(inputPath: string)
| 14 | const PLUGIN_MANIFEST = path.join(".claude-plugin", "plugin.json") |
| 15 | |
| 16 | export async function loadClaudePlugin(inputPath: string): Promise<ClaudePlugin> { |
| 17 | const root = await resolveClaudeRoot(inputPath) |
| 18 | const manifestPath = path.join(root, PLUGIN_MANIFEST) |
| 19 | const manifest = await readJson<ClaudeManifest>(manifestPath) |
| 20 | |
| 21 | const agents = await loadAgents(resolveComponentDirs(root, "agents", manifest.agents)) |
| 22 | const commands = await loadCommands(resolveComponentDirs(root, "commands", manifest.commands)) |
| 23 | const skills = await loadSkills(resolveComponentDirs(root, "skills", manifest.skills)) |
| 24 | const hooks = await loadHooks(root, manifest.hooks) |
| 25 | |
| 26 | const mcpServers = await loadMcpServers(root, manifest) |
| 27 | |
| 28 | return { |
| 29 | root, |
| 30 | manifest, |
| 31 | agents, |
| 32 | commands, |
| 33 | skills, |
| 34 | hooks, |
| 35 | mcpServers, |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | async function resolveClaudeRoot(inputPath: string): Promise<string> { |
| 40 | const absolute = path.resolve(inputPath) |
no test coverage detected