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)
This commit is contained in:
Diego Szychowski 2025-12-07 19:54:19 -03:00
parent 38e65abd83
commit bb2f311a5e
1 changed files with 7 additions and 0 deletions

View File

@ -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