(text: string)
| 169 | * @returns Array of parsed agent references |
| 170 | */ |
| 171 | export function extractAgentReferences(text: string): AgentReference[] { |
| 172 | const regex = /@(\w+)(?:#(\d+))?/g; |
| 173 | const references: AgentReference[] = []; |
| 174 | let match; |
| 175 | |
| 176 | while ((match = regex.exec(text)) !== null) { |
| 177 | references.push({ |
| 178 | agentId: match[1], |
| 179 | runCount: match[2] ? parseInt(match[2]) : 10 // default to 10 runs |
| 180 | }); |
| 181 | } |
| 182 | |
| 183 | return references; |
| 184 | } |
| 185 | |
| 186 | /** |
| 187 | * Extracts agent references with their positions for inline rendering |
no test coverage detected