(text: string)
| 314 | * @returns Array of references with position info, only for valid agents |
| 315 | */ |
| 316 | export async function extractValidAgentReferencesWithPositions(text: string): Promise<Array<{ |
| 317 | reference: AgentReference; |
| 318 | start: number; |
| 319 | end: number; |
| 320 | fullMatch: string; |
| 321 | }>> { |
| 322 | const validAgentIds = await getAllAgentIds(); |
| 323 | const validIdSet = new Set(validAgentIds); |
| 324 | |
| 325 | const allRefs = extractAgentReferencesWithPositions(text); |
| 326 | return allRefs.filter(ref => validIdSet.has(ref.reference.agentId)); |
| 327 | } |
| 328 | |
| 329 | /** |
| 330 | * Detects partial @agent typing for suggestions |
nothing calls this directly
no test coverage detected