memory location is non configurable _bmad/_memory for sidecar content

This commit is contained in:
Brian Madison
2025-12-16 15:43:38 +08:00
parent 59e4cc7b82
commit 32615afaf9
18 changed files with 204 additions and 169 deletions

View File

@@ -333,18 +333,12 @@ async function compileAgent(yamlContent, answers = {}, agentName = '', targetPat
finalAnswers = { ...defaults, ...answers };
}
// Add bmad_memory to answers if provided in config
if (options.config && options.config.bmad_memory) {
finalAnswers.bmad_memory = options.config.bmad_memory;
}
// Process templates with answers
const processedYaml = processAgentYaml(agentYaml, finalAnswers);
// Strip install_config from output
const cleanYaml = stripInstallConfig(processedYaml);
// Replace {bmad_memory} in XML content
let xml = await compileToXml(cleanYaml, agentName, targetPath);
// Ensure xml is a string before attempting replaceAll
@@ -352,10 +346,6 @@ async function compileAgent(yamlContent, answers = {}, agentName = '', targetPat
throw new TypeError('compileToXml did not return a string');
}
if (finalAnswers.bmad_memory) {
xml = xml.replaceAll('{bmad_memory}', finalAnswers.bmad_memory);
}
return {
xml,
metadata: cleanYaml.agent.metadata,