@codingame/monaco-vscode-chat-service-override 7.1.0 → 7.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/package.json +2 -2
  2. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +86 -91
  3. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +5 -6
  4. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +205 -115
  5. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +61 -21
  6. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +3 -4
  7. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +2 -3
  8. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +3 -4
  9. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +4 -5
  10. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +10 -11
  11. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +10 -8
  12. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +24 -25
  13. package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +1 -1
  14. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +5 -3
  15. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipantContributions.js +29 -108
  16. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +76 -67
  17. package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +9 -8
  18. package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +1 -1
  19. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatContextAttachments.js +9 -5
  20. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions.js +17 -12
  21. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +28 -7
  22. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +2 -3
  23. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +17 -55
  24. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.js +54 -0
  25. package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +4 -4
  26. package/vscode/src/vs/workbench/contrib/chat/common/languageModelStats.js +3 -4
  27. package/vscode/src/vs/workbench/contrib/chat/common/languageModelToolsService.js +1 -1
  28. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +60 -25
  29. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +6 -7
  30. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +6 -5
  31. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +24 -0
  32. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +9 -12
  33. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.js +4 -10
  34. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClear.js +0 -17
@@ -2,12 +2,15 @@ import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
2
2
  import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
3
3
  import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
4
4
  import { Schemas } from 'vscode/vscode/vs/base/common/network';
5
+ import { compare } from 'vscode/vscode/vs/base/common/strings';
5
6
  import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
6
7
  import { URI } from 'vscode/vscode/vs/base/common/uri';
8
+ import { EditorType } from 'vscode/vscode/vs/editor/common/editorCommon';
7
9
  import { AbstractGotoSymbolQuickAccessProvider } from 'vscode/vscode/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess';
8
- import { localize2WithPath, localizeWithPath } from 'vscode/vscode/vs/nls';
10
+ import { localize2, localize } from 'vscode/vscode/vs/nls';
9
11
  import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
10
12
  import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
13
+ import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
11
14
  import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
12
15
  import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
13
16
  import { CHAT_CATEGORY } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
@@ -15,17 +18,14 @@ import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/brow
15
18
  import { ChatContextAttachments } from '../contrib/chatContextAttachments.js';
16
19
  import { ChatAgentLocation } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents';
17
20
  import { IChatAgentService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
18
- import { CONTEXT_IN_CHAT_INPUT, CONTEXT_CHAT_LOCATION, CONTEXT_IN_QUICK_CHAT } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
21
+ import { CONTEXT_CHAT_LOCATION, CONTEXT_IN_QUICK_CHAT, CONTEXT_IN_CHAT_INPUT } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
19
22
  import { ChatRequestAgentPart } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatParserTypes';
20
23
  import { IChatVariablesService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatVariables.service';
24
+ import { ILanguageModelToolsService } from 'vscode/vscode/vs/workbench/contrib/chat/common/languageModelToolsService.service';
21
25
  import { AnythingQuickAccessProvider } from 'vscode/vscode/vs/workbench/contrib/search/browser/anythingQuickAccess';
22
26
  import { SymbolsQuickAccessProvider } from 'vscode/vscode/vs/workbench/contrib/search/browser/symbolsQuickAccess';
23
- import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
24
27
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
25
- import { EditorType } from 'vscode/vscode/vs/editor/common/editorCommon';
26
- import { compare } from 'vscode/vscode/vs/base/common/strings';
27
28
 
28
- const _moduleId = "vs/workbench/contrib/chat/browser/actions/chatContextActions";
29
29
  function registerChatContextActions() {
30
30
  registerAction2(AttachContextAction);
31
31
  registerAction2(AttachFileAction);
@@ -36,7 +36,7 @@ class AttachFileAction extends Action2 {
36
36
  constructor() {
37
37
  super({
38
38
  id: AttachFileAction.ID,
39
- title: ( localize2WithPath(_moduleId, 0, "Attach File")),
39
+ title: ( localize2(7296, "Attach File")),
40
40
  category: CHAT_CATEGORY,
41
41
  f1: false
42
42
  });
@@ -45,7 +45,7 @@ class AttachFileAction extends Action2 {
45
45
  const variablesService = accessor.get(IChatVariablesService);
46
46
  const textEditorService = accessor.get(IEditorService);
47
47
  const activeUri = textEditorService.activeEditor?.resource;
48
- if (textEditorService.activeTextEditorControl?.getEditorType() === EditorType.ICodeEditor && activeUri && [Schemas.file, Schemas.vscodeRemote].includes(activeUri.scheme)) {
48
+ if (textEditorService.activeTextEditorControl?.getEditorType() === EditorType.ICodeEditor && activeUri && [Schemas.file, Schemas.vscodeRemote, Schemas.untitled].includes(activeUri.scheme)) {
49
49
  variablesService.attachContext('file', activeUri, ChatAgentLocation.Panel);
50
50
  }
51
51
  }
@@ -55,7 +55,7 @@ class AttachSelectionAction extends Action2 {
55
55
  constructor() {
56
56
  super({
57
57
  id: AttachSelectionAction.ID,
58
- title: ( localize2WithPath(_moduleId, 1, "Add Selection to Chat")),
58
+ title: ( localize2(7297, "Add Selection to Chat")),
59
59
  category: CHAT_CATEGORY,
60
60
  f1: false
61
61
  });
@@ -65,7 +65,7 @@ class AttachSelectionAction extends Action2 {
65
65
  const textEditorService = accessor.get(IEditorService);
66
66
  const activeEditor = textEditorService.activeTextEditorControl;
67
67
  const activeUri = textEditorService.activeEditor?.resource;
68
- if (textEditorService.activeTextEditorControl?.getEditorType() === EditorType.ICodeEditor && activeUri && [Schemas.file, Schemas.vscodeRemote].includes(activeUri.scheme)) {
68
+ if (textEditorService.activeTextEditorControl?.getEditorType() === EditorType.ICodeEditor && activeUri && [Schemas.file, Schemas.vscodeRemote, Schemas.untitled].includes(activeUri.scheme)) {
69
69
  const selection = activeEditor?.getSelection();
70
70
  if (selection) {
71
71
  variablesService.attachContext('file', { uri: activeUri, range: selection }, ChatAgentLocation.Panel);
@@ -75,12 +75,26 @@ class AttachSelectionAction extends Action2 {
75
75
  }
76
76
  class AttachContextAction extends Action2 {
77
77
  static { this.ID = 'workbench.action.chat.attachContext'; }
78
+ static { this._cdt = ( (ContextKeyExpr.or( (ContextKeyExpr.and(
79
+ (CONTEXT_CHAT_LOCATION.isEqualTo(ChatAgentLocation.Panel)),
80
+ (CONTEXT_IN_QUICK_CHAT.isEqualTo(false))
81
+ )), (ContextKeyExpr.and(
82
+ (CONTEXT_CHAT_LOCATION.isEqualTo(ChatAgentLocation.Editor)),
83
+ (ContextKeyExpr.equals('config.chat.experimental.variables.editor', true))
84
+ )), (ContextKeyExpr.and(
85
+ (CONTEXT_CHAT_LOCATION.isEqualTo(ChatAgentLocation.Notebook)),
86
+ (ContextKeyExpr.equals('config.chat.experimental.variables.notebook', true))
87
+ )), (ContextKeyExpr.and(
88
+ (CONTEXT_CHAT_LOCATION.isEqualTo(ChatAgentLocation.Terminal)),
89
+ (ContextKeyExpr.equals('config.chat.experimental.variables.terminal', true))
90
+ ))))); }
78
91
  constructor() {
79
92
  super({
80
93
  id: AttachContextAction.ID,
81
- title: ( localize2WithPath(_moduleId, 2, "Attach Context")),
94
+ title: ( localize2(7298, "Attach Context")),
82
95
  icon: Codicon.attach,
83
96
  category: CHAT_CATEGORY,
97
+ precondition: AttachContextAction._cdt,
84
98
  keybinding: {
85
99
  when: CONTEXT_IN_CHAT_INPUT,
86
100
  primary: KeyMod.CtrlCmd | KeyCode.Slash,
@@ -88,10 +102,7 @@ class AttachContextAction extends Action2 {
88
102
  },
89
103
  menu: [
90
104
  {
91
- when: ( (ContextKeyExpr.and(
92
- (CONTEXT_CHAT_LOCATION.isEqualTo(ChatAgentLocation.Panel)),
93
- (CONTEXT_IN_QUICK_CHAT.isEqualTo(false))
94
- ))),
105
+ when: AttachContextAction._cdt,
95
106
  id: MenuId.ChatExecute,
96
107
  group: 'navigation',
97
108
  },
@@ -121,7 +132,7 @@ class AttachContextAction extends Action2 {
121
132
  isDynamic: pick.isDynamic,
122
133
  value: pick.value,
123
134
  name: `${typeof pick.value === 'string' && pick.value.startsWith('#') ? pick.value.slice(1) : ''}${selection}`,
124
- fullName: `${pick.icon ? `$(${pick.icon.id}) ` : ''}${selection}`
135
+ fullName: selection
125
136
  });
126
137
  }
127
138
  else if ('symbol' in pick && pick.symbol) {
@@ -155,6 +166,15 @@ class AttachContextAction extends Action2 {
155
166
  isDynamic: true
156
167
  });
157
168
  }
169
+ else if ('kind' in pick && pick.kind === 'tool') {
170
+ toAttach.push({
171
+ id: pick.id,
172
+ name: pick.label,
173
+ fullName: pick.label,
174
+ value: undefined,
175
+ isTool: true
176
+ });
177
+ }
158
178
  else {
159
179
  toAttach.push({
160
180
  ...pick,
@@ -175,6 +195,7 @@ class AttachContextAction extends Action2 {
175
195
  const chatVariablesService = accessor.get(IChatVariablesService);
176
196
  const commandService = accessor.get(ICommandService);
177
197
  const widgetService = accessor.get(IChatWidgetService);
198
+ const languageModelToolsService = accessor.get(ILanguageModelToolsService);
178
199
  const context = args[0];
179
200
  const widget = context?.widget ?? widgetService.lastFocusedWidget;
180
201
  if (!widget) {
@@ -183,12 +204,13 @@ class AttachContextAction extends Action2 {
183
204
  const usedAgent = widget.parsedInput.parts.find(p => p instanceof ChatRequestAgentPart);
184
205
  const slowSupported = usedAgent ? usedAgent.agent.metadata.supportsSlowVariables : true;
185
206
  const quickPickItems = [];
186
- for (const variable of chatVariablesService.getVariables()) {
207
+ for (const variable of chatVariablesService.getVariables(widget.location)) {
187
208
  if (variable.fullName && (!variable.isSlow || slowSupported)) {
188
209
  quickPickItems.push({
189
- label: `${variable.icon ? `$(${variable.icon.id}) ` : ''}${variable.fullName}`,
210
+ label: variable.fullName,
190
211
  name: variable.name,
191
212
  id: variable.id,
213
+ iconClass: variable.icon ? ThemeIcon.asClassName(variable.icon) : undefined,
192
214
  icon: variable.icon
193
215
  });
194
216
  }
@@ -200,10 +222,11 @@ class AttachContextAction extends Action2 {
200
222
  for (const variable of completions) {
201
223
  if (variable.fullName) {
202
224
  quickPickItems.push({
203
- label: `${variable.icon ? `$(${variable.icon.id}) ` : ''}${variable.fullName}`,
225
+ label: variable.fullName,
204
226
  id: variable.id,
205
227
  command: variable.command,
206
228
  icon: variable.icon,
229
+ iconClass: variable.icon ? ThemeIcon.asClassName(variable.icon) : undefined,
207
230
  value: variable.value,
208
231
  isDynamic: true,
209
232
  name: variable.name
@@ -212,9 +235,26 @@ class AttachContextAction extends Action2 {
212
235
  }
213
236
  }
214
237
  }
238
+ for (const tool of languageModelToolsService.getTools()) {
239
+ if (tool.canBeInvokedManually) {
240
+ const item = {
241
+ kind: 'tool',
242
+ label: tool.displayName ?? tool.name,
243
+ id: tool.name,
244
+ };
245
+ if (ThemeIcon.isThemeIcon(tool.icon)) {
246
+ item.iconClass = ThemeIcon.asClassName(tool.icon);
247
+ }
248
+ else if (tool.icon) {
249
+ item.iconPath = tool.icon;
250
+ }
251
+ quickPickItems.push(item);
252
+ }
253
+ }
215
254
  quickPickItems.push({
216
- label: ( localizeWithPath(_moduleId, 3, '{0} Symbol...', `$(${Codicon.symbolField.id})`)),
255
+ label: ( localize(7299, 'Symbol...')),
217
256
  icon: ThemeIcon.fromId(Codicon.symbolField.id),
257
+ iconClass: ThemeIcon.asClassName(Codicon.symbolField),
218
258
  prefix: SymbolsQuickAccessProvider.PREFIX
219
259
  });
220
260
  function extractTextFromIconLabel(label) {
@@ -237,7 +277,7 @@ class AttachContextAction extends Action2 {
237
277
  SymbolsQuickAccessProvider.PREFIX,
238
278
  AbstractGotoSymbolQuickAccessProvider.PREFIX
239
279
  ],
240
- placeholder: ( localizeWithPath(_moduleId, 4, 'Search attachments')),
280
+ placeholder: ( localize(7300, 'Search attachments')),
241
281
  providerOptions: {
242
282
  handleAccept: (item) => {
243
283
  if ('prefix' in item) {
@@ -1,4 +1,4 @@
1
- import { localize2WithPath } from 'vscode/vscode/vs/nls';
1
+ import { localize2 } from 'vscode/vscode/vs/nls';
2
2
  import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
3
3
  import { IClipboardService } from 'vscode/vscode/vs/platform/clipboard/common/clipboardService.service';
4
4
  import { CHAT_CATEGORY, stringifyItem } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
@@ -6,13 +6,12 @@ import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/brow
6
6
  import { CONTEXT_RESPONSE_FILTERED } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
7
7
  import { isRequestVM, isResponseVM } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatViewModel';
8
8
 
9
- const _moduleId = "vs/workbench/contrib/chat/browser/actions/chatCopyActions";
10
9
  function registerChatCopyActions() {
11
10
  registerAction2(class CopyAllAction extends Action2 {
12
11
  constructor() {
13
12
  super({
14
13
  id: 'workbench.action.chat.copyAll',
15
- title: ( localize2WithPath(_moduleId, 0, "Copy All")),
14
+ title: ( localize2(7252, "Copy All")),
16
15
  f1: false,
17
16
  category: CHAT_CATEGORY,
18
17
  menu: {
@@ -42,7 +41,7 @@ function registerChatCopyActions() {
42
41
  constructor() {
43
42
  super({
44
43
  id: 'workbench.action.chat.copyItem',
45
- title: ( localize2WithPath(_moduleId, 1, "Copy")),
44
+ title: ( localize2(7253, "Copy")),
46
45
  f1: false,
47
46
  category: CHAT_CATEGORY,
48
47
  menu: {
@@ -1,10 +1,9 @@
1
1
  import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
2
- import { localize2WithPath } from 'vscode/vscode/vs/nls';
2
+ import { localize2 } from 'vscode/vscode/vs/nls';
3
3
  import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
4
4
  import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
5
5
  import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat.service';
6
6
 
7
- const _moduleId = "vs/workbench/contrib/chat/browser/actions/chatDeveloperActions";
8
7
  function registerChatDeveloperActions() {
9
8
  registerAction2(LogChatInputHistoryAction);
10
9
  }
@@ -13,7 +12,7 @@ class LogChatInputHistoryAction extends Action2 {
13
12
  constructor() {
14
13
  super({
15
14
  id: LogChatInputHistoryAction.ID,
16
- title: ( localize2WithPath(_moduleId, 0, "Log Chat Input History")),
15
+ title: ( localize2(7301, "Log Chat Input History")),
17
16
  icon: Codicon.attach,
18
17
  category: Categories.Developer,
19
18
  f1: true
@@ -1,5 +1,5 @@
1
1
  import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
2
- import { localize2WithPath } from 'vscode/vscode/vs/nls';
2
+ import { localize2 } from 'vscode/vscode/vs/nls';
3
3
  import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
4
4
  import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
5
5
  import { CHAT_CATEGORY } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
@@ -7,13 +7,12 @@ import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/brow
7
7
  import { CONTEXT_IN_CHAT_SESSION, CONTEXT_CHAT_ENABLED } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
8
8
  import { isResponseVM } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatViewModel';
9
9
 
10
- const _moduleId = "vs/workbench/contrib/chat/browser/actions/chatFileTreeActions";
11
10
  function registerChatFileTreeActions() {
12
11
  registerAction2(class NextFileTreeAction extends Action2 {
13
12
  constructor() {
14
13
  super({
15
14
  id: 'workbench.action.chat.nextFileTree',
16
- title: ( localize2WithPath(_moduleId, 0, "Next File Tree")),
15
+ title: ( localize2(7258, "Next File Tree")),
17
16
  keybinding: {
18
17
  primary: KeyMod.CtrlCmd | KeyCode.F9,
19
18
  weight: KeybindingWeight.WorkbenchContrib,
@@ -32,7 +31,7 @@ function registerChatFileTreeActions() {
32
31
  constructor() {
33
32
  super({
34
33
  id: 'workbench.action.chat.previousFileTree',
35
- title: ( localize2WithPath(_moduleId, 1, "Previous File Tree")),
34
+ title: ( localize2(7259, "Previous File Tree")),
36
35
  keybinding: {
37
36
  primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F9,
38
37
  weight: KeybindingWeight.WorkbenchContrib,
@@ -1,6 +1,6 @@
1
1
  import { VSBuffer } from 'vscode/vscode/vs/base/common/buffer';
2
2
  import { joinPath } from 'vscode/vscode/vs/base/common/resources';
3
- import { localizeWithPath, localize2WithPath } from 'vscode/vscode/vs/nls';
3
+ import { localize, localize2 } from 'vscode/vscode/vs/nls';
4
4
  import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
5
5
  import { IFileDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
6
6
  import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
@@ -12,16 +12,15 @@ import { isExportableSessionData } from 'vscode/vscode/vs/workbench/contrib/chat
12
12
  import { IChatService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService.service';
13
13
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
14
14
 
15
- const _moduleId = "vs/workbench/contrib/chat/browser/actions/chatImportExport";
16
15
  const defaultFileName = 'chat.json';
17
- const filters = [{ name: ( localizeWithPath(_moduleId, 0, "Chat Session")), extensions: ['json'] }];
16
+ const filters = [{ name: ( localize(7260, "Chat Session")), extensions: ['json'] }];
18
17
  function registerChatExportActions() {
19
18
  registerAction2(class ExportChatAction extends Action2 {
20
19
  constructor() {
21
20
  super({
22
21
  id: 'workbench.action.chat.export',
23
22
  category: CHAT_CATEGORY,
24
- title: ( localize2WithPath(_moduleId, 1, "Export Chat...")),
23
+ title: ( localize2(7261, "Export Chat...")),
25
24
  precondition: CONTEXT_CHAT_ENABLED,
26
25
  f1: true,
27
26
  });
@@ -55,7 +54,7 @@ function registerChatExportActions() {
55
54
  constructor() {
56
55
  super({
57
56
  id: 'workbench.action.chat.import',
58
- title: ( localize2WithPath(_moduleId, 2, "Import Chat...")),
57
+ title: ( localize2(7262, "Import Chat...")),
59
58
  category: CHAT_CATEGORY,
60
59
  precondition: CONTEXT_CHAT_ENABLED,
61
60
  f1: true,
@@ -1,4 +1,4 @@
1
- import { localize2WithPath } from 'vscode/vscode/vs/nls';
1
+ import { localize2 } from 'vscode/vscode/vs/nls';
2
2
  import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
3
3
  import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
4
4
  import { ActiveEditorContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
@@ -12,7 +12,6 @@ import { AUX_WINDOW_GROUP, ACTIVE_GROUP } from 'vscode/vscode/vs/workbench/servi
12
12
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
13
13
  import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
14
14
 
15
- const _moduleId = "vs/workbench/contrib/chat/browser/actions/chatMoveActions";
16
15
  var MoveToNewLocation;
17
16
  ( ((function(MoveToNewLocation) {
18
17
  MoveToNewLocation["Editor"] = "Editor";
@@ -23,7 +22,7 @@ function registerMoveActions() {
23
22
  constructor() {
24
23
  super({
25
24
  id: `workbench.action.chat.openInEditor`,
26
- title: ( localize2WithPath(_moduleId, 0, "Open Chat in Editor")),
25
+ title: ( localize2(7263, "Open Chat in Editor")),
27
26
  category: CHAT_CATEGORY,
28
27
  precondition: CONTEXT_CHAT_ENABLED,
29
28
  f1: true,
@@ -43,7 +42,7 @@ function registerMoveActions() {
43
42
  constructor() {
44
43
  super({
45
44
  id: `workbench.action.chat.openInNewWindow`,
46
- title: ( localize2WithPath(_moduleId, 1, "Open Chat in New Window")),
45
+ title: ( localize2(7264, "Open Chat in New Window")),
47
46
  category: CHAT_CATEGORY,
48
47
  precondition: CONTEXT_CHAT_ENABLED,
49
48
  f1: true,
@@ -63,7 +62,7 @@ function registerMoveActions() {
63
62
  constructor() {
64
63
  super({
65
64
  id: `workbench.action.chat.openInSidebar`,
66
- title: ( localize2WithPath(_moduleId, 2, "Open Chat in Side Bar")),
65
+ title: ( localize2(7265, "Open Chat in Side Bar")),
67
66
  category: CHAT_CATEGORY,
68
67
  precondition: CONTEXT_CHAT_ENABLED,
69
68
  f1: true,
@@ -81,7 +80,6 @@ function registerMoveActions() {
81
80
  }
82
81
  async function executeMoveToAction(accessor, moveTo, chatView) {
83
82
  const widgetService = accessor.get(IChatWidgetService);
84
- const viewService = accessor.get(IViewsService);
85
83
  const editorService = accessor.get(IEditorService);
86
84
  const widget = chatView?.widget ?? widgetService.lastFocusedWidget;
87
85
  if (!widget || !('viewId' in widget.viewContext)) {
@@ -93,9 +91,8 @@ async function executeMoveToAction(accessor, moveTo, chatView) {
93
91
  return;
94
92
  }
95
93
  const sessionId = viewModel.sessionId;
96
- const view = await viewService.openView(widget.viewContext.viewId);
97
- const viewState = view.widget.getViewState();
98
- view.clear();
94
+ const viewState = widget.getViewState();
95
+ widget.clear();
99
96
  await editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options: { target: { sessionId }, pinned: true, viewState: viewState } }, moveTo === MoveToNewLocation.Window ? AUX_WINDOW_GROUP : ACTIVE_GROUP);
100
97
  }
101
98
  async function moveToSidebar(accessor) {
@@ -103,14 +100,16 @@ async function moveToSidebar(accessor) {
103
100
  const editorService = accessor.get(IEditorService);
104
101
  const editorGroupService = accessor.get(IEditorGroupsService);
105
102
  const chatEditorInput = editorService.activeEditor;
103
+ let view;
106
104
  if (chatEditorInput instanceof ChatEditorInput && chatEditorInput.sessionId) {
107
105
  await editorService.closeEditor({ editor: chatEditorInput, groupId: editorGroupService.activeGroup.id });
108
- const view = await viewsService.openView(CHAT_VIEW_ID);
106
+ view = await viewsService.openView(CHAT_VIEW_ID);
109
107
  view.loadSession(chatEditorInput.sessionId);
110
108
  }
111
109
  else {
112
- await viewsService.openView(CHAT_VIEW_ID);
110
+ view = await viewsService.openView(CHAT_VIEW_ID);
113
111
  }
112
+ view.focus();
114
113
  }
115
114
 
116
115
  export { registerMoveActions };
@@ -2,7 +2,7 @@ import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
2
2
  import { KeyCode, KeyMod } from 'vscode/vscode/vs/base/common/keyCodes';
3
3
  import marked_1 from 'vscode/external/vscode-marked/lib/marked.esm.js';
4
4
  import { IBulkEditService } from 'vscode/vscode/vs/editor/browser/services/bulkEditService';
5
- import { localize2WithPath } from 'vscode/vscode/vs/nls';
5
+ import { localize2 } from 'vscode/vscode/vs/nls';
6
6
  import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
7
7
  import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
8
8
  import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
@@ -17,13 +17,12 @@ import { NOTEBOOK_EDITOR_ID, CellEditType, CellKind } from 'vscode/vscode/vs/wor
17
17
  import { NOTEBOOK_IS_ACTIVE_EDITOR } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
18
18
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
19
19
 
20
- const _moduleId = "vs/workbench/contrib/chat/browser/actions/chatTitleActions";
21
20
  function registerChatTitleActions() {
22
21
  registerAction2(class MarkHelpfulAction extends Action2 {
23
22
  constructor() {
24
23
  super({
25
24
  id: 'workbench.action.chat.markHelpful',
26
- title: ( localize2WithPath(_moduleId, 0, "Helpful")),
25
+ title: ( localize2(7266, "Helpful")),
27
26
  f1: false,
28
27
  category: CHAT_CATEGORY,
29
28
  icon: Codicon.thumbsup,
@@ -44,6 +43,7 @@ function registerChatTitleActions() {
44
43
  const chatService = accessor.get(IChatService);
45
44
  chatService.notifyUserAction({
46
45
  agentId: item.agent?.id,
46
+ command: item.slashCommand?.name,
47
47
  sessionId: item.sessionId,
48
48
  requestId: item.requestId,
49
49
  result: item.result,
@@ -59,7 +59,7 @@ function registerChatTitleActions() {
59
59
  constructor() {
60
60
  super({
61
61
  id: 'workbench.action.chat.markUnhelpful',
62
- title: ( localize2WithPath(_moduleId, 1, "Unhelpful")),
62
+ title: ( localize2(7267, "Unhelpful")),
63
63
  f1: false,
64
64
  category: CHAT_CATEGORY,
65
65
  icon: Codicon.thumbsdown,
@@ -80,6 +80,7 @@ function registerChatTitleActions() {
80
80
  const chatService = accessor.get(IChatService);
81
81
  chatService.notifyUserAction({
82
82
  agentId: item.agent?.id,
83
+ command: item.slashCommand?.name,
83
84
  sessionId: item.sessionId,
84
85
  requestId: item.requestId,
85
86
  result: item.result,
@@ -95,7 +96,7 @@ function registerChatTitleActions() {
95
96
  constructor() {
96
97
  super({
97
98
  id: 'workbench.action.chat.reportIssueForBug',
98
- title: ( localize2WithPath(_moduleId, 2, "Report Issue")),
99
+ title: ( localize2(7268, "Report Issue")),
99
100
  f1: false,
100
101
  category: CHAT_CATEGORY,
101
102
  icon: Codicon.report,
@@ -115,6 +116,7 @@ function registerChatTitleActions() {
115
116
  const chatService = accessor.get(IChatService);
116
117
  chatService.notifyUserAction({
117
118
  agentId: item.agent?.id,
119
+ command: item.slashCommand?.name,
118
120
  sessionId: item.sessionId,
119
121
  requestId: item.requestId,
120
122
  result: item.result,
@@ -128,7 +130,7 @@ function registerChatTitleActions() {
128
130
  constructor() {
129
131
  super({
130
132
  id: 'workbench.action.chat.insertIntoNotebook',
131
- title: ( localize2WithPath(_moduleId, 3, "Insert into Notebook")),
133
+ title: ( localize2(7269, "Insert into Notebook")),
132
134
  f1: false,
133
135
  category: CHAT_CATEGORY,
134
136
  icon: Codicon.insert,
@@ -158,7 +160,7 @@ function registerChatTitleActions() {
158
160
  if (notebookEditor.isReadOnly) {
159
161
  return;
160
162
  }
161
- const value = item.response.asString();
163
+ const value = ( (item.response.toString()));
162
164
  const splitContents = splitMarkdownAndCodeBlocks(value);
163
165
  const focusRange = notebookEditor.getFocus();
164
166
  const index = Math.max(focusRange.end, 0);
@@ -190,7 +192,7 @@ function registerChatTitleActions() {
190
192
  constructor() {
191
193
  super({
192
194
  id: 'workbench.action.chat.remove',
193
- title: ( localize2WithPath(_moduleId, 4, "Remove Request and Response")),
195
+ title: ( localize2(7270, "Remove Request and Response")),
194
196
  f1: false,
195
197
  category: CHAT_CATEGORY,
196
198
  icon: Codicon.x,
@@ -3,7 +3,7 @@ import { isMarkdownString, MarkdownString } from 'vscode/vscode/vs/base/common/h
3
3
  import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
4
  import { Schemas } from 'vscode/vscode/vs/base/common/network';
5
5
  import { isMacintosh } from 'vscode/vscode/vs/base/common/platform';
6
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
6
+ import { localize } from 'vscode/vscode/vs/nls';
7
7
  import { AccessibleViewRegistry } from 'vscode/vscode/vs/platform/accessibility/browser/accessibleViewRegistry';
8
8
  import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
9
9
  import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
@@ -58,48 +58,45 @@ import { registerChatContextActions } from './actions/chatContextActions.js';
58
58
  import { registerChatDeveloperActions } from './actions/chatDeveloperActions.js';
59
59
  import { LanguageModelToolsExtensionPointHandler } from '../common/tools/languageModelToolsContribution.js';
60
60
 
61
- const _moduleId = "vs/workbench/contrib/chat/browser/chat.contribution";
62
61
  const configurationRegistry = ( (Registry.as(Extensions.Configuration)));
63
62
  configurationRegistry.registerConfiguration({
64
63
  id: 'chatSidebar',
65
- title: ( localizeWithPath(_moduleId, 0, "Chat")),
64
+ title: ( localize(3108, "Chat")),
66
65
  type: 'object',
67
66
  properties: {
68
67
  'chat.editor.fontSize': {
69
68
  type: 'number',
70
- description: ( localizeWithPath(_moduleId, 1, "Controls the font size in pixels in chat codeblocks.")),
69
+ description: ( localize(3109, "Controls the font size in pixels in chat codeblocks.")),
71
70
  default: isMacintosh ? 12 : 14,
72
71
  },
73
72
  'chat.editor.fontFamily': {
74
73
  type: 'string',
75
- description: ( localizeWithPath(_moduleId, 2, "Controls the font family in chat codeblocks.")),
74
+ description: ( localize(3110, "Controls the font family in chat codeblocks.")),
76
75
  default: 'default'
77
76
  },
78
77
  'chat.editor.fontWeight': {
79
78
  type: 'string',
80
- description: ( localizeWithPath(_moduleId, 3, "Controls the font weight in chat codeblocks.")),
79
+ description: ( localize(3111, "Controls the font weight in chat codeblocks.")),
81
80
  default: 'default'
82
81
  },
83
82
  'chat.editor.wordWrap': {
84
83
  type: 'string',
85
- description: ( localizeWithPath(_moduleId, 4, "Controls whether lines should wrap in chat codeblocks.")),
84
+ description: ( localize(3112, "Controls whether lines should wrap in chat codeblocks.")),
86
85
  default: 'off',
87
86
  enum: ['on', 'off']
88
87
  },
89
88
  'chat.editor.lineHeight': {
90
89
  type: 'number',
91
- description: ( localizeWithPath(
92
- _moduleId,
93
- 5,
90
+ description: ( localize(
91
+ 3113,
94
92
  "Controls the line height in pixels in chat codeblocks. Use 0 to compute the line height from the font size."
95
93
  )),
96
94
  default: 0
97
95
  },
98
96
  'chat.experimental.implicitContext': {
99
97
  type: 'boolean',
100
- description: ( localizeWithPath(
101
- _moduleId,
102
- 6,
98
+ description: ( localize(
99
+ 3114,
103
100
  "Controls whether a checkbox is shown to allow the user to determine which implicit context is included with a chat participant's prompt."
104
101
  )),
105
102
  deprecated: true,
@@ -107,22 +104,22 @@ configurationRegistry.registerConfiguration({
107
104
  },
108
105
  'chat.experimental.variables.editor': {
109
106
  type: 'boolean',
110
- description: ( localizeWithPath(_moduleId, 7, "Enables variables for editor chat.")),
111
- default: false
107
+ description: ( localize(3115, "Enables variables for editor chat.")),
108
+ default: true
112
109
  },
113
110
  'chat.experimental.variables.notebook': {
114
111
  type: 'boolean',
115
- description: ( localizeWithPath(_moduleId, 8, "Enables variables for notebook chat.")),
112
+ description: ( localize(3116, "Enables variables for notebook chat.")),
116
113
  default: false
117
114
  },
118
115
  'chat.experimental.variables.terminal': {
119
116
  type: 'boolean',
120
- description: ( localizeWithPath(_moduleId, 9, "Enables variables for terminal chat.")),
117
+ description: ( localize(3117, "Enables variables for terminal chat.")),
121
118
  default: false
122
119
  },
123
120
  }
124
121
  });
125
- ( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(ChatEditor, ChatEditorInput.EditorID, ( localizeWithPath(_moduleId, 10, "Chat"))), [
122
+ ( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(ChatEditor, ChatEditorInput.EditorID, ( localize(3118, "Chat"))), [
126
123
  ( (new SyncDescriptor(ChatEditorInput)))
127
124
  ]);
128
125
  let ChatResolverContribution = class ChatResolverContribution extends Disposable {
@@ -131,7 +128,7 @@ let ChatResolverContribution = class ChatResolverContribution extends Disposable
131
128
  super();
132
129
  this._register(editorResolverService.registerEditor(`${Schemas.vscodeChatSesssion}:**/**`, {
133
130
  id: ChatEditorInput.EditorID,
134
- label: ( localizeWithPath(_moduleId, 10, "Chat")),
131
+ label: ( localize(3118, "Chat")),
135
132
  priority: RegisteredEditorPriority.builtin
136
133
  }, {
137
134
  singlePerResource: true,
@@ -154,9 +151,10 @@ let ChatSlashStaticSlashCommandsContribution = class ChatSlashStaticSlashCommand
154
151
  super();
155
152
  this._store.add(slashCommandService.registerSlashCommand({
156
153
  command: 'clear',
157
- detail: ( localizeWithPath(_moduleId, 11, "Start a new chat")),
154
+ detail: ( localize(3119, "Start a new chat")),
158
155
  sortText: 'z2_clear',
159
- executeImmediately: true
156
+ executeImmediately: true,
157
+ locations: [ChatAgentLocation.Panel]
160
158
  }, async () => {
161
159
  commandService.executeCommand(ACTION_ID_NEW_CHAT);
162
160
  }));
@@ -164,7 +162,8 @@ let ChatSlashStaticSlashCommandsContribution = class ChatSlashStaticSlashCommand
164
162
  command: 'help',
165
163
  detail: '',
166
164
  sortText: 'z1_help',
167
- executeImmediately: true
165
+ executeImmediately: true,
166
+ locations: [ChatAgentLocation.Panel]
168
167
  }, async (prompt, progress) => {
169
168
  const defaultAgent = chatAgentService.getDefaultAgent(ChatAgentLocation.Panel);
170
169
  const agents = chatAgentService.getAgents();
@@ -200,8 +199,8 @@ let ChatSlashStaticSlashCommandsContribution = class ChatSlashStaticSlashCommand
200
199
  progress.report({ content: ( (new MarkdownString(defaultAgent.metadata.helpTextVariablesPrefix))), kind: 'markdownContent' });
201
200
  }
202
201
  const variables = [
203
- ...chatVariablesService.getVariables(),
204
- { name: 'file', description: ( localizeWithPath(_moduleId, 12, "Choose a file in the workspace")) }
202
+ ...chatVariablesService.getVariables(ChatAgentLocation.Panel),
203
+ { name: 'file', description: ( localize(3120, "Choose a file in the workspace")) }
205
204
  ];
206
205
  const variableText = ( (variables
207
206
  .map(v => `* \`${chatVariableLeader}${v.name}\` - ${v.description}`)))
@@ -232,7 +231,7 @@ registerWorkbenchContribution2(ChatResolverContribution.ID, ChatResolverContribu
232
231
  workbenchContributionsRegistry.registerWorkbenchContribution(ChatSlashStaticSlashCommandsContribution, LifecyclePhase.Eventually);
233
232
  ( (Registry.as(EditorExtensions.EditorFactory))).registerEditorSerializer(ChatEditorInput.TypeID, ChatEditorInputSerializer);
234
233
  registerWorkbenchContribution2(ChatExtensionPointHandler.ID, ChatExtensionPointHandler, WorkbenchPhase.BlockStartup);
235
- registerWorkbenchContribution2(LanguageModelToolsExtensionPointHandler.ID, LanguageModelToolsExtensionPointHandler, WorkbenchPhase.Eventually);
234
+ registerWorkbenchContribution2(LanguageModelToolsExtensionPointHandler.ID, LanguageModelToolsExtensionPointHandler, WorkbenchPhase.BlockRestore);
236
235
  registerChatActions();
237
236
  registerChatCopyActions();
238
237
  registerChatCodeBlockActions();