deepseek-harness-wallet 0.3.2 → 0.3.3
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/CHANGELOG.md +16 -10
- package/README.md +179 -176
- package/index.js +257 -7
- package/lib/client.js +680 -74
- package/lib/plans.js +178 -0
- package/package.json +8 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## 0.3.3 - 2026-08-25
|
|
6
|
+
|
|
7
|
+
- 新增通用官方套餐适配器契约,并首批接入 Z.ai Coding Plan 全球区与中国区;每个来源固定绑定官方域名和独立的 DSH 凭据引用,浏览器不会收到 Key、接口路径或原始响应。 / Added a generic official subscription-plan adapter contract with initial Z.ai Coding Plan Global and China adapters; each source is pinned to its official domain and its own DSH credential reference, while the browser receives no key, endpoint path, or raw response.
|
|
8
|
+
- 套餐页分别显示 5 小时模型 Token 额度与月度 MCP 工具额度,以从 100% 向下消耗的剩余比例为主,已用比例和可用时的已用/总量为辅,并显示重置时间、套餐等级、更新时间和来源域名;剩余不高于 50% 变黄、不高于 20% 变红,也不把套餐额度换算成人民币余额。 / The plan view separates the 5-hour model-token window from monthly MCP-tool quota, leading with remaining percentage that drains from 100% while retaining used percentage and available used/total values; it also shows reset time, plan level, update time, and source domain, turns yellow at 50% remaining and red at 20%, and never converts quota into currency.
|
|
9
|
+
- 后台按来源独立解析凭据、5 分钟缓存并合并并发刷新;网络失败保留最近成功快照并标记缓存,401、限流、超时与响应结构变化只返回安全错误枚举。 / Each source resolves credentials independently, caches for five minutes, and deduplicates concurrent refreshes; failures preserve the latest successful snapshot and expose bounded error enums for authorization, rate limits, timeouts, and response changes.
|
|
10
|
+
- 钱包设置页在账户管理之后常态显示套餐卡片,紧凑钱包与悬浮窗提供可折叠入口;新增响应式、浅深色、无嵌套交互控件和进度条可访问性样式。 / Wallet settings keeps plan cards visible after account management, while compact and floating wallet panels expose a collapsible entry with responsive, theme-native, non-nested controls and accessible progress bars.
|
|
11
|
+
- 钱包标签与侧边栏时钟改为跟随当前会话的实时 Provider/模型:选择 Z.ai 时隐藏 DeepSeek 余额、充值与峰谷时钟,标签切换为 5 小时 Token、月度 MCP 和本场 Token 摘要;其他第三方只显示自身会话 Token,切回 DeepSeek V4 后恢复原视图。 / Made the composer chip and sidebar clock follow the current session's live provider/model selection: Z.ai hides DeepSeek balance, recharge, and peak pricing in favor of 5-hour Token, monthly MCP, and session-token summaries; other providers show only their own session usage, and DeepSeek V4 restores the original view.
|
|
12
|
+
- 修复 maid-atelier 皮肤的通用 `aria-haspopup="dialog"` 按钮规则把钱包主按钮强制压成 30×30、继而误触发 compact 的问题:标准标签在该皮肤下与 38px 工具栏对齐并使用主题变量,圆角裁剪也阻止模糊层和外阴影产生矩形漏色;设置页提供独立的“显示输入框标签”与“仅显示余额”开关,隐藏只影响输入框标签,不停止提醒、设置、套餐或账本;皮肤压窄侧栏时峰谷卡会按实际文本溢出换行,测量过程不再改动被监听卡片;模型菜单打开时临时停用皮肤的合成模糊层并使用不透明菜单面,避免 Edge 切换模型时重排或重绘卡住;峰谷卡在应用浅/深色模式下都沿用工作栏的深蓝金边配色,兼顾对比度与整体融合。 / Fixed maid-atelier's broad dialog-trigger rule forcing the wallet button to 30×30 and falsely triggering compact mode: the standard chip now aligns with the skin's 38px toolbar using theme tokens, with rounded clipping that prevents rectangular blur/shadow bleed; settings exposes independent composer-label visibility and primary-value-only switches; constrained peak cards wrap only on real text overflow using read-only measurement; the model picker temporarily disables the skin's composited blur in favor of an opaque menu surface to prevent Edge repaint stalls; and peak cards retain the workbar's navy-and-gold palette in both app themes for readable, integrated visuals (Fixes #30).
|
|
13
|
+
- 修复 Z.ai 套餐 Provider 被错误列入 DeepSeek“官方计费分桶”的问题:Z.ai 全球区与中国区现在是不可提升的独立套餐来源,旧勾选和误记费用会在载入时清理;控制面板新增 DeepSeek / Z.ai 手动查看切换与明确的拖动标题栏,且设置页会解释峰谷时钟在非 DeepSeek V4 模型下为何自动隐藏。 / Prevented Z.ai plan providers from appearing in or being promoted through DeepSeek's official-billing alias control: both regions are now reserved independent plan sources and stale selections or mispriced history are repaired on load; the details panel adds manual DeepSeek/Z.ai views and an explicit drag handle, while settings explains why the peak clock auto-hides outside DeepSeek V4.
|
|
14
|
+
- 新增套餐响应归一化、缓存迁移、官方域名白名单、路由安全、失败保留和 UI 回归测试,并使用本机已配置的 Z.ai 中国区 Coding Plan 做了不输出敏感信息的真实接口验证。 / Added coverage for response normalization, cache migration, official-origin pinning, route safety, stale-success retention, and UI behavior, plus a redacted real-interface verification against the locally configured Z.ai China Coding Plan.
|
|
15
|
+
|
|
5
16
|
## 0.3.2 - 2026-08-23
|
|
6
17
|
|
|
7
18
|
- 新增 365 天本地 Token 用量账本与折叠式热力图:按日期、会话、模型和官方/第三方 provider 展示调用次数、Token、缓存命中率与可定价费用。 / Added a 365-day local Token ledger and collapsible heatmap grouped by date, session, model, and official/third-party provider.
|
|
@@ -72,7 +83,7 @@ All notable changes to this project are documented in this file.
|
|
|
72
83
|
- 标签上「本场」恢复常显(¥0.00 也显示,新会话不再缺席);仅未定价模型仍隐藏。/ The chip shows the session cost again even at ¥0.00; only unpriced models stay hidden.
|
|
73
84
|
- 面板/浮动窗版本号移至底部右下角,不再与顶栏按钮挤压。 / Panel version tags moved to the footer, clear of the header buttons.
|
|
74
85
|
|
|
75
|
-
## 0.2.0 - 2026-08-
|
|
86
|
+
## 0.2.0 - 2026-08-19
|
|
76
87
|
|
|
77
88
|
- 新增多账户管理与热切换:面板内“账户管理”可添加多个账户(名称 + API Key),切换后无需重启,下一次 LLM 调用即按新账户计费;key 界面掩码显示,余额查询跟随当前账户(contributed in PR #4 by mxchen-xyz)。 / Added multi-account management with hot switching: manage accounts in the panel, and the very next LLM call is billed with the newly activated key — no restart needed; keys stay masked in the UI and balance follows the active account.
|
|
78
89
|
- 面板视觉重做:余额横排摘要卡、设置合并为分组卡片(胶囊开关、行内滑块、阈值保存贴边)、账户列表限高两行滚动、主操作并列与安静的清除入口。 / Restyled the panel: horizontal balance summary card, grouped settings card (chip toggles, inline slider, threshold save inline), two-row scrollable account list, and paired primary actions with a quiet destructive entry.
|
|
@@ -80,8 +91,10 @@ All notable changes to this project are documented in this file.
|
|
|
80
91
|
- 设置页钱包页两列网格布局铺满宿主内容列,余额行横排。 / The settings wallet page lays controls out in a two-column grid that fills the host settings column.
|
|
81
92
|
- 会话花费跟随当前账户货币:美元账户显示「本约 $x」(按 CNY 价折算的估算值,标签承担约算含义),人民币账户显示精确的「本场 ¥x」。 / Session cost follows the active account currency: USD accounts show 本约 $x (a labeled estimate converted from the CNY table), CNY accounts show the exact 本场 figure.
|
|
82
93
|
- 芯片上低于显示精度的会话花费(如 $0.00)直接隐藏,面板照常显示,高缩放下更容易保持完整布局。 / Sub-cent session spend is hidden on the chip (kept in panels) so the full layout survives high scale factors.
|
|
83
|
-
- 输入框位置缩放上限进一步收紧为 105%(悬浮/侧边仍 125%)。
|
|
84
|
-
- 包装官方的路由(如 dsh-vision-proxy 的 deepseek-vision)可勾选计入官方计费桶:设置页新增「Provider 分桶」,自动列出出现过的 provider,勾选即按官方价格计入本场花费(Fixes #21, reported by @wenjie0112)。 / Wrapper provider routes (e.g. deepseek-vision from dsh-vision-proxy) can be checked into the official billing bucket: the settings page gains a Provider section listing observed providers; checked ones bill officially.
|
|
94
|
+
- 输入框位置缩放上限进一步收紧为 105%(悬浮/侧边仍 125%)。 / Tightened the composer-docked scale cap to 105%, while floating and side docks retain 125%.
|
|
95
|
+
- 包装官方的路由(如 dsh-vision-proxy 的 deepseek-vision)可勾选计入官方计费桶:设置页新增「Provider 分桶」,自动列出出现过的 provider,勾选即按官方价格计入本场花费(Fixes #21, reported by @wenjie0112)。 / Wrapper provider routes (e.g. deepseek-vision from dsh-vision-proxy) can be checked into the official billing bucket: the settings page gains a Provider section listing observed providers; checked ones bill officially.
|
|
96
|
+
- 账户激活通过宿主凭据接口写入 `DEEPSEEK_API_KEY`;若启动环境变量覆盖该值,则安全拒绝切换,避免显示虚假的激活状态。 / Account activation writes through the host credentials seam and safely refuses switching when a launch-time environment variable shadows `DEEPSEEK_API_KEY`.
|
|
97
|
+
- 新增账户列表、激活和移除 API,并补充账户存储辅助函数测试。 / Added account list, activation, and removal APIs with account-store helper coverage.
|
|
85
98
|
|
|
86
99
|
## 0.1.5 - 2026-08-18
|
|
87
100
|
|
|
@@ -105,13 +118,6 @@ All notable changes to this project are documented in this file.
|
|
|
105
118
|
- Expanded the zero-dependency test suite with release metadata, documentation-resource, HTTP route-boundary, layout, reminder, desktop fallback, and capability-gating checks; added exact npm archive verification for the 0.1.4 release candidate.
|
|
106
119
|
- Expanded validation to Windows, Ubuntu, and macOS on Node 22.19 and 24, added cross-platform reference-patch checks and focused DSH deletion-chain tests, and added npm OIDC trusted publishing for formal GitHub Releases.
|
|
107
120
|
|
|
108
|
-
## 0.2.0 - 2026-08-16
|
|
109
|
-
|
|
110
|
-
- Added multi-account management: add / list / remove multiple DeepSeek accounts from the wallet panel's 账户管理 section; keys are stored in `$DSH_HOME/storages/accounts.json` and the UI only shows masked keys.
|
|
111
|
-
- Added hot account switching: activating an account writes its key into the credentials seam (`credentials.set('DEEPSEEK_API_KEY', ...)`), so the next LLM request is billed with the new account without a restart. Balance lookups prefer the active account's key and fall back to the credentials seam when no account is active.
|
|
112
|
-
- The first account added becomes the active account automatically; switching is refused with a clear error when `DEEPSEEK_API_KEY` is supplied by the launching environment (shadowed writes are rejected by the credentials provider).
|
|
113
|
-
- Added `GET/POST /api/wallet/accounts`, `POST /api/wallet/accounts/activate`, and `POST /api/wallet/accounts/remove` routes, plus unit tests for the account store helpers.
|
|
114
|
-
|
|
115
121
|
## 0.1.3 - 2026-08-16
|
|
116
122
|
|
|
117
123
|
- Fixed the recharge shortcut so its first click reliably opens the anti-phishing confirmation, including when the detail panel is closed (contributed in PR #2 by QZYWQ).
|
package/README.md
CHANGED
|
@@ -1,176 +1,179 @@
|
|
|
1
|
-
# DeepSeek Harness Control Center
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/deepseek-harness-wallet)
|
|
4
|
-
[](https://github.com/feibi-mochi/deepseek-harness-control-center/releases)
|
|
5
|
-
[](https://github.com/feibi-mochi/deepseek-harness-control-center/actions/workflows/validate.yml)
|
|
6
|
-
[](https://github.com/deepseek-ai/DeepSeek-Harness)
|
|
7
|
-
[](./LICENSE)
|
|
8
|
-
|
|
9
|
-
**DeepSeek Harness monitoring, alerts, recharge, and session control center.**
|
|
10
|
-
|
|
11
|
-
`Balance ¥5.89 · Session ¥0.72 · Official 18.8M | Third-party 800K · ↗ Recharge`
|
|
12
|
-
|
|
13
|
-
[English](./README.md) · [简体中文](https://github.com/feibi-mochi/deepseek-harness-control-center/blob/main/docs/i18n/README.zh-CN.md) · [Install](#install) · [Compatibility](#browser-desktop-and-os-compatibility) · [Changelog](./CHANGELOG.md)
|
|
14
|
-
|
|
15
|
-
> A local-first companion that keeps account status, per-conversation usage, completion reminders, official recharge, flexible layout, and host-gated session controls beside the DSH composer.
|
|
16
|
-
|
|
17
|
-
> **Version:**
|
|
18
|
-
|
|
19
|
-
> If DeepSeek Harness Control Center helps you, please consider leaving a ⭐ Star. Thank you!
|
|
20
|
-
|
|
21
|
-
## What it does
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
余额 ¥5.89 · 本场 ¥0.72 · 官 18.8M | 三方 800K · ↗充
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
- **Official DeepSeek** — live balance (60s global refresh with fast boot retries), an estimated current-session cost (not an official bill) locked to the price active for each usage event, including the 2026-08-17 peak/off-peak rollout, and token breakdown.
|
|
28
|
-
- **Vision model accounting** — `deepseek-v4-flash-vision-exp` is priced like V4 Flash; image tokens reported by the Harness are included with text tokens.
|
|
29
|
-
- **v4 peak/off-peak ring clock** — a resident 24-hour sidebar footer widget for `v4-flash`, `v4-pro`, and `v4-flash-vision-exp`. Weekday peak windows are 09:00–12:00 and 14:00–18:00 Beijing time. After Friday 18:00 the card previews “weekend all-day off-peak”; Saturday and Sunday name the current all-day off-peak rule; Monday before 09:00 shows the time remaining to enter peak. Optional notifications treat Friday 18:00 through Monday 09:00 as one continuous off-peak period.
|
|
30
|
-
- **Official pricing sync** — periodically checks the official DeepSeek pricing page and applies only a fully validated table. Network failures retain the last validated rule (or the built-in rule before the first successful sync); an unrecognized page structure is marked for review instead of silently changing billing.
|
|
31
|
-
- **
|
|
32
|
-
- **
|
|
33
|
-
- **
|
|
34
|
-
- **
|
|
35
|
-
- **
|
|
36
|
-
- **
|
|
37
|
-
- **
|
|
38
|
-
- **
|
|
39
|
-
- **
|
|
40
|
-
- **
|
|
41
|
-
- **
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
|
117
|
-
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
|
147
|
-
|
|
|
148
|
-
|
|
|
149
|
-
|
|
|
150
|
-
|
|
|
151
|
-
|
|
|
152
|
-
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
- Since 2026-08-
|
|
164
|
-
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
1
|
+
# DeepSeek Harness Control Center
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/deepseek-harness-wallet)
|
|
4
|
+
[](https://github.com/feibi-mochi/deepseek-harness-control-center/releases)
|
|
5
|
+
[](https://github.com/feibi-mochi/deepseek-harness-control-center/actions/workflows/validate.yml)
|
|
6
|
+
[](https://github.com/deepseek-ai/DeepSeek-Harness)
|
|
7
|
+
[](./LICENSE)
|
|
8
|
+
|
|
9
|
+
**DeepSeek Harness monitoring, alerts, recharge, and session control center.**
|
|
10
|
+
|
|
11
|
+
`Balance ¥5.89 · Session ¥0.72 · Official 18.8M | Third-party 800K · ↗ Recharge`
|
|
12
|
+
|
|
13
|
+
[English](./README.md) · [简体中文](https://github.com/feibi-mochi/deepseek-harness-control-center/blob/main/docs/i18n/README.zh-CN.md) · [Install](#install) · [Compatibility](#browser-desktop-and-os-compatibility) · [Changelog](./CHANGELOG.md)
|
|
14
|
+
|
|
15
|
+
> A local-first companion that keeps account status, per-conversation usage, completion reminders, official recharge, flexible layout, and host-gated session controls beside the DSH composer.
|
|
16
|
+
|
|
17
|
+
> **Version:** v0.3.3 is the current stable release on GitHub and npm.
|
|
18
|
+
|
|
19
|
+
> If DeepSeek Harness Control Center helps you, please consider leaving a ⭐ Star. Thank you!
|
|
20
|
+
|
|
21
|
+
## What it does
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
余额 ¥5.89 · 本场 ¥0.72 · 官 18.8M | 三方 800K · ↗充
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- **Official DeepSeek** — live balance (60s global refresh with fast boot retries), an estimated current-session cost (not an official bill) locked to the price active for each usage event, including the 2026-08-17 peak/off-peak rollout, and token breakdown.
|
|
28
|
+
- **Vision model accounting** — `deepseek-v4-flash-vision-exp` is priced like V4 Flash; image tokens reported by the Harness are included with text tokens.
|
|
29
|
+
- **v4 peak/off-peak ring clock** — a resident 24-hour sidebar footer widget for `v4-flash`, `v4-pro`, and `v4-flash-vision-exp`. Weekday peak windows are 09:00–12:00 and 14:00–18:00 Beijing time. After Friday 18:00 the card previews “weekend all-day off-peak”; Saturday and Sunday name the current all-day off-peak rule; Monday before 09:00 shows the time remaining to enter peak. Optional notifications treat Friday 18:00 through Monday 09:00 as one continuous off-peak period.
|
|
30
|
+
- **Official pricing sync** — periodically checks the official DeepSeek pricing page and applies only a fully validated table. Network failures retain the last validated rule (or the built-in rule before the first successful sync); an unrecognized page structure is marked for review instead of silently changing billing.
|
|
31
|
+
- **Z.ai Coding Plan quotas** — a generic official-plan adapter monitors configured Global and China plans without exposing credentials. It separates the 5-hour model-token window from monthly MCP-tool usage, leads with quota remaining from 100% down while keeping usage as secondary context, retains the last successful snapshot on failure, and never converts subscription quota into CNY balance.
|
|
32
|
+
- **Provider-aware composer surfaces** — the chip and sidebar clock follow the session's selected provider/model. Z.ai replaces DeepSeek balance, recharge, and peak pricing with plan-window summaries; unrelated providers show only their own session tokens, and DeepSeek V4 restores the wallet and peak clock.
|
|
33
|
+
- **365-day local usage ledger** — Wallet settings keeps the heatmap visible, while compact wallet panels keep it collapsible. Stable request identities are deduplicated, official cost is locked at usage time, official and third-party data stay separate, and prompts or responses are never stored. Collection begins after upgrading to v0.3.2; older aggregate counters have no trustworthy dates and are not backfilled.
|
|
34
|
+
- **Third-party total** — current-session tokens (input / cache read / output). No balance guessing, no cost math, zero configuration.
|
|
35
|
+
- **Provider classification** — observed wrapper routes appear in the settings page; opted-in routes join the official token/cost bucket for subsequent calls and are priced with the official table. Existing history is not retroactively reclassified.
|
|
36
|
+
- **Click the chip** to open the detail panel: correctly formatted per-currency balances, cost and token splits, a freely editable low-balance threshold for the active account and currency (two decimals, persisted per account; alerts never mix currencies), manual refresh, and a jump to the official recharge page (first click shows the domain for confirmation — anti-phishing).
|
|
37
|
+
- **Move, dock, and scale** — drag the chip freely, preview nearby snap targets, use compact horizontal or vertical layouts, adjust its scale from the control panel, and show official or third-party data independently. The choices are remembered locally.
|
|
38
|
+
- **Composer-label controls and skin compatibility** — independently show/hide the composer label or reduce it to the primary remaining value (DeepSeek balance, Z.ai five-hour quota) without disabling reminders, settings, plan monitoring, or history. The standard chip also resists broad skin button rules and aligns with maid-atelier's 38px navy-and-gold composer toolbar.
|
|
39
|
+
- **Floating window mode** — detach the detail panel into a draggable window with a remembered position, or minimize it directly to a freely movable dot; the dot turns red below the threshold.
|
|
40
|
+
- **Completion reminders** — optionally notify when a conversation finishes, with persistent or timed modes, queueing and deduplication for simultaneous completions, cross-tab coordination, and an in-page fallback when system notifications are unavailable.
|
|
41
|
+
- **Optional permanent deletion** — when the DSH host advertises a real deletion capability, an opt-in setting enables a confirmed permanent-delete action in the session menu; unsupported hosts keep the control disabled.
|
|
42
|
+
- **Low-balance alert** — below the threshold the chip turns red with a breathing animation and fires one desktop notification; it resets automatically once the balance recovers.
|
|
43
|
+
- **Theme-native UI** — uses DSH `--dsw-alias-*` variables with safe fallback colors, so light and dark themes both render correctly; the panel closes when you click outside and flips open-direction near screen edges.
|
|
44
|
+
- **Clear current-session wallet data** — one button clears only the open conversation's token/cost records; it does not delete the conversation, and every other conversation is untouched. Historical ledger clearing is a separate action.
|
|
45
|
+
|
|
46
|
+
## Multi-account
|
|
47
|
+
|
|
48
|
+
- Open the wallet panel → **Account Management(账户管理)** to add accounts (name + API key), switch the active one, or remove them.
|
|
49
|
+
- The first account added becomes the active account automatically and is synced into the credentials seam.
|
|
50
|
+
- Switching prompts a confirmation because it changes **LLM billing** for subsequent requests: the switch writes the account key into the credentials seam (`credentials.set('DEEPSEEK_API_KEY', ...)`), and since the llm-deepseek provider route resolves that reference per request, the very next LLM call is billed with the new account — no restart needed.
|
|
51
|
+
- Account keys are encrypted at rest in `$DSH_HOME/storages/accounts.json`: Windows uses the current user's DPAPI; other platforms use an owner-only AES-GCM key file. An encrypted `.bak` recovers a missing, corrupt, or undecryptable primary file; if neither copy can be read, writes are locked instead of overwriting account data. The UI only shows masked keys.
|
|
52
|
+
- Session usage estimates follow the active account's currency: USD-settled accounts show `本约 $x`, converted from the CNY price table at the vendor's long-standing list ratio (not a live FX rate); CNY accounts show `本场 ¥x`. These are local estimates, not an official invoice.
|
|
53
|
+
- If `DEEPSEEK_API_KEY` is supplied by the launching environment, switching is refused with a clear error (the credentials provider rejects shadowed writes) — unset it in your shell to enable switching.
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
## Project overview
|
|
57
|
+
|
|
58
|
+
### One place for the signals that matter
|
|
59
|
+
|
|
60
|
+
DeepSeek Harness can keep several conversations and model providers active at once, but balance, usage, background-task status, and session actions normally live in different places. Control Center brings the information worth checking repeatedly beside the composer, so the current workflow can answer three questions at a glance: **How much official balance remains? What has this conversation used? Does anything need attention?**
|
|
61
|
+
|
|
62
|
+
### Present when needed, quiet when not
|
|
63
|
+
|
|
64
|
+
The project is designed around quick reading and in-context action rather than another full-page dashboard. Its compact surface expands only when needed, adapts to the available space, and leaves layout and reminder behavior under the user's control. Accounting remains separated by conversation and provider, while wallet-data cleanup and permanent session deletion remain intentionally different operations.
|
|
65
|
+
|
|
66
|
+
### Extensible without hiding the boundaries
|
|
67
|
+
|
|
68
|
+
The npm package handles monitoring and interface behavior; optional host powers are enabled only when DSH actually provides them. That capability-based boundary keeps unsupported actions visibly unavailable and gives browsers or desktop wrappers a small, reviewable adaptation surface. Future providers and controls can therefore be added without changing the established `deepseek-harness-wallet` package identity or silently expanding what the plugin is trusted to do.
|
|
69
|
+
|
|
70
|
+
> **Want permanent session deletion?** It cannot be enabled by configuring the plugin alone. Give the [integration guide](./integrations/dsh-session-delete/README.md) and [Agent adaptation prompt](./integrations/dsh-session-delete/AGENT_PROMPT.md) to an Agent with access to the buildable DSH source. The control-panel switch becomes available only after the host implementation is built, tested, and advertises the capability.
|
|
71
|
+
|
|
72
|
+
Details: [compatibility](#browser-desktop-and-os-compatibility) · [data and trust](#data--trust) · [pricing](#pricing-timeline)
|
|
73
|
+
|
|
74
|
+
## Install
|
|
75
|
+
|
|
76
|
+
From npm (stable v0.3.3):
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
dsh plugin --profile web add deepseek-harness-wallet
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
or from GitHub `main` (current v0.3.3 source):
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
dsh plugin --profile web add github:feibi-mochi/deepseek-harness-control-center
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Restart `dsh web`, then hard-refresh the page.
|
|
89
|
+
|
|
90
|
+
## Quick use
|
|
91
|
+
|
|
92
|
+
1. Click the wallet or peak/off-peak card to open its control panel; open the Harness settings card for health and compatibility checks.
|
|
93
|
+
2. The peak card supports horizontal/vertical layout and 100%–120% scaling. The wallet chip uses a separate scale: 100%–105% in the composer and up to 125% when docked or floating.
|
|
94
|
+
3. Turn the official recharge button off when you need a smaller card; official and third-party rows can also be shown independently.
|
|
95
|
+
4. Drag the card to any open area. If it is hard to find after a layout change, use **Reset/Dock(归位/停靠)** in the panel to return it to the sidebar.
|
|
96
|
+
5. The card follows the host light/dark theme. A hard refresh after upgrading makes sure the new client bundle is loaded.
|
|
97
|
+
|
|
98
|
+
### Update
|
|
99
|
+
|
|
100
|
+
```sh
|
|
101
|
+
dsh plugin --profile web update deepseek-harness-wallet
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Remove
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
dsh plugin --profile web remove deepseek-harness-wallet
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
> The package was renamed from `dsh-wallet` to `deepseek-harness-wallet` in 0.1.1. If you installed the old name, remove it with `dsh plugin --profile web remove dsh-wallet` first.
|
|
111
|
+
|
|
112
|
+
## Browser, desktop, and OS compatibility
|
|
113
|
+
|
|
114
|
+
The client contains no operating-system-specific feature branch; it checks the Web and host capabilities it needs. That makes the same code portable, but **portable code is not the same as real-device verification**:
|
|
115
|
+
|
|
116
|
+
| Verification level | Coverage |
|
|
117
|
+
| --- | --- |
|
|
118
|
+
| Real environment checked for this release | Windows + current Edge + DSH Web |
|
|
119
|
+
| Automated compatibility checks | Browser notification failure, in-page fallback, cross-tab fallback, storage fallback, CSS-scale fallback, and synchronous/asynchronous desktop adapters |
|
|
120
|
+
| Capability-compatible targets | Current Chrome, Edge, and Firefox on Windows/macOS/Linux; Safari on macOS; Electron/Tauri-style DSH wrappers that provide the requirements below |
|
|
121
|
+
|
|
122
|
+
The last row describes intended compatibility, not a claim that every browser/OS/wrapper combination was physically tested. If system notifications are unavailable or denied, reminders fall back to an in-page notice; if Web Locks are unavailable, a renewable local-storage lease coordinates reminder ownership across tabs. CSS `zoom` also has a transform fallback. Core wallet data, controls, dragging, docking, scaling, and visibility settings use these shared paths rather than an OS name check.
|
|
123
|
+
|
|
124
|
+
Electron, Tauri, and other DSH desktop wrappers can run the wallet when they expose the normal DSH Web plugin loader, slots, wallet HTTP endpoints, DOM, and `fetch`. A wrapper that restricts native notifications, persistent storage, or external links may define one optional adapter before the plugin bundle loads:
|
|
125
|
+
|
|
126
|
+
```js
|
|
127
|
+
window.__DSH_WALLET_ADAPTER__ = {
|
|
128
|
+
// All fields are optional. Keep storage synchronous and localStorage-compatible.
|
|
129
|
+
storage: { getItem, setItem, removeItem },
|
|
130
|
+
notify({ title, body, tag, requireInteraction, onClick, onClose }) {
|
|
131
|
+
// May return a notification-like handle, Promise, or nothing.
|
|
132
|
+
// Call the supplied onClick/onClose callbacks for native events.
|
|
133
|
+
},
|
|
134
|
+
requestNotificationPermission() { return 'granted' },
|
|
135
|
+
openExternal(url) { return true },
|
|
136
|
+
capabilities: { permanentDelete: true },
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
`notify()` may return a notification-like handle, a Promise for one, or nothing for fire-and-forget native APIs. The payload also includes `onClick` / `onClose` callbacks so Electron IPC, Tauri notification actions, and other desktop bridges can return events without copying wallet logic; returning `false` asks the wallet to use its browser fallback. `requestNotificationPermission()` is optional for hosts such as Tauri and macOS that require a native permission request. Returning `false` from `openExternal()` likewise asks the wallet to try the browser fallback. Declare `permanentDelete` only when the host actually implements the wallet preference and session-menu action; compatible hosts advertise it automatically, while unsupported hosts show a disabled control instead of a switch that has no effect. Platform adaptations are intentionally confined to `createCompatibilityAdapter()` in `lib/client.js`, so an Agent can add a new wrapper without editing wallet accounting or UI logic.
|
|
141
|
+
|
|
142
|
+
For buildable DSH hosts, the npm package and repository include a versioned [Agent-assisted permanent-delete integration kit](./integrations/dsh-session-delete/README.md) with a Chinese guide, complete Agent prompt, read-only preflight, compatibility manifest, upstream notice, and an exact-baseline reference patch. The patch is not a universal installer: a different DSH commit must be inspected and adapted by semantics, and closed or non-rebuildable desktop applications remain unsupported.
|
|
143
|
+
|
|
144
|
+
## Data & trust
|
|
145
|
+
|
|
146
|
+
| Item | Behavior |
|
|
147
|
+
| --- | --- |
|
|
148
|
+
| Token accounting | Listens to the `llm/stream` event and buckets per session and provider: `deepseek-official` plus explicitly opted-in wrapper routes use the official bucket; other providers stay third-party; each usage event also locks its contemporaneous official price, so multiple sessions and pricing windows never mix. |
|
|
149
|
+
| Balance | The wallet plugin itself sends the active key directly only to the official `/user/balance` endpoint. When multi-account switching is enabled, the selected key is also written into the DSH credentials seam; DSH may then use it for subsequent model requests. |
|
|
150
|
+
| Accounts | Keys live encrypted in `$DSH_HOME/storages/accounts.json`, with an encrypted `accounts.json.bak` fallback for a missing, corrupt, or undecryptable primary. Windows uses current-user DPAPI; other platforms use an owner-only AES-GCM key file, so move `accounts.json`, `.bak`, and `.key` together. If neither copy can be read, account writes fail closed. |
|
|
151
|
+
| Usage ledger | Local events live in `$DSH_HOME/storages/wallet.json` with a `wallet.json.bak` recovery copy. Missing/corrupt primaries recover automatically; if neither copy is readable, wallet writes fail closed. Up to 365 days of session/provider/model/token metadata and locked cost are kept—never prompts, tool arguments, or response bodies. |
|
|
152
|
+
| Local settings | Layout, scale, visibility, reminder, and panel settings stay in browser-compatible local storage. |
|
|
153
|
+
| Permanent deletion | Opt-in and host-gated. The wallet never advertises the action unless the host implements the matching session deletion path. |
|
|
154
|
+
| Model surface | No tools registered, no prompt injection, zero token cost. |
|
|
155
|
+
| Recharge | The URL is hardcoded to the official `https://platform.deepseek.com/top_up` and is not user-configurable (anti-phishing). |
|
|
156
|
+
|
|
157
|
+
## Pricing timeline
|
|
158
|
+
|
|
159
|
+
CNY per 1M tokens, curated from official announcements (cache writes are not billed):
|
|
160
|
+
|
|
161
|
+
- Since 2025-02-09 — deepseek-chat 2/8 (cache read 0.5), deepseek-reasoner 4/16 (cache read 1)
|
|
162
|
+
- Since 2026-04-24 — v4-flash 1/2 (cache read 0.02), v4-pro 3/6 (cache read 0.025)
|
|
163
|
+
- Since 2026-08-17 00:00 Beijing — peak/off-peak pricing for the v4 models (peak windows Beijing 09:00–12:00 / 14:00–18:00; off-peak is half the peak rate):
|
|
164
|
+
- v4-flash (off-peak / peak): cache read 0.05 / 0.10, input 1.5 / 3, output 4.5 / 9
|
|
165
|
+
- v4-pro (off-peak / peak): cache read 0.15 / 0.30, input 4.5 / 9, output 13.5 / 27
|
|
166
|
+
- Since 2026-08-21 — v4-flash-vision-exp launched with the V4 Flash peak/off-peak table: cache read 0.05 / 0.10, input 1.5 / 3, output 4.5 / 9.
|
|
167
|
+
- Since 2026-08-23 00:00 Beijing — Saturday and Sunday are no longer split into peak/off-peak windows; weekend calls use the off-peak rates all day. Weekday peak windows remain 09:00–12:00 and 14:00–18:00.
|
|
168
|
+
|
|
169
|
+
Historical deepseek-chat and deepseek-reasoner records retain their original flat-rate table; this is not a claim that those legacy model names remain currently available. Each usage event is priced when it arrives; upgrading from 0.1.2 migrates legacy counters once using the then-current rate. Costs are estimates; the API-returned balance is authoritative.
|
|
170
|
+
|
|
171
|
+
## Roadmap
|
|
172
|
+
|
|
173
|
+
- [x] 365-day Token heatmap and rebuildable local usage ledger
|
|
174
|
+
- [x] Z.ai Coding Plan Global/China monitoring on a generic official-plan adapter contract
|
|
175
|
+
- [ ] Additional provider price/balance adapters only after real-account validation
|
|
176
|
+
|
|
177
|
+
## License
|
|
178
|
+
|
|
179
|
+
[MIT](LICENSE)
|