import type { ChainExecution, StepResult } from "./types.js"; export declare function initStorage(): void; export declare function saveExecution(exec: ChainExecution, chainSnapshot?: string): void; /** Load the chain snapshot saved at execution start (for safe resume). */ export declare function loadChainSnapshot(executionId: string): string | null; export declare function checkpointStep(executionId: string, step: StepResult): void; export declare function loadExecution(id: string): ChainExecution | null; export declare function listExecutions(limit?: number, offset?: number): ChainExecution[]; /** Time-travel: get the full checkpoint history for an execution. */ export declare function getExecutionTimeline(executionId: string): Array<{ stepId: string; status: string; checkpointAt: string; durationMs?: number; inputTokens?: number; outputTokens?: number; }>; /** Get execution stats for a chain. */ export declare function getChainStats(chainName: string): { totalRuns: number; successRate: number; avgDurationMs: number; totalTokens: { input: number; output: number; }; }; export interface VersionMeta { id: number; versionNumber: number; message: string | null; stepCount: number | null; createdAt: string; yamlSize: number; } export interface VersionFull extends VersionMeta { yamlContent: string; } export declare function createVersion(entityType: "chain" | "pipeline", entityName: string, yamlContent: string, message?: string | null, stepCount?: number): VersionMeta; export declare function listVersions(entityType: "chain" | "pipeline", entityName: string, limit?: number, offset?: number): VersionMeta[]; export declare function getVersion(entityType: "chain" | "pipeline", entityName: string, versionNumber: number): VersionFull | null; export declare function deleteVersion(entityType: "chain" | "pipeline", entityName: string, versionNumber: number): boolean; export declare function countVersions(entityType: "chain" | "pipeline", entityName: string): number; export declare function closeStorage(): void;