zevairouter 1.1.80 → 1.1.82

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 (608) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/cli/app/.next-cli-build/BUILD_ID +1 -1
  3. package/cli/app/.next-cli-build/app-path-routes-manifest.json +20 -20
  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 +1 -1
  39. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  40. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  41. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  42. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  43. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  44. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  45. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  46. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  47. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  48. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  49. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  50. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  51. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  52. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page.js.nft.json +1 -1
  53. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  54. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  55. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  56. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page.js.nft.json +1 -1
  57. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page_client-reference-manifest.js +1 -1
  58. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  59. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  60. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  61. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  62. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  63. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  64. package/cli/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  65. package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  66. package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
  67. package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  68. package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  69. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  70. package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  71. package/cli/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  72. package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  73. package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
  74. package/cli/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  75. package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  76. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
  77. package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  78. package/cli/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  79. package/cli/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  80. package/cli/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  81. package/cli/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  82. package/cli/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  83. package/cli/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  84. package/cli/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  85. package/cli/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  86. package/cli/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  87. package/cli/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  88. package/cli/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  89. package/cli/app/.next-cli-build/server/app/api/cache/stats/route.js.nft.json +1 -1
  90. package/cli/app/.next-cli-build/server/app/api/changelog/route.js.nft.json +1 -1
  91. package/cli/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +5 -5
  92. package/cli/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  93. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  94. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  95. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  96. package/cli/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  97. package/cli/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  98. package/cli/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
  99. package/cli/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  100. package/cli/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js +2 -2
  101. package/cli/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
  102. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-gateway/accounts/route.js.nft.json +1 -1
  103. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
  104. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +2 -2
  105. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  106. package/cli/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  107. package/cli/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  108. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  109. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  110. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  111. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  112. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  113. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  114. package/cli/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js +2 -2
  115. package/cli/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
  116. package/cli/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  117. package/cli/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  118. package/cli/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +2 -2
  119. package/cli/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  120. package/cli/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  121. package/cli/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  122. package/cli/app/.next-cli-build/server/app/api/cli-tools/dsh-settings/route.js +2 -2
  123. package/cli/app/.next-cli-build/server/app/api/cli-tools/dsh-settings/route.js.nft.json +1 -1
  124. package/cli/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js +2 -2
  125. package/cli/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
  126. package/cli/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +2 -2
  127. package/cli/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  128. package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +1 -1
  129. package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
  130. package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  131. package/cli/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  132. package/cli/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  133. package/cli/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  134. package/cli/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  135. package/cli/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js +2 -2
  136. package/cli/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js.nft.json +1 -1
  137. package/cli/app/.next-cli-build/server/app/api/cli-tools/openbot-settings/route.js +2 -2
  138. package/cli/app/.next-cli-build/server/app/api/cli-tools/openbot-settings/route.js.nft.json +1 -1
  139. package/cli/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
  140. package/cli/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  141. package/cli/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  142. package/cli/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  143. package/cli/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +2 -2
  144. package/cli/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
  145. package/cli/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js +2 -2
  146. package/cli/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js.nft.json +1 -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.nft.json +1 -1
  162. package/cli/app/.next-cli-build/server/app/api/headroom/enable/route.js.nft.json +1 -1
  163. package/cli/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  164. package/cli/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  165. package/cli/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  166. package/cli/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  167. package/cli/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  168. package/cli/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  169. package/cli/app/.next-cli-build/server/app/api/health/ready/route.js.nft.json +1 -1
  170. package/cli/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  171. package/cli/app/.next-cli-build/server/app/api/init/route.js +1 -1
  172. package/cli/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  173. package/cli/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js.nft.json +1 -1
  174. package/cli/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  175. package/cli/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  176. package/cli/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  177. package/cli/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  178. package/cli/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  179. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  180. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +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 +1 -1
  185. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  186. package/cli/app/.next-cli-build/server/app/api/metrics/route.js.nft.json +1 -1
  187. package/cli/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  188. package/cli/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  189. package/cli/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
  190. package/cli/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  191. package/cli/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  192. package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
  193. package/cli/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  194. package/cli/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  195. package/cli/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  196. package/cli/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  197. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/cancel/route.js +1 -1
  198. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  199. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
  200. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  201. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/route.js +1 -1
  202. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/route.js.nft.json +1 -1
  203. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/latest/route.js +1 -1
  204. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/latest/route.js.nft.json +1 -1
  205. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/route.js +1 -1
  206. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/route.js.nft.json +1 -1
  207. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  208. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  209. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/route.js.nft.json +1 -1
  210. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/latest/route.js.nft.json +1 -1
  211. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/route.js.nft.json +1 -1
  212. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  213. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  214. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/route.js.nft.json +1 -1
  215. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/latest/route.js.nft.json +1 -1
  216. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/route.js.nft.json +1 -1
  217. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-token/route.js.nft.json +1 -1
  218. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/quota-cookie/route.js.nft.json +1 -1
  219. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  220. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  221. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/route.js.nft.json +1 -1
  222. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/latest/route.js.nft.json +1 -1
  223. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js.nft.json +1 -1
  224. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-token/route.js.nft.json +1 -1
  225. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/quota-cookie/route.js.nft.json +1 -1
  226. package/cli/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  227. package/cli/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  228. package/cli/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  229. package/cli/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  230. package/cli/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  231. package/cli/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  232. package/cli/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  233. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  234. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  235. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/route.js.nft.json +1 -1
  236. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/latest/route.js.nft.json +1 -1
  237. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  238. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-token/route.js.nft.json +1 -1
  239. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/json-import/route.js.nft.json +1 -1
  240. package/cli/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  241. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  242. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  243. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  244. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  245. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/route.js.nft.json +1 -1
  246. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/latest/route.js.nft.json +1 -1
  247. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/route.js.nft.json +1 -1
  248. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  249. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  250. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  251. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  252. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  253. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  254. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/route.js.nft.json +1 -1
  255. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/latest/route.js.nft.json +1 -1
  256. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/route.js.nft.json +1 -1
  257. package/cli/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  258. package/cli/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  259. package/cli/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
  260. package/cli/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
  261. package/cli/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  262. package/cli/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  263. package/cli/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  264. package/cli/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  265. package/cli/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  266. package/cli/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  267. package/cli/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  268. package/cli/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  269. package/cli/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js.nft.json +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/aistudio/helper/route.js.nft.json +1 -1
  275. package/cli/app/.next-cli-build/server/app/api/providers/aistudio/models/route.js.nft.json +1 -1
  276. package/cli/app/.next-cli-build/server/app/api/providers/bulk-delete/route.js.nft.json +1 -1
  277. package/cli/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  278. package/cli/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  279. package/cli/app/.next-cli-build/server/app/api/providers/cloudflare-ai/discover-models/route.js +1 -1
  280. package/cli/app/.next-cli-build/server/app/api/providers/cloudflare-ai/discover-models/route.js.nft.json +1 -1
  281. package/cli/app/.next-cli-build/server/app/api/providers/codebuddy/discover-models/route.js.nft.json +1 -1
  282. package/cli/app/.next-cli-build/server/app/api/providers/codebuddy-cn/discover-models/route.js.nft.json +1 -1
  283. package/cli/app/.next-cli-build/server/app/api/providers/codebuddy-intl/discover-models/route.js.nft.json +1 -1
  284. package/cli/app/.next-cli-build/server/app/api/providers/flow/import/route.js.nft.json +1 -1
  285. package/cli/app/.next-cli-build/server/app/api/providers/flow/login/[jobId]/route.js.nft.json +1 -1
  286. package/cli/app/.next-cli-build/server/app/api/providers/flow/login/route.js.nft.json +1 -1
  287. package/cli/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +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.nft.json +1 -1
  290. package/cli/app/.next-cli-build/server/app/api/providers/opencode/discover-models/route.js +1 -1
  291. package/cli/app/.next-cli-build/server/app/api/providers/opencode/discover-models/route.js.nft.json +1 -1
  292. package/cli/app/.next-cli-build/server/app/api/providers/openrouter/discover-models/route.js.nft.json +1 -1
  293. package/cli/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  294. package/cli/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  295. package/cli/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +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 +1 -1
  300. package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  301. package/cli/app/.next-cli-build/server/app/api/providers/web-login/route.js +1 -1
  302. package/cli/app/.next-cli-build/server/app/api/providers/web-login/route.js.nft.json +1 -1
  303. package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  304. package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  305. package/cli/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  306. package/cli/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  307. package/cli/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  308. package/cli/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  309. package/cli/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  310. package/cli/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  311. package/cli/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  312. package/cli/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  313. package/cli/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  314. package/cli/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  315. package/cli/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  316. package/cli/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  317. package/cli/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  318. package/cli/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  319. package/cli/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  320. package/cli/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  321. package/cli/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  322. package/cli/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  323. package/cli/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  324. package/cli/app/.next-cli-build/server/app/api/terminal/auth/setup/route.js.nft.json +1 -1
  325. package/cli/app/.next-cli-build/server/app/api/terminal/auth/status/route.js.nft.json +1 -1
  326. package/cli/app/.next-cli-build/server/app/api/terminal/auth/unlock/route.js.nft.json +1 -1
  327. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/input/route.js.nft.json +1 -1
  328. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/resize/route.js.nft.json +1 -1
  329. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/route.js.nft.json +1 -1
  330. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/stream/route.js.nft.json +1 -1
  331. package/cli/app/.next-cli-build/server/app/api/terminal/session/route.js.nft.json +1 -1
  332. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  333. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  334. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  335. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  336. package/cli/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  337. package/cli/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  338. package/cli/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  339. package/cli/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  340. package/cli/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  341. package/cli/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  342. package/cli/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  343. package/cli/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  344. package/cli/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  345. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  346. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  347. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  348. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  349. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  350. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
  351. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
  352. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  353. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  354. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  355. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  356. package/cli/app/.next-cli-build/server/app/api/usage/aggregate/route.js +1 -1
  357. package/cli/app/.next-cli-build/server/app/api/usage/aggregate/route.js.nft.json +1 -1
  358. package/cli/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  359. package/cli/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  360. package/cli/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  361. package/cli/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  362. package/cli/app/.next-cli-build/server/app/api/usage/quota-stream/route.js +1 -1
  363. package/cli/app/.next-cli-build/server/app/api/usage/quota-stream/route.js.nft.json +1 -1
  364. package/cli/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  365. package/cli/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  366. package/cli/app/.next-cli-build/server/app/api/usage/routing-stream/route.js.nft.json +1 -1
  367. package/cli/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  368. package/cli/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  369. package/cli/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  370. package/cli/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  371. package/cli/app/.next-cli-build/server/app/api/v1/audio/music/route.js +1 -1
  372. package/cli/app/.next-cli-build/server/app/api/v1/audio/music/route.js.nft.json +1 -1
  373. package/cli/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  374. package/cli/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  375. package/cli/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  376. package/cli/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  377. package/cli/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  378. package/cli/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  379. package/cli/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  380. package/cli/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  381. package/cli/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  382. package/cli/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  383. package/cli/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  384. package/cli/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  385. package/cli/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  386. package/cli/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  387. package/cli/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
  388. package/cli/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  389. package/cli/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  390. package/cli/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  391. package/cli/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  392. package/cli/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  393. package/cli/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +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.nft.json +1 -1
  413. package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
  414. package/cli/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  415. package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  416. package/cli/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  417. package/cli/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  418. package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  419. package/cli/app/.next-cli-build/server/app/callback.html +1 -1
  420. package/cli/app/.next-cli-build/server/app/callback.rsc +3 -3
  421. package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  422. package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  423. package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +3 -3
  424. package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
  425. package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +3 -3
  426. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +3 -3
  427. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +3 -3
  428. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +1 -1
  429. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  430. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +3 -3
  431. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +3 -3
  432. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +3 -3
  433. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  434. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  435. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +4 -4
  436. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +4 -4
  437. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +4 -4
  438. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  439. package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  440. package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +3 -3
  441. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +3 -3
  442. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +3 -3
  443. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  444. package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
  445. package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +3 -3
  446. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +3 -3
  447. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +3 -3
  448. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +1 -1
  449. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  450. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +3 -3
  451. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +3 -3
  452. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +3 -3
  453. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  454. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  455. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +3 -3
  456. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +3 -3
  457. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +3 -3
  458. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  459. package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  460. package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +4 -4
  461. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +4 -4
  462. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +4 -4
  463. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  464. package/cli/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
  465. package/cli/app/.next-cli-build/server/app/dashboard/playground.rsc +3 -3
  466. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +3 -3
  467. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +3 -3
  468. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +1 -1
  469. package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  470. package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +3 -3
  471. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +3 -3
  472. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +3 -3
  473. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  474. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  475. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +3 -3
  476. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +3 -3
  477. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +3 -3
  478. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  479. package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  480. package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +4 -4
  481. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +4 -4
  482. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +4 -4
  483. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  484. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  485. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +3 -3
  486. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +3 -3
  487. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +3 -3
  488. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  489. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  490. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +3 -3
  491. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +3 -3
  492. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +3 -3
  493. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  494. package/cli/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  495. package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +3 -3
  496. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  497. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +3 -3
  498. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  499. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  500. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  501. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +3 -3
  502. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  503. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  504. package/cli/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  505. package/cli/app/.next-cli-build/server/app/dashboard/skills.rsc +3 -3
  506. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +3 -3
  507. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +3 -3
  508. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  509. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  510. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.rsc +3 -3
  511. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +3 -3
  512. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +3 -3
  513. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  514. package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  515. package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +3 -3
  516. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +3 -3
  517. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +3 -3
  518. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  519. package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  520. package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +3 -3
  521. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +3 -3
  522. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +3 -3
  523. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  524. package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
  525. package/cli/app/.next-cli-build/server/app/dashboard.rsc +3 -3
  526. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +3 -3
  527. package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +3 -3
  528. package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  529. package/cli/app/.next-cli-build/server/app/index.html +1 -1
  530. package/cli/app/.next-cli-build/server/app/index.rsc +3 -3
  531. package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  532. package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  533. package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  534. package/cli/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  535. package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  536. package/cli/app/.next-cli-build/server/app/landing.html +1 -1
  537. package/cli/app/.next-cli-build/server/app/landing.rsc +3 -3
  538. package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  539. package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  540. package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +3 -3
  541. package/cli/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  542. package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  543. package/cli/app/.next-cli-build/server/app/login.html +1 -1
  544. package/cli/app/.next-cli-build/server/app/login.rsc +3 -3
  545. package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +3 -3
  546. package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  547. package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +3 -3
  548. package/cli/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  549. package/cli/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  550. package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  551. package/cli/app/.next-cli-build/server/app/provider-icons/[provider]/route.js.nft.json +1 -1
  552. package/cli/app/.next-cli-build/server/app/skills/[skill]/SKILL.md/route.js.nft.json +1 -1
  553. package/cli/app/.next-cli-build/server/app-paths-manifest.json +20 -20
  554. package/cli/app/.next-cli-build/server/chunks/1283.js +1 -1
  555. package/cli/app/.next-cli-build/server/chunks/1350.js +1 -1
  556. package/cli/app/.next-cli-build/server/chunks/1509.js +1 -1
  557. package/cli/app/.next-cli-build/server/chunks/1757.js +1 -1
  558. package/cli/app/.next-cli-build/server/chunks/1852.js +1 -1
  559. package/cli/app/.next-cli-build/server/chunks/2025.js +1 -1
  560. package/cli/app/.next-cli-build/server/chunks/267.js +1 -1
  561. package/cli/app/.next-cli-build/server/chunks/2990.js +1 -1
  562. package/cli/app/.next-cli-build/server/chunks/3792.js +1 -1
  563. package/cli/app/.next-cli-build/server/chunks/3815.js +1 -1
  564. package/cli/app/.next-cli-build/server/chunks/412.js +1 -1
  565. package/cli/app/.next-cli-build/server/chunks/4128.js +1 -1
  566. package/cli/app/.next-cli-build/server/chunks/4177.js +1 -1
  567. package/cli/app/.next-cli-build/server/chunks/4549.js +1 -1
  568. package/cli/app/.next-cli-build/server/chunks/4631.js +1 -0
  569. package/cli/app/.next-cli-build/server/chunks/4730.js +1 -1
  570. package/cli/app/.next-cli-build/server/chunks/5024.js +1 -1
  571. package/cli/app/.next-cli-build/server/chunks/5330.js +4 -4
  572. package/cli/app/.next-cli-build/server/chunks/5626.js +1 -1
  573. package/cli/app/.next-cli-build/server/chunks/5728.js +3 -1
  574. package/cli/app/.next-cli-build/server/chunks/5744.js +1 -1
  575. package/cli/app/.next-cli-build/server/chunks/6166.js +1 -1
  576. package/cli/app/.next-cli-build/server/chunks/6396.js +1 -1
  577. package/cli/app/.next-cli-build/server/chunks/6492.js +1 -1
  578. package/cli/app/.next-cli-build/server/chunks/6936.js +1 -1
  579. package/cli/app/.next-cli-build/server/chunks/7135.js +1 -1
  580. package/cli/app/.next-cli-build/server/chunks/7319.js +23 -21
  581. package/cli/app/.next-cli-build/server/chunks/7364.js +1 -1
  582. package/cli/app/.next-cli-build/server/chunks/7404.js +1 -1
  583. package/cli/app/.next-cli-build/server/chunks/8517.js +1 -1
  584. package/cli/app/.next-cli-build/server/chunks/8725.js +1 -1
  585. package/cli/app/.next-cli-build/server/chunks/8749.js +1 -1
  586. package/cli/app/.next-cli-build/server/chunks/9548.js +1 -1
  587. package/cli/app/.next-cli-build/server/chunks/9618.js +1 -1
  588. package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  589. package/cli/app/.next-cli-build/server/pages/404.html +1 -1
  590. package/cli/app/.next-cli-build/server/pages/500.html +1 -1
  591. package/cli/app/.next-cli-build/server/preview-props.json +3 -3
  592. package/cli/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  593. package/cli/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  594. package/cli/app/.next-cli-build/static/chunks/{5497-71a02c6639ddb92b.js → 5497-44af6e5aafe6256a.js} +1 -1
  595. package/cli/app/.next-cli-build/static/chunks/620-2e48912d07143146.js +1 -0
  596. package/cli/app/.next-cli-build/static/chunks/{7001-da01aaca36365276.js → 7001-8bbc6a14335afd88.js} +1 -1
  597. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-936f29821afd7d28.js → page-342ac0d9d2fb15c7.js} +1 -1
  598. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-808e3749cba268ff.js +1 -0
  599. package/cli/app/CHANGELOG.md +15 -0
  600. package/cli/app/package.json +1 -1
  601. package/cli/app/src/mitm/server.js +1 -1
  602. package/cli/package.json +1 -1
  603. package/package.json +1 -1
  604. package/cli/app/.next-cli-build/server/chunks/8972.js +0 -1
  605. package/cli/app/.next-cli-build/static/chunks/620-0f6bd4f59fa0cd33.js +0 -1
  606. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-926a39b841570eda.js +0 -1
  607. /package/cli/app/.next-cli-build/static/{Vbe_S3ECwU1yAXUWqmRCl → IRiQfFU12MuWje_S9vQv0}/_buildManifest.js +0 -0
  608. /package/cli/app/.next-cli-build/static/{Vbe_S3ECwU1yAXUWqmRCl → IRiQfFU12MuWje_S9vQv0}/_ssgManifest.js +0 -0
@@ -1 +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}})}}};
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){if(410!==b.status){let a=await b.text().catch(()=>"");console.warn(`[oauth] Nous agent key mint failed (${b.status}): ${a}`)}else await b.body?.cancel?.().catch(()=>{});return{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)=>{let c=null;try{let b=String(a.access_token||"").split(".");if(b.length>=2){let a=JSON.parse(Buffer.from(b[1],"base64url").toString("utf8"));c=a?.email||null}}catch{}return{accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,...c?{email:c}:{},...b?.agentKey?{apiKey:b.agentKey}:{},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}})}}};