| 70 | * Check if a child agent should be collapsed when spawned by a specific parent |
| 71 | */ |
| 72 | export const shouldCollapseForParent = ( |
| 73 | childAgentType: string, |
| 74 | parentAgentType: string | undefined, |
| 75 | ): boolean => { |
| 76 | if (!parentAgentType) { |
| 77 | return false |
| 78 | } |
| 79 | |
| 80 | for (const [parentPattern, childPatterns] of Object.entries( |
| 81 | PARENT_CHILD_COLLAPSE_RULES, |
| 82 | )) { |
| 83 | if (parentAgentType.includes(parentPattern)) { |
| 84 | for (const childPattern of childPatterns) { |
| 85 | if (childAgentType.includes(childPattern)) { |
| 86 | return true |
| 87 | } |
| 88 | } |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | return false |
| 93 | } |
| 94 | |
| 95 | // Agent IDs that should render as simple text instead of full agent boxes |
| 96 | export const SIMPLE_TEXT_AGENT_IDS = [ |