@sunshaobei/dsh-session-manager 0.4.3-fork.1 → 0.6.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 +30 -9
- package/README.zh.md +30 -9
- package/client.css +532 -97
- package/client.js +949 -84
- package/cordis.patch.yml +1 -1
- package/package.json +10 -10
- package/packages/session-trash-host/lib/index.js +842 -254
- package/packages/session-trash-host/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# dsh-session-
|
|
1
|
+
# dsh-session-manager
|
|
2
2
|
|
|
3
3
|
**Session recycle bin & permanent delete for DeepSeek Harness.**
|
|
4
4
|
|
|
5
|
-
Move
|
|
5
|
+
Move the current session into a recycle bin from the conversation header, restore or permanently delete archived sessions (single or batch), with live-session protection.
|
|
6
6
|
|
|
7
7
|
The interface automatically follows the browser language: Chinese locales use
|
|
8
8
|
Chinese and all other locales use English.
|
|
@@ -13,26 +13,38 @@ Chinese and all other locales use English.
|
|
|
13
13
|
|
|
14
14
|
## ✨ Features
|
|
15
15
|
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
16
|
+
- **Conversation-header archive button** — move the current session into the recycle bin from the header (no confirmation; always recoverable).
|
|
17
|
+
- **No duplicate of DSH's own affordance** — archiving from the sidebar uses DSH's built-in hover button; this plugin no longer injects a second, differently worded icon (0.4.4 removed the old row trash icon and the document-wide MutationObserver that drove it).
|
|
18
18
|
- **Recycle-bin manager** (Settings → 🗑 会话回收站) — archived sessions with multi-select: batch restore, batch permanent delete; each item shows its ID and path.
|
|
19
19
|
- **True permanent delete** — physically removes the session log from disk and the projection-cache record; ghost sessions (records without a log) are cleaned up so they vanish instead of lingering.
|
|
20
20
|
- **Live-session protection** — sessions with an active agent are refused deletion.
|
|
21
|
+
- **Sub-session aware** — each row can show how many sub-agent sessions it left behind (whole tree, any depth) and open them inline: title, size, time and running state, with a checkbox per sub-session. Permanent delete removes the whole tree; the ones you uncheck are kept and stay reachable as a "deleted main session · N sub-sessions kept" row instead of becoming invisible leftovers.
|
|
22
|
+
- **Running sub-agents block the row** — a session is refused while any sub-session in its tree is still running, and the refusal names it.
|
|
21
23
|
- **Batch fault tolerance** — batch operations delete per-session with error collection and reporting.
|
|
22
24
|
- **Light/dark adaptive UI** — all colors are CSS custom properties in `client.css`; components follow the resolved DSH appearance (`data-ds-dark-theme`) with `prefers-color-scheme` as the OS-level fallback (no hardcoded palette). UI and code text follow the app font too (`--dsw-font-family` / `--ds-font-family-code`), so the Settings → 字体 choice applies here as well.
|
|
23
25
|
|
|
24
26
|
---
|
|
25
27
|
|
|
28
|
+
## 📋 Requirements
|
|
29
|
+
|
|
30
|
+
- **DSH 0.2.0-rc.2 or newer** (this release is tested on that version only; older hosts are untested).
|
|
31
|
+
|
|
32
|
+
The recycle-bin list no longer reads session logs: its titles and turn counts come from the Session projection cache (`SessionProjectionCache.cachedSnapshot`, plus `cachedPredecessorTitle` for checkpoints written by an older format generation) — the same zero-I/O face DSH's own session list uses. On a host without those two methods the plugin still mounts, archives and restores, but the list degrades to 「未命名会话」 with no turn counts.
|
|
33
|
+
|
|
34
|
+
The floor is declared as `dsh.engines.dsh`. Note that DSH 0.2.0-rc.2 does **not** read that field: it is documentation for users and marketplaces, not a runtime gate.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
26
38
|
## 📦 Install
|
|
27
39
|
|
|
28
40
|
### One-click from the plugin market (dsh-market)
|
|
29
41
|
|
|
30
|
-
Once listed in the [awesome-dsh-plugin](https://awesome-dsh-plugin.com) registry: open **Settings → Plugin Market** → search **dsh-session-
|
|
42
|
+
Once listed in the [awesome-dsh-plugin](https://awesome-dsh-plugin.com) registry: open **Settings → Plugin Market** → search **dsh-session-manager** → install.
|
|
31
43
|
|
|
32
44
|
### Manual
|
|
33
45
|
|
|
34
46
|
```bash
|
|
35
|
-
dsh plugin --profile web add dsh-session-
|
|
47
|
+
dsh plugin --profile web add dsh-session-manager
|
|
36
48
|
```
|
|
37
49
|
|
|
38
50
|
Then restart the web app (stop the `dsh web` process and run `dsh web` again).
|
|
@@ -46,14 +58,14 @@ dsh plugin --profile web add link:/absolute/path/to/harness-session-delete
|
|
|
46
58
|
### Uninstall
|
|
47
59
|
|
|
48
60
|
```bash
|
|
49
|
-
dsh plugin --profile web remove dsh-session-
|
|
61
|
+
dsh plugin --profile web remove dsh-session-manager
|
|
50
62
|
```
|
|
51
63
|
|
|
52
64
|
---
|
|
53
65
|
|
|
54
66
|
## 🚀 Usage
|
|
55
67
|
|
|
56
|
-
1. **
|
|
68
|
+
1. **Move to the recycle bin** — click the 「移入回收站」 icon in the conversation header: the session is archived and an undo toast appears. Whether an archived session keeps showing in the left sidebar is decided by DSH's own **View options → Filter sessions** setting (Hide archived / All conversations / Archived only); this plugin does not touch it, exactly like DSH's built-in archive button.
|
|
57
69
|
2. **Settings recycle bin** — open **Settings ⚙️ → 🗑 会话回收站**:
|
|
58
70
|
- Checkbox multi-select → **Restore** (batch unarchive) or **Permanent delete** (batch purge).
|
|
59
71
|
- Each entry shows the session name, ID and working path (hover for full details).
|
|
@@ -75,12 +87,21 @@ harness-session-delete/
|
|
|
75
87
|
├── package.json # single bundle manifest (dsh.bundle.patch + dsh.client)
|
|
76
88
|
├── cordis.patch.yml # bundle patch: one insert mounting the host row
|
|
77
89
|
├── index.js # node half: host entry (inject + apply)
|
|
78
|
-
├── client.js # browser half:
|
|
90
|
+
├── client.js # browser half: conversation-header action + settings recycle bin
|
|
79
91
|
├── client.css # plugin stylesheet: design tokens + light/dark adaptive components
|
|
80
92
|
└── packages/
|
|
81
93
|
└── session-trash-host/ # host implementation (persistence/workspace/cache patches, HTTP routes)
|
|
82
94
|
```
|
|
83
95
|
|
|
96
|
+
### Changelog convention
|
|
97
|
+
|
|
98
|
+
`CHANGELOG.md` and `CHANGELOG.zh.md` mirror each other. Every entry follows:
|
|
99
|
+
|
|
100
|
+
- Version section `## [version] - YYYY-MM-DD`, with only the `### Added` / `### Changed` / `### Fixed` / `### Performance` / `### Removed` headings it actually uses.
|
|
101
|
+
- One topic per bullet: **a short bold lead stating the outcome**, then 1-2 sentences on what changed and why it matters.
|
|
102
|
+
- No implementation detail, no code, no test or verification results — those belong in the commit or the PR.
|
|
103
|
+
- Write only user-visible or breaking changes; skip internal refactors with no visible effect.
|
|
104
|
+
|
|
84
105
|
---
|
|
85
106
|
|
|
86
107
|
## 🔌 How it works
|
package/README.zh.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# dsh-session-
|
|
1
|
+
# dsh-session-manager
|
|
2
2
|
|
|
3
3
|
**DSH 会话回收站与彻底删除插件(DeepSeek Harness)。**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
会话详情头部一键移入回收站,设置页多选还原/彻底删除,活跃会话安全拦截。
|
|
6
6
|
|
|
7
7
|
界面会自动跟随浏览器语言:中文区域显示中文,其他区域显示英文。
|
|
8
8
|
|
|
@@ -12,26 +12,38 @@
|
|
|
12
12
|
|
|
13
13
|
## ✨ 功能特性
|
|
14
14
|
|
|
15
|
-
-
|
|
16
|
-
-
|
|
15
|
+
- **会话详情头部归档按钮** — 会话页顶部一键把当前会话移入回收站(免确认,随时可找回)。
|
|
16
|
+
- **不与 DSH 自带入口重复** — 侧边栏会话行的归档入口统一使用 DSH 自带的悬浮归档按钮;本插件不再注入第二个、措辞不同的图标(0.4.4 起移除了旧的行内垃圾桶,并去掉了驱动它的全文档 MutationObserver)。
|
|
17
17
|
- **回收站管理器**(设置 → 🗑 会话回收站)— 已归档会话多选:批量还原、批量彻底删除;条目显示 ID 与路径。
|
|
18
18
|
- **真正的彻底删除** — 物理清除磁盘日志与投影缓存;无日志的幽灵会话被彻底清理,不会残留。
|
|
19
19
|
- **活跃会话保护** — 正在运行(有活跃 agent)的会话拒绝删除。
|
|
20
|
+
- **子会话可见可控** — 每行可显示该会话留下的子代理会话数量(任意层级全树),并可就地展开:标题、大小、时间、运行状态,逐个勾选。彻底删除会一并清除整棵子树;未勾选的会保留,并以「已删除的主会话 · 保留 N 个子会话」的形式继续可见,而不是变成看不见、够不着的残留。
|
|
21
|
+
- **运行中的子代理会拦住删除** — 只要该会话的子树里还有子会话在运行就拒绝删除,并点名是哪一个。
|
|
20
22
|
- **批量容错** — 批量操作逐条执行,收集并汇报失败项。
|
|
21
23
|
- **浅色/深色自适应界面** — 所有颜色以 CSS 变量(设计令牌)收敛在 `client.css`,组件优先跟随 DSH 应用外观(`data-ds-dark-theme`),并以 `prefers-color-scheme` 作为系统级兜底,无硬编码色板。界面与代码文字同样跟随 DSH 全局字体(`--dsw-font-family` / `--ds-font-family-code`),「设置 → 字体」对本插件同样生效。
|
|
22
24
|
|
|
23
25
|
---
|
|
24
26
|
|
|
27
|
+
## 📋 环境要求
|
|
28
|
+
|
|
29
|
+
- **DSH 0.2.0-rc.2 及以上**(本版仅在该版本上测试通过;更低版本未测试)。
|
|
30
|
+
|
|
31
|
+
回收站列表的标题与轮数不再读取会话日志,而是取自会话投影缓存(`SessionProjectionCache.cachedSnapshot`,以及为跨格式代际准备的 `cachedPredecessorTitle`)——这正是 DSH 自身会话列表使用的零 I/O 门面。缺少这两个方法的旧宿主上,插件仍能挂载、归档与还原,但列表会退化为「未命名会话」且不显示轮数。
|
|
32
|
+
|
|
33
|
+
该下限以 `dsh.engines.dsh` 声明。注意:DSH 0.2.0-rc.2 **并不读取**该字段,因此它是给用户与插件市场看的文档性声明,不是运行时强校验。
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
25
37
|
## 📦 安装
|
|
26
38
|
|
|
27
39
|
### 从插件市场一键安装(dsh-market)
|
|
28
40
|
|
|
29
|
-
收录进 [awesome-dsh-plugin](https://awesome-dsh-plugin.com) 注册表后:打开 **设置 → 插件市场** → 搜索 **dsh-session-
|
|
41
|
+
收录进 [awesome-dsh-plugin](https://awesome-dsh-plugin.com) 注册表后:打开 **设置 → 插件市场** → 搜索 **dsh-session-manager** → 安装。
|
|
30
42
|
|
|
31
43
|
### 手动安装
|
|
32
44
|
|
|
33
45
|
```bash
|
|
34
|
-
dsh plugin --profile web add dsh-session-
|
|
46
|
+
dsh plugin --profile web add dsh-session-manager
|
|
35
47
|
```
|
|
36
48
|
|
|
37
49
|
安装完成后重启 Web 服务(停止 `dsh web` 进程后重新启动)。
|
|
@@ -45,14 +57,14 @@ dsh plugin --profile web add link:/绝对路径/harness-session-delete
|
|
|
45
57
|
### 卸载
|
|
46
58
|
|
|
47
59
|
```bash
|
|
48
|
-
dsh plugin --profile web remove dsh-session-
|
|
60
|
+
dsh plugin --profile web remove dsh-session-manager
|
|
49
61
|
```
|
|
50
62
|
|
|
51
63
|
---
|
|
52
64
|
|
|
53
65
|
## 🚀 使用说明
|
|
54
66
|
|
|
55
|
-
1.
|
|
67
|
+
1. **移入回收站** — 在会话页顶部点「移入回收站」图标:会话进入回收站,并弹出可撤销提示。归档后的会话是否仍显示在左侧列表,由 DSH 侧边栏「视图选项 → 筛选会话」的档位决定(隐藏已归档 / 全部对话 / 仅显示已归档),本插件不做干预,与 DSH 自带按钮行为一致。
|
|
56
68
|
2. **设置页回收站** — 打开「设置 ⚙️ → 🗑 会话回收站」:
|
|
57
69
|
- 复选框多选 → **还原**(批量解除归档)或 **彻底删除**(批量清除)。
|
|
58
70
|
- 每个条目显示会话名、ID 与工作路径(悬浮查看完整信息)。
|
|
@@ -74,12 +86,21 @@ harness-session-delete/
|
|
|
74
86
|
├── package.json # 单包 bundle 声明(dsh.bundle.patch + dsh.client)
|
|
75
87
|
├── cordis.patch.yml # bundle patch:一行 insert 挂载 host 行
|
|
76
88
|
├── index.js # node 半边:host 入口(inject + apply)
|
|
77
|
-
├── client.js # browser
|
|
89
|
+
├── client.js # browser 半边:会话头部动作 + 设置页回收站
|
|
78
90
|
├── client.css # 插件样式表:设计令牌 + 浅色/深色自适应组件
|
|
79
91
|
└── packages/
|
|
80
92
|
└── session-trash-host/ # host 实现(persistence/workspace/cache 补丁、HTTP 路由)
|
|
81
93
|
```
|
|
82
94
|
|
|
95
|
+
### 更新日志规范
|
|
96
|
+
|
|
97
|
+
`CHANGELOG.md` 与 `CHANGELOG.zh.md` 一一对应。每条按下面写:
|
|
98
|
+
|
|
99
|
+
- 版本段用 `## [版本] - YYYY-MM-DD`,其下只列实际涉及的 `### Added` / `### Changed` / `### Fixed` / `### Performance` / `### Removed`。
|
|
100
|
+
- 每条一个主题:**加粗短句点明结论**,随后 1–2 句说明「改了什么 + 为什么、对用户有什么影响」。
|
|
101
|
+
- 不写实现细节、不贴代码、不写测试或验证过程 —— 那些属于 commit / PR。
|
|
102
|
+
- 只写用户可感知或破坏性的变化;纯内部重构若无可见影响则不写。
|
|
103
|
+
|
|
83
104
|
---
|
|
84
105
|
|
|
85
106
|
## 🔌 工作原理
|