dsh-mcp-diff

DSH PLUGIN开发与运行时

仓库 Fakek0f3sT/dsh-mcp-diff · npm dsh-mcp-diff

开发与运行时 L5 · 运行验证通过 安全审查:低风险 可信度:金 可安装插件
安装这个插件

把网页对话里的每次文件改动渲染成一张折叠的 diff 卡片并逐行高亮,涵盖 MCP filesystem 的 edit_file/write_file 与内置的 edit/write。

验证等级 L5 L5 · 运行验证通过
GitHub 星标 4 复刻 0 · 未关闭 issue 0
最近更新 2026-09-17 创建于 2026-08-27
README 6.8 KB 正文体量,越大说明说明书写得越细

安装

可安装插件
在 DSH 里执行,装完用 dsh plugin list 确认已挂上;标了 L4 / L5 的命令已在沙盒里真实跑通
dsh plugin --profile web add [email protected]
兼容 DSH 版本0.2.0-rc.2 等 11 个版本版本不匹配时安装会报错
Node.js 要求^22.19.0 || >=24.0.0来自仓库 package.json 的 engines 字段
前置依赖@deepseek-ai/cordis@^4.0.1需要同时安装的同级依赖
npm 包名dsh-mcp-diff可用 npm view 查看包信息

能做什么

开发与运行时
字段来自项目仓库与公开索引,中文说明由本站标注

适用场景

代码评审文件读写联网搜索

上游标签

deepseek-harnessdiffdshdsh-pluginmcpplugin

验证等级与安全审查

L5 · 运行验证通过
自动化流程结论,不是人工审核
验证等级L5 · 运行验证通过在 dsh 沙盒中完成安装与运行冒烟——装得上、跑得起来
安全审查低风险静态分析结论,未标注不代表已通过审查
仓库健康度稳定按仓库活跃度与最近更新时间给出
可信度金综合仓库活跃度与验证结果

上面的结论来自上游最近一次自动化验证(2026-10-08): 同一套检查会在插件发新版后重跑,页面显示的是最新一次的逐项结果。

逐项检查结果

L1 · 已找到 ✓ 通过
  • L1.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L2 · 结构化 ✓ 通过
  • L2.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L3 · 安装规范 ✓ 通过
  • L3.1_INSTALL_COMMAND_PARSED 安装命令已解析 方式:安装规范解析
  • L3.2_DSH_VERSION_DECLARED DSH 版本已声明 方式:DSH 版本声明
L4 · 安装已测 ✓ 通过
  • L4.1_INSTALL_EXECUTED_CONFINED 受限沙盒内执行安装 方式:沙盒安装执行
  • L4.2_INSTALL_SUCCESS 沙盒安装成功 方式:沙盒安装执行
  • L4.3_ARTIFACT_CONFIRMED 安装产物已确认 方式:沙盒安装执行
L5 · 运行已测 ✓ 通过
  • L5.1_INSTALL_PASSED_SANDBOXED 沙盒安装通过 方式:沙盒安装执行
  • L5.2_WEB_BOOT_READY Web 启动就绪 方式:Web 启动
  • L5.3_HTTP_SERVED HTTP 服务响应 方式:HTTP 请求
  • L5.4_PLUGIN_INVENTORY_ACTIVE 插件清单中已激活 方式:插件清单查询

风险详情

  • 审查结论 通过
  • 结论说明 vet 静态分析未发现可疑行为,判定为干净(clean)。
  • 风险计数 严重 0 / 高 0 / 中 0
  • 风险详情 未发现严重或警告级问题。

仓库档案

开发与运行时
字段来自项目仓库与公开索引,中文说明由本站标注
作者 / 维护方Fakek0f3sT仓库 dsh-mcp-diff · 默认分支 main
分类开发与运行时dev
收录类型可安装插件声明了 dsh.bundle、可用 dsh plugin add 安装的条目
开发语言未标注仓库主语言
许可证MIT商用或二次分发前请确认条款原文
星标 / 复刻 / issue4 / 0 / 0收录时的数值,非实时
创建 / 更新2026-08-27 · 2026-09-17最后推送 2026-09-02
本站收录2026-10-14首次进入本站目录的时间

README 全文

6.8 KB
作者原文,中文版优先;只做安全转义,不改内容

dsh-mcp-diff

A client plugin for the DeepSeek Harness (Web GUI) that turns every file
mutation it can confidently parse into a uniform diff card in the chat —
collapsed by default, with per-line highlighting (green for additions, red for
deletions).

Covers the filesystem MCP server (edit_file / write_file / move_file /
create_directory),
the built-in DSH tools (edit / write), and recognizable file-mutating
bash commands — one look for all of them. Bash shapes the parser cannot
confidently identify (chmod, ln, rsync, dd, git state changes, …)
keep the plain terminal card: a missed card beats a wrong one.

Why

By default DSH draws a diff only for its own file tools (edit, write), with
its own renderer. When the agent edits files through the
@modelcontextprotocol/server-filesystem MCP server, the call is named
mcp__filesystem__edit_file / mcp__filesystem__write_file — there is no
registered toolview for it, so the chat shows only a generic block with no diff.

The plugin:

  • registers a toolview under the MCP keys and builds the diff from the server
    response (a ready unified diff with context and @@ headers) or from the call
    arguments when there is no response yet (write_file, a still-running
    edit_file);
  • also overrides the built-in edit / write, unifying their contextual hunks
    (a per-line LCS: shared lines read as neutral context instead of being
    doubled);
  • renders move_file and create_directory as compact informational cards —
    source → destination, the created path, both workspace-relative — since
    they carry no diff lines;
  • makes every card's path openable: a click hands it to the host's file
    opener (the same channel the native tool rows use), which resolves it
    against the session workspace and opens the file in your IDE/editor;
  • renders everything as one card built on a native ` — **collapsed by default**, the header shows the path ++N -M`, and it expands on click.

Bash edit cards

When the agent edits files through bash instead of a file tool (a python3 -
heredoc with old/new blocks, sed -i, cat > file <<EOF, tee,
> file redirects), DSH shows a plain terminal block and tracks no "files
touched" — so the plugin owns the bash toolview and adds a card only for
commands it can confidently parse as line mutations
:

  • replace — a heredoc script that reads a file, .replace()s old/new
    triple-quoted blocks and writes it back: the card shows the file, real
    del/add lines and +N -M derived from those blocks;
  • write — cat > f < f / >> f: the
    path always, the added lines when the content is spelled out in the command;
  • in-place — sed -i / perl -pi with explicit file tokens: the path only;
  • path ops — mkdir, mv, cp, rm, touch with literal path
    arguments: an informational card naming the operation and its paths (no diff
    lines exist for these). Anything non-literal — $VAR, globs, cd
    chaining — keeps the plain terminal card.

Every other bash call (ls, git status, builds, grep…) keeps a plain
terminal-like card — it is never turned into a diff. Such a card gains a small
warning chip when the command matches an unambiguous destructive signature
(rm -rf, chmod 777, git reset --hard, git checkout ., git clean -f,
curl … | sh, mkfs, dd of=, shred) — an annotation of the command text,
never a mutation claim.

The card is marked bash edit and carries a footnote: intended change
parsed from the bash command — not an edit/MCP tool result
. The client sees
only the command text and its output (no filesystem access), so the diff is
what the script claims to do, with the full command and the output tail
one click away. Dynamic paths ($VAR, globs) and unsupported shapes are left
unrendered on purpose: a missed card is better than a wrong one.

Open file links

Every path a card shows — the diff header, a move_file destination, the
paths of a bash mutation — is a link: clicking it calls the host's file
opener (openFile), the same channel the native tool rows use. The host
resolves the path against the session workspace (bash paths against the
command's own working directory) and opens the file in your IDE/editor.
A path without a workspace context (an unusual host setup) stays plain text,
and so does any path that would resolve outside the session workspace —
an absolute or ~ target parsed out of a bash command, .. traversal, a
bash call working outside the workspace. Rendered content never triggers an
open of an arbitrary host file.

Install

# from npm (prebuilt, recommended)
dsh plugin --profile web add dsh-mcp-diff

# or from GitHub (built on install)
dsh plugin --profile web add github:Fakek0f3sT/dsh-mcp-diff

dsh plugin add is a pnpm forwarder: it adds the package to your profile
(~/.dsh/profiles/web) and, since the plugin declares dsh.bundle,
automatically includes it in dsh.profile.bundles — nothing to wire by hand.
Installed from GitHub, lib/ is built in place (the prepare script); from npm
it ships prebuilt.

Important: DSH picks up its plugin set only at startup — after installing,
restart dsh web and refresh the GUI page.

Check that the bundle is served:

curl -s http://127.0.0.1:3080/plugins/dsh-mcp-diff/client.js | head -c 80

Manually from a clone

git clone https://github.com/Fakek0f3sT/dsh-mcp-diff.git
cd dsh-mcp-diff && npm install && npm run build
cd ~/.dsh/profiles/web
npm install /path/to/dsh-mcp-diff
{
"dependencies": { "dsh-mcp-diff": "link:./node_modules/dsh-mcp-diff" },
"dsh": { "profile": { "bundles": [ "…", "dsh-mcp-diff" ] } }
}

Configuring for another MCP server

The toolview keys are set for the server name filesystem. If your filesystem
MCP server is named differently (the serverName field in the config), edit the
key constants in src/client/index.tsx (MCP_TOOL_KEYS, MCP_MOVE_FILE_KEY,
MCP_CREATE_DIR_KEY — keys of the form mcp____…). The edit / write keys live there
too — remove them if you do not want to override the built-in renderer.

Development

npm install
npm run build
npm run test   # the self-checks (bash-mutation, diff, path-containment) via tsx

Compatibility

Tested on DSH 0.1.1-rc.2. The plugin imports only platform modules (react,
ui-primitives, ui-slots, runtime/client) — ui-tool internals are not imported.

License

MIT

常见问题

7 问
答案由本站依据条目字段整理,不引用上游原文
dsh-mcp-diff 怎么安装?

在 DSH 里执行 `dsh plugin --profile web add [email protected]` 即可。对应的 npm 包名是 `dsh-mcp-diff`。

dsh-mcp-diff 的验证等级是什么意思?

L5 · 运行验证通过。在 dsh 沙盒中完成安装与运行冒烟——装得上、跑得起来

dsh-mcp-diff 安全吗?

低风险。vet 静态分析未发现可疑行为,判定为干净(clean)。

dsh-mcp-diff 支持哪些 DSH 版本?

上游记录的兼容版本包括 0.2.0-rc.2、0.2.0-rc.1、0.1.7-rc.2、0.1.7-rc.1、0.1.6-alpha.2、0.1.6-alpha.1、0.1.5-rc.2、0.1.3-alpha.2。版本较多,只列出前 8 个。

dsh-mcp-diff 需要什么运行环境?

Node.js ^22.19.0 || >=24.0.0;需要同时安装 @deepseek-ai/cordis@^4.0.1。环境不满足时安装会失败,建议先确认本机版本。

dsh-mcp-diff 用的是什么许可证?

上游标注为 MIT。商用或二次分发前请到仓库确认许可证原文。

这条记录的数据可靠吗?

本站按仓库名去重后合并整理,字段以作者仓库与 npm 元数据为准;安装命令、仓库地址与 README 保持原文,带 L4 / L5 标记的安装命令已在隔离沙盒里真实跑通。

开发与运行时
按星标排序,可作替代方案

rea

rea

L4 · 沙盒安装通过 2.6 万 星

dsh-TUI

dsh-TUI

Claude Code 风格全屏终端 UI:像素鲸鱼顶栏、实时工作状态行、思考流式展开。

L4 · 沙盒安装通过 4,292 星

mirage

mirage

把文件系统与 bash 提供者换成 mirage 虚拟工作区:文件工具与 shell 命令作用于挂载的资源(RAM、S3、Redis、Sla

L3 · 安装规范通过 3,681 星

dashi-taskboard

dashi-taskboard

把当前已安装并运行中的 Codex Taskboard 嵌入 DeepSeek Harness 侧边栏,并通过 Launcher 运行时描述

L4 · 沙盒安装通过 3,311 星

插件的元信息来自作者仓库;分类、验证等级与安全结论的中文说明为中文整理,最近核验 2026-10-08。