HuanLinOTO/dsh-plugin-merge-tool-calls 预览 preview

HuanLinOTO/dsh-plugin-merge-tool-calls

将 WebUI 会话流中连续相邻的同工具调用合并为「主卡片+紧凑子行」树状展示,默认覆盖所有内置通用行工具

Project Overview项目介绍

This is a native plugin built exclusively for DeepSeek Harness (DSH). It changes how tool calls are displayed in the DSH WebUI by merging consecutive adjacent calls of the same tool or tool family into a single tree view with a main card and compact child rows. It reduces the vertical space occupied by multiple tool cards when you repeatedly read files, search the web, edit code, or run shell commands. It covers all of DSH’s built-in general-purpose tools by default, and lets users configure a custom whitelist of tools to merge if they want more control.

After merging, the main card only shows the tool name and a summary of how many calls are included. All specific call details, like file paths for read calls, are moved to child rows that are collapsed by default. Clicking the main card toggles the expansion and collapse of all child rows with a smooth animation, and single unmerged calls retain their original display behavior. This plugin only modifies the presentation layer, so it does not change session logs, model-visible data, or detail panels, and the merged output is always consistent for a given chat snapshot when you replay the conversation.

Users can install this plugin directly via the DSH CLI from any DSH profile, with two supported distribution channels: GitHub source and the public npm registry. After installation, you need to restart the DSH web process and hard refresh your browser with Ctrl+Shift+R for the plugin to take effect. The plugin requires a browser that supports the :has() CSS selector, which includes Chrome 105+, Safari 15.4+, and Firefox 121+. Older browsers that do not support this feature will automatically fall back to normal spacing, so no broken interface will occur.

这是一个专为 DeepSeek Harness (DSH) 开发的原生插件,功能是将 WebUI 会话流中连续相邻的同工具调用合并为「主卡片 + 紧凑子行」的树状展示,减少连续读文件、搜索、编辑或执行命令时多条工具卡片对流式界面的占据。插件默认覆盖所有 DSH 内置通用行工具,同时也支持用户自定义配置需要合并的工具白名单,灵活适配不同使用需求。

合并后主卡片只显示工具名和调用数量摘要,具体调用路径信息都下沉到默认折叠的子行,点击主卡片即可展开或收起所有子行,单次未合并的调用保持原有显示行为不改变。插件仅做展示层的合并,不会影响会话日志、模型可见数据和详情面板,合并结果完全由聊天快照决定,回放结果稳定可预期。

用户可通过 DSH CLI 直接安装该插件,支持从 GitHub 源码或 npm registry 两种分发渠道安装,安装后需要重启 DSH Web 进程并硬刷新浏览器生效。插件要求浏览器支持 :has() 选择器(Chrome 105+/Safari 15.4+/Firefox 121+),不支持的浏览器会自动退化为正常行间距,不会造成界面异常。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 2 warnings2 项注意
  • No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
  • Only 7 stars - very few users, little community feedback星标只有 7,几乎没人在用,遇到问题缺少社区反馈
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 "@huanlin/dsh-plugin-merge-tool-calls"

把 HuanLinOTO/dsh-plugin-merge-tool-calls 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-plugin-merge-tool-calls card

dsh-plugin-merge-tool-calls

把 WebUI 会话流中连续相邻的同工具调用合并为一个「主卡片 + 紧凑子行」的树状展示,减少连续读文件/搜索/编辑/执行命令时多条卡片对流的占据。默认覆盖所有内置通用行工具(read/grep/glob/edit/write/bash/pwsh/web_search/web_fetch/run_code),也可配置白名单。

合并前:                         合并后:
[Read] foo ▸ 内容                 [Read] · 3 Files  ▸(点击展开子行)
[Read] bar ▸ 内容                   └ foo(子行,点击展开 foo 的内容)
[Read] baz ▸ 内容                   └ bar(子行,点击展开 bar 的内容)
                                    └ baz(子行,点击展开 baz 的内容)

主行只显示数量摘要(Read · 3 Files),具体文件路径全部下沉到子行;子行默认折叠,点击主行以动画展开/收起。单次调用(无合并)保持原行为(主行直接显示路径并展开内容)。

纯展示层合并:会话日志、模型可见数据、详情面板均不受影响;回放确定(合并结果是聊天快照的纯函数)。

工作原理

  • 通过 keyed slot tool.call.toolview 的 shadow 机制(priority: -1,最低者渲染)接管工具的卡片;tools: [] 时接管全部内置通用行工具(见 src/client/tool-names.ts),非空列表为显式白名单(任意 wire 名均可)。
  • 组件经 useChat 读取聊天快照,在 order + node store 中按 call id 定位自身节点,前后扫描连续调用,按 maxGroupSize 分组。一组只合并同名或同家族调用:同名必合;已知家族(grep+glob、bash+pwsh、read+web_fetch)跨名合;未知工具名(variant others)仅与自身合,不相关的工具不会混进同一张卡。
  • 组首座位渲染合并卡片;组内其余座位渲染 null,由注入的样式规则 [data-chat-flow-kind="tool-call"]:has([data-slot="tool.call.toolview"]:empty) { display: none; } 将其从流中收起(与内置 .flowItem:empty 语义一致;渲染器为每个 toolview 包一层 data-slot 容器,故以该容器判空)。
  • 主卡片镜像内置 ToolRow 的行面:按 variant 渲染标题/图标(Read/Search/Bash/Write/Edit/Code/Tool call,工具自定义标题如 Pwsh/Inspect 优先)。合并组的主行摘要改为数量(Read · 5 Files / Search · 3 Queries / Bash · 4 Commands 等,按 variant 选名词),不再显示首个调用的路径;单次调用(无合并)仍显示 args 摘要(读→路径、搜索→query、bash→description/command、未知工具带 工具名 · 前缀),read/write/edit 单行的摘要是可点击文件链接。行状态、错误首行、bash 失败退出码转红点均与内置一致。
  • 子行紧凑(20px 高),结构为主行的尾部(sep 点 + 路径)。合并组内所有调用(含首个)均渲染为子行,所以每个文件路径都在子行上。对齐运行时自动测量:组件挂载后量取主行 sep 点相对卡片的偏移(并用 ResizeObserver 跟随字体/布局变化),以 --mtc-sep-left 自定义属性设置子行缩进——sep 点与主行 sep 点同列、路径与主行摘要同列,不依赖任何手工字体宽度常量,任意工具名均自动对齐。展开的子行卡片以负向 calc 抵消该缩进,左边缘与主卡片内容区对齐(占满卡片宽度,左侧不留白)。无可展开内容(如运行中的 read)的子行渲染为静态行。
  • 子行默认折叠:主行点击展开时,子行块以 grid-template-rows: 0fr → 1fr + 透明度过渡动画滑出(200ms),收起时反向滑回;折叠期间子行仍在 DOM 中(grid 0fr + overflow: hidden 收起,不卸载),所以动画平滑无闪烁。每个子行仍可独立点击展开其内容卡片。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-split-panes 下一个 Next dsh-aemeath-pet →