(inputPath: string)
| 37 | } |
| 38 | |
| 39 | async 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 | |
| 57 | async function loadAgents(agentsDirs: string[]): Promise<ClaudeAgent[]> { |
| 58 | const files = await collectMarkdownFiles(agentsDirs) |
no test coverage detected