({
agentType,
description,
name,
descriptionColor,
taskDescription,
toolUseCount,
tokens,
color,
isLast,
isResolved,
isError: _isError,
isAsync = false,
shouldAnimate: _shouldAnimate,
lastToolInfo,
hideType = false,
}: Props)
| 22 | }; |
| 23 | |
| 24 | export function AgentProgressLine({ |
| 25 | agentType, |
| 26 | description, |
| 27 | name, |
| 28 | descriptionColor, |
| 29 | taskDescription, |
| 30 | toolUseCount, |
| 31 | tokens, |
| 32 | color, |
| 33 | isLast, |
| 34 | isResolved, |
| 35 | isError: _isError, |
| 36 | isAsync = false, |
| 37 | shouldAnimate: _shouldAnimate, |
| 38 | lastToolInfo, |
| 39 | hideType = false, |
| 40 | }: Props): React.ReactNode { |
| 41 | const treeChar = isLast ? '└─' : '├─'; |
| 42 | const isBackgrounded = isAsync && isResolved; |
| 43 | |
| 44 | // Determine the status text |
| 45 | const getStatusText = (): string => { |
| 46 | if (!isResolved) { |
| 47 | return lastToolInfo || 'Initializing…'; |
| 48 | } |
| 49 | if (isBackgrounded) { |
| 50 | return taskDescription ?? 'Running in the background'; |
| 51 | } |
| 52 | return 'Done'; |
| 53 | }; |
| 54 | |
| 55 | return ( |
| 56 | <Box flexDirection="column"> |
| 57 | <Box paddingLeft={3}> |
| 58 | <Text dimColor>{treeChar} </Text> |
| 59 | <Text dimColor={!isResolved}> |
| 60 | {hideType ? ( |
| 61 | <> |
| 62 | <Text bold>{name ?? description ?? agentType}</Text> |
| 63 | {name && description && <Text dimColor>: {description}</Text>} |
| 64 | </> |
| 65 | ) : ( |
| 66 | <> |
| 67 | <Text bold backgroundColor={color} color={color ? 'inverseText' : undefined}> |
| 68 | {agentType} |
| 69 | </Text> |
| 70 | {description && ( |
| 71 | <> |
| 72 | {' ('} |
| 73 | <Text backgroundColor={descriptionColor} color={descriptionColor ? 'inverseText' : undefined}> |
| 74 | {description} |
| 75 | </Text> |
| 76 | {')'} |
| 77 | </> |
| 78 | )} |
| 79 | </> |
| 80 | )} |
| 81 | {!isBackgrounded && ( |
nothing calls this directly
no test coverage detected