@soulcraft/brainy 4.5.0 → 4.5.1
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/dist/brainy.js
CHANGED
|
@@ -846,6 +846,13 @@ export class Brainy {
|
|
|
846
846
|
if (params.service) {
|
|
847
847
|
filter.service = params.service;
|
|
848
848
|
}
|
|
849
|
+
// v4.5.1: Exclude VFS relationships by default (same pattern as brain.find())
|
|
850
|
+
// VFS relationships have metadata.isVFS = true
|
|
851
|
+
// Only include VFS relationships if explicitly requested
|
|
852
|
+
if (params.includeVFS !== true) {
|
|
853
|
+
filter.metadata = filter.metadata || {};
|
|
854
|
+
filter.metadata.isVFS = { notEquals: true };
|
|
855
|
+
}
|
|
849
856
|
// Fetch from storage with pagination at storage layer (efficient!)
|
|
850
857
|
const result = await this.storage.getVerbs({
|
|
851
858
|
pagination: {
|
|
@@ -266,6 +266,16 @@ export interface GetRelationsParams {
|
|
|
266
266
|
* Only return relationships belonging to this service.
|
|
267
267
|
*/
|
|
268
268
|
service?: string;
|
|
269
|
+
/**
|
|
270
|
+
* Include VFS relationships (v4.5.1)
|
|
271
|
+
*
|
|
272
|
+
* By default, getRelations() excludes VFS relationships (since v4.4.0).
|
|
273
|
+
* Set this to true when you need to traverse VFS structure.
|
|
274
|
+
*
|
|
275
|
+
* @default false
|
|
276
|
+
* @since v4.5.1
|
|
277
|
+
*/
|
|
278
|
+
includeVFS?: boolean;
|
|
269
279
|
}
|
|
270
280
|
/**
|
|
271
281
|
* Batch add parameters
|
package/dist/vfs/PathResolver.js
CHANGED
|
@@ -135,7 +135,8 @@ export class PathResolver {
|
|
|
135
135
|
// Get all relationships where parentId contains other entities
|
|
136
136
|
const relations = await this.brain.getRelations({
|
|
137
137
|
from: parentId,
|
|
138
|
-
type: VerbType.Contains
|
|
138
|
+
type: VerbType.Contains,
|
|
139
|
+
includeVFS: true // v4.5.1: Required to see VFS relationships
|
|
139
140
|
});
|
|
140
141
|
// Find the child with matching name
|
|
141
142
|
for (const relation of relations) {
|
|
@@ -159,7 +160,8 @@ export class PathResolver {
|
|
|
159
160
|
// Production-ready: Use graph relationships (VFS creates these in mkdir/writeFile)
|
|
160
161
|
const relations = await this.brain.getRelations({
|
|
161
162
|
from: dirId,
|
|
162
|
-
type: VerbType.Contains
|
|
163
|
+
type: VerbType.Contains,
|
|
164
|
+
includeVFS: true // v4.5.1: Required to see VFS relationships
|
|
163
165
|
});
|
|
164
166
|
const validChildren = [];
|
|
165
167
|
const childNames = new Set();
|
|
@@ -330,7 +330,8 @@ export class VirtualFileSystem {
|
|
|
330
330
|
await this.brain.relate({
|
|
331
331
|
from: parentId,
|
|
332
332
|
to: existingId,
|
|
333
|
-
type: VerbType.Contains
|
|
333
|
+
type: VerbType.Contains,
|
|
334
|
+
metadata: { isVFS: true } // v4.5.1: Mark as VFS relationship
|
|
334
335
|
});
|
|
335
336
|
}
|
|
336
337
|
}
|
|
@@ -347,7 +348,8 @@ export class VirtualFileSystem {
|
|
|
347
348
|
await this.brain.relate({
|
|
348
349
|
from: parentId,
|
|
349
350
|
to: entity,
|
|
350
|
-
type: VerbType.Contains
|
|
351
|
+
type: VerbType.Contains,
|
|
352
|
+
metadata: { isVFS: true } // v4.5.1: Mark as VFS relationship
|
|
351
353
|
});
|
|
352
354
|
// Update path resolver cache
|
|
353
355
|
await this.pathResolver.createPath(path, entity);
|
|
@@ -612,7 +614,8 @@ export class VirtualFileSystem {
|
|
|
612
614
|
await this.brain.relate({
|
|
613
615
|
from: parentId,
|
|
614
616
|
to: entity,
|
|
615
|
-
type: VerbType.Contains
|
|
617
|
+
type: VerbType.Contains,
|
|
618
|
+
metadata: { isVFS: true } // v4.5.1: Mark as VFS relationship
|
|
616
619
|
});
|
|
617
620
|
}
|
|
618
621
|
// Update path resolver cache
|
|
@@ -1410,7 +1413,12 @@ export class VirtualFileSystem {
|
|
|
1410
1413
|
// Add to new parent
|
|
1411
1414
|
if (newParentPath && newParentPath !== '/') {
|
|
1412
1415
|
const newParentId = await this.pathResolver.resolve(newParentPath);
|
|
1413
|
-
await this.brain.relate({
|
|
1416
|
+
await this.brain.relate({
|
|
1417
|
+
from: newParentId,
|
|
1418
|
+
to: entityId,
|
|
1419
|
+
type: VerbType.Contains,
|
|
1420
|
+
metadata: { isVFS: true } // v4.5.1: Mark as VFS relationship
|
|
1421
|
+
});
|
|
1414
1422
|
}
|
|
1415
1423
|
}
|
|
1416
1424
|
// Update the entity
|
|
@@ -1475,7 +1483,12 @@ export class VirtualFileSystem {
|
|
|
1475
1483
|
const parentPath = this.getParentPath(destPath);
|
|
1476
1484
|
if (parentPath && parentPath !== '/') {
|
|
1477
1485
|
const parentId = await this.pathResolver.resolve(parentPath);
|
|
1478
|
-
await this.brain.relate({
|
|
1486
|
+
await this.brain.relate({
|
|
1487
|
+
from: parentId,
|
|
1488
|
+
to: newEntity,
|
|
1489
|
+
type: VerbType.Contains,
|
|
1490
|
+
metadata: { isVFS: true } // v4.5.1: Mark as VFS relationship
|
|
1491
|
+
});
|
|
1479
1492
|
}
|
|
1480
1493
|
// Update path cache
|
|
1481
1494
|
await this.pathResolver.createPath(destPath, newEntity);
|
|
@@ -1562,7 +1575,8 @@ export class VirtualFileSystem {
|
|
|
1562
1575
|
await this.brain.relate({
|
|
1563
1576
|
from: parentId,
|
|
1564
1577
|
to: entity,
|
|
1565
|
-
type: VerbType.Contains
|
|
1578
|
+
type: VerbType.Contains,
|
|
1579
|
+
metadata: { isVFS: true } // v4.5.1: Mark as VFS relationship
|
|
1566
1580
|
});
|
|
1567
1581
|
// Update path resolver cache
|
|
1568
1582
|
await this.pathResolver.createPath(path, entity);
|
|
@@ -1732,7 +1746,8 @@ export class VirtualFileSystem {
|
|
|
1732
1746
|
await this.brain.relate({
|
|
1733
1747
|
from: fromEntityId,
|
|
1734
1748
|
to: toEntityId,
|
|
1735
|
-
type: type // Convert string to VerbType
|
|
1749
|
+
type: type, // Convert string to VerbType
|
|
1750
|
+
metadata: { isVFS: true } // v4.5.1: Mark as VFS relationship
|
|
1736
1751
|
});
|
|
1737
1752
|
// Invalidate caches for both paths
|
|
1738
1753
|
this.invalidateCaches(from);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soulcraft/brainy",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.1",
|
|
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",
|