dsh-cost-meter 1.9.4 → 1.9.6

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 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
- [![version](https://img.shields.io/badge/version-1.9.4-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
13
+ [![version](https://img.shields.io/badge/version-1.9.6-4176E6)](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.4** adds compact, stable model pricing, independent model statistics and display controls, and a peak-period progress style. It fixes OpenDesign credential saving and partial query feedback, and adds Codex quota windows with protected source switching.
19
+ **v1.9.6** restores official balances immediately after re-enabling display, adds per-source LAN HTTP permissions to CLIProxyAPI settings, and blends composer quota chips into the page background.
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.4](docs/update-notes-1.9.4.md#english). Fully restart DSH after updating.
26
+ Release notes: [v1.9.6](docs/update-notes-1.9.6.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.4`** — review the script before running):
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.6`** — review the script before running):
345
345
 
346
346
  ```powershell
347
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.4/install.ps1 | iex
347
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.6/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.4
353
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.6
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.4.tar.gz
359
+ dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.9.6.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.4
424
+ - dsh-cost-meter@1.9.6
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
- [![version](https://img.shields.io/badge/version-1.9.4-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
13
+ [![version](https://img.shields.io/badge/version-1.9.6-4176E6)](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.4** 带来固定顺序的紧凑定价列表、每模型独立统计、独立显示开关与峰谷进度条;修复 OpenDesign 凭据保存和部分查询反馈,加入 Codex 双窗口与数据源切换保护。
19
+ **v1.9.6** 修复官方余额关闭显示后无法立即恢复的问题;补齐 CLIProxyAPI 每个来源的局域网 HTTP 权限设置;输入区额度条背景与页面保持一致。
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.4](docs/update-notes-1.9.4.md#中文)。更新后完全重启 DSH。
26
+ 更新说明:[v1.9.6](docs/update-notes-1.9.6.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.4`**,建议先下载审阅再运行):
344
+ **PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.9.6`**,建议先下载审阅再运行):
345
345
 
346
346
  ```powershell
347
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.4/install.ps1 | iex
347
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.6/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.4
353
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.6
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.4.tar.gz
359
+ dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.9.6.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.4
424
+ - dsh-cost-meter@1.9.6
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 上实测可用。
@@ -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.
@@ -0,0 +1,45 @@
1
+ # v1.9.6
2
+
3
+ ## 中文
4
+
5
+ ### 官方余额重新开启后立即显示
6
+
7
+ 修复“显示位置设为关闭,退出设置,再进入改回两者都显示后,余额仍不出现”的问题。关闭时写入的状态不再阻挡重新查询,恢复显示会立即取得余额或显示查询错误,无需重启或等待刷新间隔。仅在侧栏、设置页面之间切换位置时继续沿用有效缓存。
8
+
9
+ ### CLIProxyAPI 局域网配置
10
+
11
+ 在“设置 → 费用 → 额度”中,点击 CLIProxyAPI 来源名称展开配置。每个来源现在都提供凭据白名单和“允许非回环 HTTP”开关。
12
+
13
+ 例如 Base URL 为 `http://192.168.1.100:8317` 时,凭据白名单填写 `192.168.1.100:8317`,并勾选“允许非回环 HTTP”,然后保存该来源的 Management Key 并启用。HTTPS 来源只需配置准确的主机与端口白名单;HTTP 会明文传输凭据,开关说明保留此提示。授权分别属于各个来源,添加其他来源不会继承。
14
+
15
+ 感谢 [@snhun](https://github.com/snhun) 在 [#321](https://github.com/Han-1413141/dsh-cost-meter/issues/321) 报告局域网配置缺少入口,并建议为新增来源分别提供配置。
16
+
17
+ ### 输入区额度组件背景
18
+
19
+ 输入框上方的预算、Go、套餐与 Codex 额度组件改用透明背景,与所在页面保持一致;文字、进度条和交互状态继续使用 DSH 主题颜色。
20
+
21
+ ### 本地验证
22
+
23
+ 使用已构建客户端与生产宿主服务,在真实 Chrome 中执行关闭余额、退出设置、重新进入并恢复显示的完整过程;刷新间隔设为 60 分钟,恢复后立即显示余额。CLIProxyAPI 使用本机局域网 HTTP 模拟管理服务,验证配置保存、重新进入、真实 HTTP 查询、两个来源权限独立,以及缺少白名单或 HTTP 授权时在发送凭据前拒绝请求。数据和密钥为测试值,不查询用户账户,不调用模型。
24
+
25
+ 安装更新后,完全退出 DSH(包括托盘)再打开以加载新版插件。以后切换余额显示无需重启。
26
+
27
+ ## English
28
+
29
+ ### Immediate balance display recovery
30
+
31
+ Re-enabling official balance display now queries immediately instead of reusing a disabled snapshot until its refresh interval expires. Closing and reopening settings no longer requires a DSH restart. Switching between sidebar and settings placements retains valid cached data.
32
+
33
+ ### CLIProxyAPI LAN settings
34
+
35
+ Each source now exposes its exact credential host allowlist and non-loopback HTTP permission. For `http://192.168.1.100:8317`, enter `192.168.1.100:8317` in that source's allowlist and enable non-loopback HTTP. HTTP sends credentials in plaintext, as indicated by the control. Permissions remain independent between sources. Thanks to [@snhun](https://github.com/snhun) for reporting the missing controls and suggesting per-source settings in [#321](https://github.com/Han-1413141/dsh-cost-meter/issues/321).
36
+
37
+ ### Composer quota backgrounds
38
+
39
+ Quota chips above the composer use a transparent background to blend into their containing page while retaining theme text, progress bars and interaction states.
40
+
41
+ ### Validation
42
+
43
+ A real Chrome test connects the built client to the production host service, exercises closing and reopening settings with a 60-minute balance cache, and queries a local LAN HTTP gateway. It verifies persisted source configuration, independent permissions, and rejection before credential transmission when either permission is missing. All account data and credentials are synthetic; no model calls are made.
44
+
45
+ Fully quit DSH, including its tray process, and reopen after installing this update. Subsequent balance display toggles do not require restarting.