/**
 * Run Checkpoint Store — durable crash-restart recovery for in-flight workflow runs (plan §M3).
 *
 * The runtime's output cache is content-addressed (key = hash(kind + params + input signature +
 * runIndex), spec §A5). Persisting that cache to disk turns run-from-node into crash recovery:
 * after a qlogicagent restart, a FRESH WorkflowRuntime replays the same DAG, recomputes the same
 * cache keys, and hits the persisted entries for every node that already completed — so those
 * executors are NOT re-invoked (no duplicate agent turns / channel sends), and only the
 * not-yet-run remainder executes. This is exactly the M3 acceptance:
 * "qlogicagent 崩溃重启从 checkpoint 恢复在跑工作流".
 *
 * Stored at `<project>/.qlogicagent/workflows/<workflowId>/runs/<runId>/cache.json`.
 * NodeExecResult is JSON (PortMap of DataItems + firedPorts), so the snapshot round-trips losslessly.
 *
 * fail-loud: a corrupt/unreadable snapshot is treated as absent (a fresh run), never silently
 * partially applied.
 */
import type { NodeExecResult } from "./node-schema.js";
/** One persisted cache entry: a content key and the executor result it produced. */
export interface CheckpointEntry {
    key: string;
    result: NodeExecResult;
}
/** A point-in-time snapshot of a run's content-addressed output cache. */
export interface CheckpointSnapshot {
    workflowId: string;
    runId: string;
    entries: CheckpointEntry[];
    updatedAt: string;
}
/**
 * Durable run state the runtime loads on (re)start and persists after each computed node.
 * Implementations may be file-backed (production) or in-memory (tests).
 */
export interface RunCheckpoint {
    /** Load the prior snapshot, or undefined for a never-started / absent run. */
    load(): Promise<CheckpointSnapshot | undefined>;
    /** Persist the full set of computed cache entries (idempotent overwrite). */
    persist(entries: CheckpointEntry[]): Promise<void>;
    /** Remove the snapshot once the run has completed successfully. */
    clear(): Promise<void>;
}
/** File-backed checkpoint under `.qlogicagent/workflows/<id>/runs/<runId>/cache.json`. */
export declare class FileRunCheckpoint implements RunCheckpoint {
    private readonly workflowId;
    private readonly runId;
    private readonly dir;
    private readonly file;
    constructor(cwd: string, workflowId: string, runId: string);
    load(): Promise<CheckpointSnapshot | undefined>;
    persist(entries: CheckpointEntry[]): Promise<void>;
    clear(): Promise<void>;
}
