dsh-cost-meter 1.9.73 → 1.9.74
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 +4 -4
- package/README.zh-CN.md +4 -4
- package/docs/custom-balance-sources.en.md +6 -0
- package/docs/custom-balance-sources.md +6 -0
- package/docs/plugin-compatibility-watch.md +4 -0
- package/docs/update-notes-1.9.74.md +31 -0
- package/lib/client.display.js +2 -2
- package/lib/client.js +10 -10
- package/lib/client.plan-settings.js +1 -1
- package/lib/client.pricing.js +2 -2
- package/lib/client.statistics.js +8 -7
- package/lib/custom-balance.js +4 -0
- package/lib/ledger-writer-worker.js +1 -1
- package/lib/openai-credits.js +74 -0
- package/lib/store.js +28 -7
- package/lib/typert.host.js +9 -2
- package/package.json +2 -2
- package/docs/update-notes-1.9.73.md +0 -29
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<p align="center">Cost tracking and subscription quotas for DeepSeek Harness</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<a href="https://github.com/Han-1413141/dsh-cost-meter/releases/latest"><img src="https://img.shields.io/badge/version-1.9.
|
|
6
|
+
<a href="https://github.com/Han-1413141/dsh-cost-meter/releases/latest"><img src="https://img.shields.io/badge/version-1.9.74-4176E6?style=flat-square" alt="version"></a>
|
|
7
7
|
<a href="https://www.npmjs.com/package/dsh-cost-meter"><img src="https://img.shields.io/npm/dm/dsh-cost-meter?label=downloads&style=flat-square&color=4176E6" alt="npm monthly downloads"></a>
|
|
8
8
|
<a href="https://github.com/Han-1413141/dsh-cost-meter/stargazers"><img src="https://img.shields.io/github/stars/Han-1413141/dsh-cost-meter?label=stars&style=flat-square&color=D9A400" alt="GitHub stars"></a>
|
|
9
9
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="MIT license"></a>
|
|
@@ -42,20 +42,20 @@ Restart `dsh web` after installation or updates. **Desktop** uses its bundled CL
|
|
|
42
42
|
The PowerShell installer checks pnpm and Git and uses the `web` profile by default:
|
|
43
43
|
|
|
44
44
|
```powershell
|
|
45
|
-
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.
|
|
45
|
+
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.74/install.ps1 | iex
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
Install a pinned Git tag:
|
|
49
49
|
|
|
50
50
|
```sh
|
|
51
|
-
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.
|
|
51
|
+
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.74
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
See [installation and updates](docs/install.en.md) for uninstalling or installing without Git.
|
|
55
55
|
|
|
56
56
|
</details>
|
|
57
57
|
|
|
58
|
-
Current release **v1.9.
|
|
58
|
+
Current release **v1.9.74**: [release notes](docs/update-notes-1.9.74.md#english) · [troubleshooting](docs/install-troubleshooting.md)
|
|
59
59
|
|
|
60
60
|
## Feature overview
|
|
61
61
|
|
package/README.zh-CN.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<p align="center">DeepSeek Harness 费用统计与订阅额度插件</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<a href="https://github.com/Han-1413141/dsh-cost-meter/releases/latest"><img src="https://img.shields.io/badge/version-1.9.
|
|
6
|
+
<a href="https://github.com/Han-1413141/dsh-cost-meter/releases/latest"><img src="https://img.shields.io/badge/version-1.9.74-4176E6?style=flat-square" alt="version"></a>
|
|
7
7
|
<a href="https://www.npmjs.com/package/dsh-cost-meter"><img src="https://img.shields.io/npm/dm/dsh-cost-meter?label=downloads&style=flat-square&color=4176E6" alt="npm monthly downloads"></a>
|
|
8
8
|
<a href="https://github.com/Han-1413141/dsh-cost-meter/stargazers"><img src="https://img.shields.io/github/stars/Han-1413141/dsh-cost-meter?label=stars&style=flat-square&color=D9A400" alt="GitHub stars"></a>
|
|
9
9
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="MIT license"></a>
|
|
@@ -42,20 +42,20 @@ dsh plugin --profile web add dsh-cost-meter
|
|
|
42
42
|
PowerShell 脚本自动检查 pnpm 和 Git,默认安装到 `web` Profile:
|
|
43
43
|
|
|
44
44
|
```powershell
|
|
45
|
-
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.
|
|
45
|
+
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.74/install.ps1 | iex
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
固定 Git tag 安装:
|
|
49
49
|
|
|
50
50
|
```sh
|
|
51
|
-
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.
|
|
51
|
+
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.74
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
更新、卸载及无 Git 的安装方法见[安装说明](docs/install.md)。
|
|
55
55
|
|
|
56
56
|
</details>
|
|
57
57
|
|
|
58
|
-
当前版本 **v1.9.
|
|
58
|
+
当前版本 **v1.9.74**:[更新说明](docs/update-notes-1.9.74.md#中文) · [安装排障](docs/install-troubleshooting.md)
|
|
59
59
|
|
|
60
60
|
## 功能总览
|
|
61
61
|
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
[简体中文](custom-balance-sources.md) · [Features](features.en.md)
|
|
4
4
|
|
|
5
|
+
## OpenAI API credits
|
|
6
|
+
|
|
7
|
+
In Settings → Cost → Quotas, choose Add OpenAI API credits. Enter the grant amount, start date and expiration date in UTC from [Credit grants](https://platform.openai.com/settings/organization/billing/credit-grants) for the linked API organization. Save its Admin API key and enable the card. DSH keeps the key in its credential store. You can also set `DSH_OPENAI_COST_ADMIN_KEY` on the server.
|
|
8
|
+
|
|
9
|
+
The card estimates the grant remaining from organization costs in the period using the [OpenAI Costs API](https://developers.openai.com/api/reference/resources/admin/subresources/organization/subresources/usage/methods/costs). Quota settings and the sidebar tooltip show the grant amount, organization costs, estimated remainder and expiration. Overlapping grants, different credit eligibility and reporting delays can affect the estimate. Use Credit grants for the official balance.
|
|
10
|
+
|
|
5
11
|
## Request and response configuration
|
|
6
12
|
|
|
7
13
|
**POST with a JSON body:** in **Settings → Cost → Quota**, expand a custom balance entry, select **POST**, then fill in **Request body (JSON)**. For example, if the endpoint expects an account and returns `{"data":{"balance":12.5}}`:
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
[English](custom-balance-sources.en.md) · [功能与截图](features.md)
|
|
4
4
|
|
|
5
|
+
## OpenAI API 赠送额度
|
|
6
|
+
|
|
7
|
+
在「设置 → 费用 → 额度」选择「添加 OpenAI API 赠送额度」。填写绑定的 API 组织在 [Credit grants](https://platform.openai.com/settings/organization/billing/credit-grants) 显示的赠送金额、生效日期及到期日期(UTC),然后保存该组织的 Admin API Key 并开启查询。密钥通过 DSH 凭据库保存,也可在服务端设置 `DSH_OPENAI_COST_ADMIN_KEY`。
|
|
8
|
+
|
|
9
|
+
插件按 [OpenAI Costs API](https://developers.openai.com/api/reference/resources/admin/subresources/organization/subresources/usage/methods/costs) 返回的该组织期间费用计算预估余额。在额度页可看总额、组织费用、预估剩余和到期日,侧栏悬停可看明细。多个赠送额度叠加、不同费用的抵扣规则或统计延迟会影响预估,以官方 Credit grants 为准。
|
|
10
|
+
|
|
5
11
|
## 请求与响应配置
|
|
6
12
|
|
|
7
13
|
**POST 携带 JSON 请求体:**进入**设置 → 费用 → 额度**,展开自定义余额,选择 **POST**,在**请求体 (JSON)** 中填写接口要求的内容。例如接口需要账号参数,并返回 `{"data":{"balance":12.5}}`:
|
|
@@ -112,3 +112,7 @@ SHA-512 校验、静态契约检查和实际发布包回归通过:原生及代
|
|
|
112
112
|
### 2026-11-18:Codex Subscription 3.2.21
|
|
113
113
|
|
|
114
114
|
官方发布包 SHA-512 校验通过,四个额度接入函数语法指纹及静态契约未变。实际发布包的额度解析、单周和双窗口、默认缓存、强制刷新、账号切换、共享请求取消、登录失效及只读 HTTP/RPC 检查通过;测试仅使用合成数据与本机服务,外部账户及模型请求为 0。兼容基线更新至 `3.2.21`,两个既有宿主的 CI 矩阵均保留旧版本并加入 `3.2.21`。
|
|
115
|
+
|
|
116
|
+
### 2026-11-18:Codex Subscription 3.2.24
|
|
117
|
+
|
|
118
|
+
[#531](https://github.com/Han-1413141/dsh-cost-meter/issues/531) 报告 `3.2.23`,核对时 npm 最新版为 `3.2.24`。两个发布包均通过额度解析、缓存、账号切换、授权失败恢复和宿主 RPC 回归。新版 `createSubscriptionRpcHandler` 的语法指纹有变化,静态契约检查通过。兼容基线和 CI 更新至 `3.2.24`。
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# v1.9.74
|
|
2
|
+
|
|
3
|
+
## 中文
|
|
4
|
+
|
|
5
|
+
- 更新 GitHub 首页的微信群二维码,欢迎加入插件交流 5 群。
|
|
6
|
+
- DeepSeek 余额直接读取官方数据。余额进度条缺少预算上限时仅显示金额;自定义余额可以用服务返回的上限绘制进度条。
|
|
7
|
+
- 自定义价格可以复制已有渠道和模型的币种、各项单价、倍率、峰谷规则及长上下文档位。可在保存前编辑复制结果。
|
|
8
|
+
- 显示设置将侧栏全局选项与组件选项分开。关闭示例数据时按实际配置渲染预览。会话费用明细支持点击弹窗外部关闭,并调整了按钮、提示和内容间距。
|
|
9
|
+
- 额度页可添加 OpenAI API 赠送额度。根据手填的赠送金额和有效期,以及 OpenAI 官方返回的组织 API 费用,显示预估剩余、总额、组织费用和到期日。
|
|
10
|
+
- 验证 `dsh-codex-subscription` 3.2.23 和 3.2.24,兼容基线更新到 3.2.24。
|
|
11
|
+
|
|
12
|
+
感谢 [@cinast](https://github.com/cinast) 在 [#529](https://github.com/Han-1413141/dsh-cost-meter/issues/529) 提供显示设置和会话费用明细的截图与交互建议。[@PersueFree](https://github.com/PersueFree) 在 [#530](https://github.com/Han-1413141/dsh-cost-meter/issues/530) 提出自定义价格模板,在 [#532](https://github.com/Han-1413141/dsh-cost-meter/issues/532) 复现余额满格并定位上限缺失,并[提醒更新群二维码](https://github.com/Han-1413141/dsh-cost-meter/issues/530#issuecomment-6971033997)。感谢 [@Solismuchengxue](https://github.com/Solismuchengxue) 在 [#533](https://github.com/Han-1413141/dsh-cost-meter/issues/533) 提出 OpenAI API 赠送额度显示需求,以及 [GitHub Actions](https://github.com/apps/github-actions) 在 [#531](https://github.com/Han-1413141/dsh-cost-meter/issues/531) 报告上游版本变化。
|
|
13
|
+
|
|
14
|
+
## English
|
|
15
|
+
|
|
16
|
+
- Update the repository README with the WeChat group 5 QR code.
|
|
17
|
+
- Use the official DeepSeek wallet balance. Show the balance amount without a progress bar when a budget cap is unavailable. Custom balance sources can use a cap supplied by their API.
|
|
18
|
+
- Copy currency, rates, multipliers, peak and off-peak settings, and long-context tiers from an existing custom model price into an editable draft.
|
|
19
|
+
- Group sidebar-wide settings apart from component options. With sample data disabled, the preview follows the active display settings. Click outside the session cost dialog to dismiss it.
|
|
20
|
+
- Add an OpenAI API credit estimate to Quotas and the sidebar. Enter the grant amount and dates, and use official organization API costs to estimate remaining credits.
|
|
21
|
+
- Verify `dsh-codex-subscription` 3.2.23 and 3.2.24, and update the compatibility baseline to 3.2.24.
|
|
22
|
+
|
|
23
|
+
Thanks to [@cinast](https://github.com/cinast) for the settings and dialog feedback ([#529](https://github.com/Han-1413141/dsh-cost-meter/issues/529)), [@PersueFree](https://github.com/PersueFree) for the price template proposal ([#530](https://github.com/Han-1413141/dsh-cost-meter/issues/530)), the balance progress reproduction and diagnosis ([#532](https://github.com/Han-1413141/dsh-cost-meter/issues/532)), and the [WeChat group report](https://github.com/Han-1413141/dsh-cost-meter/issues/530#issuecomment-6971033997), and [@Solismuchengxue](https://github.com/Solismuchengxue) for the OpenAI API credit request ([#533](https://github.com/Han-1413141/dsh-cost-meter/issues/533)). [GitHub Actions](https://github.com/apps/github-actions) reported the upstream version change in [#531](https://github.com/Han-1413141/dsh-cost-meter/issues/531).
|
|
24
|
+
|
|
25
|
+
## 升级 / Upgrade
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
dsh plugin --profile web add dsh-cost-meter@latest
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
更新后请完全退出并重启 DSH。Desktop 用户参见 [安装与更新](https://github.com/Han-1413141/dsh-cost-meter/blob/v1.9.74/docs/install-troubleshooting.md#desktop-安装与更新)。
|