ccstatusline 2.0.17 → 2.0.18
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 +27 -20
- 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.18";
|
|
51378
51378
|
function getPackageVersion() {
|
|
51379
51379
|
if (/^\d+\.\d+\.\d+/.test(PACKAGE_VERSION)) {
|
|
51380
51380
|
return PACKAGE_VERSION;
|
|
@@ -58997,7 +58997,6 @@ function getBlockMetrics(transcriptPath) {
|
|
|
58997
58997
|
}
|
|
58998
58998
|
function findMostRecentBlockStartTime(rootDir, sessionDurationHours = 5) {
|
|
58999
58999
|
const sessionDurationMs = sessionDurationHours * 60 * 60 * 1000;
|
|
59000
|
-
const sessionGapThresholdMs = Math.min(sessionDurationMs, 60 * 60 * 1000);
|
|
59001
59000
|
const now = new Date;
|
|
59002
59001
|
const pattern = path6.join(rootDir, "projects", "**", "*.jsonl").replace(/\\/g, "/");
|
|
59003
59002
|
const files = globSync([pattern]);
|
|
@@ -59045,7 +59044,7 @@ function findMostRecentBlockStartTime(rootDir, sessionDurationHours = 5) {
|
|
|
59045
59044
|
if (!currentTimestamp || !previousTimestamp)
|
|
59046
59045
|
continue;
|
|
59047
59046
|
const gap = previousTimestamp.getTime() - currentTimestamp.getTime();
|
|
59048
|
-
if (gap >=
|
|
59047
|
+
if (gap >= sessionDurationMs) {
|
|
59049
59048
|
foundSessionGap = true;
|
|
59050
59049
|
break;
|
|
59051
59050
|
}
|
|
@@ -59061,23 +59060,31 @@ function findMostRecentBlockStartTime(rootDir, sessionDurationHours = 5) {
|
|
|
59061
59060
|
if (!mostRecentTimestamp || !continuousWorkStart) {
|
|
59062
59061
|
return null;
|
|
59063
59062
|
}
|
|
59064
|
-
const
|
|
59065
|
-
const
|
|
59066
|
-
let
|
|
59067
|
-
|
|
59068
|
-
|
|
59069
|
-
|
|
59070
|
-
|
|
59071
|
-
|
|
59072
|
-
|
|
59073
|
-
|
|
59074
|
-
|
|
59075
|
-
|
|
59076
|
-
|
|
59077
|
-
|
|
59078
|
-
|
|
59079
|
-
|
|
59080
|
-
|
|
59063
|
+
const blocks = [];
|
|
59064
|
+
const sortedTimestamps = timestamps.slice().sort((a, b) => a.getTime() - b.getTime());
|
|
59065
|
+
let currentBlockStart = null;
|
|
59066
|
+
let currentBlockEnd = null;
|
|
59067
|
+
for (const timestamp of sortedTimestamps) {
|
|
59068
|
+
if (timestamp.getTime() < continuousWorkStart.getTime())
|
|
59069
|
+
continue;
|
|
59070
|
+
if (!currentBlockStart || currentBlockEnd && timestamp.getTime() > currentBlockEnd.getTime()) {
|
|
59071
|
+
currentBlockStart = floorToHour(timestamp);
|
|
59072
|
+
currentBlockEnd = new Date(currentBlockStart.getTime() + sessionDurationMs);
|
|
59073
|
+
blocks.push({ start: currentBlockStart, end: currentBlockEnd });
|
|
59074
|
+
}
|
|
59075
|
+
}
|
|
59076
|
+
for (const block of blocks) {
|
|
59077
|
+
if (now.getTime() >= block.start.getTime() && now.getTime() <= block.end.getTime()) {
|
|
59078
|
+
const hasActivity = timestamps.some((t) => t.getTime() >= block.start.getTime() && t.getTime() <= block.end.getTime());
|
|
59079
|
+
if (hasActivity) {
|
|
59080
|
+
return {
|
|
59081
|
+
startTime: block.start,
|
|
59082
|
+
lastActivity: mostRecentTimestamp
|
|
59083
|
+
};
|
|
59084
|
+
}
|
|
59085
|
+
}
|
|
59086
|
+
}
|
|
59087
|
+
return null;
|
|
59081
59088
|
}
|
|
59082
59089
|
function getAllTimestampsFromFile(filePath) {
|
|
59083
59090
|
const timestamps = [];
|