/** * Persistence Types * * Types for JSONL-based persistence of runs and state. */ /** * Run metadata stored in runs.jsonl */ export interface RunRecord { executionId: string; startTime: number; endTime?: number; status: "running" | "completed" | "failed" | "aborted"; actionCount: number; logFile: string; error?: string; /** SHA-256 digest of run bundle (actions + final state) for tamper evidence */ digest?: string; } /** * Action record stored in individual log files */ export interface ActionRecord { seq: number; timestamp: number; type: string; payload: unknown; } /** * State snapshot stored in state.jsonl */ export interface StateRecord { timestamp: number; executionId?: string; snapshot: Record; } /** * Query options for runs */ export interface RunQueryOptions { /** Filter runs starting after this timestamp */ after?: number; /** Filter runs starting before this timestamp */ before?: number; /** Filter by status */ status?: "running" | "completed" | "failed" | "aborted"; /** Maximum number of results */ limit?: number; } /** * Persistence configuration */ export interface PersistenceConfig { /** Base directory for persistence files (default: .gizmo) */ baseDir: string; /** Whether to enable persistence (default: true) */ enabled?: boolean; } /** * Persistence store interface */ export interface PersistenceStore { appendRun(record: RunRecord): Promise; updateRun(executionId: string, update: Partial): Promise; queryRuns(options?: RunQueryOptions): Promise; getRun(executionId: string): Promise; appendAction(executionId: string, action: ActionRecord): Promise; getActions(executionId: string): Promise; appendState(record: StateRecord): Promise; getLatestState(): Promise; queryState(options?: { after?: number; before?: number; limit?: number; }): Promise; init(): Promise; close(): Promise; } //# sourceMappingURL=types.d.ts.map