@wangxiaocuo/dsh-session-trash 0.6.0 → 0.6.2
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.en.md +14 -11
- package/README.md +14 -11
- package/client.js +258 -75
- package/lib/concurrency.js +30 -0
- package/lib/inventory.js +58 -25
- package/lib/state.js +1 -21
- package/lib/trash-service.js +241 -88
- package/package.json +8 -3
package/README.en.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
A session trash for DeepSeek Harness. Move cold sessions out of the sidebar without deleting their logs, restore them within the retention window, or delete the logs permanently. Built for DSH 0.2.2-rc.1 on Desktop and Web. Host and Client ship in one package, with no build step.
|
|
8
8
|
|
|
9
|
-
Status: feature complete
|
|
9
|
+
Status: feature complete. CI (GitHub Actions) runs the unit and Host smoke tests on Ubuntu (Node 20/22) and Windows (Node 22); macOS has run the end-to-end suite against a real DSH Host. The Windows and Linux DSH Hosts have not been verified manually yet, and Windows skips the cases that rely on POSIX permission bits.
|
|
10
10
|
|
|
11
11
|
## Features
|
|
12
12
|
|
|
@@ -167,7 +167,7 @@ The index schema is v2; a v1 index is upgraded automatically on startup and pres
|
|
|
167
167
|
- Permanent deletion removes the session log only. Attachments, images, projection-cache rows, and search-index rows are not deleted.
|
|
168
168
|
- `/state` returns all entry summaries in one response. Search, filtering, and paging happen in the Client.
|
|
169
169
|
- There is no cross-window live push. Another window's change appears after a refresh or when the window regains focus.
|
|
170
|
-
- Windows and Linux have not been
|
|
170
|
+
- The Windows and Linux DSH Hosts have not been verified manually; CI covers unit and Host smoke tests only. On Windows, cases that rely on POSIX permission bits are skipped, and long paths over 260 characters / symlink copying depend on system configuration (the related tests skip themselves when unsupported).
|
|
171
171
|
- macOS path comparison is case-insensitive. On a case-sensitive APFS volume, paths that differ only by case are treated as the same location.
|
|
172
172
|
- Multiple DSH processes sharing one `DSH_HOME` serialize trash operations through `.lock`. A process paused for more than 10 minutes can lose the lock to another process.
|
|
173
173
|
|
|
@@ -175,19 +175,22 @@ The index schema is v2; a v1 index is upgraded automatically on startup and pres
|
|
|
175
175
|
|
|
176
176
|
```bash
|
|
177
177
|
pnpm install
|
|
178
|
-
pnpm test
|
|
179
|
-
|
|
178
|
+
pnpm test # unit tests
|
|
179
|
+
pnpm test:smoke # Host smoke test (real Cordis, plain Node)
|
|
180
|
+
npm run test:e2e # real dsh web end-to-end (needs the desktop app)
|
|
180
181
|
```
|
|
181
182
|
|
|
182
|
-
|
|
183
|
+
The Host smoke test wires the plugin into a real Cordis context through the `@deepseek-ai/cordis` devDependency, creates its own temporary `DSH_HOME`, and removes it afterwards; it does not need the desktop app. Set `DSH_SMOKE_KEEP=1` to keep the temporary home for debugging. `pnpm test` enumerates the test files through `test/run-unit.mjs`, so it does not depend on shell glob expansion and behaves the same on Windows and POSIX shells.
|
|
183
184
|
|
|
184
|
-
|
|
185
|
+
What CI verifies:
|
|
185
186
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
187
|
+
| Check | Verified environment |
|
|
188
|
+
|---|---|
|
|
189
|
+
| Unit tests, Host smoke test | CI: Ubuntu Node 20/22, Windows Node 22 |
|
|
190
|
+
| Package contents (`npm pack`) | CI: Ubuntu |
|
|
191
|
+
| Real `dsh web` end to end | macOS + DSH 0.2.2-rc.1 (run manually) |
|
|
192
|
+
|
|
193
|
+
`npm run test:e2e` boots a real `dsh web` Host in a temporary `DSH_HOME` and runs the full flow. It discovers the desktop app in the platform's usual install locations, or uses `DSH_ELECTRON`; when no desktop app is found it prints a skip message and exits 0. The cleanup-failure scenario that relies on POSIX permission bits is skipped on Windows. Set `DSH_E2E_KEEP=1` to keep the temporary home and logs.
|
|
191
194
|
|
|
192
195
|
Project layout:
|
|
193
196
|
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
DeepSeek Harness 的会话回收站插件。冷会话可以从侧边栏移出,日志保留在本地;保留期内可以恢复,到期后自动删除日志。面向 DSH 0.2.2-rc.1 的 Desktop 和 Web,Host 和 Client 在同一个包里,不需要构建步骤。
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
当前状态:功能已实现。CI(GitHub Actions)在 Ubuntu(Node 20/22)和 Windows(Node 22)上跑单元测试与 Host 冒烟测试;macOS 已在真实 DSH Host 上跑通端到端测试。Windows 和 Linux 的真实 DSH Host 尚未手动验证;Windows 上依赖 POSIX 权限位的用例会显式跳过。
|
|
10
10
|
|
|
11
11
|
## 功能
|
|
12
12
|
|
|
@@ -166,7 +166,7 @@ npm 安装的插件在「插件」页打开「会话回收站」的详情,展
|
|
|
166
166
|
- 永久删除只删除会话日志。附件、图片、投影缓存和搜索索引不会被删除。
|
|
167
167
|
- `/state` 一次返回全部条目摘要,页面在客户端搜索、筛选和分页。
|
|
168
168
|
- 没有跨窗口实时推送。另一个窗口的变更要等刷新或窗口重新获得焦点后出现。
|
|
169
|
-
- Windows 和 Linux
|
|
169
|
+
- Windows 和 Linux 的真实 DSH Host 尚未手动验证;CI 只覆盖单元测试和 Host 冒烟测试。Windows 上依赖 POSIX 权限位的用例会跳过;超过 260 字符的长路径和符号链接复制受系统设置影响,对应用例在不支持时自动跳过。
|
|
170
170
|
- macOS 的路径比较按大小写不敏感处理。在大小写敏感的 APFS 卷上,仅大小写不同的两个路径会被视为同一位置。
|
|
171
171
|
- 多个 DSH 进程共享同一个 `DSH_HOME` 时,回收站操作通过 `.lock` 串行;进程暂停超过 10 分钟后,锁可能被另一个进程接管。
|
|
172
172
|
|
|
@@ -174,19 +174,22 @@ npm 安装的插件在「插件」页打开「会话回收站」的详情,展
|
|
|
174
174
|
|
|
175
175
|
```bash
|
|
176
176
|
pnpm install
|
|
177
|
-
pnpm test
|
|
178
|
-
|
|
177
|
+
pnpm test # 单元测试
|
|
178
|
+
pnpm test:smoke # Host 冒烟测试(真实 Cordis,普通 Node 即可)
|
|
179
|
+
npm run test:e2e # 真实 dsh web 端到端(需要本机桌面版)
|
|
179
180
|
```
|
|
180
181
|
|
|
181
|
-
|
|
182
|
+
Host 冒烟测试通过 `@deepseek-ai/cordis` 这个 devDependency 装配真实插件上下文,自己创建并清理临时 `DSH_HOME`,不需要桌面版;设置 `DSH_SMOKE_KEEP=1` 可以保留临时目录用于排查。`pnpm test` 通过 `test/run-unit.mjs` 枚举测试文件,不依赖 shell 展开 glob,Windows 和 POSIX shell 行为一致。
|
|
182
183
|
|
|
183
|
-
|
|
184
|
+
验证范围:
|
|
184
185
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
186
|
+
| 检查 | 已验证环境 |
|
|
187
|
+
|---|---|
|
|
188
|
+
| 单元测试、Host 冒烟测试 | CI:Ubuntu Node 20/22、Windows Node 22 |
|
|
189
|
+
| 打包内容(`npm pack`) | CI:Ubuntu |
|
|
190
|
+
| 真实 `dsh web` 端到端 | macOS + DSH 0.2.2-rc.1(手动执行) |
|
|
191
|
+
|
|
192
|
+
`npm run test:e2e` 会启动真实 `dsh web` Host,在临时 `DSH_HOME` 中跑完整流程。脚本会按平台在常见安装位置查找桌面版,也可以用 `DSH_ELECTRON` 指向其他 Electron 可执行文件;找不到桌面版时打印跳过信息并以 0 退出。依赖 POSIX 权限位的「清理失败」场景在 Windows 上会跳过。设置 `DSH_E2E_KEEP=1` 可以保留临时目录和日志。
|
|
190
193
|
|
|
191
194
|
项目结构:
|
|
192
195
|
|