dsh-undo-savepoint README

The project's README from github.com/lire1131/dsh-undo-savepoint. As one markdown file: README.md.

dsh-undo-savepoint DSH 安全管家(撤销 / 回退 / 崩溃自愈)

awesome · DSH plugin CI

中文 | English | 更新日志

为 DeepSeek Harness (DSH) 打造的安全管家。改设置自动存档,一键撤销 / 恢复 / 回退到任意版本;DSH 起不来时,局外 WebUI / GUI / CLI 依然可用。

主动检查,有异常才说话。DSH 版本变化时先打升级保险快照,崩溃后给出最后正常快照。

预览

局外 WebUI:端口 → Profile → 快照库三段式流程条,快照按日期分组,逐条对比 / 恢复 / 备注 / 删除
webui
快照对比:左栏文件导航带增删行数,右栏逐行红绿 设置:实例管理、快照策略、自动清理与保留数量
diff settings
批量处理:勾选多条后一键删除,先二次确认 安全模式:禁用其他插件前给出两条风险提示
batch safemode

核心能力

能力 说明
配置与插件代码回滚 快照覆盖配置与用户插件代码树,undo / redo / 回退任意版本,WebUI、对话、CLI 三入口。
文件回退 按 AI 消息或 60s 批次回滚工作区文件改动,不依赖 git,不删聊天记录。
一键安全模式 DSH 起不来时只留本插件保证启动,改前先落快照。
崩溃归因与自检修复 按日志签名给出最后正常快照;undo_doctor 查启动硬失败,undo_scan 修会话文件,改前都先存档。
时间线与整页管理 日期分组、备注标签、定时快照、ZIP 导出导入;侧边栏「快照管理」整页打开,不遮罩对话。
对话头控件可选 六项各自开关,默认只放撤销、重做、创建快照与单入口菜单。
局外急救与免装 Node WebUI、GUI、CLI 与桌面快捷方式都能用,系统没装 Node 时复用 DSH 自带的那份。

平台支持

能力 Windows macOS Linux
配置 / 插件快照、撤销 / 重做 ✅ ✅ ✅
局外 CLI / GUI ✅(.bat / .ps1) ✅(.command) ✅(.sh)
局外 WebUI(undo-server) ✅ ✅ ✅
文件选择对话框 PowerShell 原生 osascript zenity → kdialog(都没有则回退手输)

安装

前置:已安装 DSH(@deepseek-ai/dsh)。离线工具优先复用 DSH 自带的 Node,找不到再回落系统 Node(≥20),系统没装 Node 也能用。宿主本身对 Node 的要求由 DSH 决定,0.2.2 及以后要 ≥24.9。

桌面端安装(推荐)

桌面端是主要使用场景,走 desktop profile。先启动一次桌面端完成初始化,再完全退出桌面客户端后执行安装。

GitHub 直装。默认装默认分支的最新提交,需要固定版本时在末尾加 #vX.Y.Z。

dsh plugin --profile desktop add github:lire1131/dsh-undo-savepoint

npm 源安装。默认装 npm 上的 latest,需要固定版本时在包名后加 @X.Y.Z。

dsh plugin --profile desktop add dsh-undo-savepoint

安装完成后重启 DSH 即生效。DSH 0.2.0-rc.2 起的桌面版遇到致命错误会弹官方恢复窗,第三个按钮会摘掉第三方插件的 bundles 条目,并把补丁备份为 cordis.patch.yml.bak-<时间戳>,包本体保留。被禁用后不需要重装,恢复挂载声明即可。桌面形态下 safe-mode 默认拒绝执行,带 confirmDesktop 的显式确认会先落前置快照再写文件;官方恢复窗第三个按钮仍是首选逃生路径。

Web profile 安装

把 profile 换成 web。需要固定版本时按上面的方式自行加 tag 或版本号。

dsh plugin --profile web add github:lire1131/dsh-undo-savepoint
dsh plugin --profile web add dsh-undo-savepoint

环境自检

插件首次挂载时检查外部 Node.js、PowerShell、平台与 DSH home 可写性,结果写入日志,不阻断启动。离线启动脚本(launch-undo.bat、launch-undo.sh、launch-undo.command)在启动 WebUI 前调用同一入口。设置 DSH_UNDO_SKIP_ENV_CHECK=1 可跳过整个自检。

使用

DSH 起不来时

运行局外 WebUI,不依赖 DSH。

node tools/undo-server.mjs

时间线、回滚、对比、诊断与安全模式都在这个本地页面里。插件加载后会自动创建桌面快捷方式,双击也能打开。系统没装 Node 时,快捷方式用的是 DSH 自带的 Node。需要一键禁用除本插件外的全部用户插件时,用安全模式,重启 DSH 后再逐个排查。

支持范围

package.json 的 engines.dsh 覆盖 0.1.x 与 0.2.x 的历次声明,末段为 >=0.2.2-0。已验证桌面版 DSH 0.2.0-rc.2、0.2.1-rc.3、0.2.1-rc.5 与 0.2.2-rc.5。

DSH 0.2.2 起宿主要求 Node.js 24.9,本插件离线工具仍只要求 20,两者分开判定。版本不在声明范围内时,不要改 package.json,用官方的版本豁免。

dsh plugin --profile web allow-version dsh-undo-savepoint@<插件版本> --dsh-version <运行时版本> --accept-risk

卸载

dsh plugin remove dsh-undo-savepoint
node tools/uninstall.mjs

uninstall.mjs 默认摘掉挂载声明、junction 与桌面快捷方式,保留快照库与设置。确认不再需要历史快照时加 --purge。

node tools/uninstall.mjs --purge

快照存放与安全

快照默认在 $DSH_HOME\undo-snapshots,按 profile 分 manual 与 auto 两个库,手动库不自动清理。快照会复制 .env 等配置,可能含密钥;插件写入时对敏感文件做脱敏,真实值只存本机 vault。快照库仍是本机敏感目录,不要外传。

更多

dsh-undo-savepoint (lire1131/dsh-undo-savepoint)

Searching Database…

What is this?dsh-undo-savepoint is a crash-rescue plugin for DeepSeek Harness (DSH) that snapshots your config and plugin code so you can undo, redo, or roll back to any version, plus an offline CLI/GUI/WebUI that keeps working even when DSH itself won't boot.
Is this a DSH plugin or a standalone app?It's primarily a DSH plugin (dsh-plugin) installed inside DeepSeek Harness, but it also ships a fully standalone offline WebUI, GUI window, and CLI that run independently of DSH for emergency recovery.
What do I need before installing?You need DSH (@deepseek-ai/dsh) already installed and Node.js 20 or newer; the plugin's core itself is a pure, zero-dependency Node module.
Are there any size or restore limits I should know?Each snapshot's referenced plugin-code data is capped at 5MB; beyond that it only keeps a manifest with a [truncated] warning instead of losing data. Restoring package.json/pnpm-lock.yaml only flags that node_modules may be out of sync unless you pass -SyncDeps to actually reinstall.
Does it work the same on Windows, macOS, and Linux?Yes — since v0.4.0 the core is a pure zero-dependency Node module distributed for all three OSes, though the offline tools differ in format (.bat/.ps1 on Windows, .command on macOS, .sh on Linux) and file-picker dialogs use PowerShell, osascript, or zenity/kdialog respectively.
What does Safe Mode do when DSH won't start?Safe Mode disables every other user plugin so DSH can boot, while backing up and restoring your profile/home patch files and neutralizing entries in dsh.profile.bundles that would fail launcher validation; one click exits it again.
Can I undo just the file changes from one AI message?Yes, message-level undo tracks workspace file changes per AI message or 60-second batch, independent of git or session storage, letting you revert exactly what one reply changed.
What if a DSH session file gets corrupted?The undoscan tool checks session.jsonl.zstd files for known crash causes like single-frame layout violations or overlapping sequence numbers and can auto-fix them (keeping a .bak and a quarantine copy), even offline via dsh-undo.ps1 scan --fix when DSH won't launch.
Can I move my snapshots to a different machine?Yes, snapshots export/import as a ZIP file (optionally AES-256-GCM encrypted), and the restore flow pre-checks for missing plugins on the new machine before you apply them.
Creator
lire1131
Size
5 MB
Stars
207
Age
3mo
Commits · 90 Days