@sunshaobei/dsh-session-manager 0.0.0-stage → 0.4.3-fork.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Seetraum
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,95 @@
1
- # Temporary Holding Version
1
+ # dsh-session-recycle-bin
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **Session recycle bin & permanent delete for DeepSeek Harness.**
4
+
5
+ Move sessions into a recycle bin from the sidebar, restore or permanently delete them (single or batch), with live-session protection.
6
+
7
+ The interface automatically follows the browser language: Chinese locales use
8
+ Chinese and all other locales use English.
9
+
10
+ [English](README.md) | [中文](README.zh.md)
11
+
12
+ ---
13
+
14
+ ## ✨ Features
15
+
16
+ - **Sidebar per-session delete icon** — hover a session row, a small trash icon appears; click to move it into the recycle bin instantly (no confirmation; always recoverable).
17
+ - **Session-header delete button** — delete the current session from the conversation header.
18
+ - **Recycle-bin manager** (Settings → 🗑 会话回收站) — archived sessions with multi-select: batch restore, batch permanent delete; each item shows its ID and path.
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
+ - **Live-session protection** — sessions with an active agent are refused deletion.
21
+ - **Batch fault tolerance** — batch operations delete per-session with error collection and reporting.
22
+ - **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
+
24
+ ---
25
+
26
+ ## 📦 Install
27
+
28
+ ### One-click from the plugin market (dsh-market)
29
+
30
+ Once listed in the [awesome-dsh-plugin](https://awesome-dsh-plugin.com) registry: open **Settings → Plugin Market** → search **dsh-session-recycle-bin** → install.
31
+
32
+ ### Manual
33
+
34
+ ```bash
35
+ dsh plugin --profile web add dsh-session-recycle-bin
36
+ ```
37
+
38
+ Then restart the web app (stop the `dsh web` process and run `dsh web` again).
39
+
40
+ ### Local development install
41
+
42
+ ```bash
43
+ dsh plugin --profile web add link:/absolute/path/to/harness-session-delete
44
+ ```
45
+
46
+ ### Uninstall
47
+
48
+ ```bash
49
+ dsh plugin --profile web remove dsh-session-recycle-bin
50
+ ```
51
+
52
+ ---
53
+
54
+ ## 🚀 Usage
55
+
56
+ 1. **Sidebar delete** — hover a session in the left sidebar, click the trash icon: the session moves into the recycle bin and the row disappears immediately.
57
+ 2. **Settings recycle bin** — open **Settings ⚙️ → 🗑 会话回收站**:
58
+ - Checkbox multi-select → **Restore** (batch unarchive) or **Permanent delete** (batch purge).
59
+ - Each entry shows the session name, ID and working path (hover for full details).
60
+ 3. **Permanent delete** physically removes the log and projection cache; live sessions are protected.
61
+ 4. **Undo** — restoring shows an undo toast that re-archives the session.
62
+
63
+ ---
64
+
65
+ ## 🛠 Development
66
+
67
+ ```bash
68
+ pnpm test # run the test suite (host logic + HTTP routes)
69
+ ```
70
+
71
+ Repo layout:
72
+
73
+ ```
74
+ harness-session-delete/
75
+ ├── package.json # single bundle manifest (dsh.bundle.patch + dsh.client)
76
+ ├── cordis.patch.yml # bundle patch: one insert mounting the host row
77
+ ├── index.js # node half: host entry (inject + apply)
78
+ ├── client.js # browser half: sidebar icons + settings recycle bin
79
+ ├── client.css # plugin stylesheet: design tokens + light/dark adaptive components
80
+ └── packages/
81
+ └── session-trash-host/ # host implementation (persistence/workspace/cache patches, HTTP routes)
82
+ ```
83
+
84
+ ---
85
+
86
+ ## 🔌 How it works
87
+
88
+ - A **single npm bundle** covers both halves, same as other published plugins: the host row mounts via `cordis.patch.yml`; the browser half joins automatically through `dsh.client` + `exports["./client"]`.
89
+ - The browser talks to the host over the plugin's own `/api/session-trash/*` HTTP routes (registered on the webserver; non-GET requests carry an `x-dsh-plugin` CSRF header).
90
+
91
+ ---
92
+
93
+ ## 📄 License
94
+
95
+ [MIT](LICENSE)
package/README.zh.md ADDED
@@ -0,0 +1,94 @@
1
+ # dsh-session-recycle-bin
2
+
3
+ **DSH 会话回收站与彻底删除插件(DeepSeek Harness)。**
4
+
5
+ 侧边栏一键移入回收站,设置页多选还原/彻底删除,活跃会话安全拦截。
6
+
7
+ 界面会自动跟随浏览器语言:中文区域显示中文,其他区域显示英文。
8
+
9
+ [English](README.md) | [中文](README.zh.md)
10
+
11
+ ---
12
+
13
+ ## ✨ 功能特性
14
+
15
+ - **侧边栏会话行删除图标** — 悬停会话行出现小垃圾桶图标,点击即移入回收站(免确认,随时可找回)。
16
+ - **会话头部删除按钮** — 从会话页顶部删除当前会话。
17
+ - **回收站管理器**(设置 → 🗑 会话回收站)— 已归档会话多选:批量还原、批量彻底删除;条目显示 ID 与路径。
18
+ - **真正的彻底删除** — 物理清除磁盘日志与投影缓存;无日志的幽灵会话被彻底清理,不会残留。
19
+ - **活跃会话保护** — 正在运行(有活跃 agent)的会话拒绝删除。
20
+ - **批量容错** — 批量操作逐条执行,收集并汇报失败项。
21
+ - **浅色/深色自适应界面** — 所有颜色以 CSS 变量(设计令牌)收敛在 `client.css`,组件优先跟随 DSH 应用外观(`data-ds-dark-theme`),并以 `prefers-color-scheme` 作为系统级兜底,无硬编码色板。界面与代码文字同样跟随 DSH 全局字体(`--dsw-font-family` / `--ds-font-family-code`),「设置 → 字体」对本插件同样生效。
22
+
23
+ ---
24
+
25
+ ## 📦 安装
26
+
27
+ ### 从插件市场一键安装(dsh-market)
28
+
29
+ 收录进 [awesome-dsh-plugin](https://awesome-dsh-plugin.com) 注册表后:打开 **设置 → 插件市场** → 搜索 **dsh-session-recycle-bin** → 安装。
30
+
31
+ ### 手动安装
32
+
33
+ ```bash
34
+ dsh plugin --profile web add dsh-session-recycle-bin
35
+ ```
36
+
37
+ 安装完成后重启 Web 服务(停止 `dsh web` 进程后重新启动)。
38
+
39
+ ### 本地开发安装
40
+
41
+ ```bash
42
+ dsh plugin --profile web add link:/绝对路径/harness-session-delete
43
+ ```
44
+
45
+ ### 卸载
46
+
47
+ ```bash
48
+ dsh plugin --profile web remove dsh-session-recycle-bin
49
+ ```
50
+
51
+ ---
52
+
53
+ ## 🚀 使用说明
54
+
55
+ 1. **侧边栏删除** — 悬停左侧会话列表中的会话,点击垃圾桶图标:会话移入回收站,行即时消失。
56
+ 2. **设置页回收站** — 打开「设置 ⚙️ → 🗑 会话回收站」:
57
+ - 复选框多选 → **还原**(批量解除归档)或 **彻底删除**(批量清除)。
58
+ - 每个条目显示会话名、ID 与工作路径(悬浮查看完整信息)。
59
+ 3. **彻底删除** 物理清除日志与投影缓存;活跃会话受保护。
60
+ 4. **撤销** — 还原操作带撤销提示,可重新归档。
61
+
62
+ ---
63
+
64
+ ## 🛠 开发
65
+
66
+ ```bash
67
+ pnpm test # 运行测试套件(host 逻辑 + HTTP 路由层)
68
+ ```
69
+
70
+ 仓库结构:
71
+
72
+ ```
73
+ harness-session-delete/
74
+ ├── package.json # 单包 bundle 声明(dsh.bundle.patch + dsh.client)
75
+ ├── cordis.patch.yml # bundle patch:一行 insert 挂载 host 行
76
+ ├── index.js # node 半边:host 入口(inject + apply)
77
+ ├── client.js # browser 半边:侧边栏图标 + 设置页回收站
78
+ ├── client.css # 插件样式表:设计令牌 + 浅色/深色自适应组件
79
+ └── packages/
80
+ └── session-trash-host/ # host 实现(persistence/workspace/cache 补丁、HTTP 路由)
81
+ ```
82
+
83
+ ---
84
+
85
+ ## 🔌 工作原理
86
+
87
+ - **单包 bundle** 同时覆盖两端,与其它已发布插件一致:host 半边由 `cordis.patch.yml` 挂载;浏览器半边经 `dsh.client` + `exports["./client"]` 自动进入模块图。
88
+ - 浏览器通过插件自身的 `/api/session-trash/*` HTTP 路由与宿主通信(webserver 注册;非 GET 请求携带 `x-dsh-plugin` CSRF 头)。
89
+
90
+ ---
91
+
92
+ ## 📄 许可证
93
+
94
+ [MIT](LICENSE)