(teammateId: string)
| 20 | * Colors are assigned in round-robin order. |
| 21 | */ |
| 22 | export function assignTeammateColor(teammateId: string): AgentColorName { |
| 23 | const existing = teammateColorAssignments.get(teammateId) |
| 24 | if (existing) { |
| 25 | return existing |
| 26 | } |
| 27 | |
| 28 | const color = AGENT_COLORS[colorIndex % AGENT_COLORS.length]! |
| 29 | teammateColorAssignments.set(teammateId, color) |
| 30 | colorIndex++ |
| 31 | |
| 32 | return color |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Gets the assigned color for a teammate, if any. |
no test coverage detected