/** * InteractionChannelImpl — concrete implementation of InteractionChannel. * * Maintains a pending queue of interactions, fires onPending callbacks, * and performs auto-resolution for 'yolo' and 'deny' approval modes. */ import type { InteractionChannel, PendingInteraction, InteractionResponse } from './interaction.js'; import type { ApprovalRequestEvent, InputRequiredEvent } from './events.js'; export declare class InteractionChannelImpl implements InteractionChannel { /** Currently pending interactions, in arrival order. */ private _pending; /** Registered onPending handlers. */ private _handlers; /** * Response dispatcher injected by RunHandleImpl. * Called when the consumer responds to an interaction; the run handle * is responsible for writing the response to the agent subprocess. */ private _dispatch; /** Whether the run is still active. Set to false when the run terminates. */ private _active; /** Approval mode for auto-resolution. */ private readonly _approvalMode; constructor(approvalMode?: 'yolo' | 'prompt' | 'deny'); get pending(): PendingInteraction[]; onPending(handler: (interaction: PendingInteraction) => void): () => void; respond(id: string, response: InteractionResponse): Promise; approveAll(): Promise; denyAll(reason?: string): Promise; /** * Inject the response dispatcher. Called by RunHandleImpl during construction. */ setDispatch(dispatch: (id: string, response: InteractionResponse) => Promise): void; /** * Mark the run as terminated. Clears pending interactions (they expire). */ terminate(): void; /** * Handle an incoming approval_request event. * * If approvalMode is 'yolo', auto-approves without queuing. * If approvalMode is 'deny', auto-denies without queuing. * Otherwise, queues to pending and fires onPending handlers. * * @returns Whether the interaction was auto-resolved (true = handled internally). */ handleApprovalRequest(event: ApprovalRequestEvent): boolean; /** * Handle an incoming input_required event. * * Input interactions are always queued regardless of approvalMode. * (approvalMode only affects approval-type interactions.) */ handleInputRequired(event: InputRequiredEvent): void; private _addPending; }