(text: string)
| 334 | * @returns Array of references with position info, only for valid agents |
| 335 | */ |
| 336 | export async function extractValidAgentReferencesWithPositions(text: string): Promise<Array<{ |
| 337 | reference: AgentReference; |
| 338 | start: number; |
| 339 | end: number; |
| 340 | fullMatch: string; |
| 341 | }>> { |
| 342 | const validAgentIds = await getAllAgentIds(); |
| 343 | const validIdSet = new Set(validAgentIds); |
| 344 | |
| 345 | const allRefs = extractAgentReferencesWithPositions(text); |
| 346 | return allRefs.filter(ref => validIdSet.has(ref.reference.agentId)); |
| 347 | } |
| 348 | |
| 349 | /** |
| 350 | * Detects partial @agent typing for suggestions |
nothing calls this directly
no test coverage detected