import type { SessionLocator, SessionPaths } from '../../session/paths.js'; import type { CheckpointId } from '../../types/ids/index.js'; import type { Checkpoint } from '../../types/session/checkpoint.js'; import { type CheckpointLogView, type CheckpointScope, type CheckpointWriteReceipt, type SessionCheckpointStore } from './contract.js'; export interface DiskSessionCheckpointStoreOptions { /** The project whose sessions hold the checkpoints. */ readonly paths: SessionPaths; /** The session log the checkpoints are verified and protected against. */ readonly log: CheckpointLogView; /** * The session this store answers for, with its ancestors when it is a * child session. A scope for that session that names no `ancestors` is * placed by this locator, so a child's checkpoints land in * `/subagents//checkpoints/` even when the * caller building the scope knows only the session id. A scope that names * its own `ancestors` is placed by them. */ readonly session?: SessionLocator; } /** * {@link SessionCheckpointStore} at `/checkpoints/.json`. * * A write is durable before it resolves: the document is written to a private * sidecar, fsynced, linked to its final name (which fails rather than * replacing an existing document), and the directory is fsynced. When the * write creates `checkpoints/` (or any directory above it), the parent of each * directory it created is fsynced too, so the new directory's own entry * survives as well as the document's. The caller * appends `checkpoint_written` only after that, so the record never names a * file a power loss could take back. * * Directories are mode 0700 and documents 0600. */ export declare class DiskSessionCheckpointStore implements SessionCheckpointStore { #private; constructor(options: DiskSessionCheckpointStoreOptions); write(scope: CheckpointScope, checkpoint: Checkpoint): Promise; read(scope: CheckpointScope, checkpointId: CheckpointId): Promise; restore(scope: CheckpointScope, checkpointId: CheckpointId): Promise; list(scope: CheckpointScope): Promise; delete(scope: CheckpointScope, checkpointId: CheckpointId): Promise; prune(scope: CheckpointScope, keepLast: number): Promise; } //# sourceMappingURL=disk.d.ts.map