roo installer had some bugs

This commit is contained in:
Brian Madison
2025-12-15 15:08:19 +08:00
parent 60238d2854
commit 5716282898
7 changed files with 28 additions and 16 deletions

View File

@@ -563,6 +563,9 @@ class ConfigCollector {
// Get friendly module name from config or use uppercase module name
const moduleDisplayName = moduleConfig.header || `${moduleName.toUpperCase()} Module`;
// Add blank line for better readability
console.log();
// Display the module name in color first
console.log(chalk.cyan('?') + ' ' + chalk.magenta(moduleDisplayName));

View File

@@ -34,7 +34,7 @@ class BaseIdeSetup {
* @returns {string} The activation header text
*/
async getAgentCommandHeader() {
const headerPath = path.join(getSourcePath(), 'src', 'utility', 'agent-components', 'agent-command-header.md');
const headerPath = getSourcePath('utility', 'agent-components', 'agent-command-header.md');
return await fs.readFile(headerPath, 'utf8');
}

View File

@@ -45,12 +45,22 @@ class RooSetup extends BaseIdeSetup {
continue;
}
// Read the actual agent file from _bmad for metadata extraction (installed agents are .md files)
const agentPath = path.join(bmadDir, artifact.module, 'agents', `${artifact.name}.md`);
const content = await this.readFile(agentPath);
// artifact.sourcePath contains the full path to the agent file
if (!artifact.sourcePath) {
console.error(`Error: Missing sourcePath for artifact ${artifact.name} from module ${artifact.module}`);
console.error(`Artifact object:`, artifact);
throw new Error(`Missing sourcePath for agent: ${artifact.name}`);
}
const content = await this.readFile(artifact.sourcePath);
// Create command file that references the actual _bmad agent
await this.createCommandFile({ module: artifact.module, name: artifact.name, path: agentPath }, content, commandPath, projectDir);
await this.createCommandFile(
{ module: artifact.module, name: artifact.name, path: artifact.sourcePath },
content,
commandPath,
projectDir,
);
addedCount++;
console.log(chalk.green(` ✓ Added command: ${commandName}`));