(pluginRoot)
| 77 | } |
| 78 | |
| 79 | async function collectPluginSamples(pluginRoot) { |
| 80 | if (!(await pathExists(pluginRoot))) { |
| 81 | return []; |
| 82 | } |
| 83 | const directories = await listImmediateDirectories(pluginRoot); |
| 84 | const samples = []; |
| 85 | for (const directory of directories) { |
| 86 | const manifestPath = path.join(directory, ".codex-plugin", "plugin.json"); |
| 87 | if (!(await pathExists(manifestPath))) { |
| 88 | continue; |
| 89 | } |
| 90 | try { |
| 91 | const manifest = await readJson(manifestPath); |
| 92 | samples.push(await computePluginBudget(directory, manifest)); |
| 93 | } catch { |
| 94 | // Ignore malformed shipped samples and keep the baseline usable. |
| 95 | } |
| 96 | } |
| 97 | return samples; |
| 98 | } |
| 99 | |
| 100 | export async function loadBudgetBaseline() { |
| 101 | if (cachedBaseline) { |
no test coverage detected