/** * Checkpoints - Snapshot session/run state for recovery */ export interface CheckpointData { id: string; name: string; timestamp: Date; sessionId?: string; runId?: string; agentId?: string; state: Record; messages?: any[]; metadata?: Record; } export interface CheckpointConfig { storage?: CheckpointStorage; autoSave?: boolean; autoSaveInterval?: number; maxCheckpoints?: number; } export interface CheckpointStorage { save(checkpoint: CheckpointData): Promise; load(id: string): Promise; list(): Promise; delete(id: string): Promise; clear(): Promise; } /** * In-memory checkpoint storage */ export declare class MemoryCheckpointStorage implements CheckpointStorage { private checkpoints; save(checkpoint: CheckpointData): Promise; load(id: string): Promise; list(): Promise; delete(id: string): Promise; clear(): Promise; } /** * File-based checkpoint storage */ export declare class FileCheckpointStorage implements CheckpointStorage { private dirPath; constructor(dirPath: string); private ensureDir; private getFilePath; save(checkpoint: CheckpointData): Promise; load(id: string): Promise; list(): Promise; delete(id: string): Promise; clear(): Promise; } /** * Checkpoint Manager class */ export declare class CheckpointManager { private config; private storage; private autoSaveTimer?; private currentState; constructor(config?: CheckpointConfig); /** * Create a checkpoint */ create(name: string, options?: Partial): Promise; /** * Restore from a checkpoint */ restore(id: string): Promise; /** * Restore the latest checkpoint */ restoreLatest(): Promise; /** * Get a checkpoint by ID */ get(id: string): Promise; /** * List all checkpoints */ list(): Promise; /** * Delete a checkpoint */ delete(id: string): Promise; /** * Clear all checkpoints */ clear(): Promise; /** * Update current state */ setState(state: Record): void; /** * Get current state */ getState(): Record; /** * Start auto-save */ startAutoSave(): void; /** * Stop auto-save */ stopAutoSave(): void; /** * Enforce maximum checkpoints limit */ private enforceMaxCheckpoints; /** * Export checkpoint to JSON string */ export(id: string): Promise; /** * Import checkpoint from JSON string */ import(json: string): Promise; } /** * Create a checkpoint manager */ export declare function createCheckpointManager(config?: CheckpointConfig): CheckpointManager; /** * Create file-based checkpoint storage */ export declare function createFileCheckpointStorage(dirPath: string): FileCheckpointStorage;