agents now are not duplicated and isntead cli commmands load from installed agent files

This commit is contained in:
Brian Madison
2025-11-09 20:24:56 -06:00
parent 7eb52520fa
commit f49a4731e7
18 changed files with 388 additions and 292 deletions

View File

@@ -4,7 +4,8 @@ const os = require('node:os');
const chalk = require('chalk');
const { BaseIdeSetup } = require('./_base-ide');
const { WorkflowCommandGenerator } = require('./shared/workflow-command-generator');
const { getAgentsFromBmad, getTasksFromBmad } = require('./shared/bmad-artifacts');
const { AgentCommandGenerator } = require('./shared/agent-command-generator');
const { getTasksFromBmad } = require('./shared/bmad-artifacts');
/**
* Codex setup handler (CLI mode)
@@ -92,23 +93,17 @@ class CodexSetup extends BaseIdeSetup {
const selectedModules = options.selectedModules || [];
const artifacts = [];
const agents = await getAgentsFromBmad(bmadDir, selectedModules);
for (const agent of agents) {
const content = await this.readAndProcessWithProject(
agent.path,
{
module: agent.module,
name: agent.name,
},
projectDir,
);
// Generate agent launchers
const agentGen = new AgentCommandGenerator(this.bmadFolderName);
const { artifacts: agentArtifacts } = await agentGen.collectAgentArtifacts(bmadDir, selectedModules);
for (const artifact of agentArtifacts) {
artifacts.push({
type: 'agent',
module: agent.module,
sourcePath: agent.path,
relativePath: path.join(agent.module, 'agents', `${agent.name}.md`),
content,
module: artifact.module,
sourcePath: artifact.sourcePath,
relativePath: artifact.relativePath,
content: artifact.content,
});
}
@@ -139,7 +134,7 @@ class CodexSetup extends BaseIdeSetup {
return {
artifacts,
counts: {
agents: agents.length,
agents: agentArtifacts.length,
tasks: tasks.length,
workflows: workflowCounts.commands,
workflowLaunchers: workflowCounts.launchers,