import type { SnapshotChecksum, SnapshotCleanupReceipt, SnapshotCounts } from '../agent-blackboard/snapshot-types.mts'; /** What the server itself recorded when it exported a snapshot. Never read from a caller. */ export type SnapshotRecord = { sessionId: string; worktree: string; path: string; /** The exporting client's own capability; kept server-side and never returned to a caller. */ clientToken?: string; /** What the export reported, so a partition verifies the file against the server's own record. */ checksum?: SnapshotChecksum; counts?: SnapshotCounts; directory?: string; receipt?: SnapshotCleanupReceipt; }; export type SnapshotRegistry = { /** Records an export and returns the server-minted, unguessable cleanup token. */ register: (record: SnapshotRecord) => string; /** Removes and returns the record when the token is known and bound to this caller. */ take: (token: string, sessionId: string, worktree: string) => SnapshotRecord; /** Puts a taken record back after a failed cleanup so the same token can retry. */ restore: (token: string, record: SnapshotRecord) => void; }; export declare const MAX_RECORDS = 256; /** * Tokens live in memory only. A server restart forgets every binding, so an old token is then * rejected as unknown. A partitioned snapshot can still be removed through `snapshot-recovery.mts`, * which proves ownership from the signed receipt on disk; a plain export file has no receipt, so * it is left for the operating system to reap from its temp directory. */ export declare function createSnapshotRegistry(): SnapshotRegistry;