chore: separate proxy client from external (#877)

This commit is contained in:
Yury Semikhatsky
2025-08-12 18:05:45 -07:00
committed by GitHub
parent c091a11d76
commit 8572ab300c
4 changed files with 58 additions and 55 deletions

View File

@@ -46,11 +46,9 @@ export class BrowserServerBackend implements ServerBackend {
}
async initialize(server: mcpServer.Server): Promise<void> {
const capabilities = server.getClientCapabilities() as mcpServer.ClientCapabilities;
const capabilities = server.getClientCapabilities();
let rootPath: string | undefined;
if (capabilities.roots && (
server.getClientVersion()?.name === 'Visual Studio Code' ||
server.getClientVersion()?.name === 'Visual Studio Code - Insiders')) {
if (capabilities?.roots) {
const { roots } = await server.listRoots();
const firstRootUri = roots[0]?.uri;
const url = firstRootUri ? new URL(firstRootUri) : undefined;
@@ -89,6 +87,6 @@ export class BrowserServerBackend implements ServerBackend {
}
serverClosed() {
void this._context!.dispose().catch(logUnhandledError);
void this._context?.dispose().catch(logUnhandledError);
}
}