npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ponydev/dsh-system-hud

v0.2.2

Published

DSH Web 插件:对话顶栏 / 输入框底部 / 侧栏底部显示本机 CPU、内存、磁盘、网络、I/O、温度,点开右侧「系统」详情

Readme

dsh-system-hud

npm license

DeepSeek Harness(DSH)Web UI 插件:把本机硬件状态放进界面里三个原生位置。

  • ① 对话顶栏入口:两个小环 + 温度,和「会话日志 / 更多 / 账号」同一行;点一下打开右侧「系统」详情
  • ② 输入框底部:和 轮次 · tok/s、token · 缓存命中、上下文环同一行,追加一个原生风格 pill
  • ③ 侧边栏底部:240px 卡片(CPU / 内存 / 磁盘 三个环 + 网络、IO、温度),在「每月限额」和「更多」之间
  • ④ 右侧「系统」详情:原生 tab,每核占用、内存/磁盘明细、60s 网络、温度、Top 进程
  • 设置 → 系统 HUD:三处位置逐个开关、指标开关与排序、拿不到的数据怎么显示、采样周期、阈值

只用真实数据:CPU 走进程内 os.cpus() 差分,内存/磁盘/网络/IO 走系统命令;macOS 上拿不到温度时按设置策略处理(默认隐藏,绝不填 0)。

三个位置

设置 → 系统 HUD

截图由离线 harness scripts/render-test.mjs 用假数据(Example Mac / Apple M2 Pro)生成:npm run test-ui;来源登记见 docs/screenshots/MANIFEST.md。不要提交真机 / 真实账户截图。

安装

要求 DSH >=0.2.0-rc.2 <0.3.0。

# CLI
dsh plugin --profile web add @ponydev/dsh-system-hud

# 或在 Web「插件」页搜索安装

安装后重启宿主(launchctl kickstart -k gui/$(id -u)/local.deepseek-harness.web)并刷新页面。

本地开发:

dsh plugin --profile web add link:/path/to/dsh-system-hud

设置页(对齐其他插件)

设置 → 系统 HUD 顶部与其他插件一致:

  • 标题图标 + 版本号(v0.1.2)
  • GitHub(仓库)、问题反馈(Issues)、检查更新(查 npm 最新版,本地 link: 安装时显示「尚未发布到 npm」)
  • 控件全部用 DSH primitives(Button / Switch / SegmentedTabs / Modal),颜色只用 --dsw-* token

右侧面板

面板的布局/字号/状态/响应式规范见 docs/PANEL-DESIGN.md,设计规范见 docs/PANEL-DESIGN.md(效果图已移除,恢复时须用假数据重新生成)。

功能特性

| 指标 | macOS | Linux | 数据来源 | |---|---|---|---| | CPU 使用率 / 每核 / 负载 | ✅ | ✅ | 进程内差分,os.loadavg() | | 内存 已用/总量/交换 | ✅ | ✅ | vm_stat + sysctl / /proc/meminfo | | 磁盘 已用/总量 | ✅ | ✅ | df -k(APFS 用 used+free 反算) | | 磁盘 I/O 读写 | ✅ | ✅ | ioreg 累计差分 / /proc/diskstats | | 网络 ↑↓ | ✅ | ✅ | netstat -ibn 累计差分 / /proc/net/dev | | 温度 | ❌ 需可选 helper | ✅ | /sys/class/thermal | | Top 进程 | ✅(ps) | ✅(ps) | 取不到时自动隐藏 |

采样开销:快层(CPU + 网络)实测约 6ms/轮 ≈ 0.6% 单核;内存/磁盘/IO/温度 5s 一次;Top 进程 30s 一次。页面不可见或无位置启用时停止采样。

已知限制

  • macOS 26 没有免特权温度源:temperature.available=false,按设置策略渲染(默认隐藏,绝不填 0);Linux 读 /sys/class/thermal。
  • sidebar.footer.action 是 nowrap 横向单行、宽 256px,被「模型额度」卡片占满,所以展开态用 shell.overlay 浮层卡锚定在 footer 行上方;折叠态才用 footer 图标。
  • 右栏「系统」tab 只在有可见会话时可打开;无会话时点击退化为浮层大卡。
  • Top 进程依赖 ps,宿主侧可用但未在真实宿主内验证;取不到时该块自动隐藏。

检查更新

设置 → 系统 HUD 右上角「检查更新」查询 npm 最新版;本地 link: 安装(尚未发布)会显示「尚未发布到 npm」。 Host 端 update-check 有 10 分钟缓存、8 秒超时,失败只写 error 字段,不影响页面其他部分。

安全

  • 只执行写死白名单的系统命令(vm_stat / netstat -ibn / df -k / ioreg / sysctl / pmset -g therm / ps),execFile 数组参数、2s 超时、1 MiB 输出上限、SIGKILL 兜底;绝不拼接 shell,绝不接受前端传入的命令/参数。
  • /system-hud/* 全部走 connection.admit 认证围栏,未认证 401。
  • 配置落盘 $DSH_HOME/system-hud/config.json(目录 0700 / 文件 0600,tmp+rename 原子写),不存任何凭据。
  • 快照不含用户名、绝对路径、环境变量;远端访问时 UI 显示「本机」。

配置

cordis.patch.yml 里的默认配置:

- insert:
    - id: system-hud
      name: "@ponydev/dsh-system-hud"
      config:
        fastMs: 1000
        slowMs: 5000
        topProcMs: 30000
        regions: { header: true, dock: true, sidebar: true, rightPane: true, bottomBar: false }

运行时偏好持久化在 $DSH_HOME/system-hud/config.json(0600),由设置页写回;Host 是唯一真相源。

结构

lib/index.js      Host:/system-hud 路由、认证围栏、配置持久化、update-check
lib/sample.js     分层采样(快/慢/top、单飞、差分、暂停、失败保留旧值)
lib/metrics.js    darwin/linux 解析与执行(命令白名单)
lib/client.js     ModuleLoader bundle:三个位置、右侧「系统」tab、设置页、i18n
cordis.patch.yml  bundle patch(插入 system-hud 行 + 默认配置)
scripts/          smoke / check-i18n / release-notes / render-test / check-privacy / check-shots
docs/             DESIGN.md、CONTRACT.md、PANEL-DESIGN.md、screenshots(MANIFEST 登记来源)

开发

npm run check      # 语法 + i18n 键一致性 + 插件标识一致性
npm run verify     # 单独校验插件 id / 名称(包名、cordis patch、ModuleLoader id、NS、路由)
npm run smoke      # 离线解析/差分/配置冒烟(不触网)
npm run test-ui     # 离线 UI 预览(有本机 Chrome 时截图到 docs/screenshots/)

接口契约见 docs/CONTRACT.md,设计与取舍见 docs/DESIGN.md,项目规范见 AGENTS.md。

License

MIT