Skip to content
dsh.fish
Bundle

dsh-deepseek-balance

DSH web plugin: show the DeepSeek API balance and today's estimated consumption in the sidebar footer next to Settings.

Source
qschen86
License
MIT
Updated
Updated 12 hours ago

Readme

# dsh-deepseek-balance

DeepSeek Harness Web 插件:在左侧 rail 底部显示 DeepSeek API 余额徽章与今日估算消耗,点击弹出详情面板。

## 功能

- **余额徽章**(`sidebar.rail.footer` 槽位):当前余额 + 今日消耗;余额 < 5 元变红
- **详情面板**:余额明细(CNY/USD)、今日消耗与 Token、近 30 天消耗曲线(本地快照差分)
- **自动刷新**:会话开始/结束回合时刷新;60s 缓存 + 单飞去重 + 服务端节流,失败回退最后快照(stale)
- **消耗统计**:基于会话日志增量扫描(水印 + liveness),不重放全部历史

## 安装

```bash
dsh plugin --profile web add dsh-deepseek-balance
# 或使用 GitHub Release tarball:
# dsh plugin --profile web add https://github.com/qschen86/dsh-deepseek-balance/releases/download/v0.1.0/dsh-deepseek-balance-0.1.0.tgz
dsh --profile web --dump-config   # 验证条目
# 重启 dsh web(host 半生效),刷新页面(client 半生效)
```

## 初始化(首次安装)

1. 安装后重启 dsh web、刷新页面(见上文安装命令)。
2. **设置凭据**:DSH 设置 → 凭据 → 添加 `DEEPSEEK_API_KEY`,值填 DeepSeek
   开放平台的 API Key(插件通过 `ctx.credentials` 读取,不接触其他存储)。
3. 确认:左 rail 底部出现余额徽章;点击弹出余额与今日消耗面板。
   若徽章显示"获取失败",检查凭据名称是否恰好为 `DEEPSEEK_API_KEY`(插件不读取
   凭据之外的任何配置)。

## 已知限制

- 验证于 **dsh 0.1.0-rc.6**。余额/消耗面板完全走官方槽位与服务注入,升级兼容;
- "Deep diving..." 鲸鱼喷水动画与插件清单标签页需要对该版本闭包内两个客户端文件做
  手动补丁(`dsh-client-ui-conversation` / `dsh-client-ui-settings-plugin-inventory`,
  备份文件在部署机插件目录下,本仓库不包含)。**dsh 升级后这两个补丁会丢失**,
  其余功能不受影响。

## 许可

MIT

Install

dsh plugin --profile web add github:qschen86/dsh-deepseek-balance

Profile: web

  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source