fix: single agent install and team installation support

This commit is contained in:
Brian Madison
2025-06-16 21:26:32 -05:00
parent 449e42440a
commit 18a382baa4
7 changed files with 224 additions and 25 deletions

View File

@@ -220,11 +220,12 @@ class Installer {
const agentPath = configLoader.getAgentPath(config.agent);
const destAgentPath = path.join(
installDir,
".bmad-core",
"agents",
`${config.agent}.md`
);
await fileManager.copyFile(agentPath, destAgentPath);
files.push(`agents/${config.agent}.md`);
files.push(`.bmad-core/agents/${config.agent}.md`);
// Copy dependencies
const dependencies = await configLoader.getAgentDependencies(
@@ -240,9 +241,9 @@ class Installer {
const copiedFiles = await fileManager.copyGlobPattern(
dep.replace(".bmad-core/", ""),
sourceBase,
installDir
path.join(installDir, ".bmad-core")
);
files.push(...copiedFiles);
files.push(...copiedFiles.map(f => `.bmad-core/${f}`));
} else {
// Handle single files
const sourcePath = path.join(
@@ -251,14 +252,72 @@ class Installer {
);
const destPath = path.join(
installDir,
dep.replace(".bmad-core/", "")
dep
);
if (await fileManager.copyFile(sourcePath, destPath)) {
files.push(dep.replace(".bmad-core/", ""));
files.push(dep);
}
}
}
} else if (config.installType === "team") {
// Team installation
spinner.text = `Installing ${config.team} team...`;
// Get team dependencies
const teamDependencies = await configLoader.getTeamDependencies(config.team);
const sourceBase = configLoader.getBmadCorePath();
// Install all team dependencies
for (const dep of teamDependencies) {
spinner.text = `Copying team dependency: ${dep}`;
if (dep.includes("*")) {
// Handle glob patterns
const copiedFiles = await fileManager.copyGlobPattern(
dep.replace(".bmad-core/", ""),
sourceBase,
path.join(installDir, ".bmad-core")
);
files.push(...copiedFiles.map(f => `.bmad-core/${f}`));
} else {
// Handle single files
const sourcePath = path.join(sourceBase, dep.replace(".bmad-core/", ""));
const destPath = path.join(installDir, dep);
if (await fileManager.copyFile(sourcePath, destPath)) {
files.push(dep);
}
}
}
} else if (config.installType === "expansion-only") {
// Expansion-only installation - create minimal .bmad-core structure
spinner.text = "Creating minimal .bmad-core structure for expansion packs...";
const bmadCoreDestDir = path.join(installDir, ".bmad-core");
await fileManager.ensureDirectory(bmadCoreDestDir);
// Create basic directory structure
const dirs = ['agents', 'agent-teams', 'templates', 'tasks', 'checklists', 'workflows', 'data', 'utils', 'schemas'];
for (const dir of dirs) {
await fileManager.ensureDirectory(path.join(bmadCoreDestDir, dir));
}
// Copy minimal required files (schemas, utils, etc.)
const sourceBase = configLoader.getBmadCorePath();
const essentialFiles = [
'schemas/**/*',
'utils/**/*'
];
for (const pattern of essentialFiles) {
const copiedFiles = await fileManager.copyGlobPattern(
pattern,
sourceBase,
bmadCoreDestDir
);
files.push(...copiedFiles.map(f => `.bmad-core/${f}`));
}
}
// Install expansion packs if requested
@@ -664,6 +723,10 @@ class Installer {
return configLoader.getAvailableExpansionPacks();
}
async getAvailableTeams() {
return configLoader.getAvailableTeams();
}
async installExpansionPacks(installDir, selectedPacks, spinner) {
if (!selectedPacks || selectedPacks.length === 0) {
return [];