@xrn1997/dsh-session-delete 0.8.0 → 0.9.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.
Files changed (91) hide show
  1. package/README.md +133 -173
  2. package/THIRD_PARTY_NOTICES.md +4 -2
  3. package/docs/DETAIL.md +1 -0
  4. package/docs/DETAIL.zh.md +1 -0
  5. package/docs/preview.svg +119 -0
  6. package/docs/preview.zh.svg +117 -0
  7. package/docs/screenshots/screenshot-01.png +0 -0
  8. package/lib/client.js +4244 -2086
  9. package/lib/index.js +1237 -336
  10. package/lib/types/api/archive-rows.d.ts +20 -0
  11. package/lib/types/api/connection-route.d.ts +1 -1
  12. package/lib/types/api/route-table.d.ts +100 -11
  13. package/lib/types/client/archive-detail.d.ts +27 -0
  14. package/lib/types/client/archive-pane.d.ts +60 -0
  15. package/lib/types/client/archive-store.d.ts +6 -0
  16. package/lib/types/client/attachment-view.d.ts +0 -7
  17. package/lib/types/client/batch-bar.d.ts +3 -2
  18. package/lib/types/client/batch-confirm.d.ts +13 -4
  19. package/lib/types/client/batch-menu-item.d.ts +1 -1
  20. package/lib/types/client/batch-pick.d.ts +2 -1
  21. package/lib/types/client/config-settings.d.ts +2 -2
  22. package/lib/types/client/confirm-dialog.d.ts +2 -2
  23. package/lib/types/client/copy.d.ts +53 -13
  24. package/lib/types/client/detail-ledger.d.ts +23 -0
  25. package/lib/types/client/detail-pane.d.ts +33 -0
  26. package/lib/types/client/host-archive-watch.d.ts +22 -0
  27. package/lib/types/client/host-rows.d.ts +7 -0
  28. package/lib/types/client/maintenance-parts.d.ts +4 -3
  29. package/lib/types/client/maintenance-settings.d.ts +4 -3
  30. package/lib/types/client/notice.d.ts +16 -0
  31. package/lib/types/client/orphan-maintenance.d.ts +1 -1
  32. package/lib/types/client/receipt.d.ts +4 -1
  33. package/lib/types/client/remote.d.ts +38 -7
  34. package/lib/types/client/session-detail.d.ts +94 -0
  35. package/lib/types/client/session-list.d.ts +112 -0
  36. package/lib/types/client/settings-cards.d.ts +1 -1
  37. package/lib/types/client/subagent-section.d.ts +45 -0
  38. package/lib/types/client/trash-confirm.d.ts +2 -1
  39. package/lib/types/client/trash-detail.d.ts +9 -60
  40. package/lib/types/client/trash-nav.d.ts +8 -7
  41. package/lib/types/client/trash-panel.d.ts +1 -1
  42. package/lib/types/client/trash-snapshot.d.ts +10 -23
  43. package/lib/types/client/trash-view.d.ts +39 -9
  44. package/lib/types/client/ui/ErrorBoundary.d.ts +32 -0
  45. package/lib/types/client/ui/icons.d.ts +10 -4
  46. package/lib/types/client/undo-notices.d.ts +23 -3
  47. package/lib/types/client/undo-toast.d.ts +4 -1
  48. package/lib/types/client/use-archive-detail-reader.d.ts +28 -0
  49. package/lib/types/client/use-archive-panel-controller.d.ts +73 -0
  50. package/lib/types/client/use-archive-query.d.ts +29 -0
  51. package/lib/types/client/use-detail-rail.d.ts +48 -0
  52. package/lib/types/client/use-detail-reader.d.ts +71 -0
  53. package/lib/types/client/use-gated-refresh.d.ts +27 -0
  54. package/lib/types/client/{use-trash-selection.d.ts → use-list-selection.d.ts} +16 -14
  55. package/lib/types/client/use-maintenance.d.ts +11 -7
  56. package/lib/types/client/use-panel-selection.d.ts +38 -0
  57. package/lib/types/client/use-prompt-rail.d.ts +1 -1
  58. package/lib/types/client/use-trash-detail-reader.d.ts +14 -20
  59. package/lib/types/client/use-trash-panel-controller.d.ts +17 -5
  60. package/lib/types/client/write-seats.d.ts +80 -8
  61. package/lib/types/deps.d.ts +7 -4
  62. package/lib/types/{verbs/errors.d.ts → errors.d.ts} +1 -1
  63. package/lib/types/index.d.ts +1 -1
  64. package/lib/types/log/session-log.d.ts +22 -2
  65. package/lib/types/log/zstd-frames.d.ts +8 -1
  66. package/lib/types/ports/fs-port.d.ts +16 -4
  67. package/lib/types/ports/host-port.d.ts +89 -5
  68. package/lib/types/shared/session-path.d.ts +35 -0
  69. package/lib/types/shared/wire.d.ts +205 -27
  70. package/lib/types/trash/archive-detail.d.ts +27 -0
  71. package/lib/types/trash/attachments.d.ts +4 -1
  72. package/lib/types/trash/detail.d.ts +24 -1
  73. package/lib/types/trash/entry.d.ts +23 -8
  74. package/lib/types/trash/groups.d.ts +1 -0
  75. package/lib/types/trash/ledger.d.ts +4 -2
  76. package/lib/types/trash/projection-cache.d.ts +24 -0
  77. package/lib/types/trash/reconcile.d.ts +5 -3
  78. package/lib/types/trash/session-rows.d.ts +83 -0
  79. package/lib/types/trash/shrinking-view.d.ts +30 -0
  80. package/lib/types/verbs/batch-carried.d.ts +4 -2
  81. package/lib/types/verbs/live-admission.d.ts +7 -2
  82. package/lib/types/verbs/member-journal.d.ts +1 -1
  83. package/lib/types/verbs/permanent-removal.d.ts +15 -5
  84. package/lib/types/verbs/restore-session.d.ts +6 -4
  85. package/lib/types/verbs/trash-scope.d.ts +14 -13
  86. package/locale/en.json +7 -6
  87. package/locale/zh.json +2 -1
  88. package/package.json +10 -4
  89. package/lib/types/client/confirm-close.d.ts +0 -14
  90. package/lib/types/client/write-settlement.d.ts +0 -66
  91. package/lib/types/client/write.d.ts +0 -66
package/README.md CHANGED
@@ -1,173 +1,133 @@
1
- # @xrn1997/dsh-session-delete
2
-
3
- [![CI](https://github.com/xrn1997/dsh-session-delete/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/xrn1997/dsh-session-delete/actions/workflows/ci.yml)
4
- [![npm version](https://img.shields.io/npm/v/@xrn1997/dsh-session-delete.svg)](https://www.npmjs.com/package/@xrn1997/dsh-session-delete)
5
- [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
6
- [![Tested with DSH 0.2.0-rc.2 … 0.2.2-rc.1](https://img.shields.io/badge/DSH-0.2.0--rc.2%20%E2%80%A6%200.2.2--rc.1-brightgreen)](#安装)
7
-
8
- 给 DeepSeek Harness(DSH)加一个**删除会话**的能力。DSH 官方有归档、没有删除——归档只是把会话从列表里挪走,文件还在。本插件补上删除,并且让删除可恢复:删除 = 移入回收站,另有一个显式的「彻底删除」。
9
-
10
- ![回收站面板:左列是按项目分组的无边框会话行(行右是恢复/彻底删除图标按钮),右栏是会话信息表、计量行与四档「工作步骤」正文,页脚是整页唯一的实心红按钮「清空回收站…」](docs/screenshots/screenshot-01.png)
11
-
12
- - 安装:`dsh plugin --profile <profile> add @xrn1997/dsh-session-delete`
13
- - 许可:[Apache-2.0](LICENSE)
14
- - 数据:回收站本体留在本机 `$DSH_HOME/session-trash/`(默认 `~/.dsh/session-trash/`),不联网、不上传
15
-
16
- ## 目录
17
-
18
- - [功能特性](#功能特性)
19
- - [安装](#安装)
20
- - [用法](#用法)
21
- - [回收站与数据](#回收站与数据)
22
- - [可调项](#可调项)
23
- - [界面语言](#界面语言)
24
- - [常见问题](#常见问题)
25
- - [开发](#开发)
26
- - [贡献](#贡献)
27
- - [许可](#许可)
28
-
29
- ## 功能特性
30
-
31
- - **删除 = 移入回收站**:会话行「⋯」→「删除」,可随时恢复;删完有一条停 6 秒的撤销提示。删的是当前正打开的会话时,对话会随删除关闭(不会停在「会话不可用」),点撤销会把它重新打开
32
- - **按整组删**:父会话在盘上的子会话与更深后代一起走;任一成员在跑 ⇒ 整组拒绝、零副作用
33
- - **批量删除**:宿主会话列表「⋯」→「多选」,一次确认、一次执行;失败的留在框里可重试,成功的整批撤销
34
- - **回收站面板**:左清单右详情,按项目分组、可折叠、可拖分栏;看得见正文再决定恢复不恢复
35
- - **详情看得到附件**:消息里的图片内联、可点开放大,普通文件给下载 chip;图片加载失败换成占位,不把破图留在屏上(文件下载失败没有页面内提示,浏览器可能把错误响应存成文件)
36
- - **恢复**:单条即点即回,批量带确认;回到各自的原项目目录(删除前你自己归档过的仍保持归档)
37
- - **显式彻底删除**:单条彻底删除(行右的垃圾桶图标)与页脚「清空回收站…」共用同一个二次确认;不自动过期
38
- - **手动清理残留**:插件设置页有一张「维护」卡,随时检查两类残留——父会话已不在的子会话,和 `.dsh` 里已没有任何引用的图片副本;看过数量与体积再由你决定清不清,不自动检查、不自动清理
39
- - **可调项有表单**:插件详情页的「可调项」卡直接改三只旋钮(孤儿预览条数、附件响应上限、JSON 扫描上限),保存写回 profile 的 patch 层;也可以继续直接改 `cordis.patch.yml`
40
- - **失败不吞**:宿主读不到时把原文上屏并给「重试」;不可用时不注册任何入口
41
- - **文案随宿主语言**:中文 / English 挂在宿主 locale 服务上
42
-
43
- ## 安装
44
-
45
- ```bash
46
- dsh plugin --profile <profile> add @xrn1997/dsh-session-delete
47
- dsh plugin --profile <profile> remove @xrn1997/dsh-session-delete
48
- ```
49
-
50
- 装完**重启宿主**(Node 半不走 HMR)。卸载只移除插件,`$DSH_HOME/session-trash/`(默认 `~/.dsh/session-trash/`)下已有的目录不会被自动清理。
51
-
52
- 装法:
53
-
54
- - **npm 安装**(推荐):使用预构建产物,秒装、无需构建授权。
55
- - **GitHub Release 装**(不依赖本包在 npm 上的发布,也不需要构建工具链):发版工作流在 `V*` tag 上产出预构建 tarball。装最新 Release:
56
- `dsh plugin --profile <profile> add https://github.com/xrn1997/dsh-session-delete/releases/latest/download/dsh-session-delete.tgz`
57
- 钉版本就换成 `https://github.com/xrn1997/dsh-session-delete/releases/download/V<版本>/xrn1997-dsh-session-delete-<版本>.tgz`;tarball 自带 `lib/`,装的是预构建产物,宿主能否挂载仍由兼容闸与真机验证决定。宿主不认 URL 形态的参数时,把 `.tgz` 下到本地再按下面离线分发那条装。Releases 页还没有对应版本时,用 npm 或离线分发。
58
- - **离线分发**:`pnpm pack` 出 tarball 后 `dsh plugin --profile <profile> add ./xrn1997-dsh-session-delete-<版本>.tgz`(scoped 包的文件名带作者段)。包里带预构建产物(`prepack` 会替你跑 `build`),这条路不需要为构建脚本授权。
59
-
60
- **兼容性分两层,别混**:
61
-
62
- - **装得上**由 `package.json` 的 `engines.dsh` 决定:宿主拿运行中的版本比这个区间,不满足即拒绝并回滚。窗口是 **`>=0.1.7-rc.2 <0.3.0-0`**(预发布版本参与匹配)。地板由两件硬依赖定:`sidebar.session.row.leading`(0.1.7-rc.2 首现)与 `workspaceRegistry.unarchiveSession`;`0.1.7-rc.2` 是第一个同时具备全部所需槽位与服务方法的代次,CLI 台架验过四个槽位齐全、激活零错误。更低的 `0.1.7-rc.1` 缺行首勾选槽位;0.1.7-alpha、0.1.6、0.1.5 还缺会话行菜单/行尾槽位或 `unarchiveSession`,**不要装**。
63
- - **真跑过**由 `xrn1997.dshReleases` 记录,只列桌面真机实测过的宿主:**DSH Desktop 0.2.0-rc.2、0.2.1-rc.1、0.2.1-rc.2、0.2.1-rc.3、0.2.1-rc.5、0.2.2-rc.1**(均 `compatible`)。窗口内的其他代次装得上但没在桌面真机上验过,不作为推荐目标;窗口外的一律拒装。
64
- - **部署注意**:exact Fetch 路由的 owner principal 校验(非 owner 回 403)自 `0.2.1-alpha.3` 起才有;更早的代次(含 `0.2.0-rc.2`)只有宿主 `/api` 的 trusted-host / 浏览器认证。单机 web / 桌面标准组合可用;要跑多 Peer 部署,优先名单里带这道校验的实测代次(`0.2.1-rc.1` 起)。
65
-
66
- ## 用法
67
-
68
- **删一条**:会话行「⋯」→「删除」→ 确认框。确认框在点之前就说明**这一组**的规模(「含 N 个子会话,将一起移入回收站」,N>0 才出现),删完那条提示点「撤销」即恢复。
69
-
70
- ![会话行的「⋯」菜单:宿主原有动作之后,本插件加了「多选」与红色的「删除」两行](docs/screenshots/screenshot-02.png)
71
-
72
- 删除按**整组**走:父会话在盘上的子会话与更深后代一起移走(传递闭包,一层层取到底)——那些行宿主本来就不显示。这里的子会话只指宿主 `origin:"subagent"` 的会话;用「在新对话中分支」产生的普通 fork 是独立会话,删父、恢复都不动它。任一成员在跑(**包括列表里看不见的子会话**)⇒ 整组拒绝、零副作用,报的是那个运行中的 id;本插件不替用户终止正在进行的活。
73
-
74
- **删一批**:会话行「⋯」→「多选」进入显式模式。模式内点整行勾选/取消且**不切换会话**,行首出勾选框,浮条常驻(0 条也给退出入口),同一位置在「全选 / 取消全选」之间切换。确认框逐条列出这批会话,执行是一次批量请求:部分失败不关框、原文落在失败那一行,按钮变成「重试这 N 条」,成功的 6 秒内可整批撤销。
75
-
76
- ![批量删除模式:两行已勾选,浮条显示「已选 2 条」与展开的已选清单,动作是「移入回收站 2 条」与「退出多选」](docs/screenshots/screenshot-03.png)
77
-
78
- **管回收站**:侧栏面板里的「回收站」一行(与「插件」同层)。左清单右详情(中央列更窄时改成下钻,「← 返回清单」回来),按项目分组、组头可折叠、两栏之间那根线可拖。详情按块展示这条会话的对话全量:你的提问、宿主注入的上下文、助手文字与思考、工具调用与结果、系统消息与压缩摘要。工作步骤有四档(简洁 / 标准 / 详细 / 完全展开),默认「标准」把连续的过程块收成「工作步骤」一行,点开仍逐条折叠;长会话有更早页时正文工具栏出「加载更早」,点一次取一页;右缘常驻一道「提问」轨,一句提问一格,悬停出预览、点一下跳到那句(没加载的会先补页),简洁档里补回来的整页过程块被藏起来时也会自动继续往前翻。助手文字与思考按 Markdown 排版,你的提问保持原话。跟着父会话一起进来的子会话不占清单行,入口在父详情的「子会话」段(默认收起成一行摘要,点开才列出孩子):点一条即切到那个孩子的详情(会话信息、正文与分页同一套),头部「← 返回父会话」回到父。
79
-
80
- - **恢复**:单条不需要确认框,放回原项目目录(删除前你自己归档过的仍保持归档;旧版本留下的归档态条目会迁移式取消归档)。原工作区已被删掉也照常恢复(跳过账本挂接,恢复后在宿主的会话列表里归入「未分组」);回收站清单把这些条目直接归在「未分组」组里,点之前就看得见。
81
- - **批量恢复 / 批量彻底删除**:工具栏「多选」进入,页脚换成两颗动作按钮。组头那颗是**三态**勾选框,点它选上这个项目的全部会话(含折叠起来看不见的)。两者都先确认,逐条执行、失败不连坐,失败的原文留在它自己那行。
82
- - **彻底删除 / 清空**:共用同一个二次确认。单条那张卡片报的是**这一次会释放多少**(父 + 跟着进来的孩子 + 仍留在盘上的后代,与头部合计共用同一算式)。「清空回收站…」先把回收站目录与清单对账一遍再清,所以手工搬进 `session-trash/` 的**认得出**的目录也归它管;认不出的外人目录不动也不列。
83
- - **残留维护在插件设置页**:父会话已不在(既不在会话列表、也不在回收站清册)的子会话宿主客户端整排不显示,回收站里也不会有;`.dsh` 附件库里也可能留下没有任何引用的图片副本。插件详情页的「维护」卡分「孤儿会话」「孤儿附件」两段,都是**手动**:点「检查」只读,看过数量、体积与图片缩略图再确认清理,清完自动重查;永久删除、不搬进回收站、**绝不自动跑**。回收站面板不再扫描残留,顶上只保留彻底删除 / 清空之后的附件清理提示。
84
-
85
- ## 回收站与数据
86
-
87
- | 东西 | 位置 |
88
- | --- | --- |
89
- | 回收站本体 | `$DSH_HOME/session-trash/<时间戳>-<原目录名>/`(默认 `~/.dsh/session-trash/…`) |
90
- | 回收站清单 | 本插件自己的 storage domain(介质在 `$DSH_HOME/storages/`,默认 `~/.dsh/storages/`) |
91
-
92
- - 回收站与 `$DSH_HOME/sessions/`(默认 `~/.dsh/sessions/`)**同卷**:搬进搬出靠整目录 `rename`,原子、瞬时。
93
- - **一格目录 = 一个会话**:父会话与跟着它进来的子会话各占一格,面板上折成一行。手工翻回收站目录时看到比清单多的目录,那是子会话。
94
- - **清单丢了不致命**:会话文件自描述,解压后第一行即 header,含 `id` 与 `cwd`;读取回收站列表(以及清空、恢复、彻底删除与清理无主子会话前)会先与回收站目录对账。
95
- - **不自动过期**:不设天数上限,清空是显式动作;界面显示条数与共可释放量(与彻底删除确认同一口径)。
96
- - **附件**:宿主把对话里的图片/文件副本存在 `$DSH_HOME/attachments/v1`。彻底删除会话时,只清理**只被这些会话引用**的图片副本;共享副本保留,你磁盘上的原图不受影响。普通文件附件目前只渲染、不代删。设置页「维护」卡的「孤儿附件」段可以手动清掉 `.dsh` 里已经没有任何引用的图片副本,同样只动这些副本、源文件不受影响、共享引用保留。
97
- - **无主子会话不在回收站里**:它们的父会话已不存在;清理只清会话目录与会话独占的图片副本(宿主投影缓存不包含在内,共享图片保留,你磁盘上的原图不受影响)。检查与清理都在插件设置页的「维护」卡里手动发起。
98
- - 回收站本体留在本机、不联网、不上传。
99
-
100
- ## 可调项
101
-
102
- 三只旋钮都有默认值;可以在宿主 profile 的 `cordis.patch.yml` 里改,也可以在插件设置页的「可调项」卡里改,都不需要改代码:
103
-
104
- | 键 | 默认值 | 作用 |
105
- | --- | --- | --- |
106
- | `orphanPreviewLimit` | `200` | 设置页「孤儿附件」预览清单的条数(数量与字节仍按全量报告) |
107
- | `maxAttachmentBytes` | `20971520`(20 MiB) | `GET /attachment` 单次响应的字节上限 |
108
- | `maxJsonRefBytes` | `10485760`(10 MiB) | 附件引用扫描里单个 JSON 引用源的字节上限 |
109
-
110
- ```yaml
111
- - insert:
112
- - id: xrn1997-session-delete
113
- name: '@xrn1997/dsh-session-delete'
114
- config:
115
- orphanPreviewLimit: 200
116
- maxAttachmentBytes: 20971520
117
- maxJsonRefBytes: 10485760
118
- ```
119
-
120
- 0.6.1 及以前的行 id 是 `session-delete`;如果你的 profile 覆盖过这一行,升级后请把 id 同步成
121
- `xrn1997-session-delete`,否则那份覆盖不再命中本行。
122
-
123
- 配置在插件激活时归一;未知键、非整数或越界会让这一条激活失败(不会用半套配置启动)。宿主的字段投影仍不认这枚手写的 Standard Schema(0.2.2-rc.1 实测 `Config.listConfigs` 回 `status: unsupported`),所以字段表单由插件设置页的「可调项」卡提供([ADR-0043](docs/adr/0043-options-form-through-config-route.md)):三只数字输入 + 保存,写回 profile 的 patch 层(宿主的 `configEditor.edit`,保存后这一行会重启)。也可以继续直接改 `cordis.patch.yml`,两条路改的是同一份配置。
124
-
125
- ## 界面语言
126
-
127
- 中文 / English 挂在宿主自己的 locale 服务上,跟随设置的界面语言;服务不可用时退回内置中文。
128
-
129
- ## 常见问题
130
-
131
- **装完侧栏没有「回收站」,会话菜单里也没有「删除」?**
132
-
133
- 先重启宿主。若仍没有,确认这一代宿主上本插件激活过——取数通道探测不过时,本插件一个入口都不注册:页面上看不出它的存在,但也不会因此把宿主拖死。这是有意用「入口不出现」表达不可用,不是禁用态。
134
-
135
- **删完之后侧栏那一行怎么还在?**
136
-
137
- 本插件只在**宿主确实不再列它**时才通告客户端把那一行去掉;拿不准时宁可沉默(那时说「已移除」是假话)。刚巧遇上就刷新页面,那一行会自己消失。本机运行期没打开过的**冷会话**走正常路径,删完即走。
138
-
139
- **正在运行的会话为什么删不掉?**
140
-
141
- 判据用的是宿主自己的活跃检查(与官方归档的准入同源)。一律拒绝,不替用户终止正在进行的活——先停下这个会话再删。**它正在跑的子会话也算**:报告的是那个子会话的 id,而那一行宿主的列表里不显示,所以别看列表就以为删得掉。
142
-
143
- **批量删除/恢复为什么只成功了一部分?**
144
-
145
- 执行是逐条的,失败不会连坐。批量删除的确认框不关,原文留在失败那一行,按钮变成「重试这 N 条」;批量恢复失败的条目留在清单自己那行,多选态保持,成功的已经消失。重试只处理失败名单。
146
-
147
- **把工作区删了,回收站里的会话还能恢复吗?**
148
-
149
- 能。宿主的「删除工作区」只删注册、保留目录和每个会话日志;恢复照常回盘,只是跳过账本挂接,会话落在「未分组」。回收站清单里这类条目归在「未分组」组,批量恢复确认框也会逐条说明。
150
-
151
- **我把会话目录从回收站手工搬回 `sessions/` 了,为什么列表里没有?**
152
-
153
- 回收站目录只负责文件;恢复还要挂回工作区账本(旧版本留下的归档态条目会迁移式取消归档)。手工搬回不是恢复,下一次读清单会把对应行对账掉。请在面板里点「恢复」。
154
-
155
- **把宿主绑到局域网地址后,插件入口不出现,或操作报「需要宿主的 Web 身份」/「非受信来源」?**
156
-
157
- 本插件把十段注册到宿主的 exact Fetch 路由(`/api/dsh-session-delete-api/...`),取数门槛就是宿主 `/api` 的那一套:浏览器、桌面壳的请求转发与本机 `curl` 都需要宿主签发的 Web 身份(`dsh web` 那次访问换来的 cookie),不再有回环免身份,也没有旧前缀 fallback。支持面是 web UI 与桌面端,二者都装 `client-connection`;入口探测回 401/403 时插件不注册任何入口(页面表现为插件不存在),不会摆出一个点下去必然失败的入口;操作中途身份失效,原文「需要宿主的 Web 身份」上屏。原文写「非受信来源」说的是另一件事:这条请求的归属不成立,`Host` 不被认为是本次部署的地址,或 `Origin` 与它对不上(宿主 `/api` 查 Host / `sec-fetch-site` / Origin;附件字节段另有插件的同源取数闸,同站/跨站页面与 authority 对不上的 `Origin` / `Referer` 都拒)。常见成因有两种:用自定义域名(含 hosts 文件)访问,却没把它写进宿主 `client-connection` 的 `trustedHosts`——宿主自己的页面同样要求这一条;或者反向代理改写了 `Host`,它必须保留客户端的原始 `Host`。绑定时另有一条前提:宿主只接受具体接口地址、拒绝 `0.0.0.0`,请绑到某个具体 IP(例如 `webserver.host: 192.168.50.199`)。
158
-
159
- ## 开发
160
-
161
- 构建、本地调试、门控、真机验证与发版见 [`docs/development.md`](docs/development.md);提交信息与 PR 约定见 [`CONTRIBUTING.md`](CONTRIBUTING.md);架构地图与主人清单见 [`docs/architecture.md`](docs/architecture.md);界面规格见 [`docs/ui-spec.md`](docs/ui-spec.md);文档分层与放置见 [`docs/AGENTS.md`](docs/AGENTS.md);裁决见 [`docs/adr/`](docs/adr/README.md);发布历史见 [`CHANGELOG.md`](CHANGELOG.md)。历史取舍在 git 历史里,README 不复述。
162
-
163
- ## 贡献
164
-
165
- 欢迎 Issue 与 PR。提交信息、PR 约定与发版边界见 [`CONTRIBUTING.md`](CONTRIBUTING.md);提交前按 [`docs/development.md`](docs/development.md) 的「复核门」跑 `pnpm test` 与 `pnpm typecheck`,并确认退出码;提交即表示你同意以 [Apache-2.0](LICENSE) 协议授权你的贡献。
166
-
167
- ## 许可
168
-
169
- [Apache-2.0](LICENSE)。
170
-
171
- 图标形状、控件与 Markdown 样式派生自 DeepSeek Harness 的 MIT 许可代码,`lib/client.js` 另内联了
172
- `react-markdown` / `remark-gfm` 及其传递依赖(MIT / ISC);来源、落点与许可全文见
173
- [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md)。
1
+ # @xrn1997/dsh-session-delete
2
+
3
+ [![CI](https://github.com/xrn1997/dsh-session-delete/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/xrn1997/dsh-session-delete/actions/workflows/ci.yml)
4
+ [![npm version](https://img.shields.io/npm/v/@xrn1997/dsh-session-delete.svg)](https://www.npmjs.com/package/@xrn1997/dsh-session-delete)
5
+ [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
6
+ [![Tested with DSH 0.2.0-rc.2 … 0.2.2-rc.3](https://img.shields.io/badge/DSH-0.2.0--rc.2%20%E2%80%A6%200.2.2--rc.3-brightgreen)](#兼容性)
7
+
8
+ > **DeepSeek Harness(DSH)会话回收站插件** —— DSH 原生只有「归档」没有「删除」。本插件补上可恢复的删除:删除即移入本地回收站,随时还原;彻底删除是另一件显式动作。
9
+
10
+ ![回收站面板:顶部是「回收站 | 归档」平级分段;左列是按项目分组的无边框会话行(行右是恢复 / 彻底删除图标按钮),右栏是会话信息表、计量行、收起成摘要条的子会话段与四档「工作步骤」正文,右缘是提问轨,页脚是整页唯一的实心红按钮「清空回收站…」](docs/screenshots/screenshot-01.png)
11
+
12
+ - 安装:`dsh plugin --profile <profile> add @xrn1997/dsh-session-delete`(装完重启宿主)
13
+ - 许可:[Apache-2.0](LICENSE) · 运行环境:`Node.js >= 24` · 兼容性见[下文](#兼容性)
14
+ - 数据:回收站留在本机 `$DSH_HOME/session-trash/`(默认 `~/.dsh/session-trash/`),不联网、不上传
15
+
16
+ ## 核心特性
17
+
18
+ - **删除 = 移入回收站**:会话行「⋯」→「删除」并确认后,会话移入回收站,同时出现一条停 6 秒的「撤销」;删掉正打开着的会话时对话随删除关闭,点撤销会重新打开
19
+ - **按整组删**:父会话与它的子代理后代一起移入回收站,任一会话在跑就整组拒绝、零副作用(「在新对话中分支」出来的 fork 是独立会话,不受影响)
20
+ - **批量操作**:宿主会话列表「⋯」→「多选」一次确认批量移入回收站,成功的 6 秒内可整批撤销;回收站面板里另有「多选」,可批量恢复或批量彻底删除。部分失败不连坐,失败的留在原位可重试
21
+ - **回收站面板**:左侧清单右侧详情、按项目分组、分栏可拖;「归档」档与回收站平级,已归档会话可只读预览、一步解除归档或删除
22
+ - **看得见正文再决定**:详情完整还原对话(提问、助手文字与思考、工具调用与结果、注入上下文,以及系统消息与上下文压缩标记),长会话可「加载更早」分页;正文有「简洁 / 标准 / 详细 / 完全展开」四档,默认「标准」把连续过程块收成一行「工作步骤」、点开仍逐条折叠;右缘「提问轨」在有提问时出现、一点跳到那句;子会话收起成摘要条,点开可进孩子详情、返回父会话;图片可点开放大,文件给下载控件
23
+ - **显式彻底删除**:单条彻底删除与「清空回收站…」都带二次确认;单条报出这一次会释放多少,批量报条数,清空只报不可恢复;**永不自动过期**
24
+ - **手动维护**:插件设置页的「维护」卡检查并清理三类残留——「孤儿会话」「孤儿附件」「投影缓存」;看过检查结果再决定清不清,不自动扫描、不自动清理
25
+ - **可调项有表单**:设置页「可调项」卡直接改三只旋钮,也可以在 profile 的 `cordis.patch.yml` 里改
26
+ - **多语言与容错**:界面文案跟随宿主语言(中文 / English,服务不可用时回退内置中文);数据通道探测不过时不注册任何入口,失败原文上屏、可重试
27
+
28
+ ## 安装
29
+
30
+ ```bash
31
+ dsh plugin --profile <profile> add @xrn1997/dsh-session-delete
32
+ ```
33
+
34
+ 装完**重启宿主**(Node 半不走热重载)。三种装法任选:
35
+
36
+ - **npm**(推荐):使用预构建产物,秒装、无需构建授权
37
+ - **GitHub Release**(备选;URL 形态的 `add` 在桌面 0.2.2-rc.3 实测**不通**——宿主把它交给 bundled pnpm 拉 tarball 会失败,请改用下面的**离线分发**):`dsh plugin --profile <profile> add https://github.com/xrn1997/dsh-session-delete/releases/latest/download/dsh-session-delete.tgz`;钉版本就把地址换成 `https://github.com/xrn1997/dsh-session-delete/releases/download/V<版本>/xrn1997-dsh-session-delete-<版本>.tgz`
38
+ - **离线分发**:`pnpm pack` 出 tarball 后 `dsh plugin --profile <profile> add ./xrn1997-dsh-session-delete-<版本>.tgz`
39
+
40
+ 卸载只移除插件:`dsh plugin --profile <profile> remove @xrn1997/dsh-session-delete`。`$DSH_HOME/session-trash/` 里已有的回收站不会被自动清理。
41
+
42
+ ## 兼容性
43
+
44
+ - **装得上**:由 `package.json` 的 `engines.dsh` 表达,窗口是 **`>=0.1.7-rc.2 <0.3.0-0`**(预发布版本参与匹配);窗口外没有支持面。当前宿主安装器与加载器并不强制校验这份声明(ADR-0046),别把窗口当成运行期保证
45
+ - **真跑过**:桌面真机实测名单是 **DSH Desktop 0.2.0-rc.2、0.2.1-rc.1、0.2.1-rc.2、0.2.1-rc.3、0.2.1-rc.5、0.2.2-rc.1、0.2.2-rc.2、0.2.2-rc.3**;窗口内的其他版本没实测过,不作为推荐目标
46
+ - **多 Peer 部署**:接口的 owner 校验(非 owner 回 403)自 `0.2.1-alpha.3` 起才有;要跑多 Peer,优先选名单里 `0.2.1-rc.1` 起的实测代次
47
+
48
+ ## 使用指南
49
+
50
+ **删一条**:会话行「⋯」→「删除」,确认后这条会话所在的组(含子会话)移入回收站;删完点顶部提示条里的「撤销」即恢复。正在运行的会话,本行菜单里的「删除」置灰(显示「删除(运行中)」);**列表里看不见的子会话在跑也算**——菜单只看本行状态,点下去会由服务端整组拒绝,并回原文。
51
+
52
+ ![会话行的「⋯」菜单:宿主原有动作之后,本插件加了「多选」与红色的「删除」两行](docs/screenshots/screenshot-02.png)
53
+
54
+ **删一批**:「⋯」→「多选」进入批量模式,勾选多条后点浮条里的「移入回收站」一次完成。
55
+
56
+ ![批量删除模式:两行已勾选,浮条显示「已选 2 条」与展开的已选清单,动作是「移入回收站 2 条」与「退出多选」](docs/screenshots/screenshot-03.png)
57
+
58
+ **浏览与恢复**:侧栏常驻的「回收站」入口进两栏面板(窄屏下钻),顶部可切换「回收站 | 归档」两档。左列按项目分组、展开或勾选条目,右侧实时预览正文;点「恢复」送回原项目(原工作区不在了就归入「未分组」),点「彻底删除」或页脚「清空回收站…」永久释放空间——两者共用二次确认。归档档里可一步解除归档;删除归档会话后撤销,回到的是「归档」而不是会话列表。
59
+
60
+ ## 数据存储与安全
61
+
62
+ | 项目 | 说明 |
63
+ | :--- | :--- |
64
+ | **本地回收站** | `$DSH_HOME/session-trash/`(默认 `~/.dsh/session-trash/`),与会话目录同卷;搬进搬出是整目录重命名,原子、瞬时 |
65
+ | **回收站清单** | 本插件自己的存储域(介质在 `$DSH_HOME/storages/`);会话文件自带 `id` 与 `cwd`,清单丢了也不影响识别与恢复,读取前会自动与回收站目录对账 |
66
+ | **保留期限** | **永不自动过期**,无天数或容量上限;释放空间是显式动作 |
67
+ | **附件** | 移入回收站不碰附件;彻底删除只清理仅被这些会话引用的 `.dsh` 内图片副本——共享副本保留、你磁盘上的源文件不受影响;普通文件附件只渲染、不代删。对象在 `.dsh/attachments/v1/objects/` |
68
+ | **投影缓存** | 宿主的会话投影缓存只写不删:永久删除会顺手带走被删会话自己的缓存记录;以前删剩的孤儿记录由设置页「维护」卡手动检查与清理(派生数据,可重建) |
69
+ | **网络** | 全程本地,不联网、不上传 |
70
+
71
+ ## 可调项
72
+
73
+ 三只旋钮都有默认值,可以在插件设置页的「可调项」卡里改,也可以在 profile 的 `cordis.patch.yml` 里改,都不用改代码:
74
+
75
+ | 键 | 默认值 | 作用 |
76
+ | --- | --- | --- |
77
+ | `orphanPreviewLimit` | `200` | 「孤儿附件」预览清单的条数(数量与字节仍按全量报告) |
78
+ | `maxAttachmentBytes` | `20971520`(20 MiB) | 附件单次读取的字节上限 |
79
+ | `maxJsonRefBytes` | `10485760`(10 MiB) | 附件引用扫描里单个 JSON 引用源的字节上限 |
80
+
81
+ ```yaml
82
+ - insert:
83
+ - id: xrn1997-session-delete
84
+ name: '@xrn1997/dsh-session-delete'
85
+ config:
86
+ orphanPreviewLimit: 200
87
+ maxAttachmentBytes: 20971520
88
+ maxJsonRefBytes: 10485760
89
+ ```
90
+
91
+ 配置在插件激活时归一:未知键、非整数或越界会让这一条激活失败(不会用半套配置启动)。
92
+
93
+ ## 常见问题
94
+
95
+ **装完侧栏没有「回收站」,会话菜单里也没有「删除」?**
96
+ 先重启宿主(Node 半不走热重载)。若仍没有,说明这台宿主没通过数据通道探测——插件会主动隐藏全部入口,这是有意的「不可用」表达,不影响宿主稳定性。
97
+
98
+ **删除会话后,侧栏那一行没有立刻消失?**
99
+ 插件只在确认宿主列表已真正移除后才移除行;遇到短暂残留,刷新页面即可。
100
+
101
+ **正在运行的会话为什么删不掉?**
102
+ 本行菜单项会置灰(「删除(运行中)」);列表里看不见的子会话在跑时,菜单看不出来,点下去由服务端整组拒绝并回原文。插件不替你终止正在跑的任务,先停止再删。
103
+
104
+ **批量删除/恢复只成功了一部分?**
105
+ 执行逐条进行、失败不连坐。失败的留在原位并显示原文,按钮变成「重试这 N 条」;重试只处理失败名单。
106
+
107
+ **把工作区删了,回收站里的会话还能恢复吗?**
108
+ 能。恢复照常回盘,只是跳过账本挂接,会话在宿主列表里归入「未分组」;回收站清单里这类条目也归在「未分组」组。
109
+
110
+ **点文件下载失败,页面没有提示?**
111
+ 下载走浏览器原生下载:宿主回错误响应时,浏览器可能把错误页存成文件、页面内拿不到失败原因(这是浏览器下载行为,不是插件把错误吞了)。换一条能下载的会话/文件,或直接从会话目录取原件。
112
+
113
+ **把会话目录手工搬回 `sessions/` 了,为什么列表里没有?**
114
+ 手工搬回不是恢复,下一次读清单会把那一行对账掉;请在面板里点「恢复」。
115
+
116
+ **在局域网 IP 或自定义域名下访问 Web 端,插件入口不出现或提示校验异常?**
117
+ 插件路由的身份校验托管于宿主:访问用的域名 / IP 要写进宿主 `client-connection` 的 `trustedHosts`,反向代理要保留客户端原始 `Host`,绑定地址用具体 IP 而不是 `0.0.0.0`。附件字节段另有插件的同源取数闸:同站 / 跨站页面与 authority 对不上的 `Origin` / `Referer` 会被拒(403 信封)。身份失效时原文是「需要宿主的 Web 身份」,请求归属不成立时是「非受信来源」。
118
+
119
+ ## 开发与文档
120
+
121
+ ```bash
122
+ pnpm install
123
+ pnpm gates # 类型检查 + Lint + 单测 + 构建 + 打包预检
124
+ ```
125
+
126
+ 更多工程细节:[开发与调试](https://github.com/xrn1997/dsh-session-delete/blob/main/docs/development.md) · [系统架构](https://github.com/xrn1997/dsh-session-delete/blob/main/docs/architecture.md) · [界面规格](https://github.com/xrn1997/dsh-session-delete/blob/main/docs/ui-spec.md) · [更新日志](https://github.com/xrn1997/dsh-session-delete/blob/main/CHANGELOG.md) · [决策记录](https://github.com/xrn1997/dsh-session-delete/blob/main/docs/adr/README.md)
127
+
128
+ ## 贡献与许可
129
+
130
+ 欢迎提交 Issue 与 PR,参与前请先阅读 [CONTRIBUTING.md](https://github.com/xrn1997/dsh-session-delete/blob/main/CONTRIBUTING.md)。
131
+
132
+ - 主体代码基于 [Apache-2.0](LICENSE) 协议开源。
133
+ - 部分 UI 与 Markdown 渲染控件派生自 DeepSeek Harness(MIT 协议),内联第三方依赖许可声明见 [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)。
@@ -131,8 +131,10 @@
131
131
 
132
132
  ### MIT
133
133
 
134
- 本节适用于第 1 节的抄本(版权人 `DeepSeek`,`Copyright (c) 2026 DeepSeek`)与第 2 节表格里的
135
- 构建期依赖(版权人见上表,各包 LICENSE 原文)。
134
+ 本节只适用于第 1 节的抄本(版权人 `DeepSeek`,`Copyright (c) 2026 DeepSeek`)。
135
+ 第 2 节表格里的构建期依赖各自由其版权人按各自的许可证授权:**版权行与许可原文以各包随 npm
136
+ 包分发的 `LICENSE` 文件为准**(`node_modules/<包>/LICENSE`;`pnpm licenses list --dev` 可按
137
+ lockfile 复核)。本文件列出闭包清单与作者,不把上游版权行改写成 DeepSeek 的版权行。
136
138
 
137
139
  ```text
138
140
  MIT License
package/docs/DETAIL.md ADDED
@@ -0,0 +1 @@
1
+ ![Trash panel illustration: session rows grouped by project in the left column (restore and delete-forever buttons at each row's right), session info, the "Work steps" bar and a conversation preview in the right column, and the page's only solid red "Empty trash…" button in the footer](preview.svg)
@@ -0,0 +1 @@
1
+ ![回收站面板示意:左列是按项目分组的会话行(行右是恢复与彻底删除按钮),右栏是会话信息与「工作步骤」折叠条和对话预览,页脚是整页唯一的实心红按钮「清空回收站…」](preview.zh.svg)
@@ -0,0 +1,119 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="640" height="300" viewBox="0 0 640 300">
2
+ <!--
3
+ Illustration for the plugin detail page (`docs/DETAIL.md` links it as a Markdown image).
4
+
5
+ Both palettes live in the table below: light is the default, dark is a whole-table override
6
+ under `prefers-color-scheme`. The host ThemePresenter writes the resolved theme to
7
+ `documentElement.style.colorScheme`, which is what the media query sees when this file is
8
+ loaded as an `<img>` (same mechanism as `icon.svg`). Never inline a literal color in an
9
+ element here: the illustration would stay a light block in dark mode. Dark values follow the
10
+ host's dark alias palette (bg-base / bg-layer / border / label-primary·secondary·tertiary /
11
+ caption / state-error-primary); panel and strokes are slightly tuned for the illustration.
12
+ Brand and danger stay the same in both modes so accents remain legible.
13
+ -->
14
+ <style>
15
+ text{font-family:'Segoe UI','Helvetica Neue',Arial,'WenQuanYi Zen Hei',sans-serif}
16
+ .page{fill:#F5F6FC}
17
+ .panel{fill:#FFFFFF;stroke:#E6EBF7}
18
+ .rule{stroke:#EDF1F9}
19
+ .row{fill:#FFFFFF}
20
+ .sel{fill:#EEF2FF}
21
+ .bubble{fill:#E8EDFF}
22
+ .chip{fill:#F5F6FC}
23
+ .icon-hit{fill:#F5F6FC}
24
+ .icon{stroke:#7A859E}
25
+ .ink1{fill:#1F2A44}
26
+ .ink2{fill:#38425A}
27
+ .ink3{fill:#7A859E}
28
+ .ink4{fill:#ACB5CF}
29
+ .stroke4{stroke:#ACB5CF}
30
+ .brand{fill:#4D6BFE}
31
+ .danger{fill:#E5484D}
32
+ .on-danger{fill:#FFFFFF}
33
+ @media (prefers-color-scheme: dark){
34
+ .page{fill:#151517}
35
+ .panel{fill:#1E1E20;stroke:#33363B}
36
+ .rule{stroke:#2F3237}
37
+ .row{fill:#1E1E20}
38
+ .sel{fill:#353638}
39
+ .bubble{fill:#2C2C2E}
40
+ .chip{fill:#232325}
41
+ .icon-hit{fill:#26272B}
42
+ .icon{stroke:#ADB2B8}
43
+ .ink1{fill:#F9FAFB}
44
+ .ink2{fill:#CFD3D6}
45
+ .ink3{fill:#ADB2B8}
46
+ .ink4{fill:#81858C}
47
+ .stroke4{stroke:#81858C}
48
+ .danger{fill:#F25A5A}
49
+ }
50
+ </style>
51
+ <rect class="page" width="640" height="300"/>
52
+ <!-- Trash panel -->
53
+ <rect class="panel" x="28" y="22" width="584" height="256" rx="14"/>
54
+ <!-- Header: Trash | Archive -->
55
+ <text class="ink1" x="48" y="50" font-size="13" font-weight="600">Trash 12</text>
56
+ <rect class="brand" x="46" y="57" width="58" height="3" rx="1.5"/>
57
+ <text class="ink4" x="118" y="50" font-size="13">Archive 3</text>
58
+ <line class="rule" x1="44" y1="68" x2="248" y2="68"/>
59
+ <!-- Left: session rows grouped by project -->
60
+ <path class="ink4" d="M47 78h6l2 2h7v8H47z"/>
61
+ <text class="ink3" x="65" y="88" font-size="11">product-site</text>
62
+ <rect class="sel" x="40" y="94" width="210" height="26" rx="8"/>
63
+ <text class="ink1" x="52" y="111" font-size="12">Design review</text>
64
+ <rect class="row" x="40" y="124" width="210" height="26" rx="8"/>
65
+ <text class="ink2" x="52" y="141" font-size="12">Landing page copy</text>
66
+ <path class="ink4" d="M47 160h6l2 2h7v8H47z"/>
67
+ <text class="ink3" x="65" y="170" font-size="11">cli-tooling</text>
68
+ <rect class="row" x="40" y="176" width="210" height="26" rx="8"/>
69
+ <text class="ink2" x="52" y="193" font-size="12">Release script triage</text>
70
+ <rect class="row" x="40" y="206" width="210" height="26" rx="8"/>
71
+ <text class="ink2" x="52" y="223" font-size="12">Copy localization</text>
72
+ <!-- Row actions: restore / delete forever -->
73
+ <g class="icon" fill="none" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round">
74
+ <circle class="icon-hit" cx="206" cy="107" r="8" stroke="none"/>
75
+ <path d="M210 106h-5.6q-2.6 0-2.6 2.8"/>
76
+ <path d="M200.2 107.2l1.6 1.8 1.6-1.8"/>
77
+ <circle class="icon-hit" cx="228" cy="107" r="8" stroke="none"/>
78
+ <path d="M225 105.5h6M226.4 105.5v-.8h3.2v.8M225.8 105.5l.5 4h3.4l.5-4"/>
79
+ <circle class="icon-hit" cx="206" cy="137" r="8" stroke="none"/>
80
+ <path d="M210 136h-5.6q-2.6 0-2.6 2.8"/>
81
+ <path d="M200.2 137.2l1.6 1.8 1.6-1.8"/>
82
+ <circle class="icon-hit" cx="228" cy="137" r="8" stroke="none"/>
83
+ <path d="M225 135.5h6M226.4 135.5v-.8h3.2v.8M225.8 135.5l.5 4h3.4l.5-4"/>
84
+ <circle class="icon-hit" cx="206" cy="189" r="8" stroke="none"/>
85
+ <path d="M210 188h-5.6q-2.6 0-2.6 2.8"/>
86
+ <path d="M200.2 189.2l1.6 1.8 1.6-1.8"/>
87
+ <circle class="icon-hit" cx="228" cy="189" r="8" stroke="none"/>
88
+ <path d="M225 187.5h6M226.4 187.5v-.8h3.2v.8M225.8 187.5l.5 4h3.4l.5-4"/>
89
+ <circle class="icon-hit" cx="206" cy="219" r="8" stroke="none"/>
90
+ <path d="M210 218h-5.6q-2.6 0-2.6 2.8"/>
91
+ <path d="M200.2 219.2l1.6 1.8 1.6-1.8"/>
92
+ <circle class="icon-hit" cx="228" cy="219" r="8" stroke="none"/>
93
+ <path d="M225 217.5h6M226.4 217.5v-.8h3.2v.8M225.8 217.5l.5 4h3.4l.5-4"/>
94
+ </g>
95
+ <!-- Column divider -->
96
+ <line class="rule" x1="262" y1="22" x2="262" y2="278"/>
97
+ <!-- Right: session info and work steps -->
98
+ <text class="ink1" x="284" y="52" font-size="15" font-weight="600">Design review</text>
99
+ <text class="ink3" x="284" y="80" font-size="11">Project</text>
100
+ <text class="ink2" x="352" y="80" font-size="11">product-site</text>
101
+ <text class="ink3" x="284" y="100" font-size="11">Model</text>
102
+ <text class="ink2" x="352" y="100" font-size="11">DeepSeek-V3</text>
103
+ <text class="ink3" x="284" y="120" font-size="11">Created</text>
104
+ <text class="ink2" x="352" y="120" font-size="11">Nov 8, 14:02</text>
105
+ <text class="ink3" x="284" y="140" font-size="11">Trash dir</text>
106
+ <text class="ink2" x="352" y="140" font-size="11">~/.dsh/session-trash</text>
107
+ <!-- Work steps bar -->
108
+ <rect class="chip" x="284" y="154" width="306" height="26" rx="6"/>
109
+ <text class="ink2" x="298" y="171" font-size="11">Work steps · 3</text>
110
+ <path class="stroke4" d="M568 164l4 4 4-4" fill="none" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>
111
+ <!-- Conversation preview -->
112
+ <rect class="bubble" x="284" y="192" width="200" height="22" rx="7"/>
113
+ <text class="ink2" x="296" y="207" font-size="10.5">Fix the release script</text>
114
+ <rect class="chip" x="284" y="222" width="306" height="20" rx="7"/>
115
+ <text class="ink3" x="296" y="236" font-size="10">Updated three settings, added rollback notes…</text>
116
+ <!-- Footer: the page's only solid red button -->
117
+ <rect class="danger" x="486" y="244" width="104" height="28" rx="8"/>
118
+ <text class="on-danger" x="538" y="262" font-size="11" text-anchor="middle">Empty trash…</text>
119
+ </svg>
@@ -0,0 +1,117 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="640" height="300" viewBox="0 0 640 300">
2
+ <!--
3
+ 插件详情页的示意插图(`docs/DETAIL.zh.md` 以 Markdown 图片引用)。
4
+
5
+ 两档配色都住下面这张表:浅色档是默认值,深色档由 `prefers-color-scheme` 整组覆盖。
6
+ 宿主 ThemePresenter 会把解析后的主题写到 `documentElement.style.colorScheme`,本图作为
7
+ `<img>` 载入时媒体查询按它求值(机制与 `icon.svg` 同源)——不能在元素上写死颜色,否则
8
+ 深色模式下整张图仍是一块浅色画布。深色档按宿主深色 alias 的色值取向(bg-base / bg-layer /
9
+ border / label-primary·secondary·tertiary / caption / state-error-primary),面板与描边为
10
+ 示意图略作收敛;brand 与危险红两档同色,保持强调可辨。
11
+ -->
12
+ <style>
13
+ text{font-family:'WenQuanYi Zen Hei','PingFang SC','Noto Sans SC','Microsoft YaHei','Segoe UI',sans-serif}
14
+ .page{fill:#F5F6FC}
15
+ .panel{fill:#FFFFFF;stroke:#E6EBF7}
16
+ .rule{stroke:#EDF1F9}
17
+ .row{fill:#FFFFFF}
18
+ .sel{fill:#EEF2FF}
19
+ .bubble{fill:#E8EDFF}
20
+ .chip{fill:#F5F6FC}
21
+ .icon-hit{fill:#F5F6FC}
22
+ .icon{stroke:#7A859E}
23
+ .ink1{fill:#1F2A44}
24
+ .ink2{fill:#38425A}
25
+ .ink3{fill:#7A859E}
26
+ .ink4{fill:#ACB5CF}
27
+ .stroke4{stroke:#ACB5CF}
28
+ .brand{fill:#4D6BFE}
29
+ .danger{fill:#E5484D}
30
+ .on-danger{fill:#FFFFFF}
31
+ @media (prefers-color-scheme: dark){
32
+ .page{fill:#151517}
33
+ .panel{fill:#1E1E20;stroke:#33363B}
34
+ .rule{stroke:#2F3237}
35
+ .row{fill:#1E1E20}
36
+ .sel{fill:#353638}
37
+ .bubble{fill:#2C2C2E}
38
+ .chip{fill:#232325}
39
+ .icon-hit{fill:#26272B}
40
+ .icon{stroke:#ADB2B8}
41
+ .ink1{fill:#F9FAFB}
42
+ .ink2{fill:#CFD3D6}
43
+ .ink3{fill:#ADB2B8}
44
+ .ink4{fill:#81858C}
45
+ .stroke4{stroke:#81858C}
46
+ .danger{fill:#F25A5A}
47
+ }
48
+ </style>
49
+ <rect class="page" width="640" height="300"/>
50
+ <!-- 回收站面板 -->
51
+ <rect class="panel" x="28" y="22" width="584" height="256" rx="14"/>
52
+ <!-- 头部:回收站 | 归档 平级分段 -->
53
+ <text class="ink1" x="48" y="50" font-size="13" font-weight="600">回收站 12</text>
54
+ <rect class="brand" x="46" y="57" width="68" height="3" rx="1.5"/>
55
+ <text class="ink4" x="128" y="50" font-size="13">归档 3</text>
56
+ <line class="rule" x1="44" y1="68" x2="248" y2="68"/>
57
+ <!-- 左列:按项目分组的会话行 -->
58
+ <path class="ink4" d="M47 78h6l2 2h7v8H47z"/>
59
+ <text class="ink3" x="65" y="88" font-size="11">产品官网</text>
60
+ <rect class="sel" x="40" y="94" width="210" height="26" rx="8"/>
61
+ <text class="ink1" x="52" y="111" font-size="12">与设计的评审会</text>
62
+ <rect class="row" x="40" y="124" width="210" height="26" rx="8"/>
63
+ <text class="ink2" x="52" y="141" font-size="12">重构落地页文案</text>
64
+ <path class="ink4" d="M47 160h6l2 2h7v8H47z"/>
65
+ <text class="ink3" x="65" y="170" font-size="11">CLI 工具</text>
66
+ <rect class="row" x="40" y="176" width="210" height="26" rx="8"/>
67
+ <text class="ink2" x="52" y="193" font-size="12">发布脚本排查</text>
68
+ <rect class="row" x="40" y="206" width="210" height="26" rx="8"/>
69
+ <text class="ink2" x="52" y="223" font-size="12">文案本地化</text>
70
+ <!-- 行右:恢复 / 彻底删除图标按钮 -->
71
+ <g class="icon" fill="none" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round">
72
+ <circle class="icon-hit" cx="206" cy="107" r="8" stroke="none"/>
73
+ <path d="M210 106h-5.6q-2.6 0-2.6 2.8"/>
74
+ <path d="M200.2 107.2l1.6 1.8 1.6-1.8"/>
75
+ <circle class="icon-hit" cx="228" cy="107" r="8" stroke="none"/>
76
+ <path d="M225 105.5h6M226.4 105.5v-.8h3.2v.8M225.8 105.5l.5 4h3.4l.5-4"/>
77
+ <circle class="icon-hit" cx="206" cy="137" r="8" stroke="none"/>
78
+ <path d="M210 136h-5.6q-2.6 0-2.6 2.8"/>
79
+ <path d="M200.2 137.2l1.6 1.8 1.6-1.8"/>
80
+ <circle class="icon-hit" cx="228" cy="137" r="8" stroke="none"/>
81
+ <path d="M225 135.5h6M226.4 135.5v-.8h3.2v.8M225.8 135.5l.5 4h3.4l.5-4"/>
82
+ <circle class="icon-hit" cx="206" cy="189" r="8" stroke="none"/>
83
+ <path d="M210 188h-5.6q-2.6 0-2.6 2.8"/>
84
+ <path d="M200.2 189.2l1.6 1.8 1.6-1.8"/>
85
+ <circle class="icon-hit" cx="228" cy="189" r="8" stroke="none"/>
86
+ <path d="M225 187.5h6M226.4 187.5v-.8h3.2v.8M225.8 187.5l.5 4h3.4l.5-4"/>
87
+ <circle class="icon-hit" cx="206" cy="219" r="8" stroke="none"/>
88
+ <path d="M210 218h-5.6q-2.6 0-2.6 2.8"/>
89
+ <path d="M200.2 219.2l1.6 1.8 1.6-1.8"/>
90
+ <circle class="icon-hit" cx="228" cy="219" r="8" stroke="none"/>
91
+ <path d="M225 217.5h6M226.4 217.5v-.8h3.2v.8M225.8 217.5l.5 4h3.4l.5-4"/>
92
+ </g>
93
+ <!-- 分栏线 -->
94
+ <line class="rule" x1="262" y1="22" x2="262" y2="278"/>
95
+ <!-- 右栏:会话信息与工作步骤 -->
96
+ <text class="ink1" x="284" y="52" font-size="15" font-weight="600">与设计的评审会</text>
97
+ <text class="ink3" x="284" y="80" font-size="11">项目</text>
98
+ <text class="ink2" x="352" y="80" font-size="11">产品官网</text>
99
+ <text class="ink3" x="284" y="100" font-size="11">模型</text>
100
+ <text class="ink2" x="352" y="100" font-size="11">DeepSeek-V3</text>
101
+ <text class="ink3" x="284" y="120" font-size="11">创建</text>
102
+ <text class="ink2" x="352" y="120" font-size="11">11-08 14:02</text>
103
+ <text class="ink3" x="284" y="140" font-size="11">回收站目录</text>
104
+ <text class="ink2" x="352" y="140" font-size="11">~/.dsh/session-trash</text>
105
+ <!-- 工作步骤折叠条 -->
106
+ <rect class="chip" x="284" y="154" width="306" height="26" rx="6"/>
107
+ <text class="ink2" x="298" y="171" font-size="11">工作步骤 · 3 步</text>
108
+ <path class="stroke4" d="M568 164l4 4 4-4" fill="none" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>
109
+ <!-- 对话预览 -->
110
+ <rect class="bubble" x="284" y="192" width="200" height="22" rx="7"/>
111
+ <text class="ink2" x="296" y="207" font-size="10.5">帮我改一下发布脚本</text>
112
+ <rect class="chip" x="284" y="222" width="306" height="20" rx="7"/>
113
+ <text class="ink3" x="296" y="236" font-size="10">已更新三处配置,并补了回滚说明…</text>
114
+ <!-- 页脚:整页唯一的实心红按钮 -->
115
+ <rect class="danger" x="486" y="244" width="104" height="28" rx="8"/>
116
+ <text class="on-danger" x="538" y="262" font-size="11" text-anchor="middle">清空回收站…</text>
117
+ </svg>
Binary file