"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.n = (module)=>{
        var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
        __webpack_require__.d(getter, {
            a: getter
        });
        return getter;
    };
})();
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    callAIWithObjectResponse: ()=>callAIWithObjectResponse,
    extractJSONFromCodeBlock: ()=>extractJSONFromCodeBlock,
    preprocessDoubaoBboxJson: ()=>preprocessDoubaoBboxJson,
    resolveReasoningConfig: ()=>resolveReasoningConfig,
    safeParseJson: ()=>safeParseJson,
    callAI: ()=>callAI,
    AIResponseParseError: ()=>AIResponseParseError,
    callAIWithStringResponse: ()=>callAIWithStringResponse
});
const env_namespaceObject = require("@midscene/shared/env");
const logger_namespaceObject = require("@midscene/shared/logger");
const utils_namespaceObject = require("@midscene/shared/utils");
const external_jsonrepair_namespaceObject = require("jsonrepair");
const external_openai_namespaceObject = require("openai");
var external_openai_default = /*#__PURE__*/ __webpack_require__.n(external_openai_namespaceObject);
const util_js_namespaceObject = require("../auto-glm/util.js");
const external_codex_app_server_js_namespaceObject = require("./codex-app-server.js");
const external_image_detail_js_namespaceObject = require("./image-detail.js");
const external_request_timeout_js_namespaceObject = require("./request-timeout.js");
function _define_property(obj, key, value) {
    if (key in obj) Object.defineProperty(obj, key, {
        value: value,
        enumerable: true,
        configurable: true,
        writable: true
    });
    else obj[key] = value;
    return obj;
}
class AIResponseParseError extends Error {
    constructor(message, rawResponse, usage){
        super(message), _define_property(this, "usage", void 0), _define_property(this, "rawResponse", void 0);
        this.name = 'AIResponseParseError';
        this.rawResponse = rawResponse;
        this.usage = usage;
    }
}
async function createChatClient({ modelConfig }) {
    const { socksProxy, httpProxy, modelName, openaiBaseURL, openaiApiKey, openaiExtraConfig, modelDescription, uiTarsModelVersion, modelFamily, createOpenAIClient, timeout } = modelConfig;
    let proxyAgent;
    const warnClient = (0, logger_namespaceObject.getDebug)('ai:call', {
        console: true
    });
    const debugProxy = (0, logger_namespaceObject.getDebug)('ai:call:proxy');
    const warnProxy = (0, logger_namespaceObject.getDebug)('ai:call:proxy', {
        console: true
    });
    const sanitizeProxyUrl = (url)=>{
        try {
            const parsed = new URL(url);
            if (parsed.username) {
                parsed.password = '****';
                return parsed.href;
            }
            return url;
        } catch  {
            return url;
        }
    };
    if (httpProxy) {
        debugProxy('using http proxy', sanitizeProxyUrl(httpProxy));
        if (utils_namespaceObject.ifInBrowser) warnProxy('HTTP proxy is configured but not supported in browser environment');
        else {
            const moduleName = 'undici';
            const { ProxyAgent } = await import(moduleName);
            proxyAgent = new ProxyAgent({
                uri: httpProxy
            });
        }
    } else if (socksProxy) {
        debugProxy('using socks proxy', sanitizeProxyUrl(socksProxy));
        if (utils_namespaceObject.ifInBrowser) warnProxy('SOCKS proxy is configured but not supported in browser environment');
        else try {
            const moduleName = 'fetch-socks';
            const { socksDispatcher } = await import(moduleName);
            const proxyUrl = new URL(socksProxy);
            if (!proxyUrl.hostname) throw new Error('SOCKS proxy URL must include a valid hostname');
            const port = Number.parseInt(proxyUrl.port, 10);
            if (!proxyUrl.port || Number.isNaN(port)) throw new Error('SOCKS proxy URL must include a valid port');
            const protocol = proxyUrl.protocol.replace(':', '');
            const socksType = 'socks4' === protocol ? 4 : 'socks5' === protocol ? 5 : 5;
            proxyAgent = socksDispatcher({
                type: socksType,
                host: proxyUrl.hostname,
                port,
                ...proxyUrl.username ? {
                    userId: decodeURIComponent(proxyUrl.username),
                    password: decodeURIComponent(proxyUrl.password || '')
                } : {}
            });
            debugProxy('socks proxy configured successfully', {
                type: socksType,
                host: proxyUrl.hostname,
                port: port
            });
        } catch (error) {
            warnProxy('Failed to configure SOCKS proxy:', error);
            throw new Error(`Invalid SOCKS proxy URL: ${socksProxy}. Expected format: socks4://host:port, socks5://host:port, or with authentication: socks5://user:pass@host:port`);
        }
    }
    const effectiveTimeoutMs = (0, external_request_timeout_js_namespaceObject.resolveEffectiveTimeoutMs)({
        timeout
    });
    const openAIOptions = {
        baseURL: openaiBaseURL,
        apiKey: openaiApiKey,
        ...proxyAgent ? {
            fetchOptions: {
                dispatcher: proxyAgent
            }
        } : {},
        ...openaiExtraConfig,
        maxRetries: 0,
        ...null !== effectiveTimeoutMs ? {
            timeout: effectiveTimeoutMs
        } : {},
        dangerouslyAllowBrowser: true
    };
    const baseOpenAI = new (external_openai_default())(openAIOptions);
    let openai = baseOpenAI;
    if (openai && env_namespaceObject.globalConfigManager.getEnvConfigInBoolean(env_namespaceObject.MIDSCENE_LANGSMITH_DEBUG)) {
        if (utils_namespaceObject.ifInBrowser) throw new Error('langsmith is not supported in browser');
        warnClient('DEBUGGING MODE: langsmith wrapper enabled');
        const langsmithModule = 'langsmith/wrappers';
        const { wrapOpenAI } = await import(langsmithModule);
        openai = wrapOpenAI(openai);
    }
    if (openai && env_namespaceObject.globalConfigManager.getEnvConfigInBoolean(env_namespaceObject.MIDSCENE_LANGFUSE_DEBUG)) {
        if (utils_namespaceObject.ifInBrowser) throw new Error('langfuse is not supported in browser');
        warnClient('DEBUGGING MODE: langfuse wrapper enabled');
        const langfuseModule = '@langfuse/openai';
        const { observeOpenAI } = await import(langfuseModule);
        openai = observeOpenAI(openai);
    }
    if (createOpenAIClient) {
        const wrappedClient = await createOpenAIClient(baseOpenAI, openAIOptions);
        if (wrappedClient) openai = wrappedClient;
    }
    return {
        completion: openai.chat.completions,
        modelName,
        modelDescription,
        uiTarsModelVersion,
        modelFamily
    };
}
async function callAI(messages, modelConfig, options) {
    if ((0, external_codex_app_server_js_namespaceObject.isCodexAppServerProvider)(modelConfig.openaiBaseURL)) {
        if (!modelConfig.modelFamily && hasExplicitReasoningConfig({
            reasoningEnabled: modelConfig.reasoningEnabled,
            reasoningEffort: modelConfig.reasoningEffort,
            reasoningBudget: modelConfig.reasoningBudget
        })) throw new Error('Reasoning config requires MIDSCENE_MODEL_FAMILY. Set MIDSCENE_MODEL_FAMILY when using MIDSCENE_MODEL_REASONING_ENABLED / MIDSCENE_MODEL_REASONING_EFFORT / MIDSCENE_MODEL_REASONING_BUDGET.');
        return (0, external_codex_app_server_js_namespaceObject.callAIWithCodexAppServer)(messages, modelConfig, {
            stream: options?.stream,
            onChunk: options?.onChunk,
            reasoningEnabled: modelConfig.reasoningEnabled,
            abortSignal: options?.abortSignal
        });
    }
    const { completion, modelName, modelDescription, uiTarsModelVersion, modelFamily } = await createChatClient({
        modelConfig
    });
    const effectiveTimeoutMs = (0, external_request_timeout_js_namespaceObject.resolveEffectiveTimeoutMs)(modelConfig);
    const extraBody = modelConfig.extraBody;
    const maxTokens = env_namespaceObject.globalConfigManager.getEnvConfigValueAsNumber(env_namespaceObject.MIDSCENE_MODEL_MAX_TOKENS) ?? env_namespaceObject.globalConfigManager.getEnvConfigValueAsNumber(env_namespaceObject.OPENAI_MAX_TOKENS);
    const debugCall = (0, logger_namespaceObject.getDebug)('ai:call');
    const warnCall = (0, logger_namespaceObject.getDebug)('ai:call', {
        console: true
    });
    const debugProfileStats = (0, logger_namespaceObject.getDebug)('ai:profile:stats');
    const debugProfileDetail = (0, logger_namespaceObject.getDebug)('ai:profile:detail');
    const startTime = Date.now();
    const temperature = (()=>{
        if ('gpt-5' === modelFamily) return void debugCall('temperature is ignored for gpt-5');
        return modelConfig.temperature ?? 0;
    })();
    const isStreaming = options?.stream && options?.onChunk;
    let content;
    let accumulated = '';
    let accumulatedReasoning = '';
    let usage;
    let timeCost;
    let requestId;
    const hasUsableText = (value)=>'string' == typeof value && value.trim().length > 0;
    const buildUsageInfo = (usageData, requestId)=>{
        if (!usageData) return;
        const cachedInputTokens = usageData?.prompt_tokens_details?.cached_tokens;
        return {
            prompt_tokens: usageData.prompt_tokens ?? 0,
            completion_tokens: usageData.completion_tokens ?? 0,
            total_tokens: usageData.total_tokens ?? 0,
            cached_input: cachedInputTokens ?? 0,
            time_cost: timeCost ?? 0,
            model_name: modelName,
            model_description: modelDescription,
            slot: modelConfig.slot,
            intent: void 0,
            request_id: requestId ?? void 0
        };
    };
    const commonConfig = {
        temperature,
        stream: !!isStreaming,
        max_tokens: maxTokens,
        ...'qwen2.5-vl' === modelFamily ? {
            vl_high_resolution_images: true
        } : {}
    };
    if ((0, util_js_namespaceObject.isAutoGLM)(modelFamily)) {
        commonConfig.top_p = 0.85;
        commonConfig.frequency_penalty = 0.2;
    }
    const { config: reasoningEffortConfig, debugMessage: reasoningEffortDebugMessage } = resolveReasoningConfig({
        reasoningEnabled: modelConfig.reasoningEnabled,
        reasoningEffort: modelConfig.reasoningEffort,
        reasoningBudget: modelConfig.reasoningBudget,
        modelFamily
    });
    if (reasoningEffortDebugMessage) debugCall(reasoningEffortDebugMessage);
    const shouldUseOriginalImageDetail = (0, external_image_detail_js_namespaceObject.shouldForceOriginalImageDetail)(modelConfig);
    const messagesWithImageDetail = (()=>{
        if (!shouldUseOriginalImageDetail) return messages;
        return messages.map((msg)=>{
            if (!Array.isArray(msg.content)) return msg;
            const content = msg.content.map((part)=>{
                if (part && 'image_url' === part.type && part.image_url?.url) return {
                    ...part,
                    image_url: {
                        ...part.image_url,
                        detail: 'original'
                    }
                };
                return part;
            });
            return {
                ...msg,
                content
            };
        });
    })();
    try {
        debugCall(`sending ${isStreaming ? 'streaming ' : ''}request to ${modelName}`);
        if (isStreaming) {
            const { signal: streamSignal, cleanup: cleanupStreamSignal } = (0, external_request_timeout_js_namespaceObject.buildRequestAbortSignal)(effectiveTimeoutMs, options?.abortSignal);
            try {
                const stream = await completion.create({
                    model: modelName,
                    messages: messagesWithImageDetail,
                    ...commonConfig,
                    ...reasoningEffortConfig,
                    ...extraBody
                }, {
                    stream: true,
                    signal: streamSignal
                });
                requestId = stream._request_id;
                for await (const chunk of stream){
                    const content = chunk.choices?.[0]?.delta?.content || '';
                    const reasoning_content = chunk.choices?.[0]?.delta?.reasoning_content || '';
                    if (chunk.usage) usage = chunk.usage;
                    if (content || reasoning_content) {
                        accumulated += content;
                        accumulatedReasoning += reasoning_content;
                        const chunkData = {
                            content,
                            reasoning_content,
                            accumulated,
                            isComplete: false,
                            usage: void 0
                        };
                        options.onChunk(chunkData);
                    }
                    if (chunk.choices?.[0]?.finish_reason) {
                        timeCost = Date.now() - startTime;
                        if (!usage) {
                            const estimatedTokens = Math.max(1, Math.floor(accumulated.length / 4));
                            usage = {
                                prompt_tokens: estimatedTokens,
                                completion_tokens: estimatedTokens,
                                total_tokens: 2 * estimatedTokens
                            };
                        }
                        const finalChunk = {
                            content: '',
                            accumulated,
                            reasoning_content: '',
                            isComplete: true,
                            usage: buildUsageInfo(usage, requestId)
                        };
                        options.onChunk(finalChunk);
                        break;
                    }
                }
            } finally{
                cleanupStreamSignal();
            }
            content = accumulated;
            debugProfileStats(`streaming model, ${modelName}, mode, ${modelFamily || 'default'}, cost-ms, ${timeCost}, temperature, ${temperature ?? ''}`);
        } else {
            const retryCount = modelConfig.retryCount ?? 1;
            const retryInterval = modelConfig.retryInterval ?? 2000;
            const maxAttempts = retryCount + 1;
            let lastError;
            for(let attempt = 1; attempt <= maxAttempts; attempt++){
                const { signal: attemptSignal, cleanup: cleanupAttemptSignal } = (0, external_request_timeout_js_namespaceObject.buildRequestAbortSignal)(effectiveTimeoutMs, options?.abortSignal);
                try {
                    const result = await completion.create({
                        model: modelName,
                        messages: messagesWithImageDetail,
                        ...commonConfig,
                        ...reasoningEffortConfig,
                        ...extraBody
                    }, {
                        signal: attemptSignal
                    });
                    timeCost = Date.now() - startTime;
                    debugProfileStats(`model, ${modelName}, mode, ${modelFamily || 'default'}, ui-tars-version, ${uiTarsModelVersion}, prompt-tokens, ${result.usage?.prompt_tokens || ''}, completion-tokens, ${result.usage?.completion_tokens || ''}, total-tokens, ${result.usage?.total_tokens || ''}, cost-ms, ${timeCost}, requestId, ${result._request_id || ''}, temperature, ${temperature ?? ''}`);
                    debugProfileDetail(`model usage detail: ${JSON.stringify(result.usage)}`);
                    if (!result.choices) throw new Error(`invalid response from LLM service: ${JSON.stringify(result)}`);
                    content = result.choices[0].message.content;
                    accumulatedReasoning = result.choices[0].message?.reasoning_content || '';
                    usage = result.usage;
                    requestId = result._request_id;
                    if (!hasUsableText(content) && hasUsableText(accumulatedReasoning)) {
                        warnCall('empty content from AI model, using reasoning content');
                        content = accumulatedReasoning;
                    }
                    if (!hasUsableText(content)) throw new AIResponseParseError('empty content from AI model', JSON.stringify(result), buildUsageInfo(usage, requestId));
                    break;
                } catch (error) {
                    lastError = error;
                    const wasHardTimeout = (0, external_request_timeout_js_namespaceObject.isHardTimeoutError)(lastError);
                    if (wasHardTimeout) warnCall(`AI call hit hard timeout (${effectiveTimeoutMs}ms, attempt ${attempt}/${maxAttempts}, model ${modelName}, slot ${modelConfig.slot})`);
                    if (options?.abortSignal?.aborted) break;
                    if (attempt < maxAttempts) {
                        warnCall(`AI call failed (attempt ${attempt}/${maxAttempts}), retrying in ${retryInterval}ms... Error: ${lastError.message}`);
                        await new Promise((resolve)=>setTimeout(resolve, retryInterval));
                    }
                } finally{
                    cleanupAttemptSignal();
                }
            }
            if (!content) throw lastError;
        }
        debugCall(`response reasoning content: ${accumulatedReasoning}`);
        debugCall(`response content: ${content}`);
        if (isStreaming && !usage) {
            const estimatedTokens = Math.max(1, Math.floor((content || '').length / 4));
            usage = {
                prompt_tokens: estimatedTokens,
                completion_tokens: estimatedTokens,
                total_tokens: 2 * estimatedTokens
            };
        }
        return {
            content: content || '',
            reasoning_content: accumulatedReasoning || void 0,
            usage: buildUsageInfo(usage, requestId),
            isStreamed: !!isStreaming
        };
    } catch (e) {
        warnCall('call AI error', e);
        if (e instanceof AIResponseParseError) throw e;
        const newError = new Error(`failed to call ${isStreaming ? 'streaming ' : ''}AI model service (${modelName}): ${e.message}\nTrouble shooting: https://midscenejs.com/model-provider.html`, {
            cause: e
        });
        throw newError;
    }
}
async function callAIWithObjectResponse(messages, modelConfig, options) {
    const response = await callAI(messages, modelConfig, {
        abortSignal: options?.abortSignal
    });
    (0, utils_namespaceObject.assert)(response, 'empty response');
    const modelFamily = modelConfig.modelFamily;
    const jsonContent = safeParseJson(response.content, modelFamily);
    if ('object' != typeof jsonContent) throw new AIResponseParseError(`failed to parse json response from model (${modelConfig.modelName}): ${response.content}`, response.content, response.usage);
    return {
        content: jsonContent,
        contentString: response.content,
        usage: response.usage,
        reasoning_content: response.reasoning_content
    };
}
async function callAIWithStringResponse(msgs, modelConfig, options) {
    const { content, usage } = await callAI(msgs, modelConfig, {
        abortSignal: options?.abortSignal
    });
    return {
        content,
        usage
    };
}
function extractJSONFromCodeBlock(response) {
    try {
        const jsonMatch = response.match(/^\s*(\{[\s\S]*\})\s*$/);
        if (jsonMatch) return jsonMatch[1];
        const codeBlockMatch = response.match(/```(?:json)?\s*(\{[\s\S]*?\})\s*```/);
        if (codeBlockMatch) return codeBlockMatch[1];
        const jsonLikeMatch = response.match(/\{[\s\S]*\}/);
        if (jsonLikeMatch) return jsonLikeMatch[0];
    } catch  {}
    return response;
}
function preprocessDoubaoBboxJson(input) {
    if (input.includes('bbox')) while(/\d+\s+\d+/.test(input))input = input.replace(/(\d+)\s+(\d+)/g, '$1,$2');
    return input;
}
function hasExplicitReasoningConfig({ reasoningEnabled, reasoningEffort, reasoningBudget }) {
    return void 0 !== reasoningEnabled || !!reasoningEffort || void 0 !== reasoningBudget;
}
const SUPPORTED_REASONING_FAMILIES = [
    'qwen3-vl',
    'qwen3.5',
    'qwen3.6',
    'doubao-vision',
    'doubao-seed',
    'glm-v'
];
function isSupportedReasoningFamily(family) {
    return !!family && SUPPORTED_REASONING_FAMILIES.includes(family);
}
function supportedReasoningFamilyNames() {
    return SUPPORTED_REASONING_FAMILIES.join(', ');
}
function resolveReasoningConfig({ reasoningEnabled, reasoningEffort, reasoningBudget, modelFamily }) {
    const hasExplicitConfig = hasExplicitReasoningConfig({
        reasoningEnabled,
        reasoningEffort,
        reasoningBudget
    });
    if (hasExplicitConfig) {
        if (!modelFamily) throw new Error(`Reasoning config requires MIDSCENE_MODEL_FAMILY. Set MIDSCENE_MODEL_FAMILY to a supported family such as ${supportedReasoningFamilyNames()}, or remove MIDSCENE_MODEL_REASONING_ENABLED / MIDSCENE_MODEL_REASONING_EFFORT / MIDSCENE_MODEL_REASONING_BUDGET.`);
        if (!isSupportedReasoningFamily(modelFamily)) throw new Error(`Reasoning config is not supported for model family "${modelFamily}". Use a supported family such as ${supportedReasoningFamilyNames()}, or remove MIDSCENE_MODEL_REASONING_ENABLED / MIDSCENE_MODEL_REASONING_EFFORT / MIDSCENE_MODEL_REASONING_BUDGET.`);
    } else if (!isSupportedReasoningFamily(modelFamily)) return {
        config: {}
    };
    const effectiveReasoningEnabled = reasoningEnabled ?? false;
    const debugMessages = [];
    const config = {};
    if ('qwen3-vl' === modelFamily || 'qwen3.5' === modelFamily || 'qwen3.6' === modelFamily) {
        config.enable_thinking = effectiveReasoningEnabled;
        debugMessages.push(`enable_thinking=${effectiveReasoningEnabled}`);
        if (void 0 !== reasoningBudget) {
            config.thinking_budget = reasoningBudget;
            debugMessages.push(`thinking_budget=${reasoningBudget}`);
        }
    } else if ('doubao-vision' === modelFamily || 'doubao-seed' === modelFamily) {
        config.thinking = {
            type: effectiveReasoningEnabled ? 'enabled' : 'disabled'
        };
        debugMessages.push(`thinking.type=${effectiveReasoningEnabled ? 'enabled' : 'disabled'}`);
        if (reasoningEffort) {
            config.reasoning_effort = reasoningEffort;
            debugMessages.push(`reasoning_effort="${reasoningEffort}"`);
        }
    } else if ('glm-v' === modelFamily) {
        config.thinking = {
            type: effectiveReasoningEnabled ? 'enabled' : 'disabled'
        };
        debugMessages.push(`thinking.type=${effectiveReasoningEnabled ? 'enabled' : 'disabled'}`);
    }
    return {
        config,
        debugMessage: debugMessages.length ? `reasoning config for ${modelFamily}: ${debugMessages.join(', ')}` : void 0
    };
}
function normalizeJsonObject(obj) {
    if (null == obj) return obj;
    if (Array.isArray(obj)) return obj.map((item)=>normalizeJsonObject(item));
    if ('object' == typeof obj) {
        const normalized = {};
        for (const [key, value] of Object.entries(obj)){
            const trimmedKey = key.trim();
            let normalizedValue = normalizeJsonObject(value);
            if ('string' == typeof normalizedValue) normalizedValue = normalizedValue.trim();
            normalized[trimmedKey] = normalizedValue;
        }
        return normalized;
    }
    if ('string' == typeof obj) return obj.trim();
    return obj;
}
function safeParseJson(input, modelFamily) {
    const cleanJsonString = extractJSONFromCodeBlock(input);
    if (cleanJsonString?.match(/\((\d+),(\d+)\)/)) return cleanJsonString.match(/\((\d+),(\d+)\)/)?.slice(1).map(Number);
    let parsed;
    let lastError;
    try {
        parsed = JSON.parse(cleanJsonString);
        return normalizeJsonObject(parsed);
    } catch (error) {
        lastError = error;
    }
    try {
        parsed = JSON.parse((0, external_jsonrepair_namespaceObject.jsonrepair)(cleanJsonString));
        return normalizeJsonObject(parsed);
    } catch (error) {
        lastError = error;
    }
    if ('doubao-vision' === modelFamily || 'doubao-seed' === modelFamily || (0, util_js_namespaceObject.isUITars)(modelFamily)) {
        const jsonString = preprocessDoubaoBboxJson(cleanJsonString);
        try {
            parsed = JSON.parse((0, external_jsonrepair_namespaceObject.jsonrepair)(jsonString));
            return normalizeJsonObject(parsed);
        } catch (error) {
            lastError = error;
        }
    }
    throw Error(`failed to parse LLM response into JSON. Error - ${String(lastError ?? 'unknown error')}. Response - \n ${input}`);
}
exports.AIResponseParseError = __webpack_exports__.AIResponseParseError;
exports.callAI = __webpack_exports__.callAI;
exports.callAIWithObjectResponse = __webpack_exports__.callAIWithObjectResponse;
exports.callAIWithStringResponse = __webpack_exports__.callAIWithStringResponse;
exports.extractJSONFromCodeBlock = __webpack_exports__.extractJSONFromCodeBlock;
exports.preprocessDoubaoBboxJson = __webpack_exports__.preprocessDoubaoBboxJson;
exports.resolveReasoningConfig = __webpack_exports__.resolveReasoningConfig;
exports.safeParseJson = __webpack_exports__.safeParseJson;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "AIResponseParseError",
    "callAI",
    "callAIWithObjectResponse",
    "callAIWithStringResponse",
    "extractJSONFromCodeBlock",
    "preprocessDoubaoBboxJson",
    "resolveReasoningConfig",
    "safeParseJson"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});

//# sourceMappingURL=index.js.map