(pluginRoot, manifest)
| 66 | } |
| 67 | |
| 68 | export async function discoverPluginSkillDirectories(pluginRoot, manifest) { |
| 69 | const configuredPath = manifest?.skills ? manifest.skills.replace(/^\.\//, "") : "skills"; |
| 70 | const skillsRoot = path.join(pluginRoot, configuredPath); |
| 71 | if (!(await isDirectory(skillsRoot))) { |
| 72 | return []; |
| 73 | } |
| 74 | |
| 75 | const candidates = await listImmediateDirectories(skillsRoot); |
| 76 | const directories = []; |
| 77 | for (const candidate of candidates) { |
| 78 | const skillFile = path.join(candidate, "SKILL.md"); |
| 79 | if (await pathExists(skillFile)) { |
| 80 | directories.push(candidate); |
| 81 | } |
| 82 | } |
| 83 | return directories; |
| 84 | } |
| 85 | |
| 86 | export async function loadPluginManifest(pluginRoot) { |
| 87 | const manifestPath = path.join(pluginRoot, ".codex-plugin", "plugin.json"); |
no test coverage detected