MCPcopy Create free account
hub / github.com/anomalyco/opencode / taskAgent

Function taskAgent

packages/session-ui/src/components/message-part.tsx:394–405  ·  view source on GitHub ↗
(
  raw: unknown,
  list?: readonly { name: string; color?: string }[],
)

Source from the content-addressed store, hash-verified

392}
393
394function 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
407function webSearchProviderLabel(provider: unknown) {
408 if (provider === "parallel") return "Parallel Web Search"

Callers 2

taskSessionFunction · 0.85
renderFunction · 0.85

Calls 2

toneFunction · 0.70
findMethod · 0.65

Tested by

no test coverage detected