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

Function findParents

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

Source from the content-addressed store, hash-verified

78 // Find all agents that transitively spawn any of the selected agents
79 const visited = new Set<string>()
80 function findParents(agentId: string) {
81 const parents = spawnedBy.get(agentId)
82 if (!parents) return
83
84 for (const parentId of parents) {
85 if (visited.has(parentId)) continue
86 visited.add(parentId)
87
88 // Skip if already included or not a local agent
89 if (alreadyIncluded.has(parentId)) continue
90 if (!localAgentIds.has(parentId)) continue
91
92 dependents.add(parentId)
93 // Recursively find parents of this parent
94 findParents(parentId)
95 }
96 }
97
98 // Start from each selected agent and find all its parents
99 for (const agentId of selectedAgentIds) {

Callers 1

computeDependentsFunction · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected