import type { SessionControl, SessionInputQueue, TurnSelection } from "#execution/session/input-queue.js"; import type { SessionInboxReader } from "#execution/session-inbox/inbox.js"; import type { SessionStateCursor } from "#execution/session/state-cursor.js"; import type { WorkflowToolRunMessage } from "#execution/tools/workflow/messages.js"; export type NextTurnInstruction = { readonly kind: "workflow"; readonly message: WorkflowToolRunMessage; } | { readonly kind: SessionControl; } | { readonly kind: "closed"; } | { readonly kind: "cancel-turn"; } /** `session.cancel()` while no turn runs, but tasks are working. */ | { readonly kind: "cancel-working-tasks"; } | TurnSelection; /** * Waits for the next input the parked owner must act on. Fully routed * descendant deliveries leave nothing for the parent, so the wait continues. */ export declare function nextTurnDelivery(input: { readonly inbox: SessionInboxReader; readonly cursor: SessionStateCursor; readonly hasWorkingTasks: () => boolean; readonly queue: SessionInputQueue; }): Promise;