9router 0.3.28 → 0.3.30

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 (541) hide show
  1. package/app/.next/BUILD_ID +1 -1
  2. package/app/.next/app-path-routes-manifest.json +46 -43
  3. package/app/.next/build-manifest.json +2 -2
  4. package/app/.next/prerender-manifest.json +24 -0
  5. package/app/.next/routes-manifest.json +18 -0
  6. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -16
  7. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  8. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  9. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  10. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  11. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  12. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  13. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  14. package/app/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  15. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  16. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  17. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  18. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js +2 -0
  19. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -0
  20. package/app/.next/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -0
  21. package/app/.next/server/app/(dashboard)/dashboard/page.js +1 -1
  22. package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  23. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  24. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  26. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  27. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  28. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  29. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  30. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  31. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  32. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  33. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  34. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  35. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  36. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  37. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  38. package/app/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  39. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  40. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  41. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  42. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  43. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  44. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  45. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  46. package/app/.next/server/app/_global-error.html +2 -2
  47. package/app/.next/server/app/_global-error.rsc +1 -1
  48. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  49. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  50. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  51. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  52. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  53. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  54. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  55. package/app/.next/server/app/_not-found.html +1 -1
  56. package/app/.next/server/app/_not-found.rsc +3 -3
  57. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  58. package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  59. package/app/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  60. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  61. package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  62. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  63. package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  64. package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  65. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
  66. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +2 -2
  67. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
  68. package/app/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
  69. package/app/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
  70. package/app/.next/server/app/api/cli-tools/copilot-settings/route_client-reference-manifest.js +1 -1
  71. package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
  72. package/app/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
  73. package/app/.next/server/app/api/cli-tools/opencode-settings/route_client-reference-manifest.js +1 -1
  74. package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
  75. package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
  76. package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
  77. package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
  78. package/app/.next/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
  79. package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
  80. package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  81. package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
  82. package/app/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
  83. package/app/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
  84. package/app/.next/server/app/api/models/route.js +1 -1
  85. package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
  86. package/app/.next/server/app/api/models/test/route.js +1 -1
  87. package/app/.next/server/app/api/models/test/route_client-reference-manifest.js +1 -1
  88. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  89. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  90. package/app/.next/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
  91. package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
  92. package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
  93. package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
  94. package/app/.next/server/app/api/oauth/iflow/cookie/route.js +1 -0
  95. package/app/.next/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -0
  96. package/app/.next/server/app/api/oauth/iflow/cookie/route_client-reference-manifest.js +1 -0
  97. package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
  98. package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
  99. package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
  100. package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
  101. package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
  102. package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
  103. package/app/.next/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
  104. package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
  105. package/app/.next/server/app/api/providers/[id]/models/route.js +1 -1
  106. package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
  107. package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
  108. package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
  109. package/app/.next/server/app/api/providers/[id]/test-models/route_client-reference-manifest.js +1 -1
  110. package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
  111. package/app/.next/server/app/api/providers/route.js +1 -1
  112. package/app/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
  113. package/app/.next/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
  114. package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
  115. package/app/.next/server/app/api/settings/database/route_client-reference-manifest.js +1 -1
  116. package/app/.next/server/app/api/settings/proxy-test/route_client-reference-manifest.js +1 -1
  117. package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
  118. package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  119. package/app/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  120. package/app/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
  121. package/app/.next/server/app/api/translator/console-logs/route.js +1 -1
  122. package/app/.next/server/app/api/translator/console-logs/route_client-reference-manifest.js +1 -1
  123. package/app/.next/server/app/api/translator/console-logs/stream/route.js +1 -1
  124. package/app/.next/server/app/api/translator/console-logs/stream/route_client-reference-manifest.js +1 -1
  125. package/app/.next/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
  126. package/app/.next/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
  127. package/app/.next/server/app/api/translator/send/route.js +1 -1
  128. package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
  129. package/app/.next/server/app/api/translator/translate/route.js +1 -1
  130. package/app/.next/server/app/api/translator/translate/route.js.nft.json +1 -1
  131. package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
  132. package/app/.next/server/app/api/tunnel/disable/route_client-reference-manifest.js +1 -1
  133. package/app/.next/server/app/api/tunnel/enable/route_client-reference-manifest.js +1 -1
  134. package/app/.next/server/app/api/tunnel/status/route_client-reference-manifest.js +1 -1
  135. package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  136. package/app/.next/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  137. package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
  138. package/app/.next/server/app/api/usage/chart/route_client-reference-manifest.js +1 -1
  139. package/app/.next/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
  140. package/app/.next/server/app/api/usage/providers/route_client-reference-manifest.js +1 -1
  141. package/app/.next/server/app/api/usage/request-details/route_client-reference-manifest.js +1 -1
  142. package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
  143. package/app/.next/server/app/api/usage/stats/route.js +1 -0
  144. package/app/.next/server/app/api/usage/stats/route.js.nft.json +1 -0
  145. package/app/.next/server/app/api/usage/stats/route_client-reference-manifest.js +1 -0
  146. package/app/.next/server/app/api/usage/stream/route_client-reference-manifest.js +1 -1
  147. package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
  148. package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  149. package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
  150. package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
  151. package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  152. package/app/.next/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
  153. package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
  154. package/app/.next/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  155. package/app/.next/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
  156. package/app/.next/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
  157. package/app/.next/server/app/api/v1/messages/route.js +1 -1
  158. package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
  159. package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
  160. package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
  161. package/app/.next/server/app/api/v1/responses/route.js +1 -1
  162. package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
  163. package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
  164. package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
  165. package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
  166. package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  167. package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
  168. package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
  169. package/app/.next/server/app/api/version/route.js +1 -1
  170. package/app/.next/server/app/api/version/route_client-reference-manifest.js +1 -1
  171. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  172. package/app/.next/server/app/callback.html +1 -1
  173. package/app/.next/server/app/callback.rsc +3 -3
  174. package/app/.next/server/app/callback.segments/_full.segment.rsc +3 -3
  175. package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
  176. package/app/.next/server/app/callback.segments/_index.segment.rsc +3 -3
  177. package/app/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
  178. package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  179. package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
  180. package/app/.next/server/app/dashboard/cli-tools.html +1 -1
  181. package/app/.next/server/app/dashboard/cli-tools.rsc +5 -5
  182. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  183. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  184. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  185. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  186. package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  187. package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  188. package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
  189. package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  190. package/app/.next/server/app/dashboard/combos.html +1 -1
  191. package/app/.next/server/app/dashboard/combos.rsc +5 -5
  192. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  193. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  194. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  195. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  196. package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  197. package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  198. package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
  199. package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  200. package/app/.next/server/app/dashboard/endpoint.html +1 -1
  201. package/app/.next/server/app/dashboard/endpoint.rsc +5 -5
  202. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  203. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  204. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  205. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  206. package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
  207. package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  208. package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
  209. package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  210. package/app/.next/server/app/dashboard/mitm.html +1 -0
  211. package/app/.next/server/app/dashboard/mitm.meta +17 -0
  212. package/app/.next/server/app/dashboard/mitm.rsc +20 -0
  213. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +6 -0
  214. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +4 -0
  215. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +4 -0
  216. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +6 -0
  217. package/app/.next/server/app/dashboard/mitm.segments/_full.segment.rsc +20 -0
  218. package/app/.next/server/app/dashboard/mitm.segments/_head.segment.rsc +6 -0
  219. package/app/.next/server/app/dashboard/mitm.segments/_index.segment.rsc +7 -0
  220. package/app/.next/server/app/dashboard/mitm.segments/_tree.segment.rsc +5 -0
  221. package/app/.next/server/app/dashboard/profile.html +1 -1
  222. package/app/.next/server/app/dashboard/profile.rsc +5 -5
  223. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  224. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  225. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  226. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  227. package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  228. package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  229. package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
  230. package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  231. package/app/.next/server/app/dashboard/providers/new.html +1 -1
  232. package/app/.next/server/app/dashboard/providers/new.rsc +5 -5
  233. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  234. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  235. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  236. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  237. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  238. package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  239. package/app/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  240. package/app/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
  241. package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  242. package/app/.next/server/app/dashboard/providers.html +1 -1
  243. package/app/.next/server/app/dashboard/providers.rsc +5 -5
  244. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  245. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  246. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  247. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  248. package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  249. package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  250. package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
  251. package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  252. package/app/.next/server/app/dashboard/quota.html +2 -1
  253. package/app/.next/server/app/dashboard/quota.rsc +6 -6
  254. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  255. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  256. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  257. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  258. package/app/.next/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  259. package/app/.next/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  260. package/app/.next/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
  261. package/app/.next/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  262. package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  263. package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
  264. package/app/.next/server/app/dashboard/settings/pricing.rsc +3 -3
  265. package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  266. package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  267. package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
  268. package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  269. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  270. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  271. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  272. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  273. package/app/.next/server/app/dashboard/translator.html +1 -1
  274. package/app/.next/server/app/dashboard/translator.rsc +5 -5
  275. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  276. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  277. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  278. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  279. package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  280. package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  281. package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
  282. package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  283. package/app/.next/server/app/dashboard/usage.html +1 -1
  284. package/app/.next/server/app/dashboard/usage.rsc +5 -5
  285. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  286. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  287. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  288. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  289. package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  290. package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  291. package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
  292. package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  293. package/app/.next/server/app/dashboard.html +1 -1
  294. package/app/.next/server/app/dashboard.rsc +5 -5
  295. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  296. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  297. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  298. package/app/.next/server/app/dashboard.segments/_full.segment.rsc +5 -5
  299. package/app/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
  300. package/app/.next/server/app/dashboard.segments/_index.segment.rsc +3 -3
  301. package/app/.next/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  302. package/app/.next/server/app/index.html +1 -1
  303. package/app/.next/server/app/index.rsc +3 -3
  304. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  305. package/app/.next/server/app/index.segments/_full.segment.rsc +3 -3
  306. package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
  307. package/app/.next/server/app/index.segments/_index.segment.rsc +3 -3
  308. package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  309. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  310. package/app/.next/server/app/landing.html +1 -1
  311. package/app/.next/server/app/landing.rsc +3 -3
  312. package/app/.next/server/app/landing.segments/_full.segment.rsc +3 -3
  313. package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
  314. package/app/.next/server/app/landing.segments/_index.segment.rsc +3 -3
  315. package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
  316. package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  317. package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
  318. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  319. package/app/.next/server/app/login.html +1 -1
  320. package/app/.next/server/app/login.rsc +4 -4
  321. package/app/.next/server/app/login.segments/_full.segment.rsc +4 -4
  322. package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
  323. package/app/.next/server/app/login.segments/_index.segment.rsc +3 -3
  324. package/app/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  325. package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  326. package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
  327. package/app/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  328. package/app/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  329. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  330. package/app/.next/server/app-paths-manifest.json +46 -43
  331. package/app/.next/server/chunks/1238.js +2 -2
  332. package/app/.next/server/chunks/1424.js +1 -1
  333. package/app/.next/server/chunks/2280.js +1 -1
  334. package/app/.next/server/chunks/3245.js +1 -1
  335. package/app/.next/server/chunks/3832.js +1 -1
  336. package/app/.next/server/chunks/412.js +2 -2
  337. package/app/.next/server/chunks/4841.js +12 -0
  338. package/app/.next/server/chunks/4989.js +2 -2
  339. package/app/.next/server/chunks/6182.js +16 -10
  340. package/app/.next/server/chunks/6384.js +1 -0
  341. package/app/.next/server/chunks/649.js +15 -0
  342. package/app/.next/server/chunks/7647.js +1 -1
  343. package/app/.next/server/chunks/8590.js +1 -1
  344. package/app/.next/server/chunks/8756.js +1 -1
  345. package/app/.next/server/chunks/8895.js +2 -2
  346. package/app/.next/server/pages/404.html +1 -1
  347. package/app/.next/server/pages/500.html +2 -2
  348. package/app/.next/server/server-reference-manifest.js +1 -1
  349. package/app/.next/server/server-reference-manifest.json +1 -1
  350. package/app/.next/static/chunks/4495-97a066cea645caef.js +1 -0
  351. package/app/.next/static/chunks/5497-87f1cb95ee622c7b.js +7 -0
  352. package/app/.next/static/chunks/9242-3524e9de7ad33a19.js +15 -0
  353. package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-8caef34f3e144a20.js +1 -0
  354. package/app/.next/static/chunks/app/(dashboard)/dashboard/mitm/page-7f5a8700b96d31b1.js +1 -0
  355. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-d3eea801999e8eaf.js +1 -0
  356. package/app/.next/static/chunks/app/(dashboard)/layout-e85ef8386b3bd547.js +1 -0
  357. package/app/.next/static/chunks/app/_global-error/page-3afc9e982dbedc92.js +1 -0
  358. package/app/.next/static/chunks/app/api/auth/login/route-3afc9e982dbedc92.js +1 -0
  359. package/app/.next/static/chunks/app/api/auth/logout/route-3afc9e982dbedc92.js +1 -0
  360. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-3afc9e982dbedc92.js +1 -0
  361. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-3afc9e982dbedc92.js +1 -0
  362. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-3afc9e982dbedc92.js +1 -0
  363. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-3afc9e982dbedc92.js +1 -0
  364. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-3afc9e982dbedc92.js +1 -0
  365. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-3afc9e982dbedc92.js +1 -0
  366. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-3afc9e982dbedc92.js +1 -0
  367. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-3afc9e982dbedc92.js +1 -0
  368. package/app/.next/static/chunks/app/api/cloud/auth/route-3afc9e982dbedc92.js +1 -0
  369. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-3afc9e982dbedc92.js +1 -0
  370. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-3afc9e982dbedc92.js +1 -0
  371. package/app/.next/static/chunks/app/api/cloud/models/alias/route-3afc9e982dbedc92.js +1 -0
  372. package/app/.next/static/chunks/app/api/combos/[id]/route-3afc9e982dbedc92.js +1 -0
  373. package/app/.next/static/chunks/app/api/combos/route-3afc9e982dbedc92.js +1 -0
  374. package/app/.next/static/chunks/app/api/init/route-3afc9e982dbedc92.js +1 -0
  375. package/app/.next/static/chunks/app/api/keys/[id]/route-3afc9e982dbedc92.js +1 -0
  376. package/app/.next/static/chunks/app/api/keys/route-3afc9e982dbedc92.js +1 -0
  377. package/app/.next/static/chunks/app/api/models/alias/route-3afc9e982dbedc92.js +1 -0
  378. package/app/.next/static/chunks/app/api/models/route-3afc9e982dbedc92.js +1 -0
  379. package/app/.next/static/chunks/app/api/models/test/route-3afc9e982dbedc92.js +1 -0
  380. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-3afc9e982dbedc92.js +1 -0
  381. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-3afc9e982dbedc92.js +1 -0
  382. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-3afc9e982dbedc92.js +1 -0
  383. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-3afc9e982dbedc92.js +1 -0
  384. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-3afc9e982dbedc92.js +1 -0
  385. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-3afc9e982dbedc92.js +1 -0
  386. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-3afc9e982dbedc92.js +1 -0
  387. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-3afc9e982dbedc92.js +1 -0
  388. package/app/.next/static/chunks/app/api/pricing/route-3afc9e982dbedc92.js +1 -0
  389. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-3afc9e982dbedc92.js +1 -0
  390. package/app/.next/static/chunks/app/api/provider-nodes/route-3afc9e982dbedc92.js +1 -0
  391. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-3afc9e982dbedc92.js +1 -0
  392. package/app/.next/static/chunks/app/api/providers/[id]/models/route-3afc9e982dbedc92.js +1 -0
  393. package/app/.next/static/chunks/app/api/providers/[id]/route-3afc9e982dbedc92.js +1 -0
  394. package/app/.next/static/chunks/app/api/providers/[id]/test/route-3afc9e982dbedc92.js +1 -0
  395. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-3afc9e982dbedc92.js +1 -0
  396. package/app/.next/static/chunks/app/api/providers/client/route-3afc9e982dbedc92.js +1 -0
  397. package/app/.next/static/chunks/app/api/providers/route-3afc9e982dbedc92.js +1 -0
  398. package/app/.next/static/chunks/app/api/providers/test-batch/route-3afc9e982dbedc92.js +1 -0
  399. package/app/.next/static/chunks/app/api/providers/validate/route-3afc9e982dbedc92.js +1 -0
  400. package/app/.next/static/chunks/app/api/settings/database/route-3afc9e982dbedc92.js +1 -0
  401. package/app/.next/static/chunks/app/api/settings/proxy-test/route-3afc9e982dbedc92.js +1 -0
  402. package/app/.next/static/chunks/app/api/settings/require-login/route-3afc9e982dbedc92.js +1 -0
  403. package/app/.next/static/chunks/app/api/settings/route-3afc9e982dbedc92.js +1 -0
  404. package/app/.next/static/chunks/app/api/shutdown/route-3afc9e982dbedc92.js +1 -0
  405. package/app/.next/static/chunks/app/api/tags/route-3afc9e982dbedc92.js +1 -0
  406. package/app/.next/static/chunks/app/api/translator/console-logs/route-3afc9e982dbedc92.js +1 -0
  407. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-3afc9e982dbedc92.js +1 -0
  408. package/app/.next/static/chunks/app/api/translator/load/route-3afc9e982dbedc92.js +1 -0
  409. package/app/.next/static/chunks/app/api/translator/save/route-3afc9e982dbedc92.js +1 -0
  410. package/app/.next/static/chunks/app/api/translator/send/route-3afc9e982dbedc92.js +1 -0
  411. package/app/.next/static/chunks/app/api/translator/translate/route-3afc9e982dbedc92.js +1 -0
  412. package/app/.next/static/chunks/app/api/tunnel/disable/route-3afc9e982dbedc92.js +1 -0
  413. package/app/.next/static/chunks/app/api/tunnel/enable/route-3afc9e982dbedc92.js +1 -0
  414. package/app/.next/static/chunks/app/api/tunnel/status/route-3afc9e982dbedc92.js +1 -0
  415. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-3afc9e982dbedc92.js +1 -0
  416. package/app/.next/static/chunks/app/api/usage/chart/route-3afc9e982dbedc92.js +1 -0
  417. package/app/.next/static/chunks/app/api/usage/history/route-3afc9e982dbedc92.js +1 -0
  418. package/app/.next/static/chunks/app/api/usage/providers/route-3afc9e982dbedc92.js +1 -0
  419. package/app/.next/static/chunks/app/api/usage/request-details/route-3afc9e982dbedc92.js +1 -0
  420. package/app/.next/static/chunks/app/api/usage/request-logs/route-3afc9e982dbedc92.js +1 -0
  421. package/app/.next/static/chunks/app/api/usage/stats/route-3afc9e982dbedc92.js +1 -0
  422. package/app/.next/static/chunks/app/api/usage/stream/route-3afc9e982dbedc92.js +1 -0
  423. package/app/.next/static/chunks/app/api/v1/api/chat/route-3afc9e982dbedc92.js +1 -0
  424. package/app/.next/static/chunks/app/api/v1/chat/completions/route-3afc9e982dbedc92.js +1 -0
  425. package/app/.next/static/chunks/app/api/v1/embeddings/route-3afc9e982dbedc92.js +1 -0
  426. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-3afc9e982dbedc92.js +1 -0
  427. package/app/.next/static/chunks/app/api/v1/messages/route-3afc9e982dbedc92.js +1 -0
  428. package/app/.next/static/chunks/app/api/v1/models/route-3afc9e982dbedc92.js +1 -0
  429. package/app/.next/static/chunks/app/api/v1/responses/route-3afc9e982dbedc92.js +1 -0
  430. package/app/.next/static/chunks/app/api/v1/route-3afc9e982dbedc92.js +1 -0
  431. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-3afc9e982dbedc92.js +1 -0
  432. package/app/.next/static/chunks/app/api/v1beta/models/route-3afc9e982dbedc92.js +1 -0
  433. package/app/.next/static/chunks/app/api/version/route-3afc9e982dbedc92.js +1 -0
  434. package/app/.next/static/chunks/app/{layout-cbe799ec784651ca.js → layout-f9f92a7880a478f2.js} +1 -1
  435. package/app/.next/static/chunks/app/manifest.webmanifest/route-3afc9e982dbedc92.js +1 -0
  436. package/app/.next/static/chunks/app/page-3afc9e982dbedc92.js +1 -0
  437. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-3afc9e982dbedc92.js +1 -0
  438. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-3afc9e982dbedc92.js +1 -0
  439. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-3afc9e982dbedc92.js +1 -0
  440. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-3afc9e982dbedc92.js +1 -0
  441. package/app/.next/static/css/fb5ab131d55b40e1.css +3 -0
  442. package/app/.next/static/k3zp-r_EpPiF5lcYQ24hp/_buildManifest.js +1 -0
  443. package/app/package.json +1 -1
  444. package/app/src/mitm/cert/generate.js +16 -5
  445. package/app/src/mitm/cert/install.js +8 -3
  446. package/app/src/mitm/dns/dnsConfig.js +79 -66
  447. package/app/src/mitm/manager.js +126 -169
  448. package/app/src/mitm/server.js +37 -44
  449. package/hooks/postinstall.js +73 -0
  450. package/package.json +2 -1
  451. package/app/.next/server/chunks/1164.js +0 -1
  452. package/app/.next/server/chunks/3110.js +0 -12
  453. package/app/.next/static/7sCSr7yWSqEyoyOGqrYLA/_buildManifest.js +0 -1
  454. package/app/.next/static/chunks/4495-bc9f104bf7b22419.js +0 -1
  455. package/app/.next/static/chunks/5497-9aeee36152b1d579.js +0 -7
  456. package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-4cc436d49f7e7638.js +0 -15
  457. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-96232c1eaa074aae.js +0 -1
  458. package/app/.next/static/chunks/app/(dashboard)/layout-626a5cf4ccea1e63.js +0 -1
  459. package/app/.next/static/chunks/app/_global-error/page-dc114b2367afe467.js +0 -1
  460. package/app/.next/static/chunks/app/api/auth/login/route-dc114b2367afe467.js +0 -1
  461. package/app/.next/static/chunks/app/api/auth/logout/route-dc114b2367afe467.js +0 -1
  462. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-dc114b2367afe467.js +0 -1
  463. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-dc114b2367afe467.js +0 -1
  464. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-dc114b2367afe467.js +0 -1
  465. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-dc114b2367afe467.js +0 -1
  466. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-dc114b2367afe467.js +0 -1
  467. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-dc114b2367afe467.js +0 -1
  468. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-dc114b2367afe467.js +0 -1
  469. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-dc114b2367afe467.js +0 -1
  470. package/app/.next/static/chunks/app/api/cloud/auth/route-dc114b2367afe467.js +0 -1
  471. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-dc114b2367afe467.js +0 -1
  472. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-dc114b2367afe467.js +0 -1
  473. package/app/.next/static/chunks/app/api/cloud/models/alias/route-dc114b2367afe467.js +0 -1
  474. package/app/.next/static/chunks/app/api/combos/[id]/route-dc114b2367afe467.js +0 -1
  475. package/app/.next/static/chunks/app/api/combos/route-dc114b2367afe467.js +0 -1
  476. package/app/.next/static/chunks/app/api/init/route-dc114b2367afe467.js +0 -1
  477. package/app/.next/static/chunks/app/api/keys/[id]/route-dc114b2367afe467.js +0 -1
  478. package/app/.next/static/chunks/app/api/keys/route-dc114b2367afe467.js +0 -1
  479. package/app/.next/static/chunks/app/api/models/alias/route-dc114b2367afe467.js +0 -1
  480. package/app/.next/static/chunks/app/api/models/route-dc114b2367afe467.js +0 -1
  481. package/app/.next/static/chunks/app/api/models/test/route-dc114b2367afe467.js +0 -1
  482. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-dc114b2367afe467.js +0 -1
  483. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-dc114b2367afe467.js +0 -1
  484. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-dc114b2367afe467.js +0 -1
  485. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-dc114b2367afe467.js +0 -1
  486. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-dc114b2367afe467.js +0 -1
  487. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-dc114b2367afe467.js +0 -1
  488. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-dc114b2367afe467.js +0 -1
  489. package/app/.next/static/chunks/app/api/pricing/route-dc114b2367afe467.js +0 -1
  490. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-dc114b2367afe467.js +0 -1
  491. package/app/.next/static/chunks/app/api/provider-nodes/route-dc114b2367afe467.js +0 -1
  492. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-dc114b2367afe467.js +0 -1
  493. package/app/.next/static/chunks/app/api/providers/[id]/models/route-dc114b2367afe467.js +0 -1
  494. package/app/.next/static/chunks/app/api/providers/[id]/route-dc114b2367afe467.js +0 -1
  495. package/app/.next/static/chunks/app/api/providers/[id]/test/route-dc114b2367afe467.js +0 -1
  496. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-dc114b2367afe467.js +0 -1
  497. package/app/.next/static/chunks/app/api/providers/client/route-dc114b2367afe467.js +0 -1
  498. package/app/.next/static/chunks/app/api/providers/route-dc114b2367afe467.js +0 -1
  499. package/app/.next/static/chunks/app/api/providers/test-batch/route-dc114b2367afe467.js +0 -1
  500. package/app/.next/static/chunks/app/api/providers/validate/route-dc114b2367afe467.js +0 -1
  501. package/app/.next/static/chunks/app/api/settings/database/route-dc114b2367afe467.js +0 -1
  502. package/app/.next/static/chunks/app/api/settings/proxy-test/route-dc114b2367afe467.js +0 -1
  503. package/app/.next/static/chunks/app/api/settings/require-login/route-dc114b2367afe467.js +0 -1
  504. package/app/.next/static/chunks/app/api/settings/route-dc114b2367afe467.js +0 -1
  505. package/app/.next/static/chunks/app/api/shutdown/route-dc114b2367afe467.js +0 -1
  506. package/app/.next/static/chunks/app/api/tags/route-dc114b2367afe467.js +0 -1
  507. package/app/.next/static/chunks/app/api/translator/console-logs/route-dc114b2367afe467.js +0 -1
  508. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-dc114b2367afe467.js +0 -1
  509. package/app/.next/static/chunks/app/api/translator/load/route-dc114b2367afe467.js +0 -1
  510. package/app/.next/static/chunks/app/api/translator/save/route-dc114b2367afe467.js +0 -1
  511. package/app/.next/static/chunks/app/api/translator/send/route-dc114b2367afe467.js +0 -1
  512. package/app/.next/static/chunks/app/api/translator/translate/route-dc114b2367afe467.js +0 -1
  513. package/app/.next/static/chunks/app/api/tunnel/disable/route-dc114b2367afe467.js +0 -1
  514. package/app/.next/static/chunks/app/api/tunnel/enable/route-dc114b2367afe467.js +0 -1
  515. package/app/.next/static/chunks/app/api/tunnel/status/route-dc114b2367afe467.js +0 -1
  516. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-dc114b2367afe467.js +0 -1
  517. package/app/.next/static/chunks/app/api/usage/chart/route-dc114b2367afe467.js +0 -1
  518. package/app/.next/static/chunks/app/api/usage/history/route-dc114b2367afe467.js +0 -1
  519. package/app/.next/static/chunks/app/api/usage/providers/route-dc114b2367afe467.js +0 -1
  520. package/app/.next/static/chunks/app/api/usage/request-details/route-dc114b2367afe467.js +0 -1
  521. package/app/.next/static/chunks/app/api/usage/request-logs/route-dc114b2367afe467.js +0 -1
  522. package/app/.next/static/chunks/app/api/usage/stream/route-dc114b2367afe467.js +0 -1
  523. package/app/.next/static/chunks/app/api/v1/api/chat/route-dc114b2367afe467.js +0 -1
  524. package/app/.next/static/chunks/app/api/v1/chat/completions/route-dc114b2367afe467.js +0 -1
  525. package/app/.next/static/chunks/app/api/v1/embeddings/route-dc114b2367afe467.js +0 -1
  526. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-dc114b2367afe467.js +0 -1
  527. package/app/.next/static/chunks/app/api/v1/messages/route-dc114b2367afe467.js +0 -1
  528. package/app/.next/static/chunks/app/api/v1/models/route-dc114b2367afe467.js +0 -1
  529. package/app/.next/static/chunks/app/api/v1/responses/route-dc114b2367afe467.js +0 -1
  530. package/app/.next/static/chunks/app/api/v1/route-dc114b2367afe467.js +0 -1
  531. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-dc114b2367afe467.js +0 -1
  532. package/app/.next/static/chunks/app/api/v1beta/models/route-dc114b2367afe467.js +0 -1
  533. package/app/.next/static/chunks/app/api/version/route-dc114b2367afe467.js +0 -1
  534. package/app/.next/static/chunks/app/manifest.webmanifest/route-dc114b2367afe467.js +0 -1
  535. package/app/.next/static/chunks/app/page-dc114b2367afe467.js +0 -1
  536. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-dc114b2367afe467.js +0 -1
  537. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-dc114b2367afe467.js +0 -1
  538. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-dc114b2367afe467.js +0 -1
  539. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-dc114b2367afe467.js +0 -1
  540. package/app/.next/static/css/544a28fc50711a49.css +0 -3
  541. /package/app/.next/static/{7sCSr7yWSqEyoyOGqrYLA → k3zp-r_EpPiF5lcYQ24hp}/_ssgManifest.js +0 -0
@@ -0,0 +1,15 @@
1
+ "use strict";exports.id=649,exports.ids=[649],exports.modules={62911:(a,b,c)=>{c.d(b,{d:()=>d});let d={claude:{id:"claude",name:"Claude Code",icon:"terminal",color:"#D97757",description:"Anthropic Claude Code CLI",configType:"env",envVars:{baseUrl:"ANTHROPIC_BASE_URL",model:"ANTHROPIC_MODEL",opusModel:"ANTHROPIC_DEFAULT_OPUS_MODEL",sonnetModel:"ANTHROPIC_DEFAULT_SONNET_MODEL",haikuModel:"ANTHROPIC_DEFAULT_HAIKU_MODEL"},modelAliases:["default","sonnet","opus","haiku","opusplan"],settingsFile:"~/.claude/settings.json",defaultModels:[{id:"opus",name:"Claude Opus",alias:"opus",envKey:"ANTHROPIC_DEFAULT_OPUS_MODEL",defaultValue:"cc/claude-opus-4-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",image:"/providers/codex.png",color:"#10A37F",description:"OpenAI Codex CLI",configType:"custom"},opencode:{id:"opencode",name:"OpenCode",image:"/providers/opencode.png",color:"#E87040",description:"OpenCode AI Terminal Assistant",configType:"custom"},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:["claude-opus-4-6-thinking","claude-sonnet-4-6","gemini-3-flash","gpt-oss-120b-medium","gemini-3-pro-high","gemini-3-pro-low"],defaultModels:[{id:"gemini-3.1-pro-high",name:"Gemini 3.1 Pro High",alias:"gemini-3.1-pro-high"},{id:"gemini-3.1-pro-low",name:"Gemini 3.1 Pro Low",alias:"gemini-3.1-pro-low"},{id:"gemini-3-flash",name:"Gemini 3 Flash",alias:"gemini-3-flash"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",alias:"claude-sonnet-4-6"},{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 Thinking",alias:"claude-opus-4-6-thinking"},{id:"gpt-oss-120b-medium",name:"GPT OSS 120B Medium",alias:"gpt-oss-120b-medium"}]},copilot:{id:"copilot",name:"GitHub Copilot",image:"/providers/copilot.png",color:"#1F6FEB",description:"GitHub Copilot IDE with MITM",configType:"mitm",mitmDomain:"api.individual.githubcopilot.com",modelAliases:["gpt-4o-mini","claude-haiku-4.5","gpt-4o","gpt-5-mini"],defaultModels:[{id:"gpt-4o",name:"GPT-4o",alias:"gpt-4o"},{id:"gpt-4.1",name:"GPT-4.1",alias:"gpt-4.1"},{id:"gpt-5-mini",name:"GPT-5 Mini",alias:"gpt-5-mini"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5",alias:"claude-haiku-4.5"}]},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 routes requests through its own server, so local endpoint is not supported. Please enable Tunnel or Cloud Endpoint in Settings."}],guideSteps:[{step:1,title:"Open Settings",desc:"Go to Settings → Models"},{step:2,title:"Enable OpenAI API",desc:'Enable "OpenAI API key" option'},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Add Custom Model",desc:'Click "View All Model" → "Add Custom Model"'},{step:6,title:"Select Model",type:"modelSelector"}]},cline:{id:"cline",name:"Cline",image:"/providers/cline.png",color:"#00D1B2",description:"Cline AI Coding Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Settings",desc:"Go to Cline Settings panel"},{step:2,title:"Select Provider",desc:"Choose API Provider → OpenAI Compatible"},{step:3,title:"Base URL",value:"{{baseUrl}}/v1",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Select Model",type:"modelSelector"}]},kilo:{id:"kilo",name:"Kilo Code",image:"/providers/kilocode.png",color:"#FF6B6B",description:"Kilo Code AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Settings",desc:"Go to Kilo Code Settings panel"},{step:2,title:"Select Provider",desc:"Choose API Provider → OpenAI Compatible"},{step:3,title:"Base URL",value:"{{baseUrl}}/v1",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Select Model",type:"modelSelector"}]},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:`{
2
+ "apiBase": "{{baseUrl}}",
3
+ "title": "{{model}}",
4
+ "model": "{{model}}",
5
+ "provider": "openai",
6
+ "apiKey": "{{apiKey}}"
7
+ }`}}}},83916:(a,b,c)=>{c.d(b,{Tk:()=>i,Ah:()=>j,a7:()=>n,ZM:()=>l,tA:()=>p,kn:()=>q,yZ:()=>m,qO:()=>o});var d=c(48249),e=c(67484),f=c(50412),g=c(81220);let h=process.env.NEXT_PUBLIC_CLOUD_URL;function i({tool:a,isExpanded:b,onToggle:c,activeProviders:i,modelMappings:j,onModelMappingChange:k,baseUrl:l,hasActiveProviders:m,apiKeys:n,cloudEnabled:o,initialStatus:p}){let q,r,s,[t,u]=(0,e.useState)(p||null),[v,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(null),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(null),[J,K]=(0,e.useState)(""),[L,M]=(0,e.useState)({}),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)("");(0,e.useRef)(!1);let R=(()=>{if(!t?.installed)return null;let a=t.settings?.env?.ANTHROPIC_BASE_URL;if(!a)return"not_configured";let b=a.includes("localhost")||a.includes("127.0.0.1"),c=o&&h&&a.startsWith(h),d=l&&a.startsWith(l);return b||c||d?"configured":"other"})(),S=()=>{let a=P||l;return a.endsWith("/v1")?a:`${a}/v1`},T=async()=>{y(!0),C(null);try{let b={ANTHROPIC_BASE_URL:S()},c=J?.trim()||(n?.length>0?n[0].key:null)||(o?null:"sk_9router");c&&(b.ANTHROPIC_AUTH_TOKEN=c),a.defaultModels.forEach(a=>{let c=j[a.alias];c&&a.envKey&&(b[a.envKey]=c)});let d=await fetch("/api/cli-tools/claude-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:b})}),e=await d.json();d.ok?(C({type:"success",text:"Settings applied successfully!"}),u(a=>({...a,hasBackup:!0,settings:{...a?.settings,env:b}}))):C({type:"error",text:e.error||"Failed to apply settings"})}catch(a){C({type:"error",text:a.message})}finally{y(!1)}},U=async()=>{A(!0),C(null);try{let b=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),c=await b.json();b.ok?(C({type:"success",text:"Settings reset successfully!"}),a.defaultModels.forEach(a=>k(a.alias,a.defaultValue||"")),K("")):C({type:"error",text:c.error||"Failed to reset settings"})}catch(a){C({type:"error",text:a.message})}finally{A(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/claude.png",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}),"configured"===R&&(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"===R&&(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"===R&&(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-4",children:[v&&(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:"Checking Claude CLI..."})]}),!v&&t&&!t.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Claude CLI not installed"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Please install Claude CLI to use this feature."})]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:()=>E(!D),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:D?"expand_less":"help"}),D?"Hide":"How to Install"]})]}),D&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,d.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @anthropic-ai/claude-code"})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"claude"})," to verify."]})]})]})]}),!v&&t?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[t?.settings?.env?.ANTHROPIC_BASE_URL&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:t.settings.env.ANTHROPIC_BASE_URL})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:(q=P||l).endsWith("/v1")?q:`${q}/v1`,onChange:a=>Q(a.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),P&&P!==l&&(0,d.jsx)("button",{onClick:()=>Q(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),n.length>0?(0,d.jsx)("select",{value:J,onChange:a=>K(a.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:n.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:o?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),a.defaultModels.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:a.name}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:j[a.alias]||"",onChange:b=>k(a.alias,b.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>{I(a.alias),G(!0)},disabled:!m,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${m?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),j[a.alias]&&(0,d.jsx)("button",{onClick:()=>k(a.alias,""),className:"p-1 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"})})]},a.alias))]}),B&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===B.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"===B.type?"check_circle":"error"}),(0,d.jsx)("span",{children:B.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:T,disabled:!m,loading:x,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:U,disabled:!t?.has9Router,loading:z,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>O(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:F,onClose:()=>G(!1),onSelect:a=>{H&&k(H,a.value)},selectedModel:H?j[H]:null,activeProviders:i,modelAliases:L,title:`Select model for ${H}`}),(0,d.jsx)(f.uR,{isOpen:N,onClose:()=>O(!1),title:"Claude CLI - Manual Configuration",configs:(r=J&&J.trim()?J:o?"<API_KEY_FROM_DASHBOARD>":"sk_9router",s={ANTHROPIC_BASE_URL:S(),ANTHROPIC_AUTH_TOKEN:r},a.defaultModels.forEach(a=>{let b=j[a.alias];b&&a.envKey&&(s[a.envKey]=b)}),[{filename:"~/.claude/settings.json",content:JSON.stringify({env:s},null,2)}])})]})}function j({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i,activeProviders:j,cloudEnabled:k,initialStatus:l}){let m,n,o,[p,q]=(0,e.useState)(l||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)(!1),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)(""),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)({}),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)(""),N=p?.installed?p.config?p.config.includes(h)||p.config.includes("localhost")||p.config.includes("127.0.0.1")?"configured":"other":"not_configured":null,O=()=>{let a=L||`${h}/v1`;return a.endsWith("/v1")?a:`${a}/v1`},P=async()=>{s(!0);try{let a=await fetch("/api/cli-tools/codex-settings"),b=await a.json();q(b)}catch(a){q({installed:!1,error:a.message})}finally{s(!1)}},Q=async()=>{u(!0),y(null);try{let a=B&&B.trim()||k?B:"sk_9router",b=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:O(),apiKey:a,model:D})}),c=await b.json();b.ok?(y({type:"success",text:"Settings applied successfully!"}),P()):y({type:"error",text:c.error||"Failed to apply settings"})}catch(a){y({type:"error",text:a.message})}finally{u(!1)}},R=async()=>{w(!0),y(null);try{let a=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),b=await a.json();a.ok?(y({type:"success",text:"Settings reset successfully!"}),E(""),P()):y({type:"error",text:b.error||"Failed to reset settings"})}catch(a){y({type:"error",text:a.message})}finally{w(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/codex.png",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}),"configured"===N&&(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"===N&&(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"===N&&(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-4",children:[r&&(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:"Checking Codex CLI..."})]}),!r&&p&&!p.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Codex CLI not installed"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Please install Codex CLI to use auto-apply feature."})]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:()=>A(!z),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:z?"expand_less":"help"}),z?"Hide":"How to Install"]})]}),z&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,d.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @openai/codex"})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"codex"})," to verify."]}),(0,d.jsx)("div",{className:"pt-2 border-t border-border",children:(0,d.jsxs)("p",{className:"text-text-muted text-xs",children:["Codex uses ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.codex/auth.json"})," with ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"OPENAI_API_KEY"}),'. Click "Apply" to auto-configure.']})})]})]})]}),!r&&p?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[p?.config&&((n=(m=p.config.match(/base_url\s*=\s*"([^"]+)"/))?m[1]:null)?(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:n})]}):null),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:L||`${h}/v1`,onChange:a=>M(a.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),L&&L!==`${h}/v1`&&(0,d.jsx)("button",{onClick:()=>M(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),i.length>0?(0,d.jsx)("select",{value:B,onChange:a=>C(a.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:i.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:k?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:D,onChange:a=>E(a.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>G(!0),disabled:!j?.length,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),D&&(0,d.jsx)("button",{onClick:()=>E(""),className:"p-1 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"})})]})]}),x&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===x.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"===x.type?"check_circle":"error"}),(0,d.jsx)("span",{children:x.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:Q,disabled:!B||!D,loading:t,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:R,disabled:!p.has9Router,loading:v,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>K(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:F,onClose:()=>G(!1),onSelect:a=>{E(a.value),G(!1)},selectedModel:D,activeProviders:j,modelAliases:H,title:"Select Model for Codex"}),(0,d.jsx)(f.uR,{isOpen:J,onClose:()=>K(!1),title:"Codex CLI - Manual Configuration",configs:(o=B&&B.trim()?B:k?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.codex/config.toml",content:`# 9Router Configuration for Codex CLI
8
+ model = "${D}"
9
+ model_provider = "9router"
10
+
11
+ [model_providers.9router]
12
+ name = "9Router"
13
+ base_url = "${O()}"
14
+ wire_api = "responses"
15
+ `},{filename:"~/.codex/auth.json",content:JSON.stringify({OPENAI_API_KEY:o},null,2)}])})]})}let k=process.env.NEXT_PUBLIC_CLOUD_URL;function l({tool:a,isExpanded:b,onToggle:c,baseUrl:h,hasActiveProviders:i,apiKeys:j,activeProviders:l,cloudEnabled:m,initialStatus:n}){let o,p,q,r,[s,t]=(0,e.useState)(n||null),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(""),[E,F]=(0,e.useState)(""),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)({}),[K,L]=(0,e.useState)(!1),[M,N]=(0,e.useState)("");(0,e.useRef)(!1);let O=(()=>{if(!s?.installed)return null;let a=s.settings?.customModels?.find(a=>"custom:9Router-0"===a.id);if(!a)return"not_configured";let b=a.baseUrl?.includes("localhost")||a.baseUrl?.includes("127.0.0.1"),c=m&&k&&a.baseUrl?.startsWith(k),d=h&&a.baseUrl?.startsWith(h);return b||c||d?"configured":"other"})(),P=async()=>{v(!0);try{let a=await fetch("/api/cli-tools/droid-settings"),b=await a.json();t(b)}catch(a){t({installed:!1,error:a.message})}finally{v(!1)}},Q=()=>{let a=M||h;return a.endsWith("/v1")?a:`${a}/v1`},R=async()=>{x(!0),B(null);try{let a=C?.trim()||(j?.length>0?j[0].key:null)||(m?null:"sk_9router"),b=await fetch("/api/cli-tools/droid-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:Q(),apiKey:a,model:E})}),c=await b.json();b.ok?(B({type:"success",text:"Settings applied successfully!"}),P()):B({type:"error",text:c.error||"Failed to apply settings"})}catch(a){B({type:"error",text:a.message})}finally{x(!1)}},S=async()=>{z(!0),B(null);try{let a=await fetch("/api/cli-tools/droid-settings",{method:"DELETE"}),b=await a.json();a.ok?(B({type:"success",text:"Settings reset successfully!"}),F(""),D(""),P()):B({type:"error",text:b.error||"Failed to reset settings"})}catch(a){B({type:"error",text:a.message})}finally{z(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/droid.png",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}),"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-4",children:[u&&(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:"Checking Factory Droid CLI..."})]}),!u&&s&&!s.installed&&(0,d.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Factory Droid CLI not installed"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Please install Factory Droid CLI to use this feature."})]})]}),!u&&s?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[s?.settings?.customModels?.find(a=>"custom:9Router-0"===a.id)?.baseUrl&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:s.settings.customModels.find(a=>"custom:9Router-0"===a.id).baseUrl})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:(o=M||h).endsWith("/v1")?o:`${o}/v1`,onChange:a=>N(a.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),M&&M!==h&&(0,d.jsx)("button",{onClick:()=>N(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),j.length>0?(0,d.jsx)("select",{value:C,onChange:a=>D(a.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:j.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:m?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:E,onChange:a=>F(a.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>H(!0),disabled:!i,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${i?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),E&&(0,d.jsx)("button",{onClick:()=>F(""),className:"p-1 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"})})]})]}),A&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===A.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===A.type?"check_circle":"error"}),(0,d.jsx)("span",{children:A.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:R,disabled:!E,loading:w,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:S,disabled:!s?.has9Router,loading:y,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>L(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:G,onClose:()=>H(!1),onSelect:a=>{F(a.value),H(!1)},selectedModel:E,activeProviders:l,modelAliases:I,title:"Select Model for Factory Droid"}),(0,d.jsx)(f.uR,{isOpen:K,onClose:()=>L(!1),title:"Factory Droid - Manual Configuration",configs:(p=C&&C.trim()?C:m?"<API_KEY_FROM_DASHBOARD>":"sk_9router",q={customModels:[{model:E||"provider/model-id",id:"custom:9Router-0",index:0,baseUrl:Q(),apiKey:p,displayName:E||"provider/model-id",maxOutputTokens:131072,noImageSupport:!1,provider:"openai"}]},r="u">typeof navigator&&navigator.platform,[{filename:r?.toLowerCase().includes("win")?"%USERPROFILE%\\.factory\\settings.json":"~/.factory/settings.json",content:JSON.stringify(q,null,2)}])})]})}function m({tool:a,isExpanded:b,onToggle:c,baseUrl:h,hasActiveProviders:i,apiKeys:j,activeProviders:k,cloudEnabled:l,initialStatus:m}){let n,o,[p,q]=(0,e.useState)(m||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)(!1),[F,G]=(0,e.useState)({}),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)("");(0,e.useRef)(!1);let L=(()=>{if(!p?.installed)return null;let a=p.settings?.models?.providers?.["9router"];if(!a)return"not_configured";let b=a.baseUrl?.includes("localhost")||a.baseUrl?.includes("127.0.0.1")||a.baseUrl?.includes("0.0.0.0"),c=h&&a.baseUrl?.startsWith(h);return b||c?"configured":"other"})(),M=async()=>{s(!0);try{let a=await fetch("/api/cli-tools/openclaw-settings"),b=await a.json();q(b)}catch(a){q({installed:!1,error:a.message})}finally{s(!1)}},N=()=>{let a=J||"http://127.0.0.1:20128";return a.endsWith("/v1")?a:`${a}/v1`},O=async()=>{u(!0),y(null);try{let a=z?.trim()||(j?.length>0?j[0].key:null)||(l?null:"sk_9router"),b=await fetch("/api/cli-tools/openclaw-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:N(),apiKey:a,model:B})}),c=await b.json();b.ok?(y({type:"success",text:"Settings applied successfully!"}),M()):y({type:"error",text:c.error||"Failed to apply settings"})}catch(a){y({type:"error",text:a.message})}finally{u(!1)}},P=async()=>{w(!0),y(null);try{let a=await fetch("/api/cli-tools/openclaw-settings",{method:"DELETE"}),b=await a.json();a.ok?(y({type:"success",text:"Settings reset successfully!"}),C(""),A(""),M()):y({type:"error",text:b.error||"Failed to reset settings"})}catch(a){y({type:"error",text:a.message})}finally{w(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/openclaw.png",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}),"configured"===L&&(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"===L&&(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"===L&&(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-4",children:[r&&(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:"Checking Open Claw CLI..."})]}),!r&&p&&!p.installed&&(0,d.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Open Claw CLI not installed"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Please install Open Claw CLI to use this feature."})]})]}),!r&&p?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[p?.settings?.models?.providers?.["9router"]?.baseUrl&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:p.settings.models.providers["9router"].baseUrl})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:(n=J||"http://127.0.0.1:20128").endsWith("/v1")?n:`${n}/v1`,onChange:a=>K(a.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),J&&J!==h&&(0,d.jsx)("button",{onClick:()=>K(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),j.length>0?(0,d.jsx)("select",{value:z,onChange:a=>A(a.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:j.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:l?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:B,onChange:a=>C(a.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>E(!0),disabled:!i,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${i?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),B&&(0,d.jsx)("button",{onClick:()=>C(""),className:"p-1 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"})})]})]}),x&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===x.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"===x.type?"check_circle":"error"}),(0,d.jsx)("span",{children:x.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:O,disabled:!B,loading:t,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:P,disabled:!p?.has9Router,loading:v,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>I(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:D,onClose:()=>E(!1),onSelect:a=>{C(a.value),E(!1)},selectedModel:B,activeProviders:k,modelAliases:F,title:"Select Model for Open Claw"}),(0,d.jsx)(f.uR,{isOpen:H,onClose:()=>I(!1),title:"Open Claw - Manual Configuration",configs:(o=z&&z.trim()?z:l?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.openclaw/openclaw.json",content:JSON.stringify({agents:{defaults:{model:{primary:`9router/${B||"provider/model-id"}`}}},models:{providers:{"9router":{baseUrl:N(),apiKey:o,api:"openai-completions",models:[{id:B||"provider/model-id",name:(B||"provider/model-id").split("/").pop()}]}}}},null,2)}])})]})}function n({toolId:a,tool:b,isExpanded:c,onToggle:h,baseUrl:i,apiKeys:j,activeProviders:k=[],cloudEnabled:l=!1,tunnelEnabled:m=!1}){let[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(""),[t,u]=(0,e.useState)(()=>j?.length>0?j[0].key:""),v=a=>{let b=t&&t.trim()?t:l?"your-api-key":"sk_9router",c=i||"http://localhost:20128",d=c.endsWith("/v1")?c:`${c}/v1`;return a.replace(/\{\{baseUrl\}\}/g,d).replace(/\{\{apiKey\}\}/g,b).replace(/\{\{model\}\}/g,r||"provider/model-id")},w=async(a,b)=>{await navigator.clipboard.writeText(v(a)),o(b),setTimeout(()=>o(null),2e3)},x=k.length>0,y=()=>(!b.requiresExternalUrl||!!l||!!m)&&(!b.requiresCloud||!!l);return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:h,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:b.image?(0,d.jsx)(g.default,{src:b.image,alt:b.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}}):b.icon?(0,d.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:b.color},children:b.icon}):(0,d.jsx)(g.default,{src:`/providers/${a}.png`,alt:b.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.jsx)("h3",{className:"font-medium text-sm",children:b.name}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:b.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${c?"rotate-180":""}`,children:"expand_more"})]}),c&&(0,d.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:b.guideSteps?(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[b.notes&&0!==b.notes.length?(0,d.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:b.notes.map((a,b)=>{if("cloudCheck"===a.type&&(l||m))return null;let c="warning"===a.type,e="cloudCheck"===a.type&&!l&&!m,f="bg-blue-500/10 border-blue-500/30",g="text-blue-600 dark:text-blue-400",h="text-blue-500",i="info";return c?(f="bg-yellow-500/10 border-yellow-500/30",g="text-yellow-600 dark:text-yellow-400",h="text-yellow-500",i="warning"):e&&(f="bg-red-500/10 border-red-500/30",g="text-red-600 dark:text-red-400",h="text-red-500",i="error"),(0,d.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${f}`,children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-lg ${h}`,children:i}),(0,d.jsx)("p",{className:`text-sm ${g}`,children:a.text})]},b)})}):null,y()&&b.guideSteps.map(a=>(0,d.jsxs)("div",{className:"flex items-start gap-4",children:[(0,d.jsx)("div",{className:"size-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold text-white",style:{backgroundColor:b.color},children:a.step}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"font-medium text-text",children:a.title}),a.desc&&(0,d.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:a.desc}),"apiKeySelector"===a.type&&(0,d.jsx)("div",{className:"mt-2 flex items-center gap-2",children:j&&j.length>0?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("select",{value:t,onChange:a=>u(a.target.value),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:j.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}),(0,d.jsx)("button",{onClick:()=>w(t,"apiKey"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"apiKey"===n?"check":"content_copy"})})]}):(0,d.jsx)("span",{className:"text-sm text-text-muted",children:l?"No API keys - Create one in Keys page":"sk_9router"})}),"modelSelector"===a.type&&(0,d.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,d.jsx)("input",{type:"text",value:r,onChange:a=>s(a.target.value),placeholder:"provider/model-id",className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>q(!0),disabled:!x,className:`shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors ${x?"bg-bg-secondary border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),r&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{onClick:()=>w(r,"model"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"model"===n?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>s(""),className:"p-2 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]})]}),a.value&&(0,d.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,d.jsx)("code",{className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm font-mono border border-border truncate",children:v(a.value)}),a.copyable&&(0,d.jsx)("button",{onClick:()=>w(a.value,`${a.step}-${a.title}`),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:n===`${a.step}-${a.title}`?"check":"content_copy"})})]})]})]},a.step)),y()&&b.codeBlock&&(0,d.jsxs)("div",{className:"mt-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wide",children:b.codeBlock.language}),(0,d.jsxs)("button",{onClick:()=>w(b.codeBlock.code,"codeblock"),className:"flex items-center gap-1 px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"codeblock"===n?"check":"content_copy"}),"codeblock"===n?"Copied!":"Copy"]})]}),(0,d.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto",children:(0,d.jsx)("code",{className:"text-sm font-mono whitespace-pre",children:v(b.codeBlock.code)})})]})]}):(0,d.jsx)("p",{className:"text-text-muted text-sm",children:"Coming soon..."})}),(0,d.jsx)(f.rq,{isOpen:p,onClose:()=>q(!1),onSelect:a=>{s(a.value)},selectedModel:r,activeProviders:k,title:"Select Model"})]})}function o({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i,activeProviders:j,cloudEnabled:k,initialStatus:l}){let m,[n,o]=(0,e.useState)(l||null),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(null),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(""),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)({}),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)(""),L=(()=>{if(!n?.installed)return null;if(!n.config)return"not_configured";let a=n.config?.provider?.["9router"]?.options?.baseURL||"",b=a.includes("localhost")||a.includes("127.0.0.1");return n.has9Router&&(b||a.includes(h))?"configured":n.has9Router?"other":"not_configured"})(),M=()=>{let a=J||h;return a.endsWith("/v1")?a:`${a}/v1`},N=async()=>{q(!0);try{let a=await fetch("/api/cli-tools/opencode-settings"),b=await a.json();o(b)}catch(a){o({installed:!1,error:a.message})}finally{q(!1)}},O=async()=>{s(!0),w(null);try{let a=z&&z.trim()||k?z:"sk_9router",b=await fetch("/api/cli-tools/opencode-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:M(),apiKey:a,model:B})}),c=await b.json();b.ok?(w({type:"success",text:"Settings applied successfully!"}),N()):w({type:"error",text:c.error||"Failed to apply settings"})}catch(a){w({type:"error",text:a.message})}finally{s(!1)}},P=async()=>{u(!0),w(null);try{let a=await fetch("/api/cli-tools/opencode-settings",{method:"DELETE"}),b=await a.json();a.ok?(w({type:"success",text:"Settings reset successfully!"}),C(""),N()):w({type:"error",text:b.error||"Failed to reset settings"})}catch(a){w({type:"error",text:a.message})}finally{u(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/opencode.png",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}),"configured"===L&&(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"===L&&(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"===L&&(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-4",children:[p&&(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:"Checking OpenCode CLI..."})]}),!p&&n&&!n.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"OpenCode CLI not installed"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Please install OpenCode CLI to use auto-apply feature."})]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:()=>y(!x),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:x?"expand_less":"help"}),x?"Hide":"How to Install"]})]}),x&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux:"}),(0,d.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g opencode-ai"})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"opencode"})," to verify."]})]})]})]}),!p&&n?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[n?.config?.provider?.["9router"]?.options?.baseURL&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:n.config.provider["9router"].options.baseURL})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:J||`${h}/v1`,onChange:a=>K(a.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),J&&J!==`${h}/v1`&&(0,d.jsx)("button",{onClick:()=>K(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),i.length>0?(0,d.jsx)("select",{value:z,onChange:a=>A(a.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:i.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:k?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:B,onChange:a=>C(a.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>E(!0),disabled:!j?.length,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),B&&(0,d.jsx)("button",{onClick:()=>C(""),className:"p-1 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"})})]})]}),v&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===v.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"===v.type?"check_circle":"error"}),(0,d.jsx)("span",{children:v.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:O,disabled:!B,loading:r,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:P,disabled:!n.has9Router,loading:t,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>I(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:D,onClose:()=>E(!1),onSelect:a=>{C(a.value),E(!1)},selectedModel:B,activeProviders:j,modelAliases:F,title:"Select Model for OpenCode"}),(0,d.jsx)(f.uR,{isOpen:H,onClose:()=>I(!1),title:"OpenCode - Manual Configuration",configs:(m=z&&z.trim()?z:k?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.config/opencode/opencode.json",content:JSON.stringify({provider:{"9router":{npm:"@ai-sdk/openai-compatible",options:{baseURL:M(),apiKey:m},models:{[B||"provider/model-id"]:{name:B||"provider/model-id"}}}},model:`9router/${B||"provider/model-id"}`},null,2)}])})]})}function p({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)(""),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),u="u">typeof navigator&&navigator.userAgent?.includes("Windows"),v=async()=>{try{let a=await fetch("/api/cli-tools/antigravity-mitm");if(a.ok){let b=await a.json();h(b),c?.(b)}}catch{h({running:!1,certExists:!1,dnsStatus:{}})}},w=a=>{u||g?.hasCachedPassword?x(a,""):(t(a),l(!0),r(null))},x=async(c,d)=>{j(!0),r(null);try{if("start"===c){let c=o?.trim()||(a?.length>0?a[0].key:null)||(b?null:"sk_9router"),e=await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:c,sudoPassword:d})}),f=await e.json();e.ok?r({type:"success",text:"Server started"}):r({type:"error",text:f.error||"Failed to start server"})}else{let a=await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:d})}),b=await a.json();a.ok?r({type:"success",text:"Server stopped — all DNS cleared"}):r({type:"error",text:b.error||"Failed to stop server"})}l(!1),n(""),await v()}catch(a){r({type:"error",text:a.message})}finally{j(!1),t(null)}},y=()=>{m.trim()?x(s,m):r({type:"error",text:"Sudo password is required"})},z=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 items-center justify-between",children:[(0,d.jsxs)("div",{className:"flex 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"}),z?(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 items-center gap-1 text-xs text-text-muted",children:[{label:"Cert",ok:g?.certExists},{label:"Server",ok:z}].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":"radio_button_unchecked"}),a]},a))})]}),(0,d.jsx)("div",{className:"px-2 py-2 rounded-lg bg-surface/50 border border-border/50",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:"How it works:"})," MITM server runs an HTTPS proxy on port 443. When you enable DNS for a tool, its API domain redirects to localhost. The proxy intercepts requests, applies your model mappings, and forwards to 9Router."]})}),!z&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted shrink-0",children:"API Key"}),a?.length>0?(0,d.jsx)("select",{value:o,onChange:a=>p(a.target.value),className:"flex-1 px-2 py-1 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:a.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"text-xs text-text-muted",children:b?"No API keys — create one in Keys page":"sk_9router (default)"})]}),q&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===q.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"===q.type?"check_circle":"error"}),(0,d.jsx)("span",{children:q.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[z?(0,d.jsxs)("button",{onClick:()=>w("stop"),disabled:i,className:"px-4 py-1.5 rounded-lg bg-red-500/10 border border-red-500/30 text-red-500 font-medium text-xs flex items-center gap-1.5 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop Server"]}):(0,d.jsxs)("button",{onClick:()=>w("start"),disabled:i,className:"px-4 py-1.5 rounded-lg bg-primary/10 border border-primary/30 text-primary font-medium text-xs flex items-center gap-1.5 hover:bg-primary/20 transition-colors disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start Server"]}),z&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Enable DNS per tool below to activate interception"})]}),!z&&u&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-yellow-500/10 text-yellow-600 border border-yellow-500/20",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"warning"}),(0,d.jsx)("span",{children:"Windows: Run 9Router terminal as Administrator"})]})]})}),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:"bg-surface border border-border rounded-xl p-6 w-full max-w-sm flex flex-col gap-4 shadow-xl",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||y()}}),q&&(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:q.text})]}),(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(""),r(null)},disabled:i,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:y,loading:i,children:"Confirm"})]})]})})]})}function q({tool:a,isExpanded:b,onToggle:c,serverRunning:h,dnsActive:i,certCovered:j,hasCachedPassword:k,apiKeys:l,activeProviders:m,hasActiveProviders:n,cloudEnabled:o,onDnsChange:p}){let[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(""),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)({}),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(null),G="u">typeof navigator&&navigator.userAgent?.includes("Windows"),H=(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]),I=(a,b)=>{B(c=>({...c,[a]:b}))},J=()=>{if(!h)return;let a=i?"disable":"enable";G||k?K(a,""):(z(a),v(!0),t(null))},K=async(b,c)=>{r(!0),t(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");t({type:"success",text:"enable"===b?"DNS enabled — traffic intercepted":"DNS disabled — traffic restored"}),v(!1),x(""),p?.(e)}catch(a){t({type:"error",text:a.message})}finally{r(!1),z(null)}},L=()=>{w.trim()?K(y,w):t({type:"error",text:"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-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{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}),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.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.mitmDomain})]})]}),(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:[(0,d.jsxs)("div",{className:"flex flex-col gap-0.5 text-[11px] text-text-muted px-1",children:[(0,d.jsxs)("p",{children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:"Domain:"})," ",(0,d.jsx)("code",{className:"text-[10px] bg-surface px-1 rounded",children:a.mitmDomain}),void 0!==j&&(0,d.jsxs)("span",{className:`ml-1.5 ${j?"text-green-600":"text-red-500"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[11px] align-middle",children:j?"verified":"warning"}),j?" cert OK":" cert missing domain"]})]}),(0,d.jsxs)("p",{children:["Toggle DNS to redirect ",a.name," traffic through 9Router via MITM."]})]}),s&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===s.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"===s.type?"check_circle":"error"}),(0,d.jsx)("span",{children:s.text})]}),a.defaultModels?.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-2",children:a.defaultModels.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-36 shrink-0 text-xs font-semibold text-text-main text-right",children:a.name}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:A[a.alias]||"",onChange:b=>I(a.alias,b.target.value),onBlur:b=>{var c,d;return c=a.alias,d=b.target.value,void H({...A,[c]:d})},placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>{F(a.alias),D(!0)},disabled:!n,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 ${n?"bg-surface border-border hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"}),A[a.alias]&&(0,d.jsx)("button",{onClick:()=>{I(a.alias,""),H({...A,[a.alias]:""})},className:"p-1 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"})})]},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.jsx)("div",{children:i?(0,d.jsxs)("button",{onClick:J,disabled:!h||q,className:"px-4 py-1.5 rounded-lg bg-red-500/10 border border-red-500/30 text-red-500 font-medium text-xs flex items-center gap-1.5 hover:bg-red-500/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop DNS"]}):(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:J,loading:q,disabled:!h||q,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"play_circle"}),"Start DNS"]})})]})]}),u&&(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:"bg-surface border border-border rounded-xl p-6 w-full max-w-sm flex flex-col gap-4 shadow-xl",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:w,onChange:a=>x(a.target.value),onKeyDown:a=>{"Enter"!==a.key||q||L()}}),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.text})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>{v(!1),x(""),t(null)},disabled:q,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:L,loading:q,children:"Confirm"})]})]})}),(0,d.jsx)(f.rq,{isOpen:C,onClose:()=>D(!1),onSelect:a=>{if(!E)return;let b={...A,[E]:a.value};B(b),H(b)},selectedModel:E?A[E]:null,activeProviders:m,title:`Select model for ${E}`})]})}}};
@@ -1 +1 @@
1
- "use strict";exports.id=7647,exports.ids=[7647],exports.modules={2255:(a,b,c)=>{let d,e;c.d(b,{$V:()=>o,A9:()=>h,Bm:()=>w,C8:()=>x,Cn:()=>i,Co:()=>n,EQ:()=>v,K:()=>k,LY:()=>t,NA:()=>p,O:()=>u,Ox:()=>j,Uc:()=>q,eo:()=>r,gx:()=>s,nZ:()=>l,x0:()=>g,xq:()=>m});var f=c(21820);let g={VSCODE_VERSION:"1.110.0",COPILOT_CHAT_VERSION:"0.38.0",USER_AGENT:"GitHubCopilotChat/0.38.0",API_VERSION:"2025-04-01"};function h(){let a=(0,f.platform)(),b=(0,f.arch)();return`antigravity/1.104.0 ${a}/${b}`}let i={ideType:9,platform:(d=(0,f.platform)(),e=(0,f.arch)(),"darwin"===d?"arm64"===e?2:1:"linux"===d?"arm64"===e?4:3:5*("win32"===d)),pluginType:2},j={name:"x-request-source",value:"local"},k={"X-Client-Name":"antigravity","X-Client-Version":"1.107.0","x-goog-api-client":"gl-node/18.18.2 fire/0.8.6 grpc/1.10.x","User-Agent":"antigravity/1.107.0 darwin/arm64"},l={loadCodeAssist:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUser:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser"},m={claude:{baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14,context-management-2025-06-27","Anthropic-Dangerous-Direct-Browser-Access":"true","User-Agent":"claude-cli/1.0.83 (external, cli)","X-App":"cli","X-Stainless-Helper-Method":"stream","X-Stainless-Retry-Count":"0","X-Stainless-Runtime-Version":"v24.3.0","X-Stainless-Package-Version":"0.55.1","X-Stainless-Runtime":"node","X-Stainless-Lang":"js","X-Stainless-Arch":"arm64","X-Stainless-Os":"MacOS","X-Stainless-Timeout":"60"},clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",tokenUrl:"https://console.anthropic.com/v1/oauth/token"},gemini:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",format:"gemini",clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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"},"gemini-cli":{baseUrl:"https://cloudcode-pa.googleapis.com/v1internal",format:"gemini-cli",clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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"},codex:{baseUrl:"https://chatgpt.com/backend-api/codex/responses",format:"openai-responses",headers:{originator:"codex-cli","User-Agent":"codex-cli/1.0.18 (macOS; arm64)"},clientId:"app_EMoamEEZ73f0CkXaXp7hrann",clientSecret:"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",tokenUrl:"https://auth.openai.com/oauth/token"},qwen:{baseUrl:"https://portal.qwen.ai/v1/chat/completions",format:"openai",headers:{"User-Agent":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"gl-node/22.17.0"},clientId:"f0304373b74a44d2b584a3fb70ca9e56",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",authUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code"},iflow:{baseUrl:"https://apis.iflow.cn/v1/chat/completions",format:"openai",headers:{"User-Agent":"iFlow-Cli"},clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",tokenUrl:"https://iflow.cn/oauth/token",authUrl:"https://iflow.cn/oauth"},antigravity:{baseUrls:["https://daily-cloudcode-pa.googleapis.com","https://cloudcode-pa.googleapis.com"],format:"antigravity",headers:{"User-Agent":h()},clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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"},openrouter:{baseUrl:"https://openrouter.ai/api/v1/chat/completions",format:"openai",headers:{"HTTP-Referer":"https://endpoint-proxy.local","X-Title":"Endpoint Proxy"}},openai:{baseUrl:"https://api.openai.com/v1/chat/completions",format:"openai"},glm:{baseUrl:"https://api.z.ai/api/anthropic/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"}},"glm-cn":{baseUrl:"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",format:"openai",headers:{}},kimi:{baseUrl:"https://api.kimi.com/coding/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"}},minimax:{baseUrl:"https://api.minimax.io/anthropic/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"}},"minimax-cn":{baseUrl:"https://api.minimaxi.com/anthropic/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"}},alicode:{baseUrl:"https://coding.dashscope.aliyuncs.com/v1/chat/completions",format:"openai",headers:{}},github:{baseUrl:"https://api.githubcopilot.com/chat/completions",responsesUrl:"https://api.githubcopilot.com/responses",format:"openai",headers:{"copilot-integration-id":"vscode-chat","editor-version":`vscode/${g.VSCODE_VERSION}`,"editor-plugin-version":`copilot-chat/${g.COPILOT_CHAT_VERSION}`,"user-agent":g.USER_AGENT,"openai-intent":"conversation-panel","x-github-api-version":g.API_VERSION,"x-vscode-user-agent-library-version":"electron-fetch","X-Initiator":"user",Accept:"application/json","Content-Type":"application/json"}},kiro:{baseUrl:"https://codewhisperer.us-east-1.amazonaws.com/generateAssistantResponse",format:"kiro",headers:{"Content-Type":"application/json",Accept:"application/vnd.amazon.eventstream","X-Amz-Target":"AmazonCodeWhispererStreamingService.GenerateAssistantResponse","User-Agent":"AWS-SDK-JS/3.0.0 kiro-ide/1.0.0","X-Amz-User-Agent":"aws-sdk-js/3.0.0 kiro-ide/1.0.0"},tokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authUrl:"https://prod.us-east-1.auth.desktop.kiro.dev"},cursor:{baseUrl:"https://api2.cursor.sh",chatPath:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",format:"cursor",headers:{"connect-accept-encoding":"gzip","connect-protocol-version":"1","Content-Type":"application/connect+proto","User-Agent":"connect-es/1.6.1"},clientVersion:"1.1.3"},"kimi-coding":{baseUrl:"https://api.kimi.com/coding/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"},clientId:"17e5f671-d194-4dfb-9706-5516cb48c098",tokenUrl:"https://auth.kimi.com/api/oauth/token",refreshUrl:"https://auth.kimi.com/api/oauth/token"},kilocode:{baseUrl:"https://api.kilo.ai/api/openrouter/chat/completions",format:"openai",headers:{}},cline:{baseUrl:"https://api.cline.bot/api/v1/chat/completions",format:"openai",headers:{"HTTP-Referer":"https://cline.bot","X-Title":"Cline"},tokenUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},nvidia:{baseUrl:"https://integrate.api.nvidia.com/v1/chat/completions",format:"openai"},anthropic:{baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"}},deepseek:{baseUrl:"https://api.deepseek.com/chat/completions",format:"openai"},groq:{baseUrl:"https://api.groq.com/openai/v1/chat/completions",format:"openai"},xai:{baseUrl:"https://api.x.ai/v1/chat/completions",format:"openai"},mistral:{baseUrl:"https://api.mistral.ai/v1/chat/completions",format:"openai"},perplexity:{baseUrl:"https://api.perplexity.ai/chat/completions",format:"openai"},together:{baseUrl:"https://api.together.xyz/v1/chat/completions",format:"openai"},fireworks:{baseUrl:"https://api.fireworks.ai/inference/v1/chat/completions",format:"openai"},cerebras:{baseUrl:"https://api.cerebras.ai/v1/chat/completions",format:"openai"},cohere:{baseUrl:"https://api.cohere.ai/v1/chat/completions",format:"openai"},nebius:{baseUrl:"https://api.studio.nebius.ai/v1/chat/completions",format:"openai"},siliconflow:{baseUrl:"https://api.siliconflow.cn/v1/chat/completions",format:"openai"},hyperbolic:{baseUrl:"https://api.hyperbolic.xyz/v1/chat/completions",format:"openai"},deepgram:{baseUrl:"https://api.deepgram.com/v1/listen",format:"openai"},assemblyai:{baseUrl:"https://api.assemblyai.com/v1/audio/transcriptions",format:"openai"},nanobanana:{baseUrl:"https://api.nanobananaapi.ai/v1/chat/completions",format:"openai"},chutes:{baseUrl:"https://llm.chutes.ai/v1/chat/completions",format:"openai"}},n="You are Claude Code, Anthropic's official CLI for Claude.",o="You are Antigravity, a powerful agentic AI coding assistant designed by the Google Deepmind team working on Advanced Agentic Coding.You are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.**Absolute paths only****Proactiveness**",p={google:{token:"https://oauth2.googleapis.com/token",auth:"https://accounts.google.com/o/oauth2/auth"},openai:{token:"https://auth.openai.com/oauth/token",auth:"https://auth.openai.com/oauth/authorize"},anthropic:{token:"https://console.anthropic.com/v1/oauth/token",auth:"https://console.anthropic.com/v1/oauth/authorize"},qwen:{token:"https://chat.qwen.ai/api/v1/oauth2/token",auth:"https://chat.qwen.ai/api/v1/oauth2/device/code"},iflow:{token:"https://iflow.cn/oauth/token",auth:"https://iflow.cn/oauth"},github:{token:"https://github.com/login/oauth/access_token",auth:"https://github.com/login/oauth/authorize",deviceCode:"https://github.com/login/device/code"}},q=64e3,r=32e3,s={BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,NOT_ACCEPTABLE:406,REQUEST_TIMEOUT:408,RATE_LIMITED:429,SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504},t={[s.BAD_REQUEST]:{type:"invalid_request_error",code:"bad_request"},[s.UNAUTHORIZED]:{type:"authentication_error",code:"invalid_api_key"},[s.FORBIDDEN]:{type:"permission_error",code:"insufficient_quota"},[s.NOT_FOUND]:{type:"invalid_request_error",code:"model_not_found"},[s.NOT_ACCEPTABLE]:{type:"invalid_request_error",code:"model_not_supported"},[s.RATE_LIMITED]:{type:"rate_limit_error",code:"rate_limit_exceeded"},[s.SERVER_ERROR]:{type:"server_error",code:"internal_server_error"},[s.BAD_GATEWAY]:{type:"server_error",code:"bad_gateway"},[s.SERVICE_UNAVAILABLE]:{type:"server_error",code:"service_unavailable"},[s.GATEWAY_TIMEOUT]:{type:"server_error",code:"gateway_timeout"}},u={[s.BAD_REQUEST]:"Bad request",[s.UNAUTHORIZED]:"Invalid API key provided",[s.FORBIDDEN]:"You exceeded your current quota",[s.NOT_FOUND]:"Model not found",[s.NOT_ACCEPTABLE]:"Model not supported",[s.RATE_LIMITED]:"Rate limit exceeded",[s.SERVER_ERROR]:"Internal server error",[s.BAD_GATEWAY]:"Bad gateway - upstream provider error",[s.SERVICE_UNAVAILABLE]:"Service temporarily unavailable",[s.GATEWAY_TIMEOUT]:"Gateway timeout"},v={base:1e3,max:12e4,maxLevel:15},w={unauthorized:12e4,paymentRequired:12e4,notFound:12e4,transient:3e4,requestNotAllowed:5e3,rateLimit:12e4,serviceUnavailable:2e3,authExpired:12e4},x=["Please write a 5-10 word title for the following conversation:"]},57647:(a,b,c)=>{c.d(b,{SZ:()=>o,Tz:()=>j,e2:()=>m,jJ:()=>n,vA:()=>l});var d=c(2255);let e="https://api.openai.com/v1",f="https://api.anthropic.com/v1";function g(a){return"string"==typeof a&&a.startsWith("openai-compatible-")}function h(a){return"string"==typeof a&&a.startsWith("anthropic-compatible-")}function i(a){return g(a)&&a.includes("responses")?"responses":"chat"}function j(a){if(a.input&&(Array.isArray(a.input)||"string"==typeof a.input)&&!a.messages)return"openai-responses";if(a.request?.contents&&"antigravity"===a.userAgent)return"antigravity";if(a.contents&&Array.isArray(a.contents))return"gemini";if(a.stream_options||a.response_format||void 0!==a.logprobs||void 0!==a.top_logprobs||void 0!==a.n||void 0!==a.presence_penalty||void 0!==a.frequency_penalty||a.logit_bias||a.user)return"openai";if(a.messages&&Array.isArray(a.messages)){let b=a.messages[0];if(b?.content&&Array.isArray(b.content)){let c=b.content[0];if(c?.type==="text"&&!a.model?.includes("/")){if(a.system||a.anthropic_version)return"claude";let c=b.content.some(a=>"image"===a.type&&a.source?.type==="base64"),d=b.content.some(a=>"image_url"===a.type&&a.image_url?.url);if(c)return"claude";if(d)return"openai";if(b.content.some(a=>"tool_use"===a.type||"tool_result"===a.type))return"claude"}}if(void 0!==a.system||a.anthropic_version)return"claude"}return"openai"}function k(a){if(g(a)){let b=i(a);return{...d.xq.openai,format:"responses"===b?"openai-responses":"openai",baseUrl:e}}return h(a)?{...d.xq.anthropic,format:"claude",baseUrl:f}:d.xq[a]||d.xq.openai}function l(a,b,c=!0,d={}){if(g(a)){var j;let b,c=i(a);return j=d?.baseUrl||e,b=j.replace(/\/$/,""),`${b}${"responses"===c?"/responses":"/chat/completions"}`}if(h(a)){let a;return a=(d?.baseUrl||f).replace(/\/$/,""),`${a}/messages`}let m=k(a);switch(a){case"claude":case"glm":case"kimi":case"minimax":return`${m.baseUrl}?beta=true`;case"gemini":return`${m.baseUrl}/${b}:${c?"streamGenerateContent?alt=sse":"generateContent"}`;case"gemini-cli":return`${m.baseUrl}:${c?"streamGenerateContent?alt=sse":"generateContent"}`;case"antigravity":{let a=d?.baseUrlIndex||0,b=m.baseUrls[a]||m.baseUrls[0];return`${b}${c?"/v1internal:streamGenerateContent?alt=sse":"/v1internal:generateContent"}`}default:return m.baseUrl}}function m(a,b,c=!0,d=null){let e={"Content-Type":"application/json",...k(a).headers};if(h(a))b.apiKey?e["x-api-key"]=b.apiKey:b.accessToken&&(e.Authorization=`Bearer ${b.accessToken}`),e["anthropic-version"]||(e["anthropic-version"]="2023-06-01");else switch(a){case"gemini":b.apiKey?e["x-goog-api-key"]=b.apiKey:b.accessToken&&(e.Authorization=`Bearer ${b.accessToken}`);break;case"antigravity":case"gemini-cli":e.Authorization=`Bearer ${b.accessToken}`;break;case"claude":b.apiKey?e["x-api-key"]=b.apiKey:b.accessToken&&(e.Authorization=`Bearer ${b.accessToken}`);break;case"github":let f=b.copilotToken||b.accessToken;e.Authorization=`Bearer ${f}`,e["Content-Type"]="application/json",e["copilot-integration-id"]="vscode-chat",e["editor-version"]="vscode/1.107.1",e["editor-plugin-version"]="copilot-chat/0.26.7",e["user-agent"]="GitHubCopilotChat/0.26.7",e["openai-intent"]="conversation-panel",e["x-github-api-version"]="2025-04-01",e["x-request-id"]=crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){let b=16*Math.random()|0;return("x"==a?b:3&b|8).toString(16)}),e["x-vscode-user-agent-library-version"]="electron-fetch",e["X-Initiator"]="user",e.Accept="application/json";break;case"codex":case"qwen":case"openai":case"openrouter":default:e.Authorization=`Bearer ${b.apiKey||b.accessToken}`;break;case"glm":case"kimi":case"minimax":e["x-api-key"]=b.apiKey}return c&&(e.Accept="text/event-stream"),e}function n(a){return g(a)?"responses"===i(a)?"openai-responses":"openai":h(a)?"claude":k(a).format||"openai"}function o(a){return!function(a){let b=a.messages||a.contents;if(!b?.length)return!0;let c=b[b.length-1];return c?.role==="user"}(a)&&(delete a.reasoning_effort,delete a.thinking),a}}};
1
+ "use strict";exports.id=7647,exports.ids=[7647],exports.modules={2255:(a,b,c)=>{let d,e;c.d(b,{$V:()=>q,A9:()=>h,Bm:()=>y,C8:()=>z,Cn:()=>i,Co:()=>p,EQ:()=>x,Ic:()=>m,K:()=>k,LY:()=>v,NA:()=>r,O:()=>w,Ox:()=>j,Uc:()=>s,eo:()=>t,gx:()=>u,nZ:()=>l,x0:()=>g,xq:()=>o,zv:()=>n});var f=c(21820);let g={VSCODE_VERSION:"1.110.0",COPILOT_CHAT_VERSION:"0.38.0",USER_AGENT:"GitHubCopilotChat/0.38.0",API_VERSION:"2025-04-01"};function h(){let a=(0,f.platform)(),b=(0,f.arch)();return`antigravity/1.104.0 ${a}/${b}`}let i={ideType:9,platform:(d=(0,f.platform)(),e=(0,f.arch)(),"darwin"===d?"arm64"===e?2:1:"linux"===d?"arm64"===e?4:3:5*("win32"===d)),pluginType:2},j={name:"x-request-source",value:"local"},k={"X-Client-Name":"antigravity","X-Client-Version":"1.107.0","x-goog-api-client":"gl-node/18.18.2 fire/0.8.6 grpc/1.10.x","User-Agent":"antigravity/1.107.0 darwin/arm64"},l={loadCodeAssist:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUser:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser"},m={"Content-Type":"application/json","User-Agent":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"google-cloud-sdk vscode_cloudshelleditor/0.1","Client-Metadata":JSON.stringify({ideType:"IDE_UNSPECIFIED",platform:"PLATFORM_UNSPECIFIED",pluginType:"GEMINI"})},n={ideType:"IDE_UNSPECIFIED",platform:"PLATFORM_UNSPECIFIED",pluginType:"GEMINI"},o={claude:{baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05","Anthropic-Dangerous-Direct-Browser-Access":"true","User-Agent":"claude-cli/2.1.63 (external, cli)","X-App":"cli","X-Stainless-Helper-Method":"stream","X-Stainless-Retry-Count":"0","X-Stainless-Runtime-Version":"v24.3.0","X-Stainless-Package-Version":"0.74.0","X-Stainless-Runtime":"node","X-Stainless-Lang":"js","X-Stainless-Arch":function(){switch((0,f.arch)()){case"x64":return"x64";case"arm64":return"arm64";case"ia32":return"x86";default:return`other::${(0,f.arch)()}`}}(),"X-Stainless-Os":function(){switch((0,f.platform)()){case"darwin":return"MacOS";case"win32":return"Windows";case"linux":return"Linux";case"freebsd":return"FreeBSD";default:return`Other::${(0,f.platform)()}`}}(),"X-Stainless-Timeout":"600"},clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",tokenUrl:"https://api.anthropic.com/v1/oauth/token"},gemini:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",format:"gemini",clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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"},"gemini-cli":{baseUrl:"https://cloudcode-pa.googleapis.com/v1internal",format:"gemini-cli",clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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"},codex:{baseUrl:"https://chatgpt.com/backend-api/codex/responses",format:"openai-responses",headers:{originator:"codex-cli","User-Agent":"codex-cli/1.0.18 (macOS; arm64)"},clientId:"app_EMoamEEZ73f0CkXaXp7hrann",clientSecret:"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",tokenUrl:"https://auth.openai.com/oauth/token"},qwen:{baseUrl:"https://portal.qwen.ai/v1/chat/completions",format:"openai",headers:{"User-Agent":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"gl-node/22.17.0"},clientId:"f0304373b74a44d2b584a3fb70ca9e56",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",authUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code"},iflow:{baseUrl:"https://apis.iflow.cn/v1/chat/completions",format:"openai",headers:{"User-Agent":"iFlow-Cli"},clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",tokenUrl:"https://iflow.cn/oauth/token",authUrl:"https://iflow.cn/oauth"},antigravity:{baseUrls:["https://daily-cloudcode-pa.googleapis.com","https://cloudcode-pa.googleapis.com"],format:"antigravity",headers:{"User-Agent":h()},clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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"},openrouter:{baseUrl:"https://openrouter.ai/api/v1/chat/completions",format:"openai",headers:{"HTTP-Referer":"https://endpoint-proxy.local","X-Title":"Endpoint Proxy"}},openai:{baseUrl:"https://api.openai.com/v1/chat/completions",format:"openai"},glm:{baseUrl:"https://api.z.ai/api/anthropic/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"}},"glm-cn":{baseUrl:"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",format:"openai",headers:{}},kimi:{baseUrl:"https://api.kimi.com/coding/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"}},minimax:{baseUrl:"https://api.minimax.io/anthropic/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"}},"minimax-cn":{baseUrl:"https://api.minimaxi.com/anthropic/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"}},alicode:{baseUrl:"https://coding.dashscope.aliyuncs.com/v1/chat/completions",format:"openai",headers:{}},github:{baseUrl:"https://api.githubcopilot.com/chat/completions",responsesUrl:"https://api.githubcopilot.com/responses",format:"openai",headers:{"copilot-integration-id":"vscode-chat","editor-version":`vscode/${g.VSCODE_VERSION}`,"editor-plugin-version":`copilot-chat/${g.COPILOT_CHAT_VERSION}`,"user-agent":g.USER_AGENT,"openai-intent":"conversation-panel","x-github-api-version":g.API_VERSION,"x-vscode-user-agent-library-version":"electron-fetch","X-Initiator":"user",Accept:"application/json","Content-Type":"application/json"}},kiro:{baseUrl:"https://codewhisperer.us-east-1.amazonaws.com/generateAssistantResponse",format:"kiro",headers:{"Content-Type":"application/json",Accept:"application/vnd.amazon.eventstream","X-Amz-Target":"AmazonCodeWhispererStreamingService.GenerateAssistantResponse","User-Agent":"AWS-SDK-JS/3.0.0 kiro-ide/1.0.0","X-Amz-User-Agent":"aws-sdk-js/3.0.0 kiro-ide/1.0.0"},tokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authUrl:"https://prod.us-east-1.auth.desktop.kiro.dev"},cursor:{baseUrl:"https://api2.cursor.sh",chatPath:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",format:"cursor",headers:{"connect-accept-encoding":"gzip","connect-protocol-version":"1","Content-Type":"application/connect+proto","User-Agent":"connect-es/1.6.1"},clientVersion:"1.1.3"},"kimi-coding":{baseUrl:"https://api.kimi.com/coding/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"},clientId:"17e5f671-d194-4dfb-9706-5516cb48c098",tokenUrl:"https://auth.kimi.com/api/oauth/token",refreshUrl:"https://auth.kimi.com/api/oauth/token"},kilocode:{baseUrl:"https://api.kilo.ai/api/openrouter/chat/completions",format:"openai",headers:{}},cline:{baseUrl:"https://api.cline.bot/api/v1/chat/completions",format:"openai",headers:{"HTTP-Referer":"https://cline.bot","X-Title":"Cline"},tokenUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},nvidia:{baseUrl:"https://integrate.api.nvidia.com/v1/chat/completions",format:"openai"},anthropic:{baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"}},deepseek:{baseUrl:"https://api.deepseek.com/chat/completions",format:"openai"},groq:{baseUrl:"https://api.groq.com/openai/v1/chat/completions",format:"openai"},xai:{baseUrl:"https://api.x.ai/v1/chat/completions",format:"openai"},mistral:{baseUrl:"https://api.mistral.ai/v1/chat/completions",format:"openai"},perplexity:{baseUrl:"https://api.perplexity.ai/chat/completions",format:"openai"},together:{baseUrl:"https://api.together.xyz/v1/chat/completions",format:"openai"},fireworks:{baseUrl:"https://api.fireworks.ai/inference/v1/chat/completions",format:"openai"},cerebras:{baseUrl:"https://api.cerebras.ai/v1/chat/completions",format:"openai"},cohere:{baseUrl:"https://api.cohere.ai/v1/chat/completions",format:"openai"},nebius:{baseUrl:"https://api.studio.nebius.ai/v1/chat/completions",format:"openai"},siliconflow:{baseUrl:"https://api.siliconflow.cn/v1/chat/completions",format:"openai"},hyperbolic:{baseUrl:"https://api.hyperbolic.xyz/v1/chat/completions",format:"openai"},deepgram:{baseUrl:"https://api.deepgram.com/v1/listen",format:"openai"},assemblyai:{baseUrl:"https://api.assemblyai.com/v1/audio/transcriptions",format:"openai"},nanobanana:{baseUrl:"https://api.nanobananaapi.ai/v1/chat/completions",format:"openai"},chutes:{baseUrl:"https://llm.chutes.ai/v1/chat/completions",format:"openai"}},p="You are a Claude agent, built on Anthropic's Claude Agent SDK.",q="You are Antigravity, a powerful agentic AI coding assistant designed by the Google Deepmind team working on Advanced Agentic Coding.You are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.**Absolute paths only****Proactiveness**",r={google:{token:"https://oauth2.googleapis.com/token",auth:"https://accounts.google.com/o/oauth2/auth"},openai:{token:"https://auth.openai.com/oauth/token",auth:"https://auth.openai.com/oauth/authorize"},anthropic:{token:"https://api.anthropic.com/v1/oauth/token",auth:"https://api.anthropic.com/v1/oauth/authorize"},qwen:{token:"https://chat.qwen.ai/api/v1/oauth2/token",auth:"https://chat.qwen.ai/api/v1/oauth2/device/code"},iflow:{token:"https://iflow.cn/oauth/token",auth:"https://iflow.cn/oauth"},github:{token:"https://github.com/login/oauth/access_token",auth:"https://github.com/login/oauth/authorize",deviceCode:"https://github.com/login/device/code"}},s=64e3,t=32e3,u={BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,NOT_ACCEPTABLE:406,REQUEST_TIMEOUT:408,RATE_LIMITED:429,SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504},v={[u.BAD_REQUEST]:{type:"invalid_request_error",code:"bad_request"},[u.UNAUTHORIZED]:{type:"authentication_error",code:"invalid_api_key"},[u.FORBIDDEN]:{type:"permission_error",code:"insufficient_quota"},[u.NOT_FOUND]:{type:"invalid_request_error",code:"model_not_found"},[u.NOT_ACCEPTABLE]:{type:"invalid_request_error",code:"model_not_supported"},[u.RATE_LIMITED]:{type:"rate_limit_error",code:"rate_limit_exceeded"},[u.SERVER_ERROR]:{type:"server_error",code:"internal_server_error"},[u.BAD_GATEWAY]:{type:"server_error",code:"bad_gateway"},[u.SERVICE_UNAVAILABLE]:{type:"server_error",code:"service_unavailable"},[u.GATEWAY_TIMEOUT]:{type:"server_error",code:"gateway_timeout"}},w={[u.BAD_REQUEST]:"Bad request",[u.UNAUTHORIZED]:"Invalid API key provided",[u.FORBIDDEN]:"You exceeded your current quota",[u.NOT_FOUND]:"Model not found",[u.NOT_ACCEPTABLE]:"Model not supported",[u.RATE_LIMITED]:"Rate limit exceeded",[u.SERVER_ERROR]:"Internal server error",[u.BAD_GATEWAY]:"Bad gateway - upstream provider error",[u.SERVICE_UNAVAILABLE]:"Service temporarily unavailable",[u.GATEWAY_TIMEOUT]:"Gateway timeout"},x={base:1e3,max:12e4,maxLevel:15},y={unauthorized:12e4,paymentRequired:12e4,notFound:12e4,transient:3e4,requestNotAllowed:5e3,rateLimit:12e4,serviceUnavailable:2e3,authExpired:12e4},z=["Please write a 5-10 word title for the following conversation:"]},57647:(a,b,c)=>{c.d(b,{SZ:()=>o,Tz:()=>j,e2:()=>m,jJ:()=>n,vA:()=>l});var d=c(2255);let e="https://api.openai.com/v1",f="https://api.anthropic.com/v1";function g(a){return"string"==typeof a&&a.startsWith("openai-compatible-")}function h(a){return"string"==typeof a&&a.startsWith("anthropic-compatible-")}function i(a){return g(a)&&a.includes("responses")?"responses":"chat"}function j(a){if(a.input&&(Array.isArray(a.input)||"string"==typeof a.input)&&!a.messages)return"openai-responses";if(a.request?.contents&&"antigravity"===a.userAgent)return"antigravity";if(a.contents&&Array.isArray(a.contents))return"gemini";if(a.stream_options||a.response_format||void 0!==a.logprobs||void 0!==a.top_logprobs||void 0!==a.n||void 0!==a.presence_penalty||void 0!==a.frequency_penalty||a.logit_bias||a.user)return"openai";if(a.messages&&Array.isArray(a.messages)){let b=a.messages[0];if(b?.content&&Array.isArray(b.content)){let c=b.content[0];if(c?.type==="text"&&!a.model?.includes("/")){if(a.system||a.anthropic_version)return"claude";let c=b.content.some(a=>"image"===a.type&&a.source?.type==="base64"),d=b.content.some(a=>"image_url"===a.type&&a.image_url?.url);if(c)return"claude";if(d)return"openai";if(b.content.some(a=>"tool_use"===a.type||"tool_result"===a.type))return"claude"}}if(void 0!==a.system||a.anthropic_version)return"claude"}return"openai"}function k(a){if(g(a)){let b=i(a);return{...d.xq.openai,format:"responses"===b?"openai-responses":"openai",baseUrl:e}}return h(a)?{...d.xq.anthropic,format:"claude",baseUrl:f}:d.xq[a]||d.xq.openai}function l(a,b,c=!0,d={}){var j,m;if(g(a)){let b,c=i(a);return j=d?.baseUrl||e,b=j.replace(/\/$/,""),`${b}${"responses"===c?"/responses":"/chat/completions"}`}if(h(a)){let a;return a=(d?.baseUrl||f).replace(/\/$/,""),`${a}/messages`}let n=k(a);switch(a){case"claude":case"glm":case"kimi":case"minimax":return`${n.baseUrl}?beta=true`;case"gemini":return`${n.baseUrl}/${b}:${c?"streamGenerateContent?alt=sse":"generateContent"}`;case"gemini-cli":return`${n.baseUrl}:${c?"streamGenerateContent?alt=sse":"generateContent"}`;case"antigravity":{let a=d?.baseUrlIndex||0,b=n.baseUrls[a]||n.baseUrls[0];return`${b}${c?"/v1internal:streamGenerateContent?alt=sse":"/v1internal:generateContent"}`}case"codex":case"github":default:return n.baseUrl;case"qwen":{let a,b,c=(m=d?.qwenResourceUrl,a=(n.baseUrl||"").replace(/\/chat\/completions$/,""),(b="string"==typeof m?m.trim():"")?b.startsWith("http://")||b.startsWith("https://")?b.replace(/\/$/,""):`https://${b.replace(/\/$/,"")}/v1`:a);return`${c}/chat/completions`}}}function m(a,b,c=!0,d=null){let e={"Content-Type":"application/json",...k(a).headers};if(h(a))b.apiKey?e["x-api-key"]=b.apiKey:b.accessToken&&(e.Authorization=`Bearer ${b.accessToken}`),e["anthropic-version"]||(e["anthropic-version"]="2023-06-01");else switch(a){case"gemini":b.apiKey?e["x-goog-api-key"]=b.apiKey:b.accessToken&&(e.Authorization=`Bearer ${b.accessToken}`);break;case"antigravity":case"gemini-cli":e.Authorization=`Bearer ${b.accessToken}`;break;case"claude":b.apiKey?e["x-api-key"]=b.apiKey:b.accessToken&&(e.Authorization=`Bearer ${b.accessToken}`);break;case"github":let f=b.copilotToken||b.accessToken;e.Authorization=`Bearer ${f}`,e["Content-Type"]="application/json",e["copilot-integration-id"]="vscode-chat",e["editor-version"]="vscode/1.107.1",e["editor-plugin-version"]="copilot-chat/0.26.7",e["user-agent"]="GitHubCopilotChat/0.26.7",e["openai-intent"]="conversation-panel",e["x-github-api-version"]="2025-04-01",e["x-request-id"]=crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){let b=16*Math.random()|0;return("x"==a?b:3&b|8).toString(16)}),e["x-vscode-user-agent-library-version"]="electron-fetch",e["X-Initiator"]="user",e.Accept="application/json";break;case"codex":case"qwen":case"openai":case"openrouter":default:e.Authorization=`Bearer ${b.apiKey||b.accessToken}`;break;case"glm":case"kimi":case"minimax":e["x-api-key"]=b.apiKey}return c&&(e.Accept="text/event-stream"),e}function n(a){return g(a)?"responses"===i(a)?"openai-responses":"openai":h(a)?"claude":k(a).format||"openai"}function o(a){return!function(a){let b=a.messages||a.contents;if(!b?.length)return!0;let c=b[b.length-1];return c?.role==="user"}(a)&&(delete a.reasoning_effort,delete a.thinking),a}}};
@@ -1 +1 @@
1
- "use strict";exports.id=8590,exports.ids=[8590],exports.modules={8590:(a,b,c)=>{c.d(b,{I9:()=>g,Ql:()=>j,iD:()=>n,jR:()=>m,oD:()=>e,qZ:()=>o});var d=c(2255);let e=3e5;async function f(a,b){let c=await fetch(d.NA.anthropic.token,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.claude.clientId})});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Claude OAuth token",{status:c.status,error:a}),null}let e=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Claude OAuth token",{hasNewAccessToken:!!e.access_token,hasNewRefreshToken:!!e.refresh_token,expiresIn:e.expires_in}),{accessToken:e.access_token,refreshToken:e.refresh_token||a,expiresIn:e.expires_in}}async function g(a,b,c,e){let f=await fetch(d.NA.google.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:b,client_secret:c})});if(!f.ok){let a=await f.text();return e?.error?.("TOKEN_REFRESH","Failed to refresh Google token",{status:f.status,error:a}),null}let g=await f.json();return e?.info?.("TOKEN_REFRESH","Successfully refreshed Google token",{hasNewAccessToken:!!g.access_token,hasNewRefreshToken:!!g.refresh_token,expiresIn:g.expires_in}),{accessToken:g.access_token,refreshToken:g.refresh_token||a,expiresIn:g.expires_in}}async function h(a,b){let c=d.NA.qwen.token;try{let e=await fetch(c,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.qwen.clientId})});if(200===e.status){let c=await e.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Qwen token",{hasNewAccessToken:!!c.access_token,hasNewRefreshToken:!!c.refresh_token,expiresIn:c.expires_in}),{accessToken:c.access_token,refreshToken:c.refresh_token||a,expiresIn:c.expires_in}}{let a=await e.text().catch(()=>"");b?.warn?.("TOKEN_REFRESH","Error with Qwen endpoint",{status:e.status,error:a})}}catch(a){b?.warn?.("TOKEN_REFRESH","Network error trying Qwen endpoint",{error:a.message})}return b?.error?.("TOKEN_REFRESH","Failed to refresh Qwen token"),null}async function i(a,b){let c=await fetch(d.NA.openai.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.codex.clientId,scope:"openid profile email offline_access"})});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Codex token",{status:c.status,error:a}),null}let e=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Codex token",{hasNewAccessToken:!!e.access_token,hasNewRefreshToken:!!e.refresh_token,expiresIn:e.expires_in}),{accessToken:e.access_token,refreshToken:e.refresh_token||a,expiresIn:e.expires_in}}async function j(a,b,c){let e=b?.authMethod,f=b?.clientId,g=b?.clientSecret,h=b?.region;if(f&&g){let b="idc"===e&&h?`https://oidc.${h}.amazonaws.com/token`:"https://oidc.us-east-1.amazonaws.com/token",d=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:f,clientSecret:g,refreshToken:a,grantType:"refresh_token"})});if(!d.ok){let a=await d.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro AWS token",{status:d.status,error:a}),null}let i=await d.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro AWS token",{hasNewAccessToken:!!i.accessToken,expiresIn:i.expiresIn}),{accessToken:i.accessToken,refreshToken:i.refreshToken||a,expiresIn:i.expiresIn}}let i=await fetch(d.xq.kiro.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"kiro-cli/1.0.0"},body:JSON.stringify({refreshToken:a})});if(!i.ok){let a=await i.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro social token",{status:i.status,error:a}),null}let j=await i.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro social token",{hasNewAccessToken:!!j.accessToken,expiresIn:j.expiresIn}),{accessToken:j.accessToken,refreshToken:j.refreshToken||a,expiresIn:j.expiresIn}}async function k(a,b){let c=btoa(`${d.xq.iflow.clientId}:${d.xq.iflow.clientSecret}`),e=await fetch(d.NA.iflow.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${c}`},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.iflow.clientId,client_secret:d.xq.iflow.clientSecret})});if(!e.ok){let a=await e.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh iFlow token",{status:e.status,error:a}),null}let f=await e.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed iFlow token",{hasNewAccessToken:!!f.access_token,hasNewRefreshToken:!!f.refresh_token,expiresIn:f.expires_in}),{accessToken:f.access_token,refreshToken:f.refresh_token||a,expiresIn:f.expires_in}}async function l(a,b){let c=await fetch(d.NA.github.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.github.clientId,client_secret:d.xq.github.clientSecret})});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh GitHub token",{status:c.status,error:a}),null}let e=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed GitHub token",{hasNewAccessToken:!!e.access_token,hasNewRefreshToken:!!e.refresh_token,expiresIn:e.expires_in}),{accessToken:e.access_token,refreshToken:e.refresh_token||a,expiresIn:e.expires_in}}async function m(a,b){try{let c=await fetch("https://api.github.com/copilot_internal/v2/token",{headers:{Authorization:`token ${a}`,"User-Agent":d.x0.USER_AGENT,"Editor-Version":`vscode/${d.x0.VSCODE_VERSION}`,"Editor-Plugin-Version":`copilot-chat/${d.x0.COPILOT_CHAT_VERSION}`,Accept:"application/json","x-github-api-version":d.x0.API_VERSION}});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Copilot token",{status:c.status,error:a}),null}let e=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Copilot token",{hasToken:!!e.token,expiresAt:e.expires_at}),{token:e.token,expiresAt:e.expires_at}}catch(a){return b?.error?.("TOKEN_REFRESH","Error refreshing Copilot token",{error:a.message}),null}}async function n(a,b,c){if(!b||!b.refreshToken)return c?.warn?.("TOKEN_REFRESH",`No refresh token available for provider: ${a}`),null;switch(a){case"gemini":case"gemini-cli":case"antigravity":return await g(b.refreshToken,d.xq[a].clientId,d.xq[a].clientSecret,c);case"claude":return await f(b.refreshToken,c);case"codex":return await i(b.refreshToken,c);case"qwen":return await h(b.refreshToken,c);case"iflow":return await k(b.refreshToken,c);case"github":return await l(b.refreshToken,c);case"kiro":return await j(b.refreshToken,b.providerSpecificData,c);default:return c?.warn?.("TOKEN_REFRESH",`Unsupported provider for token refresh: ${a}`),null}}async function o(a,b=3,c=null){for(let d=0;d<b;d++){if(d>0){let a=1e3*d;c?.debug?.("TOKEN_REFRESH",`Retry ${d}/${b} after ${a}ms`),await new Promise(b=>setTimeout(b,a))}try{let b=await a();if(b)return b}catch(a){c?.warn?.("TOKEN_REFRESH",`Attempt ${d+1}/${b} failed: ${a.message}`)}}return c?.error?.("TOKEN_REFRESH",`All ${b} retry attempts failed`),null}}};
1
+ "use strict";exports.id=8590,exports.ids=[8590],exports.modules={8590:(a,b,c)=>{c.d(b,{I9:()=>g,Ql:()=>j,iD:()=>n,jR:()=>m,oD:()=>e,qZ:()=>o});var d=c(2255);let e=3e5;async function f(a,b){let c=await fetch(d.NA.anthropic.token,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.claude.clientId})});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Claude OAuth token",{status:c.status,error:a}),null}let e=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Claude OAuth token",{hasNewAccessToken:!!e.access_token,hasNewRefreshToken:!!e.refresh_token,expiresIn:e.expires_in}),{accessToken:e.access_token,refreshToken:e.refresh_token||a,expiresIn:e.expires_in}}async function g(a,b,c,e){let f=await fetch(d.NA.google.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:b,client_secret:c})});if(!f.ok){let a=await f.text();return e?.error?.("TOKEN_REFRESH","Failed to refresh Google token",{status:f.status,error:a}),null}let g=await f.json();return e?.info?.("TOKEN_REFRESH","Successfully refreshed Google token",{hasNewAccessToken:!!g.access_token,hasNewRefreshToken:!!g.refresh_token,expiresIn:g.expires_in}),{accessToken:g.access_token,refreshToken:g.refresh_token||a,expiresIn:g.expires_in}}async function h(a,b){let c=d.NA.qwen.token;try{let e=await fetch(c,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.qwen.clientId})});if(200===e.status){let c=await e.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Qwen token",{hasNewAccessToken:!!c.access_token,hasNewRefreshToken:!!c.refresh_token,expiresIn:c.expires_in}),{accessToken:c.access_token,refreshToken:c.refresh_token||a,expiresIn:c.expires_in,providerSpecificData:c.resource_url?{resourceUrl:c.resource_url}:void 0}}{let a=await e.text().catch(()=>"");b?.warn?.("TOKEN_REFRESH","Error with Qwen endpoint",{status:e.status,error:a})}}catch(a){b?.warn?.("TOKEN_REFRESH","Network error trying Qwen endpoint",{error:a.message})}return b?.error?.("TOKEN_REFRESH","Failed to refresh Qwen token"),null}async function i(a,b){let c=await fetch(d.NA.openai.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.codex.clientId,scope:"openid profile email offline_access"})});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Codex token",{status:c.status,error:a}),null}let e=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Codex token",{hasNewAccessToken:!!e.access_token,hasNewRefreshToken:!!e.refresh_token,expiresIn:e.expires_in}),{accessToken:e.access_token,refreshToken:e.refresh_token||a,expiresIn:e.expires_in}}async function j(a,b,c){let e=b?.authMethod,f=b?.clientId,g=b?.clientSecret,h=b?.region;if(f&&g){let b="idc"===e&&h?`https://oidc.${h}.amazonaws.com/token`:"https://oidc.us-east-1.amazonaws.com/token",d=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:f,clientSecret:g,refreshToken:a,grantType:"refresh_token"})});if(!d.ok){let a=await d.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro AWS token",{status:d.status,error:a}),null}let i=await d.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro AWS token",{hasNewAccessToken:!!i.accessToken,expiresIn:i.expiresIn}),{accessToken:i.accessToken,refreshToken:i.refreshToken||a,expiresIn:i.expiresIn}}let i=await fetch(d.xq.kiro.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"kiro-cli/1.0.0"},body:JSON.stringify({refreshToken:a})});if(!i.ok){let a=await i.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro social token",{status:i.status,error:a}),null}let j=await i.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro social token",{hasNewAccessToken:!!j.accessToken,expiresIn:j.expiresIn}),{accessToken:j.accessToken,refreshToken:j.refreshToken||a,expiresIn:j.expiresIn}}async function k(a,b){let c=btoa(`${d.xq.iflow.clientId}:${d.xq.iflow.clientSecret}`),e=await fetch(d.NA.iflow.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${c}`},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.iflow.clientId,client_secret:d.xq.iflow.clientSecret})});if(!e.ok){let a=await e.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh iFlow token",{status:e.status,error:a}),null}let f=await e.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed iFlow token",{hasNewAccessToken:!!f.access_token,hasNewRefreshToken:!!f.refresh_token,expiresIn:f.expires_in}),{accessToken:f.access_token,refreshToken:f.refresh_token||a,expiresIn:f.expires_in}}async function l(a,b){let c=await fetch(d.NA.github.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.github.clientId,client_secret:d.xq.github.clientSecret})});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh GitHub token",{status:c.status,error:a}),null}let e=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed GitHub token",{hasNewAccessToken:!!e.access_token,hasNewRefreshToken:!!e.refresh_token,expiresIn:e.expires_in}),{accessToken:e.access_token,refreshToken:e.refresh_token||a,expiresIn:e.expires_in}}async function m(a,b){try{let c=await fetch("https://api.github.com/copilot_internal/v2/token",{headers:{Authorization:`token ${a}`,"User-Agent":d.x0.USER_AGENT,"Editor-Version":`vscode/${d.x0.VSCODE_VERSION}`,"Editor-Plugin-Version":`copilot-chat/${d.x0.COPILOT_CHAT_VERSION}`,Accept:"application/json","x-github-api-version":d.x0.API_VERSION}});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Copilot token",{status:c.status,error:a}),null}let e=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Copilot token",{hasToken:!!e.token,expiresAt:e.expires_at}),{token:e.token,expiresAt:e.expires_at}}catch(a){return b?.error?.("TOKEN_REFRESH","Error refreshing Copilot token",{error:a.message}),null}}async function n(a,b,c){if(!b||!b.refreshToken)return c?.warn?.("TOKEN_REFRESH",`No refresh token available for provider: ${a}`),null;switch(a){case"gemini":case"gemini-cli":case"antigravity":return await g(b.refreshToken,d.xq[a].clientId,d.xq[a].clientSecret,c);case"claude":return await f(b.refreshToken,c);case"codex":return await i(b.refreshToken,c);case"qwen":return await h(b.refreshToken,c);case"iflow":return await k(b.refreshToken,c);case"github":return await l(b.refreshToken,c);case"kiro":return await j(b.refreshToken,b.providerSpecificData,c);default:return c?.warn?.("TOKEN_REFRESH",`Unsupported provider for token refresh: ${a}`),null}}async function o(a,b=3,c=null){for(let d=0;d<b;d++){if(d>0){let a=1e3*d;c?.debug?.("TOKEN_REFRESH",`Retry ${d}/${b} after ${a}ms`),await new Promise(b=>setTimeout(b,a))}try{let b=await a();if(b)return b}catch(a){c?.warn?.("TOKEN_REFRESH",`Attempt ${d+1}/${b} failed: ${a.message}`)}}return c?.error?.("TOKEN_REFRESH",`All ${b} retry attempts failed`),null}}};
@@ -1 +1 @@
1
- "use strict";exports.id=8756,exports.ids=[8756],exports.modules={7803:(a,b,c)=>{c.r(b),c.d(b,{debug:()=>f,error:()=>i,info:()=>g,maskKey:()=>m,request:()=>j,response:()=>k,stream:()=>l,warn:()=>h});function d(){return new Date().toLocaleTimeString("en-US",{hour12:!1})}function e(a){if(!a)return"";if("string"==typeof a)return a;try{return JSON.stringify(a)}catch{return String(a)}}function f(a,b,c){!0;{let f=c?` ${e(c)}`:"";console.log(`[${d()}] 🔍 [${a}] ${b}${f}`)}}function g(a,b,c){!0;{let f=c?` ${e(c)}`:"";console.log(`[${d()}] â„šī¸ [${a}] ${b}${f}`)}}function h(a,b,c){c&&e(c)}function i(a,b,c){!0;{let f=c?` ${e(c)}`:"";console.log(`[${d()}] ❌ [${a}] ${b}${f}`)}}function j(a,b,c){let f=c?` ${e(c)}`:"";console.log(`\x1b[36m[${d()}] đŸ“Ĩ ${a} ${b}${f}\x1b[0m`)}function k(a,b,c){let f=c?` ${e(c)}`:"";console.log(`[${d()}] ${a<400?"\uD83D\uDCE4":"\uD83D\uDCA5"} ${a} (${b}ms)${f}`)}function l(a,b){let c=b?` ${e(b)}`:"";console.log(`[${d()}] 🌊 [STREAM] ${a}${c}`)}function m(a){return!a||a.length<8?"***":`${a.slice(0,4)}...${a.slice(-4)}`}},38160:(a,b,c)=>{c.d(b,{Ou:()=>i,eG:()=>h});var d=c(2255);let e=new Map,f=new Map,g=null;async function h(a,b){if(!a||!b)return null;let c=e.get(a);if(c&&Date.now()-c.fetchedAt<36e5)return c.projectId;if(f.has(a))return f.get(a).promise;let d=new AbortController,g=(async()=>{try{let c=await j(b,d.signal);if(c)return e.set(a,{projectId:c,fetchedAt:Date.now()}),c;return console.warn("[ProjectId] could not fetch projectId for connection",a.slice(0,8)),null}catch(a){return console.warn(`[ProjectId] Error fetching project ID: ${a.message}`),null}finally{f.delete(a)}})();return f.set(a,{promise:g,controller:d,startedAt:Date.now()}),g}function i(a){e.delete(a)}async function j(a,b){let c=await fetch(d.nZ.loadCodeAssist,{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json","User-Agent":(0,d.A9)(),...d.K},body:JSON.stringify({metadata:d.Cn,mode:1}),signal:b});if(!c.ok){let a=await c.text().catch(()=>"");throw Error(`loadCodeAssist failed: HTTP ${c.status} ${a.slice(0,200)}`)}let e=await c.json(),f=function(a){if(!a)return null;if("string"==typeof a.cloudaicompanionProject){let b=a.cloudaicompanionProject.trim();if(b)return b}if(a.cloudaicompanionProject&&"object"==typeof a.cloudaicompanionProject){let b=a.cloudaicompanionProject.id;if("string"==typeof b&&b.trim())return b.trim()}return null}(e);if(f)return f;let g="legacy-tier";if(Array.isArray(e.allowedTiers)){for(let a of e.allowedTiers)if(a&&"object"==typeof a&&!0===a.isDefault&&a.id&&"string"==typeof a.id&&a.id.trim()){g=a.id.trim();break}}return k(a,g,b)}async function k(a,b,c){console.log(`[ProjectId] Onboarding user with tier: ${b}`);let e={tierId:b,metadata:d.Cn,mode:1};for(let b=1;b<=5&&!c?.aborted;b++){let f=new AbortController,g=setTimeout(()=>f.abort(),3e4),h=()=>f.abort();c?.addEventListener("abort",h);try{let c=await fetch(d.nZ.onboardUser,{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json","User-Agent":(0,d.A9)(),...d.K},body:JSON.stringify(e),signal:f.signal});if(clearTimeout(g),!c.ok){let a=await c.text().catch(()=>"");throw Error(`onboardUser HTTP ${c.status}: ${a.slice(0,200)}`)}let h=await c.json();if(!0===h.done){let a=function(a){if(!a?.response)return null;let b=a.response.cloudaicompanionProject;if("string"==typeof b){let a=b.trim();if(a)return a}if(b&&"object"==typeof b){let a=b.id;if("string"==typeof a&&a.trim())return a.trim()}return null}(h);if(a)return console.log(`[ProjectId] Successfully onboarded, project ID: ${a}`),a;throw Error("onboardUser done but no project_id in response")}console.log(`[ProjectId] Onboard attempt ${b}/5: not done yet, waiting...`),await new Promise(a=>setTimeout(a,2e3))}catch(a){if(clearTimeout(g),"AbortError"===a.name){if(console.warn(`[ProjectId] onboardUser attempt ${b} aborted (timeout or connection removed)`),c?.aborted)return null;continue}if(5===b)return console.warn(`[ProjectId] onboardUser failed after 5 attempts: ${a.message}`),null;throw a}finally{clearTimeout(g),c?.removeEventListener("abort",h)}}return null}g=setInterval(()=>{try{let a=Date.now();for(let[b,c]of e)(!c||a-c.fetchedAt>=36e5)&&e.delete(b);for(let[b,c]of f){if(!c||"number"!=typeof c.startedAt){f.delete(b);continue}if(a-c.startedAt>12e4){try{c.controller.abort()}catch(a){}f.delete(b)}}}catch(a){console.warn("[ProjectId] cleanup sweep error:",a?.message??a)}},6e5),g?.unref?.()},67828:(a,b,c)=>{c.d(b,{I9:()=>i,eU:()=>l,vN:()=>k});var d=c(7803),e=c(89718),f=c(38160),g=c(8590);let h=g.oD,i=(a,b,c)=>(0,g.I9)(a,b,c,d);function j(a){return new Date(Date.now()+1e3*a).toISOString()}async function k(a,b){try{let c={};b.accessToken&&(c.accessToken=b.accessToken),b.refreshToken&&(c.refreshToken=b.refreshToken),b.expiresIn&&(c.expiresAt=j(b.expiresIn),c.expiresIn=b.expiresIn),b.providerSpecificData&&(c.providerSpecificData=b.providerSpecificData),b.projectId&&(c.projectId=b.projectId);let f=await (0,e.rj)(a,c);return d.info("TOKEN_REFRESH","Credentials updated in localDb",{connectionId:a,success:!!f}),!!f}catch(b){return d.error("TOKEN_REFRESH","Error updating credentials in localDb",{connectionId:a,error:b.message}),!1}}async function l(a,b){let c={...b};if(c.expiresAt){let b=new Date(c.expiresAt).getTime()-Date.now();if(b<h){let e;d.info("TOKEN_REFRESH","Token expiring soon, refreshing proactively",{provider:a,expiresIn:Math.round(b/1e3)});let h=await (e=c,(0,g.iD)(a,e,d));h?.accessToken&&(await k(c.connectionId,h),function(a,b,c){("antigravity"===a||"gemini-cli"===a)&&b&&c&&((0,f.Ou)(b),(0,f.eG)(b,c).then(a=>{a&&k(b,{projectId:a}).catch(a=>{d.debug("TOKEN_REFRESH","Failed to persist refreshed projectId",{connectionId:b,error:a?.message??a})})}).catch(a=>{d.debug("TOKEN_REFRESH","Failed to fetch projectId after token refresh",{connectionId:b,error:a?.message??a})}))}(a,(c={...c,accessToken:h.accessToken,refreshToken:h.refreshToken??c.refreshToken,expiresAt:h.expiresIn?j(h.expiresIn):c.expiresAt}).connectionId,c.accessToken))}}if("github"===a&&c.providerSpecificData?.copilotTokenExpiresAt){let b=1e3*c.providerSpecificData.copilotTokenExpiresAt-Date.now();if(b<h){let e;d.info("TOKEN_REFRESH","Copilot token expiring soon, refreshing proactively",{provider:a,expiresIn:Math.round(b/1e3)});let f=await (e=c.accessToken,(0,g.jR)(e,d));if(f){let a={...c.providerSpecificData,copilotToken:f.token,copilotTokenExpiresAt:f.expiresAt};await k(c.connectionId,{providerSpecificData:a}),c.providerSpecificData=a}}}return c}},75681:(a,b,c)=>{c.d(b,{DI:()=>h,IS:()=>d,JH:()=>g,Q2:()=>k,fg:()=>f,gb:()=>j,mq:()=>i,rs:()=>m,wG:()=>n,zN:()=>e,zt:()=>l});let d={iflow:{id:"iflow",alias:"if",name:"iFlow AI",icon:"water_drop",color:"#6366F1"},qwen:{id:"qwen",alias:"qw",name:"Qwen Code",icon:"psychology",color:"#10B981"},"gemini-cli":{id:"gemini-cli",alias:"gc",name:"Gemini CLI",icon:"terminal",color:"#4285F4"},kiro:{id:"kiro",alias:"kr",name:"Kiro AI",icon:"psychology_alt",color:"#FF6B35"}},e={claude:{id:"claude",alias:"cc",name:"Claude Code",icon:"smart_toy",color:"#D97757"},antigravity:{id:"antigravity",alias:"ag",name:"Antigravity",icon:"rocket_launch",color:"#F59E0B"},codex:{id:"codex",alias:"cx",name:"OpenAI Codex",icon:"code",color:"#3B82F6"},github:{id:"github",alias:"gh",name:"GitHub Copilot",icon:"code",color:"#333333"},cursor:{id:"cursor",alias:"cu",name:"Cursor IDE",icon:"edit_note",color:"#00D4AA"},kilocode:{id:"kilocode",alias:"kc",name:"Kilo Code",icon:"code",color:"#FF6B35",textIcon:"KC"},cline:{id:"cline",alias:"cl",name:"Cline",icon:"smart_toy",color:"#5B9BD5",textIcon:"CL"}},f={openrouter:{id:"openrouter",alias:"openrouter",name:"OpenRouter",icon:"router",color:"#F97316",textIcon:"OR",passthroughModels:!0,website:"https://openrouter.ai"},glm:{id:"glm",alias:"glm",name:"GLM Coding",icon:"code",color:"#2563EB",textIcon:"GL",website:"https://open.bigmodel.cn"},"glm-cn":{id:"glm-cn",alias:"glm-cn",name:"GLM (China)",icon:"code",color:"#DC2626",textIcon:"GC",website:"https://open.bigmodel.cn"},kimi:{id:"kimi",alias:"kimi",name:"Kimi",icon:"psychology",color:"#1E3A8A",textIcon:"KM",website:"https://kimi.moonshot.cn"},minimax:{id:"minimax",alias:"minimax",name:"Minimax Coding",icon:"memory",color:"#7C3AED",textIcon:"MM",website:"https://www.minimaxi.com"},"minimax-cn":{id:"minimax-cn",alias:"minimax-cn",name:"Minimax (China)",icon:"memory",color:"#DC2626",textIcon:"MC",website:"https://www.minimaxi.com"},alicode:{id:"alicode",alias:"alicode",name:"Alibaba",icon:"cloud",color:"#FF6A00",textIcon:"ALi"},openai:{id:"openai",alias:"openai",name:"OpenAI",icon:"auto_awesome",color:"#10A37F",textIcon:"OA",website:"https://platform.openai.com"},anthropic:{id:"anthropic",alias:"anthropic",name:"Anthropic",icon:"smart_toy",color:"#D97757",textIcon:"AN",website:"https://console.anthropic.com"},gemini:{id:"gemini",alias:"gemini",name:"Gemini",icon:"diamond",color:"#4285F4",textIcon:"GE",website:"https://ai.google.dev"},deepseek:{id:"deepseek",alias:"ds",name:"DeepSeek",icon:"bolt",color:"#4D6BFE",textIcon:"DS",website:"https://deepseek.com"},groq:{id:"groq",alias:"groq",name:"Groq",icon:"speed",color:"#F55036",textIcon:"GQ",website:"https://groq.com"},xai:{id:"xai",alias:"xai",name:"xAI (Grok)",icon:"auto_awesome",color:"#1DA1F2",textIcon:"XA",website:"https://x.ai"},mistral:{id:"mistral",alias:"mistral",name:"Mistral",icon:"air",color:"#FF7000",textIcon:"MI",website:"https://mistral.ai"},perplexity:{id:"perplexity",alias:"pplx",name:"Perplexity",icon:"search",color:"#20808D",textIcon:"PP",website:"https://www.perplexity.ai"},together:{id:"together",alias:"together",name:"Together AI",icon:"group_work",color:"#0F6FFF",textIcon:"TG",website:"https://www.together.ai"},fireworks:{id:"fireworks",alias:"fireworks",name:"Fireworks AI",icon:"local_fire_department",color:"#7B2EF2",textIcon:"FW",website:"https://fireworks.ai"},cerebras:{id:"cerebras",alias:"cerebras",name:"Cerebras",icon:"memory",color:"#FF4F00",textIcon:"CB",website:"https://www.cerebras.ai"},cohere:{id:"cohere",alias:"cohere",name:"Cohere",icon:"hub",color:"#39594D",textIcon:"CO",website:"https://cohere.com"},nvidia:{id:"nvidia",alias:"nvidia",name:"NVIDIA NIM",icon:"developer_board",color:"#76B900",textIcon:"NV",website:"https://developer.nvidia.com/nim"},nebius:{id:"nebius",alias:"nebius",name:"Nebius AI",icon:"cloud",color:"#6C5CE7",textIcon:"NB",website:"https://nebius.com"},siliconflow:{id:"siliconflow",alias:"siliconflow",name:"SiliconFlow",icon:"cloud_queue",color:"#5B6EF5",textIcon:"SF",website:"https://cloud.siliconflow.com"},hyperbolic:{id:"hyperbolic",alias:"hyp",name:"Hyperbolic",icon:"bolt",color:"#00D4FF",textIcon:"HY",website:"https://hyperbolic.xyz"},deepgram:{id:"deepgram",alias:"dg",name:"Deepgram",icon:"mic",color:"#13EF93",textIcon:"DG",website:"https://deepgram.com"},assemblyai:{id:"assemblyai",alias:"aai",name:"AssemblyAI",icon:"record_voice_over",color:"#0062FF",textIcon:"AA",website:"https://assemblyai.com"},nanobanana:{id:"nanobanana",alias:"nb",name:"NanoBanana",icon:"image",color:"#FFD700",textIcon:"NB",website:"https://nanobananaapi.ai"},chutes:{id:"chutes",alias:"ch",name:"Chutes AI",icon:"water_drop",color:"#5B6EF5",textIcon:"CH",website:"https://chutes.ai"}},g="openai-compatible-",h="anthropic-compatible-";function i(a){return"string"==typeof a&&a.startsWith(g)}function j(a){return"string"==typeof a&&a.startsWith(h)}let k={...d,...e,...f};function l(a){for(let b of Object.values(k))if(b.alias===a||b.id===a)return b;return null}function m(a){let b=l(a);return b?.id||a}function n(a){let b=k[a];return b?.alias||a}Object.values(k).reduce((a,b)=>(a[b.alias]=b.id,a),{}),Object.values(k).reduce((a,b)=>(a[b.id]=b.alias,a),{})}};
1
+ "use strict";exports.id=8756,exports.ids=[8756],exports.modules={7803:(a,b,c)=>{c.r(b),c.d(b,{debug:()=>f,error:()=>i,info:()=>g,maskKey:()=>m,request:()=>j,response:()=>k,stream:()=>l,warn:()=>h});function d(){return new Date().toLocaleTimeString("en-US",{hour12:!1})}function e(a){if(!a)return"";if("string"==typeof a)return a;try{return JSON.stringify(a)}catch{return String(a)}}function f(a,b,c){!0;{let f=c?` ${e(c)}`:"";console.log(`[${d()}] 🔍 [${a}] ${b}${f}`)}}function g(a,b,c){!0;{let f=c?` ${e(c)}`:"";console.log(`[${d()}] â„šī¸ [${a}] ${b}${f}`)}}function h(a,b,c){c&&e(c)}function i(a,b,c){!0;{let f=c?` ${e(c)}`:"";console.log(`[${d()}] ❌ [${a}] ${b}${f}`)}}function j(a,b,c){let f=c?` ${e(c)}`:"";console.log(`\x1b[36m[${d()}] đŸ“Ĩ ${a} ${b}${f}\x1b[0m`)}function k(a,b,c){let f=c?` ${e(c)}`:"";console.log(`[${d()}] ${a<400?"\uD83D\uDCE4":"\uD83D\uDCA5"} ${a} (${b}ms)${f}`)}function l(a,b){let c=b?` ${e(b)}`:"";console.log(`[${d()}] 🌊 [STREAM] ${a}${c}`)}function m(a){return!a||a.length<8?"***":`${a.slice(0,4)}...${a.slice(-4)}`}},38160:(a,b,c)=>{c.d(b,{Ou:()=>i,eG:()=>h});var d=c(2255);let e=new Map,f=new Map,g=null;async function h(a,b){if(!a||!b)return null;let c=e.get(a);if(c&&Date.now()-c.fetchedAt<36e5)return c.projectId;if(f.has(a))return f.get(a).promise;let d=new AbortController,g=(async()=>{try{let c=await j(b,d.signal);if(c)return e.set(a,{projectId:c,fetchedAt:Date.now()}),c;return console.warn("[ProjectId] could not fetch projectId for connection",a.slice(0,8)),null}catch(a){return console.warn(`[ProjectId] Error fetching project ID: ${a.message}`),null}finally{f.delete(a)}})();return f.set(a,{promise:g,controller:d,startedAt:Date.now()}),g}function i(a){e.delete(a)}async function j(a,b){let c=await fetch(d.nZ.loadCodeAssist,{method:"POST",headers:{...d.Ic,Authorization:`Bearer ${a}`},body:JSON.stringify({metadata:d.zv}),signal:b});if(!c.ok){let a=await c.text().catch(()=>"");throw Error(`loadCodeAssist failed: HTTP ${c.status} ${a.slice(0,200)}`)}let e=await c.json(),f=function(a){if(!a)return null;if("string"==typeof a.cloudaicompanionProject){let b=a.cloudaicompanionProject.trim();if(b)return b}if(a.cloudaicompanionProject&&"object"==typeof a.cloudaicompanionProject){let b=a.cloudaicompanionProject.id;if("string"==typeof b&&b.trim())return b.trim()}return null}(e);if(f)return f;let g="legacy-tier";if(Array.isArray(e.allowedTiers)){for(let a of e.allowedTiers)if(a&&"object"==typeof a&&!0===a.isDefault&&a.id&&"string"==typeof a.id&&a.id.trim()){g=a.id.trim();break}}return k(a,g,b)}async function k(a,b,c){console.log(`[ProjectId] Onboarding user with tier: ${b}`);let e={tierId:b,metadata:d.zv};for(let b=1;b<=5&&!c?.aborted;b++){let f=new AbortController,g=setTimeout(()=>f.abort(),3e4),h=()=>f.abort();c?.addEventListener("abort",h);try{let c=await fetch(d.nZ.onboardUser,{method:"POST",headers:{...d.Ic,Authorization:`Bearer ${a}`},body:JSON.stringify(e),signal:f.signal});if(clearTimeout(g),!c.ok){let a=await c.text().catch(()=>"");throw Error(`onboardUser HTTP ${c.status}: ${a.slice(0,200)}`)}let h=await c.json();if(!0===h.done){let a=function(a){if(!a?.response)return null;let b=a.response.cloudaicompanionProject;if("string"==typeof b){let a=b.trim();if(a)return a}if(b&&"object"==typeof b){let a=b.id;if("string"==typeof a&&a.trim())return a.trim()}return null}(h);if(a)return console.log(`[ProjectId] Successfully onboarded, project ID: ${a}`),a;throw Error("onboardUser done but no project_id in response")}console.log(`[ProjectId] Onboard attempt ${b}/5: not done yet, waiting...`),await new Promise(a=>setTimeout(a,2e3))}catch(a){if(clearTimeout(g),"AbortError"===a.name){if(console.warn(`[ProjectId] onboardUser attempt ${b} aborted (timeout or connection removed)`),c?.aborted)return null;continue}if(5===b)return console.warn(`[ProjectId] onboardUser failed after 5 attempts: ${a.message}`),null;throw a}finally{clearTimeout(g),c?.removeEventListener("abort",h)}}return null}g=setInterval(()=>{try{let a=Date.now();for(let[b,c]of e)(!c||a-c.fetchedAt>=36e5)&&e.delete(b);for(let[b,c]of f){if(!c||"number"!=typeof c.startedAt){f.delete(b);continue}if(a-c.startedAt>12e4){try{c.controller.abort()}catch(a){}f.delete(b)}}}catch(a){console.warn("[ProjectId] cleanup sweep error:",a?.message??a)}},6e5),g?.unref?.()},67828:(a,b,c)=>{c.d(b,{I9:()=>i,eU:()=>l,vN:()=>k});var d=c(7803),e=c(89718),f=c(38160),g=c(8590);let h=g.oD,i=(a,b,c)=>(0,g.I9)(a,b,c,d);function j(a){return new Date(Date.now()+1e3*a).toISOString()}async function k(a,b){try{let c={};b.accessToken&&(c.accessToken=b.accessToken),b.refreshToken&&(c.refreshToken=b.refreshToken),b.expiresIn&&(c.expiresAt=j(b.expiresIn),c.expiresIn=b.expiresIn),b.providerSpecificData&&(c.providerSpecificData={...b.existingProviderSpecificData||{},...b.providerSpecificData}),b.projectId&&(c.projectId=b.projectId);let f=await (0,e.rj)(a,c);return d.info("TOKEN_REFRESH","Credentials updated in localDb",{connectionId:a,success:!!f}),!!f}catch(b){return d.error("TOKEN_REFRESH","Error updating credentials in localDb",{connectionId:a,error:b.message}),!1}}async function l(a,b){let c={...b};if(c.expiresAt){let b=new Date(c.expiresAt).getTime()-Date.now();if(b<h){let e;d.info("TOKEN_REFRESH","Token expiring soon, refreshing proactively",{provider:a,expiresIn:Math.round(b/1e3)});let h=await (e=c,(0,g.iD)(a,e,d));if(h?.accessToken){let b={...h,existingProviderSpecificData:c.providerSpecificData};await k(c.connectionId,b),function(a,b,c){("antigravity"===a||"gemini-cli"===a)&&b&&c&&((0,f.Ou)(b),(0,f.eG)(b,c).then(a=>{a&&k(b,{projectId:a}).catch(a=>{d.debug("TOKEN_REFRESH","Failed to persist refreshed projectId",{connectionId:b,error:a?.message??a})})}).catch(a=>{d.debug("TOKEN_REFRESH","Failed to fetch projectId after token refresh",{connectionId:b,error:a?.message??a})}))}(a,(c={...c,accessToken:h.accessToken,refreshToken:h.refreshToken??c.refreshToken,providerSpecificData:h.providerSpecificData?{...c.providerSpecificData,...h.providerSpecificData}:c.providerSpecificData,expiresAt:h.expiresIn?j(h.expiresIn):c.expiresAt}).connectionId,c.accessToken)}}}if("github"===a&&c.providerSpecificData?.copilotTokenExpiresAt){let b=1e3*c.providerSpecificData.copilotTokenExpiresAt-Date.now();if(b<h){let e;d.info("TOKEN_REFRESH","Copilot token expiring soon, refreshing proactively",{provider:a,expiresIn:Math.round(b/1e3)});let f=await (e=c.accessToken,(0,g.jR)(e,d));if(f){let a={...c.providerSpecificData,copilotToken:f.token,copilotTokenExpiresAt:f.expiresAt};await k(c.connectionId,{providerSpecificData:a}),c.providerSpecificData=a}}}return c}},75681:(a,b,c)=>{c.d(b,{DI:()=>h,IS:()=>d,JH:()=>g,Q2:()=>k,fg:()=>f,gb:()=>j,mq:()=>i,rs:()=>m,wG:()=>n,zN:()=>e,zt:()=>l});let d={iflow:{id:"iflow",alias:"if",name:"iFlow AI",icon:"water_drop",color:"#6366F1"},qwen:{id:"qwen",alias:"qw",name:"Qwen Code",icon:"psychology",color:"#10B981"},"gemini-cli":{id:"gemini-cli",alias:"gc",name:"Gemini CLI",icon:"terminal",color:"#4285F4"},kiro:{id:"kiro",alias:"kr",name:"Kiro AI",icon:"psychology_alt",color:"#FF6B35"}},e={claude:{id:"claude",alias:"cc",name:"Claude Code",icon:"smart_toy",color:"#D97757"},antigravity:{id:"antigravity",alias:"ag",name:"Antigravity",icon:"rocket_launch",color:"#F59E0B"},codex:{id:"codex",alias:"cx",name:"OpenAI Codex",icon:"code",color:"#3B82F6"},github:{id:"github",alias:"gh",name:"GitHub Copilot",icon:"code",color:"#333333"},cursor:{id:"cursor",alias:"cu",name:"Cursor IDE",icon:"edit_note",color:"#00D4AA"},kilocode:{id:"kilocode",alias:"kc",name:"Kilo Code",icon:"code",color:"#FF6B35",textIcon:"KC"},cline:{id:"cline",alias:"cl",name:"Cline",icon:"smart_toy",color:"#5B9BD5",textIcon:"CL"}},f={openrouter:{id:"openrouter",alias:"openrouter",name:"OpenRouter",icon:"router",color:"#F97316",textIcon:"OR",passthroughModels:!0,website:"https://openrouter.ai"},glm:{id:"glm",alias:"glm",name:"GLM Coding",icon:"code",color:"#2563EB",textIcon:"GL",website:"https://open.bigmodel.cn"},"glm-cn":{id:"glm-cn",alias:"glm-cn",name:"GLM (China)",icon:"code",color:"#DC2626",textIcon:"GC",website:"https://open.bigmodel.cn"},kimi:{id:"kimi",alias:"kimi",name:"Kimi",icon:"psychology",color:"#1E3A8A",textIcon:"KM",website:"https://kimi.moonshot.cn"},minimax:{id:"minimax",alias:"minimax",name:"Minimax Coding",icon:"memory",color:"#7C3AED",textIcon:"MM",website:"https://www.minimaxi.com"},"minimax-cn":{id:"minimax-cn",alias:"minimax-cn",name:"Minimax (China)",icon:"memory",color:"#DC2626",textIcon:"MC",website:"https://www.minimaxi.com"},alicode:{id:"alicode",alias:"alicode",name:"Alibaba",icon:"cloud",color:"#FF6A00",textIcon:"ALi"},openai:{id:"openai",alias:"openai",name:"OpenAI",icon:"auto_awesome",color:"#10A37F",textIcon:"OA",website:"https://platform.openai.com"},anthropic:{id:"anthropic",alias:"anthropic",name:"Anthropic",icon:"smart_toy",color:"#D97757",textIcon:"AN",website:"https://console.anthropic.com"},gemini:{id:"gemini",alias:"gemini",name:"Gemini",icon:"diamond",color:"#4285F4",textIcon:"GE",website:"https://ai.google.dev"},deepseek:{id:"deepseek",alias:"ds",name:"DeepSeek",icon:"bolt",color:"#4D6BFE",textIcon:"DS",website:"https://deepseek.com"},groq:{id:"groq",alias:"groq",name:"Groq",icon:"speed",color:"#F55036",textIcon:"GQ",website:"https://groq.com"},xai:{id:"xai",alias:"xai",name:"xAI (Grok)",icon:"auto_awesome",color:"#1DA1F2",textIcon:"XA",website:"https://x.ai"},mistral:{id:"mistral",alias:"mistral",name:"Mistral",icon:"air",color:"#FF7000",textIcon:"MI",website:"https://mistral.ai"},perplexity:{id:"perplexity",alias:"pplx",name:"Perplexity",icon:"search",color:"#20808D",textIcon:"PP",website:"https://www.perplexity.ai"},together:{id:"together",alias:"together",name:"Together AI",icon:"group_work",color:"#0F6FFF",textIcon:"TG",website:"https://www.together.ai"},fireworks:{id:"fireworks",alias:"fireworks",name:"Fireworks AI",icon:"local_fire_department",color:"#7B2EF2",textIcon:"FW",website:"https://fireworks.ai"},cerebras:{id:"cerebras",alias:"cerebras",name:"Cerebras",icon:"memory",color:"#FF4F00",textIcon:"CB",website:"https://www.cerebras.ai"},cohere:{id:"cohere",alias:"cohere",name:"Cohere",icon:"hub",color:"#39594D",textIcon:"CO",website:"https://cohere.com"},nvidia:{id:"nvidia",alias:"nvidia",name:"NVIDIA NIM",icon:"developer_board",color:"#76B900",textIcon:"NV",website:"https://developer.nvidia.com/nim"},nebius:{id:"nebius",alias:"nebius",name:"Nebius AI",icon:"cloud",color:"#6C5CE7",textIcon:"NB",website:"https://nebius.com"},siliconflow:{id:"siliconflow",alias:"siliconflow",name:"SiliconFlow",icon:"cloud_queue",color:"#5B6EF5",textIcon:"SF",website:"https://cloud.siliconflow.com"},hyperbolic:{id:"hyperbolic",alias:"hyp",name:"Hyperbolic",icon:"bolt",color:"#00D4FF",textIcon:"HY",website:"https://hyperbolic.xyz"},deepgram:{id:"deepgram",alias:"dg",name:"Deepgram",icon:"mic",color:"#13EF93",textIcon:"DG",website:"https://deepgram.com"},assemblyai:{id:"assemblyai",alias:"aai",name:"AssemblyAI",icon:"record_voice_over",color:"#0062FF",textIcon:"AA",website:"https://assemblyai.com"},nanobanana:{id:"nanobanana",alias:"nb",name:"NanoBanana",icon:"image",color:"#FFD700",textIcon:"NB",website:"https://nanobananaapi.ai"},chutes:{id:"chutes",alias:"ch",name:"Chutes AI",icon:"water_drop",color:"#5B6EF5",textIcon:"CH",website:"https://chutes.ai"}},g="openai-compatible-",h="anthropic-compatible-";function i(a){return"string"==typeof a&&a.startsWith(g)}function j(a){return"string"==typeof a&&a.startsWith(h)}let k={...d,...e,...f};function l(a){for(let b of Object.values(k))if(b.alias===a||b.id===a)return b;return null}function m(a){let b=l(a);return b?.id||a}function n(a){let b=k[a];return b?.alias||a}Object.values(k).reduce((a,b)=>(a[b.alias]=b.id,a),{}),Object.values(k).reduce((a,b)=>(a[b.id]=b.alias,a),{})}};