omniroute 2.8.4 → 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.
Files changed (108) hide show
  1. package/app/.next/BUILD_ID +1 -1
  2. package/app/.next/build-manifest.json +2 -2
  3. package/app/.next/prerender-manifest.json +3 -3
  4. package/app/.next/server/app/(dashboard)/dashboard/a2a/page_client-reference-manifest.js +1 -1
  5. package/app/.next/server/app/(dashboard)/dashboard/agents/page_client-reference-manifest.js +1 -1
  6. package/app/.next/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
  7. package/app/.next/server/app/(dashboard)/dashboard/api-manager/page_client-reference-manifest.js +1 -1
  8. package/app/.next/server/app/(dashboard)/dashboard/audit-log/page_client-reference-manifest.js +1 -1
  9. package/app/.next/server/app/(dashboard)/dashboard/auto-combo/page_client-reference-manifest.js +1 -1
  10. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  11. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  12. package/app/.next/server/app/(dashboard)/dashboard/costs/page_client-reference-manifest.js +1 -1
  13. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  14. package/app/.next/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
  15. package/app/.next/server/app/(dashboard)/dashboard/limits/page_client-reference-manifest.js +1 -1
  16. package/app/.next/server/app/(dashboard)/dashboard/logs/page_client-reference-manifest.js +1 -1
  17. package/app/.next/server/app/(dashboard)/dashboard/mcp/page_client-reference-manifest.js +1 -1
  18. package/app/.next/server/app/(dashboard)/dashboard/media/page_client-reference-manifest.js +1 -1
  19. package/app/.next/server/app/(dashboard)/dashboard/onboarding/page_client-reference-manifest.js +1 -1
  20. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  21. package/app/.next/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  22. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  23. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  24. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  26. package/app/.next/server/app/(dashboard)/dashboard/search-tools/page_client-reference-manifest.js +1 -1
  27. package/app/.next/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
  28. package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  29. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  30. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  31. package/app/.next/server/app/400/page_client-reference-manifest.js +1 -1
  32. package/app/.next/server/app/401/page_client-reference-manifest.js +1 -1
  33. package/app/.next/server/app/403/page_client-reference-manifest.js +1 -1
  34. package/app/.next/server/app/408/page_client-reference-manifest.js +1 -1
  35. package/app/.next/server/app/429/page_client-reference-manifest.js +1 -1
  36. package/app/.next/server/app/500/page_client-reference-manifest.js +1 -1
  37. package/app/.next/server/app/502/page_client-reference-manifest.js +1 -1
  38. package/app/.next/server/app/503/page_client-reference-manifest.js +1 -1
  39. package/app/.next/server/app/_global-error.html +2 -2
  40. package/app/.next/server/app/_global-error.rsc +1 -1
  41. package/app/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  42. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  43. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  44. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  45. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  46. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  47. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  48. package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  49. package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -1
  50. package/app/.next/server/app/forgot-password/page_client-reference-manifest.js +1 -1
  51. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  52. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  53. package/app/.next/server/app/maintenance/page_client-reference-manifest.js +1 -1
  54. package/app/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  55. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  56. package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
  57. package/app/.next/server/app/status/page_client-reference-manifest.js +1 -1
  58. package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
  59. package/app/.next/server/chunks/[root-of-the-server]__09c944b3._.js +1 -1
  60. package/app/.next/server/chunks/[root-of-the-server]__134baf4c._.js +1 -1
  61. package/app/.next/server/chunks/[root-of-the-server]__179c5303._.js +1 -1
  62. package/app/.next/server/chunks/[root-of-the-server]__237e5042._.js +1 -1
  63. package/app/.next/server/chunks/[root-of-the-server]__46fad57a._.js +1 -1
  64. package/app/.next/server/chunks/[root-of-the-server]__7d9b23e7._.js +1 -1
  65. package/app/.next/server/chunks/[root-of-the-server]__80e3bfc3._.js +2 -2
  66. package/app/.next/server/chunks/[root-of-the-server]__84e445b2._.js +1 -1
  67. package/app/.next/server/chunks/[root-of-the-server]__92cb0def._.js +1 -1
  68. package/app/.next/server/chunks/[root-of-the-server]__9bbd49c8._.js +1 -1
  69. package/app/.next/server/chunks/[root-of-the-server]__add0a68c._.js +1 -1
  70. package/app/.next/server/chunks/[root-of-the-server]__c393c81f._.js +1 -1
  71. package/app/.next/server/chunks/[root-of-the-server]__cd42b732._.js +1 -1
  72. package/app/.next/server/chunks/[root-of-the-server]__d4563e10._.js +1 -1
  73. package/app/.next/server/chunks/[root-of-the-server]__db2f9fe0._.js +1 -1
  74. package/app/.next/server/chunks/[root-of-the-server]__e27a89bd._.js +1 -1
  75. package/app/.next/server/chunks/[root-of-the-server]__e56edf04._.js +1 -1
  76. package/app/.next/server/chunks/[root-of-the-server]__e6e94646._.js +1 -1
  77. package/app/.next/server/chunks/[root-of-the-server]__eb98039a._.js +1 -1
  78. package/app/.next/server/chunks/[root-of-the-server]__f31b4656._.js +1 -1
  79. package/app/.next/server/chunks/_05c48915._.js +1 -1
  80. package/app/.next/server/chunks/_2115d8de._.js +1 -1
  81. package/app/.next/server/chunks/_3ac953eb._.js +1 -1
  82. package/app/.next/server/chunks/_4b8fd853._.js +1 -1
  83. package/app/.next/server/chunks/_68683848._.js +1 -1
  84. package/app/.next/server/chunks/_ee9b677b._.js +1 -1
  85. package/app/.next/server/chunks/open-sse_cf4d5692._.js +1 -1
  86. package/app/.next/server/chunks/open-sse_config_constants_ts_9583de19._.js +1 -1
  87. package/app/.next/server/chunks/open-sse_services_826884e1._.js +2 -1
  88. package/app/.next/server/chunks/ssr/[root-of-the-server]__9affb65e._.js +1 -1
  89. package/app/.next/server/chunks/ssr/[root-of-the-server]__a6942102._.js +1 -1
  90. package/app/.next/server/chunks/ssr/src_9197fb9b._.js +1 -1
  91. package/app/.next/server/chunks/ssr/src_lib_initCloudSync_ts_982b9d4d._.js +1 -1
  92. package/app/.next/server/pages/500.html +2 -2
  93. package/app/.next/server/server-reference-manifest.js +1 -1
  94. package/app/.next/server/server-reference-manifest.json +1 -1
  95. package/app/.next/static/chunks/{1e206030e7793015.js → d9a70775eb233dc3.js} +1 -1
  96. package/app/.next/static/chunks/{0f71d7fbf89bb737.js → ec1938d17386c6db.js} +1 -1
  97. package/app/CHANGELOG.md +24 -0
  98. package/app/docs/openapi.yaml +1 -1
  99. package/app/open-sse/config/constants.ts +3 -3
  100. package/app/open-sse/services/comboAgentMiddleware.ts +9 -1
  101. package/app/package-lock.json +2 -2
  102. package/app/package.json +1 -1
  103. package/app/src/shared/constants/cliTools.ts +2 -2
  104. package/app/tests/e2e/providers-bailian-coding-plan.spec.ts +14 -0
  105. package/package.json +1 -1
  106. /package/app/.next/static/{Ys6bRJXPNt8j-MKOjvZwp → coLESPH6_RrEzzULWq8F5}/_buildManifest.js +0 -0
  107. /package/app/.next/static/{Ys6bRJXPNt8j-MKOjvZwp → coLESPH6_RrEzzULWq8F5}/_clientMiddlewareManifest.json +0 -0
  108. /package/app/.next/static/{Ys6bRJXPNt8j-MKOjvZwp → coLESPH6_RrEzzULWq8F5}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[918622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},677850,a=>a.a(async(b,c)=>{try{let b=await a.y("zod");a.n(b),c()}catch(a){c(a)}},!0),342602,(a,b,c)=>{"use strict";b.exports=a.r(918622)},187924,(a,b,c)=>{"use strict";b.exports=a.r(342602).vendored["react-ssr"].ReactJsxRuntime},572131,(a,b,c)=>{"use strict";b.exports=a.r(342602).vendored["react-ssr"].React},804730,a=>{a.v({name:"omniroute",version:"2.8.4",description:"Smart AI Router with auto fallback — route to FREE & cheap models, zero downtime. Works with Cursor, Cline, Claude Desktop, Codex, and any OpenAI-compatible tool.",type:"module",bin:{omniroute:"bin/omniroute.mjs","omniroute-reset-password":"bin/reset-password.mjs"},files:["bin/","app/","open-sse/mcp-server/","src/shared/contracts/","scripts/postinstall.mjs","scripts/native-binary-compat.mjs","README.md","LICENSE"],workspaces:["open-sse"],engines:{node:">=18.0.0 <24.0.0"},keywords:["ai","router","proxy","openai","claude","anthropic","gemini","fallback","cursor","cline","codex","llm","auto-fallback"],license:"MIT",author:"diegosouzapw",repository:{type:"git",url:"https://github.com/diegosouzapw/OmniRoute"},homepage:"https://omniroute.online",scripts:{dev:"node scripts/run-next.mjs dev",build:"next build","build:cli":"node scripts/prepublish.mjs",start:"node scripts/run-next.mjs start",lint:"eslint .","electron:dev":'concurrently "npm run dev" "wait-on http://localhost:20128 && cd electron && npm run dev"',"electron:build":"npm run build && cd electron && npm run build","electron:build:win":"npm run build && cd electron && npm run build:win","electron:build:mac":"npm run build && cd electron && npm run build:mac","electron:build:linux":"npm run build && cd electron && npm run build:linux",test:"node --import tsx/esm --test tests/unit/*.test.mjs","test:unit":"node --import tsx/esm --test tests/unit/*.test.mjs","test:plan3":"node --import tsx/esm --test tests/unit/plan3-p0.test.mjs","test:fixes":"node --import tsx/esm --test tests/unit/fixes-p1.test.mjs","test:security":"node --import tsx/esm --test tests/unit/security-fase01.test.mjs","check:cycles":"node scripts/check-cycles.mjs","check:route-validation:t06":"node scripts/check-route-validation.mjs","check:any-budget:t11":"node scripts/check-t11-any-budget.mjs","check:docs-sync":"node scripts/check-docs-sync.mjs","typecheck:core":"tsc --pretty false -p tsconfig.typecheck-core.json","typecheck:noimplicit:core":"tsc --pretty false -p tsconfig.typecheck-noimplicit-core.json","test:integration":"node --import tsx/esm --test tests/integration/*.test.mjs","test:e2e":"node scripts/run-playwright-tests.mjs test tests/e2e/*.spec.ts","test:protocols:e2e":"node scripts/run-protocol-clients-tests.mjs","test:vitest":"vitest run open-sse/mcp-server/__tests__/*.test.ts open-sse/services/autoCombo/__tests__/*.test.ts","test:ecosystem":"node scripts/run-ecosystem-tests.mjs","test:coverage":"npx c8 --exclude=open-sse --check-coverage --lines 50 --functions 50 --branches 50 node --import tsx/esm --test tests/unit/*.test.mjs","test:all":"npm run test:unit && npm run test:vitest && npm run test:ecosystem && npm run test:e2e",check:"npm run lint && npm run test",prepublishOnly:"npm run build:cli",postinstall:"node scripts/postinstall.mjs",prepare:"husky","system-info":"node scripts/system-info.mjs"},dependencies:{"@modelcontextprotocol/sdk":"^1.27.1","@monaco-editor/react":"^4.7.0",bcryptjs:"^3.0.3","better-sqlite3":"^12.6.2",bottleneck:"^2.19.5",dompurify:"^3.3.2",express:"^5.2.1","fetch-socks":"^1.3.2","http-proxy-middleware":"^3.0.5","https-proxy-agent":"^8.0.0",jose:"^6.1.3",lowdb:"^7.0.1","monaco-editor":"^0.55.1",next:"^16.1.6","next-intl":"^4.8.3","node-machine-id":"^1.1.12",open:"^11.0.0",ora:"^9.1.0",pino:"^10.3.1","pino-pretty":"^13.1.3",react:"19.2.4","react-dom":"19.2.4",recharts:"^3.7.0",selfsigned:"^5.5.0",tsx:"^4.21.0",undici:"^7.19.2",uuid:"^13.0.0","wreq-js":"^2.0.1",zod:"^4.3.6",zustand:"^5.0.10","@swc/helpers":"0.5.19"},devDependencies:{"@playwright/test":"^1.58.2","@tailwindcss/postcss":"^4.1.18","@types/bcryptjs":"^3.0.0","@types/better-sqlite3":"^7.6.13","@types/node":"^25.2.3","@types/react":"^19.2.14","@types/react-dom":"^19.2.3",concurrently:"^9.2.1","cross-env":"^10.1.0",eslint:"^9.39.2","eslint-config-next":"16.1.6",husky:"^9.1.7","lint-staged":"^16.2.7",prettier:"^3.8.1",tailwindcss:"^4",typescript:"^5.9.3","typescript-eslint":"^8.56.0",vitest:"^4.0.18","wait-on":"^9.0.4"},"lint-staged":{"*.{js,jsx,ts,tsx,mjs}":["prettier --write","eslint --fix --no-error-on-unmatched-pattern"],"*.{json,md,yml,yaml,css}":["prettier --write"]},pnpm:{onlyBuiltDependencies:["@parcel/watcher","@swc/core","better-sqlite3","esbuild","omniroute","sharp"]}})},588788,a=>{"use strict";var b=a.i(32886),c=a.i(187924);function d({locale:a,...d}){if(!a)throw Error(void 0);return(0,c.jsx)(b.IntlProvider,{locale:a,...d})}a.s(["default",()=>d])}];
1
+ module.exports=[918622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},677850,a=>a.a(async(b,c)=>{try{let b=await a.y("zod");a.n(b),c()}catch(a){c(a)}},!0),342602,(a,b,c)=>{"use strict";b.exports=a.r(918622)},187924,(a,b,c)=>{"use strict";b.exports=a.r(342602).vendored["react-ssr"].ReactJsxRuntime},572131,(a,b,c)=>{"use strict";b.exports=a.r(342602).vendored["react-ssr"].React},804730,a=>{a.v({name:"omniroute",version:"2.8.5",description:"Smart AI Router with auto fallback — route to FREE & cheap models, zero downtime. Works with Cursor, Cline, Claude Desktop, Codex, and any OpenAI-compatible tool.",type:"module",bin:{omniroute:"bin/omniroute.mjs","omniroute-reset-password":"bin/reset-password.mjs"},files:["bin/","app/","open-sse/mcp-server/","src/shared/contracts/","scripts/postinstall.mjs","scripts/native-binary-compat.mjs","README.md","LICENSE"],workspaces:["open-sse"],engines:{node:">=18.0.0 <24.0.0"},keywords:["ai","router","proxy","openai","claude","anthropic","gemini","fallback","cursor","cline","codex","llm","auto-fallback"],license:"MIT",author:"diegosouzapw",repository:{type:"git",url:"https://github.com/diegosouzapw/OmniRoute"},homepage:"https://omniroute.online",scripts:{dev:"node scripts/run-next.mjs dev",build:"next build","build:cli":"node scripts/prepublish.mjs",start:"node scripts/run-next.mjs start",lint:"eslint .","electron:dev":'concurrently "npm run dev" "wait-on http://localhost:20128 && cd electron && npm run dev"',"electron:build":"npm run build && cd electron && npm run build","electron:build:win":"npm run build && cd electron && npm run build:win","electron:build:mac":"npm run build && cd electron && npm run build:mac","electron:build:linux":"npm run build && cd electron && npm run build:linux",test:"node --import tsx/esm --test tests/unit/*.test.mjs","test:unit":"node --import tsx/esm --test tests/unit/*.test.mjs","test:plan3":"node --import tsx/esm --test tests/unit/plan3-p0.test.mjs","test:fixes":"node --import tsx/esm --test tests/unit/fixes-p1.test.mjs","test:security":"node --import tsx/esm --test tests/unit/security-fase01.test.mjs","check:cycles":"node scripts/check-cycles.mjs","check:route-validation:t06":"node scripts/check-route-validation.mjs","check:any-budget:t11":"node scripts/check-t11-any-budget.mjs","check:docs-sync":"node scripts/check-docs-sync.mjs","typecheck:core":"tsc --pretty false -p tsconfig.typecheck-core.json","typecheck:noimplicit:core":"tsc --pretty false -p tsconfig.typecheck-noimplicit-core.json","test:integration":"node --import tsx/esm --test tests/integration/*.test.mjs","test:e2e":"node scripts/run-playwright-tests.mjs test tests/e2e/*.spec.ts","test:protocols:e2e":"node scripts/run-protocol-clients-tests.mjs","test:vitest":"vitest run open-sse/mcp-server/__tests__/*.test.ts open-sse/services/autoCombo/__tests__/*.test.ts","test:ecosystem":"node scripts/run-ecosystem-tests.mjs","test:coverage":"npx c8 --exclude=open-sse --check-coverage --lines 50 --functions 50 --branches 50 node --import tsx/esm --test tests/unit/*.test.mjs","test:all":"npm run test:unit && npm run test:vitest && npm run test:ecosystem && npm run test:e2e",check:"npm run lint && npm run test",prepublishOnly:"npm run build:cli",postinstall:"node scripts/postinstall.mjs",prepare:"husky","system-info":"node scripts/system-info.mjs"},dependencies:{"@modelcontextprotocol/sdk":"^1.27.1","@monaco-editor/react":"^4.7.0",bcryptjs:"^3.0.3","better-sqlite3":"^12.6.2",bottleneck:"^2.19.5",dompurify:"^3.3.2",express:"^5.2.1","fetch-socks":"^1.3.2","http-proxy-middleware":"^3.0.5","https-proxy-agent":"^8.0.0",jose:"^6.1.3",lowdb:"^7.0.1","monaco-editor":"^0.55.1",next:"^16.1.6","next-intl":"^4.8.3","node-machine-id":"^1.1.12",open:"^11.0.0",ora:"^9.1.0",pino:"^10.3.1","pino-pretty":"^13.1.3",react:"19.2.4","react-dom":"19.2.4",recharts:"^3.7.0",selfsigned:"^5.5.0",tsx:"^4.21.0",undici:"^7.19.2",uuid:"^13.0.0","wreq-js":"^2.0.1",zod:"^4.3.6",zustand:"^5.0.10","@swc/helpers":"0.5.19"},devDependencies:{"@playwright/test":"^1.58.2","@tailwindcss/postcss":"^4.1.18","@types/bcryptjs":"^3.0.0","@types/better-sqlite3":"^7.6.13","@types/node":"^25.2.3","@types/react":"^19.2.14","@types/react-dom":"^19.2.3",concurrently:"^9.2.1","cross-env":"^10.1.0",eslint:"^9.39.2","eslint-config-next":"16.1.6",husky:"^9.1.7","lint-staged":"^16.2.7",prettier:"^3.8.1",tailwindcss:"^4",typescript:"^5.9.3","typescript-eslint":"^8.56.0",vitest:"^4.0.18","wait-on":"^9.0.4"},"lint-staged":{"*.{js,jsx,ts,tsx,mjs}":["prettier --write","eslint --fix --no-error-on-unmatched-pattern"],"*.{json,md,yml,yaml,css}":["prettier --write"]},pnpm:{onlyBuiltDependencies:["@parcel/watcher","@swc/core","better-sqlite3","esbuild","omniroute","sharp"]}})},588788,a=>{"use strict";var b=a.i(32886),c=a.i(187924);function d({locale:a,...d}){if(!a)throw Error(void 0);return(0,c.jsx)(b.IntlProvider,{locale:a,...d})}a.s(["default",()=>d])}];
2
2
 
3
3
  //# sourceMappingURL=%5Broot-of-the-server%5D__9affb65e._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[193695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},677850,a=>a.a(async(b,c)=>{try{let b=await a.y("zod");a.n(b),c()}catch(a){c(a)}},!0),804730,a=>{a.v({name:"omniroute",version:"2.8.4",description:"Smart AI Router with auto fallback — route to FREE & cheap models, zero downtime. Works with Cursor, Cline, Claude Desktop, Codex, and any OpenAI-compatible tool.",type:"module",bin:{omniroute:"bin/omniroute.mjs","omniroute-reset-password":"bin/reset-password.mjs"},files:["bin/","app/","open-sse/mcp-server/","src/shared/contracts/","scripts/postinstall.mjs","scripts/native-binary-compat.mjs","README.md","LICENSE"],workspaces:["open-sse"],engines:{node:">=18.0.0 <24.0.0"},keywords:["ai","router","proxy","openai","claude","anthropic","gemini","fallback","cursor","cline","codex","llm","auto-fallback"],license:"MIT",author:"diegosouzapw",repository:{type:"git",url:"https://github.com/diegosouzapw/OmniRoute"},homepage:"https://omniroute.online",scripts:{dev:"node scripts/run-next.mjs dev",build:"next build","build:cli":"node scripts/prepublish.mjs",start:"node scripts/run-next.mjs start",lint:"eslint .","electron:dev":'concurrently "npm run dev" "wait-on http://localhost:20128 && cd electron && npm run dev"',"electron:build":"npm run build && cd electron && npm run build","electron:build:win":"npm run build && cd electron && npm run build:win","electron:build:mac":"npm run build && cd electron && npm run build:mac","electron:build:linux":"npm run build && cd electron && npm run build:linux",test:"node --import tsx/esm --test tests/unit/*.test.mjs","test:unit":"node --import tsx/esm --test tests/unit/*.test.mjs","test:plan3":"node --import tsx/esm --test tests/unit/plan3-p0.test.mjs","test:fixes":"node --import tsx/esm --test tests/unit/fixes-p1.test.mjs","test:security":"node --import tsx/esm --test tests/unit/security-fase01.test.mjs","check:cycles":"node scripts/check-cycles.mjs","check:route-validation:t06":"node scripts/check-route-validation.mjs","check:any-budget:t11":"node scripts/check-t11-any-budget.mjs","check:docs-sync":"node scripts/check-docs-sync.mjs","typecheck:core":"tsc --pretty false -p tsconfig.typecheck-core.json","typecheck:noimplicit:core":"tsc --pretty false -p tsconfig.typecheck-noimplicit-core.json","test:integration":"node --import tsx/esm --test tests/integration/*.test.mjs","test:e2e":"node scripts/run-playwright-tests.mjs test tests/e2e/*.spec.ts","test:protocols:e2e":"node scripts/run-protocol-clients-tests.mjs","test:vitest":"vitest run open-sse/mcp-server/__tests__/*.test.ts open-sse/services/autoCombo/__tests__/*.test.ts","test:ecosystem":"node scripts/run-ecosystem-tests.mjs","test:coverage":"npx c8 --exclude=open-sse --check-coverage --lines 50 --functions 50 --branches 50 node --import tsx/esm --test tests/unit/*.test.mjs","test:all":"npm run test:unit && npm run test:vitest && npm run test:ecosystem && npm run test:e2e",check:"npm run lint && npm run test",prepublishOnly:"npm run build:cli",postinstall:"node scripts/postinstall.mjs",prepare:"husky","system-info":"node scripts/system-info.mjs"},dependencies:{"@modelcontextprotocol/sdk":"^1.27.1","@monaco-editor/react":"^4.7.0",bcryptjs:"^3.0.3","better-sqlite3":"^12.6.2",bottleneck:"^2.19.5",dompurify:"^3.3.2",express:"^5.2.1","fetch-socks":"^1.3.2","http-proxy-middleware":"^3.0.5","https-proxy-agent":"^8.0.0",jose:"^6.1.3",lowdb:"^7.0.1","monaco-editor":"^0.55.1",next:"^16.1.6","next-intl":"^4.8.3","node-machine-id":"^1.1.12",open:"^11.0.0",ora:"^9.1.0",pino:"^10.3.1","pino-pretty":"^13.1.3",react:"19.2.4","react-dom":"19.2.4",recharts:"^3.7.0",selfsigned:"^5.5.0",tsx:"^4.21.0",undici:"^7.19.2",uuid:"^13.0.0","wreq-js":"^2.0.1",zod:"^4.3.6",zustand:"^5.0.10","@swc/helpers":"0.5.19"},devDependencies:{"@playwright/test":"^1.58.2","@tailwindcss/postcss":"^4.1.18","@types/bcryptjs":"^3.0.0","@types/better-sqlite3":"^7.6.13","@types/node":"^25.2.3","@types/react":"^19.2.14","@types/react-dom":"^19.2.3",concurrently:"^9.2.1","cross-env":"^10.1.0",eslint:"^9.39.2","eslint-config-next":"16.1.6",husky:"^9.1.7","lint-staged":"^16.2.7",prettier:"^3.8.1",tailwindcss:"^4",typescript:"^5.9.3","typescript-eslint":"^8.56.0",vitest:"^4.0.18","wait-on":"^9.0.4"},"lint-staged":{"*.{js,jsx,ts,tsx,mjs}":["prettier --write","eslint --fix --no-error-on-unmatched-pattern"],"*.{json,md,yml,yaml,css}":["prettier --write"]},pnpm:{onlyBuiltDependencies:["@parcel/watcher","@swc/core","better-sqlite3","esbuild","omniroute","sharp"]}})},569264,a=>{a.n(a.i(354832))},650645,a=>{a.n(a.i(827572))},923576,a=>{a.n(a.i(104858))},825210,a=>{a.n(a.i(402747))},517537,a=>{a.n(a.i(903363))},13718,a=>{a.n(a.i(685523))},118198,a=>{a.n(a.i(545518))},296736,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},500790,(a,b,c)=>{let{createClientModuleProxy:d}=a.r(211857);a.n(d("[project]/node_modules/next/dist/client/app-dir/link.js <module evaluation>"))},784707,(a,b,c)=>{let{createClientModuleProxy:d}=a.r(211857);a.n(d("[project]/node_modules/next/dist/client/app-dir/link.js"))},297647,a=>{"use strict";a.i(500790);var b=a.i(784707);a.n(b)},395936,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={default:function(){return i},useLinkStatus:function(){return h.useLinkStatus}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(296736),g=a.r(907997),h=f._(a.r(297647));function i(a){let b=a.legacyBehavior,c="string"==typeof a.children||"number"==typeof a.children||"string"==typeof a.children?.type,d=a.children?.type?.$$typeof===Symbol.for("react.client.reference");return!b||c||d||(a.children?.type?.$$typeof===Symbol.for("react.lazy")?console.error("Using a Lazy Component as a direct child of `<Link legacyBehavior>` from a Server Component is not supported. If you need legacyBehavior, wrap your Lazy Component in a Client Component that renders the Link's `<a>` tag."):console.error("Using a Server Component as a direct child of `<Link legacyBehavior>` is not supported. If you need legacyBehavior, wrap your Server Component in a Client Component that renders the Link's `<a>` tag.")),(0,g.jsx)(h.default,{...a})}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},330878,a=>{"use strict";var b=a.i(800717),c=a.i(118845),d=a.i(40953),e=(0,b.cache)(function(a,b){return function({_cache:a=(0,c.b)(),_formatters:b=(0,c.c)(a),getMessageFallback:e=d.d,messages:f,namespace:g,onError:h=d.b,...i}){return function({messages:a,namespace:b,...c},e){return a=a["!"],b=(0,d.r)(b,"!"),(0,d.a)({...c,messages:a,namespace:b})}({...i,onError:h,cache:a,formatters:b,getMessageFallback:e,messages:{"!":f},namespace:g?`!.${g}`:"!"},0)}({...a,namespace:b})});a.s(["default",()=>e],330878)},442979,a=>{"use strict";var b=a.i(330878),c=a.i(767228),d=a.i(800717)["use".trim()];function e(...[a]){let f=function(a){var b=(0,c.default)();try{return d(b)}catch(b){throw b instanceof TypeError&&b.message.includes("Cannot read properties of null (reading 'use')")?Error(`\`${a}\` is not callable within an async component. Please refer to https://next-intl.dev/docs/environments/server-client-components#async-components`,{cause:b}):b}}("useTranslations");return(0,b.default)(f,a)}a.s(["useTranslations",()=>e],442979)}];
1
+ module.exports=[193695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},677850,a=>a.a(async(b,c)=>{try{let b=await a.y("zod");a.n(b),c()}catch(a){c(a)}},!0),804730,a=>{a.v({name:"omniroute",version:"2.8.5",description:"Smart AI Router with auto fallback — route to FREE & cheap models, zero downtime. Works with Cursor, Cline, Claude Desktop, Codex, and any OpenAI-compatible tool.",type:"module",bin:{omniroute:"bin/omniroute.mjs","omniroute-reset-password":"bin/reset-password.mjs"},files:["bin/","app/","open-sse/mcp-server/","src/shared/contracts/","scripts/postinstall.mjs","scripts/native-binary-compat.mjs","README.md","LICENSE"],workspaces:["open-sse"],engines:{node:">=18.0.0 <24.0.0"},keywords:["ai","router","proxy","openai","claude","anthropic","gemini","fallback","cursor","cline","codex","llm","auto-fallback"],license:"MIT",author:"diegosouzapw",repository:{type:"git",url:"https://github.com/diegosouzapw/OmniRoute"},homepage:"https://omniroute.online",scripts:{dev:"node scripts/run-next.mjs dev",build:"next build","build:cli":"node scripts/prepublish.mjs",start:"node scripts/run-next.mjs start",lint:"eslint .","electron:dev":'concurrently "npm run dev" "wait-on http://localhost:20128 && cd electron && npm run dev"',"electron:build":"npm run build && cd electron && npm run build","electron:build:win":"npm run build && cd electron && npm run build:win","electron:build:mac":"npm run build && cd electron && npm run build:mac","electron:build:linux":"npm run build && cd electron && npm run build:linux",test:"node --import tsx/esm --test tests/unit/*.test.mjs","test:unit":"node --import tsx/esm --test tests/unit/*.test.mjs","test:plan3":"node --import tsx/esm --test tests/unit/plan3-p0.test.mjs","test:fixes":"node --import tsx/esm --test tests/unit/fixes-p1.test.mjs","test:security":"node --import tsx/esm --test tests/unit/security-fase01.test.mjs","check:cycles":"node scripts/check-cycles.mjs","check:route-validation:t06":"node scripts/check-route-validation.mjs","check:any-budget:t11":"node scripts/check-t11-any-budget.mjs","check:docs-sync":"node scripts/check-docs-sync.mjs","typecheck:core":"tsc --pretty false -p tsconfig.typecheck-core.json","typecheck:noimplicit:core":"tsc --pretty false -p tsconfig.typecheck-noimplicit-core.json","test:integration":"node --import tsx/esm --test tests/integration/*.test.mjs","test:e2e":"node scripts/run-playwright-tests.mjs test tests/e2e/*.spec.ts","test:protocols:e2e":"node scripts/run-protocol-clients-tests.mjs","test:vitest":"vitest run open-sse/mcp-server/__tests__/*.test.ts open-sse/services/autoCombo/__tests__/*.test.ts","test:ecosystem":"node scripts/run-ecosystem-tests.mjs","test:coverage":"npx c8 --exclude=open-sse --check-coverage --lines 50 --functions 50 --branches 50 node --import tsx/esm --test tests/unit/*.test.mjs","test:all":"npm run test:unit && npm run test:vitest && npm run test:ecosystem && npm run test:e2e",check:"npm run lint && npm run test",prepublishOnly:"npm run build:cli",postinstall:"node scripts/postinstall.mjs",prepare:"husky","system-info":"node scripts/system-info.mjs"},dependencies:{"@modelcontextprotocol/sdk":"^1.27.1","@monaco-editor/react":"^4.7.0",bcryptjs:"^3.0.3","better-sqlite3":"^12.6.2",bottleneck:"^2.19.5",dompurify:"^3.3.2",express:"^5.2.1","fetch-socks":"^1.3.2","http-proxy-middleware":"^3.0.5","https-proxy-agent":"^8.0.0",jose:"^6.1.3",lowdb:"^7.0.1","monaco-editor":"^0.55.1",next:"^16.1.6","next-intl":"^4.8.3","node-machine-id":"^1.1.12",open:"^11.0.0",ora:"^9.1.0",pino:"^10.3.1","pino-pretty":"^13.1.3",react:"19.2.4","react-dom":"19.2.4",recharts:"^3.7.0",selfsigned:"^5.5.0",tsx:"^4.21.0",undici:"^7.19.2",uuid:"^13.0.0","wreq-js":"^2.0.1",zod:"^4.3.6",zustand:"^5.0.10","@swc/helpers":"0.5.19"},devDependencies:{"@playwright/test":"^1.58.2","@tailwindcss/postcss":"^4.1.18","@types/bcryptjs":"^3.0.0","@types/better-sqlite3":"^7.6.13","@types/node":"^25.2.3","@types/react":"^19.2.14","@types/react-dom":"^19.2.3",concurrently:"^9.2.1","cross-env":"^10.1.0",eslint:"^9.39.2","eslint-config-next":"16.1.6",husky:"^9.1.7","lint-staged":"^16.2.7",prettier:"^3.8.1",tailwindcss:"^4",typescript:"^5.9.3","typescript-eslint":"^8.56.0",vitest:"^4.0.18","wait-on":"^9.0.4"},"lint-staged":{"*.{js,jsx,ts,tsx,mjs}":["prettier --write","eslint --fix --no-error-on-unmatched-pattern"],"*.{json,md,yml,yaml,css}":["prettier --write"]},pnpm:{onlyBuiltDependencies:["@parcel/watcher","@swc/core","better-sqlite3","esbuild","omniroute","sharp"]}})},569264,a=>{a.n(a.i(354832))},650645,a=>{a.n(a.i(827572))},923576,a=>{a.n(a.i(104858))},825210,a=>{a.n(a.i(402747))},517537,a=>{a.n(a.i(903363))},13718,a=>{a.n(a.i(685523))},118198,a=>{a.n(a.i(545518))},296736,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},500790,(a,b,c)=>{let{createClientModuleProxy:d}=a.r(211857);a.n(d("[project]/node_modules/next/dist/client/app-dir/link.js <module evaluation>"))},784707,(a,b,c)=>{let{createClientModuleProxy:d}=a.r(211857);a.n(d("[project]/node_modules/next/dist/client/app-dir/link.js"))},297647,a=>{"use strict";a.i(500790);var b=a.i(784707);a.n(b)},395936,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={default:function(){return i},useLinkStatus:function(){return h.useLinkStatus}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(296736),g=a.r(907997),h=f._(a.r(297647));function i(a){let b=a.legacyBehavior,c="string"==typeof a.children||"number"==typeof a.children||"string"==typeof a.children?.type,d=a.children?.type?.$$typeof===Symbol.for("react.client.reference");return!b||c||d||(a.children?.type?.$$typeof===Symbol.for("react.lazy")?console.error("Using a Lazy Component as a direct child of `<Link legacyBehavior>` from a Server Component is not supported. If you need legacyBehavior, wrap your Lazy Component in a Client Component that renders the Link's `<a>` tag."):console.error("Using a Server Component as a direct child of `<Link legacyBehavior>` is not supported. If you need legacyBehavior, wrap your Server Component in a Client Component that renders the Link's `<a>` tag.")),(0,g.jsx)(h.default,{...a})}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},330878,a=>{"use strict";var b=a.i(800717),c=a.i(118845),d=a.i(40953),e=(0,b.cache)(function(a,b){return function({_cache:a=(0,c.b)(),_formatters:b=(0,c.c)(a),getMessageFallback:e=d.d,messages:f,namespace:g,onError:h=d.b,...i}){return function({messages:a,namespace:b,...c},e){return a=a["!"],b=(0,d.r)(b,"!"),(0,d.a)({...c,messages:a,namespace:b})}({...i,onError:h,cache:a,formatters:b,getMessageFallback:e,messages:{"!":f},namespace:g?`!.${g}`:"!"},0)}({...a,namespace:b})});a.s(["default",()=>e],330878)},442979,a=>{"use strict";var b=a.i(330878),c=a.i(767228),d=a.i(800717)["use".trim()];function e(...[a]){let f=function(a){var b=(0,c.default)();try{return d(b)}catch(b){throw b instanceof TypeError&&b.message.includes("Cannot read properties of null (reading 'use')")?Error(`\`${a}\` is not callable within an async component. Please refer to https://next-intl.dev/docs/environments/server-client-components#async-components`,{cause:b}):b}}("useTranslations");return(0,b.default)(f,a)}a.s(["useTranslations",()=>e],442979)}];
2
2
 
3
3
  //# sourceMappingURL=%5Broot-of-the-server%5D__a6942102._.js.map
@@ -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,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><!--Ys6bRJXPNt8j_MKOjvZwp--><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,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;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\":\"Ys6bRJXPNt8j-MKOjvZwp\",\"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
+ <!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,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;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\": \"a7VFOG1xbXB+lUFWc9isu0lUg7FNr21e98GYUWJ1OoY=\"\n}"
1
+ self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"5rb/o5YRX+cZsnWwE0Hw7zsTLpktmctwAHC7vPcNdzY=\"\n}"
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "node": {},
3
3
  "edge": {},
4
- "encryptionKey": "a7VFOG1xbXB+lUFWc9isu0lUg7FNr21e98GYUWJ1OoY="
4
+ "encryptionKey": "5rb/o5YRX+cZsnWwE0Hw7zsTLpktmctwAHC7vPcNdzY="
5
5
  }
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,804730,t=>{t.v({name:"omniroute",version:"2.8.4",description:"Smart AI Router with auto fallback — route to FREE & cheap models, zero downtime. Works with Cursor, Cline, Claude Desktop, Codex, and any OpenAI-compatible tool.",type:"module",bin:{omniroute:"bin/omniroute.mjs","omniroute-reset-password":"bin/reset-password.mjs"},files:["bin/","app/","open-sse/mcp-server/","src/shared/contracts/","scripts/postinstall.mjs","scripts/native-binary-compat.mjs","README.md","LICENSE"],workspaces:["open-sse"],engines:{node:">=18.0.0 <24.0.0"},keywords:["ai","router","proxy","openai","claude","anthropic","gemini","fallback","cursor","cline","codex","llm","auto-fallback"],license:"MIT",author:"diegosouzapw",repository:{type:"git",url:"https://github.com/diegosouzapw/OmniRoute"},homepage:"https://omniroute.online",scripts:{dev:"node scripts/run-next.mjs dev",build:"next build","build:cli":"node scripts/prepublish.mjs",start:"node scripts/run-next.mjs start",lint:"eslint .","electron:dev":'concurrently "npm run dev" "wait-on http://localhost:20128 && cd electron && npm run dev"',"electron:build":"npm run build && cd electron && npm run build","electron:build:win":"npm run build && cd electron && npm run build:win","electron:build:mac":"npm run build && cd electron && npm run build:mac","electron:build:linux":"npm run build && cd electron && npm run build:linux",test:"node --import tsx/esm --test tests/unit/*.test.mjs","test:unit":"node --import tsx/esm --test tests/unit/*.test.mjs","test:plan3":"node --import tsx/esm --test tests/unit/plan3-p0.test.mjs","test:fixes":"node --import tsx/esm --test tests/unit/fixes-p1.test.mjs","test:security":"node --import tsx/esm --test tests/unit/security-fase01.test.mjs","check:cycles":"node scripts/check-cycles.mjs","check:route-validation:t06":"node scripts/check-route-validation.mjs","check:any-budget:t11":"node scripts/check-t11-any-budget.mjs","check:docs-sync":"node scripts/check-docs-sync.mjs","typecheck:core":"tsc --pretty false -p tsconfig.typecheck-core.json","typecheck:noimplicit:core":"tsc --pretty false -p tsconfig.typecheck-noimplicit-core.json","test:integration":"node --import tsx/esm --test tests/integration/*.test.mjs","test:e2e":"node scripts/run-playwright-tests.mjs test tests/e2e/*.spec.ts","test:protocols:e2e":"node scripts/run-protocol-clients-tests.mjs","test:vitest":"vitest run open-sse/mcp-server/__tests__/*.test.ts open-sse/services/autoCombo/__tests__/*.test.ts","test:ecosystem":"node scripts/run-ecosystem-tests.mjs","test:coverage":"npx c8 --exclude=open-sse --check-coverage --lines 50 --functions 50 --branches 50 node --import tsx/esm --test tests/unit/*.test.mjs","test:all":"npm run test:unit && npm run test:vitest && npm run test:ecosystem && npm run test:e2e",check:"npm run lint && npm run test",prepublishOnly:"npm run build:cli",postinstall:"node scripts/postinstall.mjs",prepare:"husky","system-info":"node scripts/system-info.mjs"},dependencies:{"@modelcontextprotocol/sdk":"^1.27.1","@monaco-editor/react":"^4.7.0",bcryptjs:"^3.0.3","better-sqlite3":"^12.6.2",bottleneck:"^2.19.5",dompurify:"^3.3.2",express:"^5.2.1","fetch-socks":"^1.3.2","http-proxy-middleware":"^3.0.5","https-proxy-agent":"^8.0.0",jose:"^6.1.3",lowdb:"^7.0.1","monaco-editor":"^0.55.1",next:"^16.1.6","next-intl":"^4.8.3","node-machine-id":"^1.1.12",open:"^11.0.0",ora:"^9.1.0",pino:"^10.3.1","pino-pretty":"^13.1.3",react:"19.2.4","react-dom":"19.2.4",recharts:"^3.7.0",selfsigned:"^5.5.0",tsx:"^4.21.0",undici:"^7.19.2",uuid:"^13.0.0","wreq-js":"^2.0.1",zod:"^4.3.6",zustand:"^5.0.10","@swc/helpers":"0.5.19"},devDependencies:{"@playwright/test":"^1.58.2","@tailwindcss/postcss":"^4.1.18","@types/bcryptjs":"^3.0.0","@types/better-sqlite3":"^7.6.13","@types/node":"^25.2.3","@types/react":"^19.2.14","@types/react-dom":"^19.2.3",concurrently:"^9.2.1","cross-env":"^10.1.0",eslint:"^9.39.2","eslint-config-next":"16.1.6",husky:"^9.1.7","lint-staged":"^16.2.7",prettier:"^3.8.1",tailwindcss:"^4",typescript:"^5.9.3","typescript-eslint":"^8.56.0",vitest:"^4.0.18","wait-on":"^9.0.4"},"lint-staged":{"*.{js,jsx,ts,tsx,mjs}":["prettier --write","eslint --fix --no-error-on-unmatched-pattern"],"*.{json,md,yml,yaml,css}":["prettier --write"]},pnpm:{onlyBuiltDependencies:["@parcel/watcher","@swc/core","better-sqlite3","esbuild","omniroute","sharp"]}})},175696,t=>{"use strict";var e=t.i(861745),s=t.i(843476);function n({locale:t,...n}){if(!t)throw Error(void 0);return(0,s.jsx)(e.IntlProvider,{locale:t,...n})}t.s(["default",()=>n])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,804730,t=>{t.v({name:"omniroute",version:"2.8.5",description:"Smart AI Router with auto fallback — route to FREE & cheap models, zero downtime. Works with Cursor, Cline, Claude Desktop, Codex, and any OpenAI-compatible tool.",type:"module",bin:{omniroute:"bin/omniroute.mjs","omniroute-reset-password":"bin/reset-password.mjs"},files:["bin/","app/","open-sse/mcp-server/","src/shared/contracts/","scripts/postinstall.mjs","scripts/native-binary-compat.mjs","README.md","LICENSE"],workspaces:["open-sse"],engines:{node:">=18.0.0 <24.0.0"},keywords:["ai","router","proxy","openai","claude","anthropic","gemini","fallback","cursor","cline","codex","llm","auto-fallback"],license:"MIT",author:"diegosouzapw",repository:{type:"git",url:"https://github.com/diegosouzapw/OmniRoute"},homepage:"https://omniroute.online",scripts:{dev:"node scripts/run-next.mjs dev",build:"next build","build:cli":"node scripts/prepublish.mjs",start:"node scripts/run-next.mjs start",lint:"eslint .","electron:dev":'concurrently "npm run dev" "wait-on http://localhost:20128 && cd electron && npm run dev"',"electron:build":"npm run build && cd electron && npm run build","electron:build:win":"npm run build && cd electron && npm run build:win","electron:build:mac":"npm run build && cd electron && npm run build:mac","electron:build:linux":"npm run build && cd electron && npm run build:linux",test:"node --import tsx/esm --test tests/unit/*.test.mjs","test:unit":"node --import tsx/esm --test tests/unit/*.test.mjs","test:plan3":"node --import tsx/esm --test tests/unit/plan3-p0.test.mjs","test:fixes":"node --import tsx/esm --test tests/unit/fixes-p1.test.mjs","test:security":"node --import tsx/esm --test tests/unit/security-fase01.test.mjs","check:cycles":"node scripts/check-cycles.mjs","check:route-validation:t06":"node scripts/check-route-validation.mjs","check:any-budget:t11":"node scripts/check-t11-any-budget.mjs","check:docs-sync":"node scripts/check-docs-sync.mjs","typecheck:core":"tsc --pretty false -p tsconfig.typecheck-core.json","typecheck:noimplicit:core":"tsc --pretty false -p tsconfig.typecheck-noimplicit-core.json","test:integration":"node --import tsx/esm --test tests/integration/*.test.mjs","test:e2e":"node scripts/run-playwright-tests.mjs test tests/e2e/*.spec.ts","test:protocols:e2e":"node scripts/run-protocol-clients-tests.mjs","test:vitest":"vitest run open-sse/mcp-server/__tests__/*.test.ts open-sse/services/autoCombo/__tests__/*.test.ts","test:ecosystem":"node scripts/run-ecosystem-tests.mjs","test:coverage":"npx c8 --exclude=open-sse --check-coverage --lines 50 --functions 50 --branches 50 node --import tsx/esm --test tests/unit/*.test.mjs","test:all":"npm run test:unit && npm run test:vitest && npm run test:ecosystem && npm run test:e2e",check:"npm run lint && npm run test",prepublishOnly:"npm run build:cli",postinstall:"node scripts/postinstall.mjs",prepare:"husky","system-info":"node scripts/system-info.mjs"},dependencies:{"@modelcontextprotocol/sdk":"^1.27.1","@monaco-editor/react":"^4.7.0",bcryptjs:"^3.0.3","better-sqlite3":"^12.6.2",bottleneck:"^2.19.5",dompurify:"^3.3.2",express:"^5.2.1","fetch-socks":"^1.3.2","http-proxy-middleware":"^3.0.5","https-proxy-agent":"^8.0.0",jose:"^6.1.3",lowdb:"^7.0.1","monaco-editor":"^0.55.1",next:"^16.1.6","next-intl":"^4.8.3","node-machine-id":"^1.1.12",open:"^11.0.0",ora:"^9.1.0",pino:"^10.3.1","pino-pretty":"^13.1.3",react:"19.2.4","react-dom":"19.2.4",recharts:"^3.7.0",selfsigned:"^5.5.0",tsx:"^4.21.0",undici:"^7.19.2",uuid:"^13.0.0","wreq-js":"^2.0.1",zod:"^4.3.6",zustand:"^5.0.10","@swc/helpers":"0.5.19"},devDependencies:{"@playwright/test":"^1.58.2","@tailwindcss/postcss":"^4.1.18","@types/bcryptjs":"^3.0.0","@types/better-sqlite3":"^7.6.13","@types/node":"^25.2.3","@types/react":"^19.2.14","@types/react-dom":"^19.2.3",concurrently:"^9.2.1","cross-env":"^10.1.0",eslint:"^9.39.2","eslint-config-next":"16.1.6",husky:"^9.1.7","lint-staged":"^16.2.7",prettier:"^3.8.1",tailwindcss:"^4",typescript:"^5.9.3","typescript-eslint":"^8.56.0",vitest:"^4.0.18","wait-on":"^9.0.4"},"lint-staged":{"*.{js,jsx,ts,tsx,mjs}":["prettier --write","eslint --fix --no-error-on-unmatched-pattern"],"*.{json,md,yml,yaml,css}":["prettier --write"]},pnpm:{onlyBuiltDependencies:["@parcel/watcher","@swc/core","better-sqlite3","esbuild","omniroute","sharp"]}})},175696,t=>{"use strict";var e=t.i(861745),s=t.i(843476);function n({locale:t,...n}){if(!t)throw Error(void 0);return(0,s.jsx)(e.IntlProvider,{locale:t,...n})}t.s(["default",()=>n])}]);