dsh-lan-guard 0.4.6 → 0.5.0
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 +55 -0
- package/README.md +30 -5
- package/README.zh.md +32 -5
- package/lib/client.js +25 -1
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +15 -0
- package/lib/index.js +74 -3
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.5.0] — 2026-10-06(适配 DSH `0.2.1-alpha.1` + 手机端轮次浮轨 `mobileTurnRail`)
|
|
4
|
+
|
|
5
|
+
### 一、适配 DeepSeek Harness `0.2.1-alpha.1`:**代码零改动**
|
|
6
|
+
|
|
7
|
+
`rc.2 → 0.2.1-alpha.1` 共 266 个提交、4190 个文件。本插件依赖的 6 个面里只有两处有源码改动:
|
|
8
|
+
|
|
9
|
+
| 上游改动 | 结论 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| `packages/client/ui-layout`:frame 网格行 `100%` → `minmax(0,1fr) auto`;新增 `shell.bottom` 槽与 `.bottomRow`;`.handle` 加 `grid-area` | 与本插件无关:插件只占 `settings.section`,不渲染 `shell.bottom`;全仓只有 `experimental/inspector` 用它。实测该行 rect `[0,844,390,0]`,**不占高度** |
|
|
12
|
+
| `packages/client/ui-renderer`:删掉 `invariant.ts`(与它的测试) | 与本插件无关:从未引用 |
|
|
13
|
+
|
|
14
|
+
`host/webserver`、`client/connection`、`client/ui-slots`、`client/ui-settings`、`client/ui-settings-general` 只有 `package.json` / README 改动 —— `register` / `tapIndex` / `requestRejection` / `authenticatedUrl` / `settings.section` 全部原位。
|
|
15
|
+
|
|
16
|
+
**⚠️ 新增一条适配步骤:vendor 连带升级。** 新的宿主包把 vendor 版本写进了自己的 peer 要求
|
|
17
|
+
(`@deepseek-ai/cordis: ~4.0.5-alpha.1`、`@deepseek-ai/schemastery: ~3.18.5-alpha.1`;本次 vendor 同步升到
|
|
18
|
+
`cordis 4.0.5-alpha.1`、`schemastery 3.18.5-alpha.1`)。只升两个宿主包会留下
|
|
19
|
+
`unmet peer @deepseek-ai/cordis@~4.0.5-alpha.1: found 4.0.4`,而且 `^4.0.4` 这类范围**默认不含预发布版**,
|
|
20
|
+
`4.0.5-alpha.1` 落在它外面 —— 所以必须显式钉到 `4.0.5-alpha.1` / `3.18.5-alpha.1`,类型环境才与运行环境一致。
|
|
21
|
+
本插件的 `peerDependencies` **不需要改**:插件门禁只比对 `@deepseek-ai/dsh*`(`evaluatePluginCompatibility` 会
|
|
22
|
+
`continue` 掉所有非 `dsh*` 名字),cordis/schemastery 的 peer 不参与丢弃判定。`dsh.engines.dsh`(`>=0.1.7-rc.1 <0.3.0`)
|
|
23
|
+
与 `peerDependencies` 的上界顺手确认仍包住 `0.2.1-alpha.1`。
|
|
24
|
+
|
|
25
|
+
**验证**:`dsh-host-webserver` / `dsh-client-connection` → `0.2.1-alpha.1`,`cordis` → `4.0.5-alpha.1`,
|
|
26
|
+
`schemastery` → `3.18.5-alpha.1` 后:typecheck 干净、**368** 个用例全绿、`tsdown` 构建与 `npm pack --dry-run` 通过。
|
|
27
|
+
|
|
28
|
+
**窄屏四判据在 `0.2.1-alpha.1` 上复测**(390×844;`3080` 直连与经代理 `3081` 逐项一致):右侧栏展开后可见面积 **100%**
|
|
29
|
+
且视口正中命中面板内、面板 `[data-rightbar-col]` 仍为 `[390,0,0,844]`、滚动层内部被裁层 **0**、
|
|
30
|
+
`?lgdiag=1` 落在 `clipping=0` → `ineffective -> reverted (stock page)`、`html` 上只有 `color-scheme`(补偿**零介入**)。
|
|
31
|
+
0.2.1 新增的 `[data-shell-bottom]` 实测高 0,不影响布局。
|
|
32
|
+
|
|
33
|
+
### 二、新增 `mobileTurnRail`(**默认关**):把 PC 右侧的轮次浮轨搬到手机
|
|
34
|
+
|
|
35
|
+
DSH 在手机上**照样渲染**那根浮轨(`ChatView` 无条件挂载,可跳转、可翻历史、当前轮次跟随、悬停预览),
|
|
36
|
+
藏它的只有官方一条容器查询:`@container (max-width: 900px) { .frame { display: none } }`
|
|
37
|
+
(容器是对话区,390px 手机上只有约 327px 宽)。
|
|
38
|
+
|
|
39
|
+
- **做法**:一段只在 `≤1023px` 生效的样式解除隐藏,并把浮轨从"压着正文"挪到对话区右侧留白(`right:2px`、宽 24px)。
|
|
40
|
+
选择器用属性(`nav[aria-label="轮次导航"|"Turn navigation"]`,CSS Module 类名是哈希的)加一条纯 `display` 的结构化兜底。
|
|
41
|
+
- **不重写**:轮次数据(`ui-chat` 的 `navigation.items()`)是包内私有的,插件拿不到;解开隐藏即可**原样复用**官方组件。
|
|
42
|
+
插件不新建滚动容器、不加按钮、不加自己的监听。
|
|
43
|
+
- **实测**(`0.2.1-alpha.1` / 390×844,把 `0.5.0` 的注入脚本原样打进页面):`display:none` → `block`、
|
|
44
|
+
rect `[357,355,24,52]`、5 格、间距 10px、恰好 1 格 `aria-current`;对话列右缘 351 / 浮轨左缘 357 ⇒ **不压正文**;
|
|
45
|
+
`Global panels` 与 `Session hierarchy` 两个 nav 的 `display` 不变;0 报错。注入脚本在测试里**被执行**(假 DOM + 假时钟),
|
|
46
|
+
覆盖"可见即收工""无浮轨则保留样式等下一个会话""override 失效则整体回退"三条分支。
|
|
47
|
+
- **已知短板(默认关的原因)**:每格 24×10px,格间距在官方 JS 里锁死为 10px(`TURN_SPACING_PX`、
|
|
48
|
+
`measureElement: () => 10`),CSS 撑到 44px 会让相邻格互相覆盖、反而点错。适合"看得见 + 能跳",
|
|
49
|
+
不适合"随手点得准";真机上若确认需要更粗命中区,正解是再叠一层透明触控层(按手指纵向位置选轮次),而不是继续放大 CSS。
|
|
50
|
+
- **自检与回退**:安装后脚本确认浮轨真的可见;若上游把隐藏规则改强,约 **3 秒内整体摘掉注入样式**
|
|
51
|
+
(页面回到与官方逐字节一致)并在 `__DSH_LAN_GUARD__.mobileTurnRail` 记 `"reverted"`(连接体检显示 `轮次导航 ✗ 已回退`)。
|
|
52
|
+
`?lgdiag=1` 会在屏幕底部多一屏 `[lan-guard 轮次导航诊断]`(`#lgtr`,与顶部滚动诊断 `#lgsc` 分开,互不覆盖)。
|
|
53
|
+
|
|
54
|
+
**变更文件**:`src/config.ts`(新开关,默认 false、volatile)、`src/settings/index-tap.ts`(新注入 + 自检/回退 + 注册)、
|
|
55
|
+
`src/store/preferences.ts`、`src/settings/routes.ts`、`src/auth/manager.ts`、`src/client.ts`(「连接与证书」新增开关 +
|
|
56
|
+
连接体检新增一行)、`docs/*`、双语 README。
|
|
57
|
+
|
|
3
58
|
## [0.4.6] — 2026-10-01(兼容 DeepSeek Harness `0.2.0-rc.2`)
|
|
4
59
|
|
|
5
60
|
**结论:仅声明,零代码。** `0.2.0-rc.1 → 0.2.0-rc.2` 之间,本插件用到的宿主接口面没有发生任何变化:
|
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.
|
|
9
|
+
<img src="https://img.shields.io/badge/DSH-0.2.1--alpha.1-4B6BFB" alt="DSH 0.2.1-alpha.1">
|
|
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.
|
|
52
|
+
- Verified DeepSeek Harness: `0.2.1-alpha.1`
|
|
53
53
|
|
|
54
54
|
Install from npm:
|
|
55
55
|
|
|
@@ -82,7 +82,7 @@ Then **restart DSH once** and open **Settings → 局域网访问**. After that
|
|
|
82
82
|
|
|
83
83
|
## Settings
|
|
84
84
|
|
|
85
|
-
Everything lives under **Settings → 局域网访问**, in four tabs. The non-sensitive switches (`enabled`, `listenPort`, `listenHost`, `networkInterface`, `settingsUnlock`, `answerHeartbeat`, `socketWatchdog`, `mobileCompat`, `auth.mode`, `auth.adminPolicy`, `auth.adminProtection`, `auth.allowLoopback`, `auth.requirePairing`, `auth.requireApproval`) are editable directly; `listenPort` and `listenHost` take effect on the next DSH restart; `settingsUnlock`, `socketWatchdog` and `
|
|
85
|
+
Everything lives under **Settings → 局域网访问**, in four tabs. The non-sensitive switches (`enabled`, `listenPort`, `listenHost`, `networkInterface`, `settingsUnlock`, `answerHeartbeat`, `socketWatchdog`, `mobileCompat`, `mobileScrollFix`, `mobileTurnRail`, `auth.mode`, `auth.adminPolicy`, `auth.adminProtection`, `auth.allowLoopback`, `auth.requirePairing`, `auth.requireApproval`) are editable directly; `listenPort` and `listenHost` take effect on the next DSH restart; `settingsUnlock`, `socketWatchdog`, `mobileCompat`, `mobileScrollFix` and `mobileTurnRail` take effect on the next page load while `answerHeartbeat` also applies to connections that are already open; `dataDir` and `tls.*` are startup fields that need a profile-patch edit.
|
|
86
86
|
|
|
87
87
|
| Setting | Default | Effect |
|
|
88
88
|
| --- | --- | --- |
|
|
@@ -121,6 +121,7 @@ The plugin reads its config from its Cordis entry. **Every key has a usable defa
|
|
|
121
121
|
answerHeartbeat: true # proxy answers the WebSocket heartbeat (default on)
|
|
122
122
|
socketWatchdog: true # page-side socket watchdog (default on)
|
|
123
123
|
mobileCompat: true # mobile compatibility shims (default on)
|
|
124
|
+
mobileTurnRail: false # show DSH's own turn rail on narrow screens (default off)
|
|
124
125
|
dataDir: ~/.dsh/profiles/web/data/dsh-lan-guard # optional; this is the derived default
|
|
125
126
|
tls:
|
|
126
127
|
mode: self-signed # 'self-signed' (default) | 'provided' | 'off'
|
|
@@ -147,10 +148,11 @@ The plugin reads its config from its Cordis entry. **Every key has a usable defa
|
|
|
147
148
|
|
|
148
149
|
## Compatibility
|
|
149
150
|
|
|
150
|
-
Current version: plugin **`0.
|
|
151
|
+
Current version: plugin **`0.5.0`**; compatible with DeepSeek Harness **`0.2.1-alpha.1`** (the adaptation itself is declaration-only and touches no code; this release also adds one off-by-default switch, `mobileTurnRail`).
|
|
151
152
|
|
|
152
153
|
| Plugin | Verified DeepSeek Harness | What this version is |
|
|
153
154
|
| --- | --- | --- |
|
|
155
|
+
| **`0.5.0`** | **`0.2.1-alpha.1`**, **`0.2.0-rc.2`**, `0.2.0-rc.1`, `0.1.7-rc.2` | (1) **Adaptation, zero code**: across the 266 commits from `rc.2` to `0.2.1-alpha.1`, of the six surfaces this plugin depends on only `ui-layout` (new `shell.bottom` slot, frame grid rows → `minmax(0,1fr) auto`) and `ui-renderer` (drops the unreferenced `invariant.ts`) changed source, and neither concerns this plugin (nothing renders `shell.bottom` — measured at 0 height). devDependencies raised to `dsh-host-webserver`/`dsh-client-connection` `0.2.1-alpha.1`, **and — because the new host packages peer-require the vendor prereleases — `@deepseek-ai/cordis` to `4.0.5-alpha.1` and `@deepseek-ai/schemastery` to `3.18.5-alpha.1`** (a `^4.0.4` range excludes prereleases); type check + 368 tests green. (2) **New `mobileTurnRail` (off by default)**: un-hides DSH's own turn rail, which the official narrow-screen container query hides. (3) Narrow-screen regression re-run: right sidebar 100% visible, 0 clipped layers, healthy scroll range, zero compensation engagement — identical on 3080 and 3081 |
|
|
154
156
|
| **`0.4.6`** | **`0.2.0-rc.2`**, **`0.2.0-rc.1`**, `0.1.7-rc.2` | Verification release for `0.2.0-rc.2`: zero code changes, compatibility metadata only (`dsh.compatibility.dshReleases` gains `0.2.0-rc.2`), plus both host devDependencies raised to `0.2.0-rc.2` and the type check and full suite re-run. Upstream changed only version numbers between `rc.1` and `rc.2` (the sole source edit is a hooks-ordering fix in `ui-renderer`, unrelated to this plugin), so the plugin runs on `rc.2` unchanged; measurements also confirm the mobile clip compensation now has nothing to act on (clipped layers 1 → **0**, scroll range 336px → **92343px**; every polling round reverts wholesale and writes no inline style) |
|
|
155
157
|
| **`0.4.5`** | **`0.2.0-rc.1`**, `0.1.7-rc.2` | Long transcripts hydrate after the official scroller has already picked up a small scroll range; the mobile clip compensation treated that intermediate state as healthy and stopped, so a late `overflow:hidden` layer was never released (measured on device: 336px of scroll range with 1 clipped layer inside the scroller). It now keeps looking inside the existing polling window and releases the late layer — 336px → 6889px, 1 clipped layer → 0, official "back to bottom" still on screen |
|
|
156
158
|
| **`0.4.4`** | **`0.2.0-rc.1`**, `0.1.7-rc.2` | iOS session scrolling on DSH `0.2.0-rc.1`: an inner `overflow:hidden` layer with a locked height clipped the conversation (measured on device: 21083px of content behind a 336px scroll range), so a session did not open at the newest message and barely dragged. `mobileScrollFix` now grows that inner layer and drops its scroll-container role, restoring 20675px — verified on device with the composer still pinned and the official "back to bottom" button back in place |
|
|
@@ -169,7 +171,7 @@ Current version: plugin **`0.4.6`**; compatible with DeepSeek Harness **`0.2.0-r
|
|
|
169
171
|
| `0.1.1` | `0.1.7-rc.1` | Documentation release: bilingual user READMEs |
|
|
170
172
|
| `0.1.0` | `0.1.7-rc.1` | First release: gated reverse proxy, self-signed HTTPS, device pairing, settings page, QR access |
|
|
171
173
|
|
|
172
|
-
- 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`. 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.
|
|
174
|
+
- 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`. 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.
|
|
173
175
|
- 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).
|
|
174
176
|
- **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).
|
|
175
177
|
- **`0.4.0` verification status**: all three changes carry measurements, not just specs.
|
|
@@ -219,6 +221,19 @@ The official UI is reused with zero modifications and adapts on a phone viewport
|
|
|
219
221
|
|
|
220
222
|
**Self-check**: append `?lgdiag=1` to the page URL for an on-screen report (`narrow / mobile / innerHeight / visualViewport / pageScrolls / clippingLayers / patched`). That report is exactly the data that located this bug.
|
|
221
223
|
|
|
224
|
+
### Bringing the PC turn rail to the phone (`mobileTurnRail`, off by default, added 2026-10-06)
|
|
225
|
+
|
|
226
|
+
**It is already there — it is just hidden.** The rail that floats at the right of a session on the desktop (grey ticks = loaded turns, dim ticks = not loaded yet, black bar = the current turn; hovering previews; tapping an unloaded turn pages the history in first) is **rendered and wired up on a phone too**. `ChatView` mounts it unconditionally; the only thing hiding it is DSH's own container query:
|
|
227
|
+
`@container (max-width: 900px) { .frame { display: none } }` (the container is the chat frame, only about 327px wide on a 390px phone).
|
|
228
|
+
|
|
229
|
+
**What this switch does**: a stylesheet scoped to `≤1023px` un-hides that rail and moves it out of the message column into the chat frame's right gutter (`right:2px`, 24px wide).
|
|
230
|
+
**Why not reimplement it**: the turn data (`ui-chat`'s `navigation.items()`) is package-internal, so a plugin cannot rebuild the rail — but it does not need to. Un-hiding **reuses** the official component: its jump-to-turn, its page-history-in, its active-turn follow and its previews. This plugin adds no scroll container, no button and no listener of its own.
|
|
231
|
+
|
|
232
|
+
**Measured (0.2.1-alpha.1 / 390×844, with the injected script run verbatim)**: `display:none` → `block`, rect `[357,355,24,52]`, 5 marks, 10px pitch, exactly one `aria-current`; the message column ends at x=351 and the rail starts at x=357, so it **no longer covers the text**; the `Global panels` and `Session hierarchy` navs are untouched; zero page errors.
|
|
233
|
+
|
|
234
|
+
**Known limit (hence off by default)**: each mark is only 24×10px, and the pitch is fixed at 10px inside DSH's own JavaScript — CSS-growing them to 44px would make neighbours overlap and mis-tap. It is good for "see where you are and jump", not for "tap precisely with a thumb". If on-device testing shows the hit area is the real problem, the right follow-up is a transparent touch layer (pick a turn from the finger's vertical position), not bigger CSS.
|
|
235
|
+
|
|
236
|
+
**Self-check and revert**: after installing, the script confirms the rail is really visible. If upstream ever strengthens its hide (higher specificity), the script **removes the injected stylesheet wholesale** within about 3 seconds, leaving the page byte-identical to stock, and records `"reverted"` in `__DSH_LAN_GUARD__.mobileTurnRail` (surfaced as `轮次导航 ✗ 已回退` in the connection doctor). `?lgdiag=1` adds a `[lan-guard 轮次导航诊断]` panel at the bottom of the screen.
|
|
222
237
|
|
|
223
238
|
## Security boundary
|
|
224
239
|
|
|
@@ -288,6 +303,16 @@ pnpm run verify # typecheck + tests + build + pack dry-run
|
|
|
288
303
|
|
|
289
304
|
The client half registers into the official additive `settings.section` seat; the host half mounts through the package's own `cordis.patch.yml`.
|
|
290
305
|
|
|
306
|
+
### Docs
|
|
307
|
+
|
|
308
|
+
| Document | What it is for |
|
|
309
|
+
| --- | --- |
|
|
310
|
+
| [docs/dsh-version-adaptation.md](docs/dsh-version-adaptation.md) | **Follow this when DSH ships a new version**: which packages to diff, which interfaces to check, how to declare and release |
|
|
311
|
+
| [docs/mobile-regression.md](docs/mobile-regression.md) | **Narrow-screen geometry regression, runnable on a computer**: two entries, four quantitative criteria (+1 optional turn-rail criterion), token-free direct access to 3080 |
|
|
312
|
+
| [docs/mobile-acceptance.md](docs/mobile-acceptance.md) | On-device acceptance checklist (touch, lock screen / backgrounding, dictation — things a computer cannot verify) |
|
|
313
|
+
| [docs/mobile-debug-runbook.md](docs/mobile-debug-runbook.md) | Runbook for when the phone misbehaves (incl. Web Inspector probes) |
|
|
314
|
+
| [docs/upstream-dsh-0.2.0-rc.1-session-scroll.md](docs/upstream-dsh-0.2.0-rc.1-session-scroll.md) | Draft regression report for upstream (rc.1 transcript clipping) |
|
|
315
|
+
|
|
291
316
|
## Release
|
|
292
317
|
|
|
293
318
|
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:
|
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.
|
|
9
|
+
<img src="https://img.shields.io/badge/DSH-0.2.1--alpha.1-4B6BFB" alt="DSH 0.2.1-alpha.1">
|
|
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.
|
|
52
|
+
- 已验证的 DeepSeek Harness:`0.2.1-alpha.1`
|
|
53
53
|
|
|
54
54
|
从 npm 安装:
|
|
55
55
|
|
|
@@ -82,7 +82,7 @@ dsh plugin --profile web add "link:$(pwd)"
|
|
|
82
82
|
|
|
83
83
|
## 设置
|
|
84
84
|
|
|
85
|
-
设置项集中在 **设置 → 局域网访问** 的四个 tab 里。非敏感开关(`enabled`、`listenPort`、`listenHost`、`networkInterface`、`settingsUnlock`、`answerHeartbeat`、`socketWatchdog`、`mobileCompat`、`auth.mode`、`auth.adminPolicy`、`auth.adminProtection`、`auth.allowLoopback`、`auth.requirePairing`、`auth.requireApproval`)可直接改;`listenPort` 与 `listenHost` 需重启 dsh 生效;`settingsUnlock` / `socketWatchdog` / `mobileCompat` / `mobileScrollFix` 刷新页面即可生效,`answerHeartbeat` 立即对**已打开**的连接生效;`dataDir` 与 `tls.*` 属启动期字段,需在 profile patch 里改。
|
|
85
|
+
设置项集中在 **设置 → 局域网访问** 的四个 tab 里。非敏感开关(`enabled`、`listenPort`、`listenHost`、`networkInterface`、`settingsUnlock`、`answerHeartbeat`、`socketWatchdog`、`mobileCompat`、`mobileScrollFix`、`mobileTurnRail`、`auth.mode`、`auth.adminPolicy`、`auth.adminProtection`、`auth.allowLoopback`、`auth.requirePairing`、`auth.requireApproval`)可直接改;`listenPort` 与 `listenHost` 需重启 dsh 生效;`settingsUnlock` / `socketWatchdog` / `mobileCompat` / `mobileScrollFix` / `mobileTurnRail` 刷新页面即可生效,`answerHeartbeat` 立即对**已打开**的连接生效;`dataDir` 与 `tls.*` 属启动期字段,需在 profile patch 里改。
|
|
86
86
|
|
|
87
87
|
| 设置项 | 默认 | 作用 |
|
|
88
88
|
| --- | --- | --- |
|
|
@@ -100,6 +100,7 @@ dsh plugin --profile web add "link:$(pwd)"
|
|
|
100
100
|
| 断线看门狗 | **开** | 页面补丁:卡在「连接中」超过 8 秒的 WebSocket 会被关掉;从后台回来 10 秒后仍一条都没连上时自动重载一次(每标签最多连续 3 次,冷却 20 秒起)。只对真的连不上的页面生效。刷新页面生效。 |
|
|
101
101
|
| 移动端兼容垫片 | **开** | 页面补丁:补 `AbortSignal.any`/`AbortSignal.timeout`/`Promise.withResolvers`/`Iterator` 与移动端 meta。缺这些 API 时 DSH 客户端在会话流里抛错,界面只会一直显示「载入历史…」且没有报错。现代浏览器上这些分支不生效。刷新页面生效。 |
|
|
102
102
|
| 手机滚动矫正(窄屏) | **开** | 手机端 DSH 外壳在窄屏下把对话列裁在 `overflow:hidden` 的层里(实测 844/1688),整页也不可滚 → 内容可见但**滑不动**。开启后只在「窄屏 + 移动端 + 整页不可滚 + 找到被裁剪溢出的层」四条同时成立时,把那几层改成可触摸滚动;正常页面不碰。页面加 `?lgdiag=1` 可看布局诊断。刷新页面生效。 |
|
|
103
|
+
| 手机端轮次导航 | 关 | 把 PC 右侧那根**轮次浮轨**搬到手机:DSH 在手机上其实照样渲染它(可跳转到某一轮、未加载的会先翻历史再跳、当前轮次跟随),只是被它自己的窄屏容器查询藏了起来(`@container (max-width: 900px)`)。开启后用一段只在 ≤1023px 生效的样式把它放出来,并贴到对话区右边缘(`right:2px`、宽 24px)以免压住正文;官方组件原样复用,插件不重写导航逻辑、不新建滚动容器、不加按钮。**已知短板**:每格 24×10px,格间距在官方 JS 里锁死 10px,"点得准"不如 PC。上游若改了隐藏规则,脚本会在 3 秒内自检失败并**整体摘掉样式**(页面回到官方原样)。刷新页面生效;`?lgdiag=1` 底部会多一屏轮次导航诊断。 |
|
|
103
104
|
| 新设备需要命名确认 | **开** | 新设备首次通过门禁时要自己命名一次,之后才出现在设备列表里。 |
|
|
104
105
|
| 新设备需要管理员批准 | 关 | 开启后,命名完还要你在设备列表点「批准」才能进入。 |
|
|
105
106
|
| TLS | **自签 HTTPS** | 关闭会明文传输门禁密码;非回环 + 关闭 TLS 必须显式设置 `tls.allowInsecureLan: true`,否则**拒绝启动**。 |
|
|
@@ -121,6 +122,7 @@ dsh plugin --profile web add "link:$(pwd)"
|
|
|
121
122
|
answerHeartbeat: true # 代理代答 WebSocket 心跳(默认开;手机挂起时不被宿主回收)
|
|
122
123
|
socketWatchdog: true # 页面断线看门狗(默认开)
|
|
123
124
|
mobileCompat: true # 移动端兼容垫片(默认开)
|
|
125
|
+
mobileTurnRail: false # 手机端显示官方轮次浮轨(默认关,刷新页面生效)
|
|
124
126
|
dataDir: ~/.dsh/profiles/web/data/dsh-lan-guard # 可选;缺省即用这个推导路径
|
|
125
127
|
tls:
|
|
126
128
|
mode: self-signed # 'self-signed'(默认)| 'provided' | 'off'
|
|
@@ -147,10 +149,11 @@ dsh plugin --profile web add "link:$(pwd)"
|
|
|
147
149
|
|
|
148
150
|
## 兼容性
|
|
149
151
|
|
|
150
|
-
当前版本:插件 **`0.
|
|
152
|
+
当前版本:插件 **`0.5.0`**;兼容 DeepSeek Harness **`0.2.1-alpha.1`**(适配仅声明、零代码;本版另加一个默认关闭的 `mobileTurnRail`)。
|
|
151
153
|
|
|
152
154
|
| 插件 | 已验证的 DeepSeek Harness | 这个版本是什么 |
|
|
153
155
|
| --- | --- | --- |
|
|
156
|
+
| **`0.5.0`** | **`0.2.1-alpha.1`**、**`0.2.0-rc.2`**、`0.2.0-rc.1`、`0.1.7-rc.2` | ①**适配(零代码)**:`rc.2 → 0.2.1-alpha.1` 的 266 个提交里,本插件依赖的 6 个面中只有 `ui-layout`(新增 `shell.bottom` 槽、frame 网格行改 `minmax(0,1fr) auto`)与 `ui-renderer`(删掉未被引用的 `invariant.ts`)有源码改动,两者都与本插件无关(`shell.bottom` 无人渲染,实测占位 0 高)。devDependency 升到 `dsh-host-webserver`/`dsh-client-connection` `0.2.1-alpha.1`,**并按新宿主包的 peer 要求连带把 `@deepseek-ai/cordis` 升到 `4.0.5-alpha.1`、`@deepseek-ai/schemastery` 升到 `3.18.5-alpha.1`**(`^4.0.4` 不含预发布版);类型检查 + 368 个用例全绿。②**新增 `mobileTurnRail`(默认关)**:把被官方窄屏容器查询藏起来的轮次浮轨放出来。③窄屏四判据复测:右侧栏可见 100%、被裁层 0、可滚范围正常、补偿零介入,3080 与 3081 逐项一致 |
|
|
154
157
|
| **`0.4.6`** | **`0.2.0-rc.2`**、**`0.2.0-rc.1`**、`0.1.7-rc.2` | 针对 `0.2.0-rc.2` 的验证版:代码零改动,只更新兼容元数据(`dsh.compatibility.dshReleases` 补 `0.2.0-rc.2`),并把两个宿主 devDependency 升到 `0.2.0-rc.2` 后重跑类型检查与全部用例。上游在 `rc.1 → rc.2` 之间只动了版本号(唯一源码改动是 `ui-renderer` 的 hooks 顺序修复,与本插件无关),因此本插件在 `rc.2` 上零改动可用;同时实测确认移动端裁剪补偿在 `rc.2` 上已无作用对象(被裁层 1 → **0**,可滚范围 336px → **92343px**,脚本每轮自检后整体撤销、不写任何内联样式) |
|
|
155
158
|
| **`0.4.5`** | **`0.2.0-rc.1`**、`0.1.7-rc.2` | 长会话的正文是在官方滚动层拿到少量可滚范围**之后**才挂载的,旧逻辑把这个中间态当成「已正常」收工,晚出现的 `overflow:hidden` 层再也没人放行(真机实测:可滚范围 336px、滚动层内部仍有 1 层被裁)。现在改为在既有轮询窗口内继续侦测并放行迟到的裁剪层:可滚范围 336px → 6889px,被裁层 1 → 0,官方「回到底部」仍在屏内 |
|
|
156
159
|
| **`0.4.4`** | **`0.2.0-rc.1`**、`0.1.7-rc.2` | 修好 DSH `0.2.0-rc.1` 上的 iOS 会话滚动:官方滚动层内部有一层 `overflow:hidden` 且高度锁死,把会话内容裁掉(真机实测:21083px 的内容只换来 336px 可滚范围),表现为打开会话不在最新、手指几乎拖不动。`mobileScrollFix` 现在让该层长高并脱离滚动容器身份,可滚范围恢复到 20675px;真机验收同时确认输入框仍吸底、官方「回到底部」按钮回到原位 |
|
|
@@ -169,7 +172,7 @@ dsh plugin --profile web add "link:$(pwd)"
|
|
|
169
172
|
| `0.1.1` | `0.1.7-rc.1` | 文档版:中英双语用户 README |
|
|
170
173
|
| `0.1.0` | `0.1.7-rc.1` | 首个版本:门禁反向代理、自签 HTTPS、设备配对、设置页、扫码访问 |
|
|
171
174
|
|
|
172
|
-
- 声明范围 `>=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`。未列入的 DSH 版本属**未验证**,请自行验证后再使用。上界在 `0.4.3` 从 `<0.2.0` 放宽:profile 加载会拒绝范围不含运行版本的 bundle,而裸的 `<0.2.0` 恰好排除 `0.2.0` 正式版。
|
|
175
|
+
- 声明范围 `>=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`。未列入的 DSH 版本属**未验证**,请自行验证后再使用。上界在 `0.4.3` 从 `<0.2.0` 放宽:profile 加载会拒绝范围不含运行版本的 bundle,而裸的 `<0.2.0` 恰好排除 `0.2.0` 正式版。
|
|
173
176
|
- 本插件用到的宿主/客户端接口:`webServer.register` / `webServer.tapIndex`(indexTaps)、`connection.requestRejection`、`connection.authenticatedUrl`、追加型 `settings.section` seat、`@deepseek-ai/schemastery`,以及 `profileContext`(用于推导默认数据目录)。
|
|
174
177
|
- **破坏性默认值变更(`0.3.2` 起)**:`listenHost` 默认由 `127.0.0.1` 改为 `0.0.0.0`,装完重启一次即可用;`0.3.1` 及更早默认仅回环。门禁与自签 TLS 的默认值未变(未设密码仍拒绝所有设备)。详见 [CHANGELOG](CHANGELOG.md)。
|
|
175
178
|
- **`0.4.0` 的验证状态**:三处改动都做了实测,不只跑用例。
|
|
@@ -219,6 +222,20 @@ dsh plugin --profile web add "link:$(pwd)"
|
|
|
219
222
|
|
|
220
223
|
**自检**:在页面地址后加 `?lgdiag=1`,顶部会出现一屏诊断(`narrow / mobile / innerHeight / visualViewport / pageScrolls / clippingLayers / 是否已修`)。这一屏就是本次定位所用的数据,以后复现同类问题不必连 Mac 调试。
|
|
221
224
|
|
|
225
|
+
### 手机上把 PC 右侧的轮次浮轨搬过来(`mobileTurnRail`,默认关,2026-10-06 新增)
|
|
226
|
+
|
|
227
|
+
**它本来就在,只是被藏了。** PC 上会话右侧那根浮轨(灰刻度=已加载轮次、暗刻度=还没加载、黑长条=当前轮次;悬停出预览;点未加载的会先翻历史再跳)在手机上**照样渲染、照样接线**——`ChatView` 无条件挂载它,隐藏它的只有官方自己的一条容器查询:
|
|
228
|
+
`@container (max-width: 900px) { .frame { display: none } }`(容器是对话区,390px 手机上只有约 327px 宽)。
|
|
229
|
+
|
|
230
|
+
**做法**:开启后用一段只在 `≤1023px` 生效的样式把它放出来,并把它从"压着正文"挪到对话区右侧留白里(`right:2px`、宽 24px)。
|
|
231
|
+
**为什么不是重写一个**:轮次数据(`ui-chat` 的 `navigation.items()`)是包内私有的,插件拿不到;而解开隐藏就能**原样复用**官方组件的跳转、翻历史、当前轮次跟随与预览。所以本插件不新建滚动容器、不加自己的按钮、不监听自己的事件。
|
|
232
|
+
|
|
233
|
+
**实测(0.2.1-alpha.1 / 390×844,把注入脚本原样打进页面)**:`display:none` → `block`、rect `[357,355,24,52]`、5 格、间距 10px、恰好 1 格 `aria-current`;对话列右缘 351、浮轨左缘 357 ⇒ **不压正文**;`Global panels` / `Session hierarchy` 两个 nav 完全不受影响;0 报错。
|
|
234
|
+
|
|
235
|
+
**已知短板(所以默认关)**:每格只有 24×10px,而格间距在官方 JS 里锁死为 10px——用 CSS 撑到 44px 会让相邻格互相覆盖,反而点错。它适合"看得见 + 能跳",不适合"随手点得准"。若真机上确认需要更粗的命中区,正确做法是再叠一层透明触控层(按手指纵向位置选轮次),而不是继续放大 CSS。
|
|
236
|
+
|
|
237
|
+
**自检与回退**:脚本会在安装后自己确认浮轨真的可见;若上游把隐藏规则改强(更高优先级),它会在约 3 秒内**把注入的样式整体摘掉**,页面回到与官方逐字节一致的状态,并在 `__DSH_LAN_GUARD__.mobileTurnRail` 记 `"reverted"`(连接体检里显示为 `轮次导航 ✗ 已回退`)。`?lgdiag=1` 会在屏幕底部多一屏 `[lan-guard 轮次导航诊断]`。
|
|
238
|
+
|
|
222
239
|
## 安全边界
|
|
223
240
|
|
|
224
241
|
- DSH 自身的监听地址不被改动;本插件从不修改 DSH 配置、会话数据或官方 UI。
|
|
@@ -287,6 +304,16 @@ pnpm run verify # 类型检查 + 测试 + 构建 + pack dry-run
|
|
|
287
304
|
|
|
288
305
|
客户端半边注册到官方追加型 seat `settings.section`,宿主半边通过包内 `cordis.patch.yml` 挂载。
|
|
289
306
|
|
|
307
|
+
### 文档索引
|
|
308
|
+
|
|
309
|
+
| 文档 | 用途 |
|
|
310
|
+
| --- | --- |
|
|
311
|
+
| [docs/dsh-version-adaptation.md](docs/dsh-version-adaptation.md) | **DSH 升级后照着走**:diff 哪些包、核对哪些接口、怎么落声明与发版 |
|
|
312
|
+
| [docs/mobile-regression.md](docs/mobile-regression.md) | **电脑上就能跑的窄屏几何回归**:两个入口、四个量化判据(+1 条可选的轮次浮轨判据)、免 token 直连 3080 的方法 |
|
|
313
|
+
| [docs/mobile-acceptance.md](docs/mobile-acceptance.md) | 真机验收清单(触摸、锁屏/切后台、语音这些本地验不了的) |
|
|
314
|
+
| [docs/mobile-debug-runbook.md](docs/mobile-debug-runbook.md) | 手机端出问题时的排障手册(含 Web Inspector 探针) |
|
|
315
|
+
| [docs/upstream-dsh-0.2.0-rc.1-session-scroll.md](docs/upstream-dsh-0.2.0-rc.1-session-scroll.md) | 投递上游的回归报告底稿(rc.1 会话裁剪) |
|
|
316
|
+
|
|
290
317
|
## 发版
|
|
291
318
|
|
|
292
319
|
发版由 tag 驱动。更新 `package.json`、把对应 CHANGELOG 段落移出 `Unreleased`、编写带中英双锚点的 `release-notes/v<版本>.md` 后,推送发版提交与 tag:
|
package/lib/client.js
CHANGED
|
@@ -1288,7 +1288,7 @@ window.__ModuleLoader__.load({
|
|
|
1288
1288
|
const lines = [];
|
|
1289
1289
|
try {
|
|
1290
1290
|
const patches = globalThis.__DSH_LAN_GUARD__ ?? {};
|
|
1291
|
-
lines.push(`页面补丁:官方设置页解锁 ${patches.settingsUnlock === true ? "✓" : "—"} · 移动端兼容垫片 ${patches.mobileCompat === true ? "✓" : "—"} · 断线看门狗 ${patches.socketWatchdog === true ? "✓" : "—"}`);
|
|
1291
|
+
lines.push(`页面补丁:官方设置页解锁 ${patches.settingsUnlock === true ? "✓" : "—"} · 移动端兼容垫片 ${patches.mobileCompat === true ? "✓" : "—"} · 断线看门狗 ${patches.socketWatchdog === true ? "✓" : "—"} · 轮次导航 ${patches.mobileTurnRail === true ? "✓" : patches.mobileTurnRail === "reverted" ? "✗ 已回退" : "—"}`);
|
|
1292
1292
|
const missing = [];
|
|
1293
1293
|
if (typeof AbortSignal.any !== "function") missing.push("AbortSignal.any");
|
|
1294
1294
|
if (typeof AbortSignal.timeout !== "function") missing.push("AbortSignal.timeout");
|
|
@@ -1783,6 +1783,30 @@ window.__ModuleLoader__.load({
|
|
|
1783
1783
|
className: "lg-hint",
|
|
1784
1784
|
key: "h"
|
|
1785
1785
|
}, "手机上 DSH 自己的外壳会把对话列压在固定的输入框/目标条/快捷回复浮层后面,导致内容可见但**滑不动**(同一视口在桌面 Chrome 里能滚,属 iOS 布局/触摸差异)。开启后,页面会在「整页不可滚 + 发现被裁剪的层」时把那几层改成可触摸滚动;能正常滚动的页面一律不碰。打开页面时加 ?lgdiag=1 会显示一屏布局诊断。")]),
|
|
1786
|
+
(0, react.createElement)("div", {
|
|
1787
|
+
className: "lg-field",
|
|
1788
|
+
key: "turnrail"
|
|
1789
|
+
}, [
|
|
1790
|
+
(0, react.createElement)("div", {
|
|
1791
|
+
className: "lg-toggle",
|
|
1792
|
+
key: "t"
|
|
1793
|
+
}, [(0, react.createElement)("span", { key: "l" }, "手机端轮次导航(PC 右侧那根浮轨)"), (0, react.createElement)("button", {
|
|
1794
|
+
key: "s",
|
|
1795
|
+
type: "button",
|
|
1796
|
+
className: "lg-switch",
|
|
1797
|
+
"aria-checked": preferences.mobileTurnRail,
|
|
1798
|
+
disabled: busy,
|
|
1799
|
+
onClick: () => void write({ preferences: { mobileTurnRail: !preferences.mobileTurnRail } })
|
|
1800
|
+
}, (0, react.createElement)("span", null))]),
|
|
1801
|
+
(0, react.createElement)("p", {
|
|
1802
|
+
className: "lg-hint",
|
|
1803
|
+
key: "h"
|
|
1804
|
+
}, "DSH 在手机上其实照样渲染右侧那根轮次浮轨(可跳转、可加载更早轮次、当前轮次跟随),只是被它自己的「窄屏容器查询」藏了起来。开启后本插件用一段只在 ≤1023px 生效的样式把它放出来:贴到对话区右边缘、不再压住正文,官方组件原样复用,不重写、不新建滚动容器。"),
|
|
1805
|
+
(0, react.createElement)("p", {
|
|
1806
|
+
className: "lg-hint",
|
|
1807
|
+
key: "h2"
|
|
1808
|
+
}, "⚠️ 已知短板(默认关的原因):每格只有 24×10px,而格间距在官方 JS 里锁死为 10px,用 CSS 撑到 44px 会让相邻格互相覆盖——「点得准」仍不如 PC。建议先开起来看效果,真需要再叠一层透明触控层(拖动选轮次)。打开页面时加 ?lgdiag=1 会多一屏轮次导航诊断。")
|
|
1809
|
+
]),
|
|
1786
1810
|
(0, react.createElement)("div", {
|
|
1787
1811
|
className: "lg-row",
|
|
1788
1812
|
key: "doctor"
|