@kenz1117/dsh-ui-usage-billing 1.8.9 → 1.8.11
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 +5 -5
- package/README.md +15 -14
- package/lib/client.js +5 -5
- package/lib/index.js +195 -1
- package/lib/types/client/footer-lane.d.ts +72 -0
- package/lib/types/guard.d.ts +17 -0
- package/package.json +68 -65
package/README.en.md
CHANGED
|
@@ -63,7 +63,7 @@ Most billing plugins stop at "token count × unit price". dsh-ui-usage-billing t
|
|
|
63
63
|
|
|
64
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
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.
|
|
66
|
-
- **Shortcut**: bind "Open usage billing dashboard" in the host's Settings → Shortcuts — `⌘⇧
|
|
66
|
+
- **Shortcut**: bind "Open usage billing dashboard" in the host's Settings → Shortcuts — `⌘⇧D` by default (`Ctrl+Shift+D` on Windows / Linux), rebindable or clearable — so the dashboard stays one keystroke away even with the sidebar entry hidden.
|
|
67
67
|
|
|
68
68
|

|
|
69
69
|
|
|
@@ -119,12 +119,12 @@ Overview / Queue / Billing / Usage / Trends / Agents / Rates / Settings. The her
|
|
|
119
119
|
|
|
120
120
|
## 🚀 Quick start
|
|
121
121
|
|
|
122
|
-
One codebase currently supports DSH `0.1.2-alpha.1` through `0.2.
|
|
122
|
+
One codebase currently supports DSH `0.1.2-alpha.1` through `0.2.3-alpha.3`. 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.11` release (ledger rows whose session logs were deleted are merged by catalog key and repriced from the catalog, issue #127; channel visibility; cache-write priced by each vendor's own rate; the dashboard shortcut; the `/usage` command registration-timing fix; an extra keyless FX source; host `0.2.2-rc.4` / `0.2.2-rc.5` compatibility; the sidebar footer card collapsing to a 36×36 icon button when it shares the slot with other plugins, issue #130; a catalog expansion adding 13 first-party vendor models); `alpha` points to `1.8.3-alpha.16` (content = `1.8.10` plus the issue #140 form-A fixes and the host `0.2.3-alpha.3` compatibility declaration), and the next preview starts at `1.8.3-alpha.17`.
|
|
123
123
|
|
|
124
124
|
`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:
|
|
125
125
|
|
|
126
126
|
```sh
|
|
127
|
-
dsh plugin --profile web add npm:@kenz1117/dsh-ui-usage-billing@1.8.
|
|
127
|
+
dsh plugin --profile web add npm:@kenz1117/dsh-ui-usage-billing@1.8.11
|
|
128
128
|
```
|
|
129
129
|
|
|
130
130
|
Default installations can also use `@latest`. Check the host with `dsh --version` or `npm ls -g @deepseek-ai/dsh`.
|
|
@@ -262,7 +262,7 @@ For on-machine debugging: `dsh plugin --profile web add "link:<absolute path to
|
|
|
262
262
|
|
|
263
263
|
## 📦 Release
|
|
264
264
|
|
|
265
|
-
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.
|
|
265
|
+
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.10` release, while `alpha` points to `1.8.3-alpha.15`; see [COMPATIBILITY.md](COMPATIBILITY.md).
|
|
266
266
|
|
|
267
267
|
```sh
|
|
268
268
|
pnpm test && pnpm run build # full tests + build before release
|
|
@@ -277,7 +277,7 @@ The host discovers the browser side automatically via the `dsh.client` declarati
|
|
|
277
277
|
|
|
278
278
|
- **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.
|
|
279
279
|
- **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.
|
|
280
|
-
- **Compatibility**: stable and preview releases from the current `main` share one matrix covering DSH `0.1.2-alpha.1` through `0.2.
|
|
280
|
+
- **Compatibility**: stable and preview releases from the current `main` share one matrix covering DSH `0.1.2-alpha.1` through `0.2.3-alpha.3`, with 41 per-version declarations. The current stable release is `1.8.11` (npm `latest`; ledger rows whose session logs were deleted are merged by catalog key and repriced from the catalog, issue #127; channel visibility; cache-write priced by each vendor's own rate; the dashboard shortcut; the `/usage` registration fix; an extra keyless FX source; host `0.2.2-rc.4` / `0.2.2-rc.5` compatibility; the sidebar footer card collapsing to a 36×36 icon button when it shares the slot with other plugins, issue #130; a catalog expansion adding 13 first-party vendor models); the preview channel is `1.8.3-alpha.16` (npm `alpha`; content = the stable release plus the issue #140 fixes and the host `0.2.3-alpha.3` compatibility declaration). Release channels and monitoring are documented in [COMPATIBILITY.md](COMPATIBILITY.md). Node.js `^22.19.0 || >=24.0.0`.
|
|
281
281
|
- **Lifecycle**: no `preinstall` / `install` / `postinstall` / `prepare` (ready on install).
|
|
282
282
|
- **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/*`.
|
|
283
283
|
- **Build artifacts**: runtime files `lib/*` and `cordis.patch.yml` are committed at the pinned commit and declared in `files`.
|
package/README.md
CHANGED
|
@@ -62,8 +62,9 @@
|
|
|
62
62
|
### 侧栏与即时反馈
|
|
63
63
|
|
|
64
64
|
- **触发卡**:今日 / 本周 / 本月主数字、近 7 天趋势与当日水位;支持完整卡片、紧凑图标、完全隐藏,悬停可看速览。
|
|
65
|
+
- **与其它插件共存**:侧栏底部入口被多个插件同时占用时,触发卡自动收成 36×36 图标钮(不占满整行、不挤走邻居),悬停仍出速览、点击照常打开仪表盘;邻居卸载后自动还原成完整卡片。
|
|
65
66
|
- **费用条与提醒**:常驻本轮 / 会话费用,按当前模型显示峰谷和订阅额度预警;切档与会话完成可发系统通知。
|
|
66
|
-
- **快捷键**:宿主「设置 → 快捷键」可绑定「打开用量计费仪表盘」,默认 `⌘⇧
|
|
67
|
+
- **快捷键**:宿主「设置 → 快捷键」可绑定「打开用量计费仪表盘」,默认 `⌘⇧D`(Windows / Linux `Ctrl+Shift+D`),可改绑或清空;侧栏隐藏后也能一键打开面板。
|
|
67
68
|
|
|
68
69
|

|
|
69
70
|
|
|
@@ -119,12 +120,12 @@
|
|
|
119
120
|
|
|
120
121
|
## 🚀 快速开始
|
|
121
122
|
|
|
122
|
-
当前维护 DSH `0.1.2-alpha.1` ~ `0.2.
|
|
123
|
+
当前维护 DSH `0.1.2-alpha.1` ~ `0.2.3-alpha.3` 的一份代码。正式版与预览版共享同一兼容矩阵:正式版使用 npm `latest`,预览版使用 `alpha`。当前 `latest` 指向 `1.8.11` 正式版(日志已删的存量账本行按目录键归一并按目录价补价 + 通道可见性 + 缓存写入按厂商费率独立计价 + 仪表盘快捷键与 `/usage` 命令注册时机修正 + 汇率兜底源 + 宿主 0.2.2-rc.4 / rc.5 兼容声明 + 侧栏 footer 同槽共存收成 36×36 图标钮 + 目录扩容 13 条新模型);`alpha` 指向 `1.8.3-alpha.16`(内容 = `1.8.10` + issue #140 形态 A 两处失效的修复 + 宿主 `0.2.3-alpha.3` 兼容声明),下一轮预览从 `1.8.3-alpha.17` 起。
|
|
123
124
|
|
|
124
125
|
`dsh plugin add` 需要显式 `--profile`,且建议钉具体版本号,避免包管理器的发布冷静期解析到其他版本。当前正式版安装命令:
|
|
125
126
|
|
|
126
127
|
```sh
|
|
127
|
-
dsh plugin --profile web add npm:@kenz1117/dsh-ui-usage-billing@1.8.
|
|
128
|
+
dsh plugin --profile web add npm:@kenz1117/dsh-ui-usage-billing@1.8.11
|
|
128
129
|
```
|
|
129
130
|
|
|
130
131
|
默认安装也可使用 `@latest`。可用 `dsh --version` 或 `npm ls -g @deepseek-ai/dsh` 确认宿主版本。
|
|
@@ -205,29 +206,29 @@ cost(CNY)= (missInput × p_input + cacheWrite × p_cacheWrite + cacheHit ×
|
|
|
205
206
|
|
|
206
207
|
**用量行的提供方标注(issue #126)**:用量分区的模型排行在模型名下标出该模型走过的通道与 token 占比(如「直连 · zai-coding-cn · 100%」)——同名模型经不同通道(官方 / 直连 / 中转)时据此区分,不再只看到一行合并数字。
|
|
207
208
|
|
|
208
|
-
### 支持模型(2026-11 主流阵容,OpenAI 兼容系列,共
|
|
209
|
+
### 支持模型(2026-11 主流阵容,OpenAI 兼容系列,共 262 款)
|
|
209
210
|
|
|
210
|
-
完整目录见费率 Tab 及源码 `src/builtin-catalog.ts` 的 `BUILTIN_MODEL_CATALOG`(
|
|
211
|
+
完整目录见费率 Tab 及源码 `src/builtin-catalog.ts` 的 `BUILTIN_MODEL_CATALOG`(261 款在售 + 1 款退役型号保留历史回算),此处每厂商仅列代表型号。
|
|
211
212
|
|
|
212
213
|
| 厂商 | 代表模型 |
|
|
213
214
|
| -------- | -------------------------------------------- |
|
|
214
215
|
| DeepSeek | V4.1 Flash、V4 Pro(等 3 款;按官方变更节点分段计价:基础价 → 峰谷 v1 → 周末全谷) |
|
|
215
|
-
| 智谱 AI | GLM-5.3、GLM-5.2(等
|
|
216
|
-
| 阿里通义 | Qwen3.8 Max
|
|
216
|
+
| 智谱 AI | GLM-5.3、GLM-5.2(等 18 款) |
|
|
217
|
+
| 阿里通义 | Qwen4 Max、Qwen3.8 Max(等 28 款) |
|
|
217
218
|
| 字节豆包 | Doubao Seed-2.1 Pro、Doubao Seed-2.0 Pro(等 13 款) |
|
|
218
219
|
| 月之暗面 | Kimi K3.1 Pro、Kimi K3.1 Pro Highspeed、Kimi K3、Kimi K2.7 Code(等 18 款) |
|
|
219
220
|
| 小米 | MiMo V2.6 Pro(等 6 款) |
|
|
220
221
|
| MiniMax | MiniMax-M3、MiniMax-M2.7(等 8 款) |
|
|
221
222
|
| 云知声 | U2 Flash、Unisound U2(等 3 款) |
|
|
222
223
|
| 百度文心 | ERNIE-5.1、ERNIE-4.5 300B(等 2 款) |
|
|
223
|
-
| 腾讯混元 | 混元 Hy4(限时 5 折)、混元 Hy4 Preview、混元 Hy3(等
|
|
224
|
-
| Anthropic | Claude
|
|
224
|
+
| 腾讯混元 | 混元 Hy4(限时 5 折)、混元 Hy4 Preview、混元 Hy3(等 10 款) |
|
|
225
|
+
| Anthropic | Claude Fable 5.2、Claude Opus 5(等 15 款) |
|
|
225
226
|
| Mistral AI | Mistral Large 3、Mistral Small 4(等 30 款) |
|
|
226
227
|
| Cohere | Command A、Command R(等 7 款) |
|
|
227
|
-
| OpenAI | GPT-6 Astra、GPT-
|
|
228
|
-
| Google | Gemini
|
|
228
|
+
| OpenAI | GPT-6.2 Sol / Astra、GPT-6 Astra(等 45 款) |
|
|
229
|
+
| Google | Gemini 4 Neon、Gemini 3.1 Pro(等 28 款) |
|
|
229
230
|
| xAI | Grok 4.7、Grok 4.20(等 8 款) |
|
|
230
|
-
| Meta | Llama 4 Maverick、Muse
|
|
231
|
+
| Meta | Llama 4 Maverick、Muse Ember 1.0(等 9 款) |
|
|
231
232
|
| 美团 | LongCat 2.0(估算价) |
|
|
232
233
|
| 面壁智能 | MiniCPM-V 4.5(估算价) |
|
|
233
234
|
| 小红书 | Dots3-Note Preview(估算价) |
|
|
@@ -282,7 +283,7 @@ pnpm run build # tsc -b && tsdown,产出 lib/index.js 与 lib/client.js
|
|
|
282
283
|
|
|
283
284
|
## 📦 发布
|
|
284
285
|
|
|
285
|
-
本包为独立 npm 包,只维护一份 `main` 代码。正式版使用非预发布版本号并切 `latest`,预览版使用预发布版本号并切 `alpha`;当前 `latest` 指向 `1.8.
|
|
286
|
+
本包为独立 npm 包,只维护一份 `main` 代码。正式版使用非预发布版本号并切 `latest`,预览版使用预发布版本号并切 `alpha`;当前 `latest` 指向 `1.8.10` 正式版,`alpha` 指向 `1.8.3-alpha.15`,详见 [COMPATIBILITY.md](COMPATIBILITY.md)。
|
|
286
287
|
|
|
287
288
|
```sh
|
|
288
289
|
pnpm test && pnpm run build # 发版前全量测试 + 构建
|
|
@@ -297,7 +298,7 @@ npm dist-tag add @kenz1117/dsh-ui-usage-billing@<版本> latest # 正式版
|
|
|
297
298
|
|
|
298
299
|
- **权限等级:high**:读取持久会话日志(文件)、访问多厂商官方 / 订阅 / 余额 / 定价 API(网络)、经凭据 seam 读取 `apiKeyEnv`(凭据)、写入 harness home 下的账本、快照与任务队列(持久状态)。插件自身**不含**命令执行 / Shell;仅用户显式入队时才经宿主创建会话并提交 Prompt,Agent 的工具调用仍由宿主原有权限与审批控制。
|
|
299
300
|
- **更新通道:`user-reviewed`**:本插件具备文件 / 网络 / 凭据能力,DSH STORE 采用每次安装需本机人工确认的通道;安装前请复核仓库、固定 Commit、生命周期脚本与影响范围。
|
|
300
|
-
- **兼容范围**:当前 `main` 的正式版与预览版共享同一兼容矩阵,适配 DSH `0.1.2-alpha.1` ~ `0.2.
|
|
301
|
+
- **兼容范围**:当前 `main` 的正式版与预览版共享同一兼容矩阵,适配 DSH `0.1.2-alpha.1` ~ `0.2.3-alpha.3`,共 41 项逐版本声明。当前正式版为 `1.8.11`(npm `latest`,日志已删的存量账本行按目录键归一并按目录价补价 + 通道可见性 + 缓存写入按厂商费率独立计价 + 仪表盘快捷键与 `/usage` 注册修正 + 汇率兜底源 + 宿主 0.2.2-rc.4 / rc.5 兼容声明 + 侧栏 footer 同槽共存收成 36×36 图标钮 + 目录扩容 13 条新模型),预览通道为 `1.8.3-alpha.16`(npm `alpha`,内容 = 正式版 + issue #140 修复 + 宿主 `0.2.3-alpha.3` 兼容声明)。发行通道与监控机制见 [COMPATIBILITY.md](COMPATIBILITY.md)。Node.js `^22.19.0 || >=24.0.0`。
|
|
301
302
|
- **生命周期**:无 `preinstall` / `install` / `postinstall` / `prepare`(安装即用)。
|
|
302
303
|
- **不冒用官方**:仅新增自有 entry id `ui-usage-billing`;对 `@deepseek-ai/dsh-*` 仅为 `peerDependencies` 依赖(不重复安装 / 不替换 / 不遮蔽官方组件),包名使用第三方命名空间 `@kenz1117/*`。
|
|
303
304
|
- **打包产物**:运行文件 `lib/*` 与 `cordis.patch.yml` 已随固定 Commit 提交并声明在 `files`。
|