DeepSeek Harness plugin

dsh-balance-plugin-r0bert00

Real-time DeepSeek account balance display for the DeepSeek Harness Web GUI

Jump to install

Source facts

Repository
r0bert001/dsh-balance-plugin
Latest update
Aug 15, 2026
Category
UI Enhancements
GitHub stars
0
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/r0bert001/dsh-balance-plugin
Plugin: dsh-balance-plugin-r0bert00
Author: r0bert001

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer2 files
README.mdSource · read only

dsh-model-balance

在 DeepSeek Harness Web 界面中实时显示 DeepSeek 账户模型余额的插件。

插件在会话页头部(标题下方)显示一个余额胶囊:当前总余额、更新时间点、 状态圆点(绿 = 正常 / 黄 = 获取中 / 红 = 失败),并带一个手动刷新按钮。 把鼠标悬停在胶囊上可以看到充值 / 赠送余额的明细。

工作原理

  • 宿主端lib/index.js):每 intervalMs(默认 60 秒)用配置的凭证

调用 GET {baseURL}/user/balance,缓存快照,并通过 webServer 注册一个 exact 路由 /api/model-balance 提供给浏览器。该接口永远不会暴露 API Key

  • 浏览器端lib/client.js):每 30 秒轮询该路由(页面重新可见时立即

刷新),把快照渲染到 conversation.session.header.utilities 插槽。

凭证解析与官方 DeepSeek LLM 适配器一致:先走 credentials 服务(Web 的 「模型」设置页写入的 Key,即 $DSH_HOME/.credentials.yaml),再回退到启动 环境变量 DEEPSEEK_API_KEYDEEPSEEK_BASE_URL 可覆盖 API 地址。

安装

# 在 dsh-model-balance 目录外执行;pnpm 由 dsh plugin 转发
dsh plugin --profile web add <dsh-model-balance 的绝对路径>

安装后重启 Web 服务(dsh web)并刷新页面即可生效:

# 先停掉正在运行的 dsh web,然后
dsh web

配置

编辑 $DSH_HOME/profiles/web/cordis.patch.yml 覆盖行配置:

- id: model-balance
  config:
    intervalMs: 30000   # 宿主刷新间隔(毫秒),最小 5000
    apiKeyEnv: DEEPSEEK_API_KEY
    baseURL: https://api.deepseek.com

验证

  • 接口:curl http://127.0.0.1:3080/api/model-balance 应返回

{"state":"ok","data":{...},"fetchedAt":...}

  • 组成检查:dsh --profile web --dump-config 中应包含 model-balance 行。

说明

  • 默认绑定为 127.0.0.1,余额接口只返回余额数据;如需更严格的访问控制,

可自行在宿主端加鉴权。

  • 移除插件:dsh plugin --profile web remove dsh-model-balance,然后重启。