import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle"; import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service"; import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service"; import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service"; import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions"; import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service"; import { ILanguageModelsConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelsConfiguration.service"; /** * Owns the `github.copilot.hasByokModels` context key. The key is true iff: * - `github.copilot.clientByokEnabled` is true (set by `ChatEntitlementService` + Copilot extension), * - `chat.aiDisabled` is off, and * - the language-models configuration has at least one non-Copilot vendor group (at any time), * or — pre extension scan — the `chatNonCopilotModelsAreUserSelectable` signal is on. * * Strategy (avoids activating BYOK extensions just to gate UI): * 1. Restore the last persisted answer for correct warm-reload UI. * 2. Configured non-Copilot vendor groups are a positive signal at any time. * 3. Pre-registration only, also trust the `chatNonCopilotModelsAreUserSelectable` signal * (post-registration it can be stale — model cache lags behind group removal). * 4. Only persist `false` after both extension scan and first config load complete, so startup * latency doesn't clobber a previously-true answer. * * Eager so the key is bound before any sign-in UI renders. */ export declare class HasByokModelsContribution extends Disposable implements IWorkbenchContribution { private readonly _languageModelsConfigurationService; private readonly _contextKeyService; private readonly _configurationService; private readonly _storageService; static readonly ID = "workbench.contrib.hasByokModels"; private static readonly STORAGE_KEY_LAST_KNOWN; private static readonly TRACKED_KEYS; private readonly _hasByokModels; private _extensionsRegistered; private _configurationLoaded; constructor(_languageModelsConfigurationService: ILanguageModelsConfigurationService, _contextKeyService: IContextKeyService, _configurationService: IConfigurationService, _storageService: IStorageService, extensionService: IExtensionService); private _isFeatureEnabled; private _restore; private _setResult; private _update; }