Path: blob/main/src/vs/workbench/services/mcp/browser/mcpGalleryManifestService.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { IMcpGalleryManifestService } from '../../../../platform/mcp/common/mcpGalleryManifest.js';6import { McpGalleryManifestService as McpGalleryManifestService } from '../../../../platform/mcp/common/mcpGalleryManifestService.js';7import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';8import { IProductService } from '../../../../platform/product/common/productService.js';9import { IRemoteAgentService } from '../../remote/common/remoteAgentService.js';1011class WebMcpGalleryManifestService extends McpGalleryManifestService implements IMcpGalleryManifestService {1213constructor(14@IProductService productService: IProductService,15@IRemoteAgentService remoteAgentService: IRemoteAgentService,16) {17super(productService);18const remoteConnection = remoteAgentService.getConnection();19if (remoteConnection) {20const channel = remoteConnection.getChannel('mcpGalleryManifest');21this.getMcpGalleryManifest().then(manifest => {22channel.call('setMcpGalleryManifest', [manifest]);23this._register(this.onDidChangeMcpGalleryManifest(manifest => channel.call('setMcpGalleryManifest', [manifest])));24});25}26}2728}2930registerSingleton(IMcpGalleryManifestService, WebMcpGalleryManifestService, InstantiationType.Delayed);313233