let e=null,t=null,n=null;const r=e=>import(e);typeof process<`u`&&(process.versions?.node||process.versions?.bun)&&(r(`node:fs`).then(t=>{e=t.existsSync}),r(`node:os`).then(e=>{t=e.homedir}),r(`node:path`).then(e=>{n=e.join}));let i=null;function a(){if(i===null){if(!e||!t||!n)return typeof process<`u`&&(process.versions?.node||process.versions?.bun)||(i=!1),!1;let r=process.env.GOOGLE_APPLICATION_CREDENTIALS;i=e(r||n(t(),`.config`,`gcloud`,`application_default_credentials.json`))}return i}function o(e){if(e===`github-copilot`)return process.env.COPILOT_GITHUB_TOKEN||process.env.GH_TOKEN||process.env.GITHUB_TOKEN;if(e===`anthropic`)return process.env.ANTHROPIC_OAUTH_TOKEN||process.env.ANTHROPIC_API_KEY;if(e===`google-vertex`){if(process.env.GOOGLE_CLOUD_API_KEY)return process.env.GOOGLE_CLOUD_API_KEY;let e=a(),t=!!(process.env.GOOGLE_CLOUD_PROJECT||process.env.GCLOUD_PROJECT),n=!!process.env.GOOGLE_CLOUD_LOCATION;if(e&&t&&n)return`<authenticated>`}if(e===`amazon-bedrock`&&(process.env.AWS_PROFILE||process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY||process.env.AWS_BEARER_TOKEN_BEDROCK||process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI||process.env.AWS_CONTAINER_CREDENTIALS_FULL_URI||process.env.AWS_WEB_IDENTITY_TOKEN_FILE))return`<authenticated>`;let t={openai:`OPENAI_API_KEY`,"azure-openai-responses":`AZURE_OPENAI_API_KEY`,google:`GEMINI_API_KEY`,groq:`GROQ_API_KEY`,cerebras:`CEREBRAS_API_KEY`,xai:`XAI_API_KEY`,openrouter:`OPENROUTER_API_KEY`,"vercel-ai-gateway":`AI_GATEWAY_API_KEY`,zai:`ZAI_API_KEY`,mistral:`MISTRAL_API_KEY`,minimax:`MINIMAX_API_KEY`,"minimax-cn":`MINIMAX_CN_API_KEY`,huggingface:`HF_TOKEN`,fireworks:`FIREWORKS_API_KEY`,opencode:`OPENCODE_API_KEY`,"opencode-go":`OPENCODE_API_KEY`,"kimi-coding":`KIMI_API_KEY`}[e];return t?process.env[t]:void 0}export{o as t};