ruaibeite/dsh-undo ↗★ 0

@ruaibeite/dsh-undo

Turn-level file undo for DeepSeek Harness: every write and edit is snapshotted before it lands, and the model (undo tool), the human (/undo command) or the GUI button in the message action row can roll back all files a turn changed. 适合需要防止AI误写代码、随时想一键撤销文件变更的开发者。

Package
@ruaibeite/dsh-undo
Compatibility
Unverified
Harness peer range
>=0.1.5-rc.1 <0.1.6-0 || >=0.1.7-rc.1 <0.1.8-0 || >=0.2.0-rc.1 <0.2.1-0 || >=0.2.1-alpha.1 <0.3.0-0
Cordis peer range
^4.0.1 || >=4.0.5-alpha.1 <4.0.6
Version
0.4.1
License
MIT
Last updated
Oct 8, 2026

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:ruaibeite/dsh-undo

存储与配置

$DSH_HOME/undo/
├── index.json                 # 快照索引,每条含 id/time/path/existed/bytes/turn/sessionId
└── files/             # 快照内容(逐字节)

$DSH_HOME 内部的写入会被排除(那是 harness 自身状态,不是工作区文件)。

cordis.patch.yml 里该条目可配:

键默认说明
maxSnapshots300保留快照条数上限,超出淘汰最旧的
maxFileBytes4194304超过此大小的文件不快照
onlyToolWritesfalsetrue 时只快照带工具 actor 的写入
sessionScanEvents400为定位轮次边界而扫描的会话日志尾部条数
listFilesPerTurn10action: "list" 每轮最多列出多少条文件,其余用一行省略汇总(list 带上 turn 则打印该轮全量清单)
debugfalsetrue 时把每个事件写入 $DSH_HOME/undo/debug.log