
import { Schemas } from '../../../../base/common/network.js';
import { IChatSessionsService } from './chatSessionsService.service.js';
import { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';

var ChatConfiguration;
(function(ChatConfiguration) {
    ChatConfiguration["AIDisabled"] = "chat.disableAIFeatures";
    ChatConfiguration["PluginsEnabled"] = "chat.plugins.enabled";
    ChatConfiguration["PluginLocations"] = "chat.pluginLocations";
    ChatConfiguration["PluginMarketplaces"] = "chat.plugins.marketplaces";
    ChatConfiguration["AgentEnabled"] = "chat.agent.enabled";
    ChatConfiguration["PlanAgentDefaultModel"] = "chat.planAgent.defaultModel";
    ChatConfiguration["ExploreAgentDefaultModel"] = "chat.exploreAgent.defaultModel";
    ChatConfiguration["RequestQueueingDefaultAction"] = "chat.requestQueuing.defaultAction";
    ChatConfiguration["AgentStatusEnabled"] = "chat.agentsControl.enabled";
    ChatConfiguration["EditorAssociations"] = "chat.editorAssociations";
    ChatConfiguration["UnifiedAgentsBar"] = "chat.unifiedAgentsBar.enabled";
    ChatConfiguration["AgentSessionProjectionEnabled"] = "chat.agentSessionProjection.enabled";
    ChatConfiguration["EditModeHidden"] = "chat.editMode.hidden";
    ChatConfiguration["ExtensionToolsEnabled"] = "chat.extensionTools.enabled";
    ChatConfiguration["RepoInfoEnabled"] = "chat.repoInfo.enabled";
    ChatConfiguration["EditRequests"] = "chat.editRequests";
    ChatConfiguration["InlineReferencesStyle"] = "chat.inlineReferences.style";
    ChatConfiguration["AutoReply"] = "chat.autoReply";
    ChatConfiguration["GlobalAutoApprove"] = "chat.tools.global.autoApprove";
    ChatConfiguration["AutoApproveEdits"] = "chat.tools.edits.autoApprove";
    ChatConfiguration["AutoApprovedUrls"] = "chat.tools.urls.autoApprove";
    ChatConfiguration["EligibleForAutoApproval"] = "chat.tools.eligibleForAutoApproval";
    ChatConfiguration["EnableMath"] = "chat.math.enabled";
    ChatConfiguration["CheckpointsEnabled"] = "chat.checkpoints.enabled";
    ChatConfiguration["ThinkingStyle"] = "chat.agent.thinkingStyle";
    ChatConfiguration["ThinkingGenerateTitles"] = "chat.agent.thinking.generateTitles";
    ChatConfiguration["TerminalToolsInThinking"] = "chat.agent.thinking.terminalTools";
    ChatConfiguration["SimpleTerminalCollapsible"] = "chat.tools.terminal.simpleCollapsible";
    ChatConfiguration["ThinkingPhrases"] = "chat.agent.thinking.phrases";
    ChatConfiguration["AutoExpandToolFailures"] = "chat.tools.autoExpandFailures";
    ChatConfiguration["TodosShowWidget"] = "chat.tools.todos.showWidget";
    ChatConfiguration["NotifyWindowOnConfirmation"] = "chat.notifyWindowOnConfirmation";
    ChatConfiguration["NotifyWindowOnResponseReceived"] = "chat.notifyWindowOnResponseReceived";
    ChatConfiguration["ChatViewSessionsEnabled"] = "chat.viewSessions.enabled";
    ChatConfiguration["ChatViewSessionsGrouping"] = "chat.viewSessions.grouping";
    ChatConfiguration["ChatViewSessionsOrientation"] = "chat.viewSessions.orientation";
    ChatConfiguration["ChatViewProgressBadgeEnabled"] = "chat.viewProgressBadge.enabled";
    ChatConfiguration["ChatContextUsageEnabled"] = "chat.contextUsage.enabled";
    ChatConfiguration["SubagentToolCustomAgents"] = "chat.customAgentInSubagent.enabled";
    ChatConfiguration["SubagentsAllowInvocationsFromSubagents"] = "chat.subagents.allowInvocationsFromSubagents";
    ChatConfiguration["ShowCodeBlockProgressAnimation"] = "chat.agent.codeBlockProgress";
    ChatConfiguration["RestoreLastPanelSession"] = "chat.restoreLastPanelSession";
    ChatConfiguration["ExitAfterDelegation"] = "chat.exitAfterDelegation";
    ChatConfiguration["ExplainChangesEnabled"] = "chat.editing.explainChanges.enabled";
    ChatConfiguration["RevealNextChangeOnResolve"] = "chat.editing.revealNextChangeOnResolve";
    ChatConfiguration["GrowthNotificationEnabled"] = "chat.growthNotification.enabled";
    ChatConfiguration["ChatCustomizationMenuEnabled"] = "chat.customizationsMenu.enabled";
    ChatConfiguration["ChatCustomizationHarnessSelectorEnabled"] = "chat.customizations.harnessSelector.enabled";
    ChatConfiguration["AutopilotEnabled"] = "chat.autopilot.enabled";
    ChatConfiguration["ImageCarouselEnabled"] = "imageCarousel.chat.enabled";
    ChatConfiguration["ArtifactsEnabled"] = "chat.artifacts.enabled";
})(ChatConfiguration || (ChatConfiguration = {}));
var ChatModeKind;
(function(ChatModeKind) {
    ChatModeKind["Ask"] = "ask";
    ChatModeKind["Edit"] = "edit";
    ChatModeKind["Agent"] = "agent";
})(ChatModeKind || (ChatModeKind = {}));
function validateChatMode(mode) {
    switch (mode) {
    case ChatModeKind.Ask:
    case ChatModeKind.Edit:
    case ChatModeKind.Agent:
        return mode;
    default:
        return undefined;
    }
}
var ChatPermissionLevel;
(function(ChatPermissionLevel) {
    ChatPermissionLevel["Default"] = "default";
    ChatPermissionLevel["AutoApprove"] = "autoApprove";
    ChatPermissionLevel["Autopilot"] = "autopilot";
})(ChatPermissionLevel || (ChatPermissionLevel = {}));
function isAutoApproveLevel(level) {
    return level === ChatPermissionLevel.AutoApprove || level === ChatPermissionLevel.Autopilot;
}
var ThinkingDisplayMode;
(function(ThinkingDisplayMode) {
    ThinkingDisplayMode["Collapsed"] = "collapsed";
    ThinkingDisplayMode["CollapsedPreview"] = "collapsedPreview";
    ThinkingDisplayMode["FixedScrolling"] = "fixedScrolling";
})(ThinkingDisplayMode || (ThinkingDisplayMode = {}));
var CollapsedToolsDisplayMode;
(function(CollapsedToolsDisplayMode) {
    CollapsedToolsDisplayMode["Off"] = "off";
    CollapsedToolsDisplayMode["WithThinking"] = "withThinking";
    CollapsedToolsDisplayMode["Always"] = "always";
})(CollapsedToolsDisplayMode || (CollapsedToolsDisplayMode = {}));
var ChatNotificationMode;
(function(ChatNotificationMode) {
    ChatNotificationMode["Off"] = "off";
    ChatNotificationMode["WindowNotFocused"] = "windowNotFocused";
    ChatNotificationMode["Always"] = "always";
})(ChatNotificationMode || (ChatNotificationMode = {}));
var ChatAgentLocation;
(function(ChatAgentLocation) {
    ChatAgentLocation["Chat"] = "panel";
    ChatAgentLocation["Terminal"] = "terminal";
    ChatAgentLocation["Notebook"] = "notebook";
    ChatAgentLocation["EditorInline"] = "editor";
})(ChatAgentLocation || (ChatAgentLocation = {}));
(function(ChatAgentLocation) {
    function fromRaw(value) {
        switch (value) {
        case "panel":
            return ChatAgentLocation.Chat;
        case "terminal":
            return ChatAgentLocation.Terminal;
        case "notebook":
            return ChatAgentLocation.Notebook;
        case "editor":
            return ChatAgentLocation.EditorInline;
        }
        return ChatAgentLocation.Chat;
    }
    ChatAgentLocation.fromRaw = fromRaw;
})(ChatAgentLocation || (ChatAgentLocation = {}));
const chatAlwaysUnsupportedFileSchemes = ( new Set([
    Schemas.vscodeChatEditor,
    Schemas.walkThrough,
    Schemas.vscodeLocalChatSession,
    Schemas.vscodeSettings,
    Schemas.webviewPanel,
    Schemas.vscodeUserData,
    Schemas.extension,
    "ccreq",
    "openai-codex"
]));
function isSupportedChatFileScheme(accessor, scheme) {
    const chatService = accessor.get(IChatSessionsService);
    if (( chatAlwaysUnsupportedFileSchemes.has(scheme))) {
        return false;
    }
    if (chatService.getContentProviderSchemes().includes(scheme)) {
        return false;
    }
    return true;
}
const MANAGE_CHAT_COMMAND_ID = "workbench.action.chat.manage";
const ChatEditorTitleMaxLength = 30;
const CONTEXT_MODELS_EDITOR = ( new RawContextKey("inModelsEditor", false));
const CONTEXT_MODELS_SEARCH_FOCUS = ( new RawContextKey("inModelsSearch", false));

export { CONTEXT_MODELS_EDITOR, CONTEXT_MODELS_SEARCH_FOCUS, ChatAgentLocation, ChatConfiguration, ChatEditorTitleMaxLength, ChatModeKind, ChatNotificationMode, ChatPermissionLevel, CollapsedToolsDisplayMode, MANAGE_CHAT_COMMAND_ID, ThinkingDisplayMode, isAutoApproveLevel, isSupportedChatFileScheme, validateChatMode };
