dsh-session-deleter
中文 | English
A DSH Web plugin that deletes sessions from the sidebar. It stops the live agent, moves the whole session log directory into a recoverable trash, and adds a Trash panel to restore, purge or empty it.
DSH itself only archives sessions (hides them); this plugin adds real, undoable deletion.
Features
- Delete from a session row's "…" menu and from a hover button; works for idle, running, archived and pinned sessions
- Cancels running work and waits for the agent handle to dispose before touching the log, so Windows file locks do not fail the delete
- Moves the session directory to
~/.dsh/session-trash/<sessionId>-<timestamp>/withmeta.json(title, original directory, workspace, archived/pinned state, size, deletion time) - Trash panel in the sidebar: restore to the original workspace (including archived/pinned state), purge one entry, or empty everything
- Confirmation dialog with an explicit "delete permanently" opt-in
- Chinese and English UI
- Attachments and workspace files are left untouched
Compatibility
Built for @deepseek-ai/dsh 0.2.1-rc.5. It uses the official client slots (sidebar.workspaces.session.menu.item, sidebar.workspaces.session.row.action, shell.overlay, sidebar.panellist, main) and the official Connection admission fence, plus these internal shapes: AgentHandle.dispose, sessionPersistence.root / findLog(), WorkspaceEntity.attachSession/detachSession.
Inspired by jasonrale/dsh-archive-manager, whose 0.1.0-rc.6 client API does not load on 0.2.x.
Install
Repository: https://github.com/zyyu1/dsh-session-deleter
git clone https://github.com/zyyu1/dsh-session-deleter
Installed on this machine as:
~/.dsh/plugins/dsh-session-deleter
~/.dsh/profiles/desktop/node_modules/dsh-session-deleter -> junction to the above
~/.dsh/profiles/desktop/package.json # "dsh-session-deleter": "link:..."
~/.dsh/profiles/desktop/cordis.patch.yml # insert row; inject includes webServer
To update, overwrite lib/index.js, lib/client.js and package.json in
~/.dsh/plugins/dsh-session-deleter/, then reload the page once (Ctrl+R) to
pick up a new client bundle.
For a fresh install: copy this package to ~/.dsh/plugins/, add the link:
dependency to the profile, run pnpm install, add the insert row from
cordis.patch.yml (with webServer in inject), and reload.
webServeris required: 0.2.1'sconnection.rpc.handlescopes its channel to the Connection service fiber, which does not injectwebServerand therefore always throws. This plugin registers/session-deleterdirectly throughctx.webServer.registerand reusesctx.connection.admit()for browser authentication and the Host/Origin fence.
Data layout
~/.dsh/
sessions/
session-trash/
<sessionId>-<timestamp>/
meta.json
session/
License
MIT
No comments yet. Be the first to write one.