dsh-lan-guard 0.7.7 → 0.7.8

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
@@ -1,5 +1,33 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.8] — 2026-10-28(适配 DSH 0.2.2-alpha.2)
4
+
5
+ 兼容声明 + 一处跟随上游多语言界面的修复。
6
+
7
+ - `dsh.compatibility.dshReleases` 增加 `0.2.2-alpha.2: compatible`;支持范围仍为 `>=0.1.7-rc.1 <0.3.0`(`dsh.engines.dsh`),上界已覆盖 0.2.2-alpha.2,无需放宽。
8
+ - 开发依赖同步到 `0.2.2-alpha.2`(`dsh-host-webserver`、`dsh-client-connection`、`dsh-scope`),并按新宿主包的 peer 要求把 `@deepseek-ai/cordis` → `4.0.6-alpha.1`、`@deepseek-ai/schemastery` → `3.18.6-alpha.1`;peer 范围未变。
9
+ - 逐包比对 rc.4 → 0.2.2-alpha.2 的 npm 产物:这是一次**有真实改动**的升级。`dsh-host-webserver` 新增 per-Peer 的 `webserver/index-inject` 参数、`WebResource` / `WebResourceRoute` / `readResource`,`renderIndex` / `collectIndexInjections` 增加 `peer` 参数;`dsh-client-connection` 客户端契约新增可选 `resolveAsset`;`dsh-client-ui-layout`、`dsh-client-ui-settings-general` 增加 6 种语言字典(另有 `fullscreen-timeout` 更新提示文案);`dsh-client-ui-renderer`、`dsh-client-ui-settings`、`dsh-scope` 仅版本与 locale 资源变化。本插件用到的 `register` / `tapIndex` / `requestRejection` / `authenticatedUrl` 签名均未变。
10
+ - **修复**:官方轮次浮轨的 `aria-label` 在 0.2.2 被本地化成 8 种语言(中、英、日、西、法、德、俄、葡),而插件只匹配中/英,切到其他语言时手机浮轨不再贴边、按住预览失效。现改为匹配全部 8 种标签,并加结构化兜底(找到唯一带 `button[data-index]` 的 `<nav>` 并打 `data-lg-turn-nav` 标记),将来 DSH 再加语言无需再发版。
11
+ - 未采用 0.2.2 的 `resource` 路由与 `readResource`:它们不暴露客户端 socket,而门禁与 `adminPolicy: local_only` 依赖远端地址,采用会削弱安全边界;per-Peer 注入只影响 fallback 渲染,本插件不拥有 fallback。
12
+ - 测试 386 → 388:新增「选择器覆盖 8 种语言标签」「未知语言下靠结构兜底找到并标记浮轨」两项。类型检查、构建、`npm pack --dry-run` 均通过。
13
+ - 真实 Chrome(窄视口)复核:中、日、未知三种标签的浮轨均得到 `display:block` / `width:28px` / `right:4px`,刻度 `touch-action:none`;未知语言被标记 `data-lg-turn-nav=1`;`data-lg-turn-card` 时官方 tooltip 隐藏。
14
+ - 运行态(实例运行 0.2.2-alpha.2,装的是 `0.7.6`,与本版差异只在浮轨定位):`dsh --profile web --dump-config` exit 0 且插件在合成树中;LAN 入口 200、客户端补丁注入、`/plugins/dsh-lan-guard/config` 与 `/devices` 返回真实数据。
15
+ - 两版 README 六处同步到 `0.7.8` / `0.2.2-alpha.2`:徽章、已验证行、当前版本句、兼容表(新增 latest 行、`0.7.7` 转 published)、12 个已验证版本清单、发版 tag 示例;并新增一条「0.2.2 新能力评估」。
16
+ - 未做:手机实机验收(触摸、锁屏、语音);插件设置页的多语言翻译 —— DSH 已支持 8 种语言,但面板仍是中文,留到下一版处理。
17
+
18
+ **0.2.2 核查结果**:
19
+
20
+ | 检查 | 结果 |
21
+ | --- | --- |
22
+ | 本插件用到的宿主接口 | `webServer.register` / `tapIndex` / `port`、`connection.requestRejection` / `authenticatedUrl`:签名未变 |
23
+ | 0.2.2 新增能力 | per-Peer 注入、`resource` 路由、`readResource`、客户端 `resolveAsset`、7→8 语言:已评估,仅采用多语言标签 |
24
+ | 多语言浮轨 | 8 种标签全覆盖 + 未知语言结构化兜底,真实 Chrome 验证 |
25
+ | 类型检查(0.2.2-alpha.2 `.d.ts`) | 通过 |
26
+ | 自动回归 | 23 文件 / 388 用例全绿 |
27
+ | 构建与打包 | 通过;`npm pack` 清单与 `files` 一致 |
28
+ | `--dump-config` | exit 0,插件在合成树中,无拒载/豁免 |
29
+ | 运行态 | LAN 入口 200、补丁注入、`/config` 与 `/devices` 200 |
30
+
3
31
  ## [0.7.7] — 2026-10-27(适配 DSH 0.2.1-rc.4)
4
32
 
5
33
  **代码零改动**,只更新兼容声明、开发依赖与发布文档。
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  <a href="https://github.com/idoall/dsh-lan-guard/actions/workflows/ci.yml"><img src="https://github.com/idoall/dsh-lan-guard/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
7
7
  <a href="https://www.npmjs.com/package/dsh-lan-guard"><img src="https://img.shields.io/npm/v/dsh-lan-guard?label=npm&color=CB3837" alt="npm version"></a>
8
8
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-0F172A" alt="MIT"></a>
9
- <img src="https://img.shields.io/badge/DSH-0.2.1--rc.4-4B6BFB" alt="DSH 0.2.1-rc.4">
9
+ <img src="https://img.shields.io/badge/DSH-0.2.2--alpha.2-4B6BFB" alt="DSH 0.2.2-alpha.2">
10
10
  </p>
11
11
 
12
12
  <p align="center">English | <a href="README.zh.md">中文</a></p>
@@ -49,7 +49,7 @@ Requirements:
49
49
 
50
50
  - DeepSeek Harness with a Web profile
51
51
  - Node.js 20 or newer
52
- - Verified DeepSeek Harness: `0.2.1-rc.4` (API review, type checking and automated regression, plus config load, LAN entry, client injection and management endpoints checked on a running rc.4 instance (running `0.7.6`, whose `lib` is byte-identical to this release); phone/browser interaction acceptance on rc.4 is still pending).
52
+ - Verified DeepSeek Harness: `0.2.2-alpha.2` (API review, type checking and automated regression, plus config load, LAN entry, client injection and management endpoints checked on a running `0.2.2-alpha.2` instance; that instance runs `0.7.6`, whose only difference from this release is how the phone turn rail is located — and that fix was verified in real Chrome against a standalone page for a Chinese, a Japanese and an unknown label; on-device acceptance is still pending).
53
53
 
54
54
  Install from npm:
55
55
 
@@ -148,11 +148,12 @@ The plugin reads its config from its Cordis entry. **Every key has a usable defa
148
148
 
149
149
  ## Compatibility
150
150
 
151
- Current version: plugin **`0.7.7`**, compatible with DeepSeek Harness **`0.2.1-rc.4`**. Each row below is one plugin release: the DSH versions it was verified against, and what that release did.
151
+ Current version: plugin **`0.7.8`**, compatible with DeepSeek Harness **`0.2.2-alpha.2`**. Each row below is one plugin release: the DSH versions it was verified against, and what that release did.
152
152
 
153
153
  | Plugin | Verified DeepSeek Harness | What this version is |
154
154
  | --- | --- | --- |
155
- | **`0.7.7`** (latest) | **`0.2.1-rc.4`**, `0.2.1-rc.3`, `0.2.1-rc.2`, `0.2.1-alpha.5`, `0.2.1-alpha.4`, `0.2.1-alpha.3`, `0.2.1-alpha.1`, `0.2.0-rc.2`, `0.2.0-rc.1`, `0.1.7-rc.2`, `0.1.7-rc.1` | Keeps up with DSH `0.2.1-rc.4`: this upstream release only bumps version strings, and the host interfaces and types are byte-identical to rc.3; no plugin runtime code changed. |
155
+ | **`0.7.8`** (latest) | **`0.2.2-alpha.2`**, `0.2.1-rc.4`, `0.2.1-rc.3`, `0.2.1-rc.2`, `0.2.1-alpha.5`, `0.2.1-alpha.4`, `0.2.1-alpha.3`, `0.2.1-alpha.1`, `0.2.0-rc.2`, `0.2.0-rc.1`, `0.1.7-rc.2`, `0.1.7-rc.1` | Keeps up with DSH `0.2.2-alpha.2`: the new UI localises the turn navigator's label into eight languages, so the phone rail now finds it without depending on copy (with a structural fallback for languages added later); the rest is compatibility statements and docs. |
156
+ | **`0.7.7`** (published) | **`0.2.1-rc.4`**, `0.2.1-rc.3`, `0.2.1-rc.2`, `0.2.1-alpha.5`, `0.2.1-alpha.4`, `0.2.1-alpha.3`, `0.2.1-alpha.1`, `0.2.0-rc.2`, `0.2.0-rc.1`, `0.1.7-rc.2`, `0.1.7-rc.1` | Keeps up with DSH `0.2.1-rc.4`: this upstream release only bumps version strings, and the host interfaces and types are byte-identical to rc.3; no plugin runtime code changed. |
156
157
  | **`0.7.6`** (published) | **`0.2.1-rc.3`**, `0.2.1-rc.2`, `0.2.1-alpha.5`, `0.2.1-alpha.4`, `0.2.1-alpha.3`, `0.2.1-alpha.1`, `0.2.0-rc.2`, `0.2.0-rc.1`, `0.1.7-rc.2`, `0.1.7-rc.1` | Compatibility release for DSH `0.2.1-rc.3`; no runtime code change. API/type/automated checks only; phone/browser acceptance pending. |
157
158
  | **`0.7.5`** (published) | **`0.2.1-rc.2`**, `0.2.1-alpha.5`, `0.2.1-alpha.4`, `0.2.1-alpha.3`, `0.2.1-alpha.1`, `0.2.0-rc.2`, `0.2.0-rc.1`, `0.1.7-rc.2` | Keeps up with DSH `0.2.1-rc.2`: compatibility statement only, no code change. |
158
159
  | **`0.7.4`** | **`0.2.1-alpha.5`**, `0.2.1-alpha.4`, `0.2.1-alpha.3`, `0.2.1-alpha.1`, `0.2.0-rc.2`, `0.2.0-rc.1`, `0.1.7-rc.2` | Keeps up with DSH `0.2.1-alpha.5`: compatibility statement only, no code change. |
@@ -180,7 +181,8 @@ Current version: plugin **`0.7.7`**, compatible with DeepSeek Harness **`0.2.1-r
180
181
  | `0.1.1` | `0.1.7-rc.1` | Documentation release: bilingual user READMEs |
181
182
  | `0.1.0` | `0.1.7-rc.1` | First release: gated reverse proxy, self-signed HTTPS, device pairing, settings page, QR access |
182
183
 
183
- - Declared range `>=0.1.7-rc.1 <0.3.0` (`dsh.engines.dsh`); verified releases: `0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-alpha.1`, `0.2.1-alpha.3`, `0.2.1-alpha.4`, `0.2.1-alpha.5`, `0.2.1-rc.2`, `0.2.1-rc.3`, `0.2.1-rc.4` (11 releases; the rc.4 verification scope is described above). DSH versions not listed are **unverified** — verify them yourself before use. The upper bound was widened from `<0.2.0` in `0.4.3` because profile load refuses a bundle whose range excludes the running release, and a plain `<0.2.0` would exclude the `0.2.0` stable.
184
+ - Declared range `>=0.1.7-rc.1 <0.3.0` (`dsh.engines.dsh`); verified releases: `0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-alpha.1`, `0.2.1-alpha.3`, `0.2.1-alpha.4`, `0.2.1-alpha.5`, `0.2.1-rc.2`, `0.2.1-rc.3`, `0.2.1-rc.4`, `0.2.2-alpha.2` (12 releases; the `0.2.2-alpha.2` verification scope is described above). DSH versions not listed are **unverified** — verify them yourself before use. The upper bound was widened from `<0.2.0` in `0.4.3` because profile load refuses a bundle whose range excludes the running release, and a plain `<0.2.0` would exclude the `0.2.0` stable.
185
+ - **New in 0.2.2, evaluated**: the per-Peer `webserver/index-inject` emit, `resource` routes and `readResource` are all new; this plugin does not use them — the first only affects fallback rendering, and the other two expose no client socket, while the gate and the "local only" policy depend on the remote address. What it *did* adopt is the multi-language UI: the phone rail now recognises all eight DSH languages, with a structural fallback for any language added later.
184
186
  - Host/client interfaces this plugin uses: `webServer.register` / `webServer.tapIndex` (indexTaps), `connection.requestRejection`, `connection.authenticatedUrl`, the additive `settings.section` seat, `@deepseek-ai/schemastery`, and `profileContext` (for deriving the default data directory).
185
187
  - **Breaking default change (from `0.3.2`)**: `listenHost` now defaults to `0.0.0.0` instead of `127.0.0.1`, so one restart after install is enough; `0.3.1` and earlier default to loopback only. The gate and self-signed TLS defaults are unchanged (with no password the gate still refuses every device). See the [CHANGELOG](CHANGELOG.md).
186
188
  - **`0.4.0` verification status**: all three changes carry measurements, not just specs.
@@ -341,8 +343,8 @@ The client half registers into the official additive `settings.section` seat; th
341
343
  Releases are tag-driven. Update `package.json`, move the matching CHANGELOG section out of `Unreleased`, write `release-notes/v<version>.md` with both language anchors, then push the release commit and tag:
342
344
 
343
345
  ```sh
344
- git tag v0.7.7
345
- git push origin v0.7.7
346
+ git tag v0.7.8
347
+ git push origin v0.7.8
346
348
  ```
347
349
 
348
350
  The release workflow checks that the tag matches the `package.json` version and that the notes carry both anchors, then runs `pnpm run verify`, packs the plugin, publishes through npm trusted publishing (OIDC), and creates a GitHub Release with the tarball attached.
package/README.zh.md CHANGED
@@ -6,7 +6,7 @@
6
6
  <a href="https://github.com/idoall/dsh-lan-guard/actions/workflows/ci.yml"><img src="https://github.com/idoall/dsh-lan-guard/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
7
7
  <a href="https://www.npmjs.com/package/dsh-lan-guard"><img src="https://img.shields.io/npm/v/dsh-lan-guard?label=npm&color=CB3837" alt="npm 版本"></a>
8
8
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-0F172A" alt="MIT"></a>
9
- <img src="https://img.shields.io/badge/DSH-0.2.1--rc.4-4B6BFB" alt="DSH 0.2.1-rc.4">
9
+ <img src="https://img.shields.io/badge/DSH-0.2.2--alpha.2-4B6BFB" alt="DSH 0.2.2-alpha.2">
10
10
  </p>
11
11
 
12
12
  <p align="center"><a href="README.md">English</a> | 中文</p>
@@ -49,7 +49,7 @@ DSH 的 Web 界面只监听 `127.0.0.1`,而官方明确拒绝绑定 `0.0.0.0`
49
49
 
50
50
  - 带 Web profile 的 DeepSeek Harness
51
51
  - Node.js 20 或更新
52
- - 已验证的 DeepSeek Harness:`0.2.1-rc.4`(接口审查、类型检查与自动回归;另在运行 rc.4 的实例上核对配置加载、LAN 入口、客户端注入与管理接口,该实例装的是 `0.7.6`,其 `lib` 与本版逐字节相同。rc.4 的手机/浏览器交互验收仍待完成)。
52
+ - 已验证的 DeepSeek Harness:`0.2.2-alpha.2`(接口审查、类型检查与自动回归;另在运行 `0.2.2-alpha.2` 的实例上核对配置加载、LAN 入口、客户端注入与管理接口。该实例装的是 `0.7.6`,与本版只差手机轮次浮轨的定位方式,而这项修复已在真实 Chrome 里用独立页面按中文、日文、未知语言三种标签验证;手机实机验收仍待完成)。
53
53
 
54
54
  从 npm 安装:
55
55
 
@@ -149,11 +149,12 @@ dsh plugin --profile web add "link:$(pwd)"
149
149
 
150
150
  ## 兼容性
151
151
 
152
- 当前版本:插件 **`0.7.7`**,兼容 DeepSeek Harness **`0.2.1-rc.4`**。下表每行是一个插件版本:它验证过哪些 DSH 版本,以及那一版做了什么。
152
+ 当前版本:插件 **`0.7.8`**,兼容 DeepSeek Harness **`0.2.2-alpha.2`**。下表每行是一个插件版本:它验证过哪些 DSH 版本,以及那一版做了什么。
153
153
 
154
154
  | 插件 | 已验证的 DeepSeek Harness | 这个版本是什么 |
155
155
  | --- | --- | --- |
156
- | **`0.7.7`** (latest) | **`0.2.1-rc.4`**、`0.2.1-rc.3`、`0.2.1-rc.2`、`0.2.1-alpha.5`、`0.2.1-alpha.4`、`0.2.1-alpha.3`、`0.2.1-alpha.1`、`0.2.0-rc.2`、`0.2.0-rc.1`、`0.1.7-rc.2`、`0.1.7-rc.1` | 跟上 DSH `0.2.1-rc.4`:上游这次只改版本号,宿主接口与类型与 rc.3 逐字节一致;插件运行时代码不变。 |
156
+ | **`0.7.8`** (latest) | **`0.2.2-alpha.2`**、`0.2.1-rc.4`、`0.2.1-rc.3`、`0.2.1-rc.2`、`0.2.1-alpha.5`、`0.2.1-alpha.4`、`0.2.1-alpha.3`、`0.2.1-alpha.1`、`0.2.0-rc.2`、`0.2.0-rc.1`、`0.1.7-rc.2`、`0.1.7-rc.1` | 跟上 DSH `0.2.2-alpha.2`:新版界面把轮次导航的标签译成 8 种语言,手机浮轨改成不依赖文案的定位(并为将来新增语言留了结构化兜底);其余是兼容声明与文档。 |
157
+ | **`0.7.7`** (published) | **`0.2.1-rc.4`**、`0.2.1-rc.3`、`0.2.1-rc.2`、`0.2.1-alpha.5`、`0.2.1-alpha.4`、`0.2.1-alpha.3`、`0.2.1-alpha.1`、`0.2.0-rc.2`、`0.2.0-rc.1`、`0.1.7-rc.2`、`0.1.7-rc.1` | 跟上 DSH `0.2.1-rc.4`:上游这次只改版本号,宿主接口与类型与 rc.3 逐字节一致;插件运行时代码不变。 |
157
158
  | **`0.7.6`** (published) | **`0.2.1-rc.3`**、`0.2.1-rc.2`、`0.2.1-alpha.5`、`0.2.1-alpha.4`、`0.2.1-alpha.3`、`0.2.1-alpha.1`、`0.2.0-rc.2`、`0.2.0-rc.1`、`0.1.7-rc.2`、`0.1.7-rc.1` | 跟上 DSH `0.2.1-rc.3`,运行时代码不变。仅完成接口、类型与自动检查;手机/浏览器验收待完成。 |
158
159
  | **`0.7.5`** (published) | **`0.2.1-rc.2`**、`0.2.1-alpha.5`、`0.2.1-alpha.4`、`0.2.1-alpha.3`、`0.2.1-alpha.1`、`0.2.0-rc.2`、`0.2.0-rc.1`、`0.1.7-rc.2` | 跟上 DSH `0.2.1-rc.2`:只更新兼容声明,代码没动。 |
159
160
  | **`0.7.4`** | **`0.2.1-alpha.5`**、`0.2.1-alpha.4`、`0.2.1-alpha.3`、`0.2.1-alpha.1`、`0.2.0-rc.2`、`0.2.0-rc.1`、`0.1.7-rc.2` | 跟上 DSH `0.2.1-alpha.5`:只更新兼容声明,代码没动。 |
@@ -181,7 +182,8 @@ dsh plugin --profile web add "link:$(pwd)"
181
182
  | `0.1.1` | `0.1.7-rc.1` | 文档版:中英双语用户 README |
182
183
  | `0.1.0` | `0.1.7-rc.1` | 首个版本:门禁反向代理、自签 HTTPS、设备配对、设置页、扫码访问 |
183
184
 
184
- - 声明范围 `>=0.1.7-rc.1 <0.3.0`(`dsh.engines.dsh`);已验证版本:`0.1.7-rc.1`、`0.1.7-rc.2`、`0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-alpha.1`、`0.2.1-alpha.3`、`0.2.1-alpha.4`、`0.2.1-alpha.5`、`0.2.1-rc.2`、`0.2.1-rc.3`、`0.2.1-rc.4`(共 11 个版本,rc.4 验证范围见上文)。未列入的 DSH 版本属**未验证**,请自行验证后再使用。上界在 `0.4.3` 从 `<0.2.0` 放宽:profile 加载会拒绝范围不含运行版本的 bundle,而裸的 `<0.2.0` 恰好排除 `0.2.0` 正式版。
185
+ - 声明范围 `>=0.1.7-rc.1 <0.3.0`(`dsh.engines.dsh`);已验证版本:`0.1.7-rc.1`、`0.1.7-rc.2`、`0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-alpha.1`、`0.2.1-alpha.3`、`0.2.1-alpha.4`、`0.2.1-alpha.5`、`0.2.1-rc.2`、`0.2.1-rc.3`、`0.2.1-rc.4`、`0.2.2-alpha.2`(共 12 个版本,`0.2.2-alpha.2` 验证范围见上文)。未列入的 DSH 版本属**未验证**,请自行验证后再使用。上界在 `0.4.3` 从 `<0.2.0` 放宽:profile 加载会拒绝范围不含运行版本的 bundle,而裸的 `<0.2.0` 恰好排除 `0.2.0` 正式版。
186
+ - **0.2.2 新能力评估**:`webserver/index-inject` 的 per-Peer 注入、`resource` 路由与 `readResource` 都是 0.2.2 新增;本插件没有采用 —— 前者只影响 fallback 渲染,后两者拿不到客户端地址,而门禁和「仅本机」策略依赖远端地址。真正用上的是多语言:手机浮轨现在识别 DSH 全部 8 种界面语言,并对将来新增语言保留结构化兜底。
185
187
  - 本插件用到的宿主/客户端接口:`webServer.register` / `webServer.tapIndex`(indexTaps)、`connection.requestRejection`、`connection.authenticatedUrl`、追加型 `settings.section` seat、`@deepseek-ai/schemastery`,以及 `profileContext`(用于推导默认数据目录)。
186
188
  - **破坏性默认值变更(`0.3.2` 起)**:`listenHost` 默认由 `127.0.0.1` 改为 `0.0.0.0`,装完重启一次即可用;`0.3.1` 及更早默认仅回环。门禁与自签 TLS 的默认值未变(未设密码仍拒绝所有设备)。详见 [CHANGELOG](CHANGELOG.md)。
187
189
  - **`0.4.0` 的验证状态**:三处改动都做了实测,不只跑用例。
@@ -342,8 +344,8 @@ pnpm run verify # 类型检查 + 测试 + 构建 + pack dry-run
342
344
  发版由 tag 驱动。更新 `package.json`、把对应 CHANGELOG 段落移出 `Unreleased`、编写带中英双锚点的 `release-notes/v<版本>.md` 后,推送发版提交与 tag:
343
345
 
344
346
  ```sh
345
- git tag v0.7.7
346
- git push origin v0.7.7
347
+ git tag v0.7.8
348
+ git push origin v0.7.8
347
349
  ```
348
350
 
349
351
  发版工作流会校验 tag 与 `package.json` 版本一致、要求发布说明含中英双锚点,然后运行 `pnpm run verify`、打包插件、通过 npm trusted publishing(OIDC)发布,并创建附带 tarball 的 GitHub Release。
package/lib/index.js CHANGED
@@ -3264,6 +3264,36 @@ const MOBILE_TURN_RAIL_MARKER = "/*dsh-lan-guard:mobile-turn-rail*/";
3264
3264
  /** Id of the phone preview card the touch layer renders. */
3265
3265
  const TURN_RAIL_CARD_ID = "lg-turn-card";
3266
3266
  /**
3267
+ * Selectors for the official rail.
3268
+ *
3269
+ * `nav[data-lg-turn-nav]` is the structural seat: when DSH adds a language that
3270
+ * {@link TURN_RAIL_LABELS} does not name yet, the scripts find the rail by its
3271
+ * `button[data-index]` marks, tag it, and every rule below starts applying to it
3272
+ * without a new release.
3273
+ */
3274
+ const TURN_RAIL_NAV_SELECTORS = [...[
3275
+ "轮次导航",
3276
+ "Turn navigation",
3277
+ "ターン移動",
3278
+ "Navegación por turnos",
3279
+ "Navigation entre les tours",
3280
+ "Rundennavigation",
3281
+ "Навигация по ходам",
3282
+ "Navegação entre turnos"
3283
+ ].map((label) => `nav[aria-label="${label}"]`), "nav[data-lg-turn-nav]"];
3284
+ /** The rail itself, for display and layout. */
3285
+ const TURN_RAIL_SELECTOR = TURN_RAIL_NAV_SELECTORS.join(",");
3286
+ /** Everything inside the rail: the touch-action/overscroll containment. */
3287
+ const TURN_RAIL_DESCENDANT_SELECTOR = TURN_RAIL_NAV_SELECTORS.map((selector) => `${selector} *`).join(",");
3288
+ /** The tick marks: one readable height instead of DSH's 2px hairline. */
3289
+ const TURN_RAIL_TICK_SELECTOR = TURN_RAIL_NAV_SELECTORS.map((selector) => `${selector} button[data-index]::before`).join(",");
3290
+ /** The official hover bubble, hidden while this plugin's card is open. */
3291
+ const TURN_RAIL_TOOLTIP_SELECTOR = TURN_RAIL_NAV_SELECTORS.map((selector) => `${selector}[data-lg-turn-card] [role="tooltip"]`).join(",");
3292
+ /** The hovered mark, promoted to a visible brand-coloured bar during a scrub. */
3293
+ const TURN_RAIL_PREVIEW_SELECTOR = TURN_RAIL_NAV_SELECTORS.map((selector) => `${selector}[data-lg-turn-card] button[class*="_markP"]::before`).join(",");
3294
+ /** Embed `text` as the body of a double-quoted JavaScript string literal. */
3295
+ const jsString = (text) => JSON.stringify(text).slice(1, -1);
3296
+ /**
3267
3297
  * The phone-only touch layer for the turn rail.
3268
3298
  *
3269
3299
  * The official rail is a HOVER design: the preview bubble is driven by
@@ -3307,7 +3337,21 @@ function mobileTurnRailTouchScript() {
3307
3337
  var tipObserver=null,navObserver=null,markObserver=null,tipNode=null,tipPoll=0,settleTimer=0;
3308
3338
  var tipBaseline="",tipGeneration=0,tipCache={},cacheNav=null;
3309
3339
  function one(sel,root){try{return (root||doc).querySelector(sel)}catch(e){return null}}
3310
- function navOf(node){try{return node&&node.closest?node.closest(SEL):null}catch(e){return null}}
3340
+ function navOf(node){
3341
+ try{
3342
+ var n=node&&node.closest?node.closest(SEL):null;
3343
+ if(n)return n;
3344
+ /* A language DSH added after this release: the rail is still the only
3345
+ <nav> whose marks carry data-index, so tag it and let the rules that
3346
+ list nav[data-lg-turn-nav] take over. */
3347
+ var c=node&&node.closest?node.closest('nav'):null;
3348
+ if(c&&c.querySelector&&c.querySelector('button[data-index]')){
3349
+ try{c.setAttribute('data-lg-turn-nav','1')}catch(e){}
3350
+ return c;
3351
+ }
3352
+ return null;
3353
+ }catch(e){return null}
3354
+ }
3311
3355
  // Official TurnNavigator marks carry data-index; card controls do not.
3312
3356
  function marks(){return nav?nav.querySelectorAll("button[data-index]"):[]}
3313
3357
  function el(tag,style,text){
@@ -3747,9 +3791,10 @@ function mobileTurnRailTouchScript() {
3747
3791
  *
3748
3792
  * - the override lives in a `@media (max-width: 1023px)` block, so a desktop
3749
3793
  * window is never touched;
3750
- * - the selector is attribute-based (`nav[aria-label="轮次导航"]` /
3751
- * `"Turn navigation"`) plus one structural fallback, because a CSS-module
3752
- * class name is hashed; the labelled rule nudges the rail into the chat
3794
+ * - the selector is attribute-based (`nav[aria-label="…"]`, one per UI language
3795
+ * DSH ships — eight as of 0.2.2, listed in {@link TURN_RAIL_LABELS}) plus a
3796
+ * structural fallback, because a CSS-module class name is hashed and DSH
3797
+ * localises the label; the labelled rule nudges the rail into the chat
3753
3798
  * frame's right gutter (`right:4px`, `width:28px`) so it does not overlap the
3754
3799
  * message column;
3755
3800
  * - it SELF-CHECKS: if the rail is found but stays invisible while the override
@@ -3778,7 +3823,7 @@ function mobileTurnRailTouchScript() {
3778
3823
  * @returns one inline `<script>` element.
3779
3824
  */
3780
3825
  function mobileTurnRailScript() {
3781
- return `<script>${MOBILE_TURN_RAIL_MARKER}(function(){try{var S=self,doc=document;var flags=globalThis.${PATCHES_GLOBAL};if(flags&&flags.mobileTurnRail===true)return;globalThis.${PATCHES_GLOBAL}=Object.assign({},flags,{mobileTurnRail:true});var diag=false;try{diag=/[?&]lgdiag/.test((S.location&&S.location.search)||"")}catch(e){}var lines=[];function log(s){lines.push(s);if(!diag)return;try{var p=doc.getElementById("lgtr");if(!p){p=doc.createElement("pre");p.id="lgtr";p.style.cssText="position:fixed;left:0;bottom:0;right:0;max-height:30%;z-index:2147483646;background:rgba(0,0,0,.9);color:#7cf;font:10px/1.3 monospace;padding:6px;margin:0;overflow:auto;white-space:pre-wrap;pointer-events:none";(doc.body||doc.documentElement).appendChild(p)}p.textContent="[lan-guard 轮次导航诊断]"+String.fromCharCode(10)+lines.join(String.fromCharCode(10))}catch(e){}}var SEL="nav[aria-label=\\"轮次导航\\"],nav[aria-label=\\"Turn navigation\\"]";if(!doc.getElementById("lg-turn-rail")){var st=doc.createElement("style");st.id="lg-turn-rail";st.appendChild(doc.createTextNode("@media (max-width: 1023px){"+SEL+"{display:block!important;right:4px!important;width:28px!important;touch-action:none!important;-webkit-touch-callout:none;-webkit-user-drag:none;user-select:none;-webkit-user-select:none;overscroll-behavior:contain!important}"+"nav[aria-label=\\"轮次导航\\"] *,nav[aria-label=\\"Turn navigation\\"] *{touch-action:none!important;overscroll-behavior:contain!important}"+"html,body{overscroll-behavior-y:none!important}"+"nav[aria-label=\\"轮次导航\\"] button[data-index]::before,nav[aria-label=\\"Turn navigation\\"] button[data-index]::before{height:3px!important}"+"nav[aria-label=\\"轮次导航\\"][data-lg-turn-card] [role=\\"tooltip\\"],nav[aria-label=\\"Turn navigation\\"][data-lg-turn-card] [role=\\"tooltip\\"]{visibility:hidden!important;opacity:0!important;pointer-events:none!important}"+"nav[aria-label=\\"轮次导航\\"][data-lg-turn-card] button[class*=\\"_markP\\"]::before,nav[aria-label=\\"Turn navigation\\"][data-lg-turn-card] button[class*=\\"_markP\\"]::before{transform:translateY(-50%) scaleX(1)!important;background:var(--dsw-alias-state-business-primary,#3964fe)!important;opacity:1!important}"+"div:has(>div [data-chat-flow])>div>nav{display:block!important}"+"}"));(doc.head||doc.documentElement).appendChild(st)}var narrow=false;try{narrow=!!(S.matchMedia&&S.matchMedia("(max-width: 1023px)").matches)}catch(e){}log("narrow="+narrow);var tries=0,misses=0,done=false;function rail(){try{return doc.querySelector(SEL)}catch(e){return null}}function visible(n){try{var cs=getComputedStyle(n),r=n.getBoundingClientRect();return cs.display!=="none"&&r.width>1&&r.height>1}catch(e){return false}}function revert(){try{var s=doc.getElementById("lg-turn-rail");if(s&&s.parentNode)s.parentNode.removeChild(s)}catch(e){}globalThis.${PATCHES_GLOBAL}=Object.assign({},globalThis.${PATCHES_GLOBAL},{mobileTurnRail:"reverted"});}function run(){if(done)return;if(!narrow){done=true;return}var n=rail();if(!n){if(++tries>8){log("no turn rail yet (style kept for the next session)");done=true}return}if(visible(n)){var r=n.getBoundingClientRect();log("turn rail visible "+Math.round(r.width)+"x"+Math.round(r.height)+" at x"+Math.round(r.x));done=true;return}if(++misses>=3){log("override lost -> reverted (stock page)");revert();done=true}}log("style installed");run();var t=setInterval(function(){if(done){clearInterval(t);return}run()},1500);try{` + mobileTurnRailTouchScript() + "}catch(e){}}catch(e){}})()<\/script>";
3826
+ return `<script>${MOBILE_TURN_RAIL_MARKER}(function(){try{var S=self,doc=document;var flags=globalThis.${PATCHES_GLOBAL};if(flags&&flags.mobileTurnRail===true)return;globalThis.${PATCHES_GLOBAL}=Object.assign({},flags,{mobileTurnRail:true});var diag=false;try{diag=/[?&]lgdiag/.test((S.location&&S.location.search)||"")}catch(e){}var lines=[];function log(s){lines.push(s);if(!diag)return;try{var p=doc.getElementById("lgtr");if(!p){p=doc.createElement("pre");p.id="lgtr";p.style.cssText="position:fixed;left:0;bottom:0;right:0;max-height:30%;z-index:2147483646;background:rgba(0,0,0,.9);color:#7cf;font:10px/1.3 monospace;padding:6px;margin:0;overflow:auto;white-space:pre-wrap;pointer-events:none";(doc.body||doc.documentElement).appendChild(p)}p.textContent="[lan-guard 轮次导航诊断]"+String.fromCharCode(10)+lines.join(String.fromCharCode(10))}catch(e){}}var SEL=` + JSON.stringify(TURN_RAIL_SELECTOR) + ";if(!doc.getElementById(\"lg-turn-rail\")){var st=doc.createElement(\"style\");st.id=\"lg-turn-rail\";st.appendChild(doc.createTextNode(\"@media (max-width: 1023px){\"+SEL+\"{display:block!important;right:4px!important;width:28px!important;touch-action:none!important;-webkit-touch-callout:none;-webkit-user-drag:none;user-select:none;-webkit-user-select:none;overscroll-behavior:contain!important}\"+\"" + jsString(TURN_RAIL_DESCENDANT_SELECTOR) + "{touch-action:none!important;overscroll-behavior:contain!important}\"+\"html,body{overscroll-behavior-y:none!important}\"+\"" + jsString(TURN_RAIL_TICK_SELECTOR) + "{height:3px!important}\"+\"" + jsString(TURN_RAIL_TOOLTIP_SELECTOR) + "{visibility:hidden!important;opacity:0!important;pointer-events:none!important}\"+\"" + jsString(TURN_RAIL_PREVIEW_SELECTOR) + `{transform:translateY(-50%) scaleX(1)!important;background:var(--dsw-alias-state-business-primary,#3964fe)!important;opacity:1!important}"+"div:has(>div [data-chat-flow])>div>nav{display:block!important}"+"}"));(doc.head||doc.documentElement).appendChild(st)}var narrow=false;try{narrow=!!(S.matchMedia&&S.matchMedia("(max-width: 1023px)").matches)}catch(e){}log("narrow="+narrow);var tries=0,misses=0,done=false;function rail(){var n=null;try{n=doc.querySelector(SEL)}catch(e){}if(n)return n;try{var all=doc.querySelectorAll("nav");for(var i=0;i<all.length;i++){var c=all[i];if(c.querySelector&&c.querySelector("button[data-index]")){try{c.setAttribute("data-lg-turn-nav","1")}catch(e){}return c}}}catch(e){}return null}function visible(n){try{var cs=getComputedStyle(n),r=n.getBoundingClientRect();return cs.display!=="none"&&r.width>1&&r.height>1}catch(e){return false}}function revert(){try{var s=doc.getElementById("lg-turn-rail");if(s&&s.parentNode)s.parentNode.removeChild(s)}catch(e){}globalThis.${PATCHES_GLOBAL}=Object.assign({},globalThis.${PATCHES_GLOBAL},{mobileTurnRail:"reverted"});}function run(){if(done)return;if(!narrow){done=true;return}var n=rail();if(!n){if(++tries>8){log("no turn rail yet (style kept for the next session)");done=true}return}if(visible(n)){var r=n.getBoundingClientRect();log("turn rail visible "+Math.round(r.width)+"x"+Math.round(r.height)+" at x"+Math.round(r.x));done=true;return}if(++misses>=3){log("override lost -> reverted (stock page)");revert();done=true}}log("style installed");run();var t=setInterval(function(){if(done){clearInterval(t);return}run()},1500);try{` + mobileTurnRailTouchScript() + "}catch(e){}}catch(e){}})()<\/script>";
3782
3827
  }
3783
3828
  /**
3784
3829
  * Insert the narrow-screen turn-rail override.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-lan-guard",
3
- "version": "0.7.7",
3
+ "version": "0.7.8",
4
4
  "description": "DSH web plugin: expose the official desktop Web UI to the local network through a gated reverse proxy, without touching DSH's own loopback binding.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -78,7 +78,8 @@
78
78
  "0.2.1-alpha.5": "compatible",
79
79
  "0.2.1-rc.2": "compatible",
80
80
  "0.2.1-rc.3": "compatible",
81
- "0.2.1-rc.4": "compatible"
81
+ "0.2.1-rc.4": "compatible",
82
+ "0.2.2-alpha.2": "compatible"
82
83
  }
83
84
  }
84
85
  },
@@ -99,17 +100,17 @@
99
100
  "reverse-proxy"
100
101
  ],
101
102
  "devDependencies": {
102
- "@deepseek-ai/cordis": "4.0.5",
103
- "@deepseek-ai/dsh-client-connection": "0.2.1-rc.4",
104
- "@deepseek-ai/dsh-host-webserver": "0.2.1-rc.4",
105
- "@deepseek-ai/schemastery": "3.18.5",
103
+ "@deepseek-ai/cordis": "4.0.6-alpha.1",
104
+ "@deepseek-ai/dsh-client-connection": "0.2.2-alpha.2",
105
+ "@deepseek-ai/dsh-host-webserver": "0.2.2-alpha.2",
106
+ "@deepseek-ai/schemastery": "3.18.6-alpha.1",
106
107
  "@types/node": "^26.2.0",
107
108
  "@types/qrcode": "^1.5.6",
108
109
  "@types/react": "^18.3.31",
109
110
  "tsdown": "^0.22.14",
110
111
  "typescript": "^7.0.2",
111
112
  "vitest": "^4.1.11",
112
- "@deepseek-ai/dsh-scope": "0.2.1-rc.4"
113
+ "@deepseek-ai/dsh-scope": "0.2.2-alpha.2"
113
114
  },
114
115
  "packageManager": "pnpm@10.33.1"
115
116
  }