dsh-cost-meter 1.9.28 → 1.9.30
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/THIRD_PARTY_NOTICES.md +2 -0
- package/docs/update-notes-1.9.29.md +45 -0
- package/docs/update-notes-1.9.30.md +46 -0
- package/lib/client.js +2 -2
- package/lib/client.sidebar-order.js +1 -1
- package/lib/ledger-persistence.js +2 -2
- package/lib/ledger-writer-worker.js +2 -30
- package/lib/ledger-writer.js +22 -6
- package/lib/plan-billing.js +1 -1
- package/lib/store.js +18 -5
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
**Session cost tracking plugin for the DeepSeek Harness web GUI (bilingual UI)**
|
|
8
8
|
|
|
9
|
-
[](https://github.com/Han-1413141/dsh-cost-meter)
|
|
10
10
|
[](https://www.npmjs.com/package/dsh-cost-meter)
|
|
11
11
|
[](https://dshfind.com/zh/plugins/Han-1413141/dsh-cost-meter?ref=badge)
|
|
12
12
|
[](LICENSE)
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
|
|
17
17
|
</div>
|
|
18
18
|
|
|
19
|
-
**v1.9.
|
|
19
|
+
**v1.9.30** fixes Desktop sidebar spacing, OpenDesign balance placement, two-line Today alignment and background ledger saving/disposal.
|
|
20
20
|
|
|
21
21
|
**Host floor: DSH 0.2.0** · Adaptation target: **0.2.1-rc.2** (npm `next`). Expand the compatibility notes below for exact declarations, host records and troubleshooting.
|
|
22
22
|
|
|
23
|
-
Release notes: [v1.9.
|
|
23
|
+
Release notes: [v1.9.30](docs/update-notes-1.9.30.md#english). Fully restart DSH after updating.
|
|
24
24
|
|
|
25
25
|

|
|
26
26
|
|
|
@@ -352,22 +352,22 @@ On Node.js 20, use `npm install -g pnpm@10` instead. See [pnpm installation and
|
|
|
352
352
|
dsh plugin --profile web add dsh-cost-meter
|
|
353
353
|
```
|
|
354
354
|
|
|
355
|
-
**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.
|
|
355
|
+
**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.30`** — review the script before running):
|
|
356
356
|
|
|
357
357
|
```powershell
|
|
358
|
-
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.
|
|
358
|
+
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.30/install.ps1 | iex
|
|
359
359
|
```
|
|
360
360
|
|
|
361
361
|
**Or a plain command line** (the machine must already have pnpm and git; also pinned to the tag):
|
|
362
362
|
|
|
363
363
|
```sh
|
|
364
|
-
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.
|
|
364
|
+
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.30
|
|
365
365
|
```
|
|
366
366
|
|
|
367
367
|
Without git, use the GitHub tag archive:
|
|
368
368
|
|
|
369
369
|
```sh
|
|
370
|
-
dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.9.
|
|
370
|
+
dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.9.30.tar.gz
|
|
371
371
|
```
|
|
372
372
|
|
|
373
373
|
After installing, **restart** `dsh web` (plugin rows, the Typert manifest and the client bundle are all scanned at startup):
|
|
@@ -432,7 +432,7 @@ Workarounds:
|
|
|
432
432
|
|
|
433
433
|
```yaml
|
|
434
434
|
minimumReleaseAgeExclude:
|
|
435
|
-
- dsh-cost-meter@1.9.
|
|
435
|
+
- dsh-cost-meter@1.9.30
|
|
436
436
|
```
|
|
437
437
|
|
|
438
438
|
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
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
**DeepSeek Harness 会话费用统计插件(界面中英双语)**
|
|
8
8
|
|
|
9
|
-
[](https://github.com/Han-1413141/dsh-cost-meter)
|
|
10
10
|
[](https://www.npmjs.com/package/dsh-cost-meter)
|
|
11
11
|
[](https://dshfind.com/zh/plugins/Han-1413141/dsh-cost-meter?ref=badge)
|
|
12
12
|
[](LICENSE)
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
|
|
17
17
|
</div>
|
|
18
18
|
|
|
19
|
-
**v1.9.
|
|
19
|
+
**v1.9.30** 修复桌面侧栏底部留白、OpenDesign 余额位置、今日消费两行对齐,以及后台账本保存和卸载卡住的问题。
|
|
20
20
|
|
|
21
21
|
**宿主要求:DSH 0.2.0 起支持** · 适配目标 **0.2.1-rc.2**(npm `next`)。完整声明、历史记录与安装排障见下方展开项。
|
|
22
22
|
|
|
23
|
-
更新说明:[v1.9.
|
|
23
|
+
更新说明:[v1.9.30](docs/update-notes-1.9.30.md#中文)。更新后完全重启 DSH。
|
|
24
24
|
|
|
25
25
|

|
|
26
26
|
|
|
@@ -352,22 +352,22 @@ Node.js 20 请改用 `npm install -g pnpm@10`。版本要求见 [pnpm 官方安
|
|
|
352
352
|
dsh plugin --profile web add dsh-cost-meter
|
|
353
353
|
```
|
|
354
354
|
|
|
355
|
-
**PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.9.
|
|
355
|
+
**PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.9.30`**,建议先下载审阅再运行):
|
|
356
356
|
|
|
357
357
|
```powershell
|
|
358
|
-
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.
|
|
358
|
+
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.30/install.ps1 | iex
|
|
359
359
|
```
|
|
360
360
|
|
|
361
361
|
**或直接命令行**(机器上需已有 pnpm 与 git;同样固定到 tag):
|
|
362
362
|
|
|
363
363
|
```sh
|
|
364
|
-
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.
|
|
364
|
+
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.30
|
|
365
365
|
```
|
|
366
366
|
|
|
367
367
|
没有 git 时可用 GitHub tag 打包直链:
|
|
368
368
|
|
|
369
369
|
```sh
|
|
370
|
-
dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.9.
|
|
370
|
+
dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.9.30.tar.gz
|
|
371
371
|
```
|
|
372
372
|
|
|
373
373
|
安装后**重启** `dsh web`(插件行、Typert 清单与客户端 bundle 均在启动时扫描):
|
|
@@ -432,7 +432,7 @@ DSH **0.2.1-rc.1 / 0.2.1-rc.2** 宿主自带 pnpm **11.28.5**,默认启用内
|
|
|
432
432
|
|
|
433
433
|
```yaml
|
|
434
434
|
minimumReleaseAgeExclude:
|
|
435
|
-
- dsh-cost-meter@1.9.
|
|
435
|
+
- dsh-cost-meter@1.9.30
|
|
436
436
|
```
|
|
437
437
|
|
|
438
438
|
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/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -4,6 +4,8 @@ The display settings preview reuses selected SVG artwork and presentation CSS fr
|
|
|
4
4
|
|
|
5
5
|
Artwork is reused without geometry changes. Presentation styles are scoped and adapted into separate regions at normal text size. The preview uses the host's exported primitives when available.
|
|
6
6
|
|
|
7
|
+
The standalone ledger worker also bundles the home-directory resolver from @deepseek-ai/dsh-home-paths 0.2.1-rc.1, under the same DeepSeek MIT license below. It does not bundle the host runtime or credential services.
|
|
8
|
+
|
|
7
9
|
MIT License
|
|
8
10
|
|
|
9
11
|
Copyright (c) 2026 DeepSeek
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# v1.9.29 更新说明
|
|
2
|
+
|
|
3
|
+
## 中文
|
|
4
|
+
|
|
5
|
+
本次更新修复用户反馈的桌面侧栏布局、后台账本保存和插件卸载问题。
|
|
6
|
+
|
|
7
|
+
### 修复内容
|
|
8
|
+
|
|
9
|
+
- **账本保存失败:**v1.9.28 的后台线程没有继承 DSH 的模块解析环境,部分安装方式会反复报告找不到 `@deepseek-ai/dsh-home-paths`。现将线程及其依赖独立打包,可在没有宿主模块解析器的环境中运行。
|
|
10
|
+
- **卸载与重载卡住:**卸载时异步等待正在进行的写入,让宿主事件循环继续处理完成和失败消息。线程超时后终止并释放它持有的锁,再完成最终保存;提交回执仍防止重复记账。
|
|
11
|
+
- **桌面端底部空白:**费用区按内容占据高度,避免皮肤拉伸底部容器,使卡片与用户操作区保持紧邻。
|
|
12
|
+
- **OpenDesign 余额位置:**余额放在标题行右侧,下方保留 5h 和周额度,悬停提示保留完整含义。
|
|
13
|
+
- **紧凑同行布局:**今日金额与余额首行对齐,第二行 Token 数完整显示,不再被固定行高截断。
|
|
14
|
+
|
|
15
|
+
### 验证
|
|
16
|
+
|
|
17
|
+
- 后台线程在独立目录中运行;覆盖缺少宿主依赖、线程超时、持锁终止、卸载响应和用量只保存一次。
|
|
18
|
+
- 浏览器检查覆盖浅色与深色、标准/紧凑/合并/简洁布局、窄侧栏和插件隐藏后的宿主布局恢复。
|
|
19
|
+
- 使用真实 DSH 0.2.1-rc.2 宿主及模拟账号响应,验证已有的 pi-ai Codex 订阅读取、旧 RPC 清单兼容,以及多次加载、重载和取消。未查询真实供应商账号。
|
|
20
|
+
|
|
21
|
+
### 升级
|
|
22
|
+
|
|
23
|
+
在插件市场更新到 **1.9.29**,或按正在使用的环境执行:
|
|
24
|
+
|
|
25
|
+
```powershell
|
|
26
|
+
dsh plugin --profile desktop add dsh-cost-meter@1.9.29
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
网页端将 `desktop` 换成 `web`。升级后完全退出并重启对应的 DSH Desktop 或 Web 进程,确保新后台线程和宿主服务一并加载。
|
|
30
|
+
|
|
31
|
+
问题由用户通过截图和运行日志反馈,感谢提供桌面端表现、报错及重载现象。
|
|
32
|
+
|
|
33
|
+
## English
|
|
34
|
+
|
|
35
|
+
This patch fixes Desktop sidebar spacing, background ledger saves and plugin disposal.
|
|
36
|
+
|
|
37
|
+
- Bundle the ledger worker and its dependencies so it can run without the DSH module resolver. This fixes repeated missing `@deepseek-ai/dsh-home-paths` errors introduced by the v1.9.28 background writer in affected installations.
|
|
38
|
+
- Await active writes without blocking the host event loop. Terminate stalled workers, release only their own locks, and preserve pending usage through the final save. Atomic commit receipts continue to prevent duplicate billing.
|
|
39
|
+
- Keep footer cards next to user controls when a Desktop skin stretches the footer containers.
|
|
40
|
+
- Place the OpenDesign wallet balance beside the title, with the 5h and weekly quota rows below.
|
|
41
|
+
- Keep Today and Balance aligned while allowing both the amount and token count to remain fully visible.
|
|
42
|
+
|
|
43
|
+
Checks cover isolated workers, import failures, stalled workers holding locks, concurrent ledger writes, sidebar layouts and theme variants. Existing native pi-ai Codex quota and reload behavior was also verified with the real DSH 0.2.1-rc.2 runtime and simulated account responses; no live supplier account was queried.
|
|
44
|
+
|
|
45
|
+
Update to **1.9.29** through the plugin marketplace or use the command above. Use `web` instead of `desktop` for the Web profile. Fully exit and restart the relevant DSH process after upgrading.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# v1.9.30 更新说明
|
|
2
|
+
|
|
3
|
+
## 中文
|
|
4
|
+
|
|
5
|
+
本次更新解决后台线程失败后无法持续保存账本,以及 `dsh-opencode-go` 订阅用量被误计入 API 花费的问题。
|
|
6
|
+
|
|
7
|
+
### 后台保存
|
|
8
|
+
|
|
9
|
+
v1.9.29 已将账本线程独立打包,解决部分 Desktop/Web 安装中缺少宿主模块解析器的问题。本版本补齐失败后的保存路径:线程启动失败、导入失败或超时后,立即同步提交尚未保存的用量,后续定时保存继续走同步路径。本次运行只提示一次,不再每两秒启动同一个故障线程。重启 DSH 后重新尝试后台保存。
|
|
10
|
+
|
|
11
|
+
另一个宿主暂时占用账本锁时仍正常重试。线程已提交、但确认消息丢失时,先根据原子提交回执恢复结果,避免重复计费。
|
|
12
|
+
|
|
13
|
+
### OpenCode Go 计费
|
|
14
|
+
|
|
15
|
+
`dsh-opencode-go` 现在与 `opencode-go` 一样归入 Go 套餐家族,服务端与浏览器使用一致的别名。新调用按已保存的 Go 套餐归属分类:订阅用量保留 API 等值金额,API 花费为零;用户显式指定的渠道或模型分类仍优先。
|
|
16
|
+
|
|
17
|
+
本次不自动重算历史记录。历史修正不在 #389 的请求范围内,原有调用数、Token 数和已保存金额继续保留。
|
|
18
|
+
|
|
19
|
+
### 验证范围
|
|
20
|
+
|
|
21
|
+
- 真实 Worker 在独立目录中运行,覆盖缺少宿主依赖、启动异常、超时、持锁终止、正常定时保存和单次告警。
|
|
22
|
+
- 写入期间新增用量、多宿主合并、回执丢失、卸载等待及后续保存均保留原有数据。
|
|
23
|
+
- Go 别名覆盖大小写与 `llm-` 包装、三种报告中的模型及新模型,验证前后端分类、显式覆盖和实际持久化的 API 花费。
|
|
24
|
+
|
|
25
|
+
### 升级
|
|
26
|
+
|
|
27
|
+
在插件市场更新到 **1.9.30**,或按正在使用的环境执行:
|
|
28
|
+
|
|
29
|
+
```powershell
|
|
30
|
+
dsh plugin --profile desktop add dsh-cost-meter@1.9.30
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
网页端将 `desktop` 换成 `web`。升级后完全退出并重启对应的 DSH Desktop 或 Web 进程。
|
|
34
|
+
|
|
35
|
+
感谢 [@2239058652](https://github.com/2239058652) 在 [#387](https://github.com/Han-1413141/dsh-cost-meter/issues/387) 提供运行环境、最小复现、依赖链测试与异步失败定位;感谢 [@ZIye1208](https://github.com/ZIye1208) 在 [#389](https://github.com/Han-1413141/dsh-cost-meter/issues/389) 提供渠道对照、别名定位与补丁验证。
|
|
36
|
+
|
|
37
|
+
## English
|
|
38
|
+
|
|
39
|
+
This patch restores routine ledger saves after a worker failure and fixes billing classification for the dedicated `dsh-opencode-go` plugin.
|
|
40
|
+
|
|
41
|
+
- If worker startup, import or execution fails, save pending usage synchronously and keep subsequent scheduled saves on that path for the current process. Warn once and retry the worker after restarting DSH. Temporary lock contention still retries normally, and atomic receipts recover committed writes whose acknowledgement was lost.
|
|
42
|
+
- Map `dsh-opencode-go` to the Go family in both host and browser. New calls follow the persisted Go classification and explicit model/provider overrides. Plan usage retains its API-equivalent value with zero API spend. Historical amounts are not automatically recalculated in this patch.
|
|
43
|
+
|
|
44
|
+
Checks cover real worker failures, scheduled saves, single warnings, lock recovery, concurrent usage, lost acknowledgements, host/client classification and persisted amounts. Update to **1.9.30** and fully restart the relevant DSH Desktop or Web process.
|
|
45
|
+
|
|
46
|
+
Thanks to [@2239058652](https://github.com/2239058652) for the reproduction and asynchronous-failure analysis in [#387](https://github.com/Han-1413141/dsh-cost-meter/issues/387), and [@ZIye1208](https://github.com/ZIye1208) for the provider comparison, alias diagnosis and patch verification in [#389](https://github.com/Han-1413141/dsh-cost-meter/issues/389).
|