dsh-thinking-levels 0.3.0 → 0.3.1

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 (3) hide show
  1. package/README.md +46 -19
  2. package/README.zh.md +46 -19
  3. package/package.json +5 -5
package/README.md CHANGED
@@ -1,26 +1,36 @@
1
1
  # dsh-thinking-levels
2
2
 
3
- **Per-round thinking-level (`reasoning_effort`) control for [DeepSeek Harness (dsh)](https://github.com/deepseek-ai/deepseek-harness): five levels — `off` / `low` / `high` / `max` for manual control, plus an `auto` scheduler that keeps cheap tool rounds cheap and never starves heavy work.**
3
+ **Per-round thinking-level (`reasoning_effort`) control for [DeepSeek Harness (dsh)](https://github.com/deepseek-ai/deepseek-harness): pick `Auto` (a mask) in the session model selector and the plugin schedules `low` / `high` / `max` from the recent tool-call history before submitting the API effort — or fix a wire level (`off` / `low` / `high` / `max`) manually. Cheap tool rounds stay cheap; heavy work never starves.**
4
4
 
5
5
  [中文文档](./README.zh.md) · English
6
6
 
7
- In a multi-step tool chain, the model re-thinks before **every** tool call — and that thinking dominates the wall-clock time (a 50-step agent task can spend minutes reasoning between tools). `dsh-thinking-levels` plugs into the `agent/request` waterfall that dsh re-resolves for every step, and injects a thinking level into the next model request.
7
+ In a multi-step tool chain, the model re-thinks before **every** tool call — and that thinking dominates the wall-clock time (a 50-step agent task can spend minutes reasoning between tools). `dsh-thinking-levels` plugs into the `agent/request` waterfall that dsh re-resolves for every step (registered with `prepend` so the session model-selection assembly cannot overwrite its decision) and injects a thinking level into the next model request.
8
8
 
9
9
  ## Levels
10
10
 
11
- | Level | Meaning |
12
- |---|---|
13
- | `off` | thinking disabled (manual only — never auto-picked) |
14
- | `low` | manual pick for simple chat tasks (cheap rounds stay cheap) |
15
- | `high` | the official default effort |
16
- | `max` | heavy work |
17
- | `auto` | schedule per step from the recent tool-call history |
11
+ | Level | Meaning | Where |
12
+ |---|---|---|
13
+ | `off` | thinking disabled (manual only — never auto-picked) | model selector / default level |
14
+ | `low` | manual pick for simple chat tasks (cheap rounds stay cheap) | model selector / default level |
15
+ | `high` | the official default effort | model selector / default level |
16
+ | `max` | heavy work | model selector / default level |
17
+ | `auto` | **mask**: schedule per step from the recent tool-call history, resolved to a wire level before submission | model selector (injected by the plugin) / default level |
18
+
19
+ Wire-level facts (verified against the official DeepSeek docs and dsh's `llm-deepseek` adapter): `low` maps 1:1 on deepseek-v4-flash / v4-pro, while `medium` / `xhigh` collapse onto `high`. The adapter accepts `off | low | high | max` and rejects anything else with `UNSUPPORTED_REASONING_EFFORT` — `auto` is the plugin's mask layer, never sent to the API, always resolved to a concrete wire level before injection.
18
20
 
19
- Wire-level facts (verified against the official DeepSeek docs and dsh's `llm-deepseek` adapter): `low` maps 1:1 on deepseek-v4-flash / v4-pro, while `medium` / `xhigh` collapse onto `high`. The adapter accepts `off | low | high | max` and rejects anything else with `UNSUPPORTED_REASONING_EFFORT` — this plugin validates the configured level before injecting, fail-loud.
21
+ ## Model-selector Auto
22
+
23
+ The session model selector (next to the model) now offers **Auto** after `Off / Low / High / Max` (injected into the model-directory metadata by the plugin):
24
+
25
+ | Model-selector pick | Behavior |
26
+ |---|---|
27
+ | **Auto** | plugin schedules via tool history + the upgrade/downgrade toggles, resolves to `low` / `high` / `max` before submission |
28
+ | `off` / `low` / `high` / `max` | **manual choice wins** — plugin does not intervene |
29
+ | unset | the plugin's default level applies (below) |
20
30
 
21
31
  ## Auto scheduler
22
32
 
23
- The hub is `high` (the official default). `auto` schedules between `low` / `high` / `max`; it never picks `off`, and it always resolves to a wire level before injecting.
33
+ The hub is `high` (the official default). `auto` schedules between `low` / `high` / `max`; it never picks `off`.
24
34
 
25
35
  | Recent tool calls | Level |
26
36
  |---|---|
@@ -29,20 +39,27 @@ The hub is `high` (the official default). `auto` schedules between `low` / `high
29
39
  | mixed / heavy tools | `high` |
30
40
  | very heavy payloads, upgrades allowed | `max` |
31
41
 
42
+ The scheduling policy is the same source as [dsh-tool-turbo](https://github.com/drscrewdriver/dsh-tool-turbo) (same simple-tool whitelist / payload thresholds / 75% ratio rule).
43
+
32
44
  ## Install
33
45
 
34
46
  ```bash
35
- # 1. install the plugin into a profile from GitHub (web shown; any profile works)
47
+ # 1. install the plugin into a profile from npm (web shown; any profile works)
36
48
  # (the web profile is a pnpm workspace root, so -w is required)
37
- dsh plugin --profile web add https://github.com/drscrewdriver/dsh-thinking-levels.git -w
38
- # local-path alternative (no network needed, no -w outside workspace roots):
49
+ dsh plugin --profile web add dsh-thinking-levels -w
50
+ # GitHub alternative:
51
+ # dsh plugin --profile web add https://github.com/drscrewdriver/dsh-thinking-levels.git -w
52
+ # local-path alternative (no network needed):
39
53
  # dsh plugin --profile web add /absolute/path/to/dsh-thinking-levels
40
54
 
41
- # 2. restart dsh web
42
- # (a running instance does not hot-load new bundle layers)
55
+ # 2. restart dsh web (a running instance does not hot-load new bundle layers)
43
56
  dsh web
44
57
  ```
45
58
 
59
+ > Note: the dsh runtime uses pnpm 11, whose `minimumReleaseAge` supply-chain policy may block a
60
+ > freshly published version with `ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION` — add the version to
61
+ > `minimumReleaseAgeExclude` in `~/.dsh/profiles/web/pnpm-workspace.yaml` to lift the cooling period.
62
+
46
63
  Manual `link:` registration (alternative to `dsh plugin add`):
47
64
 
48
65
  ```bash
@@ -62,14 +79,24 @@ Two surfaces share one schema:
62
79
  - **Assembly** — the plugin row's `config:` in the profile composition (e.g. `cordis.yml`):
63
80
  ```yaml
64
81
  config:
65
- level: high # off | low | high | max | auto
66
- allowDowngrade: false # forbid the scheduler dropping below `high`
82
+ level: auto # off | low | high | max | auto — the default level when the session picks nothing
83
+ allowDowngrade: true # let the scheduler drop below `high`
67
84
  allowUpgrade: false # forbid the scheduler lifting to `max`
68
85
  ```
69
- - **Runtime** — the dsh-settings namespace `thinking-levels` (`level`, `allowDowngrade`, `allowUpgrade`, `enabled`): changes apply to the next model request, no restart needed.
86
+ - **Runtime** — the dsh-settings namespace `thinking-levels` (`level`, `allowDowngrade`, `allowUpgrade`, `enabled`): changes apply to the next model request, no restart needed. A visual editor is available under Settings → Plugins → configurable plugins.
70
87
 
71
88
  Defaults: `{ enabled: true, level: 'auto', allowDowngrade: true, allowUpgrade: false }`.
72
89
 
90
+ > Semantics: the model-selector pick outranks the plugin's default level. Pick `auto` (mask) → plugin schedules; pick `off/low/high/max` → applied directly; pick nothing → the plugin's `level` default is used. `allowDowngrade` / `allowUpgrade` constrain `auto` scheduling only.
91
+
92
+ ## Dependency note
93
+
94
+ The host half value-imports `@deepseek-ai/dsh-settings` (an official package absent from the profile's hoisted node_modules by design — it resolves from the dsh global install). If the plugin shows as disabled/unmounted in the plugin list, install the official dependency into the profile:
95
+
96
+ ```bash
97
+ dsh plugin --profile web add @deepseek-ai/dsh-settings@^0.1.0-rc.7 -w
98
+ ```
99
+
73
100
  ## Development
74
101
 
75
102
  ```bash
package/README.zh.md CHANGED
@@ -1,26 +1,36 @@
1
1
  # dsh-thinking-levels
2
2
 
3
- **为 [DeepSeek Harness (dsh)](https://github.com/deepseek-ai/deepseek-harness) 提供按轮次的思考档位(`reasoning_effort`)控制:`off` / `low` / `high` / `max` 四档手动固定,外加 `auto` 自动调度——让廉价工具轮次保持廉价,同时绝不让重任务缺少推理。**
3
+ **为 [DeepSeek Harness (dsh)](https://github.com/deepseek-ai/deepseek-harness) 提供按轮次的思考档位(`reasoning_effort`)控制:在会话模型选择器中可选 `Auto`(mask)——由插件按工具调用历史自动在 `low` / `high` / `max` 间调度后提交 API;也可手动固定 `off` / `low` / `high` / `max`,让廉价工具轮次保持廉价,同时绝不让重任务缺少推理。**
4
4
 
5
5
  [中文文档](./README.zh.md) · English
6
6
 
7
- 在多步工具链任务中,模型在**每一次工具调用前**都会重新思考——而这个思考过程占据了绝大部分墙钟时间(一个 50 步的 agent 任务可能在工具之间花费数分钟思考)。`dsh-thinking-levels` 接入 dsh 每一步都会重新解析的 `agent/request` waterfall,向下一次模型请求注入思考档位。
7
+ 在多步工具链任务中,模型在**每一次工具调用前**都会重新思考——而这个思考过程占据了绝大部分墙钟时间(一个 50 步的 agent 任务可能在工具之间花费数分钟思考)。`dsh-thinking-levels` 接入 dsh 每一步都会重新解析的 `agent/request` waterfall(以 `prepend` 置于最外层,避免被会话模型选择覆盖),向下一次模型请求注入思考档位。
8
8
 
9
9
  ## 档位
10
10
 
11
- | 档位 | 含义 |
12
- |---|---|
13
- | `off` | 关闭思考(仅手动选择,自动调度永不选用) |
14
- | `low` | 手动低档,对应简单对话任务(廉价轮次保持廉价) |
15
- | `high` | 官方默认档位 |
16
- | `max` | 重任务 |
17
- | `auto` | 依据最近的工具调用历史逐轮调度 |
11
+ | 档位 | 含义 | 位置 |
12
+ |---|---|---|
13
+ | `off` | 关闭思考(仅手动选择,自动调度永不选用) | 模型选择器 / 默认档位 |
14
+ | `low` | 手动低档,对应简单对话任务(廉价轮次保持廉价) | 模型选择器 / 默认档位 |
15
+ | `high` | 官方默认档位 | 模型选择器 / 默认档位 |
16
+ | `max` | 重任务 | 模型选择器 / 默认档位 |
17
+ | `auto` | **mask**:按最近的工具调用历史逐轮调度,提交 API 前解析为具体档位 | 模型选择器(由插件注入元数据)/ 默认档位 |
18
+
19
+ 线缆档位事实(对照官方 DeepSeek 文档与 dsh `llm-deepseek` 适配器核实):deepseek-v4-flash / v4-pro 上 `low` 1:1 生效,`medium` / `xhigh` 折叠到 `high`。适配器只接受 `off | low | high | max`,其他值抛 `UNSUPPORTED_REASONING_EFFORT`——`auto` 是插件的 mask 层,永不直接发送给 API,注入前必然解析为具体线缆档位。
18
20
 
19
- 线缆档位事实(对照官方 DeepSeek 文档与 dsh `llm-deepseek` 适配器核实):deepseek-v4-flash / v4-pro 上 `low` 1:1 生效,`medium` / `xhigh` 折叠到 `high`。适配器只接受 `off | low | high | max`,其他值抛 `UNSUPPORTED_REASONING_EFFORT`——本插件在注入前 fail-loud 校验配置档位。
21
+ ## 模型选择器 Auto
22
+
23
+ 会话界面模型选择器(模型旁)现在提供 **Auto** 档位(由插件注入模型目录元数据,位于 `Off / Low / High / Max` 之后):
24
+
25
+ | 模型选择器选择 | 行为 |
26
+ |---|---|
27
+ | **Auto** | 插件按工具调用历史 + 升降档开关调度,解析成 `low` / `high` / `max` 后提交 API |
28
+ | `off` / `low` / `high` / `max` | **尊重手动选择**,插件不介入 |
29
+ | 未选择 | 使用插件的默认档位(见下) |
20
30
 
21
31
  ## 自动调度
22
32
 
23
- 中枢为 `high`(官方默认)。`auto` 只在 `low` / `high` / `max` 之间调度;永不选 `off`,且注入前必然解析为具体线缆档位。
33
+ 中枢为 `high`(官方默认)。`auto` 只在 `low` / `high` / `max` 之间调度;永不选 `off`。
24
34
 
25
35
  | 最近的工具调用 | 档位 |
26
36
  |---|---|
@@ -29,20 +39,27 @@
29
39
  | 混合 / 重工具 | `high` |
30
40
  | 超大载荷、允许升级 | `max` |
31
41
 
42
+ 调度策略与 [dsh-tool-turbo](https://github.com/drscrewdriver/dsh-tool-turbo) 同源(同一套简单工具白名单 / 载荷阈值 / 75% 比例规则)。
43
+
32
44
  ## 安装
33
45
 
34
46
  ```bash
35
- # 1. 从 GitHub 把插件装进某个 profile(以 web 为例,任意 profile 均可)
47
+ # 1. 从 npm 把插件装进某个 profile(以 web 为例,任意 profile 均可)
36
48
  # (web profile 是 pnpm workspace root,必须带 -w)
37
- dsh plugin --profile web add https://github.com/drscrewdriver/dsh-thinking-levels.git -w
38
- # 本地路径备选(无需网络;非 workspace root 目录无需 -w):
49
+ dsh plugin --profile web add dsh-thinking-levels -w
50
+ # GitHub 安装备选:
51
+ # dsh plugin --profile web add https://github.com/drscrewdriver/dsh-thinking-levels.git -w
52
+ # 本地路径备选(无需网络):
39
53
  # dsh plugin --profile web add /dsh-thinking-levels 的绝对路径/
40
54
 
41
- # 2. 重启 dsh web
42
- # (运行中的实例不会热加载新的 bundle 层)
55
+ # 2. 重启 dsh web(运行中的实例不会热加载新的 bundle 层)
43
56
  dsh web
44
57
  ```
45
58
 
59
+ > 注意:dsh 运行环境使用 pnpm 11,新发布的版本会受 `minimumReleaseAge` 冷却期约束;如安装报
60
+ > `ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION`,在 `~/.dsh/profiles/web/pnpm-workspace.yaml` 的
61
+ > `minimumReleaseAgeExclude` 中加入对应版本即可。
62
+
46
63
  手动 `link:` 注册(`dsh plugin add` 的备选方式):
47
64
 
48
65
  ```bash
@@ -62,14 +79,24 @@ cd ~/.dsh/profiles/web && pnpm install && dsh web
62
79
  - **装配层** — profile 组合中插件行的 `config:`(如 `cordis.yml`):
63
80
  ```yaml
64
81
  config:
65
- level: high # off | low | high | max | auto
66
- allowDowngrade: false # 禁止调度器降到 `high` 以下
82
+ level: auto # off | low | high | max | auto —— 会话未显式选择时的默认档位
83
+ allowDowngrade: true # 允许调度器降到 `high` 以下
67
84
  allowUpgrade: false # 禁止调度器升到 `max`
68
85
  ```
69
- - **运行时** — dsh-settings 命名空间 `thinking-levels`(`level`、`allowDowngrade`、`allowUpgrade`、`enabled`):改动对下一次模型请求生效,无需重启。
86
+ - **运行时** — dsh-settings 命名空间 `thinking-levels`(`level`、`allowDowngrade`、`allowUpgrade`、`enabled`):改动对下一次模型请求生效,无需重启。设置面板(设置 → 插件 → 可配置插件)提供可视化编辑。
70
87
 
71
88
  默认值:`{ enabled: true, level: 'auto', allowDowngrade: true, allowUpgrade: false }`。
72
89
 
90
+ > 语义说明:模型选择器选择优先于插件默认档位。选 `auto`(mask)→ 插件调度;选 `off/low/high/max` → 直接生效;未选择 → 使用插件的 `level` 默认档位。`allowDowngrade` / `allowUpgrade` 只约束 `auto` 调度。
91
+
92
+ ## 依赖说明
93
+
94
+ 插件 host 侧值依赖 `@deepseek-ai/dsh-settings`(官方包默认不在 profile 的 hoisted node_modules 中,会从 dsh 全局嵌套解析)。如插件在插件列表中显示“已停用/未挂载”,请将官方依赖装入 profile:
95
+
96
+ ```bash
97
+ dsh plugin --profile web add @deepseek-ai/dsh-settings@^0.1.0-rc.7 -w
98
+ ```
99
+
73
100
  ## 开发
74
101
 
75
102
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-thinking-levels",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "DSH host plugin: thinking-level (reasoning_effort) control for dsh — auto-adjust per tool round, with optional manual lock and per-tool timing telemetry.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,16 +34,16 @@
34
34
  },
35
35
  "peerDependencies": {
36
36
  "@deepseek-ai/cordis": "^4.0.1",
37
- "@deepseek-ai/dsh-agent": "^0.1.0-rc.6",
38
- "@deepseek-ai/dsh-settings": "^0.1.0-rc.6"
37
+ "@deepseek-ai/dsh-agent": "^0.1.0-rc.7",
38
+ "@deepseek-ai/dsh-settings": "^0.1.0-rc.7"
39
39
  },
40
40
  "dependencies": {
41
41
  "@deepseek-ai/schemastery": "^3.18.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@deepseek-ai/cordis": "^4.0.1",
45
- "@deepseek-ai/dsh-agent": "^0.1.0-rc.6",
46
- "@deepseek-ai/dsh-settings": "^0.1.0-rc.6",
45
+ "@deepseek-ai/dsh-agent": "^0.1.0-rc.7",
46
+ "@deepseek-ai/dsh-settings": "^0.1.0-rc.7",
47
47
  "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.7",
48
48
  "@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.7",
49
49
  "@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.7",