(
list: readonly { role: string; agent?: string }[] | undefined,
agents: readonly { name: string; color?: string }[],
)
| 32 | } |
| 33 | |
| 34 | export function messageAgentColor( |
| 35 | list: readonly { role: string; agent?: string }[] | undefined, |
| 36 | agents: readonly { name: string; color?: string }[], |
| 37 | ) { |
| 38 | if (!list) return undefined |
| 39 | for (let i = list.length - 1; i >= 0; i--) { |
| 40 | const item = list[i] |
| 41 | if (item.role !== "user" || !item.agent) continue |
| 42 | return agentColor(item.agent, agents.find((agent) => agent.name === item.agent)?.color) |
| 43 | } |
| 44 | } |
no test coverage detected