dsh-balance-widget 0.2.0 → 0.2.1

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.
Files changed (3) hide show
  1. package/README.en.md +18 -8
  2. package/README.md +18 -8
  3. package/package.json +1 -1
package/README.en.md CHANGED
@@ -2,14 +2,12 @@
2
2
 
3
3
  [中文](README.md) | **English**
4
4
 
5
- <p align="center">
6
- <img src="https://img.shields.io/npm/v/dsh-balance-widget?style=flat-square&label=npm" alt="npm">
7
- <img src="https://img.shields.io/github/stars/LL-cmyk-so/dsh-balance-widget?style=flat-square&label=Stars" alt="Stars">
8
- <img src="https://img.shields.io/github/license/LL-cmyk-so/dsh-balance-widget?style=flat-square" alt="License">
9
- <img src="https://img.shields.io/github/last-commit/LL-cmyk-so/dsh-balance-widget?style=flat-square" alt="Last commit">
10
- <img src="https://img.shields.io/badge/Node%2024-ready-brightgreen?style=flat-square" alt="Node 24">
11
- <img src="https://img.shields.io/badge/dependencies-zero-brightgreen?style=flat-square" alt="Zero deps">
12
- </p>
5
+ [![npm](https://img.shields.io/npm/v/dsh-balance-widget?style=flat-square&label=npm)](https://www.npmjs.com/package/dsh-balance-widget)
6
+ [![Stars](https://img.shields.io/github/stars/LL-cmyk-so/dsh-balance-widget?style=flat-square&label=Stars)](https://github.com/LL-cmyk-so/dsh-balance-widget)
7
+ [![License](https://img.shields.io/github/license/LL-cmyk-so/dsh-balance-widget?style=flat-square)](https://github.com/LL-cmyk-so/dsh-balance-widget/blob/main/LICENSE)
8
+ [![Last commit](https://img.shields.io/github/last-commit/LL-cmyk-so/dsh-balance-widget?style=flat-square)](https://github.com/LL-cmyk-so/dsh-balance-widget)
9
+ [![Node 24](https://img.shields.io/badge/Node%2024-ready-brightgreen?style=flat-square)](https://nodejs.org)
10
+ [![Zero deps](https://img.shields.io/badge/dependencies-zero-brightgreen?style=flat-square)]()
13
11
 
14
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.
15
13
 
@@ -100,6 +98,18 @@ Built-in DeepSeek official peak/off-peak pricing (CNY per 1M tokens), effective
100
98
 
101
99
  `deepseek-chat` / `deepseek-reasoner` aliases map to Flash / Pro pricing respectively. Costs are **estimates**; actual billing from the provider is authoritative.
102
100
 
101
+ ## Changelog
102
+
103
+ ### v0.2.0 — Last prompt & today total cost
104
+ - ✨ **Added**: popover now shows "last prompt cost" and "today total cost"
105
+ - Last prompt: prices the current session's last turn from the session file
106
+ - Today total: walks every session under `~/.dsh/sessions/` and sums today's usage
107
+ - 🐛 **Fixed**: session-id prefix duplication in the last-cost route (both `session-`-prefixed and bare ids resolve)
108
+
109
+ ### v0.1.0 — Initial release
110
+ - 🎉 Account balance (official `/user/balance`) + session cost (estimate) + token usage
111
+ - On-demand refresh: no polling, queries only on click, costs zero tokens
112
+
103
113
  ## Verify
104
114
 
105
115
  - Config tree: `dsh --profile web --dump-config` should show a `balance-widget` entry.
package/README.md CHANGED
@@ -2,14 +2,12 @@
2
2
 
3
3
  **中文** | [English](README.en.md)
4
4
 
5
- <p align="center">
6
- <img src="https://img.shields.io/npm/v/dsh-balance-widget?style=flat-square&label=npm" alt="npm">
7
- <img src="https://img.shields.io/github/stars/LL-cmyk-so/dsh-balance-widget?style=flat-square&label=Stars" alt="Stars">
8
- <img src="https://img.shields.io/github/license/LL-cmyk-so/dsh-balance-widget?style=flat-square" alt="License">
9
- <img src="https://img.shields.io/github/last-commit/LL-cmyk-so/dsh-balance-widget?style=flat-square" alt="Last commit">
10
- <img src="https://img.shields.io/badge/Node%2024-ready-brightgreen?style=flat-square" alt="Node 24">
11
- <img src="https://img.shields.io/badge/dependencies-zero-brightgreen?style=flat-square" alt="Zero deps">
12
- </p>
5
+ [![npm](https://img.shields.io/npm/v/dsh-balance-widget?style=flat-square&label=npm)](https://www.npmjs.com/package/dsh-balance-widget)
6
+ [![Stars](https://img.shields.io/github/stars/LL-cmyk-so/dsh-balance-widget?style=flat-square&label=Stars)](https://github.com/LL-cmyk-so/dsh-balance-widget)
7
+ [![License](https://img.shields.io/github/license/LL-cmyk-so/dsh-balance-widget?style=flat-square)](https://github.com/LL-cmyk-so/dsh-balance-widget/blob/main/LICENSE)
8
+ [![Last commit](https://img.shields.io/github/last-commit/LL-cmyk-so/dsh-balance-widget?style=flat-square)](https://github.com/LL-cmyk-so/dsh-balance-widget)
9
+ [![Node 24](https://img.shields.io/badge/Node%2024-ready-brightgreen?style=flat-square)](https://nodejs.org)
10
+ [![Zero deps](https://img.shields.io/badge/dependencies-zero-brightgreen?style=flat-square)]()
13
11
 
14
12
  DeepSeek Harness (DSH) Web GUI 的余额与成本小部件:在会话头部右上角(角落)渲染一个 💰 图标,点击弹出账户余额与本会话的估算成本。
15
13
 
@@ -96,6 +94,18 @@ dsh plugin --profile web add "link:$(pwd)"
96
94
 
97
95
  `deepseek-chat` / `deepseek-reasoner` 别名分别映射到 Flash / Pro 价格。成本为**估算值**,实际以官方账单为准。
98
96
 
97
+ ## 版本历史
98
+
99
+ ### v0.2.0 — 最近一次提问与今日总成本
100
+ - ✨ **新增**:弹层增加「最近一次提问成本」与「今天总成本」两项
101
+ - 最近一次提问:解析当前会话最后一个 turn 的 token 用量 × 单价
102
+ - 今天总成本:遍历 `~/.dsh/sessions/` 下所有会话,累加今天(自然日)用量
103
+ - 🐛 **修复**:last-cost 路由的 session-id 前缀重复问题(带/不带 `session-` 前缀均可解析)
104
+
105
+ ### v0.1.0 — 初始版本
106
+ - 🎉 账户余额(官方 `/user/balance`)+ 本会话成本(估算)+ Token 用量
107
+ - 按需刷新:无轮询,点击才查询,不消耗 token
108
+
99
109
  ## 验证
100
110
 
101
111
  - 配置树:`dsh --profile web --dump-config` 应出现 `balance-widget` 条目
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 corner icon in the conversation session header that shows the DeepSeek account balance and the current session's estimated spend on click. Host half proxies the official /user/balance API over ctx.webServer (loopback-only); client half renders the icon and popover. Zero external dependencies — works on Node 24.",
4
- "version": "0.2.0",
4
+ "version": "0.2.1",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "files": [