zevairouter 1.0.77 → 1.0.79

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 (577) hide show
  1. package/CHANGELOG.md +10 -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/server/app/(dashboard)/dashboard/automation/page.js.nft.json +1 -1
  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.js.nft.json +1 -1
  8. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  9. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  10. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  11. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  12. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  13. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  14. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  15. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  16. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  17. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page.js.nft.json +1 -1
  18. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page_client-reference-manifest.js +1 -1
  19. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  20. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  21. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  22. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  23. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  24. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  25. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  26. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  27. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  28. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  29. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  30. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  31. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  32. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  33. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js.nft.json +1 -1
  34. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  35. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  36. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  37. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  38. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  39. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  40. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  41. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  42. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  43. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  44. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  45. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  46. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  47. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  48. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  49. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page.js.nft.json +1 -1
  50. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page_client-reference-manifest.js +1 -1
  51. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  52. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  53. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  54. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  55. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  56. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  57. package/cli/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  58. package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  59. package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
  60. package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  61. package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  62. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  63. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  64. package/cli/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  65. package/cli/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  66. package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  67. package/cli/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  68. package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  69. package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
  70. package/cli/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  71. package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  72. package/cli/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  73. package/cli/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
  74. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  75. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  76. package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  77. package/cli/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  78. package/cli/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  79. package/cli/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  80. package/cli/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  81. package/cli/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  82. package/cli/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  83. package/cli/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  84. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  85. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  86. package/cli/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  87. package/cli/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  88. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-gateway/accounts/route.js.nft.json +1 -1
  89. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  90. package/cli/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  91. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  92. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  93. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  94. package/cli/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  95. package/cli/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  96. package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  97. package/cli/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  98. package/cli/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  99. package/cli/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  100. package/cli/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  101. package/cli/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  102. package/cli/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  103. package/cli/app/.next-cli-build/server/app/api/context/[id]/route.js.nft.json +1 -1
  104. package/cli/app/.next-cli-build/server/app/api/context/bulk/route.js.nft.json +1 -1
  105. package/cli/app/.next-cli-build/server/app/api/context/route.js.nft.json +1 -1
  106. package/cli/app/.next-cli-build/server/app/api/dashboard/chat/completions/route.js +1 -1
  107. package/cli/app/.next-cli-build/server/app/api/dashboard/chat/completions/route.js.nft.json +1 -1
  108. package/cli/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  109. package/cli/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  110. package/cli/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  111. package/cli/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  112. package/cli/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  113. package/cli/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  114. package/cli/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  115. package/cli/app/.next-cli-build/server/app/api/init/route.js +1 -1
  116. package/cli/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  117. package/cli/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  118. package/cli/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  119. package/cli/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  120. package/cli/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  121. package/cli/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  122. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  123. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  124. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  125. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  126. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  127. package/cli/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  128. package/cli/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  129. package/cli/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  130. package/cli/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  131. package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
  132. package/cli/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  133. package/cli/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  134. package/cli/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  135. package/cli/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  136. package/cli/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  137. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/cancel/route.js +1 -1
  138. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  139. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
  140. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  141. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/route.js +1 -1
  142. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/route.js.nft.json +1 -1
  143. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/latest/route.js +1 -1
  144. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/latest/route.js.nft.json +1 -1
  145. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/route.js +1 -1
  146. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/route.js.nft.json +1 -1
  147. package/cli/app/.next-cli-build/server/app/api/oauth/autoclaw/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  148. package/cli/app/.next-cli-build/server/app/api/oauth/autoclaw/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  149. package/cli/app/.next-cli-build/server/app/api/oauth/autoclaw/bulk-import/[jobId]/route.js.nft.json +1 -1
  150. package/cli/app/.next-cli-build/server/app/api/oauth/autoclaw/bulk-import/latest/route.js.nft.json +1 -1
  151. package/cli/app/.next-cli-build/server/app/api/oauth/autoclaw/bulk-import/route.js.nft.json +1 -1
  152. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  153. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  154. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/route.js.nft.json +1 -1
  155. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/latest/route.js.nft.json +1 -1
  156. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/route.js.nft.json +1 -1
  157. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-token/route.js.nft.json +1 -1
  158. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/quota-cookie/route.js.nft.json +1 -1
  159. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  160. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  161. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/route.js.nft.json +1 -1
  162. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/latest/route.js.nft.json +1 -1
  163. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js.nft.json +1 -1
  164. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-token/route.js.nft.json +1 -1
  165. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/quota-cookie/route.js.nft.json +1 -1
  166. package/cli/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  167. package/cli/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  168. package/cli/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  169. package/cli/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  170. package/cli/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  171. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  172. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  173. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/route.js.nft.json +1 -1
  174. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/latest/route.js.nft.json +1 -1
  175. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  176. package/cli/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  177. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  178. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  179. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  180. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/route.js.nft.json +1 -1
  181. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/latest/route.js.nft.json +1 -1
  182. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/route.js.nft.json +1 -1
  183. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  184. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  185. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  186. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  187. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  188. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/route.js.nft.json +1 -1
  189. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/latest/route.js.nft.json +1 -1
  190. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/route.js.nft.json +1 -1
  191. package/cli/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  192. package/cli/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  193. package/cli/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  194. package/cli/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  195. package/cli/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  196. package/cli/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  197. package/cli/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  198. package/cli/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  199. package/cli/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  200. package/cli/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  201. package/cli/app/.next-cli-build/server/app/api/providers/bulk-delete/route.js.nft.json +1 -1
  202. package/cli/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  203. package/cli/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  204. package/cli/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  205. package/cli/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  206. package/cli/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  207. package/cli/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  208. package/cli/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  209. package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js +51 -1
  210. package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  211. package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  212. package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  213. package/cli/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  214. package/cli/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  215. package/cli/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  216. package/cli/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  217. package/cli/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  218. package/cli/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  219. package/cli/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  220. package/cli/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  221. package/cli/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  222. package/cli/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  223. package/cli/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  224. package/cli/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  225. package/cli/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  226. package/cli/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  227. package/cli/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  228. package/cli/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  229. package/cli/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  230. package/cli/app/.next-cli-build/server/app/api/terminal/auth/setup/route.js.nft.json +1 -1
  231. package/cli/app/.next-cli-build/server/app/api/terminal/auth/status/route.js.nft.json +1 -1
  232. package/cli/app/.next-cli-build/server/app/api/terminal/auth/unlock/route.js.nft.json +1 -1
  233. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/input/route.js.nft.json +1 -1
  234. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/resize/route.js.nft.json +1 -1
  235. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/route.js.nft.json +1 -1
  236. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/stream/route.js.nft.json +1 -1
  237. package/cli/app/.next-cli-build/server/app/api/terminal/session/route.js.nft.json +1 -1
  238. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  239. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  240. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  241. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  242. package/cli/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  243. package/cli/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  244. package/cli/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  245. package/cli/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  246. package/cli/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  247. package/cli/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  248. package/cli/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  249. package/cli/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  250. package/cli/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  251. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  252. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  253. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  254. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  255. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  256. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  257. package/cli/app/.next-cli-build/server/app/api/usage/aggregate/route.js.nft.json +1 -1
  258. package/cli/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  259. package/cli/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  260. package/cli/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  261. package/cli/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  262. package/cli/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  263. package/cli/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  264. package/cli/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  265. package/cli/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  266. package/cli/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  267. package/cli/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  268. package/cli/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  269. package/cli/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  270. package/cli/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  271. package/cli/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  272. package/cli/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  273. package/cli/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  274. package/cli/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  275. package/cli/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  276. package/cli/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  277. package/cli/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  278. package/cli/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  279. package/cli/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  280. package/cli/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  281. package/cli/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  282. package/cli/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  283. package/cli/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  284. package/cli/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  285. package/cli/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  286. package/cli/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  287. package/cli/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  288. package/cli/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  289. package/cli/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  290. package/cli/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  291. package/cli/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  292. package/cli/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  293. package/cli/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  294. package/cli/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  295. package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
  296. package/cli/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  297. package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  298. package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  299. package/cli/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  300. package/cli/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  301. package/cli/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  302. package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  303. package/cli/app/.next-cli-build/server/app/callback.html +1 -1
  304. package/cli/app/.next-cli-build/server/app/callback.rsc +3 -3
  305. package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  306. package/cli/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  307. package/cli/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
  308. package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  309. package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  310. package/cli/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  311. package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
  312. package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +5 -5
  313. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +2 -2
  314. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation.segment.rsc +1 -1
  315. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  316. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  317. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +5 -5
  318. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_head.segment.rsc +1 -1
  319. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_index.segment.rsc +3 -3
  320. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +1 -1
  321. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  322. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
  323. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  324. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  325. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  326. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  327. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
  328. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  329. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
  330. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  331. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  332. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
  333. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  334. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  335. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  336. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  337. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  338. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  339. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
  340. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  341. package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  342. package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  343. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  344. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  345. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  346. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  347. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  348. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  349. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
  350. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  351. package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
  352. package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +5 -5
  353. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +2 -2
  354. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context.segment.rsc +1 -1
  355. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  356. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  357. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +5 -5
  358. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_head.segment.rsc +1 -1
  359. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_index.segment.rsc +3 -3
  360. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +1 -1
  361. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  362. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
  363. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  364. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  365. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  366. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  367. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
  368. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  369. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
  370. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  371. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  372. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  373. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  374. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  375. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  376. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  377. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  378. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  379. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  380. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
  381. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  382. package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  383. package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  384. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  385. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  386. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  387. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  388. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  389. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  390. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
  391. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  392. package/cli/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
  393. package/cli/app/.next-cli-build/server/app/dashboard/playground.rsc +5 -5
  394. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +2 -2
  395. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground.segment.rsc +1 -1
  396. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  397. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  398. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +5 -5
  399. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_head.segment.rsc +1 -1
  400. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_index.segment.rsc +3 -3
  401. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +1 -1
  402. package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  403. package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  404. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  405. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  406. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  407. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  408. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  409. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  410. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
  411. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  412. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  413. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  414. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  415. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  416. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  417. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  418. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  419. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  420. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  421. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
  422. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  423. package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  424. package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  425. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  426. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  427. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  428. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  429. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  430. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  431. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
  432. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  433. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  434. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
  435. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  436. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  437. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  438. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  439. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
  440. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  441. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
  442. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  443. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  444. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
  445. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  446. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  447. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  448. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  449. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
  450. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  451. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +3 -3
  452. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  453. package/cli/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  454. package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
  455. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  456. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  457. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  458. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  459. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  460. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  461. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
  462. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  463. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  464. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  465. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  466. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  467. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  468. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  469. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
  470. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  471. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  472. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  473. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  474. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  475. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  476. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
  477. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  478. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  479. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  480. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  481. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
  482. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  483. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +3 -3
  484. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  485. package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  486. package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  487. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  488. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  489. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  490. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  491. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  492. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  493. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
  494. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  495. package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  496. package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  497. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  498. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  499. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  500. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  501. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  502. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  503. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
  504. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  505. package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
  506. package/cli/app/.next-cli-build/server/app/dashboard.rsc +5 -5
  507. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  508. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  509. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  510. package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
  511. package/cli/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  512. package/cli/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
  513. package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  514. package/cli/app/.next-cli-build/server/app/index.html +1 -1
  515. package/cli/app/.next-cli-build/server/app/index.rsc +3 -3
  516. package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  517. package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  518. package/cli/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  519. package/cli/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
  520. package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  521. package/cli/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  522. package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  523. package/cli/app/.next-cli-build/server/app/landing.html +1 -1
  524. package/cli/app/.next-cli-build/server/app/landing.rsc +3 -3
  525. package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  526. package/cli/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  527. package/cli/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
  528. package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  529. package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  530. package/cli/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  531. package/cli/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  532. package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  533. package/cli/app/.next-cli-build/server/app/login.html +1 -1
  534. package/cli/app/.next-cli-build/server/app/login.rsc +4 -4
  535. package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  536. package/cli/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  537. package/cli/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
  538. package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  539. package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  540. package/cli/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  541. package/cli/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  542. package/cli/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  543. package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  544. package/cli/app/.next-cli-build/server/app-paths-manifest.json +7 -7
  545. package/cli/app/.next-cli-build/server/chunks/3104.js +1 -1
  546. package/cli/app/.next-cli-build/server/chunks/3110.js +9 -59
  547. package/cli/app/.next-cli-build/server/chunks/{7276.js → 3155.js} +52 -2
  548. package/cli/app/.next-cli-build/server/chunks/318.js +1 -1
  549. package/cli/app/.next-cli-build/server/chunks/3407.js +1 -1
  550. package/cli/app/.next-cli-build/server/chunks/3487.js +1 -1
  551. package/cli/app/.next-cli-build/server/chunks/3831.js +1 -1
  552. package/cli/app/.next-cli-build/server/chunks/4746.js +1 -1
  553. package/cli/app/.next-cli-build/server/chunks/5024.js +1 -1
  554. package/cli/app/.next-cli-build/server/chunks/6896.js +1 -1
  555. package/cli/app/.next-cli-build/server/chunks/8450.js +1 -1
  556. package/cli/app/.next-cli-build/server/chunks/8590.js +1 -1
  557. package/cli/app/.next-cli-build/server/chunks/891.js +1 -1
  558. package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  559. package/cli/app/.next-cli-build/server/pages/404.html +1 -1
  560. package/cli/app/.next-cli-build/server/pages/500.html +1 -1
  561. package/cli/app/.next-cli-build/static/chunks/3702-ba0384ec4bf3a024.js +1 -0
  562. package/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/src/lib/terminal/ptyBridge.py +163 -0
  563. package/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/src/lib/terminal/ptyBridge.py +163 -0
  564. package/cli/app/package.json +1 -1
  565. package/cli/cli.js +43 -2
  566. package/cli/package.json +1 -1
  567. package/open-sse/config/kiroConstants.js +38 -0
  568. package/open-sse/config/providers.js +2 -2
  569. package/open-sse/executors/default.js +1 -1
  570. package/open-sse/services/kiroModels.js +2 -14
  571. package/open-sse/services/tokenRefresh.js +1 -1
  572. package/open-sse/services/usage.js +2 -2
  573. package/package.json +1 -1
  574. package/src/app/api/providers/[id]/test/testUtils.js +1 -1
  575. package/cli/app/.next-cli-build/static/chunks/3702-991457772883a6eb.js +0 -1
  576. /package/cli/app/.next-cli-build/static/{098RO3FmMluIVFeaC1xM- → 4C9PwQ6urCt5mEONGURu3}/_buildManifest.js +0 -0
  577. /package/cli/app/.next-cli-build/static/{098RO3FmMluIVFeaC1xM- → 4C9PwQ6urCt5mEONGURu3}/_ssgManifest.js +0 -0
@@ -1,9 +1,59 @@
1
- "use strict";exports.id=7276,exports.ids=[7276],exports.modules={15626:(a,b,c)=>{c.d(b,{buildClineHeaders:()=>e});let d=c(39006).version||"0.0.0";function e(a,b={}){let c,f=(c=function(a){if("string"!=typeof a)return"";let b=a.trim();return b?b.startsWith("workos:")?b:`workos:${b}`:""}(a))?`Bearer ${c}`:"",g={"HTTP-Referer":"https://cline.bot","X-Title":"Cline","User-Agent":`ZevaiRouter/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"zevairouter","X-CLIENT-VERSION":d,"X-CORE-VERSION":d,"X-IS-MULTIROOT":"false",...b};return f&&(g.Authorization=f),g}},30022:(a,b,c)=>{c.d(b,{KC:()=>j,RB:()=>q,Ty:()=>m,_G:()=>h,bg:()=>g,cT:()=>l,pM:()=>p,pr:()=>r,qk:()=>n,rf:()=>f,t6:()=>k,xG:()=>o});let d="https://openapi.qoder.sh",e="https://api3.qoder.sh",f="https://qoder.com/device/selectAccounts",g=`${d}/api/v1/deviceToken/poll`,h=`${d}/api/v1/userinfo`,i=`${e}/algo/api/v2/service/pro/sse/agent_chat_generation?FetchKeys=llm_model_result&AgentId=agent_common`,j=`${i}&Encode=1`,k=`${e}/algo/api/v2/model/list`,l="1.0.0",m="5",n="disagree",o="v2",p="x86_64_windows",q="5",r=`-----BEGIN PUBLIC KEY-----
1
+ "use strict";exports.id=3155,exports.ids=[3155],exports.modules={6382:(a,b,c)=>{c.d(b,{$D:()=>p,VE:()=>h,ZF:()=>m,aZ:()=>q,gI:()=>l,rG:()=>k});let d="-agentic",e="-thinking",f="1.0.138",g="1.0.0";function h(a){return{userAgent:`aws-sdk-js/${g} ua/2.1 os/windows#10.0.26200 lang/js md/nodejs#22.21.1 api/codewhispererruntime#${g} m/N,E KiroIDE-${f}-${a}`,amzUserAgent:`aws-sdk-js/${g} KiroIDE-${f}-${a}`}}let i=new Set(["1","true","yes","on"]),j=new Set(["0","false","no","off"]),k=`
2
+ # CRITICAL: CHUNKED WRITE PROTOCOL (MANDATORY)
3
+
4
+ You MUST follow these rules for ALL file operations. Violation causes server timeouts and task failure.
5
+
6
+ ## ABSOLUTE LIMITS
7
+ - **MAXIMUM 350 LINES** per single write/edit operation - NO EXCEPTIONS
8
+ - **RECOMMENDED 300 LINES** or less for optimal performance
9
+ - **NEVER** write entire files in one operation if >300 lines
10
+
11
+ ## MANDATORY CHUNKED WRITE STRATEGY
12
+
13
+ ### For NEW FILES (>300 lines total):
14
+ 1. FIRST: Write initial chunk (first 250-300 lines) using write_to_file/fsWrite
15
+ 2. THEN: Append remaining content in 250-300 line chunks using file append operations
16
+ 3. REPEAT: Continue appending until complete
17
+
18
+ ### For EDITING EXISTING FILES:
19
+ 1. Use surgical edits (apply_diff/targeted edits) - change ONLY what's needed
20
+ 2. NEVER rewrite entire files - use incremental modifications
21
+ 3. Split large refactors into multiple small, focused edits
22
+
23
+ ### For LARGE CODE GENERATION:
24
+ 1. Generate in logical sections (imports, types, functions separately)
25
+ 2. Write each section as a separate operation
26
+ 3. Use append operations for subsequent sections
27
+
28
+ ## EXAMPLES OF CORRECT BEHAVIOR
29
+
30
+ CORRECT: Writing a 600-line file
31
+ - Operation 1: Write lines 1-300 (initial file creation)
32
+ - Operation 2: Append lines 301-600
33
+
34
+ CORRECT: Editing multiple functions
35
+ - Operation 1: Edit function A
36
+ - Operation 2: Edit function B
37
+ - Operation 3: Edit function C
38
+
39
+ WRONG: Writing 500 lines in single operation -> TIMEOUT
40
+ WRONG: Rewriting entire file to change 5 lines -> TIMEOUT
41
+ WRONG: Generating massive code blocks without chunking -> TIMEOUT
42
+
43
+ ## WHY THIS MATTERS
44
+ - Server has 2-3 minute timeout for operations
45
+ - Large writes exceed timeout and FAIL completely
46
+ - Chunked writes are FASTER and more RELIABLE
47
+ - Failed writes waste time and require retry
48
+
49
+ REMEMBER: When in doubt, write LESS per operation. Multiple small operations > one large operation.
50
+ `.trim();function l(a,b,c){if(function(a){if(!a||"object"!=typeof a)return!1;let b=a.thinking;if(b&&"object"==typeof b&&"disabled"===b.type)return!0;let c=a.reasoning_effort??(a.reasoning&&"object"==typeof a.reasoning?a.reasoning.effort:null);return"string"==typeof c&&"none"===c.toLowerCase()}(a))return!1;if(b){let a=function(a,b){if(!a)return;if("function"==typeof a.get)return a.get(b);let c=b.toLowerCase();for(let b of Object.keys(a))if(b.toLowerCase()===c)return a[b]}(b,"anthropic-beta");if("string"==typeof a&&a.toLowerCase().includes("interleaved-thinking"))return!0}if(a&&"object"==typeof a){let b=a.thinking;if(b&&"object"==typeof b&&"enabled"===b.type){let a=Number(b.budget_tokens);if(!Number.isFinite(a)||a>0)return!0}let c=a.reasoning_effort??(a.reasoning&&"object"==typeof a.reasoning?a.reasoning.effort:null);if("string"==typeof c){let a=c.toLowerCase();if(a&&"none"!==a&&("low"===a||"medium"===a||"high"===a||"auto"===a))return!0}if(function(a){for(let b of Array.isArray(a?.messages)?a.messages:[]){if(!b||"system"!==b.role&&"user"!==b.role)continue;let a=b.content;if("string"==typeof a){if(r(a))return!0}else if(Array.isArray(a))for(let b of a){let a=b?.text;if("string"==typeof a&&r(a))return!0}}return!!("string"==typeof a?.system&&r(a.system))}(a))return!0}if("string"==typeof c&&c){let a=c.toLowerCase();if(a.includes("thinking")||a.includes("-reason"))return!0}return!1}function m(a){let b=t(s(a?.kiro_expose_reasoning,a?.kiroExposeReasoning,a?.metadata?.kiro_expose_reasoning,a?.metadata?.kiroExposeReasoning,a?.extra_body?.kiro_expose_reasoning,a?.extra_body?.kiroExposeReasoning));if(null!==b)return b;let c="u">typeof process?process.env:{};return!0===t(s(c.KIRO_EXPOSE_REASONING,c.ZEVAI_EXPOSE_REASONING))}function n(a){return"string"==typeof a&&a.endsWith(d)}function o(a){return"string"==typeof a&&a.endsWith(e)}function p(a){var b,c;let f=a,g=!1,h=!1;return n(f)&&(g=!0,f=n(b=f)?b.slice(0,-d.length):b),o(f)&&(h=!0,f=o(c=f)?c.slice(0,-e.length):c),{upstream:f,agentic:g,thinking:h}}function q(a=16e3){let b=Math.max(1,Math.min(32e3,Number(a)||16e3));return`<thinking_mode>enabled</thinking_mode>
51
+ <max_thinking_length>${b}</max_thinking_length>`}function r(a){return!!a&&!!a.includes("<thinking_mode>")&&(a.includes("<thinking_mode>enabled</thinking_mode>")||a.includes("<thinking_mode>interleaved</thinking_mode>"))}function s(...a){return a.find(a=>null!=a)}function t(a){if("boolean"==typeof a)return a;if("number"==typeof a)return 1===a||0!==a&&null;if("string"!=typeof a)return null;let b=a.trim().toLowerCase();return!!i.has(b)||!j.has(b)&&null}},15626:(a,b,c)=>{c.d(b,{buildClineHeaders:()=>e});let d=c(39006).version||"0.0.0";function e(a,b={}){let c,f=(c=function(a){if("string"!=typeof a)return"";let b=a.trim();return b?b.startsWith("workos:")?b:`workos:${b}`:""}(a))?`Bearer ${c}`:"",g={"HTTP-Referer":"https://cline.bot","X-Title":"Cline","User-Agent":`ZevaiRouter/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"zevairouter","X-CLIENT-VERSION":d,"X-CORE-VERSION":d,"X-IS-MULTIROOT":"false",...b};return f&&(g.Authorization=f),g}},30022:(a,b,c)=>{c.d(b,{KC:()=>j,RB:()=>q,Ty:()=>m,_G:()=>h,bg:()=>g,cT:()=>l,pM:()=>p,pr:()=>r,qk:()=>n,rf:()=>f,t6:()=>k,xG:()=>o});let d="https://openapi.qoder.sh",e="https://api3.qoder.sh",f="https://qoder.com/device/selectAccounts",g=`${d}/api/v1/deviceToken/poll`,h=`${d}/api/v1/userinfo`,i=`${e}/algo/api/v2/service/pro/sse/agent_chat_generation?FetchKeys=llm_model_result&AgentId=agent_common`,j=`${i}&Encode=1`,k=`${e}/algo/api/v2/model/list`,l="1.0.0",m="5",n="disagree",o="v2",p="x86_64_windows",q="5",r=`-----BEGIN PUBLIC KEY-----
2
52
  MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDA8iMH5c02LilrsERw9t6Pv5Nc
3
53
  4k6Pz1EaDicBMpdpxKduSZu5OANqUq8er4GM95omAGIOPOh+Nx0spthYA2BqGz+l
4
54
  6HRkPJ7S236FZz73In/KVuLnwI8JJ2CbuJap8kvheCCZpmAWpb/cPx/3Vr/J6I17
5
55
  XcW+ML9FoCI6AOvOzwIDAQAB
6
- -----END PUBLIC KEY-----`},39006:a=>{a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.77","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"./cli/cli.js"},"files":["cli/","src/","public/","scripts/","i18n/","assets/","images/","open-sse/","next.config.mjs","postcss.config.mjs","jsconfig.json","start.sh","package.json","README.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"next build --webpack","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","prepack":"node cli/scripts/build-cli.js","postinstall":"node cli/hooks/postinstall.js || exit 0"},"dependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","confbox":"^0.2.4","express":"^5.2.1","fs":"^0.0.1-security","http-proxy-middleware":"^3.0.5","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","monaco-editor":"^0.55.1","next":"^16.1.6","node-forge":"^1.3.3","node-machine-id":"^1.1.12","open":"^11.0.0","ora":"^9.1.0","react":"19.2.4","react-dom":"19.2.4","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks-proxy-agent":"^10.1.0","sql.js":"^1.14.1","undici":"^8.4.1","uuid":"^14.0.1","zustand":"^5.0.10"},"comment_optional_runtime":"Heavy packages are NOT optionalDependencies (clean `npm i -g`, no deprecated noise). postinstall warm-ups them into ~/.zevai/runtime so one command still gets full features. ZEVAI_MINIMAL_POSTINSTALL=1 skips browser downloads. Runtime code can still lazy-retry: better-sqlite3, camoufox-js, cloakbrowser, node-pty, playwright.","devDependencies":{"@tailwindcss/postcss":"^4.1.18","better-sqlite3":"^12.6.2","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","postcss":"^8.5.6","tailwindcss":"^4"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"https://github.com/Verifiedlabs/zevairouter"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},52007:(a,b,c)=>{c.d(b,{av:()=>o,gK:()=>m});var d=c(55511),e=c(39609);let f="https://llm.kimchi.dev",g=new Set([429,500,502,503,504]),h=new Map,i=new Map;function j(a){return(("string"==typeof a?a.trim():"")||f).replace(/\/+$/,"")}function k(a){return a?.accessToken||a?.apiKey||a?.providerSpecificData?.apiKey||null}function l(a){if(!a||"object"!=typeof a)return null;let b=a.slug||a.id||a.model||a.name;if("string"!=typeof b||""===b.trim())return null;let c=Array.isArray(a.input_modalities)?a.input_modalities.filter(a=>"text"===a||"image"===a):[],d=a.limits&&"object"==typeof a.limits?a.limits:{},e=Number(d.context_window||a.contextLength||a.context_length)||void 0,f=Number(d.max_output_tokens||a.maxOutputTokens||a.max_output_tokens)||void 0,g="string"==typeof a.provider?a.provider:"",h=!0===a.reasoning,i=Array.isArray(c)&&c.includes("image")?"imageToText":"llm",j={...a,id:b.trim(),name:String(a.display_name||a.displayName||a.name||b).trim(),provider:g,upstreamProvider:g,reasoning:h,inputModalities:c,kind:i,type:i,capabilities:{vision:c.includes("image"),reasoning:h,...e?{contextWindow:e}:{},...f?{maxOutput:f}:{},...g?{upstreamProvider:g}:{}},...e?{contextLength:e}:{},...f?{maxOutputTokens:f}:{}};return"anthropic"===g&&(j.compat={supportsReasoningEffort:!1,cacheControlFormat:"anthropic"}),j}function m(a){if("string"!=typeof a||""===a.trim())return null;let b=a.includes("/")?a.split("/").pop():a;return i.get(b)||i.get(b.toLowerCase())||null}async function n(a,b,c={}){let d=`${j(b)}/v1/models/metadata?include_in_cli=true`,f=new AbortController,h=setTimeout(()=>f.abort(Error("Kimchi models fetch timeout")),2e4),i=c.signal?AbortSignal.any([c.signal,f.signal]):f.signal;try{let b=await (0,e.proxyAwareFetch)(d,{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${a}`,"User-Agent":"kimchi/0.1.40"},cache:"no-store",signal:i},c.proxyOptions||null);if(!b.ok){let a=Error(`Kimchi models ${b.status}: ${b.statusText}`);throw a.status=b.status,a.retryable=g.has(b.status),a}let f=await b.json();return Array.isArray(f?.models)?f.models:[]}finally{clearTimeout(h)}}async function o(a,b={}){let c,e,g,m=k(a);if(!m)return null;let p=a?.providerSpecificData?.kimchiEndpoint||b.endpoint||f,q=(g=(e=a?.providerSpecificData||{}).userId||e.username||a?.refreshToken||k(a)||"anonymous",(0,d.createHash)("sha256").update(`kimchi:${j(p)}:${g}`).digest("hex")),r=Date.now();if(!b.forceRefresh){let a=h.get(q);if(a&&a.expiresAt>r)return a}try{c=await n(m,p,b)}catch(a){return b.log?.warn?.("KIMCHI_MODELS",a.message),null}let s=c.map(l).filter(Boolean);if(0===s.length)return null;for(let a of s||[])a?.id&&(i.set(a.id,a),i.set(a.id.toLowerCase(),a));let t={expiresAt:Date.now()+3e5,models:s,rawModels:c};return h.set(q,t),t}},53225:(a,b,c)=>{c.d(b,{EV:()=>l,X5:()=>k});var d=c(55511),e=c(39609),f=c(78085),g=c(30022);let h=new Map,i=new Map;async function j(a,b,c=null){let d,h,i={userId:(h=a?.providerSpecificData||{}).userId,authToken:a.accessToken,name:a.displayName||"",email:a.email||"",machineId:h.machineId||""};if(!i.userId||!i.authToken)return null;let k={Accept:"application/json","Accept-Encoding":"identity",...(0,f.d)(Buffer.alloc(0),g.t6,i)},l=new AbortController,m=null,n=null;try{m=setTimeout(()=>l.abort("timeout"),15e3),b&&"function"==typeof b.addEventListener&&(b.aborted?l.abort(b.reason):(n=()=>l.abort(b.reason),b.addEventListener("abort",n))),d=await (0,e.proxyAwareFetch)(g.t6,{method:"GET",headers:k,signal:l.signal},c)}finally{m&&clearTimeout(m),b&&n&&b.removeEventListener("abort",n)}if(!d.ok)return null;let o=await d.json().catch(()=>null);if(!o||!Array.isArray(o.chat))return null;let p=[],q=new Map;for(let a of o.chat){if(!a||"object"!=typeof a)continue;let b=a.key;if(!b||(q.set(b,a),!1===a.enable))continue;let c=a.display_name||b,d=Number(a.max_input_tokens)||131072;p.push({id:b,name:`${c}`,contextLength:d,isVL:!!a.is_vl,isReasoning:!!a.is_reasoning,maxOutputTokens:Number(a.max_output_tokens)||0,description:a.description||""})}return{models:p,rawConfigs:q}}async function k(a,b,c={}){let d=await l(a,c);if(!d)return null;let e=d.rawConfigs.get(b);return e?{...e,key:b}:null}async function l(a,b={}){let c;if(!a?.accessToken||!(a.providerSpecificData||{}).userId)return null;let e=(c=(a?.providerSpecificData||{}).userId||a?.refreshToken||a?.accessToken||"anonymous",(0,d.createHash)("sha256").update(`qoder:${c}`).digest("hex")),f=Date.now();if(!b.forceRefresh){let a=h.get(e);if(a&&a.expiresAt>f)return a}let g=i.get(e);if(g&&!b.forceRefresh)return g;let k=(async()=>{let c=await j(a,b.signal,b.proxyOptions);if(!c)return null;let d={expiresAt:Date.now()+36e5,models:c.models,rawConfigs:c.rawConfigs,fetched:!0};return h.set(e,d),d})();i.set(e,k);try{return await k}finally{i.get(e)===k&&i.delete(e)}}},78085:(a,b,c)=>{c.d(b,{d:()=>i});var d=c(55511),e=c.n(d),f=c(47293),g=c(30022);function h(a){return e().createHash("md5").update(a).digest("hex")}function i(a,b,c){var d;let i,j;if(!c?.userId)throw Error("cosy: user id is empty");if(!c?.authToken)throw Error("cosy: auth token is empty");let k=Buffer.isBuffer(a)?a:"string"==typeof a?Buffer.from(a,"latin1"):Buffer.from(a||[]),{cosyKey:l,info:m}=(d={uid:c.userId,security_oauth_token:c.authToken,name:c.name||"",aid:"",email:c.email||""},i=(0,f.A)().slice(0,16),j=function(a,b){var c;let d,f,g=Buffer.from(b,"utf8");if(16!==g.length)throw Error(`aes key must be 16 bytes, got ${g.length}`);let h=g.subarray(0,16),i=e().createCipheriv("aes-128-cbc",g,h);i.setAutoPadding(!1);let j=(d=16-(c=Buffer.from(a,"utf8")).length%16,f=Buffer.alloc(c.length+d,d),c.copy(f,0),f);return Buffer.concat([i.update(j),i.final()]).toString("base64")}(JSON.stringify(d),i),{cosyKey:e().publicEncrypt({key:g.pr,padding:e().constants.RSA_PKCS1_PADDING},Buffer.from(i,"utf8")).toString("base64"),info:j}),n=String(Math.floor(Date.now()/1e3)),o=JSON.stringify({version:"v1",requestId:(0,f.A)(),info:m,cosyVersion:g.cT,ideVersion:""}),p=Buffer.from(o,"utf8").toString("base64"),q=function(a){let b;try{b=new URL(a).pathname||""}catch{return""}return b.startsWith("/algo")?b.slice(5):b}(b),r=`${p}
56
+ -----END PUBLIC KEY-----`},39006:a=>{a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.79","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"./cli/cli.js"},"files":["cli/","src/","public/","scripts/","i18n/","assets/","images/","open-sse/","next.config.mjs","postcss.config.mjs","jsconfig.json","start.sh","package.json","README.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"next build --webpack","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","prepack":"node cli/scripts/build-cli.js","postinstall":"node cli/hooks/postinstall.js || exit 0"},"dependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","confbox":"^0.2.4","express":"^5.2.1","fs":"^0.0.1-security","http-proxy-middleware":"^3.0.5","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","monaco-editor":"^0.55.1","next":"^16.1.6","node-forge":"^1.3.3","node-machine-id":"^1.1.12","open":"^11.0.0","ora":"^9.1.0","react":"19.2.4","react-dom":"19.2.4","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks-proxy-agent":"^10.1.0","sql.js":"^1.14.1","undici":"^8.4.1","uuid":"^14.0.1","zustand":"^5.0.10"},"comment_optional_runtime":"Heavy packages are NOT optionalDependencies (clean `npm i -g`, no deprecated noise). postinstall warm-ups them into ~/.zevai/runtime so one command still gets full features. ZEVAI_MINIMAL_POSTINSTALL=1 skips browser downloads. Runtime code can still lazy-retry: better-sqlite3, camoufox-js, cloakbrowser, node-pty, playwright.","devDependencies":{"@tailwindcss/postcss":"^4.1.18","better-sqlite3":"^12.6.2","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","postcss":"^8.5.6","tailwindcss":"^4"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"https://github.com/Verifiedlabs/zevairouter"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},52007:(a,b,c)=>{c.d(b,{av:()=>o,gK:()=>m});var d=c(55511),e=c(39609);let f="https://llm.kimchi.dev",g=new Set([429,500,502,503,504]),h=new Map,i=new Map;function j(a){return(("string"==typeof a?a.trim():"")||f).replace(/\/+$/,"")}function k(a){return a?.accessToken||a?.apiKey||a?.providerSpecificData?.apiKey||null}function l(a){if(!a||"object"!=typeof a)return null;let b=a.slug||a.id||a.model||a.name;if("string"!=typeof b||""===b.trim())return null;let c=Array.isArray(a.input_modalities)?a.input_modalities.filter(a=>"text"===a||"image"===a):[],d=a.limits&&"object"==typeof a.limits?a.limits:{},e=Number(d.context_window||a.contextLength||a.context_length)||void 0,f=Number(d.max_output_tokens||a.maxOutputTokens||a.max_output_tokens)||void 0,g="string"==typeof a.provider?a.provider:"",h=!0===a.reasoning,i=Array.isArray(c)&&c.includes("image")?"imageToText":"llm",j={...a,id:b.trim(),name:String(a.display_name||a.displayName||a.name||b).trim(),provider:g,upstreamProvider:g,reasoning:h,inputModalities:c,kind:i,type:i,capabilities:{vision:c.includes("image"),reasoning:h,...e?{contextWindow:e}:{},...f?{maxOutput:f}:{},...g?{upstreamProvider:g}:{}},...e?{contextLength:e}:{},...f?{maxOutputTokens:f}:{}};return"anthropic"===g&&(j.compat={supportsReasoningEffort:!1,cacheControlFormat:"anthropic"}),j}function m(a){if("string"!=typeof a||""===a.trim())return null;let b=a.includes("/")?a.split("/").pop():a;return i.get(b)||i.get(b.toLowerCase())||null}async function n(a,b,c={}){let d=`${j(b)}/v1/models/metadata?include_in_cli=true`,f=new AbortController,h=setTimeout(()=>f.abort(Error("Kimchi models fetch timeout")),2e4),i=c.signal?AbortSignal.any([c.signal,f.signal]):f.signal;try{let b=await (0,e.proxyAwareFetch)(d,{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${a}`,"User-Agent":"kimchi/0.1.40"},cache:"no-store",signal:i},c.proxyOptions||null);if(!b.ok){let a=Error(`Kimchi models ${b.status}: ${b.statusText}`);throw a.status=b.status,a.retryable=g.has(b.status),a}let f=await b.json();return Array.isArray(f?.models)?f.models:[]}finally{clearTimeout(h)}}async function o(a,b={}){let c,e,g,m=k(a);if(!m)return null;let p=a?.providerSpecificData?.kimchiEndpoint||b.endpoint||f,q=(g=(e=a?.providerSpecificData||{}).userId||e.username||a?.refreshToken||k(a)||"anonymous",(0,d.createHash)("sha256").update(`kimchi:${j(p)}:${g}`).digest("hex")),r=Date.now();if(!b.forceRefresh){let a=h.get(q);if(a&&a.expiresAt>r)return a}try{c=await n(m,p,b)}catch(a){return b.log?.warn?.("KIMCHI_MODELS",a.message),null}let s=c.map(l).filter(Boolean);if(0===s.length)return null;for(let a of s||[])a?.id&&(i.set(a.id,a),i.set(a.id.toLowerCase(),a));let t={expiresAt:Date.now()+3e5,models:s,rawModels:c};return h.set(q,t),t}},53225:(a,b,c)=>{c.d(b,{EV:()=>l,X5:()=>k});var d=c(55511),e=c(39609),f=c(78085),g=c(30022);let h=new Map,i=new Map;async function j(a,b,c=null){let d,h,i={userId:(h=a?.providerSpecificData||{}).userId,authToken:a.accessToken,name:a.displayName||"",email:a.email||"",machineId:h.machineId||""};if(!i.userId||!i.authToken)return null;let k={Accept:"application/json","Accept-Encoding":"identity",...(0,f.d)(Buffer.alloc(0),g.t6,i)},l=new AbortController,m=null,n=null;try{m=setTimeout(()=>l.abort("timeout"),15e3),b&&"function"==typeof b.addEventListener&&(b.aborted?l.abort(b.reason):(n=()=>l.abort(b.reason),b.addEventListener("abort",n))),d=await (0,e.proxyAwareFetch)(g.t6,{method:"GET",headers:k,signal:l.signal},c)}finally{m&&clearTimeout(m),b&&n&&b.removeEventListener("abort",n)}if(!d.ok)return null;let o=await d.json().catch(()=>null);if(!o||!Array.isArray(o.chat))return null;let p=[],q=new Map;for(let a of o.chat){if(!a||"object"!=typeof a)continue;let b=a.key;if(!b||(q.set(b,a),!1===a.enable))continue;let c=a.display_name||b,d=Number(a.max_input_tokens)||131072;p.push({id:b,name:`${c}`,contextLength:d,isVL:!!a.is_vl,isReasoning:!!a.is_reasoning,maxOutputTokens:Number(a.max_output_tokens)||0,description:a.description||""})}return{models:p,rawConfigs:q}}async function k(a,b,c={}){let d=await l(a,c);if(!d)return null;let e=d.rawConfigs.get(b);return e?{...e,key:b}:null}async function l(a,b={}){let c;if(!a?.accessToken||!(a.providerSpecificData||{}).userId)return null;let e=(c=(a?.providerSpecificData||{}).userId||a?.refreshToken||a?.accessToken||"anonymous",(0,d.createHash)("sha256").update(`qoder:${c}`).digest("hex")),f=Date.now();if(!b.forceRefresh){let a=h.get(e);if(a&&a.expiresAt>f)return a}let g=i.get(e);if(g&&!b.forceRefresh)return g;let k=(async()=>{let c=await j(a,b.signal,b.proxyOptions);if(!c)return null;let d={expiresAt:Date.now()+36e5,models:c.models,rawConfigs:c.rawConfigs,fetched:!0};return h.set(e,d),d})();i.set(e,k);try{return await k}finally{i.get(e)===k&&i.delete(e)}}},78085:(a,b,c)=>{c.d(b,{d:()=>i});var d=c(55511),e=c.n(d),f=c(47293),g=c(30022);function h(a){return e().createHash("md5").update(a).digest("hex")}function i(a,b,c){var d;let i,j;if(!c?.userId)throw Error("cosy: user id is empty");if(!c?.authToken)throw Error("cosy: auth token is empty");let k=Buffer.isBuffer(a)?a:"string"==typeof a?Buffer.from(a,"latin1"):Buffer.from(a||[]),{cosyKey:l,info:m}=(d={uid:c.userId,security_oauth_token:c.authToken,name:c.name||"",aid:"",email:c.email||""},i=(0,f.A)().slice(0,16),j=function(a,b){var c;let d,f,g=Buffer.from(b,"utf8");if(16!==g.length)throw Error(`aes key must be 16 bytes, got ${g.length}`);let h=g.subarray(0,16),i=e().createCipheriv("aes-128-cbc",g,h);i.setAutoPadding(!1);let j=(d=16-(c=Buffer.from(a,"utf8")).length%16,f=Buffer.alloc(c.length+d,d),c.copy(f,0),f);return Buffer.concat([i.update(j),i.final()]).toString("base64")}(JSON.stringify(d),i),{cosyKey:e().publicEncrypt({key:g.pr,padding:e().constants.RSA_PKCS1_PADDING},Buffer.from(i,"utf8")).toString("base64"),info:j}),n=String(Math.floor(Date.now()/1e3)),o=JSON.stringify({version:"v1",requestId:(0,f.A)(),info:m,cosyVersion:g.cT,ideVersion:""}),p=Buffer.from(o,"utf8").toString("base64"),q=function(a){let b;try{b=new URL(a).pathname||""}catch{return""}return b.startsWith("/algo")?b.slice(5):b}(b),r=`${p}
7
57
  ${l}
8
58
  ${n}
9
59
  ${k.toString("latin1")}
@@ -180,4 +180,4 @@ Respond ONLY with the JSON object, no other text.`,e=Array.isArray(a.messages)?a
180
180
 
181
181
  ${d}`:Array.isArray(f.content)&&f.content.push({type:"text",text:`
182
182
 
183
- ${d}`}):e.unshift({role:"system",content:d}),{...a,messages:e,response_format:{type:"json_object"}}}buildUrl(a,b,c=0,d=null){if(this.provider?.startsWith?.("openai-compatible-")){let a=(d?.providerSpecificData?.baseUrl||"https://api.openai.com/v1").replace(/\/$/,""),b=this.provider.includes("responses")?"/responses":"/chat/completions";return`${a}${b}`}if(this.provider?.startsWith?.("anthropic-compatible-")){let a=(d?.providerSpecificData?.baseUrl||"https://api.anthropic.com/v1").replace(/\/$/,"");return`${a}/messages`}switch(this.provider){case"claude":case"glm":case"kimi":case"minimax":case"minimax-cn":case"kimi-coding":return`${this.config.baseUrl}?beta=true`;case"gemini":return`${this.config.baseUrl}/${a}:${b?"streamGenerateContent?alt=sse":"generateContent"}`;default:{let a=this.config.baseUrl;if(a?.includes("{accountId}")){let b=d?.providerSpecificData?.accountId;if(!b)throw Error(`${this.provider} requires accountId in providerSpecificData`);return a.replace("{accountId}",b)}return a}}}buildHeaders(a,b=!0){let c={"Content-Type":"application/json",...this.config.headers};switch(this.provider){case"gemini":a.apiKey?c["x-goog-api-key"]=a.apiKey:c.Authorization=`Bearer ${a.accessToken}`;break;case"claude":{let b=(0,h.b)();if(b){for(let a of Object.keys(b)){let d=a.replace(/(^|-)([a-z])/g,(a,b,c)=>b+c.toUpperCase());if("anthropic-beta"===a){let e=new Set((c[d]||c[a]||"").split(",").map(a=>a.trim()).filter(Boolean)),f=new Set(b[a].split(",").map(a=>a.trim()).filter(Boolean));for(let a of e)f.add(a);b[a]=Array.from(f).join(",")}d!==a&&void 0!==c[d]&&delete c[d]}Object.assign(c,b)}a.apiKey?c["x-api-key"]=a.apiKey:c.Authorization=`Bearer ${a.accessToken}`;break}case"glm":case"kimi":case"minimax":case"minimax-cn":case"kimi-coding":c["x-api-key"]=a.apiKey||a.accessToken,"kimi-coding"===this.provider&&Object.assign(c,(0,f.VK)());break;default:if(this.provider?.startsWith?.("anthropic-compatible-"))a.apiKey?c["x-api-key"]=a.apiKey:a.accessToken&&(c.Authorization=`Bearer ${a.accessToken}`),c["anthropic-version"]||(c["anthropic-version"]="2023-06-01");else if("gitlab"===this.provider)c.Authorization=`Bearer ${a.apiKey||a.accessToken}`;else if(this.provider?.startsWith?.("codebuddy")){let b=n(),d=n();a.apiKey?c["X-Api-Key"]=a.apiKey:c.Authorization=`Bearer ${a.accessToken}`,c.Accept="text/event-stream",c["Content-Type"]="application/json; charset=utf-8",c["User-Agent"]="CLI/2.105.2 CodeBuddy/2.105.2",c["X-App"]="cli",c["X-Stainless-Runtime"]="node",c["X-Stainless-Lang"]="js",c["X-Stainless-Helper-Method"]="stream",c["X-Stainless-Retry-Count"]="0",c["X-Requested-With"]="XMLHttpRequest",c["X-Domain"]=a.providerSpecificData?.domain||this.config?.domain||"www.codebuddy.ai",c["X-Request-ID"]=b,c["X-Conversation-ID"]=d,c["X-Conversation-Request-ID"]=d,c["X-Conversation-Message-ID"]=b,c["X-Agent-Intent"]="craft",c["X-IDE-Type"]="CLI",c["X-IDE-Name"]="CLI",c["X-IDE-Version"]="2.105.2",c["X-Private-Data"]="false"}else"kilocode"===this.provider?(c.Authorization=`Bearer ${a.apiKey||a.accessToken}`,a.providerSpecificData?.orgId&&(c["X-Kilocode-OrganizationID"]=a.providerSpecificData.orgId)):"cline"===this.provider||"clinepass"===this.provider?Object.assign(c,(0,g.buildClineHeaders)(a.apiKey||a.accessToken)):this.config?.format==="claude"?(c["x-api-key"]=a.apiKey||a.accessToken,c["anthropic-version"]||(c["anthropic-version"]="2023-06-01")):c.Authorization=`Bearer ${a.apiKey||a.accessToken}`}if(this.provider?.startsWith?.("anthropic-compatible-")){let b=a?.providerSpecificData?.baseUrl||"";if(!(""===b||b.includes("api.anthropic.com"))){for(let a of(delete c["anthropic-dangerous-direct-browser-access"],delete c["Anthropic-Dangerous-Direct-Browser-Access"],delete c["x-app"],delete c["X-App"],["anthropic-beta","Anthropic-Beta"]))if(c[a]){let b=c[a].split(",").map(a=>a.trim()).filter(a=>a&&"claude-code-20250219"!==a).join(",");b?c[a]=b:delete c[a]}}}return b&&(c.Accept="text/event-stream"),c}async refreshCredentials(a,b,c=null){if(!a.refreshToken)return null;let d={claude:()=>this.refreshWithJSON(f.NA.anthropic.token,{grant_type:"refresh_token",refresh_token:a.refreshToken,client_id:e.xq.claude.clientId},c),codex:()=>this.refreshWithForm(f.NA.openai.token,{grant_type:"refresh_token",refresh_token:a.refreshToken,client_id:e.xq.codex.clientId,scope:"openid profile email offline_access"},c),qwen:()=>this.refreshWithForm(f.NA.qwen.token,{grant_type:"refresh_token",refresh_token:a.refreshToken,client_id:e.xq.qwen.clientId},c),iflow:()=>this.refreshIflow(a.refreshToken,c),gemini:()=>this.refreshGoogle(a.refreshToken,c),kiro:()=>this.refreshKiro(a.refreshToken,c),codebuddy:()=>this.refreshCodeBuddy(a.refreshToken,c),cline:()=>this.refreshCline(a.refreshToken,c),clinepass:()=>this.refreshCline(a.refreshToken,c),"kimi-coding":()=>this.refreshKimiCoding(a.refreshToken,c),kilocode:()=>this.refreshKilocode(a.refreshToken,c)}[this.provider];if(!d)return null;try{let a=await d();return a&&b?.info?.("TOKEN",`${this.provider} refreshed`),a}catch(a){return b?.error?.("TOKEN",`${this.provider} refresh error: ${a.message}`),null}}async refreshWithJSON(a,b,c=null){let d=await (0,i.proxyAwareFetch)(a,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(b)},c);if(!d.ok)return null;let e=await d.json();return{accessToken:e.access_token,refreshToken:e.refresh_token||b.refresh_token,expiresIn:e.expires_in}}async refreshWithForm(a,b,c=null){let d=await (0,i.proxyAwareFetch)(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams(b)},c);if(!d.ok)return null;let e=await d.json();return{accessToken:e.access_token,refreshToken:e.refresh_token||b.refresh_token,expiresIn:e.expires_in}}async refreshIflow(a,b=null){let c=btoa(`${e.xq.iflow.clientId}:${e.xq.iflow.clientSecret}`),d=await (0,i.proxyAwareFetch)(f.NA.iflow.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${c}`},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:e.xq.iflow.clientId,client_secret:e.xq.iflow.clientSecret})},b);if(!d.ok)return null;let g=await d.json();return{accessToken:g.access_token,refreshToken:g.refresh_token||a,expiresIn:g.expires_in}}async refreshGoogle(a,b=null){let c=await (0,i.proxyAwareFetch)(f.NA.google.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:this.config.clientId,client_secret:this.config.clientSecret})},b);if(!c.ok)return null;let d=await c.json();return{accessToken:d.access_token,refreshToken:d.refresh_token||a,expiresIn:d.expires_in}}async refreshKiro(a,b=null){let c=await (0,i.proxyAwareFetch)(e.xq.kiro.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"kiro-cli/1.0.0"},body:JSON.stringify({refreshToken:a})},b);if(!c.ok)return null;let d=await c.json();return{accessToken:d.accessToken,refreshToken:d.refreshToken||a,expiresIn:d.expiresIn}}async refreshCodeBuddy(a,b=null){let c=this.config?.refreshUrl||e.xq.codebuddy.refreshUrl,d=this.config?.domain||"www.codebuddy.ai",f=await (0,i.proxyAwareFetch)(c,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"CLI/2.63.2 CodeBuddy/2.63.2","X-Requested-With":"XMLHttpRequest","X-Domain":d,"X-Refresh-Token":a,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"},b);if(!f.ok)return null;let g=await f.json(),h=g?.data||g,j=h?.accessToken||h?.access_token;return j?{accessToken:j,refreshToken:h?.refreshToken||h?.refresh_token||a,expiresIn:h?.expiresIn||h?.expires_in||86400}:null}async refreshCline(a,b=null){console.log("[DEBUG] Refreshing Cline token, refreshToken length:",a?.length);let c=await (0,i.proxyAwareFetch)("https://api.cline.bot/api/v1/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:a,grantType:"refresh_token",clientType:"extension"})},b);if(console.log("[DEBUG] Cline refresh response status:",c.status),!c.ok)return console.log("[DEBUG] Cline refresh error:",await c.text()),null;let d=await c.json();console.log("[DEBUG] Cline refresh payload:",JSON.stringify(d).substring(0,200));let e=d?.data||d,f=e?.expiresAt,g=f?Math.max(1,Math.floor((new Date(f).getTime()-Date.now())/1e3)):void 0;return console.log("[DEBUG] Cline refresh success, expiresIn:",g),{accessToken:e?.accessToken,refreshToken:e?.refreshToken||a,expiresIn:g}}async refreshKimiCoding(a,b=null){let c=(0,f.VK)(),d=await (0,i.proxyAwareFetch)("https://auth.kimi.com/api/oauth/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",...c},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:"17e5f671-d194-4dfb-9706-5516cb48c098"})},b);if(!d.ok)return null;let e=await d.json();return{accessToken:e.access_token,refreshToken:e.refresh_token||a,expiresIn:e.expires_in}}async refreshKilocode(a,b=null){return null}}},98625:(a,b,c)=>{c.d(b,{P:()=>e});var d=c(96179);class e extends d.L{constructor(){super("azure")}buildUrl(a,b,c=0,d=null){let e=d?.providerSpecificData?.azureEndpoint||process.env.AZURE_ENDPOINT||"https://api.openai.com",f=d?.providerSpecificData?.apiVersion||process.env.AZURE_API_VERSION||"2024-10-01-preview",g=d?.providerSpecificData?.deployment||a||process.env.AZURE_DEPLOYMENT||"gpt-4",h=e.replace(/\/$/,"");return`${h}/openai/deployments/${g}/chat/completions?api-version=${f}`}buildHeaders(a,b=!0){let c={"Content-Type":"application/json",...this.config.headers},d=a?.apiKey||a?.accessToken||process.env.OPENAI_API_KEY;d&&(c["api-key"]=d);let e=a?.providerSpecificData?.organization||process.env.AZURE_ORGANIZATION;return e&&(c["OpenAI-Organization"]=e),b&&(c.Accept="text/event-stream"),c}transformRequest(a,b,c,d){return b}}}};
183
+ ${d}`}):e.unshift({role:"system",content:d}),{...a,messages:e,response_format:{type:"json_object"}}}buildUrl(a,b,c=0,d=null){if(this.provider?.startsWith?.("openai-compatible-")){let a=(d?.providerSpecificData?.baseUrl||"https://api.openai.com/v1").replace(/\/$/,""),b=this.provider.includes("responses")?"/responses":"/chat/completions";return`${a}${b}`}if(this.provider?.startsWith?.("anthropic-compatible-")){let a=(d?.providerSpecificData?.baseUrl||"https://api.anthropic.com/v1").replace(/\/$/,"");return`${a}/messages`}switch(this.provider){case"claude":case"glm":case"kimi":case"minimax":case"minimax-cn":case"kimi-coding":return`${this.config.baseUrl}?beta=true`;case"gemini":return`${this.config.baseUrl}/${a}:${b?"streamGenerateContent?alt=sse":"generateContent"}`;default:{let a=this.config.baseUrl;if(a?.includes("{accountId}")){let b=d?.providerSpecificData?.accountId;if(!b)throw Error(`${this.provider} requires accountId in providerSpecificData`);return a.replace("{accountId}",b)}return a}}}buildHeaders(a,b=!0){let c={"Content-Type":"application/json",...this.config.headers};switch(this.provider){case"gemini":a.apiKey?c["x-goog-api-key"]=a.apiKey:c.Authorization=`Bearer ${a.accessToken}`;break;case"claude":{let b=(0,h.b)();if(b){for(let a of Object.keys(b)){let d=a.replace(/(^|-)([a-z])/g,(a,b,c)=>b+c.toUpperCase());if("anthropic-beta"===a){let e=new Set((c[d]||c[a]||"").split(",").map(a=>a.trim()).filter(Boolean)),f=new Set(b[a].split(",").map(a=>a.trim()).filter(Boolean));for(let a of e)f.add(a);b[a]=Array.from(f).join(",")}d!==a&&void 0!==c[d]&&delete c[d]}Object.assign(c,b)}a.apiKey?c["x-api-key"]=a.apiKey:c.Authorization=`Bearer ${a.accessToken}`;break}case"glm":case"kimi":case"minimax":case"minimax-cn":case"kimi-coding":c["x-api-key"]=a.apiKey||a.accessToken,"kimi-coding"===this.provider&&Object.assign(c,(0,f.VK)());break;default:if(this.provider?.startsWith?.("anthropic-compatible-"))a.apiKey?c["x-api-key"]=a.apiKey:a.accessToken&&(c.Authorization=`Bearer ${a.accessToken}`),c["anthropic-version"]||(c["anthropic-version"]="2023-06-01");else if("gitlab"===this.provider)c.Authorization=`Bearer ${a.apiKey||a.accessToken}`;else if(this.provider?.startsWith?.("codebuddy")){let b=n(),d=n();a.apiKey?c["X-Api-Key"]=a.apiKey:c.Authorization=`Bearer ${a.accessToken}`,c.Accept="text/event-stream",c["Content-Type"]="application/json; charset=utf-8",c["User-Agent"]="CLI/2.105.2 CodeBuddy/2.105.2",c["X-App"]="cli",c["X-Stainless-Runtime"]="node",c["X-Stainless-Lang"]="js",c["X-Stainless-Helper-Method"]="stream",c["X-Stainless-Retry-Count"]="0",c["X-Requested-With"]="XMLHttpRequest",c["X-Domain"]=a.providerSpecificData?.domain||this.config?.domain||"www.codebuddy.ai",c["X-Request-ID"]=b,c["X-Conversation-ID"]=d,c["X-Conversation-Request-ID"]=d,c["X-Conversation-Message-ID"]=b,c["X-Agent-Intent"]="craft",c["X-IDE-Type"]="CLI",c["X-IDE-Name"]="CLI",c["X-IDE-Version"]="2.105.2",c["X-Private-Data"]="false"}else"kilocode"===this.provider?(c.Authorization=`Bearer ${a.apiKey||a.accessToken}`,a.providerSpecificData?.orgId&&(c["X-Kilocode-OrganizationID"]=a.providerSpecificData.orgId)):"cline"===this.provider||"clinepass"===this.provider?Object.assign(c,(0,g.buildClineHeaders)(a.apiKey||a.accessToken)):this.config?.format==="claude"?(c["x-api-key"]=a.apiKey||a.accessToken,c["anthropic-version"]||(c["anthropic-version"]="2023-06-01")):c.Authorization=`Bearer ${a.apiKey||a.accessToken}`}if(this.provider?.startsWith?.("anthropic-compatible-")){let b=a?.providerSpecificData?.baseUrl||"";if(!(""===b||b.includes("api.anthropic.com"))){for(let a of(delete c["anthropic-dangerous-direct-browser-access"],delete c["Anthropic-Dangerous-Direct-Browser-Access"],delete c["x-app"],delete c["X-App"],["anthropic-beta","Anthropic-Beta"]))if(c[a]){let b=c[a].split(",").map(a=>a.trim()).filter(a=>a&&"claude-code-20250219"!==a).join(",");b?c[a]=b:delete c[a]}}}return b&&(c.Accept="text/event-stream"),c}async refreshCredentials(a,b,c=null){if(!a.refreshToken)return null;let d={claude:()=>this.refreshWithJSON(f.NA.anthropic.token,{grant_type:"refresh_token",refresh_token:a.refreshToken,client_id:e.xq.claude.clientId},c),codex:()=>this.refreshWithForm(f.NA.openai.token,{grant_type:"refresh_token",refresh_token:a.refreshToken,client_id:e.xq.codex.clientId,scope:"openid profile email offline_access"},c),qwen:()=>this.refreshWithForm(f.NA.qwen.token,{grant_type:"refresh_token",refresh_token:a.refreshToken,client_id:e.xq.qwen.clientId},c),iflow:()=>this.refreshIflow(a.refreshToken,c),gemini:()=>this.refreshGoogle(a.refreshToken,c),kiro:()=>this.refreshKiro(a.refreshToken,c),codebuddy:()=>this.refreshCodeBuddy(a.refreshToken,c),cline:()=>this.refreshCline(a.refreshToken,c),clinepass:()=>this.refreshCline(a.refreshToken,c),"kimi-coding":()=>this.refreshKimiCoding(a.refreshToken,c),kilocode:()=>this.refreshKilocode(a.refreshToken,c)}[this.provider];if(!d)return null;try{let a=await d();return a&&b?.info?.("TOKEN",`${this.provider} refreshed`),a}catch(a){return b?.error?.("TOKEN",`${this.provider} refresh error: ${a.message}`),null}}async refreshWithJSON(a,b,c=null){let d=await (0,i.proxyAwareFetch)(a,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(b)},c);if(!d.ok)return null;let e=await d.json();return{accessToken:e.access_token,refreshToken:e.refresh_token||b.refresh_token,expiresIn:e.expires_in}}async refreshWithForm(a,b,c=null){let d=await (0,i.proxyAwareFetch)(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams(b)},c);if(!d.ok)return null;let e=await d.json();return{accessToken:e.access_token,refreshToken:e.refresh_token||b.refresh_token,expiresIn:e.expires_in}}async refreshIflow(a,b=null){let c=btoa(`${e.xq.iflow.clientId}:${e.xq.iflow.clientSecret}`),d=await (0,i.proxyAwareFetch)(f.NA.iflow.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${c}`},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:e.xq.iflow.clientId,client_secret:e.xq.iflow.clientSecret})},b);if(!d.ok)return null;let g=await d.json();return{accessToken:g.access_token,refreshToken:g.refresh_token||a,expiresIn:g.expires_in}}async refreshGoogle(a,b=null){let c=await (0,i.proxyAwareFetch)(f.NA.google.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:this.config.clientId,client_secret:this.config.clientSecret})},b);if(!c.ok)return null;let d=await c.json();return{accessToken:d.access_token,refreshToken:d.refresh_token||a,expiresIn:d.expires_in}}async refreshKiro(a,b=null){let c=await (0,i.proxyAwareFetch)(e.xq.kiro.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"kiro-cli/2.12.2"},body:JSON.stringify({refreshToken:a})},b);if(!c.ok)return null;let d=await c.json();return{accessToken:d.accessToken,refreshToken:d.refreshToken||a,expiresIn:d.expiresIn}}async refreshCodeBuddy(a,b=null){let c=this.config?.refreshUrl||e.xq.codebuddy.refreshUrl,d=this.config?.domain||"www.codebuddy.ai",f=await (0,i.proxyAwareFetch)(c,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"CLI/2.63.2 CodeBuddy/2.63.2","X-Requested-With":"XMLHttpRequest","X-Domain":d,"X-Refresh-Token":a,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"},b);if(!f.ok)return null;let g=await f.json(),h=g?.data||g,j=h?.accessToken||h?.access_token;return j?{accessToken:j,refreshToken:h?.refreshToken||h?.refresh_token||a,expiresIn:h?.expiresIn||h?.expires_in||86400}:null}async refreshCline(a,b=null){console.log("[DEBUG] Refreshing Cline token, refreshToken length:",a?.length);let c=await (0,i.proxyAwareFetch)("https://api.cline.bot/api/v1/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:a,grantType:"refresh_token",clientType:"extension"})},b);if(console.log("[DEBUG] Cline refresh response status:",c.status),!c.ok)return console.log("[DEBUG] Cline refresh error:",await c.text()),null;let d=await c.json();console.log("[DEBUG] Cline refresh payload:",JSON.stringify(d).substring(0,200));let e=d?.data||d,f=e?.expiresAt,g=f?Math.max(1,Math.floor((new Date(f).getTime()-Date.now())/1e3)):void 0;return console.log("[DEBUG] Cline refresh success, expiresIn:",g),{accessToken:e?.accessToken,refreshToken:e?.refreshToken||a,expiresIn:g}}async refreshKimiCoding(a,b=null){let c=(0,f.VK)(),d=await (0,i.proxyAwareFetch)("https://auth.kimi.com/api/oauth/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",...c},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:"17e5f671-d194-4dfb-9706-5516cb48c098"})},b);if(!d.ok)return null;let e=await d.json();return{accessToken:e.access_token,refreshToken:e.refresh_token||a,expiresIn:e.expires_in}}async refreshKilocode(a,b=null){return null}}},98625:(a,b,c)=>{c.d(b,{P:()=>e});var d=c(96179);class e extends d.L{constructor(){super("azure")}buildUrl(a,b,c=0,d=null){let e=d?.providerSpecificData?.azureEndpoint||process.env.AZURE_ENDPOINT||"https://api.openai.com",f=d?.providerSpecificData?.apiVersion||process.env.AZURE_API_VERSION||"2024-10-01-preview",g=d?.providerSpecificData?.deployment||a||process.env.AZURE_DEPLOYMENT||"gpt-4",h=e.replace(/\/$/,"");return`${h}/openai/deployments/${g}/chat/completions?api-version=${f}`}buildHeaders(a,b=!0){let c={"Content-Type":"application/json",...this.config.headers},d=a?.apiKey||a?.accessToken||process.env.OPENAI_API_KEY;d&&(c["api-key"]=d);let e=a?.providerSpecificData?.organization||process.env.AZURE_ORGANIZATION;return e&&(c["OpenAI-Organization"]=e),b&&(c.Accept="text/event-stream"),c}transformRequest(a,b,c,d){return b}}}};
@@ -1 +1 @@
1
- "use strict";exports.id=3407,exports.ids=[1998,3407],exports.modules={15626:(a,b,c)=>{c.d(b,{buildClineHeaders:()=>e});let d=c(39006).version||"0.0.0";function e(a,b={}){let c,f=(c=function(a){if("string"!=typeof a)return"";let b=a.trim();return b?b.startsWith("workos:")?b:`workos:${b}`:""}(a))?`Bearer ${c}`:"",g={"HTTP-Referer":"https://cline.bot","X-Title":"Cline","User-Agent":`ZevaiRouter/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"zevairouter","X-CLIENT-VERSION":d,"X-CORE-VERSION":d,"X-IS-MULTIROOT":"false",...b};return f&&(g.Authorization=f),g}},30869:(a,b,c)=>{c.d(b,{UY:()=>h,X3:()=>i,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g});var d=c(39006),e=c(75681),f=c(81329);d.version;let g={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},h={maxLines:200,pollIntervalMs:1e3},i={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"}},39006:a=>{a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.77","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"./cli/cli.js"},"files":["cli/","src/","public/","scripts/","i18n/","assets/","images/","open-sse/","next.config.mjs","postcss.config.mjs","jsconfig.json","start.sh","package.json","README.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"next build --webpack","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","prepack":"node cli/scripts/build-cli.js","postinstall":"node cli/hooks/postinstall.js || exit 0"},"dependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","confbox":"^0.2.4","express":"^5.2.1","fs":"^0.0.1-security","http-proxy-middleware":"^3.0.5","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","monaco-editor":"^0.55.1","next":"^16.1.6","node-forge":"^1.3.3","node-machine-id":"^1.1.12","open":"^11.0.0","ora":"^9.1.0","react":"19.2.4","react-dom":"19.2.4","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks-proxy-agent":"^10.1.0","sql.js":"^1.14.1","undici":"^8.4.1","uuid":"^14.0.1","zustand":"^5.0.10"},"comment_optional_runtime":"Heavy packages are NOT optionalDependencies (clean `npm i -g`, no deprecated noise). postinstall warm-ups them into ~/.zevai/runtime so one command still gets full features. ZEVAI_MINIMAL_POSTINSTALL=1 skips browser downloads. Runtime code can still lazy-retry: better-sqlite3, camoufox-js, cloakbrowser, node-pty, playwright.","devDependencies":{"@tailwindcss/postcss":"^4.1.18","better-sqlite3":"^12.6.2","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","postcss":"^8.5.6","tailwindcss":"^4"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"https://github.com/Verifiedlabs/zevairouter"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},39326:(a,b,c)=>{c.d(b,{B:()=>h,p:()=>g});var d=c(71998);function e(a){return null==a?"":String(a).trim()}let f=new Map;function g(a,b,c){if(!a||0===a.length)return null;if(1===a.length)return a[0];if("round-robin"===b){let b=f.get(c)||{index:-1};return b.index=(b.index+1)%a.length,f.set(c,b),a[b.index]}return"random"===b?a[Math.floor(Math.random()*a.length)]:a[0]}async function h(a={}){try{let b=e(a?.proxyPoolId),c="__none__"===b?"":b,f=function(a={}){let b=a?.connectionProxyEnabled===!0,c=e(a?.connectionProxyUrl);return{connectionProxyEnabled:b,connectionProxyUrl:c,connectionNoProxy:e(a?.connectionNoProxy)}}(a);if(c){let a=await (0,d.hr)(c),b=e(a?.proxyUrl),f=e(a?.noProxy);if(a&&!0===a.isActive&&b){if("vercel"===a.type||"cloudflare"===a.type||"deno"===a.type)return{source:a.type,proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:f,strictProxy:!0===a.strictProxy,vercelRelayUrl:b};return{source:"pool",proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!0,connectionProxyUrl:b,connectionNoProxy:f,strictProxy:!0===a.strictProxy}}}if(f.connectionProxyEnabled&&f.connectionProxyUrl)return{source:"legacy",proxyPoolId:c||null,proxyPool:null,...f};return{source:"none",proxyPoolId:c||null,proxyPool:null,...f}}catch(a){return console.error("[resolveConnectionProxyConfig] Failed to resolve proxy config:",a),{source:"error",proxyPoolId:null,proxyPool:null,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:"",strictProxy:!1}}}},47293:(a,b,c)=>{c.d(b,{A:()=>f});let d=new Uint8Array(16);var e=c(50122);let f=function(a,b,c){return b||a||!crypto.randomUUID?function(a,b,c){let f=(a=a||{}).random??a.rng?.()??crypto.getRandomValues(d);if(f.length<16)throw Error("Random bytes length must be >= 16");if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=f[a];return b}return(0,e.k)(f)}(a,b,c):crypto.randomUUID()}},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},66811:(a,b,c)=>{c.d(b,{F:()=>t});var d=c(89718),e=c(39326),f=c(74926),g=c(75681),h=c(30869),i=c(44404),j=c(35024),k=c(93943),l=c(92990),m=c(15626);let n={claude:{checkExpiry:!0,refreshable:!0},codex:{url:"https://chatgpt.com/backend-api/codex/responses",method:"POST",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"Content-Type":"application/json",originator:"codex_cli_rs","User-Agent":"codex_cli_rs/0.136.0"},body:JSON.stringify({model:"gpt-5.3-codex",input:[],stream:!1,store:!1}),acceptStatuses:[400],refreshable:!0},"gemini-cli":{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},antigravity:{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},github:{url:"https://api.github.com/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"User-Agent":"ZevaiRouter",Accept:"application/vnd.github+json"}},iflow:{buildUrl:a=>`https://iflow.cn/api/oauth/getUserInfo?accessToken=${encodeURIComponent(a)}`,method:"GET",noAuth:!0},qwen:{checkExpiry:!0,refreshable:!0},kiro:{checkExpiry:!0,refreshable:!0},qoder:{url:"https://openapi.qoder.sh/api/v1/userinfo",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!1},"kimi-coding":{checkExpiry:!0,refreshable:!1},cursor:{tokenExists:!0},kilocode:{url:`${l.MZ.apiBaseUrl}/api/profile`,method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},cline:{refreshable:!0},clinepass:{refreshable:!0},kimchi:{url:l.Td.validationUrl||"https://api.cast.ai/v1/llm/openai/supported-providers",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{Accept:"application/json","User-Agent":"kimchi/0.1.40"},refreshable:!1},"grok-cli":{url:j.xq["grok-cli"]?.userUrl||"https://cli-chat-proxy.grok.com/v1/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{Accept:"application/json",...j.xq["grok-cli"]?.headers||{"User-Agent":"grok-pager/0.2.93 grok-shell/0.2.93 (linux; x86_64)","x-xai-token-auth":"xai-grok-cli","x-grok-client-identifier":"grok-pager","x-grok-client-version":"0.2.93"}},refreshable:!0},gitlab:{url:"https://gitlab.com/api/v4/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},codebuddy:{tokenExists:!0},"codebuddy-cn":{tokenExists:!0}};async function o(a){return await fetch("https://api.cline.bot/api/v1/users/me",{method:"GET",headers:(0,m.buildClineHeaders)(a,{Accept:"application/json"})})}async function p(a){let b=a.provider,c=a.refreshToken;if(!c)return null;try{if("gemini-cli"===b||"antigravity"===b){let a="gemini-cli"===b?l.LT:l.YT,d=await fetch("https://oauth2.googleapis.com/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:a.clientId,client_secret:a.clientSecret,grant_type:"refresh_token",refresh_token:c})});if(!d.ok)return null;let e=await d.json();return{accessToken:e.access_token,expiresIn:e.expires_in,refreshToken:e.refresh_token||c}}if("codex"===b||"grok-cli"===b||"xai"===b)return await (0,k.Vq)(b,a,console);if("claude"===b){let a=await fetch(l.OV.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:c,client_id:l.OV.clientId})});if(!a.ok)return null;let b=await a.json();return{accessToken:b.access_token,expiresIn:b.expires_in,refreshToken:b.refresh_token||c}}if("kiro"===b){let b=a.providerSpecificData||{},d=b.clientId||a.clientId,e=b.clientSecret||a.clientSecret,f=b.region||a.region;if(d&&e){let a=`https://oidc.${f||"us-east-1"}.amazonaws.com/token`,b=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:d,clientSecret:e,refreshToken:c,grantType:"refresh_token"})});if(!b.ok)return null;let g=await b.json();return{accessToken:g.accessToken,expiresIn:g.expiresIn||3600,refreshToken:g.refreshToken||c}}let g=await fetch(l.Tx.socialRefreshUrl,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":"kiro-cli/1.0.0"},body:JSON.stringify({refreshToken:c})});if(!g.ok)return null;let h=await g.json();return{accessToken:h.accessToken,expiresIn:h.expiresIn||3600,refreshToken:h.refreshToken||c}}if("qwen"===b){let a=await fetch(l.Hp.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:c,client_id:l.Hp.clientId})});if(!a.ok)return null;let b=await a.json();return{accessToken:b.access_token,expiresIn:b.expires_in,refreshToken:b.refresh_token||c}}if("cline"===b||"clinepass"===b){let a=await fetch(l.lB.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:c,grantType:"refresh_token",clientType:"extension"})});if(!a.ok)return null;let b=await a.json(),d=b?.data||b,e=d?.expiresAt?Math.max(1,Math.floor((new Date(d.expiresAt).getTime()-Date.now())/1e3)):3600;return{accessToken:d?.accessToken,expiresIn:e,refreshToken:d?.refreshToken||c}}if("codebuddy"===b||"codebuddy-cn"===b){let a="codebuddy-cn"===b?l.ne:l.Nl,d=await fetch(a.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":a.domain,"X-Refresh-Token":c,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"});if(!d.ok)return null;let e=await d.json(),f=e?.data||e,g=f?.accessToken||f?.access_token;if(!g)return null;return{accessToken:g,expiresIn:f?.expiresIn||f?.expires_in||86400,refreshToken:f?.refreshToken||f?.refresh_token||c}}return null}catch(a){return console.log(`Error refreshing ${b} token:`,a.message),null}}async function q(a,b=null){if("autoclaw"===a.provider){if(!a.accessToken)return{valid:!1,error:"No access token",refreshed:!1};try{let{AUTOCLAW_WALLET_ENDPOINT:d,buildAutoClawWalletHeaders:e}=await c.e(2693).then(c.bind(c,42693)),f=await r(d,{method:"GET",headers:e(a.accessToken)},b);if(!f.ok){if(401===f.status||403===f.status)return{valid:!1,error:"Token invalid or revoked",refreshed:!1};return{valid:!1,error:`AutoClaw API returned ${f.status}`,refreshed:!1}}let g=await f.json().catch(()=>null);if(g&&0===g.code)return{valid:!0,error:null,refreshed:!1,newTokens:null};return{valid:!1,error:"Token invalid or revoked",refreshed:!1}}catch(a){return{valid:!1,error:a.message,refreshed:!1}}}let d=n[a.provider];if(!d)return{valid:!1,error:"Provider test not supported",refreshed:!1};if(!a.accessToken)return{valid:!1,error:"No access token",refreshed:!1};if(d.tokenExists)return{valid:!0,error:null,refreshed:!1,newTokens:null};let e=a.accessToken,f=!1,g=null,h=(0,k.fp)(a.provider,a);if(d.refreshable&&h&&a.refreshToken){let b=await p(a);if(!b)return{valid:!1,error:"Token expired and refresh failed",refreshed:!1};e=b.accessToken,f=!0,g=b}if(d.checkExpiry)return f?{valid:!0,error:null,refreshed:f,newTokens:g}:h?{valid:!1,error:"Token expired",refreshed:!1}:{valid:!0,error:null,refreshed:!1,newTokens:null};if("cline"===a.provider||"clinepass"===a.provider){let b=async a=>{let b=await o(a);return b.ok?{valid:!0,error:null,refreshed:f,newTokens:g}:401===b.status?{valid:!1,error:"Token invalid or revoked",refreshed:f}:403===b.status?{valid:!1,error:"Access denied",refreshed:f}:{valid:!1,error:`API returned ${b.status}`,refreshed:f}},c=await b(e);if(c.valid||"Token invalid or revoked"!==c.error||!a.refreshToken)return c;let d=await p(a);return d?.accessToken?(f=!0,g=d,e=d.accessToken,await b(e)):{valid:!1,error:"Token invalid or revoked",refreshed:!1}}try{let c=d.buildUrl?d.buildUrl(e):d.url,h=d.noAuth?{...d.extraHeaders}:{[d.authHeader]:`${d.authPrefix}${e}`,...d.extraHeaders},i={method:d.method,headers:h};d.body&&(i.body=d.body);let j=await r(c,i,b);if(j.ok||d.acceptStatuses&&d.acceptStatuses.includes(j.status))return{valid:!0,error:null,refreshed:f,newTokens:g};if(401===j.status&&d.refreshable&&!f&&a.refreshToken){let e=await p(a);if(e){let a=d.buildUrl?d.buildUrl(e.accessToken):c,f=d.noAuth?{...d.extraHeaders}:{[d.authHeader]:`${d.authPrefix}${e.accessToken}`,...d.extraHeaders},g={method:d.method,headers:f};d.body&&(g.body=d.body);let h=await r(a,g,b);if(h.ok||d.acceptStatuses&&d.acceptStatuses.includes(h.status))return{valid:!0,error:null,refreshed:!0,newTokens:e}}return{valid:!1,error:"Token invalid or revoked",refreshed:!1}}if(401===j.status)return{valid:!1,error:"Token invalid or revoked",refreshed:f};if(403===j.status)return{valid:!1,error:"Access denied",refreshed:f};return{valid:!1,error:`API returned ${j.status}`,refreshed:f}}catch(a){return{valid:!1,error:a.message,refreshed:f}}}async function r(a,b={},d=null){if(d?.vercelRelayUrl){let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,39609));return e(a,b,{vercelRelayUrl:d.vercelRelayUrl})}if(!d?.connectionProxyEnabled||!d?.connectionProxyUrl)return fetch(a,b);let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,39609));return e(a,b,{connectionProxyEnabled:!0,connectionProxyUrl:d.connectionProxyUrl,connectionNoProxy:d.connectionNoProxy||""})}async function s(a,b=null){if((0,g.mq)(a.provider)){let c=a.providerSpecificData?.baseUrl;if(!c)return{valid:!1,error:"Missing base URL"};try{let d=await r(`${c.replace(/\/$/,"")}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:d.ok,error:d.ok?null:"Invalid API key or base URL"}}catch(a){return{valid:!1,error:a.message}}}if((0,g.gb)(a.provider)){let c=a.providerSpecificData?.baseUrl;if(!c)return{valid:!1,error:"Missing base URL"};try{(c=c.replace(/\/$/,"")).endsWith("/messages")&&(c=c.slice(0,-9));let d=await r(`${c}/models`,{headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01",Authorization:`Bearer ${a.apiKey}`}},b);return{valid:d.ok,error:d.ok?null:"Invalid API key or base URL"}}catch(a){return{valid:!1,error:a.message}}}try{switch(a.provider){case"cloudflare-ai":{let c=(a.providerSpecificData||{}).accountId;if(!c)return{valid:!1,error:"Missing Account ID"};let d=`https://api.cloudflare.com/client/v4/accounts/${c}/ai/v1/chat/completions`,e=await r(d,{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json"},body:JSON.stringify({model:(0,i.fZ)("cloudflare-ai"),messages:[{role:"user",content:"test"}],max_tokens:1})},b),f=401!==e.status&&403!==e.status&&404!==e.status;return{valid:f,error:f?null:"Invalid API token or Account ID"}}case"azure":{let c=a.providerSpecificData||{},d=(c.azureEndpoint||"").replace(/\/$/,""),e=c.deployment||"gpt-4",f=c.apiVersion||"2024-10-01-preview",g=`${d}/openai/deployments/${e}/chat/completions?api-version=${f}`,h={"api-key":a.apiKey,"Content-Type":"application/json"};c.organization&&(h["OpenAI-Organization"]=c.organization);let i=await r(g,{method:"POST",headers:h,body:JSON.stringify({messages:[{role:"user",content:"test"}],max_completion_tokens:1})},b),j=401!==i.status&&403!==i.status;return{valid:j,error:j?null:"Invalid API key or Azure configuration"}}case"openai":{let c=await r("https://api.openai.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"vercel-ai-gateway":{let c=await r("https://ai-gateway.vercel.sh/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"anthropic":{let c=await r("https://api.anthropic.com/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"claude-3-haiku-20240307",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"gemini":{let c=await r(`https://generativelanguage.googleapis.com/v1/models?key=${a.apiKey}`,{},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"openrouter":{let c=await r("https://openrouter.ai/api/v1/auth/key",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"glm":{let c=await r("https://api.z.ai/api/anthropic/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"glm-4.7",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"glm-cn":{let c=await r("https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:"glm-4.7",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"minimax":case"minimax-cn":{let c=await r({minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages"}[a.provider],{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"minimax-m2",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"kimi":{let c=await r("https://api.kimi.com/coding/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"kimi-latest",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"alicode":case"alicode-intl":{let c="alicode-intl"===a.provider?"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions":"https://coding.dashscope.aliyuncs.com/v1/chat/completions",d=await r(c,{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:(0,i.fZ)(a.provider),max_tokens:1,messages:[{role:"user",content:"test"}]})},b),e=401!==d.status&&403!==d.status;return{valid:e,error:e?null:"Invalid API key"}}case"volcengine-ark":case"byteplus":{let c=await r(h.X3[a.provider],{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:(0,i.fZ)(a.provider),max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"deepseek":{let c=await r("https://api.deepseek.com/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"groq":{let c=await r("https://api.groq.com/openai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"mistral":{let c=await r("https://api.mistral.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"xai":{let c=await r("https://api.x.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nvidia":{let c=await r("https://integrate.api.nvidia.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"perplexity":{let c=await r("https://api.perplexity.ai/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"together":{let c=await r("https://api.together.xyz/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"fireworks":{let c=await r("https://api.fireworks.ai/inference/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"cerebras":{let c=await r("https://api.cerebras.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"cohere":{let c=await r("https://api.cohere.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nebius":{let c=await r("https://api.studio.nebius.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"siliconflow":{let c=await r("https://api.siliconflow.cn/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"hyperbolic":{let c=await r("https://api.hyperbolic.xyz/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"ollama":{let b=await fetch("https://ollama.com/api/tags",{headers:{Authorization:`Bearer ${a.apiKey}`}});return{valid:b.ok,error:b.ok?null:"Invalid API key"}}case"ollama-local":{let b=(0,j.Ak)(a),c=await fetch(`${b}/api/tags`);return{valid:c.ok,error:c.ok?null:`Ollama not reachable at ${b}`}}case"deepgram":{let c=await r("https://api.deepgram.com/v1/projects",{headers:{Authorization:`Token ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"assemblyai":{let c=await r("https://api.assemblyai.com/v1/account",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nanobanana":{let c=await r("https://api.nanobananaapi.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"fal-ai":{let c=await r("https://api.fal.ai/v1/models?limit=1",{headers:{Authorization:`Key ${a.apiKey}`}},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"chutes":{let c=await r("https://llm.chutes.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"grok-web":{let c=a.apiKey.startsWith("sso=")?a.apiKey.slice(4):a.apiKey,d=a=>Array.from(crypto.getRandomValues(new Uint8Array(a)),a=>a.toString(16).padStart(2,"0")).join(""),e=Buffer.from("e:TypeError: Cannot read properties of null (reading 'children')").toString("base64"),f=await r("https://grok.com/rest/app-chat/conversations/new",{method:"POST",headers:{Accept:"*/*","Content-Type":"application/json",Cookie:`sso=${c}`,Origin:"https://grok.com",Referer:"https://grok.com/","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36","x-statsig-id":e,"x-xai-request-id":crypto.randomUUID(),traceparent:`00-${d(16)}-${d(8)}-00`},body:JSON.stringify({temporary:!0,modelName:"grok-4",message:"ping",fileAttachments:[],imageAttachments:[],disableSearch:!1,enableImageGeneration:!1,sendFinalMetadata:!0})},b),g=401!==f.status&&403!==f.status;return{valid:g,error:g?null:"Invalid SSO cookie"}}case"perplexity-web":{let c=a.apiKey;c.startsWith("__Secure-next-auth.session-token=")&&(c=c.slice(33));let d=await r("https://www.perplexity.ai/api/auth/session",{method:"GET",headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",Cookie:`__Secure-next-auth.session-token=${c}`}},b);if(!d.ok)return{valid:!1,error:"Invalid session cookie"};let e=await d.json().catch(()=>null),f=!!(e&&e.user);return{valid:f,error:f?null:"Session expired — re-paste cookie"}}case"opencode-go":{let c=await r("https://opencode.ai/zen/go/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a.apiKey}`},body:JSON.stringify({model:(0,i.fZ)("opencode-go"),messages:[{role:"user",content:"ping"}],max_tokens:1,stream:!1})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"xiaomi-mimo":case"xiaomi-tokenplan":{let c=await r(`${{"xiaomi-mimo":"https://api.xiaomimimo.com/v1","xiaomi-tokenplan":"https://token-plan-sgp.xiaomimimo.com/v1"}[a.provider]}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"codebuddy":case"codebuddy-cn":{let c="codebuddy-cn"===a.provider?l.ne:l.Nl,d=c.baseUrl,e=await r(`${d}/v2/chat/completions`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":c.userAgent,"X-Domain":c.domain,"X-Requested-With":"XMLHttpRequest","X-Product":"SaaS","X-Api-Key":a.apiKey},body:JSON.stringify({model:"default-model-lite",max_tokens:1,messages:[{role:"user",content:"hi"}]})},b),f=e.ok||429===e.status||400===e.status;return{valid:f,error:f?null:`Invalid API key (${e.status})`}}default:return{valid:!1,error:"Provider test not supported"}}}catch(a){return{valid:!1,error:a.message}}}async function t(a){let b,c=await (0,d.Mc)(a);if(!c)return{valid:!1,error:"Connection not found",latencyMs:0,testedAt:new Date().toISOString()};let g=await (0,e.B)(c.providerSpecificData||{});if(g.connectionProxyEnabled&&g.connectionProxyUrl&&!g.vercelRelayUrl){let b=await (0,f.C)({proxyUrl:g.connectionProxyUrl});if(!b.ok){let c=b.error||`Proxy test failed with status ${b.status}`;return await (0,d.updateProviderConnection)(a,{testStatus:"error",lastError:c,lastErrorAt:new Date().toISOString()}),{valid:!1,error:c,latencyMs:0,testedAt:new Date().toISOString()}}}let h=Date.now();b="apikey"===c.authType||"cookie"===c.authType?await s(c,g):await q(c,g);let i=Date.now()-h,j={testStatus:b.valid?"active":"error",lastError:b.valid?null:b.error,lastErrorAt:b.valid?null:new Date().toISOString()};return b.refreshed&&b.newTokens&&(b.newTokens.accessToken&&(j.accessToken=b.newTokens.accessToken),b.newTokens.refreshToken&&(j.refreshToken=b.newTokens.refreshToken),b.newTokens.idToken&&(j.idToken=b.newTokens.idToken),b.newTokens.lastRefreshAt&&(j.lastRefreshAt=b.newTokens.lastRefreshAt),b.newTokens.expiresIn&&(j.expiresIn=b.newTokens.expiresIn),b.newTokens.expiresIn?j.expiresAt=new Date(Date.now()+1e3*b.newTokens.expiresIn).toISOString():b.newTokens.expiresAt&&(j.expiresAt=b.newTokens.expiresAt),b.newTokens.providerSpecificData&&(j.providerSpecificData={...c.providerSpecificData||{},...b.newTokens.providerSpecificData})),await (0,d.updateProviderConnection)(a,j),{valid:b.valid,error:b.error,refreshed:!!b.refreshed,latencyMs:i,testedAt:new Date().toISOString()}}},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,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.fv,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)},74926:(a,b,c)=>{c.d(b,{C:()=>f});var d=c(47774);function e(a){return null==a?"":String(a).trim()}async function f({proxyUrl:a,testUrl:b,timeoutMs:c}={}){let g,h=e(a);if(!h)return{ok:!1,status:400,error:"proxyUrl is required"};let i=e(b)||"https://google.com/",j=Number(c),k=Number.isFinite(j)&&j>0?Math.min(j,3e4):8e3;try{try{g=new d.ProxyAgent({uri:h})}catch(a){return{ok:!1,status:400,error:`Invalid proxy URL: ${a?.message||String(a)}`}}let a=new AbortController,b=Date.now(),c=setTimeout(()=>a.abort(),k);try{let c=await (0,d.hd)(i,{method:"HEAD",dispatcher:g,signal:a.signal,headers:{"User-Agent":"ZevaiRouter"}});return{ok:c.ok,status:c.status,statusText:c.statusText,url:i,elapsedMs:Date.now()-b}}catch(b){let a=b?.name==="AbortError"?"Proxy test timed out":function(a){if(!a)return"Unknown error";let b=a?.message||String(a),c=a?.cause?.code||a?.code,d=a?.cause?.message;return d&&d!==b?c?`${b}: ${d} (${c})`:`${b}: ${d}`:c&&!b.includes(c)?`${b} (${c})`:b}(b);return{ok:!1,status:500,error:a}}finally{clearTimeout(c)}}finally{try{await g?.close?.()}catch{}}}},81329:(a,b,c)=>{c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(44404);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))},89718:(a,b,c)=>{c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,KK:()=>d.KK,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,NR:()=>d.NR,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,QI:()=>d.QI,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,dK:()=>d.dK,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,getQuotaSnapshot:()=>d.LF,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,p3:()=>d.p3,qd:()=>d.qd,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yW:()=>d.yW,yg:()=>d.yg,zP:()=>d.zP,zY:()=>d.zY});var d=c(93999)},92990:(a,b,c)=>{c.d(b,{DI:()=>g,Hp:()=>i,LT:()=>h,MZ:()=>r,Nl:()=>x,Nu:()=>n,OV:()=>f,Td:()=>u,Tx:()=>o,WN:()=>p,Ww:()=>z,YT:()=>l,ZL:()=>k,cD:()=>m,f7:()=>w,hF:()=>j,lB:()=>s,ne:()=>y,qp:()=>v,t:()=>q,w1:()=>t});var d=c(21820);function e(){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 f={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"},g={clientId:"app_EMoamEEZ73f0CkXaXp7hrann",authorizeUrl:"https://auth.openai.com/oauth/authorize",tokenUrl:"https://auth.openai.com/oauth/token",scope:"openid profile email offline_access",codeChallengeMethod:"S256",extraParams:{id_token_add_organizations:"true",codex_cli_simplified_flow:"true",originator:"codex_cli_rs"}},h={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"]},i={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"},j={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"},k={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"}},l={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:e(),pluginType:2})};function m(){return{ideType:9,platform:e(),pluginType:2}}let n={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"},o={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"]},p={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"}},q={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"},r={apiBaseUrl:"https://api.kilo.ai",initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},s={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"},t={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"},u={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"},v={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:"openid profile email offline_access grok-cli:access api:access conversations:read conversations:write",referrer:"grok-build",refreshLeadMs:3e5},w={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},x={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:"CLI/2.63.2 CodeBuddy/2.63.2",domain:"www.codebuddy.ai",platform:"CLI",pollInterval:5e3},y={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:"CLI/2.63.2 CodeBuddy/2.63.2",domain:"www.codebuddy.cn",platform:"CLI",pollInterval:5e3},z=3e5},93943:(a,b,c)=>{c.d(b,{Vq:()=>i,fp:()=>g});var d=c(8590);let e=new Map;function f(a){if(null==a||""===a)return null;if("number"==typeof a)return a<1e12?1e3*a:a;let b=new Date(a).getTime();return Number.isFinite(b)?b:null}function g(a,b,c=Date.now()){if(!b)return!1;let e=f(b?.expiresAt??b?.tokenExpiresAt);return!!(null!==e&&e-c<(0,d.Og)(a)||"codex"===a&&b.refreshToken&&function(a,b=Date.now()){let c=f(a?.lastRefreshAt??a?.lastRefresh??a?.providerSpecificData?.lastRefreshAt);return!c||b-c>=6912e5}(b,c))}async function h(a,b,c){let d,f=(d=b?.connectionId||b?.id||b?.email||b?.name||b?.refreshToken?.slice?.(-16)||"default",`${a}:${d}`),g=e.get(f);if(g)return g;let h=Promise.resolve().then(c).finally(()=>{e.delete(f)});return e.set(f,h),h}async function i(a,b,c){return b?h(a,b,async()=>{let e=await (0,d.$B)(a,b,c);return function(a,b,c,e=Date.now()){var f,g;if(!c)return null;if((0,d.jT)(c))return c;let h={},i=new Date(e).toISOString();c.accessToken&&(h.accessToken=c.accessToken),c.apiKey&&(h.apiKey=c.apiKey),c.token&&(h.token=c.token);let j=c.refreshToken??b?.refreshToken;j&&(h.refreshToken=j);let k=c.idToken??b?.idToken;return k&&(h.idToken=k),c.expiresIn?(h.expiresIn=c.expiresIn,h.expiresAt=function(a,b=Date.now()){return a?new Date(b+1e3*a).toISOString():null}(c.expiresIn,e)):c.expiresAt&&(h.expiresAt=c.expiresAt),c.projectId&&(h.projectId=c.projectId),c.providerSpecificData&&(f=b?.providerSpecificData,h.providerSpecificData=(g=c.providerSpecificData)&&"object"==typeof g?{...f||{},...g}:f),c.copilotToken&&(h.copilotToken=c.copilotToken),c.copilotTokenExpiresAt&&(h.copilotTokenExpiresAt=c.copilotTokenExpiresAt),("codex"===a||h.accessToken||h.apiKey||h.token||h.refreshToken||h.copilotToken)&&(h.lastRefreshAt=c.lastRefreshAt||i),h}(a,b,e)}):null}}};
1
+ "use strict";exports.id=3407,exports.ids=[1998,3407],exports.modules={15626:(a,b,c)=>{c.d(b,{buildClineHeaders:()=>e});let d=c(39006).version||"0.0.0";function e(a,b={}){let c,f=(c=function(a){if("string"!=typeof a)return"";let b=a.trim();return b?b.startsWith("workos:")?b:`workos:${b}`:""}(a))?`Bearer ${c}`:"",g={"HTTP-Referer":"https://cline.bot","X-Title":"Cline","User-Agent":`ZevaiRouter/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"zevairouter","X-CLIENT-VERSION":d,"X-CORE-VERSION":d,"X-IS-MULTIROOT":"false",...b};return f&&(g.Authorization=f),g}},30869:(a,b,c)=>{c.d(b,{UY:()=>h,X3:()=>i,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g});var d=c(39006),e=c(75681),f=c(81329);d.version;let g={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},h={maxLines:200,pollIntervalMs:1e3},i={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"}},39006:a=>{a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.79","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"./cli/cli.js"},"files":["cli/","src/","public/","scripts/","i18n/","assets/","images/","open-sse/","next.config.mjs","postcss.config.mjs","jsconfig.json","start.sh","package.json","README.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"next build --webpack","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","prepack":"node cli/scripts/build-cli.js","postinstall":"node cli/hooks/postinstall.js || exit 0"},"dependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","confbox":"^0.2.4","express":"^5.2.1","fs":"^0.0.1-security","http-proxy-middleware":"^3.0.5","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","monaco-editor":"^0.55.1","next":"^16.1.6","node-forge":"^1.3.3","node-machine-id":"^1.1.12","open":"^11.0.0","ora":"^9.1.0","react":"19.2.4","react-dom":"19.2.4","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks-proxy-agent":"^10.1.0","sql.js":"^1.14.1","undici":"^8.4.1","uuid":"^14.0.1","zustand":"^5.0.10"},"comment_optional_runtime":"Heavy packages are NOT optionalDependencies (clean `npm i -g`, no deprecated noise). postinstall warm-ups them into ~/.zevai/runtime so one command still gets full features. ZEVAI_MINIMAL_POSTINSTALL=1 skips browser downloads. Runtime code can still lazy-retry: better-sqlite3, camoufox-js, cloakbrowser, node-pty, playwright.","devDependencies":{"@tailwindcss/postcss":"^4.1.18","better-sqlite3":"^12.6.2","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","postcss":"^8.5.6","tailwindcss":"^4"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"https://github.com/Verifiedlabs/zevairouter"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},39326:(a,b,c)=>{c.d(b,{B:()=>h,p:()=>g});var d=c(71998);function e(a){return null==a?"":String(a).trim()}let f=new Map;function g(a,b,c){if(!a||0===a.length)return null;if(1===a.length)return a[0];if("round-robin"===b){let b=f.get(c)||{index:-1};return b.index=(b.index+1)%a.length,f.set(c,b),a[b.index]}return"random"===b?a[Math.floor(Math.random()*a.length)]:a[0]}async function h(a={}){try{let b=e(a?.proxyPoolId),c="__none__"===b?"":b,f=function(a={}){let b=a?.connectionProxyEnabled===!0,c=e(a?.connectionProxyUrl);return{connectionProxyEnabled:b,connectionProxyUrl:c,connectionNoProxy:e(a?.connectionNoProxy)}}(a);if(c){let a=await (0,d.hr)(c),b=e(a?.proxyUrl),f=e(a?.noProxy);if(a&&!0===a.isActive&&b){if("vercel"===a.type||"cloudflare"===a.type||"deno"===a.type)return{source:a.type,proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:f,strictProxy:!0===a.strictProxy,vercelRelayUrl:b};return{source:"pool",proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!0,connectionProxyUrl:b,connectionNoProxy:f,strictProxy:!0===a.strictProxy}}}if(f.connectionProxyEnabled&&f.connectionProxyUrl)return{source:"legacy",proxyPoolId:c||null,proxyPool:null,...f};return{source:"none",proxyPoolId:c||null,proxyPool:null,...f}}catch(a){return console.error("[resolveConnectionProxyConfig] Failed to resolve proxy config:",a),{source:"error",proxyPoolId:null,proxyPool:null,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:"",strictProxy:!1}}}},47293:(a,b,c)=>{c.d(b,{A:()=>f});let d=new Uint8Array(16);var e=c(50122);let f=function(a,b,c){return b||a||!crypto.randomUUID?function(a,b,c){let f=(a=a||{}).random??a.rng?.()??crypto.getRandomValues(d);if(f.length<16)throw Error("Random bytes length must be >= 16");if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=f[a];return b}return(0,e.k)(f)}(a,b,c):crypto.randomUUID()}},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},66811:(a,b,c)=>{c.d(b,{F:()=>t});var d=c(89718),e=c(39326),f=c(74926),g=c(75681),h=c(30869),i=c(44404),j=c(35024),k=c(93943),l=c(92990),m=c(15626);let n={claude:{checkExpiry:!0,refreshable:!0},codex:{url:"https://chatgpt.com/backend-api/codex/responses",method:"POST",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"Content-Type":"application/json",originator:"codex_cli_rs","User-Agent":"codex_cli_rs/0.136.0"},body:JSON.stringify({model:"gpt-5.3-codex",input:[],stream:!1,store:!1}),acceptStatuses:[400],refreshable:!0},"gemini-cli":{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},antigravity:{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},github:{url:"https://api.github.com/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"User-Agent":"ZevaiRouter",Accept:"application/vnd.github+json"}},iflow:{buildUrl:a=>`https://iflow.cn/api/oauth/getUserInfo?accessToken=${encodeURIComponent(a)}`,method:"GET",noAuth:!0},qwen:{checkExpiry:!0,refreshable:!0},kiro:{checkExpiry:!0,refreshable:!0},qoder:{url:"https://openapi.qoder.sh/api/v1/userinfo",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!1},"kimi-coding":{checkExpiry:!0,refreshable:!1},cursor:{tokenExists:!0},kilocode:{url:`${l.MZ.apiBaseUrl}/api/profile`,method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},cline:{refreshable:!0},clinepass:{refreshable:!0},kimchi:{url:l.Td.validationUrl||"https://api.cast.ai/v1/llm/openai/supported-providers",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{Accept:"application/json","User-Agent":"kimchi/0.1.40"},refreshable:!1},"grok-cli":{url:j.xq["grok-cli"]?.userUrl||"https://cli-chat-proxy.grok.com/v1/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{Accept:"application/json",...j.xq["grok-cli"]?.headers||{"User-Agent":"grok-pager/0.2.93 grok-shell/0.2.93 (linux; x86_64)","x-xai-token-auth":"xai-grok-cli","x-grok-client-identifier":"grok-pager","x-grok-client-version":"0.2.93"}},refreshable:!0},gitlab:{url:"https://gitlab.com/api/v4/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},codebuddy:{tokenExists:!0},"codebuddy-cn":{tokenExists:!0}};async function o(a){return await fetch("https://api.cline.bot/api/v1/users/me",{method:"GET",headers:(0,m.buildClineHeaders)(a,{Accept:"application/json"})})}async function p(a){let b=a.provider,c=a.refreshToken;if(!c)return null;try{if("gemini-cli"===b||"antigravity"===b){let a="gemini-cli"===b?l.LT:l.YT,d=await fetch("https://oauth2.googleapis.com/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:a.clientId,client_secret:a.clientSecret,grant_type:"refresh_token",refresh_token:c})});if(!d.ok)return null;let e=await d.json();return{accessToken:e.access_token,expiresIn:e.expires_in,refreshToken:e.refresh_token||c}}if("codex"===b||"grok-cli"===b||"xai"===b)return await (0,k.Vq)(b,a,console);if("claude"===b){let a=await fetch(l.OV.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:c,client_id:l.OV.clientId})});if(!a.ok)return null;let b=await a.json();return{accessToken:b.access_token,expiresIn:b.expires_in,refreshToken:b.refresh_token||c}}if("kiro"===b){let b=a.providerSpecificData||{},d=b.clientId||a.clientId,e=b.clientSecret||a.clientSecret,f=b.region||a.region;if(d&&e){let a=`https://oidc.${f||"us-east-1"}.amazonaws.com/token`,b=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:d,clientSecret:e,refreshToken:c,grantType:"refresh_token"})});if(!b.ok)return null;let g=await b.json();return{accessToken:g.accessToken,expiresIn:g.expiresIn||3600,refreshToken:g.refreshToken||c}}let g=await fetch(l.Tx.socialRefreshUrl,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":"kiro-cli/2.12.2"},body:JSON.stringify({refreshToken:c})});if(!g.ok)return null;let h=await g.json();return{accessToken:h.accessToken,expiresIn:h.expiresIn||3600,refreshToken:h.refreshToken||c}}if("qwen"===b){let a=await fetch(l.Hp.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:c,client_id:l.Hp.clientId})});if(!a.ok)return null;let b=await a.json();return{accessToken:b.access_token,expiresIn:b.expires_in,refreshToken:b.refresh_token||c}}if("cline"===b||"clinepass"===b){let a=await fetch(l.lB.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:c,grantType:"refresh_token",clientType:"extension"})});if(!a.ok)return null;let b=await a.json(),d=b?.data||b,e=d?.expiresAt?Math.max(1,Math.floor((new Date(d.expiresAt).getTime()-Date.now())/1e3)):3600;return{accessToken:d?.accessToken,expiresIn:e,refreshToken:d?.refreshToken||c}}if("codebuddy"===b||"codebuddy-cn"===b){let a="codebuddy-cn"===b?l.ne:l.Nl,d=await fetch(a.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":a.domain,"X-Refresh-Token":c,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"});if(!d.ok)return null;let e=await d.json(),f=e?.data||e,g=f?.accessToken||f?.access_token;if(!g)return null;return{accessToken:g,expiresIn:f?.expiresIn||f?.expires_in||86400,refreshToken:f?.refreshToken||f?.refresh_token||c}}return null}catch(a){return console.log(`Error refreshing ${b} token:`,a.message),null}}async function q(a,b=null){if("autoclaw"===a.provider){if(!a.accessToken)return{valid:!1,error:"No access token",refreshed:!1};try{let{AUTOCLAW_WALLET_ENDPOINT:d,buildAutoClawWalletHeaders:e}=await c.e(2693).then(c.bind(c,42693)),f=await r(d,{method:"GET",headers:e(a.accessToken)},b);if(!f.ok){if(401===f.status||403===f.status)return{valid:!1,error:"Token invalid or revoked",refreshed:!1};return{valid:!1,error:`AutoClaw API returned ${f.status}`,refreshed:!1}}let g=await f.json().catch(()=>null);if(g&&0===g.code)return{valid:!0,error:null,refreshed:!1,newTokens:null};return{valid:!1,error:"Token invalid or revoked",refreshed:!1}}catch(a){return{valid:!1,error:a.message,refreshed:!1}}}let d=n[a.provider];if(!d)return{valid:!1,error:"Provider test not supported",refreshed:!1};if(!a.accessToken)return{valid:!1,error:"No access token",refreshed:!1};if(d.tokenExists)return{valid:!0,error:null,refreshed:!1,newTokens:null};let e=a.accessToken,f=!1,g=null,h=(0,k.fp)(a.provider,a);if(d.refreshable&&h&&a.refreshToken){let b=await p(a);if(!b)return{valid:!1,error:"Token expired and refresh failed",refreshed:!1};e=b.accessToken,f=!0,g=b}if(d.checkExpiry)return f?{valid:!0,error:null,refreshed:f,newTokens:g}:h?{valid:!1,error:"Token expired",refreshed:!1}:{valid:!0,error:null,refreshed:!1,newTokens:null};if("cline"===a.provider||"clinepass"===a.provider){let b=async a=>{let b=await o(a);return b.ok?{valid:!0,error:null,refreshed:f,newTokens:g}:401===b.status?{valid:!1,error:"Token invalid or revoked",refreshed:f}:403===b.status?{valid:!1,error:"Access denied",refreshed:f}:{valid:!1,error:`API returned ${b.status}`,refreshed:f}},c=await b(e);if(c.valid||"Token invalid or revoked"!==c.error||!a.refreshToken)return c;let d=await p(a);return d?.accessToken?(f=!0,g=d,e=d.accessToken,await b(e)):{valid:!1,error:"Token invalid or revoked",refreshed:!1}}try{let c=d.buildUrl?d.buildUrl(e):d.url,h=d.noAuth?{...d.extraHeaders}:{[d.authHeader]:`${d.authPrefix}${e}`,...d.extraHeaders},i={method:d.method,headers:h};d.body&&(i.body=d.body);let j=await r(c,i,b);if(j.ok||d.acceptStatuses&&d.acceptStatuses.includes(j.status))return{valid:!0,error:null,refreshed:f,newTokens:g};if(401===j.status&&d.refreshable&&!f&&a.refreshToken){let e=await p(a);if(e){let a=d.buildUrl?d.buildUrl(e.accessToken):c,f=d.noAuth?{...d.extraHeaders}:{[d.authHeader]:`${d.authPrefix}${e.accessToken}`,...d.extraHeaders},g={method:d.method,headers:f};d.body&&(g.body=d.body);let h=await r(a,g,b);if(h.ok||d.acceptStatuses&&d.acceptStatuses.includes(h.status))return{valid:!0,error:null,refreshed:!0,newTokens:e}}return{valid:!1,error:"Token invalid or revoked",refreshed:!1}}if(401===j.status)return{valid:!1,error:"Token invalid or revoked",refreshed:f};if(403===j.status)return{valid:!1,error:"Access denied",refreshed:f};return{valid:!1,error:`API returned ${j.status}`,refreshed:f}}catch(a){return{valid:!1,error:a.message,refreshed:f}}}async function r(a,b={},d=null){if(d?.vercelRelayUrl){let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,39609));return e(a,b,{vercelRelayUrl:d.vercelRelayUrl})}if(!d?.connectionProxyEnabled||!d?.connectionProxyUrl)return fetch(a,b);let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,39609));return e(a,b,{connectionProxyEnabled:!0,connectionProxyUrl:d.connectionProxyUrl,connectionNoProxy:d.connectionNoProxy||""})}async function s(a,b=null){if((0,g.mq)(a.provider)){let c=a.providerSpecificData?.baseUrl;if(!c)return{valid:!1,error:"Missing base URL"};try{let d=await r(`${c.replace(/\/$/,"")}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:d.ok,error:d.ok?null:"Invalid API key or base URL"}}catch(a){return{valid:!1,error:a.message}}}if((0,g.gb)(a.provider)){let c=a.providerSpecificData?.baseUrl;if(!c)return{valid:!1,error:"Missing base URL"};try{(c=c.replace(/\/$/,"")).endsWith("/messages")&&(c=c.slice(0,-9));let d=await r(`${c}/models`,{headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01",Authorization:`Bearer ${a.apiKey}`}},b);return{valid:d.ok,error:d.ok?null:"Invalid API key or base URL"}}catch(a){return{valid:!1,error:a.message}}}try{switch(a.provider){case"cloudflare-ai":{let c=(a.providerSpecificData||{}).accountId;if(!c)return{valid:!1,error:"Missing Account ID"};let d=`https://api.cloudflare.com/client/v4/accounts/${c}/ai/v1/chat/completions`,e=await r(d,{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json"},body:JSON.stringify({model:(0,i.fZ)("cloudflare-ai"),messages:[{role:"user",content:"test"}],max_tokens:1})},b),f=401!==e.status&&403!==e.status&&404!==e.status;return{valid:f,error:f?null:"Invalid API token or Account ID"}}case"azure":{let c=a.providerSpecificData||{},d=(c.azureEndpoint||"").replace(/\/$/,""),e=c.deployment||"gpt-4",f=c.apiVersion||"2024-10-01-preview",g=`${d}/openai/deployments/${e}/chat/completions?api-version=${f}`,h={"api-key":a.apiKey,"Content-Type":"application/json"};c.organization&&(h["OpenAI-Organization"]=c.organization);let i=await r(g,{method:"POST",headers:h,body:JSON.stringify({messages:[{role:"user",content:"test"}],max_completion_tokens:1})},b),j=401!==i.status&&403!==i.status;return{valid:j,error:j?null:"Invalid API key or Azure configuration"}}case"openai":{let c=await r("https://api.openai.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"vercel-ai-gateway":{let c=await r("https://ai-gateway.vercel.sh/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"anthropic":{let c=await r("https://api.anthropic.com/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"claude-3-haiku-20240307",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"gemini":{let c=await r(`https://generativelanguage.googleapis.com/v1/models?key=${a.apiKey}`,{},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"openrouter":{let c=await r("https://openrouter.ai/api/v1/auth/key",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"glm":{let c=await r("https://api.z.ai/api/anthropic/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"glm-4.7",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"glm-cn":{let c=await r("https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:"glm-4.7",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"minimax":case"minimax-cn":{let c=await r({minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages"}[a.provider],{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"minimax-m2",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"kimi":{let c=await r("https://api.kimi.com/coding/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"kimi-latest",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"alicode":case"alicode-intl":{let c="alicode-intl"===a.provider?"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions":"https://coding.dashscope.aliyuncs.com/v1/chat/completions",d=await r(c,{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:(0,i.fZ)(a.provider),max_tokens:1,messages:[{role:"user",content:"test"}]})},b),e=401!==d.status&&403!==d.status;return{valid:e,error:e?null:"Invalid API key"}}case"volcengine-ark":case"byteplus":{let c=await r(h.X3[a.provider],{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:(0,i.fZ)(a.provider),max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"deepseek":{let c=await r("https://api.deepseek.com/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"groq":{let c=await r("https://api.groq.com/openai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"mistral":{let c=await r("https://api.mistral.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"xai":{let c=await r("https://api.x.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nvidia":{let c=await r("https://integrate.api.nvidia.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"perplexity":{let c=await r("https://api.perplexity.ai/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"together":{let c=await r("https://api.together.xyz/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"fireworks":{let c=await r("https://api.fireworks.ai/inference/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"cerebras":{let c=await r("https://api.cerebras.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"cohere":{let c=await r("https://api.cohere.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nebius":{let c=await r("https://api.studio.nebius.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"siliconflow":{let c=await r("https://api.siliconflow.cn/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"hyperbolic":{let c=await r("https://api.hyperbolic.xyz/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"ollama":{let b=await fetch("https://ollama.com/api/tags",{headers:{Authorization:`Bearer ${a.apiKey}`}});return{valid:b.ok,error:b.ok?null:"Invalid API key"}}case"ollama-local":{let b=(0,j.Ak)(a),c=await fetch(`${b}/api/tags`);return{valid:c.ok,error:c.ok?null:`Ollama not reachable at ${b}`}}case"deepgram":{let c=await r("https://api.deepgram.com/v1/projects",{headers:{Authorization:`Token ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"assemblyai":{let c=await r("https://api.assemblyai.com/v1/account",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nanobanana":{let c=await r("https://api.nanobananaapi.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"fal-ai":{let c=await r("https://api.fal.ai/v1/models?limit=1",{headers:{Authorization:`Key ${a.apiKey}`}},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"chutes":{let c=await r("https://llm.chutes.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"grok-web":{let c=a.apiKey.startsWith("sso=")?a.apiKey.slice(4):a.apiKey,d=a=>Array.from(crypto.getRandomValues(new Uint8Array(a)),a=>a.toString(16).padStart(2,"0")).join(""),e=Buffer.from("e:TypeError: Cannot read properties of null (reading 'children')").toString("base64"),f=await r("https://grok.com/rest/app-chat/conversations/new",{method:"POST",headers:{Accept:"*/*","Content-Type":"application/json",Cookie:`sso=${c}`,Origin:"https://grok.com",Referer:"https://grok.com/","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36","x-statsig-id":e,"x-xai-request-id":crypto.randomUUID(),traceparent:`00-${d(16)}-${d(8)}-00`},body:JSON.stringify({temporary:!0,modelName:"grok-4",message:"ping",fileAttachments:[],imageAttachments:[],disableSearch:!1,enableImageGeneration:!1,sendFinalMetadata:!0})},b),g=401!==f.status&&403!==f.status;return{valid:g,error:g?null:"Invalid SSO cookie"}}case"perplexity-web":{let c=a.apiKey;c.startsWith("__Secure-next-auth.session-token=")&&(c=c.slice(33));let d=await r("https://www.perplexity.ai/api/auth/session",{method:"GET",headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",Cookie:`__Secure-next-auth.session-token=${c}`}},b);if(!d.ok)return{valid:!1,error:"Invalid session cookie"};let e=await d.json().catch(()=>null),f=!!(e&&e.user);return{valid:f,error:f?null:"Session expired — re-paste cookie"}}case"opencode-go":{let c=await r("https://opencode.ai/zen/go/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a.apiKey}`},body:JSON.stringify({model:(0,i.fZ)("opencode-go"),messages:[{role:"user",content:"ping"}],max_tokens:1,stream:!1})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"xiaomi-mimo":case"xiaomi-tokenplan":{let c=await r(`${{"xiaomi-mimo":"https://api.xiaomimimo.com/v1","xiaomi-tokenplan":"https://token-plan-sgp.xiaomimimo.com/v1"}[a.provider]}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"codebuddy":case"codebuddy-cn":{let c="codebuddy-cn"===a.provider?l.ne:l.Nl,d=c.baseUrl,e=await r(`${d}/v2/chat/completions`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":c.userAgent,"X-Domain":c.domain,"X-Requested-With":"XMLHttpRequest","X-Product":"SaaS","X-Api-Key":a.apiKey},body:JSON.stringify({model:"default-model-lite",max_tokens:1,messages:[{role:"user",content:"hi"}]})},b),f=e.ok||429===e.status||400===e.status;return{valid:f,error:f?null:`Invalid API key (${e.status})`}}default:return{valid:!1,error:"Provider test not supported"}}}catch(a){return{valid:!1,error:a.message}}}async function t(a){let b,c=await (0,d.Mc)(a);if(!c)return{valid:!1,error:"Connection not found",latencyMs:0,testedAt:new Date().toISOString()};let g=await (0,e.B)(c.providerSpecificData||{});if(g.connectionProxyEnabled&&g.connectionProxyUrl&&!g.vercelRelayUrl){let b=await (0,f.C)({proxyUrl:g.connectionProxyUrl});if(!b.ok){let c=b.error||`Proxy test failed with status ${b.status}`;return await (0,d.updateProviderConnection)(a,{testStatus:"error",lastError:c,lastErrorAt:new Date().toISOString()}),{valid:!1,error:c,latencyMs:0,testedAt:new Date().toISOString()}}}let h=Date.now();b="apikey"===c.authType||"cookie"===c.authType?await s(c,g):await q(c,g);let i=Date.now()-h,j={testStatus:b.valid?"active":"error",lastError:b.valid?null:b.error,lastErrorAt:b.valid?null:new Date().toISOString()};return b.refreshed&&b.newTokens&&(b.newTokens.accessToken&&(j.accessToken=b.newTokens.accessToken),b.newTokens.refreshToken&&(j.refreshToken=b.newTokens.refreshToken),b.newTokens.idToken&&(j.idToken=b.newTokens.idToken),b.newTokens.lastRefreshAt&&(j.lastRefreshAt=b.newTokens.lastRefreshAt),b.newTokens.expiresIn&&(j.expiresIn=b.newTokens.expiresIn),b.newTokens.expiresIn?j.expiresAt=new Date(Date.now()+1e3*b.newTokens.expiresIn).toISOString():b.newTokens.expiresAt&&(j.expiresAt=b.newTokens.expiresAt),b.newTokens.providerSpecificData&&(j.providerSpecificData={...c.providerSpecificData||{},...b.newTokens.providerSpecificData})),await (0,d.updateProviderConnection)(a,j),{valid:b.valid,error:b.error,refreshed:!!b.refreshed,latencyMs:i,testedAt:new Date().toISOString()}}},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,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.fv,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)},74926:(a,b,c)=>{c.d(b,{C:()=>f});var d=c(47774);function e(a){return null==a?"":String(a).trim()}async function f({proxyUrl:a,testUrl:b,timeoutMs:c}={}){let g,h=e(a);if(!h)return{ok:!1,status:400,error:"proxyUrl is required"};let i=e(b)||"https://google.com/",j=Number(c),k=Number.isFinite(j)&&j>0?Math.min(j,3e4):8e3;try{try{g=new d.ProxyAgent({uri:h})}catch(a){return{ok:!1,status:400,error:`Invalid proxy URL: ${a?.message||String(a)}`}}let a=new AbortController,b=Date.now(),c=setTimeout(()=>a.abort(),k);try{let c=await (0,d.hd)(i,{method:"HEAD",dispatcher:g,signal:a.signal,headers:{"User-Agent":"ZevaiRouter"}});return{ok:c.ok,status:c.status,statusText:c.statusText,url:i,elapsedMs:Date.now()-b}}catch(b){let a=b?.name==="AbortError"?"Proxy test timed out":function(a){if(!a)return"Unknown error";let b=a?.message||String(a),c=a?.cause?.code||a?.code,d=a?.cause?.message;return d&&d!==b?c?`${b}: ${d} (${c})`:`${b}: ${d}`:c&&!b.includes(c)?`${b} (${c})`:b}(b);return{ok:!1,status:500,error:a}}finally{clearTimeout(c)}}finally{try{await g?.close?.()}catch{}}}},81329:(a,b,c)=>{c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(44404);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))},89718:(a,b,c)=>{c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,KK:()=>d.KK,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,NR:()=>d.NR,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,QI:()=>d.QI,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,dK:()=>d.dK,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,getQuotaSnapshot:()=>d.LF,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,p3:()=>d.p3,qd:()=>d.qd,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yW:()=>d.yW,yg:()=>d.yg,zP:()=>d.zP,zY:()=>d.zY});var d=c(93999)},92990:(a,b,c)=>{c.d(b,{DI:()=>g,Hp:()=>i,LT:()=>h,MZ:()=>r,Nl:()=>x,Nu:()=>n,OV:()=>f,Td:()=>u,Tx:()=>o,WN:()=>p,Ww:()=>z,YT:()=>l,ZL:()=>k,cD:()=>m,f7:()=>w,hF:()=>j,lB:()=>s,ne:()=>y,qp:()=>v,t:()=>q,w1:()=>t});var d=c(21820);function e(){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 f={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"},g={clientId:"app_EMoamEEZ73f0CkXaXp7hrann",authorizeUrl:"https://auth.openai.com/oauth/authorize",tokenUrl:"https://auth.openai.com/oauth/token",scope:"openid profile email offline_access",codeChallengeMethod:"S256",extraParams:{id_token_add_organizations:"true",codex_cli_simplified_flow:"true",originator:"codex_cli_rs"}},h={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"]},i={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"},j={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"},k={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"}},l={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:e(),pluginType:2})};function m(){return{ideType:9,platform:e(),pluginType:2}}let n={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"},o={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"]},p={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"}},q={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"},r={apiBaseUrl:"https://api.kilo.ai",initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},s={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"},t={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"},u={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"},v={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:"openid profile email offline_access grok-cli:access api:access conversations:read conversations:write",referrer:"grok-build",refreshLeadMs:3e5},w={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},x={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:"CLI/2.63.2 CodeBuddy/2.63.2",domain:"www.codebuddy.ai",platform:"CLI",pollInterval:5e3},y={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:"CLI/2.63.2 CodeBuddy/2.63.2",domain:"www.codebuddy.cn",platform:"CLI",pollInterval:5e3},z=3e5},93943:(a,b,c)=>{c.d(b,{Vq:()=>i,fp:()=>g});var d=c(8590);let e=new Map;function f(a){if(null==a||""===a)return null;if("number"==typeof a)return a<1e12?1e3*a:a;let b=new Date(a).getTime();return Number.isFinite(b)?b:null}function g(a,b,c=Date.now()){if(!b)return!1;let e=f(b?.expiresAt??b?.tokenExpiresAt);return!!(null!==e&&e-c<(0,d.Og)(a)||"codex"===a&&b.refreshToken&&function(a,b=Date.now()){let c=f(a?.lastRefreshAt??a?.lastRefresh??a?.providerSpecificData?.lastRefreshAt);return!c||b-c>=6912e5}(b,c))}async function h(a,b,c){let d,f=(d=b?.connectionId||b?.id||b?.email||b?.name||b?.refreshToken?.slice?.(-16)||"default",`${a}:${d}`),g=e.get(f);if(g)return g;let h=Promise.resolve().then(c).finally(()=>{e.delete(f)});return e.set(f,h),h}async function i(a,b,c){return b?h(a,b,async()=>{let e=await (0,d.$B)(a,b,c);return function(a,b,c,e=Date.now()){var f,g;if(!c)return null;if((0,d.jT)(c))return c;let h={},i=new Date(e).toISOString();c.accessToken&&(h.accessToken=c.accessToken),c.apiKey&&(h.apiKey=c.apiKey),c.token&&(h.token=c.token);let j=c.refreshToken??b?.refreshToken;j&&(h.refreshToken=j);let k=c.idToken??b?.idToken;return k&&(h.idToken=k),c.expiresIn?(h.expiresIn=c.expiresIn,h.expiresAt=function(a,b=Date.now()){return a?new Date(b+1e3*a).toISOString():null}(c.expiresIn,e)):c.expiresAt&&(h.expiresAt=c.expiresAt),c.projectId&&(h.projectId=c.projectId),c.providerSpecificData&&(f=b?.providerSpecificData,h.providerSpecificData=(g=c.providerSpecificData)&&"object"==typeof g?{...f||{},...g}:f),c.copilotToken&&(h.copilotToken=c.copilotToken),c.copilotTokenExpiresAt&&(h.copilotTokenExpiresAt=c.copilotTokenExpiresAt),("codex"===a||h.accessToken||h.apiKey||h.token||h.refreshToken||h.copilotToken)&&(h.lastRefreshAt=c.lastRefreshAt||i),h}(a,b,e)}):null}}};
@@ -1 +1 @@
1
- "use strict";exports.id=3487,exports.ids=[3487],exports.modules={48096:(a,b,c)=>{c.d(b,{K:()=>k,runXaiEmailDeviceAuthorize:()=>o});var d=c(63312);function e(a){return new Promise(b=>setTimeout(b,a))}async function f(a){return a.evaluate(()=>document.body?.innerText||"").catch(()=>"")}async function g(a,b,{timeout:c=3e3}={}){for(let d of b)try{let b=a.locator(d).first();if(await b.isVisible({timeout:400}).catch(()=>!1))return await b.click({timeout:c}),d}catch{}return null}async function h(a){return g(a,["#onetrust-accept-btn-handler","#onetrust-reject-all-handler",'button:has-text("Accept All Cookies")','button:has-text("Reject All")'])}async function i(a,b,c=35){await a.click(),await a.fill("").catch(()=>null),await a.type(b,{delay:c})}async function j(a,{timeoutMs:b=6e4,onStep:c}={}){let d=Date.now();for(;Date.now()-d<b;){let b=await a.evaluate(()=>{let a=document.querySelector("input[name=cf-turnstile-response], [name=cf-turnstile-response]");return a?String(a.value||""):""}).catch(()=>"");if(b&&b.length>20)return c?.("turnstile_ok",`Cloudflare Turnstile solved (${b.length} chars)`),{ok:!0,length:b.length};try{for(let b of a.frames()){let a=b.url()||"";/turnstile|challenges\.cloudflare/i.test(a)&&await b.locator("input[type=checkbox], body").first().click({timeout:800}).catch(()=>null)}}catch{}await e(1200)}return c?.("turnstile_timeout","Turnstile did not produce a token in time"),{ok:!1}}async function k(a,{email:b,password:l,firstName:m,lastName:n,pollOtp:o=d.ws,onStep:p}={}){if(!m||!n){let{generateRandomPersonName:a}=await Promise.resolve().then(c.bind(c,63312)),b=a();m=m||b.firstName,n=n||b.lastName}let q=(a,b)=>p?.(a,b);q("opening_signup","Opening xAI email sign-up"),await a.goto("https://accounts.x.ai/sign-up",{waitUntil:"domcontentloaded",timeout:6e4}),await e(1200),await h(a),await a.getByRole("button",{name:/Sign up with email/i}).count()&&(await a.getByRole("button",{name:/Sign up with email/i}).click(),await e(800),q("signup_with_email","Selected Sign up with email")),await a.waitForSelector("input[type=email], input[name=email]",{timeout:15e3}),await i(a.locator("input[type=email], input[name=email]").first(),b,40),await g(a,['button:has-text("Sign up")','button:has-text("Sign Up")']),q("submitted_email",`Submitted sign-up email ${b}`),await e(2e3),await h(a),q("polling_otp","Polling tempmail for xAI confirmation code");let r=await o(b,{timeoutMs:12e4,intervalMs:3e3});if(!r?.code)return{status:"failed",step:"otp_timeout",error:"No xAI OTP received on tempmail inbox"};q("otp_received",`OTP ${r.code} from ${r.subject||"tempmail"}`);let s=a.locator("input[name=code]");await s.isVisible().catch(()=>!1)&&(await i(s,r.code,80),await e(1200));let t=await f(a);/Complete your sign up/i.test(t)||(await g(a,['button:has-text("Confirm email")']),await e(2e3));for(let b=0;b<20&&(t=await f(a),!(/Complete your sign up/i.test(t)||await a.locator("input[name=givenName]").count()));b++)await e(500);if(!await a.locator("input[name=givenName]").first().isVisible().catch(()=>!1))return{status:"failed",step:"profile_form_missing",error:"xAI profile form (givenName) not shown after OTP"};if(q("filling_profile","Filling name + password"),await i(a.locator("input[name=givenName]").first(),m,35),await i(a.locator("input[name=familyName]").first(),n,35),await i(a.locator("input[name=password], input[type=password]").first(),l,35),!(await j(a,{timeoutMs:6e4,onStep:p})).ok)return{status:"needs_manual",step:"turnstile",error:"Cloudflare Turnstile did not solve. Use CloakBrowser headed engine or complete manually."};await g(a,['button:has-text("Complete sign up")']),q("completing_signup","Clicked Complete sign up"),await e(4e3),t=await f(a),/Complete your sign up/i.test(t)&&(await j(a,{timeoutMs:2e4,onStep:p}),await g(a,['button:has-text("Complete sign up")']),await e(4e3),t=await f(a));let u=a.url();return!/Complete your sign up|Verify your email|You must provide/i.test(t)&&!/\/sign-up/i.test(u)||/\/account/i.test(u)||/Welcome/i.test(t)?(q("signup_ok",`Account ready: ${b}`),{status:"success",email:b,password:l,url:u}):{status:"failed",step:"signup_incomplete",error:"xAI sign-up did not complete after profile submit",url:u,text:t.slice(0,300)}}async function l(a,b){try{let c=a.getByRole("button",{name:b}).first();if(await c.isVisible({timeout:600}).catch(()=>!1))return await c.click({timeout:4e3}),!0}catch{}return!1}async function m(a){for(let b of[/^(Allow|Authorize|Approve|Confirm|Yes|Accept)$/i,/Allow|Authorize|Approve|Confirm/i,/^Continue$/i,/Continue/i,/^Next$/i,/Sign in|Log in|Login/i])if(await l(a,b))return!0;try{let b=a.getByRole("link",{name:/Allow|Authorize|Continue|Confirm/i}).first();if(await b.isVisible({timeout:400}).catch(()=>!1))return await b.click({timeout:3e3}),!0}catch{}return!!await g(a,['button:has-text("Allow")','button:has-text("Authorize")','button:has-text("Approve")','button:has-text("Confirm")','button:has-text("Continue")','button:has-text("Next")',"button[type=submit]","input[type=submit]"])}async function n(a,{email:b,password:c,onStep:d,pollOtp:h}){let k=(a,b)=>d?.(a,b);await a.getByRole("button",{name:/Login with email/i}).count()&&(await a.getByRole("button",{name:/Login with email/i}).click().catch(()=>null),await e(800)),await a.locator("input[type=email]").first().isVisible().catch(()=>!1)&&(k("device_login_email","Entering email on device page"),await i(a.locator("input[type=email]").first(),b,40),await m(a),await e(1200)),await a.locator("input[type=password]").first().isVisible().catch(()=>!1)&&(k("device_login_password","Entering password on device page"),await i(a.locator("input[type=password]").first(),c,40),await j(a,{timeoutMs:45e3,onStep:d}),await g(a,['button:has-text("Login")','button:has-text("Log in")',"button[type=submit]"]),await e(2500));let l=await f(a);if(/security code|Verify your email|one time|confirmation code/i.test(l)){k("login_otp","Login requires OTP — polling tempmail");let c=await h(b,{timeoutMs:9e4});if(c?.code){let b=a.locator("input[name=code], input[autocomplete=one-time-code], input[type=text]").first();await b.isVisible().catch(()=>!1)&&await i(b,c.code,80),await m(a),await e(2e3)}}}async function o(a,{email:b,password:c,verificationUrl:g,pollToken:i,deviceCode:k,pollOtp:l=d.ws,onStep:p,cancelCheck:q}={}){let r=(a,b)=>p?.(a,b),s={done:!1},t=a.url();/\/account/i.test(t)||/accounts\.x\.ai/i.test(t)||(r("opening_signin","Opening xAI email login"),await a.goto("https://accounts.x.ai/sign-in",{waitUntil:"domcontentloaded",timeout:6e4}),await e(1e3),await h(a),await n(a,{email:b,password:c,onStep:p,pollOtp:l})),r("opening_device","Opening Grok Build device authorization"),await a.goto(g,{waitUntil:"domcontentloaded",timeout:6e4}),await e(1500),await h(a),await m(a),await e(2e3),(await a.getByRole("button",{name:/Login with email/i}).count()||await a.locator("input[type=email]").first().isVisible().catch(()=>!1))&&(r("device_needs_login","Device page requires login — signing in"),await n(a,{email:b,password:c,onStep:p,pollOtp:l}),await a.goto(g,{waitUntil:"domcontentloaded",timeout:6e4}),await e(1500),await h(a),await m(a),await e(2e3));try{let b=(await f(a)).replace(/\s+/g," ").slice(0,160);r("device_page",`Device page: ${a.url().slice(0,80)} \xb7 ${b}`)}catch{}let u=(async()=>{let a=Date.now(),b=4e3;for(;Date.now()-a<72e4;){if(q?.())throw Error("Job cancelled during token polling");s.done&&await e(1500);let a=await i(k);if(a?.success&&a.tokens)return{tokens:a.tokens};if(a?.pending||a?.error==="authorization_pending"){await e(b);continue}if(a?.error==="slow_down"){b=Math.min(b+5e3,3e4),await e(b);continue}if(a?.error&&!["authorization_pending","slow_down"].includes(a.error)){r("token_poll_note",`Poll: ${a.error}`),await e(b);continue}await e(b)}throw Error("Timed out waiting for Grok CLI OAuth token (device may not have been authorized in the browser)")})(),v=(async()=>{let d=Date.now(),i=0;for(;Date.now()-d<66e4;){if(q?.())return;if(s.done){await e(2e3);continue}let d=await f(a),k=a.url();if(/Device Authorized|device has been authorized|you can close|successfully authorized/i.test(d)){s.done=!0,r("device_authorized","Device authorized in browser");return}if(/Login with email|Sign in to continue|log in to continue/i.test(d)||await a.locator("input[type=password]").first().isVisible().catch(()=>!1)){r("device_relogin","Re-login required on device page"),await n(a,{email:b,password:c,onStep:p,pollOtp:l}),await a.goto(g,{waitUntil:"domcontentloaded",timeout:6e4}).catch(()=>null),await e(1500);continue}if(/Authorize Grok|Grok Build|Verify your identity|Confirm your identity|device code|user code/i.test(d)||/oauth2\/device|device\/verify/i.test(k)){await m(a)&&i%3==0&&r("device_click",`Clicked authorize control (${i+1})`),await j(a,{timeoutMs:12e3,onStep:i%5==0?p:void 0}),await e(1800),i+=1;continue}if(/Redirecting/i.test(d)||/\/account/i.test(k)&&!/device/i.test(k)){r("device_reopen","Re-opening device authorization URL"),await a.goto(g,{waitUntil:"domcontentloaded",timeout:6e4}),await e(1500),await h(a),await m(a),await e(1500),i+=1;continue}await m(a),i>0&&i%8==0&&(r("device_reload",`Reload device page (attempt ${i}) \xb7 ${k.slice(0,60)}`),await a.goto(g,{waitUntil:"domcontentloaded",timeout:6e4}).catch(()=>null),await e(1200),await m(a)),await e(1800),i+=1}})();r("polling_token","Waiting for device token after authorization");try{let[a]=await Promise.all([u,v.catch(a=>(r("device_ui_note",String(a?.message||a).slice(0,120)),null))]);return{status:"success",tokens:a.tokens}}catch(c){let b=(await f(a).catch(()=>"")).replace(/\s+/g," ").slice(0,200);return{status:"failed",error:`${c.message||c} \xb7 page: ${a.url()} \xb7 ${b}`}}}},63312:(a,b,c)=>{c.d(b,{WZ:()=>h,generateRandomPersonName:()=>l,oB:()=>n,ws:()=>p});let d=process.env.TEMPMAIL_BASE_URL||"https://tempmail.zevai.web.id",e=process.env.TEMPMAIL_EMAIL_DOMAIN||"zevai.web.id";function f(a={}){return{baseUrl:String(a.baseUrl||d).replace(/\/+$/,""),domain:String(a.domain||e).replace(/^@/,""),userAgent:a.userAgent||"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"}}async function g(a,b,{method:c="GET",body:d}={}){let e=`${a.baseUrl}${b.startsWith("/")?b:`/${b}`}`,f=await fetch(e,{method:c,headers:{Accept:"application/json","User-Agent":a.userAgent,...d?{"Content-Type":"application/json"}:{}},body:d?JSON.stringify(d):void 0}),h=await f.text(),i=null;try{i=h?JSON.parse(h):null}catch{i={raw:h}}if(!f.ok){let a=Error(i?.error||`Tempmail HTTP ${f.status}`);throw a.status=f.status,a.payload=i,a}return i}function h(){let a=Math.random().toString(36).slice(2,10);return`Zv!${a}Aa1`}let i=["James","John","Robert","Michael","William","David","Richard","Joseph","Thomas","Charles","Christopher","Daniel","Matthew","Anthony","Mark","Steven","Paul","Andrew","Joshua","Kenneth","Kevin","Brian","George","Timothy","Ronald","Edward","Jason","Jeffrey","Ryan","Jacob","Mary","Patricia","Jennifer","Linda","Barbara","Elizabeth","Susan","Jessica","Sarah","Karen","Lisa","Nancy","Betty","Margaret","Sandra","Ashley","Dorothy","Kimberly","Emily","Donna","Michelle","Carol","Amanda","Melissa","Deborah","Stephanie","Rebecca","Sharon","Laura","Emma","Olivia","Ava","Sophia","Isabella","Mia","Charlotte","Amelia","Noah","Liam","Oliver","Elijah","Lucas","Mason","Logan","Ethan"],j=["Smith","Johnson","Williams","Brown","Jones","Garcia","Miller","Davis","Rodriguez","Martinez","Hernandez","Lopez","Gonzalez","Wilson","Anderson","Thomas","Taylor","Moore","Jackson","Martin","Lee","Perez","Thompson","White","Harris","Sanchez","Clark","Ramirez","Lewis","Robinson","Walker","Young","Allen","King","Wright","Scott","Torres","Nguyen","Hill","Flores","Green","Adams","Nelson","Baker","Hall","Rivera","Campbell","Mitchell","Carter","Roberts","Turner","Phillips","Parker","Evans","Edwards","Collins","Stewart","Morris","Murphy","Cook"];function k(a){return a[Math.floor(Math.random()*a.length)]}function l(){return{firstName:k(i),lastName:k(j)}}async function m(a,{label:b=null,...c}={}){return g(f(c),"/api/addresses",{method:"POST",body:{address:a,label:b||"grok-cli-bulk"}})}async function n({prefix:a="zevai-cb",label:b="grok-cli-bulk",...c}={}){let d=f(c),e=function(a="zevai"){let b=Math.random().toString(36).slice(2,8),c=Date.now().toString(36).slice(-4);return`${a}-${c}${b}`.toLowerCase().replace(/[^a-z0-9._+-]/g,"")}(a),g=`${e}@${d.domain}`;return await m(g,{label:b,...d}),{address:g,domain:d.domain}}async function o(a,b={}){let c=f(b),d=encodeURIComponent(a),e=await g(c,`/api/inbox/${d}`);return Array.isArray(e)?e:[]}async function p(a,{timeoutMs:b=12e4,intervalMs:c=3e3,seenIds:d=null,...e}={}){let f=d||new Set,g=Date.now();for(;Date.now()-g<b;){for(let b of[...await o(a,e)].sort((a,b)=>(b.received_at||0)-(a.received_at||0))){let a=b.id||`${b.subject}-${b.received_at}`;if(f.has(a))continue;let c=b.subject||"",d=c.match(/([A-Z0-9]{2,5}-[A-Z0-9]{2,5})\s+xAI confirmation code/i);if(d)return f.add(a),{code:d[1],subject:c,id:b.id||null,mail:b}}await function(a){return new Promise(b=>setTimeout(b,a))}(c)}return null}},83487:(a,b,c)=>{c.d(b,{MC:()=>o,cO:()=>d.cO});var d=c(53041),e=c(63312),f=c(48096);let g="grok-cli";function h(a){return new Promise(b=>setTimeout(b,a))}async function i(a=[],{createMailbox:b=e.oB}={}){let c=Array.isArray(a)?a:[],d=[],f=[];for(let a=0;a<c.length;a++){let g=String(c[a]||"").trim();if(!g||g.startsWith("#"))continue;if(/^\d{1,3}$/.test(g)){let c=Math.min(50,Math.max(1,Number(g)));for(let f=0;f<c;f++){let c=await b({prefix:"zevai-cb",label:"grok-cli-bulk"}),f=(0,e.WZ)();d.push({line:a+1,email:c.address,password:f,mode:"tempmail-register"})}continue}let h=g.match(/^(auto|tempmail)(?::(\d{1,3}))?$/i);if(h){let c=Math.min(50,Math.max(1,Number(h[2]||1)));for(let f=0;f<c;f++){let c=await b({prefix:"zevai-cb",label:"grok-cli-bulk"}),f=(0,e.WZ)();d.push({line:a+1,email:c.address,password:f,mode:"tempmail-register"})}continue}let i="",j="";if(g.includes("|")){let[a,...b]=g.split("|");i=a.trim(),j=b.join("|").trim()}else if(g.includes(":")){let a=g.indexOf(":"),b=g.slice(0,a).trim();b.includes("@")&&(i=b,j=g.slice(a+1).trim())}if(!i||!j){f.push(a+1);continue}d.push({line:a+1,email:i,password:j,mode:"email-login"})}return{parsed:d,invalidLines:f}}async function j(){let{requestDeviceCode:a}=await Promise.all([c.e(7774),c.e(5433),c.e(5024),c.e(4404),c.e(8590),c.e(7276),c.e(3110),c.e(318),c.e(8895),c.e(4177),c.e(3159)]).then(c.bind(c,74177));return a(g)}async function k(a){let{pollForToken:b}=await Promise.all([c.e(7774),c.e(5433),c.e(5024),c.e(4404),c.e(8590),c.e(7276),c.e(3110),c.e(318),c.e(8895),c.e(4177),c.e(3159)]).then(c.bind(c,74177));return b(g,a)}async function l({tokens:a,email:b,automation:d="tempmail-cloakbrowser"}){let{createProviderConnection:e}=await Promise.resolve().then(c.bind(c,71998)),f={...a.providerSpecificData||{},loginEmail:b,automation:d,authMethod:a.providerSpecificData?.authMethod||"device_code"},h={provider:g,authType:"oauth",accessToken:a.accessToken,refreshToken:a.refreshToken||null,email:a.email||b,displayName:a.displayName||b?.split("@")[0]||null,scope:a.scope||null,providerSpecificData:f,expiresAt:a.expiresIn?new Date(Date.now()+1e3*a.expiresIn).toISOString():null,testStatus:"active"};return{connection:await e(h)}}async function m(a,b){let{launchBulkImportBrowser:d,normalizeBulkImportEngine:e}=await c.e(5949).then(c.bind(c,75949)),f=e(b||"cloakbrowser");return d({engine:f,proxyUrl:a,headless:"cloakbrowser"!==f,windowSize:"cloakbrowser"===f?{width:1280,height:900}:null})}class n extends d.Q6{constructor({browserLauncher:a=m,saveConnection:b=l,requestDeviceCode:c=j,pollToken:d=k,createMailbox:f=e.oB,pollOtp:g=e.ws,storageName:h="grok-cli-bulk-import",proxyUrl:i=null}={}){super({browserLauncher:b=>a(b?.proxyUrls?.[0]||i||null,b?.engine),googleAutomation:null,socialExchange:null,kiroServiceFactory:null,storageName:h}),this.saveConnection=b,this.requestDeviceCode=c,this.pollToken=d,this.createMailbox=f,this.pollOtp=g,this.proxyUrl=i}async startJob({accounts:a,concurrency:b,engine:c,proxyPoolMode:d,proxyPoolId:e}){let{parsed:f,invalidLines:g}=await i(a,{createMailbox:this.createMailbox});if(!f.length){let a=g.length>0?"Invalid format. Use: auto / auto:5 / email:password (or email|password)":"At least one account entry is required (e.g. auto or auto:3)";throw Object.assign(Error(a),{error:a,...g.length?{invalidLines:g}:{}})}if(g.length>0)throw Object.assign(Error("Invalid account format"),{error:"Invalid format. Use: auto / auto:5 / email:password",invalidLines:g});let h=f.map(a=>`${a.email}:${a.password}`),j=await super.startJob({accounts:h,concurrency:b??1,engine:c||"cloakbrowser",proxyPoolMode:d,proxyPoolId:e}),k=this.jobs.get(j.jobId);if(k){let a=new Map(f.map(a=>[a.email.toLowerCase(),a.mode]));for(let b of k.accounts)b.mode=a.get(String(b.email||"").toLowerCase())||"email-login";for(let a of k.accounts){let b=f.find(b=>b.email===a.email);b&&(a.password=b.password,a.mode=b.mode)}}return j}async processAccount(a,b,g){if(a.cancelRequested||!a.browser)return void this.finalizeAccount(b,"cancelled",{error:"Job cancelled"});let h=a.browser,i=null,j=b.proxyUrl||null,k=a.proxyUrls?.[0]||null;if("cloakbrowser"===a.engine&&j&&j!==k||"cloakbrowser"===a.engine&&j&&!k)try{let{launchBulkImportBrowser:a}=await c.e(5949).then(c.bind(c,75949));h=i=await a({engine:"cloakbrowser",proxyUrl:j,headless:!1,windowSize:{width:1280,height:900}}),this.setAccountStep(b,"proxy_browser","Launched CloakBrowser with account proxy (geoip)")}catch(c){this.finalizeAccount(b,"failed",{error:c.message||"Failed to launch browser with proxy",step:"proxy_launch_failed",message:c.message||"Failed to launch browser with proxy"}),await this.persistJobSnapshot(a,{forcePreview:!0});return}let l=i?null:j,{context:m,page:n}=await (0,d.go)(h,l);b.runtimeSession={context:m,page:n,ownedBrowser:i};try{this.setAccountStep(b,"preparing_worker",`Worker ${g} preparing CloakBrowser / xAI flow${j?" (proxied)":" (direct VPS IP — expect blocks)"}`),await this.persistJobSnapshot(a,{forcePreview:!0});let c=(c,d)=>{this.setAccountStep(b,c,d),this.persistJobSnapshot(a,{forcePreview:!1})},d=b.mode||"email-login";if("tempmail-register"===d){let{firstName:d,lastName:g}=(0,e.generateRandomPersonName)();b.profileName=`${d} ${g}`,this.setAccountStep(b,"registering_xai",`Signing up as ${d} ${g} (tempmail + Turnstile)`),await this.persistJobSnapshot(a,{forcePreview:!0});let h=await (0,f.K)(n,{email:b.email,password:b.password,firstName:d,lastName:g,pollOtp:(a,b)=>this.pollOtp(a,b),onStep:c});if("needs_manual"===h.status){b.manualSession={context:m,page:n,opened:!1,openedAt:null,ownedBrowser:i},this.finalizeAccount(b,"needs_manual",{error:h.error,step:h.step||"awaiting_manual",message:h.error}),await this.persistJobSnapshot(a,{forcePreview:!0}),i=null;return}if("success"!==h.status){this.finalizeAccount(b,"failed",{error:h.error||"xAI email signup failed",step:h.step||"failed",message:h.error||"xAI email signup failed"}),b.runtimeSession=null,await m.close().catch(()=>null),i&&await i.close().catch(()=>null),await this.persistJobSnapshot(a,{forcePreview:!0});return}}this.setAccountStep(b,"requesting_device_code","Requesting Grok CLI device code"),await this.persistJobSnapshot(a,{forcePreview:!0});let h=await this.requestDeviceCode(),k=function(a){if(a?.verification_uri_complete)return a.verification_uri_complete;let b=a?.verification_uri||"https://accounts.x.ai/oauth2/device";if(a?.user_code)try{let c=new URL(b);return c.searchParams.set("user_code",a.user_code),c.toString()}catch{return`${b}${b.includes("?")?"&":"?"}user_code=${encodeURIComponent(a.user_code)}`}return b}(h),l=h?.device_code;if(!k||!l)throw Error("Grok CLI did not return a device code / verification URL");let o=await (0,f.runXaiEmailDeviceAuthorize)(n,{email:b.email,password:b.password,verificationUrl:k,deviceCode:l,pollToken:a=>this.pollToken(a),pollOtp:(a,b)=>this.pollOtp(a,b),onStep:c,cancelCheck:()=>a.cancelRequested});if("success"===o.status&&o.tokens){await this.finalizeSuccess(a,b,o.tokens,d),b.runtimeSession=null,await m.close().catch(()=>null),i&&await i.close().catch(()=>null),await this.persistJobSnapshot(a,{forcePreview:!0});return}this.finalizeAccount(b,"failed",{error:o.error||"Device authorization failed",step:"device_failed",message:o.error||"Device authorization failed"}),b.runtimeSession=null,await m.close().catch(()=>null),i&&await i.close().catch(()=>null),await this.persistJobSnapshot(a,{forcePreview:!0})}catch(c){a.cancelRequested?this.finalizeAccount(b,"cancelled",{error:"Job cancelled",step:"cancelled",message:"Job cancelled while Grok CLI automation was running"}):this.finalizeAccount(b,c.status||"failed",{error:c.message||"Unexpected Grok CLI bulk import failure.",step:c.step||"failed",message:c.message||"Unexpected Grok CLI bulk import failure."}),b.runtimeSession=null,await m.close().catch(()=>null),i&&await i.close().catch(()=>null),await this.persistJobSnapshot(a,{forcePreview:!0})}finally{b.password=void 0,i&&await i.close().catch(()=>null)}}createPollPromise(a,b,c){return(async()=>{let d=Date.now(),e=5e3;for(;Date.now()-d<9e5;){if(b.cancelRequested)throw Error("Job cancelled during token polling");this.setAccountStep(c,"polling_grok_token","Waiting for Grok CLI OAuth token"),this.persistJobSnapshot(b,{forcePreview:!1});let d=await this.pollToken(a);if(d.success&&d.tokens)return{tokens:d.tokens};if(d.pending||"authorization_pending"===d.error){await h(e);continue}if("slow_down"===d.error){e=Math.min(e+5e3,3e4),await h(e);continue}await h(e)}throw Error("Timed out waiting for Grok CLI OAuth token")})()}async finalizeSuccess(a,b,c,d="email-login"){this.setAccountStep(b,"saving_connection","Saving Grok CLI connection"),await this.persistJobSnapshot(a,{forcePreview:!0});let{connection:e}=await this.saveConnection({tokens:c,email:c.email||b.email,automation:"tempmail-register"===d?"tempmail-cloakbrowser":"email-login-cloakbrowser"});this.finalizeAccount(b,"success",{connectionId:e.id,step:"connection_saved",message:"Grok CLI connection saved successfully"})}}function o(){return(!globalThis.__grokCliBulkImportSingleton&&(globalThis.__grokCliBulkImportSingleton={manager:new n}),globalThis.__grokCliBulkImportSingleton).manager}}};
1
+ "use strict";exports.id=3487,exports.ids=[3487],exports.modules={48096:(a,b,c)=>{c.d(b,{K:()=>k,runXaiEmailDeviceAuthorize:()=>o});var d=c(63312);function e(a){return new Promise(b=>setTimeout(b,a))}async function f(a){return a.evaluate(()=>document.body?.innerText||"").catch(()=>"")}async function g(a,b,{timeout:c=3e3}={}){for(let d of b)try{let b=a.locator(d).first();if(await b.isVisible({timeout:400}).catch(()=>!1))return await b.click({timeout:c}),d}catch{}return null}async function h(a){return g(a,["#onetrust-accept-btn-handler","#onetrust-reject-all-handler",'button:has-text("Accept All Cookies")','button:has-text("Reject All")'])}async function i(a,b,c=35){await a.click(),await a.fill("").catch(()=>null),await a.type(b,{delay:c})}async function j(a,{timeoutMs:b=6e4,onStep:c}={}){let d=Date.now();for(;Date.now()-d<b;){let b=await a.evaluate(()=>{let a=document.querySelector("input[name=cf-turnstile-response], [name=cf-turnstile-response]");return a?String(a.value||""):""}).catch(()=>"");if(b&&b.length>20)return c?.("turnstile_ok",`Cloudflare Turnstile solved (${b.length} chars)`),{ok:!0,length:b.length};try{for(let b of a.frames()){let a=b.url()||"";/turnstile|challenges\.cloudflare/i.test(a)&&await b.locator("input[type=checkbox], body").first().click({timeout:800}).catch(()=>null)}}catch{}await e(1200)}return c?.("turnstile_timeout","Turnstile did not produce a token in time"),{ok:!1}}async function k(a,{email:b,password:l,firstName:m,lastName:n,pollOtp:o=d.ws,onStep:p}={}){if(!m||!n){let{generateRandomPersonName:a}=await Promise.resolve().then(c.bind(c,63312)),b=a();m=m||b.firstName,n=n||b.lastName}let q=(a,b)=>p?.(a,b);q("opening_signup","Opening xAI email sign-up"),await a.goto("https://accounts.x.ai/sign-up",{waitUntil:"domcontentloaded",timeout:6e4}),await e(1200),await h(a),await a.getByRole("button",{name:/Sign up with email/i}).count()&&(await a.getByRole("button",{name:/Sign up with email/i}).click(),await e(800),q("signup_with_email","Selected Sign up with email")),await a.waitForSelector("input[type=email], input[name=email]",{timeout:15e3}),await i(a.locator("input[type=email], input[name=email]").first(),b,40),await g(a,['button:has-text("Sign up")','button:has-text("Sign Up")']),q("submitted_email",`Submitted sign-up email ${b}`),await e(2e3),await h(a),q("polling_otp","Polling tempmail for xAI confirmation code");let r=await o(b,{timeoutMs:12e4,intervalMs:3e3});if(!r?.code)return{status:"failed",step:"otp_timeout",error:"No xAI OTP received on tempmail inbox"};q("otp_received",`OTP ${r.code} from ${r.subject||"tempmail"}`);let s=a.locator("input[name=code]");await s.isVisible().catch(()=>!1)&&(await i(s,r.code,80),await e(1200));let t=await f(a);/Complete your sign up/i.test(t)||(await g(a,['button:has-text("Confirm email")']),await e(2e3));for(let b=0;b<20&&(t=await f(a),!(/Complete your sign up/i.test(t)||await a.locator("input[name=givenName]").count()));b++)await e(500);if(!await a.locator("input[name=givenName]").first().isVisible().catch(()=>!1))return{status:"failed",step:"profile_form_missing",error:"xAI profile form (givenName) not shown after OTP"};if(q("filling_profile","Filling name + password"),await i(a.locator("input[name=givenName]").first(),m,35),await i(a.locator("input[name=familyName]").first(),n,35),await i(a.locator("input[name=password], input[type=password]").first(),l,35),!(await j(a,{timeoutMs:6e4,onStep:p})).ok)return{status:"needs_manual",step:"turnstile",error:"Cloudflare Turnstile did not solve. Use CloakBrowser headed engine or complete manually."};await g(a,['button:has-text("Complete sign up")']),q("completing_signup","Clicked Complete sign up"),await e(4e3),t=await f(a),/Complete your sign up/i.test(t)&&(await j(a,{timeoutMs:2e4,onStep:p}),await g(a,['button:has-text("Complete sign up")']),await e(4e3),t=await f(a));let u=a.url();return!/Complete your sign up|Verify your email|You must provide/i.test(t)&&!/\/sign-up/i.test(u)||/\/account/i.test(u)||/Welcome/i.test(t)?(q("signup_ok",`Account ready: ${b}`),{status:"success",email:b,password:l,url:u}):{status:"failed",step:"signup_incomplete",error:"xAI sign-up did not complete after profile submit",url:u,text:t.slice(0,300)}}async function l(a,b){try{let c=a.getByRole("button",{name:b}).first();if(await c.isVisible({timeout:600}).catch(()=>!1))return await c.click({timeout:4e3}),!0}catch{}return!1}async function m(a){for(let b of[/^(Allow|Authorize|Approve|Confirm|Yes|Accept)$/i,/Allow|Authorize|Approve|Confirm/i,/^Continue$/i,/Continue/i,/^Next$/i,/Sign in|Log in|Login/i])if(await l(a,b))return!0;try{let b=a.getByRole("link",{name:/Allow|Authorize|Continue|Confirm/i}).first();if(await b.isVisible({timeout:400}).catch(()=>!1))return await b.click({timeout:3e3}),!0}catch{}return!!await g(a,['button:has-text("Allow")','button:has-text("Authorize")','button:has-text("Approve")','button:has-text("Confirm")','button:has-text("Continue")','button:has-text("Next")',"button[type=submit]","input[type=submit]"])}async function n(a,{email:b,password:c,onStep:d,pollOtp:h}){let k=(a,b)=>d?.(a,b);await a.getByRole("button",{name:/Login with email/i}).count()&&(await a.getByRole("button",{name:/Login with email/i}).click().catch(()=>null),await e(800)),await a.locator("input[type=email]").first().isVisible().catch(()=>!1)&&(k("device_login_email","Entering email on device page"),await i(a.locator("input[type=email]").first(),b,40),await m(a),await e(1200)),await a.locator("input[type=password]").first().isVisible().catch(()=>!1)&&(k("device_login_password","Entering password on device page"),await i(a.locator("input[type=password]").first(),c,40),await j(a,{timeoutMs:45e3,onStep:d}),await g(a,['button:has-text("Login")','button:has-text("Log in")',"button[type=submit]"]),await e(2500));let l=await f(a);if(/security code|Verify your email|one time|confirmation code/i.test(l)){k("login_otp","Login requires OTP — polling tempmail");let c=await h(b,{timeoutMs:9e4});if(c?.code){let b=a.locator("input[name=code], input[autocomplete=one-time-code], input[type=text]").first();await b.isVisible().catch(()=>!1)&&await i(b,c.code,80),await m(a),await e(2e3)}}}async function o(a,{email:b,password:c,verificationUrl:g,pollToken:i,deviceCode:k,pollOtp:l=d.ws,onStep:p,cancelCheck:q}={}){let r=(a,b)=>p?.(a,b),s={done:!1},t=a.url();/\/account/i.test(t)||/accounts\.x\.ai/i.test(t)||(r("opening_signin","Opening xAI email login"),await a.goto("https://accounts.x.ai/sign-in",{waitUntil:"domcontentloaded",timeout:6e4}),await e(1e3),await h(a),await n(a,{email:b,password:c,onStep:p,pollOtp:l})),r("opening_device","Opening Grok Build device authorization"),await a.goto(g,{waitUntil:"domcontentloaded",timeout:6e4}),await e(1500),await h(a),await m(a),await e(2e3),(await a.getByRole("button",{name:/Login with email/i}).count()||await a.locator("input[type=email]").first().isVisible().catch(()=>!1))&&(r("device_needs_login","Device page requires login — signing in"),await n(a,{email:b,password:c,onStep:p,pollOtp:l}),await a.goto(g,{waitUntil:"domcontentloaded",timeout:6e4}),await e(1500),await h(a),await m(a),await e(2e3));try{let b=(await f(a)).replace(/\s+/g," ").slice(0,160);r("device_page",`Device page: ${a.url().slice(0,80)} \xb7 ${b}`)}catch{}let u=(async()=>{let a=Date.now(),b=4e3;for(;Date.now()-a<72e4;){if(q?.())throw Error("Job cancelled during token polling");s.done&&await e(1500);let a=await i(k);if(a?.success&&a.tokens)return{tokens:a.tokens};if(a?.pending||a?.error==="authorization_pending"){await e(b);continue}if(a?.error==="slow_down"){b=Math.min(b+5e3,3e4),await e(b);continue}if(a?.error&&!["authorization_pending","slow_down"].includes(a.error)){r("token_poll_note",`Poll: ${a.error}`),await e(b);continue}await e(b)}throw Error("Timed out waiting for Grok CLI OAuth token (device may not have been authorized in the browser)")})(),v=(async()=>{let d=Date.now(),i=0;for(;Date.now()-d<66e4;){if(q?.())return;if(s.done){await e(2e3);continue}let d=await f(a),k=a.url();if(/Device Authorized|device has been authorized|you can close|successfully authorized/i.test(d)){s.done=!0,r("device_authorized","Device authorized in browser");return}if(/Login with email|Sign in to continue|log in to continue/i.test(d)||await a.locator("input[type=password]").first().isVisible().catch(()=>!1)){r("device_relogin","Re-login required on device page"),await n(a,{email:b,password:c,onStep:p,pollOtp:l}),await a.goto(g,{waitUntil:"domcontentloaded",timeout:6e4}).catch(()=>null),await e(1500);continue}if(/Authorize Grok|Grok Build|Verify your identity|Confirm your identity|device code|user code/i.test(d)||/oauth2\/device|device\/verify/i.test(k)){await m(a)&&i%3==0&&r("device_click",`Clicked authorize control (${i+1})`),await j(a,{timeoutMs:12e3,onStep:i%5==0?p:void 0}),await e(1800),i+=1;continue}if(/Redirecting/i.test(d)||/\/account/i.test(k)&&!/device/i.test(k)){r("device_reopen","Re-opening device authorization URL"),await a.goto(g,{waitUntil:"domcontentloaded",timeout:6e4}),await e(1500),await h(a),await m(a),await e(1500),i+=1;continue}await m(a),i>0&&i%8==0&&(r("device_reload",`Reload device page (attempt ${i}) \xb7 ${k.slice(0,60)}`),await a.goto(g,{waitUntil:"domcontentloaded",timeout:6e4}).catch(()=>null),await e(1200),await m(a)),await e(1800),i+=1}})();r("polling_token","Waiting for device token after authorization");try{let[a]=await Promise.all([u,v.catch(a=>(r("device_ui_note",String(a?.message||a).slice(0,120)),null))]);return{status:"success",tokens:a.tokens}}catch(c){let b=(await f(a).catch(()=>"")).replace(/\s+/g," ").slice(0,200);return{status:"failed",error:`${c.message||c} \xb7 page: ${a.url()} \xb7 ${b}`}}}},63312:(a,b,c)=>{c.d(b,{WZ:()=>h,generateRandomPersonName:()=>l,oB:()=>n,ws:()=>p});let d=process.env.TEMPMAIL_BASE_URL||"https://tempmail.zevai.web.id",e=process.env.TEMPMAIL_EMAIL_DOMAIN||"zevai.web.id";function f(a={}){return{baseUrl:String(a.baseUrl||d).replace(/\/+$/,""),domain:String(a.domain||e).replace(/^@/,""),userAgent:a.userAgent||"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"}}async function g(a,b,{method:c="GET",body:d}={}){let e=`${a.baseUrl}${b.startsWith("/")?b:`/${b}`}`,f=await fetch(e,{method:c,headers:{Accept:"application/json","User-Agent":a.userAgent,...d?{"Content-Type":"application/json"}:{}},body:d?JSON.stringify(d):void 0}),h=await f.text(),i=null;try{i=h?JSON.parse(h):null}catch{i={raw:h}}if(!f.ok){let a=Error(i?.error||`Tempmail HTTP ${f.status}`);throw a.status=f.status,a.payload=i,a}return i}function h(){let a=Math.random().toString(36).slice(2,10);return`Zv!${a}Aa1`}let i=["James","John","Robert","Michael","William","David","Richard","Joseph","Thomas","Charles","Christopher","Daniel","Matthew","Anthony","Mark","Steven","Paul","Andrew","Joshua","Kenneth","Kevin","Brian","George","Timothy","Ronald","Edward","Jason","Jeffrey","Ryan","Jacob","Mary","Patricia","Jennifer","Linda","Barbara","Elizabeth","Susan","Jessica","Sarah","Karen","Lisa","Nancy","Betty","Margaret","Sandra","Ashley","Dorothy","Kimberly","Emily","Donna","Michelle","Carol","Amanda","Melissa","Deborah","Stephanie","Rebecca","Sharon","Laura","Emma","Olivia","Ava","Sophia","Isabella","Mia","Charlotte","Amelia","Noah","Liam","Oliver","Elijah","Lucas","Mason","Logan","Ethan"],j=["Smith","Johnson","Williams","Brown","Jones","Garcia","Miller","Davis","Rodriguez","Martinez","Hernandez","Lopez","Gonzalez","Wilson","Anderson","Thomas","Taylor","Moore","Jackson","Martin","Lee","Perez","Thompson","White","Harris","Sanchez","Clark","Ramirez","Lewis","Robinson","Walker","Young","Allen","King","Wright","Scott","Torres","Nguyen","Hill","Flores","Green","Adams","Nelson","Baker","Hall","Rivera","Campbell","Mitchell","Carter","Roberts","Turner","Phillips","Parker","Evans","Edwards","Collins","Stewart","Morris","Murphy","Cook"];function k(a){return a[Math.floor(Math.random()*a.length)]}function l(){return{firstName:k(i),lastName:k(j)}}async function m(a,{label:b=null,...c}={}){return g(f(c),"/api/addresses",{method:"POST",body:{address:a,label:b||"grok-cli-bulk"}})}async function n({prefix:a="zevai-cb",label:b="grok-cli-bulk",...c}={}){let d=f(c),e=function(a="zevai"){let b=Math.random().toString(36).slice(2,8),c=Date.now().toString(36).slice(-4);return`${a}-${c}${b}`.toLowerCase().replace(/[^a-z0-9._+-]/g,"")}(a),g=`${e}@${d.domain}`;return await m(g,{label:b,...d}),{address:g,domain:d.domain}}async function o(a,b={}){let c=f(b),d=encodeURIComponent(a),e=await g(c,`/api/inbox/${d}`);return Array.isArray(e)?e:[]}async function p(a,{timeoutMs:b=12e4,intervalMs:c=3e3,seenIds:d=null,...e}={}){let f=d||new Set,g=Date.now();for(;Date.now()-g<b;){for(let b of[...await o(a,e)].sort((a,b)=>(b.received_at||0)-(a.received_at||0))){let a=b.id||`${b.subject}-${b.received_at}`;if(f.has(a))continue;let c=b.subject||"",d=c.match(/([A-Z0-9]{2,5}-[A-Z0-9]{2,5})\s+xAI confirmation code/i);if(d)return f.add(a),{code:d[1],subject:c,id:b.id||null,mail:b}}await function(a){return new Promise(b=>setTimeout(b,a))}(c)}return null}},83487:(a,b,c)=>{c.d(b,{MC:()=>o,cO:()=>d.cO});var d=c(53041),e=c(63312),f=c(48096);let g="grok-cli";function h(a){return new Promise(b=>setTimeout(b,a))}async function i(a=[],{createMailbox:b=e.oB}={}){let c=Array.isArray(a)?a:[],d=[],f=[];for(let a=0;a<c.length;a++){let g=String(c[a]||"").trim();if(!g||g.startsWith("#"))continue;if(/^\d{1,3}$/.test(g)){let c=Math.min(50,Math.max(1,Number(g)));for(let f=0;f<c;f++){let c=await b({prefix:"zevai-cb",label:"grok-cli-bulk"}),f=(0,e.WZ)();d.push({line:a+1,email:c.address,password:f,mode:"tempmail-register"})}continue}let h=g.match(/^(auto|tempmail)(?::(\d{1,3}))?$/i);if(h){let c=Math.min(50,Math.max(1,Number(h[2]||1)));for(let f=0;f<c;f++){let c=await b({prefix:"zevai-cb",label:"grok-cli-bulk"}),f=(0,e.WZ)();d.push({line:a+1,email:c.address,password:f,mode:"tempmail-register"})}continue}let i="",j="";if(g.includes("|")){let[a,...b]=g.split("|");i=a.trim(),j=b.join("|").trim()}else if(g.includes(":")){let a=g.indexOf(":"),b=g.slice(0,a).trim();b.includes("@")&&(i=b,j=g.slice(a+1).trim())}if(!i||!j){f.push(a+1);continue}d.push({line:a+1,email:i,password:j,mode:"email-login"})}return{parsed:d,invalidLines:f}}async function j(){let{requestDeviceCode:a}=await Promise.all([c.e(7774),c.e(5433),c.e(5024),c.e(4404),c.e(8590),c.e(3155),c.e(3110),c.e(318),c.e(8895),c.e(4177),c.e(3159)]).then(c.bind(c,74177));return a(g)}async function k(a){let{pollForToken:b}=await Promise.all([c.e(7774),c.e(5433),c.e(5024),c.e(4404),c.e(8590),c.e(3155),c.e(3110),c.e(318),c.e(8895),c.e(4177),c.e(3159)]).then(c.bind(c,74177));return b(g,a)}async function l({tokens:a,email:b,automation:d="tempmail-cloakbrowser"}){let{createProviderConnection:e}=await Promise.resolve().then(c.bind(c,71998)),f={...a.providerSpecificData||{},loginEmail:b,automation:d,authMethod:a.providerSpecificData?.authMethod||"device_code"},h={provider:g,authType:"oauth",accessToken:a.accessToken,refreshToken:a.refreshToken||null,email:a.email||b,displayName:a.displayName||b?.split("@")[0]||null,scope:a.scope||null,providerSpecificData:f,expiresAt:a.expiresIn?new Date(Date.now()+1e3*a.expiresIn).toISOString():null,testStatus:"active"};return{connection:await e(h)}}async function m(a,b){let{launchBulkImportBrowser:d,normalizeBulkImportEngine:e}=await c.e(5949).then(c.bind(c,75949)),f=e(b||"cloakbrowser");return d({engine:f,proxyUrl:a,headless:"cloakbrowser"!==f,windowSize:"cloakbrowser"===f?{width:1280,height:900}:null})}class n extends d.Q6{constructor({browserLauncher:a=m,saveConnection:b=l,requestDeviceCode:c=j,pollToken:d=k,createMailbox:f=e.oB,pollOtp:g=e.ws,storageName:h="grok-cli-bulk-import",proxyUrl:i=null}={}){super({browserLauncher:b=>a(b?.proxyUrls?.[0]||i||null,b?.engine),googleAutomation:null,socialExchange:null,kiroServiceFactory:null,storageName:h}),this.saveConnection=b,this.requestDeviceCode=c,this.pollToken=d,this.createMailbox=f,this.pollOtp=g,this.proxyUrl=i}async startJob({accounts:a,concurrency:b,engine:c,proxyPoolMode:d,proxyPoolId:e}){let{parsed:f,invalidLines:g}=await i(a,{createMailbox:this.createMailbox});if(!f.length){let a=g.length>0?"Invalid format. Use: auto / auto:5 / email:password (or email|password)":"At least one account entry is required (e.g. auto or auto:3)";throw Object.assign(Error(a),{error:a,...g.length?{invalidLines:g}:{}})}if(g.length>0)throw Object.assign(Error("Invalid account format"),{error:"Invalid format. Use: auto / auto:5 / email:password",invalidLines:g});let h=f.map(a=>`${a.email}:${a.password}`),j=await super.startJob({accounts:h,concurrency:b??1,engine:c||"cloakbrowser",proxyPoolMode:d,proxyPoolId:e}),k=this.jobs.get(j.jobId);if(k){let a=new Map(f.map(a=>[a.email.toLowerCase(),a.mode]));for(let b of k.accounts)b.mode=a.get(String(b.email||"").toLowerCase())||"email-login";for(let a of k.accounts){let b=f.find(b=>b.email===a.email);b&&(a.password=b.password,a.mode=b.mode)}}return j}async processAccount(a,b,g){if(a.cancelRequested||!a.browser)return void this.finalizeAccount(b,"cancelled",{error:"Job cancelled"});let h=a.browser,i=null,j=b.proxyUrl||null,k=a.proxyUrls?.[0]||null;if("cloakbrowser"===a.engine&&j&&j!==k||"cloakbrowser"===a.engine&&j&&!k)try{let{launchBulkImportBrowser:a}=await c.e(5949).then(c.bind(c,75949));h=i=await a({engine:"cloakbrowser",proxyUrl:j,headless:!1,windowSize:{width:1280,height:900}}),this.setAccountStep(b,"proxy_browser","Launched CloakBrowser with account proxy (geoip)")}catch(c){this.finalizeAccount(b,"failed",{error:c.message||"Failed to launch browser with proxy",step:"proxy_launch_failed",message:c.message||"Failed to launch browser with proxy"}),await this.persistJobSnapshot(a,{forcePreview:!0});return}let l=i?null:j,{context:m,page:n}=await (0,d.go)(h,l);b.runtimeSession={context:m,page:n,ownedBrowser:i};try{this.setAccountStep(b,"preparing_worker",`Worker ${g} preparing CloakBrowser / xAI flow${j?" (proxied)":" (direct VPS IP — expect blocks)"}`),await this.persistJobSnapshot(a,{forcePreview:!0});let c=(c,d)=>{this.setAccountStep(b,c,d),this.persistJobSnapshot(a,{forcePreview:!1})},d=b.mode||"email-login";if("tempmail-register"===d){let{firstName:d,lastName:g}=(0,e.generateRandomPersonName)();b.profileName=`${d} ${g}`,this.setAccountStep(b,"registering_xai",`Signing up as ${d} ${g} (tempmail + Turnstile)`),await this.persistJobSnapshot(a,{forcePreview:!0});let h=await (0,f.K)(n,{email:b.email,password:b.password,firstName:d,lastName:g,pollOtp:(a,b)=>this.pollOtp(a,b),onStep:c});if("needs_manual"===h.status){b.manualSession={context:m,page:n,opened:!1,openedAt:null,ownedBrowser:i},this.finalizeAccount(b,"needs_manual",{error:h.error,step:h.step||"awaiting_manual",message:h.error}),await this.persistJobSnapshot(a,{forcePreview:!0}),i=null;return}if("success"!==h.status){this.finalizeAccount(b,"failed",{error:h.error||"xAI email signup failed",step:h.step||"failed",message:h.error||"xAI email signup failed"}),b.runtimeSession=null,await m.close().catch(()=>null),i&&await i.close().catch(()=>null),await this.persistJobSnapshot(a,{forcePreview:!0});return}}this.setAccountStep(b,"requesting_device_code","Requesting Grok CLI device code"),await this.persistJobSnapshot(a,{forcePreview:!0});let h=await this.requestDeviceCode(),k=function(a){if(a?.verification_uri_complete)return a.verification_uri_complete;let b=a?.verification_uri||"https://accounts.x.ai/oauth2/device";if(a?.user_code)try{let c=new URL(b);return c.searchParams.set("user_code",a.user_code),c.toString()}catch{return`${b}${b.includes("?")?"&":"?"}user_code=${encodeURIComponent(a.user_code)}`}return b}(h),l=h?.device_code;if(!k||!l)throw Error("Grok CLI did not return a device code / verification URL");let o=await (0,f.runXaiEmailDeviceAuthorize)(n,{email:b.email,password:b.password,verificationUrl:k,deviceCode:l,pollToken:a=>this.pollToken(a),pollOtp:(a,b)=>this.pollOtp(a,b),onStep:c,cancelCheck:()=>a.cancelRequested});if("success"===o.status&&o.tokens){await this.finalizeSuccess(a,b,o.tokens,d),b.runtimeSession=null,await m.close().catch(()=>null),i&&await i.close().catch(()=>null),await this.persistJobSnapshot(a,{forcePreview:!0});return}this.finalizeAccount(b,"failed",{error:o.error||"Device authorization failed",step:"device_failed",message:o.error||"Device authorization failed"}),b.runtimeSession=null,await m.close().catch(()=>null),i&&await i.close().catch(()=>null),await this.persistJobSnapshot(a,{forcePreview:!0})}catch(c){a.cancelRequested?this.finalizeAccount(b,"cancelled",{error:"Job cancelled",step:"cancelled",message:"Job cancelled while Grok CLI automation was running"}):this.finalizeAccount(b,c.status||"failed",{error:c.message||"Unexpected Grok CLI bulk import failure.",step:c.step||"failed",message:c.message||"Unexpected Grok CLI bulk import failure."}),b.runtimeSession=null,await m.close().catch(()=>null),i&&await i.close().catch(()=>null),await this.persistJobSnapshot(a,{forcePreview:!0})}finally{b.password=void 0,i&&await i.close().catch(()=>null)}}createPollPromise(a,b,c){return(async()=>{let d=Date.now(),e=5e3;for(;Date.now()-d<9e5;){if(b.cancelRequested)throw Error("Job cancelled during token polling");this.setAccountStep(c,"polling_grok_token","Waiting for Grok CLI OAuth token"),this.persistJobSnapshot(b,{forcePreview:!1});let d=await this.pollToken(a);if(d.success&&d.tokens)return{tokens:d.tokens};if(d.pending||"authorization_pending"===d.error){await h(e);continue}if("slow_down"===d.error){e=Math.min(e+5e3,3e4),await h(e);continue}await h(e)}throw Error("Timed out waiting for Grok CLI OAuth token")})()}async finalizeSuccess(a,b,c,d="email-login"){this.setAccountStep(b,"saving_connection","Saving Grok CLI connection"),await this.persistJobSnapshot(a,{forcePreview:!0});let{connection:e}=await this.saveConnection({tokens:c,email:c.email||b.email,automation:"tempmail-register"===d?"tempmail-cloakbrowser":"email-login-cloakbrowser"});this.finalizeAccount(b,"success",{connectionId:e.id,step:"connection_saved",message:"Grok CLI connection saved successfully"})}}function o(){return(!globalThis.__grokCliBulkImportSingleton&&(globalThis.__grokCliBulkImportSingleton={manager:new n}),globalThis.__grokCliBulkImportSingleton).manager}}};