import type { TodoItem } from '../core/context.js'; import type { ConversationState } from '../core/conversation-state.js'; import type { EventBus } from '../kernel/events.js'; /** * On-disk checkpoint for `ctx.todos`. Written atomically every time the * todo list changes, read once on session resume. This is the missing * piece that lets `wstack resume ` rehydrate where the previous run * stopped instead of starting with an empty board. * * Schema is intentionally small — a single JSON object so a future * format bump is easy. The `version` field is the only contract; the * shape under `todos` mirrors `TodoItem` so reading is a straight assign. */ export interface TodosCheckpointFile { version: 1; sessionId: string; updatedAt: string; todos: TodoItem[]; } export type TodosCheckpointDetach = () => Promise; /** Read a checkpoint from disk. Returns null when the file doesn't * exist or is corrupt — callers treat both cases as "no prior state". */ export declare function loadTodosCheckpoint(filePath: string, events?: EventBus, traceId?: string): Promise; /** Write the checkpoint atomically. Best-effort: a write failure is * logged but does not throw — losing one checkpoint shouldn't bring * down the agent run. */ export declare function saveTodosCheckpoint(filePath: string, sessionId: string, todos: readonly TodoItem[], events?: EventBus, traceId?: string, warn?: (msg: string) => void): Promise; /** * Subscribe a `ConversationState` so every `todos_replaced` mutation * triggers an atomic write to disk. Returns the unsubscribe function. * * Writes are debounced by 150ms so a flurry of edits (e.g. the LLM * marking three items done in the same tool call) coalesces into one * disk hit. */ export declare function attachTodosCheckpoint(state: ConversationState, filePath: string, sessionId: string, events?: EventBus, traceId?: string, warn?: (msg: string) => void): TodosCheckpointDetach; //# sourceMappingURL=todos-checkpoint.d.ts.map