import { type Component, type SelectItem, type SelectListTheme } from "@earendil-works/pi-tui"; /** Default window height for the SelectList (the built-in position indicator scales to the list). */ export declare const PICKER_MAX_VISIBLE = 10; /** * The host dialog cap this package must never exceed (PE-001): pi-web rejects a * `select` dialog offering more than 24 options with "A select dialog must not * offer more than 24 options". It is the single knob if a future host enforces a * different bound. */ export declare const SELECT_OPTION_LIMIT = 24; /** Pager entry offered on every page but the first. */ export declare const PAGED_SELECT_PREV = "\u25C0 Previous page"; /** Pager entry offered on every page but the last. */ export declare const PAGED_SELECT_NEXT = "More options\u2026"; /** The plain-dialog shape `pagedSelect` drives (Pi's `ctx.ui.select`). */ export type SelectFn = (title: string, options: readonly string[]) => string | undefined | Promise; /** * Present `options` through `select` without ever offering more than * `SELECT_OPTION_LIMIT` entries in one dialog (AC6, PE-001, PE-012). * * - A list that fits — data plus `trailing` — opens exactly one dialog, in the * caller's order with `trailing` last, so a ≤ cap flow is byte-identical to a * plain `select` call. * - A longer list pages `PAGED_SELECT_PAGE_SIZE` data entries at a time — * `SELECT_OPTION_LIMIT - 3`, so the derived page never hardcodes the cap — * appending `PAGED_SELECT_PREV` and/or `PAGED_SELECT_NEXT` before `trailing`. * Pager entries navigate; `trailing` and data entries are returned to the * caller; `undefined` (cancel) passes straight through. * * The two pager labels are reserved: a data value (or a `trailing` value) that * spells one is indistinguishable from the pager entry in the string `select` * answers with, so a colliding pager label is decorated until it names nothing * else on the dialog — the data value stays selectable and so does the pager. */ export declare function pagedSelect(select: SelectFn, title: string, options: readonly string[], { trailing }?: { trailing?: string; }): Promise; /** * The provider prefix Pi resolves a reference by — everything before the first * `/` (SPEC Decision 6). * * Lenient on purpose, and deliberately distinct from the strict * `parseModelReference` in `../config/schema.js`, which validates and rejects: * this split must answer for any registry string. Both the console's * provider-first grouping and the slash-aware filter below take their provider * from here, so the two settings-side consumers cannot drift apart. */ export declare function providerOf(reference: string): string; /** * Token/subsequence, slash-aware reference filter (OB-2). * * - An empty query returns every reference. * - The query is split on whitespace; every token must match for a reference to * survive. * - A token matched as a *subsequence* (characters in order, not necessarily * contiguous): `flash` matches any reference containing `flash`, `a/c` * matches `anthropic/claude`. * - A token ending in `/` constrains to the provider: `nan/` matches provider * `nan` only, never a model id that merely contains `nan`. */ export declare function filterReferences(query: string, refs: readonly string[]): string[]; /** * Wrap a `SelectList` as a pi-tui `Component`, rebuilding it client-side from * `filterReferences` as the operator types so the subsequence/slash-aware * filter (OB-2) — not `SelectList`'s own prefix `setFilter` — drives what the * window shows. Control keys (arrows, Enter, Escape) forward to the list. * * `initial` — the value in force — is selected in the window the picker opens * with, through the SelectList's own `setSelectedIndex` (OB-3). */ export declare function createPickerComponent(options: { items: readonly SelectItem[]; maxVisible: number; theme: SelectListTheme; /** The value in force, selected in the window the picker opens with (OB-3). */ initial?: string; onSelect: (value: string) => void; onCancel?: () => void; }): Component & { dispose?(): void; };