import { normalizeChatResponseReasoningToolsWithNative, normalizeMessageReasoningToolsWithNative } from '../../router/virtual-router/engine-selection/native-hub-bridge-action-semantics.js';
const MODULE_NAME = 'reasoning-tool-normalizer';
function assertReasoningToolNormalizerNativeAvailable() {
    if (typeof normalizeMessageReasoningToolsWithNative !== 'function' ||
        typeof normalizeChatResponseReasoningToolsWithNative !== 'function') {
        throw new Error(`[${MODULE_NAME}] native bindings unavailable`);
    }
}
export function normalizeMessageReasoningTools(message, options) {
    assertReasoningToolNormalizerNativeAvailable();
    const normalized = normalizeMessageReasoningToolsWithNative(message, typeof options?.idPrefix === 'string' ? options.idPrefix : undefined);
    return {
        toolCallsAdded: normalized.toolCallsAdded,
        ...(typeof normalized.cleanedReasoning === 'string'
            ? { cleanedReasoning: normalized.cleanedReasoning }
            : {})
    };
}
export function normalizeChatResponseReasoningTools(response, options) {
    assertReasoningToolNormalizerNativeAvailable();
    normalizeChatResponseReasoningToolsWithNative(response, typeof options?.idPrefixBase === 'string' ? options.idPrefixBase : undefined);
}
