ccstatusline-usage 2.0.42 → 2.0.45

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
@@ -29,6 +29,7 @@
29
29
  This fork adds API-based usage widgets beyond the upstream:
30
30
 
31
31
  - **Session/Weekly Usage** - Real utilization from Anthropic API with progress bars
32
+ - **Extra Usage** - When weekly limit is reached, shows extra usage spending (e.g. `Extra: €41.24/€47.00`)
32
33
  - **Reset Timer** - Time until 5-hour session window resets
33
34
  - **Context Window Display** - Visual bar showing context usage
34
35
  - **Two-line Layout** - Session info on line 1, context on line 2
@@ -36,7 +37,7 @@ This fork adds API-based usage widgets beyond the upstream:
36
37
  ### Enhanced Status Line Preview
37
38
 
38
39
  ```
39
- Session: [████░░░░░░░░░░░] 27.0% | Weekly: [████████████░░░] 86.0% | 1:56 hr | Model: Opus 4.5 | Session ID: 714aa815-8a...
40
+ Session: [████░░░░░░░░░░░] 27.0% | Weekly: [████████████░░░] 86.0% | 1:56 hr | Extra: $41.24/$47.00 | Model: Opus 4.6 | Session ID: 714aa815-8a...
40
41
  Context: [███████░░░░░░░░] 103k/200k (51%)
41
42
  ```
42
43
 
@@ -64,6 +65,23 @@ These widgets are enabled by default. Just install and run!
64
65
 
65
66
  ## 🆕 Recent Updates
66
67
 
68
+ ### [v2.0.44](https://github.com/pcvelz/ccstatusline-usage/releases/tag/v2.0.44) - Upstream sync + extra usage
69
+
70
+ - Merged 101 upstream commits (line reorder, CLAUDE_CONFIG_DIR support, Windows fixes, and more)
71
+ - Extra usage spending display in Reset Timer widget (e.g. `Extra: €41.24/€47.00`)
72
+ - Auto-detect currency from timezone (Europe/* = €, else $)
73
+
74
+ ### [v2.0.43](https://github.com/pcvelz/ccstatusline-usage/releases/tag/v2.0.43) - Extra usage spending display
75
+
76
+ - Show extra usage spending in Reset Timer widget when weekly limit is reached (e.g. `Extra: €41.24/€47.00`)
77
+ - Auto-detect currency from timezone (Europe/* = €, else $)
78
+ - Updated README release notes
79
+
80
+ ### [v2.0.42](https://github.com/pcvelz/ccstatusline-usage/releases/tag/v2.0.42) - Fix reset timer API field
81
+
82
+ - Fixed API field name from `reset_at` to `resets_at` — reset timer now displays correctly
83
+ - Merged latest changes from upstream ccstatusline
84
+
67
85
  ### v2.0.16 - Add fish style path abbreviation toggle to Current Working Directory widget
68
86
 
69
87
  ### v2.0.15 - Block Timer calculation fixes
@@ -369,10 +387,10 @@ Once configured, ccstatusline automatically formats your Claude Code status line
369
387
 
370
388
  ### 📊 Available Widgets
371
389
 
372
- #### API Usage Widgets (Fork Enhancement)
390
+ #### API Usage Widgets ([pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage))
373
391
  - **Session Usage** - 5-hour session utilization with progress bar (e.g., "Session: [████░░░░░░░░░░░] 29.0%")
374
392
  - **Weekly Usage** - 7-day utilization with progress bar (e.g., "Weekly: [█░░░░░░░░░░░░░░] 7.0%")
375
- - **Reset Timer** - Time until 5-hour session window resets (e.g., "2:59 hr")
393
+ - **Reset Timer / Extra Usage** - Time until 5-hour session window resets (e.g., "2:59 hr"), or extra usage spending when weekly limit is reached (e.g., "Extra: €41.24/€47.00")
376
394
  - **Context Bar** - Visual context window usage with bar (e.g., "Context: [███████░░░░░░░░] 103k/200k (51%)")
377
395
 
378
396
  #### Standard Widgets
@@ -414,7 +432,7 @@ These settings affect where long lines are truncated, and where right-alignment
414
432
 
415
433
  Configure global formatting preferences that apply to all widgets:
416
434
 
417
- ![Global Options](screenshots/global.png)
435
+ ![Global Options](https://raw.githubusercontent.com/sirmalloc/ccstatusline/main/screenshots/global.png)
418
436
 
419
437
  #### Default Padding & Separators
420
438
  - **Default Padding** - Add consistent padding to the left and right of each widget
@@ -446,7 +464,7 @@ Configure global formatting preferences that apply to all widgets:
446
464
 
447
465
  The Block Timer widget helps you track your progress through Claude Code's 5-hour conversation blocks:
448
466
 
449
- ![Block Timer](screenshots/blockTimer.png)
467
+ ![Block Timer](https://raw.githubusercontent.com/sirmalloc/ccstatusline/main/screenshots/blockTimer.png)
450
468
 
451
469
  **Display Modes:**
452
470
  - **Time Display** - Shows elapsed time as "3hr 45m" (default)
@@ -650,6 +668,10 @@ jq 'del(.statusLine)' ~/.claude/settings.json > /tmp/cs.json && cat /tmp/cs.json
650
668
 
651
669
  - GitHub: [@sirmalloc](https://github.com/sirmalloc)
652
670
 
671
+ **PC van Velzen** ([pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage) fork)
672
+
673
+ - GitHub: [@pcvelz](https://github.com/pcvelz)
674
+
653
675
  ---
654
676
 
655
677
  ## 🔗 Related Projects
@@ -51450,7 +51450,7 @@ import { execSync as execSync3 } from "child_process";
51450
51450
  import * as fs5 from "fs";
51451
51451
  import * as path4 from "path";
51452
51452
  var __dirname = "/Users/peter/Documents/Code/ccstatusline-usage/src/utils";
51453
- var PACKAGE_VERSION = "2.0.42";
51453
+ var PACKAGE_VERSION = "2.0.45";
51454
51454
  function getPackageVersion() {
51455
51455
  if (/^\d+\.\d+\.\d+/.test(PACKAGE_VERSION)) {
51456
51456
  return PACKAGE_VERSION;
@@ -54404,7 +54404,10 @@ class ClaudeSessionIdWidget {
54404
54404
  }
54405
54405
  }
54406
54406
  // src/widgets/ApiUsage.tsx
54407
- import { execSync as execSync8, spawnSync } from "child_process";
54407
+ import {
54408
+ execSync as execSync8,
54409
+ spawnSync
54410
+ } from "child_process";
54408
54411
  import * as fs6 from "fs";
54409
54412
  import * as path5 from "path";
54410
54413
  var CACHE_FILE = path5.join(process.env.HOME ?? "", ".cache", "ccstatusline-api.json");
@@ -54549,6 +54552,12 @@ function fetchApiData() {
54549
54552
  if (data.seven_day) {
54550
54553
  apiData.weeklyUsage = data.seven_day.utilization;
54551
54554
  }
54555
+ if (data.extra_usage) {
54556
+ apiData.extraUsageEnabled = data.extra_usage.is_enabled === true;
54557
+ apiData.extraUsageLimit = data.extra_usage.monthly_limit;
54558
+ apiData.extraUsageUsed = data.extra_usage.used_credits;
54559
+ apiData.extraUsageUtilization = data.extra_usage.utilization;
54560
+ }
54552
54561
  if (apiData.sessionUsage === undefined && apiData.weeklyUsage === undefined) {
54553
54562
  const stale = readStaleCache();
54554
54563
  if (stale && !stale.error)
@@ -54659,7 +54668,7 @@ class ResetTimerWidget {
54659
54668
  return "brightBlue";
54660
54669
  }
54661
54670
  getDescription() {
54662
- return "Shows time until daily limit reset";
54671
+ return "Shows extra usage spending or time until limit reset";
54663
54672
  }
54664
54673
  getDisplayName() {
54665
54674
  return "Reset Timer";
@@ -54673,6 +54682,11 @@ class ResetTimerWidget {
54673
54682
  const data = fetchApiData();
54674
54683
  if (data.error)
54675
54684
  return getErrorMessage(data.error);
54685
+ if (data.extraUsageEnabled && data.extraUsageUsed !== undefined && data.extraUsageLimit !== undefined) {
54686
+ const used = formatCents(data.extraUsageUsed);
54687
+ const limit = formatCents(data.extraUsageLimit);
54688
+ return `Extra: ${used}/${limit}`;
54689
+ }
54676
54690
  if (!data.sessionResetAt)
54677
54691
  return null;
54678
54692
  try {
@@ -54695,6 +54709,18 @@ class ResetTimerWidget {
54695
54709
  return true;
54696
54710
  }
54697
54711
  }
54712
+ function getCurrencySymbol() {
54713
+ try {
54714
+ const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
54715
+ if (tz.startsWith("Europe/"))
54716
+ return "€";
54717
+ } catch {}
54718
+ return "$";
54719
+ }
54720
+ function formatCents(cents) {
54721
+ const symbol2 = getCurrencySymbol();
54722
+ return `${symbol2}${(cents / 100).toFixed(2)}`;
54723
+ }
54698
54724
 
54699
54725
  class ContextBarWidget {
54700
54726
  getDefaultColor() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccstatusline-usage",
3
- "version": "2.0.42",
3
+ "version": "2.0.45",
4
4
  "description": "A customizable status line formatter for Claude Code CLI",
5
5
  "module": "src/ccstatusline.ts",
6
6
  "type": "module",