import { BestAgentError } from "@best-agent/foundation";
import { validateProviderResponseFinalAnswer } from "./provider-final-answer-handler.js";
export function assertValidProviderProseResponse(input) {
    const text = input.assertValidTerminalAssistantText(input.text);
    const finalValidation = validateProviderResponseFinalAnswer({
        availableTools: input.availableTools,
        messages: input.messages,
        objective: input.objective,
        text,
    });
    if (!finalValidation.ok) {
        throw new BestAgentError("PROVIDER_DECISION_INVALID", finalValidation.observation.message);
    }
    return text;
}
//# sourceMappingURL=provider-response-validation.js.map