dsh-think-effort 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.0 — 2026-11-24
4
+
5
+ - **实时调试悬浮窗**:设置页新增「调试」区块与 `debugOverlay` 开关(默认关)。打开后,会话右下角出现可拖动的悬浮窗(`shell.overlay` 槽位),实时显示每次模型请求的档位决策:时间、用途、请求档位 → 实际发送档位、模型,以及子代理会话(带「子」标记)和 `设置更新` / `能力声明` 事件;支持「当前会话 / 全部会话 / 仅切换」筛选、一键复制、清空,窗口位置与展开状态在浏览器本地保存。
6
+ - **只记录、不改变请求**:Host 半边在适配器边界把每条决策写入内存环形缓冲(最多 300 条,不写会话日志、不落盘),经两条 `webServer` 路由(`GET /think-effort/debug?since=N`、`POST /think-effort/debug/clear`)提供增量读取与清空;开关关闭时路由返回 `enabled: false` 且不记录。
7
+ - 设置页原来的「高级」disclosure 改为「调试」区块,`trace`(stderr 诊断)移入其中。
8
+ - 测试:40 项全绿(新增调试日志 ring buffer/路由/清空契约、Host 决策记录、开关热更新、客户端悬浮窗注册与双语文案)。
9
+ - 文档:README / DETAIL(中英)新增悬浮窗说明与截图(`docs/debug-settings.png`、`docs/debug-overlay.png`);`cordis.patch.yml` 与配置表补 `debugOverlay`。
10
+
11
+ ## 0.4.0 — 2026-11-24
12
+
13
+ - **设置里多一个入口**:同一条配置现在注册进 DSH 设置面板的 `settings.section`(导航项「自动思考档位」,紧跟「内置插件」),并带一个仪表盘图标的 `settings.section.icon`。以前只能从「插件 → 自动思考档位 → 行 → 配置」进入,入口太深;两处共用同一份表单与同一次写入。
14
+ - **按需出现**:设置页入口通过 `configForms.whileServed(['think-effort'])` 注册,只在 Host 正在提供该行的设置命名空间时存在——没装这一行、或行里没有 volatile 字段的部署不会留下空页面。
15
+ - 浏览器半边的客户端模块 `inject` 增加 `configForms`,与插件管理器页面读取行配置的方式一致。
16
+ - 文档:README/DETAIL 更新两处入口与截图(`docs/settings-section.png`);新增 `test/client.test.mjs` 静态守卫(设置的 slot、行键、命名空间、图标配对不得漂移)。
17
+ - 验证:一次性 web profile 里实测——设置导航出现「自动思考档位」,页面完整渲染,改「普通步骤 · Auto 落到」为 `max` 保存后 profile 的 `cordis.patch.yml` 出现对应覆盖;「插件 → 行 → 配置」入口保持可用。
18
+
3
19
  ## 0.3.0 — 2026-11-24
4
20
 
5
21
  - **可视化设置页**:插件 → 自动思考档位 → 配置。覆盖全部字段(启用、Auto 落点、模型默认档、子代理强度、Auto 适用范围、廉价调用、能力声明、高级诊断),保存后即时生效。
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **中文(默认)** · [English](#english)
4
4
 
5
- 给 DeepSeek Harness(DSH)加一套**声明式自动思考档位**:模型选择器里出现 `Auto`,普通步骤落到模型声明的默认档(DeepSeek 为 `high`),会话标题、上下文压缩、自动复审这类由 Harness 自己发起的廉价调用自动用 `low`。
5
+ 给 DeepSeek Harness(DSH)加一套**声明式自动思考档位**:模型选择器里出现 `Auto`,普通步骤落到模型声明的默认档(DeepSeek 为 `high`),会话标题、上下文压缩、自动复审这类由 Harness 自己发起的廉价调用自动用 `low`。打开调试开关后,每次请求的档位决策会实时出现在会话界面的悬浮窗里,子代理的决策也在其中。
6
6
 
7
7
  ## 快速开始
8
8
 
@@ -50,7 +50,7 @@ DSH Desktop → **插件市场**搜索 `dsh-think-effort` 安装;或 **插件
50
50
 
51
51
  ### 启用与验证
52
52
 
53
- 1. **新安装不需要重启**:DSH 的 base bundle 默认启用 HMR,新 bundle 安装后直接激活(安装结果显示 `application: applied`)。打开 **插件** 页能看到「自动思考档位」即已生效;若页面是旧快照,刷新一次即可。
53
+ 1. **新安装不需要重启**:DSH 的 base bundle 默认启用 HMR,新 bundle 安装后直接激活(安装结果显示 `application: applied`)。打开 **插件** 页能看到「自动思考档位」即已生效;**设置** 面板的导航里也会多出同名入口。若页面是旧快照,刷新一次即可。
54
54
  2. 输入框右侧的模型 chip 应从 `deepseek-v4.1-flash-1017` 变成 `deepseek-v4.1-flash-1017 High`(或你模型的默认档)。
55
55
  3. 点开 chip →「推理等级」,应能看到 `Auto / Low / High / Max`。
56
56
  4. 想核对具体模型,可让 Agent 调用只读工具 `reasoning_effort_status`,它会报告该模型声明的档位、默认档、`Auto` 与子代理的解析结果、廉价调用档位,不发送任何模型请求。
@@ -59,16 +59,37 @@ DSH Desktop → **插件市场**搜索 `dsh-think-effort` 安装;或 **插件
59
59
 
60
60
  ### 可视化设置
61
61
 
62
- **插件 → 自动思考档位 → 行右侧「配置」**(桌面/Web 相同):
62
+ 同一条配置有**两个入口**,表单与写入完全相同,改哪个都一样:
63
63
 
64
- ![设置页](docs/settings.png)
64
+ - **设置 → 自动思考档位**(推荐):侧栏底部「更多」→ 设置,左侧导航里紧跟「内置插件」,带仪表盘图标;
65
+ - **插件 → 自动思考档位 → 行右侧「配置」**:正在浏览插件列表时顺手进入。
66
+
67
+ ![设置面板里的入口](docs/settings-section.png)
68
+
69
+ ![插件行的配置页](docs/settings.png)
65
70
 
66
71
  - **档位分配**:普通步骤的 Auto 落点、模型默认档、**子代理推理强度**、哪些模型显示 Auto;
67
72
  - **廉价调用**:总开关、档位、purpose 清单;
68
73
  - **能力声明**:是否写入 `reasoningEfforts`、声明哪些档位、DeepSeek host/模型匹配规则;
69
- - **高级**:stderr 诊断。
74
+ - **调试**:会话界面的实时档位切换日志、stderr 诊断。
75
+
76
+ 所有字段都是 `volatile` 配置:点「保存」后**立即生效**,不需要重启,也不用改 `cordis.patch.yml`。「设置」里的入口只在 Host 提供该行设置命名空间时出现,卸载或关闭本插件后不留空页面。
77
+
78
+ ### 实时调试悬浮窗
79
+
80
+ 设置页的「调试 → 在会话界面显示实时档位切换日志」打开后,会话右下角会出现一个可拖动的小窗口:
81
+
82
+ ![设置页里的调试开关](docs/debug-settings.png)
83
+
84
+ ![实时档位切换日志](docs/debug-overlay.png)
85
+
86
+ - **每次请求都记一条**:时间、用途(普通步骤 / 会话标题 / 压缩 / 自动复核)、请求档位(`Auto` 或具体档)、实际发送档位,以及模型;
87
+ - **子代理单独标记**:子代理会话由同一个 Host 处理,因此它的决策也在同一个窗口里,带「子」标记;
88
+ - **切换直观可见**:插件真正改写了档位(如 `auto → high`)的行高亮;同一会话同一用途的档位发生变化时,行尾出现 `⇄`;
89
+ - **筛选与复制**:可在「当前会话 / 全部会话 / 仅切换」之间切换,一键复制为文本,方便贴到 issue;
90
+ - **只记录、不改变请求**:关掉开关后日志立即停止记录,窗口消失;记录只存在 Host 内存里(最多 300 条),不写会话日志、不落盘。
70
91
 
71
- 所有字段都是 `volatile` 配置:点「保存」后**立即生效**,不需要重启,也不用改 `cordis.patch.yml`。
92
+ 窗口位置与展开状态记在浏览器本地,刷新页面后保持原样;「设置更新」「能力声明」也会作为事件出现在日志里,方便确认保存是否生效。
72
93
 
73
94
  ### 本插件的第一次使用
74
95
 
@@ -117,6 +138,7 @@ DSH Desktop → **插件市场**搜索 `dsh-think-effort` 安装;或 **插件
117
138
  auxLevel: low
118
139
  autoScope: all
119
140
  subagentLevel: inherit
141
+ debugOverlay: false
120
142
  trace: false
121
143
  ```
122
144
 
@@ -135,6 +157,7 @@ DSH Desktop → **插件市场**搜索 `dsh-think-effort` 安装;或 **插件
135
157
  | `auxLevel` | `low` | 廉价调用用的档位 |
136
158
  | `autoScope` | `all` | `all` / `declared` / `off` |
137
159
  | `subagentLevel` | `inherit` | 子代理档位:`inherit` / `auto` / `low`…`max`;固定档会覆盖子代理自身或继承的选择 |
160
+ | `debugOverlay` | `false` | 在会话界面显示实时档位切换日志(只记录,不改请求) |
138
161
  | `trace` | `false` | 把决策写到 stderr(排查用) |
139
162
 
140
163
  ## 兼容性
@@ -153,7 +176,7 @@ MIT。
153
176
 
154
177
  **中文简介**:给 DeepSeek Harness 加一套声明式自动思考档位——`Auto` 落到模型声明的默认档,廉价调用自动用低档。
155
178
 
156
- Declarative automatic thinking depth for DeepSeek Harness: the model selector gains `Auto`, normal steps use the model's declared default depth (`high` on DeepSeek), and cheap host-owned calls — session titles, compaction, auto-review — drop to `low`.
179
+ Declarative automatic thinking depth for DeepSeek Harness: the model selector gains `Auto`, normal steps use the model's declared default depth (`high` on DeepSeek), and cheap host-owned calls — session titles, compaction, auto-review — drop to `low`. Turn on the debug switch and every request's effort decision appears live in a floating window over the conversation, subagent decisions included.
157
180
 
158
181
  ### Quick start
159
182
 
@@ -193,7 +216,7 @@ Copy the `.tgz` (or an unpacked directory with `package.json` at its root) to th
193
216
 
194
217
  ### Enable and verify
195
218
 
196
- 1. A **fresh install needs no restart**: the base bundle enables HMR, so a new bundle activates immediately (`application: applied`). The "Automatic thinking depth" card appears under **Plugins**; refresh the page if the list is stale.
219
+ 1. A **fresh install needs no restart**: the base bundle enables HMR, so a new bundle activates immediately (`application: applied`). The "Automatic thinking depth" card appears under **Plugins**, and **Settings** gains a navigation entry of the same name; refresh the page if the list is stale.
197
220
  2. The model chip next to the composer reads `<model> High` (the model's default depth) instead of the bare model id.
198
221
  3. Open the chip → "Reasoning level": `Auto / Low / High / Max` are listed.
199
222
  4. For a specific model, ask the agent to call the read-only `reasoning_effort_status` tool: it reports the declared depths, the default, what `Auto` and subagents resolve to, and the cheap-call depth, without sending a model request.
@@ -202,16 +225,37 @@ Copy the `.tgz` (or an unpacked directory with `package.json` at its root) to th
202
225
 
203
226
  ### Visual settings
204
227
 
205
- **Plugins → Automatic thinking depth → Configure** on the row (Desktop and Web):
228
+ The same form is reachable from **two places**; both read and write the identical configuration:
206
229
 
207
- ![Settings page](docs/settings.png)
230
+ - **Settings → Automatic thinking depth** (recommended): sidebar foot → More → Settings; the entry sits right after "Built-in plugins" and carries a gauge icon;
231
+ - **Plugins → Automatic thinking depth → Configure** on the row, when you are already browsing plugins.
232
+
233
+ ![The Settings entry](docs/settings-section.png)
234
+
235
+ ![The Plugins row configuration](docs/settings.png)
208
236
 
209
237
  - **Depth assignment**: the ordinary-step Auto target, the model default, the **subagent effort**, and which models offer Auto;
210
238
  - **Cheap calls**: switch, level, and purpose list;
211
239
  - **Capability declaration**: whether to write `reasoningEfforts`, which depths to declare, and the DeepSeek host/model rules;
212
- - **Advanced**: stderr diagnostics.
240
+ - **Debug**: the conversation's live effort-switch log and stderr diagnostics.
241
+
242
+ Every field is `volatile`: **Save** applies immediately, without a restart and without hand-editing `cordis.patch.yml`. The Settings entry exists only while the Host serves this row's settings namespace, so disabling or removing the plugin leaves no empty page behind.
243
+
244
+ ### Live debug window
245
+
246
+ Turn on **Debug → Show the live effort-switch log in the conversation** and a movable window appears at the conversation's bottom-right corner:
247
+
248
+ ![The debug switch in Settings](docs/debug-settings.png)
249
+
250
+ ![The live effort-switch log](docs/debug-overlay.png)
251
+
252
+ - **One line per request**: time, purpose (ordinary step / session title / compaction / auto-review), requested depth (`Auto` or an explicit level), the depth actually sent, and the model;
253
+ - **Subagents are marked**: subagent sessions run in the same Host process, so their decisions land in the same window with a `Sub` badge;
254
+ - **Switches stand out**: rows the plugin actually rewrote (for example `auto → high`) are highlighted, and a level change for the same session and purpose is marked `⇄`;
255
+ - **Filter and copy**: switch between this session, all sessions, and switches only; copy the log as text for an issue report;
256
+ - **Records only, never rewrites**: turning the switch off stops recording and hides the window; the journal lives in Host memory (300 records at most) and never touches the session log or disk.
213
257
 
214
- Every field is `volatile`: **Save** applies immediately, without a restart and without hand-editing `cordis.patch.yml`.
258
+ The window's position and open state persist in the browser, so a page refresh keeps them. Settings updates and capability declarations also appear as events, which makes a save's effect easy to confirm.
215
259
 
216
260
  ### Features
217
261
 
@@ -220,10 +264,11 @@ Every field is `volatile`: **Save** applies immediately, without a restart and w
220
264
  - **Subagent effort**: `inherit` keeps DSH's native behavior; `auto` follows this plugin's default; a fixed depth overrides the child's own or inherited pick.
221
265
  - Cheap host-owned calls (`session-title`, `compaction`, `auto-review`) drop to `low` only when the model declares it, regardless of the session's own choice.
222
266
  - Idempotent: a second boot writes nothing; unload restores the original adapter registrations and retires a durable `auto`.
267
+ - **Live debug window**: an opt-in, bounded, in-memory journal served over a Host route and rendered as a movable log over the conversation, subagent decisions included.
223
268
 
224
269
  ### Configuration
225
270
 
226
- Override the `think-effort` row in the profile's `cordis.patch.yml`; the fields are listed in the Chinese section above. `declareCapability`, `efforts`, `defaultEffort`, `auxPurposes`, `auxLevel`, `autoScope`, `subagentLevel` and `trace` are the ones most often changed. Most users should use the visual settings page instead of editing this file.
271
+ Override the `think-effort` row in the profile's `cordis.patch.yml`; the fields are listed in the Chinese section above. `declareCapability`, `efforts`, `defaultEffort`, `auxPurposes`, `auxLevel`, `autoScope`, `subagentLevel`, `debugOverlay` and `trace` are the ones most often changed. Most users should use the visual settings page instead of editing this file.
227
272
 
228
273
  ### Compatibility
229
274