(agentId: string)
| 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) { |
no test coverage detected