dsh-balance-widget 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.en.md CHANGED
@@ -9,13 +9,13 @@
9
9
  [![Node 24](https://img.shields.io/badge/Node%2024-ready-brightgreen?style=flat-square)](https://nodejs.org)
10
10
  [![Zero deps](https://img.shields.io/badge/dependencies-zero-brightgreen?style=flat-square)]()
11
11
 
12
- A balance & cost widget for the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH) Web GUI: a 💰 icon in the corner of the conversation session header. Click it to see your DeepSeek account balance and the current session's estimated spend.
12
+ A balance & cost widget for the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH) Web GUI: a persistent sidebar footer card shows the account balance and a remaining-ratio bar; clicking opens a four-tier cost breakdown (last prompt / this session / today-this-project / today-all).
13
13
 
14
14
  ## Preview
15
15
 
16
- | Balance always visible | Popover on click |
16
+ | Sidebar card | Four-tier cost popover |
17
17
  | --- | --- |
18
- | ![Balance corner](docs/screenshot-corner.png) | ![Popover detail](docs/screenshot-popover.png) |
18
+ | ![Sidebar card](docs/screenshot-corner.png) | ![Cost popover](docs/screenshot-popover.png) |
19
19
 
20
20
  ## How it differs from similar plugins
21
21
 
@@ -54,14 +54,16 @@ A balance & cost widget for the [DeepSeek Harness](https://github.com/deepseek-a
54
54
  ```
55
55
  host half (lib/index.js)
56
56
  ctx.webServer.register:
57
- GET /api/dsh-balance/balance → official /user/balance (loopback-only guard)
58
- GET /api/dsh-balance/last-cost → last prompt cost (session file + zstd decode)
59
- GET /api/dsh-balance/today-cost → today's total across all sessions
57
+ GET /api/dsh-balance/balance → official /user/balance (loopback-only guard)
58
+ GET /api/dsh-balance/active-cost → last prompt + session total (most recent session)
59
+ GET /api/dsh-balance/today-cost → today's costs (dual: current workspace + all)
60
+ Zero @deepseek-ai/* imports; loads from any profile layout.
61
+ Also registers a deepseek_billing tool for model-driven queries.
60
62
 
61
63
  client half (lib/client.js)
62
- ctx.slots.inject("conversation.session.header.utilities")
63
- → 💰 icon (session header, top-right corner)
64
- → click fetches same-origin APIs → popover with balance + three costs + tokens
64
+ ctx.slots.inject("sidebar.footer.action")
65
+ → persistent sidebar footer card (balance + ratio bar + today)
66
+ → click opens four-tier cost popover + ⓘ term explanations
65
67
  ```
66
68
 
67
69
  ## Installation
package/README.md CHANGED
@@ -9,13 +9,13 @@
9
9
  [![Node 24](https://img.shields.io/badge/Node%2024-ready-brightgreen?style=flat-square)](https://nodejs.org)
10
10
  [![Zero deps](https://img.shields.io/badge/dependencies-zero-brightgreen?style=flat-square)]()
11
11
 
12
- DeepSeek Harness (DSH) Web GUI 的余额与成本小部件:在会话头部右上角(角落)渲染一个 💰 图标,点击弹出账户余额与本会话的估算成本。
12
+ DeepSeek Harness (DSH) Web GUI 的余额与成本小部件:侧边栏底部常驻卡片显示账户余额与剩余比例条,点击弹出四层级成本明细(最近提问 / 本会话 / 今日·本项目 / 今日·全部)。
13
13
 
14
14
  ## 效果预览
15
15
 
16
- | 余额常驻右上角 | 点击弹出详情 |
16
+ | 侧边栏卡片(左下角常驻) | 点击弹出四层级成本 |
17
17
  | --- | --- |
18
- | ![余额常驻](docs/screenshot-corner.png) | ![弹框详情](docs/screenshot-popover.png) |
18
+ | ![侧边栏卡片](docs/screenshot-corner.png) | ![成本明细弹框](docs/screenshot-popover.png) |
19
19
 
20
20
  ## 与同类插件的区别
21
21
 
@@ -49,15 +49,16 @@ DeepSeek Harness (DSH) Web GUI 的余额与成本小部件:在会话头部右
49
49
  ```
50
50
  host 半区 (lib/index.js)
51
51
  ctx.webServer.register:
52
- GET /api/dsh-balance/balance → 官方 /user/balance(loopback-only 守卫)
53
- GET /api/dsh-balance/last-cost → 当前会话最近一次提问成本(读会话文件 + zstd 解压)
54
- GET /api/dsh-balance/today-cost → 今天所有会话总成本
52
+ GET /api/dsh-balance/balance → 官方 /user/balance(loopback-only 守卫)
53
+ GET /api/dsh-balance/active-cost → 最近活跃会话的最近提问 + 会话总计
54
+ GET /api/dsh-balance/today-cost → 今日成本(双值:当前工作区 + 全部)
55
55
  依赖:零外部 @deepseek-ai/* import,任何 profile 布局均可解析
56
+ 另有 deepseek_billing 工具供模型直接查询余额/成本
56
57
 
57
58
  client 半区 (lib/client.js)
58
- ctx.slots.inject("conversation.session.header.utilities")
59
- → 💰 图标(会话头部右上角)
60
- → 点击 fetch 同源 API → 弹层展示余额 + 三种成本 + token
59
+ ctx.slots.inject("sidebar.footer.action")
60
+ → 侧边栏底部常驻卡片(余额 + 比例条 + 今日)
61
+ → 点击弹出四层级成本明细 + ⓘ 名词解释
61
62
  ```
62
63
 
63
64
  ## 安装
Binary file
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-balance-widget",
3
3
  "description": "Balance & cost widget for the dsh web GUI: a sidebar footer card shows the DeepSeek account balance, a remaining-ratio bar and today's costs; clicking opens a popover with four-tier cost breakdown (last prompt / this session / today-this-project / today-all), term explanations, and a one-click top-up link. Zero external dependencies — works on Node 24.",
4
- "version": "0.4.4",
4
+ "version": "0.4.5",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "files": [