MCPcopy Create free account
hub / github.com/Noumena-Network/code / getTaskStatusColor

Function getTaskStatusColor

src/components/tasks/taskStatusUtils.tsx:51–71  ·  view source on GitHub ↗
(status: TaskStatus, options?: {
  isIdle?: boolean;
  awaitingApproval?: boolean;
  hasError?: boolean;
  shutdownRequested?: boolean;
})

Source from the content-addressed store, hash-verified

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

Callers 2

WorkflowDetailDialogFunction · 0.85
AsyncAgentDetailDialogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected