dsh-approval-diff
界面增强 活跃维护

dsh-approval-diff

joao-paulo-santos/dsh-approval-diff

可将默认文件变更审批提示替换为真实差异审查界面的插件,支持行级diff对比、变更关键词高亮、磁盘源上下文调用,单个文件独立卡片展示,变更审核流程更直观高效。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
JavaScript
主要语言
None
开源协议
56 KB
仓库大小
29 天前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:joao-paulo-santos/dsh-approval-diff
git clone https://github.com/joao-paulo-santos/dsh-approval-diff.git
git clone git@github.com:joao-paulo-santos/dsh-approval-diff.git
README.md main

dsh-approval-diff

A DeepSeek Harness (DSH)
plugin: install it into a profile alongside your own plugins.

See what you approve. When the model asks permission to change a file, the
native card shows the tool arguments: old_string and new_string as raw
text, no file context, no line numbers. This plugin replaces that ask with a
real diff review: red and green lines side by side, word-level highlights
inside changed lines, surrounding file content with true line numbers, and
exactly two buttons.

Plugin value proposition

alternative falls short
the native approval card raw tool arguments; you reconstruct the diff in your head, every ask
reading the file yourself you become the diff engine, and the model already read it once
auto-approve and hope no review at all

What you get

  • True line diffs for edit: LCS line matching plus word-level highlights;
    unchanged lines inside an edit's operands render as context, not as changes
  • Split or Unified view (GitHub style toggle, choice remembered); unified
    groups each change run as all removed lines, then all added
  • New files (write) render one-sided, all green; deletions (rm and
    friends) render the full current file in red before you decide
  • Consecutive edits to the same file merge into one diff and one decision
  • Two buttons, Reject and Allow, scoped to exactly what the card shows
  • Requests that cannot succeed are never shown to you
  • Minimize collapses the card without deciding; the close button hands that
    request back to the native card

How to install

Requires a DeepSeek Harness checkout and a profile (here web):

# from the harness checkout
pnpm dsh plugin --profile web add /path/to/dsh-approval-diff

# verify the profile still composes
pnpm dsh --profile web --dump-config

Restart the harness after installing: the host half loads at boot. The
client half hot-reloads once installed.

Tests

node test/client.test.mjs

47 checks: host route contract, chain selection, diff rendering (split and
unified), context dedup, per-file scoping, run merging and queued delivery,
doom detection, dismissal and fallthrough.

Limitations

  • File-changing approvals only (edit, write, deletion-only bash).
    Everything else is the native card's job.
  • Deletion review reads targets from disk; glob targets render as the
    pattern.
  • One approval at a time, matching the native card's behavior.