deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
PROJECT README
插件包名:
dsh-balance
在 DeepSeek Harness 侧边栏左下角「设置」按钮上方显示你的 DeepSeek 开放平台账户余额的插件。

DeepSeek API 不提供消费历史,所以插件会在服务端把每次成功查询的余额快照
记录到 ~/.dsh/dsh-balance/balance-history.json(保留最近 90 天)。估算时从
最新记录向前找最近一段余额持续下降的区间(余额上涨即充值点,自动跳过),
用该区间的消耗量 ÷ 天数得到日均消耗,再推算当前余额还能用多久。
estimateMinDays(至少累计多少天才估算,默认 1)、
historyMaxAgeDays(历史保留天数,默认 90)双半插件(dual-half cordis plugin):
| 半 | 文件 | 作用 |
|---|---|---|
| 服务端(host) | lib/index.js | 注册 GET /ds-balance/balance 路由(仅回环可信请求),解析 API Key,代理 https://api.deepseek.com/user/balance |
| 浏览器(client) | lib/client.js | 向 sidebar.footer.action 插槽注册余额徽标组件,定时拉取并渲染 |
按优先级:
推荐用凭证服务:Key 不进插件配置、不进浏览器,且与模型调用复用同一把 Key。
# 1. 把插件放进 web profile 的 node_modules(目录联接,改源码即生效)
$profile = "$HOME\.dsh\profiles\web"
$target = "$profile\node_modules\dsh-balance"
New-Item -ItemType Junction -Path $target -Target "<本目录>" -ErrorAction SilentlyContinue
# 2. 在 $profile\cordis.patch.yml 末尾追加:
# - insert:
# - id: dsh-balance
# name: dsh-balance
# config:
# apiKeyEnv: DEEPSEEK_API_KEY
# 服务端路由(Key 已配置时)
curl http://127.0.0.1:3080/ds-balance/balance
# 期望 {"ok":true,"is_available":true,"balance_infos":[{"currency":"CNY",...}],...}
Remove-Item "$HOME\.dsh\profiles\web\node_modules\dsh-balance" -Recurse
# 并从 cordis.patch.yml 删除 dsh-balance 条目 CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。