export declare const CHECKPOINT_INTERVAL_MS: number; export declare const CHECKPOINT_WORKER_TIMEOUT_MS = 8000; export declare const CHECKPOINT_LOCK_STALE_MS = 15000; export declare const CHECKPOINT_MAX_WORKERS = 4; export interface CheckpointInput { session_id?: string; sessionId?: string; cwd?: string; workspaceRoot?: string; last_assistant_message?: string; } export interface CheckpointOptions { home?: string; now?: number; /** Capture now even when the last checkpoint is under five minutes old (a session handing off). */ force?: boolean; /** Why the capture was made; shown in the checkpoint document. */ reason?: string; } export interface CheckpointReceipt { version: 1; sessionId: string; cwd: string; savedAt: string; docPath: string; diffPath: string; incrementId?: string; /** Set when SpecWeave Studio ran the session; Studio reads `studio/.json`. */ studioThreadId?: string; /** First line of the session's last message, for `specweave handoff list`. */ title?: string; } /** Written beside `current.json` when a session hands off through its checkpoint (it hit the limit). */ export declare const SESSION_HANDOFF_FILE = "handoff.json"; /** Written beside it when `specweave pickup` takes that handoff. */ export declare const SESSION_PICKED_FILE = "picked.json"; export interface SessionHandoffMark { version: 1; at: string; by?: string; reason?: string; } export interface CheckpointRequest { version: 1; sessionId: string; cwd: string; directory: string; generation: string; token: string; slot: string; summary?: string; studioThreadId?: string; reason?: string; } /** Resolve symlinks and the nearest Git worktree without invoking Git in the hook. */ export declare function checkpointIdentity(input: CheckpointInput): { sessionId: string; cwd: string; } | undefined; export declare function checkpointsDirectory(home?: string): string; export declare function checkpointDirectory(input: CheckpointInput, opts?: CheckpointOptions): string | undefined; /** Where Studio finds the newest checkpoint of one of its threads, whichever provider wrote it. */ export declare function studioCheckpointFile(threadId: string, home?: string): string; export declare function readSessionCheckpoint(input: CheckpointInput, opts?: CheckpointOptions): CheckpointReceipt | undefined; /** * The newest checkpoint any session saved for `cwd` (resolved like the hooks * resolve it), so `pickup` can offer it after a session died at the limit. */ export declare function latestCheckpointFor(cwd: string, opts?: CheckpointOptions): CheckpointReceipt | undefined; /** @internal Reserve a bounded worker slot and persist only scrubbed worker input. */ export declare function prepareSessionCheckpoint(input: CheckpointInput, opts?: CheckpointOptions): string | undefined; /** First sentence of the session's last message, without markdown, at most 100 characters. */ export declare function summaryTitle(summary?: string): string | undefined; /** * Mark this session's checkpoint as a handoff: the session hit the limit and * cannot write an increment handoff of its own (several increments are active, * or it worked in a worktree or nested repository). `specweave handoff list` * shows it until `specweave pickup` takes it. Returns the checkpoint directory. */ export declare function markSessionHandoff(input: CheckpointInput, mark: Omit & { at?: string; }, opts?: CheckpointOptions): string | undefined; /** * Drop this session's handoff mark once it works again (its limit reset and it * went on), so `pickup` does not offer work its own session already continued. */ export declare function clearSessionHandoff(input: CheckpointInput, opts?: CheckpointOptions): void; /** Queue at most one capture per session/worktree and four per user. All errors fail open. */ export declare function queueSessionCheckpoint(input: CheckpointInput, opts?: CheckpointOptions): void; /** Called by the supervisor on success, failure, or its hard deadline. */ export declare function cleanupCheckpointRequest(requestPath: string): void; /** Worker entry: publish the receipt last, so interruption leaves the previous snapshot usable. */ export declare function runSessionCheckpoint(requestPath: string): Promise; //# sourceMappingURL=session-checkpoint.d.ts.map