dsh-cost-meter 1.9.61 → 1.9.62

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 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.61-4176E6?style=flat-square" alt="version"></a>
6
+ <a href="https://github.com/Han-1413141/dsh-cost-meter/releases/latest"><img src="https://img.shields.io/badge/version-1.9.62-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>
@@ -19,6 +19,13 @@ Track costs and tokens by conversation, model and call. View account balances, s
19
19
  <br><sub>Project illustration</sub>
20
20
  </p>
21
21
 
22
+ <picture>
23
+ <source media="(prefers-color-scheme: dark)" srcset="docs/images/conversation-dark.png">
24
+ <img src="docs/images/conversation-light.png" alt="Full conversation view with costs, subscription quotas and account balance" width="1280">
25
+ </picture>
26
+
27
+ <p align="center"><sub>Full conversation view in light or dark mode to match your theme. Screenshots use example data.</sub></p>
28
+
22
29
  ## Installation
23
30
 
24
31
  Requires **Node.js ≥ 20, DSH 0.2.0 or later**, and pnpm available to DSH. See [host compatibility](docs/host-compatibility.md).
@@ -35,20 +42,20 @@ Restart `dsh web` after installation or updates. **Desktop** uses its bundled CL
35
42
  The PowerShell installer checks pnpm and Git and uses the `web` profile by default:
36
43
 
37
44
  ```powershell
38
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.61/install.ps1 | iex
45
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.62/install.ps1 | iex
39
46
  ```
40
47
 
41
48
  Install a pinned Git tag:
42
49
 
43
50
  ```sh
44
- dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.61
51
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.62
45
52
  ```
46
53
 
47
54
  See [installation and updates](docs/install.en.md) for uninstalling or installing without Git.
48
55
 
49
56
  </details>
50
57
 
51
- Current release **v1.9.61**: [release notes](docs/update-notes-1.9.61.md#english) · [troubleshooting](docs/install-troubleshooting.md)
58
+ Current release **v1.9.62**: [release notes](docs/update-notes-1.9.62.md#english) · [troubleshooting](docs/install-troubleshooting.md)
52
59
 
53
60
  ## Feature overview
54
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.61-4176E6?style=flat-square" alt="version"></a>
6
+ <a href="https://github.com/Han-1413141/dsh-cost-meter/releases/latest"><img src="https://img.shields.io/badge/version-1.9.62-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>
@@ -19,6 +19,13 @@
19
19
  <br><sub>项目宣传图</sub>
20
20
  </p>
21
21
 
22
+ <picture>
23
+ <source media="(prefers-color-scheme: dark)" srcset="docs/images/conversation-dark.png">
24
+ <img src="docs/images/conversation-light.png" alt="完整会话界面,包含会话费用、套餐额度与账户余额" width="1280">
25
+ </picture>
26
+
27
+ <p align="center"><sub>完整会话界面,随主题切换浅色与深色。截图使用示例数据。</sub></p>
28
+
22
29
  ## 安装
23
30
 
24
31
  需要 **Node.js ≥ 20、DSH 0.2.0 或更新版本**,以及 DSH 可用的 pnpm。[宿主兼容记录](docs/host-compatibility.md)
@@ -35,20 +42,20 @@ dsh plugin --profile web add dsh-cost-meter
35
42
  PowerShell 脚本自动检查 pnpm 和 Git,默认安装到 `web` Profile:
36
43
 
37
44
  ```powershell
38
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.61/install.ps1 | iex
45
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.62/install.ps1 | iex
39
46
  ```
40
47
 
41
48
  固定 Git tag 安装:
42
49
 
43
50
  ```sh
44
- dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.61
51
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.62
45
52
  ```
46
53
 
47
54
  更新、卸载及无 Git 的安装方法见[安装说明](docs/install.md)。
48
55
 
49
56
  </details>
50
57
 
51
- 当前版本 **v1.9.61**:[更新说明](docs/update-notes-1.9.61.md#中文) · [安装排障](docs/install-troubleshooting.md)
58
+ 当前版本 **v1.9.62**:[更新说明](docs/update-notes-1.9.62.md#中文) · [安装排障](docs/install-troubleshooting.md)
52
59
 
53
60
  ## 功能总览
54
61
 
@@ -19,22 +19,22 @@ On Node.js 20, use `npm install -g pnpm@10` instead. See [pnpm installation and
19
19
  dsh plugin --profile web add dsh-cost-meter
20
20
  ```
21
21
 
22
- **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.61`** — review the script before running):
22
+ **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.62`** — review the script before running):
23
23
 
24
24
  ```powershell
25
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.61/install.ps1 | iex
25
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.62/install.ps1 | iex
26
26
  ```
27
27
 
28
28
  **Or a plain command line** (the machine must already have pnpm and git; also pinned to the tag):
29
29
 
30
30
  ```sh
31
- dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.61
31
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.62
32
32
  ```
33
33
 
34
34
  Without git, use the GitHub tag archive:
35
35
 
36
36
  ```sh
37
- dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.9.61.tar.gz
37
+ dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.9.62.tar.gz
38
38
  ```
39
39
 
40
40
  After installing, **restart** `dsh web` (plugin rows, the Typert manifest and the client bundle are all scanned at startup):
package/docs/install.md CHANGED
@@ -19,22 +19,22 @@ Node.js 20 请改用 `npm install -g pnpm@10`。版本要求见 [pnpm 官方安
19
19
  dsh plugin --profile web add dsh-cost-meter
20
20
  ```
21
21
 
22
- **PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.9.61`**,建议先下载审阅再运行):
22
+ **PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.9.62`**,建议先下载审阅再运行):
23
23
 
24
24
  ```powershell
25
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.61/install.ps1 | iex
25
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.9.62/install.ps1 | iex
26
26
  ```
27
27
 
28
28
  **或直接命令行**(机器上需已有 pnpm 与 git;同样固定到 tag):
29
29
 
30
30
  ```sh
31
- dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.61
31
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.9.62
32
32
  ```
33
33
 
34
34
  没有 git 时可用 GitHub tag 打包直链:
35
35
 
36
36
  ```sh
37
- dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.9.61.tar.gz
37
+ dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.9.62.tar.gz
38
38
  ```
39
39
 
40
40
  安装后**重启** `dsh web`(插件行、Typert 清单与客户端 bundle 均在启动时扫描):
@@ -0,0 +1,21 @@
1
+ # v1.9.62
2
+
3
+ ## 中文
4
+
5
+ - 修复合并卡片模式下峰谷进度条过薄、高光被裁切的问题,实际侧栏与显示预览完整呈现进度条。
6
+ - 补充实际侧栏与设置预览的回归检查,覆盖浅色、深色和窄侧栏。
7
+
8
+ 感谢 [@ansel-open](https://github.com/ansel-open) 在 [#487](https://github.com/Han-1413141/dsh-cost-meter/issues/487) 报告问题,并提供复现步骤及侧栏、显示预览截图。
9
+
10
+ ## English
11
+
12
+ - Fix the thin peak-period track and clipped highlight in the merged sidebar card and its display preview.
13
+ - Cover the actual sidebar and settings preview in light, dark and narrow layouts.
14
+
15
+ ## 升级 / Upgrade
16
+
17
+ ```sh
18
+ dsh plugin --profile web add dsh-cost-meter@latest
19
+ ```
20
+
21
+ 更新后重启 `dsh web`。Desktop 用户参见 [安装与更新](install-troubleshooting.md#desktop-安装与更新)。
@@ -1,3 +1,3 @@
1
- ;(function(_){const x=window.__ModuleLoader__,Z=x[Symbol.for("@dsh-plugin/dsh-loader:load-wrap")];return(_.id==="dsh-cost-meter"&&x.load===Z?.ours&&typeof Z.original=="function"?Z.original:x.load).call(x,_)})({id:"dsh-cost-meter",chunk:"client.peak.js",factory:K=>{function _(m){if(m==="auto")return!0;if(typeof m!="string"||!m||m.length>100||/^[+-]/.test(m))return!1;try{return new Intl.DateTimeFormat("en",{timeZone:m}),!0}catch{return!1}}function x(m){if(m?.peakTimeZone!=="auto"&&_(m?.peakTimeZone))return m.peakTimeZone;try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}function Z(m){let T=[];try{T=Intl.supportedValuesOf("timeZone")}catch{}return[...new Set(["UTC",x({}),x(m),"Asia/Shanghai","Asia/Tokyo","Asia/Kolkata","Asia/Kathmandu","Europe/London","Europe/Berlin","America/New_York","America/Los_Angeles","Australia/Sydney",...T])].sort()}function Y(m,T,W,z){const C=new Date(z),O=Date.UTC(C.getUTCFullYear(),C.getUTCMonth(),C.getUTCDate()),S=new Intl.DateTimeFormat(W,{timeZone:x(T),weekday:"short",hour:"2-digit",minute:"2-digit",hourCycle:"h23"});return(m??[]).map(v=>S.format(O+v.start*36e5)+"–"+S.format(O+(v.end<=v.start?v.end+24:v.end)*36e5)).join(", ")}const q=K("react"),{createElement:e,useState:B,useEffect:U,Fragment:M}=q,G=`.cm-peak-progress{--peak-color:var(--dsw-alias-state-business-primary);min-width:0;padding:10px 2px 8px;display:flex;flex-direction:column;gap:7px;font-size:12px;line-height:1.35;font-variant-numeric:tabular-nums}.cm-peak-progress.peak{--peak-color:#ff9800}.cm-peak-progress-head,.cm-peak-progress-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0}.cm-peak-progress-phase{display:inline-flex;align-items:center;gap:6px;color:var(--peak-color);font-weight:600;white-space:nowrap}.cm-peak-progress-phase i{width:6px;height:6px;border-radius:50%;background:var(--peak-color);flex:none}.cm-peak-progress-time{font-size:11px;color:var(--dsw-alias-label-secondary);text-align:right;overflow-wrap:anywhere}.cm-peak-progress-track{height:6px;border-radius:99px;background:color-mix(in srgb,var(--peak-color) 12%,var(--dsw-alias-bg-layer-3));overflow:hidden;position:relative;width:100%}.cm-peak-progress-fill{height:100%;display:block;background:var(--peak-color);border-radius:inherit;position:relative}.cm-peak-progress-fill:after{content:"";position:absolute;right:2px;top:2px;width:2px;height:2px;background:#fff;border-radius:50%;opacity:.85}.cm-peak-progress-meta{font-size:10px;color:var(--dsw-alias-label-tertiary);gap:8px}.cm-peak-progress-meta span:last-child{text-align:right;color:var(--dsw-alias-label-secondary)}.cm-peak-progress.variant-simple{padding:2px 0;gap:3px;font-size:11px;line-height:14px}.cm-peak-progress.variant-simple .cm-peak-progress-time{font-size:10px;line-height:14px;white-space:nowrap}.cm-peak-progress.variant-simple .cm-peak-progress-track{height:4px}.cm-peak-progress.variant-simple .cm-peak-progress-meta{justify-content:flex-end;font-size:10px;line-height:12px}.cm-peak-progress.variant-simple .cm-peak-progress-phase{gap:5px}.cm-peak-progress.variant-compact{padding:2px 0;gap:7px;flex-direction:row;align-items:center;font-size:11px;line-height:16px;white-space:nowrap}.cm-peak-progress.variant-compact .cm-peak-progress-phase{gap:4px;flex:none}.cm-peak-progress.variant-compact .cm-peak-progress-phase i{width:5px;height:5px}.cm-peak-progress.variant-compact .cm-peak-progress-track{flex:1;min-width:20px;width:auto;height:4px}.cm-peak-progress.variant-compact .cm-peak-progress-time{flex:none;font-size:10px;line-height:16px;white-space:nowrap}.variant-simple .cm-peak-progress-fill:after,.variant-compact .cm-peak-progress-fill:after{top:1px;right:1px}.cm-footer-stack.simple>.cm-peak-progress{padding-left:10px;padding-right:10px;margin:0}.cm-peak-progress.rail{align-items:center;padding:4px 0;gap:4px}.cm-peak-progress.rail .cm-peak-progress-track{width:6px;height:42px;display:flex;align-items:flex-end}.cm-peak-progress.rail .cm-peak-progress-fill{width:100%}.cm-peak-progress-rail-label{font-size:10px;white-space:nowrap;color:var(--peak-color)}.cm-peak-progress.variant-summary{padding:0;border:0;border-radius:0;background:transparent;gap:2px;font-size:10px}.variant-summary .cm-peak-progress-head{gap:5px;align-items:baseline;flex-wrap:wrap}.cm-peak-summary-left{display:flex;gap:4px;align-items:center;flex-wrap:wrap;min-width:0}.cm-peak-summary-countdown,.variant-summary .cm-peak-progress-time{font-size:10px;white-space:nowrap;color:var(--dsw-alias-label-tertiary,#888)}.variant-summary .cm-peak-progress-track{height:3px}.variant-summary .cm-peak-progress-phase{font-weight:400}.cm-peak-progress.text-only:not(.rail){justify-content:space-between;flex-wrap:wrap;gap:2px 8px}.cm-peak-progress.text-only .cm-peak-progress-time{min-width:0;max-width:100%;white-space:normal}.cm-peak-progress.text-only .cm-peak-progress-phase i{display:none}
1
+ ;(function(_){const x=window.__ModuleLoader__,Z=x[Symbol.for("@dsh-plugin/dsh-loader:load-wrap")];return(_.id==="dsh-cost-meter"&&x.load===Z?.ours&&typeof Z.original=="function"?Z.original:x.load).call(x,_)})({id:"dsh-cost-meter",chunk:"client.peak.js",factory:K=>{function _(m){if(m==="auto")return!0;if(typeof m!="string"||!m||m.length>100||/^[+-]/.test(m))return!1;try{return new Intl.DateTimeFormat("en",{timeZone:m}),!0}catch{return!1}}function x(m){if(m?.peakTimeZone!=="auto"&&_(m?.peakTimeZone))return m.peakTimeZone;try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}function Z(m){let T=[];try{T=Intl.supportedValuesOf("timeZone")}catch{}return[...new Set(["UTC",x({}),x(m),"Asia/Shanghai","Asia/Tokyo","Asia/Kolkata","Asia/Kathmandu","Europe/London","Europe/Berlin","America/New_York","America/Los_Angeles","Australia/Sydney",...T])].sort()}function Y(m,T,W,z){const C=new Date(z),O=Date.UTC(C.getUTCFullYear(),C.getUTCMonth(),C.getUTCDate()),S=new Intl.DateTimeFormat(W,{timeZone:x(T),weekday:"short",hour:"2-digit",minute:"2-digit",hourCycle:"h23"});return(m??[]).map(v=>S.format(O+v.start*36e5)+"–"+S.format(O+(v.end<=v.start?v.end+24:v.end)*36e5)).join(", ")}const q=K("react"),{createElement:e,useState:B,useEffect:U,Fragment:M}=q,G=`.cm-peak-progress{--peak-color:var(--dsw-alias-state-business-primary);min-width:0;padding:10px 2px 8px;display:flex;flex-direction:column;gap:7px;font-size:12px;line-height:1.35;font-variant-numeric:tabular-nums}.cm-peak-progress.peak{--peak-color:#ff9800}.cm-peak-progress-head,.cm-peak-progress-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0}.cm-peak-progress-phase{display:inline-flex;align-items:center;gap:6px;color:var(--peak-color);font-weight:600;white-space:nowrap}.cm-peak-progress-phase i{width:6px;height:6px;border-radius:50%;background:var(--peak-color);flex:none}.cm-peak-progress-time{font-size:11px;color:var(--dsw-alias-label-secondary);text-align:right;overflow-wrap:anywhere}.cm-peak-progress-track{height:6px;border-radius:99px;background:color-mix(in srgb,var(--peak-color) 12%,var(--dsw-alias-bg-layer-3));overflow:hidden;position:relative;width:100%}.cm-peak-progress-fill{height:100%;display:block;background:var(--peak-color);border-radius:inherit;position:relative}.cm-peak-progress-fill:after{content:"";position:absolute;right:2px;top:2px;width:2px;height:2px;background:#fff;border-radius:50%;opacity:.85}.cm-peak-progress-meta{font-size:10px;color:var(--dsw-alias-label-tertiary);gap:8px}.cm-peak-progress-meta span:last-child{text-align:right;color:var(--dsw-alias-label-secondary)}.cm-peak-progress.variant-simple{padding:2px 0;gap:3px;font-size:11px;line-height:14px}.cm-peak-progress.variant-simple .cm-peak-progress-time{font-size:10px;line-height:14px;white-space:nowrap}.cm-peak-progress.variant-simple .cm-peak-progress-track{height:4px}.cm-peak-progress.variant-simple .cm-peak-progress-meta{justify-content:flex-end;font-size:10px;line-height:12px}.cm-peak-progress.variant-simple .cm-peak-progress-phase{gap:5px}.cm-peak-progress.variant-compact{padding:2px 0;gap:7px;flex-direction:row;align-items:center;font-size:11px;line-height:16px;white-space:nowrap}.cm-peak-progress.variant-compact .cm-peak-progress-phase{gap:4px;flex:none}.cm-peak-progress.variant-compact .cm-peak-progress-phase i{width:5px;height:5px}.cm-peak-progress.variant-compact .cm-peak-progress-track{flex:1;min-width:20px;width:auto;height:4px}.cm-peak-progress.variant-compact .cm-peak-progress-time{flex:none;font-size:10px;line-height:16px;white-space:nowrap}.variant-simple .cm-peak-progress-fill:after,.variant-compact .cm-peak-progress-fill:after{top:1px;right:1px}.cm-footer-stack.simple>.cm-peak-progress{padding-left:10px;padding-right:10px;margin:0}.cm-peak-progress.rail{align-items:center;padding:4px 0;gap:4px}.cm-peak-progress.rail .cm-peak-progress-track{width:6px;height:42px;display:flex;align-items:flex-end}.cm-peak-progress.rail .cm-peak-progress-fill{width:100%}.cm-peak-progress-rail-label{font-size:10px;white-space:nowrap;color:var(--peak-color)}.cm-peak-progress.variant-summary{padding:0;border:0;border-radius:0;background:transparent;gap:2px;font-size:10px}.variant-summary .cm-peak-progress-head{gap:5px;align-items:baseline;flex-wrap:wrap}.cm-peak-summary-left{display:flex;gap:4px;align-items:center;flex-wrap:wrap;min-width:0}.cm-peak-summary-countdown,.variant-summary .cm-peak-progress-time{font-size:10px;white-space:nowrap;color:var(--dsw-alias-label-tertiary,#888)}.variant-summary .cm-peak-progress-track{height:6px}.variant-summary .cm-peak-progress-phase{font-weight:400}.cm-peak-progress.text-only:not(.rail){justify-content:space-between;flex-wrap:wrap;gap:2px 8px}.cm-peak-progress.text-only .cm-peak-progress-time{min-width:0;max-width:100%;white-space:normal}.cm-peak-progress.text-only .cm-peak-progress-phase i{display:none}
2
2
  `,H="cm-peak-alert-preview";let R=0;function J(m){const{peakView:T,peakPhaseAt:W,peakPhaseForConfig:z=(s,k)=>W(k,s.peakWindows,s.peakHolidays),peakConfigForState:C=s=>s?.config,peakPeriodProgress:O,usePeakClock:S,phaseLabelKeys:v,countdownText:j,resolveLocale:E,makeT:V,Tooltip:Q,FloatingCard:X}=m;let I=document.getElementById("dsh-cost-meter-peak-style");I||(I=document.createElement("style"),I.id="dsh-cost-meter-peak-style",document.head.appendChild(I)),I.textContent=G;function $(s,k){const a=T(s,k);if(!a)return null;const{start:i,progress:A}=O(s,a,k),t=E(s)==="en"?"en":"zh-CN",n=x(s),f=r=>new Intl.DateTimeFormat("en",{timeZone:n,timeZoneName:"shortOffset"}).formatToParts(r).find(g=>g.type==="timeZoneName")?.value??"",b=f(i)!==f(a.nextAtMs),w=r=>new Intl.DateTimeFormat(t,{timeZone:n,hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(r),d=r=>new Intl.DateTimeFormat("en-CA",{timeZone:n,year:"numeric",month:"2-digit",day:"2-digit"}).format(r),c=r=>{const g=w(r)+(b?" "+f(r):"");return d(r)===d(k)?g:new Intl.DateTimeFormat(t,{timeZone:n,...a.holiday||Math.abs(r-k)>=7*864e5?{month:"numeric",day:"numeric"}:{weekday:"short"}}).format(r)+" "+g};return{...a,start:i,progress:A,timeZone:n,startText:c(i),switchTime:c(a.nextAtMs)}}function ee({config:s,t:k,now:a,rail:i=!1}){const A=S(s,a),t=$(s,A);if(!t)return null;const n=E(s)==="en",f=v(t),b=k(t.nextIntoPeak?"peakShort":"offPeakShort"),w=Math.max(1,Math.ceil((t.nextAtMs-A)/6e4)),d=Math.floor(w/1440),c=Math.floor(w%1440/60),r=w%60,g=d>0?n?d+"d "+c+"h"+(r?" "+r+"m":""):d+"天"+(c?c+"小时":"")+(r?r+"分":""):j(t,A,k),P=n?(d?d+"d ":"")+(c?c+"h ":"")+(r?r+"m":""):(d?d+"天":"")+(c?c+"时":"")+(r?r+"分":""),o=(n?"In ":"剩余 ")+g,p=t.switchTime+(n?" · ":" 转")+b,u=t.startText+" — "+t.switchTime,h=[k(f.notice),t.timeZone+" · "+u,o+" · "+p,(n?"Elapsed ":"本时段已过 ")+t.progress.toFixed(1)+"%"].join(`
3
3
  `),l=s.peakTimeDisplay??"both",y=s.sidebarTextOnly===!0,N=y?"compact":s.peakProgressVariant??(s.sidebarSimple?"simple":s.sidebarStyle==="compact"?"compact":"full"),te=t.holiday?n?"Holiday · off-peak":"节假日 · 全天谷价":t.weekend?n?"Weekend · off-peak":"周末 · 全天谷价":k(f.short),D=t.holiday?n?"Holiday":"假日":t.weekend?n?"Weekend":"周末":k(f.short),L=ne=>e("span",{className:"cm-peak-progress-phase"},e("i",{"aria-hidden":!0}),ne),F=y?null:e("div",{className:"cm-peak-progress-track",role:"progressbar","aria-label":n?"Current pricing period elapsed":"当前计价时段已过进度","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(t.progress*10)/10,"aria-valuetext":h},e("span",{className:"cm-peak-progress-fill",style:{[i?"height":"width"]:t.progress+"%"}})),re=l==="countdown"?P:l==="switch"?t.switchTime+" → "+b:t.switchTime+" · "+P,se=i?e(M,null,F,e("span",{className:"cm-peak-progress-rail-label"},D)):N==="summary"?e(M,null,e("div",{className:"cm-peak-progress-head"},e("span",{className:"cm-peak-summary-left"},L(D),l!=="switch"?e("span",{className:"cm-peak-summary-countdown"},(n?"In ":"剩余 ")+P):null),l!=="countdown"?e("span",{className:"cm-peak-progress-time"},p):null),F):N==="compact"?e(M,null,L(D),F,e("span",{className:"cm-peak-progress-time"},re)):N==="simple"?e(M,null,e("div",{className:"cm-peak-progress-head"},L(t.holiday||t.weekend?D+(n?" · off-peak":"谷价"):D),e("span",{className:"cm-peak-progress-time"},l==="switch"?p:o)),F,l==="both"?e("div",{className:"cm-peak-progress-meta"},e("span",null,p)):null):e(M,null,e("div",{className:"cm-peak-progress-head"},L(te),e("span",{className:"cm-peak-progress-time"},l==="switch"?p:o)),F,l==="both"?e("div",{className:"cm-peak-progress-meta"},e("span",null,t.startText+(n?" start":" 开始")),e("span",null,p)):null);return e(Q,{portal:!0,label:h,side:"right",delayMs:300},e("div",{"data-cm-display":"peak","aria-label":h,className:"cm-peak-progress "+(t.inPeak?"peak":"off")+(i?" rail":" variant-"+N)+(y?" text-only":""),"data-variant":N,"data-progress":t.progress,"data-switch-at":t.nextAtMs},se))}function ae(s){const k=s.useCost?s.useCost(o=>o):void 0,a=C(k?.state),[i,A]=B(Date.now()),[t,n]=B(null),[f,b]=B(null);if(U(()=>{const o=window.setInterval(()=>A(Date.now()),1e4);return()=>window.clearInterval(o)},[]),U(()=>{const o=p=>{const u=p.detail?.kind==="offpeak"?"offpeak":"peak";b(u);const h=k?.state?.config;if(h?.peakAlertWebNotify===!0&&window.Notification&&Notification.permission==="granted"){const l=V(E(h));try{new Notification(l(u==="peak"?"peakAlertTitlePeak":"peakAlertTitleOffPeak")+l("peakAlertPreviewTag"),{body:l("peakAlertBody",{time:l("countdownMinute",{m:2}),phase:l(u==="peak"?"peakAlertPhasePeak":"peakAlertPhaseOffPeak")})})}catch{}}};return window.addEventListener(H,o),window.__cmPeakAlertLive=!0,()=>{window.removeEventListener(H,o),window.__cmPeakAlertLive=!1}},[]),U(()=>{if(!a||a.peakAlertEnabled!==!0||a.peakEnabled!==!0||a.peakAlertWebNotify!==!0||!window.Notification||Notification.permission!=="granted")return;const o=z(a,i);if(o===null)return;const p=a.peakAlertTarget==="peak"||a.peakAlertTarget==="offpeak"?a.peakAlertTarget:"both",u=o.nextIntoPeak===!0;if(p!=="both"&&p!==(u?"peak":"offpeak"))return;const h=Number(a.peakAlertAhead),l=(Number.isFinite(h)&&h>=1?h:2)*6e4;if(i<o.nextAtMs-l||i>=o.nextAtMs||R===o.nextAtMs)return;const y=V(E(a));R=o.nextAtMs;try{new Notification(y(u?"peakAlertTitlePeak":"peakAlertTitleOffPeak"),{body:y("peakAlertBody",{time:j(o,i,y),phase:y(u?"peakAlertPhasePeak":"peakAlertPhaseOffPeak")})})}catch{}},[i]),!a||a.peakEnabled!==!0)return null;let w=null;if(a.peakAlertEnabled===!0){const o=Date.parse(a.peakEffectiveAt||"");if(!(Number.isFinite(o)&&i<o)){const p=z(a,i);if(p!==null){const u=a.peakAlertTarget==="peak"||a.peakAlertTarget==="offpeak"?a.peakAlertTarget:"both",h=Number(a.peakAlertAhead),l=(Number.isFinite(h)&&h>=1?h:2)*6e4;(u==="both"||u===(p.nextIntoPeak?"peak":"offpeak"))&&i>=p.nextAtMs-l&&i<p.nextAtMs&&t!==p.nextAtMs&&(w=p)}}}let d=null,c=!1,r=null;if(w!==null)d=w,c=w.nextIntoPeak===!0,r=()=>n(w.nextAtMs);else if(f!==null)d={nextAtMs:i+2*6e4,nextIntoPeak:f==="peak"},c=f==="peak",r=()=>b(null);else return null;const g=V(E(a)),P=a.peakAlertPosition==="center"?"cm-peak-alert-center":"cm-peak-alert-corner";return e(X,{actions:{dismiss:r},className:"cm-peak-alert "+P+" "+(c?"cm-peak-alert-peak":"cm-peak-alert-offpeak"),role:"alert"},e("div",{className:"cm-peak-alert-badge"},g(c?"peakAlertBadgePeak":"peakAlertBadgeOffPeak")),e("div",{className:"cm-peak-alert-title"},g(c?"peakAlertTitlePeak":"peakAlertTitleOffPeak")),e("div",{className:"cm-peak-alert-body"},g("peakAlertBody",{time:j(d,i,g),phase:g(c?"peakAlertPhasePeak":"peakAlertPhaseOffPeak")})),e("div",{className:"cm-peak-alert-actions"},e("button",{type:"button",className:"cm-btn","data-cm-action":"dismiss",onClick:r},g("peakAlertBtn"))))}return s=>e(s.view==="alert"?ae:ee,s)}return{mount:J}}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-cost-meter",
3
- "version": "1.9.61",
3
+ "version": "1.9.62",
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",
@@ -231,7 +231,8 @@
231
231
  "docs/catalog-2026-11-05.md",
232
232
  "docs/update-notes-1.9.60.md",
233
233
  "docs/local-savings.md",
234
- "docs/update-notes-1.9.61.md"
234
+ "docs/update-notes-1.9.61.md",
235
+ "docs/update-notes-1.9.62.md"
235
236
  ],
236
237
  "dependencies": {
237
238
  "acorn": "8.15.0",