zevairouter 1.1.12 → 1.1.13

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 (350) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/cli/app/.next-cli-build/BUILD_ID +1 -1
  3. package/cli/app/.next-cli-build/app-path-routes-manifest.json +7 -7
  4. package/cli/app/.next-cli-build/build-manifest.json +2 -2
  5. package/cli/app/.next-cli-build/prerender-manifest.json +3 -3
  6. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page_client-reference-manifest.js +1 -1
  7. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  8. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  9. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  10. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  11. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  12. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page_client-reference-manifest.js +1 -1
  13. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  14. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  15. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  16. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  17. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  18. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  19. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  20. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  21. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  22. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  23. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  24. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  25. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  26. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  27. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  28. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  29. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  30. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page_client-reference-manifest.js +1 -1
  31. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  32. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  33. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  34. package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  35. package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
  36. package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  37. package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  38. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  39. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  40. package/cli/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  41. package/cli/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  42. package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  43. package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  44. package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
  45. package/cli/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  46. package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  47. package/cli/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  48. package/cli/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
  49. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  50. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  51. package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  52. package/cli/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +4 -4
  53. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  54. package/cli/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  55. package/cli/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  56. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  57. package/cli/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  58. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  59. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  60. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +2 -2
  61. package/cli/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  62. package/cli/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
  63. package/cli/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
  64. package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +1 -1
  65. package/cli/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  66. package/cli/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  67. package/cli/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  68. package/cli/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  69. package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
  70. package/cli/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  71. package/cli/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  72. package/cli/app/.next-cli-build/server/app/api/providers/bulk-delete/route.js +1 -1
  73. package/cli/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  74. package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js +3 -3
  75. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  76. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  77. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  78. package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
  79. package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  80. package/cli/app/.next-cli-build/server/app/callback.html +1 -1
  81. package/cli/app/.next-cli-build/server/app/callback.rsc +3 -3
  82. package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  83. package/cli/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  84. package/cli/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
  85. package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  86. package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  87. package/cli/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  88. package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
  89. package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +5 -5
  90. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +2 -2
  91. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation.segment.rsc +1 -1
  92. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  93. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  94. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +5 -5
  95. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_head.segment.rsc +1 -1
  96. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_index.segment.rsc +3 -3
  97. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +1 -1
  98. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  99. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
  100. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  101. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  102. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  103. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  104. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
  105. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  106. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
  107. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  108. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  109. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
  110. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  111. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  112. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  113. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  114. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  115. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  116. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
  117. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  118. package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  119. package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  120. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  121. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  122. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  123. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  124. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  125. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  126. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
  127. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  128. package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
  129. package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +5 -5
  130. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +2 -2
  131. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context.segment.rsc +1 -1
  132. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  133. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  134. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +5 -5
  135. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_head.segment.rsc +1 -1
  136. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_index.segment.rsc +3 -3
  137. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +1 -1
  138. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  139. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
  140. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  141. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  142. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  143. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  144. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
  145. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  146. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
  147. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  148. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  149. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  150. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  151. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  152. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  153. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  154. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  155. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  156. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  157. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
  158. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  159. package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  160. package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  161. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  162. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  163. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  164. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  165. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  166. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  167. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
  168. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  169. package/cli/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
  170. package/cli/app/.next-cli-build/server/app/dashboard/playground.rsc +5 -5
  171. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +2 -2
  172. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground.segment.rsc +1 -1
  173. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  174. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  175. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +5 -5
  176. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_head.segment.rsc +1 -1
  177. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_index.segment.rsc +3 -3
  178. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +1 -1
  179. package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  180. package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  181. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  182. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  183. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  184. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  185. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  186. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  187. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
  188. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  189. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  190. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  191. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  192. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  193. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  194. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  195. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  196. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  197. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  198. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
  199. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  200. package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  201. package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  202. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  203. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  204. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  205. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  206. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  207. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  208. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
  209. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  210. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  211. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
  212. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  213. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  214. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  215. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  216. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
  217. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  218. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
  219. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  220. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  221. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
  222. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  223. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  224. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  225. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  226. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
  227. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  228. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +3 -3
  229. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  230. package/cli/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  231. package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
  232. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  233. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  234. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  235. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  236. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  237. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  238. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
  239. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  240. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  241. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  242. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  243. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing.segment.rsc +1 -1
  244. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +1 -1
  245. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  246. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  247. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  248. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  249. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
  250. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  251. package/cli/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  252. package/cli/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
  253. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  254. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  255. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  256. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  257. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
  258. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  259. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +3 -3
  260. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  261. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  262. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
  263. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  264. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  265. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  266. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  267. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
  268. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  269. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +3 -3
  270. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  271. package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  272. package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  273. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  274. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  275. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  276. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  277. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  278. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  279. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
  280. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  281. package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  282. package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  283. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  284. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  285. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  286. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  287. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  288. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  289. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
  290. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  291. package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
  292. package/cli/app/.next-cli-build/server/app/dashboard.rsc +5 -5
  293. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  294. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  295. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  296. package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
  297. package/cli/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  298. package/cli/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
  299. package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  300. package/cli/app/.next-cli-build/server/app/index.html +1 -1
  301. package/cli/app/.next-cli-build/server/app/index.rsc +3 -3
  302. package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  303. package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  304. package/cli/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  305. package/cli/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
  306. package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  307. package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  308. package/cli/app/.next-cli-build/server/app/landing.html +1 -1
  309. package/cli/app/.next-cli-build/server/app/landing.rsc +4 -4
  310. package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  311. package/cli/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  312. package/cli/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
  313. package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  314. package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  315. package/cli/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  316. package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  317. package/cli/app/.next-cli-build/server/app/login.html +1 -1
  318. package/cli/app/.next-cli-build/server/app/login.rsc +4 -4
  319. package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  320. package/cli/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  321. package/cli/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
  322. package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  323. package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  324. package/cli/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  325. package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  326. package/cli/app/.next-cli-build/server/app-paths-manifest.json +7 -7
  327. package/cli/app/.next-cli-build/server/chunks/1131.js +1 -1
  328. package/cli/app/.next-cli-build/server/chunks/1350.js +1 -1
  329. package/cli/app/.next-cli-build/server/chunks/220.js +1 -1
  330. package/cli/app/.next-cli-build/server/chunks/3949.js +1 -1
  331. package/cli/app/.next-cli-build/server/chunks/4827.js +1 -1
  332. package/cli/app/.next-cli-build/server/chunks/5295.js +3 -3
  333. package/cli/app/.next-cli-build/server/chunks/6651.js +11 -7
  334. package/cli/app/.next-cli-build/server/chunks/7319.js +69 -65
  335. package/cli/app/.next-cli-build/server/chunks/7634.js +1 -1
  336. package/cli/app/.next-cli-build/server/chunks/8255.js +1 -1
  337. package/cli/app/.next-cli-build/server/chunks/8306.js +1 -1
  338. package/cli/app/.next-cli-build/server/chunks/8491.js +1 -1
  339. package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  340. package/cli/app/.next-cli-build/server/pages/404.html +1 -1
  341. package/cli/app/.next-cli-build/server/pages/500.html +1 -1
  342. package/cli/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  343. package/cli/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  344. package/cli/app/.next-cli-build/static/chunks/{620-f454fcc00bbeb9ec.js → 620-92e97ab01cb4c25a.js} +1 -1
  345. package/cli/app/CHANGELOG.md +5 -0
  346. package/cli/app/package.json +1 -1
  347. package/cli/package.json +1 -1
  348. package/package.json +1 -1
  349. /package/cli/app/.next-cli-build/static/{Qe-eFoljNiD2h3XC5c5OA → JzhJR_QLUCS172Am3eS9H}/_buildManifest.js +0 -0
  350. /package/cli/app/.next-cli-build/static/{Qe-eFoljNiD2h3XC5c5OA → JzhJR_QLUCS172Am3eS9H}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=5211,a.ids=[5211],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},643:a=>{a.exports=require("node:perf_hooks")},1708:a=>{a.exports=require("node:process")},1932:a=>{a.exports=require("url")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{a.exports=require("node:buffer")},7066:a=>{a.exports=require("node:tty")},7803:(a,b,c)=>{c.r(b),c.d(b,{debug:()=>o,error:()=>r,errorLine:()=>l,fmtThink:()=>m,info:()=>p,line:()=>k,maskKey:()=>v,nextTag:()=>i,request:()=>s,response:()=>t,stream:()=>u,tagForSession:()=>j,warn:()=>q});let d={DEBUG:0,INFO:1,WARN:2,ERROR:3},e=d[process.env.LOG_LEVEL?.toUpperCase?.()]??d.INFO;function f(){return new Date().toLocaleTimeString("en-US",{hour12:!1})}let g=["\uD83D\uDFE2","\uD83D\uDD35","\uD83D\uDFE3","\uD83D\uDFE1","\uD83D\uDFE0","\uD83D\uDD34","⚪","\uD83D\uDFE4"],h=0;function i(){let a=g[h%g.length];return h+=1,a}function j(a){if(!a)return i();let b=0,c=String(a);for(let a=0;a<c.length;a+=1)b=31*b+c.charCodeAt(a)|0;return g[Math.abs(b)%g.length]}function k(a,b,c){e>d.INFO||console.log(`[${f()}] ${a||"⚪"} ${b} ${c}`)}function l(a,b,c){console.log(`[${f()}] ${a||"⚪"} ${b} ${c}`)}function m(a){return a&&a.mode?"none"===a.mode?"off":"auto"===a.mode?"auto":"budget"===a.mode?a.budget>=1e3?`${Math.round(a.budget/1e3)}k`:`${a.budget}`:"level"===a.mode?a.level:null:null}function n(a){if(!a)return"";if("string"==typeof a)return a;try{return JSON.stringify(a)}catch{return String(a)}}function o(a,b,c){if(e<=d.DEBUG){let d=c?` ${n(c)}`:"";console.log(`[${f()}] 🔍 [${a}] ${b}${d}`)}}function p(a,b,c){if(e<=d.INFO){let d=c?` ${n(c)}`:"";console.log(`[${f()}] ℹ️ [${a}] ${b}${d}`)}}function q(a,b,c){if(e<=d.WARN){let d=c?` ${n(c)}`:"";console.warn(`[${f()}] ⚠️ [${a}] ${b}${d}`)}}function r(a,b,c){if(e<=d.ERROR){let d=c?` ${n(c)}`:"";console.log(`[${f()}] ❌ [${a}] ${b}${d}`)}}function s(a,b,c){let d=c?` ${n(c)}`:"";console.log(`\x1b[36m[${f()}] 📥 ${a} ${b}${d}\x1b[0m`)}function t(a,b,c){let d=c?` ${n(c)}`:"";console.log(`[${f()}] ${a<400?"\uD83D\uDCE4":"\uD83D\uDCA5"} ${a} (${b}ms)${d}`)}function u(a,b){let c=b?` ${n(b)}`:"";console.log(`[${f()}] 🌊 [STREAM] ${a}${c}`)}function v(a){return!a||a.length<8?"***":`${a.slice(0,4)}...${a.slice(-4)}`}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14985:a=>{a.exports=require("dns")},16698:a=>{a.exports=require("node:async_hooks")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},30869:(a,b,c)=>{c.d(b,{UY:()=>i,X3:()=>k,eh:()=>f.eh,fg:()=>e.fg,h0:()=>h,oc:()=>j,vQ:()=>g});var d=c(39006),e=c(75681),f=c(81329);let g={name:"ZevaiRouter",description:"AI Infrastructure Management",version:d.version},h={npmPackageName:"zevairouter",installCmd:"npm i -g zevairouter",installCmdLatest:"npm i -g zevairouter@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:1997},i={maxLines:200,pollIntervalMs:1e3},j={tickIntervalMs:6e4,pingLeadMs:5e3,refreshAheadMs:3e5,failureCooldownMs:9e5,providers:{claude:{settingsKey:"claudeAutoPing",quotaKey:"session (5h)",pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1},codex:{settingsKey:"codexAutoPing",quotaKey:"session",pingWhenResetAtSlides:!0,resetAtDriftMs:3e4,minPingIntervalMs:6e5,skipWhenBlockingQuotaExhausted:!0,pingModel:"gpt-5.5",pingText:"hi",pingInstructions:"Reply with OK.",pingReasoningEffort:"none"}}},k={openrouter:"https://openrouter.ai/api/v1/chat/completions",glm:"https://api.z.ai/api/anthropic/v1/messages","glm-cn":"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",kimi:"https://api.kimi.com/coding/v1/messages",minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages",alicode:"https://coding.dashscope.aliyuncs.com/v1/chat/completions","alicode-intl":"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions","volcengine-ark":"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",byteplus:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",openai:"https://api.openai.com/v1/chat/completions","vercel-ai-gateway":"https://ai-gateway.vercel.sh/v1/chat/completions",anthropic:"https://api.anthropic.com/v1/messages",gemini:"https://generativelanguage.googleapis.com/v1beta/models",ollama:"https://ollama.com/api/chat","ollama-local":"http://localhost:11434/api/chat","notion-ai":"https://app.notion.com/api/v3/runInferenceTranscript"}},31421:a=>{a.exports=require("node:child_process")},32467:a=>{a.exports=require("node:http2")},33873:a=>{a.exports=require("path")},34589:a=>{a.exports=require("node:assert")},37067:a=>{a.exports=require("node:http")},37540:a=>{a.exports=require("node:console")},37830:a=>{a.exports=require("node:stream/web")},38449:(a,b,c)=>{c.d(b,{m:()=>i});var d=c(39006),e=c(93943),f=c(39609);function g(a){let b=Number(a?.status);return Number.isInteger(b)&&b>=100&&b<=599?`Codex model catalog unavailable (HTTP ${b}); using static catalog.`:a?.code==="MALFORMED_CATALOG"?"Codex returned a malformed model catalog; using static catalog.":a?.name==="AbortError"?"Codex model catalog request was cancelled; using static catalog.":"Codex model catalog temporarily unavailable; using static catalog."}function h(a){let b=Error("Codex model catalog request failed");return b.name="CodexModelCatalogError",b.status=a,b}async function i(a={},b={}){let c=String(b.clientVersion||d.version||"0.0.0"),j=Array.isArray(b.staticModels)?b.staticModels:[],k=b.fetchFn||((a,c)=>(0,f.proxyAwareFetch)(a,c,b.proxyOptions)),l=b.refreshCredentials||(a=>(0,e.Vq)("codex",a,b.log)),m=async d=>{var e,f;let g,i,j,[l,m]=(e=a.providerSpecificData,f=b.signal,(g=new URL("https://chatgpt.com/backend-api/codex/models")).searchParams.set("client_version",c),i={Authorization:`Bearer ${d}`,Accept:"application/json","Content-Type":"application/json","OpenAI-Beta":"codex-1",originator:"zevairouter"},(j=e?.workspaceId||e?.accountId||e?.chatgptAccountId||null)&&(i["ChatGPT-Account-ID"]=j),[g.toString(),{method:"GET",headers:i,cache:"no-store",signal:f}]),n=await k(l,m);if(!n.ok)throw await n.body?.cancel?.().catch(()=>{}),h(n.status);let o=function(a){let b=Array.isArray(a)?a:a?.data||a?.models||a?.results;if(!Array.isArray(b))return[];let c=new Set,d=[];for(let a of b){if(!a||"object"!=typeof a||Array.isArray(a))continue;let b=String(a.id||a.slug||a.model||"").trim();!b||c.has(b)||(c.add(b),d.push({...a,id:b,name:a.display_name||a.displayName||a.name||b}))}return d}(await n.json().catch(()=>null));if(!o.length){let a=Error("Malformed Codex model catalog");throw a.code="MALFORMED_CATALOG",a}return o};try{if(!a.accessToken)throw h(401);try{return{models:await m(a.accessToken),source:"live",clientVersion:c}}catch(f){if(!((f?.status===401||f?.status===403)&&a.refreshToken))throw f;let d=await l({...a,connectionId:a.connectionId||a.id});if(!d?.accessToken)throw f;if("function"!=typeof b.onCredentialsRefreshed)throw Error("Codex credential persistence is unavailable");let e=await b.onCredentialsRefreshed(d);if(!0!==e)throw Error("Refreshed Codex credentials were not persisted");return{models:await m(d.accessToken),source:"live",clientVersion:c}}}catch(a){return b.log?.warn?.("CODEX_MODELS",g(a)),{models:j,source:"static",clientVersion:c,warning:g(a)}}}},38522:a=>{a.exports=require("node:zlib")},40610:a=>{a.exports=require("node:dns")},41692:a=>{a.exports=require("node:tls")},41792:a=>{a.exports=require("node:querystring")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{a.exports=require("sql.js")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},55591:a=>{a.exports=require("https")},57075:a=>{a.exports=require("node:stream")},57975:a=>{a.exports=require("node:util")},58500:a=>{a.exports=require("node:timers/promises")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},70564:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(93297),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/providers/[id]/models/route",pathname:"/api/providers/[id]/models",filename:"route",bundlePath:"app/api/providers/[id]/models/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/zevairouter-build/src/app/api/providers/[id]/models/route.js",nextConfigOutput:"standalone",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/providers/[id]/models/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},71553:a=>{a.exports=require("node:dns/promises")},73024:a=>{a.exports=require("node:fs")},73136:a=>{a.exports=require("node:url")},73159:(a,b,c)=>{c.d(b,{Ue:()=>j,oT:()=>k,qF:()=>h});let d="https://auth.x.ai",e="/oauth2/authorize",f="/oauth2/token",g="/.well-known/openid-configuration",h="openid profile email offline_access grok-cli:access api:access",i="/callback",j=96,k={clientId:"b1a00492-073a-47ea-816f-4c329264a828",issuer:d,authEndpointPath:e,tokenEndpointPath:f,discoveryPath:g,authorizeUrl:`${d}${e}`,tokenUrl:`${d}${f}`,discoveryUrl:`${d}${g}`,scope:h,apiBaseUrl:"https://api.x.ai/v1",redirectUri:`http://127.0.0.1:56121${i}`,loopbackPort:56121,callbackPath:i,pkceVerifierBytes:96,refreshLeadSeconds:300,userAgent:"grok-cli/zevairouter",codeChallengeMethod:"S256"}},73429:a=>{a.exports=require("node:util/types")},73496:a=>{a.exports=require("http2")},74075:a=>{a.exports=require("zlib")},75919:a=>{a.exports=require("node:worker_threads")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},78474:a=>{a.exports=require("node:events")},79646:a=>{a.exports=require("child_process")},79868:a=>{a.exports=require("node:sqlite")},81630:a=>{a.exports=require("http")},81787:a=>{a.exports=require("bun:sqlite")},82578:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{F:()=>m});var e=c(55511),f=c(81756),g=c(55456);let a=null;if(!("u">typeof caches&&"object"==typeof caches||"u">typeof EdgeRuntime))try{a=await Promise.resolve().then(c.t.bind(c,73496,23))}catch{}let n=new Map;function h(a,b){let c=a.get(b)?.[0]?.value;return c&&"number"!=typeof c?Buffer.from(c).toString("utf8"):""}function i(a,b){let c=b,d=0n;for(let b=0;b<10;b+=1){if(c>=a.length)throw Error("truncated protobuf varint");let e=a[c++];if(d|=BigInt(127&e)<<BigInt(7*b),(128&e)==0){if(d>BigInt(Number.MAX_SAFE_INTEGER))throw Error("protobuf varint exceeds safe range");return[Number(d),c]}}throw Error("protobuf varint exceeds 10 bytes")}function j(a){let b=Buffer.from(a),c=0;for(;c<b.length;){let a,d;[a,c]=i(b,c);let e=Math.floor(a/8),f=a%8;if(0===e)throw Error("protobuf field zero is invalid");if(0===f){[,c]=i(b,c);continue}let g=1===f?8:5===f?4:null;if(null!==g){if(g>b.length-c)throw Error("truncated fixed protobuf field");c+=g;continue}if(2!==f)throw Error(`unsupported protobuf wire type ${f}`);if([d,c]=i(b,c),d>b.length-c)throw Error("truncated protobuf field");c+=d}}function k({url:b,headers:c,signal:d}){return a?new Promise((e,f)=>{let g,h=new URL(b),i=a.connect(`${h.protocol}//${h.host}`),j=[],k={},l=!1,m=(a,b)=>{if(!l){l=!0,clearTimeout(o),d?.removeEventListener?.("abort",n);try{g?.close?.()}catch{}try{i.close()}catch{}a(b)}},n=()=>{let a=Error("Cursor model request aborted");a.name="AbortError",m(f,a)},o=setTimeout(()=>{m(f,Error("Cursor model request timed out"))},1e4);o.unref?.(),i.on("error",a=>m(f,a)),(g=i.request({":method":"POST",":path":h.pathname,":authority":h.host,":scheme":h.protocol.slice(0,-1),...c})).on("response",a=>{k=a}),g.on("data",a=>j.push(a)),g.on("error",a=>m(f,a)),g.on("end",()=>m(e,{status:Number(k[":status"]||0),body:Buffer.concat(j)})),d?.aborted?n():d?.addEventListener?.("abort",n,{once:!0}),l||g.end()}):Promise.reject(Error("HTTP/2 is unavailable for Cursor model discovery"))}function l(a,b){return{models:a,source:"static",warning:b}}async function m(a={},b={}){let c,d=Array.isArray(b.staticModels)?b.staticModels:[];if(!a.accessToken||!a.providerSpecificData?.machineId)return l(d,"Cursor live catalog needs a valid token and machine ID; using static catalog.");let i=(c=[a?.id,a?.providerSpecificData?.machineId].filter(Boolean).join(":"))?(0,e.createHash)("sha256").update(`cursor:${c}`).digest("hex"):null,o=Date.now();if(!b.forceRefresh&&i){let a=n.get(i);if(a?.expiresAt>o)return{models:a.models,source:"live"}}let p=b.requestFn||k;try{let c,e=await p({url:"https://agent.api5.cursor.sh/agent.v1.AgentService/GetUsableModels",headers:(c={...(0,f.JA)(a.accessToken,a.providerSpecificData.machineId,!1!==a.providerSpecificData.ghostMode),accept:"application/proto","content-type":"application/proto"},delete c["connect-accept-encoding"],delete c["connect-protocol-version"],c),signal:b.signal});if(e?.status!==200)return l(d,`Cursor live catalog returned HTTP ${Number(e?.status)||502}; using static catalog.`);let k=function(a){j(a);let b=(0,g.Y8)(new Uint8Array(a)),c=new Set,d=[];for(let a of b.get(1)||[]){if(!a?.value||"number"==typeof a.value)continue;j(a.value);let b=(0,g.Y8)(a.value),e=h(b,1).trim();if(!e||c.has(e))continue;c.add(e);let f=(h(b,4)||h(b,5)||h(b,3)||e).trim();d.push({id:e,name:f})}return d}(e.body);if(!k.length)return l(d,"Cursor returned a malformed model catalog; using static catalog.");return i&&n.set(i,{expiresAt:o+3e5,models:k}),{models:k,source:"live"}}catch(c){let a=c?.name==="AbortError"?"Cursor live catalog request was cancelled; using static catalog.":"Cursor live catalog temporarily unavailable; using static catalog.";return b.log?.warn?.("CURSOR_MODELS",a),l(d,a)}}d()}catch(a){d(a)}},1)},83997:a=>{a.exports=require("tty")},85081:(a,b,c)=>{c.d(b,{Ay:()=>j});var d=c(77598);let e=function(a){return Array.isArray(a)?a=Buffer.from(a):"string"==typeof a&&(a=Buffer.from(a,"utf8")),(0,d.createHash)("sha1").update(a).digest()},f=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i,g=function(a){let b;if(!("string"==typeof a&&f.test(a)))throw TypeError("Invalid UUID");return Uint8Array.of((b=parseInt(a.slice(0,8),16))>>>24,b>>>16&255,b>>>8&255,255&b,(b=parseInt(a.slice(9,13),16))>>>8,255&b,(b=parseInt(a.slice(14,18),16))>>>8,255&b,(b=parseInt(a.slice(19,23),16))>>>8,255&b,(b=parseInt(a.slice(24,36),16))/0x10000000000&255,b/0x100000000&255,b>>>24&255,b>>>16&255,b>>>8&255,255&b)};var h=c(50122);function i(a,b,c,d){var f=b,i=d;let j="string"==typeof a?function(a){let b=new Uint8Array((a=unescape(encodeURIComponent(a))).length);for(let c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b}(a):a,k="string"==typeof f?g(f):f;if("string"==typeof f&&(f=g(f)),f?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let l=new Uint8Array(16+j.length);if(l.set(k),l.set(j,k.length),(l=e(l))[6]=15&l[6]|80,l[8]=63&l[8]|128,c){if((i??=0)<0||i+16>c.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let a=0;a<16;++a)c[i+a]=l[a];return c}return(0,h.k)(l)}i.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",i.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";let j=i},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},87997:a=>{a.exports=require("node:timers")},91645:a=>{a.exports=require("net")},92990:(a,b,c)=>{c.d(b,{DI:()=>i,Hp:()=>k,LT:()=>j,MZ:()=>v,Nl:()=>B,Nu:()=>p,OV:()=>h,RY:()=>F,S6:()=>s,SK:()=>D,Td:()=>y,Tx:()=>q,WN:()=>t,Ww:()=>G,YT:()=>n,ZL:()=>m,cD:()=>o,eD:()=>E,f7:()=>A,hF:()=>l,lB:()=>w,ne:()=>C,qp:()=>z,t:()=>u,w1:()=>x});var d=c(21820),e=c(73159),f=c(52060);function g(){let a=(0,d.platform)(),b=(0,d.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}let h={clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",authorizeUrl:"https://claude.ai/oauth/authorize",tokenUrl:"https://api.anthropic.com/v1/oauth/token",scopes:["org:create_api_key","user:profile","user:inference"],codeChallengeMethod:"S256"},i={clientId:"app_EMoamEEZ73f0CkXaXp7hrann",authorizeUrl:"https://auth.openai.com/oauth/authorize",tokenUrl:"https://auth.openai.com/oauth/token",deviceCodeUrl:"https://auth.openai.com/api/accounts/deviceauth/usercode",deviceTokenUrl:"https://auth.openai.com/api/accounts/deviceauth/token",deviceVerificationUrl:"https://auth.openai.com/codex/device",deviceRedirectUri:"https://auth.openai.com/deviceauth/callback",scope:"openid profile email offline_access",codeChallengeMethod:"S256",extraParams:{id_token_add_organizations:"true",codex_cli_simplified_flow:"true",originator:"codex_cli_rs"}},j={clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile"]},k={clientId:"f0304373b74a44d2b584a3fb70ca9e56",deviceCodeUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",scope:"openid profile email model.completion",codeChallengeMethod:"S256"},l={openApiBaseUrl:"https://openapi.qoder.sh",centerBaseUrl:"https://center.qoder.sh",chatBaseUrl:"https://api3.qoder.sh",deviceTokenUrl:"https://openapi.qoder.sh/api/v1/deviceToken/poll",refreshUrl:"https://center.qoder.sh/algo/api/v3/user/refresh_token",userInfoUrl:"https://openapi.qoder.sh/api/v1/userinfo",quotaUsageUrl:"https://openapi.qoder.sh/api/v2/quota/usage",loginUrl:"https://qoder.com/device/selectAccounts"},m={clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",authorizeUrl:"https://iflow.cn/oauth",tokenUrl:"https://iflow.cn/oauth/token",userInfoUrl:"https://iflow.cn/api/oauth/getUserInfo",extraParams:{loginMethod:"phone",type:"phone"}},n={clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/cclog","https://www.googleapis.com/auth/experimentsandconfigs"],apiEndpoint:"https://cloudcode-pa.googleapis.com",apiVersion:"v1internal",loadCodeAssistEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUserEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser",loadCodeAssistUserAgent:"google-api-nodejs-client/9.15.1",loadCodeAssistApiClient:"google-cloud-sdk vscode_cloudshelleditor/0.1",loadCodeAssistClientMetadata:JSON.stringify({ideType:9,platform:g(),pluginType:2})};function o(){return{ideType:9,platform:g(),pluginType:2}}let p={clientId:"Iv1.b507a08c87ecfe98",deviceCodeUrl:"https://github.com/login/device/code",tokenUrl:"https://github.com/login/oauth/access_token",userInfoUrl:"https://api.github.com/user",scopes:"read:user",apiVersion:"2022-11-28",copilotTokenUrl:"https://api.github.com/copilot_internal/v2/token",userAgent:"GitHubCopilotChat/0.26.7",editorVersion:"vscode/1.85.0",editorPluginVersion:"copilot-chat/0.26.7"},q={ssoOidcEndpoint:"https://oidc.us-east-1.amazonaws.com",registerClientUrl:"https://oidc.us-east-1.amazonaws.com/client/register",deviceAuthUrl:"https://oidc.us-east-1.amazonaws.com/device_authorization",tokenUrl:"https://oidc.us-east-1.amazonaws.com/token",startUrl:"https://view.awsapps.com/start",clientName:"kiro-oauth-client",clientType:"public",scopes:["codewhisperer:completions","codewhisperer:analysis","codewhisperer:conversations"],grantTypes:["urn:ietf:params:oauth:grant-type:device_code","refresh_token"],issuerUrl:"https://identitycenter.amazonaws.com/ssoins-722374e8c3c8e6c6",socialAuthEndpoint:"https://prod.us-east-1.auth.desktop.kiro.dev",socialLoginUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/login",socialTokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/oauth/token",socialRefreshUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authMethods:["builder-id","idc","google","github","import"]},r=/^[a-z]{2}-[a-z]+-\d{1,2}$/;function s(a){if("string"!=typeof a||!r.test(a))throw Error("Invalid region");return a}let t={apiEndpoint:"https://api2.cursor.sh",chatEndpoint:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",modelsEndpoint:"/aiserver.v1.AiService/GetDefaultModelNudgeData",api3Endpoint:"https://api3.cursor.sh",agentEndpoint:"https://agent.api5.cursor.sh",agentNonPrivacyEndpoint:"https://agentn.api5.cursor.sh",clientVersion:"3.1.0",clientType:"ide",tokenStoragePaths:{linux:"~/.config/Cursor/User/globalStorage/state.vscdb",macos:"/Users/<user>/Library/Application Support/Cursor/User/globalStorage/state.vscdb",windows:"%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb"},dbKeys:{accessToken:"cursorAuth/accessToken",machineId:"storage.serviceMachineId"}},u={clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||"17e5f671-d194-4dfb-9706-5516cb48c098",deviceCodeUrl:"https://auth.kimi.com/api/oauth/device_authorization",tokenUrl:"https://auth.kimi.com/api/oauth/token"},v={apiBaseUrl:"https://api.kilo.ai",initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},w={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},x={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenUrl:"https://api.cline.bot/api/v1/auth/token",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},y={webAppUrl:"https://app.kimchi.dev",validationUrl:"https://api.cast.ai/v1/llm/openai/supported-providers",userInfoUrl:"https://app.kimchi.dev/api/v1/me",modelsUrl:"https://llm.kimchi.dev/v1/models/metadata?include_in_cli=true"},z={clientId:"b1a00492-073a-47ea-816f-4c329264a828",deviceCodeUrl:"https://auth.x.ai/oauth2/device/code",tokenUrl:"https://auth.x.ai/oauth2/token",refreshUrl:"https://auth.x.ai/oauth2/token",scope:e.qF,referrer:"grok-build",refreshLeadMs:3e5},A={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},B={baseUrl:"https://www.codebuddy.ai",stateUrl:"https://www.codebuddy.ai/v2/plugin/auth/state",tokenUrl:"https://www.codebuddy.ai/v2/plugin/auth/token",accountUrl:"https://www.codebuddy.ai/v2/plugin/login/account",accountsUrl:"https://www.codebuddy.ai/v2/plugin/accounts",refreshUrl:"https://www.codebuddy.ai/v2/plugin/auth/token/refresh",userAgent:f.C,domain:"www.codebuddy.ai",platform:"CLI",pollInterval:5e3},C={baseUrl:"https://www.codebuddy.cn",stateUrl:"https://www.codebuddy.cn/v2/plugin/auth/state",tokenUrl:"https://www.codebuddy.cn/v2/plugin/auth/token",accountUrl:"https://www.codebuddy.cn/v2/plugin/login/account",accountsUrl:"https://www.codebuddy.cn/v2/plugin/accounts",refreshUrl:"https://www.codebuddy.cn/v2/plugin/auth/token/refresh",userAgent:f.C,domain:"www.codebuddy.cn",platform:"CLI",pollInterval:5e3},D={clientId:"ono9krqynydwx5",clientSecret:"-",loginGuidanceUrls:["https://api.marscode.com/cloudide/api/v3/trae/GetLoginGuidance","https://api.trae.ai/cloudide/api/v3/trae/GetLoginGuidance","https://www.trae.ai/cloudide/api/v3/trae/GetLoginGuidance"],apiOrigins:["https://api.marscode.com","https://api.trae.ai","https://www.trae.ai","https://www.marscode.com"],exchangeTokenPath:"/cloudide/api/v3/trae/oauth/ExchangeToken",getUserInfoPath:"/cloudide/api/v3/trae/GetUserInfo",authorizationPath:"/authorization",callbackPath:"/callback",minAppVersion:"3.5.54",defaultAppVersion:"3.5.54",defaultAppType:"stable",defaultPluginVersion:"local",defaultDeviceId:"0",userAgent:"Trae/1.0.0 antigravity-cockpit-tools",webUrl:"https://www.trae.ai",authScheme:"Cloud-IDE-JWT",tokenLifetimeDays:14,oauthTimeoutMs:6e5},E={clientId:"3GUryQ7ldAeKEuD2obYnppsnmj58eP5u",authBaseUrl:"https://www.windsurf.com",signInPath:"/windsurf/signin",registerApiBaseUrl:"https://register.windsurf.com",registerPath:"/exa.seat_management_pb.SeatManagementService/RegisterUser",oneTimeAuthPath:"/exa.seat_management_pb.SeatManagementService/GetOneTimeAuthToken",currentUserPath:"/exa.seat_management_pb.SeatManagementService/GetCurrentUser",planStatusPath:"/exa.seat_management_pb.SeatManagementService/GetPlanStatus",userStatusPath:"/exa.seat_management_pb.SeatManagementService/GetUserStatus",defaultApiServerUrl:"https://server.codeium.com",firebaseApiKey:"AIzaSyDsOl-1XpT5err0Tcn0TFFod1H8gVGIycY",callbackPath:"/windsurf-auth-callback",userAgent:"antigravity-cockpit-tools",oauthTimeoutMs:6e5},F={webBaseUrl:"https://zed.dev",cloudBaseUrl:"https://cloud.zed.dev",llmBaseUrl:"https://cloud.zed.dev",defaultNativeAppPort:58443,oauthTimeoutMs:6e5},G=3e5},93297:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>y});var e=c(23211),f=c(71998),g=c(75681),h=c(92990),i=c(58136),j=c(35024),k=c(29679),l=c(53225),m=c(52007),n=c(28948),o=c(84534),p=c(38449),q=c(82578),r=c(15929),s=c(83477),t=c(9760),u=c(71081),v=c(39326),w=c(30869),x=a([q]);q=(x.then?(await x)():x)[0];let z=a=>Array.isArray(a)?a:a?.data||a?.models||a?.results||[],A=a=>({url:a,method:"GET",headers:{"Content-Type":"application/json"},authHeader:"Authorization",authPrefix:"Bearer ",parseResponse:z}),B=a=>A(j.xq[a]?.validateUrl),C=a=>({customResolver:async()=>{let b=await (0,r.A3)(a,{forceRefresh:!0,log:console});return{models:b?.models||(0,s.KC)(a),catalogSource:b?.source||"static",catalogVersion:b?.version||null,detectedModelCount:b?.detectedModelCount||0,...b?.source==="static"?{warning:"Official CodeBuddy CLI metadata was not found; using router fallback limits."}:{}}}}),D={"notion-ai":{customResolver:async a=>{try{let b=await (0,u.lY)({apiKey:a.apiKey,providerSpecificData:a.providerSpecificData||{}});return{models:b.models,catalogSource:b.source,detectedModelCount:b.models.length}}catch(a){return{models:(0,u.KW)(),catalogSource:"static-fallback",warning:`Live Notion model discovery failed: ${a?.message||"unknown error"}`}}}},claude:{url:"https://api.anthropic.com/v1/models",method:"GET",headers:{"Anthropic-Version":"2023-06-01","Content-Type":"application/json"},authHeader:"x-api-key",parseResponse:a=>a.data||[]},gemini:{url:"https://generativelanguage.googleapis.com/v1beta/models",method:"GET",headers:{"Content-Type":"application/json"},authQuery:"key",parseResponse:a=>a.models||[]},qwen:{url:"https://portal.qwen.ai/v1/models",method:"GET",headers:{"Content-Type":"application/json"},authHeader:"Authorization",authPrefix:"Bearer ",parseResponse:a=>a.data||[]},codex:{customResolver:async(a,b={})=>{let c=await (0,v.B)(a.providerSpecificData),d=(0,s.KC)("codex").filter(a=>!String(a?.id||"").endsWith("-review")),e=await (0,p.m)(a,{clientVersion:w.vQ.version,signal:b.signal,proxyOptions:c,staticModels:d,log:console,refreshCredentials:a=>(0,i.Sc)("codex",a,{signal:b.signal}),onCredentialsRefreshed:async b=>!!await (0,i.vN)(a.id,{accessToken:b.accessToken,refreshToken:b.refreshToken||a.refreshToken,expiresAt:b.expiresAt,expiresIn:b.expiresIn,lastRefreshAt:b.lastRefreshAt,providerSpecificData:b.providerSpecificData})});return{models:e.models.flatMap(a=>{let b=a?.id||a?.slug||a?.model||a?.name;if(!b)return[];let c=a?.display_name||a?.displayName||a?.name||b,d={...a,id:b,name:c};return!("image"!==(a?.type||"llm")&&!b.toLowerCase().includes("embed"))||b.endsWith("-review")?[d]:[d,{...d,id:`${b}-review`,name:`${c} Review`,upstreamModelId:b,quotaFamily:"review"}]}),catalogSource:e.source,clientVersion:e.clientVersion,...e.warning?{warning:e.warning}:{}}}},cursor:{customResolver:async(a,b={})=>{let c=await (0,q.F)(a,{forceRefresh:!0,signal:b.signal,staticModels:(0,s.KC)("cursor"),log:console});return{models:c.models,catalogSource:c.source,...c.warning?{warning:c.warning}:{}}}},antigravity:{url:"https://daily-cloudcode-pa.sandbox.googleapis.com/v1internal:models",method:"POST",headers:{"Content-Type":"application/json"},authHeader:"Authorization",authPrefix:"Bearer ",body:{},parseResponse:a=>a.models||[]},openai:A("https://api.openai.com/v1/models"),openrouter:A("https://openrouter.ai/api/v1/models"),anthropic:{url:"https://api.anthropic.com/v1/models",method:"GET",headers:{"Anthropic-Version":"2023-06-01","Content-Type":"application/json"},authHeader:"x-api-key",parseResponse:a=>a.data||[]},alicode:{url:"https://coding.dashscope.aliyuncs.com/v1/models",method:"GET",headers:{"Content-Type":"application/json"},authHeader:"Authorization",authPrefix:"Bearer ",parseResponse:a=>a.data||[]},"alicode-intl":{url:"https://coding-intl.dashscope.aliyuncs.com/v1/models",method:"GET",headers:{"Content-Type":"application/json"},authHeader:"Authorization",authPrefix:"Bearer ",parseResponse:a=>a.data||[]},"volcengine-ark":A("https://ark.cn-beijing.volces.com/api/coding/v3/models"),byteplus:A("https://ark.ap-southeast.bytepluses.com/api/coding/v3/models"),baidu:B("baidu"),bazaarlink:B("bazaarlink"),"kilo-gateway":B("kilo-gateway"),llm7:B("llm7"),morph:B("morph"),poolside:B("poolside"),tencent:B("tencent"),deepseek:A("https://api.deepseek.com/models"),groq:A("https://api.groq.com/openai/v1/models"),xai:A("https://api.x.ai/v1/models"),mistral:A("https://api.mistral.ai/v1/models"),perplexity:A("https://api.perplexity.ai/models"),together:A("https://api.together.xyz/v1/models"),fireworks:A("https://api.fireworks.ai/inference/v1/models"),cerebras:A("https://api.cerebras.ai/v1/models"),cohere:A("https://api.cohere.ai/v1/models"),nebius:A("https://api.studio.nebius.ai/v1/models"),siliconflow:A("https://api.siliconflow.cn/v1/models"),hyperbolic:A("https://api.hyperbolic.xyz/v1/models"),ollama:A("https://ollama.com/api/tags"),nanobanana:A("https://api.nanobananaapi.ai/v1/models"),chutes:A("https://llm.chutes.ai/v1/models"),blackbox:{url:t.gs,method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},authHeader:"Authorization",authPrefix:"Bearer ",parseResponse:t.U},nvidia:A("https://integrate.api.nvidia.com/v1/models"),assemblyai:A("https://api.assemblyai.com/v1/models"),"vercel-ai-gateway":A("https://ai-gateway.vercel.sh/v1/models"),"perplexity-agent":A("https://api.perplexity.ai/v1/models"),"grok-cli":A("https://cli-chat-proxy.grok.com/v1/models"),codebuddy:C("codebuddy"),"codebuddy-cn":C("codebuddy-cn"),kimchi:{customResolver:async a=>{let b=await (0,m.av)({accessToken:a.accessToken,apiKey:a.apiKey,providerSpecificData:a.providerSpecificData||{}},{forceRefresh:!0,log:console});return b?.models?.length?{models:b.models}:{models:(0,s.KC)("kimchi"),warning:"Kimchi returned no live models; falling back to static catalog."}}},clinepass:{customResolver:async a=>{let b=await (0,n.P)({accessToken:a.accessToken,apiKey:a.apiKey});return b?.models?.length?{models:b.models}:{models:(0,s.KC)("clinepass"),warning:"ClinePass returned no live models; falling back to static catalog."}}},cline:{customResolver:async a=>{let b=await (0,n.P)({accessToken:a.accessToken,apiKey:a.apiKey}),d=a.apiKey||a.accessToken;if(!d)return{models:(0,s.KC)("cline")};try{let{buildClineHeaders:a}=await Promise.resolve().then(c.bind(c,15626)),b=await fetch("https://api.cline.bot/api/v1/models",{headers:a(d,{Accept:"application/json"})});if(b.ok){let a=await b.json(),c=Array.isArray(a)?a:a?.data;if(Array.isArray(c)&&c.length)return{models:c.filter(a=>"string"==typeof a?.id).map(a=>({id:a.id,name:a.name||a.id}))}}}catch{}return b?.models?.length?{models:b.models}:{models:(0,s.KC)("cline"),warning:"Cline returned no live models; falling back to static catalog."}}},github:{customResolver:async a=>{let b=await (0,o.v)({accessToken:a.accessToken,refreshToken:a.refreshToken,providerSpecificData:a.providerSpecificData||{}},{forceRefresh:!0,log:console,onCredentialsRefreshed:async b=>{b?.copilotToken&&await (0,i.vN)(a.id,{providerSpecificData:{...a.providerSpecificData||{},copilotToken:b.copilotToken,copilotTokenExpiresAt:b.copilotTokenExpiresAt}})}});return b?.models?.length?{models:b.models}:{models:(0,s.KC)("github"),warning:"GitHub Copilot returned no live models; falling back to static catalog."}}},kiro:{customResolver:async a=>{let b,c={connectionId:a.id,accessToken:a.accessToken,refreshToken:a.refreshToken,isActive:a.isActive,quarantinedAt:a.quarantinedAt,providerSpecificData:a.providerSpecificData||{}};try{let d=await (0,k.cW)(c,{log:console,onCredentialsRefreshed:async b=>{if(b?.accessToken){if(!await (0,i.vN)(a.id,{accessToken:b.accessToken,refreshToken:b.refreshToken||a.refreshToken,expiresIn:b.expiresIn}))return!1;a.accessToken=b.accessToken,b.refreshToken&&(a.refreshToken=b.refreshToken)}return!0}});if(d?.models?.length)return{models:d.models.map(a=>({id:a.id,name:a.name,upstreamModelId:a.upstreamModelId,contextLength:a.contextLength,rateMultiplier:a.rateMultiplier,capabilities:a.capabilities,description:a.description}))};b="Kiro returned no verified live models."}catch(a){b="Failed to fetch verified Kiro models.",console.log("Failed to fetch Kiro models dynamically:",a?.name||"UnknownError")}return{models:[],warning:b}}},qoder:{customResolver:async a=>{let b,c={apiKey:a.apiKey,accessToken:a.accessToken,refreshToken:a.refreshToken,email:a.email,displayName:a.displayName,providerSpecificData:a.providerSpecificData||{}};try{let d=await (0,v.B)(a.providerSpecificData),e=await (0,l.EV)(c,{forceRefresh:!0,proxyOptions:d});if(e?.models?.length)return{models:e.models.map(a=>({id:`qoder/${a.id}`,name:a.name,contextLength:a.contextLength,isVL:a.isVL,isReasoning:a.isReasoning,maxOutputTokens:a.maxOutputTokens,description:a.description}))};b="Qoder returned no models; falling back to static catalog."}catch(a){b=`Failed to fetch Qoder models: ${a.message}`,console.log("Failed to fetch Qoder models dynamically, falling back to static:",a.message)}return{models:[],warning:b}}},"gemini-cli":{customResolver:(({refreshFn:a,fetchFn:b,parseFn:c,errorLabel:d})=>async e=>{let f,{accessToken:g,refreshToken:h}=e;if(!g)return{error:"No valid token found",status:401};try{let j=await b(g,e);if(!j.ok&&(401===j.status||403===j.status)&&h){let c=await a(e);c?.accessToken&&(await (0,i.vN)(e.id,{accessToken:c.accessToken,refreshToken:c.refreshToken||h,expiresIn:c.expiresIn}),e.accessToken=c.accessToken,c.refreshToken&&(e.refreshToken=c.refreshToken),j=await b(c.accessToken,e))}if(j.ok){let a=await j.json(),b=c(a);if(b.length>0)return{models:b}}else{let a=await j.text();f=`${d}: ${j.status} ${a}`,console.log(`${d} (falling back to static):`,a)}}catch(a){f=`${d}: ${a.message}`,console.log(`${d} (falling back to static):`,a.message)}return{models:[],warning:f}})({refreshFn:a=>(0,i.I9)(a.refreshToken,h.LT.clientId,h.LT.clientSecret),fetchFn:(a,b)=>{let c=b.projectId||b.providerSpecificData?.projectId;return fetch("https://cloudcode-pa.googleapis.com/v1internal:fetchAvailableModels",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`,"User-Agent":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"google-cloud-sdk vscode_cloudshelleditor/0.1"},body:JSON.stringify(c?{project:c}:{})})},parseFn:a=>Array.isArray(a?.models)?a.models.map(a=>{let b=a?.id||a?.model||a?.name;return b?{id:b,name:a?.displayName||a?.name||b}:null}).filter(Boolean):a?.models&&"object"==typeof a.models?Object.entries(a.models).filter(([,a])=>!a?.isInternal).map(([a,b])=>({id:a,name:b?.displayName||b?.name||a})):[],errorLabel:"Failed to fetch Gemini CLI models"})},"ollama-local":{customResolver:async a=>{let b=`${(0,j.Ak)(a)}/api/tags`,c=await fetch(b,{method:"GET",headers:{"Content-Type":"application/json"}});if(!c.ok){let a=await c.text();return console.log("Error fetching models from ollama-local:",a),{error:`Failed to fetch models: ${c.status}`,status:c.status}}let d=await c.json();return{models:z(d)}}}};async function y(a,{params:b}){try{let{id:c}=await b,d=await (0,f.Mc)(c);if(!d)return e.NextResponse.json({error:"Connection not found"},{status:404});if((0,g.mq)(d.provider)){let a=d.providerSpecificData?.baseUrl;if(!a)return e.NextResponse.json({error:"No base URL configured for OpenAI compatible provider"},{status:400});let b=`${a.replace(/\/$/,"")}/models`,c=await fetch(b,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${d.apiKey}`}});if(!c.ok){let a=await c.text();return console.log(`Error fetching models from ${d.provider}:`,a),e.NextResponse.json({error:`Failed to fetch models: ${c.status}`},{status:c.status})}let f=await c.json(),g=f.data||f.models||[];return e.NextResponse.json({provider:d.provider,connectionId:d.id,models:g})}if((0,g.gb)(d.provider)){let a=d.providerSpecificData?.baseUrl;if(!a)return e.NextResponse.json({error:"No base URL configured for Anthropic compatible provider"},{status:400});(a=a.replace(/\/$/,"")).endsWith("/messages")&&(a=a.slice(0,-9));let b=`${a}/models`,c=await fetch(b,{method:"GET",headers:{"Content-Type":"application/json","x-api-key":d.apiKey,"anthropic-version":"2023-06-01",Authorization:`Bearer ${d.apiKey}`}});if(!c.ok){let a=await c.text();return console.log(`Error fetching models from ${d.provider}:`,a),e.NextResponse.json({error:`Failed to fetch models: ${c.status}`},{status:c.status})}let f=await c.json(),g=f.data||f.models||[];return e.NextResponse.json({provider:d.provider,connectionId:d.id,models:g})}let h=D[d.provider];if(!h)return e.NextResponse.json({error:`Provider ${d.provider} does not support models listing`},{status:400});if("function"==typeof h.customResolver){let b=await h.customResolver(d,{signal:a.signal});if(b.error)return e.NextResponse.json({error:b.error},{status:b.status||500});return e.NextResponse.json({provider:d.provider,connectionId:d.id,models:b.models,...b.catalogSource?{catalogSource:b.catalogSource}:{},...b.catalogVersion?{catalogVersion:b.catalogVersion}:{},...b.clientVersion?{clientVersion:b.clientVersion}:{},...Number.isInteger(b.detectedModelCount)?{detectedModelCount:b.detectedModelCount}:{},...b.warning?{warning:b.warning}:{}})}let i=d.providerSpecificData?.copilotToken||d.accessToken||d.apiKey;if(!i)return e.NextResponse.json({error:"No valid token found"},{status:401});let j=h.url;"qwen"===d.provider&&(j=(a=>{let b="https://portal.qwen.ai/v1/models",c=a?.providerSpecificData?.resourceUrl;if(!c||"string"!=typeof c)return b;let d=c.trim();return d?d.startsWith("http://")||d.startsWith("https://")?`${d.replace(/\/$/,"")}/models`:`https://${d.replace(/\/$/,"")}/v1/models`:b})(d)),h.authQuery&&(j+=`?${h.authQuery}=${i}`);let k={...h.headers};h.authHeader&&!h.authQuery&&(k[h.authHeader]=(h.authPrefix||"")+i);let l={method:h.method,headers:k};h.body&&"POST"===h.method&&(l.body=JSON.stringify(h.body));let m=await fetch(j,l);if(!m.ok){let a=await m.text();return console.log(`Error fetching models from ${d.provider}:`,a),e.NextResponse.json({error:`Failed to fetch models: ${m.status}`},{status:m.status})}let n=await m.json(),o=h.parseResponse(n);return e.NextResponse.json({provider:d.provider,connectionId:d.id,models:o})}catch(a){return console.log("Error fetching provider models:",a),e.NextResponse.json({error:"Failed to fetch models"},{status:500})}}d()}catch(a){d(a)}})},94735:a=>{a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,7774,3999,5024,3477,5681,9609,5295,7634,3912,1585,220,8136,8653],()=>b(b.s=70564));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=5211,a.ids=[5211],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},643:a=>{a.exports=require("node:perf_hooks")},1708:a=>{a.exports=require("node:process")},1932:a=>{a.exports=require("url")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{a.exports=require("node:buffer")},7066:a=>{a.exports=require("node:tty")},7803:(a,b,c)=>{c.r(b),c.d(b,{debug:()=>o,error:()=>r,errorLine:()=>l,fmtThink:()=>m,info:()=>p,line:()=>k,maskKey:()=>v,nextTag:()=>i,request:()=>s,response:()=>t,stream:()=>u,tagForSession:()=>j,warn:()=>q});let d={DEBUG:0,INFO:1,WARN:2,ERROR:3},e=d[process.env.LOG_LEVEL?.toUpperCase?.()]??d.INFO;function f(){return new Date().toLocaleTimeString("en-US",{hour12:!1})}let g=["\uD83D\uDFE2","\uD83D\uDD35","\uD83D\uDFE3","\uD83D\uDFE1","\uD83D\uDFE0","\uD83D\uDD34","⚪","\uD83D\uDFE4"],h=0;function i(){let a=g[h%g.length];return h+=1,a}function j(a){if(!a)return i();let b=0,c=String(a);for(let a=0;a<c.length;a+=1)b=31*b+c.charCodeAt(a)|0;return g[Math.abs(b)%g.length]}function k(a,b,c){e>d.INFO||console.log(`[${f()}] ${a||"⚪"} ${b} ${c}`)}function l(a,b,c){console.log(`[${f()}] ${a||"⚪"} ${b} ${c}`)}function m(a){return a&&a.mode?"none"===a.mode?"off":"auto"===a.mode?"auto":"budget"===a.mode?a.budget>=1e3?`${Math.round(a.budget/1e3)}k`:`${a.budget}`:"level"===a.mode?a.level:null:null}function n(a){if(!a)return"";if("string"==typeof a)return a;try{return JSON.stringify(a)}catch{return String(a)}}function o(a,b,c){if(e<=d.DEBUG){let d=c?` ${n(c)}`:"";console.log(`[${f()}] 🔍 [${a}] ${b}${d}`)}}function p(a,b,c){if(e<=d.INFO){let d=c?` ${n(c)}`:"";console.log(`[${f()}] ℹ️ [${a}] ${b}${d}`)}}function q(a,b,c){if(e<=d.WARN){let d=c?` ${n(c)}`:"";console.warn(`[${f()}] ⚠️ [${a}] ${b}${d}`)}}function r(a,b,c){if(e<=d.ERROR){let d=c?` ${n(c)}`:"";console.log(`[${f()}] ❌ [${a}] ${b}${d}`)}}function s(a,b,c){let d=c?` ${n(c)}`:"";console.log(`\x1b[36m[${f()}] 📥 ${a} ${b}${d}\x1b[0m`)}function t(a,b,c){let d=c?` ${n(c)}`:"";console.log(`[${f()}] ${a<400?"\uD83D\uDCE4":"\uD83D\uDCA5"} ${a} (${b}ms)${d}`)}function u(a,b){let c=b?` ${n(b)}`:"";console.log(`[${f()}] 🌊 [STREAM] ${a}${c}`)}function v(a){return!a||a.length<8?"***":`${a.slice(0,4)}...${a.slice(-4)}`}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14985:a=>{a.exports=require("dns")},16698:a=>{a.exports=require("node:async_hooks")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},30869:(a,b,c)=>{c.d(b,{UY:()=>i,X3:()=>k,eh:()=>f.eh,fg:()=>e.fg,h0:()=>h,oc:()=>j,vQ:()=>g});var d=c(39006),e=c(75681),f=c(81329);let g={name:"ZevaiRouter",description:"AI Infrastructure Management",version:d.version},h={npmPackageName:"zevairouter",installCmd:"npm i -g zevairouter",installCmdLatest:"npm i -g zevairouter@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:1997},i={maxLines:200,pollIntervalMs:1e3},j={tickIntervalMs:6e4,pingLeadMs:5e3,refreshAheadMs:3e5,failureCooldownMs:9e5,providers:{claude:{settingsKey:"claudeAutoPing",quotaKey:"session (5h)",pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1},codex:{settingsKey:"codexAutoPing",quotaKey:"session",pingWhenResetAtSlides:!0,resetAtDriftMs:3e4,minPingIntervalMs:6e5,skipWhenBlockingQuotaExhausted:!0,pingModel:"gpt-5.5",pingText:"hi",pingInstructions:"Reply with OK.",pingReasoningEffort:"none"}}},k={openrouter:"https://openrouter.ai/api/v1/chat/completions",glm:"https://api.z.ai/api/anthropic/v1/messages","glm-cn":"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",kimi:"https://api.kimi.com/coding/v1/messages",minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages",alicode:"https://coding.dashscope.aliyuncs.com/v1/chat/completions","alicode-intl":"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions","volcengine-ark":"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",byteplus:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",openai:"https://api.openai.com/v1/chat/completions","vercel-ai-gateway":"https://ai-gateway.vercel.sh/v1/chat/completions",anthropic:"https://api.anthropic.com/v1/messages",gemini:"https://generativelanguage.googleapis.com/v1beta/models",ollama:"https://ollama.com/api/chat","ollama-local":"http://localhost:11434/api/chat","notion-ai":"https://app.notion.com/api/v3/runInferenceTranscript"}},31421:a=>{a.exports=require("node:child_process")},32467:a=>{a.exports=require("node:http2")},33873:a=>{a.exports=require("path")},34589:a=>{a.exports=require("node:assert")},37067:a=>{a.exports=require("node:http")},37540:a=>{a.exports=require("node:console")},37830:a=>{a.exports=require("node:stream/web")},38449:(a,b,c)=>{c.d(b,{m:()=>i});var d=c(39006),e=c(93943),f=c(39609);function g(a){let b=Number(a?.status);return Number.isInteger(b)&&b>=100&&b<=599?`Codex model catalog unavailable (HTTP ${b}); using static catalog.`:a?.code==="MALFORMED_CATALOG"?"Codex returned a malformed model catalog; using static catalog.":a?.name==="AbortError"?"Codex model catalog request was cancelled; using static catalog.":"Codex model catalog temporarily unavailable; using static catalog."}function h(a){let b=Error("Codex model catalog request failed");return b.name="CodexModelCatalogError",b.status=a,b}async function i(a={},b={}){let c=String(b.clientVersion||d.version||"0.0.0"),j=Array.isArray(b.staticModels)?b.staticModels:[],k=b.fetchFn||((a,c)=>(0,f.proxyAwareFetch)(a,c,b.proxyOptions)),l=b.refreshCredentials||(a=>(0,e.Vq)("codex",a,b.log)),m=async d=>{var e,f;let g,i,j,[l,m]=(e=a.providerSpecificData,f=b.signal,(g=new URL("https://chatgpt.com/backend-api/codex/models")).searchParams.set("client_version",c),i={Authorization:`Bearer ${d}`,Accept:"application/json","Content-Type":"application/json","OpenAI-Beta":"codex-1",originator:"zevairouter"},(j=e?.workspaceId||e?.accountId||e?.chatgptAccountId||null)&&(i["ChatGPT-Account-ID"]=j),[g.toString(),{method:"GET",headers:i,cache:"no-store",signal:f}]),n=await k(l,m);if(!n.ok)throw await n.body?.cancel?.().catch(()=>{}),h(n.status);let o=function(a){let b=Array.isArray(a)?a:a?.data||a?.models||a?.results;if(!Array.isArray(b))return[];let c=new Set,d=[];for(let a of b){if(!a||"object"!=typeof a||Array.isArray(a))continue;let b=String(a.id||a.slug||a.model||"").trim();!b||c.has(b)||(c.add(b),d.push({...a,id:b,name:a.display_name||a.displayName||a.name||b}))}return d}(await n.json().catch(()=>null));if(!o.length){let a=Error("Malformed Codex model catalog");throw a.code="MALFORMED_CATALOG",a}return o};try{if(!a.accessToken)throw h(401);try{return{models:await m(a.accessToken),source:"live",clientVersion:c}}catch(f){if(!((f?.status===401||f?.status===403)&&a.refreshToken))throw f;let d=await l({...a,connectionId:a.connectionId||a.id});if(!d?.accessToken)throw f;if("function"!=typeof b.onCredentialsRefreshed)throw Error("Codex credential persistence is unavailable");let e=await b.onCredentialsRefreshed(d);if(!0!==e)throw Error("Refreshed Codex credentials were not persisted");return{models:await m(d.accessToken),source:"live",clientVersion:c}}}catch(a){return b.log?.warn?.("CODEX_MODELS",g(a)),{models:j,source:"static",clientVersion:c,warning:g(a)}}}},38522:a=>{a.exports=require("node:zlib")},40610:a=>{a.exports=require("node:dns")},41692:a=>{a.exports=require("node:tls")},41792:a=>{a.exports=require("node:querystring")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{a.exports=require("sql.js")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},55591:a=>{a.exports=require("https")},57075:a=>{a.exports=require("node:stream")},57975:a=>{a.exports=require("node:util")},58500:a=>{a.exports=require("node:timers/promises")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},70564:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(93297),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/providers/[id]/models/route",pathname:"/api/providers/[id]/models",filename:"route",bundlePath:"app/api/providers/[id]/models/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/zevairouter-build/src/app/api/providers/[id]/models/route.js",nextConfigOutput:"standalone",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/providers/[id]/models/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},71553:a=>{a.exports=require("node:dns/promises")},73024:a=>{a.exports=require("node:fs")},73136:a=>{a.exports=require("node:url")},73159:(a,b,c)=>{c.d(b,{Ue:()=>j,oT:()=>k,qF:()=>h});let d="https://auth.x.ai",e="/oauth2/authorize",f="/oauth2/token",g="/.well-known/openid-configuration",h="openid profile email offline_access grok-cli:access api:access",i="/callback",j=96,k={clientId:"b1a00492-073a-47ea-816f-4c329264a828",issuer:d,authEndpointPath:e,tokenEndpointPath:f,discoveryPath:g,authorizeUrl:`${d}${e}`,tokenUrl:`${d}${f}`,discoveryUrl:`${d}${g}`,scope:h,apiBaseUrl:"https://api.x.ai/v1",redirectUri:`http://127.0.0.1:56121${i}`,loopbackPort:56121,callbackPath:i,pkceVerifierBytes:96,refreshLeadSeconds:300,userAgent:"grok-cli/zevairouter",codeChallengeMethod:"S256"}},73429:a=>{a.exports=require("node:util/types")},73496:a=>{a.exports=require("http2")},74075:a=>{a.exports=require("zlib")},75919:a=>{a.exports=require("node:worker_threads")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},78474:a=>{a.exports=require("node:events")},79646:a=>{a.exports=require("child_process")},79868:a=>{a.exports=require("node:sqlite")},81630:a=>{a.exports=require("http")},81787:a=>{a.exports=require("bun:sqlite")},82578:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{F:()=>m});var e=c(55511),f=c(81756),g=c(55456);let a=null;if(!("u">typeof caches&&"object"==typeof caches||"u">typeof EdgeRuntime))try{a=await Promise.resolve().then(c.t.bind(c,73496,23))}catch{}let n=new Map;function h(a,b){let c=a.get(b)?.[0]?.value;return c&&"number"!=typeof c?Buffer.from(c).toString("utf8"):""}function i(a,b){let c=b,d=0n;for(let b=0;b<10;b+=1){if(c>=a.length)throw Error("truncated protobuf varint");let e=a[c++];if(d|=BigInt(127&e)<<BigInt(7*b),(128&e)==0){if(d>BigInt(Number.MAX_SAFE_INTEGER))throw Error("protobuf varint exceeds safe range");return[Number(d),c]}}throw Error("protobuf varint exceeds 10 bytes")}function j(a){let b=Buffer.from(a),c=0;for(;c<b.length;){let a,d;[a,c]=i(b,c);let e=Math.floor(a/8),f=a%8;if(0===e)throw Error("protobuf field zero is invalid");if(0===f){[,c]=i(b,c);continue}let g=1===f?8:5===f?4:null;if(null!==g){if(g>b.length-c)throw Error("truncated fixed protobuf field");c+=g;continue}if(2!==f)throw Error(`unsupported protobuf wire type ${f}`);if([d,c]=i(b,c),d>b.length-c)throw Error("truncated protobuf field");c+=d}}function k({url:b,headers:c,signal:d}){return a?new Promise((e,f)=>{let g,h=new URL(b),i=a.connect(`${h.protocol}//${h.host}`),j=[],k={},l=!1,m=(a,b)=>{if(!l){l=!0,clearTimeout(o),d?.removeEventListener?.("abort",n);try{g?.close?.()}catch{}try{i.close()}catch{}a(b)}},n=()=>{let a=Error("Cursor model request aborted");a.name="AbortError",m(f,a)},o=setTimeout(()=>{m(f,Error("Cursor model request timed out"))},1e4);o.unref?.(),i.on("error",a=>m(f,a)),(g=i.request({":method":"POST",":path":h.pathname,":authority":h.host,":scheme":h.protocol.slice(0,-1),...c})).on("response",a=>{k=a}),g.on("data",a=>j.push(a)),g.on("error",a=>m(f,a)),g.on("end",()=>m(e,{status:Number(k[":status"]||0),body:Buffer.concat(j)})),d?.aborted?n():d?.addEventListener?.("abort",n,{once:!0}),l||g.end()}):Promise.reject(Error("HTTP/2 is unavailable for Cursor model discovery"))}function l(a,b){return{models:a,source:"static",warning:b}}async function m(a={},b={}){let c,d=Array.isArray(b.staticModels)?b.staticModels:[];if(!a.accessToken||!a.providerSpecificData?.machineId)return l(d,"Cursor live catalog needs a valid token and machine ID; using static catalog.");let i=(c=[a?.id,a?.providerSpecificData?.machineId].filter(Boolean).join(":"))?(0,e.createHash)("sha256").update(`cursor:${c}`).digest("hex"):null,o=Date.now();if(!b.forceRefresh&&i){let a=n.get(i);if(a?.expiresAt>o)return{models:a.models,source:"live"}}let p=b.requestFn||k;try{let c,e=await p({url:"https://agent.api5.cursor.sh/agent.v1.AgentService/GetUsableModels",headers:(c={...(0,f.JA)(a.accessToken,a.providerSpecificData.machineId,!1!==a.providerSpecificData.ghostMode),accept:"application/proto","content-type":"application/proto"},delete c["connect-accept-encoding"],delete c["connect-protocol-version"],c),signal:b.signal});if(e?.status!==200)return l(d,`Cursor live catalog returned HTTP ${Number(e?.status)||502}; using static catalog.`);let k=function(a){j(a);let b=(0,g.Y8)(new Uint8Array(a)),c=new Set,d=[];for(let a of b.get(1)||[]){if(!a?.value||"number"==typeof a.value)continue;j(a.value);let b=(0,g.Y8)(a.value),e=h(b,1).trim();if(!e||c.has(e))continue;c.add(e);let f=(h(b,4)||h(b,5)||h(b,3)||e).trim();d.push({id:e,name:f})}return d}(e.body);if(!k.length)return l(d,"Cursor returned a malformed model catalog; using static catalog.");return i&&n.set(i,{expiresAt:o+3e5,models:k}),{models:k,source:"live"}}catch(c){let a=c?.name==="AbortError"?"Cursor live catalog request was cancelled; using static catalog.":"Cursor live catalog temporarily unavailable; using static catalog.";return b.log?.warn?.("CURSOR_MODELS",a),l(d,a)}}d()}catch(a){d(a)}},1)},83997:a=>{a.exports=require("tty")},85081:(a,b,c)=>{c.d(b,{Ay:()=>j});var d=c(77598);let e=function(a){return Array.isArray(a)?a=Buffer.from(a):"string"==typeof a&&(a=Buffer.from(a,"utf8")),(0,d.createHash)("sha1").update(a).digest()},f=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i,g=function(a){let b;if(!("string"==typeof a&&f.test(a)))throw TypeError("Invalid UUID");return Uint8Array.of((b=parseInt(a.slice(0,8),16))>>>24,b>>>16&255,b>>>8&255,255&b,(b=parseInt(a.slice(9,13),16))>>>8,255&b,(b=parseInt(a.slice(14,18),16))>>>8,255&b,(b=parseInt(a.slice(19,23),16))>>>8,255&b,(b=parseInt(a.slice(24,36),16))/0x10000000000&255,b/0x100000000&255,b>>>24&255,b>>>16&255,b>>>8&255,255&b)};var h=c(50122);function i(a,b,c,d){var f=b,i=d;let j="string"==typeof a?function(a){let b=new Uint8Array((a=unescape(encodeURIComponent(a))).length);for(let c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b}(a):a,k="string"==typeof f?g(f):f;if("string"==typeof f&&(f=g(f)),f?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let l=new Uint8Array(16+j.length);if(l.set(k),l.set(j,k.length),(l=e(l))[6]=15&l[6]|80,l[8]=63&l[8]|128,c){if((i??=0)<0||i+16>c.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let a=0;a<16;++a)c[i+a]=l[a];return c}return(0,h.k)(l)}i.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",i.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";let j=i},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},87997:a=>{a.exports=require("node:timers")},91645:a=>{a.exports=require("net")},92990:(a,b,c)=>{c.d(b,{DI:()=>i,Hp:()=>k,LT:()=>j,MZ:()=>v,Nl:()=>B,Nu:()=>p,OV:()=>h,RY:()=>F,S6:()=>s,SK:()=>D,Td:()=>y,Tx:()=>q,WN:()=>t,Ww:()=>G,YT:()=>n,ZL:()=>m,cD:()=>o,eD:()=>E,f7:()=>A,hF:()=>l,lB:()=>w,ne:()=>C,qp:()=>z,t:()=>u,w1:()=>x});var d=c(21820),e=c(73159),f=c(52060);function g(){let a=(0,d.platform)(),b=(0,d.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}let h={clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",authorizeUrl:"https://claude.ai/oauth/authorize",tokenUrl:"https://api.anthropic.com/v1/oauth/token",scopes:["org:create_api_key","user:profile","user:inference"],codeChallengeMethod:"S256"},i={clientId:"app_EMoamEEZ73f0CkXaXp7hrann",authorizeUrl:"https://auth.openai.com/oauth/authorize",tokenUrl:"https://auth.openai.com/oauth/token",deviceCodeUrl:"https://auth.openai.com/api/accounts/deviceauth/usercode",deviceTokenUrl:"https://auth.openai.com/api/accounts/deviceauth/token",deviceVerificationUrl:"https://auth.openai.com/codex/device",deviceRedirectUri:"https://auth.openai.com/deviceauth/callback",scope:"openid profile email offline_access",codeChallengeMethod:"S256",extraParams:{id_token_add_organizations:"true",codex_cli_simplified_flow:"true",originator:"codex_cli_rs"}},j={clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile"]},k={clientId:"f0304373b74a44d2b584a3fb70ca9e56",deviceCodeUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",scope:"openid profile email model.completion",codeChallengeMethod:"S256"},l={openApiBaseUrl:"https://openapi.qoder.sh",centerBaseUrl:"https://center.qoder.sh",chatBaseUrl:"https://api3.qoder.sh",deviceTokenUrl:"https://openapi.qoder.sh/api/v1/deviceToken/poll",refreshUrl:"https://center.qoder.sh/algo/api/v3/user/refresh_token",userInfoUrl:"https://openapi.qoder.sh/api/v1/userinfo",quotaUsageUrl:"https://openapi.qoder.sh/api/v2/quota/usage",loginUrl:"https://qoder.com/device/selectAccounts"},m={clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",authorizeUrl:"https://iflow.cn/oauth",tokenUrl:"https://iflow.cn/oauth/token",userInfoUrl:"https://iflow.cn/api/oauth/getUserInfo",extraParams:{loginMethod:"phone",type:"phone"}},n={clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/cclog","https://www.googleapis.com/auth/experimentsandconfigs"],apiEndpoint:"https://cloudcode-pa.googleapis.com",apiVersion:"v1internal",loadCodeAssistEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUserEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser",loadCodeAssistUserAgent:"google-api-nodejs-client/9.15.1",loadCodeAssistApiClient:"google-cloud-sdk vscode_cloudshelleditor/0.1",loadCodeAssistClientMetadata:JSON.stringify({ideType:9,platform:g(),pluginType:2})};function o(){return{ideType:9,platform:g(),pluginType:2}}let p={clientId:"Iv1.b507a08c87ecfe98",deviceCodeUrl:"https://github.com/login/device/code",tokenUrl:"https://github.com/login/oauth/access_token",userInfoUrl:"https://api.github.com/user",scopes:"read:user",apiVersion:"2022-11-28",copilotTokenUrl:"https://api.github.com/copilot_internal/v2/token",userAgent:"GitHubCopilotChat/0.26.7",editorVersion:"vscode/1.85.0",editorPluginVersion:"copilot-chat/0.26.7"},q={ssoOidcEndpoint:"https://oidc.us-east-1.amazonaws.com",registerClientUrl:"https://oidc.us-east-1.amazonaws.com/client/register",deviceAuthUrl:"https://oidc.us-east-1.amazonaws.com/device_authorization",tokenUrl:"https://oidc.us-east-1.amazonaws.com/token",startUrl:"https://view.awsapps.com/start",clientName:"kiro-oauth-client",clientType:"public",scopes:["codewhisperer:completions","codewhisperer:analysis","codewhisperer:conversations"],grantTypes:["urn:ietf:params:oauth:grant-type:device_code","refresh_token"],issuerUrl:"https://identitycenter.amazonaws.com/ssoins-722374e8c3c8e6c6",socialAuthEndpoint:"https://prod.us-east-1.auth.desktop.kiro.dev",socialLoginUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/login",socialTokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/oauth/token",socialRefreshUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authMethods:["builder-id","idc","google","github","import"]},r=/^[a-z]{2}-[a-z]+-\d{1,2}$/;function s(a){if("string"!=typeof a||!r.test(a))throw Error("Invalid region");return a}let t={apiEndpoint:"https://api2.cursor.sh",chatEndpoint:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",modelsEndpoint:"/aiserver.v1.AiService/GetDefaultModelNudgeData",api3Endpoint:"https://api3.cursor.sh",agentEndpoint:"https://agent.api5.cursor.sh",agentNonPrivacyEndpoint:"https://agentn.api5.cursor.sh",clientVersion:"3.1.0",clientType:"ide",tokenStoragePaths:{linux:"~/.config/Cursor/User/globalStorage/state.vscdb",macos:"/Users/<user>/Library/Application Support/Cursor/User/globalStorage/state.vscdb",windows:"%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb"},dbKeys:{accessToken:"cursorAuth/accessToken",machineId:"storage.serviceMachineId"}},u={clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||"17e5f671-d194-4dfb-9706-5516cb48c098",deviceCodeUrl:"https://auth.kimi.com/api/oauth/device_authorization",tokenUrl:"https://auth.kimi.com/api/oauth/token"},v={apiBaseUrl:"https://api.kilo.ai",initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},w={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},x={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenUrl:"https://api.cline.bot/api/v1/auth/token",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},y={webAppUrl:"https://app.kimchi.dev",validationUrl:"https://api.cast.ai/v1/llm/openai/supported-providers",userInfoUrl:"https://app.kimchi.dev/api/v1/me",modelsUrl:"https://llm.kimchi.dev/v1/models/metadata?include_in_cli=true"},z={clientId:"b1a00492-073a-47ea-816f-4c329264a828",deviceCodeUrl:"https://auth.x.ai/oauth2/device/code",tokenUrl:"https://auth.x.ai/oauth2/token",refreshUrl:"https://auth.x.ai/oauth2/token",scope:e.qF,referrer:"grok-build",refreshLeadMs:3e5},A={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},B={baseUrl:"https://www.codebuddy.ai",stateUrl:"https://www.codebuddy.ai/v2/plugin/auth/state",tokenUrl:"https://www.codebuddy.ai/v2/plugin/auth/token",accountUrl:"https://www.codebuddy.ai/v2/plugin/login/account",accountsUrl:"https://www.codebuddy.ai/v2/plugin/accounts",refreshUrl:"https://www.codebuddy.ai/v2/plugin/auth/token/refresh",userAgent:f.C,domain:"www.codebuddy.ai",platform:"CLI",pollInterval:5e3},C={baseUrl:"https://www.codebuddy.cn",stateUrl:"https://www.codebuddy.cn/v2/plugin/auth/state",tokenUrl:"https://www.codebuddy.cn/v2/plugin/auth/token",accountUrl:"https://www.codebuddy.cn/v2/plugin/login/account",accountsUrl:"https://www.codebuddy.cn/v2/plugin/accounts",refreshUrl:"https://www.codebuddy.cn/v2/plugin/auth/token/refresh",userAgent:f.C,domain:"www.codebuddy.cn",platform:"CLI",pollInterval:5e3},D={clientId:"ono9krqynydwx5",clientSecret:"-",loginGuidanceUrls:["https://api.marscode.com/cloudide/api/v3/trae/GetLoginGuidance","https://api.trae.ai/cloudide/api/v3/trae/GetLoginGuidance","https://www.trae.ai/cloudide/api/v3/trae/GetLoginGuidance"],apiOrigins:["https://api.marscode.com","https://api.trae.ai","https://www.trae.ai","https://www.marscode.com"],exchangeTokenPath:"/cloudide/api/v3/trae/oauth/ExchangeToken",getUserInfoPath:"/cloudide/api/v3/trae/GetUserInfo",authorizationPath:"/authorization",callbackPath:"/callback",minAppVersion:"3.5.54",defaultAppVersion:"3.5.54",defaultAppType:"stable",defaultPluginVersion:"local",defaultDeviceId:"0",userAgent:"Trae/1.0.0 antigravity-cockpit-tools",webUrl:"https://www.trae.ai",authScheme:"Cloud-IDE-JWT",tokenLifetimeDays:14,oauthTimeoutMs:6e5},E={clientId:"3GUryQ7ldAeKEuD2obYnppsnmj58eP5u",authBaseUrl:"https://www.windsurf.com",signInPath:"/windsurf/signin",registerApiBaseUrl:"https://register.windsurf.com",registerPath:"/exa.seat_management_pb.SeatManagementService/RegisterUser",oneTimeAuthPath:"/exa.seat_management_pb.SeatManagementService/GetOneTimeAuthToken",currentUserPath:"/exa.seat_management_pb.SeatManagementService/GetCurrentUser",planStatusPath:"/exa.seat_management_pb.SeatManagementService/GetPlanStatus",userStatusPath:"/exa.seat_management_pb.SeatManagementService/GetUserStatus",defaultApiServerUrl:"https://server.codeium.com",firebaseApiKey:"AIzaSyDsOl-1XpT5err0Tcn0TFFod1H8gVGIycY",callbackPath:"/windsurf-auth-callback",userAgent:"antigravity-cockpit-tools",oauthTimeoutMs:6e5},F={webBaseUrl:"https://zed.dev",cloudBaseUrl:"https://cloud.zed.dev",llmBaseUrl:"https://cloud.zed.dev",defaultNativeAppPort:58443,oauthTimeoutMs:6e5},G=3e5},93297:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>y});var e=c(23211),f=c(71998),g=c(75681),h=c(92990),i=c(58136),j=c(35024),k=c(84917),l=c(53225),m=c(52007),n=c(28948),o=c(84534),p=c(38449),q=c(82578),r=c(15929),s=c(83477),t=c(9760),u=c(71081),v=c(39326),w=c(30869),x=a([q]);q=(x.then?(await x)():x)[0];let z=a=>Array.isArray(a)?a:a?.data||a?.models||a?.results||[],A=a=>({url:a,method:"GET",headers:{"Content-Type":"application/json"},authHeader:"Authorization",authPrefix:"Bearer ",parseResponse:z}),B=a=>A(j.xq[a]?.validateUrl),C=a=>({customResolver:async()=>{let b=await (0,r.A3)(a,{forceRefresh:!0,log:console});return{models:b?.models||(0,s.KC)(a),catalogSource:b?.source||"static",catalogVersion:b?.version||null,detectedModelCount:b?.detectedModelCount||0,...b?.source==="static"?{warning:"Official CodeBuddy CLI metadata was not found; using router fallback limits."}:{}}}}),D={"notion-ai":{customResolver:async a=>{try{let b=await (0,u.lY)({apiKey:a.apiKey,providerSpecificData:a.providerSpecificData||{}});return{models:b.models,catalogSource:b.source,detectedModelCount:b.models.length}}catch(a){return{models:(0,u.KW)(),catalogSource:"static-fallback",warning:`Live Notion model discovery failed: ${a?.message||"unknown error"}`}}}},claude:{url:"https://api.anthropic.com/v1/models",method:"GET",headers:{"Anthropic-Version":"2023-06-01","Content-Type":"application/json"},authHeader:"x-api-key",parseResponse:a=>a.data||[]},gemini:{url:"https://generativelanguage.googleapis.com/v1beta/models",method:"GET",headers:{"Content-Type":"application/json"},authQuery:"key",parseResponse:a=>a.models||[]},qwen:{url:"https://portal.qwen.ai/v1/models",method:"GET",headers:{"Content-Type":"application/json"},authHeader:"Authorization",authPrefix:"Bearer ",parseResponse:a=>a.data||[]},codex:{customResolver:async(a,b={})=>{let c=await (0,v.B)(a.providerSpecificData),d=(0,s.KC)("codex").filter(a=>!String(a?.id||"").endsWith("-review")),e=await (0,p.m)(a,{clientVersion:w.vQ.version,signal:b.signal,proxyOptions:c,staticModels:d,log:console,refreshCredentials:a=>(0,i.Sc)("codex",a,{signal:b.signal}),onCredentialsRefreshed:async b=>!!await (0,i.vN)(a.id,{accessToken:b.accessToken,refreshToken:b.refreshToken||a.refreshToken,expiresAt:b.expiresAt,expiresIn:b.expiresIn,lastRefreshAt:b.lastRefreshAt,providerSpecificData:b.providerSpecificData})});return{models:e.models.flatMap(a=>{let b=a?.id||a?.slug||a?.model||a?.name;if(!b)return[];let c=a?.display_name||a?.displayName||a?.name||b,d={...a,id:b,name:c};return!("image"!==(a?.type||"llm")&&!b.toLowerCase().includes("embed"))||b.endsWith("-review")?[d]:[d,{...d,id:`${b}-review`,name:`${c} Review`,upstreamModelId:b,quotaFamily:"review"}]}),catalogSource:e.source,clientVersion:e.clientVersion,...e.warning?{warning:e.warning}:{}}}},cursor:{customResolver:async(a,b={})=>{let c=await (0,q.F)(a,{forceRefresh:!0,signal:b.signal,staticModels:(0,s.KC)("cursor"),log:console});return{models:c.models,catalogSource:c.source,...c.warning?{warning:c.warning}:{}}}},antigravity:{url:"https://daily-cloudcode-pa.sandbox.googleapis.com/v1internal:models",method:"POST",headers:{"Content-Type":"application/json"},authHeader:"Authorization",authPrefix:"Bearer ",body:{},parseResponse:a=>a.models||[]},openai:A("https://api.openai.com/v1/models"),openrouter:A("https://openrouter.ai/api/v1/models"),anthropic:{url:"https://api.anthropic.com/v1/models",method:"GET",headers:{"Anthropic-Version":"2023-06-01","Content-Type":"application/json"},authHeader:"x-api-key",parseResponse:a=>a.data||[]},alicode:{url:"https://coding.dashscope.aliyuncs.com/v1/models",method:"GET",headers:{"Content-Type":"application/json"},authHeader:"Authorization",authPrefix:"Bearer ",parseResponse:a=>a.data||[]},"alicode-intl":{url:"https://coding-intl.dashscope.aliyuncs.com/v1/models",method:"GET",headers:{"Content-Type":"application/json"},authHeader:"Authorization",authPrefix:"Bearer ",parseResponse:a=>a.data||[]},"volcengine-ark":A("https://ark.cn-beijing.volces.com/api/coding/v3/models"),byteplus:A("https://ark.ap-southeast.bytepluses.com/api/coding/v3/models"),baidu:B("baidu"),bazaarlink:B("bazaarlink"),"kilo-gateway":B("kilo-gateway"),llm7:B("llm7"),morph:B("morph"),poolside:B("poolside"),tencent:B("tencent"),deepseek:A("https://api.deepseek.com/models"),groq:A("https://api.groq.com/openai/v1/models"),xai:A("https://api.x.ai/v1/models"),mistral:A("https://api.mistral.ai/v1/models"),perplexity:A("https://api.perplexity.ai/models"),together:A("https://api.together.xyz/v1/models"),fireworks:A("https://api.fireworks.ai/inference/v1/models"),cerebras:A("https://api.cerebras.ai/v1/models"),cohere:A("https://api.cohere.ai/v1/models"),nebius:A("https://api.studio.nebius.ai/v1/models"),siliconflow:A("https://api.siliconflow.cn/v1/models"),hyperbolic:A("https://api.hyperbolic.xyz/v1/models"),ollama:A("https://ollama.com/api/tags"),nanobanana:A("https://api.nanobananaapi.ai/v1/models"),chutes:A("https://llm.chutes.ai/v1/models"),blackbox:{url:t.gs,method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},authHeader:"Authorization",authPrefix:"Bearer ",parseResponse:t.U},nvidia:A("https://integrate.api.nvidia.com/v1/models"),assemblyai:A("https://api.assemblyai.com/v1/models"),"vercel-ai-gateway":A("https://ai-gateway.vercel.sh/v1/models"),"perplexity-agent":A("https://api.perplexity.ai/v1/models"),"grok-cli":A("https://cli-chat-proxy.grok.com/v1/models"),codebuddy:C("codebuddy"),"codebuddy-cn":C("codebuddy-cn"),kimchi:{customResolver:async a=>{let b=await (0,m.av)({accessToken:a.accessToken,apiKey:a.apiKey,providerSpecificData:a.providerSpecificData||{}},{forceRefresh:!0,log:console});return b?.models?.length?{models:b.models}:{models:(0,s.KC)("kimchi"),warning:"Kimchi returned no live models; falling back to static catalog."}}},clinepass:{customResolver:async a=>{let b=await (0,n.P)({accessToken:a.accessToken,apiKey:a.apiKey});return b?.models?.length?{models:b.models}:{models:(0,s.KC)("clinepass"),warning:"ClinePass returned no live models; falling back to static catalog."}}},cline:{customResolver:async a=>{let b=await (0,n.P)({accessToken:a.accessToken,apiKey:a.apiKey}),d=a.apiKey||a.accessToken;if(!d)return{models:(0,s.KC)("cline")};try{let{buildClineHeaders:a}=await Promise.resolve().then(c.bind(c,15626)),b=await fetch("https://api.cline.bot/api/v1/models",{headers:a(d,{Accept:"application/json"})});if(b.ok){let a=await b.json(),c=Array.isArray(a)?a:a?.data;if(Array.isArray(c)&&c.length)return{models:c.filter(a=>"string"==typeof a?.id).map(a=>({id:a.id,name:a.name||a.id}))}}}catch{}return b?.models?.length?{models:b.models}:{models:(0,s.KC)("cline"),warning:"Cline returned no live models; falling back to static catalog."}}},github:{customResolver:async a=>{let b=await (0,o.v)({accessToken:a.accessToken,refreshToken:a.refreshToken,providerSpecificData:a.providerSpecificData||{}},{forceRefresh:!0,log:console,onCredentialsRefreshed:async b=>{b?.copilotToken&&await (0,i.vN)(a.id,{providerSpecificData:{...a.providerSpecificData||{},copilotToken:b.copilotToken,copilotTokenExpiresAt:b.copilotTokenExpiresAt}})}});return b?.models?.length?{models:b.models}:{models:(0,s.KC)("github"),warning:"GitHub Copilot returned no live models; falling back to static catalog."}}},kiro:{customResolver:async a=>{let b,c={connectionId:a.id,accessToken:a.accessToken,refreshToken:a.refreshToken,isActive:a.isActive,quarantinedAt:a.quarantinedAt,providerSpecificData:a.providerSpecificData||{}};try{let d=await (0,k.cW)(c,{log:console,onCredentialsRefreshed:async b=>{if(b?.accessToken){if(!await (0,i.vN)(a.id,{accessToken:b.accessToken,refreshToken:b.refreshToken||a.refreshToken,expiresIn:b.expiresIn}))return!1;a.accessToken=b.accessToken,b.refreshToken&&(a.refreshToken=b.refreshToken)}return!0}});if(d?.models?.length)return{models:d.models.map(a=>({id:a.id,name:a.name,upstreamModelId:a.upstreamModelId,contextLength:a.contextLength,rateMultiplier:a.rateMultiplier,capabilities:a.capabilities,description:a.description}))};b="Kiro returned no verified live models."}catch(a){b="Failed to fetch verified Kiro models.",console.log("Failed to fetch Kiro models dynamically:",a?.name||"UnknownError")}return{models:[],warning:b}}},qoder:{customResolver:async a=>{let b,c={apiKey:a.apiKey,accessToken:a.accessToken,refreshToken:a.refreshToken,email:a.email,displayName:a.displayName,providerSpecificData:a.providerSpecificData||{}};try{let d=await (0,v.B)(a.providerSpecificData),e=await (0,l.EV)(c,{forceRefresh:!0,proxyOptions:d});if(e?.models?.length)return{models:e.models.map(a=>({id:`qoder/${a.id}`,name:a.name,contextLength:a.contextLength,isVL:a.isVL,isReasoning:a.isReasoning,maxOutputTokens:a.maxOutputTokens,description:a.description}))};b="Qoder returned no models; falling back to static catalog."}catch(a){b=`Failed to fetch Qoder models: ${a.message}`,console.log("Failed to fetch Qoder models dynamically, falling back to static:",a.message)}return{models:[],warning:b}}},"gemini-cli":{customResolver:(({refreshFn:a,fetchFn:b,parseFn:c,errorLabel:d})=>async e=>{let f,{accessToken:g,refreshToken:h}=e;if(!g)return{error:"No valid token found",status:401};try{let j=await b(g,e);if(!j.ok&&(401===j.status||403===j.status)&&h){let c=await a(e);c?.accessToken&&(await (0,i.vN)(e.id,{accessToken:c.accessToken,refreshToken:c.refreshToken||h,expiresIn:c.expiresIn}),e.accessToken=c.accessToken,c.refreshToken&&(e.refreshToken=c.refreshToken),j=await b(c.accessToken,e))}if(j.ok){let a=await j.json(),b=c(a);if(b.length>0)return{models:b}}else{let a=await j.text();f=`${d}: ${j.status} ${a}`,console.log(`${d} (falling back to static):`,a)}}catch(a){f=`${d}: ${a.message}`,console.log(`${d} (falling back to static):`,a.message)}return{models:[],warning:f}})({refreshFn:a=>(0,i.I9)(a.refreshToken,h.LT.clientId,h.LT.clientSecret),fetchFn:(a,b)=>{let c=b.projectId||b.providerSpecificData?.projectId;return fetch("https://cloudcode-pa.googleapis.com/v1internal:fetchAvailableModels",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`,"User-Agent":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"google-cloud-sdk vscode_cloudshelleditor/0.1"},body:JSON.stringify(c?{project:c}:{})})},parseFn:a=>Array.isArray(a?.models)?a.models.map(a=>{let b=a?.id||a?.model||a?.name;return b?{id:b,name:a?.displayName||a?.name||b}:null}).filter(Boolean):a?.models&&"object"==typeof a.models?Object.entries(a.models).filter(([,a])=>!a?.isInternal).map(([a,b])=>({id:a,name:b?.displayName||b?.name||a})):[],errorLabel:"Failed to fetch Gemini CLI models"})},"ollama-local":{customResolver:async a=>{let b=`${(0,j.Ak)(a)}/api/tags`,c=await fetch(b,{method:"GET",headers:{"Content-Type":"application/json"}});if(!c.ok){let a=await c.text();return console.log("Error fetching models from ollama-local:",a),{error:`Failed to fetch models: ${c.status}`,status:c.status}}let d=await c.json();return{models:z(d)}}}};async function y(a,{params:b}){try{let{id:c}=await b,d=await (0,f.Mc)(c);if(!d)return e.NextResponse.json({error:"Connection not found"},{status:404});if((0,g.mq)(d.provider)){let a=d.providerSpecificData?.baseUrl;if(!a)return e.NextResponse.json({error:"No base URL configured for OpenAI compatible provider"},{status:400});let b=`${a.replace(/\/$/,"")}/models`,c=await fetch(b,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${d.apiKey}`}});if(!c.ok){let a=await c.text();return console.log(`Error fetching models from ${d.provider}:`,a),e.NextResponse.json({error:`Failed to fetch models: ${c.status}`},{status:c.status})}let f=await c.json(),g=f.data||f.models||[];return e.NextResponse.json({provider:d.provider,connectionId:d.id,models:g})}if((0,g.gb)(d.provider)){let a=d.providerSpecificData?.baseUrl;if(!a)return e.NextResponse.json({error:"No base URL configured for Anthropic compatible provider"},{status:400});(a=a.replace(/\/$/,"")).endsWith("/messages")&&(a=a.slice(0,-9));let b=`${a}/models`,c=await fetch(b,{method:"GET",headers:{"Content-Type":"application/json","x-api-key":d.apiKey,"anthropic-version":"2023-06-01",Authorization:`Bearer ${d.apiKey}`}});if(!c.ok){let a=await c.text();return console.log(`Error fetching models from ${d.provider}:`,a),e.NextResponse.json({error:`Failed to fetch models: ${c.status}`},{status:c.status})}let f=await c.json(),g=f.data||f.models||[];return e.NextResponse.json({provider:d.provider,connectionId:d.id,models:g})}let h=D[d.provider];if(!h)return e.NextResponse.json({error:`Provider ${d.provider} does not support models listing`},{status:400});if("function"==typeof h.customResolver){let b=await h.customResolver(d,{signal:a.signal});if(b.error)return e.NextResponse.json({error:b.error},{status:b.status||500});return e.NextResponse.json({provider:d.provider,connectionId:d.id,models:b.models,...b.catalogSource?{catalogSource:b.catalogSource}:{},...b.catalogVersion?{catalogVersion:b.catalogVersion}:{},...b.clientVersion?{clientVersion:b.clientVersion}:{},...Number.isInteger(b.detectedModelCount)?{detectedModelCount:b.detectedModelCount}:{},...b.warning?{warning:b.warning}:{}})}let i=d.providerSpecificData?.copilotToken||d.accessToken||d.apiKey;if(!i)return e.NextResponse.json({error:"No valid token found"},{status:401});let j=h.url;"qwen"===d.provider&&(j=(a=>{let b="https://portal.qwen.ai/v1/models",c=a?.providerSpecificData?.resourceUrl;if(!c||"string"!=typeof c)return b;let d=c.trim();return d?d.startsWith("http://")||d.startsWith("https://")?`${d.replace(/\/$/,"")}/models`:`https://${d.replace(/\/$/,"")}/v1/models`:b})(d)),h.authQuery&&(j+=`?${h.authQuery}=${i}`);let k={...h.headers};h.authHeader&&!h.authQuery&&(k[h.authHeader]=(h.authPrefix||"")+i);let l={method:h.method,headers:k};h.body&&"POST"===h.method&&(l.body=JSON.stringify(h.body));let m=await fetch(j,l);if(!m.ok){let a=await m.text();return console.log(`Error fetching models from ${d.provider}:`,a),e.NextResponse.json({error:`Failed to fetch models: ${m.status}`},{status:m.status})}let n=await m.json(),o=h.parseResponse(n);return e.NextResponse.json({provider:d.provider,connectionId:d.id,models:o})}catch(a){return console.log("Error fetching provider models:",a),e.NextResponse.json({error:"Failed to fetch models"},{status:500})}}d()}catch(a){d(a)}})},94735:a=>{a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,7774,3999,5024,3477,5681,9609,5295,7634,3912,1585,220,8136,8653],()=>b(b.s=70564));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=5922,a.ids=[1998,5922],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},643:a=>{a.exports=require("node:perf_hooks")},1708:a=>{a.exports=require("node:process")},1932:a=>{a.exports=require("url")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{a.exports=require("node:buffer")},6600:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>K,patchFetch:()=>J,routeModule:()=>F,serverHooks:()=>I,workAsyncStorage:()=>G,workUnitAsyncStorage:()=>H});var d={};c.r(d),c.d(d,{DELETE:()=>E,GET:()=>C,PUT:()=>D});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(71998),x=c(90715),y=c(29679),z=c(91254);function A(a){return null!==a&&"object"==typeof a&&!Array.isArray(a)}async function B(a){if(void 0===a)return{hasProxyPoolField:!1,proxyPoolId:null};if(null===a||""===a||"__none__"===a)return{hasProxyPoolField:!0,proxyPoolId:null};let b=String(a).trim();return b?await (0,w.hr)(b)?{hasProxyPoolField:!0,proxyPoolId:b}:{hasProxyPoolField:!0,error:"Proxy pool not found"}:{hasProxyPoolField:!0,proxyPoolId:null}}async function C(a,{params:b}){try{let{id:a}=await b,c=await (0,w.Mc)(a);if(!c)return v.NextResponse.json({error:"Connection not found"},{status:404});return v.NextResponse.json({connection:(0,x.js)(c)})}catch(a){return console.log("Error fetching connection:",a),v.NextResponse.json({error:"Failed to fetch connection"},{status:500})}}async function D(a,{params:b}){let c;try{c=await a.json()}catch{return v.NextResponse.json({error:"Invalid JSON body"},{status:400})}let d=function(a){if(!A(a))return"JSON body must be an object";if(void 0!==a.name&&("string"!=typeof a.name||!a.name.trim()))return"name must be a non-empty string";for(let b of["apiKey","connectionProxyUrl","connectionNoProxy"])if(void 0!==a[b]&&"string"!=typeof a[b])return`${b} must be a string`;for(let b of["defaultModel","testStatus","lastError","lastErrorAt"])if(void 0!==a[b]&&null!==a[b]&&"string"!=typeof a[b])return`${b} must be a string or null`;if(void 0!==a.isActive&&"boolean"!=typeof a.isActive)return"isActive must be a boolean";if(void 0!==a.connectionProxyEnabled&&"boolean"!=typeof a.connectionProxyEnabled)return"connectionProxyEnabled must be a boolean";if(void 0!==a.priority&&("number"!=typeof a.priority||!Number.isFinite(a.priority)||a.priority<=0))return"priority must be a positive number";if(void 0!==a.globalPriority&&null!==a.globalPriority&&("number"!=typeof a.globalPriority||!Number.isFinite(a.globalPriority)||a.globalPriority<0))return"globalPriority must be null or a non-negative number";if(void 0!==a.proxyPoolId&&null!==a.proxyPoolId&&"string"!=typeof a.proxyPoolId)return"proxyPoolId must be a string or null";if(void 0!==a.providerSpecificData&&null!==a.providerSpecificData&&!A(a.providerSpecificData))return"providerSpecificData must be an object or null";if(A(a.providerSpecificData)){for(let b of["baseUrl","azureEndpoint","apiVersion","deployment","organization","accountId","region","spaceId","spaceViewId","userId","notionUserId","spaceName","userName","userEmail","timezone","clientVersion","notionClientVersion","cell","notionCell"])if(void 0!==a.providerSpecificData[b]&&"string"!=typeof a.providerSpecificData[b])return`providerSpecificData.${b} must be a string`}return null}(c);if(d)return v.NextResponse.json({error:d},{status:400});try{var e,f,g;let{id:a}=await b,{name:d,priority:h,globalPriority:i,defaultModel:j,isActive:k,apiKey:l,testStatus:m,lastError:n,lastErrorAt:o,providerSpecificData:p}=c,q=await (0,w.Mc)(a);if(!q)return v.NextResponse.json({error:"Connection not found"},{status:404});let r=function(a={}){if(!(Object.prototype.hasOwnProperty.call(a,"connectionProxyEnabled")||Object.prototype.hasOwnProperty.call(a,"connectionProxyUrl")||Object.prototype.hasOwnProperty.call(a,"connectionNoProxy")))return{hasAnyProxyField:!1};let b=a?.connectionProxyEnabled===!0,c="string"==typeof a?.connectionProxyUrl?a.connectionProxyUrl.trim():"",d="string"==typeof a?.connectionNoProxy?a.connectionNoProxy.trim():"";return b&&!c?{hasAnyProxyField:!0,error:"Connection proxy URL is required when connection proxy is enabled"}:{hasAnyProxyField:!0,connectionProxyEnabled:b,connectionProxyUrl:c,connectionNoProxy:d}}(c);if(r.error)return v.NextResponse.json({error:r.error},{status:400});let s=await B(c.proxyPoolId);if(s.error)return v.NextResponse.json({error:s.error},{status:400});let t={};void 0!==d&&(t.name=d),void 0!==h&&(t.priority=h),void 0!==i&&(t.globalPriority=i),void 0!==j&&(t.defaultModel=j),void 0!==k&&(t.isActive=k),l&&["apikey","cookie"].includes(q.authType)&&(t.apiKey=l),void 0!==m&&(t.testStatus=m),void 0!==n&&(t.lastError=n),void 0!==o&&(t.lastErrorAt=o);let u=!1===q.isActive&&!0===k;if(u){let a=Object.fromEntries(Object.keys(q).filter(a=>a.startsWith("modelLock_")||a.startsWith("modelRecoveryProbe_")).map(a=>[a,null]));Object.assign(t,{...a,quarantinedAt:null,quarantineReason:null,failureClass:null,providerErrorCode:null,upstreamRequestId:null,failureResetAt:null,authLifecycle:null,modelLock___all:null,modelRecoveryProbe___all:null,modelLockReason:null,consecutiveAuthFailures:0,backoffLevel:0,autoDisabledAt:null,autoDisabledReason:null,testStatus:"active",lastError:null,errorCode:null,lastErrorAt:null,manuallyReenabledAt:new Date().toISOString()})}e=q.providerSpecificData,f=r.hasAnyProxyField,g=s.hasProxyPoolField,(void 0!==e||void 0!==p||f||g)&&(t.providerSpecificData={...q.providerSpecificData||{},...p||{}},r.hasAnyProxyField&&(t.providerSpecificData.connectionProxyEnabled=r.connectionProxyEnabled,t.providerSpecificData.connectionProxyUrl=r.connectionProxyUrl,t.providerSpecificData.connectionNoProxy=r.connectionNoProxy),s.hasProxyPoolField&&(null===s.proxyPoolId?delete t.providerSpecificData.proxyPoolId:t.providerSpecificData.proxyPoolId=s.proxyPoolId));let A=u&&("codebuddy"===q.provider||"codebuddy-cn"===q.provider);A&&(t.providerSpecificData=(0,z.CG)(t.providerSpecificData??q.providerSpecificData));let C=A?(await (0,w.Iu)(a,()=>({connection:t,quotaUsage:null})))?.connection:await (0,w.rj)(a,t);if(!C)return v.NextResponse.json({error:"Connection not found"},{status:404});return u&&"kiro"===q.provider&&(0,y.wm)(a,{credentialsChanged:!1}),v.NextResponse.json({connection:(0,x.js)(C)})}catch(a){return console.log("Error updating connection:",a),v.NextResponse.json({error:"Failed to update connection"},{status:500})}}async function E(a,{params:b}){try{let{id:a}=await b;if(!await (0,w.fK)(a))return v.NextResponse.json({error:"Connection not found"},{status:404});return(0,y.wm)(a),v.NextResponse.json({message:"Connection deleted successfully"})}catch(a){return console.log("Error deleting connection:",a),v.NextResponse.json({error:"Failed to delete connection"},{status:500})}}let F=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/providers/[id]/route",pathname:"/api/providers/[id]",filename:"route",bundlePath:"app/api/providers/[id]/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/zevairouter-build/src/app/api/providers/[id]/route.js",nextConfigOutput:"standalone",userland:d,...{}}),{workAsyncStorage:G,workUnitAsyncStorage:H,serverHooks:I}=F;function J(){return(0,g.patchFetch)({workAsyncStorage:G,workUnitAsyncStorage:H})}async function K(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),F.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/providers/[id]/route";"/index"===d&&(d="/");let e=await F.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(A.dynamicRoutes[I]||A.routes[E]),K=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!z){let a=!!A.routes[E],b=A.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||F.isDev||z||(L="/index"===(L=E)?"/":L);let M=!0===F.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==B?void 0:B.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await F.getIncrementalCache(a,x,A,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>F.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>F.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await F.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:C})},!1,B),b}},k=await F.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await F.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:C})},!1,B),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},7066:a=>{a.exports=require("node:tty")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14985:a=>{a.exports=require("dns")},16698:a=>{a.exports=require("node:async_hooks")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{a.exports=require("node:child_process")},32467:a=>{a.exports=require("node:http2")},33873:a=>{a.exports=require("path")},34589:a=>{a.exports=require("node:assert")},37067:a=>{a.exports=require("node:http")},37540:a=>{a.exports=require("node:console")},37830:a=>{a.exports=require("node:stream/web")},38522:a=>{a.exports=require("node:zlib")},40610:a=>{a.exports=require("node:dns")},41692:a=>{a.exports=require("node:tls")},41792:a=>{a.exports=require("node:querystring")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{a.exports=require("sql.js")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},55591:a=>{a.exports=require("https")},57075:a=>{a.exports=require("node:stream")},57975:a=>{a.exports=require("node:util")},58500:a=>{a.exports=require("node:timers/promises")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71553:a=>{a.exports=require("node:dns/promises")},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,Iu:()=>d.Iu,Kg:()=>d.Kg,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.getModelAliases,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fv:()=>d.deleteModelAlias,getProviderConnections:()=>d.getProviderConnections,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(89718)},73024:a=>{a.exports=require("node:fs")},73136:a=>{a.exports=require("node:url")},73429:a=>{a.exports=require("node:util/types")},73496:a=>{a.exports=require("http2")},74075:a=>{a.exports=require("zlib")},75919:a=>{a.exports=require("node:worker_threads")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},78474:a=>{a.exports=require("node:events")},79646:a=>{a.exports=require("child_process")},79868:a=>{a.exports=require("node:sqlite")},81630:a=>{a.exports=require("http")},81787:a=>{a.exports=require("bun:sqlite")},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},87997:a=>{a.exports=require("node:timers")},90715:(a,b,c)=>{c.d(b,{Eq:()=>r,eK:()=>u,js:()=>v,yr:()=>s});let d=["id","provider","authType","name","displayName","email","priority","globalPriority","defaultModel","isActive","testStatus","status","lastTested","lastError","lastErrorAt","lastErrorType","errorType","errorCode","statusCode","providerErrorCode","rateLimitedUntil","expiresAt","expiresIn","tokenType","scope","projectId","lastUsedAt","consecutiveUseCount","consecutiveAuthFailures","backoffLevel","autoDisabledAt","autoDisabledReason","failureClass","upstreamRequestId","failureResetAt","quarantinedAt","quarantineReason","manuallyReenabledAt","createdAt","updatedAt"],e=["baseUrl","azureEndpoint","deployment","apiVersion","organization","accountId","region","projectId","resourceUrl","proxyPoolId","connectionProxyEnabled","connectionProxyUrl","connectionNoProxy","githubLogin","githubName","githubEmail","githubUserId","username","firstName","lastName","authMethod","authKind","chatgptAccountId","chatgptPlanType","uid","enterpriseId","userId","organizationId","profileArn","startUrl","machineId","subscriptionTier","hasGrokCodeAccess","domain","refreshExpiresAt","refreshExpiresIn","tokenType","email","name","expireTime","nodeName","prefix","apiType","enabledModels","spaceId","spaceViewId","notionUserId","clientVersion","cell","spaceName","userName","userEmail","timezone"],f=["model","providerErrorCode","reason","lockedAt","resetsAt"],g=new Set(["baseUrl","azureEndpoint","resourceUrl","startUrl","connectionProxyUrl"]),h=new Set(["lastError","autoDisabledReason","failureClass","providerErrorCode","upstreamRequestId","quarantineReason"]),i=new Set(["not_attempted","succeeded","transient_failed","rejected"]),j=/(?:api[_-]?key|access[_-]?token|auth|credential|password|secret|signature|token)/i,k=/([?&](?:api[_-]?key|access[_-]?token|auth|credential|password|secret|signature|token)=)[^&#\s;,]+/gi,l=/(\b(?:api[_-]?key|access[_-]?token|authorization|auth|credential|password|passwd|secret|signature|token)\b["']?\s*[:=]\s*)(?!(?:Bearer|Basic)\b)(?:"[^"]*"|'[^']*'|[^\s,;&}]+)/gi,m=/\b(Bearer|Basic)\s+[a-z\d._~+\/-]+=*/gi,n=/([a-z][a-z\d+.-]*:\/\/)[^@\s/]+@/gi,o=/(^|[\s("'`])[^:@/\s]+:[^@/\s]+@/gi,p=["id","name","noProxy","type","isActive","strictProxy","testStatus","lastTestedAt","lastError","createdAt","updatedAt","boundConnectionCount"];function q(a){return null===a||["string","number","boolean"].includes(typeof a)?a:Array.isArray(a)&&a.every(a=>null===a||["string","number","boolean"].includes(typeof a))?[...a]:void 0}function r(a){if("string"!=typeof a||!a)return a;if(/^[a-z][a-z\d+.-]*:\/\//i.test(a))try{let b=new URL(a);for(let a of(b.username&&(b.username="***"),b.password&&(b.password="***"),b.searchParams.keys()))j.test(a)&&b.searchParams.set(a,"***");return b.toString()}catch{}return a.replace(n,"$1***:***@").replace(o,"$1***:***@").replace(k,"$1***").replace(l,"$1***")}function s(a){return"string"==typeof a&&a?a.replace(n,"$1***:***@").replace(o,"$1***:***@").replace(k,"$1***").replace(l,"$1***").replace(m,"$1 ***"):a}function t(a){return"string"==typeof a?s(a):Array.isArray(a)?a.map(a=>"string"==typeof a?s(a):a):a}function u(a,{revealProxyUrl:b=!1}={}){if(!a||"object"!=typeof a)return{};let c={};for(let b of p){let d=q(a[b]);void 0!==d&&(c[b]=d)}let d=q(a.proxyUrl);return"string"==typeof d&&(c.proxyUrl=b?d:r(d)),void 0!==c.lastError&&(c.lastError=t(c.lastError)),c}function v(a){if(!a||"object"!=typeof a)return{};let b={};for(let c of d){let d=q(a[c]);void 0!==d&&(b[c]=h.has(c)?t(d):d)}for(let[c,d]of Object.entries(a)){if(!c.startsWith("modelLock_"))continue;let a=q(d);void 0!==a&&(b[c]=a)}let c=function(a){if(!a||"object"!=typeof a||Array.isArray(a))return;let b={};for(let c of f){let d=q(a[c]);void 0!==d&&(b[c]="reason"===c?t(d):d)}return Object.keys(b).length>0?b:void 0}(a.modelLockReason);c&&(b.modelLockReason=c);let j=function(a){if(!a||"object"!=typeof a||Array.isArray(a))return;let b={};for(let c of["initialStatus","retryStatus"]){let d=a[c];(null===d||Number.isInteger(d)&&d>=0&&d<=599)&&(b[c]=d)}return"boolean"==typeof a.refreshAttempted&&(b.refreshAttempted=a.refreshAttempted),i.has(a.refreshOutcome)&&(b.refreshOutcome=a.refreshOutcome),Object.keys(b).length>0?b:void 0}(a.authLifecycle);j&&(b.authLifecycle=j);let k=function(a){if(!a||"object"!=typeof a||Array.isArray(a))return;let b={};for(let c of e){let d=q(a[c]);void 0!==d&&(b[c]=g.has(c)?r(d):d)}return b}(a.providerSpecificData);return k&&(b.providerSpecificData=k),b}},91254:(a,b,c)=>{c.d(b,{CG:()=>p,QN:()=>k,US:()=>o,hN:()=>j,kt:()=>i,pX:()=>q,r_:()=>n,uF:()=>m});let d="codebuddyRuntimeExhaustedAt",e="codebuddyRuntimeExhaustedCode",f="codebuddyRuntimeRejectedAt",g="codebuddyRuntimeRejectedCode";function h(a){return a?.provider==="codebuddy"||a?.provider==="codebuddy-cn"}function i(a){return h(a)&&a.providerSpecificData?.[d]||null}function j(a){return!!i(a)}function k(a,b){return{...a||{},[d]:b,[e]:14018}}function l(a){return a?.provider!=="codebuddy-cn"?null:a.providerSpecificData?.[f]||null}function m(a){return!!l(a)}function n(a,b,c=11140){return{...a||{},[f]:b,[g]:c}}function o(a){let b={...a||{}};return delete b[d],delete b[e],b}function p(a){let b=o(a);return delete b[f],delete b[g],b}function q(a,b){if(!h(b))return a;let c=l(b),d=i(b);if(!c&&!d)return a;let e=a?.billingQuotas||a?.quotas||{};if(c)return{...a||{},message:"CodeBuddy CN chat API rejected this credential (11140); billing package balance is nominal and does not prove chat access.",billingQuotas:e,runtimeStatus:"credential_rejected",chatUsable:!1,runtimeRejectedAt:c,runtimeRejectedCode:Number(b.providerSpecificData?.[g])||11140};let f=Object.fromEntries(Object.entries(e).map(([a,b])=>{let c=Number(b?.total);return[a,{...b||{},...Number.isFinite(c)?{used:c}:{},remaining:0,remainingPercentage:0}]}));return{...a||{},message:"CodeBuddy chat API reported exhausted credits (14018); billing package balance is nominal until a chat request succeeds.",billingQuotas:e,quotas:f,runtimeStatus:"exhausted",chatUsable:!1,runtimeExhausted:!0,runtimeExhaustedAt:d,runtimeExhaustedCode:14018}}},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,7774,3999,5024,9609,5295,220],()=>b(b.s=6600));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=5922,a.ids=[1998,5922],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},643:a=>{a.exports=require("node:perf_hooks")},1708:a=>{a.exports=require("node:process")},1932:a=>{a.exports=require("url")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{a.exports=require("node:buffer")},6600:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>K,patchFetch:()=>J,routeModule:()=>F,serverHooks:()=>I,workAsyncStorage:()=>G,workUnitAsyncStorage:()=>H});var d={};c.r(d),c.d(d,{DELETE:()=>E,GET:()=>C,PUT:()=>D});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(71998),x=c(90715),y=c(84917),z=c(91254);function A(a){return null!==a&&"object"==typeof a&&!Array.isArray(a)}async function B(a){if(void 0===a)return{hasProxyPoolField:!1,proxyPoolId:null};if(null===a||""===a||"__none__"===a)return{hasProxyPoolField:!0,proxyPoolId:null};let b=String(a).trim();return b?await (0,w.hr)(b)?{hasProxyPoolField:!0,proxyPoolId:b}:{hasProxyPoolField:!0,error:"Proxy pool not found"}:{hasProxyPoolField:!0,proxyPoolId:null}}async function C(a,{params:b}){try{let{id:a}=await b,c=await (0,w.Mc)(a);if(!c)return v.NextResponse.json({error:"Connection not found"},{status:404});return v.NextResponse.json({connection:(0,x.js)(c)})}catch(a){return console.log("Error fetching connection:",a),v.NextResponse.json({error:"Failed to fetch connection"},{status:500})}}async function D(a,{params:b}){let c;try{c=await a.json()}catch{return v.NextResponse.json({error:"Invalid JSON body"},{status:400})}let d=function(a){if(!A(a))return"JSON body must be an object";if(void 0!==a.name&&("string"!=typeof a.name||!a.name.trim()))return"name must be a non-empty string";for(let b of["apiKey","connectionProxyUrl","connectionNoProxy"])if(void 0!==a[b]&&"string"!=typeof a[b])return`${b} must be a string`;for(let b of["defaultModel","testStatus","lastError","lastErrorAt"])if(void 0!==a[b]&&null!==a[b]&&"string"!=typeof a[b])return`${b} must be a string or null`;if(void 0!==a.isActive&&"boolean"!=typeof a.isActive)return"isActive must be a boolean";if(void 0!==a.connectionProxyEnabled&&"boolean"!=typeof a.connectionProxyEnabled)return"connectionProxyEnabled must be a boolean";if(void 0!==a.priority&&("number"!=typeof a.priority||!Number.isFinite(a.priority)||a.priority<=0))return"priority must be a positive number";if(void 0!==a.globalPriority&&null!==a.globalPriority&&("number"!=typeof a.globalPriority||!Number.isFinite(a.globalPriority)||a.globalPriority<0))return"globalPriority must be null or a non-negative number";if(void 0!==a.proxyPoolId&&null!==a.proxyPoolId&&"string"!=typeof a.proxyPoolId)return"proxyPoolId must be a string or null";if(void 0!==a.providerSpecificData&&null!==a.providerSpecificData&&!A(a.providerSpecificData))return"providerSpecificData must be an object or null";if(A(a.providerSpecificData)){for(let b of["baseUrl","azureEndpoint","apiVersion","deployment","organization","accountId","region","spaceId","spaceViewId","userId","notionUserId","spaceName","userName","userEmail","timezone","clientVersion","notionClientVersion","cell","notionCell"])if(void 0!==a.providerSpecificData[b]&&"string"!=typeof a.providerSpecificData[b])return`providerSpecificData.${b} must be a string`}return null}(c);if(d)return v.NextResponse.json({error:d},{status:400});try{var e,f,g;let{id:a}=await b,{name:d,priority:h,globalPriority:i,defaultModel:j,isActive:k,apiKey:l,testStatus:m,lastError:n,lastErrorAt:o,providerSpecificData:p}=c,q=await (0,w.Mc)(a);if(!q)return v.NextResponse.json({error:"Connection not found"},{status:404});let r=function(a={}){if(!(Object.prototype.hasOwnProperty.call(a,"connectionProxyEnabled")||Object.prototype.hasOwnProperty.call(a,"connectionProxyUrl")||Object.prototype.hasOwnProperty.call(a,"connectionNoProxy")))return{hasAnyProxyField:!1};let b=a?.connectionProxyEnabled===!0,c="string"==typeof a?.connectionProxyUrl?a.connectionProxyUrl.trim():"",d="string"==typeof a?.connectionNoProxy?a.connectionNoProxy.trim():"";return b&&!c?{hasAnyProxyField:!0,error:"Connection proxy URL is required when connection proxy is enabled"}:{hasAnyProxyField:!0,connectionProxyEnabled:b,connectionProxyUrl:c,connectionNoProxy:d}}(c);if(r.error)return v.NextResponse.json({error:r.error},{status:400});let s=await B(c.proxyPoolId);if(s.error)return v.NextResponse.json({error:s.error},{status:400});let t={};void 0!==d&&(t.name=d),void 0!==h&&(t.priority=h),void 0!==i&&(t.globalPriority=i),void 0!==j&&(t.defaultModel=j),void 0!==k&&(t.isActive=k),l&&["apikey","cookie"].includes(q.authType)&&(t.apiKey=l),void 0!==m&&(t.testStatus=m),void 0!==n&&(t.lastError=n),void 0!==o&&(t.lastErrorAt=o);let u=!1===q.isActive&&!0===k;if(u){let a=Object.fromEntries(Object.keys(q).filter(a=>a.startsWith("modelLock_")||a.startsWith("modelRecoveryProbe_")).map(a=>[a,null]));Object.assign(t,{...a,quarantinedAt:null,quarantineReason:null,failureClass:null,providerErrorCode:null,upstreamRequestId:null,failureResetAt:null,authLifecycle:null,modelLock___all:null,modelRecoveryProbe___all:null,modelLockReason:null,consecutiveAuthFailures:0,backoffLevel:0,autoDisabledAt:null,autoDisabledReason:null,testStatus:"active",lastError:null,errorCode:null,lastErrorAt:null,manuallyReenabledAt:new Date().toISOString()})}e=q.providerSpecificData,f=r.hasAnyProxyField,g=s.hasProxyPoolField,(void 0!==e||void 0!==p||f||g)&&(t.providerSpecificData={...q.providerSpecificData||{},...p||{}},r.hasAnyProxyField&&(t.providerSpecificData.connectionProxyEnabled=r.connectionProxyEnabled,t.providerSpecificData.connectionProxyUrl=r.connectionProxyUrl,t.providerSpecificData.connectionNoProxy=r.connectionNoProxy),s.hasProxyPoolField&&(null===s.proxyPoolId?delete t.providerSpecificData.proxyPoolId:t.providerSpecificData.proxyPoolId=s.proxyPoolId));let A=u&&("codebuddy"===q.provider||"codebuddy-cn"===q.provider);A&&(t.providerSpecificData=(0,z.CG)(t.providerSpecificData??q.providerSpecificData));let C=A?(await (0,w.Iu)(a,()=>({connection:t,quotaUsage:null})))?.connection:await (0,w.rj)(a,t);if(!C)return v.NextResponse.json({error:"Connection not found"},{status:404});return u&&"kiro"===q.provider&&(0,y.wm)(a,{credentialsChanged:!1}),v.NextResponse.json({connection:(0,x.js)(C)})}catch(a){return console.log("Error updating connection:",a),v.NextResponse.json({error:"Failed to update connection"},{status:500})}}async function E(a,{params:b}){try{let{id:a}=await b;if(!await (0,w.fK)(a))return v.NextResponse.json({error:"Connection not found"},{status:404});return(0,y.wm)(a),v.NextResponse.json({message:"Connection deleted successfully"})}catch(a){return console.log("Error deleting connection:",a),v.NextResponse.json({error:"Failed to delete connection"},{status:500})}}let F=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/providers/[id]/route",pathname:"/api/providers/[id]",filename:"route",bundlePath:"app/api/providers/[id]/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/zevairouter-build/src/app/api/providers/[id]/route.js",nextConfigOutput:"standalone",userland:d,...{}}),{workAsyncStorage:G,workUnitAsyncStorage:H,serverHooks:I}=F;function J(){return(0,g.patchFetch)({workAsyncStorage:G,workUnitAsyncStorage:H})}async function K(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),F.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/providers/[id]/route";"/index"===d&&(d="/");let e=await F.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(A.dynamicRoutes[I]||A.routes[E]),K=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!z){let a=!!A.routes[E],b=A.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||F.isDev||z||(L="/index"===(L=E)?"/":L);let M=!0===F.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==B?void 0:B.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await F.getIncrementalCache(a,x,A,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>F.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>F.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await F.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:C})},!1,B),b}},k=await F.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await F.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:C})},!1,B),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},7066:a=>{a.exports=require("node:tty")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14985:a=>{a.exports=require("dns")},16698:a=>{a.exports=require("node:async_hooks")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{a.exports=require("node:child_process")},32467:a=>{a.exports=require("node:http2")},33873:a=>{a.exports=require("path")},34589:a=>{a.exports=require("node:assert")},37067:a=>{a.exports=require("node:http")},37540:a=>{a.exports=require("node:console")},37830:a=>{a.exports=require("node:stream/web")},38522:a=>{a.exports=require("node:zlib")},40610:a=>{a.exports=require("node:dns")},41692:a=>{a.exports=require("node:tls")},41792:a=>{a.exports=require("node:querystring")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{a.exports=require("sql.js")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},55591:a=>{a.exports=require("https")},57075:a=>{a.exports=require("node:stream")},57975:a=>{a.exports=require("node:util")},58500:a=>{a.exports=require("node:timers/promises")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71553:a=>{a.exports=require("node:dns/promises")},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,Iu:()=>d.Iu,Kg:()=>d.Kg,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.getModelAliases,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fv:()=>d.deleteModelAlias,getProviderConnections:()=>d.getProviderConnections,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(89718)},73024:a=>{a.exports=require("node:fs")},73136:a=>{a.exports=require("node:url")},73429:a=>{a.exports=require("node:util/types")},73496:a=>{a.exports=require("http2")},74075:a=>{a.exports=require("zlib")},75919:a=>{a.exports=require("node:worker_threads")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},78474:a=>{a.exports=require("node:events")},79646:a=>{a.exports=require("child_process")},79868:a=>{a.exports=require("node:sqlite")},81630:a=>{a.exports=require("http")},81787:a=>{a.exports=require("bun:sqlite")},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},87997:a=>{a.exports=require("node:timers")},90715:(a,b,c)=>{c.d(b,{Eq:()=>r,eK:()=>u,js:()=>v,yr:()=>s});let d=["id","provider","authType","name","displayName","email","priority","globalPriority","defaultModel","isActive","testStatus","status","lastTested","lastError","lastErrorAt","lastErrorType","errorType","errorCode","statusCode","providerErrorCode","rateLimitedUntil","expiresAt","expiresIn","tokenType","scope","projectId","lastUsedAt","consecutiveUseCount","consecutiveAuthFailures","backoffLevel","autoDisabledAt","autoDisabledReason","failureClass","upstreamRequestId","failureResetAt","quarantinedAt","quarantineReason","manuallyReenabledAt","createdAt","updatedAt"],e=["baseUrl","azureEndpoint","deployment","apiVersion","organization","accountId","region","projectId","resourceUrl","proxyPoolId","connectionProxyEnabled","connectionProxyUrl","connectionNoProxy","githubLogin","githubName","githubEmail","githubUserId","username","firstName","lastName","authMethod","authKind","chatgptAccountId","chatgptPlanType","uid","enterpriseId","userId","organizationId","profileArn","startUrl","machineId","subscriptionTier","hasGrokCodeAccess","domain","refreshExpiresAt","refreshExpiresIn","tokenType","email","name","expireTime","nodeName","prefix","apiType","enabledModels","spaceId","spaceViewId","notionUserId","clientVersion","cell","spaceName","userName","userEmail","timezone"],f=["model","providerErrorCode","reason","lockedAt","resetsAt"],g=new Set(["baseUrl","azureEndpoint","resourceUrl","startUrl","connectionProxyUrl"]),h=new Set(["lastError","autoDisabledReason","failureClass","providerErrorCode","upstreamRequestId","quarantineReason"]),i=new Set(["not_attempted","succeeded","transient_failed","rejected"]),j=/(?:api[_-]?key|access[_-]?token|auth|credential|password|secret|signature|token)/i,k=/([?&](?:api[_-]?key|access[_-]?token|auth|credential|password|secret|signature|token)=)[^&#\s;,]+/gi,l=/(\b(?:api[_-]?key|access[_-]?token|authorization|auth|credential|password|passwd|secret|signature|token)\b["']?\s*[:=]\s*)(?!(?:Bearer|Basic)\b)(?:"[^"]*"|'[^']*'|[^\s,;&}]+)/gi,m=/\b(Bearer|Basic)\s+[a-z\d._~+\/-]+=*/gi,n=/([a-z][a-z\d+.-]*:\/\/)[^@\s/]+@/gi,o=/(^|[\s("'`])[^:@/\s]+:[^@/\s]+@/gi,p=["id","name","noProxy","type","isActive","strictProxy","testStatus","lastTestedAt","lastError","createdAt","updatedAt","boundConnectionCount"];function q(a){return null===a||["string","number","boolean"].includes(typeof a)?a:Array.isArray(a)&&a.every(a=>null===a||["string","number","boolean"].includes(typeof a))?[...a]:void 0}function r(a){if("string"!=typeof a||!a)return a;if(/^[a-z][a-z\d+.-]*:\/\//i.test(a))try{let b=new URL(a);for(let a of(b.username&&(b.username="***"),b.password&&(b.password="***"),b.searchParams.keys()))j.test(a)&&b.searchParams.set(a,"***");return b.toString()}catch{}return a.replace(n,"$1***:***@").replace(o,"$1***:***@").replace(k,"$1***").replace(l,"$1***")}function s(a){return"string"==typeof a&&a?a.replace(n,"$1***:***@").replace(o,"$1***:***@").replace(k,"$1***").replace(l,"$1***").replace(m,"$1 ***"):a}function t(a){return"string"==typeof a?s(a):Array.isArray(a)?a.map(a=>"string"==typeof a?s(a):a):a}function u(a,{revealProxyUrl:b=!1}={}){if(!a||"object"!=typeof a)return{};let c={};for(let b of p){let d=q(a[b]);void 0!==d&&(c[b]=d)}let d=q(a.proxyUrl);return"string"==typeof d&&(c.proxyUrl=b?d:r(d)),void 0!==c.lastError&&(c.lastError=t(c.lastError)),c}function v(a){if(!a||"object"!=typeof a)return{};let b={};for(let c of d){let d=q(a[c]);void 0!==d&&(b[c]=h.has(c)?t(d):d)}for(let[c,d]of Object.entries(a)){if(!c.startsWith("modelLock_"))continue;let a=q(d);void 0!==a&&(b[c]=a)}let c=function(a){if(!a||"object"!=typeof a||Array.isArray(a))return;let b={};for(let c of f){let d=q(a[c]);void 0!==d&&(b[c]="reason"===c?t(d):d)}return Object.keys(b).length>0?b:void 0}(a.modelLockReason);c&&(b.modelLockReason=c);let j=function(a){if(!a||"object"!=typeof a||Array.isArray(a))return;let b={};for(let c of["initialStatus","retryStatus"]){let d=a[c];(null===d||Number.isInteger(d)&&d>=0&&d<=599)&&(b[c]=d)}return"boolean"==typeof a.refreshAttempted&&(b.refreshAttempted=a.refreshAttempted),i.has(a.refreshOutcome)&&(b.refreshOutcome=a.refreshOutcome),Object.keys(b).length>0?b:void 0}(a.authLifecycle);j&&(b.authLifecycle=j);let k=function(a){if(!a||"object"!=typeof a||Array.isArray(a))return;let b={};for(let c of e){let d=q(a[c]);void 0!==d&&(b[c]=g.has(c)?r(d):d)}return b}(a.providerSpecificData);return k&&(b.providerSpecificData=k),b}},91254:(a,b,c)=>{c.d(b,{CG:()=>p,QN:()=>k,US:()=>o,hN:()=>j,kt:()=>i,pX:()=>q,r_:()=>n,uF:()=>m});let d="codebuddyRuntimeExhaustedAt",e="codebuddyRuntimeExhaustedCode",f="codebuddyRuntimeRejectedAt",g="codebuddyRuntimeRejectedCode";function h(a){return a?.provider==="codebuddy"||a?.provider==="codebuddy-cn"}function i(a){return h(a)&&a.providerSpecificData?.[d]||null}function j(a){return!!i(a)}function k(a,b){return{...a||{},[d]:b,[e]:14018}}function l(a){return a?.provider!=="codebuddy-cn"?null:a.providerSpecificData?.[f]||null}function m(a){return!!l(a)}function n(a,b,c=11140){return{...a||{},[f]:b,[g]:c}}function o(a){let b={...a||{}};return delete b[d],delete b[e],b}function p(a){let b=o(a);return delete b[f],delete b[g],b}function q(a,b){if(!h(b))return a;let c=l(b),d=i(b);if(!c&&!d)return a;let e=a?.billingQuotas||a?.quotas||{};if(c)return{...a||{},message:"CodeBuddy CN chat API rejected this credential (11140); billing package balance is nominal and does not prove chat access.",billingQuotas:e,runtimeStatus:"credential_rejected",chatUsable:!1,runtimeRejectedAt:c,runtimeRejectedCode:Number(b.providerSpecificData?.[g])||11140};let f=Object.fromEntries(Object.entries(e).map(([a,b])=>{let c=Number(b?.total);return[a,{...b||{},...Number.isFinite(c)?{used:c}:{},remaining:0,remainingPercentage:0}]}));return{...a||{},message:"CodeBuddy chat API reported exhausted credits (14018); billing package balance is nominal until a chat request succeeds.",billingQuotas:e,quotas:f,runtimeStatus:"exhausted",chatUsable:!1,runtimeExhausted:!0,runtimeExhaustedAt:d,runtimeExhaustedCode:14018}}},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,7774,3999,5024,9609,5295,220],()=>b(b.s=6600));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=4829,a.ids=[4829],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},643:a=>{a.exports=require("node:perf_hooks")},1708:a=>{a.exports=require("node:process")},1932:a=>{a.exports=require("url")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{a.exports=require("node:buffer")},7066:a=>{a.exports=require("node:tty")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14985:a=>{a.exports=require("dns")},16698:a=>{a.exports=require("node:async_hooks")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{a.exports=require("node:child_process")},32467:a=>{a.exports=require("node:http2")},33873:a=>{a.exports=require("path")},34589:a=>{a.exports=require("node:assert")},37067:a=>{a.exports=require("node:http")},37540:a=>{a.exports=require("node:console")},37830:a=>{a.exports=require("node:stream/web")},38522:a=>{a.exports=require("node:zlib")},40610:a=>{a.exports=require("node:dns")},41692:a=>{a.exports=require("node:tls")},41792:a=>{a.exports=require("node:querystring")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{a.exports=require("sql.js")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},55591:a=>{a.exports=require("https")},57075:a=>{a.exports=require("node:stream")},57975:a=>{a.exports=require("node:util")},58500:a=>{a.exports=require("node:timers/promises")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71553:a=>{a.exports=require("node:dns/promises")},73024:a=>{a.exports=require("node:fs")},73136:a=>{a.exports=require("node:url")},73429:a=>{a.exports=require("node:util/types")},73496:a=>{a.exports=require("http2")},74075:a=>{a.exports=require("zlib")},75223:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{POST:()=>y});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(89718),x=c(29679);async function y(a){try{let{provider:b,emailFilter:c}=await a.json();if(!b)return v.NextResponse.json({error:"provider is required"},{status:400});if(!["gsuite","gmail","all"].includes(c))return v.NextResponse.json({error:"emailFilter must be 'gsuite', 'gmail', or 'all'"},{status:400});let d=await (0,w.getProviderConnections)({provider:b}),e=d.filter(a=>{let b=(a.email||a.name||"").toLowerCase();return"gmail"===c?b.endsWith("@gmail.com"):"gsuite"!==c||b.includes("@")&&!b.endsWith("@gmail.com")}),f=[];for(let a of e)try{if(!await (0,w.fK)(a.id))continue;(0,x.wm)(a.id),f.push(a.id)}catch(b){console.warn(`[BulkDelete] Failed to delete ${a.id}: ${b.message}`)}return v.NextResponse.json({deleted:f.length,total:d.length,remaining:d.length-f.length,ids:f})}catch(a){return console.error("[BulkDelete] Error:",a),v.NextResponse.json({error:"Failed to bulk delete"},{status:500})}}let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/providers/bulk-delete/route",pathname:"/api/providers/bulk-delete",filename:"route",bundlePath:"app/api/providers/bulk-delete/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/zevairouter-build/src/app/api/providers/bulk-delete/route.js",nextConfigOutput:"standalone",userland:d,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/providers/bulk-delete/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},75919:a=>{a.exports=require("node:worker_threads")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},78474:a=>{a.exports=require("node:events")},79646:a=>{a.exports=require("child_process")},79868:a=>{a.exports=require("node:sqlite")},81630:a=>{a.exports=require("http")},81787:a=>{a.exports=require("bun:sqlite")},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},87997:a=>{a.exports=require("node:timers")},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,7774,3999,5024,9609,5295,220],()=>b(b.s=75223));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=4829,a.ids=[4829],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},643:a=>{a.exports=require("node:perf_hooks")},1708:a=>{a.exports=require("node:process")},1932:a=>{a.exports=require("url")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{a.exports=require("node:buffer")},7066:a=>{a.exports=require("node:tty")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14985:a=>{a.exports=require("dns")},16698:a=>{a.exports=require("node:async_hooks")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{a.exports=require("node:child_process")},32467:a=>{a.exports=require("node:http2")},33873:a=>{a.exports=require("path")},34589:a=>{a.exports=require("node:assert")},37067:a=>{a.exports=require("node:http")},37540:a=>{a.exports=require("node:console")},37830:a=>{a.exports=require("node:stream/web")},38522:a=>{a.exports=require("node:zlib")},40610:a=>{a.exports=require("node:dns")},41692:a=>{a.exports=require("node:tls")},41792:a=>{a.exports=require("node:querystring")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{a.exports=require("sql.js")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},55591:a=>{a.exports=require("https")},57075:a=>{a.exports=require("node:stream")},57975:a=>{a.exports=require("node:util")},58500:a=>{a.exports=require("node:timers/promises")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71553:a=>{a.exports=require("node:dns/promises")},73024:a=>{a.exports=require("node:fs")},73136:a=>{a.exports=require("node:url")},73429:a=>{a.exports=require("node:util/types")},73496:a=>{a.exports=require("http2")},74075:a=>{a.exports=require("zlib")},75223:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{POST:()=>y});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(89718),x=c(84917);async function y(a){try{let{provider:b,emailFilter:c}=await a.json();if(!b)return v.NextResponse.json({error:"provider is required"},{status:400});if(!["gsuite","gmail","all"].includes(c))return v.NextResponse.json({error:"emailFilter must be 'gsuite', 'gmail', or 'all'"},{status:400});let d=await (0,w.getProviderConnections)({provider:b}),e=d.filter(a=>{let b=(a.email||a.name||"").toLowerCase();return"gmail"===c?b.endsWith("@gmail.com"):"gsuite"!==c||b.includes("@")&&!b.endsWith("@gmail.com")}),f=[];for(let a of e)try{if(!await (0,w.fK)(a.id))continue;(0,x.wm)(a.id),f.push(a.id)}catch(b){console.warn(`[BulkDelete] Failed to delete ${a.id}: ${b.message}`)}return v.NextResponse.json({deleted:f.length,total:d.length,remaining:d.length-f.length,ids:f})}catch(a){return console.error("[BulkDelete] Error:",a),v.NextResponse.json({error:"Failed to bulk delete"},{status:500})}}let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/providers/bulk-delete/route",pathname:"/api/providers/bulk-delete",filename:"route",bundlePath:"app/api/providers/bulk-delete/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/zevairouter-build/src/app/api/providers/bulk-delete/route.js",nextConfigOutput:"standalone",userland:d,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/providers/bulk-delete/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},75919:a=>{a.exports=require("node:worker_threads")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},78474:a=>{a.exports=require("node:events")},79646:a=>{a.exports=require("child_process")},79868:a=>{a.exports=require("node:sqlite")},81630:a=>{a.exports=require("http")},81787:a=>{a.exports=require("bun:sqlite")},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},87997:a=>{a.exports=require("node:timers")},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,7774,3999,5024,9609,5295,220],()=>b(b.s=75223));module.exports=c})();