dsh-cost-meter 1.9.69 → 1.9.70
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/update-notes-1.9.70.md +29 -0
- package/lib/billing-history.js +2 -0
- package/lib/client.js +9 -9
- package/lib/coding-plans.js +4 -6
- package/lib/ledger-writer-worker.js +1 -1
- package/lib/legacy-price-matching.js +398 -0
- package/lib/plan-billing.js +55 -30
- package/lib/plan-provider-aliases.js +32 -0
- package/lib/pricing.js +116 -79
- package/package.json +3 -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.70-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.70/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.70
|
|
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.70**: [release notes](docs/update-notes-1.9.70.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.70-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.70/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.70
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
更新、卸载及无 Git 的安装方法见[安装说明](docs/install.md)。
|
|
55
55
|
|
|
56
56
|
</details>
|
|
57
57
|
|
|
58
|
-
当前版本 **v1.9.
|
|
58
|
+
当前版本 **v1.9.70**:[更新说明](docs/update-notes-1.9.70.md#中文) · [安装排障](docs/install-troubleshooting.md)
|
|
59
59
|
|
|
60
60
|
## 功能总览
|
|
61
61
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# v1.9.70
|
|
2
|
+
|
|
3
|
+
## 中文
|
|
4
|
+
|
|
5
|
+
- 修复 OpenAI 兼容入口和第三方渠道的 DeepSeek 价格匹配,支持工作站、套餐别名、`deepseek-ai` 命名空间及 Magpie 多层账号路由。
|
|
6
|
+
- 优先使用手动映射和渠道自有价格,完整型号优先于格式别名及日期标签,保留 Mistral 等渠道的独立转售价。
|
|
7
|
+
- 区分 Flash/Pro、版本、上下文规格、免费及本地来源。缺少价格或存在歧义时显示未定价。
|
|
8
|
+
- 工作站转发后保留 API/套餐归属。免费插件经过转发后沿用“按免费计算”设置。
|
|
9
|
+
- 旧账单保留原计价规则,可使用历史重算按新规则更新。
|
|
10
|
+
|
|
11
|
+
感谢 [@pyk136874470692022](https://github.com/pyk136874470692022) 在 [#499](https://github.com/Han-1413141/dsh-cost-meter/issues/499) 报告第三方 API 调用费用为零并提供截图,促成本次排查。
|
|
12
|
+
|
|
13
|
+
## English
|
|
14
|
+
|
|
15
|
+
- Fix DeepSeek price matching through compatible APIs, workstations, plan aliases, the `deepseek-ai` namespace and nested Magpie account routes.
|
|
16
|
+
- Prioritize manual assignments, provider-specific prices and full model IDs, preserving independent reseller rates such as Mistral's.
|
|
17
|
+
- Distinguish Flash/Pro, versions, context sizes and free/local sources. Missing or ambiguous quotes remain unpriced.
|
|
18
|
+
- Preserve API/subscription attribution and the free-model setting through forwarding routes.
|
|
19
|
+
- Keep historical matching rules in saved price versions. Explicit history recalculation can apply the new rules.
|
|
20
|
+
|
|
21
|
+
Thanks to [@pyk136874470692022](https://github.com/pyk136874470692022) for the third-party API zero-cost report and screenshots in [#499](https://github.com/Han-1413141/dsh-cost-meter/issues/499).
|
|
22
|
+
|
|
23
|
+
## 升级 / Upgrade
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
dsh plugin --profile web add dsh-cost-meter@latest
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
更新后重启 DSH。Desktop 用户参见 [安装与更新](https://github.com/Han-1413141/dsh-cost-meter/blob/v1.9.70/docs/install-troubleshooting.md#desktop-安装与更新)。
|
package/lib/billing-history.js
CHANGED
|
@@ -56,6 +56,7 @@ export function pricingSnapshot(config, stored = false, memo) {
|
|
|
56
56
|
const prices = config?.prices ?? {}
|
|
57
57
|
snapshot.prices = { ...(prices.currency ? { currency: prices.currency } : {}), ollamaPeak: !stored || prices.ollamaPeak === true, ollamaTaggedPeak: !stored || prices.ollamaTaggedPeak === true, snapshotTags: !stored || prices.snapshotTags === true,
|
|
58
58
|
shortSnapshotTags: !stored || prices.shortSnapshotTags === true, volcenginePeak: !stored || prices.volcenginePeak === true,
|
|
59
|
+
legacyModelMatching: stored && prices.legacyModelMatching !== false,
|
|
59
60
|
default: ratesOnly(prices.default, memo), models: modelsOnly(prices.models, memo),
|
|
60
61
|
...(prices.custom ? { custom: modelsOnly(prices.custom, memo) } : {}),
|
|
61
62
|
providers: Object.fromEntries(Object.entries(prices.providers ?? {}).filter(([key]) => safe(key)).map(([key, table]) => [key, memoized(table, memo?.providers, () => ({
|
|
@@ -92,6 +93,7 @@ export function normalizePricingHistory(raw, config, previous, stored = false) {
|
|
|
92
93
|
for (const policy of ['ollamaPeak', 'ollamaTaggedPeak', 'snapshotTags', 'shortSnapshotTags', 'volcenginePeak']) {
|
|
93
94
|
if (saved.length) prices[policy] = saved.every(version => version.prices?.[policy] === true)
|
|
94
95
|
}
|
|
96
|
+
if (saved.length) prices.legacyModelMatching = saved.every(version => version.prices?.legacyModelMatching === true)
|
|
95
97
|
const seed = createPricingHistory({ ...config, prices }, stored)
|
|
96
98
|
for (const [id, pricing] of Object.entries(seed.versions)) rememberPriceVersion(versions, id, pricing)
|
|
97
99
|
changes[randomUUID()] = seed.changes.initial
|