import { extractReasoningSegmentsWithNative, sanitizeReasoningTaggedTextWithNative } from '../../router/virtual-router/engine-selection/native-shared-conversion-semantics.js';
function assertReasoningUtilsNativeAvailable() {
    if (typeof extractReasoningSegmentsWithNative !== 'function' ||
        typeof sanitizeReasoningTaggedTextWithNative !== 'function') {
        throw new Error('[reasoning-utils] native bindings unavailable');
    }
}
export function extractReasoningSegments(source, reasoningCollector) {
    assertReasoningUtilsNativeAvailable();
    const output = extractReasoningSegmentsWithNative(source ?? '');
    if (reasoningCollector) {
        reasoningCollector.push(...output.segments);
    }
    return output.text;
}
export function sanitizeReasoningTaggedText(value) {
    assertReasoningUtilsNativeAvailable();
    return sanitizeReasoningTaggedTextWithNative(value);
}
