export interface EngineModelGroup { engine: string; label: string; models: string[]; modelDisplayNames?: Readonly>; preserveCustomModels?: boolean; configured: boolean; isSubscription?: boolean; } export interface ChatModelEngineEntry { name: string; label: string; defaultModel?: string; supportedModels?: readonly string[]; /** Full runtime model set, independent of any user-selected picker subset. */ runtimeSupportedModels?: readonly string[]; modelDisplayNames?: Readonly>; acceptsCustomModels?: boolean; preserveCustomModels?: boolean; requiredEnvVars?: readonly string[]; packageInstalled?: boolean; /** * Server-resolved readiness. The env-key fallback below cannot see * vault-stored credentials or the deploy-injected Builder gateway lane, so * an engine running on either is reported unconfigured without this. * * Undefined means the server could not resolve it — including a credential * read that threw, reported in `configuredError`. That deliberately falls * through to the env heuristic rather than reading as "needs an API key". */ configured?: boolean; configuredError?: string; /** * Whether `supportedModels` is the provider's checked models (`selected`) * or its recommended list. A checked list is authoritative: the picker adds * nothing to it, and live discovery (Ollama) doesn't replace it. */ modelSelection?: ChatModelSelectionState; } export interface ChatModelSelectionState { state: "default" | "selected" | "unreadable"; scope?: "user" | "org"; error?: string; } export interface BuildChatModelGroupsOptions { engines: readonly ChatModelEngineEntry[]; configuredKeys?: Iterable; builderConnected?: boolean; currentEngineName?: string; currentModel?: string; } /** * Where a model picker starts before anyone chooses: the app's configured * default model on a configured engine that offers it (the configured * default engine first), else the first model of the first configured * engine. `null` when nothing is configured. Every picker starts here, so * the home composer and the agent panel never open on different models. */ export declare function resolveDefaultModelSelection(groups: readonly Pick[], defaultModel: string | undefined, defaultEngine?: string): { model: string; engine: string; } | null; export declare function modelCatalogConfirmsMissing(groups: readonly Pick[] | undefined, loading: boolean | undefined): boolean; /** * Live discovery replaces the static Ollama suggestions only while nobody has * checked models for it; the checked list already came from that discovery. */ export declare function usesLiveOllamaModels(engine: Pick): boolean; export declare function buildChatModelGroups({ engines, configuredKeys, builderConnected, currentEngineName, currentModel, }: BuildChatModelGroupsOptions): EngineModelGroup[];