@kenz1117/dsh-ui-usage-billing 0.9.2 → 0.9.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.
Files changed (3) hide show
  1. package/README.en.md +20 -19
  2. package/README.md +20 -19
  3. package/package.json +1 -1
package/README.en.md CHANGED
@@ -5,11 +5,13 @@
5
5
  <p align="center">A billing dashboard plugin for DeepSeek Harness — aggregates model usage in real time from persisted session logs and estimates cost against current multi-provider prices, shown in a one-click dashboard from the sidebar.</p>
6
6
 
7
7
  <p align="center">
8
- [![GitHub license](https://img.shields.io/github/license/kenz1117/dsh-ui-usage-billing)](https://github.com/kenz1117/dsh-ui-usage-billing/blob/main/LICENSE)
9
- [![GitHub stars](https://img.shields.io/github/stars/kenz1117/dsh-ui-usage-billing)](https://github.com/kenz1117/dsh-ui-usage-billing)
10
- [![GitHub last commit](https://img.shields.io/github/last-commit/kenz1117/dsh-ui-usage-billing)](https://github.com/kenz1117/dsh-ui-usage-billing)
11
- [![npm version](https://img.shields.io/npm/v/@kenz1117/dsh-ui-usage-billing)](https://www.npmjs.com/package/@kenz1117/dsh-ui-usage-billing)
12
- [![Awesome DSH Plugin](https://awesome-dsh-plugin.com/badge.svg)](https://awesome-dsh-plugin.com)
8
+ <a href="https://github.com/kenz1117/dsh-ui-usage-billing/blob/main/LICENSE"><img alt="GitHub license" src="https://img.shields.io/github/license/kenz1117/dsh-ui-usage-billing"></a>
9
+ <a href="https://github.com/kenz1117/dsh-ui-usage-billing"><img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/kenz1117/dsh-ui-usage-billing"></a>
10
+ <a href="https://www.npmjs.com/package/@kenz1117/dsh-ui-usage-billing"><img alt="npm version" src="https://img.shields.io/npm/v/@kenz1117/dsh-ui-usage-billing"></a>
11
+ <a href="https://www.npmjs.com/package/@kenz1117/dsh-ui-usage-billing"><img alt="npm downloads" src="https://img.shields.io/npm/dm/@kenz1117/dsh-ui-usage-billing"></a>
12
+ <a href="https://github.com/kenz1117/dsh-ui-usage-billing/issues"><img alt="GitHub issues" src="https://img.shields.io/github/issues/kenz1117/dsh-ui-usage-billing"></a>
13
+ <a href="https://github.com/kenz1117/dsh-ui-usage-billing/graphs/contributors"><img alt="GitHub contributors" src="https://img.shields.io/github/contributors/kenz1117/dsh-ui-usage-billing"></a>
14
+ <a href="https://awesome-dsh-plugin.com"><img alt="Awesome DSH Plugin" src="https://awesome-dsh-plugin.com/badge.svg"></a>
13
15
  </p>
14
16
 
15
17
  [English](README.en.md) · [中文](README.md)
@@ -20,38 +22,37 @@
20
22
 
21
23
  > **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.
22
24
 
25
+ ### Demo GIF
26
+
27
+ ![Demo](screenshots/demo.gif)
28
+
23
29
  ## Features
24
30
 
25
31
  - **Sidebar entry**: a dashboard-style trigger card above the Settings button — month cost as the headline number (monospace) with a 7-day sparkline mini-trend, second line "Today / This week"; collapses to an icon button; hover reveals a quick-look card.
26
32
  - **Billing dashboard (tabbed)**: Overview / Trends / Providers / Stats / Rates / Settings — hero figures + YoY/DoD + month projection + KPI×4 + heatmap; 7/30-day trend; provider billing & subscriptions; export / cost breakdown / workspaces / session detail; model rate table; budget & peak alerts. Restrained tones, `--dsw-*` tokens, dark/light adaptive.
33
+
34
+ ![Overview: month cost hero, budget progress, KPIs and usage heatmap](screenshots/1.png)
27
35
  - **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).
28
36
  - **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".
29
37
  - **Live-priced rate table**: models.dev fetched pricing + live-model alignment — the models actually configured are all included; peak/off-peak split (weekdays 9-12 / 14-18 peak ×2, weekends off-peak all day) plus a live USD→CNY rate, refreshed every 6 hours.
38
+
39
+ ![Rates: model rate table (peak/off-peak split and live rate)](screenshots/5.png)
30
40
  - **Official vs third-party buckets**: the detail cost column is split by official DeepSeek direct / third-party relay ("official x / third y" when mixed); the Stats tab has an official/third-party summary card.
31
41
  - **Monthly budget + tier alerts**: a budget bar (on/off / amount / progress, ≥80% amber, over red pulse); notifies once per tier crossing 50/80/100%; a balance below the threshold (in CNY) alerts once a day.
32
42
  - **Subscription quota**: detects subscription providers in `llm-pi-ai` (Kimi / Z.ai / OpenCode Go / MiniMax / OpenRouter / Xiaomi / Volcano…); those with a quota API show remaining % and reset time live, exhausted in red, no API shown as "not wired"; subscription-channel model cost is 0.
43
+
44
+ ![Providers: provider billing & subscriptions (balance, plan quota, model usage)](screenshots/3.png)
33
45
  - **Custom provider balance**: configure any HTTP endpoint for balance (`extract` supports constant / dot-path / add-subtract / divide, header `{{ENV}}` via the credentials seam); DeepSeek / Kimi / StepFun / SiliconFlow have built-in official balances, and the balance column estimates "≈N days" from the 7-day daily burn.
34
46
  - **Real usage aggregation**: the server aggregates from session logs on demand (incremental cache recomputes only written sessions), with per-session corruption tolerance and snapshot fallback; the `usage_stats` tool lets the model query today / month spend.
35
47
  - **Multi-language + dual currency**: the ¥/$ switch is bilingual (USD→English, CNY→Chinese, this plugin only); the rate table converts to the selected currency.
36
48
  - **Model health + uncatalogued annotation**: provider connection dots (green / red / grey); a model id not in the catalog is marked "uncatalogued" priced at the fallback, with provider inferred (e.g. `mi-mimo-2.5` → Xiaomi); estimated-price models are marked "estimated".
37
49
  - **Session detail + cost spikes + heatmap**: sessions sorted by cost (title / project / calls / cost / last active); per-turn cost bars (last 40 turns, amount at bar top, peak/off-peak background bands, >2× spike flagged with attribution); a monthly calendar heatmap (5-color scale, hover detail).
38
- - **Export + offline self-contained**: the Stats tab exports daily / per-session CSV and full JSON; no chart library, no external CDN, pure design tokens.
39
50
 
40
- ## Screenshots
51
+ ![Trends: daily cost trend, per-turn costs and peak/off-peak share](screenshots/2.png)
41
52
 
42
- ![Overview: month cost hero, budget progress, KPIs and usage heatmap](screenshots/1.png)
43
-
44
- ![Trends: daily cost trend, per-turn costs and peak/off-peak share](screenshots/2.png)
45
-
46
- ![Providers: provider billing & subscriptions (balance, plan quota, model usage)](screenshots/3.png)
47
-
48
- ![Stats: export, cost breakdown, workspaces and session detail](screenshots/4.png)
49
-
50
- ![Rates: model rate table (peak/off-peak split and live rate)](screenshots/5.png)
51
-
52
- ### Demo video
53
+ - **Export + offline self-contained**: the Stats tab exports daily / per-session CSV and full JSON; no chart library, no external CDN, pure design tokens.
53
54
 
54
- <video src="screenshots/demo.mp4" poster="screenshots/1.png" controls width="100%"></video>
55
+ ![Stats: export, cost breakdown, workspaces and session detail](screenshots/4.png)
55
56
 
56
57
  ## Quick start
57
58
 
package/README.md CHANGED
@@ -5,11 +5,13 @@
5
5
  <p align="center">DeepSeek Harness 计费仪表盘插件 — 从持久化会话日志实时聚合模型用量,按多厂商最新官方价格估算费用,侧边栏一键查看完整仪表盘。</p>
6
6
 
7
7
  <p align="center">
8
- [![GitHub license](https://img.shields.io/github/license/kenz1117/dsh-ui-usage-billing)](https://github.com/kenz1117/dsh-ui-usage-billing/blob/main/LICENSE)
9
- [![GitHub stars](https://img.shields.io/github/stars/kenz1117/dsh-ui-usage-billing)](https://github.com/kenz1117/dsh-ui-usage-billing)
10
- [![GitHub last commit](https://img.shields.io/github/last-commit/kenz1117/dsh-ui-usage-billing)](https://github.com/kenz1117/dsh-ui-usage-billing)
11
- [![npm version](https://img.shields.io/npm/v/@kenz1117/dsh-ui-usage-billing)](https://www.npmjs.com/package/@kenz1117/dsh-ui-usage-billing)
12
- [![Awesome DSH Plugin](https://awesome-dsh-plugin.com/badge.svg)](https://awesome-dsh-plugin.com)
8
+ <a href="https://github.com/kenz1117/dsh-ui-usage-billing/blob/main/LICENSE"><img alt="GitHub license" src="https://img.shields.io/github/license/kenz1117/dsh-ui-usage-billing"></a>
9
+ <a href="https://github.com/kenz1117/dsh-ui-usage-billing"><img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/kenz1117/dsh-ui-usage-billing"></a>
10
+ <a href="https://www.npmjs.com/package/@kenz1117/dsh-ui-usage-billing"><img alt="npm version" src="https://img.shields.io/npm/v/@kenz1117/dsh-ui-usage-billing"></a>
11
+ <a href="https://www.npmjs.com/package/@kenz1117/dsh-ui-usage-billing"><img alt="npm downloads" src="https://img.shields.io/npm/dm/@kenz1117/dsh-ui-usage-billing"></a>
12
+ <a href="https://github.com/kenz1117/dsh-ui-usage-billing/issues"><img alt="GitHub issues" src="https://img.shields.io/github/issues/kenz1117/dsh-ui-usage-billing"></a>
13
+ <a href="https://github.com/kenz1117/dsh-ui-usage-billing/graphs/contributors"><img alt="GitHub contributors" src="https://img.shields.io/github/contributors/kenz1117/dsh-ui-usage-billing"></a>
14
+ <a href="https://awesome-dsh-plugin.com"><img alt="Awesome DSH Plugin" src="https://awesome-dsh-plugin.com/badge.svg"></a>
13
15
  </p>
14
16
 
15
17
  [中文](README.md) · [English](README.en.md)
@@ -20,38 +22,37 @@
20
22
 
21
23
  > **峰谷计费规则更新(自 2026-08-23(周日)00:00 起)**:DeepSeek 模型按官方新规计费——**工作日(周一至周五)** 继续执行原峰谷分段计费(高峰 09:00–12:00 / 14:00–18:00,×2);**周末(周六、周日)** 全天不再区分峰谷时段,统一按**低谷价**计费。插件计费引擎、费率表与每轮费用峰谷分带均已同步生效。
22
24
 
25
+ ### 演示动图
26
+
27
+ ![演示](screenshots/demo.gif)
28
+
23
29
  ## 特性
24
30
 
25
31
  - **侧边栏入口**:设置按钮上方的仪表盘式触发卡——本月费用主数字(等宽字体)+ 近 7 天 sparkline 迷你趋势,副行「今日 / 本周」;折叠栏自动切为图标钮;悬停浮现速览卡。
26
32
  - **计费仪表盘(分区 Tab)**:概览 / 趋势 / 明细 / 统计 / 费率 / 设置 六区——Hero 大数字 + 本年/今日环比 + 本月预计 + KPI×4 + 热力图;趋势图 7/30 天;厂商计费与订阅;导出 / 费用构成 / 工作区 / 会话明细;模型单价表;预算与峰谷提醒。克制冷调、`--dsw-*` 令牌、深浅主题自适应。
33
+
34
+ ![概览:本月费用 Hero、预算进度、KPI 与用量热力图](screenshots/1.png)
27
35
  - **即时代费用条**:输入框下方常驻「本轮 ¥x · 会话 ¥y」+ 峰谷档位与切换倒计时 + 订阅额度预警 chips(≤20% 浮现、≤10% 红)。
28
36
  - **峰/谷切换提醒**:切档前弹窗 + 可选系统通知(提前量 / 位置 / 模式 / 预览可配),区分「即将进峰时 ×2 可稍等」/「即将进平价 价格减半」。
29
37
  - **实时定价费率表**:models.dev 抓价 + 探活模型对标——系统实际配置模型全纳入;峰谷分时(工作日 9-12 / 14-18 高峰 ×2,周末全天低谷)+ 实时汇率(USD→CNY),每 6 小时刷新。
38
+
39
+ ![费率:模型单价表(峰谷分时与实时汇率)](screenshots/5.png)
30
40
  - **官方 vs 三方分桶**:明细费用列按官方 DeepSeek 直连 / 第三方中转分解(混合时「官 x / 三 y」),统计 Tab 有「官方/三方」汇总卡。
31
41
  - **月度预算 + 分档提醒**:预算条(开关 / 金额 / 进度,≥80% 琥珀、超支红脉);跨 50 / 80 / 100% 各提醒一次;余额折算 CNY 低于阈值每天提醒一次。
32
42
  - **订阅套餐额度**:识别 `llm-pi-ai` 里的订阅类 provider(Kimi / Z.ai / OpenCode Go / MiniMax / OpenRouter / 小米 / 火山…),有额度 API 的实时显示剩余%与重置时间、用尽标红,无 API 标「未接入」;订阅通道模型费用记 0。
43
+
44
+ ![明细:厂商计费与订阅(余额、套餐额度、模型用量)](screenshots/3.png)
33
45
  - **自定义 Provider 余额**:配置任意 HTTP 端点查余额(`extract` 支持常量 / 点路径 / add-subtract / divide,请求头 `{{ENV}}` 经凭据 seam);DeepSeek / Kimi / 阶跃星辰 / 硅基流动内置官方余额,余额列按近 7 天日均折算「约可撑 N 天」。
34
46
  - **真实用量聚合**:服务端从会话日志实时聚合(增量缓存只重算写过的会话),单会话损坏容错、快照落盘回退;`usage_stats` 工具让模型自查今天 / 本月花费。
35
47
  - **多语种 + 双币种**:¥ / $ 切换随币种双语(USD→英文、CNY→中文,仅本插件生效);费率表按所选币种换算。
36
48
  - **模型健康 + 未收录标注**:厂商接入状态圆点(绿 / 红 / 灰);模型 id 不在目录时标「未收录」按兜底价估算、厂商自动推断(如 `mi-mimo-2.5` → 小米);估算价模型标注「估算价」。
37
49
  - **会话明细 + 成本突增 + 热力图**:按会话费用倒序(标题 / 项目 / 调用 / 费用 / 最后活跃);每轮费用柱状图(最近 40 轮、金额贴柱顶、峰谷背景分带、超 2 倍红标归因);当月日历热力图(5 档色阶、悬停明细)。
38
- - **数据导出 + 离线自包含**:统计 Tab 导出按日 / 按会话 CSV 与全量 JSON;无图表库、无外部 CDN、纯设计令牌。
39
50
 
40
- ## 截图
51
+ ![趋势:每日费用趋势、每轮费用与峰谷时段占比](screenshots/2.png)
41
52
 
42
- ![概览:本月费用 Hero、预算进度、KPI 与用量热力图](screenshots/1.png)
43
-
44
- ![趋势:每日费用趋势、每轮费用与峰谷时段占比](screenshots/2.png)
45
-
46
- ![明细:厂商计费与订阅(余额、套餐额度、模型用量)](screenshots/3.png)
47
-
48
- ![统计:导出、费用构成、工作区与会话明细](screenshots/4.png)
49
-
50
- ![费率:模型单价表(峰谷分时与实时汇率)](screenshots/5.png)
51
-
52
- ### 演示视频
53
+ - **数据导出 + 离线自包含**:统计 Tab 导出按日 / 按会话 CSV 与全量 JSON;无图表库、无外部 CDN、纯设计令牌。
53
54
 
54
- <video src="screenshots/demo.mp4" poster="screenshots/1.png" controls width="100%"></video>
55
+ ![统计:导出、费用构成、工作区与会话明细](screenshots/4.png)
55
56
 
56
57
  ## 快速开始
57
58
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kenz1117/dsh-ui-usage-billing",
3
3
  "description": "Usage billing dashboard for DeepSeek Harness: sidebar cost metrics plus a full dashboard modal, priced from a current multi-provider catalog with real usage aggregated from session logs.",
4
- "version": "0.9.2",
4
+ "version": "0.9.3",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },