@kangyishuai/dsh-session-delete 0.4.1 → 0.4.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.
Files changed (3) hide show
  1. package/README.md +15 -11
  2. package/README.zh-CN.md +15 -11
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Unofficial plugin for [DeepSeek Harness (DSH)](https://github.com/deepseek-ai). Not affiliated with DeepSeek.
8
8
 
9
- > **Status: v0.4.1, early.** Verified on DSH 0.2.1-rc.5 with `pnpm smoke:session-delete` (24 end-to-end assertions) plus a manual pass in the desktop GUI. Treat it as young software and keep backups of anything you cannot lose.
9
+ > **Status: v0.4.2, early.** Verified on DSH 0.2.1-rc.5 with `pnpm smoke:session-delete` (24 end-to-end assertions) plus a manual pass in the desktop GUI. Treat it as young software and keep backups of anything you cannot lose.
10
10
 
11
11
  ## What it does
12
12
 
@@ -16,7 +16,7 @@ DSH's built-in _archive_ only hides a session: the id goes into the workspace's
16
16
  - **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.
17
17
  - **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.
18
18
  - **Audit log.** Every delete / restore / purge appends one JSON line to `~/.dsh/session-trash/audit.log`, readable from the trash panel.
19
- - **Receipt after delete.** After the move, the plugin checks the places a session can be referenced and reports anything left behind (v0.1: one session at a time).
19
+ - **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).
20
20
 
21
21
  ## Install
22
22
 
@@ -81,7 +81,7 @@ Files and directories it touches:
81
81
  - **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.
82
82
  - **Uninstalling the plugin does not empty the trash.** `~/.dsh/session-trash/` is your recovery path and stays until you delete it yourself.
83
83
  - **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.
84
- - **Alpha software operating on your data.** Until v0.1 passes GUI acceptance, back up anything you care about.
84
+ - **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.
85
85
 
86
86
  ## How this differs from the built-in archive
87
87
 
@@ -89,19 +89,23 @@ Archive is a bookmark, not a deletion: DSH adds the session id to the workspace'
89
89
 
90
90
  ## Compatibility & degradation
91
91
 
92
- v0.1 declares no `engines.dsh` range. Instead there are three layers of defense:
92
+ The package declares no `engines.dsh` range. Instead there are three layers of defense:
93
93
 
94
- | Layer | When it runs | What it does | What you see |
95
- | --------------------- | -------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
96
- | L1 version gate | install / activation | `engines.dsh` version range. **Not declared in v0.1**, so this layer is currently inactive. | nothing |
97
- | L2 startup self-check | plugin activation | Probes every host capability it depends on and grades them api / internal / unknown. | **Degraded mode**: a host without `workspaceRegistry` (for example the headless composition) still allows deletion — the archive gate and workspace bookkeeping steps are skipped and reported in the receipt. Only a missing persistence seam puts the plugin in read-only mode. |
94
+ | Layer | When it runs | What it does | What you see |
95
+ | ------------------------ | -------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------- |
96
+ | L1 version gate | install / activation | `engines.dsh` version range. **Not declared**, so this layer is inactive. | nothing |
97
+ | L2 startup self-check | plugin activation | Probes every host capability it depends on. | a capability grade: `api` / `internal` / `minimal` / `unknown` |
98
+ | L3 per-operation refusal | every operation | Each operation re-checks its own prerequisites; unknown always refuses. | structured error code + reason, no half-deleted state |
98
99
 
99
- **Read-only mode**: plan, audit and trash listing keep working; delete, restore and purge are disabled. |
100
- | L3 per-operation refusal | every operation | Each operation re-checks its own prerequisites; unknown always refuses. | A structured error code plus a human-readable reason, and no half-deleted state. |
100
+ Capability grades:
101
+
102
+ - `api` / `internal` — full operation. `internal` means some steps rely on host contracts that are not in the public docs; they run and are reported.
103
+ - `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.
104
+ - `unknown` — the persistence seam itself is missing: **read-only mode**. Plan, audit and trash listing keep working; delete/restore/purge are disabled.
101
105
 
102
106
  | Plugin | Verified on DSH | Notes |
103
107
  | ------ | ------------------------ | ------------------------------------------------------------------------------------------- |
104
- | 0.4.1 | **0.2.1-rc.5** (desktop) | `pnpm smoke:session-delete`: 24 assertions green; manual GUI pass on the same host version. |
108
+ | 0.4.2 | **0.2.1-rc.5** (desktop) | `pnpm smoke:session-delete`: 24 assertions green; manual GUI pass on the same host version. |
105
109
 
106
110
  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.
107
111
 
package/README.zh-CN.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  非官方 [DeepSeek Harness (DSH)](https://github.com/deepseek-ai) 插件,与 DeepSeek 无关。
8
8
 
9
- > **状态:v0.4.1,早期可用。** 已在 DSH 0.2.1-rc.5 上用 `pnpm smoke:session-delete`(24 项端到端断言)加一轮桌面版人工验收。仍是年轻软件,重要数据请自行备份。
9
+ > **状态:v0.4.2,早期可用。** 已在 DSH 0.2.1-rc.5 上用 `pnpm smoke:session-delete`(24 项端到端断言)加一轮桌面版人工验收。仍是年轻软件,重要数据请自行备份。
10
10
 
11
11
  ## 做什么
12
12
 
@@ -16,7 +16,7 @@ DSH 自带的「归档」只是把会话藏起来:id 记进工作区的归档
16
16
  - **默认进回收站。** 第一次点删除不会抹掉任何东西:会话进 `~/.dsh/session-trash/`,随时可恢复。「彻底删除」是另一个独立的显式动作。
17
17
  - **删前预演(plan / dry-run)。** 确认框由一份计划生成:占用体积、是否 live、有几个子会话、将清理哪些引用。真正执行前会重新算一遍并与你确认时的计划比对,不一致就中止,避免删掉你没看到的东西。
18
18
  - **审计日志。** 每次删除 / 恢复 / 彻底删除都往 `~/.dsh/session-trash/audit.log` 追加一行 JSON,回收站面板里能直接看。
19
- - **删除回执。** 移走之后核对会话可能被引用的几处,把没清干净的残留列出来(v0.1 支持单条会话)。
19
+ - **删除回执。** 移走之后核对会话可能被引用的几处,把没清干净的残留列出来(删除仍是一次一条;回收站页签支持批量恢复 / 批量彻底删除)。
20
20
 
21
21
  ## 安装
22
22
 
@@ -81,7 +81,7 @@ dsh plugin --profile desktop add /tmp/kangyishuai-dsh-session-delete-*.tgz
81
81
  - **恢复不等于完整撤销。** 日志和工作区归属会回来,置顶与归档标记不会:DSH 归档时会顺手清掉 pin,取消归档时不会恢复。
82
82
  - **卸载插件不会清空回收站。** `~/.dsh/session-trash/` 是你的恢复通道,会一直留着,除非你自己删。
83
83
  - **数据根目录。** 按「插件配置 `dataRoot` → 环境变量 `DSH_HOME` → `~/.dsh`」的顺序解析。如果你的 DSH 把数据放在别处,要把插件指过去;根目录不像 DSH 数据目录时,插件会拒绝执行而不是瞎猜。
84
- - **这是 alpha 软件,而且会动你的数据。** 在 v0.1 通过 GUI 验收之前,重要会话请自行备份。
84
+ - **这是 alpha 软件,而且会动你的数据。** 它已在下方表格的版本上通过 GUI 验收,但仍属早期软件:重要会话请自行备份。
85
85
 
86
86
  ## 与官方归档的区别
87
87
 
@@ -89,19 +89,23 @@ dsh plugin --profile desktop add /tmp/kangyishuai-dsh-session-delete-*.tgz
89
89
 
90
90
  ## 兼容性与降级
91
91
 
92
- v0.1 没有声明 `engines.dsh` 版本范围,改用三层防线:
92
+ 本包没有声明 `engines.dsh` 版本范围,改用三层防线:
93
93
 
94
- | 层 | 触发时机 | 做什么 | 你会看到什么 |
95
- | ----------- | ----------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
96
- | L1 版本闸门 | 安装 / 激活 | `engines.dsh` 版本范围。**v0.1 尚未声明**,这一层目前不生效。 | 无 |
97
- | L2 启动自检 | 插件激活时 | 探测所有依赖的宿主能力,分成 api / internal / unknown 三档。 | 进入**降级模式**:宿主没有 `workspaceRegistry`(例如 headless 组合)时仍然允许删除——归档闸门与工作区记账步骤会被跳过并写进回执。只有持久化本体缺失时才进入只读模式。 |
94
+ | 层 | 触发时机 | 做什么 | 你会看到什么 |
95
+ | ------------- | ----------- | ------------------------------------------------------ | --------------------------------------------------------- |
96
+ | L1 版本闸门 | 安装 / 激活 | `engines.dsh` 版本范围。**未声明**,这一层目前不生效。 | 无 |
97
+ | L2 启动自检 | 插件激活时 | 探测所有依赖的宿主能力。 | 能力档位:`api` / `internal` / `minimal` / `unknown` |
98
+ | L3 执行期拒绝 | 每次操作 | 每个操作自己再校验前置能力,unknown 一律拒绝。 | 结构化错误码 + 人类可读原因,磁盘上不会出现删了一半的状态 |
98
99
 
99
- **只读模式**:plan、审计、回收站列表还能用;删除、恢复、彻底删除被禁用。 |
100
- | L3 执行期拒绝 | 每次操作 | 每个操作自己再校验前置能力,unknown 一律拒绝。 | 结构化错误码 + 人类可读原因,磁盘上不会出现删了一半的状态。 |
100
+ 能力档位:
101
+
102
+ - `api` / `internal` —— 全流程可用。`internal` 表示部分步骤依赖不在公开文档里的宿主契约,会执行并在面板/回执里说明。
103
+ - `minimal` —— 宿主没有 `workspaceRegistry`(例如 headless 组合)。删除照常进行;归档闸门、置顶/工作区记账、投影缓存这些步骤被跳过并写进回执。
104
+ - `unknown` —— 持久化本体缺失:**只读模式**。plan、审计、回收站列表还能用;删除、恢复、彻底删除被禁用。
101
105
 
102
106
  | 插件版本 | 已验证的 DSH 版本 | 说明 |
103
107
  | -------- | ------------------------ | -------------------------------------------------------------------------------- |
104
- | 0.4.1 | **0.2.1-rc.5**(桌面版) | `pnpm smoke:session-delete` 24 项断言全绿,并在同一版本桌面版做过人工 GUI 验收。 |
108
+ | 0.4.2 | **0.2.1-rc.5**(桌面版) | `pnpm smoke:session-delete` 24 项断言全绿,并在同一版本桌面版做过人工 GUI 验收。 |
105
109
 
106
110
  目前只在 **macOS** 上验证过。Windows 相关路径(`session.lock` 的 EBUSY/EPERM 重试、宿主在那儿用的命名信号量)代码里有,但**还没实测**。
107
111
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kangyishuai/dsh-session-delete",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Real session deletion for DSH: trash by default, plan before delete, audit log, residue receipt",
5
5
  "keywords": [
6
6
  "dsh",