
Security News
Deno Goes the Way of the Dinosaur
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.
dsh-plugin-balance
Advanced tools
DeepSeek / OpenCode Go / OpenAI 额度悬浮窗:输入框上方显示,支持 DSH 模型列表同步、自定义额度接口、可拖动、主题适配;内置 DSH 会话 token 用量统计(按 日/月/模型)与官方峰谷价费用估算。
简体中文(默认) · English README
dsh-plugin-balance 是一个 DSH(DeepSeek Harness)Web 插件,在输入框正上方显示一个小悬浮窗,可以:
悬浮窗可拖动、自动适配亮/暗主题,折叠成小胶囊后仍保留刷新按钮。
① 动画演示 —— 悬停展开 / 移开收起(弹簧动画),直观感受交互

② 用量明细 —— OpenCode Go 5h / 每周 / 每月 用量与重置时间

③ Token 用量统计 —— 今日 / 本月 / 总共 + 最近 7 天柱状图 + 按模型统计 + 费用估算

④ 实际效果 —— 对话框内的悬浮窗

⑤ 余额类型 —— 自动识别 DeepSeek 官方余额 / 套餐(OpenCode Go)用量

| 模块 | 说明 |
|---|---|
| 账户类型 | DeepSeek 官方(/user/balance)、OpenCode Go(经宿主代理查 /usage)、OpenAI credit_grants,或从 DSH 模型列表同步的自定义额度接口 |
| OpenCode Go 展示 | 主行显示 5h / 每周 / 每月 百分比徽章;折叠胶囊只显示百分比;明细面板带重置时间 |
| Token 用量 | 今日 / 本月 / 总共 的 token 数、最近 7 天迷你柱状图、按模型拆分(入 / 出 / 缓存命中) |
| 费用估算 | ≈¥ 徽章(官方价:DeepSeek 峰谷=空闲×2,北京 9:00–12:00、14:00–18:00;Kimi K2/K3、GLM 4.x/5.x 恒价;非人民币官方价按汇率 7.2 折算) |
| 交互 | 可拖动并记住位置、点外部折叠、适配主题、胶囊内也有刷新按钮 |
插件已发布到 npm(dsh-plugin-balance)并带 dsh.bundle manifest,可直接用 DSH 标准插件命令安装:
dsh plugin add dsh-plugin-balance # 默认 profile
# 或显式指定 Web profile:
dsh plugin --profile web add dsh-plugin-balance
该命令会解析 npm 包、写入 bundle 条目并启用插件。重启
dsh web(或热重载)后刷新浏览器页面即可。
本插件已收录进 awesome-dsh-plugin 目录并上架 dsh-market——DSH 设置页内置的插件市场。安装 dsh-market 后,在 设置 → 插件市场 搜索 dsh-plugin-balance 即可一键安装 / 升级:
dsh plugin --profile web add dshmarket
如果自己管理 profile(如离线环境 / 无 dsh CLI):
在 Web profile 的 package.json(如 ~/.dsh/profiles/web/package.json)中加入依赖(可用 npm 版本、tarball 或本地路径):
"dependencies": {
"dsh-plugin-balance": "^1.3.6"
}
在 cordis.patch.yml 中启用(包内已自带同样内容的 cordis.patch.yml):
- insert:
- id: plugin-balance
name: dsh-plugin-balance
安装并重启:
cd ~/.dsh/profiles/web
pnpm install
# 重启 `dsh web`,然后刷新浏览器页面
需要
webServer与credentials服务(web profile 的@deepseek-ai/dsh-web-app已提供)。主进程半依赖credentials、webServer、llm、settings、sessions。
点击开关按钮打开设置:
DEEPSEEK_API_KEY),也可在浏览器填写(存于 localStorage);支持自定义 /user/balance 基地址。OPENCODE_GO_API_KEY(缺省回退 OPENCODE_API_KEY)。baseURL 与 apiKeyEnv),或手动填;密钥由宿主解析,不会发给浏览器。点击柱状图按钮打开「TOKEN 使用量」面板:今日 / 本月 / 总共 + 最近 7 天柱状图 + 按模型统计 + 费用徽章。
主进程半监听 DSH 会话事件流(session/event),把每次请求上报的 token 用量(未命中输入 + 缓存写、缓存命中、输出)按 日期 / 月份 / 模型 折叠累计,并持久化到 ~/.dsh/storages/dsh-plugin-balance-usage.json。
turn:step 的新样本替换旧样本;重载 / 重启后重放日志不会重复计数。request/header 精确记录(会话中途切换模型也不会归错桶)。GET /api/dsh-plugin-balance/tokens。version 9:旧版数据不再估算折算,而是从会话事件流(含磁盘归档日志)精确重放重建。FAQs
DeepSeek / OpenCode Go / OpenAI 额度悬浮窗:输入框上方显示,支持 DSH 模型列表同步、自定义额度接口、可拖动、主题适配;内置 DSH 会话 token 用量统计(按 日/月/模型)与官方峰谷价费用估算。
The npm package dsh-plugin-balance receives a total of 284 weekly downloads. As such, dsh-plugin-balance popularity was classified as not popular.
We found that dsh-plugin-balance demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.

Security News
Anthropic’s free OSS Scanner uses Mythos and other Claude models to find open source vulnerabilities and send maintainers reports with proposed fixes.

Security News
On Front Lines’ Early Adopters: CISO podcast, Andrew Becherer shares lessons from Datadog, weighs the long-term costs of AI-built tools, and explains how founders can actually gain a CISO’s trust.