mirror of
https://github.com/bmadcode/BMAD-METHOD.git
synced 2025-12-29 16:14:59 +00:00
refac tools part 1
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
const path = require('node:path');
|
||||
const fs = require('fs-extra');
|
||||
const { escapeXml } = require('../../lib/xml-utils');
|
||||
const { escapeXml } = require('./xml-utils');
|
||||
|
||||
const AgentPartyGenerator = {
|
||||
/**
|
||||
|
||||
@@ -124,13 +124,6 @@ class XmlHandler {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: DELETE THIS METHOD
|
||||
*/
|
||||
injectActivationSimple(agentContent, metadata = {}) {
|
||||
console.error('Error in simple injection:', error);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build agent from YAML source
|
||||
* @param {string} yamlPath - Path to .agent.yaml file
|
||||
|
||||
@@ -4,7 +4,7 @@ const path = require('node:path');
|
||||
const crypto = require('node:crypto');
|
||||
const { AgentAnalyzer } = require('./agent-analyzer');
|
||||
const { ActivationBuilder } = require('./activation-builder');
|
||||
const { escapeXml } = require('../../../lib/xml-utils');
|
||||
const { escapeXml } = require('../xml-utils');
|
||||
const {
|
||||
processAgentYaml,
|
||||
extractInstallConfig,
|
||||
|
||||
13
tools/cli/lib/xml-utils.js
Normal file
13
tools/cli/lib/xml-utils.js
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Escape XML special characters in a string
|
||||
* @param {string} text - The text to escape
|
||||
* @returns {string} The escaped text
|
||||
*/
|
||||
function escapeXml(text) {
|
||||
if (!text) return '';
|
||||
return text.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>').replaceAll('"', '"').replaceAll("'", ''');
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
escapeXml,
|
||||
};
|
||||
Reference in New Issue
Block a user