omniroute 2.4.1 → 2.4.3

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 (850) hide show
  1. package/README.md +76 -76
  2. package/app/.next/BUILD_ID +1 -1
  3. package/app/.next/app-path-routes-manifest.json +74 -72
  4. package/app/.next/build-manifest.json +2 -2
  5. package/app/.next/routes-manifest.json +14 -0
  6. package/app/.next/server/app/(dashboard)/dashboard/a2a/page.js +1 -1
  7. package/app/.next/server/app/(dashboard)/dashboard/a2a/page.js.nft.json +1 -1
  8. package/app/.next/server/app/(dashboard)/dashboard/a2a/page_client-reference-manifest.js +1 -1
  9. package/app/.next/server/app/(dashboard)/dashboard/agents/page.js +1 -1
  10. package/app/.next/server/app/(dashboard)/dashboard/agents/page.js.nft.json +1 -1
  11. package/app/.next/server/app/(dashboard)/dashboard/agents/page_client-reference-manifest.js +1 -1
  12. package/app/.next/server/app/(dashboard)/dashboard/analytics/page.js +1 -1
  13. package/app/.next/server/app/(dashboard)/dashboard/analytics/page.js.nft.json +1 -1
  14. package/app/.next/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
  15. package/app/.next/server/app/(dashboard)/dashboard/api-manager/page.js +1 -1
  16. package/app/.next/server/app/(dashboard)/dashboard/api-manager/page.js.nft.json +1 -1
  17. package/app/.next/server/app/(dashboard)/dashboard/api-manager/page_client-reference-manifest.js +1 -1
  18. package/app/.next/server/app/(dashboard)/dashboard/audit-log/page.js +1 -1
  19. package/app/.next/server/app/(dashboard)/dashboard/audit-log/page.js.nft.json +1 -1
  20. package/app/.next/server/app/(dashboard)/dashboard/audit-log/page_client-reference-manifest.js +1 -1
  21. package/app/.next/server/app/(dashboard)/dashboard/auto-combo/page.js +1 -1
  22. package/app/.next/server/app/(dashboard)/dashboard/auto-combo/page.js.nft.json +1 -1
  23. package/app/.next/server/app/(dashboard)/dashboard/auto-combo/page_client-reference-manifest.js +1 -1
  24. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  25. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  26. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  27. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  28. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  29. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  30. package/app/.next/server/app/(dashboard)/dashboard/costs/page.js +1 -1
  31. package/app/.next/server/app/(dashboard)/dashboard/costs/page.js.nft.json +1 -1
  32. package/app/.next/server/app/(dashboard)/dashboard/costs/page_client-reference-manifest.js +1 -1
  33. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  34. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  35. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  36. package/app/.next/server/app/(dashboard)/dashboard/health/page.js +1 -1
  37. package/app/.next/server/app/(dashboard)/dashboard/health/page.js.nft.json +1 -1
  38. package/app/.next/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
  39. package/app/.next/server/app/(dashboard)/dashboard/limits/page.js +1 -1
  40. package/app/.next/server/app/(dashboard)/dashboard/limits/page.js.nft.json +1 -1
  41. package/app/.next/server/app/(dashboard)/dashboard/limits/page_client-reference-manifest.js +1 -1
  42. package/app/.next/server/app/(dashboard)/dashboard/logs/page.js +2 -2
  43. package/app/.next/server/app/(dashboard)/dashboard/logs/page.js.nft.json +1 -1
  44. package/app/.next/server/app/(dashboard)/dashboard/logs/page_client-reference-manifest.js +1 -1
  45. package/app/.next/server/app/(dashboard)/dashboard/mcp/page.js +1 -1
  46. package/app/.next/server/app/(dashboard)/dashboard/mcp/page.js.nft.json +1 -1
  47. package/app/.next/server/app/(dashboard)/dashboard/mcp/page_client-reference-manifest.js +1 -1
  48. package/app/.next/server/app/(dashboard)/dashboard/media/page.js +1 -1
  49. package/app/.next/server/app/(dashboard)/dashboard/media/page.js.nft.json +1 -1
  50. package/app/.next/server/app/(dashboard)/dashboard/media/page_client-reference-manifest.js +1 -1
  51. package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js +1 -1
  52. package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js.nft.json +1 -1
  53. package/app/.next/server/app/(dashboard)/dashboard/onboarding/page_client-reference-manifest.js +1 -1
  54. package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
  55. package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  56. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  57. package/app/.next/server/app/(dashboard)/dashboard/playground/page.js +3 -3
  58. package/app/.next/server/app/(dashboard)/dashboard/playground/page.js.nft.json +1 -1
  59. package/app/.next/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  60. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  61. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  62. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  63. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  64. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  65. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  66. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  67. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  68. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  69. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  70. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  71. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  72. package/app/.next/server/app/(dashboard)/dashboard/settings/page.js +1 -1
  73. package/app/.next/server/app/(dashboard)/dashboard/settings/page.js.nft.json +1 -1
  74. package/app/.next/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
  75. package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js +1 -1
  76. package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js.nft.json +1 -1
  77. package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  78. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  79. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  80. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  81. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  82. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  83. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  84. package/app/.next/server/app/.well-known/agent.json/route_client-reference-manifest.js +1 -1
  85. package/app/.next/server/app/400/page.js +1 -1
  86. package/app/.next/server/app/400/page.js.nft.json +1 -1
  87. package/app/.next/server/app/400/page_client-reference-manifest.js +1 -1
  88. package/app/.next/server/app/401/page.js +1 -1
  89. package/app/.next/server/app/401/page.js.nft.json +1 -1
  90. package/app/.next/server/app/401/page_client-reference-manifest.js +1 -1
  91. package/app/.next/server/app/403/page.js +1 -1
  92. package/app/.next/server/app/403/page.js.nft.json +1 -1
  93. package/app/.next/server/app/403/page_client-reference-manifest.js +1 -1
  94. package/app/.next/server/app/408/page.js +1 -1
  95. package/app/.next/server/app/408/page.js.nft.json +1 -1
  96. package/app/.next/server/app/408/page_client-reference-manifest.js +1 -1
  97. package/app/.next/server/app/429/page.js +1 -1
  98. package/app/.next/server/app/429/page.js.nft.json +1 -1
  99. package/app/.next/server/app/429/page_client-reference-manifest.js +1 -1
  100. package/app/.next/server/app/500/page.js +1 -1
  101. package/app/.next/server/app/500/page.js.nft.json +1 -1
  102. package/app/.next/server/app/500/page_client-reference-manifest.js +1 -1
  103. package/app/.next/server/app/502/page.js +1 -1
  104. package/app/.next/server/app/502/page.js.nft.json +1 -1
  105. package/app/.next/server/app/502/page_client-reference-manifest.js +1 -1
  106. package/app/.next/server/app/503/page.js +1 -1
  107. package/app/.next/server/app/503/page.js.nft.json +1 -1
  108. package/app/.next/server/app/503/page_client-reference-manifest.js +1 -1
  109. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  110. package/app/.next/server/app/_global-error.html +2 -2
  111. package/app/.next/server/app/_global-error.rsc +1 -1
  112. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  113. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  114. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  115. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  116. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  117. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  118. package/app/.next/server/app/_not-found/page.js +1 -1
  119. package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
  120. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  121. package/app/.next/server/app/a2a/route_client-reference-manifest.js +1 -1
  122. package/app/.next/server/app/api/a2a/status/route_client-reference-manifest.js +1 -1
  123. package/app/.next/server/app/api/a2a/tasks/[id]/cancel/route_client-reference-manifest.js +1 -1
  124. package/app/.next/server/app/api/a2a/tasks/[id]/route_client-reference-manifest.js +1 -1
  125. package/app/.next/server/app/api/a2a/tasks/route_client-reference-manifest.js +1 -1
  126. package/app/.next/server/app/api/acp/agents/route.js +1 -1
  127. package/app/.next/server/app/api/acp/agents/route.js.nft.json +1 -1
  128. package/app/.next/server/app/api/acp/agents/route_client-reference-manifest.js +1 -1
  129. package/app/.next/server/app/api/auth/login/route.js +1 -1
  130. package/app/.next/server/app/api/auth/login/route.js.nft.json +1 -1
  131. package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  132. package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  133. package/app/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  134. package/app/.next/server/app/api/cache/route_client-reference-manifest.js +1 -1
  135. package/app/.next/server/app/api/cache/stats/route_client-reference-manifest.js +1 -1
  136. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  137. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  138. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
  139. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
  140. package/app/.next/server/app/api/cli-tools/backups/route_client-reference-manifest.js +1 -1
  141. package/app/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
  142. package/app/.next/server/app/api/cli-tools/cline-settings/route_client-reference-manifest.js +1 -1
  143. package/app/.next/server/app/api/cli-tools/codex-profiles/route_client-reference-manifest.js +1 -1
  144. package/app/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
  145. package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
  146. package/app/.next/server/app/api/cli-tools/guide-settings/[toolId]/route_client-reference-manifest.js +1 -1
  147. package/app/.next/server/app/api/cli-tools/kilo-settings/route_client-reference-manifest.js +1 -1
  148. package/app/.next/server/app/api/cli-tools/openclaw/auto-order/route_client-reference-manifest.js +1 -1
  149. package/app/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
  150. package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route_client-reference-manifest.js +1 -1
  151. package/app/.next/server/app/api/cli-tools/status/route_client-reference-manifest.js +1 -1
  152. package/app/.next/server/app/api/cloud/auth/route.js +1 -1
  153. package/app/.next/server/app/api/cloud/auth/route.js.nft.json +1 -1
  154. package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
  155. package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
  156. package/app/.next/server/app/api/cloud/credentials/update/route.js.nft.json +1 -1
  157. package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
  158. package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
  159. package/app/.next/server/app/api/cloud/model/resolve/route.js.nft.json +1 -1
  160. package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
  161. package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
  162. package/app/.next/server/app/api/cloud/models/alias/route.js.nft.json +1 -1
  163. package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
  164. package/app/.next/server/app/api/combos/[id]/route.js +1 -1
  165. package/app/.next/server/app/api/combos/[id]/route.js.nft.json +1 -1
  166. package/app/.next/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
  167. package/app/.next/server/app/api/combos/auto/route_client-reference-manifest.js +1 -1
  168. package/app/.next/server/app/api/combos/metrics/route_client-reference-manifest.js +1 -1
  169. package/app/.next/server/app/api/combos/route.js +1 -1
  170. package/app/.next/server/app/api/combos/route.js.nft.json +1 -1
  171. package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
  172. package/app/.next/server/app/api/combos/test/route.js +1 -1
  173. package/app/.next/server/app/api/combos/test/route.js.nft.json +1 -1
  174. package/app/.next/server/app/api/combos/test/route_client-reference-manifest.js +1 -1
  175. package/app/.next/server/app/api/compliance/audit-log/route_client-reference-manifest.js +1 -1
  176. package/app/.next/server/app/api/db-backups/export/route.js +1 -1
  177. package/app/.next/server/app/api/db-backups/export/route.js.nft.json +1 -1
  178. package/app/.next/server/app/api/db-backups/export/route_client-reference-manifest.js +1 -1
  179. package/app/.next/server/app/api/db-backups/exportAll/route_client-reference-manifest.js +1 -1
  180. package/app/.next/server/app/api/db-backups/import/route.js +1 -1
  181. package/app/.next/server/app/api/db-backups/import/route.js.nft.json +1 -1
  182. package/app/.next/server/app/api/db-backups/import/route_client-reference-manifest.js +1 -1
  183. package/app/.next/server/app/api/db-backups/route.js +1 -1
  184. package/app/.next/server/app/api/db-backups/route.js.nft.json +1 -1
  185. package/app/.next/server/app/api/db-backups/route_client-reference-manifest.js +1 -1
  186. package/app/.next/server/app/api/evals/[suiteId]/route_client-reference-manifest.js +1 -1
  187. package/app/.next/server/app/api/evals/route_client-reference-manifest.js +1 -1
  188. package/app/.next/server/app/api/fallback/chains/route_client-reference-manifest.js +1 -1
  189. package/app/.next/server/app/api/init/route.js +1 -1
  190. package/app/.next/server/app/api/init/route.js.nft.json +1 -1
  191. package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  192. package/app/.next/server/app/api/keys/[id]/route.js +1 -1
  193. package/app/.next/server/app/api/keys/[id]/route.js.nft.json +1 -1
  194. package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
  195. package/app/.next/server/app/api/keys/route.js +1 -1
  196. package/app/.next/server/app/api/keys/route.js.nft.json +1 -1
  197. package/app/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
  198. package/app/.next/server/app/api/logs/console/route_client-reference-manifest.js +1 -1
  199. package/app/.next/server/app/api/mcp/audit/route_client-reference-manifest.js +1 -1
  200. package/app/.next/server/app/api/mcp/audit/stats/route_client-reference-manifest.js +1 -1
  201. package/app/.next/server/app/api/mcp/sse/route.js +1 -1
  202. package/app/.next/server/app/api/mcp/sse/route.js.nft.json +1 -1
  203. package/app/.next/server/app/api/mcp/sse/route_client-reference-manifest.js +1 -1
  204. package/app/.next/server/app/api/mcp/status/route.js +1 -1
  205. package/app/.next/server/app/api/mcp/status/route.js.nft.json +1 -1
  206. package/app/.next/server/app/api/mcp/status/route_client-reference-manifest.js +1 -1
  207. package/app/.next/server/app/api/mcp/stream/route.js +1 -1
  208. package/app/.next/server/app/api/mcp/stream/route.js.nft.json +1 -1
  209. package/app/.next/server/app/api/mcp/stream/route_client-reference-manifest.js +1 -1
  210. package/app/.next/server/app/api/mcp/tools/route_client-reference-manifest.js +1 -1
  211. package/app/.next/server/app/api/models/alias/route.js +1 -1
  212. package/app/.next/server/app/api/models/alias/route.js.nft.json +1 -1
  213. package/app/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
  214. package/app/.next/server/app/api/models/availability/route_client-reference-manifest.js +1 -1
  215. package/app/.next/server/app/api/models/catalog/route.js +2 -2
  216. package/app/.next/server/app/api/models/catalog/route.js.nft.json +1 -1
  217. package/app/.next/server/app/api/models/catalog/route_client-reference-manifest.js +1 -1
  218. package/app/.next/server/app/api/models/openrouter-catalog/route.js +1 -1
  219. package/app/.next/server/app/api/models/openrouter-catalog/route.js.nft.json +1 -1
  220. package/app/.next/server/app/api/models/openrouter-catalog/route_client-reference-manifest.js +1 -1
  221. package/app/.next/server/app/api/models/route.js +1 -1
  222. package/app/.next/server/app/api/models/route.js.nft.json +1 -1
  223. package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
  224. package/app/.next/server/app/api/monitoring/health/route.js +1 -1
  225. package/app/.next/server/app/api/monitoring/health/route.js.nft.json +1 -1
  226. package/app/.next/server/app/api/monitoring/health/route_client-reference-manifest.js +1 -1
  227. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  228. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  229. package/app/.next/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
  230. package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +1 -1
  231. package/app/.next/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  232. package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
  233. package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
  234. package/app/.next/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  235. package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
  236. package/app/.next/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  237. package/app/.next/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  238. package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
  239. package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
  240. package/app/.next/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  241. package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
  242. package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
  243. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  244. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  245. package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
  246. package/app/.next/server/app/api/policies/route_client-reference-manifest.js +1 -1
  247. package/app/.next/server/app/api/pricing/defaults/route_client-reference-manifest.js +1 -1
  248. package/app/.next/server/app/api/pricing/models/route.js +1 -1
  249. package/app/.next/server/app/api/pricing/models/route.js.nft.json +1 -1
  250. package/app/.next/server/app/api/pricing/models/route_client-reference-manifest.js +1 -1
  251. package/app/.next/server/app/api/pricing/route.js +1 -1
  252. package/app/.next/server/app/api/pricing/route.js.nft.json +1 -1
  253. package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
  254. package/app/.next/server/app/api/provider-metrics/route_client-reference-manifest.js +1 -1
  255. package/app/.next/server/app/api/provider-models/route.js +1 -1
  256. package/app/.next/server/app/api/provider-models/route.js.nft.json +1 -1
  257. package/app/.next/server/app/api/provider-models/route_client-reference-manifest.js +1 -1
  258. package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
  259. package/app/.next/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  260. package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
  261. package/app/.next/server/app/api/provider-nodes/route.js +2 -2
  262. package/app/.next/server/app/api/provider-nodes/route.js.nft.json +1 -1
  263. package/app/.next/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
  264. package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
  265. package/app/.next/server/app/api/providers/[id]/models/route.js +2 -2
  266. package/app/.next/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  267. package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
  268. package/app/.next/server/app/api/providers/[id]/refresh/route.js +1 -0
  269. package/app/.next/server/app/api/providers/[id]/refresh/route.js.nft.json +1 -0
  270. package/app/.next/server/app/api/providers/[id]/refresh/route_client-reference-manifest.js +1 -0
  271. package/app/.next/server/app/api/providers/[id]/route.js +1 -1
  272. package/app/.next/server/app/api/providers/[id]/route.js.nft.json +1 -1
  273. package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
  274. package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
  275. package/app/.next/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  276. package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
  277. package/app/.next/server/app/api/providers/client/route.js +1 -1
  278. package/app/.next/server/app/api/providers/client/route.js.nft.json +1 -1
  279. package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
  280. package/app/.next/server/app/api/providers/route.js +1 -1
  281. package/app/.next/server/app/api/providers/route.js.nft.json +1 -1
  282. package/app/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
  283. package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
  284. package/app/.next/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  285. package/app/.next/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
  286. package/app/.next/server/app/api/providers/validate/route.js +1 -1
  287. package/app/.next/server/app/api/providers/validate/route.js.nft.json +1 -1
  288. package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
  289. package/app/.next/server/app/api/rate-limit/route_client-reference-manifest.js +1 -1
  290. package/app/.next/server/app/api/rate-limits/route.js +1 -1
  291. package/app/.next/server/app/api/rate-limits/route.js.nft.json +1 -1
  292. package/app/.next/server/app/api/rate-limits/route_client-reference-manifest.js +1 -1
  293. package/app/.next/server/app/api/resilience/reset/route_client-reference-manifest.js +1 -1
  294. package/app/.next/server/app/api/resilience/route.js +1 -1
  295. package/app/.next/server/app/api/resilience/route.js.nft.json +1 -1
  296. package/app/.next/server/app/api/resilience/route_client-reference-manifest.js +1 -1
  297. package/app/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
  298. package/app/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
  299. package/app/.next/server/app/api/settings/background-degradation/route.js +1 -1
  300. package/app/.next/server/app/api/settings/background-degradation/route.js.nft.json +1 -1
  301. package/app/.next/server/app/api/settings/background-degradation/route_client-reference-manifest.js +1 -1
  302. package/app/.next/server/app/api/settings/combo-defaults/route.js +1 -1
  303. package/app/.next/server/app/api/settings/combo-defaults/route.js.nft.json +1 -1
  304. package/app/.next/server/app/api/settings/combo-defaults/route_client-reference-manifest.js +1 -1
  305. package/app/.next/server/app/api/settings/ip-filter/route_client-reference-manifest.js +1 -1
  306. package/app/.next/server/app/api/settings/model-aliases/route.js +1 -1
  307. package/app/.next/server/app/api/settings/model-aliases/route.js.nft.json +1 -1
  308. package/app/.next/server/app/api/settings/model-aliases/route_client-reference-manifest.js +1 -1
  309. package/app/.next/server/app/api/settings/proxy/route.js +1 -1
  310. package/app/.next/server/app/api/settings/proxy/route.js.nft.json +1 -1
  311. package/app/.next/server/app/api/settings/proxy/route_client-reference-manifest.js +1 -1
  312. package/app/.next/server/app/api/settings/proxy/test/route.js +1 -1
  313. package/app/.next/server/app/api/settings/proxy/test/route_client-reference-manifest.js +1 -1
  314. package/app/.next/server/app/api/settings/require-login/route.js +1 -1
  315. package/app/.next/server/app/api/settings/require-login/route.js.nft.json +1 -1
  316. package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
  317. package/app/.next/server/app/api/settings/route.js +1 -1
  318. package/app/.next/server/app/api/settings/route.js.nft.json +1 -1
  319. package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  320. package/app/.next/server/app/api/settings/system-prompt/route.js +1 -1
  321. package/app/.next/server/app/api/settings/system-prompt/route.js.nft.json +1 -1
  322. package/app/.next/server/app/api/settings/system-prompt/route_client-reference-manifest.js +1 -1
  323. package/app/.next/server/app/api/settings/task-routing/route.js +1 -0
  324. package/app/.next/server/app/api/settings/task-routing/route.js.nft.json +1 -0
  325. package/app/.next/server/app/api/settings/task-routing/route_client-reference-manifest.js +1 -0
  326. package/app/.next/server/app/api/settings/thinking-budget/route.js +1 -1
  327. package/app/.next/server/app/api/settings/thinking-budget/route.js.nft.json +1 -1
  328. package/app/.next/server/app/api/settings/thinking-budget/route_client-reference-manifest.js +1 -1
  329. package/app/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  330. package/app/.next/server/app/api/storage/health/route_client-reference-manifest.js +1 -1
  331. package/app/.next/server/app/api/sync/cloud/route.js +1 -1
  332. package/app/.next/server/app/api/sync/cloud/route.js.nft.json +1 -1
  333. package/app/.next/server/app/api/sync/cloud/route_client-reference-manifest.js +1 -1
  334. package/app/.next/server/app/api/sync/initialize/route.js +1 -1
  335. package/app/.next/server/app/api/sync/initialize/route.js.nft.json +1 -1
  336. package/app/.next/server/app/api/sync/initialize/route_client-reference-manifest.js +1 -1
  337. package/app/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
  338. package/app/.next/server/app/api/telemetry/summary/route_client-reference-manifest.js +1 -1
  339. package/app/.next/server/app/api/token-health/route.js +1 -1
  340. package/app/.next/server/app/api/token-health/route.js.nft.json +1 -1
  341. package/app/.next/server/app/api/token-health/route_client-reference-manifest.js +1 -1
  342. package/app/.next/server/app/api/translator/detect/route_client-reference-manifest.js +1 -1
  343. package/app/.next/server/app/api/translator/history/route_client-reference-manifest.js +1 -1
  344. package/app/.next/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
  345. package/app/.next/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
  346. package/app/.next/server/app/api/translator/send/route.js +1 -1
  347. package/app/.next/server/app/api/translator/send/route.js.nft.json +1 -1
  348. package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
  349. package/app/.next/server/app/api/translator/translate/route.js +1 -1
  350. package/app/.next/server/app/api/translator/translate/route.js.nft.json +1 -1
  351. package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
  352. package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  353. package/app/.next/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  354. package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
  355. package/app/.next/server/app/api/usage/analytics/route.js +1 -1
  356. package/app/.next/server/app/api/usage/analytics/route.js.nft.json +1 -1
  357. package/app/.next/server/app/api/usage/analytics/route_client-reference-manifest.js +1 -1
  358. package/app/.next/server/app/api/usage/budget/route_client-reference-manifest.js +1 -1
  359. package/app/.next/server/app/api/usage/call-logs/[id]/route.js.nft.json +1 -1
  360. package/app/.next/server/app/api/usage/call-logs/[id]/route_client-reference-manifest.js +1 -1
  361. package/app/.next/server/app/api/usage/call-logs/route.js.nft.json +1 -1
  362. package/app/.next/server/app/api/usage/call-logs/route_client-reference-manifest.js +1 -1
  363. package/app/.next/server/app/api/usage/history/route.js.nft.json +1 -1
  364. package/app/.next/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
  365. package/app/.next/server/app/api/usage/logs/route.js.nft.json +1 -1
  366. package/app/.next/server/app/api/usage/logs/route_client-reference-manifest.js +1 -1
  367. package/app/.next/server/app/api/usage/proxy-logs/route.js +1 -1
  368. package/app/.next/server/app/api/usage/proxy-logs/route_client-reference-manifest.js +1 -1
  369. package/app/.next/server/app/api/usage/quota/route.js +1 -1
  370. package/app/.next/server/app/api/usage/quota/route.js.nft.json +1 -1
  371. package/app/.next/server/app/api/usage/quota/route_client-reference-manifest.js +1 -1
  372. package/app/.next/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  373. package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
  374. package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
  375. package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  376. package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
  377. package/app/.next/server/app/api/v1/audio/speech/route.js +1 -1
  378. package/app/.next/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  379. package/app/.next/server/app/api/v1/audio/speech/route_client-reference-manifest.js +1 -1
  380. package/app/.next/server/app/api/v1/audio/transcriptions/route.js +1 -1
  381. package/app/.next/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  382. package/app/.next/server/app/api/v1/audio/transcriptions/route_client-reference-manifest.js +1 -1
  383. package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
  384. package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  385. package/app/.next/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
  386. package/app/.next/server/app/api/v1/completions/route.js +1 -1
  387. package/app/.next/server/app/api/v1/completions/route.js.nft.json +1 -1
  388. package/app/.next/server/app/api/v1/completions/route_client-reference-manifest.js +1 -1
  389. package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
  390. package/app/.next/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  391. package/app/.next/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
  392. package/app/.next/server/app/api/v1/images/generations/route.js +1 -1
  393. package/app/.next/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  394. package/app/.next/server/app/api/v1/images/generations/route_client-reference-manifest.js +1 -1
  395. package/app/.next/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
  396. package/app/.next/server/app/api/v1/messages/route.js +1 -1
  397. package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
  398. package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
  399. package/app/.next/server/app/api/v1/models/route.js +1 -1
  400. package/app/.next/server/app/api/v1/models/route.js.nft.json +1 -1
  401. package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
  402. package/app/.next/server/app/api/v1/moderations/route.js +1 -1
  403. package/app/.next/server/app/api/v1/moderations/route.js.nft.json +1 -1
  404. package/app/.next/server/app/api/v1/moderations/route_client-reference-manifest.js +1 -1
  405. package/app/.next/server/app/api/v1/music/generations/route.js +1 -1
  406. package/app/.next/server/app/api/v1/music/generations/route.js.nft.json +1 -1
  407. package/app/.next/server/app/api/v1/music/generations/route_client-reference-manifest.js +1 -1
  408. package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route.js +1 -1
  409. package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route.js.nft.json +1 -1
  410. package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route_client-reference-manifest.js +1 -1
  411. package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route.js +1 -1
  412. package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route.js.nft.json +1 -1
  413. package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route_client-reference-manifest.js +1 -1
  414. package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route.js +1 -1
  415. package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route.js.nft.json +1 -1
  416. package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route_client-reference-manifest.js +1 -1
  417. package/app/.next/server/app/api/v1/rerank/route.js +1 -1
  418. package/app/.next/server/app/api/v1/rerank/route.js.nft.json +1 -1
  419. package/app/.next/server/app/api/v1/rerank/route_client-reference-manifest.js +1 -1
  420. package/app/.next/server/app/api/v1/responses/route.js +1 -1
  421. package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
  422. package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
  423. package/app/.next/server/app/api/v1/route.js +1 -1
  424. package/app/.next/server/app/api/v1/route.js.nft.json +1 -1
  425. package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
  426. package/app/.next/server/app/api/v1/videos/generations/route.js +1 -1
  427. package/app/.next/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  428. package/app/.next/server/app/api/v1/videos/generations/route_client-reference-manifest.js +1 -1
  429. package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
  430. package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  431. package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
  432. package/app/.next/server/app/api/v1beta/models/route.js +1 -1
  433. package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
  434. package/app/.next/server/app/callback/page.js +1 -1
  435. package/app/.next/server/app/callback/page.js.nft.json +1 -1
  436. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  437. package/app/.next/server/app/docs/page.js +1 -1
  438. package/app/.next/server/app/docs/page.js.nft.json +1 -1
  439. package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  440. package/app/.next/server/app/forbidden/page.js +1 -1
  441. package/app/.next/server/app/forbidden/page.js.nft.json +1 -1
  442. package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -1
  443. package/app/.next/server/app/forgot-password/page.js +1 -1
  444. package/app/.next/server/app/forgot-password/page.js.nft.json +1 -1
  445. package/app/.next/server/app/forgot-password/page_client-reference-manifest.js +1 -1
  446. package/app/.next/server/app/landing/page.js +2 -2
  447. package/app/.next/server/app/landing/page.js.nft.json +1 -1
  448. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  449. package/app/.next/server/app/login/page.js +1 -1
  450. package/app/.next/server/app/login/page.js.nft.json +1 -1
  451. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  452. package/app/.next/server/app/maintenance/page.js +1 -1
  453. package/app/.next/server/app/maintenance/page.js.nft.json +1 -1
  454. package/app/.next/server/app/maintenance/page_client-reference-manifest.js +1 -1
  455. package/app/.next/server/app/offline/page.js +1 -1
  456. package/app/.next/server/app/offline/page.js.nft.json +1 -1
  457. package/app/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  458. package/app/.next/server/app/page.js +1 -1
  459. package/app/.next/server/app/page.js.nft.json +1 -1
  460. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  461. package/app/.next/server/app/privacy/page.js +1 -1
  462. package/app/.next/server/app/privacy/page.js.nft.json +1 -1
  463. package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
  464. package/app/.next/server/app/status/page.js +1 -1
  465. package/app/.next/server/app/status/page.js.nft.json +1 -1
  466. package/app/.next/server/app/status/page_client-reference-manifest.js +1 -1
  467. package/app/.next/server/app/terms/page.js +1 -1
  468. package/app/.next/server/app/terms/page.js.nft.json +1 -1
  469. package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
  470. package/app/.next/server/app-paths-manifest.json +74 -72
  471. package/app/.next/server/chunks/1308.js +1 -1
  472. package/app/.next/server/chunks/1714.js +135 -0
  473. package/app/.next/server/chunks/1909.js +1 -1
  474. package/app/.next/server/chunks/1960.js +1 -1
  475. package/app/.next/server/chunks/2391.js +1 -1
  476. package/app/.next/server/chunks/2476.js +1 -0
  477. package/app/.next/server/chunks/2767.js +3 -3
  478. package/app/.next/server/chunks/3061.js +2 -2
  479. package/app/.next/server/chunks/3596.js +1 -1
  480. package/app/.next/server/chunks/3648.js +5 -5
  481. package/app/.next/server/chunks/406.js +13 -13
  482. package/app/.next/server/chunks/4755.js +1 -1
  483. package/app/.next/server/chunks/5585.js +1 -0
  484. package/app/.next/server/chunks/595.js +1 -1
  485. package/app/.next/server/chunks/5979.js +1 -1
  486. package/app/.next/server/chunks/6094.js +1 -0
  487. package/app/.next/server/chunks/6197.js +46 -0
  488. package/app/.next/server/chunks/6440.js +1 -0
  489. package/app/.next/server/chunks/7109.js +2 -2
  490. package/app/.next/server/chunks/7136.js +1 -0
  491. package/app/.next/server/chunks/7327.js +1 -1
  492. package/app/.next/server/chunks/7544.js +1 -1
  493. package/app/.next/server/chunks/7669.js +1 -1
  494. package/app/.next/server/chunks/8369.js +1 -1
  495. package/app/.next/server/chunks/8907.js +1 -1
  496. package/app/.next/server/chunks/9631.js +1 -1
  497. package/app/.next/server/chunks/9704.js +2 -2
  498. package/app/.next/server/instrumentation.js +1 -1
  499. package/app/.next/server/middleware.js +4 -4
  500. package/app/.next/server/pages/500.html +2 -2
  501. package/app/.next/server/server-reference-manifest.js +1 -1
  502. package/app/.next/server/server-reference-manifest.json +1 -1
  503. package/app/.next/{server/chunks/3922.js → static/chunks/5846-dc138c1880db7dc4.js} +2 -1
  504. package/app/.next/static/chunks/647-bf8bc535ac3648d0.js +21 -0
  505. package/app/.next/static/chunks/app/(dashboard)/dashboard/agents/page-576b27a05c09fba5.js +1 -0
  506. package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-3c3f3b0b558e9302.js +15 -0
  507. package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-81244e4816fac7ea.js +1 -0
  508. package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/{page-08c2aa1b8887ab74.js → page-8b96e2f6d76d6f2d.js} +1 -1
  509. package/app/.next/static/chunks/app/(dashboard)/dashboard/logs/page-2d456b7ddbf3d41e.js +1 -0
  510. package/app/.next/static/chunks/app/(dashboard)/dashboard/media/page-5ed5bdc9e926936c.js +1 -0
  511. package/app/.next/static/chunks/app/(dashboard)/dashboard/page-799001b6cea7d5bc.js +1 -0
  512. package/app/.next/static/chunks/app/(dashboard)/dashboard/playground/page-0fff47edc56250ea.js +2 -0
  513. package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-a4c3bff638878498.js +1 -0
  514. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-01465d13a7217fd4.js +1 -0
  515. package/app/.next/static/chunks/app/.well-known/agent.json/route-a4c3bff638878498.js +1 -0
  516. package/app/.next/static/chunks/app/400/layout-a4c3bff638878498.js +1 -0
  517. package/app/.next/static/chunks/app/401/layout-a4c3bff638878498.js +1 -0
  518. package/app/.next/static/chunks/app/403/layout-a4c3bff638878498.js +1 -0
  519. package/app/.next/static/chunks/app/408/layout-a4c3bff638878498.js +1 -0
  520. package/app/.next/static/chunks/app/429/layout-a4c3bff638878498.js +1 -0
  521. package/app/.next/static/chunks/app/500/layout-a4c3bff638878498.js +1 -0
  522. package/app/.next/static/chunks/app/502/layout-a4c3bff638878498.js +1 -0
  523. package/app/.next/static/chunks/app/503/layout-a4c3bff638878498.js +1 -0
  524. package/app/.next/static/chunks/app/_global-error/page-a4c3bff638878498.js +1 -0
  525. package/app/.next/static/chunks/app/_not-found/page-a4c3bff638878498.js +1 -0
  526. package/app/.next/static/chunks/app/a2a/route-a4c3bff638878498.js +1 -0
  527. package/app/.next/static/chunks/app/api/a2a/status/route-a4c3bff638878498.js +1 -0
  528. package/app/.next/static/chunks/app/api/a2a/tasks/[id]/cancel/route-a4c3bff638878498.js +1 -0
  529. package/app/.next/static/chunks/app/api/a2a/tasks/[id]/route-a4c3bff638878498.js +1 -0
  530. package/app/.next/static/chunks/app/api/a2a/tasks/route-a4c3bff638878498.js +1 -0
  531. package/app/.next/static/chunks/app/api/acp/agents/route-a4c3bff638878498.js +1 -0
  532. package/app/.next/static/chunks/app/api/auth/login/route-a4c3bff638878498.js +1 -0
  533. package/app/.next/static/chunks/app/api/auth/logout/route-a4c3bff638878498.js +1 -0
  534. package/app/.next/static/chunks/app/api/auth/status/route-a4c3bff638878498.js +1 -0
  535. package/app/.next/static/chunks/app/api/cache/route-a4c3bff638878498.js +1 -0
  536. package/app/.next/static/chunks/app/api/cache/stats/route-a4c3bff638878498.js +1 -0
  537. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-a4c3bff638878498.js +1 -0
  538. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-a4c3bff638878498.js +1 -0
  539. package/app/.next/static/chunks/app/api/cli-tools/backups/route-a4c3bff638878498.js +1 -0
  540. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-a4c3bff638878498.js +1 -0
  541. package/app/.next/static/chunks/app/api/cli-tools/cline-settings/route-a4c3bff638878498.js +1 -0
  542. package/app/.next/static/chunks/app/api/cli-tools/codex-profiles/route-a4c3bff638878498.js +1 -0
  543. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-a4c3bff638878498.js +1 -0
  544. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-a4c3bff638878498.js +1 -0
  545. package/app/.next/static/chunks/app/api/cli-tools/guide-settings/[toolId]/route-a4c3bff638878498.js +1 -0
  546. package/app/.next/static/chunks/app/api/cli-tools/kilo-settings/route-a4c3bff638878498.js +1 -0
  547. package/app/.next/static/chunks/app/api/cli-tools/openclaw/auto-order/route-a4c3bff638878498.js +1 -0
  548. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-a4c3bff638878498.js +1 -0
  549. package/app/.next/static/chunks/app/api/cli-tools/runtime/[toolId]/route-a4c3bff638878498.js +1 -0
  550. package/app/.next/static/chunks/app/api/cli-tools/status/route-a4c3bff638878498.js +1 -0
  551. package/app/.next/static/chunks/app/api/cloud/auth/route-a4c3bff638878498.js +1 -0
  552. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-a4c3bff638878498.js +1 -0
  553. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-a4c3bff638878498.js +1 -0
  554. package/app/.next/static/chunks/app/api/cloud/models/alias/route-a4c3bff638878498.js +1 -0
  555. package/app/.next/static/chunks/app/api/combos/[id]/route-a4c3bff638878498.js +1 -0
  556. package/app/.next/static/chunks/app/api/combos/auto/route-a4c3bff638878498.js +1 -0
  557. package/app/.next/static/chunks/app/api/combos/metrics/route-a4c3bff638878498.js +1 -0
  558. package/app/.next/static/chunks/app/api/combos/route-a4c3bff638878498.js +1 -0
  559. package/app/.next/static/chunks/app/api/combos/test/route-a4c3bff638878498.js +1 -0
  560. package/app/.next/static/chunks/app/api/compliance/audit-log/route-a4c3bff638878498.js +1 -0
  561. package/app/.next/static/chunks/app/api/db-backups/export/route-a4c3bff638878498.js +1 -0
  562. package/app/.next/static/chunks/app/api/db-backups/exportAll/route-a4c3bff638878498.js +1 -0
  563. package/app/.next/static/chunks/app/api/db-backups/import/route-a4c3bff638878498.js +1 -0
  564. package/app/.next/static/chunks/app/api/db-backups/route-a4c3bff638878498.js +1 -0
  565. package/app/.next/static/chunks/app/api/evals/[suiteId]/route-a4c3bff638878498.js +1 -0
  566. package/app/.next/static/chunks/app/api/evals/route-a4c3bff638878498.js +1 -0
  567. package/app/.next/static/chunks/app/api/fallback/chains/route-a4c3bff638878498.js +1 -0
  568. package/app/.next/static/chunks/app/api/init/route-a4c3bff638878498.js +1 -0
  569. package/app/.next/static/chunks/app/api/keys/[id]/route-a4c3bff638878498.js +1 -0
  570. package/app/.next/static/chunks/app/api/keys/route-a4c3bff638878498.js +1 -0
  571. package/app/.next/static/chunks/app/api/logs/console/route-a4c3bff638878498.js +1 -0
  572. package/app/.next/static/chunks/app/api/mcp/audit/route-a4c3bff638878498.js +1 -0
  573. package/app/.next/static/chunks/app/api/mcp/audit/stats/route-a4c3bff638878498.js +1 -0
  574. package/app/.next/static/chunks/app/api/mcp/sse/route-a4c3bff638878498.js +1 -0
  575. package/app/.next/static/chunks/app/api/mcp/status/route-a4c3bff638878498.js +1 -0
  576. package/app/.next/static/chunks/app/api/mcp/stream/route-a4c3bff638878498.js +1 -0
  577. package/app/.next/static/chunks/app/api/mcp/tools/route-a4c3bff638878498.js +1 -0
  578. package/app/.next/static/chunks/app/api/models/alias/route-a4c3bff638878498.js +1 -0
  579. package/app/.next/static/chunks/app/api/models/availability/route-a4c3bff638878498.js +1 -0
  580. package/app/.next/static/chunks/app/api/models/catalog/route-a4c3bff638878498.js +1 -0
  581. package/app/.next/static/chunks/app/api/models/openrouter-catalog/route-a4c3bff638878498.js +1 -0
  582. package/app/.next/static/chunks/app/api/models/route-a4c3bff638878498.js +1 -0
  583. package/app/.next/static/chunks/app/api/monitoring/health/route-a4c3bff638878498.js +1 -0
  584. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-a4c3bff638878498.js +1 -0
  585. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-a4c3bff638878498.js +1 -0
  586. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-a4c3bff638878498.js +1 -0
  587. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-a4c3bff638878498.js +1 -0
  588. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-a4c3bff638878498.js +1 -0
  589. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-a4c3bff638878498.js +1 -0
  590. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-a4c3bff638878498.js +1 -0
  591. package/app/.next/static/chunks/app/api/policies/route-a4c3bff638878498.js +1 -0
  592. package/app/.next/static/chunks/app/api/pricing/defaults/route-a4c3bff638878498.js +1 -0
  593. package/app/.next/static/chunks/app/api/pricing/models/route-a4c3bff638878498.js +1 -0
  594. package/app/.next/static/chunks/app/api/pricing/route-a4c3bff638878498.js +1 -0
  595. package/app/.next/static/chunks/app/api/provider-metrics/route-a4c3bff638878498.js +1 -0
  596. package/app/.next/static/chunks/app/api/provider-models/route-a4c3bff638878498.js +1 -0
  597. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-a4c3bff638878498.js +1 -0
  598. package/app/.next/static/chunks/app/api/provider-nodes/route-a4c3bff638878498.js +1 -0
  599. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-a4c3bff638878498.js +1 -0
  600. package/app/.next/static/chunks/app/api/providers/[id]/models/route-a4c3bff638878498.js +1 -0
  601. package/app/.next/static/chunks/app/api/providers/[id]/refresh/route-a4c3bff638878498.js +1 -0
  602. package/app/.next/static/chunks/app/api/providers/[id]/route-a4c3bff638878498.js +1 -0
  603. package/app/.next/static/chunks/app/api/providers/[id]/test/route-a4c3bff638878498.js +1 -0
  604. package/app/.next/static/chunks/app/api/providers/client/route-a4c3bff638878498.js +1 -0
  605. package/app/.next/static/chunks/app/api/providers/route-a4c3bff638878498.js +1 -0
  606. package/app/.next/static/chunks/app/api/providers/test-batch/route-a4c3bff638878498.js +1 -0
  607. package/app/.next/static/chunks/app/api/providers/validate/route-a4c3bff638878498.js +1 -0
  608. package/app/.next/static/chunks/app/api/rate-limit/route-a4c3bff638878498.js +1 -0
  609. package/app/.next/static/chunks/app/api/rate-limits/route-a4c3bff638878498.js +1 -0
  610. package/app/.next/static/chunks/app/api/resilience/reset/route-a4c3bff638878498.js +1 -0
  611. package/app/.next/static/chunks/app/api/resilience/route-a4c3bff638878498.js +1 -0
  612. package/app/.next/static/chunks/app/api/restart/route-a4c3bff638878498.js +1 -0
  613. package/app/.next/static/chunks/app/api/sessions/route-a4c3bff638878498.js +1 -0
  614. package/app/.next/static/chunks/app/api/settings/background-degradation/route-a4c3bff638878498.js +1 -0
  615. package/app/.next/static/chunks/app/api/settings/combo-defaults/route-a4c3bff638878498.js +1 -0
  616. package/app/.next/static/chunks/app/api/settings/ip-filter/route-a4c3bff638878498.js +1 -0
  617. package/app/.next/static/chunks/app/api/settings/model-aliases/route-a4c3bff638878498.js +1 -0
  618. package/app/.next/static/chunks/app/api/settings/proxy/route-a4c3bff638878498.js +1 -0
  619. package/app/.next/static/chunks/app/api/settings/proxy/test/route-a4c3bff638878498.js +1 -0
  620. package/app/.next/static/chunks/app/api/settings/require-login/route-a4c3bff638878498.js +1 -0
  621. package/app/.next/static/chunks/app/api/settings/route-a4c3bff638878498.js +1 -0
  622. package/app/.next/static/chunks/app/api/settings/system-prompt/route-a4c3bff638878498.js +1 -0
  623. package/app/.next/static/chunks/app/api/settings/task-routing/route-a4c3bff638878498.js +1 -0
  624. package/app/.next/static/chunks/app/api/settings/thinking-budget/route-a4c3bff638878498.js +1 -0
  625. package/app/.next/static/chunks/app/api/shutdown/route-a4c3bff638878498.js +1 -0
  626. package/app/.next/static/chunks/app/api/storage/health/route-a4c3bff638878498.js +1 -0
  627. package/app/.next/static/chunks/app/api/sync/cloud/route-a4c3bff638878498.js +1 -0
  628. package/app/.next/static/chunks/app/api/sync/initialize/route-a4c3bff638878498.js +1 -0
  629. package/app/.next/static/chunks/app/api/tags/route-a4c3bff638878498.js +1 -0
  630. package/app/.next/static/chunks/app/api/telemetry/summary/route-a4c3bff638878498.js +1 -0
  631. package/app/.next/static/chunks/app/api/token-health/route-a4c3bff638878498.js +1 -0
  632. package/app/.next/static/chunks/app/api/translator/detect/route-a4c3bff638878498.js +1 -0
  633. package/app/.next/static/chunks/app/api/translator/history/route-a4c3bff638878498.js +1 -0
  634. package/app/.next/static/chunks/app/api/translator/load/route-a4c3bff638878498.js +1 -0
  635. package/app/.next/static/chunks/app/api/translator/save/route-a4c3bff638878498.js +1 -0
  636. package/app/.next/static/chunks/app/api/translator/send/route-a4c3bff638878498.js +1 -0
  637. package/app/.next/static/chunks/app/api/translator/translate/route-a4c3bff638878498.js +1 -0
  638. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-a4c3bff638878498.js +1 -0
  639. package/app/.next/static/chunks/app/api/usage/analytics/route-a4c3bff638878498.js +1 -0
  640. package/app/.next/static/chunks/app/api/usage/budget/route-a4c3bff638878498.js +1 -0
  641. package/app/.next/static/chunks/app/api/usage/call-logs/[id]/route-a4c3bff638878498.js +1 -0
  642. package/app/.next/static/chunks/app/api/usage/call-logs/route-a4c3bff638878498.js +1 -0
  643. package/app/.next/static/chunks/app/api/usage/history/route-a4c3bff638878498.js +1 -0
  644. package/app/.next/static/chunks/app/api/usage/logs/route-a4c3bff638878498.js +1 -0
  645. package/app/.next/static/chunks/app/api/usage/proxy-logs/route-a4c3bff638878498.js +1 -0
  646. package/app/.next/static/chunks/app/api/usage/quota/route-a4c3bff638878498.js +1 -0
  647. package/app/.next/static/chunks/app/api/usage/request-logs/route-a4c3bff638878498.js +1 -0
  648. package/app/.next/static/chunks/app/api/v1/api/chat/route-a4c3bff638878498.js +1 -0
  649. package/app/.next/static/chunks/app/api/v1/audio/speech/route-a4c3bff638878498.js +1 -0
  650. package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-a4c3bff638878498.js +1 -0
  651. package/app/.next/static/chunks/app/api/v1/chat/completions/route-a4c3bff638878498.js +1 -0
  652. package/app/.next/static/chunks/app/api/v1/completions/route-a4c3bff638878498.js +1 -0
  653. package/app/.next/static/chunks/app/api/v1/embeddings/route-a4c3bff638878498.js +1 -0
  654. package/app/.next/static/chunks/app/api/v1/images/generations/route-a4c3bff638878498.js +1 -0
  655. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-a4c3bff638878498.js +1 -0
  656. package/app/.next/static/chunks/app/api/v1/messages/route-a4c3bff638878498.js +1 -0
  657. package/app/.next/static/chunks/app/api/v1/models/route-a4c3bff638878498.js +1 -0
  658. package/app/.next/static/chunks/app/api/v1/moderations/route-a4c3bff638878498.js +1 -0
  659. package/app/.next/static/chunks/app/api/v1/music/generations/route-a4c3bff638878498.js +1 -0
  660. package/app/.next/static/chunks/app/api/v1/providers/[provider]/chat/completions/route-a4c3bff638878498.js +1 -0
  661. package/app/.next/static/chunks/app/api/v1/providers/[provider]/embeddings/route-a4c3bff638878498.js +1 -0
  662. package/app/.next/static/chunks/app/api/v1/providers/[provider]/images/generations/route-a4c3bff638878498.js +1 -0
  663. package/app/.next/static/chunks/app/api/v1/rerank/route-a4c3bff638878498.js +1 -0
  664. package/app/.next/static/chunks/app/api/v1/responses/route-a4c3bff638878498.js +1 -0
  665. package/app/.next/static/chunks/app/api/v1/route-a4c3bff638878498.js +1 -0
  666. package/app/.next/static/chunks/app/api/v1/videos/generations/route-a4c3bff638878498.js +1 -0
  667. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-a4c3bff638878498.js +1 -0
  668. package/app/.next/static/chunks/app/api/v1beta/models/route-a4c3bff638878498.js +1 -0
  669. package/app/.next/static/chunks/app/landing/{page-75b0c988db383cfc.js → page-8f652c1fbc33efd2.js} +1 -1
  670. package/app/.next/static/chunks/app/page-a4c3bff638878498.js +1 -0
  671. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-a4c3bff638878498.js +1 -0
  672. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-a4c3bff638878498.js +1 -0
  673. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-a4c3bff638878498.js +1 -0
  674. package/app/.next/static/css/0a5545f707228079.css +1 -0
  675. package/app/.next/static/vyty8kP9IuZktMt159X9L/_buildManifest.js +1 -0
  676. package/app/package.json +1 -1
  677. package/package.json +1 -1
  678. package/app/.next/server/chunks/2901.js +0 -46
  679. package/app/.next/server/chunks/786.js +0 -135
  680. package/app/.next/server/chunks/9679.js +0 -1
  681. package/app/.next/static/chunks/5846-995a9fadc90d26d3.js +0 -2
  682. package/app/.next/static/chunks/647-27f02a9e225826d5.js +0 -21
  683. package/app/.next/static/chunks/app/(dashboard)/dashboard/agents/page-4ec5a1458c077143.js +0 -1
  684. package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-ad968920ad7029fd.js +0 -15
  685. package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-c92198822ec0da04.js +0 -1
  686. package/app/.next/static/chunks/app/(dashboard)/dashboard/logs/page-95e4b5e0bf023d76.js +0 -1
  687. package/app/.next/static/chunks/app/(dashboard)/dashboard/media/page-07cbc45d62a20735.js +0 -1
  688. package/app/.next/static/chunks/app/(dashboard)/dashboard/page-23797ed1fe047ef7.js +0 -1
  689. package/app/.next/static/chunks/app/(dashboard)/dashboard/playground/page-4c93d045288f7d9e.js +0 -2
  690. package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-4fd91743f3ac831d.js +0 -1
  691. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-e3a0a2f5334efeed.js +0 -1
  692. package/app/.next/static/chunks/app/.well-known/agent.json/route-4fd91743f3ac831d.js +0 -1
  693. package/app/.next/static/chunks/app/400/layout-4fd91743f3ac831d.js +0 -1
  694. package/app/.next/static/chunks/app/401/layout-4fd91743f3ac831d.js +0 -1
  695. package/app/.next/static/chunks/app/403/layout-4fd91743f3ac831d.js +0 -1
  696. package/app/.next/static/chunks/app/408/layout-4fd91743f3ac831d.js +0 -1
  697. package/app/.next/static/chunks/app/429/layout-4fd91743f3ac831d.js +0 -1
  698. package/app/.next/static/chunks/app/500/layout-4fd91743f3ac831d.js +0 -1
  699. package/app/.next/static/chunks/app/502/layout-4fd91743f3ac831d.js +0 -1
  700. package/app/.next/static/chunks/app/503/layout-4fd91743f3ac831d.js +0 -1
  701. package/app/.next/static/chunks/app/_global-error/page-4fd91743f3ac831d.js +0 -1
  702. package/app/.next/static/chunks/app/_not-found/page-4fd91743f3ac831d.js +0 -1
  703. package/app/.next/static/chunks/app/a2a/route-4fd91743f3ac831d.js +0 -1
  704. package/app/.next/static/chunks/app/api/a2a/status/route-4fd91743f3ac831d.js +0 -1
  705. package/app/.next/static/chunks/app/api/a2a/tasks/[id]/cancel/route-4fd91743f3ac831d.js +0 -1
  706. package/app/.next/static/chunks/app/api/a2a/tasks/[id]/route-4fd91743f3ac831d.js +0 -1
  707. package/app/.next/static/chunks/app/api/a2a/tasks/route-4fd91743f3ac831d.js +0 -1
  708. package/app/.next/static/chunks/app/api/acp/agents/route-4fd91743f3ac831d.js +0 -1
  709. package/app/.next/static/chunks/app/api/auth/login/route-4fd91743f3ac831d.js +0 -1
  710. package/app/.next/static/chunks/app/api/auth/logout/route-4fd91743f3ac831d.js +0 -1
  711. package/app/.next/static/chunks/app/api/auth/status/route-4fd91743f3ac831d.js +0 -1
  712. package/app/.next/static/chunks/app/api/cache/route-4fd91743f3ac831d.js +0 -1
  713. package/app/.next/static/chunks/app/api/cache/stats/route-4fd91743f3ac831d.js +0 -1
  714. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-4fd91743f3ac831d.js +0 -1
  715. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-4fd91743f3ac831d.js +0 -1
  716. package/app/.next/static/chunks/app/api/cli-tools/backups/route-4fd91743f3ac831d.js +0 -1
  717. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-4fd91743f3ac831d.js +0 -1
  718. package/app/.next/static/chunks/app/api/cli-tools/cline-settings/route-4fd91743f3ac831d.js +0 -1
  719. package/app/.next/static/chunks/app/api/cli-tools/codex-profiles/route-4fd91743f3ac831d.js +0 -1
  720. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-4fd91743f3ac831d.js +0 -1
  721. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-4fd91743f3ac831d.js +0 -1
  722. package/app/.next/static/chunks/app/api/cli-tools/guide-settings/[toolId]/route-4fd91743f3ac831d.js +0 -1
  723. package/app/.next/static/chunks/app/api/cli-tools/kilo-settings/route-4fd91743f3ac831d.js +0 -1
  724. package/app/.next/static/chunks/app/api/cli-tools/openclaw/auto-order/route-4fd91743f3ac831d.js +0 -1
  725. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-4fd91743f3ac831d.js +0 -1
  726. package/app/.next/static/chunks/app/api/cli-tools/runtime/[toolId]/route-4fd91743f3ac831d.js +0 -1
  727. package/app/.next/static/chunks/app/api/cli-tools/status/route-4fd91743f3ac831d.js +0 -1
  728. package/app/.next/static/chunks/app/api/cloud/auth/route-4fd91743f3ac831d.js +0 -1
  729. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-4fd91743f3ac831d.js +0 -1
  730. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-4fd91743f3ac831d.js +0 -1
  731. package/app/.next/static/chunks/app/api/cloud/models/alias/route-4fd91743f3ac831d.js +0 -1
  732. package/app/.next/static/chunks/app/api/combos/[id]/route-4fd91743f3ac831d.js +0 -1
  733. package/app/.next/static/chunks/app/api/combos/auto/route-4fd91743f3ac831d.js +0 -1
  734. package/app/.next/static/chunks/app/api/combos/metrics/route-4fd91743f3ac831d.js +0 -1
  735. package/app/.next/static/chunks/app/api/combos/route-4fd91743f3ac831d.js +0 -1
  736. package/app/.next/static/chunks/app/api/combos/test/route-4fd91743f3ac831d.js +0 -1
  737. package/app/.next/static/chunks/app/api/compliance/audit-log/route-4fd91743f3ac831d.js +0 -1
  738. package/app/.next/static/chunks/app/api/db-backups/export/route-4fd91743f3ac831d.js +0 -1
  739. package/app/.next/static/chunks/app/api/db-backups/exportAll/route-4fd91743f3ac831d.js +0 -1
  740. package/app/.next/static/chunks/app/api/db-backups/import/route-4fd91743f3ac831d.js +0 -1
  741. package/app/.next/static/chunks/app/api/db-backups/route-4fd91743f3ac831d.js +0 -1
  742. package/app/.next/static/chunks/app/api/evals/[suiteId]/route-4fd91743f3ac831d.js +0 -1
  743. package/app/.next/static/chunks/app/api/evals/route-4fd91743f3ac831d.js +0 -1
  744. package/app/.next/static/chunks/app/api/fallback/chains/route-4fd91743f3ac831d.js +0 -1
  745. package/app/.next/static/chunks/app/api/init/route-4fd91743f3ac831d.js +0 -1
  746. package/app/.next/static/chunks/app/api/keys/[id]/route-4fd91743f3ac831d.js +0 -1
  747. package/app/.next/static/chunks/app/api/keys/route-4fd91743f3ac831d.js +0 -1
  748. package/app/.next/static/chunks/app/api/logs/console/route-4fd91743f3ac831d.js +0 -1
  749. package/app/.next/static/chunks/app/api/mcp/audit/route-4fd91743f3ac831d.js +0 -1
  750. package/app/.next/static/chunks/app/api/mcp/audit/stats/route-4fd91743f3ac831d.js +0 -1
  751. package/app/.next/static/chunks/app/api/mcp/sse/route-4fd91743f3ac831d.js +0 -1
  752. package/app/.next/static/chunks/app/api/mcp/status/route-4fd91743f3ac831d.js +0 -1
  753. package/app/.next/static/chunks/app/api/mcp/stream/route-4fd91743f3ac831d.js +0 -1
  754. package/app/.next/static/chunks/app/api/mcp/tools/route-4fd91743f3ac831d.js +0 -1
  755. package/app/.next/static/chunks/app/api/models/alias/route-4fd91743f3ac831d.js +0 -1
  756. package/app/.next/static/chunks/app/api/models/availability/route-4fd91743f3ac831d.js +0 -1
  757. package/app/.next/static/chunks/app/api/models/catalog/route-4fd91743f3ac831d.js +0 -1
  758. package/app/.next/static/chunks/app/api/models/openrouter-catalog/route-4fd91743f3ac831d.js +0 -1
  759. package/app/.next/static/chunks/app/api/models/route-4fd91743f3ac831d.js +0 -1
  760. package/app/.next/static/chunks/app/api/monitoring/health/route-4fd91743f3ac831d.js +0 -1
  761. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-4fd91743f3ac831d.js +0 -1
  762. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-4fd91743f3ac831d.js +0 -1
  763. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-4fd91743f3ac831d.js +0 -1
  764. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-4fd91743f3ac831d.js +0 -1
  765. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-4fd91743f3ac831d.js +0 -1
  766. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-4fd91743f3ac831d.js +0 -1
  767. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-4fd91743f3ac831d.js +0 -1
  768. package/app/.next/static/chunks/app/api/policies/route-4fd91743f3ac831d.js +0 -1
  769. package/app/.next/static/chunks/app/api/pricing/defaults/route-4fd91743f3ac831d.js +0 -1
  770. package/app/.next/static/chunks/app/api/pricing/models/route-4fd91743f3ac831d.js +0 -1
  771. package/app/.next/static/chunks/app/api/pricing/route-4fd91743f3ac831d.js +0 -1
  772. package/app/.next/static/chunks/app/api/provider-metrics/route-4fd91743f3ac831d.js +0 -1
  773. package/app/.next/static/chunks/app/api/provider-models/route-4fd91743f3ac831d.js +0 -1
  774. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-4fd91743f3ac831d.js +0 -1
  775. package/app/.next/static/chunks/app/api/provider-nodes/route-4fd91743f3ac831d.js +0 -1
  776. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-4fd91743f3ac831d.js +0 -1
  777. package/app/.next/static/chunks/app/api/providers/[id]/models/route-4fd91743f3ac831d.js +0 -1
  778. package/app/.next/static/chunks/app/api/providers/[id]/route-4fd91743f3ac831d.js +0 -1
  779. package/app/.next/static/chunks/app/api/providers/[id]/test/route-4fd91743f3ac831d.js +0 -1
  780. package/app/.next/static/chunks/app/api/providers/client/route-4fd91743f3ac831d.js +0 -1
  781. package/app/.next/static/chunks/app/api/providers/route-4fd91743f3ac831d.js +0 -1
  782. package/app/.next/static/chunks/app/api/providers/test-batch/route-4fd91743f3ac831d.js +0 -1
  783. package/app/.next/static/chunks/app/api/providers/validate/route-4fd91743f3ac831d.js +0 -1
  784. package/app/.next/static/chunks/app/api/rate-limit/route-4fd91743f3ac831d.js +0 -1
  785. package/app/.next/static/chunks/app/api/rate-limits/route-4fd91743f3ac831d.js +0 -1
  786. package/app/.next/static/chunks/app/api/resilience/reset/route-4fd91743f3ac831d.js +0 -1
  787. package/app/.next/static/chunks/app/api/resilience/route-4fd91743f3ac831d.js +0 -1
  788. package/app/.next/static/chunks/app/api/restart/route-4fd91743f3ac831d.js +0 -1
  789. package/app/.next/static/chunks/app/api/sessions/route-4fd91743f3ac831d.js +0 -1
  790. package/app/.next/static/chunks/app/api/settings/background-degradation/route-4fd91743f3ac831d.js +0 -1
  791. package/app/.next/static/chunks/app/api/settings/combo-defaults/route-4fd91743f3ac831d.js +0 -1
  792. package/app/.next/static/chunks/app/api/settings/ip-filter/route-4fd91743f3ac831d.js +0 -1
  793. package/app/.next/static/chunks/app/api/settings/model-aliases/route-4fd91743f3ac831d.js +0 -1
  794. package/app/.next/static/chunks/app/api/settings/proxy/route-4fd91743f3ac831d.js +0 -1
  795. package/app/.next/static/chunks/app/api/settings/proxy/test/route-4fd91743f3ac831d.js +0 -1
  796. package/app/.next/static/chunks/app/api/settings/require-login/route-4fd91743f3ac831d.js +0 -1
  797. package/app/.next/static/chunks/app/api/settings/route-4fd91743f3ac831d.js +0 -1
  798. package/app/.next/static/chunks/app/api/settings/system-prompt/route-4fd91743f3ac831d.js +0 -1
  799. package/app/.next/static/chunks/app/api/settings/thinking-budget/route-4fd91743f3ac831d.js +0 -1
  800. package/app/.next/static/chunks/app/api/shutdown/route-4fd91743f3ac831d.js +0 -1
  801. package/app/.next/static/chunks/app/api/storage/health/route-4fd91743f3ac831d.js +0 -1
  802. package/app/.next/static/chunks/app/api/sync/cloud/route-4fd91743f3ac831d.js +0 -1
  803. package/app/.next/static/chunks/app/api/sync/initialize/route-4fd91743f3ac831d.js +0 -1
  804. package/app/.next/static/chunks/app/api/tags/route-4fd91743f3ac831d.js +0 -1
  805. package/app/.next/static/chunks/app/api/telemetry/summary/route-4fd91743f3ac831d.js +0 -1
  806. package/app/.next/static/chunks/app/api/token-health/route-4fd91743f3ac831d.js +0 -1
  807. package/app/.next/static/chunks/app/api/translator/detect/route-4fd91743f3ac831d.js +0 -1
  808. package/app/.next/static/chunks/app/api/translator/history/route-4fd91743f3ac831d.js +0 -1
  809. package/app/.next/static/chunks/app/api/translator/load/route-4fd91743f3ac831d.js +0 -1
  810. package/app/.next/static/chunks/app/api/translator/save/route-4fd91743f3ac831d.js +0 -1
  811. package/app/.next/static/chunks/app/api/translator/send/route-4fd91743f3ac831d.js +0 -1
  812. package/app/.next/static/chunks/app/api/translator/translate/route-4fd91743f3ac831d.js +0 -1
  813. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-4fd91743f3ac831d.js +0 -1
  814. package/app/.next/static/chunks/app/api/usage/analytics/route-4fd91743f3ac831d.js +0 -1
  815. package/app/.next/static/chunks/app/api/usage/budget/route-4fd91743f3ac831d.js +0 -1
  816. package/app/.next/static/chunks/app/api/usage/call-logs/[id]/route-4fd91743f3ac831d.js +0 -1
  817. package/app/.next/static/chunks/app/api/usage/call-logs/route-4fd91743f3ac831d.js +0 -1
  818. package/app/.next/static/chunks/app/api/usage/history/route-4fd91743f3ac831d.js +0 -1
  819. package/app/.next/static/chunks/app/api/usage/logs/route-4fd91743f3ac831d.js +0 -1
  820. package/app/.next/static/chunks/app/api/usage/proxy-logs/route-4fd91743f3ac831d.js +0 -1
  821. package/app/.next/static/chunks/app/api/usage/quota/route-4fd91743f3ac831d.js +0 -1
  822. package/app/.next/static/chunks/app/api/usage/request-logs/route-4fd91743f3ac831d.js +0 -1
  823. package/app/.next/static/chunks/app/api/v1/api/chat/route-4fd91743f3ac831d.js +0 -1
  824. package/app/.next/static/chunks/app/api/v1/audio/speech/route-4fd91743f3ac831d.js +0 -1
  825. package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-4fd91743f3ac831d.js +0 -1
  826. package/app/.next/static/chunks/app/api/v1/chat/completions/route-4fd91743f3ac831d.js +0 -1
  827. package/app/.next/static/chunks/app/api/v1/completions/route-4fd91743f3ac831d.js +0 -1
  828. package/app/.next/static/chunks/app/api/v1/embeddings/route-4fd91743f3ac831d.js +0 -1
  829. package/app/.next/static/chunks/app/api/v1/images/generations/route-4fd91743f3ac831d.js +0 -1
  830. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-4fd91743f3ac831d.js +0 -1
  831. package/app/.next/static/chunks/app/api/v1/messages/route-4fd91743f3ac831d.js +0 -1
  832. package/app/.next/static/chunks/app/api/v1/models/route-4fd91743f3ac831d.js +0 -1
  833. package/app/.next/static/chunks/app/api/v1/moderations/route-4fd91743f3ac831d.js +0 -1
  834. package/app/.next/static/chunks/app/api/v1/music/generations/route-4fd91743f3ac831d.js +0 -1
  835. package/app/.next/static/chunks/app/api/v1/providers/[provider]/chat/completions/route-4fd91743f3ac831d.js +0 -1
  836. package/app/.next/static/chunks/app/api/v1/providers/[provider]/embeddings/route-4fd91743f3ac831d.js +0 -1
  837. package/app/.next/static/chunks/app/api/v1/providers/[provider]/images/generations/route-4fd91743f3ac831d.js +0 -1
  838. package/app/.next/static/chunks/app/api/v1/rerank/route-4fd91743f3ac831d.js +0 -1
  839. package/app/.next/static/chunks/app/api/v1/responses/route-4fd91743f3ac831d.js +0 -1
  840. package/app/.next/static/chunks/app/api/v1/route-4fd91743f3ac831d.js +0 -1
  841. package/app/.next/static/chunks/app/api/v1/videos/generations/route-4fd91743f3ac831d.js +0 -1
  842. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-4fd91743f3ac831d.js +0 -1
  843. package/app/.next/static/chunks/app/api/v1beta/models/route-4fd91743f3ac831d.js +0 -1
  844. package/app/.next/static/chunks/app/page-4fd91743f3ac831d.js +0 -1
  845. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-4fd91743f3ac831d.js +0 -1
  846. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-4fd91743f3ac831d.js +0 -1
  847. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-4fd91743f3ac831d.js +0 -1
  848. package/app/.next/static/css/f8997b4d505d4a63.css +0 -1
  849. package/app/.next/static/ig97FitGiiNqfOhrQUGzh/_buildManifest.js +0 -1
  850. /package/app/.next/static/{ig97FitGiiNqfOhrQUGzh → vyty8kP9IuZktMt159X9L}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6560],{14701:(e,t,a)=>{Promise.resolve().then(a.bind(a,38932))},38932:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>i});var s=a(95155),l=a(12115),r=a(40993),n=a(50910),d=a(52529);function i(){let[e,t]=(0,l.useState)([]),[a,i]=(0,l.useState)(null),[c,o]=(0,l.useState)(!0),[m,x]=(0,l.useState)(!1),[p,u]=(0,l.useState)(!1),[h,b]=(0,l.useState)(!1),[g,f]=(0,l.useState)({}),[j,v]=(0,l.useState)(!1),[y,N]=(0,l.useState)(!1),[k,w]=(0,l.useState)({name:"",binary:"",versionCommand:"",spawnArgs:""}),C=(0,n.c)("agents"),O=(0,n.c)("settings"),S=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/acp/agents"),a=await e.json();t(a.agents||[]),i(a.summary||null)}catch(e){console.error("Failed to fetch agents:",e)}finally{o(!1)}},[]);(0,l.useEffect)(()=>{S(),fetch("/api/settings").then(e=>e.json()).then(e=>f(e)).catch(()=>{})},[S]);let _=async(e,t)=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[e]:t})})).ok&&f(a=>({...a,[e]:t}))}catch(e){console.error("Failed to update setting:",e)}},F=async()=>{x(!0);try{let e=await fetch("/api/acp/agents",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"refresh"})}),a=await e.json();t(a.agents||[]),await S()}catch(e){console.error("Failed to refresh:",e)}finally{x(!1)}},A=async e=>{e.preventDefault(),b(!0);try{let e=k.name.toLowerCase().replace(/[^a-z0-9]/g,"-");(await fetch("/api/acp/agents",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,name:k.name,binary:k.binary,versionCommand:k.versionCommand||`${k.binary} --version`,spawnArgs:k.spawnArgs?k.spawnArgs.split(",").map(e=>e.trim()):[],protocol:"stdio"})})).ok&&(w({name:"",binary:"",versionCommand:"",spawnArgs:""}),u(!1),await S())}catch(e){console.error("Failed to add agent:",e)}finally{b(!1)}},E=async e=>{try{(await fetch(`/api/acp/agents?id=${e}`,{method:"DELETE"})).ok&&await S()}catch(e){console.error("Failed to remove agent:",e)}};return c?(0,s.jsx)("div",{className:"flex items-center justify-center min-h-[400px]",children:(0,s.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-primary border-t-transparent"})}):(0,s.jsxs)("div",{className:"flex flex-col gap-6 p-6 max-w-5xl mx-auto",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-2xl font-bold",children:C("title")}),(0,s.jsx)("p",{className:"text-text-muted mt-1",children:C("description")})]}),(0,s.jsxs)(r.$n,{variant:"secondary",onClick:F,loading:m,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1",children:"refresh"}),C("refresh")]})]}),a&&(0,s.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-border/50 bg-card p-4 text-center",children:[(0,s.jsx)("div",{className:"text-2xl font-bold text-primary",children:a.installed}),(0,s.jsx)("div",{className:"text-xs text-text-muted mt-1",children:C("installed")})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border/50 bg-card p-4 text-center",children:[(0,s.jsx)("div",{className:"text-2xl font-bold text-text-muted",children:a.notFound}),(0,s.jsx)("div",{className:"text-xs text-text-muted mt-1",children:C("notFound")})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border/50 bg-card p-4 text-center",children:[(0,s.jsx)("div",{className:"text-2xl font-bold",children:a.builtIn}),(0,s.jsx)("div",{className:"text-xs text-text-muted mt-1",children:C("builtIn")})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-border/50 bg-card p-4 text-center",children:[(0,s.jsx)("div",{className:"text-2xl font-bold text-amber-500",children:a.custom}),(0,s.jsx)("div",{className:"text-xs text-text-muted mt-1",children:C("custom")})]})]}),(0,s.jsxs)(r.Zp,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,s.jsx)("div",{className:"p-2 rounded-lg bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"fingerprint"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold",children:O("cliFingerprint")})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:O("cliFingerprintDesc")}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:["codex","claude","github","antigravity","kiro","cursor","kimi-coding","kilocode","cline"].map(e=>{let t=Object.values(d.Q2).find(t=>t.id===e),a=(g.cliCompatProviders||[]).includes(e),l=t?.name||e,r=t?.icon||"terminal",n=t?.color||"#888";return(0,s.jsxs)("button",{onClick:()=>{let t=g.cliCompatProviders||[];_("cliCompatProviders",t.includes(e)?t.filter(t=>t!==e):[...t,e])},className:`inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-all border ${a?"bg-emerald-500/10 border-emerald-500/30 text-emerald-600 dark:text-emerald-400":"bg-black/[0.02] dark:bg-white/[0.02] border-transparent text-text-muted hover:bg-black/[0.05] dark:hover:bg-white/[0.05]"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:{color:a?void 0:n},children:a?"fingerprint":r}),l,a&&(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px] text-emerald-500",children:"check"})]},e)})}),(g.cliCompatProviders||[]).length>0&&(0,s.jsxs)("p",{className:"text-xs text-emerald-600 dark:text-emerald-400 mt-1 flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"verified"}),O("cliFingerprintEnabled",{count:(g.cliCompatProviders||[]).length})]})]})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(e=>(0,s.jsxs)(r.Zp,{children:[(0,s.jsxs)("div",{className:"flex items-start justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:`p-2 rounded-lg ${e.installed?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":"bg-zinc-500/10 text-zinc-400"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:e.installed?"smart_toy":"block"})}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"font-semibold text-sm flex items-center gap-1.5",children:[e.name,e.isCustom&&(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-amber-500/10 text-amber-600 dark:text-amber-400 font-medium",children:C("custom")})]}),(0,s.jsx)("code",{className:"text-xs text-text-muted",children:e.binary})]})]}),(0,s.jsx)("div",{className:"flex items-center gap-1",children:e.installed?(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 font-medium",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"check_circle"}),e.version||C("installed")]}):(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full bg-zinc-500/10 text-zinc-500 font-medium",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"cancel"}),C("notFound")]})})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-3 pt-3 border-t border-border/30",children:[(0,s.jsx)("span",{className:"inline-flex items-center gap-1 text-[10px] px-2 py-0.5 rounded-full bg-blue-500/10 text-blue-500 font-mono",children:e.protocol}),e.isCustom&&(0,s.jsxs)("button",{onClick:()=>E(e.id),className:"text-xs text-red-500 hover:text-red-400 transition-colors flex items-center gap-0.5",title:C("remove"),children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"delete"}),C("remove")]})]})]},e.id))}),e.find(e=>"opencode"===e.id&&e.installed)&&(0,s.jsx)(r.Zp,{children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("div",{className:"p-2 rounded-lg bg-violet-500/10 text-violet-500 shrink-0",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"code_blocks"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,s.jsx)("h3",{className:"text-base font-semibold",children:"OpenCode Integration"}),(0,s.jsxs)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 font-medium",children:["opencode ",e.find(e=>"opencode"===e.id)?.version," detected"]})]}),(0,s.jsxs)("p",{className:"text-sm text-text-muted mb-3",children:["Generate a ready-to-use"," ",(0,s.jsx)("code",{className:"text-xs bg-black/[0.06] dark:bg-white/[0.08] px-1 py-0.5 rounded",children:"opencode.json"})," ","with your OmniRoute base URL and all available models — drop it in your project root and run"," ",(0,s.jsx)("code",{className:"text-xs bg-black/[0.06] dark:bg-white/[0.08] px-1 py-0.5 rounded",children:"opencode"}),"."]}),(0,s.jsxs)(r.$n,{variant:"secondary",loading:j,onClick:async()=>{v(!0),N(!1);try{let e=await fetch("/v1/models"),t=e.ok?await e.json():{data:[]},a={};for(let e of t.data||[])a[e.id]={name:e.id};let s=window.location.origin+"/v1",l={$schema:"https://opencode.ai/config.json",provider:{omniroute:{npm:"@ai-sdk/openai-compatible",name:"OmniRoute",options:{baseURL:s,apiKey:"YOUR_OMNIROUTE_API_KEY"},models:Object.keys(a).length>0?a:{"gpt-4o":{name:"gpt-4o"}}}}},r=new Blob([JSON.stringify(l,null,2)],{type:"application/json"}),n=URL.createObjectURL(r),d=document.createElement("a");d.href=n,d.download="opencode.json",d.click(),URL.revokeObjectURL(n),N(!0),setTimeout(()=>N(!1),3e3)}catch(e){console.error("Failed to generate opencode.json:",e)}finally{v(!1)}},children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1",children:y?"check":"download"}),y?"Downloaded!":"Download opencode.json"]})]})]})}),(0,s.jsxs)(r.Zp,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"p-2 rounded-lg bg-amber-500/10 text-amber-600 dark:text-amber-400",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"add_circle"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-lg font-semibold",children:C("addCustomAgent")}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:C("addCustomAgentDesc")})]})]}),(0,s.jsx)(r.$n,{variant:"secondary",onClick:()=>u(!p),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:p?"expand_less":"expand_more"})})]}),p&&(0,s.jsxs)("form",{onSubmit:A,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsx)(r.pd,{label:C("agentName"),placeholder:"e.g. My Custom CLI",value:k.name,onChange:e=>w({...k,name:e.target.value}),required:!0}),(0,s.jsx)(r.pd,{label:C("binaryName"),placeholder:"e.g. mycli",value:k.binary,onChange:e=>w({...k,binary:e.target.value}),required:!0})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsx)(r.pd,{label:C("versionCommand"),placeholder:"e.g. mycli --version",value:k.versionCommand,onChange:e=>w({...k,versionCommand:e.target.value})}),(0,s.jsx)(r.pd,{label:C("spawnArgs"),placeholder:"e.g. --quiet, --json",value:k.spawnArgs,onChange:e=>w({...k,spawnArgs:e.target.value})})]}),(0,s.jsx)("div",{className:"flex justify-end",children:(0,s.jsxs)(r.$n,{type:"submit",variant:"primary",loading:h,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1",children:"add"}),C("addAgent")]})})]})]})]})}},40993:(e,t,a)=>{"use strict";a.d(t,{Ex:()=>c.default,$n:()=>s.default,Zp:()=>n.default,Qv:()=>i.CardSkeleton,G9:()=>j.default,bQ:()=>k.default,pp:()=>y.default,Qn:()=>N.default,pd:()=>l.default,Mh:()=>f.default,uR:()=>p.default,aF:()=>d.default,rq:()=>x.default,LF:()=>m.default,KN:()=>b.default,Lo:()=>g.default,y7:()=>h.default,Iz:()=>v.default,l6:()=>r.default,lM:()=>o.default,cn:()=>u.default});var s=a(35806),l=a(34422),r=a(42994),n=a(81060),d=a(71361),i=a(92542);a(17705);var c=a(80927),o=a(19790);a(6261),a(55846),a(34243),a(89938),a(99023);var m=a(80178),x=a(85444),p=a(91961);a(25112);var u=a(45624),h=a(37415),b=a(48643),g=a(8287);a(1652);var f=a(92701);a(18150);var j=a(71689),v=a(33709);a(76332);var y=a(66200);a(61580);var N=a(51503);a(54128);var k=a(44638);a(21720),a(97050)}},e=>{e.O(0,[8500,3418,9751,8055,1149,5846,647,8441,3794,7358],()=>e(e.s=14701)),_N_E=e.O()}]);
@@ -1,15 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{22611:(e,t,s)=>{"use strict";s.d(t,{default:()=>S});var a=s(95155),l=s(12115),r=s(40993);let i={claude:{id:"claude",name:"Claude Code",icon:"terminal",color:"#D97757",description:"Anthropic Claude Code CLI",configType:"env",envVars:{baseUrl:"ANTHROPIC_BASE_URL",model:"ANTHROPIC_MODEL",opusModel:"ANTHROPIC_DEFAULT_OPUS_MODEL",sonnetModel:"ANTHROPIC_DEFAULT_SONNET_MODEL",haikuModel:"ANTHROPIC_DEFAULT_HAIKU_MODEL"},modelAliases:["default","sonnet","opus","haiku","opusplan"],settingsFile:"~/.claude/settings.json",defaultModels:[{id:"opus",name:"Claude Opus",alias:"opus",envKey:"ANTHROPIC_DEFAULT_OPUS_MODEL",defaultValue:"cc/claude-opus-4-5-20251101"},{id:"sonnet",name:"Claude Sonnet",alias:"sonnet",envKey:"ANTHROPIC_DEFAULT_SONNET_MODEL",defaultValue:"cc/claude-sonnet-4-5-20250929"},{id:"haiku",name:"Claude Haiku",alias:"haiku",envKey:"ANTHROPIC_DEFAULT_HAIKU_MODEL",defaultValue:"cc/claude-haiku-4-5-20251001"}]},codex:{id:"codex",name:"OpenAI Codex CLI",image:"/providers/codex.png",color:"#10A37F",description:"OpenAI Codex CLI",configType:"custom"},droid:{id:"droid",name:"Factory Droid",image:"/providers/droid.png",color:"#00D4FF",description:"Factory Droid AI Assistant",configType:"custom"},openclaw:{id:"openclaw",name:"Open Claw",image:"/providers/openclaw.png",color:"#FF6B35",description:"Open Claw AI Assistant",configType:"custom"},cursor:{id:"cursor",name:"Cursor",image:"/providers/cursor.png",color:"#000000",description:"Cursor AI Code Editor",configType:"guide",requiresCloud:!0,notes:[{type:"warning",text:"Requires Cursor Pro account to use this feature."},{type:"cloudCheck",text:"Cursor routes requests through its own server, so local endpoint is not supported. Please enable Cloud Endpoint in Settings."}],guideSteps:[{step:1,title:"Open Settings",desc:"Go to Settings → Models"},{step:2,title:"Enable OpenAI API",desc:'Enable "OpenAI API key" option'},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Add Custom Model",desc:'Click "View All Model" → "Add Custom Model"'},{step:6,title:"Select Model",type:"modelSelector"}]},cline:{id:"cline",name:"Cline",image:"/providers/cline.png",color:"#00D1B2",description:"Cline AI Coding Assistant CLI",configType:"custom"},kilo:{id:"kilo",name:"Kilo Code",image:"/providers/kilocode.png",color:"#FF6B6B",description:"Kilo Code AI Assistant CLI",configType:"custom"},continue:{id:"continue",name:"Continue",image:"/providers/continue.png",color:"#7C3AED",description:"Continue AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Config",desc:"Open Continue configuration file"},{step:2,title:"API Key",type:"apiKeySelector"},{step:3,title:"Select Model",type:"modelSelector"},{step:4,title:"Add Model Config",desc:"Add the following configuration to your models array:"}],codeBlock:{language:"json",code:`{
2
- "apiBase": "{{baseUrl}}",
3
- "title": "{{model}}",
4
- "model": "{{model}}",
5
- "provider": "openai",
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"}]}};var n=s(81135),o=s(5772),c=s(50910),d=s(33418);function x({effectiveConfigStatus:e,batchStatus:t,lastConfiguredAt:s=null}){let l=(0,c.c)("cliTools"),r=(0,d.Ym)(),i=e||t?.configStatus||null,n={configured:{dotClass:"bg-green-500",badgeClass:"bg-green-500/10 text-green-600 dark:text-green-400",text:l("configured")},not_configured:{dotClass:"bg-yellow-500",badgeClass:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",text:l("notConfigured")},not_installed:{dotClass:"bg-zinc-400 dark:bg-zinc-500",badgeClass:"bg-zinc-500/10 text-zinc-500 dark:text-zinc-400",text:l("notInstalled")},other:{dotClass:"bg-blue-500",badgeClass:"bg-blue-500/10 text-blue-600 dark:text-blue-400",text:l("custom")},unknown:{dotClass:"bg-zinc-400 dark:bg-zinc-500",badgeClass:"bg-zinc-500/10 text-zinc-500 dark:text-zinc-400",text:l("unknown")}},o=i?n[i]||n.unknown:null;return(0,a.jsxs)(a.Fragment,{children:[o&&(0,a.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full ${o.badgeClass}`,children:[(0,a.jsx)("span",{className:`size-1.5 rounded-full ${o.dotClass}`}),o.text]}),s?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] text-text-muted",title:l("lastSavedAt",{date:new Date(s).toLocaleString(r)}),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"schedule"}),function(e,t){let s=Date.now()-new Date(e).getTime();if(s<0)return t("justNow");let a=Math.floor(s/1e3);if(a<60)return t("justNow");let l=Math.floor(a/60);if(l<60)return t("minutesAgoShort",{count:l});let r=Math.floor(l/60);if(r<24)return t("hoursAgoShort",{count:r});let i=Math.floor(r/24);if(i<30)return t("daysAgoShort",{count:i});let n=Math.floor(i/30);return n<12?t("monthsAgoShort",{count:n}):t("yearsAgoShort",{count:Math.floor(n/12)})}(s,l)]}):i&&"not_installed"!==i?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"schedule"}),l("never")]}):null]})}let m="https://cloud.omniroute.online";function u({tool:e,isExpanded:t,onToggle:s,activeProviders:i,modelMappings:n,onModelMappingChange:d,baseUrl:u,hasActiveProviders:p,apiKeys:h,cloudEnabled:g,batchStatus:f,lastConfiguredAt:y}){let b,j,N,v=(0,c.c)("cliTools"),[k,w]=(0,l.useState)(null),[C,S]=(0,l.useState)(!1),[A,_]=(0,l.useState)(!1),[O,E]=(0,l.useState)(!1),[T,P]=(0,l.useState)(null),[$,z]=(0,l.useState)(!1),[R,M]=(0,l.useState)(!1),[K,I]=(0,l.useState)(null),[D,F]=(0,l.useState)(""),[U,L]=(0,l.useState)({}),[B,H]=(0,l.useState)(!1),[J,q]=(0,l.useState)(""),W=(0,l.useRef)(!1),[G,V]=(0,l.useState)([]),[Y,Z]=(0,l.useState)(!1),[Q,X]=(0,l.useState)(null),ee=!!(k?.installed&&k?.runnable),et=(()=>{if(!ee)return null;let e=k.settings?.env?.ANTHROPIC_BASE_URL;if(!e)return"not_configured";let t=e.includes("localhost")||e.includes("127.0.0.1"),s=g&&m&&e.startsWith(m);return t||s?"configured":"other"})()||f?.configStatus||null;(0,l.useEffect)(()=>{h?.length>0&&!D&&F(h[0].key)},[h,D]),(0,l.useEffect)(()=>{t&&!k&&(ea(),es(),en())},[t,k]);let es=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&L(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(k?.installed&&!W.current){W.current=!0;let t=k.settings?.env||{};e.defaultModels.forEach(e=>{if(e.envKey){let s=t[e.envKey]||e.defaultValue||"";s&&d(e.alias,s)}});let s=t.ANTHROPIC_AUTH_TOKEN;s&&h?.some(e=>e.key===s)&&F(s)}},[k,h,e.defaultModels,d]);let ea=async()=>{S(!0);try{let e=await fetch("/api/cli-tools/claude-settings"),t=await e.json();w(t)}catch(e){w({installed:!1,error:e.message})}finally{S(!1)}},el=()=>{let e=J||u;return e.endsWith("/v1")?e:`${e}/v1`},er=async()=>{_(!0),P(null);try{let t={ANTHROPIC_BASE_URL:el()},s=D?.trim()||(h?.length>0?h[0].key:null)||(g?null:"sk_omniroute");s&&(t.ANTHROPIC_AUTH_TOKEN=s),e.defaultModels.forEach(e=>{let s=n[e.alias];s&&e.envKey&&(t[e.envKey]=s)});let a=await fetch("/api/cli-tools/claude-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:t})}),l=await a.json();a.ok?(P({type:"success",text:v("settingsApplied")}),w(e=>({...e,hasBackup:!0,settings:{...e?.settings,env:t}}))):P({type:"error",text:l.error||v("failedApplySettings")})}catch(e){P({type:"error",text:e.message})}finally{_(!1)}},ei=async()=>{E(!0),P(null);try{let t=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),s=await t.json();t.ok?(P({type:"success",text:v("settingsReset")}),e.defaultModels.forEach(e=>d(e.alias,e.defaultValue||"")),F("")):P({type:"error",text:s.error||v("failedResetSettings")})}catch(e){P({type:"error",text:e.message})}finally{E(!1)}},en=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=claude"),t=await e.json();e.ok&&V(t.backups||[])}catch(e){console.log("Error fetching backups:",e)}},eo=async e=>{X(e),P(null);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"claude",backupId:e})}),s=await t.json();t.ok?(P({type:"success",text:v("backupRestored")}),ea(),en()):P({type:"error",text:s.error||v("failedRestore")})}catch(e){P({type:"error",text:e.message})}finally{X(null)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/claude.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(x,{effectiveConfigStatus:et,batchStatus:f,lastConfiguredAt:y})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:v("toolDescriptions.claude")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[C&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:v("checkingCli",{tool:"Claude"})})]}),!C&&k&&!ee&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:k.installed?v("cliNotRunnable",{tool:"Claude"}):v("cliNotInstalled",{tool:"Claude"})}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:k.installed?v("cliFoundFailedHealthcheck",{tool:"Claude",reason:k.reason?` (${k.reason})`:""}):v("installCliPrompt",{tool:"Claude"})})]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>z(!$),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:$?"expand_less":"help"}),$?v("hide"):v("howToInstall")]})]}),$&&(0,a.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,a.jsx)("h4",{className:"font-medium mb-3",children:v("installationGuide")}),(0,a.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted mb-1",children:v("platforms")}),(0,a.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,a.jsxs)("p",{className:"text-text-muted",children:[v("afterInstallationRun")," ",(0,a.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"claude"})," ",v("toVerify")]})]})]})]}),!C&&ee&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[k?.settings?.env?.ANTHROPIC_BASE_URL&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:v("current")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:k.settings.env.ANTHROPIC_BASE_URL})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:v("baseUrl")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:(b=J||u).endsWith("/v1")?b:`${b}/v1`,onChange:e=>q(e.target.value),placeholder:v("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"}),J&&J!==u&&(0,a.jsx)("button",{onClick:()=>q(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:v("resetToDefault"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:v("apiKey")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),h.length>0?(0,a.jsx)("select",{value:D,onChange:e=>F(e.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:h.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:g?v("noApiKeysCreateOne"):v("defaultOmnirouteKey")})]}),e.defaultModels.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:e.name}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:n[e.alias]||"",onChange:t=>d(e.alias,t.target.value),placeholder:v("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,a.jsx)("button",{onClick:()=>{I(e.alias),M(!0)},disabled:!p,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${p?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:v("selectModel")}),n[e.alias]&&(0,a.jsx)("button",{onClick:()=>d(e.alias,""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:v("clear"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e.alias))]}),T&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===T.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===T.type?"check_circle":"error"}),(0,a.jsx)("span",{children:T.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:er,disabled:!p,loading:A,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),v("apply")]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:ei,disabled:!k?.hasOmniRoute,loading:O,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),v("reset")]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>H(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),v("manualConfig")]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{Z(!Y),Y||en()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),v("backups"),G.length>0&&` (${G.length})`]})]}),Y&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),v("configBackups")]}),0===G.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:v("noBackupsYet")}):(0,a.jsx)("div",{className:"space-y-1.5",children:G.map(e=>(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,a.jsx)("span",{className:"flex-1 truncate font-mono",title:e.id,children:e.id}),(0,a.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(e.createdAt).toLocaleString()}),(0,a.jsx)("button",{onClick:()=>eo(e.id),disabled:Q===e.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:Q===e.id?"...":v("restore")})]},e.id))})]})]})]}),(0,a.jsx)(r.rq,{isOpen:R,onClose:()=>M(!1),onSelect:e=>{K&&d(K,e.value)},selectedModel:K?n[K]:null,activeProviders:i,modelAliases:U,title:v("selectModelForAlias",{alias:K||""})}),(0,a.jsx)(r.uR,{isOpen:B,onClose:()=>H(!1),title:v("claudeManualConfiguration"),configs:(j=D&&D.trim()?D:g?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",N={ANTHROPIC_BASE_URL:el(),ANTHROPIC_AUTH_TOKEN:j},e.defaultModels.forEach(e=>{let t=n[e.alias];t&&e.envKey&&(N[e.envKey]=t)}),[{filename:"~/.claude/settings.json",content:JSON.stringify({env:N},null,2)}])})]})}function p({tool:e,isExpanded:t,onToggle:s,baseUrl:i,apiKeys:n,activeProviders:d,cloudEnabled:m,batchStatus:u,lastConfiguredAt:p}){let h,g,f,y=(0,c.c)("cliTools"),[b,j]=(0,l.useState)(null),[N,v]=(0,l.useState)(!1),[k,w]=(0,l.useState)(!1),[C,S]=(0,l.useState)(!1),[A,_]=(0,l.useState)(null),[O,E]=(0,l.useState)(!1),[T,P]=(0,l.useState)(""),[$,z]=(0,l.useState)(""),[R,M]=(0,l.useState)(!1),[K,I]=(0,l.useState)({}),[D,F]=(0,l.useState)(!1),[U,L]=(0,l.useState)(""),[B,H]=(0,l.useState)([]),[J,q]=(0,l.useState)(!1),[W,G]=(0,l.useState)(""),[V,Y]=(0,l.useState)(!1),[Z,Q]=(0,l.useState)(null),[X,ee]=(0,l.useState)([]),[et,es]=(0,l.useState)(!1),[ea,el]=(0,l.useState)(null),er=!!(b?.installed&&b?.runnable);(0,l.useEffect)(()=>{n?.length>0&&!T&&P(n[0].key)},[n,T]),(0,l.useEffect)(()=>{t&&!b&&(ec(),ei(),em(),eg())},[t,b]);let ei=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&I(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(b?.config){let e=b.config.match(/^model\s*=\s*"([^"]+)"/m);e&&z(e[1])}},[b]);let en=(er?b.config?b.config.includes(i)||b.config.includes("localhost")||b.config.includes("127.0.0.1")?"configured":"other":"not_configured":null)||u?.configStatus||null,eo=()=>{let e=U||`${i}/v1`;return e.endsWith("/v1")?e:`${e}/v1`},ec=async()=>{v(!0);try{let e=await fetch("/api/cli-tools/codex-settings"),t=await e.json();j(t)}catch(e){j({installed:!1,error:e.message})}finally{v(!1)}},ed=async()=>{w(!0),_(null);try{let e=T&&T.trim()||m?T:"sk_omniroute",t=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:eo(),apiKey:e,model:$})}),s=await t.json();t.ok?(_({type:"success",text:y("settingsApplied")}),ec()):_({type:"error",text:s.error||y("failedApplySettings")})}catch(e){_({type:"error",text:e.message})}finally{w(!1)}},ex=async()=>{S(!0),_(null);try{let e=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),t=await e.json();e.ok?(_({type:"success",text:y("settingsReset")}),z(""),ec()):_({type:"error",text:t.error||y("failedResetSettings")})}catch(e){_({type:"error",text:e.message})}finally{S(!1)}},em=async()=>{try{let e=await fetch("/api/cli-tools/codex-profiles"),t=await e.json();e.ok&&H(t.profiles||[])}catch(e){console.log("Error fetching profiles:",e)}},eu=async()=>{if(W.trim()){Y(!0),_(null);try{let e=await fetch("/api/cli-tools/codex-profiles",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:W.trim()})}),t=await e.json();e.ok?(_({type:"success",text:y("profileSaved",{name:W})}),G(""),em()):_({type:"error",text:t.error||y("failedSaveProfile")})}catch(e){_({type:"error",text:e.message})}finally{Y(!1)}}},ep=async e=>{Q(e),_(null);try{let t=await fetch("/api/cli-tools/codex-profiles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileId:e})}),s=await t.json();t.ok?(_({type:"success",text:s.message||y("profileActivated")}),ec(),eg()):_({type:"error",text:s.error||y("failedActivateProfile")})}catch(e){_({type:"error",text:e.message})}finally{Q(null)}},eh=async e=>{try{(await fetch("/api/cli-tools/codex-profiles",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileId:e})})).ok&&em()}catch(e){console.log("Error deleting profile:",e)}},eg=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=codex"),t=await e.json();e.ok&&ee(t.backups||[])}catch(e){console.log("Error fetching backups:",e)}},ef=async e=>{el(e),_(null);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"codex",backupId:e})}),s=await t.json();t.ok?(_({type:"success",text:y("backupRestored")}),ec(),eg()):_({type:"error",text:s.error||y("failedRestore")})}catch(e){_({type:"error",text:e.message})}finally{el(null)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/codex.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(x,{effectiveConfigStatus:en,batchStatus:u,lastConfiguredAt:p})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:y("toolDescriptions.codex")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[N&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:y("checkingCli",{tool:"Codex"})})]}),!N&&b&&!er&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:b.installed?y("cliNotRunnable",{tool:"Codex"}):y("cliNotInstalled",{tool:"Codex"})}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:b.installed?y("cliFoundFailedHealthcheck",{tool:"Codex",reason:b.reason?` (${b.reason})`:""}):y("installCodexPrompt")})]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>E(!O),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:O?"expand_less":"help"}),O?y("hide"):y("howToInstall")]})]}),O&&(0,a.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,a.jsx)("h4",{className:"font-medium mb-3",children:y("installationGuide")}),(0,a.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted mb-1",children:y("platforms")}),(0,a.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,a.jsxs)("p",{className:"text-text-muted",children:[y("afterInstallationRun")," ",(0,a.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"codex"})," ",y("toVerify")]}),(0,a.jsx)("div",{className:"pt-2 border-t border-border",children:(0,a.jsxs)("p",{className:"text-text-muted text-xs",children:[y("codexAuthNotePrefix")," ",(0,a.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.codex/auth.json"})," ",y("codexAuthNoteMiddle")," ",(0,a.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"OPENAI_API_KEY"}),". ",y("codexAuthNoteSuffix")]})})]})]})]}),!N&&er&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[b?.config&&((g=(h=b.config.match(/base_url\s*=\s*"([^"]+)"/))?h[1]:null)?(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:y("current")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:g})]}):null),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:y("baseUrl")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:U||`${i}/v1`,onChange:e=>L(e.target.value),placeholder:y("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!==`${i}/v1`&&(0,a.jsx)("button",{onClick:()=>L(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:y("resetToDefault"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:y("apiKey")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),n.length>0?(0,a.jsx)("select",{value:T,onChange:e=>P(e.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(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:m?y("noApiKeysCreateOne"):y("defaultOmnirouteKey")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:y("model")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:$,onChange:e=>z(e.target.value),placeholder:y("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,a.jsx)("button",{onClick:()=>M(!0),disabled:!d?.length,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:y("selectModel")}),$&&(0,a.jsx)("button",{onClick:()=>z(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:y("clear"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),A&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===A.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===A.type?"check_circle":"error"}),(0,a.jsx)("span",{children:A.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:ed,disabled:!T||!$,loading:k,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),y("apply")]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:ex,disabled:!b.hasOmniRoute,loading:C,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),y("reset")]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>F(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),y("manualConfig")]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{q(!J),J||em()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"manage_accounts"}),y("profiles")]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{es(!et),et||eg()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),y("backups"),X.length>0&&` (${X.length})`]})]}),J&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"manage_accounts"}),y("savedProfiles")]}),0===B.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:y("noProfilesYet")}):(0,a.jsx)("div",{className:"space-y-1.5 mb-3",children:B.map(e=>(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"person"}),(0,a.jsx)("span",{className:"font-medium flex-1 truncate",children:e.name}),(0,a.jsx)("span",{className:"text-text-muted truncate max-w-[140px]",title:e.authLabel,children:e.authLabel}),(0,a.jsx)("button",{onClick:()=>ep(e.id),disabled:Z===e.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:Z===e.id?"...":y("activate")}),(0,a.jsx)("button",{onClick:()=>eh(e.id),className:"p-0.5 text-text-muted hover:text-red-500 transition-colors",title:y("deleteProfile"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"delete"})})]},e.id))}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:W,onChange:e=>G(e.target.value),placeholder:y("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:e=>"Enter"===e.key&&eu()}),(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:eu,disabled:!W.trim(),loading:V,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),y("saveCurrent")]})]})]}),et&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),y("configBackups")]}),0===X.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:y("noBackupsYet")}):(0,a.jsx)("div",{className:"space-y-1.5",children:X.map(e=>(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,a.jsx)("span",{className:"flex-1 truncate font-mono",title:e.id,children:e.id}),(0,a.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(e.createdAt).toLocaleString()}),(0,a.jsx)("button",{onClick:()=>ef(e.id),disabled:ea===e.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:ea===e.id?"...":y("restore")})]},e.id))})]})]})]}),(0,a.jsx)(r.rq,{isOpen:R,onClose:()=>M(!1),onSelect:e=>{z(e.value),M(!1)},selectedModel:$,activeProviders:d,modelAliases:K,title:y("selectModelForTool",{tool:"Codex"})}),(0,a.jsx)(r.uR,{isOpen:D,onClose:()=>F(!1),title:y("codexManualConfiguration"),configs:(f=T&&T.trim()?T:m?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",[{filename:"~/.codex/config.toml",content:`# OmniRoute Configuration for Codex CLI
8
- model = "${$}"
9
- model_provider = "omniroute"
10
-
11
- [model_providers.omniroute]
12
- name = "OmniRoute"
13
- base_url = "${eo()}"
14
- wire_api = "responses"
15
- `},{filename:"~/.codex/auth.json",content:JSON.stringify({OPENAI_API_KEY:f},null,2)}])})]})}let h="https://cloud.omniroute.online";function g({tool:e,isExpanded:t,onToggle:s,baseUrl:i,hasActiveProviders:n,apiKeys:d,activeProviders:m,cloudEnabled:u,batchStatus:p,lastConfiguredAt:g}){let f,y,b,j,N=(0,c.c)("cliTools"),[v,k]=(0,l.useState)(null),[w,C]=(0,l.useState)(!1),[S,A]=(0,l.useState)(!1),[_,O]=(0,l.useState)(!1),[E,T]=(0,l.useState)(null),[P,$]=(0,l.useState)(""),[z,R]=(0,l.useState)(""),[M,K]=(0,l.useState)(!1),[I,D]=(0,l.useState)({}),[F,U]=(0,l.useState)(!1),[L,B]=(0,l.useState)(""),H=(0,l.useRef)(!1),[J,q]=(0,l.useState)([]),[W,G]=(0,l.useState)(!1),[V,Y]=(0,l.useState)(null),Z=!!(v?.installed&&v?.runnable),Q=(()=>{if(!Z)return null;let e=v.settings?.customModels?.find(e=>"custom:OmniRoute-0"===e.id);if(!e)return"not_configured";let t=e.baseUrl?.includes("localhost")||e.baseUrl?.includes("127.0.0.1"),s=u&&h&&e.baseUrl?.startsWith(h);return t||s?"configured":"other"})()||p?.configStatus||null;(0,l.useEffect)(()=>{d?.length>0&&!P&&$(d[0].key)},[d,P]),(0,l.useEffect)(()=>{t&&!v&&(ee(),X(),el())},[t,v]);let X=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&D(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(v?.installed&&!H.current){H.current=!0;let e=v.settings?.customModels?.find(e=>"custom:OmniRoute-0"===e.id);e&&(e.model&&R(e.model),e.apiKey&&d?.some(t=>t.key===e.apiKey)&&$(e.apiKey))}},[v,d]);let ee=async()=>{C(!0);try{let e=await fetch("/api/cli-tools/droid-settings"),t=await e.json();k(t)}catch(e){k({installed:!1,error:e.message})}finally{C(!1)}},et=()=>{let e=L||i;return e.endsWith("/v1")?e:`${e}/v1`},es=async()=>{A(!0),T(null);try{let e=P?.trim()||(d?.length>0?d[0].key:null)||(u?null:"sk_omniroute"),t=await fetch("/api/cli-tools/droid-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:et(),apiKey:e,model:z})}),s=await t.json();t.ok?(T({type:"success",text:N("settingsApplied")}),ee()):T({type:"error",text:s.error||N("failedApplySettings")})}catch(e){T({type:"error",text:e.message})}finally{A(!1)}},ea=async()=>{O(!0),T(null);try{let e=await fetch("/api/cli-tools/droid-settings",{method:"DELETE"}),t=await e.json();e.ok?(T({type:"success",text:N("settingsReset")}),R(""),$(""),ee()):T({type:"error",text:t.error||N("failedResetSettings")})}catch(e){T({type:"error",text:e.message})}finally{O(!1)}},el=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=droid"),t=await e.json();e.ok&&q(t.backups||[])}catch(e){console.log("Error fetching backups:",e)}},er=async e=>{Y(e),T(null);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"droid",backupId:e})}),s=await t.json();t.ok?(T({type:"success",text:N("backupRestored")}),ee(),el()):T({type:"error",text:s.error||N("failedRestore")})}catch(e){T({type:"error",text:e.message})}finally{Y(null)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/droid.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(x,{effectiveConfigStatus:Q,batchStatus:p,lastConfiguredAt:g})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:N("toolDescriptions.droid")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[w&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:N("checkingCli",{tool:"Factory Droid"})})]}),!w&&v&&!Z&&(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:v.installed?N("cliNotRunnable",{tool:"Factory Droid"}):N("cliNotInstalled",{tool:"Factory Droid"})}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:v.installed?N("cliFoundFailedHealthcheck",{tool:"Factory Droid",reason:v.reason?` (${v.reason})`:""}):N("installCliPrompt",{tool:"Factory Droid"})})]})]}),!w&&Z&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[v?.settings?.customModels?.find(e=>"custom:OmniRoute-0"===e.id)?.baseUrl&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:N("current")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:v.settings.customModels.find(e=>"custom:OmniRoute-0"===e.id).baseUrl})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:N("baseUrl")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:(f=L||i).endsWith("/v1")?f:`${f}/v1`,onChange:e=>B(e.target.value),placeholder:N("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"}),L&&L!==i&&(0,a.jsx)("button",{onClick:()=>B(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:N("resetToDefault"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:N("apiKey")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),d.length>0?(0,a.jsx)("select",{value:P,onChange:e=>$(e.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:d.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:u?N("noApiKeysCreateOne"):N("defaultOmnirouteKey")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:N("model")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:z,onChange:e=>R(e.target.value),placeholder:N("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,a.jsx)("button",{onClick:()=>K(!0),disabled:!n,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${n?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:N("selectModel")}),z&&(0,a.jsx)("button",{onClick:()=>R(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:N("clear"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),E&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===E.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===E.type?"check_circle":"error"}),(0,a.jsx)("span",{children:E.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:es,disabled:!z,loading:S,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),N("apply")]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:ea,disabled:!v?.hasOmniRoute,loading:_,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),N("reset")]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>U(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),N("manualConfig")]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{G(!W),W||el()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),N("backups"),J.length>0&&` (${J.length})`]})]}),W&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),N("configBackups")]}),0===J.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:N("noBackupsYet")}):(0,a.jsx)("div",{className:"space-y-1.5",children:J.map(e=>(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,a.jsx)("span",{className:"flex-1 truncate font-mono",title:e.id,children:e.id}),(0,a.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(e.createdAt).toLocaleString()}),(0,a.jsx)("button",{onClick:()=>er(e.id),disabled:V===e.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:V===e.id?"...":N("restore")})]},e.id))})]})]})]}),(0,a.jsx)(r.rq,{isOpen:M,onClose:()=>K(!1),onSelect:e=>{R(e.value),K(!1)},selectedModel:z,activeProviders:m,modelAliases:I,title:N("selectModelForTool",{tool:"Factory Droid"})}),(0,a.jsx)(r.uR,{isOpen:F,onClose:()=>U(!1),title:N("droidManualConfiguration"),configs:(y=P&&P.trim()?P:u?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",b={customModels:[{model:z||"provider/model-id",id:"custom:OmniRoute-0",index:0,baseUrl:et(),apiKey:y,displayName:z||"provider/model-id",maxOutputTokens:131072,noImageSupport:!1,provider:"openai"}]},j="u">typeof navigator&&navigator.platform,[{filename:j?.toLowerCase().includes("win")?"%USERPROFILE%\\.factory\\settings.json":"~/.factory/settings.json",content:JSON.stringify(b,null,2)}])})]})}let f="https://cloud.omniroute.online";function y({tool:e,isExpanded:t,onToggle:s,baseUrl:i,hasActiveProviders:n,apiKeys:d,activeProviders:m,cloudEnabled:u,batchStatus:p,lastConfiguredAt:h}){let g,y,b=(0,c.c)("cliTools"),[j,N]=(0,l.useState)(null),[v,k]=(0,l.useState)(!1),[w,C]=(0,l.useState)(!1),[S,A]=(0,l.useState)(!1),[_,O]=(0,l.useState)(null),[E,T]=(0,l.useState)(""),[P,$]=(0,l.useState)(""),[z,R]=(0,l.useState)(!1),[M,K]=(0,l.useState)({}),[I,D]=(0,l.useState)(!1),[F,U]=(0,l.useState)(""),L=(0,l.useRef)(!1),[B,H]=(0,l.useState)([]),[J,q]=(0,l.useState)(!1),[W,G]=(0,l.useState)(null),V=!!(j?.installed&&j?.runnable),Y=(()=>{if(!V)return null;let e=j.settings?.models?.providers?.omniroute;if(!e)return"not_configured";let t=e.baseUrl?.includes("localhost")||e.baseUrl?.includes("127.0.0.1"),s=u&&f&&e.baseUrl?.startsWith(f);return t||s?"configured":"other"})()||p?.configStatus||null;(0,l.useEffect)(()=>{d?.length>0&&!E&&T(d[0].key)},[d,E]),(0,l.useEffect)(()=>{t&&!j&&(Q(),Z(),es())},[t,j]);let Z=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&K(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(j?.installed&&!L.current){L.current=!0;let e=j.settings?.models?.providers?.omniroute;if(e){let t=j.settings?.agents?.defaults?.model?.primary;t&&$(t.replace("omniroute/","")),e.apiKey&&d?.some(t=>t.key===e.apiKey)&&T(e.apiKey)}}},[j,d]);let Q=async()=>{k(!0);try{let e=await fetch("/api/cli-tools/openclaw-settings"),t=await e.json();N(t)}catch(e){N({installed:!1,error:e.message})}finally{k(!1)}},X=()=>{let e=F||i;return e.endsWith("/v1")?e:`${e}/v1`},ee=async()=>{C(!0),O(null);try{let e=E?.trim()||(d?.length>0?d[0].key:null)||(u?null:"sk_omniroute"),t=await fetch("/api/cli-tools/openclaw-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:X(),apiKey:e,model:P})}),s=await t.json();t.ok?(O({type:"success",text:b("settingsApplied")}),Q()):O({type:"error",text:s.error||b("failedApplySettings")})}catch(e){O({type:"error",text:e.message})}finally{C(!1)}},et=async()=>{A(!0),O(null);try{let e=await fetch("/api/cli-tools/openclaw-settings",{method:"DELETE"}),t=await e.json();e.ok?(O({type:"success",text:b("settingsReset")}),$(""),T(""),Q()):O({type:"error",text:t.error||b("failedResetSettings")})}catch(e){O({type:"error",text:e.message})}finally{A(!1)}},es=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=openclaw"),t=await e.json();e.ok&&H(t.backups||[])}catch(e){console.log("Error fetching backups:",e)}},ea=async e=>{G(e),O(null);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"openclaw",backupId:e})}),s=await t.json();t.ok?(O({type:"success",text:b("backupRestored")}),Q(),es()):O({type:"error",text:s.error||b("failedRestore")})}catch(e){O({type:"error",text:e.message})}finally{G(null)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/openclaw.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(x,{effectiveConfigStatus:Y,batchStatus:p,lastConfiguredAt:h})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:b("toolDescriptions.openclaw")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[v&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:b("checkingCli",{tool:"Open Claw"})})]}),!v&&j&&!V&&(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:j.installed?b("cliNotRunnable",{tool:"Open Claw"}):b("cliNotInstalled",{tool:"Open Claw"})}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:j.installed?b("cliFoundFailedHealthcheck",{tool:"Open Claw",reason:j.reason?` (${j.reason})`:""}):b("installCliPrompt",{tool:"Open Claw"})})]})]}),!v&&V&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[j?.settings?.models?.providers?.omniroute?.baseUrl&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:b("current")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:j.settings.models.providers.omniroute.baseUrl})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:b("baseUrl")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:(g=F||i).endsWith("/v1")?g:`${g}/v1`,onChange:e=>U(e.target.value),placeholder:b("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"}),F&&F!==i&&(0,a.jsx)("button",{onClick:()=>U(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:b("resetToDefault"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:b("apiKey")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),d.length>0?(0,a.jsx)("select",{value:E,onChange:e=>T(e.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:d.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:u?b("noApiKeysCreateOne"):b("defaultOmnirouteKey")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:b("model")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:P,onChange:e=>$(e.target.value),placeholder:b("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,a.jsx)("button",{onClick:()=>R(!0),disabled:!n,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${n?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:b("selectModel")}),P&&(0,a.jsx)("button",{onClick:()=>$(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:b("clear"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),_&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===_.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===_.type?"check_circle":"error"}),(0,a.jsx)("span",{children:_.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:ee,disabled:!P,loading:w,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),b("apply")]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:et,disabled:!j?.hasOmniRoute,loading:S,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),b("reset")]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>D(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),b("manualConfig")]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{q(!J),J||es()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),b("backups"),B.length>0&&` (${B.length})`]})]}),J&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),b("configBackups")]}),0===B.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:b("noBackupsYet")}):(0,a.jsx)("div",{className:"space-y-1.5",children:B.map(e=>(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,a.jsx)("span",{className:"flex-1 truncate font-mono",title:e.id,children:e.id}),(0,a.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(e.createdAt).toLocaleString()}),(0,a.jsx)("button",{onClick:()=>ea(e.id),disabled:W===e.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:W===e.id?"...":b("restore")})]},e.id))})]})]})]}),(0,a.jsx)(r.rq,{isOpen:z,onClose:()=>R(!1),onSelect:e=>{$(e.value),R(!1)},selectedModel:P,activeProviders:m,modelAliases:M,title:b("selectModelForTool",{tool:"Open Claw"})}),(0,a.jsx)(r.uR,{isOpen:I,onClose:()=>D(!1),title:b("openClawManualConfiguration"),configs:(y=E&&E.trim()?E:u?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",[{filename:"~/.openclaw/openclaw.json",content:JSON.stringify({agents:{defaults:{model:{primary:`omniroute/${P||"provider/model-id"}`}}},models:{providers:{omniroute:{baseUrl:X(),apiKey:y,api:"openai-completions",models:[{id:P||"provider/model-id",name:(P||"provider/model-id").split("/").pop()}]}}}},null,2)}])})]})}let b="https://cloud.omniroute.online";function j({tool:e,isExpanded:t,onToggle:s,baseUrl:i,hasActiveProviders:n,apiKeys:d,activeProviders:m,cloudEnabled:u,batchStatus:p,lastConfiguredAt:h}){let g=(0,c.c)("cliTools"),[f,y]=(0,l.useState)(null),[j,N]=(0,l.useState)(!1),[v,k]=(0,l.useState)(!1),[w,C]=(0,l.useState)(!1),[S,A]=(0,l.useState)(null),[_,O]=(0,l.useState)(""),[E,T]=(0,l.useState)(""),[P,$]=(0,l.useState)(!1),[z,R]=(0,l.useState)({}),[M,K]=(0,l.useState)(!1),[I,D]=(0,l.useState)(""),F=(0,l.useRef)(!1),[U,L]=(0,l.useState)([]),[B,H]=(0,l.useState)(!1),[J,q]=(0,l.useState)(null),W=!!(f?.installed&&f?.runnable),G=(()=>{if(!W)return null;if(!f.hasOmniRoute)return"not_configured";let e=f.settings?.openAiBaseUrl||"",t=e.includes("localhost")||e.includes("127.0.0.1"),s=u&&b&&e.startsWith(b);return t||s?"configured":"other"})(),V=G||p?.configStatus||null;(0,l.useEffect)(()=>{d?.length>0&&!_&&O(d[0].key)},[d,_]),(0,l.useEffect)(()=>{t&&!f&&(X(),Y(),Z())},[t,f]),(0,l.useEffect)(()=>{if(f?.settings&&!F.current){let e=f.settings.openAiModelId;e&&(T(e),F.current=!0)}},[f]);let Y=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let t=await e.json();R(t.aliases||{})}}catch{}},Z=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=cline");if(e.ok){let t=await e.json();L(t.backups||[])}}catch{}},Q=async e=>{q(e);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"cline",backupId:e})});if(t.ok)A({type:"success",text:g("backupRestoredReloading")}),await X(),await Z();else{let e=await t.json();A({type:"error",text:e.error||g("failedRestoreBackup")})}}catch(e){A({type:"error",text:e.message})}finally{q(null)}},X=async()=>{N(!0);try{let e=await fetch("/api/cli-tools/cline-settings"),t=await e.json();y(t)}catch(e){y({error:e.message})}finally{N(!1)}},ee=async()=>{k(!0),A(null);try{let e=I||i||"http://localhost:20128",t=e.endsWith("/v1")?e:`${e}/v1`,s=await fetch("/api/cli-tools/cline-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:t,apiKey:_||"sk_omniroute",model:E})}),a=await s.json();s.ok?(A({type:"success",text:a.message||g("applied")}),await X(),await Z()):A({type:"error",text:a.error||g("failed")})}catch(e){A({type:"error",text:e.message})}finally{k(!1)}},et=async()=>{C(!0),A(null);try{let e=await fetch("/api/cli-tools/cline-settings",{method:"DELETE"}),t=await e.json();e.ok?(A({type:"success",text:t.message||g("resetDone")}),T(""),F.current=!1,await X(),await Z()):A({type:"error",text:t.error||g("failed")})}catch(e){A({type:"error",text:e.message})}finally{C(!1)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:e.image?(0,a.jsx)(o.default,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}}):(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:e.color},children:"terminal"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(x,{effectiveConfigStatus:V,batchStatus:p,lastConfiguredAt:h})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:g("toolDescriptions.cline")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-6 pt-6 border-t border-border",children:[j&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,a.jsx)("span",{children:g("checkingCli",{tool:"Cline"})})]}),f&&!j&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-bg-secondary/50 border-border",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${W?"text-green-500":"text-yellow-500"}`,children:W?"check_circle":"warning"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:W?g("cliDetectedReady",{tool:"Cline"}):f.installed?g("cliNotRunnable",{tool:"Cline"}):g("cliNotDetected",{tool:"Cline"})}),f.commandPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[g("binary"),":"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:f.commandPath})]}),f.globalStatePath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[g("configPathShort"),":"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:f.globalStatePath})]})]})]}),W&&(0,a.jsxs)(a.Fragment,{children:["configured"===G&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-green-500/10 border border-green-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-green-500 text-lg",children:"check_circle"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm text-green-700 dark:text-green-300",children:g("omnirouteConfiguredOpenAiCompatible")}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[g("provider"),": ",(0,a.jsx)("strong",{children:"openai"})," • ",g("model"),":"," ",(0,a.jsx)("strong",{children:f.settings?.openAiModelId||"—"})]})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:g("model")}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:E,onChange:e=>T(e.target.value),placeholder:g("providerModelPlaceholder"),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)(r.$n,{variant:"outline",size:"sm",onClick:()=>$(!0),disabled:!n,children:g("select")}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>K(!0),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:g("apiKey")}),d&&d.length>0?(0,a.jsx)("select",{value:_,onChange:e=>O(e.target.value),className:"px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:u?g("noApiKeysAvailable"):g("usingDefaultOmniroute")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:ee,disabled:!E,loading:v,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"configured"===G?g("updateConfig"):g("applyConfig")]}),"configured"===G&&(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:et,loading:w,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restart_alt"}),g("reset")]})]}),S&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-lg text-sm ${"success"===S.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"success"===S.type?"check_circle":"error"}),(0,a.jsx)("span",{children:S.text})]}),(0,a.jsxs)("div",{className:"border-t border-border pt-3 mt-1",children:[(0,a.jsxs)("button",{onClick:()=>H(!B),className:"flex items-center gap-2 text-sm text-text-muted hover:text-text transition-colors",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] transition-transform ${B?"rotate-90":""}`,children:"chevron_right"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"backup"}),g("backups")," ",U.length>0&&`(${U.length})`]}),B&&U.length>0&&(0,a.jsx)("div",{className:"mt-2 flex flex-col gap-1.5 pl-6",children:U.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 p-2 rounded bg-bg-secondary/50 text-xs",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-medium",children:e.originalFile}),(0,a.jsx)("span",{className:"text-text-muted",children:new Date(e.createdAt).toLocaleString()})]}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>Q(e.id),loading:J===e.id,children:g("restore")})]},e.id))}),B&&0===U.length&&(0,a.jsx)("p",{className:"mt-2 pl-6 text-xs text-text-muted",children:g("noBackupsAvailable")})]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:P,onClose:()=>$(!1),onSelect:e=>{T(e.value),$(!1)},selectedModel:E,activeProviders:m,title:g("selectModelForTool",{tool:"Cline"})}),M&&(0,a.jsx)(r.uR,{isOpen:M,onClose:()=>K(!1),title:g("clineManualConfiguration"),...{onApply:e=>{e.model&&T(e.model),e.apiKey&&O(e.apiKey),e.baseUrl&&D(e.baseUrl),K(!1)},currentConfig:{model:E,apiKey:_,baseUrl:I||i}}})]})}function N({tool:e,isExpanded:t,onToggle:s,baseUrl:i,hasActiveProviders:n,apiKeys:d,activeProviders:m,cloudEnabled:u,batchStatus:p,lastConfiguredAt:h}){let g=(0,c.c)("cliTools"),[f,y]=(0,l.useState)(null),[b,j]=(0,l.useState)(!1),[N,v]=(0,l.useState)(!1),[k,w]=(0,l.useState)(!1),[C,S]=(0,l.useState)(null),[A,_]=(0,l.useState)(""),[O,E]=(0,l.useState)(""),[T,P]=(0,l.useState)(!1),[$,z]=(0,l.useState)({}),[R,M]=(0,l.useState)(!1),[K,I]=(0,l.useState)(""),D=(0,l.useRef)(!1),[F,U]=(0,l.useState)([]),[L,B]=(0,l.useState)(!1),[H,J]=(0,l.useState)(null),q=!!(f?.installed&&f?.runnable),W=q?f.hasOmniRoute?"configured":"not_configured":null,G=W||p?.configStatus||null;(0,l.useEffect)(()=>{d?.length>0&&!A&&_(d[0].key)},[d,A]),(0,l.useEffect)(()=>{t&&!f&&(Q(),V(),Y())},[t,f]);let V=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let t=await e.json();z(t.aliases||{})}}catch{}},Y=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=kilo");if(e.ok){let t=await e.json();U(t.backups||[])}}catch{}},Z=async e=>{J(e);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"kilo",backupId:e})});if(t.ok)S({type:"success",text:g("backupRestoredReloading")}),await Q(),await Y();else{let e=await t.json();S({type:"error",text:e.error||g("failedRestoreBackup")})}}catch(e){S({type:"error",text:e.message})}finally{J(null)}},Q=async()=>{j(!0);try{let e=await fetch("/api/cli-tools/kilo-settings"),t=await e.json();y(t)}catch(e){y({error:e.message})}finally{j(!1)}},X=async()=>{v(!0),S(null);try{let e=K||i||"http://localhost:20128",t=e.endsWith("/v1")?e:`${e}/v1`,s=await fetch("/api/cli-tools/kilo-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:t,apiKey:A||"sk_omniroute",model:O})}),a=await s.json();s.ok?(S({type:"success",text:a.message||g("applied")}),await Q(),await Y()):S({type:"error",text:a.error||g("failed")})}catch(e){S({type:"error",text:e.message})}finally{v(!1)}},ee=async()=>{w(!0),S(null);try{let e=await fetch("/api/cli-tools/kilo-settings",{method:"DELETE"}),t=await e.json();e.ok?(S({type:"success",text:t.message||g("resetDone")}),E(""),D.current=!1,await Q(),await Y()):S({type:"error",text:t.error||g("failed")})}catch(e){S({type:"error",text:e.message})}finally{w(!1)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:e.image?(0,a.jsx)(o.default,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}}):(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:e.color},children:"terminal"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(x,{effectiveConfigStatus:G,batchStatus:p,lastConfiguredAt:h})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:g("toolDescriptions.kilo")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-6 pt-6 border-t border-border",children:[b&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,a.jsx)("span",{children:g("checkingCli",{tool:"Kilo Code"})})]}),f&&!b&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-bg-secondary/50 border-border",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${q?"text-green-500":"text-yellow-500"}`,children:q?"check_circle":"warning"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:q?g("cliDetectedReady",{tool:"Kilo Code"}):f.installed?g("cliNotRunnable",{tool:"Kilo Code"}):g("cliNotDetected",{tool:"Kilo Code"})}),f.commandPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[g("binary"),":"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:f.commandPath})]}),f.authPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[g("auth"),":"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:f.authPath})]})]})]}),q&&(0,a.jsxs)(a.Fragment,{children:["configured"===W&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-green-500/10 border border-green-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-green-500 text-lg",children:"check_circle"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm text-green-700 dark:text-green-300",children:g("omnirouteConfiguredOpenAiCompatible")}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[g("providers"),":"," ",(0,a.jsx)("strong",{children:f.settings?.auth?.join(", ")||"—"})]})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:g("model")}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:O,onChange:e=>E(e.target.value),placeholder:g("providerModelPlaceholder"),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)(r.$n,{variant:"outline",size:"sm",onClick:()=>P(!0),disabled:!n,children:g("select")}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>M(!0),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:g("apiKey")}),d&&d.length>0?(0,a.jsx)("select",{value:A,onChange:e=>_(e.target.value),className:"px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:u?g("noApiKeysAvailable"):g("usingDefaultOmniroute")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:X,disabled:!O,loading:N,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"configured"===W?g("updateConfig"):g("applyConfig")]}),"configured"===W&&(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:ee,loading:k,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restart_alt"}),g("reset")]})]}),C&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-lg text-sm ${"success"===C.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"success"===C.type?"check_circle":"error"}),(0,a.jsx)("span",{children:C.text})]}),(0,a.jsxs)("div",{className:"border-t border-border pt-3 mt-1",children:[(0,a.jsxs)("button",{onClick:()=>B(!L),className:"flex items-center gap-2 text-sm text-text-muted hover:text-text transition-colors",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] transition-transform ${L?"rotate-90":""}`,children:"chevron_right"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"backup"}),g("backups")," ",F.length>0&&`(${F.length})`]}),L&&F.length>0&&(0,a.jsx)("div",{className:"mt-2 flex flex-col gap-1.5 pl-6",children:F.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 p-2 rounded bg-bg-secondary/50 text-xs",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-medium",children:e.originalFile}),(0,a.jsx)("span",{className:"text-text-muted",children:new Date(e.createdAt).toLocaleString()})]}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>Z(e.id),loading:H===e.id,children:g("restore")})]},e.id))}),L&&0===F.length&&(0,a.jsx)("p",{className:"mt-2 pl-6 text-xs text-text-muted",children:g("noBackupsAvailable")})]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:T,onClose:()=>P(!1),onSelect:e=>{E(e.value),P(!1)},selectedModel:O,activeProviders:m,title:g("selectModelForTool",{tool:"Kilo Code"})}),R&&(0,a.jsx)(r.uR,{isOpen:R,onClose:()=>M(!1),title:g("kiloManualConfiguration"),...{onApply:e=>{e.model&&E(e.model),e.apiKey&&_(e.apiKey),e.baseUrl&&I(e.baseUrl),M(!1)},currentConfig:{model:O,apiKey:A,baseUrl:K||i}}})]})}function v({toolId:e,tool:t,isExpanded:s,onToggle:i,baseUrl:n,apiKeys:d,activeProviders:x=[],cloudEnabled:m=!1,batchStatus:u}){let p,h,g,f=(0,c.c)("cliTools"),y=(0,l.useCallback)((e,t,s)=>{try{return f(e,s)}catch{return t}},[f]),[b,j]=(0,l.useState)(null),[N,v]=(0,l.useState)(!1),[k,w]=(0,l.useState)(""),[C,S]=(0,l.useState)(null),[A,_]=(0,l.useState)(null),[O,E]=(0,l.useState)(!1),T=(0,l.useRef)(!1),[P,$]=(0,l.useState)(()=>d?.length>0?d[0].key:"");(0,l.useEffect)(()=>{let t=localStorage.getItem(`omniroute-cli-model-${e}`);t&&w(t);let s=localStorage.getItem(`omniroute-cli-key-${e}`);s&&d?.some(e=>e.key===s)&&$(s)},[e,d]);let z=(0,l.useCallback)(t=>{w(t),t?localStorage.setItem(`omniroute-cli-model-${e}`,t):localStorage.removeItem(`omniroute-cli-model-${e}`)},[e]),R=(0,l.useCallback)(t=>{$(t),t&&localStorage.setItem(`omniroute-cli-key-${e}`,t)},[e]);(0,l.useEffect)(()=>{!s||C||T.current||(T.current=!0,fetch(`/api/cli-tools/runtime/${e}`).then(e=>e.json()).then(e=>S(e)).catch(e=>S({error:e?.message||f("runtimeCheckFailed")})))},[s,C,e]);let M=e=>{let t=P&&P.trim()?P:m?f("yourApiKeyPlaceholder"):"sk_omniroute",s=n||"http://localhost:20128",a=s.endsWith("/v1")?s:`${s}/v1`;return e.replace(/\{\{baseUrl\}\}/g,a).replace(/\{\{apiKey\}\}/g,t).replace(/\{\{model\}\}/g,k||f("modelPlaceholder"))},K=async(e,t)=>{await navigator.clipboard.writeText(M(e)),j(t),setTimeout(()=>j(null),2e3)},I=x.length>0,D=s&&null===C,F=async()=>{E(!0),_(null);try{let t=P&&P.trim()?P:m?"":"sk_omniroute",s=n||"http://localhost:20128",a=s.endsWith("/v1")?s:`${s}/v1`,l=await fetch(`/api/cli-tools/guide-settings/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:a,apiKey:t,model:k})}),r=await l.json();l.ok?_({type:"success",text:r.message||f("configurationSaved")}):_({type:"error",text:r.error||f("failedToSave")})}catch(e){_({type:"error",text:e.message})}finally{E(!1)}},U=["continue"].includes(e),L=()=>!t.requiresCloud||!!m;return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:i,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:t.image?(0,a.jsx)(o.default,{src:t.image,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}}):t.icon?(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:t.color},children:t.icon}):(0,a.jsx)(o.default,{src:`/providers/${e}.png`,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:t.name}),(p=C?.reason==="not_required"||"guide"===t.configType,h=C?C.installed&&C.runnable:u?.installed&&u?.runnable,g=C?C.installed:u?.installed,p?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-blue-500/10 text-blue-600 dark:text-blue-400",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-blue-500"}),f("guide")]}):h?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-green-500/10 text-green-600 dark:text-green-400",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-green-500"}),f("detected")]}):!1===g&&(C||u)?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-zinc-500/10 text-zinc-500 dark:text-zinc-400",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-zinc-400 dark:bg-zinc-500"}),f("notInstalled")]}):g&&!h&&(C||u)?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-yellow-500"}),f("notReady")]}):null)]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:y(`toolDescriptions.${e}`,t.description)})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${s?"rotate-180":""}`,children:"expand_more"})]}),s&&(0,a.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:t.guideSteps?(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[D&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,a.jsx)("span",{children:f("checkingRuntime")})]}),!D&&C&&!C.error&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-blue-500 text-lg",children:"not_required"===C.reason?"info":C.installed&&C.runnable?"check_circle":"warning"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:"not_required"===C.reason?f("guideOnlyIntegration"):C.installed&&C.runnable?f("cliRuntimeDetected"):C.installed?f("cliFoundNotRunnable",{reason:C.reason?`: ${C.reason}`:""}):f("cliRuntimeNotDetected")}),C.commandPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[f("binary"),":"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:C.commandPath})]}),C.configPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[f("configPath"),":"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:C.configPath})]})]})]}),!D&&C?.error&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-red-500/10 border border-red-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-red-500 text-lg",children:"error"}),(0,a.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:f("failedCheckRuntimeStatus")})]}),t.notes&&0!==t.notes.length?(0,a.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:t.notes.map((t,s)=>{if("cloudCheck"===t.type&&m)return null;let l="warning"===t.type,r="cloudCheck"===t.type&&!m,i="bg-blue-500/10 border-blue-500/30",n="text-blue-600 dark:text-blue-400",o="text-blue-500",c="info";return l?(i="bg-yellow-500/10 border-yellow-500/30",n="text-yellow-600 dark:text-yellow-400",o="text-yellow-500",c="warning"):r&&(i="bg-red-500/10 border-red-500/30",n="text-red-600 dark:text-red-400",o="text-red-500",c="error"),(0,a.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${i}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${o}`,children:c}),(0,a.jsx)("p",{className:`text-sm ${n}`,children:y(`guides.${e}.notes.${s}`,t.text)})]},s)})}):null,L()&&t.guideSteps.map(s=>(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsx)("div",{className:"size-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold text-white",style:{backgroundColor:t.color},children:s.step}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-text",children:y(`guides.${e}.steps.${s.step}.title`,s.title)}),s.desc&&(0,a.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:y(`guides.${e}.steps.${s.step}.desc`,s.desc)}),"apiKeySelector"===s.type&&(0,a.jsx)("div",{className:"mt-2 flex items-center gap-2",children:d&&d.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("select",{value:P,onChange:e=>R(e.target.value),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}),(0,a.jsx)("button",{onClick:()=>K(P,"apiKey"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"apiKey"===b?"check":"content_copy"})})]}):(0,a.jsx)("span",{className:"text-sm text-text-muted",children:m?f("noApiKeysCreateOne"):"sk_omniroute"})}),"modelSelector"===s.type&&(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:k,onChange:e=>z(e.target.value),placeholder:f("modelPlaceholder"),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>v(!0),disabled:!I,className:`shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors ${I?"bg-bg-secondary border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:f("selectModel")}),k&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{onClick:()=>K(k,"model"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"model"===b?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>z(""),className:"p-2 text-text-muted hover:text-red-500 rounded transition-colors",title:f("clear"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]})]}),s.value&&(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,a.jsx)("code",{className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm font-mono border border-border truncate",children:M(s.value)}),s.copyable&&(0,a.jsx)("button",{onClick:()=>K(s.value,`${s.step}-${s.title}`),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:b===`${s.step}-${s.title}`?"check":"content_copy"})})]})]})]},s.step)),L()&&t.codeBlock&&(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wide",children:t.codeBlock.language}),(0,a.jsxs)("button",{onClick:()=>K(t.codeBlock.code,"codeblock"),className:"flex items-center gap-1 px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"codeblock"===b?"check":"content_copy"}),"codeblock"===b?f("copied"):f("copy")]})]}),(0,a.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto",children:(0,a.jsx)("code",{className:"text-sm font-mono whitespace-pre",children:M(t.codeBlock.code)})})]}),L()&&(0,a.jsxs)("div",{className:"mt-2",children:[A&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs mb-2 ${"success"===A.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===A.type?"check_circle":"error"}),(0,a.jsx)("span",{children:A.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[U&&(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:F,disabled:!k,loading:O,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),f("saveConfig")]}),t.codeBlock&&(0,a.jsxs)(r.$n,{variant:U?"outline":"primary",size:"sm",onClick:()=>K(t.codeBlock.code,"codeblock"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"codeblock"===b?"check":"content_copy"}),"codeblock"===b?f("copied"):f("copyConfig")]}),k&&(0,a.jsxs)("span",{className:"text-xs text-text-muted flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-green-500",children:"check_circle"}),f("selectionSaved")]})]})]})]}):(0,a.jsx)("p",{className:"text-text-muted text-sm",children:f("comingSoon")})}),(0,a.jsx)(r.rq,{isOpen:N,onClose:()=>v(!1),onSelect:e=>{z(e.value)},selectedModel:k,activeProviders:x,title:f("selectModel")})]})}function k({tool:e,isExpanded:t,onToggle:s,baseUrl:i,apiKeys:n,activeProviders:d,hasActiveProviders:x,cloudEnabled:m}){let u=(0,c.c)("cliTools"),[p,h]=(0,l.useState)(null),[g,f]=(0,l.useState)(!1),[y,b]=(0,l.useState)(!1),[j,N]=(0,l.useState)(""),[v,k]=(0,l.useState)(""),[w,C]=(0,l.useState)(null),[S,A]=(0,l.useState)({}),[_,O]=(0,l.useState)(!1),[E,T]=(0,l.useState)(null);(0,l.useEffect)(()=>{n?.length>0&&!v&&k(n[0].key)},[n,v]),(0,l.useEffect)(()=>{t&&!p&&($(),P())},[t,p]);let P=async()=>{try{let e=await fetch("/api/cli-tools/antigravity-mitm/alias?tool=antigravity");if(e.ok){let t=(await e.json()).aliases||{};Object.keys(t).length>0&&A(t)}}catch(e){console.log("Error loading saved mappings:",e)}},$=async()=>{try{let e=await fetch("/api/cli-tools/antigravity-mitm");if(e.ok){let t=await e.json();h(t)}}catch(e){console.log("Error fetching status:",e),h({running:!1})}},z="u">typeof navigator&&navigator.userAgent?.includes("Windows"),R=async e=>{f(!0),C(null);try{let t=v?.trim()||(n?.length>0?n[0].key:null)||(m?null:"sk_omniroute"),s=await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t,sudoPassword:e})}),a=await s.json();s.ok?(C({type:"success",text:u("mitmStarted")}),b(!1),N(""),$()):C({type:"error",text:a.error||u("failedStart")})}catch(e){C({type:"error",text:e.message})}finally{f(!1)}},M=async e=>{f(!0),C(null);try{let t=await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:e})}),s=await t.json();t.ok?(C({type:"success",text:u("mitmStopped")}),b(!1),N(""),$()):C({type:"error",text:s.error||u("failedStop")})}catch(e){C({type:"error",text:e.message})}finally{f(!1)}},K=()=>{j.trim()?p?.running?M(j):R(j):C({type:"error",text:u("sudoPasswordRequiredError")})},I=(e,t)=>{A(s=>({...s,[e]:t}))},D=async()=>{f(!0),C(null);try{let e=await fetch("/api/cli-tools/antigravity-mitm/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"antigravity",mappings:S})});if(!e.ok){let t=await e.json();throw Error(t.error||u("failedSaveMappings"))}C({type:"success",text:u("mappingsSaved")})}catch(e){C({type:"error",text:e.message})}finally{f(!1)}},F=p?.running;return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/antigravity.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),F?(0,a.jsx)(r.Ex,{variant:"success",size:"sm",children:u("active")}):(0,a.jsx)(r.Ex,{variant:"default",size:"sm",children:u("inactive")})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:u("toolDescriptions.antigravity")})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"flex items-center gap-2",children:F?(0,a.jsxs)("button",{onClick:()=>{z||p?.hasCachedPassword?M(""):(b(!0),C(null))},disabled:g,className:"px-4 py-2 rounded-lg bg-red-500/10 border border-red-500/30 text-red-500 font-medium text-sm flex items-center gap-2 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"stop_circle"}),u("stopMitm")]}):(0,a.jsxs)("button",{onClick:()=>{z||p?.hasCachedPassword?R(""):(b(!0),C(null))},disabled:g||!x,className:"px-4 py-2 rounded-lg bg-primary/10 border border-primary/30 text-primary font-medium text-sm flex items-center gap-2 hover:bg-primary/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"play_circle"}),u("startMitm")]})}),w?.type==="error"&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,a.jsx)("span",{children:w.text})]}),F&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:u("apiKey")}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),n.length>0?(0,a.jsx)("select",{value:v,onChange:e=>k(e.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(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:m?u("noApiKeysCreateOne"):u("defaultOmnirouteKey")})]}),e.defaultModels.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:e.name}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:S[e.alias]||"",onChange:t=>I(e.alias,t.target.value),placeholder:u("modelPlaceholder"),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,a.jsx)("button",{onClick:()=>{T(e.alias),O(!0)},disabled:!x,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${x?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:u("select")}),S[e.alias]&&(0,a.jsx)("button",{onClick:()=>I(e.alias,""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:u("clear"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e.alias)),(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:D,disabled:g||0===Object.keys(S).length,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),u("saveMappings")]})})]}),!F&&(0,a.jsxs)("div",{className:"flex flex-col gap-1.5 px-1",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"font-medium text-text-main",children:u("howItWorks")})," ",u("antigravityHowWorksDesc")]}),(0,a.jsxs)("div",{className:"flex flex-col gap-0.5 text-[11px] text-text-muted",children:[(0,a.jsx)("span",{children:u("antigravityStep1")}),(0,a.jsxs)("span",{children:[u("antigravityStep2Prefix")," ",(0,a.jsx)("code",{className:"text-[10px] bg-surface px-1 rounded",children:"daily-cloudcode-pa.googleapis.com"})," ",u("antigravityStep2Suffix")]}),(0,a.jsx)("span",{children:u("antigravityStep3")})]})]})]}),(0,a.jsx)(r.aF,{isOpen:y,onClose:()=>{b(!1),N(""),C(null)},title:u("sudoPasswordRequiredTitle"),size:"sm",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:u("sudoPasswordHint")})]}),(0,a.jsx)(r.pd,{type:"password",placeholder:u("enterSudoPassword"),value:j,onChange:e=>N(e.target.value),onKeyDown:e=>{"Enter"!==e.key||g||K()}}),w&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===w.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===w.type?"check_circle":"error"}),(0,a.jsx)("span",{children:w.text})]}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{b(!1),N(""),C(null)},disabled:g,children:u("cancel")}),(0,a.jsx)(r.$n,{variant:"primary",size:"sm",onClick:K,loading:g,children:u("confirm")})]})]})}),(0,a.jsx)(r.rq,{isOpen:_,onClose:()=>O(!1),onSelect:e=>{E&&A(t=>({...t,[E]:e.value}))},selectedModel:E?S[E]:null,activeProviders:d,title:u("selectModelForAlias",{alias:E||""})})]})}function w({tool:e,isExpanded:t,onToggle:s,baseUrl:i,apiKeys:n,activeProviders:d=[],hasActiveProviders:x=!1,cloudEnabled:m=!1,batchStatus:u}){let p=(0,c.c)("cliTools"),[h,g]=(0,l.useState)(null),[f,y]=(0,l.useState)(()=>{try{let e=localStorage.getItem("omniroute-copilot-selected-models");return e?new Set(JSON.parse(e)):new Set}catch{return new Set}}),[b,j]=(0,l.useState)(()=>{{let e=localStorage.getItem("omniroute-cli-key-copilot");if(e&&n?.some(t=>t.key===e))return e}return n?.length>0?n[0].key:""}),[N,v]=(0,l.useState)(128e3),[k,w]=(0,l.useState)(16e3),[C,S]=(0,l.useState)(!0),[A,_]=(0,l.useState)(!1),[O,E]=(0,l.useState)([]),[T,P]=(0,l.useState)(!1),[$,z]=(0,l.useState)("");(0,l.useEffect)(()=>{if(!t||T)return;let e=!1;return fetch("/v1/models").then(e=>e.json()).then(t=>{e||(E((t.data||[]).filter(e=>e&&!e.type&&!e.parent&&e.id).map(e=>({value:e.id,label:e.id}))),P(!0))}).catch(()=>{e||P(!0)}),()=>{e=!0}},[t,T]);let R=$?O.filter(e=>e.label.toLowerCase().includes($.toLowerCase())):O;(0,l.useEffect)(()=>{f.size>0&&localStorage.setItem("omniroute-copilot-selected-models",JSON.stringify([...f]))},[f]);let M=()=>JSON.stringify({name:"OmniRoute",vendor:"azure",apiKey:"${input:chat.lm.secret.omniroute}",models:[...f].map(e=>({id:e,name:e,url:`${i}/v1/chat/completions#models.ai.azure.com`,toolCalling:C,vision:A,maxInputTokens:N,maxOutputTokens:k}))},null,2),K=async(e,t)=>{await navigator.clipboard.writeText(e),g(t),setTimeout(()=>g(null),2e3)};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:e.image||"/providers/copilot.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-blue-500/10 text-blue-600 dark:text-blue-400",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-blue-500"}),p("guide")]})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-blue-500 text-lg",children:"info"}),(0,a.jsxs)("div",{className:"text-sm text-blue-700 dark:text-blue-300",children:[(0,a.jsx)("p",{className:"font-medium",children:"GitHub Copilot Config Generator"}),(0,a.jsxs)("p",{className:"mt-1 text-xs opacity-80",children:["Generates the"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:"chatLanguageModels.json"})," ","block for VS Code GitHub Copilot using the Azure vendor pattern. Select the models you want, then copy the JSON into your config file."]})]})]}),(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-lg",children:"warning"}),(0,a.jsxs)("p",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:["This configuration uses the Azure vendor workaround for custom model lists. Tested with ",(0,a.jsx)("strong",{children:"VS Code ≥ 1.109"})," and"," ",(0,a.jsx)("strong",{children:"GitHub Copilot Chat ≥ v0.37"}),". Future extension updates may change this behavior."]})]}),m&&n?.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,a.jsx)("div",{className:"size-6 rounded-full flex items-center justify-center text-xs font-semibold text-white",style:{backgroundColor:e.color},children:"1"}),(0,a.jsx)("span",{className:"font-medium text-sm",children:"API Key"})]}),(0,a.jsx)("select",{value:b,onChange:e=>{var t;j(t=e.target.value),t&&localStorage.setItem("omniroute-cli-key-copilot",t)},className:"w-full px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:n.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"size-6 rounded-full flex items-center justify-center text-xs font-semibold text-white",style:{backgroundColor:e.color},children:m&&n?.length>0?"2":"1"}),(0,a.jsxs)("span",{className:"font-medium text-sm",children:["Select Models (",f.size,"/",R.length,")"]})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{onClick:()=>{y(new Set(O.map(e=>e.value)))},className:"px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:"Select All"}),(0,a.jsx)("button",{onClick:()=>{y(new Set)},className:"px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:"Clear"})]})]}),(0,a.jsx)("div",{className:"mb-2",children:(0,a.jsx)("input",{type:"text",value:$,onChange:e=>z(e.target.value),placeholder:"Filter models...",className:"w-full px-3 py-1.5 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"})}),T||0!==O.length?0===R.length&&0===O.length?(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-lg",children:"warning"}),(0,a.jsx)("p",{className:"text-sm text-yellow-600 dark:text-yellow-400",children:p("noActiveProviders")})]}):(0,a.jsx)("div",{className:"max-h-64 overflow-y-auto rounded-lg border border-border bg-bg-secondary",children:R.map(e=>(0,a.jsxs)("label",{className:"flex items-center gap-3 px-3 py-2 hover:bg-bg-tertiary cursor-pointer border-b border-border last:border-0 transition-colors",children:[(0,a.jsx)("input",{type:"checkbox",checked:f.has(e.value),onChange:()=>{var t;return t=e.value,void y(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"rounded border-border text-primary accent-[#1F6FEB]"}),(0,a.jsx)("span",{className:"text-sm font-mono truncate",children:e.label})]},e.value))}):(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,a.jsx)("span",{children:"Loading models..."})]})]}),(0,a.jsxs)("details",{className:"group",children:[(0,a.jsxs)("summary",{className:"flex items-center gap-2 cursor-pointer text-sm text-text-muted hover:text-text-main transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base group-open:rotate-90 transition-transform",children:"chevron_right"}),"Advanced Options"]}),(0,a.jsxs)("div",{className:"mt-3 grid grid-cols-2 gap-3 pl-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted block mb-1",children:"Max Input Tokens"}),(0,a.jsx)("input",{type:"number",value:N,onChange:e=>v(Number(e.target.value)||128e3),className:"w-full px-3 py-1.5 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted block mb-1",children:"Max Output Tokens"}),(0,a.jsx)("input",{type:"number",value:k,onChange:e=>w(Number(e.target.value)||16e3),className:"w-full px-3 py-1.5 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"})]}),(0,a.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",checked:C,onChange:e=>S(e.target.checked),className:"rounded border-border accent-[#1F6FEB]"}),(0,a.jsx)("span",{className:"text-sm",children:"Tool Calling"})]}),(0,a.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",checked:A,onChange:e=>_(e.target.checked),className:"rounded border-border accent-[#1F6FEB]"}),(0,a.jsx)("span",{className:"text-sm",children:"Vision"})]})]})]}),f.size>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"size-6 rounded-full flex items-center justify-center text-xs font-semibold text-white",style:{backgroundColor:e.color},children:m&&n?.length>0?"3":"2"}),(0,a.jsxs)("span",{className:"font-medium text-sm",children:["Copy Config (",f.size," model",1!==f.size?"s":"",")"]})]}),(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:()=>K(M(),"config"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"config"===h?"check":"content_copy"}),p("config"===h?"copied":"copyConfig")]})]}),(0,a.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto max-h-80",children:(0,a.jsx)("code",{className:"text-xs font-mono whitespace-pre text-text-main",children:M()})}),(0,a.jsxs)("div",{className:"mt-3 p-3 bg-bg-secondary rounded-lg border border-border",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"font-medium text-text-main",children:"Paste into: "}),(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:"~/.config/Code/User/chatLanguageModels.json"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Then reload VS Code and set the API key in the input prompt."})]})]})]})})]})}let C="https://cloud.omniroute.online";function S({machineId:e}){let t,s,o,d=(0,c.c)("cliTools"),[x,m]=(0,l.useState)([]),[h,f]=(0,l.useState)(!0),[b,S]=(0,l.useState)(null),[A,_]=(0,l.useState)({}),[O,E]=(0,l.useState)(!1),[T,P]=(0,l.useState)([]),[$,z]=(0,l.useState)({}),[R,M]=(0,l.useState)(!1);(0,l.useEffect)(()=>{F(),K(),I(),D()},[]);let K=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let t=await e.json();E(t.cloudEnabled||!1)}}catch(e){console.log("Error loading cloud settings:",e)}},I=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let t=await e.json();P(t.keys||[])}}catch(e){console.log("Error fetching API keys:",e)}},D=async()=>{try{let e=new AbortController,t=setTimeout(()=>e.abort(),8e3),s=await fetch("/api/cli-tools/status",{signal:e.signal});if(clearTimeout(t),s.ok){let e=await s.json();z(e||{})}}catch(e){console.log("CLI tool status check timed out or failed:",e)}finally{M(!0)}},F=async()=>{try{let e=await fetch("/api/providers"),t=await e.json();e.ok&&m(t.connections||[])}catch(e){console.log("Error fetching connections:",e)}finally{f(!1)}},U=()=>x.filter(e=>!1!==e.isActive),L=(0,l.useCallback)((e,t,s)=>{_(a=>a[e]?.[t]===s?a:{...a,[e]:{...a[e],[t]:s}})},[]);if(h||!R)return(0,a.jsx)("div",{className:"flex flex-col gap-6",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(r.Qv,{}),(0,a.jsx)(r.Qv,{}),(0,a.jsx)(r.Qv,{})]})});let B=(t=U(),s=[],o=new Set,t.forEach(e=>{let t=n.Xg[e.provider]||e.provider;(0,n.KC)(e.provider).forEach(a=>{let l=`${t}/${a.id}`;o.has(l)||(o.add(l),s.push({value:l,label:`${t}/${a.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:a.id}))})}),s).length>0;return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[!B&&(0,a.jsx)(r.Zp,{className:"border-yellow-500/50 bg-yellow-500/5",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:d("noActiveProviders")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:d("noActiveProvidersDesc")})]})]})}),(0,a.jsx)("div",{className:"flex flex-col gap-4",children:Object.entries(i).map(([e,t])=>((e,t)=>{let s={tool:t,isExpanded:b===e,onToggle:()=>S(b===e?null:e),baseUrl:O&&C?C:window.location.origin,apiKeys:T,batchStatus:$[e]||null,lastConfiguredAt:$[e]?.lastConfiguredAt||null};switch(e){case"claude":return(0,a.jsx)(u,{...s,activeProviders:U(),modelMappings:A[e]||{},onModelMappingChange:(t,s)=>L(e,t,s),hasActiveProviders:B,cloudEnabled:O},e);case"codex":return(0,a.jsx)(p,{...s,activeProviders:U(),cloudEnabled:O},e);case"droid":return(0,a.jsx)(g,{...s,activeProviders:U(),hasActiveProviders:B,cloudEnabled:O},e);case"openclaw":return(0,a.jsx)(y,{...s,activeProviders:U(),hasActiveProviders:B,cloudEnabled:O},e);case"antigravity":return(0,a.jsx)(k,{...s,activeProviders:U(),hasActiveProviders:B,cloudEnabled:O},e);case"cline":return(0,a.jsx)(j,{...s,activeProviders:U(),hasActiveProviders:B,cloudEnabled:O},e);case"kilo":return(0,a.jsx)(N,{...s,activeProviders:U(),hasActiveProviders:B,cloudEnabled:O},e);case"copilot":return(0,a.jsx)(w,{...s,activeProviders:U(),hasActiveProviders:B,cloudEnabled:O},e);default:return(0,a.jsx)(v,{toolId:e,...s,activeProviders:U(),cloudEnabled:O},e)}})(e,t))})]})}},40993:(e,t,s)=>{"use strict";s.d(t,{Ex:()=>c.default,$n:()=>a.default,Zp:()=>i.default,Qv:()=>o.CardSkeleton,G9:()=>b.default,bQ:()=>k.default,pp:()=>N.default,Qn:()=>v.default,pd:()=>l.default,Mh:()=>y.default,uR:()=>u.default,aF:()=>n.default,rq:()=>m.default,LF:()=>x.default,KN:()=>g.default,Lo:()=>f.default,y7:()=>h.default,Iz:()=>j.default,l6:()=>r.default,lM:()=>d.default,cn:()=>p.default});var a=s(35806),l=s(34422),r=s(42994),i=s(81060),n=s(71361),o=s(92542);s(17705);var c=s(80927),d=s(19790);s(6261),s(55846),s(34243),s(89938),s(99023);var x=s(80178),m=s(85444),u=s(91961);s(25112);var p=s(45624),h=s(37415),g=s(48643),f=s(8287);s(1652);var y=s(92701);s(18150);var b=s(71689),j=s(33709);s(76332);var N=s(66200);s(61580);var v=s(51503);s(54128);var k=s(44638);s(21720),s(97050)},44058:(e,t,s)=>{Promise.resolve().then(s.bind(s,22611))}},e=>{e.O(0,[8500,3418,9751,8055,1149,5846,647,8441,3794,7358],()=>e(e.s=44058)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{40993:(e,t,a)=>{"use strict";a.d(t,{Ex:()=>d.default,$n:()=>s.default,Zp:()=>i.default,Qv:()=>o.CardSkeleton,G9:()=>y.default,bQ:()=>N.default,pp:()=>j.default,Qn:()=>k.default,pd:()=>r.default,Mh:()=>f.default,uR:()=>p.default,aF:()=>n.default,rq:()=>x.default,LF:()=>m.default,KN:()=>b.default,Lo:()=>g.default,y7:()=>h.default,Iz:()=>v.default,l6:()=>l.default,lM:()=>c.default,cn:()=>u.default});var s=a(35806),r=a(34422),l=a(42994),i=a(81060),n=a(71361),o=a(92542);a(17705);var d=a(80927),c=a(19790);a(6261),a(55846),a(34243),a(89938),a(99023);var m=a(80178),x=a(85444),p=a(91961);a(25112);var u=a(45624),h=a(37415),b=a(48643),g=a(8287);a(1652);var f=a(92701);a(18150);var y=a(71689),v=a(33709);a(76332);var j=a(66200);a(61580);var k=a(51503);a(54128);var N=a(44638);a(21720),a(97050)},93062:(e,t,a)=>{Promise.resolve().then(a.bind(a,96191))},96191:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>N});var s=a(95155),r=a(12115),l=a(40993);function i({children:e,content:t,position:a="top",className:l="",delayMs:i=200}){let n,[o,d]=(0,r.useState)(!1),c=(0,r.useId)(),m=(0,r.useRef)(null),x=(0,r.useCallback)(()=>{clearTimeout(m.current),m.current=setTimeout(()=>d(!0),i)},[i]),p=(0,r.useCallback)(()=>{clearTimeout(m.current),d(!1)},[]);(0,r.useEffect)(()=>()=>{clearTimeout(m.current)},[]);let u={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"},h=t?c:void 0,b=(0,r.isValidElement)(e)?(n=[e.props["aria-describedby"],h].filter(Boolean).join(" "),(0,r.cloneElement)(e,{"aria-describedby":n||void 0})):(0,s.jsx)("span",{tabIndex:0,"aria-describedby":h,children:e});return(0,s.jsxs)("span",{className:`relative inline-flex ${l}`,onMouseEnter:x,onMouseLeave:p,onFocus:x,onBlur:p,onKeyDown:e=>{"Escape"===e.key&&p()},children:[b,o&&t&&(0,s.jsx)("span",{id:c,role:"tooltip",className:`absolute z-50 px-2.5 py-1.5 text-xs font-medium text-white bg-gray-900/95 rounded-md shadow-lg whitespace-nowrap pointer-events-none animate-in fade-in duration-150 motion-reduce:transition-none motion-reduce:animate-none border border-white/10 ${u[a]||u.top}`,children:t})]})}var n=a(30949),o=a(67671),d=a(50910);let c=/^[a-zA-Z0-9_/.-]+$/,m=[{value:"priority",labelKey:"priority",descKey:"priorityDesc",icon:"sort"},{value:"weighted",labelKey:"weighted",descKey:"weightedDesc",icon:"percent"},{value:"round-robin",labelKey:"roundRobin",descKey:"roundRobinDesc",icon:"autorenew"},{value:"random",labelKey:"random",descKey:"randomDesc",icon:"shuffle"},{value:"least-used",labelKey:"leastUsed",descKey:"leastUsedDesc",icon:"low_priority"},{value:"cost-optimized",labelKey:"costOpt",descKey:"costOptimizedDesc",icon:"savings"}],x={priority:{when:"Use when you have one preferred model and only want fallback on failure.",avoid:"Avoid when you need balanced load between models.",example:"Example: Primary coding model with cheaper backup for outages."},weighted:{when:"Use when you need controlled traffic split across models.",avoid:"Avoid when weights are not maintained or you need strict fairness.",example:"Example: 80% stable model and 20% canary model for safe rollout."},"round-robin":{when:"Use when you need predictable, even request distribution.",avoid:"Avoid when model latency/cost differs significantly.",example:"Example: Same model across multiple accounts to spread throughput."},random:{when:"Use when you want a simple spread with low configuration effort.",avoid:"Avoid when requests must be distributed with strict guarantees.",example:"Example: Prototyping with equivalent models and no traffic policy."},"least-used":{when:"Use when you want adaptive balancing based on recent demand.",avoid:"Avoid when your traffic is too low to benefit from usage balancing.",example:"Example: Mixed workloads where one model tends to get overloaded."},"cost-optimized":{when:"Use when minimizing cost is the top priority.",avoid:"Avoid when pricing data is missing or outdated.",example:"Example: Batch or background jobs where lower cost matters most."}},p={priority:{title:"Fail-safe baseline",description:"Use one primary model and keep fallback chain short and reliable.",tips:["Put your most reliable model first.","Keep 1-2 backup models with similar quality.","Use safe retries to absorb transient provider failures."]},weighted:{title:"Controlled traffic split",description:"Great for canary rollouts and gradual migration between models.",tips:["Start with conservative split like 90/10.","Keep the total at 100% and auto-balance after changes.","Monitor success and latency before increasing canary weight."]},"round-robin":{title:"Predictable load sharing",description:"Best when models are equivalent and you need smooth distribution.",tips:["Use at least 2 models.","Set concurrency limits to avoid burst overload.","Use queue timeout to fail fast under saturation."]},random:{title:"Quick spread with low setup",description:"Use when you need simple distribution without strict guarantees.",tips:["Use models with similar latency profiles.","Keep retries enabled to absorb random misses.","Prefer this for experimentation, not strict SLAs."]},"least-used":{title:"Adaptive balancing",description:"Routes to less-used models to reduce hotspots over time.",tips:["Works better under continuous traffic.","Combine with health checks for safer balancing.","Track per-model usage to validate distribution gains."]},"cost-optimized":{title:"Budget-first routing",description:"Routes to lower-cost models when pricing metadata is available.",tips:["Ensure pricing coverage for all selected models.","Keep a quality fallback for hard prompts.","Use for batch/background jobs where cost is the main KPI."]}},u="omniroute:combos:hide-usage-guide",h=[{id:"free-stack",icon:"volunteer_activism",titleKey:"templateFreeStack",descKey:"templateFreeStackDesc",fallbackTitle:"Free Stack ($0)",fallbackDesc:"Round-robin across all free providers: Kiro, iFlow, Qwen, Gemini CLI. Zero cost, never stops.",strategy:"round-robin",suggestedName:"free-stack",isFeatured:!0,config:{maxRetries:3,retryDelayMs:500,healthCheckEnabled:!0}},{id:"high-availability",icon:"shield",titleKey:"templateHighAvailability",descKey:"templateHighAvailabilityDesc",fallbackTitle:"High availability",fallbackDesc:"Priority routing with health checks and safe retries.",strategy:"priority",suggestedName:"high-availability",config:{maxRetries:2,retryDelayMs:1500,healthCheckEnabled:!0}},{id:"cost-saver",icon:"savings",titleKey:"templateCostSaver",descKey:"templateCostSaverDesc",fallbackTitle:"Cost saver",fallbackDesc:"Cost-optimized routing for budget-first workloads.",strategy:"cost-optimized",suggestedName:"cost-saver",config:{maxRetries:1,retryDelayMs:500,healthCheckEnabled:!0}},{id:"balanced",icon:"balance",titleKey:"templateBalanced",descKey:"templateBalancedDesc",fallbackTitle:"Balanced load",fallbackDesc:"Least-used routing to spread demand over time.",strategy:"least-used",suggestedName:"balanced-load",config:{maxRetries:1,retryDelayMs:1e3,healthCheckEnabled:!0}}];function b(e){return m.find(t=>t.value===e)||m[0]}function g(e,t){return e(b(t).labelKey)}function f(e,t){return e(b(t).descKey)}function y(e,t,a){return"function"==typeof e.has&&e.has(t)?e(t):a}function v(e,t,a){let s=x[t]||x.priority;return y(e,`strategyGuide.${t}.${a}`,s[a])}function j(e,t,a){let s=p[t]||p.priority;return"tips"===a?s.tips.map((a,s)=>y(e,`strategyRecommendations.${t}.tip${s+1}`,a)):y(e,`strategyRecommendations.${t}.${a}`,s[a])}function k(e){return"string"==typeof e?{model:e,weight:0}:{model:e.model,weight:e.weight||0}}function N(){let e=(0,d.c)("combos"),t=(0,d.c)("common"),[a,i]=(0,r.useState)([]),[c,m]=(0,r.useState)(!0),[x,p]=(0,r.useState)(!1),[h,b]=(0,r.useState)(null),[g,f]=(0,r.useState)([]),[v,j]=(0,r.useState)({}),[k,N]=(0,r.useState)(null),[C,$]=(0,r.useState)(null),{copied:S,copy:M}=(0,n.C)(),R=(0,o.i)(),[P,z]=(0,r.useState)(null),[A,K]=(0,r.useState)(null),[q,_]=(0,r.useState)([]),[O,U]=(0,r.useState)(!0),[F,H]=(0,r.useState)("");(0,r.useEffect)(()=>{B(),fetch("/api/settings/proxy").then(e=>e.ok?e.json():null).then(e=>K(e)).catch(()=>{})},[]),(0,r.useEffect)(()=>{try{globalThis.localStorage?.getItem(u)==="1"&&U(!1)}catch{}},[]);let B=async()=>{try{let[e,t,a,s]=await Promise.all([fetch("/api/combos"),fetch("/api/providers"),fetch("/api/combos/metrics"),fetch("/api/provider-nodes")]),r=await e.json(),l=await t.json(),n=await a.json(),o=s.ok?await s.json():{nodes:[]};if(e.ok&&i(r.combos||[]),t.ok){let e=(l.connections||[]).filter(e=>"active"===e.testStatus||"success"===e.testStatus);f(e)}a.ok&&j(n.metrics||{}),_(o.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{m(!1)}},L=async t=>{try{let a=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(a.ok)await B(),p(!1),H(t.name?.trim()||""),R.success(e("comboCreated"));else{let t=await a.json();R.error(t.error?.message||t.error||e("failedCreate"))}}catch(t){R.error(e("errorCreating"))}},G=async(t,a)=>{try{let s=await fetch(`/api/combos/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(s.ok)await B(),b(null),R.success(e("comboUpdated"));else{let t=await s.json();R.error(t.error?.message||t.error||e("failedUpdate"))}}catch(t){R.error(e("errorUpdating"))}},I=async t=>{if(confirm(e("deleteConfirm")))try{(await fetch(`/api/combos/${t}`,{method:"DELETE"})).ok&&(i(a.filter(e=>e.id!==t)),R.success(e("comboDeleted")))}catch(t){R.error(e("errorDeleting"))}},W=async e=>{let t=e.name.replace(/-copy(-\d+)?$/,""),s=a.map(e=>e.name),r=`${t}-copy`,l=1;for(;s.includes(r);)l++,r=`${t}-copy-${l}`;let i={name:r,models:e.models,strategy:e.strategy||"priority",config:e.config||{}};await L(i)},Q=async t=>{$(t.name),N(null);try{let e=await fetch("/api/combos/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboName:t.name})}),a=await e.json();N(a)}catch(t){N({error:e("testFailed")}),R.error(e("testFailed"))}},Z=async t=>{let a=!1===t.isActive;i(e=>e.map(e=>e.id===t.id?{...e,isActive:a}:e));try{await fetch(`/api/combos/${t.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:a})})}catch(s){i(e=>e.map(e=>e.id===t.id?{...e,isActive:!a}:e)),R.error(e("failedToggle"))}};return c?(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsx)(l.Qv,{}),(0,s.jsx)(l.Qv,{})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold",children:e("title")}),(0,s.jsx)("p",{className:"text-sm text-text-muted mt-1",children:e("description")})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[!O&&(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:()=>{U(!0);try{globalThis.localStorage?.removeItem(u)}catch{}},children:y(e,"usageGuideShow","Show guide")}),(0,s.jsx)(l.$n,{icon:"add",onClick:()=>p(!0),children:e("createCombo")})]})]}),O&&(0,s.jsx)(w,{onHide:()=>U(!1),onHideForever:()=>{U(!1);try{globalThis.localStorage?.setItem(u,"1")}catch{}}}),F&&(0,s.jsx)(l.Zp,{padding:"sm",className:"border border-emerald-500/20 bg-emerald-500/[0.04] dark:bg-emerald-500/[0.08]",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-emerald-700 dark:text-emerald-300",children:y(e,"quickTestTitle",`Combo "${F}" ready to validate`)}),(0,s.jsx)("code",{className:"inline-block text-[11px] mt-0.5 px-1.5 py-0.5 rounded bg-emerald-500/15 text-emerald-700 dark:text-emerald-300",children:F}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:y(e,"quickTestDescription","Run a test now to confirm fallback and latency behavior.")})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(l.$n,{size:"sm",variant:"secondary",icon:"play_arrow",onClick:()=>{Q({name:F}),H("")},children:y(e,"testNow","Test now")}),(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:()=>H(""),children:t("close")})]})]})}),0===a.length?(0,s.jsx)(l.pp,{icon:"\uD83E\uDDE9",title:e("noCombosYet"),description:e("description"),actionLabel:e("createCombo"),onAction:()=>p(!0)}):(0,s.jsx)("div",{className:"flex flex-col gap-4",children:a.map(e=>(0,s.jsx)(T,{combo:e,metrics:v[e.name],providerNodes:q,copied:S,onCopy:M,onEdit:()=>b(e),onDelete:()=>I(e.id),onDuplicate:()=>W(e),onTest:()=>Q(e),testing:C===e.name,onProxy:()=>z(e),hasProxy:!!A?.combos?.[e.id],onToggle:()=>Z(e)},e.id))}),k&&(0,s.jsx)(l.aF,{isOpen:!!k,onClose:()=>{N(null),$(null)},title:e("testResults",{name:C}),children:(0,s.jsx)(D,{results:k})}),(0,s.jsx)(E,{isOpen:x,onClose:()=>p(!1),onSave:L,activeProviders:g,combo:null},"create"),(0,s.jsx)(E,{isOpen:!!h,combo:h,onClose:()=>b(null),onSave:e=>G(h.id,e),activeProviders:g},h?.id||"new"),P&&(0,s.jsx)(l.KN,{isOpen:!!P,onClose:()=>z(null),level:"combo",levelId:P.id,levelLabel:P.name})]})}function w({onHide:e,onHideForever:t}){let a=(0,d.c)("combos");return(0,s.jsxs)(l.Zp,{padding:"sm",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,s.jsx)("div",{className:"size-7 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-primary text-[16px]",children:"tips_and_updates"})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold",children:a("routingStrategy")}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:a("description")})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:e,className:"!h-6 px-2 text-[10px]",children:y(a,"usageGuideHide","Hide")}),(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:t,className:"!h-6 px-2 text-[10px]",children:y(a,"usageGuideDontShowAgain","Don't show again")})]})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2 mt-3",children:["priority","cost-optimized","least-used"].map(e=>{let t=b(e);return(0,s.jsxs)("div",{className:"rounded-lg border border-black/10 dark:border-white/10 bg-black/[0.02] dark:bg-white/[0.02] p-2.5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] text-primary",children:t.icon}),(0,s.jsx)("span",{className:"text-xs font-medium",children:g(a,e)})]}),(0,s.jsx)("p",{className:"text-[11px] leading-4 text-text-muted mt-1.5",children:f(a,e)})]},e)})})]})}function C({strategy:e}){let t=(0,d.c)("combos");return(0,s.jsxs)("div",{className:"rounded-lg border border-black/10 dark:border-white/10 bg-black/[0.02] dark:bg-white/[0.02] p-2.5",children:[(0,s.jsx)("div",{className:"text-[11px] text-text-muted",children:y(t,"strategyGuideTitle","How to use this strategy")}),(0,s.jsxs)("div",{className:"mt-1.5 flex flex-col gap-1.5 text-[11px]",children:[(0,s.jsxs)("p",{className:"text-text-main",children:[(0,s.jsxs)("span",{className:"font-semibold",children:[y(t,"strategyGuideWhen","When to use"),":"]})," ",v(t,e,"when")]}),(0,s.jsxs)("p",{className:"text-text-main",children:[(0,s.jsxs)("span",{className:"font-semibold",children:[y(t,"strategyGuideAvoid","Avoid when"),":"]})," ",v(t,e,"avoid")]}),(0,s.jsxs)("p",{className:"text-text-main",children:[(0,s.jsxs)("span",{className:"font-semibold",children:[y(t,"strategyGuideExample","Example"),":"]})," ",v(t,e,"example")]})]})]})}function $({strategy:e,onApply:t,showNudge:a}){let r=(0,d.c)("combos"),i=g(r,e),n=j(r,e,"title"),o=j(r,e,"description"),c=j(r,e,"tips");return(0,s.jsxs)("div",{className:"rounded-lg border border-black/10 dark:border-white/10 bg-white/70 dark:bg-white/[0.02] p-2.5",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:y(r,"recommendationsLabel","Recommended setup")}),(0,s.jsxs)("p",{className:"text-xs font-semibold text-text-main mt-0.5",children:[n," \xb7 ",(0,s.jsx)("span",{className:"text-primary",children:i})]}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:o})]}),(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:t,className:"!h-6 px-2 text-[10px]",children:y(r,"applyRecommendations","Apply recommendations")})]}),(0,s.jsx)("div",{className:"mt-2 grid grid-cols-1 gap-1",children:c.map((t,a)=>(0,s.jsxs)("div",{className:"flex items-start gap-1 rounded-md bg-black/[0.02] dark:bg-white/[0.03] px-1.5 py-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px] text-primary mt-0.5",children:"check"}),(0,s.jsx)("p",{className:"text-[10px] text-text-main",children:t})]},`${e}-tip-${a+1}`))}),a&&(0,s.jsx)("div",{"data-testid":"strategy-change-nudge",className:"mt-2 rounded-md border border-primary/20 bg-primary/10 px-2 py-1 text-[10px] text-primary",children:y(r,"recommendationsUpdated","Recommendations updated for {strategy}.").replace("{strategy}",i)})]})}function S({label:e,help:t}){return(0,s.jsxs)("div",{className:"flex items-center gap-1 mb-0.5",children:[(0,s.jsx)("label",{className:"text-[10px] text-text-muted",children:e}),(0,s.jsx)(i,{content:t,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px] text-text-muted cursor-help",children:"help"})})]})}function M({checks:e,blockers:t}){let a=(0,d.c)("combos"),r=t.length>0;return(0,s.jsxs)("div",{"data-testid":"combo-readiness-panel",className:`rounded-lg border px-2.5 py-2 ${r?"border-amber-500/30 bg-amber-500/5":"border-emerald-500/20 bg-emerald-500/[0.04]"}`,children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px] ${r?"text-amber-600 dark:text-amber-400":"text-emerald-600 dark:text-emerald-400"}`,children:r?"rule":"check_circle"}),(0,s.jsx)("p",{className:"text-[11px] font-medium text-text-main",children:y(a,"readinessTitle","Ready to save?")})]}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:y(a,"readinessDescription","Review the checklist before creating or updating this combo.")}),(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-1 mt-2",children:e.map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-1 rounded-md px-1.5 py-1 bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[12px] ${e.ok?"text-emerald-500":"text-amber-500"}`,children:e.ok?"task_alt":"pending"}),(0,s.jsx)("span",{className:"text-[10px] text-text-main",children:e.label})]},e.id))}),r&&(0,s.jsxs)("div",{"data-testid":"combo-save-blockers",className:"mt-2 rounded-md border border-amber-500/30 bg-amber-500/10 px-2 py-1.5",children:[(0,s.jsx)("p",{className:"text-[10px] font-medium text-amber-700 dark:text-amber-300",children:y(a,"saveBlockedTitle","Save is blocked until the following items are fixed:")}),(0,s.jsx)("div",{className:"mt-1 flex flex-col gap-0.5",children:t.map((e,t)=>(0,s.jsxs)("p",{className:"text-[10px] text-amber-700 dark:text-amber-300",children:["• ",e]},`${e}-${t}`))})]})]})}function T({combo:e,metrics:t,copied:a,onCopy:r,onEdit:n,onDelete:o,onDuplicate:c,onTest:m,testing:x,onProxy:p,hasProxy:u,onToggle:h,providerNodes:b}){let y=e.strategy||"priority",v=e.models||[],j=!1===e.isActive,N=(0,d.c)("combos"),w=(0,d.c)("common"),C=f(N,y);return(0,s.jsx)(l.Zp,{padding:"sm",className:`group ${j?"opacity-50":""}`,children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,s.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("code",{className:"text-sm font-medium font-mono truncate",children:e.name}),(0,s.jsx)(i,{content:C,children:(0,s.jsx)("span",{className:`text-[9px] uppercase font-semibold px-1.5 py-0.5 rounded-full ${"weighted"===y?"bg-amber-500/15 text-amber-600 dark:text-amber-400":"round-robin"===y?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":"random"===y?"bg-purple-500/15 text-purple-600 dark:text-purple-400":"least-used"===y?"bg-cyan-500/15 text-cyan-600 dark:text-cyan-400":"cost-optimized"===y?"bg-teal-500/15 text-teal-600 dark:text-teal-400":"bg-blue-500/15 text-blue-600 dark:text-blue-400"}`,children:g(N,y)})}),u&&(0,s.jsxs)("span",{className:"text-[9px] uppercase font-semibold px-1.5 py-0.5 rounded-full bg-primary/15 text-primary flex items-center gap-0.5",title:N("proxyConfigured"),children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"vpn_lock"}),"proxy"]}),(0,s.jsx)("button",{onClick:t=>{t.stopPropagation(),r(e.name,`combo-${e.id}`)},className:"p-0.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors opacity-100 md:opacity-0 md:group-hover:opacity-100",title:N("copyComboName"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:a===`combo-${e.id}`?"check":"content_copy"})})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[0===v.length?(0,s.jsx)("span",{className:"text-xs text-text-muted italic",children:N("noModels")}):v.slice(0,3).map((e,t)=>{let{model:a,weight:r}=k(e);return(0,s.jsxs)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1.5 py-0.5 rounded text-text-muted",children:[(e=>{let t=e.split("/");if(2!==t.length)return e;let[a,s]=t,r=(b||[]).find(e=>e.id===a||e.prefix===a);return r?`${r.name}/${s}`:e})(a),"weighted"===y&&r>0?` (${r}%)`:""]},t)}),v.length>3&&(0,s.jsx)("span",{className:"text-[10px] text-text-muted",children:N("more",{count:v.length-3})})]}),t&&(0,s.jsxs)("div",{className:"flex items-center gap-3 mt-1",children:[(0,s.jsxs)("span",{className:"text-[10px] text-text-muted",children:[(0,s.jsx)("span",{className:"text-emerald-500",children:t.totalSuccesses}),"/",t.totalRequests," ",N("reqs")]}),(0,s.jsxs)("span",{className:"text-[10px] text-text-muted",children:[t.successRate,"% ",N("success")]}),(0,s.jsxs)("span",{className:"text-[10px] text-text-muted",children:["~",t.avgLatencyMs,"ms"]}),t.fallbackRate>0&&(0,s.jsxs)("span",{className:"text-[10px] text-amber-500",children:[t.fallbackRate,"% fallback"]})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0 ml-2",children:[(0,s.jsx)(l.lM,{size:"sm",checked:!j,onChange:h,title:N(j?"enableCombo":"disableCombo")}),(0,s.jsxs)("div",{className:"flex items-center gap-1 transition-opacity",children:[(0,s.jsx)("button",{onClick:m,disabled:x,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-emerald-500 transition-colors",title:N("testCombo"),children:(0,s.jsx)("span",{className:`material-symbols-outlined text-[16px] ${x?"animate-spin":""}`,children:x?"progress_activity":"play_arrow"})}),(0,s.jsx)("button",{onClick:c,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:N("duplicate"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"content_copy"})}),(0,s.jsx)("button",{onClick:p,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:N("proxyConfig"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"vpn_lock"})}),(0,s.jsx)("button",{onClick:n,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:w("edit"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})}),(0,s.jsx)("button",{onClick:o,className:"p-1.5 hover:bg-red-500/10 rounded text-red-500 transition-colors",title:w("delete"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})]})]})})}function D({results:e}){return e.error?(0,s.jsxs)("div",{className:"flex items-center gap-2 text-red-500 text-sm",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"error"}),"string"==typeof e.error?e.error:JSON.stringify(e.error)]}):(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[e.resolvedBy&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-emerald-500 text-[18px]",children:"check_circle"}),(0,s.jsxs)("span",{children:["Resolved by:"," ",(0,s.jsx)("code",{className:"text-xs bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 px-1.5 py-0.5 rounded",children:e.resolvedBy})]})]}),e.results?.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs px-2 py-1.5 rounded bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px] ${"ok"===e.status?"text-emerald-500":"skipped"===e.status?"text-text-muted":"text-red-500"}`,children:"ok"===e.status?"check_circle":"skipped"===e.status?"skip_next":"error"}),(0,s.jsx)("code",{className:"font-mono flex-1",children:e.model}),void 0!==e.latencyMs&&(0,s.jsxs)("span",{className:"text-text-muted",children:[e.latencyMs,"ms"]}),(0,s.jsx)("span",{className:`text-[10px] uppercase font-medium ${"ok"===e.status?"text-emerald-500":"skipped"===e.status?"text-text-muted":"text-red-500"}`,children:e.status})]},t))]})}function E({isOpen:e,combo:t,onClose:a,onSave:n,activeProviders:x}){let p=(0,d.c)("combos"),u=(0,d.c)("common"),b=(0,o.i)(),[v,j]=(0,r.useState)(t?.name||""),[N,w]=(0,r.useState)(()=>(t?.models||[]).map(e=>k(e))),[T,D]=(0,r.useState)(t?.strategy||"priority"),[E,P]=(0,r.useState)(!1),[z,A]=(0,r.useState)(!1),[K,q]=(0,r.useState)(""),[_,O]=(0,r.useState)({}),[U,F]=(0,r.useState)({}),[H,B]=(0,r.useState)([]),[L,G]=(0,r.useState)(!1),[I,W]=(0,r.useState)(t?.config||{}),[Q,Z]=(0,r.useState)(!1),J=(0,r.useRef)(!1),Y=(0,r.useCallback)(e=>{let t=e.split("/");if(2!==t.length)return!1;let[a,s]=t,r=H.find(e=>e.id===a||e.prefix===a),l=[a];return r?.apiType&&l.push(r.apiType),r?.name&&l.push(String(r.name).toLowerCase()),l.some(e=>!!_?.[e]?.[s])},[_,H]),[V,X]=(0,r.useState)(null),[ee,et]=(0,r.useState)(null),ea=N.reduce((e,t)=>e+(t.weight||0),0),es=N.reduce((e,t)=>e+ +!!Y(t.model),0),er=N.length>0?Math.round(es/N.length*100):0,el=0===N.length,ei="round-robin"===T&&1===N.length,en="cost-optimized"===T&&N.length>0&&0===es,eo="cost-optimized"===T&&N.length>0&&es>0&&es<N.length,ed="weighted"===T&&N.length>0&&100!==ea,ec=!v.trim()||!!K||z||el||ed||en,em=[{id:"name",ok:!!v.trim()&&!K,label:y(p,"readinessCheckName","Combo name is valid")},{id:"models",ok:!el,label:y(p,"readinessCheckModels","At least one model is selected")},{id:"weights",ok:"weighted"!==T||!ed,label:"weighted"===T?y(p,"readinessCheckWeights","Weighted total is 100%"):y(p,"readinessCheckWeightsOptional","Weight rule not required")},{id:"pricing",ok:"cost-optimized"!==T||!en,label:"cost-optimized"===T?y(p,"readinessCheckPricing","Pricing data is available"):y(p,"readinessCheckPricingOptional","Pricing rule not required")}],ex=[];v.trim()?K&&ex.push(K):ex.push(y(p,"saveBlockName","Define a combo name.")),el&&ex.push(y(p,"saveBlockModels","Add at least one model.")),ed&&ex.push("function"==typeof p.has&&p.has("saveBlockWeighted")?p("saveBlockWeighted",{total:ea}):`Set weights to 100% (current: ${ea}%).`),en&&ex.push(y(p,"saveBlockPricing","Add pricing for at least one model or choose a different strategy."));let ep=async()=>{try{let[e,t,a]=await Promise.all([fetch("/api/models/alias"),fetch("/api/provider-nodes"),fetch("/api/pricing")]);if(!e.ok||!t.ok)throw Error(`Failed to fetch data: aliases=${e.status}, nodes=${t.status}`);let s=a.ok?await a.json():{},[r,l]=await Promise.all([e.json(),t.json()]);O(s&&"object"==typeof s&&!Array.isArray(s)?s:{}),F(r.aliases||{}),B(l.nodes||[])}catch(e){console.error("Error fetching modal data:",e)}};(0,r.useEffect)(()=>{e&&ep()},[e]),(0,r.useEffect)(()=>{if(!J.current){J.current=!0;return}Z(!0);let e=setTimeout(()=>Z(!1),2600);return()=>clearTimeout(e)},[T]);let eu=e=>e.trim()?c.test(e)?(q(""),!0):(q(p("nameInvalid")),!1):(q(p("nameRequired")),!1),eh=()=>{let e=N.length;if(0===e)return;let t=Math.floor(100/e),a=100-t*e;w(N.map((e,s)=>({...e,weight:t+(0===s?a:0)})))},eb=(0,r.useCallback)(e=>{let t=e.split("/");if(2!==t.length)return e;let[a,s]=t,r=H.find(e=>e.id===a||e.prefix===a);return r?`${r.name}/${s}`:e},[H]),eg=e=>{e.target&&(e.currentTarget.style.opacity="1"),X(null),et(null)},ef=async()=>{if(!eu(v)||el||ed||en)return;A(!0);let e={name:v.trim(),models:"weighted"===T?N:N.map(e=>e.model),strategy:T},t={...I};"round-robin"===T&&(void 0!==I.concurrencyPerModel&&(t.concurrencyPerModel=I.concurrencyPerModel),void 0!==I.queueTimeoutMs&&(t.queueTimeoutMs=I.queueTimeoutMs)),Object.keys(t).length>0&&(e.config=t),await n(e),A(!1)},ey=!!t;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.aF,{isOpen:e,onClose:a,title:ey?p("editCombo"):p("createCombo"),children:(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(l.pd,{label:p("comboName"),value:v,onChange:e=>{let t=e.target.value;j(t),t?eu(t):q("")},placeholder:p("comboNamePlaceholder"),error:K}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:p("nameHint")})]}),!ey&&(0,s.jsxs)("div",{className:"rounded-lg border border-black/8 dark:border-white/8 bg-black/[0.02] dark:bg-white/[0.02] p-3",children:[(0,s.jsxs)("div",{className:"mb-2",children:[(0,s.jsx)("p",{className:"text-xs font-medium",children:y(p,"templatesTitle","Quick templates")}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:y(p,"templatesDescription","Apply a starting profile, then adjust models and config.")})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 mt-1",children:h.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>{D(e.strategy),W(t=>({...t,...e.config})),v.trim()||j(e.suggestedName)},className:`text-left rounded-md border px-3 py-2 transition-all ${e.isFeatured?"border-emerald-500/50 bg-emerald-500/5 hover:border-emerald-500/80 hover:bg-emerald-500/10 ring-1 ring-emerald-500/20":"border-black/10 dark:border-white/10 bg-white/70 dark:bg-white/[0.03] hover:border-primary/40 hover:bg-primary/5"}`,children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[16px] ${e.isFeatured?"text-emerald-500":"text-primary"}`,children:e.icon}),(0,s.jsx)("span",{className:"text-[12px] font-semibold text-text-main",children:y(p,e.titleKey,e.fallbackTitle)}),e.isFeatured&&(0,s.jsx)("span",{className:"ml-auto text-[9px] font-bold uppercase tracking-wide bg-emerald-500/20 text-emerald-600 dark:text-emerald-400 px-1.5 py-0.5 rounded",children:"FREE"})]}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-1.5 leading-[1.5]",children:y(p,e.descKey,e.fallbackDesc)}),(0,s.jsxs)("p",{className:`text-[10px] mt-1.5 font-medium ${e.isFeatured?"text-emerald-500":"text-primary"}`,children:[y(p,"templateApply","Apply template")," →"]})]},e.id))})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-1 mb-1.5",children:[(0,s.jsx)("label",{className:"text-sm font-medium",children:p("routingStrategy")}),(0,s.jsx)(i,{content:f(p,T),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px] text-text-muted cursor-help",children:"help"})})]}),(0,s.jsx)("div",{className:"grid grid-cols-3 gap-1 p-0.5 bg-black/5 dark:bg-white/5 rounded-lg",children:m.map(e=>(0,s.jsxs)("button",{onClick:()=>D(e.value),"data-testid":`strategy-option-${e.value}`,title:p(e.descKey),"aria-label":`${g(p,e.value)}. ${p(e.descKey)}`,className:`py-1.5 px-2 rounded-md text-xs font-medium transition-all ${T===e.value?"bg-white dark:bg-bg-main shadow-sm text-primary":"text-text-muted hover:text-text-main"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] align-middle mr-0.5",children:e.icon}),g(p,e.value)]},e.value))}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:f(p,T)}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(C,{strategy:T})}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)($,{strategy:T,onApply:()=>{let e={priority:{maxRetries:2,retryDelayMs:1500,healthCheckEnabled:!0},weighted:{maxRetries:1,retryDelayMs:1e3,healthCheckEnabled:!0},"round-robin":{maxRetries:1,retryDelayMs:750,healthCheckEnabled:!0,concurrencyPerModel:3,queueTimeoutMs:3e4},random:{maxRetries:1,retryDelayMs:1e3,healthCheckEnabled:!0},"least-used":{maxRetries:1,retryDelayMs:1e3,healthCheckEnabled:!0},"cost-optimized":{maxRetries:1,retryDelayMs:500,healthCheckEnabled:!0}},t=e[T]||e.priority;W(e=>{let a={...e};for(let[e,s]of Object.entries(t))(void 0===a[e]||null===a[e]||""===a[e])&&(a[e]=s);return a}),"weighted"===T&&N.length>1&&eh(),"round-robin"===T&&G(!0),b.success(y(p,"recommendationsApplied","Recommendations applied to this combo."))},showNudge:Q})})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,s.jsx)("label",{className:"text-sm font-medium",children:p("models")}),"weighted"===T&&N.length>1&&(0,s.jsx)("button",{onClick:eh,className:"text-[10px] text-primary hover:text-primary/80 transition-colors",children:p("autoBalance")})]}),0===N.length?(0,s.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:p("noModelsYet")})]}):(0,s.jsx)("div",{className:"flex flex-col gap-1 max-h-[240px] overflow-y-auto",children:N.map((e,t)=>(0,s.jsxs)("div",{draggable:!0,onDragStart:e=>{X(t),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",t.toString()),e.target&&setTimeout(()=>e.currentTarget.style.opacity="0.5",0)},onDragEnd:eg,onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="move",et(t)},onDrop:e=>((e,t)=>{if(e.preventDefault(),null===V||V===t)return;let a=[...N],[s]=a.splice(V,1);a.splice(t,0,s),w(a),X(null),et(null)})(e,t),className:`group/item flex items-center gap-1.5 px-2 py-1.5 rounded-md transition-all cursor-grab active:cursor-grabbing ${ee===t&&V!==t?"bg-primary/10 border border-primary/30":"bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] border border-transparent"} ${V===t?"opacity-50":""}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted/40 cursor-grab shrink-0",children:"drag_indicator"}),(0,s.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:t+1}),(0,s.jsx)("div",{className:"flex-1 min-w-0 px-1 text-xs text-text-main truncate",children:eb(e.model)}),"cost-optimized"===T&&(0,s.jsx)("span",{className:`text-[9px] px-1.5 py-0.5 rounded-full uppercase font-semibold ${Y(e.model)?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":"bg-amber-500/15 text-amber-600 dark:text-amber-400"}`,title:Y(e.model)?y(p,"pricingAvailable","Pricing available"):y(p,"pricingMissing","No pricing"),children:Y(e.model)?y(p,"pricingAvailableShort","priced"):y(p,"pricingMissingShort","no-price")}),"weighted"===T&&(0,s.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0",children:[(0,s.jsx)("input",{type:"number",min:"0",max:"100",value:e.weight,onChange:e=>{var a;let s;return a=e.target.value,void((s=[...N])[t]={...s[t],weight:Math.max(0,Math.min(100,Number(a)||0))},w(s))},className:"w-10 text-[11px] text-center py-0.5 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"}),(0,s.jsx)("span",{className:"text-[10px] text-text-muted",children:"%"})]}),"priority"===T&&(0,s.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,s.jsx)("button",{onClick:()=>(e=>{if(0===e)return;let t=[...N];[t[e-1],t[e]]=[t[e],t[e-1]],w(t)})(t),disabled:0===t,className:`p-0.5 rounded ${0===t?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:p("moveUp"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,s.jsx)("button",{onClick:()=>(e=>{if(e===N.length-1)return;let t=[...N];[t[e],t[e+1]]=[t[e+1],t[e]],w(t)})(t),disabled:t===N.length-1,className:`p-0.5 rounded ${t===N.length-1?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:p("moveDown"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,s.jsx)("button",{onClick:()=>{w(N.filter((e,a)=>a!==t))},className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:p("removeModel"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},`${e.model}-${t}`))}),"weighted"===T&&N.length>0&&(0,s.jsx)(R,{models:N}),"cost-optimized"===T&&N.length>0&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-black/10 dark:border-white/10 bg-black/[0.02] dark:bg-white/[0.02] px-2 py-1.5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-[10px]",children:[(0,s.jsx)("span",{className:"text-text-muted",children:y(p,"pricingCoverage","Pricing coverage")}),(0,s.jsxs)("span",{className:"font-medium text-text-main",children:[es,"/",N.length," (",er,"%)"]})]}),(0,s.jsx)("div",{className:"h-1.5 mt-1 rounded-full bg-black/10 dark:bg-white/10 overflow-hidden",children:(0,s.jsx)("div",{className:`h-full transition-all duration-300 ${100===er?"bg-emerald-500":er>0?"bg-amber-500":"bg-red-500"}`,style:{width:`${er}%`}})}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-1",children:y(p,"pricingCoverageHint","Cost-optimized works best when all combo models have pricing.")})]}),el&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-amber-500/20 bg-amber-500/10 px-2 py-1.5 text-[10px] text-amber-700 dark:text-amber-300 flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"warning"}),(0,s.jsx)("span",{children:p("noModelsYet")})]}),ed&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-amber-500/20 bg-amber-500/10 px-2 py-1.5 text-[10px] text-amber-700 dark:text-amber-300 flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"warning"}),(0,s.jsxs)("span",{children:[p("weighted")," ",ea,"% ","≠"," 100%. ",p("autoBalance")]})]}),ei&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-blue-500/20 bg-blue-500/10 px-2 py-1.5 text-[10px] text-blue-700 dark:text-blue-300 flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"info"}),(0,s.jsx)("span",{children:y(p,"warningRoundRobinSingleModel","Round-robin is most useful with at least 2 models.")})]}),eo&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-amber-500/20 bg-amber-500/10 px-2 py-1.5 text-[10px] text-amber-700 dark:text-amber-300 flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"warning"}),(0,s.jsx)("span",{children:"function"==typeof p.has&&p.has("warningCostOptimizedPartialPricing")?p("warningCostOptimizedPartialPricing",{priced:es,total:N.length}):`Only ${es} of ${N.length} models have pricing. Routing may be partially cost-aware.`})]}),en&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-amber-500/20 bg-amber-500/10 px-2 py-1.5 text-[10px] text-amber-700 dark:text-amber-300 flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"warning"}),(0,s.jsx)("span",{children:y(p,"warningCostOptimizedNoPricing","No pricing data found for this combo. Cost-optimized may route unexpectedly.")})]}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(M,{checks:em,blockers:ex})}),(0,s.jsxs)("button",{onClick:()=>P(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-text-muted hover:text-primary hover:border-primary/30 transition-colors flex items-center justify-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),p("addModel")]})]}),(0,s.jsxs)("button",{onClick:()=>G(!L),className:"flex items-center gap-1 text-xs text-text-muted hover:text-text-main transition-colors self-start",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:L?"expand_less":"expand_more"}),p("advancedSettings")]}),L&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 p-3 bg-black/[0.02] dark:bg-white/[0.02] rounded-lg border border-black/5 dark:border-white/5",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(S,{label:p("maxRetries"),help:y(p,"advancedHelp.maxRetries","How many retries are attempted before failing the request.")}),(0,s.jsx)("input",{type:"number",min:"0",max:"10",value:I.maxRetries??"",placeholder:"1",onChange:e=>W({...I,maxRetries:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(S,{label:p("retryDelay"),help:y(p,"advancedHelp.retryDelay","Initial delay between retries. Higher values reduce burst pressure.")}),(0,s.jsx)("input",{type:"number",min:"0",max:"60000",step:"500",value:I.retryDelayMs??"",placeholder:"2000",onChange:e=>W({...I,retryDelayMs:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(S,{label:p("timeout"),help:y(p,"advancedHelp.timeout","Maximum request time before aborting. Set higher for long generations.")}),(0,s.jsx)("input",{type:"number",min:"1000",max:"600000",step:"1000",value:I.timeoutMs??"",placeholder:"120000",onChange:e=>W({...I,timeoutMs:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)(S,{label:p("healthcheck"),help:y(p,"advancedHelp.healthcheck","Skips unhealthy models/providers from routing decisions when enabled.")}),(0,s.jsx)("input",{type:"checkbox",checked:!1!==I.healthCheckEnabled,onChange:e=>W({...I,healthCheckEnabled:e.target.checked}),className:"accent-primary"})]})]}),"round-robin"===T&&(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2 pt-2 border-t border-black/5 dark:border-white/5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(S,{label:p("concurrencyPerModel"),help:y(p,"advancedHelp.concurrencyPerModel","Max simultaneous requests sent to each model in round-robin.")}),(0,s.jsx)("input",{type:"number",min:"1",max:"20",value:I.concurrencyPerModel??"",placeholder:"3",onChange:e=>W({...I,concurrencyPerModel:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(S,{label:p("queueTimeout"),help:y(p,"advancedHelp.queueTimeout","How long a request can wait in queue before timeout in round-robin.")}),(0,s.jsx)("input",{type:"number",min:"1000",max:"120000",step:"1000",value:I.queueTimeoutMs??"",placeholder:"30000",onChange:e=>W({...I,queueTimeoutMs:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]})]}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted",children:p("advancedHint")})]}),(0,s.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,s.jsx)(l.$n,{onClick:a,variant:"ghost",fullWidth:!0,size:"sm",children:u("cancel")}),(0,s.jsx)(l.$n,{onClick:ef,fullWidth:!0,size:"sm",disabled:ec,children:z?p("saving"):ey?u("save"):p("createCombo")})]})]})}),(0,s.jsx)(l.rq,{isOpen:E,onClose:()=>P(!1),onSelect:e=>{N.find(t=>t.model===e.value)||w([...N,{model:e.value,weight:0}])},activeProviders:x,modelAliases:U,title:p("addModelToCombo"),selectedModel:null})]})}function R({models:e}){let t=e.reduce((e,t)=>e+(t.weight||0),0),a=100===t,r=["bg-blue-500","bg-emerald-500","bg-amber-500","bg-purple-500","bg-rose-500","bg-cyan-500","bg-orange-500","bg-indigo-500"];return(0,s.jsxs)("div",{className:"mt-1.5",children:[(0,s.jsx)("div",{className:"h-1.5 rounded-full bg-black/5 dark:bg-white/5 overflow-hidden flex",children:e.map((e,t)=>e.weight?(0,s.jsx)("div",{className:`${r[t%r.length]} transition-all duration-300`,style:{width:`${Math.min(e.weight,100)}%`}},t):null)}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,s.jsx)("div",{className:"flex gap-1",children:e.map((e,t)=>e.weight>0&&(0,s.jsxs)("span",{className:"flex items-center gap-0.5 text-[9px] text-text-muted",children:[(0,s.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${r[t%r.length]}`}),e.weight,"%"]},t))}),(0,s.jsxs)("span",{className:`text-[10px] font-medium ${a?"text-emerald-500":t>100?"text-red-500":"text-amber-500"}`,children:[t,"%",!a&&t>0&&" ≠ 100%"]})]})]})}}},e=>{e.O(0,[8500,3418,9751,8055,1149,5846,647,8441,3794,7358],()=>e(e.s=93062)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8013],{40993:(e,t,r)=>{"use strict";r.d(t,{Ex:()=>i.default,$n:()=>l.default,Zp:()=>s.default,Qv:()=>c.CardSkeleton,G9:()=>f.default,bQ:()=>w.default,pp:()=>j.default,Qn:()=>N.default,pd:()=>a.default,Mh:()=>v.default,uR:()=>m.default,aF:()=>n.default,rq:()=>u.default,LF:()=>x.default,KN:()=>g.default,Lo:()=>h.default,y7:()=>b.default,Iz:()=>y.default,l6:()=>o.default,lM:()=>d.default,cn:()=>p.default});var l=r(35806),a=r(34422),o=r(42994),s=r(81060),n=r(71361),c=r(92542);r(17705);var i=r(80927),d=r(19790);r(6261),r(55846),r(34243),r(89938),r(99023);var x=r(80178),u=r(85444),m=r(91961);r(25112);var p=r(45624),b=r(37415),g=r(48643),h=r(8287);r(1652);var v=r(92701);r(18150);var f=r(71689),y=r(33709);r(76332);var j=r(66200);r(61580);var N=r(51503);r(54128);var w=r(44638);r(21720),r(97050)},56646:(e,t,r)=>{Promise.resolve().then(r.bind(r,58802))},58802:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>x});var l=r(95155),a=r(12115),o=r(40993),s=r(50910);let n={debug:"text-gray-400",trace:"text-gray-500",info:"text-cyan-400",warn:"text-yellow-400",error:"text-red-400",fatal:"text-fuchsia-400"},c={debug:"bg-gray-500/10 border-gray-500/20",trace:"bg-gray-500/10 border-gray-500/20",info:"bg-cyan-500/10 border-cyan-500/20",warn:"bg-yellow-500/10 border-yellow-500/20",error:"bg-red-500/10 border-red-500/20",fatal:"bg-fuchsia-500/10 border-fuchsia-500/20"};function i(){let e=(0,s.c)("loggers"),[t,r]=(0,a.useState)([]),[o,i]=(0,a.useState)(!0),[d,x]=(0,a.useState)(null),[u,m]=(0,a.useState)("all"),[p,b]=(0,a.useState)(""),[g,h]=(0,a.useState)(!0),[v,f]=(0,a.useState)(null),[y,j]=(0,a.useState)(null),N=(0,a.useRef)(null),w=(0,a.useCallback)(async()=>{try{let e=new URLSearchParams;"all"!==u&&e.set("level",u),e.set("limit","500");let t=await fetch(`/api/logs/console?${e.toString()}`);if(!t.ok)throw Error(`HTTP ${t.status}`);let l=await t.json();r(l),f(new Date),x(null)}catch(e){x(e.message||"Failed to fetch logs")}finally{i(!1)}},[u]);(0,a.useEffect)(()=>{w();let e=setInterval(w,5e3);return()=>clearInterval(e)},[w]),(0,a.useEffect)(()=>{g&&N.current&&(N.current.scrollTop=N.current.scrollHeight)},[t,g]);let S=p?t.filter(e=>JSON.stringify(e).toLowerCase().includes(p.toLowerCase())):t;return(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-3 p-4 rounded-xl bg-[var(--color-surface)] border border-[var(--color-border)]",children:[(0,l.jsxs)("select",{value:u,onChange:e=>m(e.target.value),"aria-label":"Filter by log level",className:"px-3 py-2 rounded-lg text-sm bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] focus:outline-2 focus:outline-[var(--color-accent)]",children:[(0,l.jsx)("option",{value:"all",children:e("allLevels")}),(0,l.jsx)("option",{value:"debug",children:"Debug+"}),(0,l.jsx)("option",{value:"info",children:"Info+"}),(0,l.jsx)("option",{value:"warn",children:"Warn+"}),(0,l.jsx)("option",{value:"error",children:"Error+"})]}),(0,l.jsx)("input",{type:"text",placeholder:"Search logs...",value:p,onChange:e=>b(e.target.value),"aria-label":"Search log entries",className:"flex-1 min-w-[200px] px-3 py-2 rounded-lg text-sm bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] placeholder:text-[var(--color-text-muted)] focus:outline-2 focus:outline-[var(--color-accent)]"}),(0,l.jsxs)("button",{onClick:()=>h(!g),title:g?"Disable auto-scroll":"Enable auto-scroll",className:`px-3 py-2 rounded-lg text-sm font-medium border transition-colors ${g?"bg-cyan-500/15 text-cyan-400 border-cyan-500/30":"bg-[var(--color-bg)] text-[var(--color-text-muted)] border-[var(--color-border)]"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px] align-middle mr-1",children:g?"vertical_align_bottom":"lock"}),"Auto-scroll"]}),(0,l.jsx)("button",{onClick:w,disabled:o,className:"px-3 py-2 rounded-lg text-sm font-medium bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] disabled:opacity-50 transition-colors",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px] align-middle",children:"refresh"})}),(0,l.jsxs)("div",{className:"flex items-center gap-2 ml-auto text-xs text-[var(--color-text-muted)]",children:[(0,l.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500 animate-pulse"}),(0,l.jsxs)("span",{children:[S.length," entries"]}),(0,l.jsx)("span",{className:"text-[var(--color-text-muted)]/50",children:"•"}),(0,l.jsx)("span",{children:"Last 1h"}),v&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"text-[var(--color-text-muted)]/50",children:"•"}),(0,l.jsxs)("span",{children:["Updated ",v.toLocaleTimeString()]})]})]})]}),d&&(0,l.jsxs)("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",role:"alert",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px] align-middle mr-2",children:"error"}),d,(0,l.jsx)("span",{className:"text-xs ml-2 opacity-70",children:"— Make sure the application is writing logs to file (LOG_TO_FILE=true)"})]}),(0,l.jsxs)("div",{ref:N,className:"rounded-xl border border-[var(--color-border)] bg-[#0d1117] overflow-auto font-mono text-xs leading-relaxed",style:{maxHeight:"calc(100vh - 340px)",minHeight:"400px"},role:"log","aria-label":"Application console logs","aria-live":"polite",children:[(0,l.jsxs)("div",{className:"sticky top-0 z-10 px-4 py-2 bg-[#161b22] border-b border-[#30363d] flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56]"}),(0,l.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),(0,l.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F]"}),(0,l.jsx)("span",{className:"ml-3 text-[#8b949e] text-[11px]",children:"OmniRoute — Application Console"})]}),(0,l.jsxs)("div",{className:"p-3 space-y-px",children:[0!==S.length||o?S.map((e,t)=>{let r=(e.level||"info").toLowerCase(),a=n[r]||n.info,o=c[r]||"",s=e.component||e.module||"",i=e.msg||e.message||"";return(0,l.jsxs)("div",{className:`group flex items-start gap-2 px-2 py-1 rounded hover:bg-white/5 transition-colors ${"error"===r||"fatal"===r?"bg-red-500/5":""}`,children:[(0,l.jsx)("span",{className:"text-[#484f58] whitespace-nowrap shrink-0 select-none",children:(e=>{try{return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}catch{return e}})(e.timestamp)}),(0,l.jsx)("span",{className:`inline-block px-1.5 py-0 rounded text-[10px] font-semibold uppercase border shrink-0 ${a} ${o}`,children:r.padEnd(5)}),s&&(0,l.jsxs)("span",{className:"text-purple-400/80 shrink-0",children:["[",s,"]"]}),(0,l.jsxs)("span",{className:"text-[#c9d1d9] flex-1 break-all",children:[i,e.correlationId&&(0,l.jsxs)("span",{className:"text-[#484f58] ml-2",children:["cid:",e.correlationId.slice(0,8)]})]}),(0,l.jsx)("button",{onClick:()=>{let r;return r=JSON.stringify(e,null,2),void navigator.clipboard.writeText(r).then(()=>{j(t),setTimeout(()=>j(null),2e3)})},title:"Copy log entry",className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0 text-[#8b949e] hover:text-white",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:y===t?"check":"content_copy"})})]},t)}):(0,l.jsxs)("div",{className:"text-[#8b949e] text-center py-12",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[40px] block mb-2 opacity-30",children:"terminal"}),(0,l.jsx)("p",{children:e("noLogEntries")}),(0,l.jsx)("p",{className:"text-[10px] mt-1 opacity-60",children:"Ensure LOG_TO_FILE=true is set in your .env file"})]}),o&&0===S.length&&(0,l.jsxs)("div",{className:"text-[#8b949e] text-center py-12",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[24px] animate-spin block mb-2",children:"progress_activity"}),"Loading logs..."]})]})]})]})}function d(){let[e,t]=(0,a.useState)([]),[r,o]=(0,a.useState)(!0),[n,c]=(0,a.useState)(null),[i,d]=(0,a.useState)(""),[x,u]=(0,a.useState)(""),[m,p]=(0,a.useState)(0),[b,g]=(0,a.useState)(!1),h=(0,s.c)("logs"),v=(0,a.useCallback)(async()=>{o(!0),c(null);try{let e=new URLSearchParams;i&&e.set("action",i),x&&e.set("actor",x),e.set("limit",String(26)),e.set("offset",String(m));let r=await fetch(`/api/compliance/audit-log?${e.toString()}`);if(!r.ok)throw Error(h("failedFetchAuditLog"));let l=await r.json();g(l.length>25),t(l.slice(0,25))}catch(e){c(e.message||h("failedFetchAuditLog"))}finally{o(!1)}},[i,x,m,h]);(0,a.useEffect)(()=>{v()},[v]);let f=()=>{p(0),v()};return(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-xl font-bold text-[var(--color-text-main)]",children:h("auditLog")}),(0,l.jsx)("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:h("auditLogDesc")})]}),(0,l.jsx)("button",{onClick:v,disabled:r,"aria-label":h("refreshAuditLogAria"),className:"px-4 py-2 rounded-lg text-sm font-medium bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] transition-colors disabled:opacity-50",children:r?h("loading"):h("refresh")})]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-3 p-4 rounded-xl bg-[var(--color-surface)] border border-[var(--color-border)]",role:"search","aria-label":h("filterEntriesAria"),children:[(0,l.jsx)("input",{type:"text",placeholder:h("filterByAction"),value:i,onChange:e=>d(e.target.value),onKeyDown:e=>"Enter"===e.key&&f(),"aria-label":h("filterByActionTypeAria"),className:"flex-1 min-w-[180px] px-3 py-2 rounded-lg text-sm bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] placeholder:text-[var(--color-text-muted)] focus:outline-2 focus:outline-[var(--color-accent)]"}),(0,l.jsx)("input",{type:"text",placeholder:h("filterByActor"),value:x,onChange:e=>u(e.target.value),onKeyDown:e=>"Enter"===e.key&&f(),"aria-label":h("filterByActorAria"),className:"flex-1 min-w-[180px] px-3 py-2 rounded-lg text-sm bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] placeholder:text-[var(--color-text-muted)] focus:outline-2 focus:outline-[var(--color-accent)]"}),(0,l.jsx)("button",{onClick:f,className:"px-4 py-2 rounded-lg text-sm font-medium bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors focus:outline-2 focus:outline-offset-2 focus:outline-[var(--color-accent)]",children:h("search")})]}),n&&(0,l.jsx)("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",role:"alert",children:n}),(0,l.jsx)("div",{className:"overflow-x-auto rounded-xl border border-[var(--color-border)]",children:(0,l.jsxs)("table",{className:"w-full text-sm",role:"table","aria-label":h("tableAria"),children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"bg-[var(--color-bg-alt)] border-b border-[var(--color-border)]",children:[(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:h("timestamp")}),(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:h("action")}),(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:h("actor")}),(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:h("target")}),(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:h("details")}),(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:h("ipAddress")})]})}),(0,l.jsx)("tbody",{children:0!==e.length||r?e.map(e=>{var t;return(0,l.jsxs)("tr",{className:"border-b border-[var(--color-border)] hover:bg-[var(--color-bg-alt)] transition-colors",children:[(0,l.jsx)("td",{className:"px-4 py-3 whitespace-nowrap text-[var(--color-text-muted)] font-mono text-xs",children:(e=>{try{return new Date(e).toLocaleString()}catch{return e}})(e.timestamp)}),(0,l.jsx)("td",{className:"px-4 py-3",children:(0,l.jsx)("span",{className:`inline-block px-2 py-0.5 rounded-md text-xs font-medium border ${(t=e.action).includes("delete")||t.includes("remove")?"bg-red-500/15 text-red-400 border-red-500/20":t.includes("create")||t.includes("add")?"bg-green-500/15 text-green-400 border-green-500/20":t.includes("update")||t.includes("change")?"bg-blue-500/15 text-blue-400 border-blue-500/20":t.includes("login")||t.includes("auth")?"bg-purple-500/15 text-purple-400 border-purple-500/20":"bg-gray-500/15 text-gray-400 border-gray-500/20"}`,children:e.action})}),(0,l.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-main)]",children:e.actor}),(0,l.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-muted)] max-w-[200px] truncate",children:e.target||h("notAvailable")}),(0,l.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-muted)] max-w-[300px] truncate font-mono text-xs",children:e.details?JSON.stringify(e.details):h("notAvailable")}),(0,l.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-muted)] font-mono text-xs whitespace-nowrap",children:e.ip_address||h("notAvailable")})]},e.id)}):(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-[var(--color-text-muted)]",children:h("noEntries")})})})]})}),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("p",{className:"text-xs text-[var(--color-text-muted)]",children:h("showing",{count:e.length,offset:m})}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsxs)("button",{onClick:()=>p(Math.max(0,m-25)),disabled:0===m,className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] disabled:opacity-30 transition-colors",children:["← ",h("previous")]}),(0,l.jsxs)("button",{onClick:()=>p(m+25),disabled:!b,className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] disabled:opacity-30 transition-colors",children:[h("next")," →"]})]})]})]})}function x(){let[e,t]=(0,a.useState)("request-logs"),r=(0,s.c)("logs");return(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)(o.Iz,{options:[{value:"request-logs",label:r("requestLogs")},{value:"proxy-logs",label:r("proxyLogs")},{value:"audit-logs",label:r("auditLog")},{value:"console",label:r("console")}],value:e,onChange:t}),"request-logs"===e&&(0,l.jsx)(o.y7,{}),"proxy-logs"===e&&(0,l.jsx)(o.Lo,{}),"audit-logs"===e&&(0,l.jsx)(d,{}),"console"===e&&(0,l.jsx)(i,{})]})}}},e=>{e.O(0,[8500,3418,9751,8055,1149,5846,647,8441,3794,7358],()=>e(e.s=56646)),_N_E=e.O()}]);