dsh-session-manager 0.4.7 → 0.4.10

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 CHANGED
@@ -1,131 +1,185 @@
1
- # Changelog
2
-
3
- ## 0.4.7 — 2026-09-10
4
-
5
- - **fix(disk scan)**: include `session.v3.jsonl.zstd` in the on-disk
6
- filename list used by readSessionArtifact() and listSessionHeaders().
7
- DSH 0.1.5-rc.1's persistence backend writes generation v3 artifacts at
8
- that filename; the 0.4.6 release scanned only v2/plaintext names, so
9
- fresh sessions appeared to have no disk record and the move/migrate
10
- endpoints failed with "会话没有磁盘记录" / "session has no artifact".
11
-
12
- - **chore**: bump version to 0.4.7.
13
-
14
-
15
- ## 0.4.6 — 2026-09-05
16
-
17
- - **fix(persistence)**: read all concatenated Zstandard frames in a session
18
- artifact. DSH writes one frame for the header and additional frames for
19
- event batches; reading only the first frame made sessions appear to lose
20
- their event history after refresh.
21
- - **fix(move)**: preserve the session generation/header version when
22
- re-homing an artifact, and synchronize the live session, persistence
23
- coordinator, registry indexes, and workspace accounting after a move.
24
- This avoids stale-path `ENOENT` failures and v2/v0 filename/header
25
- mismatches on the next DSH startup.
26
- - **fix(preset migration)**: fall back to an id-based artifact scan when a
27
- persistence locate result points at a stale path, and mirror cold-path
28
- migrations into the live session projection.
29
- - **fix(client)**: stop calling the removed/unavailable
30
- `noteAgentPreset` client method; refresh the session projection instead.
31
- - **recovery**: add `scripts/heal-v2-sessions.ps1` for the DSH 0.1.1-rc.2
32
- boot-time quirk where `session.v2.jsonl.zstd` contains a `version: 0`
33
- header. Run it before starting DSH; this repair must happen before DSH's
34
- workspace initialization, which is earlier than user plugin `apply()`.
35
-
36
- - **docs**: bump version to 0.4.6.
37
- ## 0.4.5 — 2026-09-05
38
-
39
- - **fix(move)**: keep the live session and agent in place during a cross-workspace
40
- move. The previous code tore down the live agent/session, moved the file, then
41
- called `ctx.agents.resume` to re-create the agent. DSH's `agent/status` event
42
- is only emitted on phase changes, so a freshly resumed agent never told the
43
- client it was now idle, leaving the sidebar's model selector and send button
44
- disabled ("会话不可用") until a manual browser refresh. The new path flushes
45
- pending events to disk, updates the in-memory session header + coordinator
46
- state + workspace accounting in place, and atomically renames the artifact,
47
- so the agent's UI keeps showing the same in-memory session with no client
48
- re-init.
49
- - **fix(preset migration)**: drop the over-strict `persistence.readRaw` /
50
- `persistence.list` precondition that caused the
51
- `/session-manager/api/preset-scan` endpoint to fail with
52
- `current persistence backend does not support readRaw/list` on a default DSH
53
- build. The actual `JsonlSessionPersistence` backend exposes both methods, so
54
- the precondition is replaced with a try/catch around `listSessionHeaders` that
55
- converts any missing-method failure into a useful
56
- `failed to enumerate sessions: <detail>` message.
57
- - **chore**: remove the now-unused `quietLive` / `releaseLiveSession` helpers
58
- and squash the per-route indentation noise around `/move` and `/workspaces`.
59
-
60
- ## 0.4.4 — 2026-09-03
61
-
62
- - **docs**: rename the English README wording from `conversation` to `session` to align with the plugin name (`dsh-session-manager`), the Chinese README (`会话`), the DSH host APIs, and the [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) registry entry.
63
- - **chore**: rewrite `package.json` `description` to use `Session manager` / `sessions` for the same alignment, and bump the version to `0.4.4`.
64
- - **chore(repo)**: update the GitHub repository description to match.
65
-
66
- ## 0.4.3 — 2026-09-03
67
-
68
- - **docs**: add the [Awesome DSH Plugin](https://awesome-dsh-plugin.com) badge to `README.md` / `README.zh.md` so the repo surfaces its curated registry membership.
69
-
70
- ## 0.4.2 — 2026-09-03
71
-
72
- - **feat(theme)**: dialogs now auto-follow DSH''s dark/light theme (`data-ds-dark-theme` / ` `code-scheme` / `data-theme`) via a single `data-sm-theme` attribute and scoped CSS variables, with inline `background` / `color` / `border-color` applied to each dialog root so they stay opaque regardless of how DSH resolves its own tokens. The previous manual light/dark toggle button is removed.
73
- - **docs**: aligned bilingual README structure, dropped the obsolete "no bulk migration" wording, and added an Acknowledgments section that thanks the users and the contributors filing issues and opening PRs. Listed [dsh-market](https://github.com/dsh-market/dsh-market) and [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) as install sources.
74
- - **chore**: rewrote `package.json` `description` to match the new English summary.
75
-
76
- ## 0.4.1 — 2026-08-28
77
-
78
- - **fix(ui)**: keep the title-bar **Delete conversation** button readable on hover with a red background, white text, and red border; remove the unused legacy danger-button rules.
79
-
80
- ## 0.4.0 — 2026-08-28
81
-
82
- - **feat(session preset migration)**: replaces the former bulk workflow with a
83
- per-conversation **Migrate preset** action in Session manager. It resolves the
84
- effective preset from the latest `agent-preset/selected` event or, when absent,
85
- the session header, then safely updates that one conversation.
86
- - **fix(lifecycle)**: moving a conversation or migrating its preset now retires stale
87
- live agents and persistence owners before refresh. This prevents resume failures
88
- such as `already has a live persistence owner`.
89
- - **fix(move)**: refreshes session and workspace state immediately and once more after
90
- the host event race, so a moved conversation reappears in its target workspace
91
- without a manual browser refresh.
92
- - **ui**: finalizes header actions and Session manager dialogs: red delete actions,
93
- per-row preset migration, consistent dialog placement, readable hover states, and
94
- a close button beside the manager title.
95
- - **docs**: refreshes bilingual documentation and npm metadata for the single-session
96
- preset migration workflow.
97
-
98
- ## 0.3.0 — 2026-08-27
99
-
100
- - **feat(preset migration)**: introduced preset migration support for conversations
101
- whose configured Agent preset was renamed or removed.
102
- - **feat(move)**: added workspace move handling and client-side workspace refreshes.
103
-
104
- ## 0.2.1 — 2026-08-26
105
-
106
- - **fix(move)**: reimplemented cross-workspace moves so the session artifact, stored
107
- `cwd`, and workspace accounting are moved together while preserving history,
108
- title, archive state, and derived-session relationships.
109
- - **feat(workspaces API)**: added the workspace projection endpoint used by the move UI.
110
- - **guard**: reject subagent and transient blank-session placeholders for move actions.
111
-
112
- ## 0.2.0 — 2026-08-16
113
-
114
- > ⚠️ The initial workspace-move implementation was superseded by 0.2.1.
115
-
116
- - **feat(move)**: added the initial move-to-workspace UI and host endpoints.
117
-
118
- ## 0.1.2 — 2026-08-16
119
-
120
- - **docs**: synchronized package metadata and bilingual README files for publication.
121
-
122
- ## 0.1.1 — 2026-08-16
123
-
124
- - **fix(panel)**: hide transient blank-session placeholders from the manager panel.
125
- - **test**: added the host API smoke test.
126
- - **ci**: added syntax and package-content verification.
127
-
128
- ## 0.1.0 — 2026-08-16
129
-
130
- - **feat**: initial session deletion with confirmation, archive management, and the
131
- Session manager panel.
1
+ # Changelog
2
+
3
+ ## 0.4.10 — 2026-09-13
4
+
5
+ - **fix(move)**: cross-workspace move no longer breaks the live JSONL writer. The DSH JSONL backend keeps one `JsonlSessionHandle` per session id in an in-process tracker; its `header.cwd` is captured at construction, and the api-gateway's `session/event` router writes through that handle, so a session whose header was rewritten in memory but whose writer was still pointing at the pre-move directory started throwing `ENOENT` on the first new message (issue #8). `moveSession` now mutates the live writer's `header` in place so its persist path flips to the target `cwd` while the same handle, queue, cursor, and lease are retained; the Agent's owned handle therefore stays consistent with the tracker entry, and no `session/disposed` is fabricated. If the runtime does not expose a rebindable writer (older DSH builds or a custom backend), the move now refuses up front with a clear message instead of silently leaving the live session writing to a deleted path. Adds `test/issue-8-move-enoent.test.mjs` (post-move writer identity stability + a "no-fix ENOENT" regression guard) and `test/issue-8-repro/` (a standalone reproducer script).
6
+
7
+ - **chore**: bump version to 0.4.10.
8
+
9
+ ## 0.4.9 — 2026-09-12
10
+
11
+ - **fix(ui)**: Session manager panel and inner dialogs (Delete / Move /
12
+ Migrate confirmations) now close on Esc regardless of focus
13
+ position (issue #7). The original layer-bound onKeyDown was
14
+ unreachable because the sidebar toggle / row button that opened
15
+ each modal stayed focused -- focus is a sibling of the layer,
16
+ not a descendant, so keydown never bubbles into the modal subtree.
17
+ ConfirmDialog / MoveDialog are also used by the title-bar Delete
18
+ / Move actions, so this fix applies there too.
19
+
20
+ - **fix(ui)**: Modals now close ONLY via Esc or their explicit close
21
+ buttons. The original 0.4.7 behavior (close on backdrop click)
22
+ was removed per user feedback -- a stray click outside the panel
23
+ was dismissing it accidentally. Every `.sm-nativeDialogBackdrop`
24
+ `onMouseDown` handler is gone; the dim backdrop itself is also
25
+ gone so opening a modal never darkens the page (sidebar or
26
+ content area).
27
+
28
+ - **refactor(ui)**: Esc handling moved from per-layer `onKeyDown`
29
+ to a `window`-level `keydown` listener via `useEffect` on every
30
+ modal. A `useRef` lets the listener see the latest state values
31
+ without re-subscribing on every render. The panel listener
32
+ returns early when any inner dialog is open so the child
33
+ dialog's listener gets the first shot at Esc.
34
+
35
+ - **fix(ui)**: After a keyboard-driven close (Esc), the originally
36
+ focused trigger button (sidebar toggle / row button / Cancel
37
+ button) no longer leaves a lingering `:focus-visible` ring. The
38
+ four Esc handlers `blur()` the active element after the close
39
+ call. Mouse-driven closes are not affected -- `:focus-visible`
40
+ only activates for keyboard-acquired focus.
41
+
42
+ - **fix(ui)**: ConfirmDialog no longer listens for Enter at the
43
+ layer level. The previous handler raced with the focused Cancel
44
+ button's native Enter handler -- both fired (`onCancel` +
45
+ `onConfirm`). Enter now lives only on the focused button.
46
+
47
+ - **cleanup(ui)**: Remove three dead `<section>` `ref={(el) =>
48
+ el.focus()}` callbacks (sections have no `tabindex` and are
49
+ not focusable, so the focus calls were silent no-ops). Also
50
+ remove the now-unused `onPanelKey` callback and `tabIndex: -1`
51
+ attributes on the modal layers. The `.sm-nativeDialogBackdrop`
52
+ divs are no longer rendered at all -- they had no behavior left
53
+ after removing the click-to-close.
54
+
55
+ - **chore**: bump version to 0.4.9.
56
+
57
+ ## 0.4.7 — 2026-09-10
58
+
59
+ - **fix(disk scan)**: include `session.v3.jsonl.zstd` in the on-disk
60
+ filename list used by readSessionArtifact() and listSessionHeaders().
61
+ DSH 0.1.5-rc.1's persistence backend writes generation v3 artifacts at
62
+ that filename; the 0.4.6 release scanned only v2/plaintext names, so
63
+ fresh sessions appeared to have no disk record and the move/migrate
64
+ endpoints failed with "会话没有磁盘记录" / "session has no artifact".
65
+
66
+ - **chore**: bump version to 0.4.7.
67
+
68
+
69
+ ## 0.4.6 — 2026-09-05
70
+
71
+ - **fix(persistence)**: read all concatenated Zstandard frames in a session
72
+ artifact. DSH writes one frame for the header and additional frames for
73
+ event batches; reading only the first frame made sessions appear to lose
74
+ their event history after refresh.
75
+ - **fix(move)**: preserve the session generation/header version when
76
+ re-homing an artifact, and synchronize the live session, persistence
77
+ coordinator, registry indexes, and workspace accounting after a move.
78
+ This avoids stale-path `ENOENT` failures and v2/v0 filename/header
79
+ mismatches on the next DSH startup.
80
+ - **fix(preset migration)**: fall back to an id-based artifact scan when a
81
+ persistence locate result points at a stale path, and mirror cold-path
82
+ migrations into the live session projection.
83
+ - **fix(client)**: stop calling the removed/unavailable
84
+ `noteAgentPreset` client method; refresh the session projection instead.
85
+ - **recovery**: add `scripts/heal-v2-sessions.ps1` for the DSH 0.1.1-rc.2
86
+ boot-time quirk where `session.v2.jsonl.zstd` contains a `version: 0`
87
+ header. Run it before starting DSH; this repair must happen before DSH's
88
+ workspace initialization, which is earlier than user plugin `apply()`.
89
+
90
+ - **docs**: bump version to 0.4.6.
91
+ ## 0.4.5 — 2026-09-05
92
+
93
+ - **fix(move)**: keep the live session and agent in place during a cross-workspace
94
+ move. The previous code tore down the live agent/session, moved the file, then
95
+ called `ctx.agents.resume` to re-create the agent. DSH's `agent/status` event
96
+ is only emitted on phase changes, so a freshly resumed agent never told the
97
+ client it was now idle, leaving the sidebar's model selector and send button
98
+ disabled ("会话不可用") until a manual browser refresh. The new path flushes
99
+ pending events to disk, updates the in-memory session header + coordinator
100
+ state + workspace accounting in place, and atomically renames the artifact,
101
+ so the agent's UI keeps showing the same in-memory session with no client
102
+ re-init.
103
+ - **fix(preset migration)**: drop the over-strict `persistence.readRaw` /
104
+ `persistence.list` precondition that caused the
105
+ `/session-manager/api/preset-scan` endpoint to fail with
106
+ `current persistence backend does not support readRaw/list` on a default DSH
107
+ build. The actual `JsonlSessionPersistence` backend exposes both methods, so
108
+ the precondition is replaced with a try/catch around `listSessionHeaders` that
109
+ converts any missing-method failure into a useful
110
+ `failed to enumerate sessions: <detail>` message.
111
+ - **chore**: remove the now-unused `quietLive` / `releaseLiveSession` helpers
112
+ and squash the per-route indentation noise around `/move` and `/workspaces`.
113
+
114
+ ## 0.4.4 — 2026-09-03
115
+
116
+ - **docs**: rename the English README wording from `conversation` to `session` to align with the plugin name (`dsh-session-manager`), the Chinese README (`会话`), the DSH host APIs, and the [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) registry entry.
117
+ - **chore**: rewrite `package.json` `description` to use `Session manager` / `sessions` for the same alignment, and bump the version to `0.4.4`.
118
+ - **chore(repo)**: update the GitHub repository description to match.
119
+
120
+ ## 0.4.3 — 2026-09-03
121
+
122
+ - **docs**: add the [Awesome DSH Plugin](https://awesome-dsh-plugin.com) badge to `README.md` / `README.zh.md` so the repo surfaces its curated registry membership.
123
+
124
+ ## 0.4.2 — 2026-09-03
125
+
126
+ - **feat(theme)**: dialogs now auto-follow DSH''s dark/light theme (`data-ds-dark-theme` / ` `code-scheme` / `data-theme`) via a single `data-sm-theme` attribute and scoped CSS variables, with inline `background` / `color` / `border-color` applied to each dialog root so they stay opaque regardless of how DSH resolves its own tokens. The previous manual light/dark toggle button is removed.
127
+ - **docs**: aligned bilingual README structure, dropped the obsolete "no bulk migration" wording, and added an Acknowledgments section that thanks the users and the contributors filing issues and opening PRs. Listed [dsh-market](https://github.com/dsh-market/dsh-market) and [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) as install sources.
128
+ - **chore**: rewrote `package.json` `description` to match the new English summary.
129
+
130
+ ## 0.4.1 — 2026-08-28
131
+
132
+ - **fix(ui)**: keep the title-bar **Delete conversation** button readable on hover with a red background, white text, and red border; remove the unused legacy danger-button rules.
133
+
134
+ ## 0.4.0 — 2026-08-28
135
+
136
+ - **feat(session preset migration)**: replaces the former bulk workflow with a
137
+ per-conversation **Migrate preset** action in Session manager. It resolves the
138
+ effective preset from the latest `agent-preset/selected` event or, when absent,
139
+ the session header, then safely updates that one conversation.
140
+ - **fix(lifecycle)**: moving a conversation or migrating its preset now retires stale
141
+ live agents and persistence owners before refresh. This prevents resume failures
142
+ such as `already has a live persistence owner`.
143
+ - **fix(move)**: refreshes session and workspace state immediately and once more after
144
+ the host event race, so a moved conversation reappears in its target workspace
145
+ without a manual browser refresh.
146
+ - **ui**: finalizes header actions and Session manager dialogs: red delete actions,
147
+ per-row preset migration, consistent dialog placement, readable hover states, and
148
+ a close button beside the manager title.
149
+ - **docs**: refreshes bilingual documentation and npm metadata for the single-session
150
+ preset migration workflow.
151
+
152
+ ## 0.3.0 — 2026-08-27
153
+
154
+ - **feat(preset migration)**: introduced preset migration support for conversations
155
+ whose configured Agent preset was renamed or removed.
156
+ - **feat(move)**: added workspace move handling and client-side workspace refreshes.
157
+
158
+ ## 0.2.1 — 2026-08-26
159
+
160
+ - **fix(move)**: reimplemented cross-workspace moves so the session artifact, stored
161
+ `cwd`, and workspace accounting are moved together while preserving history,
162
+ title, archive state, and derived-session relationships.
163
+ - **feat(workspaces API)**: added the workspace projection endpoint used by the move UI.
164
+ - **guard**: reject subagent and transient blank-session placeholders for move actions.
165
+
166
+ ## 0.2.0 — 2026-08-16
167
+
168
+ > ⚠️ The initial workspace-move implementation was superseded by 0.2.1.
169
+
170
+ - **feat(move)**: added the initial move-to-workspace UI and host endpoints.
171
+
172
+ ## 0.1.2 — 2026-08-16
173
+
174
+ - **docs**: synchronized package metadata and bilingual README files for publication.
175
+
176
+ ## 0.1.1 — 2026-08-16
177
+
178
+ - **fix(panel)**: hide transient blank-session placeholders from the manager panel.
179
+ - **test**: added the host API smoke test.
180
+ - **ci**: added syntax and package-content verification.
181
+
182
+ ## 0.1.0 — 2026-08-16
183
+
184
+ - **feat**: initial session deletion with confirmation, archive management, and the
185
+ Session manager panel.
package/README.md CHANGED
@@ -1,107 +1,109 @@
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
- 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.
11
-
12
- ## Features
13
-
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 rewrites 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 panel**: browse active and archived sessions in the sidebar, and run Open, Archive / Unarchive, Move, Migrate preset, or Delete on each row.
19
- - The current session's title area offers Archive / Unarchive, Move to workspace, and a red Delete session button.
20
- - Each dialog button (Move, Migrate preset, Delete, plus the Session manager toggle) closes its own popup when clicked a second time, matching the built-in title-area buttons.
21
-
22
- ## Where to find the UI
23
-
24
- - **Session title area (right side):** Archive / Unarchive, Move to workspace, Delete session.
25
- - **Sidebar footer → Session manager:** browse all sessions (including archived ones) and operate on each one.
26
-
27
- ## Agent preset migration
28
-
29
- 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`.
30
-
31
- 1. Open **Session manager**.
32
- 2. Locate the session and select **Migrate preset**.
33
- 3. Choose one of the currently available target presets and confirm.
34
-
35
- The plugin determines the session's effective preset from its latest `agent-preset/selected` event when present; otherwise it uses the session header. It then rewrites that event in place (or appends a fresh one if the session has never recorded a selection), so the migration is durable and the prior entry remains visible in the event log as history. For a live session, the new event is appended in memory via `Session.append()` and flushed to disk via `SessionStore.flush()`; the api-gateway's chat panel sees the new preset on the next event fold.
36
-
37
- > A preset migration changes session metadata only. It does not alter message history, files, or the selected workspace.
38
-
39
- ## Install
40
-
41
- 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.
42
-
43
- ### From dsh-market
44
-
45
- ```powershell
46
- dsh plugin --profile web add npm:dsh-session-manager
47
- ```
48
-
49
- ### From GitHub
50
-
51
- ```powershell
52
- dsh plugin --profile web add github:hkkz9522/dsh-session-manager
53
- ```
54
-
55
- Restart DSH Web after installation. If the browser still holds an older client bundle, force refresh with `Ctrl+Shift+R`.
56
-
57
- ### Local development / runtime injection
58
-
59
- ```text
60
- dev_inject_plugin {"dir": "<absolute path to this repository>"}
61
- ```
62
-
63
- ## Safety and behavior
64
-
65
- - **Deletion is permanent**, so the UI always asks for confirmation.
66
- - Move and Migrate preset do **not** tear down the live agent or session. They keep the in-memory session/agent alive, write the new artifact in place, update the in-memory session header to point at the new cwd (move) or append the new event (migrate), and refresh the workspace registry. The api-gateway's chat panel therefore stays "available" without a manual refresh.
67
- - Move rewrites the session's stored `cwd`; subsequent tool calls run in the target workspace.
68
- - Subagent sessions and transient blank-session placeholders are excluded from Delete, Move, and Migrate preset.
69
- - The move path encodes the artifact in the backend's own physical layout (zstd frames with a one-header-line first frame, or plain JSONL), matching DSH's own writer. The migrate path rewrites the relevant event in place at the existing file.
70
-
71
- ## Compatibility
72
-
73
- | Plugin version | Verified DSH version |
74
- | --- | --- |
75
- | 0.4.7 | v0.1.5-rc.1 |
76
- | 0.4.4 | 0.1.3-alpha.2 |
77
- | 0.4.1 | 0.1.3-alpha.2 |
78
- | 0.4.0 | v0.1.2-rc.1 |
79
- | 0.1.2 | v0.1.0-rc.7 |
80
- | 0.1.1 | v0.1.0-rc.7 |
81
- | 0.1.0 | v0.1.0-rc.7 |
82
-
83
- The plugin is a Cordis plugin and declares `cordis: ">=4.0.0-rc <5"` as its peer dependency.
84
-
85
- ## Development
86
-
87
- - `lib/index.js` is the host-side ESM plugin; `lib/client.js` is the Web client bundle. No build step is required.
88
- - Before submitting changes, run:
89
-
90
- ```powershell
91
- node --check lib/client.js
92
- node --check lib/index.js
93
- node --test test/*.test.mjs
94
- node scripts/smoke-test.mjs
95
- git diff --check
96
- npm pack --dry-run
97
- ```
98
-
99
- Release history is in [CHANGELOG.md](CHANGELOG.md).
100
-
101
- ## Acknowledgments
102
-
103
- 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.
104
-
105
- ## License
106
-
107
- [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
+ 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.
11
+
12
+ ## Features
13
+
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 rewrites 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 panel**: browse active and archived sessions in the sidebar, and run Open, Archive / Unarchive, Move, Migrate preset, or Delete on each row.
19
+ - The current session's title area offers Archive / Unarchive, Move to workspace, and a red Delete session button.
20
+ - Each dialog button (Move, Migrate preset, Delete, plus the Session manager toggle) closes its own popup when clicked a second time, matching the built-in title-area buttons.
21
+
22
+ ## Where to find the UI
23
+
24
+ - **Session title area (right side):** Archive / Unarchive, Move to workspace, Delete session.
25
+ - **Sidebar footer → Session manager:** browse all sessions (including archived ones) and operate on each one.
26
+
27
+ ## Agent preset migration
28
+
29
+ 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`.
30
+
31
+ 1. Open **Session manager**.
32
+ 2. Locate the session and select **Migrate preset**.
33
+ 3. Choose one of the currently available target presets and confirm.
34
+
35
+ The plugin determines the session's effective preset from its latest `agent-preset/selected` event when present; otherwise it uses the session header. It then rewrites that event in place (or appends a fresh one if the session has never recorded a selection), so the migration is durable and the prior entry remains visible in the event log as history. For a live session, the new event is appended in memory via `Session.append()` and flushed to disk via `SessionStore.flush()`; the api-gateway's chat panel sees the new preset on the next event fold.
36
+
37
+ > A preset migration changes session metadata only. It does not alter message history, files, or the selected workspace.
38
+
39
+ ## Install
40
+
41
+ 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.
42
+
43
+ ### From dsh-market
44
+
45
+ ```powershell
46
+ dsh plugin --profile web add npm:dsh-session-manager
47
+ ```
48
+
49
+ ### From GitHub
50
+
51
+ ```powershell
52
+ dsh plugin --profile web add github:hkkz9522/dsh-session-manager
53
+ ```
54
+
55
+ Restart DSH Web after installation. If the browser still holds an older client bundle, force refresh with `Ctrl+Shift+R`.
56
+
57
+ ### Local development / runtime injection
58
+
59
+ ```text
60
+ dev_inject_plugin {"dir": "<absolute path to this repository>"}
61
+ ```
62
+
63
+ ## Safety and behavior
64
+
65
+ - **Deletion is permanent**, so the UI always asks for confirmation.
66
+ - Move and Migrate preset do **not** tear down the live agent or session. They keep the in-memory session/agent alive, write the new artifact in place, update the in-memory session header to point at the new cwd (move) or append the new event (migrate), and refresh the workspace registry. The api-gateway's chat panel therefore stays "available" without a manual refresh.
67
+ - Move rewrites the session's stored `cwd`; subsequent tool calls run in the target workspace.
68
+ - Subagent sessions and transient blank-session placeholders are excluded from Delete, Move, and Migrate preset.
69
+ - The move path encodes the artifact in the backend's own physical layout (zstd frames with a one-header-line first frame, or plain JSONL), matching DSH's own writer. The migrate path rewrites the relevant event in place at the existing file.
70
+
71
+ ## Compatibility
72
+
73
+ | Plugin version | Verified DSH version |
74
+ | --- | --- |
75
+ | 0.4.10 | v0.1.5-rc.1 |
76
+ | 0.4.9 | v0.1.5-rc.1 |
77
+ | 0.4.7 | v0.1.5-rc.1 |
78
+ | 0.4.4 | 0.1.3-alpha.2 |
79
+ | 0.4.1 | 0.1.3-alpha.2 |
80
+ | 0.4.0 | v0.1.2-rc.1 |
81
+ | 0.1.2 | v0.1.0-rc.7 |
82
+ | 0.1.1 | v0.1.0-rc.7 |
83
+ | 0.1.0 | v0.1.0-rc.7 |
84
+
85
+ The plugin is a Cordis plugin and declares `cordis: ">=4.0.0-rc <5"` as its peer dependency.
86
+
87
+ ## Development
88
+
89
+ - `lib/index.js` is the host-side ESM plugin; `lib/client.js` is the Web client bundle. No build step is required.
90
+ - Before submitting changes, run:
91
+
92
+ ```powershell
93
+ node --check lib/client.js
94
+ node --check lib/index.js
95
+ node --test test/*.test.mjs
96
+ node scripts/smoke-test.mjs
97
+ git diff --check
98
+ npm pack --dry-run
99
+ ```
100
+
101
+ Release history is in [CHANGELOG.md](CHANGELOG.md).
102
+
103
+ ## Acknowledgments
104
+
105
+ 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.
106
+
107
+ ## License
108
+
109
+ [MIT](LICENSE)
package/README.zh.md CHANGED
@@ -72,6 +72,8 @@ dev_inject_plugin {"dir": "<本仓库的绝对路径>"}
72
72
 
73
73
  | 插件版本 | 已验证 DSH 版本 |
74
74
  | --- | --- |
75
+ | 0.4.10 | v0.1.5-rc.1 |
76
+ | 0.4.9 | v0.1.5-rc.1 |
75
77
  | 0.4.7 | v0.1.5-rc.1 |
76
78
  | 0.4.4 | 0.1.3-alpha.2 |
77
79
  | 0.4.1 | 0.1.3-alpha.2 |