File size: 1,011 Bytes
a070805
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { ExecutionStatus } from "#/types/agent-server/core/base/common";

/**
 * Maps a conversation's execution status to a single emoji that visually
 * conveys the agent's state in the browser tab title.
 *
 *   βœ… green check β€” agent finished or is otherwise waiting on the user
 *   🟒 green circle β€” agent is actively running
 *   βšͺ gray circle β€” agent is paused/stopped
 *   πŸ”΄ red circle β€” agent is in an error state
 *
 * Returns null when the status is unknown so callers can omit the prefix.
 */
export function getAgentStateEmoji(
  status: ExecutionStatus | null | undefined,
): string | null {
  switch (status) {
    case ExecutionStatus.RUNNING:
      return "🟒";
    case ExecutionStatus.FINISHED:
    case ExecutionStatus.IDLE:
    case ExecutionStatus.WAITING_FOR_CONFIRMATION:
      return "βœ…";
    case ExecutionStatus.PAUSED:
      return "βšͺ";
    case ExecutionStatus.ERROR:
    case ExecutionStatus.STUCK:
      return "πŸ”΄";
    default:
      return null;
  }
}