@soulcraft/brainy 4.5.1 → 4.5.3

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.
@@ -106,9 +106,11 @@ export class VirtualFileSystem {
106
106
  if (existing.length > 1) {
107
107
  console.warn(`⚠️ Found ${existing.length} root entities! Using first one, consider cleanup.`);
108
108
  // Sort by creation time - use oldest root (most likely to have children)
109
+ // v4.5.3: FIX - createdAt is in entity object, not at Result level!
110
+ // brain.find() returns Result[], which has entity.createdAt, not top-level createdAt
109
111
  existing.sort((a, b) => {
110
- const aTime = a.metadata?.createdAt || a.metadata?.modified || 0;
111
- const bTime = b.metadata?.createdAt || b.metadata?.modified || 0;
112
+ const aTime = a.entity?.createdAt || a.metadata?.modified || 0;
113
+ const bTime = b.entity?.createdAt || b.metadata?.modified || 0;
112
114
  return aTime - bTime;
113
115
  });
114
116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soulcraft/brainy",
3
- "version": "4.5.1",
3
+ "version": "4.5.3",
4
4
  "description": "Universal Knowledge Protocol™ - World's first Triple Intelligence database unifying vector, graph, and document search in one API. 31 nouns × 40 verbs for infinite expressiveness.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",