ccstatusline-usage 2.3.13 → 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 +10 -1
- package/dist/ccstatusline.js +27 -24
- package/package.json +1 -1
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,15 @@ 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
|
+
|
|
75
|
+
### [v2.3.14](https://github.com/pcvelz/ccstatusline-usage/releases/tag/v2.3.14) - Drop extraUsageBalance setting
|
|
76
|
+
|
|
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.
|
|
78
|
+
|
|
70
79
|
### [v2.3.13](https://github.com/pcvelz/ccstatusline-usage/releases/tag/v2.3.13) - Fix timer color regression from v2.3.12
|
|
71
80
|
|
|
72
81
|
- [pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage): **Fix timer color** — In v2.3.12, the Reset Timer widget color setting was applied to both the `Extra: €X/€Y` output and the countdown timer (e.g. `4:28 hr`), causing the timer to appear red. The dark red is now applied inline only to the `Extra:` path; the countdown timer respects the widget's configured color as before.
|
package/dist/ccstatusline.js
CHANGED
|
@@ -52459,7 +52459,6 @@ var init_Settings = __esm(() => {
|
|
|
52459
52459
|
autoAlign: false,
|
|
52460
52460
|
continueThemeAcrossLines: false
|
|
52461
52461
|
}),
|
|
52462
|
-
extraUsageBalance: exports_external.number().optional(),
|
|
52463
52462
|
updatemessage: exports_external.object({
|
|
52464
52463
|
message: exports_external.string().nullable().optional(),
|
|
52465
52464
|
remaining: exports_external.number().nullable().optional()
|
|
@@ -55593,7 +55592,7 @@ function getTerminalWidth() {
|
|
|
55593
55592
|
function canDetectTerminalWidth() {
|
|
55594
55593
|
return probeTerminalWidth() !== null;
|
|
55595
55594
|
}
|
|
55596
|
-
var __dirname = "/Users/peter/Documents/Code/ccstatusline-usage/src/utils", PACKAGE_VERSION = "2.3.
|
|
55595
|
+
var __dirname = "/Users/peter/Documents/Code/ccstatusline-usage/src/utils", PACKAGE_VERSION = "2.3.15";
|
|
55597
55596
|
var init_terminal = () => {};
|
|
55598
55597
|
|
|
55599
55598
|
// src/utils/renderer.ts
|
|
@@ -63158,18 +63157,19 @@ function formatUsageBar(label, shortLabel, percent, size2) {
|
|
|
63158
63157
|
const display = Math.min(100, percent);
|
|
63159
63158
|
return `${size2 === "mobile" ? shortLabel : label}: ${bar} ${display.toFixed(1)}%`;
|
|
63160
63159
|
}
|
|
63161
|
-
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
|
+
}
|
|
63162
63168
|
const bar = makeSplitUsageBar(extraPercent, getBarWidth(size2));
|
|
63163
|
-
return `${
|
|
63164
|
-
}
|
|
63165
|
-
function computeEffectiveTotal(extraUsed, extraLimit, ceiling) {
|
|
63166
|
-
if (ceiling === undefined)
|
|
63167
|
-
return extraLimit;
|
|
63168
|
-
return Math.min(ceiling, extraLimit);
|
|
63169
|
+
return `${displayLabel}: ${bar} ${suffix}`;
|
|
63169
63170
|
}
|
|
63170
|
-
function computeExtraPercent(extraUsed, extraLimit
|
|
63171
|
-
|
|
63172
|
-
return denominator > 0 ? extraUsed / denominator * 100 : 0;
|
|
63171
|
+
function computeExtraPercent(extraUsed, extraLimit) {
|
|
63172
|
+
return extraLimit > 0 ? extraUsed / extraLimit * 100 : 0;
|
|
63173
63173
|
}
|
|
63174
63174
|
function getCurrencySymbol() {
|
|
63175
63175
|
try {
|
|
@@ -63200,7 +63200,7 @@ class SessionUsageWidget {
|
|
|
63200
63200
|
getEditorDisplay(_item) {
|
|
63201
63201
|
return { displayText: this.getDisplayName() };
|
|
63202
63202
|
}
|
|
63203
|
-
render(_item, context,
|
|
63203
|
+
render(_item, context, _settings) {
|
|
63204
63204
|
if (context.isPreview)
|
|
63205
63205
|
return "Session: [███░░░░░░░░░░░░] 20%";
|
|
63206
63206
|
const data = context.usageData ?? {};
|
|
@@ -63212,7 +63212,7 @@ class SessionUsageWidget {
|
|
|
63212
63212
|
const extraUsed = data.extraUsageUsed;
|
|
63213
63213
|
const extraLimit = data.extraUsageLimit;
|
|
63214
63214
|
if (size2 !== "mobile" && data.extraUsageEnabled === true && extraUsed !== undefined && extraLimit !== undefined && data.sessionUsage >= 100 && (data.weeklyUsage === undefined || data.weeklyUsage < 100)) {
|
|
63215
|
-
const extraPercent = computeExtraPercent(extraUsed, extraLimit
|
|
63215
|
+
const extraPercent = computeExtraPercent(extraUsed, extraLimit);
|
|
63216
63216
|
return formatSplitUsageBar("Session", "S", extraPercent, size2);
|
|
63217
63217
|
}
|
|
63218
63218
|
return formatUsageBar("Session", "S", data.sessionUsage, size2);
|
|
@@ -63241,7 +63241,7 @@ class WeeklyUsageWidget {
|
|
|
63241
63241
|
getEditorDisplay(_item) {
|
|
63242
63242
|
return { displayText: this.getDisplayName() };
|
|
63243
63243
|
}
|
|
63244
|
-
render(_item, context,
|
|
63244
|
+
render(_item, context, _settings) {
|
|
63245
63245
|
if (context.isPreview)
|
|
63246
63246
|
return "Weekly: [██░░░░░░░░░░░░░] 12%";
|
|
63247
63247
|
const data = context.usageData ?? {};
|
|
@@ -63252,9 +63252,9 @@ class WeeklyUsageWidget {
|
|
|
63252
63252
|
const size2 = getDisplaySize(context);
|
|
63253
63253
|
const extraUsed = data.extraUsageUsed;
|
|
63254
63254
|
const extraLimit = data.extraUsageLimit;
|
|
63255
|
-
if (
|
|
63256
|
-
const extraPercent = computeExtraPercent(extraUsed, extraLimit
|
|
63257
|
-
return formatSplitUsageBar("Weekly", "W", extraPercent, size2);
|
|
63255
|
+
if (data.extraUsageEnabled === true && extraUsed !== undefined && extraLimit !== undefined && data.weeklyUsage >= 100) {
|
|
63256
|
+
const extraPercent = computeExtraPercent(extraUsed, extraLimit);
|
|
63257
|
+
return formatSplitUsageBar("Weekly", "W", extraPercent, size2, extraUsed, extraLimit);
|
|
63258
63258
|
}
|
|
63259
63259
|
return formatUsageBar("Weekly", "W", data.weeklyUsage, size2);
|
|
63260
63260
|
}
|
|
@@ -63282,7 +63282,7 @@ class ResetTimerWidget {
|
|
|
63282
63282
|
getEditorDisplay(_item) {
|
|
63283
63283
|
return { displayText: this.getDisplayName() };
|
|
63284
63284
|
}
|
|
63285
|
-
render(_item, context,
|
|
63285
|
+
render(_item, context, _settings) {
|
|
63286
63286
|
if (context.isPreview)
|
|
63287
63287
|
return "4:30 hr";
|
|
63288
63288
|
const data = context.usageData ?? {};
|
|
@@ -63293,11 +63293,14 @@ class ResetTimerWidget {
|
|
|
63293
63293
|
const is1mModel = modelId.includes("[1m]");
|
|
63294
63294
|
const isOpus = modelId.includes("opus");
|
|
63295
63295
|
const isChargedModel = is1mModel && !isOpus;
|
|
63296
|
-
|
|
63297
|
-
|
|
63298
|
-
const
|
|
63299
|
-
|
|
63300
|
-
|
|
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
|
+
}
|
|
63301
63304
|
}
|
|
63302
63305
|
if (!data.sessionResetAt)
|
|
63303
63306
|
return null;
|