MCPcopy Create free account
hub / github.com/MatterAIOrg/OrbCode / ancestorDirs

Function ancestorDirs

src/memory/loader.ts:108–119  ·  view source on GitHub ↗

Walk from cwd up to root, collecting directories (root last).

(cwd: string)

Source from the content-addressed store, hash-verified

106
107/** Walk from cwd up to root, collecting directories (root last). */
108function ancestorDirs(cwd: string): string[] {
109 const dirs: string[] = []
110 let current = path.resolve(cwd)
111 const root = path.parse(current).root
112 while (current !== root) {
113 dirs.push(current)
114 const parent = path.dirname(current)
115 if (parent === current) break
116 current = parent
117 }
118 return dirs
119}
120
121/**
122 * Load all AGENTS.md memory files, in precedence order (lowest first). The

Callers 1

loadMemoryFilesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected