(repoRoot: string, pluginName: string)
| 303 | } |
| 304 | |
| 305 | async function resolvePluginRoot(repoRoot: string, pluginName: string): Promise<string | null> { |
| 306 | const rootManifest = path.join(repoRoot, ".claude-plugin", "plugin.json") |
| 307 | if (await pathExists(rootManifest)) { |
| 308 | try { |
| 309 | const raw = await fs.readFile(rootManifest, "utf8") |
| 310 | const manifest = JSON.parse(raw) as { name?: string } |
| 311 | if (manifest.name === pluginName) return repoRoot |
| 312 | } catch { |
| 313 | // Fall through to the legacy multi-plugin layout. |
| 314 | } |
| 315 | } |
| 316 | |
| 317 | const legacyPluginPath = path.join(repoRoot, "plugins", pluginName) |
| 318 | const legacyManifest = path.join(legacyPluginPath, ".claude-plugin", "plugin.json") |
| 319 | if (await pathExists(legacyManifest)) return legacyPluginPath |
| 320 | |
| 321 | return null |
| 322 | } |
| 323 | |
| 324 | function resolveGitHubSource(): string { |
| 325 | const override = process.env.COMPOUND_PLUGIN_GITHUB_SOURCE |
no test coverage detected