@pinkbanana/dsh-balance 0.4.0 → 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 +13 -2
- package/README_EN.md +13 -2
- package/lib/client.js +743 -6
- package/lib/client.js.map +1 -1
- package/lib/index.js +495 -3
- package/lib/index.js.map +1 -1
- package/lib/types/billing.d.ts +119 -0
- package/lib/types/client/BillingTab.d.ts +18 -0
- package/lib/types/client/DeepSeekPanel.d.ts +3 -2
- package/lib/types/client/format.d.ts +1 -0
- package/lib/types/client/index.d.ts +1 -0
- package/lib/types/client/locales.d.ts +44 -0
- package/lib/types/client/pricing.d.ts +1 -0
- package/lib/types/client/styles.d.ts +1 -1
- package/lib/types/index.d.ts +3 -0
- package/lib/types/pricing.d.ts +7 -0
- package/package.json +9 -3
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[简体中文](./README.md) | [English](./README_EN.md)
|
|
4
4
|
|
|
5
|
-
DeepSeek Harness 插件,用于查询 API
|
|
5
|
+
DeepSeek Harness 插件,用于查询 API 余额、当前可用模型和多维消费统计。API Key 仅由本机 Host 使用,不会发送到浏览器。
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
@@ -13,19 +13,30 @@ 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
|
- 缓存查询结果并支持手动刷新
|
|
21
|
+
- 依据 DeepSeek 峰谷定价,在高峰时段(北京时间 9:00–12:00、14:00–18:00)将聊天框下方的余额指示灯变为橙色
|
|
17
22
|
- 原生支持简体中文和英文,并跟随 Harness 系统语言切换
|
|
18
23
|
- 支持 Harness 已保存的 `DEEPSEEK_API_KEY`
|
|
19
24
|
|
|
20
25
|
## 安装
|
|
21
26
|
|
|
22
27
|
```bash
|
|
23
|
-
dsh plugin --profile web add @pinkbanana/dsh-balance
|
|
28
|
+
dsh plugin --profile web add @pinkbanana/dsh-balance@latest
|
|
24
29
|
dsh --profile web
|
|
25
30
|
```
|
|
26
31
|
|
|
27
32
|
打开 <http://127.0.0.1:3080/>,进入“设置 → DeepSeek 余额”。该入口位于“Agent 预设”下方,余额摘要也会显示在已有会话的聊天框下方。API Key 可在“设置 → 模型”中保存,或通过 `DEEPSEEK_API_KEY` 环境变量提供。
|
|
28
33
|
|
|
34
|
+
消费统计从已保存会话和当前运行中的 live session 读取,不展示 prompt 内容。可在插件配置中增加固定汇率,例如:
|
|
35
|
+
|
|
36
|
+
```yaml
|
|
37
|
+
usdToCny: 7.2
|
|
38
|
+
```
|
|
39
|
+
|
|
29
40
|
## 开发
|
|
30
41
|
|
|
31
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
|
|
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
|

|
|
8
8
|
|
|
@@ -13,19 +13,30 @@ 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
|
|
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)
|
|
17
22
|
- Native Simplified Chinese and English that follows the Harness system language
|
|
18
23
|
- Use the `DEEPSEEK_API_KEY` saved by Harness
|
|
19
24
|
|
|
20
25
|
## Install
|
|
21
26
|
|
|
22
27
|
```bash
|
|
23
|
-
dsh plugin --profile web add @pinkbanana/dsh-balance
|
|
28
|
+
dsh plugin --profile web add @pinkbanana/dsh-balance@latest
|
|
24
29
|
dsh --profile web
|
|
25
30
|
```
|
|
26
31
|
|
|
27
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.
|
|
28
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
|
+
|
|
29
40
|
## Development
|
|
30
41
|
|
|
31
42
|
```bash
|