READMESource: main@3351e054
@local/dsh-session-manager
会话管理 —— 在设置里搜索已归档的会话记录,看它们占了多少磁盘,然后多选恢复或永久删除。
A Session Manager page inside Settings that lists archived Harness sessions and lets you inspect, restore, and permanently delete them — with search and multi-select batch actions.
What it does
- Archived-only view — unarchived sessions are never shown; the page is the place where archived records are managed.
- Search — filters the list by title, workspace path, or session id (literal, case-insensitive).
- Multi-select — select all / per-row checkboxes, then act on the selection.
- Restore — unarchives the selected sessions; they return to the conversation list in their workspace.
- Delete — permanently removes the durable session log, its projection-cache checkpoint, and its workspace membership entry. Destructive actions ask for confirmation and show the reclaimed size afterwards.
- Size and totals — each row shows the on-disk size of the session log; the page shows the total held by archived sessions.
Behavior and limits worth knowing
- Deletion is real and immediate: the session's log directory under
~/.dsh/sessions/<workspace>/<session-id>/, itssession_projcachecheckpoint, and its WorkspacesessionIdsentry are removed in one request. - A session that is currently running a turn cannot be deleted — stop it first. (An idle session that merely stays resident in memory is deletable.)
- Resident sessions leave a memory-only shell: the harness keeps opened sessions in process memory and offers no public unload API. After deletion the record no longer resolves to any data, and the plugin keeps its archive entry (which is what hides it) until the next start; the startup drain then drops that final entry. Restart the app once for the leftover entry to disappear from the sidebar's archived group.
- Content search is not available: the shipped full-text backend is not mounted for the main query service (
openAt: never), so search covers metadata only. A literal-content search could be added on top ofsessionQuery.filterEvents, at the cost of reading every archived log. - Running-time queueing: if a log cannot be removed at request time (rare — e.g. another handle holds it), the id is queued in
~/.dsh/storages/session-manager/pending-deletions.jsonand retried on the next start.
Files
| File | Role |
|---|---|
index.js |
Host half: registers /session-manager/{list,restore,delete} on the host webServer; reads the corpus through ctx.sessionQuery, edits the live workspace domain for membership, removes storage directories. |
client.js |
Web half: registers the settings.section page, its styles, and the nav glyph replacement. |
cordis.patch.yml |
Inserts the session-manager Loader row. |
locale/en.json, locale/zh.json |
Display metadata shown by Plugin Manager and Settings. |
icon.svg |
Original line-style mark. |
Install
Install the package directory through Plugin Manager (install_bundle), or add it to a profile's bundle list. Host-side code changes require an app restart; client code reloads with the page when the host re-serves the bundle.
Package
npm pack # → dsh-session-manager-1.1.0.tgz(package/ 为根)
The tarball contains exactly the files list plus README.md and LICENSE.
License
MIT © 2026 xiaobaga281
No comments yet. Be the first to write one.