@kenz1117/dsh-ui-usage-billing 1.8.6 → 1.8.8
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 +4 -4
- package/README.md +8 -4
- package/lib/client.js +5 -5
- package/lib/index.js +352 -3
- package/lib/types/aggregate.d.ts +6 -0
- package/lib/types/client/TokenPanel.d.ts +2 -0
- package/lib/types/client/domain/channel-visibility.d.ts +68 -0
- package/lib/types/client/domain/types.d.ts +6 -0
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/client/pricing.d.ts +0 -2
- package/lib/types/client/provider-display.d.ts +0 -2
- package/lib/types/client/round-chart.d.ts +4 -1
- package/lib/types/client/usage-billing-settings.d.ts +19 -0
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -118,12 +118,12 @@ 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-rc.
|
|
121
|
+
One codebase currently supports DSH `0.1.2-alpha.1` through `0.2.2-rc.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.8` 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; host `0.2.2-rc.3` compatibility); `alpha` points to `1.8.3-alpha.12` (a subset of the stable release), and the next preview starts at `1.8.3-alpha.13`.
|
|
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
|
|
|
125
125
|
```sh
|
|
126
|
-
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.8
|
|
127
127
|
```
|
|
128
128
|
|
|
129
129
|
Default installations can also use `@latest`. Check the host with `dsh --version` or `npm ls -g @deepseek-ai/dsh`.
|
|
@@ -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.
|
|
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.8` release, while `alpha` points to `1.8.3-alpha.12`; 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-rc.
|
|
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.3`, with 36 per-version declarations. The current stable release is `1.8.8` (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; host `0.2.2-rc.3` compatibility); the preview channel is `1.8.3-alpha.12` (npm `alpha`, a subset of the stable release). 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,12 +118,12 @@
|
|
|
118
118
|
|
|
119
119
|
## 🚀 快速开始
|
|
120
120
|
|
|
121
|
-
当前维护 DSH `0.1.2-alpha.1` ~ `0.2.2-rc.3` 的一份代码。正式版与预览版共享同一兼容矩阵:正式版使用 npm `latest`,预览版使用 `alpha`。当前 `latest` 指向 `1.8.
|
|
121
|
+
当前维护 DSH `0.1.2-alpha.1` ~ `0.2.2-rc.3` 的一份代码。正式版与预览版共享同一兼容矩阵:正式版使用 npm `latest`,预览版使用 `alpha`。当前 `latest` 指向 `1.8.8` 正式版(日志已删的存量账本行按目录键归一并按目录价补价 + 通道可见性 + 缓存写入按厂商费率独立计价 + 宿主 0.2.2-rc.3 零适配兼容);`alpha` 指向 `1.8.3-alpha.12`(内容为正式版的子集),下一轮预览从 `1.8.3-alpha.13` 起。
|
|
122
122
|
|
|
123
123
|
`dsh plugin add` 需要显式 `--profile`,且建议钉具体版本号,避免包管理器的发布冷静期解析到其他版本。当前正式版安装命令:
|
|
124
124
|
|
|
125
125
|
```sh
|
|
126
|
-
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.8
|
|
127
127
|
```
|
|
128
128
|
|
|
129
129
|
默认安装也可使用 `@latest`。可用 `dsh --version` 或 `npm ls -g @deepseek-ai/dsh` 确认宿主版本。
|
|
@@ -200,6 +200,10 @@ cost(CNY)= (missInput × p_input + cacheWrite × p_cacheWrite + cacheHit ×
|
|
|
200
200
|
|
|
201
201
|
**未收录模型的补价入口(issue #125)**:概览顶部的「N 个模型未收录计价」提示条现在**直接列出未收录的模型 id**,并带「去补价」按钮(跳到设置页的自定义单价分区);这些 id 同时进入自定义单价的候选列表(下拉直接选),不必回会话日志手抄——中转站的 id 常带路由前缀与全角冒号,抄错就是「自定义价没效果」。
|
|
202
202
|
|
|
203
|
+
**通道可见性(设置 Tab,issue #126)**:通道多起来后(官方、直连、几个中转、未知路由)账单列表很长,可在设置里逐个通道勾选「显示」。隐藏的通道**不参与统计口径**——账单分组少掉该通道,概览累计、趋势与用量随之联动扣除。口径两条:只扣**可归属**的用量,旧格式会话(无通道维度)的用量宁可多算也不静默丢数;会话 / 工具 / 角色等没有通道维度的指标仍为全量。偏好存浏览器本地(`dsh.ui-usage-billing.channels`),按通道桶 key 记录(显示名随语言变,桶 key 稳定)。
|
|
204
|
+
|
|
205
|
+
**用量行的提供方标注(issue #126)**:用量分区的模型排行在模型名下标出该模型走过的通道与 token 占比(如「直连 · zai-coding-cn · 100%」)——同名模型经不同通道(官方 / 直连 / 中转)时据此区分,不再只看到一行合并数字。
|
|
206
|
+
|
|
203
207
|
### 支持模型(2026-11 主流阵容,OpenAI 兼容系列,共 247 款)
|
|
204
208
|
|
|
205
209
|
完整目录见费率 Tab 及源码 `src/builtin-catalog.ts` 的 `BUILTIN_MODEL_CATALOG`(246 款在售 + 1 款退役型号保留历史回算),此处每厂商仅列代表型号。
|
|
@@ -277,7 +281,7 @@ pnpm run build # tsc -b && tsdown,产出 lib/index.js 与 lib/client.js
|
|
|
277
281
|
|
|
278
282
|
## 📦 发布
|
|
279
283
|
|
|
280
|
-
本包为独立 npm 包,只维护一份 `main` 代码。正式版使用非预发布版本号并切 `latest`,预览版使用预发布版本号并切 `alpha`;当前 `latest` 指向 `1.8.
|
|
284
|
+
本包为独立 npm 包,只维护一份 `main` 代码。正式版使用非预发布版本号并切 `latest`,预览版使用预发布版本号并切 `alpha`;当前 `latest` 指向 `1.8.8` 正式版,`alpha` 指向 `1.8.3-alpha.12`,详见 [COMPATIBILITY.md](COMPATIBILITY.md)。
|
|
281
285
|
|
|
282
286
|
```sh
|
|
283
287
|
pnpm test && pnpm run build # 发版前全量测试 + 构建
|
|
@@ -292,7 +296,7 @@ npm dist-tag add @kenz1117/dsh-ui-usage-billing@<版本> latest # 正式版
|
|
|
292
296
|
|
|
293
297
|
- **权限等级:high**:读取持久会话日志(文件)、访问多厂商官方 / 订阅 / 余额 / 定价 API(网络)、经凭据 seam 读取 `apiKeyEnv`(凭据)、写入 harness home 下的账本、快照与任务队列(持久状态)。插件自身**不含**命令执行 / Shell;仅用户显式入队时才经宿主创建会话并提交 Prompt,Agent 的工具调用仍由宿主原有权限与审批控制。
|
|
294
298
|
- **更新通道:`user-reviewed`**:本插件具备文件 / 网络 / 凭据能力,DSH STORE 采用每次安装需本机人工确认的通道;安装前请复核仓库、固定 Commit、生命周期脚本与影响范围。
|
|
295
|
-
- **兼容范围**:当前 `main` 的正式版与预览版共享同一兼容矩阵,适配 DSH `0.1.2-alpha.1` ~ `0.2.2-rc.3`,共 36 项逐版本声明。当前正式版为 `1.8.
|
|
299
|
+
- **兼容范围**:当前 `main` 的正式版与预览版共享同一兼容矩阵,适配 DSH `0.1.2-alpha.1` ~ `0.2.2-rc.3`,共 36 项逐版本声明。当前正式版为 `1.8.8`(npm `latest`,日志已删的存量账本行按目录键归一并按目录价补价 + 通道可见性 + 缓存写入按厂商费率独立计价 + 宿主 0.2.2-rc.3 零适配兼容),预览通道为 `1.8.3-alpha.12`(npm `alpha`,内容为正式版的子集)。发行通道与监控机制见 [COMPATIBILITY.md](COMPATIBILITY.md)。Node.js `^22.19.0 || >=24.0.0`。
|
|
296
300
|
- **生命周期**:无 `preinstall` / `install` / `postinstall` / `prepare`(安装即用)。
|
|
297
301
|
- **不冒用官方**:仅新增自有 entry id `ui-usage-billing`;对 `@deepseek-ai/dsh-*` 仅为 `peerDependencies` 依赖(不重复安装 / 不替换 / 不遮蔽官方组件),包名使用第三方命名空间 `@kenz1117/*`。
|
|
298
302
|
- **打包产物**:运行文件 `lib/*` 与 `cordis.patch.yml` 已随固定 Commit 提交并声明在 `files`。
|