@pinkbanana/dsh-balance 0.12.0 → 0.12.1

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
@@ -29,9 +29,9 @@ DeepSeek Harness 插件,用于查询 DeepSeek / StepFun API 余额,以及 De
29
29
 
30
30
  ## 兼容性
31
31
 
32
- 0.12.0 适配 DeepSeek Harness **0.2.1-rc.5**([上游版本](https://github.com/deepseek-ai/deepseek-harness/releases/tag/dsh-v0.2.1-rc.5)),需要 Node.js **22.19+(22.x)或 24+**。所有 DSH peer 依赖和开发依赖均锁定为 `0.2.1-rc.5`。Harness `0.2.0-rc.2` 用户请继续使用插件 `0.10.2`;本次源码不再兼容 Harness 0.1 的接口。
32
+ 0.12.1 适配 DeepSeek Harness **0.2.1-rc.5**([上游版本](https://github.com/deepseek-ai/deepseek-harness/releases/tag/dsh-v0.2.1-rc.5)),需要 Node.js **22.19+(22.x)或 24+**。所有 DSH peer 依赖和开发依赖均锁定为 `0.2.1-rc.5`。Harness `0.2.0-rc.2` 用户请继续使用插件 `0.10.2`;本次源码不再兼容 Harness 0.1 的接口。
33
33
 
34
- 新版 dsh 会在安装及启动时校验插件兼容版本。旧插件锁定 `rc.2`,会被 `rc.5` 拒绝加载;请升级到插件 `0.12.0`,无需添加版本豁免。仍使用 dsh `0.2.1-rc.2` 的用户请保留插件 `0.11.0`。
34
+ 新版 dsh 会在安装及启动时校验插件兼容版本。旧插件锁定 `rc.2`,会被 `rc.5` 拒绝加载;请升级到插件 `0.12.1`,无需添加版本豁免。仍使用 dsh `0.2.1-rc.2` 的用户请保留插件 `0.11.0`。
35
35
 
36
36
  也可在本地构建并打包源码,再用 `dsh plugin --profile web add /absolute/path/to/package.tgz` 安装生成的 `.tgz` 文件,随后重启 Harness:
37
37
 
@@ -42,7 +42,9 @@ pnpm pack
42
42
 
43
43
  消费统计通过新版只读会话句柄读取,以 `inheritedEventCount` 排除分叉继承的记录;会话页在 token 用量变化或一轮运行结束后刷新;统计页面每 15 秒检查更新,重新聚焦或返回页面时刷新,隐藏页面暂停查询。兼容 `assistant/message` 和重试/取消请求的 `assistant/attempt`,读取最后一条 stream usage,并以重试边界区分独立请求,同一次请求的重复结算仅计一次。
44
44
 
45
- 全局统计会跳过当前 dsh 无法读取的旧格式或损坏会话,并显示未纳入统计的会话数量;其余会话仍正常统计。部分读取结果不缓存,下次刷新会重试。单个会话无法读取或所有会话都读取失败时,仍明确显示读取错误,不将失败记录当作零消费。
45
+ 全局统计会跳过当前 dsh 无法读取的旧格式或损坏会话,并显示未纳入统计的会话数量;其余会话仍正常统计。部分汇总结果不缓存,下次刷新会重试失败会话;已成功读取且 revision 未变化的会话复用精简用量记录。单个会话无法读取或所有会话都读取失败时,仍明确显示读取错误,不将失败记录当作零消费。
46
+
47
+ 自 `0.12.1` 起,统计查询逐个读取会话,提取请求用量后即释放完整日志;所有请求共享读取队列,同一会话的并发读取合并。缓存仅保留用量与标题,不保留消息或工具输出。切换提供方、日期范围或重复刷新不再同时加载多份完整历史,避免大量会话引起堆内存耗尽。手动强制刷新会重新读取日志。
46
48
 
47
49
  分类明细采用带数量的 Tab 面板,在模型、提供方、会话和日期之间切换;窄屏自动改用主题化选择器。每页默认 10 条,可选择 5 / 10 / 20 条。会话消费页分别查看模型汇总与请求明细,请求支持模型筛选。长名称省略显示,悬停保留完整名称。
48
50
 
package/README_EN.md CHANGED
@@ -27,7 +27,7 @@ The composer readout follows the current session’s provider and model. The Set
27
27
 
28
28
  ## Compatibility
29
29
 
30
- Version 0.12.0 targets DeepSeek Harness **0.2.1-rc.5** ([upstream release](https://github.com/deepseek-ai/deepseek-harness/releases/tag/dsh-v0.2.1-rc.5)). Use Node.js **22.19+ (22.x) or 24+**. All DSH peer and development dependencies are pinned to `0.2.1-rc.5`. Harness `0.2.0-rc.2` users should keep plugin `0.10.2`; Harness 0.1 APIs are no longer supported by this checkout.
30
+ Version 0.12.1 targets DeepSeek Harness **0.2.1-rc.5** ([upstream release](https://github.com/deepseek-ai/deepseek-harness/releases/tag/dsh-v0.2.1-rc.5)). Use Node.js **22.19+ (22.x) or 24+**. All DSH peer and development dependencies are pinned to `0.2.1-rc.5`. Harness `0.2.0-rc.2` users should keep plugin `0.10.2`; Harness 0.1 APIs are no longer supported by this checkout.
31
31
 
32
32
  To install from source, build and pack it locally, then pass the generated `.tgz` path to `dsh plugin --profile web add /absolute/path/to/package.tgz` and restart Harness:
33
33
 
@@ -38,12 +38,14 @@ pnpm pack
38
38
 
39
39
  Usage reads the current read-only session handles and excludes fork-inherited events using `inheritedEventCount`. The conversation tab refreshes when token usage changes or a turn finishes.
40
40
 
41
- Global statistics skip sessions that the current dsh cannot read, such as unsupported historical formats or damaged logs, and show how many sessions were excluded. Partial results are retried on the next refresh without caching. An unreadable selected session, or a collection where every session fails to read, still reports an error instead of showing zero usage.
41
+ Global statistics skip sessions that the current dsh cannot read, such as unsupported historical formats or damaged logs, and show how many sessions were excluded. Partial summaries are retried on the next refresh; unchanged successful sessions reuse compact usage records while failed sessions are retried. An unreadable selected session, or a collection where every session fails to read, still reports an error instead of showing zero usage.
42
42
 
43
43
  Usage breakdowns use counted tabs for models, providers, sessions, and dates, with a themed category selector on narrow screens. Lists default to 10 rows per page, with 5 / 10 / 20 options. The conversation page separates model summaries and requests, and requests can be filtered by model. Long names are truncated with their full value available on hover.
44
44
 
45
45
  ![Tabbed breakdown and pagination](./docs/dsh-usage-tabs.jpg)
46
46
 
47
+ Since `0.12.1`, usage queries read one session log at a time across all HTTP requests, extract compact request metadata, and release the full log before continuing. Concurrent reads of the same session are shared. Unchanged successful sessions reuse revision-keyed usage records even when another session is unreadable; explicit refresh re-reads logs. Cached records exclude message bodies and tool output, preventing full-history retention and overlapping scans from exhausting the JavaScript heap.
48
+
47
49
  ## Install
48
50
 
49
51
  ```bash
@@ -79,7 +81,7 @@ Statistics cover locally saved dsh sessions only, not other clients or organizat
79
81
 
80
82
  Conversation/reasoning model estimates use the [Tokener model catalog](https://www.tokener.ai/zh/models) USD reference snapshot checked on 2026-11-03, matching exact model IDs without vendor rates or DeepSeek peak multipliers. This snapshot also estimates older records; it does not reconstruct historical charges. Unknown models, missing usage, and requests with unpublished cache-write pricing retain their requests/tokens but stay unpriced. Account balances and actual bills remain in the [Tokener console](https://console.tokener.ai).
81
83
 
82
- New dsh versions validate compatibility before installation and startup. Plugin `0.11.0` declares `rc.2` peers and is rejected on `rc.5`; upgrade to `0.12.0` without a version exemption. Keep plugin `0.11.0` if you remain on dsh `0.2.1-rc.2`.
84
+ New dsh versions validate compatibility before installation and startup. Plugin `0.11.0` declares `rc.2` peers and is rejected on `rc.5`; upgrade to `0.12.1` without a version exemption. Keep plugin `0.11.0` if you remain on dsh `0.2.1-rc.2`.
83
85
 
84
86
  ## StepFun setup
85
87