dsh-toolfold 0.1.8 → 0.1.9
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 +30 -1
- package/README.en.md +9 -7
- package/README.md +9 -7
- package/lib/client.js +1954 -1921
- package/lib/index.js +265 -128
- package/package.json +13 -3
- package/lib/build-dynamic.cjs +0 -69
- package/lib/dynamic-body.js +0 -1814
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
所有显著变更将记录于此。版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
|
|
4
|
+
|
|
5
|
+
## [0.1.9] - 2026-09-05
|
|
6
|
+
|
|
7
|
+
> ⚠️ **版本支持**:本节改动将随 `0.1.9` 发布;自 `0.1.9` 起,本插件仅支持 DSH `>= 0.1.2-rc.1` 且 `< 0.1.3`(安装节有同样提示)。
|
|
8
|
+
|
|
9
|
+
### 缺陷修复
|
|
10
|
+
- **折叠条行距对齐官方**:`.ccxBar` 去掉上下 `3px` 透明内边距(`padding:0`)。条是无边框无背景元素,透明 padding 会被读成行间白边——实测每侧多出 3px(条↔行 30px、条↔条 33px,而官方行↔行字墨边距 27px = 流 `margin-top:16px` + 24px 行盒内字墨各 ~5.5px)。官方行本身零内边距,去掉后折叠条回到同一节奏。
|
|
11
|
+
- **思考行复活**:答案流进曾被清空隐藏的思考行时自动恢复可见,不再误判为空行。
|
|
12
|
+
- **关引擎保留卡片样式**:引擎规则与卡片 chrome 拆成两个 style 标签,停用折叠不再剥掉卡片外观。
|
|
13
|
+
- **压掉 16px 空带**:隐藏思考的 wrapper 一并折叠,回答上方不再留空。
|
|
14
|
+
|
|
15
|
+
### 功能变更
|
|
16
|
+
- **思考显示三档下拉**(自动跟随官方折叠 / 始终保留 / 始终隐藏,默认自动):原来自动开着时保留是个摆设,现在没有无效组合;老配置自动沿用,可回滚。设置卡与 README 已同步。
|
|
17
|
+
- **总开关**:一键停用/恢复全部折叠(关闭后聊天回到产品默认显示,卡片常驻随时可重开)。
|
|
18
|
+
- **跟随官方 Compact 折叠**:官方收起整块过程时思考自动保留可见(即下拉的默认档)。
|
|
19
|
+
- **版本不匹配警告**:运行的 DSH 超出支持范围时,设置卡显示 ⚠ 图标(hover 看详情)并打一条一次性 console 警告。
|
|
20
|
+
- **适配 DSH 0.1.2**:`settingsNamespace()` helper 被移除,改用裸字符串命名空间;新增 `engines.dsh` 下限,删除 `dsh-settings` peer 依赖。
|
|
21
|
+
|
|
22
|
+
### 工程变更
|
|
23
|
+
- **浏览器半模块化**:`lib/client.js`(约 2244 行单文件)与字符串手术生成的 `lib/dynamic-body.js` 重构为 `src/client/` 下的模块源(`settings` / `bridge` / `styles` / `engine` / `card` / `react-env` / `index`),由 tsdown 构建(`tsdown.config.mjs`,与 host 半共三个 entry):
|
|
24
|
+
- `lib/client.js(.map)` —— 安装通道 loader 产物(`window.__ModuleLoader__.load`,经 `exports["./client"]` 加载),行为与旧文件一致;
|
|
25
|
+
- `lib/dynamic-body.js(.map)` —— 动态通道 body(同一模块图去掉 loader 包装),供动态插件会话与 `tools/live-probe.mjs` 使用;
|
|
26
|
+
- React 不再静态导入:构建 wrapper 将通道提供的 React 种入 `globalThis.__dshToolfoldReact`(安装通道 `require('react')` / 动态通道闭包参数 `React`),无 React 的无头环境仅跳过设置卡片注册。
|
|
27
|
+
- **构建期产物**(删除旧生成器 `lib/build-dynamic.cjs`):`lib/client.js` / `lib/dynamic-body.js`(及 `.map`)已 gitignore,由 `prepare: pnpm build`(tsdown)重建——`pnpm publish` 与 git-hosted 安装都会先跑 prepare 再打包,`files` 白名单只含构建产物(`lib/index.js`、`lib/client.js`,不含 src / map)。`package.json` 增加 `prepare` / `build` / `build:watch` 脚本与 `tsdown` devDependency。改动流程:只改 `src/` → `pnpm build` → 验证。
|
|
28
|
+
- **host 半搬家**:`lib/index.js` → `src/host/index.js`(与 `src/client/` 对称;ESM,无需 scoped package.json),由 tsdown 第三个 entry(`platform: 'node'`,`schemastery` 保持 external)构建回 `lib/index.js`——`main` / `exports["."]` / `files` 指向不变。至此 `lib/` 下 100% 生成物,`.gitignore` 收成一行 `lib/`(源码层/产物层不再混放)。
|
|
29
|
+
- **工具去本机硬编码**:`jsdom`(29.1.1)与 `playwright`(1.61.1)收为 devDependencies,`tools/engine-smoke.mjs` / `tools/live-probe.mjs` 改按包名解析;live-probe 的 Chrome 路径改为 `CHROME_PATH` 环境变量优先,否则按平台取第一个存在的默认位置。`pnpm install` 后 `test:engine` / `probe:live` 开箱即用。
|
|
30
|
+
- **新增 `pnpm-lock.yaml`**:安装可重复。
|
|
31
|
+
- **发布管线**:Publish 前加 `pnpm install`;dry-run 校验 + `--provenance` OIDC 可信发布;发布条件收窄为仅 release 触发(取消手动发布);`engines.dsh` 上限收窄到 `<0.1.3`。
|
|
4
32
|
|
|
5
33
|
## [0.1.8] - 2026-08-28
|
|
6
34
|
|
|
@@ -64,6 +92,7 @@
|
|
|
64
92
|
- 首个可用版本:连续 `tool-call` 折叠为最后一条的单行摘要 + “已折叠 N 个工具调用”,支持 `durMs / keepThink / splitThink / stats` 四项设置(DSH `settings` 服务 → `~/.dsh/settings.yaml`,回退到 Host 路由与 `localStorage`)与瀑布动画。
|
|
65
93
|
- `toolfold` 远端包与一键安装、设置双半通信(Host `GET/POST /api/dsh-toolfold/settings` + Client 桥)。
|
|
66
94
|
|
|
95
|
+
[0.1.9]: https://github.com/Minecraftbe/dsh-toolfold/compare/v0.1.8...v0.1.9
|
|
67
96
|
[0.1.8]: https://github.com/Minecraftbe/dsh-toolfold/compare/v0.1.7...v0.1.8
|
|
68
97
|
[0.1.7]: https://github.com/Minecraftbe/dsh-toolfold/compare/v0.1.6...v0.1.7
|
|
69
98
|
[0.1.6]: https://github.com/Minecraftbe/dsh-toolfold/compare/v0.1.5...v0.1.6
|
package/README.en.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
English | [中文](README.md)
|
|
6
6
|
|
|
7
|
-
> A DSH Web GUI plugin that provides a **
|
|
7
|
+
> A DSH Web GUI plugin that provides a **simple tool call collapsing**: consecutive **tool calls** are collapsed into a single compact bar showing only a one‑line summary of the last call. Click to expand/collapse.
|
|
8
8
|
> It does not replace any built‑in renderer, and uninstallation restores the UI completely.
|
|
9
9
|
|
|
10
10
|

|
|
@@ -58,6 +58,8 @@ dsh plugin --profile web remove dsh-toolfold
|
|
|
58
58
|
|
|
59
59
|
After restart, the interface returns to its original state.
|
|
60
60
|
|
|
61
|
+
> ⚠️ **Version support**: starting from `0.1.9`, this plugin only supports DSH `>= 0.1.2-rc.1` and `< 0.1.3`. On DSH versions outside this range, the settings card shows a version-mismatch warning and folding may not work correctly.
|
|
62
|
+
|
|
61
63
|
---
|
|
62
64
|
|
|
63
65
|
## Quick Start
|
|
@@ -77,9 +79,9 @@ The plugin works immediately after installation, but you might notice two things
|
|
|
77
79
|
|
|
78
80
|
### ❓ Why did my thinking content disappear?
|
|
79
81
|
|
|
80
|
-
**Reason**: “
|
|
82
|
+
**Reason**: “Thinking display” defaults to “Auto-follow official fold” — completed thinking is hidden unless the official Compact view folds the whole process block.
|
|
81
83
|
|
|
82
|
-
**How to restore**: go to `Settings → Plugins → Tool Fold` and
|
|
84
|
+
**How to restore**: go to `Settings → Plugins → Tool Fold` and set **“Thinking display”** to **“Always keep”**.
|
|
83
85
|
|
|
84
86
|
### ❓ Why are my tool calls split into two separate fold bars?
|
|
85
87
|
|
|
@@ -97,7 +99,7 @@ The plugin works immediately after installation, but you might notice two things
|
|
|
97
99
|
|
|
98
100
|
- **Automatic folding of consecutive tool calls** – adjacent tool calls are collapsed into one bar, showing only the last call’s summary line and the number of folded items.
|
|
99
101
|
- **Thinking splits call groups (enabled by default)** – a completed thinking block separates the tool calls before and after it into two independent fold bars; they are never merged across a thinking block.
|
|
100
|
-
- **Thinking
|
|
102
|
+
- **Thinking display (three modes)** – “Auto-follow official fold” by default: thinking is kept when the official view folds the whole process block, hidden otherwise; “Always keep” shows it between fold bars (split mode) or interpolated back on expansion; “Always hide” never shows completed thinking.
|
|
101
103
|
- **Ongoing thinking always visible** – streaming thinking remains visible until it finishes, then follows the above rules.
|
|
102
104
|
|
|
103
105
|
### Animation & Experience
|
|
@@ -124,7 +126,7 @@ Settings are found at: **Settings → Plugins → Tool Fold** (the card looks li
|
|
|
124
126
|
| Option | Description |
|
|
125
127
|
| --- | --- |
|
|
126
128
|
| **Expand animation duration** | Duration of the expand/collapse animation per card (0–1000 ms, default 240 ms; 0 = instant) |
|
|
127
|
-
| **
|
|
129
|
+
| **Thinking display** | How completed thinking is shown: auto-follow official fold (default) / always keep / always hide |
|
|
128
130
|
| **Split thinking across call groups** | Enabled by default: a completed thinking block separates tool calls before and after it into independent fold bars. Disabled: thinking is folded together with the surrounding call group (legacy behaviour) |
|
|
129
131
|
| **Performance stats** | Show real‑time plugin timing in the card (cumulative count and ms/s for observation callbacks, engine refresh, merge recalculation, safe rescan, summary cloning, plus the number of streaming batches short‑circuited with zero overhead) |
|
|
130
132
|
|
|
@@ -139,7 +141,7 @@ Plugin settings are persisted automatically, with the following priority:
|
|
|
139
141
|
```yaml
|
|
140
142
|
toolfold:
|
|
141
143
|
durMs: 240 # expand animation duration 0–2000 ms
|
|
142
|
-
|
|
144
|
+
thinkMode: auto # completed-thinking display: auto-follow official fold / keep always / hide always
|
|
143
145
|
splitThink: true # whether to split call groups by thinking
|
|
144
146
|
stats: false # whether to enable performance stats
|
|
145
147
|
```
|
|
@@ -171,4 +173,4 @@ The settings card shows the current storage method (“Settings saved in DSH hos
|
|
|
171
173
|
|
|
172
174
|
---
|
|
173
175
|
|
|
174
|
-
> This project is entirely built with dsh + deepseek v4 flash(max).
|
|
176
|
+
> This project is entirely built with dsh + deepseek v4 flash(max).
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
中文 | [English](README.en.md)
|
|
6
6
|
|
|
7
|
-
> DSH Web GUI
|
|
7
|
+
> DSH Web GUI 插件,提供**简单的工具调用折叠体验**:把连续的**工具调用**折叠成一条简洁的折叠条,只展示最后一个调用的一行摘要,点击即可展开/收起。不替换任何内置渲染器,卸载后界面完全恢复原样。
|
|
8
8
|
|
|
9
9
|

|
|
10
10
|
|
|
@@ -57,6 +57,8 @@ dsh plugin --profile web remove dsh-toolfold
|
|
|
57
57
|
|
|
58
58
|
重启后界面完全恢复原样。
|
|
59
59
|
|
|
60
|
+
> ⚠️ **版本支持**:自 `0.1.9` 起,本插件仅支持 DSH `>= 0.1.2-rc.1` 且 `< 0.1.3`。在此范围之外的 DSH 上,设置卡片会显示版本不匹配警告,折叠功能可能无法正常工作。
|
|
61
|
+
|
|
60
62
|
---
|
|
61
63
|
|
|
62
64
|
## 快速上手
|
|
@@ -76,9 +78,9 @@ dsh plugin --profile web remove dsh-toolfold
|
|
|
76
78
|
|
|
77
79
|
### ❓ 思考内容怎么消失了?
|
|
78
80
|
|
|
79
|
-
|
|
81
|
+
**原因**:默认「思考显示」为「自动跟随官方折叠」——官方未收起整块过程时,已完成的思考默认隐藏以节省空间。
|
|
80
82
|
|
|
81
|
-
**改回**:`设置 → 插件 → 工具折叠` →
|
|
83
|
+
**改回**:`设置 → 插件 → 工具折叠` → 「思考显示」选「始终保留」。
|
|
82
84
|
|
|
83
85
|
### ❓ 工具调用为什么被切成了两段?
|
|
84
86
|
|
|
@@ -96,7 +98,7 @@ dsh plugin --profile web remove dsh-toolfold
|
|
|
96
98
|
|
|
97
99
|
- **连续工具调用自动折叠**:相邻工具调用整段收起,仅显示最后一个调用的摘要行,并标注折叠数量
|
|
98
100
|
- **思考分隔调用组(默认开启)**:已完成的思考会将前后两组工具调用**隔开、各自独立折叠**,不会跨思考合并
|
|
99
|
-
-
|
|
101
|
+
- **思考显示(三档)**:默认「自动跟随官方折叠」——官方收起整块过程时保留思考,其余时候隐藏;也可切「始终保留」(分隔模式下显示在两条折叠条之间,合并模式下展开时插回调用之间)或「始终隐藏」
|
|
100
102
|
- **进行中的思考独立显示**:流式思考始终保持可见,完成后按上述规则处理
|
|
101
103
|
|
|
102
104
|
### 动画与体验
|
|
@@ -123,7 +125,7 @@ dsh plugin --profile web remove dsh-toolfold
|
|
|
123
125
|
| 设置项 | 说明 |
|
|
124
126
|
| --- | --- |
|
|
125
127
|
| **展开动画时长** | 单张卡片的展开/收起动画时长(0–1000ms,默认 240ms;设为 0 为瞬时切换) |
|
|
126
|
-
|
|
|
128
|
+
| **思考显示** | 已完成思考的显示方式:自动跟随官方折叠(默认)/ 始终保留 / 始终隐藏 |
|
|
127
129
|
| **思考分隔调用组** | 开启(默认):已完成的思考把前后两组工具调用隔开、各自独立折叠;关闭:思考并入所在工具组一起折叠 |
|
|
128
130
|
| **性能统计** | 在卡片内实时显示插件自身耗时(观察回调/引擎刷新/合并重算/安全重扫/摘要克隆的累计次数与耗时,以及被零开销短路忽略的流式批次) |
|
|
129
131
|
|
|
@@ -138,7 +140,7 @@ dsh plugin --profile web remove dsh-toolfold
|
|
|
138
140
|
```yaml
|
|
139
141
|
toolfold:
|
|
140
142
|
durMs: 240 # 展开动画时长 0–2000ms
|
|
141
|
-
|
|
143
|
+
thinkMode: auto # 已完成思考的显示方式:auto 自动跟随官方折叠 / keep 始终保留 / hide 始终隐藏
|
|
142
144
|
splitThink: true # 是否让已完成的思考隔开前后两组工具调用
|
|
143
145
|
stats: false # 是否开启性能统计
|
|
144
146
|
```
|
|
@@ -170,4 +172,4 @@ dsh plugin --profile web remove dsh-toolfold
|
|
|
170
172
|
|
|
171
173
|
---
|
|
172
174
|
|
|
173
|
-
> 本项目完全由 dsh + deepseek v4 flash(max) 完成。
|
|
175
|
+
> 本项目完全由 dsh + deepseek v4 flash(max) 完成。
|