/** * The run row and its audit event: the write that never overwrites a terminal * row, the terminal landing every door ends on, and the stopped check an * in-flight run interleaves with. * * ONE ledger. The owner / agent / automation / console views are FILTERS over * it — but only the two keys `vendo_runs` DECLARES are refs (routing.ts), and a * run names no subject of its own. Owner and agent are read off the row by * `runs.list`; writing them here as refs no store would answer is what made * `runs.list({ owner })` throw. */ import { type Json, type RunContext, type Step, type ToolOutcome } from "@vendoai/core"; import type { EngineBase } from "./engine-context.js"; import type { RunRecord, RunStatus } from "./index.js"; import { type InternalRunRecord } from "./types.js"; export type RunRowsDeps = { base: EngineBase; }; export interface RunRowsAccess { /** A `run`-kind audit event under the run's own away context. */ audit(ctx: RunContext, status: string, extra?: Record): Promise; /** The run row write that never overwrites a terminal row. */ writeRun(record: InternalRunRecord): Promise; /** The terminal landing every door ends on. */ terminal(run: InternalRunRecord, ctx: RunContext, status: Extract, summary: string, error?: NonNullable): Promise; /** Append one step outcome to the in-flight run. */ appendOutcome(run: InternalRunRecord, step: Step, outcome: ToolOutcome): void; /** Land the run on the failure a step's own expressions produced. */ failStep(run: InternalRunRecord, ctx: RunContext, step: Step, error: unknown): Promise; /** Whether this run has already ended — stopped here, or terminal on disk. */ finishStoppedIfNeeded(run: InternalRunRecord): Promise; } export declare const createRunRows: ({ base: { config, engine, iso, stopped } }: RunRowsDeps) => RunRowsAccess; //# sourceMappingURL=run-rows.d.ts.map