@dreamorosi/agent-timekeeper-claude-code 0.2.1 → 0.2.2
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/.claude-plugin/plugin.json +1 -1
- package/hooks/register.js +17 -4
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-timekeeper",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Claude Code plugin for Agent Timekeeper: records Sessions, Runs, tool calls and Interactions as Signals, and uploads them to your own endpoint",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Andrea Amorosi"
|
package/hooks/register.js
CHANGED
|
@@ -358,6 +358,8 @@ var createUploaderCore = (host, options) => {
|
|
|
358
358
|
let pid = 0;
|
|
359
359
|
let quarantined = 0;
|
|
360
360
|
let dropped = 0;
|
|
361
|
+
let quarantinedSinceWrite = 0;
|
|
362
|
+
let droppedSinceWrite = 0;
|
|
361
363
|
let lastSuccessAt;
|
|
362
364
|
let lastProblem;
|
|
363
365
|
let config2;
|
|
@@ -418,7 +420,7 @@ var createUploaderCore = (host, options) => {
|
|
|
418
420
|
`${lines.join("\n")}
|
|
419
421
|
`
|
|
420
422
|
);
|
|
421
|
-
|
|
423
|
+
quarantinedSinceWrite += lines.length;
|
|
422
424
|
return {
|
|
423
425
|
kind: "invalid",
|
|
424
426
|
message: `${lines.length} Signals were ${reason} and kept in ${quarantineDirectory}: update the producer, then inspect or delete them`
|
|
@@ -451,7 +453,7 @@ var createUploaderCore = (host, options) => {
|
|
|
451
453
|
continue;
|
|
452
454
|
}
|
|
453
455
|
total -= segment.size;
|
|
454
|
-
|
|
456
|
+
droppedSinceWrite += lines;
|
|
455
457
|
}
|
|
456
458
|
}
|
|
457
459
|
function* split(base, lines, queue2) {
|
|
@@ -568,7 +570,14 @@ var createUploaderCore = (host, options) => {
|
|
|
568
570
|
}
|
|
569
571
|
return problem ? { outcome: "done", problem } : { outcome: "done" };
|
|
570
572
|
}
|
|
573
|
+
const latest = (a, b) => a === void 0 ? b : b === void 0 || a >= b ? a : b;
|
|
571
574
|
function* snapshot() {
|
|
575
|
+
const written = yield* readStatusTask(directory);
|
|
576
|
+
if (written) {
|
|
577
|
+
quarantined = Math.max(quarantined, written.quarantined);
|
|
578
|
+
dropped = Math.max(dropped, written.dropped);
|
|
579
|
+
lastSuccessAt = latest(lastSuccessAt, written.lastSuccessAt);
|
|
580
|
+
}
|
|
572
581
|
const segments = yield* listSegments(directory);
|
|
573
582
|
const status = {
|
|
574
583
|
updatedAt: now().toISOString(),
|
|
@@ -576,8 +585,8 @@ var createUploaderCore = (host, options) => {
|
|
|
576
585
|
pendingSignals: yield* linesOf(segments),
|
|
577
586
|
spoolBytes: segments.reduce((sum, segment) => sum + segment.size, 0),
|
|
578
587
|
paused,
|
|
579
|
-
quarantined,
|
|
580
|
-
dropped
|
|
588
|
+
quarantined: quarantined + quarantinedSinceWrite,
|
|
589
|
+
dropped: dropped + droppedSinceWrite
|
|
581
590
|
};
|
|
582
591
|
if (config2) {
|
|
583
592
|
status.machineId = config2.machineId;
|
|
@@ -593,6 +602,10 @@ var createUploaderCore = (host, options) => {
|
|
|
593
602
|
function* writeStatus() {
|
|
594
603
|
try {
|
|
595
604
|
yield* writeAtomically(path(STATUS_FILE), serializeStatus(current));
|
|
605
|
+
quarantined = current.quarantined;
|
|
606
|
+
dropped = current.dropped;
|
|
607
|
+
quarantinedSinceWrite = 0;
|
|
608
|
+
droppedSinceWrite = 0;
|
|
596
609
|
} catch {
|
|
597
610
|
}
|
|
598
611
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dreamorosi/agent-timekeeper-claude-code",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Claude Code plugin for Agent Timekeeper: records Sessions, Runs, tool calls and Interactions as Signals, and uploads them to your own endpoint",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|