MCPcopy Create free account
hub / github.com/Noumena-Network/code / findProjectMemoryBoundary

Function findProjectMemoryBoundary

src/utils/agentsmd.ts:82–101  ·  view source on GitHub ↗
(startPath: string)

Source from the content-addressed store, hash-verified

80}
81
82function findProjectMemoryBoundary(startPath: string): string | null {
83 const fs = getFsImplementation()
84 let currentDir = safeResolvePath(fs, startPath).resolvedPath
85
86 while (true) {
87 if (
88 PROJECT_MEMORY_BOUNDARY_MARKERS.some(marker =>
89 fs.existsSync(join(currentDir, marker)),
90 )
91 ) {
92 return currentDir
93 }
94
95 const parentDir = dirname(currentDir)
96 if (parentDir === currentDir) {
97 return null
98 }
99 currentDir = parentDir
100 }
101}
102
103function pathInWorkingPath(child: string, parent: string): boolean {
104 const relativePath = relativeSafe(parent, child)

Callers 1

agentsmd.tsFile · 0.70

Calls 2

getFsImplementationFunction · 0.85
safeResolvePathFunction · 0.85

Tested by

no test coverage detected