Preface

In DSH’s plugin-based architecture, session persistence can be provided by backend plugins. @morlay/session-persistence-rdb targets use cases where session persistence needs to be stored in SQLite or PostgreSQL: it integrates as a DSH plugin, provides an RDB durable session persistence backend, and allows selecting the database backend through configuration.

Plugin Positioning

@morlay/session-persistence-rdb is a DeepSeek Harness plugin maintained by morlay, licensed under MIT. Its core role is to provide a SQLite/PostgreSQL persistent session backend for ctx.sessionPersistence.

Core Capabilities

The following capabilities have been confirmed for this plugin:

  • Provides an RDB (SQLite/PostgreSQL) persistent session backend via the ctx.sessionPersistence interface.
  • Implements PersistenceBackend<number> using drizzle.
  • Reuses the upstream PersistenceCoordinator and contract test suite.
  • Supports selecting SQLite or PostgreSQL backend via configuration.

Installation and Activation

Handle authentication before installation. The GitHub Packages registry requires authentication, even for public packages. You need to configure an access token for npm.pkg.github.com in your profile’s .npmrc, for example:

//npm.pkg.github.com/:_authToken=<token>

Once the token is confirmed to work, install the plugin to the target DSH profile. The example below installs it to the web profile and scopes the registry to the @morlay scope:

dsh plugin --profile=web add "@morlay/session-persistence-rdb@^0.0.1" --config.@morlay:registry=https://npm.pkg.github.com/

Do not use the global --registry here. If the global registry points to GitHub Packages, dependencies such as @deepseek-ai/* might also resolve to GitHub Packages, leading to installation failures.

Typical Usage

After enabling the plugin, configure the backend type in settings.yaml using the session-persistence-rdb namespace.

SQLite Backend

Configuration fields include type, path, journalMode, and busyTimeout. The example structure is as follows:

session-persistence-rdb:
  type: sqlite
  path: <SQLite file path>
  journalMode: <journalMode value>
  busyTimeout: <milliseconds>

PostgreSQL Backend

Configuration fields include type and connectionString. The example structure is as follows:

session-persistence-rdb:
  type: postgres
  connectionString: <PostgreSQL connection string>

settings.yaml is plain YAML and does not support !!js JS expressions. !!js is only valid in cordis.patch.yml (the bundle patch layer, evaluated by the loader).

Applicable Scenarios and Notes

This plugin is suitable for DSH users who need SQLite or PostgreSQL persistent session backends. Before using it, note the following:

  • The license is MIT.
  • The plugin runs with the permissions of the current dsh process; inspect the source code and license before installation.
  • Installing from GitHub Packages requires an .npmrc token.
  • The registry must be scoped to the @morlay scope to avoid affecting resolution of dependencies like @deepseek-ai/*.
  • settings.yaml does not support !!js; do not write !!js expressions to this file.

Resources

  • GitHub: https://github.com/morlay/session-persistence-rdb.git
  • Community directory: This article does not confirm a specific URL.