import type { Component, TUI } from "@oh-my-pi/pi-tui"; import { KeybindingsManager } from "../../config/keybindings"; import type { ExtensionUIContext, ExtensionUIDialogOptions, ExtensionWidgetContent, ExtensionWidgetOptions, TerminalInputHandler } from "../../extensibility/extensions"; import { type Theme } from "../../modes/theme/theme"; import type { InteractiveModeContext } from "../../modes/types"; export declare class ExtensionUiController { #private; private ctx; constructor(ctx: InteractiveModeContext); /** * Initialize the hook system with TUI-based UI context. */ initHooksAndCustomTools(): Promise; setHookWidget(key: string, content: ExtensionWidgetContent, options?: ExtensionWidgetOptions): void; initializeHookRunner(uiContext: ExtensionUIContext, _hasUI: boolean): void; createBackgroundUiContext(): ExtensionUIContext; /** * Emit session event to all extension tools. */ emitCustomToolSessionEvent(reason: "start" | "switch" | "branch" | "tree" | "shutdown", previousSessionFile?: string): Promise; /** * Show a tool error in the chat. */ showToolError(toolName: string, error: string): void; /** * Set hook status text in the footer. */ setHookStatus(key: string, text: string | undefined): void; /** * Show a selector for hooks. */ showHookSelector(title: string, options: string[], dialogOptions?: ExtensionUIDialogOptions): Promise; /** * Hide the hook selector. */ hideHookSelector(): void; /** * Show a confirmation dialog for hooks. */ showHookConfirm(title: string, message: string): Promise; /** * Show a text input for hooks. */ showHookInput(title: string, placeholder?: string, dialogOptions?: ExtensionUIDialogOptions): Promise; /** * Hide the hook input. */ hideHookInput(): void; /** * Show a multi-line editor for hooks (with Ctrl+G support). */ showHookEditor(title: string, prefill?: string, dialogOptions?: ExtensionUIDialogOptions, editorOptions?: { promptStyle?: boolean; }): Promise; /** * Hide the hook editor. */ hideHookEditor(): void; /** * Show a notification for hooks. */ showHookNotify(message: string, type?: "info" | "warning" | "error"): void; /** * Show a custom component with keyboard focus. */ showHookCustom(factory: (tui: TUI, theme: Theme, keybindings: KeybindingsManager, done: (result: T) => void) => (Component & { dispose?(): void; }) | Promise, options?: { overlay?: boolean; }): Promise; /** * Show an extension error in the UI. */ addExtensionTerminalInputListener(handler: TerminalInputHandler): () => void; clearHookWidgets(): void; clearExtensionTerminalInputListeners(): void; showExtensionError(extensionPath: string, error: string): void; }