ddtcorex/dsh-maestro-sync ↗★ 1
@ddtcorex/dsh-maestro-sync
Maestro 跨机同步插件:支持在多台机器之间合并记忆与会话,采用“先只读预览、后确认应用”的安全同步机制。
AI 分析
核心用途是解决多设备间 DSH 数据不一致的问题。适合在公司和家里多台电脑上使用 DSH、需要无缝同步会话历史与长期记忆的用户。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:ddtcorex/dsh-maestro-sync说明文档
阅读完整 README ↗dsh-maestro-sync
Maestro harness sync — merge memories and sessions across machines (publishable)
DSH Maestro plugin — part of the
dsh-maestro-*ecosystem (@ddtcorex/dsh-maestro-sync).
Install
dsh plugin add @ddtcorex/dsh-maestro-sync
Safe Sync — Preview then Apply
Sync is exact, read-only preview first, then confirmed apply:
# 1. Preview (read-only, no writes, 60s TTL) — the only way to see a plan
node lib/cli.js --pull --dry-run # or --push --dry-run
# stdout: one final JSON SyncPreview { ok, previewId, revision, expiresAt, summary, actions }
# human progress goes to stderr
# 2. Apply the EXACT preview you just reviewed (requires all three)
node lib/cli.js --pull --apply --preview-id --confirm
- No omitted boolean can apply a sync.
--applywithout--preview-idand--confirmexits non-zero; the legacypull/pushroutes and tools are preview-only compatibility aliases and never write. - Stale-guard: apply re-inventories both machines, recomputes the plan and
rejects it as
STALE_PREVIEWif anything changed since the preview — no write happens against a stale plan. Apply is single-use per preview id. - Eligible only:
memories/**/*.md(no*.bak.*),memories/SUGGESTIONS.jsonl,sessions///session.jsonl.zstd - Transport: argv-only
spawn/rsync --files-from, no shell interpolation; the remote root is a validated absolute path. A~/.dshdefault is resolved to the absolute remote home by the SSH preflight (printf %s '$HOME'), never by shell~expansion. - Sessions:
Buffer/pathonly via validated Zstd artifact API; the standalone checksummed header frame is preserved and merged line-union. - Atomic publish: pull =
backup + fsync(tmp) + rename + fsync(dir)per local file; push = materialize to a private operation dir, upload to/.maestro-sync/stage//, then a fixed POSIX CAS helper validates each target SHA-256 (expectedTargetSha256), backs up and renames atomically. A concurrent remote change is reported asCONCURRENT_MODIFICATIONand never overwrites the target. - Fail closed: a transport/stage/publish failure is a structured non-zero
result with
committed/uncommittedjournals —ok:trueonly when every reported file was actually published. No merge-mode fallback to destructive rsync;--strategy=overrideexists only with a separate--ack-override. - Recovery: every overwritten file keeps a timestamped backup beside it
(
.bak..; remote backups under the same rule). Restore withcp .bak.*. - Consent: live Apply is an operator action — the CLI requires
--preview-id+--confirm; the Settings UI only offers Apply inside a confirmation dialog bound to a live preview. - Host preflight:
ssh -o ConnectTimeout=5must succeed before preview/apply. - UI: Settings -> Maestro Sync -> Preview Pull/Push -> review
copy/merge/skip/conflict-> confirmation dialog (direction, host, plan age, action counts) -> Apply.
Excluded (never read, hashed or copied): settings, tunnel profiles, secret
material, profiles, supervisor state, storages, tools, skills, logs, caches and
*.bak.*.
Develop
pnpm --filter @ddtcorex/dsh-maestro-sync verify
pnpm --filter @ddtcorex/dsh-maestro-sync build
pnpm --filter @ddtcorex/dsh-maestro-sync test