export const AGENT_STATUSES = [
    "new",
    "running",
    "waitingForApproval",
    "waitingForInput",
    "completed",
    "closed",
    "error",
    "idle",
    "costLimitReached",
];
const AGENT_STATUS_SET = new Set(AGENT_STATUSES);
export const TRANSIENT_AGENT_RUN_STATES = new Set([
    "toolApprovalGranted",
    "toolApprovalRejected",
    "toolApprovalsRequired",
    "executingToolCalls",
    "tokenUsage",
    "streamOpen",
    "contextChanged",
    "thinking",
]);
export function isAgentStatus(value) {
    return typeof value === "string" && AGENT_STATUS_SET.has(value);
}
export function parseAgentStatus(value) {
    return isAgentStatus(value) ? value : undefined;
}
export function isTransientAgentRunState(value) {
    return typeof value === "string" && TRANSIENT_AGENT_RUN_STATES.has(value);
}
export function isTerminalAgentStatus(status) {
    return (status === "completed" || status === "error" || status === "closed");
}
export function isAgentClosed(status) {
    return status === "closed";
}
export function isRunningAgentStatus(status) {
    return status === "running";
}
export function isExecutingAgentStatus(status) {
    return status === "running" || status === "waitingForApproval";
}
export function isActiveSidebarAgentStatus(status) {
    return (status === "running" ||
        status === "waitingForApproval" ||
        status === "waitingForInput" ||
        status === "costLimitReached" ||
        status === "idle");
}
export function needsAgentAttention(status) {
    return (status === "waitingForApproval" ||
        status === "waitingForInput" ||
        status === "costLimitReached" ||
        status === "error" ||
        status === "idle" ||
        status === "completed");
}
//# sourceMappingURL=agentStatus.js.map