dsh-damage-pulse README

The project's README from github.com/wssfk12138/dsh-damage-pulse. As one markdown file: README.md.

dsh-damage-pulse

dsh-damage-pulse 实时用量、鲸鱼娘、提醒规则、微信通知与安全更新功能总览

LINUX DO 社区认可 Fastai 模型赞助商

dsh-damage-pulse 是为 DSH(DeepSeek Harness)打造的 DeepSeek 用量、消费与余额监控插件。它按照官方计费规则记录每次调用,通过单次、会话和全局三个层级呈现 Token 与费用,并用鲸鱼娘的动态反馈把抽象的模型消耗变成一眼就能看懂的变化。

FastAI 官方图标 Fastai 模型赞助商
免费不意味着开发没有成本。感谢Fastai的赞助,让我能把功能留给所有用户,把广告留在应用之外。

如果你正在寻找稳定、实惠的 AI 模型中转服务,可以试试 Fastai,也可以先阅读中转站新手帮助文档了解中转站、倍率、计费和使用方式。你在 Fastai 中的每一笔消费都会让我获得一定数量的返利,我会把它转化为 Token,继续开发更多新项目并上传至 GitHub。当前所有项目均使用了 Fastai 提供的 GPT 模型参与开发。注册时填写优惠码:WSSFK,可以获得3$试用金。  Fastai 点击注册

功能总览

能力 你能看到什么
精准计费 按 provider、model、缓存类型和北京时间峰谷价格计算每次真实费用
三层用量展示 对话内单次明细、输入区会话累计、全局账户余额悬浮卡
历史统计 今日、近 7 天、近 30 天和全部历史的消费、请求与 Token 概览
余额与峰谷监控 官方余额定时校准、实时扣减、充值恢复及峰谷状态提示
鲸鱼娘动态反馈 待机、眨眼、扣费受击、缓存未命中、余额耗尽与充值复活
主动提醒 每日预算、峰谷切换、缓存命中异常和鲸鱼娘通知气泡
微信通知 在详细设置中登录、管理 ClawBot,并接收少女风业务提醒
安全更新 检查 GitHub Release,验证版本、来源与 SHA-256 后再安装

2026 年 9 月官方计价更新

精准计费与持久账本

三层用量与历史统计

余额、峰谷与悬浮交互

鲸鱼娘

鲸鱼娘是趴在余额悬浮卡上的桌面伙伴。她会用待机和眨眼动作陪你等待,并根据普通扣费、缓存未命中、连续消费、余额耗尽与充值恢复呈现不同反馈。扣费金额按事件顺序排队飘字,不同费用类型使用不同颜色与反馈强度;普通扣费保持轻量,不会频繁弹出气泡打扰工作。

鲸鱼娘啃手指待机原画
等待任务时:啃手指待机
鲸鱼娘严重扣费原画
缓存未命中时:严重扣费反应

提醒与微信通知

dsh-damage-pulse 通过 ClawBot 发送的微信通知实机截图

详细设置与安全更新

插件提供蓝粉双色的响应式详细设置面板,集中展示今日消费与历史统计,并可配置鲸鱼娘、每日预算、峰谷提醒、缓存异常、气泡和微信通知。设置更新使用 revision 防止多个页面互相覆盖,并兼容旧字段迁移。

更新面板可以打开项目主页、检查最新 Release、比较版本并下载安装包。安装前会校验 Release/tag 版本、资产名称、下载来源、重定向域名和 SHA-256,且只有识别到可安装 profile 时才执行安装。

架构

项目公开品牌为 dsh-damage-pulse。为兼容已安装用户,下列目录名、包名、API 路径、设置命名空间和本地存储键仍沿用 dsh-token-monitor / token-monitor,无需迁移已有配置与历史数据。

部分 位置 职责
Host 插件 plugins/dsh-token-monitor 计费资格、价格计算、持久账本、余额、统计、预算/峰谷/缓存提醒、微信与更新 API
Client 包 packages/client/ui-token-monitor 单次用量、会话累计、余额悬浮卡、鲸鱼娘动画、通知气泡和详细设置
微信能力 plugins/wechat-notify / ClawBot 连接状态、登录管理与消息投递;不可用时不会阻塞计费和余额监控

安装

本仓库从 0.2.0 起提供标准 DSH Host + Client 组合包和预编译产物。4.0.3 明确兼容 DSH Desktop 2.0.4(DSH 0.1.2-alpha.1),并继续支持 0.1.0-rc.5 之后的旧版兼容宿主(含 0.1.0-rc.6/rc.7/rc.8 与 0.1.1-rc.2)。无需复制源码、修改 DSH tsconfig、手动传入 --patch 或重建 Client bundle。

Desktop 2.0.4 不再提供旧的 @deepseek-ai/dsh-client-runtime 模块;4.0.3 已将该包从产品 peer 与 Client 注入图中移除,仅在开发环境保留旧宿主回归测试。

旧版或社区自行打包的 DSH 客户端应在其现有项目中沿用宿主自身的 lock 文件和依赖版本安装本插件。不要在一个新建的纯 npm 依赖树中把 rc.5/rc.6/rc.7 宿主包与当前 registry 的 rc.8 上游包混合钉定;这种组合会因上游 peer 版本漂移而解析失败,并不表示插件与原宿主不兼容。

dsh plugin --profile web add github:wssfk12138/dsh-damage-pulse

安装后重启 Web profile:

dsh --profile web

标准包提供余额悬浮栏、余额实时扣减、缓存命中/未命中动画、单次用量行和输入区会话累计。升级自早期源码集成版时,请移除原有手工 --patch 或重复挂载项,避免同一插件加载两次。

原生侧边栏会话金额(标准包能力)

左侧原生会话行金额属于标准包能力,标准包开箱即可提供,无需手工改宿主源码:

scripts/apply-sidebar-integration.ps1 保留为完整 DSH 源码部署的开发/历史兼容工具;标准包已自动显示金额时无需运行。如需在完整 DSH 源码上手工挂载,运行:

.\scripts\apply-sidebar-integration.ps1 -HarnessRoot 'C:\path\to\deepseek-harness'
$env:DSH_BUILD_FACE = 'client'
corepack pnpm --dir 'C:\path\to\deepseek-harness\packages\client\ui-workspace' exec tsdown

脚本会先备份三个目标文件,并以幂等方式读取 projectionValues.tokenCost.cost。上游结构不匹配时会停止,不会猜测写入。

源码开发

corepack pnpm install
corepack pnpm build
corepack pnpm run check:bundle

配置

API Key

通过 DSH 的 credentials 机制配置 DEEPSEEK_API_KEY(~/.dsh/.credentials.yaml),未配置时余额卡片显示引导态,token 计量不受影响。

价格表(可选覆盖)

价格表默认内置(见 src/pricing.ts),可通过 settings namespace dsh-token-monitor 的 priceTable 字段覆盖价格和工作日高峰时段。周一至周五默认按北京时间 9:00–12:00、14:00–18:00 为峰价,其余时间为谷价;周六、周日无论时段均按谷价。官方依据:模型与价格、图像理解 Token 用量。

HTTP 端点

端点 说明
GET /api/token-monitor/balance DeepSeek 账户余额(含 currency / 总余额 / 赠送余额)
GET /api/token-monitor/usage?sessionId= 用量明细历史(可过滤会话)
GET /api/token-monitor/usage-summary?range= 今日 / 7 天 / 30 天 / 全部时间的聚合统计
GET /api/token-monitor/charge-events?since=<seq> 严格递增的扣费事件流,驱动余额变化、飘字和受击动画
GET /api/token-monitor/notification-events?since=<seq> 预算、峰谷和缓存异常通知流
GET/PATCH /api/token-monitor/settings 带 revision 的统一设置读取与更新
GET /api/token-monitor/wechat/status 查询微信连接、认证、投递和短时登录会话状态;设置页“刷新”会重新请求此端点
POST /api/token-monitor/wechat/login 创建二维码登录会话
POST /api/token-monitor/wechat/login/confirm 确认当前二维码登录状态
POST /api/token-monitor/wechat/reconnect 重连由 DSH Host 管理的微信 bridge
POST /api/token-monitor/wechat/disconnect 经显式确认后断开由 DSH Host 管理的微信 bridge
POST /api/token-monitor/wechat/test 发送独立测试消息,不受业务微信通知总开关限制
GET/POST /api/token-monitor/update* Release 检查与受安全门禁保护的安装流程

微信通知兼容层

插件内置一个不注册 Cordis 工具的轻量 ClawBot 适配器,并按以下优先级选择通知 provider:新版外部 wechat-notify 能力对象 → 旧版 send() / status() 接口 → 内置适配器 → 不可用。任一时刻只会选择一个 provider;微信未登录、超时或发送失败不会阻塞余额监控、计费和鲸鱼娘动画。

如果用户已经安装独立 dsh-wechat-notify,本插件会复用它的发送能力;未安装时,只要设置 WECHAT_NOTIFY_CLAWBOT_INDEX,内置适配器即可开箱发送。该变量必须指向本机 ClawBot CLI 的入口文件,例如:

$env:WECHAT_NOTIFY_CLAWBOT_INDEX = 'C:\path\to\clawbot-cli\dist\index.js'
dsh --profile web

兼容层不迁移或删除原插件凭据,也不会重复注册 wechat_notify、扫码工具或 bridge。旧版接口若只能发送,状态面板会明确标注“发送可用,登录管理由原插件负责”。

常见问题

社区与反馈

欢迎在 LINUX DO 社区 交流使用体验、反馈问题和分享改进建议。插件的安装、运行和全部功能均不依赖任何中转服务或充值渠道。

许可证

MIT

赞助商简介
免费不意味着开发没有成本。感谢Fastai的赞助,让我能把功能留给所有用户,把广告留在应用之外。

本项目由 Fastai 赞助开发。Fastai 是低价实惠的模型中转站,覆盖 GPT / Claude 全模型,提供主流生图、视频模型。包纯度,实用耐蹬,支持开发票,支持企业学校长期合作。注册时填写优惠码:WSSFK,可以获得3$试用金。下图是我的账户使用记录,重度使用一个月,亲测好用。 Fastai 点击注册

Fastai 账户使用记录

Fastai 模型调用明细

dsh-damage-pulse (wssfk12138/dsh-damage-pulse)

Searching Database…

What is this?dsh-damage-pulse is a monitoring plugin for DSH (DeepSeek Harness) that tracks DeepSeek API token usage, cost, and account balance, showing per-call billing, session totals and a global balance card, with a whale-girl mascot animating each charge event.
Is this a standalone app or a plugin for something else?It is a plugin that ships as a standard DSH Host + Client bundle and runs inside a DSH-compatible host (such as DSH Desktop), rather than being a separate application.
How do I install and activate it?Install the standard Host + Client package, which is compatible with DSH Desktop 2.0.4 and several older rc hosts; no manual source copying, tsconfig edits, --patch flags, or Client bundle rebuilds are needed, just restart the target Web profile after installing.
Do I need a DeepSeek API key to use it?Yes, you configure DEEPSEEKAPIKEY through DSH's own credentials file (~/.dsh/.credentials.yaml); if it's missing, the balance card just shows a guided empty state while token metering keeps working normally.
Does mixing old and new DSH host packages cause problems?Yes, pinning an rc.5/rc.6/rc.7 host package together with the current rc.8 upstream package in a freshly built npm dependency tree fails to resolve because of upstream peer-version drift; this doesn't mean the plugin is actually incompatible with those hosts.
Does this plugin depend on any third-party relay or billing service to work?No, installation, operation and every feature of the plugin work directly against your own DeepSeek account without needing any token relay or top-up channel; the sponsor mentioned in the README is unrelated to the plugin's core functionality.
What is the whale girl mascot?She sits on the balance card, idling and blinking while you wait, then reacts with different charge animations for normal billing, cache misses, continuous spending, balance exhaustion and top-up recovery.
How does peak/off-peak pricing work?Weekday 09:00-12:00 and 14:00-18:00 Beijing time count as peak pricing with higher rates, all other times and all weekend hours are off-peak; the status badge refreshes every 30 seconds, shown red for peak and green for off-peak.
Can I override the default pricing table?Yes, the built-in price table can be overridden via the priceTable field in the dsh-token-monitor settings namespace, letting you set custom prices and peak-hour windows; the plugin host needs restarting after a change.
What HTTP endpoints does the plugin expose?It exposes REST endpoints for account balance, usage history, usage summaries, charge/notification event streams, settings, WeChat login/status and update checks, e.g. GET /api/token-monitor/balance and GET /api/token-monitor/usage-summary.
Creator
wssfk12138
Size
57.6 MB
Stars
271
Age
2mo
Commits · 90 Days