ccstatusline-usage 2.0.34 → 2.0.35
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 +5 -3
- package/package.json +1 -1
package/dist/ccstatusline.js
CHANGED
|
@@ -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.
|
|
51453
|
+
var PACKAGE_VERSION = "2.0.35";
|
|
51454
51454
|
function getPackageVersion() {
|
|
51455
51455
|
if (/^\d+\.\d+\.\d+/.test(PACKAGE_VERSION)) {
|
|
51456
51456
|
return PACKAGE_VERSION;
|
|
@@ -54683,8 +54683,10 @@ class ContextBarWidget {
|
|
|
54683
54683
|
const cw = context.data?.context_window;
|
|
54684
54684
|
if (!cw)
|
|
54685
54685
|
return null;
|
|
54686
|
-
const total = cw.context_window_size
|
|
54687
|
-
const used = cw.current_usage
|
|
54686
|
+
const total = Number(cw.context_window_size) || 200000;
|
|
54687
|
+
const used = Number(cw.current_usage) || 0;
|
|
54688
|
+
if (isNaN(total) || isNaN(used))
|
|
54689
|
+
return null;
|
|
54688
54690
|
const percent = total > 0 ? used / total * 100 : 0;
|
|
54689
54691
|
const usedK = Math.round(used / 1000);
|
|
54690
54692
|
const totalK = Math.round(total / 1000);
|