import { type ExtensionContext } from "@earendil-works/pi-coding-agent"; import { type SelectItem } from "@earendil-works/pi-tui"; /** * Sentinel value for the "use session model" (clear) popup entry. * * A non-empty, model-namespace-safe sentinel so it can never collide with a * real `"provider/modelId"` value returned by the registry. */ export declare const CLEAR_VALUE = "\0pi-autocommit-clear"; /** Label for the "use session model" (clear) popup entry. */ export declare const CLEAR_LABEL = "Use session model (clear)"; /** * Max rows the model popup shows before scrolling. * * Bounds the rendered height so the popup never overflows the terminal, * even when hundreds of models are registered. The actual height is * `Math.min(items.length, MAX_VISIBLE_MODELS)`; `SelectList` handles the * scrolling window and shows a `(n/total)` indicator when truncated. */ export declare const MAX_VISIBLE_MODELS = 10; /** * Build the popup option list as `SelectList` items: clear entry first, * then the available models. The current value is marked with `(current)`. * * The `value` is the raw `"provider/modelId"` string (or `CLEAR_VALUE`), so * the selected item round-trips directly into `saveModel` without label * parsing. */ export declare function buildModelSelectItems(ctx: ExtensionContext, currentModel: string | undefined): SelectItem[]; /** * Build the popup option list as plain strings. * * Used only by the non-TUI fallback (`ctx.ui.select`), which takes string * options. The TUI path uses `buildModelSelectItems` (SelectItem[]) with a * bounded, scrollable `SelectList` in the editor region. */ export declare function buildModelOptions(ctx: ExtensionContext, currentModel: string | undefined): string[]; /** * Show the model selector popup and return the user's choice. * * In the TUI, renders a `SelectList` in the editor region via * `ctx.ui.custom()` (non-overlay), matching pi's built-in `/model` selector * UX: the chat history stays visible above and the popup does not overlap * it. The viewport is capped at `MAX_VISIBLE_MODELS` rows and scrolls, so * the list never overflows the terminal. In non-TUI modes (e.g. RPC), falls * back to `ctx.ui.select`. * * @returns The selected model value (`provider/modelId` or `CLEAR_VALUE`), * or `null` if the user cancelled. */ export declare function showModelPopup(ctx: ExtensionContext, currentModel: string | undefined): Promise; /** * The number of visible rows the popup should render. Exposed for tests so * the bounded-viewport invariant can be asserted independently of the * `SelectList` implementation. */ export declare function modelPopupMaxVisible(items: SelectItem[]): number; //# sourceMappingURL=model-popup.d.ts.map