session-persistence-rdb
by dsh-external
RDB 持久化会话后端(durable session persistence backend,bundle)
RDB-backed durable session persistence backend (bundle).
安装
dsh plugin --profile web add github:dsh-external/session-persistence-rdbGitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试
安装与环境配置指引、插件开发教程见 DSH 中文社区文档 ↗
安装即在你的机器上以你的权限运行第三方代码——它可读写文件、使用凭据、访问网络,DSH 的工具审批不会为插件代码加沙箱。「检测到 manifest」仅代表发现 dsh.bundle / dsh.plugin 清单,不构成兼容性或安全审查;安装前请审阅源码,不熟悉的插件先在不含密钥的环境试用。
README
RDB(SQLite / PostgreSQL)持久会话后端(ctx.sessionPersistence):通过 drizzle
实现 PersistenceBackend<number>,复用上游 PersistenceCoordinator 与契约测试套件,
支持配置选择 SQLite 或 PostgreSQL 后端。设计细节(表结构、delta 过滤、并发写、
方言差异、仓库结构)见 docs/design.md。
安装
包发布在 GitHub Packages,按包名安装到 dsh profile(示例:web;dsh plugin add 把参数原样转发给 pnpm,版本号按发布版本调整)。registry 必须限定在
@morlay scope(--config.@morlay:registry=…),不要用全局 --registry,
否则依赖(@deepseek-ai/* 等)也会被指到 GitHub Packages 而解析失败:
dsh plugin --profile=web add "@morlay/session-persistence-rdb@^0.0.1" --config.@morlay:registry=https://npm.pkg.github.com/
GitHub Packages 的 registry 要求认证(公开包也一样):profile 的 .npmrc
需为 npm.pkg.github.com 配置访问 token(如
//npm.pkg.github.com/:_authToken=<token>),详见
GitHub 文档。
配置
配置写在 ${DSH_HOME}/settings.yaml,settings namespace 为插件短名
session-persistence-rdb(与 cordis 插件 name 一致):
session-persistence-rdb:
type: sqlite
# path 省略时回落 cordis.patch.yml 的默认($DSH_HOME/sessions/sessions.sqlite,
# 由 bundle patch 的 !!js 表达式求值);自定义路径请用绝对路径字符串。
path: /absolute/path/to/sessions.sqlite
journalMode: wal
busyTimeout: 5000
settings.yaml 是纯 YAML(settings-local 用
yaml库解析),不支持!!jsJS 表达式——!!js dshHomePath(...)会被当作字面字符串。!!js只在cordis.patch.yml(bundle patch 层,loader 求值)有效。
字段即 Config 判别联合(见下);未写出的字段回落到 bundle patch / cordis.yml 的 config 默认值。PostgreSQL:
session-persistence-rdb:
type: postgres
connectionString: postgres://user:pass@localhost:5432/sessions
Config 类型:
type Config =
| {
type: "sqlite";
/** SQLite 数据库文件路径;`:memory:` 用于测试。 */
path: string;
/** journal_mode:`wal`(默认)/ `delete` / `truncate` / `persist`。 */
journalMode?: "wal" | "delete" | "truncate" | "persist";
/** 写锁竞争等待毫秒数(默认 5000)。 */
busyTimeout?: number;
}
| {
type: "postgres";
/** node-postgres 连接串;首次打开自动建表并写入 store 身份。 */
connectionString: string;
};
原始 README: https://github.com/morlay/session-persistence-rdb/blob/main/README.md ↗
同类插件
查看全部 →
archify
Agent 技能:生成美观、可校验的架构图、工作流图、时序图、数据流图与生命周期图——自包含 HTML、带动画与清晰导出

dsh-turn-rewind
对话回退:基于持久 Change Ledger 回滚会话与工作区状态。

dsh-plugin-cc
把 DeepSeek Harness 接入 Claude Code:评审、批评、委派与会话导入

dsh-interconnect
跨实例互联:经 interconnect 服务在多个 DSH 实例间转发消息与事件。

dsh-chat-import
把 13 家 coding agent(Claude Code、Codex、ChatGPT、Cursor、Gemini、opencode 等)的完整对话历史导入为可续聊的 DeepSeek Harness 会话,并支持反向导出回 Claude Code。

dsh-crew
DSH 插件:从 Claude Code / Codex 向 DSH agent 派活——原生 subagent 进度、宿主内 worker 会话(分级预设),以及为纯文本宿主补上视觉与图像生成的多模态桥