/** * Model selector component for switching between available models. * Uses pi-tui overlay pattern with search and fuzzy filtering. */ import { Box, Input } from '@mariozechner/pi-tui'; import type { Focusable, TUI } from '@mariozechner/pi-tui'; export interface ModelItem { /** Full model ID (e.g., "anthropic/claude-sonnet-4") */ id: string; /** Provider name (e.g., "anthropic") */ provider: string; /** Model name without provider (e.g., "claude-sonnet-4") */ modelName: string; /** Whether the API key for this provider is available */ hasApiKey: boolean; /** Environment variable name for the API key (e.g., "ANTHROPIC_API_KEY") */ apiKeyEnvVar?: string; /** Number of times this model has been selected (for ranking) */ useCount?: number; } export interface ModelSelectorOptions { /** TUI instance for rendering */ tui: TUI; /** List of available models */ models: ModelItem[]; /** Currently selected model ID */ currentModelId?: string; /** Optional title for the selector */ title?: string; /** Optional hex color for the title background (e.g. mode color) */ titleColor?: string; /** Callback when a model is selected */ onSelect: (model: ModelItem) => void; /** Callback when selection is cancelled */ onCancel: () => void; } /** * Build a synthetic "Use: " ModelItem for an arbitrary model id typed by * the user. The provider prefix is parsed from the id; key metadata is * derived from any sibling model that already lives under the same provider * so the API-key prompt still fires for known providers without a key. * * If no sibling is found (truly novel provider), we default `hasApiKey: false` * so the user is still prompted for a key by provider name. */ export declare function makeCustomModelItem(id: string, models: ModelItem[]): ModelItem; export declare class ModelSelectorComponent extends Box implements Focusable { private searchInput; private listContainer; private allModels; private filteredModels; private selectedIndex; private currentModelId?; private onSelectCallback; private onCancelCallback; private tui; private title; private titleColor?; private _focused; get focused(): boolean; set focused(value: boolean); constructor(options: ModelSelectorOptions); private buildUI; private sortModels; /** Whether the custom "Use: ..." item is showing at the top */ private hasCustomItem; private filterModels; private makeCustomModelItem; private updateList; handleInput(keyData: string): void; private handleSelect; getSearchInput(): Input; } //# sourceMappingURL=model-selector.d.ts.map