kingcharleslzy-ai / dsh-cost-balance-pro

Listed

The upstream repository does not provide a description.

mainOther View source

Installation

npx -y @deepseek-ai/dsh plugin --profile web add github:kingcharleslzy-ai/dsh-cost-balance-pro

This installation command is an unverified starting point generated from the GitHub repository address.

README

Maintainer-authored documentation snapshot.

View on GitHub ↗
Commit 09c0777Synced Aug 17, 2026

This README snapshot could not be refreshed during the latest directory sync.

dsh-cost-balance-pro

DSH 插件:输入框下方可见文字的会话花费/余额统计条,带设置页与一键还原。

能力

  • 折叠态直接显示 余额(¥)· 本次花费($),点击展开明细(缓存命中 / Token / 花费 / 余额)
  • 设置页(设置 → 插件 → 余额统计条):显示开关(余额/花费/命中率)、字号(10–16px)、颜色(跟随主题/灰色/自定义取色器)、一键还原
  • 配置持久化于 $DSH_HOME/dsh-cost-balance-pro.json,重启保留,保存后统计条即时刷新

设置页字段

字段类型默认值说明
showBalancebooleantrue折叠态显示余额
showCostbooleantrue折叠态显示本次花费
showHitRatebooleantrue展开面板显示缓存命中率
costCurrencyenumcny花费货币:cny 人民币 / usd 美元
balanceCurrencyenumcny余额货币:cny 人民币 / usd 美元
usdCnyRatenumber6.82USD→CNY 汇率(余额/花费换算用,官方峰谷价隐含值)
fontSizenumber12折叠态字号,限制 10–16
colorModeenumautoauto 跟随主题 / mono 灰色 / custom 自定义
customColorstring#8b5cf6colorMode=custom 时的文字颜色(#RRGGBB)

相对 dsh-cost-balance 的修复

  1. 槽位注册 id 改为唯一 cost-balance-pro,不再与官方统计栏冲突(原版同槽同 id 同 priority 会挂掉整个前端);
  2. ctx 经 props 传入组件(原版模块级裸 ctx 导致槽位条目渲染期 ReferenceError,药丸从未渲染成功);
  3. 折叠态从 5px 无字细线改为可见文字;
  4. 客户端工厂补上 return module.exports(缺失时加载器收到 undefined,插件静默失效);
  5. 客户端模块声明 exports.inject = ['timer']ctx.interval 需要 timer 注入)。

安装

dsh plugin --profile web add dsh-cost-balance-pro

装后重启服务一次(或下次登录),刷新页面即可看到统计条;样式去设置页调整。

模型定价(峰谷计费)

DeepSeek 自 2026-08-17 起执行峰谷计费:高峰 = UTC 01:00-04:00 与 06:00-10:00(北京 09:00-12:00 / 14:00-18:00),谷价为峰价一半。本插件按当前时段自动计价,折叠态显示 峰/谷 徽标(峰橙、谷绿),展开面板显示当前时段说明。

内置官方价(USD/1M):

模型时段缓存命中未命中输出
V4-Flash0.0140.441.32
V4-Flash0.0070.220.66
V4-Pro0.0441.323.96
V4-Pro0.0220.661.98

可在 profile 的 cordis.patch.yml 按 id 覆盖整行 config 传入 prices(结构 { 模型: { peak: {hit, miss, out}, offPeak: {...} } })。

开发

npm test          # 客户端契约测试(node:test)
npm pack --dry-run

发布:push v* 标签触发 GitHub Actions,经 npm OIDC trusted publishing 自动发布(带 provenance)。

License

MIT

Project files and signals

Shown items are public repository signals detected in the directory snapshot.

TestsDetected

Repository information

Language
JavaScript
License
MIT
Latest release
v0.1.6
Last updated
Aug 17, 2026, 8:31 AM

Install deliberately

Review source code, permissions, lifecycle hooks, dependencies and network access. Test untrusted plugins in an isolated environment.