/** The slice of an execution context the caller's signals act on. */ export type SignalTarget = { pauseRequested: boolean; cancel: (reason?: string) => void; }; /** The two handles a host may pass into a run. */ export type ExternalSignals = { abortSignal?: AbortSignal; pauseSignal?: AbortSignal; }; type Detach = () => void; /** Wire a caller's cancel signal to an execution context. An already-aborted * signal throws at once; a later abort cancels the context, which tears * down in-flight LLM requests. Returns a detach function the entry calls * when it returns, so a host controller that outlives the run holds no * reference to the context. */ export declare function attachAbortSignal(target: SignalTarget, signal?: AbortSignal): Detach; /** Wire a caller's pause signal to an execution context. Firing it only sets * a flag; the runner stops at its next statement boundary. Returns a detach * function, as attachAbortSignal does. */ export declare function attachPauseSignal(target: SignalTarget, signal?: AbortSignal): Detach; /** Run `body` with the caller's signals wired to `target`, and unwire them * however the body ends. */ export declare function withExternalSignals(target: SignalTarget, signals: ExternalSignals, body: () => Promise): Promise; export {};