dsh-think-effort 0.3.0 → 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 +8 -0
- package/README.md +18 -8
- package/client.js +86 -5
- package/docs/DETAIL.en.md +9 -2
- package/docs/DETAIL.zh.md +9 -2
- package/docs/settings-section.png +0 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
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
|
+
|
|
3
11
|
## 0.3.0 — 2026-11-24
|
|
4
12
|
|
|
5
13
|
- **可视化设置页**:插件 → 自动思考档位 → 配置。覆盖全部字段(启用、Auto 落点、模型默认档、子代理强度、Auto 适用范围、廉价调用、能力声明、高级诊断),保存后即时生效。
|
package/README.md
CHANGED
|
@@ -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,21 @@ DSH Desktop → **插件市场**搜索 `dsh-think-effort` 安装;或 **插件
|
|
|
59
59
|
|
|
60
60
|
### 可视化设置
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
同一条配置有**两个入口**,表单与写入完全相同,改哪个都一样:
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
- **设置 → 自动思考档位**(推荐):侧栏底部「更多」→ 设置,左侧导航里紧跟「内置插件」,带仪表盘图标;
|
|
65
|
+
- **插件 → 自动思考档位 → 行右侧「配置」**:正在浏览插件列表时顺手进入。
|
|
66
|
+
|
|
67
|
+

|
|
68
|
+
|
|
69
|
+

|
|
65
70
|
|
|
66
71
|
- **档位分配**:普通步骤的 Auto 落点、模型默认档、**子代理推理强度**、哪些模型显示 Auto;
|
|
67
72
|
- **廉价调用**:总开关、档位、purpose 清单;
|
|
68
73
|
- **能力声明**:是否写入 `reasoningEfforts`、声明哪些档位、DeepSeek host/模型匹配规则;
|
|
69
74
|
- **高级**:stderr 诊断。
|
|
70
75
|
|
|
71
|
-
所有字段都是 `volatile` 配置:点「保存」后**立即生效**,不需要重启,也不用改 `cordis.patch.yml
|
|
76
|
+
所有字段都是 `volatile` 配置:点「保存」后**立即生效**,不需要重启,也不用改 `cordis.patch.yml`。「设置」里的入口只在 Host 提供该行设置命名空间时出现,卸载或关闭本插件后不留空页面。
|
|
72
77
|
|
|
73
78
|
### 本插件的第一次使用
|
|
74
79
|
|
|
@@ -193,7 +198,7 @@ Copy the `.tgz` (or an unpacked directory with `package.json` at its root) to th
|
|
|
193
198
|
|
|
194
199
|
### Enable and verify
|
|
195
200
|
|
|
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
|
|
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.
|
|
197
202
|
2. The model chip next to the composer reads `<model> High` (the model's default depth) instead of the bare model id.
|
|
198
203
|
3. Open the chip → "Reasoning level": `Auto / Low / High / Max` are listed.
|
|
199
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.
|
|
@@ -202,16 +207,21 @@ Copy the `.tgz` (or an unpacked directory with `package.json` at its root) to th
|
|
|
202
207
|
|
|
203
208
|
### Visual settings
|
|
204
209
|
|
|
205
|
-
|
|
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
|
+

|
|
206
216
|
|
|
207
|
-

|
|
208
218
|
|
|
209
219
|
- **Depth assignment**: the ordinary-step Auto target, the model default, the **subagent effort**, and which models offer Auto;
|
|
210
220
|
- **Cheap calls**: switch, level, and purpose list;
|
|
211
221
|
- **Capability declaration**: whether to write `reasoningEfforts`, which depths to declare, and the DeepSeek host/model rules;
|
|
212
222
|
- **Advanced**: stderr diagnostics.
|
|
213
223
|
|
|
214
|
-
Every field is `volatile`: **Save** applies immediately, without a restart and without hand-editing `cordis.patch.yml`.
|
|
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.
|
|
215
225
|
|
|
216
226
|
### Features
|
|
217
227
|
|
package/client.js
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Browser half of `dsh-think-effort`: the visual settings page for one row.
|
|
3
3
|
*
|
|
4
|
-
* The page
|
|
5
|
-
*
|
|
4
|
+
* The page renders in two places, from one form:
|
|
5
|
+
*
|
|
6
|
+
* - the Plugins page's `plugins.row.config` slot, keyed by
|
|
7
|
+
* `<package name>#<row id>`, so the bundle's row gains a Configure control;
|
|
8
|
+
* - the Settings panel's `settings.section` slot, so the same options are
|
|
9
|
+
* reachable where a person looks for settings instead of only behind a
|
|
10
|
+
* bundle row.
|
|
11
|
+
*
|
|
6
12
|
* The page owner supplies `form`: the accepted Host values of this row plus one
|
|
7
13
|
* revision-fenced `mutate`. Every field is volatile, so saving writes the
|
|
8
|
-
* profile patch and the running policy follows without a restart.
|
|
14
|
+
* profile patch and the running policy follows without a restart. The Settings
|
|
15
|
+
* entry reads the row's settings namespace through `configForms` and exists
|
|
16
|
+
* only while the Host serves it, so a deployment without this row shows no
|
|
17
|
+
* trace of the page.
|
|
9
18
|
*
|
|
10
19
|
* The layout follows the desktop reference implementation: purpose rows
|
|
11
20
|
* (ordinary step, subagent, cheap calls) over a shared effort vocabulary, with
|
|
@@ -20,11 +29,18 @@ window.__ModuleLoader__.load({
|
|
|
20
29
|
const h = React.createElement;
|
|
21
30
|
|
|
22
31
|
const NS = 'think-effort';
|
|
23
|
-
|
|
32
|
+
/** The bundle row this page belongs to; the row id is also the Host settings namespace. */
|
|
33
|
+
const ROW_ID = 'think-effort';
|
|
34
|
+
const ROW_KEY = `dsh-think-effort#${ROW_ID}`;
|
|
35
|
+
/** Settings navigation section id; the shell pairs it with the icon of the same id. */
|
|
36
|
+
const SECTION_ID = 'think-effort';
|
|
37
|
+
/** Right after the built-in Plugins section (order 15): the plugin's own options. */
|
|
38
|
+
const SECTION_ORDER = 16;
|
|
24
39
|
const EFFORT_ORDER = ['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'];
|
|
25
40
|
const KNOWN_PURPOSES = ['session-title', 'compaction', 'auto-review'];
|
|
26
41
|
|
|
27
42
|
const zh = {
|
|
43
|
+
nav: '自动思考档位',
|
|
28
44
|
intro: '按“用途”分配推理强度:普通步骤、子代理、Harness 自己的廉价调用。改动即时生效,不需要重启。',
|
|
29
45
|
loading: '正在读取插件配置…',
|
|
30
46
|
unavailable: '这个部署没有提供可编辑的插件配置(设置服务未挂载,或该行没有可实时编辑的字段)。',
|
|
@@ -88,6 +104,7 @@ window.__ModuleLoader__.load({
|
|
|
88
104
|
};
|
|
89
105
|
|
|
90
106
|
const en = {
|
|
107
|
+
nav: 'Automatic thinking depth',
|
|
91
108
|
intro: 'Assign thinking depth by purpose: ordinary steps, subagents, and the Harness\'s own cheap calls. Changes apply immediately, without a restart.',
|
|
92
109
|
loading: 'Reading plugin configuration…',
|
|
93
110
|
unavailable: 'This deployment exposes no editable plugin configuration (the settings service is not mounted, or this row has no live fields).',
|
|
@@ -624,6 +641,37 @@ window.__ModuleLoader__.load({
|
|
|
624
641
|
return t('summary', { auto, sub, aux });
|
|
625
642
|
}
|
|
626
643
|
|
|
644
|
+
/**
|
|
645
|
+
* The Settings panel's copy of the page.
|
|
646
|
+
*
|
|
647
|
+
* The Plugins page receives `form` from its row owner; a Settings section
|
|
648
|
+
* is owned by the shell and receives only `close`, so this copy reads the
|
|
649
|
+
* row's settings form from the `configForms` service. Both surfaces share
|
|
650
|
+
* that one form, so an edit belongs to the same profile write either way.
|
|
651
|
+
*/
|
|
652
|
+
function SettingsSection({ useConfig, mutate, t }) {
|
|
653
|
+
const state = useConfig((snapshot) => snapshot);
|
|
654
|
+
const form = React.useMemo(() => ({ state, mutate }), [state, mutate]);
|
|
655
|
+
return Page({ form, t });
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
/** Settings navigation glyph: a gauge arc with a needle, matching the bundle icon's motif. */
|
|
659
|
+
function SectionIcon({ size }) {
|
|
660
|
+
return h('svg', {
|
|
661
|
+
viewBox: '0 0 24 24',
|
|
662
|
+
width: size,
|
|
663
|
+
height: size,
|
|
664
|
+
fill: 'none',
|
|
665
|
+
stroke: 'currentColor',
|
|
666
|
+
strokeWidth: 1.8,
|
|
667
|
+
strokeLinecap: 'round',
|
|
668
|
+
'aria-hidden': 'true',
|
|
669
|
+
},
|
|
670
|
+
h('path', { d: 'M4.5 16.5a7.5 7.5 0 1 1 15 0' }),
|
|
671
|
+
h('path', { d: 'M12 16.5 16 11.5' }),
|
|
672
|
+
h('circle', { cx: 12, cy: 16.5, r: 1.6, fill: 'currentColor', stroke: 'none' }));
|
|
673
|
+
}
|
|
674
|
+
|
|
627
675
|
function apply(ctx) {
|
|
628
676
|
const locale = ctx.get('locale');
|
|
629
677
|
if (locale !== undefined) {
|
|
@@ -648,8 +696,41 @@ window.__ModuleLoader__.load({
|
|
|
648
696
|
}, (props) => props.view === 'summary'
|
|
649
697
|
? Summary({ form: props.form, t })
|
|
650
698
|
: Page({ form: props.form, t })));
|
|
699
|
+
// The same form under Settings: a bundle row alone is too hidden a home
|
|
700
|
+
// for a plugin's options. The entry exists only while the Host serves
|
|
701
|
+
// this row's settings namespace, so a profile without the row (or one
|
|
702
|
+
// whose row exposes no volatile fields) shows no trace of the page.
|
|
703
|
+
ctx.effect(() => ctx.configForms.whileServed([ROW_ID], () => {
|
|
704
|
+
const form = ctx.configForms.get(ROW_ID);
|
|
705
|
+
const offSection = slots.inject('settings.section', () => slots.register({
|
|
706
|
+
name: 'settings.section',
|
|
707
|
+
id: SECTION_ID,
|
|
708
|
+
order: SECTION_ORDER,
|
|
709
|
+
label: () => t('nav'),
|
|
710
|
+
locale: NS,
|
|
711
|
+
inject: () => ({
|
|
712
|
+
mutate: (ops, revision) => form.mutate(ops, revision),
|
|
713
|
+
hooks: {
|
|
714
|
+
config: {
|
|
715
|
+
getSnapshot: () => form.getSnapshot(),
|
|
716
|
+
subscribe: (listener) => form.subscribe(listener),
|
|
717
|
+
},
|
|
718
|
+
},
|
|
719
|
+
t,
|
|
720
|
+
}),
|
|
721
|
+
}, SettingsSection));
|
|
722
|
+
const offIcon = slots.inject('settings.section.icon', () => slots.register({
|
|
723
|
+
name: 'settings.section.icon',
|
|
724
|
+
id: SECTION_ID,
|
|
725
|
+
locale: NS,
|
|
726
|
+
}, SectionIcon));
|
|
727
|
+
return () => {
|
|
728
|
+
offSection();
|
|
729
|
+
offIcon();
|
|
730
|
+
};
|
|
731
|
+
}), 'think-effort: settings entry');
|
|
651
732
|
}
|
|
652
733
|
|
|
653
|
-
return { inject: ['slots', 'locale'], apply };
|
|
734
|
+
return { inject: ['slots', 'locale', 'configForms'], apply };
|
|
654
735
|
},
|
|
655
736
|
});
|
package/docs/DETAIL.en.md
CHANGED
|
@@ -14,9 +14,16 @@ Declarative thinking-depth control for DeepSeek (and other) reasoning models: th
|
|
|
14
14
|
- Pick `Auto` in the model selector to state "use the default depth", or a concrete depth to pin it.
|
|
15
15
|
- Leaving the depth unset (the native "provider default" row) behaves like `Auto` on ordinary steps — both land on the declared default; `Auto` only records the intent in the session. The cheap-call downgrade applies either way.
|
|
16
16
|
- The recognized models, default depth and cheap-call list live in the plugin row's config (`think-effort` in `cordis.patch.yml`).
|
|
17
|
-
- The visual settings page
|
|
17
|
+
- The visual settings page has **two entries**, both editing the same form: **Settings → Automatic thinking depth** (recommended), or **Plugins → Automatic thinking depth → Configure** on the row. Every field is `volatile`, so Save applies immediately without a restart.
|
|
18
18
|
|
|
19
|
-

|
|
20
|
+
|
|
21
|
+
## Where the settings page comes from
|
|
22
|
+
|
|
23
|
+
- The row page registers into the plugin manager's `plugins.row.config`, keyed `dsh-think-effort#think-effort`.
|
|
24
|
+
- The Settings page registers into the settings panel's `settings.section` (same `id` `think-effort`, `order: 16`, right after the built-in Plugins section at 15); its glyph registers into `settings.section.icon` with the matching `id`.
|
|
25
|
+
- A Settings section receives no form from its owner, so the page reads the **row's settings namespace** (the profile entry id, `think-effort`) through the `configForms` service. `whileServed(['think-effort'])` registers the entry only while the Host serves that namespace, so a deployment without the row never shows an empty page.
|
|
26
|
+
- Both entries share one form controller inside `configForms`, so a save from either place is the same profile write.
|
|
20
27
|
|
|
21
28
|
## Limitations
|
|
22
29
|
|
package/docs/DETAIL.zh.md
CHANGED
|
@@ -14,9 +14,16 @@
|
|
|
14
14
|
- 在模型选择器里选 `Auto` 即声明「按默认档走」;选具体档位即固定该档位。
|
|
15
15
|
- 不选任何档位(原生“提供方默认”)在普通步骤上与 `Auto` 等效,都会落到声明默认档;差别只是 `Auto` 把意图记录进会话。廉价调用的降档在任何情况下都生效。
|
|
16
16
|
- 识别范围、默认档、廉价调用清单都在插件配置里(`cordis.patch.yml` 的 `think-effort` 行)。
|
|
17
|
-
-
|
|
17
|
+
- 可视化设置有**两个入口**,表单与写入相同:**设置 → 自动思考档位**(推荐),或**插件 → 自动思考档位 → 行「配置」**。字段全部是 `volatile` 配置,保存后立即生效(无需重启)。
|
|
18
18
|
|
|
19
|
-

|
|
20
|
+
|
|
21
|
+
## 设置页从哪里来
|
|
22
|
+
|
|
23
|
+
- 插件行页面注册进插件管理器的 `plugins.row.config`,键为 `dsh-think-effort#think-effort`;
|
|
24
|
+
- 设置页注册进设置面板的 `settings.section`(`id` 同为 `think-effort`,`order: 16`,紧跟 order 15 的内置插件),图标注册进 `settings.section.icon` 且 `id` 必须与之一致;
|
|
25
|
+
- 设置页没有 owner 传入的表单,所以它从 `configForms` 服务读取**行设置命名空间**(即 profile 条目 id `think-effort`)。`whileServed(['think-effort'])` 保证只有 Host 正在提供该命名空间时才注册,页面不会在没有这一行的部署里留下空壳;
|
|
26
|
+
- 两个入口共用 `configForms` 里同一个表单控制器,因此任一入口的保存都是同一次 profile 写入。
|
|
20
27
|
|
|
21
28
|
## 限制
|
|
22
29
|
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-think-effort",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "Automatic thinking depth for DeepSeek routes in DeepSeek Harness: declare the model's effort vocabulary, add Auto to the model selector, resolve it to the declared default, give subagents their own depth, drop cheap host-owned calls to Low, and edit every rule on a live visual settings page.",
|
|
5
|
+
"description": "Automatic thinking depth for DeepSeek routes in DeepSeek Harness: declare the model's effort vocabulary, add Auto to the model selector, resolve it to the declared default, give subagents their own depth, drop cheap host-owned calls to Low, and edit every rule on a live visual settings page reachable from both Settings and the Plugins row.",
|
|
6
6
|
"icon": "./icon.svg",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "mhlywxl",
|