HaoyueQin/dsh-diff-stat0

dsh-diff-stat

Inline +N −M diff badges on edit/write tool rows and a per-turn file change summary card for DeepSeek Harness. PTC/code-dispatch fallback, no git required.

包名
dsh-diff-stat
版本
0.0.1
许可证
MIT
最近更新
2026年8月24日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:HaoyueQin/dsh-diff-stat

DSH Diff Stat

English | 中文

dsh plugin npm npm downloads dsh platform License: MIT i18n

A DeepSeek Harness Web plugin: inline +N −M badges on edit/write tool rows plus a per-turn file change summary card. Full unified diffs on click. Code Dispatch (PTC) nested sub-calls work via argument fallback — no wire diff view required. No git dependency, no third-party plugin dependencies.

Features

  • Inline +N −M badges: takes over the stock edit/write rows (keyed lower-priority shadow; uninstall restores stock automatically). Counts show while running from the argument-derived estimate, then switch to the exact result-view hunks on settlement
  • Full diff on click: expands a unified diff rendered through the stock DiffBlock primitive (16-line capped collapse, copy, └ +A -R footer, theme tokens)
  • Per-turn summary card: a collapsible "N files changed +X −Y" bar at each turn's tail; expands to per-file rows (name · directory · ±lines · review · open ▾ · ∨). Same-file edits within a turn merge and accumulate
  • PTC / Code Dispatch fallback: nested sub-calls carry no wire diff views; the plugin derives the call-time diff from the tools' own presentCall semantics (edit's old→new, write's whole-file create). rootCallId+subCallId dedup keeps replays from double-counting
  • Undo: reverts the turn's files to their pre-turn state — reverse uniqueness-checked hunk peeling, deletes files the turn created, rejects drifted files before writing, atomic commits
  • Inline view: 打开 ▾ → View inline expands a height-capped file content window (16-line collapse, the stock DiffBlock interaction)
  • Open with: system open (the stock openFile), reveal in Explorer, open in VS Code, copy absolute/relative path
  • zh / en: copy follows the Web UI language (locale service)

How it works

  • Inline badges: register the edit/write keys of the tool.call.toolview keyed slot at priority −1 (shadows the shipped rows); diff data follows the authoritative chain resultView → callView → argument fallback (a truncated window that dropped the call head still renders from the result view)
  • Turn summary card: a ConversationNodeDefinition accumulator (turn/start / tool/call / tool/result(append) / tool/code-dispatch) publishes Turn data; the conversation.chat.turnTail chain claims rendering — modeled on the official ui-deliverables plugin
  • Host half (optional): a same-origin prefix route serves a fenced API — realpath containment (checked before and after resolution), symlink rejection, UTF-8 round-trip validation, 512 KiB read cap, atomic writes. When the host half is absent the dependent actions hide themselves

Install

# npm pack tarball (recommended; sidesteps the Windows local-dir link: junction bug)
dsh plugin --profile web add dsh-diff-stat-.tgz

# restart dsh web to take effect
dsh web

Uninstall:

dsh plugin --profile web remove dsh-diff-stat

Development

npm install --legacy-peer-deps          # devDependencies (peers are dsh-internal packages)
DSH_CHECKOUT= bash scripts/build.sh   # host half → lib/ (junction links + tsc)
npm run build:client                    # browser half → lib/client.js (tsdown)
npm run typecheck                       # both halves via tsc

License

BSD-3-Clause