dsh-thinking-levels 0.4.1 → 0.6.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.ja.md +89 -0
- package/CHANGELOG.ko.md +89 -0
- package/CHANGELOG.md +89 -0
- package/INSTALL.ja.md +163 -0
- package/INSTALL.ko.md +163 -0
- package/INSTALL.md +163 -0
- package/INSTALL.zh.md +163 -0
- package/LICENSE +21 -0
- package/README.ja.md +168 -0
- package/README.ko.md +168 -0
- package/README.md +195 -108
- package/README.zh.md +174 -108
- package/lib/client.js +1142 -93
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +35 -3
- package/lib/index.js +221 -26
- package/lib/takeover-sync.d.ts +98 -0
- package/lib/takeover-sync.js +131 -0
- package/lib/thinking-level.d.ts +106 -16
- package/lib/thinking-level.js +126 -13
- package/package.json +88 -79
package/INSTALL.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Installation Guide (Official DSH CLI)
|
|
2
|
+
|
|
3
|
+
This guide uses only the official DSH `dsh plugin` command. The command installs the dependency into a profile and synchronizes `dsh.profile.bundles`. Do not replace it with plain `npm install`, direct `pnpm add` in the profile, or manual edits to the profile manifest.
|
|
4
|
+
|
|
5
|
+
- [English installation guide](./INSTALL.md)
|
|
6
|
+
- [中文安装指南](./INSTALL.zh.md)
|
|
7
|
+
- [日本語インストールガイド](./INSTALL.ja.md)
|
|
8
|
+
- [한국어 설치 안내](./INSTALL.ko.md)
|
|
9
|
+
- [English README](./README.md)
|
|
10
|
+
- [中文 README](./README.zh.md)
|
|
11
|
+
- [日本語 README](./README.ja.md)
|
|
12
|
+
- [한국어 README](./README.ko.md)
|
|
13
|
+
- [Changelog](./CHANGELOG.md)
|
|
14
|
+
- [日本語 changelog](./CHANGELOG.ja.md)
|
|
15
|
+
- [한국어 changelog](./CHANGELOG.ko.md)
|
|
16
|
+
|
|
17
|
+
The placeholders in this guide are:
|
|
18
|
+
|
|
19
|
+
- `<profile>`: the DSH profile to modify, usually `web`;
|
|
20
|
+
- `dsh-thinking-levels`: the npm package and runtime plugin ID;
|
|
21
|
+
- `thinking-levels`: the Cordis composition and settings Slot ID.
|
|
22
|
+
|
|
23
|
+
## 0. Prerequisites and profile discovery
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
echo "DSH_HOME=${DSH_HOME:-$HOME/.dsh}"
|
|
27
|
+
dsh --version
|
|
28
|
+
ls "${DSH_HOME:-$HOME/.dsh}/profiles"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Use the profile named by your running DSH process. `web` is common, but the active `--profile` argument is authoritative.
|
|
32
|
+
|
|
33
|
+
## 1. Official installation
|
|
34
|
+
|
|
35
|
+
Install the latest version:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
dsh plugin --profile <profile> add dsh-thinking-levels -w
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
(The `-w` flag is required when the profile is a pnpm workspace root, as `web` is.)
|
|
42
|
+
|
|
43
|
+
Install the current release explicitly:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
dsh plugin --profile <profile> add dsh-thinking-levels@0.6.0 -w
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The official CLI updates the profile dependency, lockfile, and `dsh.profile.bundles` automatically. Do not add a manual YAML row.
|
|
50
|
+
|
|
51
|
+
### Supply-chain cooling period
|
|
52
|
+
|
|
53
|
+
The dsh runtime uses pnpm 11, whose `minimumReleaseAge` policy may block a freshly published
|
|
54
|
+
version with `ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION`. Add the version to
|
|
55
|
+
`minimumReleaseAgeExclude` in `~/.dsh/profiles/web/pnpm-workspace.yaml`:
|
|
56
|
+
|
|
57
|
+
```yaml
|
|
58
|
+
minimumReleaseAgeExclude:
|
|
59
|
+
- dsh-thinking-levels@0.6.0
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 2. Upgrade
|
|
63
|
+
|
|
64
|
+
Upgrade to the latest registry version:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
dsh plugin --profile <profile> update dsh-thinking-levels -w
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Restart DSH for host changes and refresh the Web page for client changes.
|
|
71
|
+
|
|
72
|
+
## 3. Local-path / link: registration (alternative)
|
|
73
|
+
|
|
74
|
+
For development or offline installs, register the plugin from a local checkout:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# ~/.dsh/profiles/web/package.json dependencies:
|
|
78
|
+
# "dsh-thinking-levels": "link:<absolute path to dsh-thinking-levels>"
|
|
79
|
+
# ~/.dsh/profiles/web/cordis.patch.yml:
|
|
80
|
+
# - insert:
|
|
81
|
+
# - id: thinking-levels
|
|
82
|
+
# name: dsh-thinking-levels
|
|
83
|
+
cd ~/.dsh/profiles/web && pnpm install && dsh web
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Or use the official CLI with a local path (no network needed):
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
dsh plugin --profile <profile> add /absolute/path/to/dsh-thinking-levels -w
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## 4. Verify installation
|
|
93
|
+
|
|
94
|
+
Check the dependency and installed version:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
grep -n "dsh-thinking-levels" \
|
|
98
|
+
"${DSH_HOME:-$HOME/.dsh}/profiles/<profile>/package.json"
|
|
99
|
+
node -p "require('${DSH_HOME:-$HOME/.dsh}/profiles/<profile>/node_modules/dsh-thinking-levels/package.json').version"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
The version must be `0.6.0` for this release.
|
|
103
|
+
|
|
104
|
+
Check the official composition:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
dsh --profile <profile> --dump-default-config
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
It must contain:
|
|
111
|
+
|
|
112
|
+
```yaml
|
|
113
|
+
- id: thinking-levels
|
|
114
|
+
name: dsh-thinking-levels
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## 5. Verify the settings card
|
|
118
|
+
|
|
119
|
+
Restart DSH, then refresh the Web page. Open **Settings → Plugins → configurable plugins** and expand the **Thinking Levels** card.
|
|
120
|
+
|
|
121
|
+
1. The level picker offers the eight standard levels plus `auto`; the scheduler toggles sit below.
|
|
122
|
+
2. The model-capabilities block groups providers; each model row shows text/image badges and a declared context window, and expands into the per-level editor.
|
|
123
|
+
3. Tick a level and enter its gateway wire value (e.g. `high` → `ultra`), then press **Apply levels**. `off` left empty means "do not send".
|
|
124
|
+
4. The search box filters models; the official / generic presets apply to every thinking model.
|
|
125
|
+
|
|
126
|
+
## Japanese and Korean support status
|
|
127
|
+
|
|
128
|
+
The plugin ships `ja` and `ko` dictionaries, but the current official DSH release exposes only `zh` and `en` through `LocaleRuntime`. On stock DSH, selecting Japanese or Korean fails with `locale "<id>" is not registered`.
|
|
129
|
+
|
|
130
|
+
To use them before official support lands, maintain a DSH fork and update:
|
|
131
|
+
|
|
132
|
+
- `packages/client/locale/src/locale-settings.ts`: add `ja` and `ko` to `LOCALE_IDS` (the Host preference schema derives from this list).
|
|
133
|
+
- `packages/client/locale/src/client/index.ts`: add `{ id: 'ja', label: '日本語' }` and `{ id: 'ko', label: '한국어' }` to `LOCALES`.
|
|
134
|
+
- Add the corresponding core dictionaries and tests, then rebuild and run the forked DSH.
|
|
135
|
+
|
|
136
|
+
A plugin-only change cannot extend DSH's global locale list. Use the fork's documented build and official profile commands; do not manually edit a profile manifest.
|
|
137
|
+
|
|
138
|
+
## 6. Troubleshooting
|
|
139
|
+
|
|
140
|
+
| Symptom | Action |
|
|
141
|
+
| --- | --- |
|
|
142
|
+
| `dsh` is not found | Install or enable the official DSH CLI. Do not simulate profile installation with plain npm or pnpm commands. |
|
|
143
|
+
| `ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION` | Add the version to `minimumReleaseAgeExclude` in the profile's `pnpm-workspace.yaml`. |
|
|
144
|
+
| Plugin shows as "disabled/unmounted" with no error | Check the profile composition; the host must not value-depend on `@deepseek-ai/dsh-settings` (it does not). |
|
|
145
|
+
| Client entry missing from `__DSH_BOOT__` | Confirm `exports["./client"]` exists and the host fiber was established. |
|
|
146
|
+
| Model selector has no `Auto` | Confirm the adapter `resolveModel` wrapper ran (it re-runs on `llm/adapters-updated`). |
|
|
147
|
+
| Settings card write fails | The value was rejected by the llm-pi-ai schema (e.g. a `reasoningEfforts` table with no thinking level). Check the entered values. |
|
|
148
|
+
| Subagent returns `UNSUPPORTED_REASONING_EFFORT` | The target model does not advertise the level; pick a supported one or restore the provider default. |
|
|
149
|
+
| Stale client bundle | Hard-refresh the browser (Ctrl+Shift+R) after an upgrade. |
|
|
150
|
+
|
|
151
|
+
## 7. Remove
|
|
152
|
+
|
|
153
|
+
Use the official command:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
dsh plugin --profile <profile> remove dsh-thinking-levels -w
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Verify that the composed profile no longer contains the bundle:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
dsh --profile <profile> --dump-default-config
|
|
163
|
+
```
|
package/INSTALL.zh.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# 安装指南(官方 DSH CLI)
|
|
2
|
+
|
|
3
|
+
本指南只使用官方 `dsh plugin` 命令。该命令会把依赖装进 profile 并同步 `dsh.profile.bundles`。不要用普通 `npm install`、在 profile 里直接 `pnpm add` 或手工编辑 profile 清单代替。
|
|
4
|
+
|
|
5
|
+
- [安装指南](./INSTALL.zh.md)
|
|
6
|
+
- [English installation guide](./INSTALL.md)
|
|
7
|
+
- [日本語インストールガイド](./INSTALL.ja.md)
|
|
8
|
+
- [한국어 설치 안내](./INSTALL.ko.md)
|
|
9
|
+
- [中文 README](./README.zh.md)
|
|
10
|
+
- [English README](./README.md)
|
|
11
|
+
- [日本語 README](./README.ja.md)
|
|
12
|
+
- [한국어 README](./README.ko.md)
|
|
13
|
+
- [版本更新日志](./CHANGELOG.md)
|
|
14
|
+
- [日本語 changelog](./CHANGELOG.ja.md)
|
|
15
|
+
- [한국어 changelog](./CHANGELOG.ko.md)
|
|
16
|
+
|
|
17
|
+
本指南中的占位符:
|
|
18
|
+
|
|
19
|
+
- `<profile>`:要修改的 DSH profile,通常是 `web`;
|
|
20
|
+
- `dsh-thinking-levels`:npm 包名与运行时插件 ID;
|
|
21
|
+
- `thinking-levels`:Cordis 组合条目与设置页 Slot ID。
|
|
22
|
+
|
|
23
|
+
## 0. 前置检查与 profile 确认
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
echo "DSH_HOME=${DSH_HOME:-$HOME/.dsh}"
|
|
27
|
+
dsh --version
|
|
28
|
+
ls "${DSH_HOME:-$HOME/.dsh}/profiles"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
使用你正在运行的 DSH 进程对应的 profile。`web` 很常见,但以实际 `--profile` 参数为准。
|
|
32
|
+
|
|
33
|
+
## 1. 官方安装
|
|
34
|
+
|
|
35
|
+
安装最新版本:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
dsh plugin --profile <profile> add dsh-thinking-levels -w
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
(当 profile 是 pnpm workspace root 时必须带 `-w`,`web` 就是。)
|
|
42
|
+
|
|
43
|
+
显式安装当前发布版:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
dsh plugin --profile <profile> add dsh-thinking-levels@0.6.0 -w
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
官方 CLI 会自动更新 profile 依赖、锁文件与 `dsh.profile.bundles`。不要手工追加 YAML。
|
|
50
|
+
|
|
51
|
+
### 供应链冷却期
|
|
52
|
+
|
|
53
|
+
dsh 运行环境使用 pnpm 11,其 `minimumReleaseAge` 策略可能拦截刚发布的版本,报
|
|
54
|
+
`ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION`。把版本加入 `~/.dsh/profiles/web/pnpm-workspace.yaml` 的
|
|
55
|
+
`minimumReleaseAgeExclude`:
|
|
56
|
+
|
|
57
|
+
```yaml
|
|
58
|
+
minimumReleaseAgeExclude:
|
|
59
|
+
- dsh-thinking-levels@0.6.0
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 2. 升级
|
|
63
|
+
|
|
64
|
+
升级到 registry 最新版本:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
dsh plugin --profile <profile> update dsh-thinking-levels -w
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
宿主侧改动需重启 DSH;浏览器侧刷新 Web 页面。
|
|
71
|
+
|
|
72
|
+
## 3. 本地路径 / link: 注册(备选)
|
|
73
|
+
|
|
74
|
+
开发或离线安装时,可以从本地检出注册插件:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# ~/.dsh/profiles/web/package.json dependencies 增加:
|
|
78
|
+
# "dsh-thinking-levels": "link:<dsh-thinking-levels 的绝对路径>"
|
|
79
|
+
# ~/.dsh/profiles/web/cordis.patch.yml:
|
|
80
|
+
# - insert:
|
|
81
|
+
# - id: thinking-levels
|
|
82
|
+
# name: dsh-thinking-levels
|
|
83
|
+
cd ~/.dsh/profiles/web && pnpm install && dsh web
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
或用官方 CLI 加本地路径(无需网络):
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
dsh plugin --profile <profile> add /dsh-thinking-levels 的绝对路径/ -w
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## 4. 验证安装
|
|
93
|
+
|
|
94
|
+
检查依赖与安装版本:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
grep -n "dsh-thinking-levels" \
|
|
98
|
+
"${DSH_HOME:-$HOME/.dsh}/profiles/<profile>/package.json"
|
|
99
|
+
node -p "require('${DSH_HOME:-$HOME/.dsh}/profiles/<profile>/node_modules/dsh-thinking-levels/package.json').version"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
本版本的版本号必须是 `0.6.0`。
|
|
103
|
+
|
|
104
|
+
检查官方组合配置:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
dsh --profile <profile> --dump-default-config
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
应包含:
|
|
111
|
+
|
|
112
|
+
```yaml
|
|
113
|
+
- id: thinking-levels
|
|
114
|
+
name: dsh-thinking-levels
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## 5. 验证设置卡片
|
|
118
|
+
|
|
119
|
+
重启 DSH 后刷新 Web 页面。打开「设置 → 插件 → 可配置插件」,展开「思考档位」卡片。
|
|
120
|
+
|
|
121
|
+
1. 档位选择器提供 8 个标准档位加 `auto`;下方是调度开关。
|
|
122
|
+
2. 模型能力区按提供方分组;每个模型行显示文字/图片徽标与声明的上下文长度,展开后进入逐档编辑器。
|
|
123
|
+
3. 勾选档位并填写网关线上值(如 `high` → `ultra`),点击「应用档位」保存。`off` 留空表示不发送。
|
|
124
|
+
4. 搜索框可筛选模型;官方/通用预设一键应用到全部思考模型。
|
|
125
|
+
|
|
126
|
+
## 日语与韩语支持状态
|
|
127
|
+
|
|
128
|
+
插件自带 `ja` 与 `ko` 字典,但当前官方 DSH 只通过 `LocaleRuntime` 暴露 `zh` 和 `en`。在原版 DSH 上选择日语或韩语会报 `locale "<id>" is not registered`。
|
|
129
|
+
|
|
130
|
+
官方支持落地前要使用它们,请维护 DSH fork 并更新:
|
|
131
|
+
|
|
132
|
+
- `packages/client/locale/src/locale-settings.ts`:把 `ja` 与 `ko` 加入 `LOCALE_IDS`(Host 偏好 schema 由该列表派生)。
|
|
133
|
+
- `packages/client/locale/src/client/index.ts`:在 `LOCALES` 中加入 `{ id: 'ja', label: '日本語' }` 与 `{ id: 'ko', label: '한국어' }`。
|
|
134
|
+
- 补齐对应的核心字典与测试,然后重新构建并运行 fork 版本。
|
|
135
|
+
|
|
136
|
+
仅修改插件无法扩展 DSH 的全局 locale 列表。请使用 fork 文档中的构建与官方 profile 命令;不要手工编辑 profile 清单。
|
|
137
|
+
|
|
138
|
+
## 6. 排查
|
|
139
|
+
|
|
140
|
+
| 症状 | 处理 |
|
|
141
|
+
| --- | --- |
|
|
142
|
+
| 找不到 `dsh` 命令 | 安装或启用官方 DSH CLI。不要用普通 npm/pnpm 命令模拟 profile 安装。 |
|
|
143
|
+
| `ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION` | 把版本加入 profile 的 `pnpm-workspace.yaml` 的 `minimumReleaseAgeExclude`。 |
|
|
144
|
+
| 插件显示「已停用/未挂载」且无错误 | 检查 profile 组合;宿主不得值依赖 `@deepseek-ai/dsh-settings`(本插件没有)。 |
|
|
145
|
+
| client 入口不在 `__DSH_BOOT__` | 确认 `exports["./client"]` 存在且 host fiber 已建立。 |
|
|
146
|
+
| 模型选择器没有 `Auto` | 确认 adapter `resolveModel` 包装已生效(`llm/adapters-updated` 时重新包装)。 |
|
|
147
|
+
| 设置卡片写入失败 | 值被 llm-pi-ai schema 拒绝(如 `reasoningEfforts` 表没有任何思考档位)。检查填写值。 |
|
|
148
|
+
| 子 agent 报 `UNSUPPORTED_REASONING_EFFORT` | 目标模型未声明该档位;改用支持的档位或恢复提供方默认。 |
|
|
149
|
+
| 浏览器显示旧 bundle | 升级后硬刷新(Ctrl+Shift+R)。 |
|
|
150
|
+
|
|
151
|
+
## 7. 卸载
|
|
152
|
+
|
|
153
|
+
使用官方命令:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
dsh plugin --profile <profile> remove dsh-thinking-levels -w
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
确认组合配置不再包含该 bundle:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
dsh --profile <profile> --dump-default-config
|
|
163
|
+
```
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 drscrewdriver
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.ja.md
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# dsh-thinking-levels
|
|
2
|
+
|
|
3
|
+
**[DeepSeek Harness (dsh)](https://github.com/deepseek-ai/deepseek-harness) 向けのラウンド単位思考レベル(`reasoning_effort`)制御:セッションのモデルセレクターで `Auto`(マスク)を選ぶと、プラグインが直近のツール呼び出し履歴から `low` / `high` / `max` をスケジュールして API に提出します。あるいは `off` / `on` / `minimal` / `low` / `medium` / `high` / `xhigh` / `max` を手動で固定。軽いツールラウンドは軽いまま、重い作業も推論不足になりません。**
|
|
4
|
+
|
|
5
|
+
- [English README](./README.md)
|
|
6
|
+
- [中文 README](./README.zh.md)
|
|
7
|
+
- [日本語 README](./README.ja.md)
|
|
8
|
+
- [한국어 README](./README.ko.md)
|
|
9
|
+
- [インストールガイド](./INSTALL.ja.md)
|
|
10
|
+
- [English installation guide](./INSTALL.md)
|
|
11
|
+
- [中文安装指南](./INSTALL.zh.md)
|
|
12
|
+
- [한국어 설치 안내](./INSTALL.ko.md)
|
|
13
|
+
- [Changelog](./CHANGELOG.md)
|
|
14
|
+
- [日本語 changelog](./CHANGELOG.ja.md)
|
|
15
|
+
- [한국어 changelog](./CHANGELOG.ko.md)
|
|
16
|
+
|
|
17
|
+
> **互換性について:** `0.6.0` には日本語(`ja`)と韓国語(`ko`)の辞書と選択項目が含まれていますが、現在の公式 DSH は `LocaleRuntime` 経由で `zh` と `en` のみを提供しています。純正 DSH で `ja` または `ko` を選択すると `locale "<id>" is not registered` で失敗します。公式 DSH が対応 locale ID を追加するまで利用できません。上級ユーザーは DSH フォークを保守し、`packages/client/locale/src/locale-settings.ts` の `LOCALE_IDS` と `packages/client/locale/src/client/index.ts` の `LOCALES` ラベルを更新し、コア辞書とテストを追加して再ビルド・実行してください。このプラグインだけでは DSH のグローバル locale 一覧を拡張できません。
|
|
18
|
+
|
|
19
|
+
マルチステップのツールチェーンでは、モデルは**ツール呼び出しのたびに**再思考します——その思考がウォールクロック時間の大半を占めます(50 ステップのエージェントタスクはツール間に数分の推論を費やし得ます)。`dsh-thinking-levels` は、dsh が毎ステップ再解決する `agent/request` waterfall(`prepend` で最外層に登録し、セッションのモデル選択アセンブリに上書きされないようにする)に接続し、次のモデルリクエストに思考レベルを注入します。
|
|
20
|
+
|
|
21
|
+
## レベル
|
|
22
|
+
|
|
23
|
+
| レベル | 意味 | 場所 |
|
|
24
|
+
|---|---|---|
|
|
25
|
+
| `off` | 思考無効(手動のみ。自動スケジュールでは選択されません) | モデルセレクター / 既定レベル |
|
|
26
|
+
| `on` | 思考有効化(トグルのみのモデル向け):`enable_thinking` のみ送信し、think effort は送信しません | モデルセレクター / 既定レベル |
|
|
27
|
+
| `minimal` | 最小(非常に軽いタスク) | モデルセレクター / 既定レベル |
|
|
28
|
+
| `low` | シンプルなチャットタスク用の手動低レベル(軽いラウンドは軽いまま) | モデルセレクター / 既定レベル |
|
|
29
|
+
| `medium` | 中 | モデルセレクター / 既定レベル |
|
|
30
|
+
| `high` | 公式既定レベル | モデルセレクター / 既定レベル |
|
|
31
|
+
| `xhigh` | 特高 | モデルセレクター / 既定レベル |
|
|
32
|
+
| `max` | 重い作業 | モデルセレクター / 既定レベル |
|
|
33
|
+
| `auto` | **マスク**:直近のツール呼び出し履歴からステップごとにスケジュールし、提出前に具体レベルへ解決 | モデルセレクター(プラグインが注入)/ 既定レベル |
|
|
34
|
+
|
|
35
|
+
ワイヤーレベルの事実(公式 DeepSeek ドキュメントと dsh の `llm-deepseek` アダプターで確認):deepseek-v4-flash / v4-pro では `low` が 1:1 で有効、`medium` / `xhigh` は `high` に畳み込まれます。アダプターは `off | low | high | max` のみ受け付け、それ以外は `UNSUPPORTED_REASONING_EFFORT` で拒否します——`auto` はプラグインのマスク層で、API には送信されず、注入前に必ず具体的なワイヤーレベルへ解決されます。`on` は **effort レベルではありません**:トグルのみのモデル(Qwen3.6 形式)だけが広告し、`enable_thinking` を true にするだけ——`reasoning_effort` は送信されません。effort 対応モデルは `on` を広告しないため、手動で `on` を選んでも除去されます。
|
|
36
|
+
|
|
37
|
+
## カスタム送信値マッピング
|
|
38
|
+
|
|
39
|
+
`llm-pi-ai` で手動宣言したモデルでは、設定カードで各レベルをゲートウェイが実際に受け付ける値にマッピングできます(dsh-thinking-effort から借用):レベルにチェックを入れ、送信値を入力します(例:`high` → `ultra`)。マッピングはモデルの `reasoningEfforts` テーブルとして保存され、Composer で `High` を選ぶとゲートウェイには `ultra` が送信されます。`off` を空欄にすると送信されません。
|
|
40
|
+
|
|
41
|
+
- 公式プリセット:`Off / High / Max`(公式 DeepSeek 形式)
|
|
42
|
+
- 汎用プリセット:`Off / Low / Medium / High`
|
|
43
|
+
|
|
44
|
+
## モデル能力ガード(v0.5.0)
|
|
45
|
+
|
|
46
|
+
このプラグインは、推論能力を宣言していないモデルに `reasoning_effort` を**送信しません**。カスタム openai-completions ルート(例:`reasoningEfforts` のないローカル Qwen3.6)は `ctx.llm.resolveModelInfo` で非推論モデルと判定され、継承・スケジュールを問わずすべてのレベルは**除去**されて送信されません——dsh のリクエスト毎 `UNSUPPORTED_REASONING_EFFORT` 拒否は発生しません。サポートされないフィールドが API に渡されることはありません。
|
|
47
|
+
|
|
48
|
+
| dsh バージョン | `low` の扱い |
|
|
49
|
+
|---|---|
|
|
50
|
+
| rc.6(旧) | 非ネイティブ:`models` オーバーライドで確認された場合のみセレクターに表示。表示(セレクター + リクエスト検証)後にそのまま透過 |
|
|
51
|
+
| rc.7+(新) | ネイティブ:プラグインは書き換えも再注入もしません。手動 `low` はそのまま透過 |
|
|
52
|
+
|
|
53
|
+
auto スケジューラーは対応モデルで `low` を選ぶことがあります——上記の能力ガードが受け取れないモデルから遠ざけます。
|
|
54
|
+
|
|
55
|
+
## モデルセレクターの Auto
|
|
56
|
+
|
|
57
|
+
セッションのモデルセレクター(モデルの横)には、ワイヤーレベルの後に **Auto** が表示されます(プラグインがモデルディレクトリのメタデータに注入):
|
|
58
|
+
|
|
59
|
+
| セレクター選択 | 動作 |
|
|
60
|
+
|---|---|
|
|
61
|
+
| **Auto** | ツール履歴 + 昇降トグルでスケジュールし、提出前に `low` / `high` / `max` へ解決 |
|
|
62
|
+
| `off` / `on` / `minimal` / `low` / `medium` / `high` / `xhigh` / `max` | **手動選択が優先**——プラグインは介入しません(トグルのみのモデルでは `on` は `on` のまま。effort へ引き上げられず、effort 対応モデルでは除去されます) |
|
|
63
|
+
| 未選択 | プラグインの既定レベルが適用されます(下記) |
|
|
64
|
+
|
|
65
|
+
## 自動スケジューラー
|
|
66
|
+
|
|
67
|
+
ハブは `high`(公式既定)。`auto` は `low` / `high` / `max` の間でのみスケジュールし、`off` は選びません。
|
|
68
|
+
|
|
69
|
+
| 直近のツール呼び出し | レベル |
|
|
70
|
+
|---|---|
|
|
71
|
+
| なし(新しいプロンプト、純粋なチャット) | `low` |
|
|
72
|
+
| ≥75% がシンプルなツール・小さい引数・降格許可 | `low` |
|
|
73
|
+
| 混合 / 重いツール | `high` |
|
|
74
|
+
| 非常に重いペイロード・昇格許可 | `max` |
|
|
75
|
+
|
|
76
|
+
スケジュールポリシーは [dsh-tool-turbo](https://github.com/drscrewdriver/dsh-tool-turbo) と同源です(同じシンプルツールのホワイトリスト / ペイロード閾値 / 75% 比率ルール)。
|
|
77
|
+
|
|
78
|
+
## インストール
|
|
79
|
+
|
|
80
|
+
完全な手順(profile の確認、アップグレード、移行、検証、トラブルシューティング)は [INSTALL.ja.md](./INSTALL.ja.md) を参照してください。クイックスタート:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# 1. npm から profile へプラグインをインストール(例は web。任意の profile で可)
|
|
84
|
+
# (web profile は pnpm workspace root なので -w が必須)
|
|
85
|
+
dsh plugin --profile web add dsh-thinking-levels -w
|
|
86
|
+
# GitHub 版:
|
|
87
|
+
# dsh plugin --profile web add https://github.com/drscrewdriver/dsh-thinking-levels.git -w
|
|
88
|
+
# ローカルパス版(ネットワーク不要):
|
|
89
|
+
# dsh plugin --profile web add /absolute/path/to/dsh-thinking-levels
|
|
90
|
+
|
|
91
|
+
# 2. dsh web を再起動(実行中のインスタンスは新しい bundle 層をホットロードしない)
|
|
92
|
+
dsh web
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
> 注意:dsh ランタイムは pnpm 11 を使用し、新規公開バージョンは `minimumReleaseAge` のクーリング期間の対象です。`ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION` が発生したら、`~/.dsh/profiles/web/pnpm-workspace.yaml` の `minimumReleaseAgeExclude` にバージョンを追加してください。
|
|
96
|
+
|
|
97
|
+
手動 `link:` 登録(`dsh plugin add` の代替):
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# ~/.dsh/profiles/web/package.json dependencies:
|
|
101
|
+
# "dsh-thinking-levels": "link:<dsh-thinking-levels の絶対パス>"
|
|
102
|
+
# ~/.dsh/profiles/web/cordis.patch.yml:
|
|
103
|
+
# - insert:
|
|
104
|
+
# - id: thinking-levels
|
|
105
|
+
# name: dsh-thinking-levels
|
|
106
|
+
cd ~/.dsh/profiles/web && pnpm install && dsh web
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## 設定
|
|
110
|
+
|
|
111
|
+
2 つの面が同じスキーマを共有します:
|
|
112
|
+
|
|
113
|
+
- **アセンブリ** — profile 構成のプラグイン行の `config:`(例:`cordis.yml`):
|
|
114
|
+
```yaml
|
|
115
|
+
config:
|
|
116
|
+
level: auto # off | on | minimal | low | medium | high | xhigh | max | auto — セッションが何も選ばないときの既定レベル
|
|
117
|
+
allowDowngrade: true # スケジューラーが `high` より下へ下げるのを許可
|
|
118
|
+
allowUpgrade: false # スケジューラーが `max` へ上げるのを禁止
|
|
119
|
+
```
|
|
120
|
+
- **ランタイム** — dsh-settings 名前空間 `thinking-levels`(`level`、`allowDowngrade`、`allowUpgrade`、`enabled`、`models`):変更は次のモデルリクエストから有効、再起動不要。設定パネル(設定 → プラグイン → 設定可能なプラグイン)にビジュアルエディターがあります(レベルグリッド + 送信値入力 + 検索 + ワンクリックプリセット)。
|
|
121
|
+
|
|
122
|
+
モデル毎の能力オーバーライド(`models`、キーは `provider/model`)は自動検出の結果を確定します。構成者が最終判断します:
|
|
123
|
+
|
|
124
|
+
```yaml
|
|
125
|
+
config:
|
|
126
|
+
level: auto
|
|
127
|
+
models:
|
|
128
|
+
llm-pi-ai/Qwen3.6-35B-A3B: # 非 effort 思考モデル(思考トグル + budget)
|
|
129
|
+
vision: false
|
|
130
|
+
thinking: true
|
|
131
|
+
efforts: false # reasoning_effort を送信しない(リクエスト時に除去)
|
|
132
|
+
llm-pi-ai/Qwen3.8-27B: # effort 対応モデル(rc.6 時代のアダプターに low なし)
|
|
133
|
+
efforts: [low, high] # low を確認 → セレクター表示 + 透過
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
> Qwen の思考オン/オフ + budget は **llm-pi-ai** ルート側で設定します:
|
|
137
|
+
> `compat.thinkingFormat: qwen`(→ ワイヤー `enable_thinking` + `thinking_budget`、`thinkingBudgets` 経由)、または effort モデル(Qwen3.8-27B 等)では `qwen-chat-template`(→ `chat_template_kwargs.enable_thinking`)。
|
|
138
|
+
|
|
139
|
+
既定値:`{ enabled: true, level: 'auto', allowDowngrade: true, allowUpgrade: false, models: {} }`。
|
|
140
|
+
|
|
141
|
+
> 意味:モデルセレクターの選択はプラグインの既定レベルより優先されます。`auto`(マスク)→ プラグインがスケジュール。ワイヤーレベル → 直接適用。未選択 → プラグインの `level` 既定値。`allowDowngrade` / `allowUpgrade` は `auto` スケジュールのみを制約します。
|
|
142
|
+
|
|
143
|
+
## dsh-llm-openai-completions の自動引き継ぎ(v0.5.2)
|
|
144
|
+
|
|
145
|
+
カスタムゲートウェイ(vLLM / LM Studio / 自前の OpenAI 互換プロキシ)は、思考を宣言したら(`llm-pi-ai` のモデル行に `reasoningEfforts` テーブル)[dsh-llm-openai-completions](https://github.com/drscrewdriver/dsh-llm-openai-completions) がそのルートを引き継ぐ必要があります——そうしないと pi-ai が `role: "developer"`(400)を送信したり `enable_thinking` を落としたりします。このプラグインは引き継ぎリストを**自動保守**します:
|
|
146
|
+
|
|
147
|
+
- `llm-pi-ai.providers` をスキャンし、「カスタム openai-completions ゲートウェイ(`api: openai-completions` または非公式 baseURL)**かつ** いずれかのモデルが `reasoningEfforts` テーブルを宣言」する provider を特定;
|
|
148
|
+
- 自動的に `llm-openai-completions.providers` へマージし `enabled: true` に(手動追加分は保持、重複排除);
|
|
149
|
+
- トリガー:プラグイン起動、`llm/adapters-updated`、`llm-pi-ai` または引き継ぎリストの設定変更——手動編集不要;
|
|
150
|
+
- ソフト結合:`llm-openai-completions` 未インストール(名前空間未登録)なら書き込みをスキップし、他機能に影響しません。
|
|
151
|
+
|
|
152
|
+
## 依存関係
|
|
153
|
+
|
|
154
|
+
host 側は `@deepseek-ai/dsh-settings` に値依存しません(設定登録は cordis の `settings` サービス経由。dsh ランタイムが提供)。profile への公式パッケージ手動インストールは不要です。`dependencies` は `@deepseek-ai/schemastery` のみ(パッケージと一緒に自動インストール)。
|
|
155
|
+
|
|
156
|
+
## 開発
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
npm run lint # eslint(typescript-eslint flat config)
|
|
160
|
+
npm run typecheck # tsc --noEmit
|
|
161
|
+
npm test # vitest — 46 テスト
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
テストカバレッジ:レベルポリシー(手動透過・拡張レベル、`on` のクランプ、auto スケジューラー、検証、シンプルツール境界)、モデル能力ガード(`reasoningEffortSupported`、`resolveEffortInjection` の除去/透過)、セッションイベント解析(ガード、ウィンドウ上限、不正レコード)、設定スキーマ(既定値ロックステップ、越界拒否、`models` オーバーライド)、引き継ぎ同期(特定、重複排除マージ、ソフト結合)。
|
|
165
|
+
|
|
166
|
+
## ライセンス
|
|
167
|
+
|
|
168
|
+
MIT
|