@codingame/monaco-vscode-mcp-service-override 26.2.2 → 27.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/index.js +8 -2
- package/package.json +2 -2
- package/vscode/src/vs/base/common/jsonRpcProtocol.d.ts +66 -0
- package/vscode/src/vs/base/common/jsonRpcProtocol.js +216 -0
- package/vscode/src/vs/platform/mcp/common/allowedMcpServersService.js +1 -1
- package/vscode/src/vs/platform/mcp/common/mcpGalleryService.js +2 -2
- package/vscode/src/vs/platform/mcp/common/mcpGateway.d.ts +39 -0
- package/vscode/src/vs/platform/mcp/common/mcpGateway.js +6 -0
- package/vscode/src/vs/platform/mcp/common/mcpResourceScannerService.d.ts +2 -1
- package/vscode/src/vs/platform/mcp/common/mcpResourceScannerService.js +12 -6
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcp.contribution.js +15 -5
- 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 +27 -28
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpGatewayService.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpGatewayService.js +34 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpGatewayToolBrokerContribution.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpGatewayToolBrokerContribution.js +15 -0
- 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/mcpServersView.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.js +42 -24
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js +13 -12
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/extensionMcpDiscovery.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/installedMcpServersDiscovery.js +2 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/pluginMcpDiscovery.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/pluginMcpDiscovery.js +106 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpContextKeys.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpGatewayToolBrokerChannel.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpGatewayToolBrokerChannel.js +202 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpLanguageModelToolContribution.js +25 -17
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.d.ts +3 -5
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js +27 -32
- 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 +34 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSandboxService.js +233 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerRequestHandler.d.ts +1 -18
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerRequestHandler.js +88 -142
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.js +9 -9
- package/vscode/src/vs/workbench/services/mcp/browser/mcpWorkbenchManagementService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/mcp/browser/mcpWorkbenchManagementService.js +2 -2
- package/vscode/src/vs/platform/mcp/common/mcpManagementIpc.d.ts +0 -42
- package/vscode/src/vs/platform/mcp/common/mcpManagementIpc.js +0 -105
- package/vscode/src/vs/platform/mcp/common/mcpManagementService.d.ts +0 -130
- package/vscode/src/vs/platform/mcp/common/mcpManagementService.js +0 -665
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.d.ts +0 -259
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.js +0 -1225
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.d.ts +0 -72
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.js +0 -996
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.d.ts +0 -17
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.js +0 -49
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerIcons.d.ts +0 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerIcons.js +0 -12
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.d.ts +0 -88
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.js +0 -464
- package/vscode/src/vs/workbench/contrib/mcp/browser/media/mcpServerEditor.css +0 -94
- package/vscode/src/vs/workbench/services/mcp/common/mcpWorkbenchManagementService.d.ts +0 -87
- package/vscode/src/vs/workbench/services/mcp/common/mcpWorkbenchManagementService.js +0 -702
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
2
|
-
import { EditorInputCapabilities, IUntypedEditorInput } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor";
|
|
3
|
-
import { EditorInput } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor/editorInput";
|
|
4
|
-
import { ThemeIcon } from "@codingame/monaco-vscode-api/vscode/vs/base/common/themables";
|
|
5
|
-
import { IWorkbenchMcpServer } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes";
|
|
6
|
-
export declare class McpServerEditorInput extends EditorInput {
|
|
7
|
-
private _mcpServer;
|
|
8
|
-
static readonly ID = "workbench.mcpServer.input2";
|
|
9
|
-
get typeId(): string;
|
|
10
|
-
get capabilities(): EditorInputCapabilities;
|
|
11
|
-
get resource(): URI;
|
|
12
|
-
constructor(_mcpServer: IWorkbenchMcpServer);
|
|
13
|
-
get mcpServer(): IWorkbenchMcpServer;
|
|
14
|
-
getName(): string;
|
|
15
|
-
getIcon(): ThemeIcon | undefined;
|
|
16
|
-
matches(other: EditorInput | IUntypedEditorInput): boolean;
|
|
17
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
3
|
-
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
4
|
-
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
5
|
-
import { EditorInputCapabilities } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
|
|
6
|
-
import { EditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor/editorInput';
|
|
7
|
-
import { join } from '@codingame/monaco-vscode-api/vscode/vs/base/common/path';
|
|
8
|
-
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
9
|
-
import { registerIcon } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/iconRegistry';
|
|
10
|
-
|
|
11
|
-
const MCPServerEditorIcon = registerIcon("mcp-server-editor-icon", Codicon.mcp, ( localize(9463, "Icon of the MCP Server editor.")));
|
|
12
|
-
class McpServerEditorInput extends EditorInput {
|
|
13
|
-
static {
|
|
14
|
-
this.ID = "workbench.mcpServer.input2";
|
|
15
|
-
}
|
|
16
|
-
get typeId() {
|
|
17
|
-
return McpServerEditorInput.ID;
|
|
18
|
-
}
|
|
19
|
-
get capabilities() {
|
|
20
|
-
return EditorInputCapabilities.Readonly | EditorInputCapabilities.Singleton;
|
|
21
|
-
}
|
|
22
|
-
get resource() {
|
|
23
|
-
return ( URI.from({
|
|
24
|
-
scheme: Schemas.extension,
|
|
25
|
-
path: join(this.mcpServer.id, "mcpServer")
|
|
26
|
-
}));
|
|
27
|
-
}
|
|
28
|
-
constructor(_mcpServer) {
|
|
29
|
-
super();
|
|
30
|
-
this._mcpServer = _mcpServer;
|
|
31
|
-
}
|
|
32
|
-
get mcpServer() {
|
|
33
|
-
return this._mcpServer;
|
|
34
|
-
}
|
|
35
|
-
getName() {
|
|
36
|
-
return localize(9464, "MCP Server: {0}", this._mcpServer.label);
|
|
37
|
-
}
|
|
38
|
-
getIcon() {
|
|
39
|
-
return MCPServerEditorIcon;
|
|
40
|
-
}
|
|
41
|
-
matches(other) {
|
|
42
|
-
if (super.matches(other)) {
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
return other instanceof McpServerEditorInput && this._mcpServer.id === other._mcpServer.id;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export { McpServerEditorInput };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const mcpServerIcon: import("@codingame/monaco-vscode-api/vscode/vs/base/common/themables").ThemeIcon;
|
|
2
|
-
export declare const mcpServerRemoteIcon: import("@codingame/monaco-vscode-api/vscode/vs/base/common/themables").ThemeIcon;
|
|
3
|
-
export declare const mcpServerWorkspaceIcon: import("@codingame/monaco-vscode-api/vscode/vs/base/common/themables").ThemeIcon;
|
|
4
|
-
export declare const mcpStarredIcon: import("@codingame/monaco-vscode-api/vscode/vs/base/common/themables").ThemeIcon;
|
|
5
|
-
export declare const mcpLicenseIcon: import("@codingame/monaco-vscode-api/vscode/vs/base/common/themables").ThemeIcon;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
3
|
-
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
4
|
-
import { registerIcon } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/iconRegistry';
|
|
5
|
-
|
|
6
|
-
const mcpServerIcon = registerIcon("mcp-server", Codicon.mcp, ( localize(9465, "Icon used for the MCP server.")));
|
|
7
|
-
const mcpServerRemoteIcon = registerIcon("mcp-server-remote", Codicon.remote, ( localize(9466, "Icon to indicate that an MCP server is for the remote user scope.")));
|
|
8
|
-
const mcpServerWorkspaceIcon = registerIcon("mcp-server-workspace", Codicon.rootFolder, ( localize(9467, "Icon to indicate that an MCP server is for the workspace scope.")));
|
|
9
|
-
const mcpStarredIcon = registerIcon("mcp-server-starred", Codicon.starFull, ( localize(9468, "Icon shown along with the starred status.")));
|
|
10
|
-
const mcpLicenseIcon = registerIcon("mcp-server-license", Codicon.law, ( localize(9469, "Icon shown along with the license status.")));
|
|
11
|
-
|
|
12
|
-
export { mcpLicenseIcon, mcpServerIcon, mcpServerRemoteIcon, mcpServerWorkspaceIcon, mcpStarredIcon };
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { Disposable, IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
-
import { IHoverService } from "@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service";
|
|
3
|
-
import { IOpenerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service";
|
|
4
|
-
import { IMcpServerContainer, IWorkbenchMcpServer } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes";
|
|
5
|
-
import { IThemeService } from "@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service";
|
|
6
|
-
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
7
|
-
import { McpServerStatusAction } from "./mcpServerActions.js";
|
|
8
|
-
import { ExtensionHoverOptions } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/browser/extensionsWidgets";
|
|
9
|
-
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
10
|
-
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
11
|
-
import { IMarkdownRendererService } from "@codingame/monaco-vscode-api/vscode/vs/platform/markdown/browser/markdownRenderer.service";
|
|
12
|
-
export declare abstract class McpServerWidget extends Disposable implements IMcpServerContainer {
|
|
13
|
-
private _mcpServer;
|
|
14
|
-
get mcpServer(): IWorkbenchMcpServer | null;
|
|
15
|
-
set mcpServer(mcpServer: IWorkbenchMcpServer | null);
|
|
16
|
-
update(): void;
|
|
17
|
-
abstract render(): void;
|
|
18
|
-
}
|
|
19
|
-
export declare function onClick(element: HTMLElement, callback: () => void): IDisposable;
|
|
20
|
-
export declare class McpServerIconWidget extends McpServerWidget {
|
|
21
|
-
private readonly themeService;
|
|
22
|
-
private readonly iconLoadingDisposable;
|
|
23
|
-
private readonly element;
|
|
24
|
-
private readonly iconElement;
|
|
25
|
-
private readonly codiconIconElement;
|
|
26
|
-
private iconUrl;
|
|
27
|
-
constructor(container: HTMLElement, themeService: IThemeService);
|
|
28
|
-
private clear;
|
|
29
|
-
render(): void;
|
|
30
|
-
}
|
|
31
|
-
export declare class PublisherWidget extends McpServerWidget {
|
|
32
|
-
readonly container: HTMLElement;
|
|
33
|
-
private small;
|
|
34
|
-
private readonly hoverService;
|
|
35
|
-
private readonly openerService;
|
|
36
|
-
private element;
|
|
37
|
-
private containerHover;
|
|
38
|
-
private readonly disposables;
|
|
39
|
-
constructor(container: HTMLElement, small: boolean, hoverService: IHoverService, openerService: IOpenerService);
|
|
40
|
-
private clear;
|
|
41
|
-
render(): void;
|
|
42
|
-
}
|
|
43
|
-
export declare class StarredWidget extends McpServerWidget {
|
|
44
|
-
readonly container: HTMLElement;
|
|
45
|
-
private small;
|
|
46
|
-
private readonly disposables;
|
|
47
|
-
constructor(container: HTMLElement, small: boolean);
|
|
48
|
-
private clear;
|
|
49
|
-
render(): void;
|
|
50
|
-
static getCountLabel(starsCount: number): string;
|
|
51
|
-
}
|
|
52
|
-
export declare class LicenseWidget extends McpServerWidget {
|
|
53
|
-
readonly container: HTMLElement;
|
|
54
|
-
private readonly disposables;
|
|
55
|
-
constructor(container: HTMLElement);
|
|
56
|
-
private clear;
|
|
57
|
-
render(): void;
|
|
58
|
-
}
|
|
59
|
-
export declare class McpServerHoverWidget extends McpServerWidget {
|
|
60
|
-
private readonly options;
|
|
61
|
-
private readonly mcpServerStatusAction;
|
|
62
|
-
private readonly hoverService;
|
|
63
|
-
private readonly configurationService;
|
|
64
|
-
private readonly hover;
|
|
65
|
-
constructor(options: ExtensionHoverOptions, mcpServerStatusAction: McpServerStatusAction, hoverService: IHoverService, configurationService: IConfigurationService);
|
|
66
|
-
render(): void;
|
|
67
|
-
private getHoverMarkdown;
|
|
68
|
-
}
|
|
69
|
-
export declare class McpServerScopeBadgeWidget extends McpServerWidget {
|
|
70
|
-
readonly container: HTMLElement;
|
|
71
|
-
private readonly instantiationService;
|
|
72
|
-
private readonly badge;
|
|
73
|
-
private element;
|
|
74
|
-
constructor(container: HTMLElement, instantiationService: IInstantiationService);
|
|
75
|
-
private clear;
|
|
76
|
-
render(): void;
|
|
77
|
-
}
|
|
78
|
-
export declare class McpServerStatusWidget extends McpServerWidget {
|
|
79
|
-
private readonly container;
|
|
80
|
-
private readonly extensionStatusAction;
|
|
81
|
-
private readonly markdownRendererService;
|
|
82
|
-
private readonly renderDisposables;
|
|
83
|
-
private readonly _onDidRender;
|
|
84
|
-
readonly onDidRender: Event<void>;
|
|
85
|
-
constructor(container: HTMLElement, extensionStatusAction: McpServerStatusAction, markdownRendererService: IMarkdownRendererService);
|
|
86
|
-
render(): void;
|
|
87
|
-
}
|
|
88
|
-
export declare const mcpStarredIconColor: string;
|
|
@@ -1,464 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { addDisposableListener, EventType, finalHandler, append, $, reset } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
4
|
-
import { StandardKeyboardEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/keyboardEvent';
|
|
5
|
-
import { getDefaultHoverDelegate } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
6
|
-
import { renderIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/iconLabel/iconLabels';
|
|
7
|
-
import { KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
8
|
-
import { Disposable, DisposableStore, MutableDisposable, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
9
|
-
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
10
|
-
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
11
|
-
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
12
|
-
import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
|
|
13
|
-
import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
|
|
14
|
-
import { verifiedPublisherIcon } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensionManagement/common/extensionsIcons';
|
|
15
|
-
import { McpServerInstallState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
|
|
16
|
-
import { registerThemingParticipant } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService';
|
|
17
|
-
import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
|
|
18
|
-
import { isDark } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/theme';
|
|
19
|
-
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
20
|
-
import { mcpServerIcon, mcpStarredIcon, mcpLicenseIcon, mcpServerWorkspaceIcon, mcpServerRemoteIcon } from './mcpServerIcons.js';
|
|
21
|
-
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
22
|
-
import { ExtensionIconBadge } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/browser/extensionsWidgets';
|
|
23
|
-
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
24
|
-
import { LocalMcpServerScope } from '../../../services/mcp/common/mcpWorkbenchManagementService.js';
|
|
25
|
-
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
26
|
-
import { registerColor } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colorUtils';
|
|
27
|
-
import { textLinkForeground } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/baseColors';
|
|
28
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/chartsColors';
|
|
29
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/editorColors';
|
|
30
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/inputColors';
|
|
31
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/listColors';
|
|
32
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/menuColors';
|
|
33
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/minimapColors';
|
|
34
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/miscColors';
|
|
35
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/quickpickColors';
|
|
36
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/searchColors';
|
|
37
|
-
import { IMarkdownRendererService } from '@codingame/monaco-vscode-api/vscode/vs/platform/markdown/browser/markdownRenderer.service';
|
|
38
|
-
|
|
39
|
-
class McpServerWidget extends Disposable {
|
|
40
|
-
constructor() {
|
|
41
|
-
super(...arguments);
|
|
42
|
-
this._mcpServer = null;
|
|
43
|
-
}
|
|
44
|
-
get mcpServer() {
|
|
45
|
-
return this._mcpServer;
|
|
46
|
-
}
|
|
47
|
-
set mcpServer(mcpServer) {
|
|
48
|
-
this._mcpServer = mcpServer;
|
|
49
|
-
this.update();
|
|
50
|
-
}
|
|
51
|
-
update() {
|
|
52
|
-
this.render();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function onClick(element, callback) {
|
|
56
|
-
const disposables = ( new DisposableStore());
|
|
57
|
-
disposables.add(
|
|
58
|
-
addDisposableListener(element, EventType.CLICK, finalHandler(callback))
|
|
59
|
-
);
|
|
60
|
-
disposables.add(addDisposableListener(element, EventType.KEY_UP, e => {
|
|
61
|
-
const keyboardEvent = ( new StandardKeyboardEvent(e));
|
|
62
|
-
if (keyboardEvent.equals(KeyCode.Space) || keyboardEvent.equals(KeyCode.Enter)) {
|
|
63
|
-
e.preventDefault();
|
|
64
|
-
e.stopPropagation();
|
|
65
|
-
callback();
|
|
66
|
-
}
|
|
67
|
-
}));
|
|
68
|
-
return disposables;
|
|
69
|
-
}
|
|
70
|
-
let McpServerIconWidget = class McpServerIconWidget extends McpServerWidget {
|
|
71
|
-
constructor(container, themeService) {
|
|
72
|
-
super();
|
|
73
|
-
this.themeService = themeService;
|
|
74
|
-
this.iconLoadingDisposable = this._register(( new MutableDisposable()));
|
|
75
|
-
this.element = append(container, $(".extension-icon"));
|
|
76
|
-
this.iconElement = append(this.element, $("img.icon", {
|
|
77
|
-
alt: ""
|
|
78
|
-
}));
|
|
79
|
-
this.iconElement.style.display = "none";
|
|
80
|
-
this.codiconIconElement = append(this.element, $(ThemeIcon.asCSSSelector(mcpServerIcon)));
|
|
81
|
-
this.codiconIconElement.style.display = "none";
|
|
82
|
-
this.render();
|
|
83
|
-
this._register(toDisposable(() => this.clear()));
|
|
84
|
-
this._register(this.themeService.onDidColorThemeChange(() => this.render()));
|
|
85
|
-
}
|
|
86
|
-
clear() {
|
|
87
|
-
this.iconUrl = undefined;
|
|
88
|
-
this.iconElement.src = "";
|
|
89
|
-
this.iconElement.style.display = "none";
|
|
90
|
-
this.codiconIconElement.style.display = "none";
|
|
91
|
-
this.codiconIconElement.className = ThemeIcon.asClassName(mcpServerIcon);
|
|
92
|
-
this.iconLoadingDisposable.clear();
|
|
93
|
-
}
|
|
94
|
-
render() {
|
|
95
|
-
if (!this.mcpServer) {
|
|
96
|
-
this.clear();
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
if (this.mcpServer.icon) {
|
|
100
|
-
const type = this.themeService.getColorTheme().type;
|
|
101
|
-
const iconUrl = isDark(type) ? this.mcpServer.icon.dark : this.mcpServer.icon.light;
|
|
102
|
-
if (this.iconUrl !== iconUrl) {
|
|
103
|
-
this.iconElement.style.display = "inherit";
|
|
104
|
-
this.codiconIconElement.style.display = "none";
|
|
105
|
-
this.iconUrl = iconUrl;
|
|
106
|
-
this.iconLoadingDisposable.value = addDisposableListener(this.iconElement, "error", () => {
|
|
107
|
-
this.iconElement.style.display = "none";
|
|
108
|
-
this.codiconIconElement.style.display = "inherit";
|
|
109
|
-
}, {
|
|
110
|
-
once: true
|
|
111
|
-
});
|
|
112
|
-
this.iconElement.src = this.iconUrl;
|
|
113
|
-
if (!this.iconElement.complete) {
|
|
114
|
-
this.iconElement.style.visibility = "hidden";
|
|
115
|
-
this.iconElement.onload = () => this.iconElement.style.visibility = "inherit";
|
|
116
|
-
} else {
|
|
117
|
-
this.iconElement.style.visibility = "inherit";
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
} else {
|
|
121
|
-
this.iconUrl = undefined;
|
|
122
|
-
this.iconElement.style.display = "none";
|
|
123
|
-
this.iconElement.src = "";
|
|
124
|
-
this.codiconIconElement.className = this.mcpServer.codicon ? `codicon ${this.mcpServer.codicon}` : ThemeIcon.asClassName(mcpServerIcon);
|
|
125
|
-
this.codiconIconElement.style.display = "inherit";
|
|
126
|
-
this.iconLoadingDisposable.clear();
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
McpServerIconWidget = ( __decorate([( __param(1, IThemeService))], McpServerIconWidget));
|
|
131
|
-
let PublisherWidget = class PublisherWidget extends McpServerWidget {
|
|
132
|
-
constructor(container, small, hoverService, openerService) {
|
|
133
|
-
super();
|
|
134
|
-
this.container = container;
|
|
135
|
-
this.small = small;
|
|
136
|
-
this.hoverService = hoverService;
|
|
137
|
-
this.openerService = openerService;
|
|
138
|
-
this.disposables = this._register(( new DisposableStore()));
|
|
139
|
-
this.render();
|
|
140
|
-
this._register(toDisposable(() => this.clear()));
|
|
141
|
-
}
|
|
142
|
-
clear() {
|
|
143
|
-
this.element?.remove();
|
|
144
|
-
this.disposables.clear();
|
|
145
|
-
}
|
|
146
|
-
render() {
|
|
147
|
-
this.clear();
|
|
148
|
-
if (!this.mcpServer?.publisherDisplayName) {
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
this.element = append(this.container, $(".publisher"));
|
|
152
|
-
const publisherDisplayName = $(".publisher-name.ellipsis");
|
|
153
|
-
publisherDisplayName.textContent = this.mcpServer.publisherDisplayName;
|
|
154
|
-
const verifiedPublisher = $(".verified-publisher");
|
|
155
|
-
append(
|
|
156
|
-
verifiedPublisher,
|
|
157
|
-
$("span.extension-verified-publisher.clickable"),
|
|
158
|
-
renderIcon(verifiedPublisherIcon)
|
|
159
|
-
);
|
|
160
|
-
if (this.small) {
|
|
161
|
-
if (this.mcpServer.gallery?.publisherDomain?.verified) {
|
|
162
|
-
append(this.element, verifiedPublisher);
|
|
163
|
-
}
|
|
164
|
-
append(this.element, publisherDisplayName);
|
|
165
|
-
} else {
|
|
166
|
-
this.element.classList.toggle("clickable", !!this.mcpServer.gallery?.publisherUrl);
|
|
167
|
-
this.element.setAttribute("role", "button");
|
|
168
|
-
this.element.tabIndex = 0;
|
|
169
|
-
this.containerHover = this.disposables.add(
|
|
170
|
-
this.hoverService.setupManagedHover(getDefaultHoverDelegate("mouse"), this.element, ( localize(9470, "Publisher ({0})", this.mcpServer.publisherDisplayName)))
|
|
171
|
-
);
|
|
172
|
-
append(this.element, publisherDisplayName);
|
|
173
|
-
if (this.mcpServer.gallery?.publisherDomain?.verified) {
|
|
174
|
-
append(this.element, verifiedPublisher);
|
|
175
|
-
const publisherDomainLink = ( URI.parse(this.mcpServer.gallery?.publisherDomain.link));
|
|
176
|
-
verifiedPublisher.tabIndex = 0;
|
|
177
|
-
verifiedPublisher.setAttribute("role", "button");
|
|
178
|
-
this.containerHover.update(( localize(
|
|
179
|
-
9471,
|
|
180
|
-
"This publisher has verified ownership of {0}",
|
|
181
|
-
this.mcpServer.gallery?.publisherDomain.link
|
|
182
|
-
)));
|
|
183
|
-
verifiedPublisher.setAttribute("role", "link");
|
|
184
|
-
append(verifiedPublisher, $(
|
|
185
|
-
"span.extension-verified-publisher-domain",
|
|
186
|
-
undefined,
|
|
187
|
-
publisherDomainLink.authority.startsWith("www.") ? publisherDomainLink.authority.substring(4) : publisherDomainLink.authority
|
|
188
|
-
));
|
|
189
|
-
this.disposables.add(
|
|
190
|
-
onClick(verifiedPublisher, () => this.openerService.open(publisherDomainLink))
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
if (this.mcpServer.gallery?.publisherUrl) {
|
|
194
|
-
this.disposables.add(onClick(
|
|
195
|
-
this.element,
|
|
196
|
-
() => this.openerService.open(this.mcpServer?.gallery?.publisherUrl)
|
|
197
|
-
));
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
PublisherWidget = ( __decorate([( __param(2, IHoverService)), ( __param(3, IOpenerService))], PublisherWidget));
|
|
203
|
-
class StarredWidget extends McpServerWidget {
|
|
204
|
-
constructor(container, small) {
|
|
205
|
-
super();
|
|
206
|
-
this.container = container;
|
|
207
|
-
this.small = small;
|
|
208
|
-
this.disposables = this._register(( new DisposableStore()));
|
|
209
|
-
this.container.classList.add("extension-ratings");
|
|
210
|
-
if (this.small) {
|
|
211
|
-
container.classList.add("small");
|
|
212
|
-
}
|
|
213
|
-
this.render();
|
|
214
|
-
this._register(toDisposable(() => this.clear()));
|
|
215
|
-
}
|
|
216
|
-
clear() {
|
|
217
|
-
this.container.innerText = "";
|
|
218
|
-
this.disposables.clear();
|
|
219
|
-
}
|
|
220
|
-
render() {
|
|
221
|
-
this.clear();
|
|
222
|
-
if (!this.mcpServer?.starsCount) {
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
if (this.small && this.mcpServer.installState !== McpServerInstallState.Uninstalled) {
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
const parent = this.small ? this.container : append(this.container, $("span.rating", {
|
|
229
|
-
tabIndex: 0
|
|
230
|
-
}));
|
|
231
|
-
append(parent, $("span" + ThemeIcon.asCSSSelector(mcpStarredIcon)));
|
|
232
|
-
const ratingCountElement = append(parent, $(
|
|
233
|
-
"span.count",
|
|
234
|
-
undefined,
|
|
235
|
-
StarredWidget.getCountLabel(this.mcpServer.starsCount)
|
|
236
|
-
));
|
|
237
|
-
if (!this.small) {
|
|
238
|
-
ratingCountElement.style.paddingLeft = "3px";
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
static getCountLabel(starsCount) {
|
|
242
|
-
if (starsCount > 1000000) {
|
|
243
|
-
return `${Math.floor(starsCount / 100000) / 10}M`;
|
|
244
|
-
} else if (starsCount > 1000) {
|
|
245
|
-
return `${Math.floor(starsCount / 1000)}K`;
|
|
246
|
-
} else {
|
|
247
|
-
return String(starsCount);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
class LicenseWidget extends McpServerWidget {
|
|
252
|
-
constructor(container) {
|
|
253
|
-
super();
|
|
254
|
-
this.container = container;
|
|
255
|
-
this.disposables = this._register(( new DisposableStore()));
|
|
256
|
-
this.container.classList.add("license");
|
|
257
|
-
this.render();
|
|
258
|
-
this._register(toDisposable(() => this.clear()));
|
|
259
|
-
}
|
|
260
|
-
clear() {
|
|
261
|
-
this.container.innerText = "";
|
|
262
|
-
this.disposables.clear();
|
|
263
|
-
}
|
|
264
|
-
render() {
|
|
265
|
-
this.clear();
|
|
266
|
-
if (!this.mcpServer?.license) {
|
|
267
|
-
return;
|
|
268
|
-
}
|
|
269
|
-
const parent = append(this.container, $("span.license", {
|
|
270
|
-
tabIndex: 0
|
|
271
|
-
}));
|
|
272
|
-
append(parent, $("span" + ThemeIcon.asCSSSelector(mcpLicenseIcon)));
|
|
273
|
-
const licenseElement = append(parent, $("span", undefined, this.mcpServer.license));
|
|
274
|
-
licenseElement.style.paddingLeft = "3px";
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
let McpServerHoverWidget = class McpServerHoverWidget extends McpServerWidget {
|
|
278
|
-
constructor(options, mcpServerStatusAction, hoverService, configurationService) {
|
|
279
|
-
super();
|
|
280
|
-
this.options = options;
|
|
281
|
-
this.mcpServerStatusAction = mcpServerStatusAction;
|
|
282
|
-
this.hoverService = hoverService;
|
|
283
|
-
this.configurationService = configurationService;
|
|
284
|
-
this.hover = this._register(( new MutableDisposable()));
|
|
285
|
-
}
|
|
286
|
-
render() {
|
|
287
|
-
this.hover.value = undefined;
|
|
288
|
-
if (this.mcpServer) {
|
|
289
|
-
this.hover.value = this.hoverService.setupManagedHover({
|
|
290
|
-
delay: this.configurationService.getValue("workbench.hover.delay"),
|
|
291
|
-
showHover: (options, focus) => {
|
|
292
|
-
return this.hoverService.showInstantHover({
|
|
293
|
-
...options,
|
|
294
|
-
additionalClasses: ["extension-hover"],
|
|
295
|
-
position: {
|
|
296
|
-
hoverPosition: this.options.position(),
|
|
297
|
-
forcePosition: true
|
|
298
|
-
},
|
|
299
|
-
persistence: {
|
|
300
|
-
hideOnKeyDown: true
|
|
301
|
-
}
|
|
302
|
-
}, focus);
|
|
303
|
-
},
|
|
304
|
-
placement: "element"
|
|
305
|
-
}, this.options.target, {
|
|
306
|
-
markdown: () => Promise.resolve(this.getHoverMarkdown()),
|
|
307
|
-
markdownNotSupportedFallback: undefined
|
|
308
|
-
}, {
|
|
309
|
-
appearance: {
|
|
310
|
-
showHoverHint: true
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
getHoverMarkdown() {
|
|
316
|
-
if (!this.mcpServer) {
|
|
317
|
-
return undefined;
|
|
318
|
-
}
|
|
319
|
-
const markdown = ( new MarkdownString("", {
|
|
320
|
-
isTrusted: true,
|
|
321
|
-
supportThemeIcons: true
|
|
322
|
-
}));
|
|
323
|
-
markdown.appendMarkdown(`**${this.mcpServer.label}**`);
|
|
324
|
-
markdown.appendText(`\n`);
|
|
325
|
-
let addSeparator = false;
|
|
326
|
-
if (this.mcpServer.local?.scope === LocalMcpServerScope.Workspace) {
|
|
327
|
-
markdown.appendMarkdown(`$(${mcpServerWorkspaceIcon.id}) `);
|
|
328
|
-
markdown.appendMarkdown(( localize(9472, "Workspace MCP Server")));
|
|
329
|
-
addSeparator = true;
|
|
330
|
-
}
|
|
331
|
-
if (this.mcpServer.local?.scope === LocalMcpServerScope.RemoteUser) {
|
|
332
|
-
markdown.appendMarkdown(`$(${mcpServerRemoteIcon.id}) `);
|
|
333
|
-
markdown.appendMarkdown(( localize(9473, "Remote MCP Server")));
|
|
334
|
-
addSeparator = true;
|
|
335
|
-
}
|
|
336
|
-
if (this.mcpServer.installState === McpServerInstallState.Installed) {
|
|
337
|
-
if (this.mcpServer.starsCount) {
|
|
338
|
-
if (addSeparator) {
|
|
339
|
-
markdown.appendText(` | `);
|
|
340
|
-
}
|
|
341
|
-
const starsCountLabel = StarredWidget.getCountLabel(this.mcpServer.starsCount);
|
|
342
|
-
markdown.appendMarkdown(`$(${mcpStarredIcon.id}) ${starsCountLabel}`);
|
|
343
|
-
addSeparator = true;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
if (addSeparator) {
|
|
347
|
-
markdown.appendText(`\n`);
|
|
348
|
-
}
|
|
349
|
-
if (this.mcpServer.description) {
|
|
350
|
-
markdown.appendMarkdown(`${this.mcpServer.description}`);
|
|
351
|
-
}
|
|
352
|
-
const extensionStatus = this.mcpServerStatusAction.status;
|
|
353
|
-
if (extensionStatus.length) {
|
|
354
|
-
markdown.appendMarkdown(`---`);
|
|
355
|
-
markdown.appendText(`\n`);
|
|
356
|
-
for (const status of extensionStatus) {
|
|
357
|
-
if (status.icon) {
|
|
358
|
-
markdown.appendMarkdown(`$(${status.icon.id}) `);
|
|
359
|
-
}
|
|
360
|
-
markdown.appendMarkdown(status.message.value);
|
|
361
|
-
markdown.appendText(`\n`);
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
return markdown;
|
|
365
|
-
}
|
|
366
|
-
};
|
|
367
|
-
McpServerHoverWidget = ( __decorate([( __param(2, IHoverService)), ( __param(3, IConfigurationService))], McpServerHoverWidget));
|
|
368
|
-
let McpServerScopeBadgeWidget = class McpServerScopeBadgeWidget extends McpServerWidget {
|
|
369
|
-
constructor(container, instantiationService) {
|
|
370
|
-
super();
|
|
371
|
-
this.container = container;
|
|
372
|
-
this.instantiationService = instantiationService;
|
|
373
|
-
this.badge = this._register(( new MutableDisposable()));
|
|
374
|
-
this.element = append(this.container, $(""));
|
|
375
|
-
this.render();
|
|
376
|
-
this._register(toDisposable(() => this.clear()));
|
|
377
|
-
}
|
|
378
|
-
clear() {
|
|
379
|
-
this.badge.value?.element.remove();
|
|
380
|
-
this.badge.clear();
|
|
381
|
-
}
|
|
382
|
-
render() {
|
|
383
|
-
this.clear();
|
|
384
|
-
const scope = this.mcpServer?.local?.scope;
|
|
385
|
-
if (!scope || scope === LocalMcpServerScope.User) {
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
|
-
let icon;
|
|
389
|
-
switch (scope) {
|
|
390
|
-
case LocalMcpServerScope.Workspace:
|
|
391
|
-
{
|
|
392
|
-
icon = mcpServerWorkspaceIcon;
|
|
393
|
-
break;
|
|
394
|
-
}
|
|
395
|
-
case LocalMcpServerScope.RemoteUser:
|
|
396
|
-
{
|
|
397
|
-
icon = mcpServerRemoteIcon;
|
|
398
|
-
break;
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
this.badge.value = this.instantiationService.createInstance(ExtensionIconBadge, icon, undefined);
|
|
402
|
-
append(this.element, this.badge.value.element);
|
|
403
|
-
}
|
|
404
|
-
};
|
|
405
|
-
McpServerScopeBadgeWidget = ( __decorate([( __param(1, IInstantiationService))], McpServerScopeBadgeWidget));
|
|
406
|
-
let McpServerStatusWidget = class McpServerStatusWidget extends McpServerWidget {
|
|
407
|
-
constructor(container, extensionStatusAction, markdownRendererService) {
|
|
408
|
-
super();
|
|
409
|
-
this.container = container;
|
|
410
|
-
this.extensionStatusAction = extensionStatusAction;
|
|
411
|
-
this.markdownRendererService = markdownRendererService;
|
|
412
|
-
this.renderDisposables = this._register(( new MutableDisposable()));
|
|
413
|
-
this._onDidRender = this._register(( new Emitter()));
|
|
414
|
-
this.onDidRender = this._onDidRender.event;
|
|
415
|
-
this.render();
|
|
416
|
-
this._register(extensionStatusAction.onDidChangeStatus(() => this.render()));
|
|
417
|
-
}
|
|
418
|
-
render() {
|
|
419
|
-
reset(this.container);
|
|
420
|
-
this.renderDisposables.value = undefined;
|
|
421
|
-
const disposables = ( new DisposableStore());
|
|
422
|
-
this.renderDisposables.value = disposables;
|
|
423
|
-
const extensionStatus = this.extensionStatusAction.status;
|
|
424
|
-
if (extensionStatus.length) {
|
|
425
|
-
const markdown = ( new MarkdownString("", {
|
|
426
|
-
isTrusted: true,
|
|
427
|
-
supportThemeIcons: true
|
|
428
|
-
}));
|
|
429
|
-
for (let i = 0; i < extensionStatus.length; i++) {
|
|
430
|
-
const status = extensionStatus[i];
|
|
431
|
-
if (status.icon) {
|
|
432
|
-
markdown.appendMarkdown(`$(${status.icon.id}) `);
|
|
433
|
-
}
|
|
434
|
-
markdown.appendMarkdown(status.message.value);
|
|
435
|
-
if (i < extensionStatus.length - 1) {
|
|
436
|
-
markdown.appendText(`\n`);
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
const rendered = disposables.add(this.markdownRendererService.render(markdown));
|
|
440
|
-
append(this.container, rendered.element);
|
|
441
|
-
}
|
|
442
|
-
this._onDidRender.fire();
|
|
443
|
-
}
|
|
444
|
-
};
|
|
445
|
-
McpServerStatusWidget = ( __decorate([( __param(2, IMarkdownRendererService))], McpServerStatusWidget));
|
|
446
|
-
const mcpStarredIconColor = registerColor("mcpIcon.starForeground", {
|
|
447
|
-
light: "#DF6100",
|
|
448
|
-
dark: "#FF8E00",
|
|
449
|
-
hcDark: "#FF8E00",
|
|
450
|
-
hcLight: textLinkForeground
|
|
451
|
-
}, ( localize(9474, "The icon color for mcp starred.")), false);
|
|
452
|
-
registerThemingParticipant((theme, collector) => {
|
|
453
|
-
const mcpStarredIconColorValue = theme.getColor(mcpStarredIconColor);
|
|
454
|
-
if (mcpStarredIconColorValue) {
|
|
455
|
-
collector.addRule(
|
|
456
|
-
`.extension-ratings .codicon-mcp-server-starred { color: ${mcpStarredIconColorValue}; }`
|
|
457
|
-
);
|
|
458
|
-
collector.addRule(
|
|
459
|
-
`.monaco-hover.extension-hover .markdown-hover .hover-contents ${ThemeIcon.asCSSSelector(mcpStarredIcon)} { color: ${mcpStarredIconColorValue}; }`
|
|
460
|
-
);
|
|
461
|
-
}
|
|
462
|
-
});
|
|
463
|
-
|
|
464
|
-
export { LicenseWidget, McpServerHoverWidget, McpServerIconWidget, McpServerScopeBadgeWidget, McpServerStatusWidget, McpServerWidget, PublisherWidget, StarredWidget, mcpStarredIconColor, onClick };
|