(status: TaskStatus, options?: {
isIdle?: boolean;
awaitingApproval?: boolean;
hasError?: boolean;
shutdownRequested?: boolean;
})
| 48 | * Returns the appropriate semantic color for a task based on status and state flags. |
| 49 | */ |
| 50 | export function getTaskStatusColor(status: TaskStatus, options?: { |
| 51 | isIdle?: boolean; |
| 52 | awaitingApproval?: boolean; |
| 53 | hasError?: boolean; |
| 54 | shutdownRequested?: boolean; |
| 55 | }): 'success' | 'error' | 'warning' | 'background' { |
| 56 | const { |
| 57 | isIdle, |
| 58 | awaitingApproval, |
| 59 | hasError, |
| 60 | shutdownRequested |
| 61 | } = options ?? {}; |
| 62 | if (hasError) return 'error'; |
| 63 | if (awaitingApproval) return 'warning'; |
| 64 | if (shutdownRequested) return 'warning'; |
| 65 | if (isIdle) return 'background'; |
| 66 | if (status === 'completed') return 'success'; |
| 67 | if (status === 'failed') return 'error'; |
| 68 | if (status === 'killed') return 'warning'; |
| 69 | return 'background'; |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Derives a human-readable activity string for an in-process teammate, |
no outgoing calls
no test coverage detected