@cotestdev/mcp_playwright 0.0.36 → 0.0.38

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.
@@ -18,16 +18,15 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var common_exports = {};
20
20
  __export(common_exports, {
21
- baseSchema: () => baseSchema,
21
+ baseSchema: () => import_schema2.baseSchema,
22
22
  default: () => common_default
23
23
  });
24
24
  module.exports = __toCommonJS(common_exports);
25
25
  var import_mcpBundle = require("../../../mcpBundle");
26
26
  var import_tool = require("./tool");
27
27
  var import_response = require("../response");
28
- const baseSchema = import_mcpBundle.z.object({
29
- toolText: import_mcpBundle.z.string().describe("A human-readable description of the action to perform by the tool.")
30
- });
28
+ var import_schema = require("./schema");
29
+ var import_schema2 = require("./schema");
31
30
  const close = (0, import_tool.defineTool)({
32
31
  capability: "core",
33
32
  schema: {
@@ -50,7 +49,7 @@ const resize = (0, import_tool.defineTabTool)({
50
49
  name: "browser_resize",
51
50
  title: "Resize browser window",
52
51
  description: "Resize the browser window",
53
- inputSchema: baseSchema.extend({
52
+ inputSchema: import_schema.baseSchema.extend({
54
53
  width: import_mcpBundle.z.number().describe("Width of the browser window"),
55
54
  height: import_mcpBundle.z.number().describe("Height of the browser window")
56
55
  }),
@@ -24,14 +24,14 @@ __export(dialogs_exports, {
24
24
  module.exports = __toCommonJS(dialogs_exports);
25
25
  var import_mcpBundle = require("../../../mcpBundle");
26
26
  var import_tool = require("./tool");
27
- var import_common = require("./common");
27
+ var import_schema = require("./schema");
28
28
  const handleDialog = (0, import_tool.defineTabTool)({
29
29
  capability: "core",
30
30
  schema: {
31
31
  name: "browser_handle_dialog",
32
32
  title: "Handle a dialog",
33
33
  description: "Handle a dialog",
34
- inputSchema: import_common.baseSchema.extend({
34
+ inputSchema: import_schema.baseSchema.extend({
35
35
  accept: import_mcpBundle.z.boolean().describe("Whether to accept the dialog."),
36
36
  promptText: import_mcpBundle.z.string().optional().describe("The text of the prompt in case of a prompt dialog.")
37
37
  }),
@@ -24,8 +24,8 @@ module.exports = __toCommonJS(evaluate_exports);
24
24
  var import_mcpBundle = require("../../../mcpBundle");
25
25
  var import_utils = require("playwright-core/lib/utils");
26
26
  var import_tool = require("./tool");
27
- var import_common = require("./common");
28
- const evaluateSchema = import_common.baseSchema.extend({
27
+ var import_schema = require("./schema");
28
+ const evaluateSchema = import_schema.baseSchema.extend({
29
29
  function: import_mcpBundle.z.string().describe("() => { /* code */ } or (element) => { /* code */ } when element is provided"),
30
30
  element: import_mcpBundle.z.string().optional().describe("Human-readable element description used to obtain permission to interact with the element"),
31
31
  ref: import_mcpBundle.z.string().optional().describe("Exact target element reference from the page snapshot")
@@ -24,14 +24,14 @@ __export(files_exports, {
24
24
  module.exports = __toCommonJS(files_exports);
25
25
  var import_mcpBundle = require("../../../mcpBundle");
26
26
  var import_tool = require("./tool");
27
- var import_common = require("./common");
27
+ var import_schema = require("./schema");
28
28
  const uploadFile = (0, import_tool.defineTabTool)({
29
29
  capability: "core",
30
30
  schema: {
31
31
  name: "browser_file_upload",
32
32
  title: "Upload files",
33
33
  description: "Upload one or multiple files",
34
- inputSchema: import_common.baseSchema.extend({
34
+ inputSchema: import_schema.baseSchema.extend({
35
35
  paths: import_mcpBundle.z.array(import_mcpBundle.z.string()).optional().describe("The absolute paths to the files to upload. Can be single file or multiple files. If omitted, file chooser is cancelled.")
36
36
  }),
37
37
  type: "action"
@@ -24,14 +24,14 @@ module.exports = __toCommonJS(form_exports);
24
24
  var import_mcpBundle = require("../../../mcpBundle");
25
25
  var import_utils = require("playwright-core/lib/utils");
26
26
  var import_tool = require("./tool");
27
- var import_common = require("./common");
27
+ var import_schema = require("./schema");
28
28
  const fillForm = (0, import_tool.defineTabTool)({
29
29
  capability: "core",
30
30
  schema: {
31
31
  name: "browser_fill_form",
32
32
  title: "Fill form",
33
33
  description: "Fill multiple form fields",
34
- inputSchema: import_common.baseSchema.extend({
34
+ inputSchema: import_schema.baseSchema.extend({
35
35
  fields: import_mcpBundle.z.array(import_mcpBundle.z.object({
36
36
  name: import_mcpBundle.z.string().describe("Human-readable field name"),
37
37
  type: import_mcpBundle.z.enum(["textbox", "checkbox", "radio", "combobox", "slider"]).describe("Type of the field"),
@@ -24,14 +24,14 @@ module.exports = __toCommonJS(keyboard_exports);
24
24
  var import_mcpBundle = require("../../../mcpBundle");
25
25
  var import_tool = require("./tool");
26
26
  var import_snapshot = require("./snapshot");
27
- var import_common = require("./common");
27
+ var import_schema = require("./schema");
28
28
  const press = (0, import_tool.defineTabTool)({
29
29
  capability: "core-input",
30
30
  schema: {
31
31
  name: "browser_press_key",
32
32
  title: "Press a key",
33
33
  description: "Press a key on the keyboard",
34
- inputSchema: import_common.baseSchema.extend({
34
+ inputSchema: import_schema.baseSchema.extend({
35
35
  key: import_mcpBundle.z.string().describe("Name of the key to press or a character to generate, such as `ArrowLeft` or `a`")
36
36
  }),
37
37
  type: "input"
@@ -56,7 +56,7 @@ const pressSequentially = (0, import_tool.defineTabTool)({
56
56
  name: "browser_press_sequentially",
57
57
  title: "Type text key by key",
58
58
  description: "Type text key by key on the keyboard",
59
- inputSchema: import_common.baseSchema.extend({
59
+ inputSchema: import_schema.baseSchema.extend({
60
60
  text: import_mcpBundle.z.string().describe("Text to type"),
61
61
  submit: import_mcpBundle.z.boolean().optional().describe("Whether to submit entered text (press Enter after)")
62
62
  }),
@@ -116,7 +116,7 @@ const keydown = (0, import_tool.defineTabTool)({
116
116
  name: "browser_keydown",
117
117
  title: "Press a key down",
118
118
  description: "Press a key down on the keyboard",
119
- inputSchema: import_common.baseSchema.extend({
119
+ inputSchema: import_schema.baseSchema.extend({
120
120
  key: import_mcpBundle.z.string().describe("Name of the key to press or a character to generate, such as `ArrowLeft` or `a`")
121
121
  }),
122
122
  type: "input"
@@ -133,7 +133,7 @@ const keyup = (0, import_tool.defineTabTool)({
133
133
  name: "browser_keyup",
134
134
  title: "Press a key up",
135
135
  description: "Press a key up on the keyboard",
136
- inputSchema: import_common.baseSchema.extend({
136
+ inputSchema: import_schema.baseSchema.extend({
137
137
  key: import_mcpBundle.z.string().describe("Name of the key to press or a character to generate, such as `ArrowLeft` or `a`")
138
138
  }),
139
139
  type: "input"
@@ -23,14 +23,14 @@ __export(navigate_exports, {
23
23
  module.exports = __toCommonJS(navigate_exports);
24
24
  var import_mcpBundle = require("../../../mcpBundle");
25
25
  var import_tool = require("./tool");
26
- var import_common = require("./common");
26
+ var import_schema = require("./schema");
27
27
  const navigate = (0, import_tool.defineTool)({
28
28
  capability: "core-navigation",
29
29
  schema: {
30
30
  name: "browser_navigate",
31
31
  title: "Navigate to a URL",
32
32
  description: "Navigate to a URL",
33
- inputSchema: import_common.baseSchema.extend({
33
+ inputSchema: import_schema.baseSchema.extend({
34
34
  url: import_mcpBundle.z.string().describe("The URL to navigate to")
35
35
  }),
36
36
  type: "action"
@@ -57,7 +57,7 @@ const goBack = (0, import_tool.defineTabTool)({
57
57
  name: "browser_navigate_back",
58
58
  title: "Go back",
59
59
  description: "Go back to the previous page in the history",
60
- inputSchema: import_common.baseSchema.extend({}),
60
+ inputSchema: import_schema.baseSchema.extend({}),
61
61
  type: "action"
62
62
  },
63
63
  handle: async (tab, params, response) => {
@@ -73,7 +73,7 @@ const goForward = (0, import_tool.defineTabTool)({
73
73
  name: "browser_navigate_forward",
74
74
  title: "Go forward",
75
75
  description: "Go forward to the next page in the history",
76
- inputSchema: import_common.baseSchema.extend({}),
76
+ inputSchema: import_schema.baseSchema.extend({}),
77
77
  type: "action"
78
78
  },
79
79
  handle: async (tab, params, response) => {
@@ -89,7 +89,7 @@ const reload = (0, import_tool.defineTabTool)({
89
89
  name: "browser_reload",
90
90
  title: "Reload the page",
91
91
  description: "Reload the current page",
92
- inputSchema: import_common.baseSchema.extend({}),
92
+ inputSchema: import_schema.baseSchema.extend({}),
93
93
  type: "action"
94
94
  },
95
95
  handle: async (tab, params, response) => {
@@ -37,8 +37,8 @@ var import_test = require("playwright/test");
37
37
  var import_mcpBundle = require("../../../mcpBundle");
38
38
  var import_ai_runner = require("@cotestdev/ai-runner");
39
39
  var import_tool = require("./tool");
40
- var import_common = require("./common");
41
- const codeSchema = import_common.baseSchema.extend({
40
+ var import_schema = require("./schema");
41
+ const codeSchema = import_schema.baseSchema.extend({
42
42
  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(); }\``)
43
43
  });
44
44
  const runCode = (0, import_tool.defineTabTool)({
@@ -0,0 +1,31 @@
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 schema_exports = {};
20
+ __export(schema_exports, {
21
+ baseSchema: () => baseSchema
22
+ });
23
+ module.exports = __toCommonJS(schema_exports);
24
+ var import_mcpBundle = require("../../../mcpBundle");
25
+ const baseSchema = import_mcpBundle.z.object({
26
+ toolText: import_mcpBundle.z.string().describe("A human-readable description of the action to perform by the tool.")
27
+ });
28
+ // Annotate the CommonJS export names for ESM import in node:
29
+ 0 && (module.exports = {
30
+ baseSchema
31
+ });
@@ -28,8 +28,8 @@ var import_utils2 = require("playwright-core/lib/utils");
28
28
  var import_mcpBundle = require("../../../mcpBundle");
29
29
  var import_tool = require("./tool");
30
30
  var import_utils3 = require("./utils");
31
- var import_common = require("./common");
32
- const screenshotSchema = import_common.baseSchema.extend({
31
+ var import_schema = require("./schema");
32
+ const screenshotSchema = import_schema.baseSchema.extend({
33
33
  type: import_mcpBundle.z.enum(["png", "jpeg"]).default("png").describe("Image format for the screenshot. Default is png."),
34
34
  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."),
35
35
  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."),
@@ -25,7 +25,7 @@ module.exports = __toCommonJS(snapshot_exports);
25
25
  var import_mcpBundle = require("../../../mcpBundle");
26
26
  var import_utils = require("playwright-core/lib/utils");
27
27
  var import_tool = require("./tool");
28
- var import_common = require("./common");
28
+ var import_schema = require("./schema");
29
29
  const snapshot = (0, import_tool.defineTool)({
30
30
  capability: "core",
31
31
  schema: {
@@ -42,7 +42,7 @@ const snapshot = (0, import_tool.defineTool)({
42
42
  response.setIncludeFullSnapshot(params.filename);
43
43
  }
44
44
  });
45
- const elementSchema = import_common.baseSchema.extend({
45
+ const elementSchema = import_schema.baseSchema.extend({
46
46
  element: import_mcpBundle.z.string().optional().describe("Human-readable element description used to obtain permission to interact with the element"),
47
47
  ref: import_mcpBundle.z.string().describe("Exact target element reference from the page snapshot")
48
48
  });
@@ -87,7 +87,7 @@ const drag = (0, import_tool.defineTabTool)({
87
87
  name: "browser_drag",
88
88
  title: "Drag mouse",
89
89
  description: "Perform drag and drop between two elements",
90
- inputSchema: import_common.baseSchema.extend({
90
+ inputSchema: import_schema.baseSchema.extend({
91
91
  startElement: import_mcpBundle.z.string().describe("Human-readable source element description used to obtain the permission to interact with the element"),
92
92
  startRef: import_mcpBundle.z.string().describe("Exact source element reference from the page snapshot"),
93
93
  endElement: import_mcpBundle.z.string().describe("Human-readable target element description used to obtain the permission to interact with the element"),
@@ -24,14 +24,14 @@ module.exports = __toCommonJS(tabs_exports);
24
24
  var import_mcpBundle = require("../../../mcpBundle");
25
25
  var import_tool = require("./tool");
26
26
  var import_response = require("../response");
27
- var import_common = require("./common");
27
+ var import_schema = require("./schema");
28
28
  const browserTabs = (0, import_tool.defineTool)({
29
29
  capability: "core-tabs",
30
30
  schema: {
31
31
  name: "browser_tabs",
32
32
  title: "Manage tabs",
33
33
  description: "List, create, close, or select a browser tab.",
34
- inputSchema: import_common.baseSchema.extend({
34
+ inputSchema: import_schema.baseSchema.extend({
35
35
  action: import_mcpBundle.z.enum(["list", "new", "close", "select"]).describe("Operation to perform"),
36
36
  index: import_mcpBundle.z.number().optional().describe("Tab index, used for close/select. If omitted for close, current tab is closed.")
37
37
  }),
@@ -24,14 +24,14 @@ module.exports = __toCommonJS(verify_exports);
24
24
  var import_mcpBundle = require("../../../mcpBundle");
25
25
  var import_utils = require("playwright-core/lib/utils");
26
26
  var import_tool = require("./tool");
27
- var import_common = require("./common");
27
+ var import_schema = require("./schema");
28
28
  const verifyElement = (0, import_tool.defineTabTool)({
29
29
  capability: "testing",
30
30
  schema: {
31
31
  name: "browser_verify_element_visible",
32
32
  title: "Verify element visible",
33
33
  description: "Verify element is visible on the page",
34
- inputSchema: import_common.baseSchema.extend({
34
+ inputSchema: import_schema.baseSchema.extend({
35
35
  role: import_mcpBundle.z.string().describe('ROLE of the element. Can be found in the snapshot like this: `- {ROLE} "Accessible Name":`'),
36
36
  accessibleName: import_mcpBundle.z.string().describe('ACCESSIBLE_NAME of the element. Can be found in the snapshot like this: `- role "{ACCESSIBLE_NAME}"`')
37
37
  }),
@@ -53,7 +53,7 @@ const verifyText = (0, import_tool.defineTabTool)({
53
53
  name: "browser_verify_text_visible",
54
54
  title: "Verify text visible",
55
55
  description: `Verify text is visible on the page. Prefer ${verifyElement.schema.name} if possible.`,
56
- inputSchema: import_common.baseSchema.extend({
56
+ inputSchema: import_schema.baseSchema.extend({
57
57
  text: import_mcpBundle.z.string().describe('TEXT to verify. Can be found in the snapshot like this: `- role "Accessible Name": {TEXT}` or like this: `- text: {TEXT}`')
58
58
  }),
59
59
  type: "assertion"
@@ -74,7 +74,7 @@ const verifyList = (0, import_tool.defineTabTool)({
74
74
  name: "browser_verify_list_visible",
75
75
  title: "Verify list visible",
76
76
  description: "Verify list is visible on the page",
77
- inputSchema: import_common.baseSchema.extend({
77
+ inputSchema: import_schema.baseSchema.extend({
78
78
  element: import_mcpBundle.z.string().describe("Human-readable list description"),
79
79
  ref: import_mcpBundle.z.string().describe("Exact target element reference that points to the list"),
80
80
  items: import_mcpBundle.z.array(import_mcpBundle.z.string()).describe("Items to verify")
@@ -106,7 +106,7 @@ const verifyValue = (0, import_tool.defineTabTool)({
106
106
  name: "browser_verify_value",
107
107
  title: "Verify value",
108
108
  description: "Verify element value",
109
- inputSchema: import_common.baseSchema.extend({
109
+ inputSchema: import_schema.baseSchema.extend({
110
110
  type: import_mcpBundle.z.enum(["textbox", "checkbox", "radio", "combobox", "slider"]).describe("Type of the element"),
111
111
  element: import_mcpBundle.z.string().describe("Human-readable element description"),
112
112
  ref: import_mcpBundle.z.string().describe("Exact target element reference that points to the element"),
@@ -23,14 +23,14 @@ __export(wait_exports, {
23
23
  module.exports = __toCommonJS(wait_exports);
24
24
  var import_mcpBundle = require("../../../mcpBundle");
25
25
  var import_tool = require("./tool");
26
- var import_common = require("./common");
26
+ var import_schema = require("./schema");
27
27
  const wait = (0, import_tool.defineTool)({
28
28
  capability: "core",
29
29
  schema: {
30
30
  name: "browser_wait_for",
31
31
  title: "Wait for",
32
32
  description: "Wait for text to appear or disappear or a specified time to pass",
33
- inputSchema: import_common.baseSchema.extend({
33
+ inputSchema: import_schema.baseSchema.extend({
34
34
  time: import_mcpBundle.z.number().optional().describe("The time to wait in seconds"),
35
35
  text: import_mcpBundle.z.string().optional().describe("The text to wait for"),
36
36
  textGone: import_mcpBundle.z.string().optional().describe("The text to wait for to disappear")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cotestdev/mcp_playwright",
3
- "version": "0.0.36",
3
+ "version": "0.0.38",
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,6 +25,7 @@
25
25
  "author": "",
26
26
  "license": "Apache-2.0",
27
27
  "dependencies": {
28
+ "@cotestdev/ai-runner": "^0.0.7",
28
29
  "playwright": "^1.40.0",
29
30
  "playwright-core": "^1.40.0"
30
31
  },