import type { AgentScreenMissingState } from "@/hooks/use-agent-screen-state-machine"; export function reconcileMissingAgentStateWithPresentAgent( state: AgentScreenMissingState, ): AgentScreenMissingState { if (state.kind === "resolving" || state.kind === "not_found") { return { kind: "idle" }; } return state; } export function clearHistorySyncErrorAfterSuccessfulSync( state: AgentScreenMissingState, ): AgentScreenMissingState { if (state.kind === "error") { return { kind: "idle" }; } return state; }