import type { RunEvent, RunResult } from "../../engine/types.ts"; import type { RunStore } from "../types.ts"; /** * The `--result-out` artifact: what the run's own record knows at its terminal state. `output` is * the engine's `RunResult.output` (the workflow's final node output); `steps` collects every * completed step's output by its node path from the persisted log — the structured result a batch * consumer wants without having to learn the event-log format. */ export interface RunResultArtifact { readonly runId: string; readonly workflowName: string; readonly status: RunResult["status"]; readonly output: unknown; readonly steps: Record; readonly error?: string; readonly path?: string; } export declare function resultArtifact(result: RunResult, workflowName: string, events: readonly RunEvent[]): RunResultArtifact; /** * Persist the artifact, creating parent directories. Returns the failure text when the write fails — * never throws: a result file that cannot land must not reclassify a run that already finished, so * the caller warns and keeps the run's outcome. */ export declare function writeResultArtifact(filePath: string, artifact: RunResultArtifact): Promise; /** * The one operation both `--result-out` surfaces perform: relative paths resolve against the * invocation's cwd, the artifact is built from the run's own persisted log, and the failure text — * not an exception — comes back for the caller to warn with. */ export declare function writeRunResultArtifact(store: Pick, cwd: string, resultOut: string, runId: string, workflowName: string, result: RunResult): Promise; //# sourceMappingURL=result-artifact.d.ts.map