brittanistrehlowll-oss/dsh-quota-panel2

dsh-quota-panel

Provider quota/balance corner panel for the dsh web surface: server-side credential proxies plus a config-driven page badge for DeepSeek balance and OpenCode Zen Go usage windows.

AI 분석

核心用途是在 Web 界面角落直观展示当前 API 密钥的剩余余额或使用窗口进度。适合需要实时监控 API 额度、避免因欠费或超限导致任务中断的用户。

패키지
dsh-quota-panel
버전
0.2.0
라이선스
MIT
최근 업데이트
2026. 8. 14.

설치

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:brittanistrehlowll-oss/dsh-quota-panel

Configuration

Each provider is one entry under providers. Two renderers ship:

formatendpoint shaperow
deepseek-balance{ "balance_infos": [{ "currency", "total_balance", "granted_balance", "topped_up_balance" }] }¥58.36 + 余额充足/正常/紧张/建议充值
opencode-usage{ "usage": { "rolling"|"weekly"|"monthly": { "percent", "resetsAt" } } }五 10% · 周 45% · 月 22% + progress bar + 当前最高占用

Override the shipped defaults in your profile's cordis.patch.yml:

- id: quota-panel
  config:
    refreshMs: 30000
    providers:
      - id: deepseek
        label: DeepSeek
        credential: DEEPSEEK_API_KEY
        endpoint: https://api.deepseek.com/user/balance
        format: deepseek-balance
        balanceTiers: { critical: 10, warn: 20, healthy: 50 }
      - id: opencode-go
        label: OpenCode Go
        credential: OPENCODE_GO_API_KEY
        endpoint: https://opencode.ai/zen/go/v1/usage
        format: opencode-usage
        windowLabels: { rolling: 五, weekly: 周, monthly: 月 }
        warnPercent: 70
        errorPercent: 90

Fields:

fieldmeaningdefault
idroute id (/api/quota/), ^[a-z0-9-]+$required
labelprovider name on the cardrequired
credentialcredential reference ($DSH_HOME/.credentials.yaml or env)required
endpointquota JSON endpoint, GET with Authorization: Bearer required
formatrow rendererdeepseek-balance
balanceTiers(deepseek-balance) {critical, warn, healthy} levels{10, 20, 50}
lowBalancelegacy alias for balanceTiers.warn
windowLabels(opencode-usage) {rolling, weekly, monthly}{滚, 周, 月}
warnPercent / errorPercent(opencode-usage) thresholds70 / 90
refreshMsauto-refresh interval60000

DeepSeek balance levels

With the default balanceTiers {critical: 10, warn: 20, healthy: 50}:

balancestatesecondary line
50ok余额充足

OpenCode usage states

high = max(rolling, weekly, monthly):

usagestate
= warnPercentwarn (amber dot + progress)
>= errorPercenterror (red dot + progress)

OpenCode usage states

high = max(rolling, weekly, monthly):

usagestate
= warnPercentwarn (amber dot + progress)
>= errorPercenterror (red dot + progress)