From bb2f311a5e5cc22dbd00ff21272a8ab7a492d29a Mon Sep 17 00:00:00 2001 From: Diego Szychowski Date: Sun, 7 Dec 2025 19:54:19 -0300 Subject: [PATCH] fix: retrieve installed modules during manifest processing for compiling agents The problem was that the installedModules variable was being used at line 1987 but was never defined in the compileAgents method's scope. Issue: When compiling agents the compilation failed. Installation failed: installedModules is not defined ReferenceError: installedModules is not defined at Installer.compileAgents (BMAD-METHOD/tools/cli/installers/lib/core/installer.js:1987:30) at async Command.action (BMAD-METHOD/tools/cli/commands/install.js:26:24) The fix: - Added the declaration let installedModules = []; at line 1968 - Added code to populate installedModules by reading the bmad directory and filtering for module directories (lines 1975-1979) - This follows the same pattern used in other methods like generateManifests (line 1237) and update (line 2050) --- tools/cli/installers/lib/core/installer.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/cli/installers/lib/core/installer.js b/tools/cli/installers/lib/core/installer.js index 9390042e..7cc6f019 100644 --- a/tools/cli/installers/lib/core/installer.js +++ b/tools/cli/installers/lib/core/installer.js @@ -1965,11 +1965,18 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice: // Only regenerate YAML manifest for IDE updates if needed const existingManifestPath = path.join(bmadDir, '_cfg', 'manifest.yaml'); let existingIdes = []; + let installedModules = []; if (await fs.pathExists(existingManifestPath)) { const manifestContent = await fs.readFile(existingManifestPath, 'utf8'); const yaml = require('js-yaml'); const manifest = yaml.load(manifestContent); existingIdes = manifest.ides || []; + + // Get installed modules from the bmad directory + const moduleEntries = await fs.readdir(bmadDir, { withFileTypes: true }); + installedModules = moduleEntries + .filter((entry) => entry.isDirectory() && entry.name !== '_cfg' && entry.name !== 'docs' && entry.name !== 'agents') + .map((entry) => entry.name); } // Update IDE configurations using the existing IDE list from manifest