DSH officially provides the /export export feature, but lacks a companion import tool. The dsh-session-import plugin fills this gap, allowing officially exported ZIP or JSONL files to be restored into a conversation that can be continued.

Plugin Overview

The plugin is named dsh-session-import, belongs to the “Memory” category, is provided by maintainer kinyokun, and follows the MIT license.

Core Features

  1. File Parsing: Supports parsing ZIP files or raw JSONL files exported by /export.
  2. Validation Mechanism: Performs structural authenticity verification and validates file integrity using SHA-256 fingerprints.
  3. State Synchronization: Synchronizes model, preset, permission, and other state information.
  4. Tree Support: Supports importing an entire sub-session tree, as well as image and file attachments.
  5. Real-Time Interaction: Import and delete operations are pushed in real time without page refresh.

Installation and Enablement

Install the plugin with the following command:

dsh plugin --profile web add github:kinyokun/dsh-session-import

After installation, restart dsh web and refresh the browser.

Typical Usage

  1. On the new session page, click “Import Conversation”.
  2. Select a ZIP or JSONL file.
  3. Review the validation results, number of sub-sessions, and number of attachments.
  4. Select the target workspace.
  5. Click “Start Import”.

Each import generates a new session ID, rebuilds the parent-child relationships within the package, and does not overwrite the original session. After a successful import, historical messages, system prompts, model, and other state events are fully preserved.

Limitations and Notes

This plugin runs with the permissions of the current DSH process. You should review the source code and license before installation.

  • Maximum upload size is 256 MiB.
  • Maximum total extracted ZIP size is 512 MiB.
  • Maximum of 256 sessions.
  • Maximum of 4096 ZIP entries.
  • Maximum of 1000000 logical events.
  • Split archives, encrypted ZIP files, ZIP64, and symbolic links are not supported.

Recovery and Validation

Structural validation determines whether the official runtime can recover logs; SHA-256 is used to compare file fingerprints. The recovery area is located alongside the storage root directory. For example, ~/.dsh/sessions corresponds to ~/.dsh/sessions-import-recovery/.

Resources