feat: implement recursive agent discovery and compilation

- Module agents now discovered recursively at any depth in agents folder
- .agent.yaml files are compiled to .md format during module installation
- Custom agents also support subdirectory structure
- Agents maintain their directory structure when installed
- YAML files are skipped during file copying as they're compiled separately
- Added compileModuleAgents method to handle YAML-to-MD compilation
- Updated discoverAgents to recursively search for .agent.yaml files
- Agents in subdirectories are properly placed in _cfg/agents with relative paths

This fixes issue where agents like cbt-coach were not being compiled
and were only copied as YAML files.
This commit is contained in:
Brian Madison
2025-12-06 15:38:38 -06:00
parent 0d83799ecf
commit 1bd01e1ce6
3 changed files with 172 additions and 28 deletions

View File

@@ -2532,8 +2532,10 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice:
agentType = parts.slice(-2).join('-'); // Take last 2 parts as type
}
// Create target directory
const agentTargetDir = path.join(customAgentsDir, finalAgentName);
// Create target directory - use relative path if agent is in a subdirectory
const agentTargetDir = agent.relativePath
? path.join(customAgentsDir, agent.relativePath)
: path.join(customAgentsDir, finalAgentName);
await fs.ensureDir(agentTargetDir);
// Calculate paths