sidecar content goes to custom core config location

This commit is contained in:
Brian Madison
2025-12-06 21:08:57 -06:00
parent ba2c81263b
commit 1697a45376
12 changed files with 377 additions and 30 deletions

View File

@@ -76,7 +76,7 @@ async function getTasksFromBmad(bmadDir, selectedModules = []) {
return tasks;
}
async function getAgentsFromDir(dirPath, moduleName) {
async function getAgentsFromDir(dirPath, moduleName, relativePath = '') {
const agents = [];
if (!(await fs.pathExists(dirPath))) {
@@ -87,10 +87,11 @@ async function getAgentsFromDir(dirPath, moduleName) {
for (const entry of entries) {
const fullPath = path.join(dirPath, entry.name);
const newRelativePath = relativePath ? `${relativePath}/${entry.name}` : entry.name;
if (entry.isDirectory()) {
// Recurse into subdirectories
const subDirAgents = await getAgentsFromDir(fullPath, moduleName);
const subDirAgents = await getAgentsFromDir(fullPath, moduleName, newRelativePath);
agents.push(...subDirAgents);
} else if (entry.name.endsWith('.md')) {
// Skip README files and other non-agent files
@@ -117,6 +118,7 @@ async function getAgentsFromDir(dirPath, moduleName) {
path: fullPath,
name: entry.name.replace('.md', ''),
module: moduleName,
relativePath: newRelativePath, // Keep the .md extension for the full path
});
}
}