import { useCallback } from "react";
export function useAgentOperationSocketHandler(input) {
    const { agent, actions } = input;
    return useCallback((messageType, payload) => {
        if (messageType !== "edit-operation") {
            return false;
        }
        if (!agent) {
            return true;
        }
        const operation = payload;
        const operationAgentId = operation.agentId || operation.user?.agentId;
        if (operationAgentId === agent.id) {
            actions.mergeOperationHistory([operation]);
        }
        return true;
    }, [actions, agent]);
}
//# sourceMappingURL=useAgentOperationSocketHandler.js.map