dsh-cost-meter 1.9.75 → 1.9.76
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/plugin-compatibility-watch.md +4 -0
- package/lib/coding-plans.js +4 -1
- package/lib/index.js +8 -1
- package/lib/typert.host.js +2 -2
- package/package.json +2 -2
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.76-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.76/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.76
|
|
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.76**: [release notes](docs/release-notes/v1.9.76.md) · [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.76-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.76/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.76
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
更新、卸载及无 Git 的安装方法见[安装说明](docs/install.md)。
|
|
55
55
|
|
|
56
56
|
</details>
|
|
57
57
|
|
|
58
|
-
当前版本 **v1.9.
|
|
58
|
+
当前版本 **v1.9.76**:[更新说明](docs/release-notes/v1.9.76.md) · [安装排障](docs/install-troubleshooting.md)
|
|
59
59
|
|
|
60
60
|
## 功能总览
|
|
61
61
|
|
|
@@ -116,3 +116,7 @@ SHA-512 校验、静态契约检查和实际发布包回归通过:原生及代
|
|
|
116
116
|
### 2026-11-18:Codex Subscription 3.2.24
|
|
117
117
|
|
|
118
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`。
|
|
119
|
+
|
|
120
|
+
### 2026-11-19:Codex Subscription 3.2.25
|
|
121
|
+
|
|
122
|
+
[#539](https://github.com/Han-1413141/dsh-cost-meter/issues/539) 报告 `3.2.25` 发布。npm 发布包 SHA-512 与登记值一致,四个额度接口函数的指纹与 `3.2.24` 一致。使用发布包在 DSH `0.2.0-rc.2` 和 `0.2.2-alpha.3` 上验证了两种额度窗口、强制刷新、账号切换、授权失效恢复和宿主 RPC。回归使用本机测试数据,兼容基线和两个 CI 矩阵均已加入 `3.2.25`。
|
package/lib/coding-plans.js
CHANGED
|
@@ -1595,8 +1595,11 @@ export async function queryCodingPlan(provider, key, locale, t, { baseUrl, orgId
|
|
|
1595
1595
|
const parse = isKimiCoding ? parseKimiCodingUsage : CODING_PLAN_PARSERS[provider]
|
|
1596
1596
|
let response
|
|
1597
1597
|
try {
|
|
1598
|
+
// Z.ai's official usage plugin sends the configured token as-is to quota/limit.
|
|
1599
|
+
// The older billing endpoints retain their Bearer authentication.
|
|
1600
|
+
const zaiMonitor = provider === 'zai' && url.endsWith('/api/monitor/usage/quota/limit')
|
|
1598
1601
|
const headers = {
|
|
1599
|
-
authorization: `Bearer ${key.trim()}`,
|
|
1602
|
+
authorization: zaiMonitor ? key.trim() : `Bearer ${key.trim()}`,
|
|
1600
1603
|
'user-agent': 'dsh-cost-meter/1.4 (DeepSeek Harness plugin)',
|
|
1601
1604
|
}
|
|
1602
1605
|
if (isKimiCoding) {
|
package/lib/index.js
CHANGED
|
@@ -1818,6 +1818,10 @@ function createService(ctx, ledger, openRouterPrices, openDesignPrices, codexSub
|
|
|
1818
1818
|
if (String(ref).startsWith('DSH_COST_METER_ACCOUNT_BALANCE_') || ref === 'DEEPSEEK_BALANCE_API_KEY') balanceAccounts.reset()
|
|
1819
1819
|
const selected = queryAccountTarget(ledger.config, 'balance', secretRefOf)
|
|
1820
1820
|
if (ref === selected?.ref || usesModelBalanceRoute() && ref === balanceRoute.apiKeyEnv) invalidateAccountBalance()
|
|
1821
|
+
const zai = queryAccountTarget(ledger.config, 'codingPlans.zai', secretRefOf)
|
|
1822
|
+
if (ref === zai?.ref || zai?.id === 'default' && CODING_PLAN_PROVIDERS.zai.credentialEnvs.includes(ref)) {
|
|
1823
|
+
resetQueryCache('codingPlans.zai')
|
|
1824
|
+
}
|
|
1821
1825
|
})
|
|
1822
1826
|
ctx.on('settings/document-updated', ns => {
|
|
1823
1827
|
if (ns === balanceRoute.settingsNs || ns === 'llm-deepseek' || ns === 'llm-deepseek-api-key') syncBalanceModelRoute(true)
|
|
@@ -3084,7 +3088,10 @@ function createService(ctx, ledger, openRouterPrices, openDesignPrices, codexSub
|
|
|
3084
3088
|
invalidateCustomBalanceCachesForVar(customVar)
|
|
3085
3089
|
for (const source of gatewaySourceConfigs()) if (managementKeyVarOf(source) === customVar) { gatewayQuotaCaches[source.id]?.controller?.abort(); delete gatewayQuotaCaches[source.id] }
|
|
3086
3090
|
}
|
|
3087
|
-
else if (account.id === selectedQueryAccount(ledger.config, account.source))
|
|
3091
|
+
else if (account.id === selectedQueryAccount(ledger.config, account.source)) {
|
|
3092
|
+
resetQueryCache(account.source, { keepLogin: account.source === 'codingPlans.opendesign' })
|
|
3093
|
+
if (account.source === 'codingPlans.zai') void ensureCodingPlan('zai').catch(() => {})
|
|
3094
|
+
}
|
|
3088
3095
|
if (account?.source === 'balance') balanceAccounts.reset()
|
|
3089
3096
|
if (account?.source === 'balance' && account.id === selectedQueryAccount(ledger.config, 'balance')) {
|
|
3090
3097
|
ledger.balanceRef = null
|
package/lib/typert.host.js
CHANGED
|
@@ -483,7 +483,7 @@ const configSchema = z.object({
|
|
|
483
483
|
const balanceSchema = z.object({
|
|
484
484
|
keyConfigured: z.boolean().optional(),
|
|
485
485
|
keySource: z.string().optional(),
|
|
486
|
-
status: z.enum(['off', '
|
|
486
|
+
status: z.enum(['off', 'ok', 'error']),
|
|
487
487
|
message: z.string(),
|
|
488
488
|
fetchedAt: num,
|
|
489
489
|
currency: z.string(),
|
|
@@ -575,7 +575,7 @@ const codingPlanSchema = z.object({
|
|
|
575
575
|
// 密钥配置状态(v1.6.8):是否已在凭据库中配置,以及来自哪一层(env / file / legacy)。
|
|
576
576
|
keyConfigured: z.boolean().optional(),
|
|
577
577
|
keySource: z.string().optional(),
|
|
578
|
-
status: z.enum(['off', 'ok', 'error']),
|
|
578
|
+
status: z.enum(['off', 'loading', 'ok', 'error']),
|
|
579
579
|
message: z.string(),
|
|
580
580
|
fetchedAt: num,
|
|
581
581
|
windows: z.record(z.string(), z.object({ percent: num.optional(), resetsAt: z.string(), text: z.string().optional(), unlimited: z.boolean().optional() })),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-cost-meter",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.76",
|
|
4
4
|
"description": "DeepSeek Harness 会话费用统计插件:本会话成本、当日费用、历史记录与官方价格同步,支持多厂商多模型价格计费(内置 170+ 模型 ID 价格目录与自动匹配)、主流 Coding Plan 订阅额度查询与显示(16 家,含 WorkBuddy 官方积分、OpenDesign 工作区查询、含小米 MiMo Token Plan 控制台 Cookie 查询、SCNet Token Plan 本地 Credits 计量与火山方舟 Volcano Ark Coding Plan AK/SK 签名查询)、自定义 Provider 余额查询(可配任意 HTTP 端点)与余额进度条、峰谷计价时段显示与切换前弹窗/系统通知提醒(位置/提前量/类型可配),界面中英双语。Session cost tracking plugin for DeepSeek Harness: per-conversation cost, daily totals, history and official price sync, with multi-vendor model pricing (built-in 170+ model-ID catalog with auto-matching), Coding Plan quota queries & display for 16 vendors (incl. WorkBuddy official credits, OpenDesign workspace queries, Xiaomi MiMo Token Plan via console cookie, local credits metering for the SCNet Token Plan and Volcano Ark Coding Plan via AK/SK signature), plan/API dual-track billing with per-1% & full-window Token Plan usage estimates, custom provider balance lookup (configurable HTTP endpoint) and balance progress bar, plus peak/off-peak pricing display with pre-switch popup & system-notification alerts (position / lead time / type configurable), in a bilingual (Chinese/English) UI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/bootstrap.js",
|
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
"docs/update-notes-1.9.70.md",
|
|
245
245
|
"docs/update-notes-1.9.71.md",
|
|
246
246
|
"docs/update-notes-1.9.72.md",
|
|
247
|
-
"docs/update-notes-1.9.
|
|
247
|
+
"docs/update-notes-1.9.76.md"
|
|
248
248
|
],
|
|
249
249
|
"dependencies": {
|
|
250
250
|
"acorn": "8.15.0",
|