@surfishs/dsh-prompt-enhance 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.en.md +3 -0
  2. package/README.md +3 -0
  3. package/cordis.patch.yml +1 -1
  4. package/lib/client.js +454 -397
  5. package/lib/index.js +67 -56
  6. package/lib/index.js.map +3 -3
  7. package/package.json +23 -15
  8. package/src/client/ActionIcons.tsx +4 -17
  9. package/src/client/EnhanceButton.tsx +52 -48
  10. package/src/client/ResultDock.tsx +22 -9
  11. package/src/client/ResultPanel.tsx +83 -52
  12. package/src/client/SparkleFishIcon.tsx +3 -13
  13. package/src/client/SparkleIcon.tsx +2 -12
  14. package/src/client/UndoBar.tsx +11 -6
  15. package/src/client/enhance-client.ts +44 -40
  16. package/src/client/index.tsx +3 -12
  17. package/src/client/llm-catalog.ts +14 -16
  18. package/src/client/locales.ts +20 -4
  19. package/src/client/reasoning-options.ts +7 -15
  20. package/src/client/settings-page-controls.tsx +449 -0
  21. package/src/client/settings-page-copy.ts +112 -0
  22. package/src/client/settings-page-spec.ts +330 -0
  23. package/src/client/settings-page-styles.ts +161 -0
  24. package/src/client/settings-page.tsx +166 -1109
  25. package/src/client/settings-source.ts +41 -31
  26. package/src/client/settings.ts +17 -12
  27. package/src/client/shortcut.ts +7 -6
  28. package/src/client/styles.ts +52 -0
  29. package/src/client/useDockAlignment.ts +5 -15
  30. package/src/config.ts +84 -27
  31. package/src/context.ts +1 -5
  32. package/src/enhance-routes.ts +8 -8
  33. package/src/enhancer.ts +43 -34
  34. package/src/orchestrate.ts +19 -23
  35. package/src/prompts.ts +4 -4
  36. package/src/provider-catalog.ts +1 -1
  37. package/src/reasoning-cache.ts +4 -4
  38. package/src/reasoning-efforts.ts +4 -9
  39. package/src/settings-source.ts +37 -23
  40. package/src/shared/limits.ts +38 -0
  41. package/src/shared/normalize.ts +4 -1
  42. package/src/shared/protocol.ts +27 -23
  43. package/src/shared/reasoning.ts +1 -7
  44. package/src/shared/stream-text.ts +0 -6
  45. package/src/shared/validate.ts +3 -9
  46. package/docs/code-review-2026-09.md +0 -211
  47. package/docs/handoff-settings-page.md +0 -195
  48. package/docs/release-0.2.3.md +0 -47
  49. package/docs/release-0.2.4.md +0 -20
  50. package/docs/release-0.2.5.md +0 -28
  51. package/docs/release-0.2.6.md +0 -33
  52. package/docs/release-0.2.7.md +0 -22
  53. package/docs/release-0.3.0.md +0 -36
  54. package/docs/release-0.3.1.md +0 -50
  55. package/docs/release-0.3.2.md +0 -41
  56. package/docs/release-0.3.3.md +0 -53
  57. package/docs/release-0.3.4.md +0 -43
@@ -1,211 +0,0 @@
1
- # dsh-prompt-enhance 代码审阅报告
2
-
3
- 审阅对象:`dsh-prompt-enhance@0.2.2`(单包双半的 DSH Web GUI 提示词增强插件)
4
- 审阅方式:全量静态阅读 + 依赖契约逐项比对 + 真实 `tsc`/`vitest`/`esbuild` 验证 + **GUI 实机冒烟**
5
- 最终状态:typecheck 通过、**20 文件 / 207 用例全绿**、`lib/` 产物与 `src/` 一致、**插件在真实 `dsh web` 中加载并可用**
6
-
7
- ---
8
-
9
- ## 一、功能定位
10
-
11
- 在 dsh Web GUI 的作曲区提供一个「增强」入口:把草稿经 harness 自带 LLM 服务低温重写为结构化提示词,预览原文/结果后回填、复制或撤销。
12
-
13
- **硬约束(修复过程中一律未改动)**
14
-
15
- - 原文永不被动修改:只有显式「回填」才会改动作曲区,且可一键撤销。
16
- - 结果永远是规范化正文(去代码围栏、trim),超长输入**拒绝而非截断**。
17
- - 流式仅为显示:最终应用内容始终来自 `normalizeOutput` 的完整结果。
18
- - 上下文感知失败即 fail-open 回退到单条增强,绝不因读不到历史而失败。
19
-
20
- **模型路由优先级**:设置里的 provider/model 对 → 会话请求头路由 → harness 默认模型。
21
-
22
- ---
23
-
24
- ## 二、目录结构与入口
25
-
26
- ```
27
- src/
28
- index.ts 宿主入口:name/inject、跨代设置分区装配、装配 route+command
29
- config.ts schemastery schema、DEFAULT_CONFIG、resolveConfig
30
- enhance-routes.ts 两个 POST 端点:准入闸门、限流/并发、SSE 与 JSON
31
- enhance-command.ts /enhance 斜杠命令
32
- orchestrate.ts 两条入口共用的路由解析 + 上下文装配
33
- enhancer.ts 一次 LLM 调用:超时竞速、BlockAssembler、finish 校验、错误映射
34
- context.ts 会话历史 → 有界、去框架化的 <conversation_context> 片段
35
- prompts.ts 内置增强策略 + 上下文规则 + <raw_prompt> 框架化
36
- loopback.ts socket + Host + Origin 三重信任围栏(防 DNS rebinding)
37
- http.ts readBoundedJson / writeJson
38
- sse.ts 带背压的 SSE 帧写入器(本次新增)
39
- shared/ protocol / validate / normalize / stream-text(两端共用)
40
- client/
41
- index.tsx 词典注册、设置镜像、两个 slot 注册、快捷键
42
- EnhanceButton.tsx 守卫链 + fetch + 面板 + 回填/undo
43
- ResultPanel.tsx 预览面板(loading/stream/result/error、焦点陷阱、复制兜底)
44
- UndoBar.tsx 撤销条
45
- enhance-client.ts 同源 fetch + SSE 读取 + 类型化错误
46
- settings.ts 客户端设置镜像(不 import host config)
47
- shortcut.ts 快捷键解析/匹配(event.code 优先,布局无关)
48
- ui-state.ts 面板/undo/session 注册表 + 微任务合并 delta
49
- session-key.ts sessionId 兼容 shim(0.1.1-rc ↔ 0.1.2-rc)
50
- undo-stack.ts 按会话的深度受限 undo 栈
51
- locales.ts 中英文字典
52
- styles.ts 自注入样式
53
- ```
54
-
55
- - **宿主半**:`exports["."]` → `lib/index.js`(ESM,包引用保持 external)
56
- - **浏览器半**:`dsh.client` → `lib/client.js`(CJS,包进 `window.__ModuleLoader__.load`)
57
- - **bundle patch**:`cordis.patch.yml` 把插件行插入 web profile 名单
58
-
59
- ---
60
-
61
- ## 三、发现的问题与处置
62
-
63
- ### P0-1 `error.upstream.<reason>` 键名错配(8 个原因中 5 个失效)
64
-
65
- 线上 `reason` 是 kebab-case,字典键是 camelCase,用 `` `error.upstream.${reason}` `` 拼键导致 `invalid-credential`/`rate-limit`/`context-window`/`tool-call`/`max-tokens` 全部落空,永远退化成通用文案——而对应词条其实早已写好。
66
-
67
- **处置**:改为显式映射表 `UPSTREAM_ERROR_KEYS`(`PromptEnhanceKey` 字面量校验),并补两层回归测试(键集一致性 + 真实面板逐 reason 渲染 + 负例)。
68
-
69
- ### P0-2 `npm run typecheck` 在 CI 第一步即断
70
-
71
- `tests/client-components.test.tsx` 导入了未公开的 `InputState`(该类型刻意不从包根与 `./client` 转出),导致 `tsc` 报错;CI 顺序为 typecheck → test → build,因此后续从未执行。
72
-
73
- **处置**:测试改为本地字面量类型。过程中曾尝试用 `Parameters<>` 从 slot props 反推,核实后发现 `SnapshotSelectorHook<T>` 在 selector 上对 `T` 泛型、会擦除状态类型,该写法不可编译,故弃用并在注释中说明原因。
74
-
75
- ### P0-3 运行时依赖声明不完整
76
-
77
- - `lib/client.js` 实际 `require("react")`/`require("react-dom")`/`require("react/jsx-runtime")`,但只声明了 `react`。
78
- - `lib/index.js` 静态 `import "@deepseek-ai/dsh-llm"`,却只写在 devDependencies。
79
-
80
- **处置**:`peerDependencies` 补 `react-dom`、`@deepseek-ai/dsh-llm`;`dsh.client.inject` 补 `react-dom`。
81
-
82
- ### P1-1 SSE 响应从不结束(隐藏最深的真缺陷)
83
-
84
- 流式路由写完 `done` 帧后从不调用 `res.end()`,chunked 响应永远缺 `0\r\n\r\n`:
85
-
86
- - 浏览器里"看起来正常"——客户端在 `done` 帧上 `return` 并 `reader.cancel()`,掩盖了它;
87
- - 但**每次流式增强都泄漏一个未收尾的响应**,keep-alive 无法复用连接;
88
- - 任何整 body 读取者(`response.text()`、curl、反向代理、访问日志中间件)**永久挂起**。
89
-
90
- **处置**:路由在 `done` 帧后调用 `res.end()`(带 `writableEnded`/`destroyed` 守卫与 try/catch,避免客户端中途断开时抛出覆盖真实结果)。既有测试从未覆盖 SSE 端点,是它长期潜伏的原因;本次补了 SSE 端到端用例,并用裸 socket 字节打印取得铁证(修复前末尾无 `0\r\n\r\n`,修复后有,且 `response.text()` 从永久挂起变为 `200 / 236 bytes`)。
91
-
92
- ### P1-2 SSE 帧写入无背压
93
-
94
- 忽略 `res.write()` 返回的 `false`,慢客户端可让 socket 缓冲无界增长。
95
-
96
- **处置**:新增 `src/sse.ts`——帧在缓冲区满时停靠至 `drain`,`close` 释放停靠,`dispose()` 释放监听;配 10 条单测。
97
-
98
- ### P0-4 浏览器半硬声明可选服务,导致整个 Web 启动失败(本次审阅引入的回归)
99
-
100
- 我把 `settingsScope` 写进了客户端半的 `inject`。cordis 的契约是"`inject` 里列了谁,就等于没有它就不加载"(`Plugin.Base.inject`:*Services the plugin requires; it only loads while all are available*),而该服务由可选的设置面板包 `@deepseek-ai/dsh-client-ui-settings` 提供——目标 profile 的 bundles 名单里没有它。结果插件永久 `pending`,shell 把"有 entry 没激活"当作致命错误,**整个 GUI 白屏**,报错为 `web boot: 1 entry did not activate`。
101
-
102
- **处置**:改为**不硬依赖任何服务**——`slots`/`locale`/`settingsScope` 全部走可选的 `ctx.inject`,`apply` 本体不直接触碰任何服务;缺服务时降级(无设置面板则用内置默认值,无 locale 则渲染字典键)。配 `tests/client-apply.test.ts`(4 条)锁定"裸环境也必须能启动"。
103
-
104
- ### P0-5 渲染期脆性读取使插槽条目被错误边界卸载(既有缺陷)
105
-
106
- `EnhanceButton` 直接读 `state.imageIds.length` / `state.occurrences.length`。这两个字段在插件编写时所依据的 dsh 版本里属于输入快照,但 slot 宿主不保证提供;字段缺失时 `.length` 在**渲染期**抛错,React 错误边界据此卸载整个 `conversation.input.right` 条目——表现为按钮消失 + 控制台狂刷同一条堆栈(实测 `slot entry crashed in 'conversation.input.right'`),功能彻底不可用。
107
-
108
- **处置**:新增 `countOf` / `stringOf` 防御式读取:字段缺失或类型畸形一律降级为"无此计数 / 空串",代价仅是两条**提示性**守卫(仅图片、含命令块)不触发,增强本身照常。同时给 `UndoBar` 的 `draft` 读取加同样防护(避免把 `undefined` 误判为"用户继续输入"而静默丢弃撤销记录)。配一条回归用例:宿主只提供 `{ draft, phase }` 时按钮必须照常渲染。
109
-
110
- ### P1-3 其他
111
-
112
- - `context.ts` 用 UTF-16 单元而非码点计上下文预算(中文/emoji 场景预算偏差约 2 倍),截断还可能劈开代理对 → 改用共享 `countText` 并按码点截断。
113
- - `resolveConfig` 可原样返回 `provider: ''`,让下游把空串读成"存在覆盖" → 归一为 `undefined`。
114
- - 跨会话 busy 用 `disabled` 静默禁用按钮,键盘/读屏用户连原因都读不到 → 改 `aria-disabled` + 可读原因文案。
115
- - `abort()` 回调抛错会阻断面板状态迁移 → 统一用 `abortOf()` 包裹。
116
- - `ResultPanel` 焦点还原挂在第二个 mount-only effect 上,StrictMode 下会立刻把焦点吐回按钮、使焦点陷阱与 Esc 失效 → 合并进同一 effect 并加"不抢用户已移动的焦点"守卫。
117
- - `openError` 冗余同时传 `message` 与 `localized` → 只留 `localized`。
118
- - CI `node-version: 22` 不满足 `engines: ^22.19.0` → 改为 `'22.19'`。
119
- - `files` 未包含 README 引用的 `docs/` 截图 → 补入;加 `prepublishOnly` 与 `publishConfig.access`。
120
-
121
- ---
122
-
123
- ## 四、验证证据
124
-
125
- | 检查 | 结果 |
126
- |---|---|
127
- | `npm run typecheck` | 通过,无错误 |
128
- | `npm test` | **20 文件 / 207 用例全绿** |
129
- | `npm run build` | 通过;`lib/index.js` 与 `lib/client.js` 均含最新逻辑 |
130
- | `git status`(build 后) | 无产物漂移,符合 CI 的 lib 一致性校验 |
131
- | SSE 协议 | 裸 socket 确认 `0\r\n\r\n` 终止符存在;`response.text()` 正常返回 |
132
- | 安装形态 | `dsh plugin --profile web add link:C:\prompt-enhance-fresh`,插件行显示为 `link:` |
133
- | **GUI 实机** | **插件在真实 `dsh web` 中加载成功、按钮渲染、增强流程可用** |
134
-
135
- **审阅过程中被证伪的两处自身判断(记录以示校准)**
136
-
137
- 1. 我曾判定「`README.md`/`README.zh-CN.md` 不存在、需补写」——错,两份都存在(305/304 行),是目录列举被输出截断误导;最终未改写,只补了 `docs/` 并同步架构树。
138
- 2. 我曾推测 `tests/client-components.test.tsx` 导出的 `sessionId` 是类型错误——错,`dsh-client-runtime` 通过声明合并提供了它(`SessionIdentity` 非可选);真正的类型错误只有 `InputState` 一处。
139
-
140
- **另一条被实践证的教训**:207 个自动化用例全绿,而插件在真实宿主里一加载就崩(P0-5)。差别在于"宿主不提供某些字段"这种**跨版本形状差异**,只有真正装进宿主才暴露得出来——因此新增的两组用例(`tests/client-apply.test.ts` 的裸环境启动、`tests/client-components.test.tsx` 的缺字段渲染)都把"宿主比预期更贫瘠"当作一等公民来锁定。
141
-
142
- ---
143
-
144
- ## 五、GUI 冒烟结果
145
-
146
- 已在真实 `dsh web` 中完成基础冒烟:插件加载、作曲区按钮渲染、增强流程可用。
147
-
148
- 仍建议按需逐条确认的细项(均已有自动化覆盖,此处仅列人工回归点):
149
-
150
- 1. Settings → 插件配置出现 `prompt-enhance` 分区(目标 profile 未打包设置面板时,此项**预期不出现**,功能自动使用内置默认值)。
151
- 2. ✨ 按钮与 `Ctrl+Alt+E` 走同一流程;空输入/超长/含引用块各自给出可读拒绝文案。
152
- 3. 预览面板:回填 → 撤销条出现 → 撤销恢复原文;复制可用(含非安全上下文回退)。
153
- 4. 流式增强:文字边写边显示,结束后面板**平滑切到规范化结果**(`display.finish()` 冲刷确保末尾字符不丢)。
154
- 5. `/enhance <文本>` 在命令面板可复制、不进入模型历史。
155
- 6. 多会话布局:另一会话增强中时,本会话按钮给出"另一个会话正在增强中"提示而非静默变灰。
156
- 7. 上游错误(如错误 API Key)能否显示**具体**修复提示(对应 P0-1 的修复面)。
157
-
158
- ---
159
-
160
- ## 六、安装形态提醒
161
-
162
- 当前 profile 通过 `link:` 指向本仓库,**宿主半改动必须重启 `dsh web`**;且 profile 的 `package.json` 里若残留 `^0.2.x` 语义版本声明,任何一次 `npm install` 都可能把 `link:` 覆盖回 npm 上的版本,从而静默丢掉本地修复。
163
-
164
- ---
165
-
166
- ## 七、发布记录(本次交付闭环)
167
-
168
- 审阅修复经多轮提交交付,并已发布到 npm 与 GitHub。
169
-
170
- ### 版本演进
171
-
172
- | 版本 | 内容 | 状态 |
173
- |---|---|---|
174
- | `0.2.1` / `0.2.2` | 审阅前已发布(**不含本次任何修复**) | 已被 0.2.4 取代 |
175
- | `0.2.3` | 四个缺陷修复(locale 映射、SSE 未结束、启动崩溃、渲染崩溃)+ 打包面补全 | 已发布,GitHub **Latest** |
176
- | `0.2.4` | 仅打包修正:`@deepseek-ai/dsh-llm` 改为可满足范围的 optional peer | 已发布,npm **latest** / GitHub **Pre-release** |
177
-
178
- ### commit 批次
179
-
180
- | 顺序 | 主题 |
181
- |---|---|
182
- | 1 | `fix: locale reason mapping, package peer surface, SSE backpressure` |
183
- | 2 | `fix: end the SSE response so the streamed route terminates` |
184
- | 3 | `fix(client): never hard-require optional services so boot cannot fail` |
185
- | 4 | `fix(client): tolerate host input states without imageIds/occurrences` |
186
- | 5 | `docs: finalize code review report` |
187
- | 6 | `docs: add 0.2.3 changelog entry`,随后 `npm version patch` 产出 0.2.3 的版本提交与 `v0.2.3` 标签 |
188
- | 7 | `fix: make the dsh-llm peer optional and satisfiable`,随后 `npm version patch` 产出 0.2.4 的版本提交与 `v0.2.4` 标签 |
189
- | 8 | `docs: add release notes for 0.2.3 and 0.2.4` |
190
-
191
- 精确 hash 以 `git log --oneline` 为准;此处刻意不写 hash,避免记录随 rebase/amend 失真。
192
-
193
- ### 发布验证
194
-
195
- | 检查 | 结果 |
196
- |---|---|
197
- | `npm view dsh-prompt-enhance dist-tags --json` | `latest` = **`0.2.4`** |
198
- | `gh release list` | `v0.2.3` = **Latest**;`v0.2.4` = **Pre-release** |
199
- | GitHub 远端 | `main` 已推送(以 `git log origin/main -1` 为准) |
200
- | `npm pack` | 37 个文件(0.2.3/0.2.4 发布时),含 `lib/`、`cordis.patch.yml`、两份 README、`docs/`、`src/` |
201
- | `prepublishOnly` 闸门 | `npm run build && npm test` 各执行一次,207 用例通过后才上传 |
202
-
203
- ### 过程中的两个教训
204
-
205
- 1. **npm 版本号不可覆盖。** 首次 `npm publish` 因「已发布 0.2.2」被拒——这不是权限问题(`npm whoami` 全程为 `rongxingda`),而是 npm 的版本号一次性语义。正确反应是升版本号(`npm version patch`),而非排查权限。任何"改完直接重发同号"的期望都不成立。
206
- 2. **`npm view` 的即时读数是旧快照。** 发布成功后立刻查 `dist-tags` 仍返回 0.2.2,属于 registry 复制延迟;判断发布是否成功应以 `npm publish` 自身的 `+ <pkg>@<version>` 输出为准,稍后再查 dist-tags 复核。
207
-
208
- ### 已知遗留(未处理,供后续决策)
209
-
210
- - `v0.2.0`–`v0.2.2` **有标签但无 GitHub Release 页**;CHANGELOG 的口径已相应限定为「自 0.2.3 起」,因此文档与实际一致,无需补建。
211
- - `files` 含 `"docs"`,因此 Release 正文等文档会随后续版本进入 npm 包(每个约几 KB,不影响功能)。
@@ -1,195 +0,0 @@
1
- # 交接:dsh-prompt-enhance 配置页(feat/settings-section)
2
-
3
- 给下一个会话(创造模式)的交接说明。读这份就够开工,不需要重新调查宿主。
4
-
5
- **状态(2026-11-13)**:插件有**两个**配置入口,共用同一套 staged 表单:
6
- ① 设置对话框左侧「提示词增强」(`settings.section`,这是本插件一直自己画的那页);
7
- ② 插件页(`plugins.row.config`,宿主文档规定的插件自带配置入口)。
8
- 17 个字段全部接通,临时探针已删;`npm run typecheck` / `npm test`(25 文件 / 265 用例)/
9
- `npm run build` 全绿,`lib/client.js` 已重建并复制到运行目录。
10
-
11
- ## 目标
12
-
13
- 在 DSH `0.2.2-rc.1` 桌面版里,为 `dsh-prompt-enhance@0.3.4` 提供配置页。
14
-
15
- 插件作者**没有写过任何设置 UI**:插件只声明 schemastery `Config`,页面过去靠宿主
16
- `SettingsForms.describe()` 按 schema 自动生成;`0.2.2-rc.1` 不再为普通 profile 条目生成。
17
-
18
- ## 两个入口各自是什么
19
-
20
- ### ① 设置对话框页(`settings.section`)
21
-
22
- 插槽契约:`settings.section`,list 槽,注册 `{ id, order, label, locale, inject }`。
23
- 本插件:`id: dsh-prompt-enhance`、`order: 70`、`label: 提示词增强`。
24
-
25
- 这一页的呈现是**刻意保留的诊断形态**:标题 `英文键(中文名)`(如 `enabled(总开关)`),
26
- 提示中英双语用 `|` 连接,页首有一句「这些设置写入宿主侧 dsh-prompt-enhance 配置节」。
27
- 用户明确要求保留这一版 UI,别把它当成「应该统一成人话标题」而改掉。
28
-
29
- ### ② 插件页行配置(`plugins.row.config`)
30
-
31
- 宿主文档(`@deepseek-ai/dsh-client-ui-plugin-manager/README.zh.md`「配置页」)规定:
32
- 自带配置的插件在插件页提供配置,三个 slot 分别是
33
- `plugins.item`(官方插件)、`plugins.bundle.config`(组合包)、
34
- **`plugins.row.config`(`<包名>#<行 id>`)**。行上会多一个「配置」控件,打开该行自己的页面;
35
- 管理器画标题/图标/面包屑,传 `view: 'page' | 'summary'` 和该行的 `form`;离开页面丢弃暂存。
36
-
37
- 本插件:包名 `dsh-prompt-enhance`,行 id `dsh-prompt-enhance`(见 `cordis.patch.yml`),
38
- 注册 key **`dsh-prompt-enhance#dsh-prompt-enhance`**。这一页用 locale 文案(人话标题、单语提示),
39
- `view === 'summary'` 返回「模型、上下文与资源限制」。
40
-
41
- **管理器怎么决定要不要画「配置」控件**(`plugin-manager/lib/client.js`):
42
-
43
- ```js
44
- const configure = (pkg) => ({
45
- has: (row) => ledger.rows.has(rowConfigKey(pkg.name, row.rowId)), // `${pkg}#${rowId}`
46
- open: (row) => setView({ kind: 'row', name: pkg.name, rowId: row.rowId }),
47
- })
48
- ```
49
-
50
- 运行时验证:`cordis_inspect_query`(client `Slots.listSubTree`, root `plugins.row.config`)显示
51
- occupants 里已有 `dsh-prompt-enhance#dsh-prompt-enhance`,同槽还有 `dsh-free-search#web-search-free`、
52
- `@michengai/dsh-btw#michengai-btw`——说明注册是活的,第三方插件也用同一套。
53
- **注意入口位置**:是**侧边栏「插件」面板**(带安装/启停、组合包列表的那个),
54
- 不是 **设置 → 插件**(那是 `settings.plugins.tab` 的标签页宿主,只有「全部 / dsh-market」两个清单页,
55
- 不承载行配置)。
56
-
57
- ## 共用层(两个入口都走它)
58
-
59
- - 一个 `SettingsPageController`:`createSettingsForm(scope)` → `SettingsFormModel(scope, 描述符)`
60
- → `bind(projection)` 出 store → `inject()` 返回 `{ hooks: { promptEnhance: store }, ...form.actions() }`。
61
- 两个槽的 `inject` 都指向同一个 controller,因此两页共享同一份暂存状态。
62
- - `SettingsRows` 渲染 17 行;两种 `RowCopy` 只决定文案:`SECTION_COPY`(键名+中文名、双语提示)
63
- 与 `pageCopy(t)`(单语、跟随 locale)。
64
- - 三种行形态:3 个布尔(`enabled` / `contextAware` / `streaming`)用 `Switch`;
65
- 2 个枚举(`strategyMode` / `reasoningEffort`)用 `SegmentedControl`;
66
- 其余 12 个用 `SettingsValueField`(文本/数字)。
67
-
68
- ## primitives 契约(从壳 bundle 实测,省得重新挖)
69
-
70
- primitives 编译进了 Web 壳前端包,就在 app.asar 里:
71
-
72
- ```
73
- dsh/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-*.js (约 970 KB)
74
- ```
75
-
76
- asar 可以直接用 node 读(pwsh 的 `Get-ChildItem` 只把它当文件):
77
-
78
- ```js
79
- // 本机 app.asar 的 header 有 12 字节 pickle 前缀,JSON 从 offset 16 开始
80
- const b = fs.readFileSync('D:\\DeepseekHarness\\resources\\app.asar')
81
- const len = b.readUInt32LE(12)
82
- const header = JSON.parse(b.subarray(16, 16 + len).toString('utf8'))
83
- // base = 16 + len;条目 offset 相对 base,按 header.files 找到目标路径后切片
84
- ```
85
-
86
- 官方设置页源码同在同一份 asar:`dsh-client-ui-settings-agent-loop/lib/client.js`(最小例子)、
87
- `...-web-search/lib/client.js`(`Switch` + 多 namespace + 自定义保存顺序)。
88
-
89
- **导出**(相关部分):`SettingsForm`、`SettingsFormModel`、`SettingsValueField`、
90
- `SettingsSecretField`、`settingsTextField`、`settingsNumberField`、`Switch`、
91
- `SegmentedControl`、`Tag`、`Menu`、`Modal` 等。
92
-
93
- **字段描述符是普通对象**,布尔/枚举可以自写,不必绕过表单模型:
94
-
95
- ```ts
96
- settingsTextField(k) → { field:k, format:v => typeof v==='string' ? v : '',
97
- parse:t => t.trim()==='' ? {kind:'clear'} : {kind:'set', value:t.trim()} }
98
- settingsNumberField(k) → { field:k, format:v => typeof v==='number' ? String(v) : '', parse: … }
99
-
100
- class SettingsFormModel {
101
- constructor(scope, specs, secretSpecs = [])
102
- bind(project) // → { getSnapshot, subscribe },宿主再包装成 selector hook
103
- shell() // { available, writable, dirty, invalid, saving, failed }
104
- field(key) // { text, overridden, invalid }
105
- actions() // { edit(key,text), resetField(key), save(), discard() }
106
- plan() // clear → unset;text === format(现值) → 跳过;parse → set
107
- dispose()
108
- }
109
- ```
110
-
111
- **自写描述符的机关**:`parse` 返回什么就写什么 JSON 值,所以:
112
-
113
- ```ts
114
- settingsBooleanField(k) → parse: t==='true' ? {kind:'set', value:true}
115
- : t==='false' ? {kind:'set', value:false}
116
- : t==='' ? {kind:'clear'} : undefined
117
- settingsEnumField(k, opts) → parse: t => opts.includes(t) ? {kind:'set', value:t} : undefined
118
- ```
119
-
120
- **不要**改成绕过表单模型直接 `remote.settings.mutate`——会丢掉 staged/保存/丢弃/覆盖标记/恢复默认。
121
-
122
- **原语 props**:`Switch({checked,onChange(next:boolean),label?,disabled?})`、
123
- `SegmentedControl({id,value,options:[{value,label}],onChange(next),label?,disabled?})`、
124
- `Tag({tone, children})`。
125
-
126
- **行样式**:宿主设置行用 CSS module `181ew`,自绘行照抄其度量
127
- (`display:flex;flex-direction:column;gap:6px;padding:12px 0`;标签 13px/500;
128
- 提示 12px/1.5 `var(--dsw-alias-label-tertiary)`;行间 `0.5px solid var(--dsw-alias-border-l2)`)。
129
- 分隔线放外层包裹 div,因为原生 `.field + .field` 不会跨到自绘行。
130
-
131
- **jsx 陷阱**:`react/jsx-runtime` 的 `jsx(type, props, key)` 第三参是 **key**,
132
- children 必须放 `props.children`。手写 `jsx()` 时传错会渲染成空白页。
133
-
134
- **测试侧**:primitives 没装也不该装,Vite 在 transform 阶段解析不到它 → 任何 import 到
135
- `src/client/index` 的测试都会在收集阶段挂。`vitest.config.ts` 把它 alias 到
136
- `tests/support/ui-primitives.tsx`(行为替身,含 `SettingsFormModel` 的忠实移植)。
137
-
138
- ## 已完成
139
-
140
- | 项 | 位置 |
141
- |---|---|
142
- | 两个入口 + 共用表单(17 字段) | `src/client/settings-page.tsx` |
143
- | 页面文案(`settings.*`,zh/en) | `src/client/locales.ts` |
144
- | 宿主 primitives 的环境声明 | `src/client/primitives.d.ts` |
145
- | 注册调用 | `src/client/index.tsx` 的 `apply()`:`installSettingsPages(ctx)` |
146
- | 两个入口的回归测试(9 例) | `tests/settings-page.test.tsx` |
147
- | primitives 行为替身(只给测试用) | `tests/support/ui-primitives.tsx` |
148
- | Vitest 别名 | `vitest.config.ts` |
149
- | 构建产物 | `lib/client.js`(提交在分支上;已部署到运行 profile) |
150
- | 远端分支 | `surfishs/dsh-prompt-enhance` → `feat/settings-section` |
151
-
152
- ## 剩余待办
153
-
154
- 1. **确认真机入口**:Ctrl+R 后
155
- - 设置对话框左侧应出现「提示词增强」,17 行、标题 `键名(中文名)`、双语提示;
156
- - 侧边栏「插件」面板 → `dsh-prompt-enhance` → 行 `dsh-prompt-enhance` 应有「配置」控件
157
- (注册已证实是活的;若没有,先确认打开的是插件面板而不是 设置→插件)。
158
- 2. 发版时补 `CHANGELOG.md`。
159
- 3. `README` / `README.zh-CN.md` 仍写「设置 → 插件配置」(宿主自动生成页时代的说法),
160
- 可补一句:0.2.2 起配置在插件页行配置,另有设置对话框页。
161
-
162
- ## 本机构建与验证
163
-
164
- ```powershell
165
- cd D:\DeepSeekHarnessWorkspace\dsh-prompt-enhance
166
- npm ci
167
- npm run typecheck
168
- npm test # CI 必过项:25 文件 / 265 用例
169
- npm run build
170
- ```
171
-
172
- 运行目录是 `C:\Users\surfish\.dsh\profiles\desktop\node_modules\dsh-prompt-enhance`:
173
-
174
- ```powershell
175
- Copy-Item .\lib\client.js "$env:USERPROFILE\.dsh\profiles\desktop\node_modules\dsh-prompt-enhance\lib\client.js" -Force
176
- ```
177
-
178
- 回滚文件(保留在运行目录):
179
-
180
- - `lib/client.js.bak-pe-settings` —— 插件原始的 0.3.4 产物(没有任何配置页)
181
- - `lib/client.js.bak-handpatch` —— 更早的手改版
182
-
183
- ## 依赖镜像
184
-
185
- ```powershell
186
- npm config set registry https://registry.npmmirror.com
187
- ```
188
-
189
- ## 注意
190
-
191
- - 不要改 `lib/client.js` 当源码用;`lib/` 是构建产物,CI 会校验 `git diff --quiet lib/`。
192
- - 页面依赖 `@deepseek-ai/dsh-client-ui-primitives` 运行时存在;它是 dsh web 壳的一部分。
193
- - 自写描述符的 `format` 必须确定性:staged 表单用它做「这一行没改过」的判等基准。
194
- - 插件页注册 key 与行 id 强绑定:`SETTINGS_ROW_ID` 改了必须同步 `cordis.patch.yml` 的 `id`。
195
- - 设置对话框页的 `英文键(中文名)` + 双语提示是用户要求保留的形态,不要「顺手统一」。
@@ -1,47 +0,0 @@
1
- ## Two boot/render failures, two silent bugs
2
-
3
- This release fixes two defects that made the plugin unusable rather than merely imperfect, plus two long-standing bugs that only showed up once it ran against a real `dsh web` host.
4
-
5
- ### If the web GUI went blank
6
-
7
- The browser half declared `settingsScope` in the plugin's exported `inject`. Cordis loads a plugin **only while every service named there is available**, and that service belongs to the optional settings surface (`@deepseek-ai/dsh-client-ui-settings`) — which a minimal profile need not bundle. The entry therefore sat `pending` forever and the shell reported:
8
-
9
- ```
10
- web boot: 1 entry did not activate
11
- dsh-prompt-enhance: pending (waiting for service: settingsScope)
12
- ```
13
-
14
- The browser half now hard-requires **nothing**: `slots`, `locale`, and `settingsScope` all ride optional `ctx.inject`, and `apply()` itself touches no service. Degradation is graceful — a profile with no settings surface keeps the bundled default mirror (shortcut `ctrl+alt+e`, 12000-character cap, streaming on), and one with no locale service renders dictionary keys.
15
-
16
- ### If the composer lost the enhance button
17
-
18
- `EnhanceButton` read `state.imageIds.length` and `state.occurrences.length` directly. Those fields are part of the input snapshot in the dsh lines the plugin was written against, but a slot host is not obliged to expose them, and reading `.length` off a missing field throws **during render** — which React answers by unmounting the whole slot entry behind its error boundary:
19
-
20
- ```
21
- slot entry crashed in 'conversation.input.right': TypeError: Cannot read properties of undefined (reading 'length')
22
- ```
23
-
24
- Both counts, plus `draft` / `phase`, are now read defensively. An absent field only disables the corresponding *advisory* guard (images-only, reference chips); the enhancement itself always runs.
25
-
26
- ### Specific upstream fix hints never appeared
27
-
28
- The host sends `reason` in kebab-case (`invalid-credential`, `rate-limit`, `context-window`, `tool-call`, `max-tokens`) while the dictionaries key those hints in camelCase (`error.upstream.invalidCredential`, …). Building the key as `` `error.upstream.${reason}` `` matched only the three single-word reasons (`auth`, `quota`, `empty`) and silently fell back to the generic line for the other five — the specific copy was shipped but unreachable. `UPSTREAM_ERROR_KEYS` is now an explicit, literal-typed table, covered by a key-set test and a per-reason render test on the real panel.
29
-
30
- ### The streamed route never ended its response
31
-
32
- `/prompt-enhance/enhance-stream` wrote its `done` frame but never called `res.end()`, so the chunked body lacked its `0\r\n\r\n` terminator and the connection stayed half-open. A browser client survived only because it returns on the `done` frame and cancels its reader — but any whole-body consumer (`response.text()`, curl, a reverse proxy, a logging middleware) waited **forever**, and keep-alive could never reuse the socket. The route now ends the response after the final frame, guarded against a client that vanished mid-stream.
33
-
34
- ### Also in this release
35
-
36
- - New SSE frame writer with real socket backpressure (`src/sse.ts`): a slow reader parks frames instead of letting the socket buffer grow without bound.
37
- - The conversation-context budget uses the same Unicode code-point gauge as the input cap, and truncates without splitting surrogate pairs.
38
- - `resolveConfig` normalizes a blank `provider` / `model` pair to `undefined` instead of a surviving `''` that downstream read as "an override exists".
39
- - The cross-session busy state uses `aria-disabled` with a readable reason, so the cause is reachable by keyboard and screen-reader users instead of a silently disabled button.
40
- - `ResultPanel`'s focus restore no longer hands focus straight back out under React StrictMode (which had neutered the Tab trap and the Escape handler).
41
- - `peerDependencies` now includes `react-dom`; `files` includes the `docs/` screenshot the READMEs reference; CI runs the Node floor (`22.19`).
42
-
43
- ### Verification
44
-
45
- - `npm run typecheck`, `npm run build` clean.
46
- - **207 tests across 20 files** — new coverage for locale key-set integrity, per-reason error copy, 10 SSE writer units, SSE route end-to-end (reads the body to completion, which is what catches the missing terminator), boot under a service-less host, and render under a host input state without `imageIds` / `occurrences`.
47
- - Exercised against a live `dsh web` profile: the layer mounts, the composer button renders, and the enhance flow (stream → preview → fill back → undo) works.
@@ -1,20 +0,0 @@
1
- ## Packaging-only follow-up to 0.2.3
2
-
3
- No runtime behavior changes. **0.2.3 is the functional release** — see its notes for the four defect fixes; use 0.2.4 if you want the clean install.
4
-
5
- ### What changed
6
-
7
- `0.2.3` declared `@deepseek-ai/dsh-llm` as a peer with the range `^0.1.1-rc.2`. No published version can satisfy that — the registry serves `0.0.1-rc.1`, one minor below the range — so every install produced a peer warning that could not be resolved, and npm could offer to pull a version whose API does not match this plugin.
8
-
9
- That module is in fact a **runtime module supplied by the dsh host**: both `lib/` bundles keep every package import external, and the plugin loader satisfies it in-process. It is not installable from npm by design.
10
-
11
- - The range is now the honest floor: **`>=0.1.1-rc.2`**, matching the `dsh.engines.dsh` floor.
12
- - The entry is marked **`optional`** in `peerDependenciesMeta`, so a host that does not provide it produces no warning; the plugin reports a normal error at enhance time rather than failing to load.
13
- - The `react` / `react-dom` peers stay **required** — the web shell's module registry provides them and they really are needed.
14
- - Both READMEs' *Requirements* sections now state where the module comes from.
15
-
16
- ### Verification
17
-
18
- - `npm run typecheck`, `npm run build` clean.
19
- - **207 tests across 20 files** pass.
20
- - `npm pack` contents unchanged apart from `package.json`.
@@ -1,28 +0,0 @@
1
- ## Two metadata corrections
2
-
3
- No runtime behavior changes. Both corrections remove claims the project could not back.
4
-
5
- ### `dsh.engines.dsh` is now bounded: `>=0.1.1-rc.2 <0.2.0`
6
-
7
- It previously read `>=0.1.1-rc.2` — an open-ended claim that *any* future harness version is supported. Boot verification at the time covered `0.1.1-rc.2`, `0.1.2-alpha.3`, and `0.1.7-rc.2`, while the current npm line was already `0.2.0-rc.2`, so the open ceiling was over-promising.
8
-
9
- `<0.2.0` rather than `<0.1.8` is deliberate: per semver, a prerelease only matches a range that names a prerelease, so `<0.1.8` would have **excluded the verified `0.1.7-rc.2`** — the exact version the range has to keep. `<0.2.0` keeps every `0.1.x` and excludes the then-unverified `0.2.0-rc.1` / `0.2.0-rc.2`.
10
-
11
- > Superseded by **0.2.6**, which widened the ceiling to `<0.3.0` after `0.2.0-rc.2` was verified on the dsh desktop application. This release is the honest intermediate step, not the final state.
12
-
13
- ### `dsh.client.inject` no longer lists `@deepseek-ai/dsh-client-ui-settings`
14
-
15
- That entry dated from the layout in which the browser half hard-declared the settings surface — the declaration that produced, on a profile without that package:
16
-
17
- ```
18
- web boot: 1 entry did not activate
19
- dsh-prompt-enhance: pending (waiting for service: settingsScope)
20
- ```
21
-
22
- …and took the whole GUI down with it (fixed in 0.2.3 by reaching every optional service through `ctx.inject`). With that fix in place the module no longer belongs in the required-provider list.
23
-
24
- ### Verification
25
-
26
- - `npm run typecheck`, `npm run build` clean.
27
- - **207 tests across 20 files** pass.
28
- - Metadata-only: `lib/` is byte-identical to 0.2.4, which is why the tarball contents are unchanged apart from `package.json`.
@@ -1,33 +0,0 @@
1
- ## Verified on the latest dsh line
2
-
3
- No runtime behavior changes — this release widens the declared compatibility ceiling, because the versions that were previously outside it have now been checked on real hosts.
4
-
5
- ### What was verified
6
-
7
- The `0.2.0-rc.2` runtime (the current npm line) had never been exercised when `0.2.5` capped the range at `<0.2.0`. It has now been, on two hosts:
8
-
9
- | Host | Runtime | Result |
10
- |---|---|---|
11
- | dsh **desktop application** (`DeepSeek Harness.exe`, FileVersion `0.2.0-rc.2`) | `0.2.0-rc.2` | loads and enhances |
12
- | global CLI (`dsh web`) | `0.2.0-rc.2` | loads and enhances |
13
-
14
- Three independent signals, not just "the UI looked fine":
15
-
16
- 1. **The runtime's plugin-compatibility gate accepts this plugin.** `0.2.0-rc.2` refuses to load bundles whose `peerDependencies` pin an older `@deepseek-ai/dsh-*` range. This plugin is **not** among the refused: the optional `@deepseek-ai/dsh-llm` peer introduced in `0.2.4` (range `>=0.1.1-rc.2`, marked `optional`) satisfies the gate. For comparison, the gate skipped `dshmarket@1.45.0`, `dsh-find-plugin@0.4.0`, and `dsh-better-sidebar@0.15.2` on the same host.
17
- 2. **No `pending (waiting for service: …)` and no `1 entry did not activate`.** The "hard-require nothing" fix from `0.2.3` — every optional service reached through `ctx.inject` — holds on the new runtime as well.
18
- 3. **A real enhancement completed end to end** against the live model: `[prompt-enhance] … in=2 out=64 ctx=0 1928ms ok`.
19
-
20
- ### What changed
21
-
22
- `dsh.engines.dsh` is now **`>=0.1.1-rc.2 <0.3.0`** (was `>=0.1.1-rc.2 <0.2.0`). The new ceiling covers the whole `0.2.x` line including its prereleases, while still refusing a `0.3.x` that has never been seen.
23
-
24
- Two notes on reading this field:
25
-
26
- - `dsh.engines` is **advisory metadata** consumed by the loader and the plugin manager. It states the supported range; it does not enforce anything.
27
- - If you run a `0.2.x` runtime, expect *other* plugins to disappear from the UI. That is the compatibility gate doing its job, not a fault in this plugin — check your dsh startup output for `skipping profile bundle` lines.
28
-
29
- ### Verification
30
-
31
- - `npm run typecheck`, `npm run build` clean.
32
- - **207 tests across 20 files** pass.
33
- - Boot-verified on `0.1.1-rc.2`, `0.1.2-alpha.3`, `0.1.7-rc.2`, and `0.2.0-rc.2`.
@@ -1,22 +0,0 @@
1
- ## Version bump carrying the desktop-app verification record
2
-
3
- No runtime behavior changes. This version exists because a **docs-only** change followed 0.2.6: the source had already been verified on the current dsh line, but the record of *where* it was verified needed correcting.
4
-
5
- ### What this version carries
6
-
7
- The `0.2.6` release notes described the `0.2.0-rc.2` verification as having happened on the global CLI. That was incomplete: the environment the plugin is **actually used in day to day** is the dsh **desktop application**, and its `FileVersion` is `0.2.0-rc.2` too. The record now names both hosts, and the READMEs say so as well.
8
-
9
- This matters for anyone reading the support claim: "verified on `0.2.0-rc.2`" should not rest on a CLI smoke test when the desktop app is the real target. Both were checked, and the evidence is the same three signals:
10
-
11
- 1. **The runtime's plugin-compatibility gate accepts this plugin.** `0.2.0-rc.2` refuses bundles whose `peerDependencies` pin an older `@deepseek-ai/dsh-*` range. This plugin passes, thanks to the optional `@deepseek-ai/dsh-llm` peer (`>=0.1.1-rc.2`) introduced in 0.2.4. The gate skipped `dshmarket@1.45.0`, `dsh-find-plugin@0.4.0`, and `dsh-better-sidebar@0.15.2` on the same host.
12
- 2. **No `pending (waiting for service: …)` and no `1 entry did not activate`.**
13
- 3. **A real enhancement completed end to end**: `[prompt-enhance] … in=2 out=64 ctx=0 1928ms ok`.
14
-
15
- ### Documentation-only
16
-
17
- `src/` and `lib/` are unchanged from 0.2.6; the shipped bundles are identical. The declared range is `>=0.1.1-rc.2 <0.3.0`, boot-verified on `0.1.1-rc.2`, `0.1.2-alpha.3`, `0.1.7-rc.2`, and `0.2.0-rc.2` (desktop app and CLI).
18
-
19
- ### Verification
20
-
21
- - `npm run typecheck`, `npm run build` clean.
22
- - **207 tests across 20 files** pass.
@@ -1,36 +0,0 @@
1
- ## Adapting to the `0.2.1-rc.2` settings contract
2
-
3
- No new features. This release exists because the harness moved the two services that carry the plugin's settings, and the plugin's probes for them **failed silently**: the settings page kept rendering, edits kept landing on disk, and nothing ever reached a request or the composer. Five defects are fixed; three of them predate the update but only became reachable on the current line.
4
-
5
- ### What was silently broken
6
-
7
- | Surface | What `0.2.x` did | What the user saw | Fix |
8
- |---|---|---|---|
9
- | Host: the section | Deleted the `installSettingsSection` / `settingsNamespace` exports outright; `SettingsForms.describe()` replaced them | Settings edits applied on disk, never to the next enhance | Read the row through `describe()` **per request** |
10
- | Browser: the mirror | `ctx.settingsScope` no longer exists | `enabled` / `maxInputChars` / `shortcut` / `streaming` stuck at the bundled defaults | `configForms.get(entryId)` first, then the aggregate binder, then the legacy scope |
11
- | Browser: the attachment guard | `InputState.imageIds` renamed `attachmentIds` | The "attachments only" guard never fired | Read both names |
12
-
13
- The host fix is verified end to end, not just in unit tests: on a real `dsh web` at `0.2.1-rc.2`, a profile with `maxInputChars: 300` refused a 400-character draft with `422 {count: 400, max: 300}`, and editing the same profile to `20000` — **without restarting** — let the identical draft through.
14
-
15
- ### Two defects in the new browser mirror
16
-
17
- Found on a second pass over the code this release introduces.
18
-
19
- 1. **It disposed an object it does not own.** `configForms.get()` does not create a form per caller: the settings provider caches one controller per entry and hands the same instance to the settings page, and `dispose()` permanently stops that controller deriving — the provider keeps the dead instance in its cache. Tearing it down on plugin unload would have frozen this entry's settings page for the rest of the session. The mirror now releases only its own subscription.
20
- 2. **It resolved the entry id once.** With the describe mirror not yet loaded, the namespace list was empty, so the plugin bound its configured candidate — which on an aggregate bundle is not the real row, and a namespace that does not exist answers `unavailable` forever. Resolution now re-runs on every describe tick and rebinds when the served id changes, which also covers a rename the first pass could not see.
21
-
22
- ### Three behaviour fixes
23
-
24
- - **Retry storms.** The rate window counts successful calls only, by design — a run of timeouts must not lock the user out when the model recovers. That left deterministic failures (wrong key, mistyped provider) bounded by nothing but the concurrency cap. Three consecutive failures now trip a 30-second cool-down answering `429 {code: 'cooldown', retryAfterSeconds, failures}` before a body is read or the model is called; a success clears the streak.
25
- - **`413` killed the socket.** The over-length answer used `res.socket.destroy()`, which also tore down anything else riding the same keep-alive connection. It now answers `connection: close` and lets Node discard the unread body.
26
- - **A rebuilt webserver left the plugin routeless.** Registration was guarded by a bare "already mounted on this context" flag, so a host that replaced its `webServer` service kept the button on screen while every click 404'd. The guard now compares service identity and re-mounts.
27
-
28
- ### Migration
29
-
30
- Nothing to do. The package is a drop-in replacement for `0.2.7`; the declared range is unchanged at `>=0.1.1-rc.2 <0.3.0`, and both older settings APIs are still probed, so a `0.1.x` host keeps working.
31
-
32
- ### Verification
33
-
34
- - `npm run typecheck` and `npm run build` clean against `@deepseek-ai/dsh-*@0.2.1-rc.2`; a clean rebuild of `lib/` is byte-identical.
35
- - **231 tests across 22 files** pass, including two new files (`tests/settings-source.test.ts`, `tests/client-settings-source.test.ts`) that pin the probe order, the rebind-on-settle path, and the "never dispose the provider's form" contract.
36
- - Real-host smoke on `dsh web` at `0.2.1-rc.2`: no `pending` / `did not activate`, the enhance route answered with a real model result (`deepseek-official` / `deepseek-flash`), and the settings schema appeared in the config page with Chinese descriptions.