import { useCallback, useState } from "react";
export function useAgentToolUiEvents() {
    const [recentToolUiEvents, setRecentToolUiEvents] = useState([]);
    const appendToolUiEvent = useCallback((type, detail, seq) => {
        const timestamp = new Date().toISOString();
        setRecentToolUiEvents((prev) => {
            const next = [
                ...prev,
                {
                    timestamp,
                    type,
                    detail: detail || null,
                    seq: seq ?? null,
                },
            ];
            return next.slice(-40);
        });
    }, []);
    return {
        recentToolUiEvents,
        appendToolUiEvent,
    };
}
//# sourceMappingURL=useAgentToolUiEvents.js.map