/** * Input multiplexer — merges harness-injected inputs (scheduler firings, * goal continuations) with the driver's own input source. * * Injected inputs are delivered ONLY at turn boundaries: the agent loop * calls getUserInput() between turns and queued items win the race there. * Nothing is ever pushed mid-turn — turn structure, permission prompts, * and prompt-cache behavior stay intact. * * The base input promise is held across calls: when the driver is parked * waiting for the user (interactive TUI, idle) and a scheduled prompt * arrives, the injected item is returned immediately while the pending * user input keeps waiting and is delivered at the next boundary. The * user's typing is never dropped. */ export interface InputMultiplexer { /** Drop-in replacement for the driver's getUserInput. */ getUserInput: () => Promise; /** Queue a synthetic input for the next turn boundary. */ enqueue: (text: string, opts?: { priority?: boolean; }) => void; /** Number of injected inputs currently waiting. */ pending: () => number; } export declare function createInputMultiplexer(base: () => Promise): InputMultiplexer;