zevairouter 1.1.64 → 1.1.66

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 (596) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/cli/app/.next-cli-build/BUILD_ID +1 -1
  3. package/cli/app/.next-cli-build/app-path-routes-manifest.json +6 -6
  4. package/cli/app/.next-cli-build/build-manifest.json +2 -2
  5. package/cli/app/.next-cli-build/prerender-manifest.json +3 -3
  6. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page.js.nft.json +1 -1
  7. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page_client-reference-manifest.js +1 -1
  8. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  9. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  10. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  11. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  12. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  13. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  14. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  15. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  16. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  17. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  18. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page.js.nft.json +1 -1
  19. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page_client-reference-manifest.js +1 -1
  20. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  21. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  22. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  23. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  24. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  25. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  26. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  27. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  28. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  29. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  30. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  31. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  32. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  33. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  34. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js.nft.json +1 -1
  35. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  36. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  37. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  38. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  39. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  40. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  41. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  42. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  43. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  44. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  45. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  46. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  47. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  48. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  49. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  50. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  51. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page.js.nft.json +1 -1
  52. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  53. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  54. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  55. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page.js.nft.json +1 -1
  56. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page_client-reference-manifest.js +1 -1
  57. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  58. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  59. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  60. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  61. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  62. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  63. package/cli/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  64. package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  65. package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
  66. package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  67. package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  68. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  69. package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  70. package/cli/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  71. package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  72. package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
  73. package/cli/app/.next-cli-build/server/app/_not-found.rsc +2 -2
  74. package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +2 -2
  75. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  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/reset-password/route.js.nft.json +1 -1
  83. package/cli/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  84. package/cli/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  85. package/cli/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  86. package/cli/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  87. package/cli/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  88. package/cli/app/.next-cli-build/server/app/api/cache/stats/route.js.nft.json +1 -1
  89. package/cli/app/.next-cli-build/server/app/api/changelog/route.js.nft.json +1 -1
  90. package/cli/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +5 -6
  91. package/cli/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  92. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  93. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  94. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  95. package/cli/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  96. package/cli/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  97. package/cli/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
  98. package/cli/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  99. package/cli/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js +3 -3
  100. package/cli/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
  101. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-gateway/accounts/route.js.nft.json +1 -1
  102. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
  103. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +2 -2
  104. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  105. package/cli/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  106. package/cli/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  107. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  108. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  109. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  110. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  111. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  112. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  113. package/cli/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js +2 -2
  114. package/cli/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
  115. package/cli/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  116. package/cli/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  117. package/cli/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +1 -1
  118. package/cli/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  119. package/cli/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  120. package/cli/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  121. package/cli/app/.next-cli-build/server/app/api/cli-tools/dsh-settings/route.js +2 -2
  122. package/cli/app/.next-cli-build/server/app/api/cli-tools/dsh-settings/route.js.nft.json +1 -1
  123. package/cli/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js +3 -3
  124. package/cli/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
  125. package/cli/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
  126. package/cli/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  127. package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +1 -1
  128. package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +1 -1
  129. package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  130. package/cli/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +1 -1
  131. package/cli/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  132. package/cli/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  133. package/cli/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  134. package/cli/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js +2 -2
  135. package/cli/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js.nft.json +1 -1
  136. package/cli/app/.next-cli-build/server/app/api/cli-tools/openbot-settings/route.js +2 -2
  137. package/cli/app/.next-cli-build/server/app/api/cli-tools/openbot-settings/route.js.nft.json +1 -1
  138. package/cli/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  139. package/cli/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  140. package/cli/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -2
  141. package/cli/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  142. package/cli/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +2 -2
  143. package/cli/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
  144. package/cli/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js +1 -1
  145. package/cli/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js.nft.json +1 -1
  146. package/cli/app/.next-cli-build/server/app/api/combos/[id]/route.js +3 -1
  147. package/cli/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  148. package/cli/app/.next-cli-build/server/app/api/combos/presets/route.js.nft.json +1 -1
  149. package/cli/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  150. package/cli/app/.next-cli-build/server/app/api/context/[id]/route.js.nft.json +1 -1
  151. package/cli/app/.next-cli-build/server/app/api/context/bulk/route.js.nft.json +1 -1
  152. package/cli/app/.next-cli-build/server/app/api/context/route.js.nft.json +1 -1
  153. package/cli/app/.next-cli-build/server/app/api/context/test/route.js.nft.json +1 -1
  154. package/cli/app/.next-cli-build/server/app/api/dashboard/chat/completions/route.js +1 -1
  155. package/cli/app/.next-cli-build/server/app/api/dashboard/chat/completions/route.js.nft.json +1 -1
  156. package/cli/app/.next-cli-build/server/app/api/dashboard/cli-tools/keys/route.js.nft.json +1 -1
  157. package/cli/app/.next-cli-build/server/app/api/dashboard/media/[operation]/route.js +1 -1
  158. package/cli/app/.next-cli-build/server/app/api/dashboard/media/[operation]/route.js.nft.json +1 -1
  159. package/cli/app/.next-cli-build/server/app/api/dashboard/media/videos/[id]/route.js +1 -1
  160. package/cli/app/.next-cli-build/server/app/api/dashboard/media/videos/[id]/route.js.nft.json +1 -1
  161. package/cli/app/.next-cli-build/server/app/api/dashboard/models/route.js +1 -1
  162. package/cli/app/.next-cli-build/server/app/api/dashboard/models/route.js.nft.json +1 -1
  163. package/cli/app/.next-cli-build/server/app/api/headroom/enable/route.js.nft.json +1 -1
  164. package/cli/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  165. package/cli/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  166. package/cli/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  167. package/cli/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  168. package/cli/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  169. package/cli/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  170. package/cli/app/.next-cli-build/server/app/api/health/ready/route.js.nft.json +1 -1
  171. package/cli/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  172. package/cli/app/.next-cli-build/server/app/api/init/route.js +1 -1
  173. package/cli/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  174. package/cli/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js.nft.json +1 -1
  175. package/cli/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  176. package/cli/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  177. package/cli/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  178. package/cli/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  179. package/cli/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  180. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  181. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  182. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  183. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  184. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  185. package/cli/app/.next-cli-build/server/app/api/metrics/route.js.nft.json +1 -1
  186. package/cli/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  187. package/cli/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  188. package/cli/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
  189. package/cli/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  190. package/cli/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  191. package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
  192. package/cli/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  193. package/cli/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  194. package/cli/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  195. package/cli/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  196. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/cancel/route.js +1 -1
  197. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  198. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
  199. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  200. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/route.js +1 -1
  201. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/route.js.nft.json +1 -1
  202. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/latest/route.js +1 -1
  203. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/latest/route.js.nft.json +1 -1
  204. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/route.js +1 -1
  205. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/route.js.nft.json +1 -1
  206. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  207. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  208. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/route.js.nft.json +1 -1
  209. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/latest/route.js.nft.json +1 -1
  210. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/route.js.nft.json +1 -1
  211. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  212. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  213. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/route.js.nft.json +1 -1
  214. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/latest/route.js.nft.json +1 -1
  215. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/route.js.nft.json +1 -1
  216. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-token/route.js.nft.json +1 -1
  217. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/quota-cookie/route.js.nft.json +1 -1
  218. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  219. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  220. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/route.js.nft.json +1 -1
  221. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/latest/route.js.nft.json +1 -1
  222. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js.nft.json +1 -1
  223. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-token/route.js.nft.json +1 -1
  224. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/quota-cookie/route.js.nft.json +1 -1
  225. package/cli/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  226. package/cli/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  227. package/cli/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  228. package/cli/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  229. package/cli/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  230. package/cli/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  231. package/cli/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  232. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  233. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  234. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/route.js.nft.json +1 -1
  235. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/latest/route.js.nft.json +1 -1
  236. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  237. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-token/route.js.nft.json +1 -1
  238. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/json-import/route.js.nft.json +1 -1
  239. package/cli/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  240. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  241. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  242. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  243. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  244. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/route.js.nft.json +1 -1
  245. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/latest/route.js.nft.json +1 -1
  246. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/route.js.nft.json +1 -1
  247. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  248. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  249. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  250. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  251. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  252. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  253. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/route.js.nft.json +1 -1
  254. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/latest/route.js.nft.json +1 -1
  255. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/route.js.nft.json +1 -1
  256. package/cli/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  257. package/cli/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  258. package/cli/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
  259. package/cli/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
  260. package/cli/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  261. package/cli/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  262. package/cli/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  263. package/cli/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  264. package/cli/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  265. package/cli/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  266. package/cli/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  267. package/cli/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  268. package/cli/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js.nft.json +1 -1
  269. package/cli/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  270. package/cli/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  271. package/cli/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  272. package/cli/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  273. package/cli/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  274. package/cli/app/.next-cli-build/server/app/api/providers/bulk-delete/route.js +1 -1
  275. package/cli/app/.next-cli-build/server/app/api/providers/bulk-delete/route.js.nft.json +1 -1
  276. package/cli/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  277. package/cli/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  278. package/cli/app/.next-cli-build/server/app/api/providers/cloudflare-ai/discover-models/route.js +1 -1
  279. package/cli/app/.next-cli-build/server/app/api/providers/cloudflare-ai/discover-models/route.js.nft.json +1 -1
  280. package/cli/app/.next-cli-build/server/app/api/providers/codebuddy/discover-models/route.js.nft.json +1 -1
  281. package/cli/app/.next-cli-build/server/app/api/providers/codebuddy-cn/discover-models/route.js.nft.json +1 -1
  282. package/cli/app/.next-cli-build/server/app/api/providers/codebuddy-intl/discover-models/route.js.nft.json +1 -1
  283. package/cli/app/.next-cli-build/server/app/api/providers/flow/import/route.js.nft.json +1 -1
  284. package/cli/app/.next-cli-build/server/app/api/providers/flow/login/[jobId]/route.js.nft.json +1 -1
  285. package/cli/app/.next-cli-build/server/app/api/providers/flow/login/route.js.nft.json +1 -1
  286. package/cli/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  287. package/cli/app/.next-cli-build/server/app/api/providers/kiro/discover-models/route.js +1 -1
  288. package/cli/app/.next-cli-build/server/app/api/providers/kiro/discover-models/route.js.nft.json +1 -1
  289. package/cli/app/.next-cli-build/server/app/api/providers/kiro/models/route.js +1 -1
  290. package/cli/app/.next-cli-build/server/app/api/providers/kiro/models/route.js.nft.json +1 -1
  291. package/cli/app/.next-cli-build/server/app/api/providers/opencode/discover-models/route.js +1 -1
  292. package/cli/app/.next-cli-build/server/app/api/providers/opencode/discover-models/route.js.nft.json +1 -1
  293. package/cli/app/.next-cli-build/server/app/api/providers/openrouter/discover-models/route.js.nft.json +1 -1
  294. package/cli/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  295. package/cli/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  296. package/cli/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  297. package/cli/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  298. package/cli/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  299. package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  300. package/cli/app/.next-cli-build/server/app/api/providers/web-login/route.js.nft.json +1 -1
  301. package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  302. package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  303. package/cli/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  304. package/cli/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  305. package/cli/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  306. package/cli/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  307. package/cli/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  308. package/cli/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  309. package/cli/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  310. package/cli/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  311. package/cli/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  312. package/cli/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  313. package/cli/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  314. package/cli/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  315. package/cli/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  316. package/cli/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  317. package/cli/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  318. package/cli/app/.next-cli-build/server/app/api/settings/route.js +3 -1
  319. package/cli/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  320. package/cli/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  321. package/cli/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  322. package/cli/app/.next-cli-build/server/app/api/terminal/auth/setup/route.js.nft.json +1 -1
  323. package/cli/app/.next-cli-build/server/app/api/terminal/auth/status/route.js.nft.json +1 -1
  324. package/cli/app/.next-cli-build/server/app/api/terminal/auth/unlock/route.js.nft.json +1 -1
  325. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/input/route.js.nft.json +1 -1
  326. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/resize/route.js.nft.json +1 -1
  327. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/route.js.nft.json +1 -1
  328. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/stream/route.js.nft.json +1 -1
  329. package/cli/app/.next-cli-build/server/app/api/terminal/session/route.js.nft.json +1 -1
  330. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  331. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  332. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  333. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  334. package/cli/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  335. package/cli/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  336. package/cli/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  337. package/cli/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  338. package/cli/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  339. package/cli/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  340. package/cli/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  341. package/cli/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  342. package/cli/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  343. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  344. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  345. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  346. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +1 -1
  347. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  348. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
  349. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
  350. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  351. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  352. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  353. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  354. package/cli/app/.next-cli-build/server/app/api/usage/aggregate/route.js +1 -1
  355. package/cli/app/.next-cli-build/server/app/api/usage/aggregate/route.js.nft.json +1 -1
  356. package/cli/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  357. package/cli/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  358. package/cli/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  359. package/cli/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  360. package/cli/app/.next-cli-build/server/app/api/usage/quota-stream/route.js +2 -2
  361. package/cli/app/.next-cli-build/server/app/api/usage/quota-stream/route.js.nft.json +1 -1
  362. package/cli/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  363. package/cli/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  364. package/cli/app/.next-cli-build/server/app/api/usage/routing-stream/route.js.nft.json +1 -1
  365. package/cli/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  366. package/cli/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  367. package/cli/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  368. package/cli/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  369. package/cli/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  370. package/cli/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  371. package/cli/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  372. package/cli/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  373. package/cli/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  374. package/cli/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  375. package/cli/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  376. package/cli/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  377. package/cli/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  378. package/cli/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  379. package/cli/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  380. package/cli/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  381. package/cli/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  382. package/cli/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  383. package/cli/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +1 -1
  384. package/cli/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
  385. package/cli/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  386. package/cli/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  387. package/cli/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  388. package/cli/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  389. package/cli/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  390. package/cli/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  391. package/cli/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  392. package/cli/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  393. package/cli/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  394. package/cli/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  395. package/cli/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  396. package/cli/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  397. package/cli/app/.next-cli-build/server/app/api/v1/systemone/route.js +1 -1
  398. package/cli/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -1
  399. package/cli/app/.next-cli-build/server/app/api/v1/videos/[id]/content/route.js.nft.json +1 -1
  400. package/cli/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  401. package/cli/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  402. package/cli/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  403. package/cli/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  404. package/cli/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  405. package/cli/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  406. package/cli/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  407. package/cli/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  408. package/cli/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  409. package/cli/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  410. package/cli/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  411. package/cli/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  412. package/cli/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  413. package/cli/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  414. package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
  415. package/cli/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  416. package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  417. package/cli/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  418. package/cli/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  419. package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  420. package/cli/app/.next-cli-build/server/app/callback.html +1 -1
  421. package/cli/app/.next-cli-build/server/app/callback.rsc +2 -2
  422. package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +2 -2
  423. package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  424. package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +2 -2
  425. package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
  426. package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +2 -2
  427. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +2 -2
  428. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +2 -2
  429. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +1 -1
  430. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  431. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +2 -2
  432. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  433. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +2 -2
  434. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  435. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  436. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +2 -2
  437. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  438. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +2 -2
  439. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  440. package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  441. package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +2 -2
  442. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  443. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +2 -2
  444. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  445. package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
  446. package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +2 -2
  447. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +2 -2
  448. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +2 -2
  449. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +1 -1
  450. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  451. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +2 -2
  452. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  453. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +2 -2
  454. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  455. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  456. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +2 -2
  457. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  458. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +2 -2
  459. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  460. package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  461. package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +2 -2
  462. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  463. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +2 -2
  464. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  465. package/cli/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
  466. package/cli/app/.next-cli-build/server/app/dashboard/playground.rsc +2 -2
  467. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +2 -2
  468. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +2 -2
  469. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +1 -1
  470. package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  471. package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +2 -2
  472. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  473. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +2 -2
  474. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  475. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  476. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +2 -2
  477. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  478. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +2 -2
  479. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  480. package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  481. package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +2 -2
  482. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  483. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +2 -2
  484. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  485. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  486. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +2 -2
  487. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  488. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +2 -2
  489. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  490. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  491. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +2 -2
  492. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  493. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +2 -2
  494. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  495. package/cli/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  496. package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +3 -3
  497. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  498. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +3 -3
  499. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  500. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  501. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +2 -2
  502. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
  503. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +2 -2
  504. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  505. package/cli/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  506. package/cli/app/.next-cli-build/server/app/dashboard/skills.rsc +2 -2
  507. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  508. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +2 -2
  509. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  510. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  511. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.rsc +2 -2
  512. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  513. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +2 -2
  514. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  515. package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  516. package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +2 -2
  517. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  518. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +2 -2
  519. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  520. package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  521. package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +2 -2
  522. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  523. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +2 -2
  524. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  525. package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
  526. package/cli/app/.next-cli-build/server/app/dashboard.rsc +2 -2
  527. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  528. package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +2 -2
  529. package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  530. package/cli/app/.next-cli-build/server/app/index.html +1 -1
  531. package/cli/app/.next-cli-build/server/app/index.rsc +2 -2
  532. package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  533. package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +2 -2
  534. package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  535. package/cli/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  536. package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  537. package/cli/app/.next-cli-build/server/app/landing.html +1 -1
  538. package/cli/app/.next-cli-build/server/app/landing.rsc +2 -2
  539. package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +2 -2
  540. package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  541. package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  542. package/cli/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  543. package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  544. package/cli/app/.next-cli-build/server/app/login.html +1 -1
  545. package/cli/app/.next-cli-build/server/app/login.rsc +2 -2
  546. package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +2 -2
  547. package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  548. package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  549. package/cli/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  550. package/cli/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  551. package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  552. package/cli/app/.next-cli-build/server/app/provider-icons/[provider]/route.js.nft.json +1 -1
  553. package/cli/app/.next-cli-build/server/app/skills/[skill]/SKILL.md/route.js.nft.json +1 -1
  554. package/cli/app/.next-cli-build/server/app-paths-manifest.json +6 -6
  555. package/cli/app/.next-cli-build/server/chunks/1350.js +1 -1
  556. package/cli/app/.next-cli-build/server/chunks/1757.js +1 -1
  557. package/cli/app/.next-cli-build/server/chunks/3190.js +1 -1
  558. package/cli/app/.next-cli-build/server/chunks/3204.js +1 -1
  559. package/cli/app/.next-cli-build/server/chunks/4039.js +1 -1
  560. package/cli/app/.next-cli-build/server/chunks/4128.js +3 -0
  561. package/cli/app/.next-cli-build/server/chunks/4177.js +1 -0
  562. package/cli/app/.next-cli-build/server/chunks/4730.js +1 -1
  563. package/cli/app/.next-cli-build/server/chunks/4827.js +1 -0
  564. package/cli/app/.next-cli-build/server/chunks/5024.js +51 -1
  565. package/cli/app/.next-cli-build/server/chunks/5330.js +18 -18
  566. package/cli/app/.next-cli-build/server/chunks/5626.js +1 -1
  567. package/cli/app/.next-cli-build/server/chunks/5744.js +2 -0
  568. package/cli/app/.next-cli-build/server/chunks/5905.js +2 -2
  569. package/cli/app/.next-cli-build/server/chunks/7135.js +1 -1
  570. package/cli/app/.next-cli-build/server/chunks/7319.js +23 -23
  571. package/cli/app/.next-cli-build/server/chunks/8238.js +1 -1
  572. package/cli/app/.next-cli-build/server/chunks/9489.js +1 -0
  573. package/cli/app/.next-cli-build/server/chunks/9548.js +1 -1
  574. package/cli/app/.next-cli-build/server/chunks/9618.js +1 -1
  575. package/cli/app/.next-cli-build/server/chunks/9679.js +1 -1
  576. package/cli/app/.next-cli-build/server/chunks/9946.js +1 -0
  577. package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  578. package/cli/app/.next-cli-build/server/pages/404.html +1 -1
  579. package/cli/app/.next-cli-build/server/pages/500.html +1 -1
  580. package/cli/app/.next-cli-build/server/preview-props.json +3 -3
  581. package/cli/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  582. package/cli/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  583. package/cli/app/.next-cli-build/static/chunks/{620-3a2ccad7dbaba6da.js → 620-7835dd9c83c5b531.js} +1 -1
  584. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/{page-a0e271ee32723312.js → page-41baf67bacd12af7.js} +1 -1
  585. package/cli/app/CHANGELOG.md +16 -0
  586. package/cli/app/package.json +1 -1
  587. package/cli/package.json +1 -1
  588. package/package.json +1 -1
  589. package/cli/app/.next-cli-build/server/chunks/4754.js +0 -1
  590. package/cli/app/.next-cli-build/server/chunks/5308.js +0 -3
  591. package/cli/app/.next-cli-build/server/chunks/5580.js +0 -1
  592. package/cli/app/.next-cli-build/server/chunks/6382.js +0 -51
  593. package/cli/app/.next-cli-build/server/chunks/7793.js +0 -1
  594. package/cli/app/.next-cli-build/server/chunks/8795.js +0 -1
  595. /package/cli/app/.next-cli-build/static/{Osr-wd9QaMA1NymhYIOSl → 86qPSmidvodTOsnCM3oez}/_buildManifest.js +0 -0
  596. /package/cli/app/.next-cli-build/static/{Osr-wd9QaMA1NymhYIOSl → 86qPSmidvodTOsnCM3oez}/_ssgManifest.js +0 -0
@@ -0,0 +1,3 @@
1
+ "use strict";exports.id=4128,exports.ids=[4128],exports.modules={19225:(a,b,c)=>{a.exports=c(44870)},25308:(a,b,c)=>{c.d(b,{t8:()=>w,Vu:()=>y,Pr:()=>B,vt:()=>D,UP:()=>x});var d=c(12557),e=c(43659),f=c(24),g=c(47593),h=c(9024),i=c(4305);let j=new Set(["content_filter"]),k=new Set(["function_call","custom_tool_call"]);function l(a){return"string"==typeof a&&a.length>0}function m(a,b={sawContent:!1,finishReason:null}){let c=String(a||"").split("\n");for(let a of(b.pending=c.pop(),c)){let c=function(a){let b=(0,h.tV)(String(a||"").trimStart());if(!b||b.done)return{content:!1,finishReason:null};if("string"==typeof b.type&&!Array.isArray(b.choices))return b.type.startsWith("response.")?function(a){let b=!1,c=null;switch(a.type){case"response.output_text.delta":case"response.function_call_arguments.delta":case"response.custom_tool_call_input.delta":b=l(a.delta);break;case"response.output_text.done":b=l(a.text);break;case"response.output_item.added":case"response.output_item.done":b=k.has(a.item?.type);break;case"response.completed":c="stop";break;case"response.incomplete":{let b=a.response?.incomplete_details?.reason;c="content_filter"===b?"content_filter":"max_output_tokens"===b?"length":"incomplete";break}case"response.failed":c="failed"}return{content:b,finishReason:c}}(b):function(a){let b=!1,c=null;if("content_block_delta"===a.type){let c=a.delta||{};"text_delta"===c.type&&l(c.text)&&(b=!0),"input_json_delta"===c.type&&l(c.partial_json)&&(b=!0)}else if("content_block_start"===a.type){let c=a.content_block||{};"tool_use"===c.type&&(b=!0),"text"===c.type&&l(c.text)&&(b=!0)}else"message_delta"===a.type&&a.delta?.stop_reason&&(c=(0,i.Jm)(a.delta.stop_reason));return{content:b,finishReason:c}}(b);let c=!1,d=null;for(let a of b.choices||[])(function(a){if(!a||"object"!=typeof a)return!1;let b=a.content;return!!("string"==typeof b&&b.length>0||Array.isArray(b)&&b.length>0||Array.isArray(a.tool_calls)&&a.tool_calls.length>0)||"string"==typeof a.output_text&&!!(a.output_text.length>0)})(a.delta||a.message||{})&&(c=!0),a.finish_reason&&(d=a.finish_reason);return{content:c,finishReason:d}}(a);c.content&&(b.sawContent=!0),c.finishReason&&(b.finishReason=c.finishReason)}return b}function n(a){return!!a&&j.has(String(a).toLowerCase())}async function o(a,{deadlineMs:b=45e3}={}){let c=a.getReader(),d=new TextDecoder,e=[],f={sawContent:!1,finishReason:null},g="",h=Number.isFinite(b)&&b>0?b:45e3,i=null,j=new Promise(a=>{i=setTimeout(()=>a("__deadline__"),h)}),k=a=>(i&&clearTimeout(i),a),l=null;for(;;){let a;l||(l=c.read());try{a=await Promise.race([l,j])}catch(a){return l=null,k({outcome:f.sawContent?"content":"empty",timedOut:!1,head:e,reader:c,pendingRead:null,finishReason:f.finishReason,error:a})}if("__deadline__"===a)return k({outcome:"content",timedOut:!0,head:e,reader:c,pendingRead:l,finishReason:f.finishReason});l=null;let{done:b,value:h}=a;if(b)return g&&m(`${g}
2
+ `,f),k({outcome:f.sawContent?"content":"empty",timedOut:!1,head:e,reader:c,pendingRead:null,finishReason:f.finishReason});if(e.push(h),m(g+=d.decode(h,{stream:!0}),f),g=f.pending,f.sawContent)return k({outcome:"content",timedOut:!1,head:e,reader:c,pendingRead:null,finishReason:f.finishReason})}}var p=c(57874);let q=new Set(["vision","pdf","audioInput","videoInput"]),r="[Called tools: ",s="[Tool result: ";function t(a){return a.filter(Boolean).map(a=>{if("tool"===a.role||"function"===a.role)return{role:"assistant",content:`${s}${(0,g.kU)(a.content)||String(a.content??"")}]`};if("assistant"===a.role&&Array.isArray(a.tool_calls)){let{tool_calls:b,...c}=a,d=b.map(a=>a?.function?.name||a?.name||"tool").join(", "),e=(0,g.kU)(c.content)||("string"==typeof c.content?c.content:"");return{...c,content:`${e}${e?"\n":""}${r}${d}]`}}if(Array.isArray(a.content)&&a.content.some(a=>a?.type==="tool_use"||a?.type==="tool_result")){let b=[],c=[],d=[];for(let e of a.content)e?.type==="text"&&e.text&&b.push(e.text),e?.type==="tool_use"&&c.push(e.name||"tool"),e?.type==="tool_result"&&d.push((0,g.kU)(e.content)||String(e.content??""));let e=b.join("\n");return c.length>0&&(e=`${e}${e?"\n":""}${r}${c.join(", ")}]`),d.length>0&&(e=`${e}${e?"\n":""}${s}${d.join("\n")}]`),{...a,content:e}}return a})}let u=new Map;function v(a){if(!Array.isArray(a)||0===a.length)return[];let b=a.length-1;for(;b>=0&&a[b]?.role!=="assistant"&&a[b]?.role!=="model";)b--;return a.slice(b+1)}function w(a){let b=new Set;if(!a||"object"!=typeof a)return b;let c=a=>{if(!a||"object"!=typeof a)return;["image_url","image","input_image"].includes(a.type)&&b.add("vision"),["file","document","input_file"].includes(a.type)&&b.add("pdf"),["input_audio","audio","audio_url"].includes(a.type)&&b.add("audioInput"),["input_video","video","video_url"].includes(a.type)&&b.add("videoInput");let c=a.inlineData?.mimeType||a.inlineData?.mime_type||a.fileData?.mimeType||a.fileData?.mime_type;"string"==typeof c&&c.startsWith("image/")&&b.add("vision"),"application/pdf"===c&&b.add("pdf"),"string"==typeof c&&c.startsWith("audio/")&&b.add("audioInput"),"string"==typeof c&&c.startsWith("video/")&&b.add("videoInput")},d=a=>{Array.isArray(a)&&a.forEach(c)};return v(a.messages).forEach(a=>{if(!a||"object"!=typeof a)return;Array.isArray(a.images)&&a.images.length>0&&b.add("vision");let c=Array.isArray(a.experimental_attachments)?a.experimental_attachments:a.attachments;if(Array.isArray(c))for(let a of c){if(!a||"object"!=typeof a)continue;let c=a.contentType||a.mediaType||"string"==typeof a.url&&a.url.match(/^data:([^;,]+)/)?.[1];"string"==typeof c&&c.startsWith("image/")?b.add("vision"):"application/pdf"===c?b.add("pdf"):"string"==typeof c&&c.startsWith("audio/")?b.add("audioInput"):"string"==typeof c&&c.startsWith("video/")?b.add("videoInput"):!c&&(a.url||a.data)&&b.add("vision")}(a.image_url||a.image)&&b.add("vision"),(a.audio_url||a.audio)&&b.add("audioInput"),d(a.content),"string"==typeof a.content&&(a.content.includes("data:image/")?b.add("vision"):a.content.includes("data:audio/")?b.add("audioInput"):a.content.includes("data:application/pdf")&&b.add("pdf"))}),v(a.input).forEach(a=>d(a?.content)),v(a.contents||a.request?.contents).forEach(a=>d(a?.parts)),Array.isArray(a.tools)&&a.tools.some(a=>{let b=String(a?.type||"").toLowerCase(),c=String(a?.name||a?.function?.name||"").toLowerCase();return b.includes("web_search")||c.includes("web_search")||c.includes("search_web")})&&b.add("search"),b}function x(a){a?u.delete(a):u.clear()}function y(a,b){if(a.includes("/"))return null;let c=(Array.isArray(b)?b:b?.combos||[]).find(b=>b.name===a);return c&&c.models&&c.models.length>0?c.models:null}async function z(a){let b=String(a.headers?.get?.("content-type")||"").toLowerCase();if(!a.body||!b.includes("text/event-stream"))return null;let c=await o(a.body,{deadlineMs:45e3});return{outcome:c.outcome,finishReason:c.finishReason,timedOut:c.timedOut,response:new Response(function(a,b,c=null){let d=c;return new ReadableStream({start(b){for(let c of a)b.enqueue(c)},async pull(a){let c=d?await d:await b.read();(d=null,c.done)?a.close():a.enqueue(c.value)},cancel(a){try{b.cancel(a)}catch{}}})}(c.head,c.reader,c.pendingRead),{status:a.status,statusText:a.statusText,headers:a.headers})}}async function A({body:a,models:b,log:c,comboName:d,sessionId:e,smartPolicy:f,sessionSticky:g,confidenceThreshold:h,resolveSmartChoice:i}){let j=("string"==typeof f?f:"smart").toLowerCase(),k="per-turn"===j||!1===g,l="strict"===j,m=function(a,b){if("custom"===a||"smart"===a||a.startsWith("smart-switch")){let c=Number(b);if("smart-switch-70"===a)return .7;if("smart-switch-90"===a)return .9;if(Number.isFinite(c)&&c>0)return c}return .8}(j,h),n=!k&&e?(0,p.hp)(d,e,b):null;if(n&&(l||"function"!=typeof i))return c?.info?.("COMBO",`smart-router kept session model ${n}`),[n,...b.filter(a=>a!==n)];if("function"!=typeof i)return b;try{let f=await i(a,b),g=f?.choice,h="number"==typeof f?.confidence?f.confidence:null;if(!(g&&b.includes(g)&&(null===h||h>=m)))return c?.info?.("COMBO","smart-router made no switch, keeping combo order"),n?[n,...b.filter(a=>a!==n)]:b;if(n&&g===n)return[n,...b.filter(a=>a!==n)];return!k&&e&&(0,p.V9)(d,e,g),c?.info?.("COMBO",`smart-router selected ${g}`),(0,p.DW)(b,f)}catch(a){return c?.warn?.("COMBO","smart-router failed open",{error:a?.message||String(a)}),n?[n,...b.filter(a=>a!==n)]:b}}async function B({body:a,models:b,handleSingleModel:c,log:g,comboName:h,comboStrategy:i,comboStickyLimit:j=1,autoSwitch:k=!0,sessionId:l=null,smartPolicy:m="smart",sessionSticky:o=!0,confidenceThreshold:p=.8,resolveSmartChoice:r=null}){let s="smart"===i?await A({body:a,models:b,log:g,comboName:h,sessionId:l,smartPolicy:m,sessionSticky:o,confidenceThreshold:p,resolveSmartChoice:r}):function(a,b,c,d=1){let e;if(!a||a.length<=1||"round-robin"!==c)return a;let f=b||"__default__",g=Number.isFinite(e=Number.parseInt(d,10))&&e>0?e:1,h=u.get(f),i="number"==typeof h?{index:h,consecutiveUseCount:0}:h||{index:0,consecutiveUseCount:0},j=i.index%a.length,k=function(a,b){let c=[...a];for(let a=0;a<b;a++){let a=c.shift();c.push(a)}return c}(a,j),l=i.consecutiveUseCount+1;return l>=g?u.set(f,{index:(j+1)%a.length,consecutiveUseCount:0}):u.set(f,{index:j,consecutiveUseCount:l}),k}(b,h,i,j);if(k){let b=w(a);if(b.size>0){let a=function(a,b){if(!b||0===b.size||!Array.isArray(a)||a.length<=1)return a;let c=[...b].filter(a=>q.has(a)),d=[...b].filter(a=>!q.has(a)),e=a.map((a,b)=>{let e,g,h,i;return{model:a,index:b,tier:(g=(e="string"==typeof a?a.indexOf("/"):-1)>0?a.slice(0,e):"",h=e>0?a.slice(e+1):a,i=(0,f.nl)(g,h),c.every(a=>!0===i[a])?+!d.every(a=>!0===i[a]):2)}}).sort((a,b)=>a.tier-b.tier||a.index-b.index);return e.every((a,b)=>a.index===b)?a:e.map(a=>a.model)}(s,b);a[0]!==s[0]&&g.info("COMBO",`Auto-switch for [${[...b].join(", ")}] -> ${a[0]}`),s=a}}let t=null,v=null,x=null,y=null;for(let b=0;b<s.length;b++){let e=s[b];g.info("COMBO",`Trying model ${b+1}/${s.length}: ${e}`);try{let f=await c(a,e);if(f.ok){let a=null;try{a=await z(f)}catch(a){return g.warn("COMBO",`empty-peek error on ${e}, returning empty SSE: ${a?.message||a}`),new Response("data: [DONE]\n\n",{status:200,headers:{"Content-Type":"text/event-stream"}})}if(!a){if(b!==s.length-1&&(f.headers?.get?.("content-type")||"").includes("application/json"))try{let a=await f.clone().json();if(function(a){if(!a||"object"!=typeof a)return!1;if(Array.isArray(a.choices)){if(0===a.choices.length)return!0;let b=a.choices[0];if(!b)return!0;let c=b.message||b.delta,d=c?.content,e="string"==typeof d?d.trim().length>0:Array.isArray(d)&&d.length>0,f=Array.isArray(c?.tool_calls)&&c.tool_calls.length>0||!!c?.function_call,g="string"==typeof c?.reasoning_content&&c.reasoning_content.trim().length>0,h=b.finish_reason;if(!e&&!f&&!g&&("stop"!==h&&"length"!==h&&"tool_calls"!==h&&"function_call"!==h||"in_progress"===h||"incomplete"===h))return!0}if(Array.isArray(a.content)){let b=a.content.some(a=>"text"===a.type&&a.text?.trim().length>0||"tool_use"===a.type),c=a.stop_reason;if(!b&&(!c||"in_progress"===c||"incomplete"===c))return!0}return!1}(a)){g.warn("COMBO",`Model ${e} returned HTTP 200 with zero usable content, falling back to next model`),t="Zero usable content",x=200;continue}}catch{}return g.info("COMBO",`Model ${e} succeeded`),f}if("content"===a.outcome)return g.info("COMBO",`Model ${e} succeeded${a.timedOut?" (peek deadline; committed)":""}`),a.response;let c=a.finishReason||"no-content",d=b===s.length-1;if(n(a.finishReason)||d)return g.warn("COMBO",`Model ${e} returned empty (${c}) — ${n(a.finishReason)?"no-retry class":"last candidate"}, returning as-is`),a.response;g.warn("COMBO",`Model ${e} returned empty (${c}) — falling through to next candidate`),a.response.body?.cancel?.().catch(()=>{}),t=`empty generation (${c})`,x||(x=502);continue}let h=f.statusText||"",i=null;try{let a=await f.clone().json();h=a?.error?.message||a?.error||a?.message||h,i=a?.retryAfter||null}catch{}if(i&&(!v||new Date(i)<new Date(v))&&(v=i),"string"!=typeof h)try{h=JSON.stringify(h)}catch{h=String(h)}let{shouldFallback:j,requestScoped:k}=(0,d.hk)(f.status,h);if(!j&&!k)return g.warn("COMBO",`Model ${e} failed (no fallback)`,{status:f.status}),f;if(k){g.warn("COMBO",`Model ${e} rejected the request (${f.status}), trying next`,{status:f.status}),t=h||String(f.status),x||(x=f.status),y||(y=f);continue}t=h||String(f.status),x=f.status,g.warn("COMBO",`Model ${e} failed, trying next`,{status:f.status})}catch(a){t=a.message||String(a),x=500,g.warn("COMBO",`Model ${e} threw error, trying next`,{error:t})}}if(y)return g.warn("COMBO",`No model served the request; returning the first request-scoped failure (${y.status})`),y;let C=t&&t.toLowerCase().includes("no credentials")?503:x||503,D=t||"All combo models unavailable";if(v){let a=(0,d.Qo)(v);return g.warn("COMBO",`All models failed | ${D} (${a})`),(0,e.wO)(C,D,v,a)}return g.warn("COMBO",`All models failed | ${D}`),new Response(JSON.stringify({error:{message:D}}),{status:C,headers:{"Content-Type":"application/json"}})}let C={minPanel:2,stragglerGraceMs:8e3,panelHardTimeoutMs:9e4};async function D({body:a,models:b,handleSingleModel:c,log:d,comboName:e,judgeModel:f,tuning:h}){var i;let j,k,l=Array.isArray(b)?b.filter(Boolean):[];if(0===l.length)return new Response(JSON.stringify({error:{message:"Fusion combo has no models"}}),{status:400,headers:{"Content-Type":"application/json"}});if(1===l.length)return c(a,l[0]);let m={...C,...h||{}},n=Math.min(Math.max(2,Number(m.minPanel)||2),l.length),o="string"==typeof f&&f.trim()?f.trim():l[0];d.info("FUSION",`Combo "${e||"unnamed"}" | panel=${l.length} | judge=${o} | quorum=${n}`);let{tools:p,tool_choice:q,stream_options:r,...s}=a,u={...s,stream:!1};Array.isArray(u.messages)&&(u.messages=t(u.messages)),Array.isArray(u.input)&&(u.input=t(u.input));let v=Date.now(),w=l.map(a=>{var b,d;return b=c(u,a,!0),d=m.panelHardTimeoutMs,new Promise(a=>{let c=setTimeout(()=>a({__timeout:!0}),d);Promise.resolve(b).then(b=>{clearTimeout(c),a(b)}).catch(b=>{clearTimeout(c),a({__error:b})})})}),x=await function(a,{minPanel:b,stragglerGraceMs:c,panelHardTimeoutMs:d}){return new Promise(e=>{let f=Array(a.length),g=0,h=0,i=!1,j=null,k=()=>{i||(i=!0,clearTimeout(l),j&&clearTimeout(j),e(f))},l=setTimeout(k,d);a.forEach((d,e)=>{Promise.resolve(d).then(a=>{f[e]=a}).catch(a=>{f[e]={__error:a}}).finally(()=>{if(g++,f[e]?.ok&&h++,g===a.length)return k();h>=b&&!j&&(j=setTimeout(k,c))})})})}(w,{...m,minPanel:n});d.info("FUSION",`Panel collected in ${Date.now()-v}ms`);let y=[];for(let a=0;a<x.length;a++){let b=x[a],c=l[a];if(!b){d.warn("FUSION",`Panel ${c} dropped (straggler/timeout)`);continue}if(b.__timeout){d.warn("FUSION",`Panel ${c} timed out`);continue}if(b.__error){d.warn("FUSION",`Panel ${c} threw`,{error:b.__error?.message||String(b.__error)});continue}if(!b.ok){d.warn("FUSION",`Panel ${c} failed`,{status:b.status});continue}try{let a=await b.clone().json(),e=function(a){if(!a||"object"!=typeof a)return"";let b=a.choices?.[0];if(b){let a=b.message??b.delta??{},c=(0,g.kU)(a.content);if(c.trim())return c;if("string"==typeof b.text&&b.text.trim())return b.text}let c=(0,g.kU)(a.content);if(c.trim())return c;let d=a.candidates?.[0]?.content?.parts;if(Array.isArray(d)){let a=d.map(a=>a?.text||"").join("");if(a.trim())return a}if(Array.isArray(a.output)){let b=a.output.flatMap(a=>Array.isArray(a.content)?a.content.map(a=>a?.text||""):[]).join("");if(b.trim())return b}return""}(a);e?y.push({model:c,text:e}):d.warn("FUSION",`Panel ${c} returned empty content`)}catch(a){d.warn("FUSION",`Panel ${c} returned an unreadable response`,{error:a.message||String(a)})}}if(0===y.length)return new Response(JSON.stringify({error:{message:"All fusion panel models failed"}}),{status:503,headers:{"Content-Type":"application/json"}});if(1===y.length)return c(a,y[0].model);let z=(j=y.map((a,b)=>`[Source ${b+1}]
3
+ ${a.text}`).join("\n\n"),i=[`You are the judge in a model-fusion panel. ${y.length} expert models independently answered the user's most recent request.`,"\nDo not mention the panel or sources. Produce one authoritative final answer addressed directly to the user.\n\nInternally compare consensus, contradictions, partial coverage, unique insights, and blind spots. Resolve conflicts with your own judgment, then write the most complete and correct answer without filler.\n\n=== PANEL RESPONSES ===",j,"=== END PANEL RESPONSES ===\n\nNow answer the user's original request."].join("\n"),k={...a},Array.isArray(a.messages)?k.messages=[...a.messages,{role:"user",content:i}]:Array.isArray(a.input)?k.input=[...a.input,{role:"user",content:i}]:Array.isArray(a.contents)?k.contents=[...a.contents,{role:"user",parts:[{text:i}]}]:Array.isArray(a.request?.contents)?k.request={...a.request,contents:[...a.request.contents,{role:"user",parts:[{text:i}]}]}:k.messages=[{role:"user",content:i}],k);return d.info("FUSION",`Judging ${y.length} answers with ${o}`),c(z,o)}},26305:(a,b,c)=>{c.d(b,{Lf:()=>j,ni:()=>k,p$:()=>h});var d=c(19548),e=c(36672);let f=/^(gemini-4-argon|claude-opus-5-5|claude-sonnet-5-5)(-|$)/;function g(a){return(0,e.kD)(String(a||"").trim()).replace(/^(ag|antigravity)\//,"")}function h(a){return f.test(g(a))}function i(a){return Object.keys(a?.usage?.quotas||{})}function j(a,b=[],c=[]){let h,k,l=g(a);if(!f.test(l))return{premium:!1,eligibleIds:null,sources:new Map};let m=(h=d.vq.ag?.find(a=>a.id===l),(k=h?.upstreamModelId?(0,e.kD)(h.upstreamModelId):null)&&k!==l?[l,k]:[l]),n=new Map((c||[]).filter(Boolean).map(a=>[a.connectionId,a])),o=[...n.values()].some(a=>i(a).some(a=>m.includes(a))),p=new Set,q=new Map;for(let a of b){let b=i(n.get(a.id)),c=null;o&&b.length>0?b.some(a=>m.includes(a))&&(c="quota"):a?.providerSpecificData?.paidSubscription===!0&&(c="flag"),q.set(a.id,c),c&&p.add(a.id)}return{premium:!0,eligibleIds:p,sources:q,modelId:l}}function k(a){return`ag/${g(a)} needs a paid Antigravity subscription and no active account is eligible. Turn on "Paid" for a subscribed account in Providers > Antigravity.`}},29240:(a,b,c)=>{c.d(b,{Dw:()=>m,GJ:()=>l,Ip:()=>k,MZ:()=>h,RV:()=>j,bo:()=>i});var d=c(17404);function e(a){let b="string"==typeof a?a.trim():"";return b.startsWith("models/")?b.slice(7):b}function f(a){let b=e(a).toLowerCase(),c=new Set([b]),f=b.indexOf("/");if(f>0){let a=b.slice(0,f),e=b.slice(f+1),g=(0,d.rs)(a),h=(0,d.wG)(g);g&&c.add(`${String(g).toLowerCase()}/${e}`),h&&c.add(`${String(h).toLowerCase()}/${e}`)}return[...c]}function g(a,b){let c=String(b||"").trim().toLowerCase();if(!c.includes("*"))return!1;if("*"===c)return!0;let d=c.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return RegExp(`^${d}$`,"i").test(String(a||"").trim().toLowerCase())}function h(a){let b=a?.headers?.get?.("Authorization");return b?.startsWith("Bearer ")?b.slice(7):a?.headers?.get?.("x-api-key")||null}function i(a,b){if(!b)return!0;if(!0!==b.active)return!1;let c=Array.isArray(b.allowedCombos)?b.allowedCombos:[];if(0===c.length)return!0;let d=e(a);return c.some(a=>e(a)===d)}function j(a,b,c=null){let d=Array.isArray(c);if(!b)return{allowed:!0,kind:d?"combo":"model"};if(!0!==b.active)return{allowed:!1,kind:"inactive"};if(d){if(!i(a,b))return{allowed:!1,kind:"combo"};let d=c.find(a=>!l("string"==typeof a?a:"",b));return d?{allowed:!1,kind:"model",model:"string"==typeof d?d:""}:{allowed:!0,kind:"combo"}}return l(a,b)?{allowed:!0,kind:"model"}:{allowed:!1,kind:"model"}}function k(a,b){if(b?.kind==="combo")return`Combo ${a} is not allowed for this API key`;let c=b?.model||a;return`Model ${c} is not allowed for this API key`}function l(a,b){let c;if(!b)return!0;if(!0!==b.active)return!1;let h=Array.isArray(b.allowedModels)?b.allowedModels:[];if(0===h.length)return!0;let{deny:i,allow:j}=function(a){let b=[],c=[];for(let d of a){let a=String(d??"").trim();(a.startsWith("!")||a.startsWith("-"))&&a.length>1?b.push(a.slice(1).toLowerCase()):a&&c.push(a)}return{deny:b,allow:c}}(h);return c=f(a),!i.some(a=>c.some(b=>{if(g(b,a))return!0;let c=b.includes("/")?b.split("/").slice(1).join("/"):b;return b.includes(a)||c.includes(a)}))&&(0===j.length||j.some(b=>(function(a,b){let c=f(a);if(c.some(a=>a===e(b).toLowerCase())||c.some(a=>g(a,b)))return!0;let h=/^([^/*]+)\/\*$/.exec(String(b||"").trim().toLowerCase());if(!h)return!1;let i=String((0,d.rs)(h[1])||"").toLowerCase();return!!i&&c.some(a=>a.startsWith(`${i}/`))})(a,b)))}function m(a,b,c=new Map){if(!b)return[...a];let d=new Set(Array.isArray(b.allowedConnectionIds)?b.allowedConnectionIds:[]);return a.filter(a=>!!l(a?.id,b)&&(0===d.size||(c.get(e(a?.id))||c.get(a?.id)||[]).some(a=>d.has(a))))}},45974:(a,b,c)=>{c.d(b,{FN:()=>n,VZ:()=>o,XJ:()=>s,vO:()=>p});var d=c(39326),e=c(89026),f=c(7803);let g=new Map,h=new Map,i=new Map,j=new Map,k=new Map;function l(a){if(!a||"string"!=typeof a)return null;let b=(a.includes("/")?a.slice(a.indexOf("/")+1):a).toLowerCase();return b.startsWith("claude-")||b.startsWith("gpt-")||"claude"===b?"claude_gpt":b.startsWith("gemini-")&&!b.includes("image")||"gemini"===b?"gemini":null}function m(a,b){if(!a||"object"!=typeof a||!b)return null;let c="string"==typeof b?(b.includes("/")?b.slice(b.indexOf("/")+1):b).replace(/\([^()]+\)\s*$/,"").trim():"",d=l(c),e=[];if(a[c]&&e.push(a[c]),"claude-sonnet-5-5"===c&&a["claude-sonnet-5-5-high"]&&e.push(a["claude-sonnet-5-5-high"]),"claude-opus-5-5"===c&&a["claude-opus-5-5-high"]&&e.push(a["claude-opus-5-5-high"]),"gemini-3.8-flash"===c&&a["gemini-3.8-flash-medium"]&&e.push(a["gemini-3.8-flash-medium"]),"claude_gpt"===d?(a.claude_gpt_session&&e.push(a.claude_gpt_session),a.claude_gpt_weekly&&e.push(a.claude_gpt_weekly)):"gemini"===d&&(a.gemini_session&&e.push(a.gemini_session),a.gemini_weekly&&e.push(a.gemini_weekly)),0===e.length)return null;let f=Date.now(),g=[];for(let a of e)if(a&&"number"==typeof a.remainingPercentage&&!(a.remainingPercentage>0))if(a.resetAt){let b=new Date(a.resetAt).getTime();b>f&&g.push({...a,resetMs:b})}else g.push({...a,resetMs:0});if(g.length>0){g.sort((a,b)=>b.resetMs-a.resetMs);let a=g[0];return{used:a.used,total:a.total,remainingPercentage:0,resetAt:a.resetAt,displayName:a.displayName||c}}let h=e.filter(a=>a&&"number"==typeof a.remainingPercentage);return 0===h.length?null:(h.sort((a,b)=>a.remainingPercentage-b.remainingPercentage),h[0])}function n(a,b,c=Date.now()){if(!a||!b)return null;let d=g.get(a),e=m(d,b)||d?.[b];if(!e||"number"!=typeof e.remainingPercentage||e.remainingPercentage>0||!e.resetAt)return null;let f=new Date(e.resetAt).getTime();return!Number.isFinite(f)||f<=c?null:e.resetAt}function o(a,b,c=Date.now()){return null!==n(a,b,c)}function p(a,b){if(!a||!b)return;let c=`${a}|${b}`;j.delete(c);let d=k.get(c);if(void 0===d)return;k.delete(c);let e=g.get(a),f=new Date(d).toISOString();e?.[b]?.resetAt===f&&delete e[b];let h=l(b);"claude_gpt"===h&&e?.claude_gpt_session?.resetAt===f?delete e.claude_gpt_session:"gemini"===h&&e?.gemini_session?.resetAt===f&&delete e.gemini_session,e&&g.set(a,e)}async function q(a,b,c){let d=Date.now(),e=i.get(a);if(e)return e;if(d-(h.get(a)||0)<3e4)return g.get(a)||null;h.set(a,d);let f=r(a,b,c);i.set(a,f);try{return await f}finally{i.delete(a)}}async function r(a,b,c){try{let f=await (0,d.B)(c||{}),h=await (0,e.my)({provider:"antigravity",accessToken:b,providerSpecificData:c||{},projectId:c?.projectId},{connectionProxyEnabled:!0===f.connectionProxyEnabled,connectionProxyUrl:f.connectionProxyUrl||"",connectionNoProxy:f.connectionNoProxy||"",vercelRelayUrl:f.vercelRelayUrl||"",strictProxy:!0===f.strictProxy});if(!h?.quotas||h.message)return null;return g.set(a,function(a,b){let c=Date.now();for(let[d,e]of k)if(d.startsWith(`${a}|`)){if(e<=c){k.delete(d);continue}b[d.slice(a.length+1)]={remainingPercentage:0,resetAt:new Date(e).toISOString()}}return b}(a,{...h.quotas})),g.get(a)}catch(b){return f.warn("AG_QUOTA",`${String(a).slice(0,8)} | refresh failed: ${b?.message||b}`),null}}async function s(a,b,c,d,e){if(!a||!c)return null;f.info("AG_QUOTA",`${String(a).slice(0,8)} | ${b} on ${c} — refreshing quota`);let h=m(await q(a,d,e),c);if(!h||h.remainingPercentage>0){let d=`${a}|${c}`,e=Date.now(),h=j.get(d),i=h&&e-h.windowStart<=6e4?h.windowStart:e,l=h&&i===h.windowStart?h.count+1:1;if(j.set(d,{count:l,windowStart:i}),l>=3){j.delete(d);let h=e+9e5,i=g.get(a)||{};return i[c]={remainingPercentage:0,resetAt:new Date(h).toISOString()},g.set(a,i),k.set(d,h),f.warn("AG_QUOTA",`${String(a).slice(0,8)} | STRIKE_${b} ${c} — CACHE_BLOCK 15m`),h}return null}if(j.delete(`${a}|${c}`),!h.resetAt)return null;let i=new Date(h.resetAt).getTime();if(!Number.isFinite(i)||i<=Date.now())return null;let l=g.get(a)||{};return l[c]={remainingPercentage:0,resetAt:h.resetAt},g.set(a,l),f.warn("AG_QUOTA",`${String(a).slice(0,8)} | UPSTREAM_${b} ${c} — CACHE_BLOCK until ${h.resetAt}`),i}},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()}},57874:(a,b,c)=>{c.d(b,{DW:()=>k,JE:()=>i,Kn:()=>j,UH:()=>d,V9:()=>m,hp:()=>l,nn:()=>g,rc:()=>e});let d="oc/jev-1.13-free",e=8e3,f=new Map;function g(a,b=2e3){if(!a||"object"!=typeof a)return"";let c=Array.isArray(a.messages)?a.messages:Array.isArray(a.input)?a.input:null;if(c&&c.length>0){for(let a=c.length-1;a>=0;a--){let d=c[a];if(d?.role==="user"||d?.type==="message"||!d?.role&&d?.content){let a=h(d.content??d.text);if(a&&a.trim().length>0)return a.trim().slice(0,b)}}let a=c[c.length-1],d=h(a?.content??a?.text);if(d)return d.trim().slice(0,b)}return"string"==typeof a.prompt&&a.prompt.trim()?a.prompt.trim().slice(0,b):"string"==typeof a.input&&a.input.trim()?a.input.trim().slice(0,b):""}function h(a){return"string"==typeof a?a:Array.isArray(a)?a.map(a=>"string"==typeof a?a:a?.type==="text"&&"string"==typeof a.text?a.text:"").filter(Boolean).join(" "):""}function i(a){let b={};if(!Array.isArray(a))return b;for(let c of a)"string"==typeof c&&c.trim().length>0&&(b[c.trim()]=null);return b}function j(a){if(!a||"object"!=typeof a)return null;let b=a.answers?.route;if(!b||"object"!=typeof b)return null;let c="string"==typeof b.choice?b.choice.trim():"";if(!c)return null;let d="number"==typeof b.confidence&&Number.isFinite(b.confidence)?b.confidence:null,e=null;if(b.probabilities&&"object"==typeof b.probabilities&&!Array.isArray(b.probabilities))for(let[a,c]of(e={},Object.entries(b.probabilities))){let b="number"==typeof c?c:Number(c);Number.isFinite(b)&&(e[a]=b)}return{choice:c,confidence:d,probabilities:e}}function k(a,b){if(!Array.isArray(a)||a.length<=1)return a||[];if(!b?.choice||!a.includes(b.choice))return[...a];let{choice:c,probabilities:d}=b,e=a.filter(a=>a!==c);return d&&"object"==typeof d&&e.sort((a,b)=>{let c=d[a]??0;return(d[b]??0)-c}),[c,...e]}function l(a,b,c){if(!b||!a||!Array.isArray(c))return null;let d=`${a}:${b}`,e=f.get(d);return e?Date.now()-e.lastUsed>72e5||!c.includes(e.model)?(f.delete(d),null):(e.lastUsed=Date.now(),e.model):null}function m(a,b,c){if(!b||!a||!c)return;!function(){if(f.size<5e3)return;let a=Date.now();for(let[b,c]of f.entries())a-c.lastUsed>72e5&&f.delete(b);if(f.size>=5e3)for(let[a]of[...f.entries()].sort((a,b)=>a[1].lastUsed-b[1].lastUsed).slice(0,1250))f.delete(a)}();let d=`${a}:${b}`;f.set(d,{model:c,lastUsed:Date.now()})}},79761:(a,b,c)=>{c.d(b,{BU:()=>l,hb:()=>k,tH:()=>j});var d=c(40669),e=c(35989),f=c(75434);let g=new Set(["account","provider","egress","integrity"]);function h(a,b="unknown",c=160){return String(a||"").trim().toLowerCase().replace(/[^a-z0-9._:-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,c)||b}function i(a={}){let b=g.has(a.scope)?a.scope:null;if(!b)return null;let c=h((0,d.g2)(h(a.provider)),"unknown-provider",80),f=h(a.accountId||a.connectionId,"unknown-account"),j=h(a.egressId,"direct"),k=(0,e.Nm)(a.modelFamily||a.model);return Object.freeze("account"===b?{scope:b,provider:c,accountId:f}:"provider"===b?{scope:b,provider:c}:"egress"===b?{scope:b,egressId:j}:{scope:b,provider:c,modelFamily:k,egressId:j})}let j=function(a={}){let b="function"==typeof a.now?a.now:Date.now,c="function"==typeof a.onTransition?a.onTransition:()=>{},e=new Map,f=0;function g(a,b,d){c(Object.freeze({type:"circuit",provider:a.dimensions.provider,phase:b,reason:a.dimensions.scope,deadlineMs:a.openUntilMs?Math.max(0,a.openUntilMs-d):0,...a.dimensions.modelFamily?{modelFamily:a.dimensions.modelFamily}:{}}))}function j(a){for(let[b,c]of e)c.failures=c.failures.filter(b=>a-b.atMs<=6e4),"closed"===c.mode&&0===c.failures.length&&a-c.lastTouchedAtMs>18e5&&e.delete(b);let b=[...e.entries()].filter(([,a])=>"closed"===a.mode).sort((a,b)=>a[1].lastTouchedAtMs-b[1].lastTouchedAtMs);for(;b.length>2048;)e.delete(b.shift()[0])}function k(a,c=!1){let d=i(a);if(!d)return null;let f=Object.values(d).join("\x1f"),g=e.get(f);return!g&&c&&(g={dimensions:d,mode:"closed",failures:[],openDurationMs:3e4,openUntilMs:null,probeLeaseId:null,probeSuccesses:0,lastTouchedAtMs:b()},e.set(f,g)),g}function l(a,b){a?.mode==="open"&&b>=a.openUntilMs&&(a.mode="half_open",a.probeLeaseId=null,g(a,"half_open",b))}function m(a,b,c=a.openDurationMs){a.mode="open",a.openDurationMs=Math.min(3e5,Math.max(3e4,c)),a.openUntilMs=b+a.openDurationMs,a.probeLeaseId=null,a.probeSuccesses=0,a.lastTouchedAtMs=b,g(a,"open",b)}return Object.freeze({recordFailure:function(a={}){let c;if(!1===a.evidentiary)return!1;let e=b();j(e);let f=k(a,!0);return!!f&&(l(f,e),"closed"===f.mode)&&(f.failures=f.failures.filter(a=>e-a.atMs<=6e4),f.failures.push(Object.freeze({atMs:e,accountId:h(a.accountId||a.connectionId,"unknown-account"),provider:h((0,d.g2)(h(a.provider)),"unknown-provider",80)})),f.lastTouchedAtMs=e,c=f.failures.length,("integrity"===f.dimensions.scope?c>=1:!(c<5)&&("provider"===f.dimensions.scope?new Set(f.failures.map(a=>a.accountId)).size>=2:"egress"!==f.dimensions.scope||new Set(f.failures.map(a=>a.provider)).size>=2))&&m(f,e),!0)},recordSuccess:function(a={}){let c=b(),d=k(a);return!!d&&(l(d,c),"closed"===d.mode&&(d.failures=[],d.lastTouchedAtMs=c,!0))},getDecision:function(a){let c=b();j(c);let d=i(a),e=k(a);return e?(l(e,c),Object.freeze({...e.dimensions,state:e.mode,openUntilMs:e.openUntilMs,openDurationMs:e.openDurationMs,probeInFlight:!!e.probeLeaseId,consecutiveProbeSuccesses:e.probeSuccesses})):Object.freeze({...d||{scope:null},state:"closed",openUntilMs:null,openDurationMs:3e4,probeInFlight:!1,consecutiveProbeSuccesses:0})},tryAcquireProbe:function(a){let c=b(),d=k(a);return d?(l(d,c),"half_open"!==d.mode)?Object.freeze({acquired:!1,reason:"open"===d.mode?"circuit_open":"circuit_closed"}):d.probeLeaseId?Object.freeze({acquired:!1,reason:"probe_in_flight"}):(d.probeLeaseId=`probe-${c}-${++f}`,d.lastTouchedAtMs=c,Object.freeze({acquired:!0,leaseId:d.probeLeaseId})):Object.freeze({acquired:!1,reason:"circuit_closed"})},releaseProbe:function(a,c={}){let d=b(),e=k(a);if(!e||"half_open"!==e.mode||!e.probeLeaseId||c.leaseId!==e.probeLeaseId)return!1;if(e.probeLeaseId=null,e.lastTouchedAtMs=d,!0===c.cancelled)return!0;if(!0===c.success)return e.probeSuccesses+=1,e.probeSuccesses>=2&&(e.mode="closed",e.failures=[],e.openDurationMs=3e4,e.openUntilMs=null,e.probeLeaseId=null,e.probeSuccesses=0,e.lastTouchedAtMs=d,g(e,"closed",d)),!0;return m(e,d,Math.min(3e5,2*e.openDurationMs)),!0}})}({onTransition:f.cN}),k=j.recordFailure;j.recordSuccess,j.getDecision,j.tryAcquireProbe;let l=j.releaseProbe},88967:(a,b,c)=>{c.d(b,{Pt:()=>J,Tr:()=>e,c1:()=>D,kI:()=>f,uT:()=>C,vk:()=>I});var d=c(89718);function e(a){let b=a.headers.get("Authorization");if(b?.startsWith("Bearer "))return b.slice(7);let c=a.headers.get("x-api-key");return c||null}async function f(a){return!!a&&await (0,d.ek)(a)}var g=c(39326),h=c(12557),i=c(29679),j=c(91254),k=c(17404),l=c(7803),m=c(45974),n=c(93930),o=c(79761);let p=new Set(["policy_suspended","credential_rejected","reauth_required"]),q=new Set(["authentication","entitlement_or_quota","permission_denied","rate_limited","upstream_transient"]),r=new Set(["not_attempted","succeeded","transient_failed","rejected"]);function s(a,b=200){return null==a||""===a?null:String(a).slice(0,b).replace(/[^a-zA-Z0-9._:/#-]/g,"")||null}function t(a){let b=Number(a);return Number.isInteger(b)&&b>=0&&b<=599?b:null}function u(a,b){let c=a&&"object"==typeof a&&!Array.isArray(a)?a:{},d=Number(b??c.resetsAtMs),e=new Date(d),f=Number.isFinite(d)&&d>0&&Number.isFinite(e.getTime())?e.toISOString():null;return{failureClass:s(c.failureClass,80)?.toLowerCase()||null,providerErrorCode:s(c.providerErrorCode),upstreamRequestId:s(c.upstreamRequestId),failureResetAt:f,authLifecycle:function(a){if(!a||"object"!=typeof a||Array.isArray(a))return null;let b=r.has(a.refreshOutcome)?a.refreshOutcome:"not_attempted";return{initialStatus:t(a.initialStatus),refreshAttempted:!0===a.refreshAttempted,refreshOutcome:b,retryStatus:t(a.retryStatus)}}(c.authLifecycle)}}function v(a,b){return({policy_suspended:"Kiro reports that this account is suspended or disabled by upstream policy.",credential_rejected:"Kiro rejected the credential after a successful token refresh.",reauth_required:"Kiro rejected the refresh credential; sign in again before re-enabling.",entitlement_or_quota:"Kiro entitlement or quota is temporarily unavailable.",rate_limited:"Kiro rate limit is temporarily exhausted.",authentication:"Kiro authentication is temporarily unavailable.",permission_denied:"Kiro denied this request without confirming an account suspension.",upstream_transient:"Kiro upstream is temporarily unavailable."})[a]||`Kiro upstream request failed with status ${b||"unknown"}.`}function w(a){return"string"!=typeof a?"":a.trim().replace(/^(?:kiro|kr)\//i,"")}function x(a,b){let c=a?.providerSpecificData?.enabledModels;if(!Array.isArray(c)||0===c.length)return!0;let d=w(b);return c.some(a=>w(a)===d)}var y=c(26305);let z=Object.freeze({"nvidia-build":"fill-first"}),A=Promise.resolve();function B(a){return Object.freeze({...a,supportedModels:Object.freeze([...a.supportedModels||[]]),supportedOperations:Object.freeze([...a.supportedOperations||[]]),capabilities:Object.freeze([...a.capabilities||[]]),quota:a.quota?Object.freeze({...a.quota}):null,circuits:Object.freeze({...a.circuits||{}}),eligibility:Object.freeze({eligible:a.eligibility.eligible,reasons:Object.freeze([...a.eligibility.reasons])})})}async function C(a,b=null,c={}){let e=(0,k.rs)(a),f=Array.isArray(c.allowedConnectionIds)?c.allowedConnectionIds:null;if(!f&&c.apiKey&&(f=await (0,d.ME)(c.apiKey)),k.AI_PROVIDERS[e]?.noAuth){let a={id:"noauth",provider:e,priority:1,legacyOrder:0,isActive:!0,quarantinedAt:null,reauthRequired:!1,supportedModels:[],supportedOperations:[c.operation||"chat"],capabilities:c.capabilities||[],modelLocked:!1,quota:null,circuits:{},transportAvailable:!1!==c.transportAvailable,outboundAllowed:!1!==c.outboundAllowed,egressId:"direct",health:null,sticky:!1};return a.eligibility=(0,n.Z)(a,{...c,provider:e,model:b,operation:c.operation||"chat",allowedConnectionIds:f,pinnedConnectionId:c.strictPreferred?c.preferredConnectionId:null}),Object.freeze([B(a)])}let[g,i]=await Promise.all([(0,d.getProviderConnections)({provider:e}),(0,d.tV)(e)]),j=new Map(i.map(a=>[a.connectionId,a])),l=Number.isFinite(c.nowMs)?c.nowMs:Date.now(),p=c.circuitRegistry||o.tH;return Object.freeze(g.map((a,d)=>{let g,i=a.providerSpecificData||{},k=j.get(a.id)||null,o=Date.parse(k?.fetchedAt),q=Number.isFinite(o)&&l-o<=h.JN,r=(0,h.td)(k?.usage,e,b),s=(0,h.yH)(k,l),t=Array.isArray(i.enabledModels)?i.enabledModels.map(a=>w(a)):[],u=i.connectionProxyPoolId||i.proxyPoolId||(i.vercelRelayUrl?"relay":"direct"),v={account:{scope:"account",provider:e,accountId:a.id},provider:{scope:"provider",provider:e},egress:{scope:"egress",egressId:u},integrity:{scope:"integrity",provider:e,model:b,egressId:u}},x=Object.fromEntries(Object.entries(v).map(([a,b])=>[a,p.getDecision(b)])),y=Object.entries(x).filter(([,a])=>"half_open"===a.state),z=Object.values(x).some(a=>"open"===a.state);if(!0===c.acquireCircuitProbes&&!z&&1===y.length){let[a]=y[0],b=p.tryAcquireProbe(v[a]);x[a]={...x[a],probeAcquired:!0===b.acquired,...b.leaseId?{probeLeaseId:b.leaseId}:{}}}let A={id:a.id,provider:e,priority:Number.isFinite(a.priority)?a.priority:999,legacyOrder:d,isActive:!0===a.isActive,quarantinedAt:a.quarantinedAt||null,reauthRequired:"reauth_required"===a.failureClass||"token_expired"===a.autoDisabledReason||"reauth_required"===a.autoDisabledReason,supportedModels:t,supportedOperations:Array.isArray(i.supportedOperations)?i.supportedOperations:[c.operation||"chat"],capabilities:Array.isArray(i.capabilities)?i.capabilities:[],modelLocked:(0,h.Bl)(a,b,e)||(g=a.id,"antigravity"===e&&!!(0,m.FN)(g,b,l)),quota:k?{provenance:q?"fresh":"last_successful",exhausted:!!s,remaining:r>=0?r:null,total:r>=0?100:null,fetchedAtMs:Number.isFinite(o)?o:null,validUntilMs:Number.isFinite(o)?o+h.JN:null,exhaustedUntilMs:s||null}:null,circuits:x,transportAvailable:!1!==c.transportAvailable&&!1!==i.transportAvailable,outboundAllowed:!1!==c.outboundAllowed,egressId:u,health:"unavailable"===a.testStatus||a.lastError?"degraded":"success"===a.testStatus||"connected"===a.testStatus?"healthy":null,sticky:a.consecutiveUseCount>0};return A.eligibility=(0,n.Z)(A,{...c,provider:e,model:b,operation:c.operation||"chat",allowedConnectionIds:f,pinnedConnectionId:c.strictPreferred?c.preferredConnectionId:null,nowMs:l}),B(A)}))}async function D(a,b=null,e=null,f={}){let n,o=b instanceof Set?b:b?new Set([b]):new Set,p=f?.preferredConnectionId||null,q=!!f?.strictPreferred,r=A;A=new Promise(a=>{n=a});try{let b;await r;let n=(0,k.rs)(a);if(k.AI_PROVIDERS[n]?.noAuth){let a=((await (0,d.mt)()).providerStrategies||{})[n]||{},b=a.rotateStrategy||"none",c=a.proxyPoolId||null;if("none"!==b){let a=(await (0,d.ui)({isActive:!0})).filter(a=>a.proxyUrl),e=a.filter(a=>"error"!==a.testStatus),f=(e.length?e:a).map(a=>a.id);c=(0,g.p)(f,b,n)}let e=await (0,g.B)({proxyPoolId:c||""});return{id:"noauth",connectionId:"noauth",connectionName:"Public",isActive:!0,accessToken:"public",providerSpecificData:{connectionProxyEnabled:e.connectionProxyEnabled,connectionProxyUrl:e.connectionProxyUrl,connectionNoProxy:e.connectionNoProxy,connectionProxyPoolId:e.proxyPoolId||null,strictProxy:!0===e.strictProxy,vercelRelayUrl:e.vercelRelayUrl||""}}}let s=await (0,d.getProviderConnections)({provider:n,isActive:!0}),t=Array.isArray(f?.allowedConnectionIds)?f.allowedConnectionIds:null;if(!t&&f?.apiKey&&(t=await (0,d.ME)(f.apiKey)),Array.isArray(t)&&t.length>0){let b=new Set(t);s=s.filter(a=>b.has(a.id)),l.debug("AUTH",`${a} | API key scoped to ${s.length} allowed connection(s)`)}l.debug("AUTH",`${a} | total connections: ${s.length}, excludeIds: ${o.size>0?[...o].join(","):"none"}, model: ${e||"any"}`);let u=null;if("kiro"===n&&e)try{u=await (0,i.ED)(e)}catch(a){l.warn("AUTH",`Kiro model support cache unavailable: ${a?.message||a}`)}let v=u?.state==="supported"||u?.state==="unsupported",w={modelUnavailable:!0,provider:n,model:e};if(0===s.length){if(v)return l.warn("AUTH",`${a} | no eligible supporter for ${e}`),w;return l.warn("AUTH",`No credentials for ${a}`),null}let A=s.filter(a=>!a.quarantinedAt);if("antigravity"===n&&e){let b=(0,y.Lf)(e,A,await (0,d.tV)(n));if(b.premium&&(A=A.filter(a=>b.eligibleIds.has(a.id)),l.debug("AUTH",`${a} | ${e} is paid-only: ${A.length} eligible account(s)`),0===A.length))return l.warn("AUTH",`${a} | no paid account eligible for ${e}`),{...w,status:403,message:(0,y.ni)(e)}}let B=new Set,C=new Set,D=!1;if("kiro"===n&&e){let a=A=A.filter(a=>x(a,e)),b=new Set(u?.unsupportedConnectionIds||[]),c=new Set(u?.freshCatalogConnectionIds||[]),d=s.filter(a=>{let c=a?.providerSpecificData?.enabledModels;return Array.isArray(c)&&c.length>0&&x(a,e)&&!b.has(a.id)}).map(a=>a.id),f=new Set([...u?.supportingConnectionIds||[],...d].filter(a=>!b.has(a)));C=new Set([...b,...[...c].filter(a=>!f.has(a))]),A=A.filter(a=>!C.has(a.id)),D=a.length>0&&a.every(a=>C.has(a.id)),f.size>0?(B=f,v=!0):u?.state==="unsupported"&&(A=[])}let E=new Map;if("codebuddy-cn"===n)for(let a of(await (0,d.tV)(n))){let b=(0,h.yH)(a);b&&E.set(a.connectionId,b)}let F=new Map;if("codebuddy-cn"===n)for(let a of s){if(11140!==Number(a.providerErrorCode))continue;let b=(0,h.kJ)(a);b&&F.set(a.id,b)}let G=new Set,H=new Set;if("codex"===n&&e){let a=await (0,d.tV)(n),b=new Map(a.map(a=>[a.connectionId,a]));for(let a of s)(0,h.xB)(a,e,n)&&H.add(a.id),(0,h.N2)(a,e,b.get(a.id),n,{ignoreProbe:!0})&&!H.has(a.id)&&G.add(a.id)}if("codebuddy"===n||"codebuddy-cn"===n)for(let a of s)(0,j.hN)(a)&&(0,h.xB)(a,null,n)&&H.add(a.id);let I=a=>F.has(a.id)||("codebuddy"===n||"codebuddy-cn"===n)&&(0,j.hN)(a)&&H.has(a.id)||(0,h.Bl)(a,e,n)&&!G.has(a.id),J=a=>H.has(a.id)?"codebuddy"===n||"codebuddy-cn"===n?a[(0,h.UM)(null,n)]:new Date(Date.now()+1e3).toISOString():[(0,h.V0)(a,e,n),F.get(a.id)].filter(Boolean).sort().at(-1)||null,K=A.filter(a=>!(o.has(a.id)||I(a)||E.has(a.id)||"antigravity"===n&&(0,m.VZ)(a.id,e))),L=K,M=!1;if("kiro"===n&&e&&!q){let a=K.filter(a=>B.has(a.id));if(a.length>0)L=a;else{let a=K.filter(a=>!B.has(a.id)),b=[...o].filter(a=>!B.has(a)).length;L=a,b>=3?(L=[],M=!0):o.size>0&&0===a.length&&(M=!0)}}if(q&&p){let b=s.find(a=>a.id===p);if(!b)return l.warn("AUTH",`${a} | pinned account not found: ${p}`),null;if(b.quarantinedAt)return l.warn("AUTH",`${a} | pinned account is quarantined: ${b.id?.slice(0,8)}`),null;if(C.has(b.id))return l.warn("AUTH",`${a} | pinned account does not support ${e}: ${b.id?.slice(0,8)}`),w;if(!A.some(a=>a.id===b.id))return l.warn("AUTH",`${a} | pinned account is not eligible for ${e||"this request"}: ${b.id?.slice(0,8)}`),v?w:null;if(o.has(b.id))return l.warn("AUTH",`${a} | pinned account excluded after failure: ${b.id?.slice(0,8)}`),null;if(I(b)||E.has(b.id)){let a=[J(b),E.has(b.id)?new Date(E.get(b.id)).toISOString():null].filter(Boolean).sort().at(-1);return{allRateLimited:!0,retryAfter:a,retryAfterHuman:(0,h.Qo)(a),lastError:b.lastError||"Pinned account unavailable",lastErrorCode:b.errorCode||null}}L=[b]}if(l.debug("AUTH",`${a} | available: ${L.length}/${A.length}`),s.forEach(a=>{let b=o.has(a.id),c=I(a),d=G.has(a.id),f=E.get(a.id),g=!!a.quarantinedAt,i=C.has(a.id);if(b||c||f||d||g||i){let j=(0,h.kJ)(a),k=H.has(a.id);l.debug("AUTH",` → ${a.id?.slice(0,8)} | ${b?"excluded":""} ${c?`modelLocked(${e}) until ${j}`:""} ${d?`staleLockRecovered(${e})`:""} ${k?`recoveryProbeInFlight(${e})`:""} ${f?`quotaExhausted until ${new Date(f).toISOString()}`:""} ${g?"quarantined":""} ${i?`unsupported(${e})`:""}`)}}),0===L.length){if(M)return l.warn("AUTH",`${a} | bounded fallback exhausted for ${e}`),null;let b=A.filter(a=>I(a)),c=A.map(a=>[I(a)?J(a):null,E.has(a.id)?new Date(E.get(a.id)).toISOString():null,"antigravity"===n?(0,m.FN)(a.id,e):null].filter(Boolean).sort().at(-1)).filter(Boolean).sort()[0]||null;if(c){let d=b[0];return l.warn("AUTH",`${a} | all ${A.length} candidate accounts locked for ${e||"all"} (${(0,h.Qo)(c)}) | lastError=${d?.lastError?.slice(0,50)}`),{allRateLimited:!0,retryAfter:c,retryAfterHuman:(0,h.Qo)(c),lastError:d?.lastError||null,lastErrorCode:d?.errorCode||null}}return l.warn("AUTH",`${a} | all ${s.length} accounts unavailable`),v||D?w:null}let N=await (0,d.mt)(),O=(N.providerStrategies||{})[n]||{},P=O.fallbackStrategy||z[n]||N.fallbackStrategy||"fill-first";if(p&&(b=L.find(a=>a.id===p))&&l.debug("AUTH",`${a} | pinned to ${b.id?.slice(0,8)} (${b.name||b.email||"unnamed"})`),b);else if(q&&p)return l.warn("AUTH",`${a} | pinned account unavailable: ${p}`),null;else if("round-robin"===P){let a=O.stickyRoundRobinLimit||N.stickyRoundRobinLimit||3,c=[...L].sort((a,b)=>a.lastUsedAt||b.lastUsedAt?a.lastUsedAt?b.lastUsedAt?new Date(b.lastUsedAt)-new Date(a.lastUsedAt):-1:1:(a.priority||999)-(b.priority||999))[0],e=c?.consecutiveUseCount||0;c&&c.lastUsedAt&&e<a?(b=c,await (0,d.updateProviderConnection)(b.id,{lastUsedAt:new Date().toISOString(),consecutiveUseCount:(b.consecutiveUseCount||0)+1})):(b=[...L].sort((a,b)=>a.lastUsedAt||b.lastUsedAt?a.lastUsedAt?b.lastUsedAt?new Date(a.lastUsedAt)-new Date(b.lastUsedAt):1:-1:(a.priority||999)-(b.priority||999))[0],await (0,d.updateProviderConnection)(b.id,{lastUsedAt:new Date().toISOString(),consecutiveUseCount:1}))}else if("most-quota"===P){let a=await Promise.all(L.map(async a=>{let b=-1;try{let c=await (0,d.getQuotaSnapshot)(a.id);b=(0,h.td)(c?.usage,n,e)}catch{}return{conn:a,remaining:b}}));a.sort((a,b)=>a.remaining!==b.remaining?b.remaining-a.remaining:(a.conn.priority||999)-(b.conn.priority||999)),b=(a.filter(a=>0!==a.remaining)[0]||a[0]).conn,await (0,d.updateProviderConnection)(b.id,{lastUsedAt:new Date().toISOString(),consecutiveUseCount:1})}else if("lowest-latency"===P){let{getLatencyStats:e}=await Promise.resolve().then(c.bind(c,14686)),f=await e(),g=L.map(a=>{let b=f.get(`${a.provider}|${a.id}`)||f.get(`${n}|${a.id}`);return{conn:a,avgMs:b?b.avgMs:null,samples:b?b.samples:0}});g.sort((a,b)=>null===a.avgMs&&null===b.avgMs?(a.conn.priority||999)-(b.conn.priority||999):null===a.avgMs?1:null===b.avgMs?-1:a.avgMs!==b.avgMs?a.avgMs-b.avgMs:(a.conn.priority||999)-(b.conn.priority||999)),b=g[0].conn,l.debug("AUTH",`${a} | lowest-latency → ${b.id?.slice(0,8)} (${g[0].avgMs??"?"}ms avg, ${g[0].samples} samples)`),await (0,d.updateProviderConnection)(b.id,{lastUsedAt:new Date().toISOString(),consecutiveUseCount:1})}else b=L[0];if(G.has(b.id)){let a=(0,h.WP)(e,n);await (0,d.updateProviderConnection)(b.id,a),b={...b,...a}}if(("codebuddy"===n||"codebuddy-cn"===n)&&(0,j.hN)(b)){let a=(0,h.WP)(null,n);await (0,d.updateProviderConnection)(b.id,a),b={...b,...a}}let Q=await (0,g.B)(b.providerSpecificData||{});return{authType:b.authType,apiKey:b.apiKey,accessToken:b.accessToken,refreshToken:b.refreshToken,idToken:b.idToken,expiresAt:b.expiresAt,expiresIn:b.expiresIn,lastRefreshAt:b.lastRefreshAt,projectId:b.projectId||b.providerSpecificData?.projectId||null,connectionName:b.displayName||b.name||b.email||b.id,copilotToken:b.providerSpecificData?.copilotToken,providerSpecificData:{...b.providerSpecificData||{},connectionProxyEnabled:Q.connectionProxyEnabled,connectionProxyUrl:Q.connectionProxyUrl,connectionNoProxy:Q.connectionNoProxy,strictProxy:!0===Q.strictProxy,connectionProxyPoolId:Q.proxyPoolId||null,vercelRelayUrl:Q.vercelRelayUrl||""},connectionId:b.id,testStatus:b.testStatus,lastError:b.lastError,_connection:b}}finally{n&&n()}}var E=c(3662);async function F(a,b,e,f=null,g=null,i=null,m=null,n=null){let o,p,q;if(!a||"noauth"===a)return{shouldFallback:!1,cooldownMs:0};let r=(0,k.rs)(f),s=(0,h.UM)(g,r);if((0,h.d5)(b,e))return await (0,d.updateProviderConnection)(a,{[s]:null}),l.warn("AUTH",`shared egress/WAF error; fallback without locking account [${b}]`),{shouldFallback:!0,cooldownMs:0};if((0,h.P0)(b,e))return await (0,d.updateProviderConnection)(a,{[s]:null}),l.warn("AUTH",`non-account error; no fallback [${b}] ${"string"==typeof e?e.slice(0,100):"Provider error"}`),{shouldFallback:!1,cooldownMs:0};let t=(await (0,d.getProviderConnections)({provider:r})).find(b=>b.id===a),u=t?.backoffLevel||0,v=(0,h.UO)(e),w="codebuddy-cn"===r&&14018===v,x="codebuddy"===r&&14018===v,y="codebuddy-cn"===r&&11140===v;if(y){let c=new Date().toISOString(),e="CodeBuddy CN rejected this credential (11140 request illegal).";return await (0,d.Iu)(a,(a,d)=>{if(a.manuallyReenabledAt&&a.manuallyReenabledAt!==m?.manuallyReenabledAt)return null;let f={...a,providerSpecificData:(0,j.r_)(a.providerSpecificData,c,v)};return{connection:{[s]:null,isActive:!1,testStatus:"unavailable",lastError:e,errorCode:b,providerErrorCode:v,quarantinedAt:c,quarantineReason:e,lastErrorAt:c,autoDisabledAt:c,autoDisabledReason:"credential_rejected",consecutiveAuthFailures:Math.max(1,(a.consecutiveAuthFailures||0)+1),backoffLevel:0,providerSpecificData:f.providerSpecificData},quotaUsage:(0,j.pX)(d?.usage||{},f)}}),l.warn("AUTH",`${t?.displayName||t?.name||a.slice(0,8)} quarantined immediately [11140]`),{shouldFallback:!0,cooldownMs:0}}if(w){let b=await (0,d.getQuotaSnapshot)(a);i=(0,h.lI)(b?.usage)||i}let z=function(a,b,c){if("github"!==c||402!==Number(a)||!String(b||"").toLowerCase().includes("you've reached your additional usage limit for your plan"))return null;let d=new Date;return Date.UTC(d.getUTCFullYear(),d.getUTCMonth()+1,1)}(b,e,r);z&&z>Date.now()?(o=!0,p=z-Date.now(),q=0):i&&i>Date.now()?(o=!0,p=Math.min(i-Date.now(),E.fh),q=0):{shouldFallback:o,cooldownMs:p,newBackoffLevel:q}=(0,h.hk)(b,e,u);let A=g&&(0,h.Hp)(b,e)?(0,h.gU)(g,r):{};if(!o)return await (0,d.updateProviderConnection)(a,{[s]:null,...A}),{shouldFallback:!1,cooldownMs:0};let B="string"==typeof e?e.slice(0,100):"Provider error",C=w||x,D=z||C?null:(0,h.LV)(r,g),G=(0,h.S5)(D,p,r),H=new Date().toISOString();if(D&&Object.keys(A).length>0){await (0,d.updateProviderConnection)(a,{...G,...A,[s]:null});let c=t?.displayName||t?.name||t?.email||a.slice(0,8);return l.warn("AUTH",`${c} cannot serve ${D}; locked ${Object.keys(G)[0]} for ${Math.round(p/1e3)}s [${b}]`),{shouldFallback:!0,cooldownMs:p,modelOnly:!0}}let I={...G,...A,[s]:null,...C?{[(0,h.UM)(null,r)]:null}:{},testStatus:"unavailable",lastError:B,errorCode:b,providerErrorCode:v,modelLockReason:{model:D||"__all",providerErrorCode:v,reason:B,lockedAt:H,resetsAt:new Date(Date.now()+p).toISOString()},lastErrorAt:H,backoffLevel:q??u};if(C)try{await (0,d.Iu)(a,(a,b)=>{if(a.manuallyReenabledAt&&a.manuallyReenabledAt!==m?.manuallyReenabledAt)return null;let c={...a,providerSpecificData:(0,j.QN)(a.providerSpecificData,H)};return{connection:{...I,providerSpecificData:c.providerSpecificData},quotaUsage:(0,j.pX)(b?.usage||{},c)}})}catch(a){throw l.warn("AUTH",`CodeBuddy runtime exhaustion update failed: ${a?.message||a}`),a}else await (0,d.updateProviderConnection)(a,I);let J=Object.keys(G)[0],K=t?.displayName||t?.name||t?.email||a.slice(0,8);if(l.warn("AUTH",`${K} locked ${J} for ${Math.round(p/1e3)}s [${b}]`),f&&c.e(6802).then(c.bind(c,86802)).then(a=>{a.alertProviderDown(f,`${K}: ${B}`),(429===b||B.toLowerCase().includes("quota"))&&a.alertQuotaExhausted(f,K)}).catch(()=>{}),f&&b&&B&&console.error(`❌ ${f} [${b}]: ${B}`),new Set([401,403]).has(b)&&!w){let c=("string"==typeof e?e:"").toLowerCase(),f=["quota","payment","billing","entitlement","subscription","insufficient_quota"].some(a=>c.includes(a)),g=n?.failureClass==="credential_rejected";if(y||g||!f&&["token expired","token is expired","token has expired","expired token","token invalid","invalid token","revoked","invalid_grant","unauthorized","invalid api key","invalid_api_key","banned","suspended","restricted","account disabled"].some(a=>c.includes(a))){let e=(t?.consecutiveAuthFailures||0)+1;e>=3?(await (0,d.updateProviderConnection)(a,{isActive:!1,autoDisabledAt:new Date().toISOString(),autoDisabledReason:c.includes("banned")||c.includes("suspended")||c.includes("restricted")||c.includes("account disabled")?"banned":"token_expired",consecutiveAuthFailures:e}),l.warn("AUTH",`⛔ Auto-disabled ${K} after ${e} consecutive auth failures [${b}]: ${B}`)):(await (0,d.updateProviderConnection)(a,{consecutiveAuthFailures:e}),l.warn("AUTH",`${K} auth failure ${e}/3 [${b}]: ${B}`))}}return{shouldFallback:!0,cooldownMs:p}}async function G(a,b,c,e,f){if(!a||"noauth"===a)return{shouldFallback:!1,cooldownMs:0};let g=(await (0,d.getProviderConnections)({provider:c})).find(b=>b.id===a),i=g?.displayName||g?.name||g?.email||a.slice(0,8),j=new Date().toISOString(),k=`${c} rejected the refresh credential; sign in again before re-enabling.`;return await (0,d.updateProviderConnection)(a,{[(0,h.UM)(e,c)]:null,isActive:!1,testStatus:"unavailable",lastError:k,lastErrorType:"auth",errorCode:b,failureClass:"reauth_required",providerErrorCode:f.providerErrorCode,upstreamRequestId:f.upstreamRequestId,failureResetAt:f.failureResetAt,authLifecycle:f.authLifecycle,quarantinedAt:j,quarantineReason:k,lastErrorAt:j,autoDisabledAt:j,autoDisabledReason:"reauth_required",consecutiveAuthFailures:Math.max(1,(g?.consecutiveAuthFailures||0)+1),backoffLevel:0}),l.warn("AUTH",`${i} quarantined immediately [reauth_required]`),{shouldFallback:!0,cooldownMs:0}}async function H(a,b,c){if("antigravity"!==a||!b||"noauth"===b||!(0,y.p$)(c))return!1;let[e,f]=await Promise.all([(0,d.getProviderConnections)({provider:a}),(0,d.tV)(a)]);return!!e.some(a=>a.id===b)&&!(0,y.Lf)(c,e,f).eligibleIds.has(b)}async function I(a,b,c,e=null,f=null,g=null,j=null,m=null){let n,o,r,t=(0,k.rs)(e);if("antigravity"===t){let c=u(j,g),e="policy_suspended"===c.failureClass&&"ORG_CODE_ASSIST_RESTRICTED"===c.providerErrorCode,i="account_validation_required"===c.failureClass&&"VALIDATION_REQUIRED"===c.providerErrorCode;if(e||i){if(!a||"noauth"===a)return{shouldFallback:!1,cooldownMs:0};let e=(await (0,d.getProviderConnections)({provider:t})).find(b=>b.id===a),g=new Date().toISOString(),j=i?"Google requires account verification before Antigravity can use Gemini Code Assist.":"Google organization policy blocks Gemini Code Assist access for this Antigravity account.",k=(0,h.UM)(f,t);await (0,d.Op)(a,a=>({...Object.fromEntries(Object.keys(a||{}).filter(a=>a.startsWith("modelLock_")).map(a=>[a,null])),[k]:null,modelLockReason:null,isActive:!1,testStatus:"unavailable",lastError:j,errorCode:b,failureClass:c.failureClass,providerErrorCode:c.providerErrorCode,upstreamRequestId:c.upstreamRequestId,failureResetAt:c.failureResetAt,authLifecycle:c.authLifecycle,quarantinedAt:g,quarantineReason:j,lastErrorAt:g,autoDisabledAt:g,autoDisabledReason:c.failureClass,consecutiveAuthFailures:Math.max(1,(a?.consecutiveAuthFailures||0)+1),backoffLevel:0}));let m=e?.displayName||e?.name||e?.email||a.slice(0,8);return l.warn("AUTH",`${m} quarantined immediately [${c.failureClass}]`),{shouldFallback:!0,cooldownMs:0}}}if("kiro"!==t){let d=u(j,g);return"reauth_required"===d.failureClass?G(a,b,t,f,d):await H(t,a,f)?(l.warn("AUTH",`${a.slice(0,8)} is not a paid account for ${f}; left unmarked [${b}]`),{shouldFallback:!0,cooldownMs:0,modelOnly:!0}):F(a,b,c,e,f,g,m,d)}if(!a||"noauth"===a)return{shouldFallback:!1,cooldownMs:0};let w=(0,h.UM)(f,t),x=u(j,g),{failureClass:y}=x;if("shared_egress_waf"===y||(0,h.d5)(b,c))return await (0,d.updateProviderConnection)(a,{[w]:null}),l.warn("AUTH",`Kiro shared egress/WAF error; fallback without account punishment [${b}]`),{shouldFallback:!0,cooldownMs:0};if(function(a,b){if("invalid_model"===a)return!0;let c=String(b||"").toUpperCase();return/INVALID[_-]?MODEL|MODEL[_-]?(?:NOT[_-]?(?:FOUND|SUPPORTED)|UNSUPPORTED)/.test(c)}(y,x.providerErrorCode)){await (0,d.updateProviderConnection)(a,{[w]:null});let b=!1;try{await (0,i.FL)(a,f);let c=(await (0,d.getProviderConnections)({provider:t,isActive:!0})).filter(a=>!a.quarantinedAt).map(a=>a.id);b=!!f&&await (0,i.CY)(f,a,c)}catch(a){l.warn("AUTH",`Kiro model support cache update failed: ${a?.message||a}`)}return l.warn("AUTH",`Kiro model is unsupported by ${a.slice(0,8)}; ${b?"trying a known supporter":"not rotating to an unknown account"}`),{shouldFallback:b,cooldownMs:0}}if(function(a,b){if("invalid_request"===a||"request_error"===a)return!0;let c=String(b||"").toUpperCase();return/INVALID[_-]?(?:REQUEST|ARGUMENT)|VALIDATION|BAD[_-]?REQUEST|MALFORMED/.test(c)}(y,x.providerErrorCode)||(0,h.P0)(b,c))return await (0,d.updateProviderConnection)(a,{[w]:null}),l.warn("AUTH",`Kiro request error; no account lock or credential rotation [${b}]`),{shouldFallback:!1,cooldownMs:0};let z=(await (0,d.getProviderConnections)({provider:t})).find(b=>b.id===a),A=z?.backoffLevel||0,B=x.providerErrorCode||s((0,h.UO)(c)),C=z?.displayName||z?.name||z?.email||a.slice(0,8);if(p.has(y)){let c=new Date().toISOString(),e=v(y,b);return await (0,d.updateProviderConnection)(a,{[w]:null,isActive:!1,testStatus:"unavailable",lastError:e,errorCode:b,failureClass:y,providerErrorCode:B,upstreamRequestId:x.upstreamRequestId,failureResetAt:x.failureResetAt,authLifecycle:x.authLifecycle,quarantinedAt:c,quarantineReason:e,lastErrorAt:c,autoDisabledAt:c,autoDisabledReason:y,consecutiveAuthFailures:Math.max(1,(z?.consecutiveAuthFailures||0)+1),backoffLevel:0}),l.warn("AUTH",`${C} quarantined immediately [${y}]`),{shouldFallback:!0,cooldownMs:0}}let D=Number(g);if(Number.isFinite(D)&&D>Date.now()?(n=!0,o=Math.min(D-Date.now(),E.fh),r=0):{shouldFallback:n,cooldownMs:o,newBackoffLevel:r}=(0,h.hk)(b,c,A),!n)return await (0,d.updateProviderConnection)(a,{[w]:null}),{shouldFallback:!1,cooldownMs:0};let J=q.has(y)||403===b||408===b||429===b||b>=500,K=y||(429===b?"rate_limited":403===b?"permission_denied":b>=500?"upstream_transient":null),L=v(K,b),M=J?null:(0,h.LV)(t,f),N=(0,h.S5)(M,o,t),O=new Date().toISOString(),P=new Date(Date.now()+o).toISOString();await (0,d.updateProviderConnection)(a,{...N,[w]:null,testStatus:"unavailable",lastError:L,errorCode:b,failureClass:K,providerErrorCode:B,upstreamRequestId:x.upstreamRequestId,failureResetAt:x.failureResetAt,authLifecycle:x.authLifecycle,modelLockReason:{model:M||"__all",providerErrorCode:B,reason:L,lockedAt:O,resetsAt:P},lastErrorAt:O,backoffLevel:r??A,consecutiveAuthFailures:0});let Q=Object.keys(N)[0];if(l.warn("AUTH",`${C} locked ${Q} for ${Math.round(o/1e3)}s [${b}]`),!y&&(401===b||403===b)){let e=("string"==typeof c?c:"").toLowerCase();if(!["quota","payment","billing","entitlement","subscription","insufficient_quota"].some(a=>e.includes(a))&&["token expired","token invalid","invalid token","revoked","unauthorized","invalid api key","invalid_api_key","banned","suspended","restricted","account disabled"].some(a=>e.includes(a))){let c=(z?.consecutiveAuthFailures||0)+1,f=["banned","suspended","restricted","account disabled"].some(a=>e.includes(a));if(c>=3){let e=new Date().toISOString(),g=f?v("policy_suspended",b):"Kiro rejected this credential three consecutive times.";await (0,d.updateProviderConnection)(a,{isActive:!1,quarantinedAt:e,quarantineReason:g,failureClass:f?"policy_suspended":"authentication",autoDisabledAt:e,autoDisabledReason:f?"policy_suspended":"token_expired",consecutiveAuthFailures:c}),l.warn("AUTH",`${C} quarantined after ${c} unstructured auth failures`)}else await (0,d.updateProviderConnection)(a,{consecutiveAuthFailures:c})}}return{shouldFallback:!0,cooldownMs:o}}async function J(a,b,c=null){if(!a||"noauth"===a)return;let e=b._connection||b,f=(0,k.rs)(e.provider),g=(0,h.LV)(f,c),i=Date.now(),m=(0,h.UM)(c,f),n=!1,o=!1,p=(a,b=!1)=>{if(!a||b&&(a.quarantinedAt||e.quarantinedAt))return null;let d=(a,b)=>{if(!a.startsWith(b))return!1;let d=a.slice(b.length);return"__all"===d||!c||(0,h.LV)(f,d)===g};if(b&&Object.keys(a).some(b=>(d(b,"modelLock_")||d(b,"modelRecoveryProbe_"))&&a[b]!==e[b]&&Date.parse(a[b])>i))return n=!0,null;let j=Object.keys(a).filter(a=>a.startsWith("modelLock_")),k=c?(0,h.MC)(c,f):null,l=!!k&&null!=a[k];if("unavailable"!==a.testStatus&&!a.lastError&&0===j.length&&!l)return null;let o=j.filter(d=>{if(b&&a[d]!==e[d])return!1;let j=d.slice(10);if(c&&(0,h.LV)(f,j)===g||c&&"modelLock___all"===d)return!0;let k=a[d];return k&&new Date(k).getTime()<=i});if(0===o.length&&"unavailable"!==a.testStatus&&!a.lastError&&!l)return null;let p=j.filter(b=>!o.includes(b)&&Date.parse(a[b])>i),q={...Object.fromEntries(o.map(a=>[a,null])),...l?{[k]:null}:{}};return b&&a[m]!==e[m]||(q[m]=null),0===p.length&&Object.assign(q,{testStatus:"active",lastError:null,errorCode:null,providerErrorCode:null,..."kiro"===f?{failureClass:null,upstreamRequestId:null,failureResetAt:null,authLifecycle:null}:{},modelLockReason:null,lastErrorAt:null,backoffLevel:0,consecutiveAuthFailures:0}),q};if("kiro"===f){await (0,d.Op)(a,a=>p(a,!0)),n&&l.debug("AUTH",`Kiro success did not clear newer failure state for ${a.slice(0,8)}`);return}if("codebuddy"===f||"codebuddy-cn"===f){let b=(0,j.kt)(e);await (0,d.Iu)(a,a=>{if(a.quarantinedAt||(0,j.uF)(a))return null;let c=(0,j.kt)(a);if(c&&c!==b)return null;let d=p(a)||{};return(b&&(0,j.kt)(a)===b&&(d.providerSpecificData=(0,j.US)(a.providerSpecificData),d[(0,h.UM)(null,f)]=null,o=!0),0===Object.keys(d).length)?null:{connection:d,...o?{quotaUsage:null}:{}}});return}let q=p(e);q&&await (0,d.updateProviderConnection)(a,q)}},92280:(a,b,c)=>{Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},93930:(a,b,c)=>{c.d(b,{Z:()=>e});let d=Object.freeze([["unsupported_model",(a,b)=>Array.isArray(a.supportedModels)&&a.supportedModels.length>0&&!a.supportedModels.includes(b.model)],["unsupported_operation",(a,b)=>Array.isArray(a.supportedOperations)&&a.supportedOperations.length>0&&!a.supportedOperations.includes(b.operation)],["unsupported_capability",(a,b)=>{let c=new Set(a.capabilities||[]);return c.size>0&&(b.requiredCapabilities||[]).some(a=>!c.has(a))}],["api_key_model_restricted",(a,b)=>Array.isArray(b.allowedModels)&&b.allowedModels.length>0&&!b.allowedModels.includes(b.model)],["api_key_provider_restricted",(a,b)=>Array.isArray(b.allowedProviders)&&b.allowedProviders.length>0&&!b.allowedProviders.includes(a.provider)],["connection_restricted",(a,b)=>Array.isArray(b.allowedConnectionIds)&&b.allowedConnectionIds.length>0&&!b.allowedConnectionIds.includes(a.id)],["explicit_pin_mismatch",(a,b)=>!!b.pinnedConnectionId&&b.pinnedConnectionId!==a.id],["inactive",a=>!0!==a.isActive],["quarantined",a=>!!a.quarantinedAt],["reauth_required",a=>!0===a.reauthRequired],["model_locked",a=>!0===a.modelLocked],["quota_exhausted",(a,b)=>{let c=a.quota;return!!c&&!0===c.exhausted&&("last_successful"!==c.provenance||!(Number(c.remaining)>0&&Number(c.validUntilMs)>Number(b.nowMs||Date.now())))}],["circuit_open",a=>Object.values(a.circuits||{}).some(a=>a?.state==="open"||a?.state==="half_open"&&a?.probeAcquired!==!0)],["missing_transport",a=>!1===a.transportAvailable],["outbound_rejected",a=>!1===a.outboundAllowed]]);function e(a={},b={}){let c=d.filter(([,c])=>c(a,b)).map(([a])=>a);return Object.freeze({eligible:0===c.length,reasons:Object.freeze(c)})}}};
@@ -0,0 +1 @@
1
+ "use strict";exports.id=4177,exports.ids=[4177],exports.modules={220:(a,b,c)=>{c.d(b,{A:()=>e});var d=c(92990);let e={config:d.LT,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),state:c,access_type:"offline",prompt:"consent"});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,client_secret:a.clientSecret,code:b,redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Token exchange failed: ${a}`)}return await d.json()},postExchange:async a=>{let b=await fetch(`${d.LT.userInfoUrl}?alt=json`,{headers:{Authorization:`Bearer ${a.access_token}`}}),c=b.ok?await b.json():{},e="";try{let b=await fetch("https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",{method:"POST",headers:{Authorization:`Bearer ${a.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({metadata:(0,d.cD)(),mode:1})});if(b.ok){let a=await b.json();e=a.cloudaicompanionProject?.id||a.cloudaicompanionProject||""}}catch(a){console.log("Failed to fetch project ID:",a)}return{userInfo:c,projectId:e}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,email:b?.userInfo?.email,projectId:b?.projectId})}},5867:(a,b,c)=>{c.d(b,{A:()=>e});var d=c(92990);let e=(0,c(67377).N)(d.t3)},13342:(a,b,c)=>{c.d(b,{A:()=>i});var d=c(92990),e=c(23358);async function f(a,b,c){let e=`${a.replace(/\/$/,"")}${b}`,f=await fetch(e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","User-Agent":d.eD.userAgent},body:JSON.stringify(c)}),g=await f.text();if(!f.ok)throw Error(`Windsurf ${b} HTTP ${f.status}: ${g.slice(0,200)}`);try{return JSON.parse(g)}catch{throw Error(`Windsurf ${b} invalid JSON`)}}async function g(a){let b=await f(d.eD.registerApiBaseUrl,d.eD.registerPath,{firebase_id_token:a}),c=(0,e.j)(b,[["apiKey"],["api_key"]]);if(!c)throw Error("Windsurf RegisterUser missing apiKey");return{apiKey:c,apiServerUrl:(0,e.j)(b,[["apiServerUrl"],["api_server_url"]])||d.eD.defaultApiServerUrl,name:(0,e.j)(b,[["name"]])}}async function h(a,b){try{let c=await f(a,d.eD.oneTimeAuthPath,{firebaseIdToken:b}),g=(0,e.j)(c,[["authToken"],["auth_token"]]);if(!g)return{email:null,name:null};let h=await f(a,d.eD.currentUserPath,{authToken:g,includeSubscription:!0}),i=h.user||h;return{email:(0,e.j)(i,[["email"]]),name:(0,e.j)(i,[["name"]])}}catch{return{email:null,name:null}}}let i={config:d.eD,flowType:"authorization_code",callbackPath:d.eD.callbackPath,buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({response_type:"token",client_id:a.clientId,redirect_uri:b,state:c,prompt:"login",redirect_parameters_type:"query",workflow:"onboarding"});return`${a.authBaseUrl}${a.signInPath}?${d.toString()}`},exchangeToken:async(a,b,c,d,e)=>{let f=String(b||"").trim();if(!(f.includes("?")||f.includes("access_token="))){let b=f.replace(/^Bearer\s+/i,"");if(b.startsWith("sk-ws-"))return{accessToken:b,refreshToken:null,expiresIn:null,apiServerUrl:a.defaultApiServerUrl,firebaseIdToken:null,_authMethod:"imported"};let c=await g(b);return{accessToken:c.apiKey,refreshToken:null,expiresIn:null,apiServerUrl:c.apiServerUrl,firebaseIdToken:b,_authMethod:"imported"}}let{firebaseIdToken:h}=function(a,b){let c=String(a||"").trim(),d=c;c.includes("?")&&(d=c.slice(c.indexOf("?")+1)),c.startsWith("#")&&(d=c.slice(1));let e=Object.fromEntries(new URLSearchParams(d)),f=a=>{for(let b of a){let a=e[b];if(a&&String(a).trim())return String(a).trim()}return null},g=f(["error"]);if(g){let a=f(["error_description"]);throw Error(a?`Windsurf auth failed: ${g} (${a})`:`Windsurf auth failed: ${g}`)}let h=f(["access_token","token"]);if(!h)throw Error("Windsurf callback missing access_token");let i=f(["state"]);if(b&&i&&i!==b)throw Error("Windsurf callback state mismatch");return{firebaseIdToken:h}}(f,e),i=await g(h);return{accessToken:i.apiKey,refreshToken:null,expiresIn:null,apiServerUrl:i.apiServerUrl,firebaseIdToken:h,_authMethod:"oauth"}},postExchange:async a=>a.firebaseIdToken?{userInfo:await h(a.apiServerUrl,a.firebaseIdToken)}:{userInfo:{email:null,name:null}},mapTokens:(a,b)=>({accessToken:a.accessToken,refreshToken:null,expiresIn:null,email:b?.userInfo?.email||void 0,displayName:b?.userInfo?.name||void 0,providerSpecificData:{authMethod:a._authMethod||"oauth",apiServerUrl:a.apiServerUrl,firebaseIdToken:a.firebaseIdToken}})}},17691:(a,b,c)=>{c.d(b,{A:()=>d});let d={config:c(92990).Td,flowType:"browser_token",buildAuthUrl:(a,b,c)=>{let d=(a.webAppUrl||"https://app.kimchi.dev").replace(/\/+$/,""),e=new URLSearchParams({callback:b,state:c});return`${d}/cli-auth?${e.toString()}`},exchangeToken:async(a,b)=>{let c=String(b||"").trim();if(!c)throw Error("Missing Kimchi token");let d=a.validationUrl||"https://api.cast.ai/v1/llm/openai/supported-providers",e=await fetch(d,{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${c}`}});if(!e.ok)throw Error(`Kimchi token validation failed: ${e.status}`);let f={};if(a.userInfoUrl)try{let b=await fetch(a.userInfoUrl,{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${c}`}});b.ok&&(f=await b.json())}catch{f={}}return{access_token:c,token_type:"Bearer",_kimchiUser:f}},mapTokens:a=>{let b=a._kimchiUser||{},c=b.id?String(b.id):"",d=b.username||"",e=b.email||(c?`kimchi-user-${c}`:null);return{accessToken:a.access_token,refreshToken:null,email:e,displayName:b.name||d||null,providerSpecificData:{authMethod:"browser_token",userId:c,username:d}}}}},18245:(a,b,c)=>{c.d(b,{A:()=>f});var d=c(92990),e=c(49804);let f={config:d.RY,flowType:"authorization_code",callbackPath:"/",prepareConfig:async(a,b)=>{let c=Number(b?.nativeAppPort)||d.RY.defaultNativeAppPort,f=(0,e.le)(a,{nativeAppPort:c});return{...a,...f}},buildAuthUrl:(a,b,c)=>a.authUrl,exchangeToken:async(a,b,c,d,f,g)=>{let{userId:h,encryptedAccessToken:i}=(0,e.Q_)(b);return{accessToken:(0,e.Wc)(i,d),userId:h,systemId:g?.systemId||a.systemId}},postExchange:async a=>{let b={accessToken:a.accessToken,providerSpecificData:{userId:a.userId,systemId:a.systemId}},c=null;try{c=await (0,e.qJ)(b,{config:d.RY})}catch{}let f=(0,e.k9)(b,c);return{userInfo:c,organizationId:f,email:c?.email||null,name:c?.name||c?.display_name||null}},mapTokens:(a,b)=>({accessToken:a.accessToken,refreshToken:null,expiresIn:null,email:b?.email||void 0,displayName:b?.name||void 0,providerSpecificData:{authMethod:"oauth",userId:a.userId,systemId:a.systemId,organizationId:b?.organizationId||""}})}},18941:(a,b,c)=>{c.d(b,{A:()=>d});let d={config:c(92990).lB,flowType:"authorization_code",buildAuthUrl:(a,b)=>{let c=new URLSearchParams({client_type:"extension",callback_url:b,redirect_uri:b});return`${a.authorizeUrl}?${c.toString()}`},exchangeToken:async(a,b,c)=>{try{let a=b,c=4-a.length%4;4!==c&&(a+="=".repeat(c));let d=Buffer.from(a,"base64").toString("utf-8"),e=d.lastIndexOf("}");if(-1===e)throw Error("No JSON found in decoded code");let f=JSON.parse(d.substring(0,e+1));return{access_token:f.accessToken,refresh_token:f.refreshToken,email:f.email,firstName:f.firstName,lastName:f.lastName,expires_at:f.expiresAt}}catch(f){let d=await fetch(a.tokenExchangeUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"authorization_code",code:b,client_type:"extension",redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Cline token exchange failed: ${a}`)}let e=await d.json();return{access_token:e.data?.accessToken||e.accessToken,refresh_token:e.data?.refreshToken||e.refreshToken,email:e.data?.userInfo?.email||"",expires_at:e.data?.expiresAt||e.expiresAt}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_at?Math.floor((new Date(a.expires_at).getTime()-Date.now())/1e3):3600,email:a.email,providerSpecificData:{firstName:a.firstName,lastName:a.lastName}})}},20386:(a,b,c)=>{c.d(b,{A:()=>f});var d=c(92990);let e="1.0.0",f={config:d.sA,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","x-api-version":e},body:new URLSearchParams({client_id:a.clientId})});if(!b.ok){let a=await b.text();throw Error(`Muse Code device code request failed: ${a}`)}return await b.json()},pollToken:async(a,b)=>{let c,d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","x-api-version":e},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:b,client_id:a.clientId})});try{c=await d.json()}catch{c={error:"invalid_response",error_description:await d.text()}}let f=c?.error==="authorization_pending"||c?.error==="slow_down";return{ok:d.ok||f,data:c}},postExchange:async a=>{let b,c;for(let c=0;(429===(b=await fetch("https://api.meta.ai/muse-code/key",{method:"POST",headers:{Accept:"application/json",Authorization:`Bearer ${a.access_token}`,"Content-Type":"application/json","x-api-version":e},body:JSON.stringify({onboard:!0}),redirect:"error"})).status||b.status>=500)&&!(c>=2);c++)await new Promise(a=>setTimeout(a,5e3*(c+1)));let d=await b.text();if(!b.ok){let a=`${b.status} ${d.slice(0,200)}`;try{let b=JSON.parse(d);(b?.title||b?.detail)&&(a=[b.title,b.detail].filter(Boolean).join(": "),b.action_url&&(a+=` — ${b.action_url}`))}catch{}throw Error(`Muse Code key mint failed: ${a}`)}try{c=JSON.parse(d)}catch{throw Error("Muse Code key mint returned invalid JSON")}if(!1===c.is_subs_active)throw Error("Muse Code subscription is inactive — activate it on muse.ai first");let f=c.action_url||c.require_payment_action_url;if(!c.api_key&&(c.require_payment||f))throw Error(`Muse Code subscription required${f?`: ${f}`:""}`);if(!c.api_key)throw Error("Muse Code key response is missing api_key");return{key:c}},mapTokens:(a,b)=>{let c=b?.key||{};return{accessToken:c.api_key,refreshToken:null,expiresIn:null,email:c.user_email?.trim().toLowerCase()||void 0,providerSpecificData:{authMethod:"device_code",oauthAccessToken:a.access_token,subscriptionTier:c.subs_tier_name||null}}}}},23358:(a,b,c)=>{c.d(b,{j:()=>d});function d(a,b){for(let c of b){let b=a;for(let a of c){if(null==b||"object"!=typeof b){b=void 0;break}b=b[a]}if("string"==typeof b&&b.trim())return b.trim();if("number"==typeof b)return String(b)}return null}},24329:(a,b,c)=>{c.d(b,{A:()=>i});var d=c(92990),e=c(34363);async function f(a){let b=await a.text();try{return b?JSON.parse(b):{}}catch{return{error:"invalid_response",error_description:b.slice(0,500)}}}async function g(a){let b=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({client_id:a.clientId})}),c=await f(b);if(!b.ok)throw Error(`Codex device code request failed: ${c.error_description||c.error||b.status}`);if(!c.device_auth_id||!c.user_code)throw Error("Codex device code response is missing the device id or user code");let d=c.expires_at?Math.max(1,Math.floor((new Date(c.expires_at).getTime()-Date.now())/1e3)):900;return{...c,device_code:c.device_auth_id,verification_uri:a.deviceVerificationUrl,interval:Number.parseInt(c.interval,10)||5,expires_in:d}}async function h(a,b,c,d){let e=d?._codexUserCode||d?.userCode||d?.user_code;if(!e)return{ok:!1,data:{error:"missing_user_code",error_description:"Codex device authorization is missing the user code"}};let g=await fetch(a.deviceTokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({device_auth_id:b,user_code:e})}),h=await f(g),i=403===g.status||404===g.status||"authorization_pending"===h.error;return{ok:g.ok||i,pending:i,data:h}}let i={config:d.DI,flowType:"authorization_code_pkce",fixedPort:1455,callbackPath:"/auth/callback",requestDeviceCode:g,pollToken:h,buildAuthUrl:(a,b,c,d)=>{let e=Object.entries({response_type:"code",client_id:a.clientId,redirect_uri:b,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod,...a.extraParams,state:c}).map(([a,b])=>`${a}=${encodeURIComponent(b)}`).join("&");return`${a.authorizeUrl}?${e}`},exchangeToken:async(a,b,c,d)=>{let e=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,code:b,redirect_uri:c,code_verifier:d})});if(!e.ok){let a=await e.text();throw Error(`Token exchange failed: ${a}`)}return await e.json()},mapTokens:a=>{let b=(0,e.Y)(a.id_token),c={accessToken:a.access_token,refreshToken:a.refresh_token,idToken:a.id_token,expiresIn:a.expires_in,lastRefreshAt:new Date().toISOString()},d=b.email||(0,e.J)(a.access_token);return d&&(c.email=d),(b.chatgptAccountId||b.chatgptPlanType)&&(c.providerSpecificData={chatgptAccountId:b.chatgptAccountId,chatgptPlanType:b.chatgptPlanType}),c}}},24336:(a,b,c)=>{c.d(b,{A:()=>l});var d=c(55511),e=c.n(d),f=c(92990),g=c(23358);async function h(a){let b=JSON.stringify({loginTraceID:a,login_trace_id:a}),c="no successful response";for(let a of f.SK.loginGuidanceUrls)try{let d=await fetch(a,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","User-Agent":f.SK.userAgent},body:b});if(!d.ok){c=`${a} HTTP ${d.status}`;continue}let e=await d.json(),h=(0,g.j)(e,[["Result","LoginHost"],["Result","loginHost"],["Result","LoginURL"],["result","loginHost"],["data","Result","LoginHost"],["data","loginHost"],["LoginHost"],["loginHost"]]);if(h)return h;c=`${a} missing LoginHost`}catch(b){c=`${a} ${b.message}`}throw Error(`Trae GetLoginGuidance failed: ${c}`)}function i(){return[...f.SK.apiOrigins]}async function j(a,b){let c=JSON.stringify({ClientID:f.SK.clientId,RefreshToken:a,ClientSecret:f.SK.clientSecret,UserID:""}),d="no successful response";for(let e of i()){let h=`${e.replace(/\/$/,"")}${f.SK.exchangeTokenPath}`;try{let e,i={Accept:"application/json","Content-Type":"application/json","User-Agent":f.SK.userAgent};b&&(i["x-cloudide-token"]=b);let j=await fetch(h,{method:"POST",headers:i,body:c}),k=await j.text();if(!j.ok){d=`${h} HTTP ${j.status}`;continue}try{e=JSON.parse(k)}catch{d=`${h} invalid JSON`;continue}let l=(0,g.j)(e,[["Result","AccessToken"],["Result","accessToken"],["result","access_token"],["accessToken"]]);if(!l){let a=(0,g.j)(e,[["message"],["msg"],["error"],["Result","Message"]])||"missing AccessToken";d=`${h} ${a}`;continue}return{accessToken:l,refreshToken:(0,g.j)(e,[["Result","RefreshToken"],["result","refresh_token"],["refreshToken"]])||a,expiresIn:null,expiresAt:(0,g.j)(e,[["Result","ExpiresAt"],["Result","expiresAt"],["result","expires_at"],["expiresAt"]])}}catch(a){d=`${h} ${a.message}`}}throw Error(`Trae ExchangeToken failed: ${d}`)}async function k(a){for(let b of i()){let c=`${b.replace(/\/$/,"")}${f.SK.getUserInfoPath}`;try{let b=await fetch(c,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","User-Agent":f.SK.userAgent,"x-cloudide-token":a},body:JSON.stringify({})});if(!b.ok)continue;let d=await b.json();return{email:(0,g.j)(d,[["Result","NonPlainTextEmail"],["Result","Email"],["Result","email"],["email"],["data","email"]]),name:(0,g.j)(d,[["Result","ScreenName"],["Result","Nickname"],["Result","Name"],["result","nickname"],["nickname"],["name"]]),aiRegion:(0,g.j)(d,[["Result","AIRegion"],["Result","aiRegion"],["aiRegion"]]),region:(0,g.j)(d,[["Result","Region"],["Result","region"],["region"]]),tenant:(0,g.j)(d,[["Result","TenantID"],["Result","tenantId"],["tenantId"]]),userId:(0,g.j)(d,[["Result","UserID"],["Result","userId"],["userId"]])}}catch{}}return{email:null,name:null}}let l={config:f.SK,flowType:"authorization_code",callbackPath:f.SK.callbackPath,prepareConfig:async a=>{let b=e().randomUUID(),c=await h(b);return{...a,loginTraceID:b,loginHost:c}},buildAuthUrl:(a,b,c)=>{var d;let g,h,i={plugin_version:f.SK.defaultPluginVersion,machine_id:e().randomUUID(),device_id:f.SK.defaultDeviceId,x_device_brand:"unknown",x_device_type:"unknown",x_os_version:"unknown",x_env:"",x_app_version:f.SK.defaultAppVersion,x_app_type:f.SK.defaultAppType},j=a.loginTraceID||c;return d=a.loginHost,(g=new URL(d.startsWith("http")?d:`https://${d.replace(/^\/+/,"")}`)).pathname=f.SK.authorizationPath,(h=new URLSearchParams).set("login_version","1"),h.set("auth_from","trae"),h.set("login_channel","native_ide"),h.set("plugin_version",i.plugin_version),h.set("auth_type","local"),h.set("client_id",f.SK.clientId),h.set("redirect","0"),h.set("login_trace_id",j),h.set("auth_callback_url",b),h.set("machine_id",i.machine_id),h.set("device_id",i.device_id),h.set("x_device_id",i.device_id),h.set("x_machine_id",i.machine_id),h.set("x_device_brand",i.x_device_brand),h.set("x_device_type",i.x_device_type),h.set("x_os_version",i.x_os_version),h.set("x_env",i.x_env),h.set("x_app_version",i.x_app_version),h.set("x_app_type",i.x_app_type),g.search=h.toString(),g.toString()},exchangeToken:async(a,b)=>{let c=String(b||"").trim();if(!(/[?=&]/.test(c)&&(c.includes("refreshToken")||c.includes("refresh_token"))))return{accessToken:c.replace(/^(Cloud-IDE-JWT|Bearer)\s+/i,""),refreshToken:null,expiresIn:24*f.SK.tokenLifetimeDays*3600,_authMethod:"imported"};let{refreshToken:d,cloudideToken:e}=function(a){let b=String(a||"").trim(),c=b;b.includes("?")&&(c=b.slice(b.indexOf("?")+1)),b.startsWith("#")&&(c=b.slice(1));let d=Object.fromEntries(new URLSearchParams(c)),e=a=>{for(let b of a){let a=d[b];if(a&&String(a).trim())return String(a).trim()}return null},f=e(["error","error_code","errorCode"]);if(f){let a=e(["error_description","error_desc","message"]);throw Error(a?`Trae auth failed: ${f} (${a})`:`Trae auth failed: ${f}`)}let g=e(["refreshToken","refresh_token","RefreshToken"]);if(!g)throw Error("Trae callback missing refreshToken");let h=e(["loginHost","login_host","LoginHost","host","consoleHost"]);if(!h)throw Error("Trae callback missing loginHost");return{refreshToken:g,loginHost:h,cloudideToken:e(["x-cloudide-token","xCloudideToken","accessToken","access_token","token"])}}(c);return{...await j(d,e),_authMethod:"oauth"}},postExchange:async a=>({userInfo:await k(a.accessToken)}),mapTokens:(a,b)=>{let c,d=a.expiresIn||(a.expiresAt?Math.max(60,Number(a.expiresAt)-Math.floor(Date.now()/1e3)):24*f.SK.tokenLifetimeDays*3600),e=b?.userInfo||{},g=e.aiRegion||"US-East";return{accessToken:a.accessToken,refreshToken:a.refreshToken,expiresIn:d,email:e.email||void 0,displayName:e.name||void 0,providerSpecificData:{authMethod:a._authMethod||"oauth",aiRegion:g,region:e.region||g,tenant:e.tenant||"marscode",userId:e.userId||"",scope:"sg"===(c=(g||"").toLowerCase())||c.includes("singapore")?"marscode-sg":"cn"===c||c.includes("cn")||c.includes("china")?"marscode-cn":"marscode-us",webId:"",bizUserId:"",userUniqueId:"",appLanguage:"en",appVersion:f.SK.defaultAppVersion,userRegion:"SG"===g?"SG":"US",userIdentity:"Free"}}}}},31111:(a,b,c)=>{c.d(b,{A:()=>e});var d=c(91365);let e=(0,d.O)(d.$.cn)},34363:(a,b,c)=>{function d(a){try{if(!a||"string"!=typeof a)return null;let b=a.split(".");if(3!==b.length)return null;let c=b[1].replace(/-/g,"+").replace(/_/g,"/"),d=(4-c.length%4)%4,e=c+"=".repeat(d);return JSON.parse(Buffer.from(e,"base64").toString("utf8"))}catch{return null}}function e(a){let b=d(a);if(b)return b.email||b.preferred_username||b.sub||void 0}function f(a){let b=d(a);if(!b)return{};let c=b["https://api.openai.com/auth"]||{};return{email:b.email,chatgptAccountId:c.chatgpt_account_id||b.account_id,chatgptPlanType:c.chatgpt_plan_type||b.plan_type}}c.d(b,{J:()=>e,Y:()=>f})},34940:(a,b,c)=>{c.d(b,{A:()=>h});var d=c(71164),e=c(92990),f=c(34363),g=c(72520);let h={config:e.qp,flowType:"device_code",requestDeviceCode:async a=>{let b=new URLSearchParams({client_id:a.clientId,scope:a.scope});a.referrer&&b.set("referrer",a.referrer);let c=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","User-Agent":d.f},body:b});if(!c.ok){let a=await c.text();throw Error(`Grok CLI device code request failed: ${a}`)}return await c.json()},pollToken:async(a,b)=>{let c,e=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","User-Agent":d.f},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:b,client_id:a.clientId})});try{c=await e.json()}catch{c={error:"invalid_response",error_description:await e.text()}}let f=c?.error==="authorization_pending"||c?.error==="slow_down";return{ok:e.ok||f,data:c}},postExchange:async a=>{try{let b=await fetch("https://cli-chat-proxy.grok.com/v1/user",{headers:{Authorization:`Bearer ${a.access_token}`,Accept:"application/json","User-Agent":d.f,"x-xai-token-auth":"xai-grok-cli","x-grok-client-version":d.u}});if(b.ok)return{user:await b.json()}}catch{}return{user:null}},mapTokens:(a,b)=>{let c=(0,g.p)(a.id_token)||(0,f.J)(a.access_token)||b?.user?.email||null,d=b?.user?.userId||b?.user?.principalId||null,e=[b?.user?.firstName,b?.user?.lastName].filter(Boolean).join(" ").trim()||null;return{accessToken:a.access_token,refreshToken:a.refresh_token||null,expiresIn:a.expires_in,scope:a.scope,email:c||void 0,displayName:e||void 0,providerSpecificData:{authMethod:"device_code",idToken:a.id_token||null,email:c||null,userId:d,hasGrokCodeAccess:b?.user?.hasGrokCodeAccess??null,subscriptionTier:b?.user?.subscriptionTier??null}}}}},35152:(a,b,c)=>{c.d(b,{A:()=>d});let d={config:c(92990).w1,flowType:"authorization_code",buildAuthUrl:(a,b)=>{let c=new URLSearchParams({client_type:"extension",callback_url:b,redirect_uri:b});return`${a.authorizeUrl}?${c.toString()}`},exchangeToken:async(a,b,c)=>{try{let a=b,c=4-a.length%4;4!==c&&(a+="=".repeat(c));let d=Buffer.from(a,"base64").toString("utf-8"),e=d.lastIndexOf("}");if(-1===e)throw Error("No JSON found in decoded code");let f=JSON.parse(d.substring(0,e+1));return{access_token:f.accessToken,refresh_token:f.refreshToken,email:f.email,firstName:f.firstName,lastName:f.lastName,expires_at:f.expiresAt}}catch(g){let d=a.tokenUrl||a.tokenExchangeUrl,e=await fetch(d,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"authorization_code",code:b,client_type:"extension",redirect_uri:c})});if(!e.ok){let a=await e.text();throw Error(`ClinePass token exchange failed: ${a}`)}let f=await e.json();return{access_token:f.data?.accessToken||f.accessToken,refresh_token:f.data?.refreshToken||f.refreshToken,email:f.data?.userInfo?.email||"",expires_at:f.data?.expiresAt||f.expiresAt}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_at?Math.floor((new Date(a.expires_at).getTime()-Date.now())/1e3):3600,email:a.email,providerSpecificData:{firstName:a.firstName,lastName:a.lastName}})}},38160:(a,b,c)=>{c.d(b,{Ou:()=>k,eG:()=>i,gQ:()=>j});var d=c(75924);let e=new Map,f=new Map,g=null;function h(a){return"string"==typeof a?a.trim()||null:a&&"object"==typeof a&&"string"==typeof a.id&&a.id.trim()||null}async function i(a,b,c={}){if(!a||!b)return null;let d=h(c.preferredProjectId),g=e.get(a);if(g&&Date.now()-g.fetchedAt<36e5&&(!d||d===g.projectId))return g.projectId;let j=d?`${a}::${d}`:a;if(f.has(j))return f.get(j).promise;let k=new AbortController,m=(async()=>{try{let c=await l(b,k.signal,{preferredProjectId:d});if(c)return e.set(a,{projectId:c,fetchedAt:Date.now()}),c;return console.warn("[ProjectId] could not fetch projectId for connection",a.slice(0,8)),null}catch(a){return console.warn(`[ProjectId] Error fetching project ID: ${a.message}`),null}finally{f.delete(j)}})();return f.set(j,{promise:m,controller:k,startedAt:Date.now()}),m}async function j(a,b={}){if(!a)return{projectId:null,tierId:null,requiresUserProject:!1,error:"missing access token"};try{return await m(a,void 0,b)}catch(a){return{projectId:null,tierId:null,requiresUserProject:!1,error:a?.message||String(a)}}}function k(a){e.delete(a)}async function l(a,b,c={}){return(await m(a,b,c)).projectId}async function m(a,b,c={}){let e=h(c.preferredProjectId),f=await fetch(d.nZ.loadCodeAssist,{method:"POST",headers:{...d.Ic,Authorization:`Bearer ${a}`},body:JSON.stringify({metadata:d.zv}),signal:b});if(!f.ok){let a=await f.text().catch(()=>"");throw Error(`loadCodeAssist failed: HTTP ${f.status} ${a.slice(0,200)}`)}let g=await f.json(),i=function(a){if(!a)return null;if("string"==typeof a.cloudaicompanionProject){let b=a.cloudaicompanionProject.trim();if(b)return b}if(a.cloudaicompanionProject&&"object"==typeof a.cloudaicompanionProject){let b=a.cloudaicompanionProject.id;if("string"==typeof b&&b.trim())return b.trim()}return null}(g);if(i)return{projectId:i,tierId:o(g).tierId||null,requiresUserProject:!1,loadRaw:g};let j=o(g),k=j.tierId||"free-tier";if(j.userDefined)return e?{projectId:await n(a,k,b,e)||e,tierId:k,requiresUserProject:!0,loadRaw:g,error:void 0}:(console.warn("[ProjectId] GSuite/DASHER has no free-tier project from loadCodeAssist; caller should reuse a stored/peer managed project id."),{projectId:null,tierId:k,requiresUserProject:!0,loadRaw:g,error:"no managed project on account; use stored or peer projectId"});let l=await n(a,k,b,null);return{projectId:l,tierId:k,requiresUserProject:!1,loadRaw:g,error:l?void 0:"onboardUser did not return a project id"}}async function n(a,b,c,e=null){console.log(`[ProjectId] Onboarding user with tier: ${b}`+(e?` project=${e}`:""));let f={tierId:b,metadata:d.zv};e&&(f.cloudaicompanionProject=e);for(let b=1;b<=5&&!c?.aborted;b++){let g=new AbortController,h=setTimeout(()=>g.abort(),3e4),i=()=>g.abort();c?.addEventListener("abort",i);try{let c=await fetch(d.nZ.onboardUser,{method:"POST",headers:{...d.Ic,Authorization:`Bearer ${a}`},body:JSON.stringify(f),signal:g.signal});if(clearTimeout(h),!c.ok){let a=await c.text().catch(()=>"");throw Error(`onboardUser HTTP ${c.status}: ${a.slice(0,200)}`)}let i=await c.json();if(!0===i.done){let a=function(a){if(!a?.response)return null;let b=a.response.cloudaicompanionProject;if("string"==typeof b){let a=b.trim();if(a)return a}if(b&&"object"==typeof b){let a=b.id;if("string"==typeof a&&a.trim())return a.trim()}return null}(i);if(a)return console.log(`[ProjectId] Successfully onboarded, project ID: ${a}`),a;if(e)return console.log(`[ProjectId] onboard done without id; using preferred project ${e}`),e;throw Error("onboardUser done but no project_id in response")}console.log(`[ProjectId] Onboard attempt ${b}/5: not done yet, waiting...`),await new Promise(a=>setTimeout(a,2e3))}catch(a){if(clearTimeout(h),"AbortError"===a.name){if(console.warn(`[ProjectId] onboardUser attempt ${b} aborted (timeout or connection removed)`),c?.aborted)return null;continue}if(5===b)return console.warn(`[ProjectId] onboardUser failed after 5 attempts: ${a.message}`),null;console.warn(`[ProjectId] onboardUser attempt ${b} failed: ${a.message}, retrying...`),await new Promise(a=>setTimeout(a,2e3))}finally{clearTimeout(h),c?.removeEventListener("abort",i)}}return null}function o(a){let b=null,c=!1;if(a?.currentTier?.id&&"string"==typeof a.currentTier.id&&(b=a.currentTier.id.trim(),c=!!a.currentTier.userDefinedCloudaicompanionProject),Array.isArray(a?.allowedTiers)){for(let d of a.allowedTiers)if(d&&"object"==typeof d&&!0===d.isDefault&&d.id){b=String(d.id).trim(),c=!!d.userDefinedCloudaicompanionProject;break}if(!b){let d=a.allowedTiers.find(a=>a?.id==="free-tier");d?(b="free-tier",c=!!d.userDefinedCloudaicompanionProject):a.allowedTiers[0]?.id&&(b=String(a.allowedTiers[0].id).trim(),c=!!a.allowedTiers[0].userDefinedCloudaicompanionProject)}}return"free-tier"===b&&(c=!1),{tierId:b,userDefined:c}}g=setInterval(()=>{try{let a=Date.now();for(let[b,c]of e)(!c||a-c.fetchedAt>=36e5)&&e.delete(b);for(let[b,c]of f){if(!c||"number"!=typeof c.startedAt){f.delete(b);continue}if(a-c.startedAt>12e4){try{c.controller.abort()}catch(a){}f.delete(b)}}}catch(a){console.warn("[ProjectId] cleanup sweep error:",a?.message??a)}},6e5),g?.unref?.()},41902:(a,b,c)=>{c.d(b,{A:()=>d});let d={config:c(92990).OV,flowType:"authorization_code_pkce",buildAuthUrl:(a,b,c,d)=>{let e=new URLSearchParams({code:"true",client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),code_challenge:d,code_challenge_method:a.codeChallengeMethod,state:c});return`${a.authorizeUrl}?${e.toString()}`},exchangeToken:async(a,b,c,d,e)=>{let f=b,g="";if(f.includes("#")){let a=f.split("#");f=a[0],g=a[1]||""}let h=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({code:f,state:g||e,grant_type:"authorization_code",client_id:a.clientId,redirect_uri:c,code_verifier:d})});if(!h.ok){let a=await h.text();throw Error(`Token exchange failed: ${a}`)}return await h.json()},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope})}},45891:(a,b,c)=>{c.d(b,{A:()=>e});var d=c(91365);let e=(0,d.O)(d.$.global)},49475:(a,b,c)=>{c.d(b,{A:()=>e});var d=c(92990);let e={config:d.Nu,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,scope:a.scopes})});if(!b.ok){let a=await b.text();throw Error(`Device code request failed: ${a}`)}return await b.json()},pollToken:async(a,b)=>{let c,d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,device_code:b,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})});try{c=await d.json()}catch(a){c={error:"invalid_response",error_description:await d.text()}}return{ok:d.ok,data:c}},postExchange:async a=>{let b=await fetch(d.Nu.copilotTokenUrl,{headers:{Authorization:`Bearer ${a.access_token}`,Accept:"application/json","X-GitHub-Api-Version":d.Nu.apiVersion,"User-Agent":d.Nu.userAgent}}),c=b.ok?await b.json():{},e=await fetch(d.Nu.userInfoUrl,{headers:{Authorization:`Bearer ${a.access_token}`,Accept:"application/json","X-GitHub-Api-Version":d.Nu.apiVersion,"User-Agent":d.Nu.userAgent}});return{copilotToken:c,userInfo:e.ok?await e.json():{}}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,providerSpecificData:{copilotToken:b?.copilotToken?.token,copilotTokenExpiresAt:b?.copilotToken?.expires_at,githubUserId:b?.userInfo?.id,githubLogin:b?.userInfo?.login,githubName:b?.userInfo?.name,githubEmail:b?.userInfo?.email}})}},56187:(a,b,c)=>{c.d(b,{A:()=>d});let d={config:c(92990).f7,flowType:"authorization_code_pkce",buildAuthUrl:(a,b,c,d,e={})=>{let f=e.baseUrl||a.defaultBaseUrl,g=new URLSearchParams({client_id:e.clientId||"",redirect_uri:b,response_type:"code",state:c,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod});return`${f}${a.authorizeUrlPath}?${g.toString()}`},exchangeToken:async(a,b,c,d,e,f={})=>{let g=f.baseUrl||a.defaultBaseUrl,h=f.clientId||"",i=f.clientSecret||"",j=new URLSearchParams({client_id:h,grant_type:"authorization_code",code:b,redirect_uri:c,code_verifier:d});i&&j.set("client_secret",i);let k=await fetch(`${g}${a.tokenUrlPath}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:j.toString()});if(!k.ok)throw Error(`GitLab token exchange failed: ${await k.text()}`);let l=await k.json(),m=await fetch(`${g}${a.userInfoUrlPath}`,{headers:{Authorization:`Bearer ${l.access_token}`}}),n=m.ok?await m.json():{};return{...l,_user:n,_baseUrl:g,_clientId:h}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,providerSpecificData:{username:a._user?.username||"",email:a._user?.email||a._user?.public_email||"",name:a._user?.name||"",baseUrl:a._baseUrl,clientId:a._clientId,authKind:"oauth"}})}},67096:(a,b,c)=>{c.d(b,{A:()=>d});let d={config:c(92990).MZ,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.initiateUrl,{method:"POST",headers:{"Content-Type":"application/json"}});if(!b.ok){if(429===b.status)throw Error("Too many pending authorization requests. Please try again later.");let a=await b.text();throw Error(`Device auth initiation failed: ${a}`)}let c=await b.json();return{device_code:c.code,user_code:c.code,verification_uri:c.verificationUrl,verification_uri_complete:c.verificationUrl,expires_in:c.expiresIn||300,interval:3}},pollToken:async(a,b)=>{let c=await fetch(`${a.pollUrlBase}/${b}`);if(202===c.status)return{ok:!1,data:{error:"authorization_pending"}};if(403===c.status)return{ok:!1,data:{error:"access_denied",error_description:"Authorization denied by user"}};if(410===c.status)return{ok:!1,data:{error:"expired_token",error_description:"Authorization code expired"}};if(!c.ok)return{ok:!1,data:{error:"poll_failed",error_description:`Poll failed: ${c.status}`}};let d=await c.json();if("approved"===d.status&&d.token){let b=null;try{let c=await fetch(`${a.apiBaseUrl}/api/profile`,{headers:{Authorization:`Bearer ${d.token}`}});if(c.ok){let a=await c.json();b=a.organizations?.[0]?.id||null}}catch{}return{ok:!0,data:{access_token:d.token,_userEmail:d.userEmail,_orgId:b}}}return{ok:!1,data:{error:"authorization_pending"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:null,expiresIn:null,email:a._userEmail,...a._orgId?{providerSpecificData:{orgId:a._orgId}}:{}})}},67377:(a,b,c)=>{function d(a){return{config:a,flowType:"device_code",requestDeviceCode:async a=>{let{QoderService:b}=await c.e(1531).then(c.bind(c,91531)),d=new b(a).initiateDeviceFlow();return{device_code:d.nonce,user_code:d.nonce.slice(0,8).toUpperCase(),verification_uri:a.loginUrl,verification_uri_complete:d.verificationUriComplete,expires_in:300,interval:2,codeVerifier:d.codeVerifier,_qoderNonce:d.nonce,_qoderMachineId:d.machineId}},pollToken:async(a,b,d,e)=>{let f,{QoderService:g}=await c.e(1531).then(c.bind(c,91531)),h=new g(a),i=b||e?._qoderNonce,j=d||e?._qoderVerifier;if(!i||!j)return{ok:!1,data:{error:"invalid_request",error_description:"Missing nonce/verifier"}};try{f=await h.pollDeviceToken({nonce:i,codeVerifier:j})}catch(a){return{ok:!1,data:{error:"poll_failed",error_description:a.message}}}if("pending"===f.status)return{ok:!1,data:{error:"authorization_pending"}};let k=await h.fetchUserInfo(f.accessToken),l=Math.max(86400,Math.floor((f.expireTime-Date.now())/1e3));return{ok:!0,data:{access_token:f.accessToken,refresh_token:f.refreshToken,expires_in:l,_qoderUserId:f.userId,_qoderMachineId:e?._qoderMachineId||"",_qoderName:k.name,_qoderEmail:k.email,_qoderOrganizationId:k.organizationId}}},mapTokens:a=>{let b=(a._qoderEmail||"").trim(),c=(a._qoderName||"").trim()||null,d=a._qoderUserId||"",e=b||(d?`qoder-user-${d}`:null);return{accessToken:a.access_token,refreshToken:a.refresh_token||null,expiresIn:a.expires_in,email:e,displayName:c,providerSpecificData:{authMethod:"device",userId:d,machineId:a._qoderMachineId||"",organizationId:a._qoderOrganizationId||""}}}}}c.d(b,{A:()=>e,N:()=>d});let e=d(c(92990).hF)},67511:(a,b,c)=>{c.d(b,{A:()=>e});var d=c(92990);let e={config:d.Z2,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,scope:a.scope})});if(!b.ok){let a=await b.text();throw Error(`Nous device code request failed: ${a}`)}let c=await b.json();return{device_code:c.device_code,user_code:c.user_code,verification_uri:c.verification_uri,verification_uri_complete:c.verification_uri_complete,expires_in:c.expires_in,interval:c.interval}},pollToken:async(a,b)=>{let c,d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:a.clientId,device_code:b})});try{c=await d.json()}catch{c={error:"invalid_response",error_description:await d.text().catch(()=>"")}}let e=c?.error==="authorization_pending"||c?.error==="slow_down";return{ok:d.ok||e,data:c}},postExchange:async a=>{try{let b=await fetch(d.Z2.agentKeyUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${a.access_token}`},body:JSON.stringify({min_ttl_seconds:7200})});if(!b.ok){let a=await b.text().catch(()=>"");return console.warn(`[oauth] Nous agent key mint failed (${b.status}): ${a}`),{agentKey:null}}let c=await b.json();return{agentKey:c.api_key||null,agentKeyId:c.key_id||null,agentKeyExpiresAt:c.expires_at||null,agentKeyExpiresIn:c.expires_in||null}}catch(a){return console.warn(`[oauth] Nous agent key mint error: ${a?.message||a}`),{agentKey:null}}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,apiKey:b?.agentKey||a.access_token,providerSpecificData:{inferenceBaseUrl:d.Z2.inferenceBaseUrl,...b?.agentKeyId?{agentKeyId:b.agentKeyId}:{},...b?.agentKeyExpiresAt?{agentKeyExpiresAt:b.agentKeyExpiresAt}:{}}})}},67973:(a,b,c)=>{c.d(b,{A:()=>e});var d=c(92990);let e={config:d.Nl,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(`${a.stateUrl}?platform=${a.platform}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":a.domain,"X-No-Authorization":"true","X-No-User-Id":"true","X-No-Enterprise-Id":"true","X-No-Department-Info":"true","X-Product":"SaaS"},body:"{}"});if(!b.ok)throw Error(`CodeBuddy state request failed: ${await b.text()}`);let c=await b.json();if(0!==c.code||!c.data?.state||!c.data?.authUrl)throw Error(`CodeBuddy state error: ${c.msg||"missing state/authUrl"}`);return{device_code:c.data.state,verification_uri:c.data.authUrl,user_code:"",interval:a.pollInterval/1e3,_isCodeBuddy:!0}},pollToken:async(a,b)=>{let c=new URL(a.tokenUrl);c.searchParams.set("state",b);let d=await fetch(c.toString(),{method:"GET",headers:{Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":a.domain,"X-No-Authorization":"true","X-No-User-Id":"true","X-No-Enterprise-Id":"true","X-No-Department-Info":"true","X-Product":"SaaS"}});if(!d.ok)return{ok:!1,data:{error:"request_failed",error_description:await d.text().catch(()=>"")||`${d.status} ${d.statusText}`}};let e=await d.json();return 0===e.code&&e.data?.accessToken?{ok:!0,data:{access_token:e.data.accessToken,refresh_token:e.data.refreshToken||"",token_type:e.data.tokenType||"Bearer",expires_in:e.data.expiresIn,expires_at:e.data.expiresAt,refresh_expires_in:e.data.refreshExpiresIn,refresh_expires_at:e.data.refreshExpiresAt,domain:e.data.domain||a.domain,raw:e.data}}:11217===e.code?{ok:!0,data:{error:"authorization_pending"}}:{ok:!1,data:{error:e.msg||"unknown_error"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in||(a.expires_at?Math.max(1,Math.floor((new Date(a.expires_at).getTime()-Date.now())/1e3)):86400),providerSpecificData:{domain:a.domain||d.Nl.domain,refreshExpiresIn:a.refresh_expires_in,refreshExpiresAt:a.refresh_expires_at,tokenType:a.token_type||"Bearer",rawAuth:a.raw}})}},68446:(a,b,c)=>{c.d(b,{A:()=>d});let d={config:c(92990).WN,flowType:"import_token",mapTokens:a=>({accessToken:a.accessToken,refreshToken:null,expiresIn:a.expiresIn||86400,providerSpecificData:{machineId:a.machineId,authMethod:"imported"}})}},72520:(a,b,c)=>{c.d(b,{A:()=>l,p:()=>j});var d=c(55511),e=c.n(d),f=c(73159);let g=null;function h(a,b){let c,d=String(a||"").trim();if(!d)throw Error(`xai discovery ${b} is empty`);try{c=new URL(d)}catch(a){throw Error(`xai discovery ${b} is invalid: ${a.message}`)}if("https:"!==c.protocol)throw Error(`xai discovery ${b} must use https: ${d}`);let e=c.hostname.toLowerCase().trim();if("x.ai"!==e&&!e.endsWith(".x.ai"))throw Error(`xai discovery ${b} host ${e} is not on x.ai`);return d}async function i(){if(g)return g;try{let a=await fetch(f.oT.discoveryUrl,{headers:{Accept:"application/json"}});if(a.ok){let b=await a.json();return g={authorizeUrl:h(b.authorization_endpoint,"authorization_endpoint"),tokenUrl:h(b.token_endpoint,"token_endpoint")}}}catch{}return g={authorizeUrl:f.oT.authorizeUrl,tokenUrl:f.oT.tokenUrl}}function j(a){if(!a||"string"!=typeof a)return;let b=a.split(".");if(3===b.length)try{let a=b[1].replace(/-/g,"+").replace(/_/g,"/"),c=(k-a.length%k)%k,d=Buffer.from(a+"=".repeat(c),"base64").toString("utf8"),e=JSON.parse(d);return e.email||e.preferred_username||e.sub||void 0}catch{return}}let k=4,l={config:f.oT,flowType:"authorization_code_pkce",fixedPort:f.oT.loopbackPort,callbackPath:f.oT.callbackPath,pkceVerifierBytes:f.Ue,prepareConfig:async a=>{let b=await i();return{...a,authorizeUrl:b.authorizeUrl,tokenUrl:b.tokenUrl}},buildAuthUrl:(a,b,c,d)=>{let f=e().randomBytes(16).toString("hex"),g=Object.entries({response_type:"code",client_id:a.clientId,redirect_uri:b,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod,state:c,nonce:f,plan:"generic",referrer:"cli-proxy-api"}).map(([a,b])=>`${a}=${encodeURIComponent(b)}`).join("&");return`${a.authorizeUrl}?${g}`},exchangeToken:async(a,b,c,d)=>{let e=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,code:b,redirect_uri:c,code_verifier:d})});if(!e.ok){let a=await e.text();throw Error(`xAI token exchange failed: ${a}`)}return await e.json()},mapTokens:a=>{let b={accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope},c=j(a.id_token);return c&&(b.email=c),a.id_token&&(b.providerSpecificData={idToken:a.id_token}),b}}},74177:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{PY:()=>R,exchangeTokens:()=>O,extractCodexAccountInfo:()=>K.Y,kP:()=>N,pollForToken:()=>Q,requestDeviceCode:()=>P,sO:()=>M});var e=c(48895),f=c(13808),g=c(81884),h=c(24336),i=c(13342),j=c(18245),k=c(86857),l=c(31111),m=c(45891),n=c(67511),o=c(67377),p=c(5867),q=c(20386),r=c(41902),s=c(24329),t=c(72520),u=c(220),v=c(79188),w=c(86725),x=c(98287),y=c(49475),z=c(93551),A=c(68446),B=c(88165),C=c(67096),D=c(18941),E=c(35152),F=c(34940),G=c(17691),H=c(56187),I=c(67973),J=c(99799),K=c(34363),L=a([e]);e=(L.then?(await L)():L)[0];let S={claude:r.A,codex:s.A,xai:t.A,"gemini-cli":u.A,antigravity:v.A,iflow:w.A,qoder:o.A,"qoder-cn":p.A,muse:q.A,qwen:x.A,github:y.A,kiro:z.A,cursor:A.A,"kimi-coding":B.A,kilocode:C.A,cline:D.A,clinepass:E.A,"grok-cli":F.A,kimchi:G.A,gitlab:H.A,codebuddy:I.A,"codebuddy-cn":J.A};function M(a){let b=S[a];if(!b)throw Error(`Unknown provider: ${a}`);return b}async function N(a,b,c){let d=M(a),e=d.prepareConfig?await d.prepareConfig(d.config,c||{}):d.config,{codeVerifier:g,codeChallenge:h,state:i}=(0,f.lz)(d.pkceVerifierBytes),j=e.loginTraceID||i,k=e.privateKeyVerifier||g;return{authUrl:"device_code"===d.flowType?null:"authorization_code_pkce"===d.flowType?d.buildAuthUrl(e,b,j,h,c||{}):d.buildAuthUrl(e,b,j,void 0,c||{}),state:j,codeVerifier:k,codeChallenge:h,redirectUri:b,flowType:d.flowType,fixedPort:d.fixedPort,callbackPath:d.callbackPath||"/callback",...e.systemId?{systemId:e.systemId}:{}}}async function O(a,b,c,d,e,f){let g=M(a),h=g.prepareConfig?await g.prepareConfig(g.config,f||{}):g.config,i=await g.exchangeToken(h,b,c,d,e,f||{}),j=null;return g.postExchange&&(j=await g.postExchange(i)),g.mapTokens(i,j)}async function P(a,b,c){let d=M(a);if("codex"!==a&&"device_code"!==d.flowType)throw Error(`Provider ${a} does not support device code flow`);return await d.requestDeviceCode(d.config,b,c||{})}async function Q(a,b,c,d){let e=M(a);if("codex"!==a&&"device_code"!==e.flowType)throw Error(`Provider ${a} does not support device code flow`);let f=await e.pollToken(e.config,b,c,d);if("codex"===a){if(f.pending)return{success:!1,error:"authorization_pending",errorDescription:"Waiting for Codex authorization",pending:!0};if(!f.ok)return{success:!1,error:f.data.error||"device_authorization_failed",errorDescription:f.data.error_description||f.data.message};let a=f.data.authorization_code,b=f.data.code_verifier;if(!a||!b)return{success:!1,error:"invalid_device_response",errorDescription:"Codex device authorization did not return an authorization code"};try{let c=await O("codex",a,e.config.deviceRedirectUri,b);return{success:!0,tokens:c}}catch(a){return{success:!1,error:"token_exchange_failed",errorDescription:a.message}}}if(f.ok)if(f.data.access_token){let b=null;if(e.postExchange)try{b=await e.postExchange(f.data)}catch(b){return console.warn(`[oauth] ${a} postExchange failed:`,b?.message||b),{success:!1,error:"exchange_failed",errorDescription:b.message,fatal:!0}}let c=e.mapTokens(f.data,b);if("kiro"===a&&c.providerSpecificData&&!c.providerSpecificData.profileArn){let a=await (0,z.g)(c.accessToken);a&&(c.providerSpecificData.profileArn=a)}return{success:!0,tokens:c}}else if("authorization_pending"===f.data.error||"slow_down"===f.data.error)return{success:!1,error:f.data.error,errorDescription:f.data.error_description||f.data.message,pending:"authorization_pending"===f.data.error};else return{success:!1,error:f.data.error||"no_access_token",errorDescription:f.data.error_description||f.data.message||"No access token received"};return{success:!1,error:f.data.error,errorDescription:f.data.error_description}}S.kimi=S["kimi-coding"],S.glm=g.A,S.trae=h.A,S.windsurf=i.A,S.zed=j.A,S["codebuddy-intl"]=k.A,S["minimax-code"]=l.A,S["minimax-code-global"]=m.A,S.nous=n.A;let T=!1;async function R(){if(!T){T=!0;try{let{getProviderConnections:a,updateProviderConnection:b}=await Promise.resolve().then(c.bind(c,89718));for(let c of(await a()).filter(a=>{if("codex"!==a.provider||"oauth"!==a.authType||!a.idToken)return!1;let b=!!a.email,c=!!a.providerSpecificData?.chatgptAccountId;return!b||!c})){let a=(0,K.Y)(c.idToken);if(!a.email&&!a.chatgptAccountId)continue;let d={};!c.email&&a.email&&(d.email=a.email),(a.chatgptAccountId||a.chatgptPlanType)&&(d.providerSpecificData={...c.providerSpecificData||{},chatgptAccountId:a.chatgptAccountId,chatgptPlanType:a.chatgptPlanType}),Object.keys(d).length&&await b(c.id,d)}}catch(a){T=!1,console.log("backfillCodexEmails failed:",a?.message||a)}}}d()}catch(a){d(a)}})},79188:(a,b,c)=>{c.d(b,{A:()=>f});var d=c(38160),e=c(92990);let f={config:e.YT,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),state:c,access_type:"offline",prompt:"consent"});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,client_secret:a.clientSecret,code:b,redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Token exchange failed: ${a}`)}return await d.json()},postExchange:async a=>{let b=await fetch(`${e.YT.userInfoUrl}?alt=json`,{headers:{Authorization:`Bearer ${a.access_token}`,"x-request-source":"local"}}),c=b.ok?await b.json():{},f=process.env.ANTIGRAVITY_GCP_PROJECT||process.env.ZEVAI_ANTIGRAVITY_GCP_PROJECT||"",g="";try{let b=await Promise.race([(0,d.gQ)(a.access_token,{preferredProjectId:f||null}),new Promise(a=>setTimeout(()=>a({projectId:null,error:"project resolve timed out"}),2e4))]);(g=b.projectId||f||"")||!b.error||console.warn("[Antigravity OAuth] project resolve:",b.error)}catch(a){console.warn("[Antigravity OAuth] project resolve failed:",a?.message||a)}return{userInfo:c,projectId:g}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,email:b?.userInfo?.email,projectId:b?.projectId})}},81884:(a,b,c)=>{c.d(b,{A:()=>k});var d=c(55511),e=c.n(d);async function f(a,b){let c=await g(a,b),d={Authorization:`Bearer ${c}`,"Content-Type":"application/json"},e=function(a){let b=(Array.isArray(a?.organizations)?a.organizations:[]).map(a=>({organization:a,projects:(a?.projects||[]).filter(a=>"2"!==String(a?.projectType??"").trim())})).filter(({organization:a,projects:b})=>!!(a?.organizationId&&b.length));if(!b.length)return null;let c=b.find(({organization:a})=>i(a.organizationName))||b[0],d=c.projects.find(a=>i(a?.projectName))||c.projects[0];return c.organization?.organizationId&&d?.projectId?{organizationId:c.organization.organizationId,projectId:d.projectId}:null}(await h(`${a.apiBaseUrl}/api/biz/customer/getCustomerInfo`,{headers:d},"customer info"));if(!e)throw Error("Unable to resolve Z.ai organization and project for the coding plan");let f=`${a.apiBaseUrl}/api/biz/v1/organization/${e.organizationId}/projects/${e.projectId}/api_keys`,j=await h(f,{headers:d},"api keys")||[],k=Array.isArray(j)?j.find(b=>b?.name===a.planApiKeyName):null;k||(k=await h(f,{method:"POST",headers:d,body:JSON.stringify({name:a.planApiKeyName})},"api key create"));let l=k?.apiKey?.trim();if(!l)throw Error("Z.ai api_keys response is missing apiKey");let m=await h(`${f}/copy/${encodeURIComponent(l)}`,{headers:d},"api key copy"),n=m?.secretKey?.trim();if(!n)throw Error("Z.ai api key copy response is missing secretKey");return{planApiKey:`${l}.${n}`,businessToken:c}}async function g(a,b){let c=await h(a.businessLoginUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:b})},"Z.ai business login"),d=c?.access_token?.trim()||c?.accessToken?.trim();if(!d)throw Error("Z.ai business login response is missing access_token");return d}async function h(a,b,c){let d,e=await fetch(a,b),f=await e.text();if(!e.ok)throw Error(`Z.ai ${c} request failed (HTTP ${e.status}): ${f.slice(0,200)}`);try{d=JSON.parse(f)}catch{throw Error(`Z.ai ${c} response is not valid JSON`)}if(!j(d?.code)||d?.success===!1)throw Error(d?.msg||`Z.ai ${c} returned business error ${d?.code}`);return d?.data??d??null}function i(a){let b=String(a||"").trim().toLowerCase();return b.includes("默认机构")||b.includes("默认项目")||"default"===b}function j(a){return null==a||0===a||200===a||"0"===a||"200"===a}let k={config:{providerId:"zai",cliInitUrl:"https://zcode.z.ai/api/v1/oauth/cli/init",cliPollUrl:"https://zcode.z.ai/api/v1/oauth/cli/poll",businessLoginUrl:"https://api.z.ai/api/auth/z/login",apiBaseUrl:"https://api.z.ai",planApiKeyName:"zcode-api-key"},flowType:"device_code",requestDeviceCode:async a=>{let b=e().randomBytes(32).toString("hex"),c=await fetch(a.cliInitUrl,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b}`},body:JSON.stringify({provider:a.providerId||"zai"})});if(!c.ok){let a=await c.text();throw Error(`ZCode OAuth init failed: ${a}`)}let d=await c.json();if(!j(d.code)||!d.data)throw Error(d.msg||"ZCode OAuth init returned no data");let f=d.data;if(!f.flow_id||!f.authorize_url)throw Error("ZCode OAuth init response missing flow_id/authorize_url");return{device_code:f.flow_id,verification_uri:f.authorize_url,expires_in:function(a){let b=Number(a);if(!Number.isFinite(b)||b<=0)return null;let c=Math.floor(((b>1e12?b:1e3*b)-Date.now())/1e3);return c>0?c:null}(f.expires_at)??300,interval:f.poll_interval_sec||3,_zcodePollToken:b}},pollToken:async(a,b,c,d)=>{let e=d?._zcodePollToken;if(!e)return{ok:!0,data:{error:"access_denied",error_description:"Missing ZCode poll token — restart the login flow"}};let g=await fetch(`${a.cliPollUrl}/${encodeURIComponent(b)}`,{headers:{Authorization:`Bearer ${e}`}});if(!g.ok)return{ok:!0,data:{error:"access_denied",error_description:`ZCode poll failed (HTTP ${g.status})`}};let h=await g.json();if(!j(h.code))return{ok:!0,data:{error:"access_denied",error_description:h.msg||"ZCode poll failed"}};let i=h.data||{};if("pending"===i.status)return{ok:!0,data:{error:"authorization_pending"}};if("failed"===i.status)return{ok:!0,data:{error:"access_denied",error_description:"ZCode authorization failed or was cancelled"}};if("ready"!==i.status)return{ok:!0,data:{error:"authorization_pending",error_description:`Unknown status: ${i.status}`}};let k=i[a.providerId]||i[i.providerId]||{},l=k.access_token||k.accessToken||i.accessToken||i.access_token;if(!l)return{ok:!0,data:{error:"access_denied",error_description:"ZCode poll response missing access token"}};let{planApiKey:m,businessToken:n}=await f(a,l);return{ok:!0,data:{access_token:m,_zcodeJwtToken:i.token||"",_zaiBusinessToken:n,_zaiRefreshToken:k.refresh_token||k.refreshToken||i.refresh_token||i.refreshToken||"",_zcodeUser:i.user||{}}}},mapTokens:a=>{let b=a._zcodeUser||{},c=b.name||b.email||null;return{accessToken:a.access_token,apiKey:a.access_token,email:b.email||null,...c?{displayName:c}:{},providerSpecificData:{authMethod:"cli_poll",username:b.name||void 0,userId:b.user_id||void 0,zcodeJwtToken:a._zcodeJwtToken||void 0,zaiBusinessToken:a._zaiBusinessToken||void 0,...a._zaiRefreshToken?{zaiRefreshToken:a._zaiRefreshToken}:{}}}}}},86725:(a,b,c)=>{c.d(b,{A:()=>e});var d=c(92990);let e={config:d.ZL,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({loginMethod:a.extraParams.loginMethod,type:a.extraParams.type,redirect:b,state:c,client_id:a.clientId});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=Buffer.from(`${a.clientId}:${a.clientSecret}`).toString("base64"),e=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${d}`},body:new URLSearchParams({grant_type:"authorization_code",code:b,redirect_uri:c,client_id:a.clientId,client_secret:a.clientSecret})});if(!e.ok){let a=await e.text();throw Error(`Token exchange failed: ${a}`)}return await e.json()},postExchange:async a=>{let b=await fetch(`${d.ZL.userInfoUrl}?accessToken=${encodeURIComponent(a.access_token)}`,{headers:{Accept:"application/json"}});if(!b.ok){let a=await b.text();throw Error(`Failed to fetch user info: ${a}`)}let c=await b.json();if(!c.success)throw Error(`User info request failed: ${c.message||"Unknown error"}`);let e=c.data||{};if(!e.apiKey||""===e.apiKey.trim())throw Error("Empty API key returned from iFlow");if(!(e.email?.trim()||e.phone?.trim()))throw Error("Missing account email/phone in user info");return{userInfo:e}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,apiKey:b?.userInfo?.apiKey,email:b?.userInfo?.email||b?.userInfo?.phone,displayName:b?.userInfo?.nickname||b?.userInfo?.name})}},86857:(a,b,c)=>{c.d(b,{A:()=>d});let d={config:c(92990).DV,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(`${a.stateUrl}?platform=${a.platform}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"www.codebuddy.ai","X-No-Authorization":"true","X-No-User-Id":"true","X-Product":"SaaS"},body:"{}"});if(!b.ok)throw Error(`CodeBuddy Intl state request failed: ${await b.text()}`);let c=await b.json();if(0!==c.code||!c.data?.state||!c.data?.authUrl)throw Error(`CodeBuddy Intl state error: ${c.msg||"missing state/authUrl"}`);return{device_code:c.data.state,verification_uri:c.data.authUrl,user_code:"",interval:a.pollInterval/1e3,_isCodeBuddy:!0}},pollToken:async(a,b)=>{let c=await fetch(`${a.tokenUrl}?state=${encodeURIComponent(b)}`,{method:"GET",headers:{Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"www.codebuddy.ai","X-No-Authorization":"true","X-No-User-Id":"true","X-No-Enterprise-Id":"true","X-No-Department-Info":"true","X-Product":"SaaS"}});if(!c.ok)return{ok:!1,data:{error:"request_failed"}};let d=await c.json();return 0===d.code&&d.data?.accessToken?{ok:!0,data:{access_token:d.data.accessToken,refresh_token:d.data.refreshToken||"",token_type:d.data.tokenType||"Bearer",expires_in:d.data.expiresIn}}:11217===d.code?{ok:!0,data:{error:"authorization_pending"}}:{ok:!1,data:{error:d.msg||"unknown_error"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in||86400,providerSpecificData:{}})}},88165:(a,b,c)=>{c.d(b,{A:()=>f});var d=c(55511),e=c.n(d);let f={config:c(92990).t,flowType:"device_code",requestDeviceCode:async a=>{let{buildKimiHeaders:b}=await Promise.resolve().then(c.bind(c,75924)),d=e().randomUUID(),f={"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",...b(d)},g=await fetch(a.deviceCodeUrl,{method:"POST",headers:f,body:new URLSearchParams({client_id:a.clientId})});if(!g.ok){let a=await g.text();throw Error(`Device code request failed: ${a}`)}let h=await g.json(),i="https://www.kimi.com/code/authorize_device";return{device_code:h.device_code,user_code:h.user_code,verification_uri:h.verification_uri||i,verification_uri_complete:h.verification_uri_complete||`${i}?user_code=${h.user_code}`,expires_in:h.expires_in,interval:h.interval||5,_kimiDeviceId:d}},pollToken:async(a,b,d,e)=>{let f,{buildKimiHeaders:g}=await Promise.resolve().then(c.bind(c,75924)),h=e?._kimiDeviceId,i={"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",...g(h)},j=await fetch(a.tokenUrl,{method:"POST",headers:i,body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:a.clientId,device_code:b})});try{f=await j.json()}catch{f={error:"invalid_response",error_description:"non-json token response"}}return"authorization_pending"===f.error||"slow_down"===f.error?{ok:!0,data:f}:(f.access_token&&h&&(f._kimiDeviceId=h),{ok:j.ok||!!f.access_token||!!f.error,data:f})},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,providerSpecificData:{authMethod:"device_code",...a._kimiDeviceId?{deviceId:a._kimiDeviceId}:{}}})}},91365:(a,b,c)=>{c.d(b,{$:()=>h,O:()=>g});let d=(a,b)=>"string"==typeof a?.[b]&&a[b].trim()?a[b].trim():void 0,e=(a,b)=>"number"==typeof a?.[b]&&Number.isFinite(a[b])&&a[b]>0?a[b]:void 0;async function f(a,b){let c,d=await fetch(a,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(b).toString(),signal:AbortSignal.timeout(3e4)});try{c=JSON.parse(await d.text())}catch{}return c&&"object"==typeof c||(c={error:`invalid_json_response (HTTP ${d.status})`}),{status:d.status,body:c}}function g(a){return{config:{clientId:"mcode-public",scope:"agent.default",audience:"agent-backend",deviceUrl:`${a.account}/oauth2/device/code`,tokenUrl:`${a.account}/oauth2/token`},flowType:"device_code",async requestDeviceCode(a,b){let c,g,h;if(!b)throw Error("MiniMax Code sign-in requires a PKCE code challenge");let{status:i,body:j}=await f(a.deviceUrl,{client_id:a.clientId,scope:a.scope,audience:a.audience,code_challenge:b,code_challenge_method:"S256"}),{userCode:k,deviceCode:l,uri:m}={userCode:d(j,"user_code"),deviceCode:d(j,"device_code"),uri:d(j,"verification_uri_complete")??d(j,"verification_uri")??d(j,"verification_url")};if(!k||!m)throw Error(`MiniMax device code response unusable (HTTP ${i})`);let n=!l;return{device_code:l??k,user_code:k,verification_uri:m,expires_in:(c=e(j,"expires_in"),g=e(j,"expired_in"),(c||(g?g<1e12?g:Math.max(1,Math.ceil((g-Date.now())/1e3)):void 0))??600),interval:(h=e(j,"interval"))?n&&h>=60?Math.round(h/1e3):h:5,_minimaxPollByUser:n}},async pollToken(a,b,c,e){if(!b)return{ok:!0,data:{error:"authorization_pending"}};let g={grant_type:"urn:ietf:params:oauth:grant-type:device_code",...e?._minimaxPollByUser?{user_code:b}:{device_code:b},client_id:a.clientId,code_verifier:c},{body:h}=await f(a.tokenUrl,g),i=d(h,"status");return"pending"===i?{ok:!0,data:{error:"authorization_pending"}}:"slow_down"===i?{ok:!0,data:{error:"slow_down"}}:"denied"===i||"access_denied"===i?{ok:!0,data:{error:"access_denied"}}:"expired"===i||"expired_token"===i?{ok:!0,data:{error:"expired_token"}}:i?{ok:!0,data:{error:`unexpected_status:${i}`}}:d(h,"error")?{ok:!0,data:{error:d(h,"error"),error_description:d(h,"error_description")}}:d(h,"access_token")?{ok:!0,data:h}:{ok:!0,data:{error:"no_access_token"}}},mapTokens(a){let b=e(a,"expires_in");return{accessToken:d(a,"access_token"),refreshToken:d(a,"refresh_token")??"",expiresIn:b??3600}}}}let h={cn:{account:"https://account.minimax.cn"},global:{account:"https://account.minimax.io"}}},93551:(a,b,c)=>{c.d(b,{A:()=>f,g:()=>g});var d=c(92990),e=c(34363);let f={config:d.Tx,flowType:"device_code",requestDeviceCode:async(a,b,c={})=>{let d=("string"==typeof c.region?c.region.trim():"")||"us-east-1",e=("string"==typeof c.startUrl?c.startUrl.trim():"")||a.startUrl,f="idc"===c.authMethod?"idc":"builder-id",g=`https://oidc.${d}.amazonaws.com/client/register`,h=`https://oidc.${d}.amazonaws.com/device_authorization`,i=await fetch(g,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientName:a.clientName,clientType:a.clientType,scopes:a.scopes,grantTypes:a.grantTypes,issuerUrl:a.issuerUrl})});if(!i.ok){let a=await i.text();throw Error(`Client registration failed: ${a}`)}let j=await i.json(),k=await fetch(h,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:j.clientId,clientSecret:j.clientSecret,startUrl:e})});if(!k.ok){let a=await k.text();throw Error(`Device authorization failed: ${a}`)}let l=await k.json();return{device_code:l.deviceCode,user_code:l.userCode,verification_uri:l.verificationUri,verification_uri_complete:l.verificationUriComplete,expires_in:l.expiresIn,interval:l.interval||5,_clientId:j.clientId,_clientSecret:j.clientSecret,_region:d,_authMethod:f,_startUrl:e}},pollToken:async(a,b,c,d)=>{let e,f=d?._region||"us-east-1",g=`https://oidc.${f}.amazonaws.com/token`,h=await fetch(g,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:d?._clientId,clientSecret:d?._clientSecret,deviceCode:b,grantType:"urn:ietf:params:oauth:grant-type:device_code"})});try{e=await h.json()}catch(a){e={error:"invalid_response",error_description:await h.text()}}return e.accessToken?{ok:!0,data:{access_token:e.accessToken,refresh_token:e.refreshToken,expires_in:e.expiresIn,profile_arn:e?.profileArn||null,_clientId:d?._clientId,_clientSecret:d?._clientSecret,_region:d?._region,_authMethod:d?._authMethod,_startUrl:d?._startUrl}}:{ok:!1,data:{error:e.error||"authorization_pending",error_description:e.error_description||e.message}}},mapTokens:a=>{let b=(0,e.J)(a.access_token);return{accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,email:b,providerSpecificData:{profileArn:a?.profile_arn||null,clientId:a._clientId,clientSecret:a._clientSecret,region:a._region||"us-east-1",authMethod:a._authMethod||"builder-id",startUrl:a._startUrl||d.Tx.startUrl}}}};async function g(a){if(!a)return null;try{let b=await fetch("https://codewhisperer.us-east-1.amazonaws.com/ListAvailableProfiles",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify({maxResults:10})});if(!b.ok)return null;let c=await b.json();return c.profiles?.find(a=>a.arn?.trim())?.arn?.trim()||null}catch{return null}}},98287:(a,b,c)=>{c.d(b,{A:()=>d});let d={config:c(92990).Hp,flowType:"device_code",requestDeviceCode:async(a,b)=>{let c=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,scope:a.scope,code_challenge:b,code_challenge_method:a.codeChallengeMethod})});if(!c.ok){let a=await c.text();throw Error(`Device code request failed: ${a}`)}return await c.json()},pollToken:async(a,b,c)=>{let d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:a.clientId,device_code:b,code_verifier:c})});return{ok:d.ok,data:await d.json()}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,providerSpecificData:{resourceUrl:a.resource_url}})}},99799:(a,b,c)=>{c.d(b,{A:()=>e});var d=c(92990);let e={config:d.ne,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(`${a.stateUrl}?platform=${a.platform}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":a.domain,"X-No-Authorization":"true","X-No-User-Id":"true","X-No-Enterprise-Id":"true","X-No-Department-Info":"true","X-Product":"SaaS"},body:"{}"});if(!b.ok)throw Error(`CodeBuddy CN state request failed: ${await b.text()}`);let c=await b.json();if(0!==c.code||!c.data?.state||!c.data?.authUrl)throw Error(`CodeBuddy CN state error: ${c.msg||"missing state/authUrl"}`);return{device_code:c.data.state,verification_uri:c.data.authUrl,user_code:"",interval:a.pollInterval/1e3,_isCodeBuddy:!0}},pollToken:async(a,b)=>{let c=new URL(a.tokenUrl);c.searchParams.set("state",b);let d=await fetch(c.toString(),{method:"GET",headers:{Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":a.domain,"X-No-Authorization":"true","X-No-User-Id":"true","X-No-Enterprise-Id":"true","X-No-Department-Info":"true","X-Product":"SaaS"}});if(!d.ok)return{ok:!1,data:{error:"request_failed",error_description:await d.text().catch(()=>"")||`${d.status} ${d.statusText}`}};let e=await d.json();return 0===e.code&&e.data?.accessToken?{ok:!0,data:{access_token:e.data.accessToken,refresh_token:e.data.refreshToken||"",token_type:e.data.tokenType||"Bearer",expires_in:e.data.expiresIn,expires_at:e.data.expiresAt,refresh_expires_in:e.data.refreshExpiresIn,refresh_expires_at:e.data.refreshExpiresAt,domain:e.data.domain||a.domain,raw:e.data}}:11217===e.code?{ok:!0,data:{error:"authorization_pending"}}:{ok:!1,data:{error:e.msg||"unknown_error"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in||(a.expires_at?Math.max(1,Math.floor((new Date(a.expires_at).getTime()-Date.now())/1e3)):86400),providerSpecificData:{domain:a.domain||d.ne.domain,refreshExpiresIn:a.refresh_expires_in,refreshExpiresAt:a.refresh_expires_at,tokenType:a.token_type||"Bearer",rawAuth:a.raw}})}}};