DeepSeek Harness plugin

dsh-code-diff-viewer

Collapsible before/after code-diff cards for edit/write tool calls in DeepSeek Harness (dsh), with absolute line numbers. Pure visual, injected into the conversation flow.

Jump to install

Source facts

Repository
kelai141/dsh-code-diff-viewer
Latest update
Aug 18, 2026
Category
Tools & Capabilities
GitHub stars
2
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/kelai141/dsh-code-diff-viewer
Plugin: dsh-code-diff-viewer
Author: kelai141

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

dsh-code-diff-viewer

让 DeepSeek Harness(dsh)Web 界面的 edit / write 工具调用,以可折叠的「修改前 / 修改后」左右对照代码面板呈现——带语法高亮、绝对行号、变更行红/绿底色,纯视觉注入对话流,不新建模式、不落盘任何文件。

> 母仓库声明:本项目是 DeepSeek Harnessdsh@deepseek-ai/dsh)的第三方插件,通过 dsh 的 profile bundle 机制(dsh.bundle.patch + dsh.client 双面插件)扩展其 Web 界面,并非 dsh 官方组件。

特性

  • 左右对照:同时有增有删 → 双列「修改前 / 修改后」;纯新增 → 单列绿色「新增」;纯删除 → 单列红色「删除」
  • 绝对行号:原厂 diff hunk 自带 3 行上下文,本插件通过 Host 端 /cdv-locate 读取文件反推每个 hunk 在文件中的真实起始行,文件中部(如第 20~30 行)的修改也能精确定位
  • 语法高亮:内置轻量分词器(JS/TS、Python、CSS、HTML、Shell、JSON、YAML 等),关键字蓝、字符串绿、数字浅蓝、类型紫、属性白
  • 可折叠:点击卡片头部展开/收起;最新一次修改自动展开,旧卡片保持收起
  • 纯视觉:只注册 tool.call.toolview 槽位的 edit / write 键,替换原厂卡片;Host 半仅提供一个只读定位接口
  • 进程级自动启用:作为静态 bundle 层挂载,dsh 启动即生效,无需审批

效果示意

▸ Edit · src/config.ts                    [+11 −11]  完成
  ┌───────────────┬─────────────────────┐
  │ 修改前        │ 修改后              │
  │ 17  const c…  │ 17  const c…        │
  │ 20− key20…    │ 20+ key20-updated…  │
  │ 21− key21…    │ 21+ key21-updated…  │
  │ …             │ …                   │
  └───────────────┴─────────────────────┘

安装

要求:已安装 DeepSeek Harnessdsh CLI)与 pnpm,使用 web profile。

方式一:从 GitHub 安装(推荐)

dsh plugin --profile web add github:kelai141/dsh-code-diff-viewer
# 或
dsh plugin --profile web add https://github.com/kelai141/dsh-code-diff-viewer.git

dsh plugin 会执行 pnpm 安装,并自动把 dsh-code-diff-viewer 加入 profile 的 dsh.profile.bundles 层(包内的 cordis.patch.yml 声明了组合行 code-diff-viewer)。

> git 托管的插件若被 pnpm 拦截构建脚本(本项目无构建脚本,一般不会触发),按 pnpm 提示在 profiles/web/pnpm-workspace.yamlallowBuilds 中加入对应 key 后重试。

方式二:本地开发 / 源码安装

git clone https://github.com/kelai141/dsh-code-diff-viewer.git
dsh plugin --profile web add file:D:/coding/dsh-code-diff-viewer   # 改成你的实际路径

方式三:手动补丁(不经过 pnpm)

把包放到任意可被 profile 解析的位置(例如 profiles/web/node_modules/dsh-code-diff-viewer),然后在 profile 的用户补丁 profiles/web/cordis.patch.yml 中追加:

- insert:
    - id: code-diff-viewer
      name: 'dsh-code-diff-viewer'

并在 profiles/web/package.jsondsh.profile.bundles 中加入 dsh-code-diff-viewer

启用

安装后重启 dsh web 进程(组合行在启动时加载,无热更新):

# 停止旧的 web 进程后
dsh web

刷新浏览器后即可生效:对话流中所有 edit / write 工具卡片都会渲染为可折叠的对照面板。无需任何授权/审批(静态组合行是受信代码)。

验证

  • 组合树包含新行:dsh --profile web --dump-config | grep code-diff-viewer
  • 客户端包可访问:http://127.0.0.1:3080/plugins/dsh-code-diff-viewer/client.js
  • 定位接口(Host):POST /cdv-locate,请求体 { "path": "<文件绝对路径>", "needle": "<hunk newText>" },返回 { "start": <1-based 起始行> | null }

卸载

dsh plugin --profile web remove dsh-code-diff-viewer

重启 dsh web 后界面恢复原厂卡片。

工作原理

1. dsh 的 edit / write 工具在结果中携带真实 diff hunk(oldText / newText,jsdiff structuredPatch(context: 3),每个 hunk 带 3 行上下文) 2. 客户端插件读取工具调用块(ToolCallBlock)的 callView / resultView,取 card: 'diff'diffs 3. 行级 LCS 对齐两侧内容,纯增/纯删/混合自动选择单列或双列 4. 通过 Host 半的 /cdv-locate 在磁盘文件(修改后状态)中反推 hunk 绝对起始行,渲染真实行号 5. 轻量正则分词器做语法高亮;卡片头部可折叠,最新调用自动展开

仓库结构

dsh-code-diff-viewer/
├── cordis.patch.yml     # bundle 层补丁:insert 组合行
├── package.json         # 双面插件声明(dsh.bundle.patch / dsh.client)
└── lib/
    ├── index.js         # Host 半:POST /cdv-locate 只读定位服务
    └── client.js        # Client 半:__ModuleLoader__ 浏览器包(编辑/写入工具卡片)

兼容性

  • dsh(DeepSeek Harness)web profile,Node.js ≥ 22
  • 无第三方运行时依赖;客户端仅依赖 dsh 自带的 react seed 模块与 slots 服务

License

[MIT](./LICENSE) © 2026 kelai141

第三方项目声明:DeepSeek Harness(deepseek-harness)是其开发者们的作品,本项目仅作为其生态插件独立开源,与官方无隶属关系。