import { useAgentContentChunkHandler } from "./useAgentContentChunkHandler";
import { useAgentContextUpdateHandler } from "./useAgentContextUpdateHandler";
import { useAgentHeartbeatMessages } from "./useAgentHeartbeatMessages";
import { useAgentRunSequenceGuard } from "./useAgentRunSequenceGuard";
import { useAgentSettleCompletedRun } from "./useAgentSettleCompletedRun";
import { useAgentStreamMessageFactory } from "./useAgentStreamMessageFactory";
import { useAgentToolCallHandler } from "./useAgentToolCallHandler";
import { useAgentToolResultHandler } from "./useAgentToolResultHandler";
export function useAgentRunMessagePipeline(input) {
    const { streamMessageFactory, contextUpdate, sequenceGuard, heartbeat, settle, contentChunk, toolCall, toolResult, } = input;
    const createNewStreamMessage = useAgentStreamMessageFactory(streamMessageFactory);
    const handleContextUpdate = useAgentContextUpdateHandler(contextUpdate);
    const acceptRunSequenceFrame = useAgentRunSequenceGuard(sequenceGuard);
    const heartbeatHandlers = useAgentHeartbeatMessages(heartbeat);
    const settleCompletedRun = useAgentSettleCompletedRun({
        ...settle,
        clearHeartbeatMessages: heartbeatHandlers.clearHeartbeatMessages,
    });
    const handleContentChunk = useAgentContentChunkHandler({
        ...contentChunk,
        createNewStreamMessage,
    });
    const handleToolCall = useAgentToolCallHandler({
        ...toolCall,
        createNewStreamMessage,
    });
    const handleToolResult = useAgentToolResultHandler(toolResult);
    return {
        createNewStreamMessage,
        handleContextUpdate,
        acceptRunSequenceFrame,
        ...heartbeatHandlers,
        settleCompletedRun,
        handleContentChunk,
        handleToolCall,
        handleToolResult,
    };
}
//# sourceMappingURL=useAgentRunMessagePipeline.js.map