lehhair/dsh-diff-viewer
DSH Web GUI PiUI风格差异查看器插件:通过ui-tool diff-card链式插槽替换写入/编辑工具调用的默认DiffBlock(包含主机补丁)。私有。
Project Overview项目介绍
This is a native plugin built exclusively for DeepSeek Harness (DSH), serving as a PiUI-style diff viewer for the DSH Web GUI. It replaces the default DiffBlock diff rendering for the built-in write and edit tool calls, adding a range of quality-of-life improvements for viewing generated code changes. It includes support for real file line numbers, word-level change highlighting, context folding for long unchanged sections, and windowed rendering for very large diffs. It also supports nested write and edit calls within PTC/Code Dispatch, correctly handling rendering for child tool calls without breaking core DSH functionality.
The plugin works by hooking into DSH's open keyed tool rendering slot, registering for the edit and write tool keys at a lower priority than the default renderer. It fully reuses DSH's official core components like ToolRow styling and DisclosureRow elements, only swapping out the expanded diff card for the new PiUI-style DiffViewer. It does not modify any core DSH code, so uninstalling the plugin immediately restores the original default diff rendering behavior. It also recalculates real starting line numbers for each diff hunk and passes them to the rendering layer, safely falling back to hiding line numbers for old sessions or nested calls without stored line number metadata.
Two official installation methods are documented: you can install directly from the GitHub repository via the DSH CLI command dsh plugin --profile web add "github:lehhair/dsh-diff-viewer", or install the pre-built tarball from the latest GitHub Release. To develop the plugin from source, you need a local checkout of the DSH core repository, use pnpm to install dependencies and run the build check, and built outputs are committed to the lib directory of the repo. Uninstalling is done via the DSH CLI as well, with a simple dsh plugin --profile web remove @dsh-external/dsh-diff-viewer command that cleans up all plugin files.
这是一款专为DeepSeek Harness(DSH)打造的原生插件,是DSH Web GUI的PiUI风格差异查看器,用于替换write/edit工具调用默认的DiffBlock差异渲染。它支持统一单栏/拆分双栏行号显示、真实文件行号标记、变更条标记、行内词级高亮、未变更上下文折叠、大差异窗口化渲染,同时还支持PTC/Code Dispatch的嵌套调用处理。
插件通过keyed接管方式替换write/edit的工具行渲染,以更低优先级注册对应按键,仅替换展开后的差异卡片为PiUI风格DiffViewer,不修改DSH核心代码,属于纯插件实现,卸载后即可恢复官方默认渲染。它会重新计算hunk的真实起始行号并透传到渲染层,对缺失行号信息的旧会话或嵌套调用会安全降级隐藏行号。
插件支持两种官方安装方式,可通过GitHub仓库直装,也可安装GitHub Release自动构建的压缩包,安装后重启DSH Web即可生效。开发需依赖本地检出的DSH源码,使用pnpm管理依赖和执行构建,构建产物已提交到仓库的lib目录。卸载可通过DSH官方插件命令直接移除,不会残留额外配置。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-diff-viewer(lehhair/dsh-diff-viewer)
仓库:https://github.com/lehhair/dsh-diff-viewer
本站详情页:https://www.yhbd.top/plugins/lehhair-dsh-diff-viewer/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证未声明 · ⭐ 26 · 最近提交 2026-09-06 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
- 26 stars - an early-stage project星标 26,属于早期项目
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add "github:lehhair/dsh-diff-viewer"
把 lehhair/dsh-diff-viewer 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-diff-viewer
DSH Web GUI 的 PiUI 风格 diff 查看器插件:替换 write/edit 工具调用的 diff 渲染(原 DiffBlock)。
- 统一/并排行号:unified 单栏默认(同一 gutter 并排显示旧/新行号),split 双栏可选(
viewMode) - 真实文件行号:已完成的 edit/write 顶层调用,行号 gutter 显示文件中的真实行号(GitHub 式
@@位置),不是片段内 1..N 重新计数;新建文件(create)显示 1..N - 变更条:新增实心绿条、删除条纹红条;行背景色带统一延伸到最宽行
- 词级高亮:行内改动叠加绿/红标记,shiki 语法着色(
highlightLines) - 上下文折叠:长段未变更行折叠为"
N 行未变更",向上/向下/全部展开 - 窗口化渲染:固定行高窗口化,大 diff 不挂载全部行;sticky 横向滚动条(hover 显现)
- 复制 +
└ +A -R · N file(s)页脚 - edit 结果默认展开:settled 的 edit 结果卡展开即见替换 diff(write 保持默认收起)
- PTC/Code 嵌套支持:Code Dispatch 内的 write/edit 子卡片同样接管——嵌套子调用核心短路 meta(
exec.parent时不执行presentationMeta),插件按工具参数推导调用时 diff(edit 的 old_string→new_string、write 的整文件新增),错误子调用保持通用错误路径
机制
插件通过 keyed 接管替换 write/edit 的工具行渲染:ui-tool 的 tool.call.toolview 槽是开放 key 域,同一 key 以更低 priority 阴影(最低优先渲染)。插件注册 edit/write 键(priority -1),接管后的行完全复刻官方 FileMutationRow(复用官方 ToolRow 样式 + DisclosureRow/StateDot 等平台组件),只把展开后的 diff 卡换成 PiUI 风格 DiffViewer——不改任何核心,纯插件,卸载即还原官方行。
- 真实行号机制:核心的
FileDiff契约只有{ path, oldText, newText },工具执行时 hunk 的真实起始行(structuredPatch的oldStart/newStart)被核心丢弃。插件的 host 半(lib/index.js)监听agent/created,在每个 agent 自己的 layer 上 re-register 一份edit/writeshadow 定义(官方 schedule 插件同款模式):schema/render/execute 全部原样复用原定义(...original),只替换output.presentationMeta为带行号的版本——用与核心相同的structuredPatch(context 3)复算 hunk,把oldStart/newStart镌进 meta 的 diffs。零额外 diff 计算(同一次structuredPatch多带两个字段),文件读写语义不变(execute 引用原闭包)。 - 行号透传:
oldStart/newStart随tool/result的 meta 落盘,穿过核心diffsFromMeta的窄化(只校验三个固定字段、额外字段原样保留)与插件自身的narrowDiffs(畸形值拒绝),到达 DiffViewer 渲染真实行号。 - 无锚点安全降级:老会话日志(meta 无行号)与 PTC 嵌套子调用(核心在
exec.parent存在时短路presentationMeta,meta 恒缺失)没有锚点 → 行号 gutter 隐藏(回到无行号的 diff 块),绝不显示编造的假行号。create(oldText: null)的 newText 即整个新文件,1..N 真实 → 显示。 - 不限制高度:展开的 diff 直接撑开显示完整内容(不套滚动容器),窗口化渲染保证超大 diff 依然高效
- diff 数据(dsh 0.1.2+ 契约):Host 的
presentCall/presentResult视图不再进入 Client,diff 卡完全从原始事件字段派生——running 用参数推导的调用时 diff(edit 的 old_string→new_string、write 的整文件内容),settled 用tool/result落盘的meta.diffs(应用后的 hunks,即行号所在的通道);执行错误走官方行的错误摘要 + IN/OUT 卡 - 嵌套兜底:Code Dispatch 子调用(PTC 模式)的 meta 恒缺失(同上),插件回退到参数的调用时 diff——与官方行渲染同一调用的 running 态一致
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
theBigGavin/marketingdashboard
hancao97/hanai-investment-dsh
maddogfinance/dsh-trading
TencentCloud/tencentcloud-agentobs-sdk-dsh