dsh-long-archive 2.0.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 +21 -0
- package/README.md +101 -0
- package/cordis.patch.yml +13 -0
- package/lib/client.js +1162 -0
- package/lib/index.js +327 -0
- package/package.json +65 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dsh-archive-view 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
|
|
13
|
+
all 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
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# dsh-long-archive
|
|
2
|
+
|
|
3
|
+
[中文](README.zh.md) | English
|
|
4
|
+
|
|
5
|
+
An archived-session manager for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) WebUI: an "Archived" entry at the sidebar footer opens a grouped archive panel — open a session to continue it, unarchive, or delete it (full live-agent teardown + physical log removal).
|
|
6
|
+
|
|
7
|
+
Native DSH only has the "archive" action (hides the session from the sidebar); there is no way to view, restore, or delete archived sessions. This plugin fills that gap.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Archive list** — an "Archived" entry at the sidebar footer opens a panel grouping sessions by workspace, visually matching the official sidebar
|
|
12
|
+
- **Continue a session** — click an archived session to open it and keep chatting; its archived state is untouched
|
|
13
|
+
- **Unarchive** — put a session back into its workspace with one click, original position preserved
|
|
14
|
+
- **Delete for good** — safely stops the session first, then removes its complete on-disk record; a confirmation dialog guards the action
|
|
15
|
+
- **Search** — instant filtering by title or workspace, plus message search (your prompts and the assistant's replies); behaves like the official search
|
|
16
|
+
- **View sync** — grouping (by workspace / one list), ordering (manual / recently updated), and drag-to-reorder all stay in real-time two-way sync with the official sidebar
|
|
17
|
+
- **Bilingual UI** — English and Chinese, following the system language automatically
|
|
18
|
+
- Session status at a glance: running / completed / waiting for you — same as the official sidebar
|
|
19
|
+
|
|
20
|
+
## Compatibility
|
|
21
|
+
|
|
22
|
+
Developed against `@deepseek-ai/dsh` **0.1.0-rc.6**. Relies on official internal shapes (`workspaceRegistry.enqueueOperation`, `AgentHandle.dispose`, the client-runtime service shapes); a dsh upgrade may require adaptation — if something misbehaves after upgrading, check whether this repo has caught up with the new version.
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
From npm (one command):
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
npx @deepseek-ai/dsh plugin --profile web add dsh-archive-manager
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Or from a git checkout:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
# 1. Clone the repo — any location works; this is just an example
|
|
36
|
+
git clone https://github.com/Jasonrale/dsh-archive-manager.git ~/dsh-archive-manager
|
|
37
|
+
|
|
38
|
+
# 2. Register it (the profile is created automatically if missing;
|
|
39
|
+
# replace the path with the one YOU cloned to)
|
|
40
|
+
npx @deepseek-ai/dsh plugin --profile web add ~/dsh-archive-manager
|
|
41
|
+
|
|
42
|
+
# 3. Restart dsh web
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Updating
|
|
46
|
+
|
|
47
|
+
A local install is a snapshot, not a live link — after changing the plugin sources, re-register:
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
npx @deepseek-ai/dsh plugin --profile web remove dsh-archive-manager
|
|
51
|
+
npx @deepseek-ai/dsh plugin --profile web add ~/dsh-archive-manager
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Uninstall
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
npx @deepseek-ai/dsh plugin --profile web remove dsh-archive-manager
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Then restart dsh web (the source directory can be kept or deleted).
|
|
61
|
+
|
|
62
|
+
## Known limitations
|
|
63
|
+
|
|
64
|
+
- Sessions that were running while the plugin itself was **hot-reloaded** cannot be deleted afterwards — the plugin will refuse with a clear message asking you to restart dsh first. (Normal use is unaffected: install once, and everything — including sessions archived before the plugin existed — stays manageable.)
|
|
65
|
+
|
|
66
|
+
## License
|
|
67
|
+
|
|
68
|
+
MIT
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 本仓库说明(fork 适配版 2.0.0)
|
|
73
|
+
|
|
74
|
+
上游 `dsh-long-archive(基于上游 dsh-archive-manager@1.1.1)` 已停更(2026-08-17 后无提交),无法在 **DSH 0.1.5-rc.2** 上工作。
|
|
75
|
+
本仓库从 1.1.1 起适配,**当前版本 2.0.0**,累计 8 处兼容补丁,**未改动任何功能语义**,仅修兼容性。
|
|
76
|
+
|
|
77
|
+
### 补丁清单
|
|
78
|
+
|
|
79
|
+
| # | 位置 | 问题 | 修复 |
|
|
80
|
+
|---|---|---|---|
|
|
81
|
+
| 1 | `cordis.patch.yml` | 服务端 inject 缺 `webServer` | 补上(`connection.rpc` 内部要用) |
|
|
82
|
+
| 2 | `lib/index.js` | 用了 0.1.5 已不可用的 `connection.rpc.handle('/arcv')`(内部 `owner.webServer` 拿不到注入)→ **DSH 启动即崩** | 改为直挂 HTTP 路由 `ctx.webServer.register({kind:'exact', path:'/api/dsh-archive-rpc'})` |
|
|
83
|
+
| 3 | `lib/client.js` | `connection.rpc.call('/arcv')` | 改为 `fetch('/api/dsh-archive-rpc')` |
|
|
84
|
+
| 4 | `lib/client.js` | 客户端 `inject` 只声明 `['slots']`,但代码用了 `sessions/workspaces/locale/layout` → 全是 undefined(标题显示成文件夹名、点不开) | 补全声明 |
|
|
85
|
+
| 5 | `lib/client.js` | 调用了 0.1.2+ 已移除的 `workspaces.project()` | 加 `typeof` 保护 |
|
|
86
|
+
| 6 | `package.json` | `dsh.client` 缺 `inject` 列表 → **客户端模块根本不加载**(侧栏入口不出现) | 补 7 项核心包 |
|
|
87
|
+
| 7 | `lib/index.js` + `lib/client.js` | 加载期异常会冒泡 → DSH 起不来 | `apply` 整体包 **try/catch 防崩**:失败只记日志,**最坏"入口消失",绝不拖垮 DSH** |
|
|
88
|
+
| 8 | `lib/client.js` | 客户端注册 `window.__ModuleLoader__.load({ id: "dsh-archive-manager" })` 用的是**旧包名** → 加载器找不到注册,报 `loaded without registering "dsh-long-archive"`(页面提示 Failed to load plugins) | 改为 `id: "dsh-long-archive"` |
|
|
89
|
+
|
|
90
|
+
### 行为说明
|
|
91
|
+
|
|
92
|
+
- 入口:**侧栏底部**(`sidebar.footer.action`)→ 分组归档面板(按工作区分组、可搜索)。
|
|
93
|
+
- **点会话行不预览**,只提示「先恢复再预览」(归档会话被核心的投影缓存排除,直接打开是空壳)。
|
|
94
|
+
- **恢复**:点「恢复」才真正恢复到原工作区。
|
|
95
|
+
- 删除:二次确认后永久删除。
|
|
96
|
+
|
|
97
|
+
### 兼容性
|
|
98
|
+
|
|
99
|
+
- ✅ **不替换核心插件**(不碰 `workspace`/`session-projection-cache`/`ui-workspace`),所以它失效时不会拖垮会话列表/侧栏。
|
|
100
|
+
- ⚠️ 依赖 DSH 内部服务(`agents`/`sessionPersistence`/`workspaceRegistry`/`storageDomain`/`sessions`)与 `workspaces.archivedSessionIds` 字段;这些变了它会**静默失效**(入口/列表不显示),届时重新打补丁即可。
|
|
101
|
+
- 已验证:DSH **0.1.5-rc.2**。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# This file is loaded automatically when the package is a profile layer
|
|
2
|
+
# (declares dsh.bundle.patch). It inserts the plugin into the web composition.
|
|
3
|
+
- insert:
|
|
4
|
+
- id: archive-manager
|
|
5
|
+
name: dsh-long-archive
|
|
6
|
+
inject:
|
|
7
|
+
- connection
|
|
8
|
+
- webServer
|
|
9
|
+
- agents
|
|
10
|
+
- sessionPersistence
|
|
11
|
+
- workspaceRegistry
|
|
12
|
+
- storageDomain
|
|
13
|
+
- sessions
|