@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误写代码、随时想一键撤销文件变更的开发者。
설치
$
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 里该条目可配:
| 键 | 默认 | 说明 |
|---|---|---|
maxSnapshots | 300 | 保留快照条数上限,超出淘汰最旧的 |
maxFileBytes | 4194304 | 超过此大小的文件不快照 |
onlyToolWrites | false | true 时只快照带工具 actor 的写入 |
sessionScanEvents | 400 | 为定位轮次边界而扫描的会话日志尾部条数 |
listFilesPerTurn | 10 | action: "list" 每轮最多列出多少条文件,其余用一行省略汇总(list 带上 turn 则打印该轮全量清单) |
debug | false | true 时把每个事件写入 $DSH_HOME/undo/debug.log |