dsh-cost-meter 1.5.27 → 1.5.28

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.en.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  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) · 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) · quota strip above the input box (budget / Go / coding-plan usage in one row, toggleable)
8
8
 
9
- [![version](https://img.shields.io/badge/version-1.5.27-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
9
+ [![version](https://img.shields.io/badge/version-1.5.28-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
10
10
  [![npm](https://img.shields.io/npm/v/dsh-cost-meter?label=npm)](https://www.npmjs.com/package/dsh-cost-meter)
11
11
  [![license](https://img.shields.io/badge/license-MIT-green)](LICENSE)
12
12
  [![dsh](https://img.shields.io/badge/DeepSeek%20Harness-dsh--plugin-4176E6)](https://github.com/deepseek-ai/deepseek-harness)
@@ -195,22 +195,22 @@ Real captures from an actual DSH sidebar of the period strip and collapsed verti
195
195
  dsh plugin --profile web add dsh-cost-meter
196
196
  ```
197
197
 
198
- **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.5.27`** — review the script before running):
198
+ **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.5.28`** — review the script before running):
199
199
 
200
200
  ```powershell
201
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.5.27/install.ps1 | iex
201
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.5.28/install.ps1 | iex
202
202
  ```
203
203
 
204
204
  **Or a plain command line** (the machine must already have pnpm and git; also pinned to the tag):
205
205
 
206
206
  ```sh
207
- dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.5.27
207
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.5.28
208
208
  ```
209
209
 
210
210
  Without git, use the GitHub tag archive:
211
211
 
212
212
  ```sh
213
- dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.5.27.tar.gz
213
+ dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.5.28.tar.gz
214
214
  ```
215
215
 
216
216
  After installing, **restart** `dsh web` (plugin rows, the Typert manifest and the client bundle are all scanned at startup):
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  本会话费用 · 当日费用 · OpenCode Go 订阅额度显示 · 预算与已用百分比 · 官方账户余额 · 自定义 Provider 余额查询(可配任意 HTTP 端点) · 余额三段进度条 · 历史记录 · 峰谷计价时段显示(UTC 01:00–04:00、06:00–10:00 为峰时段) · 峰/谷切换前弹窗与系统通知提醒(位置/提前量/提醒类型可配) · 官方价格一键同步 · 类 Codex Token 用量热图 · 多厂商多模型价格计费(内置 90+ 模型价格目录与自动匹配) · 主流 Coding Plan 额度查询与显示(Anthropic / Z.ai / MiniMax / Kimi / OpenRouter / SiliconFlow / CommandCode / SCNet 八家) · 输入框上方额度横条(预算/Go/Coding Plan 用量一条横排显示,可开关)
8
8
 
9
- [![version](https://img.shields.io/badge/version-1.5.27-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
9
+ [![version](https://img.shields.io/badge/version-1.5.28-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
10
10
  [![npm](https://img.shields.io/npm/v/dsh-cost-meter?label=npm)](https://www.npmjs.com/package/dsh-cost-meter)
11
11
  [![license](https://img.shields.io/badge/license-MIT-green)](LICENSE)
12
12
  [![dsh](https://img.shields.io/badge/DeepSeek%20Harness-dsh--plugin-4176E6)](https://github.com/deepseek-ai/deepseek-harness)
@@ -197,22 +197,22 @@
197
197
  dsh plugin --profile web add dsh-cost-meter
198
198
  ```
199
199
 
200
- **PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.5.27`**,建议先下载审阅再运行):
200
+ **PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.5.28`**,建议先下载审阅再运行):
201
201
 
202
202
  ```powershell
203
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.5.27/install.ps1 | iex
203
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.5.28/install.ps1 | iex
204
204
  ```
205
205
 
206
206
  **或直接命令行**(机器上需已有 pnpm 与 git;同样固定到 tag):
207
207
 
208
208
  ```sh
209
- dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.5.27
209
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.5.28
210
210
  ```
211
211
 
212
212
  没有 git 时可用 GitHub tag 打包直链:
213
213
 
214
214
  ```sh
215
- dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.5.27.tar.gz
215
+ dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.5.28.tar.gz
216
216
  ```
217
217
 
218
218
  安装后**重启** `dsh web`(插件行、Typert 清单与客户端 bundle 均在启动时扫描):
package/lib/client.js CHANGED
@@ -2633,13 +2633,16 @@ window.__ModuleLoader__.load({
2633
2633
  // 首次更新后的功能引导:非模态小卡片,让用户自主决定是否开启额度横条;
2634
2634
  // 选择「开启/暂不」后写回 promptSeen=true 永久消失(挂在常驻 sidebar.footer.action)。
2635
2635
  function QuotaStripGuide(props) {
2636
+ // 所有 Hook 必须在任何条件返回之前调用:promptSeen 从 false 翻为 true 时本组件
2637
+ // 会从「渲染引导卡」变为提前 return null,若 useRef 在条件返回之后,两次渲染
2638
+ // 的 Hook 数量不一致,触发 React #300(Rendered fewer hooks than expected)。
2636
2639
  const costStore = props.useCost ? props.useCost(s => s) : undefined
2640
+ const busyRef = useRef(false)
2637
2641
  const state = costStore?.state
2638
2642
  if (!state) return null
2639
2643
  const config = state.config
2640
2644
  if (config.quotaStrip?.promptSeen === true) return null
2641
2645
  const t = makeT(resolveLocale(config?.locale))
2642
- const busyRef = useRef(false)
2643
2646
  const choose = enabled => {
2644
2647
  if (busyRef.current === true) return
2645
2648
  busyRef.current = true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-cost-meter",
3
- "version": "1.5.27",
3
+ "version": "1.5.28",
4
4
  "description": "DeepSeek Harness 会话费用统计插件:本会话成本、当日费用、历史记录与官方价格同步,支持多厂商多模型价格计费(内置 90+ 模型价格目录与自动匹配)、主流 Coding Plan 订阅额度查询与显示(7 家,含 SCNet Token Plan 本地 Credits 计量)、自定义 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 90+ model catalog with auto-matching), Coding Plan quota queries & display for 7 vendors (incl. local credits metering for the SCNet Token Plan), 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/index.js",