@matthewfl/pi-contemplator 0.0.5 → 0.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matthewfl/pi-contemplator",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "A Pi extension that keeps long-running agentic sessions on track with background memory, contemplation, and structural review.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -463,7 +463,15 @@ export class Contemplator {
463
463
  debugLog("contemplator.flush_skipped", { reason: this.running ? "already_running" : "no_pending_update" });
464
464
  return;
465
465
  }
466
+ // Checkpoint a live main-agent interval before taking the activity snapshot.
467
+ // persistAgentActivity restarts the running clock at Date.now(), so a later
468
+ // turn/agent checkpoint records only the remainder.
469
+ this.persistAgentActivity(ctx);
466
470
  const update = this.pending;
471
+ const branchEntriesAtStart = ctx.sessionManager.getBranch() as Entry[];
472
+ update.mainAgentOutputTokens = assistantOutputTokens(branchEntriesAtStart);
473
+ update.mainAgentToolCalls = assistantToolCallCount(branchEntriesAtStart);
474
+ update.mainAgentActiveTimeMs = agentActiveTimeMs(branchEntriesAtStart);
467
475
  this.pending = undefined;
468
476
  const turnsBeforeRun = this.turnsSinceRun;
469
477
  const sessionGeneration = this.sessionGeneration;