@kenz1117/dsh-ui-usage-billing 1.0.20 → 1.1.1

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.en.md CHANGED
@@ -21,6 +21,12 @@
21
21
 
22
22
  ---
23
23
 
24
+ > **Rate-table display update (2026-08-27)**: the models.dev supplement is **no longer rendered in full** — the rate table previously listed all ~5900 models from 158 gateway providers, drowning out the ones actually in use. The table now contains only the built-in catalog plus probed (configured and reachable) models. Billing is unaffected: models outside the catalog but priced on models.dev are still estimated at their official USD prices when hit; they just no longer appear in the table.
25
+
26
+ > **Qwen family pricing update (2026-08-27)**: aligned with the latest Alibaba Cloud Model Studio list prices — **Qwen3.7-Max** corrected to official list price (input ¥12 / explicit-cache hit ¥1.2 / output ¥36, previously recorded at the discounted promo rate). The current official 50%-off promotion has **no announced end date**: the rate table shows the discounted price with a red promo badge (hover for details), and resumes list-price display once an end date is filled in after the announcement. The Qwen family also gains **supplementary pricing reference rows** (Batch File standing half-price tier, Batch Chat, explicit-cache create/hit — display-only, excluded from estimation); Qwen3-Coder Plus officially does not support batch inference, so only the explicit-cache rows are listed.
27
+
28
+ > **Peak/off-peak pricing update (from 2026-08-23 (Sun) 00:00 Beijing)**: DeepSeek models follow the new official rule — **weekdays (Mon–Fri)** keep the original peak/off-peak split (peak 09:00–12:00 / 14:00–18:00, ×2); **weekends (Sat/Sun)** are no longer split and are billed at the **off-peak price** all day. The plugin's billing engine, rate table and per-turn peak/off-peak bands all reflect this.
29
+
24
30
  <div align="center">
25
31
  <img src="screenshots/demo.png" alt="dsh-ui-usage-billing — billing dashboard overview" width="80%">
26
32
  </div>
@@ -34,7 +40,7 @@
34
40
  - **Real usage, no fabricated samples** — the server aggregates from persisted session logs and estimates against live multi-provider official prices; it shows an empty snapshot until real data arrives.
35
41
  - **Everything on one screen** — a sidebar trigger card plus a full dashboard (Overview / Trends / Providers / Stats / Rates / Settings) across six tabs: month / today / projection / heatmap / trend.
36
42
  - **Subscriptions · balance · quota · reconcile** — plan quota, multi-provider balance, relay-station quota, declared endpoints and balance-delta reconciliation form a cross-verifiable billing loop.
37
- - **Peak/off-peak pricing + switch alerts** — weekday peak split and weekend all-day off-peak, **priced per official change boundary** (base price before 08-17, weekend peak hours 08-17~08-23, weekend all-day off-peak from 08-23), with a popover / system notification before a tier switch, configurable lead time.
43
+ - **Peak/off-peak pricing + switch alerts** — weekday peak split and weekend all-day off-peak, with a popover / system notification before a tier switch, configurable lead time.
38
44
  - **Offline & self-contained** — no chart library, no external CDN, pure design tokens; lightweight and ready to use.
39
45
  - **Multi-language + dual currency** — Chinese / English, ¥/$ toggle that only affects this plugin.
40
46
 
@@ -44,7 +50,7 @@
44
50
  - **Billing dashboard (tabbed)**: Overview / Trends / Providers / Stats / Rates / Settings — hero figures + YoY/DoD + month projection + KPI×4 + heatmap; 7/30-day trend (switches between Cost / Tokens); provider billing & subscriptions; export / cost breakdown / workspaces / session detail; model rate table; budget & peak alerts. Restrained tones, `--dsw-*` tokens, dark/light adaptive.
45
51
 
46
52
  ![Overview: month cost hero, budget progress, KPIs and usage heatmap](screenshots/1.png)
47
- - **Live cost bar**: below the composer, persistent "This turn ¥x · Session ¥y" plus the peak/off-peak tier & switch countdown and subscription low-quota chips (≤20% appear, ≤10% red); the whole capsule can be hidden via the settings-tab "Live cost capsule" toggle (display-only preference persisted locally; stats and alerts are unaffected).
53
+ - **Live cost bar**: below the composer, persistent "This turn ¥x · Session ¥y" plus the peak/off-peak tier & switch countdown and subscription low-quota chips (≤20% appear, ≤10% red).
48
54
  - **Peak/off-peak switch alert**: a popover before a tier switch plus an optional system notification (lead time / position / mode / preview configurable), distinguishing "About to enter peak ×2 — can wait" / "About to enter off-peak, price halves".
49
55
  - **Plugin info card**: a persistent "About" card in the Settings tab — name, description, author (jump to GitHub), source repo, npm, MIT license, version (read server-side from the package's `package.json`, single source of truth, correct on publish).
50
56
 
@@ -70,8 +76,8 @@
70
76
  ## 📈 Usage visualizations
71
77
 
72
78
  - **Session detail + cost spikes + heatmap**: sessions sorted by cost (title / project / calls / cost / last active); per-turn cost bars (peak/off-peak background bands, >2× spike flagged with attribution); month / year calendar heatmap (5-color scale, hover detail; the year view is ~52 weeks, GitHub-style), with active-day and streak counts on top.
73
- - **Performance metrics**: per-model first-token latency (TTFT) mean / P50 / P90, generation speed (tokens/s), total-latency mean; per-hour × per-model comparison curve — metric tabs (TTFT / tok/s), clickable model chips (top-5 by samples lit by default, one-click select-all), hover snapping to the nearest hour with a crosshair and per-model tooltip, broken lines for missing-sample hours (never fabricated); view preferences persist locally.
74
- - **Token insights**: a dedicated "Tokens" tab — the daily token chart switches between two views: "Structure" stacks "input (cache miss) / input (cache hit) / output" (including reasoning), while "By model" stacks each day by model (same per-model colors as the trends tab; the toggle hides itself when the snapshot carries no per-day-per-model detail); the hover tooltip shows the day's exact breakdown (per-bucket in structure view, per-model "hit / miss / output" in model view, thousand-separated); clicking a legend swatch or a model-table row focuses that model (other segments dim, y-axis unchanged, click again to release); per-model totals and share, structural KPIs (cache-hit rate / reasoning share / input-output ratio / peak day); per-day token CSV and JSON export (JSON includes the per-day-per-model detail).
79
+ - **Performance metrics**: per-model first-token latency (TTFT) mean / P50 / P90, generation speed (tokens/s), total-latency mean, plus per-hour TTFT and speed curves aggregating by Beijing hour; rendered in the Stats tab as a per-model performance table and per-hour TTFT/speed dual line charts.
80
+ - **Token insights**: a dedicated "Tokens" tab — daily token stacks colored by "input (cache miss) / input (cache hit) / output" (including reasoning), per-model totals and share, structural KPIs (cache-hit rate / reasoning share / input-output ratio / peak day); per-day token CSV and JSON export.
75
81
 
76
82
  ![Trends: daily cost trend, per-turn costs and peak/off-peak share](screenshots/2.png)
77
83
  - **Export + offline self-contained**: the Stats tab exports daily / per-session / per-site CSV and full JSON; cost breakdown / workspaces / session-detail sections are drillable (click a project row to expand its sessions); no chart library, no external CDN, pure design tokens.
@@ -144,7 +150,7 @@ cost (CNY) = (missInput × p_input + cacheHit × p_cacheHit + output × p_output
144
150
 
145
151
  | Provider | Models |
146
152
  | -------- | ------------------------------------------------------------------------------------------- |
147
- | DeepSeek | V4 Flash, V4 Flash Vision (Exp), V4 Pro (priced per official change boundary: base tier peak/off-peak v1 → weekend off-peak) |
153
+ | DeepSeek | V4 Flash, V4 Flash Vision (Exp), V4 Pro (peak/off-peak billing: weekdays peak 09:00-12:00 / 14:00-18:00 Beijing = 2× off-peak; weekends off-peak all day) |
148
154
  | Zhipu AI | GLM-5.3, GLM-5.2, GLM-5.1, GLM-5-Turbo, GLM-4.7, GLM-4.6, GLM-4.5-Air, GLM-5V-Turbo |
149
155
  | Aliyun | Qwen3.8 Max, Qwen3.7-Max, Qwen3.5-Plus, Qwen3.5-Flash |
150
156
  | Doubao | Seed-2.0 Pro, Seed-2.0 Mini, Seed-1.6 |
@@ -212,7 +218,7 @@ None. This plugin is a pure UI surface: it registers no tools, injects no system
212
218
 
213
219
  ## ⚠️ Known Limitations and Deferred Work
214
220
 
215
- - **Balance queries cover DeepSeek / Moonshot (Kimi) / StepFun / SiliconFlow / xAI / Zhipu GLM (Z.ai CN region) / Tencent Cloud TokenHub (token-plan quota)**: the first six use a standard Bearer API key; Tencent Cloud uses the cloud-API key pair (`<SecretId>:<SecretKey>`, TC3-signed management API). Other providers expose no public balance API or need non-Bearer auth (Xiaomi MiMo via console Cookie, SenseTime via AccessKey signing, MiniMax/Doubao via quota or AK/SK), so they currently show "not configured"; the extension point is `src/balance.ts` (add a querier per provider balance API).
221
+ - **Balance queries cover DeepSeek / Moonshot (Kimi) / StepFun / SiliconFlow / xAI / Zhipu GLM (Z.ai CN region)**: these use a standard Bearer API key. Other providers expose no public balance API or need non-Bearer auth (Xiaomi MiMo via console Cookie, SenseTime via AccessKey signing, MiniMax/Doubao via quota or AK/SK), so they currently show "not configured"; the extension point is `src/balance.ts` (add a querier per provider balance API).
216
222
  - **Relay quota depends on upstream private schemas**: New API / Sub2API interface fields are not public, so an unreadable station is labeled "no quota" rather than fabricating an amount; if a station's response fields differ, extend the parsers in `src/relay.ts`. An "unknown route" means that route no longer exists in the current provider config (renamed / deleted); historical call data is not lost — re-adding the same-named route restores attribution automatically.
217
223
  - **Overspend notifications rely on the browser Notification API**: when permission is denied or the platform lacks support, only the in-UI red-pulse fallback remains — no host-level notification channel; notifications are capped at once per day.
218
224
  - **Session rows are not navigable**: clicking a session row does not open that session (cross-plugin navigation needs a host session-selection channel); sessions are capped at 100 rows and the panel shows the top 20.
@@ -221,9 +227,8 @@ None. This plugin is a pure UI surface: it registers no tools, injects no system
221
227
 
222
228
  ## ❤️ Contributors
223
229
 
224
- - [@ciphoo](https://github.com/ciphoo) — MiniMax CN Token Plan quota support (PR #5), `minimax-cn` subscription key wiring (PR #12), a concurrent-ledger-write `MoveFileExW EPERM` fix on Windows (PR #11)
230
+ - [@ciphoo](https://github.com/ciphoo) — MiniMax CN Token Plan quota support (PR #5)
225
231
  - [@fabulousyuann-tech](https://github.com/fabulousyuann-tech) — durable ledger that retains usage after session deletion (PR #8)
226
- - [@hi-fangj](https://github.com/hi-fangj) — hover tooltip with the exact per-day token breakdown on the token daily chart (PR #21), the live-cost capsule toggle (PR #22), the per-model view and legend focus for the token daily chart (PR #23), and the per-model comparison curve in the perf panel (PR #24)
227
232
 
228
233
  ## 📄 License
229
234
 
package/README.md CHANGED
@@ -21,6 +21,12 @@
21
21
 
22
22
  ---
23
23
 
24
+ > **费率表展示规则更新(2026-08-27)**:models.dev 聚合的补充价目**不再整表渲染**——此前费率表会把 158 个网关厂商的全部约 5900 个模型一并铺出,淹没实际在用的条目;现在表格只包含内置目录与系统探活命中的模型。计费能力不受影响:目录外但 models.dev 有价的模型命中时仍按其官方 USD 价正常估算,只是不再出现在表格里。
25
+
26
+ > **千问(Qwen)系列价格更新(2026-08-27)**:对齐阿里云百炼最新官方刊例——**Qwen3.7-Max** 更正为官方原价(输入 ¥12 / 显式缓存命中 ¥1.2 / 输出 ¥36,此前误录活动折后价),当前官方限时 5 折且**未公布截止时间**,费率表按折后价显示并挂红色促销徽章(悬停提示活动性质),公告截止后补填日期即自动恢复原价展示;Qwen 全系补充**附加计价参考行**(Batch File 长期半价档、Batch Chat、显式缓存创建/命中,纯展示不参与估算计费);Qwen3-Coder Plus 官方明确不支持批量推理,仅列显式缓存两行。
27
+
28
+ > **峰谷计费规则更新(自 2026-08-23(周日)00:00 起)**:DeepSeek 模型按官方新规计费——**工作日(周一至周五)** 继续执行原峰谷分段计费(高峰 09:00–12:00 / 14:00–18:00,×2);**周末(周六、周日)** 全天不再区分峰谷时段,统一按**低谷价**计费。插件计费引擎、费率表与每轮费用峰谷分带均已同步生效。
29
+
24
30
  <div align="center">
25
31
  <img src="screenshots/demo.png" alt="dsh-ui-usage-billing — 计费仪表盘总览" width="80%">
26
32
  </div>
@@ -32,9 +38,9 @@
32
38
  ## ✨ 核心亮点
33
39
 
34
40
  - **真实用量,不伪造样本** — 服务端从持久化会话日志实时聚合,按实时多厂商官方价估算;数据到达前显示空快照,绝不展示假数据。
35
- - **一屏看懂一切** — 侧边栏触发卡 + 全屏仪表盘(概览 / Token / 用量 / 趋势 / 费率 / 设置)六区,本月/今日/预计/热力图/趋势全在。
41
+ - **一屏看懂一切** — 侧边栏触发卡 + 全屏仪表盘(概览 / 趋势 / 明细 / 统计 / 费率 / 设置)六区,本月/今日/预计/热力图/趋势全在。
36
42
  - **订阅 · 余额 · 额度 · 对账** — 订阅套餐额度、多厂商余额、中转站额度、声明端点、余额差对账,形成可交叉验证的计费闭环。
37
- - **峰谷计价 + 切换提醒** — 工作日峰谷分时、周末全天低谷,**按官方变更节点分段计价**(8-17 前基础价、8-17~8-23 周末计峰、8-23 起周末全谷),切档前弹窗/系统通知,提前量可配。
43
+ - **峰谷计价 + 切换提醒** — 工作日峰谷分时、周末全天低谷,切档前弹窗/系统通知,提前量可配。
38
44
  - **离线自包含** — 无图表库、无外部 CDN、纯设计令牌;依赖极轻,随装随用。
39
45
  - **多语种 + 双币种** — 中文/English、¥/≈$ 切换,只对本插件生效。
40
46
 
@@ -44,14 +50,13 @@
44
50
  - **计费仪表盘(分区 Tab)**:概览 / 趋势 / 明细 / 统计 / 费率 / 设置 六区——Hero 大数字 + 本年/今日环比 + 本月预计 + KPI×4 + 热力图;趋势图 7/30 天(可切费用 / Token);厂商计费与订阅;导出 / 费用构成 / 工作区 / 会话明细;模型单价表;预算与峰谷提醒。克制冷调、`--dsw-*` 令牌、深浅主题自适应。
45
51
 
46
52
  ![概览:本月费用 Hero、预算进度、KPI 与用量热力图](screenshots/1.png)
47
- - **即时代费用条**:输入框下方常驻「本轮 ¥x · 会话 ¥y」+ 峰谷档位与切换倒计时 + 订阅额度预警 chips(≤20% 浮现、≤10% 红);可在设置 Tab 以「平价消耗胶囊」开关整条隐藏(显示偏好本地持久化,统计与提醒不受影响)。
53
+ - **即时代费用条**:输入框下方常驻「本轮 ¥x · 会话 ¥y」+ 峰谷档位与切换倒计时 + 订阅额度预警 chips(≤20% 浮现、≤10% 红)。
48
54
  - **峰/谷切换提醒**:切档前弹窗 + 可选系统通知(提前量 / 位置 / 模式 / 预览可配),区分「即将进峰时 ×2 可稍等」/「即将进平价 价格减半」。
49
55
  - **插件信息卡**:设置 Tab 常驻「关于」卡——插件名、描述、作者(可跳 GitHub)、源码仓库、npm、许可证 MIT、版本号(服务端读自包 `package.json`,单一来源,发布自动正确)。
50
56
 
51
57
  ## 💰 计费引擎
52
58
 
53
- - **实时定价费率表**:models.dev 抓价 + 探活模型对标——系统实际配置模型全纳入;峰谷分时(工作日 9-12 / 14-18 高峰 ×2,周末全天低谷;历史费用按官方变更节点分段计价,见下方「计费细节」)+ 实时汇率(USD→CNY),每 6 小时刷新。
54
- - **自定义单价**:设置面板为未收录或变价模型填入实付价(未命中 / 缓存命中 / 输出,可选 USD 与低谷价三栏),总览与日趋势按用户价重估显示;支持按中转站来源绑定同模型不同价(origin 规范化宽松匹配),目录外模型填价即生效。
59
+ - **实时定价费率表**:models.dev 抓价 + 探活模型对标——系统实际配置模型全纳入;峰谷分时(工作日 9-12 / 14-18 高峰 ×2,周末全天低谷)+ 实时汇率(USD→CNY),每 6 小时刷新。
55
60
 
56
61
  ![费率:模型单价表(峰谷分时与实时汇率)](screenshots/5.png)
57
62
  - **官方 vs 三方分桶**:明细费用列按官方 DeepSeek 直连 / 第三方中转分解(混合时「官 x / 三 y」),统计 Tab 有「官方/三方」汇总卡。
@@ -61,7 +66,7 @@
61
66
  ## 🔌 订阅与余额
62
67
 
63
68
  - **订阅套餐额度**:识别 `llm-pi-ai` 里的订阅类 provider(Kimi / Z.ai / OpenCode Go / MiniMax / OpenRouter / 小米 / 火山…),有额度 API 的实时显示剩余%与重置时间、用尽标红,无 API 标「未接入」;订阅通道模型费用记 0。档位月费与周期额度口径由内置知识库自动识别(如 OpenCode Go $10/月 + 周 $30 额度)。**MiniMax 用户注意**:国内开发者环境请用 `minimax-token-plan-cn`(自动对接 `https://api.minimaxi.com`);国际保留 `minimax` / `minimax-token-plan`(默认 `https://www.minimaxi.com`);需要自配中转或 staging 时可在该 provider 设置里覆盖 `baseUrl`。
64
- - **多厂商余额**:DeepSeek / Kimi / 阶跃星辰 / 硅基流动 / xAI / 智谱 GLM(Z.ai 国内域)内置官方余额,余额列按近 7 天日均折算「约可撑 N 天」;**腾讯云 TokenHub Token Plan** 余量已接入(云 API 管控面,TC3 签名)——凭据值填 `<SecretId>:<SecretKey>`(云 API 密钥对,非 TokenHub 推理 key),推理路由命名为 `tencent-tokenhub` / `tokenhub` / `tencent` / `tencentcloud` 任一即可命中。
69
+ - **多厂商余额**:DeepSeek / Kimi / 阶跃星辰 / 硅基流动 / xAI / 智谱 GLM(Z.ai 国内域)内置官方余额,余额列按近 7 天日均折算「约可撑 N 天」。
65
70
  - **自定义 Provider 余额**:配置任意 HTTP 端点查余额(`extract` 支持常量 / 点路径 / add-subtract / divide,请求头 `{{ENV}}` 经凭据 seam)。
66
71
  - **声明端点 + 余额对账**:**声明端点**(`declaredEndpoints`)为内置表没有的供应商自声明余额/额度接口——只写「数字在哪里」的点路径、无表达式;请求由匹配到同源 provider 的 origin 构造,安全边界(单斜杠绝对路径、仅 GET、拒跨源重定向、响应体/超时上限、凭据只取匹配 provider 自有 `apiKeyEnv`)由 `src/declarative.ts` 强制执行,取错路径在界面标注 `declared` 与 reason。**余额差对账**(`reconcilePath`)用官方(仅 DeepSeek 官方方向)余额当日变动与本地账本当日的官方渠道费用交叉校验,偏差超阈值(0.3 元且 >15%)时提示核对价格表或近期账单;充值 / 授信 / 币种变化重置基准而非告警、余额未减少(走订阅扣费)静默。
67
72
  - **中转站归组与额度**:按 provider 的 `baseURL` 归一化 origin 归组——同一中转站的多把 key 合并成一行,站名即域名;对配了 `baseURL` 的路由自动识别 New API 系(`/api/status`)与 Sub2API(`/v1/usage`)的**余额与滚动额度窗口**,读不出标「未读出额度」,剩余 <20% 标红;识别结果有 5 分钟指纹缓存(同站多把 key 独立熔断),`relay-quotas` 端点附 `diagnostics` 供「我的中转站为什么不显示」自查。项目归属优先用工作区标题命名。**未计价的模型**(目录外/无价)费用按 0 计,Hero 下会提示「N 个模型未收录计价」。
@@ -71,8 +76,8 @@
71
76
  ## 📈 用量可视化
72
77
 
73
78
  - **会话明细 + 成本突增 + 热力图**:按会话费用倒序(标题 / 项目 / 调用 / 费用 / 最后活跃);每轮费用柱状图(峰谷背景分带、超 2 倍红标归因);月 / 年日历热力图(5 档色阶、悬停明细;年视图近 52 周、GitHub 风格),头部显示活跃天数 / 连续使用天数。
74
- - **性能指标**:每个模型首字延时(TTFT)均值 / P50 / P90、生成速度(tokens/s)、总延迟均值;按小时×模型对比曲线——指标 tab 切换(首字延时 / 生成速度),模型 chip 点击开/关曲线(默认点亮样本数前 5,全选一键),悬停吸附最近小时显示十字线与逐模型数值,缺失样本小时断线不造假;视图偏好本地持久化。
75
- - **Token 统计洞察**:独立「Token」分区——每日 token 堆叠双视角切换:「按结构」按「输入(缓存未命中)/ 输入(缓存命中)/ 输出」三桶分色(含 reasoning 思考),「按模型」每天按模型堆叠(分色与趋势页一致,旧快照缺按日×模型明细时自动隐藏切换);悬停柱状图显示当日精确明细(结构视角给三桶逐项,模型视角给逐模型「命中/未命中/输出」,千分位不缩写);点击图例色块或模型 Token 表行可聚焦单个模型(其余段弱化、y 轴不变,再点解除),模型 token 总量与占比,结构 KPI(缓存命中率 / 思考占比 / 输入输出比 / 峰值日);按日 token CSV 与 JSON 导出(JSON 含按日×模型明细)。
79
+ - **性能指标**:每个模型首字延时(TTFT)均值 / P50 / P90、生成速度(tokens/s)、总延迟均值,另按北京时间小时聚合 TTFT 与速度曲线;统计 Tab 渲染为按模型性能表 + 按小时 TTFT/速度双折线。
80
+ - **Token 统计洞察**:独立「Token」分区——每日 token 堆叠按「输入(缓存未命中)/ 输入(缓存命中)/ 输出」三桶分色(含 reasoning 思考),模型 token 总量与占比,结构 KPI(缓存命中率 / 思考占比 / 输入输出比 / 峰值日);按日 token CSV 与 JSON 导出。
76
81
 
77
82
  ![趋势:每日费用趋势、每轮费用与峰谷时段占比](screenshots/2.png)
78
83
  - **数据导出 + 离线自包含**:统计 Tab 导出按日 / 按会话 / 按站点 CSV 与全量 JSON;费用构成 / 工作区 / 会话明细分区可下钻(点项目行展开该项目的会话);无图表库、无外部 CDN、纯设计令牌。
@@ -88,6 +93,12 @@
88
93
  - **数据导出防注入**:按日 / 按会话 / 按站点 CSV 对以 `=` / `+` / `-` / `@` 开头的单元格前置单引号,并完整转义逗号 / 引号 / 换行 / 回车,防止在 Excel / WPS 中被当作公式执行。
89
94
  - **隐私底线**:纯 UI surface,不注册工具、不注入系统提示、不向会话日志写入模型可见事件;仅从既有会话日志聚合,日志内容由其他包负责。
90
95
 
96
+ ## 📌 版本兼容
97
+
98
+ - **v1.1.x(本线)**:面向 DSH 正式版(`0.1.0-rc.8` ~ `0.1.1-rc.2`)的稳定兼容线,100% 可用。
99
+ - **v1.0.12 ~ v1.0.15**:0.1.2 迁移中间态,**低版本宿主请勿使用**(已知会导致 web 启动卡死,见 issue #25),已标记 deprecated。
100
+ - **v1.0.16+ / 2.0.0-alpha(npm `alpha` 标签)**:需要 DSH `0.1.2-alpha.1`+。本插件发布策略锚定官方正式版:正式版兼容优先 100% 保证,预览版宿主适配随 alpha 线提供、不作稳定承诺。
101
+
91
102
  ## 🚀 快速开始
92
103
 
93
104
  在宿主 `cordis.patch.yml` 中加入:
@@ -151,7 +162,7 @@ cost(CNY)= (missInput × p_input + cacheHit × p_cacheHit + output × p_outp
151
162
 
152
163
  | 厂商 | 代表模型 |
153
164
  | -------- | -------------------------------------------- |
154
- | DeepSeek | V4 Flash、V4 Pro(等 3 款;按官方变更节点分段计价:基础价 峰谷 v1 → 周末全谷) |
165
+ | DeepSeek | V4 Flash、V4 Pro(等 3 款;峰谷计费:工作日高峰 ×2、周末全天低谷) |
155
166
  | 智谱 AI | GLM-5.3、GLM-5.2(等 10 款) |
156
167
  | 阿里通义 | Qwen3.8 Max、Qwen3-Coder 480B(等 7 款) |
157
168
  | 字节豆包 | Doubao Seed-2.1 Pro、Doubao-Seed-Evolving(等 8 款) |
@@ -224,11 +235,11 @@ npm publish --access public
224
235
 
225
236
  - **权限等级:high**:读取持久会话日志(文件)、访问多厂商官方 / 订阅 / 余额 / 定价 API(网络)、经凭据 seam 读取 `apiKeyEnv`(凭据)、写入 `~/.dsh` 账本(持久状态);**不含**命令执行 / Shell。
226
237
  - **更新通道:`user-reviewed`**:本插件具备文件 / 网络 / 凭据能力,DSH STORE 采用每次安装需本机人工确认的通道;安装前请复核仓库、固定 Commit、生命周期脚本与影响范围。
227
- - **兼容范围**:DSH `0.1.2-alpha.1` 起声明为 `compatible`(见 `package.json` 的 `dsh.compatibility.dshReleases`);旧宿主(`0.1.0-rc.8` ~ `0.1.1-rc.2`)请停留在 v1.0.11。Node.js `^22.19.0 || >=24.0.0`。
238
+ - **兼容范围**:DSH `0.1.0-rc.8` / `0.1.1-rc.1` / `0.1.1-rc.2` 声明为 `compatible`(见 `package.json` 的 `dsh.compatibility.dshReleases`);Node.js `^22.19.0 || >=24.0.0`。
228
239
  - **生命周期**:无 `preinstall` / `install` / `postinstall` / `prepare`(安装即用)。
229
240
  - **不冒用官方**:仅新增自有 entry id `ui-usage-billing`;对 `@deepseek-ai/dsh-*` 仅为 `peerDependencies` 依赖(不重复安装 / 不替换 / 不遮蔽官方组件),包名使用第三方命名空间 `@kenz1117/*`。
230
241
  - **打包产物**:运行文件 `lib/*` 与 `cordis.patch.yml` 已随固定 Commit 提交并声明在 `files`。
231
- - **源码锚点**:源码以 GitHub 默认分支上的固定 Commit 锁定并可追溯;例如 v1.0.13 对应 `c8e2a325689fb823d90c5c44857e6224465ea6cf`。DSH STORE 自动化每约 8 小时重新读取默认分支 HEAD 作为新的固定 Commit,并按 SemVer 变更判定是否重新审查。
242
+ - **源码锚点**:源码以 GitHub 默认分支上的固定 Commit 锁定并可追溯;例如 v1.0.5 对应 `160f4cbfa4fa128adf5a2bf22983757605bcc096`。DSH STORE 自动化每约 8 小时重新读取默认分支 HEAD 作为新的固定 Commit,并按 SemVer 变更判定是否重新审查。
232
243
 
233
244
  ## 🤖 Model Experience
234
245
 
@@ -236,7 +247,7 @@ npm publish --access public
236
247
 
237
248
  ## ⚠️ Known Limitations and Deferred Work
238
249
 
239
- - **余额查询已接入 DeepSeek / 月之暗面(Kimi)/ 阶跃星辰(StepFun)/ 硅基流动 / xAI / 智谱 GLM(Z.ai 国内域)/ 腾讯云 TokenHub(Token Plan 余量)**:前六家用标准 Bearer API key,腾讯云用云 API 密钥对(TC3 签名)。其余厂商因无公开余额接口或需非 Bearer 鉴权(小米 MiMo 走控制台 Cookie、商汤走 AccessKey 签名、MiniMax/字节豆包走额度制或 AK/SK),暂显示「未配置」;扩展点在 `src/balance.ts`(按厂商余额 API 增加查询器)。
250
+ - **余额查询已接入 DeepSeek / 月之暗面(Kimi)/ 阶跃星辰(StepFun)/ 硅基流动 / xAI / 智谱 GLM(Z.ai 国内域)**:这些用标准 Bearer API key 即可查询。其余厂商因无公开余额接口或需非 Bearer 鉴权(小米 MiMo 走控制台 Cookie、商汤走 AccessKey 签名、MiniMax/字节豆包走额度制或 AK/SK),暂显示「未配置」;扩展点在 `src/balance.ts`(按厂商余额 API 增加查询器)。
240
251
  - **中转站额度依赖上游私有 schema**:New API / Sub2API 的接口字段未公开,读不出时标「未读出额度」而非臆造金额;若某中转站响应字段不同,需按 `src/relay.ts` 的解析器扩展。未知路由表示该路由在当前 provider 配置里已不存在(改过名 / 删除过),历史调用数据未丢,重新配置同名路由即可自动归位。
241
252
  - **超支通知依赖浏览器 Notification**:权限被拒绝或平台不支持时只有界面红色脉冲兜底,没有宿主级通知通道;通知上限为每天一次。
242
253
  - **会话明细不可跳转**:点击会话行不会打开对应会话(跨插件导航需要宿主会话选择通道);会话数封顶 100 行、面板只显示前 20 行。
@@ -245,9 +256,8 @@ npm publish --access public
245
256
 
246
257
  ## ❤️ Contributors
247
258
 
248
- - [@ciphoo](https://github.com/ciphoo) — MiniMax 国内域 Token Plan 订阅额度支持(PR #5)、`minimax-cn` 订阅凭据接线(PR #12)、Windows 下账本并发写入 `MoveFileExW EPERM` 修复(PR #11
259
+ - [@ciphoo](https://github.com/ciphoo) — MiniMax 国内域 Token Plan 订阅额度支持(PR #5)
249
260
  - [@fabulousyuann-tech](https://github.com/fabulousyuann-tech) — 会话删除后用量保留的持久 ledger 功能(PR #8)
250
- - [@hi-fangj](https://github.com/hi-fangj) — Token 每日图悬停精确明细(PR #21)、平价消耗胶囊开关(PR #22)、Token 每日图按模型视角与图例聚焦(PR #23)、性能面板按模型对比曲线(PR #24)
251
261
 
252
262
  ## 📄 许可证
253
263