diff --git a/src/vfs/PathResolver.ts b/src/vfs/PathResolver.ts index 3b49b1f1..4d8d3de5 100644 --- a/src/vfs/PathResolver.ts +++ b/src/vfs/PathResolver.ts @@ -232,7 +232,7 @@ export class PathResolver { includeVFS: true // v4.5.1: Required to see VFS relationships }) - const validChildren: VFSEntity[] = [] + const validChildren: VFSEntity[]= [] const childNames = new Set() // Fetch all child entities via relationships diff --git a/src/vfs/VirtualFileSystem.ts b/src/vfs/VirtualFileSystem.ts index 4069b94f..b127a529 100644 --- a/src/vfs/VirtualFileSystem.ts +++ b/src/vfs/VirtualFileSystem.ts @@ -177,9 +177,10 @@ export class VirtualFileSystem implements IVirtualFileSystem { console.warn(`⚠️ Found ${existing.length} root entities! Using first one, consider cleanup.`) // Sort by creation time - use oldest root (most likely to have children) + // v4.5.2: FIX - createdAt is at entity level, not metadata level! existing.sort((a, b) => { - const aTime = a.metadata?.createdAt || a.metadata?.modified || 0 - const bTime = b.metadata?.createdAt || b.metadata?.modified || 0 + const aTime = (a as any).createdAt || a.metadata?.modified || 0 + const bTime = (b as any).createdAt || b.metadata?.modified || 0 return aTime - bTime }) }