/** Model selection and provider-management panels for the terminal app. */ import { type ReactElement } from 'react'; import type { ModelDirectory, ModelRow } from '../models.ts'; import { type DiscoveredModelView, type ProviderConfiguration, type ProviderSettingsDirectory, type ProviderTargetView } from '../provider-settings.ts'; import { type ProviderAuthorizationDirectory, type ProviderAuthorizationRow } from '../authorization.ts'; export declare function ModelPanel({ directory, error, current, onSelect, onProviders, onRetry, onClose }: { directory: ModelDirectory | undefined; error: string | undefined; /** `provider/model` label of the applied model: the cursor lands on it once. */ current?: string; onSelect: (row: ModelRow) => void; onProviders?: () => void; onRetry: () => void; onClose: () => void; }): ReactElement; /** The provider-management stage reached from /model with `a`. */ export declare function ProviderPanel({ directory, error, authorizations, authorizationError, onConfigure, onUnset, onRemove, onRetry, onBack, onExit }: { directory: ProviderSettingsDirectory | undefined; error: string | undefined; authorizations: ProviderAuthorizationDirectory | undefined; authorizationError: string | undefined; onConfigure: (target: ProviderTargetView) => void; onUnset: (target: ProviderTargetView) => void; onRemove: (target: ProviderTargetView) => void; onRetry: () => void; onBack: () => void; /** Leave the whole /model flow (Ctrl+C), not just this stage. */ onExit: () => void; }): ReactElement; /** Provider configuration editor: only explicit models are written to settings. */ /** * The unified provider setup page: API key, endpoint, and the explicit model * list (with per-model context/output capacities) on ONE screen — the deep * Tab menu and the separate key panel merged into a single discoverable * surface. A saved key rides the same Enter as the endpoint and models; an * empty endpoint keeps the provider's official default. Tab moves to the * discovery page, which interrogates the real endpoint and returns checkable * models for adoption; the last row also accepts hand-typed model ids. */ /** One declarable donor the setup page can copy reasoning efforts from verbatim. */ export interface EffortDonor { /** Provider route the declaration lives on. */ readonly provider: string; /** Model id the declaration belongs to. */ readonly id: string; /** The stored display-level to wire-value map, copied verbatim. */ readonly efforts: Record; } export declare function ProviderSetupPanel({ target, authorization, onSubscribe, save, saveCredential, discover, effortDonors, done, back, onExit }: { target: ProviderTargetView; /** * The provider's sign-in flow, when it offers a web (OAuth) channel: its * presence adds the subscription/key mode layer at the top of the page. */ authorization: ProviderAuthorizationRow | undefined; /** Open the subscription channel: sign in when logged out, confirm sign-out when logged in. */ onSubscribe: (() => void) | undefined; /** Models with declared efforts (settings first, catalog-advertised after) a model row can copy from. */ effortDonors: readonly EffortDonor[]; save: (target: ProviderTargetView, configuration: ProviderConfiguration) => Promise; saveCredential: ((target: ProviderTargetView, key: string) => Promise) | undefined; discover: (target: ProviderTargetView, request: { readonly apiKey?: string; readonly baseURL?: string; }, signal?: AbortSignal) => Promise; /** Report a successful save so the surface can notice the key rotation. */ done: (result: { readonly key: boolean; }) => void; back: () => void; /** Leave the whole /model flow (Ctrl+C), not just this page. */ onExit: () => void; }): ReactElement; /** Bounded destructive-action confirmation for credential or provider removal. */ export declare function ProviderConfirmPanel({ target, kind, confirm, done, back }: { target: ProviderTargetView; kind: 'credential' | 'provider'; confirm: (target: ProviderTargetView) => Promise; done: () => void; back: () => void; }): ReactElement; /** * The /help overlay: one scrolling card with the keyboard map, the TUI-local * commands, the live registry commands, and the user-invocable skills — the * real command surface, replacing the one-line notice. */