跳到正文
dsh-market 浏览插件 GitHub EN

PerryLink/dsh-session-sync

DeepSeek Harness 的跨设备会话同步:经 git 在多机之间同步会话与设置。

Star 数 ★ 14 分类 会话与消息 收录于 2026-09-03 npm dsh-session-sync

安装

在 DeepSeek Harness 里通过 dsh-market 安装

dsh plugin --profile web add dshmarket

或使用命令行

dsh plugin --profile web add dsh-session-sync

装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络。请先审阅源码,并尽量锁定 commit(github:owner/repo#sha)。

README

🔄 dsh-session-sync

  • 1024 商店渠道:先 npm i -g dsh1024,再 dsh1024 plugin --profile web add dsh-session-sync(计入 deepseek1024.com 安装排行)。

DeepSeek Harness 的跨设备会话同步 —— 为你的会话存储建立专用 git 镜像。

在设备间同步会话,冲突时两边都保留,绝不丢失任何一轮。

官方仓库。 本仓库是 dsh-session-sync 的唯一官方仓库,由 PerryLink 维护。其他账号下的同名仓库与本项目无关。

dsh-doctor DSH Market

English · 简体中文 · Español · Português · हिन्दी


⭐ 如果它帮到了你

这个插件是 DSH 插件家族的一员(40+ 个,全部 Apache-2.0)。如果你在用,给个 star —— 它不会解锁任何功能,但会让下一个人在搜索里更容易找到它。

English: part of a 40+ plugin family for DeepSeek Harness. If it is useful, a star helps the next person find it — nothing is gated behind it.

兼容性

项目 状态
Harness DeepSeek Harness dsh-v0.1.7-rc.2(GitHub tag,2026-09-24 已核验:完整门控链,针对钉住的 0.1.7-rc.2 peers)。npm 依赖线 0.1.7-rc.2,peers `>=0.1.2-rc.1 <0.2.0
Node ^22.19.0 || >=24.0.0
平台 任何能运行 git 和 DSH 的环境(基于 git 镜像;无平台特定代码)
模型 纯文本模型即可完整支持;无需视觉或额外模型能力

你能得到什么

dsh-session-sync 把你的 DSH 会话存储镜像到一个专用 git 工作树,并同步到你自己控制的远端 —— 无云服务、无第三方存储:

  • /sync 命令 —— status(分支、脱敏后的远端、领先/落后、未提交文件、fork 文件)、diff、log、pull、push、help。
  • sync_status / sync_pull / sync_push 工具 —— 在轮次内为模型提供同样的能力。
  • append-only 冲突裁决 —— 会话日志是 append-only;任何分歧都会两边都保留(本地版本保留、远端版本留存为 fork 文件),绝不静默覆盖。分歧的会话还可在会话层面 fork。
  • 自动模式 —— 启动时拉取、每个关闭轮次后推送、周期拉取,全部可配置且可逆。
  • 写操作走确认门 —— pull/push 会先询问(经 userQuestions 或 approval);只读界面从不询问;没有回答者时操作失败关闭。
设备 A                              远端(你的 git 仓库)                  设备 B
$DSH_HOME/sessions ──镜像──▶ 提交 ──推送──▶ [sessions] ──拉取──▶ 合并(两边保留 + fork)

快速开始

# 1. 把 bundle 安装进你的 profile
dsh plugin --profile web add "github:PerryLink/dsh-session-sync#main"

# 或从 npm(已发布版本)
dsh plugin --profile web add dsh-session-sync

# 2. 指向一个私有 git 远端并核对挂载行
dsh --profile web --dump-config | grep -A2 'id: session-sync'

然后在你的 profile patch 里设置远端(基线应是私有仓库)并同步:

- insert:
    - id: session-sync
      name: dsh-session-sync
      config:
        remote: git@github.com:you/your-dsh-sessions.git
> /sync status
> /sync pull
> /sync push

安装与卸载

  • git 通道(最新 main):dsh plugin --profile web add "github:PerryLink/dsh-session-sync#main"(等价于从 git+https://github.com/PerryLink/dsh-session-sync.git 安装)。无构建步骤 —— index.mjs 与 lib/ 即发布产物。
  • npm 通道(已发布版本):dsh plugin --profile web add dsh-session-sync。
  • tarball 通道:在本仓库执行 pnpm pack,然后 dsh plugin --profile web add ./dsh-session-sync-<version>.tgz。
  • 卸载:dsh plugin --profile web remove dsh-session-sync(或从 profile patch 删除该行)。

配置

所有可调项都是 Schemastery Config 字段(可从 cordis.yml 覆盖)。按 id 的覆盖会替换整行 —— 重述你需要的每个键。cordis.patch.yml 对每个键都有行内注释。

键 默认值 含义
enabled true 总开关;false 卸载命令、工具、监听器与自动模式
backend git 同步后端:git(明文镜像)或 encrypted(age 加密镜像内容)
sessionRoot '' 会话存储根;空 = $DSH_HOME/sessions(两者皆缺加载失败)
repoDir '' 同步工作树根;空 = $DSH_HOME/dsh-session-sync/repo
remote '' 远端地址(pull/push 前必须非空;status/diff 无需)
branch main 远端分支名
gitBin git git 可执行路径
ageBin age age 可执行路径(backend: encrypted 时探测;缺失降级明文)
ageRecipient '' age 收件人(公钥/身份串);空 = 无法加密、降级明文
ageIdentity '' 无口令 age 私钥文件路径(用于解密);空 = 无法解密、降级明文
autoPullOnStart false 插件挂载时拉取一次(配置即授权,不再确认)
autoPushOnTurnEnd false 每个关闭轮次后推送
pullIntervalMinutes 0 每 N 分钟周期拉取(0 = 关闭,最大 10080)
confirmVia auto 确认通道:auto(优先 userQuestions,其次 approval)、userQuestions、approval
graceMs 10000 git 终止宽限(毫秒)
commandTimeoutMs 120000 单条命令超时(毫秒)
maxOutputBytes 262144 单流收集输出上限(字节)
commitName dsh-session-sync 提交者名
commitEmail dsh-session-sync@localhost 提交者邮箱
registerCommand true 注册 /sync 命令
registerTools true tools 服务存在时注册 sync_* 工具

在你的 profile patch 中的覆盖示例:

- insert:
    - id: session-sync
      name: dsh-session-sync
      config:
        remote: git@github.com:you/your-dsh-sessions.git
        branch: main
        autoPushOnTurnEnd: true
        pullIntervalMinutes: 30
        confirmVia: userQuestions

工具与界面

界面 只读 需要确认 说明
/sync status ✅ — 分支、脱敏远端、领先/落后、未提交文件、fork 文件、最近推/拉
/sync diff ✅ — 未提交变更 + HEAD..remote 统计(只读)
/sync log ✅ — 同步仓库最近提交
/sync pull ✅ fetch + 合并(两边保留语义;本地保留、远端留存为 fork)
/sync push ✅ 镜像 + 提交 + 推送;绝不强推,被拒时拉取调和后重试一次
sync_status ✅ — 为模型提供 /sync status 同样的信息
sync_pull ✅ 模型可调用的拉取
sync_push ✅ 模型可调用的推送

权限与数据

  • 权限:写操作走确认门(confirmVia);插件从不重新实现或绕过 harness 的 userQuestions/approval 服务。自动模式由配置授权覆盖,不再确认。
  • 数据:同步元数据(设备 id、最近推/拉、最近推送头、最近错误)存于 session-sync 存储领域。会话文件按不透明字节复制 —— 插件从不解析它们。设备 id 也写入同步仓库的 device.txt,用于跨设备 fork 归属。
  • 会话日志:sync/push、sync/pull、sync/conflict 在 types.d.ts 中声明;仅当宿主收录这些类型时才追加(见已知限制)。所有写入与展示的内容都经过脱敏。插件写入的唯一持久消息——冲突 fork 通知——携带插件自有的 producer-owned source kind(dsh-session-sync);宿主已退役共享的 plugin kind,读回会话时一律拒收。

安全边界

  • 绝不静默覆盖。 append-only 三分支合并在任何分歧时都保留两边;fork 文件永不被删除,git 绝不强推、reset、rebase 或切换分支。
  • 路径收容。 文件按不透明字节镜像、拒绝符号链接,每次路径拼接都做收容校验(PATH_UNSAFE 响亮失败)。
  • 脱敏输出。 远端 URL 凭据、令牌与 key=value 密钥在进入模型或日志前被打码;路径展示拒绝根外路径。
  • 不存凭据。 插件自身不存凭据;git 凭据由你常规的 git credential helper 管理。age 身份/接收方文件由你管理,密钥绝不进入同步仓库。
  • git 加固。 git 以 GIT_TERMINAL_PROMPT=0、GIT_OPTIONAL_LOCKS=0 运行,带截止时间与信号边界,输出按流封顶。
  • 失败关闭。 缺少确认回答者、缺少远端或不安全路径都会响亮拒绝操作。

加密与威胁模型

backend: encrypted 在镜像之上增加一层可选的 age 加密:会话字节在提交与推送前加密为 encrypted/**/*.age 文件,合并前再解密回本地明文镜像。三方合并始终在本地明文上进行,因此追加式保留双方语义不变。

加密保护什么:

  • 远端中的镜像内容。 你推送的会话文件是 age 密文;远端主机、其运维者以及任何克隆该仓库的人,没有私钥都看不到明文的会话字节。

加密不保护什么(边界):

  • 密钥与 age 身份由你管理。 接收方/身份文件从不由插件随包分发、存储或轮换。密钥泄露会使它保护的镜像内容暴露。请使用无口令身份并把它放在仓库之外。
  • 远端实际仍是私有仓库。 git 元数据——提交信息、.gitignore、encrypted/ 路径结构、分支名与推拉活动——对远端主机依然可见。加密隐藏的是内容,不是你在同步这个事实,也不是会话树的形态。
  • 明文仍存在于本地。 <repoDir>/sessions/ 的镜像在磁盘上是明文;加密保护的是传输中/远端的那份,而非本地磁盘加密或正在使用的会话存储。
  • 优雅降级意味着明文。 使用 backend: encrypted 时,若 age 缺失,或 ageRecipient/ageIdentity 为空,插件会回退到明文 git 路径并在状态/日志中显式告警——它绝不假装已经加密。在把远端当作已加密之前,先检查 /sync status 中的告警。

基线:backend: git(默认)下,会话字节以未加密形式存放在你的 git 远端——请使用私有仓库。

已知限制

  • 加密可选。 backend: encrypted 增加一层 age 加密(见上文「加密与威胁模型」);age 或密钥缺失时它会显式告警并降级为明文。backend: git(默认)下,会话字节以未加密形式存放在你的 git 远端 —— 请使用私有仓库。
  • 依赖 git。 插件需要 git 可执行文件与 subprocess 服务;没有它们时同步操作会给出明确原因失败(profile 仍可启动)。
  • 0.1.0-rc.6/0.1.0-rc.8/0.1.1-rc.2/0.1.2-alpha.2/0.1.2-alpha.3/0.1.2-rc.1/0.1.7-alpha.2 上的会话事件。 harness 尚未收录 sync/* 事件类型,因此会话日志追加被跳过(会话仍可加载);宿主收录类型或 Session.append 暴露 ignorable 信封后插件会自动开启。
  • 轮次间的 approval。 /sync 在轮次之间运行,approval 通道没有开放轮次可挂靠;请对命令式同步使用 confirmVia: userQuestions,或在轮次内经工具驱动同步。开放轮次判定读宿主 turnBoundary 会话投影:未组合 @deepseek-ai/dsh-session-projection 时无法核实轮次状态,按失败关闭并给出该原因。
  • 宿主私有产物不进同步。 session.lock(宿主会话租约)与 session.migration.*.tmp(迁移暂存)永不镜像、永不删除——它们是运行时状态而非可同步内容;会话日志(session.jsonl、session.v[1-9]*.jsonl[.zstd])仍是镜像载荷。

开发

pnpm install                                       # node ^22.19 || >=24
pnpm run typecheck && pnpm run typecheck:ci        # tsc --checkJs,针对已发布的 0.1.7-alpha.2 peers
pnpm test                                          # node --test(13 个测试文件;git 引擎套件在无 git 时跳过)
pnpm run verify:self-contained                     # 依赖 spec 可从 registry 解析
pnpm run verify:artifacts                          # 发布文件齐全 + index.mjs 可 import
pnpm run check:readmes                             # 五语 README 一致性
pnpm pack                                          # 发布 tarball

无构建步骤:纯 ESM,index.mjs 与 lib/ 即发布产物。

Topics

dsh, dsh-plugin, deepseek-harness, deepseek, cordis, session-sync, session, git, sync, cross-device

贡献者

  • @PerryLink —— 创建者与维护者:git 镜像引擎、append-only 两边保留合并、/sync 命令与 sync_* 工具、自动模式、脱敏器与五语文档。

PerryLink DSH Plugin Family

This project is one of the 45 DeepSeek Harness plugins maintained by PerryLink. If this one helps you, the others likely will too:

Plugin One-liner
dsh-auto-review Second-model auto-review on the approval chain, fail-closed by default
dsh-autotier Automatic strong/cheap model-tier routing with deterministic risk guards and a /tier command
dsh-background-agents Durable background child agents with a Web UI sidebar, messaging and interrupt
dsh-budget Cost governance for DeepSeek Harness: budgets, carbon, and latency in one panel.
dsh-catalog DSH Desktop Market standard catalog source for the PerryLink family
dsh-cert-mcp Read-only MCP server exposing the certification registry: grades, snapshots and five-dimension evidence
dsh-checkpoint-rewind Claude Code /rewind-equivalent: snapshots, session forks, one-shot restore
dsh-claude-move Migrate Claude Code sessions, memory, skills and CLAUDE.md into DSH
dsh-click Cross-platform native desktop control for DeepSeek Harness — Windows first.
dsh-composer-history Terminal-style input history for the web composer: arrows, Ctrl+R search
dsh-data-quality Dataset quality checks and citation cross-checks (the optional numeric bridge consumed here)
dsh-defend Prompt-injection, jailbreak, and secret-leak defense for DeepSeek Harness.
dsh-doublecheck Engineering-discipline guard: requirements grill, test gates, adversary review
dsh-draw Unified static-image generation routing for DeepSeek Harness.
dsh-fast Read-only performance diagnostics for DeepSeek Harness.
dsh-fund-research Deterministic research reports for Chinese public mutual funds
dsh-github GitHub PR/issues integration for DSH, every write gated by approval
dsh-industry-research Industry research orchestration that seals its deliverables through this plugin's ctx.researchReport.assemble
dsh-laya Laya typed decisions (noul/choice/score) as a first-class Cordis service and model-visible tools
dsh-library Local document knowledge base for DeepSeek Harness.
dsh-local-ai Local-model (Ollama) integration for DeepSeek Harness.
dsh-lsp-actions LSP diagnostics, formatting, completion, code actions and rename over language servers
dsh-mask PII masking middleware: anonymize at the model boundary, restore at the display layer
dsh-mcp-panel Read-only MCP runtime panel: /mcp command + Settings tab with status, tools and errors
dsh-memento Approval-gated cross-session memory: ctx.memory seam + SQLite + memory tool
dsh-observe OpenTelemetry and Langfuse observability exporter for DeepSeek Harness.
dsh-output-styles Claude Code outputStyles-equivalent runtime style switching
dsh-permission-rules Claude Code-style declarative allow/deny/ask permission rules with audit
dsh-plugin-certification Community certification registry with repro-checkable grades and badges
dsh-plugin-doctor Zero-dependency static + sandbox smoke detector for DSH plugins
dsh-plugin-guide Plugin-development knowledge base as an on-demand agent skill
dsh-plugin-kit Shared zero-runtime-dependency toolkit for the PerryLink DSH plugins
dsh-plugin-upgrade One-package, one-corridor-index plugin upgrade skill: routes a repository to the matching closed corridor card
dsh-plugin-upgrade-015 Merged 0.1.3-alpha.1 → 0.1.5-rc.1 upgrade corridor card plus a zero-dependency seam scanner
dsh-reach Multi-channel approval/question bridge: WeChat/Telegram/Feishu, session console
dsh-research-report Verifiable research-report engine: content-addressed evidence ledger and sealed versions
dsh-score Multi-dimensional quality scoring for DeepSeek Harness plugins.
dsh-session-pin Pin sessions in the Web sidebar with durable ordering
dsh-session-sync Cross-device session sync for DeepSeek Harness — a dedicated git mirror of your session store.
dsh-skill-pack-security Security-audit skill pack: secret scan, dependency and supply-chain review
dsh-talk Voice-first session loop for DeepSeek Harness: talk to it, hear it answer.
dsh-team-rooms Cross-session team rooms: shared message bus, task board and timeline
dsh-test-drive Isolated install-and-smoke test drives for DeepSeek Harness plugins.
dsh-ticktick TickTick/Dida365 task bridge: session-header panel + 11 tools
dsh-translate Vendor parameter translation and deterministic JSON repair for DeepSeek Harness.

从 DSH Desktop 市场安装

所有 PerryLink 插件均可在 DSH Desktop 内置市场中浏览:市场 → 来源 → 添加来源 → 粘贴 https://perrylink-dsh-catalog.perrylink.workers.dev/catalog-source.json → 选中。安装仍需通过市场的 npm 身份校验与你的确认。

许可证

LICENSE (Apache License 2.0) © 2026 dsh-session-sync contributors

内容来自项目 README(GitHub)↗

评论存放在 GitHub Discussions。用 GitHub 账号登录后可发表评论或点表情。