dsh-cost-meter 1.9.51 → 1.9.52
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 +10 -10
- package/README.zh-CN.md +10 -10
- package/docs/dsh-0.2.1-compatibility.md +2 -0
- package/docs/dsh-0.2.2-compatibility.md +31 -0
- package/docs/update-notes-1.9.52.md +19 -0
- package/lib/native-search-billing.js +8 -1
- package/package.json +7 -4
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.52** adapts to DSH 0.2.2-alpha.3, fixes missing native-search usage for isolated Web services on the updated Cordis runtime, and extends the host peer ranges.
|
|
20
20
|
|
|
21
|
-
**Host floor: DSH 0.2.0** · Adaptation target: **0.2.
|
|
21
|
+
**Host floor: DSH 0.2.0** · Adaptation target: **0.2.2-alpha.3**. Expand the compatibility notes below for exact declarations, host records and troubleshooting.
|
|
22
22
|
|
|
23
|
-
Release notes: [v1.9.
|
|
23
|
+
Release notes: [v1.9.52](docs/update-notes-1.9.52.md#english). Fully restart DSH after updating.
|
|
24
24
|
|
|
25
25
|

|
|
26
26
|
|
|
@@ -34,7 +34,7 @@ Per-conversation cost · daily totals · OpenCode Go subscription quota display
|
|
|
34
34
|
<details>
|
|
35
35
|
<summary>Compatibility, configuration and troubleshooting</summary>
|
|
36
36
|
|
|
37
|
-
**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
|
|
37
|
+
**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 **0.2.2-alpha.3**. Exact ranges and how the host reads them: [compatibility declaration](docs/dsh-0.2.2-compatibility.md#english).
|
|
38
38
|
|
|
39
39
|
Supports [official Search/Fetch request fees](docs/web-request-fees.md#english), separately from model tokens.
|
|
40
40
|
|
|
@@ -356,22 +356,22 @@ On Node.js 20, use `npm install -g pnpm@10` instead. See [pnpm installation and
|
|
|
356
356
|
dsh plugin --profile web add dsh-cost-meter
|
|
357
357
|
```
|
|
358
358
|
|
|
359
|
-
**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.
|
|
359
|
+
**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.52`** — review the script before running):
|
|
360
360
|
|
|
361
361
|
```powershell
|
|
362
|
-
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.
|
|
362
|
+
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.52/install.ps1 | iex
|
|
363
363
|
```
|
|
364
364
|
|
|
365
365
|
**Or a plain command line** (the machine must already have pnpm and git; also pinned to the tag):
|
|
366
366
|
|
|
367
367
|
```sh
|
|
368
|
-
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.
|
|
368
|
+
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.52
|
|
369
369
|
```
|
|
370
370
|
|
|
371
371
|
Without git, use the GitHub tag archive:
|
|
372
372
|
|
|
373
373
|
```sh
|
|
374
|
-
dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.9.
|
|
374
|
+
dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.9.52.tar.gz
|
|
375
375
|
```
|
|
376
376
|
|
|
377
377
|
After installing, **restart** `dsh web` (plugin rows, the Typert manifest and the client bundle are all scanned at startup):
|
|
@@ -436,7 +436,7 @@ Workarounds:
|
|
|
436
436
|
|
|
437
437
|
```yaml
|
|
438
438
|
minimumReleaseAgeExclude:
|
|
439
|
-
- dsh-cost-meter@1.9.
|
|
439
|
+
- dsh-cost-meter@1.9.52
|
|
440
440
|
```
|
|
441
441
|
|
|
442
442
|
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.52** 适配 DSH 0.2.2-alpha.3,修复新 Cordis 下隔离 Web 服务的原生搜索漏计,并补齐宿主依赖范围。
|
|
20
20
|
|
|
21
|
-
**宿主要求:DSH 0.2.0 起支持** · 适配目标 **0.2.
|
|
21
|
+
**宿主要求:DSH 0.2.0 起支持** · 适配目标 **0.2.2-alpha.3**。完整声明、历史记录与安装排障见下方展开项。
|
|
22
22
|
|
|
23
|
-
更新说明:[v1.9.
|
|
23
|
+
更新说明:[v1.9.52](docs/update-notes-1.9.52.md#中文)。更新后完全重启 DSH。
|
|
24
24
|
|
|
25
25
|

|
|
26
26
|
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
<details>
|
|
35
35
|
<summary>兼容、配置与排障说明</summary>
|
|
36
36
|
|
|
37
|
-
**最低支持宿主:DSH 0.2.0。** 插件把下限声明在 `engines.dsh`(宿主准入插件的闸门),不再支持任何 DSH 0.1.x 版本;本轮适配目标为
|
|
37
|
+
**最低支持宿主:DSH 0.2.0。** 插件把下限声明在 `engines.dsh`(宿主准入插件的闸门),不再支持任何 DSH 0.1.x 版本;本轮适配目标为 **0.2.2-alpha.3**。具体范围与宿主的读取方式见[兼容声明](docs/dsh-0.2.2-compatibility.md#中文)。
|
|
38
38
|
|
|
39
39
|
新增 [DeepSeek Search/Fetch API 次数费](docs/web-request-fees.md#中文),只计有结果的成功请求,并将网页抓取独立分类。
|
|
40
40
|
|
|
@@ -356,22 +356,22 @@ Node.js 20 请改用 `npm install -g pnpm@10`。版本要求见 [pnpm 官方安
|
|
|
356
356
|
dsh plugin --profile web add dsh-cost-meter
|
|
357
357
|
```
|
|
358
358
|
|
|
359
|
-
**PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.9.
|
|
359
|
+
**PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.9.52`**,建议先下载审阅再运行):
|
|
360
360
|
|
|
361
361
|
```powershell
|
|
362
|
-
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.
|
|
362
|
+
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.52/install.ps1 | iex
|
|
363
363
|
```
|
|
364
364
|
|
|
365
365
|
**或直接命令行**(机器上需已有 pnpm 与 git;同样固定到 tag):
|
|
366
366
|
|
|
367
367
|
```sh
|
|
368
|
-
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.
|
|
368
|
+
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.52
|
|
369
369
|
```
|
|
370
370
|
|
|
371
371
|
没有 git 时可用 GitHub tag 打包直链:
|
|
372
372
|
|
|
373
373
|
```sh
|
|
374
|
-
dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.9.
|
|
374
|
+
dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.9.52.tar.gz
|
|
375
375
|
```
|
|
376
376
|
|
|
377
377
|
安装后**重启** `dsh web`(插件行、Typert 清单与客户端 bundle 均在启动时扫描):
|
|
@@ -436,7 +436,7 @@ DSH **0.2.1-rc.1 / 0.2.1-rc.2** 宿主自带 pnpm **11.28.5**,默认启用内
|
|
|
436
436
|
|
|
437
437
|
```yaml
|
|
438
438
|
minimumReleaseAgeExclude:
|
|
439
|
-
- dsh-cost-meter@1.9.
|
|
439
|
+
- dsh-cost-meter@1.9.52
|
|
440
440
|
```
|
|
441
441
|
|
|
442
442
|
3. 仅本次操作用 CLI 透传 pnpm 参数:`dsh plugin --profile desktop remove dsh-cost-meter --config.minimum-release-age=0`;若只是 lockfile 校验阶段失败,可改用 `--trust-lockfile`。这两个参数已在本机 pnpm 11.28.5 临时 Profile 上实测可用。
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# DSH 兼容性:最低 0.2.0(目标 0.2.1-rc.2)
|
|
2
2
|
|
|
3
|
+
> 本文保留 0.2.1 历史验证。当前目标、依赖范围和 Cordis 调整见 [DSH 0.2.2-alpha.3 兼容说明](dsh-0.2.2-compatibility.md)。
|
|
4
|
+
|
|
3
5
|
## 中文
|
|
4
6
|
|
|
5
7
|
本轮把插件的最低兼容要求从 DSH `0.1.x` 提升到 **0.2.0**,适配目标为 npm `next` 标签的 **0.2.1-rc.2**(上一轮目标 `0.2.1-rc.1` 同样在真实宿主上验证过)。日常计费、价格、历史金额与界面布局不变。
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# DSH 0.2.2-alpha.3 兼容性
|
|
2
|
+
|
|
3
|
+
## 中文
|
|
4
|
+
|
|
5
|
+
适配目标为官方 [dsh-v0.2.2-alpha.3](https://github.com/deepseek-ai/deepseek-harness/releases/tag/dsh-v0.2.2-alpha.3),插件版本为 1.9.52。实际安装的 npm 依赖是 `@deepseek-ai/cordis@4.0.6-alpha.2`、`cordis-plugin-loader@1.0.7-alpha.2` 和 `cordis-plugin-include@1.0.11-alpha.2`;这些是 DeepSeek 发布的包版本,与发布说明中列出的上游 Cordis 基线版本不同。
|
|
6
|
+
|
|
7
|
+
### 需要调整的部分
|
|
8
|
+
|
|
9
|
+
- **原生搜索计费**:新 Cordis 把服务提供记录从 `fiber.store` 分离到 `fiber.provisions`。旧实现无法发现比费用插件更早加载的隔离 Web 服务,搜索请求因此漏计。现在读取新提供记录,并把清理操作绑定到服务提供者;旧宿主继续使用原接口。已覆盖先后加载、隔离会话、依赖插件卸载、服务重载和费用插件卸载。
|
|
10
|
+
- **宿主依赖范围**:两个 DSH peer 增加 `>=0.2.2-0 <0.3.0-0` 分支。宿主的 `includePrerelease` 判定原本已接受 alpha.3,但 npm 默认语义会拒绝旧范围中的 0.2.2 预发布版。修复后可复用当前宿主模块。
|
|
11
|
+
- **持续兼容检查**:next-host 固定到 alpha.3,客户端加载器矩阵加入 alpha.3;隔离计费测试明确加载目标宿主的 Cordis。Web 工具测试使用新版原生执行器、工具可用性选择和批量调用,保留旧宿主的单调用路径。
|
|
12
|
+
|
|
13
|
+
`engines.dsh`、商城范围和最低版本继续为 `>=0.2.0-rc.1 <0.3.0-0`。没有改动定价、峰谷规则、凭据保存格式或已有历史金额。
|
|
14
|
+
|
|
15
|
+
### 已验证
|
|
16
|
+
|
|
17
|
+
- Windows / Node.js 24:真实 alpha.3 准入、打包安装、Web 启动、两个宿主 peer 文件复用、三次合成调用和 SCNet 快照读取。
|
|
18
|
+
- 新 Cordis 的冷启动、热加载、延迟 RPC 注册、卸载重载、凭据保存/清除/刷新,以及主会话、隔离子会话和后台调用计费。
|
|
19
|
+
- 真实原生搜索与 Web Fetch 工具:本地 HTTP 响应、成功请求计费、空响应/失败不计费、历史记录和卸载清理;原生搜索同时在 0.2.1-rc.2 下通过。
|
|
20
|
+
- alpha.3 的客户端模块加载器:HTTPS 与 `dsh-app://`,主入口和 13 个分块,原生及 dsh-loader 1.3.5 前后加载组合。
|
|
21
|
+
- 完整 `test/verify.mjs` 回归,以及真实 Session、TokenMeter 和投影注册器的上下文计费检查。
|
|
22
|
+
|
|
23
|
+
以上使用隔离 Profile 和合成用量,没有调用付费模型;未安装或验证完整 Windows/macOS Desktop 外壳。更新费用插件后完全重启 DSH 即可,不需要迁移账本或重新配置。
|
|
24
|
+
|
|
25
|
+
## English
|
|
26
|
+
|
|
27
|
+
Version 1.9.52 targets the official DSH 0.2.2-alpha.3 release. Its published dependency versions are Cordis 4.0.6-alpha.2, Loader 1.0.7-alpha.2 and Include 1.0.11-alpha.2.
|
|
28
|
+
|
|
29
|
+
The new Cordis service-provision records required a billing fix: isolated Web services mounted before the cost plugin were missed by the old `fiber.store` scan. The plugin now observes `fiber.provisions`, with cleanup owned by the provider, and retains the old-host path. Both host peer ranges explicitly accept 0.2.2 prereleases under npm's default semver rules.
|
|
30
|
+
|
|
31
|
+
The pinned host and client-loader CI coverage now include alpha.3. Local validation covers packed installation, Web startup, shared host modules, billing, RPC, credentials, lifecycle cleanup, real tool execution with local HTTP responses and the full regression suite. The minimum supported host and pricing rules stay unchanged. Full Electron Desktop shells and paid requests were not exercised. Update the plugin and fully restart DSH; no ledger migration is required.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# v1.9.52 — 适配 DSH 0.2.2-alpha.3
|
|
2
|
+
|
|
3
|
+
## 中文
|
|
4
|
+
|
|
5
|
+
- 修复新版 Cordis 下,先于费用插件加载的隔离 Web 服务原生搜索漏计;兼容旧宿主,并保留正确的卸载与重载清理。
|
|
6
|
+
- 补齐 0.2.2 预发布版宿主依赖范围,避免 npm 选择不匹配的宿主依赖。
|
|
7
|
+
- 持续检查加入 alpha.3 的真实安装启动、RPC、计费、工具执行和客户端模块加载。
|
|
8
|
+
|
|
9
|
+
更新插件后完全重启 DSH,无需修改已有设置或迁移账本。完整验证记录见 [0.2.2 兼容说明](dsh-0.2.2-compatibility.md)。
|
|
10
|
+
|
|
11
|
+
适配依据:[DeepSeek Harness 官方发布说明](https://github.com/deepseek-ai/deepseek-harness/releases/tag/dsh-v0.2.2-alpha.3)。
|
|
12
|
+
|
|
13
|
+
## English
|
|
14
|
+
|
|
15
|
+
- Fix missing native-search usage when isolated Web services mount before the cost plugin on the updated Cordis runtime; preserve old-host support and lifecycle cleanup.
|
|
16
|
+
- Extend host peer ranges to accept 0.2.2 prereleases under npm semantics.
|
|
17
|
+
- Pin alpha.3 coverage for installation, Web startup, RPC, billing, tool execution and client module loading.
|
|
18
|
+
|
|
19
|
+
Update the plugin and fully restart DSH. Existing settings and ledgers need no migration. See the [compatibility record](dsh-0.2.2-compatibility.md#english).
|
|
@@ -433,7 +433,14 @@ export function installNativeSearchBilling(ctx, ledger) {
|
|
|
433
433
|
if (name === 'web') observeWeb(service, this)
|
|
434
434
|
}, { global: true })
|
|
435
435
|
for (const runtime of ctx.registry?.values?.() ?? []) {
|
|
436
|
-
for (const fiber of runtime.fibers ?? [])
|
|
436
|
+
for (const fiber of runtime.fibers ?? []) {
|
|
437
|
+
// Cordis 4.0.6 separates provided services from committed injections.
|
|
438
|
+
// Scan the provider's own records so an unrelated dependent cannot own
|
|
439
|
+
// observation cleanup. Earlier hosts keep provisions in fiber.store.
|
|
440
|
+
if (fiber.provisions) {
|
|
441
|
+
for (const provision of fiber.provisions) if (provision.name === 'web') observeWeb(provision.value, provision.ctx)
|
|
442
|
+
} else observeWeb(fiber.store?.web?.value, fiber.ctx)
|
|
443
|
+
}
|
|
437
444
|
}
|
|
438
445
|
ctx.inject(['web'], (webCtx) => {
|
|
439
446
|
observeWeb(webCtx.web, webCtx)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-cost-meter",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.52",
|
|
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",
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"0.2.0-rc.2": "compatible",
|
|
36
36
|
"0.2.1-alpha.5": "compatible",
|
|
37
37
|
"0.2.1-rc.1": "compatible",
|
|
38
|
-
"0.2.1-rc.2": "compatible"
|
|
38
|
+
"0.2.1-rc.2": "compatible",
|
|
39
|
+
"0.2.2-alpha.3": "compatible"
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
},
|
|
@@ -148,6 +149,7 @@
|
|
|
148
149
|
"docs/model-history-repricing.md",
|
|
149
150
|
"docs/tokenrhythm-balance.md",
|
|
150
151
|
"docs/dsh-0.2.1-compatibility.md",
|
|
152
|
+
"docs/dsh-0.2.2-compatibility.md",
|
|
151
153
|
"docs/pnpm-supply-chain-policy.md",
|
|
152
154
|
"docs/update-notes-1.9.3.md",
|
|
153
155
|
"docs/update-notes-1.9.4.md",
|
|
@@ -202,6 +204,7 @@
|
|
|
202
204
|
"docs/billion-context-peer-discovery.md",
|
|
203
205
|
"docs/official-price-sync-safety.md",
|
|
204
206
|
"docs/update-notes-1.9.51.md",
|
|
207
|
+
"docs/update-notes-1.9.52.md",
|
|
205
208
|
"docs/billing-review-2026-11-02.md",
|
|
206
209
|
"docs/billing-currency.md",
|
|
207
210
|
"docs/native-search-billing.md"
|
|
@@ -211,8 +214,8 @@
|
|
|
211
214
|
"zod": "4.6.6"
|
|
212
215
|
},
|
|
213
216
|
"peerDependencies": {
|
|
214
|
-
"@deepseek-ai/dsh-credentials": ">=0.2.0-rc.1 <0.3.0-0 || >=0.2.1-0 <0.3.0-0",
|
|
215
|
-
"@deepseek-ai/dsh-home-paths": ">=0.2.0-rc.1 <0.3.0-0 || >=0.2.1-0 <0.3.0-0"
|
|
217
|
+
"@deepseek-ai/dsh-credentials": ">=0.2.0-rc.1 <0.3.0-0 || >=0.2.1-0 <0.3.0-0 || >=0.2.2-0 <0.3.0-0",
|
|
218
|
+
"@deepseek-ai/dsh-home-paths": ">=0.2.0-rc.1 <0.3.0-0 || >=0.2.1-0 <0.3.0-0 || >=0.2.2-0 <0.3.0-0"
|
|
216
219
|
},
|
|
217
220
|
"repository": {
|
|
218
221
|
"type": "git",
|