MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / findMatchingSpawnAgent

Function findMatchingSpawnAgent

cli/src/utils/spawn-agent-matcher.ts:11–25  ·  view source on GitHub ↗
(
  spawnAgentsMap: Map<string, SpawnAgentInfo>,
  eventAgentType: string,
)

Source from the content-addressed store, hash-verified

9}
10
11export const findMatchingSpawnAgent = (
12 spawnAgentsMap: Map<string, SpawnAgentInfo>,
13 eventAgentType: string,
14): SpawnAgentMatch | null => {
15 const eventBaseName = getAgentBaseName(eventAgentType || '')
16
17 for (const [tempId, info] of spawnAgentsMap.entries()) {
18 const storedBaseName = getAgentBaseName(info.agentType || '')
19 if (eventBaseName === storedBaseName) {
20 return { tempId, info }
21 }
22 }
23
24 return null
25}
26
27export const resolveSpawnAgentToReal = (options: {
28 blocks: ContentBlock[]

Callers 1

handleSubagentStartFunction · 0.90

Calls 1

getAgentBaseNameFunction · 0.90

Tested by

no test coverage detected