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

Function collectDependencies

cli/src/components/publish-confirmation.tsx:30–44  ·  view source on GitHub ↗
(agentId: string)

Source from the content-addressed store, hash-verified

28 const visited = new Set<string>()
29
30 function collectDependencies(agentId: string) {
31 if (visited.has(agentId)) return
32 visited.add(agentId)
33
34 const definition = agentDefinitions.get(agentId)
35 const spawnableAgents = definition?.spawnableAgents ?? []
36
37 for (const spawnableId of spawnableAgents) {
38 const simpleId = getSimpleAgentId(spawnableId)
39 if (localAgentIds.has(simpleId) && !selectedAgentIds.has(simpleId)) {
40 dependencies.add(simpleId)
41 collectDependencies(simpleId)
42 }
43 }
44 }
45
46 for (const agentId of selectedAgentIds) {
47 collectDependencies(agentId)

Callers 2

computeDependenciesFunction · 0.85
getAllPublishAgentIdsFunction · 0.85

Calls 2

getSimpleAgentIdFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected