UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

52 lines • 2.04 kB
import { type Model } from "@earendil-works/pi-ai"; import { Container, type Focusable, Input } from "@earendil-works/pi-tui"; import { type FavoriteModelIds } from "./model-favorites.ts"; export interface FavoriteModelsConfig { allModels: Model<any>[]; favoriteModelIds: FavoriteModelIds; currentModel?: Model<any>; } export interface FavoriteModelsCallbacks { /** Called whenever the favorite model set or order changes (session-only, no persist) */ onChange: (favoriteModelIds: FavoriteModelIds) => void | Promise<void>; /** Called when user wants to persist current selection to settings */ onPersist: (favoriteModelIds: FavoriteModelIds) => void | Promise<void>; onSelect: (model: Model<any>) => void | Promise<void>; onCancel: () => void; } /** * Component for managing favorite models for Ctrl+P cycling. * Changes are session-only until explicitly persisted with Ctrl+S. */ export declare class FavoriteModelsSelectorComponent extends Container implements Focusable { private modelsById; private allIds; private favoriteIds; /** Row order frozen at construction; membership toggles never move rows, only reorder keys do. */ private displayIds; private filteredItems; private selectedIndex; private searchInput; private currentModel?; private _focused; get focused(): boolean; set focused(value: boolean); private listContainer; private footerText; private secondaryFooterText; private callbacks; private maxVisible; private isDirty; constructor(config: FavoriteModelsConfig, callbacks: FavoriteModelsCallbacks); private buildItems; private getFooterText; private getSecondaryFooterText; private refresh; /** Mirror a favoriteIds reorder swap onto the frozen display order so the row visibly moves. */ private swapDisplayIds; private notifyChange; private updateList; handleInput(data: string): void; getSearchInput(): Input; } //# sourceMappingURL=favorite-models-selector.d.ts.map