ccstatusline-usage 2.0.25 → 2.0.26
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/dist/ccstatusline.js +26 -8
- package/package.json +2 -2
package/dist/ccstatusline.js
CHANGED
|
@@ -51444,7 +51444,7 @@ import { execSync as execSync3 } from "child_process";
|
|
|
51444
51444
|
import * as fs5 from "fs";
|
|
51445
51445
|
import * as path4 from "path";
|
|
51446
51446
|
var __dirname = "/Users/peter/Documents/Code/ccstatusline-usage/src/utils";
|
|
51447
|
-
var PACKAGE_VERSION = "2.0.
|
|
51447
|
+
var PACKAGE_VERSION = "2.0.26";
|
|
51448
51448
|
function getPackageVersion() {
|
|
51449
51449
|
if (/^\d+\.\d+\.\d+/.test(PACKAGE_VERSION)) {
|
|
51450
51450
|
return PACKAGE_VERSION;
|
|
@@ -53445,12 +53445,18 @@ class ContextPercentageWidget {
|
|
|
53445
53445
|
const usedPercentage = Math.min(100, context.tokenMetrics.contextLength / contextConfig.maxTokens * 100);
|
|
53446
53446
|
const displayPercentage = isInverse ? 100 - usedPercentage : usedPercentage;
|
|
53447
53447
|
return item.rawValue ? `${displayPercentage.toFixed(1)}%` : `Ctx: ${displayPercentage.toFixed(1)}%`;
|
|
53448
|
-
} else if (context.data?.context_window
|
|
53449
|
-
const
|
|
53450
|
-
|
|
53451
|
-
|
|
53452
|
-
|
|
53453
|
-
|
|
53448
|
+
} else if (context.data?.context_window) {
|
|
53449
|
+
const ctxWindow = context.data.context_window;
|
|
53450
|
+
let usedPercentage = null;
|
|
53451
|
+
if (typeof ctxWindow.used_percentage === "number") {
|
|
53452
|
+
usedPercentage = ctxWindow.used_percentage;
|
|
53453
|
+
} else if (typeof ctxWindow.current_usage === "number" && ctxWindow.context_window_size) {
|
|
53454
|
+
usedPercentage = Math.min(100, ctxWindow.current_usage / ctxWindow.context_window_size * 100);
|
|
53455
|
+
}
|
|
53456
|
+
if (usedPercentage !== null) {
|
|
53457
|
+
const displayPercentage = isInverse ? 100 - usedPercentage : usedPercentage;
|
|
53458
|
+
return item.rawValue ? `${displayPercentage.toFixed(1)}%` : `Ctx: ${displayPercentage.toFixed(1)}%`;
|
|
53459
|
+
}
|
|
53454
53460
|
}
|
|
53455
53461
|
return null;
|
|
53456
53462
|
}
|
|
@@ -58209,7 +58215,19 @@ var StatusJSONSchema = exports_external.looseObject({
|
|
|
58209
58215
|
}).optional(),
|
|
58210
58216
|
context_window: exports_external.object({
|
|
58211
58217
|
context_window_size: exports_external.number().optional(),
|
|
58212
|
-
|
|
58218
|
+
total_input_tokens: exports_external.number().optional(),
|
|
58219
|
+
total_output_tokens: exports_external.number().optional(),
|
|
58220
|
+
current_usage: exports_external.union([
|
|
58221
|
+
exports_external.number(),
|
|
58222
|
+
exports_external.object({
|
|
58223
|
+
input_tokens: exports_external.number().optional(),
|
|
58224
|
+
output_tokens: exports_external.number().optional(),
|
|
58225
|
+
cache_creation_input_tokens: exports_external.number().optional(),
|
|
58226
|
+
cache_read_input_tokens: exports_external.number().optional()
|
|
58227
|
+
})
|
|
58228
|
+
]).optional(),
|
|
58229
|
+
used_percentage: exports_external.number().optional(),
|
|
58230
|
+
remaining_percentage: exports_external.number().optional()
|
|
58213
58231
|
}).optional()
|
|
58214
58232
|
});
|
|
58215
58233
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccstatusline-usage",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.26",
|
|
4
4
|
"description": "A customizable status line formatter for Claude Code CLI",
|
|
5
5
|
"module": "src/ccstatusline.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -70,4 +70,4 @@
|
|
|
70
70
|
"patchedDependencies": {
|
|
71
71
|
"ink@6.2.0": "patches/ink@6.2.0.patch"
|
|
72
72
|
}
|
|
73
|
-
}
|
|
73
|
+
}
|