instar 1.2.31 → 1.2.32

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.
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAkQH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAiqDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAm9KtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAkQH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAiqDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA++KtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
@@ -3722,7 +3722,7 @@ export async function startServer(options) {
3722
3722
  // Creates mid-session mini-digests via LLM, and session syntheses on completion.
3723
3723
  let activitySentinel;
3724
3724
  if (sharedIntelligence) {
3725
- const { SessionActivitySentinel } = await import('../monitoring/SessionActivitySentinel.js');
3725
+ const { SessionActivitySentinel, resolveSentinelScanIntervalMs } = await import('../monitoring/SessionActivitySentinel.js');
3726
3726
  activitySentinel = new SessionActivitySentinel({
3727
3727
  stateDir: config.stateDir,
3728
3728
  intelligence: sharedIntelligence,
@@ -3753,6 +3753,35 @@ export async function startServer(options) {
3753
3753
  console.error(`[ActivitySentinel] Synthesis failed for ${session.name}: ${err instanceof Error ? err.message : err}`);
3754
3754
  });
3755
3755
  });
3756
+ // Periodic mid-session scan. Without this, the sentinel only digests on
3757
+ // sessionComplete — so a long-running Telegram session that never cleanly
3758
+ // ends (compaction, multi-day topic, machine restart) accumulates hours
3759
+ // of activity that is never digested, and the entities within it never
3760
+ // reach SemanticMemory. The periodic scan digests in-flight activity on a
3761
+ // cadence so the knowledge graph grows throughout long sessions, not just
3762
+ // at the end. scan() is internally idempotent (hash-keyed digests),
3763
+ // skips dormant sessions, and enforces a minimum-activity threshold, so a
3764
+ // frequent cadence is safe.
3765
+ const scanIntervalMs = resolveSentinelScanIntervalMs(config.monitoring.episodicSentinel);
3766
+ if (scanIntervalMs !== null) {
3767
+ const scanMinutes = Math.round(scanIntervalMs / 60_000);
3768
+ const activityScanTimer = setInterval(() => {
3769
+ // Only the awake machine scans — mirrors the scheduler gating so
3770
+ // standby machines in a multi-machine setup don't double-digest.
3771
+ if (coordinator.enabled && !coordinator.isAwake)
3772
+ return;
3773
+ activitySentinel.scan().then((report) => {
3774
+ if (report.digestsCreated > 0) {
3775
+ console.log(`[ActivitySentinel] Periodic scan: ${report.digestsCreated} digest(s) across ${report.sessionsScanned} session(s)`);
3776
+ }
3777
+ }).catch((err) => {
3778
+ console.error(`[ActivitySentinel] Periodic scan failed: ${err instanceof Error ? err.message : err}`);
3779
+ });
3780
+ }, scanIntervalMs);
3781
+ if (activityScanTimer.unref)
3782
+ activityScanTimer.unref();
3783
+ console.log(pc.dim(` Episodic memory sentinel: periodic scan every ${scanMinutes}min`));
3784
+ }
3756
3785
  const semStatus = semanticMemory ? 'with entity extraction' : 'digests only (no SemanticMemory)';
3757
3786
  console.log(pc.green(` Episodic memory sentinel enabled (LLM-powered digestion, ${semStatus})`));
3758
3787
  }