dsh-session-manager 0.5.2 → 0.5.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/CHANGELOG.md +264 -247
- package/README.md +163 -139
- package/README.zh.md +163 -137
- package/lib/annotation-store.js +198 -198
- package/lib/client.js +2793 -2772
- package/lib/clipboard-parser.js +207 -207
- package/lib/index.js +13 -2
- package/lib/session-files.js +212 -193
- package/package.json +9 -3
package/README.md
CHANGED
|
@@ -1,139 +1,163 @@
|
|
|
1
|
-
# dsh-session-manager — session manager for DeepSeek Harness
|
|
2
|
-
|
|
3
|
-
English | [中文](README.zh.md)
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/dsh-session-manager)
|
|
6
|
-
[](https://github.com/hkkz9522/dsh-session-manager)
|
|
7
|
-
[](https://github.com/hkkz9522/dsh-session-manager/actions/workflows/ci.yml)
|
|
8
|
-
[](https://awesome-dsh-plugin.com)
|
|
9
|
-
|
|
10
|
-
## 0 Overview
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
### 3.3
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
1
|
+
# dsh-session-manager — session manager for DeepSeek Harness
|
|
2
|
+
|
|
3
|
+
English | [中文](README.zh.md)
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/dsh-session-manager)
|
|
6
|
+
[](https://github.com/hkkz9522/dsh-session-manager)
|
|
7
|
+
[](https://github.com/hkkz9522/dsh-session-manager/actions/workflows/ci.yml)
|
|
8
|
+
[](https://awesome-dsh-plugin.com)
|
|
9
|
+
|
|
10
|
+
## 0 Overview
|
|
11
|
+
|
|
12
|
+
DeepSeek Harness session manager: delete, archive, move sessions across workspaces, migrate presets, favorites, review-later, search, filter, sort, prioritize, add tags and notes, and batch-manage sessions.
|
|
13
|
+
|
|
14
|
+
Verified with the current official DSH Web UI and Desktop app. Both environments use the same plugin's Host/client functionality; environment-specific installation notes are documented below.
|
|
15
|
+
|
|
16
|
+
## 1 Features
|
|
17
|
+
|
|
18
|
+
### 1.1 Session lifecycle management
|
|
19
|
+
|
|
20
|
+
- **Delete** is irreversible and always asks for confirmation. Subagent sessions and transient blank placeholders (no persisted artifact) cannot be deleted.
|
|
21
|
+
- **Archive / Unarchive** moves a session in and out of the active list without touching its disk content.
|
|
22
|
+
- **Move to workspace** keeps history, title, archive state and derived-session relationships intact, rewrites the session's `cwd` to the target workspace, and updates the live writer's header in place so any pending tool calls keep landing on the new path.
|
|
23
|
+
- **Migrate Agent preset** rewrites the latest `agent-preset/selected` event (or the session header if no such event exists) so a session whose preset was renamed or removed can resume. Message history is never altered.
|
|
24
|
+
|
|
25
|
+
### 1.2 Session shortcuts
|
|
26
|
+
|
|
27
|
+
- **Favorites / Review-later** are manual flags that survive archive and session end; neither is cleared automatically.
|
|
28
|
+
- **Search** matches title, session ID, note and tags case-insensitively, trims whitespace, and never reads chat history.
|
|
29
|
+
- **Filters and sorting** combine a workspace selector (All / Ungrouped / specific) with an archive filter (All / Active / Archived), then layer favorites / review, tag and priority filters on top. Sort by recently updated (default), least recently updated, newest created, oldest created, or **priority (1 → 5)**.
|
|
30
|
+
- **Priority** is a dropdown **1 Highest, 2 High, 3 Normal, 4 Low, 5 Lowest**, default **3 (Normal)**; legacy `null` priorities are normalized to 3.
|
|
31
|
+
- **Tags / Notes**: up to 20 tags per session (≤ 32 characters each) and a 2000-character note. Both English `,` and Chinese `,` are separators, whitespace is trimmed, duplicate tags are merged case-insensitively.
|
|
32
|
+
- **AI-assisted tagging** is manual and opt-in: **Copy Prompt** writes a structured prompt (Chinese or English, matched to the active UI) to the clipboard; **Import** parses the clipboard JSON (tolerating Markdown fences, conversational wrappers, smart quotes, stray backslashes and a leading BOM), validates it against the same limits, and populates the editor fields. Neither button calls a model automatically.
|
|
33
|
+
- Annotations live in plain text under the DSH home (`dsh-session-manager/annotations.v1.json`), keyed by session ID. Same-origin client instances stay in sync via `BroadcastChannel`. Saves are durable across crashes; revision conflicts surface a "load latest" prompt.
|
|
34
|
+
|
|
35
|
+
### 1.3 Bulk management
|
|
36
|
+
|
|
37
|
+
- **Batch process mode**: click the toggle in the panel header to reveal row checkboxes, a **Select all in filter / Clear selection** toolbar pair, and the bulk action bar. Exiting batch process clears the current selection.
|
|
38
|
+
- **Action bar** lists every batch action:
|
|
39
|
+
- **Annotation toggles**: **Archive / Unarchive / Favorite / Unfavorite / Mark for review / Clear review flag**.
|
|
40
|
+
- **Mutating actions**: **Add tags / Clear tags / Set priority / Move to workspace / Migrate preset / Delete session**.
|
|
41
|
+
- **Confirmation flow**:
|
|
42
|
+
- Non-destructive actions (archive / unarchive / favorite / unfavorite / review / unreview / add-tags / clear-tags / set-priority / move / preset-migrate) fire immediately and report per-session results in a **result dialog** with **Success / Failed / Skipped** groups and a one-click **Retry failed** that re-arms the failed IDs into the selection.
|
|
43
|
+
- Destructive actions (**delete session**) first open a **preview dialog** listing the targeted sessions, then show a progress bar, then a per-id result dialog.
|
|
44
|
+
|
|
45
|
+
## 2 UI entry points
|
|
46
|
+
|
|
47
|
+
### 2.1 Title bar
|
|
48
|
+
|
|
49
|
+
The right side of the title area exposes actions for the **current session**: **Archive / Unarchive**, **Tags / Notes**, **Move to workspace**, **Delete session**.
|
|
50
|
+
|
|
51
|
+
### 2.2 Session manager panel
|
|
52
|
+
|
|
53
|
+
Open the **Session manager** panel from the bottom of DSH's sidebar to browse every session, switch workspaces, search by title or ID, apply filters and sorting, and run **Open / Archive / Unarchive / Tags / Notes / Move / Migrate preset / Delete** on any row. The panel header carries the workspace selector, archive filter, favorites / review flags, tag and priority filters, sort order, and matching / total counts plus a reset action.
|
|
54
|
+
|
|
55
|
+
### 2.3 Bulk management
|
|
56
|
+
|
|
57
|
+
The **Batch process** button in the session manager panel header is the entry point: click it once to enter batch process (row checkboxes appear, the **Select all in filter / Clear selection** pair and the bulk action bar show up); click it again to exit batch process.
|
|
58
|
+
|
|
59
|
+
## 3 Installation
|
|
60
|
+
|
|
61
|
+
### 3.1 Install from Plugins
|
|
62
|
+
|
|
63
|
+
In DSH, open **Plugins**, add a plugin, search for `dsh-session-manager`, and install it. This method is supported by both the official Web UI and Desktop app.
|
|
64
|
+
|
|
65
|
+
### 3.2 Install from Third-Party Plugin Markets
|
|
66
|
+
|
|
67
|
+
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).
|
|
68
|
+
|
|
69
|
+
### 3.3 Install to the Web profile via CLI
|
|
70
|
+
|
|
71
|
+
Install from npm:
|
|
72
|
+
|
|
73
|
+
```powershell
|
|
74
|
+
dsh plugin --profile web add npm:dsh-session-manager
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Install from GitHub:
|
|
78
|
+
|
|
79
|
+
```powershell
|
|
80
|
+
dsh plugin --profile web add github:hkkz9522/dsh-session-manager
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Restart DSH Web after installation. If the browser still loads an older client bundle, use `Ctrl+Shift+R` to force-refresh the page.
|
|
84
|
+
|
|
85
|
+
> The `desktop` profile is managed by the official Desktop app and is not intended to be modified with the regular `dsh` CLI. Desktop users should install the plugin through **Plugins** in the app.
|
|
86
|
+
|
|
87
|
+
### 3.4 Local Development / Testing
|
|
88
|
+
|
|
89
|
+
#### Web profile
|
|
90
|
+
|
|
91
|
+
Install the local repository via CLI:
|
|
92
|
+
|
|
93
|
+
```powershell
|
|
94
|
+
dsh plugin --profile web add <path-to-this-repository>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The local repository is linked to the current profile as a plugin checkout, making it suitable for modifying the source code directly and testing changes.
|
|
98
|
+
|
|
99
|
+
#### Desktop app
|
|
100
|
+
|
|
101
|
+
Open **Plugins** in the official Desktop app and use the absolute path to the local repository as the installation source.
|
|
102
|
+
|
|
103
|
+
For client-side code, changes can be reloaded automatically after saving when HMR is working normally. If a change does not take effect immediately, reload the current interface or restart the corresponding DSH Web / Desktop client.
|
|
104
|
+
|
|
105
|
+
After changing plugin dependencies, `package.json`, bundle configuration, or other installation- or loading-related settings, reinstalling the plugin or restarting the corresponding client is recommended.
|
|
106
|
+
|
|
107
|
+
## 4 Safety and behavior
|
|
108
|
+
|
|
109
|
+
- **Deletion is permanent**, so the UI always asks for confirmation. The API checks the session ID, directory boundary and artifact header before deletion; traversal, symlinks and junctions are refused.
|
|
110
|
+
- Move and preset migration keep the live session / agent alive; only deletion cancels and disposes the session. Move updates the stored `cwd` and the existing live writer's header.
|
|
111
|
+
- The management list hides subagent sessions and the move API rejects them. Blank sessions without a persisted artifact cannot be moved.
|
|
112
|
+
- Cold rewrites preserve the artifact's stored format (V1 / V2 / V3 / V4 are all readable; the plugin never forces an upgrade). Moves and rewrites refuse corrupt / truncated Zstd logs or JSONL logs with incomplete final lines instead of publishing partial history.
|
|
113
|
+
- Preset migration separates backup, publication and rollback. If rollback fails, recovery files are retained and their paths are included in the error; do not remove them.
|
|
114
|
+
- Incomplete startup scans skip workspace reconciliation. Complete scans preserve live sessions and any membership added during the scan.
|
|
115
|
+
- Plugin mutations are serialized per session and request bodies are limited to 64 KiB. This queue supplements, rather than replaces, DSH's own persistence coordination.
|
|
116
|
+
|
|
117
|
+
## 5 Compatibility
|
|
118
|
+
|
|
119
|
+
DSH versions are shown above plugin versions; each column represents a tested version combination.
|
|
120
|
+
|
|
121
|
+
| v0.2.0-rc.2 | v0.1.7-rc.2 | v0.1.7-rc.1 |
|
|
122
|
+
| --- | --- | --- |
|
|
123
|
+
| 0.5.4 | 0.5.3 | 0.5.2 |
|
|
124
|
+
|
|
125
|
+
| v0.1.6-alpha.2 | v0.1.5-rc.2 | v0.1.5-rc.1 |
|
|
126
|
+
| --- | --- | --- |
|
|
127
|
+
| 0.5.1 | 0.4.11 | 0.4.10, 0.4.9, 0.4.7 |
|
|
128
|
+
|
|
129
|
+
| v0.1.3-alpha.2 | v0.1.2-rc.1 | v0.1.0-rc.7 |
|
|
130
|
+
| --- | --- | --- |
|
|
131
|
+
| 0.4.6, 0.4.4, 0.4.1 | 0.4.0 | 0.1.2, 0.1.1, 0.1.0 |
|
|
132
|
+
|
|
133
|
+
The version combinations above have been tested with either the official Web UI or Desktop app. Other version combinations may also work but have not been individually verified.
|
|
134
|
+
|
|
135
|
+
When using a standalone DSH CLI/runtime, Node.js 22.15+ (22.x) or 24+ is required for built-in Zstd support. The official Desktop app ships and manages its matching runtime separately.
|
|
136
|
+
|
|
137
|
+
This is a Cordis plugin and declares `cordis: ">=4.0.0-rc <5"` as its peer dependency.
|
|
138
|
+
|
|
139
|
+
## 6 Development
|
|
140
|
+
|
|
141
|
+
- `lib/index.js` is the host-side ESM plugin; `lib/client.js` is the client UI bundle. No build step is required.
|
|
142
|
+
- Before submitting changes, run:
|
|
143
|
+
|
|
144
|
+
```powershell
|
|
145
|
+
npm run check
|
|
146
|
+
npm test
|
|
147
|
+
npm run check:package
|
|
148
|
+
git diff --check
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Tests use isolated temporary directories and the real plugin entry point, never real sessions. CI runs these checks on Windows / Linux with Node 22.15.0 / 24.
|
|
152
|
+
|
|
153
|
+
Optional integration check: run `node scripts/smoke-test.mjs` against a running DSH Web-profile test instance. It contacts a real service and is not part of the default unit test suite.
|
|
154
|
+
|
|
155
|
+
Release history is in [CHANGELOG.md](CHANGELOG.md).
|
|
156
|
+
|
|
157
|
+
## 7 Acknowledgments
|
|
158
|
+
|
|
159
|
+
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. Suggestions and feedback are welcome.
|
|
160
|
+
|
|
161
|
+
## 8 License
|
|
162
|
+
|
|
163
|
+
[MIT](LICENSE)
|