import { useFlueAgent } from "@flue/react";

import { CHAT_AGENT } from "@/lib/chat/constants";
import type { ChatAgentState } from "@/lib/chat/types";

export const useChatAgent = (): ChatAgentState => {
  const agent = useFlueAgent(CHAT_AGENT);

  return {
    error: agent.error,
    historyReady: agent.historyReady,
    messages: agent.messages,
    sendMessage: agent.sendMessage,
    status: agent.status,
  };
};
