dsh-cost-meter 1.9.7 → 1.9.9

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.7-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
13
+ [![version](https://img.shields.io/badge/version-1.9.9-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.7** fixes the sidebar introduction close button being obstructed by desktop titlebars or plugin containers. Dismissal works with translucent skins, duplicated slots, and unavailable settings saves.
19
+ **v1.9.9** fixes Go credential discovery for custom OpenCode data paths and environment sign-in data, accepts a pasted Bearer prefix, and distinguishes authentication failures from missing workspace entitlements. Both dedicated keys and automatic discovery are covered.
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.7](docs/update-notes-1.9.7.md#english). Fully restart DSH after updating.
26
+ Release notes: [v1.9.9](docs/update-notes-1.9.9.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.7`** — 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.9`** — review the script before running):
345
345
 
346
346
  ```powershell
347
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.7/install.ps1 | iex
347
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.9/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.7
353
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.9
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.7.tar.gz
359
+ dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.9.9.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.7
424
+ - dsh-cost-meter@1.9.9
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.7-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
13
+ [![version](https://img.shields.io/badge/version-1.9.9-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.7** 修复“试试更轻巧的侧栏”提示无法关闭的问题,避开桌面端标题栏,适配皮肤和插件容器;重复挂载、设置保存失败或等待时也能关闭。
19
+ **v1.9.9** 修复 OpenCode Go 自定义数据目录和环境登录态的凭据读取,支持粘贴带 Bearer 前缀的 Key,区分认证失败与工作区订阅权限。覆盖单独保存 Key 和自动读取两种方式。
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.7](docs/update-notes-1.9.7.md#中文)。更新后完全重启 DSH。
26
+ 更新说明:[v1.9.9](docs/update-notes-1.9.9.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.7`**,建议先下载审阅再运行):
344
+ **PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.9.9`**,建议先下载审阅再运行):
345
345
 
346
346
  ```powershell
347
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.7/install.ps1 | iex
347
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.9/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.7
353
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.9
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.7.tar.gz
359
+ dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.9.9.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.7
424
+ - dsh-cost-meter@1.9.9
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 上实测可用。
@@ -0,0 +1,49 @@
1
+ # v1.9.8
2
+
3
+ ## 中文
4
+
5
+ ### 修复 Deep Whale 皮肤下峰谷提醒被遮挡、无法点击
6
+
7
+ 峰谷提醒此前仍是侧栏容器内的普通固定浮层。页面内容可能从上方覆盖它,同时提醒会继承宿主容器的鼠标禁用或窗口拖动属性,造成看似“透过去”、按钮无法点击。
8
+
9
+ 现在峰谷提醒和侧栏引导共用浏览器最上层浮层;提醒明确接收鼠标事件并退出窗口拖动区域,保留不透明主题背景。居中、右下角、窄窗口均可点击“知道了”,关闭不依赖设置保存。弹窗之外的页面保持可操作。
10
+
11
+ 本地加载 `dsh-deep-whale` 实际发布的 Maid Atelier `0.1.8` 与 Orca Link `0.1.8` 前端,覆盖亮色、深色、两种位置和三种窗口宽度,共 16 个组合;另检查真实切换时刻的关闭记忆、触屏、键盘以及页面级事件拦截。持续回归使用可复现容器变换、裁切、透明度和层级的本地样式,不依赖下载第三方包。
12
+
13
+ ### 修复挂件拦截侧栏引导点击
14
+
15
+ v1.9.7 已解决提示被标题栏和容器遮挡的问题。本轮用实际插件前端组合检查时,进一步复现:鲸鱼挂件使用不透明自定义角色图并与提示按钮重叠时,会在 document 捕获阶段按图像坐标拦截点击,即使提示处于浏览器最上层也会受影响。
16
+
17
+ 费用插件现在只在自己的侧栏引导范围内提前处理鼠标与触屏事件,“关闭”“保留当前显示”“开启简化显示”均可操作。布局选择只保存一次,关闭继续独立于设置保存。引导之外的页面操作、以及从外部开始后释放到引导区域的拖动,继续交给原有处理器。不修改或关闭第三方插件。
18
+
19
+ ### 实际前端组合验证
20
+
21
+ | 插件 | npm 版本 | 本轮验证 |
22
+ | --- | --- | --- |
23
+ | Wallpaper Engine | `dsh-plugin-wallpaper-engine@1.3.3` | 实际前端与玻璃样式 |
24
+ | 鲸鱼挂件 | `dsh-whale-widget@0.4.2` | 实际前端、鼠标捕获、不透明角色图重叠 |
25
+ | Archive Manager | `@michengai/dsh-archive-manager@1.1.2` | 实际前端注册与样式 |
26
+ | 可组合记忆 | `dsh-mnemon@0.5.32` | 实际前端注册 |
27
+ | Free Search | `dsh-free-search@0.9.5` | 实际前端注册 |
28
+ | 插件市场 | `dshmarket@1.66.39` | 实际前端注册 |
29
+ | dsh-ops | `dsh-ops@0.3.0` | 无前端入口,检查包声明与宿主代码 |
30
+
31
+ 包从 npm 下载并校验 SHA-512;六个实际前端在隔离 Chrome 页面共同加载,后台接口使用测试数据。测试不运行模型、搜索、记忆服务或命令工具,不读取用户凭据,也不向正在使用的桌面端额外安装这些第三方插件。此表验证的是提示交互兼容,不代表这些插件的全部业务功能或历史版本均已测试。
32
+
33
+ 新增持续回归覆盖页面级鼠标拦截、三个按钮各执行一次、触屏关闭、外部拖动释放及页面其他按钮操作。
34
+
35
+ 更新后完全退出 DSH(包括托盘)再打开。
36
+
37
+ ## English
38
+
39
+ Fixes peak/off-peak reminders being painted underneath conversation content or losing pointer interaction with Deep Whale skins. Reminders now share the browser top-layer card used by the sidebar guide, explicitly accept pointer input, avoid native window dragging and retain an opaque theme background. Both center and corner positions remain dismissible without a settings save.
40
+
41
+ The published Maid Atelier 0.1.8 and Orca Link 0.1.8 browser clients were loaded locally across light/dark themes, both positions and three viewport widths (16 combinations). Real-transition dismissal, touch, keyboard and document-capture interception are also covered. CI uses local stacking/clipping fixtures without downloading third-party packages.
42
+
43
+ Fixes sidebar-guide actions being intercepted by floating widgets. An actual `dsh-whale-widget@0.4.2` client with an opaque custom avatar can consume document-capture events by image coordinates even when the guide is visually above it.
44
+
45
+ The cost meter now handles events within its own guide before document-level interceptors. Dismissal and both layout choices remain usable, with one settings write per choice. Unrelated page interactions and drags that started outside the guide continue to reach their existing handlers. Third-party plugin code and configuration are unchanged.
46
+
47
+ The real published browser clients of Wallpaper Engine 1.3.3, Whale Widget 0.4.2, Archive Manager 1.1.2, Mnemon 0.5.32, Free Search 0.9.5 and dshmarket 1.66.39 were loaded together in an isolated Chrome page with fixture backend data. Package integrity was verified. dsh-ops 0.3.0 has no browser client and was inspected statically. This validates guide interaction, not every plugin feature or historical version. No model, search, memory-provider or command-tool calls are made.
48
+
49
+ Fully quit DSH, including its tray process, and reopen after updating.
@@ -0,0 +1,37 @@
1
+ # v1.9.9
2
+
3
+ ## 中文
4
+
5
+ ### OpenCode Go 凭据读取与 401 提示
6
+
7
+ 感谢 [@weimingyu9312](https://github.com/weimingyu9312) 在 [#325](https://github.com/Han-1413141/dsh-cost-meter/issues/325) 报告 Tauri 桌面环境刷新 Go 额度返回 401。
8
+
9
+ - 单独保存 Key:在 **设置 → 费用 → 额度 → OpenCode Go** 展开配置,编辑凭据并保存,再点击刷新。复制了 `Bearer Key` 时只保留一层 Bearer 认证头;整段请求头、内部空白等无效输入会在本地提示修正。
10
+ - 自动读取:继续按照专用引用、官方 Go 模型路由引用、兼容环境变量、OpenCode 登录态、遗留配置的顺序读取。新增识别 `OPENCODE_AUTH_CONTENT` 和 `XDG_DATA_HOME/opencode/auth.json`,当前有效登录数据优先于旧文件;显式数据目录的登录文件缺失或损坏时不再回退旧目录,退出登录后也不再复活旧文件中的 Key。
11
+ - 401 明确提示当前 Key 未通过认证,不再认定没有订阅。只有 403 且官方响应类型为 `EntitlementError` 时,才提示该 Key 所属工作区没有 Go 权限;其他访问拒绝单独显示。
12
+ - 认证失败按照刷新间隔缓存,避免重复请求。手动刷新、保存或清除专用凭据可立即重试;不会在认证失败后偷偷换成另一个账号的 Key。
13
+ - 费用插件保存和清除只操作自己的 `OPENCODE_GO_API_KEY`,不修改模型路由共用凭据。请求固定发送到官方额度 GET 接口,不发模型请求;空窗口不会被当作 0% 用量。
14
+
15
+ 另外在与报告一致的 DSH `0.2.0-rc.2` 内核中,使用真实 Cordis Loader、凭据库和 Typert RPC 验证保存、清除、刷新、401 后恢复及环境/目录自动读取,全部通过;该集成测试已加入 CI 的 `0.2.0-rc.2` 与 `0.2.1-rc.2` 两个宿主。
16
+
17
+ 本地测试覆盖单独保存和自动读取两种流程,以及轮换、清除、环境登录态覆盖、数据目录、401/403、缓存、恢复与脱敏。测试使用隔离凭据和官方响应结构,不代表已经取得报告者在其 Tauri 环境的复测结果;原 issue 保留等待该环境确认。
18
+
19
+ 依据:[OpenCode 登录态读取源码](https://github.com/anomalyco/opencode/blob/fc7e4cf93e660ad5ddabb0c48ecc99e934ebfe95/packages/opencode/src/auth/index.ts)、[数据目录源码](https://github.com/anomalyco/opencode/blob/fc7e4cf93e660ad5ddabb0c48ecc99e934ebfe95/packages/core/src/global.ts)、[官方 Go 文档](https://opencode.ai/docs/go/)。
20
+
21
+ 更新后完全退出 DSH(包括托盘)再打开。
22
+
23
+ ## English
24
+
25
+ Thanks to [@weimingyu9312](https://github.com/weimingyu9312) for reporting an HTTP 401 when refreshing Go quotas in a Tauri desktop environment in [#325](https://github.com/Han-1413141/dsh-cost-meter/issues/325).
26
+
27
+ - Both dedicated keys and automatic discovery are covered. A pasted Bearer prefix no longer creates a duplicate authorization prefix; invalid full headers are rejected locally.
28
+ - Automatic discovery now reads `OPENCODE_AUTH_CONTENT` and `XDG_DATA_HOME/opencode/auth.json`. Current sign-in data takes precedence over older files, including an empty login set after logout. An explicit data directory never falls back to an older directory when its login file is missing or corrupt. Existing dedicated-key and official model-route priority is preserved.
29
+ - HTTP 401 is reported as failed authentication, not a missing subscription. Only an explicit 403 `EntitlementError` is classified as missing Go workspace entitlement; other access-control failures have a separate message.
30
+ - Authentication failures respect the refresh interval. Manual refresh and saving or clearing a dedicated credential can retry immediately. A failed credential does not silently switch the query to another account.
31
+ - Shared model credentials remain unchanged. Queries use the fixed official GET endpoint, make no inference calls and do not turn missing usage windows into zero usage.
32
+
33
+ An actual DSH 0.2.0-rc.2 kernel also passes the real Cordis loader, local credential store and Typert RPC save/clear/refresh, 401 recovery and env/XDG discovery checks. CI runs the integration test on both 0.2.0-rc.2 and 0.2.1-rc.2.
34
+
35
+ Local service tests cover both credential flows, rotation, clearing, auth overrides, paths, 401/403 classification, caching, recovery and redaction with isolated credentials. The reporter's Tauri environment has not yet been retested, so the original issue remains open for confirmation.
36
+
37
+ Fully quit DSH, including its tray process, and reopen after updating.