dsh-cost-meter 1.7.31 → 1.7.32
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 -6
- package/README.zh-CN.md +10 -6
- package/lib/client.js +5 -5
- package/lib/store.js +5 -0
- package/lib/typert.host.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
Per-conversation cost · daily totals · OpenCode Go subscription quota display · budget with usage percentage · official account balance · custom provider balance · balance progress bar · history · peak/off-peak pricing hours display (peak hours UTC 01:00–04:00, 06:00–10:00; from Aug 23, 2026 weekends are billed at off-peak prices all day, shown as “Weekend — all off-peak”) · pre-switch popup & system-notification alerts for peak/off-peak changes (position / lead time / alert type configurable) · one-click price sync from the official docs · Codex-style token usage heat grid · multi-vendor model pricing (built-in 90+ model price catalog with auto-matching) · mainstream Coding Plan quota queries & display (Anthropic / Z.ai / MiniMax / Kimi / OpenRouter / SiliconFlow / CommandCode / SCNet) plan/API dual-track billing (subscription quota vs pay-as-you-go money separated, per-1% & full-window token/equivalent-cost estimates with daily/weekly/monthly curves) · · quota strip above the input box (budget / Go / coding-plan usage in one row, toggleable)
|
|
10
10
|
|
|
11
|
-
[](https://github.com/Han-1413141/dsh-cost-meter)
|
|
12
12
|
|
|
13
|
-
**v1.7.
|
|
13
|
+
**v1.7.32** adds an optional, per-entry switch to convert custom USD balances into the display currency. Balances, spend and limits use the display rate and precision together; source data and progress percentages stay unchanged. See the [release notes](docs/release-notes/v1.7.32.md).
|
|
14
14
|
|
|
15
15
|
[](https://www.npmjs.com/package/dsh-cost-meter)
|
|
16
16
|
[](LICENSE)
|
|
@@ -63,6 +63,10 @@ Per-conversation cost · daily totals · OpenCode Go subscription quota display
|
|
|
63
63
|
|
|
64
64
|
## Custom provider balance example (NewApi template)
|
|
65
65
|
|
|
66
|
+
**Display currency conversion:** open **Settings → Cost → Quota**, expand a custom balance entry, and enable **Convert USD balance to display currency**. It defaults to off for each entry. Keep **Source currency** set to the endpoint's actual currency. With a USD balance of 54.3792, a CNY display rate of 7.2 and two decimal places, the balance displays as **¥391.53**. Spend and API/manual limits convert together in the sidebar, settings and tooltips; progress percentages and stored balances do not change. Enter a manual limit in the source currency. The setting persists as `convertToDisplayCurrency: true` inside that `customBalances[]` entry (legacy `customBalance` is also supported).
|
|
67
|
+
|
|
68
|
+
The global exchange rate converts **USD to the display currency**. CNY/EUR source balances and Credits keep their original units; the switch is disabled for them. Alibaba Cloud balances use the currency returned by its API. No exchange-rate lookup or extra balance request is made when toggling this setting. Turning it off restores the original currency immediately.
|
|
69
|
+
|
|
66
70
|
**DeepSeek CNY billing:** USD prices × the display exchange rate and the official CNY table can give different amounts. Settings → Cost → Prices now explains this and provides a CNY selection button. See [currency selection, sync and settlement timing](docs/billing-currency.md#english).
|
|
67
71
|
|
|
68
72
|
For Qianwen / Alibaba Cloud fund accounts, use **Add Qianwen / Alibaba Cloud balance** to query available funds with a RAM AccessKey signature. The card uses the currency returned by the API. See the [setup, permissions and balance definition](docs/qianwen-balance.md#english).
|
|
@@ -300,22 +304,22 @@ On Node.js 20, use `npm install -g pnpm@10` instead. See [pnpm installation and
|
|
|
300
304
|
dsh plugin --profile web add dsh-cost-meter
|
|
301
305
|
```
|
|
302
306
|
|
|
303
|
-
**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.7.
|
|
307
|
+
**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.7.32`** — review the script before running):
|
|
304
308
|
|
|
305
309
|
```powershell
|
|
306
|
-
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.7.
|
|
310
|
+
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.7.32/install.ps1 | iex
|
|
307
311
|
```
|
|
308
312
|
|
|
309
313
|
**Or a plain command line** (the machine must already have pnpm and git; also pinned to the tag):
|
|
310
314
|
|
|
311
315
|
```sh
|
|
312
|
-
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.7.
|
|
316
|
+
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.7.32
|
|
313
317
|
```
|
|
314
318
|
|
|
315
319
|
Without git, use the GitHub tag archive:
|
|
316
320
|
|
|
317
321
|
```sh
|
|
318
|
-
dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.7.
|
|
322
|
+
dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.7.32.tar.gz
|
|
319
323
|
```
|
|
320
324
|
|
|
321
325
|
After installing, **restart** `dsh web` (plugin rows, the Typert manifest and the client bundle are all scanned at startup):
|
package/README.zh-CN.md
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
本会话费用 · 当日费用 · OpenCode Go 订阅额度显示 · 预算与已用百分比 · 官方账户余额 · 自定义 Provider 余额查询(可配任意 HTTP 端点) · 余额三段进度条 · 历史记录 · 峰谷计价时段显示(UTC 01:00–04:00、06:00–10:00 为峰时段;2026-08-23 起周末全天按谷价,显示「周末时段——全谷价」) · 峰/谷切换前弹窗与系统通知提醒(位置/提前量/提醒类型可配) · 官方价格一键同步 · 类 Codex Token 用量热图 · 多厂商多模型价格计费(内置 90+ 模型价格目录与自动匹配) · 主流 Coding Plan 额度查询与显示(Anthropic / Z.ai / MiniMax / Kimi / OpenRouter / SiliconFlow / CommandCode / SCNet / 火山方舟 九家,含 Volcano Ark AK/SK 签名) · Plan/API 双轨计费(订阅额度与按量金额分离统计,每 1% 额度与满窗的 token/等值金额估算及日/周/月曲线) · 输入框上方额度横条(预算/Go/Coding Plan 用量一条横排显示,可开关)
|
|
10
10
|
|
|
11
|
-
[](https://github.com/Han-1413141/dsh-cost-meter)
|
|
12
12
|
|
|
13
|
-
**v1.7.
|
|
13
|
+
**v1.7.32**:每条自定义美元余额新增默认关闭的“按显示币种折算”开关;余额、已用金额和上限统一使用显示汇率与精度,原始数据和进度比例保持不变。详见[更新说明](docs/release-notes/v1.7.32.md)。
|
|
14
14
|
|
|
15
15
|
[](https://www.npmjs.com/package/dsh-cost-meter)
|
|
16
16
|
[](LICENSE)
|
|
@@ -64,6 +64,10 @@
|
|
|
64
64
|
|
|
65
65
|
## 自定义 Provider 余额配置示例(NewApi 模板)
|
|
66
66
|
|
|
67
|
+
**按显示币种折算:**进入**设置 → 费用 → 额度**,展开一条自定义余额配置,开启**按显示币种折算(USD 余额)**。每条配置默认关闭;“余额原币种”仍应填写端点实际返回的币种。例如原余额为 USD 54.3792,显示币种为 CNY、汇率为 7.2、精度为两位小数时,显示 **¥391.53**。侧栏、设置页与悬停明细中的已用金额、接口上限和手动上限一起折算;进度比例和原始余额不变。手动上限按原币种输入。对应持久化字段为该 `customBalances[]` 条目的 `convertToDisplayCurrency: true`,也兼容旧 `customBalance` 配置。
|
|
68
|
+
|
|
69
|
+
全局汇率表示**美元到显示币种**的换算。原币种为 CNY/EUR 或积分时保留原单位,开关不可用;阿里云余额以接口返回币种为准。切换开关不查询汇率、不额外请求余额,关闭后立即恢复原币种。
|
|
70
|
+
|
|
67
71
|
千问 / 阿里云资金账户余额可直接点击「添加千问 / 阿里云余额」,使用 RAM AccessKey 签名查询,显示接口返回的可用金与币种;配置步骤、所需权限及口径见[千问余额说明](docs/qianwen-balance.md)。
|
|
68
72
|
|
|
69
73
|
千问 Token Plan 可在卡片内选择[官方 CLI 订阅额度](docs/qwen-cli-quota.md),需在 DSH 主机以同一系统账号安装 CLI 并运行 `qianwen auth login`。默认保留本地估算;CLI 模式显示账号当前 Credits,不修改本地账本。
|
|
@@ -300,22 +304,22 @@ Node.js 20 请改用 `npm install -g pnpm@10`。版本要求见 [pnpm 官方安
|
|
|
300
304
|
dsh plugin --profile web add dsh-cost-meter
|
|
301
305
|
```
|
|
302
306
|
|
|
303
|
-
**PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.7.
|
|
307
|
+
**PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.7.32`**,建议先下载审阅再运行):
|
|
304
308
|
|
|
305
309
|
```powershell
|
|
306
|
-
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.7.
|
|
310
|
+
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.7.32/install.ps1 | iex
|
|
307
311
|
```
|
|
308
312
|
|
|
309
313
|
**或直接命令行**(机器上需已有 pnpm 与 git;同样固定到 tag):
|
|
310
314
|
|
|
311
315
|
```sh
|
|
312
|
-
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.7.
|
|
316
|
+
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.7.32
|
|
313
317
|
```
|
|
314
318
|
|
|
315
319
|
没有 git 时可用 GitHub tag 打包直链:
|
|
316
320
|
|
|
317
321
|
```sh
|
|
318
|
-
dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.7.
|
|
322
|
+
dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.7.32.tar.gz
|
|
319
323
|
```
|
|
320
324
|
|
|
321
325
|
安装后**重启** `dsh web`(插件行、Typert 清单与客户端 bundle 均在启动时扫描):
|