@ada-mcp/mcp-server 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -6624,6 +6624,13 @@ function resolveBootstrapInstallDeps(argv2) {
6624
6624
  if (nativeDir) extras.nativeDriversDir = nativeDir;
6625
6625
  return { skip: false, scopes, force, extras };
6626
6626
  }
6627
+ var PREINSTALL_PLAYWRIGHT_HOST_ALLOW = /* @__PURE__ */ new Set([
6628
+ "https://cdn.playwright.dev",
6629
+ "https://playwright.azureedge.net"
6630
+ ]);
6631
+ function normalizePlaywrightHost(url) {
6632
+ return url.replace(/\/$/, "");
6633
+ }
6627
6634
  function applyPreinstallPlaywrightHostFile() {
6628
6635
  if (process.env.PLAYWRIGHT_DOWNLOAD_HOST?.trim()) {
6629
6636
  return;
@@ -6634,12 +6641,18 @@ function applyPreinstallPlaywrightHostFile() {
6634
6641
  for (const root of roots) {
6635
6642
  const file = import_node_path10.default.join(root, ".ada-mcp-playwright-host");
6636
6643
  try {
6637
- const host = import_node_fs3.default.readFileSync(file, "utf8").trim();
6638
- if (host.length > 0) {
6644
+ const host = normalizePlaywrightHost(import_node_fs3.default.readFileSync(file, "utf8").trim());
6645
+ if (host.length > 0 && PREINSTALL_PLAYWRIGHT_HOST_ALLOW.has(host)) {
6639
6646
  process.env.PLAYWRIGHT_DOWNLOAD_HOST = host;
6640
6647
  console.error(`[ADA-MCP] using playwright CDN from ${file}: ${host}`);
6641
6648
  return;
6642
6649
  }
6650
+ if (host.length > 0) {
6651
+ console.error(
6652
+ `[ADA-MCP] ignore preinstall playwright CDN (runtime will re-probe): ${host}`
6653
+ );
6654
+ return;
6655
+ }
6643
6656
  } catch {
6644
6657
  }
6645
6658
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-mcp/mcp-server",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "ADA MCP server for web/mobile automation (stdio + remote HTTP)",
5
5
  "private": false,
6
6
  "type": "commonjs",
@@ -35,7 +35,7 @@
35
35
  "express": "^5.2.1",
36
36
  "jimp": "^1.6.0",
37
37
  "js-yaml": "^4.1.0",
38
- "playwright": "^1.59.1",
38
+ "playwright": "1.59.1",
39
39
  "selenium-webdriver": "^4.34.0"
40
40
  },
41
41
  "devDependencies": {
@@ -62,7 +62,11 @@ async function main() {
62
62
  console.error(`[ada-mcp preinstall] registry ${candidate} -> ${latency === null ? "fail" : `${latency}ms`}`);
63
63
  }
64
64
 
65
- const pwCandidates = playwrightHostCandidateList();
65
+ /** preinstall 阶段依赖尚未安装,无法校验浏览器包是否存在;仅测官方 CDN,避免写入国内镜像后 404 */
66
+ const pwCandidates = [
67
+ "https://cdn.playwright.dev",
68
+ "https://playwright.azureedge.net"
69
+ ];
66
70
  const pw = await detectBestPlaywrightHost(pwCandidates);
67
71
  const hostFile = path.join(root, ".ada-mcp-playwright-host");
68
72
  fs.writeFileSync(hostFile, `${pw.best}\n`, "utf8");