import { ILanguageModelChatMetadataAndIdentifier } from "./languageModels.js"; import { ILanguageModelsService } from "./languageModels.service.js"; export declare function getDefaultModelPolicyDescription(policyValue: unknown, configuredValue: unknown): string; export type ModelIdentifierResolution = { readonly kind: "notRequested"; } | { readonly kind: "pending"; readonly identifier: string; } | { readonly kind: "available"; readonly model: ILanguageModelChatMetadataAndIdentifier; } | { readonly kind: "unavailable"; readonly identifier: string; }; export interface IModelVendorResolution { hasLiveModels(vendor: string): boolean; hasResolved(vendor: string): boolean; } /** Resolves a requested model identifier against the current model catalog. */ export declare function resolveModelIdentifier(models: readonly ILanguageModelChatMetadataAndIdentifier[], identifier: string | undefined, isAbsenceConclusive: boolean): ModelIdentifierResolution; /** Resolves a model identifier using vendor-level catalog readiness. */ export declare function resolveModelIdentifierFromCatalog(models: readonly ILanguageModelChatMetadataAndIdentifier[], identifier: string | undefined, vendorResolution: IModelVendorResolution): ModelIdentifierResolution; export declare function getRegisteredLanguageModels(languageModelsService: Pick): ILanguageModelChatMetadataAndIdentifier[]; /** Filters a target's model catalog using both host-specific and underlying BYOK visibility. */ export declare function getVisibleLanguageModelsForTarget(models: readonly ILanguageModelChatMetadataAndIdentifier[], targetChatSessionType: string, languageModelsService: Pick): ILanguageModelChatMetadataAndIdentifier[]; export declare function resolveModelIdentifierFromLanguageModels(models: readonly ILanguageModelChatMetadataAndIdentifier[], identifier: string | undefined, languageModelsService: Pick, allModels: readonly ILanguageModelChatMetadataAndIdentifier[]): ModelIdentifierResolution; /** Resolves a configured model id, family, or `auto` value against a model pool. */ export declare function resolveConfiguredModel(configuredValue: string | undefined, models: readonly ILanguageModelChatMetadataAndIdentifier[]): ILanguageModelChatMetadataAndIdentifier | undefined; export declare enum ModelSelectionReason { ConfiguredDefault = "configuredDefault", FirstAvailable = "firstAvailable", ProgrammaticSelection = "programmaticSelection", Remembered = "remembered", /** A model carried onto the conversation rather than chosen inside it. */ SessionRestore = "sessionRestore", /** A model the conversation chose, restored onto it. Outranks `chat.defaultModel`. */ RestoredChoice = "restoredChoice", UserSelection = "userSelection" } /** * How a model already on a conversation is recorded: as the conversation's own, or as one carried * onto it. * * The distinction decides whether `chat.defaultModel` may still seed the conversation, and it * cannot be read off the model identifier: the same model can arrive because the user picked it, * because it was inherited from the chat this one branched off, or because an input picked it in * the absence of anything better. Each surface knows which of those happened and says so. */ export type RestoredModelReason = ModelSelectionReason.RestoredChoice | ModelSelectionReason.SessionRestore; /** Whether a reason describes a model restored onto a conversation, whoever chose it. */ export declare function isRestoredModelReason(reason: ModelSelectionReason | undefined): boolean; /** * The model a conversation is meant to run on, and the authority that put it there — regardless of * what the catalog can offer right now. Owned by the conversation rather than by any input widget, * so a choice made in one chat can never be applied to another. * * Deliberately local: it is never serialized and never crosses the agent-host wire, unlike the * selected model in the conversation's draft state. */ export interface IIntendedModelSelection { readonly modelId: string; /** Present when the model itself was seen; absent when only an id was restored from storage. */ readonly model?: ILanguageModelChatMetadataAndIdentifier; readonly reason: ModelSelectionReason; readonly configuration?: Record; } /** * Whether a reason represents a choice made inside the current conversation. `chat.defaultModel` * seeds every new conversation but must never override one of these. `SessionRestore` is excluded * deliberately: it is a model carried onto the conversation rather than chosen in it, which on an * empty session came from the previous one. A restore the surface can vouch for arrives as * {@link ModelSelectionReason.RestoredChoice} instead and does block the default. */ export declare function isInConversationModelChoice(reason: ModelSelectionReason | undefined): boolean; export interface IPendingModelSelection { readonly reference: string; } export type InitialModelSelectionResult = { readonly kind: "none"; } | { readonly kind: "pending"; readonly selection: IPendingModelSelection; } | { readonly kind: "apply"; readonly model: ILanguageModelChatMetadataAndIdentifier; readonly reason: ModelSelectionReason; }; export interface IInitialModelSelectionInput { readonly configuredModel: ILanguageModelChatMetadataAndIdentifier | undefined; readonly desiredModelResolution: ModelIdentifierResolution; readonly desiredReason: ModelSelectionReason.SessionRestore | ModelSelectionReason.Remembered; readonly fallbackModel: ILanguageModelChatMetadataAndIdentifier | undefined; readonly fallbackReason: ModelSelectionReason.FirstAvailable; } /** Applies the shared configured, desired, pending, then fallback precedence. */ export declare function resolveInitialModelSelection(input: IInitialModelSelectionInput): InitialModelSelectionResult;