mouse33333/dsh-quota-monitor0

dsh-quota-monitor

Quota monitor for the DeepSeek Harness Web GUI: OpenCode Go plan usage + DeepSeek API balance/usage + MiniMax Token Plan, as a draggable bottom-left monitor window. P0: self-metered token ledger (llm/stream waterfall, own JSONL). P1: multi-provider abstractions (balance/windows kinds, presets, configurable parsers) and bundle-type packaging.

包名
dsh-quota-monitor
版本
0.6.1
许可证
MIT
最近更新
2026年8月18日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:mouse33333/dsh-quota-monitor

配置(v0.6.0 新增)

除界面下拉预设外,可通过包条目的 config 覆盖/新增供应商(未来设置页将直接写这里):

- id: dsh-quota-monitor
  name: dsh-quota-monitor
  config:
    cacheTtlMs: 5000
    timeoutMs: 15000
    lowBalanceThreshold: 20
    providers:
      # 覆盖内置预设:给 opencode-go 设独立低阈值
      opencode-go:
        lowBalanceThreshold: 10
      # 新增自定义网关(复用通用余额解析器)
      my-gateway:
        label: 自建网关
        kind: balance
        url: https://gw.example.com/v1/balance
        apiKeyEnv: MY_GW_KEY
        parse: { builtin: generic-balance }
        currency: USD
  • 供应商字段:kindbalance|windows)、urlapiKeyEnvheadersauthbearer/raw)、currencyparsebuiltin/source/file)、 lowBalanceThreshold
  • 内置解析器:deepseek-balanceopencode-go-usagenew-api-selfsub2api-usagegeneric-balanceparse.source 支持粘贴 JS 函数, parse.file 支持脚本文件(默认导出一个 (raw) => 快照片段 的函数)。
  • OpenCode 令牌:~/.local/share/opencode/auth.jsonOPENCODE_QUOTA_AUTH 可覆盖), 或环境变量 OPENCODE_API_KEY
  • DeepSeek 密钥:DSH 凭据中的 DEEPSEEK_API_KEY 或环境变量。
  • 价格/汇率:每日刷新一次并缓存 24h;离线回落内置价格表(面板标注"内置价格")。
  • 轮询间隔:60 秒(lib/client.jsPOLL_INTERVAL_MS)。