@lancecheney/dsh-deepseek-balance 0.1.0 → 0.1.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 +10 -0
- package/README.zh.md +10 -0
- package/lib/client.js +271 -246
- package/lib/index.js +491 -119
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,6 +6,12 @@ A [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) client plu
|
|
|
6
6
|
Spent ¥0.12 | Balance ¥47.17 | Peak | ¥27.0⁺/M output
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
Clicking the badge opens a right-side drawer with full usage stats:
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
9
15
|
## Features
|
|
10
16
|
|
|
11
17
|
- **Balance** — live DeepSeek API balance from `GET /user/balance`, proxied server-side so your API key never reaches the browser.
|
|
@@ -39,6 +45,10 @@ then restart `dsh web` and refresh the page.
|
|
|
39
45
|
|
|
40
46
|
Requires a `DEEPSEEK_API_KEY` configured through the harness credential store (or the `DEEPSEEK_API_KEY` environment variable).
|
|
41
47
|
|
|
48
|
+
## Security
|
|
49
|
+
|
|
50
|
+
The balance is proxied server-side: the browser only ever talks to the local `/api/deepseek-balance` route, which the host half forwards to DeepSeek. Your API key is resolved from the harness credential store (or the `DEEPSEEK_API_KEY` environment variable) and is only used server-side in the `Authorization: Bearer ...` header when calling DeepSeek — it never reaches the browser. The badge only shows a masked preview (`sk-8ce0e*****d899`) so you can tell which key is in use.
|
|
51
|
+
|
|
42
52
|
## Notes
|
|
43
53
|
|
|
44
54
|
- The **Spent** figure is an estimate: all tokens in a session are priced at the current period's rate. Real billing is computed by DeepSeek.
|
package/README.zh.md
CHANGED
|
@@ -6,6 +6,12 @@
|
|
|
6
6
|
消耗 ¥0.12 | 余额 ¥47.17 | 高峰 | ¥27.0⁺/M 输出
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
点开徽章会打开右侧抽屉面板,展示完整用量统计:
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
9
15
|
## 功能
|
|
10
16
|
|
|
11
17
|
- **余额** — 实时 DeepSeek API 余额(`GET /user/balance`),由服务端代理请求,浏览器不会接触你的 API Key。
|
|
@@ -39,6 +45,10 @@ dsh plugin --profile web add @lancecheney/dsh-deepseek-balance
|
|
|
39
45
|
|
|
40
46
|
需要已在 harness 凭据存储中配置 `DEEPSEEK_API_KEY`(或设置 `DEEPSEEK_API_KEY` 环境变量)。
|
|
41
47
|
|
|
48
|
+
## 安全
|
|
49
|
+
|
|
50
|
+
余额接口走服务端代理:浏览器只请求本地 `/api/deepseek-balance` 路由,由 host 半区转发到 DeepSeek。API Key 从 harness 凭据存储(或 `DEEPSEEK_API_KEY` 环境变量)解析,仅在服务端调用 DeepSeek 时放入 `Authorization: Bearer ...` 请求头,绝不进入浏览器。界面只显示脱敏后的预览(`sk-8ce0e*****d899`),方便确认当前用的是哪个密钥。
|
|
51
|
+
|
|
42
52
|
## 说明
|
|
43
53
|
|
|
44
54
|
- **消耗** 是估算值:会话内所有 token 都按当前时段价格计算,实际扣费以 DeepSeek 服务端为准。
|