@dougen/dsh-deepseek-usage 0.4.0 → 0.4.2

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
@@ -1,12 +1,19 @@
1
1
  # @dougen/dsh-deepseek-usage
2
2
 
3
- DeepSeek 余额侧边栏插件(DeepSeek Harness Web UI
3
+ A sidebar plugin for **DeepSeek Harness Web UI** that shows your **DeepSeek account balance** (large display) and the **current model's unit pricing**, with a peak/off-peak billing indicator. UI language follows the DSH locale (Chinese UI shows Chinese, other languages show English).
4
4
 
5
- DSH **网页界面**的侧边栏底部常驻显示你的 **DeepSeek 账号余额**(放大显示)与**当前模型档单价**,并提供高峰/空闲计费时段指示灯。界面语言跟随 DSH 语言设置(自动检测浏览器语言,中文界面显示中文,其他语言显示英文)。
5
+ DeepSeek **余额侧边栏插件**(DeepSeek Harness Web UI):在 DSH **网页界面**的侧边栏底部常驻显示你的 **DeepSeek 账号余额**(放大显示)与**当前模型档单价**,并提供高峰/空闲计费时段指示灯。界面语言跟随 DSH 语言设置(中文界面显示中文,其他语言显示英文)。
6
6
 
7
- ![DeepSeek 用量卡片](https://cdn.jsdelivr.net/npm/@dougen/dsh-deepseek-usage/screenshot.png)
7
+ ![DeepSeek usage card / 用量卡片](https://cdn.jsdelivr.net/npm/@dougen/dsh-deepseek-usage/screenshot.png)
8
8
 
9
- ## 功能
9
+ ## Features / 功能
10
+
11
+ - **Balance**: `¥ 110.00` large display (symbol follows account currency: `¥` CNY / `$` USD)
12
+ - **Unit pricing**: `→|1.5 ⚡0.05 |→4.5` (input / input cache / output, bottom-right of the card; switches with the active model and peak/off-peak window — **updates instantly when you switch models**)
13
+ - **Peak indicator**: top-right dot, orange during peak hours (9:00–12:00, 14:00–18:00 Beijing Time), green otherwise
14
+ - **Auto refresh**: every 5 minutes; click the card to refresh instantly
15
+ - **i18n**: UI copy follows the DSH locale (Chinese / English)
16
+ - Follows the app light/dark theme
10
17
 
11
18
  - **余额**:`¥ 110.00` 大字显示(符号随账号币种自动切换:人民币 `¥` / 美元 `$`)
12
19
  - **档单价**:`→|1.5 ⚡0.05 |→4.5`(输入 / 输入缓存 / 输出,位于卡片右下角;随当前启用模型与峰谷时段自动切换,**切换模型时立即同步**)
@@ -15,11 +22,15 @@ DeepSeek 余额侧边栏插件(DeepSeek Harness Web UI)
15
22
  - **多语言**:界面文案跟随 DSH 语言(中文 / English)
16
23
  - 跟随应用明暗主题
17
24
 
18
- ## 支持范围
25
+ ## Supported scope / 支持范围
26
+
27
+ > ⚠️ This plugin **only supports DeepSeek's official platform** balance display: balance comes from the official API `GET https://api.deepseek.com/user/balance` (using the `DEEPSEEK_API_KEY` configured in DSH). Pointing `DEEPSEEK_BASE_URL` at a third-party proxy/gateway may break or return unexpected results for the balance endpoint — **not guaranteed to be compatible**. Use an official DeepSeek platform account.
19
28
 
20
29
  > ⚠️ 本插件**仅支持 DeepSeek 官方平台**的余额显示:余额来自 DeepSeek 官方 API `GET https://api.deepseek.com/user/balance`(使用 DSH 中已配置的 `DEEPSEEK_API_KEY`)。通过 `DEEPSEEK_BASE_URL` 指向第三方中转/代理时,余额接口可能不可用或返回异常,**不保证兼容**,请使用 DeepSeek 官方平台账号。
21
30
 
22
- ## 安装
31
+ ## Install / 安装
32
+
33
+ Requires the DSH CLI. Install from npm:
23
34
 
24
35
  需要 DSH CLI,从 npm 安装:
25
36
 
@@ -27,82 +38,43 @@ DeepSeek 余额侧边栏插件(DeepSeek Harness Web UI)
27
38
  dsh plugin --profile web add @dougen/dsh-deepseek-usage
28
39
  ```
29
40
 
41
+ Restart the web app (`dsh web`), open http://127.0.0.1:3080 , and the usage card appears at the bottom of the sidebar (below the Cordis panel button).
42
+
30
43
  安装后重启网页应用:`dsh web`,打开 http://127.0.0.1:3080 ,侧边栏底部(Cordis 面板按钮下方)即出现用量卡片。
31
44
 
32
- ## 数据来源
45
+ ## Data sources / 数据来源
46
+
47
+ | Data | Source |
48
+ |---|---|
49
+ | Balance | Official DeepSeek API `GET /user/balance` (uses `DEEPSEEK_API_KEY` configured in DSH) |
50
+ | Unit pricing / peak window | Built-in price table (DeepSeek official peak/off-peak pricing snapshot, effective 2026-08-17) |
33
51
 
34
52
  | 数据 | 来源 |
35
53
  |---|---|
36
54
  | 余额 | DeepSeek 官方 API `GET /user/balance`(使用 DSH 中已配置的 `DEEPSEEK_API_KEY`) |
37
55
  | 档单价 / 峰谷时段 | 内置价格表(DeepSeek 官方峰谷定价快照,2026-08-17 起) |
38
56
 
39
- 使用前请确保 DSH 已配置 `DEEPSEEK_API_KEY`(可在 DSH 设置中的模型页面配置)。
40
-
41
- ## 常见问题
42
-
43
- **余额显示"—"?**
44
- - 未配置 `DEEPSEEK_API_KEY`:在 DSH 设置中配置后重启。
45
- - 网络或接口异常:错误信息会显示在卡片下方。
46
-
47
- **单价与官方价格不一致?**
48
- - 单价按**当前启用模型**与**峰谷时段**自动切换;若当前模型不在内置价格表,会按 `deepseek-chat` 档展示并给出提示。
49
-
50
- ## 卸载
51
-
52
- ```sh
53
- dsh plugin --profile web remove @dougen/dsh-deepseek-usage
54
- ```
55
-
56
- ---
57
-
58
- # English
59
-
60
- A sidebar plugin for **DeepSeek Harness Web UI** that shows your **DeepSeek account balance** (large display) and the **current model's unit pricing**, with a peak/off-peak billing indicator. UI language follows the DSH locale (Chinese UI shows Chinese, other languages show English).
61
-
62
- ![DeepSeek usage card](https://cdn.jsdelivr.net/npm/@dougen/dsh-deepseek-usage/screenshot.png)
63
-
64
- ## Features
65
-
66
- - **Balance**: `¥ 110.00` large display (symbol follows account currency: `¥` CNY / `$` USD)
67
- - **Unit pricing**: `→|1.5 ⚡0.05 |→4.5` (input / input cache / output, bottom-right of the card; switches with the active model and peak/off-peak window — **updates instantly when you switch models**)
68
- - **Peak indicator**: top-right dot, orange during peak hours (9:00–12:00, 14:00–18:00 Beijing Time), green otherwise
69
- - **Auto refresh**: every 5 minutes; click the card to refresh instantly
70
- - **i18n**: UI copy follows the DSH locale (Chinese / English)
71
- - Follows the app light/dark theme
72
-
73
- ## Supported scope
74
-
75
- > ⚠️ This plugin **only supports DeepSeek's official platform** balance display: balance comes from the official API `GET https://api.deepseek.com/user/balance` (using the `DEEPSEEK_API_KEY` configured in DSH). Pointing `DEEPSEEK_BASE_URL` at a third-party proxy/gateway may break or return unexpected results for the balance endpoint — **not guaranteed to be compatible**. Use an official DeepSeek platform account.
76
-
77
- ## Install
78
-
79
- Requires the DSH CLI. Install from npm:
80
-
81
- ```sh
82
- dsh plugin --profile web add @dougen/dsh-deepseek-usage
83
- ```
84
-
85
- Restart the web app (`dsh web`), open http://127.0.0.1:3080 , and the usage card appears at the bottom of the sidebar (below the Cordis panel button).
86
-
87
- ## Data sources
57
+ Make sure `DEEPSEEK_API_KEY` is configured in DSH (Model settings page) before use.
88
58
 
89
- | Data | Source |
90
- |---|---|
91
- | Balance | Official DeepSeek API `GET /user/balance` (uses `DEEPSEEK_API_KEY` configured in DSH) |
92
- | Unit pricing / peak window | Built-in price table (DeepSeek official peak/off-peak pricing snapshot, effective 2026-08-17) |
59
+ 使用前请确保 DSH 已配置 `DEEPSEEK_API_KEY`(可在 DSH 设置中的模型页面配置)。
93
60
 
94
- Make sure `DEEPSEEK_API_KEY` is configured in DSH (Model settings page) before use.
61
+ ## FAQ / 常见问题
95
62
 
96
- ## FAQ
63
+ **Balance shows "—"? / 余额显示"—"?**
97
64
 
98
- **Balance shows "—"?**
99
65
  - `DEEPSEEK_API_KEY` is not configured — configure it in DSH settings and restart.
100
66
  - Network or API error — the error message is shown below the card.
101
67
 
102
- **Price differs from the official one?**
68
+ - 未配置 `DEEPSEEK_API_KEY`:在 DSH 设置中配置后重启。
69
+ - 网络或接口异常:错误信息会显示在卡片下方。
70
+
71
+ **Price differs from the official one? / 单价与官方价格不一致?**
72
+
103
73
  - The unit price switches with the **active model** and the **peak/off-peak window**; if the active model is not in the built-in price table, `deepseek-chat` pricing is shown with a notice.
104
74
 
105
- ## Uninstall
75
+ - 单价按**当前启用模型**与**峰谷时段**自动切换;若当前模型不在内置价格表,会按 `deepseek-chat` 档展示并给出提示。
76
+
77
+ ## Uninstall / 卸载
106
78
 
107
79
  ```sh
108
80
  dsh plugin --profile web remove @dougen/dsh-deepseek-usage
package/lib/pricing.js CHANGED
@@ -19,6 +19,7 @@ const SHANGHAI_OFFSET_MS = 8 * 60 * 60 * 1000;
19
19
  /** 每模型价格:input/cacheRead/output 均为 [高峰, 空闲] 二元组;cacheWrite 为常量 0。 */
20
20
  const PRICE_TABLE = {
21
21
  'deepseek-v4-flash': { input: [3.0, 1.5], cacheRead: [0.1, 0.05], cacheWrite: 0, output: [9.0, 4.5] },
22
+ 'deepseek-v4-flash-vision-exp': { input: [3.0, 1.5], cacheRead: [0.1, 0.05], cacheWrite: 0, output: [9.0, 4.5] },
22
23
  'deepseek-v4-pro': { input: [9.0, 4.5], cacheRead: [0.3, 0.15], cacheWrite: 0, output: [27.0, 13.5] },
23
24
  'deepseek-chat': { input: [2, 2], cacheRead: [0.5, 0.5], cacheWrite: 0, output: [8, 8] },
24
25
  'deepseek-reasoner': { input: [4, 4], cacheRead: [1, 1], cacheWrite: 0, output: [16, 16] },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dougen/dsh-deepseek-usage",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "DeepSeek 余额侧边栏插件:余额(官方 API)、当前档单价与峰谷时段指示灯,支持中/英文界面。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",