dsh-notify-me 1.14.4 → 1.14.6

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/CHANGELOG.md CHANGED
@@ -2,6 +2,47 @@
2
2
 
3
3
  All notable changes to **dsh-notify-me** are documented here.
4
4
 
5
+ ## [1.14.6] — 2026-10-27
6
+
7
+ ### 修复
8
+
9
+ - **监听器只绑一个具体局域网 IP 时,桌面端点通知不再抬不起窗**:抬窗路由的闸门只认 loopback 对端与 `Host`,而 `webServer` 可以被配置成只绑一块网卡;那种情况下壳按绑定地址拨号,请求的对端和 `Host` 都是那个 IP,被 `403 bad-remote` / `bad-host` 挡掉。现在闸门额外接受「恰好是监听器自己绑定的那个 IP」(`webServer.host`)作对端与 `Host`;局域网里别的机器连过来源地址不是这个 IP,照旧拒绝。
10
+ - **会话基线不再随子代理会话一直涨**:`prevById` 在会话首次出现时新增,消失后永远保留。长开的页面上子代理会话来来去去,`debug().sessionBaselines` 只增不减。现在连续 40 次列表更新都缺席的行会丢掉基线(顺带清掉 `doneFiredAt`);短暂消失仍保留,不影响「消失再出现不补报」的语义。
11
+
12
+ ### 测试
13
+
14
+ - `host-route-test.mjs` 用 `webServer.host = 192.168.1.5` 的假宿主补了四条:本机自拨的绑定地址放行、局域网别处的客户端 `bad-remote`、自拨但 `Host` 是别的域名 `bad-host`、跨源 `Origin` 照旧拒绝。
15
+ - 冒烟新增 `vanishedBaselinesPruned()`:短暂缺席保留基线,连续 40+ 次更新后清零。
16
+
17
+ ### 文档
18
+
19
+ - README / SECURITY 中英的闸门说明补上「或监听器自己绑定的那个 IP」。
20
+ - `docs/listing.md` 版本口径同步到 1.14.6。
21
+
22
+ ## [1.14.5] — 2026-10-27
23
+
24
+ ### 修复
25
+
26
+ - **外部推送关掉后重试还会继续**:重试链挂在定时器上,旧代码不再复查总开关、也不复查目标还在不在,关掉转发后浏览器仍会往那个地址继续 POST,还把取消掉的投递记成失败。现在每次尝试前复查开关与目标列表,取消的投递不计失败、不写死信;测试按钮仍然照发。
27
+ - **服务码终于在页面侧生效**:`postOnce()` 读的是 `spec.type`,可 `spec` 只是请求体、目标类型在它外面,于是 `externalVerdict()` 的服务码分支(飞书 / Server酱 / WxPusher)从来没跑过,2xx 一律记「已发送」——飞书 token 错了也一样。现在类型正确传入:服务返回 `code != 0`(WxPusher 是 `1000`)记失败并带服务端文案;2xx 但 body 不是该服务的 JSON(空白、代理或 WAF 的网页)记「已送出不可确认」,不再冒充成功。
28
+ - **配置写不进去时页面会说了**:`localStorage.setItem` 抛错(配额、无痕模式、存储被禁)以前被空 `catch` 吞掉,开关看着已保存、刷新就还原。现在记 `configWriteFailed`,`debug().configStored` 给出真假,设置页底部写明「设置没能保存」;写入失败期间后续改动基于内存里的最新配置,不再从旧存储重建。
29
+ - **审批测试通知的按钮 6 秒后失效**:标题标记到点释放时把 `pendingActions` 记录一起删了,可测试通知还留在通知中心,此刻点「同意 / 拒绝」什么都不发生。现在标记照常释放、记录留到 12 秒后与通知一起收。
30
+ - **「从不关闭」对审批通知也作数**:没有按钮的那条路径原来 12 秒必收,选了「从不关闭」照样消失。
31
+ - **通知权限弹窗被关掉后还能再问**:`permAsked` 一旦置真就不再复位,测试按钮从此唤不起授权。现在显式点测试会重新请求一次。
32
+ - **输入监听从模块作用域移进 watchers effect**:客户端插件热重载时不再叠一套指针 / 键盘监听,dispose 能摘干净。
33
+
34
+ ### 测试
35
+
36
+ - 新增 `smoke/host-route-test.mjs` 并接进 `npm test`:不依赖本机 DSH,`lib/index.js` 的 exact 路由、GET 探针、403/405/501 闸门与脚本失败路径在任何平台都会跑。`cordis-host-test.mjs` 里原来那份挪走了,不再躲在「本机没装 DSH 就跳过」后面。
37
+ - 冒烟新增:关掉转发后不再重试且不计失败、2xx 非服务 JSON 记不可确认、服务码错误记失败、写配置失败提示与内存兜底、测试通知按钮活过标题标记、权限被拒后可再次请求。
38
+
39
+ ### 文档
40
+
41
+ - README 中英:审批通知到底什么时候收,按实际行为重写(带按钮的不设自动撤回,桌面端无按钮的按 12 秒收,「从不关闭」时都不收)。
42
+ - README / CONTRIBUTING 的开发自检改成跨平台写法(正斜杠、`sh` 围栏),PowerShell 那条单独标 Windows;硬刷新补上 macOS 的按键。
43
+ - SECURITY 中英:抬窗入口的鉴权口径改成实际的三条(回环对端、回环 `Host`、带 `Origin` 时须同源),并写明 PowerShell 只在 Windows。
44
+ - `docs/listing.md` 版本口径同步到 1.14.5。
45
+
5
46
  ## [1.14.4] — 2026-10-27
6
47
 
7
48
  ### 修复
@@ -20,6 +61,7 @@ All notable changes to **dsh-notify-me** are documented here.
20
61
 
21
62
  - README 的抬窗章节改成按平台叙述,`501` 闸门的说明改成「非 Windows 宿主」,已知限制里补上非 Windows 深链的前提(系统注册 `x-scheme-handler/dsh`、壳处理第二次启动)。
22
63
  - `lib/index.js` 顶部注释改成按平台表述:这条路由是 Windows 专用的,其他桌面端页面根本不发请求。
64
+ - `docs/listing.md` 版本口径同步到 1.14.4。
23
65
 
24
66
  ## [1.14.3] — 2026-10-26
25
67
 
package/README.en.md CHANGED
@@ -51,12 +51,12 @@ Just the plugin's own panel (the real component, on the same dark theme as the h
51
51
 
52
52
  With the DSH CLI already installed, run in a terminal:
53
53
 
54
- ```powershell
54
+ ```sh
55
55
  # Install and auto-mount into the web profile
56
56
  dsh plugin --profile web add dsh-notify-me
57
57
  ```
58
58
 
59
- Restart `dsh web`, then hard-refresh the page (Ctrl+Shift+R). If you use another Web profile, replace `web` with its actual name.
59
+ Restart `dsh web`, then hard-refresh the page (Ctrl+Shift+R on Windows / Linux, Cmd+Shift+R on macOS). If you use another Web profile, replace `web` with its actual name.
60
60
 
61
61
  ### DSH Desktop
62
62
 
@@ -132,7 +132,7 @@ Open **Settings → Notify me**. The page lays out three blocks — how you get
132
132
  - **What counts as background**: switching to another app, being covered by another window, or minimizing all count; a window left in front with 3 minutes of no keyboard or mouse input counts too, and `idleMinutes: 0` falls back to looking only at the window.
133
133
  - **When "stay quiet for the conversation on screen" is replayed**: as usual once the window goes to the background or the idle timer fires; if you already handled it, it is dropped.
134
134
  - **The three "reply finished" choices**: "background only" = alert when you are not watching the page; "quiet for the open one" = the one on screen stays silent while other conversations still alert, useful with several open; "always" = never suppress. An old profile's "also alert 'reply finished' while in front" switch migrates to this setting automatically.
135
- - **"Keep while away"**: a toast only closes a few seconds later while you are actually at the page; one that arrived while you were away stays in the notification centre until you come back. Approval toasts with Approve / Reject still follow their 12 s rule and are likewise not withdrawn while you are away.
135
+ - **"Keep while away"**: while you are at the page a plain toast closes itself after a few seconds; one that arrived while you were away stays in the notification centre until you come back. A toast with Approve / Reject carries no auto-dismiss timer — it stays until you click a button, answer the request in the page, or a newer request replaces it; a desktop approval toast, which cannot render buttons, closes after 12 s and is likewise not withdrawn while you are away.
136
136
  - **Fallback for a toast click**: on Desktop a window that will not raise leaves only the conversation switch, with the reason in `debug().raiseLast`; turn this switch off and a click does nothing.
137
137
 
138
138
  </details>
@@ -290,7 +290,7 @@ Notifications with Approve / Reject buttons can only be raised by a Service Work
290
290
  <details>
291
291
  <summary>Button-toast bookkeeping and window raising</summary>
292
292
 
293
- Each button toast is booked against its interaction key, and one toast claims only one wait; once the request has been answered in the page, or replaced by a newer request, clicking the leftover buttons decides nothing and just closes it quietly. Button toasts stay 12 s (plain ones 5 s) and are withdrawn on their own; if you miss the click, the approval in the conversation is still waiting for you.
293
+ Each button toast is booked against its interaction key, and one toast claims only one wait; once the request has been answered in the page, or replaced by a newer request, clicking the leftover buttons decides nothing and just closes it quietly. Button toasts carry no auto-dismiss timer — they stay until you click or answer; plain toasts close after 5 s, and a desktop approval toast without buttons after 12 s. With "never close" selected neither kind closes itself. If you miss the click, the approval in the conversation is still waiting for you.
294
294
 
295
295
  The "raise a window and switch its conversation" part of a body click is scheduled on the worker half as well: `client.focus()` raises exactly one window (a visible one first) and routes the conversation switch to that window alone, so several DSH tabs never fight over focus or all switch at once.
296
296
 
@@ -311,7 +311,7 @@ Measured with `powershell.exe` 5.1 in one round: window in front ×3, minimized
311
311
 
312
312
  Security-wise the plugin opens exactly one exact route. Requests outside the vocabulary are refused: anything other than GET / HEAD / POST answers `405` (including a preflight `OPTIONS`, and it never returns a CORS header), a non-Windows host (Web, macOS / Linux, plain Node) `501` (macOS / Linux use the deep link and never reach this route), and a missing `x-dsh-notify-me-focus: focus` header `403`.
313
313
 
314
- That header is only a "this came from the page" marker, not the defence — a DNS-rebinding page is same-origin with the address it resolved, so it can send any custom header and triggers no preflight. The real gate is three checks: the peer address must be loopback; `Host` must be a loopback name (`127.0.0.1` / `localhost` / `[::1]`, port optional), because the shell deletes `host` when forwarding and fetch refills it from the loopback URL, while a rebound page still has the attacker's domain in `Host`; and an `Origin`, when present, must be same-origin with that `Host`. Any failure answers `403`, with `reason` set to `bad-remote` / `bad-host` / `cross-origin`. A `GET` returns only `{ok, route, enabled, desktop, platform}`, so after installing you can open it in a browser to confirm the route is there. Calls within 400 ms coalesce into one, and a script that has not answered after 8 s is killed and counted as a failure.
314
+ That header is only a "this came from the page" marker, not the defence — a DNS-rebinding page is same-origin with the address it resolved, so it can send any custom header and triggers no preflight. The real gate is three checks: the peer address must be loopback, or exactly the address the listener itself is bound to; `Host` must be a loopback name (`127.0.0.1` / `localhost` / `[::1]`, port optional) or that same bind address, because the shell deletes `host` when forwarding and fetch refills it from the URL it dialled, while a rebound page still has the attacker's domain in `Host`; and an `Origin`, when present, must be same-origin with that `Host`. Any failure answers `403`, with `reason` set to `bad-remote` / `bad-host` / `cross-origin`. A `GET` returns only `{ok, route, enabled, desktop, platform}`, so after installing you can open it in a browser to confirm the route is there. Calls within 400 ms coalesce into one, and a script that has not answered after 8 s is killed and counted as a failure.
315
315
 
316
316
  The cases where it will not raise are the same ones listed under [Known limitations](#known-limitations) (elevated window, another virtual desktop, a foreground repeatedly stolen, a window hidden to the tray with `SW_HIDE`); they all answer `202` truthfully and the conversation switch still happens.
317
317
 
@@ -350,15 +350,21 @@ The cases where it will not raise are the same ones listed under [Known limitati
350
350
 
351
351
  ## Development
352
352
 
353
- ```powershell
354
- node --check lib\client.js
355
- node --check lib\index.js
356
- node smoke\smoke-test.cjs # offline state-machine test: three host generations + master switch + zh/en cases + the quick-decision bridge (worker half included) + idle detection and toast self-dismiss + toast tag length handling
357
- node smoke\cordis-host-test.mjs # real-cordis end-to-end (skips when no local DSH installation is found)
358
- powershell -NoProfile -File lib\focus-window.ps1 -ProcessId 0 # manual raise test, the last line should be FOCUSED=1
353
+ ```sh
354
+ node --check lib/client.js
355
+ node --check lib/index.js
356
+ npm test # smoke-test (state machine) + host-route-test (host half) + cordis-host-test
359
357
  npm pack --dry-run # preview the published tarball
360
358
  ```
361
359
 
360
+ `smoke/smoke-test.cjs` is the offline state-machine suite: three host generations + master switch + zh/en cases + the quick-decision bridge (worker half included) + idle detection and toast self-dismiss + toast tag length handling. `smoke/host-route-test.mjs` needs no local DSH and runs the `lib/index.js` route, its probe and the 403/405/501 gate on every platform.
361
+
362
+ When `lib/focus-window.ps1` changes (Windows only), also run it by hand:
363
+
364
+ ```powershell
365
+ powershell -NoProfile -File lib/focus-window.ps1 -ProcessId 0 # the last line should be FOCUSED=1
366
+ ```
367
+
362
368
  `cordis-host-test.mjs` borrows `@deepseek-ai/cordis` from a local DSH installation (it probes the global npm directory, `~/.dsh/profiles/web/node_modules` and the flat fallback `~/.dsh/profiles/node_modules` in turn); in a source checkout with no profile dependencies, point it there with `DSH_CORDIS_PATH=<checkout>/vendor/cordis/lib/index.js`.
363
369
 
364
370
  ## Credits & how contributions land
package/README.md CHANGED
@@ -51,12 +51,12 @@ DSH Web / Desktop 的通知插件,让你敢不开完整访问,也不必一
51
51
 
52
52
  已安装 DSH CLI 的用户,在终端执行:
53
53
 
54
- ```powershell
54
+ ```sh
55
55
  # 安装并自动挂载进 web profile
56
56
  dsh plugin --profile web add dsh-notify-me
57
57
  ```
58
58
 
59
- 重启 `dsh web`,然后硬刷新页面(Ctrl+Shift+R)。如果你使用其他 Web profile,请把命令中的 `web` 换成实际名称。
59
+ 重启 `dsh web`,然后硬刷新页面(Windows / Linux 是 Ctrl+Shift+R,macOS 是 Cmd+Shift+R)。如果你使用其他 Web profile,请把命令中的 `web` 换成实际名称。
60
60
 
61
61
  ### DSH Desktop
62
62
 
@@ -132,7 +132,7 @@ dsh-notify-me 把「监督」和「守在屏幕前」解耦:只在真的出现
132
132
  - **后台的判定**:切到别的应用、被别的窗口盖住、最小化都算;窗口一直留在前台但 3 分钟没有任何键鼠输入同样算,`idleMinutes: 0` 退回只看窗口。
133
133
  - **「当前对话不弹通知」何时补发**:窗口转到后台或闲置超时后照常提醒;若你已处理掉就作废。
134
134
  - **「回复完成」三档**:「仅后台」=不在看页面才提醒;「仅当前对话静默」=屏幕上那条静默、别的对话照常提醒,多开对话时有用;「总是提醒」=从不静默。老配置里的「窗口在前台时也提醒『回复完成』」开关自动迁移到这一项。
135
- - **「离开时保留」**:只有你人在页面前时才几秒后关闭,人不在时收到的那条留在通知中心等你回来;带「同意 / 拒绝」的审批通知仍按 12 秒走,同样不会在人不在时被撤掉。
135
+ - **「离开时保留」**:你人在页面前时,普通通知几秒后自己收;人不在时收到的那条留在通知中心等你回来。带「同意 / 拒绝」的通知不设自动撤回,留到你点按钮、回页面把请求答掉、或被新请求顶替为止;桌面端画不出按钮的审批通知按 12 秒收,人不在时同样不撤。
136
136
  - **点击通知的兜底**:桌面端抬不起来时只切对话,原因记在 `debug().raiseLast` 里;关掉这一项后点通知不做任何事。
137
137
 
138
138
  </details>
@@ -289,7 +289,7 @@ window.__dshNotifyMe.testExternal() // 显式外发测试:向有
289
289
  <details>
290
290
  <summary>展开按钮通知的记账与调窗口</summary>
291
291
 
292
- 每条按钮通知按交互 key 记账,一次只认领一条等待;请求被页面里答掉、或被新请求顶替之后,残留通知上的按钮再点也不会误裁,只是安静地关掉。带按钮的通知停留 12 秒(普通通知 5 秒),到点自动撤;没来得及点就回页面里裁决,对话里的审批一直等着你。
292
+ 每条按钮通知按交互 key 记账,一次只认领一条等待;请求被页面里答掉、或被新请求顶替之后,残留通知上的按钮再点也不会误裁,只是安静地关掉。带按钮的通知不设自动撤回,等你点按钮或把请求答掉才消失;普通通知 5 秒自收,桌面端没有按钮的审批通知 12 秒自收。「通知自动消失」选「从不关闭」时,这两类都不收。没来得及点就回页面里裁决,对话里的审批一直等着你。
293
293
 
294
294
  点正文的「调窗口 + 切对话」也归 worker 这半侧调度:`client.focus()` 只调起一个窗口(优先当前可见的),也只让那个窗口切对话——多个 DSH 标签页不会互相抢焦点或一起乱切。
295
295
 
@@ -310,7 +310,7 @@ Windows 的激活顺序是实的:已经在前台就什么都不做(最常见
310
310
 
311
311
  安全上只开一条 exact 路由。词表之外的请求一律拒:非 GET / HEAD / POST 回 `405`(包括预检的 `OPTIONS`,且从不回任何 CORS 头),非 Windows 宿主(Web 版、macOS / Linux、纯 Node)回 `501`(macOS / Linux 走深链,不经过这条路由),缺 `x-dsh-notify-me-focus: focus` 头回 `403`。
312
312
 
313
- 那个头只是「这是页面发来的」标记,不是防线——DNS rebinding 的恶意页对目标地址而言是同源的,能带任意自定义头、也不触发预检。真正的闸门是三层:对端地址必须是 loopback;`Host` 必须是 loopback 名(`127.0.0.1` / `localhost` / `[::1]`,可带端口),因为壳转发时 `host` 已被删掉、由 fetch 按 loopback URL 重填,而 rebinding 的页面 Host 仍是攻击者域名;带了 `Origin` 就必须和 `Host` 同源。任一条不符回 `403`,`reason` 分别是 `bad-remote` / `bad-host` / `cross-origin`。`GET` 只回 `{ok, route, enabled, desktop, platform}`,装完可以先用浏览器打开确认路由在不在。400 毫秒内的重复调用合并成一次,脚本超过 8 秒没回话就 kill 掉按失败处理。
313
+ 那个头只是「这是页面发来的」标记,不是防线——DNS rebinding 的恶意页对目标地址而言是同源的,能带任意自定义头、也不触发预检。真正的闸门是三层:对端地址必须是 loopback,或恰好是监听器自己绑定的那个 IP;`Host` 必须是 loopback 名(`127.0.0.1` / `localhost` / `[::1]`,可带端口)或同一个绑定地址,因为壳转发时 `host` 已被删掉、由 fetch 按它拨号的 URL 重填,而 rebinding 的页面 Host 仍是攻击者域名;带了 `Origin` 就必须和 `Host` 同源。任一条不符回 `403`,`reason` 分别是 `bad-remote` / `bad-host` / `cross-origin`。`GET` 只回 `{ok, route, enabled, desktop, platform}`,装完可以先用浏览器打开确认路由在不在。400 毫秒内的重复调用合并成一次,脚本超过 8 秒没回话就 kill 掉按失败处理。
314
314
 
315
315
  抬不起来的几种场合与[已知限制](#已知限制)里列的一致(提权窗口、另一虚拟桌面、前台被反复抢走、`SW_HIDE` 托盘隐藏),一律如实回 `202`、对话照常切。
316
316
 
@@ -349,15 +349,21 @@ Windows 的激活顺序是实的:已经在前台就什么都不做(最常见
349
349
 
350
350
  ## 开发自检
351
351
 
352
- ```powershell
353
- node --check lib\client.js
354
- node --check lib\index.js
355
- node smoke\smoke-test.cjs # 离线状态机冒烟测试:三代宿主 + 主开关 + 中英语言用例 + 快捷裁决桥(Service Worker 半侧一并跑)+ 闲置判定与通知自收 + 通知标签长度收口
356
- node smoke\cordis-host-test.mjs # 真 cordis 端到端(找不到本机 DSH 时自动跳过)
357
- powershell -NoProfile -File lib\focus-window.ps1 -ProcessId 0 # 手动验证抬窗脚本,末行应是 FOCUSED=1
352
+ ```sh
353
+ node --check lib/client.js
354
+ node --check lib/index.js
355
+ npm test # smoke-test(状态机)+ host-route-test(宿主半路由)+ cordis-host-test
358
356
  npm pack --dry-run # 预览发布包
359
357
  ```
360
358
 
359
+ `smoke/smoke-test.cjs` 是离线状态机测试:三代宿主 + 主开关 + 中英语言用例 + 快捷裁决桥(Service Worker 半侧一并跑)+ 闲置判定与通知自收 + 通知标签长度收口。`smoke/host-route-test.mjs` 不需要本机 DSH,`lib/index.js` 的路由、探针与 403/405/501 闸门在任何平台都会跑。
360
+
361
+ 改到 `lib/focus-window.ps1` 时(仅 Windows),另需手动跑一次:
362
+
363
+ ```powershell
364
+ powershell -NoProfile -File lib/focus-window.ps1 -ProcessId 0 # 末行应是 FOCUSED=1
365
+ ```
366
+
361
367
  `cordis-host-test.mjs` 会从本机 DSH 安装借 `@deepseek-ai/cordis`(依次探测 npm 全局目录、`~/.dsh/profiles/web/node_modules` 与 `~/.dsh/profiles/node_modules` 平铺回退目录);源码 checkout 里没有 profile 依赖时,用 `DSH_CORDIS_PATH=<checkout>/vendor/cordis/lib/index.js` 指定即可。
362
368
 
363
369
  ## 致谢与贡献须知
package/lib/client.js CHANGED
@@ -329,7 +329,10 @@
329
329
  return cfg;
330
330
  }
331
331
  function writeConfig(patch) {
332
- var cfg = readConfig();
332
+ // A failed write leaves the live config as the only copy; rebuilding from
333
+ // storage would drop the setting the user just changed and make the page
334
+ // disagree with itself on the next patch.
335
+ var cfg = configWriteFailed && config ? config : readConfig();
333
336
  for (var k in patch) cfg[k] = patch[k];
334
337
  // Legacy alias, live in both directions: patching the old boolean still
335
338
  // selects the policy, so an existing caller keeps its meaning instead of
@@ -339,9 +342,17 @@
339
342
  }
340
343
  cfg.donePolicy = cfg.donePolicy === "smart" || cfg.donePolicy === "always" ? cfg.donePolicy : "background";
341
344
  cfg.doneHiddenOnly = cfg.donePolicy !== "always";
342
- try { localStorage.setItem(LS_CONFIG, JSON.stringify(cfg)); } catch (e) {}
345
+ try {
346
+ localStorage.setItem(LS_CONFIG, JSON.stringify(cfg));
347
+ configWriteFailed = false;
348
+ } catch (e) {
349
+ // Quota, private-mode storage, a blocked origin: the switch looks saved
350
+ // but dies on reload, so the settings page says so.
351
+ configWriteFailed = true;
352
+ }
343
353
  return cfg;
344
354
  }
355
+ var configWriteFailed = false;
345
356
  var config = readConfig();
346
357
  // Persist a patch, swap the live module config and re-apply any active
347
358
  // title marker (its prefix follows the notification language).
@@ -472,8 +483,11 @@
472
483
 
473
484
  // ─────────────────────── notification plumbing ───────────────────
474
485
  var permAsked = false;
475
- function requestPermission() {
476
- if (!("Notification" in window) || permAsked) return;
486
+ function requestPermission(force) {
487
+ // An explicit "test" click is a fresh intent: after a dismissed prompt
488
+ // (permission stayed "default") the old latch made every later click a
489
+ // no-op until a reload.
490
+ if (!("Notification" in window) || (permAsked && !force)) return;
477
491
  permAsked = true;
478
492
  try {
479
493
  if (Notification.permission === "default") {
@@ -951,7 +965,12 @@
951
965
  // picks between the three behaviours (see DEFAULTS).
952
966
  var policy = config.autoDismiss === "always" || config.autoDismiss === "never" ? config.autoDismiss : "present";
953
967
  if (quick) {
954
- setTimeout(function () { if (policy !== "always" && hidden()) return; n.close(); }, 12000);
968
+ // "Never close" means never, approval toast or not.
969
+ setTimeout(function () {
970
+ if (policy === "never") return;
971
+ if (policy !== "always" && hidden()) return;
972
+ n.close();
973
+ }, 12000);
955
974
  } else if (policy !== "never") {
956
975
  setTimeout(function () { if (policy !== "always" && hidden()) return; n.close(); }, 5000);
957
976
  }
@@ -1310,8 +1329,10 @@
1310
1329
  if (type === "feishu" || type === "serverchan" || type === "wxpusher") {
1311
1330
  // These answer 200 with a service code; a wrong token shows up there,
1312
1331
  // not in the HTTP status. DingTalk does the same but cannot be reached
1313
- // from a page at all, hence no branch for it.
1314
- if (!parsed || typeof parsed !== "object") return { status: "sent", retry: false };
1332
+ // from a page at all, hence no branch for it. Anything else on a 2xx —
1333
+ // an empty body, a proxy or WAF HTML page — cannot confirm delivery,
1334
+ // so it is unverified rather than a success the user never got.
1335
+ if (!parsed || typeof parsed !== "object") return { status: "unverified", retry: false };
1315
1336
  var code = parsed.code;
1316
1337
  var okCode = type === "wxpusher" ? 1000 : 0;
1317
1338
  if (code === okCode) return { status: "sent", retry: false };
@@ -1321,7 +1342,7 @@
1321
1342
  return { status: "sent", retry: false };
1322
1343
  }
1323
1344
  // One attempt. Resolves to {status, retry}; never rejects.
1324
- function postOnce(spec, plain) {
1345
+ function postOnce(spec, plain, type) {
1325
1346
  var headers = {};
1326
1347
  headers["Content-Type"] = plain ? spec.noCorsType : spec.contentType;
1327
1348
  if (!plain) {
@@ -1339,11 +1360,11 @@
1339
1360
  if (plain) return { status: "unverified", retry: false }; // opaque: delivered, reply unreadable
1340
1361
  // Some hosts (and the smoke harness) hand back a response-like object
1341
1362
  // without a body reader; the HTTP status is then all there is to judge.
1342
- if (typeof res.text !== "function") return externalVerdict(spec.type, res, "");
1363
+ if (typeof res.text !== "function") return externalVerdict(type, res, "");
1343
1364
  return res.text().then(function (text) {
1344
- return externalVerdict(spec.type, res, text);
1365
+ return externalVerdict(type, res, text);
1345
1366
  }, function () {
1346
- return externalVerdict(spec.type, res, "");
1367
+ return externalVerdict(type, res, "");
1347
1368
  });
1348
1369
  });
1349
1370
  }
@@ -1363,11 +1384,11 @@
1363
1384
  var built;
1364
1385
  try { built = externalRequest(target, ev); } catch (e) { return Promise.resolve({ status: "failed (payload)", retry: false }); }
1365
1386
  var spec = built.req;
1366
- return postOnce(spec, false).catch(function (err) {
1387
+ return postOnce(spec, false, built.type).catch(function (err) {
1367
1388
  var msg = "failed (" + (err && err.message ? err.message : String(err)) + ")";
1368
1389
  // The browser refused the exchange (CORS or the network): the opaque
1369
1390
  // path still gets the request out, only the reply is unreadable.
1370
- return postOnce(spec, true).catch(function () {
1391
+ return postOnce(spec, true, built.type).catch(function () {
1371
1392
  if (built.type !== "bark") return { status: msg, retry: true };
1372
1393
  return barkGet(target.url, ev).then(null, function () { return { status: msg, retry: true }; });
1373
1394
  });
@@ -1429,19 +1450,42 @@
1429
1450
  // lockstep). A final failure is written to the dead-letter log — the alert
1430
1451
  // itself was already shown locally, so this log is the only trace that the
1431
1452
  // phone did not get it.
1432
- function sendToTarget(target, ev) {
1453
+ // Same target across two externalTargets() reads: the list is rebuilt from
1454
+ // the config on every call, so identity cannot be compared.
1455
+ function sameExternalTarget(a, b) {
1456
+ if (a.id && b.id) return a.id === b.id;
1457
+ return a.type === b.type && a.url === b.url;
1458
+ }
1459
+ function externalTargetStillWanted(target) {
1460
+ var list = externalTargets();
1461
+ for (var i = 0; i < list.length; i++) if (sameExternalTarget(list[i], target)) return true;
1462
+ return false;
1463
+ }
1464
+ function sendToTarget(target, ev, forced) {
1433
1465
  var delays = externalRetryDelays();
1434
1466
  var attempts = 0;
1467
+ // Switching forwarding off (or deleting / disabling the target) has to
1468
+ // stop a retry chain that is already asleep on a timer: without this the
1469
+ // browser kept posting to an endpoint the user had just turned off, and
1470
+ // logged the aborted delivery as a failure (`forced` marks the explicit
1471
+ // test button, which posts even while forwarding is off).
1472
+ function wanted() {
1473
+ if (!forced && !config.externalEnabled) return false;
1474
+ return externalTargetStillWanted(target);
1475
+ }
1435
1476
  function run() {
1477
+ if (!wanted()) return Promise.resolve({ status: "cancelled" });
1436
1478
  attempts++;
1437
1479
  return deliverAttempt(target, ev).then(function (r) {
1438
1480
  if (r.status === "sent" || r.status === "unverified") return r;
1439
1481
  if (!r.retry || attempts > delays.length) return r;
1482
+ if (!wanted()) return { status: "cancelled" };
1440
1483
  var wait = Math.round(delays[attempts - 1] * (1 + Math.random() * 0.25));
1441
1484
  return new Promise(function (resolve) { setTimeout(function () { resolve(run()); }, wait); });
1442
1485
  });
1443
1486
  }
1444
1487
  return run().then(function (r) {
1488
+ if (r.status === "cancelled") return r.status;
1445
1489
  var failed = r.status.indexOf("failed") === 0;
1446
1490
  recordExternalHealth(target.id, r.status, attempts, failed ? r.status.slice(7) : "");
1447
1491
  if (failed) {
@@ -1473,9 +1517,9 @@
1473
1517
  if (!config.externalEnabled) return;
1474
1518
  if (kind === "attention" && !config.externalAttention) return;
1475
1519
  if (kind === "done" && !config.externalDone) return;
1476
- sendExternalToAll(kind, title, body, sessionId, onDone);
1520
+ sendExternalToAll(kind, title, body, sessionId, false, onDone);
1477
1521
  }
1478
- function sendExternalToAll(kind, title, body, sessionId, onDone) {
1522
+ function sendExternalToAll(kind, title, body, sessionId, forced, onDone) {
1479
1523
  var targets = externalTargets();
1480
1524
  if (!targets.length) { if (typeof onDone === "function") onDone([]); return; }
1481
1525
  var ev = {
@@ -1487,7 +1531,7 @@
1487
1531
  };
1488
1532
  var ps = [];
1489
1533
  for (var i = 0; i < targets.length; i++) {
1490
- try { ps.push(sendToTarget(targets[i], ev)); } catch (e) { ps.push(Promise.resolve("failed (dispatch)")); }
1534
+ try { ps.push(sendToTarget(targets[i], ev, !!forced)); } catch (e) { ps.push(Promise.resolve("failed (dispatch)")); }
1491
1535
  }
1492
1536
  if (typeof onDone === "function") Promise.all(ps).then(onDone, function () {});
1493
1537
  }
@@ -1575,16 +1619,18 @@
1575
1619
  attentionKeysMarked[key] = true;
1576
1620
  acquireTitleMark();
1577
1621
  }
1578
- function unmarkAttention(key) {
1622
+ function unmarkAttention(key, keepPending) {
1579
1623
  delete quietedAttention[key]; // the wait is over; a queued alert dies with it
1580
1624
  // A toast that still carries buttons for this wait dies with it too —
1581
1625
  // otherwise a settled request would leave a clickable (but stale)
1582
- // approval toast behind. Test toasts are exempt: their click is the
1583
- // proof, so they outlive the short title mark on purpose.
1626
+ // approval toast behind. A test toast releases its title mark long before
1627
+ // its buttons are done being useful, so that call passes keepPending: the
1628
+ // record stays until the later unmark(), which closes the toast with it.
1629
+ // Without that the buttons went dead while the toast was still on screen.
1584
1630
  var rec = pendingActions[key];
1585
- if (rec) {
1631
+ if (rec && !(keepPending && rec.test)) {
1586
1632
  delete pendingActions[key];
1587
- if (!rec.test) closeNotificationTag(rec.tag);
1633
+ closeNotificationTag(rec.tag);
1588
1634
  }
1589
1635
  if (!attentionKeysMarked[key]) return;
1590
1636
  delete attentionKeysMarked[key];
@@ -1636,12 +1682,9 @@
1636
1682
  lastActivityAt = Date.now();
1637
1683
  if (!idleTimer) armIdle();
1638
1684
  }
1639
- (function watchActivity() {
1640
- var events = ["pointerdown", "pointermove", "keydown", "wheel", "touchstart"];
1641
- for (var ai = 0; ai < events.length; ai++) {
1642
- try { window.addEventListener(events[ai], noteActivity, { passive: true, capture: true }); } catch (e) {}
1643
- }
1644
- })();
1685
+ // Registered from the watchers effect (see apply below) so a client-plugin
1686
+ // reload removes the previous set instead of stacking another one.
1687
+ var ACTIVITY_EVENTS = ["pointerdown", "pointermove", "keydown", "wheel", "touchstart"];
1645
1688
  function idleMinutes() {
1646
1689
  var m = config && config.idleMinutes;
1647
1690
  return (typeof m === "number" && isFinite(m) && m > 0) ? m : 0;
@@ -1880,9 +1923,12 @@
1880
1923
  var quick = quickForTest(key);
1881
1924
  deliver("attention", "DSH · " + d.kind.approval, d.testApproval, null, quick);
1882
1925
  markAttention(key);
1883
- // The title mark drops like every other test's, but the toast is NOT
1884
- // closed with it — its buttons are the very thing being tested.
1885
- setTimeout(function () { unmarkAttention(key); }, TEST_MARK_RELEASE_MS);
1926
+ // The title mark drops like every other test's, but the toast outlives
1927
+ // it — its buttons are the very thing being tested. It gets the same
1928
+ // 12 s a real approval toast has on the constructor path, then the
1929
+ // record and the toast go together.
1930
+ setTimeout(function () { unmarkAttention(key, true); }, TEST_MARK_RELEASE_MS);
1931
+ setTimeout(function () { unmarkAttention(key); }, 12000);
1886
1932
  return;
1887
1933
  }
1888
1934
  if (kind === "attention") {
@@ -1898,6 +1944,10 @@
1898
1944
  // prevById: per-session-id baseline of what we have already reported.
1899
1945
  // { running: bool, pendingKeys: string[] , doneArmed: bool, seeded: bool }
1900
1946
  var prevById = Object.create(null);
1947
+ // A row absent from this many list updates is gone, not asleep: dropping
1948
+ // its baseline bounds the map on long-lived pages (subagent sessions come
1949
+ // and go), while a short absence keeps the no-replay guarantee.
1950
+ var BASELINE_MISSING_LIMIT = 40;
1901
1951
  var faceSub = null; // current session face unsubscribe
1902
1952
  var currentFaceId = null;
1903
1953
  var listStore = null;
@@ -2036,7 +2086,8 @@
2036
2086
  running: runningNow,
2037
2087
  pendingKeys: pendingNow.map(function (p) { return p.key; }),
2038
2088
  completed: !!row.completed,
2039
- seeded: true
2089
+ seeded: true,
2090
+ missing: 0
2040
2091
  };
2041
2092
 
2042
2093
  // a wait we alerted about has been resolved -> drop the title marker
@@ -2145,7 +2196,19 @@
2145
2196
  if (!sum) continue;
2146
2197
  evalListRow(sid, sum, cur);
2147
2198
  }
2148
- // sessions that vanished: keep baseline (they may reappear) - no action.
2199
+ // Sessions that vanished: keep the baseline for a while (they may
2200
+ // reappear), then drop it. Without the sweep one entry outlived every
2201
+ // subagent session that ever ran on the page.
2202
+ var gone;
2203
+ for (gone in prevById) {
2204
+ if (byId[gone]) continue;
2205
+ var goneEntry = prevById[gone];
2206
+ goneEntry.missing = (goneEntry.missing || 0) + 1;
2207
+ if (goneEntry.missing > BASELINE_MISSING_LIMIT) {
2208
+ delete prevById[gone];
2209
+ delete doneFiredAt[gone];
2210
+ }
2211
+ }
2149
2212
  } catch (e) {}
2150
2213
  }
2151
2214
 
@@ -2360,7 +2423,7 @@
2360
2423
  });
2361
2424
  } catch (e) {}
2362
2425
  // keep in sync with package.json "version" on every release
2363
- api.version = "1.14.4";
2426
+ api.version = "1.14.6";
2364
2427
  api.setConfig = function (patch) { return setConfigLocal(patch); };
2365
2428
  api.resetConfig = function () {
2366
2429
  try {
@@ -2403,7 +2466,7 @@
2403
2466
  var targets = externalTargets();
2404
2467
  if (!targets.length) { resolve({ sent: 0, unverified: 0, failed: 0, statuses: [] }); return; }
2405
2468
  var d = texts();
2406
- sendExternalToAll("attention", d.testExternalTitle, d.testExternalBody, currentSessionId(), function (statuses) {
2469
+ sendExternalToAll("attention", d.testExternalTitle, d.testExternalBody, currentSessionId(), true, function (statuses) {
2407
2470
  var out = { sent: 0, unverified: 0, failed: 0, statuses: statuses };
2408
2471
  for (var i = 0; i < statuses.length; i++) {
2409
2472
  if (statuses[i] === "sent") out.sent++;
@@ -2466,6 +2529,7 @@
2466
2529
  desktop: isDesktopShell(),
2467
2530
  raiseChannel: isDesktopShell() ? desktopRaiseChannel() : "window-focus",
2468
2531
  raiseLast: raiseState.last,
2532
+ configStored: !configWriteFailed,
2469
2533
  actionKeys: Object.keys(pendingActions),
2470
2534
  permission: ("Notification" in window) ? Notification.permission : "n/a",
2471
2535
  visibility: hidden() ? "hidden" : "visible",
@@ -2646,6 +2710,7 @@
2646
2710
  testNoPermission: "通知权限还没给:先在页面上允许一次,再点测试。",
2647
2711
  permHint: "通知权限尚未授予:先在页面上点击一次并允许通知,系统通知才能弹出(提示音不受影响)。",
2648
2712
  offHint: "已关闭提醒:先打开「启用提醒」再测试。",
2713
+ storageFailed: "设置没能保存:浏览器拒绝了这次本地存储写入(空间不足或存储被禁用),改动只在当前页面有效,刷新即还原。",
2649
2714
  versionLine: "插件版本:dsh-notify-me v"
2650
2715
  };
2651
2716
  var UI_en = {
@@ -2797,6 +2862,7 @@
2797
2862
  testNoPermission: "Notification permission is not granted: allow it once from the page, then test again.",
2798
2863
  permHint: "Notification permission is not granted yet — click once on the page and allow notifications so toasts can appear (sound is unaffected).",
2799
2864
  offHint: "Reminders are off: enable them first, then test.",
2865
+ storageFailed: "Settings were not saved: the browser refused this local-storage write (quota or storage disabled), so the change lasts only for this page and is gone on reload.",
2800
2866
  versionLine: "Plugin version: dsh-notify-me v"
2801
2867
  };
2802
2868
  // ─────────────────── sidebar row glyph ───────────────────────────
@@ -3277,7 +3343,11 @@
3277
3343
  // A denied permission means showToast() returns before it tries
3278
3344
  // anything and records no refusal; saying "sent" there would be the
3279
3345
  // same lie issue #18 was about, one layer earlier.
3280
- if (!canToast()) { setFeedback(t("testNoPermission")); return; }
3346
+ if (!canToast()) {
3347
+ requestPermission(true);
3348
+ setFeedback(t("testNoPermission"));
3349
+ return;
3350
+ }
3281
3351
  unlockOnce();
3282
3352
  // Bypasses the visibility rules on purpose: a test must fire while the
3283
3353
  // page is open, otherwise the button proves nothing.
@@ -3454,7 +3524,7 @@
3454
3524
  if (!externalTargets().length) { setFeedback(t("externalNoTargets")); return; }
3455
3525
  setFeedback(t("externalSending"));
3456
3526
  var d = texts();
3457
- sendExternalToAll("attention", d.testExternalTitle, d.testExternalBody, currentSessionId(), function (statuses) {
3527
+ sendExternalToAll("attention", d.testExternalTitle, d.testExternalBody, currentSessionId(), true, function (statuses) {
3458
3528
  var s = 0, u = 0, f = 0;
3459
3529
  for (var i = 0; i < statuses.length; i++) {
3460
3530
  if (statuses[i] === "sent") s++;
@@ -3752,7 +3822,8 @@
3752
3822
  ] : null,
3753
3823
  // Always-visible version line at the page foot: bug reports need it,
3754
3824
  // and "which build am I on" should not require the console.
3755
- h("p", { className: "dnm-hint" }, t("versionLine") + api.version)
3825
+ h("p", { className: "dnm-hint" }, t("versionLine") + api.version),
3826
+ configWriteFailed ? h("p", { className: "dnm-warn" }, t("storageFailed")) : null
3756
3827
  ]);
3757
3828
  }
3758
3829
 
@@ -3828,6 +3899,14 @@
3828
3899
  var onVisibility = function () { try { flushQuieted(); } catch (e) {} };
3829
3900
  try { document.addEventListener("visibilitychange", onVisibility); } catch (e) {}
3830
3901
  unsubs.push(function () { try { document.removeEventListener("visibilitychange", onVisibility); } catch (e) {} });
3902
+ for (var ai = 0; ai < ACTIVITY_EVENTS.length; ai++) {
3903
+ try { window.addEventListener(ACTIVITY_EVENTS[ai], noteActivity, { passive: true, capture: true }); } catch (e) {}
3904
+ }
3905
+ unsubs.push(function () {
3906
+ for (var ai = 0; ai < ACTIVITY_EVENTS.length; ai++) {
3907
+ try { window.removeEventListener(ACTIVITY_EVENTS[ai], noteActivity, { capture: true }); } catch (e) {}
3908
+ }
3909
+ });
3831
3910
  // Same re-arm for the other half of "went away": losing window focus.
3832
3911
  try { window.addEventListener("focus", onPageFocus); } catch (e) {}
3833
3912
  try { window.addEventListener("blur", onPageBlur); } catch (e) {}
package/lib/index.js CHANGED
@@ -252,6 +252,25 @@ function splitHost(value) {
252
252
  return { hostname: plain[1], port: plain[2] ?? "" };
253
253
  }
254
254
 
255
+ /**
256
+ * Whether a peer / `Host` names the listener's own bind address.
257
+ *
258
+ * The webserver can be configured to bind one concrete LAN interface; on such a
259
+ * host the shell reaches it through that address, so the request arrives from
260
+ * this machine with the bind IP as both peer and `Host`. Accepting exactly that
261
+ * literal keeps the gate self-addressed: a remote LAN client connects from its
262
+ * own address, never the server's.
263
+ * @param hostname - bare hostname from the peer address or `Host` header.
264
+ * @param bindHost - configured bind address, if the host exposes one.
265
+ * @returns whether they name the same machine.
266
+ */
267
+ function isBindAddress(hostname, bindHost) {
268
+ if (typeof bindHost !== "string" || bindHost.length === 0) return false;
269
+ const zone = bindHost.indexOf("%");
270
+ const text = zone === -1 ? bindHost : bindHost.slice(0, zone);
271
+ return bareHostname(hostname) === bareHostname(text);
272
+ }
273
+
255
274
  /**
256
275
  * Refuse a request that did not come from this machine's own page.
257
276
  *
@@ -259,20 +278,21 @@ function splitHost(value) {
259
278
  * also answers plain HTTP on the host port, and a DNS-rebinding page reaches
260
279
  * that port while looking same-origin to the browser — it can send any header,
261
280
  * including {@link RAISE_HEADER}, and no preflight fires. What it cannot forge
262
- * is the connection's source address (loopback: it is on this machine, so no)
263
- * or the `Host` header: the shell deletes the original and the fetch re-fills
264
- * it from the loopback URL, while a rebound page keeps its own name.
281
+ * is the connection's source address (this machine, so loopback or the bind
282
+ * address) or the `Host` header: the shell deletes the original and the fetch
283
+ * re-fills it from the URL it dialled, while a rebound page keeps its own name.
265
284
  *
266
- * So the gate is: loopback peer, loopback `Host`, and an `Origin` that agrees
267
- * with that `Host` when one is present.
285
+ * So the gate is: loopback or bind-address peer, the same for `Host`, and an
286
+ * `Origin` that agrees with that `Host` when one is present.
268
287
  * @param req - the incoming request.
288
+ * @param bindHost - the listener's configured bind address, when known.
269
289
  * @returns a short refusal reason, or `null` when the request may proceed.
270
290
  */
271
- function gateRequest(req) {
272
- const remote = req.socket?.remoteAddress ?? "";
273
- if (!isLoopbackHostname(String(remote).replace(/^::ffff:/i, ""))) return "bad-remote";
291
+ function gateRequest(req, bindHost) {
292
+ const remote = String(req.socket?.remoteAddress ?? "").replace(/^::ffff:/i, "");
293
+ if (!isLoopbackHostname(remote) && !isBindAddress(remote, bindHost)) return "bad-remote";
274
294
  const host = splitHost(req.headers.host);
275
- if (host === null || !isLoopbackHostname(host.hostname)) return "bad-host";
295
+ if (host === null || (!isLoopbackHostname(host.hostname) && !isBindAddress(host.hostname, bindHost))) return "bad-host";
276
296
  const origin = req.headers.origin;
277
297
  if (typeof origin !== "string" || origin.length === 0) return null;
278
298
  if (origin === "dsh-app://app") return null; // the desktop page, if not stripped
@@ -310,14 +330,14 @@ function respond(res, status, body) {
310
330
  * whether activation is available at all; only the POST form touches the OS.
311
331
  * @returns the web-server route handler.
312
332
  */
313
- function createHandler() {
333
+ function createHandler(bindHost) {
314
334
  return function handleFocus(req, res) {
315
335
  const method = req.method ?? "GET";
316
336
  if (method !== "GET" && method !== "HEAD" && method !== "POST") {
317
337
  respond(res, 405, { ok: false, reason: "method-not-allowed" });
318
338
  return;
319
339
  }
320
- const refusal = gateRequest(req);
340
+ const refusal = gateRequest(req, bindHost);
321
341
  if (refusal !== null) {
322
342
  respond(res, 403, { ok: false, reason: refusal });
323
343
  return;
@@ -364,8 +384,15 @@ function createHandler() {
364
384
  */
365
385
  export function apply(ctx) {
366
386
  ctx.inject(["webServer"], (webCtx) => {
387
+ // The listener may be bound to one concrete LAN interface; read it so the
388
+ // gate can accept the self-addressed request the shell makes in that setup.
389
+ let bindHost;
390
+ try {
391
+ const server = webCtx.webServer;
392
+ if (server && typeof server.host === "string") bindHost = server.host;
393
+ } catch {}
367
394
  webCtx.effect(
368
- () => webCtx.webServer.register({ kind: "exact", path: FOCUS_ROUTE, handler: createHandler() }),
395
+ () => webCtx.webServer.register({ kind: "exact", path: FOCUS_ROUTE, handler: createHandler(bindHost) }),
369
396
  "dsh-notify-me: window focus route",
370
397
  );
371
398
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-notify-me",
3
- "version": "1.14.4",
3
+ "version": "1.14.6",
4
4
  "description": "离开 DSH 页面也能收到提醒:需要你操作 / 后台回复完成时发系统通知、标题标记与提示音,支持审批快捷裁决与外部推送,Web 版与桌面版均可用。",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -66,7 +66,7 @@
66
66
  "node": ">=18"
67
67
  },
68
68
  "scripts": {
69
- "test": "node smoke/smoke-test.cjs && node smoke/cordis-host-test.mjs",
69
+ "test": "node smoke/smoke-test.cjs && node smoke/host-route-test.mjs && node smoke/cordis-host-test.mjs",
70
70
  "pack": "npm pack --dry-run"
71
71
  },
72
72
  "publishConfig": {