@cotestdev/mcp_playwright 0.0.40 → 0.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,7 +35,6 @@ var import_vm = __toESM(require("vm"));
35
35
  var import_utils = require("playwright-core/lib/utils");
36
36
  var import_test = require("playwright/test");
37
37
  var import_mcpBundle = require("../../../mcpBundle");
38
- var import_ai_runner_fake = require("@cotestdev/ai-runner-fake");
39
38
  var import_tool = require("./tool");
40
39
  var import_schema = require("./schema");
41
40
  const codeSchema = import_schema.baseSchema.extend({
@@ -75,7 +74,8 @@ const runCode = (0, import_tool.defineTabTool)({
75
74
  }
76
75
  });
77
76
  const scriptSchema = import_mcpBundle.z.object({
78
- code: import_mcpBundle.z.string().describe(`A JavaScript function containing Playwright code to execute. It will be invoked with a single argument, page, which you can use for any page interaction. For example: \`async (page) => { await page.getByRole('button', { name: 'Submit' }).click(); return await page.title(); }\``)
77
+ code: import_mcpBundle.z.string().describe(`A JavaScript function containing Playwright code to execute. It will be invoked with a single argument, page, which you can use for any page interaction. For example: \`async (page) => { await page.getByRole('button', { name: 'Submit' }).click(); return await page.title(); }\``),
78
+ params: import_mcpBundle.z.array(import_mcpBundle.z.object()).optional().describe("Parameters to pass to the script.")
79
79
  });
80
80
  const runScript = (0, import_tool.defineTabTool)({
81
81
  capability: "extra",
@@ -92,9 +92,14 @@ const runScript = (0, import_tool.defineTabTool)({
92
92
  const context = {
93
93
  page: tab.page,
94
94
  expect: import_test.expect,
95
- Runner: import_ai_runner_fake.Runner,
96
95
  __end__
97
96
  };
97
+ if (params.params) {
98
+ params.params.forEach((obj) => {
99
+ if (obj && typeof obj === "object")
100
+ Object.assign(context, obj);
101
+ });
102
+ }
98
103
  import_vm.default.createContext(context);
99
104
  await tab.waitForCompletion(async () => {
100
105
  const snippet = `(async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cotestdev/mcp_playwright",
3
- "version": "0.0.40",
3
+ "version": "0.0.42",
4
4
  "description": "Playwright MCP (Model Context Protocol) tools for browser automation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -25,7 +25,6 @@
25
25
  "author": "",
26
26
  "license": "Apache-2.0",
27
27
  "dependencies": {
28
- "@cotestdev/ai-runner-fake": "^0.0.3",
29
28
  "playwright": "^1.40.0",
30
29
  "playwright-core": "^1.40.0"
31
30
  },