@ada-mcp/mcp-server 0.1.22 → 0.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,27 +8,27 @@ ADA MCP server package that supports:
8
8
 
9
9
  ## 标准安装(Cursor / MCP)
10
10
 
11
- 请使用 **`@ada-mcp/launcher@0.1.19`** 拉起本包(见 [launcher README](../ada-mcp-launcher/README.md)):
11
+ 请使用 **`@ada-mcp/launcher@0.1.24`** 拉起本包(见 [launcher README](../ada-mcp-launcher/README.md)):
12
12
 
13
13
  ```json
14
14
  {
15
15
  "mcpServers": {
16
16
  "ada-mcp": {
17
17
  "command": "pnpm",
18
- "args": ["dlx", "@ada-mcp/launcher@0.1.19"]
18
+ "args": ["dlx", "@ada-mcp/launcher@0.1.24"]
19
19
  }
20
20
  }
21
21
  }
22
22
  ```
23
23
 
24
- 本包版本:**`@ada-mcp/mcp-server@0.1.19`**(由 launcher 默认拉取;依赖锁定 `playwright@1.59.1`)。
24
+ 本包版本:**`@ada-mcp/mcp-server@0.1.24`**(由 launcher 默认拉取;依赖锁定 `playwright@1.59.1`)。
25
25
 
26
26
  直接调试本包(无 launcher 拉包前测速):
27
27
 
28
28
  ```bash
29
- pnpm dlx @ada-mcp/mcp-server@0.1.19
29
+ pnpm dlx @ada-mcp/mcp-server@0.1.24
30
30
  # npx 等价:
31
- npx -y @ada-mcp/mcp-server@0.1.19
31
+ npx -y @ada-mcp/mcp-server@0.1.24
32
32
  ```
33
33
 
34
34
  ## 启动时自动安装依赖(默认仅 Playwright)
@@ -51,7 +51,7 @@ npx -y @ada-mcp/mcp-server@0.1.19
51
51
  - `ADA_MCP_SKIP_INSTALL_DEPS=1`:跳过自动安装
52
52
  - `ADA_MCP_INSTALL_DEPS_FORCE=1`:强制重装
53
53
  - `ADA_MCP_GECKODRIVER_VERSION` / `ADA_MCP_CHROMEDRIVER_VERSION`:Selenium 驱动版本
54
- - `ADA_PLAYWRIGHT_INSTALL_TIMEOUT_MS`:浏览器下载超时(默认 15 分钟)
54
+ - `ADA_PLAYWRIGHT_INSTALL_TIMEOUT_MS`:浏览器下载超时(默认 30 分钟 / 1800000ms)
55
55
  - `ADA_INSTALL_STRATEGY_TIMEOUT_MS`:npm 装包超时(默认 2 分钟)
56
56
 
57
57
  ## 代理与镜像(`0.1.10+` 推荐)
@@ -83,27 +83,27 @@ npx -y @ada-mcp/mcp-server@0.1.19
83
83
  在标准 `args` 后追加,例如安装全部依赖:
84
84
 
85
85
  ```json
86
- "args": ["dlx", "@ada-mcp/launcher@0.1.19", "--install-deps=all"]
86
+ "args": ["dlx", "@ada-mcp/launcher@0.1.24", "--install-deps=all"]
87
87
  ```
88
88
 
89
89
  ## Cursor MCP 配置
90
90
 
91
- **pnpm(推荐)**:`pnpm` + `dlx @ada-mcp/launcher@0.1.19`
91
+ **pnpm(推荐)**:`pnpm` + `dlx @ada-mcp/launcher@0.1.24`
92
92
 
93
- **npx 等价**(`launcher@0.1.7+`):`npx` + `-y @ada-mcp/launcher@0.1.19`(内层同样 `npx -y` mcp-server,测速逻辑与 pnpm 一致)
93
+ **npx 等价**(`launcher@0.1.7+`):`npx` + `-y @ada-mcp/launcher@0.1.24`(内层同样 `npx -y` mcp-server,测速逻辑与 pnpm 一致)
94
94
 
95
95
  ```json
96
96
  {
97
97
  "mcpServers": {
98
98
  "ada-mcp": {
99
99
  "command": "npx",
100
- "args": ["-y", "@ada-mcp/launcher@0.1.19"]
100
+ "args": ["-y", "@ada-mcp/launcher@0.1.24"]
101
101
  }
102
102
  }
103
103
  }
104
104
  ```
105
105
 
106
- Windows 若找不到 `pnpm`,可将 `command` 改为 `pnpm.cmd` 绝对路径;无 pnpm 时只能直接 `npx -y @ada-mcp/mcp-server@0.1.19`(无 launcher 拉包测速)。
106
+ Windows 若找不到 `pnpm`,可将 `command` 改为 `pnpm.cmd` 绝对路径;无 pnpm 时只能直接 `npx -y @ada-mcp/mcp-server@0.1.24`(无 launcher 拉包测速)。
107
107
 
108
108
  ## Remote mode
109
109
 
package/dist/cli.cjs CHANGED
@@ -3556,7 +3556,7 @@ async function downloadGeckodriver(driversDir, versionInput, onLogLine) {
3556
3556
  downloaded = true;
3557
3557
  } catch (mirrorError) {
3558
3558
  onLogLine?.(
3559
- `[selenium][warn] ?????????: ${mirrorError instanceof Error ? mirrorError.message : String(mirrorError)}`
3559
+ `[selenium][warn] ??????: ${mirrorError instanceof Error ? mirrorError.message : String(mirrorError)}`
3560
3560
  );
3561
3561
  onLogLine?.(`[selenium] ?? GitHub: ${github}`);
3562
3562
  await downloadToFile(github, archivePath);
@@ -3756,8 +3756,8 @@ var init_src2 = __esm({
3756
3756
  {
3757
3757
  browser: "Firefox",
3758
3758
  platforms: "Windows/Linux/macOS",
3759
- vendor: "Mozilla / ?????",
3760
- url: `${DEFAULT_GECKODRIVER_MIRROR}/v0.36.0/?????????????? ${GITHUB_GECKODRIVER_RELEASES}?`
3759
+ vendor: "Mozilla",
3760
+ url: `${DEFAULT_GECKODRIVER_MIRROR}/v0.36.0/????????? ${GITHUB_GECKODRIVER_RELEASES}`
3761
3761
  },
3762
3762
  {
3763
3763
  browser: "Edge",
@@ -3940,6 +3940,25 @@ function briefErrorMessage(error2) {
3940
3940
  }
3941
3941
  return String(error2).split(/\r?\n/)[0]?.trim() || String(error2);
3942
3942
  }
3943
+ function stripAnsiCodes(text) {
3944
+ return text.replace(/\x1b\[[0-9;]*m/g, "");
3945
+ }
3946
+ function stripCliErrorPrefix(message) {
3947
+ let t = stripAnsiCodes(message).trim();
3948
+ t = t.replace(/^Error:\s*/i, "");
3949
+ while (/^[×x✖✗❌\u00d7\u2716\u2717]\s*/iu.test(t)) {
3950
+ t = t.replace(/^[×x✖✗❌\u00d7\u2716\u2717]\s*/iu, "");
3951
+ }
3952
+ return t.trim();
3953
+ }
3954
+ function isAppiumDriverAlreadyInstalledMessage(message) {
3955
+ const raw = stripAnsiCodes(message).trim();
3956
+ return /already installed/i.test(raw) && /driver named/i.test(raw);
3957
+ }
3958
+ function formatDepsWarnLine(message) {
3959
+ const body = stripCliErrorPrefix(message);
3960
+ return body ? `[deps][warn] ${body}` : "";
3961
+ }
3943
3962
  function depsVerboseEnabled() {
3944
3963
  return isTruthyEnv("ADA_DEPS_VERBOSE");
3945
3964
  }
@@ -4173,6 +4192,23 @@ async function probePlaywrightBrowserArtifact(host, browserVersion) {
4173
4192
  function requiredAppiumDrivers(config2) {
4174
4193
  return Array.from(new Set(config2.appium.requiredDrivers ?? []));
4175
4194
  }
4195
+ function isMacOsPlatform() {
4196
+ return process.platform === "darwin";
4197
+ }
4198
+ function filterAppiumDriversForPlatform(drivers, onLogLine) {
4199
+ const out = [];
4200
+ for (const driver of drivers) {
4201
+ const name = driver.toLowerCase().trim();
4202
+ if (name === "xcuitest" && !isMacOsPlatform()) {
4203
+ onLogLine?.(
4204
+ `[appium] \u8DF3\u8FC7 xcuitest\uFF1A\u5F53\u524D\u7CFB\u7EDF\u4E3A ${process.platform}\uFF0CXCUITest \u9A71\u52A8\u4EC5\u652F\u6301 macOS\uFF08\u8BF7\u5728 Mac \u4E0A\u5B89\u88C5 iOS \u81EA\u52A8\u5316\u4F9D\u8D56\uFF09`
4205
+ );
4206
+ continue;
4207
+ }
4208
+ out.push(name);
4209
+ }
4210
+ return Array.from(new Set(out));
4211
+ }
4176
4212
  function npmProxyRegistry() {
4177
4213
  return process.env.ADA_NPM_PROXY_REGISTRY ?? DEFAULT_NPM_REGISTRY_CANDIDATES[0];
4178
4214
  }
@@ -4363,7 +4399,18 @@ function structuredLogToHuman(level, payload) {
4363
4399
  return `[deps] \u5305\u5B89\u88C5\u6210\u529F: ${d.strategy}`;
4364
4400
  }
4365
4401
  if (event === "deps.install.strategy.fail") {
4366
- return `[deps][warn] \u5B89\u88C5\u7B56\u7565\u5931\u8D25 (${d.strategy}): ${d.message}`;
4402
+ const msg = stripCliErrorPrefix(String(d.message ?? ""));
4403
+ if (isAppiumDriverAlreadyInstalledMessage(msg)) {
4404
+ return null;
4405
+ }
4406
+ return `[deps][warn] \u5B89\u88C5\u7B56\u7565\u5931\u8D25 (${d.strategy}): ${msg}`;
4407
+ }
4408
+ if (event === "appium.driver.install.strategy.fail") {
4409
+ const msg = stripCliErrorPrefix(String(d.message ?? ""));
4410
+ if (isAppiumDriverAlreadyInstalledMessage(msg)) {
4411
+ return null;
4412
+ }
4413
+ return `[deps][warn] Appium \u9A71\u52A8\u5B89\u88C5\u5931\u8D25 (${d.strategy}): ${msg}`;
4367
4414
  }
4368
4415
  if (event === "deps.registry.auto-selected") {
4369
4416
  return `[deps] \u9009\u7528 npm \u955C\u50CF: ${d.selected}`;
@@ -4372,8 +4419,12 @@ function structuredLogToHuman(level, payload) {
4372
4419
  return `[playwright] CDN \u6D4B\u901F\u6392\u5E8F: ${Array.isArray(d.ranked) ? d.ranked.join(" -> ") : d.selected}`;
4373
4420
  }
4374
4421
  if (level === "warn" || level === "error") {
4375
- const msg = d.message ?? d.detail;
4376
- return `[deps][${level}] ${event}${msg ? `: ${msg}` : ""}`;
4422
+ const raw = String(d.message ?? d.detail ?? "");
4423
+ if (isAppiumDriverAlreadyInstalledMessage(raw)) {
4424
+ return null;
4425
+ }
4426
+ const warn = formatDepsWarnLine(raw);
4427
+ return warn || null;
4377
4428
  }
4378
4429
  if (depsVerboseEnabled()) {
4379
4430
  return `[deps] ${event}${Object.keys(d).length > 0 ? ` ${JSON.stringify(d)}` : ""}`;
@@ -4710,14 +4761,29 @@ async function runAppiumDriverInstallWithPriority(config2, driver, onLogLine) {
4710
4761
  const installArgs = buildAppiumDriverInstallArgs(target, appiumMajor);
4711
4762
  onLogLine?.(`[appium] \u6267\u884C: npm ${installArgs.join(" ")}`);
4712
4763
  let alreadyInstalledSeen = false;
4764
+ let alreadyInstalledWarnLogged = false;
4713
4765
  const onAppiumDriverLogLine = (line) => {
4714
- const t = line.trimEnd();
4715
- const normalized = t.replace(/^Error:\s*[×x]?\s*/i, "");
4716
- if (/A driver named\s+\"uiautomator2\"\s+is already installed/i.test(normalized)) {
4766
+ const t = stripAnsiCodes(line).trimEnd();
4767
+ if (!t) {
4768
+ return;
4769
+ }
4770
+ if (isAppiumDriverAlreadyInstalledMessage(t)) {
4717
4771
  alreadyInstalledSeen = true;
4718
- onLogLine?.(
4719
- `[deps][warn] ${normalized}\u3002\u68C0\u6D4B\u5230\u5B89\u88C5\u540E\u65E0\u9700\u518D\u6B21\u5B89\u88C5${driver}\u3002`
4720
- );
4772
+ if (!alreadyInstalledWarnLogged) {
4773
+ alreadyInstalledWarnLogged = true;
4774
+ const normalized = stripCliErrorPrefix(t);
4775
+ onLogLine?.(`[deps][warn] ${normalized}\u3002\u68C0\u6D4B\u5230\u5B89\u88C5\u540E\u65E0\u9700\u518D\u6B21\u5B89\u88C5${driver}\u3002`);
4776
+ }
4777
+ return;
4778
+ }
4779
+ if (/^Error:\s*/i.test(t)) {
4780
+ const warn = formatDepsWarnLine(t);
4781
+ if (warn) {
4782
+ onLogLine?.(warn);
4783
+ }
4784
+ return;
4785
+ }
4786
+ if (/^dbug\s+Appium/i.test(t)) {
4721
4787
  return;
4722
4788
  }
4723
4789
  onLogLine?.(t);
@@ -4940,7 +5006,7 @@ async function getInstalledAppiumDrivers() {
4940
5006
  return Array.from(new Set(names));
4941
5007
  }
4942
5008
  async function ensureAppiumDrivers(config2, onLogLine) {
4943
- const required2 = requiredAppiumDrivers(config2);
5009
+ const required2 = filterAppiumDriversForPlatform(requiredAppiumDrivers(config2), onLogLine);
4944
5010
  if (required2.length === 0) {
4945
5011
  return [];
4946
5012
  }
@@ -5172,7 +5238,10 @@ async function ensureDriverDependenciesImpl(config2, options) {
5172
5238
  onLogLine?.("[deps] \u5F00\u59CB\u68C0\u6D4B / \u5B89\u88C5\u4F9D\u8D56\u2026");
5173
5239
  await ensureNodeEnvironmentForInstall(onLogLine);
5174
5240
  const missing = [];
5175
- const requestedDrivers = options?.appiumRequiredDriversOverride !== void 0 ? normalizeAppiumDriverTokens(options.appiumRequiredDriversOverride) : resolveRequestedDrivers(config2, only);
5241
+ const requestedDrivers = filterAppiumDriversForPlatform(
5242
+ options?.appiumRequiredDriversOverride !== void 0 ? normalizeAppiumDriverTokens(options.appiumRequiredDriversOverride) : resolveRequestedDrivers(config2, only),
5243
+ onLogLine
5244
+ );
5176
5245
  const needDrivers = requestedDrivers.length > 0;
5177
5246
  const installedPackages = [];
5178
5247
  const installedDrivers = [];
@@ -5354,7 +5423,9 @@ async function getDependencyHealth(config2) {
5354
5423
  }
5355
5424
  if (appiumCliOk) {
5356
5425
  const installed = (await getInstalledAppiumDrivers()).map((x) => x.toLowerCase());
5357
- const required2 = config2?.appium?.requiredDrivers && config2.appium.requiredDrivers.length > 0 ? config2.appium.requiredDrivers.map((x) => x.toLowerCase()) : ["uiautomator2", "xcuitest", "harmonyos"];
5426
+ const required2 = filterAppiumDriversForPlatform(
5427
+ config2?.appium?.requiredDrivers && config2.appium.requiredDrivers.length > 0 ? config2.appium.requiredDrivers.map((x) => x.toLowerCase()) : ["uiautomator2", "xcuitest", "harmonyos"]
5428
+ );
5358
5429
  missingAppiumDrivers = required2.filter((x) => !installed.includes(x));
5359
5430
  appiumDriversOk = missingAppiumDrivers.length === 0;
5360
5431
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-mcp/mcp-server",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
4
4
  "description": "ADA MCP server for web/mobile automation (stdio + remote HTTP)",
5
5
  "private": false,
6
6
  "type": "commonjs",
@@ -244,8 +244,8 @@ var SELENIUM_DRIVER_MANUAL_DOWNLOAD_REFERENCES = [
244
244
  {
245
245
  browser: "Firefox",
246
246
  platforms: "Windows/Linux/macOS",
247
- vendor: "Mozilla / ?????",
248
- url: `${DEFAULT_GECKODRIVER_MIRROR}/v0.36.0/?????????????? ${GITHUB_GECKODRIVER_RELEASES}?`
247
+ vendor: "Mozilla",
248
+ url: `${DEFAULT_GECKODRIVER_MIRROR}/v0.36.0/????????? ${GITHUB_GECKODRIVER_RELEASES}`
249
249
  },
250
250
  {
251
251
  browser: "Edge",