DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

Usage Info — DeepSeek Harness 插件(DSH Plugin)
← Plugins
U

@achasoft/dsh-usage-info

Usage Info

DeepSeek Harness Web Client 的上下文占用率和账户余额:会话标头读数、余额能力接口,以及 DeepSeek 提供商

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add github:navid-kianfar/dsh-usage-info#52fb93fa1d7a2001fd51f5878fa1ce5d947e8aeb
README兼容性版本

兼容性与来源证明

Usage Info 以 @achasoft/dsh-usage-info 发布,当前版本为 0.3.0。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
web
发布来源
github
Registry 更新时间
2026/9/15

版本

0.3.0stable
2026/9/15
0.1.0stable
2026/8/26

相关插件

正在加载相关插件…

最新版
0.3.0
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
未提供
文件数
未提供
Surface
web
许可证
MIT
发布源
github
GitHub
★ 0
周下载
0
最近提交
2026/9/15
查看源码 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题
DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录

相关插件

继续浏览 models-usage 分类下经过校验的插件。

Usage@linxin666/dsh-usage用于 dsh Web GUI 的使用统计插件:检测各提供商的余额和编码计划配额,并提供实时令牌使用记录,同时在侧边栏条目中显示当前会话提供商今日的使用量Usage Stats@ychris12138/dsh-usage-statsdsh Web GUI 的令牌使用热力图、提供商余额和订阅配额Codex Connectdsh-codex-connect用于 DeepSeek Harness 的 ChatGPT OAuth 和 Codex 模型。Ui Usage Billing@kenz1117/dsh-ui-usage-billingDeepSeek Harness 的用量计费仪表板:侧边栏成本指标和完整的仪表板模态窗口,依据当前多提供商目录定价,并汇总会话日志中的实际用量。

README

@achasoft/dsh-usage-info

A session-header readout for the DeepSeek Harness (dsh) Web Client. It shows how full the model's context window is, what the current session has cost at the rates you configure, and what your provider account currently holds. Context and cost are computed in the browser from token figures the harness already publishes. The balance is read on the host, so the API key never reaches the browser.

Usage panel open below the gauge button in the session header, before the first billed request: context and cost pending, and the balance section showing a rejected-key error with a retry button

Features

Header readout

A button in the session header's utilities area. It shows a ring with the context percentage once the session has made a request, and the first currency of the account balance once a reading has landed. Until either exists it shows a gauge icon, with an amber dot when the balance cannot be read (for example on a default install with the provider disabled). The button turns to a warning colour when that balance is at or below lowBalanceThreshold. Click it to open the usage panel; click outside or press Escape to close it.

Usage panel

SectionWhat it shows
ContextPercent used, ~used / window tokens, a bar split into system prompt, tool definitions and conversation, and a note that the parts are estimates. Before the first request: "Shown after the first request".
Session costThe session's cost in costCurrency, the total token count, and one row per bucket: uncached input, cache write, cache read, output. Before anything has been billed, the token count reads "—" and the section says "Shown once a request has been billed".
BalanceEach currency's total, with granted and topped-up portions when the provider separates them, the reading's age ("Just updated", "3 min ago"), and a refresh button that asks the provider immediately. It also warns when the account is suspended or the balance is low, and shows a one-line reason when the balance cannot be read.

How the figures are made:

  • Context percent is the provider's last reported prompt size, adjusted for what the conversation gained or lost since then (a compaction lowers it right away). The three coloured parts use the harness token meter's fixed estimate, so read them as proportions. They will not add up to the total.
  • Session cost sums every billed attempt in the session log, retries included. It is (uncached input + cache write) x input + cache read x cacheRead + output x output, per one million tokens, calculated in exact decimal arithmetic. Cache writes are charged at the input rate. The figure is an estimate. Your provider's bill is the authority.
  • Balance figures are the exact decimal strings the provider sent. They are never converted to floating point.

Balance states

When the balance cannot be shown, the Balance section says why, and the poll either keeps trying or stops:

StateLine shownPolling
No provider mounted (default install)no balance provider is mounted; enable one, or hide the balance in settingsChecks every interval for a newly mounted provider
Provider mounted, no API keyno API key for the balance provider; this retries once one is storedKeeps polling, so a key stored later is picked up without a reload
Endpoint returns 404this endpoint publishes no balance; hide the balance in settingsStops. A settings change asks again
401 or 403the balance endpoint rejected the API keyKeeps polling
408 or 504, or the provider's own timeoutthe balance endpoint timed outKeeps polling
429, 5xx, or unreachablethe balance endpoint is unreachableKeeps polling
Any other status, or a malformed bodycould not read the balanceKeeps polling

Settings card

Open Settings > Plugins > Plugin configuration and expand Usage information. The card shows which balance provider is mounted, its endpoint, and a Ready or Not ready badge. It also has switches for the three sections, the refresh interval in seconds, the low-balance threshold, the cost currency, and the three rates.

There is no Save button. A switch or text field is saved as soon as it holds a valid value. The refresh interval is saved on blur or Enter, and it is refused if it is shorter than the host's cache window (cacheTtlMs, 240 s by default). If the host refuses a change, the field says "Not saved: the host refused this change." Changes reach open sessions without a reload.

Usage information settings card expanded, with provider status, switches, refresh interval, threshold, currency and rates

Requirements

  • dsh with the Web Client. This version was tested against dsh 0.1.5-rc.2.
  • Node.js ^22.19 or >=24, as declared in engines.
  • pnpm on PATH. dsh plugin runs pnpm in the profile directory.
  • Context and cost need nothing more. They read the token-meter projections the harness already publishes.
  • The balance needs the bundled DeepSeek provider enabled (see Enable the balance) and a DeepSeek API key the host can resolve.

Supported balance provider

This package ships one provider, usage-info-deepseek. It calls DeepSeek's GET <baseURL>/user/balance with Authorization: Bearer <key>. The key comes from the harness credential seam, using the name given in apiKeyEnv (default DEEPSEEK_API_KEY, the same name the harness DeepSeek model adapter uses). With the harness's local credential store, the first source that has a value wins:

  1. the environment dsh was launched in,
  2. the stored credential file ($DSH_HOME/.credentials.yaml, where $DSH_HOME defaults to ~/.dsh),
  3. .env in the directory dsh was started from,
  4. $DSH_HOME/.env.

An OpenAI-compatible gateway in front of DeepSeek usually answers /user/balance with 404. The readout then shows the "publishes no balance" line and stops polling.

To read a different billing backend, implement the AccountBalanceProvider Service Definition exported from the package root, then mount your plugin instead of usage-info-deepseek. Only one provider can be mounted. If two claim ctx.accountBalance, loading fails.

Install

Install into the web profile (the one dsh web boots):

dsh plugin --profile web add @achasoft/dsh-usage-info

dsh plugin passes the arguments to pnpm in $DSH_HOME/profiles/web. Afterwards it adds the package to that profile's dsh.profile.bundles, because the package declares a dsh.bundle patch. Restart dsh web to load it.

Other sources work the same way, because pnpm resolves them:

dsh plugin --profile web add ./dsh-usage-info           # a local checkout, linked; run `npm run build` in it first
dsh plugin --profile web add ./achasoft-dsh-usage-info-0.1.0.tgz

Relative paths are resolved from the directory you run dsh in. A git install builds through the package's prepare script. pnpm blocks that script until you add the package under allowBuilds in the profile's pnpm-workspace.yaml. When the install fails, dsh plugin points you to the key pnpm printed.

Check the composed configuration without booting:

dsh --profile web --dump-config

The output contains a # == @achasoft/dsh-usage-info layer with the rows usage-info, usage-info-ui and usage-info-deepseek.

How the configuration layers

The composed tree is built in this order, and later layers win:

  1. each bundle's cordis.patch.yml, in dsh.profile.bundles order (this package's own patch is one of them),
  2. your profile's $DSH_HOME/profiles/web/cordis.patch.yml,
  3. $DSH_HOME/cordis.patch.yml,
  4. any --patch overlays.

A patch entry that targets a row by id replaces that row's whole config. It does not merge, so restate every key you want to keep. Values you change in the Settings card are stored separately as user overrides in the usage-info: section of the harness settings document ($DSH_HOME/settings.yaml by default). Those overrides apply on top of the composed row.

Uninstall

dsh plugin --profile web remove @achasoft/dsh-usage-info

This removes the package from the profile's bundles. Also delete any usage-info* rows from your profile's cordis.patch.yml. A patch that names a missing row only prints a warning, but it is dead configuration.

Enable the balance

The provider row ships disabled, because this package cannot know which endpoint or key name your deployment uses. Enable it in $DSH_HOME/profiles/web/cordis.patch.yml:

- id: usage-info-deepseek
  disabled: false
  config:
    baseURL: https://api.deepseek.com
    apiKeyEnv: DEEPSEEK_API_KEY
    timeoutMs: 15000

Restart dsh web. The settings card badge reads Ready once the key resolves. If it does not, the card shows no value for DEEPSEEK_API_KEY.

Configuration

usage-info (readout preferences)

KeyDefault in cordis.patch.ymlSchemaSettings card
showContexttruerequired booleanyes
showCosttrueboolean, defaults to trueyes
costCurrencyUSDstring, defaults to USD; must match ^[A-Z]{3}$yes
costRates.input'0.28'decimal string, defaults to '0.28'; non-negativeyes
costRates.cacheRead'0.028'decimal string, defaults to '0.028'; non-negativeyes
costRates.output'0.42'decimal string, defaults to '0.42'; non-negativeyes
showBalancetruerequired booleanyes
refreshIntervalMs300000required integer, >= 1000yes, in whole seconds
cacheTtlMs240000required integer, >= 0no
lowBalanceThresholdunset (commented out)optional decimal string; blank disables the warningyes
  • Rates are per one million tokens, written as exact decimal strings. The shipped values are, according to the patch comment, DeepSeek's deepseek-chat rates. Set them to the model you actually use.
  • showCost, costCurrency and costRates have schema defaults, so a restated usage-info row that omits them still loads with the values above. Every other required key must be restated.
  • cacheTtlMs must not exceed refreshIntervalMs. Loading fails otherwise, and so does a settings write that would break the rule.
  • refreshIntervalMs is how often each open tab polls. cacheTtlMs controls how often the provider is actually asked: every tab shares one host-side reading, and a poll inside the cache window is answered from it. The refresh button and changing a stored credential both skip the cache.
  • Turning showBalance off stops balance requests entirely.

usage-info-deepseek (balance provider)

KeyDefaultSchemaSettings card
disabledtruerow flagno
baseURLhttps://api.deepseek.comrequired string; one trailing slash is removedno
apiKeyEnvDEEPSEEK_API_KEYrequired credential reference: the key's name, never its valueno
timeoutMs15000required integer, >= 1no

RPC and model-facing surface

The browser uses two host methods on the usageInfo namespace:

MethodPurpose
describe()Whether a provider is mounted and ready, its endpoint, the visibility flags, rates, currency, refresh interval and threshold. Rates are omitted while showCost is off.
balance({ refresh })One balance reading, from the cache unless refresh is true. Failures come back as { ok: false, code, message } values rather than thrown errors.

Nothing is model-facing. The plugin adds no tool, no prompt text and no session event.

Privacy and security

  • The API key stays on the host. The provider resolves it per reading and never caches it. It is not part of any RPC response. describe() reports only whether the key is configured.
  • One outbound request type: GET <baseURL>/user/balance from the host, at most once per cacheTtlMs plus manual refreshes. Nothing else leaves the machine.
  • Context and cost are computed in the browser from session projections it already receives. They cause no extra requests.
  • The settings card shows the endpoint URL and, when the key is missing, the key's name. A failed balance() call's message can include up to 512 characters of the endpoint's error body. The readout itself shows only the fixed one-line reasons listed above.

Known limitations

  • A default install shows a "no balance provider" line. The provider row ships disabled. Enable it as described above, or turn off Show account balance in the settings card.
  • Only the first currency is shown in the header. Every currency is listed in the panel, and the low-balance threshold is compared against each amount in its own currency.
  • The cache window is not editable in the card. Change cacheTtlMs in your profile patch, or in the usage-info: section of the settings document.

Development

Development links against a deepseek-harness checkout two directories up (../../deepseek-harness, as set by the link: devDependencies in package.json):

workspace/
├── deepseek-harness/
└── dsh-plugins/
    └── dsh-usage-info/   <- this repository
pnpm install
npm test                 # Typert drift check, then vitest
npm run build            # tsc emit, then tsdown bundle into lib/
npm run check:typert     # only the Typert drift check
npm run typecheck        # tsc --noEmit over src, generated and tests

npm run typecheck resolves harness types from the linked checkout. A checkout older than the harness this plugin targets reports missing-type errors, such as usageInfo on TypertClientRemote or the contextPressure projection key.

generated/ holds the Typert RPC contract. Only the harness generator can produce it, so it is committed. npm test fails when it no longer matches the @Remote methods in src/host/. To regenerate it from a clean harness checkout (this takes several minutes, and must not run alongside another plugin's regeneration against the same checkout):

node scripts/regen-typert.mjs ../../deepseek-harness

License

MIT. See LICENSE.