dsh-api-balance

DSH PLUGIN通知与集成

仓库 Muzi1015/dsh-api-balance

通知与集成 L5 · 运行验证通过 安全审查:低风险 可信度:金 可安装插件
安装这个插件

DeepSeek harness 内置余额显示

一句话选型结论

按资料字段整理

dsh-api-balance 是通知与集成类的 DSH 可安装插件,验证等级 L5 · 运行验证通过,安全审查为低风险,有可直接复制的安装命令。验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么;涉及密钥或系统权限的,建议先在隔离环境试装。

分类通知与集成 收录类型可安装插件 验证等级L5 · 运行验证通过 安全审查低风险
验证等级 L5 L5 · 运行验证通过
GitHub 星标 0 复刻 未标注 · 未关闭 issue 未标注
最近更新 2026-10-22 创建于 未标注
README 9.7 KB 正文体量,越大说明说明书写得越细

安装

可安装插件
在 DSH 里执行,装完用 dsh plugin list 确认已挂上;标了 L4 / L5 的命令已在沙盒里真实跑通
dsh plugin --profile web add github:Muzi1015/dsh-api-balance
  1. 1
    确认版本与运行环境

    仓库没有标注兼容版本与 Node.js 要求,先确认你的 DSH 版本能装,再继续。

  2. 2
    执行安装命令

    在 DSH 里执行上面的命令;多包仓库要注意区分具体子包名,别装错包。

  3. 3
    确认已挂载

    用 dsh plugin list 查看列表里是否出现这个插件,出现即挂载成功。

  4. 4
    试跑并检查权限

    加载后跑一个最小用例,确认它能正常工作;同时看它申请了哪些文件、命令或网络权限。

兼容 DSH 版本未标注版本不匹配时安装会报错
Node.js 要求未标注来自仓库 package.json 的 engines 字段
前置依赖无需要同时安装的同级依赖
npm 包名未发布到 npm可用 npm view 查看包信息

能做什么

通知与集成
字段来自项目仓库与公开索引,中文说明由本站标注

适用场景

通知

验证等级与安全审查

L5 · 运行验证通过
自动化流程结论,不是人工审核
验证等级L5 · 运行验证通过在 dsh 沙盒中完成安装与运行冒烟——装得上、跑得起来
安全审查低风险静态分析结论,未标注不代表已通过审查
仓库健康度活跃按仓库活跃度与最近更新时间给出
可信度金综合仓库活跃度与验证结果

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 验证等级 L5:安装和运行都在沙盒里跑通过,装完能直接用的概率高。
  • 静态安全审查为低风险,没有发现明显可疑行为。
  • 有可直接复制的安装命令,不用自己翻文档找入口。

先想清楚的地方

  • 没有声明 Node.js 版本要求,版本不匹配可能装不上。
  • 验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么。

更适合

  • 需要在通知与集成场景里给 DSH 补能力的人。
  • 想装完就能用、不想自己排依赖的人。
  • 能接受在本地装依赖、愿意自己确认权限的人。

不太适合

  • 只使用 DSH 官方内置能力、不接受第三方插件的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
插件验证等级安全审查星标兼容版本安装命令
dsh-api-balance当前 L5 · 运行验证通过 低风险 0 未标注 有
treg L3 · 安装规范通过 低风险 4,976 未标注 无
dsh-purge 未做沙盒验证 未标注 3,412 未标注 有
dsh-im L5 · 运行验证通过 低风险 1,837 0.1.7-rc.2 等 10 个 有
dsh-aurabot-qq 未做沙盒验证 未标注 633 未标注 有
dsh-dafeiyu L5 · 运行验证通过 低风险 425 0.1.7-rc.2 等 10 个 有

仓库档案

通知与集成
字段来自项目仓库与公开索引,中文说明由本站标注
作者 / 维护方Muzi1015仓库 dsh-api-balance · 默认分支 未标注
分类通知与集成notify
收录类型可安装插件声明了 dsh.bundle、可用 dsh plugin add 安装的条目
开发语言未标注仓库主语言
许可证Unlicense商用或二次分发前请确认条款原文
星标 / 复刻 / issue0 / 未标注 / 未标注收录时的数值,非实时
创建 / 更新未标注 · 2026-10-22最后推送 未标注
本站收录2026-10-30首次进入本站目录的时间

README 全文

9.7 KB
作者原文,中文版优先;只做安全转义,不改内容

dsh-api-balance

> DeepSeek Harness 内置余额显示 · npm: dsh-api-balance-plugin

A DeepSeek Harness plugin bundle that keeps your DeepSeek
API balance in sight: a resident pill under the composer, a click-through detail popover, a /balance command,
and an api_balance tool the agent can call on its own.

> This is a Harness plugin (a Host half + a browser half + a bundle patch), not a model-facing skill.
> Installing it adds real UI and a real tool to the Harness; a skill only adds instructions to the prompt.

中文说明 · Install · Configuration · How it works · Privacy · Limitations


Features

  • Resident pill in the composer dock, beside the built-in activity and usage entries: ¥128.40. It refreshes on
    its own and never needs a click to stay current.
  • Detail popover on click: total balance, topped-up credit, granted credit, the update time, and links to the
    Platform pages for usage detail and top-up.
  • /balance command: type it in the composer and the balance lands in the conversation as a plain text row.
    Nothing is sent to the model and no tokens are spent.
  • api_balance tool: ask the agent “how much credit is left?” and it reads the same values.
  • Both credential styles: a signed-in DeepSeek account (wallet balances from the account grant) or a plain
    DEEPSEEK_API_KEY. It picks whichever you actually have.
  • Theme- and locale-aware: only --dsw-alias-* tokens are used, and the copy follows the active UI language
    (English and Chinese are bundled).

Requirements

Requirement Notes
DeepSeek Harness >= 0.2.1-rc.2 Tested against 0.2.1-rc.2 (desktop and web).
A credential A signed-in DeepSeek account in the app, or the DEEPSEEK_API_KEY credential reference.
A DeepSeek account Other providers do not expose a balance endpoint; see Limitations.

Install

From npm — ask your agent:

> Install the dsh-api-balance-plugin plugin bundle.

That runs Plugin Manager's install_bundle with the package name, links it into your profile, and enables it; the app's
Settings → Plugins area accepts the same name. Reinstalling the package is how an upgrade lands.

From this repository — clone it and install the directory (handy while trying a local change):

git clone https://github.com/Muzi1015/dsh-api-balance.git

> Install the plugin bundle at /dsh-api-balance.

Both routes survive restarts because the bundle is recorded in your profile, not in a session.

Configuration

Two knobs, both with safe defaults. Override them by targeting the row id api-balance in your profile patch layer
(~/.dsh/profiles//cordis.patch.yml). A matching override replaces the whole config, so repeat every
key you still want:

- id: api-balance
name: 'dsh-api-balance-plugin'
config:
refreshSeconds: 120
lowBalance: 20
Key Default Meaning
refreshSeconds 60 How often the Host re-reads the balance (clamped to 15–3600). The pill polls the Host at the same rate.
lowBalance 5 Below this amount the pill switches to the warning tone and the popover adds a low-balance note. 0 disables it.

Usage

Surface What happens
Composer dock ¥128.40 with a state dot. Green = available, amber = low balance or a failed read, grey = unavailable.
Click the pill Popover with 总余额 / 充值 / 赠送, update time, 用量明细 and 去充值 links, plus an Esc-to-close dialog and a manual refresh button.
/balance A command row with the same numbers; errors (no credential, 401, timeout) print their reason.
Agent tool api_balance with an optional fresh flag to bypass the Host cache.

The popover reads through the Host, so the API key never reaches the browser: the page only ever sees amounts.

Data & privacy

  • The Host reads ctx.deepseekAccount.getBalance() when an account grant is stored; otherwise it resolves the
    DEEPSEEK_API_KEY credential reference (provider store first, then the ambient environment) and calls
    GET https://api.deepseek.com/user/balance.
  • The browser receives a JSON snapshot of amounts only — no token, no key, no profile.
  • The snapshot route is GET /plugin/api-balance/snapshot, same-origin guarded (a cross-site sec-fetch-site
    is answered with 403; other methods get 405). It is registered on the local Harness web server only.
  • The Host caches one snapshot for refreshSeconds so several surfaces never multiply upstream calls.
  • Nothing is written to disk by this plugin; it keeps no history and sends no telemetry.

Limitations

  • DeepSeek only. The plugin reads the DeepSeek Platform wallet. OpenAI, Anthropic and most other providers do not
    publish a balance endpoint, so a generic “balance” panel is not something one adapter can cover.
  • Balance, not itemized usage. The public API exposes the wallet, not a usage ledger, so “usage detail” is a link
    into the Platform page where you are already signed in.
  • Sign-in happens in the app. If you use an API key, that is all the plugin needs. Account wallets only appear when
    the Harness account sign-in is complete.
  • The pill needs a Web-surface client (the composer dock is a browser slot); /balance and the tool are Host-side and
    work wherever a composer or an agent exists.

How it works

File Role
index.js Host half: one read() shared by the HTTP route, the /balance command and the api_balance tool, with a TTL cache and upstream failure reporting.
client.js Browser half: a conversation.composer.dock entry that renders the pill and a fixed-position popover, polls the route, and follows ctx.locale.
cordis.patch.yml Bundle patch: inserts row api-balance with its default config.
locale/{en,zh}.json Plugin Manager title and description.
icon.svg Original artwork (circle + ¥), no third-party assets.

Registration points: ctx.webServer.register, ctx.commands.register, ctx.tools.register,
ctx.slots.inject('conversation.composer.dock'). Everything is registered through ctx.inject/ctx.effect, so
disabling the bundle removes the route, the command, the tool and the pill together.

Local development

npm run check          # node --check on both halves

The Host half is plain ESM and the browser half is plain JS registered through window.__ModuleLoader__, so there is
no build step. After editing, reinstall the directory (or restart the Harness) to pick up a fresh module generation.

Releasing a new version

1.0.0 is published to npm and tagged v1.0.0 on GitHub. For the next release:

npm version patch        # bumps package.json, commits and tags
git push --follow-tags
npm publish              # npm asks for the interactive confirmation / 2FA

The bundle you run locally is a link to this checkout, so a local edit needs only a reinstall; a published release is the
three lines above.

If you ever rename the package, change exactly three places — package.json name, the id in client.js, and the
name in cordis.patch.yml — and reinstall the bundle.

A screenshot of the pill and popover is the one asset this repository cannot generate on its own — add one to the
README before announcing it.

License

The Unlicense (public domain) — see LICENSE.


中文说明

这是什么:一个 DeepSeek Harness 插件包(Host 半 + 浏览器半 + bundle 补丁),不是 skill。装进 Harness 后会真实增加
UI 和一个工具;skill 只是给模型的提示词文本。

别人怎么用:让他的 agent 说「安装 dsh-api-balance-plugin 插件包」(install_bundle 会从 npm 拉取),或者在设置 →
插件里按包名安装;想试本地改动时,也可以 clone 仓库后直接安装那个目录。

他能看到什么:

  • 输入框下方常驻小胶囊,显示实时余额,点击展开「总余额 / 充值 / 赠送」、更新时间,以及「用量明细」「去充值」链接;
  • 在输入框输入 /balance,余额以文本行落在会话里,不发给模型、不花 token;
  • 对 agent 说「查下余额」,它会调用 api_balance 工具。

凭据:优先用 App 里已登录的 DeepSeek 账户钱包;没有登录就用 DEEPSEEK_API_KEY 凭据去查
https://api.deepseek.com/user/balance。浏览器只能拿到金额,拿不到 Key。

配置:在 profile 的 cordis.patch.yml 里覆盖 api-balance 行,refreshSeconds(默认 60,15–3600)和
lowBalance(默认 5,低于它胶囊变橙色)。注意覆盖会替换整份 config,两个键都要写。

限制:只支持 DeepSeek(其他厂商没有余额接口);只能看余额,明细跳平台页面;胶囊需要 Web 界面。

发布:已发布到 npm(dsh-api-balance-plugin@1.0.0,2026-10-20)和 GitHub(tag v1.0.0)。以后发新版:
npm version patch → git push --follow-tags → npm publish(npm 会要一次浏览器/2FA 确认)。改包名时只需改
package.json 的 name、client.js 的 id、cordis.patch.yml 的 name 三处,再重装一次即可。

常见问题

6 问
答案由本站依据条目字段整理,不引用上游原文
dsh-api-balance 怎么安装?

在 DSH 里执行 `dsh plugin --profile web add github:Muzi1015/dsh-api-balance` 即可。

dsh-api-balance 的验证等级是什么意思?

L5 · 运行验证通过。在 dsh 沙盒中完成安装与运行冒烟——装得上、跑得起来

dsh-api-balance 安全吗?

低风险。

dsh-api-balance 装之前要先确认什么?

先看它会读写哪些文件、执行哪些命令、连接哪些网络地址;验证等级只说明装得上、跑得起来,不等于安全。涉及密钥或系统权限的,建议先在隔离环境试装。

dsh-api-balance 用的是什么许可证?

上游标注为 Unlicense。商用或二次分发前请到仓库确认许可证原文。

这条记录的数据可靠吗?

本站按仓库名去重后合并整理,字段以作者仓库与 npm 元数据为准;安装命令、仓库地址与 README 保持原文,带 L4 / L5 标记的安装命令已在隔离沙盒里真实跑通。

同名或近似条目

8 条
不同作者的仓库分开列,请确认你要装的是哪一个
通知与集成
按星标排序,可作替代方案

treg

treg

Treg 是面向 Agent 工具的 OpenRouter,聚合 60 个提供商的 2896 个端点,按调用计费,统一令牌访问,无需注册各供

L3 · 安装规范通过 4,976 星

dsh-purge

dsh-purge

dsh-purge Community · DeepSeek Harness 社区维护版:宿主兼容、状态诊断、提示词管理、更新与本机备份回滚

未标注验证等级 3,412 星

dsh-im

dsh-im

将IM机器人接入DeepSeek Harness,支持飞书、微信、钉钉等九种渠道,通过扫码或凭据配置,统一管理多机器人连接。

L5 · 运行验证通过 1,837 星

dsh-aurabot-qq

dsh-aurabot-qq

让 DeepSeek Harness 里的 AI 以「大肥鱼」人格住进 QQ,通过 OneBot v11 网关聊天、发表情语音、写空间日记并

未标注验证等级 633 星

dsh-dafeiyu

dsh-dafeiyu

DSH 大肥鱼是一款由 DeepSeek Harness 真实工作状态驱动的桌面伴侣插件,以始终置顶的透明窗口实时展示 Agent 的思考、

L5 · 运行验证通过 425 星

dsh-trading

dsh-trading

L3 · 安装规范通过 235 星

插件的元信息来自作者仓库;分类、验证等级与安全结论的中文说明为中文整理,最近核验 —。