From 726c97ef1e66f8927700232b856aaa89d941cfa1 Mon Sep 17 00:00:00 2001 From: David Burns Date: Mon, 9 Nov 2026 14:43:56 +0000 Subject: [PATCH 1/2] [js] Move selenium-mcp to the SeleniumHQ/mcp repo The MCP server now lives in its own repository, with its own npm build and CI, so it can release on its own schedule rather than with the bindings. Remove javascript/selenium-mcp and its wiring: the pnpm workspace entry and lockfile importer, the npm_translate_lock input, the common/src/web visibility, .bazelignore, and the JavaScript CI targets. --- .bazelignore | 1 - .github/workflows/ci-javascript.yml | 7 +- MODULE.bazel | 1 - common/src/web/BUILD.bazel | 1 - javascript/selenium-mcp/.prettierignore | 2 - javascript/selenium-mcp/.prettierrc | 7 - javascript/selenium-mcp/AGENTS.md | 36 -- javascript/selenium-mcp/BUILD.bazel | 186 ------ javascript/selenium-mcp/README.md | 141 ----- javascript/selenium-mcp/bin/selenium-mcp.js | 78 --- javascript/selenium-mcp/eslint.config.js | 58 -- javascript/selenium-mcp/lib/cli.js | 127 ---- javascript/selenium-mcp/lib/server.js | 131 ---- javascript/selenium-mcp/lib/session.js | 310 ---------- javascript/selenium-mcp/lib/snapshot.js | 352 ----------- javascript/selenium-mcp/lib/tools/bidi.js | 106 ---- javascript/selenium-mcp/lib/tools/common.js | 162 ----- javascript/selenium-mcp/lib/tools/evaluate.js | 87 --- javascript/selenium-mcp/lib/tools/inspect.js | 85 --- javascript/selenium-mcp/lib/tools/interact.js | 577 ------------------ javascript/selenium-mcp/lib/tools/navigate.js | 241 -------- javascript/selenium-mcp/lib/validate.js | 69 --- javascript/selenium-mcp/package.json | 60 -- javascript/selenium-mcp/test/e2e/harness.js | 200 ------ .../selenium-mcp/test/e2e/tools_test.js | 516 ---------------- .../selenium-mcp/test/fixtures/data.json | 1 - .../selenium-mcp/test/fixtures/drag.html | 21 - .../test/fixtures/frame-inner.html | 8 - .../selenium-mcp/test/fixtures/frames.html | 9 - .../test/fixtures/interactions.html | 35 -- .../selenium-mcp/test/fixtures/network.html | 19 - .../selenium-mcp/test/fixtures/shadow.html | 20 - .../selenium-mcp/test/fixtures/snapshot.html | 40 -- .../selenium-mcp/test/fixtures/upload.html | 24 - javascript/selenium-mcp/test/unit/cli_test.js | 84 --- .../selenium-mcp/test/unit/session_test.js | 184 ------ .../selenium-mcp/test/unit/snapshot_test.js | 212 ------- .../selenium-mcp/test/unit/tools_test.js | 274 --------- .../selenium-mcp/test/unit/validate_test.js | 59 -- pnpm-lock.yaml | 416 ------------- pnpm-workspace.yaml | 1 - 41 files changed, 3 insertions(+), 4945 deletions(-) delete mode 100644 javascript/selenium-mcp/.prettierignore delete mode 100644 javascript/selenium-mcp/.prettierrc delete mode 100644 javascript/selenium-mcp/AGENTS.md delete mode 100644 javascript/selenium-mcp/BUILD.bazel delete mode 100644 javascript/selenium-mcp/README.md delete mode 100755 javascript/selenium-mcp/bin/selenium-mcp.js delete mode 100644 javascript/selenium-mcp/eslint.config.js delete mode 100644 javascript/selenium-mcp/lib/cli.js delete mode 100644 javascript/selenium-mcp/lib/server.js delete mode 100644 javascript/selenium-mcp/lib/session.js delete mode 100644 javascript/selenium-mcp/lib/snapshot.js delete mode 100644 javascript/selenium-mcp/lib/tools/bidi.js delete mode 100644 javascript/selenium-mcp/lib/tools/common.js delete mode 100644 javascript/selenium-mcp/lib/tools/evaluate.js delete mode 100644 javascript/selenium-mcp/lib/tools/inspect.js delete mode 100644 javascript/selenium-mcp/lib/tools/interact.js delete mode 100644 javascript/selenium-mcp/lib/tools/navigate.js delete mode 100644 javascript/selenium-mcp/lib/validate.js delete mode 100644 javascript/selenium-mcp/package.json delete mode 100644 javascript/selenium-mcp/test/e2e/harness.js delete mode 100644 javascript/selenium-mcp/test/e2e/tools_test.js delete mode 100644 javascript/selenium-mcp/test/fixtures/data.json delete mode 100644 javascript/selenium-mcp/test/fixtures/drag.html delete mode 100644 javascript/selenium-mcp/test/fixtures/frame-inner.html delete mode 100644 javascript/selenium-mcp/test/fixtures/frames.html delete mode 100644 javascript/selenium-mcp/test/fixtures/interactions.html delete mode 100644 javascript/selenium-mcp/test/fixtures/network.html delete mode 100644 javascript/selenium-mcp/test/fixtures/shadow.html delete mode 100644 javascript/selenium-mcp/test/fixtures/snapshot.html delete mode 100644 javascript/selenium-mcp/test/fixtures/upload.html delete mode 100644 javascript/selenium-mcp/test/unit/cli_test.js delete mode 100644 javascript/selenium-mcp/test/unit/session_test.js delete mode 100644 javascript/selenium-mcp/test/unit/snapshot_test.js delete mode 100644 javascript/selenium-mcp/test/unit/tools_test.js delete mode 100644 javascript/selenium-mcp/test/unit/validate_test.js diff --git a/.bazelignore b/.bazelignore index afc67b95a7716..dc4882a050048 100644 --- a/.bazelignore +++ b/.bazelignore @@ -17,7 +17,6 @@ java/client/build java/server/build javascript/atoms/node_modules javascript/grid-ui/node_modules -javascript/selenium-mcp/node_modules javascript/selenium-webdriver/node_modules node_modules .local diff --git a/.github/workflows/ci-javascript.yml b/.github/workflows/ci-javascript.yml index b2bd4279584f4..cd2a81d7b733a 100644 --- a/.github/workflows/ci-javascript.yml +++ b/.github/workflows/ci-javascript.yml @@ -37,7 +37,7 @@ jobs: uses: ./.github/workflows/bazel.yml with: name: Lint - run: bazel test //javascript/selenium-webdriver:eslint-test //javascript/selenium-mcp:eslint-test + run: bazel test //javascript/selenium-webdriver:eslint-test # Tests on 22.23.4 (earliest supported version) are run in smoke and RBE. # This job covers the latest supported version. @@ -54,7 +54,7 @@ jobs: name: Unit Tests (${{ matrix.node-version }}, ${{ matrix.os }}) os: ${{ matrix.os }} node-version: ${{ matrix.node-version }} - run: bazel test //javascript/selenium-webdriver:small-tests //javascript/selenium-mcp:small-tests + run: bazel test //javascript/selenium-webdriver:small-tests smoke: name: ${{ matrix.os }}-smoke @@ -74,7 +74,7 @@ jobs: rerun-with-debug: true download-artifact-name: targets run: > - [ -s bazel-targets-js.txt ] || printf '%s\n' //javascript/selenium-webdriver/... //javascript/selenium-mcp/... > bazel-targets-js.txt; + [ -s bazel-targets-js.txt ] || echo //javascript/selenium-webdriver/... > bazel-targets-js.txt; ./scripts/github-actions/bazel-test-if-targets.sh --config=gh-browser ${{ inputs.compile-manager && '--manager=host' || '' }} @@ -100,4 +100,3 @@ jobs: --config=gh-browser --test_tag_filters=${{ matrix.tag_filters }},-os-sensitive,-se-manager //javascript/selenium-webdriver/... - //javascript/selenium-mcp/... diff --git a/MODULE.bazel b/MODULE.bazel index 6a6480d4e160e..5a99c8260b1b9 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -109,7 +109,6 @@ npm.npm_translate_lock( "@//:pnpm-workspace.yaml", "@//javascript/grid-ui:package.json", "@//javascript/private:package.json", - "@//javascript/selenium-mcp:package.json", "@//javascript/selenium-webdriver:package.json", ], generate_bzl_library_targets = True, diff --git a/common/src/web/BUILD.bazel b/common/src/web/BUILD.bazel index 6fb29cd62300c..4ea486d2b977e 100644 --- a/common/src/web/BUILD.bazel +++ b/common/src/web/BUILD.bazel @@ -23,7 +23,6 @@ js_library( ":web", ], visibility = [ - "//javascript/selenium-mcp:__subpackages__", "//javascript/selenium-webdriver:__subpackages__", ], ) diff --git a/javascript/selenium-mcp/.prettierignore b/javascript/selenium-mcp/.prettierignore deleted file mode 100644 index 5098fa12859cc..0000000000000 --- a/javascript/selenium-mcp/.prettierignore +++ /dev/null @@ -1,2 +0,0 @@ -**/*.html -**/*.md diff --git a/javascript/selenium-mcp/.prettierrc b/javascript/selenium-mcp/.prettierrc deleted file mode 100644 index 8aa9214b0ddaa..0000000000000 --- a/javascript/selenium-mcp/.prettierrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "endOfLine": "lf", - "printWidth": 120, - "semi": false, - "singleQuote": true, - "trailingComma": "all" -} diff --git a/javascript/selenium-mcp/AGENTS.md b/javascript/selenium-mcp/AGENTS.md deleted file mode 100644 index 138da6982d511..0000000000000 --- a/javascript/selenium-mcp/AGENTS.md +++ /dev/null @@ -1,36 +0,0 @@ - - -## Code location - -- Server: `javascript/selenium-mcp/lib/` - - `server.js`: MCP server and tool registration - - `session.js`: browser lifecycle, options, Grid URL, console capture over BiDi - - `snapshot.js`: the in-page accessibility walk and the ref table - - `tools/`: one file per tool group (`navigate`, `interact`, `inspect`, `bidi`) -- CLI: `javascript/selenium-mcp/bin/selenium-mcp.js`, flags parsed in `lib/cli.js` -- Tests: `test/unit/` (no browser, jsdom) and `test/e2e/` (real browser, in-memory MCP client) - -## Common commands - -- Unit tests: `bazel test //javascript/selenium-mcp:small-tests` -- Browser tests: `bazel test //javascript/selenium-mcp:e2e-tests-chrome` -- Lint: `bazel test //javascript/selenium-mcp:eslint-test //javascript/selenium-mcp:prettier-test` - -## Rules for tools - -- Match `@playwright/mcp` names, arguments and semantics wherever the operation is the same. `selenium_*` is only for - what Selenium alone can offer. -- The tool list is sent to the agent on every turn. Keep descriptions short; `test/unit/tools_test.js` enforces the - token budget and the exact tool set. -- Tools take refs, never selectors. Errors meant for the agent are `ToolError`s with a next step in the message - ("Call browser_snapshot to get fresh refs"). -- Actions return `actionResult(...)` so the agent gets a fresh snapshot without another call. -- Never write to stdout outside the MCP transport; logs go to stderr. - -## Code conventions - -Follow `javascript/selenium-webdriver/AGENTS.md` for logging (`selenium-webdriver/lib/logging`, logger names under -`selenium.mcp.`), deprecation and JSDoc. - -`collectNodes` in `lib/snapshot.js` runs inside the page and is serialized with `Function#toString`: it must not use -anything from its module scope. diff --git a/javascript/selenium-mcp/BUILD.bazel b/javascript/selenium-mcp/BUILD.bazel deleted file mode 100644 index c782e28e75d21..0000000000000 --- a/javascript/selenium-mcp/BUILD.bazel +++ /dev/null @@ -1,186 +0,0 @@ -load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin") -load("@aspect_bazel_lib//lib:jq.bzl", "jq") -load("@aspect_rules_js//js:defs.bzl", "js_library") -load("@aspect_rules_js//npm:defs.bzl", "npm_package") -load("@npm//:defs.bzl", "npm_link_all_packages") -load("@npm//javascript/selenium-mcp:eslint/package_json.bzl", eslint_bin = "bin") -load("@npm//javascript/selenium-webdriver:prettier/package_json.bzl", prettier_bin = "bin") -load("//:version.bzl", "VERSIONS") -load("//common:browsers.bzl", "COMMON_TAGS") -load("//javascript:defs.bzl", "mocha_test") -load("//javascript/private:browsers.bzl", "BROWSERS") - -npm_link_all_packages(name = "node_modules") - -VERSION = VERSIONS["javascript"] - -js_library( - name = "prod-src-files", - srcs = glob([ - "bin/*.js", - "lib/**/*.js", - ]), - deps = [ - ":node_modules/@modelcontextprotocol/sdk", - ":node_modules/zod", - ], -) - -# The server and the bindings release together at the same version, and the -# published package depends on exactly that bindings version. In the workspace -# the bindings come from //:node_modules/selenium-webdriver (HEAD) instead, so -# package.json leaves the dependency out and the stamp adds it. -jq( - name = "package-json-stamped", - srcs = ["package.json"], - out = "stamped/package.json", - filter = '.version = "%s" | .dependencies["selenium-webdriver"] = "%s"' % (VERSION, VERSION), -) - -genrule( - name = "license", - srcs = ["//:license"], - outs = [ - "LICENSE", - "NOTICE", - ], - cmd = "cp $(locations //:license) $(@D)", -) - -npm_package( - name = "selenium-mcp", - srcs = [ - "README.md", - ":license", - ":prod-src-files", - ] + select({ - "//common:stamp": [":package-json-stamped"], - "//conditions:default": ["package.json"], - }), - package = "@selenium/mcp", - publishable = True, - replace_prefixes = {"stamped/": ""}, - tags = [ - "release-artifact", - ], - visibility = ["//visibility:public"], -) - -js_library( - name = "package-json", - srcs = ["package.json"], -) - -js_library( - name = "test-files", - testonly = True, - srcs = glob([ - "test/**/*.js", - "test/fixtures/**", - ]), -) - -mocha_test( - name = "small-tests", - size = "small", - args = ["test/unit/*_test.js"], - chdir = package_name(), - data = [ - ":node_modules/mocha", - ":node_modules/mocha-junit-reporter", - ":package-json", - ":prod-src-files", - ":test-files", - "//:node_modules/selenium-webdriver", - ], - tags = ["unit"], -) - -# Chrome only for v0; the other browsers join as the server supports them. -E2E_BROWSERS = ["chrome"] - -[ - mocha_test( - name = "e2e-tests-%s" % browser, - size = "large", - args = [ - "--retries", - "1", - "test/e2e/*_test.js", - ], - chdir = package_name(), - data = BROWSERS[browser]["data"] + [ - ":node_modules/@bazel/runfiles", - ":node_modules/mocha", - ":node_modules/mocha-junit-reporter", - ":package-json", - ":prod-src-files", - ":test-files", - "//:node_modules/selenium-webdriver", - "//common/src/web:js-lib", - ], - env = { - "SELENIUM_BROWSER": browser, - } | BROWSERS[browser]["env"], - tags = [browser] + COMMON_TAGS, - ) - for browser in E2E_BROWSERS -] - -copy_to_bin( - name = "eslint-config", - srcs = ["eslint.config.js"], -) - -eslint_bin.eslint_test( - name = "eslint-test", - args = ["."], - chdir = package_name(), - data = [ - ":eslint-config", - ":node_modules/@bazel/runfiles", - ":node_modules/@eslint/js", - ":node_modules/eslint-plugin-mocha", - ":node_modules/eslint-plugin-n", - ":node_modules/eslint-plugin-no-only-tests", - ":node_modules/eslint-plugin-prettier", - ":node_modules/globals", - ":node_modules/mocha", - ":package-json", - # eslint-plugin-prettier reads the same config as prettier-test. - ":prettier-config", - ":prod-src-files", - ":test-files", - "//:node_modules/selenium-webdriver", - ], - tags = [ - "lint", - "skip-rbe", - ], -) - -copy_to_bin( - name = "prettier-config", - srcs = [ - ".prettierignore", - ".prettierrc", - ], -) - -prettier_bin.prettier_test( - name = "prettier-test", - args = [ - ".", - "--check", - "--ignore-unknown", - "--config=.prettierrc", - ], - chdir = package_name(), - data = [ - ":package-json", - ":prettier-config", - ":prod-src-files", - ":test-files", - ], - tags = ["lint"], -) diff --git a/javascript/selenium-mcp/README.md b/javascript/selenium-mcp/README.md deleted file mode 100644 index 9ebe04b69fb45..0000000000000 --- a/javascript/selenium-mcp/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# Selenium MCP server - -`@selenium/mcp` is the official [Model Context Protocol](https://modelcontextprotocol.io) server from the Selenium -project. It lets a coding agent drive a real browser through Selenium: the agent reads the page as an accessibility -snapshot with element refs, and acts on those refs. It never has to write or guess a selector. - -It is the Selenium bindings exposed as tools, not a test runner. Selenium Manager comes with the bindings, so there is -no driver to install. - -> **Status: v1 in progress.** Chrome, headless by default, over stdio, one browser per server. See -> [What it covers](#what-it-covers). - -## Setup - -You need Node.js `^22.23.4 || ^24.22.1 || >= 26.12.1` and Chrome. Then add the server to your agent: - -**Claude Code** - -```sh -claude mcp add selenium -- npx @selenium/mcp@latest -``` - -**Codex** - -```sh -codex mcp add selenium -- npx @selenium/mcp@latest -``` - -**Cursor**: add to `.cursor/mcp.json` (or `~/.cursor/mcp.json`): - -```json -{ "mcpServers": { "selenium": { "command": "npx", "args": ["@selenium/mcp@latest"] } } } -``` - -**VS Code**: add to `.vscode/mcp.json`: - -```json -{ "servers": { "selenium": { "command": "npx", "args": ["@selenium/mcp@latest"] } } } -``` - -Any other MCP client: run `npx @selenium/mcp@latest` as a stdio server. - -## Options - -| Flag | Meaning | -| -------------------------- | ----------------------------------------------------------------------- | -| `--browser ` | `chrome` (default). `edge` and `firefox` start but are not yet tested. | -| `--headless` / `--headed` | Run headless (the default) or show the window. | -| `--grid ` | Run the browser on a Selenium Grid instead of locally. | -| `--allowed-origins ` | Semicolon-separated origins or hosts (`*.example.com`) the browser may navigate to. | -| `--blocked-origins ` | Semicolon-separated origins or hosts it may not navigate to. | -| `--allow-unrestricted-file-access` | Let `browser_navigate` open `file://` URLs, and `browser_file_upload` send files from outside the working directory (both blocked by default). | -| `--allow-evaluate` | Offer `browser_evaluate`, which runs JavaScript the agent writes in the page. | -| `--log-level ` | Log to stderr: `severe`, `warning` (default), `info`, `fine`, `all`. `all` includes raw WebDriver traffic, so typed text such as passwords. | - -Flag names match `@playwright/mcp` wherever they mean the same thing. - -## Tools - -Tool names and arguments match `@playwright/mcp` wherever the operation is the same, so habits and skills files carry -over. - -| Tool | What it does | -| -------------------------- | -------------------------------------------------------------------- | -| `browser_snapshot` | The page as an accessibility tree with refs. `all: true` adds text and structure. | -| `browser_navigate` | Go to a URL. | -| `browser_navigate_back` | Go back. | -| `browser_click` | Click a ref (optionally double or right click). | -| `browser_type` | Replace the text in a ref, optionally pressing Enter. | -| `browser_fill_form` | Fill several textboxes, checkboxes, radios and selects at once. | -| `browser_select_option` | Choose options in a ` by value or by visible text. - * - * @param {!Object} element the select element - * @param {!Array} values - * @return {!Promise>} the labels of the options selected - */ -async function selectOptions(element, values) { - const tag = (await element.getTagName()).toLowerCase() - if (tag !== 'select') - throw new ToolError('browser_select_option needs a - - diff --git a/javascript/selenium-mcp/test/fixtures/frames.html b/javascript/selenium-mcp/test/fixtures/frames.html deleted file mode 100644 index fbd0069f6df2b..0000000000000 --- a/javascript/selenium-mcp/test/fixtures/frames.html +++ /dev/null @@ -1,9 +0,0 @@ - - -Frames fixture - -

Outer

- - - - diff --git a/javascript/selenium-mcp/test/fixtures/interactions.html b/javascript/selenium-mcp/test/fixtures/interactions.html deleted file mode 100644 index f97289fabf020..0000000000000 --- a/javascript/selenium-mcp/test/fixtures/interactions.html +++ /dev/null @@ -1,35 +0,0 @@ - - -Interactions fixture - -

Interactions

- - - - - - - - - - - - - - - - Open in new tab -

Nothing yet

- - - diff --git a/javascript/selenium-mcp/test/fixtures/network.html b/javascript/selenium-mcp/test/fixtures/network.html deleted file mode 100644 index 5a2d45ebe600e..0000000000000 --- a/javascript/selenium-mcp/test/fixtures/network.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Network - - - -

Nothing yet

- - - diff --git a/javascript/selenium-mcp/test/fixtures/shadow.html b/javascript/selenium-mcp/test/fixtures/shadow.html deleted file mode 100644 index 4cdc030a15a2a..0000000000000 --- a/javascript/selenium-mcp/test/fixtures/shadow.html +++ /dev/null @@ -1,20 +0,0 @@ - - -Shadow fixture - - - - - diff --git a/javascript/selenium-mcp/test/fixtures/snapshot.html b/javascript/selenium-mcp/test/fixtures/snapshot.html deleted file mode 100644 index e3e92c21f6526..0000000000000 --- a/javascript/selenium-mcp/test/fixtures/snapshot.html +++ /dev/null @@ -1,40 +0,0 @@ - - -Snapshot fixture - -
-
-

Sign in

-

Enter your details below.

-
- - - - - - - - - - -
-
- - -
-
Wrong password
-
Saved
- -
Custom button
-
Clickable div
- Inside presentation - Logo - - Labelledby two - -
- - diff --git a/javascript/selenium-mcp/test/fixtures/upload.html b/javascript/selenium-mcp/test/fixtures/upload.html deleted file mode 100644 index 7fbc2b22e51f2..0000000000000 --- a/javascript/selenium-mcp/test/fixtures/upload.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - Upload - - - -
- - -
-
- - -
- -

Nothing yet

- - diff --git a/javascript/selenium-mcp/test/unit/cli_test.js b/javascript/selenium-mcp/test/unit/cli_test.js deleted file mode 100644 index 09d7ed8276067..0000000000000 --- a/javascript/selenium-mcp/test/unit/cli_test.js +++ /dev/null @@ -1,84 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -'use strict' - -const assert = require('node:assert') - -const { parseCommandLine } = require('../../lib/cli') - -describe('cli', function () { - it('defaults to headless Chrome', function () { - const config = parseCommandLine([]) - assert.strictEqual(config.browser, 'chrome') - assert.strictEqual(config.headless, true) - assert.strictEqual(config.grid, undefined) - assert.deepStrictEqual(config.allowedOrigins, []) - }) - - it('shows the browser with --headed', function () { - assert.strictEqual(parseCommandLine(['--headed']).headless, false) - }) - - it('rejects --headless with --headed', function () { - assert.throws(() => parseCommandLine(['--headless', '--headed']), /cannot both/) - }) - - it('accepts the other browsers and rejects unknown ones', function () { - assert.strictEqual(parseCommandLine(['--browser', 'Firefox']).browser, 'firefox') - assert.strictEqual(parseCommandLine(['--browser=edge']).browser, 'edge') - assert.throws(() => parseCommandLine(['--browser', 'netscape']), /must be one of/) - }) - - it('takes a Grid URL and checks it', function () { - assert.strictEqual(parseCommandLine(['--grid', 'http://grid:4444']).grid, 'http://grid:4444') - assert.throws(() => parseCommandLine(['--grid', 'not a url']), /must be a URL/) - }) - - it('splits origin lists on semicolons', function () { - const config = parseCommandLine(['--allowed-origins', 'https://a.test; *.b.test;', '--blocked-origins', 'c.test']) - assert.deepStrictEqual(config.allowedOrigins, ['https://a.test', '*.b.test']) - assert.deepStrictEqual(config.blockedOrigins, ['c.test']) - }) - - it('explains flags that are planned but not supported yet', function () { - assert.throws(() => parseCommandLine(['--port', '8931']), /HTTP transport/) - assert.throws(() => parseCommandLine(['--caps=network']), /not supported yet/) - }) - - it('offers browser_evaluate only with --allow-evaluate', function () { - assert.strictEqual(parseCommandLine([]).allowEvaluate, false) - assert.strictEqual(parseCommandLine(['--allow-evaluate']).allowEvaluate, true) - }) - - it('keeps file:// blocked unless asked', function () { - assert.strictEqual(parseCommandLine([]).allowFileAccess, false) - assert.strictEqual(parseCommandLine(['--allow-unrestricted-file-access']).allowFileAccess, true) - }) - - it('takes a log level in any case and refuses one it does not know', function () { - assert.strictEqual(parseCommandLine([]).logLevel, 'warning') - assert.strictEqual(parseCommandLine(['--log-level', 'FINE']).logLevel, 'fine') - for (const level of ['debug', 'warn', 'verbose']) { - assert.throws(() => parseCommandLine(['--log-level', level]), /--log-level must be one of/) - } - }) - - it('rejects unknown flags', function () { - assert.throws(() => parseCommandLine(['--nope'])) - }) -}) diff --git a/javascript/selenium-mcp/test/unit/session_test.js b/javascript/selenium-mcp/test/unit/session_test.js deleted file mode 100644 index 9064ecb8c42fb..0000000000000 --- a/javascript/selenium-mcp/test/unit/session_test.js +++ /dev/null @@ -1,184 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -'use strict' - -const assert = require('node:assert') - -const { Session } = require('../../lib/session') -const { setSliderValue } = require('../../lib/tools/interact') - -/** A driver that records quit() and has no BiDi, so console capture is skipped. */ -function fakeDriver() { - return { - quits: 0, - async quit() { - this.quits++ - }, - // The BiDi connection starts by reading the session's capabilities. - async getCapabilities() { - throw new Error('no BiDi in this test') - }, - } -} - -/** Builds that settle only when the test says so, to force each interleaving. */ -function controlledBuilds() { - const pending = [] - const buildDriver = () => - new Promise((resolve) => { - pending.push(() => { - const driver = fakeDriver() - resolve(driver) - return driver - }) - }) - return { pending, buildDriver } -} - -const CONFIG = { browser: 'chrome', headless: true } - -describe('Session lifecycle', function () { - it('hands out the browser only once console and network capture are listening', async function () { - let listening - const driver = { - async quit() {}, - getCapabilities: () => - new Promise((_resolve, reject) => { - listening = () => reject(new Error('no BiDi in this test')) - }), - } - const session = new Session(CONFIG, { buildDriver: async () => driver }) - const starting = session.driver() - while (!listening) await new Promise((resolve) => setImmediate(resolve)) - assert.strictEqual(session.isOpen, false) - listening() - assert.strictEqual(await starting, driver) - assert.strictEqual(session.isOpen, true) - }) - - it('starts one browser for concurrent callers', async function () { - const builds = controlledBuilds() - const session = new Session(CONFIG, builds) - const first = session.driver() - const second = session.driver() - assert.strictEqual(builds.pending.length, 1) - const driver = builds.pending[0]() - assert.strictEqual(await first, driver) - assert.strictEqual(await second, driver) - assert.strictEqual(session.isOpen, true) - }) - - it('quits a browser that finishes starting after close, without close waiting for it', async function () { - const builds = controlledBuilds() - const session = new Session(CONFIG, builds) - const starting = session.driver() - await session.close() - const driver = builds.pending[0]() - await assert.rejects(starting, /closed while it was starting/) - assert.strictEqual(driver.quits, 1) - assert.strictEqual(session.isOpen, false) - }) - - it('keeps a new browser when an abandoned start settles after it', async function () { - const builds = controlledBuilds() - const session = new Session(CONFIG, builds) - const abandoned = session.driver() - await session.close() - const fresh = session.driver() - assert.strictEqual(builds.pending.length, 2) - const freshDriver = builds.pending[1]() - assert.strictEqual(await fresh, freshDriver) - const oldDriver = builds.pending[0]() - await assert.rejects(abandoned, /closed while it was starting/) - assert.strictEqual(oldDriver.quits, 1) - assert.strictEqual(freshDriver.quits, 0) - assert.strictEqual(await session.driver(), freshDriver) - }) - - it('quits the running browser on close and starts a new one on the next call', async function () { - const builds = controlledBuilds() - const session = new Session(CONFIG, builds) - const starting = session.driver() - const first = builds.pending[0]() - await starting - await session.close() - assert.strictEqual(first.quits, 1) - assert.strictEqual(session.isOpen, false) - const next = session.driver() - const second = builds.pending[1]() - assert.strictEqual(await next, second) - }) - - it('stops the driver of a browser that went away, without waiting for it', async function () { - const builds = controlledBuilds() - const session = new Session(CONFIG, builds) - const starting = session.driver() - const gone = builds.pending[0]() - await starting - gone.quit = function () { - this.quits++ - return new Promise(() => {}) - } - session.discard() - assert.strictEqual(gone.quits, 1) - assert.strictEqual(session.isOpen, false) - }) - - it('waits on close for a discarded browser to finish quitting', async function () { - const builds = controlledBuilds() - const session = new Session(CONFIG, builds) - const starting = session.driver() - const gone = builds.pending[0]() - await starting - let finishQuit - gone.quit = () => new Promise((resolve) => (finishQuit = resolve)) - session.discard() - let closed = false - const closing = session.close().then(() => (closed = true)) - await new Promise((resolve) => setImmediate(resolve)) - assert.strictEqual(closed, false) - finishQuit() - await closing - assert.strictEqual(closed, true) - }) - - it('stops waiting on close for a discarded browser that never quits', async function () { - const builds = controlledBuilds() - const session = new Session(CONFIG, { ...builds, discardWaitMs: 20 }) - const starting = session.driver() - const gone = builds.pending[0]() - await starting - gone.quit = () => new Promise(() => {}) - session.discard() - await session.close() - assert.strictEqual(session.isOpen, false) - }) -}) - -describe('setSliderValue', function () { - it('refuses strings that are not HTML numbers before touching the page', async function () { - const untouchable = { - async executeScript() { - throw new Error('the page must not be touched') - }, - } - for (const value of ['0x5', '5.', '1e', '+5', ' 5', '', 'Infinity', 'five']) { - await assert.rejects(setSliderValue(untouchable, {}, value), /not a number the slider accepts/, value) - } - }) -}) diff --git a/javascript/selenium-mcp/test/unit/snapshot_test.js b/javascript/selenium-mcp/test/unit/snapshot_test.js deleted file mode 100644 index 3c25d279c962c..0000000000000 --- a/javascript/selenium-mcp/test/unit/snapshot_test.js +++ /dev/null @@ -1,212 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -'use strict' - -const assert = require('node:assert') - -const { AccessibilityNode, WebElement } = require('selenium-webdriver') - -const { RefTable, formatLine, framePrefix, renderTree } = require('../../lib/snapshot') - -let nextId = 0 - -/** A node backed by an element, as the bindings return it. */ -function el(role, name, fields = {}) { - return new AccessibilityNode({ role, name, element: new WebElement(null, `id-${++nextId}`), ...fields }) -} - -function text(content) { - return new AccessibilityNode({ role: 'text', name: content }) -} - -function page(...children) { - return new AccessibilityNode({ role: 'document', name: 'Page', element: new WebElement(null, 'root'), children }) -} - -async function render(root, options = {}, table = new RefTable()) { - const { lines, entries } = await renderTree(root, table, options) - return { text: lines.join('\n'), entries, table } -} - -describe('snapshot', function () { - describe('renderTree', function () { - const form = () => - page( - el('banner', '', { children: [el('navigation', '', { children: [el('link', 'Home')] })] }), - el('main', '', { - children: [ - el('heading', 'Sign in', { states: { level: 1 }, children: [text('Sign in')] }), - el('paragraph', '', { children: [text('Enter your details below.')] }), - el('form', '', { - children: [ - text('Username'), - el('textbox', 'Username', { value: 'ada' }), - el('textbox', 'Password', { value: '••••••' }), - el('checkbox', 'Remember me', { states: { checked: true } }), - el('combobox', 'Country', { - value: 'France', - children: [el('option', 'United Kingdom'), el('option', 'France', { states: { selected: true } })], - }), - el('button', 'Sign in', { states: { disabled: true } }), - el('button', 'Menu', { states: { expanded: false } }), - ], - }), - el('alert', '', { children: [text('Wrong password')] }), - el('status', '', { children: [text('Saved'), el('button', 'Dismiss')] }), - ], - }), - ) - - it('lists interactive elements with roles, names and state', async function () { - const { text } = await render(form()) - for (const line of [ - '[e1] link "Home"', - 'heading "Sign in" [level=1]', - 'textbox "Username" [value="ada"]', - 'checkbox "Remember me" [checked]', - 'combobox "Country" [value="France"]', - ' option "France" [selected]', - 'button "Sign in" [disabled]', - 'button "Menu" [collapsed]', - ]) { - assert.ok(text.includes(line), `expected ${JSON.stringify(line)} in:\n${text}`) - } - }) - - it('names alerts and status regions from their text', async function () { - const { text } = await render(form()) - assert.match(text, /\] alert "Wrong password"$/m) - assert.match(text, /\] status "Saved"\n {2}\[e\d+\] button "Dismiss"$/m) - }) - - it('leaves out structure and text by default', async function () { - const { text } = await render(form()) - for (const absent of ['banner', 'main', 'form', 'paragraph', 'Enter your details', 'text ']) { - assert.ok(!text.includes(absent), `did not expect ${absent} in:\n${text}`) - } - }) - - it('includes structure and text when asked for everything', async function () { - const { text } = await render(form(), { all: true }) - assert.ok(text.includes('text "Enter your details below."'), text) - assert.ok(/^\[e\d+\] main$/m.test(text), text) - assert.ok(/^ +\[e\d+\] form$/m.test(text), text) - assert.ok(!text.includes('text "Wrong password"'), 'the alert name already says it') - }) - - it('gives a native select’s options no refs, since browser_select_option takes their text', async function () { - const { text } = await render(form()) - assert.match(text, /^ {2}option "United Kingdom"$/m) - const listbox = page(el('listbox', 'Pick', { children: [el('option', 'One')] })) - assert.match((await render(listbox)).text, /\[e\d+\] option "One"/) - }) - - it('keeps an element’s ref across snapshots and drops refs for elements that went away', async function () { - const table = new RefTable() - const save = el('button', 'Save') - const remove = el('button', 'Remove me') - const first = await render(page(remove, save), {}, table) - table.replaceWith(first.entries) - assert.match(first.text, /\[e2\] button "Save"/) - const second = await render(page(save), {}, table) - table.replaceWith(second.entries) - assert.match(second.text, /^\[e2\] button "Save"$/) - assert.throws(() => table.get('e1'), /not in the current snapshot/) - assert.strictEqual(table.get('e2').element, save.element) - }) - - it('puts frame content under the iframe with prefixed refs and the frame path', async function () { - const frame = el('iframe', 'Inner', { children: [page(el('button', 'In frame'))] }) - const { text, entries } = await render(page(el('button', 'Outer'), frame)) - assert.match(text, /^\[e2\] iframe "Inner"\n {2}\[f2e1\] button "In frame"$/m) - assert.deepStrictEqual(entries.get('f2e1').framePath, [frame.element]) - }) - - it('says when a frame could not be read', async function () { - const { text } = await render(page(el('iframe', 'Gone'))) - assert.match(text, /iframe "Gone"\n {2}\(frame content not available\)/) - }) - - it('stops descending into deeply nested frames', async function () { - let node = el('button', 'Deep') - for (let i = 0; i < 7; i++) node = el('iframe', `F${i}`, { children: [page(node)] }) - const { text } = await render(page(node)) - assert.match(text, /\(frames nested too deep, not shown\)/) - assert.ok(!text.includes('Deep'), text) - }) - - it('shortens long names', async function () { - const { text } = await render(page(el('link', 'x'.repeat(300)))) - assert.match(text, /link "x{99}…"/) - }) - }) - - describe('formatLine', function () { - it('indents, quotes the name and lists properties', function () { - assert.strictEqual( - formatLine({ depth: 2, role: 'checkbox', name: 'Say "hi"', props: ['checked', 'disabled'] }, 'e4'), - ' [e4] checkbox "Say \\"hi\\"" [checked] [disabled]', - ) - }) - - it('omits the ref and name when there are none', function () { - assert.strictEqual(formatLine({ depth: 0, role: 'option', name: '', props: [] }, null), 'option') - }) - }) - - describe('framePrefix', function () { - it('nests frame refs under the frame element ref', function () { - assert.strictEqual(framePrefix('', 7), 'f7') - assert.strictEqual(framePrefix('f7', 3), 'f7f3') - }) - }) - - describe('RefTable', function () { - it('looks refs up, with or without brackets', function () { - const table = new RefTable() - const entry = { element: {}, framePath: [] } - table.set('e3', entry) - assert.strictEqual(table.get('e3'), entry) - assert.strictEqual(table.get('[e3]'), entry) - }) - - it('explains how to recover from an unknown ref', function () { - assert.throws(() => new RefTable().get('e9'), /Call browser_snapshot/) - }) - - it('drops refs the new entries leave out', function () { - const table = new RefTable() - table.set('e1', { element: {}, framePath: [] }) - table.set('e2', { element: {}, framePath: [] }) - const kept = { element: {}, framePath: [] } - table.replaceWith(new Map([['e2', kept]])) - assert.throws(() => table.get('e1'), /not in the current snapshot/) - assert.strictEqual(table.get('e2'), kept) - }) - - it('numbers elements per frame and starts again once cleared', function () { - const table = new RefTable() - assert.strictEqual(table.numberFor('', 'a'), 1) - assert.strictEqual(table.numberFor('', 'b'), 2) - assert.strictEqual(table.numberFor('f1', 'c'), 1) - assert.strictEqual(table.numberFor('', 'a'), 1) - table.clear() - assert.strictEqual(table.numberFor('', 'b'), 1) - }) - }) -}) diff --git a/javascript/selenium-mcp/test/unit/tools_test.js b/javascript/selenium-mcp/test/unit/tools_test.js deleted file mode 100644 index e12f95643d017..0000000000000 --- a/javascript/selenium-mcp/test/unit/tools_test.js +++ /dev/null @@ -1,274 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -'use strict' - -const assert = require('node:assert') - -const { allTools } = require('../../lib/server') -const { checkOrigin, normalizeUrl } = require('../../lib/tools/navigate') -const fs = require('node:fs') -const os = require('node:os') -const path = require('node:path') - -const { framePartOf, parseChecked, parseKey, resolveUploadPaths } = require('../../lib/tools/interact') -const { formatRequest, isStatic } = require('../../lib/tools/bidi') -const { formatResult } = require('../../lib/tools/evaluate') -const { Key, WebElement } = require('selenium-webdriver') - -/** Every tool offered by default, named as @playwright/mcp names them. */ -const DEFAULT_TOOLS = [ - 'browser_snapshot', - 'browser_click', - 'browser_type', - 'browser_fill_form', - 'browser_select_option', - 'browser_press_key', - 'browser_hover', - 'browser_navigate', - 'browser_navigate_back', - 'browser_wait_for', - 'browser_take_screenshot', - 'browser_console_messages', - 'browser_handle_dialog', - 'browser_tabs', - 'browser_close', - 'browser_install', - 'browser_drag', - 'browser_file_upload', - 'browser_resize', - 'browser_network_requests', -] - -/** The plan's v1 gate: the default tool list stays at 25 or fewer. */ -const MAX_DEFAULT_TOOLS = 25 - -/** Agents pay for the tool list on every turn; the plan caps it. */ -const TOOL_LIST_TOKEN_BUDGET = 4000 - -const tools = allTools() -const defaultTools = allTools({ allowEvaluate: false }) - -describe('tools', function () { - it('are exactly the default set unless more are asked for', function () { - assert.deepStrictEqual(defaultTools.map((t) => t.name).sort(), [...DEFAULT_TOOLS].sort()) - assert.ok(defaultTools.length <= MAX_DEFAULT_TOOLS, `${defaultTools.length} default tools`) - }) - - it('offer browser_evaluate only with --allow-evaluate', function () { - const names = allTools({ allowEvaluate: true }).map((t) => t.name) - assert.ok(names.includes('browser_evaluate')) - assert.ok(!defaultTools.some((t) => t.name === 'browser_evaluate')) - }) - - it('stay well inside the token budget', function () { - const listed = JSON.stringify( - tools.map(({ name, description, inputSchema }) => ({ name, description, inputSchema })), - ) - // Roughly 4 characters per token for English and JSON; 3 to stay conservative. - const tokens = Math.ceil(listed.length / 3) - assert.ok(tokens < TOOL_LIST_TOKEN_BUDGET, `tool list is about ${tokens} tokens`) - }) - - it('have object schemas whose required arguments exist', function () { - for (const tool of tools) { - assert.strictEqual(tool.inputSchema.type, 'object', tool.name) - for (const key of tool.inputSchema.required || []) { - assert.ok(tool.inputSchema.properties[key], `${tool.name} requires undeclared ${key}`) - } - assert.ok(tool.description.length <= 200, `${tool.name} description is long`) - } - }) - - describe('framePartOf', function () { - it('separates the frame part of a ref from the element', function () { - assert.strictEqual(framePartOf('e12'), '') - assert.strictEqual(framePartOf('f5e1'), 'f5') - assert.strictEqual(framePartOf('[f5f2e3]'), 'f5f2') - }) - }) - - describe('resolveUploadPaths', function () { - let root - let outside - - before(function () { - root = fs.mkdtempSync(path.join(os.tmpdir(), 'mcp-upload-')) - fs.writeFileSync(path.join(root, 'a.txt'), 'a') - fs.mkdirSync(path.join(root, 'dir')) - outside = fs.mkdtempSync(path.join(os.tmpdir(), 'mcp-outside-')) - fs.writeFileSync(path.join(outside, 'secret.txt'), 's') - fs.symlinkSync(path.join(outside, 'secret.txt'), path.join(root, 'link.txt')) - }) - - after(function () { - fs.rmSync(root, { recursive: true, force: true }) - fs.rmSync(outside, { recursive: true, force: true }) - }) - - it('resolves paths relative to the working directory', function () { - assert.deepStrictEqual(resolveUploadPaths(['a.txt'], {}, root), [fs.realpathSync(path.join(root, 'a.txt'))]) - }) - - it('refuses files outside the working directory, symlinks included', function () { - const secret = path.join(outside, 'secret.txt') - assert.throws(() => resolveUploadPaths([secret], {}, root), /outside the working directory/) - assert.throws(() => resolveUploadPaths(['link.txt'], {}, root), /outside the working directory/) - assert.deepStrictEqual(resolveUploadPaths([secret], { allowFileAccess: true }, root), [fs.realpathSync(secret)]) - }) - - it('refuses missing files, directories and an empty list', function () { - assert.throws(() => resolveUploadPaths(['nope.txt'], {}, root), /No such file/) - assert.throws(() => resolveUploadPaths(['dir'], {}, root), /Not a file/) - assert.throws(() => resolveUploadPaths([], {}, root), /at least one/) - }) - }) - - describe('network requests', function () { - it('formats requests the way @playwright/mcp does', function () { - assert.strictEqual( - formatRequest({ method: 'GET', url: 'https://a.test/', status: 200, statusText: 'OK' }), - '[GET] https://a.test/ => [200] OK', - ) - assert.strictEqual( - formatRequest({ method: 'POST', url: 'https://a.test/x' }), - '[POST] https://a.test/x => pending', - ) - assert.strictEqual( - formatRequest({ method: 'GET', url: 'https://a.test/y', error: 'net::ERR_FAILED' }), - '[GET] https://a.test/y => failed: net::ERR_FAILED', - ) - }) - - it('treats images, fonts, scripts and stylesheets as static', function () { - assert.ok(isStatic({ destination: 'image' })) - assert.ok(isStatic({ destination: '', mimeType: 'text/css; charset=utf-8' })) - assert.ok(isStatic({ destination: '', mimeType: 'application/javascript' })) - assert.ok(!isStatic({ destination: '', mimeType: 'application/json' })) - assert.ok(!isStatic({ destination: 'document', mimeType: 'text/html' })) - }) - }) - - describe('evaluate results', function () { - it('are JSON, with elements and undefined spelled out', function () { - assert.strictEqual(formatResult(undefined), 'undefined') - assert.strictEqual(formatResult(3), '3') - assert.strictEqual(formatResult({ a: undefined }), '{\n "a": ""\n}') - assert.strictEqual(formatResult([new WebElement(null, 'id')]), '[\n ""\n]') - }) - - it('are cut when very long', function () { - assert.match(formatResult('x'.repeat(30000)), /more characters cut/) - }) - }) - - describe('normalizeUrl', function () { - it('adds a scheme to bare hosts', function () { - assert.strictEqual(normalizeUrl('example.com'), 'https://example.com') - assert.strictEqual(normalizeUrl('localhost:3000/x'), 'http://localhost:3000/x') - assert.strictEqual(normalizeUrl('http://example.com'), 'http://example.com') - assert.strictEqual(normalizeUrl('about:blank'), 'about:blank') - assert.strictEqual(normalizeUrl('example.com:8080/x'), 'https://example.com:8080/x') - assert.strictEqual(normalizeUrl('data:text/html,hi'), 'data:text/html,hi') - }) - }) - - describe('checkOrigin', function () { - const config = (allowed = [], blocked = []) => ({ allowedOrigins: allowed, blockedOrigins: blocked }) - - it('allows everything by default', function () { - checkOrigin('https://example.com/a', config()) - }) - - it('enforces the allow list by origin or host', function () { - checkOrigin('https://a.test/x', config(['https://a.test'])) - checkOrigin('https://deep.b.test/x', config(['*.b.test'])) - assert.throws(() => checkOrigin('http://a.test/x', config(['https://a.test'])), /not in --allowed-origins/) - assert.throws(() => checkOrigin('https://c.test', config(['a.test'])), /not in --allowed-origins/) - }) - - it('lets the block list win', function () { - assert.throws(() => checkOrigin('https://a.test', config(['a.test'], ['a.test'])), /blocked/) - }) - - it('always allows about:blank', function () { - checkOrigin('about:blank', config(['a.test'])) - }) - - it('matches hosts case-insensitively', function () { - assert.throws(() => checkOrigin('https://a.test', config([], ['A.TEST'])), /blocked/) - assert.throws(() => checkOrigin('https://x.a.test', config([], ['*.A.Test'])), /blocked/) - }) - - it('ignores the DNS root dot on either side', function () { - assert.throws(() => checkOrigin('https://example.com./', config([], ['example.com'])), /blocked/) - assert.throws(() => checkOrigin('https://x.example.com./', config([], ['*.example.com'])), /blocked/) - assert.throws(() => checkOrigin('https://example.com:8080/', config([], ['example.com.:8080'])), /blocked/) - checkOrigin('https://example.com./', config(['example.com'])) - }) - - it('blocks file:// unless allowed', function () { - assert.throws(() => checkOrigin('file:///etc/passwd', config()), /--allow-unrestricted-file-access/) - checkOrigin('file:///tmp/page.html', { ...config(), allowFileAccess: true }) - }) - - it('allows data: only without an allow list', function () { - checkOrigin('data:text/html,hi', config()) - assert.throws(() => checkOrigin('data:text/html,hi', config(['a.test'])), /data: URLs are not allowed/) - }) - - it('refuses other schemes', function () { - assert.throws(() => checkOrigin('javascript:alert(1)', config()), /not supported/) - assert.throws(() => checkOrigin('chrome://settings', config()), /not supported/) - }) - }) - - describe('parseKey', function () { - it('maps key names and characters', function () { - assert.deepStrictEqual(parseKey('Enter'), { modifiers: [], key: Key.ENTER }) - assert.deepStrictEqual(parseKey('a'), { modifiers: [], key: 'a' }) - assert.deepStrictEqual(parseKey('+'), { modifiers: [], key: '+' }) - }) - - it('takes an emoji as one character', function () { - assert.deepStrictEqual(parseKey('😀'), { modifiers: [], key: '😀' }) - }) - - it('parses chords', function () { - assert.deepStrictEqual(parseKey('Control+Shift+ArrowLeft'), { - modifiers: [Key.CONTROL, Key.SHIFT], - key: Key.ARROW_LEFT, - }) - }) - - it('rejects unknown names', function () { - assert.throws(() => parseKey('Hyper'), /Unknown key/) - }) - }) - - describe('parseChecked', function () { - it('takes true or false, ignoring case and spaces', function () { - assert.strictEqual(parseChecked({ name: 'Agree', value: 'True' }), true) - assert.strictEqual(parseChecked({ name: 'Agree', value: ' false ' }), false) - }) - - it('refuses anything else instead of unchecking', function () { - assert.throws(() => parseChecked({ name: 'Agree', value: 'treu' }), /Agree: use "true" or "false"/) - assert.throws(() => parseChecked({ name: 'Agree', value: 'yes' }), /not "yes"/) - }) - }) -}) diff --git a/javascript/selenium-mcp/test/unit/validate_test.js b/javascript/selenium-mcp/test/unit/validate_test.js deleted file mode 100644 index 66d366327b54c..0000000000000 --- a/javascript/selenium-mcp/test/unit/validate_test.js +++ /dev/null @@ -1,59 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -'use strict' - -const assert = require('node:assert') - -const { validate } = require('../../lib/validate') - -const SCHEMA = { - type: 'object', - properties: { - ref: { type: 'string' }, - count: { type: 'number' }, - flag: { type: 'boolean' }, - mode: { type: 'string', enum: ['a', 'b'] }, - list: { type: 'array', items: { type: 'object', properties: { v: { type: 'string' } }, required: ['v'] } }, - }, - required: ['ref'], -} - -describe('validate', function () { - it('accepts valid arguments', function () { - assert.deepStrictEqual(validate(SCHEMA, { ref: 'e1', count: 2, flag: true, mode: 'a', list: [{ v: 'x' }] }), []) - }) - - it('reports missing required arguments', function () { - assert.deepStrictEqual(validate(SCHEMA, {}), ['arguments.ref is required']) - }) - - it('reports wrong types, enum values and unknown arguments', function () { - assert.deepStrictEqual(validate(SCHEMA, { ref: 1, count: 'x', mode: 'c', extra: 1 }), [ - 'arguments.ref must be a string', - 'arguments.count must be a number', - 'arguments.mode must be one of "a", "b"', - 'arguments.extra is not a known argument', - ]) - }) - - it('checks array items', function () { - assert.deepStrictEqual(validate(SCHEMA, { ref: 'e1', list: [{ v: 'ok' }, {}] }), [ - 'arguments.list[1].v is required', - ]) - }) -}) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4231cdad5fc3e..b35bfdd4e3410 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,8 +4,6 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false -packageExtensionsChecksum: sha256-nM8iufI5Id1KvysOfGJDc1w8piX+VSKA1/9BvLLu6Wc= - importers: .: {} @@ -115,52 +113,6 @@ importers: specifier: 5.8.3 version: 5.8.3 - javascript/selenium-mcp: - dependencies: - '@modelcontextprotocol/sdk': - specifier: ^1.32.2 - version: 1.32.2(zod@4.6.7) - zod: - specifier: ^4.6.7 - version: 4.6.7 - devDependencies: - '@bazel/runfiles': - specifier: ^6.5.0 - version: 6.5.0 - '@eslint/js': - specifier: ^10.0.1 - version: 10.0.1(eslint@10.14.0) - eslint: - specifier: ^10.14.0 - version: 10.14.0 - eslint-config-prettier: - specifier: ^10.1.8 - version: 10.1.8(eslint@10.14.0) - eslint-plugin-mocha: - specifier: ^11.3.0 - version: 11.3.0(eslint@10.14.0) - eslint-plugin-n: - specifier: ^18.5.0 - version: 18.5.0(eslint@10.14.0)(typescript@5.8.3) - eslint-plugin-no-only-tests: - specifier: ^3.4.0 - version: 3.4.0 - eslint-plugin-prettier: - specifier: ^5.5.7 - version: 5.5.7(eslint-config-prettier@10.1.8(eslint@10.14.0))(eslint@10.14.0)(prettier@3.9.10) - globals: - specifier: ^17.14.0 - version: 17.14.0 - mocha: - specifier: ^11.8.0 - version: 11.8.0 - mocha-junit-reporter: - specifier: ^2.2.1 - version: 2.2.1(mocha@11.8.0) - prettier: - specifier: ^3.9.10 - version: 3.9.10 - javascript/selenium-webdriver: dependencies: '@bazel/runfiles': @@ -706,12 +658,6 @@ packages: peerDependencies: graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - '@hono/node-server@2.1.6': - resolution: {integrity: sha512-p/KH9MnfNcsm3sR6x4lNgm5j+QN4Et8srKredl9DZfXiyZ1UQ3aQ2YVpFLbqktYN5JI+DB+VZFKM2PqE5hLKjQ==} - engines: {node: '>=20'} - peerDependencies: - hono: ^4 || ^5.0.0-0 - '@humanfs/core@0.19.2': resolution: {integrity: sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==} engines: {node: '>=18.18.0'} @@ -863,16 +809,6 @@ packages: '@keyv/serialize@1.1.1': resolution: {integrity: sha512-dXn3FZhPv0US+7dtJsIi2R+c7qWYiReoEh5zUntWCf4oSpMNib8FDhSoed6m3QyZdx5hK7iLFkYk3rNxwt8vTA==} - '@modelcontextprotocol/sdk@1.32.2': - resolution: {integrity: sha512-SWsVtH/0vULSQStoZ6xxH2K09Li8fXYTMC64ZeogCdpZ3XSi1eCPOByV1OpuJxuI3OcmHhosDWYyii07tpPsLw==} - engines: {node: '>=18'} - peerDependencies: - '@cfworker/json-schema': ^4.1.1 - zod: ^3.25 || ^4.0 - peerDependenciesMeta: - '@cfworker/json-schema': - optional: true - '@mui/core-downloads-tracker@5.18.0': resolution: {integrity: sha512-jbhwoQ1AY200PSSOrNXmrFCaSDSJWP7qk6urkTmIirvRXDROkqe+QwcLlUiw/PrREwsIF/vm3/dAXvjlMHF0RA==} @@ -1254,20 +1190,9 @@ packages: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} - ajv-formats@3.0.1: - resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} - peerDependencies: - ajv: ^8.0.0 - peerDependenciesMeta: - ajv: - optional: true - ajv@6.15.0: resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==} - ajv@8.20.0: - resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} - ansi-escapes@4.3.2: resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} engines: {node: '>=8'} @@ -1614,10 +1539,6 @@ packages: resolution: {integrity: sha512-e+H0ZXHSWYrENhQzw1LPuP4oF5MzVKmDU6d3hxlvaPEYLLg62MxtQNPRx4SYSuYJSBUgnQIG4HIN2tEtNv7Dog==} engines: {node: '>=18'} - content-type@1.0.5: - resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} - engines: {node: '>= 0.6'} - content-type@2.1.0: resolution: {integrity: sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==} engines: {node: '>=18'} @@ -1639,10 +1560,6 @@ packages: core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} - cors@2.8.6: - resolution: {integrity: sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==} - engines: {node: '>= 0.10'} - cosmiconfig@6.0.0: resolution: {integrity: sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==} engines: {node: '>=8'} @@ -2160,14 +2077,6 @@ packages: resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} engines: {node: '>= 0.6'} - eventsource-parser@3.1.1: - resolution: {integrity: sha512-EKN1vKAMcZ8MlYMpaNuxN6R9yakzH6uajHcHVTqWJzvu5pWw9DyhbP35HH8MVBQ+dZjAfDxk+A8NiR9KWaXiyQ==} - engines: {node: '>=18.0.0'} - - eventsource@3.0.7: - resolution: {integrity: sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==} - engines: {node: '>=18.0.0'} - execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} @@ -2183,12 +2092,6 @@ packages: resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - express-rate-limit@8.7.3: - resolution: {integrity: sha512-zPLqDI2f0gV2WmGnacLf9XSSqn4VldRyP5LCzOwx0BKH40mO6+2PCFkoSsRO2jePx87/Kf6NUF6P2QOTKXHbQA==} - engines: {node: '>= 16'} - peerDependencies: - express: '>= 4.11' - express@5.3.0: resolution: {integrity: sha512-qCqy1xSoaugxOD4IVHb1ZWdkvCF2W3aE2okKouWj8VwJ+ztskSiXoBnCSJqfKT+cVPJhuJqe9YLbY425+Zh00g==} engines: {node: '>= 18'} @@ -2209,9 +2112,6 @@ packages: fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - fast-uri@3.1.9: - resolution: {integrity: sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==} - fastq@1.20.3: resolution: {integrity: sha512-XKv5nnLs6nLF71NgiKJLIZFLkPyIEuOselLG7ujZnGrRfQK8HpvY+WqKhAJUAdLomwVHErVS4LfxFlPq0/FTAw==} @@ -2468,10 +2368,6 @@ packages: hoist-non-react-statics@3.3.2: resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==} - hono@4.13.17: - resolution: {integrity: sha512-vZIcbkvjOR5hHRWERbGkr8fGfF0GGM1ooYkuH448iO3b2AdVEr3AXZSw4Z3Kn+1L5z0CVoVeyV29VGYmFh05kQ==} - engines: {node: '>=16.9.0'} - hookified@1.15.1: resolution: {integrity: sha512-MvG/clsADq1GPM2KGo2nyfaWVyn9naPiXrqIe4jYjXNZQt238kWyOGrsyc/DmRAQ+Re6yeo6yX/yoNCG5KAEVg==} @@ -2553,10 +2449,6 @@ packages: resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} engines: {node: '>= 0.4'} - ip-address@10.7.6: - resolution: {integrity: sha512-00LYkM6byILa9eQIx6qoaXCM40xTLd56AZ4vyaPW3YTyb49VZYPo5xsiAq4tuQ54GH4R7gVdYScJ1B7B77PuTg==} - engines: {node: '>= 12'} - ipaddr.js@1.9.1: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} engines: {node: '>= 0.10'} @@ -2909,9 +2801,6 @@ packages: node-notifier: optional: true - jose@6.2.16: - resolution: {integrity: sha512-4LSJpbuBuPdGrONCdZUy0xnxtLf8eEz+EY0SMXdHQEBU7bgUHDVblU/JAjryv3wID9/LK7/YuwFwq+AQNfMscQ==} - js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -2961,12 +2850,6 @@ packages: json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} - json-schema-traverse@1.0.0: - resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} - - json-schema-typed@8.0.2: - resolution: {integrity: sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==} - json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} @@ -3441,10 +3324,6 @@ packages: resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==} engines: {node: '>= 6'} - pkce-challenge@5.0.1: - resolution: {integrity: sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==} - engines: {node: '>=16.20.0'} - pkg-conf@3.1.0: resolution: {integrity: sha512-m0OTbR/5VPNPqO1ph6Fqbj7Hv6QU7gR/tQW40ZqrL1rjgCU85W6C1bJn0BItuJqnR98PWzw7Z8hHeChD1WrgdQ==} engines: {node: '>=6'} @@ -3634,10 +3513,6 @@ packages: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} - require-from-string@2.0.2: - resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} - engines: {node: '>=0.10.0'} - requires-port@1.0.0: resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} @@ -4336,14 +4211,6 @@ packages: zen-observable@0.8.15: resolution: {integrity: sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==} - zod-to-json-schema@3.25.2: - resolution: {integrity: sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==} - peerDependencies: - zod: ^3.25.28 || ^4 - - zod@4.6.7: - resolution: {integrity: sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==} - onlyBuiltDependencies: [] snapshots: @@ -4746,11 +4613,6 @@ snapshots: eslint: 10.14.0(supports-color@10.2.2) eslint-visitor-keys: 3.4.3 - '@eslint-community/eslint-utils@4.10.1(eslint@10.14.0)': - dependencies: - eslint: 10.14.0 - eslint-visitor-keys: 3.4.3 - '@eslint-community/eslint-utils@4.10.1(eslint@8.57.1)': dependencies: eslint: 8.57.1 @@ -4758,14 +4620,6 @@ snapshots: '@eslint-community/regexpp@4.12.3': {} - '@eslint/config-array@0.23.5': - dependencies: - '@eslint/object-schema': 3.0.5 - debug: 4.4.3 - minimatch: 10.2.6 - transitivePeerDependencies: - - supports-color - '@eslint/config-array@0.23.5(supports-color@10.2.2)': dependencies: '@eslint/object-schema': 3.0.5 @@ -4800,10 +4654,6 @@ snapshots: optionalDependencies: eslint: 10.14.0(supports-color@10.2.2) - '@eslint/js@10.0.1(eslint@10.14.0)': - optionalDependencies: - eslint: 10.14.0 - '@eslint/js@8.57.1': {} '@eslint/object-schema@3.0.5': {} @@ -4817,10 +4667,6 @@ snapshots: dependencies: graphql: 16.10.0 - '@hono/node-server@2.1.6(hono@4.13.17)': - dependencies: - hono: 4.13.17 - '@humanfs/core@0.19.2': dependencies: '@humanfs/types': 0.15.0 @@ -5083,28 +4929,6 @@ snapshots: '@keyv/serialize@1.1.1': {} - '@modelcontextprotocol/sdk@1.32.2(zod@4.6.7)': - dependencies: - '@hono/node-server': 2.1.6(hono@4.13.17) - ajv: 8.20.0 - ajv-formats: 3.0.1(ajv@8.20.0) - content-type: 1.0.5 - cors: 2.8.6 - cross-spawn: 7.0.6 - eventsource: 3.0.7 - eventsource-parser: 3.1.1 - express: 5.3.0 - express-rate-limit: 8.7.3(express@5.3.0) - hono: 4.13.17 - jose: 6.2.16 - json-schema-typed: 8.0.2 - pkce-challenge: 5.0.1 - raw-body: 3.0.2 - zod: 4.6.7 - zod-to-json-schema: 3.25.2(zod@4.6.7) - transitivePeerDependencies: - - supports-color - '@mui/core-downloads-tracker@5.18.0': {} '@mui/icons-material@5.18.0(@mui/material@5.18.0(@emotion/react@11.14.0(@types/react@18.3.23)(react@18.3.1))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@18.3.23)(react@18.3.1))(@types/react@18.3.23)(react@18.3.1))(@types/react@18.3.23)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@types/react@18.3.23)(react@18.3.1)': @@ -5532,10 +5356,6 @@ snapshots: transitivePeerDependencies: - supports-color - ajv-formats@3.0.1(ajv@8.20.0): - optionalDependencies: - ajv: 8.20.0 - ajv@6.15.0: dependencies: fast-deep-equal: 3.1.3 @@ -5543,13 +5363,6 @@ snapshots: json-schema-traverse: 0.4.1 uri-js: 4.4.1 - ajv@8.20.0: - dependencies: - fast-deep-equal: 3.1.3 - fast-uri: 3.1.9 - json-schema-traverse: 1.0.0 - require-from-string: 2.0.2 - ansi-escapes@4.3.2: dependencies: type-fest: 0.21.3 @@ -5760,20 +5573,6 @@ snapshots: bluebird@3.7.2: {} - body-parser@2.4.0: - dependencies: - bytes: 3.1.2 - content-type: 2.1.0 - debug: 4.4.3 - http-errors: 2.0.1 - iconv-lite: 0.7.3 - on-finished: 2.4.2 - qs: 6.17.1 - raw-body: 3.0.2 - type-is: 2.1.0 - transitivePeerDependencies: - - supports-color - body-parser@2.4.0(supports-color@10.2.2): dependencies: bytes: 3.1.2 @@ -5971,8 +5770,6 @@ snapshots: content-disposition@2.0.1: {} - content-type@1.0.5: {} - content-type@2.1.0: {} convert-source-map@1.9.0: {} @@ -5985,11 +5782,6 @@ snapshots: core-util-is@1.0.3: {} - cors@2.8.6: - dependencies: - object-assign: 4.1.1 - vary: 1.1.2 - cosmiconfig@6.0.0: dependencies: '@types/parse-json': 4.0.2 @@ -6396,19 +6188,10 @@ snapshots: eslint: 10.14.0(supports-color@10.2.2) semver: 7.8.6 - eslint-compat-utils@0.5.1(eslint@10.14.0): - dependencies: - eslint: 10.14.0 - semver: 7.8.6 - eslint-config-prettier@10.1.8(eslint@10.14.0(supports-color@10.2.2)): dependencies: eslint: 10.14.0(supports-color@10.2.2) - eslint-config-prettier@10.1.8(eslint@10.14.0): - dependencies: - eslint: 10.14.0 - eslint-config-standard-jsx@11.0.0(eslint-plugin-react@7.37.5(eslint@8.57.1))(eslint@8.57.1): dependencies: eslint: 8.57.1 @@ -6459,13 +6242,6 @@ snapshots: eslint: 10.14.0(supports-color@10.2.2) eslint-compat-utils: 0.5.1(eslint@10.14.0(supports-color@10.2.2)) - eslint-plugin-es-x@7.8.0(eslint@10.14.0): - dependencies: - '@eslint-community/eslint-utils': 4.10.1(eslint@10.14.0) - '@eslint-community/regexpp': 4.12.3 - eslint: 10.14.0 - eslint-compat-utils: 0.5.1(eslint@10.14.0) - eslint-plugin-es@4.1.0(eslint@8.57.1): dependencies: eslint: 8.57.1 @@ -6507,12 +6283,6 @@ snapshots: eslint: 10.14.0(supports-color@10.2.2) globals: 15.15.0 - eslint-plugin-mocha@11.3.0(eslint@10.14.0): - dependencies: - '@eslint-community/eslint-utils': 4.10.1(eslint@10.14.0) - eslint: 10.14.0 - globals: 15.15.0 - eslint-plugin-n@15.7.0(eslint@8.57.1): dependencies: builtins: 5.1.0 @@ -6540,21 +6310,6 @@ snapshots: optionalDependencies: typescript: 5.8.3 - eslint-plugin-n@18.5.0(eslint@10.14.0)(typescript@5.8.3): - dependencies: - '@eslint-community/eslint-utils': 4.10.1(eslint@10.14.0) - enhanced-resolve: 5.26.1 - eslint: 10.14.0 - eslint-plugin-es-x: 7.8.0(eslint@10.14.0) - get-tsconfig: 4.14.3 - globals: 15.15.0 - globrex: 0.1.2 - ignore: 5.3.2 - js-yaml: 5.5.0 - semver: 7.8.6 - optionalDependencies: - typescript: 5.8.3 - eslint-plugin-no-only-tests@3.4.0: {} eslint-plugin-prettier@5.5.7(eslint-config-prettier@10.1.8(eslint@10.14.0(supports-color@10.2.2)))(eslint@10.14.0(supports-color@10.2.2))(prettier@3.9.10): @@ -6566,15 +6321,6 @@ snapshots: optionalDependencies: eslint-config-prettier: 10.1.8(eslint@10.14.0(supports-color@10.2.2)) - eslint-plugin-prettier@5.5.7(eslint-config-prettier@10.1.8(eslint@10.14.0))(eslint@10.14.0)(prettier@3.9.10): - dependencies: - eslint: 10.14.0 - prettier: 3.9.10 - prettier-linter-helpers: 1.0.1 - synckit: 0.12.3 - optionalDependencies: - eslint-config-prettier: 10.1.8(eslint@10.14.0) - eslint-plugin-promise@6.6.0(eslint@8.57.1): dependencies: eslint: 8.57.1 @@ -6635,41 +6381,6 @@ snapshots: eslint-visitor-keys@5.0.1: {} - eslint@10.14.0: - dependencies: - '@eslint-community/eslint-utils': 4.10.1(eslint@10.14.0) - '@eslint-community/regexpp': 4.12.3 - '@eslint/config-array': 0.23.5 - '@eslint/config-helpers': 0.7.0 - '@eslint/core': 1.2.1 - '@eslint/plugin-kit': 0.7.3 - '@humanfs/node': 0.16.8 - '@humanwhocodes/module-importer': 1.0.1 - '@humanwhocodes/retry': 0.4.3 - '@types/estree': 1.0.10 - ajv: 6.15.0 - cross-spawn: 7.0.6 - debug: 4.4.3 - escape-string-regexp: 4.0.0 - eslint-scope: 9.1.2 - eslint-visitor-keys: 5.0.1 - espree: 11.2.0 - esquery: 1.7.0 - esutils: 2.0.3 - fast-deep-equal: 3.1.3 - file-entry-cache: 11.1.5 - find-up: 5.0.0 - glob-parent: 6.0.2 - ignore: 5.3.2 - imurmurhash: 0.1.4 - is-glob: 4.0.3 - json-stable-stringify-without-jsonify: 1.0.1 - minimatch: 10.2.6 - natural-compare: 1.4.0 - optionator: 0.9.4 - transitivePeerDependencies: - - supports-color - eslint@10.14.0(supports-color@10.2.2): dependencies: '@eslint-community/eslint-utils': 4.10.1(eslint@10.14.0(supports-color@10.2.2)) @@ -6778,12 +6489,6 @@ snapshots: etag@1.8.1: {} - eventsource-parser@3.1.1: {} - - eventsource@3.0.7: - dependencies: - eventsource-parser: 3.1.1 - execa@5.1.1: dependencies: cross-spawn: 7.0.6 @@ -6808,47 +6513,6 @@ snapshots: jest-message-util: 29.7.0 jest-util: 29.7.0 - express-rate-limit@8.7.3(express@5.3.0): - dependencies: - debug: 4.4.3 - express: 5.3.0 - ip-address: 10.7.6 - transitivePeerDependencies: - - supports-color - - express@5.3.0: - dependencies: - accepts: 2.0.0 - body-parser: 2.4.0 - content-disposition: 2.0.1 - content-type: 2.1.0 - cookie: 0.7.2 - cookie-signature: 1.2.2 - debug: 4.4.3 - depd: 2.0.0 - encodeurl: 2.0.1 - escape-html: 1.0.3 - etag: 1.8.1 - finalhandler: 2.1.1 - fresh: 2.0.0 - http-errors: 2.0.1 - merge-descriptors: 2.0.0 - mime-types: 3.0.2 - on-finished: 2.4.2 - once: 1.4.0 - parseurl: 1.3.3 - proxy-addr: 2.0.8 - qs: 6.17.1 - range-parser: 1.3.0 - router: 2.2.0 - send: 1.2.1 - serve-static: 2.2.1 - statuses: 2.0.2 - type-is: 2.1.0 - vary: 1.1.2 - transitivePeerDependencies: - - supports-color - express@5.3.0(supports-color@10.2.2): dependencies: accepts: 2.0.0 @@ -6898,8 +6562,6 @@ snapshots: fast-levenshtein@2.0.6: {} - fast-uri@3.1.9: {} - fastq@1.20.3: dependencies: reusify: 1.1.0 @@ -6924,17 +6586,6 @@ snapshots: dependencies: to-regex-range: 5.0.1 - finalhandler@2.1.1: - dependencies: - debug: 4.4.3 - encodeurl: 2.0.1 - escape-html: 1.0.3 - on-finished: 2.4.2 - parseurl: 1.3.3 - statuses: 2.0.2 - transitivePeerDependencies: - - supports-color - finalhandler@2.1.1(supports-color@10.2.2): dependencies: debug: 4.4.3(supports-color@10.2.2) @@ -7194,8 +6845,6 @@ snapshots: dependencies: react-is: 16.13.1 - hono@4.13.17: {} - hookified@1.15.1: {} hookified@2.2.0: {} @@ -7288,8 +6937,6 @@ snapshots: hasown: 2.0.4 side-channel: 1.1.1 - ip-address@10.7.6: {} - ipaddr.js@1.9.1: {} is-arguments@1.2.0: @@ -7844,8 +7491,6 @@ snapshots: - supports-color - ts-node - jose@6.2.16: {} - js-tokens@4.0.0: {} js-yaml@3.15.2: @@ -7926,10 +7571,6 @@ snapshots: json-schema-traverse@0.4.1: {} - json-schema-traverse@1.0.0: {} - - json-schema-typed@8.0.2: {} - json-stable-stringify-without-jsonify@1.0.1: {} json5@1.0.2: @@ -8142,17 +7783,6 @@ snapshots: mkdirp@3.0.1: {} - mocha-junit-reporter@2.2.1(mocha@11.8.0): - dependencies: - debug: 4.4.3 - md5: 2.3.0 - mkdirp: 3.0.1 - mocha: 11.8.0 - strip-ansi: 6.0.1 - xml: 1.0.1 - transitivePeerDependencies: - - supports-color - mocha-junit-reporter@2.2.1(mocha@11.8.0)(supports-color@10.2.2): dependencies: debug: 4.4.3(supports-color@10.2.2) @@ -8422,8 +8052,6 @@ snapshots: pirates@4.0.7: {} - pkce-challenge@5.0.1: {} - pkg-conf@3.1.0: dependencies: find-up: 3.0.0 @@ -8582,7 +8210,6 @@ snapshots: recast@0.23.21: dependencies: - '@babel/parser': 7.29.13 ast-types: 0.16.3 esprima: 4.0.1 source-map: 0.6.1 @@ -8625,8 +8252,6 @@ snapshots: require-directory@2.1.1: {} - require-from-string@2.0.2: {} - requires-port@1.0.0: {} requizzle@0.2.4: @@ -8673,16 +8298,6 @@ snapshots: dependencies: glob: 7.2.3 - router@2.2.0: - dependencies: - debug: 4.4.3 - depd: 2.0.0 - is-promise: 4.0.0 - parseurl: 1.3.3 - path-to-regexp: 8.4.2 - transitivePeerDependencies: - - supports-color - router@2.2.0(supports-color@10.2.2): dependencies: debug: 4.4.3(supports-color@10.2.2) @@ -8734,22 +8349,6 @@ snapshots: semver@7.8.6: {} - send@1.2.1: - dependencies: - debug: 4.4.3 - encodeurl: 2.0.1 - escape-html: 1.0.3 - etag: 1.8.1 - fresh: 2.0.0 - http-errors: 2.0.1 - mime-types: 3.0.2 - ms: 2.1.3 - on-finished: 2.4.2 - range-parser: 1.3.0 - statuses: 2.0.2 - transitivePeerDependencies: - - supports-color - send@1.2.1(supports-color@10.2.2): dependencies: debug: 4.4.3(supports-color@10.2.2) @@ -8782,15 +8381,6 @@ snapshots: transitivePeerDependencies: - supports-color - serve-static@2.2.1: - dependencies: - encodeurl: 2.0.1 - escape-html: 1.0.3 - parseurl: 1.3.3 - send: 1.2.1 - transitivePeerDependencies: - - supports-color - serve-static@2.2.1(supports-color@10.2.2): dependencies: encodeurl: 2.0.1 @@ -9440,9 +9030,3 @@ snapshots: zen-observable: 0.8.15 zen-observable@0.8.15: {} - - zod-to-json-schema@3.25.2(zod@4.6.7): - dependencies: - zod: 4.6.7 - - zod@4.6.7: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index fe6819e7d19bc..d8fff318af1b8 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -2,7 +2,6 @@ packages: - 'javascript/atoms' - 'javascript/grid-ui' - 'javascript/private' - - 'javascript/selenium-mcp' - 'javascript/selenium-webdriver' onlyBuiltDependencies: [] From befbea01032f66033bff687f12505be0e6512488 Mon Sep 17 00:00:00 2001 From: David Burns Date: Mon, 9 Nov 2026 15:19:35 +0000 Subject: [PATCH 2/2] [js] Regenerate the lockfile with pnpm 10 pnpm 9 ignores packageExtensions in pnpm-workspace.yaml, so it dropped the @babel/parser dependency added to recast, and bidi-schema-tests failed with "Install @babel/parser". pnpm 10, which rules_js uses, keeps it; the diff now only removes what #18280 added. --- pnpm-lock.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b35bfdd4e3410..2046bfcf311fe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,8 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +packageExtensionsChecksum: sha256-nM8iufI5Id1KvysOfGJDc1w8piX+VSKA1/9BvLLu6Wc= + importers: .: {} @@ -8210,6 +8212,7 @@ snapshots: recast@0.23.21: dependencies: + '@babel/parser': 7.29.13 ast-types: 0.16.3 esprima: 4.0.1 source-map: 0.6.1