import { useRef } from "react";
import { useAgentInitialPrompt } from "./useAgentInitialPrompt";
import { useAgentPendingInitialPrompt } from "./useAgentPendingInitialPrompt";
import { useAgentSessionCommandBindings } from "./useAgentSessionCommandBindings";
import { useAgentStopCommand } from "./useAgentStopCommand";
import { useAgentSubmitHandlers } from "./useAgentSubmitHandlers";
import { useAgentSubmitResponseHandler } from "./useAgentSubmitResponseHandler";
export function useAgentSubmitLifecycle(input) {
    const { submitResponse, submitHandlers, pendingInitialPrompt, initialPrompt, stop, commandBindings, } = input;
    const submittedInitialPromptKeyRef = useRef(null);
    const handleSubmitResponse = useAgentSubmitResponseHandler(submitResponse);
    const { handleSubmit, handlePushQueuedPrompt, sendQuickMessage } = useAgentSubmitHandlers({
        ...submitHandlers,
        handleSubmitResponse,
    });
    useAgentPendingInitialPrompt({
        ...pendingInitialPrompt,
        submittedInitialPromptKeyRef,
        handleSubmit,
    });
    useAgentInitialPrompt({
        ...initialPrompt,
        submittedInitialPromptKeyRef,
        handleSubmit,
    });
    const handleStop = useAgentStopCommand(stop);
    useAgentSessionCommandBindings({
        ...commandBindings,
        handleStop,
        handleSubmit,
        sendQuickMessage,
    });
    return {
        handleSubmit,
        handlePushQueuedPrompt,
        sendQuickMessage,
        handleStop,
    };
}
//# sourceMappingURL=useAgentSubmitLifecycle.js.map