@alexpeng/dsh-custom-plugin 0.9.2 → 0.10.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.
Files changed (39) hide show
  1. package/CHANGELOG.md +1687 -850
  2. package/NOTICE +71 -0
  3. package/README.i18n.yaml +2 -2
  4. package/README.md +344 -335
  5. package/README.zh.md +309 -302
  6. package/lib/client.js +9416 -2002
  7. package/lib/client.js.map +1 -1
  8. package/lib/index.js +233 -99
  9. package/lib/types/balance.d.ts +44 -0
  10. package/lib/types/client/api.d.ts +13 -8
  11. package/lib/types/client/bg-ascii.d.ts +397 -0
  12. package/lib/types/client/bg-field.d.ts +60 -0
  13. package/lib/types/client/bg-focus.d.ts +63 -0
  14. package/lib/types/client/bg-layer.d.ts +152 -0
  15. package/lib/types/client/bg-ocean.d.ts +31 -0
  16. package/lib/types/client/bg-params.d.ts +142 -0
  17. package/lib/types/client/bg-pointer.d.ts +107 -0
  18. package/lib/types/client/bg-shader.d.ts +329 -0
  19. package/lib/types/client/bg-wake.d.ts +57 -0
  20. package/lib/types/client/custom.d.ts +4 -1
  21. package/lib/types/client/index.d.ts +1 -1
  22. package/lib/types/client/palette.d.ts +100 -0
  23. package/lib/types/client/panel-bounds.d.ts +65 -0
  24. package/lib/types/client/styles.d.ts +9 -4
  25. package/lib/types/client/ui/anchor.d.ts +55 -0
  26. package/lib/types/client/ui/appearance-controls.d.ts +24 -0
  27. package/lib/types/client/ui/command-model.d.ts +28 -0
  28. package/lib/types/client/ui/folders-model.d.ts +31 -0
  29. package/lib/types/client/ui/index-bridge.d.ts +6 -0
  30. package/lib/types/client/ui/overlays.d.ts +66 -0
  31. package/lib/types/client/ui/primitives.d.ts +93 -0
  32. package/lib/types/client/ui/prompt-model.d.ts +37 -0
  33. package/lib/types/host-service.d.ts +68 -15
  34. package/lib/types/pricing.d.ts +8 -4
  35. package/lib/types/protocol.d.ts +48 -2
  36. package/lib/types/usage.d.ts +8 -4
  37. package/locale/en.json +1 -1
  38. package/locale/zh.json +1 -1
  39. package/package.json +13 -12
package/CHANGELOG.md CHANGED
@@ -1,850 +1,1687 @@
1
- # Changelog
2
-
3
- All notable changes to this project are documented here. The format loosely
4
- follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions
5
- follow [Semantic Versioning](https://semver.org/).
6
-
7
- ## 0.9.2 — 2026-10-26
8
-
9
- ### Changed
10
-
11
- - **无障碍与电池**:天气特效尊重 `prefers-reduced-motion`(减少动态时不启动
12
- 动画帧),装饰画布加 `aria-hidden`;余额 60 秒轮询在页面隐藏时暂停、回到前台
13
- 立即刷新;6 个浮层补齐 `role="dialog"` / `aria-modal`、焦点进入、Tab 陷阱、
14
- Escape 关闭与关闭后的焦点恢复;余额入口改为可键盘操作的 `role="button"` 并带
15
- `aria-expanded` / `aria-haspopup`,关键图标按钮补 `aria-label`。
16
- - **顶栏重渲染**:`HeaderBalance` 从整店订阅改为只选余额、今日用量行与面板开关,
17
- 并对今日次数/费用做 `useMemo`;流式回合的 store 写入不再重渲染顶栏或重算台账。
18
- - **常驻组件订阅收窄**:`MermaidInPlace`、`QuoteDock`、`QuoteButton`、`Toasts`
19
- 同样改为 `useSSelector`;它们大多时候渲染 null 或很小,不再被流式/用量写入唤醒。
20
- 剩余 19 个 `useS()` 多为打开时才挂载的面板,待逐项 profile。
21
-
22
- ### Tests
23
-
24
- - Mermaid 渲染从 `src/client/custom.tsx` 抽到独立的 `src/client/mermaid-render.ts`;
25
- `pnpm smoke` 现在用真实 Mermaid 引擎在无头 Edge 中覆盖失败路径(无效代码不残留
26
- `body > div#dvx-mmd-*`、有效图渲染、旧错误卡清理、引擎缺失干净失败),并新增
27
- `tests/mermaid-render.spec.ts` 9 个单测。反证:撤掉 `suppressErrorRendering` 与
28
- 清理后 smoke 恰好红 2 项,还原后全绿。
29
- - 扫描逻辑抽到 `src/client/mermaid-scan.ts`,smoke 增加 5 项 wrapper / 失败回退 /
30
- 切换 / 主题翻转 / restore 断言;新增 `pnpm bench:mermaid` 合成长回合基准。
31
- 结论:1000 块时 warm p95 ≈2.8 ms,扫描收窄收益可忽略;真实 Mermaid ≈10 ms/图,
32
- 懒渲染只在单回合大量图时有意义,暂不引入。
33
-
34
- ### Verified
35
-
36
- - 0.9.2 tarball 装进隔离的 dsh 0.2.1-rc.3 profile(无兼容豁免)并冷启动;活体探针
37
- 全部通过,1 项因无会话跳过(时间线/导出/搜索,由单测覆盖)。
38
- - `pnpm check:readme`、`pnpm typecheck`、`pnpm test`(214)、`pnpm build`、`pnpm smoke`
39
- 全绿。
40
-
41
- ## 0.9.1 — 2026-10-25
42
-
43
- ### Fixed
44
-
45
- - **Mermaid 解析失败不再在页面底部留下错误图**:Mermaid 默认会在
46
- `render()` 抛错前把一个全宽炸弹图追加到 `<body>`(`div#dvx-mmd-*`)并留在
47
- 那里。现在 `mermaid.initialize` 打开 `suppressErrorRendering`,并在
48
- `finally` 中清理 `#id` / `#d<id>` / `#i<id>` 三个临时节点;扫描时也会移除
49
- 旧版本遗留的同名节点。失败代码块按既有设计回退为原始代码,不再出现
50
- “Syntax error in text / mermaid version …” 卡片。
51
-
52
- ### Verified
53
-
54
- - 无头 Edge 复现旧行为(`body > div#dvx-mmd-*` 残留 + “Syntax error in text”),
55
- 并验证 `suppressErrorRendering` 与 `finally` 清理两条路径都能清除;合法
56
- flowchart 仍正常渲染。
57
- - `pnpm check:readme`、`pnpm typecheck`、`pnpm test`(205)、`pnpm build`、
58
- `pnpm smoke` 全绿。
59
-
60
- ## 0.9.0 — 2026-10-25
61
-
62
- 兼容策略改为开放式下限:宿主不再因为 dsh 更新而把插件判为“不支持”。
63
-
64
- ### Changed
65
-
66
- - **兼容范围改为 `>=0.1.7-rc.2`(无上界)**:`engines.dsh` 与
67
- `@deepseek-ai/dsh-tools` peer 同步放宽。dsh 0.2.1-alpha.4+ 优先读
68
- `engines.dsh`,旧宿主读 peer;两者都放行所有高于下限的版本,因此未来任何
69
- dsh 发版(包括 0.2.1-rc.3、0.2.1 正式版、0.3、1.0)都不必先等插件发版才能
70
- 加载。实测过的版本改为证据记录(README 兼容表 / 本文件),不再是闸门。宿主
71
- 的兼容门只有“放行/拒绝”两态、没有“仅警告”,这是不再把未实测版本挡在门外
72
- 的唯一实现方式。
73
- - **构建与测试队列切到 dsh 0.2.1-rc.3**:九个 `@deepseek-ai/dsh-*`
74
- devDependency 从 rc.2 升到 rc.3,锁文件同步。`pnpm smoke` 的兼容断言改为
75
- “下限必须拒绝 0.1.7-rc.1、无上界必须放行 99.0.0、`engines.dsh` 与 peer
76
- 判定一致”,`tests/manifest.spec.ts` 的放行/拒绝清单同步改写。
77
- - **新增定时兼容 canary**:`scripts/compat-canary.mjs` +
78
- `.github/workflows/compat-canary.yml`,每天取 npm `latest`/`next` 中较高的
79
- dsh,在临时 `DSH_HOME` 里安装**已发布**插件、冷启动并跑
80
- `scripts/live-dsh-check.sh`;失败时自动开 issue。可用 `pnpm canary` 或
81
- `node scripts/compat-canary.mjs <版本> --plugin <tgz>` 本地跑。
82
-
83
- ### Verified
84
-
85
- - 0.9.0 产物在隔离的 dsh 0.2.1-rc.3 profile 中安装(无兼容豁免)并冷启动:
86
- boot 图 71 行、五个 inject 目标齐全、客户端 bundle 200,371 字节、Mermaid
87
- 本地引擎 3,572,661 字节、state / usage / backup 路由、UTF-8 往返与三种信任
88
- 围栏形状全部通过;活体探针 16 通过 / 1 跳过(无会话)。
89
- - `node scripts/compat-canary.mjs 0.2.1-rc.3 --plugin <0.9.0 tgz>` 端到端通过。
90
- - `pnpm check:readme`、`pnpm typecheck`、`pnpm test`(205 tests)、`pnpm build`、
91
- `pnpm smoke` 全绿。
92
-
93
- ## 0.8.0 — 2026-10-17
94
-
95
- dsh 0.2.1-rc.2 兼容版:`engines.dsh` 取代 peer 范围成为 0.2.1-alpha.4+ 的首要兼容门,
96
- 旧范围把 0.2.1 全线拒之门外;本版补上新运行时线,并按 0.2.1 的客户端 seed 表与输入
97
- 动作签名完成适配。
98
-
99
- ### Changed
100
-
101
- - **兼容范围新增 dsh 0.2.1-rc.2**:`engines.dsh` 与
102
- `@deepseek-ai/dsh-tools` peer 范围同为
103
- `>=0.1.7-rc.2 <0.2.0-0 || >=0.2.0-rc.2 <0.2.0-rc.3 || >=0.2.1-rc.2 <0.2.1-rc.3`。
104
- 旧范围止于 `<0.2.0-rc.3`,而 dsh 0.2.1-alpha.4 起插件管理器优先读
105
- `engines.dsh`,因此桌面版升到 0.2.1-rc.2 后会把 0.7.1 判为不兼容并拒绝启用——
106
- 这正是本次报错的根因。范围仍只收实际构建并实测过的预发布版:0.2.1-alpha.x、
107
- 0.2.1-rc.3+ 与 0.2.1 正式版不在内。
108
- - **构建与测试队列整体切到 0.2.1-rc.2**:九个 `@deepseek-ai/dsh-*`
109
- devDependency 与 `@deepseek-ai/cordis` 4.0.5 同步升级;`pnpm smoke` 新增
110
- 「队列必须恰好一个版本」检查,`tests/manifest.spec.ts` 固化范围必须同时放行
111
- 三条已验证运行时线、拒绝未验证版本。
112
- - **客户端平台模块表对齐 0.2.1 shell**:`PLATFORM_MODULES` 补入 seed 表新增的
113
- `zod` 与 `@tanstack/react-virtual`;现有五个 inject 目标在 0.2.1 boot 图中
114
- 全部存在。
115
- - **输入动作类型对齐**:`setDraft(text)` 在 0.2.1 只接收文本(旧声明的可选
116
- `editRange` 参数从未使用),本地最小接口同步收窄。
117
- - **兼容判定工具对齐新语义**:`scripts/desktop-runtime.mjs` 改为优先用
118
- `engines.dsh` 判定(与 dsh 0.2.1-alpha.4+ 一致),回退 peer 范围时才用 peer,
119
- 两者判定不一致会单独告警;`scripts/smoke.mjs` 的说明与探测版本表同步更新。
120
- - **对 0.2.0-rc.2 → 0.2.1-rc.2 的插件可感 API 做逐项核对**:本插件使用的
121
- `WebRoute`、`defineTool`、`AttachmentStore`、`SessionQueryEngine`、
122
- `SessionLogSnapshot`、`SessionEvent`、`theme.overrideTokens`、slots 注册与
123
- 五个 inject 目标均无破坏性变化;0.2.1 的变更集中在新功能(session plugin
124
- record、字体设置、PTC 模式收窄、远程 Web/TLS、新 model-label 槽位),不影响
125
- 本插件现有路径。
126
-
127
- ### Optimized
128
-
129
- - **读档形状门**:`mergeState` 现在对 folders 走 `normalizeFolders`、对 stars 走
130
- `normalizeStars`、对 usage 走新的 `normalizeUsageMap`。此前一份 JSON 合法但
131
- 文件夹深度超标(或 stars 形状错误)的文档会被直接采纳,随后每次保存的
132
- `JSON.stringify` 都抛 `RangeError`,插件永久无法保存;现在这类文档在加载时按
133
- 「损坏」处理:原名改名 `.corrupt-<pid>` 保留现场,采用默认值并继续可写。
134
- usage 的畸形日期/模型行/字符串计数会被丢弃或归零,避免后续 fold 把字符串拼进
135
- 计数器。
136
- - **保存回滚不再深拷贝整份台账**:`applyEdit` 与备份导入只捕获被替换的 section
137
- 引用做回滚点,不再 `JSON.parse(JSON.stringify(state))`。用量台账保留 90 天,
138
- 此前每次切换开关的保存都要复制整份台账;现在回滚成本与编辑量成正比。
139
- - **Mermaid 引擎一致性**:CDN 兜底不再硬编码 `mermaid@11.6.0`,改为读取实际安装
140
- 的 `mermaid/package.json` 版本;本地引擎改用异步读取(3.5 MB 同步读会卡住宿主
141
- 事件循环),字节数按 UTF-8 计。引擎脚本路由加 `ETag` + `Cache-Control:
142
- no-cache`:页面重载命中 304,不再每次重传 3.5 MB。
143
- - **浏览器轮询与渲染热点**:流式期间的 timeline 轮询在页面隐藏时暂停、单次请求
144
- 在飞时不叠加;`reuseTimelineItems` 复用未变化的 turn 对象,只有真正变化的行
145
- 触发渲染。`TurnTailEntry`(每条消息一个)和 `FxCanvas` 改用
146
- `useSSelector` 选择器订阅,余额/用量/toast 等无关写入不再重渲染最多 400 个
147
- turn-tail。诊断节流表加上限,避免跨会话无限增长。
148
- - **卸载回收补全**:anti-scroll 的滚动行为与 `data-vx-anti` 属性、就地 Mermaid
149
- 包装节点、配置加载重试定时器、问候 toast 定时器都会在停用/卸载时还原;此前
150
- 这些页级副作用会留在 GUI 中。
151
- - **路由健壮性**:`POST /state` 上限从 256 KiB 提到 1 MiB(提示词库较大的用户
152
- 此前会在保存时收到 413),并拒绝非对象 JSON;balance / usage-scan / mermaid
153
- 的意外异常统一转成 JSON 错误包,而不是让 handler reject。
154
- - **测试**:新增 `tests/timeline-diff.spec.ts`、读档形状隔离用例、usage 归一化
155
- 用例、Mermaid 版本/UTF-8 计数用例、ETag 304 用例;总数 190 → 204。
156
-
157
- ### Verified
158
-
159
- - 用桌面版自带 CLI 在隔离 profile 中安装本 tarball:**无兼容豁免、无
160
- `incompatible` 提示**(这正是用户此前遇到的拒绝路径)。
161
- - 在同一 0.2.1-rc.2 运行时上冷启动真实 Host 并跑 `scripts/live-dsh-check.sh`:
162
- boot 图 70 个模块行、五个 inject 目标齐全、插件 bundle 已服务(约 200 KB)、
163
- Mermaid 本地引擎 3.57 MB、state/usage/backup 路由、UTF-8 往返、桌面转发形状与
164
- 异源/跨站围栏全部通过;时间线/导出/搜索因临时 profile 无会话而跳过(该路径由
165
- 单测覆盖,相关 API 在 0.2.1 仅新增可选 `formatStatus` 字段)。
166
- - Mermaid 脚本路由实测:首次 200 / 3,572,661 字节,带 `If-None-Match` 的第二次
167
- 请求 304 / 0 字节。
168
- - `pnpm check:readme`、`pnpm typecheck`、`pnpm test`(204 tests)、`pnpm build`、
169
- `pnpm smoke` 全绿。
170
-
171
- ## 0.7.1 — 2026-10-03
172
-
173
- 数据安全与健壮性加固版:封住两条不可恢复配置丢失路径与一条跨宿主丢更新路径,装上浏览器提交的形状门,补齐卸载回收与凭据状态缓存;测试从 143 增至 185。
174
-
175
- ### Fixed
176
-
177
- - **宿主读档失败不再静默用默认值覆盖状态文件**:此前 `loadStateFile` 把
178
- `ENOENT`、瞬态占用(Windows 杀毒扫描 / 同步盘 / 与桌面宿主的 rename 竞争)
179
- 与 JSON 损坏一律折叠成「无文件」,随后启动流程立即把默认文档写入真实路径——
180
- folders / prompts / stars / 用量台账被无条件清空且不留副本。现在:瞬态错误按
181
- 1.5s/3s/6s 重试(与客户端重试梯子同节奏);重试耗尽或 JSON 损坏时先以
182
- pid 后缀名将原文件改名隔离(`.corrupt-<pid>`,两个宿主共享一个
183
- `$DSH_HOME` 也不会互相抢占恢复名)再采用默认值;仅当原文件既读不出又移不走
184
- 时 loader 才 reject,宿主转入只读模式(抑制一切保存)而不是销毁可能完好的
185
- 文档。启动后的首次规范化保存失败也不再误入加载失败分支。
186
- - **客户端重试耗尽后不再把出厂空配置写回宿主**:桌面壳页面可能先于宿主路由
187
- 就绪,客户端重试梯子(约 10.5 秒)耗尽后停在出厂默认值;此后用户切换任何
188
- 开关都会触发一次全量 POST,把已存 folders / prompts / stars 整组替换为空。
189
- 现在 `saveCfg` 以「曾成功读取过状态」为门槛:未加载成功一律改为重新读取并
190
- 提示「配置尚未读取完成,已重新加载,请重试」。
191
- - **插件停用/重声明后全局副作用全部回收**:卸载清理器此前只注销插槽并移除动
192
- 态样式,`theme.overrideTokens` 的设计令牌覆盖(停用后 GUI 配色仍被插件锁
193
- 死)、`<html>` 上的 `vx-liquid/vx-dark/vx-light` 类、液态玻璃 SVG 滤镜节点、
194
- 待触发的余额重试定时器(会继续外呼最多 3 次)全部残留。现在清理器逐一还原。
195
- - **共享 `$DSH_HOME` 的两个宿主不再互相清空对方的写入**(Web 与 Desktop 各自持有整份内存文档、整文件回写,最后写者赢):现在每次保存前先用 stat 身份(mtime+size)对比本进程上次读/写看到的文件,发现外部变更就回读并做三方合并——本进程未动过的配置段(cfg/folders/prompts/stars)采纳外部版本,动过的保留本地版本,用量台账按计数器做 `对方 + 本地 − 共同基线` 的精确并集(两个宿主的会话流来自不同 profile、天然不重叠)。启动加载也改用同一文件句柄做 fstat+read,基线与合并字节描述同一份文档。
196
- - **`POST /state` 形状门**:浏览器提交的 folders / stars 此前未经校验直接落
197
- state——畸形深层嵌套可让此后每次保存的 `JSON.stringify` 抛 `RangeError`,
198
- 保存从此持续失败需手改状态文件。现在 `normalizeFolders`(唯一 id、纯字符
199
- 串 id 列表、深度 ≤32、节点 ≤2000)与 `normalizeStars`(安全对象键、纯数字
200
- 序号、`true` 值、总量 ≤10000)把关,违规整笔拒绝(400「文件夹数据无效」/
201
- 「星标数据无效」),绝不截断——客户端持有全量文档,静默丢段等于丢数据。
202
- - **缓冲用量回放不再把宿主已学到的模型覆盖为 `unknown`**:启动缓冲的
203
- `session/event` 用量回放时,`null` 模型改为传 `undefined`,让宿主回退到自己
204
- 在加载期间学到的 session 模型映射。
205
- - **用量重扫不再白付全量代价后必然失败**:流式对话期间触发重扫时,revision 检查从「全部 I/O 完成后查一次」改为每个会话读取前检查,已注定作废的扫描会立即停止读取剩余会话日志。
206
- - **Mermaid CDN 兜底不再被 200-HTML 投毒**:绑架门户/镜像异常返回的 200 HTML 页此前会被缓存为「引擎」且宿主生命周期内不再重取;现在要求载荷是 ≥1000 字节、不以 `<` 开头的脚本形态,否则记为该镜像失败并继续尝试下一个。
207
- - **客户端脚本加载挂起不再无限等待**:`ensureMermaid` 的 120ms 轮询等待没有出口,网络黑洞(onload/onerror 都不触发)会让每个流式新代码块再挂一个永久等待者、「预加载」按钮永远「加载中」;现在 30 秒看门狗翻到 failed 并移除 script 标签,重试可重新插入。
208
- - **GUI 主题与 OS 配色不一致时玻璃/面板不再用错颜色**:深色 GUI + 浅色 OS 下余额悬浮卡、面板、模态保持浅色磨砂(反之亦然)——这些规则此前只跟 `prefers-color-scheme` 走;现在按客户端镜像到 `<html>` 的 `vx-dark/vx-light` 类选择,媒体查询降级为类就绪前的启动兜底(液态玻璃规则本就按此模式工作,磨砂路径对齐)。
209
-
210
- ### Changed
211
-
212
- - **凭据状态短 TTL 缓存**:`credentialStatus` 每次 `/state` GET 与保存响应都
213
- 打一次 OS keychain + 读凭据文件;现在对「来源判定」结果缓存 5 秒(从不缓
214
- 存键值本身),`applyEdit` 与遗留迁移立即失效,保存响应永远如实反映刚应用
215
- 的编辑。
216
- - **长会话交互开销**:`TurnTailEntry`(每条消息一个)对轮次数据的查找从每次 store 变更 O(轮数) 线性扫描改为 fetch 时构建的 `seq → item` Map O(1) 查表;选中拖拽时 `selectionchange` 以 60Hz 触发 `setS`,现在文本与坐标未变(<1px)时跳过发布;用量面板的 90 天汇总/按天/按模型统计改为 `useMemo`(预算输入每次击键不再重算全部统计);面板拖拽改为 mousemove 直写 DOM、mouseup 才落 store;预算状态判定复用 `productivity.budgetState`(此前为生产死代码,客户端内联了一份会漂移的副本)。
217
- - **死代码清理**:六个无引用 ICONS 条目(clock/fork/arrowUp/arrowDown/moon/
218
- sun)、两条无匹配死规则(`.vx-swatch:disabled`、`.vx-textarea`)移除;
219
- `hexToRgb` 收敛到 palette.ts 单一导出实现。
220
- - **smoke 收紧**:未构建即跑 smoke 给出明确「先 pnpm build」报错而非裸 ENOENT 堆栈;新增 bundle `require()` 字面量 ⊆ `PLATFORM_MODULES` 交叉校验(防未声明外部化导致的静默消失类断裂);`lib/client.js` 落后于 `src/client` 或 `tsdown.config.ts` 时判红(防对过期产物盖章);Windows 下 PATH 探测补 `.exe` 后缀。
221
- - **typecheck 收编构建配置**:`tsdown.config.ts`、`vitest.config.ts` 进入 `pnpm typecheck` 范围。
222
- - **CI 补浏览器段**:`setup-chrome` 后跑全量 `pnpm smoke`——客户端注册握手
223
- (bundle 必须注册 {id, factory} 且不物化、无页面错误)首次进入 CI,此前只
224
- 在本机跑。
225
-
226
- ### Tests
227
-
228
- 测试从 143 增至 185。
229
-
230
- - **路由错误面**(信任边界此前只测了围栏与备份校验):全部路由的 405、坏
231
- JSON → 400、流级超限 → 413、timeline/export 缺 `sessionId` → 400、kinds
232
- 数组内单项非法 → 400、`POST /state` 成功路径与 `applyEdit` 失败 → 400 映射、
233
- Mermaid 脚本路由引擎未就绪 → 503 及其围栏 403。
234
- - **状态加载失败处理**:损坏文档隔离、重试耗尽后隔离、瞬态故障恢复后正常合
235
- 并、隔离失败时 reject 且原文件字节不动。
236
- - **跨宿主同步合并**:外部写入按段采纳/保留、同一用量行两宿主并发累加的精确
237
- 并集、全新安装保存不触发合并。
238
- - **形状门**:合法树/星标通过、重复 id 与非字符串成员拒绝、超深树拒绝、不安
239
- 全对象键(`JSON.parse` 产生的自有 `__proto__`)拒绝。
240
- - **装载入口集成测试**(`src/index.ts` 此前零覆盖):全路由与状态工具注册、
241
- 启动规范化落盘、`stateReady` 前的用量缓冲、500ms 防抖合并为一次写入、损坏
242
- 文档隔离后继续写入、隔离失败转只读(诊断含 read-only、内存台账仍在、磁盘
243
- 无写入)、fiber 卸载回收路由/工具并重新武装单例守卫。
244
- - **单例守卫 / 家目录 / 凭据存储零覆盖补齐**:`mountOnce` 首挂生效、重挂静默、
245
- fiber 卸载后重武装(effect 须「返回」解标记的契约被锁死);`resolveDshHome`
246
- 的 `~` 展开与相对路径锚定;keytar 缺席时 `SystemCredentialStore` 全操作软
247
- 失败(本仓库与最小安装实际走的路径)。
248
- - **凭据缓存**:TTL 窗口内命中缓存、编辑后失效重解析。
249
- - **样式不变量**(`styles.spec.ts`):把 0.7.0 的实发 bug 类锁死为断言
250
- ——`.vx-liquid` 永不出现在 `.vx-root` 之后(死规则类)、磨砂/液态玻璃与余
251
- 额卡必须按 `:root.vx-dark/vx-light` 主题类出规则、无退役类名(vx-dots /
252
- vx-timeline)、花括号平衡。测试首次落地就抓出一个存量孤儿 `}`(历史上删
253
- 媒体块残留,浏览器静默忽略),已清除。
254
- - **Mermaid 载荷校验**:200-HTML 拒收并落到下一镜像、全部镜像 HTML 时不投毒
255
- 缓存、过小 200 体拒收。
256
- - **用量重扫提前中止**:扫描进行中来新用量时,剩余会话不再被读取即返回重试
257
- 错误。
258
-
259
- ## 0.7.0 — 2026-09-30
260
-
261
- 桌面版适配修复版。0.6.0 及之前的产物在 dsh Desktop 里几乎全部功能失效——本版
262
- 定位根因、修复围栏,并按桌面版重新校准了外观与额度两个界面。
263
-
264
- ### Fixed
265
-
266
- - **桌面版全线 `forbidden` 的根因**:插件的访问围栏在回环判定之外额外要求一个
267
- 浏览器同源标记(`sec-fetch-site: same-origin` 或 `origin` 头),而桌面版
268
- Electron 壳把渲染进程请求转发给它自己的 Host 之前会删掉 `host`、`origin`、
269
- `sec-fetch-site`、`cookie`——于是每个 `/api/custom-plugin/*` 路由和
270
- `/custom-plugin/mermaid.js` 都被误拒为 403 `forbidden`:三种导出、会话搜索、
271
- Mermaid 引擎预加载与就地渲染(连带 mermaid.live 按钮不出现)、余额与用量、
272
- 以及**一切静默失败的状态保存**(主题、玻璃模式、项目文件夹、提示词库在桌面
273
- 版从未真正持久化过)。0.7.0 起围栏对齐官方 API 围栏的信任语义:回环套接字 +
274
- 回环 Host、非 `cross-site`、`origin` 缺省或与 Host 一致即放行;异源与跨站
275
- 仍然 403。新增 guard 级单测(桌面转发形状、桌面 WS 形状、异源、跨站、非法
276
- origin、非回环 Host)与 `scripts/desktop-shape-probe.mjs` 活体探针;并在
277
- 真实桌面安装(F:\DSH,dsh 0.2.0-rc.2)上实测:11 项通过 / 0 失败。
278
- - **客户端不再静默吞错**:`loadCfg` / `saveCfg` 失败现在 toast + 上报客户端
279
- 诊断,「看起来生效其实没存上」从此不可复现。
280
- - **余额「额度?」的间歇性根因**:宿主对 `api.deepseek.com` 的外呼与桌面版
281
- GUI 一样走本机直连,而本机代理/安全软件按规则间歇性对 443 做 TLS 解密——
282
- 被接管的时刻 Node 校验不了其自签名证书(`SELF_SIGNED_CERT_IN_CHAIN`),
283
- 于是登录时首次查询失败、稍后手动刷新又成功,顶栏停在 `额度?` 上。0.7.0 起
284
- 宿主把这类连接层失败(TLS 拦截 / DNS / 连接超时)翻译成可读的中文原因,
285
- 客户端失败后按 8s/30s/30s 自动重试(60 秒轮询继续兜底),顶栏悬停即可看到
286
- 真实原因。失败态顶栏文案按反馈只显示「额度」两字,不带问号。
287
-
288
- ### Removed
289
-
290
- - **极光背景预设**:与整体配色不再协调,从色板中移除;旧存档的 `bg: 'aurora'`
291
- 在宿主归一化与客户端加载两侧自动迁移为 `default`。
292
- - **消息时间线轨道**(系统已内置对话时间线):轨道、悬停卡(跳转/星标/分支/
293
- 全文)、「显示时间线 / 时间线在左侧 / 仅显示星标」三个开关与时间线标签页
294
- 全部移除;`timeline` / `timelineLeft` / `starsOnly` 配置键退役(旧状态文件
295
- 里的残留键会被宿主归一化丢弃)。保留:消息尾部的 LaTeX / MathML / Mermaid
296
- 芯片(其数据链 `/timeline` 原样保留,会话运行期间由 OverlayRoot 每 3 秒
297
- 轮询驱动)、星标数据字段(备份兼容)与搜索定位跳转。
298
-
299
- ### Changed
300
-
301
- - **色板适配深色模式**:20 组色系在深色下不再禁用——按同色系自动派生深色
302
- 变体(保留色相与低饱和,明度落到深色档,饱和度压缩至 0.55 倍,避免暖色系
303
- 在深底上抢眼),色板预览即当前模式的实际效果;「深色强制重置背景」的旧
304
- 逻辑随之移除,主题翻转只重新着色。
305
- - **头部入口交互统一**:个性化 / 提示词 / 额度三张卡片统一为「点一下显示、
306
- 再点一下关闭」——额度卡片移除悬停即开与固定/取消固定的混合逻辑,提示词
307
- 浮层重复点击按钮即可关闭;四个浮层表面(含项目文件夹侧栏)互斥,打开一个
308
- 自动收起其它。
309
- - **液态玻璃**:删除「在 Chromium 启用液态玻璃…」的桌面端无关文案;位移折射
310
- 链上轻微模糊与饱和(`url(#vx-lg) blur(2.5px) saturate(1.12)`),大面积面板
311
- 中部文字清晰、玻璃可感知;液态模式下「全局浮层玻璃」把同样的位移链延伸到
312
- 弹窗 / 菜单 / 提示框 / 下拉框与系统设置窗(`CSS.supports` 门控,不支持
313
- SVG 位移滤镜的引擎回退毛玻璃)。并修复了一个让面板「看起来没有液态」的
314
- 作用域缺陷:主题毛玻璃底色(64% 白底)特异性压过 10% 液态底色,而本应翻盘
315
- 的选择器要求 `vx-liquid` 出现在 `.vx-root` 内部(它实际挂在 `<html>` 上),
316
- 从未匹配——只有不在 `.vx-root` 里的额度浮层是真液态。现以 `:root.vx-liquid`
317
- 作用域重写液态底色,并把主题类镜像到 `<html>`,所有玻璃表面统一。
318
- - **点阵背景全局移除**:所有玻璃表面不再渲染滚动的点阵纹理。
319
- - **额度区改版**:顶栏胶囊在未配置 Key 时显示本机费用估算(`≈¥0.42 · 今日
320
- N 次`,按官方价目表折算,不用 Key、不联网);配置了 Key 照旧显示真实余额。
321
- 面板默认区只放用量趋势 / 预算 / 今日明细 / 扫描按钮;「余额查询」收为可折
322
- 叠可选项(配置过 Key 默认展开),未配置时不再显示任何报错。
323
- - **价目表更新**(2026-09-30 核对官方页):`deepseek-flash` 峰时输入 ¥2 / 输出
324
- ¥8 / 缓存命中 ¥0.04(旧名 `deepseek-v4-flash` / `-vision-exp` 仍按 Flash 计
325
- 价路由),`deepseek-v4-pro` ¥9 / ¥27 不变;闲时一律半价。
326
-
327
- ## 0.6.0 — 2026-09-30
328
-
329
- ### Published
330
-
331
- - `npm publish` went out at 2026-09-29T17:26:16Z — 01:26 local on 2026-09-30, which is
332
- why this entry is dated 09-30 — and registry `dist-tags.latest` is now `0.6.0`.
333
- The first `PUT` returned 401, npm opened its browser sign-in flow, and
334
- the retried `PUT` returned **202 Accepted** — npm then keeps the version
335
- processing for a few minutes, during which the registry still reads
336
- `latest: 0.5.0`. Anyone re-checking too early will see "not published"; check
337
- `time["0.6.0"]` before re-running `npm publish`, because a second publish of an
338
- accepted-but-processing version fails on the version already existing.
339
- - The published tarball was unpacked and compared to the repository build:
340
- `lib/client.js` 207762 B (sha256 `f559cd7f1bd8a49a`), `lib/index.js` 81224 B,
341
- `package.json`, `cordis.patch.yml`, `icon.svg`, `README.md` — all byte-identical.
342
- - That registry artifact was then installed into a fresh scratch profile on
343
- dsh 0.2.0-rc.2 — dsh Desktop's exact bundled version — and scored the same
344
- 18 pass / 1 skip / 0 fail as the locally packed one.
345
- - **Install it by exact version for now.** A bare `dsh plugin … add
346
- @alexpeng/dsh-custom-plugin` resolved `0.4.2` on this machine minutes after
347
- the publish: the plugin manager reads a cached packument whose `latest` was
348
- still stale. `@alexpeng/dsh-custom-plugin@0.6.0` installs cleanly. Use
349
- `npm view @alexpeng/dsh-custom-plugin dist-tags --prefer-online` to read the
350
- real tag instead of the cached one.
351
-
352
- ### Changed
353
-
354
- - **Built against dsh 0.2.0-rc.2, and the declared range now names it.** Every
355
- `@deepseek-ai/dsh-*` devDependency moved to 0.2.0-rc.2 and the source
356
- type-checked against that release's own published types with no source
357
- changes. The gate-relevant peer became
358
- `@deepseek-ai/dsh-tools >=0.1.7-rc.2 <0.2.0-0 || >=0.2.0-rc.2 <0.2.0-rc.3`,
359
- and `engines.dsh` was set to the same range. That spelling is load-bearing:
360
- `^0.1.7-rc.2` desugars to `>=0.1.7-rc.2 <0.2.0-0`, and every `0.2.0-rc.N`
361
- sorts above `0.2.0-0`, so no caret form can admit a verified prerelease — and
362
- `^0.2.0-rc.2` would additionally admit 0.2.0 stable plus every later 0.2.x,
363
- which is exactly the unverified support this range exists to withhold.
364
- 0.2.0-rc.1 is left out on purpose: the bundle is now built for rc.2.
365
- - `pnpm smoke`'s two range checks were rewritten, because both encoded the old
366
- premise that a peer range is a single caret pin. They now assert what is
367
- actually load-bearing: the installed build target must **satisfy** the peer
368
- range (same comparator and `includePrerelease` semantics dsh's own gate uses),
369
- a range that admits every version is rejected as stating no support at all,
370
- and `engines.dsh` must admit the same versions as the peer range across ten
371
- probed releases. `semver` became a devDependency to make the first check
372
- possible. Verified by mutation: a stale range, a `*` range, and a diverging
373
- `engines.dsh` each turn the gate red.
374
- - The desktop release line pins its shell and runtime together, so dsh Desktop
375
- always ships one exact dsh version — this is why 0.2.0-rc.2 stopped being a
376
- speculative target: any Desktop install *is* that runtime.
377
-
378
- ### Added
379
-
380
- - `tests/loopback.spec.ts`: the request-level fence had never had a unit test —
381
- only the live probe script exercised it. Twelve tests now pin the two header
382
- shapes dsh Desktop's shell produces (`web-document.ts` deletes `host`,
383
- `origin`, `cookie` and `sec-fetch-site` before forwarding; the WebSocket
384
- upgrade rewrites `Origin` to the Host authority), plus the rejections a
385
- forged Origin, a cross-site marker, and a non-loopback socket must still get.
386
- - `scripts/desktop-runtime.mjs`: reads which dsh version an **installed** dsh
387
- Desktop carries, straight out of `resources/app.asar/dsh/desktop-runtime.json`,
388
- and prints whether the peer range declared here admits it. Promoted from a
389
- throwaway probe because Desktop pins shell and runtime together, so "what does
390
- this installer actually run" is a question every future Desktop release
391
- re-asks and the repository cannot answer. Read-only; takes the installation
392
- directory or the archive path. Verified in both directions: on this machine's
393
- install it reports `0.2.0-rc.2 / ADMITTED`, and with the peer range temporarily
394
- reverted to `^0.1.7-rc.2` the same run reports `REFUSED`.
395
- - README (both languages) gained an "On dsh Desktop" section: how the shell
396
- routes requests, why the profile is managed by Desktop's own `dsh` command,
397
- and which part still needs a window and a login.
398
-
399
- ### Fixed
400
-
401
- - **A second dsh host could read a half-written state document.** The atomic
402
- replace wrote to one shared temp name, `custom-plugin-state.json.tmp`, while
403
- the queue that serializes saves lives inside a single process. dsh Desktop
404
- owns `$DSH_HOME/profiles/desktop` and the Web profile owns `profiles/web`,
405
- but both hosts read and write the same
406
- `$DSH_HOME/custom-plugin-state.json`, so two hosts saving at the same moment
407
- wrote and renamed that one temp file against each other — the Windows
408
- EPERM/EBUSY shape this queue was built to stop, reachable across processes.
409
- Temp names are now qualified by the writing pid (both the state document and
410
- the pre-import recovery backup), and a failed turn deletes its own temp
411
- instead of leaving a per-pid file behind. Building that cleanup surfaced a
412
- second bug: `rm` was used in the new `catch` but never imported, so a failed
413
- save reported `ReferenceError` instead of the real rename error and left the
414
- temp file on disk.
415
-
416
- ### Verified
417
-
418
- - **dsh 0.2.0-rc.2, the version Desktop ships.** Confirmed from the installed
419
- app's own bytes, not the repository: `resources/app.asar/dsh/desktop-runtime.json`
420
- records `release.version 0.2.0-rc.2`, `node 24.18.1`, `pnpm 11.7.0`, and lists
421
- `@deepseek-ai/dsh 0.2.0-rc.2` with `@deepseek-ai/cordis 4.0.4` (the version
422
- this package's cordis peer already names) among its shared packages.
423
- - 0.5.0 on that runtime behaved as predicted: `dsh plugin --profile web add`
424
- refused it, naming `peerDependencies {"@deepseek-ai/dsh-tools":"^0.1.7-rc.2"}`,
425
- and rolled the profile back. With the exemption granted, 18 of 19 live host
426
- probes passed, 0 failed.
427
- - **0.6.0 installs on 0.2.0-rc.2 with no exemption at all** (`plugin add` exit
428
- 0, profile kept), and the same 18-pass/1-skip/0-fail result holds there and on
429
- 0.1.7-rc.2 — boot graph 66 module rows on 0.2.0-rc.2 and 65 on 0.1.7-rc.2, our
430
- row served, all
431
- five `dsh.client.inject` targets present, Mermaid engine loaded locally, UTF-8
432
- state round trip restored. The single skip is the session-dependent probe; a
433
- credential-free scratch home holds no session.
434
- - The rebuild of `pnpm-lock.yaml` (required: the old lockfile cached a
435
- `minimumReleaseAge` policy snapshot that no longer matched the allow-list, so
436
- every install was rejected) also moved the dev tree's `mermaid` from 11.17.0
437
- to 11.17.2. That is inside the declared `^11.6.0`, and the scratch profiles
438
- used for the live probes resolved 11.17.2 themselves, so the measured Mermaid
439
- engine is the version an installing user gets.
440
- - The installed `lib/client.js` is byte-identical to the repository build
441
- (207762 bytes, sha256 prefix `f559cd7f1bd8a49a`). The *served* bundle is 49
442
- bytes larger because dsh's composite `/plugins/??…` route joins modules with
443
- `;\n` and rewrites the `sourceMappingURL` — so byte identity is asserted at
444
- the installed file, never at the HTTP response.
445
- - 126 unit tests pass, typecheck is clean, `pnpm smoke` and `check:readme` are
446
- green. Not verified: opening the plugin inside a real Desktop window (needs a
447
- login), the desktop profile's own composition, and the per-turn chips.
448
-
449
- ## 0.5.0 — 2026-09-28
450
-
451
- ### Changed
452
-
453
- - **Target dsh 0.1.7-rc.2.** All `@deepseek-ai/dsh-*` dependencies, the
454
- `@deepseek-ai/dsh-tools` peer range, and `@deepseek-ai/cordis` moved to the
455
- versions that release ships, and `engines.dsh` now states the supported range.
456
- dsh checks a bundle's `@deepseek-ai/dsh-*` peer ranges against its own runtime
457
- version at install and startup and skips a bundle that does not match. The
458
- declared floor is the release this package was built and verified against;
459
- `^0.1.7-rc.2` additionally admits later 0.1.x releases that have not been
460
- re-verified, and `engines.dsh` is declarative — no part of dsh reads it.
461
- - The browser half declares `dsh.client.inject` as the five packages that own
462
- the slots it registers into, replacing the retired
463
- `@deepseek-ai/dsh-client-runtime` row.
464
- - Slot-provided data shapes (`SessionListState`, `WorkspaceListState`,
465
- `TurnLocation`) are now declared locally instead of imported from harness
466
- controller packages that rename across releases; only `SnapshotSelectorHook`
467
- still comes from the slot SDK.
468
- - In-session search uses dsh's event index when the deployment opens one and
469
- otherwise scans the session log it already read, reporting which path answered
470
- in the panel. dsh's shipped `web` profile configures the index with
471
- `openAt: never`, so the indexed route was unavailable on a default install.
472
- - Plugin Manager cards, bundle details, and the settings inventory now show a
473
- real name and icon: `locale/en.json`, `locale/zh.json`, and `icon.svg`.
474
-
475
- ### Fixed
476
-
477
- - **The timeline rail, export, and quote features lost the current session.**
478
- The session list snapshot has had no `current` field since dsh
479
- 0.1.6-alpha.2 (view selection moved to the Workspace browser), so the rail
480
- tracked nothing. The viewed session now comes from the standard `sessionId`
481
- prop every session-scoped slot entry receives.
482
- - **Opening a session or a workspace failed silently.** `ctx.sessions.open` is
483
- gone; navigation goes through `ctx.uiWorkspace.openSession()` /
484
- `connectWorkspace()`. Branching and full-text search go through
485
- `ctx.remote.session.fork()` / `.search()` — `ctx.sessions` still declares
486
- those two, but the remote namespace is the documented surface — each with an
487
- honest failure message when the service is absent.
488
- - **Exports lost tool results and the new model-visible messages.** The
489
- `tool-result` content block was replaced by a tool-role message whose call id
490
- now sits on the message (`toolCallId`, still falling back to `source.callId`
491
- for older logs); `system/message` and `developer/message` are exported as
492
- injected context; and `file`, `tool-addition`, `tool-removal`, and offloaded
493
- `image` blocks are named instead of dropped.
494
- - `conversation.chat.turnTail` changed from a chain slot to a list slot, so its
495
- `select` registration option no longer applies and was replaced by an id and
496
- order.
497
- - Client diagnostics are throttled per message kind. The previous single shared
498
- window let the frequently emitted rail line swallow the one-shot timeline
499
- result line, which made a successful timeline fetch look like zero turns.
500
- - `pnpm smoke` now checks the manifest fields dsh reads before it activates a
501
- bundle (client platform and `./client` export, patch path, icon size, locale
502
- display metadata, and peer ranges agreeing with the build target), so an
503
- unsupported or stale declaration fails the local gate instead of being skipped
504
- silently in a user's profile. The peer check refuses to read a range form it
505
- cannot interpret, and every `files` entry must resolve to something in the tree
506
- — an entry matching nothing used to publish a bundle missing that piece. Both
507
- new rules were confirmed red by breaking them on purpose. The
508
- `dsh.client.inject` rows are counted, not resolved: only a running shell knows
509
- which module ids it serves, so a retired name there is caught by the live
510
- boot-graph probe below, not by this gate.
511
- - A search excerpt now extends its window so a pasted query longer than two
512
- thirds of the excerpt is still shown whole. Measured first: the previous
513
- centering already covered ordinary queries, including a hit at the very end of
514
- a long message, so only the long-query case was affected — the fix is narrow,
515
- and the added test fails against the old formula.
516
- - Exports no longer fail outright on a `tool/result` event whose `message` is
517
- absent, and the scan fallback reads each event shape through its own typed
518
- case instead of a cast that hid real field drift.
519
- - When cross-session full-text search is unavailable, the palette says what still
520
- works (title matching over sessions and workspaces) instead of showing a bare
521
- error.
522
- - Added `scripts/live-dsh-check.sh`: a manual probe that runs against a *running*
523
- isolated dsh profile and exercises the host half on real session data
524
- (timeline, the three export formats, the search scan path, usage scan, backup,
525
- a UTF-8 state round trip, the Mermaid engine route, the client→host diagnostic
526
- ring, both fences, and the boot graph the shell serves), exiting non-zero on
527
- any failure. CI has no harness to talk to, so this is the check to run when a
528
- dsh release lands. Verified against 0.1.7-rc.2 with 19 probes green; the
529
- session-dependent ones `SKIP` — and the closing line counts them instead of
530
- claiming a clean sweep — when the scratch home holds no session, and the UTF-8
531
- probe was shown to distinguish a correct write from the mangled-bytes write it
532
- guards against.
533
- - The live check itself was then tested against a dead endpoint and found two of
534
- its own probes green-by-absence; the restore probe now refuses to pass when the
535
- append it restores never landed. Running it against a real profile exposed five
536
- more defects in the tool, all fixed: restoring the prompt library through
537
- `curl -d "$var"` mangled non-ASCII to U+FFFD (Git Bash re-encodes non-ASCII
538
- argv for `curl.exe`), so bodies are now written by node and sent with
539
- `--data-binary @file`; the script checked out with CRLF endings (the stored
540
- blobs were already LF — `core.autocrlf` was rewriting them on checkout, now
541
- pinned by `.gitattributes`); its search probe read the query word with a greedy
542
- `sed` that needed *some* six-letter run anywhere after the last `"text":"`, so
543
- it silently `SKIP`ped the one probe covering the scan path; it looked for
544
- sessions under `<state file>/../sessions`, which only finds anything because
545
- Windows folds the path lexically and would see nothing on a POSIX shell; and
546
- the real-home guard missed a `DSH_HOME` written with a trailing separator,
547
- which is exactly the spelling that would have probed a developer's own harness
548
- home.
549
- - The READMEs add a plugin-to-dsh compatibility table. A mismatched pair is not
550
- silent — dsh logs `disabling profile plugin …` on stderr, rejects the install,
551
- and models the state as `incompatible` in the plugin manager — but none of that
552
- reaches the page a user is looking at, so the supported window belongs in the
553
- README.
554
-
555
- ### Verified by independent review
556
-
557
- Four reviewers were dispatched against `30e025b..HEAD` with separate charters
558
- (code correctness, claims-vs-evidence, contract-vs-installed-runtime, and a
559
- deep re-audit pinned to the previous commit). Their findings were each
560
- re-verified before being acted on; three of their "critical" items were
561
- refuted by measurement and are recorded below so nobody re-litigates them.
562
-
563
- - Fixed: `package.json` declared `"icon"` twice. `JSON.parse` keeps the last
564
- value, so every gate stayed green on a manifest npm would warn about. `pnpm
565
- smoke` now counts top-level keys in the file text and compares them with what
566
- survived parsing, and separately checks that `engines.dsh`'s floor names the
567
- installed dsh-tools release (nothing in dsh reads `engines.dsh`, so this is
568
- the only place that keeps it honest).
569
- - Fixed: the session probes looked under `<state file>/../sessions`, which only
570
- resolves because Windows folds the path lexically; they now use the home
571
- directory directly. Skips are counted and named in the closing line, a missing
572
- boot-graph URL line fails instead of vanishing, the Mermaid probe reads
573
- `mermaidSource` rather than inferring "local" from a byte count, and a
574
- rejected state write now carries the host's own error text.
575
- - Fixed: the restore probe was vacuously green — it never checked that the
576
- append it restores had landed. It now refuses to pass when the write failed,
577
- verified by mutating the write condition and watching exactly that line go
578
- red.
579
- - Fixed: the client's last-holder clear left `turns` and the rail positions
580
- behind with no session identity, and a holder whose `sessionId` prop flipped to
581
- null could wipe the identity other holders were still rendering. A null holder
582
- now claims nothing at all.
583
- - Fixed: `slots.inject`'s callback registered the component outside the
584
- surrounding `try`, so a rejected registration would take a surface down
585
- silently while the diagnostic ring still read green; the deferred `register`
586
- has its own guard now, and the summary line reports how many injection
587
- requests it actually submitted rather than asserting "8 / 7" — dsh defers the
588
- callback until a slot is declared, so no line printed at install time can
589
- claim a surface materialized; the per-slot `ok` / `register` lines do that.
590
- - Fixed: the search request was passed as `as never`, which hid that `values`
591
- must be `keyof SessionEventMap` rather than `string`; typed, the compiler
592
- caught it immediately. A synchronous throw from `searchEvents` now degrades to
593
- the scan path like a rejection does, a log with exactly 100 hits no longer
594
- claims there are more, and the scan's role filter is exercised by a fixture
595
- that only it can exclude. Each of the three is pinned by a test that fails
596
- against the code it replaces (verified by reverting one at a time).
597
- - Fixed: the sidebar footer button ignored the `wide` prop the host supplies, so
598
- its label wrapped into a vertical stack inside the 56px rail — measured both
599
- ways on a live profile: 36px icon-only when collapsed, "项目" again at 280px.
600
- - Added `scripts/check-boot-graph.mjs`, run by the live check: the served
601
- `__DSH_BOOT__` graph must contain our row, every `dsh.client.inject` target,
602
- and reachable client bytes. This is the only gate that can see the failure
603
- shape that started this whole upgrade — a manifest naming a module the shell no
604
- longer serves — and it was confirmed red by pointing the inject list at the
605
- retired `@deepseek-ai/dsh-client-runtime`.
606
- - Measured against dsh 0.2.0-rc.1 (published the day after this release):
607
- `dsh plugin add` rejects the bundle and rolls the profile back; with the
608
- exact-version exemption granted, the source typechecks against 0.2's own
609
- types, 111/111 unit tests pass, 19/19 live probes pass, and the browser
610
- behaves as on 0.1.7 — eight slot registrations, the rail, prompt insertion,
611
- the `Ctrl+K` palette with title search, and quote-reply. The peer range is
612
- deliberately not widened: `^0.2.0-rc.1` would silently admit every 0.2.x
613
- release, including a stable nobody has reviewed — the very failure this
614
- upgrade exists to prevent. What stays unverified there (branch / Mermaid /
615
- LaTeX chips) is unverified here too: those need a real model reply.
616
- - Accepted and published: a human walked the isolated 0.1.7-rc.2 profile in a
617
- browser (personalization panel, prompts into the composer, project folders, the
618
- timeline rail, quote reply, export entries, `Ctrl+K`) and reported it behaving.
619
- The same person then ran 0.5.0 on their own machine — dsh upgraded to
620
- 0.1.7-rc.2, plugin updated through the in-app market — and reported it
621
- behaving there too. That install's `lib/client.js` is md5
622
- `6639a0aebbe7d0eed32b0c2c5c50c544`, 207762 bytes: byte-identical to the repo
623
- build this section describes, so the chain "what was verified = what was
624
- published = what a user runs" is closed at both ends.
625
- Not covered by either pass, in this or any release until someone runs it with a
626
- key: the per-turn chips (branch, Mermaid render, LaTeX/MathML) and the real
627
- balance figures, all of which need an actual model reply. `0.5.0` was then
628
- published to npm, and the tarball pulled back from the registry was verified
629
- byte-identical to the `lib/` this section describes (34 files, 215634 B).
630
- - Retracted after re-measurement, so the record does not carry them: "the
631
- `slots.inject(key, fn)` service method does not exist in 0.1.7" (it is
632
- declared at `dsh-client-ui-renderer`'s registry interface, and all eight
633
- surfaces materialize in a live browser); "`data-chat-flow-kind` is gone, so the
634
- rail has no anchors" (the reading was taken while the host's trajectory tab had
635
- the chat flow unmounted); "`WorkspaceSnapshot.state` was renamed to `phase`"
636
- (both axes ship side by side). Corrected in place: `ctx.sessions` still
637
- declares `fork()` and `search()` (only `open` is gone), the `current` field and
638
- the turnTail kind change both landed in 0.1.6-alpha.2 rather than 0.1.7, and
639
- the bilingual README gate enforces hash freshness, not content parity.
640
-
641
- ## 0.4.2 — 2026-09-12
642
-
643
- ### Fixed
644
-
645
- - **Exports fail on forked/resumed sessions with "读取会话失败: seeded
646
- session constructor seed must equal its inherited prefix".** Newer dsh
647
- builds replay-validate inside `sessionQuery.readSession()` through a
648
- snapshot-mode constructor that rejects any seeded (forked or resumed) session
649
- whose log outgrew its seed boundary, so timeline, export, in-session
650
- search, and usage scans all failed on those sessions. Every read now goes
651
- through a shared helper that falls back to `observeSession()` (the live and
652
- restore paths dsh's own session page uses) when `readSession()` rejects, and
653
- surfaces the original error only when no fallback exists.
654
- - **The "PDF(含图片)" export button produced an `.html` file.** The button and
655
- its description now say what actually lands on disk: "HTML(含图片)", a
656
- print-ready HTML document you turn into a PDF via the browser print dialog.
657
- - **Weather FX are invisible on light backgrounds.** Snow, rain, and sakura
658
- colors were tuned for the dark theme only — pure-white flakes, 6%-alpha pale
659
- rain, and 90%-lightness pink petals all vanish over the near-white palette
660
- backgrounds. The FX canvas now picks a darker particle palette (cool slate
661
- snow, steel-blue rain, deeper rose petals, each with a lifted alpha floor)
662
- whenever the resolved theme is light or the saturated aurora background is
663
- active, and swaps palettes live on theme/background changes without
664
- rebuilding the particle field.
665
-
666
- ## 0.4.1 — 2026-09-09
667
-
668
- ### Fixed
669
-
670
- - **Fresh installs show nothing after a "successful" install.** `keytar` (a
671
- native optional dependency) tripped pnpm 11's strict build-script gate, so
672
- `dsh plugin add` exited non-zero and the harness never reconciled the bundle
673
- layer — the package sat inert in `dependencies` with no host half and no
674
- browser half. `keytar` is no longer a dependency: the OS-keyring adapter
675
- still detects a `keytar` module present in the profile's `node_modules`, and
676
- users who want the OS keyring can add it themselves
677
- (`dsh plugin --profile web add keytar`).
678
- - The browser half now waits for the `slots` service (a child fiber) before
679
- mounting its surfaces instead of reading it synchronously: newer dsh builds
680
- activate the slots provider after this plugin's entry, and the synchronous
681
- read lost that race every time, logging "slots service unavailable" and
682
- skipping all UI. The mount stays fail-soft — the GUI boots even when the
683
- service never appears.
684
-
685
- ## 0.4.0 — 2026-09-03
686
-
687
- ### Added
688
-
689
- - 7 / 30 / 90-day usage trends, per-model summaries, CSV export, and local monthly CNY budget warnings.
690
- - Versioned, secret-free state backup with previewed merge/replace import and automatic recovery copies.
691
- - Editable, tagged, sortable favorite prompts with usage recency, `{{variable}}` templates, and JSON / Markdown portability.
692
- - Indexed current-session search and a Ctrl/Cmd+K command palette backed by DSH's official search APIs.
693
-
694
- ### Changed
695
-
696
- - Batch archive skips running sessions and reports separate success and failure counts.
697
- - Existing prompt and config documents are normalized for the new optional fields.
698
-
699
- ### Fixed
700
-
701
- - State-dependent routes now wait for the initial local state load; usage events
702
- arriving during an import, edit, or usage scan are queued and persisted instead
703
- of racing a stale snapshot.
704
- - Backup imports reject malformed counters/configuration, honor imported folder
705
- parents and sibling order, and keep the 5 MiB document boundary distinct from
706
- the JSON request envelope.
707
- - Search hits carry their session id and archive batches retain per-item errors;
708
- stale cross-session clicks and swallowed archive failures now surface clearly.
709
- - Malformed persisted peak counters, invalid calendar buckets, failed usage
710
- rebuilds, and partial state edits are handled without presenting or keeping
711
- a misleading snapshot; backup requests now validate their envelope fields.
712
-
713
- ### Security
714
-
715
- - Backups exclude API keys and credential metadata; imports preserve the active credential.
716
- - Archive restore remains deferred until DSH exposes an official API.
717
-
718
- ## 0.1.6 — 2026-09-02
719
-
720
- ### Fixed
721
-
722
- - Usage scans now preserve the live ledger when a session read fails or new
723
- usage arrives during replay, and return the replayed Beijing day so a
724
- midnight-crossing scan cannot relabel its result.
725
- - Legacy API-key migration no longer overwrites an existing system credential;
726
- failed system-key deletion is reported instead of being treated as success.
727
- - Legacy usage rows without a recoverable peak/off-peak split are marked as
728
- inexact and are no longer shown with a misleading cost estimate.
729
- - DeepSeek peak/off-peak cost estimates now treat only Beijing Monday-Friday
730
- 09:00–12:00 / 14:00–18:00 as peak; weekends are off-peak.
731
- - The browser usage panel now uses the same Beijing-time day bucket as the
732
- Host, including when the desktop host runs outside UTC+8.
733
- - Client state snapshots are serialized in invocation order so rapid settings
734
- changes cannot be overwritten by an older save completing later.
735
- - Timeline refreshes ignore stale session/request responses and follow live
736
- conversation running-state changes.
737
- - Mermaid modal changes reload correctly, while concurrent CDN loads share one
738
- in-flight request; the balance hover panel also remains reachable across its
739
- trigger gap.
740
-
741
- ### Changed
742
-
743
- - Centralized the cost formula, added explicit `deepseek-v4-flash-vision-exp`
744
- pricing, and covered the rule with unit tests.
745
- - Usage history is pruned to 90 Beijing calendar days; usage scans use four
746
- concurrent reads and share one in-flight scan instead of duplicating work.
747
- - The balance panel now shows the peak/off-peak token and cost split, pricing
748
- source link, and the built-in rule check date.
749
- - Saved panel keys prefer the optional OS credential store, migrate legacy
750
- state-file keys when possible, and no longer cross the browser state boundary.
751
- - Light/dark root theme styles now take precedence over the host OS preference,
752
- and the build uses the current tsdown dependency configuration without
753
- deprecation warnings.
754
-
755
- ### Added
756
-
757
- - Regression coverage for ordered state saves and shared in-flight Mermaid
758
- loading.
759
-
760
- ## 0.1.3 — 2026-08-23
761
-
762
- ### Fixed
763
-
764
- - Concurrent state saves are serialized per state file: two racing saves could
765
- collide on the shared `.tmp` file and fail the rename on Windows; a failed
766
- debounced save now surfaces in the status-tool diagnostics instead of being
767
- swallowed silently.
768
-
769
- ### Added
770
-
771
- - CI: bilingual README hash consistency check (`node scripts/check-readme-i18n.mjs`)
772
- — editing one language without the other, or forgetting to re-record the
773
- hashes in `README.i18n.yaml`, now fails the build instead of drifting silently.
774
- - CI: Dependabot with monthly schedules (GitHub Actions and grouped npm
775
- minor/patch bumps); workflow actions upgraded to current majors.
776
- - `pnpm smoke` — post-build smoke script: headless Edge loads `lib/client.js`
777
- against a stubbed module loader and asserts the registration handshake, plus
778
- artifact contract checks (loader banner/footer, node-half ESM import,
779
- patch row, local Mermaid engine).
780
- - Tests: the balance key resolution chain (panel → environment → DSH
781
- credentials, via a new credential-reader seam), state merge edge cases, and
782
- concurrent-save serialization.
783
- - Docs: the security section now states explicitly that the panel-pasted key
784
- is stored in plaintext in the state file (same trust domain as DSH's own
785
- credentials).
786
- - This changelog (also shipped in the npm tarball).
787
-
788
- ## 0.1.2 — 2026-08-23
789
-
790
- ### Fixed
791
-
792
- - **Mermaid diagrams in assistant replies now render in place.** The rendering
793
- entry previously hooked only user messages, so assistant-generated diagrams —
794
- mindmaps in particular — never got an entry point. A `MutationObserver` now
795
- scans GUI code blocks and renders ```mermaid``` fences where they are
796
- (`MermaidInPlace`), without moving any React-owned nodes.
797
-
798
- ### Changed
799
-
800
- - Mermaid engine is a local runtime dependency served by the host; the CDN
801
- mirrors are a fallback only. The source (`local` / `cdn`) is visible in the
802
- status tool diagnostics.
803
-
804
- ### Added (repository-side)
805
-
806
- - GitHub Actions CI (Node 22 + pnpm 11: typecheck / test / build), README
807
- badges, and a bilingual screenshot gallery under `docs/`.
808
-
809
- ## 0.1.1 — 2026-08-22
810
-
811
- ### Security
812
-
813
- - Mermaid rendering hardened: `securityLevel: strict` (was `loose`), and the
814
- `/custom-plugin/mermaid.js` engine route is behind the same loopback trust
815
- fence as every other route.
816
-
817
- ### Fixed
818
-
819
- - Peak/off-peak pricing and daily usage buckets are computed in Beijing time
820
- (UTC+8) regardless of the host machine's timezone; tests are
821
- timezone-independent.
822
-
823
- ### Changed
824
-
825
- - `@deepseek-ai/dsh-tools` moved to `peerDependencies` and externalized from
826
- the bundle — `lib/index.js` shrinks from ~245 KB to ~45 KB and shares the
827
- harness instance at runtime.
828
- - Dead code removed: unused `afterSeq` incremental timeline protocol and cache,
829
- unused type re-exports, dead client state fields, unconditional startup log.
830
-
831
- ### Added
832
-
833
- - Self-contained `prepare` script — GitHub source installs build themselves
834
- (pnpm ≥ 10 users: allowlist the build script, see README).
835
- - Package metadata: `repository`, `author`, `bugs`, `homepage`,
836
- `engines` (Node ≥ 22); LICENSE copyright line filled in.
837
-
838
- ## 0.1.0 — 2026-08-22
839
-
840
- Initial release: a personalization suite for the DSH web GUI, mounted through
841
- the official profile mechanism without touching DSH source.
842
-
843
- - Appearance: background palettes, liquid glass, weather effects
844
- (rain / sakura / snow).
845
- - Per-user-message timeline rail with stars and branching.
846
- - Multi-level project folders; prompt library.
847
- - Conversation export (JSON / Markdown / PDF with images).
848
- - Mermaid rendering; quote reply.
849
- - DeepSeek balance and daily token usage (peak/off-peak aware).
850
- - `custom_plugin_status` agent-facing diagnostic tool.
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format loosely
4
+ follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions
5
+ follow [Semantic Versioning](https://semver.org/).
6
+
7
+ ## 0.10.0 — 2026-11-16
8
+
9
+ #### Fixed
10
+
11
+ - **液态玻璃按 Apple Liquid Glass 重做**:毛玻璃与液态玻璃不再是同一块白底上的
12
+ 两个透明度,而是两种材质语言:
13
+ - 毛玻璃是均匀乳白(90%→84% + 30px 模糊),没有边缘光学;
14
+ - 液态玻璃是清透无色的玻璃:主体 86%→78%(浮层/对话框)、90%→82%(设置页),
15
+ 不带蓝/灰色调;玻璃感由边缘光学承担——1px 高光边(带极淡青/品红折色)、
16
+ 顶部内高光、底部内阴影与更深的外投影;
17
+ - 浮层、对话框、设置页 sheet 全部使用同一套配方,设置页内的卡片改为透明
18
+ 分组层,不再叠第二层白色材质;
19
+ - 设置页材质由中性色自绘,不再跟随宿主在背景动效三态下切换的填充,
20
+ 「关闭 / 字符 / 光影」只改变约 2 个百分点的透射率,不会再变成纯白;
21
+ - 设置页与浮层位于独立浮动文档,跨窗口背景折射不可用,因此边缘光学就是
22
+ 材质本身,`backdrop-filter` 只在 Web 环境作为增强。
23
+ - **设置页材质与背景动效解耦**:设置页根节点携带
24
+ `vx-glass-on` / `vx-liquid` / `vx-bg-live`,材质决策不再依赖宿主
25
+ `<html>` 类;`saveCfg` 成功后通过 BroadcastChannel 广播 cfg,设置面板若运行
26
+ 在独立插件实例中,主窗口会即时应用;接收端只应用、不回写,避免循环保存。
27
+ - **会话头部按钮间距**:插件「个性化 / 提示词」按钮的横向内边距由 10px 收到
28
+ 2px,与原生模式标签的 2px 右内边距一致。会话头部是 10px 间距的 flex 行,
29
+ 此前两组插件按钮之间比「标准模式 → 首个插件按钮」宽约 9px;现在两段间距
30
+ 相同。
31
+
32
+ ### 2026-11-15
33
+
34
+ #### Fixed
35
+
36
+ - **液态玻璃重做**:旧滤镜用百分比 `feImage` 与 `scale="-180"`,Chromium 只在上/左边
37
+ 产生错误偏移,整块背景被抹成模糊重影。现在位移贴图由圆角矩形 SDF 生成
38
+ (384px、alpha 255、R/G 通道、中心中性、6% 倒角),滤镜改用
39
+ `objectBoundingBox`、`feMerge` 只输出位移结果、区域外扩 25%,四边对称折射;
40
+ CSS 填充降到宿主菜单色的 72%、`blur(1.5px) saturate(1.5)`,并新增 1px 渐变
41
+ 高光边、深色变体与 `prefers-reduced-transparency` 回退。液态浮层入场改为
42
+ 纯位移 + 淡入(缩放会扭曲 SVG 滤镜坐标),全局浮层使用同一条链。真机实测
43
+ 额度卡 / 账号菜单四边折射、亮边和 60fps,切回毛玻璃后恢复原样。
44
+ - **背景与玻璃状态一致性**:`vx-bg-live` 只由页面级渲染器决定,海面(会话中栏)
45
+ 不再冒充页面背景;无页面背景时把 `--dsw-alias-bg-layer-2` 设为不透明,
46
+ 设置页不再透出会话文字;页面层首次挂载失败时最多补挂 3 次(160/320/480ms),
47
+ 不再等到拖动滑杆才出现。海面提示补充「只铺在会话中栏、需打开会话、设置页
48
+ 会盖住它」。
49
+ - **Windows 状态文件 EPERM 修复**:`saveStateFile` 的原子替换遇到
50
+ `EPERM` / `EACCES` / `EBUSY` 时按 30/60/120/240/480/800ms 退避重试;目标是
51
+ 非空目录时立即失败(不把配置错误拖成 2 秒等待);重试仍失败则回退为原地写入
52
+ 并回读校验,避免杀毒软件或另一个 dsh host 的短暂占用让「设置没有生效」。
53
+ 真机用 `FileShare.Read` 锁住状态文件 1.4s,背景动效设置仍成功落盘,刷新后
54
+ 保持,无错误 toast。
55
+ - **背景动效开启时保留玻璃材质**:新增 `vx-bg-live` 根标记;渲染器存活时,
56
+ 毛玻璃 / 液态玻璃改用「中心实、边缘透」的径向填充(中心 86% / 82%,边缘
57
+ 34% / 24%)与 `contrast(1.35)` 的滤镜链,中心文字保持可读,边缘能看到持续
58
+ 运动的字符纹理与液态折射;背景关闭后恢复原来的均匀材质。全局浮层同步使用
59
+ live 链;真机桌面 60fps。
60
+ - **设置跳转不再让用户自己按快捷键**:额度卡「完整用量」、外观浮层「完整设置」、
61
+ 提示词「管理提示词」以及快捷面板的管理动作现在直接打开 dsh 设置页并选中
62
+ 「个性化 → 目标分区」。实现优先派发宿主自己的设置快捷键(桌面
63
+ `Ctrl/Cmd+,`,Web `Ctrl+Alt+,`),失败后再走账号菜单 → 设置或直接触发器;
64
+ 真机从点击到设置对话框约 269ms,账号菜单从未展开。随后按导航标签选中
65
+ `settings.section`;只有入口不可达时才回退到 `Ctrl+Alt+,` 提示。真机验证:
66
+ 额度卡「完整用量」→ 设置对话框打开,「个性化」为当前分区,「用量与额度」
67
+ 为选中子页,卡片同时关闭且无提示 toast。
68
+
69
+ #### Changed
70
+
71
+ - **动效与流程统一**:动效 token 移到 `:root`,设置页及它拥有的弹窗/通知不再
72
+ 因为 `--vx-*` 未定义而让整条 `animation` 简写失效(设置页此前实际上没有
73
+ 过渡)。浮层从锚定方向进入(下方卡片 −6px、上方 +6px,180ms),退场 150ms;
74
+ 对话框 220ms 抬升 + 缩放,遮罩 180ms 淡入 / 160ms 淡出;通知入场 220ms,
75
+ 关闭后在原位停留 160ms 再移除,队列不跳位;设置页接管通知栈时,已在场的
76
+ 通知标记为 settled、不重播入场。设置分区切换新增 220ms 淡入上移并把宿主
77
+ 滚动容器归零,按钮 / 导航 / 列表项补齐按压缩放与 `:focus-visible` 焦点环;
78
+ 「扫描日志」在扫描期间显示旋转图标。`prefers-reduced-motion` 现在也覆盖
79
+ 设置页内部。
80
+
81
+ #### Removed
82
+
83
+ - **移除插件划词引用**:dsh 已自带文本引用,插件不再监听选区、不再注入「引用
84
+ 回复」悬浮按钮,`cfg.quote` 开关一并退休(旧状态文档中的该字段读取时直接
85
+ 丢弃)。`conversation.input.dock` 的注入保留为输入桥接,提示词插入与快捷
86
+ 面板继续可用。
87
+
88
+ ### 2026-11-14
89
+
90
+ #### Changed
91
+
92
+ - **界面改为宿主设计系统**。浮层、菜单、对话框、设置卡片、按钮、输入框与
93
+ 开关全部改用 `--dsw-*` / `--ds-*` token:浮层取宿主菜单材质与 40px 模糊,
94
+ 对话框使用不透明的 `--dsw-alias-bg-layer-3` 与 `--dsw-elevation-prominent`,
95
+ 设置内容改为原生卡片;移除自绘白色蒙层、固定 430px 窗口与硬编码品牌色。
96
+ - **入口重排**。头部「个性化」只打开 380px 锚定外观浮层,空间不足自动上翻,
97
+ 不可拖拽;项目、提示词、搜索、导出、Mermaid、效率、额度与数据管理迁入
98
+ dsh 设置页「个性化」分区,使用顶部分组导航 + 8 个设置卡片。
99
+ - **统一浮层交互底座**。新增 `ui/anchor.ts`、`ui/primitives.tsx`、
100
+ `ui/overlays.tsx`:所有浮层支持锚定翻转、Esc/外部点击关闭、焦点归还与
101
+ 120–200ms 进出场动效;`prefers-reduced-motion` 下取消位移动画。
102
+ - **提示词重做**。新增/编辑改为单个表单弹窗(名称/正文/标签/收藏,
103
+ `Ctrl/⌘+Enter` 保存);列表支持标签与收藏筛选、四种排序;删除后 5 秒内
104
+ 可撤销;导入先显示有效/无效/冲突预览再选择合并或替换;快捷浮层改为锚定
105
+ 菜单,按收藏/最近分组并支持键盘操作。
106
+ - **项目文件夹**。支持行内重命名(双击或铅笔)、上移/下移按钮、搜索、
107
+ 删除确认与空态提示;树操作抽到 `ui/folders-model.ts` 并由单测覆盖。
108
+ - **搜索**。新增「当前会话 / 全部会话」范围切换;结果支持 ↑/↓/Enter
109
+ 键盘导航、选中项滚动跟随、空/加载/错误态;全部会话走 dsh 官方跨会话接口。
110
+ - **导出**。格式卡片选择 JSON / Markdown / HTML;显示读取 → 整理 → 生成
111
+ 步骤,可取消(AbortController),完成后显示文件名与体积,失败可重试。
112
+ - **额度与用量**。新增最近刷新时间、手动刷新、余额失败标记与预算进度条;
113
+ 用量范围改为分段控件,扫描今日日志时显示进度。
114
+ - **备份**。导入预览从确认框文字改为独立对话框:展示文件夹/提示词/星标/
115
+ 用量计数、冲突明细与合并/覆盖选择,导入期间禁止关闭。
116
+ - **快捷面板**。命令按功能/会话/工作区/提示词/全文搜索分组;记录最近使用;
117
+ 选中项滚动跟随;补齐 `combobox` / `listbox` / `aria-activedescendant`。
118
+
119
+ #### Added
120
+
121
+ - `src/client/ui/anchor.ts`、`primitives.tsx`、`overlays.tsx`、
122
+ `appearance-controls.tsx`、`prompt-model.ts`、`folders-model.ts`、
123
+ `command-model.ts` 及对应单测(`tests/anchor.spec.ts`、
124
+ `tests/prompt-model.spec.ts`、`tests/folders-model.spec.ts`、
125
+ `tests/command-model.spec.ts`)。
126
+ - 设置页 8 个分区:外观 / 项目文件夹 / 提示词 / 搜索 / 导出 / 扩展 /
127
+ 用量与额度 / 数据与关于。
128
+
129
+ #### Fixed
130
+
131
+ - 提示词浮层此前只能点关闭按钮,现在 Esc、外部点击与焦点归还全部生效。
132
+ - 删除提示词不再无提示丢失,可从通知撤销;撤销动作执行后通知立即消失,
133
+ 不会重复插入同一条提示词。
134
+ - 余额卡与项目浮层改为锚定定位,不再依赖固定坐标或左下角常量。
135
+ - 设置面板打开时,模态框、命令面板与通知改由设置页内部渲染,避免被宿主
136
+ 设置层(body 级 z-index 1000)遮住;设置页内的文件夹弹窗也不再因点击
137
+ 模态框而被误关。
138
+ - 搜索与命令面板的跨会话结果改用唯一 key,同会话的多条结果不再互相覆盖。
139
+ - 导出结果体积按 UTF-8 字节计算,不再把 UTF-16 码元数当字节数。
140
+ - 卸载时补删 `vx-glass-off` 根类,避免玻璃关闭状态残留到下一次挂载。
141
+ - 提示词编辑器在内容被修改后按 `Esc`、点遮罩或取消,会先在弹窗内显示
142
+ 「放弃修改 / 继续编辑」,不再静默丢失草稿。
143
+ - Ask / Confirm / Template / Mermaid / Batch 五个旧弹窗统一为 `Dialog`:
144
+ 遮罩覆盖整个视口、焦点陷阱一致、支持退场动画;设置页内也不再只盖住
145
+ 内容区,宿主左侧设置导航在弹窗打开时不可点。
146
+ - 设置页新增会话/工作区索引桥接:`OverlayRoot` 把快照镜像到 store,
147
+ 设置页在拿不到 `useSessions/useWorkspaces` 时仍能显示会话标题并支持
148
+ 批量归档。
149
+ - 「完整设置」提示按平台输出快捷键:Windows/Linux 为 `Ctrl+Alt+,`,
150
+ macOS 为 `⌘+,`。
151
+ - 删除旧 `AppearanceTab`、`PanelBody`、`panelTab`、`.vx-toasts` 等死代码。
152
+ - 兼容性:在 dsh Desktop **0.2.2-rc.3** 实测通过(插件挂载、五个 inject
153
+ slot、设置页 8 个分区、命令面板、备份预览、暗色/液态玻璃、减动画、
154
+ 1280×822 与 1920×1080);旧 modal 统一后补上遮罩与面板的退场动画。
155
+ - 四张锚定卡片(额度、提示词、个性化、项目文件夹)统一到同一套壳层:
156
+ `.vx-popover` 改为 flex 列 + `overflow:hidden`,统一使用
157
+ `.vx-pop-head`(12/14/6)、唯一滚动的 `.vx-pop-body`(4/14/10)与
158
+ `.vx-pop-foot`(6/14/12 + 上边框)。此前每张卡片各写一套 padding 与
159
+ 滚动容器,额度卡片因此看起来像另一套界面;文件夹卡片的死样式
160
+ (`.vx-folders`、`.vx-folders-body`)与旧面板样式一并删除。
161
+ - 额度卡片改从 `.vx-root` 浮层渲染:此前它在会话头部内部,聊天正文会盖在
162
+ 卡片上;现在与提示词/个性化卡片同背景、圆角、阴影与头部结构,宽度 380,
163
+ 最大高度按视口计算,1280×822 下底边 482、输入区顶 702,不再压住输入区,
164
+ 表格固定列宽且无横向溢出。
165
+ - 额度卡片改为单屏摘要:今日 token / 调用 / 估算费用、分模型表、本月预算
166
+ 进度,底栏为「刷新 / 扫描日志 / 完整用量」;7/30/90 天趋势、CSV、余额
167
+ 明细与 API Key 留在设置 → 用量与额度,不再把设置页塞进浮层。每日用量条
168
+ 改为轨道 + 百分比填充,百分比不再把行撑出卡片;余额失败原因收成一行
169
+ badge + 提示,完整错误在悬停标题与设置页中。
170
+ - **余额模块改为只用 DSH 账号**:宿主复用 `ctx.deepseekAccount` 的
171
+ `getState()` + `getBalance()`,与「设置 → 账号与余额」同源读取充值 +
172
+ 赠送钱包;不再提供 API Key 表单、Key 回退或 Node/curl 传输。余额区展示
173
+ 赠送 / 充值、余额不足提示,以及账号服务提供的「用量明细 / 充值」链接;
174
+ 未登录时保留本机费用估算并提示到「设置 → 账号与余额」登录,grant 未就绪
175
+ 标记为 `pending` 自动重试,查询失败也会重试。实测顶栏 `¥695.55`、卡片与
176
+ 设置页来源「DSH 账号」,不再出现「API Key 无效」。
177
+ - **计价按官方峰谷价目复核(2026-11-14)**:官方页为高峰价——Flash 输入
178
+ ¥2 / 缓存命中 ¥0.04 / 输出 ¥8,Pro ¥9 / ¥0.30 / ¥27,空闲时段恰为半价;
179
+ 高峰为北京时间工作日 9–12、14–18,**不含中国法定节假日**,周末与节假日
180
+ 全天空闲。`usage.ts` 内置 2026/2027 国务院放假安排(2026-11-14 核对),
181
+ 下一份通知发布后需补表。上一版把页面 markdown 转换后的半价列误读成
182
+ “平价”,已回滚。
183
+ - **模型归属修复**:标题生成等请求在写入用量前没有自己的
184
+ `request/context`,过去会生成 `unknown` 假模型行;现在回退到会话模型,
185
+ 再回退到最近一次已知模型。扫描与实时折叠同一规则。
186
+ - 首次打开额度卡时,若今日台账为空或仍含 `unknown`,自动补扫一次本日
187
+ 会话日志(每次页面生命周期只触发一次);实测当天从 3 token / 1 次调用
188
+ 补全为 71,466 token / 6 次调用 / ¥0.0213(周六空闲价)。
189
+ - CSV 保留「峰闲状态」列,峰闲拆分不完整的旧行不输出费用;用量表继续显示
190
+ 峰/闲 token 与费用,并附官方峰谷价说明。
191
+
192
+ ### 2026-11-11
193
+
194
+ #### Added
195
+
196
+ - **`flow` 也会回应鼠标**。`flow` 复用 `ocean` 的波高水槽,但把它当作位移场:
197
+ `h` 同时扭曲噪声坐标(`+h*1.4` / `+h*0.9`)并加减墨色(`+h*0.18`)。拖动
198
+ 沿途注入的是**涡量偶极**——路径两侧各一个反向波瓣,再叠一点弱的中心抬升
199
+ ——所以痕迹像「被搅动的雾面」,而不是一道亮笔刷;拍散半径(1.8–4.0 格)
200
+ 与涡量都随指针速度增长。手停住(速度低于 10 格/秒)会在指针处积累一块
201
+ `bleed` 浓度场(速率 0.8/s、τ 0.8 秒、椭圆 4×2.2 格),墨色最多加
202
+ `bleed × 0.35`,约一秒后读得出「雾更厚」,松手后约两秒散尽。
203
+ `|h| > 0.14` 或 `bleed > 0.12` 的格子标入 emphasis,在淡区内最多抬到 50%。
204
+ `static` 仍用 `createFlowPiece(..., false)`,保持确定性、无交互状态。面板
205
+ 选中 `flow` 时显示「拖动会搅动雾面,点击会推开一圈涟漪」。
206
+ - **`rain` 也会回应鼠标**。雨帘的隐喻是「风吹过帘子」,所以它不走水槽:
207
+ 每列维护 `shift`(持续风偏)、`kick`(点击的推离,按距离向外、逐帧
208
+ ×0.93)、`surge`(点击的雨头闪光,逐帧 ×0.94)与 `repel`(排斥隧道)。
209
+ 拖动按指针速度设定风偏目标(`vx × 0.06`,上限 5 列、20 列衰减半径),
210
+ 跟随即时、回正缓慢,所以手停下约一秒内仍能看见风痕;点击以 14 列半径
211
+ 向两侧拨开雨帘,但只提亮每条雨丝**最前面两格**(×0.85),拖尾保持自己
212
+ 的衰减,不再整列 ×1.55 地闪一下。指针**停住**也会形成排斥隧道:半径 8
213
+ 列内的雨柱向外推开最多 2.4 列,目标格的墨量在半径内最多削掉 90%,雨帘
214
+ 围着光标让开、移开后合拢;隧道是「没有墨」,所以不标 emphasis,否则会被
215
+ 淡区下限顶回来。拖尾顶部比底部偏移更多(`shear = 1 − 0.45 × row/rows`),
216
+ 雨丝是斜的而不是整列横移。没有输入时四组权重恒为 0,输出与交互前逐位
217
+ 相同;残量会归零,画面真正回到原样。面板选中 `rain` 时显示「鼠标划过像
218
+ 一阵风,会把雨丝吹斜;点击向两侧拨开雨帘,随后慢慢合拢」。
219
+ - **`ripple` 也会回应鼠标**。三个固定圆心保持不变,指针最多追加 6 个活动
220
+ 源(固定环形缓冲,投放不分配)。点击在落点投一个强源,振幅与环速都随
221
+ 指针速度增长(`0.36 + min(0.24, speed × 0.004)`、`2.6 + min(1.2, speed ×
222
+ 0.012)`),所以甩手后的点击更响、扩散更快;120ms 内第一道亮环已在约 4
223
+ 格处,能看出「这里落了一滴」。拖动每 0.22 秒、每移动 5 格才投一个弱源
224
+ (振幅 0.15、环速 1.7),像指尖划过的水纹。指针源的波带内
225
+ (`|wave| > 0.045`)字级沿波的符号多走一档(±0.07),波带读起来是一条
226
+ 移动的等高线;所有值都是源年龄的纯函数,环过去后格子精确回到环境场。
227
+ 源寿命 3.2 秒、线性淡出,逐格距离门(48 格)跳过大部分 `sqrt`/`sin`。
228
+ 指针第一次出现只记录位置,页面在静止光标下加载不会自己生出涟漪。动态
229
+ 源贡献超过 0.06 的格子标入 emphasis,在淡区内仍可见;没有输入时输出与
230
+ 交互前逐位相同,源全部过期后也回到逐位相同。面板选中 `ripple` 时显示
231
+ 「点击会在落点漾开一圈新的涟漪,拖动会沿途留下小水纹」。
232
+ - **`starfield` 也会回应鼠标**,分两层:星野本身拆成**三层视差**,分别以
233
+ 0.05 / 0.10 / 0.18 行/秒漂移,阈值 0.975 / 0.966 / 0.956(远暗、中中、
234
+ 近亮);指针列以 0.12/帧缓动,按它离页面中心的距离把各层最多平移 1.2 格
235
+ (约 15px),并各自取整到自己的格点,所以近层会跳一格、远层不动。直接
236
+ 交互仍然很轻:点击在落点 2.5 格半径内撒 24 颗星光(半径线性分布,中心
237
+ 更密),拖动每 0.1 秒撒 3 颗、抖动 ±4×±3 格;每颗活 1.2 秒,固定 28 槽
238
+ 环形缓冲。**停留**会积累逐格 `heat`(速率 1.6/s、τ 0.408 秒,即 60fps
239
+ 下每帧 ×0.96,椭圆 11×6 格约 150px):半径内的星点变亮(`+heat ×
240
+ 0.55`),`hash > 0.84` 的「差点成为星」的格子被点亮成一小团星团,两者
241
+ 都标入 emphasis。heat 低于 0.02 直接忽略,所以指针离开后基线逐位复原。
242
+ 面板选中 `starfield` 时显示「点击会在落点点亮一小片星尘,拖动会沿途撒下
243
+ 星光,随后渐渐暗去」。
244
+ - **光影档 `liquid` 也能互动**。统一变量新增两个 vec4,且只存在于动画风格:
245
+ `u_pointer = [x, y, active, speed]`(CSS px,速度由 `bg-pointer` 的平滑
246
+ 速度归一化到 0..1)与 `u_pulse = [x, y, age, active]`(`age` 与 `u_time`
247
+ 同时钟,隐藏时冻结)。`grain` 声明 `animated:false`、不跑帧循环,因此
248
+ 刻意不读这两个 uniform——静态噪点响应鼠标会自相矛盾。涡旋围绕指针旋转
249
+ 云层采样坐标(半径收到视口高度的 22%),并把指针处墨色加浓 35%:纯坐标
250
+ 旋转在云面平坦处看不见,低对比场里大部分区域都是平坦的。指针位置直接用
251
+ `bg-pointer` 已经缓动过的样本(70ms),**不再二次平滑**(两级叠加会拖到
252
+ ~250ms),只有速度 uniform 以 0.12/帧缓动,甩手时涡量是渐入而不是跳变。
253
+ 点击改为**六次重叠 splat**(确定性偏移 ±0.055 q,半径 `age × (0.32 +
254
+ 0.05i)` q/s,权重 0.55…0.30),在 2.6 秒寿命内读起来是一团溅开的墨,而
255
+ 不是一圈完美的环。渲染器复用与字符档相同的被动监听并在销毁时移除;没有
256
+ `addEventListener` 的窗口也能启动,只是涡旋不生效。面板选中 `liquid` 时
257
+ 显示「鼠标划过会卷动墨云,点击会从落点扩散出一圈涟漪」。
258
+
259
+ #### Changed
260
+
261
+ - **8 套预设的出厂参数按 Desktop 验收面板固化**(2026-11-11)。逐预设调好
262
+ 的观感成为默认:`flow` 密度 0.65 / 速度 1.00 / 24 fps / 浓度 0.60;
263
+ `rain` 0.75 / 1.00 / 24 / 0.60;`ocean` 1.25 / 0.80 / 24 / 0.60;
264
+ `starfield` 0.65 / 0.30 / 20 / 0.60;`ripple` 0.65 / 0.60 / 24 / 0.65;
265
+ `static` 0.65 / 0 / 24 / 0.65;光影档 `liquid` 密度 0.80 / 速度 1.00 /
266
+ 强度 0.70 / 24 fps;`grain` 0.75 / 0 / 0.60 / 24。`opacity` 从此是出厂
267
+ 观感的一部分(此前默认 1),因此 `flow` 与 `static` 的 atlas key 不再
268
+ 相同,两者互切会重烘焙一次 atlas;画布与网格缓冲仍复用。
269
+ - **墨色强度三挡命名为「柔和 / 标准 / 强烈」**。存储值仍是
270
+ `soft` / `standard` / `strong`;只有最上一挡从「明显」改为「强烈」,
271
+ 另外两挡保持原名。面板提示同步为"觉得淡就点「强烈」,觉得抢眼就点
272
+ 「柔和」"。
273
+ - **三挡倍率整体下调,默认改为「标准」**。用户反馈原「标准」(1.0×)太深,
274
+ 所以倍率改为 `0.45 / 0.62 / 0.9`(柔和 / 标准 / 强烈),默认
275
+ `bgStrength` 从 `soft` 改为 `standard`——现在的「标准」正是他此前选作
276
+ 「柔和」的那个墨色深度(0.62×)。`DEFAULT_CONFIG`、`normalizeCfg`、
277
+ `strengthFromCfg` / `setStrengthInCfg` 四处回退同步改为 `standard`;
278
+ 已保存的配置不覆盖,缺失或非法值才落回新默认。
279
+ - **`ocean` 恢复「避让正文」开关**。会话中栏画布现在也接收淡区:把页面层
280
+ 同一份视口矩形平移进列内坐标后传给 `setFocus`,350ms 轮询与 `bgFocus`
281
+ 翻转时更新。开关打开时正文处的水面落到 0.15 下限,关掉则整列均匀。
282
+ - **上一版默认(柔和 + ocean 0.6)已被上面的固化取代**,保留此条仅为历史
283
+ 记录:`bgStrength` 的出厂值曾是 `standard`,后改为 `soft`;
284
+ `ocean` 出厂密度曾从 `0.65` 降到 `0.6`。现在两者分别是「标准」档与
285
+ 1.25。已保存的配置不会被覆盖:缺失或非法值才落回出厂默认。
286
+ - 单测同步:`bg-ascii` 钉住 ocean 默认密度 1.25,`bg-params` 钉住新的三挡
287
+ 标签,`state` 钉住 `bgStrength` 缺失和非法值回退到 `soft`。
288
+ - **`ocean` 改挂会话中栏**。之前它挂 body 级 `#vx-bg`,Desktop 的会话内容面
289
+ 是不透明卡片,所以只在顶栏/侧栏/留白可见。现在 `bgLayerScope` 把
290
+ `bgFx:'ascii'` + `bgFxPreset:'ocean'` 判为 `'conversation'`:页面层和
291
+ backdrop token 集都不挂,`ColumnBgAnchor` 在 `conversation.input.dock` 里
292
+ 找到 `_centerCol` 列根,插入 fixed `z-index:-1` 的 wrapper,并给列根
293
+ `isolation:isolate`,让画布画在列背景之上、所有消息之下。该作用域**不做
294
+ 正文淡区遮罩**(否则又看不见),面板里 `ocean` 不显示「避让正文」,改为
295
+ 一句说明。其余预设仍走页面层。(2026-11-11 晚些已恢复该开关,见本段
296
+ Changed 第三条。)
297
+ - **指针坐标偏移**:会话画布不在视口原点,`AsciiHostLike` 新增可选
298
+ `getBoundingClientRect()`,渲染器把 pointer 的 CSS px 减去 host 的
299
+ left/top 后再映射成格子;否则涟漪会落在中栏画布外面。单测覆盖了这个偏移。
300
+ - **指针手感统一**。`bg-pointer.ts` 的坐标改为时间常数 70ms 的缓动(每次
301
+ 步进至少 8ms,合并或同时间戳的样本也能推进),速度平滑 90ms;低于
302
+ 80 CSS px/s 时报告速度精确为 0(到 2× 才平滑放开),所以手搭在鼠标上
303
+ 不会搅动背景。两层渲染器每帧调用一次 `syncBgPointer`:手停下后位置继续
304
+ 缓动到目标、90ms 后开始衰减速度、1.5 秒整点把速度归零并把位置 snap 到
305
+ 目标——任何 piece 都不会靠一份过期样本继续施力。按下时位置 snap 到落点
306
+ 但**保留来速**,涟漪因此能靠甩手加力。四个常量由
307
+ `tests/bg-pointer.spec.ts` 钉住;`liquid` 的位置直接用这份缓动样本,不再
308
+ 二次平滑。
309
+ - **滑杆范围放宽、默认再淡一档,且默认值仍落在范围中点**(2026-11-11,用户
310
+ 先要求默认滑杆在中间、画面还能往淡里调,随后要求范围再放大、默认整体再淡
311
+ 一点)。只改 `ranges` 与 `opacity` / `intensity` 的默认值,滑块仍从中间
312
+ 起步。字符档:密度 `flow` / `ripple` / `static` 0.3–1.0、`rain` 0.4–1.1、
313
+ `ocean` 0.9–1.6、`starfield` 0.3–1.0;字号 6–18(`starfield` 9–19);
314
+ 帧率 15–33(`starfield` 5–35);浓度默认 `flow`/`rain`/`ocean`/`starfield`
315
+ 0.60→0.55(范围 0.1–1.0),`ripple`/`static` 0.65→0.60(0.2–1.0)——此前
316
+ 浓度下限就是默认值,只能调深,现在最低可到 0.10。速度按各自默认居中:
317
+ `flow` 0–2、`rain` 0–2、`ocean` 0–1.6、`starfield` 0–0.6、`ripple` 0–1.2
318
+ (`static` 锁定 0)。光影档 `liquid` 速度 0–2、密度 0.4–1.2、强度默认
319
+ 0.70→0.65(范围 0.3–1.0)、帧率 15–33;`grain` 速度 0、密度 0.45–1.05、
320
+ 强度默认 0.60→0.55(0.2–0.9)、帧率 15–33。已保存的覆盖值会被新范围
321
+ clamp;`tests/bg-params.spec.ts` 新增「每个默认值都是范围中点」的断言,
322
+ 防止以后改范围时又把默认值挤到一端。(`ocean` 随后又单独调细、调淡,
323
+ 见下一条。)
324
+ - **形状感知字符渲染(社区移植)**(2026-11-13,用户要求参考社区优秀案例)。
325
+ 参考 Alex Harri Jónsson 的《ASCII characters are not pixels》与 MIT 授权的
326
+ `glyph-graphics` 实现:字符单元不再只按灰度选字形,而是先看局部等高线方向,
327
+ 在不明显改变墨量的前提下换用沿轮廓的笔画(`-` `=` `|` `/` `\` 等)。
328
+ `flow` / `static` / `ripple` 启用,`rain` / 海面 / 星空保留原 ramp。实现是
329
+ 渲染器级的 `level × 5` 查找表,每格只多 4 次邻格读取;atlas 多烘 5–7 个
330
+ 方向字形,方向为 0 时仍用原字形,因此默认密度与墨量不变。许可:glyph-graphics
331
+ 为 MIT、算法出处 alexharri.com;本包未新增依赖。Harness 复测 `flow` 20.1 fps /
332
+ 45.3% TaskDuration,与移植前持平。
333
+ - **视觉层次再优化**(2026-11-12,用户要求“再次深入优化效果”)。海面原先
334
+ 20% 全屏随机点改为贴着波峰的浪花:波谷留空,海面读成水面轮廓而不是灰尘,
335
+ 也进一步减少与正文的混叠;雾面从单层 value noise 改为 0.7/0.3 双八度,
336
+ 体积和细节更明显而平均墨量不变(`static` 与 `flow` 在 t=0 仍逐字节一致);
337
+ 雨幕每列多一个 0.82–1.0 的纵深亮度因子,配合已有的列速差异,雨帘有了
338
+ 前后层。
339
+ - **「避让正文」开关在动效关闭时也保留**。此前档位切到「关闭」会整段替换成
340
+ “背景动效已关闭…”,连开关一起消失,看起来像默认避让被移除了。它是一个
341
+ 存储偏好,关掉动效时仍可调整(保存后下次开启动效立即生效)。
342
+ - **交互再润色:更明显、更连贯**(2026-11-11,用户要求“更优雅、高级、明显
343
+ 一点”)。淡区内的交互格上限 `EFFECT_FOCUS_FLOOR` 0.5→0.65:环境纹理仍压
344
+ 在 0.15,只有手刚造成的涟漪/星光/鱼更清楚地透出来。逐项:`ocean` 的环境
345
+ 波峰降到 0.45,把 ramp 高层留给指针;波峰加点、强波谷清点(点击读成
346
+ “亮环 + 中间空洞”);拖动改为每 0.16 秒 / 4 格落一个小偶极环(`DRAG_RING_TIME`
347
+ / `DRAG_RING_DISTANCE`)加一条淡尾迹,点击的四个环加宽到 1.8–2.6 格,
348
+ `EMPHASIS_WAKE` 0.15→0.09。`flow` 涡量 0.04–0.09、中心抬升 ×0.4、停留
349
+ 浓度加墨 0.45。`ripple` 点击振幅 0.40(随速度再 +0.26)、波带步进 ±0.085、
350
+ 拖动振幅 0.17。`rain` 点击闪雨头强度 ×1.0,隧道边缘改 smoothstep。
351
+ `starfield` 星光寿命 1.4 秒、停留增亮 ×0.65,末段分两级淡出。`liquid`
352
+ 涡旋角度 ×2.9、加浓 0.42。
353
+ - **`ocean` 默认更细、更淡**(2026-11-11,用户反馈“字符-海面”与内容区混在
354
+ 一起、字符太大、太深)。`ocean` 挂在会话中栏内部,海面直接铺在正文背后,
355
+ 所以它的出厂值比页面层预设再轻一档:密度 1.25→1.5(范围 1.3–1.7),
356
+ 字号 12→11(6–16),浓度 0.55→0.45(0.1–0.8),墨阶 1.4→1.2。格子更细、
357
+ 点更小、整片更淡,正文处的干扰明显下降;速度 0.8、帧率 24 与其余范围
358
+ 不变,默认值仍居中。已保存的 `ocean` 覆盖值会被新范围 clamp。
359
+
360
+ #### Measured
361
+
362
+ 同一套渲染器 harness(真实 DOM,headless Edge,1280×822 CSS / DPR 1.5)
363
+ 在**当前出厂值**(标准强度,`ocean` 密度 1.5 / 字号 11 / 浓度 0.45)下:
364
+ 静置 20.0 fps,正文列覆盖 2.29%、侧栏 3.31%;拖动后正文列 19.23%、侧栏
365
+ 21.41%;点击后正文列 21.65%;淡区关正文列 25.90%;持续拖动 20.0 fps。
366
+ 注意:海面自身的波峰相位会让“覆盖率”随时间大幅摆动——同一页面在完全无
367
+ 输入时,正文列在 7 秒内从 6.4% 漂到 17.9%,所以这张表只适合同口径对比,
368
+ 不能当作交互增量的绝对值;交互是否可读以同相位 A/B 截图为准。
369
+
370
+ 同一 harness 测 `flow`(标准强度,出厂密度 0.65,145×44 网格):静置正文列
371
+ 覆盖 8.42%(淡区把基础场压在 0.15 下限)、侧栏 19.42%;拖动后正文列仍是
372
+ 8.42%(轨迹被同一下限裁住)、侧栏保持完整纹理;点击后正文列 9.48%;持续
373
+ 拖动 20.0 fps、TaskDuration 36.0%。同样是渲染器 canvas 口径。
374
+
375
+ `rain` 同一 harness(193×59 网格):静置正文列覆盖 1.81%、侧栏 3.81%;
376
+ 拖动后正文列 3.02%;点击后正文列 2.65%;持续拖动 20.1 fps、TaskDuration
377
+ 13.4%。
378
+
379
+ `ripple` 同一 harness(145×44 网格):静置正文列 4.30%;拖动后正文列
380
+ 5.76%;点击后正文列 9.48%;持续拖动 20.1 fps、TaskDuration 36.9%。
381
+
382
+ `starfield` 同一 harness(83×25 网格):静置正文列 0.126%;拖动后
383
+ 0.458%;点击后 0.393%;20.1 fps(预设自身节奏),任务占比很低。星爆在
384
+ 淡区外是一团清晰亮点,淡区内被 50% 上限压成小一号的点簇,即「减弱但
385
+ 可见」。
386
+
387
+ 另:harness 的 `crop()` 之前没有把 CSS 坐标乘 DPR,截图区域与点击位置错位,
388
+ 本轮已修正;上面的覆盖率数字取自 canvasStats(本来就按 DPR 换算),不受影响。
389
+
390
+ `liquid` 用另一套口径(headless Edge + SwiftShader,400×320 裁剪、4×4 分块、
391
+ 块内 >8 luma 的比例):关闭避让正文时,纯云层演化 600ms 基线 13.2%;指针
392
+ 移到裁剪区左上角使块 0 变化 **0.334**、移到右下角使块 11 / 15 变化
393
+ **0.866 / 0.946**,涡旋确实跟随指针(位置直接用 70ms 缓动样本)。六次
394
+ splat 的点击在 +140ms 让裁剪区 **86.4%** 的像素变化,+540ms 仍有 91.3%,
395
+ 因为六个不同半径的环都还在穿过裁剪区;开启避让正文(出厂默认)时这些
396
+ 变化在正文列被 0.15 下限整体乘淡,这是淡区契约而不是交互失效。
397
+
398
+ Desktop 0.2.2-rc.1 实测(真实 Electron,窗口 1294×829,ocean soft + 0.6,
399
+ 会话中栏作用域):水面出现在会话正文区域内,文字仍可读;鼠标在正文区移动
400
+ 后,正文列像素变化 **2.54%**、侧栏 **1.85%**、顶栏 **39.28%**(间隔 2 px
401
+ 采样,luma 差 >12);点击后水花可见。截图:
402
+ `F:\tmp\dsh-ocean-desktop\shots\desktop-14-after-move.png` /
403
+ `desktop-15-after-click.png`。这是页面像素 diff,不是渲染器 canvas 口径,
404
+ 不要和上面的覆盖表直接比较。
405
+
406
+ ### 2026-11-09
407
+
408
+ #### Added
409
+
410
+ - **`ocean` 2.0:一片会回应鼠标的海面**。旧的 `ocean` 是两组正弦加固定泡沫,
411
+ 只是一张自走的点阵;现在换成三层场景:散度为零的流场、一个网格分辨率的
412
+ 波高水槽(`bg-wake.ts`,双缓冲波动方程,指针拖动/点击/鱼尾都会注入波峰),
413
+ 以及 18 尾两格小鱼 + 2 尾 28 格大锦鲤。鱼群用 boids-lite(对齐/聚合/分离/
414
+ 绕圈)游动,指针靠近会散开,点击会惊群,之后慢慢重新集结。
415
+ - **指针交互管线**(`bg-pointer.ts`):window 上的
416
+ `pointermove/pointerdown/pointerup/pointercancel/pointerleave/blur` 全部
417
+ `{passive:true}`,不 `preventDefault`、不读布局、不新开 rAF;触摸移动被忽略,
418
+ 触摸点击仍算一次按压;卸载时精确移除这些监听。渲染器每帧把 CSS px 映射成
419
+ 格子坐标,piece 只看到 `AsciiInput`。
420
+ - **两格通道**:`emphasis` 标记交互格(波峰/鱼身),`overlay` 携带鱼的字形
421
+ (小鱼方向、锦鲤身体/边缘/头部/尾巴)。渲染器只为 `interactive` 预设分配
422
+ 这两个缓冲,逐帧清零,overlay 用 `fillText` 在 atlas blit 之后画(约 90 格/
423
+ 帧),并新增 `stats.emphasisCells` / `stats.overlayCells`。
424
+ - **面板文案**:选中 `ocean` 时在预设按钮下方直接说明「海面会随鼠标拖动泛起
425
+ 涟漪,点击溅起水花;鱼群会被惊动,随后慢慢重新聚拢」,不让人靠猜发现交互。
426
+
427
+ #### Changed
428
+
429
+ - **`ocean` 的可见性配方**:从「每个格子一个点」改成「20% 一步底纹 + 噪声等值
430
+ 线波峰」。满格点阵看起来像方格纸,而且会让淡区失效——`buildFocusCaps` 只能把
431
+ 字形降一级,不能删掉一个每格都有的点。现在正文列在静置时 1.32% 覆盖、侧栏
432
+ 2.58%,淡区开/关在真实 shell 里是 2.95% → 1.32%(2.24×)。
433
+ - **淡区协作**:`bg-ascii.ts` 新增 `EFFECT_FOCUS_FLOOR = 0.5`。只有 `ocean` 标记
434
+ 的交互格(正波峰 + 鱼身)可以在淡区内抬到 50% 强度;负波峰不产生墨色,保持被
435
+ 遮罩。`EMPHASIS_WAKE = 0.15` 只认正波高,避免一次拖动把半张网格标成交互格。
436
+ - **点击水花**:点击注入的是偶极环(外圈波峰 + 内圈波谷),不是实心圆盘。旧写法
437
+ 会把 12 格半径内的所有格子顶到墨色上限,看起来像整块变黑而不是涟漪。
438
+
439
+ #### Fixed
440
+
441
+ - **交互不唤醒已停止的渲染器**:`gridInput.active` 只在
442
+ `motion === 'animated' && level < 5 && preset !== 'static'` 时为真;在
443
+ reduced-motion 下实测 pointer move 前后画布保持 1 个状态,paint 0 帧。
444
+ - **许可证留痕**:新增 `NOTICE`,记录 `stackedlol/ascii-sharks`(MIT,
445
+ Copyright (c) 2026 drewdi)的流场形式与 boids 思路,并声明没有复制
446
+ `dsh-ascii-ocean` 的代码(其 LICENSE 只有 12 字节,没有许可正文)。`NOTICE`
447
+ 已加入 `package.json` 的 `files`。
448
+
449
+ #### Measured
450
+
451
+ 真实 DSH web shell 0.2.2-rc.1(Desktop 自带 runtime,隔离 `DSH_HOME`,1280×822
452
+ CSS / DPR 1.5,无头 Edge,首屏 hero 布局;量的是渲染器自己的 canvas,不是页面
453
+ 截图)。hero 布局没有 transcript,淡区按 `measureFocusRect` 的回退规则取输入框
454
+ 跨度、顶边 0;因此静置时「正文列 vs 侧栏」会受波场分布影响,淡区是否生效看同一
455
+ 静置状态的 on/off 对照,不看这一行:
456
+
457
+ | 场景 | 正文列(淡区) | 侧栏 | 右侧留白 | 输入框 |
458
+ |---|---|---|---|---|
459
+ | 静置 | 2.08% | 2.59% | 3.76% | 4.27% |
460
+ | 侧栏拖动后 | 2.42% | 7.03% | 3.01% | 4.79% |
461
+ | 侧栏点击后 | 2.41% | 8.57% | 2.96% | 4.70% |
462
+ | 正文列点击后 | 2.77% | 8.70% | 2.98% | 4.65% |
463
+
464
+ - 淡区开 vs 关(同一静置状态):2.95% → 1.32%,**2.24×**;右/侧栏不变。
465
+ - CPU 代理指标(CDP `TaskDuration` / wall):静置 **29.7%**,持续拖动
466
+ **31.4%**;不是单核 CPU 时间,和上一轮 48.1% 的单核口径不可直接比较。
467
+ - `prefers-reduced-motion`:画布在 pointer move 前后都只有 1 个状态,paint 0 帧。
468
+ - `bgFx:'none'`:`#vx-bg` 不存在,canvas 数 0。
469
+ - 无控制台/page error;面板 toast 显示「Custom 便利套件已就绪」。
470
+
471
+ 同机同口径的渲染器 harness(真实 DOM,headless Edge,126×38 网格)另测得:
472
+ 静置 20.0 fps / TaskDuration 26.5%;拖动 20.0 fps / 27.8%;点击 20.0;
473
+ 同帧淡区关 11.79% vs 开 4.11%。harness 数字只用于定位,不替代上面的活体表。
474
+
475
+ 本轮只动 `ocean`,其余五套字符预设与光影档未改;版本号仍为 0.9.3。
476
+
477
+ ### 2026-11-08
478
+
479
+ #### Fixed
480
+
481
+ - **背景动效"看不见"的真瓶颈(第二轮定性)**:不是墨色不够黑,而是壳把墨色吃掉
482
+ 了。实测(Desktop 1280×822 CSS / DPR 1.5、浅色 天青灰、玻璃开):正文列叠了
483
+ **三层**半透明表面(`--dsw-alias-bg-base` 两次 + `--dsw-alias-bg-layer-1`
484
+ 一次),透到眼睛的墨色是各层 alpha 补集的乘积 —— 0.5 × 0.5 × 0.6 = **10%**,
485
+ 侧栏 24%。162 luma 的墨色阶复合后只剩 16,所以上一轮把 ΔL 从 −0.31 推到 −0.7
486
+ 也只让观感从"几乎无"变成"很浅";玻璃关时表面完全不透明,透过率为 0。
487
+ - **背衬 token 组(替代上一版的纱)**:只要挂载了任意渲染器(玻璃开或关),外观
488
+ 绘制就把上面三个 token 改成色板本色 + `BACKDROP_ALPHA_BASE = 0.25` /
489
+ `BACKDROP_ALPHA_LAYER1 = 0.27` / `BACKDROP_ALPHA_SIDEBAR = 0.27`。补集相乘后
490
+ 正文列透射 ≈ 0.41、侧栏 ≈ 0.40(墨色可见度 4×),而 RGB 与画布底色一致,所以
491
+ 页面色相一点不动,开关差异只剩墨色。卡片、弹窗、菜单、输入框使用自己的不透明
492
+ 填充,不受影响;`-bg-layer-2` / `-bg-overlay` 刻意不碰(它们画菜单,实测没有
493
+ 正文表面压在后面)。`appearanceTokenKey` 的第三维从 `veil` 改名 `backdrop`,
494
+ 面板提示改为"动效开启时页面底色会调成半透明以便透出纹理(卡片和弹窗保持不
495
+ 透明)",仍然不会替用户打开玻璃。
496
+ - **墨色不透明度定标**:`LIGHT_INK_DELTA = −0.7`(浅色表面 234.8 → 墨色 55,
497
+ 179 luma 阶);`DARK_INK_DELTA = +0.15` 不变(DeVries-Rose:暗面等感知点本来
498
+ 就要相对更强的阶,不是同一个数)。
499
+ - **`flow` / `static` 的覆盖面积**:新增 `FLOW_LEVEL_FLOOR = 0.45`,值噪声不再
500
+ 压在 `+` / `*` 这两级(12 px 下每格只有 5.5% / 4.4% 的墨色面积),典型格子上移
501
+ 到 `#`–`%`(12–17%),墨色质量 2–3×。这是"看得见"的主因,ΔL 只是次要项。
502
+
503
+ #### Added
504
+
505
+ - **内容区感应淡出(空间遮罩)**:`src/client/bg-focus.ts` 提供两档渲染器共用的纯
506
+ 几何。淡区是正文读取列(输入框的横向范围 × 从滚动视口顶到输入框顶),每 350 ms
507
+ 重新实测一次并在每次外观重绘时推送,所以 resize、侧栏折叠/展开、面板开合、全屏
508
+ 切换后都跟着文字走。`focusWeight` 用矩形外的对角距离(不是逐轴 `min`)、
509
+ `FOCUS_FEATHER_PX` 羽化、`FOCUS_FLOOR` 下限后 smoothstep,边缘是渐变带而不是
510
+ 硬切;淡区不消失(正文背后仍有极淡纹理)。初版是 116 / 0.3,第 2、4 轮由活体
511
+ 1:1 A/B 重定为 150 / 0.15(见下);矩形形状与"避开正文"的语义未变。ASCII 档用
512
+ `buildFocusCaps` 一次性把每格等级压到 `round(lastLevel × weight + dither)`
513
+ (复用同一 `Uint8Array`,只在网格或淡区变化时重建,绘制循环每格一次查表);
514
+ 光影档新增 `u_focus`(CSS px vec4)+ `u_focusFeather` / `u_focusFloor`,在 GLSL
515
+ 里乘同一个 `focusWeight()`,`u_focus.z <= 0` 即禁用。`grain` 原有径向淡出删除,
516
+ 改由这一层统一(避免两套淡出叠加出双倍宽的边)。
517
+ 实测(背衬 token 组 + `flow`、浅色、标准墨色、1:1 裁切):整页 `>2` luma
518
+ 32.5%(p99 53、均值 5.5),右留白峰值 74、侧栏 61,正文列 3.2%(最大 50、
519
+ 均值 1.05);在渲染器自己的画布上(文字不会落在那里)正文列达到等级上限的像素
520
+ 只有 0.86%,右留白 7.0%、侧栏 9.8%,且随 1280×822 → 1600×1000 → 复原的 resize
521
+ 跟着移动。`liquid` 整页 77.6%(p99 51)。
522
+
523
+ #### Changed
524
+
525
+ - **淡区改取输入框跨度(第四轮修正,取代第二轮)**:第 2 轮把横向从输入框 x 跨度改成
526
+ 转写视口的 content box(`scrollLeft + clientWidth`),实测 1280×822 得到
527
+ `x 280..1273`(993 px)。但正文块只有 `x 437..1112`(675 px),两侧 157/161 px
528
+ 是没有文字的**可见留白**(gutter),整块内容面因此都压在下限上:遮罩在数值上成立
529
+ (画布上正文列 0.0151 vs 侧栏 0.0599 = 3.96×、覆盖 9.6% vs 24.2%),观感上却是一
530
+ 片平 —— 页面级 A/B(遮罩开 vs floor=1)几乎读不出差别,用户反馈的"好像并未生效"
531
+ 就是这个状态。第 4 轮把横向改回输入框跨度(`x 421..1129`,708 px,与文字测量每侧
532
+ 差 16 px 以内),留白重新拿到满强度纹理,而任何字形都不会落到淡区之外。输入框既是
533
+ 锚点也是横向来源(定位滚动祖先并给底边),hero 布局(无滚动祖先)回退到输入框跨度
534
+ + 视口顶 0。
535
+ - **`FOCUS_FLOOR` 0.45 → 0.15(第四轮)**:0.45 是在矩形覆盖整个内容视口时定的;
536
+ 换成输入框跨度后,"四处都有 45% 墨量"没有任何参照,等于把差别抹平。下限降到 0.15
537
+ 后正文段落实测 0.0060 mean / 4.75% 覆盖(static flow),侧栏 0.0744,同一画布上
538
+ 浓淡比由 3.96× 变成输入框外留白约 6.5×(推算,见"实测"条);0.3 的旧 A/B 结论
539
+ ("等同干净页、只触及 4.2% 画布像素")是在视口矩形下得到的,不再适用。
540
+ - **`FOCUS_FEATHER_PX` 保持 150(220 A/B 否决)**:0.45 时期把 116 提到 150 是因为
541
+ 116 在约 40 device px 内走完 `@`→`%`→`*`、读成一条缝。第 4 轮试过 220:羽化带宽
542
+ 超过可见留白(约 141 px),满强度被推到内容面之外,实测留白平均墨量 0.0141、对
543
+ 正文列 0.0060 的比值只有 2.37× —— 比 150 更弱。150 时留白外缘的 `focusWeight`
544
+ 已到 0.97,眼睛看得见的那段宽度里正好走完 0.15 → ~1。
545
+ - **新增「避让正文」开关(`bgFocus`,默认打开)**:扁平 boolean 字段,`normalizeCfg`
546
+ 按默认值做类型兜底(旧存档缺字段或值不是真 boolean 都读作 `true`,不做迁移弹窗)。
547
+ 关闭时 `focusRectFor` 返回 `null`,这是两档渲染器收到的唯一输入:不调
548
+ `buildFocusCaps`、不传 `u_focus`、外观重绘推送 `null` 并停掉 350 ms 测量轮询 ——
549
+ 刻意不是"把下限设成 1 继续照算"。面板上它位于「墨色强度」下方,离散保存(取消
550
+ 待发防抖后立即 POST)并即时生效,副说明为"打开时内容区域会更淡、四周更浓;关掉则
551
+ 整页均匀。";它不属于 `resetBgParams` 重置的六个参数,所以「恢复默认参数」不会
552
+ 在用户背后把遮罩重新打开。
553
+ - **椭圆淡区被 A/B 否决**:同一 floor 下椭圆把正文列左上 120 px 的墨色覆盖率推到
554
+ 25.9%(软矩形 11.1%)、右下 16.0%(矩形 8.4%),即首行文字压在全强度 `@` 上。
555
+ 保留矩形 + 对角羽化。
556
+ - **实测(第四轮;渲染器自己的画布,浅色 天青灰、标准墨色、`static`、输入框跨度 rect
557
+ `421,116,708,586`)**:在 1280×822 / DPR 1.5 的活体宿主上,正文段落 mean
558
+ 0.00597 / 覆盖 4.75% / 峰值 0.4405,左右留白 0.01415 / 0.01382(对正文列
559
+ **2.37×**),侧栏 0.07443 / 27.4%,头部 0.01119 —— 这组是羽化 **220** 的读数,
560
+ 正是它否决了 220。收尾时宿主无法启动,羽化 150 的最终值改用等价的离线夹具复测
561
+ (真实 `bg-ascii` 模块 + 真 DOM + 1280×822 / DPR 1.5,夹具复现出与活体完全相同
562
+ 的 0.00597 / 4.75%):正文列 mean 0.00597,左留白 0.02288,侧栏 0.0740,头部
563
+ 0.01083 → **侧栏/正文列 = 12.39×、左留白/正文列 = 3.83×**;沿 x 281→461 每
564
+ 20 px 的剖面在关闭态是 0.0455 / 0.0375 / 0.0269 / 0.0233 / 0.0332 / 0.0323 /
565
+ 0.0305 / 0.0299 / 0.0385 / 0.0428(只有画面本身的起伏,没有斜坡),开启态是
566
+ 0.0455 / 0.0375 / 0.0249 / 0.0201 / 0.0104 / 0.0138 / 0.0053 / 0.0043 / 0.0036 /
567
+ 0.0097 —— 最外两格不动、进列单调塌下去,这就是"边缘浓、正文处淡"的数值形状。
568
+ - **关闭态(`bgFocus:false`)实测(同一夹具)**:正文列 mean 0.05672 / 覆盖
569
+ 23.08%、左留白 0.03486、侧栏 0.07399;与开启态同区域相比,正文列 0.0567 → 0.0060
570
+ (**9.5×** 下降)、左留白 0.0348 → 0.0229(1.5×)、侧栏 0.0740 → 0.0740(不变)——
571
+ 遮罩完全不参与,剩下的是画面自己的起伏(关闭态留白/正文列 0.61×、侧栏/正文列
572
+ 1.30×,没有斜坡)。正文对比度按单调性论证:0.45 时实测开启态 14.32:1、关闭态
573
+ 14.46:1,0.15 让正文背后的底色更接近表面,开启态只会更好,仍远高于 13.5:1。
574
+ - **六套预设抽查(同一夹具、DPR 1.5、输入框跨度 rect、羽化 150;开启态覆盖率 / 关闭
575
+ 态覆盖率 = 存活率)**:`flow` 与 `static` 4.75% / 23.08% = 0.21、`rain` 3.33% /
576
+ 7.68% = 0.43、`ocean` 1.16% / 2.65% = 0.44、`starfield` 0.09% / 0.42% = 0.21、
577
+ `ripple` 4.98% / 9.21% = 0.54。没有一套被压成全空白:`ocean` 的正文列墨量 0.0002
578
+ 本来就近乎不可见(关闭态也只有 0.0054,约 1.4 raw luma),`starfield` 依旧稀疏
579
+ 但仍在(关闭态 0.42% → 开启态 0.09%,与第 3 轮"偏弱"格同因)。
580
+ - **第三轮页面级数据(旧 rect/视口跨度,仅作历史对照)**:整页 `>2` luma
581
+ 31.0%(p99 47、均值 4.25);侧栏 94.6%(均值 7.8)、头部 48.9%、正文列 9.4%
582
+ (均值 3.0、最大 96)。渲染器画布上正文列墨色覆盖率 10.2%,侧栏 25.9%,列上方
583
+ 11.0%。`liquid` 整页 74.4%,正文列 77.1%(连续场,淡区读成整面薄雾而非字形
584
+ 纹理,判定为该档的真实形态)。
585
+
586
+ #### Verified
587
+
588
+ - **第三轮交叉矩阵(48 格:6 套字符 + 2 套光影 × 浅/深 × 柔和/标准/明显;Desktop
589
+ 1280×822、DPR 1.5)**:遮罩与强度是两条独立轴 —— 浅色 `flow` 三档的正文列/侧栏
590
+ 墨色比恒为 0.39 / 0.40 / 0.40,而墨量从 2.49 luma 涨到 3.85,下限既不被强度放大
591
+ 也不被抵消。逐件存活(浅色、渲染器画布:正文列 vs 左侧,覆盖率 / 墨量):`flow`
592
+ 与 `static` 10.2% vs 25.8%(0.017 / 0.065)、`rain` 6.5% vs 7.8%、`ocean` 2.5%
593
+ vs 3.7%(墨量 0.004 / 0.010)、`ripple` 8.3% vs 8.1%(等值线在羽化带里没有被切
594
+ 碎)、`starfield` 0.1% vs 0.2%。`starfield` 是**唯一"偏弱"格**:该件本来超过
595
+ 半数空白且不开抖动,低等级格在淡区被 `round()` 压到 0,只剩约十颗亮星;判定为
596
+ "变淡但没消失",**不给它单独开淡区下限** —— 那会让每一件都有资格退出遮罩,且
597
+ 整张定标表要重测一遍,代价大于收益。
598
+ - **两把尺子的适用范围**:ASCII 的画布覆盖率尺子只对浅色有效(它假设墨比表面暗,
599
+ 深色墨更亮,会读出 98–100% 的假覆盖率);深色改用页面级文字外差值,八件落在
600
+ 0.29–0.65,遮罩都在,只是墨量本身小、粒度粗。**页面级 `|on−off|` 均值同样不能
601
+ 当遮罩尺子**:侧栏被不透明卡片稀释会把 `grain` 的比值读成 0.90,而它自己的画布
602
+ 上正文列中位 208.7、侧栏 178.9、未上墨表面 234.7 → 0.46,正好是下限;`grain` 的
603
+ 场本身把整页中位压暗约 31 luma,那是该档的真实形态(整面薄雾),不是遮罩失效。
604
+ - **光影档边缘与静态帧**:`u_focus` 相乘后无硬过渡 —— 无文字带 y650..690 的相邻
605
+ luma 阶最大 8.0(均值 7.3);`grain` 单帧即带遮罩,三张间隔 1.2 s 的截图逐像素
606
+ 相同,1100×760 resize 后重绘的帧同样带遮罩 —— 不是"首帧按全强度画完再没重画"。
607
+ - **性能(同机、1280×822:空闲 20 s / 滚动 6 s / 伪流式 6 s)**:`none` 空闲 CPU
608
+ 0.3%、无 rAF、长任务 0;`ascii` 空闲 24 fps / CPU 48.1% / script 33.6% / 长任务 0
609
+ (成本来自既有的逐格 `drawImage` 11.98 ms,遮罩只是同一循环里多一次查表:
610
+ 23,040 格实测 −0.02 ns/格即噪声内,`buildFocusCaps` 重建 0.103 ms 且每 350 ms
611
+ 才一次);`shader` 空闲 CPU 8.3% / script 1.3% / 帧时长 p95 0.2 ms / 长任务 0。
612
+ - **可读性**:正文对比度浅色 14.46(关)→ 14.32(开,三档同值),深色 2.29 → 2.30。
613
+ - **卸载往返(关→开→关)**:三轮完全对称,节点 1842/1844/1842、`#vx-bg`
614
+ 0/1/0、canvas 1/2/1、`setInterval` 2/3/2、window 监听器 31/31/31、document
615
+ 36/37/36、主题 token 回到 `rgba(233,235,238,0.5)`、body 背景回到实色,无泄漏。
616
+
617
+ #### Tests
618
+
619
+ - `tests/bg-focus.spec.ts`:矩形归一化/相等、对角羽化、零羽化硬边、
620
+ `buildFocusCaps` 的限幅与缓冲复用;新增 `focusRectFor` 组(`undefined`/`true`
621
+ 透传、`false` 返回 `null`,即开关关闭时渲染器拿不到任何矩形),以及
622
+ "正文列压到 ≤2、留白保持满强度 9"的端到端断言。带宽用例改为 `FOCUS_FLOOR`
623
+ 0.10–0.20 / `FOCUS_FEATHER_PX` 120–180,仍是区间而不是精确值。
624
+ `tests/state.spec.ts` 新增"缺字段 / 非 boolean 一律读作 true、`false` 原样保留"
625
+ 的 `bgFocus` 用例;`tests/bg-shader.spec.ts` 增加 `u_focus`
626
+ 映射与 `setFocus` 只重绘一次的用例;`tests/palette.spec.ts` 覆盖 `backdrop`
627
+ 维度的四种 key 形状;`tests/bg-ascii.spec.ts` 新增 `FLOW_LEVEL_FLOOR` 下限与
628
+ 均值用例(防止后续"调淡"把格子压回空白半边),并把墨色阶定标带宽改到
629
+ −0.7(165–195 luma);`tests/bg-params.spec.ts` / `tests/bg-layer.spec.ts`
630
+ 跟随 liquid 强度上限与中性底色改动。
631
+
632
+ ### 2026-11-06
633
+
634
+ #### Added
635
+
636
+ - **背景动效骨架(默认关闭)**:扁平配置 `bgFx: 'none' | 'ascii' | 'shader'`
637
+ (默认 `'none'`),以及 `src/client/bg-layer.ts` 的决策门
638
+ (关闭 / 无 2D canvas / `animated` / `static` / `paused`)、幂等挂载/卸载与主题取色。
639
+ 层是 `<body>` 下的 `div#vx-bg`(`position:fixed; z-index:-1; pointer-events:none;
640
+ aria-hidden`),由 `applyAppearance` 同步、插件 disposer 移除;默认关闭时不含
641
+ canvas、rAF 或第三方库,也不改变任何可见像素。
642
+ - **ASCII 渲染器(Phase 2)**:`src/client/bg-ascii.ts` 在 `#vx-bg` 内挂一块 canvas。
643
+ 效果函数只向复用的 `Uint8Array` 写等级(不产出字符串),glyph 按等级预烘焙进
644
+ 单块 atlas(单一墨色 `inkFor`,ΔL 0.13;level 0 恒为空白字形,主题只换墨色),
645
+ 每帧仅一次 `fillRect` + 每非空格一次 `drawImage`,无逐帧小分配。网格由实测等宽
646
+ 字体的 `advance` 定 cell(`cellH = fontPx × 1.15`),DPR 上限 2,`density` 乘在
647
+ cell 尺寸上,`cols/rows` 硬上限 240/96 且超限时放大 cell 而不是截断。先只提供
648
+ `flow`(默认可动)与 `static`(一次性静止帧,零 rAF);系统预设与自定义面板留待
649
+ 下一阶段。
650
+ - **ASCII 系统预设(Phase 3a)**:新增 `rain` / `ocean` / `starfield` / `ripple`
651
+ 四套独立效果(各自一种画面语言,不是同一算法换参数):`rain` 逐列下落雨丝
652
+ (亮头 + 二次淡出拖尾、14% 空列、16 级 `classic` ramp);`ocean` 低频横向波涌
653
+ + 固定泡沫点(`dots` + 抖动);`starfield` 稀疏视差星场(空白格 >50%,不开
654
+ 抖动);`ripple` 三固定中心同心环(`CELL_ASPECT = 1.9` 校正单元纵横比、关抖动
655
+ 保等值线)。墨色仍只由 surface 亮度按固定 ΔL 派生,浅色/深色与全部色板下都成立,
656
+ 没有霓虹或高饱和撞色。每套 spec 附带可写的 `ranges`(`density`/`speed`/`fps`/
657
+ `fontPx`/`opacity` 上下限)与默认值,留给下一阶段的自定义面板;配置仍是扁平
658
+ boolean/number/string。
659
+ - **Shader 档(Phase 3b,WebGL1)**:`src/client/bg-shader.ts` 用一块 WebGL1
660
+ 上下文、一个全屏三角形(`[-1,-1, 3,-1, -1,3]`)与内联 GLSL 实现 GPU 背景,
661
+ 零第三方依赖。uniform 契约固定为 `u_time` / `u_resolution`(CSS px)/
662
+ `u_dpr`(≤2)/ `u_surface` / `u_ink` / `u_speed` / `u_density` /
663
+ `u_intensity` / `u_seed`,`shaderUniforms` 逐项夹紧到 `SHADER_UNIFORM_RANGES`。
664
+ 两套画面语言:`liquid` 低频 domain-warp 墨云(3 octave fbm + 竖向呼吸,
665
+ 24 fps 可动)、`grain` 静态细颗粒(CSS 像素网格 + 低频雾 + 边缘渐隐,零 rAF)。
666
+ 墨色仍由 `inkFor(surface, isDarkSurface(surface))` 派生(浅色固定 ΔL 0.13、
667
+ 深色 +0.20),浅色/深色与全部色板下都成立,没有霓虹或高饱和撞色。两档互斥:
668
+ 切换经 `swapBgRenderer` 先建后拆,离开 shader 档删除 program/buffer 并
669
+ `WEBGL_lose_context`;`static` 与 `prefers-reduced-motion` 只画首帧,页面隐藏
670
+ 停 rAF 并冻结时间;WebGL 探测失败、编译失败或运行中上下文丢失都回退 ASCII,
671
+ 并以 toast 明示(每页一次),不会静默换成另一种画。`bgFxPreset` 仍是单个扁平
672
+ 字段,按当前档位单向收窄。
673
+ - **背景动效面板(Phase 3c)**:`AppearanceTab` 内新增档位(关闭 / 字符 / 光影)、
674
+ 预设选择、参数滑块与「恢复默认」。六个扁平字段 `bgDensity` / `bgSpeed` /
675
+ `bgFps` / `bgFontPx` / `bgOpacity` / `bgIntensity`(`-1` 表示跟随预设),面板
676
+ 写入前按当前预设声明的 `ranges` clamp,渲染器 `resolveAsciiSpec` /
677
+ `resolveShaderSpec` 再夹一次;字符档显示 5 项,光影档显示 4 项(字号/浓度
678
+ 不适用),未知预设随档位回落到该档默认值。拖动滑块即时写入存储并重绘,POST 经
679
+ 320 ms 防抖只发一次;换档、换预设与恢复默认立即保存并取消待发请求。玻璃关闭时
680
+ 面板明确说明背景被不透明内容层完全遮住,且不会替用户自动打开玻璃。面板只在
681
+ 弹层/设置页打开时挂载,`AppearanceTab` 仅订阅 `cfg` 与 `dark`。
682
+ - **固定降级阶梯(只降不升)**:L1 fps 24→15、L2 密度 ×0.75、L3 单色(ASCII 档
683
+ 已是单墨色)、L4 关抖动、L5 画一帧后停 rAF、L6 只留底色。60 帧滑窗均值超过
684
+ `budget × 1.6` 记为坏窗,连续 2 个坏窗降一档;好窗抵消一个坏窗;切换预设回到
685
+ L0。L6 不在自动路径上(L5 已停 rAF),仅保留给显式关闭路径。
686
+ - **动效生命周期与回收**:读取 `data-vx-bg-motion` 与 `--vx-bg-tint`;
687
+ `visibilitychange` 隐藏时停 rAF 并冻结累计时间,返回时立即补画一帧;
688
+ `prefers-reduced-motion` 与 `static` 预设都只画静止帧;主题切换重建 atlas 并立即
689
+ 重绘。卸载回收 canvas、rAF、resize 定时器、`visibilitychange`、reduced-motion 与
690
+ resolution 查询、`ResizeObserver`、atlas/probe 画布和等级缓冲,并已并入
691
+ `custom.tsx` 底部 disposer。
692
+
693
+ #### Changed
694
+
695
+ - **「恢复默认参数」语义写明**:按钮只把六个扁平参数恢复为 `-1`
696
+ (「跟随当前预设」),档位与预设保持不变——点一下不该突然换画。按钮改名为
697
+ 「恢复默认参数」,`title` 提示与按钮旁的灰字(「仅重置参数,不改档位与预设」)
698
+ 都把这条语义写在面板里;`resetBgParams` 行为本身未变(已有单测覆盖档位/预设/
699
+ 玻璃字段原样保留)。
700
+ - **背景配置改为枚举**:`bgFx` 从布尔迁移为 `'none' | 'ascii' | 'shader'`
701
+ (默认 `'none'`;旧存档 `true → 'ascii'`、`false → 'none'`,未知值回落
702
+ `'none'`),`bgFxPreset` 改为一个承载两档 id 的扁平字段:ASCII 档
703
+ `flow`/`rain`/`ocean`/`starfield`/`ripple`/`static`(默认 `flow`),shader 档
704
+ `liquid`/`grain`(默认 `liquid`)。`normalizeCfg` 按当前档位单向收窄,跨档或
705
+ 未知 id 回落当前档默认值。挂载门按档位判定:shader 需要 WebGL1,只有 2D
706
+ canvas 时同层回退 ASCII;`body` 只在背景真正挂载时透明,`bgFx:'none'` 与
707
+ 渲染器落地前的页面逐像素一致(活体 A/B 实测差 0)。
708
+
709
+ - **等级语义统一(修正 Phase 2 浅色主题反转)**:level 0 在浅色与深色主题都渲染为
710
+ 空白字形,ramp 只随等级增加墨密度;主题切换只换墨色(`inkFor`),不再反转字形
711
+ 与 alpha 斜坡。此前浅色主题会把空白格画成最密字形,导致 `rain`/`starfield`
712
+ 的空白帧被铺满(rain 每帧 14,010 次 blit);修正后 rain 3,490、starfield 280。
713
+ - **预设切换复用**:`setPreset` 只重置降级阶梯,复用同一 canvas、等级缓冲与网格;
714
+ atlas 仅在 key(charset/ink/theme/dpr/tile 尺寸/fontPx/opacity)变化时重建,
715
+ 切换后立即按当前 motion 补画一帧(静止档停 rAF,动效档重启 rAF),不会白屏或
716
+ 残留上一套的帧。
717
+ - **面板不再挡输入区(Round 2)**:新增 `src/client/panel-bounds.ts`(纯几何,
718
+ 未依赖 DOM)——`pickComposerTop` 从当前页面的输入框里挑最靠下且尺寸合理的那个,
719
+ `panelFrame` 把面板夹进可视区、并把高度截到 `输入框顶 − 10px`
720
+ (`COMPOSER_CLEARANCE`)。会话头部的弹框改用它:默认位置右上、高度随窗口变,
721
+ 1280×822 下实测 `774..1204 × 74..692`,输入框 top=702,不重叠;拖到窗口外会被
722
+ 夹回可见范围。`Escape`(面板内键)与点击面板外都会关闭,清理时把焦点还给触发
723
+ 按钮(关闭后 `activeElement` 回到 `.vx-header-btn`)。面板是 `role="dialog"` +
724
+ `aria-modal="false"`,Tab 不设陷阱,顺序仍在面板内。11 个几何单测在
725
+ `tests/panel-bounds.spec.ts`。
726
+ - **弹窗遮罩对齐原生(Round 2)**:`.vx-modal-mask` 由 `rgba(8, 10, 16, .4)` 改为
727
+ `.25`。Desktop 1280×822 实测,原生确认框把页面压到原亮度的 0.764,插件弹窗
728
+ 原本是 0.616,两者并排能看出"多盖了一层";改后为 0.762。色相本来就一致,只调
729
+ alpha,不改任何画面数值。
730
+ - **深色墨色加深(Round 2)**:`DARK_INK_DELTA` 从 0.11 提到 0.20(浅色仍 −0.13)。
731
+ 深色色板下内容面 0.5–0.7 alpha,阅读列只剩 8–13% 墨色,旧值实测只差 2 luma,
732
+ 表现为"完全平板";新值在同口径 on/off 差分下把背景贡献从 2.2 luma 提到 4.2–4.3
733
+ (std 0.33 → 0.54–0.68),纹理出现但仍低饱和、不发脏。
734
+ - **档位文案改为「关闭 / 字符 / 光影」(Round 2)**:面板不再把实现名词摆到用户
735
+ 面前(原「WebGL」);说明改成"整页铺一层很淡的背景动效,垫在内容下面,不挡任何
736
+ 操作";帧率滑块的 `fps` 单位去掉(标签已写「帧率」);回退 toast 与玻璃关闭提示
737
+ 同步改写。
738
+ - **面板内拖参数不再触发全文档重算(Round 3)**:外观绘制改为按
739
+ `appearanceTokenKey(bg, glass)` 去重——滑杆每动一次都会重跑 `applyAppearance`,
740
+ 但色板与玻璃没变时不再重新注册同一套主题 token;`setDynCss` 同时改为文本未变就
741
+ 跳过写入(原实现每次重写约 21k 字符的样式表,触发全文档 style recalc)。
742
+ Desktop 真机、同口径(同一 6.5 s 拖动、同一插桩):长任务 21 个 / 2,375 ms →
743
+ 11 个 / 813 ms,`documentpreview` 与侧栏 `layout` 从热点列表消失;剩余成本是
744
+ atlas `drawImage` 搬运(968 ms / 37%)。新增 `appearanceTokenKey` 单测
745
+ (三形态分离、玻璃折入 key、同输入稳定)。
746
+
747
+ - **构建与测试队列切到 dsh 0.2.1-rc.5**:九个 `@deepseek-ai/dsh-*` devDependencies
748
+ 从 0.2.1-rc.3 升到 0.2.1-rc.5;`pnpm-workspace.yaml` 为同日发布的 35 个
749
+ `@deepseek-ai/dsh-*@0.2.1-rc.5` 包补 `minimumReleaseAgeExclude`(未删旧条目),
750
+ 锁文件只做同名包版本替换。类型检查、214 单测、build、smoke 全绿;构建产物与
751
+ 已发布的 0.9.3 逐字节一致(`lib/client.js` sha256 `984e1b6c…`、
752
+ `lib/index.js` `88dc8166…`),因此没有重发 0.9.3。
753
+ - **rc.5 事实同步**:README 双语兼容表与桌面段、AGENTS 的桌面钉版事实更新到
754
+ 0.2.1-rc.5;`tests/manifest.spec.ts` 与 `scripts/smoke.mjs` 的版本探测点补
755
+ rc.4/rc.5;`tsdown.config.ts` 注明 11 项 seed 表在 rc.5 上未变。
756
+
757
+ #### Verified
758
+
759
+ - 已发布 0.9.3 在隔离 dsh 0.2.1-rc.5 profile 中安装并冷启动:boot 图 71 行、
760
+ 五个 `dsh.client.inject` 目标齐全、客户端 bundle 服务 208,217 字节、Mermaid
761
+ 本地引擎 3,572,661 字节;活体探针 16 通过 / 1 跳过(无会话)。
762
+ - 真实桌面版 0.2.1-rc.5(运行中的 Host)桌面形态探针 11 通过 / 0 失败;1 项
763
+ 会话相关链路因尚无宿主注册会话跳过。探针前后状态文件逐字段一致。
764
+ - 平台 seed 表 11 项与 `PLATFORM_MODULES` 完全一致(从 Desktop asar 的
765
+ `dsh-web-frontend` bundle 读取)。
766
+ - 背景 ASCII 渲染器在隔离 dsh 0.2.1-rc.5 活体宿主(1440×900,有会话)实测:
767
+ `flow` 空闲 10 秒 24.27 fps、帧间隔 p50 41.1 ms / p95 45.4 ms / max 45.8 ms,
768
+ 0 掉帧、0 long task;6 秒连续滚动 24.33 fps、p95 45.5 ms、0 掉帧;6 秒逐字
769
+ 流式追加 24.51 fps、p95 45.5 ms、0 掉帧。隐藏 2.5 秒内 0 帧,返回后立即恢复
770
+ 24 fps;`prefers-reduced-motion`/`static` 档 3 秒 0 帧但保留静止画面。DPR 2 与
771
+ 3 均按 2 渲染(backing 2880×1800)。关闭 `bgFx` 后 `#vx-bg` 与 canvas 消失,
772
+ `body` 回到 `rgb(233,235,238)`,全页与渲染器落地前基线逐像素差 0。
773
+ - ASCII 六档预设在同一隔离 0.2.1-rc.5 活体宿主(1440×900,DPR 1,浅色)逐套实测
774
+ (每套 POST 配置后 reload,空闲 10 秒 + 6 秒合成滚动):`flow` 23.98 fps、
775
+ p95 48.6 ms、每帧 7,490 blit;`rain` 23.98 fps、p95 42.8 ms、3,490 blit;
776
+ `ocean` 20.58 fps、p95 49.7 ms、3,009 blit;`starfield` 14.41 fps、p95 70.5 ms、
777
+ 280 blit;`ripple` 20.58 fps、p95 55.7 ms、7,824 blit。全部 0 掉帧
778
+ (>100 ms / >150 ms 均为 0)、0 long task;`ocean`/`starfield`/`ripple` 的低帧率
779
+ 是预设自定的节奏(20/15/20 fps),p95 与目标帧间隔一致,不是性能受限。
780
+ 浅色/深色与各色板截图逐套留存;像素亮度 min 202–206、max 235,墨色随 surface
781
+ 派生,无高饱和撞色。
782
+ - Shader 两套风格在同一隔离 0.2.1-rc.5 活体宿主(1440×900,DPR 1,有会话)逐套
783
+ 实测(POST 配置后 reload,空闲 10 秒 + 6 秒合成滚动):`liquid` 空闲 240 帧
784
+ (23.98 fps),帧间隔 p50 41.7 ms / p95 42.7 ms / max 48.6 ms;滚动 144 帧
785
+ (23.98 fps)、p95 42.1 ms / max 49.0 ms;两项 0 掉帧(>100 ms / >150 ms 均为
786
+ 0)、0 long task。`grain` 声明 `animated:false`:挂载后空闲 10 秒 0 次
787
+ `drawArrays`,6 秒滚动同样 0 次(首帧即停);`liquid` 配
788
+ `prefers-reduced-motion` 时 `data-vx-bg-motion="static"`,6 秒 0 次绘制。
789
+ DPR 1 下 backing 1440×900,实际后端由 `WEBGL_debug_renderer_info` 读到
790
+ `ANGLE (NVIDIA GeForce RTX 5070 Laptop GPU, Direct3D11 vs_5_0 ps_5_0)`(只取
791
+ 后端名,不报占用率)。像素亮度:`liquid` min 219 / max 235 / std 5.2(ASCII
792
+ `flow` 为 std 5.48),`grain` min 215 / max 235 / std 4.4;浅色/深色截图逐套留存。
793
+ - 无 WebGL 回退实测(同一宿主,页面脚本执行前把 `getContext('webgl')` 全部返回
794
+ null):`bgFx:'shader'` 下只创建 1 个 ASCII canvas、0 个 shader canvas,toast
795
+ 显示“当前环境无法创建 WebGL 背景,已回退到字符动效。”,ASCII 的 `fillRect`
796
+ 1.2 秒内 44→73(约 24 fps),`body` 透明但有画,无空背景。运行中上下文丢失
797
+ 实测:对真实 context 调 `loseContext()`,120 ms 内 shader canvas 0、ASCII
798
+ canvas 1、toast 出现,随后持续绘制;旧 handle 的 destroy 再调一次
799
+ `loseContext` 完成回收(计数 1→2,未重复丢失同一 context)。
800
+ - `pnpm check:readme`、`pnpm typecheck`、`pnpm test`(243)、`pnpm build`、
801
+ `pnpm smoke` 全绿。
802
+ - Phase 3a 后:`pnpm typecheck`、`pnpm test`(251,29 个文件,`bg-ascii` 23 项)、
803
+ `pnpm build`(`lib/client.js` 240.98 kB)、`pnpm check:readme`、`pnpm smoke`
804
+ 全绿。
805
+ - Phase 3b 后:`pnpm check:readme`、`pnpm typecheck`、`pnpm test`(280,30 个文件,
806
+ 新增 `bg-shader` 20 项、`bg-layer` 档位判定与先建后拆 8 项、`state` 跨档收窄)、
807
+ `pnpm build`(`lib/client.js` 264.65 kB / gzip 69.75 kB)、`pnpm smoke` 全绿。
808
+ - Round 2(无感融入,Desktop 0.2.2-rc.1 / 1280×822 / DPR 1.5 实测):
809
+ - 面板几何:新 build 下 `774..1204 × 74..692`,composer 文本 top=702 →
810
+ `overlapH = −10`;拖到 (1250,700) 被夹成 `bottom ≤ composerTop − 9`;窄窗
811
+ (420) 收成 396 宽。`Escape` 关闭后 `activeElement` 是 `.vx-header-btn`;点
812
+ (320,400) 空白处关闭后同样回到触发按钮;Tab 连按 18 次焦点未离开面板。
813
+ - 切换中间帧(CDP screencast 逐帧采样):关→字符 `232.6→231.5`(单帧 1.1)、
814
+ 字符→光影 `231.5→232.1`(单帧 1.0,切换帧 diff 3.71 后回落 0.02/帧)、
815
+ 光影→关 diff 全 0;色板 天青灰→淡金 单帧 4.9;主题 浅→深 单帧 209.3→32.4、
816
+ 无中间值帧。所有帧 `mainStd ≥ 10.2`,没有空白帧、没有"深色底 + 浅色画布"
817
+ 残留帧。
818
+ - 采样 20 组色板(浅色 6 组 ΔL .110–.126,深色 6 组 .174–.185,浅色 meanSat
819
+ .004–.068)。现有 20 组色板全部低饱和,没有真正的高对比极端色板,该极端项
820
+ 无从抽样——结论如实记为"不存在",不用人工高饱和组合去补数。
821
+ - 原生确认框(临时工作区 `删除工作区` → 取消,用户工作区未删)与 `vx-confirm`
822
+ 叠在背景上的像素采样:遮罩前后亮度比 0.764(原生)/ 0.762(插件);遮罩下
823
+ 背景纹理保留 `range 66` vs `65.1`(差 2.7%);原生对话框面 211.2、正文最低
824
+ 16.9,插件玻璃框面 226.2、正文最低 35.9。临时文件夹已删净。
825
+ - `pnpm check:readme`、`pnpm typecheck`、`pnpm test`、`pnpm build`、
826
+ `pnpm smoke` 全绿。
827
+
828
+ ## 0.9.3 — 2026-10-26
829
+
830
+ ### Changed
831
+
832
+ - **浮层/文件夹节点订阅收窄**:`OverlayRoot` 只选它渲染的 14 个字段(overlay/config/
833
+ theme/session),`FolderNode` 只选 `folderAdd` / `folderWsPick` / `dropHint`;
834
+ 整店 `useS()` 从 19 降到 17。流式/用量/toast 写入不再重渲染整个浮层树或每个文件夹
835
+ 节点。
836
+
837
+ ### Verified
838
+
839
+ - 0.9.3 tarball 装进隔离的 dsh 0.2.1-rc.3 profile(无兼容豁免)并冷启动;活体探针
840
+ 全部通过,1 项因无会话跳过(时间线/导出/搜索,由单测覆盖)。
841
+ - `pnpm check:readme`、`pnpm typecheck`、`pnpm test`(214)、`pnpm build`、`pnpm smoke`
842
+ 全绿。
843
+
844
+ ## 0.9.2 — 2026-10-26
845
+
846
+ ### Changed
847
+
848
+ - **无障碍与电池**:天气特效尊重 `prefers-reduced-motion`(减少动态时不启动
849
+ 动画帧),装饰画布加 `aria-hidden`;余额 60 秒轮询在页面隐藏时暂停、回到前台
850
+ 立即刷新;6 个浮层补齐 `role="dialog"` / `aria-modal`、焦点进入、Tab 陷阱、
851
+ Escape 关闭与关闭后的焦点恢复;余额入口改为可键盘操作的 `role="button"` 并带
852
+ `aria-expanded` / `aria-haspopup`,关键图标按钮补 `aria-label`。
853
+ - **顶栏重渲染**:`HeaderBalance` 从整店订阅改为只选余额、今日用量行与面板开关,
854
+ 并对今日次数/费用做 `useMemo`;流式回合的 store 写入不再重渲染顶栏或重算台账。
855
+ - **常驻组件订阅收窄**:`MermaidInPlace`、`QuoteDock`、`QuoteButton`、`Toasts`
856
+ 同样改为 `useSSelector`;它们大多时候渲染 null 或很小,不再被流式/用量写入唤醒。
857
+ 剩余 19 个 `useS()` 多为打开时才挂载的面板,待逐项 profile。
858
+
859
+ ### Tests
860
+
861
+ - Mermaid 渲染从 `src/client/custom.tsx` 抽到独立的 `src/client/mermaid-render.ts`;
862
+ `pnpm smoke` 现在用真实 Mermaid 引擎在无头 Edge 中覆盖失败路径(无效代码不残留
863
+ `body > div#dvx-mmd-*`、有效图渲染、旧错误卡清理、引擎缺失干净失败),并新增
864
+ `tests/mermaid-render.spec.ts` 9 个单测。反证:撤掉 `suppressErrorRendering` 与
865
+ 清理后 smoke 恰好红 2 项,还原后全绿。
866
+ - 扫描逻辑抽到 `src/client/mermaid-scan.ts`,smoke 增加 5 项 wrapper / 失败回退 /
867
+ 切换 / 主题翻转 / restore 断言;新增 `pnpm bench:mermaid` 合成长回合基准。
868
+ 结论:1000 块时 warm p95 ≈2.8 ms,扫描收窄收益可忽略;真实 Mermaid ≈10 ms/图,
869
+ 懒渲染只在单回合大量图时有意义,暂不引入。
870
+
871
+ ### Verified
872
+
873
+ - 0.9.2 tarball 装进隔离的 dsh 0.2.1-rc.3 profile(无兼容豁免)并冷启动;活体探针
874
+ 全部通过,1 项因无会话跳过(时间线/导出/搜索,由单测覆盖)。
875
+ - `pnpm check:readme`、`pnpm typecheck`、`pnpm test`(214)、`pnpm build`、`pnpm smoke`
876
+ 全绿。
877
+
878
+ ## 0.9.1 — 2026-10-25
879
+
880
+ ### Fixed
881
+
882
+ - **Mermaid 解析失败不再在页面底部留下错误图**:Mermaid 默认会在
883
+ `render()` 抛错前把一个全宽炸弹图追加到 `<body>`(`div#dvx-mmd-*`)并留在
884
+ 那里。现在 `mermaid.initialize` 打开 `suppressErrorRendering`,并在
885
+ `finally` 中清理 `#id` / `#d<id>` / `#i<id>` 三个临时节点;扫描时也会移除
886
+ 旧版本遗留的同名节点。失败代码块按既有设计回退为原始代码,不再出现
887
+ “Syntax error in text / mermaid version …” 卡片。
888
+
889
+ ### Verified
890
+
891
+ - 无头 Edge 复现旧行为(`body > div#dvx-mmd-*` 残留 + “Syntax error in text”),
892
+ 并验证 `suppressErrorRendering` 与 `finally` 清理两条路径都能清除;合法
893
+ flowchart 仍正常渲染。
894
+ - `pnpm check:readme`、`pnpm typecheck`、`pnpm test`(205)、`pnpm build`、
895
+ `pnpm smoke` 全绿。
896
+
897
+ ## 0.9.0 — 2026-10-25
898
+
899
+ 兼容策略改为开放式下限:宿主不再因为 dsh 更新而把插件判为“不支持”。
900
+
901
+ ### Changed
902
+
903
+ - **兼容范围改为 `>=0.1.7-rc.2`(无上界)**:`engines.dsh` 与
904
+ `@deepseek-ai/dsh-tools` peer 同步放宽。dsh 0.2.1-alpha.4+ 优先读
905
+ `engines.dsh`,旧宿主读 peer;两者都放行所有高于下限的版本,因此未来任何
906
+ dsh 发版(包括 0.2.1-rc.3、0.2.1 正式版、0.3、1.0)都不必先等插件发版才能
907
+ 加载。实测过的版本改为证据记录(README 兼容表 / 本文件),不再是闸门。宿主
908
+ 的兼容门只有“放行/拒绝”两态、没有“仅警告”,这是不再把未实测版本挡在门外
909
+ 的唯一实现方式。
910
+ - **构建与测试队列切到 dsh 0.2.1-rc.3**:九个 `@deepseek-ai/dsh-*`
911
+ devDependency 从 rc.2 升到 rc.3,锁文件同步。`pnpm smoke` 的兼容断言改为
912
+ “下限必须拒绝 0.1.7-rc.1、无上界必须放行 99.0.0、`engines.dsh` 与 peer
913
+ 判定一致”,`tests/manifest.spec.ts` 的放行/拒绝清单同步改写。
914
+ - **新增定时兼容 canary**:`scripts/compat-canary.mjs` +
915
+ `.github/workflows/compat-canary.yml`,每天取 npm `latest`/`next` 中较高的
916
+ dsh,在临时 `DSH_HOME` 里安装**已发布**插件、冷启动并跑
917
+ `scripts/live-dsh-check.sh`;失败时自动开 issue。可用 `pnpm canary` 或
918
+ `node scripts/compat-canary.mjs <版本> --plugin <tgz>` 本地跑。
919
+
920
+ ### Verified
921
+
922
+ - 0.9.0 产物在隔离的 dsh 0.2.1-rc.3 profile 中安装(无兼容豁免)并冷启动:
923
+ boot 图 71 行、五个 inject 目标齐全、客户端 bundle 200,371 字节、Mermaid
924
+ 本地引擎 3,572,661 字节、state / usage / backup 路由、UTF-8 往返与三种信任
925
+ 围栏形状全部通过;活体探针 16 通过 / 1 跳过(无会话)。
926
+ - `node scripts/compat-canary.mjs 0.2.1-rc.3 --plugin <0.9.0 tgz>` 端到端通过。
927
+ - `pnpm check:readme`、`pnpm typecheck`、`pnpm test`(205 tests)、`pnpm build`、
928
+ `pnpm smoke` 全绿。
929
+
930
+ ## 0.8.0 — 2026-10-17
931
+
932
+ dsh 0.2.1-rc.2 兼容版:`engines.dsh` 取代 peer 范围成为 0.2.1-alpha.4+ 的首要兼容门,
933
+ 旧范围把 0.2.1 全线拒之门外;本版补上新运行时线,并按 0.2.1 的客户端 seed 表与输入
934
+ 动作签名完成适配。
935
+
936
+ ### Changed
937
+
938
+ - **兼容范围新增 dsh 0.2.1-rc.2**:`engines.dsh` 与
939
+ `@deepseek-ai/dsh-tools` peer 范围同为
940
+ `>=0.1.7-rc.2 <0.2.0-0 || >=0.2.0-rc.2 <0.2.0-rc.3 || >=0.2.1-rc.2 <0.2.1-rc.3`。
941
+ 旧范围止于 `<0.2.0-rc.3`,而 dsh 0.2.1-alpha.4 起插件管理器优先读
942
+ `engines.dsh`,因此桌面版升到 0.2.1-rc.2 后会把 0.7.1 判为不兼容并拒绝启用——
943
+ 这正是本次报错的根因。范围仍只收实际构建并实测过的预发布版:0.2.1-alpha.x、
944
+ 0.2.1-rc.3+ 与 0.2.1 正式版不在内。
945
+ - **构建与测试队列整体切到 0.2.1-rc.2**:九个 `@deepseek-ai/dsh-*`
946
+ devDependency 与 `@deepseek-ai/cordis` 4.0.5 同步升级;`pnpm smoke` 新增
947
+ 「队列必须恰好一个版本」检查,`tests/manifest.spec.ts` 固化范围必须同时放行
948
+ 三条已验证运行时线、拒绝未验证版本。
949
+ - **客户端平台模块表对齐 0.2.1 shell**:`PLATFORM_MODULES` 补入 seed 表新增的
950
+ `zod` 与 `@tanstack/react-virtual`;现有五个 inject 目标在 0.2.1 boot 图中
951
+ 全部存在。
952
+ - **输入动作类型对齐**:`setDraft(text)` 在 0.2.1 只接收文本(旧声明的可选
953
+ `editRange` 参数从未使用),本地最小接口同步收窄。
954
+ - **兼容判定工具对齐新语义**:`scripts/desktop-runtime.mjs` 改为优先用
955
+ `engines.dsh` 判定(与 dsh 0.2.1-alpha.4+ 一致),回退 peer 范围时才用 peer,
956
+ 两者判定不一致会单独告警;`scripts/smoke.mjs` 的说明与探测版本表同步更新。
957
+ - **对 0.2.0-rc.2 → 0.2.1-rc.2 的插件可感 API 做逐项核对**:本插件使用的
958
+ `WebRoute`、`defineTool`、`AttachmentStore`、`SessionQueryEngine`、
959
+ `SessionLogSnapshot`、`SessionEvent`、`theme.overrideTokens`、slots 注册与
960
+ 五个 inject 目标均无破坏性变化;0.2.1 的变更集中在新功能(session plugin
961
+ record、字体设置、PTC 模式收窄、远程 Web/TLS、新 model-label 槽位),不影响
962
+ 本插件现有路径。
963
+
964
+ ### Optimized
965
+
966
+ - **读档形状门**:`mergeState` 现在对 folders 走 `normalizeFolders`、对 stars 走
967
+ `normalizeStars`、对 usage 走新的 `normalizeUsageMap`。此前一份 JSON 合法但
968
+ 文件夹深度超标(或 stars 形状错误)的文档会被直接采纳,随后每次保存的
969
+ `JSON.stringify` 都抛 `RangeError`,插件永久无法保存;现在这类文档在加载时按
970
+ 「损坏」处理:原名改名 `.corrupt-<pid>` 保留现场,采用默认值并继续可写。
971
+ usage 的畸形日期/模型行/字符串计数会被丢弃或归零,避免后续 fold 把字符串拼进
972
+ 计数器。
973
+ - **保存回滚不再深拷贝整份台账**:`applyEdit` 与备份导入只捕获被替换的 section
974
+ 引用做回滚点,不再 `JSON.parse(JSON.stringify(state))`。用量台账保留 90 天,
975
+ 此前每次切换开关的保存都要复制整份台账;现在回滚成本与编辑量成正比。
976
+ - **Mermaid 引擎一致性**:CDN 兜底不再硬编码 `mermaid@11.6.0`,改为读取实际安装
977
+ 的 `mermaid/package.json` 版本;本地引擎改用异步读取(3.5 MB 同步读会卡住宿主
978
+ 事件循环),字节数按 UTF-8 计。引擎脚本路由加 `ETag` + `Cache-Control:
979
+ no-cache`:页面重载命中 304,不再每次重传 3.5 MB。
980
+ - **浏览器轮询与渲染热点**:流式期间的 timeline 轮询在页面隐藏时暂停、单次请求
981
+ 在飞时不叠加;`reuseTimelineItems` 复用未变化的 turn 对象,只有真正变化的行
982
+ 触发渲染。`TurnTailEntry`(每条消息一个)和 `FxCanvas` 改用
983
+ `useSSelector` 选择器订阅,余额/用量/toast 等无关写入不再重渲染最多 400 个
984
+ turn-tail。诊断节流表加上限,避免跨会话无限增长。
985
+ - **卸载回收补全**:anti-scroll 的滚动行为与 `data-vx-anti` 属性、就地 Mermaid
986
+ 包装节点、配置加载重试定时器、问候 toast 定时器都会在停用/卸载时还原;此前
987
+ 这些页级副作用会留在 GUI 中。
988
+ - **路由健壮性**:`POST /state` 上限从 256 KiB 提到 1 MiB(提示词库较大的用户
989
+ 此前会在保存时收到 413),并拒绝非对象 JSON;balance / usage-scan / mermaid
990
+ 的意外异常统一转成 JSON 错误包,而不是让 handler reject。
991
+ - **测试**:新增 `tests/timeline-diff.spec.ts`、读档形状隔离用例、usage 归一化
992
+ 用例、Mermaid 版本/UTF-8 计数用例、ETag 304 用例;总数 190 → 204。
993
+
994
+ ### Verified
995
+
996
+ - 用桌面版自带 CLI 在隔离 profile 中安装本 tarball:**无兼容豁免、无
997
+ `incompatible` 提示**(这正是用户此前遇到的拒绝路径)。
998
+ - 在同一 0.2.1-rc.2 运行时上冷启动真实 Host 并跑 `scripts/live-dsh-check.sh`:
999
+ boot 图 70 个模块行、五个 inject 目标齐全、插件 bundle 已服务(约 200 KB)、
1000
+ Mermaid 本地引擎 3.57 MB、state/usage/backup 路由、UTF-8 往返、桌面转发形状与
1001
+ 异源/跨站围栏全部通过;时间线/导出/搜索因临时 profile 无会话而跳过(该路径由
1002
+ 单测覆盖,相关 API 在 0.2.1 仅新增可选 `formatStatus` 字段)。
1003
+ - Mermaid 脚本路由实测:首次 200 / 3,572,661 字节,带 `If-None-Match` 的第二次
1004
+ 请求 304 / 0 字节。
1005
+ - `pnpm check:readme`、`pnpm typecheck`、`pnpm test`(204 tests)、`pnpm build`、
1006
+ `pnpm smoke` 全绿。
1007
+
1008
+ ## 0.7.1 — 2026-10-03
1009
+
1010
+ 数据安全与健壮性加固版:封住两条不可恢复配置丢失路径与一条跨宿主丢更新路径,装上浏览器提交的形状门,补齐卸载回收与凭据状态缓存;测试从 143 增至 185。
1011
+
1012
+ ### Fixed
1013
+
1014
+ - **宿主读档失败不再静默用默认值覆盖状态文件**:此前 `loadStateFile` 把
1015
+ `ENOENT`、瞬态占用(Windows 杀毒扫描 / 同步盘 / 与桌面宿主的 rename 竞争)
1016
+ 与 JSON 损坏一律折叠成「无文件」,随后启动流程立即把默认文档写入真实路径——
1017
+ folders / prompts / stars / 用量台账被无条件清空且不留副本。现在:瞬态错误按
1018
+ 1.5s/3s/6s 重试(与客户端重试梯子同节奏);重试耗尽或 JSON 损坏时先以
1019
+ pid 后缀名将原文件改名隔离(`.corrupt-<pid>`,两个宿主共享一个
1020
+ `$DSH_HOME` 也不会互相抢占恢复名)再采用默认值;仅当原文件既读不出又移不走
1021
+ 时 loader 才 reject,宿主转入只读模式(抑制一切保存)而不是销毁可能完好的
1022
+ 文档。启动后的首次规范化保存失败也不再误入加载失败分支。
1023
+ - **客户端重试耗尽后不再把出厂空配置写回宿主**:桌面壳页面可能先于宿主路由
1024
+ 就绪,客户端重试梯子(约 10.5 秒)耗尽后停在出厂默认值;此后用户切换任何
1025
+ 开关都会触发一次全量 POST,把已存 folders / prompts / stars 整组替换为空。
1026
+ 现在 `saveCfg` 以「曾成功读取过状态」为门槛:未加载成功一律改为重新读取并
1027
+ 提示「配置尚未读取完成,已重新加载,请重试」。
1028
+ - **插件停用/重声明后全局副作用全部回收**:卸载清理器此前只注销插槽并移除动
1029
+ 态样式,`theme.overrideTokens` 的设计令牌覆盖(停用后 GUI 配色仍被插件锁
1030
+ 死)、`<html>` 上的 `vx-liquid/vx-dark/vx-light` 类、液态玻璃 SVG 滤镜节点、
1031
+ 待触发的余额重试定时器(会继续外呼最多 3 次)全部残留。现在清理器逐一还原。
1032
+ - **共享 `$DSH_HOME` 的两个宿主不再互相清空对方的写入**(Web 与 Desktop 各自持有整份内存文档、整文件回写,最后写者赢):现在每次保存前先用 stat 身份(mtime+size)对比本进程上次读/写看到的文件,发现外部变更就回读并做三方合并——本进程未动过的配置段(cfg/folders/prompts/stars)采纳外部版本,动过的保留本地版本,用量台账按计数器做 `对方 + 本地 − 共同基线` 的精确并集(两个宿主的会话流来自不同 profile、天然不重叠)。启动加载也改用同一文件句柄做 fstat+read,基线与合并字节描述同一份文档。
1033
+ - **`POST /state` 形状门**:浏览器提交的 folders / stars 此前未经校验直接落
1034
+ state——畸形深层嵌套可让此后每次保存的 `JSON.stringify` 抛 `RangeError`,
1035
+ 保存从此持续失败需手改状态文件。现在 `normalizeFolders`(唯一 id、纯字符
1036
+ 串 id 列表、深度 ≤32、节点 ≤2000)与 `normalizeStars`(安全对象键、纯数字
1037
+ 序号、`true` 值、总量 ≤10000)把关,违规整笔拒绝(400「文件夹数据无效」/
1038
+ 「星标数据无效」),绝不截断——客户端持有全量文档,静默丢段等于丢数据。
1039
+ - **缓冲用量回放不再把宿主已学到的模型覆盖为 `unknown`**:启动缓冲的
1040
+ `session/event` 用量回放时,`null` 模型改为传 `undefined`,让宿主回退到自己
1041
+ 在加载期间学到的 session 模型映射。
1042
+ - **用量重扫不再白付全量代价后必然失败**:流式对话期间触发重扫时,revision 检查从「全部 I/O 完成后查一次」改为每个会话读取前检查,已注定作废的扫描会立即停止读取剩余会话日志。
1043
+ - **Mermaid CDN 兜底不再被 200-HTML 投毒**:绑架门户/镜像异常返回的 200 HTML 页此前会被缓存为「引擎」且宿主生命周期内不再重取;现在要求载荷是 ≥1000 字节、不以 `<` 开头的脚本形态,否则记为该镜像失败并继续尝试下一个。
1044
+ - **客户端脚本加载挂起不再无限等待**:`ensureMermaid` 的 120ms 轮询等待没有出口,网络黑洞(onload/onerror 都不触发)会让每个流式新代码块再挂一个永久等待者、「预加载」按钮永远「加载中」;现在 30 秒看门狗翻到 failed 并移除 script 标签,重试可重新插入。
1045
+ - **GUI 主题与 OS 配色不一致时玻璃/面板不再用错颜色**:深色 GUI + 浅色 OS 下余额悬浮卡、面板、模态保持浅色磨砂(反之亦然)——这些规则此前只跟 `prefers-color-scheme` 走;现在按客户端镜像到 `<html>` 的 `vx-dark/vx-light` 类选择,媒体查询降级为类就绪前的启动兜底(液态玻璃规则本就按此模式工作,磨砂路径对齐)。
1046
+
1047
+ ### Changed
1048
+
1049
+ - **凭据状态短 TTL 缓存**:`credentialStatus` 每次 `/state` GET 与保存响应都
1050
+ 打一次 OS keychain + 读凭据文件;现在对「来源判定」结果缓存 5 秒(从不缓
1051
+ 存键值本身),`applyEdit` 与遗留迁移立即失效,保存响应永远如实反映刚应用
1052
+ 的编辑。
1053
+ - **长会话交互开销**:`TurnTailEntry`(每条消息一个)对轮次数据的查找从每次 store 变更 O(轮数) 线性扫描改为 fetch 时构建的 `seq → item` Map O(1) 查表;选中拖拽时 `selectionchange` 以 60Hz 触发 `setS`,现在文本与坐标未变(<1px)时跳过发布;用量面板的 90 天汇总/按天/按模型统计改为 `useMemo`(预算输入每次击键不再重算全部统计);面板拖拽改为 mousemove 直写 DOM、mouseup 才落 store;预算状态判定复用 `productivity.budgetState`(此前为生产死代码,客户端内联了一份会漂移的副本)。
1054
+ - **死代码清理**:六个无引用 ICONS 条目(clock/fork/arrowUp/arrowDown/moon/
1055
+ sun)、两条无匹配死规则(`.vx-swatch:disabled`、`.vx-textarea`)移除;
1056
+ `hexToRgb` 收敛到 palette.ts 单一导出实现。
1057
+ - **smoke 收紧**:未构建即跑 smoke 给出明确「先 pnpm build」报错而非裸 ENOENT 堆栈;新增 bundle `require()` 字面量 ⊆ `PLATFORM_MODULES` 交叉校验(防未声明外部化导致的静默消失类断裂);`lib/client.js` 落后于 `src/client` 或 `tsdown.config.ts` 时判红(防对过期产物盖章);Windows 下 PATH 探测补 `.exe` 后缀。
1058
+ - **typecheck 收编构建配置**:`tsdown.config.ts`、`vitest.config.ts` 进入 `pnpm typecheck` 范围。
1059
+ - **CI 补浏览器段**:`setup-chrome` 后跑全量 `pnpm smoke`——客户端注册握手
1060
+ (bundle 必须注册 {id, factory} 且不物化、无页面错误)首次进入 CI,此前只
1061
+ 在本机跑。
1062
+
1063
+ ### Tests
1064
+
1065
+ 测试从 143 增至 185。
1066
+
1067
+ - **路由错误面**(信任边界此前只测了围栏与备份校验):全部路由的 405、坏
1068
+ JSON → 400、流级超限 → 413、timeline/export 缺 `sessionId` → 400、kinds
1069
+ 数组内单项非法 → 400、`POST /state` 成功路径与 `applyEdit` 失败 → 400 映射、
1070
+ Mermaid 脚本路由引擎未就绪 → 503 及其围栏 403。
1071
+ - **状态加载失败处理**:损坏文档隔离、重试耗尽后隔离、瞬态故障恢复后正常合
1072
+ 并、隔离失败时 reject 且原文件字节不动。
1073
+ - **跨宿主同步合并**:外部写入按段采纳/保留、同一用量行两宿主并发累加的精确
1074
+ 并集、全新安装保存不触发合并。
1075
+ - **形状门**:合法树/星标通过、重复 id 与非字符串成员拒绝、超深树拒绝、不安
1076
+ 全对象键(`JSON.parse` 产生的自有 `__proto__`)拒绝。
1077
+ - **装载入口集成测试**(`src/index.ts` 此前零覆盖):全路由与状态工具注册、
1078
+ 启动规范化落盘、`stateReady` 前的用量缓冲、500ms 防抖合并为一次写入、损坏
1079
+ 文档隔离后继续写入、隔离失败转只读(诊断含 read-only、内存台账仍在、磁盘
1080
+ 无写入)、fiber 卸载回收路由/工具并重新武装单例守卫。
1081
+ - **单例守卫 / 家目录 / 凭据存储零覆盖补齐**:`mountOnce` 首挂生效、重挂静默、
1082
+ fiber 卸载后重武装(effect 须「返回」解标记的契约被锁死);`resolveDshHome`
1083
+ 的 `~` 展开与相对路径锚定;keytar 缺席时 `SystemCredentialStore` 全操作软
1084
+ 失败(本仓库与最小安装实际走的路径)。
1085
+ - **凭据缓存**:TTL 窗口内命中缓存、编辑后失效重解析。
1086
+ - **样式不变量**(`styles.spec.ts`):把 0.7.0 的实发 bug 类锁死为断言
1087
+ ——`.vx-liquid` 永不出现在 `.vx-root` 之后(死规则类)、磨砂/液态玻璃与余
1088
+ 额卡必须按 `:root.vx-dark/vx-light` 主题类出规则、无退役类名(vx-dots /
1089
+ vx-timeline)、花括号平衡。测试首次落地就抓出一个存量孤儿 `}`(历史上删
1090
+ 媒体块残留,浏览器静默忽略),已清除。
1091
+ - **Mermaid 载荷校验**:200-HTML 拒收并落到下一镜像、全部镜像 HTML 时不投毒
1092
+ 缓存、过小 200 体拒收。
1093
+ - **用量重扫提前中止**:扫描进行中来新用量时,剩余会话不再被读取即返回重试
1094
+ 错误。
1095
+
1096
+ ## 0.7.0 — 2026-09-30
1097
+
1098
+ 桌面版适配修复版。0.6.0 及之前的产物在 dsh Desktop 里几乎全部功能失效——本版
1099
+ 定位根因、修复围栏,并按桌面版重新校准了外观与额度两个界面。
1100
+
1101
+ ### Fixed
1102
+
1103
+ - **桌面版全线 `forbidden` 的根因**:插件的访问围栏在回环判定之外额外要求一个
1104
+ 浏览器同源标记(`sec-fetch-site: same-origin` 或 `origin` 头),而桌面版
1105
+ Electron 壳把渲染进程请求转发给它自己的 Host 之前会删掉 `host`、`origin`、
1106
+ `sec-fetch-site`、`cookie`——于是每个 `/api/custom-plugin/*` 路由和
1107
+ `/custom-plugin/mermaid.js` 都被误拒为 403 `forbidden`:三种导出、会话搜索、
1108
+ Mermaid 引擎预加载与就地渲染(连带 mermaid.live 按钮不出现)、余额与用量、
1109
+ 以及**一切静默失败的状态保存**(主题、玻璃模式、项目文件夹、提示词库在桌面
1110
+ 版从未真正持久化过)。0.7.0 起围栏对齐官方 API 围栏的信任语义:回环套接字 +
1111
+ 回环 Host、非 `cross-site`、`origin` 缺省或与 Host 一致即放行;异源与跨站
1112
+ 仍然 403。新增 guard 级单测(桌面转发形状、桌面 WS 形状、异源、跨站、非法
1113
+ origin、非回环 Host)与 `scripts/desktop-shape-probe.mjs` 活体探针;并在
1114
+ 真实桌面安装(F:\DSH,dsh 0.2.0-rc.2)上实测:11 项通过 / 0 失败。
1115
+ - **客户端不再静默吞错**:`loadCfg` / `saveCfg` 失败现在 toast + 上报客户端
1116
+ 诊断,「看起来生效其实没存上」从此不可复现。
1117
+ - **余额「额度?」的间歇性根因**:宿主对 `api.deepseek.com` 的外呼与桌面版
1118
+ GUI 一样走本机直连,而本机代理/安全软件按规则间歇性对 443 做 TLS 解密——
1119
+ 被接管的时刻 Node 校验不了其自签名证书(`SELF_SIGNED_CERT_IN_CHAIN`),
1120
+ 于是登录时首次查询失败、稍后手动刷新又成功,顶栏停在 `额度?` 上。0.7.0 起
1121
+ 宿主把这类连接层失败(TLS 拦截 / DNS / 连接超时)翻译成可读的中文原因,
1122
+ 客户端失败后按 8s/30s/30s 自动重试(60 秒轮询继续兜底),顶栏悬停即可看到
1123
+ 真实原因。失败态顶栏文案按反馈只显示「额度」两字,不带问号。
1124
+
1125
+ ### Removed
1126
+
1127
+ - **极光背景预设**:与整体配色不再协调,从色板中移除;旧存档的 `bg: 'aurora'`
1128
+ 在宿主归一化与客户端加载两侧自动迁移为 `default`。
1129
+ - **消息时间线轨道**(系统已内置对话时间线):轨道、悬停卡(跳转/星标/分支/
1130
+ 全文)、「显示时间线 / 时间线在左侧 / 仅显示星标」三个开关与时间线标签页
1131
+ 全部移除;`timeline` / `timelineLeft` / `starsOnly` 配置键退役(旧状态文件
1132
+ 里的残留键会被宿主归一化丢弃)。保留:消息尾部的 LaTeX / MathML / Mermaid
1133
+ 芯片(其数据链 `/timeline` 原样保留,会话运行期间由 OverlayRoot 每 3 秒
1134
+ 轮询驱动)、星标数据字段(备份兼容)与搜索定位跳转。
1135
+
1136
+ ### Changed
1137
+
1138
+ - **色板适配深色模式**:20 组色系在深色下不再禁用——按同色系自动派生深色
1139
+ 变体(保留色相与低饱和,明度落到深色档,饱和度压缩至 0.55 倍,避免暖色系
1140
+ 在深底上抢眼),色板预览即当前模式的实际效果;「深色强制重置背景」的旧
1141
+ 逻辑随之移除,主题翻转只重新着色。
1142
+ - **头部入口交互统一**:个性化 / 提示词 / 额度三张卡片统一为「点一下显示、
1143
+ 再点一下关闭」——额度卡片移除悬停即开与固定/取消固定的混合逻辑,提示词
1144
+ 浮层重复点击按钮即可关闭;四个浮层表面(含项目文件夹侧栏)互斥,打开一个
1145
+ 自动收起其它。
1146
+ - **液态玻璃**:删除「在 Chromium 启用液态玻璃…」的桌面端无关文案;位移折射
1147
+ 链上轻微模糊与饱和(`url(#vx-lg) blur(2.5px) saturate(1.12)`),大面积面板
1148
+ 中部文字清晰、玻璃可感知;液态模式下「全局浮层玻璃」把同样的位移链延伸到
1149
+ 弹窗 / 菜单 / 提示框 / 下拉框与系统设置窗(`CSS.supports` 门控,不支持
1150
+ SVG 位移滤镜的引擎回退毛玻璃)。并修复了一个让面板「看起来没有液态」的
1151
+ 作用域缺陷:主题毛玻璃底色(64% 白底)特异性压过 10% 液态底色,而本应翻盘
1152
+ 的选择器要求 `vx-liquid` 出现在 `.vx-root` 内部(它实际挂在 `<html>` 上),
1153
+ 从未匹配——只有不在 `.vx-root` 里的额度浮层是真液态。现以 `:root.vx-liquid`
1154
+ 作用域重写液态底色,并把主题类镜像到 `<html>`,所有玻璃表面统一。
1155
+ - **点阵背景全局移除**:所有玻璃表面不再渲染滚动的点阵纹理。
1156
+ - **额度区改版**:顶栏胶囊在未配置 Key 时显示本机费用估算(`≈¥0.42 · 今日
1157
+ N 次`,按官方价目表折算,不用 Key、不联网);配置了 Key 照旧显示真实余额。
1158
+ 面板默认区只放用量趋势 / 预算 / 今日明细 / 扫描按钮;「余额查询」收为可折
1159
+ 叠可选项(配置过 Key 默认展开),未配置时不再显示任何报错。
1160
+ - **价目表更新**(2026-09-30 核对官方页):`deepseek-flash` 峰时输入 ¥2 / 输出
1161
+ ¥8 / 缓存命中 ¥0.04(旧名 `deepseek-v4-flash` / `-vision-exp` 仍按 Flash 计
1162
+ 价路由),`deepseek-v4-pro` ¥9 / ¥27 不变;闲时一律半价。
1163
+
1164
+ ## 0.6.0 — 2026-09-30
1165
+
1166
+ ### Published
1167
+
1168
+ - `npm publish` went out at 2026-09-29T17:26:16Z — 01:26 local on 2026-09-30, which is
1169
+ why this entry is dated 09-30 — and registry `dist-tags.latest` is now `0.6.0`.
1170
+ The first `PUT` returned 401, npm opened its browser sign-in flow, and
1171
+ the retried `PUT` returned **202 Accepted** — npm then keeps the version
1172
+ processing for a few minutes, during which the registry still reads
1173
+ `latest: 0.5.0`. Anyone re-checking too early will see "not published"; check
1174
+ `time["0.6.0"]` before re-running `npm publish`, because a second publish of an
1175
+ accepted-but-processing version fails on the version already existing.
1176
+ - The published tarball was unpacked and compared to the repository build:
1177
+ `lib/client.js` 207762 B (sha256 `f559cd7f1bd8a49a`), `lib/index.js` 81224 B,
1178
+ `package.json`, `cordis.patch.yml`, `icon.svg`, `README.md` — all byte-identical.
1179
+ - That registry artifact was then installed into a fresh scratch profile on
1180
+ dsh 0.2.0-rc.2 — dsh Desktop's exact bundled version — and scored the same
1181
+ 18 pass / 1 skip / 0 fail as the locally packed one.
1182
+ - **Install it by exact version for now.** A bare `dsh plugin … add
1183
+ @alexpeng/dsh-custom-plugin` resolved `0.4.2` on this machine minutes after
1184
+ the publish: the plugin manager reads a cached packument whose `latest` was
1185
+ still stale. `@alexpeng/dsh-custom-plugin@0.6.0` installs cleanly. Use
1186
+ `npm view @alexpeng/dsh-custom-plugin dist-tags --prefer-online` to read the
1187
+ real tag instead of the cached one.
1188
+
1189
+ ### Changed
1190
+
1191
+ - **Built against dsh 0.2.0-rc.2, and the declared range now names it.** Every
1192
+ `@deepseek-ai/dsh-*` devDependency moved to 0.2.0-rc.2 and the source
1193
+ type-checked against that release's own published types with no source
1194
+ changes. The gate-relevant peer became
1195
+ `@deepseek-ai/dsh-tools >=0.1.7-rc.2 <0.2.0-0 || >=0.2.0-rc.2 <0.2.0-rc.3`,
1196
+ and `engines.dsh` was set to the same range. That spelling is load-bearing:
1197
+ `^0.1.7-rc.2` desugars to `>=0.1.7-rc.2 <0.2.0-0`, and every `0.2.0-rc.N`
1198
+ sorts above `0.2.0-0`, so no caret form can admit a verified prerelease — and
1199
+ `^0.2.0-rc.2` would additionally admit 0.2.0 stable plus every later 0.2.x,
1200
+ which is exactly the unverified support this range exists to withhold.
1201
+ 0.2.0-rc.1 is left out on purpose: the bundle is now built for rc.2.
1202
+ - `pnpm smoke`'s two range checks were rewritten, because both encoded the old
1203
+ premise that a peer range is a single caret pin. They now assert what is
1204
+ actually load-bearing: the installed build target must **satisfy** the peer
1205
+ range (same comparator and `includePrerelease` semantics dsh's own gate uses),
1206
+ a range that admits every version is rejected as stating no support at all,
1207
+ and `engines.dsh` must admit the same versions as the peer range across ten
1208
+ probed releases. `semver` became a devDependency to make the first check
1209
+ possible. Verified by mutation: a stale range, a `*` range, and a diverging
1210
+ `engines.dsh` each turn the gate red.
1211
+ - The desktop release line pins its shell and runtime together, so dsh Desktop
1212
+ always ships one exact dsh version — this is why 0.2.0-rc.2 stopped being a
1213
+ speculative target: any Desktop install *is* that runtime.
1214
+
1215
+ ### Added
1216
+
1217
+ - `tests/loopback.spec.ts`: the request-level fence had never had a unit test —
1218
+ only the live probe script exercised it. Twelve tests now pin the two header
1219
+ shapes dsh Desktop's shell produces (`web-document.ts` deletes `host`,
1220
+ `origin`, `cookie` and `sec-fetch-site` before forwarding; the WebSocket
1221
+ upgrade rewrites `Origin` to the Host authority), plus the rejections a
1222
+ forged Origin, a cross-site marker, and a non-loopback socket must still get.
1223
+ - `scripts/desktop-runtime.mjs`: reads which dsh version an **installed** dsh
1224
+ Desktop carries, straight out of `resources/app.asar/dsh/desktop-runtime.json`,
1225
+ and prints whether the peer range declared here admits it. Promoted from a
1226
+ throwaway probe because Desktop pins shell and runtime together, so "what does
1227
+ this installer actually run" is a question every future Desktop release
1228
+ re-asks and the repository cannot answer. Read-only; takes the installation
1229
+ directory or the archive path. Verified in both directions: on this machine's
1230
+ install it reports `0.2.0-rc.2 / ADMITTED`, and with the peer range temporarily
1231
+ reverted to `^0.1.7-rc.2` the same run reports `REFUSED`.
1232
+ - README (both languages) gained an "On dsh Desktop" section: how the shell
1233
+ routes requests, why the profile is managed by Desktop's own `dsh` command,
1234
+ and which part still needs a window and a login.
1235
+
1236
+ ### Fixed
1237
+
1238
+ - **A second dsh host could read a half-written state document.** The atomic
1239
+ replace wrote to one shared temp name, `custom-plugin-state.json.tmp`, while
1240
+ the queue that serializes saves lives inside a single process. dsh Desktop
1241
+ owns `$DSH_HOME/profiles/desktop` and the Web profile owns `profiles/web`,
1242
+ but both hosts read and write the same
1243
+ `$DSH_HOME/custom-plugin-state.json`, so two hosts saving at the same moment
1244
+ wrote and renamed that one temp file against each other — the Windows
1245
+ EPERM/EBUSY shape this queue was built to stop, reachable across processes.
1246
+ Temp names are now qualified by the writing pid (both the state document and
1247
+ the pre-import recovery backup), and a failed turn deletes its own temp
1248
+ instead of leaving a per-pid file behind. Building that cleanup surfaced a
1249
+ second bug: `rm` was used in the new `catch` but never imported, so a failed
1250
+ save reported `ReferenceError` instead of the real rename error and left the
1251
+ temp file on disk.
1252
+
1253
+ ### Verified
1254
+
1255
+ - **dsh 0.2.0-rc.2, the version Desktop ships.** Confirmed from the installed
1256
+ app's own bytes, not the repository: `resources/app.asar/dsh/desktop-runtime.json`
1257
+ records `release.version 0.2.0-rc.2`, `node 24.18.1`, `pnpm 11.7.0`, and lists
1258
+ `@deepseek-ai/dsh 0.2.0-rc.2` with `@deepseek-ai/cordis 4.0.4` (the version
1259
+ this package's cordis peer already names) among its shared packages.
1260
+ - 0.5.0 on that runtime behaved as predicted: `dsh plugin --profile web add`
1261
+ refused it, naming `peerDependencies {"@deepseek-ai/dsh-tools":"^0.1.7-rc.2"}`,
1262
+ and rolled the profile back. With the exemption granted, 18 of 19 live host
1263
+ probes passed, 0 failed.
1264
+ - **0.6.0 installs on 0.2.0-rc.2 with no exemption at all** (`plugin add` exit
1265
+ 0, profile kept), and the same 18-pass/1-skip/0-fail result holds there and on
1266
+ 0.1.7-rc.2 — boot graph 66 module rows on 0.2.0-rc.2 and 65 on 0.1.7-rc.2, our
1267
+ row served, all
1268
+ five `dsh.client.inject` targets present, Mermaid engine loaded locally, UTF-8
1269
+ state round trip restored. The single skip is the session-dependent probe; a
1270
+ credential-free scratch home holds no session.
1271
+ - The rebuild of `pnpm-lock.yaml` (required: the old lockfile cached a
1272
+ `minimumReleaseAge` policy snapshot that no longer matched the allow-list, so
1273
+ every install was rejected) also moved the dev tree's `mermaid` from 11.17.0
1274
+ to 11.17.2. That is inside the declared `^11.6.0`, and the scratch profiles
1275
+ used for the live probes resolved 11.17.2 themselves, so the measured Mermaid
1276
+ engine is the version an installing user gets.
1277
+ - The installed `lib/client.js` is byte-identical to the repository build
1278
+ (207762 bytes, sha256 prefix `f559cd7f1bd8a49a`). The *served* bundle is 49
1279
+ bytes larger because dsh's composite `/plugins/??…` route joins modules with
1280
+ `;\n` and rewrites the `sourceMappingURL` — so byte identity is asserted at
1281
+ the installed file, never at the HTTP response.
1282
+ - 126 unit tests pass, typecheck is clean, `pnpm smoke` and `check:readme` are
1283
+ green. Not verified: opening the plugin inside a real Desktop window (needs a
1284
+ login), the desktop profile's own composition, and the per-turn chips.
1285
+
1286
+ ## 0.5.0 — 2026-09-28
1287
+
1288
+ ### Changed
1289
+
1290
+ - **Target dsh 0.1.7-rc.2.** All `@deepseek-ai/dsh-*` dependencies, the
1291
+ `@deepseek-ai/dsh-tools` peer range, and `@deepseek-ai/cordis` moved to the
1292
+ versions that release ships, and `engines.dsh` now states the supported range.
1293
+ dsh checks a bundle's `@deepseek-ai/dsh-*` peer ranges against its own runtime
1294
+ version at install and startup and skips a bundle that does not match. The
1295
+ declared floor is the release this package was built and verified against;
1296
+ `^0.1.7-rc.2` additionally admits later 0.1.x releases that have not been
1297
+ re-verified, and `engines.dsh` is declarative — no part of dsh reads it.
1298
+ - The browser half declares `dsh.client.inject` as the five packages that own
1299
+ the slots it registers into, replacing the retired
1300
+ `@deepseek-ai/dsh-client-runtime` row.
1301
+ - Slot-provided data shapes (`SessionListState`, `WorkspaceListState`,
1302
+ `TurnLocation`) are now declared locally instead of imported from harness
1303
+ controller packages that rename across releases; only `SnapshotSelectorHook`
1304
+ still comes from the slot SDK.
1305
+ - In-session search uses dsh's event index when the deployment opens one and
1306
+ otherwise scans the session log it already read, reporting which path answered
1307
+ in the panel. dsh's shipped `web` profile configures the index with
1308
+ `openAt: never`, so the indexed route was unavailable on a default install.
1309
+ - Plugin Manager cards, bundle details, and the settings inventory now show a
1310
+ real name and icon: `locale/en.json`, `locale/zh.json`, and `icon.svg`.
1311
+
1312
+ ### Fixed
1313
+
1314
+ - **The timeline rail, export, and quote features lost the current session.**
1315
+ The session list snapshot has had no `current` field since dsh
1316
+ 0.1.6-alpha.2 (view selection moved to the Workspace browser), so the rail
1317
+ tracked nothing. The viewed session now comes from the standard `sessionId`
1318
+ prop every session-scoped slot entry receives.
1319
+ - **Opening a session or a workspace failed silently.** `ctx.sessions.open` is
1320
+ gone; navigation goes through `ctx.uiWorkspace.openSession()` /
1321
+ `connectWorkspace()`. Branching and full-text search go through
1322
+ `ctx.remote.session.fork()` / `.search()` — `ctx.sessions` still declares
1323
+ those two, but the remote namespace is the documented surface — each with an
1324
+ honest failure message when the service is absent.
1325
+ - **Exports lost tool results and the new model-visible messages.** The
1326
+ `tool-result` content block was replaced by a tool-role message whose call id
1327
+ now sits on the message (`toolCallId`, still falling back to `source.callId`
1328
+ for older logs); `system/message` and `developer/message` are exported as
1329
+ injected context; and `file`, `tool-addition`, `tool-removal`, and offloaded
1330
+ `image` blocks are named instead of dropped.
1331
+ - `conversation.chat.turnTail` changed from a chain slot to a list slot, so its
1332
+ `select` registration option no longer applies and was replaced by an id and
1333
+ order.
1334
+ - Client diagnostics are throttled per message kind. The previous single shared
1335
+ window let the frequently emitted rail line swallow the one-shot timeline
1336
+ result line, which made a successful timeline fetch look like zero turns.
1337
+ - `pnpm smoke` now checks the manifest fields dsh reads before it activates a
1338
+ bundle (client platform and `./client` export, patch path, icon size, locale
1339
+ display metadata, and peer ranges agreeing with the build target), so an
1340
+ unsupported or stale declaration fails the local gate instead of being skipped
1341
+ silently in a user's profile. The peer check refuses to read a range form it
1342
+ cannot interpret, and every `files` entry must resolve to something in the tree
1343
+ — an entry matching nothing used to publish a bundle missing that piece. Both
1344
+ new rules were confirmed red by breaking them on purpose. The
1345
+ `dsh.client.inject` rows are counted, not resolved: only a running shell knows
1346
+ which module ids it serves, so a retired name there is caught by the live
1347
+ boot-graph probe below, not by this gate.
1348
+ - A search excerpt now extends its window so a pasted query longer than two
1349
+ thirds of the excerpt is still shown whole. Measured first: the previous
1350
+ centering already covered ordinary queries, including a hit at the very end of
1351
+ a long message, so only the long-query case was affected — the fix is narrow,
1352
+ and the added test fails against the old formula.
1353
+ - Exports no longer fail outright on a `tool/result` event whose `message` is
1354
+ absent, and the scan fallback reads each event shape through its own typed
1355
+ case instead of a cast that hid real field drift.
1356
+ - When cross-session full-text search is unavailable, the palette says what still
1357
+ works (title matching over sessions and workspaces) instead of showing a bare
1358
+ error.
1359
+ - Added `scripts/live-dsh-check.sh`: a manual probe that runs against a *running*
1360
+ isolated dsh profile and exercises the host half on real session data
1361
+ (timeline, the three export formats, the search scan path, usage scan, backup,
1362
+ a UTF-8 state round trip, the Mermaid engine route, the client→host diagnostic
1363
+ ring, both fences, and the boot graph the shell serves), exiting non-zero on
1364
+ any failure. CI has no harness to talk to, so this is the check to run when a
1365
+ dsh release lands. Verified against 0.1.7-rc.2 with 19 probes green; the
1366
+ session-dependent ones `SKIP` — and the closing line counts them instead of
1367
+ claiming a clean sweep — when the scratch home holds no session, and the UTF-8
1368
+ probe was shown to distinguish a correct write from the mangled-bytes write it
1369
+ guards against.
1370
+ - The live check itself was then tested against a dead endpoint and found two of
1371
+ its own probes green-by-absence; the restore probe now refuses to pass when the
1372
+ append it restores never landed. Running it against a real profile exposed five
1373
+ more defects in the tool, all fixed: restoring the prompt library through
1374
+ `curl -d "$var"` mangled non-ASCII to U+FFFD (Git Bash re-encodes non-ASCII
1375
+ argv for `curl.exe`), so bodies are now written by node and sent with
1376
+ `--data-binary @file`; the script checked out with CRLF endings (the stored
1377
+ blobs were already LF — `core.autocrlf` was rewriting them on checkout, now
1378
+ pinned by `.gitattributes`); its search probe read the query word with a greedy
1379
+ `sed` that needed *some* six-letter run anywhere after the last `"text":"`, so
1380
+ it silently `SKIP`ped the one probe covering the scan path; it looked for
1381
+ sessions under `<state file>/../sessions`, which only finds anything because
1382
+ Windows folds the path lexically and would see nothing on a POSIX shell; and
1383
+ the real-home guard missed a `DSH_HOME` written with a trailing separator,
1384
+ which is exactly the spelling that would have probed a developer's own harness
1385
+ home.
1386
+ - The READMEs add a plugin-to-dsh compatibility table. A mismatched pair is not
1387
+ silent — dsh logs `disabling profile plugin …` on stderr, rejects the install,
1388
+ and models the state as `incompatible` in the plugin manager — but none of that
1389
+ reaches the page a user is looking at, so the supported window belongs in the
1390
+ README.
1391
+
1392
+ ### Verified by independent review
1393
+
1394
+ Four reviewers were dispatched against `30e025b..HEAD` with separate charters
1395
+ (code correctness, claims-vs-evidence, contract-vs-installed-runtime, and a
1396
+ deep re-audit pinned to the previous commit). Their findings were each
1397
+ re-verified before being acted on; three of their "critical" items were
1398
+ refuted by measurement and are recorded below so nobody re-litigates them.
1399
+
1400
+ - Fixed: `package.json` declared `"icon"` twice. `JSON.parse` keeps the last
1401
+ value, so every gate stayed green on a manifest npm would warn about. `pnpm
1402
+ smoke` now counts top-level keys in the file text and compares them with what
1403
+ survived parsing, and separately checks that `engines.dsh`'s floor names the
1404
+ installed dsh-tools release (nothing in dsh reads `engines.dsh`, so this is
1405
+ the only place that keeps it honest).
1406
+ - Fixed: the session probes looked under `<state file>/../sessions`, which only
1407
+ resolves because Windows folds the path lexically; they now use the home
1408
+ directory directly. Skips are counted and named in the closing line, a missing
1409
+ boot-graph URL line fails instead of vanishing, the Mermaid probe reads
1410
+ `mermaidSource` rather than inferring "local" from a byte count, and a
1411
+ rejected state write now carries the host's own error text.
1412
+ - Fixed: the restore probe was vacuously green — it never checked that the
1413
+ append it restores had landed. It now refuses to pass when the write failed,
1414
+ verified by mutating the write condition and watching exactly that line go
1415
+ red.
1416
+ - Fixed: the client's last-holder clear left `turns` and the rail positions
1417
+ behind with no session identity, and a holder whose `sessionId` prop flipped to
1418
+ null could wipe the identity other holders were still rendering. A null holder
1419
+ now claims nothing at all.
1420
+ - Fixed: `slots.inject`'s callback registered the component outside the
1421
+ surrounding `try`, so a rejected registration would take a surface down
1422
+ silently while the diagnostic ring still read green; the deferred `register`
1423
+ has its own guard now, and the summary line reports how many injection
1424
+ requests it actually submitted rather than asserting "8 / 7" — dsh defers the
1425
+ callback until a slot is declared, so no line printed at install time can
1426
+ claim a surface materialized; the per-slot `ok` / `register` lines do that.
1427
+ - Fixed: the search request was passed as `as never`, which hid that `values`
1428
+ must be `keyof SessionEventMap` rather than `string`; typed, the compiler
1429
+ caught it immediately. A synchronous throw from `searchEvents` now degrades to
1430
+ the scan path like a rejection does, a log with exactly 100 hits no longer
1431
+ claims there are more, and the scan's role filter is exercised by a fixture
1432
+ that only it can exclude. Each of the three is pinned by a test that fails
1433
+ against the code it replaces (verified by reverting one at a time).
1434
+ - Fixed: the sidebar footer button ignored the `wide` prop the host supplies, so
1435
+ its label wrapped into a vertical stack inside the 56px rail — measured both
1436
+ ways on a live profile: 36px icon-only when collapsed, "项目" again at 280px.
1437
+ - Added `scripts/check-boot-graph.mjs`, run by the live check: the served
1438
+ `__DSH_BOOT__` graph must contain our row, every `dsh.client.inject` target,
1439
+ and reachable client bytes. This is the only gate that can see the failure
1440
+ shape that started this whole upgrade — a manifest naming a module the shell no
1441
+ longer serves — and it was confirmed red by pointing the inject list at the
1442
+ retired `@deepseek-ai/dsh-client-runtime`.
1443
+ - Measured against dsh 0.2.0-rc.1 (published the day after this release):
1444
+ `dsh plugin add` rejects the bundle and rolls the profile back; with the
1445
+ exact-version exemption granted, the source typechecks against 0.2's own
1446
+ types, 111/111 unit tests pass, 19/19 live probes pass, and the browser
1447
+ behaves as on 0.1.7 — eight slot registrations, the rail, prompt insertion,
1448
+ the `Ctrl+K` palette with title search, and quote-reply. The peer range is
1449
+ deliberately not widened: `^0.2.0-rc.1` would silently admit every 0.2.x
1450
+ release, including a stable nobody has reviewed — the very failure this
1451
+ upgrade exists to prevent. What stays unverified there (branch / Mermaid /
1452
+ LaTeX chips) is unverified here too: those need a real model reply.
1453
+ - Accepted and published: a human walked the isolated 0.1.7-rc.2 profile in a
1454
+ browser (personalization panel, prompts into the composer, project folders, the
1455
+ timeline rail, quote reply, export entries, `Ctrl+K`) and reported it behaving.
1456
+ The same person then ran 0.5.0 on their own machine — dsh upgraded to
1457
+ 0.1.7-rc.2, plugin updated through the in-app market — and reported it
1458
+ behaving there too. That install's `lib/client.js` is md5
1459
+ `6639a0aebbe7d0eed32b0c2c5c50c544`, 207762 bytes: byte-identical to the repo
1460
+ build this section describes, so the chain "what was verified = what was
1461
+ published = what a user runs" is closed at both ends.
1462
+ Not covered by either pass, in this or any release until someone runs it with a
1463
+ key: the per-turn chips (branch, Mermaid render, LaTeX/MathML) and the real
1464
+ balance figures, all of which need an actual model reply. `0.5.0` was then
1465
+ published to npm, and the tarball pulled back from the registry was verified
1466
+ byte-identical to the `lib/` this section describes (34 files, 215634 B).
1467
+ - Retracted after re-measurement, so the record does not carry them: "the
1468
+ `slots.inject(key, fn)` service method does not exist in 0.1.7" (it is
1469
+ declared at `dsh-client-ui-renderer`'s registry interface, and all eight
1470
+ surfaces materialize in a live browser); "`data-chat-flow-kind` is gone, so the
1471
+ rail has no anchors" (the reading was taken while the host's trajectory tab had
1472
+ the chat flow unmounted); "`WorkspaceSnapshot.state` was renamed to `phase`"
1473
+ (both axes ship side by side). Corrected in place: `ctx.sessions` still
1474
+ declares `fork()` and `search()` (only `open` is gone), the `current` field and
1475
+ the turnTail kind change both landed in 0.1.6-alpha.2 rather than 0.1.7, and
1476
+ the bilingual README gate enforces hash freshness, not content parity.
1477
+
1478
+ ## 0.4.2 — 2026-09-12
1479
+
1480
+ ### Fixed
1481
+
1482
+ - **Exports fail on forked/resumed sessions with "读取会话失败: seeded
1483
+ session constructor seed must equal its inherited prefix".** Newer dsh
1484
+ builds replay-validate inside `sessionQuery.readSession()` through a
1485
+ snapshot-mode constructor that rejects any seeded (forked or resumed) session
1486
+ whose log outgrew its seed boundary, so timeline, export, in-session
1487
+ search, and usage scans all failed on those sessions. Every read now goes
1488
+ through a shared helper that falls back to `observeSession()` (the live and
1489
+ restore paths dsh's own session page uses) when `readSession()` rejects, and
1490
+ surfaces the original error only when no fallback exists.
1491
+ - **The "PDF(含图片)" export button produced an `.html` file.** The button and
1492
+ its description now say what actually lands on disk: "HTML(含图片)", a
1493
+ print-ready HTML document you turn into a PDF via the browser print dialog.
1494
+ - **Weather FX are invisible on light backgrounds.** Snow, rain, and sakura
1495
+ colors were tuned for the dark theme only — pure-white flakes, 6%-alpha pale
1496
+ rain, and 90%-lightness pink petals all vanish over the near-white palette
1497
+ backgrounds. The FX canvas now picks a darker particle palette (cool slate
1498
+ snow, steel-blue rain, deeper rose petals, each with a lifted alpha floor)
1499
+ whenever the resolved theme is light or the saturated aurora background is
1500
+ active, and swaps palettes live on theme/background changes without
1501
+ rebuilding the particle field.
1502
+
1503
+ ## 0.4.1 — 2026-09-09
1504
+
1505
+ ### Fixed
1506
+
1507
+ - **Fresh installs show nothing after a "successful" install.** `keytar` (a
1508
+ native optional dependency) tripped pnpm 11's strict build-script gate, so
1509
+ `dsh plugin add` exited non-zero and the harness never reconciled the bundle
1510
+ layer — the package sat inert in `dependencies` with no host half and no
1511
+ browser half. `keytar` is no longer a dependency: the OS-keyring adapter
1512
+ still detects a `keytar` module present in the profile's `node_modules`, and
1513
+ users who want the OS keyring can add it themselves
1514
+ (`dsh plugin --profile web add keytar`).
1515
+ - The browser half now waits for the `slots` service (a child fiber) before
1516
+ mounting its surfaces instead of reading it synchronously: newer dsh builds
1517
+ activate the slots provider after this plugin's entry, and the synchronous
1518
+ read lost that race every time, logging "slots service unavailable" and
1519
+ skipping all UI. The mount stays fail-soft — the GUI boots even when the
1520
+ service never appears.
1521
+
1522
+ ## 0.4.0 — 2026-09-03
1523
+
1524
+ ### Added
1525
+
1526
+ - 7 / 30 / 90-day usage trends, per-model summaries, CSV export, and local monthly CNY budget warnings.
1527
+ - Versioned, secret-free state backup with previewed merge/replace import and automatic recovery copies.
1528
+ - Editable, tagged, sortable favorite prompts with usage recency, `{{variable}}` templates, and JSON / Markdown portability.
1529
+ - Indexed current-session search and a Ctrl/Cmd+K command palette backed by DSH's official search APIs.
1530
+
1531
+ ### Changed
1532
+
1533
+ - Batch archive skips running sessions and reports separate success and failure counts.
1534
+ - Existing prompt and config documents are normalized for the new optional fields.
1535
+
1536
+ ### Fixed
1537
+
1538
+ - State-dependent routes now wait for the initial local state load; usage events
1539
+ arriving during an import, edit, or usage scan are queued and persisted instead
1540
+ of racing a stale snapshot.
1541
+ - Backup imports reject malformed counters/configuration, honor imported folder
1542
+ parents and sibling order, and keep the 5 MiB document boundary distinct from
1543
+ the JSON request envelope.
1544
+ - Search hits carry their session id and archive batches retain per-item errors;
1545
+ stale cross-session clicks and swallowed archive failures now surface clearly.
1546
+ - Malformed persisted peak counters, invalid calendar buckets, failed usage
1547
+ rebuilds, and partial state edits are handled without presenting or keeping
1548
+ a misleading snapshot; backup requests now validate their envelope fields.
1549
+
1550
+ ### Security
1551
+
1552
+ - Backups exclude API keys and credential metadata; imports preserve the active credential.
1553
+ - Archive restore remains deferred until DSH exposes an official API.
1554
+
1555
+ ## 0.1.6 — 2026-09-02
1556
+
1557
+ ### Fixed
1558
+
1559
+ - Usage scans now preserve the live ledger when a session read fails or new
1560
+ usage arrives during replay, and return the replayed Beijing day so a
1561
+ midnight-crossing scan cannot relabel its result.
1562
+ - Legacy API-key migration no longer overwrites an existing system credential;
1563
+ failed system-key deletion is reported instead of being treated as success.
1564
+ - Legacy usage rows without a recoverable peak/off-peak split are marked as
1565
+ inexact and are no longer shown with a misleading cost estimate.
1566
+ - DeepSeek peak/off-peak cost estimates now treat only Beijing Monday-Friday
1567
+ 09:00–12:00 / 14:00–18:00 as peak; weekends are off-peak.
1568
+ - The browser usage panel now uses the same Beijing-time day bucket as the
1569
+ Host, including when the desktop host runs outside UTC+8.
1570
+ - Client state snapshots are serialized in invocation order so rapid settings
1571
+ changes cannot be overwritten by an older save completing later.
1572
+ - Timeline refreshes ignore stale session/request responses and follow live
1573
+ conversation running-state changes.
1574
+ - Mermaid modal changes reload correctly, while concurrent CDN loads share one
1575
+ in-flight request; the balance hover panel also remains reachable across its
1576
+ trigger gap.
1577
+
1578
+ ### Changed
1579
+
1580
+ - Centralized the cost formula, added explicit `deepseek-v4-flash-vision-exp`
1581
+ pricing, and covered the rule with unit tests.
1582
+ - Usage history is pruned to 90 Beijing calendar days; usage scans use four
1583
+ concurrent reads and share one in-flight scan instead of duplicating work.
1584
+ - The balance panel now shows the peak/off-peak token and cost split, pricing
1585
+ source link, and the built-in rule check date.
1586
+ - Saved panel keys prefer the optional OS credential store, migrate legacy
1587
+ state-file keys when possible, and no longer cross the browser state boundary.
1588
+ - Light/dark root theme styles now take precedence over the host OS preference,
1589
+ and the build uses the current tsdown dependency configuration without
1590
+ deprecation warnings.
1591
+
1592
+ ### Added
1593
+
1594
+ - Regression coverage for ordered state saves and shared in-flight Mermaid
1595
+ loading.
1596
+
1597
+ ## 0.1.3 — 2026-08-23
1598
+
1599
+ ### Fixed
1600
+
1601
+ - Concurrent state saves are serialized per state file: two racing saves could
1602
+ collide on the shared `.tmp` file and fail the rename on Windows; a failed
1603
+ debounced save now surfaces in the status-tool diagnostics instead of being
1604
+ swallowed silently.
1605
+
1606
+ ### Added
1607
+
1608
+ - CI: bilingual README hash consistency check (`node scripts/check-readme-i18n.mjs`)
1609
+ — editing one language without the other, or forgetting to re-record the
1610
+ hashes in `README.i18n.yaml`, now fails the build instead of drifting silently.
1611
+ - CI: Dependabot with monthly schedules (GitHub Actions and grouped npm
1612
+ minor/patch bumps); workflow actions upgraded to current majors.
1613
+ - `pnpm smoke` — post-build smoke script: headless Edge loads `lib/client.js`
1614
+ against a stubbed module loader and asserts the registration handshake, plus
1615
+ artifact contract checks (loader banner/footer, node-half ESM import,
1616
+ patch row, local Mermaid engine).
1617
+ - Tests: the balance key resolution chain (panel → environment → DSH
1618
+ credentials, via a new credential-reader seam), state merge edge cases, and
1619
+ concurrent-save serialization.
1620
+ - Docs: the security section now states explicitly that the panel-pasted key
1621
+ is stored in plaintext in the state file (same trust domain as DSH's own
1622
+ credentials).
1623
+ - This changelog (also shipped in the npm tarball).
1624
+
1625
+ ## 0.1.2 — 2026-08-23
1626
+
1627
+ ### Fixed
1628
+
1629
+ - **Mermaid diagrams in assistant replies now render in place.** The rendering
1630
+ entry previously hooked only user messages, so assistant-generated diagrams —
1631
+ mindmaps in particular — never got an entry point. A `MutationObserver` now
1632
+ scans GUI code blocks and renders ```mermaid``` fences where they are
1633
+ (`MermaidInPlace`), without moving any React-owned nodes.
1634
+
1635
+ ### Changed
1636
+
1637
+ - Mermaid engine is a local runtime dependency served by the host; the CDN
1638
+ mirrors are a fallback only. The source (`local` / `cdn`) is visible in the
1639
+ status tool diagnostics.
1640
+
1641
+ ### Added (repository-side)
1642
+
1643
+ - GitHub Actions CI (Node 22 + pnpm 11: typecheck / test / build), README
1644
+ badges, and a bilingual screenshot gallery under `docs/`.
1645
+
1646
+ ## 0.1.1 — 2026-08-22
1647
+
1648
+ ### Security
1649
+
1650
+ - Mermaid rendering hardened: `securityLevel: strict` (was `loose`), and the
1651
+ `/custom-plugin/mermaid.js` engine route is behind the same loopback trust
1652
+ fence as every other route.
1653
+
1654
+ ### Fixed
1655
+
1656
+ - Peak/off-peak pricing and daily usage buckets are computed in Beijing time
1657
+ (UTC+8) regardless of the host machine's timezone; tests are
1658
+ timezone-independent.
1659
+
1660
+ ### Changed
1661
+
1662
+ - `@deepseek-ai/dsh-tools` moved to `peerDependencies` and externalized from
1663
+ the bundle — `lib/index.js` shrinks from ~245 KB to ~45 KB and shares the
1664
+ harness instance at runtime.
1665
+ - Dead code removed: unused `afterSeq` incremental timeline protocol and cache,
1666
+ unused type re-exports, dead client state fields, unconditional startup log.
1667
+
1668
+ ### Added
1669
+
1670
+ - Self-contained `prepare` script — GitHub source installs build themselves
1671
+ (pnpm ≥ 10 users: allowlist the build script, see README).
1672
+ - Package metadata: `repository`, `author`, `bugs`, `homepage`,
1673
+ `engines` (Node ≥ 22); LICENSE copyright line filled in.
1674
+
1675
+ ## 0.1.0 — 2026-08-22
1676
+
1677
+ Initial release: a personalization suite for the DSH web GUI, mounted through
1678
+ the official profile mechanism without touching DSH source.
1679
+
1680
+ - Appearance: background palettes, liquid glass, weather effects
1681
+ (rain / sakura / snow).
1682
+ - Per-user-message timeline rail with stars and branching.
1683
+ - Multi-level project folders; prompt library.
1684
+ - Conversation export (JSON / Markdown / PDF with images).
1685
+ - Mermaid rendering; quote reply.
1686
+ - DeepSeek balance and daily token usage (peak/off-peak aware).
1687
+ - `custom_plugin_status` agent-facing diagnostic tool.