dsh-session-manager 0.4.0 → 0.4.4
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 +34 -52
- package/README.zh.md +116 -116
- package/lib/client.js +1113 -1036
- package/package.json +54 -54
package/README.md
CHANGED
|
@@ -1,59 +1,45 @@
|
|
|
1
|
-
# dsh-session-manager —
|
|
1
|
+
# dsh-session-manager — session manager for DeepSeek Harness
|
|
2
2
|
|
|
3
3
|
English | [中文](README.zh.md)
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/dsh-session-manager)
|
|
6
6
|
[](https://github.com/hkkz9522/dsh-session-manager)
|
|
7
7
|
[](https://github.com/hkkz9522/dsh-session-manager/actions/workflows/ci.yml)
|
|
8
|
+
[](https://awesome-dsh-plugin.com)
|
|
8
9
|
|
|
9
|
-
A DeepSeek Harness (DSH) plugin for
|
|
10
|
-
It adds archive management, permanent deletion, cross-workspace moves, and
|
|
11
|
-
**per-conversation Agent preset migration**.
|
|
10
|
+
A DeepSeek Harness (DSH) Web plugin for session management: delete sessions, archive sessions, move sessions across workspaces, and migrate a session's Agent preset. Suggestions are welcome on GitHub.
|
|
12
11
|
|
|
13
12
|
## Features
|
|
14
13
|
|
|
15
|
-
- **Archive
|
|
16
|
-
- **Delete
|
|
17
|
-
- **Move to workspace
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
when its original preset was renamed or removed.
|
|
22
|
-
- **Session manager** in the sidebar for browsing active and archived conversations,
|
|
23
|
-
with per-row Open, Archive/Unarchive, Move, Delete, and Migrate preset actions.
|
|
24
|
-
- Header actions for the current conversation: Archive/Unarchive, Move to workspace,
|
|
25
|
-
and a red Delete conversation action.
|
|
14
|
+
- **Archive / unarchive** sessions.
|
|
15
|
+
- **Delete sessions** with an explicit irreversible-action confirmation.
|
|
16
|
+
- **Move to workspace**: preserves history, title, archive state, and derived-session relationships, and updates the session's working directory to the target workspace.
|
|
17
|
+
- **Migrate Agent preset**: change the preset on demand. Typical use case: when the original preset was renamed or removed and the session can no longer resume, you can repair that session.
|
|
18
|
+
- **Session manager**: browse active and archived sessions in the sidebar, and run Open, Archive / Unarchive, Move, Delete, or Migrate preset on each row.
|
|
19
|
+
- The current session's title area offers Archive / Unarchive, Move to workspace, and a red Delete session button.
|
|
26
20
|
|
|
27
21
|
## Where to find the UI
|
|
28
22
|
|
|
29
|
-
- **
|
|
30
|
-
- **Sidebar footer → Session manager:** browse all
|
|
31
|
-
ones, and perform actions for an individual conversation.
|
|
32
|
-
- **Session manager row → Migrate preset:** change the Agent preset for that one
|
|
33
|
-
conversation only. There is no bulk migration action.
|
|
23
|
+
- **Session title area (right side):** archive/unarchive, move to workspace, delete session.
|
|
24
|
+
- **Sidebar footer → Session manager:** browse all sessions (including archived ones) and operate on each one.
|
|
34
25
|
|
|
35
26
|
## Agent preset migration
|
|
36
27
|
|
|
37
|
-
Use this when a
|
|
38
|
-
longer exists, for example after removing a custom preset such as
|
|
39
|
-
`router-standard`.
|
|
28
|
+
Use this when a session can no longer resume because its original preset no longer exists, for example after removing a custom preset such as `router-standard`.
|
|
40
29
|
|
|
41
30
|
1. Open **Session manager**.
|
|
42
|
-
2. Locate the
|
|
31
|
+
2. Locate the session and select **Migrate preset**.
|
|
43
32
|
3. Choose one of the currently available target presets and confirm.
|
|
44
33
|
|
|
45
|
-
The plugin determines the
|
|
46
|
-
`agent-preset/selected` event when present; otherwise it uses the session header.
|
|
47
|
-
It safely updates the relevant stored value, releases any live persistence owner,
|
|
48
|
-
and refreshes the session list. If the migrated conversation is open, reopen it
|
|
49
|
-
before continuing the chat.
|
|
34
|
+
The plugin determines the session's effective preset from its latest `agent-preset/selected` event when present; otherwise it uses the session header. It safely updates the relevant stored value, releases any live persistence owner, and refreshes the session list. If the migrated session is open, reopen it before continuing the chat.
|
|
50
35
|
|
|
51
|
-
> A preset migration changes
|
|
52
|
-
> history, files, or the selected workspace.
|
|
36
|
+
> A preset migration changes session metadata only. It does not alter message history, files, or the selected workspace.
|
|
53
37
|
|
|
54
38
|
## Install
|
|
55
39
|
|
|
56
|
-
|
|
40
|
+
The plugin is listed in [dsh-market](https://github.com/dsh-market/dsh-market) and [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin), and can be installed directly from the **Plugin Marketplace** inside DSH.
|
|
41
|
+
|
|
42
|
+
### From dsh-market
|
|
57
43
|
|
|
58
44
|
```powershell
|
|
59
45
|
dsh plugin --profile web add npm:dsh-session-manager
|
|
@@ -65,8 +51,7 @@ dsh plugin --profile web add npm:dsh-session-manager
|
|
|
65
51
|
dsh plugin --profile web add github:hkkz9522/dsh-session-manager
|
|
66
52
|
```
|
|
67
53
|
|
|
68
|
-
Restart DSH Web after installation. If
|
|
69
|
-
perform a hard refresh (`Ctrl+Shift+R`).
|
|
54
|
+
Restart DSH Web after installation. If the browser still holds an older client bundle, force refresh with `Ctrl+Shift+R`.
|
|
70
55
|
|
|
71
56
|
### Local development / runtime injection
|
|
72
57
|
|
|
@@ -76,8 +61,7 @@ dev_inject_plugin {"dir": "<absolute path to this repository>"}
|
|
|
76
61
|
|
|
77
62
|
## HTTP API
|
|
78
63
|
|
|
79
|
-
The
|
|
80
|
-
integration and diagnostics.
|
|
64
|
+
The following local endpoints are used by the Web UI and are also useful for integration and diagnostics:
|
|
81
65
|
|
|
82
66
|
```text
|
|
83
67
|
POST /session-manager/api/delete { sessionId }
|
|
@@ -88,7 +72,7 @@ GET /session-manager/api/preset-scan?sessionId=<sessionId>
|
|
|
88
72
|
POST /session-manager/api/preset-migrate { sessionId, toPreset }
|
|
89
73
|
```
|
|
90
74
|
|
|
91
|
-
Example: migrate
|
|
75
|
+
Example: migrate a session to the `standard` preset.
|
|
92
76
|
|
|
93
77
|
```bash
|
|
94
78
|
curl -s -X POST http://127.0.0.1:3080/session-manager/api/preset-migrate \
|
|
@@ -98,22 +82,16 @@ curl -s -X POST http://127.0.0.1:3080/session-manager/api/preset-migrate \
|
|
|
98
82
|
|
|
99
83
|
## Safety and behavior
|
|
100
84
|
|
|
101
|
-
- **Deletion is permanent
|
|
102
|
-
- Moving a running
|
|
103
|
-
|
|
104
|
-
-
|
|
105
|
-
|
|
106
|
-
- Subagent and transient blank-session placeholders are excluded from destructive
|
|
107
|
-
or migration operations.
|
|
108
|
-
- File rewrites use temporary files and atomic replacement where supported to avoid
|
|
109
|
-
partial session artifacts.
|
|
85
|
+
- **Deletion is permanent**, so the UI always asks for confirmation.
|
|
86
|
+
- Moving a running session first interrupts and closes it, then refreshes the sidebar; reopen the session from the target workspace to continue.
|
|
87
|
+
- Move rewrites the session's stored `cwd`; subsequent tool calls run in the target workspace.
|
|
88
|
+
- Subagent sessions and transient blank-session placeholders are excluded from delete, move, and preset migration.
|
|
89
|
+
- File rewrites use temporary files and atomic replacement (when supported by the environment) to avoid partially written session artifacts.
|
|
110
90
|
|
|
111
91
|
## Compatibility and development
|
|
112
92
|
|
|
113
|
-
-
|
|
114
|
-
|
|
115
|
-
- `lib/index.js` is the host-side ESM plugin and `lib/client.js` is the Web client
|
|
116
|
-
bundle. There is no build step.
|
|
93
|
+
- This is a Cordis plugin with peer dependency `cordis >=4.0.0-rc <5`.
|
|
94
|
+
- `lib/index.js` is the host-side ESM plugin, `lib/client.js` is the Web client bundle; no build step is required.
|
|
117
95
|
- Before submitting changes, run:
|
|
118
96
|
|
|
119
97
|
```powershell
|
|
@@ -124,8 +102,12 @@ node scripts/smoke-test.mjs
|
|
|
124
102
|
npm pack --dry-run
|
|
125
103
|
```
|
|
126
104
|
|
|
127
|
-
|
|
105
|
+
Release history is in [CHANGELOG.md](CHANGELOG.md).
|
|
106
|
+
|
|
107
|
+
## Acknowledgments
|
|
108
|
+
|
|
109
|
+
Thanks to everyone who installs and uses dsh-session-manager, and to the people who file issues and open pull requests to help improve it. This plugin is listed in [dsh-market](https://github.com/dsh-market/dsh-market) and [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin). Suggestions and feedback are welcome.
|
|
128
110
|
|
|
129
111
|
## License
|
|
130
112
|
|
|
131
|
-
[MIT](LICENSE)
|
|
113
|
+
[MIT](LICENSE)
|
package/README.zh.md
CHANGED
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
# dsh-session-manager — DeepSeek Harness 会话管理器
|
|
2
|
-
|
|
3
|
-
[English](README.md) | 中文
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/dsh-session-manager)
|
|
6
|
-
[](https://github.com/hkkz9522/dsh-session-manager)
|
|
1
|
+
# dsh-session-manager — DeepSeek Harness 会话管理器
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 中文
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/dsh-session-manager)
|
|
6
|
+
[](https://github.com/hkkz9522/dsh-session-manager)
|
|
7
7
|
[](https://github.com/hkkz9522/dsh-session-manager/actions/workflows/ci.yml)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
## 功能
|
|
13
|
-
|
|
14
|
-
- **归档 /
|
|
15
|
-
- **删除会话**:带不可逆操作的二次确认。
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
### 从
|
|
49
|
-
|
|
50
|
-
```powershell
|
|
51
|
-
dsh plugin --profile web add
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
POST /session-manager/api/preset-migrate
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
8
|
+
[](https://awesome-dsh-plugin.com)
|
|
9
|
+
|
|
10
|
+
用于在 DeepSeek Harness(DSH)Web 中进行会话管理,包括:删除会话、归档会话、跨工作区移动会话、迁移会话的 Agent 预设。欢迎至 GitHub 提意见。
|
|
11
|
+
|
|
12
|
+
## 功能
|
|
13
|
+
|
|
14
|
+
- **归档 / 移出归档**会话。
|
|
15
|
+
- **删除会话**:带不可逆操作的二次确认。
|
|
16
|
+
- **移动至工作区**:保留历史、标题、归档状态和派生会话关系,同时把会话的工作目录更新为目标工作区。
|
|
17
|
+
- **迁移 Agent 预设**:可按需修改。典型工况:当原预设被改名或删除,导致会话无法恢复时,可修复该会话。
|
|
18
|
+
- **会话管理窗口**:在侧边栏中浏览未归档和已归档会话,并对每一行执行打开、归档 / 移出归档、移动、删除、迁移预设。
|
|
19
|
+
- 当前会话标题区域提供归档 / 移出归档、移动至工作区和红色的删除会话按钮。
|
|
20
|
+
|
|
21
|
+
## UI 入口
|
|
22
|
+
|
|
23
|
+
- **会话标题右侧**:归档 / 移出归档、移动至工作区、删除会话。
|
|
24
|
+
- **侧边栏底部 → 会话管理**:查看全部会话(含归档会话)并操作每一条会话。
|
|
25
|
+
|
|
26
|
+
## Agent 预设迁移
|
|
27
|
+
|
|
28
|
+
1. 打开**会话管理**。
|
|
29
|
+
2. 找到目标会话,点击**迁移预设**。
|
|
30
|
+
3. 从当前可用的预设中选择目标预设并确认。
|
|
31
|
+
|
|
32
|
+
例如:当会话无法恢复,报错表明原 Agent 预设不存在时(例如删掉了 `router-standard`),可以使用迁移功能。
|
|
33
|
+
|
|
34
|
+
插件会优先读取最后一条 `agent-preset/selected` 事件中的有效预设;若不存在该事件,则读取会话 header 中的预设。迁移时会安全改写对应的持久化记录、释放可能残留的 live persistence owner,并刷新会话列表。若该会话当前打开,请在迁移后重新打开再继续会话。
|
|
35
|
+
|
|
36
|
+
> 迁移预设只会修改会话元数据,不会改写历史消息、文件或当前工作区。
|
|
37
|
+
|
|
38
|
+
## 安装
|
|
39
|
+
|
|
40
|
+
本插件已收录于 [dsh-market](https://github.com/dsh-market/dsh-market) 和 [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin),可以通过 DSH 应用内的**插件市场**直接搜索安装。
|
|
41
|
+
|
|
42
|
+
### 从 dsh-market 安装
|
|
43
|
+
|
|
44
|
+
```powershell
|
|
45
|
+
dsh plugin --profile web add npm:dsh-session-manager
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 从 GitHub 安装
|
|
49
|
+
|
|
50
|
+
```powershell
|
|
51
|
+
dsh plugin --profile web add github:hkkz9522/dsh-session-manager
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
安装后重启 DSH Web。若浏览器仍加载旧的客户端代码,请使用 `Ctrl+Shift+R` 强制刷新。
|
|
55
|
+
|
|
56
|
+
### 本地开发 / 运行时注入
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
dev_inject_plugin {"dir": "<本仓库的绝对路径>"}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## HTTP API
|
|
63
|
+
|
|
64
|
+
以下本地接口供 Web UI 使用,也可用于集成和排查:
|
|
65
|
+
|
|
66
|
+
```text
|
|
67
|
+
POST /session-manager/api/delete { sessionId }
|
|
68
|
+
POST /session-manager/api/unarchive { sessionId }
|
|
69
|
+
GET /session-manager/api/workspaces
|
|
70
|
+
POST /session-manager/api/move { sessionId, targetWorkspaceId }
|
|
71
|
+
GET /session-manager/api/preset-scan?sessionId=<sessionId>
|
|
72
|
+
POST /session-manager/api/preset-migrate { sessionId, toPreset }
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
示例:将会话迁移到 `standard` 预设。
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
curl -s -X POST http://127.0.0.1:3080/session-manager/api/preset-migrate \
|
|
79
|
+
-H 'content-type: application/json' \
|
|
80
|
+
-d '{"sessionId":"session-...","toPreset":"standard"}'
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## 安全与行为说明
|
|
84
|
+
|
|
85
|
+
- **删除不可恢复**,因此界面始终要求确认。
|
|
86
|
+
- 移动正在运行的会话时,插件会先中断并关闭该会话,然后自动刷新侧边栏;请在目标工作区重新打开会话后继续。
|
|
87
|
+
- 移动会改写会话保存的 `cwd`,之后的工具调用将在目标工作区执行。
|
|
88
|
+
- subagent 会话和临时空白会话占位不会参与删除、移动或预设迁移。
|
|
89
|
+
- 文件改写使用临时文件和原子替换(环境支持时),避免产生部分写入的会话工件。
|
|
90
|
+
|
|
91
|
+
## 兼容性与开发
|
|
92
|
+
|
|
93
|
+
- 本插件是 Cordis 插件,声明的 peer dependency 为 `cordis >=4.0.0-rc <5`。
|
|
94
|
+
- `lib/index.js` 是 host 端 ESM 插件,`lib/client.js` 是 Web 客户端 bundle,无需构建步骤。
|
|
95
|
+
- 提交修改前请运行:
|
|
96
|
+
|
|
97
|
+
```powershell
|
|
98
|
+
node --check lib/client.js
|
|
99
|
+
node --check lib/index.js
|
|
100
|
+
git diff --check
|
|
101
|
+
node scripts/smoke-test.mjs
|
|
102
|
+
npm pack --dry-run
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
发布记录见 [CHANGELOG.md](CHANGELOG.md)。
|
|
106
|
+
|
|
107
|
+
## 致谢
|
|
108
|
+
|
|
109
|
+
感谢每一位安装和使用 dsh-session-manager 的用户,也感谢提交 Issue 与 Pull Request 帮助改进本插件的朋友们。
|
|
110
|
+
|
|
111
|
+
本插件已被 [dsh-market](https://github.com/dsh-market/dsh-market) 和 [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) 收录。
|
|
112
|
+
欢迎提出修改意见。
|
|
113
|
+
|
|
114
|
+
## 开源许可
|
|
115
|
+
|
|
116
|
+
[MIT](LICENSE)
|
|
117
|
+
|