@codingame/monaco-vscode-chat-service-override 4.5.1 → 5.0.0

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 (26) hide show
  1. package/chat.js +6 -6
  2. package/package.json +2 -2
  3. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClear.js +2 -2
  4. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +36 -60
  5. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +78 -51
  6. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +5 -12
  7. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +6 -13
  8. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +10 -27
  9. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +39 -95
  10. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +102 -40
  11. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +57 -70
  12. package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +3 -23
  13. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +4 -3
  14. package/vscode/src/vs/workbench/contrib/chat/browser/{chatContributionServiceImpl.js → chatParticipantContributions.js} +63 -202
  15. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +35 -28
  16. package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +1 -1
  17. package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +49 -41
  18. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +71 -74
  19. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +142 -185
  20. package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +3 -3
  21. package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +5 -4
  22. package/vscode/src/vs/workbench/contrib/chat/common/languageModelStats.js +131 -0
  23. package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +11 -2
  24. package/vscode/src/vs/workbench/contrib/chat/common/voiceChat.js +4 -4
  25. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +1 -4
  26. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.js +35 -34
@@ -4,6 +4,7 @@ import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
4
4
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
5
5
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
6
6
  import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView.service';
7
+ import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.service';
7
8
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
8
9
  import { ServiceCollection } from 'vscode/vscode/vs/platform/instantiation/common/serviceCollection';
9
10
  import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
@@ -29,62 +30,66 @@ import { SIDE_BAR_FOREGROUND } from 'vscode/vscode/vs/workbench/common/theme';
29
30
  import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views.service';
30
31
  import { ChatWidget } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatWidget';
31
32
  import { ChatAgentLocation } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents';
33
+ import { IChatAgentService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
34
+ import { CHAT_PROVIDER_ID } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatParticipantContribTypes';
35
+ import { ChatModelInitState } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatModel';
32
36
  import { IChatService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService.service';
33
37
 
34
38
  const CHAT_SIDEBAR_PANEL_ID = 'workbench.panel.chatSidebar';
35
39
  let ChatViewPane = class ChatViewPane extends ViewPane {
36
- static { this.ID = 'workbench.panel.chat.view'; }
37
40
  get widget() { return this._widget; }
38
- constructor(chatViewOptions, options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService, storageService, chatService, logService) {
39
- super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
40
- this.chatViewOptions = chatViewOptions;
41
+ constructor(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService, hoverService, storageService, chatService, chatAgentService, logService) {
42
+ super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService, hoverService);
41
43
  this.storageService = storageService;
42
44
  this.chatService = chatService;
45
+ this.chatAgentService = chatAgentService;
43
46
  this.logService = logService;
44
47
  this.modelDisposables = this._register(( new DisposableStore()));
45
48
  this.didProviderRegistrationFail = false;
46
49
  this.didUnregisterProvider = false;
47
- this.memento = ( new Memento(
48
- 'interactive-session-view-' + this.chatViewOptions.providerId,
49
- this.storageService
50
- ));
50
+ this.memento = ( new Memento('interactive-session-view-' + CHAT_PROVIDER_ID, this.storageService));
51
51
  this.viewState = this.memento.getMemento(1 , 1 );
52
- this._register(this.chatService.onDidRegisterProvider(({ providerId }) => {
53
- if (providerId === this.chatViewOptions.providerId && !this._widget?.viewModel) {
54
- const sessionId = this.getSessionId();
55
- const model = sessionId ? this.chatService.getOrRestoreSession(sessionId) : undefined;
56
- try {
57
- this._widget.setVisible(false);
58
- this.updateModel(model);
59
- this.didProviderRegistrationFail = false;
60
- this.didUnregisterProvider = false;
61
- this._onDidChangeViewWelcomeState.fire();
62
- }
63
- finally {
64
- this.widget.setVisible(true);
52
+ this._register(this.chatAgentService.onDidChangeAgents(() => {
53
+ if (this.chatAgentService.getDefaultAgent(ChatAgentLocation.Panel)) {
54
+ if (!this._widget?.viewModel) {
55
+ const sessionId = this.getSessionId();
56
+ const model = sessionId ? this.chatService.getOrRestoreSession(sessionId) : undefined;
57
+ try {
58
+ this._widget.setVisible(false);
59
+ this.updateModel(model);
60
+ this.didProviderRegistrationFail = false;
61
+ this.didUnregisterProvider = false;
62
+ this._onDidChangeViewWelcomeState.fire();
63
+ }
64
+ finally {
65
+ this.widget.setVisible(true);
66
+ }
65
67
  }
66
68
  }
67
- }));
68
- this._register(this.chatService.onDidUnregisterProvider(({ providerId }) => {
69
- if (providerId === this.chatViewOptions.providerId) {
69
+ else if (this._widget?.viewModel?.initState === ChatModelInitState.Initialized) {
70
70
  this.didUnregisterProvider = true;
71
71
  this._onDidChangeViewWelcomeState.fire();
72
72
  }
73
73
  }));
74
74
  }
75
+ getActionsContext() {
76
+ return {
77
+ chatView: this
78
+ };
79
+ }
75
80
  updateModel(model, viewState) {
76
81
  this.modelDisposables.clear();
77
82
  model = model ?? (this.chatService.transferredSessionData?.sessionId
78
83
  ? this.chatService.getOrRestoreSession(this.chatService.transferredSessionData.sessionId)
79
- : this.chatService.startSession(this.chatViewOptions.providerId, CancellationToken.None));
84
+ : this.chatService.startSession(ChatAgentLocation.Panel, CancellationToken.None));
80
85
  if (!model) {
81
- throw new Error('Could not start chat session');
86
+ throw ( new Error('Could not start chat session'));
82
87
  }
83
88
  this._widget.setModel(model, { ...(viewState ?? this.viewState) });
84
89
  this.viewState.sessionId = model.sessionId;
85
90
  }
86
91
  shouldShowWelcome() {
87
- const noPersistedSessions = !this.chatService.hasSessions(this.chatViewOptions.providerId);
92
+ const noPersistedSessions = !this.chatService.hasSessions();
88
93
  return this.didUnregisterProvider || !this._widget?.viewModel && (noPersistedSessions || this.didProviderRegistrationFail);
89
94
  }
90
95
  getSessionId() {
@@ -102,10 +107,11 @@ let ChatViewPane = class ChatViewPane extends ViewPane {
102
107
  try {
103
108
  super.renderBody(parent);
104
109
  const scopedInstantiationService = this.instantiationService.createChild(( new ServiceCollection([IContextKeyService, this.scopedContextKeyService])));
110
+ const locationBasedColors = this.getLocationBasedColors();
105
111
  this._widget = this._register(scopedInstantiationService.createInstance(ChatWidget, ChatAgentLocation.Panel, { viewId: this.id }, { supportsFileReferences: true }, {
106
112
  listForeground: SIDE_BAR_FOREGROUND,
107
- listBackground: this.getBackgroundColor(),
108
- inputEditorBackground: this.getBackgroundColor(),
113
+ listBackground: locationBasedColors.background,
114
+ inputEditorBackground: locationBasedColors.background,
109
115
  resultEditorBackground: editorBackground
110
116
  }));
111
117
  this._register(this.onDidChangeBodyVisibility(visible => {
@@ -115,7 +121,7 @@ let ChatViewPane = class ChatViewPane extends ViewPane {
115
121
  this._widget.render(parent);
116
122
  const sessionId = this.getSessionId();
117
123
  const disposeListener = sessionId ? this._register(this.chatService.onDidDisposeSession((e) => {
118
- if (e.reason === 'initializationFailed' && e.providerId === this.chatViewOptions.providerId) {
124
+ if (e.reason === 'initializationFailed') {
119
125
  this.didProviderRegistrationFail = true;
120
126
  disposeListener?.dispose();
121
127
  this._onDidChangeViewWelcomeState.fire();
@@ -132,7 +138,7 @@ let ChatViewPane = class ChatViewPane extends ViewPane {
132
138
  acceptInput(query) {
133
139
  this._widget.acceptInput(query);
134
140
  }
135
- async clear() {
141
+ clear() {
136
142
  if (this.widget.viewModel) {
137
143
  this.chatService.clearSession(this.widget.viewModel.sessionId);
138
144
  }
@@ -168,18 +174,20 @@ let ChatViewPane = class ChatViewPane extends ViewPane {
168
174
  }
169
175
  };
170
176
  ChatViewPane = ( __decorate([
171
- ( __param(2, IKeybindingService)),
172
- ( __param(3, IContextMenuService)),
173
- ( __param(4, IConfigurationService)),
174
- ( __param(5, IContextKeyService)),
175
- ( __param(6, IViewDescriptorService)),
176
- ( __param(7, IInstantiationService)),
177
- ( __param(8, IOpenerService)),
178
- ( __param(9, IThemeService)),
179
- ( __param(10, ITelemetryService)),
177
+ ( __param(1, IKeybindingService)),
178
+ ( __param(2, IContextMenuService)),
179
+ ( __param(3, IConfigurationService)),
180
+ ( __param(4, IContextKeyService)),
181
+ ( __param(5, IViewDescriptorService)),
182
+ ( __param(6, IInstantiationService)),
183
+ ( __param(7, IOpenerService)),
184
+ ( __param(8, IThemeService)),
185
+ ( __param(9, ITelemetryService)),
186
+ ( __param(10, IHoverService)),
180
187
  ( __param(11, IStorageService)),
181
188
  ( __param(12, IChatService)),
182
- ( __param(13, ILogService))
189
+ ( __param(13, IChatAgentService)),
190
+ ( __param(14, ILogService))
183
191
  ], ChatViewPane));
184
192
 
185
193
  export { CHAT_SIDEBAR_PANEL_ID, ChatViewPane };
@@ -36,6 +36,7 @@ import { IChatSlashCommandService } from 'vscode/vscode/vs/workbench/contrib/cha
36
36
  import { IChatVariablesService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatVariables.service';
37
37
 
38
38
  var BuiltinDynamicCompletions_1, VariableCompletions_1;
39
+ const _moduleId = "vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib";
39
40
  const decorationDescription = 'chat';
40
41
  const placeholderDecorationType = 'chat-session-detail';
41
42
  const slashCommandTextDecorationType = 'chat-session-text';
@@ -51,8 +52,8 @@ let InputEditorDecorations = class InputEditorDecorations extends Disposable {
51
52
  this.themeService = themeService;
52
53
  this.chatAgentService = chatAgentService;
53
54
  this.id = 'inputEditorDecorations';
54
- this.previouslyUsedAgents = ( new Set());
55
- this.viewModelDisposables = this._register(( new MutableDisposable()));
55
+ this.previouslyUsedAgents = ( (new Set()));
56
+ this.viewModelDisposables = this._register(( (new MutableDisposable())));
56
57
  this.codeEditorService.registerDecorationType(decorationDescription, placeholderDecorationType, {});
57
58
  this._register(this.themeService.onDidColorThemeChange(() => this.updateRegisteredDecorationTypes()));
58
59
  this.updateRegisteredDecorationTypes();
@@ -122,7 +123,7 @@ let InputEditorDecorations = class InputEditorDecorations extends Disposable {
122
123
  },
123
124
  renderOptions: {
124
125
  after: {
125
- contentText: viewModel.inputPlaceholder ?? defaultAgent?.description ?? '',
126
+ contentText: viewModel.inputPlaceholder || (defaultAgent?.description ?? ''),
126
127
  color: this.getPlaceholderColor()
127
128
  }
128
129
  }
@@ -152,7 +153,7 @@ let InputEditorDecorations = class InputEditorDecorations extends Disposable {
152
153
  });
153
154
  const onlyAgentAndWhitespace = agentPart && parsedRequest.every(p => p instanceof ChatRequestTextPart && !p.text.trim().length || p instanceof ChatRequestAgentPart);
154
155
  if (onlyAgentAndWhitespace) {
155
- const isFollowupSlashCommand = ( this.previouslyUsedAgents.has(agentAndCommandToKey(agentPart.agent, undefined)));
156
+ const isFollowupSlashCommand = ( (this.previouslyUsedAgents.has(agentAndCommandToKey(agentPart.agent, undefined))));
156
157
  const shouldRenderFollowupPlaceholder = isFollowupSlashCommand && agentPart.agent.metadata.followupPlaceholder;
157
158
  if (agentPart.agent.description && exactlyOneSpaceAfterPart(agentPart)) {
158
159
  placeholderDecoration = [{
@@ -168,7 +169,7 @@ let InputEditorDecorations = class InputEditorDecorations extends Disposable {
168
169
  }
169
170
  const onlyAgentCommandAndWhitespace = agentPart && agentSubcommandPart && parsedRequest.every(p => p instanceof ChatRequestTextPart && !p.text.trim().length || p instanceof ChatRequestAgentPart || p instanceof ChatRequestAgentSubcommandPart);
170
171
  if (onlyAgentCommandAndWhitespace) {
171
- const isFollowupSlashCommand = ( this.previouslyUsedAgents.has(agentAndCommandToKey(agentPart.agent, agentSubcommandPart.command.name)));
172
+ const isFollowupSlashCommand = ( (this.previouslyUsedAgents.has(agentAndCommandToKey(agentPart.agent, agentSubcommandPart.command.name))));
172
173
  const shouldRenderFollowupPlaceholder = isFollowupSlashCommand && agentSubcommandPart.command.followupPlaceholder;
173
174
  if (agentSubcommandPart?.command.description && exactlyOneSpaceAfterPart(agentSubcommandPart)) {
174
175
  placeholderDecoration = [{
@@ -186,11 +187,11 @@ let InputEditorDecorations = class InputEditorDecorations extends Disposable {
186
187
  const textDecorations = [];
187
188
  if (agentPart) {
188
189
  const isDupe = !!this.chatAgentService.getAgents().find(other => other.name === agentPart.agent.name && other.id !== agentPart.agent.id);
189
- const id = isDupe ? `(${agentPart.agent.id}) ` : '';
190
- const agentHover = `${id}${agentPart.agent.description}`;
191
- textDecorations.push({ range: agentPart.editorRange, hoverMessage: ( new MarkdownString(agentHover)) });
190
+ const publisher = isDupe ? `(${agentPart.agent.extensionPublisherDisplayName}) ` : '';
191
+ const agentHover = `${publisher}${agentPart.agent.description}`;
192
+ textDecorations.push({ range: agentPart.editorRange, hoverMessage: ( (new MarkdownString(agentHover))) });
192
193
  if (agentSubcommandPart) {
193
- textDecorations.push({ range: agentSubcommandPart.editorRange, hoverMessage: ( new MarkdownString(agentSubcommandPart.command.description)) });
194
+ textDecorations.push({ range: agentSubcommandPart.editorRange, hoverMessage: ( (new MarkdownString(agentSubcommandPart.command.description))) });
194
195
  }
195
196
  }
196
197
  if (slashCommandPart) {
@@ -205,11 +206,11 @@ let InputEditorDecorations = class InputEditorDecorations extends Disposable {
205
206
  this.widget.inputEditor.setDecorationsByType(decorationDescription, variableTextDecorationType, varDecorations);
206
207
  }
207
208
  };
208
- InputEditorDecorations = ( __decorate([
209
- ( __param(1, ICodeEditorService)),
210
- ( __param(2, IThemeService)),
211
- ( __param(3, IChatAgentService))
212
- ], InputEditorDecorations));
209
+ InputEditorDecorations = ( (__decorate([
210
+ ( (__param(1, ICodeEditorService))),
211
+ ( (__param(2, IThemeService))),
212
+ ( (__param(3, IChatAgentService)))
213
+ ], InputEditorDecorations)));
213
214
  class InputEditorSlashCommandMode extends Disposable {
214
215
  constructor(widget) {
215
216
  super();
@@ -262,29 +263,29 @@ let SlashCommandCompletions = class SlashCommandCompletions extends Disposable {
262
263
  return null;
263
264
  }
264
265
  return {
265
- suggestions: ( slashCommands.map((c, i) => {
266
+ suggestions: ( (slashCommands.map((c, i) => {
266
267
  const withSlash = `/${c.command}`;
267
268
  return {
268
269
  label: withSlash,
269
270
  insertText: c.executeImmediately ? '' : `${withSlash} `,
270
271
  detail: c.detail,
271
- range: ( new Range(1, 1, 1, 1)),
272
+ range: ( (new Range(1, 1, 1, 1))),
272
273
  sortText: c.sortText ?? 'a'.repeat(i + 1),
273
274
  kind: 18 ,
274
275
  command: c.executeImmediately ? { id: SubmitAction.ID, title: withSlash, arguments: [{ widget, inputValue: `${withSlash} ` }] } : undefined,
275
276
  };
276
- }))
277
+ })))
277
278
  };
278
279
  }
279
280
  }));
280
281
  }
281
282
  };
282
- SlashCommandCompletions = ( __decorate([
283
- ( __param(0, ILanguageFeaturesService)),
284
- ( __param(1, IChatWidgetService)),
285
- ( __param(2, IChatSlashCommandService))
286
- ], SlashCommandCompletions));
287
- ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(SlashCommandCompletions, 4 );
283
+ SlashCommandCompletions = ( (__decorate([
284
+ ( (__param(0, ILanguageFeaturesService))),
285
+ ( (__param(1, IChatWidgetService))),
286
+ ( (__param(2, IChatSlashCommandService)))
287
+ ], SlashCommandCompletions)));
288
+ ( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(SlashCommandCompletions, 4 );
288
289
  let AgentCompletions = class AgentCompletions extends Disposable {
289
290
  constructor(languageFeaturesService, chatWidgetService, chatAgentService) {
290
291
  super();
@@ -312,20 +313,20 @@ let AgentCompletions = class AgentCompletions extends Disposable {
312
313
  .filter(a => !a.isDefault)
313
314
  .filter(a => a.locations.includes(widget.location));
314
315
  return {
315
- suggestions: ( agents.map((a, i) => {
316
+ suggestions: ( (agents.map((a, i) => {
316
317
  const withAt = `@${a.name}`;
317
318
  const isDupe = !!agents.find(other => other.name === a.name && other.id !== a.id);
318
319
  return {
319
320
  label: isDupe ?
320
- { label: withAt, description: a.description, detail: ` (${a.id})` } :
321
+ { label: withAt, description: a.description, detail: ` (${a.extensionPublisherDisplayName})` } :
321
322
  withAt,
322
323
  insertText: `${withAt} `,
323
324
  detail: a.description,
324
- range: ( new Range(1, 1, 1, 1)),
325
+ range: ( (new Range(1, 1, 1, 1))),
325
326
  command: { id: AssignSelectedAgentAction.ID, title: AssignSelectedAgentAction.ID, arguments: [{ agent: a, widget }] },
326
327
  kind: 18 ,
327
328
  };
328
- }))
329
+ })))
329
330
  };
330
331
  }
331
332
  }));
@@ -357,7 +358,7 @@ let AgentCompletions = class AgentCompletions extends Disposable {
357
358
  }
358
359
  const usedAgent = parsedRequest[usedAgentIdx];
359
360
  return {
360
- suggestions: ( usedAgent.agent.slashCommands.map((c, i) => {
361
+ suggestions: ( (usedAgent.agent.slashCommands.map((c, i) => {
361
362
  const withSlash = `/${c.name}`;
362
363
  return {
363
364
  label: withSlash,
@@ -366,7 +367,7 @@ let AgentCompletions = class AgentCompletions extends Disposable {
366
367
  range,
367
368
  kind: 18 ,
368
369
  };
369
- }))
370
+ })))
370
371
  };
371
372
  }
372
373
  }));
@@ -385,7 +386,7 @@ let AgentCompletions = class AgentCompletions extends Disposable {
385
386
  }
386
387
  const agents = this.chatAgentService.getAgents()
387
388
  .filter(a => a.locations.includes(widget.location));
388
- const justAgents = ( agents
389
+ const justAgents = ( (agents
389
390
  .filter(a => !a.isDefault)
390
391
  .map(agent => {
391
392
  const isDupe = !!agents.find(other => other.name === agent.name && other.id !== agent.id);
@@ -393,19 +394,19 @@ let AgentCompletions = class AgentCompletions extends Disposable {
393
394
  const agentLabel = `${chatAgentLeader}${agent.name}`;
394
395
  return {
395
396
  label: isDupe ?
396
- { label: agentLabel, description: agent.description, detail: ` (${agent.id})` } :
397
+ { label: agentLabel, description: agent.description, detail: ` (${agent.extensionPublisherDisplayName})` } :
397
398
  agentLabel,
398
399
  detail,
399
400
  filterText: `${chatSubcommandLeader}${agent.name}`,
400
401
  insertText: `${agentLabel} `,
401
- range: ( new Range(1, 1, 1, 1)),
402
+ range: ( (new Range(1, 1, 1, 1))),
402
403
  kind: 18 ,
403
404
  sortText: `${chatSubcommandLeader}${agent.id}`,
404
405
  command: { id: AssignSelectedAgentAction.ID, title: AssignSelectedAgentAction.ID, arguments: [{ agent, widget }] },
405
406
  };
406
- }));
407
+ })));
407
408
  return {
408
- suggestions: justAgents.concat(agents.flatMap(agent => ( agent.slashCommands.map((c, i) => {
409
+ suggestions: justAgents.concat(agents.flatMap(agent => ( (agent.slashCommands.map((c, i) => {
409
410
  const agentLabel = `${chatAgentLeader}${agent.name}`;
410
411
  const withSlash = `${chatSubcommandLeader}${c.name}`;
411
412
  return {
@@ -414,23 +415,23 @@ let AgentCompletions = class AgentCompletions extends Disposable {
414
415
  commitCharacters: [' '],
415
416
  insertText: `${agentLabel} ${withSlash} `,
416
417
  detail: `(${agentLabel}) ${c.description ?? ''}`,
417
- range: ( new Range(1, 1, 1, 1)),
418
+ range: ( (new Range(1, 1, 1, 1))),
418
419
  kind: 18 ,
419
420
  sortText: `${chatSubcommandLeader}${agent.id}${c.name}`,
420
421
  command: { id: AssignSelectedAgentAction.ID, title: AssignSelectedAgentAction.ID, arguments: [{ agent, widget }] },
421
422
  };
422
- }))))
423
+ })))))
423
424
  };
424
425
  }
425
426
  }));
426
427
  }
427
428
  };
428
- AgentCompletions = ( __decorate([
429
- ( __param(0, ILanguageFeaturesService)),
430
- ( __param(1, IChatWidgetService)),
431
- ( __param(2, IChatAgentService))
432
- ], AgentCompletions));
433
- ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(AgentCompletions, 4 );
429
+ AgentCompletions = ( (__decorate([
430
+ ( (__param(0, ILanguageFeaturesService))),
431
+ ( (__param(1, IChatWidgetService))),
432
+ ( (__param(2, IChatAgentService)))
433
+ ], AgentCompletions)));
434
+ ( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(AgentCompletions, 4 );
434
435
  class AssignSelectedAgentAction extends Action2 {
435
436
  static { this.ID = 'workbench.action.chat.assignSelectedAgent'; }
436
437
  constructor() {
@@ -450,7 +451,7 @@ class AssignSelectedAgentAction extends Action2 {
450
451
  registerAction2(AssignSelectedAgentAction);
451
452
  let BuiltinDynamicCompletions = class BuiltinDynamicCompletions extends Disposable {
452
453
  static { BuiltinDynamicCompletions_1 = this; }
453
- static { this.VariableNameDef = ( new RegExp(`${chatVariableLeader}\\w*`, 'g')); }
454
+ static { this.VariableNameDef = ( (new RegExp(`${chatVariableLeader}\\w*`, 'g'))); }
454
455
  constructor(languageFeaturesService, chatWidgetService) {
455
456
  super();
456
457
  this.languageFeaturesService = languageFeaturesService;
@@ -467,22 +468,18 @@ let BuiltinDynamicCompletions = class BuiltinDynamicCompletions extends Disposab
467
468
  if (!range) {
468
469
  return null;
469
470
  }
470
- const afterRange = ( new Range(
471
+ const afterRange = ( (new Range(
471
472
  position.lineNumber,
472
473
  range.replace.startColumn,
473
474
  position.lineNumber,
474
475
  range.replace.startColumn + '#file:'.length
475
- ));
476
+ )));
476
477
  return {
477
478
  suggestions: [
478
479
  {
479
480
  label: `${chatVariableLeader}file`,
480
481
  insertText: `${chatVariableLeader}file:`,
481
- detail: ( localizeWithPath(
482
- 'vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib',
483
- 'pickFileLabel',
484
- "Pick a file"
485
- )),
482
+ detail: ( localizeWithPath(_moduleId, 0, "Pick a file")),
486
483
  range,
487
484
  kind: 18 ,
488
485
  command: { id: SelectAndInsertFileAction.ID, title: SelectAndInsertFileAction.ID, arguments: [{ widget, range: afterRange }] },
@@ -494,11 +491,11 @@ let BuiltinDynamicCompletions = class BuiltinDynamicCompletions extends Disposab
494
491
  }));
495
492
  }
496
493
  };
497
- BuiltinDynamicCompletions = BuiltinDynamicCompletions_1 = ( __decorate([
498
- ( __param(0, ILanguageFeaturesService)),
499
- ( __param(1, IChatWidgetService))
500
- ], BuiltinDynamicCompletions));
501
- ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(BuiltinDynamicCompletions, 4 );
494
+ BuiltinDynamicCompletions = BuiltinDynamicCompletions_1 = ( (__decorate([
495
+ ( (__param(0, ILanguageFeaturesService))),
496
+ ( (__param(1, IChatWidgetService)))
497
+ ], BuiltinDynamicCompletions)));
498
+ ( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(BuiltinDynamicCompletions, 4 );
502
499
  function computeCompletionRanges(model, position, reg) {
503
500
  const varWord = getWordAtText(position.column, reg, model.getLineContent(position.lineNumber), 0);
504
501
  if (!varWord && model.getWordUntilPosition(position).word) {
@@ -510,24 +507,24 @@ function computeCompletionRanges(model, position, reg) {
510
507
  insert = replace = Range.fromPositions(position);
511
508
  }
512
509
  else {
513
- insert = ( new Range(
510
+ insert = ( (new Range(
514
511
  position.lineNumber,
515
512
  varWord.startColumn,
516
513
  position.lineNumber,
517
514
  position.column
518
- ));
519
- replace = ( new Range(
515
+ )));
516
+ replace = ( (new Range(
520
517
  position.lineNumber,
521
518
  varWord.startColumn,
522
519
  position.lineNumber,
523
520
  varWord.endColumn
524
- ));
521
+ )));
525
522
  }
526
523
  return { insert, replace, varWord };
527
524
  }
528
525
  let VariableCompletions = class VariableCompletions extends Disposable {
529
526
  static { VariableCompletions_1 = this; }
530
- static { this.VariableNameDef = ( new RegExp(`${chatVariableLeader}\\w*`, 'g')); }
527
+ static { this.VariableNameDef = ( (new RegExp(`${chatVariableLeader}\\w*`, 'g'))); }
531
528
  constructor(languageFeaturesService, chatWidgetService, chatVariablesService) {
532
529
  super();
533
530
  this.languageFeaturesService = languageFeaturesService;
@@ -546,8 +543,8 @@ let VariableCompletions = class VariableCompletions extends Disposable {
546
543
  return null;
547
544
  }
548
545
  const usedVariables = widget.parsedInput.parts.filter((p) => p instanceof ChatRequestVariablePart);
549
- const variableItems = ( Array.from(this.chatVariablesService.getVariables())
550
- .filter(v => !( usedVariables.some(usedVar => usedVar.variableName === v.name)))
546
+ const variableItems = ( (Array.from(this.chatVariablesService.getVariables())
547
+ .filter(v => !( (usedVariables.some(usedVar => usedVar.variableName === v.name))))
551
548
  .map(v => {
552
549
  const withLeader = `${chatVariableLeader}${v.name}`;
553
550
  return {
@@ -558,7 +555,7 @@ let VariableCompletions = class VariableCompletions extends Disposable {
558
555
  kind: 18 ,
559
556
  sortText: 'z'
560
557
  };
561
- }));
558
+ })));
562
559
  return {
563
560
  suggestions: variableItems
564
561
  };
@@ -566,12 +563,12 @@ let VariableCompletions = class VariableCompletions extends Disposable {
566
563
  }));
567
564
  }
568
565
  };
569
- VariableCompletions = VariableCompletions_1 = ( __decorate([
570
- ( __param(0, ILanguageFeaturesService)),
571
- ( __param(1, IChatWidgetService)),
572
- ( __param(2, IChatVariablesService))
573
- ], VariableCompletions));
574
- ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(VariableCompletions, 4 );
566
+ VariableCompletions = VariableCompletions_1 = ( (__decorate([
567
+ ( (__param(0, ILanguageFeaturesService))),
568
+ ( (__param(1, IChatWidgetService))),
569
+ ( (__param(2, IChatVariablesService)))
570
+ ], VariableCompletions)));
571
+ ( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(VariableCompletions, 4 );
575
572
  let ChatTokenDeleter = class ChatTokenDeleter extends Disposable {
576
573
  constructor(widget, instantiationService) {
577
574
  super();
@@ -595,12 +592,12 @@ let ChatTokenDeleter = class ChatTokenDeleter extends Disposable {
595
592
  const deletedRangeOfToken = Range.intersectRanges(token.editorRange, change.range);
596
593
  if (deletedRangeOfToken && Range.compareRangesUsingStarts(token.editorRange, change.range) < 0) {
597
594
  const length = deletedRangeOfToken.endColumn - deletedRangeOfToken.startColumn;
598
- const rangeToDelete = ( new Range(
595
+ const rangeToDelete = ( (new Range(
599
596
  token.editorRange.startLineNumber,
600
597
  token.editorRange.startColumn,
601
598
  token.editorRange.endLineNumber,
602
599
  token.editorRange.endColumn - length
603
- ));
600
+ )));
604
601
  this.widget.inputEditor.executeEdits(this.id, [{
605
602
  range: rangeToDelete,
606
603
  text: '',
@@ -613,7 +610,7 @@ let ChatTokenDeleter = class ChatTokenDeleter extends Disposable {
613
610
  }));
614
611
  }
615
612
  };
616
- ChatTokenDeleter = ( __decorate([
617
- ( __param(1, IInstantiationService))
618
- ], ChatTokenDeleter));
613
+ ChatTokenDeleter = ( (__decorate([
614
+ ( (__param(1, IInstantiationService)))
615
+ ], ChatTokenDeleter)));
619
616
  ChatWidget.CONTRIBS.push(ChatTokenDeleter);