import type { LLMContextSnapshot, RunRecord } from './types'; export declare const RUN_RECORD_VERSION = 7; /** Held while a run executes; releasing it lets another executor take the run. */ export interface RunLock { release(): void | Promise; } /** A run with every snapshot, as moved between stores. */ export interface ExportedRun { record: RunRecord; /** `[index, snapshot]`, ascending. */ snapshots: [number, LLMContextSnapshot][]; } export interface RunStore { /** Runs survive this process (a directory, IndexedDB …). */ readonly persistent: boolean; runsDir(): string | undefined; runDir(runId: string): string | undefined; createRun(): Promise; writeRecord(record: RunRecord): Promise; /** Rejects with `run_not_found` / `not_resumable` (other version) / `corrupted_run`. */ readRecord(runId: string): Promise; listRecords(): Promise; /** Stores the next snapshot and returns its index (1, 2, …). */ putSnapshot(runId: string, snapshot: LLMContextSnapshot): Promise; getSnapshot(runId: string, idx: number): Promise; listSnapshots(runId: string): Promise; /** The run's execution lock, `null` when another executor holds it. */ lockRun(runId: string): Promise; /** Some executor holds the run's lock. */ isRunLive(runId: string): Promise; removeRun(runId: string): Promise; /** Write a run exported from another store (same id, same snapshot indices). */ importRun(run: ExportedRun): Promise; } /** `YYYYMMDD-HHMMSS-<6 hex>`: local time for reading, a random suffix against collisions. */ export declare function generateRunId(now?: Date): string; export declare function exportRun(store: RunStore, runId: string): Promise; export declare function importRun(store: RunStore, run: ExportedRun): Promise; export declare class MemoryRunStore implements RunStore { readonly persistent = false; private readonly records; private readonly snapshots; private readonly locks; runsDir(): string | undefined; runDir(): string | undefined; createRun(): Promise; writeRecord(record: RunRecord): Promise; readRecord(runId: string): Promise; listRecords(): Promise; putSnapshot(runId: string, snapshot: LLMContextSnapshot): Promise; getSnapshot(runId: string, idx: number): Promise; listSnapshots(runId: string): Promise; lockRun(runId: string): Promise; isRunLive(runId: string): Promise; removeRun(runId: string): Promise; importRun(run: ExportedRun): Promise; /** `exportRun` on this store. */ exportRun(runId: string): Promise; } //# sourceMappingURL=store.d.ts.map