import { type AskRender, type AskUI, type AskUserRequest } from "./ask-user-render.js"; /** * An overlay-owned renderer for a pending ask (Plan 16 Slice 3). While a * full-terminal `ctx.ui.custom` overlay (the dashboard) is mounted, pi renders * the editor-slot `ctx.ui.select/confirm/input` dialogs BENEATH the overlay — * invisible and unfocused. So when such an overlay is active it registers a * renderer here; ask() routes to it instead of `renderAskPrompt`, and the * overlay paints the prompt in its own layer where the user can actually see * and answer it. Cleared on overlay dispose → asks fall back to the editor slot. */ export type OverlayAskRenderer = (req: AskUserRequest, signal?: AbortSignal) => Promise; export declare const AskBroker: { /** True when an orchestrator UI is currently bound. */ isBound(): boolean; /** * Register (or clear, with null) the overlay-owned ask renderer. Called by a * full-terminal overlay on mount/dispose. Last registration wins; only one * overlay is ever mounted at a time in practice. */ setOverlayRenderer(renderer: OverlayAskRenderer | null): void; /** True when an overlay has registered itself to render pending asks. */ hasOverlayRenderer(): boolean; /** * Bind the orchestrator's live UI. Refcounted — call once per overlapping * dispatch scope and pair every bind() with exactly one unbind(). Prefer * withUI() for RAII safety. */ bind(ui: AskUI): void; /** Release one binding. The UI stays bound until the last overlapping scope releases. */ unbind(): void; /** * Bind `ui` for the duration of `fn`, releasing on return or throw. Safe to * nest and to overlap (parallel fan-out) because binding is refcounted. */ withUI(ui: AskUI, fn: () => Promise): Promise; /** * Marshal an ask request to the bound orchestrator UI. Serialised against * all other in-flight asks so only one dialog renders at a time. Throws if * no UI is bound. */ ask(req: AskUserRequest, signal?: AbortSignal): Promise; /** Test-only: reset module state between cases. */ _resetForTest(): void; };