@codingame/monaco-vscode-mcp-service-override 34.1.3 → 35.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 (34) 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 +6 -5
  5. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpAddContextContribution.js +2 -2
  6. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommands.d.ts +7 -0
  7. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommands.js +247 -73
  8. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.js +25 -25
  9. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.js +23 -23
  10. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpMigration.js +4 -4
  11. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpResourceQuickAccess.js +8 -8
  12. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.js +37 -37
  13. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.js +2 -2
  14. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerIcons.js +5 -5
  15. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.js +5 -5
  16. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.js +17 -17
  17. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js +10 -10
  18. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/extensionMcpDiscovery.js +4 -4
  19. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/installedMcpServersDiscovery.js +2 -2
  20. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.js +1 -1
  21. package/vscode/src/vs/workbench/contrib/mcp/common/mcpContextKeys.js +4 -4
  22. package/vscode/src/vs/workbench/contrib/mcp/common/mcpLanguageModelToolContribution.js +8 -6
  23. package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js +13 -13
  24. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingLog.js +1 -1
  25. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.js +11 -11
  26. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSandboxService.js +3 -3
  27. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.js +3 -3
  28. package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.d.ts +4 -9
  29. package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.js +5 -48
  30. package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpAccessService.d.ts +12 -0
  31. package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpAccessService.js +3 -0
  32. package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.js +9 -9
  33. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/pluginMcpDiscovery.d.ts +0 -15
  34. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/pluginMcpDiscovery.js +0 -118
@@ -1,118 +0,0 @@
1
-
2
- import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
- import { hash } from '@codingame/monaco-vscode-api/vscode/vs/base/common/hash';
4
- import { Disposable, DisposableResourceMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
5
- import { ResourceSet } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
6
- import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
7
- import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
8
- import { isDefined } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
9
- import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
10
- import { ConfigurationTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration';
11
- import { McpServerType } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpPlatformTypes';
12
- import { StorageScope } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
13
- import { IAgentPluginService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/agentPluginService.service';
14
- import { isContributionEnabled } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/enablement';
15
- import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
16
- import { McpCollectionSortOrder, McpServerTrust, McpServerTransportType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
17
- import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
18
-
19
- let PluginMcpDiscovery = class PluginMcpDiscovery extends Disposable {
20
- constructor(_agentPluginService, _mcpRegistry) {
21
- super();
22
- this._agentPluginService = _agentPluginService;
23
- this._mcpRegistry = _mcpRegistry;
24
- this.fromGallery = false;
25
- this._collections = this._register(( new DisposableResourceMap()));
26
- }
27
- start() {
28
- this._register(autorun(reader => {
29
- const plugins = this._agentPluginService.plugins.read(reader);
30
- const seen = ( new ResourceSet());
31
- for (const plugin of plugins) {
32
- if (!isContributionEnabled(plugin.enablement.read(reader))) {
33
- continue;
34
- }
35
- const servers = plugin.mcpServerDefinitions.read(reader);
36
- if (servers.length === 0) {
37
- continue;
38
- }
39
- seen.add(plugin.uri);
40
- let collectionState = this._collections.get(plugin.uri);
41
- if (!collectionState) {
42
- collectionState = this.createCollectionState(plugin, servers[0].uri);
43
- this._collections.set(plugin.uri, collectionState);
44
- }
45
- }
46
- for (const [pluginUri] of this._collections) {
47
- if (!( seen.has(pluginUri))) {
48
- this._collections.deleteAndDispose(pluginUri);
49
- }
50
- }
51
- }));
52
- }
53
- createCollectionState(plugin, manifestURI) {
54
- const collectionId = `plugin.${plugin.uri}`;
55
- return this._mcpRegistry.registerCollection({
56
- id: collectionId,
57
- label: `${plugin.label} (Agent Plugin)`,
58
- remoteAuthority: plugin.uri.scheme === Schemas.vscodeRemote ? plugin.uri.authority : null,
59
- configTarget: ConfigurationTarget.USER,
60
- scope: StorageScope.PROFILE,
61
- trustBehavior: McpServerTrust.Kind.Trusted,
62
- serverDefinitions: ( plugin.mcpServerDefinitions.map(defs => ( defs.map(d => this._toServerDefinition(collectionId, d))).filter(isDefined))),
63
- order: McpCollectionSortOrder.Plugin,
64
- presentation: {
65
- origin: manifestURI
66
- }
67
- });
68
- }
69
- _toServerDefinition(
70
- collectionId,
71
- {
72
- name,
73
- configuration
74
- }
75
- ) {
76
- const launch = this._toLaunch(configuration);
77
- if (!launch) {
78
- return undefined;
79
- }
80
- return {
81
- id: `${collectionId}.${name}`,
82
- label: name,
83
- launch,
84
- variableReplacement: {
85
- target: ConfigurationTarget.USER
86
- },
87
- cacheNonce: String(hash(launch))
88
- };
89
- }
90
- _toLaunch(config) {
91
- if (config.type === McpServerType.LOCAL) {
92
- return {
93
- type: McpServerTransportType.Stdio,
94
- command: config.command,
95
- args: config.args ? [...config.args] : [],
96
- env: config.env ? {
97
- ...config.env
98
- } : {},
99
- envFile: config.envFile,
100
- cwd: config.cwd,
101
- sandbox: undefined
102
- };
103
- }
104
- try {
105
- return {
106
- type: McpServerTransportType.HTTP,
107
- uri: ( URI.parse(config.url)),
108
- headers: Object.entries(config.headers ?? {}),
109
- oauth: config.oauth
110
- };
111
- } catch {
112
- return undefined;
113
- }
114
- }
115
- };
116
- PluginMcpDiscovery = ( __decorate([( __param(0, IAgentPluginService)), ( __param(1, IMcpRegistry))], PluginMcpDiscovery));
117
-
118
- export { PluginMcpDiscovery };