/** * Runs a single step to a validated output under its unified retry policy (spec §9), per-step budgets * (time + tokens, spec §9.3), and — for agent steps — in-session output steering (spec §9.2) and Q&A * suspension (spec §10). Pure w.r.t. the engine boundary: all agent/network coupling is behind * `host.startAgent`; all delay (backoff + budget timers) is `host.sleep`. */ import type { AgentStep, FunctionStep } from "../flow/types.ts"; import { type RunState, type StepOutcome } from "./context.ts"; import type { NodePath } from "./node-path.ts"; import type { HostPort } from "./types.ts"; /** * How an agent step's conversation begins: a `fresh` run builds the prompt from input+context; an * `answer` resume (spec §8.4) seeds the session with the blocked conversation and replays the user's * structured answers as the next turn. `elapsedMs`/`tokensUsed` (spec §9.4) are this attempt's budget * totals as of the block being answered — see `runAgentStep`'s carry-forward. */ export type AgentEntry = { kind: "fresh"; } | { kind: "answer"; answers: Record; conversation: readonly unknown[]; elapsedMs?: number; tokensUsed?: number; }; /** Run a function step under its retry + time budget (spec §9). Emits `step-retry`; the caller emits step lifecycle. */ export declare function runFunctionStep(step: FunctionStep, input: unknown, host: HostPort, state: RunState, signal: AbortSignal, parentPath: NodePath, path: string): Promise; /** * Run an agent step under its retry policy (spec §9), budgets (time + tokens, §9.3), steering (§9.2), * and Q&A (§10). `entry` selects a fresh run or an answer-resume that continues the same loop (§8.4). * Emits `step-retry`/`agent-steer`; the caller emits step lifecycle + `questionnaire-asked`. */ export declare function runAgentStep(step: AgentStep, input: unknown, host: HostPort, state: RunState, signal: AbortSignal, parentPath: NodePath, path: string, entry: AgentEntry): Promise; //# sourceMappingURL=step-runner.d.ts.map