@cotestdev/mcp_playwright 0.0.41 → 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({
|
|
@@ -76,7 +75,7 @@ const runCode = (0, import_tool.defineTabTool)({
|
|
|
76
75
|
});
|
|
77
76
|
const scriptSchema = import_mcpBundle.z.object({
|
|
78
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(); }\``),
|
|
79
|
-
params: import_mcpBundle.z.
|
|
78
|
+
params: import_mcpBundle.z.array(import_mcpBundle.z.object()).optional().describe("Parameters to pass to the script.")
|
|
80
79
|
});
|
|
81
80
|
const runScript = (0, import_tool.defineTabTool)({
|
|
82
81
|
capability: "extra",
|
|
@@ -93,11 +92,13 @@ const runScript = (0, import_tool.defineTabTool)({
|
|
|
93
92
|
const context = {
|
|
94
93
|
page: tab.page,
|
|
95
94
|
expect: import_test.expect,
|
|
96
|
-
Runner: import_ai_runner_fake.Runner,
|
|
97
95
|
__end__
|
|
98
96
|
};
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
if (params.params) {
|
|
98
|
+
params.params.forEach((obj) => {
|
|
99
|
+
if (obj && typeof obj === "object")
|
|
100
|
+
Object.assign(context, obj);
|
|
101
|
+
});
|
|
101
102
|
}
|
|
102
103
|
import_vm.default.createContext(context);
|
|
103
104
|
await tab.waitForCompletion(async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cotestdev/mcp_playwright",
|
|
3
|
-
"version": "0.0.
|
|
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
|
},
|