/** * Resume entry points for the deterministic engine (spec §8). Rebuild run state purely from the * recorded event log — no filesystem, no PI, no network. * * Two distinct resume paths (spec §8.4): * - `resumeWorkflow` — for `crashed`/`cancelled` runs: node-atomic re-run (spec §8.2/§8.3). Skip * completed top-level nodes and re-run the first incomplete node wholesale (a foreach among them * still skips its own completed items, spec §8.2). * - `resumeWithAnswer` — for a `blocked` run: the §8.4/§8.5 same-loop path. A block is legal anywhere * in the node tree — inside a loop, foreach, branch arm, parallel, or nested workflow — so this * navigates straight to that exact position (re-entry, spec §8.5) and continues the SAME agent loop * with the answers appended, rather than restarting the enclosing node and re-asking. Under * concurrency several steps may be blocked at once (spec §8.6): an explicit `path` (or, by default, * the FIFO-first currently-pending one) selects WHICH; every other pending block is left untouched * and, if still pending afterward, reported back instead of the construct's final output. */ import { type WorkflowDefinition } from "../flow/types.ts"; import type { HostPort, RunEvent, RunOptions, RunResult } from "./types.ts"; type QuestionnaireAskedEvent = Extract; export declare function resumeWorkflow(workflow: WorkflowDefinition, priorEvents: readonly RunEvent[], host: HostPort, options?: RunOptions): Promise; /** * Resume a `blocked` run by delivering the user's structured `answers` (spec §8.4/§8.5). Re-enters * the blocked step's exact position — however deeply nested — and continues its SAME loop: an agent * step re-batches or emits `{result}`; a questionnaire step reassembles + validates the answers into * its output. On another `{questions}` the run re-blocks at that same position. * * `options.path` selects WHICH pending block to answer when several are open at once (spec §8.6); * omitted, it defaults to the FIFO-first (earliest-asked) currently-pending one. Every OTHER pending * block is left exactly as it was — not re-asked, not silently dropped — and if still pending once the * target settles, IT is what this call reports back (rather than the construct's assembled output). */ export declare function resumeWithAnswer(workflow: WorkflowDefinition, priorEvents: readonly RunEvent[], answers: Record, host: HostPort, options?: RunOptions & { path?: string; }): Promise; /** * Every step CURRENTLY blocked (spec §8.6), each resolved to its own latest `questionnaire-asked` * event, in FIFO order (earliest-asked first — the order these events appear in the log; not * completion order, spec §4.2). Empty when nothing is pending. This is what makes "several steps * blocked at once" answerable one at a time: the default target when `resumeWithAnswer` is called * with no explicit `path`, and the source of `pendingBlocks` (every OTHER pending one, left untouched). * * Exported so a host's attended loop (spec §10.2) can show the SAME question it will actually deliver * an answer to — `pendingQuestionnaire`-singular (the last EVER asked, regardless of current state) is * wrong once more than one step can be blocked at once, since it can disagree with which one * `resumeWithAnswer`'s own default (`path` omitted) targets. */ export declare function pendingQuestionnaires(priorEvents: readonly RunEvent[]): QuestionnaireAskedEvent[]; export {}; //# sourceMappingURL=resume-workflow.d.ts.map