@codingame/monaco-vscode-extensions-service-override 30.0.1 → 31.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 (46) hide show
  1. package/package.json +3 -3
  2. package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.d.ts +1 -0
  3. package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +63 -42
  4. package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +28 -28
  5. package/vscode/src/vs/workbench/api/browser/mainThreadBrowsers.js +2 -2
  6. package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +1 -1
  7. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.d.ts +22 -7
  8. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +171 -83
  9. package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.js +7 -0
  10. package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.d.ts +4 -1
  11. package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +46 -15
  12. package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +1 -1
  13. package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +2 -2
  14. package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +1 -1
  15. package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +11 -11
  16. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +20 -20
  17. package/vscode/src/vs/workbench/api/browser/mainThreadGitExtensionService.d.ts +0 -1
  18. package/vscode/src/vs/workbench/api/browser/mainThreadGitExtensionService.js +4 -13
  19. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +2 -2
  20. package/vscode/src/vs/workbench/api/browser/mainThreadMcp.d.ts +3 -3
  21. package/vscode/src/vs/workbench/api/browser/mainThreadMcp.js +34 -17
  22. package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +4 -4
  23. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +1 -1
  24. package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +3 -3
  25. package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +1 -1
  26. package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +1 -1
  27. package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +1 -1
  28. package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +2 -2
  29. package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +2 -2
  30. package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +1 -1
  31. package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +5 -5
  32. package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +1 -1
  33. package/vscode/src/vs/workbench/contrib/git/common/gitService.d.ts +7 -1
  34. package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +23 -23
  35. package/vscode/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.js +2 -2
  36. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +12 -12
  37. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +1 -1
  38. package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +1 -1
  39. package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +4 -4
  40. package/vscode/src/vs/workbench/services/themes/browser/cssExtensionPoint.js +5 -5
  41. package/vscode/src/vs/platform/browserView/common/browserViewTelemetry.d.ts +0 -34
  42. package/vscode/src/vs/platform/browserView/common/browserViewTelemetry.js +0 -7
  43. package/vscode/src/vs/platform/browserView/common/browserViewUri.d.ts +0 -21
  44. package/vscode/src/vs/platform/browserView/common/browserViewUri.js +0 -34
  45. package/vscode/src/vs/workbench/contrib/browserView/common/browserEditorInput.d.ts +0 -61
  46. package/vscode/src/vs/workbench/contrib/browserView/common/browserEditorInput.js +0 -233
@@ -4,6 +4,7 @@ import { DeferredPromise } from '@codingame/monaco-vscode-api/vscode/vs/base/com
4
4
  import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
5
5
  import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
6
6
  import { Disposable, DisposableMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
7
+ import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
7
8
  import { revive } from '@codingame/monaco-vscode-api/vscode/vs/base/common/marshalling';
8
9
  import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
9
10
  import { escapeRegExpCharacters } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
@@ -17,12 +18,13 @@ import { ILanguageFeaturesService } from '@codingame/monaco-vscode-api/vscode/vs
17
18
  import { ExtensionIdentifier } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensions/common/extensions';
18
19
  import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
19
20
  import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
21
+ import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
20
22
  import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
21
23
  import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
22
24
  import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/participants/chatAgents.service';
23
25
  import { PromptsStorage } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService';
24
26
  import { IPromptsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service';
25
- import { isValidPromptType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
27
+ import { PromptsType, isValidPromptType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
26
28
  import { ChatRequestAgentPart } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/requestParser/chatParserTypes';
27
29
  import { ChatRequestParser } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/requestParser/chatRequestParser';
28
30
  import { getDynamicVariablesForWidget, getSelectedToolAndToolSetsForWidget } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/attachments/chatVariables';
@@ -37,10 +39,12 @@ import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode
37
39
  import { NotebookDto } from './mainThreadNotebookDto.js';
38
40
  import { isUntitledChatSession } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
39
41
  import { ICustomizationHarnessService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService.service';
40
- import { AICustomizationManagementSection } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService';
41
- import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
42
- import { addDynamicVariableActionId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/input/editor/chatDynamicVariablesConstant';
42
+ import { AICustomizationManagementSection, BUILTIN_STORAGE } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService';
43
+ import { IAgentPluginService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/agentPluginService.service';
44
+ import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service';
43
45
  import { getAgentSessionProvider, AgentSessionProviders } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessions';
46
+ import { addDynamicVariableActionId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/input/editor/chatDynamicVariablesConstant';
47
+ import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
44
48
 
45
49
  class MainThreadChatTask {
46
50
  get onDidAddProgress() {
@@ -89,7 +93,9 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
89
93
  _promptsService,
90
94
  _languageModelToolsService,
91
95
  _customizationHarnessService,
92
- _configurationService
96
+ _telemetryService,
97
+ _agentPluginService,
98
+ _environmentService
93
99
  ) {
94
100
  super();
95
101
  this._chatAgentService = _chatAgentService;
@@ -104,7 +110,9 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
104
110
  this._promptsService = _promptsService;
105
111
  this._languageModelToolsService = _languageModelToolsService;
106
112
  this._customizationHarnessService = _customizationHarnessService;
107
- this._configurationService = _configurationService;
113
+ this._telemetryService = _telemetryService;
114
+ this._agentPluginService = _agentPluginService;
115
+ this._environmentService = _environmentService;
108
116
  this._agents = this._register(( new DisposableMap()));
109
117
  this._agentCompletionProviders = this._register(( new DisposableMap()));
110
118
  this._agentIdsToCompletionProviders = this._register(( new DisposableMap()));
@@ -118,14 +126,6 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
118
126
  this._activeTasks = ( new Map());
119
127
  this._unresolvedAnchors = ( new Map());
120
128
  this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostChatAgents2));
121
- this._register(this._configurationService.onDidChangeConfiguration(e => {
122
- if (e.affectsConfiguration("chat.customizations.providerApi.enabled")) {
123
- if (!this._configurationService.getValue("chat.customizations.providerApi.enabled")) {
124
- this._customizationProviders.clearAndDisposeAll();
125
- this._customizationProviderEmitters.clearAndDisposeAll();
126
- }
127
- }
128
- }));
129
129
  this._register(this._chatService.onDidDisposeSession(e => {
130
130
  for (const resource of e.sessionResources) {
131
131
  this._proxy.$releaseSession(resource);
@@ -152,17 +152,24 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
152
152
  this._acceptActiveChatSession(this._chatWidgetService.lastFocusedWidget);
153
153
  }));
154
154
  this._acceptActiveChatSession(this._chatWidgetService.lastFocusedWidget);
155
- void this._pushCustomAgents();
156
155
  this._register(this._promptsService.onDidChangeCustomAgents(() => {
157
- void this._pushCustomAgents();
156
+ this._proxy.$onDidChangeCustomAgents();
158
157
  }));
159
- void this._pushInstructions();
160
158
  this._register(this._promptsService.onDidChangeInstructions(() => {
161
- void this._pushInstructions();
159
+ this._proxy.$onDidChangeInstructions();
162
160
  }));
163
- void this._pushSkills();
164
161
  this._register(this._promptsService.onDidChangeSkills(() => {
165
- void this._pushSkills();
162
+ this._proxy.$onDidChangeSkills();
163
+ }));
164
+ this._register(this._promptsService.onDidChangeSlashCommands(() => {
165
+ this._proxy.$onDidChangeSlashCommands();
166
+ }));
167
+ this._register(this._promptsService.onDidChangeHooks(() => {
168
+ this._proxy.$onDidChangeHooks();
169
+ }));
170
+ this._register(autorun(reader => {
171
+ this._agentPluginService.plugins.read(reader);
172
+ this._proxy.$onDidChangePlugins();
166
173
  }));
167
174
  }
168
175
  _acceptActiveChatSession(widget) {
@@ -170,38 +177,105 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
170
177
  const isLocal = sessionResource && getAgentSessionProvider(sessionResource) === AgentSessionProviders.Local;
171
178
  this._proxy.$acceptActiveChatSession(isLocal ? sessionResource : undefined);
172
179
  }
173
- async _pushCustomAgents() {
174
- try {
175
- const customAgents = await this._promptsService.getCustomAgents(CancellationToken.None);
176
- const dtos = ( customAgents.map(agent => ({
177
- uri: agent.uri
178
- })));
179
- this._proxy.$acceptCustomAgents(dtos);
180
- } catch (error) {
181
- this._logService.error("[chat] Failed to push custom agents to extension host", error);
180
+ _toChatResourceSource(storage) {
181
+ switch (storage) {
182
+ case PromptsStorage.local:
183
+ return "local";
184
+ case PromptsStorage.user:
185
+ return "user";
186
+ case PromptsStorage.extension:
187
+ return "extension";
188
+ case PromptsStorage.plugin:
189
+ return "plugin";
182
190
  }
183
191
  }
184
- async _pushInstructions() {
185
- try {
186
- const instructions = await this._promptsService.getInstructionFiles(CancellationToken.None);
187
- const dtos = ( instructions.map(instruction => ({
188
- uri: instruction.uri
189
- })));
190
- this._proxy.$acceptInstructions(dtos);
191
- } catch (error) {
192
- this._logService.error("[chat] Failed to push instructions to extension host", error);
193
- }
192
+ _toCustomAgentDto(agent) {
193
+ return {
194
+ uri: agent.uri,
195
+ name: agent.name,
196
+ description: agent.description,
197
+ source: this._toChatResourceSource(agent.source.storage),
198
+ extensionId: agent.source.storage === PromptsStorage.extension ? agent.source.extensionId.value : undefined,
199
+ pluginUri: agent.source.storage === PromptsStorage.plugin ? agent.source.pluginUri : undefined,
200
+ sessionTypes: agent.sessionTypes,
201
+ argumentHint: agent.argumentHint,
202
+ tools: agent.tools,
203
+ model: agent.model,
204
+ userInvocable: agent.visibility.userInvocable,
205
+ disableModelInvocation: !agent.visibility.agentInvocable
206
+ };
194
207
  }
195
- async _pushSkills() {
196
- try {
197
- const skills = (await this._promptsService.findAgentSkills(CancellationToken.None)) ?? [];
198
- const dtos = ( skills.map(skill => ({
199
- uri: skill.uri
200
- })));
201
- this._proxy.$acceptSkills(dtos);
202
- } catch (error) {
203
- this._logService.error("[chat] Failed to push skills to extension host", error);
204
- }
208
+ _toInstructionDto(instruction) {
209
+ return {
210
+ uri: instruction.uri,
211
+ name: instruction.name,
212
+ description: instruction.description,
213
+ source: this._toChatResourceSource(instruction.storage),
214
+ extensionId: instruction.extension?.identifier.value,
215
+ pluginUri: instruction.pluginUri,
216
+ sessionTypes: instruction.sessionTypes,
217
+ pattern: instruction.pattern
218
+ };
219
+ }
220
+ _toSkillDto(skill) {
221
+ return {
222
+ uri: skill.uri,
223
+ name: skill.name,
224
+ description: skill.description,
225
+ source: this._toChatResourceSource(skill.storage),
226
+ extensionId: skill.extension?.identifier.value,
227
+ pluginUri: skill.pluginUri,
228
+ sessionTypes: skill.sessionTypes,
229
+ userInvocable: skill.userInvocable
230
+ };
231
+ }
232
+ _toSlashCommandDto(slashCommand) {
233
+ return {
234
+ uri: slashCommand.uri,
235
+ name: slashCommand.name,
236
+ description: slashCommand.description,
237
+ source: this._toChatResourceSource(slashCommand.storage),
238
+ extensionId: slashCommand.extension?.identifier.value,
239
+ pluginUri: slashCommand.pluginUri,
240
+ sessionTypes: slashCommand.sessionTypes,
241
+ argumentHint: slashCommand.argumentHint,
242
+ userInvocable: slashCommand.userInvocable
243
+ };
244
+ }
245
+ _toHookDto(hookFile) {
246
+ return {
247
+ uri: hookFile.uri,
248
+ sessionTypes: hookFile.sessionTypes
249
+ };
250
+ }
251
+ _toPluginDto(plugin) {
252
+ return {
253
+ uri: plugin.uri
254
+ };
255
+ }
256
+ async $provideCustomAgents(token) {
257
+ const customAgents = await this._promptsService.getCustomAgents(token);
258
+ return ( customAgents.map(agent => this._toCustomAgentDto(agent)));
259
+ }
260
+ async $provideInstructions(token) {
261
+ const instructions = await this._promptsService.getInstructionFiles(token);
262
+ return ( instructions.map(instruction => this._toInstructionDto(instruction)));
263
+ }
264
+ async $provideSkills(token) {
265
+ const skills = (await this._promptsService.findAgentSkills(token)) ?? [];
266
+ return ( skills.map(skill => this._toSkillDto(skill)));
267
+ }
268
+ async $provideSlashCommands(token) {
269
+ const slashCommands = await this._promptsService.getPromptSlashCommands(token);
270
+ return ( slashCommands.map(slashCommand => this._toSlashCommandDto(slashCommand)));
271
+ }
272
+ async $provideHooks(token) {
273
+ const hookFiles = await this._promptsService.listPromptFiles(PromptsType.hook, token);
274
+ return ( hookFiles.map(hookFile => this._toHookDto(hookFile)));
275
+ }
276
+ async $providePlugins(_token) {
277
+ const plugins = this._agentPluginService.plugins.get();
278
+ return ( plugins.map(plugin => this._toPluginDto(plugin)));
205
279
  }
206
280
  $unregisterAgent(handle) {
207
281
  this._agents.deleteAndDispose(handle);
@@ -235,21 +309,34 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
235
309
  chatSession
236
310
  });
237
311
  try {
238
- const contributedSession = chatSession?.contributedChatSession;
239
- let chatSessionContext;
240
- if (contributedSession) {
241
- const chatSessionResource = contributedSession.chatSessionResource;
242
- const isUntitled = isUntitledChatSession(chatSessionResource);
243
- chatSessionContext = {
244
- chatSessionResource,
245
- isUntitled,
246
- initialSessionOptions: ChatSessionOptionsMap.toStrValueArray(contributedSession.initialSessionOptions)
247
- };
248
- }
249
- return (await this._proxy.$invokeAgent(handle, request, {
312
+ const chatSessionResource = request.sessionResource;
313
+ const chatSessionContext = {
314
+ chatSessionResource,
315
+ isUntitled: isUntitledChatSession(chatSessionResource),
316
+ initialSessionOptions: ChatSessionOptionsMap.toStrValueArray(this._chatSessionService.getSessionOptions(chatSessionResource))
317
+ };
318
+ const rpcResult = await this._proxy.$invokeAgent(handle, request, {
250
319
  history,
251
320
  chatSessionContext
252
- }, token)) ?? {};
321
+ }, token);
322
+ if (rpcResult?.errorCallstack) {
323
+ this._telemetryService.publicLogError2("chatAgentError", {
324
+ callstack: rpcResult.errorCallstack,
325
+ msg: rpcResult.errorDetails?.message ?? "",
326
+ errorName: rpcResult.errorName ?? "",
327
+ agent: id,
328
+ agentExtensionId: extension.value
329
+ });
330
+ }
331
+ if (rpcResult) {
332
+ const {
333
+ errorCallstack: _,
334
+ errorName: _2,
335
+ ...result
336
+ } = rpcResult;
337
+ return result;
338
+ }
339
+ return {};
253
340
  } finally {
254
341
  this._pendingProgress.delete(request.requestId);
255
342
  }
@@ -567,10 +654,7 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
567
654
  }
568
655
  }
569
656
  async $registerChatSessionCustomizationProvider(handle, chatSessionType, metadata, extensionId) {
570
- if (!this._configurationService.getValue("chat.customizations.providerApi.enabled")) {
571
- this._logService.trace(
572
- `[MainThreadChatAgents2] Customization provider API is disabled, ignoring registration from ${extensionId.value}`
573
- );
657
+ if (this._environmentService.isSessionsWindow && chatSessionType !== "copilotcli") {
574
658
  return;
575
659
  }
576
660
  const extension = await this._extensionService.getExtension(extensionId.value);
@@ -600,22 +684,25 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
600
684
  })));
601
685
  }
602
686
  };
603
- const hiddenSections = metadata.unsupportedTypes?.map(type => {
604
- switch (type) {
605
- case "agent":
606
- return AICustomizationManagementSection.Agents;
607
- case "skill":
608
- return AICustomizationManagementSection.Skills;
609
- case "instructions":
610
- return AICustomizationManagementSection.Instructions;
611
- case "prompt":
612
- return AICustomizationManagementSection.Prompts;
613
- case "hook":
614
- return AICustomizationManagementSection.Hooks;
615
- default:
616
- return type;
687
+ const typeToSection = {
688
+ "agent": AICustomizationManagementSection.Agents,
689
+ "skill": AICustomizationManagementSection.Skills,
690
+ "instructions": AICustomizationManagementSection.Instructions,
691
+ "prompt": AICustomizationManagementSection.Prompts,
692
+ "hook": AICustomizationManagementSection.Hooks,
693
+ "plugins": AICustomizationManagementSection.Plugins
694
+ };
695
+ let hiddenSections;
696
+ if (metadata.supportedTypes) {
697
+ const supportedSections = ( new Set());
698
+ for (const t of metadata.supportedTypes) {
699
+ const section = typeToSection[t];
700
+ if (section) {
701
+ supportedSections.add(section);
702
+ }
617
703
  }
618
- });
704
+ hiddenSections = ( Object.values(typeToSection)).filter(section => !( supportedSections.has(section)));
705
+ }
619
706
  const descriptor = {
620
707
  id: chatSessionType,
621
708
  label: metadata.label,
@@ -626,7 +713,8 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
626
713
  PromptsStorage.local,
627
714
  PromptsStorage.user,
628
715
  PromptsStorage.plugin,
629
- PromptsStorage.extension
716
+ PromptsStorage.extension,
717
+ BUILTIN_STORAGE
630
718
  ]
631
719
  }),
632
720
  itemProvider
@@ -645,7 +733,7 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
645
733
  }
646
734
  }
647
735
  };
648
- MainThreadChatAgents2 = __decorate([extHostNamedCustomer(MainContext.MainThreadChatAgents2), ( __param(1, IChatAgentService)), ( __param(2, IChatSessionsService)), ( __param(3, IChatService)), ( __param(4, ILanguageFeaturesService)), ( __param(5, IChatWidgetService)), ( __param(6, IInstantiationService)), ( __param(7, ILogService)), ( __param(8, IExtensionService)), ( __param(9, IUriIdentityService)), ( __param(10, IPromptsService)), ( __param(11, ILanguageModelToolsService)), ( __param(12, ICustomizationHarnessService)), ( __param(13, IConfigurationService))], MainThreadChatAgents2);
736
+ MainThreadChatAgents2 = __decorate([extHostNamedCustomer(MainContext.MainThreadChatAgents2), ( __param(1, IChatAgentService)), ( __param(2, IChatSessionsService)), ( __param(3, IChatService)), ( __param(4, ILanguageFeaturesService)), ( __param(5, IChatWidgetService)), ( __param(6, IInstantiationService)), ( __param(7, ILogService)), ( __param(8, IExtensionService)), ( __param(9, IUriIdentityService)), ( __param(10, IPromptsService)), ( __param(11, ILanguageModelToolsService)), ( __param(12, ICustomizationHarnessService)), ( __param(13, ITelemetryService)), ( __param(14, IAgentPluginService)), ( __param(15, IWorkbenchEnvironmentService))], MainThreadChatAgents2);
649
737
  function computeCompletionRanges(model, position, reg) {
650
738
  const varWord = getWordAtText(position.column, reg, model.getLineContent(position.lineNumber), 0);
651
739
  if (!varWord && model.getWordUntilPosition(position).word) {
@@ -60,6 +60,13 @@ let MainThreadChatDebug = class MainThreadChatDebug extends Disposable {
60
60
  return uri;
61
61
  }
62
62
  }));
63
+ this._chatDebugService.registerAvailableSessionsFetcher(async token => {
64
+ const entries = await this._proxy.$getAvailableDebugSessionResources(handle, token);
65
+ return ( entries.map(e => ({
66
+ uri: URI.revive(e.uri),
67
+ title: e.title
68
+ })));
69
+ });
63
70
  }
64
71
  $unregisterChatDebugLogProvider(handle) {
65
72
  const disposables = this._providerDisposables.get(handle);
@@ -10,7 +10,7 @@ import { IChatWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/workb
10
10
  import { IChatDebugService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatDebugService.service";
11
11
  import { IChatContentInlineReference, IChatProgress } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService";
12
12
  import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service";
13
- import { IChatSession, IChatSessionHistoryItem, IChatSessionItem, IChatSessionProviderOptionItem, IChatSessionRequestHistoryItem, ReadonlyChatSessionOptionsMap } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService";
13
+ import { IChatSession, IChatSessionHistoryItem, IChatSessionItem, IChatSessionProviderOptionGroup, IChatSessionProviderOptionItem, IChatSessionRequestHistoryItem, ReadonlyChatSessionOptionsMap } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService";
14
14
  import { IChatSessionsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service";
15
15
  import { IChatAgentRequest } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/participants/chatAgents";
16
16
  import { IChatArtifactsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/chatArtifactsService.service";
@@ -85,6 +85,8 @@ export declare class MainThreadChatSessions extends Disposable implements MainTh
85
85
  constructor(_extHostContext: IExtHostContext, _agentSessionsService: IAgentSessionsService, _chatSessionsService: IChatSessionsService, _chatService: IChatService, _chatWidgetService: IChatWidgetService, _chatTodoListService: IChatTodoListService, _chatArtifactsService: IChatArtifactsService, _chatDebugService: IChatDebugService, _dialogService: IDialogService, _editorService: IEditorService, editorGroupService: IEditorGroupsService, _logService: ILogService, _instantiationService: IInstantiationService);
86
86
  private _getHandleForSessionType;
87
87
  $registerChatSessionItemController(handle: number, chatSessionType: string): void;
88
+ private _refreshControllerInputState;
89
+ private _applyOptionGroups;
88
90
  private getController;
89
91
  $updateChatSessionItems(controllerHandle: number, change: IChatSessionItemsChange): Promise<void>;
90
92
  $addOrUpdateChatSessionItem(controllerHandle: number, item: Dto<IChatSessionItem>): Promise<void>;
@@ -105,6 +107,7 @@ export declare class MainThreadChatSessions extends Disposable implements MainTh
105
107
  $handleProgressComplete(handle: number, sessionResource: UriComponents, requestId: string): void;
106
108
  $handleAnchorResolve(handle: number, sesssionResource: UriComponents, requestId: string, requestHandle: string, anchor: Dto<IChatContentInlineReference>): void;
107
109
  $onDidChangeChatSessionProviderOptions(handle: number): void;
110
+ $updateChatSessionInputState(controllerHandle: number, sessionResource: UriComponents, optionGroups: readonly IChatSessionProviderOptionGroup[]): void;
108
111
  private _refreshProviderOptions;
109
112
  dispose(): void;
110
113
  /**
@@ -135,7 +135,7 @@ class ObservableChatSession extends Disposable {
135
135
  return confirmInterrupt();
136
136
  }
137
137
  return this._dialogService.confirm({
138
- message: ( localize(2554, "Are you sure you want to interrupt the active session?"))
138
+ message: ( localize(2549, "Are you sure you want to interrupt the active session?"))
139
139
  }).then(confirmed => {
140
140
  if (confirmed.confirmed) {
141
141
  return confirmInterrupt();
@@ -382,6 +382,13 @@ let MainThreadChatSessionItemController = class MainThreadChatSessionItemControl
382
382
  this.addOrUpdateItem(existing);
383
383
  }
384
384
  }
385
+ async getNewChatSessionInputState(sessionResource, token) {
386
+ const optionGroups = await this._proxy.$provideChatSessionInputState(this._handle, sessionResource, token);
387
+ if (!optionGroups?.length) {
388
+ return undefined;
389
+ }
390
+ return optionGroups;
391
+ }
385
392
  };
386
393
  MainThreadChatSessionItemController = ( __decorate([( __param(3, IChatService)), ( __param(4, ILogService))], MainThreadChatSessionItemController));
387
394
  class MainThreadChatSessionItem {
@@ -496,6 +503,27 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
496
503
  controller,
497
504
  dispose: () => disposables.dispose()
498
505
  });
506
+ this._refreshControllerInputState(handle, chatSessionType);
507
+ }
508
+ _refreshControllerInputState(handle, chatSessionType) {
509
+ this._proxy.$provideChatSessionInputState(handle, undefined, CancellationToken.None).then(optionGroups => {
510
+ if (optionGroups?.length) {
511
+ this._applyOptionGroups(handle, chatSessionType, undefined, optionGroups);
512
+ }
513
+ }).catch(
514
+ err => this._logService.error("Error fetching chat session input state", err)
515
+ );
516
+ }
517
+ _applyOptionGroups(handle, chatSessionType, sessionResourceComponents, optionGroups) {
518
+ this._chatSessionsService.setOptionGroupsForSessionType(chatSessionType, handle, optionGroups);
519
+ if (sessionResourceComponents) {
520
+ const sessionResource = URI.revive(sessionResourceComponents);
521
+ optionGroups.forEach(group => {
522
+ if (group.selected) {
523
+ this._chatSessionsService.setSessionOption(sessionResource, group.id, group.selected);
524
+ }
525
+ });
526
+ }
499
527
  }
500
528
  getController(handle) {
501
529
  const registration = this._itemControllerRegistrations.get(handle);
@@ -547,7 +575,7 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
547
575
  const options = {
548
576
  title: {
549
577
  preferred: originalEditor?.getName() || undefined,
550
- fallback: ( localize(2555, "{0}", contribution?.displayName))
578
+ fallback: ( localize(2550, "{0}", contribution?.displayName))
551
579
  }
552
580
  };
553
581
  const newSession = await this._chatSessionsService.getOrCreateChatSession(URI.revive(modifiedResource), CancellationToken.None);
@@ -710,22 +738,25 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
710
738
  }
711
739
  this._refreshProviderOptions(handle, sessionType);
712
740
  }
741
+ $updateChatSessionInputState(controllerHandle, sessionResource, optionGroups) {
742
+ const registration = this._itemControllerRegistrations.get(controllerHandle);
743
+ if (!registration) {
744
+ this._logService.warn(
745
+ `No controller found for handle ${controllerHandle} when updating input state`
746
+ );
747
+ return;
748
+ }
749
+ this._applyOptionGroups(
750
+ controllerHandle,
751
+ registration.chatSessionType,
752
+ sessionResource,
753
+ optionGroups
754
+ );
755
+ }
713
756
  _refreshProviderOptions(handle, chatSessionScheme) {
714
757
  this._proxy.$provideChatSessionProviderOptions(handle, CancellationToken.None).then(options => {
715
758
  if (options?.optionGroups && options.optionGroups.length) {
716
- const groupsWithCallbacks = ( options.optionGroups.map(group => ({
717
- ...group,
718
- onSearch: group.searchable ? async (query, token) => {
719
- return await this._proxy.$invokeOptionGroupSearch(handle, group.id, query, token);
720
- } : undefined
721
- })));
722
- this._chatSessionsService.setOptionGroupsForSessionType(chatSessionScheme, handle, groupsWithCallbacks);
723
- }
724
- if (options?.newSessionOptions) {
725
- this._chatSessionsService.setNewSessionOptionsForSessionType(
726
- chatSessionScheme,
727
- ChatSessionOptionsMap.fromRecord(options.newSessionOptions)
728
- );
759
+ this._chatSessionsService.setOptionGroupsForSessionType(chatSessionScheme, handle, [...options.optionGroups]);
729
760
  }
730
761
  }).catch(err => this._logService.error("Error fetching chat session options", err));
731
762
  }
@@ -456,7 +456,7 @@ class MainThreadCommentController extends Disposable {
456
456
  };
457
457
  }
458
458
  }
459
- const commentsViewIcon = registerIcon("comments-view-icon", Codicon.commentDiscussion, ( localize(2556, "View icon of the comments view.")));
459
+ const commentsViewIcon = registerIcon("comments-view-icon", Codicon.commentDiscussion, ( localize(2551, "View icon of the comments view.")));
460
460
  let MainThreadComments = class MainThreadComments extends Disposable {
461
461
  constructor(
462
462
  extHostContext,
@@ -405,7 +405,7 @@ let MainThreadCustomEditorModel = MainThreadCustomEditorModel_1 = class MainThre
405
405
  this._register(workingCopyService.registerWorkingCopy(this));
406
406
  this._register(extensionService.onWillStop(e => {
407
407
  e.veto(true, ( localize(
408
- 2557,
408
+ 2552,
409
409
  "An extension provided editor for '{0}' is still open that would close otherwise.",
410
410
  this.name
411
411
  )));
@@ -473,7 +473,7 @@ let MainThreadCustomEditorModel = MainThreadCustomEditorModel_1 = class MainThre
473
473
  this._undoService.pushElement({
474
474
  type: UndoRedoElementType.Resource,
475
475
  resource: this._editorResource,
476
- label: label ?? ( localize(2558, "Edit")),
476
+ label: label ?? ( localize(2553, "Edit")),
477
477
  code: "undoredo.customEditorEdit",
478
478
  undo: () => this.undo(),
479
479
  redo: () => this.redo()
@@ -14,7 +14,7 @@ class ExtHostEditSessionIdentityCreateParticipant {
14
14
  }
15
15
  async participate(workspaceFolder, token) {
16
16
  const p = ( new Promise((resolve, reject) => {
17
- setTimeout(() => reject(( new Error(( localize(2559, "Aborted onWillCreateEditSessionIdentity-event after 10000ms"))))), this.timeout);
17
+ setTimeout(() => reject(( new Error(( localize(2554, "Aborted onWillCreateEditSessionIdentity-event after 10000ms"))))), this.timeout);
18
18
  this._proxy.$onWillCreateEditSessionIdentity(workspaceFolder.uri, token, this.timeout).then(resolve, reject);
19
19
  }));
20
20
  return raceCancellationError(p, token);
@@ -111,7 +111,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
111
111
  this._notificationService.notify({
112
112
  severity: Severity.Error,
113
113
  message: ( localize(
114
- 2560,
114
+ 2555,
115
115
  "Cannot activate the '{0}' extension because it depends on the '{1}' extension, which is not loaded. Would you like to reload the window to load the extension?",
116
116
  extName,
117
117
  missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
@@ -119,7 +119,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
119
119
  actions: {
120
120
  primary: [toAction({
121
121
  id: "reload",
122
- label: ( localize(2561, "Reload Window")),
122
+ label: ( localize(2556, "Reload Window")),
123
123
  run: () => this._hostService.reload()
124
124
  })]
125
125
  }
@@ -130,7 +130,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
130
130
  this._notificationService.notify({
131
131
  severity: Severity.Error,
132
132
  message: ( localize(
133
- 2562,
133
+ 2557,
134
134
  "Cannot activate the '{0}' extension because it depends on the '{1}' extension which is not supported in the current workspace",
135
135
  extName,
136
136
  missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
@@ -140,7 +140,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
140
140
  this._notificationService.notify({
141
141
  severity: Severity.Error,
142
142
  message: ( localize(
143
- 2563,
143
+ 2558,
144
144
  "Cannot activate the '{0}' extension because it depends on the '{1}' extension which is not supported in Restricted Mode",
145
145
  extName,
146
146
  missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
@@ -148,7 +148,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
148
148
  actions: {
149
149
  primary: [toAction({
150
150
  id: "manageWorkspaceTrust",
151
- label: ( localize(2564, "Manage Workspace Trust")),
151
+ label: ( localize(2559, "Manage Workspace Trust")),
152
152
  run: () => this._commandService.executeCommand("workbench.trust.manage")
153
153
  })]
154
154
  }
@@ -157,7 +157,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
157
157
  this._notificationService.notify({
158
158
  severity: Severity.Error,
159
159
  message: ( localize(
160
- 2565,
160
+ 2560,
161
161
  "Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled. Would you like to enable the extension and reload the window?",
162
162
  extName,
163
163
  missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
@@ -165,7 +165,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
165
165
  actions: {
166
166
  primary: [toAction({
167
167
  id: "enable",
168
- label: ( localize(2566, "Enable and Reload")),
168
+ label: ( localize(2561, "Enable and Reload")),
169
169
  enabled: true,
170
170
  run: () => this._extensionEnablementService.setEnablement(
171
171
  [missingInstalledDependency],
@@ -178,7 +178,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
178
178
  this._notificationService.notify({
179
179
  severity: Severity.Error,
180
180
  message: ( localize(
181
- 2567,
181
+ 2562,
182
182
  "Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled.",
183
183
  extName,
184
184
  missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
@@ -199,7 +199,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
199
199
  this._notificationService.notify({
200
200
  severity: Severity.Error,
201
201
  message: ( localize(
202
- 2568,
202
+ 2563,
203
203
  "Cannot activate the '{0}' extension because it depends on the '{1}' extension from '{2}', which is not installed. Would you like to install the extension and reload the window?",
204
204
  extName,
205
205
  dependencyExtension.displayName,
@@ -208,14 +208,14 @@ let MainThreadExtensionService = class MainThreadExtensionService {
208
208
  actions: {
209
209
  primary: [toAction({
210
210
  id: "install",
211
- label: ( localize(2569, "Install and Reload")),
211
+ label: ( localize(2564, "Install and Reload")),
212
212
  run: () => this._extensionsWorkbenchService.install(dependencyExtension).then(() => this._hostService.reload(), e => this._notificationService.error(e))
213
213
  })]
214
214
  }
215
215
  });
216
216
  } else {
217
217
  this._notificationService.error(( localize(
218
- 2570,
218
+ 2565,
219
219
  "Cannot activate the '{0}' extension because it depends on an unknown '{1}' extension.",
220
220
  extName,
221
221
  missingDependency