@codingame/monaco-vscode-mcp-service-override 36.2.7 → 37.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.
- package/package.json +2 -2
- package/vscode/src/vs/base/common/jsonRpcProtocol.d.ts +2 -2
- package/vscode/src/vs/platform/mcp/common/allowedMcpServers.d.ts +52 -0
- package/vscode/src/vs/platform/mcp/common/allowedMcpServers.js +180 -0
- package/vscode/src/vs/platform/mcp/common/allowedMcpServersService.d.ts +4 -0
- package/vscode/src/vs/platform/mcp/common/allowedMcpServersService.js +68 -12
- package/vscode/src/vs/platform/mcp/common/mcpGalleryService.d.ts +5 -1
- package/vscode/src/vs/platform/mcp/common/mcpGalleryService.js +200 -92
- package/vscode/src/vs/platform/mcp/common/mcpResourceScannerService.js +3 -2
- package/vscode/src/vs/platform/mcp/common/nativeMcpDiscoveryHelper.d.ts +1 -0
- 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.d.ts +10 -3
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommands.js +357 -121
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.js +25 -25
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.d.ts +11 -1
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.js +409 -145
- 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/mcpServerEditor.js +37 -37
- 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 +18 -18
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js +279 -72
- package/vscode/src/vs/workbench/contrib/mcp/browser/media/mcpServersView.css +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/extensionMcpDiscovery.js +6 -5
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/installedMcpServersDiscovery.js +9 -16
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.js +7 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAdapters.d.ts +14 -6
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAdapters.js +32 -9
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/workspaceDotMcpDiscovery.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/workspaceDotMcpDiscovery.js +20 -6
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/workspaceMcpDiscoveryAdapter.js +9 -5
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpContextKeys.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpEditorAffordanceState.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpEditorAffordanceState.js +36 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpLanguageModelToolContribution.js +6 -6
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js +51 -19
- 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/mcpSandboxService.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSandboxService.js +42 -6
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.js +6 -3
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.js +9 -9
|
@@ -27,8 +27,8 @@ import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/obse
|
|
|
27
27
|
|
|
28
28
|
const noneItem = {
|
|
29
29
|
id: undefined,
|
|
30
|
-
label: ( localize(
|
|
31
|
-
description: ( localize(
|
|
30
|
+
label: ( localize(13665, "None")),
|
|
31
|
+
description: ( localize(13666, "No selection")),
|
|
32
32
|
alwaysShow: true
|
|
33
33
|
};
|
|
34
34
|
function isFormElicitation(params) {
|
|
@@ -117,11 +117,11 @@ let McpElicitationService = class McpElicitationService {
|
|
|
117
117
|
}
|
|
118
118
|
const handle = this._notificationService.notify({
|
|
119
119
|
message: elicitation.message,
|
|
120
|
-
source: ( localize(
|
|
120
|
+
source: ( localize(13667, "MCP Server ({0})", server.definition.label)),
|
|
121
121
|
severity: Severity.Info,
|
|
122
122
|
actions: {
|
|
123
|
-
primary: [store.add(( new Action("mcp.elicit.give", ( localize(
|
|
124
|
-
secondary: [store.add(( new Action("mcp.elicit.cancel", ( localize(
|
|
123
|
+
primary: [store.add(( new Action("mcp.elicit.give", ( localize(13668, "Respond")), undefined, true, () => resolve(this._doElicitForm(elicitation, token)))))],
|
|
124
|
+
secondary: [store.add(( new Action("mcp.elicit.cancel", ( localize(13669, "Cancel")), undefined, true, () => resolve({
|
|
125
125
|
action: "decline"
|
|
126
126
|
}))))]
|
|
127
127
|
}
|
|
@@ -163,7 +163,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
163
163
|
if (chatModel instanceof ChatModel) {
|
|
164
164
|
const request = chatModel.getRequests().at(-1);
|
|
165
165
|
if (request) {
|
|
166
|
-
const part = ( new ChatElicitationRequestPart(( localize(
|
|
166
|
+
const part = ( new ChatElicitationRequestPart(( localize(13670, "Authorization Required")), ( new MarkdownString()).appendText(elicitation.message).appendMarkdown("\n\n" + ( localize(13671, "Open this URL?"))).appendCodeblock("", elicitation.url), ( localize(13672, "{0} (MCP Server)", server.definition.label)), ( localize(13673, "Open {0}", ( URI.parse(elicitation.url)).authority)), ( localize(13674, "Cancel")), async () => {
|
|
167
167
|
const result = await this._doElicitUrl(elicitation, token);
|
|
168
168
|
resolve(result);
|
|
169
169
|
completePromise.then(() => part.hide());
|
|
@@ -178,12 +178,12 @@ let McpElicitationService = class McpElicitationService {
|
|
|
178
178
|
}
|
|
179
179
|
} else {
|
|
180
180
|
const handle = this._notificationService.notify({
|
|
181
|
-
message: elicitation.message + " " + ( localize(
|
|
182
|
-
source: ( localize(
|
|
181
|
+
message: elicitation.message + " " + ( localize(13675, "This will open {0}", elicitation.url)),
|
|
182
|
+
source: ( localize(13667, "MCP Server ({0})", server.definition.label)),
|
|
183
183
|
severity: Severity.Info,
|
|
184
184
|
actions: {
|
|
185
|
-
primary: [store.add(( new Action("mcp.elicit.url.open2", ( localize(
|
|
186
|
-
secondary: [store.add(( new Action("mcp.elicit.cancel", ( localize(
|
|
185
|
+
primary: [store.add(( new Action("mcp.elicit.url.open2", ( localize(13676, "Open URL")), undefined, true, () => resolve(this._doElicitUrl(elicitation, token)))))],
|
|
186
|
+
secondary: [store.add(( new Action("mcp.elicit.cancel", ( localize(13669, "Cancel")), undefined, true, () => resolve({
|
|
187
187
|
action: "decline"
|
|
188
188
|
}))))]
|
|
189
189
|
}
|
|
@@ -325,7 +325,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
325
325
|
_getFieldPlaceholder(schema, required) {
|
|
326
326
|
let placeholder = schema.description || "";
|
|
327
327
|
if (!required) {
|
|
328
|
-
placeholder = placeholder ? `${placeholder} (${( localize(
|
|
328
|
+
placeholder = placeholder ? `${placeholder} (${( localize(13677, "Optional"))})` : ( localize(13677, "Optional"));
|
|
329
329
|
}
|
|
330
330
|
return placeholder;
|
|
331
331
|
}
|
|
@@ -434,7 +434,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
434
434
|
items.push({
|
|
435
435
|
id: "$default",
|
|
436
436
|
label: `${schema.default}`,
|
|
437
|
-
description: ( localize(
|
|
437
|
+
description: ( localize(13678, "Default value"))
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
440
|
}
|
|
@@ -503,13 +503,13 @@ let McpElicitationService = class McpElicitationService {
|
|
|
503
503
|
if (schema.minLength && value.length < schema.minLength) {
|
|
504
504
|
return {
|
|
505
505
|
isValid: false,
|
|
506
|
-
message: ( localize(
|
|
506
|
+
message: ( localize(13679, "Minimum length is {0}", schema.minLength))
|
|
507
507
|
};
|
|
508
508
|
}
|
|
509
509
|
if (schema.maxLength && value.length > schema.maxLength) {
|
|
510
510
|
return {
|
|
511
511
|
isValid: false,
|
|
512
|
-
message: ( localize(
|
|
512
|
+
message: ( localize(13680, "Maximum length is {0}", schema.maxLength))
|
|
513
513
|
};
|
|
514
514
|
}
|
|
515
515
|
if (schema.format) {
|
|
@@ -530,7 +530,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
530
530
|
isValid: true
|
|
531
531
|
} : {
|
|
532
532
|
isValid: false,
|
|
533
|
-
message: ( localize(
|
|
533
|
+
message: ( localize(13681, "Please enter a valid email address"))
|
|
534
534
|
};
|
|
535
535
|
case "uri":
|
|
536
536
|
if (URL.canParse(value)) {
|
|
@@ -540,7 +540,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
540
540
|
} else {
|
|
541
541
|
return {
|
|
542
542
|
isValid: false,
|
|
543
|
-
message: ( localize(
|
|
543
|
+
message: ( localize(13682, "Please enter a valid URI"))
|
|
544
544
|
};
|
|
545
545
|
}
|
|
546
546
|
case "date":
|
|
@@ -549,7 +549,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
549
549
|
if (!dateRegex.test(value)) {
|
|
550
550
|
return {
|
|
551
551
|
isValid: false,
|
|
552
|
-
message: ( localize(
|
|
552
|
+
message: ( localize(13683, "Please enter a valid date (YYYY-MM-DD)"))
|
|
553
553
|
};
|
|
554
554
|
}
|
|
555
555
|
const date = ( new Date(value));
|
|
@@ -557,7 +557,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
557
557
|
isValid: true
|
|
558
558
|
} : {
|
|
559
559
|
isValid: false,
|
|
560
|
-
message: ( localize(
|
|
560
|
+
message: ( localize(13683, "Please enter a valid date (YYYY-MM-DD)"))
|
|
561
561
|
};
|
|
562
562
|
}
|
|
563
563
|
case "date-time":
|
|
@@ -567,7 +567,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
567
567
|
isValid: true
|
|
568
568
|
} : {
|
|
569
569
|
isValid: false,
|
|
570
|
-
message: ( localize(
|
|
570
|
+
message: ( localize(13684, "Please enter a valid date-time"))
|
|
571
571
|
};
|
|
572
572
|
}
|
|
573
573
|
default:
|
|
@@ -581,25 +581,25 @@ let McpElicitationService = class McpElicitationService {
|
|
|
581
581
|
if (isNaN(parsed)) {
|
|
582
582
|
return {
|
|
583
583
|
isValid: false,
|
|
584
|
-
message: ( localize(
|
|
584
|
+
message: ( localize(13685, "Please enter a valid number"))
|
|
585
585
|
};
|
|
586
586
|
}
|
|
587
587
|
if (schema.type === "integer" && !Number.isInteger(parsed)) {
|
|
588
588
|
return {
|
|
589
589
|
isValid: false,
|
|
590
|
-
message: ( localize(
|
|
590
|
+
message: ( localize(13686, "Please enter a valid integer"))
|
|
591
591
|
};
|
|
592
592
|
}
|
|
593
593
|
if (schema.minimum !== undefined && parsed < schema.minimum) {
|
|
594
594
|
return {
|
|
595
595
|
isValid: false,
|
|
596
|
-
message: ( localize(
|
|
596
|
+
message: ( localize(13687, "Minimum value is {0}", schema.minimum))
|
|
597
597
|
};
|
|
598
598
|
}
|
|
599
599
|
if (schema.maximum !== undefined && parsed > schema.maximum) {
|
|
600
600
|
return {
|
|
601
601
|
isValid: false,
|
|
602
|
-
message: ( localize(
|
|
602
|
+
message: ( localize(13688, "Maximum value is {0}", schema.maximum))
|
|
603
603
|
};
|
|
604
604
|
}
|
|
605
605
|
return {
|
|
@@ -628,11 +628,11 @@ let McpElicitationService = class McpElicitationService {
|
|
|
628
628
|
allowFreeformInput: false,
|
|
629
629
|
options: [{
|
|
630
630
|
id: "true",
|
|
631
|
-
label: ( localize(
|
|
631
|
+
label: ( localize(13689, "True")),
|
|
632
632
|
value: "true"
|
|
633
633
|
}, {
|
|
634
634
|
id: "false",
|
|
635
|
-
label: ( localize(
|
|
635
|
+
label: ( localize(13690, "False")),
|
|
636
636
|
value: "false"
|
|
637
637
|
}],
|
|
638
638
|
defaultValue: schema.default !== undefined ? String(schema.default) : undefined
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
2
|
import { ILanguageFeaturesService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/languageFeatures.service";
|
|
3
|
+
import { IAgentHostConnectionsService } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostConnectionsService.service";
|
|
3
4
|
import { IMarkerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/markers/common/markers.service";
|
|
4
5
|
import { ISecretStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/secrets/common/secrets.service";
|
|
5
6
|
import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
|
|
6
7
|
import { IConfigurationResolverService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/configurationResolver/common/configurationResolver.service";
|
|
8
|
+
import { IAgentHostCustomizationService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.service";
|
|
9
|
+
import { IChatWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service";
|
|
7
10
|
import { IMcpRegistry } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service";
|
|
8
11
|
import { IMcpWorkbenchService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service";
|
|
9
12
|
import { IMcpService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service";
|
|
@@ -11,14 +14,21 @@ export declare class McpLanguageFeatures extends Disposable implements IWorkbenc
|
|
|
11
14
|
private readonly _mcpRegistry;
|
|
12
15
|
private readonly _mcpWorkbenchService;
|
|
13
16
|
private readonly _mcpService;
|
|
17
|
+
private readonly _chatWidgetService;
|
|
18
|
+
private readonly _agentHostCustomizationService;
|
|
19
|
+
private readonly _agentHostConnectionsService;
|
|
14
20
|
private readonly _markerService;
|
|
15
21
|
private readonly _configurationResolverService;
|
|
16
22
|
private readonly _secretStorageService;
|
|
17
23
|
private readonly _cachedMcpSection;
|
|
18
|
-
constructor(languageFeaturesService: ILanguageFeaturesService, _mcpRegistry: IMcpRegistry, _mcpWorkbenchService: IMcpWorkbenchService, _mcpService: IMcpService, _markerService: IMarkerService, _configurationResolverService: IConfigurationResolverService, _secretStorageService: ISecretStorageService);
|
|
24
|
+
constructor(languageFeaturesService: ILanguageFeaturesService, _mcpRegistry: IMcpRegistry, _mcpWorkbenchService: IMcpWorkbenchService, _mcpService: IMcpService, _chatWidgetService: IChatWidgetService, _agentHostCustomizationService: IAgentHostCustomizationService, _agentHostConnectionsService: IAgentHostConnectionsService, _markerService: IMarkerService, _configurationResolverService: IConfigurationResolverService, _secretStorageService: ISecretStorageService);
|
|
19
25
|
/** Simple mechanism to avoid extra json parsing for hints+lenses */
|
|
20
26
|
private _parseModel;
|
|
21
27
|
private _addDiagnostics;
|
|
22
28
|
private _provideCodeLenses;
|
|
29
|
+
private _addAgentHostServerCodeLenses;
|
|
30
|
+
private _getOtherRunningAgentHostMcpServerCounts;
|
|
31
|
+
private _toAgentHostSessionResource;
|
|
32
|
+
private _getMcpServersFromSessionState;
|
|
23
33
|
private _provideInlayHints;
|
|
24
34
|
}
|