进程内工具调用统计:提供 `tool_stats` 工具,按工具汇报调用次数、失败次数与平均耗时。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:disyli/dsh-tool-call-stats
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
A tiny community plugin for DeepSeek Harness (dsh).
It records every committed tool call in the current harness process and exposes a tool_stats tool, so the model (or you) can ask at any point:
Which tools were used, how often did they fail, and where did the time go?
Not to be confused with the token/cost trackers in the ecosystem (dsh-token-stats, dsh-usage-report, ...) — this plugin counts tool-call dispatches, not tokens. Also unrelated to dsh-tool-stat (a descriptive-statistics math tool).
Status: built and verified end-to-end against the dsh v0.1 developer preview (headless profile, live DeepSeek session): both event listeners record real dispatches and
tool_statsreturns the table below. Upstream interfaces may still change during the preview.
Example output (from the verification run):
tool calls errors avg_ms
---- ----- ------ ------
bash 1 0 23
read 1 0 8
How it works
Everything in dsh is a plugin, and this one is deliberately minimal — three seams, ~100 lines, no build step:
tools/execute(waterfall): wraps each dispatch to record its start time, then delegates vianext().tools/result(observer): counts each committed result per tool name and accumulates duration;result.isErrordrives the error counter.ctx.tools.register(defineTool(...)): exposestool_stats, which returns a canonical JSON array (output.schema) and renders a plain-text table for the model.
All state is in-memory and process-local. Nothing is persisted; restarting dsh resets the counters. When the plugin is unloaded, Cordis disposes both listeners and the tool automatically — no manual cleanup code.
Install
Into a profile (recommended)
dsh plugin --profile <name> add github:disyli/dsh-tool-call-stats
pnpm ≥ 10 will ask you to allow the package before running install scripts (this package has none, but the prompt may still gate the git install). Follow the hint dsh prints, then re-run add.
Verify the layer and start:
dsh --profile <name> --dump-config # shows a "# == dsh-tool-call-stats" layer
dsh --profile <name>
As a local overlay (source checkout)
From a deepseek-harness checkout, point a patch at the local file:
# stats.cordis.yml
- insert:
- id: tool-stats
name: '/absolute/path/to/dsh-tool-call-stats/index.js'
pnpm dsh web --patch ./stats.cordis.yml
Use
Ask the agent things like:
- "Use tool_stats to show tool usage so far."
- "Which tool failed the most in this session?"
Limitations
- Process-local only: counters reset on restart and are not shared across sessions.
- Calls aborted before the registry commits a result are not counted (their timing entries are garbage-collected after 10 s).
- Built against the dsh v0.1 developer preview; upstream interfaces may change ("THERE WILL BE COMPATIBILITY-BREAKING CHANGES").
License
MIT
链接
同类插件
yjh051108/dsh-routing-suite★ 7000
一个仓库三件套:DSH 插件包的运行时注入器(注入、热重载、卸载、开发侧挂区一键转正、路由自愈,外带设置页插件管理:列出、卸载、拖入文件夹内化)、任务感知的思维模式路由 agent 预设(router-standard / router-spec / router-react)、以及分级两级任务协议(commit_star / lock_stage / revise_do / edit_plan / mark_task / redteam_verdict 六个工具,任务状态落盘)。注入器实现直接在库内,安装的是它自己的行为而不是一份依赖清单。
strukto-ai/mirage#dsh★ 3663
把文件系统与 bash 提供者换成 mirage 虚拟工作区:文件工具与 shell 命令作用于挂载的资源(RAM、S3、Redis、Slack、Gmail、Notion、Postgres)而非宿主磁盘,支持按挂载点设置读/写/执行模式、按命令选择沙箱(进程内 monty、pyodide、quickjs;远程 docker、e2b、daytona),并可在虚拟终端中安装 CLI(git、gh、slack、linear、ntn、gws,或自行注册的程序树)作为命令头词。
hust-open-atom-club/oh-dsh★ 325
社区发行版:TUI、桌面端与 Web UI 统一体验,分层安装、一步到位。
weijiafu14/pi2dsh★ 206
Pi Host ABI 兼容引擎:装一次之后,npm 上的 Pi 扩展原包经 `dsh plugin add <pi-package>` 直接作为 DSH 原生插件挂载。已在官方 DSH 上端到端验证 pi-mcp-adapter(完整 MCP 管理面:OAuth、resources、prompts、MCP Apps、elicitation、sampling)、@tintinweb/pi-subagents、pi-code、pi-hermes-memory、pi-background-tasks;`pi2dsh inspect` 在安装前报告一个包的兼容情况。
lire1131/dsh-undo-savepoint★ 165
DSH 撤销/回退系统:配置变更自动存档,一键撤销/恢复/回退到任意版本,支持 WebUI 与离线 CLI/GUI 工具(DSH 启动失败也能救)。
Fishquito7/dsh-skill-mcp-panel★ 152
在 DSH Web 设置中管理技能与 MCP 服务器:技能卡片热启停、工作区作用域、分组、批量迁移与拖拽导入,以及 stdio/HTTP MCP 增删改查、连接测试、密钥脱敏,并附带统一 dsh-panel 命令行。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。