diff --git a/tools/installer/core/manifest-generator.js b/tools/installer/core/manifest-generator.js index f7b5d0084..bd949ecef 100644 --- a/tools/installer/core/manifest-generator.js +++ b/tools/installer/core/manifest-generator.js @@ -244,7 +244,7 @@ class ManifestGenerator { const debug = process.env.BMAD_DEBUG_MANIFEST === 'true'; for (const moduleName of this.updatedModules) { - const moduleYamlPath = await resolveInstalledModuleYaml(moduleName); + const moduleYamlPath = await resolveInstalledModuleYaml(moduleName, this.bmadDir); if (!moduleYamlPath) { // External modules live in ~/.bmad/cache/external-modules, not src/modules. // Warn rather than silently skip so missing agent rosters don't vanish @@ -439,7 +439,7 @@ class ManifestGenerator { // from module.yaml, so TOML sections use [modules.] not [modules.]. const codeByModuleName = {}; for (const moduleName of this.updatedModules) { - const moduleYamlPath = await resolveInstalledModuleYaml(moduleName); + const moduleYamlPath = await resolveInstalledModuleYaml(moduleName, this.bmadDir); if (!moduleYamlPath) { console.warn( `[warn] writeCentralConfig: could not locate module.yaml for '${moduleName}'. ` + diff --git a/tools/installer/project-root.js b/tools/installer/project-root.js index 84ecde5b0..802d1a459 100644 --- a/tools/installer/project-root.js +++ b/tools/installer/project-root.js @@ -99,7 +99,15 @@ function getExternalModuleCachePath(moduleName, ...segments) { * @param {string} moduleName * @returns {Promise} Absolute path to module.yaml, or null if not found. */ -async function resolveInstalledModuleYaml(moduleName) { +async function resolveInstalledModuleYaml(moduleName, bmadDir = null) { + // First: check _bmad//module.yaml (installed location) + // This is written by installFromResolution during install, so check it + // before caches to find freshly-installed custom/community modules. + if (bmadDir) { + const installedPath = path.join(bmadDir, moduleName, 'module.yaml'); + if (await fs.pathExists(installedPath)) return installedPath; + } + const builtIn = path.join(getModulePath(moduleName), 'module.yaml'); if (await fs.pathExists(builtIn)) return builtIn;