UNPKG

@codingame/monaco-vscode-extensions-service-override

Version:

VSCode public API plugged on the monaco editor - extensions service-override

62 lines (61 loc) 5.05 kB
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle"; import { URI, UriComponents } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri"; import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service"; import { IDialogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service"; import { LogLevel } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log"; import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service"; import { IWorkbenchMcpGatewayService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpGatewayService.service"; import { IMcpRegistry } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service"; import { McpCollectionDefinition, McpConnectionState, McpServerDefinition } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes"; import { IAuthenticationMcpAccessService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationMcpAccessService.service"; import { IAuthenticationMcpService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationMcpService.service"; import { IAuthenticationMcpUsageService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationMcpUsageService.service"; import { IAuthenticationService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication.service"; import { IDynamicAuthenticationProviderStorageService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/dynamicAuthenticationProviderStorage.service"; import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service"; import { IExtHostContext } from "../../services/extensions/common/extHostCustomers.js"; import { IMcpAuthenticationDetails, IMcpAuthenticationOptions, IAuthMetadataSource, MainThreadMcpShape } from "@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol"; export declare class MainThreadMcp extends Disposable implements MainThreadMcpShape { private readonly _extHostContext; private readonly _mcpRegistry; private readonly dialogService; private readonly _authenticationService; private readonly authenticationMcpServersService; private readonly authenticationMCPServerAccessService; private readonly authenticationMCPServerUsageService; private readonly _dynamicAuthenticationProviderStorageService; private readonly _extensionService; private readonly _contextKeyService; private readonly _telemetryService; private readonly _mcpGatewayService; private _serverIdCounter; private readonly _servers; private readonly _serverDefinitions; private readonly _serverAuthTracking; private readonly _proxy; private readonly _collectionDefinitions; private readonly _gateways; constructor(_extHostContext: IExtHostContext, _mcpRegistry: IMcpRegistry, dialogService: IDialogService, _authenticationService: IAuthenticationService, authenticationMcpServersService: IAuthenticationMcpService, authenticationMCPServerAccessService: IAuthenticationMcpAccessService, authenticationMCPServerUsageService: IAuthenticationMcpUsageService, _dynamicAuthenticationProviderStorageService: IDynamicAuthenticationProviderStorageService, _extensionService: IExtensionService, _contextKeyService: IContextKeyService, _telemetryService: ITelemetryService, _mcpGatewayService: IWorkbenchMcpGatewayService); private _publishServerDefinitions; $upsertMcpCollection(collection: McpCollectionDefinition.FromExtHost, serversDto: McpServerDefinition.Serialized[]): void; $deleteMcpCollection(collectionId: string): void; $onDidChangeState(id: number, update: McpConnectionState): void; $onDidPublishLog(id: number, level: LogLevel, log: string): void; $onDidReceiveMessage(id: number, message: string): void; $getTokenForProviderId(id: number, providerId: string, scopes: string[], options?: IMcpAuthenticationOptions): Promise<string | undefined>; $getTokenFromServerMetadata(id: number, authDetails: IMcpAuthenticationDetails, { errorOnUserInteraction, forceNewRegistration, clientId }?: IMcpAuthenticationOptions): Promise<string | undefined>; private _getSessionForProvider; private continueWithIncorrectAccountPrompt; private _onDidChangeAuthSessions; $logMcpAuthSetup(data: IAuthMetadataSource): void; $startMcpGateway(chatSessionResource?: UriComponents): Promise<{ servers: { label: string; address: URI; }[]; gatewayId: string; } | undefined>; $disposeMcpGateway(gatewayId: string): void; private loginPrompt; dispose(): void; }