@codingame/monaco-vscode-mcp-service-override 21.3.2 → 21.3.4
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.
- package/package.json +15 -15
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcp.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpAddContextContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommands.js +54 -54
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.js +17 -17
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.js +18 -18
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpMigration.js +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpResourceQuickAccess.js +7 -7
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.js +26 -26
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.js +34 -34
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerIcons.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.js +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.js +8 -8
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/extensionMcpDiscovery.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpContextKeys.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpLanguageModelToolContribution.js +6 -6
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js +12 -12
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingLog.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.js +11 -11
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServer.js +9 -9
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.js +3 -3
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.js +9 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-mcp-service-override",
|
|
3
|
-
"version": "21.3.
|
|
3
|
+
"version": "21.3.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - mcp service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,20 +15,20 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-2673c6e2-17c1-5710-b169-46f3d4a28696-common": "21.3.
|
|
19
|
-
"@codingame/monaco-vscode-4a3ac544-9a61-534c-88df-756262793ef7-common": "21.3.
|
|
20
|
-
"@codingame/monaco-vscode-4fad3647-b95d-5c19-bab1-bb9de627a5ec-common": "21.3.
|
|
21
|
-
"@codingame/monaco-vscode-5e2c24a1-3217-55e8-bc90-521eaf7df5a6-common": "21.3.
|
|
22
|
-
"@codingame/monaco-vscode-62190c26-af1c-5f7a-a364-e05a59cfb7c7-common": "21.3.
|
|
23
|
-
"@codingame/monaco-vscode-9a5ab9e7-d838-5831-9eb4-e79ea3764dcb-common": "21.3.
|
|
24
|
-
"@codingame/monaco-vscode-a654b07e-8806-5425-b124-18f03ba8e11a-common": "21.3.
|
|
25
|
-
"@codingame/monaco-vscode-api": "21.3.
|
|
26
|
-
"@codingame/monaco-vscode-b994942c-360d-5b68-8a33-77d4bde6b714-common": "21.3.
|
|
27
|
-
"@codingame/monaco-vscode-c2deffc4-ad68-5e63-8f95-9b89e0fc6898-common": "21.3.
|
|
28
|
-
"@codingame/monaco-vscode-ce7c734f-7712-563c-9335-d7acb43306af-common": "21.3.
|
|
29
|
-
"@codingame/monaco-vscode-cf77987b-b1b7-5359-aaf8-a259c63d9f03-common": "21.3.
|
|
30
|
-
"@codingame/monaco-vscode-dc3fa21d-a483-5b99-a7ab-173235644a34-common": "21.3.
|
|
31
|
-
"@codingame/monaco-vscode-f24e325c-2ce0-5bba-8236-bfc4f53180ab-common": "21.3.
|
|
18
|
+
"@codingame/monaco-vscode-2673c6e2-17c1-5710-b169-46f3d4a28696-common": "21.3.4",
|
|
19
|
+
"@codingame/monaco-vscode-4a3ac544-9a61-534c-88df-756262793ef7-common": "21.3.4",
|
|
20
|
+
"@codingame/monaco-vscode-4fad3647-b95d-5c19-bab1-bb9de627a5ec-common": "21.3.4",
|
|
21
|
+
"@codingame/monaco-vscode-5e2c24a1-3217-55e8-bc90-521eaf7df5a6-common": "21.3.4",
|
|
22
|
+
"@codingame/monaco-vscode-62190c26-af1c-5f7a-a364-e05a59cfb7c7-common": "21.3.4",
|
|
23
|
+
"@codingame/monaco-vscode-9a5ab9e7-d838-5831-9eb4-e79ea3764dcb-common": "21.3.4",
|
|
24
|
+
"@codingame/monaco-vscode-a654b07e-8806-5425-b124-18f03ba8e11a-common": "21.3.4",
|
|
25
|
+
"@codingame/monaco-vscode-api": "21.3.4",
|
|
26
|
+
"@codingame/monaco-vscode-b994942c-360d-5b68-8a33-77d4bde6b714-common": "21.3.4",
|
|
27
|
+
"@codingame/monaco-vscode-c2deffc4-ad68-5e63-8f95-9b89e0fc6898-common": "21.3.4",
|
|
28
|
+
"@codingame/monaco-vscode-ce7c734f-7712-563c-9335-d7acb43306af-common": "21.3.4",
|
|
29
|
+
"@codingame/monaco-vscode-cf77987b-b1b7-5359-aaf8-a259c63d9f03-common": "21.3.4",
|
|
30
|
+
"@codingame/monaco-vscode-dc3fa21d-a483-5b99-a7ab-173235644a34-common": "21.3.4",
|
|
31
|
+
"@codingame/monaco-vscode-f24e325c-2ce0-5bba-8236-bfc4f53180ab-common": "21.3.4"
|
|
32
32
|
},
|
|
33
33
|
"main": "index.js",
|
|
34
34
|
"module": "index.js",
|
|
@@ -78,15 +78,15 @@ registerWorkbenchContribution2(McpConfigMigrationContribution.ID, McpConfigMigra
|
|
|
78
78
|
registerWorkbenchContribution2(McpServersViewsContribution.ID, McpServersViewsContribution, WorkbenchPhase.AfterRestored);
|
|
79
79
|
const jsonRegistry = ( Registry.as(Extensions.JSONContribution));
|
|
80
80
|
jsonRegistry.registerSchema(mcpSchemaId, mcpServerSchema);
|
|
81
|
-
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(McpServerEditor, McpServerEditor.ID, ( localize(
|
|
81
|
+
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(McpServerEditor, McpServerEditor.ID, ( localize(8216, "MCP Server"))), [
|
|
82
82
|
( new SyncDescriptor(McpServerEditorInput))
|
|
83
83
|
]);
|
|
84
84
|
( Registry.as(Extensions$1.Quickaccess)).registerQuickAccessProvider({
|
|
85
85
|
ctor: McpResourceQuickAccess,
|
|
86
86
|
prefix: McpResourceQuickAccess.PREFIX,
|
|
87
|
-
placeholder: ( localize(
|
|
87
|
+
placeholder: ( localize(8217, "Filter to an MCP resource")),
|
|
88
88
|
helpEntries: [{
|
|
89
|
-
description: ( localize(
|
|
89
|
+
description: ( localize(8218, "MCP Server Resources")),
|
|
90
90
|
commandId: McpCommandIds.AddConfiguration
|
|
91
91
|
}]
|
|
92
92
|
});
|
|
@@ -30,10 +30,10 @@ let McpAddContextContribution = class McpAddContextContribution extends Disposab
|
|
|
30
30
|
_registerAddContextMenu() {
|
|
31
31
|
this._addContextMenu.value = this._chatContextPickService.registerChatContextItem({
|
|
32
32
|
type: 'pickerPick',
|
|
33
|
-
label: ( localize(
|
|
33
|
+
label: ( localize(8219, "MCP Resources...")),
|
|
34
34
|
icon: Codicon.mcp,
|
|
35
35
|
asPicker: () => ({
|
|
36
|
-
placeholder: ( localize(
|
|
36
|
+
placeholder: ( localize(8220, "Select MCP Resource...")),
|
|
37
37
|
picks: (_query, token) => this._getResourcePicks(token),
|
|
38
38
|
}),
|
|
39
39
|
});
|
|
@@ -80,7 +80,7 @@ class ListMcpServerCommand extends Action2 {
|
|
|
80
80
|
constructor() {
|
|
81
81
|
super({
|
|
82
82
|
id: McpCommandIds.ListServer,
|
|
83
|
-
title: ( localize2(
|
|
83
|
+
title: ( localize2(8221, 'List Servers')),
|
|
84
84
|
icon: Codicon.server,
|
|
85
85
|
category,
|
|
86
86
|
f1: true,
|
|
@@ -98,13 +98,13 @@ class ListMcpServerCommand extends Action2 {
|
|
|
98
98
|
const quickInput = accessor.get(IQuickInputService);
|
|
99
99
|
const store = ( new DisposableStore());
|
|
100
100
|
const pick = quickInput.createQuickPick({ useSeparators: true });
|
|
101
|
-
pick.placeholder = ( localize(
|
|
101
|
+
pick.placeholder = ( localize(8222, 'Select an MCP Server'));
|
|
102
102
|
store.add(pick);
|
|
103
103
|
store.add(autorun(reader => {
|
|
104
104
|
const servers = groupBy(mcpService.servers.read(reader).slice().sort((a, b) => (a.collection.presentation?.order || 0) - (b.collection.presentation?.order || 0)), s => s.collection.id);
|
|
105
105
|
const firstRun = pick.items.length === 0;
|
|
106
106
|
pick.items = [
|
|
107
|
-
{ id: '$add', label: ( localize(
|
|
107
|
+
{ id: '$add', label: ( localize(8223, 'Add Server')), description: ( localize(8224, 'Add a new server configuration')), alwaysShow: true, iconClass: ThemeIcon.asClassName(Codicon.add) },
|
|
108
108
|
...( Object.values(servers)).filter(s => s.length).flatMap((servers) => [
|
|
109
109
|
{ type: 'separator', label: servers[0].collection.label, id: servers[0].collection.id },
|
|
110
110
|
...( servers.map(server => ({
|
|
@@ -141,7 +141,7 @@ class McpConfirmationServerOptionsCommand extends Action2 {
|
|
|
141
141
|
constructor() {
|
|
142
142
|
super({
|
|
143
143
|
id: McpCommandIds.ServerOptionsInConfirmation,
|
|
144
|
-
title: ( localize2(
|
|
144
|
+
title: ( localize2(8225, 'Server Options')),
|
|
145
145
|
category,
|
|
146
146
|
icon: Codicon.settingsGear,
|
|
147
147
|
f1: false,
|
|
@@ -174,7 +174,7 @@ class McpServerOptionsCommand extends Action2 {
|
|
|
174
174
|
constructor() {
|
|
175
175
|
super({
|
|
176
176
|
id: McpCommandIds.ServerOptions,
|
|
177
|
-
title: ( localize2(
|
|
177
|
+
title: ( localize2(8225, 'Server Options')),
|
|
178
178
|
category,
|
|
179
179
|
f1: false,
|
|
180
180
|
});
|
|
@@ -196,20 +196,20 @@ class McpServerOptionsCommand extends Action2 {
|
|
|
196
196
|
const serverDefinition = collection?.serverDefinitions.get().find(s => s.id === server.definition.id);
|
|
197
197
|
const items = [];
|
|
198
198
|
const serverState = server.connectionState.get();
|
|
199
|
-
items.push({ type: 'separator', label: ( localize(
|
|
199
|
+
items.push({ type: 'separator', label: ( localize(8226, 'Status')) });
|
|
200
200
|
if (McpConnectionState.canBeStarted(serverState.state)) {
|
|
201
201
|
items.push({
|
|
202
|
-
label: ( localize(
|
|
202
|
+
label: ( localize(8227, 'Start Server')),
|
|
203
203
|
action: 'start'
|
|
204
204
|
});
|
|
205
205
|
}
|
|
206
206
|
else {
|
|
207
207
|
items.push({
|
|
208
|
-
label: ( localize(
|
|
208
|
+
label: ( localize(8228, 'Stop Server')),
|
|
209
209
|
action: 'stop'
|
|
210
210
|
});
|
|
211
211
|
items.push({
|
|
212
|
-
label: ( localize(
|
|
212
|
+
label: ( localize(8229, 'Restart Server')),
|
|
213
213
|
action: 'restart'
|
|
214
214
|
});
|
|
215
215
|
}
|
|
@@ -217,36 +217,36 @@ class McpServerOptionsCommand extends Action2 {
|
|
|
217
217
|
const configTarget = serverDefinition?.presentation?.origin || collection?.presentation?.origin;
|
|
218
218
|
if (configTarget) {
|
|
219
219
|
items.push({
|
|
220
|
-
label: ( localize(
|
|
220
|
+
label: ( localize(8230, 'Show Configuration')),
|
|
221
221
|
action: 'config',
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
224
|
items.push({
|
|
225
|
-
label: ( localize(
|
|
225
|
+
label: ( localize(8231, 'Show Output')),
|
|
226
226
|
action: 'showOutput'
|
|
227
227
|
});
|
|
228
|
-
items.push({ type: 'separator', label: ( localize(
|
|
229
|
-
label: ( localize(
|
|
230
|
-
description: ( localize(
|
|
228
|
+
items.push({ type: 'separator', label: ( localize(8232, 'Sampling')) }, {
|
|
229
|
+
label: ( localize(8233, 'Configure Model Access')),
|
|
230
|
+
description: ( localize(8234, 'Set the models the server can use via MCP sampling')),
|
|
231
231
|
action: 'configSampling'
|
|
232
232
|
});
|
|
233
233
|
if (samplingService.hasLogs(server)) {
|
|
234
234
|
items.push({
|
|
235
|
-
label: ( localize(
|
|
236
|
-
description: ( localize(
|
|
235
|
+
label: ( localize(8235, 'Show Sampling Requests')),
|
|
236
|
+
description: ( localize(8236, 'Show the sampling requests for this server')),
|
|
237
237
|
action: 'samplingLog',
|
|
238
238
|
});
|
|
239
239
|
}
|
|
240
240
|
const capabilities = server.capabilities.get();
|
|
241
241
|
if (capabilities === undefined || (capabilities & McpCapability.Resources)) {
|
|
242
|
-
items.push({ type: 'separator', label: ( localize(
|
|
242
|
+
items.push({ type: 'separator', label: ( localize(8237, 'Resources')) });
|
|
243
243
|
items.push({
|
|
244
|
-
label: ( localize(
|
|
244
|
+
label: ( localize(8238, 'Browse Resources')),
|
|
245
245
|
action: 'resources',
|
|
246
246
|
});
|
|
247
247
|
}
|
|
248
248
|
const pick = await quickInputService.pick(items, {
|
|
249
|
-
placeHolder: ( localize(
|
|
249
|
+
placeHolder: ( localize(8239, 'Select action for \'{0}\'', server.definition.label)),
|
|
250
250
|
});
|
|
251
251
|
if (!pick) {
|
|
252
252
|
return;
|
|
@@ -288,7 +288,7 @@ class McpServerOptionsCommand extends Action2 {
|
|
|
288
288
|
editorService.openEditor({
|
|
289
289
|
resource: undefined,
|
|
290
290
|
contents: samplingService.getLogText(server),
|
|
291
|
-
label: ( localize(
|
|
291
|
+
label: ( localize(8240, 'MCP Sampling: {0}', server.definition.label)),
|
|
292
292
|
});
|
|
293
293
|
break;
|
|
294
294
|
default:
|
|
@@ -305,7 +305,7 @@ class McpServerOptionsCommand extends Action2 {
|
|
|
305
305
|
if (accountQuery.entities().getEntityCount().total > 1) {
|
|
306
306
|
result.push({
|
|
307
307
|
action: 'disconnect',
|
|
308
|
-
label: ( localize(
|
|
308
|
+
label: ( localize(8241, 'Disconnect Account')),
|
|
309
309
|
description: `(${accountName})`,
|
|
310
310
|
accountQuery
|
|
311
311
|
});
|
|
@@ -313,7 +313,7 @@ class McpServerOptionsCommand extends Action2 {
|
|
|
313
313
|
else {
|
|
314
314
|
result.push({
|
|
315
315
|
action: 'signout',
|
|
316
|
-
label: ( localize(
|
|
316
|
+
label: ( localize(8242, 'Sign Out')),
|
|
317
317
|
description: `(${accountName})`,
|
|
318
318
|
accountQuery
|
|
319
319
|
});
|
|
@@ -470,21 +470,21 @@ let MCPServerActionRendering = class MCPServerActionRendering extends Disposable
|
|
|
470
470
|
if (state === DisplayedState.NewTools) {
|
|
471
471
|
markdown = ( new MarkdownString(single
|
|
472
472
|
? ( localize(
|
|
473
|
-
|
|
473
|
+
8243,
|
|
474
474
|
"MCP server {0} has been updated and may have new tools available.",
|
|
475
475
|
names
|
|
476
476
|
))
|
|
477
477
|
: ( localize(
|
|
478
|
-
|
|
478
|
+
8244,
|
|
479
479
|
"MCP servers have been updated and may have new tools available:\n\n{0}",
|
|
480
480
|
names
|
|
481
481
|
))));
|
|
482
482
|
}
|
|
483
483
|
else if (state === DisplayedState.Error) {
|
|
484
484
|
markdown = ( new MarkdownString(single
|
|
485
|
-
? ( localize(
|
|
485
|
+
? ( localize(8245, "MCP server {0} was unable to start successfully.", names))
|
|
486
486
|
: ( localize(
|
|
487
|
-
|
|
487
|
+
8246,
|
|
488
488
|
"Multiple MCP servers were unable to start successfully:\n\n{0}",
|
|
489
489
|
names
|
|
490
490
|
))));
|
|
@@ -512,7 +512,7 @@ let MCPServerActionRendering = class MCPServerActionRendering extends Disposable
|
|
|
512
512
|
const divider = $('hr.mcp-hover-divider');
|
|
513
513
|
container.appendChild(divider);
|
|
514
514
|
const checkboxContainer = $('div.mcp-hover-setting');
|
|
515
|
-
const settingLabelStr = ( localize(
|
|
515
|
+
const settingLabelStr = ( localize(8247, "Automatically start MCP servers when sending a chat message"));
|
|
516
516
|
const checkbox = store.add(( new Checkbox(
|
|
517
517
|
settingLabelStr,
|
|
518
518
|
config.get() !== McpAutoStartValue.Never,
|
|
@@ -537,13 +537,13 @@ let MCPServerActionRendering = class MCPServerActionRendering extends Disposable
|
|
|
537
537
|
}
|
|
538
538
|
getLabelForState({ state, servers } = displayedStateCurrent.get()) {
|
|
539
539
|
if (state === DisplayedState.NewTools) {
|
|
540
|
-
return localize(
|
|
540
|
+
return localize(8248, "New tools available ({0})", servers.length || 1);
|
|
541
541
|
}
|
|
542
542
|
else if (state === DisplayedState.Error) {
|
|
543
|
-
return localize(
|
|
543
|
+
return localize(8249, "Error loading {0} tool(s)", servers.length || 1);
|
|
544
544
|
}
|
|
545
545
|
else if (state === DisplayedState.Refreshing) {
|
|
546
|
-
return localize(
|
|
546
|
+
return localize(8250, "Discovering tools...");
|
|
547
547
|
}
|
|
548
548
|
else {
|
|
549
549
|
return null;
|
|
@@ -564,7 +564,7 @@ class ResetMcpTrustCommand extends Action2 {
|
|
|
564
564
|
constructor() {
|
|
565
565
|
super({
|
|
566
566
|
id: McpCommandIds.ResetTrust,
|
|
567
|
-
title: ( localize2(
|
|
567
|
+
title: ( localize2(8251, "Reset Trust")),
|
|
568
568
|
category,
|
|
569
569
|
f1: true,
|
|
570
570
|
precondition: McpContextKeys.toolsCount.greater(0),
|
|
@@ -579,7 +579,7 @@ class ResetMcpCachedTools extends Action2 {
|
|
|
579
579
|
constructor() {
|
|
580
580
|
super({
|
|
581
581
|
id: McpCommandIds.ResetCachedTools,
|
|
582
|
-
title: ( localize2(
|
|
582
|
+
title: ( localize2(8252, "Reset Cached Tools")),
|
|
583
583
|
category,
|
|
584
584
|
f1: true,
|
|
585
585
|
precondition: McpContextKeys.toolsCount.greater(0),
|
|
@@ -594,9 +594,9 @@ class AddConfigurationAction extends Action2 {
|
|
|
594
594
|
constructor() {
|
|
595
595
|
super({
|
|
596
596
|
id: McpCommandIds.AddConfiguration,
|
|
597
|
-
title: ( localize2(
|
|
597
|
+
title: ( localize2(8253, "Add Server...")),
|
|
598
598
|
metadata: {
|
|
599
|
-
description: ( localize2(
|
|
599
|
+
description: ( localize2(8254, "Installs a new Model Context protocol to the mcp.json settings")),
|
|
600
600
|
},
|
|
601
601
|
category,
|
|
602
602
|
f1: true,
|
|
@@ -617,7 +617,7 @@ class RemoveStoredInput extends Action2 {
|
|
|
617
617
|
constructor() {
|
|
618
618
|
super({
|
|
619
619
|
id: McpCommandIds.RemoveStoredInput,
|
|
620
|
-
title: ( localize2(
|
|
620
|
+
title: ( localize2(8252, "Reset Cached Tools")),
|
|
621
621
|
category,
|
|
622
622
|
f1: false,
|
|
623
623
|
});
|
|
@@ -630,7 +630,7 @@ class EditStoredInput extends Action2 {
|
|
|
630
630
|
constructor() {
|
|
631
631
|
super({
|
|
632
632
|
id: McpCommandIds.EditStoredInput,
|
|
633
|
-
title: ( localize2(
|
|
633
|
+
title: ( localize2(8255, "Edit Stored Input")),
|
|
634
634
|
category,
|
|
635
635
|
f1: false,
|
|
636
636
|
});
|
|
@@ -644,7 +644,7 @@ class ShowConfiguration extends Action2 {
|
|
|
644
644
|
constructor() {
|
|
645
645
|
super({
|
|
646
646
|
id: McpCommandIds.ShowConfiguration,
|
|
647
|
-
title: ( localize2(
|
|
647
|
+
title: ( localize2(8256, "Show Configuration")),
|
|
648
648
|
category,
|
|
649
649
|
f1: false,
|
|
650
650
|
});
|
|
@@ -673,7 +673,7 @@ class ShowOutput extends Action2 {
|
|
|
673
673
|
constructor() {
|
|
674
674
|
super({
|
|
675
675
|
id: McpCommandIds.ShowOutput,
|
|
676
|
-
title: ( localize2(
|
|
676
|
+
title: ( localize2(8257, "Show Output")),
|
|
677
677
|
category,
|
|
678
678
|
f1: false,
|
|
679
679
|
});
|
|
@@ -686,7 +686,7 @@ class RestartServer extends Action2 {
|
|
|
686
686
|
constructor() {
|
|
687
687
|
super({
|
|
688
688
|
id: McpCommandIds.RestartServer,
|
|
689
|
-
title: ( localize2(
|
|
689
|
+
title: ( localize2(8258, "Restart Server")),
|
|
690
690
|
category,
|
|
691
691
|
f1: false,
|
|
692
692
|
});
|
|
@@ -702,7 +702,7 @@ class StartServer extends Action2 {
|
|
|
702
702
|
constructor() {
|
|
703
703
|
super({
|
|
704
704
|
id: McpCommandIds.StartServer,
|
|
705
|
-
title: ( localize2(
|
|
705
|
+
title: ( localize2(8259, "Start Server")),
|
|
706
706
|
category,
|
|
707
707
|
f1: false,
|
|
708
708
|
});
|
|
@@ -716,7 +716,7 @@ class StopServer extends Action2 {
|
|
|
716
716
|
constructor() {
|
|
717
717
|
super({
|
|
718
718
|
id: McpCommandIds.StopServer,
|
|
719
|
-
title: ( localize2(
|
|
719
|
+
title: ( localize2(8260, "Stop Server")),
|
|
720
720
|
category,
|
|
721
721
|
f1: false,
|
|
722
722
|
});
|
|
@@ -730,7 +730,7 @@ class McpBrowseCommand extends Action2 {
|
|
|
730
730
|
constructor() {
|
|
731
731
|
super({
|
|
732
732
|
id: McpCommandIds.Browse,
|
|
733
|
-
title: ( localize2(
|
|
733
|
+
title: ( localize2(8261, "MCP Servers")),
|
|
734
734
|
category,
|
|
735
735
|
menu: [{
|
|
736
736
|
id: extensionsFilterSubMenu,
|
|
@@ -746,7 +746,7 @@ class McpBrowseCommand extends Action2 {
|
|
|
746
746
|
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
747
747
|
command: {
|
|
748
748
|
id: McpCommandIds.Browse,
|
|
749
|
-
title: ( localize2(
|
|
749
|
+
title: ( localize2(8262, "Browse Servers")),
|
|
750
750
|
category
|
|
751
751
|
},
|
|
752
752
|
});
|
|
@@ -754,7 +754,7 @@ class BrowseMcpServersPageCommand extends Action2 {
|
|
|
754
754
|
constructor() {
|
|
755
755
|
super({
|
|
756
756
|
id: McpCommandIds.BrowsePage,
|
|
757
|
-
title: ( localize2(
|
|
757
|
+
title: ( localize2(8263, "Browse MCP Servers")),
|
|
758
758
|
icon: Codicon.globe,
|
|
759
759
|
menu: [{
|
|
760
760
|
id: MenuId.ViewTitle,
|
|
@@ -773,7 +773,7 @@ class ShowInstalledMcpServersCommand extends Action2 {
|
|
|
773
773
|
constructor() {
|
|
774
774
|
super({
|
|
775
775
|
id: McpCommandIds.ShowInstalled,
|
|
776
|
-
title: ( localize2(
|
|
776
|
+
title: ( localize2(8264, "Show Installed Servers")),
|
|
777
777
|
category,
|
|
778
778
|
precondition: HasInstalledMcpServersContext,
|
|
779
779
|
f1: true,
|
|
@@ -791,7 +791,7 @@ class ShowInstalledMcpServersCommand extends Action2 {
|
|
|
791
791
|
MenuRegistry.appendMenuItem(CHAT_CONFIG_MENU_ID, {
|
|
792
792
|
command: {
|
|
793
793
|
id: McpCommandIds.ShowInstalled,
|
|
794
|
-
title: ( localize2(
|
|
794
|
+
title: ( localize2(8265, "MCP Servers"))
|
|
795
795
|
},
|
|
796
796
|
when: ( ContextKeyExpr.and(ChatContextKeys.enabled, ( ContextKeyExpr.equals('view', ChatViewId)))),
|
|
797
797
|
order: 14,
|
|
@@ -812,7 +812,7 @@ class OpenUserMcpResourceCommand extends OpenMcpResourceCommand {
|
|
|
812
812
|
constructor() {
|
|
813
813
|
super({
|
|
814
814
|
id: McpCommandIds.OpenUserMcp,
|
|
815
|
-
title: ( localize2(
|
|
815
|
+
title: ( localize2(8266, "Open User Configuration")),
|
|
816
816
|
category,
|
|
817
817
|
f1: true
|
|
818
818
|
});
|
|
@@ -826,7 +826,7 @@ class OpenRemoteUserMcpResourceCommand extends OpenMcpResourceCommand {
|
|
|
826
826
|
constructor() {
|
|
827
827
|
super({
|
|
828
828
|
id: McpCommandIds.OpenRemoteUserMcp,
|
|
829
|
-
title: ( localize2(
|
|
829
|
+
title: ( localize2(8267, "Open Remote User Configuration")),
|
|
830
830
|
category,
|
|
831
831
|
f1: true,
|
|
832
832
|
precondition: ( RemoteNameContext.notEqualsTo(''))
|
|
@@ -843,7 +843,7 @@ class OpenWorkspaceFolderMcpResourceCommand extends Action2 {
|
|
|
843
843
|
constructor() {
|
|
844
844
|
super({
|
|
845
845
|
id: McpCommandIds.OpenWorkspaceFolderMcp,
|
|
846
|
-
title: ( localize2(
|
|
846
|
+
title: ( localize2(8268, "Open Workspace Folder MCP Configuration")),
|
|
847
847
|
category,
|
|
848
848
|
f1: true,
|
|
849
849
|
precondition: ( WorkspaceFolderCountContext.notEqualsTo(0))
|
|
@@ -864,7 +864,7 @@ class OpenWorkspaceMcpResourceCommand extends Action2 {
|
|
|
864
864
|
constructor() {
|
|
865
865
|
super({
|
|
866
866
|
id: McpCommandIds.OpenWorkspaceMcp,
|
|
867
|
-
title: ( localize2(
|
|
867
|
+
title: ( localize2(8269, "Open Workspace MCP Configuration")),
|
|
868
868
|
category,
|
|
869
869
|
f1: true,
|
|
870
870
|
precondition: ( WorkbenchStateContext.isEqualTo('workspace'))
|
|
@@ -883,7 +883,7 @@ class McpBrowseResourcesCommand extends Action2 {
|
|
|
883
883
|
constructor() {
|
|
884
884
|
super({
|
|
885
885
|
id: McpCommandIds.BrowseResources,
|
|
886
|
-
title: ( localize2(
|
|
886
|
+
title: ( localize2(8270, "Browse Resources...")),
|
|
887
887
|
category,
|
|
888
888
|
precondition: McpContextKeys.serverCount.greater(0),
|
|
889
889
|
f1: true,
|
|
@@ -902,7 +902,7 @@ class McpConfigureSamplingModels extends Action2 {
|
|
|
902
902
|
constructor() {
|
|
903
903
|
super({
|
|
904
904
|
id: McpCommandIds.ConfigureSamplingModels,
|
|
905
|
-
title: ( localize2(
|
|
905
|
+
title: ( localize2(8271, "Configure SamplingModel")),
|
|
906
906
|
category,
|
|
907
907
|
});
|
|
908
908
|
}
|
|
@@ -926,7 +926,7 @@ class McpConfigureSamplingModels extends Action2 {
|
|
|
926
926
|
allItems.sort((a, b) => (b.picked ? 1 : 0) - (a.picked ? 1 : 0) || a.label.localeCompare(b.label));
|
|
927
927
|
const picked = await quickInputService.pick(allItems, {
|
|
928
928
|
placeHolder: ( localize(
|
|
929
|
-
|
|
929
|
+
8272,
|
|
930
930
|
'Pick the models {0} can access via MCP sampling',
|
|
931
931
|
server.definition.label
|
|
932
932
|
)),
|
|
@@ -942,7 +942,7 @@ class McpStartPromptingServerCommand extends Action2 {
|
|
|
942
942
|
constructor() {
|
|
943
943
|
super({
|
|
944
944
|
id: McpCommandIds.StartPromptForServer,
|
|
945
|
-
title: ( localize2(
|
|
945
|
+
title: ( localize2(8273, "Start Prompting Server")),
|
|
946
946
|
category,
|
|
947
947
|
f1: false,
|
|
948
948
|
});
|
|
@@ -13,7 +13,7 @@ import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/c
|
|
|
13
13
|
import { mcpServerToSourceData } from '../common/mcpTypesUtils.js';
|
|
14
14
|
import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
|
|
15
15
|
|
|
16
|
-
const noneItem = { id: undefined, label: ( localize(
|
|
16
|
+
const noneItem = { id: undefined, label: ( localize(8325, 'None')), description: ( localize(8326, 'No selection')), alwaysShow: true };
|
|
17
17
|
let McpElicitationService = class McpElicitationService {
|
|
18
18
|
constructor(_notificationService, _quickInputService, _chatService) {
|
|
19
19
|
this._notificationService = _notificationService;
|
|
@@ -27,7 +27,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
27
27
|
if (chatModel instanceof ChatModel) {
|
|
28
28
|
const request = chatModel.getRequests().at(-1);
|
|
29
29
|
if (request) {
|
|
30
|
-
const part = ( new ChatElicitationRequestPart(( localize(
|
|
30
|
+
const part = ( new ChatElicitationRequestPart(( localize(8327, 'Request for Input')), elicitation.message, ( localize(8328, "{0} (MCP Server)", server.definition.label)), ( localize(8329, 'Respond')), ( localize(8330, 'Cancel')), async () => {
|
|
31
31
|
const p = this._doElicit(elicitation, token);
|
|
32
32
|
resolve(p);
|
|
33
33
|
const result = await p;
|
|
@@ -44,11 +44,11 @@ let McpElicitationService = class McpElicitationService {
|
|
|
44
44
|
else {
|
|
45
45
|
const handle = this._notificationService.notify({
|
|
46
46
|
message: elicitation.message,
|
|
47
|
-
source: ( localize(
|
|
47
|
+
source: ( localize(8331, 'MCP Server ({0})', server.definition.label)),
|
|
48
48
|
severity: Severity.Info,
|
|
49
49
|
actions: {
|
|
50
|
-
primary: [store.add(( new Action('mcp.elicit.give', ( localize(
|
|
51
|
-
secondary: [store.add(( new Action('mcp.elicit.cancel', ( localize(
|
|
50
|
+
primary: [store.add(( new Action('mcp.elicit.give', ( localize(8332, 'Respond')), undefined, true, () => resolve(this._doElicit(elicitation, token)))))],
|
|
51
|
+
secondary: [store.add(( new Action('mcp.elicit.cancel', ( localize(8333, 'Cancel')), undefined, true, () => resolve({ action: 'decline' }))))],
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
store.add(handle.onDidClose(() => resolve({ action: 'cancel' })));
|
|
@@ -122,7 +122,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
122
122
|
_getFieldPlaceholder(schema, required) {
|
|
123
123
|
let placeholder = schema.description || '';
|
|
124
124
|
if (!required) {
|
|
125
|
-
placeholder = placeholder ? `${placeholder} (${( localize(
|
|
125
|
+
placeholder = placeholder ? `${placeholder} (${( localize(8334, 'Optional'))})` : ( localize(8334, 'Optional'));
|
|
126
126
|
}
|
|
127
127
|
return placeholder;
|
|
128
128
|
}
|
|
@@ -209,10 +209,10 @@ let McpElicitationService = class McpElicitationService {
|
|
|
209
209
|
}
|
|
210
210
|
_validateString(value, schema) {
|
|
211
211
|
if (schema.minLength && value.length < schema.minLength) {
|
|
212
|
-
return { isValid: false, message: ( localize(
|
|
212
|
+
return { isValid: false, message: ( localize(8335, 'Minimum length is {0}', schema.minLength)) };
|
|
213
213
|
}
|
|
214
214
|
if (schema.maxLength && value.length > schema.maxLength) {
|
|
215
|
-
return { isValid: false, message: ( localize(
|
|
215
|
+
return { isValid: false, message: ( localize(8336, 'Maximum length is {0}', schema.maxLength)) };
|
|
216
216
|
}
|
|
217
217
|
if (schema.format) {
|
|
218
218
|
const formatValid = this._validateStringFormat(value, schema.format);
|
|
@@ -227,29 +227,29 @@ let McpElicitationService = class McpElicitationService {
|
|
|
227
227
|
case 'email':
|
|
228
228
|
return !value.includes('@')
|
|
229
229
|
? { isValid: true }
|
|
230
|
-
: { isValid: false, message: ( localize(
|
|
230
|
+
: { isValid: false, message: ( localize(8337, 'Please enter a valid email address')) };
|
|
231
231
|
case 'uri':
|
|
232
232
|
if (URL.canParse(value)) {
|
|
233
233
|
return { isValid: true };
|
|
234
234
|
}
|
|
235
235
|
else {
|
|
236
|
-
return { isValid: false, message: ( localize(
|
|
236
|
+
return { isValid: false, message: ( localize(8338, 'Please enter a valid URI')) };
|
|
237
237
|
}
|
|
238
238
|
case 'date': {
|
|
239
239
|
const dateRegex = /^\d{4}-\d{2}-\d{2}$/;
|
|
240
240
|
if (!dateRegex.test(value)) {
|
|
241
|
-
return { isValid: false, message: ( localize(
|
|
241
|
+
return { isValid: false, message: ( localize(8339, 'Please enter a valid date (YYYY-MM-DD)')) };
|
|
242
242
|
}
|
|
243
243
|
const date = ( new Date(value));
|
|
244
244
|
return !isNaN(date.getTime())
|
|
245
245
|
? { isValid: true }
|
|
246
|
-
: { isValid: false, message: ( localize(
|
|
246
|
+
: { isValid: false, message: ( localize(8339, 'Please enter a valid date (YYYY-MM-DD)')) };
|
|
247
247
|
}
|
|
248
248
|
case 'date-time': {
|
|
249
249
|
const dateTime = ( new Date(value));
|
|
250
250
|
return !isNaN(dateTime.getTime())
|
|
251
251
|
? { isValid: true }
|
|
252
|
-
: { isValid: false, message: ( localize(
|
|
252
|
+
: { isValid: false, message: ( localize(8340, 'Please enter a valid date-time')) };
|
|
253
253
|
}
|
|
254
254
|
default:
|
|
255
255
|
return { isValid: true };
|
|
@@ -258,16 +258,16 @@ let McpElicitationService = class McpElicitationService {
|
|
|
258
258
|
_validateNumber(value, schema) {
|
|
259
259
|
const parsed = Number(value);
|
|
260
260
|
if (isNaN(parsed)) {
|
|
261
|
-
return { isValid: false, message: ( localize(
|
|
261
|
+
return { isValid: false, message: ( localize(8341, 'Please enter a valid number')) };
|
|
262
262
|
}
|
|
263
263
|
if (schema.type === 'integer' && !Number.isInteger(parsed)) {
|
|
264
|
-
return { isValid: false, message: ( localize(
|
|
264
|
+
return { isValid: false, message: ( localize(8342, 'Please enter a valid integer')) };
|
|
265
265
|
}
|
|
266
266
|
if (schema.minimum !== undefined && parsed < schema.minimum) {
|
|
267
|
-
return { isValid: false, message: ( localize(
|
|
267
|
+
return { isValid: false, message: ( localize(8343, 'Minimum value is {0}', schema.minimum)) };
|
|
268
268
|
}
|
|
269
269
|
if (schema.maximum !== undefined && parsed > schema.maximum) {
|
|
270
|
-
return { isValid: false, message: ( localize(
|
|
270
|
+
return { isValid: false, message: ( localize(8344, 'Maximum value is {0}', schema.maximum)) };
|
|
271
271
|
}
|
|
272
272
|
return { isValid: true, parsedValue: parsed };
|
|
273
273
|
}
|