Sessions & Messages
dsh-archived-sessions
Jxy-hy/dsh-archived-sessions · ★ 1
DSH web plugin: manage archived sessions from the Settings page — unarchive to restore, or permanently delete (log + attachments) behind a confirmation dialog.
Manifest details
安装
dsh plugin --profile web add github:Jxy-hy/dsh-archived-sessionsGitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试
For install and environment setup, plus plugin development tutorials, see DSH community docs ↗
README
Table of contents
English | 中文
A DeepSeek Harness (dsh) web plugin that adds an Archived Sessions section to the Settings page for managing archived conversations.
Official source: this repository is the official source of the npm package
dsh-archived-sessions—dsh plugin add dsh-archived-sessionsinstalls exactly this code.

Features
- List archived sessions — each row shows the session's own name (the same title the sidebar uses), working directory, log size, and last update time.
- Unarchive — restore a session to the sidebar with one click; its original position in the workspace is kept.
- Permanently delete — removes the session's local log directory (
~/.dsh/sessions/...) plus the attachment objects its log references that no other remaining session still uses, then drops the session from workspace accounting. A confirmation dialog must be acknowledged first. - Native look & feel — built on the same UI primitives and design tokens as the built-in Settings sections.
Requirements
- DeepSeek Harness 0.2.0-rc.2 or newer — the plugin consumes the
@deepseek-ai/dsh-client-storesnapshot store and theremote.session/workspacesclient services, which replaced the formerdsh-client-runtime/connection.apisurfaces. - A core with the workspace archive surface (
workspaceRegistry.archivedSessionIds/unarchiveSession). - Deletion needs no extra core support. It clears the archive set through the existing
unarchiveSession, whose contract is exactly what a delete needs: it drops the id fromarchivedSessionIds, touches no accounting slot, runs no session-existence check, and no-ops on an id that is not archived. WorkspacesessionIdsneed no write either — that getter is already filtered by the canonical-cwd header index, so removing the log drops the session from the workspace projection by itself. - A core older than the archive surface still degrades gracefully instead of failing: listing works, and the missing capability is reported as a structured
partialresult rather than thrown.
Installation
Install from npm:
dsh plugin add dsh-archived-sessions
The plugin is then mounted automatically (its dsh.bundle patch joins the profile's bundle stack). Refresh the page (hard refresh) to load the client half, then open Settings → Archived Sessions.
Alternatively, install from source:
git clone https://github.com/Jxy-hy/dsh-archived-sessions.git
cd dsh-archived-sessions
pnpm install
pnpm run build
dsh plugin --profile web add link:./dsh-archived-sessions
Then mount it by appending to ~/.dsh/profiles/web/cordis.patch.yml (or via your preferred bundle mechanism):
- insert:
- id: dsh-archived-sessions
name: 'dsh-archived-sessions'
The host half hot-mounts through the profile's config HMR; refresh the page (hard refresh) to load the client half. Open Settings → Archived Sessions.
Usage
- Archive a session from the sidebar session menu (it hides from the sidebar).
- Open Settings → Archived Sessions:
- Unarchive — restores the session to its original sidebar position.
- Delete — opens a confirmation dialog; confirming permanently deletes the local log and related attachments (objects still referenced by other sessions are kept) and removes the session from workspace accounting.
Architecture
- Host half (
src/index.ts) — registersGET/POST /__dsh-archived-sessions/{list,unarchive,delete}on the shared web server. The delete flow: dispose the live session first if it is open (so the in-memory store drops it and persistence retires its state) → wait for the write-behind flush to materialize the log → remove the session log directory → parse attachment references (sha256:) from the log → delete only the objects no other remaining session references → clear the archive set viaworkspaceRegistry.unarchiveSession. - Client half (
src/client/) — registers thesettings.sectionentry "Archived Sessions"; the list merges theremote.sessionlisting (including the projection title) with the plugin's host surface (creation time, log size); both mutations go through the host surface because the core RPC map offers neither operation. After a successful delete the client re-pulls the session-list baseline: deleting a cold (persisted, not-open) session emits nosession/disposed, so the sidebar would otherwise keep the stale row under Ungrouped until the next reconnect.
Verification
There is no test runner in this repo; both checks are standalone Node scripts over the built artifacts, so run pnpm run build first.
pnpm run verify
verify:delete— pointsDSH_HOMEat a throwaway tree and driveslib/index.jsover a real HTTP socket: list reports rows with log facts; delete removes the log directory, GCs only the attachment objects no surviving session references (a shared object must survive), clears the archive set, and reports a complete result; a core lackingunarchiveSessiondegrades topartialinstead of throwing.verify:client— executeslib/client.jsagainst stubs for the shell's frozen module table, then mounts and renders the section. This catches the failure mode that once shipped a blank settings page: a named import the shell does not export (e.g. the removedIconTrashOutline16) resolves toundefinedand only throws at render time, inside the slot's error boundary, so the page renders empty instead of failing loudly. Every name the bundle imports must be a real export of the shell's primitives.
Community & Support
- Welcome to submit feedback or bug reports via GitHub Discussions.
- This repository carries the
dsh-plugintopic so it can be discovered.