@codingame/monaco-vscode-mcp-service-override 31.0.0 → 32.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 (40) hide show
  1. package/package.json +2 -2
  2. package/vscode/src/vs/platform/mcp/common/allowedMcpServersService.js +1 -1
  3. package/vscode/src/vs/platform/mcp/common/mcpGalleryService.js +2 -2
  4. package/vscode/src/vs/workbench/contrib/mcp/browser/mcp.contribution.js +7 -11
  5. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpAddContextContribution.js +2 -2
  6. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommands.js +80 -80
  7. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.js +25 -25
  8. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.js +47 -25
  9. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpMigration.js +4 -4
  10. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpResourceQuickAccess.js +8 -8
  11. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.d.ts +72 -0
  12. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.js +1023 -0
  13. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.d.ts +17 -0
  14. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.js +49 -0
  15. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerIcons.d.ts +5 -0
  16. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerIcons.js +12 -0
  17. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.d.ts +88 -0
  18. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.js +372 -0
  19. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js +11 -11
  20. package/vscode/src/vs/workbench/contrib/mcp/browser/media/mcpServerEditor.css +98 -0
  21. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/extensionMcpDiscovery.js +6 -5
  22. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/installedMcpServersDiscovery.js +2 -2
  23. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.js +3 -3
  24. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/pluginMcpDiscovery.js +2 -2
  25. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/workspaceDotMcpDiscovery.d.ts +21 -0
  26. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/workspaceDotMcpDiscovery.js +92 -0
  27. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/workspaceMcpDiscoveryAdapter.js +2 -2
  28. package/vscode/src/vs/workbench/contrib/mcp/common/mcpContextKeys.js +4 -4
  29. package/vscode/src/vs/workbench/contrib/mcp/common/mcpLanguageModelToolContribution.js +10 -8
  30. package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js +14 -14
  31. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingLog.js +1 -1
  32. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.js +11 -11
  33. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSandboxService.js +4 -4
  34. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.js +3 -3
  35. package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.d.ts +28 -3
  36. package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.js +88 -3
  37. package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.js +9 -9
  38. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.d.ts +0 -59
  39. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.js +0 -576
  40. package/vscode/src/vs/workbench/contrib/mcp/browser/media/mcpServersView.css +0 -53
@@ -0,0 +1,98 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ .mcp-server-editor {
7
+ .configuration-content {
8
+ padding: 20px;
9
+ box-sizing: border-box;
10
+ }
11
+
12
+ .config-section {
13
+ margin-bottom: 15px;
14
+ display: flex;
15
+ align-items: flex-start;
16
+ }
17
+
18
+ .config-label {
19
+ font-weight: 600;
20
+ min-width: 80px;
21
+ margin-right: 15px;
22
+ }
23
+
24
+ .config-value {
25
+ word-break: break-all;
26
+ }
27
+
28
+ .config-value .env-entry {
29
+ display: block;
30
+ }
31
+
32
+ .no-config {
33
+ color: var(--vscode-descriptionForeground);
34
+ font-style: italic;
35
+ padding: 20px;
36
+ }
37
+
38
+ .manifest-content {
39
+ padding: 20px;
40
+ box-sizing: border-box;
41
+
42
+ .manifest-section {
43
+ margin-bottom: 20px;
44
+
45
+ .manifest-section-title {
46
+ font-size: 26px;
47
+ display: inline-block;
48
+ margin: 0px;
49
+ font-weight: 600;
50
+ height: 100%;
51
+ box-sizing: border-box;
52
+ padding: 10px;
53
+ padding-left: 0px;
54
+ flex: 1;
55
+ position: relative;
56
+ overflow: hidden;
57
+ text-overflow: ellipsis;
58
+ }
59
+ }
60
+
61
+ .package-section {
62
+
63
+ margin-top: 10px;
64
+
65
+ .package-section-title {
66
+ margin-bottom: 5px;
67
+ font-size: 1.4em;
68
+ font-weight: 600;
69
+ border-bottom: 1px solid var(--vscode-panelSection-border);
70
+ padding: 5px;
71
+ }
72
+
73
+ .package-details {
74
+ padding-left: 10px;
75
+ .package-detail {
76
+ display: grid;
77
+ grid-template-columns: 200px 1fr;
78
+ gap: 12px;
79
+ align-items: start;
80
+ padding: 8px 0px;
81
+ }
82
+
83
+ .package-separator {
84
+ margin-top: 10px;
85
+ border-bottom: 1px solid var(--vscode-panelSection-border);
86
+ }
87
+ }
88
+ }
89
+
90
+
91
+ .no-manifest {
92
+ font-style: italic;
93
+ padding: 20px;
94
+ }
95
+ }
96
+
97
+
98
+ }
@@ -13,7 +13,7 @@ import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbe
13
13
  import { ExtensionsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
14
14
  import { mcpContributionPoint, mcpActivationEvent } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
15
15
  import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
16
- import { McpServerDefinition, extensionPrefixedIdentifier, McpServerTrust } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
16
+ import { McpServerDefinition, extensionPrefixedIdentifier, McpCollectionSortOrder, McpServerTrust } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
17
17
  import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
18
18
 
19
19
  var ExtensionMcpDiscovery_1;
@@ -102,6 +102,7 @@ let ExtensionMcpDiscovery = ExtensionMcpDiscovery_1 = class ExtensionMcpDiscover
102
102
  trustBehavior: McpServerTrust.Kind.Trusted,
103
103
  scope: StorageScope.WORKSPACE,
104
104
  configTarget: ConfigurationTarget.USER,
105
+ order: McpCollectionSortOrder.Extension,
105
106
  serverDefinitions: observableValue(this, serverDefs?.map(McpServerDefinition.fromSerialized) || []),
106
107
  lazy: {
107
108
  isCached: !!serverDefs,
@@ -141,20 +142,20 @@ let ExtensionMcpDiscovery = ExtensionMcpDiscovery_1 = class ExtensionMcpDiscover
141
142
  }
142
143
  static _validate(user) {
143
144
  if (!Array.isArray(user.value)) {
144
- user.collector.error(( localize(10819, "Expected an array of MCP collections")));
145
+ user.collector.error(( localize(11121, "Expected an array of MCP collections")));
145
146
  return false;
146
147
  }
147
148
  for (const contribution of user.value) {
148
149
  if (typeof contribution.id !== "string" || isFalsyOrWhitespace(contribution.id)) {
149
- user.collector.error(( localize(10820, "Expected 'id' to be a non-empty string.")));
150
+ user.collector.error(( localize(11122, "Expected 'id' to be a non-empty string.")));
150
151
  return false;
151
152
  }
152
153
  if (typeof contribution.label !== "string" || isFalsyOrWhitespace(contribution.label)) {
153
- user.collector.error(( localize(10821, "Expected 'label' to be a non-empty string.")));
154
+ user.collector.error(( localize(11123, "Expected 'label' to be a non-empty string.")));
154
155
  return false;
155
156
  }
156
157
  if (contribution.when !== undefined && (typeof contribution.when !== "string" || isFalsyOrWhitespace(contribution.when))) {
157
- user.collector.error(( localize(10822, "Expected 'when' to be a non-empty string.")));
158
+ user.collector.error(( localize(11124, "Expected 'when' to be a non-empty string.")));
158
159
  return false;
159
160
  }
160
161
  }
@@ -13,7 +13,7 @@ import { StorageScope } from '@codingame/monaco-vscode-api/vscode/vs/platform/st
13
13
  import { getMcpServerMapping } from '../mcpConfigFileUtils.js';
14
14
  import { mcpConfigurationSection } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
15
15
  import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
16
- import { McpServerTransportType, McpServerLaunch, McpServerTrust, McpCollectionDefinition, McpServerDefinition } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
16
+ import { McpServerTransportType, McpServerLaunch, McpServerTrust, McpCollectionSortOrder, McpCollectionDefinition, McpServerDefinition } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
17
17
  import { IMcpWorkbenchService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service';
18
18
  import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
19
19
 
@@ -121,8 +121,8 @@ let InstalledMcpServersDiscovery = class InstalledMcpServersDiscovery extends Di
121
121
  const newCollection = {
122
122
  id,
123
123
  label: mcpConfigPath?.label ?? "",
124
+ order: mcpConfigPath?.order ?? McpCollectionSortOrder.User,
124
125
  presentation: {
125
- order: serverDefinitions[0]?.presentation?.order,
126
126
  origin: mcpConfigPath?.uri
127
127
  },
128
128
  remoteAuthority: mcpConfigPath?.remoteAuthority ?? null,
@@ -86,7 +86,7 @@ let NativeFilesystemMcpDiscovery = class NativeFilesystemMcpDiscovery extends Fi
86
86
  this.suffix = "";
87
87
  if (remoteAuthority) {
88
88
  this.suffix = " " + ( localize(
89
- 10823,
89
+ 11125,
90
90
  " on {0}",
91
91
  labelService.getHostLabel(Schemas.vscodeRemote, remoteAuthority)
92
92
  ));
@@ -120,9 +120,9 @@ let NativeFilesystemMcpDiscovery = class NativeFilesystemMcpDiscovery extends Fi
120
120
  scope: StorageScope.PROFILE,
121
121
  trustBehavior: McpServerTrust.Kind.TrustedOnNonce,
122
122
  serverDefinitions: observableValue(this, []),
123
+ order: adapter.order + (adapter.remoteAuthority ? McpCollectionSortOrder.RemoteBoost : 0),
123
124
  presentation: {
124
- origin: file,
125
- order: adapter.order + (adapter.remoteAuthority ? McpCollectionSortOrder.RemoteBoost : 0)
125
+ origin: file
126
126
  }
127
127
  };
128
128
  this._register(this.watchFile(
@@ -60,9 +60,9 @@ let PluginMcpDiscovery = class PluginMcpDiscovery extends Disposable {
60
60
  scope: StorageScope.PROFILE,
61
61
  trustBehavior: McpServerTrust.Kind.Trusted,
62
62
  serverDefinitions: ( plugin.mcpServerDefinitions.map(defs => ( defs.map(d => this._toServerDefinition(collectionId, d))).filter(isDefined))),
63
+ order: McpCollectionSortOrder.Plugin,
63
64
  presentation: {
64
- origin: manifestURI,
65
- order: McpCollectionSortOrder.Plugin
65
+ origin: manifestURI
66
66
  }
67
67
  });
68
68
  }
@@ -0,0 +1,21 @@
1
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
+ import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
3
+ import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service";
4
+ import { IRemoteAgentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/remote/common/remoteAgentService.service";
5
+ import { IMcpRegistry } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service";
6
+ import { IMcpDiscovery } from "./mcpDiscovery.js";
7
+ /**
8
+ * Discovers MCP servers defined in `.mcp.json` files at workspace folder roots.
9
+ * Uses the Claude-style format: `{ "mcpServers": { ... } }`.
10
+ */
11
+ export declare class WorkspaceDotMcpDiscovery extends Disposable implements IMcpDiscovery {
12
+ private readonly _fileService;
13
+ private readonly _workspaceContextService;
14
+ private readonly _mcpRegistry;
15
+ private readonly _remoteAgentService;
16
+ readonly fromGallery = false;
17
+ private readonly _collections;
18
+ constructor(_fileService: IFileService, _workspaceContextService: IWorkspaceContextService, _mcpRegistry: IMcpRegistry, _remoteAgentService: IRemoteAgentService);
19
+ start(): void;
20
+ private _watchFolder;
21
+ }
@@ -0,0 +1,92 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { RunOnceScheduler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
4
+ import { Disposable, DisposableMap, DisposableStore, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
5
+ import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
6
+ import { joinPath } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
7
+ import { ConfigurationTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration';
8
+ import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
9
+ import { StorageScope } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
10
+ import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
11
+ import { IRemoteAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/remote/common/remoteAgentService.service';
12
+ import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
13
+ import { McpCollectionSortOrder, McpServerTrust } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
14
+ import { claudeConfigToServerDefinition } from './nativeMcpDiscoveryAdapters.js';
15
+ import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
16
+
17
+ let WorkspaceDotMcpDiscovery = class WorkspaceDotMcpDiscovery extends Disposable {
18
+ constructor(_fileService, _workspaceContextService, _mcpRegistry, _remoteAgentService) {
19
+ super();
20
+ this._fileService = _fileService;
21
+ this._workspaceContextService = _workspaceContextService;
22
+ this._mcpRegistry = _mcpRegistry;
23
+ this._remoteAgentService = _remoteAgentService;
24
+ this.fromGallery = false;
25
+ this._collections = this._register(( new DisposableMap()));
26
+ }
27
+ start() {
28
+ this._register(this._workspaceContextService.onDidChangeWorkspaceFolders(e => {
29
+ for (const removed of e.removed) {
30
+ this._collections.deleteAndDispose(( removed.uri.toString()));
31
+ }
32
+ for (const added of e.added) {
33
+ this._watchFolder(added);
34
+ }
35
+ }));
36
+ for (const folder of this._workspaceContextService.getWorkspace().folders) {
37
+ this._watchFolder(folder);
38
+ }
39
+ }
40
+ _watchFolder(folder) {
41
+ const configFile = joinPath(folder.uri, ".mcp.json");
42
+ const collectionId = `workspace-dot-mcp.${folder.index}`;
43
+ const serverDefinitions = observableValue(this, []);
44
+ const collection = {
45
+ id: collectionId,
46
+ label: `${folder.name}/.mcp.json`,
47
+ remoteAuthority: this._remoteAgentService.getConnection()?.remoteAuthority || null,
48
+ scope: StorageScope.WORKSPACE,
49
+ trustBehavior: McpServerTrust.Kind.TrustedOnNonce,
50
+ serverDefinitions,
51
+ configTarget: ConfigurationTarget.WORKSPACE_FOLDER,
52
+ order: McpCollectionSortOrder.WorkspaceFolder + 1,
53
+ presentation: {
54
+ origin: configFile
55
+ }
56
+ };
57
+ const store = ( new DisposableStore());
58
+ const collectionRegistration = store.add(( new MutableDisposable()));
59
+ const updateFile = async () => {
60
+ let definitions = [];
61
+ try {
62
+ const contents = await this._fileService.readFile(configFile);
63
+ const defs = await claudeConfigToServerDefinition(collectionId, contents.value, folder.uri);
64
+ if (defs) {
65
+ for (const d of defs) {
66
+ d.roots = [folder.uri];
67
+ }
68
+ definitions = defs;
69
+ }
70
+ } catch {}
71
+ if (!definitions.length) {
72
+ collectionRegistration.clear();
73
+ } else {
74
+ serverDefinitions.set(definitions, undefined);
75
+ if (!collectionRegistration.value) {
76
+ collectionRegistration.value = this._mcpRegistry.registerCollection(collection);
77
+ }
78
+ }
79
+ };
80
+ const throttler = store.add(( new RunOnceScheduler(updateFile, 500)));
81
+ const watcher = store.add(this._fileService.createWatcher(configFile, {
82
+ recursive: false,
83
+ excludes: []
84
+ }));
85
+ store.add(watcher.onDidChange(() => throttler.schedule()));
86
+ updateFile();
87
+ this._collections.set(( folder.uri.toString()), store);
88
+ }
89
+ };
90
+ WorkspaceDotMcpDiscovery = ( __decorate([( __param(0, IFileService)), ( __param(1, IWorkspaceContextService)), ( __param(2, IMcpRegistry)), ( __param(3, IRemoteAgentService))], WorkspaceDotMcpDiscovery));
91
+
92
+ export { WorkspaceDotMcpDiscovery };
@@ -53,9 +53,9 @@ let CursorWorkspaceMcpDiscoveryAdapter = class CursorWorkspaceMcpDiscoveryAdapte
53
53
  trustBehavior: McpServerTrust.Kind.TrustedOnNonce,
54
54
  serverDefinitions: observableValue(this, []),
55
55
  configTarget: ConfigurationTarget.WORKSPACE_FOLDER,
56
+ order: McpCollectionSortOrder.WorkspaceFolder + 1,
56
57
  presentation: {
57
- origin: configFile,
58
- order: McpCollectionSortOrder.WorkspaceFolder + 1
58
+ origin: configFile
59
59
  }
60
60
  };
61
61
  this._collections.set(( folder.uri.toString()), this.watchFile(
@@ -14,19 +14,19 @@ var McpContextKeys;
14
14
  (function(McpContextKeys) {
15
15
  McpContextKeys.serverCount = ( new RawContextKey("mcp.serverCount", undefined, {
16
16
  type: "number",
17
- description: ( localize(10866, "Context key that has the number of registered MCP servers"))
17
+ description: ( localize(11168, "Context key that has the number of registered MCP servers"))
18
18
  }));
19
19
  McpContextKeys.hasUnknownTools = ( new RawContextKey("mcp.hasUnknownTools", undefined, {
20
20
  type: "boolean",
21
- description: ( localize(10867, "Indicates whether there are MCP servers with unknown tools."))
21
+ description: ( localize(11169, "Indicates whether there are MCP servers with unknown tools."))
22
22
  }));
23
23
  McpContextKeys.hasServersWithErrors = ( new RawContextKey("mcp.hasServersWithErrors", undefined, {
24
24
  type: "boolean",
25
- description: ( localize(10868, "Indicates whether there are any MCP servers with errors."))
25
+ description: ( localize(11170, "Indicates whether there are any MCP servers with errors."))
26
26
  }));
27
27
  McpContextKeys.toolsCount = ( new RawContextKey("mcp.toolsCount", undefined, {
28
28
  type: "number",
29
- description: ( localize(10869, "Context key that has the number of registered MCP tools"))
29
+ description: ( localize(11171, "Context key that has the number of registered MCP tools"))
30
30
  }));
31
31
  })(McpContextKeys || (McpContextKeys = {}));
32
32
  let McpContextKeysController = class McpContextKeysController extends Disposable {
@@ -71,7 +71,7 @@ let McpLanguageModelToolContribution = class McpLanguageModelToolContribution ex
71
71
  const toolSet = store.add(
72
72
  this._toolsService.createToolSet(source, server.definition.id, referenceName, {
73
73
  icon: Codicon.mcp,
74
- description: ( localize(10870, "{0}: All Tools", server.definition.label))
74
+ description: ( localize(11172, "{0}: All Tools", server.definition.label))
75
75
  })
76
76
  );
77
77
  return {
@@ -191,7 +191,7 @@ let McpToolImplementation = class McpToolImplementation {
191
191
  });
192
192
  const isSandboxedServer = sandboxEnabled === true;
193
193
  const mcpToolWarning = ( localize(
194
- 10871,
194
+ 11173,
195
195
  "Note that MCP servers or malicious conversation content may attempt to misuse '{0}' through tools.",
196
196
  this._productService.nameShort
197
197
  ));
@@ -200,7 +200,7 @@ let McpToolImplementation = class McpToolImplementation {
200
200
  if (!isSandboxedServer) {
201
201
  confirm = {};
202
202
  if (!tool.definition.annotations?.readOnlyHint) {
203
- confirm.title = ( new MarkdownString(( localize(10872, "Run {0}", title))));
203
+ confirm.title = ( new MarkdownString(( localize(11174, "Run {0}", title))));
204
204
  confirm.message = ( new MarkdownString(tool.definition.description, {
205
205
  supportThemeIcons: true
206
206
  }));
@@ -214,9 +214,9 @@ let McpToolImplementation = class McpToolImplementation {
214
214
  const mcpUiEnabled = this._configurationService.getValue(mcpAppsEnabledConfig);
215
215
  return {
216
216
  confirmationMessages: confirm,
217
- invocationMessage: ( new MarkdownString(( localize(10873, "Running {0}", title)))),
218
- pastTenseMessage: ( new MarkdownString(( localize(10874, "Ran {0} ", title)))),
219
- originMessage: ( localize(10875, "{0} (MCP Server)", server.definition.label)),
217
+ invocationMessage: ( new MarkdownString(( localize(11175, "Running {0}", title)))),
218
+ pastTenseMessage: ( new MarkdownString(( localize(11176, "Ran {0} ", title)))),
219
+ originMessage: ( localize(11177, "{0} (MCP Server)", server.definition.label)),
220
220
  toolSpecificData: {
221
221
  kind: "input",
222
222
  rawInput: context.parameters,
@@ -234,7 +234,9 @@ let McpToolImplementation = class McpToolImplementation {
234
234
  };
235
235
  const callResult = await this._tool.callWithProgress(invocation.parameters, progress, {
236
236
  chatRequestId: invocation.chatRequestId,
237
- chatSessionResource: invocation.context?.sessionResource
237
+ chatSessionResource: invocation.context?.sessionResource,
238
+ traceparent: invocation.traceparent,
239
+ tracestate: invocation.tracestate
238
240
  }, token);
239
241
  const details = {
240
242
  input: JSON.stringify(invocation.parameters, undefined, 2),
@@ -353,7 +355,7 @@ let McpToolImplementation = class McpToolImplementation {
353
355
  if (isForModel) {
354
356
  const permalink = invocation.context && ChatResponseResource.createUri(
355
357
  invocation.context.sessionResource,
356
- invocation.callId,
358
+ invocation.chatStreamToolCallId || invocation.callId,
357
359
  result.content.length,
358
360
  basename(uri)
359
361
  );
@@ -133,7 +133,7 @@ let McpRegistry = class McpRegistry extends Disposable {
133
133
  this._collections.set(( currentCollections.map(c => c === toReplace ? collection : c)), undefined);
134
134
  } else {
135
135
  this._collections.set(
136
- [...currentCollections, collection].sort((a, b) => (a.presentation?.order || 0) - (b.presentation?.order || 0)),
136
+ [...currentCollections, collection].sort((a, b) => a.order - b.order),
137
137
  undefined
138
138
  );
139
139
  }
@@ -227,7 +227,7 @@ let McpRegistry = class McpRegistry extends Disposable {
227
227
  if (errorOnUserInteraction) {
228
228
  throw ( new UserInteractionRequiredError("workspaceTrust"));
229
229
  } else if (!(await this._workspaceTrustRequestService.requestWorkspaceTrust({
230
- message: ( localize(10876, "This MCP server definition is defined in your workspace files."))
230
+ message: ( localize(11178, "This MCP server definition is defined in your workspace files."))
231
231
  }))) {
232
232
  return false;
233
233
  }
@@ -305,7 +305,7 @@ let McpRegistry = class McpRegistry extends Disposable {
305
305
  const originURI = r.definition.presentation?.origin?.uri || r.collection.presentation?.origin;
306
306
  let labelWithOrigin = originURI ? `[\`${r.definition.label}\`](${originURI})` : "`" + r.definition.label + "`";
307
307
  if (r.collection.source instanceof ExtensionIdentifier) {
308
- labelWithOrigin += ` (${( localize(10877, "from {0}", r.collection.source.value))})`;
308
+ labelWithOrigin += ` (${( localize(11179, "from {0}", r.collection.source.value))})`;
309
309
  }
310
310
  return labelWithOrigin;
311
311
  }
@@ -315,12 +315,12 @@ let McpRegistry = class McpRegistry extends Disposable {
315
315
  const {
316
316
  result
317
317
  } = await this._dialogService.prompt({
318
- message: ( localize(10878, "Trust and run MCP server {0}?", def.definition.label)),
318
+ message: ( localize(11180, "Trust and run MCP server {0}?", def.definition.label)),
319
319
  custom: {
320
320
  icon: Codicon.shield,
321
321
  markdownDetails: [{
322
322
  markdown: ( new MarkdownString(( localize(
323
- 10879,
323
+ 11181,
324
324
  "The MCP server {0} was updated. MCP servers may add context to your chat session and lead to unexpected behavior. Do you want to trust and run this server?",
325
325
  labelFor(def)
326
326
  )))),
@@ -333,10 +333,10 @@ let McpRegistry = class McpRegistry extends Disposable {
333
333
  }]
334
334
  },
335
335
  buttons: [{
336
- label: ( localize(10880, "Trust")),
336
+ label: ( localize(11182, "Trust")),
337
337
  run: () => true
338
338
  }, {
339
- label: ( localize(10881, "Do not trust")),
339
+ label: ( localize(11183, "Do not trust")),
340
340
  run: () => false
341
341
  }]
342
342
  });
@@ -346,12 +346,12 @@ let McpRegistry = class McpRegistry extends Disposable {
346
346
  const {
347
347
  result
348
348
  } = await this._dialogService.prompt({
349
- message: ( localize(10882, "Trust and run {0} MCP servers?", definitions.length)),
349
+ message: ( localize(11184, "Trust and run {0} MCP servers?", definitions.length)),
350
350
  custom: {
351
351
  icon: Codicon.shield,
352
352
  markdownDetails: [{
353
353
  markdown: ( new MarkdownString(( localize(
354
- 10883,
354
+ 11185,
355
355
  "Several updated MCP servers were discovered:\n\n{0}\n\n MCP servers may add context to your chat session and lead to unexpected behavior. Do you want to trust and run these server?",
356
356
  list
357
357
  )))),
@@ -364,13 +364,13 @@ let McpRegistry = class McpRegistry extends Disposable {
364
364
  }]
365
365
  },
366
366
  buttons: [{
367
- label: ( localize(10880, "Trust")),
367
+ label: ( localize(11182, "Trust")),
368
368
  run: () => "all"
369
369
  }, {
370
- label: ( localize(10884, "Pick Trusted")),
370
+ label: ( localize(11186, "Pick Trusted")),
371
371
  run: () => "pick"
372
372
  }, {
373
- label: ( localize(10881, "Do not trust")),
373
+ label: ( localize(11183, "Do not trust")),
374
374
  run: () => "none"
375
375
  }]
376
376
  });
@@ -533,14 +533,14 @@ let McpRegistry = class McpRegistry extends Disposable {
533
533
  }
534
534
  this._notificationService.notify({
535
535
  severity: Severity.Error,
536
- message: ( localize(10885, "Error starting {0}: {1}", definition.label, String(e))),
536
+ message: ( localize(11187, "Error starting {0}: {1}", definition.label, String(e))),
537
537
  actions: {
538
538
  primary: collection.presentation?.origin && [{
539
539
  id: "mcp.launchError.openConfig",
540
540
  class: undefined,
541
541
  enabled: true,
542
542
  tooltip: "",
543
- label: ( localize(10886, "Open Configuration")),
543
+ label: ( localize(11188, "Open Configuration")),
544
544
  run: () => this._editorService.openEditor({
545
545
  resource: collection.presentation.origin,
546
546
  options: {
@@ -41,7 +41,7 @@ let McpSamplingLog = class McpSamplingLog extends Disposable {
41
41
  }
42
42
  const parts = [];
43
43
  const total = record.bins.reduce((sum, value) => sum + value, 0);
44
- parts.push(( localize(10887, "{0} total requests in the last 7 days.", total)));
44
+ parts.push(( localize(11189, "{0} total requests in the last 7 days.", total)));
45
45
  parts.push(this._formatRecentRequests(record));
46
46
  return parts.join("\n");
47
47
  }
@@ -131,11 +131,11 @@ let McpSamplingService = class McpSamplingService extends Disposable {
131
131
  return this._getMatchingModel(opts);
132
132
  }
133
133
  const retry = await this._showContextual(opts.isDuringToolCall, ( localize(
134
- 10888,
134
+ 11190,
135
135
  "Allow MCP tools from \"{0}\" to make LLM requests?",
136
136
  opts.server.definition.label
137
137
  )), ( localize(
138
- 10889,
138
+ 11191,
139
139
  "The MCP server \"{0}\" has issued a request to make a language model call. Do you want to allow it to make requests during chat?",
140
140
  opts.server.definition.label
141
141
  )), this.allowButtons(opts.server, "allowedDuringChat"));
@@ -149,11 +149,11 @@ let McpSamplingService = class McpSamplingService extends Disposable {
149
149
  return this._getMatchingModel(opts);
150
150
  }
151
151
  const retry = await this._showContextual(opts.isDuringToolCall, ( localize(
152
- 10890,
152
+ 11192,
153
153
  "Allow MCP server \"{0}\" to make LLM requests?",
154
154
  opts.server.definition.label
155
155
  )), ( localize(
156
- 10891,
156
+ 11193,
157
157
  "The MCP server \"{0}\" has issued a request to make a language model call. Do you want to allow it to make requests, outside of tool calls during chat?",
158
158
  opts.server.definition.label
159
159
  )), this.allowButtons(opts.server, "allowedOutsideChat"));
@@ -165,12 +165,12 @@ let McpSamplingService = class McpSamplingService extends Disposable {
165
165
  throw McpError.notAllowed();
166
166
  } else if (model === ModelMatch.NoMatchingModel) {
167
167
  const newlyPickedModels = opts.isDuringToolCall ? await this._commandService.executeCommand(McpCommandIds.ConfigureSamplingModels, opts.server) : await this._notify(( localize(
168
- 10892,
168
+ 11194,
169
169
  "MCP server \"{0}\" triggered a language model request, but it has no allowlisted models.",
170
170
  opts.server.definition.label
171
171
  )), {
172
- [( localize(10893, "Configure"))]: () => this._commandService.executeCommand(McpCommandIds.ConfigureSamplingModels, opts.server),
173
- [( localize(10894, "Cancel"))]: () => Promise.resolve(undefined)
172
+ [( localize(11195, "Configure"))]: () => this._commandService.executeCommand(McpCommandIds.ConfigureSamplingModels, opts.server),
173
+ [( localize(11196, "Cancel"))]: () => Promise.resolve(undefined)
174
174
  });
175
175
  if (newlyPickedModels) {
176
176
  return this._getMatchingModel(opts);
@@ -181,19 +181,19 @@ let McpSamplingService = class McpSamplingService extends Disposable {
181
181
  }
182
182
  allowButtons(server, key) {
183
183
  return {
184
- [( localize(10895, "Allow in this Session"))]: async () => {
184
+ [( localize(11197, "Allow in this Session"))]: async () => {
185
185
  this._sessionSets[key].set(server.definition.id, true);
186
186
  return true;
187
187
  },
188
- [( localize(10896, "Always"))]: async () => {
188
+ [( localize(11198, "Always"))]: async () => {
189
189
  await this.updateConfig(server, c => c[key] = true);
190
190
  return true;
191
191
  },
192
- [( localize(10897, "Not Now"))]: async () => {
192
+ [( localize(11199, "Not Now"))]: async () => {
193
193
  this._sessionSets[key].set(server.definition.id, false);
194
194
  return false;
195
195
  },
196
- [( localize(10898, "Never"))]: async () => {
196
+ [( localize(11200, "Never"))]: async () => {
197
197
  await this.updateConfig(server, c => c[key] = false);
198
198
  return false;
199
199
  }
@@ -102,11 +102,11 @@ let McpSandboxService = class McpSandboxService extends Disposable {
102
102
  const suggestionLines = [];
103
103
  if (allowedDomainsList.length) {
104
104
  const shown = ( allowedDomainsList.map(domain => `"${domain}"`)).join(", ");
105
- suggestionLines.push(( localize(10899, "Add to `sandbox.network.allowedDomains`: {0}", shown)));
105
+ suggestionLines.push(( localize(11201, "Add to `sandbox.network.allowedDomains`: {0}", shown)));
106
106
  }
107
107
  if (allowWriteList.length) {
108
108
  const shown = ( allowWriteList.map(path => `"${path}"`)).join(", ");
109
- suggestionLines.push(( localize(10900, "Add to `sandbox.filesystem.allowWrite`: {0}", shown)));
109
+ suggestionLines.push(( localize(11202, "Add to `sandbox.filesystem.allowWrite`: {0}", shown)));
110
110
  }
111
111
  const sandboxConfig = {};
112
112
  if (allowedDomainsList.length) {
@@ -121,7 +121,7 @@ let McpSandboxService = class McpSandboxService extends Disposable {
121
121
  }
122
122
  return {
123
123
  message: ( localize(
124
- 10901,
124
+ 11203,
125
125
  "The MCP server {0} reported potential sandbox blocks. VS Code found possible sandbox configuration updates:\n{1}",
126
126
  serverLabel,
127
127
  suggestionLines.join("\n")
@@ -234,7 +234,7 @@ let McpSandboxService = class McpSandboxService extends Disposable {
234
234
  os,
235
235
  appRoot,
236
236
  "node_modules",
237
- "@anthropic-ai",
237
+ "@vscode",
238
238
  "sandbox-runtime",
239
239
  "dist",
240
240
  "cli.js"
@@ -52,7 +52,7 @@ let McpServerConnection = class McpServerConnection extends Disposable {
52
52
  this._state.set({
53
53
  state: McpConnectionState.Kind.Starting
54
54
  }, undefined);
55
- this._logger.info(( localize(10917, "Starting server {0}", this.definition.label)));
55
+ this._logger.info(( localize(11219, "Starting server {0}", this.definition.label)));
56
56
  try {
57
57
  const launch = this._delegate.start(this._collection, this.definition, this.launchDefinition, {
58
58
  errorOnUserInteraction: this._errorOnUserInteraction
@@ -89,7 +89,7 @@ let McpServerConnection = class McpServerConnection extends Disposable {
89
89
  store.add(autorun(reader => {
90
90
  const state = launch.state.read(reader);
91
91
  this._state.set(state, undefined);
92
- this._logger.info(( localize(10918, "Connection state: {0}", (McpConnectionState.toString(state)))));
92
+ this._logger.info(( localize(11220, "Connection state: {0}", (McpConnectionState.toString(state)))));
93
93
  if (state.state === McpConnectionState.Kind.Running && !didStart) {
94
94
  didStart = true;
95
95
  McpServerRequestHandler.create(this._instantiationService, {
@@ -128,7 +128,7 @@ let McpServerConnection = class McpServerConnection extends Disposable {
128
128
  };
129
129
  }
130
130
  async stop() {
131
- this._logger.info(( localize(10919, "Stopping server {0}", this.definition.label)));
131
+ this._logger.info(( localize(11221, "Stopping server {0}", this.definition.label)));
132
132
  this._launch.value?.object.stop();
133
133
  await this._waitForState(McpConnectionState.Kind.Stopped, McpConnectionState.Kind.Error);
134
134
  }