Chi-hong22/dsh-plan-spend ↗★ 0

@chi-hong22/dsh-plan-spend

DSH Web GUI plan-spend popup: shows the configured providers' plan spend — DeepSeek official balance and OpenCode Go 5h/weekly/monthly quota — as an out-of-tree DeepSeek Harness plugin bundle 适合需要监控DeepSeek官方和OpenCode Go API额度消耗的用户。

パッケージ
@chi-hong22/dsh-plan-spend
互換性
未検証
バージョン
0.1.0
ライセンス
MIT
最終更新
2026/10/08

インストール

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Chi-hong22/dsh-plan-spend

ドキュメント

README 全文を読む ↗

Configuration

The plugin has no config. It decides which providers to show from whether their credential is configured; the reference names live in the ADAPTERS table in index.js:

ProviderCredential ref (POSIX environment name)
DeepSeek officialDEEPSEEK_API_KEY
OpenCode GoOPENCODEGO_API_KEY

Credentials resolve through ctx.credentials.resolve(); the source precedence is documented by @deepseek-ai/dsh-credentials-local (launch environment → stored file → project .env → harness home .env). An unconfigured provider issues no request and renders as "no credential configured; skipped".

The API-key row is the fallback. The DeepSeek card is normally read in this half from the signed-in DeepSeek account: ctx.deepseekAccount.resolveToken hands out the stored grant for the configured inference origin (https://api.deepseek.com), and that token goes to the same /user/balance endpoint as x-dsh-auth-token. No API key is needed, and the grant never reaches the browser. When the account cannot answer (signed out, no account provider in this composition, or the query failed) the API-key card stands in and names its own route; a failed account query is reported on that fallback card, so "signed out" and "the query broke" stay distinguishable.

The account service's own balance query is deliberately not used: it goes to platform.deepseek.com, whose WAF answers non-browser clients with HTTP 429, so it reports a failed balance instead of a number.

A failed or missing API-key read also reports the effective credential's source layer and whether this surface could write it (ctx.credentials.describe), because "I saved a key and it still unauthorised" is almost always a read-only launch-environment value winning over the stored one.

Adding a provider = one row in ADAPTERS plus one reader function.