Temoa
dsh-sessions-rm
Session management for DeepSeek Harness (DSH).
- Stars
- 0
- Language
- JavaScript
- Created
- Aug 16, 2026
- Updated
- Aug 16, 2026
Introduction
@temoa/dsh-sessions-rm
Session management for DeepSeek Harness (DSH): a settings page that lists every historical session and physically deletes a session's log directory (irreversible, type-to-confirm, with an audit trail).
English | 中文
Features
- Settings → Session Management — an additive
settings.sectionpage (no shipped UI is replaced). - Session list — title, relative time, status badges (running / persisted), blank vs untitled distinction.
- Type-to-confirm delete — a modal dialog shows the session and an irreversible warning; you must type 确认删除 before the confirm button becomes clickable (guards against accidental deletes). Esc / backdrop / cancel close it.
- Physical deletion — the Host locates the log via
sessionPersistence.locate()andrm -rfs the whole session directory (log + session-owned artifacts). - Audit trail — every delete request (success or failure) appends one JSON line to
~/.dsh/sessions-rm.log(time / sessionId / title / ok / path or error). - Theme-aware — follows light / dark / system via official theme tokens.
Install
Option A — install as a package (dsh plugin add), no --patch needed
Install straight from GitHub — pnpm pins the package by commit with a full integrity hash:
dsh plugin --profile web add git+https://github.com/Temoa/dsh-sessions-rm.git
Because the package declares dsh.bundle.patch (cordis.patch.yml), the reconciler appends it to the profile's dsh.profile.bundles automatically — the plugin mounts at the PROFILE level and is active for every session on that profile. The client half is discovered through dsh.client (exports["./client"]) and the Host Remote manifest through exports["./typert"] (registered by dsh-typert-loader); no manual patch file is needed.
To uninstall: dsh plugin --profile web remove @temoa/dsh-sessions-rm.
After changing plugin code, fully restart the harness — modules are cached per process URL.
Option B — install from source (local development)
git clone git+https://github.com/Temoa/dsh-sessions-rm.git
cd dsh-sessions-rm
dsh web --patch ./cordis.patch.yml
Dependencies
The package declares no dependencies — runtime imports (@deepseek-ai/cordis, @deepseek-ai/dsh-typert-protocol, zod) are provided by the DSH installation. Two ways to make them resolvable:
- Symlink DSH's
node_modulesinto the plugin directory (recommended, offline):ln -s /path/to/dsh/node_modules node_modules - Or run
npm installin the plugin directory if the@deepseek-ai/*packages are available on your registry.
Usage
Open Settings → Session Management: pick a session, click 删除 (Delete), type 确认删除 in the dialog, then confirm. The row disappears, the sidebar hides the session immediately (archived), the log directory is physically removed, and one line is appended to ~/.dsh/sessions-rm.log.
How it works
- Host —
lib/index.jsregistersctx.sessionRm(aTypertRemoteServicesubclass) exposinglist/delete.lib/typert.host.jsis the Typert manifest (exports["./typert"]) auto-registered bydsh-typert-loader;api-gatewayroutessessionRm/*wire calls to the service methods. - Client —
lib/client.js(a factory-form CJS bundle built byscripts/build-client.jsfromsrc/client.js) registers matching descriptors viactx.remote.$mount()and callsctx.remote.sessionRm.list()/delete(). - Delete pipeline — reject running agents →
workspaceRegistry.archiveSession()(sidebar hides instantly via the archive set) →sessionPersistence.locate()→rm -rf→ append audit line. - Pure JS + hand-written decorator marking —
@Remoteis a TS decorator; this project reuses the officialRemote()decorator by constructing a decorator context manually (seeaddRemoteinlib/index.js), so no TS toolchain is needed.
Configuration
None — the plugin is intentionally configuration-free. All behavior is fixed by design.
Development
npm run build:client # node scripts/build-client.js → lib/client.js
npm test # node test/index.mjs — manifest/bundle structure checks
Tests cover: Host service class shape, Typert manifest structure (package/face/codecs/invocations), and client bundle format.
Boundaries
- Running sessions cannot be deleted — DSH has no public API to dispose a live agent; deleting a running session's log would corrupt the runtime.
- Deleting is irreversible — log and artifacts are permanently removed. The archive step hides the session from the sidebar immediately; the in-memory record disappears after a restart.
- Sandboxed — the
rmruns through the DSHshellservice and is subject to the sandbox policy; paths outside the writable scope may be refused. - User-role semantics — the settings page is an additive UI; it never replaces shipped surfaces and reads no model context.
License
MIT