ruvector 0.1.67 → 0.1.68
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/.ruvector/intelligence.json +4 -3
- package/bin/cli.js +21 -6
- package/package.json +1 -1
- package/ruvector.db +0 -0
package/bin/cli.js
CHANGED
|
@@ -2609,22 +2609,37 @@ class Intelligence {
|
|
|
2609
2609
|
}
|
|
2610
2610
|
|
|
2611
2611
|
sessionEnd() {
|
|
2612
|
-
// Ensure
|
|
2612
|
+
// Ensure data structure exists with defaults
|
|
2613
|
+
if (!this.data) {
|
|
2614
|
+
this.data = { patterns: {}, memories: [], trajectories: [], errors: [], agents: {}, edges: [], stats: {} };
|
|
2615
|
+
}
|
|
2613
2616
|
if (!this.data.stats) {
|
|
2614
2617
|
this.data.stats = { total_patterns: 0, total_memories: 0, total_trajectories: 0, total_errors: 0, session_count: 0, last_session: 0 };
|
|
2615
2618
|
}
|
|
2619
|
+
if (!this.data.trajectories) {
|
|
2620
|
+
this.data.trajectories = [];
|
|
2621
|
+
}
|
|
2622
|
+
|
|
2616
2623
|
const lastSession = this.data.stats.last_session || 0;
|
|
2617
2624
|
const duration = this.now() - (this.sessionStartTime || lastSession);
|
|
2618
|
-
const actions =
|
|
2625
|
+
const actions = this.data.trajectories.filter(t => t && t.timestamp >= lastSession).length;
|
|
2619
2626
|
|
|
2620
2627
|
// Force learning cycle (only if engine already initialized)
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
eng
|
|
2628
|
+
try {
|
|
2629
|
+
const eng = this.getEngineIfReady();
|
|
2630
|
+
if (eng) {
|
|
2631
|
+
eng.forceLearn();
|
|
2632
|
+
}
|
|
2633
|
+
} catch (e) {
|
|
2634
|
+
// Ignore engine errors on session end
|
|
2624
2635
|
}
|
|
2625
2636
|
|
|
2626
2637
|
// Save all data
|
|
2627
|
-
|
|
2638
|
+
try {
|
|
2639
|
+
this.save();
|
|
2640
|
+
} catch (e) {
|
|
2641
|
+
// Ignore save errors on session end
|
|
2642
|
+
}
|
|
2628
2643
|
|
|
2629
2644
|
return { duration, actions };
|
|
2630
2645
|
}
|
package/package.json
CHANGED
package/ruvector.db
CHANGED
|
Binary file
|