/**
 * OODA run_step persistence helpers — sprint-525:quick-2.
 *
 * Mirrors the pattern from src/router/execution-pipeline.ts (sprint-521):
 *   insertRunStep  → INSERT row with status='pending', returns stepId
 *   completeRunStep → UPDATE status='done' + leaf_hash_poseidon (Poseidon JCS)
 *   errorRunStep    → UPDATE status='error' + error_message
 *
 * Decoupled from the command-center monolith: imports computeLeafHash
 * via the SDK's own poseidon module (shipped sprint-521:quick-13).
 *
 * The DbClient interface is the minimal pg.Pool/pg.Client subset already
 * used by `agent-run-tracker.ts` — keeps the SDK pg-free at install time.
 *
 * @public
 */
import type { DbClient } from "../../tracking/agent-run-tracker.js";
import type { OODAPhaseKind } from "./types.js";
export interface InsertRunStepInput {
    type: OODAPhaseKind;
    /** Human-readable phase tag (e.g. "observe", "orient", "decide", "act"). */
    phase: string;
    stepIndex: number;
    payload?: Record<string, unknown>;
    parentStepId?: string;
}
/**
 * Insert a `run_step` row in `pending` state and return the freshly
 * minted UUID. Caller is responsible for finishing it via
 * `completeRunStep` / `errorRunStep`.
 */
export declare function insertRunStep(db: DbClient, runId: string, input: InsertRunStepInput): Promise<{
    stepId: string;
}>;
/**
 * Mark a `run_step` row as `done`, attach its final payload, and write
 * the Poseidon leaf hash for cryptographic accountability.
 *
 * The leaf hash is computed from the FINAL payload (not the pending one),
 * keeping the on-disk hash in sync with the canonical state at completion.
 */
export declare function completeRunStep(db: DbClient, stepId: string, payload: Record<string, unknown>): Promise<{
    leafHash: string;
}>;
/**
 * Mark a `run_step` row as `error` with the given error message.
 * Idempotent w.r.t. multiple error calls — last-write-wins on the message.
 */
export declare function errorRunStep(db: DbClient, stepId: string, error: Error): Promise<void>;
//# sourceMappingURL=run-step-persistence.d.ts.map