(agent: AgentDefinition)
| 102 | * Always use this for existing agents to get their real file location |
| 103 | */ |
| 104 | export function getActualAgentFilePath(agent: AgentDefinition): string { |
| 105 | if (agent.source === 'built-in') { |
| 106 | return 'Built-in' |
| 107 | } |
| 108 | if (agent.source === 'plugin') { |
| 109 | throw new Error('Cannot get file path for plugin agents') |
| 110 | } |
| 111 | |
| 112 | const dirPath = getAgentDirectoryPath(agent.source) |
| 113 | const filename = agent.filename || agent.agentType |
| 114 | return join(dirPath, `${filename}.md`) |
| 115 | } |
| 116 | |
| 117 | /** |
| 118 | * Gets the relative file path for a new agent based on its name |
no test coverage detected