(
raw: unknown,
list?: readonly { name: string; color?: string }[],
)
| 392 | } |
| 393 | |
| 394 | function taskAgent( |
| 395 | raw: unknown, |
| 396 | list?: readonly { name: string; color?: string }[], |
| 397 | ): { name?: string; color?: string } { |
| 398 | if (typeof raw !== "string" || !raw) return {} |
| 399 | const key = raw.toLowerCase() |
| 400 | const item = list?.find((entry) => entry.name === raw || entry.name.toLowerCase() === key) |
| 401 | return { |
| 402 | name: item?.name ?? `${raw[0]!.toUpperCase()}${raw.slice(1)}`, |
| 403 | color: item?.color ?? agentTones[key] ?? tone(key), |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | function webSearchProviderLabel(provider: unknown) { |
| 408 | if (provider === "parallel") return "Parallel Web Search" |
no test coverage detected