@kangyishuai/dsh-session-delete 0.4.8 → 0.5.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 CHANGED
@@ -8,10 +8,10 @@
8
8
 
9
9
  Unofficial plugin for [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness). Not affiliated with DeepSeek.
10
10
 
11
- > **Status: early.** Verified on the current target DSH version with `pnpm smoke:session-delete` (24 end-to-end assertions on a throwaway DSH home) and `pnpm probe:runtime`; the desktop read-only pass was done on an earlier version. The [Compatibility](#compatibility--degradation) table records exactly what was run. `pnpm gate session-delete` runs the whole release gate in one command. Treat it as young software and keep backups of anything you cannot lose.
11
+ > **Status: early.** Verified on the current target DSH version with `pnpm smoke:session-delete` (32 end-to-end assertions on a throwaway DSH home) and `pnpm probe:runtime`; the desktop read-only pass was done on an earlier version. The [Compatibility](#compatibility--degradation) table records exactly what was run. `pnpm gate session-delete` runs the whole release gate in one command. Treat it as young software and keep backups of anything you cannot lose.
12
12
 
13
13
 
14
- ![Delete confirmation with the plan: size, sub-sessions, references to clean](https://raw.githubusercontent.com/kangyishuai/dsh-plugins/main/packages/session-delete/docs/images/overview.png)
14
+ ![Delete confirmation: one line of impact, an opt-in cascade checkbox, and a Details disclosure](https://raw.githubusercontent.com/kangyishuai/dsh-plugins/main/packages/session-delete/docs/images/overview.png)
15
15
 
16
16
  ## What it does
17
17
 
@@ -20,16 +20,18 @@ DSH's built-in _archive_ only hides a session: the id goes into the workspace's
20
20
  - **Real deletion.** The session directory is moved out of `~/.dsh/sessions/`, and the bookkeeping that still points at it (archived set, pinned set, workspace membership, projection cache) is cleaned up — so the session doesn't come back and doesn't leave a ghost entry behind.
21
21
  - **Trash by default.** The first click erases nothing: the session goes to `~/.dsh/session-trash/` and can be restored. Permanent deletion is a separate, explicit action.
22
22
  - **Plan before you delete (dry-run).** The confirmation dialog is generated from a plan: on-disk size, whether the session is live, how many sub-sessions it has, and which references will be cleaned. Right before execution the plan is recomputed and compared with what you confirmed; a mismatch aborts the operation instead of deleting something you didn't see.
23
- - **Audit log.** Every delete / restore / purge appends one JSON line to `~/.dsh/session-trash/audit.log`, readable from the trash panel.
24
- - **Receipt after delete.** After the move, the plugin checks the places a session can be referenced and reports anything left behind (deletion is one session at a time; the trash tab supports batch restore / batch permanent delete).
23
+ - **Audit log.** Every delete / restore / purge appends one JSON line to `~/.dsh/session-trash/audit.log`, readable from **Settings → Session trash**.
24
+ - **Receipt after delete.** After the move, the plugin checks the places a session can be referenced and reports anything left behind (deletion is one session at a time; the trash list supports batch restore / batch permanent delete).
25
+ - **Keyboard + workspace batch.** `⌘⌥⌫` (rebindable in Settings → General → Shortcuts) opens the same confirmation for the current session, and the workspace `…` menu gains **Delete all sessions in this workspace…**, which previews the whole group and deletes it session by session.
26
+ - **Quiet UI.** One dialog line tells you what will happen (size · sub-sessions · live), the technical detail hides under **Details**, the trash panel is a single page, and maintenance (health check, audit log, receipts) moved to its own settings section. Child-session handling remembers your last choice, stored host-side in `~/.dsh/session-trash/preferences.json`.
25
27
 
26
28
  ## Screenshots
27
29
 
28
- | Plan before delete | Trash | Audit log | Receipts |
29
- | -------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
30
- | ![Plan before delete](https://raw.githubusercontent.com/kangyishuai/dsh-plugins/main/packages/session-delete/docs/images/confirm-dialog.png) | ![Trash](https://raw.githubusercontent.com/kangyishuai/dsh-plugins/main/packages/session-delete/docs/images/trash-panel.png) | ![Audit log](https://raw.githubusercontent.com/kangyishuai/dsh-plugins/main/packages/session-delete/docs/images/audit-tab.png) | ![Receipts](https://raw.githubusercontent.com/kangyishuai/dsh-plugins/main/packages/session-delete/docs/images/receipts-tab.png) |
30
+ | Delete confirmation | Workspace batch | Trash | Settings → Session trash |
31
+ | --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
32
+ | ![Delete confirmation](https://raw.githubusercontent.com/kangyishuai/dsh-plugins/main/packages/session-delete/docs/images/confirm-dialog.png) | ![Workspace batch](https://raw.githubusercontent.com/kangyishuai/dsh-plugins/main/packages/session-delete/docs/images/workspace-batch.png) | ![Trash](https://raw.githubusercontent.com/kangyishuai/dsh-plugins/main/packages/session-delete/docs/images/trash-panel.png) | ![Settings section](https://raw.githubusercontent.com/kangyishuai/dsh-plugins/main/packages/session-delete/docs/images/settings-section.png) |
31
33
 
32
- <sub>Screenshots come from <code>SMOKE_DEMO=1 pnpm smoke:session-delete</code>: workspace names, session titles and IDs are replaced with demo data. The UI language follows DSH (Chinese here).</sub>
34
+ <sub>Screenshots are captured from a live DSH desktop session with the demo data substituted in the DOM (workspace names, session titles, UUIDs and the local user path), so no real content is published. The UI language follows DSH (Chinese here).</sub>
33
35
 
34
36
  ## Install
35
37
 
@@ -51,11 +53,13 @@ Restart the DSH desktop app afterwards. A fresh install adds a host half, so rel
51
53
 
52
54
  ## Usage
53
55
 
54
- **Batch (in trash)**: the trash tab supports select-all / clear / batch restore / batch permanent delete; each entry is handled independently and failures are reported inline.
56
+ **Batch (in trash)**: the trash list has a sticky toolbar with select-all, batch restore and batch permanent delete. Batches run 20 entries at a time with a live `n/total` progress line and a Stop button, so a selection far larger than the host's single-request bound still completes; failures are summarised and stay selected for a retry.
55
57
 
56
58
  **Agent tool**: models can call `session_delete`, but only in two steps — `action=plan` returns the impact summary plus a single-use token (2 minutes), and `action=delete` needs that token. It refuses to delete the calling session, and a changed session invalidates the token. Deleting from the UI never requires the tool.
57
59
 
58
- **Keyboard**: Tab between controls, Enter/Space to activate, Esc to close a dialog. In the trash panel, ↑/↓/Home/End move focus between rows. `⌘/Ctrl + Alt + T` opens the trash. There is no one-key delete shortcut — deletion always goes through the menu and a confirmation dialog.
60
+ **Keyboard**: the delete confirmation opens with focus on **Move to trash**, so Enter deletes and Esc cancels; when deletion is blocked, focus falls back to **Cancel**. Tab moves between the checkbox, the Details disclosure and the buttons. `⌘/Ctrl + Alt + T` opens the trash. The remembered cascade checkbox means the trigger is one key press away from a batch delete — the dialog always spells out how many child sessions come along.
61
+
62
+ **Settings → Session trash**: deletion preferences (remember cascade, reset to default), a trash overview (entries, size, path), and maintenance — health check with a bookkeeping-only clean-up, operation receipts, and the audit log.
59
63
 
60
64
  **Refresh**: the trash panel has no refresh button. It loads on open and re-syncs every 5 seconds, when the window becomes visible again, and after every restore or permanent delete.
61
65
 
@@ -118,11 +122,13 @@ Capability grades:
118
122
  - `minimal` — the host has no `workspaceRegistry` (for example the headless composition). Deletion works; the archive gate, pin/workspace bookkeeping and projection-cache steps are skipped and listed in the receipt.
119
123
  - `unknown` — the persistence seam itself is missing: **read-only mode**. Plan, audit and trash listing keep working; delete/restore/purge are disabled.
120
124
 
121
- | Plugin | Verified on DSH | Notes |
122
- | ------ | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
123
- | 0.4.7 | **0.2.2-rc.2** (throwaway home) | `pnpm smoke:session-delete`: 24/24 on a throwaway DSH home, after fixing the smoke's row selection (it had counted the unsaved “new chat” row as a session — see [runtime 0.2.2-rc.2 §7](../../docs/runtime/0.2.2-rc.2.md)). Desktop read-only regression on the installed 0.4.6 (same code except one Biome template literal): 14/14. |
124
- | 0.4.2 | **0.2.2-rc.1** (desktop) | `pnpm smoke:session-delete`: 24 assertions green; plugin active with no bundle error on the same host version. |
125
- | 0.4.2 | 0.2.1-rc.5 (desktop) | `pnpm smoke:session-delete`: 24 assertions green; manual GUI pass on the same host version. |
125
+ | Plugin | Verified on DSH | Notes |
126
+ | ------ | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
127
+ | 0.4.9 | **0.2.2-rc.2** (desktop) | Trash-count badge foreground now uses a paired token: the dark theme's `state-error` is a light red (`#f25a5a`), so hardcoded white sat at 3.29:1 while `label-primary-foreground` gives 5.75:1 (still 4.5:1 in the light theme). Adds `test/client.test.js`, which asserts every theme token really exists and that the badge fill and foreground stay paired. Desktop read-only regression 14/14, unit tests 53. |
128
+ | 0.4.8 | **0.2.2-rc.2** (desktop) | macOS window-drag fix: the self-drawn dialog fallback mask declares `data-window-drag-exclude`. Desktop read-only regression on the published build: 14/14; runtime probe 67/67. |
129
+ | 0.4.7 | **0.2.2-rc.2** (throwaway home) | `pnpm smoke:session-delete`: 24/24 on a throwaway DSH home, after fixing the smoke's row selection (it had counted the unsaved “new chat” row as a session — see [runtime 0.2.2-rc.2 §7](../../docs/runtime/0.2.2-rc.2.md)). Desktop read-only regression on the installed 0.4.6 (same code except one Biome template literal): 14/14. |
130
+ | 0.4.2 | **0.2.2-rc.1** (desktop) | `pnpm smoke:session-delete`: 24 assertions green; plugin active with no bundle error on the same host version. |
131
+ | 0.4.2 | 0.2.1-rc.5 (desktop) | `pnpm smoke:session-delete`: 24 assertions green; manual GUI pass on the same host version. |
126
132
 
127
133
  After a DSH upgrade: restart, then open the plugin status (settings → plugins). If it reports read-only mode, the host API changed — upgrade the plugin or report the version pair; don't force it.
128
134
 
package/README.zh-CN.md CHANGED
@@ -8,10 +8,10 @@
8
8
 
9
9
  非官方 [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness) 插件,与 DeepSeek 无关。
10
10
 
11
- > **状态:早期可用。** 已在当前目标 DSH 版本上用 `pnpm smoke:session-delete`(临时 DSH home,24 项端到端断言)和 `pnpm probe:runtime` 验证;桌面只读回归是在更早的版本上做的。具体范围见[兼容性与降级](#兼容性与降级)表格。`pnpm gate session-delete` 一条命令跑完发版门禁。仍是年轻软件,重要数据请自行备份。
11
+ > **状态:早期可用。** 已在当前目标 DSH 版本上用 `pnpm smoke:session-delete`(临时 DSH home,33 项端到端断言)和 `pnpm probe:runtime` 验证;桌面只读回归是在更早的版本上做的。具体范围见[兼容性与降级](#兼容性与降级)表格。`pnpm gate session-delete` 一条命令跑完发版门禁。仍是年轻软件,重要数据请自行备份。
12
12
 
13
13
 
14
- ![删除确认框:展示体积、子会话和将要清理的引用](https://raw.githubusercontent.com/kangyishuai/dsh-plugins/main/packages/session-delete/docs/images/overview.png)
14
+ ![删除确认框:一行影响面、可选的级联勾选、以及「详情」折叠](https://raw.githubusercontent.com/kangyishuai/dsh-plugins/main/packages/session-delete/docs/images/overview.png)
15
15
 
16
16
  ## 做什么
17
17
 
@@ -20,16 +20,18 @@ DSH 自带的「归档」只是把会话藏起来:id 记进工作区的归档
20
20
  - **真正的删除。** 把会话目录从 `~/.dsh/sessions/` 移走,同时清掉还指向它的记账(归档集合、置顶集合、工作区归属、投影缓存),所以会话不会复活,也不会留下幽灵条目。
21
21
  - **默认进回收站。** 第一次点删除不会抹掉任何东西:会话进 `~/.dsh/session-trash/`,随时可恢复。「彻底删除」是另一个独立的显式动作。
22
22
  - **删前预演(plan / dry-run)。** 确认框由一份计划生成:占用体积、是否 live、有几个子会话、将清理哪些引用。真正执行前会重新算一遍并与你确认时的计划比对,不一致就中止,避免删掉你没看到的东西。
23
- - **审计日志。** 每次删除 / 恢复 / 彻底删除都往 `~/.dsh/session-trash/audit.log` 追加一行 JSON,回收站面板里能直接看。
24
- - **删除回执。** 移走之后核对会话可能被引用的几处,把没清干净的残留列出来(删除仍是一次一条;回收站页签支持批量恢复 / 批量彻底删除)。
23
+ - **审计日志。** 每次删除 / 恢复 / 彻底删除都往 `~/.dsh/session-trash/audit.log` 追加一行 JSON,在 **设置 → 会话回收站** 里能直接看。
24
+ - **删除回执。** 移走之后核对会话可能被引用的几处,把没清干净的残留列出来(删除仍是一次一条;回收站列表支持批量恢复 / 批量彻底删除)。
25
+ - **快捷键与工作区批量。** `⌘⌥⌫`(可在 设置 → 通用 → 快捷键 改)对当前会话直接打开同一个确认框;工作区「…」菜单里多了 **删除此工作区的全部会话…**,先给出整组影响面,再逐条删除。
26
+ - **安静的界面。** 确认框只留一行「体积 · 子会话 · 正在运行」,技术细节收进「详情」;回收站是单页列表;体检、审计、回执搬到设置页。子会话的勾选沿用你上次的选择,存在宿主侧 `~/.dsh/session-trash/preferences.json`。
25
27
 
26
28
  ## 截图
27
29
 
28
- | 删前预演 | 回收站 | 审计日志 | 回执 |
29
- | ---------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
30
- | ![删前预演](https://raw.githubusercontent.com/kangyishuai/dsh-plugins/main/packages/session-delete/docs/images/confirm-dialog.png) | ![回收站](https://raw.githubusercontent.com/kangyishuai/dsh-plugins/main/packages/session-delete/docs/images/trash-panel.png) | ![审计日志](https://raw.githubusercontent.com/kangyishuai/dsh-plugins/main/packages/session-delete/docs/images/audit-tab.png) | ![回执](https://raw.githubusercontent.com/kangyishuai/dsh-plugins/main/packages/session-delete/docs/images/receipts-tab.png) |
30
+ | 删除确认 | 工作区批量 | 回收站 | 设置 → 会话回收站 |
31
+ | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
32
+ | ![删除确认](https://raw.githubusercontent.com/kangyishuai/dsh-plugins/main/packages/session-delete/docs/images/confirm-dialog.png) | ![工作区批量](https://raw.githubusercontent.com/kangyishuai/dsh-plugins/main/packages/session-delete/docs/images/workspace-batch.png) | ![回收站](https://raw.githubusercontent.com/kangyishuai/dsh-plugins/main/packages/session-delete/docs/images/trash-panel.png) | ![设置页分节](https://raw.githubusercontent.com/kangyishuai/dsh-plugins/main/packages/session-delete/docs/images/settings-section.png) |
31
33
 
32
- <sub>截图由 <code>SMOKE_DEMO=1 pnpm smoke:session-delete</code> 生成,工作区名、会话标题和 ID 都已替换为演示数据。</sub>
34
+ <sub>截图从真实 DSH 桌面版现场截取,并在 DOM 层把工作区名、会话标题、UUID 与本机用户路径替换为演示数据,不含真实内容。</sub>
33
35
 
34
36
  ## 安装
35
37
 
@@ -51,11 +53,13 @@ dsh plugin --profile desktop add /tmp/kangyishuai-dsh-session-delete-*.tgz
51
53
 
52
54
  ## 使用
53
55
 
54
- **回收站内批量**:回收站页签支持全选/清空/批量恢复/批量彻底删除,逐条执行,失败的条目会在面板里说明。
56
+ **回收站内批量**:列表上方是吸顶的批量条(全选 / 批量恢复 / 批量彻底删除)。批量按 20 条一批执行,显示「处理中 n/总」,可随时「停止」——所以一次选 80 条也不会被宿主单次上限整单拒绝;失败的条目会汇总并保持选中,方便重试。
55
57
 
56
58
  **Agent 工具**:模型可以调用 `session_delete`,但必须两段式——`action=plan` 返回影响面摘要和一次性 token(2 分钟有效),`action=delete` 必须带这个 token。它拒绝删除调用者自己的会话,会话在此期间变化会让 token 失效。通过 UI 删除不需要这个工具。
57
59
 
58
- **键盘**:Tab 在各按钮间移动,Enter/Space 触发,Esc 关闭对话框;回收站面板里可用 ↑/↓/Home/End 在条目间移动焦点;`⌘/Ctrl + Alt + T` 直接打开回收站。删除始终需要菜单 + 确认框,没有一键删除的快捷键。
60
+ **键盘**:删除确认框打开时焦点就在「移入回收站」上,**回车即执行**、Esc 取消;不可删除时焦点回落到「取消」。Tab 在勾选框、详情折叠与按钮之间移动。`⌘/Ctrl + Alt + T` 直接打开回收站。因为级联勾选会被记住,回车离批量删除只有一步——所以确认框始终写明会带上多少个子会话。
61
+
62
+ **设置 → 会话回收站**:删除偏好(记住级联 / 重置为默认)、回收站概览(条目数、占用、路径),以及维护——体检(只动登记表)、操作回执、审计日志。
59
63
 
60
64
  **刷新**:回收站面板没有刷新按钮——打开时自动加载,之后每 5 秒、窗口重新可见、以及每次恢复/彻底删除后自动同步。
61
65
 
@@ -120,6 +124,8 @@ dsh plugin --profile desktop add /tmp/kangyishuai-dsh-session-delete-*.tgz
120
124
 
121
125
  | 插件版本 | 已验证的 DSH 版本 | 说明 |
122
126
  | -------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
127
+ | 0.4.9 | **0.2.2-rc.2**(桌面版) | 回收站计数徽章的前景色改用配对 token:深色主题下 `state-error` 是浅红 `#f25a5a`,原先配写死白只有 3.29:1,配 `label-primary-foreground` 是 5.75:1(浅色仍 4.5:1)。新增 `test/client.test.js` 守住「token 必须真实存在 + 底色/前景成对」。桌面只读回归 14/14,单测 53。 |
128
+ | 0.4.8 | **0.2.2-rc.2**(桌面版) | macOS 窗口拖动修复:自绘确认框 fallback 的遮罩声明 `data-window-drag-exclude`。桌面只读回归在发布版上复跑 14/14,宿主探针 67/67。 |
123
129
  | 0.4.7 | **0.2.2-rc.2**(临时 DSH home) | `pnpm smoke:session-delete` 24/24(临时 DSH home);此前 23/24 是冒烟把「新会话」临时行当成会话计数,修好行选择与按 ID 断言后全绿(见 [runtime 0.2.2-rc.2 §7](../../docs/runtime/0.2.2-rc.2.md))。桌面只读回归跑在已装的 0.4.6 上(与 0.4.7 只差一处 Biome 模板字符串):14/14。 |
124
130
  | 0.4.2 | **0.2.2-rc.1**(桌面版) | `pnpm smoke:session-delete` 24 项断言全绿,并确认同一版本桌面版里插件正常激活、没有 bundle 错误。 |
125
131
  | 0.4.2 | 0.2.1-rc.5(桌面版) | `pnpm smoke:session-delete` 24 项断言全绿,并在同一版本桌面版做过人工 GUI 验收。 |