JJXjustin/dsh-session-rewind ↗★ 1
dsh-session-rewind
Session and file rewind for DeepSeek Harness: checkpoint version points into a session's event log, rewind a session to any version point (archiving the original log, physically rebuilding the log file, and refreshing the projection cache), optionally pin shadow-repo git anchors for file-level restore, plus a chat UI entry to list/preview/confirm rewinds after each turn. · DSH 会话回退插件:为会话事件日志打版本点,可回退会话到任意版本点(归档原日志、重建日志文件、刷新投影缓存),可选影子仓库 git 锚点实现文件级回退,并在每轮对话后提供「还原检查点」UI 入口。 适合需要将 DSH 会话回滚到任意历史打点,或利用 Git 锚点进行文件级恢复的用户。
Other repositories with this package name
Install
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:JJXjustin/dsh-session-rewindREADME
Read the full README ↗HTTPS(推荐,需要先配置 git)
git clone https://github.com/JJXjustin/dsh-session-rewind.git
或 SSH(配置了 SSH key 后)
git clone git@github.com:JJXjustin/dsh-session-rewind.git
克隆后进入目录:`cd dsh-session-rewind`
### 2. 装配到 DSH
插件通过 DSH 的 profile 装配(link 目录方式,免 build)。在你的 DSH profile 目录(`~/.dsh/profiles/web`):
```bash
## 配置(可选)
`~/.dsh/dsh-session-rewind.json`:
```json
{
"autoCheckpoint": false,
"autoCheckpointPerTurn": true,
"checkpointOnTool": false,
"autoEveryNTurns": 0,
"gitAnchor": true,
"shadowDir": null,
"rewindPaths": null,
"rewindExclude": null
}
| 字段 | 默认 | 说明 |
|---|---|---|
autoCheckpoint | false | agent/pre-step(每步/模型请求前)打点,默认关——打点统一为「每轮一次」 |
autoCheckpointPerTurn | true | 每轮对话结束打 1 个版本点(唯一的默认打点来源;autoEveryNTurns>0 时改按 N 轮取模) |
checkpointOnTool | false | 每个顶层工具调用前打一版(标签「工具:」),显式开启才生效(旧名 checkpointOnTools: true 仍兼容) |
autoEveryNTurns | 0 | 每 N 轮打点(0 = 用 autoCheckpointPerTurn 的每轮语义) |
gitAnchor | true | 文件快照默认开:每个检查点同时在影子仓库建 git 提交(commit message = dsh-rewind::),还原时把工作区受管范围完整恢复到该快照 |
shadowDir | null | 影子仓库根目录(显式指定则不用 rewindDir/shadow-repos);默认 /.dsh-rewind/shadow-repos/ |
rewindPaths | null | 快照白名单(数组),默认整个工作区;配置后只快照这些路径 |
rewindExclude | null | 额外排除路径(追加到内置排除 .git/node_modules/.dsh-rewind/.agent-teams/_rollback/日志等之后) |