MCPcopy Create free account
hub / github.com/Roy3838/Observer / extractValidAgentReferencesWithPositions

Function extractValidAgentReferencesWithPositions

app/src/utils/agentParser.ts:336–347  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

334 * @returns Array of references with position info, only for valid agents
335 */
336export 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

Callers

nothing calls this directly

Calls 2

getAllAgentIdsFunction · 0.90

Tested by

no test coverage detected