mirror of
https://github.com/bmadcode/BMAD-METHOD.git
synced 2025-12-29 16:14:59 +00:00
remove unused code
This commit is contained in:
@@ -1920,55 +1920,6 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice:
|
||||
console.log(chalk.dim(` Created customize: ${moduleName}-${agentName}.customize.yaml`));
|
||||
}
|
||||
}
|
||||
|
||||
// Read the existing .md file to check for sidecar info
|
||||
let hasSidecar = false;
|
||||
try {
|
||||
const content = await fs.readFile(mdPath, 'utf8');
|
||||
// Look for sidecar metadata in the frontmatter or content
|
||||
hasSidecar = content.includes('hasSidecar') && content.includes('true');
|
||||
} catch {
|
||||
// Continue without sidecar processing
|
||||
}
|
||||
|
||||
// Copy sidecar files if agent has hasSidecar flag
|
||||
if (hasSidecar) {
|
||||
const { copyAgentSidecarFiles } = require('../../../lib/agent/installer');
|
||||
|
||||
// Get agent sidecar folder from core config
|
||||
const coreConfigPath = path.join(bmadDir, 'bmb', 'config.yaml');
|
||||
let agentSidecarFolder;
|
||||
|
||||
if (await fs.pathExists(coreConfigPath)) {
|
||||
const yamlLib = require('yaml');
|
||||
const coreConfigContent = await fs.readFile(coreConfigPath, 'utf8');
|
||||
const coreConfig = yamlLib.parse(coreConfigContent);
|
||||
agentSidecarFolder = coreConfig.agent_sidecar_folder || agentSidecarFolder;
|
||||
}
|
||||
|
||||
// Resolve path variables
|
||||
const resolvedSidecarFolder = agentSidecarFolder
|
||||
.replaceAll('{project-root}', projectDir)
|
||||
.replaceAll('_bmad', this.bmadFolderName || 'bmad');
|
||||
|
||||
// Create sidecar directory for this agent
|
||||
const agentSidecarDir = path.join(resolvedSidecarFolder, agentName);
|
||||
await fs.ensureDir(agentSidecarDir);
|
||||
|
||||
// Find and copy sidecar folder from source module
|
||||
const sourceModulePath = moduleName === 'core' ? getModulePath('core') : getSourcePath(`modules/${moduleName}`);
|
||||
const sourceAgentPath = path.join(sourceModulePath, 'agents');
|
||||
|
||||
// Copy sidecar files (preserve existing, add new)
|
||||
const sidecarResult = copyAgentSidecarFiles(sourceAgentPath, agentSidecarDir, null);
|
||||
|
||||
if (sidecarResult.copied.length > 0) {
|
||||
console.log(chalk.dim(` Copied ${sidecarResult.copied.length} new sidecar file(s) to: ${agentSidecarDir}`));
|
||||
}
|
||||
if (sidecarResult.preserved.length > 0) {
|
||||
console.log(chalk.dim(` Preserved ${sidecarResult.preserved.length} existing sidecar file(s)`));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -318,7 +318,6 @@ class CustomHandler {
|
||||
const { getSourcePath } = require('../../../lib/project-root');
|
||||
const genericTemplatePath = getSourcePath('utility', 'agent-components', 'agent.customize.template.yaml');
|
||||
if (await fs.pathExists(genericTemplatePath)) {
|
||||
// Copy with placeholder replacement
|
||||
let templateContent = await fs.readFile(genericTemplatePath, 'utf8');
|
||||
await fs.writeFile(customizePath, templateContent, 'utf8');
|
||||
console.log(chalk.dim(` Created customize: custom-${agentName}.customize.yaml`));
|
||||
@@ -337,41 +336,6 @@ class CustomHandler {
|
||||
// Write the compiled MD file
|
||||
await fs.writeFile(targetMdPath, processedXml, 'utf8');
|
||||
|
||||
// Check if agent has sidecar
|
||||
let hasSidecar = false;
|
||||
try {
|
||||
const yamlLib = require('yaml');
|
||||
const agentYaml = yamlLib.parse(yamlContent);
|
||||
hasSidecar = agentYaml?.agent?.metadata?.hasSidecar === true;
|
||||
} catch {
|
||||
// Continue without sidecar processing
|
||||
}
|
||||
|
||||
// Copy sidecar files if agent has hasSidecar flag
|
||||
if (hasSidecar && config.agent_sidecar_folder) {
|
||||
const { copyAgentSidecarFiles } = require('../../../lib/agent/installer');
|
||||
|
||||
// Resolve agent sidecar folder path
|
||||
const projectDir = path.dirname(bmadDir);
|
||||
const resolvedSidecarFolder = config.agent_sidecar_folder
|
||||
.replaceAll('{project-root}', projectDir)
|
||||
.replaceAll('_bmad', path.basename(bmadDir));
|
||||
|
||||
// Create sidecar directory for this agent
|
||||
const agentSidecarDir = path.join(resolvedSidecarFolder, agentName);
|
||||
await fs.ensureDir(agentSidecarDir);
|
||||
|
||||
// Copy sidecar files
|
||||
const sidecarResult = copyAgentSidecarFiles(path.dirname(agentFile), agentSidecarDir, agentFile);
|
||||
|
||||
if (sidecarResult.copied.length > 0) {
|
||||
console.log(chalk.dim(` Copied ${sidecarResult.copied.length} sidecar file(s) to: ${agentSidecarDir}`));
|
||||
}
|
||||
if (sidecarResult.preserved.length > 0) {
|
||||
console.log(chalk.dim(` Preserved ${sidecarResult.preserved.length} existing sidecar file(s)`));
|
||||
}
|
||||
}
|
||||
|
||||
// Track the file
|
||||
if (fileTrackingCallback) {
|
||||
fileTrackingCallback(targetMdPath);
|
||||
|
||||
@@ -905,35 +905,6 @@ class ModuleManager {
|
||||
await fs.writeFile(targetMdPath, xml, 'utf8');
|
||||
}
|
||||
|
||||
// Copy sidecar files if agent has hasSidecar flag
|
||||
if (hasSidecar) {
|
||||
const { copyAgentSidecarFiles } = require('../../../lib/agent/installer');
|
||||
|
||||
// Get agent sidecar folder from core config (should always be set)
|
||||
const agentSidecarFolder = this.coreConfig?.agent_sidecar_folder;
|
||||
|
||||
// Resolve path variables
|
||||
const projectDir = path.dirname(bmadDir);
|
||||
const resolvedSidecarFolder = agentSidecarFolder
|
||||
.replaceAll('{project-root}', projectDir)
|
||||
.replaceAll('_bmad', path.basename(bmadDir));
|
||||
|
||||
// Create sidecar directory for this agent
|
||||
const agentSidecarDir = path.join(resolvedSidecarFolder, agentName);
|
||||
await fs.ensureDir(agentSidecarDir);
|
||||
|
||||
// Copy sidecar files (preserve existing, add new)
|
||||
const sidecarResult = copyAgentSidecarFiles(path.dirname(sourceYamlPath), agentSidecarDir, sourceYamlPath);
|
||||
const totalFiles = sidecarResult.copied.length + sidecarResult.preserved.length;
|
||||
|
||||
if (sidecarResult.copied.length > 0) {
|
||||
console.log(chalk.dim(` Copied ${sidecarResult.copied.length} new sidecar file(s) to: ${agentSidecarDir}`));
|
||||
}
|
||||
if (sidecarResult.preserved.length > 0) {
|
||||
console.log(chalk.dim(` Preserved ${sidecarResult.preserved.length} existing sidecar file(s)`));
|
||||
}
|
||||
}
|
||||
|
||||
console.log(
|
||||
chalk.dim(` Compiled agent: ${agentName} -> ${path.relative(targetPath, targetMdPath)}${hasSidecar ? ' (with sidecar)' : ''}`),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user