dsh-quota-float

August 15, 2026 · View on GitHub

A floating usage & balance widget for DeepSeek Harness (DSH) — a draggable card on the page that shows the quota or balance of whichever provider the current conversation is using.

中文文档

Screenshots

Kimi — quota barsDeepSeek — balance
Kimi quota viewDeepSeek balance view

The card follows the current conversation's selected model — switch conversations and the view switches with it.

Features

  • 🐳 Follows the conversation — reads the current conversation's selected model via the harness's own model directory, and resolves the same credential the harness itself uses (Settings → Models → apiKeyEnv → credentials store). No keys in this package, ever.
  • 🔀 Per-provider views:
    • Kimi — 5h window + weekly quota bars with reset countdowns
    • DeepSeek — today's cost + balance (recharge-aware daily tracking)
    • Volcengine Ark — 5h + weekly quota (console cookie + CSRF, resolved via DSH credentials → launch env)
    • Alibaba Cloud BSS — monthly bill + account balance (AccessKey pair, HMAC-SHA1 signed OpenAPI, DSH credentials → launch env)
  • 🎨 Native look — built on DSH theme tokens (light/dark adaptive) with DeepSeek brand-blue accents
  • 🖱️ Draggable anywhere — position is shared across conversations; collapsible header; manual refresh button
  • 🛡️ Resilient — 3× retry, 5-minute file cache (~/.dsh/quota-float/), stale-cache fallback that keeps showing data instead of going blank

Install

# One command — installs from npm and registers the bundle automatically:
dsh plugin add @liuliuhuhushui/dsh-quota-float
Manual install (alternative)
cd ~/.dsh/profiles/web        # Windows: %USERPROFILE%\.dsh\profiles\web
pnpm add @liuliuhuhushui/dsh-quota-float

Then add the package to the profile's bundle list in package.json:

{
  "dsh": {
    "profile": {
      "bundles": [
        "@deepseek-ai/dsh-base",
        "@deepseek-ai/dsh-web-app",
        "@liuliuhuhushui/dsh-quota-float"
      ]
    }
  }
}

Restart DSH. The card appears at the bottom-right of the window.

How it works

browser card (shell.overlay slot)
  └─ GET /quota-float/quota?provider=<route>&model=<id>
       └─ host plugin (index.js)
            ├─ settings.get('llm-pi-ai' | 'llm-deepseek') → apiKeyEnv ref
            ├─ credentials.resolve(ref) → the same key model calls use
            └─ provider usage API (fetch ×3 retry) → 5-min file cache

The host half registers one exact route on the harness web server (webServer.register); the client half is a hand-written window.__ModuleLoader__ bundle — zero dependencies, no build step.

Requirements

  • DeepSeek Harness web profile (Node ≥ 22.13)
  • API keys configured in DSH Settings → Models (the widget reuses them)
  • Ark only: ARK_COOKIE + ARK_CSRF_TOKEN in ~/.dsh/.credentials.yaml (or the launch environment)
  • Alibaba only: ALIBABA_CLOUD_ACCESS_KEY_ID + ALIBABA_CLOUD_ACCESS_KEY_SECRET in ~/.dsh/.credentials.yaml (or the launch environment)

License

MIT