dsh-think-effort 0.2.1 → 0.4.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 +18 -0
- package/README.md +50 -5
- package/client.js +736 -0
- package/cordis.patch.yml +3 -1
- package/docs/DETAIL.en.md +13 -1
- package/docs/DETAIL.zh.md +13 -1
- package/docs/settings-section.png +0 -0
- package/docs/settings.png +0 -0
- package/index.js +118 -3
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +15 -4
- package/src/policy.js +46 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0 — 2026-11-24
|
|
4
|
+
|
|
5
|
+
- **设置里多一个入口**:同一条配置现在注册进 DSH 设置面板的 `settings.section`(导航项「自动思考档位」,紧跟「内置插件」),并带一个仪表盘图标的 `settings.section.icon`。以前只能从「插件 → 自动思考档位 → 行 → 配置」进入,入口太深;两处共用同一份表单与同一次写入。
|
|
6
|
+
- **按需出现**:设置页入口通过 `configForms.whileServed(['think-effort'])` 注册,只在 Host 正在提供该行的设置命名空间时存在——没装这一行、或行里没有 volatile 字段的部署不会留下空页面。
|
|
7
|
+
- 浏览器半边的客户端模块 `inject` 增加 `configForms`,与插件管理器页面读取行配置的方式一致。
|
|
8
|
+
- 文档:README/DETAIL 更新两处入口与截图(`docs/settings-section.png`);新增 `test/client.test.mjs` 静态守卫(设置的 slot、行键、命名空间、图标配对不得漂移)。
|
|
9
|
+
- 验证:一次性 web profile 里实测——设置导航出现「自动思考档位」,页面完整渲染,改「普通步骤 · Auto 落到」为 `max` 保存后 profile 的 `cordis.patch.yml` 出现对应覆盖;「插件 → 行 → 配置」入口保持可用。
|
|
10
|
+
|
|
11
|
+
## 0.3.0 — 2026-11-24
|
|
12
|
+
|
|
13
|
+
- **可视化设置页**:插件 → 自动思考档位 → 配置。覆盖全部字段(启用、Auto 落点、模型默认档、子代理强度、Auto 适用范围、廉价调用、能力声明、高级诊断),保存后即时生效。
|
|
14
|
+
- **子代理 effort**:新增 `subagentLevel`(`inherit` / `auto` / 固定档)。`inherit` 保持 DSH 原生继承;固定档覆盖子代理自身或从父代理继承的选择;廉价调用的降档仍然优先。`reasoning_effort_status` 同步报告子代理解析结果。
|
|
15
|
+
- **实时配置**:`export const Config` 声明全部字段为 `volatile`;设置写入经 `loader/volatile-update` 热更新策略,无需重启、无需手改 `cordis.patch.yml`。新增运行时依赖 `@deepseek-ai/schemastery`。
|
|
16
|
+
- **浏览器半边**:新增 `client.js`(`plugins.row.config` 键 `dsh-think-effort#think-effort`),中英双语文案,跟随 DSH 主题变量。
|
|
17
|
+
- 文档:明确**新安装免重启**(DSH base bundle 的 HMR 直接激活新 bundle);升级已安装版本才需要重启 Host。
|
|
18
|
+
- 测试:26 项(新增子代理策略、volatile 配置热更新、子代理会话识别)。
|
|
19
|
+
- CI:提交 `package-lock.json`(从 npm registry 解析,不含本机路径),`test` 与 `release` 的 verify 任务先 `npm ci` 再跑语法检查与离线测试。此前的构建失败是 `index.js` 新增运行时依赖后 CI 未安装依赖(`ERR_MODULE_NOT_FOUND: @deepseek-ai/schemastery`)。
|
|
20
|
+
|
|
3
21
|
## 0.2.1 — 2026-11-24
|
|
4
22
|
|
|
5
23
|
- `package.json` 增加有界宿主声明 `engines.dsh: ">=0.2.0-rc.1 <0.3.0-0"`,插件市场与插件管理器可据此判断兼容性。
|
package/README.md
CHANGED
|
@@ -50,15 +50,37 @@ DSH Desktop → **插件市场**搜索 `dsh-think-effort` 安装;或 **插件
|
|
|
50
50
|
|
|
51
51
|
### 启用与验证
|
|
52
52
|
|
|
53
|
-
1.
|
|
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
|
-
4. 想核对具体模型,可让 Agent 调用只读工具 `reasoning_effort_status`,它会报告该模型声明的档位、默认档、`Auto`
|
|
56
|
+
4. 想核对具体模型,可让 Agent 调用只读工具 `reasoning_effort_status`,它会报告该模型声明的档位、默认档、`Auto` 与子代理的解析结果、廉价调用档位,不发送任何模型请求。
|
|
57
|
+
|
|
58
|
+
> **升级已安装版本**是另一回事:DSH 需要重启 Host 才能载入新的 JavaScript 模块代际(安装结果会报 `restart-required`)。这是 DSH 的进程模型,不是本插件的行为。
|
|
59
|
+
|
|
60
|
+
### 可视化设置
|
|
61
|
+
|
|
62
|
+
同一条配置有**两个入口**,表单与写入完全相同,改哪个都一样:
|
|
63
|
+
|
|
64
|
+
- **设置 → 自动思考档位**(推荐):侧栏底部「更多」→ 设置,左侧导航里紧跟「内置插件」,带仪表盘图标;
|
|
65
|
+
- **插件 → 自动思考档位 → 行右侧「配置」**:正在浏览插件列表时顺手进入。
|
|
66
|
+
|
|
67
|
+

|
|
68
|
+
|
|
69
|
+

|
|
70
|
+
|
|
71
|
+
- **档位分配**:普通步骤的 Auto 落点、模型默认档、**子代理推理强度**、哪些模型显示 Auto;
|
|
72
|
+
- **廉价调用**:总开关、档位、purpose 清单;
|
|
73
|
+
- **能力声明**:是否写入 `reasoningEfforts`、声明哪些档位、DeepSeek host/模型匹配规则;
|
|
74
|
+
- **高级**:stderr 诊断。
|
|
75
|
+
|
|
76
|
+
所有字段都是 `volatile` 配置:点「保存」后**立即生效**,不需要重启,也不用改 `cordis.patch.yml`。「设置」里的入口只在 Host 提供该行设置命名空间时出现,卸载或关闭本插件后不留空页面。
|
|
57
77
|
|
|
58
78
|
### 本插件的第一次使用
|
|
59
79
|
|
|
60
80
|
装上后不需要额外配置:`Auto` 与档位由插件自动声明。选中 `Auto` 即按默认档运行;选 `Low / High / Max` 即固定该档;不选(原生「提供方默认」)在普通步骤上与 `Auto` 等效。
|
|
61
81
|
|
|
82
|
+
子代理默认**不干预**,保持 DSH 原生行为(继承父代理的模型与档位)。想让子代理固定用某一档,在设置页把「子代理 · 推理强度」改成 `Low / High / Max`,或选 `Auto` 跟随本插件的默认解析;廉价调用的降档仍然优先。
|
|
83
|
+
|
|
62
84
|
## 为什么需要它
|
|
63
85
|
|
|
64
86
|
手工在 `llm-pi-ai` 里声明的 DeepSeek 网关模型(例如走自建网关的 `deepseek-v4.1-flash-1017`)在 pi-ai 的已安装目录里查不到,profile 里也没写 `reasoningEfforts`,于是:
|
|
@@ -99,6 +121,7 @@ DSH Desktop → **插件市场**搜索 `dsh-think-effort` 安装;或 **插件
|
|
|
99
121
|
auxPurposes: [session-title, compaction, auto-review]
|
|
100
122
|
auxLevel: low
|
|
101
123
|
autoScope: all
|
|
124
|
+
subagentLevel: inherit
|
|
102
125
|
trace: false
|
|
103
126
|
```
|
|
104
127
|
|
|
@@ -116,6 +139,7 @@ DSH Desktop → **插件市场**搜索 `dsh-think-effort` 安装;或 **插件
|
|
|
116
139
|
| `auxPurposes` | `session-title, compaction, auto-review` | 视为廉价调用的 `purpose` |
|
|
117
140
|
| `auxLevel` | `low` | 廉价调用用的档位 |
|
|
118
141
|
| `autoScope` | `all` | `all` / `declared` / `off` |
|
|
142
|
+
| `subagentLevel` | `inherit` | 子代理档位:`inherit` / `auto` / `low`…`max`;固定档会覆盖子代理自身或继承的选择 |
|
|
119
143
|
| `trace` | `false` | 把决策写到 stderr(排查用) |
|
|
120
144
|
|
|
121
145
|
## 兼容性
|
|
@@ -174,21 +198,42 @@ Copy the `.tgz` (or an unpacked directory with `package.json` at its root) to th
|
|
|
174
198
|
|
|
175
199
|
### Enable and verify
|
|
176
200
|
|
|
177
|
-
1.
|
|
201
|
+
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.
|
|
178
202
|
2. The model chip next to the composer reads `<model> High` (the model's default depth) instead of the bare model id.
|
|
179
203
|
3. Open the chip → "Reasoning level": `Auto / Low / High / Max` are listed.
|
|
180
|
-
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`
|
|
204
|
+
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.
|
|
205
|
+
|
|
206
|
+
> **Upgrading an installed version** is different: DSH must restart the Host to load a fresh JavaScript module generation (`restart-required`). That is DSH's process model, not this plugin's behavior.
|
|
207
|
+
|
|
208
|
+
### Visual settings
|
|
209
|
+
|
|
210
|
+
The same form is reachable from **two places**; both read and write the identical configuration:
|
|
211
|
+
|
|
212
|
+
- **Settings → Automatic thinking depth** (recommended): sidebar foot → More → Settings; the entry sits right after "Built-in plugins" and carries a gauge icon;
|
|
213
|
+
- **Plugins → Automatic thinking depth → Configure** on the row, when you are already browsing plugins.
|
|
214
|
+
|
|
215
|
+

|
|
216
|
+
|
|
217
|
+

|
|
218
|
+
|
|
219
|
+
- **Depth assignment**: the ordinary-step Auto target, the model default, the **subagent effort**, and which models offer Auto;
|
|
220
|
+
- **Cheap calls**: switch, level, and purpose list;
|
|
221
|
+
- **Capability declaration**: whether to write `reasoningEfforts`, which depths to declare, and the DeepSeek host/model rules;
|
|
222
|
+
- **Advanced**: stderr diagnostics.
|
|
223
|
+
|
|
224
|
+
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.
|
|
181
225
|
|
|
182
226
|
### Features
|
|
183
227
|
|
|
184
228
|
- Declares `reasoningEfforts` for DeepSeek models that carry none (gateway aliases included), so the selector finally has levels.
|
|
185
229
|
- `Auto` resolves to the declared default depth on every request; an explicit pick passes through untouched.
|
|
230
|
+
- **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.
|
|
186
231
|
- 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.
|
|
187
232
|
- Idempotent: a second boot writes nothing; unload restores the original adapter registrations and retires a durable `auto`.
|
|
188
233
|
|
|
189
234
|
### Configuration
|
|
190
235
|
|
|
191
|
-
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` and `trace` are the ones most often changed.
|
|
236
|
+
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.
|
|
192
237
|
|
|
193
238
|
### Compatibility
|
|
194
239
|
|