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.
@@ -127,7 +127,8 @@
127
127
  "total_memories": 0,
128
128
  "total_trajectories": 0,
129
129
  "total_errors": 0,
130
- "session_count": 0,
131
- "last_session": 0
132
- }
130
+ "session_count": 1,
131
+ "last_session": 1767194227
132
+ },
133
+ "trajectories": []
133
134
  }
package/bin/cli.js CHANGED
@@ -2609,22 +2609,37 @@ class Intelligence {
2609
2609
  }
2610
2610
 
2611
2611
  sessionEnd() {
2612
- // Ensure stats exists with defaults
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 = (this.data.trajectories || []).filter(t => t.timestamp >= lastSession).length;
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
- const eng = this.getEngineIfReady();
2622
- if (eng) {
2623
- eng.forceLearn();
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
- this.save();
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ruvector",
3
- "version": "0.1.67",
3
+ "version": "0.1.68",
4
4
  "description": "High-performance vector database for Node.js with automatic native/WASM fallback",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/ruvector.db CHANGED
Binary file