import { PiHostUiRequest, PiHostUiResponse } from "../types.js"; import { ExtensionUIContext } from "@earendil-works/pi-coding-agent"; //#region src/node/extensionUi.d.ts /** Thrown by `custom()` — the one host-UI method with no headless degradation * (it renders an arbitrary interactive TUI component). This gives extensions a * typed unsupported issue they can catch rather than hanging. */ export declare class PiUnsupportedHostUiError extends Error { readonly method: string; constructor(method: string); } export interface SupervisorUiBridgeDeps { /** Allocate a fresh, per-thread-unique request id. */ nextRequestId: () => string; /** Single-tool causality: the executing tool's id iff exactly one tool is * running, else undefined. The bridge stamps it verbatim and never infers. */ currentToolCallId: () => string | undefined; /** Emit a blocking request to subscribers (→ `extension_ui_request`). */ emitRequest: (request: PiHostUiRequest) => void; /** Emit resolution to subscribers (→ `extension_ui_resolved`). */ emitResolved: (requestId: string) => void; /** Optional sink for non-blocking `notify` messages. */ onNotify?: (message: string, type: "info" | "warning" | "error") => void; } export interface SupervisorUiBridge { /** The `ExtensionUIContext` to bind via `session.bindExtensions`. */ readonly ui: ExtensionUIContext; /** Currently-pending blocking requests (survive reconnect — tracked here, not * on any client connection). Oldest first. */ pending: () => PiHostUiRequest[]; /** Resolve a pending request from a client response. Returns false if the id * is unknown (already resolved or never existed). */ resolve: (response: PiHostUiResponse) => boolean; /** Settle every pending request as dismissed (e.g. on session teardown). */ dismissAll: () => void; } export declare const createSupervisorUiBridge: (deps: SupervisorUiBridgeDeps) => SupervisorUiBridge; //#endregion //# sourceMappingURL=extensionUi.d.ts.map