import type { WorkflowDefinition, WorkflowEngineOptions, WorkflowRunResult } from "./types.js"; /** * Executes a workflow graph step by step. Agent steps are delegated to the * configured executor; compute/action/checkpoint nodes run inline. Every * state transition is persisted to the run bundle before the engine moves on, * so a live viewer can follow along by watching the bundle directory. */ export declare class WorkflowEngine { private readonly executor; private readonly store; private readonly defaultNodeTimeoutMs; private readonly maxSteps; private readonly onEvent?; private readonly onRunStarted?; private readonly onRunFinishing?; private activeAbort; private cancelled; private paused; private wakePause; constructor(options: WorkflowEngineOptions); get outputRoot(): string; /** Abort the currently running node and mark the run cancelled. */ cancel(): void; /** * Request a pause. The current step finishes normally; the engine then * holds before dispatching the next node until `resume` (or `cancel`). */ pause(): void; /** Release a pause requested with `pause`. */ resume(): void; /** True when a pause has been requested or the run is already held. */ get pauseRequested(): boolean; run(workflow: WorkflowDefinition, input: unknown, options?: { workflowPath?: string; }): Promise; /** * Resolve the run title inside a cancellation and timeout boundary. This * runs before any node abort controller exists, so without it a hung async * `title` callback would leave the session permanently occupied. */ private resolveTitleBounded; private createRunState; private executeGraph; /** * Hold the run at the step boundary while a pause is in effect. Pausing * never interrupts a node mid-flight; it only delays the next dispatch. */ private holdWhilePaused; private routeAfterFailure; private recordAttempt; private executeNode; private outcomeForError; private createNodeResult; private runNodeWithTimeout; private dispatchNode; private createNodeContext; private runAgentNode; private acceptSubmission; private runActionNode; private persist; private finishRun; } /** * The step contract appended to every agent-node prompt. This is the * documented standard for how the model completes a workflow step. */ export declare function appendStepContract(prompt: string, workflowName: string, nodeId: string, attemptId: string, expectedOutput: string | undefined): string;