import { type Component, type KeybindingsManager, type TUI } from '@earendil-works/pi-tui'; import type { ClientToBroker, GetSettingsData, GetTreeData, ListModelsData, ListScopedModelsData } from '../../../core/runtime/broker-protocol.js'; import type { ReadOpRequest } from '../../../core/broker-client/index.js'; /** A built picker overlay: the `component` to show, and the `focus` target the * caller must `setFocus` (the component itself, or the inner list that owns * `handleInput`). */ export interface Picker { component: Component; focus: Component; } /** Controls handed to a picker builder by InputController.showPicker. `close` * tears the whole picker down + restores editor focus; `replace` swaps the * CURRENTLY-mounted component for a new one IN THE SAME inline slot (no centered * overlay), focusing it — used by multi-step flows like /login, where selecting * a provider replaces the selector with the login dialog right under the editor. */ export interface PickerControls { close: () => void; replace: (component: Component, focus: Component) => void; } /** Send a command frame to the broker (= InputController hooks.onCommand). */ type Send = (frame: ClientToBroker) => void; /** Issue a correlated read-op (lazy loaders need it after construction). */ type Request = (frame: ReadOpRequest) => Promise; /** Tear the picker overlay down (owned by InputController). */ type Close = () => void; /** Surface a one-line viewer notice. */ type Notify = (message: string) => void; /** `/model` (and ctrl+l) — the real model selector with search + scope toggle. * Select → `set_model` with the resolved `provider/id` (the broker's * `findModelSpec` requires that form). */ export declare function buildModelPicker(tui: TUI, data: ListModelsData, send: Send, close: Close): Picker; /** `/resume` — the real session selector. Opens INSTANTLY and reconstructs from * async loaders that fetch each scope on demand — the component's own Loading * header covers the scan (listing a large session dir takes seconds, so the * fetch must stay off the open path). Select → `switch_session`. Rename/delete * are out of scope (no command frame). */ export declare function buildSessionPicker(tui: TUI, currentSessionFile: string | undefined, request: Request, keybindings: KeybindingsManager, send: Send, close: Close): Picker; /** `/tree` — the real tree navigator (pure data). Select → `navigate_tree`. * Label-edit is out of scope (no command frame) → no `onLabelChange`. */ export declare function buildTreePicker(tui: TUI, data: GetTreeData, send: Send, close: Close): Picker; /** `/fork` — the real prior-user-message selector (pure data, from * `get_tree.forkPoints`). Select → `fork`. The outer component has no * `handleInput`; the inner `getMessageList()` does (focus target). */ export declare function buildForkPicker(data: GetTreeData, send: Send, close: Close): Picker; /** `/settings` — the real settings menu (the wire `settings` IS a SettingsConfig * superset). Only the contract-enumerated mutations are wired: thinking level → * `set_thinking_level`, auto-compact → `set_auto_compaction`. Every other toggle * has no command frame (out of scope), so its callback notifies rather than * silently lying that the change took. The theme submenu is viewer-local (CTO). * The outer component has no `handleInput`; `getSettingsList()` is the focus * target. */ export declare function buildSettingsPicker(data: GetSettingsData, send: Send, close: Close, notify: Notify): Picker; /** `/scoped-models` — READ-ONLY via a pi-tui SelectList. CONTRACT GAP: pi (through * 0.79.1) does not re-export `ScopedModelsSelectorComponent`, and the contract * exposes no command frame for its enable/disable/persist mutations, so a * faithful editable picker is not buildable in scope. This shows the registry * with the enabled set marked; select notifies that toggling is unsupported. */ export declare function buildScopedModelsPicker(data: ListScopedModelsData, close: Close, notify: Notify): Picker; export {};