@codingame/monaco-vscode-mcp-service-override 26.1.0 → 26.1.2
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 +2 -2
- 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 +58 -58
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.js +24 -24
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.js +18 -18
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpMigration.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpResourceQuickAccess.js +8 -8
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.js +32 -32
- 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 +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.js +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.js +17 -17
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js +8 -8
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/extensionMcpDiscovery.js +4 -4
- 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 +13 -13
- 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/mcpServerConnection.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": "26.1.
|
|
3
|
+
"version": "26.1.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - mcp service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "26.1.
|
|
18
|
+
"@codingame/monaco-vscode-api": "26.1.2"
|
|
19
19
|
},
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"module": "index.js",
|
|
@@ -105,16 +105,16 @@ registerWorkbenchContribution2(
|
|
|
105
105
|
const jsonRegistry = ( Registry.as(Extensions.JSONContribution));
|
|
106
106
|
jsonRegistry.registerSchema(mcpSchemaId, mcpServerSchema);
|
|
107
107
|
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(
|
|
108
|
-
EditorPaneDescriptor.create(McpServerEditor, McpServerEditor.ID, ( localize(
|
|
108
|
+
EditorPaneDescriptor.create(McpServerEditor, McpServerEditor.ID, ( localize(9213, "MCP Server"))),
|
|
109
109
|
[( new SyncDescriptor(McpServerEditorInput))]
|
|
110
110
|
);
|
|
111
111
|
( Registry.as(Extensions$1.Quickaccess)).registerQuickAccessProvider({
|
|
112
112
|
ctor: McpResourceQuickAccess,
|
|
113
113
|
prefix: McpResourceQuickAccess.PREFIX,
|
|
114
114
|
when: ChatContextKeys.enabled,
|
|
115
|
-
placeholder: ( localize(
|
|
115
|
+
placeholder: ( localize(9214, "Filter to an MCP resource")),
|
|
116
116
|
helpEntries: [{
|
|
117
|
-
description: ( localize(
|
|
117
|
+
description: ( localize(9215, "MCP Server Resources")),
|
|
118
118
|
commandId: McpCommandIds.AddConfiguration
|
|
119
119
|
}]
|
|
120
120
|
});
|
|
@@ -43,7 +43,7 @@ let McpAddContextContribution = class McpAddContextContribution extends Disposab
|
|
|
43
43
|
_registerAddContextMenu() {
|
|
44
44
|
this._addContextMenu.value = this._chatContextPickService.registerChatContextItem({
|
|
45
45
|
type: "pickerPick",
|
|
46
|
-
label: ( localize(
|
|
46
|
+
label: ( localize(9216, "MCP Resources...")),
|
|
47
47
|
icon: Codicon.mcp,
|
|
48
48
|
isEnabled(widget) {
|
|
49
49
|
return !!widget.attachmentCapabilities.supportsMCPAttachments;
|
|
@@ -51,7 +51,7 @@ let McpAddContextContribution = class McpAddContextContribution extends Disposab
|
|
|
51
51
|
asPicker: () => {
|
|
52
52
|
const helper = this._instantiationService.createInstance(McpResourcePickHelper);
|
|
53
53
|
return {
|
|
54
|
-
placeholder: ( localize(
|
|
54
|
+
placeholder: ( localize(9217, "Select MCP Resource...")),
|
|
55
55
|
picks: (_query, token) => this._getResourcePicks(token, helper),
|
|
56
56
|
goBack: () => {
|
|
57
57
|
return helper.navigateBack();
|
|
@@ -78,7 +78,7 @@ class ListMcpServerCommand extends Action2 {
|
|
|
78
78
|
constructor() {
|
|
79
79
|
super({
|
|
80
80
|
id: McpCommandIds.ListServer,
|
|
81
|
-
title: ( localize2(
|
|
81
|
+
title: ( localize2(9218, "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(
|
|
102
|
+
pick.placeholder = ( localize(9219, "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(
|
|
113
|
-
description: ( localize(
|
|
112
|
+
label: ( localize(9220, "Add Server")),
|
|
113
|
+
description: ( localize(9221, "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(
|
|
151
|
+
title: ( localize2(9222, "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(
|
|
182
|
+
title: ( localize2(9222, "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(
|
|
206
|
+
label: ( localize(9223, "Status"))
|
|
207
207
|
});
|
|
208
208
|
if (McpConnectionState.canBeStarted(serverState.state)) {
|
|
209
209
|
items.push({
|
|
210
|
-
label: ( localize(
|
|
210
|
+
label: ( localize(9224, "Start Server")),
|
|
211
211
|
action: "start"
|
|
212
212
|
});
|
|
213
213
|
} else {
|
|
214
214
|
items.push({
|
|
215
|
-
label: ( localize(
|
|
215
|
+
label: ( localize(9225, "Stop Server")),
|
|
216
216
|
action: "stop"
|
|
217
217
|
});
|
|
218
218
|
items.push({
|
|
219
|
-
label: ( localize(
|
|
219
|
+
label: ( localize(9226, "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(
|
|
227
|
+
label: ( localize(9227, "Show Configuration")),
|
|
228
228
|
action: "config"
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
231
|
items.push({
|
|
232
|
-
label: ( localize(
|
|
232
|
+
label: ( localize(9228, "Show Output")),
|
|
233
233
|
action: "showOutput"
|
|
234
234
|
});
|
|
235
235
|
items.push({
|
|
236
236
|
type: "separator",
|
|
237
|
-
label: ( localize(
|
|
237
|
+
label: ( localize(9229, "Sampling"))
|
|
238
238
|
}, {
|
|
239
|
-
label: ( localize(
|
|
240
|
-
description: ( localize(
|
|
239
|
+
label: ( localize(9230, "Configure Model Access")),
|
|
240
|
+
description: ( localize(9231, "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(
|
|
246
|
-
description: ( localize(
|
|
245
|
+
label: ( localize(9232, "Show Sampling Requests")),
|
|
246
|
+
description: ( localize(9233, "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(
|
|
254
|
+
label: ( localize(9234, "Resources"))
|
|
255
255
|
});
|
|
256
256
|
items.push({
|
|
257
|
-
label: ( localize(
|
|
257
|
+
label: ( localize(9235, "Browse Resources")),
|
|
258
258
|
action: "resources"
|
|
259
259
|
});
|
|
260
260
|
}
|
|
261
261
|
const pick = await quickInputService.pick(items, {
|
|
262
|
-
placeHolder: ( localize(
|
|
262
|
+
placeHolder: ( localize(9236, "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(
|
|
310
|
+
label: ( localize(9237, "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(
|
|
327
|
+
label: ( localize(9238, "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(
|
|
334
|
+
label: ( localize(9239, "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
|
-
|
|
509
|
+
9240,
|
|
510
510
|
"MCP server {0} has been updated and may have new tools available.",
|
|
511
511
|
names
|
|
512
512
|
)) : ( localize(
|
|
513
|
-
|
|
513
|
+
9241,
|
|
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(
|
|
519
|
-
|
|
518
|
+
markdown = ( new MarkdownString(single ? ( localize(9242, "MCP server {0} was unable to start successfully.", names)) : ( localize(
|
|
519
|
+
9243,
|
|
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(
|
|
546
|
+
const settingLabelStr = ( localize(9244, "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(
|
|
574
|
+
return localize(9245, "New tools available ({0})", servers.length || 1);
|
|
575
575
|
} else if (state === DisplayedState.Error) {
|
|
576
|
-
return localize(
|
|
576
|
+
return localize(9246, "Error loading {0} tool(s)", servers.length || 1);
|
|
577
577
|
} else if (state === DisplayedState.Refreshing) {
|
|
578
|
-
return localize(
|
|
578
|
+
return localize(9247, "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(
|
|
596
|
+
title: ( localize2(9248, "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(
|
|
611
|
+
title: ( localize2(9249, "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(
|
|
626
|
+
title: ( localize2(9250, "Add Server...")),
|
|
627
627
|
metadata: {
|
|
628
|
-
description: ( localize2(
|
|
628
|
+
description: ( localize2(9251, "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(
|
|
650
|
+
title: ( localize2(9252, "Install Server from Manifest...")),
|
|
651
651
|
metadata: {
|
|
652
|
-
description: ( localize2(
|
|
652
|
+
description: ( localize2(9253, "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(
|
|
668
|
+
title: ( localize2(9249, "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(
|
|
681
|
+
title: ( localize2(9254, "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(
|
|
695
|
+
title: ( localize2(9255, "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(
|
|
725
|
+
title: ( localize2(9256, "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(
|
|
738
|
+
title: ( localize2(9257, "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(
|
|
757
|
+
title: ( localize2(9258, "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(
|
|
782
|
+
title: ( localize2(9259, "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(
|
|
797
|
-
tooltip: ( localize2(
|
|
796
|
+
title: ( localize2(9260, "MCP Servers")),
|
|
797
|
+
tooltip: ( localize2(9261, "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(
|
|
820
|
+
title: ( localize2(9262, "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(
|
|
829
|
+
title: ( localize2(9263, "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(
|
|
847
|
+
title: ( localize2(9264, "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(
|
|
872
|
+
title: ( localize2(9265, "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(
|
|
887
|
+
title: ( localize2(9266, "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(
|
|
904
|
+
title: ( localize2(9267, "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(
|
|
927
|
+
title: ( localize2(9268, "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(
|
|
948
|
+
title: ( localize2(9269, "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(
|
|
966
|
+
title: ( localize2(9270, "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
|
-
|
|
992
|
+
9271,
|
|
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(
|
|
1008
|
+
title: ( localize2(9272, "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(
|
|
1038
|
+
title: ( localize2(9273, "Skip Current Autostart")),
|
|
1039
1039
|
category,
|
|
1040
1040
|
f1: false
|
|
1041
1041
|
});
|
|
@@ -26,8 +26,8 @@ import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/obse
|
|
|
26
26
|
|
|
27
27
|
const noneItem = {
|
|
28
28
|
id: undefined,
|
|
29
|
-
label: ( localize(
|
|
30
|
-
description: ( localize(
|
|
29
|
+
label: ( localize(9337, "None")),
|
|
30
|
+
description: ( localize(9338, "No selection")),
|
|
31
31
|
alwaysShow: true
|
|
32
32
|
};
|
|
33
33
|
function isFormElicitation(params) {
|
|
@@ -79,7 +79,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
79
79
|
if (chatModel instanceof ChatModel) {
|
|
80
80
|
const request = chatModel.getRequests().at(-1);
|
|
81
81
|
if (request) {
|
|
82
|
-
const part = ( new ChatElicitationRequestPart(( localize(
|
|
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 () => {
|
|
83
83
|
const p = this._doElicitForm(elicitation, token);
|
|
84
84
|
resolve(p);
|
|
85
85
|
const result = await p;
|
|
@@ -96,11 +96,11 @@ let McpElicitationService = class McpElicitationService {
|
|
|
96
96
|
} else {
|
|
97
97
|
const handle = this._notificationService.notify({
|
|
98
98
|
message: elicitation.message,
|
|
99
|
-
source: ( localize(
|
|
99
|
+
source: ( localize(9343, "MCP Server ({0})", server.definition.label)),
|
|
100
100
|
severity: Severity.Info,
|
|
101
101
|
actions: {
|
|
102
|
-
primary: [store.add(( new Action("mcp.elicit.give", ( localize(
|
|
103
|
-
secondary: [store.add(( new Action("mcp.elicit.cancel", ( localize(
|
|
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({
|
|
104
104
|
action: "decline"
|
|
105
105
|
}))))]
|
|
106
106
|
}
|
|
@@ -143,7 +143,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
143
143
|
if (chatModel instanceof ChatModel) {
|
|
144
144
|
const request = chatModel.getRequests().at(-1);
|
|
145
145
|
if (request) {
|
|
146
|
-
const part = ( new ChatElicitationRequestPart(( localize(
|
|
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 () => {
|
|
147
147
|
const result = await this._doElicitUrl(elicitation, token);
|
|
148
148
|
resolve(result);
|
|
149
149
|
completePromise.then(() => part.hide());
|
|
@@ -158,12 +158,12 @@ let McpElicitationService = class McpElicitationService {
|
|
|
158
158
|
}
|
|
159
159
|
} else {
|
|
160
160
|
const handle = this._notificationService.notify({
|
|
161
|
-
message: elicitation.message + " " + ( localize(
|
|
162
|
-
source: ( localize(
|
|
161
|
+
message: elicitation.message + " " + ( localize(9349, "This will open {0}", elicitation.url)),
|
|
162
|
+
source: ( localize(9343, "MCP Server ({0})", server.definition.label)),
|
|
163
163
|
severity: Severity.Info,
|
|
164
164
|
actions: {
|
|
165
|
-
primary: [store.add(( new Action("mcp.elicit.url.open2", ( localize(
|
|
166
|
-
secondary: [store.add(( new Action("mcp.elicit.cancel", ( localize(
|
|
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({
|
|
167
167
|
action: "decline"
|
|
168
168
|
}))))]
|
|
169
169
|
}
|
|
@@ -305,7 +305,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
305
305
|
_getFieldPlaceholder(schema, required) {
|
|
306
306
|
let placeholder = schema.description || "";
|
|
307
307
|
if (!required) {
|
|
308
|
-
placeholder = placeholder ? `${placeholder} (${( localize(
|
|
308
|
+
placeholder = placeholder ? `${placeholder} (${( localize(9351, "Optional"))})` : ( localize(9351, "Optional"));
|
|
309
309
|
}
|
|
310
310
|
return placeholder;
|
|
311
311
|
}
|
|
@@ -414,7 +414,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
414
414
|
items.push({
|
|
415
415
|
id: "$default",
|
|
416
416
|
label: `${schema.default}`,
|
|
417
|
-
description: ( localize(
|
|
417
|
+
description: ( localize(9352, "Default value"))
|
|
418
418
|
});
|
|
419
419
|
}
|
|
420
420
|
}
|
|
@@ -483,13 +483,13 @@ let McpElicitationService = class McpElicitationService {
|
|
|
483
483
|
if (schema.minLength && value.length < schema.minLength) {
|
|
484
484
|
return {
|
|
485
485
|
isValid: false,
|
|
486
|
-
message: ( localize(
|
|
486
|
+
message: ( localize(9353, "Minimum length is {0}", schema.minLength))
|
|
487
487
|
};
|
|
488
488
|
}
|
|
489
489
|
if (schema.maxLength && value.length > schema.maxLength) {
|
|
490
490
|
return {
|
|
491
491
|
isValid: false,
|
|
492
|
-
message: ( localize(
|
|
492
|
+
message: ( localize(9354, "Maximum length is {0}", schema.maxLength))
|
|
493
493
|
};
|
|
494
494
|
}
|
|
495
495
|
if (schema.format) {
|
|
@@ -510,7 +510,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
510
510
|
isValid: true
|
|
511
511
|
} : {
|
|
512
512
|
isValid: false,
|
|
513
|
-
message: ( localize(
|
|
513
|
+
message: ( localize(9355, "Please enter a valid email address"))
|
|
514
514
|
};
|
|
515
515
|
case "uri":
|
|
516
516
|
if (URL.canParse(value)) {
|
|
@@ -520,7 +520,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
520
520
|
} else {
|
|
521
521
|
return {
|
|
522
522
|
isValid: false,
|
|
523
|
-
message: ( localize(
|
|
523
|
+
message: ( localize(9356, "Please enter a valid URI"))
|
|
524
524
|
};
|
|
525
525
|
}
|
|
526
526
|
case "date":
|
|
@@ -529,7 +529,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
529
529
|
if (!dateRegex.test(value)) {
|
|
530
530
|
return {
|
|
531
531
|
isValid: false,
|
|
532
|
-
message: ( localize(
|
|
532
|
+
message: ( localize(9357, "Please enter a valid date (YYYY-MM-DD)"))
|
|
533
533
|
};
|
|
534
534
|
}
|
|
535
535
|
const date = ( new Date(value));
|
|
@@ -537,7 +537,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
537
537
|
isValid: true
|
|
538
538
|
} : {
|
|
539
539
|
isValid: false,
|
|
540
|
-
message: ( localize(
|
|
540
|
+
message: ( localize(9357, "Please enter a valid date (YYYY-MM-DD)"))
|
|
541
541
|
};
|
|
542
542
|
}
|
|
543
543
|
case "date-time":
|
|
@@ -547,7 +547,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
547
547
|
isValid: true
|
|
548
548
|
} : {
|
|
549
549
|
isValid: false,
|
|
550
|
-
message: ( localize(
|
|
550
|
+
message: ( localize(9358, "Please enter a valid date-time"))
|
|
551
551
|
};
|
|
552
552
|
}
|
|
553
553
|
default:
|
|
@@ -561,25 +561,25 @@ let McpElicitationService = class McpElicitationService {
|
|
|
561
561
|
if (isNaN(parsed)) {
|
|
562
562
|
return {
|
|
563
563
|
isValid: false,
|
|
564
|
-
message: ( localize(
|
|
564
|
+
message: ( localize(9359, "Please enter a valid number"))
|
|
565
565
|
};
|
|
566
566
|
}
|
|
567
567
|
if (schema.type === "integer" && !Number.isInteger(parsed)) {
|
|
568
568
|
return {
|
|
569
569
|
isValid: false,
|
|
570
|
-
message: ( localize(
|
|
570
|
+
message: ( localize(9360, "Please enter a valid integer"))
|
|
571
571
|
};
|
|
572
572
|
}
|
|
573
573
|
if (schema.minimum !== undefined && parsed < schema.minimum) {
|
|
574
574
|
return {
|
|
575
575
|
isValid: false,
|
|
576
|
-
message: ( localize(
|
|
576
|
+
message: ( localize(9361, "Minimum value is {0}", schema.minimum))
|
|
577
577
|
};
|
|
578
578
|
}
|
|
579
579
|
if (schema.maximum !== undefined && parsed > schema.maximum) {
|
|
580
580
|
return {
|
|
581
581
|
isValid: false,
|
|
582
|
-
message: ( localize(
|
|
582
|
+
message: ( localize(9362, "Maximum value is {0}", schema.maximum))
|
|
583
583
|
};
|
|
584
584
|
}
|
|
585
585
|
return {
|