windows shenanigans

This commit is contained in:
Simon Knott
2025-08-21 13:17:32 +02:00
parent dc149c19c0
commit 76ba7f7bb6
2 changed files with 4 additions and 2 deletions

View File

@@ -31,6 +31,8 @@ import { contextFactory } from '../browserContextFactory.js';
import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
import type { ClientVersion, ServerBackend } from '../mcp/server.js';
import type { Root, Tool, CallToolResult, CallToolRequest } from '@modelcontextprotocol/sdk/types.js';
import { fileURLToPath } from 'url';
import path from 'path';
const contextSwitchOptions = z.object({
connectionString: z.string().optional().describe('The connection string to use to connect to the browser'),
@@ -92,7 +94,7 @@ class VSCodeProxyBackend implements ServerBackend {
command: process.execPath,
cwd: process.cwd(),
args: [
new URL('./main.js', import.meta.url).pathname,
path.join(fileURLToPath(import.meta.url), '..', 'main.js'),
JSON.stringify(this._config),
params.connectionString,
params.lib,

View File

@@ -27,7 +27,7 @@ test('browser_connect(vscode) works', async ({ startClient, playwright, browserN
name: 'browser_connect',
arguments: {
connectionString: server.wsEndpoint(),
lib: new URL('./index.js', import.meta.resolve('playwright')).pathname,
lib: import.meta.resolve('playwright'),
}
})).toHaveResponse({
result: 'Successfully connected.'