dsh-cost-meter 1.5.32 → 1.5.33

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.32-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
9
+ [![version](https://img.shields.io/badge/version-1.5.33-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)
@@ -228,22 +228,22 @@ Real captures from an actual DSH sidebar of the period strip and collapsed verti
228
228
  dsh plugin --profile web add dsh-cost-meter
229
229
  ```
230
230
 
231
- **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.32`** — review the script before running):
231
+ **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.33`** — review the script before running):
232
232
 
233
233
  ```powershell
234
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.5.32/install.ps1 | iex
234
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.5.33/install.ps1 | iex
235
235
  ```
236
236
 
237
237
  **Or a plain command line** (the machine must already have pnpm and git; also pinned to the tag):
238
238
 
239
239
  ```sh
240
- dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.5.32
240
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.5.33
241
241
  ```
242
242
 
243
243
  Without git, use the GitHub tag archive:
244
244
 
245
245
  ```sh
246
- dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.5.32.tar.gz
246
+ dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.5.33.tar.gz
247
247
  ```
248
248
 
249
249
  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.32-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
9
+ [![version](https://img.shields.io/badge/version-1.5.33-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)
@@ -230,22 +230,22 @@
230
230
  dsh plugin --profile web add dsh-cost-meter
231
231
  ```
232
232
 
233
- **PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.5.32`**,建议先下载审阅再运行):
233
+ **PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.5.33`**,建议先下载审阅再运行):
234
234
 
235
235
  ```powershell
236
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.5.32/install.ps1 | iex
236
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.5.33/install.ps1 | iex
237
237
  ```
238
238
 
239
239
  **或直接命令行**(机器上需已有 pnpm 与 git;同样固定到 tag):
240
240
 
241
241
  ```sh
242
- dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.5.32
242
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.5.33
243
243
  ```
244
244
 
245
245
  没有 git 时可用 GitHub tag 打包直链:
246
246
 
247
247
  ```sh
248
- dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.5.32.tar.gz
248
+ dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.5.33.tar.gz
249
249
  ```
250
250
 
251
251
  安装后**重启** `dsh web`(插件行、Typert 清单与客户端 bundle 均在启动时扫描):
package/lib/client.js CHANGED
@@ -2751,11 +2751,22 @@ window.__ModuleLoader__.load({
2751
2751
  // 更新后的提醒(issue #37):告知侧边栏余额/额度图框支持点击立即刷新;
2752
2752
  // 「知道了」写回 balance.clickHintSeen=true 后永久消失(挂常驻 sidebar.footer.action)。
2753
2753
  // 仅在侧边栏确有可点击图框(官方余额 / 自定义余额 / Coding Plan)时展示,避免噪音。
2754
+ // 已读标记双通道:配置标记(跨设备) + localStorage 本地兜底。后者防御版本错位——
2755
+ // 服务端/网关若运行旧版 typert schema(decode 时 zod parse 会剥离 schema 未声明的键),
2756
+ // 新增的配置标记在到达客户端前就被剥掉,卡片会在每次刷新后重现;localStorage 不经 RPC 链路,不受影响。
2757
+ const BALANCE_CLICK_HINT_LS_KEY = 'dsh-cost-meter:balance-click-hint-seen'
2758
+ const readBalanceClickHintLS = () => {
2759
+ try { return window.localStorage.getItem(BALANCE_CLICK_HINT_LS_KEY) === '1' } catch (_) { return false } // 隐私模式等场景静默
2760
+ }
2761
+ const writeBalanceClickHintLS = () => {
2762
+ try { window.localStorage.setItem(BALANCE_CLICK_HINT_LS_KEY, '1') } catch (_) { /* 配置标记仍是主通道 */ }
2763
+ }
2754
2764
  function BalanceClickGuide(props) {
2755
2765
  // Hook 全部前置(promptSeen 类标记翻转时会提前 return null,顺序必须稳定)。
2756
2766
  const costStore = props.useCost ? props.useCost(s => s) : undefined
2757
2767
  const busyRef = useRef(false)
2758
2768
  const [dismissed, setDismissed] = useState(false)
2769
+ const [lsSeen] = useState(readBalanceClickHintLS)
2759
2770
  const state = costStore?.state
2760
2771
  if (!state) return null
2761
2772
  const config = state.config
@@ -2766,7 +2777,7 @@ window.__ModuleLoader__.load({
2766
2777
  const entry = config.codingPlans?.[r.id]
2767
2778
  return entry?.enabled === true && (entry.display === 'sidebar' || entry.display === 'both')
2768
2779
  })
2769
- if (dismissed || config.balance?.clickHintSeen === true || (!sidebarBalanceOn && !sidebarCustomOn && !sidebarPlansOn)) return null
2780
+ if (dismissed || lsSeen || config.balance?.clickHintSeen === true || (!sidebarBalanceOn && !sidebarCustomOn && !sidebarPlansOn)) return null
2770
2781
  // 串行展示:横条引导(QuotaStripGuide)与本卡同为 fixed 顶部卡片,同屏会完全重叠,
2771
2782
  // 点掉一张露出另一张,视觉上像「点了没反应」。等横条引导处理完(promptSeen)再出现。
2772
2783
  if (config.quotaStrip?.promptSeen !== true) return null
@@ -2776,6 +2787,7 @@ window.__ModuleLoader__.load({
2776
2787
  // 乐观消失:点击立即隐藏,落盘确认失败才恢复可见(避免宿主渲染时序让卡片看起来「点不掉」)。
2777
2788
  setDismissed(true)
2778
2789
  busyRef.current = true
2790
+ writeBalanceClickHintLS() // 本地兜底同步落点,不依赖 RPC 成败
2779
2791
  props.api.updateConfig({ balance: { ...(config.balance ?? {}), clickHintSeen: true } })
2780
2792
  .catch(() => { busyRef.current = false; setDismissed(false) })
2781
2793
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-cost-meter",
3
- "version": "1.5.32",
3
+ "version": "1.5.33",
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",