ccstatusline 2.0.18 → 2.0.20

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.
@@ -39307,7 +39307,8 @@ async function isInstalled() {
39307
39307
  }
39308
39308
  function isBunxAvailable() {
39309
39309
  try {
39310
- execSync("which bunx", { stdio: "ignore" });
39310
+ const command = process.platform === "win32" ? "where bunx" : "which bunx";
39311
+ execSync(command, { stdio: "ignore" });
39311
39312
  return true;
39312
39313
  } catch {
39313
39314
  return false;
@@ -51374,7 +51375,7 @@ import { execSync as execSync3 } from "child_process";
51374
51375
  import * as fs5 from "fs";
51375
51376
  import * as path4 from "path";
51376
51377
  var __dirname = "/Users/sirmalloc/Projects/Personal/ccstatusline/src/utils";
51377
- var PACKAGE_VERSION = "2.0.18";
51378
+ var PACKAGE_VERSION = "2.0.20";
51378
51379
  function getPackageVersion() {
51379
51380
  if (/^\d+\.\d+\.\d+/.test(PACKAGE_VERSION)) {
51380
51381
  return PACKAGE_VERSION;
@@ -58953,7 +58954,7 @@ async function getTokenMetrics(transcriptPath) {
58953
58954
  outputTokens += data.message.usage.output_tokens || 0;
58954
58955
  cachedTokens += data.message.usage.cache_read_input_tokens ?? 0;
58955
58956
  cachedTokens += data.message.usage.cache_creation_input_tokens ?? 0;
58956
- if (data.isSidechain !== true && data.timestamp) {
58957
+ if (data.isSidechain !== true && data.timestamp && !data.isApiErrorMessage) {
58957
58958
  const entryTime = new Date(data.timestamp);
58958
58959
  if (!mostRecentTimestamp || entryTime > mostRecentTimestamp) {
58959
58960
  mostRecentTimestamp = entryTime;
@@ -58977,15 +58978,31 @@ function getBlockMetrics(transcriptPath) {
58977
58978
  if (!transcriptPath || typeof transcriptPath !== "string") {
58978
58979
  return null;
58979
58980
  }
58980
- let currentPath = path6.dirname(transcriptPath);
58981
58981
  let claudePath = null;
58982
- while (currentPath && currentPath !== path6.dirname(currentPath)) {
58983
- const baseName = path6.basename(currentPath);
58984
- if (baseName === ".claude") {
58985
- claudePath = currentPath;
58986
- break;
58982
+ if (process.platform === "win32") {
58983
+ const homeDir = process.env.USERPROFILE ?? process.env.HOME;
58984
+ if (homeDir) {
58985
+ claudePath = path6.join(homeDir, ".claude");
58986
+ if (!fs6.existsSync(claudePath)) {
58987
+ return null;
58988
+ }
58989
+ }
58990
+ } else {
58991
+ let currentPath = path6.dirname(transcriptPath);
58992
+ const visitedPaths = new Set;
58993
+ while (currentPath && !visitedPaths.has(currentPath)) {
58994
+ visitedPaths.add(currentPath);
58995
+ const baseName = path6.basename(currentPath);
58996
+ if (baseName === ".claude") {
58997
+ claudePath = currentPath;
58998
+ break;
58999
+ }
59000
+ const parentPath = path6.dirname(currentPath);
59001
+ if (parentPath === currentPath) {
59002
+ break;
59003
+ }
59004
+ currentPath = parentPath;
58987
59005
  }
58988
- currentPath = path6.dirname(currentPath);
58989
59006
  }
58990
59007
  if (!claudePath)
58991
59008
  return null;
@@ -58998,8 +59015,11 @@ function getBlockMetrics(transcriptPath) {
58998
59015
  function findMostRecentBlockStartTime(rootDir, sessionDurationHours = 5) {
58999
59016
  const sessionDurationMs = sessionDurationHours * 60 * 60 * 1000;
59000
59017
  const now = new Date;
59001
- const pattern = path6.join(rootDir, "projects", "**", "*.jsonl").replace(/\\/g, "/");
59002
- const files = globSync([pattern]);
59018
+ const pattern = path6.posix.join(rootDir.replace(/\\/g, "/"), "projects", "**", "*.jsonl");
59019
+ const files = globSync([pattern], {
59020
+ absolute: true,
59021
+ cwd: rootDir
59022
+ });
59003
59023
  if (files.length === 0)
59004
59024
  return null;
59005
59025
  const filesWithStats = files.map((file2) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccstatusline",
3
- "version": "2.0.18",
3
+ "version": "2.0.20",
4
4
  "description": "A customizable status line formatter for Claude Code CLI",
5
5
  "module": "src/ccstatusline.ts",
6
6
  "type": "module",
@@ -12,7 +12,7 @@
12
12
  ],
13
13
  "scripts": {
14
14
  "start": "bun run src/ccstatusline.ts",
15
- "build": "rm -rf dist/* && bun build src/ccstatusline.ts --target=node --outfile=dist/ccstatusline.js --target-version=14",
15
+ "build": "rm -rf dist/* ; bun build src/ccstatusline.ts --target=node --outfile=dist/ccstatusline.js --target-version=14",
16
16
  "postbuild": "bun run scripts/replace-version.ts",
17
17
  "example": "cat scripts/payload.example.json | bun start",
18
18
  "prepublishOnly": "bun run build",
@@ -70,4 +70,4 @@
70
70
  "patchedDependencies": {
71
71
  "ink@6.2.0": "patches/ink@6.2.0.patch"
72
72
  }
73
- }
73
+ }