dsh-sysmon
v0.1.1
Published
Floating system monitor for dsh web: CPU, RAM, battery, temperature, with hot alerts.
Maintainers
Readme
dsh-sysmon
A lightweight floating system monitor for the DeepSeek Harness (dsh) web UI. 为 DeepSeek Harness (dsh) 网页界面提供的轻量悬浮系统监控插件。
右下角一个不起眼的小胶囊,实时显示 CPU、内存、电池与温度;点击展开详情。 超温/高负载/低电量时自动变色提醒,数据只在本机回环,绝不外发。
A compact pill in the bottom-right corner showing live CPU, RAM, battery and temperature. Click it to expand details. Turns orange / red on hot alerts. Everything stays on the local loopback — no data ever leaves your machine.
🔗 Links / 资源链接
| 资源 | 地址 | | --- | --- | | 📦 npm | https://www.npmjs.com/package/dsh-sysmon | | 🐙 GitHub 仓库 | https://github.com/Kilganon725/dsh-sysmon | | 🐛 问题反馈 / Issues | https://github.com/Kilganon725/dsh-sysmon/issues | | 📄 更新日志 | CHANGELOG / Releases |
✨ Features / 功能特性
| Feature | 说明 | Notes |
| --- | --- | --- |
| Floating pill | 右下角悬浮胶囊,点击展开/收起 | bottom-right, click to expand |
| CPU usage | 基于 OS tick 差值计算占用率,无外部调用 | computed from os.cpus() tick deltas |
| Memory | 已用/总量与占用百分比 | used / total + percent |
| Battery | 电量、充电中、电源状态(可用时) | percent / charging / plugged |
| CPU temperature | 平台暴露时显示(含 Windows 热区 WMI 回退) | with Windows thermal-zone fallback |
| GPU temperature | NVIDIA / AMD / Intel 等暴露温度时显示 | when the GPU driver exposes it |
| Hot alerts | 橙色/红色闪烁告警 + 低电量提醒 | orange / red blink + low-battery warn |
| Zero config | 安装即用,无需任何设置 | install & forget |
🧠 How it works / 工作原理
宿主端(lib/index.js)作为 cordis fiber 注册进 web 服务,采样系统指标并经同源
HTTP 路由 GET /dsh-sysmon/stats 提供(带 1.5s 缓存与并发合并);浏览器端
(lib/client.js)是手写的零依赖 bundle(无构建步骤),通过
window.__ModuleLoader__.load 注入,每 2.5s 轮询一次并渲染。不经过任何 RPC、
不连接外部网络、不申请任何权限。
┌──────────────────────────── dsh web (single process) ────────────────────────────┐
│ │
│ host half (lib/index.js) client half (lib/client.js) │
│ ┌──────────────────────────────┐ ┌───────────────────────────────┐ │
│ │ samples every ~1.5s: │ HTTP │ zero-dependency lazy bundle │ │
│ │ · os.cpus() tick deltas │◀──────▶│ GET /dsh-sysmon/stats │ │
│ │ · systeminformation: mem, │ same- │ polls every 2.5s │ │
│ │ battery, cpu temp, gpu │ origin │ renders pill + detail panel │ │
│ │ serves GET /dsh-sysmon/stats │ │ applies warn/danger classes │ │
│ └──────────────────────────────┘ └───────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────────────┘📦 Install / 安装
方式一:npm(推荐)✅ 已发布
npm 页面:https://www.npmjs.com/package/dsh-sysmon
# 在 dsh 中直接安装为插件
dsh plugin --profile web add dsh-sysmon
# 或者仅作为依赖安装
npm install dsh-sysmon方式二:本地分享包 tgz
把 dsh-sysmon-0.1.0.tgz 下载到本地后:
dsh plugin --profile web add /path/to/dsh-sysmon-0.1.0.tgz方式三:从 GitHub 安装
dsh plugin --profile web add github:Kilganon725/dsh-sysmon方式四:手动安装(与皮肤插件 skin-switcher 同款布局)
# 1) 解包到 web profile 的 node_modules
mkdir -p ~/.dsh/profiles/web/node_modules/dsh-sysmon
tar -xzf dsh-sysmon-0.1.0.tgz -C ~/.dsh/profiles/web/node_modules/dsh-sysmon --strip-components=1
# 2) 在 profile 内安装依赖
cd ~/.dsh/profiles/web && pnpm add systeminformation@^5.0.0
# 3) 建插件符号链接(~/.dsh/plugins 约定)
ln -sfn ~/.dsh/profiles/web/node_modules/dsh-sysmon ~/.dsh/plugins/dsh-sysmon
# 4) 把 bundle 补丁追加到 profile 配置
cat >> ~/.dsh/profiles/web/cordis.patch.yml <<'EOF'
- insert:
- id: dsh-sysmon
name: dsh-sysmon
EOF⚠️ 无论哪种方式,装完后都需要重启 dsh web 并刷新页面:
dsh web
🚀 Usage / 使用
安装并重启后,右下角即出现监控胶囊:
- 折叠态:一行小胶囊,显示 CPU% · 内存% · 电池%(如有)
- 点击展开:显示主机名/核数、内存用量(GB)、运行时长、CPU/GPU 温度
- 自动刷新:每 2.5s 拉取一次,数据实时更新
告警颜色 / Alert colors
| 状态 | 条件 | 显示 | | --- | --- | --- | | 🟠 橙色 warn | CPU ≥ 80% 或 CPU 温度 ≥ 75°C;或电量 ≤ 20% 且未充电 | 胶囊变橙 | | 🔴 红色闪烁 danger | CPU ≥ 95% 或 CPU 温度 ≥ 90°C | 胶囊红色闪烁 |
🔌 HTTP API
宿主端在 web 服务内注册同源路由:
GET /dsh-sysmon/stats
响应示例(JSON,字段缺失时为 null):
{
"ts": 1756375200000,
"host": "MacBook-Pro.local",
"cpu": 23,
"cores": 10,
"ram": {
"total": 17179869184,
"used": 10200547328,
"percent": 59
},
"battery": {
"percent": 86,
"charging": true,
"plugged": true
},
"cpuTemp": 52,
"gpuTemp": null,
"uptime": 86400
}| 字段 | 类型 | 说明 |
| --- | --- | --- |
| ts | number | 采样时间戳 (ms) |
| host | string | 主机名 |
| cpu | number | CPU 占用百分比(0–100) |
| cores | number | 逻辑核心数 |
| ram.total/used/percent | number | 内存字节/字节/百分比 |
| battery | object | null | 无电池设备为 null |
| cpuTemp | number | null | CPU 温度 °C(平台不支持时为 null) |
| gpuTemp | number | null | GPU 温度 °C |
| uptime | number | 系统已运行秒数 |
⚙️ Configuration / 配置
零配置。 插件不读取任何设置项、不写任何配置。如需修改轮询间隔等参数, 请直接修改源码并重新打包(见下节)。
🛠 Development / 开发
git clone https://github.com/Kilganon725/dsh-sysmon.git
cd dsh-sysmon
npm install # 安装依赖(systeminformation)
npm test # 运行冒烟测试(node:test,无外部依赖)
npm pack # 生成 dsh-sysmon-0.1.0.tgz
npm run dry # 预览 npm publish 会发布的内容本地预览到真实 dsh:
dsh plugin --profile web add file:/absolute/path/to/dsh-sysmon改动
lib/index.js(宿主)或lib/client.js(浏览器)后需要重启 dsh web 生效。
🚢 Publishing / 发布
当前已发布:[email protected](npm)。 后续发新版:
npm version patch # 或 minor / major
npm publish # 需先 npm login(发布到 npmjs.org)
git push --tags # 推送版本 tag 到 GitHub仓库内附带了 GitHub Actions 工作流 .github/workflows/publish.yml:
推送 v* tag 时自动测试并发布到 npm。使用前请在仓库
Settings → Secrets and variables → Actions 中添加 NPM_TOKEN(npm 上的
Automation/发布级 token)。
💻 Compatibility / 兼容性
- Node.js ≥ 22.19.0(dsh 官方运行时要求)
- 平台:macOS / Windows / Linux 均可运行宿主端
- 温度传感器:部分机型(如多数 Intel 核显笔记本)不暴露温度, 此时温度行显示 "unavailable / 不可用",其余指标不受影响
- 无电池设备:台式机等无电池设备隐藏电池项
🔒 Privacy & Security / 隐私与安全
- 数据仅在本机回环(
127.0.0.1同源 HTTP),不上传、不记录、不分析 - 无任何网络外呼:除轮询本机路由外没有任何 fetch 到外部地址
- 无权限申请、无 RPC、无密钥;可放心在办公/生产环境使用
❓ FAQ / 常见问题
Q: 重启后没看到胶囊?
A: 确认插件已进入 bundle 层:dsh web --dump-config 输出中应包含
- id: dsh-sysmon。然后强制刷新浏览器(Cmd+Shift+R)。
Q: 温度一直显示不可用? A: 平台/机型未暴露温度传感器。macOS 上多数 Apple Silicon 可读到, Intel 核显机型常不可用,属正常现象。
Q: 能改刷新频率吗?
A: 当前为固定值(宿主采样 1.5s 缓存,浏览器轮询 2.5s)。修改
lib/client.js 中的 POLL_MS 后重新打包即可。
Q: 和 dsh 自带的资源面板冲突吗? A: 不冲突。本插件是独立悬浮胶囊,不修改 dsh 任何原生 UI。
📝 Changelog / 更新日志
0.1.0 (2026-08-28)
- 首个发布版本:CPU / 内存 / 电池 / 温度悬浮监控 + 高温/低电量告警
- 支持 Windows 热区温度回退(WMI ThermalZoneInformation)
- 零依赖浏览器端 bundle,无构建步骤
📄 License / 许可
MIT © 2026 Kilganon725
