MeteorNOX/DeepSeek-Balance-Whale-Widget

插件Plugin ⭐ 250 other

DeepSeek Harness(DSH)一只住在 DSH 界面右下角的小鲸鱼娘,帮你盯着DeepSeek账户余额。QQ弹弹,支持拖拽吸附、左吸附翻转、数字滚动动画,随界面自动启用,建议直接喊来你的dsh安装

编辑导读Editor's Brief

## 核心特性
- 该插件会在 DSH Web 界面右下角添加一个常驻鲸鱼小组件,并在界面打开时自动启动。
- 它会显示 DeepSeek API 余额,支持每 60 秒自动刷新、点击鲸鱼手动刷新,并在余额变化时播放数字滚动动画。
- 它可通过本地余额差额记账方式显示当日用量(无需 platform token),也可通过 platform token 模式基于平台用量 API 计算当日用量。
- 该小组件支持拖拽和边缘吸附、吸附到左侧时水平镜像、根据窗口缩放,以及带可选音效的按压动画。
- 悬停菜单提供 0.6 到 2.5 倍缩放调节、声音开关、音量控制、音效集选择和用量模式选择,并会记住尺寸设置。

## 使用场景
- 用户可以在 DSH Web 界面中工作时持续查看 DeepSeek 余额和当日用量。
- 用户无需 platform session token,也可依靠本地用量文件中记录的余额差额来跟踪每日消耗。
- 用户可以通过为平台用量接口提供 platform session token,来计算按高峰和低谷计费的当日用量。
- 用户可以根据浏览器布局偏好,通过拖拽、吸附和悬停菜单来重新定位、调整大小并静音该小组件。

## 技术细节
- 该包是一个 DSH bundle 插件,可通过 dsh plugin 命令安装和移除;本地开发可使用 link: 源路径或 npm 发布。
- 余额数据需要 DEEPSEEK_API_KEY 并调用 api.deepseek.com/user/balance;可选的实时用量需要 DEEPSEEK_PLATFORM_TOKEN 并调用 platform.deepseek.com/api/v0/usage/by_api_key/amount
- 该插件暴露了 /dsh-whale/image.png/dsh-whale/balance.json/dsh-whale/size.json 等本地端点,用于提供图片、余额数据和持久化的小组件设置。
- 资源包括鲸鱼使用的透明 PNG 和可选 MP3 音效文件;气泡由代码绘制,用量记录存储在 .dshw-usage.json 中。

## 注意事项
- 如果未配置 DEEPSEEK_API_KEY,余额显示会提示缺少凭据;基于 token 的用量功能需要单独配置 platform session token。
- 本地 link: 安装会存储绝对源路径,因此移动源目录后需要移除并重新添加插件。
- 音效文件为可选项,缺失文件会静默回退;使用 link: 时修改本地代码后,由于 ESM 缓存,需要重启 dsh web

## Core Features
- The plugin adds a persistent whale widget to the lower-right corner of the DSH Web interface and starts automatically when the interface opens.
- It shows DeepSeek API balance with automatic refresh every 60 seconds, manual refresh by clicking the whale, and a rolling number animation when the balance changes.
- It displays today's usage through either local balance-difference bookkeeping without a platform token or a platform-token mode that calculates usage from the platform usage API.
- The widget supports dragging with edge snapping, horizontal mirroring when snapped to the left side, window-based scaling, and press animation with optional sound effects.
- A hover menu provides scale adjustment from 0.6 to 2.5 times, sound toggles, volume control, sound-set selection, and usage-mode selection while remembering size settings.

## Use Cases
- Users can keep DeepSeek balance and daily usage visible while working in the DSH Web interface.
- Users can track daily consumption without a platform session token by relying on balance-difference observations stored in a local usage file.
- Users can calculate today's usage with peak and off-peak pricing by supplying a platform session token for the platform usage endpoint.
- Users can reposition, resize, and mute the widget through dragging, snapping, and the hover menu according to browser layout preferences.

## Technical Details
- The package is a DSH bundle plugin installed and removed through dsh plugin commands, with local development using a link: source path or npm publication.
- Balance data requires DEEPSEEK_API_KEY and calls api.deepseek.com/user/balance, while optional real-time usage requires DEEPSEEK_PLATFORM_TOKEN and calls platform.deepseek.com/api/v0/usage/by_api_key/amount.
- The plugin exposes local endpoints such as /dsh-whale/image.png, /dsh-whale/balance.json, and /dsh-whale/size.json for image delivery, balance data, and persisted widget settings.
- Assets include a transparent PNG for the whale and optional MP3 sound files, while speech bubbles are drawn by code and usage records are stored in .dshw-usage.json.

## Notes
- If DEEPSEEK_API_KEY is not configured, balance display reports the missing credential, and token-based usage requires a separately configured platform session token.
- Local link: installations store an absolute source path, so moving the source directory requires removing and adding the plugin again.
- Sound files are optional and absent files cause silent fallback, while local code changes with link: require restarting dsh web because of ESM caching.

安装Install

dsh plugin --profile web add dsh-whale-widget

MeteorNOX/DeepSeek-Balance-Whale-Widget 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

上一个 Prev whale-girl 下一个 Next dsh-pet