@mrrisega/dsh-remote 0.7.0-beta.8 → 0.7.1-beta.1

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.
Files changed (71) hide show
  1. package/clients/dsh-remote/dsh-bridge.mjs +17 -17
  2. package/clients/dsh-remote/dsh-events.mjs +6 -6
  3. package/clients/dsh-remote/e2ee-client.mjs +7 -7
  4. package/clients/dsh-remote/e2ee-shim-script.js +9 -9
  5. package/clients/dsh-remote/mobile-adapter.mjs +294 -43
  6. package/clients/dsh-remote/test/bridge-gzip.test.mjs +1 -1
  7. package/clients/dsh-remote/test/device-registration-report.test.mjs +1 -1
  8. package/clients/dsh-remote/test/dsh-events.test.mjs +10 -10
  9. package/clients/dsh-remote/test/e2ee-bridge.test.mjs +4 -4
  10. package/clients/dsh-remote/test/e2ee-client.test.mjs +7 -7
  11. package/clients/dsh-remote/test/e2ee-shim.test.mjs +1 -1
  12. package/clients/dsh-remote/test/e2ee-wecrypto-parity.test.mjs +1 -1
  13. package/clients/dsh-remote/test/harness-cookie-authority.test.mjs +4 -4
  14. package/clients/dsh-remote/test/machine-fingerprint.test.mjs +2 -2
  15. package/clients/dsh-remote/test/mobile-adapter-guards.test.mjs +6 -6
  16. package/clients/dsh-remote/test/mobile-adapter-image.test.mjs +1 -1
  17. package/clients/dsh-remote/test/mobile-adapter-runtime.test.mjs +5 -5
  18. package/clients/dsh-remote/test/mobile-adapter-settings.test.mjs +352 -0
  19. package/clients/dsh-remote/test/mobile-adapter.test.mjs +35 -0
  20. package/clients/dsh-remote/test/upstream-discovery.test.mjs +1 -1
  21. package/clients/dsh-remote/test/wechat-channel.test.mjs +5 -5
  22. package/clients/dsh-remote/test/wechat-runtime.test.mjs +26 -26
  23. package/clients/dsh-remote/test/wechat-tier-source.test.mjs +2 -2
  24. package/clients/dsh-remote/wechat-channel.mjs +9 -9
  25. package/clients/dsh-remote/wechat-runtime.mjs +38 -38
  26. package/docs/telemetry.md +3 -3
  27. package/dsh-setup.mjs +27 -27
  28. package/package.json +3 -3
  29. package/packages/dsh-remote-web/lib/client.js +56 -56
  30. package/packages/dsh-remote-web/lib/fix-prompt.js +1 -1
  31. package/packages/dsh-remote-web/lib/index.js +380 -59
  32. package/packages/dsh-remote-web/lib/tarball-update.js +1 -1
  33. package/packages/dsh-remote-web/package.json +1 -1
  34. package/packages/dsh-remote-web/runtime/clients/dsh-remote/dsh-bridge.mjs +17 -17
  35. package/packages/dsh-remote-web/runtime/clients/dsh-remote/dsh-events.mjs +6 -6
  36. package/packages/dsh-remote-web/runtime/clients/dsh-remote/e2ee-client.mjs +7 -7
  37. package/packages/dsh-remote-web/runtime/clients/dsh-remote/e2ee-shim-script.js +9 -9
  38. package/packages/dsh-remote-web/runtime/clients/dsh-remote/mobile-adapter.mjs +294 -43
  39. package/packages/dsh-remote-web/runtime/clients/dsh-remote/wechat-channel.mjs +9 -9
  40. package/packages/dsh-remote-web/runtime/clients/dsh-remote/wechat-runtime.mjs +38 -38
  41. package/packages/dsh-remote-web/runtime/clients/dsh-web/native.html +5 -5
  42. package/packages/dsh-remote-web/runtime/dsh-setup.mjs +27 -27
  43. package/packages/dsh-remote-web/test/account-switch-device.test.mjs +2 -2
  44. package/packages/dsh-remote-web/test/activation-single-point.test.mjs +1 -1
  45. package/packages/dsh-remote-web/test/announcements-ui.test.mjs +1 -1
  46. package/packages/dsh-remote-web/test/connect-loop.test.mjs +1 -1
  47. package/packages/dsh-remote-web/test/connect-ui.test.mjs +2 -2
  48. package/packages/dsh-remote-web/test/desktop-compat.test.mjs +4 -4
  49. package/packages/dsh-remote-web/test/diag-report.test.mjs +1 -1
  50. package/packages/dsh-remote-web/test/fix-prompt.test.mjs +2 -2
  51. package/packages/dsh-remote-web/test/harness-restart.test.mjs +1 -1
  52. package/packages/dsh-remote-web/test/install-profile-targets.test.mjs +3 -3
  53. package/packages/dsh-remote-web/test/installer-cli.test.mjs +1 -1
  54. package/packages/dsh-remote-web/test/launchd-domain.test.mjs +2 -2
  55. package/packages/dsh-remote-web/test/patch-activation.test.mjs +2 -2
  56. package/packages/dsh-remote-web/test/picker-pin.test.mjs +1 -1
  57. package/packages/dsh-remote-web/test/plugin-manifest.test.mjs +2 -2
  58. package/packages/dsh-remote-web/test/quota-absent.test.mjs +4 -4
  59. package/packages/dsh-remote-web/test/remote-access-ui.test.mjs +2 -2
  60. package/packages/dsh-remote-web/test/selfheal-restart-guard.test.mjs +420 -0
  61. package/packages/dsh-remote-web/test/settings-entry-placement.test.mjs +6 -6
  62. package/packages/dsh-remote-web/test/settings-entry.test.mjs +2 -2
  63. package/packages/dsh-remote-web/test/settings-open-path.test.mjs +4 -4
  64. package/packages/dsh-remote-web/test/setup-output.test.mjs +11 -11
  65. package/packages/dsh-remote-web/test/tarball-update.test.mjs +1 -1
  66. package/packages/dsh-remote-web/test/telemetry.test.mjs +4 -4
  67. package/packages/dsh-remote-web/test/uninstall-safety.test.mjs +2 -2
  68. package/packages/dsh-remote-web/test/watcher-upstream-port.test.mjs +1 -1
  69. package/packages/dsh-remote-web/test/wechat-bot-ui.test.mjs +7 -7
  70. package/packages/dsh-remote-web/test/windows-compat.test.mjs +5 -5
  71. package/scripts/test-net-guard.cjs +1 -1
@@ -1,6 +1,6 @@
1
1
  // 📣 公告(插件端)回归:徽标 / 面板入口 / 电脑端弹窗 / 已读上报 / 一条铁律(**不轮询**)。
2
2
  //
3
- // 契约:dsh-relay-enterprise/docs/announcements-contract.md(冻结 v1)+ 926 迭代 §1(client=desktop)。
3
+ // 契约:服务端公告契约文档(冻结 v1)(冻结 v1)+ 926 迭代 §1(client=desktop)。
4
4
  // GET /dsh-remote/announcements?client=desktop → { bubble_enabled, items[], unread_count, popup|null }
5
5
  // POST /dsh-remote/announcements/click { id } → 记 clicked_at(**现契约只有 /click,没有 /read**)
6
6
  //
@@ -506,7 +506,7 @@ test("注册来源透传:/dsh-remote/register 全量转发 body(reg_source=p
506
506
  assert.equal(r.ok, true);
507
507
  const reg = relay.seen.filter((s) => s.path === "/api/register").pop();
508
508
  assert.ok(reg, "应转发到企业端 /api/register");
509
- assert.equal(reg.body.reg_source, "panel_register", "注册来源必须透传(增长口径)");
509
+ assert.equal(reg.body.reg_source, "panel_register", "注册来源必须透传(增长约定)");
510
510
  assert.equal(reg.body.invite_code, "A8K2M4XQ", "未知/扩展字段不得被丢弃");
511
511
  assert.equal(reg.body.captcha_id, "cap-1");
512
512
  assert.equal(reg.body.captcha_answer, "1234");
@@ -8,7 +8,7 @@
8
8
  // 已授权设备列表(全程不刷新页面);
9
9
  // ③ error 阶段必须有可操作项:重试 / 复制诊断信息 / 日志路径(不留死胡同);
10
10
  // ④ document.hidden 时短轮询暂停(后台标签页不空转),回前台立即补一次;online 后退避到 15s;
11
- // ⑤ 面板注册带注册来源 reg_source=panel_register(增长口径)。
11
+ // ⑤ 面板注册带注册来源 reg_source=panel_register(增长约定)。
12
12
  import assert from "node:assert/strict";
13
13
  import { readFileSync } from "node:fs";
14
14
  import test from "node:test";
@@ -377,7 +377,7 @@ test("轮询策略:document.hidden 时暂停短轮询,回前台立即补一
377
377
  assert.ok(plugin.counts().connCalls > onlineCalls + extra, "online 后仍应按 ~15s 节奏保活(新设备扫码后列表能自动出现)");
378
378
  });
379
379
 
380
- test("面板注册带注册来源 reg_source=panel_register(增长口径:电脑端 vs 手机端网页注册)", async () => {
380
+ test("面板注册带注册来源 reg_source=panel_register(增长约定:电脑端 vs 手机端网页注册)", async () => {
381
381
  const plugin = loadPlugin({ status: NOT_LOGGED });
382
382
  let tree = await plugin.settle();
383
383
  const regTab = nodeWithText(tree, "注册");
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * 背景:DeepSeek Harness 于 2026-09-29 发布桌面端 v0.2 预览(Electron 薄壳 + 完整 dsh Web Host,
5
5
  * Host 以 `--no-open --port 0` 启动,端口随机、每进程令牌鉴权)。dsh-remote 的两大难点
6
- * (随机端口、会话 Cookie)此前已因真实事故适配过,因此这次新增的适配**集中在三处**:
6
+ * (随机端口、会话 Cookie)此前已因真实故障适配过,因此这次新增的适配**集中在三处**:
7
7
  *
8
8
  * ① **Electron 宿主下 process.execPath 不是 node**:它是 Electron 应用二进制。
9
9
  * 直接 `spawn(process.execPath, [script])` 得到的不是"跑脚本的 node",而是**又开一个桌面端应用**
@@ -92,7 +92,7 @@ test("spawnEnv:NODE_INTERPRETER 变量不得挤掉调用方的业务变量,P
92
92
  // ─────────────── ② 服务定义:plist / systemd 必须带上解释器变量(跨文件同构)───────────────
93
93
 
94
94
  test("跨文件不变量:插件与安装器的 plist / systemd 模板都必须带解释器变量占位", () => {
95
- // 为什么是"两份都要查":历史上前述两份模板漂移过、并因此各造成一个真机事故
95
+ // 为什么是"两份都要查":历史上前述两份模板漂移过、并因此各造成一个真机故障
96
96
  // (插件每次自愈都会重写 plist,谁写谁说了算 → 漂移等于把另一份正确的覆盖掉)。
97
97
  for (const [name, src] of [["lib/index.js", INDEX_SRC], ["dsh-setup.mjs", SETUP_SRC]]) {
98
98
  assert.match(src, /const SERVICE_NODE_ENV\b/, `${name}: 必须有 SERVICE_NODE_ENV`);
@@ -214,7 +214,7 @@ test("安装器:setup() 必须把 --profile 透传给插件挂载步骤", () =
214
214
  const { profileArgvOf } = makeResolveProfileDir("/Users/tester");
215
215
  assert.deepEqual(profileArgvOf(["--profile", "desktop"]), ["--profile", "desktop"]);
216
216
  assert.deepEqual(profileArgvOf([]), [], "未指定时不得凭空塞参数");
217
- // 事故面:setup() 原本调 pluginCmd([]) → --profile desktop 被静默忽略、插件装进 web profile
217
+ // 故障面:setup() 原本调 pluginCmd([]) → --profile desktop 被静默忽略、插件装进 web profile
218
218
  assert.match(SETUP_SRC, /pluginCmd\(profileArgvOf\(argv\)\)/, "setup 必须透传 profile 选择");
219
219
  assert.ok(!/pluginCmd\(\[\]\)/.test(SETUP_SRC), "不得再有硬编码空参数(会把 --profile 吞掉)");
220
220
  });
@@ -227,7 +227,7 @@ test("安装器:desktop profile 未初始化时给桌面端专属引导(不
227
227
  assert.match(fn, /isDesktopProfileDir\(profileDir\)/, "必须区分桌面端 profile");
228
228
  assert.match(fn, /启动一次 DeepSeek Harness 应用/, "必须给桌面端专属引导:profile 由应用自己创建");
229
229
  assert.match(fn, /完全退出应用/, "必须提醒完全退出(应用独占 profile,运行中安装不会被装载)");
230
- // 事故面:桌面端 profile 由 Electron 应用初始化,npm 版 dsh 明确拒绝管理它
230
+ // 故障面:桌面端 profile 由 Electron 应用初始化,npm 版 dsh 明确拒绝管理它
231
231
  //(apps/cli 的 rejectElectronProfile)—— 照抄 Web 版那句会让用户白折腾。
232
232
  assert.ok(!/未找到 dsh web profile/.test(fn), "不得再把桌面端统一报成 'dsh web profile'");
233
233
  });
@@ -219,7 +219,7 @@ test("修复提示词:带当前故障上下文(目录/上游/版本),便
219
219
  const b = await getJson(`${base}/dsh-remote/diag/fix-prompt`);
220
220
  assert.equal(b.ok, true);
221
221
  assert.match(b.prompt, new RegExp(env.relayDir.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")), "提示词要带上本机配置目录");
222
- assert.match(b.prompt, /127\.0\.0\.1:3080/, "提示词要带上上游地址(端口错配是本次事故的最大嫌疑)");
222
+ assert.match(b.prompt, /127\.0\.0\.1:3080/, "提示词要带上上游地址(端口错配是本次故障的最大嫌疑)");
223
223
  assert.match(b.prompt, /\.dsh-bridge\.log/);
224
224
  assert.match(b.prompt, /\.dsh-setup-install\.log/);
225
225
  assert.match(b.reportTitle, /dsh-remote 诊断结论/, "报告格式要有固定首行,便于后台机器解析");
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * 「连接卡住 → 一键修复提示词 + 结论报告」契约测试(node:test,零框架)。
3
3
  *
4
- * 背景(真实事故,2026-09-23,Windows 用户):
4
+ * 背景(真实故障,2026-09-23,Windows 用户):
5
5
  * 插件面板卡在「连接阶段: starting(正在启动 Bridge…)」,手机端看不到任何设备,反复修都没用。
6
6
  * 事后定位到三种机制(半装运行环境 / 守护活着没起作用 / bridge 起来就崩),它们在面板上长得一模一样,
7
7
  * 面板侧诊断分不开;只能由用户本机的 agent 在自己电脑上取证。
@@ -120,7 +120,7 @@ test("报告格式:REPORT_KEYS 六个字段齐全,REPORT_FORMAT 首行即固
120
120
  for (const key of ["症状", "机制判定", "关键证据", "已做的修复", "修复结果", "仍需人工处理"]) {
121
121
  assert.ok(REPORT_KEYS.includes(key), `REPORT_KEYS 应覆盖「${key}」`);
122
122
  }
123
- assert.equal(REPORT_KEYS.length, 6, "REPORT_KEYS 就是这六项(多了会让解析口径漂移)");
123
+ assert.equal(REPORT_KEYS.length, 6, "REPORT_KEYS 就是这六项(多了会让解析约定漂移)");
124
124
  assert.equal(REPORT_FORMAT.split("\n")[0], REPORT_TITLE, "报告模板首行必须是固定标题");
125
125
  assert.equal(REPORT_TITLE, "=== dsh-remote 诊断结论 ===");
126
126
  // 六项在模板里都要有对应行,且顺序与 REPORT_KEYS 一致
@@ -141,7 +141,7 @@ test("首次安装(运行环境在本进程内补齐)→ **不再**提示重
141
141
  });
142
142
 
143
143
  test("补装把**同版本**插件重写一遍 → 不得提示(用户实测的误报)", async () => {
144
- // 事故复盘:安装器/自愈补装会把 profile 副本整目录重写,即使是**同一个版本**。
144
+ // 故障回顾:安装器/自愈补装会把 profile 副本整目录重写,即使是**同一个版本**。
145
145
  // 旧实现只看"插件文件 mtime 晚于进程启动"→ 误判成"有新插件要装载"→ 弹出需要重启/刷新的横幅,
146
146
  // 而用户刷新后横幅还在(因为第二次补装又写了一遍)、最后靠重启才消失。
147
147
  // 现在判的是「磁盘版本 != 运行版本」,版本相同就什么都不提示。
@@ -1,7 +1,7 @@
1
1
  /**
2
- * 「默认安装装给谁」契约测试(2026-10-11 业主口径)。
2
+ * 「默认安装装给谁」契约测试(2026-10-11 用户约定)。
3
3
  *
4
- * 事故/反馈:业主执行官方那条 `npx --yes @mrrisega/dsh-remote@beta`(不带参数)后,
4
+ * 故障/反馈:用户执行官方那条 `npx --yes @mrrisega/dsh-remote@beta`(不带参数)后,
5
5
  * 插件**全进了 Web 版 profile**,而他面对的是**桌面应用** —— 面板永远不出现,
6
6
  * 且面板/文档里都看不出来"装错了地方"。根因:`resolveProfileDir()` 在没有 `--profile`
7
7
  * 与 `DSH_PROFILE_DIR` 时**写死 `profileDirOfName("web")`**。
@@ -60,7 +60,7 @@ test("默认(不带 --profile):桌面端与 Web 版**都装**,实验 pro
60
60
  const headless = makeProfile(home, "headless");
61
61
  const r = runPlugin(home);
62
62
  assert.equal(r.code, 0, `安装应成功:${r.err.slice(0, 300)}`);
63
- // ★ 业主的核心诉求:默认也要装给 desktop
63
+ // ★ 用户的核心诉求:默认也要装给 desktop
64
64
  assert.ok(hasPlugin(desktop), "★ 默认安装必须装进 desktop profile(否则桌面端用户看不到面板)");
65
65
  assert.ok(patched(desktop), "desktop 的 patch 必须写入激活行");
66
66
  assert.ok(hasPlugin(web), "Web 版 profile 同样要装");
@@ -11,7 +11,7 @@
11
11
  * ② 参数拼错(不认识的 flag)→ 明确报错、退出码 1、**也不碰磁盘**。
12
12
  *
13
13
  * ⚠️ 隔离:所有用例都伪造 HOME + DSH_PROFILE_DIR,并设 DSH_RELAY_SKIP_SERVICE=1,
14
- * 否则会污染真实的自启动服务与 ~/.dsh-remote(见 setup-output.test.mjs 的事故复盘)。
14
+ * 否则会污染真实的自启动服务与 ~/.dsh-remote(见 setup-output.test.mjs 的故障回顾)。
15
15
  */
16
16
  import assert from "node:assert/strict";
17
17
  import { execFile } from "node:child_process";
@@ -114,7 +114,7 @@ test("★ 两份 plist 模板的 PATH 必须一致(插件那份曾漏掉 /usr/
114
114
  });
115
115
 
116
116
  test("★ 被监管者(launchd)拉起的实例不得因『已有游离守护』而秒退", () => {
117
- // 真机事故链:KeepAlive 重拉 → 本进程发现 pid 文件里已有游离守护 → 秒退
117
+ // 真机故障链:KeepAlive 重拉 → 本进程发现 pid 文件里已有游离守护 → 秒退
118
118
  // → 监管者判为崩溃并节流(`launchctl print` = `state = spawn scheduled`)
119
119
  // → 插件自愈认定"服务坏了" → bootout 摘作业(入口判定成立时连 plist 一起删)
120
120
  // → **自启动彻底消失,`launchctl kickstart` 报"域里找不到该服务"**。
@@ -184,7 +184,7 @@ test("★ watcher 退出前必须确保子进程真的死了(只『请』不
184
184
  });
185
185
 
186
186
  test("★ 守护惊群:启动锁必须排在去重读取**之前**,且先写 pid 再释放锁", () => {
187
- // 2026-09-26 真机事故:一次重启窗口里同时活下来 6 个 `dsh-setup.mjs run` + 6 个 bridge,
187
+ // 2026-09-26 真机故障:一次重启窗口里同时活下来 6 个 `dsh-setup.mjs run` + 6 个 bridge,
188
188
  // 全部用同一 deviceId 抢 router 注册(日志刷满 `replaced by new connection`),隧道无限抖动。
189
189
  // 成因:去重是"先读 pid 文件、后写 pid 文件",N 个实例同时启动时每个都读到"没有别人"。
190
190
  const rb = src.slice(src.indexOf("async function runBridge()"), src.indexOf("// ---------- setup"));
@@ -172,7 +172,7 @@ test("安全护栏:原子写回 —— 不留 .tmp 残留,且末尾换行规
172
172
  });
173
173
 
174
174
  test("回归护栏:plugin 子命令必须把激活结果 return 给 setup(否则热挂载验证被跳过)", () => {
175
- // 事故复盘:convergePluginActivation 已经返回 {hotPatch},但 pluginCmd 没把它 return 出去,
175
+ // 故障回顾:convergePluginActivation 已经返回 {hotPatch},但 pluginCmd 没把它 return 出去,
176
176
  // 于是 setup() 拿不到激活形态 → 跳过热挂载验证 → 明明热挂载成功却仍报「需要重启」。
177
177
  const src = readFileSync(SETUP, "utf8");
178
178
  const call = src.match(/return convergePluginActivation\(profileDir[^\n]*/);
@@ -230,7 +230,7 @@ test("硬约束:写入 patch 行后 bundles 必须被清空(单一激活点
230
230
  });
231
231
 
232
232
  test("回归护栏:热挂载探测必须比对**版本**,不能只看接口 200", () => {
233
- // 事故复盘:profile 已更新到 0.6.4,运行中的插件仍是 beta.10,而旧探测只看
233
+ // 故障回顾:profile 已更新到 0.6.4,运行中的插件仍是 beta.10,而旧探测只看
234
234
  // `/dsh-remote/status` 是否 200(旧版本本来就有这个接口)→ 误报"热加载成功",
235
235
  // 用户以为已生效、实际还在跑旧代码。
236
236
  const src = readFileSync(SETUP, "utf8");
@@ -190,7 +190,7 @@ test("诊断面板必须显示目录选择器状态(这类'按钮没反应'才
190
190
  });
191
191
 
192
192
  test("接线:apply 挂的是**延后**接线(schedulePickerPin),绝不在启动期直接切 Loader", () => {
193
- // 🔴 2026-09-26 事故锁:旧实现是 apply() 里直接 `pinBrowseDirectoryPicker(ctx)`,
193
+ // 🔴 2026-09-26 回归锁:旧实现是 apply() 里直接 `pinBrowseDirectoryPicker(ctx)`,
194
194
  // 于是 dsh 还在装配插件图时就去 loader.remove/create → dsh-client-modules 反复 compose
195
195
  // 整张前端图(buildCombo/newlineCount/identitySectionMap 热点)→ dsh web 3 分钟不监听、
196
196
  // 表现为假死。DSH_REMOTE_NATIVE_PICKER=1 能立刻恢复,正是这条链的证据。
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * 插件清单与「一键更新静默失败」契约测试(node:test,零框架)。
3
3
  *
4
- * 事故背景(2026-09-15 生产反馈):
4
+ * 故障背景(2026-09-15 生产反馈):
5
5
  * A. 用户扫码后报「fail to load plugin / DeepSeek client collection」。
6
6
  * 排查发现 package.json 的 dsh.client.inject 声明了 `@deepseek-ai/dsh-client-runtime`,
7
7
  * 而该包在 harness 安装树里**根本不存在**(harness 只有 dsh-client-ui-* 等真包)。
@@ -84,7 +84,7 @@ test("一键更新:前端在进程结束但没成功时必须报错,而不
84
84
  });
85
85
 
86
86
  test("运行时同步:客户端脚本必须按**内容**补齐(否则手机端修复永远到不了用户)", () => {
87
- // 事故背景(2026-09-15 实测):手机端遮罩 bug 的修复落在 clients/dsh-remote/mobile-adapter.mjs,
87
+ // 故障背景(2026-09-15 实测):手机端遮罩 bug 的修复落在 clients/dsh-remote/mobile-adapter.mjs,
88
88
  // 而 bridge 是把**配置目录里那份**脚本注入官方页面后发给手机的。装置器原先只在"版本号变化"时
89
89
  // 才覆盖运行时副本,于是出现过:改了、发了版、用户升级了,但手机端拿到的仍是旧脚本 —— 修复不生效。
90
90
  // 现在按内容比对,只要与装置器手里的不一致就覆盖。
@@ -84,11 +84,11 @@ test("面板文案:额度数据缺失时不得断言任何限制", () => {
84
84
  // 【0.6.11 改断言】旧断言是
85
85
  // assert.match(CLIENT_SRC, /quota\.max_mbps \? "带宽 ≈" \+ quota\.max_mbps/, "带宽值服务端有才写")
86
86
  // 它编码的是**旧行为**(账号卡「更多」档位明细里的「当前:带宽 ≈N Mbps」那一行),不是不变量。
87
- // 业主口径:「插件面板里面不要展示『更多』里的 PRO 版本流量带宽,我看你把数字都展示出来了。
87
+ // 用户约定:「插件面板里面不要展示『更多』里的 PRO 版本流量带宽,我看你把数字都展示出来了。
88
88
  // 在本地的设置面板里面,把这个功能删掉。」→ 整块(renderPlanDetail + planSpecText/freeMbpsOf)
89
89
  // 已删,那个字符串在代码里不再存在。保留下来的**不变量**(比原来更强):
90
- // 客户端不得渲染任何带宽/流量/价格**数值** —— 服务端没下发时不许编(旧约束),下发了也不摆(新口径)。
91
- assert.doesNotMatch(CLIENT_SRC, /" Mbps"/, "面板不再渲染带宽数值(业主口径:本地面板不展示规格数字)");
90
+ // 客户端不得渲染任何带宽/流量/价格**数值** —— 服务端没下发时不许编(旧约束),下发了也不摆(新约定)。
91
+ assert.doesNotMatch(CLIENT_SRC, /" Mbps"/, "面板不再渲染带宽数值(用户约定:本地面板不展示规格数字)");
92
92
  assert.doesNotMatch(CLIENT_SRC, /" GB\/月,¥"/, "面板不再渲染流量/价格数值(档位明细已删)");
93
93
  // 但「已限速 / 不限速」这条**定性**提示仍在,且仍由服务端字段驱动(只是不再带数值)——
94
94
  // 这是上面第 ① 条不变量「服务端没说的限制一个字都不许编」的正面表达,也是必须保留的行为。
@@ -102,7 +102,7 @@ test("面板文案:额度数据缺失时不得断言任何限制", () => {
102
102
  assert.doesNotMatch(CLIENT_SRC, /:\s*" · 本月流量限额 1GB"/, "硬编码限额回退已移除");
103
103
  // 中继报告「不限量」时也不该说限额。
104
104
  // 【0.6.10 改断言】旧断言是 /免费用户 · 当前不限速、不限流量/ —— 那是**旧产品文案**(首屏挂档位名、
105
- // 用「流量」这个词),不是不变量;业主口径改为「首页面不展示会员相关信息」「流量一律叫额度」,
105
+ // 用「流量」这个词),不是不变量;用户约定改为「首页面不展示会员相关信息」「流量一律叫额度」,
106
106
  // 所以文案变成「当前不限速、不限额度」。这里保留的**不变量**是:中继明确报告不限量时必须如实说明
107
107
  // (下面这条分支仍在、仍由服务端字段驱动),不是那句具体措辞。
108
108
  assert.match(CLIENT_SRC, /当前不限速、不限额度/, "不限量应如实说明(首屏不再带档位名)");
@@ -428,7 +428,7 @@ test("「更多」只收纳营销入口:档位规格数字(Mbps / GB / 价
428
428
 
429
429
  // 【0.6.11】档位明细整块删除:标题「套餐与额度」、PRO / Pro Max 规格行、价格与结论句都不再渲染
430
430
  assert.ok(!textHas(body, "套餐与额度"), "「套餐与额度」标题应删除");
431
- assert.ok(!textHas(body, "Mbps"), "不得再渲染带宽数值(业主口径:本地面板不展示 PRO 版本流量带宽)");
431
+ assert.ok(!textHas(body, "Mbps"), "不得再渲染带宽数值(用户约定:本地面板不展示 PRO 版本流量带宽)");
432
432
  assert.ok(!textHas(body, "GB"), "不得再渲染流量数值");
433
433
  assert.ok(!textHas(body, "¥"), "不得再渲染价格");
434
434
  assert.ok(!textHas(body, "以套餐页为准"), "随档位明细一起删掉的结论句不得残留");
@@ -436,7 +436,7 @@ test("「更多」只收纳营销入口:档位规格数字(Mbps / GB / 价
436
436
  assert.ok(!textHas(tree, "Mbps"), "账号卡里不得出现 Mbps");
437
437
  assert.ok(!textHas(tree, "¥"), "账号卡里不得出现价格");
438
438
 
439
- // 但两条**折叠的营销入口**仍在(业主只要数字走,入口留着)
439
+ // 但两条**折叠的营销入口**仍在(用户只要数字走,入口留着)
440
440
  const upsell = find(body, (n) => n.type === "button" && (n.children || []).some((c) => typeof c === "string" && c.includes("升级 PRO")));
441
441
  const invite = find(body, (n) => n.type === "button" && (n.children || []).some((c) => typeof c === "string" && c.includes("带新用户换会员")));
442
442
  assert.ok(upsell, "「更多」里应保留「🚀 升级 PRO」入口");