hajimimaodie8/DSH-Session-Sync
Synchronize sessions, presets and settings between DSH desktop‑shell embedded instance and external web browser instance. Fix session isolation issue for third‑party packaged DeepSeek‑Harness desktop builds.
已收录
1
Session
Bundle 已验证
预览
功能介绍
双向同步网页版与 DSH Desktop 桌面版之间的会话、工作区、设置与插件。
适合
- 同时使用 DSH Web 和 DSH Desktop,并需要共享会话、工作区、设置和插件的用户。
- 内嵌 Harness 数据与外部 Web 实例相互隔离的第三方桌面打包版本。
- 需要并集合并、明确单向复制或手动指定对端目录的迁移与恢复工作流。
不适合
- 只运行一个 DSH 实例、没有跨实例数据隔离问题的用户。
- 需要逐个选择会话或设置的细粒度同步工作流;该插件按较宽的数据类别同步。
- 希望两端内容都保持不丢失,却选择单向覆盖命令而非默认双向合并的用户。
README
DSH-Session-Sync
Synchronize sessions, presets and settings between DSH desktop‑shell embedded instance and external web browser instance. Fix session isolation issue for third‑party packaged DeepSeek‑Harness desktop builds.
一个 DeepSeek Harness 插件:在网页版或 DSH Desktop 桌面版内,一条命令即可同步两端的 会话(对话内容)、工作区、缓存、设置与插件。解决打包版桌面实例与网页实例之间的数据隔离问题。
- 网页版:安装后在对话中输入
/sync - DSH Desktop 桌面版:同样安装后输入
/sync
功能
| 命令 | 作用 |
|---|---|
/sync |
双向合并(默认):两边内容取并集,不丢失任何一方 |
/sync web-to-desk |
单向覆盖:网页版 → 桌面版 |
/sync desk-to-web |
单向覆盖:桌面版 → 网页版 |
/sync status |
查看两端路径与数据统计 |
/sync --to <目录> |
手动指定对端数据目录 |
同步内容:会话记录、工作区列表(同路径自动合并)、会话投影缓存、设置/凭据、 插件启用配置 + 插件本体差异同步。
安装(网页版)
# 1. 把插件包复制到网页版 profile 的 node_modules
xcopy /E /I /Y "dsh-session-sync" "%USERPROFILE%\.dsh\profiles\node_modules\dsh-session-sync"
# 2. 在 %USERPROFILE%\.dsh\profiles\web\cordis.patch.yml 中追加(空列表 [] 需替换):
# - insert:
# - id: session-sync
# name: 'dsh-session-sync'
# 3. 重启 dsh web(或等待 patch 热重载),输入 /sync status 验证
安装(DSH Desktop 桌面版)
把插件包复制到桌面版对应位置,patch 追加到:
%APPDATA%\dsh-desktop\harness\profiles\web\cordis.patch.yml
xcopy /E /I /Y "dsh-session-sync" "%APPDATA%\dsh-desktop\harness\profiles\node_modules\dsh-session-sync"
原理
- 通过
$DSH_HOME定位当前实例数据目录(网页版通常~/.dsh,桌面版通常%APPDATA%\dsh-desktop\harness) - 对端目录自动推断(本端为桌面版则对端为网页版,反之亦然),支持
--to覆盖 - 复用 Cordis 命令注册(
ctx.commands.register),无外部依赖,纯 Node 内置模块
开发
dsh-session-sync/
├── package.json 插件清单(含 dsh.bundle 声明)
├── cordis.patch.yml bundle patch layer(插入 /sync 命令)
├── install.js 一键安装脚本(web/desk/both)
├── CHANGELOG.md
├── docs/
│ └── install-examples.md
├── test/
│ └── plugin.test.mjs 单元测试
├── README.md
├── LICENSE
└── lib/
├── index.js 插件入口:注册 /sync 命令
└── sync-core.js 同步核心(会话/工作区/缓存/设置/插件)
插件为 ESM 模块,导出 name / inject / apply;package.json 声明
dsh.bundle.patch,作为正式 profile bundle 插件,可通过 dsh plugin add
或插件市场安装,无需手工修改 profile patch。
插件市场
本插件已提交至 awesome-dsh-plugin
市场 registry(data/plugins/hajimimaodie8__DSH-Session-Sync.yml),
合并后可在 DSH 插件市场(dshmarket)中搜索 “session-sync” 一键安装。
测试
npm test # node --test test/
许可
MIT
常见问题常见问题
在启用了 DSH 的终端中执行已验证命令 dsh plugin --profile default add github:hajimimaodie8/DSH-Session-Sync。命令会解析公开 package 元数据,并保持插件与本页展示的目录身份一致。
兼容性以页面上展示的 bundle 与 profile 状态为准。如果某个 profile 尚未检测到,请先保持禁用,并在生产启用前阅读仓库文档。
GitHub 链接和 activity 元数据是 release 与维护状态的来源。新版本发布后重新查看本页,确认目录已经观察到最新版本。