import { useEffect } from "react";
import { sanitizeAgentMetadata } from "./agentSessionMetadata";
export function useAgentInitialMetadataMerge(input) {
    const { initialMetadata, setAgentMetadata } = input;
    useEffect(() => {
        if (!initialMetadata)
            return;
        setAgentMetadata((prev) => sanitizeAgentMetadata({
            ...(prev || {}),
            ...initialMetadata,
            additionalData: {
                ...(prev?.additionalData || {}),
                ...(initialMetadata?.additionalData || {}),
            },
        }));
    }, [initialMetadata, setAgentMetadata]);
}
//# sourceMappingURL=useAgentInitialMetadataMerge.js.map