
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["AgentEnabled"] = "chat.agent.enabled";
    ChatConfiguration["Edits2Enabled"] = "chat.edits2.enabled";
    ChatConfiguration["ExtensionToolsEnabled"] = "chat.extensionTools.enabled";
    ChatConfiguration["EditRequests"] = "chat.editRequests";
    ChatConfiguration["GlobalAutoApprove"] = "chat.tools.global.autoApprove";
    ChatConfiguration["AutoApproveEdits"] = "chat.tools.edits.autoApprove";
    ChatConfiguration["EligibleForAutoApproval"] = "chat.tools.eligibleForAutoApproval";
    ChatConfiguration["EnableMath"] = "chat.math.enabled";
    ChatConfiguration["CheckpointsEnabled"] = "chat.checkpoints.enabled";
    ChatConfiguration["AgentSessionsViewLocation"] = "chat.agentSessionsViewLocation";
    ChatConfiguration["ThinkingStyle"] = "chat.agent.thinkingStyle";
    ChatConfiguration["TodosShowWidget"] = "chat.tools.todos.showWidget";
    ChatConfiguration["UseCloudButtonV2"] = "chat.useCloudButtonV2";
    ChatConfiguration["ShowAgentSessionsViewDescription"] = "chat.showAgentSessionsViewDescription";
    ChatConfiguration["EmptyStateHistoryEnabled"] = "chat.emptyState.history.enabled";
    ChatConfiguration["NotifyWindowOnResponseReceived"] = "chat.notifyWindowOnResponseReceived";
    ChatConfiguration["SubagentToolCustomAgents"] = "chat.customAgentInSubagent.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 ThinkingDisplayMode;
(function (ThinkingDisplayMode) {
    ThinkingDisplayMode["Collapsed"] = "collapsed";
    ThinkingDisplayMode["CollapsedPreview"] = "collapsedPreview";
    ThinkingDisplayMode["FixedScrolling"] = "fixedScrolling";
})(ThinkingDisplayMode || (ThinkingDisplayMode = {}));
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 AGENT_SESSIONS_VIEWLET_ID = 'workbench.view.chat.sessions';
const MANAGE_CHAT_COMMAND_ID = 'workbench.action.chat.manage';
const ChatEditorTitleMaxLength = 30;
const CHAT_TERMINAL_OUTPUT_MAX_PREVIEW_LINES = 1000;
const CONTEXT_MODELS_EDITOR = ( new RawContextKey('inModelsEditor', false));
const CONTEXT_MODELS_SEARCH_FOCUS = ( new RawContextKey('inModelsSearch', false));

export { AGENT_SESSIONS_VIEWLET_ID, CHAT_TERMINAL_OUTPUT_MAX_PREVIEW_LINES, CONTEXT_MODELS_EDITOR, CONTEXT_MODELS_SEARCH_FOCUS, ChatAgentLocation, ChatConfiguration, ChatEditorTitleMaxLength, ChatModeKind, MANAGE_CHAT_COMMAND_ID, ThinkingDisplayMode, isSupportedChatFileScheme, validateChatMode };
