@kenz1117/dsh-ui-usage-billing 1.8.1-alpha.2 → 1.8.2-alpha.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 +95 -89
- package/README.md +95 -90
- package/lib/client.js +5 -5
- package/lib/types/client/NativeSettingsSection.d.ts +11 -0
- package/lib/types/client/UsageBilling.d.ts +4 -1
- package/lib/types/client/domain/types.d.ts +2 -0
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/client/usage-billing-settings.d.ts +12 -2
- package/package.json +4 -1
package/README.en.md
CHANGED
|
@@ -1,33 +1,21 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
+
<img src="screenshots/demo.png" alt="dsh-ui-usage-billing — See every cent of your model spend" width="100%">
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
<p><strong>Real usage · Historical ledger · Peak/off-peak pricing · Subscription quotas</strong></p>
|
|
4
5
|
|
|
5
|
-
<p
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<a href="https://github.com/kenz1117/dsh-ui-usage-billing/blob/main/COMPATIBILITY.md"><img alt="DSH compat" src="https://img.shields.io/badge/DSH-0.1.2_%7E_0.2.1--rc.4-blue"></a>
|
|
13
|
-
<a href="https://github.com/kenz1117/dsh-ui-usage-billing/blob/main/LICENSE"><img alt="License MIT" src="https://img.shields.io/github/license/kenz1117/dsh-ui-usage-billing"></a>
|
|
14
|
-
<a href="https://github.com/kenz1117/dsh-ui-usage-billing/pulls"><img alt="PRs welcome" src="https://img.shields.io/badge/PRs-welcome-brightgreen"></a>
|
|
15
|
-
<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?logo=github"></a>
|
|
16
|
-
<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>
|
|
17
|
-
<a href="https://awesome-dsh-plugin.com"><img alt="Awesome DSH Plugin" src="https://awesome-dsh-plugin.com/badge.svg"></a>
|
|
18
|
-
<a href="https://dshfind.com/en/plugins/kenz1117/dsh-ui-usage-billing"><img alt="dshfind" src="https://dshfind.com/api/badge/kenz1117/dsh-ui-usage-billing"></a>
|
|
19
|
-
</p>
|
|
20
|
-
|
|
21
|
-
[English](README.en.md) · [中文](README.md)
|
|
6
|
+
<p>
|
|
7
|
+
<a href="https://github.com/kenz1117/dsh-ui-usage-billing/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/kenz1117/dsh-ui-usage-billing/actions/workflows/ci.yml/badge.svg"></a>
|
|
8
|
+
<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?logo=npm"></a>
|
|
9
|
+
<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?logo=npm"></a>
|
|
10
|
+
<a href="https://github.com/kenz1117/dsh-ui-usage-billing/blob/main/COMPATIBILITY.md"><img alt="DSH compat" src="https://img.shields.io/badge/DSH-0.1.2_%7E_0.2.1--rc.4-blue"></a>
|
|
11
|
+
<a href="https://github.com/kenz1117/dsh-ui-usage-billing/blob/main/LICENSE"><img alt="License MIT" src="https://img.shields.io/github/license/kenz1117/dsh-ui-usage-billing"></a>
|
|
12
|
+
</p>
|
|
22
13
|
|
|
14
|
+
[English](README.en.md) · [中文](README.md) · [Quick start](#-quick-start) · [Compatibility](COMPATIBILITY.md)
|
|
23
15
|
</div>
|
|
24
16
|
|
|
25
17
|
---
|
|
26
18
|
|
|
27
|
-
<div align="center">
|
|
28
|
-
<img src="screenshots/overview.png" alt="dsh-ui-usage-billing — billing dashboard overview" width="80%">
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
19
|
### Demo GIF
|
|
32
20
|
|
|
33
21
|
The eight dashboard tabs in turn (Overview / Queue / Billing / Usage / Trends / Agents / Rates / Settings):
|
|
@@ -38,104 +26,104 @@ The eight dashboard tabs in turn (Overview / Queue / Billing / Usage / Trends /
|
|
|
38
26
|
|
|
39
27
|
Most billing plugins stop at "token count × unit price". dsh-ui-usage-billing turns billing into a **reconcilable ledger pipeline** — real usage, live prices, and peak/off-peak awareness that follows the model.
|
|
40
28
|
|
|
41
|
-
|
|
42
|
-
|
|
29
|
+
<table>
|
|
30
|
+
<tr>
|
|
31
|
+
<td width="50%" valign="top">
|
|
32
|
+
<h3>Real usage you can reconcile</h3>
|
|
33
|
+
<p>Usage is aggregated live from persisted session logs — never fabricated (an empty snapshot shows until real data arrives); daily official-balance deltas are cross-checked against the local ledger, and deviations beyond the threshold prompt a review — a bill that survives scrutiny.</p>
|
|
34
|
+
</td>
|
|
35
|
+
<td width="50%" valign="top">
|
|
36
|
+
<h3>Live prices, history never rewritten</h3>
|
|
37
|
+
<p>A live models.dev catalog + a built-in catalog of 241 models across 25 vendors + user-defined prices in the settings panel (bindable per relay origin) mean new models never wait for a release; DeepSeek time-of-day prices are <strong>segmented by official change boundaries</strong> (base price before 08-17, weekend peak hours 08-17~08-23, weekend all-day off-peak from 08-23) and later price changes never rewrite old bills.</p>
|
|
38
|
+
</td>
|
|
39
|
+
</tr>
|
|
40
|
+
<tr>
|
|
41
|
+
<td width="50%" valign="top">
|
|
42
|
+
<h3>Peak/off-peak aware, alerts follow the model</h3>
|
|
43
|
+
<p>The billing channel is detected from the current session's model: DeepSeek metered uses time-of-day prices (weekday 9-12 / 14-18 peak ×2, weekend all-day off-peak), Zhipu Coding Plan uses credit windows (weekday 14-18 peak at full rate, off-peak at <strong>50% of base credits</strong>) — the channel layer is extensible for more providers; a popover / system notification fires automatically before each switch, and only sessions whose current model actually involves peak/off-peak get alerted or show the tier section — no watching the clock.</p>
|
|
44
|
+
</td>
|
|
45
|
+
<td width="50%" valign="top">
|
|
46
|
+
<h3>Subscriptions, balances and quotas on one screen</h3>
|
|
47
|
+
<p>7 official provider balances (DeepSeek / Kimi / Zhipu GLM / Tencent Cloud TokenHub / …), Coding Plan quotas, relay-station rolling quota windows, self-declared endpoints, plus balance-delta reconciliation — what the plan deducted and what the balance deducted, verifiable side by side.</p>
|
|
48
|
+
</td>
|
|
49
|
+
</tr>
|
|
50
|
+
</table>
|
|
51
|
+
|
|
52
|
+
### More capability, one place
|
|
53
|
+
|
|
54
|
+
| Cost attribution | Automation & entry points |
|
|
55
|
+
| --- | --- |
|
|
56
|
+
| Drill down through cache hits, official / third-party spend, workspaces, Sessions and relays; agent chains, TTFT, generation speed and cost spikes stay traceable. | Queue composer drafts or JSON batches for off-peak hours; jump from a Session row to the host, or open the dashboard with `/usage`. |
|
|
57
|
+
| **Pricing & models** | **Experience & privacy** |
|
|
58
|
+
| Uncatalogued models are explicit, with aliases and custom prices to fill the gaps; the optional read-only `usage_stats` tool is off by default. | Independent Chinese / English and ¥ / $ / € controls; no chart library or external CDN, and no system-prompt injection by default. |
|
|
43
59
|
|
|
44
|
-
|
|
45
|
-
A live models.dev catalog + a built-in catalog of 241 models across 25 vendors + user-defined prices in the settings panel (bindable per relay origin) mean new models never wait for a release; DeepSeek time-of-day prices are **segmented by official change boundaries** (base price before 08-17, weekend peak hours 08-17~08-23, weekend all-day off-peak from 08-23) and later price changes never rewrite old bills.
|
|
46
|
-
|
|
47
|
-
### Peak/off-peak aware, alerts follow the model
|
|
48
|
-
The billing channel is detected from the current session's model: DeepSeek metered uses time-of-day prices (weekday 9-12 / 14-18 peak ×2, weekend all-day off-peak), Zhipu Coding Plan uses credit windows (weekday 14-18 peak at full rate, off-peak at **50% of base credits**) — the channel layer is extensible for more providers; a popover / system notification fires automatically before each switch, and only sessions whose current model actually involves peak/off-peak get alerted or show the tier section — no watching the clock.
|
|
60
|
+
## 📊 Dashboard
|
|
49
61
|
|
|
50
|
-
###
|
|
51
|
-
7 official provider balances (DeepSeek / Kimi / Zhipu GLM / Tencent Cloud TokenHub / …), Coding Plan quotas, relay-station rolling quota windows, self-declared endpoints, plus balance-delta reconciliation — what the plan deducted and what the balance deducted, verifiable side by side.
|
|
62
|
+
### Sidebar and live feedback
|
|
52
63
|
|
|
53
|
-
|
|
64
|
+
- **Trigger card**: today / week / month headline, 7-day trend and daily gauge; choose a full card, compact icon or hidden entry, with a quick look on hover.
|
|
65
|
+
- **Cost bar and alerts**: live turn / Session cost, model-aware peak and quota warnings, plus optional system notifications for tier switches and Session completion.
|
|
54
66
|
|
|
55
|
-
|
|
56
|
-
- A performance panel: per-model TTFT mean/P50/P90 and generation speed.
|
|
57
|
-
- Uncatalogued models are explicitly marked and never silently billed 0; one alias entry prices an out-of-catalog model.
|
|
58
|
-
- An optional `usage_stats` tool lets the model answer "what did I spend today" or "which site used the most".
|
|
59
|
-
- **Off-peak task queue (preview)**: nothing is queued until the user explicitly chooses a workspace, a built-in DeepSeek official model and a Prompt. An opt-in composer switch can also capture the current draft verbatim with its cwd and model—without sending the current Session or navigating away; drafts are kept by default, with optional clear-after-enqueue. JSON files can be imported in batches; the whole batch is validated before one atomic enqueue, so any invalid item means zero writes. Tasks run FIFO in independent Sessions, start only in the official off-peak window, continue across peak once admitted, and become "Needs review" without automatic replay after failures or unknown outcomes. Relay mirrors are excluded; hosts without Session control fall back to read-only and never create placeholder tasks.
|
|
60
|
-
- Zero tools registered by default: the single read-only `usage_stats` tool is registered **only** after the user explicitly turns on "inject usage query" in the settings (off by default). No system-prompt injection.
|
|
61
|
-
- Chinese / English and ¥ / ≈$ toggles; no chart library, no external CDN, offline & self-contained.
|
|
62
|
-
- **Jump from a session row**: click a session title in the dashboard to open that conversation in the host (both generations of the host's session-selection channel are probed; hosts without one show a readable notice instead of silently doing nothing).
|
|
63
|
-
- **In-conversation entry**: the `/usage` command opens the billing dashboard directly (hosts without that capability degrade silently and leave the dashboard untouched).
|
|
67
|
+

|
|
64
68
|
|
|
65
|
-
|
|
69
|
+
### Eight sections, one consistent ledger
|
|
66
70
|
|
|
67
|
-
|
|
71
|
+
Overview / Queue / Billing / Usage / Trends / Agents / Rates / Settings. The hero and KPIs cover today, 7 days, week, month, all time and custom dates; trends, heatmaps, budgets, rates and searchable settings all read the same real ledger.
|
|
68
72
|
|
|
69
|
-
|
|
73
|
+

|
|
70
74
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
- **Agents section**: the agent network rebuilt from delegation relations — a parent conversation → sub-agent tree where each row carries its call count, own cost and **chain total** (itself + all descendants), which directly answers "which delegation was the most expensive".
|
|
75
|
+
<details>
|
|
76
|
+
<summary><strong>Queue, agent and settings details</strong></summary>
|
|
74
77
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
- **
|
|
78
|
-
- **Peak/off-peak switch alert**: a popover plus an optional system notification before a switch; lead time / position / mode / preview configurable; copy differs by billing channel (DeepSeek price halves, Zhipu credits at 50%). When tasks are queued, the alert also explains that they wait for the next off-peak window, start FIFO during off-peak, and continue across peak once started; it never automatically pauses or replays them.
|
|
79
|
-
- **Session completion notification**: an optional system notification when a session transitions running → completed (off by default, enable it in the panel); multi-window / multi-instance dedup through the claim endpoint, so each session notifies once.
|
|
80
|
-
- **Plugin info card**: a persistent "About" card in the Settings tab — version read server-side from the package's `package.json` (single source of truth, correct on publish), author / repo / npm / license one click away.
|
|
78
|
+
- **Queue**: price-band countdown and queued / running / needs-review / completed tasks; up to 50 JSON items per batch, validated atomically. Locks and leases prevent duplicate submission across instances sharing one `DSH_HOME`.
|
|
79
|
+
- **Agents**: a parent conversation → sub-agent tree with own cost and chain total including every descendant.
|
|
80
|
+
- **Settings**: full-text search, global and per-model budgets, peak alerts, custom prices, native host settings and plugin information; a hidden sidebar entry can be restored from host Settings.
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
</details>
|
|
83
83
|
|
|
84
84
|
## 💰 Billing engine
|
|
85
85
|
|
|
86
|
-
- **
|
|
87
|
-
- **
|
|
86
|
+
- **Channel attribution**: official, direct, relay and unknown routes stay separate; route and model aliases repair historical attribution.
|
|
87
|
+
- **Time-based pricing**: live models.dev data, 241 built-in models across 25 vendors, segmented peak pricing and live FX; later changes never rewrite history.
|
|
88
|
+
- **Real-cost overrides**: set relay-specific prices for the same model and fill gaps for uncatalogued models.
|
|
89
|
+
- **Budget controls**: global and per-model budgets, 50 / 80 / 100% alerts, balance warnings and last-40-turn spike attribution.
|
|
88
90
|
|
|
89
|
-
|
|
90
|
-
- **Custom unit prices**: set real paid prices (miss / cache-hit / output, optional USD and off-peak columns) for uncatalogued or repriced models; bindable per relay origin; an out-of-catalog model is priced as soon as you fill it in.
|
|
91
|
-
- **Official vs third-party buckets**: the model cost column in the Billing tab splits official direct / third-party relay ("official x / third y" when mixed); web-search assist calls count as official.
|
|
92
|
-
- **Monthly budget + tier alerts**: budget bar ≥80% amber, over-budget red pulse; one alert per 50/80/100% crossing; a balance below the CNY threshold alerts once a day. **Per-model budgets**: set a CNY cap per top-spending model of the month (independent of the global budget), with one alert per model per 80% / 100% crossing.
|
|
93
|
-
- **Cost-spike attribution**: last-40-turn cost bars, amount at bar top, peak/off-peak background bands, >2× spikes flagged with attribution.
|
|
91
|
+

|
|
94
92
|
|
|
95
93
|
## 🔌 Subscriptions & balance
|
|
96
94
|
|
|
97
|
-
- **Subscription
|
|
98
|
-
- **
|
|
99
|
-
- **
|
|
100
|
-
- **Declared endpoints + balance reconcile**: `declaredEndpoints` self-declares balance/quota interfaces for vendors absent from the built-in table — dot-paths only ("where the number is"), no expressions; safety bounds (single-slash absolute path, GET only, no cross-origin redirects, response-size/timeout caps, credentials from the matched provider only) are enforced by `src/declarative.ts`; a wrong path is marked `declared` with a reason. **Balance reconcile** (`reconcilePath`) cross-checks the official balance change against the local ledger, flagging drift above the threshold (0.3 CNY and >15%); top-ups / grants / currency changes reset the baseline instead of alerting, and a flat balance (subscription spend) stays silent.
|
|
101
|
-
- **Relay-site attribution & quota**: usage is grouped by `baseURL` origin — multiple keys on one relay merge into a row named by its domain; New API (`/api/status`) and Sub2API (`/v1/usage`) are auto-detected for balance and rolling quota windows, labeled "no quota" when unreadable, <20% remaining in red; recognition caches for 5 minutes (per-key fuse-breaking), and the `relay-quotas` endpoint attaches `diagnostics` for "why is my relay not showing"; project attribution prefers the workspace title.
|
|
95
|
+
- **Subscription quotas**: detect Kimi, Z.ai, OpenCode Go, MiniMax, Claude, CommandCode and more, with remaining quota and reset times; subscription-channel model cost is 0.
|
|
96
|
+
- **Official balances**: DeepSeek, Kimi, StepFun, SiliconFlow, xAI, Zhipu GLM and Tencent Cloud TokenHub, with days remaining estimated from the last 7 days.
|
|
97
|
+
- **Relays and reconciliation**: merge keys by site, read New API / Sub2API rolling quotas, and cross-check custom endpoints or official balance deltas against the ledger.
|
|
102
98
|
|
|
103
|
-
|
|
99
|
+

|
|
104
100
|
|
|
105
|
-
>
|
|
101
|
+
> Detection, endpoints, credentials and troubleshooting for every channel live in the [adapter matrix](docs/adapters.md).
|
|
106
102
|
|
|
107
103
|
## 📈 Usage visualizations
|
|
108
104
|
|
|
109
|
-
- **
|
|
110
|
-
- **
|
|
111
|
-
- **
|
|
112
|
-
- **
|
|
113
|
-
- **Cost composition (Usage tab)**: output cost is measured, input cost is apportioned by user / tool message text length (the log has no per-role token measurement, so the UI labels it as an estimate).
|
|
114
|
-
- **Performance metrics (Usage tab)**: per-model TTFT mean / P50 / P90, generation speed (tokens/s), total-latency mean; per-hour × per-model comparison curves — metric tabs, clickable model chips (top-5 by samples lit by default), hover snapping to the nearest hour with a crosshair and per-model values, broken lines for missing-sample hours (never fabricated); view preferences persist locally.
|
|
115
|
-
- **Trends (Trends tab)**: daily cost & call trend (7 / 30 days, cost / tokens metric switch), last-40-turn cost bars (amount at bar top, >2× spikes flagged with attribution), peak/off-peak time share and the amount saved in off-peak hours.
|
|
105
|
+
- **Drill down**: inspect Sessions, projects, workspaces and sites; month / half-year / year heatmaps show cost or token intensity.
|
|
106
|
+
- **Analyze**: daily tokens by structure or model, tool-call ranking, TTFT / P50 / P90, generation speed and cost composition.
|
|
107
|
+
- **Trend**: 7 / 30-day cost and calls, the last 40 turns, peak/off-peak share and off-peak savings.
|
|
108
|
+
- **Export**: daily / Session / site CSV, daily-token CSV and full JSON; no chart library or external CDN.
|
|
116
109
|
|
|
117
|
-
|
|
118
|
-

|
|
119
|
-
- **Export + drill-down**: daily / per-session / per-site CSV and full JSON from the Billing tab, daily-token CSV from the Usage tab; session detail is drillable (click a project row to expand its sessions); no chart library, no external CDN, pure design tokens.
|
|
110
|
+

|
|
120
111
|
|
|
121
112
|
## 🛡️ Robustness & privacy
|
|
122
113
|
|
|
123
|
-
- **Real
|
|
124
|
-
- **
|
|
125
|
-
- **
|
|
126
|
-
- **
|
|
127
|
-
- **Security hardening**: every HTTP endpoint enforces loopback-only access via a dual check of the peer socket address and an exact Host-header match, rejecting `127.0.0.1.evil.com`-style DNS-rebinding names (reverse-proxy deployments can allow specific names with `trustedHosts`; the peer-socket check stays mandatory); write paths additionally validate a loopback Origin and Content-Type with a body-size cap against cross-site rewrites; balance / subscription / pricing fetches carry bounded retries with per-upstream circuit breaking (auth failures are config issues and do not trip the breaker).
|
|
128
|
-
- **Export injection guard**: CSV cells starting with `=` / `+` / `-` / `@` get a leading single quote and full escaping, so they cannot execute as formulas in Excel / WPS.
|
|
129
|
-
- **Privacy baseline**: read-only with zero tools by default — no system-prompt injection, Session creation or Prompt submission; it only aggregates existing session logs. The optional `usage_stats` tool remains read-only over those aggregates. **The only path that creates a Session and writes a user Prompt is explicit enqueueing**. The queue file is mode 0600; after execution the Prompt also enters the host-managed Session log. Tools and permissions remain entirely under host control, with no privilege expansion by this plugin. Never put passwords or secrets in a queued Prompt.
|
|
114
|
+
- **Real aggregation**: incremental Session-log reads, per-session corruption tolerance, snapshots and a durable ledger; uncatalogued and estimated prices stay explicit.
|
|
115
|
+
- **Read-only by default**: no system-prompt injection, Session creation or Prompt submission; only explicit enqueueing writes a new Session, still under host permissions.
|
|
116
|
+
- **Loopback security**: peer-socket and Host checks on HTTP, plus Origin, Content-Type and body limits on writes; CSV formula-injection protection.
|
|
117
|
+
- **Complete experience**: independent language and three-currency preferences, keyboard focus, and provider health expressed through shape, color and text.
|
|
130
118
|
|
|
131
119
|
## 🚀 Quick start
|
|
132
120
|
|
|
133
|
-
One codebase currently supports DSH `0.1.2-alpha.1` through `0.2.2-alpha.2`. Stable and preview releases share the same compatibility matrix: stable releases use npm `latest`, while previews use `alpha`. npm `latest` currently points to the stable `1.8.
|
|
121
|
+
One codebase currently supports DSH `0.1.2-alpha.1` through `0.2.2-alpha.2`. Stable and preview releases share the same compatibility matrix: stable releases use npm `latest`, while previews use `alpha`. npm `latest` currently points to the stable `1.8.1` release, while `alpha` points to `1.8.1-alpha.2`.
|
|
134
122
|
|
|
135
123
|
`dsh plugin add` requires an explicit `--profile`. Pinning an exact version is recommended so a package manager's release cooldown cannot resolve a different version. Install the current stable release with:
|
|
136
124
|
|
|
137
125
|
```sh
|
|
138
|
-
dsh plugin --profile web add npm:@kenz1117/dsh-ui-usage-billing@1.8.
|
|
126
|
+
dsh plugin --profile web add npm:@kenz1117/dsh-ui-usage-billing@1.8.1
|
|
139
127
|
```
|
|
140
128
|
|
|
141
129
|
Default installations can also use `@latest`. Check the host with `dsh --version` or `npm ls -g @deepseek-ai/dsh`.
|
|
@@ -160,6 +148,11 @@ https://kenz1117.github.io/dsh-ui-usage-billing/catalog-source.json
|
|
|
160
148
|
|
|
161
149
|
Market-hosted installs resolve an exact registry release from npm (the Host resolves the install target from npm `latest`; the version listed in the catalog is display-only). The catalog files live in `catalog/` in this repository and are validated in CI before being published by GitHub Pages.
|
|
162
150
|
|
|
151
|
+
## 📚 Advanced reference
|
|
152
|
+
|
|
153
|
+
<details>
|
|
154
|
+
<summary><strong>Architecture, billing details, model catalog, HTTP API, configuration, development, releases, permissions and limitations</strong></summary>
|
|
155
|
+
|
|
163
156
|
## ⚙️ How it works
|
|
164
157
|
|
|
165
158
|
The plugin has a server side and a browser side:
|
|
@@ -268,7 +261,7 @@ For on-machine debugging: `dsh plugin --profile web add "link:<absolute path to
|
|
|
268
261
|
|
|
269
262
|
## 📦 Release
|
|
270
263
|
|
|
271
|
-
This standalone npm package maintains one `main` codebase. Stable releases use non-prerelease versions and npm `latest`; previews use prerelease versions and npm `alpha`. npm `latest` currently points to the stable `1.8.
|
|
264
|
+
This standalone npm package maintains one `main` codebase. Stable releases use non-prerelease versions and npm `latest`; previews use prerelease versions and npm `alpha`. npm `latest` currently points to the stable `1.8.1` release, while `alpha` points to `1.8.1-alpha.2`; see [COMPATIBILITY.md](COMPATIBILITY.md).
|
|
272
265
|
|
|
273
266
|
```sh
|
|
274
267
|
pnpm test && pnpm run build # full tests + build before release
|
|
@@ -283,7 +276,7 @@ The host discovers the browser side automatically via the `dsh.client` declarati
|
|
|
283
276
|
|
|
284
277
|
- **Permission level: high**: reads durable Session logs, calls vendor / subscription / balance / pricing APIs, reads `apiKeyEnv` through the credentials seam, and writes the ledger, snapshots and task queue under the harness home. The plugin itself has **no** command-execution / shell capability; only explicit enqueueing creates a host Session and submits a Prompt, while Agent tools remain governed by the host's existing permissions and approvals.
|
|
285
278
|
- **Update channel: `user-reviewed`**: with file / network / credential capabilities, DSH STORE requires local manual confirmation on every install; review the repo, pinned commit, lifecycle scripts, and impact scope before installing.
|
|
286
|
-
- **Compatibility**: stable and preview releases from the current `main` share one matrix covering DSH `0.1.2-alpha.1` through `0.2.2-alpha.2`, with 31 per-version declarations. The current stable release is `1.8.
|
|
279
|
+
- **Compatibility**: stable and preview releases from the current `main` share one matrix covering DSH `0.1.2-alpha.1` through `0.2.2-alpha.2`, with 31 per-version declarations. The current stable release is `1.8.1` (npm `latest`), and the current preview is `1.8.1-alpha.2` (npm `alpha`). Release channels and monitoring are documented in [COMPATIBILITY.md](COMPATIBILITY.md). Node.js `^22.19.0 || >=24.0.0`.
|
|
287
280
|
- **Lifecycle**: no `preinstall` / `install` / `postinstall` / `prepare` (ready on install).
|
|
288
281
|
- **No impersonation**: adds only its own entry id `ui-usage-billing`; `@deepseek-ai/dsh-*` packages are `peerDependencies` only (no reinstall / replace / shadowing of official components); the package uses the third-party namespace `@kenz1117/*`.
|
|
289
282
|
- **Build artifacts**: runtime files `lib/*` and `cordis.patch.yml` are committed at the pinned commit and declared in `files`.
|
|
@@ -311,8 +304,19 @@ Boundaries: the tool reads only this plugin's own aggregates — never Session b
|
|
|
311
304
|
- **Cost is a catalog estimate**: models without published per-token pricing (iFlytek, SenseTime, Xiaomi) use estimates (feature-list footnote ¹); official billing is authoritative.
|
|
312
305
|
- **The ledger starts at its first successful aggregation**: sessions permanently deleted before the upgrade and absent from the old snapshot cannot be recovered. Manually deleting `.dsh-usage-ledger.json` and its `.bak` clears independently retained history. Only calls successfully observed by this plugin are retained.
|
|
313
306
|
|
|
307
|
+
</details>
|
|
308
|
+
|
|
314
309
|
## ❤️ Contributors
|
|
315
310
|
|
|
311
|
+
<p align="center">
|
|
312
|
+
<a href="https://github.com/kenz1117/dsh-ui-usage-billing/graphs/contributors">
|
|
313
|
+
<img src="https://contrib.rocks/image?repo=kenz1117/dsh-ui-usage-billing" alt="DSH Usage Billing contributors" />
|
|
314
|
+
</a>
|
|
315
|
+
</p>
|
|
316
|
+
|
|
317
|
+
<details>
|
|
318
|
+
<summary>View contribution notes</summary>
|
|
319
|
+
|
|
316
320
|
- [@lucagiftzek](https://github.com/lucagiftzek) — rate-table CSS polish (PR #59), `trustedHosts` reverse-proxy support (PR #60), currency preference persistence (PR #58), rate-table search (PR #67), peak/off-peak indicator dots with pin-to-composer (PR #68), the EUR display currency with language decoupling (PR #70), the first pricing fetch moved ahead of the warmup replay (PR #55), evidence-based models.dev listings (PR #56), and hardcoded UI strings routed through locale dictionaries (PR #61)
|
|
317
321
|
- [@hwangjunjie](https://github.com/hwangjunjie) — Tencent Cloud TokenHub / Token Plan subscription quota adaptation (`src/tc3.ts`), provider-first channel grouping with gateway badges, the `routeAliases` / `modelKeyAliases` config (PR #35), and subscription badges decided per channel on the day × model × site cells (PR #83)
|
|
318
322
|
- [@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)
|
|
@@ -324,6 +328,8 @@ Boundaries: the tool reads only this plugin's own aggregates — never Session b
|
|
|
324
328
|
- [@JinruiWang](https://github.com/JinruiWang) — workbuddy adapter channel pricing and the fold-before-live-catalog dual-caliber fix: the known-channel list, three lazy-reprice gates (ledger, cache hit, incremental cursor) and the stable-stamp reproduction test (issue #90)
|
|
325
329
|
- [@gitfangj](https://github.com/gitfangj) — `sync.sh` brace-variable compatibility under the macOS default bash 3.2
|
|
326
330
|
|
|
331
|
+
</details>
|
|
332
|
+
|
|
327
333
|
## 📄 License
|
|
328
334
|
|
|
329
335
|
[MIT](LICENSE) © 2026 KenZ (kenz1117)
|