ccstatusline-usage 2.0.29 → 2.0.30

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.
@@ -50982,18 +50982,18 @@ var SettingsSchema = exports_external.object({
50982
50982
  version: exports_external.number().default(CURRENT_VERSION),
50983
50983
  lines: exports_external.array(exports_external.array(WidgetItemSchema)).min(1).default([
50984
50984
  [
50985
- { id: "session-usage", type: "custom-command", color: "brightBlue", commandPath: "$PKG/scripts/usage.sh session", timeout: 5000 },
50985
+ { id: "session-usage", type: "custom-command", color: "brightBlue", commandPath: "$PKG/scripts/usage.sh session", timeout: 5000, label: "Session Usage" },
50986
50986
  { id: "sep1", type: "separator" },
50987
- { id: "weekly-usage", type: "custom-command", color: "brightBlue", commandPath: "$PKG/scripts/usage.sh weekly", timeout: 5000 },
50987
+ { id: "weekly-usage", type: "custom-command", color: "brightBlue", commandPath: "$PKG/scripts/usage.sh weekly", timeout: 5000, label: "Weekly Usage" },
50988
50988
  { id: "sep2", type: "separator" },
50989
- { id: "reset-timer", type: "custom-command", color: "brightBlue", commandPath: "$PKG/scripts/usage.sh reset", timeout: 5000 },
50989
+ { id: "reset-timer", type: "custom-command", color: "brightBlue", commandPath: "$PKG/scripts/usage.sh reset", timeout: 5000, label: "Reset Timer" },
50990
50990
  { id: "sep3", type: "separator" },
50991
50991
  { id: "model", type: "model", color: "magenta" },
50992
50992
  { id: "sep4", type: "separator" },
50993
50993
  { id: "session-id", type: "claude-session-id", color: "cyan" }
50994
50994
  ],
50995
50995
  [
50996
- { id: "context-usage", type: "custom-command", color: "blue", commandPath: "$PKG/scripts/context.sh", timeout: 5000 }
50996
+ { id: "context-usage", type: "custom-command", color: "blue", commandPath: "$PKG/scripts/context.sh", timeout: 5000, label: "Context Bar" }
50997
50997
  ],
50998
50998
  []
50999
50999
  ]),
@@ -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.29";
51453
+ var PACKAGE_VERSION = "2.0.30";
51454
51454
  function getPackageVersion() {
51455
51455
  if (/^\d+\.\d+\.\d+/.test(PACKAGE_VERSION)) {
51456
51456
  return PACKAGE_VERSION;
@@ -53822,7 +53822,7 @@ function getPackageDir() {
53822
53822
  try {
53823
53823
  const realPath = fs6.realpathSync(scriptPath);
53824
53824
  let dir = path5.dirname(realPath);
53825
- for (let i = 0;i < 5; i++) {
53825
+ for (let i = 0;i < 10; i++) {
53826
53826
  const pkgJson = path5.join(dir, "package.json");
53827
53827
  if (fs6.existsSync(pkgJson)) {
53828
53828
  try {
@@ -53832,10 +53832,33 @@ function getPackageDir() {
53832
53832
  }
53833
53833
  } catch {}
53834
53834
  }
53835
+ const scriptsDir = path5.join(dir, "scripts");
53836
+ if (fs6.existsSync(path5.join(scriptsDir, "usage.sh"))) {
53837
+ return dir;
53838
+ }
53835
53839
  dir = path5.dirname(dir);
53836
53840
  }
53837
53841
  } catch {}
53838
53842
  }
53843
+ const home = process.env.HOME ?? "";
53844
+ const npxPaths = [
53845
+ path5.join(home, ".npm", "_npx"),
53846
+ path5.join(home, ".cache", "npm", "_npx"),
53847
+ path5.join(home, ".local", "share", "npm", "_npx")
53848
+ ];
53849
+ for (const npxBase of npxPaths) {
53850
+ if (fs6.existsSync(npxBase)) {
53851
+ try {
53852
+ const entries = fs6.readdirSync(npxBase);
53853
+ for (const entry of entries) {
53854
+ const pkgDir = path5.join(npxBase, entry, "node_modules", "ccstatusline-usage");
53855
+ if (fs6.existsSync(path5.join(pkgDir, "scripts", "usage.sh"))) {
53856
+ return pkgDir;
53857
+ }
53858
+ }
53859
+ } catch {}
53860
+ }
53861
+ }
53839
53862
  return "";
53840
53863
  }
53841
53864
  var PKG_DIR = getPackageDir();
@@ -53851,9 +53874,11 @@ class CustomCommandWidget {
53851
53874
  return "Custom Command";
53852
53875
  }
53853
53876
  getEditorDisplay(item) {
53854
- const cmd = item.commandPath ?? "No command";
53855
- const truncatedCmd = cmd.length > 20 ? `${cmd.substring(0, 17)}...` : cmd;
53856
- const displayText = `${this.getDisplayName()} (${truncatedCmd})`;
53877
+ const displayText = item.label ? item.label : (() => {
53878
+ const cmd = item.commandPath ?? "No command";
53879
+ const truncatedCmd = cmd.length > 20 ? `${cmd.substring(0, 17)}...` : cmd;
53880
+ return `${this.getDisplayName()} (${truncatedCmd})`;
53881
+ })();
53857
53882
  const modifiers = [];
53858
53883
  if (item.maxWidth) {
53859
53884
  modifiers.push(`max:${item.maxWidth}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccstatusline-usage",
3
- "version": "2.0.29",
3
+ "version": "2.0.30",
4
4
  "description": "A customizable status line formatter for Claude Code CLI",
5
5
  "module": "src/ccstatusline.ts",
6
6
  "type": "module",