/** * [WHO]: Versioned agent run checkpoints and the atomic checkpoint store port * [FROM]: No external dependencies * [TO]: Consumed by policy-driven approval pause/resume adapters * [HERE]: core/lib/agent-core/src/run-checkpoint.ts - serializable at-most-once checkpoint primitives */ export interface AgentRunCheckpoint { version: 1; id: string; createdAt: number; expiresAt?: number; policyId: string; /** Index of the next policy to evaluate after this checkpoint is approved. */ resumePolicyIndex?: number; sessionId?: string; conversationBoundary?: { messageCount: number; assistantTimestamp?: number; }; toolCall: { id: string; name: string; input: unknown; }; metadata?: Record; } export interface CheckpointStore { save(checkpoint: AgentRunCheckpoint): Promise; consume(id: string, now?: number, validate?: (checkpoint: AgentRunCheckpoint) => boolean): Promise; delete(id: string): Promise; } export type CheckpointResolution = { status: "unavailable"; } | { status: "denied"; checkpoint: AgentRunCheckpoint; } | { status: "approved"; checkpoint: AgentRunCheckpoint; toolCall: AgentRunCheckpoint["toolCall"]; }; /** Atomically consumes a checkpoint and turns the human decision into resume data. */ export declare function resolveRunCheckpoint(store: CheckpointStore, id: string, decision: "approve" | "deny", now?: number): Promise; export declare class InMemoryCheckpointStore implements CheckpointStore { #private; save(checkpoint: AgentRunCheckpoint): Promise; consume(id: string, now?: number, validate?: (checkpoint: AgentRunCheckpoint) => boolean): Promise; delete(id: string): Promise; }