tools fix

This commit is contained in:
Brian Madison
2025-06-13 19:42:56 -05:00
parent fdfaa1f81f
commit 0bf5dca4c0
2 changed files with 47 additions and 11 deletions

View File

@@ -17,8 +17,8 @@ installation-options:
# These are the core files that should be included with any single agent installation
agent-dependencies:
core-files:
- ".bmad-core/data/bmad-kb.md"
- ".bmad-core/data/technical-preferences.md"
# Only files that truly every agent needs should go here
# Most dependencies should be declared in the agent YAML itself
- ".bmad-core/utils/template-format.md"
# Agent-specific dependencies (parsed from agent files or explicitly defined)
@@ -28,8 +28,17 @@ agent-dependencies:
pm:
- ".bmad-core/templates/prd-tmpl.md"
- ".bmad-core/templates/brownfield-prd-tmpl.md"
- ".bmad-core/checklists/pm-checklist.md"
- ".bmad-core/checklists/change-checklist.md"
- ".bmad-core/tasks/advanced-elicitation.md"
- ".bmad-core/tasks/create-doc.md"
- ".bmad-core/tasks/correct-course.md"
- ".bmad-core/tasks/create-deep-research-prompt.md"
- ".bmad-core/tasks/brownfield-create-epic.md"
- ".bmad-core/tasks/brownfield-create-story.md"
- ".bmad-core/tasks/execute-checklist.md"
- ".bmad-core/tasks/shard-doc.md"
architect:
- ".bmad-core/templates/architecture-tmpl.md"

View File

@@ -31,16 +31,43 @@ class ConfigLoader {
}
async getAgentDependencies(agentId) {
const config = await this.load();
const dependencies = config['agent-dependencies'] || {};
// Use DependencyResolver to dynamically parse agent dependencies
const DependencyResolver = require('../../lib/dependency-resolver');
const resolver = new DependencyResolver(path.join(__dirname, '..', '..', '..'));
// Always include core files
const coreFiles = dependencies['core-files'] || [];
// Add agent-specific dependencies
const agentDeps = dependencies[agentId] || [];
return [...coreFiles, ...agentDeps];
try {
const agentDeps = await resolver.resolveAgentDependencies(agentId);
// Convert to flat list of file paths
const depPaths = [];
// Add core files
const config = await this.load();
const coreFiles = config['agent-dependencies']?.['core-files'] || [];
depPaths.push(...coreFiles);
// Add agent file itself is already handled by installer
// Add all resolved resources
for (const resource of agentDeps.resources) {
const filePath = `.bmad-core/${resource.type}/${resource.id}.md`;
if (!depPaths.includes(filePath)) {
depPaths.push(filePath);
}
}
return depPaths;
} catch (error) {
console.warn(`Failed to dynamically resolve dependencies for ${agentId}: ${error.message}`);
// Fall back to static config
const config = await this.load();
const dependencies = config['agent-dependencies'] || {};
const coreFiles = dependencies['core-files'] || [];
const agentDeps = dependencies[agentId] || [];
return [...coreFiles, ...agentDeps];
}
}
async getIdeConfiguration(ide) {