Add SPA session validation and buglist, update migration docs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-12-03 21:28:08 +00:00
parent 9be3dfc14e
commit cff287e870
24169 changed files with 10223 additions and 7120 deletions

18
node_modules/playwright/lib/mcp/sdk/server.js generated vendored Normal file → Executable file
View File

@@ -41,6 +41,7 @@ var mcpBundle = __toESM(require("./bundle"));
var import_http = require("./http");
var import_inProcessTransport = require("./inProcessTransport");
const serverDebug = (0, import_utilsBundle.debug)("pw:mcp:server");
const serverDebugResponse = (0, import_utilsBundle.debug)("pw:mcp:server:response");
async function connect(factory, transport, runHeartbeat) {
const server = createServer(factory.name, factory.version, factory.create(), runHeartbeat);
await server.connect(transport);
@@ -81,7 +82,10 @@ function createServer(name, version, backend, runHeartbeat) {
if (!initializePromise)
initializePromise = initializeServer(server, backend, runHeartbeat);
await initializePromise;
return mergeTextParts(await backend.callTool(request.params.name, request.params.arguments || {}, progress));
const toolResult = await backend.callTool(request.params.name, request.params.arguments || {}, progress);
const mergedResult = mergeTextParts(toolResult);
serverDebugResponse("callResult", mergedResult);
return mergedResult;
} catch (error) {
return {
content: [{ type: "text", text: "### Result\n" + String(error) }],
@@ -108,7 +112,7 @@ const initializeServer = async (server, backend, runHeartbeat) => {
roots: clientRoots,
timestamp: Date.now()
};
await backend.initialize?.(server, clientInfo);
await backend.initialize?.(clientInfo);
if (runHeartbeat)
startHeartbeat(server);
};
@@ -138,8 +142,7 @@ async function start(serverBackendFactory, options) {
return;
}
const httpServer = await (0, import_http.startHttpServer)(options);
const url = (0, import_http.httpAddressToString)(httpServer.address());
await (0, import_http.installHttpTransport)(httpServer, serverBackendFactory, options.allowedHosts);
const url = await (0, import_http.installHttpTransport)(httpServer, serverBackendFactory, false, options.allowedHosts);
const mcpConfig = { mcpServers: {} };
mcpConfig.mcpServers[serverBackendFactory.nameInConfig] = {
url: `${url}/mcp`
@@ -157,7 +160,12 @@ function firstRootPath(clientInfo) {
return void 0;
const firstRootUri = clientInfo.roots[0]?.uri;
const url = firstRootUri ? new URL(firstRootUri) : void 0;
return url ? (0, import_url.fileURLToPath)(url) : void 0;
try {
return url ? (0, import_url.fileURLToPath)(url) : void 0;
} catch (error) {
serverDebug(error);
return void 0;
}
}
function mergeTextParts(result) {
const content = [];