"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/env.ts
var MIDSCENE_OPENAI_INIT_CONFIG_JSON = "MIDSCENE_OPENAI_INIT_CONFIG_JSON";
var MIDSCENE_MODEL_NAME = "MIDSCENE_MODEL_NAME";
var MIDSCENE_LANGSMITH_DEBUG = "MIDSCENE_LANGSMITH_DEBUG";
var MIDSCENE_DEBUG_AI_PROFILE = "MIDSCENE_DEBUG_AI_PROFILE";
var MIDSCENE_DEBUG_AI_RESPONSE = "MIDSCENE_DEBUG_AI_RESPONSE";
var MIDSCENE_DANGEROUSLY_PRINT_ALL_CONFIG = "MIDSCENE_DANGEROUSLY_PRINT_ALL_CONFIG";
var MIDSCENE_DEBUG_MODE = "MIDSCENE_DEBUG_MODE";
var MIDSCENE_OPENAI_SOCKS_PROXY = "MIDSCENE_OPENAI_SOCKS_PROXY";
var MIDSCENE_OPENAI_HTTPS_PROXY = "MIDSCENE_OPENAI_HTTPS_PROXY";
var OPENAI_API_KEY = "OPENAI_API_KEY";
var OPENAI_BASE_URL = "OPENAI_BASE_URL";
var OPENAI_MAX_TOKENS = "OPENAI_MAX_TOKENS";
var MIDSCENE_CACHE = "MIDSCENE_CACHE";
var MIDSCENE_USE_VLM_UI_TARS = "MIDSCENE_USE_VLM_UI_TARS";
var MIDSCENE_USE_QWEN_VL = "MIDSCENE_USE_QWEN_VL";
var MATCH_BY_POSITION = "MATCH_BY_POSITION";
var MIDSCENE_API_TYPE = "MIDSCENE-API-TYPE";
var MIDSCENE_REPORT_TAG_NAME = "MIDSCENE_REPORT_TAG_NAME";
var MIDSCENE_USE_AZURE_OPENAI = "MIDSCENE_USE_AZURE_OPENAI";
var MIDSCENE_AZURE_OPENAI_SCOPE = "MIDSCENE_AZURE_OPENAI_SCOPE";
var MIDSCENE_AZURE_OPENAI_INIT_CONFIG_JSON = "MIDSCENE_AZURE_OPENAI_INIT_CONFIG_JSON";
var AZURE_OPENAI_ENDPOINT = "AZURE_OPENAI_ENDPOINT";
var AZURE_OPENAI_KEY = "AZURE_OPENAI_KEY";
var AZURE_OPENAI_API_VERSION = "AZURE_OPENAI_API_VERSION";
var AZURE_OPENAI_DEPLOYMENT = "AZURE_OPENAI_DEPLOYMENT";
var MIDSCENE_USE_ANTHROPIC_SDK = "MIDSCENE_USE_ANTHROPIC_SDK";
var ANTHROPIC_API_KEY = "ANTHROPIC_API_KEY";
var OPENAI_USE_AZURE = "OPENAI_USE_AZURE";
var allConfigFromEnv = () => {
  return {
    [MIDSCENE_OPENAI_INIT_CONFIG_JSON]: process.env[MIDSCENE_OPENAI_INIT_CONFIG_JSON] || void 0,
    [MIDSCENE_MODEL_NAME]: process.env[MIDSCENE_MODEL_NAME] || void 0,
    [MIDSCENE_DEBUG_MODE]: process.env[MIDSCENE_DEBUG_MODE] || void 0,
    [MIDSCENE_LANGSMITH_DEBUG]: process.env[MIDSCENE_LANGSMITH_DEBUG] || void 0,
    [MIDSCENE_DEBUG_AI_PROFILE]: process.env[MIDSCENE_DEBUG_AI_PROFILE] || void 0,
    [MIDSCENE_DEBUG_AI_RESPONSE]: process.env[MIDSCENE_DEBUG_AI_RESPONSE] || void 0,
    [MIDSCENE_DANGEROUSLY_PRINT_ALL_CONFIG]: process.env[MIDSCENE_DANGEROUSLY_PRINT_ALL_CONFIG] || void 0,
    [OPENAI_API_KEY]: process.env[OPENAI_API_KEY] || void 0,
    [OPENAI_BASE_URL]: process.env[OPENAI_BASE_URL] || void 0,
    [OPENAI_MAX_TOKENS]: process.env[OPENAI_MAX_TOKENS] || void 0,
    [OPENAI_USE_AZURE]: process.env[OPENAI_USE_AZURE] || void 0,
    [MIDSCENE_CACHE]: process.env[MIDSCENE_CACHE] || void 0,
    [MATCH_BY_POSITION]: process.env[MATCH_BY_POSITION] || void 0,
    [MIDSCENE_REPORT_TAG_NAME]: process.env[MIDSCENE_REPORT_TAG_NAME] || void 0,
    [MIDSCENE_OPENAI_SOCKS_PROXY]: process.env[MIDSCENE_OPENAI_SOCKS_PROXY] || void 0,
    [MIDSCENE_OPENAI_HTTPS_PROXY]: process.env[MIDSCENE_OPENAI_HTTPS_PROXY] || void 0,
    [MIDSCENE_USE_AZURE_OPENAI]: process.env[MIDSCENE_USE_AZURE_OPENAI] || void 0,
    [MIDSCENE_AZURE_OPENAI_SCOPE]: process.env[MIDSCENE_AZURE_OPENAI_SCOPE] || void 0,
    [MIDSCENE_AZURE_OPENAI_INIT_CONFIG_JSON]: process.env[MIDSCENE_AZURE_OPENAI_INIT_CONFIG_JSON] || void 0,
    [MIDSCENE_USE_ANTHROPIC_SDK]: process.env[MIDSCENE_USE_ANTHROPIC_SDK] || void 0,
    [MIDSCENE_USE_VLM_UI_TARS]: process.env[MIDSCENE_USE_VLM_UI_TARS] || void 0,
    [MIDSCENE_USE_QWEN_VL]: process.env[MIDSCENE_USE_QWEN_VL] || void 0,
    [ANTHROPIC_API_KEY]: process.env[ANTHROPIC_API_KEY] || void 0,
    [AZURE_OPENAI_ENDPOINT]: process.env[AZURE_OPENAI_ENDPOINT] || void 0,
    [AZURE_OPENAI_KEY]: process.env[AZURE_OPENAI_KEY] || void 0,
    [AZURE_OPENAI_API_VERSION]: process.env[AZURE_OPENAI_API_VERSION] || void 0,
    [AZURE_OPENAI_DEPLOYMENT]: process.env[AZURE_OPENAI_DEPLOYMENT] || void 0
  };
};
var userConfig = {};
var getAIConfig = (configKey) => {
  if (configKey === MATCH_BY_POSITION) {
    configKey = MIDSCENE_USE_QWEN_VL;
  }
  if (typeof userConfig[configKey] !== "undefined") {
    return userConfig[configKey];
  }
  return allConfigFromEnv()[configKey];
};
var getAIConfigInBoolean = (configKey) => {
  const config = getAIConfig(configKey) || "";
  return /^(true|1)$/i.test(config);
};
var getAIConfigInJson = (configKey) => {
  const config = getAIConfig(configKey);
  try {
    return config ? JSON.parse(config) : void 0;
  } catch (error) {
    throw new Error(
      `Failed to parse json config: ${configKey}. ${error.message}`,
      {
        cause: error
      }
    );
  }
};
var allAIConfig = () => {
  return { ...allConfigFromEnv(), ...userConfig };
};
var overrideAIConfig = (newConfig, extendMode) => {
  userConfig = extendMode ? { ...userConfig, ...newConfig } : { ...newConfig };
};



































exports.MIDSCENE_OPENAI_INIT_CONFIG_JSON = MIDSCENE_OPENAI_INIT_CONFIG_JSON; exports.MIDSCENE_MODEL_NAME = MIDSCENE_MODEL_NAME; exports.MIDSCENE_LANGSMITH_DEBUG = MIDSCENE_LANGSMITH_DEBUG; exports.MIDSCENE_DEBUG_AI_PROFILE = MIDSCENE_DEBUG_AI_PROFILE; exports.MIDSCENE_DEBUG_AI_RESPONSE = MIDSCENE_DEBUG_AI_RESPONSE; exports.MIDSCENE_DANGEROUSLY_PRINT_ALL_CONFIG = MIDSCENE_DANGEROUSLY_PRINT_ALL_CONFIG; exports.MIDSCENE_DEBUG_MODE = MIDSCENE_DEBUG_MODE; exports.MIDSCENE_OPENAI_SOCKS_PROXY = MIDSCENE_OPENAI_SOCKS_PROXY; exports.MIDSCENE_OPENAI_HTTPS_PROXY = MIDSCENE_OPENAI_HTTPS_PROXY; exports.OPENAI_API_KEY = OPENAI_API_KEY; exports.OPENAI_BASE_URL = OPENAI_BASE_URL; exports.OPENAI_MAX_TOKENS = OPENAI_MAX_TOKENS; exports.MIDSCENE_CACHE = MIDSCENE_CACHE; exports.MIDSCENE_USE_VLM_UI_TARS = MIDSCENE_USE_VLM_UI_TARS; exports.MIDSCENE_USE_QWEN_VL = MIDSCENE_USE_QWEN_VL; exports.MATCH_BY_POSITION = MATCH_BY_POSITION; exports.MIDSCENE_API_TYPE = MIDSCENE_API_TYPE; exports.MIDSCENE_REPORT_TAG_NAME = MIDSCENE_REPORT_TAG_NAME; exports.MIDSCENE_USE_AZURE_OPENAI = MIDSCENE_USE_AZURE_OPENAI; exports.MIDSCENE_AZURE_OPENAI_SCOPE = MIDSCENE_AZURE_OPENAI_SCOPE; exports.MIDSCENE_AZURE_OPENAI_INIT_CONFIG_JSON = MIDSCENE_AZURE_OPENAI_INIT_CONFIG_JSON; exports.AZURE_OPENAI_ENDPOINT = AZURE_OPENAI_ENDPOINT; exports.AZURE_OPENAI_KEY = AZURE_OPENAI_KEY; exports.AZURE_OPENAI_API_VERSION = AZURE_OPENAI_API_VERSION; exports.AZURE_OPENAI_DEPLOYMENT = AZURE_OPENAI_DEPLOYMENT; exports.MIDSCENE_USE_ANTHROPIC_SDK = MIDSCENE_USE_ANTHROPIC_SDK; exports.ANTHROPIC_API_KEY = ANTHROPIC_API_KEY; exports.OPENAI_USE_AZURE = OPENAI_USE_AZURE; exports.getAIConfig = getAIConfig; exports.getAIConfigInBoolean = getAIConfigInBoolean; exports.getAIConfigInJson = getAIConfigInJson; exports.allAIConfig = allAIConfig; exports.overrideAIConfig = overrideAIConfig;

//# sourceMappingURL=chunk-UXPZNWPH.js.map