ccstatusline-usage 2.0.34 → 2.0.36

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
@@ -633,6 +633,7 @@ Contributions are welcome! Please feel free to submit a Pull Request.
633
633
  ```bash
634
634
  npm uninstall -g ccstatusline-usage
635
635
  rm -rf ~/.npm/_npx ~/.config/ccstatusline ~/.cache/ccstatusline*
636
+ jq 'del(.statusLine)' ~/.claude/settings.json > /tmp/cs.json && cat /tmp/cs.json > ~/.claude/settings.json
636
637
  ```
637
638
 
638
639
  ---
@@ -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.34";
51453
+ var PACKAGE_VERSION = "2.0.36";
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 ?? 200000;
54687
- const used = cw.current_usage ?? 0;
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccstatusline-usage",
3
- "version": "2.0.34",
3
+ "version": "2.0.36",
4
4
  "description": "A customizable status line formatter for Claude Code CLI",
5
5
  "module": "src/ccstatusline.ts",
6
6
  "type": "module",