/** * Workflow engine: loads a workflow script (plain JS, `export default * async (ctx) => …`), injects the ctx API, enforces the caps, transcripts every * step to `.harnery/workflows//transcript.jsonl`, and returns a RunReport. * * Guarantees the engine makes (the pitch, in code): * - **Bounded**: hard total-agent ceiling + bounded parallel() concurrency. * A runaway loop hits `maxAgents` and the run fails loud, not silently. * - **Terminating**: the run is over when the script's default export * returns. There is no recursive self-spawning path: subagents are leaf * processes; only the top-level script can spawn. * - **Schema-gated**: with `schema`, an agent's reply must strict-parse and * validate; failures re-prompt with the validation errors appended, up to * `maxAttempts`, then throw. Routing decisions read validated fields, so * the deterministic script — not a model — decides what runs next. * - **Transcripted**: every stage/agent start+end lands in the run transcript with * cost, duration, and child session id (the resume + web-UI substrate). */ import type { EngineOpts, RunReport } from "./types.js"; export declare class WorkflowRunError extends Error { readonly runId: string; readonly proofPath: string; constructor(message: string, runId: string, proofPath: string, cause?: unknown); } export declare class WorkflowParkedError extends Error { readonly runId: string; readonly approvalId: string; readonly transcriptPath: string; constructor(message: string, runId: string, approvalId: string, transcriptPath: string); } /** Thrown by ctx.blocked(). Carries the run out of the script and into the * failure path, where its presence — not its message — is what stamps the proof * with class "decision". A script cannot fake this by throwing an ordinary * Error with a suggestive message, which is the point: the class has to mean * "the script deliberately declared this", not "the text looked like it". */ export declare class WorkflowBlockedError extends Error { readonly reason: string; readonly decisionId?: string; constructor(reason: string, decisionId?: string); } export declare function runWorkflow(scriptPath: string, opts: EngineOpts): Promise; //# sourceMappingURL=engine.d.ts.map