import { buildGeminiToolsFromBridgeWithNative, prepareGeminiToolsForBridgeWithNative } from '../../router/virtual-router/engine-selection/native-shared-conversion-semantics.js';
export function prepareGeminiToolsForBridge(rawTools, missing) {
    if (!rawTools) {
        return undefined;
    }
    const result = prepareGeminiToolsForBridgeWithNative(rawTools, Array.isArray(missing) ? missing : []);
    if (Array.isArray(missing)) {
        missing.splice(0, missing.length, ...result.missing);
    }
    const defs = result.defs;
    return defs && defs.length ? defs : undefined;
}
export function buildGeminiToolsFromBridge(defs, options) {
    if (!defs || !defs.length) {
        return undefined;
    }
    const mode = options?.mode === 'antigravity' ? 'antigravity' : 'default';
    const out = buildGeminiToolsFromBridgeWithNative(defs, mode);
    return out && out.length ? out : undefined;
}
