import { KeybindingsManager, type TUI } from '@earendil-works/pi-tui'; import type { RpcExtensionUIRequest, RpcExtensionUIResponse } from '../../../core/runtime/broker-protocol.js'; /** Handle for a rendered dialog: tear it down (without responding) when the * request is superseded — e.g. the broker resolves it on its own timeout, or a * control handoff re-routes it. */ export interface DialogHandle { dismiss(): void; } /** The 4 user-blocking dialog methods. Other RpcExtensionUIRequest methods are * non-blocking display ops; callers handle them before rendering a dialog. */ export declare function isBlockingDialog(req: RpcExtensionUIRequest): boolean; /** * Render a blocking extension dialog as a focused overlay over `tui`, and resolve * by invoking `onRespond` with the matching `extension_ui_response` (or a * `cancelled` response on user-cancel/timeout). Returns a {@link DialogHandle} * whose `dismiss()` removes the overlay without responding (idempotent; safe to * call after the dialog already resolved). * * @param keybindings - used only by the `editor` dialog, which calls * `keybindings.matches(key, "app.editor.external")` for the Ctrl+G external-editor * shortcut. Defaults to a fresh `KeybindingsManager(TUI_KEYBINDINGS)` — that * knows the base TUI bindings but not pi's app-level `app.editor.external`, so * Ctrl+G is inert until the input controller (T6) passes the app keybindings * manager. `ExtensionEditorComponent` is typed against pi's CORE * KeybindingsManager (a subclass of pi-tui's), so we widen via the constructor's * own parameter type rather than importing the core class (type-only export). */ export declare function renderDialog(tui: TUI, req: RpcExtensionUIRequest, onRespond: (resp: RpcExtensionUIResponse) => void, keybindings?: KeybindingsManager): DialogHandle;