dsh-session-vault: Browse, Export, Import, and Migrate DSH Sessions

Introduction

DeepSeek Harness (DSH) session logs are stored in the local persistence layer. When switching computers, changing directories, or upgrading DSH versions, relying solely on copying raw directories from the disk often incurs high costs due to the need to align workspace paths, manage session format generations, and handle sidebar mounting relationships. While there are already reference implementations in the community for local archive management (such as MichengAI/dsh-archive-manager), a neighboring requirement is packaging sessions into portable bundles to be re-imported into the database and re-mounted to a workspace on another machine or a new version of DSH.

Below is an introduction to dsh-session-vault, a plugin by maintainer jr-create located in the “Memory” category of the DSH plugin directory. It features a host-side Node service, a browser settings page UI, and model tools for Agents. Its capabilities are organized around three operations: “See -> Take -> Put Back”. The archive format is marked as dsh-session-archive (gzip-compressed JSONL containing normalized events returned by the persistence service, rather than raw bytes from disk). Archives produced under the old name dsh-session-export remain readable. When used with dsh-config-manager, it enables complete machine-switching migration of DSH configurations and sessions.

What is this

  • Name: dsh-session-vault (The name is occupied by an unrelated plugin on npm, so distribution is via GitHub; the repository name and internal routes/data directories still use the “vault” naming)
  • Maintainer: jr-create
  • Version (package.json): 0.1.0
  • License: MIT
  • Positioning: Browse, export, import, and transfer DSH sessions across machines; the export archive extension is .dshsession

Core Features

Export and Import

Capability Description
Export Package selected sessions into a single .dshsession; if none are selected, export all
Partial Success If individual sessions cannot be read, they are skipped with a reported reason, while the rest are exported normally; an error is raised only if all fail
Import Upload or select a .dshsession, re-import it via the DSH persistence service, and mount it to the workspace sidebar
Migration Path Specify a new workspace directory during import, e.g., migrating from D:\old\proj to /home/me/proj
ID Conflicts By default, existing sessions are skipped; you can also choose to import with new IDs, retaining both copies
Preview dryRun outputs the plan only without writing to the database

Archiving and Cleanup

  • Archive Management: List, download, inspect content, and delete exported archives; export files are stored in <DSH_HOME>/dsh-session-vault/exports/ by default.
  • Session Cleanup: Permanently delete three categories—unmounted and unarchived sessions, archived but unmounted sessions, and unused empty shell sessions. Requires a preview and double confirmation. Deletion is the only operation in the plugin that bypasses the service to directly modify files (as SessionPersistence lacks a delete interface) and includes guardrails for workspace ownership, active sessions, path safety, and confirm: true; see the README sections “Stored Sessions ≠ Sidebar Sessions” and cleanup instructions for details.

Listing and Filtering

The settings page and session API distinguish between “stored in persistence” and “visible in the sidebar”: filtering is available for ranges such as All, Sidebar Visible, Unmounted Workspaces, and Sub-agents. Each row is labeled with mounted / orphaned / workspace info, etc. Titles are resolved in three tiers (projection cache, first human message, no title), with the source indicated by titleSource.

Model Tools and HTTP

Agent-callable tools:

  • session_list
  • session_export
  • session_archive_inspect
  • session_import
  • session_delete (including options like dryRun, includeArchived, includeEmpty, etc.)

The browser side utilizes /api/dsh-session-vault/* on the same origin (e.g., GET /sessions, POST /export, POST /import, POST /purge, etc.). The README provides JSON sample fields for GET /api/dsh-session-vault/sessions.

Repository tests: node --test runs 201 tests total; the README claims all pass offline.

Installation and Activation

The plugin is pure JavaScript with no build steps; do not add dependencies / peerDependencies for it, nor copy node_modules (importing host packages during link installation can cause plugin tree loading failures and prevent dsh web from starting; this plugin avoids importing host packages via ctx.get() / ctx.inject() and local shims).

# Install from GitHub
dsh plugin --profile web add github:jr-create/dsh-session-vault

# Lock to a specific commit (recommended)
dsh plugin --profile web add github:jr-create/dsh-session-vault#<sha>

# Or install a pre-packaged tarball from Release
dsh plugin --profile web add ./dsh-session-vault-0.1.0.tgz

# Local development
dsh plugin --profile web add link:<your-source-directory>

After installation, restart dsh web and open Settings → Session Vault.

Uninstall:

dsh plugin --profile web remove dsh-session-vault

Runtime Environment (package.json): Node ^22.19.0 || >=24.0.0.

Typical Usage

Graphical Interface

The settings panel has four tabs:

  1. Export — Search, select, and “Export selected and download”.
  2. Import — Click or drag in a .dshsession; you can first inspect the archive content, fill in the new workspace directory, conflict strategy, and whether to auto-create directories, then “Preview” or “Start Import”.
  3. Archive — Download, import, and delete exported archives.
  4. Cleanup — Tabs for the three types of junk ranges; preview first, check confirmation, then delete.

Via Agent Tools

Call by the tool names in the README. For example, first use session_list to confirm the scope, then session_export to generate an archive, session_archive_inspect to check content, and session_import to store it (can do a dryRun first).

Use Cases and Notes

Who it’s for: Those who need to migrate sessions between two machines or different DSH versions; those who need to batch export backups as .dshsession; those whose workspaces have been deleted but session logs remain on disk and need to be listed, exported, or cleaned up by rules; those who want Agents to export/import sessions autonomously within conversations.

Notes:

  • The plugin is installed under the web profile and accesses persistence and session data with the permissions of the current dsh web process. Please review the GitHub source code and MIT license before installation.
  • The archive is a normalized event stream, not a byte-for-byte mirror of ~/.dsh/sessions/**; cross-version import depends on the DSH persistence service and is not the same path as a pure directory copy.
  • Deletion is irreversible; export a copy beforehand if you need to retain data.

Conclusion

dsh-session-vault turns DSH sessions into a vault that is listable, packageable, and migratable back, explicitly handling unmounted sessions, sub-agents, and cleanup boundaries. It complements local archive-style plugins. Directories and documentation:

  • Plugin Directory Page: https://www.skillhub.cn/plugins/jr-create/dsh-session-vault
  • GitHub: https://github.com/jr-create/dsh-session-vault
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye