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

Function extractAgentReferences

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

Source from the content-addressed store, hash-verified

169 * @returns Array of parsed agent references
170 */
171export 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

Callers 2

sendConversationFunction · 0.90

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected