ccstatusline 2.0.18 → 2.0.19
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 +29 -10
- package/package.json +1 -1
package/dist/ccstatusline.js
CHANGED
|
@@ -51374,7 +51374,7 @@ import { execSync as execSync3 } from "child_process";
|
|
|
51374
51374
|
import * as fs5 from "fs";
|
|
51375
51375
|
import * as path4 from "path";
|
|
51376
51376
|
var __dirname = "/Users/sirmalloc/Projects/Personal/ccstatusline/src/utils";
|
|
51377
|
-
var PACKAGE_VERSION = "2.0.
|
|
51377
|
+
var PACKAGE_VERSION = "2.0.19";
|
|
51378
51378
|
function getPackageVersion() {
|
|
51379
51379
|
if (/^\d+\.\d+\.\d+/.test(PACKAGE_VERSION)) {
|
|
51380
51380
|
return PACKAGE_VERSION;
|
|
@@ -58977,15 +58977,31 @@ function getBlockMetrics(transcriptPath) {
|
|
|
58977
58977
|
if (!transcriptPath || typeof transcriptPath !== "string") {
|
|
58978
58978
|
return null;
|
|
58979
58979
|
}
|
|
58980
|
-
let currentPath = path6.dirname(transcriptPath);
|
|
58981
58980
|
let claudePath = null;
|
|
58982
|
-
|
|
58983
|
-
const
|
|
58984
|
-
if (
|
|
58985
|
-
claudePath =
|
|
58986
|
-
|
|
58981
|
+
if (process.platform === "win32") {
|
|
58982
|
+
const homeDir = process.env.USERPROFILE ?? process.env.HOME;
|
|
58983
|
+
if (homeDir) {
|
|
58984
|
+
claudePath = path6.join(homeDir, ".claude");
|
|
58985
|
+
if (!fs6.existsSync(claudePath)) {
|
|
58986
|
+
return null;
|
|
58987
|
+
}
|
|
58988
|
+
}
|
|
58989
|
+
} else {
|
|
58990
|
+
let currentPath = path6.dirname(transcriptPath);
|
|
58991
|
+
const visitedPaths = new Set;
|
|
58992
|
+
while (currentPath && !visitedPaths.has(currentPath)) {
|
|
58993
|
+
visitedPaths.add(currentPath);
|
|
58994
|
+
const baseName = path6.basename(currentPath);
|
|
58995
|
+
if (baseName === ".claude") {
|
|
58996
|
+
claudePath = currentPath;
|
|
58997
|
+
break;
|
|
58998
|
+
}
|
|
58999
|
+
const parentPath = path6.dirname(currentPath);
|
|
59000
|
+
if (parentPath === currentPath) {
|
|
59001
|
+
break;
|
|
59002
|
+
}
|
|
59003
|
+
currentPath = parentPath;
|
|
58987
59004
|
}
|
|
58988
|
-
currentPath = path6.dirname(currentPath);
|
|
58989
59005
|
}
|
|
58990
59006
|
if (!claudePath)
|
|
58991
59007
|
return null;
|
|
@@ -58998,8 +59014,11 @@ function getBlockMetrics(transcriptPath) {
|
|
|
58998
59014
|
function findMostRecentBlockStartTime(rootDir, sessionDurationHours = 5) {
|
|
58999
59015
|
const sessionDurationMs = sessionDurationHours * 60 * 60 * 1000;
|
|
59000
59016
|
const now = new Date;
|
|
59001
|
-
const pattern = path6.join(rootDir, "projects", "**", "*.jsonl")
|
|
59002
|
-
const files = globSync([pattern]
|
|
59017
|
+
const pattern = path6.posix.join(rootDir.replace(/\\/g, "/"), "projects", "**", "*.jsonl");
|
|
59018
|
+
const files = globSync([pattern], {
|
|
59019
|
+
absolute: true,
|
|
59020
|
+
cwd: rootDir
|
|
59021
|
+
});
|
|
59003
59022
|
if (files.length === 0)
|
|
59004
59023
|
return null;
|
|
59005
59024
|
const filesWithStats = files.map((file2) => {
|