dsh-sidebar-suite 0.2.7 → 0.2.8
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 +13 -1
- package/DETAIL.md +4 -2
- package/README.md +24 -4
- package/lib/client.js +2505 -2288
- package/lib/temp-session-host.mjs +918 -842
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +3 -3
- package/temp-session-config.txt +3 -3
- package//344/275/277/347/224/250/350/257/264/346/230/216.md +43 -21
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
# 更新日志 / Changelog
|
|
2
2
|
|
|
3
|
-
> 版本号以 npm registry **实际发布记录**为准(当前:`0.0.0-stage`、`0.1.3`、`0.2.4`、`0.2.5`、`0.2.6`、`0.2.7`)。
|
|
3
|
+
> 版本号以 npm registry **实际发布记录**为准(当前:`0.0.0-stage`、`0.1.3`、`0.2.4`、`0.2.5`、`0.2.6`、`0.2.7`、`0.2.8`)。
|
|
4
4
|
> `0.2.0`、`0.2.1`、`0.2.2`、`0.2.3` 是开发过程中的本地迭代号,**从未单独发布**;它们的功能一次性随 `0.2.4` 上线,所以在下面合并记录。
|
|
5
5
|
>
|
|
6
6
|
> Versions mirror the npm registry. `0.2.0`–`0.2.3` were local iteration numbers that were never published on their own; all of their features shipped together in `0.2.4`.
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## 0.2.8 — 设置全图形化 + 配置热重载 / Graphical settings & hot reload(2026-11-11)
|
|
11
|
+
|
|
12
|
+
**这次改了运行时代码**(`lib/client.js`、`lib/temp-session-host.mjs`),所以**升级后要托盘退出 DSH 再重开一次**;但从此以后改任何设置都不用再重启。
|
|
13
|
+
|
|
14
|
+
- **8 项设置全部有开关** — 详情页新增「侧栏与临时会话」卡:`SHOW_TEMP_BUTTON`、`TEMP_IN_CHAT_MODE`、`TEMP_BUTTON_STYLE`、`EXPAND_ALL_SESSIONS`、`MAX_KEPT` 做成开关 / 选项按钮 / 数字框;原有的 `DELETE_ON_EXIT`、`SCHEDULE_DELETE`、`SCHEDULE_TIME` 保持。另加「立即清理临时会话」按钮,直连已有的 `purge` 路由。Every config key now has a control; a manual purge button was added.
|
|
15
|
+
- **改文件免重启** — Host 半在 `status` / `config` / `probe` 请求时用 `mtime + size` 感知 `temp-session-config.txt` 的外部改动,重解析、重排定时清理计划、递增 `configRevision`;Client 半每 2.5–3 秒轮询,版本变化才原地重应用(按钮显隐、摆法、CHAT 兼容、会话全展开)。约 3 秒生效。No `fs.watch`: editors save by rename and a watcher would keep the host alive.
|
|
16
|
+
- **不再覆盖手改** — `saveConfig()` 写盘前先重新读文件,UI 改一项不会把用户刚在记事本里改的其它项冲掉(新增回归断言)。
|
|
17
|
+
- **文档口径统一** — 配置文件头、`README.md`、`DETAIL.md`、`使用说明.md`、locale 简介里所有「改文件必须彻底退出重开」的旧说明全部改为「约 3 秒自动生效,不用重启」;只有**升级插件包本身**和改 `cordis.patch.yml` 仍需重启。配置文件头仍保持 3 行,所以文档里的行号全部继续有效。
|
|
18
|
+
- **测试** — 新增 `tests/test_028.mjs`(真实 Host 半的热重载 / 防覆盖 / 路由 / 源码契约),`tests/test_023.mjs` 追加 0.2.8 详情页渲染与点击断言;`npm test` 链扩为 6 套。
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
10
22
|
## 0.2.7 — 下载数据可见 / Download counts made visible(2026-11-10)
|
|
11
23
|
|
|
12
24
|
**纯文档改动**:`lib/` 三份脚本、`locale/` 与 0.2.6 逐字一致,没有运行时变化。Docs only, no runtime changes.
|
package/DETAIL.md
CHANGED
|
@@ -88,7 +88,7 @@ dsh plugin --profile desktop add dsh-sidebar-suite
|
|
|
88
88
|
本地开发可把包名换成本目录路径或 `.tgz` 安装包。已在 **DSH 0.2.2-rc.1(desktop profile)** 验证。
|
|
89
89
|
For local development, point the same command at this folder or a packed `.tgz`. Tested on **DSH 0.2.2-rc.1 (desktop profile)**.
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
**升级插件包后仍需重启 / Upgrading the plugin package still needs a restart** — 安装新版或改 `lib/` 下的代码后,请完全退出并重新打开 DSH(客户端代码不热重载)。**但改配置不用重启**:0.2.8 起 `temp-session-config.txt` 的改动、以及详情页的任何开关,都在约 3 秒内原地生效。 / Config edits are the exception: from 0.2.8 they hot-reload in place within seconds.
|
|
92
92
|
|
|
93
93
|
> 组合包自带的 `cordis.patch.yml` 会自动挂载,不要再往 profile 的 `cordis.patch.yml` 里加同名行,否则会加载两次。
|
|
94
94
|
> The bundle patch mounts the plugin automatically; do not add a manual mount line or it loads twice.
|
|
@@ -116,10 +116,12 @@ For local development, point the same command at this folder or a packed `.tgz`.
|
|
|
116
116
|
|
|
117
117
|
**为什么删除是安全的**:`dsh-session-query-sqlite` 的 `_reconcile()` 会拿「磁盘上实际存在的会话」和索引行对比,多出来的行直接 `persistentDeletes`,因此删目录之后搜索索引会自愈,不会留下点不开的幽灵会话。
|
|
118
118
|
|
|
119
|
-
配置:`SHOW_TEMP_BUTTON` / `TEMP_IN_CHAT_MODE` / `TEMP_BUTTON_STYLE` / `DELETE_ON_EXIT` / `SCHEDULE_DELETE` / `SCHEDULE_TIME` / `MAX_KEPT
|
|
119
|
+
配置:`SHOW_TEMP_BUTTON` / `TEMP_IN_CHAT_MODE` / `TEMP_BUTTON_STYLE` / `EXPAND_ALL_SESSIONS` / `DELETE_ON_EXIT` / `SCHEDULE_DELETE` / `SCHEDULE_TIME` / `MAX_KEPT` —— **全部 8 项都能在详情页设**,用记事本改等号右边也行,保存后约 3 秒自动生效,不用重启。
|
|
120
120
|
|
|
121
121
|
**详情页设置(0.2.2)**:插件详情页顶部卡片新增「临时会话自动删除」区块 —— 「退出 DSH 时删除」和「每天定时清理 + 时间」两个独立开关。它不走 `configForms`,而是 `GET/POST /api/dsh-temp-session.config` 交给 Host 半执行,因为**只有一个数据源**:`temp-session-config.txt`。Host 半按行替换(`KEY=value` 只换 `= ` 右边),注释、空行、键顺序原样保留,用户手写的内容不会丢;缺失的键追加到末尾。保存后立即 `restartScheduler()`,无需重启。
|
|
122
122
|
|
|
123
|
+
**全部设置图形化 + 热重载(0.2.8)**:详情页新增「侧栏与临时会话」卡,把剩下的 5 个键也做成开关 / 选项按钮 / 数字框,并加了一个「立即清理临时会话」按钮。至此 `temp-session-config.txt` 里**没有任何一项**需要用户手改文本。Host 半在每次 `status` / `config` / `probe` 请求时比对文件的 `mtime + size`,变化就重解析、重排定时清理计划、递增 `configRevision`;Client 半每 2.5–3 秒轮询一次,只在版本变化时原地重应用(按钮显隐、按钮摆法、CHAT 兼容策略、会话全展开)。`saveConfig()` 写盘前也会先重新读文件,避免 UI 的一次保存覆盖掉用户刚刚手改的其它行。不用 `fs.watch`,因为编辑器保存通常是「写临时文件再改名」,且监听器会拖住宿主进程。 / Every remaining key now has a control; a stamp-based reload makes both the switches and Notepad edits live within seconds, with no restart and no lost hand edits.
|
|
124
|
+
|
|
123
125
|
**定时清理(0.2.2)的实现要点**:
|
|
124
126
|
|
|
125
127
|
- 调度器是 `setInterval(30s)` + `computeNextRun(HH:MM)`,`timer.unref()` 保证它不会把宿主进程吊住;每次 apply/保存都先 `stopScheduler()` 再重建,避免重载后出现两个定时器。
|
package/README.md
CHANGED
|
@@ -131,7 +131,7 @@ This bundle deliberately omits `engines.dsh`: DSH is currently a prerelease, and
|
|
|
131
131
|
组合包 patch 会自动挂载,**不要**再往 profile 的 `cordis.patch.yml` 加同名行,否则加载两次。
|
|
132
132
|
The bundle patch mounts the plugin; do not also add a manual mount line.
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
升级插件包后请完全退出并重新打开 DSH(客户端代码不热重载);但 0.2.8 起**改配置文件或在详情页改设置都不用重启**,约 3 秒自动生效。
|
|
135
135
|
The client half is not hot-reloaded — fully quit and reopen DSH after installing or editing files.
|
|
136
136
|
|
|
137
137
|
## 已知限制 / Known limits
|
|
@@ -146,11 +146,11 @@ DSH 自己的会话列表每个工作区只先显示 5 条,剩下的折叠成
|
|
|
146
146
|
|
|
147
147
|
- 每次侧栏刷新都把每个工作区的会话**全部展开**:按宿主自己的按钮走,不改宿主 DOM。
|
|
148
148
|
- 「展开其余 N 个会话」/「收起」按钮**整块隐藏**。
|
|
149
|
-
- 想恢复 DSH
|
|
149
|
+
- 想恢复 DSH 原来的折叠:在详情页关掉「会话默认全展开」开关即可;或把 `temp-session-config.txt` 的 **`EXPAND_ALL_SESSIONS=on` 改成 `off`**,保存后约 3 秒生效(已展开的列表要切换一次工作区才会收回去)。
|
|
150
150
|
|
|
151
151
|
依据(在 `app.asar` 里逐字核对过 `@deepseek-ai/dsh-client-ui-workspace/lib/client.js`):文案 `sessions.expand` = `展开其余 {n} 个会话`,按钮是 `<button data-row-key="overflow:<group>">`,点一次把该组水位线抬高 5 条,全部显示后 `aria-expanded` 变为 `true` 且文案变成「收起」。
|
|
152
152
|
|
|
153
|
-
> The host folds session lists after five rows. This plugin presses the host's own overflow button until nothing is hidden, then hides that control entirely.
|
|
153
|
+
> The host folds session lists after five rows. This plugin presses the host's own overflow button until nothing is hidden, then hides that control entirely. Use the detail-page switch (or set `EXPAND_ALL_SESSIONS=off` in `temp-session-config.txt`) to restore DSH's folding. Both hot-reload in seconds, no restart.
|
|
154
154
|
|
|
155
155
|
## 临时会话 / Temporary session(0.2.0)
|
|
156
156
|
|
|
@@ -182,9 +182,29 @@ DSH **没有公开的「删除会话」接口**(我核对过 `app.asar`:`ses
|
|
|
182
182
|
|
|
183
183
|
**正在使用的会话不会被误删**:定时清理会跳过最近 3 分钟内有写入的会话(打开着的会话一直在写转写文件),5 分钟后再试一次。退出时的删除不受这个保护影响 —— 退出本来就是你要求清理。
|
|
184
184
|
|
|
185
|
+
### 全部设置图形化 + 配置热重载(0.2.8)
|
|
186
|
+
|
|
187
|
+
详情页最上面那张卡现在能改**全部 8 项**配置,不用再碰文本:
|
|
188
|
+
|
|
189
|
+
| 设置 | 对应键 |
|
|
190
|
+
| --- | --- |
|
|
191
|
+
| 显示「临时」按钮 | `SHOW_TEMP_BUTTON` |
|
|
192
|
+
| CHAT 官网模式:隐藏 / 显示 | `TEMP_IN_CHAT_MODE` |
|
|
193
|
+
| 按钮摆法:并排 / 独占一行 | `TEMP_BUTTON_STYLE` |
|
|
194
|
+
| 会话默认全展开 | `EXPAND_ALL_SESSIONS` |
|
|
195
|
+
| 退出 DSH 时删除 | `DELETE_ON_EXIT` |
|
|
196
|
+
| 每天定时清理 + 时间 | `SCHEDULE_DELETE` / `SCHEDULE_TIME` |
|
|
197
|
+
| 最多保留几个 | `MAX_KEPT` |
|
|
198
|
+
| 立即清理临时会话 | 手动触发 `purge` |
|
|
199
|
+
|
|
200
|
+
两条路写的是同一个文件:详情页开关按行替换(注释、空行、顺序原样保留),Host 半用 `mtime + size` 感知外部改动并递增 `configRevision`;客户端每 2.5–3 秒轮询一次,看到新版本就原地重应用。所以**记事本改完保存,约 3 秒自动生效,不用重启 DSH**;反过来 UI 保存前也会先重新读文件,不会把刚手改的其它行覆盖掉。卡片底部会显示当前的「设置版本」号,方便确认有没有生效。
|
|
201
|
+
|
|
202
|
+
> 仍然需要重启的只有一件事:**升级插件包本身**(`lib/` 里的客户端代码不会热重载)。
|
|
203
|
+
> The only thing that still needs a restart is upgrading the plugin package itself.
|
|
204
|
+
|
|
185
205
|
### 配置(记事本可改)
|
|
186
206
|
|
|
187
|
-
`temp-session-config.txt
|
|
207
|
+
`temp-session-config.txt`,只改等号右边,保存后**约 3 秒自动生效,不用重启**;详情页的开关写的是同一个文件。
|
|
188
208
|
|
|
189
209
|
| 键 | 默认 | 作用 |
|
|
190
210
|
| --- | --- | --- |
|