@megen-lebar/dsh-reasoning-effort 0.2.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/README.md +33 -0
- package/cordis.patch.yml +8 -0
- package/lib/client.js +1228 -0
- package/lib/index.js +565 -0
- package/lib/official-levels.json +8430 -0
- package/package.json +30 -0
- package/test/index.test.mjs +79 -0
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# @megen-lebar/dsh-reasoning-effort
|
|
2
|
+
|
|
3
|
+
DSH Web GUI「思考强度」配置器插件。在侧边栏新增「思考强度」入口,用可视化面板管理第三方 API 各模型的 reasoning effort,无需手写 YAML。
|
|
4
|
+
|
|
5
|
+
## 功能
|
|
6
|
+
|
|
7
|
+
- 列出 `settings.yaml` 里 `llm-pi-ai.providers.*` 已配置的 provider 与模型。
|
|
8
|
+
- 选定模型后自动带出该模型的**官方思考档位**。插件优先读取当前 DSH 运行时的 pi-ai 目录,内置快照只作离线兜底,因此 Moonshot/Kimi 等官方模型会随运行时同步。
|
|
9
|
+
- 对官方 provider 可直接浏览完整模型目录;对自定义 provider 采用 provider + 模型 ID 匹配,避免同名模型串档。
|
|
10
|
+
- 两级交互流程:先选 Provider 与模型,再编辑思考档位;支持搜索、同步官方档位、全部关闭和恢复当前配置。
|
|
11
|
+
- 可为每档勾选启用并自定义「线上拼写」,并设置 provider 级默认思考强度、`compat.thinkingFormat` 与 `supportsReasoningEffort`。
|
|
12
|
+
- 模型级「关闭推理」开关:保存 `reasoningEfforts: false` 后,DSH 不再把该模型视为可配置推理模型;当前对话的推理等级入口会同步隐藏,不会改动同一 Provider 的默认强度或协议设置。
|
|
13
|
+
- 面板会显示当前对话的 Provider / 模型并高亮对应条目,避免在同名模型的其他 Provider 上误改配置。
|
|
14
|
+
- 保存过程有明确的进行中、成功和错误反馈;写入 DSH settings 命名空间 `llm-pi-ai` 后,下一轮对话生效,无需重启。
|
|
15
|
+
|
|
16
|
+
## 安装(本地 link,与 dsh-archive-panel 同模式)
|
|
17
|
+
|
|
18
|
+
1. 在 `~/.dsh/profiles/web/package.json` 的 `dependencies` 增加
|
|
19
|
+
`"@megen-lebar/dsh-reasoning-effort": "link:<本包绝对路径>"`,
|
|
20
|
+
并在 `dsh.profile.bundles` 追加 `"@megen-lebar/dsh-reasoning-effort"`。
|
|
21
|
+
2. 重启 `dsh web`。
|
|
22
|
+
3. 打开 `http://127.0.0.1:45723`,侧边栏出现「思考强度」入口。
|
|
23
|
+
|
|
24
|
+
## 目录结构
|
|
25
|
+
|
|
26
|
+
- `lib/index.js` — host 半面:`/api/dsh-reasoning/*` 路由,读写 `llm-pi-ai` settings 命名空间 + 官方档位目录。
|
|
27
|
+
- `lib/client.js` — 浏览器半面:侧边栏入口 + 可视化面板(纯 DOM)。
|
|
28
|
+
- `cordis.patch.yml` — bundle patch:把插件 row 注入 web profile roster。
|
|
29
|
+
|
|
30
|
+
## 说明
|
|
31
|
+
|
|
32
|
+
- 插件只负责「思考强度」配置;API key / baseURL / 模型列表仍在官方 Models 页配置。
|
|
33
|
+
- 官方档位优先来自当前 DSH 安装的 pi-ai 目录;运行时目录不可用时自动使用插件自带快照,不影响自定义档位的读写。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# dsh-reasoning-effort bundle patch: inserts the dual-face plugin row into the
|
|
2
|
+
# web profile roster. The node half (exports ".") mounts the config engine and
|
|
3
|
+
# /api/dsh-reasoning routes in the host process; the `dsh.client` declaration
|
|
4
|
+
# in package.json makes the browser half (exports "./client") load in the web
|
|
5
|
+
# GUI (sidebar entry + panel).
|
|
6
|
+
- insert:
|
|
7
|
+
- id: reasoning-effort
|
|
8
|
+
name: '@megen-lebar/dsh-reasoning-effort'
|