"use strict";
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfigKey = exports.XTabProviderId = exports.AzureAuthMode = exports.AuthPermissionMode = exports.AuthProviderId = exports.HARD_TOOL_LIMIT = exports.ConfigurationMigrationRegistry = exports.globalConfigRegistry = exports.ConfigValueValidators = exports.AbstractConfigurationService = exports.IConfigurationService = exports.CopilotConfigPrefix = void 0;
exports.getAllConfigKeys = getAllConfigKeys;
exports.registerNextEditProviderId = registerNextEditProviderId;
const services_1 = require("../../../util/common/services");
const errors_1 = require("../../../util/vs/base/common/errors");
const event_1 = require("../../../util/vs/base/common/event");
const lifecycle_1 = require("../../../util/vs/base/common/lifecycle");
const objects = __importStar(require("../../../util/vs/base/common/objects"));
const observable_1 = require("../../../util/vs/base/common/observable");
const types = __importStar(require("../../../util/vs/base/common/types"));
const packagejson_1 = require("../../env/common/packagejson");
const nextCursorLinePrediction_1 = require("../../inlineEdits/common/dataTypes/nextCursorLinePrediction");
const xtabPromptOptions = __importStar(require("../../inlineEdits/common/dataTypes/xtabPromptOptions"));
const xtabPromptOptions_1 = require("../../inlineEdits/common/dataTypes/xtabPromptOptions");
const responseProcessor_1 = require("../../inlineEdits/common/responseProcessor");
const alternativeContentFormat_1 = require("../../notebook/common/alternativeContentFormat");
const validator_1 = require("./validator");
exports.CopilotConfigPrefix = 'github.copilot';
exports.IConfigurationService = (0, services_1.createServiceIdentifier)('IConfigurationService');
class AbstractConfigurationService extends lifecycle_1.Disposable {
    constructor(copilotTokenStore) {
        super();
        this._onDidChangeConfiguration = this._register(new event_1.Emitter());
        this.onDidChangeConfiguration = this._onDidChangeConfiguration.event;
        this._isInternal = false;
        this._isTeamMember = false;
        this.observables = new Map();
        if (copilotTokenStore) {
            this._register(copilotTokenStore.onDidStoreUpdate(() => {
                const isTeamMember = !!copilotTokenStore.copilotToken?.isVscodeTeamMember;
                this._setUserInfo({
                    isInternal: !!copilotTokenStore.copilotToken?.isInternal,
                    isTeamMember,
                    teamMemberUsername: isTeamMember ? copilotTokenStore.copilotToken?.username : undefined
                });
            }));
        }
    }
    getConfigMixedWithDefaults(key) {
        if (key.options?.valueIgnoredForExternals && !this._isInternal) {
            return this.getDefaultValue(key);
        }
        const userValue = this.getConfig(key);
        // if user doesn't override the setting, return the default
        if (userValue === undefined) {
            return this.getDefaultValue(key);
        }
        // if user overrides the setting and the setting is an object, combine default with user value, with the preference to user settings
        if (types.isObject(userValue) && types.isObject(key.defaultValue)) {
            // If default is an object apply the default and then apply the setting
            return { ...key.defaultValue, ...userValue };
        }
        return userValue;
    }
    getDefaultValue(key) {
        if (ConfigValueValidators.isDefaultValueWithTeamAndInternalValue(key.defaultValue)) {
            return this._isUsingTeamDefault(key)
                ? key.defaultValue.teamDefaultValue
                : this._isInternal
                    ? key.defaultValue.internalDefaultValue
                    : key.defaultValue.defaultValue;
        }
        if (ConfigValueValidators.isDefaultValueWithTeamValue(key.defaultValue)) {
            return this._isUsingTeamDefault(key) ? key.defaultValue.teamDefaultValue : key.defaultValue.defaultValue;
        }
        return key.defaultValue;
    }
    _setUserInfo(userInfo) {
        if (this._isInternal === userInfo.isInternal && this._isTeamMember === userInfo.isTeamMember) {
            // no change
            return;
        }
        const internalChanged = this._isInternal !== userInfo.isInternal;
        const teamMemberChanged = this._isTeamMember !== userInfo.isTeamMember;
        this._isInternal = userInfo.isInternal;
        this._isTeamMember = userInfo.isTeamMember;
        // collect potential affected settings
        const potentialAffectedKeys = new Set();
        for (const config of exports.globalConfigRegistry.configs.values()) {
            if (internalChanged && (config.options?.valueIgnoredForExternals || ConfigValueValidators.isDefaultValueWithTeamAndInternalValue(config.defaultValue))) {
                potentialAffectedKeys.add(config.fullyQualifiedId);
            }
            else if (teamMemberChanged && ConfigValueValidators.isDefaultValueWithTeamValue(config.defaultValue)) {
                potentialAffectedKeys.add(config.fullyQualifiedId);
            }
        }
        if (potentialAffectedKeys.size > 0) {
            // fire a fake change event to refresh potential affected settings
            this._onDidChangeConfiguration.fire({
                affectsConfiguration: (section) => {
                    // Check for exact match or prefix match with dot separator
                    for (const key of potentialAffectedKeys) {
                        if (key === section || key.startsWith(section + '.') || section.startsWith(key + '.')) {
                            return true;
                        }
                    }
                    return false;
                }
            });
        }
    }
    updateExperimentBasedConfiguration(treatments) {
        if (treatments.length === 0) {
            return;
        }
        this._onDidChangeConfiguration.fire({ affectsConfiguration: () => true });
    }
    getConfigObservable(key) {
        return this._getObservable_$show2FramesUp(key, () => this.getConfig(key));
    }
    getExperimentBasedConfigObservable(key, experimentationService) {
        return this._getObservable_$show2FramesUp(key, () => this.getExperimentBasedConfig(key, experimentationService));
    }
    _getObservable_$show2FramesUp(key, getValue) {
        let observable = this.observables.get(key.id);
        if (!observable) {
            observable = (0, observable_1.observableFromEventOpts)({ debugName: () => `Configuration Key "${key.id}"` }, (handleChange) => this._register(this.onDidChangeConfiguration(e => {
                if (e.affectsConfiguration(key.fullyQualifiedId)) {
                    handleChange(e);
                }
            })), getValue);
            this.observables.set(key.id, observable);
        }
        return observable;
    }
    _isUsingTeamDefault(key) {
        if (!this._isTeamMember) {
            return false;
        }
        if (!ConfigValueValidators.isDefaultValueWithTeamAndInternalValue(key.defaultValue)
            && !ConfigValueValidators.isDefaultValueWithTeamValue(key.defaultValue)) {
            return false;
        }
        return true;
    }
    /**
     * Checks if the key is configured by the user in any of the configuration scopes.
     */
    isConfigured(key, scope) {
        const inspect = this.inspectConfig(key, scope);
        const isConfigured = (inspect?.globalValue !== undefined
            || inspect?.globalLanguageValue !== undefined
            || inspect?.workspaceFolderValue !== undefined
            || inspect?.workspaceFolderLanguageValue !== undefined
            || inspect?.workspaceValue !== undefined
            || inspect?.workspaceLanguageValue !== undefined);
        return isConfigured;
    }
}
exports.AbstractConfigurationService = AbstractConfigurationService;
var ConfigValueValidators;
(function (ConfigValueValidators) {
    function isDefaultValueWithTeamValue(value) {
        return types.isObject(value) && 'defaultValue' in value && 'teamDefaultValue' in value;
    }
    ConfigValueValidators.isDefaultValueWithTeamValue = isDefaultValueWithTeamValue;
    function isDefaultValueWithTeamAndInternalValue(value) {
        return ConfigValueValidators.isDefaultValueWithTeamValue(value) && 'internalDefaultValue' in value;
    }
    ConfigValueValidators.isDefaultValueWithTeamAndInternalValue = isDefaultValueWithTeamAndInternalValue;
})(ConfigValueValidators || (exports.ConfigValueValidators = ConfigValueValidators = {}));
let packageJsonDefaults = undefined;
function getPackageJsonDefaults() {
    if (!packageJsonDefaults) {
        packageJsonDefaults = new Map();
        // Use the information in packageJson
        const config = packagejson_1.packageJson.contributes.configuration;
        const propertyGroups = config.map((c) => c.properties);
        const configProps = Object.assign({}, ...propertyGroups);
        for (const key in configProps) {
            packageJsonDefaults.set(key, configProps[key].default);
        }
    }
    return packageJsonDefaults;
}
function toBaseConfig(key, defaultValue, options) {
    const fullyQualifiedId = `${exports.CopilotConfigPrefix}.${key}`;
    const fullyQualifiedOldId = options?.oldKey ? `${exports.CopilotConfigPrefix}.${options.oldKey}` : undefined;
    const packageJsonDefaults = getPackageJsonDefaults();
    const isPublic = packageJsonDefaults.has(fullyQualifiedId);
    const packageJsonDefaultValue = packageJsonDefaults.get(fullyQualifiedId);
    if (isPublic) {
        // make sure the default in the code matches the default in packageJson
        const publicDefaultValue = (ConfigValueValidators.isDefaultValueWithTeamAndInternalValue(defaultValue)
            ? defaultValue.defaultValue
            : ConfigValueValidators.isDefaultValueWithTeamValue(defaultValue)
                ? defaultValue.defaultValue
                : defaultValue);
        if (!objects.equals(publicDefaultValue, packageJsonDefaultValue)) {
            throw new errors_1.BugIndicatingError(`The default value for setting ${key} is different in packageJson and in code`);
        }
    }
    if (isPublic && options?.valueIgnoredForExternals) {
        throw new errors_1.BugIndicatingError(`The setting ${key} is public, it therefore cannot be restricted to internal!`);
    }
    const advancedSubKey = fullyQualifiedId.startsWith('github.copilot.advanced.') ? fullyQualifiedId.substring('github.copilot.advanced.'.length) : undefined;
    return { id: key, oldId: options?.oldKey, isPublic, fullyQualifiedId, fullyQualifiedOldId, advancedSubKey, defaultValue, options };
}
class ConfigRegistry {
    constructor() {
        /**
         * A map of all registered configs, keyed by their full id, eg `github.copilot.advanced.debug.overrideProxyUrl`.
         */
        this.configs = new Map();
    }
    registerConfig(config) {
        this.configs.set(config.fullyQualifiedId, config);
    }
}
exports.globalConfigRegistry = new ConfigRegistry();
class ConfigurationMigrationRegistryImpl {
    constructor() {
        this.migrations = [];
        this._onDidRegisterConfigurationMigrations = new event_1.Emitter();
        this.onDidRegisterConfigurationMigration = this._onDidRegisterConfigurationMigrations.event;
    }
    registerConfigurationMigrations(configurationMigrations) {
        this.migrations.push(...configurationMigrations);
        this._onDidRegisterConfigurationMigrations.fire(configurationMigrations);
    }
}
exports.ConfigurationMigrationRegistry = new ConfigurationMigrationRegistryImpl();
function defineSetting(key, configType, defaultValue, validator, options, expOptions) {
    if (configType === 1 /* ConfigType.ExperimentBased */) {
        const value = { ...toBaseConfig(key, defaultValue, options), configType: 1 /* ConfigType.ExperimentBased */, experimentName: expOptions?.experimentName, validator };
        if (value.advancedSubKey) {
            // This is a `github.copilot.advanced.*` setting
            throw new errors_1.BugIndicatingError('Shared settings cannot be experiment based');
        }
        exports.globalConfigRegistry.registerConfig(value);
        return value;
    }
    const value = { ...toBaseConfig(key, defaultValue, options), configType: 0 /* ConfigType.Simple */, validator };
    exports.globalConfigRegistry.registerConfig(value);
    return value;
}
function defineTeamInternalSetting(key, configType, defaultValue, validator, options, expOptions) {
    options = { ...options, valueIgnoredForExternals: true };
    return configType === 0 /* ConfigType.Simple */ ? defineSetting(key, configType, defaultValue, validator, options) : defineSetting(key, configType, defaultValue, validator, options, expOptions);
}
function migrateSetting(newKey, oldKey) {
    exports.ConfigurationMigrationRegistry.registerConfigurationMigrations([{
            key: `${exports.CopilotConfigPrefix}.${oldKey}`,
            migrateFn: async (migrationValue) => {
                return [
                    [`${exports.CopilotConfigPrefix}.${newKey}`, { value: migrationValue }],
                    [`${exports.CopilotConfigPrefix}.${oldKey}`, { value: undefined }]
                ];
            }
        }]);
}
function defineAndMigrateSetting(oldKey, newKey, defaultValue, options) {
    migrateSetting(newKey, oldKey);
    return defineSetting(newKey, 0 /* ConfigType.Simple */, defaultValue, undefined, { ...options, oldKey });
}
function defineAndMigrateExpSetting(oldKey, newKey, defaultValue, options, expOptions) {
    migrateSetting(newKey, oldKey);
    return defineSetting(newKey, 1 /* ConfigType.ExperimentBased */, defaultValue, undefined, { ...options, oldKey }, expOptions);
}
// Max CAPI tool count limit
exports.HARD_TOOL_LIMIT = 128;
var AuthProviderId;
(function (AuthProviderId) {
    AuthProviderId["GitHub"] = "github";
    AuthProviderId["GitHubEnterprise"] = "github-enterprise";
    AuthProviderId["Microsoft"] = "microsoft";
})(AuthProviderId || (exports.AuthProviderId = AuthProviderId = {}));
var AuthPermissionMode;
(function (AuthPermissionMode) {
    AuthPermissionMode["Default"] = "default";
    AuthPermissionMode["Minimal"] = "minimal";
})(AuthPermissionMode || (exports.AuthPermissionMode = AuthPermissionMode = {}));
var AzureAuthMode;
(function (AzureAuthMode) {
    AzureAuthMode["EntraId"] = "entraId";
    AzureAuthMode["ApiKey"] = "apiKey";
})(AzureAuthMode || (exports.AzureAuthMode = AzureAuthMode = {}));
(function (AzureAuthMode) {
    /** Microsoft authentication provider ID for VS Code authentication API */
    AzureAuthMode.MICROSOFT_AUTH_PROVIDER = 'microsoft';
    /** Azure Cognitive Services scope for Entra ID authentication */
    AzureAuthMode.COGNITIVE_SERVICES_SCOPE = 'https://cognitiveservices.azure.com/.default';
})(AzureAuthMode || (exports.AzureAuthMode = AzureAuthMode = {}));
exports.XTabProviderId = 'XtabProvider';
var ConfigKey;
(function (ConfigKey) {
    /**
     * These settings are defined in the completions extensions and shared.
     *
     * We should not change the names of these settings without coordinating with Completions extension.
    */
    let Shared;
    (function (Shared) {
        /** Allows for overriding the base domain we use for making requests to the CAPI. This helps CAPI devs develop against a local instance. */
        Shared.DebugOverrideProxyUrl = defineSetting('advanced.debug.overrideProxyUrl', 0 /* ConfigType.Simple */, undefined);
        Shared.DebugOverrideCAPIUrl = defineSetting('advanced.debug.overrideCapiUrl', 0 /* ConfigType.Simple */, undefined);
        Shared.DebugUseNodeFetchFetcher = defineSetting('advanced.debug.useNodeFetchFetcher', 0 /* ConfigType.Simple */, true);
        Shared.DebugUseNodeFetcher = defineSetting('advanced.debug.useNodeFetcher', 0 /* ConfigType.Simple */, false);
        Shared.DebugUseElectronFetcher = defineSetting('advanced.debug.useElectronFetcher', 0 /* ConfigType.Simple */, true);
        Shared.AuthProvider = defineSetting('advanced.authProvider', 0 /* ConfigType.Simple */, AuthProviderId.GitHub);
        Shared.AuthPermissions = defineSetting('advanced.authPermissions', 0 /* ConfigType.Simple */, AuthPermissionMode.Default);
    })(Shared = ConfigKey.Shared || (ConfigKey.Shared = {}));
    /**
     * Advanced settings that are available for all users to configure.
     */
    let Advanced;
    (function (Advanced) {
        /** Allows forcing a particular model.
         * Note: this should not be used while self-hosting because it might lead to
         * a fundamental different experience compared to our end-users.
        */
        Advanced.DebugOverrideChatEngine = defineAndMigrateSetting('chat.advanced.debug.overrideChatEngine', 'chat.debug.overrideChatEngine', undefined);
        Advanced.WorkspacePrototypeAdoCodeSearchEndpointOverride = defineAndMigrateSetting('chat.advanced.workspace.prototypeAdoCodeSearchEndpointOverride', 'chat.workspace.prototypeAdoCodeSearchEndpointOverride', '');
        Advanced.FeedbackOnChange = defineAndMigrateSetting('chat.advanced.feedback.onChange', 'chat.feedback.onChange', false);
        Advanced.ReviewIntent = defineAndMigrateSetting('chat.advanced.review.intent', 'chat.review.intent', false);
        /** Enable the new notebook priorities experiment */
        Advanced.NotebookSummaryExperimentEnabled = defineAndMigrateSetting('chat.advanced.notebook.summaryExperimentEnabled', 'chat.notebook.summaryExperimentEnabled', false);
        /** Enable filtering variables by cell document symbols */
        Advanced.NotebookVariableFilteringEnabled = defineAndMigrateSetting('chat.advanced.notebook.variableFilteringEnabled', 'chat.notebook.variableFilteringEnabled', false);
        Advanced.TerminalToDebuggerPatterns = defineAndMigrateSetting('chat.advanced.debugTerminalCommandPatterns', 'chat.debugTerminalCommandPatterns', []);
        Advanced.WorkspaceRecordingEnabled = defineAndMigrateSetting('chat.advanced.localWorkspaceRecording.enabled', 'chat.localWorkspaceRecording.enabled', false);
        Advanced.EditRecordingEnabled = defineAndMigrateSetting('chat.advanced.editRecording.enabled', 'chat.editRecording.enabled', false);
        Advanced.CodeSearchAgentEnabled = defineAndMigrateSetting('chat.advanced.codesearch.agent.enabled', 'chat.codesearch.agent.enabled', true);
        Advanced.AgentTemperature = defineAndMigrateSetting('chat.advanced.agent.temperature', 'chat.agent.temperature', undefined);
        Advanced.EnableUserPreferences = defineAndMigrateSetting('chat.advanced.enableUserPreferences', 'chat.enableUserPreferences', false);
        Advanced.SummarizeAgentConversationHistoryThreshold = defineAndMigrateSetting('chat.advanced.summarizeAgentConversationHistoryThreshold', 'chat.summarizeAgentConversationHistoryThreshold', undefined);
        Advanced.AgentHistorySummarizationMode = defineAndMigrateSetting('chat.advanced.agentHistorySummarizationMode', 'chat.agentHistorySummarizationMode', undefined);
        Advanced.UseResponsesApiTruncation = defineAndMigrateSetting('chat.advanced.useResponsesApiTruncation', 'chat.useResponsesApiTruncation', false);
        Advanced.OmitBaseAgentInstructions = defineAndMigrateSetting('chat.advanced.omitBaseAgentInstructions', 'chat.omitBaseAgentInstructions', false);
        Advanced.ClaudeCodeDebugEnabled = defineAndMigrateSetting('chat.advanced.claudeCode.debug', 'chat.claudeCode.debug', false);
        Advanced.CopilotCLIEnabled = defineAndMigrateSetting('chat.advanced.copilotCLI.enabled', 'chat.copilotCLI.enabled', true);
        Advanced.GitHistoryRelatedFilesUsingEmbeddings = defineAndMigrateSetting('chat.advanced.suggestRelatedFilesFromGitHistory.useEmbeddings', 'chat.suggestRelatedFilesFromGitHistory.useEmbeddings', false);
        Advanced.CLIIsolationEnabled = defineAndMigrateSetting('chat.advanced.cli.isolation.enabled', 'chat.cli.isolation.enabled', false);
        Advanced.CLICustomAgentsEnabled = defineAndMigrateSetting('chat.advanced.cli.customAgents.enabled', 'chat.cli.customAgents.enabled', false);
        Advanced.CLIMCPServerEnabled = defineAndMigrateSetting('chat.advanced.cli.mcp.enabled', 'chat.cli.mcp.enabled', false);
        Advanced.EnableClaudeCodeAgent = defineAndMigrateSetting('chat.advanced.claudeCode.enabled', 'chat.claudeCode.enabled', false);
        Advanced.RequestLoggerMaxEntries = defineAndMigrateSetting('chat.advanced.debug.requestLogger.maxEntries', 'chat.debug.requestLogger.maxEntries', 100);
        // Experiment-based settings
        /** Uses new expanded project labels */
        Advanced.ProjectLabelsExpanded = defineAndMigrateExpSetting('chat.advanced.projectLabels.expanded', 'chat.projectLabels.expanded', false);
        /** Add project labels in default agent */
        Advanced.ProjectLabelsChat = defineAndMigrateExpSetting('chat.advanced.projectLabels.chat', 'chat.projectLabels.chat', false);
        /** Add project labels in default agent */
        Advanced.ProjectLabelsInline = defineAndMigrateExpSetting('chat.advanced.projectLabels.inline', 'chat.projectLabels.inline', false);
        Advanced.WorkspaceMaxLocalIndexSize = defineAndMigrateExpSetting('chat.advanced.workspace.maxLocalIndexSize', 'chat.workspace.maxLocalIndexSize', 100_000);
        Advanced.WorkspaceEnableFullWorkspace = defineAndMigrateExpSetting('chat.advanced.workspace.enableFullWorkspace', 'chat.workspace.enableFullWorkspace', true);
        Advanced.WorkspaceEnableCodeSearch = defineAndMigrateExpSetting('chat.advanced.workspace.enableCodeSearch', 'chat.workspace.enableCodeSearch', true);
        Advanced.WorkspaceEnableEmbeddingsSearch = defineAndMigrateExpSetting('chat.advanced.workspace.enableEmbeddingsSearch', 'chat.workspace.enableEmbeddingsSearch', true);
        Advanced.WorkspacePreferredEmbeddingsModel = defineAndMigrateExpSetting('chat.advanced.workspace.preferredEmbeddingsModel', 'chat.workspace.preferredEmbeddingsModel', '');
        Advanced.NotebookAlternativeDocumentFormat = defineAndMigrateExpSetting('chat.advanced.notebook.alternativeFormat', 'chat.notebook.alternativeFormat', alternativeContentFormat_1.AlternativeNotebookFormat.xml);
        Advanced.UseAlternativeNESNotebookFormat = defineAndMigrateExpSetting('chat.advanced.notebook.alternativeNESFormat.enabled', 'chat.notebook.alternativeNESFormat.enabled', false);
        /** Configure temporal context max age */
        Advanced.TemporalContextMaxAge = defineAndMigrateExpSetting('chat.advanced.temporalContext.maxAge', 'chat.temporalContext.maxAge', 100);
        Advanced.TemporalContextPreferSameLang = defineAndMigrateExpSetting('chat.advanced.temporalContext.preferSameLang', 'chat.temporalContext.preferSameLang', false);
        Advanced.InstantApplyShortModelName = defineAndMigrateExpSetting('chat.advanced.instantApply.shortContextModelName', 'chat.instantApply.shortContextModelName', "gpt-4o-instant-apply-full-ft-v66-short" /* CHAT_MODEL.SHORT_INSTANT_APPLY */);
        Advanced.InstantApplyShortContextLimit = defineAndMigrateExpSetting('chat.advanced.instantApply.shortContextLimit', 'chat.instantApply.shortContextLimit', 8000);
        Advanced.AgentHistorySummarizationWithPromptCache = defineAndMigrateExpSetting('chat.advanced.agentHistorySummarizationWithPromptCache', 'chat.agentHistorySummarizationWithPromptCache', false);
        Advanced.AgentHistorySummarizationForceGpt41 = defineAndMigrateExpSetting('chat.advanced.agentHistorySummarizationForceGpt41', 'chat.agentHistorySummarizationForceGpt41', false);
        Advanced.PromptFileContext = defineAndMigrateExpSetting('chat.advanced.promptFileContextProvider.enabled', 'chat.promptFileContextProvider.enabled', true);
        Advanced.DefaultToolsGrouped = defineAndMigrateExpSetting('chat.advanced.tools.defaultToolsGrouped', 'chat.tools.defaultToolsGrouped', false);
        Advanced.Gpt5AlternativePatch = defineAndMigrateExpSetting('chat.advanced.gpt5AlternativePatch', 'chat.gpt5AlternativePatch', false);
        Advanced.InlineEditsTriggerOnEditorChangeAfterSeconds = defineAndMigrateExpSetting('chat.advanced.inlineEdits.triggerOnEditorChangeAfterSeconds', 'chat.inlineEdits.triggerOnEditorChangeAfterSeconds', { defaultValue: undefined, teamDefaultValue: 10 });
        Advanced.InlineEditsNextCursorPredictionDisplayLine = defineAndMigrateExpSetting('chat.advanced.inlineEdits.nextCursorPrediction.displayLine', 'chat.inlineEdits.nextCursorPrediction.displayLine', true);
        Advanced.InlineEditsNextCursorPredictionCurrentFileMaxTokens = defineAndMigrateExpSetting('chat.advanced.inlineEdits.nextCursorPrediction.currentFileMaxTokens', 'chat.inlineEdits.nextCursorPrediction.currentFileMaxTokens', xtabPromptOptions.DEFAULT_OPTIONS.currentFile.maxTokens);
        Advanced.InlineEditsRenameSymbolSuggestions = defineSetting('chat.inlineEdits.renameSymbolSuggestions', 1 /* ConfigType.ExperimentBased */, { defaultValue: false, teamDefaultValue: true });
        Advanced.DiagnosticsContextProvider = defineAndMigrateExpSetting('chat.advanced.inlineEdits.diagnosticsContextProvider.enabled', 'chat.inlineEdits.diagnosticsContextProvider.enabled', false);
        Advanced.Gemini3ReplaceStringOnly = defineSetting('chat.edits.gemini3ReplaceStringOnly', 1 /* ConfigType.ExperimentBased */, false);
        Advanced.Gemini3MultiReplaceString = defineSetting('chat.edits.gemini3MultiReplaceString', 1 /* ConfigType.ExperimentBased */, false);
    })(Advanced = ConfigKey.Advanced || (ConfigKey.Advanced = {}));
    /**
     * Internal settings those only team members can configure
     * Features should only be in this list temporarily, moving on to experimental to be accessible to early adopters.
    */
    let TeamInternal;
    (function (TeamInternal) {
        /** Allows forcing a particular context window size.
         * This setting doesn't validate values so large windows may not be supported by the model.
         * Note: this should not be used while self-hosting because it might lead to
         * a fundamental different experience compared to our end-users.
         */
        TeamInternal.DebugOverrideChatMaxTokenNum = defineTeamInternalSetting('chat.advanced.debug.overrideChatMaxTokenNum', 0 /* ConfigType.Simple */, 0);
        /** Allow reporting issue when clicking on the Unhelpful button
         * Requires a window reload to take effect
         */
        TeamInternal.DebugReportFeedback = defineTeamInternalSetting('chat.advanced.debug.reportFeedback', 0 /* ConfigType.Simple */, { defaultValue: false, teamDefaultValue: true });
        TeamInternal.InlineEditsIgnoreCompletionsDisablement = defineTeamInternalSetting('chat.advanced.inlineEdits.ignoreCompletionsDisablement', 0 /* ConfigType.Simple */, false, (0, validator_1.vBoolean)());
        TeamInternal.InlineEditsLogContextRecorderEnabled = defineTeamInternalSetting('chat.advanced.inlineEdits.logContextRecorder.enabled', 0 /* ConfigType.Simple */, false);
        TeamInternal.InlineEditsHideInternalInterface = defineTeamInternalSetting('chat.advanced.inlineEdits.hideInternalInterface', 0 /* ConfigType.Simple */, false, (0, validator_1.vBoolean)());
        TeamInternal.InlineEditsLogCancelledRequests = defineTeamInternalSetting('chat.advanced.inlineEdits.logCancelledRequests', 0 /* ConfigType.Simple */, false, (0, validator_1.vBoolean)());
        TeamInternal.InlineEditsNextCursorPredictionUrl = defineTeamInternalSetting('chat.advanced.inlineEdits.nextCursorPrediction.url', 0 /* ConfigType.Simple */, undefined, (0, validator_1.vString)());
        TeamInternal.InlineEditsNextCursorPredictionApiKey = defineTeamInternalSetting('chat.advanced.inlineEdits.nextCursorPrediction.apiKey', 0 /* ConfigType.Simple */, undefined, (0, validator_1.vString)());
        TeamInternal.InlineEditsXtabProviderUrl = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.url', 0 /* ConfigType.Simple */, undefined, (0, validator_1.vString)());
        TeamInternal.InlineEditsXtabProviderApiKey = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.apiKey', 0 /* ConfigType.Simple */, undefined, (0, validator_1.vString)());
        TeamInternal.InlineEditsXtabProviderModelConfiguration = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.modelConfiguration', 0 /* ConfigType.Simple */, { defaultValue: undefined, teamDefaultValue: { modelName: "copilot-nes-oct", promptingStrategy: xtabPromptOptions.PromptingStrategy.Xtab275, includeTagsInCurrentFile: false } }, xtabPromptOptions.MODEL_CONFIGURATION_VALIDATOR);
        TeamInternal.InlineEditsInlineCompletionsEnabled = defineTeamInternalSetting('chat.advanced.inlineEdits.inlineCompletions.enabled', 0 /* ConfigType.Simple */, true, (0, validator_1.vBoolean)());
        TeamInternal.InlineEditsXtabProviderUsePrediction = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.usePrediction', 0 /* ConfigType.Simple */, true, (0, validator_1.vBoolean)());
        TeamInternal.InlineEditsXtabLanguageContextEnabledLanguages = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.languageContext.enabledLanguages', 0 /* ConfigType.Simple */, xtabPromptOptions_1.LANGUAGE_CONTEXT_ENABLED_LANGUAGES);
        TeamInternal.InlineEditsDiagnosticsExplorationEnabled = defineTeamInternalSetting('chat.advanced.inlineEdits.inlineEditsDiagnosticsExplorationEnabled', 0 /* ConfigType.Simple */, false);
        TeamInternal.InternalWelcomeHintEnabled = defineTeamInternalSetting('chat.advanced.welcomePageHint.enabled', 0 /* ConfigType.Simple */, { defaultValue: false, internalDefaultValue: true, teamDefaultValue: true });
        TeamInternal.InlineChatUseCodeMapper = defineTeamInternalSetting('chat.advanced.inlineChat.useCodeMapper', 0 /* ConfigType.Simple */, false);
        // Backed by Experiments
        TeamInternal.DebugCollectFetcherTelemetry = defineTeamInternalSetting('chat.advanced.debug.collectFetcherTelemetry', 1 /* ConfigType.ExperimentBased */, true);
        TeamInternal.DebugExpUseNodeFetchFetcher = defineTeamInternalSetting('chat.advanced.debug.useNodeFetchFetcher', 1 /* ConfigType.ExperimentBased */, undefined);
        TeamInternal.DebugExpUseNodeFetcher = defineTeamInternalSetting('chat.advanced.debug.useNodeFetcher', 1 /* ConfigType.ExperimentBased */, undefined);
        TeamInternal.DebugExpUseElectronFetcher = defineTeamInternalSetting('chat.advanced.debug.useElectronFetcher', 1 /* ConfigType.ExperimentBased */, undefined);
        TeamInternal.InlineEditsAsyncCompletions = defineTeamInternalSetting('chat.advanced.inlineEdits.asyncCompletions', 1 /* ConfigType.ExperimentBased */, true);
        TeamInternal.InlineEditsDebounceUseCoreRequestTime = defineTeamInternalSetting('chat.advanced.inlineEdits.debounceUseCoreRequestTime', 1 /* ConfigType.ExperimentBased */, false);
        TeamInternal.InlineEditsYieldToCopilot = defineTeamInternalSetting('chat.advanced.inlineEdits.yieldToCopilot', 1 /* ConfigType.ExperimentBased */, false);
        TeamInternal.InlineEditsExcludedProviders = defineTeamInternalSetting('chat.advanced.inlineEdits.excludedProviders', 1 /* ConfigType.ExperimentBased */, undefined);
        TeamInternal.InlineEditsEnableCompletionsProvider = defineTeamInternalSetting('chat.advanced.inlineEdits.completionsProvider.enabled', 1 /* ConfigType.ExperimentBased */, false);
        TeamInternal.InlineEditsEnableGhCompletionsProvider = defineTeamInternalSetting('chat.advanced.inlineEdits.githubCompletionsProvider.enabled', 1 /* ConfigType.ExperimentBased */, false);
        TeamInternal.InlineEditsCompletionsUrl = defineTeamInternalSetting('chat.advanced.inlineEdits.completionsProvider.url', 1 /* ConfigType.ExperimentBased */, undefined);
        TeamInternal.InlineEditsDebounce = defineTeamInternalSetting('chat.advanced.inlineEdits.debounce', 1 /* ConfigType.ExperimentBased */, 200);
        TeamInternal.InlineEditsCacheDelay = defineTeamInternalSetting('chat.advanced.inlineEdits.cacheDelay', 1 /* ConfigType.ExperimentBased */, 300);
        TeamInternal.InlineEditsSubsequentCacheDelay = defineTeamInternalSetting('chat.advanced.inlineEdits.subsequentCacheDelay', 1 /* ConfigType.ExperimentBased */, 0);
        TeamInternal.InlineEditsRebasedCacheDelay = defineTeamInternalSetting('chat.advanced.inlineEdits.rebasedCacheDelay', 1 /* ConfigType.ExperimentBased */, undefined);
        TeamInternal.InlineEditsBackoffDebounceEnabled = defineTeamInternalSetting('chat.advanced.inlineEdits.backoffDebounceEnabled', 1 /* ConfigType.ExperimentBased */, true);
        TeamInternal.InlineEditsExtraDebounceEndOfLine = defineTeamInternalSetting('chat.advanced.inlineEdits.extraDebounceEndOfLine', 1 /* ConfigType.ExperimentBased */, 0);
        TeamInternal.InlineEditsDebounceOnSelectionChange = defineTeamInternalSetting('chat.advanced.inlineEdits.debounceOnSelectionChange', 1 /* ConfigType.ExperimentBased */, undefined);
        TeamInternal.InlineEditsProviderId = defineTeamInternalSetting('chat.advanced.inlineEdits.providerId', 1 /* ConfigType.ExperimentBased */, undefined);
        TeamInternal.InlineEditsUnification = defineTeamInternalSetting('chat.advanced.inlineEdits.unification', 1 /* ConfigType.ExperimentBased */, false);
        TeamInternal.InlineEditsNextCursorPredictionEnabled = defineTeamInternalSetting('chat.advanced.inlineEdits.nextCursorPrediction.enabled', 1 /* ConfigType.ExperimentBased */, { defaultValue: undefined, teamDefaultValue: nextCursorLinePrediction_1.NextCursorLinePrediction.OnlyWithEdit });
        TeamInternal.InlineEditsNextCursorPredictionModelName = defineTeamInternalSetting('chat.advanced.inlineEdits.nextCursorPrediction.modelName', 1 /* ConfigType.ExperimentBased */, "xtab-cursor-jump-1104");
        TeamInternal.InlineEditsXtabProviderModelConfigurationString = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.modelConfigurationString', 1 /* ConfigType.ExperimentBased */, undefined);
        TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.defaultModelConfigurationString', 1 /* ConfigType.ExperimentBased */, undefined);
        TeamInternal.InlineEditsXtabProviderUseVaryingLinesAbove = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.useVaryingLinesAbove', 1 /* ConfigType.ExperimentBased */, undefined);
        TeamInternal.InlineEditsXtabProviderNLinesAbove = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.nLinesAbove', 1 /* ConfigType.ExperimentBased */, undefined);
        TeamInternal.InlineEditsXtabProviderNLinesBelow = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.nLinesBelow', 1 /* ConfigType.ExperimentBased */, undefined);
        TeamInternal.InlineEditsXtabProviderRetryWithNMoreLinesBelow = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.retryWithNMoreLinesBelow', 1 /* ConfigType.ExperimentBased */, undefined);
        TeamInternal.InlineEditsAutoExpandEditWindowLines = defineTeamInternalSetting('chat.advanced.inlineEdits.autoExpandEditWindowLines', 1 /* ConfigType.ExperimentBased */, undefined);
        TeamInternal.InlineEditsXtabNRecentlyViewedDocuments = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.nRecentlyViewedDocuments', 1 /* ConfigType.ExperimentBased */, xtabPromptOptions.DEFAULT_OPTIONS.recentlyViewedDocuments.nDocuments);
        TeamInternal.InlineEditsXtabRecentlyViewedDocumentsMaxTokens = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.maxTokens', 1 /* ConfigType.ExperimentBased */, xtabPromptOptions.DEFAULT_OPTIONS.recentlyViewedDocuments.maxTokens);
        TeamInternal.InlineEditsXtabDiffNEntries = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.diffNEntries', 1 /* ConfigType.ExperimentBased */, xtabPromptOptions.DEFAULT_OPTIONS.diffHistory.nEntries);
        TeamInternal.InlineEditsXtabDiffMaxTokens = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.diffMaxTokens', 1 /* ConfigType.ExperimentBased */, xtabPromptOptions.DEFAULT_OPTIONS.diffHistory.maxTokens);
        TeamInternal.InlineEditsXtabProviderEmitFastCursorLineChange = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.emitFastCursorLineChange', 1 /* ConfigType.ExperimentBased */, true);
        TeamInternal.InlineEditsXtabIncludeViewedFiles = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.includeViewedFiles', 1 /* ConfigType.ExperimentBased */, xtabPromptOptions.DEFAULT_OPTIONS.recentlyViewedDocuments.includeViewedFiles);
        TeamInternal.InlineEditsXtabPageSize = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.pageSize', 1 /* ConfigType.ExperimentBased */, xtabPromptOptions.DEFAULT_OPTIONS.pagedClipping.pageSize);
        TeamInternal.InlineEditsXtabEditWindowMaxTokens = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.editWindowMaxTokens', 1 /* ConfigType.ExperimentBased */, undefined);
        TeamInternal.InlineEditsXtabIncludeTagsInCurrentFile = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.includeTagsInCurrentFile', 1 /* ConfigType.ExperimentBased */, xtabPromptOptions.DEFAULT_OPTIONS.currentFile.includeTags);
        TeamInternal.InlineEditsXtabCurrentFileMaxTokens = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.currentFileMaxTokens', 1 /* ConfigType.ExperimentBased */, xtabPromptOptions.DEFAULT_OPTIONS.currentFile.maxTokens);
        TeamInternal.InlineEditsXtabPrioritizeAboveCursor = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.currentFile.prioritizeAboveCursor', 1 /* ConfigType.ExperimentBased */, xtabPromptOptions.DEFAULT_OPTIONS.currentFile.prioritizeAboveCursor);
        TeamInternal.InlineEditsXtabDiffOnlyForDocsInPrompt = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.diffOnlyForDocsInPrompt', 1 /* ConfigType.ExperimentBased */, xtabPromptOptions.DEFAULT_OPTIONS.diffHistory.onlyForDocsInPrompt);
        TeamInternal.InlineEditsXtabDiffUseRelativePaths = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.diffUseRelativePaths', 1 /* ConfigType.ExperimentBased */, xtabPromptOptions.DEFAULT_OPTIONS.diffHistory.useRelativePaths);
        TeamInternal.InlineEditsXtabNNonSignificantLinesToConverge = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.nNonSignificantLinesToConverge', 1 /* ConfigType.ExperimentBased */, responseProcessor_1.ResponseProcessor.DEFAULT_DIFF_PARAMS.nLinesToConverge);
        TeamInternal.InlineEditsXtabNSignificantLinesToConverge = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.nSignificantLinesToConverge', 1 /* ConfigType.ExperimentBased */, responseProcessor_1.ResponseProcessor.DEFAULT_DIFF_PARAMS.nSignificantLinesToConverge);
        TeamInternal.InlineEditsXtabLanguageContextEnabled = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.languageContext.enabled', 1 /* ConfigType.ExperimentBased */, xtabPromptOptions.DEFAULT_OPTIONS.languageContext.enabled);
        TeamInternal.InlineEditsXtabLanguageContextMaxTokens = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.languageContext.maxTokens', 1 /* ConfigType.ExperimentBased */, xtabPromptOptions.DEFAULT_OPTIONS.languageContext.maxTokens);
        TeamInternal.InlineEditsXtabMaxMergeConflictLines = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.maxMergeConflictLines', 1 /* ConfigType.ExperimentBased */, undefined);
        TeamInternal.InlineEditsXtabOnlyMergeConflictLines = defineTeamInternalSetting('chat.advanced.inlineEdits.xtabProvider.onlyMergeConflictLines', 1 /* ConfigType.ExperimentBased */, false);
        TeamInternal.InlineEditsUndoInsertionFiltering = defineTeamInternalSetting('chat.advanced.inlineEdits.undoInsertionFiltering', 1 /* ConfigType.ExperimentBased */, 'v1');
        TeamInternal.InstantApplyModelName = defineTeamInternalSetting('chat.advanced.instantApply.modelName', 1 /* ConfigType.ExperimentBased */, 'gpt-4o-instant-apply-full-ft-v66');
        TeamInternal.VerifyTextDocumentChanges = defineTeamInternalSetting('chat.advanced.inlineEdits.verifyTextDocumentChanges', 1 /* ConfigType.ExperimentBased */, false);
        // TODO: @sandy081 - These should be moved away from this namespace
        TeamInternal.EnableReadFileV2 = defineSetting('chat.advanced.enableReadFileV2', 1 /* ConfigType.ExperimentBased */, packagejson_1.isPreRelease);
        TeamInternal.AskAgent = defineSetting('chat.advanced.enableAskAgent', 1 /* ConfigType.ExperimentBased */, { defaultValue: false, teamDefaultValue: true, internalDefaultValue: true });
        TeamInternal.RetryNetworkErrors = defineSetting('chat.advanced.enableRetryNetworkErrors', 1 /* ConfigType.ExperimentBased */, false);
    })(TeamInternal = ConfigKey.TeamInternal || (ConfigKey.TeamInternal = {}));
    ConfigKey.Enable = defineSetting('enable', 0 /* ConfigType.Simple */, {
        "*": true,
        "plaintext": false,
        "markdown": false,
        "scminput": false
    });
    ConfigKey.selectedCompletionsModel = defineSetting('selectedCompletionModel', 0 /* ConfigType.Simple */, '');
    /** Use the Responses API instead of Chat Completions when supported */
    ConfigKey.UseResponsesApi = defineSetting('chat.useResponsesApi', 1 /* ConfigType.ExperimentBased */, true);
    /** Configure reasoning effort sent to Responses API */
    ConfigKey.ResponsesApiReasoningEffort = defineSetting('chat.responsesApiReasoningEffort', 1 /* ConfigType.ExperimentBased */, 'default');
    /** Configure reasoning summary style sent to Responses API */
    ConfigKey.ResponsesApiReasoningSummary = defineSetting('chat.responsesApiReasoningSummary', 1 /* ConfigType.ExperimentBased */, 'detailed');
    /** Use the Messages API instead of Chat Completions when supported */
    ConfigKey.UseMessagesApi = defineSetting('chat.useMessagesApi', 1 /* ConfigType.ExperimentBased */, false);
    ConfigKey.EnableChatImageUpload = defineSetting('chat.imageUpload.enabled', 1 /* ConfigType.ExperimentBased */, true);
    /** Enable extended thinking for Anthropic models that support it */
    ConfigKey.AnthropicThinkingEnabled = defineSetting('chat.anthropic.thinking.enabled', 1 /* ConfigType.ExperimentBased */, false);
    /** Maximum thinking tokens for Anthropic extended thinking. If set, overrides the default calculation. */
    ConfigKey.MaxAnthropicThinkingTokens = defineSetting('chat.anthropic.thinking.maxTokens', 0 /* ConfigType.Simple */, null);
    /** Enable Anthropic web search tool for BYOK Claude models */
    ConfigKey.AnthropicWebSearchToolEnabled = defineSetting('chat.anthropic.tools.websearch.enabled', 1 /* ConfigType.ExperimentBased */, false);
    /** Maximum number of web searches allowed per request */
    ConfigKey.AnthropicWebSearchMaxUses = defineSetting('chat.anthropic.tools.websearch.maxUses', 0 /* ConfigType.Simple */, 5);
    /** List of domains to restrict web search results to */
    ConfigKey.AnthropicWebSearchAllowedDomains = defineSetting('chat.anthropic.tools.websearch.allowedDomains', 0 /* ConfigType.Simple */, []);
    /** List of domains to exclude from web search results */
    ConfigKey.AnthropicWebSearchBlockedDomains = defineSetting('chat.anthropic.tools.websearch.blockedDomains', 0 /* ConfigType.Simple */, []);
    /** User location for personalizing web search results */
    ConfigKey.AnthropicWebSearchUserLocation = defineSetting('chat.anthropic.tools.websearch.userLocation', 0 /* ConfigType.Simple */, null);
    /** Enable memory tool */
    ConfigKey.MemoryToolEnabled = defineSetting('chat.tools.memory.enabled', 1 /* ConfigType.ExperimentBased */, false);
    /** User provided code generation instructions for the chat */
    ConfigKey.CodeGenerationInstructions = defineSetting('chat.codeGeneration.instructions', 0 /* ConfigType.Simple */, []);
    ConfigKey.TestGenerationInstructions = defineSetting('chat.testGeneration.instructions', 0 /* ConfigType.Simple */, []);
    ConfigKey.CommitMessageGenerationInstructions = defineSetting('chat.commitMessageGeneration.instructions', 0 /* ConfigType.Simple */, []);
    ConfigKey.PullRequestDescriptionGenerationInstructions = defineSetting('chat.pullRequestDescriptionGeneration.instructions', 0 /* ConfigType.Simple */, []);
    /** Show code lens "Generate tests" when we have test coverage info about this symbol and it's not covered */
    ConfigKey.GenerateTestsCodeLens = defineSetting('chat.generateTests.codeLens', 0 /* ConfigType.Simple */, false);
    /** Whether new flows around setting up tests are enabled */
    ConfigKey.SetupTests = defineSetting('chat.setupTests.enabled', 0 /* ConfigType.Simple */, true);
    /** Whether the Copilot TypeScript context provider is enabled and if how */
    ConfigKey.TypeScriptLanguageContext = defineSetting('chat.languageContext.typescript.enabled', 1 /* ConfigType.ExperimentBased */, false);
    ConfigKey.TypeScriptLanguageContextMode = defineSetting('chat.languageContext.typescript.items', 1 /* ConfigType.ExperimentBased */, 'double');
    ConfigKey.TypeScriptLanguageContextIncludeDocumentation = defineSetting('chat.languageContext.typescript.includeDocumentation', 1 /* ConfigType.ExperimentBased */, false);
    ConfigKey.TypeScriptLanguageContextCacheTimeout = defineSetting('chat.languageContext.typescript.cacheTimeout', 1 /* ConfigType.ExperimentBased */, 500);
    ConfigKey.TypeScriptLanguageContextFix = defineSetting('chat.languageContext.fix.typescript.enabled', 1 /* ConfigType.ExperimentBased */, false);
    ConfigKey.TypeScriptLanguageContextInline = defineSetting('chat.languageContext.inline.typescript.enabled', 1 /* ConfigType.ExperimentBased */, false);
    ConfigKey.UseInstructionFiles = defineSetting('chat.codeGeneration.useInstructionFiles', 0 /* ConfigType.Simple */, true);
    ConfigKey.ReviewAgent = defineSetting('chat.reviewAgent.enabled', 0 /* ConfigType.Simple */, true);
    ConfigKey.CodeFeedback = defineSetting('chat.reviewSelection.enabled', 0 /* ConfigType.Simple */, true);
    ConfigKey.CodeFeedbackInstructions = defineSetting('chat.reviewSelection.instructions', 0 /* ConfigType.Simple */, []);
    ConfigKey.UseProjectTemplates = defineSetting('chat.useProjectTemplates', 0 /* ConfigType.Simple */, true);
    ConfigKey.AgentDelegateAutoCommitAndPush = defineSetting('chat.agent.delegate.autoCommitAndPush', 0 /* ConfigType.Simple */, false);
    ConfigKey.ExplainScopeSelection = defineSetting('chat.scopeSelection', 0 /* ConfigType.Simple */, false);
    ConfigKey.EnableCodeActions = defineSetting('editor.enableCodeActions', 0 /* ConfigType.Simple */, true);
    ConfigKey.LocaleOverride = defineSetting('chat.localeOverride', 0 /* ConfigType.Simple */, 'auto');
    ConfigKey.TerminalChatLocation = defineSetting('chat.terminalChatLocation', 0 /* ConfigType.Simple */, 'chatView');
    ConfigKey.AutomaticRenameSuggestions = defineSetting('renameSuggestions.triggerAutomatically', 0 /* ConfigType.Simple */, true);
    ConfigKey.GitHistoryRelatedFilesProvider = defineSetting('chat.edits.suggestRelatedFilesFromGitHistory', 0 /* ConfigType.Simple */, true);
    ConfigKey.Test2SrcRelatedFilesProvider = defineSetting('chat.edits.suggestRelatedFilesForTests', 0 /* ConfigType.Simple */, true);
    ConfigKey.TerminalToDebuggerEnabled = defineSetting('chat.copilotDebugCommand.enabled', 0 /* ConfigType.Simple */, true);
    ConfigKey.CodeSearchAgentEnabled = defineSetting('chat.codesearch.enabled', 0 /* ConfigType.Simple */, false);
    ConfigKey.InlineEditsEnabled = defineSetting('nextEditSuggestions.enabled', 1 /* ConfigType.ExperimentBased */, { defaultValue: false, teamDefaultValue: true });
    ConfigKey.InlineEditsEnableDiagnosticsProvider = defineSetting('nextEditSuggestions.fixes', 1 /* ConfigType.ExperimentBased */, { defaultValue: true, teamDefaultValue: true });
    ConfigKey.InlineEditsAllowWhitespaceOnlyChanges = defineSetting('nextEditSuggestions.allowWhitespaceOnlyChanges', 1 /* ConfigType.ExperimentBased */, true);
    ConfigKey.NewWorkspaceCreationAgentEnabled = defineSetting('chat.newWorkspaceCreation.enabled', 0 /* ConfigType.Simple */, true);
    ConfigKey.NewWorkspaceUseContext7 = defineSetting('chat.newWorkspace.useContext7', 0 /* ConfigType.Simple */, false);
    ConfigKey.SummarizeAgentConversationHistory = defineSetting('chat.summarizeAgentConversationHistory.enabled', 0 /* ConfigType.Simple */, true);
    ConfigKey.VirtualToolThreshold = defineSetting('chat.virtualTools.threshold', 1 /* ConfigType.ExperimentBased */, exports.HARD_TOOL_LIMIT);
    ConfigKey.CurrentEditorAgentContext = defineSetting('chat.agent.currentEditorContext.enabled', 0 /* ConfigType.Simple */, true);
    /** BYOK  */
    ConfigKey.OllamaEndpoint = defineSetting('chat.byok.ollamaEndpoint', 0 /* ConfigType.Simple */, 'http://localhost:11434');
    ConfigKey.AzureAuthType = defineSetting('chat.azureAuthType', 0 /* ConfigType.Simple */, AzureAuthMode.EntraId);
    ConfigKey.AzureModels = defineSetting('chat.azureModels', 0 /* ConfigType.Simple */, {});
    ConfigKey.CustomOAIModels = defineSetting('chat.customOAIModels', 0 /* ConfigType.Simple */, {});
    ConfigKey.AutoFixDiagnostics = defineSetting('chat.agent.autoFix', 1 /* ConfigType.ExperimentBased */, true);
    ConfigKey.NotebookFollowCellExecution = defineSetting('chat.notebook.followCellExecution.enabled', 0 /* ConfigType.Simple */, false);
    ConfigKey.UseAlternativeNESNotebookFormat = defineSetting('chat.notebook.enhancedNextEditSuggestions.enabled', 1 /* ConfigType.ExperimentBased */, false);
    ConfigKey.CustomInstructionsInSystemMessage = defineSetting('chat.customInstructionsInSystemMessage', 0 /* ConfigType.Simple */, true);
    ConfigKey.EnableAlternateGptPrompt = defineSetting('chat.alternateGptPrompt.enabled', 1 /* ConfigType.ExperimentBased */, false);
    ConfigKey.CompletionsFetcher = defineSetting('chat.completionsFetcher', 1 /* ConfigType.ExperimentBased */, undefined);
    ConfigKey.NextEditSuggestionsFetcher = defineSetting('chat.nesFetcher', 1 /* ConfigType.ExperimentBased */, undefined);
    ConfigKey.GitHubMcpEnabled = defineSetting('chat.githubMcpServer.enabled', 1 /* ConfigType.ExperimentBased */, false);
    ConfigKey.GitHubMcpToolsets = defineSetting('chat.githubMcpServer.toolsets', 0 /* ConfigType.Simple */, ['default']);
    ConfigKey.GitHubMcpReadonly = defineSetting('chat.githubMcpServer.readonly', 0 /* ConfigType.Simple */, false);
    ConfigKey.GitHubMcpLockdown = defineSetting('chat.githubMcpServer.lockdown', 0 /* ConfigType.Simple */, false);
})(ConfigKey || (exports.ConfigKey = ConfigKey = {}));
function getAllConfigKeys() {
    return Object.values(ConfigKey).flatMap(namespace => Object.values(namespace).map(setting => setting.fullyQualifiedId));
}
const nextEditProviderIds = [];
function registerNextEditProviderId(providerId) {
    nextEditProviderIds.push(providerId);
    return providerId;
}
//# sourceMappingURL=configurationService.js.map