omdsh-dev/dsh-tool-stat 预览 preview

omdsh-dev/dsh-tool-stat

Plugin插件 Native原生 ⭐ 6 MIT Data & Analysis数据与分析

DSH 统计工具插件:描述统计/百分位数/频数分布/相关性,零依赖纯函数确定性

Project Overview项目介绍

This is a native tool plugin built exclusively for DeepSeek Harness (DSH), designed to provide reliable statistical computing capabilities for AI agents working with numerical data. It supports four core types of calculation: descriptive statistics, percentile queries, frequency distribution, and correlation coefficient calculation. All core algorithms are implemented from scratch, with zero third-party dependencies, and it produces fully deterministic output: the same input will always return the same result, with no randomness or side effects. To install it, you can run the DSH plugin command directly to pull from the public GitHub repository, and it works with both web and headless DSH profiles.

This tool is designed for DSH users who need to analyze numerical data extracted from sources like CSV or JSON. The typical workflow is straightforward: after an AI agent extracts numerical arrays from raw data, it calls this stat tool with the required calculation action and valid input parameters. The tool returns a structured JSON result that the agent can use for further reasoning and analysis. This removes the need for the AI model to compute statistics directly, which eliminates calculation errors and produces fully reproducible results that you can inspect and verify.

The plugin is released under the open source MIT license, and it enforces strict constraints on input and output to guarantee numerical stability and correctness. It rejects non-finite values like NaN or Infinity with clear error messages that indicate the position of the bad input. It supports up to 100,000 observations, a maximum of 100 percentile requests per call, and truncates distinct frequency output to 10,000 entries to avoid performance issues. After installation, you can verify the plugin is working correctly by running a simple test command with DSH to compute descriptive statistics for a sample input array.

这是一款专为DeepSeek Harness(DSH)开发的原生统计工具插件,提供描述统计、百分位数计算、频数分布分析、相关系数计算四大核心能力,零依赖、纯函数实现,输出结果完全确定可复现。它解决了现有DSH工具无法完成数值聚合分析的痛点,在Agent从CSV/JSON提取出数值数组后,可一次性完成统计计算,毫秒级返回结构化JSON报告。

本工具面向需要在DSH Agent工作流中处理数值数据的开发者和分析人员,典型工作流为:当Agent从源数据提取出一组或多组数值观测后,调用本工具指定计算动作(如描述统计、相关性分析)并传入参数,即可获得符合规范的结构化统计结果,供Agent进行后续分析判断,避免模型直接心算带来的错误和不可复现问题。

本插件采用MIT许可协议,所有统计算法均手写实现,无第三方数值库依赖,对输入输出有严格的数值约束,最大支持10万条观测值,最多可请求100个百分位数,频数分布不同值输出截断为1万条。可通过DSH官方插件命令直接从GitHub仓库安装,支持web和headless两种DSH profile,安装后可立即通过工具调用验证可用性。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 6 stars - very few users, little community feedback星标只有 6,几乎没人在用,遇到问题缺少社区反馈
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:omdsh-dev/dsh-tool-stat

把 omdsh-dev/dsh-tool-stat 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-tool-stat

English

DSH 统计工具插件 —— 描述统计、百分位数、频数分布、相关性计算。零依赖、纯函数、确定性。

License

动机

Agent 处理数值数据时,从 CSV / JSON 提取出数值数组后往往需要聚合分析(均值、分位数、分布、相关性)。现有工具链没有这类能力:

  1. calculator 只做单表达式求值——一个表达式算不出分位数分布,更算不了相关系数
  2. dsh-tool-csv 的 stats 只报告行/列结构——不提供对一组观测值的统计聚合
  3. 模型"心算"统计不可验证——均值、方差、百分位、相关性涉及大量浮点运算,手算错误率极高,且无法给用户展示可复现的过程

本插件接收显式传入的有限数值数组或成对观测值,提供确定性的统计计算:一次函数调用,毫秒级返回结构化 JSON 报告。不读取文件、不访问网络、不创建进程、不保存状态——相同输入永远得到相同输出。

安全模型

  • 零依赖:Neumaier 补偿求和、Welford 在线方差、线性插值百分位、Spearman midrank 全部手写,无第三方数值库
  • 有限数强约束:拒绝 NaN / Infinity(错误信息带下标定位,如 values[3] must be a finite number (got Infinity));-0 在输入与输出中均规范化为 0
  • 溢出回检:所有结果在返回前再次做有限数检查,中间或最终结果溢出返回 numeric-overflow 错误——canonical 输出绝不含非有限值
  • 纯函数:输入数组永不被修改(只读遍历;需要排序时先拷贝)
  • 零方差语义:correlation 遇零方差配对返回 defined: false + reason: "zero-variance",而不是 NaN 或 ±Infinity
  • 预算:
    • 观测值 1..100,000(超限直接报错)
    • 百分位请求 ≤ 100 个
    • distinct 输出 ≤ 10,000(超出按确定规则截断并标注)
    • timeoutMs: 2000
  • 工具参数会记入会话日志,不要传入敏感数据

工具声明

注册 stat 工具(@deepseek-ai/dsh-tool-stat,row id tool-stat),统一输出 JSON 文本字符串。

action 作用 输出
describe 描述统计 count / sum / min / max / mean / median / variance / standardDeviation / q1 / q3 / iqr(Neumaier 补偿求和 + Welford 方差,population 或 sample)
percentile 百分位数 一个或多个百分位(线性插值 h=(n-1)*p,0..100),输出按请求顺序、重复保留
frequency 频数分布 value / count / ratio 分组(严格相等分组、升序输出、ratio 分母为原始计数)
correlation 相关系数 Pearson 或 Spearman(midrank 平均秩)相关系数;零方差返回 defined:false + reason
参数 类型 必填 说明
action string ✅ describe / percentile / frequency / correlation
values array ✅ 有限数值观测(1..100,000);-0 归一化为 0
other array correlation 的配对观测;长度须与 values 相同(≥2)
percentiles array percentile 的百分位(0..100,1..100 项)
method string 相关系数方法:pearson(默认)/ spearman
sample boolean 方差分母:true 用样本(n-1),默认 false(总体 n)

输出示例

{"action":"describe","count":5,"sum":15,"min":1,"max":5,"mean":3,"median":3,"variance":2,
 "standardDeviation":1.4142135623730951,"q1":2,"q3":4,"iqr":2,"sample":false}

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-animation-optimization 下一个 Next dsh-docking-layout →