插件目录 / Network / dsh-balance-display
dsh-balance-display
已验证 · 实测可装 Liu-ty
功能简介
dsh-balance-display — DSH 插件(桥接)
可用 — 实测通过,早期项目
dsh-balance-display — DSH 插件(桥接) 实测能干净安装、正常启动。早期项目,但功能可用。
「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。
README
dsh-balance-display
English | 简体中文
dsh-balance-display is an installable DeepSeek Harness bundle that shows the current DeepSeek API account balance in a collapsible shell.overlay panel.
The Host resolves DEEPSEEK_API_KEY through the Harness credentials service for every refresh and calls the official GET https://api.deepseek.com/user/balance endpoint. The browser receives only validated balance fields, availability, a check time, or a stable error code. The API key is never sent to the browser, persisted by this plugin, logged, included in error details, or recorded in snapshots.
Features
- CNY and USD rows with total, granted, and topped-up balances
- Account availability and last refresh time
- Collapsible panel, manual refresh, and manual/1/5/15-minute auto-refresh choices
- Periodic refresh pauses while the page is hidden and refreshes when it becomes visible
- Harness light/dark theme tokens and zh-CN/en-US locale dictionaries
- Explicit missing-credential, 401, timeout, network, upstream, and invalid-response states
- No balance history, synthetic data, local token-cost estimates, or provider abstraction
Requirements
- DeepSeek Harness with the Web profile and the current profile-bundle system
- Node.js
^22.19.0 || >=24.0.0 - A
DEEPSEEK_API_KEYavailable through Harness credentials for live balance reads
Without a credential, the plugin still loads and shows the missing-credential state.
Install
From a local checkout:
dsh plugin --profile web add F:\path\to\dsh-balance-display
dsh --profile web --dump-config
dsh --profile web
From the prebuilt release tarball:
dsh plugin --profile web add .\dsh-balance-display-0.1.0.tgz
From the fixed v0.1.0 source tag:
dsh plugin --profile web add github:Liu-ty/dsh-balance-display#v0.1.0
Git installs fetch source and run this package's prepare build. pnpm may refuse that install until the profile's pnpm-workspace.yaml explicitly contains:
allowBuilds:
dsh-balance-display: true
This allowance permits package code to execute on the machine at install time, outside the agent sandbox. Review the source and pin a tag or commit before granting it. A release tarball contains prebuilt files and does not need build permission.
Configuration
The bundle inserts one Host/Client row:
- id: balance-display
name: dsh-balance-display
inject: [credentials, webServer]
config:
requestTimeoutMs: 10000
Override that entire row in the profile or home cordis.patch.yml to change the positive integer timeout. Auto-refresh interval and collapsed state are browser-local preferences; the plugin stores no balance values.
Security model
- The Host resolves the credential once per balance operation and does not cache it.
- Authorization is added only to the outgoing DeepSeek request.
- Non-success bodies from DeepSeek are never forwarded or logged.
- Successful bodies are parsed against the documented field set and reduced to camel-cased display values.
- Host responses use
Cache-Control: no-store. - The plugin has no model-visible input or token-accounting integration.
Development
pnpm install
pnpm run typecheck
pnpm run test
pnpm run build
pnpm pack
Tests cover route disposal, Client slot and locale disposal, timer/listener cleanup, response validation, explicit UI states, and secret non-disclosure. A real Cordis composition smoke mounts and disposes the built Host entry.
License
安装
装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:
dsh plugin add dshbase-catalog 然后对 agent 说「帮我装 dsh-balance-display」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。
该插件是 GitHub 源码(未发 npm)——直接从仓库装:
Web profile:
dsh plugin --profile web add github:Liu-ty/dsh-balance-display Headless(CLI)profile:
dsh plugin --profile headless add github:Liu-ty/dsh-balance-display 实测报告
验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。
使用场景
给 agent 网络能力——请求、API、代理或协议——让它能触达外部系统。
适合谁
任务涉及网络的人——调 API、抓资源或与远端服务通信。
二次开发建议
适配器和请求整形是缝——加协议、鉴权处理器、重试和端点抽象。