mirror of
https://github.com/bmadcode/BMAD-METHOD.git
synced 2025-12-29 16:14:59 +00:00
fixed issue with agent customization application, now all fields are customized form the custom yaml. also added a recompile agents menu item
This commit is contained in:
@@ -731,7 +731,7 @@ class ModuleManager {
|
||||
async compileModuleAgents(sourcePath, targetPath, moduleName, bmadDir, installer = null) {
|
||||
const sourceAgentsPath = path.join(sourcePath, 'agents');
|
||||
const targetAgentsPath = path.join(targetPath, 'agents');
|
||||
const cfgAgentsDir = path.join(bmadDir, '_config', 'agents');
|
||||
const cfgAgentsDir = path.join(bmadDir, '_bmad', '_config', 'agents');
|
||||
|
||||
// Check if agents directory exists in source
|
||||
if (!(await fs.pathExists(sourceAgentsPath))) {
|
||||
@@ -809,9 +809,9 @@ class ModuleManager {
|
||||
const customizeData = yaml.parse(customizeContent);
|
||||
customizedFields = customizeData.customized_fields || [];
|
||||
|
||||
// Build answers object from customizations (filter empty values)
|
||||
// Build answers object from customizations
|
||||
if (customizeData.persona) {
|
||||
Object.assign(answers, filterCustomizationData(customizeData.persona));
|
||||
answers.persona = customizeData.persona;
|
||||
}
|
||||
if (customizeData.agent?.metadata) {
|
||||
const filteredMetadata = filterCustomizationData(customizeData.agent.metadata);
|
||||
@@ -825,6 +825,12 @@ class ModuleManager {
|
||||
if (customizeData.memories && customizeData.memories.length > 0) {
|
||||
answers.memories = customizeData.memories;
|
||||
}
|
||||
if (customizeData.menu && customizeData.menu.length > 0) {
|
||||
answers.menu = customizeData.menu;
|
||||
}
|
||||
if (customizeData.prompts && customizeData.prompts.length > 0) {
|
||||
answers.prompts = customizeData.prompts;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if agent has sidecar
|
||||
@@ -839,8 +845,14 @@ class ModuleManager {
|
||||
// Compile with customizations if any
|
||||
const { xml } = await compileAgent(yamlContent, answers, agentName, relativePath, { config: this.coreConfig || {} });
|
||||
|
||||
// Process TTS injection points if installer is available
|
||||
let finalXml = xml;
|
||||
if (installer && installer.processTTSInjectionPoints) {
|
||||
finalXml = installer.processTTSInjectionPoints(xml, targetMdPath);
|
||||
}
|
||||
|
||||
// Write the compiled agent
|
||||
await fs.writeFile(targetMdPath, xml, 'utf8');
|
||||
await fs.writeFile(targetMdPath, finalXml, 'utf8');
|
||||
|
||||
// Handle sidecar copying if present
|
||||
if (hasSidecar) {
|
||||
|
||||
Reference in New Issue
Block a user