dshbase

插件目录 / Knowledge / dsh-plugin-usage-dashboard

dsh-plugin-usage-dashboard

已验证 · 实测可装 hnmrxz

✓ 持续维护 基于 5 个官方 DSH 包

查看 GitHub ↗ ← 返回插件目录

1Stars
0Forks
0未关闭 issue
JavaScript语言
2026-08-15最近推送
跨平台平台

功能简介

用量与成本仪表盘,低余额提醒

✅
我们的评价
可用 — 实测通过,早期项目

用量与成本仪表盘,低余额提醒 实测能干净安装、正常启动。早期项目,但功能可用。

「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

README

dsh-plugin-usage-dashboard

在 DeepSeek Harness (dsh) 底部状态栏显示 DeepSeek 用量与估算花费:按会话聚合 token 成本、余额预算告警。

Estimated token cost & usage dashboard for DSH: per-session token/cost aggregation with a low-balance budget alert, right in the bottom status bar.

screenshot

Features

  • 状态栏 chip:DS ¥12.34 · 估算花费,余额低于阈值时变橙色 ⚠ 余额偏低
  • 悬停查看明细:总花费 / 会话数 / token 数 + 按会话 Top 8 的成本排行
  • 每 30 秒自动刷新,点击立即刷新
  • 数据完全来自 dsh 自己的投影缓存(tokenUsage / sessionStats),零核心改动、零运行时依赖
  • 余额告警复用 DEEPSEEK_API_KEY 凭据(与余额插件同一条链路),无需再配置
  • 中英文自动跟随 DSH 界面语言

Install

需要 DSH 0.1.0-rc.x(Web profile)。

1. 安装到 profile

cd ~/.dsh/profiles/web
npm install dsh-plugin-usage-dashboard
# 本地开发:npm install /path/to/dsh-plugin-usage-dashboard

2. 加入 composition

编辑 ~/.dsh/profiles/web/cordis.patch.yml:

- insert:
    - id: usage-dashboard
      name: dsh-plugin-usage-dashboard

3. 重启 dsh

dsh --profile web

Configuration

无配置项。Key 复用 DEEPSEEK_API_KEY(Models 设置页或环境变量)。

成本为估算值:按 DeepSeek 公开定价(CNY/1M tokens)折算——缓存命中输入 ¥0.5、未命中输入 ¥2、输出 ¥8。如需调整,编辑 lib/index.js 顶部的 PRICE 常量;余额告警阈值 BALANCE_ALERT_THRESHOLD(默认 10 CNY)同理。

How it works

Browser client.js          dsh Host process
┌──────────────┐   GET    ┌───────────────────────────┐
│ composer.dock│ ───────► │ /dsh-usage                │
│  chip        │ ◄─────── │   ├─ sessionQuery         │
└──────────────┘  JSON    │   │   .listSessions()     │
                          │   ├─ sessionProjections   │
                          │   │   .snapshot()          │
                          │   │   (tokenUsage,         │
                          │   │    sessionStats,       │
                          │   │    title)              │
                          │   ├─ credentials.resolve() │
                          │   └─ fetch /user/balance   │
                          └───────────────────────────┘

Development

lib/index.js    # Host half:聚合用量 + 余额告警,注册 /dsh-usage 路由
lib/client.js   # Client half:状态栏 chip(__ModuleLoader__ bundle)

License

MIT

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-plugin-usage-dashboard」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:hnmrxz/dsh-plugin-usage-dashboard

Headless(CLI)profile:

dsh plugin --profile headless add github:hnmrxz/dsh-plugin-usage-dashboard

实测报告

验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。

使用场景

给 agent 一套记忆、知识库或检索层,让它不再跨会话丢上下文。

适合谁

跑长项目、想让 agent 记住决策、文档和偏好而不用每次重讲的人。

二次开发建议

记忆/检索后端是缝——插新存储、调蒸馏策略,或加引用与审计轨迹。

安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Knowledge 里更多

浏览全部 7797 个插件 →