dshbase

Plugin directory / Data / dsh-cost-balance

dsh-cost-balance

Unverified zoumutou

✓ Actively maintained

View on GitHub ↗ ← Back to plugin directory

3Stars
3Forks
0Open issues
JavaScriptLanguage
2026-08-14Last push
Cross-platformPlatform

What it does

DeepSeek Harness plugin: iOS-style stats bar below input — conversation cost, account balance, cache hits, token usage expandable.

Our take
Unverified — not yet verified

DeepSeek Harness plugin: iOS-style stats bar below input — conversation cost, account balance, cache hits, token usage expandable. Not yet verified — it needs an external account or service our sandbox can't provide, so we couldn't run a full install test. It may work fine in your own environment.

“Unverified” means our automated CI has not yet installed this plugin. Feature descriptions and version compatibility are the author’s claims. This is not a security audit and not an endorsement of third-party code.

⚠ External account / service required — this plugin was not fully verified because it needs something our sandbox can't provide: DEEPSEEK_API_KEY in profile credentials. It may work fine in your own environment.

Author? Either provide the required account/service, or submit a self-test report (environment + install + run evidence) — we'll review and flip the badge. Submit evidence or self-test report ↗

README

dsh-cost-balance

npm version
npm downloads
License: MIT

DeepSeek Harness(DSH)Web UI 插件:在输入框下方显示一条 iOS 风格的小黑条,点击展开轻盈的半透明多行面板,查看会话花费、账户余额、缓存命中、Token 用量等统计。

默认折叠为一条居中的小黑条(类似 iOS 底部横条),点击展开毛玻璃面板:

内容
轮次 · 步数 3 轮 · 12 步
LLM 耗时 / 工具调用 45.2s / 12.3s
首 token 平均 / 吞吐 1.4s / 25.4 tok/s
缓存命中 87%
Token 输入 12.2K · 输出 517
花费 $0.0123(本会话,按官方定价)
余额 ¥9.00(DeepSeek 账户实时余额,60s 自动刷新)

安装(npm 发布版)

dsh plugin --profile web add dsh-cost-balance

该命令从 npm registry 拉取已发布的 dsh-cost-balance(dsh.bundle),自动加入 profile 的 bundle 层。

然后重启(或刷新)DSH Web UI。卸载:dsh plugin --profile web remove dsh-cost-balance

工作原理

  • Client 半lib/client.js):注册在 conversation.composer.dock 槽位(接管 shipped 的 stats 单元格,与产品自带统计行同源同数据),展示折叠/展开 UI;通过同源 GET /api/cost-balance 读取数据,每 60 秒自动刷新,token 用量变化时即时重算。
  • Host 半lib/index.js):经 webServer 注册 /api/cost-balance 路由——花费按会话累计 token(未命中输入 / 缓存命中 / 缓存写入 / 输出)× 模型单价计算;余额经 credentials 服务解析 DEEPSEEK_API_KEY 后调用 DeepSeek 官方 GET /user/balance(60s 缓存、失败 30s 抑制)。

余额取自用户自己的 API Key 账户,无需任何配置;未配置或抓取失败时面板显示 余额 --

定价与覆盖

内置 DeepSeek 官方定价(USD / 1M tokens):

模型 缓存命中 缓存未命中 输出
deepseek-v4-flash $0.0028 $0.14 $0.28
deepseek-v4-pro $0.003625 $0.435 $0.87

DeepSeek 将于 2026-08-16 16:00 UTC 起切换峰谷计费(off-peak 为 peak 的一半)。价格变更时无需等插件更新——在 profile 的 cordis.patch.yml 里覆盖即可:

# ~/.dsh/profiles/<你的profile>/cordis.patch.yml
- id: cost-balance
  config:
    prices:
      deepseek-v4-flash:
        cacheHit: 0.014
        cacheMiss: 0.44
        output: 1.32

(覆盖是整行替换,务必保留 id: cost-balance。)

从源码安装(开发)

git clone https://github.com/zoumutou/dsh-cost-balance.git
cd dsh-cost-balance
dsh plugin --profile web add .

发布新版本:修改 package.jsonversionnpm publish(账号需 2FA 绕过 token,见 npm 文档)。

许可

MIT

Install

🧩 Let your agent install it (recommended)

Install the catalog once, then DeepSeek Harness can find and install any plugin from this site automatically:

dsh plugin add dshbase-catalog

Then say "install dsh-cost-balance for me" — your agent finds it in the directory and installs it. Docs: dshbase-catalog · verified packs.

This plugin is GitHub source (not published to npm) — install it straight from the repo:

Web profile:

dsh plugin --profile web add github:zoumutou/dsh-cost-balance

Headless (CLI) profile:

dsh plugin --profile headless add github:zoumutou/dsh-cost-balance

Test report

Not yet L3-verified — see failure note below if we already ran it.

Status: pending
Note: 验证: runtime-fail (0.1.0-rc.6) Browse all pending failures →

When to use it

Let the agent crunch data — parse, transform, or analyze — so it works with real datasets, not just prose.

Who it's for

Users whose tasks involve tables, files, or numbers that need processing or analysis.

For developers — extending it

Data sources and transformation tools are the seams — add formats, aggregations, or visualization outputs.

Security: not yet scanned — our daily static scan will cover it shortly.

Share this badge

More in Data

Browse all 7795 plugins →