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/README.md CHANGED
@@ -1,139 +1,163 @@
1
- # dsh-session-manager — session manager for DeepSeek Harness
2
-
3
- English | [中文](README.zh.md)
4
-
5
- [![npm version](https://img.shields.io/npm/v/dsh-session-manager)](https://www.npmjs.com/package/dsh-session-manager)
6
- [![GitHub](https://img.shields.io/badge/GitHub-repository-blue)](https://github.com/hkkz9522/dsh-session-manager)
7
- [![CI](https://github.com/hkkz9522/dsh-session-manager/actions/workflows/ci.yml/badge.svg)](https://github.com/hkkz9522/dsh-session-manager/actions/workflows/ci.yml)
8
- [![Awesome DSH Plugin](https://awesome-dsh-plugin.com/badge.svg)](https://awesome-dsh-plugin.com)
9
-
10
- ## 0 Overview
11
-
12
- DSH Web session manager: delete, archive, move across workspaces, migrate preset; favorites, review-later, search, sort, priority, add tags and notes; bulk processing. Suggestions and feedback are welcome on GitHub.
13
-
14
- ## 1 Features
15
-
16
- ### 1.1 Session lifecycle management
17
-
18
- - **Delete** is irreversible and always asks for confirmation. Subagent sessions and transient blank placeholders (no persisted artifact) cannot be deleted.
19
- - **Archive / Unarchive** moves a session in and out of the active list without touching its disk content.
20
- - **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.
21
- - **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.
22
-
23
- ### 1.2 Session shortcuts
24
-
25
- - **Favorites / Review-later** are manual flags that survive archive and session end; neither is cleared automatically.
26
- - **Search** matches title, session ID, note and tags case-insensitively, trims whitespace, and never reads chat history.
27
- - **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)**.
28
- - **Priority** is a dropdown **1 Highest, 2 High, 3 Normal, 4 Low, 5 Lowest**, default **3 (Normal)**; legacy `null` priorities are normalized to 3.
29
- - **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.
30
- - **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.
31
- - Annotations live in plain text under the DSH home (`dsh-session-manager/annotations.v1.json`), keyed by session ID. Same-origin browser tabs stay in sync via `BroadcastChannel`. Saves are durable across crashes; revision conflicts surface a "load latest" prompt.
32
-
33
- ### 1.3 Bulk management
34
-
35
- - **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.
36
- - **Action bar** lists every batch action:
37
- - **Annotation toggles**: **Archive / Unarchive / Favorite / Unfavorite / Mark for review / Clear review flag**.
38
- - **Mutating actions**: **Add tags / Clear tags / Set priority / Move to workspace / Migrate preset / Delete session**.
39
- - **Confirmation flow**:
40
- - 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.
41
- - Destructive actions (**delete session**) first open a **preview dialog** listing the targeted sessions, then show a progress bar, then a per-id result dialog.
42
-
43
- ## 2 UI entry points
44
-
45
- ### 2.1 Title bar
46
-
47
- The right side of the title area exposes actions for the **current session**: **Archive / Unarchive**, **Tags / Notes**, **Move to workspace**, **Delete session**.
48
-
49
- ### 2.2 Session manager panel
50
-
51
- 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.
52
-
53
- ### 2.3 Bulk management
54
-
55
- 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.
56
-
57
- ## 3 Install
58
-
59
- ### 3.1 From the official plugin management
60
-
61
- Go to **plugin management** inside DSH, search for `dsh-session-manager`, and install it.
62
-
63
- ### 3.2 From dsh-market
64
-
65
- ```powershell
66
- dsh plugin --profile web add npm:dsh-session-manager
67
- ```
68
-
69
- ### 3.3 From GitHub
70
-
71
- ```powershell
72
- dsh plugin --profile web add github:hkkz9522/dsh-session-manager
73
- ```
74
-
75
- After installing, restart DSH Web. If the browser still holds an older client bundle, force-refresh with `Ctrl+Shift+R`.
76
-
77
- ### 3.4 Local development / runtime injection
78
-
79
- ```text
80
- dev_inject_plugin {"dir": "<absolute path to this repository>"}
81
- ```
82
-
83
- ## 4 Safety and behavior
84
-
85
- - **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.
86
- - 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.
87
- - The management list hides subagent sessions and the move API rejects them. Blank sessions without a persisted artifact cannot be moved.
88
- - 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.
89
- - 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.
90
- - Incomplete startup scans skip workspace reconciliation. Complete scans preserve live sessions and any membership added during the scan.
91
- - 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.
92
-
93
- ## 5 Compatibility
94
-
95
- | Plugin version | Verified DSH version |
96
- | --- | --- |
97
- | 0.5.2 | v0.1.7-rc.1 |
98
- | 0.5.1 | v0.1.6-alpha.2 |
99
- | 0.4.11 | v0.1.5-rc.2 |
100
- | 0.4.10 | v0.1.5-rc.1 |
101
- | 0.4.9 | v0.1.5-rc.1 |
102
- | 0.4.7 | v0.1.5-rc.1 |
103
- | 0.4.6 | 0.1.3-alpha.2 |
104
- | 0.4.4 | 0.1.3-alpha.2 |
105
- | 0.4.1 | 0.1.3-alpha.2 |
106
- | 0.4.0 | v0.1.2-rc.1 |
107
- | 0.1.2 | v0.1.0-rc.7 |
108
- | 0.1.1 | v0.1.0-rc.7 |
109
- | 0.1.0 | v0.1.0-rc.7 |
110
-
111
- Requires Node.js 22.15+ (22.x) or 24+ for built-in Zstd support.
112
-
113
- This is a Cordis plugin and declares `cordis: ">=4.0.0-rc <5"` as its peer dependency.
114
-
115
- ## 6 Development
116
-
117
- - `lib/index.js` is the host-side ESM plugin; `lib/client.js` is the Web client bundle. No build step is required.
118
- - Before submitting changes, run:
119
-
120
- ```powershell
121
- npm run check
122
- npm test
123
- npm run check:package
124
- git diff --check
125
- ```
126
-
127
- 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.
128
-
129
- Optional integration check: run `node scripts/smoke-test.mjs` against a running test instance of DSH Web. It contacts a real service and is not part of the default unit test suite.
130
-
131
- Release history is in [CHANGELOG.md](CHANGELOG.md).
132
-
133
- ## 7 Acknowledgments
134
-
135
- 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. 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). Suggestions and feedback are welcome.
136
-
137
- ## 8 License
138
-
139
- [MIT](LICENSE)
1
+ # dsh-session-manager — session manager for DeepSeek Harness
2
+
3
+ English | [中文](README.zh.md)
4
+
5
+ [![npm version](https://img.shields.io/npm/v/dsh-session-manager)](https://www.npmjs.com/package/dsh-session-manager)
6
+ [![GitHub](https://img.shields.io/badge/GitHub-repository-blue)](https://github.com/hkkz9522/dsh-session-manager)
7
+ [![CI](https://github.com/hkkz9522/dsh-session-manager/actions/workflows/ci.yml/badge.svg)](https://github.com/hkkz9522/dsh-session-manager/actions/workflows/ci.yml)
8
+ [![Awesome DSH Plugin](https://awesome-dsh-plugin.com/badge.svg)](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)