/** * * Writes a JSON snapshot of the current session's state to * `_runtime//checkpoints/.json`. Idempotent — * any number of checkpoints may exist; the service prunes the oldest * beyond `MAX_CHECKPOINTS` so the directory does not grow without bound. * * Designed for skill-level invocation (NG1). The LLM is the only one * that knows when context pressure is high; the CLI is the muscle. */ export type CheckpointReason = 'context-fill' | 'periodic' | 'artifact-written' | 'user-pause' | 'user-close'; export declare const CHECKPOINT_REASONS: readonly CheckpointReason[]; export interface CheckpointSnapshot { sessionId: string; lastActivity: string; currentPlan: string; openQuestions: string[]; recentDecisions: string[]; recentArtifactPaths: string[]; gitStatus: string; skillsActive: string[]; todoState: string[]; reason: CheckpointReason; createdAt: string; } export interface CheckpointOptions { sessionId: string; reason: CheckpointReason; /** Injectable clock for deterministic tests. Returns ISO timestamp. */ now?: () => Date; currentPlan?: string; openQuestions?: string[]; recentDecisions?: string[]; recentArtifactPaths?: string[]; gitStatus?: string; skillsActive?: string[]; todoState?: string[]; } export declare function isValidCheckpointReason(value: string): value is CheckpointReason; export interface CheckpointWriteResult { path: string; sessionId: string; reason: CheckpointReason; createdAt: string; pruned: string[]; totalRetained: number; } export declare function writeCheckpoint(projectRoot: string, options: CheckpointOptions): CheckpointWriteResult; export declare function readCheckpoint(path: string): CheckpointSnapshot; export declare function listCheckpointPaths(projectRoot: string, sessionId: string): string[]; export declare function latestCheckpointPath(projectRoot: string, sessionId: string): string | null; export declare const CHECKPOINT_CONSTANTS: { readonly CHECKPOINTS_DIR: "checkpoints"; readonly CHECKPOINT_FILENAME_EXT: ".json"; readonly MAX_CHECKPOINTS: 10; };