zevairouter 1.1.78 → 1.1.80

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 (244) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/cli/app/.next-cli-build/BUILD_ID +1 -1
  3. package/cli/app/.next-cli-build/app-path-routes-manifest.json +24 -24
  4. package/cli/app/.next-cli-build/build-manifest.json +2 -2
  5. package/cli/app/.next-cli-build/prerender-manifest.json +3 -3
  6. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page_client-reference-manifest.js +1 -1
  7. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  8. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  9. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  10. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  11. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  12. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page_client-reference-manifest.js +1 -1
  13. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  14. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  15. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  16. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  17. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  18. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  19. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  20. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  21. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  22. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  23. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  24. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  25. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  26. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  27. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  28. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  29. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  30. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  31. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page_client-reference-manifest.js +1 -1
  32. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  33. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  34. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  35. package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  36. package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
  37. package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  38. package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  39. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  40. package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  41. package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  42. package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
  43. package/cli/app/.next-cli-build/server/app/_not-found.rsc +2 -2
  44. package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +2 -2
  45. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  46. package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  47. package/cli/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +5 -5
  48. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  49. package/cli/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  50. package/cli/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  51. package/cli/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js +2 -2
  52. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  53. package/cli/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  54. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  55. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  56. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  57. package/cli/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js +2 -2
  58. package/cli/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +3 -3
  59. package/cli/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +2 -2
  60. package/cli/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  61. package/cli/app/.next-cli-build/server/app/api/cli-tools/dsh-settings/route.js +1 -1
  62. package/cli/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js +2 -2
  63. package/cli/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
  64. package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
  65. package/cli/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  66. package/cli/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  67. package/cli/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js +2 -2
  68. package/cli/app/.next-cli-build/server/app/api/cli-tools/openbot-settings/route.js +3 -3
  69. package/cli/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
  70. package/cli/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  71. package/cli/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +2 -2
  72. package/cli/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js +2 -2
  73. package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
  74. package/cli/app/.next-cli-build/server/app/api/providers/opencode/discover-models/route.js +1 -1
  75. package/cli/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  76. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  77. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  78. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  79. package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
  80. package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  81. package/cli/app/.next-cli-build/server/app/callback.html +1 -1
  82. package/cli/app/.next-cli-build/server/app/callback.rsc +2 -2
  83. package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +2 -2
  84. package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  85. package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +2 -2
  86. package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
  87. package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +2 -2
  88. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +2 -2
  89. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +2 -2
  90. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +1 -1
  91. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  92. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +2 -2
  93. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  94. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +2 -2
  95. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  96. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  97. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +3 -3
  98. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +3 -3
  99. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +3 -3
  100. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  101. package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  102. package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +2 -2
  103. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  104. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +2 -2
  105. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  106. package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
  107. package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +2 -2
  108. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +2 -2
  109. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +2 -2
  110. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +1 -1
  111. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  112. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +2 -2
  113. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  114. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +2 -2
  115. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  116. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  117. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +2 -2
  118. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  119. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +2 -2
  120. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  121. package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  122. package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +3 -3
  123. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +3 -3
  124. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +3 -3
  125. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  126. package/cli/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
  127. package/cli/app/.next-cli-build/server/app/dashboard/playground.rsc +2 -2
  128. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +2 -2
  129. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +2 -2
  130. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +1 -1
  131. package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  132. package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +2 -2
  133. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  134. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +2 -2
  135. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  136. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  137. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +2 -2
  138. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  139. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +2 -2
  140. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  141. package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  142. package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +2 -2
  143. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  144. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +2 -2
  145. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  146. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  147. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +2 -2
  148. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  149. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +2 -2
  150. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  151. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  152. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +2 -2
  153. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  154. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +2 -2
  155. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  156. package/cli/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  157. package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +2 -2
  158. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +2 -2
  159. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +2 -2
  160. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  161. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  162. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +2 -2
  163. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
  164. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +2 -2
  165. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  166. package/cli/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  167. package/cli/app/.next-cli-build/server/app/dashboard/skills.rsc +2 -2
  168. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  169. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +2 -2
  170. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  171. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  172. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.rsc +2 -2
  173. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  174. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +2 -2
  175. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  176. package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  177. package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +2 -2
  178. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  179. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +2 -2
  180. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  181. package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  182. package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +2 -2
  183. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  184. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +2 -2
  185. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  186. package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
  187. package/cli/app/.next-cli-build/server/app/dashboard.rsc +2 -2
  188. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  189. package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +2 -2
  190. package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  191. package/cli/app/.next-cli-build/server/app/index.html +1 -1
  192. package/cli/app/.next-cli-build/server/app/index.rsc +2 -2
  193. package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  194. package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +2 -2
  195. package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  196. package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  197. package/cli/app/.next-cli-build/server/app/landing.html +1 -1
  198. package/cli/app/.next-cli-build/server/app/landing.rsc +2 -2
  199. package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +2 -2
  200. package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  201. package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  202. package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  203. package/cli/app/.next-cli-build/server/app/login.html +1 -1
  204. package/cli/app/.next-cli-build/server/app/login.rsc +2 -2
  205. package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +2 -2
  206. package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  207. package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  208. package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  209. package/cli/app/.next-cli-build/server/app-paths-manifest.json +24 -24
  210. package/cli/app/.next-cli-build/server/chunks/1283.js +1 -1
  211. package/cli/app/.next-cli-build/server/chunks/1350.js +1 -1
  212. package/cli/app/.next-cli-build/server/chunks/1757.js +1 -1
  213. package/cli/app/.next-cli-build/server/chunks/1852.js +1 -1
  214. package/cli/app/.next-cli-build/server/chunks/267.js +1 -1
  215. package/cli/app/.next-cli-build/server/chunks/4549.js +1 -1
  216. package/cli/app/.next-cli-build/server/chunks/5626.js +1 -1
  217. package/cli/app/.next-cli-build/server/chunks/5744.js +1 -1
  218. package/cli/app/.next-cli-build/server/chunks/5819.js +1 -1
  219. package/cli/app/.next-cli-build/server/chunks/5905.js +3 -3
  220. package/cli/app/.next-cli-build/server/chunks/6166.js +1 -1
  221. package/cli/app/.next-cli-build/server/chunks/6396.js +1 -1
  222. package/cli/app/.next-cli-build/server/chunks/6936.js +1 -1
  223. package/cli/app/.next-cli-build/server/chunks/7135.js +1 -1
  224. package/cli/app/.next-cli-build/server/chunks/7319.js +6 -6
  225. package/cli/app/.next-cli-build/server/chunks/7364.js +1 -1
  226. package/cli/app/.next-cli-build/server/chunks/8972.js +1 -1
  227. package/cli/app/.next-cli-build/server/chunks/9548.js +1 -1
  228. package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  229. package/cli/app/.next-cli-build/server/pages/404.html +1 -1
  230. package/cli/app/.next-cli-build/server/pages/500.html +1 -1
  231. package/cli/app/.next-cli-build/server/preview-props.json +3 -3
  232. package/cli/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  233. package/cli/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  234. package/cli/app/.next-cli-build/static/chunks/620-0f6bd4f59fa0cd33.js +1 -0
  235. package/cli/app/.next-cli-build/static/chunks/{7001-67d0f2aa165b8767.js → 7001-da01aaca36365276.js} +8 -8
  236. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-c2b77eabb14f7642.js → page-936f29821afd7d28.js} +1 -1
  237. package/cli/app/CHANGELOG.md +13 -0
  238. package/cli/app/package.json +1 -1
  239. package/cli/app/src/mitm/server.js +1 -1
  240. package/cli/package.json +1 -1
  241. package/package.json +1 -1
  242. package/cli/app/.next-cli-build/static/chunks/620-11311598c4b9e95a.js +0 -1
  243. /package/cli/app/.next-cli-build/static/{BLnTNheSRSk8U0Uqmnbc4 → Vbe_S3ECwU1yAXUWqmRCl}/_buildManifest.js +0 -0
  244. /package/cli/app/.next-cli-build/static/{BLnTNheSRSk8U0Uqmnbc4 → Vbe_S3ECwU1yAXUWqmRCl}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";exports.id=6166,exports.ids=[6166],exports.modules={30869:(a,b,c)=>{c.d(b,{UY:()=>i,X3:()=>k,eh:()=>f.eh,fg:()=>e.fg,h0:()=>h,oc:()=>j,vQ:()=>g});var d=c(39006),e=c(17404),f=c(81329);let g={name:"ZevaiRouter",description:"AI Infrastructure Management",version:d.version},h={npmPackageName:"zevairouter",installCmd:"npm i -g zevairouter",installCmdLatest:"npm i -g zevairouter@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:1997},i={maxLines:200,pollIntervalMs:1e3},j={tickIntervalMs:6e4,pingLeadMs:5e3,refreshAheadMs:3e5,failureCooldownMs:9e5,providers:{claude:{settingsKey:"claudeAutoPing",quotaKey:"session (5h)",pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1},codex:{settingsKey:"codexAutoPing",quotaKey:"session",pingWhenResetAtSlides:!0,resetAtDriftMs:3e4,minPingIntervalMs:6e5,skipWhenBlockingQuotaExhausted:!0,pingModel:"gpt-5.5",pingText:"hi",pingInstructions:"Reply with OK.",pingReasoningEffort:"none"}}},k={openrouter:"https://openrouter.ai/api/v1/chat/completions",glm:"https://api.z.ai/api/anthropic/v1/messages","glm-cn":"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",kimi:"https://api.kimi.com/coding/v1/messages",minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages",alicode:"https://coding.dashscope.aliyuncs.com/v1/chat/completions","alicode-intl":"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions","volcengine-ark":"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",byteplus:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",openai:"https://api.openai.com/v1/chat/completions","vercel-ai-gateway":"https://ai-gateway.vercel.sh/v1/chat/completions",anthropic:"https://api.anthropic.com/v1/messages",gemini:"https://generativelanguage.googleapis.com/v1beta/models",ollama:"https://ollama.com/api/chat","ollama-local":"http://localhost:11434/api/chat"}},38238:(a,b,c)=>{c.d(b,{OU:()=>j,PL:()=>o,Yd:()=>i});var d=c(89718),e=c(17404),f=c(54098),g=c(30869),h=c(54603);function i(a,b){let c="string"==typeof b?b:b?JSON.stringify(b):"";for(let a=0;a<3;a++){let a=c.replace(/^\s*(?:HTTP\s+)?\[?\d{3}\]?\s*:\s*/i,""),b=a;try{let c=JSON.parse(a),d=c?.error?.message||c?.message||c?.error;"string"==typeof d&&d&&(b=d)}catch{}if(b===c)break;c=b}return c=c.trim(),`HTTP ${a}${c?`: ${c.slice(0,240)}`:""}`}async function j(a=null){let b=null;try{let a=await (0,d.PX)(!0);b=a.find(a=>!1!==a.isActive)?.key||null}catch{}let c={"Content-Type":"application/json"};return b&&(c.Authorization=`Bearer ${b}`),c["x-zevai-cli-token"]=await (0,h.Xj)("zevai-cli-auth"),a&&(c["x-zevai-connection-id"]=a),c}function k(a){return"string"==typeof a?a.trim():""}function l(a){return a&&"object"==typeof a?k(a.reasoning||a.reasoning_content||a.thinking||a.thinking_content):""}function m(){return{ok:!1,error:"Probe timed out before a usable response",status:408}}async function n(a,b){let c=a.body?.getReader?.();if(!c)return{ok:!1,error:"Provider stream ended without a usable response"};let d=new TextDecoder,e="",g=null;try{for(;!g;){let{value:a,done:h}=await c.read();if(h)break;let i=(e+=d.decode(a,{stream:!0})).split(/\r?\n/);for(let a of(e=i.pop()||"",i)){let c=a.trim();if(!c||c.startsWith(":")||!c.startsWith("data:"))continue;let d=c.slice(5).trim();if("[DONE]"===d){g||(g={ok:!1,error:"Provider stream ended without a usable response"});break}let e=null;try{e=JSON.parse(d)}catch{continue}e=(0,f.x)(e,b);let h=function(a){if(!a||"object"!=typeof a)return null;if(a.error)return{ok:!1,error:String(a.error?.message||a.error).slice(0,240)};let b=Array.isArray(a.choices)?a.choices[0]:null;if(!b)return null;let c=k(b.delta?.content||b.message?.content),d=l(b.delta)||l(b.message);return c?{ok:!0}:d?{ok:!0,note:"reasoning-only response (length-limited)"}:null}(e);if(h?.ok===!1){g=h;break}h?.ok&&(g=h)}}}catch(a){if(g?.ok)return g;if(a?.name==="TimeoutError"||a?.name==="AbortError")return m();throw a}finally{await c.cancel().catch(()=>{})}return g||{ok:!1,error:"Provider stream ended without a usable response"}}async function o(a,b,c=`http://127.0.0.1:${process.env.PORT||g.h0.appPort}`,d={}){let h,p,q=await j(d.connectionId),r=Date.now();if("embedding"===b){let b=await fetch(`${c}/api/v1/embeddings`,{method:"POST",headers:q,body:JSON.stringify({model:a,input:"test"}),signal:AbortSignal.timeout(15e3)}),d=Date.now()-r,e=await b.text().catch(()=>""),f=null;try{f=e?JSON.parse(e):null}catch{}if(!b.ok){let a=f?.error?.message||f?.error||e;return{ok:!1,latencyMs:d,error:i(b.status,a),status:b.status}}return Array.isArray(f?.data)&&f.data.length>0&&Array.isArray(f.data[0]?.embedding)?{ok:!0,latencyMs:d,error:null,status:b.status}:{ok:!1,latencyMs:d,status:b.status,error:"Provider returned no embedding data"}}if("image"===b){let b=await fetch(`${c}/api/v1/images/generations`,{method:"POST",headers:q,body:JSON.stringify({model:a,prompt:"test"}),signal:AbortSignal.timeout(15e3)}),d=Date.now()-r,e=await b.text().catch(()=>""),f=null;try{f=e?JSON.parse(e):null}catch{}if(!b.ok){let a=f?.error?.message||f?.msg||f?.message||f?.error||e;return{ok:!1,latencyMs:d,error:i(b.status,a),status:b.status}}return Array.isArray(f?.data)&&f.data.length>0?{ok:!0,latencyMs:d,error:null,status:b.status}:{ok:!1,latencyMs:d,status:b.status,error:"Provider returned no image data for this model"}}if("stt"===b){let b,d,e,f,g=new FormData,h=(e=new DataView(d=new ArrayBuffer(44+(b=8e3))),(f=(a,b)=>{for(let c=0;c<b.length;c+=1)e.setUint8(a+c,b.charCodeAt(c))})(0,"RIFF"),e.setUint32(4,36+b,!0),f(8,"WAVE"),f(12,"fmt "),e.setUint32(16,16,!0),e.setUint16(20,1,!0),e.setUint16(22,1,!0),e.setUint32(24,16e3,!0),e.setUint32(28,32e3,!0),e.setUint16(32,2,!0),e.setUint16(34,16,!0),f(36,"data"),e.setUint32(40,b,!0),new Blob([d],{type:"audio/wav"}));g.append("file",h,"test.wav"),g.append("model",a);let j=await fetch(`${c}/api/v1/audio/transcriptions`,{method:"POST",headers:Object.fromEntries(Object.entries(q).filter(([a])=>"content-type"!==a.toLowerCase())),body:g,signal:AbortSignal.timeout(15e3)}),k=Date.now()-r,l=await j.text().catch(()=>""),m=null;try{m=l?JSON.parse(l):null}catch{}if(!j.ok){let a=m?.error?.message||m?.msg||m?.message||m?.error||l;return{ok:!1,latencyMs:k,error:i(j.status,a),status:j.status}}return("string"==typeof m?.text?m.text:"").trim()?{ok:!0,latencyMs:k,error:null,status:j.status}:{ok:!1,latencyMs:k,status:j.status,error:"Provider returned no transcription text for this model"}}if("systemone"===b){let b=await fetch(`${c}/api/v1/systemone`,{method:"POST",headers:q,body:JSON.stringify({model:a,state:"Customer: I was charged twice for my order this morning.",questions:{probe:{type:"noul",instructions:"Is the customer reporting a billing problem?"}}}),signal:AbortSignal.timeout(15e3)}),d=Date.now()-r,e=await b.text().catch(()=>""),f=null;try{f=e?JSON.parse(e):null}catch{}if(!b.ok){let a=f?.error?.message||f?.msg||f?.message||f?.error||e;return{ok:!1,latencyMs:d,error:`HTTP ${b.status}${a?`: ${String(a).slice(0,240)}`:""}`,status:b.status}}return f?.answers&&"object"==typeof f.answers&&Object.keys(f.answers).length>0?{ok:!0,latencyMs:d,error:null,status:b.status}:{ok:!1,latencyMs:d,status:b.status,error:"Provider returned no answers for this model"}}let s=(0,e.rs)(String(a).split("/")[0]),t=Number.isFinite(d.timeoutMs)?d.timeoutMs:(p=String(a||"").split("/")[0],"antigravity"===(0,e.rs)(p)?3e4:15e3);try{h=await fetch(`${c}/api/v1/chat/completions`,{method:"POST",headers:{...q,"x-zevai-probe":"first-token"},body:JSON.stringify({model:a,max_tokens:1024,stream:!0,messages:[{role:"user",content:"hi"}]}),signal:AbortSignal.timeout(t)})}catch(a){if(a?.name==="TimeoutError"||a?.name==="AbortError")return{...m(),latencyMs:Date.now()-r};return{ok:!1,latencyMs:Date.now()-r,error:a?.message||"Probe failed",status:0}}if(!h.ok){let a=await h.text().catch(()=>""),b=null;try{b=a?JSON.parse(a):null}catch{}b=(0,f.x)(b,s);let c=b?.error?.message||b?.msg||b?.message||b?.error||a;return{ok:!1,latencyMs:Date.now()-r,error:i(h.status,c),status:h.status}}if((h.headers.get("content-type")||"").includes("text/event-stream")){let a=await n(h,s);return{...a,latencyMs:Date.now()-r,status:h.status,error:a.error||null}}let u=await h.text().catch(()=>""),v=null;try{v=u?JSON.parse(u):null}catch{}let w=function(a){let b=a?.status,c=a?.msg||a?.message;if(null!=b&&"200"!==String(b)&&"0"!==String(b)&&c)return{ok:!1,error:`Provider status ${b}: ${String(c).slice(0,240)}`};if(a?.error)return{ok:!1,error:String(a?.error?.message||a?.error||"Provider returned an error").slice(0,240)};let d=Array.isArray(a?.choices)&&a.choices.length>0,e=a?.choices?.[0]||{},f=l(e.message),g=!k(e.message?.content);return d&&"length"===e.finish_reason&&g&&f?{ok:!0,note:"reasoning-only response (length-limited)"}:d&&(!g||f)?{ok:!0}:{ok:!1,error:"Provider returned no completion choices for this model"}}(v=(0,f.x)(v,s));return{ok:w.ok,latencyMs:Date.now()-r,status:h.status,error:w.ok?null:w.error,...w.note?{note:w.note}:{}}}},39006:a=>{a.exports=JSON.parse('{"name":"zevairouter","version":"1.1.78","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"cli/cli.js"},"files":["cli/cli.js","cli/app/","!cli/app/.next-cli-build/cache/","!cli/app/.next-cli-build/server/route-cache/","cli/hooks/","cli/src/","cli/package.json","cli/README.md","cli/LICENSE","scripts/start-standalone.mjs","scripts/gflow-reply-capture.py","scripts/flow-vps-setup.sh","vendor/aistudio-waa/","skills/","README.md","README.zh-CN.md","DOCKER.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"node scripts/build-app.mjs","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","lint":"eslint .","test":"vitest run --config tests/vitest.config.js","build:cli":"node cli/scripts/build-cli.js","audit:package":"node cli/scripts/audit-package.mjs","smoke:package":"node cli/scripts/smoke-package.mjs","verify:mobile-scroll":"node cli/scripts/verify-dashboard-mobile-scroll.mjs","candidate:build":"node cli/scripts/local-candidate.mjs build","candidate:install":"node cli/scripts/local-candidate.mjs install","candidate:status":"node cli/scripts/local-candidate.mjs status","candidate:rollback":"node cli/scripts/local-candidate.mjs rollback","release":"node cli/scripts/release.js","prepack":"npm run build:cli && npm run audit:package","postinstall":"node cli/hooks/postinstall.js"},"dependencies":{"confbox":"0.2.4","node-machine-id":"1.1.12","react":"19.2.4","react-dom":"19.2.4"},"comment_published_runtime":"npm install -g must not download next or @next/swc. Those, plus sql.js, yaml, and @node-saml/node-saml, stay devDependencies so local dev and build:cli can trace them into cli/app. The published tarball already ships that standalone server. confbox stays here because the CLI imports it directly.","comment_optional_runtime":"Optional packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses CloakBrowser with playwright-core; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3, node-pty, and systray2.","overrides":{"body-parser":"^2.3.0","brace-expansion":"5.0.12","dompurify":"^3.4.12","ip-address":"^10.4.0","js-yaml":"4.3.2","nanoid":"^3.3.18","postcss":"^8.5.10","sharp":"0.35.5"},"comment_overrides":"Security floors for transitive dependencies. ESLint\'s legacy minimatch is a private, source-pinned 3.1.5 compatibility package backed by brace-expansion 5.0.9; modern minimatch and nanoid use fixed floors directly. Monaco still pins an old DOMPurify; Express, Next, ESLint, and image processing dependencies may resolve vulnerable body-parser, js-yaml, or sharp releases. Recheck and remove overrides once parent packages require fixed versions.","devDependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@node-saml/node-saml":"5.1.0","@tailwindcss/postcss":"^4.1.18","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","better-sqlite3":"^12.6.2","chalk":"^4.1.2","dompurify":"^3.4.12","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.4.2","express":"^5.2.1","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","minimatch":"file:vendor/minimatch3-secure","monaco-editor":"^0.55.1","next":"16.4.2","node-forge":"^1.4.2","open":"^11.0.0","ora":"^9.1.0","postcss":"^8.5.10","prop-types":"^15.8.1","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","sql.js":"1.14.1","tailwindcss":"^4","typescript":"6.0.3","undici":"^8.10.0","uuid":"^14.0.1","vitest":"4.1.12","yaml":"2.9.0","zustand":"^5.0.10"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Verifiedlabs/zevairouter.git"},"bugs":{"url":"https://github.com/Verifiedlabs/zevairouter/issues"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},43591:(a,b,c)=>{c.d(b,{A:()=>d});let d={id:"nace",alias:"nace",aliases:["drex"],category:"apikey",authType:"apikey",authModes:["apikey"],hasProviderSpecificData:!0,priority:48,display:{name:"Nace Drex",icon:"psychology",color:"#1D1D16",textIcon:"DX",website:"https://console.nace.ai",notice:{text:"Drex decision models on the System One protocol (noul / choice / score questions, calibrated probabilities). drex-max also accepts a top-level `images` array; drex-v2.0 is text-only. Paste a console.nace.ai API key (sent as a Bearer token).",apiKeyUrl:"https://console.nace.ai/dashboard/api-keys"}},models:[{id:"drex-max",name:"Drex Max",kind:"systemone"},{id:"drex-v2.0",name:"Drex 2.0",kind:"systemone"}],serviceKinds:["systemone"],systemoneConfig:{baseUrl:"https://console.nace.ai/v1/systemone",path:"/v1/systemone",authType:"apikey",authHeader:"bearer"}}},48806:(a,b,c)=>{c.d(b,{A:()=>d});let d={id:"xai",alias:"xai",category:"oauth",authModes:["oauth","apikey"],hasOAuth:!0,display:{name:"xAI (Grok)",icon:"auto_awesome",color:"#1DA1F2",textIcon:"XA",website:"https://x.ai",notice:{apiKeyUrl:"https://console.x.ai",signupUrl:"https://x.ai"}},models:[{id:"grok-imagine-video",name:"Grok Imagine Video",type:"video",params:["duration","aspect_ratio","resolution"]}],serviceKinds:["llm","imageToText","webSearch","image","video"],imageConfig:{baseUrl:"https://api.x.ai/v1/images/generations",bodyFields:["model","prompt","n","response_format"]},videoConfig:{baseUrl:"https://api.x.ai/v1/videos"},searchViaChat:{defaultModel:"grok-4.20-reasoning",endpoint:"https://api.x.ai/v1/responses",pricingUrl:"https://x.ai/api#pricing"}}},54098:(a,b,c)=>{c.d(b,{x:()=>e});var d=c(35024);function e(a,b){if(!b||!d.xq[b]?.quirks?.clineEnvelope)return a;let{success:c,data:e}=a||{};return!0!==c||!e||"object"!=typeof e||Array.isArray(e)?a:e}},54603:(a,b,c)=>{c.d(b,{Xj:()=>q});var d=c(19713),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(49120);let l=h().join(k.DATA_DIR,"machine-id"),m=h().join(k.DATA_DIR,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.DATA_DIR,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="zevai-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},72236:(a,b,c)=>{c.d(b,{A:()=>d});let d={id:"v1m",alias:"v1m",aliases:["systemone","jev"],category:"apikey",authType:"apikey",authModes:["apikey"],hasProviderSpecificData:!0,priority:45,display:{name:"v1m (System One)",icon:"psychology",color:"#6366F1",textIcon:"V1",website:"https://v1m.ir",notice:{text:"v1m System One calibrated decision engine. Fast probabilistic evaluations over state and questions.",apiKeyUrl:"https://v1m.ir"}},models:[{id:"rev-latest",name:"v1m Rev Latest (Calibrated)",kind:"systemone"},{id:"v1m-decision-engine",name:"v1m Decision Engine",kind:"systemone"}],serviceKinds:["systemone"],systemoneConfig:{baseUrl:"https://v1m.ir/v1/systemone",authType:"apikey",authHeader:"bearer"}}},81329:(a,b,c)=>{c.d(b,{Xg:()=>d.Xg,eh:()=>e,u0:()=>d.u0,vq:()=>d.vq});var d=c(19548);new Set(Object.entries(c(17404).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a));let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))}};
1
+ "use strict";exports.id=6166,exports.ids=[6166],exports.modules={30869:(a,b,c)=>{c.d(b,{UY:()=>i,X3:()=>k,eh:()=>f.eh,fg:()=>e.fg,h0:()=>h,oc:()=>j,vQ:()=>g});var d=c(39006),e=c(17404),f=c(81329);let g={name:"ZevaiRouter",description:"AI Infrastructure Management",version:d.version},h={npmPackageName:"zevairouter",installCmd:"npm i -g zevairouter",installCmdLatest:"npm i -g zevairouter@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:1997},i={maxLines:200,pollIntervalMs:1e3},j={tickIntervalMs:6e4,pingLeadMs:5e3,refreshAheadMs:3e5,failureCooldownMs:9e5,providers:{claude:{settingsKey:"claudeAutoPing",quotaKey:"session (5h)",pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1},codex:{settingsKey:"codexAutoPing",quotaKey:"session",pingWhenResetAtSlides:!0,resetAtDriftMs:3e4,minPingIntervalMs:6e5,skipWhenBlockingQuotaExhausted:!0,pingModel:"gpt-5.5",pingText:"hi",pingInstructions:"Reply with OK.",pingReasoningEffort:"none"}}},k={openrouter:"https://openrouter.ai/api/v1/chat/completions",glm:"https://api.z.ai/api/anthropic/v1/messages","glm-cn":"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",kimi:"https://api.kimi.com/coding/v1/messages",minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages",alicode:"https://coding.dashscope.aliyuncs.com/v1/chat/completions","alicode-intl":"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions","volcengine-ark":"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",byteplus:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",openai:"https://api.openai.com/v1/chat/completions","vercel-ai-gateway":"https://ai-gateway.vercel.sh/v1/chat/completions",anthropic:"https://api.anthropic.com/v1/messages",gemini:"https://generativelanguage.googleapis.com/v1beta/models",ollama:"https://ollama.com/api/chat","ollama-local":"http://localhost:11434/api/chat"}},38238:(a,b,c)=>{c.d(b,{OU:()=>j,PL:()=>o,Yd:()=>i});var d=c(89718),e=c(17404),f=c(54098),g=c(30869),h=c(54603);function i(a,b){let c="string"==typeof b?b:b?JSON.stringify(b):"";for(let a=0;a<3;a++){let a=c.replace(/^\s*(?:HTTP\s+)?\[?\d{3}\]?\s*:\s*/i,""),b=a;try{let c=JSON.parse(a),d=c?.error?.message||c?.message||c?.error;"string"==typeof d&&d&&(b=d)}catch{}if(b===c)break;c=b}return c=c.trim(),`HTTP ${a}${c?`: ${c.slice(0,240)}`:""}`}async function j(a=null){let b=null;try{let a=await (0,d.PX)(!0);b=a.find(a=>!1!==a.isActive)?.key||null}catch{}let c={"Content-Type":"application/json"};return b&&(c.Authorization=`Bearer ${b}`),c["x-zevai-cli-token"]=await (0,h.Xj)("zevai-cli-auth"),a&&(c["x-zevai-connection-id"]=a),c}function k(a){return"string"==typeof a?a.trim():""}function l(a){return a&&"object"==typeof a?k(a.reasoning||a.reasoning_content||a.thinking||a.thinking_content):""}function m(){return{ok:!1,error:"Probe timed out before a usable response",status:408}}async function n(a,b){let c=a.body?.getReader?.();if(!c)return{ok:!1,error:"Provider stream ended without a usable response"};let d=new TextDecoder,e="",g=null;try{for(;!g;){let{value:a,done:h}=await c.read();if(h)break;let i=(e+=d.decode(a,{stream:!0})).split(/\r?\n/);for(let a of(e=i.pop()||"",i)){let c=a.trim();if(!c||c.startsWith(":")||!c.startsWith("data:"))continue;let d=c.slice(5).trim();if("[DONE]"===d){g||(g={ok:!1,error:"Provider stream ended without a usable response"});break}let e=null;try{e=JSON.parse(d)}catch{continue}e=(0,f.x)(e,b);let h=function(a){if(!a||"object"!=typeof a)return null;if(a.error)return{ok:!1,error:String(a.error?.message||a.error).slice(0,240)};let b=Array.isArray(a.choices)?a.choices[0]:null;if(!b)return null;let c=k(b.delta?.content||b.message?.content),d=l(b.delta)||l(b.message);return c?{ok:!0}:d?{ok:!0,note:"reasoning-only response (length-limited)"}:null}(e);if(h?.ok===!1){g=h;break}h?.ok&&(g=h)}}}catch(a){if(g?.ok)return g;if(a?.name==="TimeoutError"||a?.name==="AbortError")return m();throw a}finally{await c.cancel().catch(()=>{})}return g||{ok:!1,error:"Provider stream ended without a usable response"}}async function o(a,b,c=`http://127.0.0.1:${process.env.PORT||g.h0.appPort}`,d={}){let h,p,q=await j(d.connectionId),r=Date.now();if("embedding"===b){let b=await fetch(`${c}/api/v1/embeddings`,{method:"POST",headers:q,body:JSON.stringify({model:a,input:"test"}),signal:AbortSignal.timeout(15e3)}),d=Date.now()-r,e=await b.text().catch(()=>""),f=null;try{f=e?JSON.parse(e):null}catch{}if(!b.ok){let a=f?.error?.message||f?.error||e;return{ok:!1,latencyMs:d,error:i(b.status,a),status:b.status}}return Array.isArray(f?.data)&&f.data.length>0&&Array.isArray(f.data[0]?.embedding)?{ok:!0,latencyMs:d,error:null,status:b.status}:{ok:!1,latencyMs:d,status:b.status,error:"Provider returned no embedding data"}}if("image"===b){let b=await fetch(`${c}/api/v1/images/generations`,{method:"POST",headers:q,body:JSON.stringify({model:a,prompt:"test"}),signal:AbortSignal.timeout(15e3)}),d=Date.now()-r,e=await b.text().catch(()=>""),f=null;try{f=e?JSON.parse(e):null}catch{}if(!b.ok){let a=f?.error?.message||f?.msg||f?.message||f?.error||e;return{ok:!1,latencyMs:d,error:i(b.status,a),status:b.status}}return Array.isArray(f?.data)&&f.data.length>0?{ok:!0,latencyMs:d,error:null,status:b.status}:{ok:!1,latencyMs:d,status:b.status,error:"Provider returned no image data for this model"}}if("stt"===b){let b,d,e,f,g=new FormData,h=(e=new DataView(d=new ArrayBuffer(44+(b=8e3))),(f=(a,b)=>{for(let c=0;c<b.length;c+=1)e.setUint8(a+c,b.charCodeAt(c))})(0,"RIFF"),e.setUint32(4,36+b,!0),f(8,"WAVE"),f(12,"fmt "),e.setUint32(16,16,!0),e.setUint16(20,1,!0),e.setUint16(22,1,!0),e.setUint32(24,16e3,!0),e.setUint32(28,32e3,!0),e.setUint16(32,2,!0),e.setUint16(34,16,!0),f(36,"data"),e.setUint32(40,b,!0),new Blob([d],{type:"audio/wav"}));g.append("file",h,"test.wav"),g.append("model",a);let j=await fetch(`${c}/api/v1/audio/transcriptions`,{method:"POST",headers:Object.fromEntries(Object.entries(q).filter(([a])=>"content-type"!==a.toLowerCase())),body:g,signal:AbortSignal.timeout(15e3)}),k=Date.now()-r,l=await j.text().catch(()=>""),m=null;try{m=l?JSON.parse(l):null}catch{}if(!j.ok){let a=m?.error?.message||m?.msg||m?.message||m?.error||l;return{ok:!1,latencyMs:k,error:i(j.status,a),status:j.status}}return("string"==typeof m?.text?m.text:"").trim()?{ok:!0,latencyMs:k,error:null,status:j.status}:{ok:!1,latencyMs:k,status:j.status,error:"Provider returned no transcription text for this model"}}if("systemone"===b){let b=await fetch(`${c}/api/v1/systemone`,{method:"POST",headers:q,body:JSON.stringify({model:a,state:"Customer: I was charged twice for my order this morning.",questions:{probe:{type:"noul",instructions:"Is the customer reporting a billing problem?"}}}),signal:AbortSignal.timeout(15e3)}),d=Date.now()-r,e=await b.text().catch(()=>""),f=null;try{f=e?JSON.parse(e):null}catch{}if(!b.ok){let a=f?.error?.message||f?.msg||f?.message||f?.error||e;return{ok:!1,latencyMs:d,error:`HTTP ${b.status}${a?`: ${String(a).slice(0,240)}`:""}`,status:b.status}}return f?.answers&&"object"==typeof f.answers&&Object.keys(f.answers).length>0?{ok:!0,latencyMs:d,error:null,status:b.status}:{ok:!1,latencyMs:d,status:b.status,error:"Provider returned no answers for this model"}}let s=(0,e.rs)(String(a).split("/")[0]),t=Number.isFinite(d.timeoutMs)?d.timeoutMs:(p=String(a||"").split("/")[0],"antigravity"===(0,e.rs)(p)?3e4:15e3);try{h=await fetch(`${c}/api/v1/chat/completions`,{method:"POST",headers:{...q,"x-zevai-probe":"first-token"},body:JSON.stringify({model:a,max_tokens:1024,stream:!0,messages:[{role:"user",content:"hi"}]}),signal:AbortSignal.timeout(t)})}catch(a){if(a?.name==="TimeoutError"||a?.name==="AbortError")return{...m(),latencyMs:Date.now()-r};return{ok:!1,latencyMs:Date.now()-r,error:a?.message||"Probe failed",status:0}}if(!h.ok){let a=await h.text().catch(()=>""),b=null;try{b=a?JSON.parse(a):null}catch{}b=(0,f.x)(b,s);let c=b?.error?.message||b?.msg||b?.message||b?.error||a;return{ok:!1,latencyMs:Date.now()-r,error:i(h.status,c),status:h.status}}if((h.headers.get("content-type")||"").includes("text/event-stream")){let a=await n(h,s);return{...a,latencyMs:Date.now()-r,status:h.status,error:a.error||null}}let u=await h.text().catch(()=>""),v=null;try{v=u?JSON.parse(u):null}catch{}let w=function(a){let b=a?.status,c=a?.msg||a?.message;if(null!=b&&"200"!==String(b)&&"0"!==String(b)&&c)return{ok:!1,error:`Provider status ${b}: ${String(c).slice(0,240)}`};if(a?.error)return{ok:!1,error:String(a?.error?.message||a?.error||"Provider returned an error").slice(0,240)};let d=Array.isArray(a?.choices)&&a.choices.length>0,e=a?.choices?.[0]||{},f=l(e.message),g=!k(e.message?.content);return d&&"length"===e.finish_reason&&g&&f?{ok:!0,note:"reasoning-only response (length-limited)"}:d&&(!g||f)?{ok:!0}:{ok:!1,error:"Provider returned no completion choices for this model"}}(v=(0,f.x)(v,s));return{ok:w.ok,latencyMs:Date.now()-r,status:h.status,error:w.ok?null:w.error,...w.note?{note:w.note}:{}}}},39006:a=>{a.exports=JSON.parse('{"name":"zevairouter","version":"1.1.80","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"cli/cli.js"},"files":["cli/cli.js","cli/app/","!cli/app/.next-cli-build/cache/","!cli/app/.next-cli-build/server/route-cache/","cli/hooks/","cli/src/","cli/package.json","cli/README.md","cli/LICENSE","scripts/start-standalone.mjs","scripts/gflow-reply-capture.py","scripts/flow-vps-setup.sh","vendor/aistudio-waa/","skills/","README.md","README.zh-CN.md","DOCKER.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"node scripts/build-app.mjs","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","lint":"eslint .","test":"vitest run --config tests/vitest.config.js","build:cli":"node cli/scripts/build-cli.js","audit:package":"node cli/scripts/audit-package.mjs","smoke:package":"node cli/scripts/smoke-package.mjs","verify:mobile-scroll":"node cli/scripts/verify-dashboard-mobile-scroll.mjs","candidate:build":"node cli/scripts/local-candidate.mjs build","candidate:install":"node cli/scripts/local-candidate.mjs install","candidate:status":"node cli/scripts/local-candidate.mjs status","candidate:rollback":"node cli/scripts/local-candidate.mjs rollback","release":"node cli/scripts/release.js","prepack":"npm run build:cli && npm run audit:package","postinstall":"node cli/hooks/postinstall.js"},"dependencies":{"confbox":"0.2.4","node-machine-id":"1.1.12","react":"19.2.4","react-dom":"19.2.4"},"comment_published_runtime":"npm install -g must not download next or @next/swc. Those, plus sql.js, yaml, and @node-saml/node-saml, stay devDependencies so local dev and build:cli can trace them into cli/app. The published tarball already ships that standalone server. confbox stays here because the CLI imports it directly.","comment_optional_runtime":"Optional packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses CloakBrowser with playwright-core; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3, node-pty, and systray2.","overrides":{"body-parser":"^2.3.0","brace-expansion":"5.0.12","dompurify":"^3.4.12","ip-address":"^10.4.0","js-yaml":"4.3.2","nanoid":"^3.3.18","postcss":"^8.5.10","sharp":"0.35.5"},"comment_overrides":"Security floors for transitive dependencies. ESLint\'s legacy minimatch is a private, source-pinned 3.1.5 compatibility package backed by brace-expansion 5.0.9; modern minimatch and nanoid use fixed floors directly. Monaco still pins an old DOMPurify; Express, Next, ESLint, and image processing dependencies may resolve vulnerable body-parser, js-yaml, or sharp releases. Recheck and remove overrides once parent packages require fixed versions.","devDependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@node-saml/node-saml":"5.1.0","@tailwindcss/postcss":"^4.1.18","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","better-sqlite3":"^12.6.2","chalk":"^4.1.2","dompurify":"^3.4.12","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.4.2","express":"^5.2.1","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","minimatch":"file:vendor/minimatch3-secure","monaco-editor":"^0.55.1","next":"16.4.2","node-forge":"^1.4.2","open":"^11.0.0","ora":"^9.1.0","postcss":"^8.5.10","prop-types":"^15.8.1","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","sql.js":"1.14.1","tailwindcss":"^4","typescript":"6.0.3","undici":"^8.10.0","uuid":"^14.0.1","vitest":"4.1.12","yaml":"2.9.0","zustand":"^5.0.10"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Verifiedlabs/zevairouter.git"},"bugs":{"url":"https://github.com/Verifiedlabs/zevairouter/issues"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},43591:(a,b,c)=>{c.d(b,{A:()=>d});let d={id:"nace",alias:"nace",aliases:["drex"],category:"apikey",authType:"apikey",authModes:["apikey"],hasProviderSpecificData:!0,priority:48,display:{name:"Nace Drex",icon:"psychology",color:"#1D1D16",textIcon:"DX",website:"https://console.nace.ai",notice:{text:"Drex decision models on the System One protocol (noul / choice / score questions, calibrated probabilities). drex-max also accepts a top-level `images` array; drex-v2.0 is text-only. Paste a console.nace.ai API key (sent as a Bearer token).",apiKeyUrl:"https://console.nace.ai/dashboard/api-keys"}},models:[{id:"drex-max",name:"Drex Max",kind:"systemone"},{id:"drex-v2.0",name:"Drex 2.0",kind:"systemone"}],serviceKinds:["systemone"],systemoneConfig:{baseUrl:"https://console.nace.ai/v1/systemone",path:"/v1/systemone",authType:"apikey",authHeader:"bearer"}}},48806:(a,b,c)=>{c.d(b,{A:()=>d});let d={id:"xai",alias:"xai",category:"oauth",authModes:["oauth","apikey"],hasOAuth:!0,display:{name:"xAI (Grok)",icon:"auto_awesome",color:"#1DA1F2",textIcon:"XA",website:"https://x.ai",notice:{apiKeyUrl:"https://console.x.ai",signupUrl:"https://x.ai"}},models:[{id:"grok-imagine-video",name:"Grok Imagine Video",type:"video",params:["duration","aspect_ratio","resolution"]}],serviceKinds:["llm","imageToText","webSearch","image","video"],imageConfig:{baseUrl:"https://api.x.ai/v1/images/generations",bodyFields:["model","prompt","n","response_format"]},videoConfig:{baseUrl:"https://api.x.ai/v1/videos"},searchViaChat:{defaultModel:"grok-4.20-reasoning",endpoint:"https://api.x.ai/v1/responses",pricingUrl:"https://x.ai/api#pricing"}}},54098:(a,b,c)=>{c.d(b,{x:()=>e});var d=c(35024);function e(a,b){if(!b||!d.xq[b]?.quirks?.clineEnvelope)return a;let{success:c,data:e}=a||{};return!0!==c||!e||"object"!=typeof e||Array.isArray(e)?a:e}},54603:(a,b,c)=>{c.d(b,{Xj:()=>q});var d=c(19713),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(49120);let l=h().join(k.DATA_DIR,"machine-id"),m=h().join(k.DATA_DIR,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.DATA_DIR,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="zevai-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},72236:(a,b,c)=>{c.d(b,{A:()=>d});let d={id:"v1m",alias:"v1m",aliases:["systemone","jev"],category:"apikey",authType:"apikey",authModes:["apikey"],hasProviderSpecificData:!0,priority:45,display:{name:"v1m (System One)",icon:"psychology",color:"#6366F1",textIcon:"V1",website:"https://v1m.ir",notice:{text:"v1m System One calibrated decision engine. Fast probabilistic evaluations over state and questions.",apiKeyUrl:"https://v1m.ir"}},models:[{id:"rev-latest",name:"v1m Rev Latest (Calibrated)",kind:"systemone"},{id:"v1m-decision-engine",name:"v1m Decision Engine",kind:"systemone"}],serviceKinds:["systemone"],systemoneConfig:{baseUrl:"https://v1m.ir/v1/systemone",authType:"apikey",authHeader:"bearer"}}},81329:(a,b,c)=>{c.d(b,{Xg:()=>d.Xg,eh:()=>e,u0:()=>d.u0,vq:()=>d.vq});var d=c(19548);new Set(Object.entries(c(17404).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a));let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))}};
@@ -46,7 +46,7 @@ id = "${I||"cc/claude-opus-4-7"}"`},{filename:"~/.config/jcode/provider-zevairou
46
46
  api: openai-completions
47
47
  discovery:
48
48
  type: openai-models-list
49
- timeoutMs: 20000`}])})]})}let ah="/api/cli-tools/openbot-settings";function ai({tool:a,isExpanded:b,onToggle:c,initialStatus:h}){let[i,j]=(0,e.useState)(h||null),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(()=>new Set),[q,r]=(0,e.useState)(""),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(null),w=(0,e.useCallback)(async()=>{l(!0);try{let a=await fetch(`${ah}?models=1`,{cache:"no-store"});j(await a.json())}catch(a){j({installed:!1,error:a.message})}finally{l(!1)}},[]),x=(0,e.useMemo)(()=>i?.endpoints||[],[i]),y=x.find(a=>a.id===m)||null,z=(0,e.useMemo)(()=>new Set(y?.agentModelIds||[]),[y]),A=i?.maxModels||64,B=(0,e.useMemo)(()=>i?.routerModels||[],[i]),C=(0,e.useMemo)(()=>{let a=q.trim().toLowerCase(),b=new Map;for(let c of B){if(a&&!c.id.toLowerCase().includes(a))continue;let d=function(a){let b=a.indexOf("/");return b>0?a.slice(0,b):a}(c.id);b.has(d)||b.set(d,[]),b.get(d).push(c)}return[...b.entries()]},[B,q]),D=(0,e.useMemo)(()=>new Set(B.map(a=>a.id)),[B]),E=(y?.modelIds||[]).filter(a=>!D.has(a)&&!z.has(a)),F=async()=>{if(y&&!s){t(!0),v(null);try{let a=await fetch(ah,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerId:y.id,models:[...o].filter(a=>D.has(a)||z.has(a))})}),b=await a.json();if(!a.ok)throw Error(b.error||"Sync failed");let c=[`${b.modelCount} models saved to "${y.name}"`];b.added.length&&c.push(`${b.added.length} added`),b.removed.length&&c.push(`${b.removed.length} removed`),b.rejected.length&&c.push(`${b.rejected.length} skipped`),v({type:"success",text:`${c.join(", ")}. Open OpenBot to use them.`}),await w()}catch(a){v({type:"error",text:a.message})}finally{t(!1)}}},G=i?.installed?i.hasZevai?"configured":"not_configured":null;return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:a.image?(0,d.jsx)(g.A,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}}):(0,d.jsx)("span",{className:"material-symbols-outlined text-[28px]",style:{color:a.color},children:a.icon||"smart_toy"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===G&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===G&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[k&&!i?.routerModels&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Reading OpenBot endpoints and router models..."})]}),i&&!i.installed&&(0,d.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:i.message||i.error||"OpenBot not detected on this computer."})]}),i?.installed&&(0,d.jsxs)(d.Fragment,{children:[a.notes?.map(a=>(0,d.jsxs)("div",{className:`flex items-start gap-2 p-2 rounded text-xs ${"warning"===a.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"bg-blue-500/10 text-blue-600 dark:text-blue-400"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5",children:"warning"===a.type?"warning":"info"}),(0,d.jsx)("span",{children:a.text})]},a.text)),i.error&&(0,d.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded text-xs bg-red-500/10 text-red-600",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5",children:"error"}),(0,d.jsx)("span",{children:i.error})]}),!i.error&&0===x.length&&(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["OpenBot has no endpoint pointing at this router yet. In OpenBot, add a custom endpoint with base URL"," ",(0,d.jsxs)("code",{className:"font-mono",children:["http://127.0.0.1:","1997","/v1"]})," ","and a ZevaiRouter API key, then come back here to pick its models."]}),y&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[x.length>1&&(0,d.jsx)("select",{value:m,onChange:a=>n(a.target.value),className:"rounded-lg border border-border bg-surface px-2 py-1.5 text-sm",children:x.map(a=>(0,d.jsxs)("option",{value:a.id,children:[a.name," (",a.id,")"]},a.id))}),(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["Endpoint ",(0,d.jsx)("strong",{className:"text-text-main",children:y.name})," \xb7 ",y.baseUrl,!y.hasApiKey&&" \xb7 no API key saved in OpenBot"]}),(0,d.jsxs)("span",{className:`ml-auto text-xs font-semibold ${o.size>=A?"text-amber-600":"text-text-main"}`,children:[o.size," / ",A," selected"]})]}),i.running&&(0,d.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded text-xs bg-amber-500/10 text-amber-700 dark:text-amber-300",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5",children:"block"}),(0,d.jsx)("span",{children:"OpenBot is open. Quit it (Cmd+Q) before syncing, then press Refresh."})]}),E.length>0&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[E.length," saved model",1===E.length?" is":"s are"," no longer offered by the router and will be removed: ",E.join(", ")]}),(0,d.jsx)("input",{type:"search",value:q,onChange:a=>r(a.target.value),placeholder:"Filter models",className:"rounded-lg border border-border bg-surface px-3 py-1.5 text-sm"}),(0,d.jsx)("div",{className:"max-h-[28rem] overflow-y-auto rounded-xl border border-border custom-scrollbar",children:C.map(([a,b])=>{let c=b.filter(a=>a.openbotCompatible&&!z.has(a.id)),e=c.length>0&&c.every(a=>o.has(a.id));return(0,d.jsxs)("div",{className:"border-b border-border-subtle last:border-b-0",children:[(0,d.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between bg-surface-2 px-3 py-1.5",children:[(0,d.jsxs)("span",{className:"font-mono text-xs font-semibold text-text-main",children:[a,"/ (",b.length,")"]}),c.length>0&&(0,d.jsx)("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:()=>{var a;return a=!e,void p(c=>{let d=new Set(c);for(let c of b)if(!(!c.openbotCompatible||z.has(c.id)))if(a){if(d.size>=A)break;d.add(c.id)}else d.delete(c.id);return d})},children:e?"Clear":"Select all"})]}),b.map(a=>{let b=z.has(a.id),c=!a.openbotCompatible||b||!o.has(a.id)&&o.size>=A;return(0,d.jsxs)("label",{className:`flex items-center gap-3 px-3 py-1.5 text-sm ${c&&!b?"opacity-50":"cursor-pointer hover:bg-surface-2"}`,children:[(0,d.jsx)("input",{type:"checkbox",checked:o.has(a.id)||b,disabled:c,onChange:()=>{var b;return b=a.id,void(!z.has(b)&&p(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.size<A&&c.add(b),c}))},className:"accent-primary"}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:a.id}),b&&(0,d.jsx)("span",{className:"rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"Used by an agent"}),!a.openbotCompatible&&(0,d.jsx)("span",{className:"rounded-full bg-zinc-500/10 px-2 py-0.5 text-[10px] font-medium text-text-muted",title:"OpenBot rejects model ids with characters such as @",children:"Not supported by OpenBot"}),a.context_length&&(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:[Math.round(a.context_length/1e3),"K"]})]},a.id)})]},a)})})]}),u&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===u.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===u.type?"check_circle":"error"}),(0,d.jsx)("span",{children:u.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:F,disabled:!y||i.running||0===o.size,loading:s,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"sync"}),"Sync to OpenBot"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:w,loading:k,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"refresh"}),"Refresh"]}),i.configPath&&(0,d.jsx)("span",{className:"truncate text-[11px] text-text-muted",children:i.configPath})]})]})]})]})}let aj="/api/cli-tools/dsh-settings",ak=`${aj}?models=1`;function al({type:a,children:b}){let c={info:["info","bg-blue-500/10 text-blue-600 dark:text-blue-400"],warning:["warning","bg-yellow-500/10 text-yellow-600 dark:text-yellow-400"],error:["error","bg-red-500/10 text-red-600"],success:["check_circle","bg-green-500/10 text-green-600"]},[e,f]=c[a]||c.info;return(0,d.jsxs)("div",{className:`flex items-start gap-2 p-2 rounded text-xs ${f}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5",children:e}),(0,d.jsx)("span",{className:"min-w-0 break-words",children:b})]})}function am({label:a,children:b}){return(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:a}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),b]})}function an({tool:a,isExpanded:b,onToggle:c,apiKeys:h,cloudEnabled:i,initialStatus:j,tunnelEnabled:k,tunnelPublicUrl:n,tailscaleEnabled:p,tailscaleUrl:q}){let r,[s,t]=(0,e.useState)(j||null),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(""),[C,D]=(0,e.useState)(""),[E,F]=(0,e.useState)(""),[G,H]=(0,e.useState)(""),I=async()=>{v(!0);try{let a=await fetch(ak);t(await a.json())}catch(a){t({installed:!1,error:a.message})}finally{v(!1)}},J=(r=C||"http://127.0.0.1:1997").endsWith("/v1")?r:`${r}/v1`,K=A?.trim()||h?.[0]?.key||(i?null:"sk_zevai"),L=s?.models||[],M=s?.defaultModel,N=L.find(a=>a.id===E),O=s?.installed?s.hasZevai?o(s.baseUrl,{tunnelPublicUrl:n,tailscaleUrl:q})?"configured":"other":"not_configured":null,P=async(a,b,c)=>{x(a),z(null);try{let a=await fetch(aj,{method:b,headers:{"Content-Type":"application/json"},...c?{body:JSON.stringify(c)}:{}}),d=await a.json();if(!a.ok)return z({type:"error",text:d.error||"Request failed"}),null;return await I(),d}catch(a){return z({type:"error",text:a.message}),null}finally{x(null)}},Q=async()=>{let a=await P("sync","POST",{baseUrl:J,apiKey:K});a&&z({type:"success",text:`Synced ${a.modelCount} models (${a.reasoningModels} with effort levels).`})},R=async()=>{await P("default","PATCH",{model:E,reasoningEffort:G||null})&&z({type:"success",text:`Default model is now zevai / ${E}.`})},S=async()=>{await P("remove","DELETE")&&z({type:"success",text:"Removed the zevai provider from DeepSeek Harness."})};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.A,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===O&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===O&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===O&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-3",children:[u&&!s?.installed&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Looking for DeepSeek Harness..."})]}),!u&&s&&!s.installed&&(0,d.jsx)(al,{type:"warning",children:s.message||"DeepSeek Harness not detected. Install the app and open it once."}),s?.installed&&(0,d.jsxs)(d.Fragment,{children:[a.notes?.map(a=>(0,d.jsx)(al,{type:a.type,children:a.text},a.text)),s.error&&(0,d.jsx)(al,{type:"error",children:s.error}),(0,d.jsx)(am,{label:"Select Endpoint",children:(0,d.jsx)(l,{value:C||J,onChange:D,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:k,tunnelPublicUrl:n,tailscaleEnabled:p,tailscaleUrl:q})}),(0,d.jsx)(am,{label:"API Key",children:(0,d.jsx)(m,{value:A,onChange:B,apiKeys:h,cloudEnabled:i})}),s.hasZevai&&(0,d.jsx)(am,{label:"Current",children:(0,d.jsxs)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-1.5 text-xs text-text-muted",children:[s.baseUrl," \xb7 ",s.modelCount," models",s.hasKeyRef?"":" \xb7 key reference missing"]})}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:Q,disabled:!K||!!s.error,loading:"sync"===w,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"sync"}),"Sync models"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:S,disabled:!s.hasZevai,loading:"remove"===w,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"delete"}),"Remove"]})]}),(0,d.jsxs)("div",{className:"mt-2 flex flex-col gap-2 border-t border-border pt-3",children:[(0,d.jsx)("p",{className:"text-xs font-semibold text-text-main",children:"Default model"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:M?.provider?`Now: ${M.provider} / ${M.model||"?"}${M.reasoningEffort?` (${M.reasoningEffort})`:""}`:"Now: DeepSeek Harness built-in default"}),M?.broken&&(0,d.jsxs)(al,{type:"warning",children:[M.reason,". New chats may fail until you pick a model below."]}),L.length>0?(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-[1fr_8rem_auto] sm:items-center",children:[(0,d.jsxs)("select",{className:"min-w-0 rounded border border-border bg-surface px-2 py-1.5 text-xs",value:E,onChange:a=>{let b,c=L.find(b=>b.id===a.target.value);F(a.target.value),H(c?(b=c.efforts).includes("high")?"high":b[b.length-1]||"":"")},children:[(0,d.jsx)("option",{value:"",children:"Choose a zevai model"}),L.map(a=>(0,d.jsx)("option",{value:a.id,children:a.id},a.id))]}),(0,d.jsxs)("select",{className:"rounded border border-border bg-surface px-2 py-1.5 text-xs disabled:opacity-50",value:G,onChange:a=>H(a.target.value),disabled:!N?.efforts.length,children:[(0,d.jsx)("option",{value:"",children:"No effort"}),N?.efforts.map(a=>(0,d.jsx)("option",{value:a,children:a},a))]}),(0,d.jsx)(f.$n,{variant:"secondary",size:"sm",onClick:R,disabled:!E,loading:"default"===w,children:"Set default"})]}):(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Sync models first to pick a zevai default."})]}),y&&(0,d.jsx)(al,{type:y.type,children:y.text})]})]})]})}let ao=[2e5,4e5,6e5,1e6],ap=[16e3,32e3,64e3,128e3],aq={contextWindow:2e5,maxTokens:64e3};function ar(a,b){let c=Number(a);return Number.isFinite(c)&&c>0&&c<=b?c:null}function as(a,b,c,d){if(null!=a&&""!==a){let b=ar(a,d);if(null!==b)return b}return ar(b,d)??c}function at(a){let b=Number(a);return Number.isFinite(b)?b>=1e6?`${+(b/1e6).toFixed(2)}M`:`${Math.round(b/1e3)}k`:String(a)}function au(a,b){return a.includes(b)?a:[...a,b].sort((a,b)=>a-b)}let av={pi:"npm install -g --ignore-scripts @earendil-works/pi-coding-agent",crush:"brew install charmbracelet/tap/crush",forge:"cargo install forgecode",smelt:"cargo install smelt",codewhale:"cargo install codewhale"};function aw({tool:a,apiKeys:b,activeProviders:c=[],cloudEnabled:h,initialStatus:i,tunnelPublicUrl:j,tailscaleUrl:k}){let n=`/api/cli-tools/${a.id}-settings`,[p,q]=(0,e.useState)(i||null),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)(""),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)([]),[F,G]=(0,e.useState)({}),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)(""),N=()=>{let a=(L||"http://127.0.0.1:1997").replace(/\/+$/,"");return a.endsWith("/v1")?a:`${a}/v1`},O=async()=>{s(!0);try{let b,c=await fetch(n),d=await c.json();q(d);let e=(b=d?.config,b?.model||b?.openai?.model||b?.providers?.zevai?.models?.[0]?.id||b?.providers?.zevai?.models?.[0]||"");if(e&&!B&&C("string"==typeof e?e:e.id),"pi"===a.id){let a=function(a){let b=a?.providers?.zevai?.models;if(!Array.isArray(b)||0===b.length)return null;let c={};return{ids:b.map(a=>{let b="string"==typeof a?a:a?.id;return b&&"string"!=typeof a&&(c[b]={contextWindow:as(a.contextWindow,void 0,aq.contextWindow,2e6),maxTokens:as(a.maxTokens,void 0,aq.maxTokens,2e5)}),b}).filter(Boolean),caps:c}}(d?.config);a&&(E(a.ids),G(a.caps))}}catch(a){q({installed:!1,error:a.message})}finally{s(!1)}},P=p?.installed?p.hasZevai?o(p.baseUrl,{tunnelPublicUrl:j,tailscaleUrl:k})?"configured":"other":"not_configured":null,Q=z?.trim()||(b?.length>0?b[0].key:"")||(h?"":"sk_zevai"),R=async()=>{u(!0),y(null);try{let b={baseUrl:N(),apiKey:Q,model:B||"provider/model-id"};if("pi"===a.id){let a=D.length>0?D:[b.model];b.models=a.map(a=>({id:a,name:a,...aq,...F[a]}))}let c=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),d=await c.json();y({type:c.ok?"success":"error",text:d.message||d.error||"Failed to apply settings"}),c.ok&&await O()}catch(a){y({type:"error",text:a.message})}finally{u(!1)}},S=async()=>{w(!0),y(null);try{let a=await fetch(n,{method:"DELETE"}),b=await a.json();y({type:a.ok?"success":"error",text:b.message||b.error||"Failed to reset"}),a.ok&&await O()}catch(a){y({type:"error",text:a.message})}finally{w(!1)}},T=a=>{E(a),G(b=>{let c={};for(let d of a)c[d]=b[d]||{...aq};return c})},U=(a,b,c)=>{G(d=>({...d,[a]:{...aq,...d[a],[b]:Number(c)}}))};return(0,d.jsxs)(f.Zp,{padding:"sm",className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[a.image?(0,d.jsx)(g.A,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg"}):(0,d.jsx)("span",{className:"material-symbols-outlined text-[28px]",style:{color:a.color},children:a.icon||"terminal"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("h2",{className:"font-medium",children:a.name}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:a.description})]}),(0,d.jsx)("span",{className:`px-2 py-0.5 text-[10px] rounded-full ${"configured"===P?"bg-green-500/10 text-green-600":"other"===P?"bg-blue-500/10 text-blue-600":p?.installed?"bg-yellow-500/10 text-yellow-600":"bg-gray-500/10 text-gray-500"}`,children:r?"Checking":"configured"===P?"Connected":p?.installed?"Not configured":"Not installed"})]}),a.notes?.map(a=>(0,d.jsx)("p",{className:"text-xs text-text-muted",children:a.text},a.text)),!p?.installed&&(0,d.jsx)("pre",{className:"overflow-x-auto rounded-lg bg-bg-secondary p-3 text-xs",children:av[a.id]||`Install ${a.name}`}),(0,d.jsx)(l,{value:L,onChange:M,tunnelEnabled:!!j,tunnelPublicUrl:j,tailscaleEnabled:!!k,tailscaleUrl:k,cloudEnabled:h}),(0,d.jsx)(m,{value:z,onChange:A,apiKeys:b,cloudEnabled:h}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,d.jsx)("input",{value:"pi"===a.id?D.join(", "):B,onChange:b=>{"pi"===a.id?T(b.target.value.split(",").map(a=>a.trim()).filter(Boolean)):C(b.target.value)},placeholder:"provider/model-id",className:"flex-1 rounded-lg border border-border bg-bg-secondary px-3 py-2 text-sm"}),(0,d.jsx)(f.$n,{variant:"secondary",onClick:()=>I(!0),disabled:0===c.length,children:"Select model"})]}),"pi"===a.id&&D.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-1.5",children:D.map(a=>{let b={...aq,...F[a]};return(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 text-xs",children:[(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a}),(0,d.jsx)("select",{value:b.contextWindow,onChange:b=>U(a,"contextWindow",b.target.value),title:"Context window",className:"rounded border border-border bg-bg-secondary px-1 py-0.5",children:au(ao,b.contextWindow).map(a=>(0,d.jsxs)("option",{value:a,children:[at(a)," ctx"]},a))}),(0,d.jsx)("select",{value:b.maxTokens,onChange:b=>U(a,"maxTokens",b.target.value),title:"Max output tokens",className:"rounded border border-border bg-bg-secondary px-1 py-0.5",children:au(ap,b.maxTokens).map(a=>(0,d.jsxs)("option",{value:a,children:[at(a)," out"]},a))})]},a)})}),x&&(0,d.jsx)("p",{className:`text-sm ${"error"===x.type?"text-red-500":"text-green-600"}`,children:x.text}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(f.$n,{onClick:R,disabled:t||!Q,children:t?"Applying":"Apply"}),(0,d.jsx)(f.$n,{variant:"secondary",onClick:S,disabled:v,children:"Reset"}),(0,d.jsx)(f.$n,{variant:"ghost",onClick:()=>K(!0),children:"Manual"})]}),(0,d.jsx)(f.rq,{isOpen:H,onClose:()=>I(!1),onSelect:b=>{"pi"===a.id?T(D.includes(b.value)?D:[...D,b.value]):C(b.value),I(!1)},activeProviders:c,title:`Select model for ${a.name}`}),(0,d.jsx)(f.uR,{isOpen:J,onClose:()=>K(!1),title:`${a.name} manual config`,configs:[{filename:p?.configPath||`${a.name} config`,content:JSON.stringify({baseUrl:N(),apiKey:Q||"<API_KEY>",model:B||"provider/model-id"},null,2)}]})]})}let ax="http://localhost:1997";function ay({apiKeys:a,cloudEnabled:b,onStatusChange:c}){let[g,h]=(0,e.useState)(null),[i,j]=(0,e.useState)(!1),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(()=>a?.[0]?.key||""),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(ax),[y,z]=(0,e.useState)(null),A=g?.isWin===!0,B=A||g?.hasCachedPassword||g?.needsSudoPassword===!1,C=g?.isAdmin!==!1;!C&&(A||g?.hasCachedPassword||g?.needsSudoPassword);let D=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/cli-tools/antigravity-mitm");if(a.ok){let b=await a.json();h(b),b.mitmRouterBaseUrl&&x(b.mitmRouterBaseUrl),c?.(b)}}catch{h({running:!1,certExists:!1,dnsStatus:{}})}},[c]),E=a=>{v(null),g&&(B?F(a,""):(r(a),l(!0),t(null)))},F=async(c,d,e=!1)=>{j(!0),v(null);try{let f;if("trust-cert"===c)f=await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"trust-cert",sudoPassword:d})});else if("start"===c){let c=o?.trim()||(a?.length>0?a[0].key:null)||(b?null:"sk_zevai");f=await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:c,sudoPassword:d,mitmRouterBaseUrl:w.trim()||ax,forceKillPort443:e})})}else f=await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:d})});if(!f.ok){let a=await f.json().catch(()=>({}));if("PORT_443_BUSY"===a.code&&a.portOwner){l(!1),z({owner:a.portOwner,password:d});return}v(a.error||`Failed to ${c} MITM server`);return}l(!1),n(""),z(null),await D()}catch(a){v(a.message||"Network error")}finally{j(!1),r(null)}},G=()=>{m.trim()?F(q,m):t("Sudo password is required")},H=g?.running;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.Zp,{padding:"sm",className:"border-primary/20 bg-primary/5",children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"security"}),(0,d.jsx)("span",{className:"font-semibold text-sm text-text-main",children:"MITM Server"}),H?(0,d.jsx)(f.Ex,{variant:"success",size:"sm",children:"Running"}):(0,d.jsx)(f.Ex,{variant:"default",size:"sm",children:"Stopped"})]}),(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-1 text-xs text-text-muted","data-i18n-skip":"true",children:[{label:"Cert",ok:g?.certExists},{label:"Trusted",ok:g?.certTrusted},{label:"Server",ok:H}].map(({label:a,ok:b})=>(0,d.jsxs)("span",{className:`flex items-center gap-0.5 px-1.5 py-0.5 rounded ${b?"text-green-600":"text-text-muted"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:b?"check_circle":"cancel"}),a]},a))})]}),(0,d.jsxs)("div",{className:"px-2 py-2 rounded-lg bg-surface/50 border border-border/50 flex flex-col gap-2",children:[(0,d.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:"Purpose:"})," Use Antigravity IDE & GitHub Copilot → with ANY provider/model from ZevaiRouter"]}),(0,d.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:"How it works:"})," Antigravity/Copilot IDE request → DNS redirect to localhost:443 → MITM proxy intercepts → ZevaiRouter → response to Antigravity/Copilot"]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid gap-1 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"ZevaiRouter Base URL"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:w,onChange:a=>x(a.target.value),placeholder:ax,disabled:H,className:"flex-1 min-w-0 px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50 disabled:opacity-50"})]}),!H&&(0,d.jsxs)("div",{className:"grid gap-1 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",list:"mitm-api-keys",value:o,onChange:a=>p(a.target.value),placeholder:b?"Enter or pick API key":"sk_zevai (default)",className:"flex-1 min-w-0 px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50"}),a?.length>0&&(0,d.jsx)("datalist",{id:"mitm-api-keys",children:a.map(a=>(0,d.jsx)("option",{value:a.key,children:a.name||a.key},a.id))})]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center","data-i18n-skip":"true",children:[g?.certExists&&!g?.certTrusted&&(0,d.jsxs)("button",{onClick:()=>E("trust-cert"),disabled:i,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-yellow-500/30 bg-yellow-500/10 px-4 py-2 text-xs font-medium text-yellow-600 transition-colors hover:bg-yellow-500/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"verified_user"}),"Trust Cert"]}),H?(0,d.jsxs)("button",{onClick:()=>E("stop"),disabled:i,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-xs font-medium text-red-500 transition-colors hover:bg-red-500/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop Server"]}):(0,d.jsxs)("button",{onClick:()=>E("start"),disabled:i||!g||A&&!C,title:A&&!C?"Administrator required":void 0,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-primary/30 bg-primary/10 px-4 py-2 text-xs font-medium text-primary transition-colors hover:bg-primary/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start Server"]}),H&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Enable DNS per tool below to activate interception"})]}),u&&(0,d.jsxs)("div",{className:"flex items-start gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600 dark:text-red-400 border border-red-500/20",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5 shrink-0",children:"error"}),(0,d.jsx)("span",{children:u})]}),A&&!C&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600 border border-red-500/20",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"shield_lock"}),(0,d.jsx)("span",{children:"Administrator required — restart ZevaiRouter as Administrator to use MITM"})]})]})}),k&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,d.jsxs)("div",{className:"mx-4 flex w-full max-w-sm flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,d.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Required for SSL certificate and server startup"})]}),(0,d.jsx)(f.pd,{type:"password",placeholder:"Enter sudo password",value:m,onChange:a=>n(a.target.value),onKeyDown:a=>{"Enter"!==a.key||i||G()}}),s&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,d.jsx)("span",{children:s})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>{l(!1),n(""),t(null)},disabled:i,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:G,loading:i,children:"Confirm"})]})]})}),y&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,d.jsxs)("div",{className:"mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,d.jsx)("h3",{className:"font-semibold text-text-main",children:"Port 443 Already In Use"}),(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,d.jsxs)("div",{className:"flex flex-col gap-1 text-xs text-text-muted",children:[(0,d.jsx)("p",{children:"Port 443 is currently used by another process:"}),(0,d.jsxs)("p",{className:"font-mono text-text-main","data-i18n-skip":"true",children:[y.owner.name," (PID ",y.owner.pid,")"]}),(0,d.jsx)("p",{children:"Kill this process to start MITM Server?"})]})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>{z(null),j(!1)},disabled:i,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:()=>{F("start",y?.password||"",!0)},loading:i,children:"Kill & Start"})]})]})})]})}var az=c(36811);function aA({tool:a,isExpanded:b,onToggle:c,serverRunning:h,dnsActive:i,hasCachedPassword:j,needsSudoPassword:k,isWin:l,apiKeys:m,activeProviders:n,hasActiveProviders:o,modelAliases:p={},cloudEnabled:q,onDnsChange:r}){let[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(""),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(null),[E,F]=(0,e.useState)({}),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(null),K=az.TOOL_HOSTS[a.id]??[],L=l||j||!1===k,M=(0,e.useCallback)(async b=>{try{await fetch("/api/cli-tools/antigravity-mitm/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:a.id,mappings:b})})}catch{}},[a.id]),N=(a,b)=>{F(c=>({...c,[a]:b}))},O=()=>{if(!h)return;let a=i?"disable":"enable";L?P(a,""):(B(a),x(!0),D(null))},P=async(b,c)=>{t(!0),v(null);try{let d=await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:a.id,action:b,sudoPassword:c})}),e=await d.json();if(!d.ok)throw Error(e.error||"Failed to toggle DNS");"enable"===b&&v(`Restart ${a.name} to apply changes`),x(!1),z(""),r?.(e)}catch{}finally{t(!1),B(null)}},Q=()=>{y.trim()?P(A,y):D("Sudo password is required")};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.A,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),h?i?(0,d.jsx)(f.Ex,{variant:"success",size:"sm",children:"Active"}):(0,d.jsx)(f.Ex,{variant:"warning",size:"sm",children:"DNS off"}):(0,d.jsx)(f.Ex,{variant:"default",size:"sm",children:"Server off"})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted sm:truncate",children:["Intercept ",a.name," requests via MITM proxy"]})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[K.length>0&&(0,d.jsxs)("div",{className:"mt-2 rounded-md border border-border bg-surface/50 px-2 py-1.5",children:[(0,d.jsx)("p",{className:"text-[10px] font-medium tracking-wide text-text-main/80 mb-1",children:"Edit hosts file manually to add the following entries:"}),(0,d.jsx)("ul",{className:"list-none space-y-0.5 font-mono text-[10px] text-text-muted break-all",children:K.map(a=>(0,d.jsxs)("li",{children:["127.0.0.1 ",a]},a))})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-0.5 text-[11px] text-text-muted px-1",children:[(0,d.jsxs)("p",{children:["Toggle DNS to redirect ",a.name," traffic through ZevaiRouter via MITM."]}),!i&&(0,d.jsx)("p",{className:"text-amber-600 text-[10px] mt-1",children:"⚠️ Enable DNS to edit model mappings"})]}),a.defaultModels?.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-2",children:a.defaultModels.map(a=>(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[9rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right",children:a.name}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:E[a.alias]||"",onChange:b=>N(a.alias,b.target.value),onBlur:b=>{var c,d;return c=a.alias,d=b.target.value,void M({...E,[c]:d})},placeholder:"provider/model-id",disabled:!i,className:`w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5 ${!i?"opacity-50 cursor-not-allowed":""}`}),E[a.alias]&&(0,d.jsx)("button",{onClick:()=>{N(a.alias,""),M({...E,[a.alias]:""})},className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>{J(a.alias),H(!0)},disabled:!o||!i,className:`rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 ${o&&i?"bg-surface border-border hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]},a.alias))}),a.defaultModels?.length===0&&(0,d.jsx)("p",{className:"text-xs text-text-muted px-1",children:"Model mappings will be available soon."}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:items-start",children:[i?(0,d.jsxs)("button",{onClick:O,disabled:!h||s,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-xs font-medium text-red-500 transition-colors hover:bg-red-500/20 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop DNS"]}):(0,d.jsxs)("button",{onClick:O,disabled:!h||s,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-primary/30 bg-primary/10 px-4 py-2 text-xs font-medium text-primary transition-colors hover:bg-primary/20 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start DNS"]}),u&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs text-amber-500",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"warning"}),(0,d.jsx)("span",{children:u})]})]})]})]}),w&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,d.jsxs)("div",{className:"mx-4 flex w-full max-w-sm flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,d.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Required to modify /etc/hosts and flush DNS cache"})]}),(0,d.jsx)(f.pd,{type:"password",placeholder:"Enter sudo password",value:y,onChange:a=>z(a.target.value),onKeyDown:a=>{"Enter"!==a.key||s||Q()}}),C&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,d.jsx)("span",{children:C})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>{x(!1),z(""),D(null)},disabled:s,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:Q,loading:s,children:"Confirm"})]})]})}),(0,d.jsx)(f.rq,{isOpen:G,onClose:()=>H(!1),onSelect:a=>{if(!I||a.isPlaceholder)return;let b={...E,[I]:a.value};F(b),M(b)},selectedModel:I?E[I]:null,activeProviders:n,modelAliases:p,title:`Select model for ${I}`})]})}var aB=c(2116),aC=c.n(aB);function aD({tool:a}){return(0,d.jsx)(aC(),{href:"/dashboard/mitm",className:"block",children:(0,d.jsx)(f.Zp,{padding:"sm",className:"overflow-hidden hover:border-primary/50 transition-colors cursor-pointer",children:(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.A,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-purple-500/10 text-purple-600 dark:text-purple-400 rounded-full",children:"MITM"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[20px]",children:"chevron_right"})]})})})}},36811:a=>{a.exports={TOOL_HOSTS:{antigravity:["daily-cloudcode-pa.googleapis.com","cloudcode-pa.googleapis.com"],copilot:["api.individual.githubcopilot.com"],kiro:["q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com"],cursor:["api2.cursor.sh"]}}},58962:(a,b,c)=>{c.d(b,{x6:()=>d.fetchJson,E2:()=>e,gs:()=>f});var d=c(86819);function e(a){if(!a)return null;let b=a.match(/\b([45]\d{2})\b/);return b?b[1]:"ERR"}function f(a){if(!a)return"";let b=Math.floor((Date.now()-new Date(a).getTime())/6e4);if(b<1)return"just now";if(b<60)return`${b}m ago`;let c=Math.floor(b/60);if(c<24)return`${c}h ago`;let d=Math.floor(c/24);return`${d}d ago`}},62911:(a,b,c)=>{c.d(b,{dM:()=>e,wn:()=>d});let d={antigravity:{id:"antigravity",name:"Antigravity",image:"/providers/antigravity.png",color:"#4285F4",description:"Google Antigravity IDE with MITM",configType:"mitm",mitmDomain:"daily-cloudcode-pa.googleapis.com",modelAliases:["gemini-4-argon-high","gemini-4-argon-medium","gemini-4-argon-low","gemini-3.8-flash-high","gemini-3.8-flash-medium","gemini-3.8-flash-low","claude-sonnet-5-5","claude-sonnet-5-5-low","claude-sonnet-5-5-medium","claude-sonnet-5-5-high","claude-opus-5-5","claude-opus-5-5-low","claude-opus-5-5-medium","claude-opus-5-5-high","claude-sonnet-4-6","claude-opus-4-6-thinking","gpt-oss-120b-medium","gemini-3-flash"],defaultModels:[{id:"gemini-4-argon-high",name:"Gemini 4 Argon (High)",alias:"gemini-4-argon-high"},{id:"gemini-4-argon-medium",name:"Gemini 4 Argon (Medium)",alias:"gemini-4-argon-medium"},{id:"gemini-4-argon-low",name:"Gemini 4 Argon (Low)",alias:"gemini-4-argon-low"},{id:"gemini-3.8-flash-high",name:"Gemini 3.8 Flash (High)",alias:"gemini-3.8-flash-high"},{id:"gemini-3.8-flash-medium",name:"Gemini 3.8 Flash (Medium)",alias:"gemini-3.8-flash-medium"},{id:"gemini-3.8-flash-low",name:"Gemini 3.8 Flash (Low)",alias:"gemini-3.8-flash-low"},{id:"claude-sonnet-5-5",name:"Claude Sonnet 5.5 (Thinking)",alias:"claude-sonnet-5-5"},{id:"claude-sonnet-5-5-low",name:"Claude Sonnet 5.5 (Low)",alias:"claude-sonnet-5-5-low"},{id:"claude-sonnet-5-5-medium",name:"Claude Sonnet 5.5 (Medium)",alias:"claude-sonnet-5-5-medium"},{id:"claude-sonnet-5-5-high",name:"Claude Sonnet 5.5 (High)",alias:"claude-sonnet-5-5-high"},{id:"claude-opus-5-5",name:"Claude Opus 5.5 (Thinking)",alias:"claude-opus-5-5"},{id:"claude-opus-5-5-low",name:"Claude Opus 5.5 (Low)",alias:"claude-opus-5-5-low"},{id:"claude-opus-5-5-medium",name:"Claude Opus 5.5 (Medium)",alias:"claude-opus-5-5-medium"},{id:"claude-opus-5-5-high",name:"Claude Opus 5.5 (High)",alias:"claude-opus-5-5-high"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6 (Thinking)",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"},{id:"gemini-3-flash",name:"Gemini 3 Flash (Command)",alias:"gemini-3-flash"}]},kiro:{id:"kiro",name:"Kiro",image:"/providers/kiro.png",color:"#FF6B00",description:"Kiro IDE with MITM",configType:"mitm",mitmDomain:"q.us-east-1.amazonaws.com",defaultModels:[{id:"auto",name:"Auto (Kiro Agent)",alias:"auto"},{id:"claude-opus-5.5",name:"Claude Opus 5.5",alias:"claude-opus-5.5"},{id:"claude-sonnet-5.5",name:"Claude Sonnet 5.5",alias:"claude-sonnet-5.5"},{id:"claude-haiku-5.5",name:"Claude Haiku 5.5",alias:"claude-haiku-5.5"},{id:"gpt-5.6-sol",name:"GPT 5.6 Sol",alias:"gpt-5.6-sol"},{id:"gpt-5.6-terra",name:"GPT 5.6 Terra",alias:"gpt-5.6-terra"},{id:"gpt-5.6-luna",name:"GPT 5.6 Luna",alias:"gpt-5.6-luna"},{id:"grok-4.7",name:"Grok 4.7",alias:"grok-4.7"},{id:"kimi-k3",name:"Kimi K3",alias:"kimi-k3"},{id:"claude-opus-5",name:"Claude Opus 5",alias:"claude-opus-5"},{id:"claude-sonnet-5",name:"Claude Sonnet 5",alias:"claude-sonnet-5"},{id:"claude-opus-4.8",name:"Claude Opus 4.8",alias:"claude-opus-4.8"},{id:"claude-opus-4.7",name:"Claude Opus 4.7",alias:"claude-opus-4.7"},{id:"claude-opus-4.6",name:"Claude Opus 4.6",alias:"claude-opus-4.6"},{id:"claude-sonnet-4.6",name:"Claude Sonnet 4.6",alias:"claude-sonnet-4.6"},{id:"claude-opus-4.5",name:"Claude Opus 4.5",alias:"claude-opus-4.5"},{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5",alias:"claude-sonnet-4.5"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5",alias:"claude-haiku-4.5"},{id:"deepseek-3.2",name:"DeepSeek 3.2",alias:"deepseek-3.2"},{id:"minimax-m2.5",name:"MiniMax M2.5",alias:"minimax-m2.5"},{id:"minimax-m2.1",name:"MiniMax M2.1",alias:"minimax-m2.1"},{id:"glm-5",name:"GLM 5",alias:"glm-5"},{id:"qwen3-coder-next",name:"Qwen3 Coder Next",alias:"qwen3-coder-next"},{id:"simple-task",name:"Simple Task (background)",alias:"simple-task"}]}},e={claude:{id:"claude",name:"Claude Code",image:"/providers/claude.png",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-6"},{id:"sonnet",name:"Claude Sonnet",alias:"sonnet",envKey:"ANTHROPIC_DEFAULT_SONNET_MODEL",defaultValue:"cc/claude-sonnet-4-6"},{id:"haiku",name:"Claude Haiku",alias:"haiku",envKey:"ANTHROPIC_DEFAULT_HAIKU_MODEL",defaultValue:"cc/claude-haiku-4-5-20251001"}]},openclaw:{id:"openclaw",name:"Open Claw",image:"/providers/openclaw.png",color:"#FF6B35",description:"Open Claw AI Assistant",configType:"custom"},codex:{id:"codex",name:"OpenAI Codex CLI / App",image:"/providers/codex.png",color:"#10A37F",description:"OpenAI Codex CLI",configType:"custom"},copilot:{id:"copilot",name:"GitHub Copilot",image:"/providers/copilot.png",color:"#1F6FEB",description:"GitHub Copilot Chat in VS Code via an OpenAI-compatible model provider",configType:"guide",docsUrl:"https://code.visualstudio.com/docs/copilot/customization/language-models",guideSteps:[{step:1,title:"Open Manage Models",desc:"In VS Code, open Copilot Chat, click the model picker at the bottom, then choose 'Manage Models...' and add an 'OpenAI Compatible' provider."},{step:2,title:"Configure Server",desc:"Enter this Base URL, then paste a ZevaiRouter API key when VS Code asks for it:",value:"{{baseUrl}}",copyable:!0},{step:3,title:"Select Model in Copilot Chat",desc:"Open Copilot Chat, click the model picker at the bottom → 'Manage Models...' → check the ZevaiRouter models to use."}]},"grok-build":{id:"grok-build",name:"Grok Build",image:"/providers/grok-cli.png",color:"#111111",description:"xAI coding agent with ZevaiRouter main and subagent model routing",configType:"custom"},opencode:{id:"opencode",name:"OpenCode",image:"/providers/opencode.png",color:"#E87040",description:"OpenCode AI Terminal Assistant",configType:"custom"},cowork:{id:"cowork",name:"Claude Cowork",image:"/providers/claude.png",color:"#D97757",description:"Claude Desktop Cowork (third-party inference)",configType:"custom"},hermes:{id:"hermes",name:"Hermes Agent",image:"/providers/hermes.png",color:"#8B5CF6",description:"Nous Research self-improving AI agent",configType:"custom",roles:[{id:"delegation",label:"Delegation (subagents)"},{id:"vision",label:"Vision"},{id:"compression",label:"Compression"},{id:"title_generation",label:"Title Generation"},{id:"approval",label:"Approval"},{id:"skills_hub",label:"Skills Hub"},{id:"mcp",label:"MCP"},{id:"review",label:"Review (/review subagent)"},{id:"memory_query_rewrite",label:"Memory Query Rewrite"},{id:"background_review",label:"Background Review"},{id:"curator",label:"Curator"},{id:"monitor",label:"Monitor"},{id:"tts_audio_tags",label:"TTS Audio Tags"},{id:"triage_specifier",label:"Triage Specifier"},{id:"kanban_decomposer",label:"Kanban Decomposer"},{id:"profile_describer",label:"Profile Describer"},{id:"goal_judge",label:"Goal Judge"}]},droid:{id:"droid",name:"Factory Droid",image:"/providers/droid.png",color:"#00D4FF",description:"Factory Droid AI Assistant",configType:"custom"},cursor:{id:"cursor",name:"Cursor",image:"/providers/cursor.png",color:"#000000",description:"Cursor AI Code Editor",configType:"guide",requiresExternalUrl:!0,notes:[{type:"warning",text:"Requires Cursor Pro account to use this feature."},{type:"cloudCheck",text:"Cursor's custom OpenAI endpoint is called from Cursor's server, so a local base URL is not supported. Use Tunnel or Cloud Endpoint, or map models in the Cursor MITM tool instead."}],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",configType:"custom"},kilo:{id:"kilo",name:"Kilo Code",image:"/providers/kilocode.png",color:"#FF6B6B",description:"Kilo Code AI Assistant",configType:"custom"},roo:{id:"roo",name:"Roo",image:"/providers/roo.png",color:"#FF6B6B",description:"Roo AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Settings",desc:"Go to Roo Settings panel"},{step:2,title:"Select Provider",desc:"Choose API Provider → Ollama"},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Select Model",type:"modelSelector"}]},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:`{
49
+ timeoutMs: 20000`}])})]})}let ah="/api/cli-tools/openbot-settings";function ai({tool:a,isExpanded:b,onToggle:c,initialStatus:h}){let[i,j]=(0,e.useState)(h||null),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(()=>new Set),[q,r]=(0,e.useState)(""),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(null),w=(0,e.useCallback)(async()=>{l(!0);try{let a=await fetch(`${ah}?models=1`,{cache:"no-store"});j(await a.json())}catch(a){j({installed:!1,error:a.message})}finally{l(!1)}},[]),x=(0,e.useMemo)(()=>i?.endpoints||[],[i]),y=x.find(a=>a.id===m)||null,z=(0,e.useMemo)(()=>new Set(y?.agentModelIds||[]),[y]),A=i?.maxModels||64,B=(0,e.useMemo)(()=>i?.routerModels||[],[i]),C=(0,e.useMemo)(()=>{let a=q.trim().toLowerCase(),b=new Map;for(let c of B){if(a&&!c.id.toLowerCase().includes(a))continue;let d=function(a){let b=a.indexOf("/");return b>0?a.slice(0,b):a}(c.id);b.has(d)||b.set(d,[]),b.get(d).push(c)}return[...b.entries()]},[B,q]),D=(0,e.useMemo)(()=>new Set(B.map(a=>a.id)),[B]),E=(y?.modelIds||[]).filter(a=>!D.has(a)&&!z.has(a)),F=async()=>{if(y&&!s){t(!0),v(null);try{let a=await fetch(ah,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerId:y.id,models:[...o].filter(a=>D.has(a)||z.has(a))})}),b=await a.json();if(!a.ok)throw Error(b.error||"Sync failed");let c=[`${b.modelCount} models saved to "${y.name}"`];b.added.length&&c.push(`${b.added.length} added`),b.removed.length&&c.push(`${b.removed.length} removed`),b.rejected.length&&c.push(`${b.rejected.length} skipped`),v({type:"success",text:`${c.join(", ")}. Open OpenBot to use them.`}),await w()}catch(a){v({type:"error",text:a.message})}finally{t(!1)}}},G=i?.installed?i.hasZevai?"configured":"not_configured":null;return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:a.image?(0,d.jsx)(g.A,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}}):(0,d.jsx)("span",{className:"material-symbols-outlined text-[28px]",style:{color:a.color},children:a.icon||"smart_toy"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===G&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===G&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[k&&!i?.routerModels&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Reading OpenBot endpoints and router models..."})]}),i&&!i.installed&&(0,d.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:i.message||i.error||"OpenBot not detected on this computer."})]}),i?.installed&&(0,d.jsxs)(d.Fragment,{children:[a.notes?.map(a=>(0,d.jsxs)("div",{className:`flex items-start gap-2 p-2 rounded text-xs ${"warning"===a.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"bg-blue-500/10 text-blue-600 dark:text-blue-400"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5",children:"warning"===a.type?"warning":"info"}),(0,d.jsx)("span",{children:a.text})]},a.text)),i.error&&(0,d.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded text-xs bg-red-500/10 text-red-600",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5",children:"error"}),(0,d.jsx)("span",{children:i.error})]}),!i.error&&0===x.length&&(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["OpenBot has no endpoint pointing at this router yet. In OpenBot, add a custom endpoint with base URL"," ",(0,d.jsxs)("code",{className:"font-mono",children:["http://127.0.0.1:","1997","/v1"]})," ","and a ZevaiRouter API key, then come back here to pick its models."]}),y&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[x.length>1&&(0,d.jsx)("select",{value:m,onChange:a=>n(a.target.value),className:"rounded-lg border border-border bg-surface px-2 py-1.5 text-sm",children:x.map(a=>(0,d.jsxs)("option",{value:a.id,children:[a.name," (",a.id,")"]},a.id))}),(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["Endpoint ",(0,d.jsx)("strong",{className:"text-text-main",children:y.name})," \xb7 ",y.baseUrl,!y.hasApiKey&&" \xb7 no API key saved in OpenBot"]}),(0,d.jsxs)("span",{className:`ml-auto text-xs font-semibold ${o.size>=A?"text-amber-600":"text-text-main"}`,children:[o.size," / ",A," selected"]})]}),i.running&&(0,d.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded text-xs bg-amber-500/10 text-amber-700 dark:text-amber-300",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5",children:"block"}),(0,d.jsx)("span",{children:"OpenBot is open. Quit it (Cmd+Q) before syncing, then press Refresh."})]}),E.length>0&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[E.length," saved model",1===E.length?" is":"s are"," no longer offered by the router and will be removed: ",E.join(", ")]}),(0,d.jsx)("input",{type:"search",value:q,onChange:a=>r(a.target.value),placeholder:"Filter models",className:"rounded-lg border border-border bg-surface px-3 py-1.5 text-sm"}),(0,d.jsx)("div",{className:"max-h-[28rem] overflow-y-auto rounded-xl border border-border custom-scrollbar",children:C.map(([a,b])=>{let c=b.filter(a=>a.openbotCompatible&&!z.has(a.id)),e=c.length>0&&c.every(a=>o.has(a.id));return(0,d.jsxs)("div",{className:"border-b border-border-subtle last:border-b-0",children:[(0,d.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between bg-surface-2 px-3 py-1.5",children:[(0,d.jsxs)("span",{className:"font-mono text-xs font-semibold text-text-main",children:[a,"/ (",b.length,")"]}),c.length>0&&(0,d.jsx)("button",{type:"button",className:"text-xs font-medium text-primary hover:underline",onClick:()=>{var a;return a=!e,void p(c=>{let d=new Set(c);for(let c of b)if(!(!c.openbotCompatible||z.has(c.id)))if(a){if(d.size>=A)break;d.add(c.id)}else d.delete(c.id);return d})},children:e?"Clear":"Select all"})]}),b.map(a=>{let b=z.has(a.id),c=!a.openbotCompatible||b||!o.has(a.id)&&o.size>=A;return(0,d.jsxs)("label",{className:`flex items-center gap-3 px-3 py-1.5 text-sm ${c&&!b?"opacity-50":"cursor-pointer hover:bg-surface-2"}`,children:[(0,d.jsx)("input",{type:"checkbox",checked:o.has(a.id)||b,disabled:c,onChange:()=>{var b;return b=a.id,void(!z.has(b)&&p(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.size<A&&c.add(b),c}))},className:"accent-primary"}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:a.id}),b&&(0,d.jsx)("span",{className:"rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"Used by an agent"}),!a.openbotCompatible&&(0,d.jsx)("span",{className:"rounded-full bg-zinc-500/10 px-2 py-0.5 text-[10px] font-medium text-text-muted",title:"OpenBot rejects model ids with characters such as @",children:"Not supported by OpenBot"}),a.context_length&&(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:[Math.round(a.context_length/1e3),"K"]})]},a.id)})]},a)})})]}),u&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===u.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===u.type?"check_circle":"error"}),(0,d.jsx)("span",{children:u.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:F,disabled:!y||i.running||0===o.size,loading:s,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"sync"}),"Sync to OpenBot"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:w,loading:k,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"refresh"}),"Refresh"]}),i.configPath&&(0,d.jsx)("span",{className:"truncate text-[11px] text-text-muted",children:i.configPath})]})]})]})]})}let aj="/api/cli-tools/dsh-settings",ak=`${aj}?models=1`;function al({type:a,children:b}){let c={info:["info","bg-blue-500/10 text-blue-600 dark:text-blue-400"],warning:["warning","bg-yellow-500/10 text-yellow-600 dark:text-yellow-400"],error:["error","bg-red-500/10 text-red-600"],success:["check_circle","bg-green-500/10 text-green-600"]},[e,f]=c[a]||c.info;return(0,d.jsxs)("div",{className:`flex items-start gap-2 p-2 rounded text-xs ${f}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5",children:e}),(0,d.jsx)("span",{className:"min-w-0 break-words",children:b})]})}function am({label:a,children:b}){return(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:a}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),b]})}function an({tool:a,isExpanded:b,onToggle:c,apiKeys:h,cloudEnabled:i,initialStatus:j,tunnelEnabled:k,tunnelPublicUrl:n,tailscaleEnabled:p,tailscaleUrl:q}){let r,[s,t]=(0,e.useState)(j||null),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(""),[C,D]=(0,e.useState)(""),[E,F]=(0,e.useState)(""),[G,H]=(0,e.useState)(""),I=async()=>{v(!0);try{let a=await fetch(ak);t(await a.json())}catch(a){t({installed:!1,error:a.message})}finally{v(!1)}},J=(r=C||"http://127.0.0.1:1997").endsWith("/v1")?r:`${r}/v1`,K=A?.trim()||h?.[0]?.key||(i?null:"sk_zevai"),L=s?.models||[],M=s?.defaultModel,N=L.find(a=>a.id===E),O=s?.installed?s.hasZevai?o(s.baseUrl,{tunnelPublicUrl:n,tailscaleUrl:q})?"configured":"other":"not_configured":null,P=async(a,b,c)=>{x(a),z(null);try{let a=await fetch(aj,{method:b,headers:{"Content-Type":"application/json"},...c?{body:JSON.stringify(c)}:{}}),d=await a.json();if(!a.ok)return z({type:"error",text:d.error||"Request failed"}),null;return await I(),d}catch(a){return z({type:"error",text:a.message}),null}finally{x(null)}},Q=async()=>{let a=await P("sync","POST",{baseUrl:J,apiKey:K});a&&z({type:"success",text:`Synced ${a.modelCount} models (${a.reasoningModels} with effort levels).`})},R=async()=>{await P("default","PATCH",{model:E,reasoningEffort:G||null})&&z({type:"success",text:`Default model is now zevai / ${E}.`})},S=async()=>{await P("remove","DELETE")&&z({type:"success",text:"Removed the zevai provider from DeepSeek Harness."})};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.A,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===O&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===O&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===O&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-3",children:[u&&!s?.installed&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Looking for DeepSeek Harness..."})]}),!u&&s&&!s.installed&&(0,d.jsx)(al,{type:"warning",children:s.message||"DeepSeek Harness not detected. Install the app and open it once."}),s?.installed&&(0,d.jsxs)(d.Fragment,{children:[a.notes?.map(a=>(0,d.jsx)(al,{type:a.type,children:a.text},a.text)),s.error&&(0,d.jsx)(al,{type:"error",children:s.error}),(0,d.jsx)(am,{label:"Select Endpoint",children:(0,d.jsx)(l,{value:C||J,onChange:D,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:k,tunnelPublicUrl:n,tailscaleEnabled:p,tailscaleUrl:q})}),(0,d.jsx)(am,{label:"API Key",children:(0,d.jsx)(m,{value:A,onChange:B,apiKeys:h,cloudEnabled:i})}),s.hasZevai&&(0,d.jsx)(am,{label:"Current",children:(0,d.jsxs)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-1.5 text-xs text-text-muted",children:[s.baseUrl," \xb7 ",s.modelCount," models",s.hasKeyRef?"":" \xb7 key reference missing"]})}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:Q,disabled:!K||!!s.error,loading:"sync"===w,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"sync"}),"Sync models"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:S,disabled:!s.hasZevai,loading:"remove"===w,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"delete"}),"Remove"]})]}),(0,d.jsxs)("div",{className:"mt-2 flex flex-col gap-2 border-t border-border pt-3",children:[(0,d.jsx)("p",{className:"text-xs font-semibold text-text-main",children:"Default model"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:M?.provider?`Now: ${M.provider} / ${M.model||"?"}${M.reasoningEffort?` (${M.reasoningEffort})`:""}`:"Now: DeepSeek Harness built-in default"}),M?.broken&&(0,d.jsxs)(al,{type:"warning",children:[M.reason,". New chats may fail until you pick a model below."]}),L.length>0?(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-[1fr_8rem_auto] sm:items-center",children:[(0,d.jsxs)("select",{className:"min-w-0 rounded border border-border bg-surface px-2 py-1.5 text-xs",value:E,onChange:a=>{let b,c=L.find(b=>b.id===a.target.value);F(a.target.value),H(c?(b=c.efforts).includes("high")?"high":b[b.length-1]||"":"")},children:[(0,d.jsx)("option",{value:"",children:"Choose a zevai model"}),L.map(a=>(0,d.jsx)("option",{value:a.id,children:a.id},a.id))]}),(0,d.jsxs)("select",{className:"rounded border border-border bg-surface px-2 py-1.5 text-xs disabled:opacity-50",value:G,onChange:a=>H(a.target.value),disabled:!N?.efforts.length,children:[(0,d.jsx)("option",{value:"",children:"No effort"}),N?.efforts.map(a=>(0,d.jsx)("option",{value:a,children:a},a))]}),(0,d.jsx)(f.$n,{variant:"secondary",size:"sm",onClick:R,disabled:!E,loading:"default"===w,children:"Set default"})]}):(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Sync models first to pick a zevai default."})]}),y&&(0,d.jsx)(al,{type:y.type,children:y.text})]})]})]})}let ao=[2e5,4e5,6e5,1e6],ap=[16e3,32e3,64e3,128e3],aq={contextWindow:2e5,maxTokens:64e3};function ar(a,b){let c=Number(a);return Number.isFinite(c)&&c>0&&c<=b?c:null}function as(a,b,c,d){if(null!=a&&""!==a){let b=ar(a,d);if(null!==b)return b}return ar(b,d)??c}function at(a){let b=Number(a);return Number.isFinite(b)?b>=1e6?`${+(b/1e6).toFixed(2)}M`:`${Math.round(b/1e3)}k`:String(a)}function au(a,b){return a.includes(b)?a:[...a,b].sort((a,b)=>a-b)}let av={pi:"npm install -g --ignore-scripts @earendil-works/pi-coding-agent",crush:"brew install charmbracelet/tap/crush",forge:"cargo install forgecode",smelt:"cargo install smelt",codewhale:"cargo install codewhale"};function aw({tool:a,apiKeys:b,activeProviders:c=[],cloudEnabled:h,initialStatus:i,tunnelPublicUrl:j,tailscaleUrl:k}){let n=`/api/cli-tools/${a.id}-settings`,[p,q]=(0,e.useState)(i||null),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)(""),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)([]),[F,G]=(0,e.useState)({}),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)(""),N=()=>{let a=(L||"http://127.0.0.1:1997").replace(/\/+$/,"");return a.endsWith("/v1")?a:`${a}/v1`},O=async()=>{s(!0);try{let b,c=await fetch(n),d=await c.json();q(d);let e=(b=d?.config,b?.model||b?.openai?.model||b?.providers?.zevai?.models?.[0]?.id||b?.providers?.zevai?.models?.[0]||"");if(e&&!B&&C("string"==typeof e?e:e.id),"pi"===a.id){let a=function(a){let b=a?.providers?.zevai?.models;if(!Array.isArray(b)||0===b.length)return null;let c={};return{ids:b.map(a=>{let b="string"==typeof a?a:a?.id;return b&&"string"!=typeof a&&(c[b]={contextWindow:as(a.contextWindow,void 0,aq.contextWindow,2e6),maxTokens:as(a.maxTokens,void 0,aq.maxTokens,2e5)}),b}).filter(Boolean),caps:c}}(d?.config);a&&(E(a.ids),G(a.caps))}}catch(a){q({installed:!1,error:a.message})}finally{s(!1)}},P=p?.installed?p.hasZevai?o(p.baseUrl,{tunnelPublicUrl:j,tailscaleUrl:k})?"configured":"other":"not_configured":null,Q=z?.trim()||(b?.length>0?b[0].key:"")||(h?"":"sk_zevai"),R=async()=>{u(!0),y(null);try{let b={baseUrl:N(),apiKey:Q,model:B||"provider/model-id"};if("pi"===a.id){let a=D.length>0?D:[b.model];b.models=a.map(a=>({id:a,name:a,...aq,...F[a]}))}let c=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),d=await c.json();y({type:c.ok?"success":"error",text:d.message||d.error||"Failed to apply settings"}),c.ok&&await O()}catch(a){y({type:"error",text:a.message})}finally{u(!1)}},S=async()=>{w(!0),y(null);try{let a=await fetch(n,{method:"DELETE"}),b=await a.json();y({type:a.ok?"success":"error",text:b.message||b.error||"Failed to reset"}),a.ok&&await O()}catch(a){y({type:"error",text:a.message})}finally{w(!1)}},T=a=>{E(a),G(b=>{let c={};for(let d of a)c[d]=b[d]||{...aq};return c})},U=(a,b,c)=>{G(d=>({...d,[a]:{...aq,...d[a],[b]:Number(c)}}))};return(0,d.jsxs)(f.Zp,{padding:"sm",className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[a.image?(0,d.jsx)(g.A,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg"}):(0,d.jsx)("span",{className:"material-symbols-outlined text-[28px]",style:{color:a.color},children:a.icon||"terminal"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("h2",{className:"font-medium",children:a.name}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:a.description})]}),(0,d.jsx)("span",{className:`px-2 py-0.5 text-[10px] rounded-full ${"configured"===P?"bg-green-500/10 text-green-600":"other"===P?"bg-blue-500/10 text-blue-600":p?.installed?"bg-yellow-500/10 text-yellow-600":"bg-gray-500/10 text-gray-500"}`,children:r?"Checking":"configured"===P?"Connected":p?.installed?"Not configured":"Not installed"})]}),a.notes?.map(a=>(0,d.jsx)("p",{className:"text-xs text-text-muted",children:a.text},a.text)),!p?.installed&&(0,d.jsx)("pre",{className:"overflow-x-auto rounded-lg bg-bg-secondary p-3 text-xs",children:av[a.id]||`Install ${a.name}`}),(0,d.jsx)(l,{value:L,onChange:M,tunnelEnabled:!!j,tunnelPublicUrl:j,tailscaleEnabled:!!k,tailscaleUrl:k,cloudEnabled:h}),(0,d.jsx)(m,{value:z,onChange:A,apiKeys:b,cloudEnabled:h}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,d.jsx)("input",{value:"pi"===a.id?D.join(", "):B,onChange:b=>{"pi"===a.id?T(b.target.value.split(",").map(a=>a.trim()).filter(Boolean)):C(b.target.value)},placeholder:"provider/model-id",className:"flex-1 rounded-lg border border-border bg-bg-secondary px-3 py-2 text-sm"}),(0,d.jsx)(f.$n,{variant:"secondary",onClick:()=>I(!0),disabled:0===c.length,children:"Select model"})]}),"pi"===a.id&&D.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-1.5",children:D.map(a=>{let b={...aq,...F[a]};return(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 text-xs",children:[(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a}),(0,d.jsx)("select",{value:b.contextWindow,onChange:b=>U(a,"contextWindow",b.target.value),title:"Context window",className:"rounded border border-border bg-bg-secondary px-1 py-0.5",children:au(ao,b.contextWindow).map(a=>(0,d.jsxs)("option",{value:a,children:[at(a)," ctx"]},a))}),(0,d.jsx)("select",{value:b.maxTokens,onChange:b=>U(a,"maxTokens",b.target.value),title:"Max output tokens",className:"rounded border border-border bg-bg-secondary px-1 py-0.5",children:au(ap,b.maxTokens).map(a=>(0,d.jsxs)("option",{value:a,children:[at(a)," out"]},a))})]},a)})}),x&&(0,d.jsx)("p",{className:`text-sm ${"error"===x.type?"text-red-500":"text-green-600"}`,children:x.text}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(f.$n,{onClick:R,disabled:t||!Q,children:t?"Applying":"Apply"}),(0,d.jsx)(f.$n,{variant:"secondary",onClick:S,disabled:v,children:"Reset"}),(0,d.jsx)(f.$n,{variant:"ghost",onClick:()=>K(!0),children:"Manual"})]}),(0,d.jsx)(f.rq,{isOpen:H,onClose:()=>I(!1),onSelect:b=>{"pi"===a.id?T(D.includes(b.value)?D:[...D,b.value]):C(b.value),I(!1)},activeProviders:c,title:`Select model for ${a.name}`}),(0,d.jsx)(f.uR,{isOpen:J,onClose:()=>K(!1),title:`${a.name} manual config`,configs:[{filename:p?.configPath||`${a.name} config`,content:JSON.stringify({baseUrl:N(),apiKey:Q||"<API_KEY>",model:B||"provider/model-id"},null,2)}]})]})}let ax="http://localhost:1997";function ay({apiKeys:a,cloudEnabled:b,onStatusChange:c}){let[g,h]=(0,e.useState)(null),[i,j]=(0,e.useState)(!1),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(()=>a?.[0]?.key||""),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(ax),[y,z]=(0,e.useState)(null),A=g?.isWin===!0,B=A||g?.hasCachedPassword||g?.needsSudoPassword===!1,C=g?.isAdmin!==!1;!C&&(A||g?.hasCachedPassword||g?.needsSudoPassword);let D=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/cli-tools/antigravity-mitm");if(a.ok){let b=await a.json();h(b),b.mitmRouterBaseUrl&&x(b.mitmRouterBaseUrl),c?.(b)}}catch{h({running:!1,certExists:!1,dnsStatus:{}})}},[c]),E=a=>{v(null),g&&(B?F(a,""):(r(a),l(!0),t(null)))},F=async(c,d,e=!1)=>{j(!0),v(null);try{let f;if("trust-cert"===c)f=await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"trust-cert",sudoPassword:d})});else if("start"===c){let c=o?.trim()||(a?.length>0?a[0].key:null)||(b?null:"sk_zevai");f=await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:c,sudoPassword:d,mitmRouterBaseUrl:w.trim()||ax,forceKillPort443:e})})}else f=await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:d})});if(!f.ok){let a=await f.json().catch(()=>({}));if("PORT_443_BUSY"===a.code&&a.portOwner){l(!1),z({owner:a.portOwner,password:d});return}v(a.error||`Failed to ${c} MITM server`);return}l(!1),n(""),z(null),await D()}catch(a){v(a.message||"Network error")}finally{j(!1),r(null)}},G=()=>{m.trim()?F(q,m):t("Sudo password is required")},H=g?.running;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.Zp,{padding:"sm",className:"border-primary/20 bg-primary/5",children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"security"}),(0,d.jsx)("span",{className:"font-semibold text-sm text-text-main",children:"MITM Server"}),H?(0,d.jsx)(f.Ex,{variant:"success",size:"sm",children:"Running"}):(0,d.jsx)(f.Ex,{variant:"default",size:"sm",children:"Stopped"})]}),(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-1 text-xs text-text-muted","data-i18n-skip":"true",children:[{label:"Cert",ok:g?.certExists},{label:"Trusted",ok:g?.certTrusted},{label:"Server",ok:H}].map(({label:a,ok:b})=>(0,d.jsxs)("span",{className:`flex items-center gap-0.5 px-1.5 py-0.5 rounded ${b?"text-green-600":"text-text-muted"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:b?"check_circle":"cancel"}),a]},a))})]}),(0,d.jsxs)("div",{className:"px-2 py-2 rounded-lg bg-surface/50 border border-border/50 flex flex-col gap-2",children:[(0,d.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:"Purpose:"})," Use Antigravity IDE & GitHub Copilot → with ANY provider/model from ZevaiRouter"]}),(0,d.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:"How it works:"})," Antigravity/Copilot IDE request → DNS redirect to localhost:443 → MITM proxy intercepts → ZevaiRouter → response to Antigravity/Copilot"]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid gap-1 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"ZevaiRouter Base URL"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:w,onChange:a=>x(a.target.value),placeholder:ax,disabled:H,className:"flex-1 min-w-0 px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50 disabled:opacity-50"})]}),!H&&(0,d.jsxs)("div",{className:"grid gap-1 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",list:"mitm-api-keys",value:o,onChange:a=>p(a.target.value),placeholder:b?"Enter or pick API key":"sk_zevai (default)",className:"flex-1 min-w-0 px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50"}),a?.length>0&&(0,d.jsx)("datalist",{id:"mitm-api-keys",children:a.map(a=>(0,d.jsx)("option",{value:a.key,children:a.name||a.key},a.id))})]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center","data-i18n-skip":"true",children:[g?.certExists&&!g?.certTrusted&&(0,d.jsxs)("button",{onClick:()=>E("trust-cert"),disabled:i,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-yellow-500/30 bg-yellow-500/10 px-4 py-2 text-xs font-medium text-yellow-600 transition-colors hover:bg-yellow-500/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"verified_user"}),"Trust Cert"]}),H?(0,d.jsxs)("button",{onClick:()=>E("stop"),disabled:i,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-xs font-medium text-red-500 transition-colors hover:bg-red-500/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop Server"]}):(0,d.jsxs)("button",{onClick:()=>E("start"),disabled:i||!g||A&&!C,title:A&&!C?"Administrator required":void 0,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-primary/30 bg-primary/10 px-4 py-2 text-xs font-medium text-primary transition-colors hover:bg-primary/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start Server"]}),H&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Enable DNS per tool below to activate interception"})]}),u&&(0,d.jsxs)("div",{className:"flex items-start gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600 dark:text-red-400 border border-red-500/20",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5 shrink-0",children:"error"}),(0,d.jsx)("span",{children:u})]}),A&&!C&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600 border border-red-500/20",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"shield_lock"}),(0,d.jsx)("span",{children:"Administrator required — restart ZevaiRouter as Administrator to use MITM"})]})]})}),k&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,d.jsxs)("div",{className:"mx-4 flex w-full max-w-sm flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,d.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Required for SSL certificate and server startup"})]}),(0,d.jsx)(f.pd,{type:"password",placeholder:"Enter sudo password",value:m,onChange:a=>n(a.target.value),onKeyDown:a=>{"Enter"!==a.key||i||G()}}),s&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,d.jsx)("span",{children:s})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>{l(!1),n(""),t(null)},disabled:i,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:G,loading:i,children:"Confirm"})]})]})}),y&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,d.jsxs)("div",{className:"mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,d.jsx)("h3",{className:"font-semibold text-text-main",children:"Port 443 Already In Use"}),(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,d.jsxs)("div",{className:"flex flex-col gap-1 text-xs text-text-muted",children:[(0,d.jsx)("p",{children:"Port 443 is currently used by another process:"}),(0,d.jsxs)("p",{className:"font-mono text-text-main","data-i18n-skip":"true",children:[y.owner.name," (PID ",y.owner.pid,")"]}),(0,d.jsx)("p",{children:"Kill this process to start MITM Server?"})]})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>{z(null),j(!1)},disabled:i,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:()=>{F("start",y?.password||"",!0)},loading:i,children:"Kill & Start"})]})]})})]})}var az=c(36811);function aA({tool:a,isExpanded:b,onToggle:c,serverRunning:h,dnsActive:i,hasCachedPassword:j,needsSudoPassword:k,isWin:l,apiKeys:m,activeProviders:n,hasActiveProviders:o,modelAliases:p={},cloudEnabled:q,onDnsChange:r}){let[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(""),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(null),[E,F]=(0,e.useState)({}),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(null),K=az.TOOL_HOSTS[a.id]??[],L=l||j||!1===k,M=(0,e.useCallback)(async b=>{try{await fetch("/api/cli-tools/antigravity-mitm/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:a.id,mappings:b})})}catch{}},[a.id]),N=(a,b)=>{F(c=>({...c,[a]:b}))},O=()=>{if(!h)return;let a=i?"disable":"enable";L?P(a,""):(B(a),x(!0),D(null))},P=async(b,c)=>{t(!0),v(null);try{let d=await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:a.id,action:b,sudoPassword:c})}),e=await d.json();if(!d.ok)throw Error(e.error||"Failed to toggle DNS");"enable"===b&&v(`Restart ${a.name} to apply changes`),x(!1),z(""),r?.(e)}catch{}finally{t(!1),B(null)}},Q=()=>{y.trim()?P(A,y):D("Sudo password is required")};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.A,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),h?i?(0,d.jsx)(f.Ex,{variant:"success",size:"sm",children:"Active"}):(0,d.jsx)(f.Ex,{variant:"warning",size:"sm",children:"DNS off"}):(0,d.jsx)(f.Ex,{variant:"default",size:"sm",children:"Server off"})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted sm:truncate",children:["Intercept ",a.name," requests via MITM proxy"]})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[K.length>0&&(0,d.jsxs)("div",{className:"mt-2 rounded-md border border-border bg-surface/50 px-2 py-1.5",children:[(0,d.jsx)("p",{className:"text-[10px] font-medium tracking-wide text-text-main/80 mb-1",children:"Edit hosts file manually to add the following entries:"}),(0,d.jsx)("ul",{className:"list-none space-y-0.5 font-mono text-[10px] text-text-muted break-all",children:K.map(a=>(0,d.jsxs)("li",{children:["127.0.0.1 ",a]},a))})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-0.5 text-[11px] text-text-muted px-1",children:[(0,d.jsxs)("p",{children:["Toggle DNS to redirect ",a.name," traffic through ZevaiRouter via MITM."]}),!i&&(0,d.jsx)("p",{className:"text-amber-600 text-[10px] mt-1",children:"⚠️ Enable DNS to edit model mappings"})]}),a.defaultModels?.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-2",children:a.defaultModels.map(a=>(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[9rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right",children:a.name}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:E[a.alias]||"",onChange:b=>N(a.alias,b.target.value),onBlur:b=>{var c,d;return c=a.alias,d=b.target.value,void M({...E,[c]:d})},placeholder:"provider/model-id",disabled:!i,className:`w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5 ${!i?"opacity-50 cursor-not-allowed":""}`}),E[a.alias]&&(0,d.jsx)("button",{onClick:()=>{N(a.alias,""),M({...E,[a.alias]:""})},className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>{J(a.alias),H(!0)},disabled:!o||!i,className:`rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 ${o&&i?"bg-surface border-border hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]},a.alias))}),a.defaultModels?.length===0&&(0,d.jsx)("p",{className:"text-xs text-text-muted px-1",children:"Model mappings will be available soon."}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:items-start",children:[i?(0,d.jsxs)("button",{onClick:O,disabled:!h||s,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-xs font-medium text-red-500 transition-colors hover:bg-red-500/20 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop DNS"]}):(0,d.jsxs)("button",{onClick:O,disabled:!h||s,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-primary/30 bg-primary/10 px-4 py-2 text-xs font-medium text-primary transition-colors hover:bg-primary/20 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start DNS"]}),u&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs text-amber-500",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"warning"}),(0,d.jsx)("span",{children:u})]})]})]})]}),w&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,d.jsxs)("div",{className:"mx-4 flex w-full max-w-sm flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,d.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Required to modify /etc/hosts and flush DNS cache"})]}),(0,d.jsx)(f.pd,{type:"password",placeholder:"Enter sudo password",value:y,onChange:a=>z(a.target.value),onKeyDown:a=>{"Enter"!==a.key||s||Q()}}),C&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,d.jsx)("span",{children:C})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>{x(!1),z(""),D(null)},disabled:s,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:Q,loading:s,children:"Confirm"})]})]})}),(0,d.jsx)(f.rq,{isOpen:G,onClose:()=>H(!1),onSelect:a=>{if(!I||a.isPlaceholder)return;let b={...E,[I]:a.value};F(b),M(b)},selectedModel:I?E[I]:null,activeProviders:n,modelAliases:p,title:`Select model for ${I}`})]})}var aB=c(2116),aC=c.n(aB);function aD({tool:a}){return(0,d.jsx)(aC(),{href:"/dashboard/mitm",className:"block",children:(0,d.jsx)(f.Zp,{padding:"sm",className:"overflow-hidden hover:border-primary/50 transition-colors cursor-pointer",children:(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.A,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-purple-500/10 text-purple-600 dark:text-purple-400 rounded-full",children:"MITM"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[20px]",children:"chevron_right"})]})})})}},36811:a=>{a.exports={TOOL_HOSTS:{antigravity:["daily-cloudcode-pa.googleapis.com","cloudcode-pa.googleapis.com"],copilot:["api.individual.githubcopilot.com"],kiro:["q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com"],cursor:["api2.cursor.sh"]}}},58962:(a,b,c)=>{c.d(b,{x6:()=>d.fetchJson,E2:()=>e,gs:()=>f});var d=c(86819);function e(a){if(!a)return null;let b=a.match(/\b([45]\d{2})\b/);return b?b[1]:"ERR"}function f(a){if(!a)return"";let b=Math.floor((Date.now()-new Date(a).getTime())/6e4);if(b<1)return"just now";if(b<60)return`${b}m ago`;let c=Math.floor(b/60);if(c<24)return`${c}h ago`;let d=Math.floor(c/24);return`${d}d ago`}},62911:(a,b,c)=>{c.d(b,{dM:()=>e,wn:()=>d});let d={antigravity:{id:"antigravity",name:"Antigravity",image:"/providers/antigravity.png",color:"#4285F4",description:"Google Antigravity IDE with MITM",configType:"mitm",mitmDomain:"daily-cloudcode-pa.googleapis.com",modelAliases:["gemini-4-argon-high","gemini-4-argon-medium","gemini-4-argon-low","gemini-4-carbon-high","gemini-4-carbon-medium","gemini-4-carbon-low","gemini-4-hydrogen-xhigh","gemini-4-hydrogen-high","gemini-4-hydrogen-medium","gemini-4-hydrogen-low","gemini-3.8-flash-high","gemini-3.8-flash-medium","gemini-3.8-flash-low","claude-sonnet-5-5","claude-sonnet-5-5-low","claude-sonnet-5-5-medium","claude-sonnet-5-5-high","claude-opus-5-5","claude-opus-5-5-low","claude-opus-5-5-medium","claude-opus-5-5-high","claude-sonnet-4-6","claude-opus-4-6-thinking","gpt-oss-120b-medium","gemini-3-flash"],defaultModels:[{id:"gemini-4-argon-high",name:"Gemini 4 Argon (High)",alias:"gemini-4-argon-high"},{id:"gemini-4-argon-medium",name:"Gemini 4 Argon (Medium)",alias:"gemini-4-argon-medium"},{id:"gemini-4-argon-low",name:"Gemini 4 Argon (Low)",alias:"gemini-4-argon-low"},{id:"gemini-4-carbon-high",name:"Gemini 4 Carbon (High)",alias:"gemini-4-carbon-high"},{id:"gemini-4-carbon-medium",name:"Gemini 4 Carbon (Medium)",alias:"gemini-4-carbon-medium"},{id:"gemini-4-carbon-low",name:"Gemini 4 Carbon (Low)",alias:"gemini-4-carbon-low"},{id:"gemini-4-hydrogen-xhigh",name:"Gemini 4 Hydrogen (xHigh)",alias:"gemini-4-hydrogen-xhigh"},{id:"gemini-4-hydrogen-high",name:"Gemini 4 Hydrogen (High)",alias:"gemini-4-hydrogen-high"},{id:"gemini-4-hydrogen-medium",name:"Gemini 4 Hydrogen (Medium)",alias:"gemini-4-hydrogen-medium"},{id:"gemini-4-hydrogen-low",name:"Gemini 4 Hydrogen (Low)",alias:"gemini-4-hydrogen-low"},{id:"gemini-3.8-flash-high",name:"Gemini 3.8 Flash (High)",alias:"gemini-3.8-flash-high"},{id:"gemini-3.8-flash-medium",name:"Gemini 3.8 Flash (Medium)",alias:"gemini-3.8-flash-medium"},{id:"gemini-3.8-flash-low",name:"Gemini 3.8 Flash (Low)",alias:"gemini-3.8-flash-low"},{id:"claude-sonnet-5-5",name:"Claude Sonnet 5.5 (Thinking)",alias:"claude-sonnet-5-5"},{id:"claude-sonnet-5-5-low",name:"Claude Sonnet 5.5 (Low)",alias:"claude-sonnet-5-5-low"},{id:"claude-sonnet-5-5-medium",name:"Claude Sonnet 5.5 (Medium)",alias:"claude-sonnet-5-5-medium"},{id:"claude-sonnet-5-5-high",name:"Claude Sonnet 5.5 (High)",alias:"claude-sonnet-5-5-high"},{id:"claude-opus-5-5",name:"Claude Opus 5.5 (Thinking)",alias:"claude-opus-5-5"},{id:"claude-opus-5-5-low",name:"Claude Opus 5.5 (Low)",alias:"claude-opus-5-5-low"},{id:"claude-opus-5-5-medium",name:"Claude Opus 5.5 (Medium)",alias:"claude-opus-5-5-medium"},{id:"claude-opus-5-5-high",name:"Claude Opus 5.5 (High)",alias:"claude-opus-5-5-high"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6 (Thinking)",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"},{id:"gemini-3-flash",name:"Gemini 3 Flash (Command)",alias:"gemini-3-flash"}]},kiro:{id:"kiro",name:"Kiro",image:"/providers/kiro.png",color:"#FF6B00",description:"Kiro IDE with MITM",configType:"mitm",mitmDomain:"q.us-east-1.amazonaws.com",defaultModels:[{id:"auto",name:"Auto (Kiro Agent)",alias:"auto"},{id:"claude-opus-5.5",name:"Claude Opus 5.5",alias:"claude-opus-5.5"},{id:"claude-sonnet-5.5",name:"Claude Sonnet 5.5",alias:"claude-sonnet-5.5"},{id:"claude-haiku-5.5",name:"Claude Haiku 5.5",alias:"claude-haiku-5.5"},{id:"gpt-5.6-sol",name:"GPT 5.6 Sol",alias:"gpt-5.6-sol"},{id:"gpt-5.6-terra",name:"GPT 5.6 Terra",alias:"gpt-5.6-terra"},{id:"gpt-5.6-luna",name:"GPT 5.6 Luna",alias:"gpt-5.6-luna"},{id:"grok-4.7",name:"Grok 4.7",alias:"grok-4.7"},{id:"kimi-k3",name:"Kimi K3",alias:"kimi-k3"},{id:"claude-opus-5",name:"Claude Opus 5",alias:"claude-opus-5"},{id:"claude-sonnet-5",name:"Claude Sonnet 5",alias:"claude-sonnet-5"},{id:"claude-opus-4.8",name:"Claude Opus 4.8",alias:"claude-opus-4.8"},{id:"claude-opus-4.7",name:"Claude Opus 4.7",alias:"claude-opus-4.7"},{id:"claude-opus-4.6",name:"Claude Opus 4.6",alias:"claude-opus-4.6"},{id:"claude-sonnet-4.6",name:"Claude Sonnet 4.6",alias:"claude-sonnet-4.6"},{id:"claude-opus-4.5",name:"Claude Opus 4.5",alias:"claude-opus-4.5"},{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5",alias:"claude-sonnet-4.5"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5",alias:"claude-haiku-4.5"},{id:"deepseek-3.2",name:"DeepSeek 3.2",alias:"deepseek-3.2"},{id:"minimax-m2.5",name:"MiniMax M2.5",alias:"minimax-m2.5"},{id:"minimax-m2.1",name:"MiniMax M2.1",alias:"minimax-m2.1"},{id:"glm-5",name:"GLM 5",alias:"glm-5"},{id:"qwen3-coder-next",name:"Qwen3 Coder Next",alias:"qwen3-coder-next"},{id:"simple-task",name:"Simple Task (background)",alias:"simple-task"}]}},e={claude:{id:"claude",name:"Claude Code",image:"/providers/claude.png",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-6"},{id:"sonnet",name:"Claude Sonnet",alias:"sonnet",envKey:"ANTHROPIC_DEFAULT_SONNET_MODEL",defaultValue:"cc/claude-sonnet-4-6"},{id:"haiku",name:"Claude Haiku",alias:"haiku",envKey:"ANTHROPIC_DEFAULT_HAIKU_MODEL",defaultValue:"cc/claude-haiku-4-5-20251001"}]},openclaw:{id:"openclaw",name:"Open Claw",image:"/providers/openclaw.png",color:"#FF6B35",description:"Open Claw AI Assistant",configType:"custom"},codex:{id:"codex",name:"OpenAI Codex CLI / App",image:"/providers/codex.png",color:"#10A37F",description:"OpenAI Codex CLI",configType:"custom"},copilot:{id:"copilot",name:"GitHub Copilot",image:"/providers/copilot.png",color:"#1F6FEB",description:"GitHub Copilot Chat in VS Code via an OpenAI-compatible model provider",configType:"guide",docsUrl:"https://code.visualstudio.com/docs/copilot/customization/language-models",guideSteps:[{step:1,title:"Open Manage Models",desc:"In VS Code, open Copilot Chat, click the model picker at the bottom, then choose 'Manage Models...' and add an 'OpenAI Compatible' provider."},{step:2,title:"Configure Server",desc:"Enter this Base URL, then paste a ZevaiRouter API key when VS Code asks for it:",value:"{{baseUrl}}",copyable:!0},{step:3,title:"Select Model in Copilot Chat",desc:"Open Copilot Chat, click the model picker at the bottom → 'Manage Models...' → check the ZevaiRouter models to use."}]},"grok-build":{id:"grok-build",name:"Grok Build",image:"/providers/grok-cli.png",color:"#111111",description:"xAI coding agent with ZevaiRouter main and subagent model routing",configType:"custom"},opencode:{id:"opencode",name:"OpenCode",image:"/providers/opencode.png",color:"#E87040",description:"OpenCode AI Terminal Assistant",configType:"custom"},cowork:{id:"cowork",name:"Claude Cowork",image:"/providers/claude.png",color:"#D97757",description:"Claude Desktop Cowork (third-party inference)",configType:"custom"},hermes:{id:"hermes",name:"Hermes Agent",image:"/providers/hermes.png",color:"#8B5CF6",description:"Nous Research self-improving AI agent",configType:"custom",roles:[{id:"delegation",label:"Delegation (subagents)"},{id:"vision",label:"Vision"},{id:"compression",label:"Compression"},{id:"title_generation",label:"Title Generation"},{id:"approval",label:"Approval"},{id:"skills_hub",label:"Skills Hub"},{id:"mcp",label:"MCP"},{id:"review",label:"Review (/review subagent)"},{id:"memory_query_rewrite",label:"Memory Query Rewrite"},{id:"background_review",label:"Background Review"},{id:"curator",label:"Curator"},{id:"monitor",label:"Monitor"},{id:"tts_audio_tags",label:"TTS Audio Tags"},{id:"triage_specifier",label:"Triage Specifier"},{id:"kanban_decomposer",label:"Kanban Decomposer"},{id:"profile_describer",label:"Profile Describer"},{id:"goal_judge",label:"Goal Judge"}]},droid:{id:"droid",name:"Factory Droid",image:"/providers/droid.png",color:"#00D4FF",description:"Factory Droid AI Assistant",configType:"custom"},cursor:{id:"cursor",name:"Cursor",image:"/providers/cursor.png",color:"#000000",description:"Cursor AI Code Editor",configType:"guide",requiresExternalUrl:!0,notes:[{type:"warning",text:"Requires Cursor Pro account to use this feature."},{type:"cloudCheck",text:"Cursor's custom OpenAI endpoint is called from Cursor's server, so a local base URL is not supported. Use Tunnel or Cloud Endpoint, or map models in the Cursor MITM tool instead."}],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",configType:"custom"},kilo:{id:"kilo",name:"Kilo Code",image:"/providers/kilocode.png",color:"#FF6B6B",description:"Kilo Code AI Assistant",configType:"custom"},roo:{id:"roo",name:"Roo",image:"/providers/roo.png",color:"#FF6B6B",description:"Roo AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Settings",desc:"Go to Roo Settings panel"},{step:2,title:"Select Provider",desc:"Choose API Provider → Ollama"},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Select Model",type:"modelSelector"}]},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:`{
50
50
  "apiBase": "{{baseUrl}}",
51
51
  "title": "{{model}}",
52
52
  "model": "{{model}}",
@@ -1,4 +1,4 @@
1
- "use strict";exports.id=6936,exports.ids=[6936],exports.modules={17511:(a,b,c)=>{let d=c(29021),e=(()=>{if("win32"===process.platform)return null;for(let a of["/usr/sbin/lsof","/usr/bin/lsof","/sbin/lsof"])try{return d.accessSync(a,d.constants.X_OK),a}catch{}return"lsof"})(),f=new Set(["gemini-3.6-flash-tiered","gemini-3.7-flash-tiered","gemini-3.8-flash-tiered"]);a.exports={IS_DEV:!1,LSOF_BIN:e,TARGET_HOSTS:["daily-cloudcode-pa.googleapis.com","cloudcode-pa.googleapis.com","api.individual.githubcopilot.com","q.us-east-1.amazonaws.com","api2.cursor.sh"],URL_PATTERNS:{antigravity:[":generateContent",":streamGenerateContent"],copilot:["/chat/completions","/v1/messages","/responses"],kiro:["/generateAssistantResponse"],cursor:["/BidiAppend","/RunSSE","/RunPoll","/Run"]},MODEL_SYNONYMS:{antigravity:{"gemini-4-argon-high":"gemini-4-argon-high","gemini-4-argon-medium":"gemini-4-argon-medium","gemini-4-argon-low":"gemini-4-argon-low","gemini-3.8-flash-high":"gemini-3.8-flash-high","gemini-3.8-flash-medium":"gemini-3.8-flash-medium","gemini-3.8-flash-low":"gemini-3.8-flash-low","gemini-default":"gemini-3.8-flash-medium","claude-sonnet-5-5-high":"claude-sonnet-5-5-high","claude-sonnet-5-5-medium":"claude-sonnet-5-5-medium","claude-sonnet-5-5-low":"claude-sonnet-5-5-low","claude-sonnet-5-5":"claude-sonnet-5-5","claude-sonnet-5.5":"claude-sonnet-5-5","claude-sonnet-5.5-high":"claude-sonnet-5-5-high","claude-sonnet-5.5-medium":"claude-sonnet-5-5-medium","claude-sonnet-5.5-low":"claude-sonnet-5-5-low","claude-sonnet-5-5-thinking":"claude-sonnet-5-5","claude-sonnet-5.5-thinking":"claude-sonnet-5-5","claude-opus-5-5-high":"claude-opus-5-5-high","claude-opus-5-5-medium":"claude-opus-5-5-medium","claude-opus-5-5-low":"claude-opus-5-5-low","claude-opus-5-5":"claude-opus-5-5","claude-opus-5.5":"claude-opus-5-5","claude-opus-5.5-high":"claude-opus-5-5-high","claude-opus-5.5-medium":"claude-opus-5-5-medium","claude-opus-5.5-low":"claude-opus-5-5-low","claude-opus-5-5-thinking":"claude-opus-5-5","claude-opus-5.5-thinking":"claude-opus-5-5"}},MODEL_PATTERNS:{antigravity:[{match:/flash.*low|low.*flash/i,alias:"gemini-3.8-flash-low"},{match:/flash.*medium|medium.*flash/i,alias:"gemini-3.8-flash-medium"},{match:/flash/i,alias:"gemini-3.8-flash-high"},{match:/opus.*5[.-]5.*high|5[.-]5.*opus.*high/i,alias:"claude-opus-5-5-high"},{match:/opus.*5[.-]5.*medium|5[.-]5.*opus.*medium/i,alias:"claude-opus-5-5-medium"},{match:/opus.*5[.-]5.*low|5[.-]5.*opus.*low/i,alias:"claude-opus-5-5-low"},{match:/sonnet.*5[.-]5.*high|5[.-]5.*sonnet.*high/i,alias:"claude-sonnet-5-5-high"},{match:/sonnet.*5[.-]5.*medium|5[.-]5.*sonnet.*medium/i,alias:"claude-sonnet-5-5-medium"},{match:/sonnet.*5[.-]5.*low|5[.-]5.*sonnet.*low/i,alias:"claude-sonnet-5-5-low"},{match:/opus.*5[.-]5|5[.-]5.*opus/i,alias:"claude-opus-5-5"},{match:/sonnet.*5[.-]5|5[.-]5.*sonnet/i,alias:"claude-sonnet-5-5"},{match:/opus/i,alias:"claude-opus-4-6-thinking"},{match:/sonnet|claude/i,alias:"claude-sonnet-4-6"},{match:/gpt.*oss|oss/i,alias:"gpt-oss-120b-medium"}]},MODEL_NO_MAP:{antigravity:[/^tab[_-]/i]},LOG_BLACKLIST_URL_PARTS:["recordCodeAssistMetrics","recordTrajectoryAnalytics","fetchAdminControls","listExperiments","fetchUserInfo"],getToolForHost:function(a){let b=(a||"").split(":")[0];return"api.individual.githubcopilot.com"===b?"copilot":"daily-cloudcode-pa.googleapis.com"===b||"cloudcode-pa.googleapis.com"===b?"antigravity":"q.us-east-1.amazonaws.com"===b?"kiro":"api2.cursor.sh"===b?"cursor":null},extractTieredFlashModel:function(a,b){let c=String(a||"").replace(/^models\//,"");if(!f.has(c))return a;try{let a=JSON.parse(Buffer.isBuffer(b)?b.toString():String(b||"")),d=c.includes("3.8")?"3.8":c.includes("3.7")?"3.7":"3.6",e=a?.request?.generationConfig?.thinkingConfig?.thinkingLevel||a?.generationConfig?.thinkingConfig?.thinkingLevel,f=["high","medium","low"].includes(String(e).toLowerCase())?String(e).toLowerCase():"medium";return`gemini-${d}-flash-${f}`}catch{return a}}}},64809:(a,b,c)=>{let{exec:d,execSync:e}=c(79646),f="win32"===process.platform;function g(){if(f)try{return e("net session >nul 2>&1",{windowsHide:!0,stdio:"ignore"}),!0}catch{return!1}return"function"==typeof process.getuid&&0===process.getuid()}function h(a){return`'${String(a).replace(/'/g,"''")}'`}a.exports={isAdmin:g,runElevatedPowerShell:function(a){if(!f)return Promise.reject(Error("Windows-only"));let b=Buffer.from(a,"utf16le").toString("base64");if(g())return new Promise((a,c)=>{d(`powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -EncodedCommand ${b}`,{windowsHide:!0},(b,d,e)=>{b?c(Error(e||b.message)):a(d)})});let c=`
1
+ "use strict";exports.id=6936,exports.ids=[6936],exports.modules={17511:(a,b,c)=>{let d=c(29021),e=(()=>{if("win32"===process.platform)return null;for(let a of["/usr/sbin/lsof","/usr/bin/lsof","/sbin/lsof"])try{return d.accessSync(a,d.constants.X_OK),a}catch{}return"lsof"})(),f=new Set(["gemini-3.6-flash-tiered","gemini-3.7-flash-tiered","gemini-3.8-flash-tiered"]);a.exports={IS_DEV:!1,LSOF_BIN:e,TARGET_HOSTS:["daily-cloudcode-pa.googleapis.com","cloudcode-pa.googleapis.com","api.individual.githubcopilot.com","q.us-east-1.amazonaws.com","api2.cursor.sh"],URL_PATTERNS:{antigravity:[":generateContent",":streamGenerateContent"],copilot:["/chat/completions","/v1/messages","/responses"],kiro:["/generateAssistantResponse"],cursor:["/BidiAppend","/RunSSE","/RunPoll","/Run"]},MODEL_SYNONYMS:{antigravity:{"gemini-4-argon-high":"gemini-4-argon-high","gemini-4-argon-medium":"gemini-4-argon-medium","gemini-4-argon-low":"gemini-4-argon-low","gemini-4-carbon-high":"gemini-4-carbon-high","gemini-4-carbon-medium":"gemini-4-carbon-medium","gemini-4-carbon-low":"gemini-4-carbon-low","gemini-4-hydrogen-xhigh":"gemini-4-hydrogen-xhigh","gemini-4-hydrogen-high":"gemini-4-hydrogen-high","gemini-4-hydrogen-medium":"gemini-4-hydrogen-medium","gemini-4-hydrogen-low":"gemini-4-hydrogen-low","gemini-3.8-flash-high":"gemini-3.8-flash-high","gemini-3.8-flash-medium":"gemini-3.8-flash-medium","gemini-3.8-flash-low":"gemini-3.8-flash-low","gemini-default":"gemini-3.8-flash-medium","claude-sonnet-5-5-high":"claude-sonnet-5-5-high","claude-sonnet-5-5-medium":"claude-sonnet-5-5-medium","claude-sonnet-5-5-low":"claude-sonnet-5-5-low","claude-sonnet-5-5":"claude-sonnet-5-5","claude-sonnet-5.5":"claude-sonnet-5-5","claude-sonnet-5.5-high":"claude-sonnet-5-5-high","claude-sonnet-5.5-medium":"claude-sonnet-5-5-medium","claude-sonnet-5.5-low":"claude-sonnet-5-5-low","claude-sonnet-5-5-thinking":"claude-sonnet-5-5","claude-sonnet-5.5-thinking":"claude-sonnet-5-5","claude-opus-5-5-high":"claude-opus-5-5-high","claude-opus-5-5-medium":"claude-opus-5-5-medium","claude-opus-5-5-low":"claude-opus-5-5-low","claude-opus-5-5":"claude-opus-5-5","claude-opus-5.5":"claude-opus-5-5","claude-opus-5.5-high":"claude-opus-5-5-high","claude-opus-5.5-medium":"claude-opus-5-5-medium","claude-opus-5.5-low":"claude-opus-5-5-low","claude-opus-5-5-thinking":"claude-opus-5-5","claude-opus-5.5-thinking":"claude-opus-5-5"}},MODEL_PATTERNS:{antigravity:[{match:/flash.*low|low.*flash/i,alias:"gemini-3.8-flash-low"},{match:/flash.*medium|medium.*flash/i,alias:"gemini-3.8-flash-medium"},{match:/flash/i,alias:"gemini-3.8-flash-high"},{match:/opus.*5[.-]5.*high|5[.-]5.*opus.*high/i,alias:"claude-opus-5-5-high"},{match:/opus.*5[.-]5.*medium|5[.-]5.*opus.*medium/i,alias:"claude-opus-5-5-medium"},{match:/opus.*5[.-]5.*low|5[.-]5.*opus.*low/i,alias:"claude-opus-5-5-low"},{match:/sonnet.*5[.-]5.*high|5[.-]5.*sonnet.*high/i,alias:"claude-sonnet-5-5-high"},{match:/sonnet.*5[.-]5.*medium|5[.-]5.*sonnet.*medium/i,alias:"claude-sonnet-5-5-medium"},{match:/sonnet.*5[.-]5.*low|5[.-]5.*sonnet.*low/i,alias:"claude-sonnet-5-5-low"},{match:/opus.*5[.-]5|5[.-]5.*opus/i,alias:"claude-opus-5-5"},{match:/sonnet.*5[.-]5|5[.-]5.*sonnet/i,alias:"claude-sonnet-5-5"},{match:/opus/i,alias:"claude-opus-4-6-thinking"},{match:/sonnet|claude/i,alias:"claude-sonnet-4-6"},{match:/gpt.*oss|oss/i,alias:"gpt-oss-120b-medium"}]},MODEL_NO_MAP:{antigravity:[/^tab[_-]/i]},LOG_BLACKLIST_URL_PARTS:["recordCodeAssistMetrics","recordTrajectoryAnalytics","fetchAdminControls","listExperiments","fetchUserInfo"],getToolForHost:function(a){let b=(a||"").split(":")[0];return"api.individual.githubcopilot.com"===b?"copilot":"daily-cloudcode-pa.googleapis.com"===b||"cloudcode-pa.googleapis.com"===b?"antigravity":"q.us-east-1.amazonaws.com"===b?"kiro":"api2.cursor.sh"===b?"cursor":null},extractTieredFlashModel:function(a,b){let c=String(a||"").replace(/^models\//,"");if(!f.has(c))return a;try{let a=JSON.parse(Buffer.isBuffer(b)?b.toString():String(b||"")),d=c.includes("3.8")?"3.8":c.includes("3.7")?"3.7":"3.6",e=a?.request?.generationConfig?.thinkingConfig?.thinkingLevel||a?.generationConfig?.thinkingConfig?.thinkingLevel,f=["high","medium","low"].includes(String(e).toLowerCase())?String(e).toLowerCase():"medium";return`gemini-${d}-flash-${f}`}catch{return a}}}},64809:(a,b,c)=>{let{exec:d,execSync:e}=c(79646),f="win32"===process.platform;function g(){if(f)try{return e("net session >nul 2>&1",{windowsHide:!0,stdio:"ignore"}),!0}catch{return!1}return"function"==typeof process.getuid&&0===process.getuid()}function h(a){return`'${String(a).replace(/'/g,"''")}'`}a.exports={isAdmin:g,runElevatedPowerShell:function(a){if(!f)return Promise.reject(Error("Windows-only"));let b=Buffer.from(a,"utf16le").toString("base64");if(g())return new Promise((a,c)=>{d(`powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -EncodedCommand ${b}`,{windowsHide:!0},(b,d,e)=>{b?c(Error(e||b.message)):a(d)})});let c=`
2
2
  $proc = Start-Process powershell -ArgumentList @(
3
3
  '-NoProfile','-NonInteractive','-ExecutionPolicy','Bypass',
4
4
  '-WindowStyle','Hidden','-EncodedCommand','${b}'
@@ -3,7 +3,7 @@ MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDA8iMH5c02LilrsERw9t6Pv5Nc
3
3
  4k6Pz1EaDicBMpdpxKduSZu5OANqUq8er4GM95omAGIOPOh+Nx0spthYA2BqGz+l
4
4
  6HRkPJ7S236FZz73In/KVuLnwI8JJ2CbuJap8kvheCCZpmAWpb/cPx/3Vr/J6I17
5
5
  XcW+ML9FoCI6AOvOzwIDAQAB
6
- -----END PUBLIC KEY-----`},39006:a=>{a.exports=JSON.parse('{"name":"zevairouter","version":"1.1.78","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"cli/cli.js"},"files":["cli/cli.js","cli/app/","!cli/app/.next-cli-build/cache/","!cli/app/.next-cli-build/server/route-cache/","cli/hooks/","cli/src/","cli/package.json","cli/README.md","cli/LICENSE","scripts/start-standalone.mjs","scripts/gflow-reply-capture.py","scripts/flow-vps-setup.sh","vendor/aistudio-waa/","skills/","README.md","README.zh-CN.md","DOCKER.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"node scripts/build-app.mjs","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","lint":"eslint .","test":"vitest run --config tests/vitest.config.js","build:cli":"node cli/scripts/build-cli.js","audit:package":"node cli/scripts/audit-package.mjs","smoke:package":"node cli/scripts/smoke-package.mjs","verify:mobile-scroll":"node cli/scripts/verify-dashboard-mobile-scroll.mjs","candidate:build":"node cli/scripts/local-candidate.mjs build","candidate:install":"node cli/scripts/local-candidate.mjs install","candidate:status":"node cli/scripts/local-candidate.mjs status","candidate:rollback":"node cli/scripts/local-candidate.mjs rollback","release":"node cli/scripts/release.js","prepack":"npm run build:cli && npm run audit:package","postinstall":"node cli/hooks/postinstall.js"},"dependencies":{"confbox":"0.2.4","node-machine-id":"1.1.12","react":"19.2.4","react-dom":"19.2.4"},"comment_published_runtime":"npm install -g must not download next or @next/swc. Those, plus sql.js, yaml, and @node-saml/node-saml, stay devDependencies so local dev and build:cli can trace them into cli/app. The published tarball already ships that standalone server. confbox stays here because the CLI imports it directly.","comment_optional_runtime":"Optional packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses CloakBrowser with playwright-core; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3, node-pty, and systray2.","overrides":{"body-parser":"^2.3.0","brace-expansion":"5.0.12","dompurify":"^3.4.12","ip-address":"^10.4.0","js-yaml":"4.3.2","nanoid":"^3.3.18","postcss":"^8.5.10","sharp":"0.35.5"},"comment_overrides":"Security floors for transitive dependencies. ESLint\'s legacy minimatch is a private, source-pinned 3.1.5 compatibility package backed by brace-expansion 5.0.9; modern minimatch and nanoid use fixed floors directly. Monaco still pins an old DOMPurify; Express, Next, ESLint, and image processing dependencies may resolve vulnerable body-parser, js-yaml, or sharp releases. Recheck and remove overrides once parent packages require fixed versions.","devDependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@node-saml/node-saml":"5.1.0","@tailwindcss/postcss":"^4.1.18","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","better-sqlite3":"^12.6.2","chalk":"^4.1.2","dompurify":"^3.4.12","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.4.2","express":"^5.2.1","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","minimatch":"file:vendor/minimatch3-secure","monaco-editor":"^0.55.1","next":"16.4.2","node-forge":"^1.4.2","open":"^11.0.0","ora":"^9.1.0","postcss":"^8.5.10","prop-types":"^15.8.1","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","sql.js":"1.14.1","tailwindcss":"^4","typescript":"6.0.3","undici":"^8.10.0","uuid":"^14.0.1","vitest":"4.1.12","yaml":"2.9.0","zustand":"^5.0.10"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Verifiedlabs/zevairouter.git"},"bugs":{"url":"https://github.com/Verifiedlabs/zevairouter/issues"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},53225:(a,b,c)=>{c.d(b,{EV:()=>m,X5:()=>l});var d=c(55511),e=c(39609),f=c(78085),g=c(21031),h=c(30022);let i=new Map,j=new Map;async function k(a,b,c=null,d="intl"){let g,i,j={userId:(i=a?.providerSpecificData||{}).userId,authToken:a.accessToken,name:a.displayName||"",email:a.email||"",machineId:i.machineId||""};if(!j.userId||!j.authToken)return null;let l=`${(0,h.e9)(a,d)}/algo/api/v2/model/list`,m={Accept:"application/json","Accept-Encoding":"identity",...(0,f.d)(Buffer.alloc(0),l,j)},n=new AbortController,o=null,p=null;try{o=setTimeout(()=>n.abort("timeout"),15e3),b&&"function"==typeof b.addEventListener&&(b.aborted?n.abort(b.reason):(p=()=>n.abort(b.reason),b.addEventListener("abort",p))),g=await (0,e.proxyAwareFetch)(l,{method:"GET",headers:m,signal:n.signal},c)}finally{o&&clearTimeout(o),b&&p&&b.removeEventListener("abort",p)}if(!g.ok)return null;let q=await g.json().catch(()=>null);if(!q||!Array.isArray(q.chat))return null;let r=[],s=new Map;for(let a of q.chat){if(!a||"object"!=typeof a)continue;let b=a.key;if(!b||(s.set(b,a),!1===a.enable))continue;let c=a.display_name||b,d=Number(a.max_input_tokens)||131072;r.push({id:b,name:`${c}`,contextLength:d,isVL:!!a.is_vl,isReasoning:!!a.is_reasoning,maxOutputTokens:Number(a.max_output_tokens)||0,description:a.description||""})}return function(a){let b=[...a.models],c=new Map(a.rawConfigs),d=new Set([...b.map(a=>a.id),...c.keys()]);for(let[a,e]of Object.entries(h.Xx))d.has(a)||(c.set(a,{...e,key:a}),b.push({id:a,name:e.display_name||a,contextLength:e.max_input_tokens||18e4,isVL:!0===e.is_vl,isReasoning:!0===e.is_reasoning,maxOutputTokens:0,description:""}));return{models:b,rawConfigs:c}}({models:r,rawConfigs:s})}async function l(a,b,c={}){let d=await m(a,c),e=d?.rawConfigs?.get(b)||(0,h.TG)(b);return e?{...e,key:b}:null}async function m(a,b={}){var c;let e,f,l,n=b.region||(0,h.ty)(a?.provider);try{e=await (0,g.iC)(a,{...b,region:n})}catch(a){return b.log?.warn?.("QODER","PAT exchange failed",{code:a?.code||null,status:a?.status||null}),null}if(!e?.accessToken||(e.provider||(e={...e,provider:"cn"===n?"qoder-cn":"qoder"}),!(e.providerSpecificData||{}).userId))return null;let o=(c=e,f=(c?.providerSpecificData||{}).userId||c?.refreshToken||c?.accessToken||"anonymous",l=(0,h.ty)(c?.provider),(0,d.createHash)("sha256").update(`qoder:${l}:${f}`).digest("hex")),p=Date.now();if(!b.forceRefresh){let a=i.get(o);if(a&&a.expiresAt>p)return a}let q=j.get(o);if(q&&!b.forceRefresh)return q;let r=(async()=>{let a=await k(e,b.signal,b.proxyOptions,n);if(!a)return null;let c={expiresAt:Date.now()+36e5,models:a.models,rawConfigs:a.rawConfigs,fetched:!0};return i.set(o,c),c})();j.set(o,r);try{return await r}finally{j.get(o)===r&&j.delete(o)}}},78085:(a,b,c)=>{c.d(b,{d:()=>i});var d=c(55511),e=c.n(d),f=c(47293),g=c(30022);function h(a){return e().createHash("md5").update(a).digest("hex")}function i(a,b,c){var d;let i,j;if(!c?.userId)throw Error("cosy: user id is empty");if(!c?.authToken)throw Error("cosy: auth token is empty");let k=Buffer.isBuffer(a)?a:"string"==typeof a?Buffer.from(a,"latin1"):Buffer.from(a||[]),{cosyKey:l,info:m}=(d={uid:c.userId,security_oauth_token:c.authToken,name:c.name||"",aid:"",email:c.email||""},i=(0,f.A)().slice(0,16),j=function(a,b){var c;let d,f,g=Buffer.from(b,"utf8");if(16!==g.length)throw Error(`aes key must be 16 bytes, got ${g.length}`);let h=g.subarray(0,16),i=e().createCipheriv("aes-128-cbc",g,h);i.setAutoPadding(!1);let j=(d=16-(c=Buffer.from(a,"utf8")).length%16,f=Buffer.alloc(c.length+d,d),c.copy(f,0),f);return Buffer.concat([i.update(j),i.final()]).toString("base64")}(JSON.stringify(d),i),{cosyKey:e().publicEncrypt({key:g.pr,padding:e().constants.RSA_PKCS1_PADDING},Buffer.from(i,"utf8")).toString("base64"),info:j}),n=String(Math.floor(Date.now()/1e3)),o=JSON.stringify({version:"v1",requestId:(0,f.A)(),info:m,cosyVersion:g.cT,ideVersion:""}),p=Buffer.from(o,"utf8").toString("base64"),q=function(a){let b;try{b=new URL(a).pathname||""}catch{return""}return b.startsWith("/algo")?b.slice(5):b}(b),r=`${p}
6
+ -----END PUBLIC KEY-----`},39006:a=>{a.exports=JSON.parse('{"name":"zevairouter","version":"1.1.80","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"cli/cli.js"},"files":["cli/cli.js","cli/app/","!cli/app/.next-cli-build/cache/","!cli/app/.next-cli-build/server/route-cache/","cli/hooks/","cli/src/","cli/package.json","cli/README.md","cli/LICENSE","scripts/start-standalone.mjs","scripts/gflow-reply-capture.py","scripts/flow-vps-setup.sh","vendor/aistudio-waa/","skills/","README.md","README.zh-CN.md","DOCKER.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"node scripts/build-app.mjs","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","lint":"eslint .","test":"vitest run --config tests/vitest.config.js","build:cli":"node cli/scripts/build-cli.js","audit:package":"node cli/scripts/audit-package.mjs","smoke:package":"node cli/scripts/smoke-package.mjs","verify:mobile-scroll":"node cli/scripts/verify-dashboard-mobile-scroll.mjs","candidate:build":"node cli/scripts/local-candidate.mjs build","candidate:install":"node cli/scripts/local-candidate.mjs install","candidate:status":"node cli/scripts/local-candidate.mjs status","candidate:rollback":"node cli/scripts/local-candidate.mjs rollback","release":"node cli/scripts/release.js","prepack":"npm run build:cli && npm run audit:package","postinstall":"node cli/hooks/postinstall.js"},"dependencies":{"confbox":"0.2.4","node-machine-id":"1.1.12","react":"19.2.4","react-dom":"19.2.4"},"comment_published_runtime":"npm install -g must not download next or @next/swc. Those, plus sql.js, yaml, and @node-saml/node-saml, stay devDependencies so local dev and build:cli can trace them into cli/app. The published tarball already ships that standalone server. confbox stays here because the CLI imports it directly.","comment_optional_runtime":"Optional packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses CloakBrowser with playwright-core; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3, node-pty, and systray2.","overrides":{"body-parser":"^2.3.0","brace-expansion":"5.0.12","dompurify":"^3.4.12","ip-address":"^10.4.0","js-yaml":"4.3.2","nanoid":"^3.3.18","postcss":"^8.5.10","sharp":"0.35.5"},"comment_overrides":"Security floors for transitive dependencies. ESLint\'s legacy minimatch is a private, source-pinned 3.1.5 compatibility package backed by brace-expansion 5.0.9; modern minimatch and nanoid use fixed floors directly. Monaco still pins an old DOMPurify; Express, Next, ESLint, and image processing dependencies may resolve vulnerable body-parser, js-yaml, or sharp releases. Recheck and remove overrides once parent packages require fixed versions.","devDependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@node-saml/node-saml":"5.1.0","@tailwindcss/postcss":"^4.1.18","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","better-sqlite3":"^12.6.2","chalk":"^4.1.2","dompurify":"^3.4.12","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.4.2","express":"^5.2.1","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","minimatch":"file:vendor/minimatch3-secure","monaco-editor":"^0.55.1","next":"16.4.2","node-forge":"^1.4.2","open":"^11.0.0","ora":"^9.1.0","postcss":"^8.5.10","prop-types":"^15.8.1","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","sql.js":"1.14.1","tailwindcss":"^4","typescript":"6.0.3","undici":"^8.10.0","uuid":"^14.0.1","vitest":"4.1.12","yaml":"2.9.0","zustand":"^5.0.10"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Verifiedlabs/zevairouter.git"},"bugs":{"url":"https://github.com/Verifiedlabs/zevairouter/issues"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},53225:(a,b,c)=>{c.d(b,{EV:()=>m,X5:()=>l});var d=c(55511),e=c(39609),f=c(78085),g=c(21031),h=c(30022);let i=new Map,j=new Map;async function k(a,b,c=null,d="intl"){let g,i,j={userId:(i=a?.providerSpecificData||{}).userId,authToken:a.accessToken,name:a.displayName||"",email:a.email||"",machineId:i.machineId||""};if(!j.userId||!j.authToken)return null;let l=`${(0,h.e9)(a,d)}/algo/api/v2/model/list`,m={Accept:"application/json","Accept-Encoding":"identity",...(0,f.d)(Buffer.alloc(0),l,j)},n=new AbortController,o=null,p=null;try{o=setTimeout(()=>n.abort("timeout"),15e3),b&&"function"==typeof b.addEventListener&&(b.aborted?n.abort(b.reason):(p=()=>n.abort(b.reason),b.addEventListener("abort",p))),g=await (0,e.proxyAwareFetch)(l,{method:"GET",headers:m,signal:n.signal},c)}finally{o&&clearTimeout(o),b&&p&&b.removeEventListener("abort",p)}if(!g.ok)return null;let q=await g.json().catch(()=>null);if(!q||!Array.isArray(q.chat))return null;let r=[],s=new Map;for(let a of q.chat){if(!a||"object"!=typeof a)continue;let b=a.key;if(!b||(s.set(b,a),!1===a.enable))continue;let c=a.display_name||b,d=Number(a.max_input_tokens)||131072;r.push({id:b,name:`${c}`,contextLength:d,isVL:!!a.is_vl,isReasoning:!!a.is_reasoning,maxOutputTokens:Number(a.max_output_tokens)||0,description:a.description||""})}return function(a){let b=[...a.models],c=new Map(a.rawConfigs),d=new Set([...b.map(a=>a.id),...c.keys()]);for(let[a,e]of Object.entries(h.Xx))d.has(a)||(c.set(a,{...e,key:a}),b.push({id:a,name:e.display_name||a,contextLength:e.max_input_tokens||18e4,isVL:!0===e.is_vl,isReasoning:!0===e.is_reasoning,maxOutputTokens:0,description:""}));return{models:b,rawConfigs:c}}({models:r,rawConfigs:s})}async function l(a,b,c={}){let d=await m(a,c),e=d?.rawConfigs?.get(b)||(0,h.TG)(b);return e?{...e,key:b}:null}async function m(a,b={}){var c;let e,f,l,n=b.region||(0,h.ty)(a?.provider);try{e=await (0,g.iC)(a,{...b,region:n})}catch(a){return b.log?.warn?.("QODER","PAT exchange failed",{code:a?.code||null,status:a?.status||null}),null}if(!e?.accessToken||(e.provider||(e={...e,provider:"cn"===n?"qoder-cn":"qoder"}),!(e.providerSpecificData||{}).userId))return null;let o=(c=e,f=(c?.providerSpecificData||{}).userId||c?.refreshToken||c?.accessToken||"anonymous",l=(0,h.ty)(c?.provider),(0,d.createHash)("sha256").update(`qoder:${l}:${f}`).digest("hex")),p=Date.now();if(!b.forceRefresh){let a=i.get(o);if(a&&a.expiresAt>p)return a}let q=j.get(o);if(q&&!b.forceRefresh)return q;let r=(async()=>{let a=await k(e,b.signal,b.proxyOptions,n);if(!a)return null;let c={expiresAt:Date.now()+36e5,models:a.models,rawConfigs:a.rawConfigs,fetched:!0};return i.set(o,c),c})();j.set(o,r);try{return await r}finally{j.get(o)===r&&j.delete(o)}}},78085:(a,b,c)=>{c.d(b,{d:()=>i});var d=c(55511),e=c.n(d),f=c(47293),g=c(30022);function h(a){return e().createHash("md5").update(a).digest("hex")}function i(a,b,c){var d;let i,j;if(!c?.userId)throw Error("cosy: user id is empty");if(!c?.authToken)throw Error("cosy: auth token is empty");let k=Buffer.isBuffer(a)?a:"string"==typeof a?Buffer.from(a,"latin1"):Buffer.from(a||[]),{cosyKey:l,info:m}=(d={uid:c.userId,security_oauth_token:c.authToken,name:c.name||"",aid:"",email:c.email||""},i=(0,f.A)().slice(0,16),j=function(a,b){var c;let d,f,g=Buffer.from(b,"utf8");if(16!==g.length)throw Error(`aes key must be 16 bytes, got ${g.length}`);let h=g.subarray(0,16),i=e().createCipheriv("aes-128-cbc",g,h);i.setAutoPadding(!1);let j=(d=16-(c=Buffer.from(a,"utf8")).length%16,f=Buffer.alloc(c.length+d,d),c.copy(f,0),f);return Buffer.concat([i.update(j),i.final()]).toString("base64")}(JSON.stringify(d),i),{cosyKey:e().publicEncrypt({key:g.pr,padding:e().constants.RSA_PKCS1_PADDING},Buffer.from(i,"utf8")).toString("base64"),info:j}),n=String(Math.floor(Date.now()/1e3)),o=JSON.stringify({version:"v1",requestId:(0,f.A)(),info:m,cosyVersion:g.cT,ideVersion:""}),p=Buffer.from(o,"utf8").toString("base64"),q=function(a){let b;try{b=new URL(a).pathname||""}catch{return""}return b.startsWith("/algo")?b.slice(5):b}(b),r=`${p}
7
7
  ${l}
8
8
  ${n}
9
9
  ${k.toString("latin1")}