@cotestdev/mcp_playwright 0.0.39 → 0.0.41
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.
|
@@ -75,7 +75,8 @@ const runCode = (0, import_tool.defineTabTool)({
|
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
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(); }\``)
|
|
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(); }\``),
|
|
79
|
+
params: import_mcpBundle.z.record(import_mcpBundle.z.string(), import_mcpBundle.z.any()).optional().describe("Parameters to pass to the script.")
|
|
79
80
|
});
|
|
80
81
|
const runScript = (0, import_tool.defineTabTool)({
|
|
81
82
|
capability: "extra",
|
|
@@ -95,6 +96,9 @@ const runScript = (0, import_tool.defineTabTool)({
|
|
|
95
96
|
Runner: import_ai_runner_fake.Runner,
|
|
96
97
|
__end__
|
|
97
98
|
};
|
|
99
|
+
for (const [key, value] of Object.entries(params.params || {})) {
|
|
100
|
+
context[key] = value;
|
|
101
|
+
}
|
|
98
102
|
import_vm.default.createContext(context);
|
|
99
103
|
await tab.waitForCompletion(async () => {
|
|
100
104
|
const snippet = `(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.41",
|
|
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,7 @@
|
|
|
25
25
|
"author": "",
|
|
26
26
|
"license": "Apache-2.0",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@cotestdev/ai-runner-fake": "^0.0.
|
|
28
|
+
"@cotestdev/ai-runner-fake": "^0.0.3",
|
|
29
29
|
"playwright": "^1.40.0",
|
|
30
30
|
"playwright-core": "^1.40.0"
|
|
31
31
|
},
|