@kangyishuai/dsh-session-delete 0.4.6 → 0.4.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/README.md CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  > Real session deletion for DeepSeek Harness: trash by default, a plan before you delete, an audit log, and a receipt for whatever is left behind.
4
4
 
5
- [![npm](https://img.shields.io/npm/v/@kangyishuai/dsh-session-delete?color=cb3837&logo=npm)](https://www.npmjs.com/package/@kangyishuai/dsh-session-delete) [![DSH](https://img.shields.io/badge/verified%20on%20DSH-0.2.2--rc.1-4b6bfb)](#compatibility--degradation) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
5
+ [![npm](https://img.shields.io/npm/v/@kangyishuai/dsh-session-delete?color=cb3837&logo=npm)](https://www.npmjs.com/package/@kangyishuai/dsh-session-delete) [![DSH](https://img.shields.io/badge/verified%20on%20DSH-0.2.2--rc.2-4b6bfb)](#compatibility--degradation) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
6
6
 
7
7
  [中文](./README.zh-CN.md)
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 DSH 0.2.2-rc.1 with `pnpm smoke:session-delete` (24 end-to-end assertions plus a read-only desktop pass) and `pnpm probe:runtime`. `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` (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.
12
12
 
13
13
 
14
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)
@@ -89,9 +89,11 @@ Files and directories it touches:
89
89
  | `~/.dsh/session-trash/` | create + write | One entry per deleted session (with a `meta.json`), `audit.log` (JSONL, one line per operation) and `journal/` (two-phase-commit records so an interrupted operation can be finished or rolled back on the next start). |
90
90
 
91
91
  - **No network access, no telemetry.**
92
+ - **macOS window drag.** The self-drawn confirmation fallback declares `data-window-drag-exclude`, so the mask cannot drag the window when it covers the title bar.
92
93
  - **Restorable by default.** Delete moves files; it does not erase them.
93
94
  - **Purge is irreversible.** "Purge" (and emptying the trash) really deletes the bytes. There is no undo toast and no recovery.
94
95
  - **Restore is not a full undo.** The log and workspace membership come back; the pin and archive flags do not. DSH clears a pin when it archives a session and doesn't restore it when it unarchives.
96
+ - **Archiving can remove a clean git worktree (DSH 0.2.2-rc.2 and later).** Moving a session to the trash archives it. Newer DSH releases record the worktrees a session created and may run `git worktree remove` on a clean one when its owning session is archived: branches and commits stay, ignored files do not. If a checkout must survive, `git worktree lock <path>` it or turn on the worktree row's `retainOnArchive` setting before deleting the session.
95
97
  - **Uninstalling the plugin does not empty the trash.** `~/.dsh/session-trash/` is your recovery path and stays until you delete it yourself.
96
98
  - **Data root.** Resolved as plugin config `dataRoot` → `DSH_HOME` → `~/.dsh`. If your DSH keeps its data somewhere else, point the plugin at it. If the root doesn't look like a DSH data directory, the plugin refuses instead of guessing.
97
99
  - **Alpha software operating on your data.** It has passed GUI acceptance on the version in the table below, but it is still early software: back up anything you cannot lose.
@@ -116,10 +118,11 @@ Capability grades:
116
118
  - `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.
117
119
  - `unknown` — the persistence seam itself is missing: **read-only mode**. Plan, audit and trash listing keep working; delete/restore/purge are disabled.
118
120
 
119
- | Plugin | Verified on DSH | Notes |
120
- | ------ | ------------------------ | -------------------------------------------------------------------------------------------------------------- |
121
- | 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. |
122
- | 0.4.2 | 0.2.1-rc.5 (desktop) | `pnpm smoke:session-delete`: 24 assertions green; manual GUI pass on the same host version. |
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. |
123
126
 
124
127
  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.
125
128
 
package/README.zh-CN.md CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  > 真正的删除会话:默认进回收站、删前先预演、留审计日志,删完给你一份残留回执。
4
4
 
5
- [![npm](https://img.shields.io/npm/v/@kangyishuai/dsh-session-delete?color=cb3837&logo=npm)](https://www.npmjs.com/package/@kangyishuai/dsh-session-delete) [![DSH](https://img.shields.io/badge/verified%20on%20DSH-0.2.2--rc.1-4b6bfb)](#兼容性与降级) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
5
+ [![npm](https://img.shields.io/npm/v/@kangyishuai/dsh-session-delete?color=cb3837&logo=npm)](https://www.npmjs.com/package/@kangyishuai/dsh-session-delete) [![DSH](https://img.shields.io/badge/verified%20on%20DSH-0.2.2--rc.2-4b6bfb)](#兼容性与降级) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
6
6
 
7
7
  [English](./README.md)
8
8
 
9
9
  非官方 [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness) 插件,与 DeepSeek 无关。
10
10
 
11
- > **状态:早期可用。** 已在 DSH 0.2.2-rc.1 上用 `pnpm smoke:session-delete`(24 项端到端断言 + 一次只读桌面回归)和 `pnpm probe:runtime` 验证。`pnpm gate session-delete` 一条命令跑完发版门禁。仍是年轻软件,重要数据请自行备份。
11
+ > **状态:早期可用。** 已在当前目标 DSH 版本上用 `pnpm smoke:session-delete`(临时 DSH home,24 项端到端断言)和 `pnpm probe:runtime` 验证;桌面只读回归是在更早的版本上做的。具体范围见[兼容性与降级](#兼容性与降级)表格。`pnpm gate session-delete` 一条命令跑完发版门禁。仍是年轻软件,重要数据请自行备份。
12
12
 
13
13
 
14
14
  ![删除确认框:展示体积、子会话和将要清理的引用](https://raw.githubusercontent.com/kangyishuai/dsh-plugins/main/packages/session-delete/docs/images/overview.png)
@@ -89,9 +89,11 @@ dsh plugin --profile desktop add /tmp/kangyishuai-dsh-session-delete-*.tgz
89
89
  | `~/.dsh/session-trash/` | 创建 + 写入 | 每条被删会话一个条目(带 `meta.json`),另有 `audit.log`(JSONL,一次操作一行)和 `journal/`(两阶段提交记录,用于下次启动时把中断的操作补完或回滚)。 |
90
90
 
91
91
  - **不联网、不上报。**
92
+ - **macOS 窗口拖动。** 自绘确认框 fallback 的遮罩声明了 `data-window-drag-exclude`,覆盖页头时拖动不会拖走窗口。
92
93
  - **默认可恢复。** 删除是把文件移走,不是抹掉。
93
94
  - **彻底删除不可恢复。** 「彻底删除」以及清空回收站是真的删字节,没有撤销 toast,也找不回来。
94
95
  - **恢复不等于完整撤销。** 日志和工作区归属会回来,置顶与归档标记不会:DSH 归档时会顺手清掉 pin,取消归档时不会恢复。
96
+ - **归档可能清理干净的工作树(DSH 0.2.2-rc.2 起)。** 「移入回收站」本质是归档会话:新版本 DSH 会记录会话创建的工作树,并在归档时对满足条件(没有未归档会话引用、Git 干净、不是分离 HEAD 等)的目录执行 `git worktree remove`。分支和提交保留,被忽略的文件(如 `node_modules`)不会保留。要保住检出目录,删除前用 `git worktree lock <path>`,或在 Forge 套件的 worktree 行打开 `retainOnArchive`。
95
97
  - **卸载插件不会清空回收站。** `~/.dsh/session-trash/` 是你的恢复通道,会一直留着,除非你自己删。
96
98
  - **数据根目录。** 按「插件配置 `dataRoot` → 环境变量 `DSH_HOME` → `~/.dsh`」的顺序解析。如果你的 DSH 把数据放在别处,要把插件指过去;根目录不像 DSH 数据目录时,插件会拒绝执行而不是瞎猜。
97
99
  - **这是 alpha 软件,而且会动你的数据。** 它已在下方表格的版本上通过 GUI 验收,但仍属早期软件:重要会话请自行备份。
@@ -116,10 +118,11 @@ dsh plugin --profile desktop add /tmp/kangyishuai-dsh-session-delete-*.tgz
116
118
  - `minimal` —— 宿主没有 `workspaceRegistry`(例如 headless 组合)。删除照常进行;归档闸门、置顶/工作区记账、投影缓存这些步骤被跳过并写进回执。
117
119
  - `unknown` —— 持久化本体缺失:**只读模式**。plan、审计、回收站列表还能用;删除、恢复、彻底删除被禁用。
118
120
 
119
- | 插件版本 | 已验证的 DSH 版本 | 说明 |
120
- | -------- | ------------------------ | ------------------------------------------------------------------------------------------------- |
121
- | 0.4.2 | **0.2.2-rc.1**(桌面版) | `pnpm smoke:session-delete` 24 项断言全绿,并确认同一版本桌面版里插件正常激活、没有 bundle 错误。 |
122
- | 0.4.2 | 0.2.1-rc.5(桌面版) | `pnpm smoke:session-delete` 24 项断言全绿,并在同一版本桌面版做过人工 GUI 验收。 |
121
+ | 插件版本 | 已验证的 DSH 版本 | 说明 |
122
+ | -------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
123
+ | 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
+ | 0.4.2 | **0.2.2-rc.1**(桌面版) | `pnpm smoke:session-delete` 24 项断言全绿,并确认同一版本桌面版里插件正常激活、没有 bundle 错误。 |
125
+ | 0.4.2 | 0.2.1-rc.5(桌面版) | `pnpm smoke:session-delete` 24 项断言全绿,并在同一版本桌面版做过人工 GUI 验收。 |
123
126
 
124
127
  目前只在 **macOS** 上验证过。Windows 相关路径(`session.lock` 的 EBUSY/EPERM 重试、宿主在那儿用的命名信号量)代码里有,但**还没实测**。
125
128
 
package/lib/client.js CHANGED
@@ -274,6 +274,8 @@ window.__ModuleLoader__.load({
274
274
  alignItems: "center",
275
275
  justifyContent: "center",
276
276
  },
277
+ // macOS 上覆盖页头的浮层必须显式声明窗口拖动排除,否则拖动会变成拖窗口。
278
+ "data-window-drag-exclude": "",
277
279
  onClick: props.onClose,
278
280
  },
279
281
  h(
package/lib/operations.js CHANGED
@@ -847,8 +847,7 @@ export function createOperations({ ctx, dataRoot, logger }) {
847
847
  action: "health",
848
848
  result: errors.length > 0 ? "failed" : "ok",
849
849
  operator: request.operator ?? "ui",
850
- detail:
851
- "清理失效引用 " + total + " 条" + (errors.length > 0 ? `,失败 ${errors.length} 条` : ""),
850
+ detail: `清理失效引用 ${total} 条${errors.length > 0 ? `,失败 ${errors.length} 条` : ""}`,
852
851
  });
853
852
  const receiptId = await writeReceipt(dataRoot, {
854
853
  action: "health",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kangyishuai/dsh-session-delete",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
4
4
  "description": "Real session deletion for DSH: trash by default, plan before delete, audit log, residue receipt",
5
5
  "keywords": [
6
6
  "dsh",