@tsa-group/claude-usage 0.4.2 → 0.4.3

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.
Files changed (2) hide show
  1. package/dist/doctor.js +14 -0
  2. package/package.json +1 -1
package/dist/doctor.js CHANGED
@@ -186,6 +186,20 @@ export async function doctor() {
186
186
  : ok(`採集狀態正常(上次成功 ${h.last_ok_at ?? "-"})`));
187
187
  if (h.last_error)
188
188
  out.push(` 上次錯誤: ${h.last_error}`);
189
+ if (warn) {
190
+ // ★ 這行以前漏了:畫面印 [BAD] 但結論說「沒有發現問題」。
191
+ // 一個會自相矛盾的診斷工具,比沒有診斷工具更糟 —— 使用者會學會忽略它。
192
+ if (credOk) {
193
+ // 憑證「現在」讀得到,health 卻說壞掉 —— 那是**背景任務**的環境或版本
194
+ // 與這裡不同,不是憑證問題。這個分辨很重要:兩者的處置完全不同。
195
+ problems.push(`憑證現在讀得到,但背景任務回報失敗(${warn})。代表背景任務跑的環境或版本` +
196
+ `與你現在這個不同 —— 重跑 claude-usage install 讓它指到目前的版本;` +
197
+ `Windows 可用 schtasks /Query /TN ClaudeUsage /V /FO LIST 看它實際執行什麼`);
198
+ }
199
+ else {
200
+ problems.push(`採集失敗:${warn}`);
201
+ }
202
+ }
189
203
  }
190
204
  else {
191
205
  out.push(info("尚無 health 紀錄(背景任務還沒跑過)"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsa-group/claude-usage",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Per-user Claude usage collector — measures Claude Code token detail and account-level rate-limit utilization locally, reports to your own ingest server.",
5
5
  "type": "module",
6
6
  "bin": {