@kenz1117/dsh-ui-usage-billing 1.8.2 → 1.8.3-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +9 -9
- package/README.md +7 -7
- package/lib/client.js +2 -2
- package/lib/index.js +92 -4
- package/lib/types/client/pricing.d.ts +10 -1
- package/package.json +64 -63
package/README.en.md
CHANGED
|
@@ -34,7 +34,7 @@ Most billing plugins stop at "token count × unit price". dsh-ui-usage-billing t
|
|
|
34
34
|
</td>
|
|
35
35
|
<td width="50%" valign="top">
|
|
36
36
|
<h3>Live prices, history never rewritten</h3>
|
|
37
|
-
<p>A live models.dev catalog + a built-in catalog of
|
|
37
|
+
<p>A live models.dev catalog + a built-in catalog of 247 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
38
|
</td>
|
|
39
39
|
</tr>
|
|
40
40
|
<tr>
|
|
@@ -84,7 +84,7 @@ Overview / Queue / Billing / Usage / Trends / Agents / Rates / Settings. The her
|
|
|
84
84
|
## 💰 Billing engine
|
|
85
85
|
|
|
86
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,
|
|
87
|
+
- **Time-based pricing**: live models.dev data, 247 built-in models across 25 vendors, segmented peak pricing and live FX; later changes never rewrite history.
|
|
88
88
|
- **Real-cost overrides**: set relay-specific prices for the same model and fill gaps for uncatalogued models.
|
|
89
89
|
- **Budget controls**: global and per-model budgets, 50 / 80 / 100% alerts, balance warnings and last-40-turn spike attribution.
|
|
90
90
|
|
|
@@ -118,7 +118,7 @@ Overview / Queue / Billing / Usage / Trends / Agents / Rates / Settings. The her
|
|
|
118
118
|
|
|
119
119
|
## 🚀 Quick start
|
|
120
120
|
|
|
121
|
-
One codebase currently supports DSH `0.1.2-alpha.1` through `0.2.2-
|
|
121
|
+
One codebase currently supports DSH `0.1.2-alpha.1` through `0.2.2-rc.1`. 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.2` release; `alpha` points to `1.8.3-alpha.2` (host `0.2.2-rc.1` compatibility and the composer-hover flicker fix).
|
|
122
122
|
|
|
123
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:
|
|
124
124
|
|
|
@@ -186,9 +186,9 @@ cost (CNY) = (missInput × p_input + cacheHit × p_cacheHit + output × p_output
|
|
|
186
186
|
|
|
187
187
|
**Month-to-date forecast**: month-to-date spend + last-7-calendar-day pace × the days still left in the month. Only the days that have not happened yet are extrapolated, so a quiet recent week never inflates the number — earlier versions averaged over the month's *recorded* days and multiplied by the whole month length, which inflated sparsely used months several times over.
|
|
188
188
|
|
|
189
|
-
### Supported models (2026-
|
|
189
|
+
### Supported models (2026-11 lineup, OpenAI-compatible series, 247 models)
|
|
190
190
|
|
|
191
|
-
The full catalog lives in the Rates tab and in `BUILTIN_MODEL_CATALOG` of `src/builtin-catalog.ts` (
|
|
191
|
+
The full catalog lives in the Rates tab and in `BUILTIN_MODEL_CATALOG` of `src/builtin-catalog.ts` (246 active + 1 retired model kept for historical repricing); representative models per vendor below.
|
|
192
192
|
|
|
193
193
|
| Provider | Representatives |
|
|
194
194
|
| -------- | -------------------------------------------- |
|
|
@@ -201,11 +201,11 @@ The full catalog lives in the Rates tab and in `BUILTIN_MODEL_CATALOG` of `src/b
|
|
|
201
201
|
| MiniMax | MiniMax-M3, MiniMax-M2.7 (8 models) |
|
|
202
202
|
| Unisound | U2 Flash, Unisound U2 (3 models) |
|
|
203
203
|
| Baidu | ERNIE-5.1, ERNIE-4.5 300B (2 models) |
|
|
204
|
-
| Tencent | Hunyuan
|
|
204
|
+
| Tencent | Hunyuan Hy4 (limited 50% promo), Hunyuan Hy4 Preview, Hunyuan Hy3 (9 models) |
|
|
205
205
|
| Anthropic | Claude Opus 5, Claude Sonnet 5 (14 models) |
|
|
206
206
|
| Mistral AI | Mistral Large 3, Mistral Small 4 (30 models) |
|
|
207
207
|
| Cohere | Command A, Command R (7 models) |
|
|
208
|
-
| OpenAI | GPT-6 Astra, GPT-5.6 Sol / Terra / Luna (
|
|
208
|
+
| OpenAI | GPT-6 Astra, GPT-5.6 Sol / Terra / Luna (39 models) |
|
|
209
209
|
| Google | Gemini 3.1 Pro, Gemini 3.6 Flash (25 models) |
|
|
210
210
|
| xAI | Grok 4.7, Grok 4.20 (8 models) |
|
|
211
211
|
| Meta | Llama 4 Maverick, Muse Spark 1.3 (8 models) |
|
|
@@ -261,7 +261,7 @@ For on-machine debugging: `dsh plugin --profile web add "link:<absolute path to
|
|
|
261
261
|
|
|
262
262
|
## 📦 Release
|
|
263
263
|
|
|
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.2` release, while `alpha` points to `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.2` release, while `alpha` points to `1.8.3-alpha.2`; see [COMPATIBILITY.md](COMPATIBILITY.md).
|
|
265
265
|
|
|
266
266
|
```sh
|
|
267
267
|
pnpm test && pnpm run build # full tests + build before release
|
|
@@ -276,7 +276,7 @@ The host discovers the browser side automatically via the `dsh.client` declarati
|
|
|
276
276
|
|
|
277
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.
|
|
278
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.
|
|
279
|
-
- **Compatibility**: stable and preview releases from the current `main` share one matrix covering DSH `0.1.2-alpha.1` through `0.2.2-
|
|
279
|
+
- **Compatibility**: stable and preview releases from the current `main` share one matrix covering DSH `0.1.2-alpha.1` through `0.2.2-rc.1`, with 34 per-version declarations. The current stable release is `1.8.2` (npm `latest`); the preview channel is `1.8.3-alpha.2` (npm `alpha`, host `0.2.2-rc.1` compatibility and the composer-hover flicker fix). Release channels and monitoring are documented in [COMPATIBILITY.md](COMPATIBILITY.md). Node.js `^22.19.0 || >=24.0.0`.
|
|
280
280
|
- **Lifecycle**: no `preinstall` / `install` / `postinstall` / `prepare` (ready on install).
|
|
281
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/*`.
|
|
282
282
|
- **Build artifacts**: runtime files `lib/*` and `cordis.patch.yml` are committed at the pinned commit and declared in `files`.
|
package/README.md
CHANGED
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
|
|
119
119
|
## 🚀 快速开始
|
|
120
120
|
|
|
121
|
-
当前维护 DSH `0.1.2-alpha.1` ~ `0.2.2-
|
|
121
|
+
当前维护 DSH `0.1.2-alpha.1` ~ `0.2.2-rc.1` 的一份代码。正式版与预览版共享同一兼容矩阵:正式版使用 npm `latest`,预览版使用 `alpha`。当前 `latest` 指向 `1.8.2` 正式版;`alpha` 指向 `1.8.3-alpha.2`(宿主 0.2.2-rc.1 兼容 + 输入栏悬浮闪烁修复,下一轮预览从 `1.8.3-alpha.3` 起)。
|
|
122
122
|
|
|
123
123
|
`dsh plugin add` 需要显式 `--profile`,且建议钉具体版本号,避免包管理器的发布冷静期解析到其他版本。当前正式版安装命令:
|
|
124
124
|
|
|
@@ -194,9 +194,9 @@ cost(CNY)= (missInput × p_input + cacheHit × p_cacheHit + output × p_outp
|
|
|
194
194
|
|
|
195
195
|
**自定义单价(设置 Tab,issue #16)**:结构化条目表(模型 + 可选来源 + 输入/缓存命中/输出 + 币种),不再手编 JSON。来源(中转站域名)留空 = 该模型默认价;填入中转站域名(如 `https://api.my-relay.com`)= 仅该来源的同名模型用此价(同名模型可同时存在默认价与多个来源价,互不覆盖)。显示层按「模型 × 来源」精确匹配重算,命中不到来源时回落该模型默认价,再无则用内置目录价。
|
|
196
196
|
|
|
197
|
-
### 支持模型(2026-
|
|
197
|
+
### 支持模型(2026-11 主流阵容,OpenAI 兼容系列,共 247 款)
|
|
198
198
|
|
|
199
|
-
完整目录见费率 Tab 及源码 `src/builtin-catalog.ts` 的 `BUILTIN_MODEL_CATALOG`(
|
|
199
|
+
完整目录见费率 Tab 及源码 `src/builtin-catalog.ts` 的 `BUILTIN_MODEL_CATALOG`(246 款在售 + 1 款退役型号保留历史回算),此处每厂商仅列代表型号。
|
|
200
200
|
|
|
201
201
|
| 厂商 | 代表模型 |
|
|
202
202
|
| -------- | -------------------------------------------- |
|
|
@@ -209,11 +209,11 @@ cost(CNY)= (missInput × p_input + cacheHit × p_cacheHit + output × p_outp
|
|
|
209
209
|
| MiniMax | MiniMax-M3、MiniMax-M2.7(等 8 款) |
|
|
210
210
|
| 云知声 | U2 Flash、Unisound U2(等 3 款) |
|
|
211
211
|
| 百度文心 | ERNIE-5.1、ERNIE-4.5 300B(等 2 款) |
|
|
212
|
-
| 腾讯混元 | 混元
|
|
212
|
+
| 腾讯混元 | 混元 Hy4(限时 5 折)、混元 Hy4 Preview、混元 Hy3(等 9 款) |
|
|
213
213
|
| Anthropic | Claude Opus 5、Claude Sonnet 5(等 14 款) |
|
|
214
214
|
| Mistral AI | Mistral Large 3、Mistral Small 4(等 30 款) |
|
|
215
215
|
| Cohere | Command A、Command R(等 7 款) |
|
|
216
|
-
| OpenAI | GPT-6 Astra、GPT-5.6 Sol / Terra / Luna(等
|
|
216
|
+
| OpenAI | GPT-6 Astra、GPT-5.6 Sol / Terra / Luna(等 39 款) |
|
|
217
217
|
| Google | Gemini 3.1 Pro、Gemini 3.6 Flash(等 25 款) |
|
|
218
218
|
| xAI | Grok 4.7、Grok 4.20(等 8 款) |
|
|
219
219
|
| Meta | Llama 4 Maverick、Muse Spark 1.3(等 8 款) |
|
|
@@ -269,7 +269,7 @@ pnpm run build # tsc -b && tsdown,产出 lib/index.js 与 lib/client.js
|
|
|
269
269
|
|
|
270
270
|
## 📦 发布
|
|
271
271
|
|
|
272
|
-
本包为独立 npm 包,只维护一份 `main` 代码。正式版使用非预发布版本号并切 `latest`,预览版使用预发布版本号并切 `alpha`;当前 `latest` 指向 `1.8.2` 正式版,`alpha` 指向 `1.8.
|
|
272
|
+
本包为独立 npm 包,只维护一份 `main` 代码。正式版使用非预发布版本号并切 `latest`,预览版使用预发布版本号并切 `alpha`;当前 `latest` 指向 `1.8.2` 正式版,`alpha` 指向 `1.8.3-alpha.2`,详见 [COMPATIBILITY.md](COMPATIBILITY.md)。
|
|
273
273
|
|
|
274
274
|
```sh
|
|
275
275
|
pnpm test && pnpm run build # 发版前全量测试 + 构建
|
|
@@ -284,7 +284,7 @@ npm dist-tag add @kenz1117/dsh-ui-usage-billing@<版本> latest # 正式版
|
|
|
284
284
|
|
|
285
285
|
- **权限等级:high**:读取持久会话日志(文件)、访问多厂商官方 / 订阅 / 余额 / 定价 API(网络)、经凭据 seam 读取 `apiKeyEnv`(凭据)、写入 harness home 下的账本、快照与任务队列(持久状态)。插件自身**不含**命令执行 / Shell;仅用户显式入队时才经宿主创建会话并提交 Prompt,Agent 的工具调用仍由宿主原有权限与审批控制。
|
|
286
286
|
- **更新通道:`user-reviewed`**:本插件具备文件 / 网络 / 凭据能力,DSH STORE 采用每次安装需本机人工确认的通道;安装前请复核仓库、固定 Commit、生命周期脚本与影响范围。
|
|
287
|
-
- **兼容范围**:当前 `main` 的正式版与预览版共享同一兼容矩阵,适配 DSH `0.1.2-alpha.1` ~ `0.2.2-
|
|
287
|
+
- **兼容范围**:当前 `main` 的正式版与预览版共享同一兼容矩阵,适配 DSH `0.1.2-alpha.1` ~ `0.2.2-rc.1`,共 34 项逐版本声明。当前正式版为 `1.8.2`(npm `latest`),预览通道为 `1.8.3-alpha.2`(npm `alpha`,宿主 0.2.2-rc.1 兼容 + 输入栏悬浮闪烁修复)。发行通道与监控机制见 [COMPATIBILITY.md](COMPATIBILITY.md)。Node.js `^22.19.0 || >=24.0.0`。
|
|
288
288
|
- **生命周期**:无 `preinstall` / `install` / `postinstall` / `prepare`(安装即用)。
|
|
289
289
|
- **不冒用官方**:仅新增自有 entry id `ui-usage-billing`;对 `@deepseek-ai/dsh-*` 仅为 `peerDependencies` 依赖(不重复安装 / 不替换 / 不遮蔽官方组件),包名使用第三方命名空间 `@kenz1117/*`。
|
|
290
290
|
- **打包产物**:运行文件 `lib/*` 与 `cordis.patch.yml` 已随固定 Commit 提交并声明在 `files`。
|