Path: blob/main/src/vs/workbench/contrib/chat/common/constants.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { Schemas } from '../../../../base/common/network.js';67export enum ChatConfiguration {8UseFileStorage = 'chat.useFileStorage',9AgentEnabled = 'chat.agent.enabled',10Edits2Enabled = 'chat.edits2.enabled',11ExtensionToolsEnabled = 'chat.extensionTools.enabled',12EditRequests = 'chat.editRequests',13GlobalAutoApprove = 'chat.tools.global.autoApprove',14AutoApproveEdits = 'chat.tools.edits.autoApprove',15EnableMath = 'chat.math.enabled',16CheckpointsEnabled = 'chat.checkpoints.enabled',17AgentSessionsViewLocation = 'chat.agentSessionsViewLocation',18ThinkingStyle = 'chat.agent.thinkingStyle',19UseChatSessionsForCloudButton = 'chat.useChatSessionsForCloudButton',20ShowAgentSessionsViewDescription = 'chat.showAgentSessionsViewDescription',21EmptyStateHistoryEnabled = 'chat.emptyState.history.enabled'22}2324/**25* The "kind" of the chat mode- "Agent" for custom modes.26*/27export enum ChatModeKind {28Ask = 'ask',29Edit = 'edit',30Agent = 'agent'31}3233export function validateChatMode(mode: unknown): ChatModeKind | undefined {34switch (mode) {35case ChatModeKind.Ask:36case ChatModeKind.Edit:37case ChatModeKind.Agent:38return mode as ChatModeKind;39default:40return undefined;41}42}4344export function isChatMode(mode: unknown): mode is ChatModeKind {45return !!validateChatMode(mode);46}4748// Thinking display modes for pinned content49export enum ThinkingDisplayMode {50Collapsed = 'collapsed',51CollapsedPreview = 'collapsedPreview',52Expanded = 'expanded',53None = 'none'54}5556export type RawChatParticipantLocation = 'panel' | 'terminal' | 'notebook' | 'editing-session';5758export enum ChatAgentLocation {59Panel = 'panel',60Terminal = 'terminal',61Notebook = 'notebook',62Editor = 'editor',63}6465export namespace ChatAgentLocation {66export function fromRaw(value: RawChatParticipantLocation | string): ChatAgentLocation {67switch (value) {68case 'panel': return ChatAgentLocation.Panel;69case 'terminal': return ChatAgentLocation.Terminal;70case 'notebook': return ChatAgentLocation.Notebook;71case 'editor': return ChatAgentLocation.Editor;72}73return ChatAgentLocation.Panel;74}75}7677export const ChatUnsupportedFileSchemes = new Set([Schemas.vscodeChatEditor, Schemas.walkThrough, Schemas.vscodeChatSession, 'ccreq']);787980