Introduction

In DSH Web, if there is no centralized management entry for archived sessions, viewing old sessions, filtering items, previewing content, unarchiving, or cleaning up disk space can be scattered. z953218350/dsh-archive-manager is a plugin for the DSH Web interface used to centrally manage archived sessions.

Below is an introduction to its capabilities, installation methods, typical usage, and data deletion risks that need attention.

What is it

dsh-archive-manager is a Web plugin for DSH, owned by z953218350, with the package name @mlgbnb/dsh-archive-manager and a license of MIT.

It provides Codex-style session archive management capabilities for the DSH Web interface, mainly used in the settings page to view, search/filter, preview, unarchive, and completely delete archived sessions.

Core Features

The plugin’s capabilities focus on archived session management in DSH Web:

  • View archived sessions in the DSH Web interface settings page.
  • Search/Filter archived sessions.
  • Display sessions grouped by workspace/project.
  • Support deleting all content in a project.
  • Parse session.jsonl.zstd and session.jsonl.
  • Display session title, creation time, conversation turns, and disk usage.
  • Preview the last 50 user/assistant messages in a session.
  • Restore sessions and sync the sidebar in real-time.
  • Physically delete session metadata and disk data files.
  • Real-time monitoring of sidebar archive changes and list synchronization.
  • Built-in Node zlib-based zstd multi-frame decompression engine, no need to install zstd command-line tools.

Installation and Enablement

First, confirm the environment meets requirements:

  • DSH >=0.1.2-alpha.2
  • Use Web Profile
  • Use Node.js built-in zlib
  • peerDependencies declared in package.json includes react ^18.2.0

The plugin reads DSH’s storages/workspace.json, storages/session_projcache.json, and the sessions/ directory at runtime. The data directory can be specified via DSH_HOME, default is ~/.dsh.

Below is the installation using DSH CLI.

  1. Install using the current package name:
dsh plugin --profile web add -w @mlgbnb/dsh-archive-manager
  1. If you want to fix the version, you can explicitly specify 1.0.10:
dsh plugin --profile web add -w "@mlgbnb/dsh-archive-manager@1.0.10"
  1. If you have a plugin directory locally, you can also use the link: method:
dsh plugin --profile web add -w "link:/path/to/dsh/plugin/dsh-archive-manager"

After installation, check the Web Profile’s package.json to confirm that the dsh.profile.bundles array contains @mlgbnb/dsh-archive-manager.

If an error occurs after running add indicating duplicate sub-package declarations, check the dsh.profile.bundles array to ensure it contains only the root package and not sub-component packages.

Finally, start DSH Web:

dsh --profile web

Or:

dsh web

After starting, access:

http://127.0.0.1:3080/

Go to:

Settings -> Plugins

to use the archive management functionality.

Typical Usage

After the steps above, common operations are as follows:

  1. Go to the settings page, find the archive management entry, and view the list of archived sessions.

  2. Browse session groups by workspace/project to confirm which archived sessions exist under a specific project.

  3. Search or filter the sessions that need to be processed.

  4. View session metadata, including title, creation time, conversation turns, and disk usage.

  5. Click preview to view the last 50 user/assistant messages in the session.

  6. If you only need to restore the session to its original workspace, perform unarchiving. The sidebar will sync after restoration.

  7. If you are sure you no longer need the session, perform a physical deletion. This operation will delete session metadata and disk data files, freeing up storage space.

  8. If you need to clean up all archived content under a project, use the project-level delete all capability.

Applicable Scenarios and Notes

Suitable for developers currently using the DSH Web Profile who need to centrally view, preview, restore, or delete archived sessions.

Pre-use notes:

  • The plugin runs with the permissions of the current dsh process; check the source code and license before installing.
  • The plugin will read storages/workspace.json, storages/session_projcache.json, and the sessions/ directory.
  • Physical deletion deletes session metadata and disk data files; it is an irreversible operation.
  • Deleting all content in a project will affect related archived sessions under that project.
  • If sub-component packages are mixed into dsh.profile.bundles, duplicate declaration issues may occur at startup.

Project repository:

https://github.com/z953218350/dsh-archive-manager