MCPcopy
hub / github.com/EveryInc/compound-engineering-plugin / resolveClaudeRoot

Function resolveClaudeRoot

src/parsers/claude.ts:39–55  ·  view source on GitHub ↗
(inputPath: string)

Source from the content-addressed store, hash-verified

37}
38
39async function resolveClaudeRoot(inputPath: string): Promise<string> {
40 const absolute = path.resolve(inputPath)
41 const manifestAtPath = path.join(absolute, PLUGIN_MANIFEST)
42 if (await pathExists(manifestAtPath)) {
43 return absolute
44 }
45
46 if (absolute.endsWith(PLUGIN_MANIFEST)) {
47 return path.dirname(path.dirname(absolute))
48 }
49
50 if (absolute.endsWith("plugin.json")) {
51 return path.dirname(path.dirname(absolute))
52 }
53
54 throw new Error(`Could not find ${PLUGIN_MANIFEST} under ${inputPath}`)
55}
56
57async function loadAgents(agentsDirs: string[]): Promise<ClaudeAgent[]> {
58 const files = await collectMarkdownFiles(agentsDirs)

Callers 1

loadClaudePluginFunction · 0.85

Calls 1

pathExistsFunction · 0.90

Tested by

no test coverage detected