DeepSeek Harness Plugin

converk/dsh-tweaks#turn-file-revert

Stars ★ 0 Downloads (30d) 113 Category UI Enhancements Added 2026-09-11 npm dsh-tweaks-turn-file-revert

Adds a changed-file summary row to finished turns and reverts or reapplies the file changes of the latest turn in the session.

Install

# from npm (prebuilt)

dsh plugin --profile web add dsh-tweaks-turn-file-revert

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:converk/dsh-tweaks#path:/plugins/turn-file-revert

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).

README

This plugin publishes its README in Chinese only.

每轮对话改完文件后,在回合末尾多给一行统计,并提供「一键撤回 / 重新应用」。

它能做什么

  • 这一轮总共 加了多少行、删了多少行,改了 几个文件
  • 一个 「撤回全部修改」 按钮:把这一轮改过的文件一次性还原成改动前的内容;
  • 撤回之后按钮会变成 「重新应用修改」,再点一下就把改动原样写回去——反悔了不用重新让模型改一遍。

补出来的一行长这样:

本轮改动情况:+52 行 −7 行    3 个文件    [撤回全部修改]

只要这一轮有文件改动就会出现,不要求官方那行「本轮文件改动」也在:模型在 run_code 里改文件时官方不会列,本插件照样统计。

怎么用

  1. 等一轮"改过文件"的对话结束。
  2. 在回合末尾找到插件补的那一行。
  3. 「撤回全部修改」 → 文件回到这一轮开始前的内容,按钮变成「重新应用修改」,并提示「已撤回本回合修改」。
  4. 想反悔,就再点 「重新应用修改」

只有本会话最后一次对话能撤回 / 重新应用。 更早回合的按钮是灰的,鼠标移上去提示「该轮对话改动现在不支持撤回/恢复」,点了也不会执行——免得把后面几轮已经改好的结果覆盖回去。发出新一轮对话后,上一轮的按钮会自动变灰。

① 本轮有改动 —— 统计 + 可点的「撤回全部修改」

本轮有改动:本轮改动情况 +52 行 −7 行、3 个文件,「撤回全部修改」可点

② 点了「撤回全部修改」—— 按钮变成「重新应用修改」

撤回后:按钮变为「重新应用修改」,右侧提示「已撤回本回合修改」

③ 更早的回合 —— 按钮置灰,鼠标移上去给提示

非最后一次对话:按钮置灰不可点,hover 提示「该轮对话改动现在不支持撤回/恢复」

说明

  • 只统计 / 撤回模型通过文件工具改的内容write / edit / str_replace_editor,新建、修改都算)——直接调的、在 run_code 里调的都算;你自己在终端或编辑器里改的文件不在这一行里。
  • 撤回是整轮一起撤,不能只撤其中某个文件。
  • 撤回以插件记录的**「改动前内容」为准直接写回;磁盘上如果已经和记录不一致(比如你手动改过),它仍然会覆盖**,并在结果里标出「覆盖了 N 个已被改动的文件」。
  • 鼠标停在那一行上,可以看到这一轮每个文件的 +/− 明细。
  • 重启 DSH 之后,之前回合的记录会丢:那些回合不会再显示这一行,也撤不了。
  • 只读模式(read-only 沙箱)下拒绝写回,也不会删除本回合新建的文件。

安装

npx @deepseek-ai/dsh plugin --profile web add "D:\你的目录\dsh-tweaks\plugins\turn-file-revert"

重启 DSH,并在浏览器中强制刷新(Ctrl + Shift + R)。

本插件含宿主半区,必须重启 DSH 后生效。 web 为 DSH 的 profile 名称,可在 C:\Users\你的用户名\.dsh\profiles\ 下确认。

开发者

本仓库的开发约定、DSH 契约与通用坑见 AGENTS.md

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.