(status: TaskStatus, options?: {
isIdle?: boolean;
awaitingApproval?: boolean;
hasError?: boolean;
shutdownRequested?: boolean;
})
| 22 | * Returns the appropriate icon for a task based on status and state flags. |
| 23 | */ |
| 24 | export function getTaskStatusIcon(status: TaskStatus, options?: { |
| 25 | isIdle?: boolean; |
| 26 | awaitingApproval?: boolean; |
| 27 | hasError?: boolean; |
| 28 | shutdownRequested?: boolean; |
| 29 | }): string { |
| 30 | const { |
| 31 | isIdle, |
| 32 | awaitingApproval, |
| 33 | hasError, |
| 34 | shutdownRequested |
| 35 | } = options ?? {}; |
| 36 | if (hasError) return figures.cross; |
| 37 | if (awaitingApproval) return figures.questionMarkPrefix; |
| 38 | if (shutdownRequested) return figures.warning; |
| 39 | if (status === 'running') { |
| 40 | if (isIdle) return figures.ellipsis; |
| 41 | return figures.play; |
| 42 | } |
| 43 | if (status === 'completed') return figures.tick; |
| 44 | if (status === 'failed' || status === 'killed') return figures.cross; |
| 45 | return figures.bullet; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Returns the appropriate semantic color for a task based on status and state flags. |
no outgoing calls
no test coverage detected