dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
Balance, quota, and model-health monitoring for DeepSeek Harness Web
English · 简体中文
dsh-balance-quota displays provider balance or quota below the DSH chat composer. It can also consume third-party JSON status APIs and show model health, availability, TTFT, response time, history, and custom metrics.
Current development version: 0.3.5 · Previous npm release: 0.3.3
DSH compatibility: 0.3.4 requires DSH 0.1.5-rc.1 or newer (
@deepseek-ai/dsh-settings≥0.1.5-rc.2), which removed thesettingsNamespace()helper in favour of passing the namespace string straight tosettings.register(). Use 0.3.3 on DSH 0.1.4 and older.
| Area | Features |
|---|---|
| Official presets | DeepSeek balance and OpenCode Go rolling/weekly/monthly quota |
| Custom balance | Public HTTPS, GET/bodyless POST, custom headers, timeout, refresh interval |
| JSON extraction | Property paths, array indexes, optional chaining, up to five ?? fallbacks |
| Amount handling | Static/dynamic currency, amount divisor, unsaved-draft testing |
| Status bar | Balance, update time, force refresh, and health entry below the composer |
| Provider selection | Default provider, inline switching, per-conversation memory |
| Model settings | Model catalog, context window, text/image input, reasoning levels |
| Health monitoring | External JSON API, status, availability, TTFT, response time, history |
| Visual binding | Select a preview slot, then select a JSON field; preview updates immediately |
| All-model preview | Preview up to 50 models with current mappings without another request |
| Transforms | Text, number, percentage, status, status-value maps, percentage multipliers |
| Number formatting | Per-field input unit, display unit, and 0–2 decimal places |
| Custom fields | Error rate, empty response, common errors, or any model metric |
| Cache and refresh | Shared Host balance cache, health-preview cache, pause while hidden |
| Credential security | Reuses DSH credential refs; API keys never enter browser configuration |
| Network security | Public HTTPS, DNS pinning, rebinding protection, private-IP/redirect blocking |
Requires Node.js 22+ and the DSH CLI.
dsh plugin --profile web add dsh-balance-quota
dsh web
Restart dsh web after installation or upgrade. Verify installation with:
dsh plugin --profile web list
All seven screenshots come from the current plugin running in DSH Web. Provider names, URLs, balances, and model names were replaced with demo values; the UI layout and controls were not redrawn.
Open Settings → Plugins → Plugin configuration → 供应商状态 (Provider Status).
This page controls balance queries, provider editing, Advanced Settings, the default provider, the chat status bar, and manual refresh.
Click 编辑 (Edit) on a provider row:
Configure the display name, endpoint, GET/bodyless POST, balance JSON path, static or dynamic currency, amount conversion, headers, refresh interval, and timeout.
Balance: $.remaining ?? $.quota?.remaining ?? $.balance
Currency: $.unit ?? $.quota?.unit ?? "USD"
测试 (Test) validates only the current unsaved draft. It does not write formal configuration, credentials, or production cache. Save after the result is correct.
Click 高级设置 (Advanced Settings). The first tab is 模型设置 (Model Settings):
It manages the provider's model ID/display name, context window, text/image input capabilities, and default/available reasoning levels.
This is separate from balance and health: Edit owns balance settings; the second Advanced Settings tab owns external monitoring.
Switch to 健康监测 (Health Monitoring):
Setup flow:
Health monitoring reads third-party monitoring data. It does not invoke chat models or consume model quota.
Bind the model list first: select the Model List slot on the right, then select an array such as $.models on the left.
| Field | Example path | Purpose |
|---|---|---|
| Model name | $.model | Card title |
| Group | $.group | Group badge |
| Status | $.status | Healthy, failed, warning, unknown |
| Availability | $.availability | Current availability |
| TTFT | $.ttft_ms | Time to first token |
| Response time | $.latency_ms | Request duration |
| History array | $.history | Recent records |
| History status | $.state | Per-record state |
| History time | $.time | Per-record timestamp |
| History error | $.message | Per-record error |
%.Custom status values can use 值映射 (Value mapping):
healthy → healthy
warning → warning
offline → failed
Selecting Number for a custom field reveals three settings:
| Setting | Values |
|---|---|
| Input unit | ms, s |
| Display unit | follow input, ms, s |
| Decimal places | 0, 1, 2 |
For example, 1250ms displayed as seconds with two decimals becomes 1.25s. Settings are stored independently per field.
Enable 状态栏 (Status bar) at the bottom of Provider Status, then return to any conversation. It appears directly below the chat composer:
From left to right: health dot, current provider, balance/quota, update time, force refresh, and the health-monitor icon.
Click the provider name in the status bar:
↻ bypasses cache and refreshes the current balance immediately.After health monitoring is enabled and saved for the current provider, an ECG icon appears next to refresh. Click it to request the endpoint and open details:
The dialog shows model/failure/warning counts, group and status, availability, average TTFT and response time, custom metrics, recent-history bars, and manual refresh.
Health represents the third-party monitor, not the current account itself.
Configure at least one provider, enable Status Bar at the bottom of Provider Status, and restart dsh web after installation or upgrade.
Enable, test, and save Health Monitoring under Advanced Settings. The icon only appears when the current provider has an enabled health monitor.
invalid external custom fieldBind the model list first, then select a field inside a model item. Name and path must be non-empty; $.last_errors[0] is valid. Version 0.3.3 trims whitespace and ignores unfinished blank fields.
Confirm the endpoint is public HTTP(S) without redirects, the credential ref resolves, and JSON paths match the response. Private, loopback, and internal destinations are rejected.
credentials and never enter browser configuration.DSH_BALANCE_ALLOW_HTTP=0 to require TLS).__proto__, constructor, and prototype.See SECURITY.md.
packages/dsh-balance is the only public package.
pnpm install
pnpm dev:install
pnpm check
pnpm test
pnpm pack:check
pnpm verify
packages/dsh-balance/
├── lib/host/ # Secure queries, validation, cache, config, health normalization
├── lib/client/ # DSH Web status bar and settings UI
├── docs/images/ # Real redacted README screenshots
├── test/ # Unit and security tests
├── README.md # npm package guide
└── SECURITY.md # Security boundary