Download src/utils/agent-state-emoji.ts from SaylorTwift/openhands: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/SaylorTwift/openhands/resolve/main/src/utils/agent-state-emoji.ts
- Command line
-
hf download hf://SaylorTwift/openhands/src/utils/agent-state-emoji.ts
-
curl -L -o agent-state-emoji.ts https://huggingface.co/SaylorTwift/openhands/resolve/main/src/utils/agent-state-emoji.ts
1.01 kB
| 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; | |
| } | |
| } | |