UNPKG

histoire

Version:

A fast story book powered by Vite

28 lines • 2.07 kB
import type { JobState } from '@histoire/shared'; import type { ProjectSnapshot } from './snapshot.js'; /** Retains completed recovery bytes for ten minutes after handoff or failure. */ export declare const JOB_RECEIPT_TTL_MS: number; /** Private disk recovery state; never serialized to the browser. */ export interface JobReceipt { /** Public bounded job snapshot. */ job: JobState; /** Receipt retention deadline. */ expires: number; /** Process owning execution, for crash recovery. */ pid: number; /** Loaded context that initiated the change; cannot consume its own handoff. */ generation?: string; /** Exact reviewed config revision expected after commit. */ configHash?: string; /** Original config revision distinguishes a failed pre-write handoff. */ originalConfigHash?: string; /** Package rollback bytes, persisted before spawning. */ snapshot?: ProjectSnapshot; /** Recovery persisted before watched write or package-only restart; successor verifies revision. */ handoff?: boolean; } /** Writes recovery before handing off, retaining a tiny pointer to the latest job. */ export declare function writeReceipt(root: string, receipt: JobReceipt): Promise<void>; /** Reads bounded private recovery data, rejecting malformed state instead of executing it. */ export declare function readReceipt(root: string): Promise<JobReceipt | undefined>; /** Reclaims every expired superseded terminal record, retaining latest and live work. */ export declare function sweepReceipts(root: string): Promise<void>; /** Acquires a cross-process lane before plan verification or any project mutation. */ export declare function claimJob(root: string, jobId: string): Promise<void>; /** Releases only the lane belonging to this exact job, never a successor's lock. */ export declare function releaseJob(root: string, jobId: string): Promise<void>; /** Removes an expired terminal receipt without deleting a newer job's state. */ export declare function expireReceipt(root: string, jobId: string): Promise<void>; //# sourceMappingURL=receipt.d.ts.map