ruvector 0.1.66 → 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 +10 -1
- package/bin/cli.js +26 -6
- package/package.json +1 -1
- package/ruvector.db +0 -0
|
@@ -121,5 +121,14 @@
|
|
|
121
121
|
"rewardHistory": [
|
|
122
122
|
1
|
|
123
123
|
]
|
|
124
|
-
}
|
|
124
|
+
},
|
|
125
|
+
"stats": {
|
|
126
|
+
"total_patterns": 0,
|
|
127
|
+
"total_memories": 0,
|
|
128
|
+
"total_trajectories": 0,
|
|
129
|
+
"total_errors": 0,
|
|
130
|
+
"session_count": 1,
|
|
131
|
+
"last_session": 1767194227
|
|
132
|
+
},
|
|
133
|
+
"trajectories": []
|
|
125
134
|
}
|
package/bin/cli.js
CHANGED
|
@@ -2609,17 +2609,37 @@ class Intelligence {
|
|
|
2609
2609
|
}
|
|
2610
2610
|
|
|
2611
2611
|
sessionEnd() {
|
|
2612
|
-
|
|
2613
|
-
|
|
2612
|
+
// Ensure data structure exists with defaults
|
|
2613
|
+
if (!this.data) {
|
|
2614
|
+
this.data = { patterns: {}, memories: [], trajectories: [], errors: [], agents: {}, edges: [], stats: {} };
|
|
2615
|
+
}
|
|
2616
|
+
if (!this.data.stats) {
|
|
2617
|
+
this.data.stats = { total_patterns: 0, total_memories: 0, total_trajectories: 0, total_errors: 0, session_count: 0, last_session: 0 };
|
|
2618
|
+
}
|
|
2619
|
+
if (!this.data.trajectories) {
|
|
2620
|
+
this.data.trajectories = [];
|
|
2621
|
+
}
|
|
2622
|
+
|
|
2623
|
+
const lastSession = this.data.stats.last_session || 0;
|
|
2624
|
+
const duration = this.now() - (this.sessionStartTime || lastSession);
|
|
2625
|
+
const actions = this.data.trajectories.filter(t => t && t.timestamp >= lastSession).length;
|
|
2614
2626
|
|
|
2615
2627
|
// Force learning cycle (only if engine already initialized)
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
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
|
|
2619
2635
|
}
|
|
2620
2636
|
|
|
2621
2637
|
// Save all data
|
|
2622
|
-
|
|
2638
|
+
try {
|
|
2639
|
+
this.save();
|
|
2640
|
+
} catch (e) {
|
|
2641
|
+
// Ignore save errors on session end
|
|
2642
|
+
}
|
|
2623
2643
|
|
|
2624
2644
|
return { duration, actions };
|
|
2625
2645
|
}
|
package/package.json
CHANGED
package/ruvector.db
CHANGED
|
Binary file
|