omniroute 2.8.3 → 2.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/.next/BUILD_ID +1 -1
- package/app/.next/build-manifest.json +2 -2
- package/app/.next/prerender-manifest.json +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/a2a/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/agents/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/auto-combo/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/costs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/limits/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/logs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/mcp/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/search-tools/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/400/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/401/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/403/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/408/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/429/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/500/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/502/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/503/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error.html +2 -2
- package/app/.next/server/app/_global-error.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/catalog/route.js +1 -1
- package/app/.next/server/app/api/models/catalog/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/[id]/models/route.js +2 -2
- package/app/.next/server/app/api/providers/[id]/test/route.js +3 -3
- package/app/.next/server/app/api/providers/route.js +1 -1
- package/app/.next/server/app/api/providers/test-batch/route.js +6 -6
- package/app/.next/server/app/api/v1/models/route.js +3 -3
- package/app/.next/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/route.js +3 -3
- package/app/.next/server/app/api/v1/route.js.nft.json +1 -1
- package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/forgot-password/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/maintenance/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/offline/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/status/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__09c944b3._.js +2 -2
- package/app/.next/server/chunks/[root-of-the-server]__134baf4c._.js +2 -2
- package/app/.next/server/chunks/[root-of-the-server]__179c5303._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__237e5042._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__2f8f5f38._.js +2 -2
- package/app/.next/server/chunks/[root-of-the-server]__31027061._.js +4 -0
- package/app/.next/server/chunks/[root-of-the-server]__3e042fbd._.js +2 -2
- package/app/.next/server/chunks/[root-of-the-server]__46fad57a._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__7a9b72a4._.js +2 -2
- package/app/.next/server/chunks/[root-of-the-server]__7d9b23e7._.js +2 -2
- package/app/.next/server/chunks/[root-of-the-server]__80e3bfc3._.js +2 -2
- package/app/.next/server/chunks/[root-of-the-server]__84e445b2._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__92cb0def._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__9bbd49c8._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__add0a68c._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__c393c81f._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__cd42b732._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__d4563e10._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__d7914418._.js +4 -0
- package/app/.next/server/chunks/[root-of-the-server]__db2f9fe0._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__e27a89bd._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__e56edf04._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__e6e94646._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__eb98039a._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__ebf3fe48._.js +2 -2
- package/app/.next/server/chunks/[root-of-the-server]__f0131d95._.js +4 -0
- package/app/.next/server/chunks/[root-of-the-server]__f31b4656._.js +3 -3
- package/app/.next/server/chunks/[root-of-the-server]__fad1679d._.js +2 -2
- package/app/.next/server/chunks/_05c48915._.js +1 -1
- package/app/.next/server/chunks/_2115d8de._.js +1 -1
- package/app/.next/server/chunks/_3ac953eb._.js +1 -1
- package/app/.next/server/chunks/_4b8fd853._.js +1 -1
- package/app/.next/server/chunks/_68683848._.js +1 -1
- package/app/.next/server/chunks/_ee9b677b._.js +1 -1
- package/app/.next/server/chunks/open-sse_cf4d5692._.js +1 -1
- package/app/.next/server/chunks/open-sse_config_constants_ts_9583de19._.js +1 -1
- package/app/.next/server/chunks/open-sse_services_826884e1._.js +2 -1
- package/app/.next/server/chunks/ssr/[root-of-the-server]__9affb65e._.js +1 -1
- package/app/.next/server/chunks/ssr/[root-of-the-server]__a6942102._.js +1 -1
- package/app/.next/server/chunks/ssr/_19b3d5b1._.js +2 -2
- package/app/.next/server/chunks/ssr/src_9197fb9b._.js +1 -1
- package/app/.next/server/chunks/ssr/src_ec615d6e._.js +2 -2
- package/app/.next/server/chunks/ssr/src_lib_initCloudSync_ts_982b9d4d._.js +1 -1
- package/app/.next/server/pages/500.html +2 -2
- package/app/.next/server/server-reference-manifest.js +1 -1
- package/app/.next/server/server-reference-manifest.json +1 -1
- package/app/.next/static/chunks/{37e9976d0367faad.js → 3fa6c964786c962d.js} +4 -4
- package/app/.next/static/chunks/{19b1432393321fcf.js → d9a70775eb233dc3.js} +1 -1
- package/app/.next/static/chunks/{0f71d7fbf89bb737.js → ec1938d17386c6db.js} +1 -1
- package/app/CHANGELOG.md +53 -0
- package/app/docs/ARCHITECTURE.md +1 -1
- package/app/docs/VM_DEPLOYMENT_GUIDE.md +2 -0
- package/app/docs/i18n/README.md +9 -17
- package/app/docs/i18n/ar/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/bg/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/da/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/de/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/es/VM_DEPLOYMENT_GUIDE.md +107 -109
- package/app/docs/i18n/fi/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/fr/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/he/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/hu/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/id/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/in/VM_DEPLOYMENT_GUIDE.md +102 -210
- package/app/docs/i18n/it/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/ja/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/ko/VM_DEPLOYMENT_GUIDE.md +109 -111
- package/app/docs/i18n/ms/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/nl/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/no/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/phi/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/pl/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/pt/VM_DEPLOYMENT_GUIDE.md +96 -98
- package/app/docs/i18n/pt-BR/VM_DEPLOYMENT_GUIDE.md +96 -98
- package/app/docs/i18n/ro/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/ru/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/sk/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/sv/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/th/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/uk-UA/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/vi/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/i18n/zh-CN/VM_DEPLOYMENT_GUIDE.md +110 -112
- package/app/docs/openapi.yaml +1 -1
- package/app/open-sse/config/constants.ts +3 -3
- package/app/open-sse/services/comboAgentMiddleware.ts +9 -1
- package/app/package-lock.json +5 -5
- package/app/package.json +1 -1
- package/app/scripts/i18n/generate-multilang.mjs +1 -0
- package/app/src/shared/constants/cliTools.ts +2 -2
- package/app/src/shared/constants/providers.ts +3 -0
- package/app/src/shared/validation/providerSchema.ts +6 -0
- package/app/tests/e2e/providers-bailian-coding-plan.spec.ts +14 -0
- package/package.json +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__61396d77._.js +0 -4
- package/app/.next/server/chunks/[root-of-the-server]__d5ecc2ba._.js +0 -4
- package/app/.next/server/chunks/[root-of-the-server]__daa26645._.js +0 -4
- /package/app/.next/static/{IiXcm5VJcOKrDneQQSdf- → coLESPH6_RrEzzULWq8F5}/_buildManifest.js +0 -0
- /package/app/.next/static/{IiXcm5VJcOKrDneQQSdf- → coLESPH6_RrEzzULWq8F5}/_clientMiddlewareManifest.json +0 -0
- /package/app/.next/static/{IiXcm5VJcOKrDneQQSdf- → coLESPH6_RrEzzULWq8F5}/_ssgManifest.js +0 -0
|
@@ -4,7 +4,7 @@ module.exports=[781133,a=>{"use strict";let b={claude:{id:"claude",name:"Claude
|
|
|
4
4
|
"model": "{{model}}",
|
|
5
5
|
"provider": "openai",
|
|
6
6
|
"apiKey": "{{apiKey}}"
|
|
7
|
-
}`}},antigravity:{id:"antigravity",name:"Antigravity",image:"/providers/antigravity.png",color:"#4285F4",description:"Google Antigravity IDE with MITM",configType:"mitm",modelAliases:["claude-opus-4-6-thinking","claude-sonnet-4-6","gemini-3-flash","gpt-oss-120b-medium","gemini-3.1-pro-high","gemini-3.1-pro-low"],defaultModels:[{id:"gemini-3.1-pro-high",name:"Gemini 3.1 Pro High",alias:"gemini-3.1-pro-high"},{id:"gemini-3.1-pro-low",name:"Gemini 3.1 Pro Low",alias:"gemini-3.1-pro-low"},{id:"gemini-3-flash",name:"Gemini 3 Flash",alias:"gemini-3-flash"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",alias:"claude-sonnet-4-6"},{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 Thinking",alias:"claude-opus-4-6-thinking"},{id:"gpt-oss-120b-medium",name:"GPT OSS 120B Medium",alias:"gpt-oss-120b-medium"}]},copilot:{id:"copilot",name:"GitHub Copilot",image:"/providers/copilot.png",color:"#1F6FEB",description:"GitHub Copilot Chat — VS Code Extension",configType:"custom"},opencode:{id:"opencode",name:"OpenCode",image:"/providers/opencode.png",icon:"terminal",color:"#FF6B35",description:"OpenCode AI coding agent (Terminal)",configType:"guide",guideSteps:[{step:1,title:"Install OpenCode",desc:"Install via npm: npm install -g opencode-ai"},{step:2,title:"API Key",type:"apiKeySelector"},{step:3,title:"Set Base URL",desc:"opencode config set baseUrl {{baseUrl}}"},{step:4,title:"Select Model",type:"modelSelector"}]},kiro:{id:"kiro",name:"Kiro AI",image:"/providers/kiro.png",icon:"psychology_alt",color:"#FF6B35",description:"Amazon Kiro — AI-powered IDE",configType:"guide",guideSteps:[{step:1,title:"Open Kiro Settings",desc:"Go to Settings → AI Provider"},{step:2,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:3,title:"API Key",type:"apiKeySelector"},{step:4,title:"Select Model",type:"modelSelector"}]}};a.s(["CLI_TOOLS",0,b])},210849,a=>{"use strict";var b=a.i(646958);a.s(["ManualConfigModal",()=>b.default])},116795,a=>{"use strict";var b=a.i(187924),c=a.i(32886),d=a.i(415925);function e({effectiveConfigStatus:a,batchStatus:e,lastConfiguredAt:f=null}){let g=(0,d.useTranslations)("cliTools"),h=(0,c.useLocale)(),i=a||e?.configStatus||null,j={configured:{dotClass:"bg-green-500",badgeClass:"bg-green-500/10 text-green-600 dark:text-green-400",text:g("configured")},not_configured:{dotClass:"bg-yellow-500",badgeClass:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",text:g("notConfigured")},not_installed:{dotClass:"bg-zinc-400 dark:bg-zinc-500",badgeClass:"bg-zinc-500/10 text-zinc-500 dark:text-zinc-400",text:g("notInstalled")},other:{dotClass:"bg-blue-500",badgeClass:"bg-blue-500/10 text-blue-600 dark:text-blue-400",text:g("custom")},unknown:{dotClass:"bg-zinc-400 dark:bg-zinc-500",badgeClass:"bg-zinc-500/10 text-zinc-500 dark:text-zinc-400",text:g("unknown")}},k=i?j[i]||j.unknown:null;return(0,b.jsxs)(b.Fragment,{children:[k&&(0,b.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full ${k.badgeClass}`,children:[(0,b.jsx)("span",{className:`size-1.5 rounded-full ${k.dotClass}`}),k.text]}),f?(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] text-text-muted",title:g("lastSavedAt",{date:new Date(f).toLocaleString(h)}),children:[(0,b.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"schedule"}),function(a,b){let c=Date.now()-new Date(a).getTime();if(c<0)return b("justNow");let d=Math.floor(c/1e3);if(d<60)return b("justNow");let e=Math.floor(d/60);if(e<60)return b("minutesAgoShort",{count:e});let f=Math.floor(e/60);if(f<24)return b("hoursAgoShort",{count:f});let g=Math.floor(f/24);if(g<30)return b("daysAgoShort",{count:g});let h=Math.floor(g/30);return h<12?b("monthsAgoShort",{count:h}):b("yearsAgoShort",{count:Math.floor(h/12)})}(f,g)]}):i&&"not_installed"!==i?(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] text-text-muted",children:[(0,b.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"schedule"}),g("never")]}):null]})}a.s(["default",()=>e])},437713,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(294023),i=a.i(959852),j=a.i(210849),k=a.i(571987),l=a.i(116795),m=a.i(415925),n=b([f,i]);[f,i]=n.then?(await n)():n;let p=process.env.NEXT_PUBLIC_CLOUD_URL;function o({tool:a,isExpanded:b,onToggle:c,activeProviders:f,modelMappings:n,onModelMappingChange:o,baseUrl:q,hasActiveProviders:r,apiKeys:s,cloudEnabled:t,batchStatus:u,lastConfiguredAt:v}){let w,x,y,z=(0,m.useTranslations)("cliTools"),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(null),[K,L]=(0,e.useState)(!1),[M,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)(null),[Q,R]=(0,e.useState)(""),[S,T]=(0,e.useState)({}),[U,V]=(0,e.useState)(!1),[W,X]=(0,e.useState)(""),Y=(0,e.useRef)(!1),[Z,$]=(0,e.useState)([]),[_,aa]=(0,e.useState)(!1),[ab,ac]=(0,e.useState)(null),ad=!!(A?.installed&&A?.runnable),ae=(()=>{if(!ad)return null;let a=A.settings?.env?.ANTHROPIC_BASE_URL;if(!a)return"not_configured";let b=a.includes("localhost")||a.includes("127.0.0.1"),c=t&&p&&a.startsWith(p);return b||c?"configured":"other"})()||u?.configStatus||null;(0,e.useEffect)(()=>{s?.length>0&&!Q&&R(s[0].key)},[s,Q]),(0,e.useEffect)(()=>{b&&!A&&(ag(),af(),ak())},[b,A]);let af=async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&T(b.aliases||{})}catch(a){console.log("Error fetching model aliases:",a)}};(0,e.useEffect)(()=>{if(A?.installed&&!Y.current){Y.current=!0;let b=A.settings?.env||{};a.defaultModels.forEach(a=>{if(a.envKey){let c=b[a.envKey]||a.defaultValue||"";c&&o(a.alias,c)}});let c=b.ANTHROPIC_AUTH_TOKEN;c&&s?.some(a=>a.key===c)&&R(c)}},[A,s,a.defaultModels,o]);let ag=async()=>{D(!0);try{let a=await fetch("/api/cli-tools/claude-settings"),b=await a.json();B(b)}catch(a){B({installed:!1,error:a.message})}finally{D(!1)}},ah=()=>{let a=W||q;return a.endsWith("/v1")?a:`${a}/v1`},ai=async()=>{F(!0),J(null);try{let b={ANTHROPIC_BASE_URL:ah()},c=Q?.trim()||(s?.length>0?s[0].key:null)||(t?null:"sk_omniroute");c&&(b.ANTHROPIC_AUTH_TOKEN=c),a.defaultModels.forEach(a=>{let c=n[a.alias];c&&a.envKey&&(b[a.envKey]=c)});let d=await fetch("/api/cli-tools/claude-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:b})}),e=await d.json();d.ok?(J({type:"success",text:z("settingsApplied")}),B(a=>({...a,hasBackup:!0,settings:{...a?.settings,env:b}}))):J({type:"error",text:e.error||z("failedApplySettings")})}catch(a){J({type:"error",text:a.message})}finally{F(!1)}},aj=async()=>{H(!0),J(null);try{let b=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),c=await b.json();b.ok?(J({type:"success",text:z("settingsReset")}),a.defaultModels.forEach(a=>o(a.alias,a.defaultValue||"")),R("")):J({type:"error",text:c.error||z("failedResetSettings")})}catch(a){J({type:"error",text:a.message})}finally{H(!1)}},ak=async()=>{try{let a=await fetch("/api/cli-tools/backups?tool=claude"),b=await a.json();a.ok&&$(b.backups||[])}catch(a){console.log("Error fetching backups:",a)}},al=async a=>{ac(a),J(null);try{let b=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"claude",backupId:a})}),c=await b.json();b.ok?(J({type:"success",text:z("backupRestored")}),ag(),ak()):J({type:"error",text:c.error||z("failedRestore")})}catch(a){J({type:"error",text:a.message})}finally{ac(null)}};return(0,d.jsxs)(g.Card,{padding:"sm",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(k.default,{src:"/providers/claude.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.currentTarget.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),(0,d.jsx)(l.default,{effectiveConfigStatus:ae,batchStatus:u,lastConfiguredAt:v})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:z("toolDescriptions.claude")})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[C&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:z("checkingCli",{tool:"Claude"})})]}),!C&&A&&!ad&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:A.installed?z("cliNotRunnable",{tool:"Claude"}):z("cliNotInstalled",{tool:"Claude"})}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:A.installed?z("cliFoundFailedHealthcheck",{tool:"Claude",reason:A.reason?` (${A.reason})`:""}):z("installCliPrompt",{tool:"Claude"})})]}),(0,d.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:()=>L(!K),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:K?"expand_less":"help"}),K?z("hide"):z("howToInstall")]})]}),K&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:z("installationGuide")}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted mb-1",children:z("platforms")}),(0,d.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @anthropic-ai/claude-code"})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:[z("afterInstallationRun")," ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"claude"})," ",z("toVerify")]})]})]})]}),!C&&ad&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[A?.settings?.env?.ANTHROPIC_BASE_URL&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:z("current")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:A.settings.env.ANTHROPIC_BASE_URL})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:z("baseUrl")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:(w=W||q).endsWith("/v1")?w:`${w}/v1`,onChange:a=>X(a.target.value),placeholder:z("baseUrlPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),W&&W!==q&&(0,d.jsx)("button",{onClick:()=>X(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:z("resetToDefault"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:z("apiKey")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),s.length>0?(0,d.jsx)("select",{value:Q,onChange:a=>R(a.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:s.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:t?z("noApiKeysCreateOne"):z("defaultOmnirouteKey")})]}),a.defaultModels.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:a.name}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:n[a.alias]||"",onChange:b=>o(a.alias,b.target.value),placeholder:z("providerModelPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>{var b;return b=a.alias,void(P(b),N(!0))},disabled:!r,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${r?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:z("selectModel")}),n[a.alias]&&(0,d.jsx)("button",{onClick:()=>o(a.alias,""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:z("clear"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},a.alias))]}),I&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===I.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===I.type?"check_circle":"error"}),(0,d.jsx)("span",{children:I.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(h.Button,{variant:"primary",size:"sm",onClick:ai,disabled:!r,loading:E,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),z("apply")]}),(0,d.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:aj,disabled:!A?.hasOmniRoute,loading:G,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),z("reset")]}),(0,d.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>V(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),z("manualConfig")]}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>{aa(!_),_||ak()},children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),z("backups"),Z.length>0&&` (${Z.length})`]})]}),_&&(0,d.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,d.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),z("configBackups")]}),0===Z.length?(0,d.jsx)("p",{className:"text-xs text-text-muted",children:z("noBackupsYet")}):(0,d.jsx)("div",{className:"space-y-1.5",children:Z.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,d.jsx)("span",{className:"flex-1 truncate font-mono",title:a.id,children:a.id}),(0,d.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(a.createdAt).toLocaleString()}),(0,d.jsx)("button",{onClick:()=>al(a.id),disabled:ab===a.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:ab===a.id?"...":z("restore")})]},a.id))})]})]})]}),(0,d.jsx)(i.ModelSelectModal,{isOpen:M,onClose:()=>N(!1),onSelect:a=>{O&&o(O,a.value)},selectedModel:O?n[O]:null,activeProviders:f,modelAliases:S,title:z("selectModelForAlias",{alias:O||""})}),(0,d.jsx)(j.ManualConfigModal,{isOpen:U,onClose:()=>V(!1),title:z("claudeManualConfiguration"),configs:(x=Q&&Q.trim()?Q:t?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",y={ANTHROPIC_BASE_URL:ah(),ANTHROPIC_AUTH_TOKEN:x},a.defaultModels.forEach(a=>{let b=n[a.alias];b&&a.envKey&&(y[a.envKey]=b)}),[{filename:"~/.claude/settings.json",content:JSON.stringify({env:y},null,2)}])})]})}a.s(["default",()=>o]),c()}catch(a){c(a)}},!1),929105,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(294023),i=a.i(959852),j=a.i(210849),k=a.i(571987),l=a.i(116795),m=a.i(415925),n=b([f,i]);function o({tool:a,isExpanded:b,onToggle:c,baseUrl:f,apiKeys:n,activeProviders:o,cloudEnabled:p,batchStatus:q,lastConfiguredAt:r}){let s,t,u,v,w,x=(0,m.useTranslations)("cliTools"),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(null),[I,J]=(0,e.useState)(!1),[K,L]=(0,e.useState)(""),[M,N]=(0,e.useState)(""),[O,P]=(0,e.useState)(!1),[Q,R]=(0,e.useState)({}),[S,T]=(0,e.useState)(!1),[U,V]=(0,e.useState)(""),[W,X]=(0,e.useState)([]),[Y,Z]=(0,e.useState)(!1),[$,_]=(0,e.useState)(""),[aa,ab]=(0,e.useState)(!1),[ac,ad]=(0,e.useState)(null),[ae,af]=(0,e.useState)([]),[ag,ah]=(0,e.useState)(!1),[ai,aj]=(0,e.useState)(null),ak=!!(y?.installed&&y?.runnable);(0,e.useEffect)(()=>{n?.length>0&&!K&&L(n[0].key)},[n,K]),(0,e.useEffect)(()=>{b&&!y&&(ao(),al(),ar(),av())},[b,y]);let al=async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&R(b.aliases||{})}catch(a){console.log("Error fetching model aliases:",a)}};(0,e.useEffect)(()=>{if(y?.config){let a=y.config.match(/^model\s*=\s*"([^"]+)"/m);a&&N(a[1])}},[y]);let am=(ak?y.config?y.config.includes(f)||y.config.includes("localhost")||y.config.includes("127.0.0.1")?"configured":"other":"not_configured":null)||q?.configStatus||null,an=()=>{let a=U||`${f}/v1`;return a.endsWith("/v1")?a:`${a}/v1`},ao=async()=>{B(!0);try{let a=await fetch("/api/cli-tools/codex-settings"),b=await a.json();z(b)}catch(a){z({installed:!1,error:a.message})}finally{B(!1)}},ap=async()=>{D(!0),H(null);try{let a=K&&K.trim()||p?K:"sk_omniroute",b=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:an(),apiKey:a,model:M})}),c=await b.json();b.ok?(H({type:"success",text:x("settingsApplied")}),ao()):H({type:"error",text:c.error||x("failedApplySettings")})}catch(a){H({type:"error",text:a.message})}finally{D(!1)}},aq=async()=>{F(!0),H(null);try{let a=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),b=await a.json();a.ok?(H({type:"success",text:x("settingsReset")}),N(""),ao()):H({type:"error",text:b.error||x("failedResetSettings")})}catch(a){H({type:"error",text:a.message})}finally{F(!1)}},ar=async()=>{try{let a=await fetch("/api/cli-tools/codex-profiles"),b=await a.json();a.ok&&X(b.profiles||[])}catch(a){console.log("Error fetching profiles:",a)}},as=async()=>{if($.trim()){ab(!0),H(null);try{let a=await fetch("/api/cli-tools/codex-profiles",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:$.trim()})}),b=await a.json();a.ok?(H({type:"success",text:x("profileSaved",{name:$})}),_(""),ar()):H({type:"error",text:b.error||x("failedSaveProfile")})}catch(a){H({type:"error",text:a.message})}finally{ab(!1)}}},at=async a=>{ad(a),H(null);try{let b=await fetch("/api/cli-tools/codex-profiles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileId:a})}),c=await b.json();b.ok?(H({type:"success",text:c.message||x("profileActivated")}),ao(),av()):H({type:"error",text:c.error||x("failedActivateProfile")})}catch(a){H({type:"error",text:a.message})}finally{ad(null)}},au=async a=>{try{(await fetch("/api/cli-tools/codex-profiles",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileId:a})})).ok&&ar()}catch(a){console.log("Error deleting profile:",a)}},av=async()=>{try{let a=await fetch("/api/cli-tools/backups?tool=codex"),b=await a.json();a.ok&&af(b.backups||[])}catch(a){console.log("Error fetching backups:",a)}},aw=async a=>{aj(a),H(null);try{let b=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"codex",backupId:a})}),c=await b.json();b.ok?(H({type:"success",text:x("backupRestored")}),ao(),av()):H({type:"error",text:c.error||x("failedRestore")})}catch(a){H({type:"error",text:a.message})}finally{aj(null)}};return(0,d.jsxs)(g.Card,{padding:"sm",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(k.default,{src:"/providers/codex.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.currentTarget.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),(0,d.jsx)(l.default,{effectiveConfigStatus:am,batchStatus:q,lastConfiguredAt:r})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:x("toolDescriptions.codex")})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[A&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:x("checkingCli",{tool:"Codex"})})]}),!A&&y&&!ak&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:y.installed?x("cliNotRunnable",{tool:"Codex"}):x("cliNotInstalled",{tool:"Codex"})}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:y.installed?x("cliFoundFailedHealthcheck",{tool:"Codex",reason:y.reason?` (${y.reason})`:""}):x("installCodexPrompt")})]}),(0,d.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:()=>J(!I),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:I?"expand_less":"help"}),I?x("hide"):x("howToInstall")]})]}),I&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:x("installationGuide")}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted mb-1",children:x("platforms")}),(0,d.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @openai/codex"})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:[x("afterInstallationRun")," ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"codex"})," ",x("toVerify")]}),(0,d.jsx)("div",{className:"pt-2 border-t border-border",children:(0,d.jsxs)("p",{className:"text-text-muted text-xs",children:[x("codexAuthNotePrefix")," ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.codex/auth.json"})," ",x("codexAuthNoteMiddle")," ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"OPENAI_API_KEY"}),". ",x("codexAuthNoteSuffix")]})})]})]})]}),!A&&ak&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[y?.config&&((t=(s=y.config.match(/base_url\s*=\s*"([^"]+)"/))?s[1]:null)?(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:x("current")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:t})]}):null),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:x("baseUrl")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:U||`${f}/v1`,onChange:a=>V(a.target.value),placeholder:x("baseUrlPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),U&&U!==`${f}/v1`&&(0,d.jsx)("button",{onClick:()=>V(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:x("resetToDefault"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:x("apiKey")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),n.length>0?(0,d.jsx)("select",{value:K,onChange:a=>L(a.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:n.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:p?x("noApiKeysCreateOne"):x("defaultOmnirouteKey")})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:x("model")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:M,onChange:a=>N(a.target.value),placeholder:x("providerModelPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>P(!0),disabled:!o?.length,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${o?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:x("selectModel")}),M&&(0,d.jsx)("button",{onClick:()=>N(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:x("clear"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),G&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===G.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===G.type?"check_circle":"error"}),(0,d.jsx)("span",{children:G.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(h.Button,{variant:"primary",size:"sm",onClick:ap,disabled:!K||!M,loading:C,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),x("apply")]}),(0,d.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:aq,disabled:!y.hasOmniRoute,loading:E,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),x("reset")]}),(0,d.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>T(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),x("manualConfig")]}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>{Z(!Y),Y||ar()},children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"manage_accounts"}),x("profiles")]}),(0,d.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>{ah(!ag),ag||av()},children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),x("backups"),ae.length>0&&` (${ae.length})`]})]}),Y&&(0,d.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,d.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"manage_accounts"}),x("savedProfiles")]}),0===W.length?(0,d.jsx)("p",{className:"text-xs text-text-muted",children:x("noProfilesYet")}):(0,d.jsx)("div",{className:"space-y-1.5 mb-3",children:W.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"person"}),(0,d.jsx)("span",{className:"font-medium flex-1 truncate",children:a.name}),(0,d.jsx)("span",{className:"text-text-muted truncate max-w-[140px]",title:a.authLabel,children:a.authLabel}),(0,d.jsx)("button",{onClick:()=>at(a.id),disabled:ac===a.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:ac===a.id?"...":x("activate")}),(0,d.jsx)("button",{onClick:()=>au(a.id),className:"p-0.5 text-text-muted hover:text-red-500 transition-colors",title:x("deleteProfile"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"delete"})})]},a.id))}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{type:"text",value:$,onChange:a=>_(a.target.value),placeholder:x("profileNamePlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50",onKeyDown:a=>"Enter"===a.key&&as()}),(0,d.jsxs)(h.Button,{variant:"primary",size:"sm",onClick:as,disabled:!$.trim(),loading:aa,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),x("saveCurrent")]})]})]}),ag&&(0,d.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,d.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),x("configBackups")]}),0===ae.length?(0,d.jsx)("p",{className:"text-xs text-text-muted",children:x("noBackupsYet")}):(0,d.jsx)("div",{className:"space-y-1.5",children:ae.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,d.jsx)("span",{className:"flex-1 truncate font-mono",title:a.id,children:a.id}),(0,d.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(a.createdAt).toLocaleString()}),(0,d.jsx)("button",{onClick:()=>aw(a.id),disabled:ai===a.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:ai===a.id?"...":x("restore")})]},a.id))})]})]})]}),(0,d.jsx)(i.ModelSelectModal,{isOpen:O,onClose:()=>P(!1),onSelect:a=>{N(a.value),P(!1)},selectedModel:M,activeProviders:o,modelAliases:Q,title:x("selectModelForTool",{tool:"Codex"})}),(0,d.jsx)(j.ManualConfigModal,{isOpen:S,onClose:()=>T(!1),title:x("codexManualConfiguration"),configs:(u=K&&K.trim()?K:p?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",v=`# OmniRoute Configuration for Codex CLI
|
|
7
|
+
}`}},antigravity:{id:"antigravity",name:"Antigravity",image:"/providers/antigravity.png",color:"#4285F4",description:"Google Antigravity IDE with MITM",configType:"mitm",modelAliases:["claude-opus-4-6-thinking","claude-sonnet-4-6","gemini-3-flash","gpt-oss-120b-medium","gemini-3.1-pro-high","gemini-3.1-pro-low"],defaultModels:[{id:"gemini-3.1-pro-high",name:"Gemini 3.1 Pro High",alias:"gemini-3.1-pro-high"},{id:"gemini-3.1-pro-low",name:"Gemini 3.1 Pro Low",alias:"gemini-3.1-pro-low"},{id:"gemini-3-flash",name:"Gemini 3 Flash",alias:"gemini-3-flash"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",alias:"claude-sonnet-4-6"},{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 Thinking",alias:"claude-opus-4-6-thinking"},{id:"gpt-oss-120b-medium",name:"GPT OSS 120B Medium",alias:"gpt-oss-120b-medium"}]},copilot:{id:"copilot",name:"GitHub Copilot",image:"/providers/copilot.png",color:"#1F6FEB",description:"GitHub Copilot Chat — VS Code Extension",configType:"custom"},opencode:{id:"opencode",name:"OpenCode",image:"/providers/opencode.png",icon:"terminal",color:"#FF6B35",description:"OpenCode AI coding agent (Terminal)",configType:"guide",guideSteps:[{step:1,title:"Install OpenCode",desc:"Install via npm: npm install -g opencode-ai"},{step:2,title:"API Key",type:"apiKeySelector"},{step:3,title:"Set Base URL",desc:"opencode config set baseUrl {{baseUrl}}"},{step:4,title:"Select Model",type:"modelSelector"}]},kiro:{id:"kiro",name:"Kiro AI",image:"/providers/kiro.png",icon:"psychology_alt",color:"#FF6B35",description:"Amazon Kiro — AI-powered IDE with MITM",configType:"mitm",guideSteps:[{step:1,title:"Open Kiro Settings",desc:"Go to Settings → AI Provider"},{step:2,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:3,title:"API Key",type:"apiKeySelector"},{step:4,title:"Select Model",type:"modelSelector"}]}};a.s(["CLI_TOOLS",0,b])},210849,a=>{"use strict";var b=a.i(646958);a.s(["ManualConfigModal",()=>b.default])},116795,a=>{"use strict";var b=a.i(187924),c=a.i(32886),d=a.i(415925);function e({effectiveConfigStatus:a,batchStatus:e,lastConfiguredAt:f=null}){let g=(0,d.useTranslations)("cliTools"),h=(0,c.useLocale)(),i=a||e?.configStatus||null,j={configured:{dotClass:"bg-green-500",badgeClass:"bg-green-500/10 text-green-600 dark:text-green-400",text:g("configured")},not_configured:{dotClass:"bg-yellow-500",badgeClass:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",text:g("notConfigured")},not_installed:{dotClass:"bg-zinc-400 dark:bg-zinc-500",badgeClass:"bg-zinc-500/10 text-zinc-500 dark:text-zinc-400",text:g("notInstalled")},other:{dotClass:"bg-blue-500",badgeClass:"bg-blue-500/10 text-blue-600 dark:text-blue-400",text:g("custom")},unknown:{dotClass:"bg-zinc-400 dark:bg-zinc-500",badgeClass:"bg-zinc-500/10 text-zinc-500 dark:text-zinc-400",text:g("unknown")}},k=i?j[i]||j.unknown:null;return(0,b.jsxs)(b.Fragment,{children:[k&&(0,b.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full ${k.badgeClass}`,children:[(0,b.jsx)("span",{className:`size-1.5 rounded-full ${k.dotClass}`}),k.text]}),f?(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] text-text-muted",title:g("lastSavedAt",{date:new Date(f).toLocaleString(h)}),children:[(0,b.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"schedule"}),function(a,b){let c=Date.now()-new Date(a).getTime();if(c<0)return b("justNow");let d=Math.floor(c/1e3);if(d<60)return b("justNow");let e=Math.floor(d/60);if(e<60)return b("minutesAgoShort",{count:e});let f=Math.floor(e/60);if(f<24)return b("hoursAgoShort",{count:f});let g=Math.floor(f/24);if(g<30)return b("daysAgoShort",{count:g});let h=Math.floor(g/30);return h<12?b("monthsAgoShort",{count:h}):b("yearsAgoShort",{count:Math.floor(h/12)})}(f,g)]}):i&&"not_installed"!==i?(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] text-text-muted",children:[(0,b.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"schedule"}),g("never")]}):null]})}a.s(["default",()=>e])},437713,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(294023),i=a.i(959852),j=a.i(210849),k=a.i(571987),l=a.i(116795),m=a.i(415925),n=b([f,i]);[f,i]=n.then?(await n)():n;let p=process.env.NEXT_PUBLIC_CLOUD_URL;function o({tool:a,isExpanded:b,onToggle:c,activeProviders:f,modelMappings:n,onModelMappingChange:o,baseUrl:q,hasActiveProviders:r,apiKeys:s,cloudEnabled:t,batchStatus:u,lastConfiguredAt:v}){let w,x,y,z=(0,m.useTranslations)("cliTools"),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(null),[K,L]=(0,e.useState)(!1),[M,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)(null),[Q,R]=(0,e.useState)(""),[S,T]=(0,e.useState)({}),[U,V]=(0,e.useState)(!1),[W,X]=(0,e.useState)(""),Y=(0,e.useRef)(!1),[Z,$]=(0,e.useState)([]),[_,aa]=(0,e.useState)(!1),[ab,ac]=(0,e.useState)(null),ad=!!(A?.installed&&A?.runnable),ae=(()=>{if(!ad)return null;let a=A.settings?.env?.ANTHROPIC_BASE_URL;if(!a)return"not_configured";let b=a.includes("localhost")||a.includes("127.0.0.1"),c=t&&p&&a.startsWith(p);return b||c?"configured":"other"})()||u?.configStatus||null;(0,e.useEffect)(()=>{s?.length>0&&!Q&&R(s[0].key)},[s,Q]),(0,e.useEffect)(()=>{b&&!A&&(ag(),af(),ak())},[b,A]);let af=async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&T(b.aliases||{})}catch(a){console.log("Error fetching model aliases:",a)}};(0,e.useEffect)(()=>{if(A?.installed&&!Y.current){Y.current=!0;let b=A.settings?.env||{};a.defaultModels.forEach(a=>{if(a.envKey){let c=b[a.envKey]||a.defaultValue||"";c&&o(a.alias,c)}});let c=b.ANTHROPIC_AUTH_TOKEN;c&&s?.some(a=>a.key===c)&&R(c)}},[A,s,a.defaultModels,o]);let ag=async()=>{D(!0);try{let a=await fetch("/api/cli-tools/claude-settings"),b=await a.json();B(b)}catch(a){B({installed:!1,error:a.message})}finally{D(!1)}},ah=()=>{let a=W||q;return a.endsWith("/v1")?a:`${a}/v1`},ai=async()=>{F(!0),J(null);try{let b={ANTHROPIC_BASE_URL:ah()},c=Q?.trim()||(s?.length>0?s[0].key:null)||(t?null:"sk_omniroute");c&&(b.ANTHROPIC_AUTH_TOKEN=c),a.defaultModels.forEach(a=>{let c=n[a.alias];c&&a.envKey&&(b[a.envKey]=c)});let d=await fetch("/api/cli-tools/claude-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:b})}),e=await d.json();d.ok?(J({type:"success",text:z("settingsApplied")}),B(a=>({...a,hasBackup:!0,settings:{...a?.settings,env:b}}))):J({type:"error",text:e.error||z("failedApplySettings")})}catch(a){J({type:"error",text:a.message})}finally{F(!1)}},aj=async()=>{H(!0),J(null);try{let b=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),c=await b.json();b.ok?(J({type:"success",text:z("settingsReset")}),a.defaultModels.forEach(a=>o(a.alias,a.defaultValue||"")),R("")):J({type:"error",text:c.error||z("failedResetSettings")})}catch(a){J({type:"error",text:a.message})}finally{H(!1)}},ak=async()=>{try{let a=await fetch("/api/cli-tools/backups?tool=claude"),b=await a.json();a.ok&&$(b.backups||[])}catch(a){console.log("Error fetching backups:",a)}},al=async a=>{ac(a),J(null);try{let b=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"claude",backupId:a})}),c=await b.json();b.ok?(J({type:"success",text:z("backupRestored")}),ag(),ak()):J({type:"error",text:c.error||z("failedRestore")})}catch(a){J({type:"error",text:a.message})}finally{ac(null)}};return(0,d.jsxs)(g.Card,{padding:"sm",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(k.default,{src:"/providers/claude.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.currentTarget.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),(0,d.jsx)(l.default,{effectiveConfigStatus:ae,batchStatus:u,lastConfiguredAt:v})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:z("toolDescriptions.claude")})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[C&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:z("checkingCli",{tool:"Claude"})})]}),!C&&A&&!ad&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:A.installed?z("cliNotRunnable",{tool:"Claude"}):z("cliNotInstalled",{tool:"Claude"})}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:A.installed?z("cliFoundFailedHealthcheck",{tool:"Claude",reason:A.reason?` (${A.reason})`:""}):z("installCliPrompt",{tool:"Claude"})})]}),(0,d.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:()=>L(!K),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:K?"expand_less":"help"}),K?z("hide"):z("howToInstall")]})]}),K&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:z("installationGuide")}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted mb-1",children:z("platforms")}),(0,d.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @anthropic-ai/claude-code"})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:[z("afterInstallationRun")," ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"claude"})," ",z("toVerify")]})]})]})]}),!C&&ad&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[A?.settings?.env?.ANTHROPIC_BASE_URL&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:z("current")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:A.settings.env.ANTHROPIC_BASE_URL})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:z("baseUrl")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:(w=W||q).endsWith("/v1")?w:`${w}/v1`,onChange:a=>X(a.target.value),placeholder:z("baseUrlPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),W&&W!==q&&(0,d.jsx)("button",{onClick:()=>X(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:z("resetToDefault"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:z("apiKey")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),s.length>0?(0,d.jsx)("select",{value:Q,onChange:a=>R(a.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:s.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:t?z("noApiKeysCreateOne"):z("defaultOmnirouteKey")})]}),a.defaultModels.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:a.name}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:n[a.alias]||"",onChange:b=>o(a.alias,b.target.value),placeholder:z("providerModelPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>{var b;return b=a.alias,void(P(b),N(!0))},disabled:!r,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${r?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:z("selectModel")}),n[a.alias]&&(0,d.jsx)("button",{onClick:()=>o(a.alias,""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:z("clear"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},a.alias))]}),I&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===I.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===I.type?"check_circle":"error"}),(0,d.jsx)("span",{children:I.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(h.Button,{variant:"primary",size:"sm",onClick:ai,disabled:!r,loading:E,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),z("apply")]}),(0,d.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:aj,disabled:!A?.hasOmniRoute,loading:G,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),z("reset")]}),(0,d.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>V(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),z("manualConfig")]}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>{aa(!_),_||ak()},children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),z("backups"),Z.length>0&&` (${Z.length})`]})]}),_&&(0,d.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,d.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),z("configBackups")]}),0===Z.length?(0,d.jsx)("p",{className:"text-xs text-text-muted",children:z("noBackupsYet")}):(0,d.jsx)("div",{className:"space-y-1.5",children:Z.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,d.jsx)("span",{className:"flex-1 truncate font-mono",title:a.id,children:a.id}),(0,d.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(a.createdAt).toLocaleString()}),(0,d.jsx)("button",{onClick:()=>al(a.id),disabled:ab===a.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:ab===a.id?"...":z("restore")})]},a.id))})]})]})]}),(0,d.jsx)(i.ModelSelectModal,{isOpen:M,onClose:()=>N(!1),onSelect:a=>{O&&o(O,a.value)},selectedModel:O?n[O]:null,activeProviders:f,modelAliases:S,title:z("selectModelForAlias",{alias:O||""})}),(0,d.jsx)(j.ManualConfigModal,{isOpen:U,onClose:()=>V(!1),title:z("claudeManualConfiguration"),configs:(x=Q&&Q.trim()?Q:t?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",y={ANTHROPIC_BASE_URL:ah(),ANTHROPIC_AUTH_TOKEN:x},a.defaultModels.forEach(a=>{let b=n[a.alias];b&&a.envKey&&(y[a.envKey]=b)}),[{filename:"~/.claude/settings.json",content:JSON.stringify({env:y},null,2)}])})]})}a.s(["default",()=>o]),c()}catch(a){c(a)}},!1),929105,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(294023),i=a.i(959852),j=a.i(210849),k=a.i(571987),l=a.i(116795),m=a.i(415925),n=b([f,i]);function o({tool:a,isExpanded:b,onToggle:c,baseUrl:f,apiKeys:n,activeProviders:o,cloudEnabled:p,batchStatus:q,lastConfiguredAt:r}){let s,t,u,v,w,x=(0,m.useTranslations)("cliTools"),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(null),[I,J]=(0,e.useState)(!1),[K,L]=(0,e.useState)(""),[M,N]=(0,e.useState)(""),[O,P]=(0,e.useState)(!1),[Q,R]=(0,e.useState)({}),[S,T]=(0,e.useState)(!1),[U,V]=(0,e.useState)(""),[W,X]=(0,e.useState)([]),[Y,Z]=(0,e.useState)(!1),[$,_]=(0,e.useState)(""),[aa,ab]=(0,e.useState)(!1),[ac,ad]=(0,e.useState)(null),[ae,af]=(0,e.useState)([]),[ag,ah]=(0,e.useState)(!1),[ai,aj]=(0,e.useState)(null),ak=!!(y?.installed&&y?.runnable);(0,e.useEffect)(()=>{n?.length>0&&!K&&L(n[0].key)},[n,K]),(0,e.useEffect)(()=>{b&&!y&&(ao(),al(),ar(),av())},[b,y]);let al=async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&R(b.aliases||{})}catch(a){console.log("Error fetching model aliases:",a)}};(0,e.useEffect)(()=>{if(y?.config){let a=y.config.match(/^model\s*=\s*"([^"]+)"/m);a&&N(a[1])}},[y]);let am=(ak?y.config?y.config.includes(f)||y.config.includes("localhost")||y.config.includes("127.0.0.1")?"configured":"other":"not_configured":null)||q?.configStatus||null,an=()=>{let a=U||`${f}/v1`;return a.endsWith("/v1")?a:`${a}/v1`},ao=async()=>{B(!0);try{let a=await fetch("/api/cli-tools/codex-settings"),b=await a.json();z(b)}catch(a){z({installed:!1,error:a.message})}finally{B(!1)}},ap=async()=>{D(!0),H(null);try{let a=K&&K.trim()||p?K:"sk_omniroute",b=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:an(),apiKey:a,model:M})}),c=await b.json();b.ok?(H({type:"success",text:x("settingsApplied")}),ao()):H({type:"error",text:c.error||x("failedApplySettings")})}catch(a){H({type:"error",text:a.message})}finally{D(!1)}},aq=async()=>{F(!0),H(null);try{let a=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),b=await a.json();a.ok?(H({type:"success",text:x("settingsReset")}),N(""),ao()):H({type:"error",text:b.error||x("failedResetSettings")})}catch(a){H({type:"error",text:a.message})}finally{F(!1)}},ar=async()=>{try{let a=await fetch("/api/cli-tools/codex-profiles"),b=await a.json();a.ok&&X(b.profiles||[])}catch(a){console.log("Error fetching profiles:",a)}},as=async()=>{if($.trim()){ab(!0),H(null);try{let a=await fetch("/api/cli-tools/codex-profiles",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:$.trim()})}),b=await a.json();a.ok?(H({type:"success",text:x("profileSaved",{name:$})}),_(""),ar()):H({type:"error",text:b.error||x("failedSaveProfile")})}catch(a){H({type:"error",text:a.message})}finally{ab(!1)}}},at=async a=>{ad(a),H(null);try{let b=await fetch("/api/cli-tools/codex-profiles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileId:a})}),c=await b.json();b.ok?(H({type:"success",text:c.message||x("profileActivated")}),ao(),av()):H({type:"error",text:c.error||x("failedActivateProfile")})}catch(a){H({type:"error",text:a.message})}finally{ad(null)}},au=async a=>{try{(await fetch("/api/cli-tools/codex-profiles",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileId:a})})).ok&&ar()}catch(a){console.log("Error deleting profile:",a)}},av=async()=>{try{let a=await fetch("/api/cli-tools/backups?tool=codex"),b=await a.json();a.ok&&af(b.backups||[])}catch(a){console.log("Error fetching backups:",a)}},aw=async a=>{aj(a),H(null);try{let b=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"codex",backupId:a})}),c=await b.json();b.ok?(H({type:"success",text:x("backupRestored")}),ao(),av()):H({type:"error",text:c.error||x("failedRestore")})}catch(a){H({type:"error",text:a.message})}finally{aj(null)}};return(0,d.jsxs)(g.Card,{padding:"sm",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(k.default,{src:"/providers/codex.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.currentTarget.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),(0,d.jsx)(l.default,{effectiveConfigStatus:am,batchStatus:q,lastConfiguredAt:r})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:x("toolDescriptions.codex")})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[A&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:x("checkingCli",{tool:"Codex"})})]}),!A&&y&&!ak&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:y.installed?x("cliNotRunnable",{tool:"Codex"}):x("cliNotInstalled",{tool:"Codex"})}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:y.installed?x("cliFoundFailedHealthcheck",{tool:"Codex",reason:y.reason?` (${y.reason})`:""}):x("installCodexPrompt")})]}),(0,d.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:()=>J(!I),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:I?"expand_less":"help"}),I?x("hide"):x("howToInstall")]})]}),I&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:x("installationGuide")}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted mb-1",children:x("platforms")}),(0,d.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @openai/codex"})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:[x("afterInstallationRun")," ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"codex"})," ",x("toVerify")]}),(0,d.jsx)("div",{className:"pt-2 border-t border-border",children:(0,d.jsxs)("p",{className:"text-text-muted text-xs",children:[x("codexAuthNotePrefix")," ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.codex/auth.json"})," ",x("codexAuthNoteMiddle")," ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"OPENAI_API_KEY"}),". ",x("codexAuthNoteSuffix")]})})]})]})]}),!A&&ak&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[y?.config&&((t=(s=y.config.match(/base_url\s*=\s*"([^"]+)"/))?s[1]:null)?(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:x("current")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:t})]}):null),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:x("baseUrl")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:U||`${f}/v1`,onChange:a=>V(a.target.value),placeholder:x("baseUrlPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),U&&U!==`${f}/v1`&&(0,d.jsx)("button",{onClick:()=>V(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:x("resetToDefault"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:x("apiKey")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),n.length>0?(0,d.jsx)("select",{value:K,onChange:a=>L(a.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:n.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:p?x("noApiKeysCreateOne"):x("defaultOmnirouteKey")})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:x("model")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:M,onChange:a=>N(a.target.value),placeholder:x("providerModelPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>P(!0),disabled:!o?.length,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${o?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:x("selectModel")}),M&&(0,d.jsx)("button",{onClick:()=>N(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:x("clear"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),G&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===G.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===G.type?"check_circle":"error"}),(0,d.jsx)("span",{children:G.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(h.Button,{variant:"primary",size:"sm",onClick:ap,disabled:!K||!M,loading:C,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),x("apply")]}),(0,d.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:aq,disabled:!y.hasOmniRoute,loading:E,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),x("reset")]}),(0,d.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>T(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),x("manualConfig")]}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>{Z(!Y),Y||ar()},children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"manage_accounts"}),x("profiles")]}),(0,d.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>{ah(!ag),ag||av()},children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),x("backups"),ae.length>0&&` (${ae.length})`]})]}),Y&&(0,d.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,d.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"manage_accounts"}),x("savedProfiles")]}),0===W.length?(0,d.jsx)("p",{className:"text-xs text-text-muted",children:x("noProfilesYet")}):(0,d.jsx)("div",{className:"space-y-1.5 mb-3",children:W.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"person"}),(0,d.jsx)("span",{className:"font-medium flex-1 truncate",children:a.name}),(0,d.jsx)("span",{className:"text-text-muted truncate max-w-[140px]",title:a.authLabel,children:a.authLabel}),(0,d.jsx)("button",{onClick:()=>at(a.id),disabled:ac===a.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:ac===a.id?"...":x("activate")}),(0,d.jsx)("button",{onClick:()=>au(a.id),className:"p-0.5 text-text-muted hover:text-red-500 transition-colors",title:x("deleteProfile"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"delete"})})]},a.id))}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{type:"text",value:$,onChange:a=>_(a.target.value),placeholder:x("profileNamePlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50",onKeyDown:a=>"Enter"===a.key&&as()}),(0,d.jsxs)(h.Button,{variant:"primary",size:"sm",onClick:as,disabled:!$.trim(),loading:aa,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),x("saveCurrent")]})]})]}),ag&&(0,d.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,d.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),x("configBackups")]}),0===ae.length?(0,d.jsx)("p",{className:"text-xs text-text-muted",children:x("noBackupsYet")}):(0,d.jsx)("div",{className:"space-y-1.5",children:ae.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,d.jsx)("span",{className:"flex-1 truncate font-mono",title:a.id,children:a.id}),(0,d.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(a.createdAt).toLocaleString()}),(0,d.jsx)("button",{onClick:()=>aw(a.id),disabled:ai===a.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:ai===a.id?"...":x("restore")})]},a.id))})]})]})]}),(0,d.jsx)(i.ModelSelectModal,{isOpen:O,onClose:()=>P(!1),onSelect:a=>{N(a.value),P(!1)},selectedModel:M,activeProviders:o,modelAliases:Q,title:x("selectModelForTool",{tool:"Codex"})}),(0,d.jsx)(j.ManualConfigModal,{isOpen:S,onClose:()=>T(!1),title:x("codexManualConfiguration"),configs:(u=K&&K.trim()?K:p?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",v=`# OmniRoute Configuration for Codex CLI
|
|
8
8
|
model = "${M}"
|
|
9
9
|
model_provider = "omniroute"
|
|
10
10
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
module.exports=[978251,a=>a.a(async(b,c)=>{try{var d=a.i(677850),e=b([d]);[d]=e.then?(await e)():e;let g=d.z.object({id:d.z.string().min(1),alias:d.z.string().min(1),name:d.z.string().min(1),icon:d.z.string().min(1),color:d.z.string().regex(/^#[0-9A-Fa-f]{6}$/,"Must be a valid hex color (#RRGGBB)"),textIcon:d.z.string().optional(),website:d.z.string().url().optional(),passthroughModels:d.z.boolean().optional()}),h=d.z.record(d.z.string(),g);function f(a,b){let c=h.safeParse(a);if(!c.success){let a=c.error.issues.map(a=>` ${a.path.join(".")}: ${a.message}`).join("\n");throw console.error(`[PROVIDER VALIDATION] ${b} has invalid entries:
|
|
2
|
-
${a}`),Error(`Provider validation failed for ${b}`)}}a.s(["validateProviders",()=>f]),c()}catch(a){c(a)}},!1),549276,a=>a.a(async(b,c)=>{try{var d=a.i(978251),e=b([d]);[d]=e.then?(await e)():e;let f={iflow:{id:"iflow",alias:"if",name:"iFlow AI",icon:"water_drop",color:"#6366F1"},qwen:{id:"qwen",alias:"qw",name:"Qwen Code",icon:"psychology",color:"#10B981"},"gemini-cli":{id:"gemini-cli",alias:"gc",name:"Gemini CLI",icon:"terminal",color:"#4285F4"},kiro:{id:"kiro",alias:"kr",name:"Kiro AI",icon:"psychology_alt",color:"#FF6B35"}},g={claude:{id:"claude",alias:"cc",name:"Claude Code",icon:"smart_toy",color:"#D97757"},antigravity:{id:"antigravity",alias:"ag",name:"Antigravity",icon:"rocket_launch",color:"#F59E0B"},codex:{id:"codex",alias:"cx",name:"OpenAI Codex",icon:"code",color:"#3B82F6"},github:{id:"github",alias:"gh",name:"GitHub Copilot",icon:"code",color:"#333333"},cursor:{id:"cursor",alias:"cu",name:"Cursor IDE",icon:"edit_note",color:"#00D4AA"},"kimi-coding":{id:"kimi-coding",alias:"kmc",name:"Kimi Coding",icon:"psychology",color:"#1E40AF",textIcon:"KC"},kilocode:{id:"kilocode",alias:"kc",name:"Kilo Code",icon:"code",color:"#FF6B35",textIcon:"KC"},cline:{id:"cline",alias:"cl",name:"Cline",icon:"smart_toy",color:"#5B9BD5",textIcon:"CL"}},h={openrouter:{id:"openrouter",alias:"openrouter",name:"OpenRouter",icon:"router",color:"#F97316",textIcon:"OR",passthroughModels:!0,website:"https://openrouter.ai"},glm:{id:"glm",alias:"glm",name:"GLM Coding",icon:"code",color:"#2563EB",textIcon:"GL",website:"https://open.bigmodel.cn"},"bailian-coding-plan":{id:"bailian-coding-plan",alias:"bcp",name:"Alibaba Coding Plan",icon:"code",color:"#FF6A00",textIcon:"BCP",website:"https://www.alibabacloud.com/help/en/model-studio/coding-plan"},kimi:{id:"kimi",alias:"kimi",name:"Kimi",icon:"psychology",color:"#1E3A8A",textIcon:"KM",website:"https://kimi.moonshot.cn"},"kimi-coding-apikey":{id:"kimi-coding-apikey",alias:"kmca",name:"Kimi Coding (API Key)",icon:"psychology",color:"#1E40AF",textIcon:"KC",website:"https://kimi.com"},minimax:{id:"minimax",alias:"minimax",name:"Minimax Coding",icon:"memory",color:"#7C3AED",textIcon:"MM",website:"https://www.minimaxi.com"},"minimax-cn":{id:"minimax-cn",alias:"minimax-cn",name:"Minimax (China)",icon:"memory",color:"#DC2626",textIcon:"MC",website:"https://www.minimaxi.com"},alicode:{id:"alicode",alias:"alicode",name:"Alibaba",icon:"cloud",color:"#FF6A00",textIcon:"ALi",website:"https://bailian.console.aliyun.com"},"alicode-intl":{id:"alicode-intl",alias:"alicode-intl",name:"Alibaba Intl",icon:"cloud",color:"#FF6A00",textIcon:"ALi",website:"https://modelstudio.console.alibabacloud.com"},openai:{id:"openai",alias:"openai",name:"OpenAI",icon:"auto_awesome",color:"#10A37F",textIcon:"OA",website:"https://platform.openai.com"},anthropic:{id:"anthropic",alias:"anthropic",name:"Anthropic",icon:"smart_toy",color:"#D97757",textIcon:"AN",website:"https://console.anthropic.com"},gemini:{id:"gemini",alias:"gemini",name:"Gemini",icon:"diamond",color:"#4285F4",textIcon:"GE",website:"https://ai.google.dev"},deepseek:{id:"deepseek",alias:"ds",name:"DeepSeek",icon:"bolt",color:"#4D6BFE",textIcon:"DS",website:"https://deepseek.com"},groq:{id:"groq",alias:"groq",name:"Groq",icon:"speed",color:"#F55036",textIcon:"GQ",website:"https://groq.com",hasFree:!0,freeNote:"Free tier: 30 RPM / 14.4K RPD — no credit card"},blackbox:{id:"blackbox",alias:"bb",name:"Blackbox AI",icon:"view_in_ar",color:"#1A1A2E",textIcon:"BB",website:"https://blackbox.ai"},xai:{id:"xai",alias:"xai",name:"xAI (Grok)",icon:"auto_awesome",color:"#1DA1F2",textIcon:"XA",website:"https://x.ai"},mistral:{id:"mistral",alias:"mistral",name:"Mistral",icon:"air",color:"#FF7000",textIcon:"MI",website:"https://mistral.ai"},perplexity:{id:"perplexity",alias:"pplx",name:"Perplexity",icon:"search",color:"#20808D",textIcon:"PP",website:"https://www.perplexity.ai"},together:{id:"together",alias:"together",name:"Together AI",icon:"group_work",color:"#0F6FFF",textIcon:"TG",website:"https://www.together.ai"},fireworks:{id:"fireworks",alias:"fireworks",name:"Fireworks AI",icon:"local_fire_department",color:"#7B2EF2",textIcon:"FW",website:"https://fireworks.ai"},cerebras:{id:"cerebras",alias:"cerebras",name:"Cerebras",icon:"memory",color:"#FF4F00",textIcon:"CB",website:"https://inference.cerebras.ai",hasFree:!0,freeNote:"Free: 1M tokens/day, 60K TPM — world's fastest inference"},cohere:{id:"cohere",alias:"cohere",name:"Cohere",icon:"hub",color:"#39594D",textIcon:"CO",website:"https://cohere.com"},nvidia:{id:"nvidia",alias:"nvidia",name:"NVIDIA NIM",icon:"developer_board",color:"#76B900",textIcon:"NV",website:"https://build.nvidia.com",hasFree:!0,freeNote:"Free dev access: ~40 RPM, 70+ models (Kimi K2.5, GLM 4.7, DeepSeek V3.2...)"},nebius:{id:"nebius",alias:"nebius",name:"Nebius AI",icon:"cloud",color:"#6C5CE7",textIcon:"NB",website:"https://nebius.com"},siliconflow:{id:"siliconflow",alias:"siliconflow",name:"SiliconFlow",icon:"cloud_queue",color:"#5B6EF5",textIcon:"SF",website:"https://cloud.siliconflow.com"},hyperbolic:{id:"hyperbolic",alias:"hyp",name:"Hyperbolic",icon:"bolt",color:"#00D4FF",textIcon:"HY",website:"https://hyperbolic.xyz"},deepgram:{id:"deepgram",alias:"dg",name:"Deepgram",icon:"mic",color:"#13EF93",textIcon:"DG",website:"https://deepgram.com"},assemblyai:{id:"assemblyai",alias:"aai",name:"AssemblyAI",icon:"record_voice_over",color:"#0062FF",textIcon:"AA",website:"https://assemblyai.com"},nanobanana:{id:"nanobanana",alias:"nb",name:"NanoBanana",icon:"image",color:"#FFD700",textIcon:"NB",website:"https://nanobananaapi.ai"},"ollama-cloud":{id:"ollama-cloud",alias:"ollamacloud",name:"Ollama Cloud",icon:"cloud",color:"#58A6FF",textIcon:"OC",website:"https://ollama.com/settings/api-keys"},elevenlabs:{id:"elevenlabs",alias:"el",name:"ElevenLabs",icon:"record_voice_over",color:"#6C47FF",textIcon:"EL",website:"https://elevenlabs.io"},cartesia:{id:"cartesia",alias:"cartesia",name:"Cartesia",icon:"spatial_audio",color:"#FF4F8B",textIcon:"CA",website:"https://cartesia.ai"},playht:{id:"playht",alias:"playht",name:"PlayHT",icon:"play_circle",color:"#00B4D8",textIcon:"PH",website:"https://play.ht"},inworld:{id:"inworld",alias:"inworld",name:"Inworld",icon:"voice_chat",color:"#7B2EF2",textIcon:"IW",website:"https://inworld.ai"},sdwebui:{id:"sdwebui",alias:"sdwebui",name:"SD WebUI",icon:"brush",color:"#FF7043",textIcon:"SD",website:"https://github.com/AUTOMATIC1111/stable-diffusion-webui"},comfyui:{id:"comfyui",alias:"comfyui",name:"ComfyUI",icon:"account_tree",color:"#4CAF50",textIcon:"CF",website:"https://github.com/comfyanonymous/ComfyUI"},huggingface:{id:"huggingface",alias:"hf",name:"HuggingFace",icon:"face",color:"#FFD21E",textIcon:"HF",website:"https://huggingface.co",hasFree:!0,freeNote:"Free Inference API for thousands of models (Whisper, VITS, SDXL…)"},synthetic:{id:"synthetic",alias:"synthetic",name:"Synthetic",icon:"verified_user",color:"#6366F1",textIcon:"SY",website:"https://synthetic.new",passthroughModels:!0},"kilo-gateway":{id:"kilo-gateway",alias:"kg",name:"Kilo Gateway",icon:"hub",color:"#617A91",textIcon:"KG",website:"https://kilo.ai",passthroughModels:!0},vertex:{id:"vertex",alias:"vertex",name:"Vertex AI",icon:"cloud",color:"#4285F4",textIcon:"VA",website:"https://cloud.google.com/vertex-ai",authHint:"Provide Service Account JSON or OAuth access_token"},zai:{id:"zai",alias:"zai",name:"Z.AI (GLM-5)",icon:"psychology",color:"#2563EB",textIcon:"ZA",website:"https://open.bigmodel.cn",apiHint:"API key from https://open.bigmodel.cn/usercenter/apikeys"},"perplexity-search":{id:"perplexity-search",alias:"pplx-search",name:"Perplexity Search",icon:"search",color:"#20808D",textIcon:"PS",website:"https://docs.perplexity.ai/guides/search-quickstart",authHint:"Same API key as Perplexity (pplx-...)"},"serper-search":{id:"serper-search",alias:"serper-search",name:"Serper Search",icon:"search",color:"#4285F4",textIcon:"SP",website:"https://serper.dev",authHint:"API key from serper.dev dashboard"},"brave-search":{id:"brave-search",alias:"brave-search",name:"Brave Search",icon:"travel_explore",color:"#FB542B",textIcon:"BR",website:"https://brave.com/search/api",authHint:"Subscription token from Brave Search API dashboard"},"exa-search":{id:"exa-search",alias:"exa-search",name:"Exa Search",icon:"neurology",color:"#1E40AF",textIcon:"EX",website:"https://exa.ai",authHint:"API key from dashboard.exa.ai"},"tavily-search":{id:"tavily-search",alias:"tavily-search",name:"Tavily Search",icon:"manage_search",color:"#5B4FDB",textIcon:"TV",website:"https://tavily.com",authHint:"API key from app.tavily.com (format: tvly-...)"}},i={...f,...g,...h};Object.values(i).reduce((a,b)=>(a[b.alias]=b.id,a),{}),Object.values(i).reduce((a,b)=>(a[b.id]=b.alias,a),{}),(0,d.validateProviders)(f,"FREE_PROVIDERS"),(0,d.validateProviders)(g,"OAUTH_PROVIDERS"),(0,d.validateProviders)(h,"APIKEY_PROVIDERS"),a.s(["AI_PROVIDERS",0,i,"APIKEY_PROVIDERS",0,h,"FREE_PROVIDERS",0,f,"OAUTH_PROVIDERS",0,g]),c()}catch(a){c(a)}},!1),728972,a=>a.a(async(b,c)=>{try{var d=a.i(958301),e=a.i(549276),f=b([e]);[e]=f.then?(await f)():f,Object.entries(e.AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a),Object.entries(d.PROVIDER_MODELS).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name}))),a.s([]),c()}catch(a){c(a)}},!1),895812,a=>a.a(async(b,c)=>{try{var d=a.i(804730),e=a.i(549276),f=a.i(728972),g=b([e,f]);[e,f]=g.then?(await g)():g;let h={name:"OmniRoute",description:"AI Gateway for Multi-Provider LLMs",version:d.default.version};a.s(["APP_CONFIG",0,h]),c()}catch(a){c(a)}},!1),831575,a=>a.a(async(b,c)=>{try{var d=a.i(907997),e=a.i(395936),f=a.i(442979),g=a.i(895812),h=a.i(549276),i=b([g,h]);[g,h]=i.then?(await i)():i;let l=[{path:"/v1/chat/completions",method:"POST",noteKey:"endpointChatNote"},{path:"/v1/responses",method:"POST",noteKey:"endpointResponsesNote"},{path:"/v1/models",method:"GET",noteKey:"endpointModelsNote"},{path:"/v1/audio/transcriptions",method:"POST",noteKey:"endpointAudioNote"},{path:"/v1/images/generations",method:"POST",noteKey:"endpointImagesNote"},{path:"/chat/completions",method:"POST",noteKey:"endpointRewriteChatNote"},{path:"/responses",method:"POST",noteKey:"endpointRewriteResponsesNote"},{path:"/models",method:"GET",noteKey:"endpointRewriteModelsNote"}],m=[{path:"/api/v1/management/proxies",method:"GET",noteKey:"mgmtProxiesListNote"},{path:"/api/v1/management/proxies",method:"POST",noteKey:"mgmtProxiesCreateNote"},{path:"/api/v1/management/proxies/health",method:"GET",noteKey:"mgmtProxiesHealthNote"},{path:"/api/v1/management/proxies/bulk-assign",method:"PUT",noteKey:"mgmtProxiesBulkAssignNote"},{path:"/api/v1/management/proxies/assignments",method:"GET",noteKey:"mgmtAssignmentsListNote"},{path:"/api/v1/management/proxies/assignments",method:"PUT",noteKey:"mgmtAssignmentsUpdateNote"},{path:"/api/settings/proxies/migrate",method:"POST",noteKey:"mgmtLegacyMigrationNote"}],n=[{icon:"hub",titleKey:"featureRoutingTitle",textKey:"featureRoutingText"},{icon:"layers",titleKey:"featureCombosTitle",textKey:"featureCombosText"},{icon:"bar_chart",titleKey:"featureUsageTitle",textKey:"featureUsageText"},{icon:"analytics",titleKey:"featureAnalyticsTitle",textKey:"featureAnalyticsText"},{icon:"health_and_safety",titleKey:"featureHealthTitle",textKey:"featureHealthText"},{icon:"terminal",titleKey:"featureCliTitle",textKey:"featureCliText"},{icon:"shield",titleKey:"featureSecurityTitle",textKey:"featureSecurityText"},{icon:"cloud_sync",titleKey:"featureCloudSyncTitle",textKey:"featureCloudSyncText"}],o=[{titleKey:"useCaseSingleEndpointTitle",textKey:"useCaseSingleEndpointText"},{titleKey:"useCaseFallbackTitle",textKey:"useCaseFallbackText"},{titleKey:"useCaseUsageVisibilityTitle",textKey:"useCaseUsageVisibilityText"}],p=["troubleshootingModelRouting","troubleshootingAmbiguousModels","troubleshootingCodexFamily","troubleshootingTestConnection","troubleshootingCircuitBreaker","troubleshootingOAuth"],q=[{href:"#quick-start",labelKey:"quickStart"},{href:"#features",labelKey:"features"},{href:"#supported-providers",labelKey:"supportedProvidersToc"},{href:"#use-cases",labelKey:"commonUseCases"},{href:"#client-compatibility",labelKey:"clientCompatibility"},{href:"#protocols",labelKey:"protocolsToc"},{href:"#api-reference",labelKey:"apiReference"},{href:"#management-api",labelKey:"managementApiReference"},{href:"#model-prefixes",labelKey:"modelPrefixes"},{href:"#troubleshooting",labelKey:"troubleshooting"}];function j({title:a,providers:b,colorDot:c}){let e=(0,f.useTranslations)("docs"),g=Object.values(b);return(0,d.jsxs)("div",{className:"rounded-lg border border-border bg-bg p-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,d.jsx)("span",{className:`size-2.5 rounded-full ${c}`}),(0,d.jsx)("h3",{className:"font-semibold",children:a}),(0,d.jsx)("span",{className:"text-xs text-text-muted ml-auto",children:e("providersCount",{count:g.length})})]}),(0,d.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-1 text-sm",children:g.map(a=>(0,d.jsxs)("div",{className:"flex items-center justify-between py-1.5 border-b border-border/40 last:border-0",children:[(0,d.jsx)("span",{className:"font-medium",children:a.name}),(0,d.jsxs)("code",{className:"text-xs text-text-muted px-1.5 py-0.5 rounded bg-bg-subtle",children:[a.alias,"/"]})]},a.id))})]})}function k(){let a=(0,f.useTranslations)("docs"),b=Object.keys(h.FREE_PROVIDERS).length+Object.keys(h.OAUTH_PROVIDERS).length+Object.keys(h.APIKEY_PROVIDERS).length,c=l.map(b=>({...b,note:a(b.noteKey)})),i=m.map(b=>({...b,note:a(b.noteKey)})),k=n.map(b=>({...b,title:a(b.titleKey),text:a(b.textKey)})),r=o.map(b=>({...b,title:a(b.titleKey),text:a(b.textKey)})),s=p.map(b=>a(b)),t=q.map(b=>({...b,label:a(b.labelKey)})),u=[...Object.values(h.FREE_PROVIDERS).map(a=>({...a,type:"free"})),...Object.values(h.OAUTH_PROVIDERS).map(a=>({...a,type:"oauth"})),...Object.values(h.APIKEY_PROVIDERS).map(a=>({...a,type:"apiKey"}))];return(0,d.jsx)("div",{className:"min-h-screen bg-bg text-text-main",children:(0,d.jsxs)("div",{className:"mx-auto max-w-6xl px-4 sm:px-6 lg:px-8 py-10 md:py-14 flex flex-col gap-8",children:[(0,d.jsx)("header",{className:"rounded-2xl border border-border bg-bg-subtle p-6 md:p-8",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-xs uppercase tracking-wider text-text-muted",children:a("documentationVersion",{version:g.APP_CONFIG.version})}),(0,d.jsxs)("h1",{className:"text-3xl md:text-4xl font-bold mt-1",children:[g.APP_CONFIG.name," ",a("docsLabel")]}),(0,d.jsx)("p",{className:"text-sm md:text-base text-text-muted mt-2 max-w-3xl",children:a("docsHeroDescription")})]}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(e.default,{href:"/dashboard",className:"px-3 py-2 rounded-lg border border-border text-sm hover:bg-bg transition-colors",children:a("openDashboard")}),(0,d.jsx)(e.default,{href:"/dashboard/endpoint",className:"px-3 py-2 rounded-lg border border-border text-sm hover:bg-bg transition-colors",children:a("endpointPage")}),(0,d.jsxs)("a",{href:"https://github.com/diegosouzapw/OmniRoute",target:"_blank",rel:"noopener noreferrer",className:"px-3 py-2 rounded-lg border border-border text-sm hover:bg-bg transition-colors flex items-center gap-1",children:[a("github")," ",(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"open_in_new"})]}),(0,d.jsx)("a",{href:"https://github.com/diegosouzapw/OmniRoute/issues",target:"_blank",rel:"noopener noreferrer",className:"px-3 py-2 rounded-lg border border-border text-sm hover:bg-bg transition-colors",children:a("reportIssue")})]})]})}),(0,d.jsxs)("nav",{className:"rounded-2xl border border-border bg-bg-subtle p-6",children:[(0,d.jsx)("h2",{className:"text-sm font-semibold uppercase tracking-wider text-text-muted mb-3",children:a("onThisPage")}),(0,d.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 text-sm",children:t.map(a=>(0,d.jsxs)("a",{href:a.href,className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-border hover:bg-bg transition-colors",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"tag"}),a.label]},a.href))})]}),(0,d.jsxs)("section",{id:"quick-start",className:"rounded-2xl border border-border bg-bg-subtle p-6",children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:a("quickStart")}),(0,d.jsxs)("ol",{className:"mt-4 grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[(0,d.jsxs)("li",{className:"rounded-lg border border-border p-3 bg-bg",children:[(0,d.jsx)("span",{className:"font-semibold",children:a("quickStartStep1Title")}),(0,d.jsxs)("p",{className:"text-text-muted mt-1",children:[a("quickStartStep1Prefix")," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"npx omniroute"})," ",a("quickStartStep1Middle")," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"npm start"}),"."]})]}),(0,d.jsxs)("li",{className:"rounded-lg border border-border p-3 bg-bg",children:[(0,d.jsx)("span",{className:"font-semibold",children:a("quickStartStep2Title")}),(0,d.jsx)("p",{className:"text-text-muted mt-1",children:a("quickStartStep2Text")})]}),(0,d.jsxs)("li",{className:"rounded-lg border border-border p-3 bg-bg",children:[(0,d.jsx)("span",{className:"font-semibold",children:a("quickStartStep3Title")}),(0,d.jsx)("p",{className:"text-text-muted mt-1",children:a("quickStartStep3Text")})]}),(0,d.jsxs)("li",{className:"rounded-lg border border-border p-3 bg-bg",children:[(0,d.jsx)("span",{className:"font-semibold",children:a("quickStartStep4Title")}),(0,d.jsxs)("p",{className:"text-text-muted mt-1",children:[a("quickStartStep4Prefix")," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"https://<host>/v1"}),"."," ",a("quickStartStep4Suffix")," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"gh/gpt-5.1-codex"}),"."]})]})]})]}),(0,d.jsxs)("section",{id:"features",className:"rounded-2xl border border-border bg-bg-subtle p-6",children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:a("features")}),(0,d.jsx)("div",{className:"mt-4 grid grid-cols-1 md:grid-cols-2 gap-3",children:k.map(a=>(0,d.jsxs)("article",{className:"rounded-lg border border-border p-4 bg-bg flex gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px] text-primary shrink-0 mt-0.5",children:a.icon}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"font-semibold text-sm",children:a.title}),(0,d.jsx)("p",{className:"text-sm text-text-muted mt-1",children:a.text})]})]},a.titleKey))})]}),(0,d.jsxs)("section",{id:"supported-providers",className:"rounded-2xl border border-border bg-bg-subtle p-6",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:a("supportedProviders")}),(0,d.jsx)("p",{className:"text-sm text-text-muted mt-1",children:a("providersAcrossConnectionTypes",{count:b})})]}),(0,d.jsx)(e.default,{href:"/dashboard/providers",className:"px-3 py-2 rounded-lg border border-border text-sm hover:bg-bg transition-colors",children:a("manageProviders")})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-3",children:[(0,d.jsx)(j,{title:a("providerTypeFree"),providers:h.FREE_PROVIDERS,colorDot:"bg-green-500"}),(0,d.jsx)(j,{title:a("providerTypeOAuth"),providers:h.OAUTH_PROVIDERS,colorDot:"bg-blue-500"}),(0,d.jsx)(j,{title:a("providerTypeApiKey"),providers:h.APIKEY_PROVIDERS,colorDot:"bg-amber-500"})]})]}),(0,d.jsxs)("section",{id:"use-cases",className:"rounded-2xl border border-border bg-bg-subtle p-6",children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:a("commonUseCases")}),(0,d.jsx)("div",{className:"mt-4 grid grid-cols-1 md:grid-cols-3 gap-3",children:r.map(a=>(0,d.jsxs)("article",{className:"rounded-lg border border-border p-4 bg-bg",children:[(0,d.jsx)("h3",{className:"font-semibold",children:a.title}),(0,d.jsx)("p",{className:"text-sm text-text-muted mt-2",children:a.text})]},a.titleKey))})]}),(0,d.jsxs)("section",{id:"client-compatibility",className:"rounded-2xl border border-border bg-bg-subtle p-6",children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:a("clientCompatibility")}),(0,d.jsxs)("div",{className:"mt-4 grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[(0,d.jsxs)("article",{className:"rounded-lg border border-border p-4 bg-bg",children:[(0,d.jsx)("h3",{className:"font-semibold",children:a("clientCherryStudioTitle")}),(0,d.jsxs)("ul",{className:"mt-2 text-text-muted space-y-1",children:[(0,d.jsxs)("li",{children:[a("baseUrlLabel"),":"," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"https://<host>/v1"})]}),(0,d.jsxs)("li",{children:[a("chatEndpointLabel"),":"," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"/chat/completions"})]}),(0,d.jsxs)("li",{children:[a("modelRecommendationLabel")," (",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"gh/..."}),","," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"cc/..."}),")"]})]})]}),(0,d.jsxs)("article",{className:"rounded-lg border border-border p-4 bg-bg",children:[(0,d.jsx)("h3",{className:"font-semibold",children:a("clientCodexTitle")}),(0,d.jsxs)("ul",{className:"mt-2 text-text-muted space-y-1",children:[(0,d.jsxs)("li",{children:[a("clientCodexBullet1")," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"gh/"}),"."]}),(0,d.jsxs)("li",{children:[a("clientCodexBullet2")," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"/responses"}),"."]}),(0,d.jsxs)("li",{children:[a("clientCodexBullet3")," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"/chat/completions"}),"."]})]})]}),(0,d.jsxs)("article",{className:"rounded-lg border border-border p-4 bg-bg",children:[(0,d.jsx)("h3",{className:"font-semibold",children:a("clientCursorTitle")}),(0,d.jsxs)("ul",{className:"mt-2 text-text-muted space-y-1",children:[(0,d.jsxs)("li",{children:[a("clientCursorBullet1")," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"cu/"})," ",a("clientCursorBullet1Suffix")]}),(0,d.jsx)("li",{children:a("clientCursorBullet2")}),(0,d.jsx)("li",{children:a("supportsChat")})]})]}),(0,d.jsxs)("article",{className:"rounded-lg border border-border p-4 bg-bg",children:[(0,d.jsx)("h3",{className:"font-semibold",children:a("clientClaudeTitle")}),(0,d.jsxs)("ul",{className:"mt-2 text-text-muted space-y-1",children:[(0,d.jsxs)("li",{children:[a("clientClaudeBullet1Prefix")," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"cc/"})," ",a("clientClaudeBullet1Middle")," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"ag/"})," ",a("clientClaudeBullet1Suffix")]}),(0,d.jsx)("li",{children:a("oauthAutoRefresh")}),(0,d.jsx)("li",{children:a("fullStreaming")})]})]})]})]}),(0,d.jsxs)("section",{id:"protocols",className:"rounded-2xl border border-border bg-bg-subtle p-6",children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:a("protocolsTitle")}),(0,d.jsx)("p",{className:"text-sm text-text-muted mt-2",children:a("protocolsDescription")}),(0,d.jsxs)("div",{className:"mt-4 grid grid-cols-1 lg:grid-cols-2 gap-4 text-sm",children:[(0,d.jsxs)("article",{className:"rounded-lg border border-border p-4 bg-bg",children:[(0,d.jsx)("h3",{className:"font-semibold",children:a("protocolMcpTitle")}),(0,d.jsx)("p",{className:"text-text-muted mt-1",children:a("protocolMcpDesc")}),(0,d.jsxs)("ol",{className:"mt-3 list-decimal list-inside space-y-1 text-text-muted",children:[(0,d.jsx)("li",{children:a("protocolMcpStep1")}),(0,d.jsx)("li",{children:a("protocolMcpStep2")}),(0,d.jsx)("li",{children:a("protocolMcpStep3")})]}),(0,d.jsx)("pre",{className:"mt-3 p-3 rounded-lg border border-border bg-bg overflow-x-auto text-xs",children:(0,d.jsx)("code",{children:"omniroute --mcp"})})]}),(0,d.jsxs)("article",{className:"rounded-lg border border-border p-4 bg-bg",children:[(0,d.jsx)("h3",{className:"font-semibold",children:a("protocolA2aTitle")}),(0,d.jsx)("p",{className:"text-text-muted mt-1",children:a("protocolA2aDesc")}),(0,d.jsxs)("ol",{className:"mt-3 list-decimal list-inside space-y-1 text-text-muted",children:[(0,d.jsx)("li",{children:a("protocolA2aStep1")}),(0,d.jsx)("li",{children:a("protocolA2aStep2")}),(0,d.jsx)("li",{children:a("protocolA2aStep3")})]}),(0,d.jsx)("pre",{className:"mt-3 p-3 rounded-lg border border-border bg-bg overflow-x-auto text-xs",children:(0,d.jsx)("code",{children:`GET /.well-known/agent.json
|
|
1
|
+
module.exports=[978251,a=>a.a(async(b,c)=>{try{var d=a.i(677850),e=b([d]);[d]=e.then?(await e)():e;let g=d.z.object({id:d.z.string().min(1),alias:d.z.string().min(1),name:d.z.string().min(1),icon:d.z.string().min(1),color:d.z.string().regex(/^#[0-9A-Fa-f]{6}$/,"Must be a valid hex color (#RRGGBB)"),textIcon:d.z.string().optional(),website:d.z.string().url().optional(),passthroughModels:d.z.boolean().optional(),deprecated:d.z.boolean().optional(),deprecationReason:d.z.string().optional(),hasFree:d.z.boolean().optional(),freeNote:d.z.string().optional(),authHint:d.z.string().optional(),apiHint:d.z.string().optional()}),h=d.z.record(d.z.string(),g);function f(a,b){let c=h.safeParse(a);if(!c.success){let a=c.error.issues.map(a=>` ${a.path.join(".")}: ${a.message}`).join("\n");throw console.error(`[PROVIDER VALIDATION] ${b} has invalid entries:
|
|
2
|
+
${a}`),Error(`Provider validation failed for ${b}`)}}a.s(["validateProviders",()=>f]),c()}catch(a){c(a)}},!1),549276,a=>a.a(async(b,c)=>{try{var d=a.i(978251),e=b([d]);[d]=e.then?(await e)():e;let f={iflow:{id:"iflow",alias:"if",name:"iFlow AI",icon:"water_drop",color:"#6366F1"},qwen:{id:"qwen",alias:"qw",name:"Qwen Code",icon:"psychology",color:"#10B981"},"gemini-cli":{id:"gemini-cli",alias:"gc",name:"Gemini CLI",icon:"terminal",color:"#4285F4",deprecated:!0,deprecationReason:"Google restricts third-party OAuth usage for Gemini CLI (Mar 2026). Pro models require paid plans. Use 'gemini' (API key) provider instead."},kiro:{id:"kiro",alias:"kr",name:"Kiro AI",icon:"psychology_alt",color:"#FF6B35"}},g={claude:{id:"claude",alias:"cc",name:"Claude Code",icon:"smart_toy",color:"#D97757"},antigravity:{id:"antigravity",alias:"ag",name:"Antigravity",icon:"rocket_launch",color:"#F59E0B"},codex:{id:"codex",alias:"cx",name:"OpenAI Codex",icon:"code",color:"#3B82F6"},github:{id:"github",alias:"gh",name:"GitHub Copilot",icon:"code",color:"#333333"},cursor:{id:"cursor",alias:"cu",name:"Cursor IDE",icon:"edit_note",color:"#00D4AA"},"kimi-coding":{id:"kimi-coding",alias:"kmc",name:"Kimi Coding",icon:"psychology",color:"#1E40AF",textIcon:"KC"},kilocode:{id:"kilocode",alias:"kc",name:"Kilo Code",icon:"code",color:"#FF6B35",textIcon:"KC"},cline:{id:"cline",alias:"cl",name:"Cline",icon:"smart_toy",color:"#5B9BD5",textIcon:"CL"}},h={openrouter:{id:"openrouter",alias:"openrouter",name:"OpenRouter",icon:"router",color:"#F97316",textIcon:"OR",passthroughModels:!0,website:"https://openrouter.ai"},glm:{id:"glm",alias:"glm",name:"GLM Coding",icon:"code",color:"#2563EB",textIcon:"GL",website:"https://open.bigmodel.cn"},"bailian-coding-plan":{id:"bailian-coding-plan",alias:"bcp",name:"Alibaba Coding Plan",icon:"code",color:"#FF6A00",textIcon:"BCP",website:"https://www.alibabacloud.com/help/en/model-studio/coding-plan"},kimi:{id:"kimi",alias:"kimi",name:"Kimi",icon:"psychology",color:"#1E3A8A",textIcon:"KM",website:"https://kimi.moonshot.cn"},"kimi-coding-apikey":{id:"kimi-coding-apikey",alias:"kmca",name:"Kimi Coding (API Key)",icon:"psychology",color:"#1E40AF",textIcon:"KC",website:"https://kimi.com"},minimax:{id:"minimax",alias:"minimax",name:"Minimax Coding",icon:"memory",color:"#7C3AED",textIcon:"MM",website:"https://www.minimaxi.com"},"minimax-cn":{id:"minimax-cn",alias:"minimax-cn",name:"Minimax (China)",icon:"memory",color:"#DC2626",textIcon:"MC",website:"https://www.minimaxi.com"},alicode:{id:"alicode",alias:"alicode",name:"Alibaba",icon:"cloud",color:"#FF6A00",textIcon:"ALi",website:"https://bailian.console.aliyun.com"},"alicode-intl":{id:"alicode-intl",alias:"alicode-intl",name:"Alibaba Intl",icon:"cloud",color:"#FF6A00",textIcon:"ALi",website:"https://modelstudio.console.alibabacloud.com"},openai:{id:"openai",alias:"openai",name:"OpenAI",icon:"auto_awesome",color:"#10A37F",textIcon:"OA",website:"https://platform.openai.com"},anthropic:{id:"anthropic",alias:"anthropic",name:"Anthropic",icon:"smart_toy",color:"#D97757",textIcon:"AN",website:"https://console.anthropic.com"},gemini:{id:"gemini",alias:"gemini",name:"Gemini",icon:"diamond",color:"#4285F4",textIcon:"GE",website:"https://ai.google.dev"},deepseek:{id:"deepseek",alias:"ds",name:"DeepSeek",icon:"bolt",color:"#4D6BFE",textIcon:"DS",website:"https://deepseek.com"},groq:{id:"groq",alias:"groq",name:"Groq",icon:"speed",color:"#F55036",textIcon:"GQ",website:"https://groq.com",hasFree:!0,freeNote:"Free tier: 30 RPM / 14.4K RPD — no credit card"},blackbox:{id:"blackbox",alias:"bb",name:"Blackbox AI",icon:"view_in_ar",color:"#1A1A2E",textIcon:"BB",website:"https://blackbox.ai"},xai:{id:"xai",alias:"xai",name:"xAI (Grok)",icon:"auto_awesome",color:"#1DA1F2",textIcon:"XA",website:"https://x.ai"},mistral:{id:"mistral",alias:"mistral",name:"Mistral",icon:"air",color:"#FF7000",textIcon:"MI",website:"https://mistral.ai"},perplexity:{id:"perplexity",alias:"pplx",name:"Perplexity",icon:"search",color:"#20808D",textIcon:"PP",website:"https://www.perplexity.ai"},together:{id:"together",alias:"together",name:"Together AI",icon:"group_work",color:"#0F6FFF",textIcon:"TG",website:"https://www.together.ai"},fireworks:{id:"fireworks",alias:"fireworks",name:"Fireworks AI",icon:"local_fire_department",color:"#7B2EF2",textIcon:"FW",website:"https://fireworks.ai"},cerebras:{id:"cerebras",alias:"cerebras",name:"Cerebras",icon:"memory",color:"#FF4F00",textIcon:"CB",website:"https://inference.cerebras.ai",hasFree:!0,freeNote:"Free: 1M tokens/day, 60K TPM — world's fastest inference"},cohere:{id:"cohere",alias:"cohere",name:"Cohere",icon:"hub",color:"#39594D",textIcon:"CO",website:"https://cohere.com"},nvidia:{id:"nvidia",alias:"nvidia",name:"NVIDIA NIM",icon:"developer_board",color:"#76B900",textIcon:"NV",website:"https://build.nvidia.com",hasFree:!0,freeNote:"Free dev access: ~40 RPM, 70+ models (Kimi K2.5, GLM 4.7, DeepSeek V3.2...)"},nebius:{id:"nebius",alias:"nebius",name:"Nebius AI",icon:"cloud",color:"#6C5CE7",textIcon:"NB",website:"https://nebius.com"},siliconflow:{id:"siliconflow",alias:"siliconflow",name:"SiliconFlow",icon:"cloud_queue",color:"#5B6EF5",textIcon:"SF",website:"https://cloud.siliconflow.com"},hyperbolic:{id:"hyperbolic",alias:"hyp",name:"Hyperbolic",icon:"bolt",color:"#00D4FF",textIcon:"HY",website:"https://hyperbolic.xyz"},deepgram:{id:"deepgram",alias:"dg",name:"Deepgram",icon:"mic",color:"#13EF93",textIcon:"DG",website:"https://deepgram.com"},assemblyai:{id:"assemblyai",alias:"aai",name:"AssemblyAI",icon:"record_voice_over",color:"#0062FF",textIcon:"AA",website:"https://assemblyai.com"},nanobanana:{id:"nanobanana",alias:"nb",name:"NanoBanana",icon:"image",color:"#FFD700",textIcon:"NB",website:"https://nanobananaapi.ai"},"ollama-cloud":{id:"ollama-cloud",alias:"ollamacloud",name:"Ollama Cloud",icon:"cloud",color:"#58A6FF",textIcon:"OC",website:"https://ollama.com/settings/api-keys"},elevenlabs:{id:"elevenlabs",alias:"el",name:"ElevenLabs",icon:"record_voice_over",color:"#6C47FF",textIcon:"EL",website:"https://elevenlabs.io"},cartesia:{id:"cartesia",alias:"cartesia",name:"Cartesia",icon:"spatial_audio",color:"#FF4F8B",textIcon:"CA",website:"https://cartesia.ai"},playht:{id:"playht",alias:"playht",name:"PlayHT",icon:"play_circle",color:"#00B4D8",textIcon:"PH",website:"https://play.ht"},inworld:{id:"inworld",alias:"inworld",name:"Inworld",icon:"voice_chat",color:"#7B2EF2",textIcon:"IW",website:"https://inworld.ai"},sdwebui:{id:"sdwebui",alias:"sdwebui",name:"SD WebUI",icon:"brush",color:"#FF7043",textIcon:"SD",website:"https://github.com/AUTOMATIC1111/stable-diffusion-webui"},comfyui:{id:"comfyui",alias:"comfyui",name:"ComfyUI",icon:"account_tree",color:"#4CAF50",textIcon:"CF",website:"https://github.com/comfyanonymous/ComfyUI"},huggingface:{id:"huggingface",alias:"hf",name:"HuggingFace",icon:"face",color:"#FFD21E",textIcon:"HF",website:"https://huggingface.co",hasFree:!0,freeNote:"Free Inference API for thousands of models (Whisper, VITS, SDXL…)"},synthetic:{id:"synthetic",alias:"synthetic",name:"Synthetic",icon:"verified_user",color:"#6366F1",textIcon:"SY",website:"https://synthetic.new",passthroughModels:!0},"kilo-gateway":{id:"kilo-gateway",alias:"kg",name:"Kilo Gateway",icon:"hub",color:"#617A91",textIcon:"KG",website:"https://kilo.ai",passthroughModels:!0},vertex:{id:"vertex",alias:"vertex",name:"Vertex AI",icon:"cloud",color:"#4285F4",textIcon:"VA",website:"https://cloud.google.com/vertex-ai",authHint:"Provide Service Account JSON or OAuth access_token"},zai:{id:"zai",alias:"zai",name:"Z.AI (GLM-5)",icon:"psychology",color:"#2563EB",textIcon:"ZA",website:"https://open.bigmodel.cn",apiHint:"API key from https://open.bigmodel.cn/usercenter/apikeys"},"perplexity-search":{id:"perplexity-search",alias:"pplx-search",name:"Perplexity Search",icon:"search",color:"#20808D",textIcon:"PS",website:"https://docs.perplexity.ai/guides/search-quickstart",authHint:"Same API key as Perplexity (pplx-...)"},"serper-search":{id:"serper-search",alias:"serper-search",name:"Serper Search",icon:"search",color:"#4285F4",textIcon:"SP",website:"https://serper.dev",authHint:"API key from serper.dev dashboard"},"brave-search":{id:"brave-search",alias:"brave-search",name:"Brave Search",icon:"travel_explore",color:"#FB542B",textIcon:"BR",website:"https://brave.com/search/api",authHint:"Subscription token from Brave Search API dashboard"},"exa-search":{id:"exa-search",alias:"exa-search",name:"Exa Search",icon:"neurology",color:"#1E40AF",textIcon:"EX",website:"https://exa.ai",authHint:"API key from dashboard.exa.ai"},"tavily-search":{id:"tavily-search",alias:"tavily-search",name:"Tavily Search",icon:"manage_search",color:"#5B4FDB",textIcon:"TV",website:"https://tavily.com",authHint:"API key from app.tavily.com (format: tvly-...)"}},i={...f,...g,...h};Object.values(i).reduce((a,b)=>(a[b.alias]=b.id,a),{}),Object.values(i).reduce((a,b)=>(a[b.id]=b.alias,a),{}),(0,d.validateProviders)(f,"FREE_PROVIDERS"),(0,d.validateProviders)(g,"OAUTH_PROVIDERS"),(0,d.validateProviders)(h,"APIKEY_PROVIDERS"),a.s(["AI_PROVIDERS",0,i,"APIKEY_PROVIDERS",0,h,"FREE_PROVIDERS",0,f,"OAUTH_PROVIDERS",0,g]),c()}catch(a){c(a)}},!1),728972,a=>a.a(async(b,c)=>{try{var d=a.i(958301),e=a.i(549276),f=b([e]);[e]=f.then?(await f)():f,Object.entries(e.AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a),Object.entries(d.PROVIDER_MODELS).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name}))),a.s([]),c()}catch(a){c(a)}},!1),895812,a=>a.a(async(b,c)=>{try{var d=a.i(804730),e=a.i(549276),f=a.i(728972),g=b([e,f]);[e,f]=g.then?(await g)():g;let h={name:"OmniRoute",description:"AI Gateway for Multi-Provider LLMs",version:d.default.version};a.s(["APP_CONFIG",0,h]),c()}catch(a){c(a)}},!1),831575,a=>a.a(async(b,c)=>{try{var d=a.i(907997),e=a.i(395936),f=a.i(442979),g=a.i(895812),h=a.i(549276),i=b([g,h]);[g,h]=i.then?(await i)():i;let l=[{path:"/v1/chat/completions",method:"POST",noteKey:"endpointChatNote"},{path:"/v1/responses",method:"POST",noteKey:"endpointResponsesNote"},{path:"/v1/models",method:"GET",noteKey:"endpointModelsNote"},{path:"/v1/audio/transcriptions",method:"POST",noteKey:"endpointAudioNote"},{path:"/v1/images/generations",method:"POST",noteKey:"endpointImagesNote"},{path:"/chat/completions",method:"POST",noteKey:"endpointRewriteChatNote"},{path:"/responses",method:"POST",noteKey:"endpointRewriteResponsesNote"},{path:"/models",method:"GET",noteKey:"endpointRewriteModelsNote"}],m=[{path:"/api/v1/management/proxies",method:"GET",noteKey:"mgmtProxiesListNote"},{path:"/api/v1/management/proxies",method:"POST",noteKey:"mgmtProxiesCreateNote"},{path:"/api/v1/management/proxies/health",method:"GET",noteKey:"mgmtProxiesHealthNote"},{path:"/api/v1/management/proxies/bulk-assign",method:"PUT",noteKey:"mgmtProxiesBulkAssignNote"},{path:"/api/v1/management/proxies/assignments",method:"GET",noteKey:"mgmtAssignmentsListNote"},{path:"/api/v1/management/proxies/assignments",method:"PUT",noteKey:"mgmtAssignmentsUpdateNote"},{path:"/api/settings/proxies/migrate",method:"POST",noteKey:"mgmtLegacyMigrationNote"}],n=[{icon:"hub",titleKey:"featureRoutingTitle",textKey:"featureRoutingText"},{icon:"layers",titleKey:"featureCombosTitle",textKey:"featureCombosText"},{icon:"bar_chart",titleKey:"featureUsageTitle",textKey:"featureUsageText"},{icon:"analytics",titleKey:"featureAnalyticsTitle",textKey:"featureAnalyticsText"},{icon:"health_and_safety",titleKey:"featureHealthTitle",textKey:"featureHealthText"},{icon:"terminal",titleKey:"featureCliTitle",textKey:"featureCliText"},{icon:"shield",titleKey:"featureSecurityTitle",textKey:"featureSecurityText"},{icon:"cloud_sync",titleKey:"featureCloudSyncTitle",textKey:"featureCloudSyncText"}],o=[{titleKey:"useCaseSingleEndpointTitle",textKey:"useCaseSingleEndpointText"},{titleKey:"useCaseFallbackTitle",textKey:"useCaseFallbackText"},{titleKey:"useCaseUsageVisibilityTitle",textKey:"useCaseUsageVisibilityText"}],p=["troubleshootingModelRouting","troubleshootingAmbiguousModels","troubleshootingCodexFamily","troubleshootingTestConnection","troubleshootingCircuitBreaker","troubleshootingOAuth"],q=[{href:"#quick-start",labelKey:"quickStart"},{href:"#features",labelKey:"features"},{href:"#supported-providers",labelKey:"supportedProvidersToc"},{href:"#use-cases",labelKey:"commonUseCases"},{href:"#client-compatibility",labelKey:"clientCompatibility"},{href:"#protocols",labelKey:"protocolsToc"},{href:"#api-reference",labelKey:"apiReference"},{href:"#management-api",labelKey:"managementApiReference"},{href:"#model-prefixes",labelKey:"modelPrefixes"},{href:"#troubleshooting",labelKey:"troubleshooting"}];function j({title:a,providers:b,colorDot:c}){let e=(0,f.useTranslations)("docs"),g=Object.values(b);return(0,d.jsxs)("div",{className:"rounded-lg border border-border bg-bg p-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,d.jsx)("span",{className:`size-2.5 rounded-full ${c}`}),(0,d.jsx)("h3",{className:"font-semibold",children:a}),(0,d.jsx)("span",{className:"text-xs text-text-muted ml-auto",children:e("providersCount",{count:g.length})})]}),(0,d.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-1 text-sm",children:g.map(a=>(0,d.jsxs)("div",{className:"flex items-center justify-between py-1.5 border-b border-border/40 last:border-0",children:[(0,d.jsx)("span",{className:"font-medium",children:a.name}),(0,d.jsxs)("code",{className:"text-xs text-text-muted px-1.5 py-0.5 rounded bg-bg-subtle",children:[a.alias,"/"]})]},a.id))})]})}function k(){let a=(0,f.useTranslations)("docs"),b=Object.keys(h.FREE_PROVIDERS).length+Object.keys(h.OAUTH_PROVIDERS).length+Object.keys(h.APIKEY_PROVIDERS).length,c=l.map(b=>({...b,note:a(b.noteKey)})),i=m.map(b=>({...b,note:a(b.noteKey)})),k=n.map(b=>({...b,title:a(b.titleKey),text:a(b.textKey)})),r=o.map(b=>({...b,title:a(b.titleKey),text:a(b.textKey)})),s=p.map(b=>a(b)),t=q.map(b=>({...b,label:a(b.labelKey)})),u=[...Object.values(h.FREE_PROVIDERS).map(a=>({...a,type:"free"})),...Object.values(h.OAUTH_PROVIDERS).map(a=>({...a,type:"oauth"})),...Object.values(h.APIKEY_PROVIDERS).map(a=>({...a,type:"apiKey"}))];return(0,d.jsx)("div",{className:"min-h-screen bg-bg text-text-main",children:(0,d.jsxs)("div",{className:"mx-auto max-w-6xl px-4 sm:px-6 lg:px-8 py-10 md:py-14 flex flex-col gap-8",children:[(0,d.jsx)("header",{className:"rounded-2xl border border-border bg-bg-subtle p-6 md:p-8",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-xs uppercase tracking-wider text-text-muted",children:a("documentationVersion",{version:g.APP_CONFIG.version})}),(0,d.jsxs)("h1",{className:"text-3xl md:text-4xl font-bold mt-1",children:[g.APP_CONFIG.name," ",a("docsLabel")]}),(0,d.jsx)("p",{className:"text-sm md:text-base text-text-muted mt-2 max-w-3xl",children:a("docsHeroDescription")})]}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(e.default,{href:"/dashboard",className:"px-3 py-2 rounded-lg border border-border text-sm hover:bg-bg transition-colors",children:a("openDashboard")}),(0,d.jsx)(e.default,{href:"/dashboard/endpoint",className:"px-3 py-2 rounded-lg border border-border text-sm hover:bg-bg transition-colors",children:a("endpointPage")}),(0,d.jsxs)("a",{href:"https://github.com/diegosouzapw/OmniRoute",target:"_blank",rel:"noopener noreferrer",className:"px-3 py-2 rounded-lg border border-border text-sm hover:bg-bg transition-colors flex items-center gap-1",children:[a("github")," ",(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"open_in_new"})]}),(0,d.jsx)("a",{href:"https://github.com/diegosouzapw/OmniRoute/issues",target:"_blank",rel:"noopener noreferrer",className:"px-3 py-2 rounded-lg border border-border text-sm hover:bg-bg transition-colors",children:a("reportIssue")})]})]})}),(0,d.jsxs)("nav",{className:"rounded-2xl border border-border bg-bg-subtle p-6",children:[(0,d.jsx)("h2",{className:"text-sm font-semibold uppercase tracking-wider text-text-muted mb-3",children:a("onThisPage")}),(0,d.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 text-sm",children:t.map(a=>(0,d.jsxs)("a",{href:a.href,className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-border hover:bg-bg transition-colors",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"tag"}),a.label]},a.href))})]}),(0,d.jsxs)("section",{id:"quick-start",className:"rounded-2xl border border-border bg-bg-subtle p-6",children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:a("quickStart")}),(0,d.jsxs)("ol",{className:"mt-4 grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[(0,d.jsxs)("li",{className:"rounded-lg border border-border p-3 bg-bg",children:[(0,d.jsx)("span",{className:"font-semibold",children:a("quickStartStep1Title")}),(0,d.jsxs)("p",{className:"text-text-muted mt-1",children:[a("quickStartStep1Prefix")," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"npx omniroute"})," ",a("quickStartStep1Middle")," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"npm start"}),"."]})]}),(0,d.jsxs)("li",{className:"rounded-lg border border-border p-3 bg-bg",children:[(0,d.jsx)("span",{className:"font-semibold",children:a("quickStartStep2Title")}),(0,d.jsx)("p",{className:"text-text-muted mt-1",children:a("quickStartStep2Text")})]}),(0,d.jsxs)("li",{className:"rounded-lg border border-border p-3 bg-bg",children:[(0,d.jsx)("span",{className:"font-semibold",children:a("quickStartStep3Title")}),(0,d.jsx)("p",{className:"text-text-muted mt-1",children:a("quickStartStep3Text")})]}),(0,d.jsxs)("li",{className:"rounded-lg border border-border p-3 bg-bg",children:[(0,d.jsx)("span",{className:"font-semibold",children:a("quickStartStep4Title")}),(0,d.jsxs)("p",{className:"text-text-muted mt-1",children:[a("quickStartStep4Prefix")," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"https://<host>/v1"}),"."," ",a("quickStartStep4Suffix")," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"gh/gpt-5.1-codex"}),"."]})]})]})]}),(0,d.jsxs)("section",{id:"features",className:"rounded-2xl border border-border bg-bg-subtle p-6",children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:a("features")}),(0,d.jsx)("div",{className:"mt-4 grid grid-cols-1 md:grid-cols-2 gap-3",children:k.map(a=>(0,d.jsxs)("article",{className:"rounded-lg border border-border p-4 bg-bg flex gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px] text-primary shrink-0 mt-0.5",children:a.icon}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"font-semibold text-sm",children:a.title}),(0,d.jsx)("p",{className:"text-sm text-text-muted mt-1",children:a.text})]})]},a.titleKey))})]}),(0,d.jsxs)("section",{id:"supported-providers",className:"rounded-2xl border border-border bg-bg-subtle p-6",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:a("supportedProviders")}),(0,d.jsx)("p",{className:"text-sm text-text-muted mt-1",children:a("providersAcrossConnectionTypes",{count:b})})]}),(0,d.jsx)(e.default,{href:"/dashboard/providers",className:"px-3 py-2 rounded-lg border border-border text-sm hover:bg-bg transition-colors",children:a("manageProviders")})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-3",children:[(0,d.jsx)(j,{title:a("providerTypeFree"),providers:h.FREE_PROVIDERS,colorDot:"bg-green-500"}),(0,d.jsx)(j,{title:a("providerTypeOAuth"),providers:h.OAUTH_PROVIDERS,colorDot:"bg-blue-500"}),(0,d.jsx)(j,{title:a("providerTypeApiKey"),providers:h.APIKEY_PROVIDERS,colorDot:"bg-amber-500"})]})]}),(0,d.jsxs)("section",{id:"use-cases",className:"rounded-2xl border border-border bg-bg-subtle p-6",children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:a("commonUseCases")}),(0,d.jsx)("div",{className:"mt-4 grid grid-cols-1 md:grid-cols-3 gap-3",children:r.map(a=>(0,d.jsxs)("article",{className:"rounded-lg border border-border p-4 bg-bg",children:[(0,d.jsx)("h3",{className:"font-semibold",children:a.title}),(0,d.jsx)("p",{className:"text-sm text-text-muted mt-2",children:a.text})]},a.titleKey))})]}),(0,d.jsxs)("section",{id:"client-compatibility",className:"rounded-2xl border border-border bg-bg-subtle p-6",children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:a("clientCompatibility")}),(0,d.jsxs)("div",{className:"mt-4 grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[(0,d.jsxs)("article",{className:"rounded-lg border border-border p-4 bg-bg",children:[(0,d.jsx)("h3",{className:"font-semibold",children:a("clientCherryStudioTitle")}),(0,d.jsxs)("ul",{className:"mt-2 text-text-muted space-y-1",children:[(0,d.jsxs)("li",{children:[a("baseUrlLabel"),":"," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"https://<host>/v1"})]}),(0,d.jsxs)("li",{children:[a("chatEndpointLabel"),":"," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"/chat/completions"})]}),(0,d.jsxs)("li",{children:[a("modelRecommendationLabel")," (",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"gh/..."}),","," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"cc/..."}),")"]})]})]}),(0,d.jsxs)("article",{className:"rounded-lg border border-border p-4 bg-bg",children:[(0,d.jsx)("h3",{className:"font-semibold",children:a("clientCodexTitle")}),(0,d.jsxs)("ul",{className:"mt-2 text-text-muted space-y-1",children:[(0,d.jsxs)("li",{children:[a("clientCodexBullet1")," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"gh/"}),"."]}),(0,d.jsxs)("li",{children:[a("clientCodexBullet2")," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"/responses"}),"."]}),(0,d.jsxs)("li",{children:[a("clientCodexBullet3")," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"/chat/completions"}),"."]})]})]}),(0,d.jsxs)("article",{className:"rounded-lg border border-border p-4 bg-bg",children:[(0,d.jsx)("h3",{className:"font-semibold",children:a("clientCursorTitle")}),(0,d.jsxs)("ul",{className:"mt-2 text-text-muted space-y-1",children:[(0,d.jsxs)("li",{children:[a("clientCursorBullet1")," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"cu/"})," ",a("clientCursorBullet1Suffix")]}),(0,d.jsx)("li",{children:a("clientCursorBullet2")}),(0,d.jsx)("li",{children:a("supportsChat")})]})]}),(0,d.jsxs)("article",{className:"rounded-lg border border-border p-4 bg-bg",children:[(0,d.jsx)("h3",{className:"font-semibold",children:a("clientClaudeTitle")}),(0,d.jsxs)("ul",{className:"mt-2 text-text-muted space-y-1",children:[(0,d.jsxs)("li",{children:[a("clientClaudeBullet1Prefix")," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"cc/"})," ",a("clientClaudeBullet1Middle")," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg-subtle",children:"ag/"})," ",a("clientClaudeBullet1Suffix")]}),(0,d.jsx)("li",{children:a("oauthAutoRefresh")}),(0,d.jsx)("li",{children:a("fullStreaming")})]})]})]})]}),(0,d.jsxs)("section",{id:"protocols",className:"rounded-2xl border border-border bg-bg-subtle p-6",children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:a("protocolsTitle")}),(0,d.jsx)("p",{className:"text-sm text-text-muted mt-2",children:a("protocolsDescription")}),(0,d.jsxs)("div",{className:"mt-4 grid grid-cols-1 lg:grid-cols-2 gap-4 text-sm",children:[(0,d.jsxs)("article",{className:"rounded-lg border border-border p-4 bg-bg",children:[(0,d.jsx)("h3",{className:"font-semibold",children:a("protocolMcpTitle")}),(0,d.jsx)("p",{className:"text-text-muted mt-1",children:a("protocolMcpDesc")}),(0,d.jsxs)("ol",{className:"mt-3 list-decimal list-inside space-y-1 text-text-muted",children:[(0,d.jsx)("li",{children:a("protocolMcpStep1")}),(0,d.jsx)("li",{children:a("protocolMcpStep2")}),(0,d.jsx)("li",{children:a("protocolMcpStep3")})]}),(0,d.jsx)("pre",{className:"mt-3 p-3 rounded-lg border border-border bg-bg overflow-x-auto text-xs",children:(0,d.jsx)("code",{children:"omniroute --mcp"})})]}),(0,d.jsxs)("article",{className:"rounded-lg border border-border p-4 bg-bg",children:[(0,d.jsx)("h3",{className:"font-semibold",children:a("protocolA2aTitle")}),(0,d.jsx)("p",{className:"text-text-muted mt-1",children:a("protocolA2aDesc")}),(0,d.jsxs)("ol",{className:"mt-3 list-decimal list-inside space-y-1 text-text-muted",children:[(0,d.jsx)("li",{children:a("protocolA2aStep1")}),(0,d.jsx)("li",{children:a("protocolA2aStep2")}),(0,d.jsx)("li",{children:a("protocolA2aStep3")})]}),(0,d.jsx)("pre",{className:"mt-3 p-3 rounded-lg border border-border bg-bg overflow-x-auto text-xs",children:(0,d.jsx)("code",{children:`GET /.well-known/agent.json
|
|
3
3
|
POST /a2a (JSON-RPC: message/send | message/stream)`})})]})]}),(0,d.jsxs)("div",{className:"mt-4 rounded-lg border border-border p-4 bg-bg",children:[(0,d.jsx)("h3",{className:"font-semibold",children:a("protocolTroubleshootingTitle")}),(0,d.jsxs)("ul",{className:"mt-2 list-disc list-inside text-sm text-text-muted space-y-1",children:[(0,d.jsx)("li",{children:a("protocolTroubleshooting1")}),(0,d.jsx)("li",{children:a("protocolTroubleshooting2")}),(0,d.jsx)("li",{children:a("protocolTroubleshooting3")})]})]})]}),(0,d.jsxs)("section",{id:"api-reference",className:"rounded-2xl border border-border bg-bg-subtle p-6",children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:a("apiReference")}),(0,d.jsx)("div",{className:"mt-4 overflow-x-auto",children:(0,d.jsxs)("table",{className:"w-full text-sm border-collapse",children:[(0,d.jsx)("thead",{children:(0,d.jsxs)("tr",{className:"border-b border-border",children:[(0,d.jsx)("th",{className:"text-left py-2 pr-4",children:a("method")}),(0,d.jsx)("th",{className:"text-left py-2 pr-4",children:a("path")}),(0,d.jsx)("th",{className:"text-left py-2",children:a("notes")})]})}),(0,d.jsx)("tbody",{children:c.map(a=>(0,d.jsxs)("tr",{className:"border-b border-border/60",children:[(0,d.jsx)("td",{className:"py-2 pr-4",children:(0,d.jsx)("code",{className:"px-1.5 py-0.5 rounded bg-bg text-xs font-semibold",children:a.method})}),(0,d.jsx)("td",{className:"py-2 pr-4 font-mono",children:a.path}),(0,d.jsx)("td",{className:"py-2 text-text-muted",children:a.note})]},a.path))})]})})]}),(0,d.jsxs)("section",{id:"model-prefixes",className:"rounded-2xl border border-border bg-bg-subtle p-6",children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:a("modelPrefixes")}),(0,d.jsxs)("p",{className:"text-sm text-text-muted mt-2 mb-4",children:[a("modelPrefixesDescriptionStart")," ",(0,d.jsx)("code",{className:"px-1 rounded bg-bg",children:"gh/gpt-5.1-codex"})," ",a("modelPrefixesDescriptionEnd")]}),(0,d.jsx)("div",{className:"overflow-x-auto",children:(0,d.jsxs)("table",{className:"w-full text-sm border-collapse",children:[(0,d.jsx)("thead",{children:(0,d.jsxs)("tr",{className:"border-b border-border",children:[(0,d.jsx)("th",{className:"text-left py-2 pr-4",children:a("prefix")}),(0,d.jsx)("th",{className:"text-left py-2 pr-4",children:a("provider")}),(0,d.jsx)("th",{className:"text-left py-2",children:a("type")})]})}),(0,d.jsx)("tbody",{children:u.map(b=>{var c;return(0,d.jsxs)("tr",{className:"border-b border-border/60",children:[(0,d.jsx)("td",{className:"py-2 pr-4 font-mono",children:(0,d.jsxs)("code",{className:"px-1.5 py-0.5 rounded bg-bg",children:[b.alias,"/"]})}),(0,d.jsx)("td",{className:"py-2 pr-4",children:b.name}),(0,d.jsx)("td",{className:"py-2",children:(0,d.jsxs)("span",{className:`inline-flex items-center gap-1 text-xs ${"free"===b.type?"text-green-500":"oauth"===b.type?"text-blue-500":"text-amber-500"}`,children:[(0,d.jsx)("span",{className:`size-1.5 rounded-full ${"free"===b.type?"bg-green-500":"oauth"===b.type?"bg-blue-500":"bg-amber-500"}`}),(c=b.type,"free"===c?a("providerTypeFree"):"oauth"===c?a("providerTypeOAuth"):a("providerTypeApiKey"))]})})]},b.id)})})]})})]}),(0,d.jsxs)("section",{id:"management-api",className:"rounded-2xl border border-border bg-bg-subtle p-6",children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:a("managementApiReference")}),(0,d.jsx)("p",{className:"text-sm text-text-muted mt-2",children:a("managementApiDescription")}),(0,d.jsx)("div",{className:"mt-4 overflow-x-auto",children:(0,d.jsxs)("table",{className:"w-full text-sm border-collapse",children:[(0,d.jsx)("thead",{children:(0,d.jsxs)("tr",{className:"border-b border-border",children:[(0,d.jsx)("th",{className:"text-left py-2 pr-4",children:a("method")}),(0,d.jsx)("th",{className:"text-left py-2 pr-4",children:a("path")}),(0,d.jsx)("th",{className:"text-left py-2",children:a("notes")})]})}),(0,d.jsx)("tbody",{children:i.map(a=>(0,d.jsxs)("tr",{className:"border-b border-border/60",children:[(0,d.jsx)("td",{className:"py-2 pr-4",children:(0,d.jsx)("code",{className:"px-1.5 py-0.5 rounded bg-bg text-xs font-semibold",children:a.method})}),(0,d.jsx)("td",{className:"py-2 pr-4 font-mono",children:a.path}),(0,d.jsx)("td",{className:"py-2 text-text-muted",children:a.note})]},`${a.method}:${a.path}`))})]})})]}),(0,d.jsxs)("section",{id:"troubleshooting",className:"rounded-2xl border border-border bg-bg-subtle p-6",children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:a("troubleshooting")}),(0,d.jsx)("ul",{className:"mt-4 list-disc list-inside text-sm text-text-muted space-y-2",children:s.map(a=>(0,d.jsx)("li",{children:a},a))})]})]})})}a.s(["default",()=>k]),c()}catch(a){c(a)}},!1)];
|
|
4
4
|
|
|
5
5
|
//# sourceMappingURL=src_ec615d6e._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[482970,a=>{"use strict";let b,c,d;var e=a.i(895956);a.i(147921);var f=a.i(289226);function g(a,b){if(!a)return b;let c=Number.parseInt(String(a),10);return!Number.isFinite(c)||c<1||c>65535?b:c}let{dashboardPort:h}=(b=g(process.env.OMNIROUTE_PORT||process.env.PORT,20128),c=!!process.env.API_PORT,d=!!process.env.DASHBOARD_PORT,{port:b,apiPort:g(process.env.API_PORT,b),dashboardPort:g(process.env.DASHBOARD_PORT,b),apiPortExplicit:c,dashboardPortExplicit:d}),i=process.env.BASE_URL||process.env.NEXT_PUBLIC_BASE_URL||process.env.NEXT_PUBLIC_APP_URL||`http://localhost:${h}`;class j{machineId;intervalMinutes;intervalId;constructor(a=null,b=15){this.machineId=a,this.intervalMinutes=b,this.intervalId=null}async initializeMachineId(){this.machineId||(this.machineId=await (0,e.getConsistentMachineId)())}async start(){this.intervalId||(await this.initializeMachineId(),setTimeout(()=>{this.syncWithRetry().catch(()=>{})},3e4),this.intervalId=setInterval(()=>{this.syncWithRetry().catch(()=>{})},60*this.intervalMinutes*1e3))}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)}async syncWithRetry(a=1){for(let b=1;b<=a;b++)try{return await this.sync()}catch(d){if(b===a)return null;let c=Math.min(1e3*Math.pow(2,b),1e4);await new Promise(a=>setTimeout(a,c))}}async sync(){if(!await (0,f.isCloudEnabled)())return null;await this.initializeMachineId();let a=await fetch(`${i}/api/sync/cloud`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({machineId:this.machineId,action:"sync"})});if(!a.ok)throw Error((await a.json().catch(()=>({}))).error||"Sync failed");return await a.json()}isRunning(){return null!==this.intervalId}}let k=null;async function l(a=null,b=15){return k||(k=new j(a,b)),k}var m=a.i(323746);async function n(){try{await (0,m.cleanupProviderConnections)();let a=await l(null,15);return await a.start(),a}catch(a){throw console.error("[CloudSync] Error initializing scheduler:",a),a}}a.z.main===module&&n().catch(a=>console.error("[CloudSync] init failed:",a));var o=a.i(522734),p=a.i(814747);let q=["clientId","clientSecret","tokenUrl","authUrl","refreshUrl"],r=0,s=null;var t=a.i(503070);parseInt(process.env.FETCH_TIMEOUT_MS||"120000",10),parseInt(process.env.STREAM_IDLE_TIMEOUT_MS||"300000",10);let u=(0,t.generateLegacyProviders)();!function(a){let b;if(s&&Date.now()-r<6e4)return;let c=(b=process.env.DATA_DIR||(0,p.join)(process.cwd(),"data"),(0,p.join)(b,"provider-credentials.json"));if(!(0,o.existsSync)(c))return s||console.log("[CREDENTIALS] No external credentials file found, using defaults."),s=a,r=Date.now();try{let b=(0,o.readFileSync)(c,"utf-8"),d=JSON.parse(b),e=0;for(let[b,c]of Object.entries(d)){if(!a[b]){console.log(`[CREDENTIALS] Warning: unknown provider "${b}" in credentials file, skipping.`);continue}if(!c||"object"!=typeof c){console.log(`[CREDENTIALS] Warning: provider "${b}" value must be an object, got ${typeof c}. Skipping.`);continue}for(let d of q)void 0!==c[d]&&(a[b][d]=c[d],e++)}let f=null!==s;console.log(`[CREDENTIALS] ${f?"Reloaded":"Loaded"} external credentials: ${e} field(s) from ${c}`)}catch(a){console.log(`[CREDENTIALS] Error reading credentials file: ${a.message}. Using defaults.`)}s=a,r=Date.now()}(u);let v="https://oauth2.googleapis.com/token",w="https://auth.openai.com/oauth/token",x="https://console.anthropic.com/v1/oauth/token",y="https://chat.qwen.ai/api/v1/oauth2/token",z="https://iflow.cn/oauth/token",A="https://github.com/login/oauth/access_token";var B=a.i(666680);let C=new Map;async function D(a,b,c,d){let e=u[a],f=e?.refreshUrl||e?.tokenUrl;if(!e||!f)return d?.warn?.("TOKEN_REFRESH",`No refresh endpoint configured for provider: ${a}`),null;if(!b)return d?.warn?.("TOKEN_REFRESH",`No refresh token available for provider: ${a}`),null;try{let c=new URLSearchParams({grant_type:"refresh_token",refresh_token:b});e.clientId&&c.set("client_id",e.clientId),e.clientSecret&&c.set("client_secret",e.clientSecret);let g=await fetch(f,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:c});if(!g.ok){let b=await g.text();return d?.error?.("TOKEN_REFRESH",`Failed to refresh token for ${a}`,{status:g.status,error:b}),null}let h=await g.json();return d?.info?.("TOKEN_REFRESH",`Successfully refreshed token for ${a}`,{hasNewAccessToken:!!h.access_token,hasNewRefreshToken:!!h.refresh_token,expiresIn:h.expires_in}),{accessToken:h.access_token,refreshToken:h.refresh_token||b,expiresIn:h.expires_in}}catch(b){return d?.error?.("TOKEN_REFRESH",`Error refreshing token for ${a}`,{error:b.message}),null}}async function E(a,b){let c=u.cline?.refreshUrl;if(!c)return b?.warn?.("TOKEN_REFRESH","No refresh URL configured for Cline"),null;try{let d=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:a,grantType:"refresh_token",clientType:"extension"})});if(!d.ok){let a=await d.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Cline token",{status:d.status,error:a}),null}let e=await d.json(),f=e?.data||e,g=f?.expiresAt,h=g?Math.max(1,Math.floor((new Date(g).getTime()-Date.now())/1e3)):void 0;return b?.info?.("TOKEN_REFRESH","Successfully refreshed Cline token",{hasNewAccessToken:!!f?.accessToken,hasNewRefreshToken:!!f?.refreshToken,expiresIn:h}),{accessToken:f?.accessToken,refreshToken:f?.refreshToken||a,expiresIn:h}}catch(a){return b?.error?.("TOKEN_REFRESH",`Network error refreshing Cline token: ${a.message}`),null}}async function F(a,b){let c=u["kimi-coding"]?.refreshUrl||u["kimi-coding"]?.tokenUrl;if(!c)return b?.warn?.("TOKEN_REFRESH","No refresh URL configured for Kimi Coding"),null;let d="kimi-refresh-"+Date.now(),e="u">typeof process?`${process.platform} ${process.arch}`:"unknown";try{let f=new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:u["kimi-coding"]?.clientId||""}),g=await fetch(c,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","X-Msh-Platform":"omniroute","X-Msh-Version":"2.1.2","X-Msh-Device-Model":e,"X-Msh-Device-Id":d},body:f});if(!g.ok){let a=await g.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Kimi Coding token",{status:g.status,error:a}),null}let h=await g.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Kimi Coding token",{hasNewAccessToken:!!h.access_token,hasNewRefreshToken:!!h.refresh_token,expiresIn:h.expires_in}),{accessToken:h.access_token,refreshToken:h.refresh_token||a,expiresIn:h.expires_in,tokenType:h.token_type,scope:h.scope}}catch(a){return b?.error?.("TOKEN_REFRESH",`Network error refreshing Kimi Coding token: ${a.message}`),null}}async function G(a,b){try{let c=await fetch(x,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:a,client_id:u.claude.clientId})});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Claude OAuth token",{status:c.status,error:a}),null}let d=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Claude OAuth token",{hasNewAccessToken:!!d.access_token,hasNewRefreshToken:!!d.refresh_token,expiresIn:d.expires_in}),{accessToken:d.access_token,refreshToken:d.refresh_token||a,expiresIn:d.expires_in}}catch(a){return b?.error?.("TOKEN_REFRESH",`Network error refreshing Claude token: ${a.message}`),null}}async function H(a,b,c,d){let e=await fetch(v,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:b,client_secret:c})});if(!e.ok){let a=await e.text();return d?.error?.("TOKEN_REFRESH","Failed to refresh Google token",{status:e.status,error:a}),null}let f=await e.json();return d?.info?.("TOKEN_REFRESH","Successfully refreshed Google token",{hasNewAccessToken:!!f.access_token,hasNewRefreshToken:!!f.refresh_token,expiresIn:f.expires_in}),{accessToken:f.access_token,refreshToken:f.refresh_token||a,expiresIn:f.expires_in}}async function I(a,b){try{let c=await fetch(y,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:u.qwen.clientId})});if(200===c.status){let d=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Qwen token",{hasNewAccessToken:!!d.access_token,hasNewRefreshToken:!!d.refresh_token,expiresIn:d.expires_in}),{accessToken:d.access_token,refreshToken:d.refresh_token||a,expiresIn:d.expires_in}}{let a=await c.text().catch(()=>""),d=null;try{let b=JSON.parse(a);d=b?.error}catch{}if("invalid_request"===d)return b?.error?.("TOKEN_REFRESH","Qwen refresh token is invalid or expired. Re-authentication required.",{status:c.status}),{error:"invalid_request"};b?.warn?.("TOKEN_REFRESH","Error with Qwen endpoint",{status:c.status,error:a})}}catch(a){b?.warn?.("TOKEN_REFRESH","Network error trying Qwen endpoint",{error:a.message})}return b?.error?.("TOKEN_REFRESH","Failed to refresh Qwen token"),null}async function J(a,b){try{let c=await fetch(w,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:u.codex.clientId,scope:"openid profile email offline_access"})});if(!c.ok){let a=await c.text(),d=null;try{let b=JSON.parse(a);d=b?.error?.code}catch{}if("refresh_token_reused"===d)return b?.error?.("TOKEN_REFRESH","Codex refresh token already used (rotating token consumed). Re-authentication required.",{status:c.status}),{error:"refresh_token_reused"};return b?.error?.("TOKEN_REFRESH","Failed to refresh Codex token",{status:c.status,error:a}),null}let d=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Codex token",{hasNewAccessToken:!!d.access_token,hasNewRefreshToken:!!d.refresh_token,expiresIn:d.expires_in}),{accessToken:d.access_token,refreshToken:d.refresh_token||a,expiresIn:d.expires_in}}catch(a){return b?.error?.("TOKEN_REFRESH",`Network error refreshing Codex token: ${a.message}`),null}}async function K(a,b,c){try{let d=b?.authMethod,e=b?.clientId,f=b?.clientSecret,g=b?.region;if(e&&f){let b="idc"===d&&g?`https://oidc.${g}.amazonaws.com/token`:"https://oidc.us-east-1.amazonaws.com/token",h=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:e,clientSecret:f,refreshToken:a,grantType:"refresh_token"})});if(!h.ok){let a=await h.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro AWS token",{status:h.status,error:a}),null}let i=await h.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro AWS token",{hasNewAccessToken:!!i.accessToken,expiresIn:i.expiresIn}),{accessToken:i.accessToken,refreshToken:i.refreshToken||a,expiresIn:i.expiresIn}}let h=await fetch(u.kiro.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:a})});if(!h.ok){let a=await h.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro social token",{status:h.status,error:a}),null}let i=await h.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro social token",{hasNewAccessToken:!!i.accessToken,expiresIn:i.expiresIn}),{accessToken:i.accessToken,refreshToken:i.refreshToken||a,expiresIn:i.expiresIn}}catch(a){return c?.error?.("TOKEN_REFRESH",`Network error refreshing Kiro token: ${a.message}`),null}}async function L(a,b){let c=btoa(`${u.iflow.clientId}:${u.iflow.clientSecret}`),d=await fetch(z,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${c}`},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:u.iflow.clientId,client_secret:u.iflow.clientSecret})});if(!d.ok){let a=await d.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh iFlow token",{status:d.status,error:a}),null}let e=await d.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed iFlow token",{hasNewAccessToken:!!e.access_token,hasNewRefreshToken:!!e.refresh_token,expiresIn:e.expires_in}),{accessToken:e.access_token,refreshToken:e.refresh_token||a,expiresIn:e.expires_in}}async function M(a,b){let c=await fetch(A,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:u.github.clientId,client_secret:u.github.clientSecret})});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh GitHub token",{status:c.status,error:a}),null}let d=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed GitHub token",{hasNewAccessToken:!!d.access_token,hasNewRefreshToken:!!d.refresh_token,expiresIn:d.expires_in}),{accessToken:d.access_token,refreshToken:d.refresh_token||a,expiresIn:d.expires_in}}async function N(a,b,c){switch(a){case"gemini":case"gemini-cli":case"antigravity":return await H(b.refreshToken,u[a].clientId,u[a].clientSecret,c);case"claude":return await G(b.refreshToken,c);case"codex":return await J(b.refreshToken,c);case"qwen":return await I(b.refreshToken,c);case"iflow":return await L(b.refreshToken,c);case"github":return await M(b.refreshToken,c);case"kiro":return await K(b.refreshToken,b.providerSpecificData,c);case"cline":return await E(b.refreshToken,c);case"kimi-coding":return await F(b.refreshToken,c);default:return D(a,b.refreshToken,b,c)}}async function O(a,b,c){var d;let e;if(!b||!b.refreshToken||"string"!=typeof b.refreshToken)return c?.warn?.("TOKEN_REFRESH",`No valid refresh token available for provider: ${a}`),null;let f=(d=b.refreshToken,e=(0,B.createHash)("sha256").update(d).digest("hex"),`${a}:${e}`);if(C.has(f))return c?.info?.("TOKEN_REFRESH",`Reusing in-flight refresh for ${a}`),C.get(f);let g=N(a,b,c).finally(()=>{C.delete(f)});return C.set(f,g),g}let P="[HealthCheck]",Q=new Set(["1","true","yes","on"]);function R(a){let b=process.env[a];return!!b&&Q.has(b.trim().toLowerCase())}let S=null,T=0,U=null;async function V(){if(R("OMNIROUTE_HIDE_HEALTHCHECK_LOGS"))return!0;let a=Date.now();return null!==S&&a-T<3e4?S:null!==U?U:U=(async()=>{try{let b=await (0,f.getSettings)();return S=!0===b.hideHealthCheckLogs,T=a,S}catch{return!1}finally{U=null}})()}function W(a,...b){V().then(c=>{c||console.log(a,...b)})}function X(a,...b){V().then(c=>{c||console.error(a,...b)})}let Y=!1;async function Z(){try{let a=await (0,m.getProviderConnections)({authType:"oauth"});if(!a||0===a.length)return;for(let b of a)try{await $(b)}catch(a){X(`${P} Error checking ${b.name||b.id}:`,a.message)}}catch(a){X(`${P} Sweep error:`,a.message)}}async function $(a){let b=a.healthCheckInterval??60;if(b<=0||!a.isActive||!a.refreshToken||"string"!=typeof a.refreshToken||"expired"===a.testStatus)return;if(!function(a){if(new Set(["gemini","gemini-cli","antigravity","claude","codex","qwen","iflow","github","kiro","cline","kimi-coding"]).has(a))return!0;let b=u[a];return!!(b?.refreshUrl||b?.tokenUrl)}(a.provider)){let b=new Date().toISOString();await (0,m.updateProviderConnection)(a.id,{lastHealthCheckAt:b}),W(`${P} Skipping ${a.provider}/${a.name||a.email||a.id} (refresh unsupported)`);return}let c=a.lastHealthCheckAt?new Date(a.lastHealthCheckAt).getTime():0;if(Date.now()-c<60*b*1e3)return;W(`${P} Refreshing ${a.provider}/${a.name||a.email||a.id} (interval: ${b}min)`);let d={refreshToken:a.refreshToken,accessToken:a.accessToken,expiresAt:a.tokenExpiresAt,providerSpecificData:a.providerSpecificData},e=await V(),f=await O(a.provider,d,{info:(a,b)=>{e||console.log(`${P} [${a}] ${b}`)},warn:(a,b)=>{e||console.warn(`${P} [${a}] ${b}`)},error:(a,b,c)=>{e||console.error(`${P} [${a}] ${b}`,c||"")}}),g=new Date().toISOString();if(f&&"object"==typeof f&&("refresh_token_reused"===f.error||"invalid_request"===f.error)){await (0,m.updateProviderConnection)(a.id,{lastHealthCheckAt:g,testStatus:"expired",lastError:`Refresh token consumed (${f.error}). Please re-authenticate this account.`,lastErrorAt:g,lastErrorType:f.error,lastErrorSource:"oauth",errorCode:f.error,isActive:!1,refreshToken:null}),X(`${P} ✗ ${a.provider}/${a.name||a.email||a.id} — Refresh token is permanently invalid (${f.error}). Connection deactivated. Re-authenticate to restore.`);return}if(f&&f.accessToken){let b={accessToken:f.accessToken,lastHealthCheckAt:g,testStatus:"active",lastError:null,lastErrorAt:null,lastErrorType:null,lastErrorSource:null,errorCode:null};f.refreshToken&&(b.refreshToken=f.refreshToken),f.expiresIn&&(b.tokenExpiresAt=new Date(Date.now()+1e3*f.expiresIn).toISOString()),await (0,m.updateProviderConnection)(a.id,b),W(`${P} ✓ ${a.provider}/${a.name||a.email||a.id} refreshed`)}else await (0,m.updateProviderConnection)(a.id,{lastHealthCheckAt:g,testStatus:"error",lastError:"Health check: token refresh failed",lastErrorAt:g,lastErrorType:"token_refresh_failed",lastErrorSource:"oauth",errorCode:"refresh_failed"}),function(a,...b){V().then(c=>{c||console.warn(a,...b)})}(`${P} ✗ ${a.provider}/${a.name||a.email||a.id} refresh failed`)}R("OMNIROUTE_DISABLE_TOKEN_HEALTHCHECK")||(Y=!0,W(`${P} Starting proactive token health-check (tick every 60s)`),setTimeout(()=>{Z(),setInterval(Z,6e4)},1e4));let _=!1;(async function(){if(!_)try{await n(),_=!0}catch(a){console.error("[ServerInit] Error initializing cloud sync:",a)}return _})().catch(a=>console.error("[CloudSync] ensure failed:",a)),a.s([],482970)}];
|
|
1
|
+
module.exports=[482970,a=>{"use strict";let b,c,d;var e=a.i(895956);a.i(147921);var f=a.i(289226);function g(a,b){if(!a)return b;let c=Number.parseInt(String(a),10);return!Number.isFinite(c)||c<1||c>65535?b:c}let{dashboardPort:h}=(b=g(process.env.OMNIROUTE_PORT||process.env.PORT,20128),c=!!process.env.API_PORT,d=!!process.env.DASHBOARD_PORT,{port:b,apiPort:g(process.env.API_PORT,b),dashboardPort:g(process.env.DASHBOARD_PORT,b),apiPortExplicit:c,dashboardPortExplicit:d}),i=process.env.BASE_URL||process.env.NEXT_PUBLIC_BASE_URL||process.env.NEXT_PUBLIC_APP_URL||`http://localhost:${h}`;class j{machineId;intervalMinutes;intervalId;constructor(a=null,b=15){this.machineId=a,this.intervalMinutes=b,this.intervalId=null}async initializeMachineId(){this.machineId||(this.machineId=await (0,e.getConsistentMachineId)())}async start(){this.intervalId||(await this.initializeMachineId(),setTimeout(()=>{this.syncWithRetry().catch(()=>{})},3e4),this.intervalId=setInterval(()=>{this.syncWithRetry().catch(()=>{})},60*this.intervalMinutes*1e3))}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)}async syncWithRetry(a=1){for(let b=1;b<=a;b++)try{return await this.sync()}catch(d){if(b===a)return null;let c=Math.min(1e3*Math.pow(2,b),1e4);await new Promise(a=>setTimeout(a,c))}}async sync(){if(!await (0,f.isCloudEnabled)())return null;await this.initializeMachineId();let a=await fetch(`${i}/api/sync/cloud`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({machineId:this.machineId,action:"sync"})});if(!a.ok)throw Error((await a.json().catch(()=>({}))).error||"Sync failed");return await a.json()}isRunning(){return null!==this.intervalId}}let k=null;async function l(a=null,b=15){return k||(k=new j(a,b)),k}var m=a.i(323746);async function n(){try{await (0,m.cleanupProviderConnections)();let a=await l(null,15);return await a.start(),a}catch(a){throw console.error("[CloudSync] Error initializing scheduler:",a),a}}a.z.main===module&&n().catch(a=>console.error("[CloudSync] init failed:",a));var o=a.i(522734),p=a.i(814747);let q=["clientId","clientSecret","tokenUrl","authUrl","refreshUrl"],r=0,s=null;var t=a.i(503070);parseInt(process.env.FETCH_TIMEOUT_MS||"120000",10),parseInt(process.env.STREAM_IDLE_TIMEOUT_MS||"120000",10);let u=(0,t.generateLegacyProviders)();!function(a){let b;if(s&&Date.now()-r<6e4)return;let c=(b=process.env.DATA_DIR||(0,p.join)(process.cwd(),"data"),(0,p.join)(b,"provider-credentials.json"));if(!(0,o.existsSync)(c))return s||console.log("[CREDENTIALS] No external credentials file found, using defaults."),s=a,r=Date.now();try{let b=(0,o.readFileSync)(c,"utf-8"),d=JSON.parse(b),e=0;for(let[b,c]of Object.entries(d)){if(!a[b]){console.log(`[CREDENTIALS] Warning: unknown provider "${b}" in credentials file, skipping.`);continue}if(!c||"object"!=typeof c){console.log(`[CREDENTIALS] Warning: provider "${b}" value must be an object, got ${typeof c}. Skipping.`);continue}for(let d of q)void 0!==c[d]&&(a[b][d]=c[d],e++)}let f=null!==s;console.log(`[CREDENTIALS] ${f?"Reloaded":"Loaded"} external credentials: ${e} field(s) from ${c}`)}catch(a){console.log(`[CREDENTIALS] Error reading credentials file: ${a.message}. Using defaults.`)}s=a,r=Date.now()}(u);let v="https://oauth2.googleapis.com/token",w="https://auth.openai.com/oauth/token",x="https://console.anthropic.com/v1/oauth/token",y="https://chat.qwen.ai/api/v1/oauth2/token",z="https://iflow.cn/oauth/token",A="https://github.com/login/oauth/access_token";var B=a.i(666680);let C=new Map;async function D(a,b,c,d){let e=u[a],f=e?.refreshUrl||e?.tokenUrl;if(!e||!f)return d?.warn?.("TOKEN_REFRESH",`No refresh endpoint configured for provider: ${a}`),null;if(!b)return d?.warn?.("TOKEN_REFRESH",`No refresh token available for provider: ${a}`),null;try{let c=new URLSearchParams({grant_type:"refresh_token",refresh_token:b});e.clientId&&c.set("client_id",e.clientId),e.clientSecret&&c.set("client_secret",e.clientSecret);let g=await fetch(f,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:c});if(!g.ok){let b=await g.text();return d?.error?.("TOKEN_REFRESH",`Failed to refresh token for ${a}`,{status:g.status,error:b}),null}let h=await g.json();return d?.info?.("TOKEN_REFRESH",`Successfully refreshed token for ${a}`,{hasNewAccessToken:!!h.access_token,hasNewRefreshToken:!!h.refresh_token,expiresIn:h.expires_in}),{accessToken:h.access_token,refreshToken:h.refresh_token||b,expiresIn:h.expires_in}}catch(b){return d?.error?.("TOKEN_REFRESH",`Error refreshing token for ${a}`,{error:b.message}),null}}async function E(a,b){let c=u.cline?.refreshUrl;if(!c)return b?.warn?.("TOKEN_REFRESH","No refresh URL configured for Cline"),null;try{let d=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:a,grantType:"refresh_token",clientType:"extension"})});if(!d.ok){let a=await d.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Cline token",{status:d.status,error:a}),null}let e=await d.json(),f=e?.data||e,g=f?.expiresAt,h=g?Math.max(1,Math.floor((new Date(g).getTime()-Date.now())/1e3)):void 0;return b?.info?.("TOKEN_REFRESH","Successfully refreshed Cline token",{hasNewAccessToken:!!f?.accessToken,hasNewRefreshToken:!!f?.refreshToken,expiresIn:h}),{accessToken:f?.accessToken,refreshToken:f?.refreshToken||a,expiresIn:h}}catch(a){return b?.error?.("TOKEN_REFRESH",`Network error refreshing Cline token: ${a.message}`),null}}async function F(a,b){let c=u["kimi-coding"]?.refreshUrl||u["kimi-coding"]?.tokenUrl;if(!c)return b?.warn?.("TOKEN_REFRESH","No refresh URL configured for Kimi Coding"),null;let d="kimi-refresh-"+Date.now(),e="u">typeof process?`${process.platform} ${process.arch}`:"unknown";try{let f=new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:u["kimi-coding"]?.clientId||""}),g=await fetch(c,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","X-Msh-Platform":"omniroute","X-Msh-Version":"2.1.2","X-Msh-Device-Model":e,"X-Msh-Device-Id":d},body:f});if(!g.ok){let a=await g.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Kimi Coding token",{status:g.status,error:a}),null}let h=await g.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Kimi Coding token",{hasNewAccessToken:!!h.access_token,hasNewRefreshToken:!!h.refresh_token,expiresIn:h.expires_in}),{accessToken:h.access_token,refreshToken:h.refresh_token||a,expiresIn:h.expires_in,tokenType:h.token_type,scope:h.scope}}catch(a){return b?.error?.("TOKEN_REFRESH",`Network error refreshing Kimi Coding token: ${a.message}`),null}}async function G(a,b){try{let c=await fetch(x,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:a,client_id:u.claude.clientId})});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Claude OAuth token",{status:c.status,error:a}),null}let d=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Claude OAuth token",{hasNewAccessToken:!!d.access_token,hasNewRefreshToken:!!d.refresh_token,expiresIn:d.expires_in}),{accessToken:d.access_token,refreshToken:d.refresh_token||a,expiresIn:d.expires_in}}catch(a){return b?.error?.("TOKEN_REFRESH",`Network error refreshing Claude token: ${a.message}`),null}}async function H(a,b,c,d){let e=await fetch(v,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:b,client_secret:c})});if(!e.ok){let a=await e.text();return d?.error?.("TOKEN_REFRESH","Failed to refresh Google token",{status:e.status,error:a}),null}let f=await e.json();return d?.info?.("TOKEN_REFRESH","Successfully refreshed Google token",{hasNewAccessToken:!!f.access_token,hasNewRefreshToken:!!f.refresh_token,expiresIn:f.expires_in}),{accessToken:f.access_token,refreshToken:f.refresh_token||a,expiresIn:f.expires_in}}async function I(a,b){try{let c=await fetch(y,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:u.qwen.clientId})});if(200===c.status){let d=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Qwen token",{hasNewAccessToken:!!d.access_token,hasNewRefreshToken:!!d.refresh_token,expiresIn:d.expires_in}),{accessToken:d.access_token,refreshToken:d.refresh_token||a,expiresIn:d.expires_in}}{let a=await c.text().catch(()=>""),d=null;try{let b=JSON.parse(a);d=b?.error}catch{}if("invalid_request"===d)return b?.error?.("TOKEN_REFRESH","Qwen refresh token is invalid or expired. Re-authentication required.",{status:c.status}),{error:"invalid_request"};b?.warn?.("TOKEN_REFRESH","Error with Qwen endpoint",{status:c.status,error:a})}}catch(a){b?.warn?.("TOKEN_REFRESH","Network error trying Qwen endpoint",{error:a.message})}return b?.error?.("TOKEN_REFRESH","Failed to refresh Qwen token"),null}async function J(a,b){try{let c=await fetch(w,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:u.codex.clientId,scope:"openid profile email offline_access"})});if(!c.ok){let a=await c.text(),d=null;try{let b=JSON.parse(a);d=b?.error?.code}catch{}if("refresh_token_reused"===d)return b?.error?.("TOKEN_REFRESH","Codex refresh token already used (rotating token consumed). Re-authentication required.",{status:c.status}),{error:"refresh_token_reused"};return b?.error?.("TOKEN_REFRESH","Failed to refresh Codex token",{status:c.status,error:a}),null}let d=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Codex token",{hasNewAccessToken:!!d.access_token,hasNewRefreshToken:!!d.refresh_token,expiresIn:d.expires_in}),{accessToken:d.access_token,refreshToken:d.refresh_token||a,expiresIn:d.expires_in}}catch(a){return b?.error?.("TOKEN_REFRESH",`Network error refreshing Codex token: ${a.message}`),null}}async function K(a,b,c){try{let d=b?.authMethod,e=b?.clientId,f=b?.clientSecret,g=b?.region;if(e&&f){let b="idc"===d&&g?`https://oidc.${g}.amazonaws.com/token`:"https://oidc.us-east-1.amazonaws.com/token",h=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:e,clientSecret:f,refreshToken:a,grantType:"refresh_token"})});if(!h.ok){let a=await h.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro AWS token",{status:h.status,error:a}),null}let i=await h.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro AWS token",{hasNewAccessToken:!!i.accessToken,expiresIn:i.expiresIn}),{accessToken:i.accessToken,refreshToken:i.refreshToken||a,expiresIn:i.expiresIn}}let h=await fetch(u.kiro.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:a})});if(!h.ok){let a=await h.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro social token",{status:h.status,error:a}),null}let i=await h.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro social token",{hasNewAccessToken:!!i.accessToken,expiresIn:i.expiresIn}),{accessToken:i.accessToken,refreshToken:i.refreshToken||a,expiresIn:i.expiresIn}}catch(a){return c?.error?.("TOKEN_REFRESH",`Network error refreshing Kiro token: ${a.message}`),null}}async function L(a,b){let c=btoa(`${u.iflow.clientId}:${u.iflow.clientSecret}`),d=await fetch(z,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${c}`},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:u.iflow.clientId,client_secret:u.iflow.clientSecret})});if(!d.ok){let a=await d.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh iFlow token",{status:d.status,error:a}),null}let e=await d.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed iFlow token",{hasNewAccessToken:!!e.access_token,hasNewRefreshToken:!!e.refresh_token,expiresIn:e.expires_in}),{accessToken:e.access_token,refreshToken:e.refresh_token||a,expiresIn:e.expires_in}}async function M(a,b){let c=await fetch(A,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:u.github.clientId,client_secret:u.github.clientSecret})});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh GitHub token",{status:c.status,error:a}),null}let d=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed GitHub token",{hasNewAccessToken:!!d.access_token,hasNewRefreshToken:!!d.refresh_token,expiresIn:d.expires_in}),{accessToken:d.access_token,refreshToken:d.refresh_token||a,expiresIn:d.expires_in}}async function N(a,b,c){switch(a){case"gemini":case"gemini-cli":case"antigravity":return await H(b.refreshToken,u[a].clientId,u[a].clientSecret,c);case"claude":return await G(b.refreshToken,c);case"codex":return await J(b.refreshToken,c);case"qwen":return await I(b.refreshToken,c);case"iflow":return await L(b.refreshToken,c);case"github":return await M(b.refreshToken,c);case"kiro":return await K(b.refreshToken,b.providerSpecificData,c);case"cline":return await E(b.refreshToken,c);case"kimi-coding":return await F(b.refreshToken,c);default:return D(a,b.refreshToken,b,c)}}async function O(a,b,c){var d;let e;if(!b||!b.refreshToken||"string"!=typeof b.refreshToken)return c?.warn?.("TOKEN_REFRESH",`No valid refresh token available for provider: ${a}`),null;let f=(d=b.refreshToken,e=(0,B.createHash)("sha256").update(d).digest("hex"),`${a}:${e}`);if(C.has(f))return c?.info?.("TOKEN_REFRESH",`Reusing in-flight refresh for ${a}`),C.get(f);let g=N(a,b,c).finally(()=>{C.delete(f)});return C.set(f,g),g}let P="[HealthCheck]",Q=new Set(["1","true","yes","on"]);function R(a){let b=process.env[a];return!!b&&Q.has(b.trim().toLowerCase())}let S=null,T=0,U=null;async function V(){if(R("OMNIROUTE_HIDE_HEALTHCHECK_LOGS"))return!0;let a=Date.now();return null!==S&&a-T<3e4?S:null!==U?U:U=(async()=>{try{let b=await (0,f.getSettings)();return S=!0===b.hideHealthCheckLogs,T=a,S}catch{return!1}finally{U=null}})()}function W(a,...b){V().then(c=>{c||console.log(a,...b)})}function X(a,...b){V().then(c=>{c||console.error(a,...b)})}let Y=!1;async function Z(){try{let a=await (0,m.getProviderConnections)({authType:"oauth"});if(!a||0===a.length)return;for(let b of a)try{await $(b)}catch(a){X(`${P} Error checking ${b.name||b.id}:`,a.message)}}catch(a){X(`${P} Sweep error:`,a.message)}}async function $(a){let b=a.healthCheckInterval??60;if(b<=0||!a.isActive||!a.refreshToken||"string"!=typeof a.refreshToken||"expired"===a.testStatus)return;if(!function(a){if(new Set(["gemini","gemini-cli","antigravity","claude","codex","qwen","iflow","github","kiro","cline","kimi-coding"]).has(a))return!0;let b=u[a];return!!(b?.refreshUrl||b?.tokenUrl)}(a.provider)){let b=new Date().toISOString();await (0,m.updateProviderConnection)(a.id,{lastHealthCheckAt:b}),W(`${P} Skipping ${a.provider}/${a.name||a.email||a.id} (refresh unsupported)`);return}let c=a.lastHealthCheckAt?new Date(a.lastHealthCheckAt).getTime():0;if(Date.now()-c<60*b*1e3)return;W(`${P} Refreshing ${a.provider}/${a.name||a.email||a.id} (interval: ${b}min)`);let d={refreshToken:a.refreshToken,accessToken:a.accessToken,expiresAt:a.tokenExpiresAt,providerSpecificData:a.providerSpecificData},e=await V(),f=await O(a.provider,d,{info:(a,b)=>{e||console.log(`${P} [${a}] ${b}`)},warn:(a,b)=>{e||console.warn(`${P} [${a}] ${b}`)},error:(a,b,c)=>{e||console.error(`${P} [${a}] ${b}`,c||"")}}),g=new Date().toISOString();if(f&&"object"==typeof f&&("refresh_token_reused"===f.error||"invalid_request"===f.error)){await (0,m.updateProviderConnection)(a.id,{lastHealthCheckAt:g,testStatus:"expired",lastError:`Refresh token consumed (${f.error}). Please re-authenticate this account.`,lastErrorAt:g,lastErrorType:f.error,lastErrorSource:"oauth",errorCode:f.error,isActive:!1,refreshToken:null}),X(`${P} ✗ ${a.provider}/${a.name||a.email||a.id} — Refresh token is permanently invalid (${f.error}). Connection deactivated. Re-authenticate to restore.`);return}if(f&&f.accessToken){let b={accessToken:f.accessToken,lastHealthCheckAt:g,testStatus:"active",lastError:null,lastErrorAt:null,lastErrorType:null,lastErrorSource:null,errorCode:null};f.refreshToken&&(b.refreshToken=f.refreshToken),f.expiresIn&&(b.tokenExpiresAt=new Date(Date.now()+1e3*f.expiresIn).toISOString()),await (0,m.updateProviderConnection)(a.id,b),W(`${P} ✓ ${a.provider}/${a.name||a.email||a.id} refreshed`)}else await (0,m.updateProviderConnection)(a.id,{lastHealthCheckAt:g,testStatus:"error",lastError:"Health check: token refresh failed",lastErrorAt:g,lastErrorType:"token_refresh_failed",lastErrorSource:"oauth",errorCode:"refresh_failed"}),function(a,...b){V().then(c=>{c||console.warn(a,...b)})}(`${P} ✗ ${a.provider}/${a.name||a.email||a.id} refresh failed`)}R("OMNIROUTE_DISABLE_TOKEN_HEALTHCHECK")||(Y=!0,W(`${P} Starting proactive token health-check (tick every 60s)`),setTimeout(()=>{Z(),setInterval(Z,6e4)},1e4));let _=!1;(async function(){if(!_)try{await n(),_=!0}catch(a){console.error("[ServerInit] Error initializing cloud sync:",a)}return _})().catch(a=>console.error("[CloudSync] ensure failed:",a)),a.s([],482970)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_lib_initCloudSync_ts_982b9d4d._.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
2
|
-
@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/e22b90cf374c3818.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[339756,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/16ea27c3b926bc31.js\"],\"default\"]\n3:I[837457,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/16ea27c3b926bc31.js\"],\"default\"]\n4:I[897367,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/16ea27c3b926bc31.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[897367,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/16ea27c3b926bc31.js\"],\"ViewportBoundary\"]\n9:I[897367,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/16ea27c3b926bc31.js\"],\"MetadataBoundary\"]\nb:I[168027,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/16ea27c3b926bc31.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"
|
|
1
|
+
<!DOCTYPE html><!--coLESPH6_RrEzzULWq8F5--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/e22b90cf374c3818.js"/><script src="/_next/static/chunks/3dd6d23a48e5d078.js" async=""></script><script src="/_next/static/chunks/726579f2940c2a2f.js" async=""></script><script src="/_next/static/chunks/b133d1854532ff8c.js" async=""></script><script src="/_next/static/chunks/c88fcc5f8b21ff92.js" async=""></script><script src="/_next/static/chunks/turbopack-858efc89e955ca00.js" async=""></script><script src="/_next/static/chunks/d96012bcfc98706a.js" async=""></script><script src="/_next/static/chunks/16ea27c3b926bc31.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: Internal Server Error.</title><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}
|
|
2
|
+
@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/e22b90cf374c3818.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[339756,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/16ea27c3b926bc31.js\"],\"default\"]\n3:I[837457,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/16ea27c3b926bc31.js\"],\"default\"]\n4:I[897367,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/16ea27c3b926bc31.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[897367,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/16ea27c3b926bc31.js\"],\"ViewportBoundary\"]\n9:I[897367,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/16ea27c3b926bc31.js\"],\"MetadataBoundary\"]\nb:I[168027,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/16ea27c3b926bc31.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"coLESPH6_RrEzzULWq8F5\",\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/d96012bcfc98706a.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/16ea27c3b926bc31.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\na:[]\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"
|
|
1
|
+
self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"5rb/o5YRX+cZsnWwE0Hw7zsTLpktmctwAHC7vPcNdzY=\"\n}"
|