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:
16
node_modules/playwright/lib/mcp/test/browserBackend.js
generated
vendored
16
node_modules/playwright/lib/mcp/test/browserBackend.js
generated
vendored
@@ -25,13 +25,14 @@ var import_config = require("../browser/config");
|
||||
var import_browserServerBackend = require("../browser/browserServerBackend");
|
||||
var import_tab = require("../browser/tab");
|
||||
var import_util = require("../../util");
|
||||
var import_browserContextFactory = require("../browser/browserContextFactory");
|
||||
function createCustomMessageHandler(testInfo, context) {
|
||||
let backend;
|
||||
return async (data) => {
|
||||
if (data.initialize) {
|
||||
if (backend)
|
||||
throw new Error("MCP backend is already initialized");
|
||||
backend = new import_browserServerBackend.BrowserServerBackend({ ...import_config.defaultConfig, capabilities: ["testing"] }, identityFactory(context));
|
||||
backend = new import_browserServerBackend.BrowserServerBackend({ ...import_config.defaultConfig, capabilities: ["testing"] }, (0, import_browserContextFactory.identityBrowserContextFactory)(context));
|
||||
await backend.initialize(data.initialize.clientInfo);
|
||||
const pausedMessage = await generatePausedMessage(testInfo, context);
|
||||
return { initialize: { pausedMessage } };
|
||||
@@ -73,7 +74,7 @@ async function generatePausedMessage(testInfo, context) {
|
||||
`- Page Title: ${await page.title()}`.trim()
|
||||
);
|
||||
let console = testInfo.errors.length ? await import_tab.Tab.collectConsoleMessages(page) : [];
|
||||
console = console.filter((msg) => !msg.type || msg.type === "error");
|
||||
console = console.filter((msg) => msg.type === "error");
|
||||
if (console.length) {
|
||||
lines.push("- Console Messages:");
|
||||
for (const message of console)
|
||||
@@ -91,17 +92,6 @@ async function generatePausedMessage(testInfo, context) {
|
||||
lines.push(`### Task`, `Try recovering from the error prior to continuing`);
|
||||
return lines.join("\n");
|
||||
}
|
||||
function identityFactory(browserContext) {
|
||||
return {
|
||||
createContext: async (clientInfo, abortSignal, toolName) => {
|
||||
return {
|
||||
browserContext,
|
||||
close: async () => {
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
createCustomMessageHandler
|
||||
|
||||
Reference in New Issue
Block a user