(agent: AgentDefinition)
| 157 | * Always use this for existing agents to get their real file location |
| 158 | */ |
| 159 | export function getActualAgentFilePath(agent: AgentDefinition): string { |
| 160 | if (agent.source === 'built-in') { |
| 161 | return 'Built-in' |
| 162 | } |
| 163 | if (agent.source === 'plugin') { |
| 164 | throw new Error('Cannot get file path for plugin agents') |
| 165 | } |
| 166 | |
| 167 | const dirPath = agent.baseDir || getAgentDirectoryPath(agent.source) |
| 168 | const filename = agent.filename || agent.agentType |
| 169 | return join(dirPath, `${filename}.md`) |
| 170 | } |
| 171 | |
| 172 | /** |
| 173 | * Gets the relative file path for a new agent based on its name |
no test coverage detected