import type { RunEvent, RunResult } from "../../engine/types.ts"; import type { Questionnaire } from "../../flow/questionnaire.ts"; import { type ProgressSink } from "../progress-sink.ts"; import type { RunLock } from "../run-lock.ts"; import type { RunStore } from "../types.ts"; import { type CommandCtx, type StartAgent } from "./context.ts"; /** A blocked step's pending batch plus the node path (spec §8.5) that batch belongs to. */ export interface PendingAsk { readonly path: string; readonly questionnaire: Questionnaire; } /** * Render the pending questionnaire (rich `ctx.ui.custom` form when a TUI is present, native dialogs * otherwise — see {@link collectAnswers}), collect structured answers, and continue via * `resumeWithAnswer` — looping while it re-blocks. * * The answers are delivered to the exact `path` whose questions were just shown, never to whichever * block the engine's own default would pick: under concurrency several steps can be blocked at once * (spec §8.6), and a step that RE-blocks (invalid answers, or a follow-up batch) becomes the most * recently asked while a sibling remains the earliest — so "the one just displayed" and "the FIFO-first * pending one" are genuinely different steps, and answering the latter would file the user's reply * under a question they never saw. * * Dismissing the prompt leaves the run `blocked` (dismiss ≠ cancel, spec §10.2). The guard is acquired * only around each resume execution, so while blocked/prompting it is released and does not block new * runs (spec §7.1). */ export declare function handleAttendedQuestionnaire(ctx: CommandCtx, store: RunStore, guard: RunLock, workflowName: string, workflowFilePath: string, startAgent: StartAgent, runId: string, initialAsk: PendingAsk | undefined, /** The invocation's sink, shared across every resume in this loop so the widget survives the block (progress §7.5). */ progress?: ProgressSink): Promise; /** The block a `blocked` {@link RunResult} is reporting — its questions together with the path they belong to. */ export declare function askOf(result: RunResult): PendingAsk | undefined; /** * The block a `/workflow resume` should show first: the FIFO-first currently-blocked one (spec §8.6). * With several steps blocked at once, the path travels with the questions so the answer is delivered * back to the step that asked them. */ export declare function pendingAsk(events: readonly RunEvent[]): PendingAsk | undefined; //# sourceMappingURL=attended.d.ts.map