import type { WorkflowToolRunMessage, WorkflowToolRunRequestMessage, WorkflowToolAuthorizationRequest } from "#execution/tools/workflow/messages.js"; import { type ChannelReader } from "#execution/tools/workflow/owner-channels.js"; /** * The run's inbox as its body sees it. Everything the body sends its session, * except the outcome, goes through the run, which relays each message before * the outcome. */ export interface WorkflowToolRunInbox { /** Messages that reached the run's inbox so far. */ readonly sent: number; send(message: Exclude): Promise; } export interface WorkflowToolRunOwnerInbox { readonly owner: WorkflowToolRunInbox; readonly reader: ChannelReader<"workflow", WorkflowToolRunMessage>; } /** Receives body messages before routing them to the waiting turn. */ export declare function openWorkflowToolRunOwnerInbox(): WorkflowToolRunOwnerInbox; /** Acknowledge only step-owned events, after delivery or deliberate discard. */ export declare function deliverWorkflowAuthorization(message: WorkflowToolRunRequestMessage & { readonly request: WorkflowToolAuthorizationRequest; }, deliver: () => Promise): Promise;