Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/chat/browser/chat.contribution.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { timeout } from '../../../../base/common/async.js';
7
import { Event } from '../../../../base/common/event.js';
8
import { MarkdownString, isMarkdownString } from '../../../../base/common/htmlContent.js';
9
import { Disposable } from '../../../../base/common/lifecycle.js';
10
import { Schemas } from '../../../../base/common/network.js';
11
import { isMacintosh } from '../../../../base/common/platform.js';
12
import { assertDefined } from '../../../../base/common/types.js';
13
import { registerEditorFeature } from '../../../../editor/common/editorFeatures.js';
14
import * as nls from '../../../../nls.js';
15
import { AccessibleViewRegistry } from '../../../../platform/accessibility/browser/accessibleViewRegistry.js';
16
import { registerAction2 } from '../../../../platform/actions/common/actions.js';
17
import { ICommandService } from '../../../../platform/commands/common/commands.js';
18
import { Extensions as ConfigurationExtensions, ConfigurationScope, IConfigurationNode, IConfigurationRegistry } from '../../../../platform/configuration/common/configurationRegistry.js';
19
import { SyncDescriptor } from '../../../../platform/instantiation/common/descriptors.js';
20
import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';
21
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
22
import { McpAccessValue, McpAutoStartValue, mcpAccessConfig, mcpAutoStartConfig, mcpGalleryServiceUrlConfig } from '../../../../platform/mcp/common/mcpManagement.js';
23
import { Registry } from '../../../../platform/registry/common/platform.js';
24
import { EditorPaneDescriptor, IEditorPaneRegistry } from '../../../browser/editor.js';
25
import { Extensions, IConfigurationMigrationRegistry } from '../../../common/configuration.js';
26
import { IWorkbenchContribution, WorkbenchPhase, registerWorkbenchContribution2 } from '../../../common/contributions.js';
27
import { EditorExtensions, IEditorFactoryRegistry } from '../../../common/editor.js';
28
import { IWorkbenchAssignmentService } from '../../../services/assignment/common/assignmentService.js';
29
import { IEditorResolverService, RegisteredEditorPriority } from '../../../services/editor/common/editorResolverService.js';
30
import { AddConfigurationType, AssistedTypes } from '../../mcp/browser/mcpCommandsAddConfiguration.js';
31
import { allDiscoverySources, discoverySourceSettingsLabel, mcpDiscoverySection, mcpServerSamplingSection } from '../../mcp/common/mcpConfiguration.js';
32
import { ChatAgentNameService, ChatAgentService, IChatAgentNameService, IChatAgentService } from '../common/chatAgents.js';
33
import { CodeMapperService, ICodeMapperService } from '../common/chatCodeMapperService.js';
34
import '../common/chatColors.js';
35
import { IChatEditingService } from '../common/chatEditingService.js';
36
import { ChatEntitlement, ChatEntitlementService, IChatEntitlementService } from '../common/chatEntitlementService.js';
37
import { ChatModeService, IChatModeService } from '../common/chatModes.js';
38
import { ChatResponseResourceFileSystemProvider } from '../common/chatResponseResourceFileSystemProvider.js';
39
import { IChatService } from '../common/chatService.js';
40
import { ChatService } from '../common/chatServiceImpl.js';
41
import { ChatSlashCommandService, IChatSlashCommandService } from '../common/chatSlashCommands.js';
42
import { ChatTodoListService, IChatTodoListService } from '../common/chatTodoListService.js';
43
import { ChatTransferService, IChatTransferService } from '../common/chatTransferService.js';
44
import { IChatVariablesService } from '../common/chatVariables.js';
45
import { ChatWidgetHistoryService, IChatWidgetHistoryService } from '../common/chatWidgetHistoryService.js';
46
import { ChatAgentLocation, ChatConfiguration, ChatModeKind } from '../common/constants.js';
47
import { ILanguageModelIgnoredFilesService, LanguageModelIgnoredFilesService } from '../common/ignoredFiles.js';
48
import { ILanguageModelsService, LanguageModelsService } from '../common/languageModels.js';
49
import { ILanguageModelStatsService, LanguageModelStatsService } from '../common/languageModelStats.js';
50
import { ILanguageModelToolsService } from '../common/languageModelToolsService.js';
51
import { PromptsConfig } from '../common/promptSyntax/config/config.js';
52
import { INSTRUCTIONS_DEFAULT_SOURCE_FOLDER, INSTRUCTION_FILE_EXTENSION, MODE_DEFAULT_SOURCE_FOLDER, MODE_FILE_EXTENSION, PROMPT_DEFAULT_SOURCE_FOLDER, PROMPT_FILE_EXTENSION } from '../common/promptSyntax/config/promptFileLocations.js';
53
import { registerPromptFileContributions } from '../common/promptSyntax/promptFileContributions.js';
54
import { INSTRUCTIONS_DOCUMENTATION_URL, MODE_DOCUMENTATION_URL, PROMPT_DOCUMENTATION_URL } from '../common/promptSyntax/promptTypes.js';
55
import { IPromptsService } from '../common/promptSyntax/service/promptsService.js';
56
import { PromptsService } from '../common/promptSyntax/service/promptsServiceImpl.js';
57
import { LanguageModelToolsExtensionPointHandler } from '../common/tools/languageModelToolsContribution.js';
58
import { BuiltinToolsContribution } from '../common/tools/tools.js';
59
import { IVoiceChatService, VoiceChatService } from '../common/voiceChatService.js';
60
import { AgentChatAccessibilityHelp, EditsChatAccessibilityHelp, PanelChatAccessibilityHelp, QuickChatAccessibilityHelp } from './actions/chatAccessibilityHelp.js';
61
import { registerChatAccessibilityActions } from './actions/chatAccessibilityActions.js';
62
import { ACTION_ID_NEW_CHAT, CopilotTitleBarMenuRendering, registerChatActions } from './actions/chatActions.js';
63
import { registerNewChatActions } from './actions/chatClearActions.js';
64
import { CodeBlockActionRendering, registerChatCodeBlockActions, registerChatCodeCompareBlockActions } from './actions/chatCodeblockActions.js';
65
import { ChatContextContributions } from './actions/chatContext.js';
66
import { registerChatContextActions } from './actions/chatContextActions.js';
67
import { registerChatCopyActions } from './actions/chatCopyActions.js';
68
import { registerChatDeveloperActions } from './actions/chatDeveloperActions.js';
69
import { ChatSubmitAction, registerChatExecuteActions } from './actions/chatExecuteActions.js';
70
import { registerChatFileTreeActions } from './actions/chatFileTreeActions.js';
71
import { ChatGettingStartedContribution } from './actions/chatGettingStarted.js';
72
import { registerChatExportActions } from './actions/chatImportExport.js';
73
import { registerLanguageModelActions } from './actions/chatLanguageModelActions.js';
74
import { registerMoveActions } from './actions/chatMoveActions.js';
75
import { registerQuickChatActions } from './actions/chatQuickInputActions.js';
76
import { registerChatTitleActions } from './actions/chatTitleActions.js';
77
import { registerChatToolActions } from './actions/chatToolActions.js';
78
import { ChatTransferContribution } from './actions/chatTransfer.js';
79
import { IChatAccessibilityService, IChatCodeBlockContextProviderService, IChatWidgetService, IQuickChatService } from './chat.js';
80
import { ChatAccessibilityService } from './chatAccessibilityService.js';
81
import './chatAttachmentModel.js';
82
import { ChatAttachmentResolveService, IChatAttachmentResolveService } from './chatAttachmentResolveService.js';
83
import { ChatMarkdownAnchorService, IChatMarkdownAnchorService } from './chatContentParts/chatMarkdownAnchorService.js';
84
import { ChatContextPickService, IChatContextPickService } from './chatContextPickService.js';
85
import { ChatInputBoxContentProvider } from './chatEdinputInputContentProvider.js';
86
import { ChatEditingEditorAccessibility } from './chatEditing/chatEditingEditorAccessibility.js';
87
import { registerChatEditorActions } from './chatEditing/chatEditingEditorActions.js';
88
import { ChatEditingEditorContextKeys } from './chatEditing/chatEditingEditorContextKeys.js';
89
import { ChatEditingEditorOverlay } from './chatEditing/chatEditingEditorOverlay.js';
90
import { ChatEditingService } from './chatEditing/chatEditingServiceImpl.js';
91
import { ChatEditingNotebookFileSystemProviderContrib } from './chatEditing/notebook/chatEditingNotebookFileSystemProvider.js';
92
import { SimpleBrowserOverlay } from './chatEditing/simpleBrowserEditorOverlay.js';
93
import { ChatEditor, IChatEditorOptions } from './chatEditor.js';
94
import { ChatEditorInput, ChatEditorInputSerializer } from './chatEditorInput.js';
95
import { agentSlashCommandToMarkdown, agentToMarkdown } from './chatMarkdownDecorationsRenderer.js';
96
import { ChatOutputRendererService, IChatOutputRendererService } from './chatOutputItemRenderer.js';
97
import { ChatCompatibilityNotifier, ChatExtensionPointHandler } from './chatParticipant.contribution.js';
98
import { ChatPasteProvidersFeature } from './chatPasteProviders.js';
99
import { QuickChatService } from './chatQuick.js';
100
import { ChatResponseAccessibleView } from './chatResponseAccessibleView.js';
101
import { ChatSessionsView } from './chatSessions.js';
102
import { ChatSetupContribution, ChatTeardownContribution } from './chatSetup.js';
103
import { ChatStatusBarEntry } from './chatStatus.js';
104
import { ChatVariablesService } from './chatVariables.js';
105
import { ChatWidget, ChatWidgetService } from './chatWidget.js';
106
import { ChatCodeBlockContextProviderService } from './codeBlockContextProviderService.js';
107
import { ChatDynamicVariableModel } from './contrib/chatDynamicVariables.js';
108
import { ChatImplicitContextContribution } from './contrib/chatImplicitContext.js';
109
import './contrib/chatInputCompletions.js';
110
import './contrib/chatInputEditorContrib.js';
111
import './contrib/chatInputEditorHover.js';
112
import { ChatRelatedFilesContribution } from './contrib/chatInputRelatedFilesContrib.js';
113
import { globalAutoApproveDescription, LanguageModelToolsService } from './languageModelToolsService.js';
114
import './promptSyntax/promptCodingAgentActionContribution.js';
115
import './promptSyntax/promptToolsCodeLensProvider.js';
116
import { PromptUrlHandler } from './promptSyntax/promptUrlHandler.js';
117
import { SAVE_TO_PROMPT_ACTION_ID, SAVE_TO_PROMPT_SLASH_COMMAND_NAME } from './promptSyntax/saveToPromptAction.js';
118
import { ConfigureToolSets, UserToolSetsContributions } from './tools/toolSetsContribution.js';
119
import { ChatViewsWelcomeHandler } from './viewsWelcome/chatViewsWelcomeHandler.js';
120
import { RenameChatSessionAction, DeleteChatSessionAction, OpenChatSessionInNewEditorGroupAction, OpenChatSessionInSidebarAction, ToggleChatSessionsDescriptionDisplayAction } from './actions/chatSessionActions.js';
121
import { IChatLayoutService } from '../common/chatLayoutService.js';
122
import { ChatLayoutService } from './chatLayoutService.js';
123
124
// Register configuration
125
const configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration);
126
configurationRegistry.registerConfiguration({
127
id: 'chatSidebar',
128
title: nls.localize('interactiveSessionConfigurationTitle', "Chat"),
129
type: 'object',
130
properties: {
131
'chat.fontSize': {
132
type: 'number',
133
description: nls.localize('chat.fontSize', "Controls the font size in pixels in chat messages."),
134
default: 13,
135
minimum: 6,
136
maximum: 100
137
},
138
'chat.fontFamily': {
139
type: 'string',
140
description: nls.localize('chat.fontFamily', "Controls the font family in chat messages."),
141
default: 'default'
142
},
143
'chat.editor.fontSize': {
144
type: 'number',
145
description: nls.localize('interactiveSession.editor.fontSize', "Controls the font size in pixels in chat codeblocks."),
146
default: isMacintosh ? 12 : 14,
147
},
148
'chat.editor.fontFamily': {
149
type: 'string',
150
description: nls.localize('interactiveSession.editor.fontFamily', "Controls the font family in chat codeblocks."),
151
default: 'default'
152
},
153
'chat.editor.fontWeight': {
154
type: 'string',
155
description: nls.localize('interactiveSession.editor.fontWeight', "Controls the font weight in chat codeblocks."),
156
default: 'default'
157
},
158
'chat.editor.wordWrap': {
159
type: 'string',
160
description: nls.localize('interactiveSession.editor.wordWrap', "Controls whether lines should wrap in chat codeblocks."),
161
default: 'off',
162
enum: ['on', 'off']
163
},
164
'chat.editor.lineHeight': {
165
type: 'number',
166
description: nls.localize('interactiveSession.editor.lineHeight', "Controls the line height in pixels in chat codeblocks. Use 0 to compute the line height from the font size."),
167
default: 0
168
},
169
'chat.commandCenter.enabled': {
170
type: 'boolean',
171
markdownDescription: nls.localize('chat.commandCenter.enabled', "Controls whether the command center shows a menu for actions to control chat (requires {0}).", '`#window.commandCenter#`'),
172
default: true
173
},
174
'chat.implicitContext.enabled': {
175
type: 'object',
176
tags: ['experimental'],
177
description: nls.localize('chat.implicitContext.enabled.1', "Enables automatically using the active editor as chat context for specified chat locations."),
178
additionalProperties: {
179
type: 'string',
180
enum: ['never', 'first', 'always'],
181
description: nls.localize('chat.implicitContext.value', "The value for the implicit context."),
182
enumDescriptions: [
183
nls.localize('chat.implicitContext.value.never', "Implicit context is never enabled."),
184
nls.localize('chat.implicitContext.value.first', "Implicit context is enabled for the first interaction."),
185
nls.localize('chat.implicitContext.value.always', "Implicit context is always enabled.")
186
]
187
},
188
default: {
189
'panel': 'always',
190
}
191
},
192
'chat.implicitContext.suggestedContext': {
193
type: 'boolean',
194
tags: ['experimental'],
195
markdownDescription: nls.localize('chat.implicitContext.suggestedContext', "Controls whether the new implicit context flow is shown. In Ask and Edit modes, the context will automatically be included. In Agent mode context will be suggested as an attachment. Selections are always included as context."),
196
default: true,
197
},
198
'chat.editing.autoAcceptDelay': {
199
type: 'number',
200
markdownDescription: nls.localize('chat.editing.autoAcceptDelay', "Delay after which changes made by chat are automatically accepted. Values are in seconds, `0` means disabled and `100` seconds is the maximum."),
201
default: 0,
202
minimum: 0,
203
maximum: 100
204
},
205
'chat.editing.confirmEditRequestRemoval': {
206
type: 'boolean',
207
scope: ConfigurationScope.APPLICATION,
208
markdownDescription: nls.localize('chat.editing.confirmEditRequestRemoval', "Whether to show a confirmation before removing a request and its associated edits."),
209
default: true,
210
},
211
'chat.editing.confirmEditRequestRetry': {
212
type: 'boolean',
213
scope: ConfigurationScope.APPLICATION,
214
markdownDescription: nls.localize('chat.editing.confirmEditRequestRetry', "Whether to show a confirmation before retrying a request and its associated edits."),
215
default: true,
216
},
217
'chat.experimental.detectParticipant.enabled': {
218
type: 'boolean',
219
deprecationMessage: nls.localize('chat.experimental.detectParticipant.enabled.deprecated', "This setting is deprecated. Please use `chat.detectParticipant.enabled` instead."),
220
description: nls.localize('chat.experimental.detectParticipant.enabled', "Enables chat participant autodetection for panel chat."),
221
default: null
222
},
223
'chat.detectParticipant.enabled': {
224
type: 'boolean',
225
description: nls.localize('chat.detectParticipant.enabled', "Enables chat participant autodetection for panel chat."),
226
default: true
227
},
228
'chat.renderRelatedFiles': {
229
type: 'boolean',
230
description: nls.localize('chat.renderRelatedFiles', "Controls whether related files should be rendered in the chat input."),
231
default: false
232
},
233
'chat.notifyWindowOnConfirmation': {
234
type: 'boolean',
235
description: nls.localize('chat.notifyWindowOnConfirmation', "Controls whether a chat session should notify the user when a confirmation is needed while the window is not in focus. This includes a window badge as well as notification toast."),
236
default: true,
237
},
238
[ChatConfiguration.GlobalAutoApprove]: {
239
default: false,
240
// HACK: Description duplicated for policy parser. See https://github.com/microsoft/vscode/issues/254526
241
description: nls.localize('autoApprove2.description',
242
'Global auto approve also known as "YOLO mode" disables manual approval completely for all tools in all workspaces, allowing the agent to act fully autonomously. This is extremely dangerous and is *never* recommended, even containerized environments like Codespaces and Dev Containers have user keys forwarded into the container that could be compromised.\n\nThis feature disables critical security protections and makes it much easier for an attacker to compromise the machine.'
243
),
244
markdownDescription: globalAutoApproveDescription.value,
245
type: 'boolean',
246
scope: ConfigurationScope.APPLICATION_MACHINE,
247
tags: ['experimental'],
248
policy: {
249
name: 'ChatToolsAutoApprove',
250
minimumVersion: '1.99',
251
value: (account) => account.chat_preview_features_enabled === false ? false : undefined,
252
}
253
},
254
[ChatConfiguration.AutoApproveEdits]: {
255
default: {
256
'**/*': true,
257
'**/.vscode/*.json': false,
258
'**/.git/**': false,
259
'**/{package.json,package-lock.json,server.xml,build.rs,web.config,.gitattributes,.env}': false,
260
'**/*.{csproj,fsproj,vbproj}': false,
261
},
262
markdownDescription: nls.localize('chat.tools.autoApprove.edits', "Controls whether edits made by chat are automatically approved. The default is to approve all edits except those made to certain files which have the potential to cause immediate unintended side-effects, such as `**/.vscode/*.json`.\n\nFiles are matched against the glob patterns in the order they are specified."),
263
type: 'object',
264
additionalProperties: {
265
type: 'boolean',
266
}
267
},
268
'chat.sendElementsToChat.enabled': {
269
default: true,
270
description: nls.localize('chat.sendElementsToChat.enabled', "Controls whether elements can be sent to chat from the Simple Browser."),
271
type: 'boolean',
272
tags: ['experimental']
273
},
274
'chat.sendElementsToChat.attachCSS': {
275
default: true,
276
markdownDescription: nls.localize('chat.sendElementsToChat.attachCSS', "Controls whether CSS of the selected element will be added to the chat. {0} must be enabled.", '`#chat.sendElementsToChat.enabled#`'),
277
type: 'boolean',
278
tags: ['experimental']
279
},
280
'chat.sendElementsToChat.attachImages': {
281
default: true,
282
markdownDescription: nls.localize('chat.sendElementsToChat.attachImages', "Controls whether a screenshot of the selected element will be added to the chat. {0} must be enabled.", '`#chat.sendElementsToChat.enabled#`'),
283
type: 'boolean',
284
tags: ['experimental']
285
},
286
'chat.undoRequests.restoreInput': {
287
default: true,
288
markdownDescription: nls.localize('chat.undoRequests.restoreInput', "Controls whether the input of the chat should be restored when an undo request is made. The input will be filled with the text of the request that was restored."),
289
type: 'boolean',
290
tags: ['experimental']
291
},
292
'chat.editRequests': {
293
markdownDescription: nls.localize('chat.editRequests', "Enables editing of requests in the chat. This allows you to change the request content and resubmit it to the model."),
294
type: 'string',
295
enum: ['inline', 'hover', 'input', 'none'],
296
default: 'inline',
297
},
298
'chat.emptyChatState.enabled': {
299
type: 'boolean',
300
default: true,
301
description: nls.localize('chat.emptyChatState', "Shows a modified empty chat state with hints in the input placeholder text."),
302
tags: ['experimental'],
303
experiment: {
304
mode: 'startup'
305
}
306
},
307
[ChatConfiguration.EmptyStateHistoryEnabled]: {
308
type: 'boolean',
309
default: false,
310
description: nls.localize('chat.emptyState.history.enabled', "Show recent chat history on the empty chat state."),
311
tags: ['experimental']
312
},
313
'chat.checkpoints.enabled': {
314
type: 'boolean',
315
default: true,
316
description: nls.localize('chat.checkpoints.enabled', "Enables checkpoints in chat. Checkpoints allow you to restore the chat to a previous state."),
317
},
318
'chat.checkpoints.showFileChanges': {
319
type: 'boolean',
320
description: nls.localize('chat.checkpoints.showFileChanges', "Controls whether to show chat checkpoint file changes."),
321
default: false
322
},
323
[mcpAccessConfig]: {
324
type: 'string',
325
description: nls.localize('chat.mcp.access', "Controls access to Model Context Protocol servers."),
326
enum: [
327
McpAccessValue.None,
328
McpAccessValue.Registry,
329
McpAccessValue.All
330
],
331
enumDescriptions: [
332
nls.localize('chat.mcp.access.none', "No access to MCP servers."),
333
nls.localize('chat.mcp.access.registry', "Only allow access to MCP servers from the registry."),
334
nls.localize('chat.mcp.access.any', "Allow access to any MCP server.")
335
],
336
default: McpAccessValue.All,
337
policy: {
338
name: 'ChatMCP',
339
minimumVersion: '1.99',
340
value: (account) => {
341
if (account.mcp === false) {
342
return McpAccessValue.None;
343
}
344
if (account.mcpAccess === 'registry_only') {
345
return McpAccessValue.Registry;
346
}
347
return undefined;
348
},
349
}
350
},
351
[mcpAutoStartConfig]: {
352
type: 'string',
353
description: nls.localize('chat.mcp.autostart', "Controls whether MCP servers should be automatically started when the chat messages are submitted."),
354
default: McpAutoStartValue.Never,
355
enum: [
356
McpAutoStartValue.Never,
357
McpAutoStartValue.OnlyNew,
358
McpAutoStartValue.NewAndOutdated
359
],
360
enumDescriptions: [
361
nls.localize('chat.mcp.autostart.never', "Never automatically start MCP servers."),
362
nls.localize('chat.mcp.autostart.onlyNew', "Only automatically start new MCP servers that have never been run."),
363
nls.localize('chat.mcp.autostart.newAndOutdated', "Automatically start new and outdated MCP servers that are not yet running.")
364
],
365
tags: ['experimental'],
366
},
367
[mcpServerSamplingSection]: {
368
type: 'object',
369
description: nls.localize('chat.mcp.serverSampling', "Configures which models are exposed to MCP servers for sampling (making model requests in the background). This setting can be edited in a graphical way under the `{0}` command.", 'MCP: ' + nls.localize('mcp.list', 'List Servers')),
370
scope: ConfigurationScope.RESOURCE,
371
additionalProperties: {
372
type: 'object',
373
properties: {
374
allowedDuringChat: {
375
type: 'boolean',
376
description: nls.localize('chat.mcp.serverSampling.allowedDuringChat', "Whether this server is make sampling requests during its tool calls in a chat session."),
377
default: true,
378
},
379
allowedOutsideChat: {
380
type: 'boolean',
381
description: nls.localize('chat.mcp.serverSampling.allowedOutsideChat', "Whether this server is allowed to make sampling requests outside of a chat session."),
382
default: false,
383
},
384
allowedModels: {
385
type: 'array',
386
items: {
387
type: 'string',
388
description: nls.localize('chat.mcp.serverSampling.model', "A model the MCP server has access to."),
389
},
390
}
391
}
392
},
393
},
394
[AssistedTypes[AddConfigurationType.NuGetPackage].enabledConfigKey]: {
395
type: 'boolean',
396
description: nls.localize('chat.mcp.assisted.nuget.enabled.description', "Enables NuGet packages for AI-assisted MCP server installation. Used to install MCP servers by name from the central registry for .NET packages (NuGet.org)."),
397
default: false,
398
tags: ['experimental'],
399
experiment: {
400
mode: 'startup'
401
}
402
},
403
[ChatConfiguration.UseFileStorage]: {
404
type: 'boolean',
405
description: nls.localize('chat.useFileStorage', "Enables storing chat sessions on disk instead of in the storage service. Enabling this does a one-time per-workspace migration of existing sessions to the new format."),
406
default: true,
407
tags: ['experimental'],
408
},
409
[ChatConfiguration.Edits2Enabled]: {
410
type: 'boolean',
411
description: nls.localize('chat.edits2Enabled', "Enable the new Edits mode that is based on tool-calling. When this is enabled, models that don't support tool-calling are unavailable for Edits mode."),
412
default: false,
413
},
414
[ChatConfiguration.ExtensionToolsEnabled]: {
415
type: 'boolean',
416
description: nls.localize('chat.extensionToolsEnabled', "Enable using tools contributed by third-party extensions."),
417
default: true,
418
policy: {
419
name: 'ChatAgentExtensionTools',
420
minimumVersion: '1.99',
421
description: nls.localize('chat.extensionToolsPolicy', "Enable using tools contributed by third-party extensions."),
422
}
423
},
424
[ChatConfiguration.AgentEnabled]: {
425
type: 'boolean',
426
description: nls.localize('chat.agent.enabled.description', "Enable agent mode for chat. When this is enabled, agent mode can be activated via the dropdown in the view."),
427
default: true,
428
policy: {
429
name: 'ChatAgentMode',
430
minimumVersion: '1.99',
431
value: (account) => account.chat_agent_enabled === false ? false : undefined,
432
}
433
},
434
[ChatConfiguration.EnableMath]: {
435
type: 'boolean',
436
description: nls.localize('chat.mathEnabled.description', "Enable math rendering in chat responses using KaTeX."),
437
default: true,
438
tags: ['preview'],
439
},
440
[ChatConfiguration.AgentSessionsViewLocation]: {
441
type: 'string',
442
enum: ['disabled', 'view'],
443
description: nls.localize('chat.sessionsViewLocation.description', "Controls where to show the agent sessions menu."),
444
default: 'disabled',
445
tags: ['experimental'],
446
experiment: {
447
mode: 'auto'
448
}
449
},
450
[mcpDiscoverySection]: {
451
type: 'object',
452
properties: Object.fromEntries(allDiscoverySources.map(k => [k, { type: 'boolean', description: discoverySourceSettingsLabel[k] }])),
453
additionalProperties: false,
454
default: Object.fromEntries(allDiscoverySources.map(k => [k, false])),
455
markdownDescription: nls.localize('mcp.discovery.enabled', "Configures discovery of Model Context Protocol servers from configuration from various other applications."),
456
},
457
[mcpGalleryServiceUrlConfig]: {
458
type: 'string',
459
description: nls.localize('mcp.gallery.serviceUrl', "Configure the MCP Gallery service URL to connect to"),
460
default: '',
461
scope: ConfigurationScope.APPLICATION,
462
tags: ['usesOnlineServices'],
463
included: false,
464
policy: {
465
name: 'McpGalleryServiceUrl',
466
minimumVersion: '1.101',
467
value: (account) => account.mcpRegistryUrl
468
},
469
},
470
[PromptsConfig.KEY]: {
471
type: 'boolean',
472
title: nls.localize(
473
'chat.reusablePrompts.config.enabled.title',
474
"Prompt Files",
475
),
476
markdownDescription: nls.localize(
477
'chat.reusablePrompts.config.enabled.description',
478
"Enable reusable prompt (`*{0}`) and instruction files (`*{1}`) in Chat sessions. [Learn More]({2}).",
479
PROMPT_FILE_EXTENSION,
480
INSTRUCTION_FILE_EXTENSION,
481
PROMPT_DOCUMENTATION_URL,
482
),
483
default: true,
484
restricted: true,
485
disallowConfigurationDefault: true,
486
tags: ['experimental', 'prompts', 'reusable prompts', 'prompt snippets', 'instructions'],
487
policy: {
488
name: 'ChatPromptFiles',
489
minimumVersion: '1.99',
490
description: nls.localize('chat.promptFiles.policy', "Enables reusable prompt and instruction files in Chat sessions.")
491
}
492
},
493
[PromptsConfig.INSTRUCTIONS_LOCATION_KEY]: {
494
type: 'object',
495
title: nls.localize(
496
'chat.instructions.config.locations.title',
497
"Instructions File Locations",
498
),
499
markdownDescription: nls.localize(
500
'chat.instructions.config.locations.description',
501
"Specify location(s) of instructions files (`*{0}`) that can be attached in Chat sessions. [Learn More]({1}).\n\nRelative paths are resolved from the root folder(s) of your workspace.",
502
INSTRUCTION_FILE_EXTENSION,
503
INSTRUCTIONS_DOCUMENTATION_URL,
504
),
505
default: {
506
[INSTRUCTIONS_DEFAULT_SOURCE_FOLDER]: true,
507
},
508
additionalProperties: { type: 'boolean' },
509
restricted: true,
510
tags: ['experimental', 'prompts', 'reusable prompts', 'prompt snippets', 'instructions'],
511
examples: [
512
{
513
[INSTRUCTIONS_DEFAULT_SOURCE_FOLDER]: true,
514
},
515
{
516
[INSTRUCTIONS_DEFAULT_SOURCE_FOLDER]: true,
517
'/Users/vscode/repos/instructions': true,
518
},
519
],
520
},
521
[PromptsConfig.PROMPT_LOCATIONS_KEY]: {
522
type: 'object',
523
title: nls.localize(
524
'chat.reusablePrompts.config.locations.title',
525
"Prompt File Locations",
526
),
527
markdownDescription: nls.localize(
528
'chat.reusablePrompts.config.locations.description',
529
"Specify location(s) of reusable prompt files (`*{0}`) that can be run in Chat sessions. [Learn More]({1}).\n\nRelative paths are resolved from the root folder(s) of your workspace.",
530
PROMPT_FILE_EXTENSION,
531
PROMPT_DOCUMENTATION_URL,
532
),
533
default: {
534
[PROMPT_DEFAULT_SOURCE_FOLDER]: true,
535
},
536
additionalProperties: { type: 'boolean' },
537
unevaluatedProperties: { type: 'boolean' },
538
restricted: true,
539
tags: ['experimental', 'prompts', 'reusable prompts', 'prompt snippets', 'instructions'],
540
examples: [
541
{
542
[PROMPT_DEFAULT_SOURCE_FOLDER]: true,
543
},
544
{
545
[PROMPT_DEFAULT_SOURCE_FOLDER]: true,
546
'/Users/vscode/repos/prompts': true,
547
},
548
],
549
},
550
[PromptsConfig.MODE_LOCATION_KEY]: {
551
type: 'object',
552
title: nls.localize(
553
'chat.mode.config.locations.title',
554
"Mode File Locations",
555
),
556
markdownDescription: nls.localize(
557
'chat.mode.config.locations.description',
558
"Specify location(s) of custom chat mode files (`*{0}`). [Learn More]({1}).\n\nRelative paths are resolved from the root folder(s) of your workspace.",
559
MODE_FILE_EXTENSION,
560
MODE_DOCUMENTATION_URL,
561
),
562
default: {
563
[MODE_DEFAULT_SOURCE_FOLDER]: true,
564
},
565
additionalProperties: { type: 'boolean' },
566
unevaluatedProperties: { type: 'boolean' },
567
restricted: true,
568
tags: ['experimental', 'prompts', 'reusable prompts', 'prompt snippets', 'instructions'],
569
examples: [
570
{
571
[MODE_DEFAULT_SOURCE_FOLDER]: true,
572
},
573
{
574
[MODE_DEFAULT_SOURCE_FOLDER]: true,
575
'/Users/vscode/repos/chatmodes': true,
576
},
577
],
578
},
579
[PromptsConfig.USE_AGENT_MD]: {
580
type: 'boolean',
581
title: nls.localize('chat.useAgentMd.title', "Use AGENTS.MD file",),
582
markdownDescription: nls.localize('chat.useAgentMd.description', "Controls whether instructions from `AGENTS.MD` file found in a workspace roots are added to all chat requests.",),
583
default: true,
584
restricted: true,
585
disallowConfigurationDefault: true,
586
tags: ['experimental', 'prompts', 'reusable prompts', 'prompt snippets', 'instructions']
587
},
588
[PromptsConfig.PROMPT_FILES_SUGGEST_KEY]: {
589
type: 'object',
590
title: nls.localize(
591
'chat.promptFilesRecommendations.title',
592
"Prompt File Recommendations",
593
),
594
markdownDescription: nls.localize(
595
'chat.promptFilesRecommendations.description',
596
"Configure which prompt files to recommend in the chat welcome view. Each key is a prompt file name, and the value can be `true` to always recommend, `false` to never recommend, or a [when clause](https://aka.ms/vscode-when-clause) expression like `resourceExtname == .js` or `resourceLangId == markdown`.",
597
),
598
default: {},
599
additionalProperties: {
600
oneOf: [
601
{ type: 'boolean' },
602
{ type: 'string' }
603
]
604
},
605
tags: ['experimental'],
606
examples: [
607
{
608
'plan': true,
609
'a11y-audit': 'resourceExtname == .html',
610
'document': 'resourceLangId == markdown'
611
}
612
],
613
},
614
'chat.setup.signInDialogVariant': { // TODO@bpasero remove me eventually
615
type: 'string',
616
enum: ['default', 'apple'],
617
description: nls.localize('chat.signInDialogVariant', "Control variations of the sign-in dialog."),
618
default: 'default',
619
tags: ['experimental'],
620
experiment: {
621
mode: 'auto'
622
}
623
},
624
'chat.todoListTool.enabled': {
625
type: 'boolean',
626
default: false,
627
description: nls.localize('chat.todoListTool.enabled', "Enables todo lists in chat, which the agent uses as a tool for planning, progress tracking, and context management for complex development workflows."),
628
tags: ['experimental'],
629
experiment: {
630
mode: 'auto'
631
}
632
},
633
'chat.todoListTool.writeOnly': {
634
type: 'boolean',
635
default: false,
636
description: nls.localize('chat.todoListTool.writeOnly', "When enabled, the todo tool operates in write-only mode, requiring the agent to remember todos in context."),
637
tags: ['experimental']
638
},
639
[ChatConfiguration.ThinkingStyle]: {
640
type: 'string',
641
default: 'collapsedPreview',
642
enum: ['collapsed', 'collapsedPreview', 'expanded', 'none'],
643
enumDescriptions: [
644
nls.localize('chat.agent.thinkingMode.collapsed', "Thinking parts will be collapsed by default."),
645
nls.localize('chat.agent.thinkingMode.collapsedPreview', "Thinking parts will be expanded first, then collapse once we reach a part that is not thinking."),
646
nls.localize('chat.agent.thinkingMode.expanded', "Thinking parts will be expanded by default."),
647
nls.localize('chat.agent.thinkingMode.none', "Do not show the thinking"),
648
],
649
description: nls.localize('chat.agent.thinkingCollapsedByDefault', "Controls how thinking is rendered."),
650
tags: ['experimental'],
651
},
652
'chat.disableAIFeatures': {
653
type: 'boolean',
654
description: nls.localize('chat.disableAIFeatures', "Disable and hide built-in AI features provided by GitHub Copilot, including chat, code completions and next edit suggestions."),
655
default: false,
656
scope: ConfigurationScope.WINDOW
657
},
658
[ChatConfiguration.UseChatSessionsForCloudButton]: {
659
type: 'boolean',
660
description: nls.localize('chat.useChatSessionsForCloudButton', "Controls whether the 'Delegate to coding agent' button uses the new chat sessions API."),
661
default: false,
662
tags: ['experimental'],
663
664
},
665
[ChatConfiguration.ShowAgentSessionsViewDescription]: {
666
type: 'boolean',
667
description: nls.localize('chat.showAgentSessionsViewDescription', "Controls whether session descriptions are displayed on a second row in the Chat Sessions view."),
668
default: true,
669
}
670
}
671
});
672
Registry.as<IEditorPaneRegistry>(EditorExtensions.EditorPane).registerEditorPane(
673
EditorPaneDescriptor.create(
674
ChatEditor,
675
ChatEditorInput.EditorID,
676
nls.localize('chat', "Chat")
677
),
678
[
679
new SyncDescriptor(ChatEditorInput)
680
]
681
);
682
Registry.as<IConfigurationMigrationRegistry>(Extensions.ConfigurationMigration).registerConfigurationMigrations([
683
{
684
key: 'chat.experimental.detectParticipant.enabled',
685
migrateFn: (value, _accessor) => ([
686
['chat.experimental.detectParticipant.enabled', { value: undefined }],
687
['chat.detectParticipant.enabled', { value: value !== false }]
688
])
689
},
690
{
691
key: mcpDiscoverySection,
692
migrateFn: (value: unknown) => {
693
if (typeof value === 'boolean') {
694
return { value: Object.fromEntries(allDiscoverySources.map(k => [k, value])) };
695
}
696
697
return { value };
698
}
699
},
700
]);
701
702
class ChatResolverContribution extends Disposable {
703
704
static readonly ID = 'workbench.contrib.chatResolver';
705
706
constructor(
707
@IEditorResolverService editorResolverService: IEditorResolverService,
708
@IInstantiationService instantiationService: IInstantiationService,
709
) {
710
super();
711
712
this._register(editorResolverService.registerEditor(
713
`{${Schemas.vscodeChatEditor},${Schemas.vscodeChatSession}}:**/**`,
714
{
715
id: ChatEditorInput.EditorID,
716
label: nls.localize('chat', "Chat"),
717
priority: RegisteredEditorPriority.builtin
718
},
719
{
720
singlePerResource: true,
721
canSupportResource: resource => resource.scheme === Schemas.vscodeChatEditor || resource.scheme === Schemas.vscodeChatSession,
722
},
723
{
724
createEditorInput: ({ resource, options }) => {
725
return { editor: instantiationService.createInstance(ChatEditorInput, resource, options as IChatEditorOptions), options };
726
}
727
}
728
));
729
}
730
}
731
732
class ChatAgentSettingContribution extends Disposable implements IWorkbenchContribution {
733
734
static readonly ID = 'workbench.contrib.chatAgentSetting';
735
736
constructor(
737
@IWorkbenchAssignmentService private readonly experimentService: IWorkbenchAssignmentService,
738
@IChatEntitlementService private readonly entitlementService: IChatEntitlementService,
739
) {
740
super();
741
this.registerMaxRequestsSetting();
742
}
743
744
745
private registerMaxRequestsSetting(): void {
746
let lastNode: IConfigurationNode | undefined;
747
const registerMaxRequestsSetting = () => {
748
const treatmentId = this.entitlementService.entitlement === ChatEntitlement.Free ?
749
'chatAgentMaxRequestsFree' :
750
'chatAgentMaxRequestsPro';
751
this.experimentService.getTreatment<number>(treatmentId).then(value => {
752
const defaultValue = value ?? (this.entitlementService.entitlement === ChatEntitlement.Free ? 25 : 25);
753
const node: IConfigurationNode = {
754
id: 'chatSidebar',
755
title: nls.localize('interactiveSessionConfigurationTitle', "Chat"),
756
type: 'object',
757
properties: {
758
'chat.agent.maxRequests': {
759
type: 'number',
760
markdownDescription: nls.localize('chat.agent.maxRequests', "The maximum number of requests to allow per-turn in agent mode. When the limit is reached, will ask to confirm to continue."),
761
default: defaultValue,
762
},
763
}
764
};
765
configurationRegistry.updateConfigurations({ remove: lastNode ? [lastNode] : [], add: [node] });
766
lastNode = node;
767
});
768
};
769
this._register(Event.runAndSubscribe(Event.debounce(this.entitlementService.onDidChangeEntitlement, () => { }, 1000), () => registerMaxRequestsSetting()));
770
}
771
}
772
773
AccessibleViewRegistry.register(new ChatResponseAccessibleView());
774
AccessibleViewRegistry.register(new PanelChatAccessibilityHelp());
775
AccessibleViewRegistry.register(new QuickChatAccessibilityHelp());
776
AccessibleViewRegistry.register(new EditsChatAccessibilityHelp());
777
AccessibleViewRegistry.register(new AgentChatAccessibilityHelp());
778
779
registerEditorFeature(ChatInputBoxContentProvider);
780
781
class ChatSlashStaticSlashCommandsContribution extends Disposable {
782
783
static readonly ID = 'workbench.contrib.chatSlashStaticSlashCommands';
784
785
constructor(
786
@IChatSlashCommandService slashCommandService: IChatSlashCommandService,
787
@ICommandService commandService: ICommandService,
788
@IChatAgentService chatAgentService: IChatAgentService,
789
@IChatWidgetService chatWidgetService: IChatWidgetService,
790
@IInstantiationService instantiationService: IInstantiationService,
791
) {
792
super();
793
this._store.add(slashCommandService.registerSlashCommand({
794
command: 'clear',
795
detail: nls.localize('clear', "Start a new chat"),
796
sortText: 'z2_clear',
797
executeImmediately: true,
798
locations: [ChatAgentLocation.Panel]
799
}, async () => {
800
commandService.executeCommand(ACTION_ID_NEW_CHAT);
801
}));
802
this._store.add(slashCommandService.registerSlashCommand({
803
command: SAVE_TO_PROMPT_SLASH_COMMAND_NAME,
804
detail: nls.localize('save-chat-to-prompt-file', "Save chat to a prompt file"),
805
sortText: `z3_${SAVE_TO_PROMPT_SLASH_COMMAND_NAME}`,
806
executeImmediately: true,
807
silent: true,
808
locations: [ChatAgentLocation.Panel]
809
}, async () => {
810
const { lastFocusedWidget } = chatWidgetService;
811
assertDefined(
812
lastFocusedWidget,
813
'No currently active chat widget found.',
814
);
815
const options = { chat: lastFocusedWidget };
816
return commandService.executeCommand(SAVE_TO_PROMPT_ACTION_ID, options,);
817
}));
818
this._store.add(slashCommandService.registerSlashCommand({
819
command: 'help',
820
detail: '',
821
sortText: 'z1_help',
822
executeImmediately: true,
823
locations: [ChatAgentLocation.Panel],
824
modes: [ChatModeKind.Ask]
825
}, async (prompt, progress) => {
826
const defaultAgent = chatAgentService.getDefaultAgent(ChatAgentLocation.Panel);
827
const agents = chatAgentService.getAgents();
828
829
// Report prefix
830
if (defaultAgent?.metadata.helpTextPrefix) {
831
if (isMarkdownString(defaultAgent.metadata.helpTextPrefix)) {
832
progress.report({ content: defaultAgent.metadata.helpTextPrefix, kind: 'markdownContent' });
833
} else {
834
progress.report({ content: new MarkdownString(defaultAgent.metadata.helpTextPrefix), kind: 'markdownContent' });
835
}
836
progress.report({ content: new MarkdownString('\n\n'), kind: 'markdownContent' });
837
}
838
839
// Report agent list
840
const agentText = (await Promise.all(agents
841
.filter(a => !a.isDefault && !a.isCore)
842
.filter(a => a.locations.includes(ChatAgentLocation.Panel))
843
.map(async a => {
844
const description = a.description ? `- ${a.description}` : '';
845
const agentMarkdown = instantiationService.invokeFunction(accessor => agentToMarkdown(a, true, accessor));
846
const agentLine = `- ${agentMarkdown} ${description}`;
847
const commandText = a.slashCommands.map(c => {
848
const description = c.description ? `- ${c.description}` : '';
849
return `\t* ${agentSlashCommandToMarkdown(a, c)} ${description}`;
850
}).join('\n');
851
852
return (agentLine + '\n' + commandText).trim();
853
}))).join('\n');
854
progress.report({ content: new MarkdownString(agentText, { isTrusted: { enabledCommands: [ChatSubmitAction.ID] } }), kind: 'markdownContent' });
855
856
// Report help text ending
857
if (defaultAgent?.metadata.helpTextPostfix) {
858
progress.report({ content: new MarkdownString('\n\n'), kind: 'markdownContent' });
859
if (isMarkdownString(defaultAgent.metadata.helpTextPostfix)) {
860
progress.report({ content: defaultAgent.metadata.helpTextPostfix, kind: 'markdownContent' });
861
} else {
862
progress.report({ content: new MarkdownString(defaultAgent.metadata.helpTextPostfix), kind: 'markdownContent' });
863
}
864
}
865
866
// Without this, the response will be done before it renders and so it will not stream. This ensures that if the response starts
867
// rendering during the next 200ms, then it will be streamed. Once it starts streaming, the whole response streams even after
868
// it has received all response data has been received.
869
await timeout(200);
870
}));
871
}
872
}
873
Registry.as<IEditorFactoryRegistry>(EditorExtensions.EditorFactory).registerEditorSerializer(ChatEditorInput.TypeID, ChatEditorInputSerializer);
874
875
registerWorkbenchContribution2(ChatResolverContribution.ID, ChatResolverContribution, WorkbenchPhase.BlockStartup);
876
registerWorkbenchContribution2(ChatSlashStaticSlashCommandsContribution.ID, ChatSlashStaticSlashCommandsContribution, WorkbenchPhase.Eventually);
877
registerWorkbenchContribution2(ChatExtensionPointHandler.ID, ChatExtensionPointHandler, WorkbenchPhase.BlockStartup);
878
registerWorkbenchContribution2(LanguageModelToolsExtensionPointHandler.ID, LanguageModelToolsExtensionPointHandler, WorkbenchPhase.BlockRestore);
879
registerWorkbenchContribution2(ChatCompatibilityNotifier.ID, ChatCompatibilityNotifier, WorkbenchPhase.Eventually);
880
registerWorkbenchContribution2(CopilotTitleBarMenuRendering.ID, CopilotTitleBarMenuRendering, WorkbenchPhase.BlockRestore);
881
registerWorkbenchContribution2(CodeBlockActionRendering.ID, CodeBlockActionRendering, WorkbenchPhase.BlockRestore);
882
registerWorkbenchContribution2(ChatImplicitContextContribution.ID, ChatImplicitContextContribution, WorkbenchPhase.Eventually);
883
registerWorkbenchContribution2(ChatRelatedFilesContribution.ID, ChatRelatedFilesContribution, WorkbenchPhase.Eventually);
884
registerWorkbenchContribution2(ChatViewsWelcomeHandler.ID, ChatViewsWelcomeHandler, WorkbenchPhase.BlockStartup);
885
registerWorkbenchContribution2(ChatGettingStartedContribution.ID, ChatGettingStartedContribution, WorkbenchPhase.Eventually);
886
registerWorkbenchContribution2(ChatSetupContribution.ID, ChatSetupContribution, WorkbenchPhase.BlockRestore);
887
registerWorkbenchContribution2(ChatTeardownContribution.ID, ChatTeardownContribution, WorkbenchPhase.AfterRestored);
888
registerWorkbenchContribution2(ChatStatusBarEntry.ID, ChatStatusBarEntry, WorkbenchPhase.BlockRestore);
889
registerWorkbenchContribution2(BuiltinToolsContribution.ID, BuiltinToolsContribution, WorkbenchPhase.Eventually);
890
registerWorkbenchContribution2(ChatAgentSettingContribution.ID, ChatAgentSettingContribution, WorkbenchPhase.AfterRestored);
891
registerWorkbenchContribution2(ChatEditingEditorAccessibility.ID, ChatEditingEditorAccessibility, WorkbenchPhase.AfterRestored);
892
registerWorkbenchContribution2(ChatEditingEditorOverlay.ID, ChatEditingEditorOverlay, WorkbenchPhase.AfterRestored);
893
registerWorkbenchContribution2(SimpleBrowserOverlay.ID, SimpleBrowserOverlay, WorkbenchPhase.AfterRestored);
894
registerWorkbenchContribution2(ChatEditingEditorContextKeys.ID, ChatEditingEditorContextKeys, WorkbenchPhase.AfterRestored);
895
registerWorkbenchContribution2(ChatTransferContribution.ID, ChatTransferContribution, WorkbenchPhase.BlockRestore);
896
registerWorkbenchContribution2(ChatContextContributions.ID, ChatContextContributions, WorkbenchPhase.AfterRestored);
897
registerWorkbenchContribution2(ChatResponseResourceFileSystemProvider.ID, ChatResponseResourceFileSystemProvider, WorkbenchPhase.AfterRestored);
898
registerWorkbenchContribution2(PromptUrlHandler.ID, PromptUrlHandler, WorkbenchPhase.BlockRestore);
899
registerWorkbenchContribution2(ChatSessionsView.ID, ChatSessionsView, WorkbenchPhase.AfterRestored);
900
registerWorkbenchContribution2(ChatEditingNotebookFileSystemProviderContrib.ID, ChatEditingNotebookFileSystemProviderContrib, WorkbenchPhase.BlockStartup);
901
registerWorkbenchContribution2(UserToolSetsContributions.ID, UserToolSetsContributions, WorkbenchPhase.Eventually);
902
903
registerChatActions();
904
registerChatAccessibilityActions();
905
registerChatCopyActions();
906
registerChatCodeBlockActions();
907
registerChatCodeCompareBlockActions();
908
registerChatFileTreeActions();
909
registerChatTitleActions();
910
registerChatExecuteActions();
911
registerQuickChatActions();
912
registerChatExportActions();
913
registerMoveActions();
914
registerNewChatActions();
915
registerChatContextActions();
916
registerChatDeveloperActions();
917
registerChatEditorActions();
918
registerChatToolActions();
919
registerLanguageModelActions();
920
921
registerEditorFeature(ChatPasteProvidersFeature);
922
923
924
registerSingleton(IChatTransferService, ChatTransferService, InstantiationType.Delayed);
925
registerSingleton(IChatService, ChatService, InstantiationType.Delayed);
926
registerSingleton(IChatWidgetService, ChatWidgetService, InstantiationType.Delayed);
927
registerSingleton(IQuickChatService, QuickChatService, InstantiationType.Delayed);
928
registerSingleton(IChatAccessibilityService, ChatAccessibilityService, InstantiationType.Delayed);
929
registerSingleton(IChatWidgetHistoryService, ChatWidgetHistoryService, InstantiationType.Delayed);
930
registerSingleton(ILanguageModelsService, LanguageModelsService, InstantiationType.Delayed);
931
registerSingleton(ILanguageModelStatsService, LanguageModelStatsService, InstantiationType.Delayed);
932
registerSingleton(IChatSlashCommandService, ChatSlashCommandService, InstantiationType.Delayed);
933
registerSingleton(IChatAgentService, ChatAgentService, InstantiationType.Delayed);
934
registerSingleton(IChatAgentNameService, ChatAgentNameService, InstantiationType.Delayed);
935
registerSingleton(IChatVariablesService, ChatVariablesService, InstantiationType.Delayed);
936
registerSingleton(ILanguageModelToolsService, LanguageModelToolsService, InstantiationType.Delayed);
937
registerSingleton(IVoiceChatService, VoiceChatService, InstantiationType.Delayed);
938
registerSingleton(IChatCodeBlockContextProviderService, ChatCodeBlockContextProviderService, InstantiationType.Delayed);
939
registerSingleton(ICodeMapperService, CodeMapperService, InstantiationType.Delayed);
940
registerSingleton(IChatEditingService, ChatEditingService, InstantiationType.Delayed);
941
registerSingleton(IChatMarkdownAnchorService, ChatMarkdownAnchorService, InstantiationType.Delayed);
942
registerSingleton(ILanguageModelIgnoredFilesService, LanguageModelIgnoredFilesService, InstantiationType.Delayed);
943
registerSingleton(IChatEntitlementService, ChatEntitlementService, InstantiationType.Delayed);
944
registerSingleton(IPromptsService, PromptsService, InstantiationType.Delayed);
945
registerSingleton(IChatContextPickService, ChatContextPickService, InstantiationType.Delayed);
946
registerSingleton(IChatModeService, ChatModeService, InstantiationType.Delayed);
947
registerSingleton(IChatAttachmentResolveService, ChatAttachmentResolveService, InstantiationType.Delayed);
948
registerSingleton(IChatTodoListService, ChatTodoListService, InstantiationType.Delayed);
949
registerSingleton(IChatOutputRendererService, ChatOutputRendererService, InstantiationType.Delayed);
950
registerSingleton(IChatLayoutService, ChatLayoutService, InstantiationType.Delayed);
951
952
953
registerPromptFileContributions();
954
955
956
registerAction2(ConfigureToolSets);
957
registerAction2(RenameChatSessionAction);
958
registerAction2(DeleteChatSessionAction);
959
registerAction2(OpenChatSessionInNewEditorGroupAction);
960
registerAction2(OpenChatSessionInSidebarAction);
961
registerAction2(ToggleChatSessionsDescriptionDisplayAction);
962
963
ChatWidget.CONTRIBS.push(ChatDynamicVariableModel);
964
965