dsh-archived-chats 0.3.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-archived-chats contributors
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 ADDED
@@ -0,0 +1,40 @@
1
+ # dsh-archived-chats
2
+
3
+ A settings page for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) that brings archived chats back into view.
4
+
5
+ Once a conversation is archived in DeepSeek Harness it disappears from the sidebar, and there is no built-in way to browse it again — only the workspace store (`~/.dsh/storages/workspace.json`) still remembers it. This plugin adds an **Archived Chats** page under Settings where every archived session is visible, searchable, and manageable.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ dsh plugin --profile web add dsh-archived-chats
11
+ ```
12
+
13
+ Restart DSH once after installing, then open **Settings → Archived Chats**.
14
+
15
+ ## Features
16
+
17
+ - **Complete archived-session list**, grouped by workspace (project) with a per-group count. Every group can be collapsed or expanded, and the state is remembered per browser.
18
+ - **Search** by title, plus two filters: type (all / regular / subagent) and project.
19
+ - **Unarchive** a single chat or a whole project group from the group's `⋯` menu — restored chats reappear in the sidebar immediately.
20
+ - **Delete** one chat, a project group, or everything (**Delete All**), each behind a confirmation dialog. Deletion is thorough: the session log is removed from disk, the session is detached from its workspace record, and the registry's in-memory header index is purged, so the sidebar drops the rows live.
21
+ - Sessions that are still resident in the background are **parked permanently** and physically removed on the next DSH start — nothing is left half-deleted, and parked sessions stay hidden meanwhile.
22
+ - Works in light and dark schemes; localized in English and 中文.
23
+
24
+ ## How it works
25
+
26
+ - **Host half** (`lib/index.js`) registers the `/plugins/dsh-archived-chats/*` routes on the DSH web server: `GET /state`, `POST /unarchive`, `POST /unarchive-all`, `POST /delete`, `POST /delete-all`. Unarchiving writes through the workspace registry's own state path, so every connected client receives the `host/archived-sessions-changed` push. Mutating routes require a custom `x-dsh-archived-chats: 1` header as CSRF hardening.
27
+ - **Pending-deletion store**: deleting a live session takes a "park and defer" path — the agent is cancelled permanently (`cancel({ kind: 'disposed' })`), the session stays archived and hidden, and the id is recorded in `$DSH_HOME/plugin-data/archived-chats/pending-deletions.json`. On the next boot the plugin sweeps the queue and completes the deletion through the ordinary delete path. Parked sessions are excluded from the listing; unarchiving one before the restart cancels its pending deletion.
28
+ - **Browser half** (`lib/client.js`) registers a `settings.section` slot entry (order 30) and renders the page with React and DSH design tokens.
29
+
30
+ ## Uninstall
31
+
32
+ ```sh
33
+ dsh plugin --profile web remove dsh-archived-chats
34
+ ```
35
+
36
+ The only leftover is the small pending-deletion store under `$DSH_HOME/plugin-data/archived-chats/`; uninstalling does not process the queue.
37
+
38
+ ## License
39
+
40
+ MIT
package/README.zh.md ADDED
@@ -0,0 +1,40 @@
1
+ # dsh-archived-chats
2
+
3
+ 为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 新增一个「已归档的聊天」设置页,把被归档的会话重新找回来。
4
+
5
+ 在 DeepSeek Harness 里,聊天一旦归档就会从侧边栏消失,界面中没有任何入口可以再看到它,只有工作区存档(`~/.dsh/storages/workspace.json`)还记得它。这个插件在「设置」中补上一个「已归档的聊天」页面,让所有归档会话都可见、可搜索、可管理。
6
+
7
+ ## 安装
8
+
9
+ ```sh
10
+ dsh plugin --profile web add dsh-archived-chats
11
+ ```
12
+
13
+ 安装后重启一次 DSH,然后打开 **设置 → 已归档的聊天**。
14
+
15
+ ## 功能
16
+
17
+ - **完整归档列表**:按工作区(项目)分组并显示每组数量;每个分组都可折叠/展开,状态按浏览器记忆。
18
+ - **搜索**标题,外加两个筛选器:类型(全部 / 普通会话 / 子代理会话)和项目。
19
+ - **取消归档**单个聊天,或从分组的 `⋯` 菜单整组取消——恢复的聊天会立刻回到侧边栏。
20
+ - **删除**单个聊天、某个项目分组或全部(**全部删除**),均有确认弹窗。删除是彻底的:会话日志从磁盘移除、从工作区记录中摘除、注册表内存索引同步清理,主侧边栏的条目也会立即消失。
21
+ - 仍驻留后台的会话会被**永久停用**,待下次启动 DSH 时完成物理删除——不会留下半删除状态,停用期间会话保持隐藏。
22
+ - 适配浅色/深色主题,支持中文和英文界面。
23
+
24
+ ## 实现原理
25
+
26
+ - **Host 半**(`lib/index.js`)在 DSH Web 服务器上注册 `/plugins/dsh-archived-chats/*` 路由:`GET /state`、`POST /unarchive`、`POST /unarchive-all`、`POST /delete`、`POST /delete-all`。取消归档走 workspace registry 自身的状态写入通道,所有已连接的客户端都会收到 `host/archived-sessions-changed` 推送。写操作路由要求自定义请求头 `x-dsh-archived-chats: 1` 作为 CSRF 加固。
27
+ - **待删队列**:删除仍在后台运行的会话时采用「停用并延后」策略——agent 被永久取消(`cancel({ kind: 'disposed' })`),会话保持归档与隐藏,id 记入 `$DSH_HOME/plugin-data/archived-chats/pending-deletions.json`;下次启动时插件会清扫该队列,通过常规删除路径完成物理删除。已入队的会话不会出现在列表中;若在重启前取消归档,待删标记会被撤销。
28
+ - **浏览器半**(`lib/client.js`)注册 `settings.section` 插槽项(order 30),用 React 和 DSH 设计令牌渲染页面。
29
+
30
+ ## 卸载
31
+
32
+ ```sh
33
+ dsh plugin --profile web remove dsh-archived-chats
34
+ ```
35
+
36
+ 唯一残留是 `$DSH_HOME/plugin-data/archived-chats/` 下的待删队列小文件;卸载不会触发队列处理。
37
+
38
+ ## License
39
+
40
+ MIT
@@ -0,0 +1,7 @@
1
+ # dsh-archived-chats profile patch layer: one loader entry for the plugin
2
+ # package. The host half registers /plugins/dsh-archived-chats/* HTTP routes;
3
+ # the browser half is picked up by dsh-client-modules through the package's
4
+ # dsh.client declaration, exactly like the shipped ui-* packages.
5
+ - insert:
6
+ - id: archived-chats
7
+ name: 'dsh-archived-chats'