ccstatusline 2.0.16 → 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 +26 -18
- 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;
|
|
@@ -59060,23 +59060,31 @@ function findMostRecentBlockStartTime(rootDir, sessionDurationHours = 5) {
|
|
|
59060
59060
|
if (!mostRecentTimestamp || !continuousWorkStart) {
|
|
59061
59061
|
return null;
|
|
59062
59062
|
}
|
|
59063
|
-
const
|
|
59064
|
-
const
|
|
59065
|
-
let
|
|
59066
|
-
|
|
59067
|
-
|
|
59068
|
-
|
|
59069
|
-
|
|
59070
|
-
|
|
59071
|
-
|
|
59072
|
-
|
|
59073
|
-
|
|
59074
|
-
|
|
59075
|
-
|
|
59076
|
-
|
|
59077
|
-
|
|
59078
|
-
|
|
59079
|
-
|
|
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;
|
|
59080
59088
|
}
|
|
59081
59089
|
function getAllTimestampsFromFile(filePath) {
|
|
59082
59090
|
const timestamps = [];
|