x2802490130-prog/dsh-balance-float

Plugin插件 Native原生 ⭐ 5 MIT Usage & Cost用量与计费

DeepSeek Harness(DSH)Web 插件:在网页右上角显示一个悬浮窗,实时显示 DeepSeek 模型账户余额,支持手动刷新与一键优雅退出(Y/N 快捷键确认)。

catalog descriptioncatalog 简介 / catalog description:DSH 悬浮余额/一键退出插件

Project Overview项目介绍

This is a native plugin built exclusively for DeepSeek Harness (DSH). It adds a floating window to the top-right corner of the DSH web interface that displays your current DeepSeek API account balance in real time. The plugin automatically refreshes the balance every 60 seconds, and also supports manual refresh with a single click of the refresh button on the window. There are three different methods to install the plugin: installing via npm, installing directly from GitHub, and adding a local link for development testing. After installation, you just need to restart DSH or hard refresh the page to see the floating window.

The plugin comes with a graceful exit feature that lets you shut down DSH with one click. When you click the exit button on the floating window, a confirmation prompt will pop up, and you need to press Y on your keyboard to confirm the exit. If you press N or Esc, the exit action will be canceled. Once you confirm exit, the plugin will close both the local DSH service and the DSH web page at the same time, which avoids leaving unnecessary background processes running after you finish using DSH.

To work properly, the plugin reads your DeepSeek API Key in a specific order: first from the environment variable, then from the DSH credentials configuration file. The API Key is only used to query your account balance, and will never be exposed in any web response from DSH. The plugin is open source under the MIT license, and it is written in pure JavaScript with no build steps required after installation. For development and testing, you can add the optional jsdom dependency to run regression tests that work even offline.

这是一款专为 DeepSeek Harness(DSH)开发的原生网页插件,会在DSH网页界面右上角添加一个悬浮窗,实时展示DeepSeek模型账户的余额信息,支持每60秒自动刷新余额,也可点击按钮手动刷新,还提供一键优雅退出功能,退出时需要通过键盘快捷键确认。插件支持三种安装方式,分别是npm官方安装、GitHub直装和本地开发链接安装。

安装完成后重启DSH或硬刷新网页,即可在右上角看到悬浮窗。点击悬浮窗主体可展开查看余额明细,包括总余额、赠送余额、充值余额和上次更新时间;点击刷新按钮可立即更新余额;点击退出按钮会弹出确认框,按Y确认退出,按N或Esc可取消退出,确认退出后会同时关闭本地DSH服务和网页。

插件会按环境变量、DSH配置文件的顺序读取DeepSeek API Key,API Key仅用于余额查询,不会出现在网页响应中。本插件采用MIT许可开源,纯JavaScript开发无构建步骤,直装即可使用,不需要额外构建依赖。开发测试时可添加可选依赖jsdom运行回归测试,离线也可执行。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 5 stars - very few users, little community feedback星标只有 5,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add dsh-balance-float

把 x2802490130-prog/dsh-balance-float 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-balance-float

DeepSeek Harness(DSH)Web 插件:在网页右上角显示一个悬浮窗,实时显示 DeepSeek 模型账户余额,支持手动刷新与一键优雅退出(Y/N 快捷键确认)。

环境要求

  • 已安装 DeepSeek Harness CLI:npm install -g @deepseek-ai/dsh
  • 已配置 DeepSeek API Key(用于余额查询;未配置时悬浮窗显示「获取失败」红点,不影响其他功能,Key 配置方式见下文)

功能

  • 实时余额:悬浮窗每 60 秒自动刷新,展示总余额 / 赠送 / 充值明细
  • 手动刷新:点击 ↻ 按钮立即刷新
  • 一键退出:点击 ⏻ 弹出确认框,按键盘 Y 确认退出(关闭本地服务与网页),N / Esc 取消
  • 退出即关闭:退出后本地 DSH 服务与 http://127.0.0.1:3080 网页一并关闭

安装

方式一:npm(推荐)

dsh plugin --profile web add dsh-balance-float

方式二:GitHub 直装

dsh plugin --profile web add github:x2802490130-prog/dsh-balance-float

本插件为纯 JavaScript 发布(无构建步骤),git 直装即可使用,无需 pnpm 构建许可(见官方 publish.md)。

方式三:本地链接(开发 / 尝鲜)

dsh plugin --profile web add link:/path/to/dsh-balance-float

安装后重启 dsh(或硬刷新网页 Ctrl+F5),右上角即出现悬浮窗。

使用

操作 效果
点击悬浮窗主体 展开余额明细(总 / 赠送 / 充值 / 更新时间)
点击 ↻ 立即刷新余额
点击 ⏻ 弹出退出确认框
键盘 Y 确认退出(本地服务与网页一并关闭)
键盘 N / Esc 取消退出
再点 ⏻ 关闭确认框

配置

插件读取 DeepSeek API Key,查找顺序:

  1. 环境变量 DEEPSEEK_API_KEY
  2. $DSH_HOME/.credentials.yaml
  3. %USERPROFILE%/.dsh/.credentials.yaml(Windows)
  4. $HOME/.dsh/.credentials.yaml

credentials 文件格式:

DEEPSEEK_API_KEY: sk-xxxx

API Key 仅用于服务端请求,永远不会出现在网页响应中。

HTTP 接口

方法 路径 说明
GET /api/dsh-balance 余额查询(60 秒缓存)
POST /api/dsh-exit 优雅退出:SIGINT 关闭 dsh,6 秒兜底强杀

两个接口都只挂在本地 dsh 服务上,不对外暴露。

开发与测试

npm i -D jsdom   # 可选:测试依赖
node test.mjs    # 回归测试(宿主路由 + jsdom 客户端交互,离线可跑)

目录结构

lib/index.js        宿主(HTTP 路由:余额 / 退出)
client/client.js    客户端(悬浮窗 UI 与交互)
cordis.patch.yml    bundle 补丁
test.mjs            回归测试
windows/            可选:Windows 隐藏窗口启动 / 停止脚本 + 默认图标(覆盖 icon/dsh.ico 即可替换)

License

MIT

← 上一个 Prev dsh-plugin-uisfx 下一个 Next dsh-screenshot →