Update npm packages (73 packages including @jqhtml 2.3.36)
Update npm registry domain from privatenpm.hanson.xyz to npm.internal.hanson.xyz 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
81
node_modules/playwright/lib/mcp/sdk/bundle.js
generated
vendored
81
node_modules/playwright/lib/mcp/sdk/bundle.js
generated
vendored
@@ -1,81 +0,0 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var bundle_exports = {};
|
||||
__export(bundle_exports, {
|
||||
CallToolRequestSchema: () => CallToolRequestSchema,
|
||||
Client: () => Client,
|
||||
ListRootsRequestSchema: () => ListRootsRequestSchema,
|
||||
ListToolsRequestSchema: () => ListToolsRequestSchema,
|
||||
PingRequestSchema: () => PingRequestSchema,
|
||||
ProgressNotificationSchema: () => ProgressNotificationSchema,
|
||||
SSEClientTransport: () => SSEClientTransport,
|
||||
SSEServerTransport: () => SSEServerTransport,
|
||||
Server: () => Server,
|
||||
StdioClientTransport: () => StdioClientTransport,
|
||||
StdioServerTransport: () => StdioServerTransport,
|
||||
StreamableHTTPClientTransport: () => StreamableHTTPClientTransport,
|
||||
StreamableHTTPServerTransport: () => StreamableHTTPServerTransport,
|
||||
z: () => z,
|
||||
zodToJsonSchema: () => zodToJsonSchema
|
||||
});
|
||||
module.exports = __toCommonJS(bundle_exports);
|
||||
var bundle = __toESM(require("../../mcpBundleImpl"));
|
||||
const zodToJsonSchema = bundle.zodToJsonSchema;
|
||||
const Client = bundle.Client;
|
||||
const Server = bundle.Server;
|
||||
const SSEClientTransport = bundle.SSEClientTransport;
|
||||
const SSEServerTransport = bundle.SSEServerTransport;
|
||||
const StdioClientTransport = bundle.StdioClientTransport;
|
||||
const StdioServerTransport = bundle.StdioServerTransport;
|
||||
const StreamableHTTPServerTransport = bundle.StreamableHTTPServerTransport;
|
||||
const StreamableHTTPClientTransport = bundle.StreamableHTTPClientTransport;
|
||||
const CallToolRequestSchema = bundle.CallToolRequestSchema;
|
||||
const ListRootsRequestSchema = bundle.ListRootsRequestSchema;
|
||||
const ProgressNotificationSchema = bundle.ProgressNotificationSchema;
|
||||
const ListToolsRequestSchema = bundle.ListToolsRequestSchema;
|
||||
const PingRequestSchema = bundle.PingRequestSchema;
|
||||
const z = bundle.z;
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
CallToolRequestSchema,
|
||||
Client,
|
||||
ListRootsRequestSchema,
|
||||
ListToolsRequestSchema,
|
||||
PingRequestSchema,
|
||||
ProgressNotificationSchema,
|
||||
SSEClientTransport,
|
||||
SSEServerTransport,
|
||||
Server,
|
||||
StdioClientTransport,
|
||||
StdioServerTransport,
|
||||
StreamableHTTPClientTransport,
|
||||
StreamableHTTPServerTransport,
|
||||
z,
|
||||
zodToJsonSchema
|
||||
});
|
||||
2
node_modules/playwright/lib/mcp/sdk/exports.js
generated
vendored
2
node_modules/playwright/lib/mcp/sdk/exports.js
generated
vendored
@@ -16,14 +16,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
||||
var exports_exports = {};
|
||||
module.exports = __toCommonJS(exports_exports);
|
||||
__reExport(exports_exports, require("./inProcessTransport"), module.exports);
|
||||
__reExport(exports_exports, require("./proxyBackend"), module.exports);
|
||||
__reExport(exports_exports, require("./server"), module.exports);
|
||||
__reExport(exports_exports, require("./tool"), module.exports);
|
||||
__reExport(exports_exports, require("./http"), module.exports);
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
...require("./inProcessTransport"),
|
||||
...require("./proxyBackend"),
|
||||
...require("./server"),
|
||||
...require("./tool"),
|
||||
...require("./http")
|
||||
|
||||
75
node_modules/playwright/lib/mcp/sdk/http.js
generated
vendored
75
node_modules/playwright/lib/mcp/sdk/http.js
generated
vendored
@@ -28,51 +28,36 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var http_exports = {};
|
||||
__export(http_exports, {
|
||||
httpAddressToString: () => httpAddressToString,
|
||||
installHttpTransport: () => installHttpTransport,
|
||||
startHttpServer: () => startHttpServer
|
||||
addressToString: () => addressToString,
|
||||
startMcpHttpServer: () => startMcpHttpServer
|
||||
});
|
||||
module.exports = __toCommonJS(http_exports);
|
||||
var import_assert = __toESM(require("assert"));
|
||||
var import_http = __toESM(require("http"));
|
||||
var import_crypto = __toESM(require("crypto"));
|
||||
var import_utilsBundle = require("playwright-core/lib/utilsBundle");
|
||||
var mcpBundle = __toESM(require("./bundle"));
|
||||
var mcpBundle = __toESM(require("playwright-core/lib/mcpBundle"));
|
||||
var import_utils = require("playwright-core/lib/utils");
|
||||
var mcpServer = __toESM(require("./server"));
|
||||
const testDebug = (0, import_utilsBundle.debug)("pw:mcp:test");
|
||||
async function startHttpServer(config, abortSignal) {
|
||||
const { host, port } = config;
|
||||
const httpServer = import_http.default.createServer();
|
||||
decorateServer(httpServer);
|
||||
await new Promise((resolve, reject) => {
|
||||
httpServer.on("error", reject);
|
||||
abortSignal?.addEventListener("abort", () => {
|
||||
httpServer.close();
|
||||
reject(new Error("Aborted"));
|
||||
});
|
||||
httpServer.listen(port, host, () => {
|
||||
resolve();
|
||||
httpServer.removeListener("error", reject);
|
||||
});
|
||||
});
|
||||
return httpServer;
|
||||
async function startMcpHttpServer(config, serverBackendFactory, allowedHosts) {
|
||||
const httpServer = (0, import_utils.createHttpServer)();
|
||||
await (0, import_utils.startHttpServer)(httpServer, config);
|
||||
return await installHttpTransport(httpServer, serverBackendFactory, allowedHosts);
|
||||
}
|
||||
function httpAddressToString(address) {
|
||||
function addressToString(address, options) {
|
||||
(0, import_assert.default)(address, "Could not bind server socket");
|
||||
if (typeof address === "string")
|
||||
return address;
|
||||
const resolvedPort = address.port;
|
||||
let resolvedHost = address.family === "IPv4" ? address.address : `[${address.address}]`;
|
||||
if (resolvedHost === "0.0.0.0" || resolvedHost === "[::]")
|
||||
resolvedHost = "localhost";
|
||||
return `http://${resolvedHost}:${resolvedPort}`;
|
||||
throw new Error("Unexpected address type: " + address);
|
||||
let host = address.family === "IPv4" ? address.address : `[${address.address}]`;
|
||||
if (options.normalizeLoopback && (host === "0.0.0.0" || host === "[::]" || host === "[::1]" || host === "127.0.0.1"))
|
||||
host = "localhost";
|
||||
return `${options.protocol}://${host}:${address.port}`;
|
||||
}
|
||||
async function installHttpTransport(httpServer, serverBackendFactory, unguessableUrl, allowedHosts) {
|
||||
const url = httpAddressToString(httpServer.address());
|
||||
async function installHttpTransport(httpServer, serverBackendFactory, allowedHosts) {
|
||||
const url = addressToString(httpServer.address(), { protocol: "http", normalizeLoopback: true });
|
||||
const host = new URL(url).host;
|
||||
allowedHosts = (allowedHosts || [host]).map((h) => h.toLowerCase());
|
||||
const allowAnyHost = allowedHosts.includes("*");
|
||||
const pathPrefix = unguessableUrl ? `/${import_crypto.default.randomUUID()}` : "";
|
||||
const sseSessions = /* @__PURE__ */ new Map();
|
||||
const streamableSessions = /* @__PURE__ */ new Map();
|
||||
httpServer.on("request", async (req, res) => {
|
||||
@@ -87,12 +72,7 @@ async function installHttpTransport(httpServer, serverBackendFactory, unguessabl
|
||||
return res.end("Access is only allowed at " + allowedHosts.join(", "));
|
||||
}
|
||||
}
|
||||
if (!req.url?.startsWith(pathPrefix)) {
|
||||
res.statusCode = 404;
|
||||
return res.end("Not found");
|
||||
}
|
||||
const path = req.url?.slice(pathPrefix.length);
|
||||
const url2 = new URL(`http://localhost${path}`);
|
||||
const url2 = new URL(`http://localhost${req.url}`);
|
||||
if (url2.pathname === "/killkillkill" && req.method === "GET") {
|
||||
res.statusCode = 200;
|
||||
res.end("Killing process");
|
||||
@@ -104,7 +84,7 @@ async function installHttpTransport(httpServer, serverBackendFactory, unguessabl
|
||||
else
|
||||
await handleStreamable(serverBackendFactory, req, res, streamableSessions);
|
||||
});
|
||||
return `${url}${pathPrefix}`;
|
||||
return url;
|
||||
}
|
||||
async function handleSSE(serverBackendFactory, req, res, url, sessions) {
|
||||
if (req.method === "POST") {
|
||||
@@ -165,23 +145,8 @@ async function handleStreamable(serverBackendFactory, req, res, sessions) {
|
||||
res.statusCode = 400;
|
||||
res.end("Invalid request");
|
||||
}
|
||||
function decorateServer(server) {
|
||||
const sockets = /* @__PURE__ */ new Set();
|
||||
server.on("connection", (socket) => {
|
||||
sockets.add(socket);
|
||||
socket.once("close", () => sockets.delete(socket));
|
||||
});
|
||||
const close = server.close;
|
||||
server.close = (callback) => {
|
||||
for (const socket of sockets)
|
||||
socket.destroy();
|
||||
sockets.clear();
|
||||
return close.call(server, callback);
|
||||
};
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
httpAddressToString,
|
||||
installHttpTransport,
|
||||
startHttpServer
|
||||
addressToString,
|
||||
startMcpHttpServer
|
||||
});
|
||||
|
||||
128
node_modules/playwright/lib/mcp/sdk/proxyBackend.js
generated
vendored
128
node_modules/playwright/lib/mcp/sdk/proxyBackend.js
generated
vendored
@@ -1,128 +0,0 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var proxyBackend_exports = {};
|
||||
__export(proxyBackend_exports, {
|
||||
ProxyBackend: () => ProxyBackend
|
||||
});
|
||||
module.exports = __toCommonJS(proxyBackend_exports);
|
||||
var import_utilsBundle = require("playwright-core/lib/utilsBundle");
|
||||
var mcpBundle = __toESM(require("./bundle"));
|
||||
const errorsDebug = (0, import_utilsBundle.debug)("pw:mcp:errors");
|
||||
const { z, zodToJsonSchema } = mcpBundle;
|
||||
class ProxyBackend {
|
||||
constructor(mcpProviders) {
|
||||
this._mcpProviders = mcpProviders;
|
||||
this._contextSwitchTool = this._defineContextSwitchTool();
|
||||
}
|
||||
async initialize(clientInfo) {
|
||||
this._clientInfo = clientInfo;
|
||||
}
|
||||
async listTools() {
|
||||
const currentClient = await this._ensureCurrentClient();
|
||||
const response = await currentClient.listTools();
|
||||
if (this._mcpProviders.length === 1)
|
||||
return response.tools;
|
||||
return [
|
||||
...response.tools,
|
||||
this._contextSwitchTool
|
||||
];
|
||||
}
|
||||
async callTool(name, args) {
|
||||
if (name === this._contextSwitchTool.name)
|
||||
return this._callContextSwitchTool(args);
|
||||
const currentClient = await this._ensureCurrentClient();
|
||||
return await currentClient.callTool({
|
||||
name,
|
||||
arguments: args
|
||||
});
|
||||
}
|
||||
serverClosed() {
|
||||
void this._currentClient?.close().catch(errorsDebug);
|
||||
}
|
||||
async _callContextSwitchTool(params) {
|
||||
try {
|
||||
const factory = this._mcpProviders.find((factory2) => factory2.name === params.name);
|
||||
if (!factory)
|
||||
throw new Error("Unknown connection method: " + params.name);
|
||||
await this._setCurrentClient(factory);
|
||||
return {
|
||||
content: [{ type: "text", text: "### Result\nSuccessfully changed connection method.\n" }]
|
||||
};
|
||||
} catch (error) {
|
||||
return {
|
||||
content: [{ type: "text", text: `### Result
|
||||
Error: ${error}
|
||||
` }],
|
||||
isError: true
|
||||
};
|
||||
}
|
||||
}
|
||||
_defineContextSwitchTool() {
|
||||
return {
|
||||
name: "browser_connect",
|
||||
description: [
|
||||
"Connect to a browser using one of the available methods:",
|
||||
...this._mcpProviders.map((factory) => `- "${factory.name}": ${factory.description}`)
|
||||
].join("\n"),
|
||||
inputSchema: zodToJsonSchema(z.object({
|
||||
name: z.enum(this._mcpProviders.map((factory) => factory.name)).default(this._mcpProviders[0].name).describe("The method to use to connect to the browser")
|
||||
}), { strictUnions: true }),
|
||||
annotations: {
|
||||
title: "Connect to a browser context",
|
||||
readOnlyHint: true,
|
||||
openWorldHint: false
|
||||
}
|
||||
};
|
||||
}
|
||||
async _ensureCurrentClient() {
|
||||
if (this._currentClient)
|
||||
return this._currentClient;
|
||||
return await this._setCurrentClient(this._mcpProviders[0]);
|
||||
}
|
||||
async _setCurrentClient(factory) {
|
||||
await this._currentClient?.close();
|
||||
this._currentClient = void 0;
|
||||
const client = new mcpBundle.Client({ name: "Playwright MCP Proxy", version: "0.0.0" });
|
||||
client.registerCapabilities({
|
||||
roots: {
|
||||
listRoots: true
|
||||
}
|
||||
});
|
||||
client.setRequestHandler(mcpBundle.ListRootsRequestSchema, () => ({ roots: this._clientInfo?.roots || [] }));
|
||||
client.setRequestHandler(mcpBundle.PingRequestSchema, () => ({}));
|
||||
const transport = await factory.connect();
|
||||
await client.connect(transport);
|
||||
this._currentClient = client;
|
||||
return client;
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
ProxyBackend
|
||||
});
|
||||
33
node_modules/playwright/lib/mcp/sdk/server.js
generated
vendored
33
node_modules/playwright/lib/mcp/sdk/server.js
generated
vendored
@@ -28,16 +28,18 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var server_exports = {};
|
||||
__export(server_exports, {
|
||||
allRootPaths: () => allRootPaths,
|
||||
connect: () => connect,
|
||||
createServer: () => createServer,
|
||||
firstRootPath: () => firstRootPath,
|
||||
start: () => start,
|
||||
wrapInClient: () => wrapInClient,
|
||||
wrapInProcess: () => wrapInProcess
|
||||
});
|
||||
module.exports = __toCommonJS(server_exports);
|
||||
var import_url = require("url");
|
||||
var import_utilsBundle = require("playwright-core/lib/utilsBundle");
|
||||
var mcpBundle = __toESM(require("./bundle"));
|
||||
var mcpBundle = __toESM(require("playwright-core/lib/mcpBundle"));
|
||||
var import_http = require("./http");
|
||||
var import_inProcessTransport = require("./inProcessTransport");
|
||||
const serverDebug = (0, import_utilsBundle.debug)("pw:mcp:server");
|
||||
@@ -46,10 +48,18 @@ async function connect(factory, transport, runHeartbeat) {
|
||||
const server = createServer(factory.name, factory.version, factory.create(), runHeartbeat);
|
||||
await server.connect(transport);
|
||||
}
|
||||
async function wrapInProcess(backend) {
|
||||
function wrapInProcess(backend) {
|
||||
const server = createServer("Internal", "0.0.0", backend, false);
|
||||
return new import_inProcessTransport.InProcessTransport(server);
|
||||
}
|
||||
async function wrapInClient(backend, options) {
|
||||
const server = createServer("Internal", "0.0.0", backend, false);
|
||||
const transport = new import_inProcessTransport.InProcessTransport(server);
|
||||
const client = new mcpBundle.Client({ name: options.name, version: options.version });
|
||||
await client.connect(transport);
|
||||
await client.ping();
|
||||
return client;
|
||||
}
|
||||
function createServer(name, version, backend, runHeartbeat) {
|
||||
const server = new mcpBundle.Server({ name, version }, {
|
||||
capabilities: {
|
||||
@@ -141,8 +151,7 @@ async function start(serverBackendFactory, options) {
|
||||
await connect(serverBackendFactory, new mcpBundle.StdioServerTransport(), false);
|
||||
return;
|
||||
}
|
||||
const httpServer = await (0, import_http.startHttpServer)(options);
|
||||
const url = await (0, import_http.installHttpTransport)(httpServer, serverBackendFactory, false, options.allowedHosts);
|
||||
const url = await (0, import_http.startMcpHttpServer)(options, serverBackendFactory, options.allowedHosts);
|
||||
const mcpConfig = { mcpServers: {} };
|
||||
mcpConfig.mcpServers[serverBackendFactory.nameInConfig] = {
|
||||
url: `${url}/mcp`
|
||||
@@ -167,6 +176,20 @@ function firstRootPath(clientInfo) {
|
||||
return void 0;
|
||||
}
|
||||
}
|
||||
function allRootPaths(clientInfo) {
|
||||
const paths = [];
|
||||
for (const root of clientInfo.roots) {
|
||||
try {
|
||||
const url = new URL(root.uri);
|
||||
const path = (0, import_url.fileURLToPath)(url);
|
||||
if (path)
|
||||
paths.push(path);
|
||||
} catch (error) {
|
||||
serverDebug(error);
|
||||
}
|
||||
}
|
||||
return paths;
|
||||
}
|
||||
function mergeTextParts(result) {
|
||||
const content = [];
|
||||
const testParts = [];
|
||||
@@ -190,9 +213,11 @@ function mergeTextParts(result) {
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
allRootPaths,
|
||||
connect,
|
||||
createServer,
|
||||
firstRootPath,
|
||||
start,
|
||||
wrapInClient,
|
||||
wrapInProcess
|
||||
});
|
||||
|
||||
4
node_modules/playwright/lib/mcp/sdk/tool.js
generated
vendored
4
node_modules/playwright/lib/mcp/sdk/tool.js
generated
vendored
@@ -22,13 +22,13 @@ __export(tool_exports, {
|
||||
toMcpTool: () => toMcpTool
|
||||
});
|
||||
module.exports = __toCommonJS(tool_exports);
|
||||
var import_bundle = require("../sdk/bundle");
|
||||
var import_mcpBundle = require("playwright-core/lib/mcpBundle");
|
||||
function toMcpTool(tool) {
|
||||
const readOnly = tool.type === "readOnly" || tool.type === "assertion";
|
||||
return {
|
||||
name: tool.name,
|
||||
description: tool.description,
|
||||
inputSchema: (0, import_bundle.zodToJsonSchema)(tool.inputSchema, { strictUnions: true }),
|
||||
inputSchema: import_mcpBundle.z.toJSONSchema(tool.inputSchema),
|
||||
annotations: {
|
||||
title: tool.title,
|
||||
readOnlyHint: readOnly,
|
||||
|
||||
Reference in New Issue
Block a user