@pinkbanana/dsh-balance 0.4.1 → 0.5.0

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.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [简体中文](./README.md) | [English](./README_EN.md)
4
4
 
5
- DeepSeek Harness 插件,用于查询 API 余额和当前可用模型。API Key 仅由本机 Host 使用,不会发送到浏览器。
5
+ DeepSeek Harness 插件,用于查询 API 余额、当前可用模型和多维消费统计。API Key 仅由本机 Host 使用,不会发送到浏览器。
6
6
 
7
7
  ![DeepSeek 余额设置面板](./docs/dsh-balance-settings-v040.png)
8
8
 
@@ -13,6 +13,10 @@ DeepSeek Harness 插件,用于查询 API 余额和当前可用模型。API Key
13
13
  - 查看总余额、充值余额和赠送余额
14
14
  - 在聊天框下方持续显示余额摘要
15
15
  - 查看当前 API Key 可用的模型
16
+ - 在设置页按模型、会话和日期查看实际 usage 消费,并在当前会话的“消费”Tab 查看请求明细
17
+ - 缺少 provider usage、未知 provider 或未知模型时标记为“未计费”,不进行 token 估算
18
+ - 日期按浏览器 IANA 时区分组;DeepSeek 峰谷价格始终按北京时间计算
19
+ - 默认显示 USD;配置 `usdToCny` 后额外显示固定汇率换算的 CNY
16
20
  - 缓存查询结果并支持手动刷新
17
21
  - 依据 DeepSeek 峰谷定价,在高峰时段(北京时间 9:00–12:00、14:00–18:00)将聊天框下方的余额指示灯变为橙色
18
22
  - 原生支持简体中文和英文,并跟随 Harness 系统语言切换
@@ -27,6 +31,12 @@ dsh --profile web
27
31
 
28
32
  打开 <http://127.0.0.1:3080/>,进入“设置 → DeepSeek 余额”。该入口位于“Agent 预设”下方,余额摘要也会显示在已有会话的聊天框下方。API Key 可在“设置 → 模型”中保存,或通过 `DEEPSEEK_API_KEY` 环境变量提供。
29
33
 
34
+ 消费统计从已保存会话和当前运行中的 live session 读取,不展示 prompt 内容。可在插件配置中增加固定汇率,例如:
35
+
36
+ ```yaml
37
+ usdToCny: 7.2
38
+ ```
39
+
30
40
  ## 开发
31
41
 
32
42
  ```bash
package/README_EN.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [简体中文](./README.md) | [English](./README_EN.md)
4
4
 
5
- A DeepSeek Harness plugin for checking API balances and available models. The API key is used only by the local Host and is never sent to the browser.
5
+ A DeepSeek Harness plugin for checking API balances, available models, and multidimensional usage costs. The API key is used only by the local Host and is never sent to the browser.
6
6
 
7
7
  ![DeepSeek balance settings panel](./docs/dsh-balance-settings-v040.png)
8
8
 
@@ -13,6 +13,10 @@ A DeepSeek Harness plugin for checking API balances and available models. The AP
13
13
  - View total, topped-up, and granted balances
14
14
  - Keep a compact balance summary below the chat composer
15
15
  - View models available to the current API key
16
+ - View actual usage costs by model, session, and day in Settings, plus request details in the current session's Usage tab
17
+ - Mark missing usage, unknown providers, and unknown models as unpriced without estimating tokens
18
+ - Group dates in the browser's IANA timezone while applying DeepSeek peak pricing in Beijing time
19
+ - Show USD by default, with optional fixed-rate CNY conversion through `usdToCny`
16
20
  - Cache query results with manual refresh support
17
21
  - Follows DeepSeek peak/off-peak pricing: the balance indicator below the composer turns orange during peak hours (09:00–12:00, 14:00–18:00 Beijing time)
18
22
  - Native Simplified Chinese and English that follows the Harness system language
@@ -27,6 +31,12 @@ dsh --profile web
27
31
 
28
32
  Open <http://127.0.0.1:3080/> and go to Settings → DeepSeek Balance. The panel sits directly below Agent presets, and the balance summary also appears below the composer in existing sessions. Save the API key in Settings → Models or provide it through the `DEEPSEEK_API_KEY` environment variable.
29
33
 
34
+ Usage statistics read saved sessions and prefer the current live session. Prompt content is never exposed. To show a fixed-rate CNY conversion, add for example:
35
+
36
+ ```yaml
37
+ usdToCny: 7.2
38
+ ```
39
+
30
40
  ## Development
31
41
 
32
42
  ```bash