iambbp/dsh-monitor2

dsh-monitor

DeepSeek 实时 API 用量监控与峰谷价格提示悬浮窗原生插件,支持拖动、折叠、隐藏及状态记忆。

AI 分析

核心用途是实时监控 API 消耗并提示 50% 的峰谷优惠时段。悬浮窗设计直观,支持折叠。适合频繁调用 DeepSeek 官方 API、需要精细化控制和节省 Token 费用的 DSH 用户。

包名
dsh-monitor
版本
1.1.0
许可证
MIT
最近更新
2026年8月21日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:iambbp/dsh-monitor

4.2 注册到 DSH Web 配置

  1. ~/.dsh/profiles/web/package.json — 添加依赖:
{
  "name": "dsh-profile-web",
  "private": true,
  "dependencies": {
    "dsh-monitor": "file:./dsh-monitor"
  },
  "dsh": {
    "profile": {
      "bundles": [
        "@deepseek-ai/dsh-base",
        "@deepseek-ai/dsh-web-app"
      ]
    }
  }
}

⚠️ bundles 数组只放 bundle 组装包(@deepseek-ai/dsh-base@deepseek-ai/dsh-web-app),不要把单个插件加进 bundles,否则 DSH 启动会卡住。

  1. ~/.dsh/profiles/web/cordis.patch.yml — 通过 insert 加载插件:

## 五、使用说明

1. **打开**:启动 DSH 后按 F5 刷新页面,悬浮窗出现在右上角
2. **拖动**:按住面板标题栏(「DEEPSEEK · 监控」一行)拖动到任意位置
3. **折叠**:点标题栏右侧 `–`,收成小药丸(显示当前费用 + 峰谷)
4. **隐藏**:点 `✕`,完全隐藏(状态记忆在 localStorage,F5 后不自动弹出)
5. **复制报告**:点「📋 复制报告」,剪贴板获得今日报告,例如:

【DEEPSEEK 用量报告】2026-08-21 · 谷时段·半价 今日 Token: 270,647(输入 2,849 / 缓存命中 266,112 / 输出 1,686) 今日费用: ¥0.0252(高峰 ¥0 / 谷时 ¥0.0252) 交互次数: 3 次 平均消耗: 90,216 Token/次 配额使用: 0%(¥0.0252 / ¥10) 峰谷规则: 峰 北京 09:00-12:00/14:00-18:00 ×1.0 | 谷 其余时段 ×0.5(每天) 模型: deepseek-v4-flash · 单价(当前时段): 缓存命中 ¥0.05/1M · 未命中 ¥1.5/1M · 输出 ¥4.5/1M


6. **刷新**:点「🔄 刷新」立即更新(平时每 2 秒自动更新)

---

## 八、配置项

插件当前内置默认值,如需调整请修改 `lib/index.js`:

| 配置 | 位置 | 默认值 | 说明 |
|------|------|--------|------|
| 价格表 | `PRICING` 常量 | flash/pro 官方价 | 官方调价时更新 |
| 配额上限 | `buildPayload()` 中 `quota.limit` | `10`(元) | 配额进度条分母 |
| 统计模型 | `buildPayload()` 中 `model` | `deepseek-v4-flash` | 报告中的模型名与单价 |
| 轮询间隔 | `lib/ui.js` 中 `pollTimer` | 2000ms | 悬浮窗刷新频率 |
| 历史保留 | `maybeRollover()` 中 `90` | 90 天 | 滚动窗口 |

---