dshbase

Plugin directory / Knowledge / dsh-billing

dsh-billing

Verified · install-tested on dsh TheTianzz

✓ Actively maintained

View on GitHub ↗ ← Back to plugin directory

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

What it does

DeepSeek Harness plugin: account balance + session costs (/balance /cost commands, deepseek_billing tool, Web UI dual pills), official prices auto-sync every 12 hours.

✅
Our take
Works — verified, early-stage project

DeepSeek Harness plugin: account balance + session costs (/balance /cost commands, deepseek_billing tool, Web UI dual pills), official prices auto-sync every 12 hours. It installs cleanly and boots without issues in our testing. It's early-stage but functional.

“Verified” means our automated CI actually ran dsh plugin add in a clean profile and it booted — nothing more. Feature descriptions and version compatibility are the author’s claims. This is not a security audit and not an endorsement of third-party code.

README

dsh-billing

DeepSeek Harness 插件:账户余额 + 会话费用(人民币),带 Web UI 悬浮显示。

功能

入口 用法 说明
UI 会话头部双胶囊 无需操作,常驻显示 余额 + 本会话费用 并排显示在会话标题旁;点击任一胶囊立即刷新两个
悬停明细 鼠标悬停 余额胶囊:充值/赠金/美元;费用胶囊:按模型的 token 与费用拆分
斜杠命令 /balance 聊天框输入 /balance 查询账户余额(人民币优先,附美元)
斜杠命令 /cost 聊天框输入 /cost 当前会话费用明细
工具 deepseek_billing 直接问模型"余额多少/花了多少钱" query = balance / cost / both

结构

  • host.js — 宿主插件:命令 + 工具 + /billing/{balance,cost} RPC 通道(供浏览器胶囊轮询)
  • client.js — 浏览器 bundle(__ModuleLoader__ 工厂格式,仅依赖平台共享的 react,无构建步骤)
    • conversation.session.header.actions 槽位(负数 order = 静态会话上下文)→ 余额 + 会话费用双胶囊
  • package.json — 声明 dsh.bundle(空 patch)+ dsh.client(web 平台)
  • cordis.patch.yml — 空层;本插件由 profile 的 cordis.patch.yml 插入行激活

安装(一条命令)

组合包自带激活层(cordis.patch.yml),安装后自动生效,无需手改任何配置:

# 从本地目录安装
dsh plugin --profile web add ./deepseek-billing

# 或从打包产物安装(跨机器分发推荐)
dsh plugin --profile web add ./dsh-billing-0.2.0.tgz

# 或从 npm / git 安装(发布后)
dsh plugin --profile web add dsh-billing
dsh plugin --profile web add github:you/dsh-billing

安装后重启 dsh web,再刷新浏览器页面(F5)使新 boot graph 生效。
宿主侧 API key 使用 DEEPSEEK_API_KEY 凭据引用(在 Web 模型设置页保存即可)。

配置(全部可选)

config.pricing 按模型覆盖单价(元/百万 tokens),支持峰谷价自动切换(见 host.js 顶部默认值)。例如:

config:
  pricing:
    deepseek-v4-pro:
      cacheHit: 0.025
      cacheMiss: 3
      output: 6
      schedules:
        - effectiveAt: '2026-08-17T00:00:00+08:00'
          timezoneOffsetMinutes: 480
          peakWindows: [[9, 12], [14, 18]]
          offPeak: { cacheHit: 0.15, cacheMiss: 4.5, output: 13.5 }
          peak: { cacheHit: 0.30, cacheMiss: 9.0, output: 27.0 }

更新频率(事件驱动,空闲零请求)

  • 轮次中:每完成 10 步刷新一次(步号跨过 10 的整数倍时触发)
  • 每轮结束(turn/end):刷新一次,结算本轮收尾的步(短轮也靠它结算)
  • 挂载 / 切换会话 / 点击胶囊 / 页面从后台切回可见:立即刷新
  • 空闲时零请求:没有定时轮询;只有上述事件发生时才有请求
  • 服务端按需从内存会话日志计算,无后台常驻任务

价格自动同步(官方改价怎么办)

计费口径

  • token 取自会话日志中 provider 上报的 usage(含缓存命中拆分;失败重试也计入)
  • 单价内置官方价格,2026-08-17 起自动按北京时间峰谷价
  • 子代理是独立会话,各自单独统计
  • 输出为估算值,实际扣费以 DeepSeek 官方账单为准

维护提示

  • 改 client.js 后:客户端 HMR 会自动更新,刷新页面必生效
  • 改 host.js 后:若热重载未生效(Node ESM 缓存),可改文件名/包名触发重导入,或重启 dsh web

官方文档:

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-billing for me" — your agent finds it in the directory and installs it. Docs: dshbase-catalog · verified packs.

Web profile:

dsh plugin --profile web add dsh-billing

Headless (CLI) profile:

dsh plugin --profile headless add dsh-billing

Package

npm: dsh-billing · version — · tested on dsh 0.1.0-rc.6

Test report

Verified end-to-end: L1 install + L2 load + L3 runtime Q&A on dsh 0.1.0-rc.6.

When to use it

Give the agent a memory, a knowledge base, or a retrieval layer so it stops forgetting context between sessions.

Who it's for

Users running long projects who want the agent to remember decisions, docs, and preferences without re-explaining.

For developers — extending it

The memory/retrieval backend is the seam — plug a new store, tune what gets distilled, or add citation and audit trails.

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

Share this badge

More in Knowledge

Browse all 7797 plugins →