ccstatusline-usage 2.3.14 → 2.3.15

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
@@ -32,7 +32,7 @@ This fork adds API-based usage widgets beyond the upstream:
32
32
 
33
33
  - **Session/Weekly Usage** - Real utilization from Anthropic API with progress bars
34
34
  - **Weekly Pace** - Pendulum bar showing if you're ahead or behind expected usage pace
35
- - **Reset Timer** - Time until 5-hour session window resets
35
+ - **Reset Timer** - Time until weekly reset (when at 100% / on a charged model); otherwise time until 5-hour session window resets
36
36
  - **Context Window Display** - Visual bar showing context usage
37
37
  - **Off Peak** - Shows peak/off-peak status with countdown timer (peak hours drain sessions faster)
38
38
  - **Two-line Layout** - Session info on line 1, context on line 2
@@ -67,6 +67,11 @@ Session: [████░░░░░░░░░░░] 27.0% | Weekly: [██
67
67
 
68
68
  ## 🆕 Recent Updates
69
69
 
70
+ ### [v2.3.15](https://github.com/pcvelz/ccstatusline-usage/releases/tag/v2.3.15) - Move extra amounts into Weekly bar, Reset Timer shows weekly reset time
71
+
72
+ - [pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage): **Extra amounts in Weekly bar** — When at 100% / on a charged model, the split bar now shows `€spent/€limit` after the bar instead of `100.0%`. Mobile shows the spent amount only.
73
+ - [pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage): **Reset Timer shows weekly reset time** — When extra usage is active the timer now counts down to the weekly reset instead of showing the `Extra: €X/€Y` spending (which moved to the Weekly bar). Falls back to session timer if no weekly reset data is available.
74
+
70
75
  ### [v2.3.14](https://github.com/pcvelz/ccstatusline-usage/releases/tag/v2.3.14) - Drop extraUsageBalance setting
71
76
 
72
77
  - [pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage): Removed the `extraUsageBalance` setting introduced in v2.3.12. `Extra: €X/€Y` now uses the API's monthly limit directly — stable, no config, no drift.
@@ -55592,7 +55592,7 @@ function getTerminalWidth() {
55592
55592
  function canDetectTerminalWidth() {
55593
55593
  return probeTerminalWidth() !== null;
55594
55594
  }
55595
- var __dirname = "/Users/peter/Documents/Code/ccstatusline-usage/src/utils", PACKAGE_VERSION = "2.3.14";
55595
+ var __dirname = "/Users/peter/Documents/Code/ccstatusline-usage/src/utils", PACKAGE_VERSION = "2.3.15";
55596
55596
  var init_terminal = () => {};
55597
55597
 
55598
55598
  // src/utils/renderer.ts
@@ -63157,9 +63157,16 @@ function formatUsageBar(label, shortLabel, percent, size2) {
63157
63157
  const display = Math.min(100, percent);
63158
63158
  return `${size2 === "mobile" ? shortLabel : label}: ${bar} ${display.toFixed(1)}%`;
63159
63159
  }
63160
- function formatSplitUsageBar(label, shortLabel, extraPercent, size2) {
63160
+ function formatSplitUsageBar(label, shortLabel, extraPercent, size2, extraUsed, extraLimit) {
63161
+ const displayLabel = size2 === "mobile" ? shortLabel : label;
63162
+ const suffix = extraUsed !== undefined && extraLimit !== undefined ? `${DARK_RED_OPEN2}${formatCents(extraUsed)}/${formatCents(extraLimit)}${DARK_RED_CLOSE2}` : "100.0%";
63163
+ if (size2 === "mobile") {
63164
+ const bar2 = makeProgressBar(100, getBarWidth(size2));
63165
+ const mobileSuffix = extraUsed !== undefined ? `${DARK_RED_OPEN2}${formatCents(extraUsed)}${DARK_RED_CLOSE2}` : suffix;
63166
+ return `${displayLabel}: ${bar2} ${mobileSuffix}`;
63167
+ }
63161
63168
  const bar = makeSplitUsageBar(extraPercent, getBarWidth(size2));
63162
- return `${size2 === "mobile" ? shortLabel : label}: ${bar} 100.0%`;
63169
+ return `${displayLabel}: ${bar} ${suffix}`;
63163
63170
  }
63164
63171
  function computeExtraPercent(extraUsed, extraLimit) {
63165
63172
  return extraLimit > 0 ? extraUsed / extraLimit * 100 : 0;
@@ -63245,9 +63252,9 @@ class WeeklyUsageWidget {
63245
63252
  const size2 = getDisplaySize(context);
63246
63253
  const extraUsed = data.extraUsageUsed;
63247
63254
  const extraLimit = data.extraUsageLimit;
63248
- if (size2 !== "mobile" && data.extraUsageEnabled === true && extraUsed !== undefined && extraLimit !== undefined && data.weeklyUsage >= 100) {
63255
+ if (data.extraUsageEnabled === true && extraUsed !== undefined && extraLimit !== undefined && data.weeklyUsage >= 100) {
63249
63256
  const extraPercent = computeExtraPercent(extraUsed, extraLimit);
63250
- return formatSplitUsageBar("Weekly", "W", extraPercent, size2);
63257
+ return formatSplitUsageBar("Weekly", "W", extraPercent, size2, extraUsed, extraLimit);
63251
63258
  }
63252
63259
  return formatUsageBar("Weekly", "W", data.weeklyUsage, size2);
63253
63260
  }
@@ -63286,10 +63293,14 @@ class ResetTimerWidget {
63286
63293
  const is1mModel = modelId.includes("[1m]");
63287
63294
  const isOpus = modelId.includes("opus");
63288
63295
  const isChargedModel = is1mModel && !isOpus;
63289
- if (data.extraUsageEnabled && data.extraUsageUsed !== undefined && data.extraUsageLimit !== undefined && (data.weeklyUsage !== undefined && data.weeklyUsage >= 100 || data.sessionUsage !== undefined && data.sessionUsage >= 100 || isChargedModel)) {
63290
- const used = formatCents(data.extraUsageUsed);
63291
- const limit = formatCents(data.extraUsageLimit);
63292
- return `${DARK_RED_OPEN2}Extra: ${used}/${limit}${DARK_RED_CLOSE2}`;
63296
+ const extraActive = data.extraUsageEnabled && data.extraUsageUsed !== undefined && data.extraUsageLimit !== undefined && (data.weeklyUsage !== undefined && data.weeklyUsage >= 100 || data.sessionUsage !== undefined && data.sessionUsage >= 100 || isChargedModel);
63297
+ if (extraActive) {
63298
+ const weeklyWindow = resolveWeeklyUsageWindow(data);
63299
+ if (weeklyWindow) {
63300
+ const hours = Math.floor(weeklyWindow.remainingMs / (1000 * 60 * 60));
63301
+ const minutes = Math.floor(weeklyWindow.remainingMs % (1000 * 60 * 60) / (1000 * 60));
63302
+ return `${hours}:${minutes.toString().padStart(2, "0")} hr`;
63303
+ }
63293
63304
  }
63294
63305
  if (!data.sessionResetAt)
63295
63306
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccstatusline-usage",
3
- "version": "2.3.14",
3
+ "version": "2.3.15",
4
4
  "description": "A customizable status line formatter for Claude Code CLI",
5
5
  "module": "src/ccstatusline.ts",
6
6
  "type": "module",