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:
root
2026-02-20 11:31:28 +00:00
parent d01a6179aa
commit b5eb27a827
1690 changed files with 47348 additions and 16848 deletions

View File

@@ -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

View File

@@ -35,7 +35,7 @@ __export(generatorTools_exports, {
module.exports = __toCommonJS(generatorTools_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_bundle = require("../sdk/bundle");
var import_mcpBundle = require("playwright-core/lib/mcpBundle");
var import_testTool = require("./testTool");
var import_testContext = require("./testContext");
const setupPage = (0, import_testTool.defineTestTool)({
@@ -43,10 +43,10 @@ const setupPage = (0, import_testTool.defineTestTool)({
name: "generator_setup_page",
title: "Setup generator page",
description: "Setup the page for test.",
inputSchema: import_bundle.z.object({
plan: import_bundle.z.string().describe("The plan for the test. This should be the actual test plan with all the steps."),
project: import_bundle.z.string().optional().describe('Project to use for setup. For example: "chromium", if no project is provided uses the first project in the config.'),
seedFile: import_bundle.z.string().optional().describe('A seed file contains a single test that is used to setup the page for testing, for example: "tests/seed.spec.ts". If no seed file is provided, a default seed file is created.')
inputSchema: import_mcpBundle.z.object({
plan: import_mcpBundle.z.string().describe("The plan for the test. This should be the actual test plan with all the steps."),
project: import_mcpBundle.z.string().optional().describe('Project to use for setup. For example: "chromium", if no project is provided uses the first project in the config.'),
seedFile: import_mcpBundle.z.string().optional().describe('A seed file contains a single test that is used to setup the page for testing, for example: "tests/seed.spec.ts". If no seed file is provided, a default seed file is created.')
}),
type: "readOnly"
},
@@ -62,7 +62,7 @@ const generatorReadLog = (0, import_testTool.defineTestTool)({
name: "generator_read_log",
title: "Retrieve test log",
description: "Retrieve the performed test log",
inputSchema: import_bundle.z.object({}),
inputSchema: import_mcpBundle.z.object({}),
type: "readOnly"
},
handle: async (context) => {
@@ -80,9 +80,9 @@ const generatorWriteTest = (0, import_testTool.defineTestTool)({
name: "generator_write_test",
title: "Write test",
description: "Write the generated test to the test file",
inputSchema: import_bundle.z.object({
fileName: import_bundle.z.string().describe("The file to write the test to"),
code: import_bundle.z.string().describe("The generated test code")
inputSchema: import_mcpBundle.z.object({
fileName: import_mcpBundle.z.string().describe("The file to write the test to"),
code: import_mcpBundle.z.string().describe("The generated test code")
}),
type: "readOnly"
},

View File

@@ -35,16 +35,16 @@ __export(plannerTools_exports, {
module.exports = __toCommonJS(plannerTools_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_bundle = require("../sdk/bundle");
var import_mcpBundle = require("playwright-core/lib/mcpBundle");
var import_testTool = require("./testTool");
const setupPage = (0, import_testTool.defineTestTool)({
schema: {
name: "planner_setup_page",
title: "Setup planner page",
description: "Setup the page for test planning",
inputSchema: import_bundle.z.object({
project: import_bundle.z.string().optional().describe('Project to use for setup. For example: "chromium", if no project is provided uses the first project in the config.'),
seedFile: import_bundle.z.string().optional().describe('A seed file contains a single test that is used to setup the page for testing, for example: "tests/seed.spec.ts". If no seed file is provided, a default seed file is created.')
inputSchema: import_mcpBundle.z.object({
project: import_mcpBundle.z.string().optional().describe('Project to use for setup. For example: "chromium", if no project is provided uses the first project in the config.'),
seedFile: import_mcpBundle.z.string().optional().describe('A seed file contains a single test that is used to setup the page for testing, for example: "tests/seed.spec.ts". If no seed file is provided, a default seed file is created.')
}),
type: "readOnly"
},
@@ -54,16 +54,18 @@ const setupPage = (0, import_testTool.defineTestTool)({
return { content: [{ type: "text", text: output }], isError: status !== "paused" };
}
});
const planSchema = import_bundle.z.object({
overview: import_bundle.z.string().describe("A brief overview of the application to be tested"),
suites: import_bundle.z.array(import_bundle.z.object({
name: import_bundle.z.string().describe("The name of the suite"),
seedFile: import_bundle.z.string().describe("A seed file that was used to setup the page for testing."),
tests: import_bundle.z.array(import_bundle.z.object({
name: import_bundle.z.string().describe("The name of the test"),
file: import_bundle.z.string().describe('The file the test should be saved to, for example: "tests/<suite-name>/<test-name>.spec.ts".'),
steps: import_bundle.z.array(import_bundle.z.string().describe(`The steps to be executed to perform the test. For example: 'Click on the "Submit" button'`)),
expectedResults: import_bundle.z.array(import_bundle.z.string().describe("The expected results of the steps for test to verify."))
const planSchema = import_mcpBundle.z.object({
overview: import_mcpBundle.z.string().describe("A brief overview of the application to be tested"),
suites: import_mcpBundle.z.array(import_mcpBundle.z.object({
name: import_mcpBundle.z.string().describe("The name of the suite"),
seedFile: import_mcpBundle.z.string().describe("A seed file that was used to setup the page for testing."),
tests: import_mcpBundle.z.array(import_mcpBundle.z.object({
name: import_mcpBundle.z.string().describe("The name of the test"),
file: import_mcpBundle.z.string().describe('The file the test should be saved to, for example: "tests/<suite-name>/<test-name>.spec.ts".'),
steps: import_mcpBundle.z.array(import_mcpBundle.z.object({
perform: import_mcpBundle.z.string().optional().describe(`Action to perform. For example: 'Click on the "Submit" button'.`),
expect: import_mcpBundle.z.string().array().describe(`Expected result of the action where appropriate. For example: 'The page should show the "Thank you for your submission" message'`)
}))
}))
}))
});
@@ -90,8 +92,8 @@ const saveTestPlan = (0, import_testTool.defineTestTool)({
title: "Save test plan as markdown file",
description: "Save the test plan as a markdown file",
inputSchema: planSchema.extend({
name: import_bundle.z.string().describe('The name of the test plan, for example: "Test Plan".'),
fileName: import_bundle.z.string().describe('The file to save the test plan to, for example: "spec/test.plan.md". Relative to the workspace root.')
name: import_mcpBundle.z.string().describe('The name of the test plan, for example: "Test Plan".'),
fileName: import_mcpBundle.z.string().describe('The file to save the test plan to, for example: "spec/test.plan.md". Relative to the workspace root.')
}),
type: "readOnly"
},
@@ -118,12 +120,11 @@ const saveTestPlan = (0, import_testTool.defineTestTool)({
lines.push(`**File:** \`${test.file}\``);
lines.push(``);
lines.push(`**Steps:**`);
for (let k = 0; k < test.steps.length; k++)
lines.push(` ${k + 1}. ${test.steps[k]}`);
lines.push(``);
lines.push(`**Expected Results:**`);
for (const result of test.expectedResults)
lines.push(` - ${result}`);
for (let k = 0; k < test.steps.length; k++) {
lines.push(` ${k + 1}. ${test.steps[k].perform ?? "-"}`);
for (const expect of test.steps[k].expect)
lines.push(` - expect: ${expect}`);
}
}
}
lines.push(``);

View File

@@ -31,15 +31,15 @@ __export(testBackend_exports, {
TestServerBackend: () => TestServerBackend
});
module.exports = __toCommonJS(testBackend_exports);
var import_mcpBundle = require("playwright-core/lib/mcpBundle");
var mcp = __toESM(require("../sdk/exports"));
var import_testContext = require("./testContext");
var testTools = __toESM(require("./testTools.js"));
var generatorTools = __toESM(require("./generatorTools.js"));
var plannerTools = __toESM(require("./plannerTools.js"));
var import_tools = require("../browser/tools");
var import_bundle = require("../sdk/bundle");
class TestServerBackend {
constructor(configOption, options) {
constructor(configPath, options) {
this.name = "Playwright";
this.version = "0.0.1";
this._tools = [
@@ -55,10 +55,10 @@ class TestServerBackend {
...import_tools.browserTools.map((tool) => wrapBrowserTool(tool))
];
this._options = options || {};
this._configOption = configOption;
this._configPath = configPath;
}
async initialize(clientInfo) {
this._context = new import_testContext.TestContext(clientInfo, this._configOption, this._options);
this._context = new import_testContext.TestContext(clientInfo, this._configPath, this._options);
}
async listTools() {
return this._tools.map((tool) => mcp.toMcpTool(tool.schema));
@@ -74,13 +74,13 @@ class TestServerBackend {
}
}
serverClosed() {
void this._context.close();
void this._context?.close();
}
}
const typesWithIntent = ["action", "assertion", "input"];
function wrapBrowserTool(tool) {
const inputSchema = typesWithIntent.includes(tool.schema.type) ? tool.schema.inputSchema.extend({
intent: import_bundle.z.string().describe("The intent of the call, for example the test step description plan idea")
intent: import_mcpBundle.z.string().describe("The intent of the call, for example the test step description plan idea")
}) : tool.schema.inputSchema;
return {
schema: {

View File

@@ -62,7 +62,7 @@ class GeneratorJournal {
const result = [];
result.push(`# Plan`);
result.push(this._plan);
result.push(`# Seed file: ${import_path.default.relative(this._rootPath, this._seed.file)}`);
result.push(`# Seed file: ${(0, import_utils.toPosixPath)(import_path.default.relative(this._rootPath, this._seed.file))}`);
result.push("```ts");
result.push(this._seed.content);
result.push("```");
@@ -172,7 +172,7 @@ class TestContext {
const { testRunner, screen, claimStdio, releaseStdio } = testRunnerAndScreen;
claimStdio();
try {
const setupReporter = new import_list.default({ configDir, screen, includeTestId: true });
const setupReporter = new MCPListReporter({ configDir, screen, includeTestId: true });
const { status: status2 } = await testRunner.runGlobalSetup([setupReporter]);
if (status2 !== "passed")
return { output: testRunnerAndScreen.output.join("\n"), status: status2 };
@@ -191,7 +191,7 @@ class TestContext {
}
};
try {
const reporter = new import_list.default({ configDir, screen, includeTestId: true });
const reporter = new MCPListReporter({ configDir, screen, includeTestId: true });
status = await Promise.race([
testRunner.runTests(reporter, params).then((result) => result.status),
testRunnerAndScreen.waitForTestPaused().then(() => "paused")
@@ -271,6 +271,12 @@ const bestPracticesMarkdown = `
- NEVER! use page.waitForTimeout()
- NEVER! use page.evaluate()
`;
class MCPListReporter extends import_list.default {
async onTestPaused() {
await new Promise(() => {
});
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
GeneratorJournal,

View File

@@ -33,7 +33,7 @@ __export(testTools_exports, {
runTests: () => runTests
});
module.exports = __toCommonJS(testTools_exports);
var import_bundle = require("../sdk/bundle");
var import_mcpBundle = require("playwright-core/lib/mcpBundle");
var import_listModeReporter = __toESM(require("../../reporters/listModeReporter"));
var import_testTool = require("./testTool");
const listTests = (0, import_testTool.defineTestTool)({
@@ -41,7 +41,7 @@ const listTests = (0, import_testTool.defineTestTool)({
name: "test_list",
title: "List tests",
description: "List tests",
inputSchema: import_bundle.z.object({}),
inputSchema: import_mcpBundle.z.object({}),
type: "readOnly"
},
handle: async (context) => {
@@ -56,15 +56,15 @@ const runTests = (0, import_testTool.defineTestTool)({
name: "test_run",
title: "Run tests",
description: "Run tests",
inputSchema: import_bundle.z.object({
locations: import_bundle.z.array(import_bundle.z.string()).optional().describe('Folder, file or location to run: "test/e2e" or "test/e2e/file.spec.ts" or "test/e2e/file.spec.ts:20"'),
projects: import_bundle.z.array(import_bundle.z.string()).optional().describe('Projects to run, projects from playwright.config.ts, by default runs all projects. Running with "chromium" is a good start')
inputSchema: import_mcpBundle.z.object({
locations: import_mcpBundle.z.array(import_mcpBundle.z.string()).optional().describe('Folder, file or location to run: "test/e2e" or "test/e2e/file.spec.ts" or "test/e2e/file.spec.ts:20"'),
projects: import_mcpBundle.z.array(import_mcpBundle.z.string()).optional().describe('Projects to run, projects from playwright.config.ts, by default runs all projects. Running with "chromium" is a good start')
}),
type: "readOnly"
},
handle: async (context, params) => {
const { output } = await context.runTestsWithGlobalSetupAndPossiblePause({
locations: params.locations,
locations: params.locations ?? [],
projects: params.projects,
disableConfigReporters: true
});
@@ -76,10 +76,10 @@ const debugTest = (0, import_testTool.defineTestTool)({
name: "test_debug",
title: "Debug single test",
description: "Debug single test",
inputSchema: import_bundle.z.object({
test: import_bundle.z.object({
id: import_bundle.z.string().describe("Test ID to debug."),
title: import_bundle.z.string().describe("Human readable test title for granting permission to debug the test.")
inputSchema: import_mcpBundle.z.object({
test: import_mcpBundle.z.object({
id: import_mcpBundle.z.string().describe("Test ID to debug."),
title: import_mcpBundle.z.string().describe("Human readable test title for granting permission to debug the test.")
})
}),
type: "readOnly"
@@ -87,6 +87,8 @@ const debugTest = (0, import_testTool.defineTestTool)({
handle: async (context, params) => {
const { output, status } = await context.runTestsWithGlobalSetupAndPossiblePause({
headed: context.computedHeaded,
locations: [],
// we can make this faster by passing the test's location, so we don't need to scan all tests to find the ID
testIds: [params.test.id],
// For automatic recovery
timeout: 0,