@codingame/monaco-vscode-mcp-service-override 26.2.2 → 28.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 (66) hide show
  1. package/index.js +8 -2
  2. package/package.json +2 -2
  3. package/vscode/src/vs/base/common/jsonRpcProtocol.d.ts +66 -0
  4. package/vscode/src/vs/base/common/jsonRpcProtocol.js +216 -0
  5. package/vscode/src/vs/platform/mcp/common/allowedMcpServersService.js +1 -1
  6. package/vscode/src/vs/platform/mcp/common/mcpGalleryService.js +2 -2
  7. package/vscode/src/vs/platform/mcp/common/mcpGateway.d.ts +39 -0
  8. package/vscode/src/vs/platform/mcp/common/mcpGateway.js +6 -0
  9. package/vscode/src/vs/platform/mcp/common/mcpResourceScannerService.d.ts +3 -1
  10. package/vscode/src/vs/platform/mcp/common/mcpResourceScannerService.js +12 -5
  11. package/vscode/src/vs/workbench/contrib/mcp/browser/mcp.contribution.js +15 -5
  12. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpAddContextContribution.js +2 -2
  13. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommands.js +58 -58
  14. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.js +27 -28
  15. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpGatewayService.d.ts +20 -0
  16. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpGatewayService.js +51 -0
  17. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpGatewayToolBrokerContribution.d.ts +7 -0
  18. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpGatewayToolBrokerContribution.js +16 -0
  19. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.js +18 -18
  20. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpMigration.js +4 -4
  21. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpResourceQuickAccess.js +8 -8
  22. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.d.ts +4 -1
  23. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.js +42 -24
  24. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.d.ts +1 -1
  25. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js +13 -12
  26. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/extensionMcpDiscovery.js +4 -4
  27. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/installedMcpServersDiscovery.js +3 -1
  28. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.js +1 -1
  29. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAdapters.js +2 -1
  30. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/pluginMcpDiscovery.d.ts +15 -0
  31. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/pluginMcpDiscovery.js +106 -0
  32. package/vscode/src/vs/workbench/contrib/mcp/common/mcpContextKeys.js +4 -4
  33. package/vscode/src/vs/workbench/contrib/mcp/common/mcpGatewayToolBrokerChannel.d.ts +39 -0
  34. package/vscode/src/vs/workbench/contrib/mcp/common/mcpGatewayToolBrokerChannel.js +302 -0
  35. package/vscode/src/vs/workbench/contrib/mcp/common/mcpLanguageModelToolContribution.js +25 -17
  36. package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.d.ts +3 -1
  37. package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js +27 -18
  38. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingLog.js +1 -1
  39. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.d.ts +1 -0
  40. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.js +28 -18
  41. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSandboxService.d.ts +47 -0
  42. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSandboxService.js +385 -0
  43. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.d.ts +6 -1
  44. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.js +61 -3
  45. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerRequestHandler.d.ts +4 -20
  46. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerRequestHandler.js +95 -145
  47. package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.js +9 -9
  48. package/vscode/src/vs/workbench/services/mcp/browser/mcpWorkbenchManagementService.d.ts +1 -1
  49. package/vscode/src/vs/workbench/services/mcp/browser/mcpWorkbenchManagementService.js +2 -2
  50. package/vscode/src/vs/platform/mcp/common/mcpManagementIpc.d.ts +0 -42
  51. package/vscode/src/vs/platform/mcp/common/mcpManagementIpc.js +0 -105
  52. package/vscode/src/vs/platform/mcp/common/mcpManagementService.d.ts +0 -130
  53. package/vscode/src/vs/platform/mcp/common/mcpManagementService.js +0 -665
  54. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.d.ts +0 -259
  55. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.js +0 -1225
  56. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.d.ts +0 -72
  57. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.js +0 -996
  58. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.d.ts +0 -17
  59. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.js +0 -49
  60. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerIcons.d.ts +0 -5
  61. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerIcons.js +0 -12
  62. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.d.ts +0 -88
  63. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.js +0 -464
  64. package/vscode/src/vs/workbench/contrib/mcp/browser/media/mcpServerEditor.css +0 -94
  65. package/vscode/src/vs/workbench/services/mcp/common/mcpWorkbenchManagementService.d.ts +0 -87
  66. package/vscode/src/vs/workbench/services/mcp/common/mcpWorkbenchManagementService.js +0 -702
@@ -78,7 +78,7 @@ class ListMcpServerCommand extends Action2 {
78
78
  constructor() {
79
79
  super({
80
80
  id: McpCommandIds.ListServer,
81
- title: ( localize2(9218, "List Servers")),
81
+ title: ( localize2(10099, "List Servers")),
82
82
  icon: Codicon.server,
83
83
  category,
84
84
  f1: true,
@@ -99,7 +99,7 @@ class ListMcpServerCommand extends Action2 {
99
99
  const pick = quickInput.createQuickPick({
100
100
  useSeparators: true
101
101
  });
102
- pick.placeholder = ( localize(9219, "Select an MCP Server"));
102
+ pick.placeholder = ( localize(10100, "Select an MCP Server"));
103
103
  mcpService.activateCollections();
104
104
  store.add(pick);
105
105
  store.add(autorun(reader => {
@@ -109,8 +109,8 @@ class ListMcpServerCommand extends Action2 {
109
109
  const firstRun = pick.items.length === 0;
110
110
  pick.items = [{
111
111
  id: "$add",
112
- label: ( localize(9220, "Add Server")),
113
- description: ( localize(9221, "Add a new server configuration")),
112
+ label: ( localize(10101, "Add Server")),
113
+ description: ( localize(10102, "Add a new server configuration")),
114
114
  alwaysShow: true,
115
115
  iconClass: ThemeIcon.asClassName(Codicon.add)
116
116
  }, ...( Object.values(servers)).filter(s => s.length).flatMap(servers => [{
@@ -148,7 +148,7 @@ class McpConfirmationServerOptionsCommand extends Action2 {
148
148
  constructor() {
149
149
  super({
150
150
  id: McpCommandIds.ServerOptionsInConfirmation,
151
- title: ( localize2(9222, "Server Options")),
151
+ title: ( localize2(10103, "Server Options")),
152
152
  category,
153
153
  icon: Codicon.settingsGear,
154
154
  f1: false,
@@ -179,7 +179,7 @@ class McpServerOptionsCommand extends Action2 {
179
179
  constructor() {
180
180
  super({
181
181
  id: McpCommandIds.ServerOptions,
182
- title: ( localize2(9222, "Server Options")),
182
+ title: ( localize2(10103, "Server Options")),
183
183
  category,
184
184
  f1: false
185
185
  });
@@ -203,20 +203,20 @@ class McpServerOptionsCommand extends Action2 {
203
203
  const serverState = server.connectionState.get();
204
204
  items.push({
205
205
  type: "separator",
206
- label: ( localize(9223, "Status"))
206
+ label: ( localize(10104, "Status"))
207
207
  });
208
208
  if (McpConnectionState.canBeStarted(serverState.state)) {
209
209
  items.push({
210
- label: ( localize(9224, "Start Server")),
210
+ label: ( localize(10105, "Start Server")),
211
211
  action: "start"
212
212
  });
213
213
  } else {
214
214
  items.push({
215
- label: ( localize(9225, "Stop Server")),
215
+ label: ( localize(10106, "Stop Server")),
216
216
  action: "stop"
217
217
  });
218
218
  items.push({
219
- label: ( localize(9226, "Restart Server")),
219
+ label: ( localize(10107, "Restart Server")),
220
220
  action: "restart"
221
221
  });
222
222
  }
@@ -224,26 +224,26 @@ class McpServerOptionsCommand extends Action2 {
224
224
  const configTarget = serverDefinition?.presentation?.origin || collection?.presentation?.origin;
225
225
  if (configTarget) {
226
226
  items.push({
227
- label: ( localize(9227, "Show Configuration")),
227
+ label: ( localize(10108, "Show Configuration")),
228
228
  action: "config"
229
229
  });
230
230
  }
231
231
  items.push({
232
- label: ( localize(9228, "Show Output")),
232
+ label: ( localize(10109, "Show Output")),
233
233
  action: "showOutput"
234
234
  });
235
235
  items.push({
236
236
  type: "separator",
237
- label: ( localize(9229, "Sampling"))
237
+ label: ( localize(10110, "Sampling"))
238
238
  }, {
239
- label: ( localize(9230, "Configure Model Access")),
240
- description: ( localize(9231, "Set the models the server can use via MCP sampling")),
239
+ label: ( localize(10111, "Configure Model Access")),
240
+ description: ( localize(10112, "Set the models the server can use via MCP sampling")),
241
241
  action: "configSampling"
242
242
  });
243
243
  if (samplingService.hasLogs(server)) {
244
244
  items.push({
245
- label: ( localize(9232, "Show Sampling Requests")),
246
- description: ( localize(9233, "Show the sampling requests for this server")),
245
+ label: ( localize(10113, "Show Sampling Requests")),
246
+ description: ( localize(10114, "Show the sampling requests for this server")),
247
247
  action: "samplingLog"
248
248
  });
249
249
  }
@@ -251,15 +251,15 @@ class McpServerOptionsCommand extends Action2 {
251
251
  if (capabilities === undefined || (capabilities & McpCapability.Resources)) {
252
252
  items.push({
253
253
  type: "separator",
254
- label: ( localize(9234, "Resources"))
254
+ label: ( localize(10115, "Resources"))
255
255
  });
256
256
  items.push({
257
- label: ( localize(9235, "Browse Resources")),
257
+ label: ( localize(10116, "Browse Resources")),
258
258
  action: "resources"
259
259
  });
260
260
  }
261
261
  const pick = await quickInputService.pick(items, {
262
- placeHolder: ( localize(9236, "Select action for '{0}'", server.definition.label))
262
+ placeHolder: ( localize(10117, "Select action for '{0}'", server.definition.label))
263
263
  });
264
264
  if (!pick) {
265
265
  return;
@@ -307,7 +307,7 @@ class McpServerOptionsCommand extends Action2 {
307
307
  editorService.openEditor({
308
308
  resource: undefined,
309
309
  contents: samplingService.getLogText(server),
310
- label: ( localize(9237, "MCP Sampling: {0}", server.definition.label))
310
+ label: ( localize(10118, "MCP Sampling: {0}", server.definition.label))
311
311
  });
312
312
  break;
313
313
  default:
@@ -324,14 +324,14 @@ class McpServerOptionsCommand extends Action2 {
324
324
  if (accountQuery.entities().getEntityCount().total > 1) {
325
325
  result.push({
326
326
  action: "disconnect",
327
- label: ( localize(9238, "Disconnect Account")),
327
+ label: ( localize(10119, "Disconnect Account")),
328
328
  description: `(${accountName})`,
329
329
  accountQuery
330
330
  });
331
331
  } else {
332
332
  result.push({
333
333
  action: "signout",
334
- label: ( localize(9239, "Sign Out")),
334
+ label: ( localize(10120, "Sign Out")),
335
335
  description: `(${accountName})`,
336
336
  accountQuery
337
337
  });
@@ -506,17 +506,17 @@ let MCPServerActionRendering = class MCPServerActionRendering extends Disposable
506
506
  let markdown;
507
507
  if (state === DisplayedState.NewTools) {
508
508
  markdown = ( new MarkdownString(single ? ( localize(
509
- 9240,
509
+ 10121,
510
510
  "MCP server {0} has been updated and may have new tools available.",
511
511
  names
512
512
  )) : ( localize(
513
- 9241,
513
+ 10122,
514
514
  "MCP servers have been updated and may have new tools available:\n\n{0}",
515
515
  names
516
516
  ))));
517
517
  } else if (state === DisplayedState.Error) {
518
- markdown = ( new MarkdownString(single ? ( localize(9242, "MCP server {0} was unable to start successfully.", names)) : ( localize(
519
- 9243,
518
+ markdown = ( new MarkdownString(single ? ( localize(10123, "MCP server {0} was unable to start successfully.", names)) : ( localize(
519
+ 10124,
520
520
  "Multiple MCP servers were unable to start successfully:\n\n{0}",
521
521
  names
522
522
  ))));
@@ -543,7 +543,7 @@ let MCPServerActionRendering = class MCPServerActionRendering extends Disposable
543
543
  const divider = $("hr.mcp-hover-divider");
544
544
  container.appendChild(divider);
545
545
  const checkboxContainer = $("div.mcp-hover-setting");
546
- const settingLabelStr = ( localize(9244, "Automatically start MCP servers when sending a chat message"));
546
+ const settingLabelStr = ( localize(10125, "Automatically start MCP servers when sending a chat message"));
547
547
  const checkbox = store.add(( new Checkbox(settingLabelStr, config.get() !== McpAutoStartValue.Never, {
548
548
  ...defaultCheckboxStyles
549
549
  })));
@@ -571,11 +571,11 @@ let MCPServerActionRendering = class MCPServerActionRendering extends Disposable
571
571
  } = displayedStateCurrent.get()
572
572
  ) {
573
573
  if (state === DisplayedState.NewTools) {
574
- return localize(9245, "New tools available ({0})", servers.length || 1);
574
+ return localize(10126, "New tools available ({0})", servers.length || 1);
575
575
  } else if (state === DisplayedState.Error) {
576
- return localize(9246, "Error loading {0} tool(s)", servers.length || 1);
576
+ return localize(10127, "Error loading {0} tool(s)", servers.length || 1);
577
577
  } else if (state === DisplayedState.Refreshing) {
578
- return localize(9247, "Discovering tools...");
578
+ return localize(10128, "Discovering tools...");
579
579
  } else {
580
580
  return null;
581
581
  }
@@ -593,7 +593,7 @@ class ResetMcpTrustCommand extends Action2 {
593
593
  constructor() {
594
594
  super({
595
595
  id: McpCommandIds.ResetTrust,
596
- title: ( localize2(9248, "Reset Trust")),
596
+ title: ( localize2(10129, "Reset Trust")),
597
597
  category,
598
598
  f1: true,
599
599
  precondition: ( ContextKeyExpr.and(McpContextKeys.toolsCount.greater(0), ( ChatContextKeys.Setup.hidden.negate())))
@@ -608,7 +608,7 @@ class ResetMcpCachedTools extends Action2 {
608
608
  constructor() {
609
609
  super({
610
610
  id: McpCommandIds.ResetCachedTools,
611
- title: ( localize2(9249, "Reset Cached Tools")),
611
+ title: ( localize2(10130, "Reset Cached Tools")),
612
612
  category,
613
613
  f1: true,
614
614
  precondition: ( ContextKeyExpr.and(McpContextKeys.toolsCount.greater(0), ( ChatContextKeys.Setup.hidden.negate())))
@@ -623,9 +623,9 @@ class AddConfigurationAction extends Action2 {
623
623
  constructor() {
624
624
  super({
625
625
  id: McpCommandIds.AddConfiguration,
626
- title: ( localize2(9250, "Add Server...")),
626
+ title: ( localize2(10131, "Add Server...")),
627
627
  metadata: {
628
- description: ( localize2(9251, "Installs a new Model Context protocol to the mcp.json settings"))
628
+ description: ( localize2(10132, "Installs a new Model Context protocol to the mcp.json settings"))
629
629
  },
630
630
  category,
631
631
  f1: true,
@@ -647,9 +647,9 @@ class InstallFromManifestAction extends Action2 {
647
647
  constructor() {
648
648
  super({
649
649
  id: McpCommandIds.InstallFromManifest,
650
- title: ( localize2(9252, "Install Server from Manifest...")),
650
+ title: ( localize2(10133, "Install Server from Manifest...")),
651
651
  metadata: {
652
- description: ( localize2(9253, "Install an MCP server from a JSON manifest file"))
652
+ description: ( localize2(10134, "Install an MCP server from a JSON manifest file"))
653
653
  },
654
654
  category,
655
655
  f1: true,
@@ -665,7 +665,7 @@ class RemoveStoredInput extends Action2 {
665
665
  constructor() {
666
666
  super({
667
667
  id: McpCommandIds.RemoveStoredInput,
668
- title: ( localize2(9249, "Reset Cached Tools")),
668
+ title: ( localize2(10130, "Reset Cached Tools")),
669
669
  category,
670
670
  f1: false
671
671
  });
@@ -678,7 +678,7 @@ class EditStoredInput extends Action2 {
678
678
  constructor() {
679
679
  super({
680
680
  id: McpCommandIds.EditStoredInput,
681
- title: ( localize2(9254, "Edit Stored Input")),
681
+ title: ( localize2(10135, "Edit Stored Input")),
682
682
  category,
683
683
  f1: false
684
684
  });
@@ -692,7 +692,7 @@ class ShowConfiguration extends Action2 {
692
692
  constructor() {
693
693
  super({
694
694
  id: McpCommandIds.ShowConfiguration,
695
- title: ( localize2(9255, "Show Configuration")),
695
+ title: ( localize2(10136, "Show Configuration")),
696
696
  category,
697
697
  f1: false
698
698
  });
@@ -722,7 +722,7 @@ class ShowOutput extends Action2 {
722
722
  constructor() {
723
723
  super({
724
724
  id: McpCommandIds.ShowOutput,
725
- title: ( localize2(9256, "Show Output")),
725
+ title: ( localize2(10137, "Show Output")),
726
726
  category,
727
727
  f1: false
728
728
  });
@@ -735,7 +735,7 @@ class RestartServer extends Action2 {
735
735
  constructor() {
736
736
  super({
737
737
  id: McpCommandIds.RestartServer,
738
- title: ( localize2(9257, "Restart Server")),
738
+ title: ( localize2(10138, "Restart Server")),
739
739
  category,
740
740
  f1: false
741
741
  });
@@ -754,7 +754,7 @@ class StartServer extends Action2 {
754
754
  constructor() {
755
755
  super({
756
756
  id: McpCommandIds.StartServer,
757
- title: ( localize2(9258, "Start Server")),
757
+ title: ( localize2(10139, "Start Server")),
758
758
  category,
759
759
  f1: false
760
760
  });
@@ -779,7 +779,7 @@ class StopServer extends Action2 {
779
779
  constructor() {
780
780
  super({
781
781
  id: McpCommandIds.StopServer,
782
- title: ( localize2(9259, "Stop Server")),
782
+ title: ( localize2(10140, "Stop Server")),
783
783
  category,
784
784
  f1: false
785
785
  });
@@ -793,8 +793,8 @@ class McpBrowseCommand extends Action2 {
793
793
  constructor() {
794
794
  super({
795
795
  id: McpCommandIds.Browse,
796
- title: ( localize2(9260, "MCP Servers")),
797
- tooltip: ( localize2(9261, "Browse MCP Servers")),
796
+ title: ( localize2(10141, "MCP Servers")),
797
+ tooltip: ( localize2(10142, "Browse MCP Servers")),
798
798
  category,
799
799
  icon: Codicon.search,
800
800
  precondition: ( ChatContextKeys.Setup.hidden.negate()),
@@ -817,7 +817,7 @@ class McpBrowseCommand extends Action2 {
817
817
  MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
818
818
  command: {
819
819
  id: McpCommandIds.Browse,
820
- title: ( localize2(9262, "Browse MCP Servers")),
820
+ title: ( localize2(10143, "Browse MCP Servers")),
821
821
  category,
822
822
  precondition: ( ChatContextKeys.Setup.hidden.negate())
823
823
  }
@@ -826,7 +826,7 @@ class ShowInstalledMcpServersCommand extends Action2 {
826
826
  constructor() {
827
827
  super({
828
828
  id: McpCommandIds.ShowInstalled,
829
- title: ( localize2(9263, "Show Installed Servers")),
829
+ title: ( localize2(10144, "Show Installed Servers")),
830
830
  category,
831
831
  precondition: ( ContextKeyExpr.and(HasInstalledMcpServersContext, ( ChatContextKeys.Setup.hidden.negate()))),
832
832
  f1: true
@@ -844,7 +844,7 @@ class ShowInstalledMcpServersCommand extends Action2 {
844
844
  MenuRegistry.appendMenuItem(CHAT_CONFIG_MENU_ID, {
845
845
  command: {
846
846
  id: McpCommandIds.ShowInstalled,
847
- title: ( localize2(9264, "MCP Servers"))
847
+ title: ( localize2(10145, "MCP Servers"))
848
848
  },
849
849
  when: ( ContextKeyExpr.and(ChatContextKeys.enabled, ( ContextKeyExpr.equals("view", ChatViewId)))),
850
850
  order: 10,
@@ -869,7 +869,7 @@ class OpenUserMcpResourceCommand extends OpenMcpResourceCommand {
869
869
  constructor() {
870
870
  super({
871
871
  id: McpCommandIds.OpenUserMcp,
872
- title: ( localize2(9265, "Open User Configuration")),
872
+ title: ( localize2(10146, "Open User Configuration")),
873
873
  category,
874
874
  f1: true,
875
875
  precondition: ( ChatContextKeys.Setup.hidden.negate())
@@ -884,7 +884,7 @@ class OpenRemoteUserMcpResourceCommand extends OpenMcpResourceCommand {
884
884
  constructor() {
885
885
  super({
886
886
  id: McpCommandIds.OpenRemoteUserMcp,
887
- title: ( localize2(9266, "Open Remote User Configuration")),
887
+ title: ( localize2(10147, "Open Remote User Configuration")),
888
888
  category,
889
889
  f1: true,
890
890
  precondition: ( ContextKeyExpr.and(( ChatContextKeys.Setup.hidden.negate()), ( RemoteNameContext.notEqualsTo(""))))
@@ -901,7 +901,7 @@ class OpenWorkspaceFolderMcpResourceCommand extends Action2 {
901
901
  constructor() {
902
902
  super({
903
903
  id: McpCommandIds.OpenWorkspaceFolderMcp,
904
- title: ( localize2(9267, "Open Workspace Folder MCP Configuration")),
904
+ title: ( localize2(10148, "Open Workspace Folder MCP Configuration")),
905
905
  category,
906
906
  f1: true,
907
907
  precondition: ( ContextKeyExpr.and(( ChatContextKeys.Setup.hidden.negate()), ( WorkspaceFolderCountContext.notEqualsTo(0))))
@@ -924,7 +924,7 @@ class OpenWorkspaceMcpResourceCommand extends Action2 {
924
924
  constructor() {
925
925
  super({
926
926
  id: McpCommandIds.OpenWorkspaceMcp,
927
- title: ( localize2(9268, "Open Workspace MCP Configuration")),
927
+ title: ( localize2(10149, "Open Workspace MCP Configuration")),
928
928
  category,
929
929
  f1: true,
930
930
  precondition: ( ContextKeyExpr.and(( ChatContextKeys.Setup.hidden.negate()), ( WorkbenchStateContext.isEqualTo("workspace"))))
@@ -945,7 +945,7 @@ class McpBrowseResourcesCommand extends Action2 {
945
945
  constructor() {
946
946
  super({
947
947
  id: McpCommandIds.BrowseResources,
948
- title: ( localize2(9269, "Browse Resources...")),
948
+ title: ( localize2(10150, "Browse Resources...")),
949
949
  category,
950
950
  precondition: ( ContextKeyExpr.and(McpContextKeys.serverCount.greater(0), ( ChatContextKeys.Setup.hidden.negate()))),
951
951
  f1: true
@@ -963,7 +963,7 @@ class McpConfigureSamplingModels extends Action2 {
963
963
  constructor() {
964
964
  super({
965
965
  id: McpCommandIds.ConfigureSamplingModels,
966
- title: ( localize2(9270, "Configure SamplingModel")),
966
+ title: ( localize2(10151, "Configure SamplingModel")),
967
967
  category
968
968
  });
969
969
  }
@@ -989,7 +989,7 @@ class McpConfigureSamplingModels extends Action2 {
989
989
  );
990
990
  const picked = await quickInputService.pick(allItems, {
991
991
  placeHolder: ( localize(
992
- 9271,
992
+ 10152,
993
993
  "Pick the models {0} can access via MCP sampling",
994
994
  server.definition.label
995
995
  )),
@@ -1005,7 +1005,7 @@ class McpStartPromptingServerCommand extends Action2 {
1005
1005
  constructor() {
1006
1006
  super({
1007
1007
  id: McpCommandIds.StartPromptForServer,
1008
- title: ( localize2(9272, "Start Prompting Server")),
1008
+ title: ( localize2(10153, "Start Prompting Server")),
1009
1009
  category,
1010
1010
  f1: false
1011
1011
  });
@@ -1035,7 +1035,7 @@ class McpSkipCurrentAutostartCommand extends Action2 {
1035
1035
  constructor() {
1036
1036
  super({
1037
1037
  id: McpCommandIds.SkipCurrentAutostart,
1038
- title: ( localize2(9273, "Skip Current Autostart")),
1038
+ title: ( localize2(10154, "Skip Current Autostart")),
1039
1039
  category,
1040
1040
  f1: false
1041
1041
  });
@@ -17,17 +17,16 @@ import { ChatElicitationRequestPart } from '@codingame/monaco-vscode-api/vscode/
17
17
  import { ChatModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatModel';
18
18
  import { ElicitationState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService';
19
19
  import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
20
- import { LocalChatSessionUri } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
21
20
  import { MpcResponseError, ElicitationKind, McpConnectionState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
22
21
  import { mcpServerToSourceData } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypesUtils';
23
- import { MCP } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/modelContextProtocol';
22
+ import { MCP } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/modelContextProtocol';
24
23
  import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
25
24
  import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
26
25
 
27
26
  const noneItem = {
28
27
  id: undefined,
29
- label: ( localize(9337, "None")),
30
- description: ( localize(9338, "No selection")),
28
+ label: ( localize(10218, "None")),
29
+ description: ( localize(10219, "No selection")),
31
30
  alwaysShow: true
32
31
  };
33
32
  function isFormElicitation(params) {
@@ -75,11 +74,11 @@ let McpElicitationService = class McpElicitationService {
75
74
  async _elicitForm(server, context, elicitation, token) {
76
75
  const store = ( new DisposableStore());
77
76
  const value = await ( new Promise(resolve => {
78
- const chatModel = context?.chatSessionId && this._chatService.getSession(LocalChatSessionUri.forSession(context.chatSessionId));
77
+ const chatModel = context?.chatSessionResource && this._chatService.getSession(context.chatSessionResource);
79
78
  if (chatModel instanceof ChatModel) {
80
79
  const request = chatModel.getRequests().at(-1);
81
80
  if (request) {
82
- const part = ( new ChatElicitationRequestPart(( localize(9339, "Request for Input")), elicitation.message, ( localize(9340, "{0} (MCP Server)", server.definition.label)), ( localize(9341, "Respond")), ( localize(9342, "Cancel")), async () => {
81
+ const part = ( new ChatElicitationRequestPart(( localize(10220, "Request for Input")), elicitation.message, ( localize(10221, "{0} (MCP Server)", server.definition.label)), ( localize(10222, "Respond")), ( localize(10223, "Cancel")), async () => {
83
82
  const p = this._doElicitForm(elicitation, token);
84
83
  resolve(p);
85
84
  const result = await p;
@@ -96,11 +95,11 @@ let McpElicitationService = class McpElicitationService {
96
95
  } else {
97
96
  const handle = this._notificationService.notify({
98
97
  message: elicitation.message,
99
- source: ( localize(9343, "MCP Server ({0})", server.definition.label)),
98
+ source: ( localize(10224, "MCP Server ({0})", server.definition.label)),
100
99
  severity: Severity.Info,
101
100
  actions: {
102
- primary: [store.add(( new Action("mcp.elicit.give", ( localize(9344, "Respond")), undefined, true, () => resolve(this._doElicitForm(elicitation, token)))))],
103
- secondary: [store.add(( new Action("mcp.elicit.cancel", ( localize(9345, "Cancel")), undefined, true, () => resolve({
101
+ primary: [store.add(( new Action("mcp.elicit.give", ( localize(10225, "Respond")), undefined, true, () => resolve(this._doElicitForm(elicitation, token)))))],
102
+ secondary: [store.add(( new Action("mcp.elicit.cancel", ( localize(10226, "Cancel")), undefined, true, () => resolve({
104
103
  action: "decline"
105
104
  }))))]
106
105
  }
@@ -139,11 +138,11 @@ let McpElicitationService = class McpElicitationService {
139
138
  })).finally(() => promiseStore.dispose());
140
139
  const store = ( new DisposableStore());
141
140
  const value = await ( new Promise(resolve => {
142
- const chatModel = context?.chatSessionId && this._chatService.getSession(LocalChatSessionUri.forSession(context.chatSessionId));
141
+ const chatModel = context?.chatSessionResource && this._chatService.getSession(context.chatSessionResource);
143
142
  if (chatModel instanceof ChatModel) {
144
143
  const request = chatModel.getRequests().at(-1);
145
144
  if (request) {
146
- const part = ( new ChatElicitationRequestPart(( localize(9346, "Authorization Required")), ( new MarkdownString()).appendText(elicitation.message).appendMarkdown("\n\n" + ( localize(9347, "Open this URL?"))).appendCodeblock("", elicitation.url), ( localize(9340, "{0} (MCP Server)", server.definition.label)), ( localize(9348, "Open {0}", ( URI.parse(elicitation.url)).authority)), ( localize(9342, "Cancel")), async () => {
145
+ const part = ( new ChatElicitationRequestPart(( localize(10227, "Authorization Required")), ( new MarkdownString()).appendText(elicitation.message).appendMarkdown("\n\n" + ( localize(10228, "Open this URL?"))).appendCodeblock("", elicitation.url), ( localize(10221, "{0} (MCP Server)", server.definition.label)), ( localize(10229, "Open {0}", ( URI.parse(elicitation.url)).authority)), ( localize(10223, "Cancel")), async () => {
147
146
  const result = await this._doElicitUrl(elicitation, token);
148
147
  resolve(result);
149
148
  completePromise.then(() => part.hide());
@@ -158,12 +157,12 @@ let McpElicitationService = class McpElicitationService {
158
157
  }
159
158
  } else {
160
159
  const handle = this._notificationService.notify({
161
- message: elicitation.message + " " + ( localize(9349, "This will open {0}", elicitation.url)),
162
- source: ( localize(9343, "MCP Server ({0})", server.definition.label)),
160
+ message: elicitation.message + " " + ( localize(10230, "This will open {0}", elicitation.url)),
161
+ source: ( localize(10224, "MCP Server ({0})", server.definition.label)),
163
162
  severity: Severity.Info,
164
163
  actions: {
165
- primary: [store.add(( new Action("mcp.elicit.url.open2", ( localize(9350, "Open URL")), undefined, true, () => resolve(this._doElicitUrl(elicitation, token)))))],
166
- secondary: [store.add(( new Action("mcp.elicit.cancel", ( localize(9345, "Cancel")), undefined, true, () => resolve({
164
+ primary: [store.add(( new Action("mcp.elicit.url.open2", ( localize(10231, "Open URL")), undefined, true, () => resolve(this._doElicitUrl(elicitation, token)))))],
165
+ secondary: [store.add(( new Action("mcp.elicit.cancel", ( localize(10226, "Cancel")), undefined, true, () => resolve({
167
166
  action: "decline"
168
167
  }))))]
169
168
  }
@@ -305,7 +304,7 @@ let McpElicitationService = class McpElicitationService {
305
304
  _getFieldPlaceholder(schema, required) {
306
305
  let placeholder = schema.description || "";
307
306
  if (!required) {
308
- placeholder = placeholder ? `${placeholder} (${( localize(9351, "Optional"))})` : ( localize(9351, "Optional"));
307
+ placeholder = placeholder ? `${placeholder} (${( localize(10232, "Optional"))})` : ( localize(10232, "Optional"));
309
308
  }
310
309
  return placeholder;
311
310
  }
@@ -414,7 +413,7 @@ let McpElicitationService = class McpElicitationService {
414
413
  items.push({
415
414
  id: "$default",
416
415
  label: `${schema.default}`,
417
- description: ( localize(9352, "Default value"))
416
+ description: ( localize(10233, "Default value"))
418
417
  });
419
418
  }
420
419
  }
@@ -483,13 +482,13 @@ let McpElicitationService = class McpElicitationService {
483
482
  if (schema.minLength && value.length < schema.minLength) {
484
483
  return {
485
484
  isValid: false,
486
- message: ( localize(9353, "Minimum length is {0}", schema.minLength))
485
+ message: ( localize(10234, "Minimum length is {0}", schema.minLength))
487
486
  };
488
487
  }
489
488
  if (schema.maxLength && value.length > schema.maxLength) {
490
489
  return {
491
490
  isValid: false,
492
- message: ( localize(9354, "Maximum length is {0}", schema.maxLength))
491
+ message: ( localize(10235, "Maximum length is {0}", schema.maxLength))
493
492
  };
494
493
  }
495
494
  if (schema.format) {
@@ -510,7 +509,7 @@ let McpElicitationService = class McpElicitationService {
510
509
  isValid: true
511
510
  } : {
512
511
  isValid: false,
513
- message: ( localize(9355, "Please enter a valid email address"))
512
+ message: ( localize(10236, "Please enter a valid email address"))
514
513
  };
515
514
  case "uri":
516
515
  if (URL.canParse(value)) {
@@ -520,7 +519,7 @@ let McpElicitationService = class McpElicitationService {
520
519
  } else {
521
520
  return {
522
521
  isValid: false,
523
- message: ( localize(9356, "Please enter a valid URI"))
522
+ message: ( localize(10237, "Please enter a valid URI"))
524
523
  };
525
524
  }
526
525
  case "date":
@@ -529,7 +528,7 @@ let McpElicitationService = class McpElicitationService {
529
528
  if (!dateRegex.test(value)) {
530
529
  return {
531
530
  isValid: false,
532
- message: ( localize(9357, "Please enter a valid date (YYYY-MM-DD)"))
531
+ message: ( localize(10238, "Please enter a valid date (YYYY-MM-DD)"))
533
532
  };
534
533
  }
535
534
  const date = ( new Date(value));
@@ -537,7 +536,7 @@ let McpElicitationService = class McpElicitationService {
537
536
  isValid: true
538
537
  } : {
539
538
  isValid: false,
540
- message: ( localize(9357, "Please enter a valid date (YYYY-MM-DD)"))
539
+ message: ( localize(10238, "Please enter a valid date (YYYY-MM-DD)"))
541
540
  };
542
541
  }
543
542
  case "date-time":
@@ -547,7 +546,7 @@ let McpElicitationService = class McpElicitationService {
547
546
  isValid: true
548
547
  } : {
549
548
  isValid: false,
550
- message: ( localize(9358, "Please enter a valid date-time"))
549
+ message: ( localize(10239, "Please enter a valid date-time"))
551
550
  };
552
551
  }
553
552
  default:
@@ -561,25 +560,25 @@ let McpElicitationService = class McpElicitationService {
561
560
  if (isNaN(parsed)) {
562
561
  return {
563
562
  isValid: false,
564
- message: ( localize(9359, "Please enter a valid number"))
563
+ message: ( localize(10240, "Please enter a valid number"))
565
564
  };
566
565
  }
567
566
  if (schema.type === "integer" && !Number.isInteger(parsed)) {
568
567
  return {
569
568
  isValid: false,
570
- message: ( localize(9360, "Please enter a valid integer"))
569
+ message: ( localize(10241, "Please enter a valid integer"))
571
570
  };
572
571
  }
573
572
  if (schema.minimum !== undefined && parsed < schema.minimum) {
574
573
  return {
575
574
  isValid: false,
576
- message: ( localize(9361, "Minimum value is {0}", schema.minimum))
575
+ message: ( localize(10242, "Minimum value is {0}", schema.minimum))
577
576
  };
578
577
  }
579
578
  if (schema.maximum !== undefined && parsed > schema.maximum) {
580
579
  return {
581
580
  isValid: false,
582
- message: ( localize(9362, "Maximum value is {0}", schema.maximum))
581
+ message: ( localize(10243, "Maximum value is {0}", schema.maximum))
583
582
  };
584
583
  }
585
584
  return {
@@ -0,0 +1,20 @@
1
+ import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
2
+ import { IRemoteAgentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/remote/common/remoteAgentService.service";
3
+ import { IMcpGatewayResult } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpGatewayService";
4
+ import { IWorkbenchMcpGatewayService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpGatewayService.service";
5
+ /**
6
+ * Browser implementation of the MCP Gateway Service.
7
+ *
8
+ * In browser/serverless web environments without a remote connection,
9
+ * there is no Node.js process available to create an HTTP server.
10
+ *
11
+ * When running with a remote connection, the gateway is created on the
12
+ * remote server via IPC.
13
+ */
14
+ export declare class BrowserMcpGatewayService implements IWorkbenchMcpGatewayService {
15
+ private readonly _remoteAgentService;
16
+ private readonly _logService;
17
+ readonly _serviceBrand: undefined;
18
+ constructor(_remoteAgentService: IRemoteAgentService, _logService: ILogService);
19
+ createGateway(inRemote: boolean): Promise<IMcpGatewayResult | undefined>;
20
+ }