dsh-cost-meter 1.9.4 → 1.9.5
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.md +8 -8
- package/README.zh-CN.md +8 -8
- package/docs/display-settings.md +4 -0
- package/docs/plugin-compatibility-watch.md +11 -0
- package/docs/update-notes-1.9.5.md +39 -0
- package/lib/client.display.js +2 -2
- package/lib/client.js +5 -5
- package/lib/store.js +5 -1
- package/lib/typert.host.js +1 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -10,20 +10,20 @@ Community and feedback: [Join the WeChat group →](#community). The WeChat grou
|
|
|
10
10
|
|
|
11
11
|
Per-conversation cost · daily totals · OpenCode Go subscription quota display · budget with usage percentage · official account balance · custom provider balance · balance progress bar · history · peak/off-peak pricing hours display (peak hours UTC 01:00–04:00, 06:00–10:00; weekends and Chinese public holidays are off-peak all day, with separate labels) · pre-switch popup & system-notification alerts for peak/off-peak changes (position / lead time / alert type configurable) · one-click price sync from the official docs · Codex-style token usage heat grid · multi-vendor model pricing (built-in 170+ model-ID catalog with auto-matching) · mainstream Coding Plan quota queries & display (Anthropic / Z.ai / MiniMax / Kimi / OpenRouter / SiliconFlow / CommandCode / SCNet / Volcano Ark / Qwen / Xiaomi MiMo / Factory Droid) plan/API dual-track billing (subscription quota vs pay-as-you-go money separated, per-1% & full-window token/equivalent-cost estimates with daily/weekly/monthly curves) · subscription plugin compatibility (Codex / ChatGPT subscription plans) · mobile layout (dsh-pocket) · quota strip above the input box (budget / Go / coding-plan usage in one row, toggleable)
|
|
12
12
|
|
|
13
|
-
[](https://github.com/Han-1413141/dsh-cost-meter)
|
|
14
14
|
|
|
15
15
|
**Minimum supported host: DSH 0.2.0.** The plugin declares the floor in `engines.dsh`, the host's admission gate for plugins, and no longer supports any DSH 0.1.x release; the adaptation target is the npm `next` release **0.2.1-rc.2**. Exact ranges and how the host reads them: [compatibility declaration](docs/dsh-0.2.1-compatibility.md#english).
|
|
16
16
|
|
|
17
17
|
Supports [official Search/Fetch request fees](docs/web-request-fees.md#english), separately from model tokens.
|
|
18
18
|
|
|
19
|
-
**v1.9.
|
|
19
|
+
**v1.9.5** fixes Codex quota cards disappearing after an unsuccessful read: the sidebar keeps a retry entry and recovers automatically after sign-in. GitHub now monitors published interfaces of billion-context, dsh-codex-subscription and dsh-codex-connect.
|
|
20
20
|
|
|
21
21
|
Configuration and verification: [OpenDesign queries](docs/opendesign-billing.md), [dynamic ports / LAN / WorkBuddy2API setup](docs/custom-balance-sources.md), and [opacity fixes with performance measurements](docs/performance-2026-10-18.md).
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
Desktop users: follow the [Desktop installation instructions](docs/install-troubleshooting.md#desktop-安装与更新) for the application's own CLI and `desktop` Profile.
|
|
25
25
|
|
|
26
|
-
Release notes: [v1.9.
|
|
26
|
+
Release notes: [v1.9.5](docs/update-notes-1.9.5.md#english). Fully restart DSH after updating.
|
|
27
27
|
|
|
28
28
|
Host records inside the declared range, and the earlier 0.1.x history, are in the [compatibility record](docs/host-compatibility.md); the per-release list lives in `package.json` (`dsh.compatibility.dshReleases`).
|
|
29
29
|
|
|
@@ -341,22 +341,22 @@ On Node.js 20, use `npm install -g pnpm@10` instead. See [pnpm installation and
|
|
|
341
341
|
dsh plugin --profile web add dsh-cost-meter
|
|
342
342
|
```
|
|
343
343
|
|
|
344
|
-
**PowerShell one-click script** (copy the whole line, paste, press Enter; pnpm is provisioned automatically, git is auto-detected — no clone needed; the install chain is **pinned to the release tag `v1.9.
|
|
344
|
+
**PowerShell one-click script** (copy the whole line, paste, press Enter; pnpm is provisioned automatically, git is auto-detected — no clone needed; the install chain is **pinned to the release tag `v1.9.5`** — review the script before running):
|
|
345
345
|
|
|
346
346
|
```powershell
|
|
347
|
-
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.
|
|
347
|
+
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.5/install.ps1 | iex
|
|
348
348
|
```
|
|
349
349
|
|
|
350
350
|
**Or a plain command line** (the machine must already have pnpm and git; also pinned to the tag):
|
|
351
351
|
|
|
352
352
|
```sh
|
|
353
|
-
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.
|
|
353
|
+
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.5
|
|
354
354
|
```
|
|
355
355
|
|
|
356
356
|
Without git, use the GitHub tag archive:
|
|
357
357
|
|
|
358
358
|
```sh
|
|
359
|
-
dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.9.
|
|
359
|
+
dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.9.5.tar.gz
|
|
360
360
|
```
|
|
361
361
|
|
|
362
362
|
After installing, **restart** `dsh web` (plugin rows, the Typert manifest and the client bundle are all scanned at startup):
|
|
@@ -421,7 +421,7 @@ Workarounds:
|
|
|
421
421
|
|
|
422
422
|
```yaml
|
|
423
423
|
minimumReleaseAgeExclude:
|
|
424
|
-
- dsh-cost-meter@1.9.
|
|
424
|
+
- dsh-cost-meter@1.9.5
|
|
425
425
|
```
|
|
426
426
|
|
|
427
427
|
3. For a one-off CLI operation, forward the pnpm flag: `dsh plugin --profile desktop remove dsh-cost-meter --config.minimum-release-age=0` (or add `--trust-lockfile` when only lockfile verification fails). Both flags were verified against pnpm 11.28.5 in a temporary profile.
|
package/README.zh-CN.md
CHANGED
|
@@ -10,20 +10,20 @@
|
|
|
10
10
|
|
|
11
11
|
本会话费用 · 当日费用 · OpenCode Go 订阅额度显示 · 预算与已用百分比 · 官方账户余额 · 自定义 Provider 余额查询(可配任意 HTTP 端点) · 余额三段进度条 · 历史记录 · 峰谷计价时段显示(UTC 01:00–04:00、06:00–10:00 为峰时段;周末与中国法定假日全天按谷价,分别标注) · 峰/谷切换前弹窗与系统通知提醒(位置/提前量/提醒类型可配) · 官方价格一键同步 · 类 Codex Token 用量热图 · 多厂商多模型价格计费(内置 170+ 模型 ID 价格目录与自动匹配) · 主流 Coding Plan 额度查询与显示(Anthropic / Z.ai / MiniMax / Kimi / OpenRouter / SiliconFlow / CommandCode / SCNet / 火山方舟 / 千问 / 小米 MiMo 十一家,含 Volcano Ark AK/SK 签名与 MiMo 控制台 Cookie 查询) · Plan/API 双轨计费(订阅额度与按量金额分离统计,每 1% 额度与满窗的 token/等值金额估算及日/周/月曲线) · 订阅插件兼容(Codex / ChatGPT 订阅) · 手机端适配(dsh-pocket) · 输入框上方额度横条(预算/Go/Coding Plan 用量一条横排显示,可开关)
|
|
12
12
|
|
|
13
|
-
[](https://github.com/Han-1413141/dsh-cost-meter)
|
|
14
14
|
|
|
15
15
|
**最低支持宿主:DSH 0.2.0。** 插件把下限声明在 `engines.dsh`(宿主准入插件的闸门),不再支持任何 DSH 0.1.x 版本;本轮适配目标为 npm `next` 标签的 **0.2.1-rc.2**。具体范围与宿主的读取方式见[兼容声明](docs/dsh-0.2.1-compatibility.md#中文)。
|
|
16
16
|
|
|
17
17
|
新增 [DeepSeek Search/Fetch API 次数费](docs/web-request-fees.md#中文),只计有结果的成功请求,并将网页抓取独立分类。
|
|
18
18
|
|
|
19
|
-
**v1.9.
|
|
19
|
+
**v1.9.5** 修复 Codex 额度查询失败后卡片消失的问题,保留点击重试入口,登录后自动恢复显示;增加 billion-context、dsh-codex-subscription、dsh-codex-connect 的 GitHub 发布包与接口监控。
|
|
20
20
|
|
|
21
21
|
配置与验证:[OpenDesign 查询说明](docs/opendesign-billing.md)、[随机端口 / 局域网 / WorkBuddy2API 配置](docs/custom-balance-sources.md)、[透明度修复与性能测量](docs/performance-2026-10-18.md)。
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
桌面端用户请按 [Desktop 安装说明](docs/install-troubleshooting.md#desktop-安装与更新),使用应用自带的 CLI 和 `desktop` Profile。
|
|
25
25
|
|
|
26
|
-
更新说明:[v1.9.
|
|
26
|
+
更新说明:[v1.9.5](docs/update-notes-1.9.5.md#中文)。更新后完全重启 DSH。
|
|
27
27
|
|
|
28
28
|
声明范围内的宿主记录与此前的 0.1.x 历史见[兼容记录](docs/host-compatibility.md);逐版本清单在 `package.json` 的 `dsh.compatibility.dshReleases`。
|
|
29
29
|
|
|
@@ -341,22 +341,22 @@ Node.js 20 请改用 `npm install -g pnpm@10`。版本要求见 [pnpm 官方安
|
|
|
341
341
|
dsh plugin --profile web add dsh-cost-meter
|
|
342
342
|
```
|
|
343
343
|
|
|
344
|
-
**PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.9.
|
|
344
|
+
**PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.9.5`**,建议先下载审阅再运行):
|
|
345
345
|
|
|
346
346
|
```powershell
|
|
347
|
-
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.
|
|
347
|
+
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.5/install.ps1 | iex
|
|
348
348
|
```
|
|
349
349
|
|
|
350
350
|
**或直接命令行**(机器上需已有 pnpm 与 git;同样固定到 tag):
|
|
351
351
|
|
|
352
352
|
```sh
|
|
353
|
-
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.
|
|
353
|
+
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.5
|
|
354
354
|
```
|
|
355
355
|
|
|
356
356
|
没有 git 时可用 GitHub tag 打包直链:
|
|
357
357
|
|
|
358
358
|
```sh
|
|
359
|
-
dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.9.
|
|
359
|
+
dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.9.5.tar.gz
|
|
360
360
|
```
|
|
361
361
|
|
|
362
362
|
安装后**重启** `dsh web`(插件行、Typert 清单与客户端 bundle 均在启动时扫描):
|
|
@@ -421,7 +421,7 @@ DSH **0.2.1-rc.1 / 0.2.1-rc.2** 宿主自带 pnpm **11.28.5**,默认启用内
|
|
|
421
421
|
|
|
422
422
|
```yaml
|
|
423
423
|
minimumReleaseAgeExclude:
|
|
424
|
-
- dsh-cost-meter@1.9.
|
|
424
|
+
- dsh-cost-meter@1.9.5
|
|
425
425
|
```
|
|
426
426
|
|
|
427
427
|
3. 仅本次操作用 CLI 透传 pnpm 参数:`dsh plugin --profile desktop remove dsh-cost-meter --config.minimum-release-age=0`;若只是 lockfile 校验阶段失败,可改用 `--trust-lockfile`。这两个参数已在本机 pnpm 11.28.5 临时 Profile 上实测可用。
|
package/docs/display-settings.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# 显示设置预览
|
|
2
2
|
|
|
3
|
+
关闭输入框上方的 Codex 额度条:选择“输入区 → 调整组件 → Codex 额度”,取消“在输入区显示 Codex 额度”。该开关与侧栏额度独立,不影响预算、Go 或其他套餐的额度条;两个 Codex 显示位置都隐藏时停止查询。
|
|
4
|
+
|
|
5
|
+
Codex 额度的真实数据来自已启用并登录的 `dsh-codex-subscription` 或 `dsh-codex-connect`。自动检测先通过宿主 `/api` RPC 读取 subscription 额度,再回退 connect 的状态路由。侧栏以“周额度 · 剩余 83% · 10/25 08:10 重置”显示,5h 窗口单列一行;会话额度条也标明“剩余”。重置时间按本机时区显示,Codex 不随其他套餐的进度条方向切换口径。示例百分比只用于预览;真实查询未成功时,已开启的侧栏卡片会显示登录与重试提示,可以点击重新查询。启用期间每分钟检查一次,成功数据缓存五分钟,失败一分钟后重试;关闭后停止检查。查询只读取额度,不发送模型请求。
|
|
6
|
+
|
|
3
7
|
进入 DSH 设置 → 费用 → 显示。默认勾选“使用示例数据”,展示余额、预算、Go、套餐、峰谷和三种模型的完整效果。选中 Codex 或自定义余额时也提供对应示例。取消勾选后展示当前缓存数据,缺失的会话值显示“—”。数据来源的选择仅保存在本机预览偏好中,不更改插件配置或账本。
|
|
4
8
|
|
|
5
9
|
预览分为侧栏、输入区和会话内容三个区域,使用正常字号,只渲染当前区域。点击虚线框,在右侧调整对应组件。示例模式下隐藏的组件保留淡化效果,方便再次选中;当前数据模式下未显示的组件保留淡色标签。组件菜单只列出可调整的组件,操作提示不再作为菜单选项。显示设置的更改自动保存。
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# 兼容插件监控
|
|
2
|
+
|
|
3
|
+
GitHub Actions 工作流 `plugin-compatibility-watch` 每日北京时间 08:23 检查,支持手动运行。GitHub 排队可能延迟实际开始时间。
|
|
4
|
+
|
|
5
|
+
监控 `billion-context`、`dsh-codex-subscription`、`dsh-codex-connect` 的 npm `latest` 发布包。检查包名与版本、SHA-512 完整性、导出入口、DSH 兼容范围、宿主依赖,以及接入函数的语法指纹和额度接口标记。billion-context 额外运行本项目实际使用的原版源码兼容检查,覆盖代理和原生传输。
|
|
6
|
+
|
|
7
|
+
检查只下载和读取公开包,不安装或执行上游代码,不查询用户账户。新版本、接口变化、契约不匹配或检查失败时,由 `github-actions[bot]` 创建对应插件的跟踪 issue。后续变化更新同一条未关闭的机器人 issue;相同结果不重复通知。报告和指纹保存在该次 Actions 的 artifact 中。
|
|
8
|
+
|
|
9
|
+
静态契约匹配不能证明上游运行行为完全一致。出现变更后,先查看报告中的函数变化,运行本项目对应兼容回归;确认后执行 `node scripts/watch-plugin-compatibility.mjs --record` 更新基线,并随修复提交。基线不会由机器人自动接受,也不会自动升级插件。
|
|
10
|
+
|
|
11
|
+
本地查看:`node scripts/watch-plugin-compatibility.mjs`。本地默认不创建 issue。单元检查:`node test/plugin-compatibility-watch.mjs`。
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# v1.9.5
|
|
2
|
+
|
|
3
|
+
## 中文
|
|
4
|
+
|
|
5
|
+
### Codex 额度恢复显示
|
|
6
|
+
|
|
7
|
+
开启“显示 Codex 额度”和“在侧栏显示 Codex 额度”后,查询失败或暂未登录不会再让卡片消失。卡片显示登录与重试提示,点击可立即重新查询。启用期间自动恢复检查,成功数据缓存五分钟,失败一分钟后重试;关闭后停止检查。
|
|
8
|
+
|
|
9
|
+
额度改用简洁文字卡,例如“周额度 · 剩余 83% · 10/25 08:10 重置”。按接口实际返回的窗口显示,Pro 等只返回周额度的账户不会增加 5h;只有存在 5h 时才增加对应行。预览跟随已取得的窗口,没有账号数据时默认只预览周额度。统一使用剩余比例,重置时间按本机时区显示;会话额度条也明确标注“剩余”,多窗口时标明 5h/周。
|
|
10
|
+
|
|
11
|
+
在“设置 → 费用 → 显示 → 输入区”选择“Codex 额度”,可以单独关闭“在输入区显示 Codex 额度”,保留侧栏卡片。侧栏和输入区的开关相互独立,两个位置都隐藏时停止额度查询。
|
|
12
|
+
|
|
13
|
+
“使用示例数据”的百分比仅用于预览。真实额度仍需要启用并登录对应 Codex 插件。修复当前数据预览使用旧快照的问题,预览本身不触发账户查询。
|
|
14
|
+
|
|
15
|
+
### 三个兼容插件的 GitHub 监控
|
|
16
|
+
|
|
17
|
+
每日北京时间 08:23 检查 billion-context、dsh-codex-subscription、dsh-codex-connect 的 npm latest。对比导出入口、DSH 兼容范围、宿主依赖和接入函数的语法指纹,billion-context 同时运行现有原版源码契约检查。
|
|
18
|
+
|
|
19
|
+
新版本、接口变化或检查失败时,GitHub 机器人创建或更新对应插件的跟踪 issue;相同结果不重复通知。不执行上游发布包,不自动升级或自动接受新基线。静态检查与真实账号完整运行是不同的验证范围。[监控说明](plugin-compatibility-watch.md)
|
|
20
|
+
|
|
21
|
+
更新后完全退出 DSH(包括托盘)再重新打开。
|
|
22
|
+
|
|
23
|
+
## English
|
|
24
|
+
|
|
25
|
+
### Codex quota recovery
|
|
26
|
+
|
|
27
|
+
Enabled sidebar cards stay visible when quota reads fail or the account is signed out. The card explains how to recover and supports an immediate click-to-retry. Enabled views check once per minute, cache successful reads for five minutes, and retry failures after one minute. Disabling the view cleans up its checks.
|
|
28
|
+
|
|
29
|
+
Compact text rows show the window, explicit remaining percentage and reset date/time in the device timezone, with a separate 5h row when available. The conversation strip also labels percentages as remaining.
|
|
30
|
+
|
|
31
|
+
Display settings now include Codex in the composer component menu, with separate sidebar and composer switches. Hiding one keeps the other; hiding both stops quota reads.
|
|
32
|
+
|
|
33
|
+
Example percentages remain preview-only. Real quota requires an enabled, signed-in Codex plugin. Current-data previews now read the current cache without querying the account.
|
|
34
|
+
|
|
35
|
+
### Upstream compatibility monitoring
|
|
36
|
+
|
|
37
|
+
A daily GitHub workflow checks npm latest for billion-context, dsh-codex-subscription and dsh-codex-connect. It compares package exports, DSH compatibility, host dependencies and relevant function fingerprints; billion-context also runs the existing source contract checks. New releases, changed interfaces and failed checks create or update one bot issue per plugin. Unchanged observations stay quiet. Upstream code is never executed or automatically accepted as a new baseline.
|
|
38
|
+
|
|
39
|
+
Fully quit DSH, including its tray process, and reopen it after updating.
|