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

Function resolveInclude

src/memory/loader.ts:39–43  ·  view source on GitHub ↗

Resolve an @include path relative to the including file's directory.

(ref: string, baseDir: string)

Source from the content-addressed store, hash-verified

37
38/** Resolve an @include path relative to the including file's directory. */
39function resolveInclude(ref: string, baseDir: string): string {
40 if (ref.startsWith("~/")) return path.join(os.homedir(), ref.slice(2))
41 if (path.isAbsolute(ref)) return ref
42 return path.resolve(baseDir, ref)
43}
44
45/**
46 * Extract `@path` references from leaf text (not inside code spans/blocks).

Callers 1

extractIncludesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected