rae-playwright-mcp 0.0.1 → 0.0.2
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.
- package/README.md +63 -21
- package/cli.js +7 -3
- package/index.js +1 -1
- package/lib/common/config.js +282 -0
- package/lib/common/config.js.map +7 -0
- package/lib/common/configLoader.js +345 -0
- package/lib/common/configLoader.js.map +7 -0
- package/lib/common/esmLoaderHost.js +105 -0
- package/lib/common/esmLoaderHost.js.map +7 -0
- package/lib/common/expectBundle.js +44 -0
- package/lib/common/expectBundle.js.map +7 -0
- package/lib/common/expectBundleImpl.js +15781 -0
- package/lib/common/expectBundleImpl.js.map +7 -0
- package/lib/common/fixtures.js +303 -0
- package/lib/common/fixtures.js.map +7 -0
- package/lib/common/globals.js +59 -0
- package/lib/common/globals.js.map +7 -0
- package/lib/common/ipc.js +61 -0
- package/lib/common/ipc.js.map +7 -0
- package/lib/common/poolBuilder.js +86 -0
- package/lib/common/poolBuilder.js.map +7 -0
- package/lib/common/process.js +133 -0
- package/lib/common/process.js.map +7 -0
- package/lib/common/suiteUtils.js +141 -0
- package/lib/common/suiteUtils.js.map +7 -0
- package/lib/common/test.js +323 -0
- package/lib/common/test.js.map +7 -0
- package/lib/common/testLoader.js +102 -0
- package/lib/common/testLoader.js.map +7 -0
- package/lib/common/testType.js +299 -0
- package/lib/common/testType.js.map +7 -0
- package/lib/common/validators.js +69 -0
- package/lib/common/validators.js.map +7 -0
- package/lib/mcp/browser/actions.d.js +17 -0
- package/lib/mcp/browser/actions.d.js.map +7 -0
- package/lib/mcp/browser/browserContextFactory.js +343 -0
- package/lib/mcp/browser/browserContextFactory.js.map +7 -0
- package/lib/mcp/browser/browserServerBackend.js +78 -0
- package/lib/mcp/browser/browserServerBackend.js.map +7 -0
- package/lib/mcp/browser/config.js +421 -0
- package/lib/mcp/browser/config.js.map +7 -0
- package/lib/mcp/browser/context.js +287 -0
- package/lib/mcp/browser/context.js.map +7 -0
- package/lib/mcp/browser/response.js +353 -0
- package/lib/mcp/browser/response.js.map +7 -0
- package/lib/mcp/browser/sessionLog.js +161 -0
- package/lib/mcp/browser/sessionLog.js.map +7 -0
- package/lib/mcp/browser/tab.js +329 -0
- package/lib/mcp/browser/tab.js.map +7 -0
- package/lib/mcp/browser/tools/common.js +64 -0
- package/lib/mcp/browser/tools/common.js.map +7 -0
- package/lib/mcp/browser/tools/console.js +45 -0
- package/lib/mcp/browser/tools/console.js.map +7 -0
- package/lib/mcp/browser/tools/dialogs.js +61 -0
- package/lib/mcp/browser/tools/dialogs.js.map +7 -0
- package/lib/mcp/browser/tools/evaluate.js +60 -0
- package/lib/mcp/browser/tools/evaluate.js.map +7 -0
- package/lib/mcp/browser/tools/files.js +59 -0
- package/lib/mcp/browser/tools/files.js.map +7 -0
- package/lib/mcp/browser/tools/form.js +64 -0
- package/lib/mcp/browser/tools/form.js.map +7 -0
- package/lib/mcp/browser/tools/install.js +70 -0
- package/lib/mcp/browser/tools/install.js.map +7 -0
- package/lib/mcp/browser/tools/keyboard.js +85 -0
- package/lib/mcp/browser/tools/keyboard.js.map +7 -0
- package/lib/mcp/browser/tools/mouse.js +108 -0
- package/lib/mcp/browser/tools/mouse.js.map +7 -0
- package/lib/mcp/browser/tools/navigate.js +63 -0
- package/lib/mcp/browser/tools/navigate.js.map +7 -0
- package/lib/mcp/browser/tools/network.js +61 -0
- package/lib/mcp/browser/tools/network.js.map +7 -0
- package/lib/mcp/browser/tools/pdf.js +49 -0
- package/lib/mcp/browser/tools/pdf.js.map +7 -0
- package/lib/mcp/browser/tools/runCode.js +78 -0
- package/lib/mcp/browser/tools/runCode.js.map +7 -0
- package/lib/mcp/browser/tools/screenshot.js +106 -0
- package/lib/mcp/browser/tools/screenshot.js.map +7 -0
- package/lib/mcp/browser/tools/snapshot.js +192 -0
- package/lib/mcp/browser/tools/snapshot.js.map +7 -0
- package/lib/mcp/browser/tools/tabs.js +68 -0
- package/lib/mcp/browser/tools/tabs.js.map +7 -0
- package/lib/mcp/browser/tools/tool.js +51 -0
- package/lib/mcp/browser/tools/tool.js.map +7 -0
- package/lib/mcp/browser/tools/tracing.js +76 -0
- package/lib/mcp/browser/tools/tracing.js.map +7 -0
- package/lib/mcp/browser/tools/utils.js +95 -0
- package/lib/mcp/browser/tools/utils.js.map +7 -0
- package/lib/mcp/browser/tools/verify.js +144 -0
- package/lib/mcp/browser/tools/verify.js.map +7 -0
- package/lib/mcp/browser/tools/wait.js +64 -0
- package/lib/mcp/browser/tools/wait.js.map +7 -0
- package/lib/mcp/browser/tools.js +83 -0
- package/lib/mcp/browser/tools.js.map +7 -0
- package/lib/mcp/browser/watchdog.js +45 -0
- package/lib/mcp/browser/watchdog.js.map +7 -0
- package/lib/mcp/config.d.js +17 -0
- package/lib/mcp/config.d.js.map +7 -0
- package/lib/mcp/config.d.ts +197 -0
- package/lib/mcp/extension/cdpRelay.js +352 -0
- package/lib/mcp/extension/cdpRelay.js.map +7 -0
- package/lib/mcp/extension/extensionContextFactory.js +77 -0
- package/lib/mcp/extension/extensionContextFactory.js.map +7 -0
- package/lib/mcp/extension/protocol.js +29 -0
- package/lib/mcp/extension/protocol.js.map +7 -0
- package/lib/mcp/index.js +62 -0
- package/lib/mcp/index.js.map +7 -0
- package/lib/mcp/log.js +36 -0
- package/lib/mcp/log.js.map +7 -0
- package/lib/mcp/program.js +94 -0
- package/lib/mcp/program.js.map +7 -0
- package/lib/mcp/sdk/exports.js +29 -0
- package/lib/mcp/sdk/exports.js.map +7 -0
- package/lib/mcp/sdk/http.js +153 -0
- package/lib/mcp/sdk/http.js.map +7 -0
- package/lib/mcp/sdk/inProcessTransport.js +72 -0
- package/lib/mcp/sdk/inProcessTransport.js.map +7 -0
- package/lib/mcp/sdk/server.js +208 -0
- package/lib/mcp/sdk/server.js.map +7 -0
- package/lib/mcp/sdk/tool.js +48 -0
- package/lib/mcp/sdk/tool.js.map +7 -0
- package/lib/mcp/test/browserBackend.js +99 -0
- package/lib/mcp/test/browserBackend.js.map +7 -0
- package/lib/mcp/test/generatorTools.js +123 -0
- package/lib/mcp/test/generatorTools.js.map +7 -0
- package/lib/mcp/test/plannerTools.js +145 -0
- package/lib/mcp/test/plannerTools.js.map +7 -0
- package/lib/mcp/test/seed.js +83 -0
- package/lib/mcp/test/seed.js.map +7 -0
- package/lib/mcp/test/streams.js +45 -0
- package/lib/mcp/test/streams.js.map +7 -0
- package/lib/mcp/test/testBackend.js +100 -0
- package/lib/mcp/test/testBackend.js.map +7 -0
- package/lib/mcp/test/testContext.js +280 -0
- package/lib/mcp/test/testContext.js.map +7 -0
- package/lib/mcp/test/testTool.js +31 -0
- package/lib/mcp/test/testTool.js.map +7 -0
- package/lib/mcp/test/testTools.js +109 -0
- package/lib/mcp/test/testTools.js.map +7 -0
- package/lib/third_party/pirates.js +63 -0
- package/lib/third_party/pirates.js.map +7 -0
- package/lib/third_party/tsconfig-loader.js +104 -0
- package/lib/third_party/tsconfig-loader.js.map +7 -0
- package/lib/transform/babelBundle.js +44 -0
- package/lib/transform/babelBundle.js.map +7 -0
- package/lib/transform/babelBundleImpl.js +68726 -0
- package/lib/transform/babelBundleImpl.js.map +7 -0
- package/lib/transform/babelHighlightUtils.js +64 -0
- package/lib/transform/babelHighlightUtils.js.map +7 -0
- package/lib/transform/compilationCache.js +273 -0
- package/lib/transform/compilationCache.js.map +7 -0
- package/lib/transform/esmLoader.js +104 -0
- package/lib/transform/esmLoader.js.map +7 -0
- package/lib/transform/portTransport.js +68 -0
- package/lib/transform/portTransport.js.map +7 -0
- package/lib/transform/transform.js +297 -0
- package/lib/transform/transform.js.map +7 -0
- package/lib/util.js +404 -0
- package/lib/utilsBundle.js +44 -0
- package/lib/utilsBundleImpl.js +13122 -0
- package/package.json +4 -3
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var mouse_exports = {};
|
|
20
|
+
__export(mouse_exports, {
|
|
21
|
+
default: () => mouse_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(mouse_exports);
|
|
24
|
+
var import_mcpBundle = require("playwright-core/lib/mcpBundle");
|
|
25
|
+
var import_tool = require("./tool");
|
|
26
|
+
const elementSchema = import_mcpBundle.z.object({
|
|
27
|
+
element: import_mcpBundle.z.string().describe("Human-readable element description used to obtain permission to interact with the element")
|
|
28
|
+
});
|
|
29
|
+
const mouseMove = (0, import_tool.defineTabTool)({
|
|
30
|
+
capability: "vision",
|
|
31
|
+
schema: {
|
|
32
|
+
name: "browser_mouse_move_xy",
|
|
33
|
+
title: "Move mouse",
|
|
34
|
+
description: "Move mouse to a given position",
|
|
35
|
+
inputSchema: elementSchema.extend({
|
|
36
|
+
x: import_mcpBundle.z.number().describe("X coordinate"),
|
|
37
|
+
y: import_mcpBundle.z.number().describe("Y coordinate")
|
|
38
|
+
}),
|
|
39
|
+
type: "input"
|
|
40
|
+
},
|
|
41
|
+
handle: async (tab, params, response) => {
|
|
42
|
+
response.addCode(`// Move mouse to (${params.x}, ${params.y})`);
|
|
43
|
+
response.addCode(`await page.mouse.move(${params.x}, ${params.y});`);
|
|
44
|
+
await tab.waitForCompletion(async () => {
|
|
45
|
+
await tab.page.mouse.move(params.x, params.y);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
const mouseClick = (0, import_tool.defineTabTool)({
|
|
50
|
+
capability: "vision",
|
|
51
|
+
schema: {
|
|
52
|
+
name: "browser_mouse_click_xy",
|
|
53
|
+
title: "Click",
|
|
54
|
+
description: "Click left mouse button at a given position",
|
|
55
|
+
inputSchema: elementSchema.extend({
|
|
56
|
+
x: import_mcpBundle.z.number().describe("X coordinate"),
|
|
57
|
+
y: import_mcpBundle.z.number().describe("Y coordinate")
|
|
58
|
+
}),
|
|
59
|
+
type: "input"
|
|
60
|
+
},
|
|
61
|
+
handle: async (tab, params, response) => {
|
|
62
|
+
response.setIncludeSnapshot();
|
|
63
|
+
response.addCode(`// Click mouse at coordinates (${params.x}, ${params.y})`);
|
|
64
|
+
response.addCode(`await page.mouse.move(${params.x}, ${params.y});`);
|
|
65
|
+
response.addCode(`await page.mouse.down();`);
|
|
66
|
+
response.addCode(`await page.mouse.up();`);
|
|
67
|
+
await tab.waitForCompletion(async () => {
|
|
68
|
+
await tab.page.mouse.move(params.x, params.y);
|
|
69
|
+
await tab.page.mouse.down();
|
|
70
|
+
await tab.page.mouse.up();
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
const mouseDrag = (0, import_tool.defineTabTool)({
|
|
75
|
+
capability: "vision",
|
|
76
|
+
schema: {
|
|
77
|
+
name: "browser_mouse_drag_xy",
|
|
78
|
+
title: "Drag mouse",
|
|
79
|
+
description: "Drag left mouse button to a given position",
|
|
80
|
+
inputSchema: elementSchema.extend({
|
|
81
|
+
startX: import_mcpBundle.z.number().describe("Start X coordinate"),
|
|
82
|
+
startY: import_mcpBundle.z.number().describe("Start Y coordinate"),
|
|
83
|
+
endX: import_mcpBundle.z.number().describe("End X coordinate"),
|
|
84
|
+
endY: import_mcpBundle.z.number().describe("End Y coordinate")
|
|
85
|
+
}),
|
|
86
|
+
type: "input"
|
|
87
|
+
},
|
|
88
|
+
handle: async (tab, params, response) => {
|
|
89
|
+
response.setIncludeSnapshot();
|
|
90
|
+
response.addCode(`// Drag mouse from (${params.startX}, ${params.startY}) to (${params.endX}, ${params.endY})`);
|
|
91
|
+
response.addCode(`await page.mouse.move(${params.startX}, ${params.startY});`);
|
|
92
|
+
response.addCode(`await page.mouse.down();`);
|
|
93
|
+
response.addCode(`await page.mouse.move(${params.endX}, ${params.endY});`);
|
|
94
|
+
response.addCode(`await page.mouse.up();`);
|
|
95
|
+
await tab.waitForCompletion(async () => {
|
|
96
|
+
await tab.page.mouse.move(params.startX, params.startY);
|
|
97
|
+
await tab.page.mouse.down();
|
|
98
|
+
await tab.page.mouse.move(params.endX, params.endY);
|
|
99
|
+
await tab.page.mouse.up();
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
var mouse_default = [
|
|
104
|
+
mouseMove,
|
|
105
|
+
mouseClick,
|
|
106
|
+
mouseDrag
|
|
107
|
+
];
|
|
108
|
+
//# sourceMappingURL=mouse.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/mcp/browser/tools/mouse.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'playwright-core/lib/mcpBundle';\nimport { defineTabTool } from './tool';\n\nconst elementSchema = z.object({\n element: z.string().describe('Human-readable element description used to obtain permission to interact with the element'),\n});\n\nconst mouseMove = defineTabTool({\n capability: 'vision',\n schema: {\n name: 'browser_mouse_move_xy',\n title: 'Move mouse',\n description: 'Move mouse to a given position',\n inputSchema: elementSchema.extend({\n x: z.number().describe('X coordinate'),\n y: z.number().describe('Y coordinate'),\n }),\n type: 'input',\n },\n\n handle: async (tab, params, response) => {\n response.addCode(`// Move mouse to (${params.x}, ${params.y})`);\n response.addCode(`await page.mouse.move(${params.x}, ${params.y});`);\n\n await tab.waitForCompletion(async () => {\n await tab.page.mouse.move(params.x, params.y);\n });\n },\n});\n\nconst mouseClick = defineTabTool({\n capability: 'vision',\n schema: {\n name: 'browser_mouse_click_xy',\n title: 'Click',\n description: 'Click left mouse button at a given position',\n inputSchema: elementSchema.extend({\n x: z.number().describe('X coordinate'),\n y: z.number().describe('Y coordinate'),\n }),\n type: 'input',\n },\n\n handle: async (tab, params, response) => {\n response.setIncludeSnapshot();\n\n response.addCode(`// Click mouse at coordinates (${params.x}, ${params.y})`);\n response.addCode(`await page.mouse.move(${params.x}, ${params.y});`);\n response.addCode(`await page.mouse.down();`);\n response.addCode(`await page.mouse.up();`);\n\n await tab.waitForCompletion(async () => {\n await tab.page.mouse.move(params.x, params.y);\n await tab.page.mouse.down();\n await tab.page.mouse.up();\n });\n },\n});\n\nconst mouseDrag = defineTabTool({\n capability: 'vision',\n schema: {\n name: 'browser_mouse_drag_xy',\n title: 'Drag mouse',\n description: 'Drag left mouse button to a given position',\n inputSchema: elementSchema.extend({\n startX: z.number().describe('Start X coordinate'),\n startY: z.number().describe('Start Y coordinate'),\n endX: z.number().describe('End X coordinate'),\n endY: z.number().describe('End Y coordinate'),\n }),\n type: 'input',\n },\n\n handle: async (tab, params, response) => {\n response.setIncludeSnapshot();\n\n response.addCode(`// Drag mouse from (${params.startX}, ${params.startY}) to (${params.endX}, ${params.endY})`);\n response.addCode(`await page.mouse.move(${params.startX}, ${params.startY});`);\n response.addCode(`await page.mouse.down();`);\n response.addCode(`await page.mouse.move(${params.endX}, ${params.endY});`);\n response.addCode(`await page.mouse.up();`);\n\n await tab.waitForCompletion(async () => {\n await tab.page.mouse.move(params.startX, params.startY);\n await tab.page.mouse.down();\n await tab.page.mouse.move(params.endX, params.endY);\n await tab.page.mouse.up();\n });\n },\n});\n\nexport default [\n mouseMove,\n mouseClick,\n mouseDrag,\n];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,uBAAkB;AAClB,kBAA8B;AAE9B,MAAM,gBAAgB,mBAAE,OAAO;AAAA,EAC7B,SAAS,mBAAE,OAAO,EAAE,SAAS,2FAA2F;AAC1H,CAAC;AAED,MAAM,gBAAY,2BAAc;AAAA,EAC9B,YAAY;AAAA,EACZ,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,aAAa,cAAc,OAAO;AAAA,MAChC,GAAG,mBAAE,OAAO,EAAE,SAAS,cAAc;AAAA,MACrC,GAAG,mBAAE,OAAO,EAAE,SAAS,cAAc;AAAA,IACvC,CAAC;AAAA,IACD,MAAM;AAAA,EACR;AAAA,EAEA,QAAQ,OAAO,KAAK,QAAQ,aAAa;AACvC,aAAS,QAAQ,qBAAqB,OAAO,CAAC,KAAK,OAAO,CAAC,GAAG;AAC9D,aAAS,QAAQ,yBAAyB,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI;AAEnE,UAAM,IAAI,kBAAkB,YAAY;AACtC,YAAM,IAAI,KAAK,MAAM,KAAK,OAAO,GAAG,OAAO,CAAC;AAAA,IAC9C,CAAC;AAAA,EACH;AACF,CAAC;AAED,MAAM,iBAAa,2BAAc;AAAA,EAC/B,YAAY;AAAA,EACZ,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,aAAa,cAAc,OAAO;AAAA,MAChC,GAAG,mBAAE,OAAO,EAAE,SAAS,c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S,QAAQ,yBAAyB,OAAO,IAAI,KAAK,OAAO,IAAI,IAAI;AACzE,aAAS,QAAQ,wBAAwB;AAEzC,UAAM,IAAI,kBAAkB,YAAY;AACtC,YAAM,IAAI,KAAK,MAAM,KAAK,OAAO,QAAQ,OAAO,MAAM;AACtD,YAAM,IAAI,KAAK,MAAM,KAAK;AAC1B,YAAM,IAAI,KAAK,MAAM,KAAK,OAAO,MAAM,OAAO,IAAI;AAClD,YAAM,IAAI,KAAK,MAAM,GAAG;AAAA,IAC1B,CAAC;AAAA,EACH;AACF,CAAC;AAED,IAAO,gBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var navigate_exports = {};
|
|
20
|
+
__export(navigate_exports, {
|
|
21
|
+
default: () => navigate_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(navigate_exports);
|
|
24
|
+
var import_mcpBundle = require("playwright-core/lib/mcpBundle");
|
|
25
|
+
var import_tool = require("./tool");
|
|
26
|
+
const navigate = (0, import_tool.defineTool)({
|
|
27
|
+
capability: "core",
|
|
28
|
+
schema: {
|
|
29
|
+
name: "browser_navigate",
|
|
30
|
+
title: "Navigate to a URL",
|
|
31
|
+
description: "Navigate to a URL",
|
|
32
|
+
inputSchema: import_mcpBundle.z.object({
|
|
33
|
+
url: import_mcpBundle.z.string().describe("The URL to navigate to")
|
|
34
|
+
}),
|
|
35
|
+
type: "action"
|
|
36
|
+
},
|
|
37
|
+
handle: async (context, params, response) => {
|
|
38
|
+
const tab = await context.ensureTab();
|
|
39
|
+
await tab.navigate(params.url);
|
|
40
|
+
response.setIncludeSnapshot();
|
|
41
|
+
response.addCode(`await page.goto('${params.url}');`);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const goBack = (0, import_tool.defineTabTool)({
|
|
45
|
+
capability: "core",
|
|
46
|
+
schema: {
|
|
47
|
+
name: "browser_navigate_back",
|
|
48
|
+
title: "Go back",
|
|
49
|
+
description: "Go back to the previous page",
|
|
50
|
+
inputSchema: import_mcpBundle.z.object({}),
|
|
51
|
+
type: "action"
|
|
52
|
+
},
|
|
53
|
+
handle: async (tab, params, response) => {
|
|
54
|
+
await tab.page.goBack();
|
|
55
|
+
response.setIncludeSnapshot();
|
|
56
|
+
response.addCode(`await page.goBack();`);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
var navigate_default = [
|
|
60
|
+
navigate,
|
|
61
|
+
goBack
|
|
62
|
+
];
|
|
63
|
+
//# sourceMappingURL=navigate.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/mcp/browser/tools/navigate.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'playwright-core/lib/mcpBundle';\nimport { defineTool, defineTabTool } from './tool';\n\nconst navigate = defineTool({\n capability: 'core',\n\n schema: {\n name: 'browser_navigate',\n title: 'Navigate to a URL',\n description: 'Navigate to a URL',\n inputSchema: z.object({\n url: z.string().describe('The URL to navigate to'),\n }),\n type: 'action',\n },\n\n handle: async (context, params, response) => {\n const tab = await context.ensureTab();\n await tab.navigate(params.url);\n\n response.setIncludeSnapshot();\n response.addCode(`await page.goto('${params.url}');`);\n },\n});\n\nconst goBack = defineTabTool({\n capability: 'core',\n schema: {\n name: 'browser_navigate_back',\n title: 'Go back',\n description: 'Go back to the previous page',\n inputSchema: z.object({}),\n type: 'action',\n },\n\n handle: async (tab, params, response) => {\n await tab.page.goBack();\n response.setIncludeSnapshot();\n response.addCode(`await page.goBack();`);\n },\n});\n\nexport default [\n navigate,\n goBack,\n];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,uBAAkB;AAClB,kBAA0C;AAE1C,MAAM,eAAW,wBAAW;AAAA,EAC1B,YAAY;AAAA,EAEZ,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,aAAa,mBAAE,OAAO;AAAA,MACpB,KAAK,mBAAE,OAAO,EAAE,SAAS,wBAAwB;AAAA,IACnD,CAAC;AAAA,IACD,MAAM;AAAA,EACR;AAAA,EAEA,QAAQ,OAAO,SAAS,QAAQ,aAAa;AAC3C,UAAM,MAAM,MAAM,QAAQ,UAAU;AACpC,UAAM,IAAI,SAAS,OAAO,GAAG;AAE7B,aAAS,mBAAmB;AAC5B,aAAS,QAAQ,oBAAoB,OAAO,GAAG,KAAK;AAAA,EACtD;AACF,CAAC;AAED,MAAM,aAAS,2BAAc;AAAA,EAC3B,YAAY;AAAA,EACZ,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,aAAa,mBAAE,OAAO,CAAC,CAAC;AAAA,IACxB,MAAM;AAAA,EACR;AAAA,EAEA,QAAQ,OAAO,KAAK,QAAQ,aAAa;AACvC,UAAM,IAAI,KAAK,OAAO;AACtB,aAAS,mBAAmB;AAC5B,aAAS,QAAQ,sBAAsB;AAAA,EACzC;AACF,CAAC;AAED,IAAO,mBAAQ;AAAA,EACb;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var network_exports = {};
|
|
20
|
+
__export(network_exports, {
|
|
21
|
+
default: () => network_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(network_exports);
|
|
24
|
+
var import_mcpBundle = require("playwright-core/lib/mcpBundle");
|
|
25
|
+
var import_tool = require("./tool");
|
|
26
|
+
const requests = (0, import_tool.defineTabTool)({
|
|
27
|
+
capability: "core",
|
|
28
|
+
schema: {
|
|
29
|
+
name: "browser_network_requests",
|
|
30
|
+
title: "List network requests",
|
|
31
|
+
description: "Returns all network requests since loading the page",
|
|
32
|
+
inputSchema: import_mcpBundle.z.object({
|
|
33
|
+
includeStatic: import_mcpBundle.z.boolean().default(false).describe("Whether to include successful static resources like images, fonts, scripts, etc. Defaults to false.")
|
|
34
|
+
}),
|
|
35
|
+
type: "readOnly"
|
|
36
|
+
},
|
|
37
|
+
handle: async (tab, params, response) => {
|
|
38
|
+
const requests2 = await tab.requests();
|
|
39
|
+
for (const request of requests2) {
|
|
40
|
+
const rendered = await renderRequest(request, params.includeStatic);
|
|
41
|
+
if (rendered)
|
|
42
|
+
response.addResult(rendered);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
async function renderRequest(request, includeStatic) {
|
|
47
|
+
const response = request._hasResponse ? await request.response() : void 0;
|
|
48
|
+
const isStaticRequest = ["document", "stylesheet", "image", "media", "font", "script", "manifest"].includes(request.resourceType());
|
|
49
|
+
const isSuccessfulRequest = !response || response.status() < 400;
|
|
50
|
+
if (isStaticRequest && isSuccessfulRequest && !includeStatic)
|
|
51
|
+
return void 0;
|
|
52
|
+
const result = [];
|
|
53
|
+
result.push(`[${request.method().toUpperCase()}] ${request.url()}`);
|
|
54
|
+
if (response)
|
|
55
|
+
result.push(`=> [${response.status()}] ${response.statusText()}`);
|
|
56
|
+
return result.join(" ");
|
|
57
|
+
}
|
|
58
|
+
var network_default = [
|
|
59
|
+
requests
|
|
60
|
+
];
|
|
61
|
+
//# sourceMappingURL=network.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/mcp/browser/tools/network.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'playwright-core/lib/mcpBundle';\nimport { defineTabTool } from './tool';\n\nimport type * as playwright from 'playwright-core';\nimport type { Request } from '../../../../../playwright-core/src/client/network';\n\nconst requests = defineTabTool({\n capability: 'core',\n\n schema: {\n name: 'browser_network_requests',\n title: 'List network requests',\n description: 'Returns all network requests since loading the page',\n inputSchema: z.object({\n includeStatic: z.boolean().default(false).describe('Whether to include successful static resources like images, fonts, scripts, etc. Defaults to false.'),\n }),\n type: 'readOnly',\n },\n\n handle: async (tab, params, response) => {\n const requests = await tab.requests();\n for (const request of requests) {\n const rendered = await renderRequest(request, params.includeStatic);\n if (rendered)\n response.addResult(rendered);\n }\n },\n});\n\nasync function renderRequest(request: playwright.Request, includeStatic: boolean): Promise<string | undefined> {\n const response = (request as Request)._hasResponse ? await request.response() : undefined;\n const isStaticRequest = ['document', 'stylesheet', 'image', 'media', 'font', 'script', 'manifest'].includes(request.resourceType());\n const isSuccessfulRequest = !response || response.status() < 400;\n\n if (isStaticRequest && isSuccessfulRequest && !includeStatic)\n return undefined;\n\n const result: string[] = [];\n result.push(`[${request.method().toUpperCase()}] ${request.url()}`);\n if (response)\n result.push(`=> [${response.status()}] ${response.statusText()}`);\n return result.join(' ');\n}\n\nexport default [\n requests,\n];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,uBAAkB;AAClB,kBAA8B;AAK9B,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Names = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var pdf_exports = {};
|
|
20
|
+
__export(pdf_exports, {
|
|
21
|
+
default: () => pdf_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(pdf_exports);
|
|
24
|
+
var import_mcpBundle = require("playwright-core/lib/mcpBundle");
|
|
25
|
+
var import_utils = require("playwright-core/lib/utils");
|
|
26
|
+
var import_tool = require("./tool");
|
|
27
|
+
var import_utils2 = require("./utils");
|
|
28
|
+
const pdfSchema = import_mcpBundle.z.object({
|
|
29
|
+
filename: import_mcpBundle.z.string().optional().describe("File name to save the pdf to. Defaults to `page-{timestamp}.pdf` if not specified. Prefer relative file names to stay within the output directory.")
|
|
30
|
+
});
|
|
31
|
+
const pdf = (0, import_tool.defineTabTool)({
|
|
32
|
+
capability: "pdf",
|
|
33
|
+
schema: {
|
|
34
|
+
name: "browser_pdf_save",
|
|
35
|
+
title: "Save as PDF",
|
|
36
|
+
description: "Save page as PDF",
|
|
37
|
+
inputSchema: pdfSchema,
|
|
38
|
+
type: "readOnly"
|
|
39
|
+
},
|
|
40
|
+
handle: async (tab, params, response) => {
|
|
41
|
+
const fileName = await response.addFile(params.filename ?? (0, import_utils2.dateAsFileName)("pdf"), { origin: "llm", reason: "Page saved as PDF" });
|
|
42
|
+
response.addCode(`await page.pdf(${(0, import_utils.formatObject)({ path: fileName })});`);
|
|
43
|
+
await tab.page.pdf({ path: fileName });
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
var pdf_default = [
|
|
47
|
+
pdf
|
|
48
|
+
];
|
|
49
|
+
//# sourceMappingURL=pdf.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/mcp/browser/tools/pdf.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'playwright-core/lib/mcpBundle';\nimport { formatObject } from 'playwright-core/lib/utils';\n\nimport { defineTabTool } from './tool';\nimport { dateAsFileName } from './utils';\n\nconst pdfSchema = z.object({\n filename: z.string().optional().describe('File name to save the pdf to. Defaults to `page-{timestamp}.pdf` if not specified. Prefer relative file names to stay within the output directory.'),\n});\n\nconst pdf = defineTabTool({\n capability: 'pdf',\n\n schema: {\n name: 'browser_pdf_save',\n title: 'Save as PDF',\n description: 'Save page as PDF',\n inputSchema: pdfSchema,\n type: 'readOnly',\n },\n\n handle: async (tab, params, response) => {\n const fileName = await response.addFile(params.filename ?? dateAsFileName('pdf'), { origin: 'llm', reason: 'Page saved as PDF' });\n response.addCode(`await page.pdf(${formatObject({ path: fileName })});`);\n await tab.page.pdf({ path: fileName });\n },\n});\n\nexport default [\n pdf,\n];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,uBAAkB;AAClB,mBAA6B;AAE7B,kBAA8B;AAC9B,IAAAA,gBAA+B;AAE/B,MAAM,YAAY,mBAAE,OAAO;AAAA,EACzB,UAAU,mBAAE,OAAO,EAAE,SAAS,EAAE,SAAS,oJAAoJ;AAC/L,CAAC;AAED,MAAM,UAAM,2BAAc;AAAA,EACxB,YAAY;AAAA,EAEZ,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,aAAa;AAAA,IACb,MAAM;AAAA,EACR;AAAA,EAEA,QAAQ,OAAO,KAAK,QAAQ,aAAa;AACvC,UAAM,WAAW,MAAM,SAAS,QAAQ,OAAO,gBAAY,8BAAe,KAAK,GAAG,EAAE,QAAQ,OAAO,QAAQ,oBAAoB,CAAC;AAChI,aAAS,QAAQ,sBAAkB,2BAAa,EAAE,MAAM,SAAS,CAAC,CAAC,IAAI;AACvE,UAAM,IAAI,KAAK,IAAI,EAAE,MAAM,SAAS,CAAC;AAAA,EACvC;AACF,CAAC;AAED,IAAO,cAAQ;AAAA,EACb;AACF;",
|
|
6
|
+
"names": ["import_utils"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var runCode_exports = {};
|
|
30
|
+
__export(runCode_exports, {
|
|
31
|
+
default: () => runCode_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(runCode_exports);
|
|
34
|
+
var import_vm = __toESM(require("vm"));
|
|
35
|
+
var import_utils = require("playwright-core/lib/utils");
|
|
36
|
+
var import_mcpBundle = require("playwright-core/lib/mcpBundle");
|
|
37
|
+
var import_tool = require("./tool");
|
|
38
|
+
const codeSchema = import_mcpBundle.z.object({
|
|
39
|
+
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(); }\``)
|
|
40
|
+
});
|
|
41
|
+
const runCode = (0, import_tool.defineTabTool)({
|
|
42
|
+
capability: "core",
|
|
43
|
+
schema: {
|
|
44
|
+
name: "browser_run_code",
|
|
45
|
+
title: "Run Playwright code",
|
|
46
|
+
description: "Run Playwright code snippet",
|
|
47
|
+
inputSchema: codeSchema,
|
|
48
|
+
type: "action"
|
|
49
|
+
},
|
|
50
|
+
handle: async (tab, params, response) => {
|
|
51
|
+
response.setIncludeSnapshot();
|
|
52
|
+
response.addCode(`await (${params.code})(page);`);
|
|
53
|
+
const __end__ = new import_utils.ManualPromise();
|
|
54
|
+
const context = {
|
|
55
|
+
page: tab.page,
|
|
56
|
+
__end__
|
|
57
|
+
};
|
|
58
|
+
import_vm.default.createContext(context);
|
|
59
|
+
await tab.waitForCompletion(async () => {
|
|
60
|
+
const snippet = `(async () => {
|
|
61
|
+
try {
|
|
62
|
+
const result = await (${params.code})(page);
|
|
63
|
+
__end__.resolve(JSON.stringify(result));
|
|
64
|
+
} catch (e) {
|
|
65
|
+
__end__.reject(e);
|
|
66
|
+
}
|
|
67
|
+
})()`;
|
|
68
|
+
await import_vm.default.runInContext(snippet, context);
|
|
69
|
+
const result = await __end__;
|
|
70
|
+
if (typeof result === "string")
|
|
71
|
+
response.addResult(result);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
var runCode_default = [
|
|
76
|
+
runCode
|
|
77
|
+
];
|
|
78
|
+
//# sourceMappingURL=runCode.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/mcp/browser/tools/runCode.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport vm from 'vm';\n\nimport { ManualPromise } from 'playwright-core/lib/utils';\n\nimport { z } from 'playwright-core/lib/mcpBundle';\nimport { defineTabTool } from './tool';\n\nconst codeSchema = z.object({\n code: 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(); }\\``),\n});\n\nconst runCode = defineTabTool({\n capability: 'core',\n schema: {\n name: 'browser_run_code',\n title: 'Run Playwright code',\n description: 'Run Playwright code snippet',\n inputSchema: codeSchema,\n type: 'action',\n },\n\n handle: async (tab, params, response) => {\n response.setIncludeSnapshot();\n response.addCode(`await (${params.code})(page);`);\n const __end__ = new ManualPromise<void>();\n const context = {\n page: tab.page,\n __end__,\n };\n vm.createContext(context);\n await tab.waitForCompletion(async () => {\n const snippet = `(async () => {\n try {\n const result = await (${params.code})(page);\n __end__.resolve(JSON.stringify(result));\n } catch (e) {\n __end__.reject(e);\n }\n })()`;\n await vm.runInContext(snippet, context);\n const result = await __end__;\n if (typeof result === 'string')\n response.addResult(result);\n });\n },\n});\n\nexport default [\n runCode,\n];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,gBAAe;AAEf,mBAA8B;AAE9B,uBAAkB;AAClB,kBAA8B;AAE9B,MAAM,aAAa,mBAAE,OAAO;AAAA,EAC1B,MAAM,mBAAE,OAAO,EAAE,SAAS,uRAAuR;AACnT,CAAC;AAED,MAAM,cAAU,2BAAc;AAAA,EAC5B,YAAY;AAAA,EACZ,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,aAAa;AAAA,IACb,MAAM;AAAA,EACR;AAAA,EAEA,QAAQ,OAAO,KAAK,QAAQ,aAAa;AACvC,aAAS,mBAAmB;AAC5B,aAAS,QAAQ,UAAU,OAAO,IAAI,UAAU;AAChD,UAAM,UAAU,IAAI,2BAAoB;AACxC,UAAM,UAAU;AAAA,MACd,MAAM,IAAI;AAAA,MACV;AAAA,IACF;AACA,cAAAA,QAAG,cAAc,OAAO;AACxB,UAAM,IAAI,kBAAkB,YAAY;AACtC,YAAM,UAAU;AAAA;AAAA,kCAEY,OAAO,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAMvC,YAAM,UAAAA,QAAG,aAAa,SAAS,OAAO;AACtC,YAAM,SAAS,MAAM;AACrB,UAAI,OAAO,WAAW;AACpB,iBAAS,UAAU,MAAM;AAAA,IAC7B,CAAC;AAAA,EACH;AACF,CAAC;AAED,IAAO,kBAAQ;AAAA,EACb;AACF;",
|
|
6
|
+
"names": ["vm"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var screenshot_exports = {};
|
|
30
|
+
__export(screenshot_exports, {
|
|
31
|
+
default: () => screenshot_default,
|
|
32
|
+
scaleImageToFitMessage: () => scaleImageToFitMessage
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(screenshot_exports);
|
|
35
|
+
var import_fs = __toESM(require("fs"));
|
|
36
|
+
var import_utils = require("playwright-core/lib/utils");
|
|
37
|
+
var import_utilsBundle = require("playwright-core/lib/utilsBundle");
|
|
38
|
+
var import_utils2 = require("playwright-core/lib/utils");
|
|
39
|
+
var import_mcpBundle = require("playwright-core/lib/mcpBundle");
|
|
40
|
+
var import_tool = require("./tool");
|
|
41
|
+
var import_utils3 = require("./utils");
|
|
42
|
+
const screenshotSchema = import_mcpBundle.z.object({
|
|
43
|
+
type: import_mcpBundle.z.enum(["png", "jpeg"]).default("png").describe("Image format for the screenshot. Default is png."),
|
|
44
|
+
filename: import_mcpBundle.z.string().optional().describe("File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg}` if not specified. Prefer relative file names to stay within the output directory."),
|
|
45
|
+
element: import_mcpBundle.z.string().optional().describe("Human-readable element description used to obtain permission to screenshot the element. If not provided, the screenshot will be taken of viewport. If element is provided, ref must be provided too."),
|
|
46
|
+
ref: import_mcpBundle.z.string().optional().describe("Exact target element reference from the page snapshot. If not provided, the screenshot will be taken of viewport. If ref is provided, element must be provided too."),
|
|
47
|
+
fullPage: import_mcpBundle.z.boolean().optional().describe("When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Cannot be used with element screenshots.")
|
|
48
|
+
});
|
|
49
|
+
const screenshot = (0, import_tool.defineTabTool)({
|
|
50
|
+
capability: "core",
|
|
51
|
+
schema: {
|
|
52
|
+
name: "browser_take_screenshot",
|
|
53
|
+
title: "Take a screenshot",
|
|
54
|
+
description: `Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.`,
|
|
55
|
+
inputSchema: screenshotSchema,
|
|
56
|
+
type: "readOnly"
|
|
57
|
+
},
|
|
58
|
+
handle: async (tab, params, response) => {
|
|
59
|
+
if (!!params.element !== !!params.ref)
|
|
60
|
+
throw new Error("Both element and ref must be provided or neither.");
|
|
61
|
+
if (params.fullPage && params.ref)
|
|
62
|
+
throw new Error("fullPage cannot be used with element screenshots.");
|
|
63
|
+
const fileType = params.type || "png";
|
|
64
|
+
const options = {
|
|
65
|
+
type: fileType,
|
|
66
|
+
quality: fileType === "png" ? void 0 : 90,
|
|
67
|
+
scale: "css",
|
|
68
|
+
...params.fullPage !== void 0 && { fullPage: params.fullPage }
|
|
69
|
+
};
|
|
70
|
+
const isElementScreenshot = params.element && params.ref;
|
|
71
|
+
const screenshotTarget = isElementScreenshot ? params.element : params.fullPage ? "full page" : "viewport";
|
|
72
|
+
const fileName = await response.addFile(params.filename || (0, import_utils3.dateAsFileName)(fileType), { origin: "llm", reason: `Screenshot of ${screenshotTarget}` });
|
|
73
|
+
response.addCode(`// Screenshot ${screenshotTarget} and save it as ${fileName}`);
|
|
74
|
+
const ref = params.ref ? await tab.refLocator({ element: params.element || "", ref: params.ref }) : null;
|
|
75
|
+
if (ref)
|
|
76
|
+
response.addCode(`await page.${ref.resolved}.screenshot(${(0, import_utils2.formatObject)(options)});`);
|
|
77
|
+
else
|
|
78
|
+
response.addCode(`await page.screenshot(${(0, import_utils2.formatObject)(options)});`);
|
|
79
|
+
const buffer = ref ? await ref.locator.screenshot(options) : await tab.page.screenshot(options);
|
|
80
|
+
await (0, import_utils.mkdirIfNeeded)(fileName);
|
|
81
|
+
await import_fs.default.promises.writeFile(fileName, buffer);
|
|
82
|
+
response.addImage({
|
|
83
|
+
contentType: fileType === "png" ? "image/png" : "image/jpeg",
|
|
84
|
+
data: scaleImageToFitMessage(buffer, fileType)
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
function scaleImageToFitMessage(buffer, imageType) {
|
|
89
|
+
const image = imageType === "png" ? import_utilsBundle.PNG.sync.read(buffer) : import_utilsBundle.jpegjs.decode(buffer, { maxMemoryUsageInMB: 512 });
|
|
90
|
+
const pixels = image.width * image.height;
|
|
91
|
+
const shrink = Math.min(1568 / image.width, 1568 / image.height, Math.sqrt(1.15 * 1024 * 1024 / pixels));
|
|
92
|
+
if (shrink > 1)
|
|
93
|
+
return buffer;
|
|
94
|
+
const width = image.width * shrink | 0;
|
|
95
|
+
const height = image.height * shrink | 0;
|
|
96
|
+
const scaledImage = (0, import_utils.scaleImageToSize)(image, { width, height });
|
|
97
|
+
return imageType === "png" ? import_utilsBundle.PNG.sync.write(scaledImage) : import_utilsBundle.jpegjs.encode(scaledImage, 80).data;
|
|
98
|
+
}
|
|
99
|
+
var screenshot_default = [
|
|
100
|
+
screenshot
|
|
101
|
+
];
|
|
102
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
103
|
+
0 && (module.exports = {
|
|
104
|
+
scaleImageToFitMessage
|
|
105
|
+
});
|
|
106
|
+
//# sourceMappingURL=screenshot.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/mcp/browser/tools/screenshot.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from 'fs';\n\nimport { mkdirIfNeeded, scaleImageToSize } from 'playwright-core/lib/utils';\nimport { jpegjs, PNG } from 'playwright-core/lib/utilsBundle';\nimport { formatObject } from 'playwright-core/lib/utils';\n\nimport { z } from 'playwright-core/lib/mcpBundle';\nimport { defineTabTool } from './tool';\nimport { dateAsFileName } from './utils';\n\nimport type * as playwright from 'playwright-core';\n\nconst screenshotSchema = z.object({\n type: z.enum(['png', 'jpeg']).default('png').describe('Image format for the screenshot. Default is png.'),\n filename: z.string().optional().describe('File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg}` if not specified. Prefer relative file names to stay within the output directory.'),\n element: z.string().optional().describe('Human-readable element description used to obtain permission to screenshot the element. If not provided, the screenshot will be taken of viewport. If element is provided, ref must be provided too.'),\n ref: z.string().optional().describe('Exact target element reference from the page snapshot. If not provided, the screenshot will be taken of viewport. If ref is provided, element must be provided too.'),\n fullPage: z.boolean().optional().describe('When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Cannot be used with element screenshots.'),\n});\n\nconst screenshot = defineTabTool({\n capability: 'core',\n schema: {\n name: 'browser_take_screenshot',\n title: 'Take a screenshot',\n description: `Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.`,\n inputSchema: screenshotSchema,\n type: 'readOnly',\n },\n\n handle: async (tab, params, response) => {\n if (!!params.element !== !!params.ref)\n throw new Error('Both element and ref must be provided or neither.');\n if (params.fullPage && params.ref)\n throw new Error('fullPage cannot be used with element screenshots.');\n\n const fileType = params.type || 'png';\n const options: playwright.PageScreenshotOptions = {\n type: fileType,\n quality: fileType === 'png' ? undefined : 90,\n scale: 'css',\n ...(params.fullPage !== undefined && { fullPage: params.fullPage })\n };\n const isElementScreenshot = params.element && params.ref;\n\n const screenshotTarget = isElementScreenshot ? params.element : (params.fullPage ? 'full page' : 'viewport');\n const fileName = await response.addFile(params.filename || dateAsFileName(fileType), { origin: 'llm', reason: `Screenshot of ${screenshotTarget}` });\n response.addCode(`// Screenshot ${screenshotTarget} and save it as ${fileName}`);\n\n // Only get snapshot when element screenshot is needed\n const ref = params.ref ? await tab.refLocator({ element: params.element || '', ref: params.ref }) : null;\n\n if (ref)\n response.addCode(`await page.${ref.resolved}.screenshot(${formatObject(options)});`);\n else\n response.addCode(`await page.screenshot(${formatObject(options)});`);\n\n const buffer = ref ? await ref.locator.screenshot(options) : await tab.page.screenshot(options);\n\n await mkdirIfNeeded(fileName);\n await fs.promises.writeFile(fileName, buffer);\n\n response.addImage({\n contentType: fileType === 'png' ? 'image/png' : 'image/jpeg',\n data: scaleImageToFitMessage(buffer, fileType)\n });\n }\n});\n\nexport function scaleImageToFitMessage(buffer: Buffer, imageType: 'png' | 'jpeg'): Buffer {\n // https://docs.claude.com/en/docs/build-with-claude/vision#evaluate-image-size\n // Not more than 1.15 megapixel, linear size not more than 1568.\n\n const image = imageType === 'png' ? PNG.sync.read(buffer) : jpegjs.decode(buffer, { maxMemoryUsageInMB: 512 });\n const pixels = image.width * image.height;\n\n const shrink = Math.min(1568 / image.width, 1568 / image.height, Math.sqrt(1.15 * 1024 * 1024 / pixels));\n if (shrink > 1)\n return buffer;\n\n const width = image.width * shrink | 0;\n const height = image.height * shrink | 0;\n const scaledImage = scaleImageToSize(image, { width, height });\n return imageType === 'png' ? PNG.sync.write(scaledImage as any) : jpegjs.encode(scaledImage, 80).data;\n}\n\nexport default [\n screenshot,\n];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,gBAAe;AAEf,mBAAgD;AAChD,yBAA4B;AAC5B,IAAAA,gBAA6B;AAE7B,uBAAkB;AAClB,kBAA8B;AAC9B,IAAAA,gBAA+B;AAI/B,MAAM,mBAAmB,mBAAE,OAAO;AAAA,EAChC,MAAM,mBAAE,KAAK,CAAC,OAAO,MAAM,CAAC,EAAE,QAAQ,KAAK,EAAE,SAAS,kDAAkD;AA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