zevairouter 1.1.74 → 1.1.75

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 (235) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/cli/app/.next-cli-build/BUILD_ID +1 -1
  3. package/cli/app/.next-cli-build/app-path-routes-manifest.json +18 -18
  4. package/cli/app/.next-cli-build/build-manifest.json +2 -2
  5. package/cli/app/.next-cli-build/prerender-manifest.json +3 -3
  6. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page_client-reference-manifest.js +1 -1
  7. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  8. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  9. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  10. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  11. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  12. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page_client-reference-manifest.js +1 -1
  13. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  14. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  15. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  16. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  17. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  18. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  19. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  20. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  21. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  22. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  23. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  24. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  25. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  26. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  27. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  28. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  29. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  30. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  31. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  32. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page_client-reference-manifest.js +1 -1
  33. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  34. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  35. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  36. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  37. package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  38. package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
  39. package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  40. package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  41. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  42. package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  43. package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  44. package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
  45. package/cli/app/.next-cli-build/server/app/_not-found.rsc +2 -2
  46. package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +2 -2
  47. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  48. package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  49. package/cli/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +5 -5
  50. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  51. package/cli/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  52. package/cli/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  53. package/cli/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js +2 -2
  54. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  55. package/cli/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  56. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  57. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  58. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  59. package/cli/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js +2 -2
  60. package/cli/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  61. package/cli/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +1 -1
  62. package/cli/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  63. package/cli/app/.next-cli-build/server/app/api/cli-tools/dsh-settings/route.js +2 -2
  64. package/cli/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js +2 -2
  65. package/cli/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
  66. package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
  67. package/cli/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  68. package/cli/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  69. package/cli/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js +2 -2
  70. package/cli/app/.next-cli-build/server/app/api/cli-tools/openbot-settings/route.js +3 -3
  71. package/cli/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  72. package/cli/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  73. package/cli/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +2 -2
  74. package/cli/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js +2 -2
  75. package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
  76. package/cli/app/.next-cli-build/server/app/api/providers/opencode/discover-models/route.js +1 -1
  77. package/cli/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  78. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  79. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  80. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  81. package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
  82. package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  83. package/cli/app/.next-cli-build/server/app/callback.html +1 -1
  84. package/cli/app/.next-cli-build/server/app/callback.rsc +2 -2
  85. package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +2 -2
  86. package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  87. package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +2 -2
  88. package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
  89. package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +2 -2
  90. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +2 -2
  91. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +2 -2
  92. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +1 -1
  93. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  94. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +2 -2
  95. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  96. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +2 -2
  97. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  98. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  99. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +2 -2
  100. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  101. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +2 -2
  102. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  103. package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  104. package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +2 -2
  105. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  106. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +2 -2
  107. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  108. package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
  109. package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +2 -2
  110. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +2 -2
  111. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +2 -2
  112. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +1 -1
  113. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  114. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +2 -2
  115. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  116. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +2 -2
  117. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  118. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  119. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +2 -2
  120. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  121. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +2 -2
  122. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  123. package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  124. package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +2 -2
  125. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  126. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +2 -2
  127. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  128. package/cli/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
  129. package/cli/app/.next-cli-build/server/app/dashboard/playground.rsc +2 -2
  130. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +2 -2
  131. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +2 -2
  132. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +1 -1
  133. package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  134. package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +2 -2
  135. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  136. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +2 -2
  137. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  138. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  139. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +2 -2
  140. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  141. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +2 -2
  142. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  143. package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  144. package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +2 -2
  145. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  146. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +2 -2
  147. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  148. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  149. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +2 -2
  150. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  151. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +2 -2
  152. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  153. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  154. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +2 -2
  155. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  156. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +2 -2
  157. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  158. package/cli/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  159. package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +2 -2
  160. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +2 -2
  161. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +2 -2
  162. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  163. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  164. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +2 -2
  165. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
  166. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +2 -2
  167. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  168. package/cli/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  169. package/cli/app/.next-cli-build/server/app/dashboard/skills.rsc +2 -2
  170. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  171. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +2 -2
  172. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  173. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  174. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.rsc +2 -2
  175. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  176. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +2 -2
  177. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  178. package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  179. package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +2 -2
  180. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  181. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +2 -2
  182. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  183. package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  184. package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +2 -2
  185. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  186. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +2 -2
  187. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  188. package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
  189. package/cli/app/.next-cli-build/server/app/dashboard.rsc +2 -2
  190. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  191. package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +2 -2
  192. package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  193. package/cli/app/.next-cli-build/server/app/index.html +1 -1
  194. package/cli/app/.next-cli-build/server/app/index.rsc +2 -2
  195. package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  196. package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +2 -2
  197. package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  198. package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  199. package/cli/app/.next-cli-build/server/app/landing.html +1 -1
  200. package/cli/app/.next-cli-build/server/app/landing.rsc +2 -2
  201. package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +2 -2
  202. package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  203. package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  204. package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  205. package/cli/app/.next-cli-build/server/app/login.html +1 -1
  206. package/cli/app/.next-cli-build/server/app/login.rsc +2 -2
  207. package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +2 -2
  208. package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  209. package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  210. package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  211. package/cli/app/.next-cli-build/server/app-paths-manifest.json +18 -18
  212. package/cli/app/.next-cli-build/server/chunks/1350.js +1 -1
  213. package/cli/app/.next-cli-build/server/chunks/1757.js +1 -1
  214. package/cli/app/.next-cli-build/server/chunks/267.js +1 -1
  215. package/cli/app/.next-cli-build/server/chunks/412.js +2 -2
  216. package/cli/app/.next-cli-build/server/chunks/5330.js +11 -11
  217. package/cli/app/.next-cli-build/server/chunks/5626.js +1 -1
  218. package/cli/app/.next-cli-build/server/chunks/5744.js +1 -1
  219. package/cli/app/.next-cli-build/server/chunks/6166.js +1 -1
  220. package/cli/app/.next-cli-build/server/chunks/7135.js +1 -1
  221. package/cli/app/.next-cli-build/server/chunks/7319.js +20 -20
  222. package/cli/app/.next-cli-build/server/chunks/7364.js +1 -1
  223. package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  224. package/cli/app/.next-cli-build/server/pages/404.html +1 -1
  225. package/cli/app/.next-cli-build/server/pages/500.html +1 -1
  226. package/cli/app/.next-cli-build/server/preview-props.json +3 -3
  227. package/cli/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  228. package/cli/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  229. package/cli/app/.next-cli-build/static/chunks/{620-e3de3e0ee39ffc1b.js → 620-5dcb9cde7ac3a657.js} +1 -1
  230. package/cli/app/CHANGELOG.md +5 -0
  231. package/cli/app/package.json +1 -1
  232. package/cli/package.json +1 -1
  233. package/package.json +1 -1
  234. /package/cli/app/.next-cli-build/static/{zzddPjINdHZRTO-AqhKd4 → Un7-kxqLQqw_hcB3wU7vf}/_buildManifest.js +0 -0
  235. /package/cli/app/.next-cli-build/static/{zzddPjINdHZRTO-AqhKd4 → Un7-kxqLQqw_hcB3wU7vf}/_ssgManifest.js +0 -0
@@ -216,7 +216,7 @@ ${d}`:d}(d[c].content,e,a);g.length>=f||(d[c]={...d[c],content:g},h-=f-g.length,
216
216
 
217
217
  `),{emit:d,phaseBefore:c,phase:a.phase}}(g,b).emit)w(a)}};p();try{for(;;){let a=await Promise.race([j.read(),n,q]);if(a.done)break;if(a.value&&(g.bytes+=a.value.byteLength||a.value.length||0,p(),v(i.push(a.value)),g.loopDetected)){h(`loop detected; cutting stream (reasoning_chars=${g.reasoning.length})`),await j.cancel(ab("repetition_loop","model repetition loop detected")).catch(()=>{});break}}v(i.end())}finally{clearTimeout(d),o.signal.removeEventListener("abort",r);try{j.releaseLock()}catch{}}let x=function(a,b){let c=E(a),d={reasoning:a.reasoning,content:a.content,tools:c,upstreamFinish:a.finish,malformed:a.malformed};if(a.loopDetected&&!a.finish){if(H(a))return{...d,action:"promote_tool",finish:"tool_calls",chunks:[u("tool_calls"),m]};let b=C(a.content)?"stop":l;return{...d,action:"loop_cutoff",finish:b,chunks:[u(b),m]}}if(G(a)){if("recover"===b&&a.reasoning.length)return{...d,action:"recover",finish:a.finish,chunks:[]};if("terminal"===b||"recover"===b)return{...d,action:"terminal",finish:l,chunks:function(a){let b=[],c=!1;for(let d of a.held)if(!d.done)if(d.json?.choices?.[0]?.finish_reason){let a=structuredClone(d.json);a.choices[0].finish_reason=l,a.choices[0].delta&&delete a.choices[0].delta.content,b.push(t(a)),c=!0}else d.raw&&!d.malformed&&b.push(`${d.raw}
218
218
 
219
- `);return c||b.push(u(l)),b.push(m),b}(a)}}if(H(a))return{...d,action:"promote_tool",finish:"tool_calls",chunks:I(a,"tool_calls")};if(!a.finish&&!a.sawDone&&("waiting"!==a.phase||a.upstreamError)){let b=a.upstreamError?"upstream_rejected":"network_error";return{...d,action:b,finish:b,chunks:[u(b),m]}}return{...d,action:"forward",finish:a.finish,chunks:I(a,null)}}(g,b);if("recover"!==x.action)for(let a of x.chunks)w(a);return h(`finish upstream=${g.finish||"-"} action=${x.action} reasoning_chars=${g.reasoning.length} content_chars=${g.content.length} tools=${E(g).length}`),{turn:g,fin:x}}},cancel(a){p=!0,clearInterval(r),o.abort(a||ab("client_abort","client closed"))}},{highWaterMark:16384}),{status:200,headers:{...aa}})}({up:F,reqBody:L,opts:J,getToken:d,releaseToken:e,call:Q,signal:g,rlog:K,headersTimeoutMs:O,calls:()=>P}):am({up:F,reqBody:L,opts:J,getToken:d,releaseToken:e,call:Q,signal:g,rlog:K,headersTimeoutMs:O,calls:()=>P}):(K(`upstream status=${F.status} bytes=${(F.text||"").length}`),new Response(F.text||JSON.stringify({error:{message:`NVIDIA HTTP ${F.status}`}}),{status:F.status||502,headers:{...F.headers||{},"Content-Type":"application/json"}}))}async function al({call:a,body:b,timeoutMs:c,signal:d,getTokenFn:e,rlog:f}){let g=await e(),h=await a(g,b,c);return h.retry&&!d?.aborted&&(f("recovery 400 token_rejected; retrying with a fresh token"),g=await e({fresh:!0}),h=await a(g,b,c)),h}async function am({up:a,reqBody:b,opts:c,getToken:d,releaseToken:e,call:f,signal:g,rlog:h,headersTimeoutMs:i,calls:j}){let k;try{k=await aj(a.r,g,c.streamIdleMs)}catch(a){if(g?.aborted)throw ad(g);return ac(a?.code==="stream_idle"?504:502,w(a?.message||"upstream read failed"))}let l=null;try{l=JSON.parse(k)}catch{l=null}if(!l)return k&&k.trim()?ac(502,"upstream returned invalid JSON"):ac(502,"upstream returned empty body");let m=c.recoveryAttempts>0?"recover":"forward",n=J(l,m),o=c.recoveryAttempts,p=b,q=l;for(;"recover"===n.action&&o>0&&!g?.aborted;){let a,b;o--;let j=x(p,n.turn.reasoning);h(`recovery attempt=${c.recoveryAttempts-o} effort=${j.effort}`);try{a=await al({call:f,body:j.body,timeoutMs:i??c.headersTimeoutMs,signal:g,getTokenFn:a=>ae(d(a),g,e),rlog:h})}catch(b){if(g?.aborted)throw ad(g);a=null}if(!a||!a.r){n=J(q,"terminal");break}try{b=await aj(a.r,g,c.streamIdleMs)}catch(a){if(g?.aborted)throw ad(g);n=J(q,"terminal");break}let k=null;try{k=JSON.parse(b)}catch{k=null}if(!k){n=J(q,"terminal");break}n=J(k,m=o>0?"recover":"terminal"),p=j.body,q=k}return"recover"===n.action&&(n=J(q,"terminal")),h(`summary transport=json action=${n.action} upstream_calls=${j()}`),new Response(JSON.stringify(n.json),{status:200,headers:{"Content-Type":"application/json"}})}function an(a,b){let c=process.env[a];if(void 0===c||""===String(c).trim())return b;let d=Number(c);return Number.isFinite(d)&&d>=0?Math.floor(d):b}let ao={acquire:(a,b)=>(0,e.qG)(a,b),release:a=>(0,e.zD)(a),pin:a=>(0,e.Ty)(a),unpin:a=>(0,e.oC)(a),recycle:a=>(0,e.WO)(a),sampleCpu:()=>(0,e.Px)()},ap=null;class aq extends d.Hv{constructor({pool:a=null,fetchFn:b=null}={}){super("nvidia-build",{id:"nvidia-build",baseUrl:g,maxRetries:0,retrySameCredential429:!1}),this._pool=a,this._fetch=b}get pool(){return this._pool||(ap??=new U({browser:ao,options:{idleMs:an("NVIDIA_BUILD_IDLE_MS",3e5),refillWindowMs:an("NVIDIA_BUILD_REFILL_WINDOW_MS",6e4),target:Math.max(0,an("NVIDIA_BUILD_POOL_TARGET",1)),mintTimeoutMs:an("NVIDIA_BUILD_MINT_TIMEOUT_MS",3e4),recycleAfter:Math.max(1,an("NVIDIA_BUILD_RECYCLE_AFTER",4))}}))}parseError(a,b){let c,d=a?.status||502,e=b||`Upstream error: ${d}`;try{let a=JSON.parse(b),c=a?.error?.message||a?.detail||a?.message;"string"==typeof c&&c.trim()&&(e=c)}catch{}let f=a?.headers?.get?.("retry-after")||a?.headers?.get?.("x-ratelimit-reset");if(f&&(429===d||503===d)){let a=Number(f);if(Number.isFinite(a)&&a>0)c=Date.now()+1e3*a;else{let a=Date.parse(f);Number.isFinite(a)&&a>Date.now()&&(c=a)}}let g=400===d?"invalid_request":401===d?"authentication":429===d?"rate_limited":d>=500?"upstream_transient":void 0;return{status:d,message:e,...Number.isFinite(c)?{resetsAtMs:c}:{},...g?{failureClass:g}:{}}}async testConnection(a){try{return Z(Y(W(a)))}catch{return!1}}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:k,proxyOptions:l=null}){let m=(a,c={})=>({response:a,url:g,headers:{},transformedBody:b,...c}),n=Y(W(d));if(!n.length||!Z(n))return m(ac(401,"no credentials: NVIDIA build cookies missing or unreadable","authentication_error"),{retryable:!1});let o={key:function(a,b=null){if(b)return`nvidia-build:${String(b).slice(0,36)}`;let c=a.map(a=>`${a.domain}|${a.name}=${a.value}`).sort().join("\n");return`nvidia-build:${(0,j.createHash)("sha256").update(c).digest("hex").slice(0,16)}`}(n,d?.connectionId),cookies:n},p=function(a){let b="string"==typeof a?a.trim():"";i[b=b.replace(/\([^()]+\)\s*$/,"").trim()]&&(b=i[b]);let c=h[b]?b:"moonshotai/kimi-k3.1-pro",{artifact:d}=h[c];return{id:c,artifact:d,apiUrl:`${g}/${d}`,known:c===b}}(a||b?.model),q=this.pool,r=this._fetch||((a,b)=>(0,$.Fm)(a,b,{...l,singleTransportAttempt:!0}));try{let a=await ak({body:b,stream:c,modelInfo:p,signal:e,log:k,fetchFn:r,getToken:a=>q.getToken(o,a),releaseToken:a=>q.releaseToken(o,a),options:{forceEffort:process.env.NVIDIA_BUILD_EFFORT||"",recoveryAttempts:an("NVIDIA_BUILD_REASONING_RECOVERY",2),heartbeatMs:an("NVIDIA_BUILD_HEARTBEAT_MS",15e3),upstream5xxRetries:an("NVIDIA_BUILD_UPSTREAM_5XX_RETRY",1),headersTimeoutMs:an("NVIDIA_BUILD_HEADERS_TIMEOUT_MS",6e5),streamIdleMs:an("NVIDIA_BUILD_STREAM_IDLE_MS",6e5),toolDedupMinChars:an("NVIDIA_BUILD_TOOL_DEDUP_MIN_CHARS",void 0),toolHistoryMaxChars:an("NVIDIA_BUILD_TOOL_HISTORY_MAX_CHARS",void 0),toolHistoryProtectLast:an("NVIDIA_BUILD_TOOL_HISTORY_PROTECT_LAST",void 0)}});return 401===a.status&&q.close(o.key,"session-expired"),m(a)}catch(b){if(e?.aborted)throw b;let a=b instanceof Error?b.message:"nvidia-build failed";if((0,f.BE)(a))return m(ac(503,"NVIDIA Build needs a Chromium binary. Run `npx playwright-core install chromium-headless-shell` or set ZEVAI_BROWSER_BIN."),{retryable:!1});if(b instanceof M)return q.close(o.key,"session-expired"),m(ac(401,a,"authentication_error"),{retryable:!1});return m(ac(b?.status||502,a))}}}},42946:(a,b,c)=>{"use strict";c.d(b,{Az:()=>h,F5:()=>i,fO:()=>k,tV:()=>g});var d=c(55511),e=c(48991);function f(a){return"string"!=typeof a?null:a.replace(/^claude:/i,"").trim()||null}function g(a){if("string"!=typeof a||!a)return null;if("{"===a[0])try{return f(JSON.parse(a)?.session_id)}catch{return null}return f(a)}function h(a){let b=a.tools;if(!b||0===b.length)return{body:a,toolNameMap:null};let c=a=>`${a}${e.uR}`,d=new Map,f=new Set,g=[];for(let a of b){let b=c(a.name);d.set(b,a.name),f.add(a.name),g.push({...a,name:b})}let h=[...g,...j],i=a.messages?.map(a=>{if(!Array.isArray(a.content))return a;let b=a.content.map(a=>"tool_use"===a.type?{...a,name:c(a.name)}:a);return{...a,content:b}}),k={...a,tools:h,messages:i||a.messages};return a.tool_choice?.type==="tool"&&f.has(a.tool_choice.name)&&(k.tool_choice={...a.tool_choice,name:c(a.tool_choice.name)}),{body:k,toolNameMap:d.size>0?d:null}}function i(a,b){if(!a||"object"!=typeof a||"content_block_start"!==a.type)return a;let c=a.content_block;if(c?.type!=="tool_use"||"string"!=typeof c.name)return a;let d=function(a,b){if("string"!=typeof a)return null;if(b?.has(a))return b.get(a);if("string"!=typeof a||!a.endsWith(e.uR)||e.dw.has(a))return null;let c=a.slice(0,-e.uR.length);return c.length>0?c:null}(c.name,b);return d&&d!==c.name?{...a,content_block:{...c,name:d}}:a}let j=[{name:"Task",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"TaskOutput",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"TaskStop",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"TaskCreate",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"TaskGet",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"TaskUpdate",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"TaskList",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"Bash",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"Glob",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"Grep",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"Read",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"Edit",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"Write",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"NotebookEdit",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"WebFetch",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"WebSearch",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"AskUserQuestion",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"Skill",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"EnterPlanMode",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"ExitPlanMode",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}}];function k(a,b,c){let e,g,h,i,j,k;if(!b||!b.includes("sk-ant-oat"))return a;let l={...a},m={type:"text",text:(e=JSON.stringify(a),g=(0,d.createHash)("sha256").update(e).digest("hex").slice(0,5),h=(0,d.randomBytes)(2).toString("hex").slice(0,3),`x-anthropic-billing-header: cc_version=2.1.92.${h}; cc_entrypoint=sdk-cli; cch=${g};`)};return Array.isArray(l.system)?l.system[0]?.text?.startsWith("x-anthropic-billing-header:")||(l.system=[m,...l.system]):"string"==typeof l.system?l.system=[m,{type:"text",text:l.system}]:l.system=[m],l.metadata?.user_id||(l.metadata={...l.metadata,user_id:(i=(0,d.randomBytes)(32).toString("hex"),j=(0,d.randomUUID)(),k=f(c)||(0,d.randomUUID)(),`{"device_id":"${i}","account_uuid":"${j}","session_id":"${k}"}`)}),l}},43086:(a,b,c)=>{"use strict";let d=c(5318),{kClose:e,kDestroy:f,kClosed:g,kDestroyed:h,kDispatch:i,kNoProxyAgent:j,kHttpProxyAgent:k,kHttpsProxyAgent:l}=c(49176),m=c(48841),n=c(37417),o={"http:":80,"https:":443};class p extends d{#a7=null;#a8=null;#E=null;constructor(a={}){super(a),this.#E=a;let{httpProxy:b,httpsProxy:c,noProxy:d,...e}=a;this[j]=new n(e);let f=b??process.env.http_proxy??process.env.HTTP_PROXY;f?this[k]=new m({...e,uri:f}):this[k]=this[j];let g=c??process.env.https_proxy??process.env.HTTPS_PROXY;g?this[l]=new m({...e,uri:g}):this[l]=this[k],this.#a9()}[i](a,b){let c=new URL(a.origin);return this.#ba(c).dispatch(a,b)}[e](){return Promise.all([this[j].close(),!this[k][g]&&this[k].close(),!this[l][g]&&this[l].close()])}[f](a){return Promise.all([this[j].destroy(a),!this[k][h]&&this[k].destroy(a),!this[l][h]&&this[l].destroy(a)])}#ba(a){let{protocol:b,host:c,port:d}=a;return((c=c.replace(/:\d*$/,"").replace(/^\[(.+)\]$/,"$1").toLowerCase()).length>1&&46===c.charCodeAt(c.length-1)&&(c=c.slice(0,-1)),d=Number.parseInt(d,10)||o[b]||0,this.#bb(c,d))?"https:"===b?this[l]:this[k]:this[j]}#bb(a,b){if(this.#bc&&this.#a9(),0===this.#a8.length)return!0;for(let c=0;c<this.#a8.length;c++){let d=this.#a8[c];if("*"===d.hostname){if(d.port&&d.port!==b)continue;return!1}if((!d.port||d.port===b)&&(!d.wildcard&&a===d.hostname||a.slice(-(d.hostname.length+1))===`.${d.hostname}`))return!1}return!0}#a9(){let a=this.#E.noProxy??this.#bd,b=a.split(/[,\s]/),c=[];for(let a=0;a<b.length;a++){let d,e,f=b[a];if(!f)continue;let g=f.match(/^\[(.+)\]:(\d+)$/);if(g)d=g[1],e=Number.parseInt(g[2],10);else{let a=f.replace(/^\[(.+)\]$/,"$1"),b=1===(a.match(/:/g)||[]).length&&a.match(/^(.+):(\d+)$/);d=b?b[1]:a,e=b?Number.parseInt(b[2],10):0}let h=42===f.charCodeAt(0);c.push({hostname:d.replace(/^\*?\./,"").replace(/^(.+)\.$/,"$1").toLowerCase(),port:e,wildcard:h})}this.#a7=a,this.#a8=c}get #bc(){return void 0===this.#E.noProxy&&this.#a7!==this.#bd}get #bd(){return process.env.no_proxy??process.env.NO_PROXY??""}}a.exports=p},43212:(a,b,c)=>{"use strict";c(85450),c(30395),c(42541),c(90943),c(51525),c(84238),c(92843),c(64323),c(16605),c(42946),new TextEncoder},43469:(a,b,c)=>{"use strict";c.d(b,{buildClineHeaders:()=>f,resolveClineCredential:()=>e});let d=c(90053).rE||"0.0.0";function e(a){let b="string"==typeof a?.apiKey?a.apiKey.trim():"";return b?{token:b,isApiKey:!0}:{token:a?.accessToken,isApiKey:!1}}function f(a,b={},c={}){let e=function(a,b={}){let c=function(a,{isApiKey:b=!1}={}){if("string"!=typeof a)return"";let c=a.trim();return c?b||c.startsWith("workos:")?c:`workos:${c}`:""}(a,b);return c?`Bearer ${c}`:""}(a,c),g={"HTTP-Referer":"https://cline.bot","X-Title":"Cline","User-Agent":`ZevaiRouter/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"zevairouter","X-CLIENT-VERSION":d,"X-CORE-VERSION":d,"X-IS-MULTIROOT":"false",...b};return e&&(g.Authorization=e),g}},43904:(a,b,c)=>{"use strict";let{kMockCallHistoryAddLog:d}=c(80830),{InvalidArgumentError:e}=c(61448);function f(a,b,c,d,f){switch(b.operator){case"OR":return d.push(...c(a,f)),d;case"AND":return c(a,d);default:throw new e("options.operator must to be a case insensitive string equal to 'OR' or 'AND'")}}function g(a){return(b,c=this.logs)=>{if("string"==typeof b||null==b)return c.filter(c=>c[a]===b);if(b instanceof RegExp)return c.filter(c=>b.test(c[a]));throw new e(`${a} parameter should be one of string, regexp, undefined or null`)}}class h{constructor(a={}){this.body=a.body,this.headers=a.headers,this.method=a.method;let b=function(a){try{let b=new URL(a.path,a.origin);if(0!==b.search.length)return b;return b.search=new URLSearchParams(a.query).toString(),b}catch(a){throw new e("An error occurred when computing MockCallHistoryLog.url",{cause:a})}}(a);this.fullUrl=b.toString(),this.origin=b.origin,this.path=b.pathname,this.searchParams=Object.fromEntries(b.searchParams),this.protocol=b.protocol,this.host=b.host,this.port=b.port,this.hash=b.hash}toMap(){return new Map([["protocol",this.protocol],["host",this.host],["port",this.port],["origin",this.origin],["path",this.path],["hash",this.hash],["searchParams",this.searchParams],["fullUrl",this.fullUrl],["method",this.method],["body",this.body],["headers",this.headers]])}toString(){let a="";return this.toMap().forEach((b,c)=>{("string"==typeof b||null==b)&&(a=`${a}${c}->${b}|`),("object"==typeof b&&null!==b||Array.isArray(b))&&(a=`${a}${c}->${JSON.stringify(b)}|`)}),a.slice(0,-1)}}class i{logs=[];calls(){return this.logs}firstCall(){return this.logs.at(0)}lastCall(){return this.logs.at(-1)}nthCall(a){if("number"!=typeof a)throw new e("nthCall must be called with a number");if(!Number.isInteger(a))throw new e("nthCall must be called with an integer");if(1!==Math.sign(a))throw new e("nthCall must be called with a positive value. use firstCall or lastCall instead");return this.logs.at(a-1)}filterCalls(a,b){if(0===this.logs.length)return this.logs;if("function"==typeof a)return this.logs.filter(a);if(a instanceof RegExp)return this.logs.filter(b=>a.test(b.toString()));if("object"==typeof a&&null!==a){if(0===Object.keys(a).length)return this.logs;let c={operator:"OR",...function(a={}){let b={};if("operator"in a){if("string"!=typeof a.operator||"OR"!==a.operator.toUpperCase()&&"AND"!==a.operator.toUpperCase())throw new e("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");return{...b,operator:a.operator.toUpperCase()}}return b}(b)},d="AND"===c.operator?this.logs:[];return"protocol"in a&&(d=f(a.protocol,c,this.filterCallsByProtocol,d,this.logs)),"host"in a&&(d=f(a.host,c,this.filterCallsByHost,d,this.logs)),"port"in a&&(d=f(a.port,c,this.filterCallsByPort,d,this.logs)),"origin"in a&&(d=f(a.origin,c,this.filterCallsByOrigin,d,this.logs)),"path"in a&&(d=f(a.path,c,this.filterCallsByPath,d,this.logs)),"hash"in a&&(d=f(a.hash,c,this.filterCallsByHash,d,this.logs)),"fullUrl"in a&&(d=f(a.fullUrl,c,this.filterCallsByFullUrl,d,this.logs)),"method"in a&&(d=f(a.method,c,this.filterCallsByMethod,d,this.logs)),[...new Set(d)]}throw new e("criteria parameter should be one of function, regexp, or object")}filterCallsByProtocol=g.call(this,"protocol");filterCallsByHost=g.call(this,"host");filterCallsByPort=g.call(this,"port");filterCallsByOrigin=g.call(this,"origin");filterCallsByPath=g.call(this,"path");filterCallsByHash=g.call(this,"hash");filterCallsByFullUrl=g.call(this,"fullUrl");filterCallsByMethod=g.call(this,"method");clear(){this.logs=[]}[d](a){let b=new h(a);return this.logs.push(b),b}*[Symbol.iterator](){for(let a of this.calls())yield a}}a.exports.MockCallHistory=i,a.exports.MockCallHistoryLog=h},44193:(a,b,c)=>{"use strict";c.d(b,{B:()=>d});let d="opencode/latest/2.0.26/cli"},44282:(a,b,c)=>{"use strict";c.d(b,{$j:()=>j,Ie:()=>h,VR:()=>g});var d=c(55511),e=c(30395);let f=new Map([["&"," and "],["\uD83E\uDD84"," unicorn "],["♥"," love "],["\xdf","ss"],["ẞ","Ss"],["\xe4","ae"],["\xc4","Ae"],["\xf6","oe"],["\xd6","Oe"],["\xfc","ue"],["\xdc","Ue"],["\xc6","AE"],["\xe6","ae"],["\xd8","O"],["\xf8","o"],["Œ","OE"],["œ","oe"],["\xd0","D"],["\xf0","d"],["Đ","D"],["đ","d"],["\xde","TH"],["\xfe","th"],["Ł","L"],["ł","l"],["ı","i"]]);function g(a){if(!a)return(0,d.randomUUID)();let b=(0,d.createHash)("sha256").update(String(a)).digest("hex"),c=(3&parseInt(b[16],16)|8).toString(16);return`${b.slice(0,8)}-${b.slice(8,12)}-4${b.slice(13,16)}-${c}${b.slice(17,20)}-${b.slice(20,32)}`}let h=process.cwd(),i=(function(a){let b="";for(let c of a)b+=f.get(c)??c;return b.normalize("NFD").replace(/[̀-ͯ]/g,"")})(String(h??"")).replace(/([A-Z]{2,})(\d+)/g,"$1 $2").replace(/([a-z\d]+)([A-Z]{2,})/g,"$1 $2").replace(/([a-z\d])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-rt-z\d]+)/g,"$1 $2").toLowerCase().replace(/[^a-z\d]+/g,"-").replace(/^-+|-+$/g,"");function j({apiKey:a,sessionId:b,accept:c}={}){let f={"Content-Type":"application/json",...e.xq.commandcode?.headers||{},"x-project-slug":i,"x-session-id":b||(0,d.randomUUID)()};return a&&(f.Authorization=`Bearer ${a}`),c&&(f.Accept=c),f}},44822:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"codebuddy-intl",alias:"cbai",uiAlias:"cbai",priority:90,display:{name:"CodeBuddy",icon:"smart_toy",color:"#006EFF",website:"https://www.codebuddy.ai",notice:{signupUrl:"https://www.codebuddy.ai"}},category:"oauth",authModes:["oauth","apikey"],hasOAuth:!0,transport:{baseUrl:"https://www.codebuddy.ai/v2/chat/completions",format:"openai",forceStream:!0,thinkingFormat:"openai",headers:{"User-Agent":"IDE/2.108.1 CodeBuddy/2.108.1","X-Product":"SaaS","X-IDE-Type":"IDE","X-IDE-Name":"IDE","x-requested-with":"XMLHttpRequest","x-codebuddy-request":"1"},auth:{combined:!0,header:"Authorization",scheme:"bearer",hooks:["codebuddyHeaders"]},usage:{url:"https://www.codebuddy.ai/v2/billing/meter/get-user-resource"}},models:[{id:"glm-5.2",name:"GLM-5.2"},{id:"glm-5.1",name:"GLM-5.1"},{id:"glm-5.0",name:"GLM-5.0"},{id:"glm-5.0-turbo",name:"GLM-5.0-Turbo"},{id:"glm-5v-turbo",name:"GLM-5v-Turbo"},{id:"glm-4.7",name:"GLM-4.7"},{id:"minimax-m3",name:"MiniMax-M3"},{id:"minimax-m2.7",name:"MiniMax-M2.7"},{id:"kimi-k2.7",name:"Kimi-K2.7-Code"},{id:"kimi-k2.6",name:"Kimi-K2.6"},{id:"kimi-k2.5",name:"Kimi-K2.5"},{id:"hy3-preview",name:"Hy3 Preview"},{id:"deepseek-v4-pro",name:"DeepSeek-V4-Pro"},{id:"deepseek-v4.1-flash",name:"DeepSeek-V4.1-Flash"},{id:"deepseek-v3-2-volc",name:"DeepSeek-V3.2"}],oauth:{baseUrl:"https://www.codebuddy.ai",stateUrl:"https://www.codebuddy.ai/v2/plugin/auth/state",tokenUrl:"https://www.codebuddy.ai/v2/plugin/auth/token",refreshUrl:"https://www.codebuddy.ai/v2/plugin/auth/token/refresh",userAgent:"IDE/2.63.2 CodeBuddy/2.63.2",platform:"ide",pollInterval:5e3},features:{usage:!0,usageApikey:!0},serviceKinds:["llm"]}},44991:(a,b,c)=>{"use strict";c.d(b,{D:()=>f});var d=c(88164),e=c(30395);class f extends d.L{constructor(){super("ollama-local")}buildUrl(a,b,c=0,d=null){return`${(0,e.Ak)(d)}/api/chat`}}},45221:(a,b,c)=>{"use strict";let{runtimeFeatures:d}=c(56758),{maxUnsigned16Bit:e,opcodes:f}=c(62026),g=null,h=8192,i=d.has("crypto")?c(77598).randomFillSync:null;function j(){return 8192===h&&(h=0,i(g??=Buffer.allocUnsafeSlow(8192),0,8192)),[g[h++],g[h++],g[h++],g[h++]]}class k{constructor(a){this.frameData=a}createFrame(a){let b=this.frameData,c=j(),d=b?.byteLength??0,f=d,g=6;d>e?(g+=8,f=127):d>125&&(g+=2,f=126);let h=Buffer.allocUnsafe(d+g);h[0]=h[1]=0,h[0]|=128,h[0]=(240&h[0])+a,h[g-4]=c[0],h[g-3]=c[1],h[g-2]=c[2],h[g-1]=c[3],h[1]=f,126===f?h.writeUInt16BE(d,2):127===f&&(h[2]=h[3]=0,h.writeUIntBE(d,4,6)),h[1]|=128;for(let a=0;a<d;++a)h[g+a]=b[a]^c[3&a];return h}static createFastTextFrame(a){let b=j(),c=a.length;for(let d=0;d<c;++d)a[d]^=b[3&d];let d=c,g=6;c>e?(g+=8,d=127):c>125&&(g+=2,d=126);let h=Buffer.allocUnsafeSlow(g);return h[0]=128|f.TEXT,h[1]=128|d,h[g-4]=b[0],h[g-3]=b[1],h[g-2]=b[2],h[g-1]=b[3],126===d?h.writeUInt16BE(c,2):127===d&&(h[2]=h[3]=0,h.writeUIntBE(c,4,6)),[h,a]}}a.exports={WebsocketFrameSend:k,generateMask:j}},45874:(a,b,c)=>{"use strict";c.d(b,{Xx:()=>j,exportSettings:()=>k,getSettings:()=>i});var d=c(52825),e=c(50743);let f={cloudEnabled:!1,tunnelEnabled:!1,tunnelUrl:"",tunnelProvider:"cloudflare",tailscaleEnabled:!1,tailscaleUrl:"",stickyRoundRobinLimit:3,providerStrategies:{},comboStrategy:"fallback",comboStickyRoundRobinLimit:1,comboStrategies:{},capacityAdapter:{vision:{enabled:!1,roundRobin:!1,models:[]},pdf:{enabled:!1,roundRobin:!1,models:[]},audioInput:{enabled:!1,roundRobin:!1,models:[]},videoInput:{enabled:!1,roundRobin:!1,models:[]}},responseCacheEnabled:!1,requireLogin:!0,tunnelDashboardAccess:!0,authMode:"password",oidcIssuerUrl:"",oidcClientId:"",oidcClientSecret:"",oidcScopes:"openid profile email",oidcLoginLabel:"Sign in with OIDC",ssoType:"oidc",samlEntryPoint:"",samlIssuer:"urn:zevairouter:sp",samlCert:"",samlLoginLabel:"Sign in with SAML SSO",samlAttributeEmail:"email",samlAttributeName:"name",enableObservability:!0,observabilityMaxRecords:1e3,observabilityBatchSize:20,observabilityFlushIntervalMs:5e3,observabilityMaxJsonSize:5,outboundProxyEnabled:!1,outboundProxyUrl:"",outboundNoProxy:"",mitmRouterBaseUrl:"http://localhost:1997",dnsToolEnabled:{},rtkEnabled:!0,headroomEnabled:!1,headroomUrl:"http://localhost:8787",headroomCompressUserMessages:!1,headroomTimeoutMs:3e3,headroomCodeAware:!1,headroomKompress:!0,cavemanEnabled:!1,cavemanLevel:"full",ponytailEnabled:!1,ponytailLevel:"full",customPromptEnabled:!1,customPrompt:"",pxpipeEnabled:!1,pxpipeAutoInstall:!0,pxpipeMinChars:25e3,pxpipeTimeoutMs:15e3,contextInjectionEnabled:!1,v11Flags:{kiroIntegrity:!1,outboundPolicy:!1,compatV11:!1,refreshLanes:!1,adaptiveShadow:!1,adaptiveRoute:!1,registryV2:!1,quotaStreamV2:!1},trustedOutboundTargets:[],fiveSimApiKey:"",providerOverrides:{},quotaVisibility:{}};async function g(){let a=(await (0,d.cK)()).get("SELECT data FROM settings WHERE id = 1");return a?(0,e.q)(a.data,{}):{}}function h(a){let b={...f,...a||{}};for(let[a,c]of Object.entries(f))void 0===b[a]&&("outboundProxyEnabled"===a&&"string"==typeof b.outboundProxyUrl&&b.outboundProxyUrl.trim()?b[a]=!0:b[a]=c);return b}async function i(){return h(await g())}async function j(a){let b,c=await (0,d.cK)();return c.transaction(()=>{let d=c.get("SELECT data FROM settings WHERE id = 1");b={...d?(0,e.q)(d.data,{}):{},...a},c.run("INSERT INTO settings(id, data) VALUES(1, ?) ON CONFLICT(id) DO UPDATE SET data = excluded.data",[(0,e.s)(b)])}),h(b)}async function k(){return await g()}},46455:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{NS:()=>A,dg:()=>C,qX:()=>z});var e=c(5210),f=c(70321),g=c(27054),h=c(65333),i=c(99939),j=c(79154),k=c(63993),l=c(36633),m=c(39817),n=a([e,h]);[e,h]=n.then?(await n)():n;let D=["expired","authentication","unauthorized","401","re-authorize"],E=globalThis._quotaUsageInflight??=new Map,F=new Map;function o(a,b=Date.now()){let c=F.get(a.id),d=c?.refreshToken===a.refreshToken?(c.failures||0)+1:1,e=Math.min(216e5,3e5*2**(d-1));F.set(a.id,{failures:d,retryAt:b+e,refreshToken:a.refreshToken})}function p(a){F.delete(a.id)}function q(a){return a?.provider==="codex"&&!!a.providerSpecificData?.codexRefreshBlockedAt||a?.failureClass==="reauth_required"||!!a?.quarantinedAt}function r(a){return!!a?.accessToken&&!function(a,b=Date.now()){let c=(0,j.Dz)(a);return null!==c&&c<=b}(a)}function s(a){if("codex"===a)return"Codex";let b=String(a||"provider");return b.charAt(0).toUpperCase()+b.slice(1)}function t(a){return`${s(a)} refresh token rejected; reconnect this account.`}function u(a){return String(a?.code||"invalid_refresh_token").replace(/[^a-zA-Z0-9_.:-]/g,"_").slice(0,120)||"invalid_refresh_token"}async function v(a,b){let c=new Date().toISOString(),d=u(b),e={lastError:t(a.provider),lastErrorAt:c,lastErrorType:"auth",errorCode:d,failureClass:"reauth_required"};"codex"===a.provider&&(e.providerSpecificData={...a.providerSpecificData||{},codexRefreshBlockedAt:c,codexRefreshErrorCode:d});try{return await (0,f.updateProviderConnection)(a.id,e)||{...a,...e}}catch(b){return console.warn(`[Usage] ${s(a.provider)} refresh rejection state was not persisted: ${b.message}`),{...a,...e}}}async function w(a,b){let c=b?.permanent===!0?b:(0,i.R_)({code:u(b)}),d=await v(a,c);if(r(a))return{connection:d,refreshed:!1,refreshBlocked:!0,refreshError:c};throw c}function x(a){return!!(a?.quotas&&"object"==typeof a.quotas&&Object.keys(a.quotas).length>0)}function y(a,b){return!!(a?.quotaFetchFailed===!0&&!a.accountDead&&!x(a)&&x(b?.usage))}async function z(a,b=!1,c=null){let d;if(a?.id){let b=await (0,f.getProviderConnectionById)(a.id).catch(()=>null),c=(0,i.kI)(a,b);c!==a&&(a={...a,refreshToken:c.refreshToken,accessToken:c.accessToken,expiresAt:c.expiresAt,lastRefreshAt:c.lastRefreshAt})}let e=(0,h.SB)(a.provider);if(q(a)){if(r(a))return{connection:a,refreshed:!1,refreshBlocked:!0};throw(0,i.R_)({code:a.providerSpecificData?.codexRefreshErrorCode||a.errorCode||"invalid_refresh_token"})}let g={accessToken:a.accessToken,refreshToken:a.refreshToken,idToken:a.idToken,expiresAt:a.expiresAt||a.tokenExpiresAt,lastRefreshAt:a.lastRefreshAt,connectionId:a.id,providerSpecificData:a.providerSpecificData,copilotToken:a.providerSpecificData?.copilotToken,copilotTokenExpiresAt:a.providerSpecificData?.copilotTokenExpiresAt};if(!(b||e.needsRefresh(g)))return{connection:a,refreshed:!1};if(!b&&function(a,b=Date.now()){let c=F.get(a.id);return!!c&&(c.refreshToken!==a.refreshToken?(F.delete(a.id),!1):c.retryAt>b)}(a))return{connection:a,refreshed:!1,refreshFailed:!0,refreshBackedOff:!0};try{d=await e.refreshCredentials(g,console,c)}catch(b){if(b?.permanent===!0)return p(a),w(a,b);throw b?.name!=="AbortError"&&o(a),b}if((0,i.jT)(d))return p(a),w(a,(0,i.R_)(d));if(!d){if(o(a),a.accessToken)return{connection:a,refreshed:!1,refreshFailed:!0};throw Error("Failed to refresh credentials. Please re-authorize the connection.")}p(a);let j={updatedAt:new Date().toISOString()};d.accessToken&&(j.accessToken=d.accessToken),d.refreshToken&&(j.refreshToken=d.refreshToken),d.idToken&&(j.idToken=d.idToken),d.lastRefreshAt&&(j.lastRefreshAt=d.lastRefreshAt),d.expiresIn?(j.expiresAt=new Date(Date.now()+1e3*d.expiresIn).toISOString(),j.expiresIn=d.expiresIn):d.expiresAt&&(j.expiresAt=d.expiresAt);let k={...d.providerSpecificData||{},...d.copilotToken?{copilotToken:d.copilotToken}:{},...d.copilotTokenExpiresAt?{copilotTokenExpiresAt:d.copilotTokenExpiresAt}:{}};return Object.keys(k).length>0&&(j.providerSpecificData={...a.providerSpecificData||{},...k}),await (0,f.updateProviderConnection)(a.id,j),{connection:{...a,...j,providerSpecificData:j.providerSpecificData||a.providerSpecificData},refreshed:!0}}function A(a){let b;if(!a)return!1;let c="api-key"===(b=String(a.authType||"").toLowerCase().trim())||"api_key"===b||"api key"===b?"apikey":b;return"oauth"===c||"apikey"===c&&l.jO.includes(a.provider)}async function B(a,b,c){let d,{writeCache:e=!1,force:h=!1}=b,i=await (0,f.getProviderConnectionById)(a);if(!i)return{error:"Connection not found",notFound:!0};if(!A(i))return{message:"Usage not available for this connection"};let j=await (0,k.B)(i.providerSpecificData),l={connectionProxyEnabled:!0===j.connectionProxyEnabled,connectionProxyUrl:j.connectionProxyUrl||"",connectionNoProxy:j.connectionNoProxy||"",vercelRelayUrl:j.vercelRelayUrl||"",strictProxy:!1},n=i,o="oauth"===n.authType,p=!1;if(o){let a;try{a=await z(n,h,l)}catch(a){if(a?.permanent===!0)return{message:t(n.provider),reauthRequired:!0,quotas:{}};throw a}n=a.connection,p=!0===a.refreshFailed}if(o&&p&&!r(n))d={message:`${s(n.provider)} credential refresh is temporarily unavailable; will retry later.`,quotaFetchFailed:!0,quotas:{}};else if(d=await (0,g.my)(n,l),o&&function(a){if(!a?.message)return!1;let b=a.message.toLowerCase();return D.some(a=>b.includes(a))}(d)&&n.refreshToken&&!q(n)&&!p)try{n=(await z(n,!0,l)).connection,d=await (0,g.my)(n,l)}catch(a){console.warn(`[Usage] ${n.provider}: force refresh failed: ${a.message}`)}if((e||c.writeCache)&&d&&!d.error)try{if("codebuddy"===n.provider||"codebuddy-cn"===n.provider||"codebuddy-intl"===n.provider){let a=null,b=await (0,f.Iu)(n.id,(b,c)=>{if(y(d,c)){var e;return e=d,a={...(0,m.pX)(c.usage,b),stale:!0,refreshError:e.message},{}}return{quotaUsage:(0,m.pX)(d,b)}});d=a||b?.quotaUsage||d}else{let a=await (0,f.getQuotaSnapshot)(n.id);y(d,a)?d={...a.usage,stale:!0,refreshError:d.message}:await (0,f.KK)(n.id,n.provider,d)}}catch(a){console.warn(`[QuotaCache] save failed for ${n.id}: ${a.message}`)}else if("codebuddy"===n.provider||"codebuddy-cn"===n.provider||"codebuddy-intl"===n.provider){let a=await (0,f.getProviderConnectionById)(n.id)||n;d=(0,m.pX)(d,a)}return d}async function C(a,b={}){let c=E.get(a);if(c||(c={active:null,queuedForce:null},E.set(a,c)),c.queuedForce)return b.writeCache&&(c.queuedForce.writeCache=!0),c.queuedForce.promise;if(c.active&&(!b.force||c.active.force))return b.writeCache&&(c.active.writeCache=!0),c.active.promise;let d=b=>{c.active===b&&(c.active=null),c.active||c.queuedForce||E.get(a)!==c||E.delete(a)};if(c.active){let e=c.active.promise,f={force:!0,writeCache:!0===b.writeCache,promise:null},g=()=>(c.queuedForce===f&&(c.queuedForce=null),c.active=f,B(a,{...b,force:!0},f));return f.promise=e.then(g,g).finally(()=>d(f)),c.queuedForce=f,f.promise}let e={force:!0===b.force,writeCache:!0===b.writeCache,promise:null};return c.active=e,e.promise=B(a,b,e).finally(()=>d(e)),e.promise}d()}catch(a){d(a)}})},46714:(a,b,c)=>{"use strict";c.d(b,{dv:()=>m,fM:()=>k,vP:()=>j}),c(64334),c(2206),c(6699);let d=Object.freeze(["none","minimal","low","medium","high","xhigh","max","ultra"]),e=Object.freeze({xhigh:Object.freeze(d.slice(0,6)),max:Object.freeze(d.slice(0,7)),ultra:d}),f=Object.freeze({off:"none",on:"high",thinking:"high"}),g=Object.freeze(["minimal","xhigh","ultra","medium","none","high","max","low"]),h=Object.freeze(["low","medium","high","xhigh","max"]),i=new Set(["gpt-6.1-sol","gpt-6.1-terra","gpt-6-sol","gpt-6-luna"]);function j(a){let b;return i.has(String(a||"").toLowerCase().replace(/\([^()]+\)\s*$/,"").replace(/\[1m\]$/i,"").replace(/-review$/,""))?h:e["gpt-5.6"===(b="string"==typeof a?a.toLowerCase():"")||/^gpt-5\.6-(?:sol|terra)(?:$|[-(:/])/.test(b)?"ultra":/^gpt-5\.6-luna(?:$|[-(:/])/.test(b)?"max":"xhigh"]}function k(a,b){let c="string"==typeof b?b.trim().toLowerCase():"",e=f[c]||c,g=d.indexOf(e),h=j(a);if(-1===g)return h.includes("low")?"low":h[0];let i=h[h.length-1],k=d.indexOf(i),l=d[Math.min(g,k)];return h.includes(l)?l:h[0]}Object.freeze([{pattern:"deepseek-ai/deepseek-v4*",levels:Object.freeze(["none","low","high","max"])},{pattern:"zai-org/glm-5.3*",levels:Object.freeze(["low","high"])},{pattern:"glm-5.3*",levels:Object.freeze(["low","high"])}]),Object.freeze({openai:Object.freeze(["none","minimal","low","medium","high","xhigh"]),"claude-adaptive":Object.freeze(["none","low","medium","high","xhigh","max"]),"claude-budget":Object.freeze(["none","low","medium","high","xhigh","max"]),"gemini-level":Object.freeze(["minimal","low","medium","high"]),"gemini-budget":Object.freeze(["none","low","medium","high"]),zai:Object.freeze(["none","thinking"]),qwen:Object.freeze(["none","low","medium","high"]),kimi:Object.freeze(["none","low","medium","high","max"]),deepseek:Object.freeze(["none","high","max"]),commandcode:Object.freeze(["none","low","medium","high","xhigh","max"]),minimax:Object.freeze(["none","thinking"]),hunyuan:Object.freeze(["none","low","medium","high"]),step:Object.freeze(["none","low","medium","high"])}),Object.freeze(["none","minimal","low","medium","high","xhigh","max"]);let l=Object.freeze(["none","low","medium","high","max"]);function m(a){if("string"!=typeof a)return{cleanModel:a,effort:null};let b=a.toLowerCase();for(let c of g)if(b.endsWith(`-${c}`))return{cleanModel:a.slice(0,-(c.length+1)),effort:c};return{cleanModel:a,effort:null}}Object.freeze(["none","low","medium","high"]),Object.freeze([{pattern:"*gemini-4*",levels:Object.freeze(["low","medium","high"])},{pattern:"*claude*4.6*",levels:l},{pattern:"*claude*4-6*",levels:l},{provider:"codebuddy-cn",pattern:"deepseek-v4-pro",levels:Object.freeze(["low","high","xhigh"])},{provider:"codebuddy-cn",pattern:"deepseek-v4.1-flash",levels:Object.freeze(["low","high","max"])},{pattern:"*deepseek-v4.1-flash-free*",levels:Object.freeze(["low","high","max"])},{pattern:"*deepseek-v4.*",levels:Object.freeze(["none","low","medium","high","xhigh","max"])},{pattern:"*deepseek-v4-*",levels:Object.freeze(["none","low","medium","high","xhigh","max"])},{provider:"codebuddy-cn",pattern:"glm-5.3",levels:Object.freeze(["low","high","max"])},{provider:"codebuddy-cn",pattern:"glm-5.3-flash",levels:Object.freeze(["low","high","max"])},{provider:"codebuddy-cn",pattern:"glm-5.2",levels:Object.freeze(["high","xhigh"])},{provider:"codebuddy-cn",pattern:"kimi-k2.8-preview",levels:Object.freeze(["low","medium","high"])},{provider:"codebuddy-cn",pattern:"hy3",levels:Object.freeze(["low","high"])},{provider:"codebuddy-cn",pattern:"hy4-preview",levels:Object.freeze(["high"])},{provider:"nvidia-build",pattern:"moonshotai/kimi-k3.1-pro",levels:Object.freeze(["low","medium","high","max"])},{provider:"nvb",pattern:"moonshotai/kimi-k3.1-pro",levels:Object.freeze(["low","medium","high","max"])},{provider:"nvidia-build",pattern:"*",levels:Object.freeze(["low","medium","high"])},{provider:"nvb",pattern:"*",levels:Object.freeze(["low","medium","high"])},{provider:"codebuddy-intl",pattern:"deepseek-v4*",levels:Object.freeze(["low","high","xhigh"])}])},46870:(a,b,c)=>{"use strict";c.d(b,{kF:()=>a1});var d=c(77598),e=c.n(d),f=c(69384),g=c(19897),h=c(28113),i=c(65556);let j=["SAPISID","__Secure-1PAPISID","__Secure-3PAPISID"],k=["SID","HSID","SSID"];class l extends Error{constructor(a){super(a),this.name="AistudioCredentialError",this.status=401}}function m(a){if(!a||"object"!=typeof a||!a.name||"string"!=typeof a.value||!a.domain)return null;let b="number"==typeof a.expires?a.expires:"number"==typeof a.expirationDate?a.expirationDate:-1,c=String(a.sameSite||"").toLowerCase(),d="strict"===c?"Strict":"none"===c||"no_restriction"===c?"None":"Lax";return{name:String(a.name),value:a.value,domain:String(a.domain),path:a.path||"/",expires:b>0?b:-1,httpOnly:!0===a.httpOnly,secure:!0===a.secure||"None"===d,sameSite:d,..."string"==typeof a.partitionKey&&a.partitionKey?{partitionKey:a.partitionKey}:{}}}function n(a){let b,c="string"==typeof a?a.trim():a?JSON.stringify(a):"";if(!c)throw new l("AI Studio storage state is empty");try{b=JSON.parse(c)}catch{throw new l("AI Studio storage state is not valid JSON")}let d=Array.isArray(b)?b:Array.isArray(b?.cookies)?b.cookies:null;if(!d)throw new l("Expected a storage state ({cookies, origins}) or a cookie array");return{cookies:d.map(m).filter(Boolean),origins:Array.isArray(b?.origins)?b.origins:[]}}function o(a,b,c="https://aistudio.google.com/",d=Date.now()/1e3){let e=new URL(c).hostname.toLowerCase(),f=null;for(let c of a?.cookies||[])c.name===b&&function(a,b){let c=a.replace(/^\./,"").toLowerCase();return b===c||b.endsWith(`.${c}`)}(c.domain,e)&&(c.expires>0&&c.expires<=d||(!f||c.domain.length>f.domain.length)&&(f=c));return f?f.value:null}function p(a){let b;try{b=n(a)}catch(a){return{valid:!1,error:a.message}}let c=j.filter(a=>!o(b,a));if(c.length)return{valid:!1,error:`Missing Google session cookies: ${c.join(", ")}`};let d=k.filter(a=>!o(b,a)),e=d.length?`Cookie export looks incomplete (missing ${d.join(", ")}); Google may sign this session out within minutes. Use Login via Browser, or export every google.com cookie from a browser session you keep signed in.`:null;return{valid:!0,error:null,count:b.cookies.length,...e?{warning:e}:{}}}function q(a){let b=(a?.cookies||[]).map(a=>`${a.domain}|${a.path}|${a.name}=${a.value}|${a.expires}`).sort().join("\n");return(0,d.createHash)("sha256").update(b).digest("hex")}function r(a){let b="string"==typeof a?.apiKey?a.apiKey.trim():"";if(b)return b;let c=a?.providerSpecificData;return c?.storageState?"string"==typeof c.storageState?c.storageState:JSON.stringify(c.storageState):""}var s=c(64271);let t="skip_thought_signature_validator",u=[7,8,9,10],v={string:1,number:2,integer:3,boolean:4,array:5,object:6},w={type:0,format:1,description:2,nullable:3,enum:4,items:5,properties:6,required:7,minProperties:8,maxProperties:9,minimum:10,maximum:11,minLength:12,maxLength:13,pattern:14,anyOf:17,maxItems:20,minItems:21,propertyOrdering:22},x=["minItems","maxItems","minProperties","maxProperties","minLength","maxLength"];function y(a,b,c){for(;a.length<=b;)a.push(null);return a[b]=c,a}function z(a){let b=String(a||"");if(b.length<=63)return b;let c=`_${(0,d.createHash)("sha256").update(b).digest("hex").slice(0,12)}`;return b.slice(0,63-c.length)+c}function A(a){let b=a&&"object"==typeof a&&!Array.isArray(a)?a:{result:a},c=Object.keys(b).filter(a=>void 0!==b[a]).sort();return 0===c.length?[]:[c.map(a=>[a,function a(b){return null==b?[0]:"number"==typeof b?[null,Number.isFinite(b)?b:0]:"string"==typeof b?[null,null,b]:"boolean"==typeof b?[null,null,null,b]:Array.isArray(b)?[null,null,null,null,null,[b.map(a)]]:"object"==typeof b?[null,null,null,null,A(b)]:[null,null,String(b)]}(b[a])])]}let B=()=>[{type:"string"},{type:"number"},{type:"boolean"}];function C(a){if(!0===a||null==a)return{anyOf:[...B(),{type:"array",items:{anyOf:B(),nullable:!0}}],nullable:!0};if(!1===a||"object"!=typeof a||Array.isArray(a))return{type:"string"};let b={...a},c={};if(Object.prototype.hasOwnProperty.call(b,"const")){let a=b.const;"string"==typeof a?(b.type="string",b.enum=[a]):"boolean"==typeof a?b.type="boolean":"number"==typeof a?(b.type=Number.isInteger(a)?"integer":"number",b.minimum=a,b.maximum=a):null===a&&(b.type="string",b.nullable=!0)}let d=b.type,e=!0===b.nullable;Array.isArray(d)&&(e=e||d.some(a=>"null"===String(a).toLowerCase()),d=d.find(a=>"null"!==String(a).toLowerCase()));let f=Array.isArray(b.anyOf)?b.anyOf:Array.isArray(b.oneOf)?b.oneOf:null;if(f){let a=f.filter(a=>!(a&&"object"==typeof a&&"null"===String(a.type).toLowerCase()));if(a.length!==f.length&&(e=!0),1===(f=a).length&&!d){let a=C({...f[0],description:b.description??f[0]?.description});return e&&(a.nullable=!0),a}}if(Array.isArray(b.allOf)&&b.allOf.length){let a={...b};for(let c of(delete a.allOf,b.allOf))c&&"object"==typeof c&&(a.type??=c.type,c.properties&&(a.properties={...a.properties||{},...c.properties}),Array.isArray(c.required)&&(a.required=[...new Set([...a.required||[],...c.required])]),a.description??=c.description);return C(a)}if((d="string"==typeof d?d.toLowerCase():"")||(b.properties?d="object":b.items?d="array":Array.isArray(b.enum)&&(d="string")),"null"===d&&(d="string",e=!0),d&&v[d]&&(c.type=d),"string"==typeof b.format&&(c.format=b.format),"string"==typeof b.description&&b.description&&(c.description=b.description),e&&(c.nullable=!0),Array.isArray(b.enum)){let a=b.enum.filter(a=>"string"==typeof a&&""!==a);a.length===b.enum.length&&a.length>0?c.enum=a:b.enum.length>0&&(c.description=`${c.description?`${c.description}
219
+ `);return c||b.push(u(l)),b.push(m),b}(a)}}if(H(a))return{...d,action:"promote_tool",finish:"tool_calls",chunks:I(a,"tool_calls")};if(!a.finish&&!a.sawDone&&("waiting"!==a.phase||a.upstreamError)){let b=a.upstreamError?"upstream_rejected":"network_error";return{...d,action:b,finish:b,chunks:[u(b),m]}}return{...d,action:"forward",finish:a.finish,chunks:I(a,null)}}(g,b);if("recover"!==x.action)for(let a of x.chunks)w(a);return h(`finish upstream=${g.finish||"-"} action=${x.action} reasoning_chars=${g.reasoning.length} content_chars=${g.content.length} tools=${E(g).length}`),{turn:g,fin:x}}},cancel(a){p=!0,clearInterval(r),o.abort(a||ab("client_abort","client closed"))}},{highWaterMark:16384}),{status:200,headers:{...aa}})}({up:F,reqBody:L,opts:J,getToken:d,releaseToken:e,call:Q,signal:g,rlog:K,headersTimeoutMs:O,calls:()=>P}):am({up:F,reqBody:L,opts:J,getToken:d,releaseToken:e,call:Q,signal:g,rlog:K,headersTimeoutMs:O,calls:()=>P}):(K(`upstream status=${F.status} bytes=${(F.text||"").length}`),new Response(F.text||JSON.stringify({error:{message:`NVIDIA HTTP ${F.status}`}}),{status:F.status||502,headers:{...F.headers||{},"Content-Type":"application/json"}}))}async function al({call:a,body:b,timeoutMs:c,signal:d,getTokenFn:e,rlog:f}){let g=await e(),h=await a(g,b,c);return h.retry&&!d?.aborted&&(f("recovery 400 token_rejected; retrying with a fresh token"),g=await e({fresh:!0}),h=await a(g,b,c)),h}async function am({up:a,reqBody:b,opts:c,getToken:d,releaseToken:e,call:f,signal:g,rlog:h,headersTimeoutMs:i,calls:j}){let k;try{k=await aj(a.r,g,c.streamIdleMs)}catch(a){if(g?.aborted)throw ad(g);return ac(a?.code==="stream_idle"?504:502,w(a?.message||"upstream read failed"))}let l=null;try{l=JSON.parse(k)}catch{l=null}if(!l)return k&&k.trim()?ac(502,"upstream returned invalid JSON"):ac(502,"upstream returned empty body");let m=c.recoveryAttempts>0?"recover":"forward",n=J(l,m),o=c.recoveryAttempts,p=b,q=l;for(;"recover"===n.action&&o>0&&!g?.aborted;){let a,b;o--;let j=x(p,n.turn.reasoning);h(`recovery attempt=${c.recoveryAttempts-o} effort=${j.effort}`);try{a=await al({call:f,body:j.body,timeoutMs:i??c.headersTimeoutMs,signal:g,getTokenFn:a=>ae(d(a),g,e),rlog:h})}catch(b){if(g?.aborted)throw ad(g);a=null}if(!a||!a.r){n=J(q,"terminal");break}try{b=await aj(a.r,g,c.streamIdleMs)}catch(a){if(g?.aborted)throw ad(g);n=J(q,"terminal");break}let k=null;try{k=JSON.parse(b)}catch{k=null}if(!k){n=J(q,"terminal");break}n=J(k,m=o>0?"recover":"terminal"),p=j.body,q=k}return"recover"===n.action&&(n=J(q,"terminal")),h(`summary transport=json action=${n.action} upstream_calls=${j()}`),new Response(JSON.stringify(n.json),{status:200,headers:{"Content-Type":"application/json"}})}function an(a,b){let c=process.env[a];if(void 0===c||""===String(c).trim())return b;let d=Number(c);return Number.isFinite(d)&&d>=0?Math.floor(d):b}let ao={acquire:(a,b)=>(0,e.qG)(a,b),release:a=>(0,e.zD)(a),pin:a=>(0,e.Ty)(a),unpin:a=>(0,e.oC)(a),recycle:a=>(0,e.WO)(a),sampleCpu:()=>(0,e.Px)()},ap=null;class aq extends d.Hv{constructor({pool:a=null,fetchFn:b=null}={}){super("nvidia-build",{id:"nvidia-build",baseUrl:g,maxRetries:0,retrySameCredential429:!1}),this._pool=a,this._fetch=b}get pool(){return this._pool||(ap??=new U({browser:ao,options:{idleMs:an("NVIDIA_BUILD_IDLE_MS",3e5),refillWindowMs:an("NVIDIA_BUILD_REFILL_WINDOW_MS",6e4),target:Math.max(0,an("NVIDIA_BUILD_POOL_TARGET",1)),mintTimeoutMs:an("NVIDIA_BUILD_MINT_TIMEOUT_MS",3e4),recycleAfter:Math.max(1,an("NVIDIA_BUILD_RECYCLE_AFTER",4))}}))}parseError(a,b){let c,d=a?.status||502,e=b||`Upstream error: ${d}`;try{let a=JSON.parse(b),c=a?.error?.message||a?.detail||a?.message;"string"==typeof c&&c.trim()&&(e=c)}catch{}let f=a?.headers?.get?.("retry-after")||a?.headers?.get?.("x-ratelimit-reset");if(f&&(429===d||503===d)){let a=Number(f);if(Number.isFinite(a)&&a>0)c=Date.now()+1e3*a;else{let a=Date.parse(f);Number.isFinite(a)&&a>Date.now()&&(c=a)}}let g=400===d?"invalid_request":401===d?"authentication":429===d?"rate_limited":d>=500?"upstream_transient":void 0;return{status:d,message:e,...Number.isFinite(c)?{resetsAtMs:c}:{},...g?{failureClass:g}:{}}}async testConnection(a){try{return Z(Y(W(a)))}catch{return!1}}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:k,proxyOptions:l=null}){let m=(a,c={})=>({response:a,url:g,headers:{},transformedBody:b,...c}),n=Y(W(d));if(!n.length||!Z(n))return m(ac(401,"no credentials: NVIDIA build cookies missing or unreadable","authentication_error"),{retryable:!1});let o={key:function(a,b=null){if(b)return`nvidia-build:${String(b).slice(0,36)}`;let c=a.map(a=>`${a.domain}|${a.name}=${a.value}`).sort().join("\n");return`nvidia-build:${(0,j.createHash)("sha256").update(c).digest("hex").slice(0,16)}`}(n,d?.connectionId),cookies:n},p=function(a){let b="string"==typeof a?a.trim():"";i[b=b.replace(/\([^()]+\)\s*$/,"").trim()]&&(b=i[b]);let c=h[b]?b:"moonshotai/kimi-k3.1-pro",{artifact:d}=h[c];return{id:c,artifact:d,apiUrl:`${g}/${d}`,known:c===b}}(a||b?.model),q=this.pool,r=this._fetch||((a,b)=>(0,$.Fm)(a,b,{...l,singleTransportAttempt:!0}));try{let a=await ak({body:b,stream:c,modelInfo:p,signal:e,log:k,fetchFn:r,getToken:a=>q.getToken(o,a),releaseToken:a=>q.releaseToken(o,a),options:{forceEffort:process.env.NVIDIA_BUILD_EFFORT||"",recoveryAttempts:an("NVIDIA_BUILD_REASONING_RECOVERY",2),heartbeatMs:an("NVIDIA_BUILD_HEARTBEAT_MS",15e3),upstream5xxRetries:an("NVIDIA_BUILD_UPSTREAM_5XX_RETRY",1),headersTimeoutMs:an("NVIDIA_BUILD_HEADERS_TIMEOUT_MS",6e5),streamIdleMs:an("NVIDIA_BUILD_STREAM_IDLE_MS",6e5),toolDedupMinChars:an("NVIDIA_BUILD_TOOL_DEDUP_MIN_CHARS",void 0),toolHistoryMaxChars:an("NVIDIA_BUILD_TOOL_HISTORY_MAX_CHARS",void 0),toolHistoryProtectLast:an("NVIDIA_BUILD_TOOL_HISTORY_PROTECT_LAST",void 0)}});return 401===a.status&&q.close(o.key,"session-expired"),m(a)}catch(b){if(e?.aborted)throw b;let a=b instanceof Error?b.message:"nvidia-build failed";if((0,f.BE)(a))return m(ac(503,"NVIDIA Build needs a Chromium binary. Run `npx playwright-core install chromium-headless-shell` or set ZEVAI_BROWSER_BIN."),{retryable:!1});if(b instanceof M)return q.close(o.key,"session-expired"),m(ac(401,a,"authentication_error"),{retryable:!1});return m(ac(b?.status||502,a))}}}},42946:(a,b,c)=>{"use strict";c.d(b,{Az:()=>h,F5:()=>i,fO:()=>k,tV:()=>g});var d=c(55511),e=c(48991);function f(a){return"string"!=typeof a?null:a.replace(/^claude:/i,"").trim()||null}function g(a){if("string"!=typeof a||!a)return null;if("{"===a[0])try{return f(JSON.parse(a)?.session_id)}catch{return null}return f(a)}function h(a){let b=a.tools;if(!b||0===b.length)return{body:a,toolNameMap:null};let c=a=>`${a}${e.uR}`,d=new Map,f=new Set,g=[];for(let a of b){let b=c(a.name);d.set(b,a.name),f.add(a.name),g.push({...a,name:b})}let h=[...g,...j],i=a.messages?.map(a=>{if(!Array.isArray(a.content))return a;let b=a.content.map(a=>"tool_use"===a.type?{...a,name:c(a.name)}:a);return{...a,content:b}}),k={...a,tools:h,messages:i||a.messages};return a.tool_choice?.type==="tool"&&f.has(a.tool_choice.name)&&(k.tool_choice={...a.tool_choice,name:c(a.tool_choice.name)}),{body:k,toolNameMap:d.size>0?d:null}}function i(a,b){if(!a||"object"!=typeof a||"content_block_start"!==a.type)return a;let c=a.content_block;if(c?.type!=="tool_use"||"string"!=typeof c.name)return a;let d=function(a,b){if("string"!=typeof a)return null;if(b?.has(a))return b.get(a);if("string"!=typeof a||!a.endsWith(e.uR)||e.dw.has(a))return null;let c=a.slice(0,-e.uR.length);return c.length>0?c:null}(c.name,b);return d&&d!==c.name?{...a,content_block:{...c,name:d}}:a}let j=[{name:"Task",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"TaskOutput",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"TaskStop",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"TaskCreate",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"TaskGet",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"TaskUpdate",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"TaskList",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"Bash",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"Glob",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"Grep",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"Read",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"Edit",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"Write",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"NotebookEdit",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"WebFetch",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"WebSearch",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"AskUserQuestion",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"Skill",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"EnterPlanMode",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}},{name:"ExitPlanMode",description:"This tool is currently unavailable.",input_schema:{type:"object",properties:{}}}];function k(a,b,c){let e,g,h,i,j,k;if(!b||!b.includes("sk-ant-oat"))return a;let l={...a},m={type:"text",text:(e=JSON.stringify(a),g=(0,d.createHash)("sha256").update(e).digest("hex").slice(0,5),h=(0,d.randomBytes)(2).toString("hex").slice(0,3),`x-anthropic-billing-header: cc_version=2.1.92.${h}; cc_entrypoint=sdk-cli; cch=${g};`)};return Array.isArray(l.system)?l.system[0]?.text?.startsWith("x-anthropic-billing-header:")||(l.system=[m,...l.system]):"string"==typeof l.system?l.system=[m,{type:"text",text:l.system}]:l.system=[m],l.metadata?.user_id||(l.metadata={...l.metadata,user_id:(i=(0,d.randomBytes)(32).toString("hex"),j=(0,d.randomUUID)(),k=f(c)||(0,d.randomUUID)(),`{"device_id":"${i}","account_uuid":"${j}","session_id":"${k}"}`)}),l}},43086:(a,b,c)=>{"use strict";let d=c(5318),{kClose:e,kDestroy:f,kClosed:g,kDestroyed:h,kDispatch:i,kNoProxyAgent:j,kHttpProxyAgent:k,kHttpsProxyAgent:l}=c(49176),m=c(48841),n=c(37417),o={"http:":80,"https:":443};class p extends d{#a7=null;#a8=null;#E=null;constructor(a={}){super(a),this.#E=a;let{httpProxy:b,httpsProxy:c,noProxy:d,...e}=a;this[j]=new n(e);let f=b??process.env.http_proxy??process.env.HTTP_PROXY;f?this[k]=new m({...e,uri:f}):this[k]=this[j];let g=c??process.env.https_proxy??process.env.HTTPS_PROXY;g?this[l]=new m({...e,uri:g}):this[l]=this[k],this.#a9()}[i](a,b){let c=new URL(a.origin);return this.#ba(c).dispatch(a,b)}[e](){return Promise.all([this[j].close(),!this[k][g]&&this[k].close(),!this[l][g]&&this[l].close()])}[f](a){return Promise.all([this[j].destroy(a),!this[k][h]&&this[k].destroy(a),!this[l][h]&&this[l].destroy(a)])}#ba(a){let{protocol:b,host:c,port:d}=a;return((c=c.replace(/:\d*$/,"").replace(/^\[(.+)\]$/,"$1").toLowerCase()).length>1&&46===c.charCodeAt(c.length-1)&&(c=c.slice(0,-1)),d=Number.parseInt(d,10)||o[b]||0,this.#bb(c,d))?"https:"===b?this[l]:this[k]:this[j]}#bb(a,b){if(this.#bc&&this.#a9(),0===this.#a8.length)return!0;for(let c=0;c<this.#a8.length;c++){let d=this.#a8[c];if("*"===d.hostname){if(d.port&&d.port!==b)continue;return!1}if((!d.port||d.port===b)&&(!d.wildcard&&a===d.hostname||a.slice(-(d.hostname.length+1))===`.${d.hostname}`))return!1}return!0}#a9(){let a=this.#E.noProxy??this.#bd,b=a.split(/[,\s]/),c=[];for(let a=0;a<b.length;a++){let d,e,f=b[a];if(!f)continue;let g=f.match(/^\[(.+)\]:(\d+)$/);if(g)d=g[1],e=Number.parseInt(g[2],10);else{let a=f.replace(/^\[(.+)\]$/,"$1"),b=1===(a.match(/:/g)||[]).length&&a.match(/^(.+):(\d+)$/);d=b?b[1]:a,e=b?Number.parseInt(b[2],10):0}let h=42===f.charCodeAt(0);c.push({hostname:d.replace(/^\*?\./,"").replace(/^(.+)\.$/,"$1").toLowerCase(),port:e,wildcard:h})}this.#a7=a,this.#a8=c}get #bc(){return void 0===this.#E.noProxy&&this.#a7!==this.#bd}get #bd(){return process.env.no_proxy??process.env.NO_PROXY??""}}a.exports=p},43212:(a,b,c)=>{"use strict";c(85450),c(30395),c(42541),c(90943),c(51525),c(84238),c(92843),c(64323),c(16605),c(42946),new TextEncoder},43469:(a,b,c)=>{"use strict";c.d(b,{buildClineHeaders:()=>f,resolveClineCredential:()=>e});let d=c(90053).rE||"0.0.0";function e(a){let b="string"==typeof a?.apiKey?a.apiKey.trim():"";return b?{token:b,isApiKey:!0}:{token:a?.accessToken,isApiKey:!1}}function f(a,b={},c={}){let e=function(a,b={}){let c=function(a,{isApiKey:b=!1}={}){if("string"!=typeof a)return"";let c=a.trim();return c?b||c.startsWith("workos:")?c:`workos:${c}`:""}(a,b);return c?`Bearer ${c}`:""}(a,c),g={"HTTP-Referer":"https://cline.bot","X-Title":"Cline","User-Agent":`ZevaiRouter/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"zevairouter","X-CLIENT-VERSION":d,"X-CORE-VERSION":d,"X-IS-MULTIROOT":"false",...b};return e&&(g.Authorization=e),g}},43904:(a,b,c)=>{"use strict";let{kMockCallHistoryAddLog:d}=c(80830),{InvalidArgumentError:e}=c(61448);function f(a,b,c,d,f){switch(b.operator){case"OR":return d.push(...c(a,f)),d;case"AND":return c(a,d);default:throw new e("options.operator must to be a case insensitive string equal to 'OR' or 'AND'")}}function g(a){return(b,c=this.logs)=>{if("string"==typeof b||null==b)return c.filter(c=>c[a]===b);if(b instanceof RegExp)return c.filter(c=>b.test(c[a]));throw new e(`${a} parameter should be one of string, regexp, undefined or null`)}}class h{constructor(a={}){this.body=a.body,this.headers=a.headers,this.method=a.method;let b=function(a){try{let b=new URL(a.path,a.origin);if(0!==b.search.length)return b;return b.search=new URLSearchParams(a.query).toString(),b}catch(a){throw new e("An error occurred when computing MockCallHistoryLog.url",{cause:a})}}(a);this.fullUrl=b.toString(),this.origin=b.origin,this.path=b.pathname,this.searchParams=Object.fromEntries(b.searchParams),this.protocol=b.protocol,this.host=b.host,this.port=b.port,this.hash=b.hash}toMap(){return new Map([["protocol",this.protocol],["host",this.host],["port",this.port],["origin",this.origin],["path",this.path],["hash",this.hash],["searchParams",this.searchParams],["fullUrl",this.fullUrl],["method",this.method],["body",this.body],["headers",this.headers]])}toString(){let a="";return this.toMap().forEach((b,c)=>{("string"==typeof b||null==b)&&(a=`${a}${c}->${b}|`),("object"==typeof b&&null!==b||Array.isArray(b))&&(a=`${a}${c}->${JSON.stringify(b)}|`)}),a.slice(0,-1)}}class i{logs=[];calls(){return this.logs}firstCall(){return this.logs.at(0)}lastCall(){return this.logs.at(-1)}nthCall(a){if("number"!=typeof a)throw new e("nthCall must be called with a number");if(!Number.isInteger(a))throw new e("nthCall must be called with an integer");if(1!==Math.sign(a))throw new e("nthCall must be called with a positive value. use firstCall or lastCall instead");return this.logs.at(a-1)}filterCalls(a,b){if(0===this.logs.length)return this.logs;if("function"==typeof a)return this.logs.filter(a);if(a instanceof RegExp)return this.logs.filter(b=>a.test(b.toString()));if("object"==typeof a&&null!==a){if(0===Object.keys(a).length)return this.logs;let c={operator:"OR",...function(a={}){let b={};if("operator"in a){if("string"!=typeof a.operator||"OR"!==a.operator.toUpperCase()&&"AND"!==a.operator.toUpperCase())throw new e("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");return{...b,operator:a.operator.toUpperCase()}}return b}(b)},d="AND"===c.operator?this.logs:[];return"protocol"in a&&(d=f(a.protocol,c,this.filterCallsByProtocol,d,this.logs)),"host"in a&&(d=f(a.host,c,this.filterCallsByHost,d,this.logs)),"port"in a&&(d=f(a.port,c,this.filterCallsByPort,d,this.logs)),"origin"in a&&(d=f(a.origin,c,this.filterCallsByOrigin,d,this.logs)),"path"in a&&(d=f(a.path,c,this.filterCallsByPath,d,this.logs)),"hash"in a&&(d=f(a.hash,c,this.filterCallsByHash,d,this.logs)),"fullUrl"in a&&(d=f(a.fullUrl,c,this.filterCallsByFullUrl,d,this.logs)),"method"in a&&(d=f(a.method,c,this.filterCallsByMethod,d,this.logs)),[...new Set(d)]}throw new e("criteria parameter should be one of function, regexp, or object")}filterCallsByProtocol=g.call(this,"protocol");filterCallsByHost=g.call(this,"host");filterCallsByPort=g.call(this,"port");filterCallsByOrigin=g.call(this,"origin");filterCallsByPath=g.call(this,"path");filterCallsByHash=g.call(this,"hash");filterCallsByFullUrl=g.call(this,"fullUrl");filterCallsByMethod=g.call(this,"method");clear(){this.logs=[]}[d](a){let b=new h(a);return this.logs.push(b),b}*[Symbol.iterator](){for(let a of this.calls())yield a}}a.exports.MockCallHistory=i,a.exports.MockCallHistoryLog=h},44193:(a,b,c)=>{"use strict";c.d(b,{B:()=>d});let d="opencode/latest/2.0.26/cli"},44282:(a,b,c)=>{"use strict";c.d(b,{$j:()=>j,Ie:()=>h,VR:()=>g});var d=c(55511),e=c(30395);let f=new Map([["&"," and "],["\uD83E\uDD84"," unicorn "],["♥"," love "],["\xdf","ss"],["ẞ","Ss"],["\xe4","ae"],["\xc4","Ae"],["\xf6","oe"],["\xd6","Oe"],["\xfc","ue"],["\xdc","Ue"],["\xc6","AE"],["\xe6","ae"],["\xd8","O"],["\xf8","o"],["Œ","OE"],["œ","oe"],["\xd0","D"],["\xf0","d"],["Đ","D"],["đ","d"],["\xde","TH"],["\xfe","th"],["Ł","L"],["ł","l"],["ı","i"]]);function g(a){if(!a)return(0,d.randomUUID)();let b=(0,d.createHash)("sha256").update(String(a)).digest("hex"),c=(3&parseInt(b[16],16)|8).toString(16);return`${b.slice(0,8)}-${b.slice(8,12)}-4${b.slice(13,16)}-${c}${b.slice(17,20)}-${b.slice(20,32)}`}let h=process.cwd(),i=(function(a){let b="";for(let c of a)b+=f.get(c)??c;return b.normalize("NFD").replace(/[̀-ͯ]/g,"")})(String(h??"")).replace(/([A-Z]{2,})(\d+)/g,"$1 $2").replace(/([a-z\d]+)([A-Z]{2,})/g,"$1 $2").replace(/([a-z\d])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-rt-z\d]+)/g,"$1 $2").toLowerCase().replace(/[^a-z\d]+/g,"-").replace(/^-+|-+$/g,"");function j({apiKey:a,sessionId:b,accept:c}={}){let f={"Content-Type":"application/json",...e.xq.commandcode?.headers||{},"x-project-slug":i,"x-session-id":b||(0,d.randomUUID)()};return a&&(f.Authorization=`Bearer ${a}`),c&&(f.Accept=c),f}},44822:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"codebuddy-intl",alias:"cbai",uiAlias:"cbai",priority:90,display:{name:"CodeBuddy",icon:"smart_toy",color:"#006EFF",website:"https://www.codebuddy.ai",notice:{signupUrl:"https://www.codebuddy.ai"}},category:"oauth",authModes:["oauth","apikey"],hasOAuth:!0,transport:{baseUrl:"https://www.codebuddy.ai/v2/chat/completions",format:"openai",forceStream:!0,thinkingFormat:"openai",headers:{"User-Agent":"IDE/2.108.1 CodeBuddy/2.108.1","X-Product":"SaaS","X-IDE-Type":"IDE","X-IDE-Name":"IDE","x-requested-with":"XMLHttpRequest","x-codebuddy-request":"1"},auth:{combined:!0,header:"Authorization",scheme:"bearer",hooks:["codebuddyHeaders"]},usage:{url:"https://www.codebuddy.ai/v2/billing/meter/get-user-resource"}},models:[{id:"glm-5.2",name:"GLM-5.2"},{id:"glm-5.1",name:"GLM-5.1"},{id:"glm-5.0",name:"GLM-5.0"},{id:"glm-5.0-turbo",name:"GLM-5.0-Turbo"},{id:"glm-5v-turbo",name:"GLM-5v-Turbo"},{id:"glm-4.7",name:"GLM-4.7"},{id:"minimax-m3",name:"MiniMax-M3"},{id:"minimax-m2.7",name:"MiniMax-M2.7"},{id:"kimi-k2.7",name:"Kimi-K2.7-Code"},{id:"kimi-k2.6",name:"Kimi-K2.6"},{id:"kimi-k2.5",name:"Kimi-K2.5"},{id:"hy3-preview",name:"Hy3 Preview"},{id:"deepseek-v4-pro",name:"DeepSeek-V4-Pro"},{id:"deepseek-v4.1-flash",name:"DeepSeek-V4.1-Flash"},{id:"deepseek-v3-2-volc",name:"DeepSeek-V3.2"}],oauth:{baseUrl:"https://www.codebuddy.ai",stateUrl:"https://www.codebuddy.ai/v2/plugin/auth/state",tokenUrl:"https://www.codebuddy.ai/v2/plugin/auth/token",refreshUrl:"https://www.codebuddy.ai/v2/plugin/auth/token/refresh",userAgent:"IDE/2.63.2 CodeBuddy/2.63.2",platform:"ide",pollInterval:5e3},features:{usage:!0,usageApikey:!0},serviceKinds:["llm"]}},44991:(a,b,c)=>{"use strict";c.d(b,{D:()=>f});var d=c(88164),e=c(30395);class f extends d.L{constructor(){super("ollama-local")}buildUrl(a,b,c=0,d=null){return`${(0,e.Ak)(d)}/api/chat`}}},45221:(a,b,c)=>{"use strict";let{runtimeFeatures:d}=c(56758),{maxUnsigned16Bit:e,opcodes:f}=c(62026),g=null,h=8192,i=d.has("crypto")?c(77598).randomFillSync:null;function j(){return 8192===h&&(h=0,i(g??=Buffer.allocUnsafeSlow(8192),0,8192)),[g[h++],g[h++],g[h++],g[h++]]}class k{constructor(a){this.frameData=a}createFrame(a){let b=this.frameData,c=j(),d=b?.byteLength??0,f=d,g=6;d>e?(g+=8,f=127):d>125&&(g+=2,f=126);let h=Buffer.allocUnsafe(d+g);h[0]=h[1]=0,h[0]|=128,h[0]=(240&h[0])+a,h[g-4]=c[0],h[g-3]=c[1],h[g-2]=c[2],h[g-1]=c[3],h[1]=f,126===f?h.writeUInt16BE(d,2):127===f&&(h[2]=h[3]=0,h.writeUIntBE(d,4,6)),h[1]|=128;for(let a=0;a<d;++a)h[g+a]=b[a]^c[3&a];return h}static createFastTextFrame(a){let b=j(),c=a.length;for(let d=0;d<c;++d)a[d]^=b[3&d];let d=c,g=6;c>e?(g+=8,d=127):c>125&&(g+=2,d=126);let h=Buffer.allocUnsafeSlow(g);return h[0]=128|f.TEXT,h[1]=128|d,h[g-4]=b[0],h[g-3]=b[1],h[g-2]=b[2],h[g-1]=b[3],126===d?h.writeUInt16BE(c,2):127===d&&(h[2]=h[3]=0,h.writeUIntBE(c,4,6)),[h,a]}}a.exports={WebsocketFrameSend:k,generateMask:j}},45874:(a,b,c)=>{"use strict";c.d(b,{Xx:()=>j,exportSettings:()=>k,getSettings:()=>i});var d=c(52825),e=c(50743);let f={cloudEnabled:!1,tunnelEnabled:!1,tunnelUrl:"",tunnelProvider:"cloudflare",tailscaleEnabled:!1,tailscaleUrl:"",stickyRoundRobinLimit:3,providerStrategies:{},comboStrategy:"fallback",comboStickyRoundRobinLimit:1,comboStrategies:{},capacityAdapter:{vision:{enabled:!1,roundRobin:!1,models:[]},pdf:{enabled:!1,roundRobin:!1,models:[]},audioInput:{enabled:!1,roundRobin:!1,models:[]},videoInput:{enabled:!1,roundRobin:!1,models:[]}},responseCacheEnabled:!1,requireLogin:!0,tunnelDashboardAccess:!0,authMode:"password",oidcIssuerUrl:"",oidcClientId:"",oidcClientSecret:"",oidcScopes:"openid profile email",oidcLoginLabel:"Sign in with OIDC",ssoType:"oidc",samlEntryPoint:"",samlIssuer:"urn:zevairouter:sp",samlCert:"",samlLoginLabel:"Sign in with SAML SSO",samlAttributeEmail:"email",samlAttributeName:"name",enableObservability:!0,observabilityMaxRecords:1e3,observabilityBatchSize:20,observabilityFlushIntervalMs:5e3,observabilityMaxJsonSize:5,outboundProxyEnabled:!1,outboundProxyUrl:"",outboundNoProxy:"",mitmRouterBaseUrl:"http://localhost:1997",dnsToolEnabled:{},rtkEnabled:!0,headroomEnabled:!1,headroomUrl:"http://localhost:8787",headroomCompressUserMessages:!1,headroomTimeoutMs:3e3,headroomCodeAware:!1,headroomKompress:!0,cavemanEnabled:!1,cavemanLevel:"full",ponytailEnabled:!1,ponytailLevel:"full",customPromptEnabled:!1,customPrompt:"",pxpipeEnabled:!1,pxpipeAutoInstall:!0,pxpipeMinChars:25e3,pxpipeTimeoutMs:15e3,contextInjectionEnabled:!1,v11Flags:{kiroIntegrity:!1,outboundPolicy:!1,compatV11:!1,refreshLanes:!1,adaptiveShadow:!1,adaptiveRoute:!1,registryV2:!1,quotaStreamV2:!1},trustedOutboundTargets:[],fiveSimApiKey:"",providerOverrides:{},quotaVisibility:{}};async function g(){let a=(await (0,d.cK)()).get("SELECT data FROM settings WHERE id = 1");return a?(0,e.q)(a.data,{}):{}}function h(a){let b={...f,...a||{}};for(let[a,c]of Object.entries(f))void 0===b[a]&&("outboundProxyEnabled"===a&&"string"==typeof b.outboundProxyUrl&&b.outboundProxyUrl.trim()?b[a]=!0:b[a]=c);return b}async function i(){return h(await g())}async function j(a){let b,c=await (0,d.cK)();return c.transaction(()=>{let d=c.get("SELECT data FROM settings WHERE id = 1");b={...d?(0,e.q)(d.data,{}):{},...a},c.run("INSERT INTO settings(id, data) VALUES(1, ?) ON CONFLICT(id) DO UPDATE SET data = excluded.data",[(0,e.s)(b)])}),h(b)}async function k(){return await g()}},46455:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{NS:()=>A,dg:()=>C,qX:()=>z});var e=c(5210),f=c(70321),g=c(27054),h=c(65333),i=c(99939),j=c(79154),k=c(63993),l=c(36633),m=c(39817),n=a([e,h]);[e,h]=n.then?(await n)():n;let D=["expired","authentication","unauthorized","401","re-authorize"],E=globalThis._quotaUsageInflight??=new Map,F=new Map;function o(a,b=Date.now()){let c=F.get(a.id),d=c?.refreshToken===a.refreshToken?(c.failures||0)+1:1,e=Math.min(216e5,3e5*2**(d-1));F.set(a.id,{failures:d,retryAt:b+e,refreshToken:a.refreshToken})}function p(a){F.delete(a.id)}function q(a){return a?.provider==="codex"&&!!a.providerSpecificData?.codexRefreshBlockedAt||a?.failureClass==="reauth_required"||!!a?.quarantinedAt}function r(a){return!!a?.accessToken&&!function(a,b=Date.now()){let c=(0,j.Dz)(a);return null!==c&&c<=b}(a)}function s(a){if("codex"===a)return"Codex";let b=String(a||"provider");return b.charAt(0).toUpperCase()+b.slice(1)}function t(a){return`${s(a)} refresh token rejected; reconnect this account.`}function u(a){return String(a?.code||"invalid_refresh_token").replace(/[^a-zA-Z0-9_.:-]/g,"_").slice(0,120)||"invalid_refresh_token"}async function v(a,b){let c=new Date().toISOString(),d=u(b),e={lastError:t(a.provider),lastErrorAt:c,lastErrorType:"auth",errorCode:d,failureClass:"reauth_required"};"codex"===a.provider&&(e.providerSpecificData={...a.providerSpecificData||{},codexRefreshBlockedAt:c,codexRefreshErrorCode:d});try{return await (0,f.updateProviderConnection)(a.id,e)||{...a,...e}}catch(b){return console.warn(`[Usage] ${s(a.provider)} refresh rejection state was not persisted: ${b.message}`),{...a,...e}}}async function w(a,b){let c=b?.permanent===!0?b:(0,i.R_)({code:u(b)}),d=await v(a,c);if(r(a))return{connection:d,refreshed:!1,refreshBlocked:!0,refreshError:c};throw c}function x(a){return!!(a?.quotas&&"object"==typeof a.quotas&&Object.keys(a.quotas).length>0)}function y(a,b){return!!(a?.quotaFetchFailed===!0&&!a.accountDead&&!x(a)&&x(b?.usage))}async function z(a,b=!1,c=null){let d;if(a?.id){let b=await (0,f.getProviderConnectionById)(a.id).catch(()=>null),c=(0,i.kI)(a,b);c!==a&&(a={...a,refreshToken:c.refreshToken,accessToken:c.accessToken,expiresAt:c.expiresAt,lastRefreshAt:c.lastRefreshAt})}let e=(0,h.SB)(a.provider);if(q(a)){if(r(a))return{connection:a,refreshed:!1,refreshBlocked:!0};throw(0,i.R_)({code:a.providerSpecificData?.codexRefreshErrorCode||a.errorCode||"invalid_refresh_token"})}let g={accessToken:a.accessToken,refreshToken:a.refreshToken,idToken:a.idToken,expiresAt:a.expiresAt||a.tokenExpiresAt,lastRefreshAt:a.lastRefreshAt,connectionId:a.id,providerSpecificData:a.providerSpecificData,copilotToken:a.providerSpecificData?.copilotToken,copilotTokenExpiresAt:a.providerSpecificData?.copilotTokenExpiresAt};if(!(b||e.needsRefresh(g)))return{connection:a,refreshed:!1};if(!b&&function(a,b=Date.now()){let c=F.get(a.id);return!!c&&(c.refreshToken!==a.refreshToken?(F.delete(a.id),!1):c.retryAt>b)}(a))return{connection:a,refreshed:!1,refreshFailed:!0,refreshBackedOff:!0};try{d=await e.refreshCredentials(g,console,c)}catch(b){if(b?.permanent===!0)return p(a),w(a,b);throw b?.name!=="AbortError"&&o(a),b}if((0,i.jT)(d))return p(a),w(a,(0,i.R_)(d));if(!d){if(o(a),a.accessToken)return{connection:a,refreshed:!1,refreshFailed:!0};throw Error("Failed to refresh credentials. Please re-authorize the connection.")}p(a);let j={updatedAt:new Date().toISOString()};d.accessToken&&(j.accessToken=d.accessToken),d.refreshToken&&(j.refreshToken=d.refreshToken),d.idToken&&(j.idToken=d.idToken),d.lastRefreshAt&&(j.lastRefreshAt=d.lastRefreshAt),d.expiresIn?(j.expiresAt=new Date(Date.now()+1e3*d.expiresIn).toISOString(),j.expiresIn=d.expiresIn):d.expiresAt&&(j.expiresAt=d.expiresAt);let k={...d.providerSpecificData||{},...d.copilotToken?{copilotToken:d.copilotToken}:{},...d.copilotTokenExpiresAt?{copilotTokenExpiresAt:d.copilotTokenExpiresAt}:{}};return Object.keys(k).length>0&&(j.providerSpecificData={...a.providerSpecificData||{},...k}),await (0,f.updateProviderConnection)(a.id,j),{connection:{...a,...j,providerSpecificData:j.providerSpecificData||a.providerSpecificData},refreshed:!0}}function A(a){let b;if(!a)return!1;let c="api-key"===(b=String(a.authType||"").toLowerCase().trim())||"api_key"===b||"api key"===b?"apikey":b;return"oauth"===c||"apikey"===c&&l.jO.includes(a.provider)}async function B(a,b,c){let d,{writeCache:e=!1,force:h=!1}=b,i=await (0,f.getProviderConnectionById)(a);if(!i)return{error:"Connection not found",notFound:!0};if(!A(i))return{message:"Usage not available for this connection"};let j=await (0,k.B)(i.providerSpecificData),l={connectionProxyEnabled:!0===j.connectionProxyEnabled,connectionProxyUrl:j.connectionProxyUrl||"",connectionNoProxy:j.connectionNoProxy||"",vercelRelayUrl:j.vercelRelayUrl||"",strictProxy:!1},n=i,o="oauth"===n.authType,p=!1;if(o){let a;try{a=await z(n,h,l)}catch(a){if(a?.permanent===!0)return{message:t(n.provider),reauthRequired:!0,quotas:{}};throw a}n=a.connection,p=!0===a.refreshFailed}if(o&&p&&!r(n))d={message:`${s(n.provider)} credential refresh is temporarily unavailable; will retry later.`,quotaFetchFailed:!0,quotas:{}};else if(d=await (0,g.my)(n,l),o&&function(a){if(!a?.message)return!1;let b=a.message.toLowerCase();return D.some(a=>b.includes(a))}(d)&&n.refreshToken&&!q(n)&&!p)try{n=(await z(n,!0,l)).connection,d=await (0,g.my)(n,l)}catch(a){console.warn(`[Usage] ${n.provider}: force refresh failed: ${a.message}`)}if((e||c.writeCache)&&d&&!d.error)try{if("codebuddy"===n.provider||"codebuddy-cn"===n.provider||"codebuddy-intl"===n.provider){let a=null,b=await (0,f.Iu)(n.id,(b,c)=>{if(y(d,c)){var e;return e=d,a={...(0,m.pX)(c.usage,b),stale:!0,refreshError:e.message},{}}return{quotaUsage:(0,m.pX)(d,b)}});d=a||b?.quotaUsage||d}else{let a=await (0,f.getQuotaSnapshot)(n.id);y(d,a)?d={...a.usage,stale:!0,refreshError:d.message}:await (0,f.KK)(n.id,n.provider,d)}}catch(a){console.warn(`[QuotaCache] save failed for ${n.id}: ${a.message}`)}else if("codebuddy"===n.provider||"codebuddy-cn"===n.provider||"codebuddy-intl"===n.provider){let a=await (0,f.getProviderConnectionById)(n.id)||n;d=(0,m.pX)(d,a)}return d}async function C(a,b={}){let c=E.get(a);if(c||(c={active:null,queuedForce:null},E.set(a,c)),c.queuedForce)return b.writeCache&&(c.queuedForce.writeCache=!0),c.queuedForce.promise;if(c.active&&(!b.force||c.active.force))return b.writeCache&&(c.active.writeCache=!0),c.active.promise;let d=b=>{c.active===b&&(c.active=null),c.active||c.queuedForce||E.get(a)!==c||E.delete(a)};if(c.active){let e=c.active.promise,f={force:!0,writeCache:!0===b.writeCache,promise:null},g=()=>(c.queuedForce===f&&(c.queuedForce=null),c.active=f,B(a,{...b,force:!0},f));return f.promise=e.then(g,g).finally(()=>d(f)),c.queuedForce=f,f.promise}let e={force:!0===b.force,writeCache:!0===b.writeCache,promise:null};return c.active=e,e.promise=B(a,b,e).finally(()=>d(e)),e.promise}d()}catch(a){d(a)}})},46714:(a,b,c)=>{"use strict";c.d(b,{dv:()=>m,fM:()=>k,vP:()=>j}),c(64334),c(2206),c(6699);let d=Object.freeze(["none","minimal","low","medium","high","xhigh","max","ultra"]),e=Object.freeze({xhigh:Object.freeze(d.slice(0,6)),max:Object.freeze(d.slice(0,7)),ultra:d}),f=Object.freeze({off:"none",on:"high",thinking:"high"}),g=Object.freeze(["minimal","xhigh","ultra","medium","none","high","max","low"]),h=Object.freeze(["low","medium","high","xhigh","max"]),i=new Set(["gpt-6.1-sol","gpt-6.1-terra","gpt-6-sol","gpt-6-luna"]);function j(a){let b;return i.has(String(a||"").toLowerCase().replace(/\([^()]+\)\s*$/,"").replace(/\[1m\]$/i,"").replace(/-review$/,""))?h:e["gpt-5.6"===(b="string"==typeof a?a.toLowerCase():"")||/^gpt-5\.6-(?:sol|terra)(?:$|[-(:/])/.test(b)?"ultra":/^gpt-5\.6-luna(?:$|[-(:/])/.test(b)?"max":"xhigh"]}function k(a,b){let c="string"==typeof b?b.trim().toLowerCase():"",e=f[c]||c,g=d.indexOf(e),h=j(a);if(-1===g)return h.includes("low")?"low":h[0];let i=h[h.length-1],k=d.indexOf(i),l=d[Math.min(g,k)];return h.includes(l)?l:h[0]}Object.freeze([{pattern:"deepseek-ai/deepseek-v4*",levels:Object.freeze(["none","low","high","max"])},{pattern:"zai-org/glm-5.3*",levels:Object.freeze(["low","high"])},{pattern:"glm-5.3*",levels:Object.freeze(["low","high"])}]),Object.freeze({openai:Object.freeze(["none","minimal","low","medium","high","xhigh"]),"claude-adaptive":Object.freeze(["none","low","medium","high","xhigh","max"]),"claude-budget":Object.freeze(["none","low","medium","high","xhigh","max"]),"gemini-level":Object.freeze(["minimal","low","medium","high"]),"gemini-budget":Object.freeze(["none","low","medium","high"]),zai:Object.freeze(["none","thinking"]),qwen:Object.freeze(["none","low","medium","high"]),kimi:Object.freeze(["none","low","medium","high","max"]),deepseek:Object.freeze(["none","high","max"]),commandcode:Object.freeze(["none","low","medium","high","xhigh","max"]),minimax:Object.freeze(["none","thinking"]),hunyuan:Object.freeze(["none","low","medium","high"]),step:Object.freeze(["none","low","medium","high"])}),Object.freeze(["none","minimal","low","medium","high","xhigh","max"]);let l=Object.freeze(["none","low","medium","high","max"]);function m(a){if("string"!=typeof a)return{cleanModel:a,effort:null};let b=a.toLowerCase();for(let c of g)if(b.endsWith(`-${c}`))return{cleanModel:a.slice(0,-(c.length+1)),effort:c};return{cleanModel:a,effort:null}}Object.freeze(["none","low","medium","high"]),Object.freeze([{pattern:"*gemini-4*",levels:Object.freeze(["low","medium","high"])},{pattern:"*claude*4.6*",levels:l},{pattern:"*claude*4-6*",levels:l},{provider:"codebuddy-cn",pattern:"deepseek-v4-pro",levels:Object.freeze(["low","high","xhigh"])},{provider:"codebuddy-cn",pattern:"deepseek-v4.1-flash",levels:Object.freeze(["low","high","max"])},{pattern:"*deepseek-v4.1-flash-free*",levels:Object.freeze(["low","high","max"])},{pattern:"*deepseek-v4.*",levels:Object.freeze(["none","low","medium","high","xhigh","max"])},{pattern:"*deepseek-v4-*",levels:Object.freeze(["none","low","medium","high","xhigh","max"])},{provider:"codebuddy-cn",pattern:"glm-5.3",levels:Object.freeze(["low","high","max"])},{provider:"codebuddy-cn",pattern:"glm-5.3-flash",levels:Object.freeze(["low","high","max"])},{provider:"codebuddy-cn",pattern:"glm-5.2",levels:Object.freeze(["high","xhigh"])},{provider:"codebuddy-cn",pattern:"kimi-k2.8-preview",levels:Object.freeze(["low","medium","high"])},{provider:"codebuddy-cn",pattern:"hy3",levels:Object.freeze(["low","high"])},{provider:"codebuddy-cn",pattern:"hy4-preview",levels:Object.freeze(["high"])},{provider:"nvidia-build",pattern:"moonshotai/kimi-k3.1-pro",levels:Object.freeze(["low","medium","high","max"])},{provider:"nvb",pattern:"moonshotai/kimi-k3.1-pro",levels:Object.freeze(["low","medium","high","max"])},{provider:"nvidia-build",pattern:"*",levels:Object.freeze(["low","medium","high"])},{provider:"nvb",pattern:"*",levels:Object.freeze(["low","medium","high"])},{provider:"codebuddy-intl",pattern:"deepseek-v4*",levels:Object.freeze(["low","high","xhigh"])}])},46870:(a,b,c)=>{"use strict";c.d(b,{kF:()=>a2});var d=c(77598),e=c.n(d),f=c(69384),g=c(19897),h=c(28113),i=c(65556);let j=["SAPISID","__Secure-1PAPISID","__Secure-3PAPISID"],k=["SID","HSID","SSID"];class l extends Error{constructor(a){super(a),this.name="AistudioCredentialError",this.status=401}}function m(a){if(!a||"object"!=typeof a||!a.name||"string"!=typeof a.value||!a.domain)return null;let b="number"==typeof a.expires?a.expires:"number"==typeof a.expirationDate?a.expirationDate:-1,c=String(a.sameSite||"").toLowerCase(),d="strict"===c?"Strict":"none"===c||"no_restriction"===c?"None":"Lax";return{name:String(a.name),value:a.value,domain:String(a.domain),path:a.path||"/",expires:b>0?b:-1,httpOnly:!0===a.httpOnly,secure:!0===a.secure||"None"===d,sameSite:d,..."string"==typeof a.partitionKey&&a.partitionKey?{partitionKey:a.partitionKey}:{}}}function n(a){let b,c="string"==typeof a?a.trim():a?JSON.stringify(a):"";if(!c)throw new l("AI Studio storage state is empty");try{b=JSON.parse(c)}catch{throw new l("AI Studio storage state is not valid JSON")}let d=Array.isArray(b)?b:Array.isArray(b?.cookies)?b.cookies:null;if(!d)throw new l("Expected a storage state ({cookies, origins}) or a cookie array");return{cookies:d.map(m).filter(Boolean),origins:Array.isArray(b?.origins)?b.origins:[]}}function o(a,b,c="https://aistudio.google.com/",d=Date.now()/1e3){let e=new URL(c).hostname.toLowerCase(),f=null;for(let c of a?.cookies||[])c.name===b&&function(a,b){let c=a.replace(/^\./,"").toLowerCase();return b===c||b.endsWith(`.${c}`)}(c.domain,e)&&(c.expires>0&&c.expires<=d||(!f||c.domain.length>f.domain.length)&&(f=c));return f?f.value:null}function p(a){let b;try{b=n(a)}catch(a){return{valid:!1,error:a.message}}let c=j.filter(a=>!o(b,a));if(c.length)return{valid:!1,error:`Missing Google session cookies: ${c.join(", ")}`};let d=k.filter(a=>!o(b,a)),e=d.length?`Cookie export looks incomplete (missing ${d.join(", ")}); Google may sign this session out within minutes. Use Login via Browser, or export every google.com cookie from a browser session you keep signed in.`:null;return{valid:!0,error:null,count:b.cookies.length,...e?{warning:e}:{}}}function q(a){let b=(a?.cookies||[]).map(a=>`${a.domain}|${a.path}|${a.name}=${a.value}|${a.expires}`).sort().join("\n");return(0,d.createHash)("sha256").update(b).digest("hex")}function r(a){let b="string"==typeof a?.apiKey?a.apiKey.trim():"";if(b)return b;let c=a?.providerSpecificData;return c?.storageState?"string"==typeof c.storageState?c.storageState:JSON.stringify(c.storageState):""}var s=c(64271);let t="skip_thought_signature_validator",u=[7,8,9,10],v={string:1,number:2,integer:3,boolean:4,array:5,object:6},w={type:0,format:1,description:2,nullable:3,enum:4,items:5,properties:6,required:7,minProperties:8,maxProperties:9,minimum:10,maximum:11,minLength:12,maxLength:13,pattern:14,anyOf:17,maxItems:20,minItems:21,propertyOrdering:22},x=["minItems","maxItems","minProperties","maxProperties","minLength","maxLength"];function y(a,b,c){for(;a.length<=b;)a.push(null);return a[b]=c,a}function z(a){let b=String(a||"");if(b.length<=63)return b;let c=`_${(0,d.createHash)("sha256").update(b).digest("hex").slice(0,12)}`;return b.slice(0,63-c.length)+c}function A(a){let b=a&&"object"==typeof a&&!Array.isArray(a)?a:{result:a},c=Object.keys(b).filter(a=>void 0!==b[a]).sort();return 0===c.length?[]:[c.map(a=>[a,function a(b){return null==b?[0]:"number"==typeof b?[null,Number.isFinite(b)?b:0]:"string"==typeof b?[null,null,b]:"boolean"==typeof b?[null,null,null,b]:Array.isArray(b)?[null,null,null,null,null,[b.map(a)]]:"object"==typeof b?[null,null,null,null,A(b)]:[null,null,String(b)]}(b[a])])]}let B=()=>[{type:"string"},{type:"number"},{type:"boolean"}];function C(a){if(!0===a||null==a)return{anyOf:[...B(),{type:"array",items:{anyOf:B(),nullable:!0}}],nullable:!0};if(!1===a||"object"!=typeof a||Array.isArray(a))return{type:"string"};let b={...a},c={};if(Object.prototype.hasOwnProperty.call(b,"const")){let a=b.const;"string"==typeof a?(b.type="string",b.enum=[a]):"boolean"==typeof a?b.type="boolean":"number"==typeof a?(b.type=Number.isInteger(a)?"integer":"number",b.minimum=a,b.maximum=a):null===a&&(b.type="string",b.nullable=!0)}let d=b.type,e=!0===b.nullable;Array.isArray(d)&&(e=e||d.some(a=>"null"===String(a).toLowerCase()),d=d.find(a=>"null"!==String(a).toLowerCase()));let f=Array.isArray(b.anyOf)?b.anyOf:Array.isArray(b.oneOf)?b.oneOf:null;if(f){let a=f.filter(a=>!(a&&"object"==typeof a&&"null"===String(a.type).toLowerCase()));if(a.length!==f.length&&(e=!0),1===(f=a).length&&!d){let a=C({...f[0],description:b.description??f[0]?.description});return e&&(a.nullable=!0),a}}if(Array.isArray(b.allOf)&&b.allOf.length){let a={...b};for(let c of(delete a.allOf,b.allOf))c&&"object"==typeof c&&(a.type??=c.type,c.properties&&(a.properties={...a.properties||{},...c.properties}),Array.isArray(c.required)&&(a.required=[...new Set([...a.required||[],...c.required])]),a.description??=c.description);return C(a)}if((d="string"==typeof d?d.toLowerCase():"")||(b.properties?d="object":b.items?d="array":Array.isArray(b.enum)&&(d="string")),"null"===d&&(d="string",e=!0),d&&v[d]&&(c.type=d),"string"==typeof b.format&&(c.format=b.format),"string"==typeof b.description&&b.description&&(c.description=b.description),e&&(c.nullable=!0),Array.isArray(b.enum)){let a=b.enum.filter(a=>"string"==typeof a&&""!==a);a.length===b.enum.length&&a.length>0?c.enum=a:b.enum.length>0&&(c.description=`${c.description?`${c.description}
220
220
  `:""}Allowed values: ${JSON.stringify(b.enum)}`)}if("array"===c.type&&(c.items=C(void 0===b.items||b.items)),"object"===c.type&&b.properties&&"object"==typeof b.properties){let a={};for(let c of Object.keys(b.properties).sort())!1!==b.properties[c]&&(a[c]=C(b.properties[c]));if(Array.isArray(b.required))for(let c of b.required)"string"!=typeof c||a[c]||(a[c]=C(!0));Object.keys(a).length&&(c.properties=a)}if("object"===c.type&&Array.isArray(b.required)){let a=b.required.filter(a=>"string"==typeof a);a.length&&(c.required=a)}for(let a of x)Number.isFinite(Number(b[a]))&&null!==b[a]&&""!==b[a]&&(c[a]=Math.trunc(Number(b[a])));for(let a of["minimum","maximum"])"number"==typeof b[a]&&Number.isFinite(b[a])&&(c[a]=b[a]);if("string"==typeof b.pattern&&(c.pattern=b.pattern),Array.isArray(b.propertyOrdering)&&(c.propertyOrdering=b.propertyOrdering.filter(a=>"string"==typeof a)),!c.type&&f&&f.length&&(c.anyOf=f.map(C)),!c.type&&!c.anyOf){let a=C(!0);return{...a,...c,anyOf:a.anyOf,nullable:!0}}return c}function D(a){let b=[];for(let[c,d]of Object.entries(a)){let a=w[c];if(void 0===a)continue;let e=d;"type"===c?e=v[d]||0:"items"===c?e=D(d):"properties"===c?e=Object.keys(d).sort().map(a=>[a,D(d[a])]):"anyOf"===c&&(e=d.map(D)),y(b,a,e)}return function(a){if(void 0===a[0]||null===a[0]||0===a[0]){let b=Array.isArray(a[17])?a[17][0]:null;a[0]=Array.isArray(b)&&b[0]?b[0]:1,5===a[0]&&Array.isArray(b)&&b[5]&&!a[5]&&y(a,5,b[5])}}(b),b}function E(a,{realSignature:b=()=>null}={}){let c=[],d=[];for(let d of a||[]){let a=[];for(let c of d?.parts||[]){let d=function(a,{realSignature:b}){if(!a||"object"!=typeof a||!0===a.thought)return null;if(a.functionCall){let c=[z(a.functionCall.name),A(a.functionCall.args||{})];a.functionCall.id&&c.push(String(a.functionCall.id));let d=y([],10,c);return y(d,14,b(a.thoughtSignature||a.thought_signature)||t)}if(a.functionResponse){let b=a.functionResponse.response,c=[z(a.functionResponse.name),A(b??{})];return a.functionResponse.id&&c.push(String(a.functionResponse.id)),y([],11,c)}let c=a.inlineData||a.inline_data;if(c?.data)return[null,null,[c?.mimeType||c?.mime_type||"application/octet-stream",String(c.data)]];let d=a.fileData||a.file_data;return d?.fileUri||d?.file_uri?y([],6,[d.mimeType||d.mime_type||"application/octet-stream",d.fileUri||d.file_uri]):"string"==typeof a.text&&""!==a.text?[null,a.text]:null}(c,{realSignature:b});d&&a.push(d)}if(!a.length)continue;let e="model"===d.role||"assistant"===d.role?"model":"user",f=c.at(-1);f&&f[1]===e?f[0].push(...a):c.push([a,e])}for(let[a]of c)for(let b of a)d.push("string"==typeof b[1]?b[1]:Array.isArray(b[2])?String(b[2][1]||""):"");let e=(c.at(-1)?.[0]||[]).filter(a=>"string"==typeof a[1]&&""!==a[1]).map(a=>a[1]).join(" ");return{contents:c,binding:d.join(" "),page:e}}function F(a){if("string"!=typeof a)return"";let b=a.trim().toLowerCase();return b&&"auto"!==b&&"thinking_level_unspecified"!==b?"xhigh"===b||"max"===b||"ultra"===b?"high":"none"===b||"off"===b?"minimal":s.Bu[b]?b:"":""}function G(a,b){if(!Array.isArray(b)||0===b.length||b.includes(a))return a;let c=s.se.indexOf(a);if(c<0)return a;for(let a=1;a<s.se.length;a++){let d=s.se[c-a];if(void 0!==d&&b.includes(d))return d;let e=s.se[c+a];if(void 0!==e&&b.includes(e))return e}return a}function H(a,b){if(!a?.thinkingLevel)return null;let c=F(b);return c?G(s.Bu[c],a.thinkingLevels):a.defaultThinkingLevel||2}function I(a,b){let c=Math.max(a?.outputLimit||0,a?.continuedOutputTokens||0),d=Number(b),e=Number.isFinite(d)&&d>0?Math.floor(d):0;return c?e?Math.min(e,c):c:e||null}function J({model:a,contents:b,system:c,tools:d,config:e,continuationToken:f=""}){let g=a?.continuedOutputTokens>0,h=Array(f?17:11).fill(null);return h[0]=`models/${String(a.id).replace(/^models\//,"")}`,h[1]=b,h[2]=u.map(a=>[null,null,a,5]),h[3]=e,c&&(h[5]=c),d&&(h[6]=d),g||(h[10]=1),f&&(h[16]=f),h}let K={0:"FINISH_REASON_UNSPECIFIED",1:"STOP",2:"MAX_TOKENS",3:"SAFETY",4:"RECITATION",5:"OTHER",6:"LANGUAGE",7:"BLOCKLIST",8:"PROHIBITED_CONTENT",9:"SPII",10:"MALFORMED_FUNCTION_CALL",11:"IMAGE_SAFETY",12:"UNEXPECTED_TOOL_CALL",13:"TOO_MANY_TOOL_CALLS",14:"IMAGE_PROHIBITED_CONTENT",15:"IMAGE_OTHER",16:"NO_IMAGE",17:"IMAGE_RECITATION",18:"MISSING_THOUGHT_SIGNATURE",19:"MALFORMED_RESPONSE"},L={0:"BLOCK_REASON_UNSPECIFIED",1:"SAFETY",2:"OTHER",3:"BLOCKLIST",4:"PROHIBITED_CONTENT",5:"IMAGE_SAFETY"};class M{constructor(){this.inString=!1,this.escaped=!1,this.previous=""}push(a){let b="";for(let c of a){if(this.inString){this.escaped?this.escaped=!1:"\\"===c?this.escaped=!0:'"'===c&&(this.inString=!1),b+=c;continue}if('"'===c){this.inString=!0,this.previous=c,b+=c;continue}if(","===c&&("["===this.previous||","===this.previous)){this.previous=c,b+="null,";continue}if("]"===c&&","===this.previous){this.previous=c,b+="null]";continue}/\s/.test(c)||(this.previous=c),b+=c}return b}}class N{constructor(){this.normalizer=new M,this.depth=0,this.inString=!1,this.escaped=!1,this.frame="",this.listClosed=!1,this.tail="",this.started=!1,this.prefix=""}push(a){let b=String(a);if(!this.started){this.prefix+=b;let a=this.prefix.replace(/^\s+/,"");if(a.startsWith(")]}'")){let c=a.indexOf("\n");if(c<0)return[];b=a.slice(c+1)}else{if(a.length<4&&")]}'".startsWith(a))return[];b=a}this.started=!0,this.prefix=""}let c=this.normalizer.push(b),d=[];for(let a of c){if(this.listClosed){this.tail+=a;continue}if(this.inString){this.depth>=3&&(this.frame+=a),this.escaped?this.escaped=!1:"\\"===a?this.escaped=!0:'"'===a&&(this.inString=!1);continue}if('"'===a){this.inString=!0,this.depth>=3&&(this.frame+=a);continue}if("["===a||"{"===a){this.depth++,this.depth>=3&&(this.frame+=a);continue}if("]"===a||"}"===a){this.depth>=3&&(this.frame+=a),this.depth--,2===this.depth&&this.frame?(d.push(JSON.parse(this.frame)),this.frame=""):1===this.depth?this.listClosed=!0:0===this.depth&&(this.listClosed=!0,this.tail=a);continue}this.depth>=3&&(this.frame+=a)}return d}trailer(){if(!this.tail)return null;try{let a=JSON.parse(`[null${this.tail}`);return Array.isArray(a)?a[1]??null:null}catch{return null}}}function O(a){let b=Number(a);return Number.isFinite(b)?b:0}function P(a,{names:b=null,systemTokens:c=0,continuable:d=!1}={}){if(!Array.isArray(a))return{chunk:null};let e=function(a,b=0){if(!Array.isArray(a)||null===a[0]||void 0===a[0]||null===a[2]||void 0===a[2])return null;let c={promptTokenCount:Math.max(0,O(a[0])-b),candidatesTokenCount:O(a[1]),totalTokenCount:Math.max(0,O(a[2])-b)};return null!==a[3]&&void 0!==a[3]&&(c.cachedContentTokenCount=O(a[3])),null!==a[7]&&void 0!==a[7]&&(c.toolUsePromptTokenCount=O(a[7])),null!==a[9]&&void 0!==a[9]&&(c.thoughtsTokenCount=O(a[9])),(null===a[1]||void 0===a[1])&&(c.candidatesTokenCount=Math.max(0,c.totalTokenCount-c.promptTokenCount-(c.thoughtsTokenCount||0)-(c.toolUsePromptTokenCount||0))),c}(a[2],c);if(null===a[0]||void 0===a[0]){let b=a[1];return Array.isArray(b)?{chunk:{promptFeedback:{blockReason:L[b[0]]||`BLOCK_REASON_${b[0]}`,...b[2]?{blockReasonMessage:b[2]}:{}}},blocked:!0,usage:e}:{chunk:e?{usageMetadata:e}:null,usage:e}}let f=Array.isArray(a[0])?a[0][0]:null;if(!Array.isArray(f))return{chunk:null,usage:e};let g=Array.isArray(f[0])?f[0]:null,h=[];for(let a of Array.isArray(g?.[0])?g[0]:[])h.push(...function(a,b){if(!Array.isArray(a))return[];let c=1===a[12]||!0===a[12],d="string"==typeof a[14]?a[14]:"",e=[];if("string"==typeof a[1]&&""!==a[1]&&e.push({text:a[1],...c?{thought:!0}:{},...d?{thoughtSignature:d}:{}}),Array.isArray(a[2])&&"string"==typeof a[2][1]&&e.push({inlineData:{mimeType:a[2][0]||"application/octet-stream",data:a[2][1]},...c?{thought:!0}:{}}),Array.isArray(a[10])&&"string"==typeof a[10][0]){let c=a[10],f=b?.get(c[0])||c[0];e.push({functionCall:{name:f,args:c[1]?function a(b){let c={},d=Array.isArray(b)?b[0]:null;if(!Array.isArray(d))return c;for(let b of d)Array.isArray(b)&&"string"==typeof b[0]&&(c[b[0]]=function b(c){if(!Array.isArray(c)||0===c[0])return null;if(null!==c[1]&&void 0!==c[1])return Number(c[1]);if(null!==c[2]&&void 0!==c[2])return String(c[2]);if(null!==c[3]&&void 0!==c[3])return!0===c[3]||1===c[3];if(null!==c[4]&&void 0!==c[4])return a(c[4]);if(null!==c[5]&&void 0!==c[5]){let a=Array.isArray(c[5])?c[5][0]:null;return Array.isArray(a)?a.map(b):[]}return null}(b[1]));return c}(c[1]):{},...c[2]?{id:String(c[2])}:{}},...d?{thoughtSignature:d}:{}})}return Array.isArray(a[7])&&"string"==typeof a[7][1]&&e.push({text:`
221
221
  \`\`\`python
222
222
  ${a[7][1]}
@@ -225,31 +225,31 @@ ${a[7][1]}
225
225
  \`\`\`
226
226
  ${a[8][1]}
227
227
  \`\`\`
228
- `}),!e.length&&d&&e.push({text:"",thoughtSignature:d}),e}(a,b));let i=null===f[1]||void 0===f[1]?null:O(f[1]),j=d&&"string"==typeof f[8]?f[8]:"",k={index:0,content:{role:"model",parts:h}};null!==i&&22!==i&&(k.finishReason=K[i]||"OTHER","string"==typeof f[3]&&f[3]&&(k.finishMessage=f[3]));let l={candidates:[k]};return e&&(l.usageMetadata=e),{chunk:l,finishCode:i,continuation:j,usage:e}}let Q={3:400,4:504,5:404,7:403,8:429,9:400,13:500,14:503,16:401};function R(a){let b;if("number"==typeof a)return 1e3*a;if("string"!=typeof a)return 0;let c=0,d=/(\d+(?:\.\d+)?)(ms|h|m|s)/g;for(;b=d.exec(a);){let a=Number(b[1]);c+="h"===b[2]?36e5*a:"m"===b[2]?6e4*a:"ms"===b[2]?a:1e3*a}return c}function S(a){if(!Array.isArray(a))return null;let b=O(a[0]),c="string"==typeof a[1]?a[1]:"",d=0;if(Array.isArray(a[2])){for(let b of a[2])if(Array.isArray(b)&&"string"==typeof b[0]&&b[0].endsWith("google.rpc.RetryInfo")&&Array.isArray(b[1])){let a=b[1][0];d=Array.isArray(a)?Math.max(d,1e3*O(a[0])+Math.floor(O(a[1])/1e6)):Math.max(d,R(a))}}if(!d){let a=c.toLowerCase().match(/retry in ([0-9.hms]+)/);a&&(d=R(a[1].replace(/\.$/,"")))}return{code:b,message:c,retryDelayMs:d,httpStatus:Q[b]||502}}var T=c(81112);function U({status:a,message:b,type:c=null,code:d=null,resetsAtMs:e=null,failureClass:f=null,lockScope:g=null}){return{error:{message:b,type:c||(429===a?"rate_limit_error":401===a?"authentication_error":403===a?"permission_error":a>=500?"upstream_error":"invalid_request_error"),...null!=d?{code:d}:{},...Number.isFinite(e)?{resets_at_ms:e}:{},...f?{failure_class:f}:{},..."account"===g?{lock_scope:"account"}:{}}}}let V={day:864e5,hour:36e5,minute:6e4,second:1e3};function W(a){let b=String(a?.blockReason||"BLOCK_REASON_UNSPECIFIED"),c="string"==typeof a?.blockReasonMessage&&a.blockReasonMessage?`: ${a.blockReasonMessage.slice(0,300)}`:"";return{status:400,message:`AI Studio blocked the prompt (${b})${c}`,code:"prompt_blocked",failureClass:"invalid_request"}}function X({httpStatus:a,rpc:b,retryAfterHeader:c=null,now:d=Date.now()}){let e,f,g=b?.httpStatus&&(!a||200===a)?b.httpStatus:a||b?.httpStatus||502,h=b?.message||"",i=b?.retryDelayMs||0;if(i||429!==g||(i=function(a){let b,c=String(a||"").match(/resets?\s+in\s+([^).;]+)/i);if(!c)return 0;let d=0,e=/(\d+(?:\.\d+)?)\s*(day|hour|hr|minute|min|second|sec)s?\b/gi;for(;b=e.exec(c[1]);){let a=b[2].toLowerCase(),c=a.startsWith("d")?"day":a.startsWith("h")?"hour":a.startsWith("m")?"minute":"second";d+=Number(b[1])*V[c]}return d}(h)),!i&&c){let a=Number(c);if(Number.isFinite(a)&&a>0)i=1e3*a;else{let a=Date.parse(c);Number.isFinite(a)&&(i=Math.max(0,a-d))}}let j=403===g&&/\baccount must be verified\b|\bverify your account\b/i.test(String(h||"")),k=429===g&&i>0?d+Math.min(i,6048e5):j?d+18e5:null;if(429===g)e=`AI Studio rate limit exceeded${h?`: ${h}`:""}`;else if(401===g)e=`AI Studio session rejected by Google (signed out, or the cookies were rotated/revoked in the browser they came from). Re-import a full cookie export or use Login via Browser, and keep that browser session signed in${h?`: ${h}`:""}`;else if(j)e=`AI Studio permission denied (account needs verification): Google blocks every model on this account until its owner verifies it at aistudio.google.com (signed in as this account). Retrying in 30 min${h?`: ${h}`:""}`;else if(403===g)e=`AI Studio permission denied${h?`: ${h}`:""}`;else if(404===g)e=`AI Studio model not found for this account${h?`: ${h}`:""}`;else{if(400===g&&/input blocked|prohibited use/i.test(String(h||"")))return{status:400,message:`AI Studio blocked the prompt (Prohibited Use policy): ${h.slice(0,300)}`,code:"prompt_blocked",resetsAtMs:null,failureClass:"invalid_request"};e=`AI Studio HTTP ${g}${h?`: ${h}`:""}`}let l=429===g&&(f=String(h||""),!/\b(this|that|the selected) model\b|\bper[- ]model\b|\bfor model\b/i.test(f)&&/\b(your|this) (google )?account\b|\ball models\b|\bacross (all )?models\b|\bevery model\b/i.test(f))||j?"account":null;return{status:g,message:e,code:b?.code??null,resetsAtMs:k,failureClass:429===g?"rate_limited":401===g?"reauth_required":403===g?"permission_denied":404===g?"invalid_model":400===g?"invalid_request":"upstream_transient",...l?{lockScope:l}:{}}}function Y(a,b,c=null,d=Date.now()){return X({httpStatus:a,rpc:function(a){try{let b,c=(b=String(a||"").replace(/^\)\]\}'\s*/,""),JSON.parse(new M().push(b)));if(!Array.isArray(c))return null;if(Array.isArray(c[1])&&c[1].length>=2)return S(c[1]);if(Array.isArray(c[0])&&"string"==typeof c[0][1])return S(c[0]);if("string"==typeof c[1])return S(c);return null}catch{return null}}(b),retryAfterHeader:c,now:d})}function Z(a,b){let c=b?.error||"helper_error",d="string"==typeof b?.message?b.message.slice(0,300):"";return 401===a||"auth_required"===c?{status:401,message:`AI Studio session expired; sign in again and re-import the account (${d||c})`,code:c,failureClass:"reauth_required"}:"bad_request"===c?{status:400,message:`AI Studio helper rejected the request: ${d}`,code:c,failureClass:"invalid_request"}:{status:502,message:`AI Studio ${c.replace(/_/g," ")}${d?`: ${d}`:""}`,code:c,failureClass:"upstream_transient"}}var $=c(73024),_=c.n($),aa=c(76760),ab=c.n(aa),ac=c(31421),ad=c(37067),ae=c.n(ad),af=c(48161),ag=c.n(af),ah=c(57075);function ai(a=process.env.DATA_DIR||ab().join(ag().homedir(),".zevai")){let b=ab().join(a,"aistudio");return{binPath:process.env.ZEVAI_AISTUDIO_WAA_BIN||ab().join(a,"bin","zevai-aistudio-waa"),socketPath:process.env.ZEVAI_AISTUDIO_WAA_SOCKET||ab().join(b,"helper.sock"),accountsDir:ab().join(b,"accounts"),logPath:ab().join(a,"logs","aistudio-waa.log")}}c(73136),ab().join("vendor","aistudio-waa","build.sh");class aj extends Error{constructor(a){super(a),this.name="HelperUnavailableError",this.status=503}}async function ak(a){let b=[];for await(let c of a)b.push(Buffer.isBuffer(c)?c:Buffer.from(c));return Buffer.concat(b).toString("utf8")}class al{constructor(a={}){let b=ai();this.binPath=a.binPath||b.binPath,this.socketPath=a.socketPath||b.socketPath,this.logPath=a.logPath||b.logPath,this.idle=a.idle||"5m",this.spawn=a.spawn||ac.spawn,this.request=a.request||(a=>(function(a,{method:b="GET",path:c,body:d=null,signal:e=null,timeoutMs:f=0}){return new Promise((g,h)=>{let i=null==d?null:Buffer.from("string"==typeof d?d:JSON.stringify(d)),j=ae().request({socketPath:a,path:c,method:b,headers:i?{"Content-Type":"application/json","Content-Length":i.length}:{},signal:e||void 0},a=>{g({status:a.statusCode||0,headers:a.headers,stream:a})});f>0&&j.setTimeout(f,()=>j.destroy(Error("helper request timed out"))),j.on("error",h),i&&j.write(i),j.end()})})(this.socketPath,a)),this.startTimeoutMs=a.startTimeoutMs??2e4,this.pollMs=a.pollMs??100,this.exists=a.exists||(a=>_().existsSync(a)),this.starting=null,this.pid=null,this.spawnCount=0}async health(){try{let a=await this.request({method:"GET",path:"/health",timeoutMs:2e3}),b=await ak(a.stream);if(200!==a.status)return null;let c=JSON.parse(b);return c?.ok?c:null}catch{return null}}async ensure(){let a=await this.health();return a?(this.pid=a.pid,a):(this.starting||(this.starting=this.#j().finally(()=>{this.starting=null})),this.starting)}async #j(){if(!this.exists(this.binPath)){var a,b;throw new aj(`AI Studio helper binary not found at ${this.binPath}. ${(a=this.binPath,`Build it once with: ${b=a,`OUT="${String(b||"").replace(/"/g,'\\"')}" bash "$(npm root -g)/zevairouter/vendor/aistudio-waa/build.sh"`} (in a git checkout: vendor/aistudio-waa/build.sh). Needs Go, git, curl and a C toolchain (Xcode Command Line Tools on macOS, gcc on Linux).`)}`)}_().mkdirSync(ab().dirname(this.socketPath),{recursive:!0,mode:448}),_().mkdirSync(ab().dirname(this.logPath),{recursive:!0});let c=_().openSync(this.logPath,"a"),d=null;try{let a=this.spawn(this.binPath,["-socket",this.socketPath,"-idle",this.idle],{detached:!0,stdio:["ignore",c,c],env:{PATH:process.env.PATH||"/usr/bin:/bin",HOME:process.env.HOME||ag().homedir(),TMPDIR:process.env.TMPDIR||ag().tmpdir()}});this.spawnCount++,a.on?.("exit",a=>{d=a}),a.on?.("error",()=>{d=-1}),a.unref?.()}finally{_().closeSync(c)}let e=Date.now()+this.startTimeoutMs;for(;Date.now()<e;){let a=await this.health();if(a)return this.pid=a.pid,a;if(null!==d&&3!==d)break;await new Promise(a=>setTimeout(a,this.pollMs))}throw new aj(`AI Studio helper did not start${null!==d?` (exit ${d})`:""}; see ${this.logPath}`)}async call(a,b,{signal:c=null,timeoutMs:d=0}={}){let e=await this.request({method:"POST",path:a,body:b,signal:c,timeoutMs:d}),f=await ak(e.stream),g=null;try{g=f?JSON.parse(f):null}catch{g={error:"bad_helper_response",message:f.slice(0,200)}}return{status:e.status,headers:e.headers,json:g}}async stream(a,b,{signal:c=null}={}){let d=await this.request({method:"POST",path:a,body:b,signal:c}),e=d.stream&&"function"==typeof d.stream.getReader?d.stream:ah.Readable.toWeb(d.stream);return{status:d.status,headers:d.headers,body:e}}}function am(a){return[a.locale||"",a.timezone||"",a.proxy||"",Number(a.authUser)||0].join("|")}class an extends Error{constructor(a){super(a.message),this.name="AistudioSessionError",this.details=a}}class ao{constructor(a={}){this.helper=a.helper||new al,this.accountsDir=a.accountsDir||ai().accountsDir,this.onCatalog=a.onCatalog||(async()=>{}),this.onCookies=a.onCookies||(async()=>{}),this.cookieSyncDelayMs=a.cookieSyncDelayMs??3e4,this.opened=new Map,this.opening=new Map,this.cookieTimers=new Map}async open(a,{model:b="",force:c=!1,signal:d=null}={}){let e=await this.helper.ensure(),f=this.opened.get(a.key);if(f&&f.helperPid===e.pid&&f.settings!==am(a)&&(c=!0),!c&&f&&f.helperPid===e.pid)return f.catalog;let g=this.opening.get(a.key);if(g&&!c)return g;let h=this.#be(a,{model:b,force:c,pid:e.pid,signal:d}).finally(()=>{this.opening.get(a.key)===h&&this.opening.delete(a.key)});return this.opening.set(a.key,h),h}async #be(a,{model:b,force:c,pid:d,signal:e}){let f=ab().join(this.accountsDir,a.key);!function(a,b=_()){let c=ab().join(a,"camoufox-fingerprint.json");try{"null"===b.readFileSync(c,"utf8").trim()&&b.unlinkSync(c)}catch{}}(f);let{status:g,json:h}=await this.helper.call("/session/open",{account:a.key,storageState:a.state,...a.fingerprint?{fingerprint:a.fingerprint}:{},directory:f,model:b,locale:a.locale||"",timezone:a.timezone||"",proxy:a.proxy||"",authUser:Number(a.authUser)||0,force:c},{signal:e});if(200!==g)throw this.opened.delete(a.key),new an(Z(g,h));let i=h?.catalog||{},j=i.models?(0,T.Bc)({listModels:i.models,tierRaw:i.tier}):null;return this.opened.set(a.key,{helperPid:d,catalog:j,fingerprint:q(a.state),settings:am(a)}),j&&await this.onCatalog(a,j).catch(()=>{}),j}async generate(a,{body:b,binding:c,page:d,model:e,signal:f,method:g="GenerateContent",proofField:h=5}){await this.open(a,{model:e,signal:f});let i={account:a.key,method:g,body:b,proofField:h,binding:c,page:d},j=await this.helper.stream("/generate",i,{signal:f});if(409===j.status&&(await aq(j.body),this.opened.delete(a.key),await this.open(a,{model:e,signal:f}),j=await this.helper.stream("/generate",i,{signal:f})),!j.headers?.["x-zevai-upstream-status"]&&200!==j.status){let b=await ap(j.body),c=null;try{c=JSON.parse(b)}catch{c={error:"helper_error",message:b.slice(0,200)}}throw 401===j.status&&this.opened.delete(a.key),new an(Z(j.status,c))}return j}forget(a){this.opened.delete(a)}async close(a){this.opened.delete(a);try{await this.helper.call("/session/close",{account:a})}catch{}}scheduleCookieSync(a){if(this.cookieTimers.has(a.key))return;let b=setTimeout(()=>{this.cookieTimers.delete(a.key),this.syncCookies(a).catch(()=>{})},this.cookieSyncDelayMs);b.unref?.(),this.cookieTimers.set(a.key,b)}async syncCookies(a){var b;let c=this.opened.get(a.key);if(!c)return!1;let{status:d,json:e}=await this.helper.call("/session/cookies",{account:a.key},{timeoutMs:5e3});if(200!==d||!Array.isArray(e?.cookies)||0===e.cookies.length)return!1;let f=(b=a.state,{cookies:(e.cookies||[]).map(m).filter(Boolean),origins:b?.origins||[]}),g=q(f);return g!==c.fingerprint&&(c.fingerprint=g,a.state=f,await this.onCookies(a,f),!0)}}async function ap(a){if(!a)return"";let b=a.getReader(),c=new TextDecoder,d="";for(;;){let{done:a,value:e}=await b.read();if(a)break;d+=c.decode(e,{stream:!0})}return d+c.decode()}async function aq(a){try{await a?.cancel?.()}catch{}}var ar=c(30714),as=c(2206);function at(a){let b=String(a||"").trim().replace(/^:/,"");if(!b||"Local"===b)return"";try{return new Intl.DateTimeFormat("en-US",{timeZone:b}),b}catch{return""}}function au(a){let b=String(a||"").trim().split(".")[0].split("@")[0];if(!b||/^(c|posix)$/i.test(b))return"";let c=b.replace(/_/g,"-");try{return Intl.getCanonicalLocales(c)[0]||""}catch{return""}}let av={"16:9":1,"9:16":2},aw={"360p":1,"720p":2,"1080p":3,"4k":4},ax={4:1,1:2,2:3,3:4},ay={1:{codes:{1:"image/png",2:"image/jpeg",3:"image/webp",4:"image/heic",5:"image/heif",7:"image/gif",8:"image/bmp",9:"image/tiff"},unlisted:"image/jpeg"},2:{codes:{1:"audio/wav",2:"audio/mp3",3:"audio/aiff",4:"audio/aac",5:"audio/ogg",6:"audio/flac",7:"audio/mpeg",8:"audio/m4a",9:"audio/l16",10:"audio/s16le",11:"audio/opus",12:"audio/alaw",13:"audio/mulaw"},unlisted:"audio/wav"},3:{codes:{1:"application/pdf"},unlisted:"application/pdf"},4:{codes:{1:"video/mp4",2:"video/mpeg",3:"video/mpg",4:"video/mov",5:"video/avi",6:"video/x-flv",7:"video/webm",8:"video/wmv",9:"video/3gpp"},unlisted:"video/mp4"}},az=["1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9"];function aA(a){let b=String(a||"").trim().match(/^(\d+(?:\.\d+)?)\s*[:x]\s*(\d+(?:\.\d+)?)$/i);if(!b)return null;let c=Number(b[1]),d=Number(b[2]);return c>0&&d>0?Math.log(c)-Math.log(d):null}function aB(a){let b=String(a||"").trim().toLowerCase();if("4k"===b)return 2160;if("8k"===b)return 4320;let c=b.match(/^(\d+)p$/);return c?Number(c[1]):null}function aC(a){let b=String(a||"").trim().toUpperCase(),c=b.endsWith("K")?1024:1,d=Number.parseInt(b.replace(/K$/,""),10);return Number.isFinite(d)&&d>0&&String(d)===b.replace(/K$/,"")?d*c:null}function aD(a,b,c){let d="",e=1/0,f=-1/0;for(let g of b||[]){let b=c(g);if(null==b||!Number.isFinite(b))continue;let h=Math.abs(b-a);(h<e||h===e&&b>f)&&(d=g,e=h,f=b)}return d}function aE(a){let b=String(a||"").trim().toLowerCase().match(/^(\d+)\s*x\s*(\d+)$/);if(!b)return null;let c=Number(b[1]),d=Number(b[2]);return c>0&&d>0?{width:c,height:d}:null}function aF(a){let b=Error(a);return b.status=400,b}function aG(a,b){let c=F(b);return G(c?s.Bu[c]:a.defaultThinkingLevel||2,a.thinkingLevels)}let aH=Object.freeze({COMPLETED:3,FAILED:4,CANCELLED:5});var aI=c(4573);let aJ="## Transcript:";function aK(a){let b=Error(a);return b.status=400,b}function aL(a,{speech:b=null,reasoningEffort:c}={}){let d=a?.thinking||a?.thinkingLevel||a?.thinkingBudget,e=Array(d?17:b?16:15).fill(null);if(!b){let b=Math.max(a?.outputLimit||0,a?.continuedOutputTokens||0);b&&(e[3]=b)}if("number"==typeof a?.temperature&&(e[4]=a.temperature),"number"==typeof a?.topP&&(e[5]=a.topP),"number"==typeof a?.topK&&(e[6]=Math.trunc(a.topK)),e[13]=1,e[14]=[3],b&&(e[15]=b),d){let b=H(a,c);e[16]=b?[1,null,null,b]:[1]}return e}function aM(a,b,{dimensions:c,taskType:d="",title:e=""}={}){let f=String(a||"").trim().replace(/^models\//,"");if(!f)throw aK("embedding model is required");let g=[].concat(b??[]);if(!g.length)throw aK("input must not be empty");if(g.length>100)throw aK("at most 100 inputs per call");let h=null;if(null!=c&&""!==c&&(!Number.isInteger(h=Number(c))||h<=0))throw aK("dimensions must be a positive integer");let i=g.map((a,b)=>{if("string"!=typeof a)throw aK(`input[${b}]: token arrays are not supported because Gemini embedding models use a different tokenizer; send text instead`);if(!a)throw aK(`embedding input ${b} has no content`);let c={content:{role:"user",parts:[{text:a}]}};return d&&(c.taskType=String(d)),e&&(c.title=String(e)),h&&(c.outputDimensionality=h),c.model=`models/${f}`,c}),j=`/v1beta/models/${f}:batchEmbedContents`,k=JSON.stringify({requests:i});return{body:[j,k,null,"POST"],binding:`${j} ${k}`,page:g.join(" "),count:g.length}}let aN="```function_calls",aO="```function_results",aP="Run these function calls and send me their results.",aQ="ask_question",aR=["run_command","manage_task","schedule","write_to_file","replace_file_content","multi_replace_file_content","view_file","delete_file","list_dir","delete_dir","move","compile_applet","lint_applet","install_applet_dependencies","install_applet_package","restart_dev_server","ask_question","show_aistudio_ui","set_up_firebase","deploy_firebase","rpc_action","generate_image","set_up_oauth","remove_oauth","search_web"],aS=new Set(["function_calls","function_results","function_call","tool_calls","tool_call","tool_code"]);class aT{constructor(a=[]){this.functionNames=Array.isArray(a)?a:[],this.emitted=new Map,this.usage=new Map,this.searched=new Set,this.held="",this.block=!1,this.other=!1,this.called=!1,this.malformed=!1,this.lastStep=0,this.wroteText=!1,this.finished=!1,this.answered=!1,this.overran=!1,this.failed=!1}decodeFrame(a){if(!Array.isArray(a))return{parts:[],error:null};let b=a[2];if(!Array.isArray(b))return{parts:[],error:null};let c=[];for(let a of b){let b=this.#bf(a);if(b.error)return{parts:c,error:b.error};c.push(...b.parts)}return{parts:c,error:null}}#bf(a){if(this.answered=!1,!Array.isArray(a))return{parts:[],error:null};let b=Number(a[11])||0,c=Number(a[12])||0,d=a[5];if(Array.isArray(d)){if(3===c)return{parts:[],error:null};if(this.failed=!0,this.called)return this.overran=!0,{parts:[],error:null};let a=String(d[0]||"Assistant generation failed"),b=Array.isArray(d[1])?d[1]:[],e=!!(b[3]||b[4]);return{parts:[],error:{status:e?429:502,code:e?8:13,message:`AI Studio Assistant lane: ${a}`,failureClass:e?"rate_limited":"upstream_transient"}}}if(Array.isArray(a[15])&&1===c){let c=a[15],d=Number(c[0])||0,e=Number(c[1])||0,f=d+(Number(c[2])||0);this.usage.set(b,{promptTokenCount:f,candidatesTokenCount:e,totalTokenCount:f+e})}let e=[];if(Array.isArray(a[9])&&1===c&&!this.searched.has(b)){let c=this.#bg(a[9]);e.push(...c),this.searched.add(b)}let f=a[0];if(!Array.isArray(f))return{parts:e,error:null};let g=0;for(let a of f){if(!Array.isArray(a)||"model"!==a[1])continue;let d=Array.isArray(a[0])?a[0]:[];for(let a=0;a<d.length;a++){let c=this.#bh(b,g+a,d[a]);e.push(...c)}g+=d.length,1===c&&(this.finished=!0)}return this.answered=1===c&&!Array.isArray(a[9])&&this.wroteText&&this.lastStep===b,{parts:e,error:null}}#bg(a){let b,c=a?.[21];if(!Array.isArray(c)||this.called)return[];let d=Array.isArray(c[3])?c[3]:[],e={};for(let a of d)Array.isArray(a)&&"string"==typeof a[0]&&(e[a[0]]=String(a[1]??""));if(e.tag!==aQ||!e.questions)return[];try{b=JSON.parse(e.questions)}catch{return[]}if(!Array.isArray(b))return[];let f="";for(let a of b)if(a?.question&&a.question!==aP)for(let b of((this.wroteText||f.length>0)&&(f+="\n\n"),f+=a.question,a.options||[]))f+=`
229
- - ${b}`;return f?(this.wroteText=!0,[{text:f}]):[]}#bh(a,b,c){if(!Array.isArray(c)||"string"!=typeof c[1])return[];let d=c[1],e=!!c[12],f=this.emitted.get(a);for(f||(f=[],this.emitted.set(a,f));f.length<=b;)f.push("");let g=f[b],h=d.startsWith(g)?d.slice(g.length):d;if(f[b]=d,!h)return[];if(e)return[{text:h,thought:!0}];let i=h;return this.wroteText&&""===g&&a!==this.lastStep&&(i="\n\n"+i),this.wroteText=!0,this.lastStep=a,this.#bi(i)}#bi(a){if(!this.functionNames.length)return[{text:a}];if(this.called)return this.overran=this.overran||""!==a.trim(),[];this.held+=a;let b=[],c=a=>{a&&b.push({text:a})};for(;!this.called;)if(this.other){let a=this.held.indexOf("\n```");if(a<0){let a=Math.min(this.held.length,3);return c(this.held.slice(0,this.held.length-a)),this.held=this.held.slice(this.held.length-a),b}let d=a+1+3;c(this.held.slice(0,d)),this.held=this.held.slice(d),this.other=!1}else if(this.block){let a=this.held.indexOf("\n"),c=this.held.slice(a).indexOf("\n```");if(c<0)return b;let d=a+c+1+3,e=this.held.slice(0,d);this.held=this.held.slice(d),this.block=!1,b.push(...this.#bj(e))}else{let a=this.held.indexOf("```");if(a<0){let a=0;for(;a<this.held.length&&"`"===this.held[this.held.length-1-a];)a++;return c(this.held.slice(0,this.held.length-a)),this.held=this.held.slice(this.held.length-a),b}c(this.held.slice(0,a)),this.held=this.held.slice(a);let d=this.held.indexOf("\n");if(d<0)return b;let e=this.held.slice(3,d).trim();if(aS.has(e)){this.block=!0;continue}c(this.held.slice(0,d+1)),this.held=this.held.slice(d+1),this.other=!0}return this.overran=""!==this.held.trim(),this.held="",b}#bj(a){let b=a.indexOf("\n"),c=a.slice(3,b).trim(),d=a.slice(b+1,a.length-3);if("function_results"===c)return[];let f=function(a,b,c){let d=String(a||"").trim();if(!d)return null;let f=null;try{f=JSON.parse(d)}catch{try{f=JSON.parse(function(a){let b="",c=!1;for(let e=0;e<a.length;e++){var d;let f=a[e],g=a.charCodeAt(e);c&&"\\"===f&&((d=a.slice(e+1)).startsWith("u")?d.length>=5&&/^[0-9a-fA-F]{4}/.test(d.slice(1,5)):d.length>0&&'"\\/bfnrt'.includes(d[0]))?(b+=a.slice(e,e+2),e++):c&&"\\"===f?b+="\\\\":c&&g<32?b+=`\\u${g.toString(16).padStart(4,"0")}`:('"'===f&&(c=!c),b+=f)}return b}(d))}catch{return null}}let g=Array.isArray(f)?f:f&&"object"==typeof f?[f]:null;if(!g||!g.length)return null;let h=[];for(let a of g){let d=a?.name;if(!d||"string"!=typeof d||!b&&!c.includes(d))return null;let f=void 0!==a.arguments&&null!==a.arguments?a.arguments:{};h.push({functionCall:{id:`call_${e().randomUUID().replace(/-/g,"").slice(0,24)}`,name:d,args:"object"==typeof f?f:{}}})}return h}(d,"function_calls"===c,this.functionNames);return f?(this.called=!0,f):"function_calls"===c?(this.malformed=!0,[]):[{text:a}]}flush(){let a=[];this.block?a.push(...this.#bj(this.held+"\n```")):!this.called&&this.held&&a.push({text:this.held}),this.held="";let b=null;if(this.usage.size>0)for(let a of(b={promptTokenCount:0,candidatesTokenCount:0,totalTokenCount:0},this.usage.values()))b.promptTokenCount+=a.promptTokenCount,b.candidatesTokenCount+=a.candidatesTokenCount,b.totalTokenCount+=a.totalTokenCount;return{parts:a,usage:b,finishReason:this.malformed?"MALFORMED_FUNCTION_CALL":"STOP"}}}let aU="https://alkalimakersuite-pa.clients6.google.com/$rpc/google.internal.alkali.applications.makersuite.v1.MakerSuiteService/GenerateContent",aV=new Set(["SAFETY","BLOCKLIST","PROHIBITED_CONTENT","SPII","IMAGE_SAFETY","IMAGE_PROHIBITED_CONTENT","IMAGE_RECITATION","RECITATION"]);function aW(a){let b=Error(a?.message||"AI Studio media generation failed");return b.status=a?.status||502,Number.isFinite(a?.resetsAtMs)&&(b.resetsAtMs=a.resetsAtMs),a?.failureClass&&(b.failureClass=a.failureClass),a?.code!==void 0&&a?.code!==null&&(b.code=a.code),b}function aX(a,b,...c){for(let d of c)if(Array.isArray(d?.media))return d.media.find(c=>c.id===a&&c.kind===b)||null}function aY(a){return(0,d.createHash)("sha256").update(a).digest("hex")}function aZ(a){return String(a||T.Sk).replace(/^(aistudio|ais)\//,"").replace(/^models\//,"").replace(/\([^()]+\)\s*$/,"").trim()||T.Sk}function a$(a){return`data: ${JSON.stringify(a)}
228
+ `}),!e.length&&d&&e.push({text:"",thoughtSignature:d}),e}(a,b));let i=null===f[1]||void 0===f[1]?null:O(f[1]),j=d&&"string"==typeof f[8]?f[8]:"",k={index:0,content:{role:"model",parts:h}};null!==i&&22!==i&&(k.finishReason=K[i]||"OTHER","string"==typeof f[3]&&f[3]&&(k.finishMessage=f[3]));let l={candidates:[k]};return e&&(l.usageMetadata=e),{chunk:l,finishCode:i,continuation:j,usage:e}}let Q={3:400,4:504,5:404,7:403,8:429,9:400,13:500,14:503,16:401};function R(a){let b;if("number"==typeof a)return 1e3*a;if("string"!=typeof a)return 0;let c=0,d=/(\d+(?:\.\d+)?)(ms|h|m|s)/g;for(;b=d.exec(a);){let a=Number(b[1]);c+="h"===b[2]?36e5*a:"m"===b[2]?6e4*a:"ms"===b[2]?a:1e3*a}return c}function S(a){if(!Array.isArray(a))return null;let b=O(a[0]),c="string"==typeof a[1]?a[1]:"",d=0;if(Array.isArray(a[2])){for(let b of a[2])if(Array.isArray(b)&&"string"==typeof b[0]&&b[0].endsWith("google.rpc.RetryInfo")&&Array.isArray(b[1])){let a=b[1][0];d=Array.isArray(a)?Math.max(d,1e3*O(a[0])+Math.floor(O(a[1])/1e6)):Math.max(d,R(a))}}if(!d){let a=c.toLowerCase().match(/retry in ([0-9.hms]+)/);a&&(d=R(a[1].replace(/\.$/,"")))}return{code:b,message:c,retryDelayMs:d,httpStatus:Q[b]||502}}var T=c(81112);function U({status:a,message:b,type:c=null,code:d=null,resetsAtMs:e=null,failureClass:f=null,lockScope:g=null}){return{error:{message:b,type:c||(429===a?"rate_limit_error":401===a?"authentication_error":403===a?"permission_error":a>=500?"upstream_error":"invalid_request_error"),...null!=d?{code:d}:{},...Number.isFinite(e)?{resets_at_ms:e}:{},...f?{failure_class:f}:{},..."account"===g?{lock_scope:"account"}:{}}}}let V={day:864e5,hour:36e5,minute:6e4,second:1e3};function W(a){let b=String(a||"");return!/\b(this|that|the selected) model\b|\bper[- ]model\b|\bfor model\b/i.test(b)&&/\b(your|this) (google )?account\b|\ball models\b|\bacross (all )?models\b|\bevery model\b/i.test(b)}function X(a){let b=String(a?.blockReason||"BLOCK_REASON_UNSPECIFIED"),c="string"==typeof a?.blockReasonMessage&&a.blockReasonMessage?`: ${a.blockReasonMessage.slice(0,300)}`:"";return{status:400,message:`AI Studio blocked the prompt (${b})${c}`,code:"prompt_blocked",failureClass:"invalid_request"}}function Y({httpStatus:a,rpc:b,retryAfterHeader:c=null,now:d=Date.now()}){let e,f=b?.httpStatus&&(!a||200===a)?b.httpStatus:a||b?.httpStatus||502,g=b?.message||"",h=b?.retryDelayMs||0;if(h||429!==f||(h=function(a){let b,c=String(a||"").match(/resets?\s+in\s+([^).;]+)/i);if(!c)return 0;let d=0,e=/(\d+(?:\.\d+)?)\s*(day|hour|hr|minute|min|second|sec)s?\b/gi;for(;b=e.exec(c[1]);){let a=b[2].toLowerCase(),c=a.startsWith("d")?"day":a.startsWith("h")?"hour":a.startsWith("m")?"minute":"second";d+=Number(b[1])*V[c]}return d}(g)),!h&&c){let a=Number(c);if(Number.isFinite(a)&&a>0)h=1e3*a;else{let a=Date.parse(c);Number.isFinite(a)&&(h=Math.max(0,a-d))}}let i=403===f&&/\baccount must be verified\b|\bverify your account\b/i.test(String(g||"")),j=429===f&&h>0?W(g)?Math.min(h,6048e5):Math.min(h,6e5):0,k=429===f&&h>0?d+j:i?d+18e5:null;if(429===f)e=`AI Studio rate limit exceeded${g?`: ${g}`:""}`;else if(401===f)e=`AI Studio session rejected by Google (signed out, or the cookies were rotated/revoked in the browser they came from). Re-import a full cookie export or use Login via Browser, and keep that browser session signed in${g?`: ${g}`:""}`;else if(i)e=`AI Studio permission denied (account needs verification): Google blocks every model on this account until its owner verifies it at aistudio.google.com (signed in as this account). Retrying in 30 min${g?`: ${g}`:""}`;else if(403===f)e=`AI Studio permission denied${g?`: ${g}`:""}`;else if(404===f)e=`AI Studio model not found for this account${g?`: ${g}`:""}`;else{if(400===f&&/input blocked|prohibited use/i.test(String(g||"")))return{status:400,message:`AI Studio blocked the prompt (Prohibited Use policy): ${g.slice(0,300)}`,code:"prompt_blocked",resetsAtMs:null,failureClass:"invalid_request"};e=`AI Studio HTTP ${f}${g?`: ${g}`:""}`}let l=429===f&&W(g)||i?"account":null;return{status:f,message:e,code:b?.code??null,resetsAtMs:k,failureClass:429===f?"rate_limited":401===f?"reauth_required":403===f?"permission_denied":404===f?"invalid_model":400===f?"invalid_request":"upstream_transient",...l?{lockScope:l}:{}}}function Z(a,b,c=null,d=Date.now()){return Y({httpStatus:a,rpc:function(a){try{let b,c=(b=String(a||"").replace(/^\)\]\}'\s*/,""),JSON.parse(new M().push(b)));if(!Array.isArray(c))return null;if(Array.isArray(c[1])&&c[1].length>=2)return S(c[1]);if(Array.isArray(c[0])&&"string"==typeof c[0][1])return S(c[0]);if("string"==typeof c[1])return S(c);return null}catch{return null}}(b),retryAfterHeader:c,now:d})}function $(a,b){let c=b?.error||"helper_error",d="string"==typeof b?.message?b.message.slice(0,300):"";return 401===a||"auth_required"===c?{status:401,message:`AI Studio session expired; sign in again and re-import the account (${d||c})`,code:c,failureClass:"reauth_required"}:"bad_request"===c?{status:400,message:`AI Studio helper rejected the request: ${d}`,code:c,failureClass:"invalid_request"}:{status:502,message:`AI Studio ${c.replace(/_/g," ")}${d?`: ${d}`:""}`,code:c,failureClass:"upstream_transient"}}var _=c(73024),aa=c.n(_),ab=c(76760),ac=c.n(ab),ad=c(31421),ae=c(37067),af=c.n(ae),ag=c(48161),ah=c.n(ag),ai=c(57075);function aj(a=process.env.DATA_DIR||ac().join(ah().homedir(),".zevai")){let b=ac().join(a,"aistudio");return{binPath:process.env.ZEVAI_AISTUDIO_WAA_BIN||ac().join(a,"bin","zevai-aistudio-waa"),socketPath:process.env.ZEVAI_AISTUDIO_WAA_SOCKET||ac().join(b,"helper.sock"),accountsDir:ac().join(b,"accounts"),logPath:ac().join(a,"logs","aistudio-waa.log")}}c(73136),ac().join("vendor","aistudio-waa","build.sh");class ak extends Error{constructor(a){super(a),this.name="HelperUnavailableError",this.status=503}}async function al(a){let b=[];for await(let c of a)b.push(Buffer.isBuffer(c)?c:Buffer.from(c));return Buffer.concat(b).toString("utf8")}class am{constructor(a={}){let b=aj();this.binPath=a.binPath||b.binPath,this.socketPath=a.socketPath||b.socketPath,this.logPath=a.logPath||b.logPath,this.idle=a.idle||"5m",this.spawn=a.spawn||ad.spawn,this.request=a.request||(a=>(function(a,{method:b="GET",path:c,body:d=null,signal:e=null,timeoutMs:f=0}){return new Promise((g,h)=>{let i=null==d?null:Buffer.from("string"==typeof d?d:JSON.stringify(d)),j=af().request({socketPath:a,path:c,method:b,headers:i?{"Content-Type":"application/json","Content-Length":i.length}:{},signal:e||void 0},a=>{g({status:a.statusCode||0,headers:a.headers,stream:a})});f>0&&j.setTimeout(f,()=>j.destroy(Error("helper request timed out"))),j.on("error",h),i&&j.write(i),j.end()})})(this.socketPath,a)),this.startTimeoutMs=a.startTimeoutMs??2e4,this.pollMs=a.pollMs??100,this.exists=a.exists||(a=>aa().existsSync(a)),this.starting=null,this.pid=null,this.spawnCount=0}async health(){try{let a=await this.request({method:"GET",path:"/health",timeoutMs:2e3}),b=await al(a.stream);if(200!==a.status)return null;let c=JSON.parse(b);return c?.ok?c:null}catch{return null}}async ensure(){let a=await this.health();return a?(this.pid=a.pid,a):(this.starting||(this.starting=this.#j().finally(()=>{this.starting=null})),this.starting)}async #j(){if(!this.exists(this.binPath)){var a,b;throw new ak(`AI Studio helper binary not found at ${this.binPath}. ${(a=this.binPath,`Build it once with: ${b=a,`OUT="${String(b||"").replace(/"/g,'\\"')}" bash "$(npm root -g)/zevairouter/vendor/aistudio-waa/build.sh"`} (in a git checkout: vendor/aistudio-waa/build.sh). Needs Go, git, curl and a C toolchain (Xcode Command Line Tools on macOS, gcc on Linux).`)}`)}aa().mkdirSync(ac().dirname(this.socketPath),{recursive:!0,mode:448}),aa().mkdirSync(ac().dirname(this.logPath),{recursive:!0});let c=aa().openSync(this.logPath,"a"),d=null;try{let a=this.spawn(this.binPath,["-socket",this.socketPath,"-idle",this.idle],{detached:!0,stdio:["ignore",c,c],env:{PATH:process.env.PATH||"/usr/bin:/bin",HOME:process.env.HOME||ah().homedir(),TMPDIR:process.env.TMPDIR||ah().tmpdir()}});this.spawnCount++,a.on?.("exit",a=>{d=a}),a.on?.("error",()=>{d=-1}),a.unref?.()}finally{aa().closeSync(c)}let e=Date.now()+this.startTimeoutMs;for(;Date.now()<e;){let a=await this.health();if(a)return this.pid=a.pid,a;if(null!==d&&3!==d)break;await new Promise(a=>setTimeout(a,this.pollMs))}throw new ak(`AI Studio helper did not start${null!==d?` (exit ${d})`:""}; see ${this.logPath}`)}async call(a,b,{signal:c=null,timeoutMs:d=0}={}){let e=await this.request({method:"POST",path:a,body:b,signal:c,timeoutMs:d}),f=await al(e.stream),g=null;try{g=f?JSON.parse(f):null}catch{g={error:"bad_helper_response",message:f.slice(0,200)}}return{status:e.status,headers:e.headers,json:g}}async stream(a,b,{signal:c=null}={}){let d=await this.request({method:"POST",path:a,body:b,signal:c}),e=d.stream&&"function"==typeof d.stream.getReader?d.stream:ai.Readable.toWeb(d.stream);return{status:d.status,headers:d.headers,body:e}}}function an(a){return[a.locale||"",a.timezone||"",a.proxy||"",Number(a.authUser)||0].join("|")}class ao extends Error{constructor(a){super(a.message),this.name="AistudioSessionError",this.details=a}}class ap{constructor(a={}){this.helper=a.helper||new am,this.accountsDir=a.accountsDir||aj().accountsDir,this.onCatalog=a.onCatalog||(async()=>{}),this.onCookies=a.onCookies||(async()=>{}),this.cookieSyncDelayMs=a.cookieSyncDelayMs??3e4,this.opened=new Map,this.opening=new Map,this.cookieTimers=new Map,this.locks=new Map}async open(a,{model:b="",force:c=!1,signal:d=null}={}){let e=await this.helper.ensure(),f=this.opened.get(a.key);if(f&&f.helperPid===e.pid&&f.settings!==an(a)&&(c=!0),!c&&f&&f.helperPid===e.pid)return f.catalog;let g=this.opening.get(a.key);if(g&&!c)return g;let h=this.#be(a,{model:b,force:c,pid:e.pid,signal:d}).finally(()=>{this.opening.get(a.key)===h&&this.opening.delete(a.key)});return this.opening.set(a.key,h),h}async #be(a,{model:b,force:c,pid:d,signal:e}){let f=ac().join(this.accountsDir,a.key);!function(a,b=aa()){let c=ac().join(a,"camoufox-fingerprint.json");try{"null"===b.readFileSync(c,"utf8").trim()&&b.unlinkSync(c)}catch{}}(f);let{status:g,json:h}=await this.helper.call("/session/open",{account:a.key,storageState:a.state,...a.fingerprint?{fingerprint:a.fingerprint}:{},directory:f,model:b,locale:a.locale||"",timezone:a.timezone||"",proxy:a.proxy||"",authUser:Number(a.authUser)||0,force:c},{signal:e});if(200!==g)throw this.opened.delete(a.key),new ao($(g,h));let i=h?.catalog||{},j=i.models?(0,T.Bc)({listModels:i.models,tierRaw:i.tier}):null;return this.opened.set(a.key,{helperPid:d,catalog:j,fingerprint:q(a.state),settings:an(a)}),j&&await this.onCatalog(a,j).catch(()=>{}),j}async generate(a,b){return this.#bf(a.key,()=>this.#bg(a,b))}#bf(a,b){let c=(this.locks.get(a)||Promise.resolve()).then(()=>b());return this.locks.set(a,c.then(()=>{},()=>{})),c}async #bg(a,{body:b,binding:c,page:d,model:e,signal:f,method:g="GenerateContent",proofField:h=5}){await this.open(a,{model:e,signal:f});let i={account:a.key,method:g,body:b,proofField:h,binding:c,page:d},j=await this.helper.stream("/generate",i,{signal:f});if(409===j.status&&(await ar(j.body),this.opened.delete(a.key),await this.open(a,{model:e,signal:f}),j=await this.helper.stream("/generate",i,{signal:f})),!j.headers?.["x-zevai-upstream-status"]&&200!==j.status){let b=await aq(j.body),c=null;try{c=JSON.parse(b)}catch{c={error:"helper_error",message:b.slice(0,200)}}throw 401===j.status&&this.opened.delete(a.key),new ao($(j.status,c))}return j}forget(a){this.opened.delete(a)}async close(a){this.opened.delete(a);try{await this.helper.call("/session/close",{account:a})}catch{}}scheduleCookieSync(a){if(this.cookieTimers.has(a.key))return;let b=setTimeout(()=>{this.cookieTimers.delete(a.key),this.syncCookies(a).catch(()=>{})},this.cookieSyncDelayMs);b.unref?.(),this.cookieTimers.set(a.key,b)}async syncCookies(a){var b;let c=this.opened.get(a.key);if(!c)return!1;let{status:d,json:e}=await this.helper.call("/session/cookies",{account:a.key},{timeoutMs:5e3});if(200!==d||!Array.isArray(e?.cookies)||0===e.cookies.length)return!1;let f=(b=a.state,{cookies:(e.cookies||[]).map(m).filter(Boolean),origins:b?.origins||[]}),g=q(f);return g!==c.fingerprint&&(c.fingerprint=g,a.state=f,await this.onCookies(a,f),!0)}}async function aq(a){if(!a)return"";let b=a.getReader(),c=new TextDecoder,d="";for(;;){let{done:a,value:e}=await b.read();if(a)break;d+=c.decode(e,{stream:!0})}return d+c.decode()}async function ar(a){try{await a?.cancel?.()}catch{}}var as=c(30714),at=c(2206);function au(a){let b=String(a||"").trim().replace(/^:/,"");if(!b||"Local"===b)return"";try{return new Intl.DateTimeFormat("en-US",{timeZone:b}),b}catch{return""}}function av(a){let b=String(a||"").trim().split(".")[0].split("@")[0];if(!b||/^(c|posix)$/i.test(b))return"";let c=b.replace(/_/g,"-");try{return Intl.getCanonicalLocales(c)[0]||""}catch{return""}}let aw={"16:9":1,"9:16":2},ax={"360p":1,"720p":2,"1080p":3,"4k":4},ay={4:1,1:2,2:3,3:4},az={1:{codes:{1:"image/png",2:"image/jpeg",3:"image/webp",4:"image/heic",5:"image/heif",7:"image/gif",8:"image/bmp",9:"image/tiff"},unlisted:"image/jpeg"},2:{codes:{1:"audio/wav",2:"audio/mp3",3:"audio/aiff",4:"audio/aac",5:"audio/ogg",6:"audio/flac",7:"audio/mpeg",8:"audio/m4a",9:"audio/l16",10:"audio/s16le",11:"audio/opus",12:"audio/alaw",13:"audio/mulaw"},unlisted:"audio/wav"},3:{codes:{1:"application/pdf"},unlisted:"application/pdf"},4:{codes:{1:"video/mp4",2:"video/mpeg",3:"video/mpg",4:"video/mov",5:"video/avi",6:"video/x-flv",7:"video/webm",8:"video/wmv",9:"video/3gpp"},unlisted:"video/mp4"}},aA=["1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9"];function aB(a){let b=String(a||"").trim().match(/^(\d+(?:\.\d+)?)\s*[:x]\s*(\d+(?:\.\d+)?)$/i);if(!b)return null;let c=Number(b[1]),d=Number(b[2]);return c>0&&d>0?Math.log(c)-Math.log(d):null}function aC(a){let b=String(a||"").trim().toLowerCase();if("4k"===b)return 2160;if("8k"===b)return 4320;let c=b.match(/^(\d+)p$/);return c?Number(c[1]):null}function aD(a){let b=String(a||"").trim().toUpperCase(),c=b.endsWith("K")?1024:1,d=Number.parseInt(b.replace(/K$/,""),10);return Number.isFinite(d)&&d>0&&String(d)===b.replace(/K$/,"")?d*c:null}function aE(a,b,c){let d="",e=1/0,f=-1/0;for(let g of b||[]){let b=c(g);if(null==b||!Number.isFinite(b))continue;let h=Math.abs(b-a);(h<e||h===e&&b>f)&&(d=g,e=h,f=b)}return d}function aF(a){let b=String(a||"").trim().toLowerCase().match(/^(\d+)\s*x\s*(\d+)$/);if(!b)return null;let c=Number(b[1]),d=Number(b[2]);return c>0&&d>0?{width:c,height:d}:null}function aG(a){let b=Error(a);return b.status=400,b}function aH(a,b){let c=F(b);return G(c?s.Bu[c]:a.defaultThinkingLevel||2,a.thinkingLevels)}let aI=Object.freeze({COMPLETED:3,FAILED:4,CANCELLED:5});var aJ=c(4573);let aK="## Transcript:";function aL(a){let b=Error(a);return b.status=400,b}function aM(a,{speech:b=null,reasoningEffort:c}={}){let d=a?.thinking||a?.thinkingLevel||a?.thinkingBudget,e=Array(d?17:b?16:15).fill(null);if(!b){let b=Math.max(a?.outputLimit||0,a?.continuedOutputTokens||0);b&&(e[3]=b)}if("number"==typeof a?.temperature&&(e[4]=a.temperature),"number"==typeof a?.topP&&(e[5]=a.topP),"number"==typeof a?.topK&&(e[6]=Math.trunc(a.topK)),e[13]=1,e[14]=[3],b&&(e[15]=b),d){let b=H(a,c);e[16]=b?[1,null,null,b]:[1]}return e}function aN(a,b,{dimensions:c,taskType:d="",title:e=""}={}){let f=String(a||"").trim().replace(/^models\//,"");if(!f)throw aL("embedding model is required");let g=[].concat(b??[]);if(!g.length)throw aL("input must not be empty");if(g.length>100)throw aL("at most 100 inputs per call");let h=null;if(null!=c&&""!==c&&(!Number.isInteger(h=Number(c))||h<=0))throw aL("dimensions must be a positive integer");let i=g.map((a,b)=>{if("string"!=typeof a)throw aL(`input[${b}]: token arrays are not supported because Gemini embedding models use a different tokenizer; send text instead`);if(!a)throw aL(`embedding input ${b} has no content`);let c={content:{role:"user",parts:[{text:a}]}};return d&&(c.taskType=String(d)),e&&(c.title=String(e)),h&&(c.outputDimensionality=h),c.model=`models/${f}`,c}),j=`/v1beta/models/${f}:batchEmbedContents`,k=JSON.stringify({requests:i});return{body:[j,k,null,"POST"],binding:`${j} ${k}`,page:g.join(" "),count:g.length}}let aO="```function_calls",aP="```function_results",aQ="Run these function calls and send me their results.",aR="ask_question",aS=["run_command","manage_task","schedule","write_to_file","replace_file_content","multi_replace_file_content","view_file","delete_file","list_dir","delete_dir","move","compile_applet","lint_applet","install_applet_dependencies","install_applet_package","restart_dev_server","ask_question","show_aistudio_ui","set_up_firebase","deploy_firebase","rpc_action","generate_image","set_up_oauth","remove_oauth","search_web"],aT=new Set(["function_calls","function_results","function_call","tool_calls","tool_call","tool_code"]);class aU{constructor(a=[]){this.functionNames=Array.isArray(a)?a:[],this.emitted=new Map,this.usage=new Map,this.searched=new Set,this.held="",this.block=!1,this.other=!1,this.called=!1,this.malformed=!1,this.lastStep=0,this.wroteText=!1,this.finished=!1,this.answered=!1,this.overran=!1,this.failed=!1}decodeFrame(a){if(!Array.isArray(a))return{parts:[],error:null};let b=a[2];if(!Array.isArray(b))return{parts:[],error:null};let c=[];for(let a of b){let b=this.#bh(a);if(b.error)return{parts:c,error:b.error};c.push(...b.parts)}return{parts:c,error:null}}#bh(a){if(this.answered=!1,!Array.isArray(a))return{parts:[],error:null};let b=Number(a[11])||0,c=Number(a[12])||0,d=a[5];if(Array.isArray(d)){if(3===c)return{parts:[],error:null};if(this.failed=!0,this.called)return this.overran=!0,{parts:[],error:null};let a=String(d[0]||"Assistant generation failed"),b=Array.isArray(d[1])?d[1]:[],e=!!(b[3]||b[4]);return{parts:[],error:{status:e?429:502,code:e?8:13,message:`AI Studio Assistant lane: ${a}`,failureClass:e?"rate_limited":"upstream_transient"}}}if(Array.isArray(a[15])&&1===c){let c=a[15],d=Number(c[0])||0,e=Number(c[1])||0,f=d+(Number(c[2])||0);this.usage.set(b,{promptTokenCount:f,candidatesTokenCount:e,totalTokenCount:f+e})}let e=[];if(Array.isArray(a[9])&&1===c&&!this.searched.has(b)){let c=this.#bi(a[9]);e.push(...c),this.searched.add(b)}let f=a[0];if(!Array.isArray(f))return{parts:e,error:null};let g=0;for(let a of f){if(!Array.isArray(a)||"model"!==a[1])continue;let d=Array.isArray(a[0])?a[0]:[];for(let a=0;a<d.length;a++){let c=this.#bj(b,g+a,d[a]);e.push(...c)}g+=d.length,1===c&&(this.finished=!0)}return this.answered=1===c&&!Array.isArray(a[9])&&this.wroteText&&this.lastStep===b,{parts:e,error:null}}#bi(a){let b,c=a?.[21];if(!Array.isArray(c)||this.called)return[];let d=Array.isArray(c[3])?c[3]:[],e={};for(let a of d)Array.isArray(a)&&"string"==typeof a[0]&&(e[a[0]]=String(a[1]??""));if(e.tag!==aR||!e.questions)return[];try{b=JSON.parse(e.questions)}catch{return[]}if(!Array.isArray(b))return[];let f="";for(let a of b)if(a?.question&&a.question!==aQ)for(let b of((this.wroteText||f.length>0)&&(f+="\n\n"),f+=a.question,a.options||[]))f+=`
229
+ - ${b}`;return f?(this.wroteText=!0,[{text:f}]):[]}#bj(a,b,c){if(!Array.isArray(c)||"string"!=typeof c[1])return[];let d=c[1],e=!!c[12],f=this.emitted.get(a);for(f||(f=[],this.emitted.set(a,f));f.length<=b;)f.push("");let g=f[b],h=d.startsWith(g)?d.slice(g.length):d;if(f[b]=d,!h)return[];if(e)return[{text:h,thought:!0}];let i=h;return this.wroteText&&""===g&&a!==this.lastStep&&(i="\n\n"+i),this.wroteText=!0,this.lastStep=a,this.#bk(i)}#bk(a){if(!this.functionNames.length)return[{text:a}];if(this.called)return this.overran=this.overran||""!==a.trim(),[];this.held+=a;let b=[],c=a=>{a&&b.push({text:a})};for(;!this.called;)if(this.other){let a=this.held.indexOf("\n```");if(a<0){let a=Math.min(this.held.length,3);return c(this.held.slice(0,this.held.length-a)),this.held=this.held.slice(this.held.length-a),b}let d=a+1+3;c(this.held.slice(0,d)),this.held=this.held.slice(d),this.other=!1}else if(this.block){let a=this.held.indexOf("\n"),c=this.held.slice(a).indexOf("\n```");if(c<0)return b;let d=a+c+1+3,e=this.held.slice(0,d);this.held=this.held.slice(d),this.block=!1,b.push(...this.#bl(e))}else{let a=this.held.indexOf("```");if(a<0){let a=0;for(;a<this.held.length&&"`"===this.held[this.held.length-1-a];)a++;return c(this.held.slice(0,this.held.length-a)),this.held=this.held.slice(this.held.length-a),b}c(this.held.slice(0,a)),this.held=this.held.slice(a);let d=this.held.indexOf("\n");if(d<0)return b;let e=this.held.slice(3,d).trim();if(aT.has(e)){this.block=!0;continue}c(this.held.slice(0,d+1)),this.held=this.held.slice(d+1),this.other=!0}return this.overran=""!==this.held.trim(),this.held="",b}#bl(a){let b=a.indexOf("\n"),c=a.slice(3,b).trim(),d=a.slice(b+1,a.length-3);if("function_results"===c)return[];let f=function(a,b,c){let d=String(a||"").trim();if(!d)return null;let f=null;try{f=JSON.parse(d)}catch{try{f=JSON.parse(function(a){let b="",c=!1;for(let e=0;e<a.length;e++){var d;let f=a[e],g=a.charCodeAt(e);c&&"\\"===f&&((d=a.slice(e+1)).startsWith("u")?d.length>=5&&/^[0-9a-fA-F]{4}/.test(d.slice(1,5)):d.length>0&&'"\\/bfnrt'.includes(d[0]))?(b+=a.slice(e,e+2),e++):c&&"\\"===f?b+="\\\\":c&&g<32?b+=`\\u${g.toString(16).padStart(4,"0")}`:('"'===f&&(c=!c),b+=f)}return b}(d))}catch{return null}}let g=Array.isArray(f)?f:f&&"object"==typeof f?[f]:null;if(!g||!g.length)return null;let h=[];for(let a of g){let d=a?.name;if(!d||"string"!=typeof d||!b&&!c.includes(d))return null;let f=void 0!==a.arguments&&null!==a.arguments?a.arguments:{};h.push({functionCall:{id:`call_${e().randomUUID().replace(/-/g,"").slice(0,24)}`,name:d,args:"object"==typeof f?f:{}}})}return h}(d,"function_calls"===c,this.functionNames);return f?(this.called=!0,f):"function_calls"===c?(this.malformed=!0,[]):[{text:a}]}flush(){let a=[];this.block?a.push(...this.#bl(this.held+"\n```")):!this.called&&this.held&&a.push({text:this.held}),this.held="";let b=null;if(this.usage.size>0)for(let a of(b={promptTokenCount:0,candidatesTokenCount:0,totalTokenCount:0},this.usage.values()))b.promptTokenCount+=a.promptTokenCount,b.candidatesTokenCount+=a.candidatesTokenCount,b.totalTokenCount+=a.totalTokenCount;return{parts:a,usage:b,finishReason:this.malformed?"MALFORMED_FUNCTION_CALL":"STOP"}}}let aV="https://alkalimakersuite-pa.clients6.google.com/$rpc/google.internal.alkali.applications.makersuite.v1.MakerSuiteService/GenerateContent",aW=new Set(["SAFETY","BLOCKLIST","PROHIBITED_CONTENT","SPII","IMAGE_SAFETY","IMAGE_PROHIBITED_CONTENT","IMAGE_RECITATION","RECITATION"]);function aX(a){let b=Error(a?.message||"AI Studio media generation failed");return b.status=a?.status||502,Number.isFinite(a?.resetsAtMs)&&(b.resetsAtMs=a.resetsAtMs),a?.failureClass&&(b.failureClass=a.failureClass),a?.code!==void 0&&a?.code!==null&&(b.code=a.code),b}function aY(a,b,...c){for(let d of c)if(Array.isArray(d?.media))return d.media.find(c=>c.id===a&&c.kind===b)||null}function aZ(a){return(0,d.createHash)("sha256").update(a).digest("hex")}function a$(a){return String(a||T.Sk).replace(/^(aistudio|ais)\//,"").replace(/^models\//,"").replace(/\([^()]+\)\s*$/,"").trim()||T.Sk}function a_(a){return`data: ${JSON.stringify(a)}
230
230
 
231
- `}async function a_(a,{fetchFn:b=fetch,signal:c=null}={}){if(!Array.isArray(a?.messages))return a;let d=!1,e=[];for(let f of a.messages){if(!Array.isArray(f?.content)){e.push(f);continue}let a=[];for(let e of f.content){let f=e?.type==="image_url"?e.image_url?.url:null;if("string"==typeof f&&/^https?:\/\//i.test(f)){let g=new AbortController,h=setTimeout(()=>g.abort(Error("image fetch timed out")),2e4);try{let h=await b(f,{signal:c?AbortSignal.any([c,g.signal]):g.signal});if(!h.ok)throw Error(`HTTP ${h.status}`);let i=Buffer.from(await h.arrayBuffer());if(i.length>0x1400000)throw Error("image larger than 20MB");let j=(h.headers.get("content-type")||"image/png").split(";")[0].trim();a.push({...e,image_url:{...e.image_url,url:`data:${j};base64,${i.toString("base64")}`}}),d=!0;continue}catch(b){let a=Error(`Could not fetch image ${f.slice(0,120)}: ${b.message}`);throw a.status=400,a}finally{clearTimeout(h)}}a.push(e)}e.push({...f,content:a})}return d?{...a,messages:e}:a}class a0{constructor(a){this.reader=a.getReader(),this.decoder=new TextDecoder,this.splitter=new N,this.pending=[],this.done=!1}async next(){for(;!this.pending.length&&!this.done;){let{done:a,value:b}=await this.reader.read();if(a){this.done=!0;let a=this.decoder.decode();a&&this.pending.push(...this.splitter.push(a));break}this.pending.push(...this.splitter.push(this.decoder.decode(b,{stream:!0})))}return this.pending.length?this.pending.shift():null}trailer(){return this.splitter.trailer()}cancel(a){this.reader.cancel(a).catch(()=>{})}}class a1 extends f.Hv{constructor(a={}){let b;super("aistudio",{id:"aistudio",baseUrl:aU,forceStream:!0,retrySameCredential429:!1}),this.fetchFn=a.fetchFn||fetch,this.persist=a.persist||(b=()=>Promise.resolve().then(c.bind(c,92216)),{async cookies(a,c){if(!a)return;let{mutateProviderConnection:d}=await b();await d(a,()=>({apiKey:c}))},async catalog(a,c){if(!a)return;let{mutateProviderConnection:d}=await b();await d(a,a=>{let b=a.providerSpecificData?.aistudioCatalog;return b&&b.tier===c.tier&&JSON.stringify(b.models)===JSON.stringify(c.models)&&JSON.stringify(b.media??null)===JSON.stringify(c.media??null)?null:{providerSpecificData:{...a.providerSpecificData||{},aistudioCatalog:c}}})}}),this.sessions=a.sessions||new ao({onCatalog:(a,b)=>this.#bk(a,b),onCookies:async(a,b)=>{let c=JSON.stringify(b);a.sources.add(aY(c)),await this.persist.cookies(a.connectionId,c)}}),this.accounts=new Map}parseError(a,b){return function(a,b){try{let c=JSON.parse(b),d=c?.error;if(!d||"object"!=typeof d)return null;let e=Number(d.resets_at_ms);return{status:a,message:d.message||`AI Studio HTTP ${a}`,...Number.isFinite(e)&&e>0?{resetsAtMs:e}:{},...d.failure_class?{failureClass:d.failure_class}:{},..."account"===d.lock_scope?{lockScope:"account"}:{},...void 0!==d.code?{providerErrorCode:d.code}:{}}}catch{return null}}(a.status,b)}async testConnection(a){return p(r(a)).valid}async checkAccount(a,{live:b=!0,signal:c=null}={}){let d=p(r(a));if(!d.valid)return{valid:!1,error:d.error};let e=d.warning||null;if(!b)return{valid:!0,error:null,...e?{warning:e}:{}};let f=null;try{f=this.account(a);let b=await this.sessions.open(f,{model:T.Sk,signal:c});return{valid:!0,error:null,tier:b?.tierName||null,models:(b?.models||[]).map(a=>a.id),catalog:b||null,...e?{warning:e}:{}}}catch(b){let a=b instanceof an?b.details:null;if(a?.status===401)return{valid:!1,error:a.message};if(b instanceof aj)return{valid:!0,error:null,warning:b.message};return{valid:!1,error:a?.message||b?.message||"AI Studio check failed"}}finally{f&&!f.connectionId&&(this.accounts.delete(f.key),await this.sessions.close?.(f.key))}}async #bk(a,b){a.connectionId&&((0,as.br)(a.connectionId,b),await this.persist.catalog(a.connectionId,b))}account(a){let b=r(a),c=p(b);if(!c.valid)throw new l(c.error);let e=n(b),f=function(a,b){let c=String(a?.connectionId||a?.id||"").replace(/[^A-Za-z0-9_-]/g,"");if(c)return c;let e=(b.cookies||[]).find(a=>"SAPISID"===a.name)?.value||"";return`acct-${(0,d.createHash)("sha256").update(e).digest("hex").slice(0,16)}`}(a,e),g=aY(b),h=a?.providerSpecificData||{},i=this.accounts.get(f);i&&i.sources.has(g)||(i&&this.sessions.forget(f),i={key:f,connectionId:a?.connectionId||null,sources:new Set([g]),state:e,fingerprint:null},this.accounts.set(f,i));let{locale:j,timezone:k}=function(a={},b=process.env){return{locale:String(a.locale||"").trim()||function(a=process.env){for(let b of["LC_ALL","LC_MESSAGES","LANG"]){let c=au(a[b]);if(c)return c}return au(Intl.DateTimeFormat().resolvedOptions().locale)||"en-US"}(b),timezone:String(a.timezone||"").trim()||function(a=process.env){return at(a.TZ)||at(Intl.DateTimeFormat().resolvedOptions().timeZone)||"UTC"}(b)}}(h);return i.locale=j,i.timezone=k,i.authUser=h.authUser||0,i.proxy=h.proxy||"",i}async execute({model:a,body:b,credentials:c,signal:d,log:e}){var f;let j,k,l,m,n,o=aZ(a),p=a=>({response:new Response(JSON.stringify(U(a)),{status:a.status,headers:{"Content-Type":"application/json"}}),url:aU,headers:{},transformedBody:b});try{j=this.account(c)}catch(a){return p({status:401,message:`AI Studio credential: ${a.message}`,failureClass:"reauth_required"})}if(!(0,as.DS)(j.connectionId)&&!c?.providerSpecificData?.aistudioCatalog?.models?.length)try{await this.sessions.open(j,{model:o,signal:d})}catch(a){return p(this.#bl(a))}let{model:q,catalog:r}=(m=(0,as.DS)(c?.connectionId)||c?.providerSpecificData?.aistudioCatalog||null,m?.models?.length?{model:m.models.find(a=>a.id===o)||null,catalog:m}:{model:(0,as.V7)(o)||T.cC.find(a=>a.id===o)||{id:o,name:o,thinking:!0,functions:!0},catalog:null});if(!q)return p({status:404,message:`AI Studio model ${o} is not available to this account (${r?.tierName||"unknown"} tier)`,failureClass:"invalid_model"});try{k=await a_(b,{fetchFn:this.fetchFn,signal:d})}catch(a){return p({status:a.status||400,message:a.message})}let s=a=>"string"==typeof a&&a&&a!==i.bf&&a!==t?a:null,u={stop:"string"==typeof k.stop?[k.stop]:k.stop,maxOutputTokens:k.max_completion_tokens??k.max_tokens,temperature:"number"==typeof k.temperature?k.temperature:void 0,topP:"number"==typeof k.top_p?k.top_p:void 0,topK:"number"==typeof k.top_k?k.top_k:void 0,reasoningEffort:(f=k,(n=f?.reasoning_effort||f?.reasoning?.effort)||(f?.thinking?.type==="disabled"?"none":void 0)),...function(a){let b=a?.response_format;if(!b||"object"!=typeof b)return{};if("json_object"===b.type)return{responseMimeType:"application/json"};if("json_schema"===b.type){let a=b.json_schema?.schema||b.schema;return{responseMimeType:"application/json",...a?{responseSchema:a}:{}}}return{}}(k)},v=q.continuedOutputTokens>0,w=I(q,u.maxOutputTokens),x=a=>{var b;let d,e=(0,g.m$)(o,a,!0,c),f=E(e.contents,{realSignature:s}),h=(b=e.systemInstruction,(d=(b?.parts||[]).map(a=>a?.text).filter(a=>"string"==typeof a&&""!==a)).length?[d.map(a=>[null,a]),"user"]:null),{tools:i,names:j}=function(a,b){let c=new Map;if(!Array.isArray(a)||0===a.length||"none"===b)return{tools:null,names:c};let d=[];for(let b of a){let a=function(a){let b,c=a?.type==="function"&&a.function?a.function:a,d=c?.name;if(!d)return null;let e=c.parameters??c.input_schema??{type:"object",properties:{}},f={...e?.$defs||{},...e?.definitions||{}},g=C(function a(b,c,d=0){if(Array.isArray(b))return b.map(b=>a(b,c,d));if(!b||"object"!=typeof b)return b;if("string"==typeof b.$ref&&d<24){let e=b.$ref.match(/^#\/(?:\$defs|definitions)\/(.+)$/),f=e?c[decodeURIComponent(e[1])]:null;if(f){let{$ref:e,...g}=b;return a({...f,...g},c,d+1)}return{}}let e={};for(let[f,g]of Object.entries(b))"$defs"!==f&&"definitions"!==f&&(e[f]=a(g,c,d));return e}(e,f));"object"!==g.type&&(g={type:"object",properties:{value:g}});let h="string"==typeof c.description?c.description:"";return b=JSON.stringify(e??{}),(/"(additionalProperties|prefixItems|exclusiveMinimum|exclusiveMaximum|propertyNames|\$ref|patternProperties|const)"/.test(b)||!0===c.strict)&&(h+=`${h?"\n":""}Arguments must follow this JSON Schema: ${JSON.stringify(e)}`),[z(d),h,D(g)]}(b);if(!a)continue;let e=(b?.type==="function"&&b.function?b.function:b).name;a[0]!==e&&c.set(a[0],e),d.push(a)}return 0===d.length?{tools:null,names:c}:{tools:[[null,d]],names:c}}(a.tools,a.tool_choice),k=+!!h;return{geminiReq:e,encoded:f,system:h,names:j,systemTokens:k,buildRound:(a,b="")=>J({model:q,contents:f.contents,system:h,tools:i,config:function(a,b={}){let c=y([],13,null);Array.isArray(b.stop)&&b.stop.length&&(c[1]=b.stop.map(String));let d=I(a,b.maxOutputTokens);d&&a?.continuedOutputTokens>0&&(d=Math.min(d,((b.round||0)+1)*32768)),d&&(c[3]=d);let e=b.temperature??a?.temperature,f=b.topP??a?.topP,g=b.topK??a?.topK;if("number"==typeof e&&(c[4]=e),"number"==typeof f&&(c[5]=f),"number"==typeof g&&(c[6]=Math.trunc(g)),b.responseMimeType&&(c[7]=b.responseMimeType),b.responseSchema&&(c[8]=D(C(b.responseSchema))),c[13]=1,a?.thinking||a?.thinkingLevel||a?.thinkingBudget){let d=H(a,b.reasoningEffort);y(c,16,d?[1,null,null,d]:[1])}return a?.continuedOutputTokens>0&&y(c,45,1),c}(q,{...u,round:a}),continuationToken:b})}},A=x(k);if(!A.encoded.contents.length)return p({status:400,message:"AI Studio request has no content"});let B=async a=>await this.sessions.generate(j,{body:a,binding:A.encoded.binding,page:A.encoded.page,model:o,signal:d});try{if(l=await this.#bm(B,A.buildRound(0),{account:j,modelId:o,retryNotFound:!0,log:e}),l.error?.code==="prompt_blocked"){let a=(0,ar.ds)(k);if(a.changed){e?.info?.("AISTUDIO",`${o} content filter triggered (${l.error.message}) -> retrying once with Lapis-2 security neutralizer`);let b=x(a.value),c=async a=>this.sessions.generate(j,{body:a,binding:b.encoded.binding,page:b.encoded.page,model:o,signal:d}),f=await this.#bm(c,b.buildRound(0),{account:j,modelId:o,retryNotFound:!1,log:e});f&&!f.error&&(l=f,A=b,B=c)}}if(l.error?.status===429){let a=await this.#bn({account:j,record:q,modelId:o,geminiReq:A.geminiReq,requestBody:k,options:u,sampleRound:A.buildRound(0),sampleBinding:A.encoded.binding,samplePage:A.encoded.page,signal:d,log:e}).catch(()=>null);if(a&&!a.error)return e?.info?.("AISTUDIO",`${o} Playground 429 bypassed via Build Code Assistant lane (account=${j.key.slice(0,8)}, applet=${a.appletId.slice(0,8)})`),this.#bo({assistantFirst:a,account:j,modelId:o,credentials:c,url:aU,body:b,signal:d,log:e})}}catch(a){return p(this.#bl(a))}if(l.error)return p(l.error);let{names:F,systemTokens:G,buildRound:K}=A;e?.info?.("AISTUDIO",`${o} first frame after ${Date.now()-l.startedAt}ms (proof ${l.proofMs??"?"}ms)`);let L={toolCalls:new Map,toolNameMap:F,model:o,sessionId:c?._clientSessionId||null,provider:"aistudio"},M=new TextEncoder,N=this,O=null;return{response:new Response(new ReadableStream({async start(a){let b=b=>{for(let c of(0,h.o)(b,L)||[])a.enqueue(M.encode(a$(c)))};O=l.reader;let c=l.frame,f=null,g=null,i=null,k=0;try{for(;;){var m;let d="",h=null,l="";for(;c;){let a=P(c,{systemTokens:G,continuable:v});a.usage&&(g=a.usage),a.continuation&&(d=a.continuation),null!==a.finishCode&&void 0!==a.finishCode&&(h=a.finishCode,l=a.continuation||"");let e=a.chunk;if(e?.candidates?.[0]){let a=e.candidates[0];a.finishReason&&(i={finishReason:a.finishReason,finishMessage:a.finishMessage},delete a.finishReason,delete a.finishMessage),delete e.usageMetadata,a.content.parts.length&&b(e)}else e?.promptFeedback&&(i={blocked:e.promptFeedback});c=await O.next()}let n=O.trailer(),p=S(n);if(p&&0!==p.code){let b=X({httpStatus:200,rpc:p});e?.warn?.("AISTUDIO",`${o} stream ended with error status ${b.status} (rpc ${p.code}): ${String(b.message).slice(0,200)}`),a.enqueue(M.encode(a$(U(b))));break}f=function(a,b){if(!a)return b;if(!b)return a;let c={...b};return c.candidatesTokenCount=(a.candidatesTokenCount||0)+(b.candidatesTokenCount||0),c.thoughtsTokenCount=(a.thoughtsTokenCount||0)+(b.thoughtsTokenCount||0),c.toolUsePromptTokenCount=(a.toolUsePromptTokenCount||0)+(b.toolUsePromptTokenCount||0),c.totalTokenCount=(b.totalTokenCount||0)+(a.candidatesTokenCount||0)+(a.thoughtsTokenCount||0)+(a.toolUsePromptTokenCount||0),c}(f,g),g=null;let r=v&&(22===h||2===h&&""!==l&&(m=k,q?.continuedOutputTokens>0&&Number(w)>(m+1)*32768));if(r&&!d){e?.warn?.("AISTUDIO",`${o} stream ended with error status 502: continuation requested without a token`),a.enqueue(M.encode(a$(U({status:502,message:"AI Studio asked to continue but sent no continuation token",failureClass:"upstream_transient"}))));break}if(!r||k+1>=64){if(i?.blocked){let b=W(i.blocked);e?.warn?.("AISTUDIO",`${o} prompt blocked mid-stream: ${i.blocked.blockReason} -> error status ${b.status}`),a.enqueue(M.encode(a$(U(b))))}else i||null!==h?b({candidates:[{index:0,content:{role:"model",parts:[]},finishReason:i?.finishReason||"STOP"}],...f?{usageMetadata:f}:{}}):(e?.warn?.("AISTUDIO",`${o} stream ended with error status 502: no finish frame`),a.enqueue(M.encode(a$(U({status:502,message:"AI Studio stream ended before a finish frame",failureClass:"upstream_transient"})))));break}k+=1,i=null;let s=await N.#bm(B,K(k,d),{account:j,modelId:o,retryNotFound:!1,log:e});if(s.error){a.enqueue(M.encode(a$(U(s.error))));break}O=s.reader,c=s.frame}}catch(b){d?.aborted||a.enqueue(M.encode(a$(U(N.#bl(b)))))}finally{a.enqueue(M.encode("data: [DONE]\n\n")),a.close(),N.sessions.scheduleCookieSync(j)}},cancel(a){O?.cancel(a)}}),{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache"}}),url:aU,headers:{},transformedBody:b}}async generateMedia({prompt:a,kind:b="image",model:c,size:d,aspectRatio:e,imageSize:f,quality:g,duration:h,resolution:i,n:j=1,images:k=[],credentials:l,signal:m=null,log:n=null}={}){let o,p;if("image"!==b&&"video"!==b)throw aW({status:400,message:`AI Studio cannot generate ${b}`});if("string"!=typeof a||!a.trim())throw aW({status:400,message:"Missing required field: prompt"});if(Array.isArray(k)&&k.length)throw aW({status:400,message:"AI Studio media generation here is text-only (no input images yet)"});let q=aZ(c||("video"===b?"gemini-omni-1.2-flash":"gemini-3.1-flash-image"));try{o=this.account(l)}catch(a){throw aW({status:401,message:`AI Studio credential: ${a.message}`,failureClass:"reauth_required"})}try{p=await this.sessions.open(o,{model:q,signal:m})}catch(a){throw aW(this.#bl(a))}let r=aX(q,b,p,(0,as.DS)(o.connectionId),l?.providerSpecificData?.aistudioCatalog);if(!r)throw aW({status:404,message:`AI Studio ${b} model ${q} is not available to this account`,failureClass:"invalid_model"});let s=Date.now();try{if("video"===b){let b=function(a,{size:b,aspectRatio:c,duration:d,resolution:e}={}){let f=c||"",g=e||"",h=aE(b);h?(f||=`${h.width}:${h.height}`,g||=`${Math.min(h.width,h.height)}p`):f||null===aA(b)||(f=b),f||="16:9",g||="720p";let i=null==d||""===d?4:Number(d);if(!Number.isFinite(i)||i<0)throw aF("Video duration must be a non-negative number of seconds");i=Math.round(i)||4,a?.videoDurations?.length&&(i=Number(aD(i,a.videoDurations.map(String),Number)));let j=a?.videoDurationRange;j&&(Number.isFinite(j.min)&&(i=Math.max(i,j.min)),Number.isFinite(j.max)&&(i=Math.min(i,j.max)));let k=aA(f);if(null===k)throw aF(`Invalid aspect_ratio ${JSON.stringify(f)}`);a?.videoAspectRatios?.length&&(f=aD(k,a.videoAspectRatios,aA));let l=aB(g);if(null===l)throw aF(`Invalid resolution ${JSON.stringify(g)}`);return a?.videoResolutions?.length&&(g=aD(l,a.videoResolutions,aB)),{aspectRatio:f,duration:i,resolution:g}}(r,{size:d,aspectRatio:e,duration:h,resolution:i}),c=function(a,b,c,{reasoningEffort:d}={}){var e;let f,g=String(b||""),h=Array(8).fill(null);if(a?.thinkingLevel){let b=ax[aG(a,d)];b&&(h[5]=b)}h[6]=1;let i=I(a);if(!i)throw aF(`AI Studio model ${a?.id} has no output token limit`);h[7]=i,y(h,24,[]);let j=Array(54).fill(null);return j[17]=[`models/${String(a.id).replace(/^models\//,"")}`,h],j[26]=[[[[[[[g]]]]]]],j[53]=[[[null,null,null,(e=a?.defaultVideoResolution||"",f=[null,null,null,null,null,null],aw[e]&&(f[5]=aw[e]),c&&(c.aspectRatio&&(f[3]=av[aD(aA(c.aspectRatio),Object.keys(av),aA)]),c.duration>0&&(f[4]=[c.duration]),c.resolution&&(f[5]=aw[aD(aB(c.resolution),Object.keys(aw),aB)])),f)]]],{body:[1,1,null,j,null,1],binding:g,page:g}}(r,a,b);n?.info?.("AISTUDIO",`${q} video ${b.resolution} ${b.aspectRatio} ${b.duration}s`);let f=await this.sessions.generate(o,{...c,model:q,signal:m,method:"CreateInteractionStream"}),g=await this.#bp(f,q,n);return n?.info?.("AISTUDIO",`${q} video done in ${Date.now()-s}ms`),[{...g,aspectRatio:b.aspectRatio,duration:b.duration,resolution:b.resolution}]}let c=function(a,{size:b,aspectRatio:c,imageSize:d,quality:e}={}){let f=a?.imageAspectRatios?.length?a.imageAspectRatios:az,g=a?.imageSizes||[],h={aspectRatio:"",imageSize:""},i=aE(b);if(i){h.aspectRatio=aD(Math.log(i.width)-Math.log(i.height),f,aA);let a=Math.sqrt(i.width*i.height),b="",c=1/0,d="",e=0;for(let f of g){let g=aC(f);g&&(g>=a&&g<c?(b=f,c=g):g>e&&(d=f,e=g))}h.imageSize=b||d}let j=c||(i||null===aA(b)?"":b);if(j){let a=aA(j);if(null===a)throw aF(`Invalid aspect_ratio ${JSON.stringify(j)}`);h.aspectRatio=aD(a,f,aA)}let k="",l=String(e||"").trim().toLowerCase();if("low"===l||"standard"===l?k="1K":"medium"===l||"hd"===l?k="2K":("high"===l||"xhigh"===l||"max"===l)&&(k="4K"),d&&(k=String(d).trim().toUpperCase()),k){let a=aC(k);if(!a)throw aF(`Invalid image_size ${JSON.stringify(d)}`);g.length&&(k=aD(a,g,aC)),(d||a>(aC(h.imageSize)||0))&&(h.imageSize=k)}return h}(r,{size:d,aspectRatio:e,imageSize:f,quality:g}),k=Math.max(1,Math.min(4,Math.trunc(Number(j))||1)),l=[];for(let b=0;b<k;b++){let b=function(a,b,c={}){let d=String(b||""),e=a?.outputResolution?[[null,null,null,[null,[]]]]:null,f=e&&c.timezone?[null,null,String(c.timezone)]:null,g=Array(f?14:11).fill(null);return g[0]=`models/${String(a.id).replace(/^models\//,"")}`,g[1]=[[[[null,d]],"user"]],g[3]=function(a,{aspectRatio:b="",imageSize:c="",reasoningEffort:d}={}){let e=a?.thinking||a?.thinkingLevel||a?.thinkingBudget,f=null,g=c;!b&&!g&&a?.outputResolution&&(g="1K"),g?f=[b||null,g]:b&&(f=[b]);let h=Array(f?27:e?17:15).fill(null),i=I(a);return i&&(h[3]=i),"number"==typeof a?.temperature&&(h[4]=a.temperature),"number"==typeof a?.topP&&(h[5]=a.topP),"number"==typeof a?.topK&&(h[6]=Math.trunc(a.topK)),h[14]=[2,1],e&&(h[16]=a.thinkingLevel?[1,null,null,aG(a,d)]:[1]),f&&(h[26]=f),h}(a,c),e&&(g[6]=e),a?.continuedOutputTokens>0||(g[10]=1),f&&(g[13]=[f]),{body:g,binding:d,page:d}}(r,a,{...c,timezone:o.timezone}),d=await this.sessions.generate(o,{...b,model:q,signal:m});l.push(await this.#bq(d,q,n))}return n?.info?.("AISTUDIO",`${q} ${l.length} image(s) in ${Date.now()-s}ms`),l}catch(a){if(Number.isInteger(a?.status))throw a;throw aW(this.#bl(a))}finally{this.sessions.scheduleCookieSync(o)}}async #br(a,b,c,d){let e,f;try{e=this.account(a)}catch(a){throw aW({status:401,message:`AI Studio credential: ${a.message}`,failureClass:"reauth_required"})}try{f=await this.sessions.open(e,{model:c?b:T.Sk,signal:d})}catch(a){throw aW(this.#bl(a))}if(!c)return{account:e,record:null};let g=aX(b,c,f,(0,as.DS)(e.connectionId),a?.providerSpecificData?.aistudioCatalog);if(!g)throw aW({status:404,message:`AI Studio ${c} model ${b} is not available to this account`,failureClass:"invalid_model"});return{account:e,record:g}}async #bs(a,b){try{return await b()}catch(a){if(Number.isInteger(a?.status))throw a;throw aW(this.#bl(a))}finally{this.sessions.scheduleCookieSync(a)}}async generateSpeech({input:a,model:b,voice:c,language:d,instructions:e,speed:f,credentials:g,signal:h=null,log:i=null}={}){if("string"!=typeof a||!a.trim())throw aW({status:400,message:"Missing required field: input"});let j=aZ(b||"gemini-3.1-flash-tts-preview"),{account:k,record:l}=await this.#br(g,j,"tts",h);return this.#bs(k,async()=>{let b=function(a,b){let c=String(b||"").trim(),d=Array.isArray(a?.voices)?a.voices:[];if(!c)return"";if(!d.length)return c;let e=d.find(a=>a.toLowerCase()===c.toLowerCase());if(!e)throw aK(`Voice ${JSON.stringify(c)} is not available on ${a.id}; voices: ${d.slice(0,12).join(", ")}${d.length>12?", ...":""}`);return e}(l,c),g=function(a,{input:b,voice:c="",language:d="",style:e=""}={}){let{part:f,text:g}=function(a,b,c=""){let d=String(b||"").trim();if(!d)throw aK("Missing required field: input");let e=String(c||"").trim();if(a?.speechMetadata){let a=[null,d];return e&&y(a,40,[null,e]),{part:a,text:d}}let f=e?`${e}
231
+ `}async function a0(a,{fetchFn:b=fetch,signal:c=null}={}){if(!Array.isArray(a?.messages))return a;let d=!1,e=[];for(let f of a.messages){if(!Array.isArray(f?.content)){e.push(f);continue}let a=[];for(let e of f.content){let f=e?.type==="image_url"?e.image_url?.url:null;if("string"==typeof f&&/^https?:\/\//i.test(f)){let g=new AbortController,h=setTimeout(()=>g.abort(Error("image fetch timed out")),2e4);try{let h=await b(f,{signal:c?AbortSignal.any([c,g.signal]):g.signal});if(!h.ok)throw Error(`HTTP ${h.status}`);let i=Buffer.from(await h.arrayBuffer());if(i.length>0x1400000)throw Error("image larger than 20MB");let j=(h.headers.get("content-type")||"image/png").split(";")[0].trim();a.push({...e,image_url:{...e.image_url,url:`data:${j};base64,${i.toString("base64")}`}}),d=!0;continue}catch(b){let a=Error(`Could not fetch image ${f.slice(0,120)}: ${b.message}`);throw a.status=400,a}finally{clearTimeout(h)}}a.push(e)}e.push({...f,content:a})}return d?{...a,messages:e}:a}class a1{constructor(a){this.reader=a.getReader(),this.decoder=new TextDecoder,this.splitter=new N,this.pending=[],this.done=!1}async next(){for(;!this.pending.length&&!this.done;){let{done:a,value:b}=await this.reader.read();if(a){this.done=!0;let a=this.decoder.decode();a&&this.pending.push(...this.splitter.push(a));break}this.pending.push(...this.splitter.push(this.decoder.decode(b,{stream:!0})))}return this.pending.length?this.pending.shift():null}trailer(){return this.splitter.trailer()}cancel(a){this.reader.cancel(a).catch(()=>{})}}class a2 extends f.Hv{constructor(a={}){let b;super("aistudio",{id:"aistudio",baseUrl:aV,forceStream:!0,retrySameCredential429:!1}),this.fetchFn=a.fetchFn||fetch,this.persist=a.persist||(b=()=>Promise.resolve().then(c.bind(c,92216)),{async cookies(a,c){if(!a)return;let{mutateProviderConnection:d}=await b();await d(a,()=>({apiKey:c}))},async catalog(a,c){if(!a)return;let{mutateProviderConnection:d}=await b();await d(a,a=>{let b=a.providerSpecificData?.aistudioCatalog;return b&&b.tier===c.tier&&JSON.stringify(b.models)===JSON.stringify(c.models)&&JSON.stringify(b.media??null)===JSON.stringify(c.media??null)?null:{providerSpecificData:{...a.providerSpecificData||{},aistudioCatalog:c}}})}}),this.sessions=a.sessions||new ap({onCatalog:(a,b)=>this.#bm(a,b),onCookies:async(a,b)=>{let c=JSON.stringify(b);a.sources.add(aZ(c)),await this.persist.cookies(a.connectionId,c)}}),this.accounts=new Map}parseError(a,b){return function(a,b){try{let c=JSON.parse(b),d=c?.error;if(!d||"object"!=typeof d)return null;let e=Number(d.resets_at_ms);return{status:a,message:d.message||`AI Studio HTTP ${a}`,...Number.isFinite(e)&&e>0?{resetsAtMs:e}:{},...d.failure_class?{failureClass:d.failure_class}:{},..."account"===d.lock_scope?{lockScope:"account"}:{},...void 0!==d.code?{providerErrorCode:d.code}:{}}}catch{return null}}(a.status,b)}async testConnection(a){return p(r(a)).valid}async checkAccount(a,{live:b=!0,signal:c=null}={}){let d=p(r(a));if(!d.valid)return{valid:!1,error:d.error};let e=d.warning||null;if(!b)return{valid:!0,error:null,...e?{warning:e}:{}};let f=null;try{f=this.account(a);let b=await this.sessions.open(f,{model:T.Sk,signal:c});return{valid:!0,error:null,tier:b?.tierName||null,models:(b?.models||[]).map(a=>a.id),catalog:b||null,...e?{warning:e}:{}}}catch(b){let a=b instanceof ao?b.details:null;if(a?.status===401)return{valid:!1,error:a.message};if(b instanceof ak)return{valid:!0,error:null,warning:b.message};return{valid:!1,error:a?.message||b?.message||"AI Studio check failed"}}finally{f&&!f.connectionId&&(this.accounts.delete(f.key),await this.sessions.close?.(f.key))}}async #bm(a,b){a.connectionId&&((0,at.br)(a.connectionId,b),await this.persist.catalog(a.connectionId,b))}account(a){let b=r(a),c=p(b);if(!c.valid)throw new l(c.error);let e=n(b),f=function(a,b){let c=String(a?.connectionId||a?.id||"").replace(/[^A-Za-z0-9_-]/g,"");if(c)return c;let e=(b.cookies||[]).find(a=>"SAPISID"===a.name)?.value||"";return`acct-${(0,d.createHash)("sha256").update(e).digest("hex").slice(0,16)}`}(a,e),g=aZ(b),h=a?.providerSpecificData||{},i=this.accounts.get(f);i&&i.sources.has(g)||(i&&this.sessions.forget(f),i={key:f,connectionId:a?.connectionId||null,sources:new Set([g]),state:e,fingerprint:null},this.accounts.set(f,i));let{locale:j,timezone:k}=function(a={},b=process.env){return{locale:String(a.locale||"").trim()||function(a=process.env){for(let b of["LC_ALL","LC_MESSAGES","LANG"]){let c=av(a[b]);if(c)return c}return av(Intl.DateTimeFormat().resolvedOptions().locale)||"en-US"}(b),timezone:String(a.timezone||"").trim()||function(a=process.env){return au(a.TZ)||au(Intl.DateTimeFormat().resolvedOptions().timeZone)||"UTC"}(b)}}(h);return i.locale=j,i.timezone=k,i.authUser=h.authUser||0,i.proxy=h.proxy||"",i}async execute({model:a,body:b,credentials:c,signal:d,log:e}){var f;let j,k,l,m,n,o=a$(a),p=a=>({response:new Response(JSON.stringify(U(a)),{status:a.status,headers:{"Content-Type":"application/json"}}),url:aV,headers:{},transformedBody:b});try{j=this.account(c)}catch(a){return p({status:401,message:`AI Studio credential: ${a.message}`,failureClass:"reauth_required"})}if(!(0,at.DS)(j.connectionId)&&!c?.providerSpecificData?.aistudioCatalog?.models?.length)try{await this.sessions.open(j,{model:o,signal:d})}catch(a){return p(this.#bn(a))}let{model:q,catalog:r}=(m=(0,at.DS)(c?.connectionId)||c?.providerSpecificData?.aistudioCatalog||null,m?.models?.length?{model:m.models.find(a=>a.id===o)||null,catalog:m}:{model:(0,at.V7)(o)||T.cC.find(a=>a.id===o)||{id:o,name:o,thinking:!0,functions:!0},catalog:null});if(!q)return p({status:404,message:`AI Studio model ${o} is not available to this account (${r?.tierName||"unknown"} tier)`,failureClass:"invalid_model"});try{k=await a0(b,{fetchFn:this.fetchFn,signal:d})}catch(a){return p({status:a.status||400,message:a.message})}let s=a=>"string"==typeof a&&a&&a!==i.bf&&a!==t?a:null,u={stop:"string"==typeof k.stop?[k.stop]:k.stop,maxOutputTokens:k.max_completion_tokens??k.max_tokens,temperature:"number"==typeof k.temperature?k.temperature:void 0,topP:"number"==typeof k.top_p?k.top_p:void 0,topK:"number"==typeof k.top_k?k.top_k:void 0,reasoningEffort:(f=k,(n=f?.reasoning_effort||f?.reasoning?.effort)||(f?.thinking?.type==="disabled"?"none":void 0)),...function(a){let b=a?.response_format;if(!b||"object"!=typeof b)return{};if("json_object"===b.type)return{responseMimeType:"application/json"};if("json_schema"===b.type){let a=b.json_schema?.schema||b.schema;return{responseMimeType:"application/json",...a?{responseSchema:a}:{}}}return{}}(k)},v=q.continuedOutputTokens>0,w=I(q,u.maxOutputTokens),x=a=>{var b;let d,e=(0,g.m$)(o,a,!0,c),f=E(e.contents,{realSignature:s}),h=(b=e.systemInstruction,(d=(b?.parts||[]).map(a=>a?.text).filter(a=>"string"==typeof a&&""!==a)).length?[d.map(a=>[null,a]),"user"]:null),{tools:i,names:j}=function(a,b){let c=new Map;if(!Array.isArray(a)||0===a.length||"none"===b)return{tools:null,names:c};let d=[];for(let b of a){let a=function(a){let b,c=a?.type==="function"&&a.function?a.function:a,d=c?.name;if(!d)return null;let e=c.parameters??c.input_schema??{type:"object",properties:{}},f={...e?.$defs||{},...e?.definitions||{}},g=C(function a(b,c,d=0){if(Array.isArray(b))return b.map(b=>a(b,c,d));if(!b||"object"!=typeof b)return b;if("string"==typeof b.$ref&&d<24){let e=b.$ref.match(/^#\/(?:\$defs|definitions)\/(.+)$/),f=e?c[decodeURIComponent(e[1])]:null;if(f){let{$ref:e,...g}=b;return a({...f,...g},c,d+1)}return{}}let e={};for(let[f,g]of Object.entries(b))"$defs"!==f&&"definitions"!==f&&(e[f]=a(g,c,d));return e}(e,f));"object"!==g.type&&(g={type:"object",properties:{value:g}});let h="string"==typeof c.description?c.description:"";return b=JSON.stringify(e??{}),(/"(additionalProperties|prefixItems|exclusiveMinimum|exclusiveMaximum|propertyNames|\$ref|patternProperties|const)"/.test(b)||!0===c.strict)&&(h+=`${h?"\n":""}Arguments must follow this JSON Schema: ${JSON.stringify(e)}`),[z(d),h,D(g)]}(b);if(!a)continue;let e=(b?.type==="function"&&b.function?b.function:b).name;a[0]!==e&&c.set(a[0],e),d.push(a)}return 0===d.length?{tools:null,names:c}:{tools:[[null,d]],names:c}}(a.tools,a.tool_choice),k=+!!h;return{geminiReq:e,encoded:f,system:h,names:j,systemTokens:k,buildRound:(a,b="")=>J({model:q,contents:f.contents,system:h,tools:i,config:function(a,b={}){let c=y([],13,null);Array.isArray(b.stop)&&b.stop.length&&(c[1]=b.stop.map(String));let d=I(a,b.maxOutputTokens);d&&a?.continuedOutputTokens>0&&(d=Math.min(d,((b.round||0)+1)*32768)),d&&(c[3]=d);let e=b.temperature??a?.temperature,f=b.topP??a?.topP,g=b.topK??a?.topK;if("number"==typeof e&&(c[4]=e),"number"==typeof f&&(c[5]=f),"number"==typeof g&&(c[6]=Math.trunc(g)),b.responseMimeType&&(c[7]=b.responseMimeType),b.responseSchema&&(c[8]=D(C(b.responseSchema))),c[13]=1,a?.thinking||a?.thinkingLevel||a?.thinkingBudget){let d=H(a,b.reasoningEffort);y(c,16,d?[1,null,null,d]:[1])}return a?.continuedOutputTokens>0&&y(c,45,1),c}(q,{...u,round:a}),continuationToken:b})}},A=x(k);if(!A.encoded.contents.length)return p({status:400,message:"AI Studio request has no content"});let B=async a=>await this.sessions.generate(j,{body:a,binding:A.encoded.binding,page:A.encoded.page,model:o,signal:d});try{if(l=await this.#bo(B,A.buildRound(0),{account:j,modelId:o,retryNotFound:!0,log:e}),l.error?.code==="prompt_blocked"){let a=(0,as.ds)(k);if(a.changed){e?.info?.("AISTUDIO",`${o} content filter triggered (${l.error.message}) -> retrying once with Lapis-2 security neutralizer`);let b=x(a.value),c=async a=>this.sessions.generate(j,{body:a,binding:b.encoded.binding,page:b.encoded.page,model:o,signal:d}),f=await this.#bo(c,b.buildRound(0),{account:j,modelId:o,retryNotFound:!1,log:e});f&&!f.error&&(l=f,A=b,B=c)}}if(l.error?.status===429){let a=()=>this.#bp({account:j,sessionId:c?._clientSessionId||null,record:q,modelId:o,geminiReq:A.geminiReq,requestBody:k,options:u,sampleRound:A.buildRound(0),sampleBinding:A.encoded.binding,samplePage:A.encoded.page,signal:d,log:e}).catch(()=>null),f=await a();if(f?.error&&403===f.error.status&&"account"===f.error.lockScope){e?.info?.("AISTUDIO",`${o} applet-lane verification 403 on account=${j.key.slice(0,8)}; probing once before giving up`),this.sessions.forget(j.key),await this.sessions.open(j,{model:o,force:!0}).catch(()=>{});let b=await a();b&&!b.error&&(e?.info?.("AISTUDIO",`${o} applet-lane verification 403 cleared on retry (account=${j.key.slice(0,8)}) -> false positive`),f=b)}if(f&&!f.error)return e?.info?.("AISTUDIO",`${o} Playground 429 bypassed via Build Code Assistant lane (account=${j.key.slice(0,8)}, applet=${f.appletId.slice(0,8)})`),this.#bq({assistantFirst:f,account:j,modelId:o,credentials:c,url:aV,body:b,signal:d,log:e})}if(l.error&&403===l.error.status&&"account"===l.error.lockScope){e?.info?.("AISTUDIO",`${o} verification 403 on account=${j.key.slice(0,8)}; probing once before locking`),this.sessions.forget(j.key),await this.sessions.open(j,{model:o,force:!0}).catch(()=>{});let a=await this.#bo(B,A.buildRound(0),{account:j,modelId:o,retryNotFound:!1,log:e}).catch(()=>null);a&&!a.error?(e?.info?.("AISTUDIO",`${o} verification 403 cleared on retry (account=${j.key.slice(0,8)}) -> false positive, not locking`),l=a):a&&a.error&&(l=a)}}catch(a){return p(this.#bn(a))}if(l.error)return p(l.error);let{names:F,systemTokens:G,buildRound:K}=A;e?.info?.("AISTUDIO",`${o} first frame after ${Date.now()-l.startedAt}ms (proof ${l.proofMs??"?"}ms)`);let L={toolCalls:new Map,toolNameMap:F,model:o,sessionId:c?._clientSessionId||null,provider:"aistudio"},M=new TextEncoder,N=this,O=null;return{response:new Response(new ReadableStream({async start(a){let b=b=>{for(let c of(0,h.o)(b,L)||[])a.enqueue(M.encode(a_(c)))};O=l.reader;let c=l.frame,f=null,g=null,i=null,k=0;try{for(;;){var m;let d="",h=null,l="";for(;c;){let a=P(c,{systemTokens:G,continuable:v});a.usage&&(g=a.usage),a.continuation&&(d=a.continuation),null!==a.finishCode&&void 0!==a.finishCode&&(h=a.finishCode,l=a.continuation||"");let e=a.chunk;if(e?.candidates?.[0]){let a=e.candidates[0];a.finishReason&&(i={finishReason:a.finishReason,finishMessage:a.finishMessage},delete a.finishReason,delete a.finishMessage),delete e.usageMetadata,a.content.parts.length&&b(e)}else e?.promptFeedback&&(i={blocked:e.promptFeedback});c=await O.next()}let n=O.trailer(),p=S(n);if(p&&0!==p.code){let b=Y({httpStatus:200,rpc:p});e?.warn?.("AISTUDIO",`${o} stream ended with error status ${b.status} (rpc ${p.code}): ${String(b.message).slice(0,200)}`),a.enqueue(M.encode(a_(U(b))));break}f=function(a,b){if(!a)return b;if(!b)return a;let c={...b};return c.candidatesTokenCount=(a.candidatesTokenCount||0)+(b.candidatesTokenCount||0),c.thoughtsTokenCount=(a.thoughtsTokenCount||0)+(b.thoughtsTokenCount||0),c.toolUsePromptTokenCount=(a.toolUsePromptTokenCount||0)+(b.toolUsePromptTokenCount||0),c.totalTokenCount=(b.totalTokenCount||0)+(a.candidatesTokenCount||0)+(a.thoughtsTokenCount||0)+(a.toolUsePromptTokenCount||0),c}(f,g),g=null;let r=v&&(22===h||2===h&&""!==l&&(m=k,q?.continuedOutputTokens>0&&Number(w)>(m+1)*32768));if(r&&!d){e?.warn?.("AISTUDIO",`${o} stream ended with error status 502: continuation requested without a token`),a.enqueue(M.encode(a_(U({status:502,message:"AI Studio asked to continue but sent no continuation token",failureClass:"upstream_transient"}))));break}if(!r||k+1>=64){if(i?.blocked){let b=X(i.blocked);e?.warn?.("AISTUDIO",`${o} prompt blocked mid-stream: ${i.blocked.blockReason} -> error status ${b.status}`),a.enqueue(M.encode(a_(U(b))))}else i||null!==h?b({candidates:[{index:0,content:{role:"model",parts:[]},finishReason:i?.finishReason||"STOP"}],...f?{usageMetadata:f}:{}}):(e?.warn?.("AISTUDIO",`${o} stream ended with error status 502: no finish frame`),a.enqueue(M.encode(a_(U({status:502,message:"AI Studio stream ended before a finish frame",failureClass:"upstream_transient"})))));break}k+=1,i=null;let s=await N.#bo(B,K(k,d),{account:j,modelId:o,retryNotFound:!1,log:e});if(s.error){a.enqueue(M.encode(a_(U(s.error))));break}O=s.reader,c=s.frame}}catch(b){d?.aborted||a.enqueue(M.encode(a_(U(N.#bn(b)))))}finally{a.enqueue(M.encode("data: [DONE]\n\n")),a.close(),N.sessions.scheduleCookieSync(j)}},cancel(a){O?.cancel(a)}}),{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache"}}),url:aV,headers:{},transformedBody:b}}async generateMedia({prompt:a,kind:b="image",model:c,size:d,aspectRatio:e,imageSize:f,quality:g,duration:h,resolution:i,n:j=1,images:k=[],credentials:l,signal:m=null,log:n=null}={}){let o,p;if("image"!==b&&"video"!==b)throw aX({status:400,message:`AI Studio cannot generate ${b}`});if("string"!=typeof a||!a.trim())throw aX({status:400,message:"Missing required field: prompt"});if(Array.isArray(k)&&k.length)throw aX({status:400,message:"AI Studio media generation here is text-only (no input images yet)"});let q=a$(c||("video"===b?"gemini-omni-1.2-flash":"gemini-3.1-flash-image"));try{o=this.account(l)}catch(a){throw aX({status:401,message:`AI Studio credential: ${a.message}`,failureClass:"reauth_required"})}try{p=await this.sessions.open(o,{model:q,signal:m})}catch(a){throw aX(this.#bn(a))}let r=aY(q,b,p,(0,at.DS)(o.connectionId),l?.providerSpecificData?.aistudioCatalog);if(!r)throw aX({status:404,message:`AI Studio ${b} model ${q} is not available to this account`,failureClass:"invalid_model"});let s=Date.now();try{if("video"===b){let b=function(a,{size:b,aspectRatio:c,duration:d,resolution:e}={}){let f=c||"",g=e||"",h=aF(b);h?(f||=`${h.width}:${h.height}`,g||=`${Math.min(h.width,h.height)}p`):f||null===aB(b)||(f=b),f||="16:9",g||="720p";let i=null==d||""===d?4:Number(d);if(!Number.isFinite(i)||i<0)throw aG("Video duration must be a non-negative number of seconds");i=Math.round(i)||4,a?.videoDurations?.length&&(i=Number(aE(i,a.videoDurations.map(String),Number)));let j=a?.videoDurationRange;j&&(Number.isFinite(j.min)&&(i=Math.max(i,j.min)),Number.isFinite(j.max)&&(i=Math.min(i,j.max)));let k=aB(f);if(null===k)throw aG(`Invalid aspect_ratio ${JSON.stringify(f)}`);a?.videoAspectRatios?.length&&(f=aE(k,a.videoAspectRatios,aB));let l=aC(g);if(null===l)throw aG(`Invalid resolution ${JSON.stringify(g)}`);return a?.videoResolutions?.length&&(g=aE(l,a.videoResolutions,aC)),{aspectRatio:f,duration:i,resolution:g}}(r,{size:d,aspectRatio:e,duration:h,resolution:i}),c=function(a,b,c,{reasoningEffort:d}={}){var e;let f,g=String(b||""),h=Array(8).fill(null);if(a?.thinkingLevel){let b=ay[aH(a,d)];b&&(h[5]=b)}h[6]=1;let i=I(a);if(!i)throw aG(`AI Studio model ${a?.id} has no output token limit`);h[7]=i,y(h,24,[]);let j=Array(54).fill(null);return j[17]=[`models/${String(a.id).replace(/^models\//,"")}`,h],j[26]=[[[[[[[g]]]]]]],j[53]=[[[null,null,null,(e=a?.defaultVideoResolution||"",f=[null,null,null,null,null,null],ax[e]&&(f[5]=ax[e]),c&&(c.aspectRatio&&(f[3]=aw[aE(aB(c.aspectRatio),Object.keys(aw),aB)]),c.duration>0&&(f[4]=[c.duration]),c.resolution&&(f[5]=ax[aE(aC(c.resolution),Object.keys(ax),aC)])),f)]]],{body:[1,1,null,j,null,1],binding:g,page:g}}(r,a,b);n?.info?.("AISTUDIO",`${q} video ${b.resolution} ${b.aspectRatio} ${b.duration}s`);let f=await this.sessions.generate(o,{...c,model:q,signal:m,method:"CreateInteractionStream"}),g=await this.#br(f,q,n);return n?.info?.("AISTUDIO",`${q} video done in ${Date.now()-s}ms`),[{...g,aspectRatio:b.aspectRatio,duration:b.duration,resolution:b.resolution}]}let c=function(a,{size:b,aspectRatio:c,imageSize:d,quality:e}={}){let f=a?.imageAspectRatios?.length?a.imageAspectRatios:aA,g=a?.imageSizes||[],h={aspectRatio:"",imageSize:""},i=aF(b);if(i){h.aspectRatio=aE(Math.log(i.width)-Math.log(i.height),f,aB);let a=Math.sqrt(i.width*i.height),b="",c=1/0,d="",e=0;for(let f of g){let g=aD(f);g&&(g>=a&&g<c?(b=f,c=g):g>e&&(d=f,e=g))}h.imageSize=b||d}let j=c||(i||null===aB(b)?"":b);if(j){let a=aB(j);if(null===a)throw aG(`Invalid aspect_ratio ${JSON.stringify(j)}`);h.aspectRatio=aE(a,f,aB)}let k="",l=String(e||"").trim().toLowerCase();if("low"===l||"standard"===l?k="1K":"medium"===l||"hd"===l?k="2K":("high"===l||"xhigh"===l||"max"===l)&&(k="4K"),d&&(k=String(d).trim().toUpperCase()),k){let a=aD(k);if(!a)throw aG(`Invalid image_size ${JSON.stringify(d)}`);g.length&&(k=aE(a,g,aD)),(d||a>(aD(h.imageSize)||0))&&(h.imageSize=k)}return h}(r,{size:d,aspectRatio:e,imageSize:f,quality:g}),k=Math.max(1,Math.min(4,Math.trunc(Number(j))||1)),l=[];for(let b=0;b<k;b++){let b=function(a,b,c={}){let d=String(b||""),e=a?.outputResolution?[[null,null,null,[null,[]]]]:null,f=e&&c.timezone?[null,null,String(c.timezone)]:null,g=Array(f?14:11).fill(null);return g[0]=`models/${String(a.id).replace(/^models\//,"")}`,g[1]=[[[[null,d]],"user"]],g[3]=function(a,{aspectRatio:b="",imageSize:c="",reasoningEffort:d}={}){let e=a?.thinking||a?.thinkingLevel||a?.thinkingBudget,f=null,g=c;!b&&!g&&a?.outputResolution&&(g="1K"),g?f=[b||null,g]:b&&(f=[b]);let h=Array(f?27:e?17:15).fill(null),i=I(a);return i&&(h[3]=i),"number"==typeof a?.temperature&&(h[4]=a.temperature),"number"==typeof a?.topP&&(h[5]=a.topP),"number"==typeof a?.topK&&(h[6]=Math.trunc(a.topK)),h[14]=[2,1],e&&(h[16]=a.thinkingLevel?[1,null,null,aH(a,d)]:[1]),f&&(h[26]=f),h}(a,c),e&&(g[6]=e),a?.continuedOutputTokens>0||(g[10]=1),f&&(g[13]=[f]),{body:g,binding:d,page:d}}(r,a,{...c,timezone:o.timezone}),d=await this.sessions.generate(o,{...b,model:q,signal:m});l.push(await this.#bs(d,q,n))}return n?.info?.("AISTUDIO",`${q} ${l.length} image(s) in ${Date.now()-s}ms`),l}catch(a){if(Number.isInteger(a?.status))throw a;throw aX(this.#bn(a))}finally{this.sessions.scheduleCookieSync(o)}}async #bt(a,b,c,d){let e,f;try{e=this.account(a)}catch(a){throw aX({status:401,message:`AI Studio credential: ${a.message}`,failureClass:"reauth_required"})}try{f=await this.sessions.open(e,{model:c?b:T.Sk,signal:d})}catch(a){throw aX(this.#bn(a))}if(!c)return{account:e,record:null};let g=aY(b,c,f,(0,at.DS)(e.connectionId),a?.providerSpecificData?.aistudioCatalog);if(!g)throw aX({status:404,message:`AI Studio ${c} model ${b} is not available to this account`,failureClass:"invalid_model"});return{account:e,record:g}}async #bu(a,b){try{return await b()}catch(a){if(Number.isInteger(a?.status))throw a;throw aX(this.#bn(a))}finally{this.sessions.scheduleCookieSync(a)}}async generateSpeech({input:a,model:b,voice:c,language:d,instructions:e,speed:f,credentials:g,signal:h=null,log:i=null}={}){if("string"!=typeof a||!a.trim())throw aX({status:400,message:"Missing required field: input"});let j=a$(b||"gemini-3.1-flash-tts-preview"),{account:k,record:l}=await this.#bt(g,j,"tts",h);return this.#bu(k,async()=>{let b=function(a,b){let c=String(b||"").trim(),d=Array.isArray(a?.voices)?a.voices:[];if(!c)return"";if(!d.length)return c;let e=d.find(a=>a.toLowerCase()===c.toLowerCase());if(!e)throw aL(`Voice ${JSON.stringify(c)} is not available on ${a.id}; voices: ${d.slice(0,12).join(", ")}${d.length>12?", ...":""}`);return e}(l,c),g=function(a,{input:b,voice:c="",language:d="",style:e=""}={}){let{part:f,text:g}=function(a,b,c=""){let d=String(b||"").trim();if(!d)throw aL("Missing required field: input");let e=String(c||"").trim();if(a?.speechMetadata){let a=[null,d];return e&&y(a,40,[null,e]),{part:a,text:d}}let f=e?`${e}
232
232
 
233
- ${d}`:d,g=f.startsWith(aJ)?f:`${aJ}
234
- ${f}`;return{part:[null,g],text:g}}(a,b,e),h=aL(a,{speech:function({voice:a="",language:b=""}={}){let c=[[[String(a).trim()||"Zephyr"]]];return String(b).trim()&&(c[1]=String(b).trim()),c}({voice:c,language:d})});return{body:J({model:a,contents:[[[f],"user"]],config:h}),binding:g,page:g}}(l,{input:a,voice:b,language:d,style:function(a,b){let c=String(a||"").trim(),d=Number(b);if(null!=b&&""!==b){if(!Number.isFinite(d)||d<.25||d>4)throw aK("speed must be between 0.25 and 4.0");1!==d&&(c=`${c} Speak at ${d} times the normal speaking rate.`.trim())}return c}(e,f)}),m=Date.now(),n=await this.sessions.generate(k,{...g,model:j,signal:h}),o=await this.#bt(n,j,i);return i?.info?.("AISTUDIO",`${j} speech ${o.format} ${o.buffer.length}B in ${Date.now()-m}ms`),o})}async generateMusic({prompt:a,model:b,credentials:c,signal:d=null,log:e=null}={}){if("string"!=typeof a||!a.trim())throw aW({status:400,message:"Missing required field: prompt"});let f=aZ(b||"lyria-3-clip-preview"),{account:g,record:h}=await this.#br(c,f,"music",d);return this.#bs(g,async()=>{let b=function(a,b){let c=String(b||"");if(!c.trim())throw aK("Missing required field: prompt");let d=aL(a);return{body:J({model:a,contents:[[[[null,c]],"user"]],config:d}),binding:c,page:c}}(h,a),c=Date.now(),i=await this.sessions.generate(g,{...b,model:f,signal:d}),j=await this.#bt(i,f,e);return e?.info?.("AISTUDIO",`${f} music ${j.format} ${j.buffer.length}B in ${Date.now()-c}ms`),j})}async embed({model:a,input:b,dimensions:c,taskType:d,credentials:e,signal:f=null,log:g=null}={}){let h=aZ(a||"gemini-embedding-001"),i=[].concat(b??[]);if(!i.length)throw aW({status:400,message:"input must not be empty"});for(let a=0;a<i.length;a+=100)aM(h,i.slice(a,a+100),{dimensions:c,taskType:d});let{account:j}=await this.#br(e,h,null,f);return this.#bs(j,async()=>{let a=[],b=0;for(let e=0;e<i.length;e+=100){let k,l=aM(h,i.slice(e,e+100),{dimensions:c,taskType:d}),m=await this.sessions.generate(j,{body:l.body,binding:l.binding,page:l.page,model:T.Sk,signal:f,method:"ProxyUnaryCall",proofField:3}),n=await this.#bu(m,h,g);if(n)throw n;try{k=function(a,b){let c,d=function(a){let b,c=String(a||"").replace(/^\)\]\}'\s*/,"").trim();try{b=JSON.parse(c)}catch{throw Object.assign(Error("AI Studio ProxyUnaryCall returned non-JSON"),{status:502})}if(!Array.isArray(b))throw Object.assign(Error("AI Studio ProxyUnaryCall response is not an array"),{status:502});if("string"==typeof b[0])return b[0];if("string"==typeof b[2])return aI.Buffer.from(b[2],"base64").toString("utf8");throw Object.assign(Error("AI Studio ProxyUnaryCall response has no body"),{status:502})}(a);try{c=JSON.parse(d)}catch{throw Object.assign(Error("AI Studio embeddings body is not JSON"),{status:502})}if(c?.error){let a=Number(c.error.code)||502;throw Object.assign(Error(c.error.message||"AI Studio embeddings failed"),{status:a,upstreamStatus:c.error.status})}let e=Array.isArray(c?.embeddings)?c.embeddings.map(a=>Array.isArray(a?.values)?a.values:[]):[];if(e.length!==b)throw Object.assign(Error(`AI Studio returned ${e.length} embeddings for ${b} inputs`),{status:502});return{embeddings:e,tokenCount:Number(c.tokenCount)||0}}(await ap(m.body),l.count)}catch(b){let a=Number(b?.status)||502;throw aW({status:a,message:`AI Studio embeddings: ${b.message}`,...a>=500?{failureClass:"upstream_transient"}:[400,404,422].includes(a)?{failureClass:"invalid_request"}:{}})}a.push(...k.embeddings),b+=k.tokenCount}return g?.info?.("AISTUDIO",`${h} ${a.length} embedding(s)`),{embeddings:a,tokenCount:b}})}async #bt(a,b,c){let d,e=await this.#bu(a,b,c);if(e)throw e;let f=new a0(a.body),g=[],h="",i=null,j=null;for(let a=await f.next();a;a=await f.next()){let b=P(a);b.blocked&&(j=b.chunk.promptFeedback);let c=b.chunk?.candidates?.[0];if(c)for(let a of(c.finishReason&&(i=c.finishReason),c.content.parts))a.inlineData?.data&&!a.thought?g.push(a.inlineData):"string"!=typeof a.text||a.thought||(h+=a.text)}let k=this.#bv(f);if(k)throw k;if(j)throw aW(W(j));try{d=function(a){let b="",c=null,d=[];for(let e of a||[]){let a=aI.Buffer.from(String(e?.data||""),"base64"),{base:f,params:g}=function(a){let[b,...c]=String(a||"").split(";"),d={};for(let a of c){let[b,c]=a.split("=");b&&void 0!==c&&(d[b.trim().toLowerCase()]=c.trim())}return{base:b.trim().toLowerCase(),params:d}}(e?.mimeType);if(!f.startsWith("audio/")||!a.length)continue;let h=f;if("audio/wav"===f||"audio/x-wav"===f){let b=function(a){if(a.length<12||"RIFF"!==a.toString("ascii",0,4)||"WAVE"!==a.toString("ascii",8,12))throw Error("AI Studio returned an invalid WAV");let b=12,c=null;for(;b+8<=a.length;){let d=a.toString("ascii",b,b+4),e=a.readUInt32LE(b+4),f=b+8;if("fmt "===d)c={tag:a.readUInt16LE(f),channels:a.readUInt16LE(f+2),rate:a.readUInt32LE(f+4),bits:a.readUInt16LE(f+14)};else if("data"===d){if(!c||1!==c.tag||16!==c.bits)throw Error("AI Studio returned WAV that is not PCM16");return{pcm:a.subarray(f,Math.min(a.length,f+e)),rate:c.rate,channels:c.channels}}b=f+e+e%2}throw Error("AI Studio returned WAV without data")}(a);a=b.pcm,f="audio/l16",g={rate:String(b.rate),channels:String(b.channels)}}if("audio/l16"===f){let a=function(a){let b=Number.parseInt(a.rate,10);if(!Number.isFinite(b)||b<=0)throw Error("AI Studio audio MIME is missing a valid rate");let c=a.channels?Number.parseInt(a.channels,10):1;if(!Number.isFinite(c)||c<=0)throw Error("AI Studio audio MIME has invalid channels");return{rate:b,channels:c}}(g);h=`audio/l16;rate=${a.rate};channels=${a.channels}`,c=a}if(b||(b=h),b!==h)throw Object.assign(Error("AI Studio returned multiple audio formats"),{status:502});d.push(a)}if(!d.length)return null;let e=aI.Buffer.concat(d);if(c)return{buffer:function(a,b=24e3,c=1){let d=aI.Buffer.alloc(44);return d.write("RIFF",0),d.writeUInt32LE(36+a.length,4),d.write("WAVE",8),d.write("fmt ",12),d.writeUInt32LE(16,16),d.writeUInt16LE(1,20),d.writeUInt16LE(c,22),d.writeUInt32LE(b,24),d.writeUInt32LE(b*c*2,28),d.writeUInt16LE(2*c,32),d.writeUInt16LE(16,34),d.write("data",36),d.writeUInt32LE(a.length,40),aI.Buffer.concat([d,a])}(e,c.rate,c.channels),mime:"audio/wav",format:"wav"};let f="audio/mpeg"===b||"audio/mp3"===b?"mp3":b.slice(6).replace(/^x-/,"")||"bin";return{buffer:e,mime:"audio/mp3"===b?"audio/mpeg":b,format:f}}(g)}catch(a){throw aW({status:502,message:a.message,failureClass:"upstream_transient"})}if(!d){let a=i&&aV.has(i),d=h.trim()?`: ${h.trim().slice(0,300)}`:"";throw c?.warn?.("AISTUDIO",`${b} returned no audio (finish ${i||"none"})`),aW({status:a?400:422,message:`AI Studio returned no audio (finish ${i||"none"})${d}`,code:a?"prompt_blocked":"no_audio",failureClass:"invalid_request"})}return{...d,...h.trim()?{text:h.trim()}:{}}}async #bu(a,b,c){let d=Number(a.headers?.["x-zevai-upstream-status"]||a.status);if(200===d)return null;let e=Y(d,await ap(a.body).catch(()=>""),a.headers?.["retry-after"]||null);return c?.warn?.("AISTUDIO",`${b} upstream HTTP ${d}${null!==e.code&&void 0!==e.code?` (rpc ${e.code})`:""}: ${String(e.message).slice(0,200)}`),aW(e)}#bv(a){let b=S(a.trailer());return b&&0!==b.code?aW(X({httpStatus:200,rpc:b})):null}async #bq(a,b,c){let d=await this.#bu(a,b,c);if(d)throw d;let e=new a0(a.body),f=null,g=null,h="",i=null,j=null;for(let a=await e.next();a;a=await e.next()){let b=P(a);b.blocked&&(j=b.chunk.promptFeedback);let c=b.chunk?.candidates?.[0];if(c)for(let a of(c.finishReason&&(i=c.finishReason),c.content.parts))a.inlineData?.data&&/^image\//.test(a.inlineData.mimeType||"")?a.thought?g=a.inlineData:f=a.inlineData:"string"!=typeof a.text||a.thought||(h+=a.text)}let k=this.#bv(e);if(k)throw k;if(j)throw aW(W(j));let l=f||g;if(!l){let a=i&&aV.has(i),d=h.trim()?`: ${h.trim().slice(0,300)}`:"";throw c?.warn?.("AISTUDIO",`${b} returned no image (finish ${i||"none"})`),aW({status:a?400:422,message:`AI Studio returned no image (finish ${i||"none"})${d}`,code:a?"prompt_blocked":"no_image",failureClass:"invalid_request"})}return{b64:l.data,mime:l.mimeType||"image/png",...h.trim()?{text:h.trim()}:{}}}async #bp(a,b,c){let d=await this.#bu(a,b,c);if(d)throw d;let e=new a0(a.body),f=null,g=null,h="";for(let a=await e.next();a;a=await e.next()){let b=function(a){let b={media:[],text:"",final:null};if(!Array.isArray(a))return b;let c=a[10];if(Array.isArray(c))return(Array.isArray(c[1])?c[1]:[]).forEach((a,c)=>{if(null!=a){if(0===c&&Array.isArray(a)&&"string"==typeof a[0])b.text+=a[0];else if(c>=1&&c<=4&&Array.isArray(a)&&"string"==typeof a[1]){let d=ay[c];b.media.push({mime:d.codes[a[0]]||d.unlisted,data:a[1],kind:1===c?"image":4===c?"video":2===c?"audio":"document"})}}}),b;let d=a[19]??a[1];if(Array.isArray(d)&&Array.isArray(d[0])){let a=d[0],c=Array.isArray(a[12])?a[12]:null,e=c?{inputTokens:Number(c[0])||0,outputTokens:Number(c[4])||0,reasoningTokens:Number(c[8])||0,totalTokens:Number(c[9])||0}:null;b.final={status:Number(a[1])||0,usage:e}}return b}(a);for(let a of b.media)"video"===a.kind&&(f=a);b.text&&(h+=b.text),b.final&&(g=b.final)}let i=this.#bv(e);if(i)throw i;if(!g)throw aW({status:502,message:"AI Studio video stream ended before the final interaction",failureClass:"upstream_transient"});if(g.status===aH.FAILED||g.status===aH.CANCELLED)throw aW({status:502,message:`AI Studio interaction ${g.status===aH.FAILED?"failed":"cancelled"}`,failureClass:"upstream_transient"});if(!f){let a=h.trim()?`: ${h.trim().slice(0,300)}`:"";throw aW({status:422,message:`AI Studio returned no video${a}`,code:"no_video",failureClass:"invalid_request"})}return{b64:f.data,mime:f.mime,...g.usage?{usage:g.usage}:{}}}async #bm(a,b,{account:c,modelId:d,retryNotFound:e,log:f=null}){let g=Date.now(),h=await a(b),i=Number(h.headers?.["x-zevai-upstream-status"]||h.status);404===i&&e&&(await ap(h.body).catch(()=>""),this.sessions.forget(c.key),await this.sessions.open(c,{model:d,force:!0}),h=await a(b),i=Number(h.headers?.["x-zevai-upstream-status"]||h.status));let j=Number(h.headers?.["x-zevai-proof-ms"])||null;if(200!==i){let a=Y(i,await ap(h.body).catch(()=>""),h.headers?.["retry-after"]||null);return f?.warn?.("AISTUDIO",`${d} upstream HTTP ${i}${null!==a.code&&void 0!==a.code?` (rpc ${a.code})`:""}: ${String(a.message).slice(0,200)}`),{error:a}}let k=new a0(h.body),l=await k.next();if(!l){let a=S(k.trailer());if(a&&0!==a.code){let b=X({httpStatus:200,rpc:a});return f?.warn?.("AISTUDIO",`${d} stream ended with error status ${b.status} (rpc ${a.code}) before any frame`),{error:b}}return f?.warn?.("AISTUDIO",`${d} stream ended with error status 502: empty stream`),{error:{status:502,message:"AI Studio returned an empty stream",failureClass:"upstream_transient"}}}let m=P(l);if(m.blocked){k.cancel("prompt blocked");let a=Array.isArray(l?.[1])?l[1][0]:null,b=W(m.chunk.promptFeedback);return f?.warn?.("AISTUDIO",`${d} prompt blocked: ${m.chunk.promptFeedback.blockReason} (block code ${a??"?"}) -> error status ${b.status}`),{error:b}}let n=m.chunk?.candidates?.[0],o=n?.content?.parts||[];if(n?.finishReason&&(0,ar.B4)(n.finishReason)&&0===o.length){k.cancel("candidate finishReason blocked");let a=W({blockReason:n.finishReason,blockReasonMessage:n.finishMessage});return f?.warn?.("AISTUDIO",`${d} candidate blocked on first frame: ${n.finishReason} -> error status ${a.status}`),{error:a}}return{reader:k,frame:l,startedAt:g,proofMs:j}}async #bw(a,{modelId:b,baseHeaders:c,signal:d}){if(a.assistantAppletId)return a.assistantAppletId;let e=aU.replace(/\/GenerateContent$/,"/CreateApplet"),f=await this.fetchFn(e,{method:"POST",headers:c,body:JSON.stringify([null,["Untitled","Generated by Gemini.",null,null,"default"],null,null,1]),signal:d||void 0});if(!f.ok)throw Error(`CreateApplet HTTP ${f.status}`);let g=JSON.parse((await f.text()).replace(/^\)\]\}'\s*/,"").trim()),h=Array.isArray(g)&&"string"==typeof g[0]?g[0]:"";if(!h)throw Error("CreateApplet returned no applet ID");return a.assistantAppletId=h,h}async #bn({account:a,record:b,modelId:c,geminiReq:d,requestBody:f,options:g,sampleRound:h,sampleBinding:i,samplePage:j,signal:k,log:l}){let m=Date.now();await this.sessions.open(a,{model:c,signal:k});let n=await this.sessions.helper.call("/prepare",{account:a.key,method:"GenerateContent",body:h,proofField:5,binding:i,page:j},{signal:k});if(200!==n.status||!n.json?.headers)return{error:{status:502,message:"AI Studio helper /prepare failed for assistant lane"}};let o={...n.json.headers};delete o.Priority,delete o.priority;let p=await this.#bw(a,{modelId:c,baseHeaders:o,signal:k}),q=function({model:a,geminiReq:b,rawTools:c,toolChoice:d,options:f={},appletId:g}){var h;let i,j=function(a,b){if(!Array.isArray(a)||!a.length||"none"===("string"==typeof b?b:b?.type))return[];let c=[];for(let b of a){let a=b?.function||b;a?.name&&c.push({name:String(a.name),description:String(a.description||""),parameters:a.parameters||a.input_schema||{type:"object",properties:{}}})}return c}(c,d),k=j.map(a=>a.name),l=Array.isArray(b?.contents)?b.contents:[],m=(h=b?.systemInstruction,Array.isArray(i=h?.parts)?i.map(a=>"string"==typeof a?.text?a.text:"").filter(Boolean):[]),n=[];for(let a of l){let b=a?.role==="model"?"model":"user",c=[],d="",e=[],f=()=>{e.length&&(c.push({text:`${d}
233
+ ${d}`:d,g=f.startsWith(aK)?f:`${aK}
234
+ ${f}`;return{part:[null,g],text:g}}(a,b,e),h=aM(a,{speech:function({voice:a="",language:b=""}={}){let c=[[[String(a).trim()||"Zephyr"]]];return String(b).trim()&&(c[1]=String(b).trim()),c}({voice:c,language:d})});return{body:J({model:a,contents:[[[f],"user"]],config:h}),binding:g,page:g}}(l,{input:a,voice:b,language:d,style:function(a,b){let c=String(a||"").trim(),d=Number(b);if(null!=b&&""!==b){if(!Number.isFinite(d)||d<.25||d>4)throw aL("speed must be between 0.25 and 4.0");1!==d&&(c=`${c} Speak at ${d} times the normal speaking rate.`.trim())}return c}(e,f)}),m=Date.now(),n=await this.sessions.generate(k,{...g,model:j,signal:h}),o=await this.#bv(n,j,i);return i?.info?.("AISTUDIO",`${j} speech ${o.format} ${o.buffer.length}B in ${Date.now()-m}ms`),o})}async generateMusic({prompt:a,model:b,credentials:c,signal:d=null,log:e=null}={}){if("string"!=typeof a||!a.trim())throw aX({status:400,message:"Missing required field: prompt"});let f=a$(b||"lyria-3-clip-preview"),{account:g,record:h}=await this.#bt(c,f,"music",d);return this.#bu(g,async()=>{let b=function(a,b){let c=String(b||"");if(!c.trim())throw aL("Missing required field: prompt");let d=aM(a);return{body:J({model:a,contents:[[[[null,c]],"user"]],config:d}),binding:c,page:c}}(h,a),c=Date.now(),i=await this.sessions.generate(g,{...b,model:f,signal:d}),j=await this.#bv(i,f,e);return e?.info?.("AISTUDIO",`${f} music ${j.format} ${j.buffer.length}B in ${Date.now()-c}ms`),j})}async embed({model:a,input:b,dimensions:c,taskType:d,credentials:e,signal:f=null,log:g=null}={}){let h=a$(a||"gemini-embedding-001"),i=[].concat(b??[]);if(!i.length)throw aX({status:400,message:"input must not be empty"});for(let a=0;a<i.length;a+=100)aN(h,i.slice(a,a+100),{dimensions:c,taskType:d});let{account:j}=await this.#bt(e,h,null,f);return this.#bu(j,async()=>{let a=[],b=0;for(let e=0;e<i.length;e+=100){let k,l=aN(h,i.slice(e,e+100),{dimensions:c,taskType:d}),m=await this.sessions.generate(j,{body:l.body,binding:l.binding,page:l.page,model:T.Sk,signal:f,method:"ProxyUnaryCall",proofField:3}),n=await this.#bw(m,h,g);if(n)throw n;try{k=function(a,b){let c,d=function(a){let b,c=String(a||"").replace(/^\)\]\}'\s*/,"").trim();try{b=JSON.parse(c)}catch{throw Object.assign(Error("AI Studio ProxyUnaryCall returned non-JSON"),{status:502})}if(!Array.isArray(b))throw Object.assign(Error("AI Studio ProxyUnaryCall response is not an array"),{status:502});if("string"==typeof b[0])return b[0];if("string"==typeof b[2])return aJ.Buffer.from(b[2],"base64").toString("utf8");throw Object.assign(Error("AI Studio ProxyUnaryCall response has no body"),{status:502})}(a);try{c=JSON.parse(d)}catch{throw Object.assign(Error("AI Studio embeddings body is not JSON"),{status:502})}if(c?.error){let a=Number(c.error.code)||502;throw Object.assign(Error(c.error.message||"AI Studio embeddings failed"),{status:a,upstreamStatus:c.error.status})}let e=Array.isArray(c?.embeddings)?c.embeddings.map(a=>Array.isArray(a?.values)?a.values:[]):[];if(e.length!==b)throw Object.assign(Error(`AI Studio returned ${e.length} embeddings for ${b} inputs`),{status:502});return{embeddings:e,tokenCount:Number(c.tokenCount)||0}}(await aq(m.body),l.count)}catch(b){let a=Number(b?.status)||502;throw aX({status:a,message:`AI Studio embeddings: ${b.message}`,...a>=500?{failureClass:"upstream_transient"}:[400,404,422].includes(a)?{failureClass:"invalid_request"}:{}})}a.push(...k.embeddings),b+=k.tokenCount}return g?.info?.("AISTUDIO",`${h} ${a.length} embedding(s)`),{embeddings:a,tokenCount:b}})}async #bv(a,b,c){let d,e=await this.#bw(a,b,c);if(e)throw e;let f=new a1(a.body),g=[],h="",i=null,j=null;for(let a=await f.next();a;a=await f.next()){let b=P(a);b.blocked&&(j=b.chunk.promptFeedback);let c=b.chunk?.candidates?.[0];if(c)for(let a of(c.finishReason&&(i=c.finishReason),c.content.parts))a.inlineData?.data&&!a.thought?g.push(a.inlineData):"string"!=typeof a.text||a.thought||(h+=a.text)}let k=this.#bx(f);if(k)throw k;if(j)throw aX(X(j));try{d=function(a){let b="",c=null,d=[];for(let e of a||[]){let a=aJ.Buffer.from(String(e?.data||""),"base64"),{base:f,params:g}=function(a){let[b,...c]=String(a||"").split(";"),d={};for(let a of c){let[b,c]=a.split("=");b&&void 0!==c&&(d[b.trim().toLowerCase()]=c.trim())}return{base:b.trim().toLowerCase(),params:d}}(e?.mimeType);if(!f.startsWith("audio/")||!a.length)continue;let h=f;if("audio/wav"===f||"audio/x-wav"===f){let b=function(a){if(a.length<12||"RIFF"!==a.toString("ascii",0,4)||"WAVE"!==a.toString("ascii",8,12))throw Error("AI Studio returned an invalid WAV");let b=12,c=null;for(;b+8<=a.length;){let d=a.toString("ascii",b,b+4),e=a.readUInt32LE(b+4),f=b+8;if("fmt "===d)c={tag:a.readUInt16LE(f),channels:a.readUInt16LE(f+2),rate:a.readUInt32LE(f+4),bits:a.readUInt16LE(f+14)};else if("data"===d){if(!c||1!==c.tag||16!==c.bits)throw Error("AI Studio returned WAV that is not PCM16");return{pcm:a.subarray(f,Math.min(a.length,f+e)),rate:c.rate,channels:c.channels}}b=f+e+e%2}throw Error("AI Studio returned WAV without data")}(a);a=b.pcm,f="audio/l16",g={rate:String(b.rate),channels:String(b.channels)}}if("audio/l16"===f){let a=function(a){let b=Number.parseInt(a.rate,10);if(!Number.isFinite(b)||b<=0)throw Error("AI Studio audio MIME is missing a valid rate");let c=a.channels?Number.parseInt(a.channels,10):1;if(!Number.isFinite(c)||c<=0)throw Error("AI Studio audio MIME has invalid channels");return{rate:b,channels:c}}(g);h=`audio/l16;rate=${a.rate};channels=${a.channels}`,c=a}if(b||(b=h),b!==h)throw Object.assign(Error("AI Studio returned multiple audio formats"),{status:502});d.push(a)}if(!d.length)return null;let e=aJ.Buffer.concat(d);if(c)return{buffer:function(a,b=24e3,c=1){let d=aJ.Buffer.alloc(44);return d.write("RIFF",0),d.writeUInt32LE(36+a.length,4),d.write("WAVE",8),d.write("fmt ",12),d.writeUInt32LE(16,16),d.writeUInt16LE(1,20),d.writeUInt16LE(c,22),d.writeUInt32LE(b,24),d.writeUInt32LE(b*c*2,28),d.writeUInt16LE(2*c,32),d.writeUInt16LE(16,34),d.write("data",36),d.writeUInt32LE(a.length,40),aJ.Buffer.concat([d,a])}(e,c.rate,c.channels),mime:"audio/wav",format:"wav"};let f="audio/mpeg"===b||"audio/mp3"===b?"mp3":b.slice(6).replace(/^x-/,"")||"bin";return{buffer:e,mime:"audio/mp3"===b?"audio/mpeg":b,format:f}}(g)}catch(a){throw aX({status:502,message:a.message,failureClass:"upstream_transient"})}if(!d){let a=i&&aW.has(i),d=h.trim()?`: ${h.trim().slice(0,300)}`:"";throw c?.warn?.("AISTUDIO",`${b} returned no audio (finish ${i||"none"})`),aX({status:a?400:422,message:`AI Studio returned no audio (finish ${i||"none"})${d}`,code:a?"prompt_blocked":"no_audio",failureClass:"invalid_request"})}return{...d,...h.trim()?{text:h.trim()}:{}}}async #bw(a,b,c){let d=Number(a.headers?.["x-zevai-upstream-status"]||a.status);if(200===d)return null;let e=Z(d,await aq(a.body).catch(()=>""),a.headers?.["retry-after"]||null);return c?.warn?.("AISTUDIO",`${b} upstream HTTP ${d}${null!==e.code&&void 0!==e.code?` (rpc ${e.code})`:""}: ${String(e.message).slice(0,200)}`),aX(e)}#bx(a){let b=S(a.trailer());return b&&0!==b.code?aX(Y({httpStatus:200,rpc:b})):null}async #bs(a,b,c){let d=await this.#bw(a,b,c);if(d)throw d;let e=new a1(a.body),f=null,g=null,h="",i=null,j=null;for(let a=await e.next();a;a=await e.next()){let b=P(a);b.blocked&&(j=b.chunk.promptFeedback);let c=b.chunk?.candidates?.[0];if(c)for(let a of(c.finishReason&&(i=c.finishReason),c.content.parts))a.inlineData?.data&&/^image\//.test(a.inlineData.mimeType||"")?a.thought?g=a.inlineData:f=a.inlineData:"string"!=typeof a.text||a.thought||(h+=a.text)}let k=this.#bx(e);if(k)throw k;if(j)throw aX(X(j));let l=f||g;if(!l){let a=i&&aW.has(i),d=h.trim()?`: ${h.trim().slice(0,300)}`:"";throw c?.warn?.("AISTUDIO",`${b} returned no image (finish ${i||"none"})`),aX({status:a?400:422,message:`AI Studio returned no image (finish ${i||"none"})${d}`,code:a?"prompt_blocked":"no_image",failureClass:"invalid_request"})}return{b64:l.data,mime:l.mimeType||"image/png",...h.trim()?{text:h.trim()}:{}}}async #br(a,b,c){let d=await this.#bw(a,b,c);if(d)throw d;let e=new a1(a.body),f=null,g=null,h="";for(let a=await e.next();a;a=await e.next()){let b=function(a){let b={media:[],text:"",final:null};if(!Array.isArray(a))return b;let c=a[10];if(Array.isArray(c))return(Array.isArray(c[1])?c[1]:[]).forEach((a,c)=>{if(null!=a){if(0===c&&Array.isArray(a)&&"string"==typeof a[0])b.text+=a[0];else if(c>=1&&c<=4&&Array.isArray(a)&&"string"==typeof a[1]){let d=az[c];b.media.push({mime:d.codes[a[0]]||d.unlisted,data:a[1],kind:1===c?"image":4===c?"video":2===c?"audio":"document"})}}}),b;let d=a[19]??a[1];if(Array.isArray(d)&&Array.isArray(d[0])){let a=d[0],c=Array.isArray(a[12])?a[12]:null,e=c?{inputTokens:Number(c[0])||0,outputTokens:Number(c[4])||0,reasoningTokens:Number(c[8])||0,totalTokens:Number(c[9])||0}:null;b.final={status:Number(a[1])||0,usage:e}}return b}(a);for(let a of b.media)"video"===a.kind&&(f=a);b.text&&(h+=b.text),b.final&&(g=b.final)}let i=this.#bx(e);if(i)throw i;if(!g)throw aX({status:502,message:"AI Studio video stream ended before the final interaction",failureClass:"upstream_transient"});if(g.status===aI.FAILED||g.status===aI.CANCELLED)throw aX({status:502,message:`AI Studio interaction ${g.status===aI.FAILED?"failed":"cancelled"}`,failureClass:"upstream_transient"});if(!f){let a=h.trim()?`: ${h.trim().slice(0,300)}`:"";throw aX({status:422,message:`AI Studio returned no video${a}`,code:"no_video",failureClass:"invalid_request"})}return{b64:f.data,mime:f.mime,...g.usage?{usage:g.usage}:{}}}async #bo(a,b,{account:c,modelId:d,retryNotFound:e,log:f=null}){let g=Date.now(),h=await a(b),i=Number(h.headers?.["x-zevai-upstream-status"]||h.status);404===i&&e&&(await aq(h.body).catch(()=>""),this.sessions.forget(c.key),await this.sessions.open(c,{model:d,force:!0}),h=await a(b),i=Number(h.headers?.["x-zevai-upstream-status"]||h.status));let j=Number(h.headers?.["x-zevai-proof-ms"])||null;if(200!==i){let a=Z(i,await aq(h.body).catch(()=>""),h.headers?.["retry-after"]||null);return f?.warn?.("AISTUDIO",`${d} upstream HTTP ${i}${null!==a.code&&void 0!==a.code?` (rpc ${a.code})`:""}: ${String(a.message).slice(0,200)}`),{error:a}}let k=new a1(h.body),l=await k.next();if(!l){let a=S(k.trailer());if(a&&0!==a.code){let b=Y({httpStatus:200,rpc:a});return f?.warn?.("AISTUDIO",`${d} stream ended with error status ${b.status} (rpc ${a.code}) before any frame`),{error:b}}return f?.warn?.("AISTUDIO",`${d} stream ended with error status 502: empty stream`),{error:{status:502,message:"AI Studio returned an empty stream",failureClass:"upstream_transient"}}}let m=P(l);if(m.blocked){k.cancel("prompt blocked");let a=Array.isArray(l?.[1])?l[1][0]:null,b=X(m.chunk.promptFeedback);return f?.warn?.("AISTUDIO",`${d} prompt blocked: ${m.chunk.promptFeedback.blockReason} (block code ${a??"?"}) -> error status ${b.status}`),{error:b}}let n=m.chunk?.candidates?.[0],o=n?.content?.parts||[];if(n?.finishReason&&(0,as.B4)(n.finishReason)&&0===o.length){k.cancel("candidate finishReason blocked");let a=X({blockReason:n.finishReason,blockReasonMessage:n.finishMessage});return f?.warn?.("AISTUDIO",`${d} candidate blocked on first frame: ${n.finishReason} -> error status ${a.status}`),{error:a}}return{reader:k,frame:l,startedAt:g,proofMs:j}}async #by(a,{modelId:b,baseHeaders:c,signal:d,sessionId:e=null}){a.assistantApplets||(a.assistantApplets=new Map);let f=e||`anon:${Date.now()}:${Math.random().toString(36).slice(2)}`,g=a.assistantApplets.get(f);if(g)return g;let h=aV.replace(/\/GenerateContent$/,"/CreateApplet"),i=await this.fetchFn(h,{method:"POST",headers:c,body:JSON.stringify([null,["Untitled","Generated by Gemini.",null,null,"default"],null,null,1]),signal:d||void 0});if(!i.ok)throw Error(`CreateApplet HTTP ${i.status}`);let j=JSON.parse((await i.text()).replace(/^\)\]\}'\s*/,"").trim()),k=Array.isArray(j)&&"string"==typeof j[0]?j[0]:"";if(!k)throw Error("CreateApplet returned no applet ID");if(a.assistantApplets.set(f,k),a.assistantApplets.size>64){let b=a.assistantApplets.keys().next().value;a.assistantApplets.delete(b)}return k}async #bp({account:a,sessionId:b=null,record:c,modelId:d,geminiReq:f,requestBody:g,options:h,sampleRound:i,sampleBinding:j,samplePage:k,signal:l,log:m}){let n=Date.now();await this.sessions.open(a,{model:d,signal:l});let o=await this.sessions.helper.call("/prepare",{account:a.key,method:"GenerateContent",body:i,proofField:5,binding:j,page:k},{signal:l});if(200!==o.status||!o.json?.headers)return{error:{status:502,message:"AI Studio helper /prepare failed for assistant lane"}};let p={...o.json.headers};delete p.Priority,delete p.priority;let q=await this.#by(a,{modelId:d,baseHeaders:p,signal:l,sessionId:b}),r=function({model:a,geminiReq:b,rawTools:c,toolChoice:d,options:f={},appletId:g}){var h;let i,j=function(a,b){if(!Array.isArray(a)||!a.length||"none"===("string"==typeof b?b:b?.type))return[];let c=[];for(let b of a){let a=b?.function||b;a?.name&&c.push({name:String(a.name),description:String(a.description||""),parameters:a.parameters||a.input_schema||{type:"object",properties:{}}})}return c}(c,d),k=j.map(a=>a.name),l=Array.isArray(b?.contents)?b.contents:[],m=(h=b?.systemInstruction,Array.isArray(i=h?.parts)?i.map(a=>"string"==typeof a?.text?a.text:"").filter(Boolean):[]),n=[];for(let a of l){let b=a?.role==="model"?"model":"user",c=[],d="",e=[],f=()=>{e.length&&(c.push({text:`${d}
235
235
  ${JSON.stringify(e)}
236
- \`\`\``}),e=[],d="")};for(let b of a?.parts||[])if(b?.functionCall){d!==aN&&(f(),d=aN);let a=b.functionCall.args??b.functionCall.arguments??{};if("string"==typeof a)try{a=JSON.parse(a)}catch{a={}}e.push({name:b.functionCall.name,arguments:a})}else if(b?.functionResponse)d!==aO&&(f(),d=aO),e.push({name:b.functionResponse.name,response:b.functionResponse.response??{}});else{if(f(),b?.thought)continue;"string"==typeof b?.text&&b.text?c.push({text:b.text}):b?.inlineData&&c.push({inlineData:b.inlineData})}f(),c.length&&n.push({role:b,parts:c})}let o=function(a,b){let c=b.length>0,d=c?aR.filter(a=>a!==aQ):aR,e=`The tools listed earlier in your instructions (${d.join(", ")}) act on an empty remote applet workspace that has nothing to do with this conversation or the user's machine. You are strictly forbidden to call any of them: do not create, view, edit or delete workspace files, run workspace commands, compile, install, deploy or generate images there. Reply to the user directly in your answer.`;if(c){let a=JSON.stringify(b);e+=`
236
+ \`\`\``}),e=[],d="")};for(let b of a?.parts||[])if(b?.functionCall){d!==aO&&(f(),d=aO);let a=b.functionCall.args??b.functionCall.arguments??{};if("string"==typeof a)try{a=JSON.parse(a)}catch{a={}}e.push({name:b.functionCall.name,arguments:a})}else if(b?.functionResponse)d!==aP&&(f(),d=aP),e.push({name:b.functionResponse.name,response:b.functionResponse.response??{}});else{if(f(),b?.thought)continue;"string"==typeof b?.text&&b.text?c.push({text:b.text}):b?.inlineData&&c.push({inlineData:b.inlineData})}f(),c.length&&n.push({role:b,parts:c})}let o=function(a,b){let c=b.length>0,d=c?aS.filter(a=>a!==aR):aS,e=`The tools listed earlier in your instructions (${d.join(", ")}) act on an empty remote applet workspace that has nothing to do with this conversation or the user's machine. You are strictly forbidden to call any of them: do not create, view, edit or delete workspace files, run workspace commands, compile, install, deploy or generate images there. Reply to the user directly in your answer.`;if(c){let a=JSON.stringify(b);e+=`
237
237
 
238
238
  You can call the following client functions. They run on the user's machine, not in this workspace, and are the only way to read or change the user's files, run the user's commands or reach the user's services.
239
239
  ${a}
240
240
  To call functions, write one fenced block:
241
- ${aN}
241
+ ${aO}
242
242
  [{"name": "<function name>", "arguments": {<arguments>}}]
243
243
  \`\`\`
244
- Right after the block, call your ask_question tool once with the question "${aP}" and write nothing more. The user's machine runs the calls and the results arrive as the answer in a fenced function_results block. Never write a function_results block yourself. Answer normally when no function is needed.`}return a.length>0&&(e+="\n\n"+a.join("\n\n")),e}(m,j),p=n;if(n.length>1){let a=n[n.length-1],b="user"===a.role?n.slice(0,-1):n,c=["<conversation_history>"];for(let a of b){let b="model"===a.role?"assistant_turn":"user_turn",d=a.parts.map(a=>a.text||"").filter(Boolean).join("\n");c.push(`<${b}>
244
+ Right after the block, call your ask_question tool once with the question "${aQ}" and write nothing more. The user's machine runs the calls and the results arrive as the answer in a fenced function_results block. Never write a function_results block yourself. Answer normally when no function is needed.`}return a.length>0&&(e+="\n\n"+a.join("\n\n")),e}(m,j),p=n;if(n.length>1){let a=n[n.length-1],b="user"===a.role?n.slice(0,-1):n,c=["<conversation_history>"];for(let a of b){let b="model"===a.role?"assistant_turn":"user_turn",d=a.parts.map(a=>a.text||"").filter(Boolean).join("\n");c.push(`<${b}>
245
245
  ${d}
246
246
  </${b}>`)}c.push("</conversation_history>"),o+=`
247
247
 
248
248
  The conversation before the first user message of this chat is transcribed at the end of these instructions between <conversation_history> and </conversation_history>: user turns between <user_turn> and </user_turn>, and your own earlier replies, including your function_calls blocks, between <assistant_turn> and </assistant_turn>. Continue the conversation from the latest message and never write these tags yourself.
249
249
 
250
- ${c.join("\n")}`,p="user"===a.role?[{role:"user",parts:a.parts}]:[{role:"user",parts:[{text:"Continue the conversation from the last turn of the conversation history at the end of your instructions."}]}]}else 1===p.length&&"user"!==p[0].role&&(p=[{role:"user",parts:p[0].parts}]);let q=E(p),r=String(a?.id||a||"gemini-3.8-flash").replace(/^models\//,""),s=H(a,f.reasoningEffort)||3,t=Array(29).fill(null);return t[0]=q.contents,t[5]=1,t[7]=`models/${r}`,o&&(t[8]=o),t[11]=g,t[13]=[2,null,2],t[15]=1,t[18]=[1,null,null,s],t[28]=e().randomUUID().toUpperCase(),{wire:t,binding:q.binding,page:q.page,functionNames:k}}({model:b,geminiReq:d,rawTools:f.tools,toolChoice:f.tool_choice,options:g,appletId:p}),r=await this.sessions.generate(a,{body:q.wire,binding:q.binding,page:q.page,model:c,signal:k,method:"CodeAssistantOffline",proofField:2}),s=Number(r.headers?.["x-zevai-upstream-status"]||r.status),t=await ap(r.body).catch(()=>"");if(200!==s){let a=Y(s,t,r.headers?.["retry-after"]||null);return l?.warn?.("AISTUDIO",`${c} CodeAssistantOffline HTTP ${s}: ${String(a.message).slice(0,200)}`),{error:a}}let u="";try{let a=JSON.parse(t.replace(/^\)\]\}'\s*/,"").trim());u=Array.isArray(a)&&"string"==typeof a[0]?a[0]:""}catch{}if(!u)return{error:{status:502,message:"CodeAssistantOffline returned no generation ID"}};let v=aU.replace(/\/GenerateContent$/,"/StreamCodeAssistantOfflineGeneration"),w=async()=>{let a=await this.fetchFn(v,{method:"POST",headers:o,body:JSON.stringify([u,null,null,p]),signal:k||void 0});if(!a.ok||!a.body){let b=await a.text().catch(()=>"");throw Object.assign(Error(`StreamCodeAssistantOfflineGeneration HTTP ${a.status}: ${b.slice(0,160)}`),{status:a.status})}return new a0(a.body)},x=await w(),y=await x.next();if(!y){let a=S(x.trailer());return a&&0!==a.code?{error:X({httpStatus:200,rpc:a})}:{error:{status:502,message:"AI Studio Assistant stream returned no frames"}}}return{reader:x,frame:y,reopenStream:w,functionNames:q.functionNames,appletId:p,generationId:u,startedAt:m}}#bo({assistantFirst:a,account:b,modelId:c,credentials:d,url:e,body:f,signal:g,log:i}){let j={toolCalls:new Map,toolNameMap:new Map,model:c,sessionId:d?._clientSessionId||null,provider:"aistudio"},k=new TextEncoder,l=this,m=a.reader,n=new aT(a.functionNames);return{response:new Response(new ReadableStream({async start(c){let d=a=>{for(let b of(0,h.o)(a,j)||[])c.enqueue(k.encode(a$(b)))};try{let b=async(a,b=null)=>{for(let e=b||await a.next();e;e=await a.next()){let{parts:b,error:f}=n.decodeFrame(e);if(f)return c.enqueue(k.encode(a$(U(f)))),!1;if(b.length>0&&d({candidates:[{index:0,content:{role:"model",parts:b}}]}),n.answered||n.overran){a.cancel("assistant turn complete");break}}return!0},e=await b(m,a.frame);if(e&&!n.finished&&!n.overran&&"function"==typeof a.reopenStream)try{m=await a.reopenStream(),e=await b(m,null)}catch{}if(e){let a=n.flush();a.parts.length>0&&d({candidates:[{index:0,content:{role:"model",parts:a.parts}}]}),d({candidates:[{index:0,content:{role:"model",parts:[]},finishReason:a.finishReason||"STOP"}],...a.usage?{usageMetadata:a.usage}:{}})}}catch(a){g?.aborted||c.enqueue(k.encode(a$(U(l.#bl(a)))))}finally{c.enqueue(k.encode("data: [DONE]\n\n")),c.close(),l.sessions.scheduleCookieSync(b)}},cancel(a){m?.cancel(a)}}),{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache"}}),url:e,headers:{},transformedBody:f}}#bl(a){if(a instanceof an)return a.details;if(a instanceof aj)return{status:503,message:a.message,failureClass:"upstream_transient"};if(a?.name==="AbortError"||a?.name==="TimeoutError")throw a;return{status:502,message:`AI Studio request failed: ${a?.message||a}`,failureClass:"upstream_transient"}}}},46956:(a,b,c)=>{"use strict";c.d(b,{Fm:()=>C,QH:()=>w,Vp:()=>v,ip:()=>x});var d=c(3433),e=c(27910),f=c(8735);let g=globalThis.fetch,h=new Set(["SELF_SIGNED_CERT_IN_CHAIN","DEPTH_ZERO_SELF_SIGNED_CERT","UNABLE_TO_VERIFY_LEAF_SIGNATURE","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_ISSUER_CERT_LOCALLY"]);function i(a){return a?"u">typeof Headers&&a instanceof Headers?Object.fromEntries(a.entries()):{...a}:{}}let j=new Map,k=new Map,l=["cloudcode-pa.googleapis.com","daily-cloudcode-pa.googleapis.com","api.individual.githubcopilot.com","q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com","api2.cursor.sh"],m=["8.8.8.8","8.8.4.4"];function n(){let a=Error("Request aborted");return a.name="AbortError",a}function o(a){return null==a?"":String(a).trim()}let p=new Map;async function q(a,b=null){let d,e=k.get(a);if(e&&Date.now()<e.expiry)return e.ip;if(b?.aborted)throw n();let g=p.get(a);if(g&&Date.now()<g)return null;let h=await Promise.resolve().then(c.t.bind(c,14985,23)),{promisify:i}=await Promise.resolve().then(c.t.bind(c,28354,23));if(b?.aborted)throw n();let j=new h.Resolver;j.setServers(m);let l=i(j.resolve4.bind(j)),o=b?new Promise((a,c)=>{d=()=>{j.cancel?.(),c(n())},b.addEventListener("abort",d,{once:!0})}):null,r=a=>o?Promise.race([a,o]):a,s=a=>{if(b?.aborted||a?.name==="AbortError")throw n()};try{let b=null,c=null;try{let c=await r(l(a));b=c?.[0]||null}catch(a){s(a),c=a}if(!b)try{let c="function"==typeof h.promises?.lookup?a=>h.promises.lookup(a,{family:4}):"function"==typeof h.lookup?i(h.lookup):null,d=c?await r(c(a,{family:4})):null,e="string"==typeof d?d:d?.address;e&&!function(a){let b=String(a||"").split(".");if(4!==b.length)return!0;let c=b.map(a=>/^\d{1,3}$/.test(a)?Number(a):0/0);if(c.some(a=>!Number.isInteger(a)||a<0||a>255))return!0;let[d,e]=c;return 0===d||10===d||127===d||169===d&&254===e||172===d&&e>=16&&e<=31||192===d&&168===e}(e)&&(b=e)}catch(a){s(a)}if(!b)return p.set(a,Date.now()+3e4),console.warn(`[ProxyFetch] DNS resolve failed for ${a}: ${c?.message||"no public address from system resolver"} (using default transport for 30s)`),null;return p.delete(a),k.set(a,{ip:b,expiry:Date.now()+f.v1.dnsCacheTtlMs}),b}finally{d&&b?.removeEventListener?.("abort",d)}}function r(a,b){let c,d=o(b);if(!d)return!1;try{c=new URL(a).hostname.toLowerCase()}catch{return!1}return d.split(",").map(a=>a.trim().toLowerCase()).filter(Boolean).some(a=>"*"===a||(a.startsWith(".")?c.endsWith(a)||c===a.slice(1):c===a||c.endsWith(`.${a}`)))}function s(a){let b;if(r(a,process.env.NO_PROXY||process.env.no_proxy))return null;try{b=new URL(a).protocol}catch{return null}return"https:"===b?process.env.HTTPS_PROXY||process.env.https_proxy||process.env.ALL_PROXY||process.env.all_proxy:process.env.HTTP_PROXY||process.env.http_proxy||process.env.ALL_PROXY||process.env.all_proxy}function t(a){let b=o(a);if(!b)return null;try{return new URL(b),b}catch{return`http://${b}`}}function u(a,b){if(b?.enabled!==!0&&b?.connectionProxyEnabled!==!0)return null;let c=o(b?.url??b?.connectionProxyUrl);if(!c)return null;let d=o(b?.noProxy??b?.connectionNoProxy);return d&&r(a,d)?null:t(c)}function v(a){return a?.strictProxy===!0&&!!(a.proxyPoolId||!0===a.enabled||!0===a.connectionProxyEnabled||o(a.url??a.connectionProxyUrl))}function w(a){return!!v(a)&&!o(a?.vercelRelayUrl)}function x(a,b=null){return u(a,b)||t(s(a))}async function y(a,b=!1){let d=t(a);if(!d&&!b)return null;let e=`${d||"direct"}::${b?"insecure":"secure"}`;if(!j.has(e)){j.size>=f.v1.proxyDispatchersMaxSize&&j.delete(j.keys().next().value);let{Agent:a,ProxyAgent:g}=await Promise.resolve().then(c.t.bind(c,3433,19)),h=b?{rejectUnauthorized:!1}:void 0,i=d?new g({uri:d,...b?{requestTls:h}:{}}):new a({connect:h});j.set(e,i)}return j.get(e)}async function z(a,b,c,e=!1){if(!c&&!e&&"function"==typeof b.directFetch)return b.directFetch(a,b);let f=c||e?await y(c,e):void 0,h=f?{...b,dispatcher:f}:b;return c||e?(0,d.hd)(a,h):g(a,h)}async function A(a,b,c){try{return await z(a,b,c,!1)}catch(f){if(b.signal?.aborted||f?.name==="AbortError")throw f;let d=b.body&&"function"==typeof b.body.getReader&&b.body.locked;if(b?.strictTls===!0||"true"===process.env.STRICT_SSL||"1"===process.env.STRICT_SSL||d||!h.has(f?.cause?.code||f?.code||""))throw f;let e="upstream";try{e=new URL(String(a)).host}catch{}return console.warn(`[ProxyFetch] self-signed TLS certificate for ${e}; retrying once without certificate verification`),z(a,b,c,!0)}}async function B(a,b,d){let f=await Promise.resolve().then(c.t.bind(c,55591,23)),g=await Promise.resolve().then(c.t.bind(c,91645,23)),h=f.default??f,j=g.default??g;return new Promise((c,f)=>{let g=new j.Socket,k=d.signal,l=null,m=null,o=!1,p=()=>k?.removeEventListener?.("abort",r),q=a=>{o||(o=!0,p(),f(a))},r=()=>{!function({upstreamResponse:a,request:b,socket:c,rejectOnce:d}){let e=n();d?.(e),a?.destroy?.(),b?.destroy?.(),c?.destroy?.()}({upstreamResponse:m,request:l,socket:g,rejectOnce:q})};k?.aborted?r():(k?.addEventListener?.("abort",r,{once:!0}),g.connect(443,b,()=>{if(o||k?.aborted)return;let b={socket:g,servername:a.hostname,path:a.pathname+a.search,method:d.method||"POST",headers:{...i(d.headers),Host:a.hostname}};(l=h.request(b,a=>{m=a,o=!0,a.once("close",p);let b={ok:a.statusCode>=200&&a.statusCode<300,status:a.statusCode,statusText:a.statusMessage,headers:new Map(Object.entries(a.headers)),body:e.Readable.toWeb(a),text:async()=>{let b=[];for await(let c of a)b.push(c);return Buffer.concat(b).toString()},json:async()=>JSON.parse(await b.text())};c(b)})).on("error",a=>q(a)),d.body&&l.write("string"==typeof d.body?d.body:JSON.stringify(d.body)),l.end()}),g.on("error",a=>q(a)))})}async function C(a,b={},c=null){let d="string"==typeof a?a:a.toString(),e=o(c?.vercelRelayUrl);if(e){let a=new URL(d),c={...i(b.headers),"x-relay-target":`${a.protocol}//${a.host}`,"x-relay-path":`${a.pathname}${a.search}`};return g(e,{...b,headers:c})}let f=u(d,c),h=f?null:t(s(d)),j=f||h;if(!j&&v(c))throw Error("[ProxyFetch] Proxy required but none resolved (strictProxy=true)");if(function(a){try{let b=new URL(a).hostname;return l.some(a=>b.includes(a))}catch{return!1}}(d)){if(j)try{return await A(a,b,j)}catch(a){if(b.signal?.aborted||a?.name==="AbortError")throw a;if(c?.strictProxy===!0)throw Error("[ProxyFetch] Required proxy request failed");throw Error("[ProxyFetch] Proxy request failed for protected upstream")}let e=new URL(d),f=await q(e.hostname,b.signal);return f?B(e,f,b):g(a,b)}if(j)try{return await A(a,b,j)}catch(d){if(b.signal?.aborted||d?.name==="AbortError")throw d;if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${d.message}`);if(c?.singleTransportAttempt===!0)throw Error("[ProxyFetch] Proxy request failed for single-attempt upstream");return console.warn(`[ProxyFetch] Proxy failed, falling back to direct: ${d.message}`),g(a,b)}return A(a,b,null)}async function D(a,b={}){return C(a,b,null)}globalThis.fetch!==D&&(globalThis.fetch=D)},47335:(a,b,c)=>{"use strict";let d=c(83204),{InvalidArgumentError:e,ResponseError:f}=c(61448);class g extends d{#U;#bx;#by;#e;#bz;#bA;#bB;#am;constructor({maxSize:a},{handler:b}){super(b),this.#am=a}#bC(a){return 0===(this.#bx??"").indexOf(a)}onRequestStart(a,b){return this.#U=0,this.#bx=null,this.#by=null,this.#e=null,this.#bz="",this.#bA=0,this.#bB=!1,super.onRequestStart(a,b)}onResponseStart(a,b,c,d){if(this.#U=b,this.#e=c,this.#bx=c["content-type"],this.#U<400)return super.onResponseStart(a,b,c,d);(this.#bC("application/json")||this.#bC("text/plain"))&&(this.#by=new TextDecoder("utf-8"))}#bD(){let a;if(this.#bz+=this.#by?.decode(void 0,{stream:!1})??"",this.#by=null,!this.#bB&&this.#bC("application/json"))try{this.#bz=JSON.parse(this.#bz)}catch{}let b=Error.stackTraceLimit;Error.stackTraceLimit=0;try{a=new f("Response Error",this.#U,{body:this.#bz,bodyTruncated:this.#bB,headers:this.#e})}finally{Error.stackTraceLimit=b}return a}onResponseData(a,b){if(this.#U<400)return super.onResponseData(a,b);if(null==this.#by)return;if(0===this.#am){this.#bz+=this.#by.decode(b,{stream:!0});return}let c=this.#am-this.#bA;if(b.length<=c){this.#bA+=b.length,this.#bz+=this.#by.decode(b,{stream:!0});return}c>0&&(this.#bz+=this.#by.decode(b.subarray(0,c),{stream:!0}),this.#bA=this.#am),this.#bB=!0,this.#bz+=this.#by.decode(void 0,{stream:!1}),this.#by=null}onResponseEnd(a,b){this.#U>=400?super.onResponseError(a,this.#bD()):super.onResponseEnd(a,b)}onResponseError(a,b){super.onResponseError(a,b)}}a.exports=(a={})=>{let{maxSize:b=1048576}=a;if(!Number.isSafeInteger(b)||b<0)throw new e("maxSize must be a non-negative integer");return a=>function(c,d){return a(c,new g({maxSize:b},{handler:d}))}}},47703:(a,b,c)=>{"use strict";let{pipeline:d}=c(57075),{fetching:e}=c(76403),{webidl:f}=c(32984),{EventSourceStream:g}=c(97356),{parseMIMEType:h}=c(16537),{createFastMessageEvent:i}=c(51753),{isNetworkError:j}=c(78196),{cloneRequest:k}=c(12600),{isValidHeaderValue:l,kEnumerableProperty:m}=c(84285),{environmentSettingsObject:n}=c(42425),{createPotentialCORSRequest:o}=c(26376),{getGlobalDispatcher:p}=c(59970),{isomorphicDecode:q}=c(70745),r=new TextEncoder,s=!1;class t extends EventTarget{#bE={open:null,error:null,message:null};#aT;#bF=!1;#bG=0;#bH=null;#H=null;#d;#a;constructor(a,b={}){let c;super(),f.util.markAsUncloneable(this);let d="EventSource constructor";f.argumentLengthCheck(arguments,1,d),s||(s=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),a=f.converters.USVString(a),b=f.converters.EventSourceInitDict(b,d,"eventSourceInitDict"),this.#d=b.node.dispatcher||b.dispatcher,this.#a={lastEventId:"",reconnectionTime:b.node.reconnectionTime};try{c=new URL(a,n.settingsObject.baseUrl),this.#a.origin=c.origin}catch(a){throw new DOMException(a,"SyntaxError")}this.#aT=c.href;let e="anonymous";!0===b.withCredentials&&(e="use-credentials",this.#bF=!0);let g=o(c,"",e);g.client=n.settingsObject,g.headersList.set("Accept","text/event-stream"),g.cache="no-store",g.initiator="other",this.#bH=g,this.#bI()}get readyState(){return f.brandCheck(this,f.is.EventSource),this.#bG}get url(){return f.brandCheck(this,f.is.EventSource),this.#aT}get withCredentials(){return f.brandCheck(this,f.is.EventSource),this.#bF}#bI(){if(2===this.#bG)return;this.#bG=0;let a=k(this.#bH);a.urlList=[...this.#bH.urlList];let b={request:a,dispatcher:this.#d};b.processResponseEndOfBody=a=>{if(!j(a))return this.#bJ()},b.processResponse=a=>{if(j(a))if(!a.aborted)return void this.#bJ();else{this.close(),this.dispatchEvent(new Event("error"));return}let b=a.headersList.get("content-type",!0),c=null!==b?h(b):"failure",e="failure"!==c&&"text/event-stream"===c.essence;if(200!==a.status||!1===e){this.close(),this.dispatchEvent(new Event("error"));return}this.#bG=1,this.dispatchEvent(new Event("open")),this.#a.origin=a.urlList[a.urlList.length-1].origin;let f=new g({eventSourceSettings:this.#a,maxEventSize:this.#d.eventSourceOptions?.maxEventSize,push:a=>{this.dispatchEvent(i(a.type,a.options))}});d(a.body.stream,f,a=>{a?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#H=e(b)}#bJ(){2!==this.#bG&&(this.#bG=0,this.dispatchEvent(new Event("error")),setTimeout(()=>{if(0===this.#bG){if(this.#bH.headersList.delete("last-event-id",!0),this.#a.lastEventId.length){let a=q(r.encode(this.#a.lastEventId));l(a)&&this.#bH.headersList.set("last-event-id",a,!0)}this.#bI()}},Math.min(this.#a.reconnectionTime,0x7fffffff))?.unref())}close(){f.brandCheck(this,f.is.EventSource),2!==this.#bG&&(this.#bG=2,this.#H.abort(),this.#bH=null)}get onopen(){return f.brandCheck(this,f.is.EventSource),this.#bE.open}set onopen(a){f.brandCheck(this,f.is.EventSource),this.#bE.open&&this.removeEventListener("open",this.#bE.open);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("open",b),this.#bE.open=a):this.#bE.open=null}get onmessage(){return f.brandCheck(this,f.is.EventSource),this.#bE.message}set onmessage(a){f.brandCheck(this,f.is.EventSource),this.#bE.message&&this.removeEventListener("message",this.#bE.message);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("message",b),this.#bE.message=a):this.#bE.message=null}get onerror(){return f.brandCheck(this,f.is.EventSource),this.#bE.error}set onerror(a){f.brandCheck(this,f.is.EventSource),this.#bE.error&&this.removeEventListener("error",this.#bE.error);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("error",b),this.#bE.error=a):this.#bE.error=null}static{f.is.EventSource=a=>null!=a&&"object"==typeof a&&#bE in a}}let u={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:0,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:1,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:2,writable:!1}};Object.defineProperties(t,u),Object.defineProperties(t.prototype,u),Object.defineProperties(t.prototype,{close:m,onerror:m,onmessage:m,onopen:m,readyState:m,url:m,withCredentials:m}),f.converters.EventSourceInitDict=f.dictionaryConverter([{key:"withCredentials",converter:f.converters.boolean,defaultValue:()=>!1},{key:"dispatcher",converter:f.converters.any,defaultValue:()=>p()},{key:"node",converter:f.dictionaryConverter([{key:"reconnectionTime",converter:f.converters["unsigned long"],defaultValue:()=>3e3},{key:"dispatcher",converter:f.converters.any}]),defaultValue:()=>({})}]),a.exports={EventSource:t,defaultReconnectionTime:3e3}},47800:(a,b,c)=>{"use strict";let{InvalidArgumentError:d}=c(61448),{setHeader:e}=c(84285),{runtimeFeatures:f}=c(56758),g=f.has("crypto")?c(77598):null,h=g?.hash?a=>g.hash("sha256",a,"base64url"):a=>Buffer.from(a).toString("base64url");function i(a){return Array.isArray(a)&&(1&a.length)==0}let j=["record","playback","update"];a.exports={createHeaderFilters:function(a={}){let{ignoreHeaders:b=[],excludeHeaders:c=[],matchHeaders:d=[],caseSensitive:e=!1}=a;return{ignore:new Set(b.map(a=>e?a:a.toLowerCase())),exclude:new Set(c.map(a=>e?a:a.toLowerCase())),match:new Set(d.map(a=>e?a:a.toLowerCase()))}},hashId:h,isUndiciHeaders:i,normalizeHeaders:function(a){let b={};if(!a)return b;if(i(a)){for(let c=0;c<a.length;c+=2){let d=a[c],f=a[c+1];if(d&&void 0!==f){let a=Buffer.isBuffer(d)?d.toString():d,c=Buffer.isBuffer(f)?f.toString():f;e(b,a.toLowerCase(),c)}}return b}if(a&&"object"==typeof a)for(let[c,d]of Object.entries(a))c&&"string"==typeof c&&e(b,c.toLowerCase(),Array.isArray(d)?d.join(", "):String(d));return b},isUrlExcludedFactory:function(a=[]){return 0===a.length?()=>!1:function(b){let c;for(let d of a)if("string"==typeof d){if(c||(c=b.toLowerCase()),c.includes(d.toLowerCase()))return!0}else if(d instanceof RegExp&&d.test(b))return!0;return!1}},validateSnapshotMode:function(a){if(!j.includes(a))throw new d(`Invalid snapshot mode: ${a}. Must be one of: ${j.join(", ")}`)}}},48047:(a,b,c)=>{"use strict";c.d(b,{f:()=>e,u:()=>d});let d="1.0.70",e=`grok-pager/${d} grok-shell/${d} (linux; x86_64)`},48841:(a,b,c)=>{"use strict";let{kProxy:d,kClose:e,kDestroy:f,kDispatch:g}=c(49176),h=c(37417),i=c(35689),j=c(5318),{InvalidArgumentError:k,RequestAbortedError:l,SecureProxyConnectionError:m,ProxyConnectionError:n}=c(61448),o=c(55285),p=c(40106),{channels:q}=c(62571),r=c(64156),{hasSafeIterator:s}=c(84285),t=Symbol("proxy agent"),u=Symbol("proxy client"),v=Symbol("proxy headers"),w=Symbol("request tls settings"),x=Symbol("proxy tls settings"),y=Symbol("connect endpoint function"),z=Symbol("connect endpoint function (http/1.1 only)"),A=Symbol("tunnel proxy"),B="proxy-authorization";function C(a,b){return new i(a,b)}let D=()=>{};function E(a,b){return 1===b.connections?new p(a,b):new i(a,b)}class F extends j{#bK;#bL;constructor(a,{headers:b={},connect:c,factory:d,proxyServername:e}){if(!a)throw new k("Proxy URL is mandatory");super(),this[v]=b,this.#bL=e,d?this.#bK=d(a,{connect:c}):this.#bK=new p(a,{connect:c})}[g](a,b){let c=b.onResponseStart;b.onResponseStart=function(a,d,e,f){if(407===d){"function"==typeof b.onResponseError&&b.onResponseError(a,new k("Proxy Authentication Required (407)"));return}c&&c.call(this,a,d,e,f)};let{origin:d,path:e="/",headers:f={}}=a;return a.path=d+e,a.headers={...this[v],...f},I(f)||(a.headers.host=new URL(d).host),null!=this.#bL&&(a.servername=this.#bL),this.#bK[g](a,b)}[e](){return this.#bK.close()}[f](a){return this.#bK.destroy(a)}}class G extends j{constructor(a){if(!a||"object"==typeof a&&!(a instanceof URL)&&!a.uri)throw new k("Proxy uri is mandatory");let{clientFactory:b=C}=a;if("function"!=typeof b)throw new k("Proxy opts.clientFactory must be a function.");let{proxyTunnel:c,connectTimeout:e}=a;super(a);let f=this.#bM(a),{href:g,origin:i,port:j,protocol:p,username:s,password:B,hostname:G}=f;if(this[d]={uri:g,protocol:p},this[w]=a.requestTls,this[x]=a.proxyTls,this[v]=a.headers||{},this[A]=c,a.auth&&a.token)throw new k("opts.auth cannot be used in combination with opts.token");a.auth?this[v]["proxy-authorization"]=`Basic ${a.auth}`:a.token?this[v]["proxy-authorization"]=a.token:s&&B?this[v]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(s)}:${decodeURIComponent(B)}`).toString("base64")}`:s&&(this[v]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(s)}:`).toString("base64")}`);let H=o({timeout:e,...a.proxyTls}),I=o({timeout:e,...a.proxyTls,allowH2:!1});this[y]=o({timeout:e,...a.requestTls}),this[z]=o({timeout:e,...a.requestTls,allowH2:!1});let J=a.factory||E,K=(b,c)=>{let{protocol:f}=new URL(b);if("socks5:"===this[d].protocol||"socks:"===this[d].protocol)return new r(this[d].uri,{headers:this[v],connect:H,factory:J,username:a.username||s,password:a.password||B,connectTimeout:e,proxyTls:a.proxyTls,requestTls:a.requestTls});if(!0!==this[A]&&"http:"===f){let a="https:"===this[d].protocol?(a,b)=>I(a,(a,c)=>{a&&"ERR_TLS_CERT_ALTNAME_INVALID"===a.code?b(new m(a)):b(a,c)}):I;return new F(this[d].uri,{headers:this[v],connect:a,factory:J,proxyServername:"https:"===this[d].protocol?this[x]?.servername||G:void 0})}return J(b,c)};"socks5:"===p||"socks:"===p?this[u]=null:this[u]=b(f,{connect:H}),this[t]=new h({...a,factory:K,connect:async(a,b)=>{if(!this[u])return void b(new k("Cannot establish tunnel connection without a proxy client"));let c=a.host;a.port||(c+=`:${"https:"===a.protocol?443:80}`);try{let d,e={origin:i,port:j,path:c,signal:a.signal,headers:{...this[v],host:a.host,...null==a.connections||a.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[x]?.servername||G},{socket:f,statusCode:g}=await this[u].connect(e);if(200!==g){f.on("error",D).destroy(),b(new l(`Proxy response (${g}) !== 200 when HTTP Tunneling`));return}if(q.proxyConnected.hasSubscribers&&q.proxyConnected.publish({socket:f,connectParams:e}),"https:"!==a.protocol)return void b(null,f);d=this[w]?this[w].servername:a.servername,(!1===a.allowH2?this[z]:this[y])({...a,servername:d,httpSocket:f},b)}catch(a){b("ERR_TLS_CERT_ALTNAME_INVALID"===a.code?new m(a):"UND_ERR_SOCKET"===a.code?new n(a):a)}}})}dispatch(a,b){let c=function(a){if(Array.isArray(a)){let b={};for(let c=0;c<a.length;c+=2)H(a[c])&&J(),b[a[c]]=a[c+1];return b}if(a&&"object"==typeof a&&s(a)){let b={};for(let[c,d]of a){if(!Object.hasOwn(b,c)){b[c]=d;continue}let a=b[c],e=[];void 0!==a&&e.push(...Array.isArray(a)?a:[a]),void 0!==d&&e.push(...Array.isArray(d)?d:[d]),b[c]=e.length>1?e:e[0]}return b}return a}(a.headers);return function(a){for(let b in a)H(b)&&J()}(c),c&&!I(c)&&(c===a.headers&&(c={...c}),c.host=new URL(a.origin).host),this[t].dispatch({...a,headers:c},b)}#bM(a){return"string"==typeof a?new URL(a):a instanceof URL?a:new URL(a.uri)}[e](){let a=[this[t].close()];return this[u]&&a.push(this[u].close()),Promise.all(a)}[f](){let a=[this[t].destroy()];return this[u]&&a.push(this[u].destroy()),Promise.all(a)}}function H(a){return a.length===B.length&&a.toLowerCase()===B}function I(a){for(let b in a)if(4===b.length&&"host"===b.toLowerCase())return!0;return!1}function J(){throw new k("Proxy-Authorization should be sent in ProxyAgent constructor")}a.exports=G},48991:(a,b,c)=>{"use strict";c.d(b,{A9:()=>l,Ch:()=>g,Cn:()=>m,Co:()=>v,Hi:()=>h,Ic:()=>t,NA:()=>x,P0:()=>p,Wu:()=>w,buildKimiHeaders:()=>y,cw:()=>i,dw:()=>o,go:()=>e,nZ:()=>s,p8:()=>q,rJ:()=>r,sX:()=>f,uR:()=>n,x0:()=>j,zv:()=>u});var d=c(21820);let e="google-genai-sdk/1.41.0 gl-node/v22.19.0";function f(a="unknown"){let b;return`GeminiCLI/0.34.0/${a||"unknown"} (${(0,d.platform)()}; ${"ia32"===(b=(0,d.arch)())?"x86":b}; terminal)`}let g="0.159.0",h="codex_cli_rs";function i(){return`${h}/${g}`}let j={VSCODE_VERSION:"1.110.0",COPILOT_CHAT_VERSION:"0.38.0",USER_AGENT:"GitHubCopilotChat/0.38.0",API_VERSION:"2025-04-01"};function k(){let a=(0,d.platform)(),b=(0,d.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}function l(){return`Antigravity/1.125.0 (${function(){switch((0,d.platform)()){case"darwin":return"Macintosh; Intel Mac OS X 10_15_7";case"win32":return"Windows NT 10.0; Win64; x64";default:return"X11; Linux x86_64"}}()}) Chrome/142.0.7444.175 Electron/39.2.7`}let m={ideType:9,platform:k(),pluginType:2},n="_ide",o=new Set(["Task","TaskOutput","TaskStop","TaskCreate","TaskGet","TaskUpdate","TaskList","Bash","Glob","Grep","Read","Edit","Write","NotebookEdit","WebFetch","WebSearch","AskUserQuestion","Skill","EnterPlanMode","ExitPlanMode"]);function p(){return`antigravity/cli/1.1.13 (aidev_client; os_type=${"win32"===(0,d.platform)()?"windows":(0,d.platform)()}; arch=${"x64"===(0,d.arch)()?"amd64":"ia32"===(0,d.arch)()?"x86":(0,d.arch)()}; cl=964361259; auth_method=consumer)`}function q(){return"antigravity/ide/2.1.1 darwin/arm64"}function r(a){return"string"==typeof a&&/(?:^|\/)gemini-3\.(?:7|8)(?:-|$)/i.test(a)?p():q()}q();let s={loadCodeAssist:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUser:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser"},t={"Content-Type":"application/json","User-Agent":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"google-cloud-sdk vscode_cloudshelleditor/0.1","Client-Metadata":JSON.stringify({ideType:9,platform:k(),pluginType:2})},u={ideType:9,platform:k(),pluginType:2},v="You are Claude Code, Anthropic's official CLI for Claude.",w={codex:6e5,claude:144e5,iflow:864e5,qwen:12e5,codebuddy:12e5,kimi:3e5,"kimi-coding":3e5,antigravity:3e5,"grok-cli":3e5,xai:3e5},x={google:{token:"https://oauth2.googleapis.com/token",auth:"https://accounts.google.com/o/oauth2/auth"},openai:{token:"https://auth.openai.com/oauth/token",auth:"https://auth.openai.com/oauth/authorize"},anthropic:{token:"https://api.anthropic.com/v1/oauth/token",auth:"https://api.anthropic.com/v1/oauth/authorize"},qwen:{token:"https://qwen.ai/api/v1/oauth2/token",auth:"https://qwen.ai/api/v1/oauth2/device/code"},iflow:{token:"https://iflow.cn/oauth/token",auth:"https://iflow.cn/oauth"},github:{token:"https://github.com/login/oauth/access_token",auth:"https://github.com/login/oauth/authorize",deviceCode:"https://github.com/login/device/code"}};function y(a){let b="string"==typeof a&&a.trim()?a.trim():`kimi-${Date.now()}`;return{"X-Msh-Platform":"zevairouter","X-Msh-Version":"2.1.2","X-Msh-Device-Model":"u">typeof process?`${process.platform} ${process.arch}`:"unknown","X-Msh-Device-Id":b}}},49166:(a,b,c)=>{"use strict";let{Cache:d}=c(50027),{webidl:e}=c(32984),{kEnumerableProperty:f}=c(84285),{kConstruct:g}=c(49176);class h{#bN=new Map;constructor(){arguments[0]!==g&&e.illegalConstructor(),e.util.markAsUncloneable(this)}async match(a,b={}){if(e.brandCheck(this,e.is.CacheStorage),e.argumentLengthCheck(arguments,1,"CacheStorage.match"),a=e.converters.RequestInfo(a),null!=(b=e.converters.MultiCacheQueryOptions(b)).cacheName){if(this.#bN.has(b.cacheName)){let c=new d(g,this.#bN.get(b.cacheName));return await c.match(a,b)}}else for(let c of this.#bN.values()){let e=new d(g,c),f=await e.match(a,b);if(void 0!==f)return f}}async has(a){e.brandCheck(this,e.is.CacheStorage);let b="CacheStorage.has";return e.argumentLengthCheck(arguments,1,b),a=e.converters.DOMString(a,b,"cacheName"),this.#bN.has(a)}async open(a){e.brandCheck(this,e.is.CacheStorage);let b="CacheStorage.open";if(e.argumentLengthCheck(arguments,1,b),a=e.converters.DOMString(a,b,"cacheName"),this.#bN.has(a))return new d(g,this.#bN.get(a));let c=[];return this.#bN.set(a,c),new d(g,c)}async delete(a){e.brandCheck(this,e.is.CacheStorage);let b="CacheStorage.delete";return e.argumentLengthCheck(arguments,1,b),a=e.converters.DOMString(a,b,"cacheName"),this.#bN.delete(a)}async keys(){return e.brandCheck(this,e.is.CacheStorage),[...this.#bN.keys()]}static{e.is.CacheStorage=a=>null!=a&&"object"==typeof a&&#bN in a}}Object.defineProperties(h.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:f,has:f,open:f,delete:f,keys:f}),a.exports={CacheStorage:h}},49176:a=>{"use strict";a.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kRequestOrigin:Symbol("request origin"),kRedirectCacheControl:Symbol("redirect cache control"),kOriginless:Symbol("originless"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2Options:Symbol("http2 options"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kHostAuthority:Symbol("host authority"),kHTTP2InitialWindowSize:Symbol("http2 initial window size"),kHTTP2ConnectionWindowSize:Symbol("http2 connection window size"),kEnableConnectProtocol:Symbol("http2session connect protocol"),kRemoteSettings:Symbol("http2session remote settings"),kHTTP2Stream:Symbol("http2session client stream"),kPingInterval:Symbol("ping interval"),kUseMilo:Symbol("use milo"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent"),kSocks5ProxyAgent:Symbol("socks5 proxy agent")}},49971:(a,b,c)=>{"use strict";c.d(b,{N:()=>g});var d=c(59602);let e={"Content-Type":"text/event-stream","Cache-Control":"no-cache","X-Accel-Buffering":"no"};async function f(a,b,c){let e=await a.text();try{let f=JSON.parse(e),g=f?.choices?.[0]?.message?.content||"",{content:h,toolCalls:i,finishReason:j}=(0,d.mU)(g,b,c);return i?(f.choices[0].message={role:"assistant",content:null,tool_calls:i},f.choices[0].finish_reason=j):f.choices[0].message.content=h,new Response(JSON.stringify(f),{status:a.status,headers:{"Content-Type":"application/json"}})}catch{return new Response(e,{status:a.status,headers:{"Content-Type":"application/json"}})}}async function g(a,b,c,d){var g,h,i,j;let k,l,m,n,o;if(!a.ok)return a;let p=await f(a,b,d.idSeed??"cgpt");return c?new Response((g=await p.json(),h=d.cid,i=d.created,j=d.model,k=new TextEncoder,m=(l=g?.choices?.[0]??{}).message??{},n=l.finish_reason??"stop",o=(a,b)=>{var c;return k.encode((c={id:h,object:"chat.completion.chunk",created:i,model:j,system_fingerprint:null,choices:[{index:0,delta:a,finish_reason:b,logprobs:null}]},`data: ${JSON.stringify(c)}
250
+ ${c.join("\n")}`,p="user"===a.role?[{role:"user",parts:a.parts}]:[{role:"user",parts:[{text:"Continue the conversation from the last turn of the conversation history at the end of your instructions."}]}]}else 1===p.length&&"user"!==p[0].role&&(p=[{role:"user",parts:p[0].parts}]);let q=E(p),r=String(a?.id||a||"gemini-3.8-flash").replace(/^models\//,""),s=H(a,f.reasoningEffort)||3,t=Array(29).fill(null);return t[0]=q.contents,t[5]=1,t[7]=`models/${r}`,o&&(t[8]=o),t[11]=g,t[13]=[2,null,2],t[15]=1,t[18]=[1,null,null,s],t[28]=e().randomUUID().toUpperCase(),{wire:t,binding:q.binding,page:q.page,functionNames:k}}({model:c,geminiReq:f,rawTools:g.tools,toolChoice:g.tool_choice,options:h,appletId:q}),s=await this.sessions.generate(a,{body:r.wire,binding:r.binding,page:r.page,model:d,signal:l,method:"CodeAssistantOffline",proofField:2}),t=Number(s.headers?.["x-zevai-upstream-status"]||s.status),u=await aq(s.body).catch(()=>"");if(200!==t){let a=Z(t,u,s.headers?.["retry-after"]||null);return m?.warn?.("AISTUDIO",`${d} CodeAssistantOffline HTTP ${t}: ${String(a.message).slice(0,200)}`),{error:a}}let v="";try{let a=JSON.parse(u.replace(/^\)\]\}'\s*/,"").trim());v=Array.isArray(a)&&"string"==typeof a[0]?a[0]:""}catch{}if(!v)return{error:{status:502,message:"CodeAssistantOffline returned no generation ID"}};let w=aV.replace(/\/GenerateContent$/,"/StreamCodeAssistantOfflineGeneration"),x=async()=>{let a=await this.fetchFn(w,{method:"POST",headers:p,body:JSON.stringify([v,null,null,q]),signal:l||void 0});if(!a.ok||!a.body){let b=await a.text().catch(()=>"");throw Object.assign(Error(`StreamCodeAssistantOfflineGeneration HTTP ${a.status}: ${b.slice(0,160)}`),{status:a.status})}return new a1(a.body)},y=await x(),z=await y.next();if(!z){let a=S(y.trailer());return a&&0!==a.code?{error:Y({httpStatus:200,rpc:a})}:{error:{status:502,message:"AI Studio Assistant stream returned no frames"}}}return{reader:y,frame:z,reopenStream:x,functionNames:r.functionNames,appletId:q,generationId:v,startedAt:n}}#bq({assistantFirst:a,account:b,modelId:c,credentials:d,url:e,body:f,signal:g,log:i}){let j={toolCalls:new Map,toolNameMap:new Map,model:c,sessionId:d?._clientSessionId||null,provider:"aistudio"},k=new TextEncoder,l=this,m=a.reader,n=new aU(a.functionNames);return{response:new Response(new ReadableStream({async start(d){let e=a=>{for(let b of(0,h.o)(a,j)||[])d.enqueue(k.encode(a_(b)))};try{let b=async(a,b=null)=>{for(let c=b||await a.next();c;c=await a.next()){let{parts:b,error:f}=n.decodeFrame(c);if(f)return d.enqueue(k.encode(a_(U(f)))),!1;if(b.length>0&&e({candidates:[{index:0,content:{role:"model",parts:b}}]}),n.answered||n.overran){a.cancel("assistant turn complete");break}}return!0},f=await b(m,a.frame),h=0;for(;f&&!n.finished&&!n.overran&&"function"==typeof a.reopenStream&&h<32&&!g?.aborted;){h+=1;try{m=await a.reopenStream()}catch(a){i?.warn?.("AISTUDIO",`${c} assistant continuation reopen failed (attempt ${h}): ${String(a?.message||a).slice(0,160)}`),d.enqueue(k.encode(a_(U(l.#bn(a))))),f=!1;break}f=await b(m,null)}if(f){let a=n.flush();a.parts.length>0&&e({candidates:[{index:0,content:{role:"model",parts:a.parts}}]}),e({candidates:[{index:0,content:{role:"model",parts:[]},finishReason:a.finishReason||"STOP"}],...a.usage?{usageMetadata:a.usage}:{}})}}catch(a){g?.aborted||d.enqueue(k.encode(a_(U(l.#bn(a)))))}finally{d.enqueue(k.encode("data: [DONE]\n\n")),d.close(),l.sessions.scheduleCookieSync(b)}},cancel(a){m?.cancel(a)}}),{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache"}}),url:e,headers:{},transformedBody:f}}#bn(a){if(a instanceof ao)return a.details;if(a instanceof ak)return{status:503,message:a.message,failureClass:"upstream_transient"};if(a?.name==="AbortError"||a?.name==="TimeoutError")throw a;return{status:502,message:`AI Studio request failed: ${a?.message||a}`,failureClass:"upstream_transient"}}}},46956:(a,b,c)=>{"use strict";c.d(b,{Fm:()=>C,QH:()=>w,Vp:()=>v,ip:()=>x});var d=c(3433),e=c(27910),f=c(8735);let g=globalThis.fetch,h=new Set(["SELF_SIGNED_CERT_IN_CHAIN","DEPTH_ZERO_SELF_SIGNED_CERT","UNABLE_TO_VERIFY_LEAF_SIGNATURE","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_ISSUER_CERT_LOCALLY"]);function i(a){return a?"u">typeof Headers&&a instanceof Headers?Object.fromEntries(a.entries()):{...a}:{}}let j=new Map,k=new Map,l=["cloudcode-pa.googleapis.com","daily-cloudcode-pa.googleapis.com","api.individual.githubcopilot.com","q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com","api2.cursor.sh"],m=["8.8.8.8","8.8.4.4"];function n(){let a=Error("Request aborted");return a.name="AbortError",a}function o(a){return null==a?"":String(a).trim()}let p=new Map;async function q(a,b=null){let d,e=k.get(a);if(e&&Date.now()<e.expiry)return e.ip;if(b?.aborted)throw n();let g=p.get(a);if(g&&Date.now()<g)return null;let h=await Promise.resolve().then(c.t.bind(c,14985,23)),{promisify:i}=await Promise.resolve().then(c.t.bind(c,28354,23));if(b?.aborted)throw n();let j=new h.Resolver;j.setServers(m);let l=i(j.resolve4.bind(j)),o=b?new Promise((a,c)=>{d=()=>{j.cancel?.(),c(n())},b.addEventListener("abort",d,{once:!0})}):null,r=a=>o?Promise.race([a,o]):a,s=a=>{if(b?.aborted||a?.name==="AbortError")throw n()};try{let b=null,c=null;try{let c=await r(l(a));b=c?.[0]||null}catch(a){s(a),c=a}if(!b)try{let c="function"==typeof h.promises?.lookup?a=>h.promises.lookup(a,{family:4}):"function"==typeof h.lookup?i(h.lookup):null,d=c?await r(c(a,{family:4})):null,e="string"==typeof d?d:d?.address;e&&!function(a){let b=String(a||"").split(".");if(4!==b.length)return!0;let c=b.map(a=>/^\d{1,3}$/.test(a)?Number(a):0/0);if(c.some(a=>!Number.isInteger(a)||a<0||a>255))return!0;let[d,e]=c;return 0===d||10===d||127===d||169===d&&254===e||172===d&&e>=16&&e<=31||192===d&&168===e}(e)&&(b=e)}catch(a){s(a)}if(!b)return p.set(a,Date.now()+3e4),console.warn(`[ProxyFetch] DNS resolve failed for ${a}: ${c?.message||"no public address from system resolver"} (using default transport for 30s)`),null;return p.delete(a),k.set(a,{ip:b,expiry:Date.now()+f.v1.dnsCacheTtlMs}),b}finally{d&&b?.removeEventListener?.("abort",d)}}function r(a,b){let c,d=o(b);if(!d)return!1;try{c=new URL(a).hostname.toLowerCase()}catch{return!1}return d.split(",").map(a=>a.trim().toLowerCase()).filter(Boolean).some(a=>"*"===a||(a.startsWith(".")?c.endsWith(a)||c===a.slice(1):c===a||c.endsWith(`.${a}`)))}function s(a){let b;if(r(a,process.env.NO_PROXY||process.env.no_proxy))return null;try{b=new URL(a).protocol}catch{return null}return"https:"===b?process.env.HTTPS_PROXY||process.env.https_proxy||process.env.ALL_PROXY||process.env.all_proxy:process.env.HTTP_PROXY||process.env.http_proxy||process.env.ALL_PROXY||process.env.all_proxy}function t(a){let b=o(a);if(!b)return null;try{return new URL(b),b}catch{return`http://${b}`}}function u(a,b){if(b?.enabled!==!0&&b?.connectionProxyEnabled!==!0)return null;let c=o(b?.url??b?.connectionProxyUrl);if(!c)return null;let d=o(b?.noProxy??b?.connectionNoProxy);return d&&r(a,d)?null:t(c)}function v(a){return a?.strictProxy===!0&&!!(a.proxyPoolId||!0===a.enabled||!0===a.connectionProxyEnabled||o(a.url??a.connectionProxyUrl))}function w(a){return!!v(a)&&!o(a?.vercelRelayUrl)}function x(a,b=null){return u(a,b)||t(s(a))}async function y(a,b=!1){let d=t(a);if(!d&&!b)return null;let e=`${d||"direct"}::${b?"insecure":"secure"}`;if(!j.has(e)){j.size>=f.v1.proxyDispatchersMaxSize&&j.delete(j.keys().next().value);let{Agent:a,ProxyAgent:g}=await Promise.resolve().then(c.t.bind(c,3433,19)),h=b?{rejectUnauthorized:!1}:void 0,i=d?new g({uri:d,...b?{requestTls:h}:{}}):new a({connect:h});j.set(e,i)}return j.get(e)}async function z(a,b,c,e=!1){if(!c&&!e&&"function"==typeof b.directFetch)return b.directFetch(a,b);let f=c||e?await y(c,e):void 0,h=f?{...b,dispatcher:f}:b;return c||e?(0,d.hd)(a,h):g(a,h)}async function A(a,b,c){try{return await z(a,b,c,!1)}catch(f){if(b.signal?.aborted||f?.name==="AbortError")throw f;let d=b.body&&"function"==typeof b.body.getReader&&b.body.locked;if(b?.strictTls===!0||"true"===process.env.STRICT_SSL||"1"===process.env.STRICT_SSL||d||!h.has(f?.cause?.code||f?.code||""))throw f;let e="upstream";try{e=new URL(String(a)).host}catch{}return console.warn(`[ProxyFetch] self-signed TLS certificate for ${e}; retrying once without certificate verification`),z(a,b,c,!0)}}async function B(a,b,d){let f=await Promise.resolve().then(c.t.bind(c,55591,23)),g=await Promise.resolve().then(c.t.bind(c,91645,23)),h=f.default??f,j=g.default??g;return new Promise((c,f)=>{let g=new j.Socket,k=d.signal,l=null,m=null,o=!1,p=()=>k?.removeEventListener?.("abort",r),q=a=>{o||(o=!0,p(),f(a))},r=()=>{!function({upstreamResponse:a,request:b,socket:c,rejectOnce:d}){let e=n();d?.(e),a?.destroy?.(),b?.destroy?.(),c?.destroy?.()}({upstreamResponse:m,request:l,socket:g,rejectOnce:q})};k?.aborted?r():(k?.addEventListener?.("abort",r,{once:!0}),g.connect(443,b,()=>{if(o||k?.aborted)return;let b={socket:g,servername:a.hostname,path:a.pathname+a.search,method:d.method||"POST",headers:{...i(d.headers),Host:a.hostname}};(l=h.request(b,a=>{m=a,o=!0,a.once("close",p);let b={ok:a.statusCode>=200&&a.statusCode<300,status:a.statusCode,statusText:a.statusMessage,headers:new Map(Object.entries(a.headers)),body:e.Readable.toWeb(a),text:async()=>{let b=[];for await(let c of a)b.push(c);return Buffer.concat(b).toString()},json:async()=>JSON.parse(await b.text())};c(b)})).on("error",a=>q(a)),d.body&&l.write("string"==typeof d.body?d.body:JSON.stringify(d.body)),l.end()}),g.on("error",a=>q(a)))})}async function C(a,b={},c=null){let d="string"==typeof a?a:a.toString(),e=o(c?.vercelRelayUrl);if(e){let a=new URL(d),c={...i(b.headers),"x-relay-target":`${a.protocol}//${a.host}`,"x-relay-path":`${a.pathname}${a.search}`};return g(e,{...b,headers:c})}let f=u(d,c),h=f?null:t(s(d)),j=f||h;if(!j&&v(c))throw Error("[ProxyFetch] Proxy required but none resolved (strictProxy=true)");if(function(a){try{let b=new URL(a).hostname;return l.some(a=>b.includes(a))}catch{return!1}}(d)){if(j)try{return await A(a,b,j)}catch(a){if(b.signal?.aborted||a?.name==="AbortError")throw a;if(c?.strictProxy===!0)throw Error("[ProxyFetch] Required proxy request failed");throw Error("[ProxyFetch] Proxy request failed for protected upstream")}let e=new URL(d),f=await q(e.hostname,b.signal);return f?B(e,f,b):g(a,b)}if(j)try{return await A(a,b,j)}catch(d){if(b.signal?.aborted||d?.name==="AbortError")throw d;if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${d.message}`);if(c?.singleTransportAttempt===!0)throw Error("[ProxyFetch] Proxy request failed for single-attempt upstream");return console.warn(`[ProxyFetch] Proxy failed, falling back to direct: ${d.message}`),g(a,b)}return A(a,b,null)}async function D(a,b={}){return C(a,b,null)}globalThis.fetch!==D&&(globalThis.fetch=D)},47335:(a,b,c)=>{"use strict";let d=c(83204),{InvalidArgumentError:e,ResponseError:f}=c(61448);class g extends d{#U;#bz;#bA;#e;#bB;#bC;#bD;#am;constructor({maxSize:a},{handler:b}){super(b),this.#am=a}#bE(a){return 0===(this.#bz??"").indexOf(a)}onRequestStart(a,b){return this.#U=0,this.#bz=null,this.#bA=null,this.#e=null,this.#bB="",this.#bC=0,this.#bD=!1,super.onRequestStart(a,b)}onResponseStart(a,b,c,d){if(this.#U=b,this.#e=c,this.#bz=c["content-type"],this.#U<400)return super.onResponseStart(a,b,c,d);(this.#bE("application/json")||this.#bE("text/plain"))&&(this.#bA=new TextDecoder("utf-8"))}#bF(){let a;if(this.#bB+=this.#bA?.decode(void 0,{stream:!1})??"",this.#bA=null,!this.#bD&&this.#bE("application/json"))try{this.#bB=JSON.parse(this.#bB)}catch{}let b=Error.stackTraceLimit;Error.stackTraceLimit=0;try{a=new f("Response Error",this.#U,{body:this.#bB,bodyTruncated:this.#bD,headers:this.#e})}finally{Error.stackTraceLimit=b}return a}onResponseData(a,b){if(this.#U<400)return super.onResponseData(a,b);if(null==this.#bA)return;if(0===this.#am){this.#bB+=this.#bA.decode(b,{stream:!0});return}let c=this.#am-this.#bC;if(b.length<=c){this.#bC+=b.length,this.#bB+=this.#bA.decode(b,{stream:!0});return}c>0&&(this.#bB+=this.#bA.decode(b.subarray(0,c),{stream:!0}),this.#bC=this.#am),this.#bD=!0,this.#bB+=this.#bA.decode(void 0,{stream:!1}),this.#bA=null}onResponseEnd(a,b){this.#U>=400?super.onResponseError(a,this.#bF()):super.onResponseEnd(a,b)}onResponseError(a,b){super.onResponseError(a,b)}}a.exports=(a={})=>{let{maxSize:b=1048576}=a;if(!Number.isSafeInteger(b)||b<0)throw new e("maxSize must be a non-negative integer");return a=>function(c,d){return a(c,new g({maxSize:b},{handler:d}))}}},47703:(a,b,c)=>{"use strict";let{pipeline:d}=c(57075),{fetching:e}=c(76403),{webidl:f}=c(32984),{EventSourceStream:g}=c(97356),{parseMIMEType:h}=c(16537),{createFastMessageEvent:i}=c(51753),{isNetworkError:j}=c(78196),{cloneRequest:k}=c(12600),{isValidHeaderValue:l,kEnumerableProperty:m}=c(84285),{environmentSettingsObject:n}=c(42425),{createPotentialCORSRequest:o}=c(26376),{getGlobalDispatcher:p}=c(59970),{isomorphicDecode:q}=c(70745),r=new TextEncoder,s=!1;class t extends EventTarget{#bG={open:null,error:null,message:null};#aT;#bH=!1;#bI=0;#bJ=null;#H=null;#d;#a;constructor(a,b={}){let c;super(),f.util.markAsUncloneable(this);let d="EventSource constructor";f.argumentLengthCheck(arguments,1,d),s||(s=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),a=f.converters.USVString(a),b=f.converters.EventSourceInitDict(b,d,"eventSourceInitDict"),this.#d=b.node.dispatcher||b.dispatcher,this.#a={lastEventId:"",reconnectionTime:b.node.reconnectionTime};try{c=new URL(a,n.settingsObject.baseUrl),this.#a.origin=c.origin}catch(a){throw new DOMException(a,"SyntaxError")}this.#aT=c.href;let e="anonymous";!0===b.withCredentials&&(e="use-credentials",this.#bH=!0);let g=o(c,"",e);g.client=n.settingsObject,g.headersList.set("Accept","text/event-stream"),g.cache="no-store",g.initiator="other",this.#bJ=g,this.#bK()}get readyState(){return f.brandCheck(this,f.is.EventSource),this.#bI}get url(){return f.brandCheck(this,f.is.EventSource),this.#aT}get withCredentials(){return f.brandCheck(this,f.is.EventSource),this.#bH}#bK(){if(2===this.#bI)return;this.#bI=0;let a=k(this.#bJ);a.urlList=[...this.#bJ.urlList];let b={request:a,dispatcher:this.#d};b.processResponseEndOfBody=a=>{if(!j(a))return this.#bL()},b.processResponse=a=>{if(j(a))if(!a.aborted)return void this.#bL();else{this.close(),this.dispatchEvent(new Event("error"));return}let b=a.headersList.get("content-type",!0),c=null!==b?h(b):"failure",e="failure"!==c&&"text/event-stream"===c.essence;if(200!==a.status||!1===e){this.close(),this.dispatchEvent(new Event("error"));return}this.#bI=1,this.dispatchEvent(new Event("open")),this.#a.origin=a.urlList[a.urlList.length-1].origin;let f=new g({eventSourceSettings:this.#a,maxEventSize:this.#d.eventSourceOptions?.maxEventSize,push:a=>{this.dispatchEvent(i(a.type,a.options))}});d(a.body.stream,f,a=>{a?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#H=e(b)}#bL(){2!==this.#bI&&(this.#bI=0,this.dispatchEvent(new Event("error")),setTimeout(()=>{if(0===this.#bI){if(this.#bJ.headersList.delete("last-event-id",!0),this.#a.lastEventId.length){let a=q(r.encode(this.#a.lastEventId));l(a)&&this.#bJ.headersList.set("last-event-id",a,!0)}this.#bK()}},Math.min(this.#a.reconnectionTime,0x7fffffff))?.unref())}close(){f.brandCheck(this,f.is.EventSource),2!==this.#bI&&(this.#bI=2,this.#H.abort(),this.#bJ=null)}get onopen(){return f.brandCheck(this,f.is.EventSource),this.#bG.open}set onopen(a){f.brandCheck(this,f.is.EventSource),this.#bG.open&&this.removeEventListener("open",this.#bG.open);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("open",b),this.#bG.open=a):this.#bG.open=null}get onmessage(){return f.brandCheck(this,f.is.EventSource),this.#bG.message}set onmessage(a){f.brandCheck(this,f.is.EventSource),this.#bG.message&&this.removeEventListener("message",this.#bG.message);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("message",b),this.#bG.message=a):this.#bG.message=null}get onerror(){return f.brandCheck(this,f.is.EventSource),this.#bG.error}set onerror(a){f.brandCheck(this,f.is.EventSource),this.#bG.error&&this.removeEventListener("error",this.#bG.error);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("error",b),this.#bG.error=a):this.#bG.error=null}static{f.is.EventSource=a=>null!=a&&"object"==typeof a&&#bG in a}}let u={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:0,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:1,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:2,writable:!1}};Object.defineProperties(t,u),Object.defineProperties(t.prototype,u),Object.defineProperties(t.prototype,{close:m,onerror:m,onmessage:m,onopen:m,readyState:m,url:m,withCredentials:m}),f.converters.EventSourceInitDict=f.dictionaryConverter([{key:"withCredentials",converter:f.converters.boolean,defaultValue:()=>!1},{key:"dispatcher",converter:f.converters.any,defaultValue:()=>p()},{key:"node",converter:f.dictionaryConverter([{key:"reconnectionTime",converter:f.converters["unsigned long"],defaultValue:()=>3e3},{key:"dispatcher",converter:f.converters.any}]),defaultValue:()=>({})}]),a.exports={EventSource:t,defaultReconnectionTime:3e3}},47800:(a,b,c)=>{"use strict";let{InvalidArgumentError:d}=c(61448),{setHeader:e}=c(84285),{runtimeFeatures:f}=c(56758),g=f.has("crypto")?c(77598):null,h=g?.hash?a=>g.hash("sha256",a,"base64url"):a=>Buffer.from(a).toString("base64url");function i(a){return Array.isArray(a)&&(1&a.length)==0}let j=["record","playback","update"];a.exports={createHeaderFilters:function(a={}){let{ignoreHeaders:b=[],excludeHeaders:c=[],matchHeaders:d=[],caseSensitive:e=!1}=a;return{ignore:new Set(b.map(a=>e?a:a.toLowerCase())),exclude:new Set(c.map(a=>e?a:a.toLowerCase())),match:new Set(d.map(a=>e?a:a.toLowerCase()))}},hashId:h,isUndiciHeaders:i,normalizeHeaders:function(a){let b={};if(!a)return b;if(i(a)){for(let c=0;c<a.length;c+=2){let d=a[c],f=a[c+1];if(d&&void 0!==f){let a=Buffer.isBuffer(d)?d.toString():d,c=Buffer.isBuffer(f)?f.toString():f;e(b,a.toLowerCase(),c)}}return b}if(a&&"object"==typeof a)for(let[c,d]of Object.entries(a))c&&"string"==typeof c&&e(b,c.toLowerCase(),Array.isArray(d)?d.join(", "):String(d));return b},isUrlExcludedFactory:function(a=[]){return 0===a.length?()=>!1:function(b){let c;for(let d of a)if("string"==typeof d){if(c||(c=b.toLowerCase()),c.includes(d.toLowerCase()))return!0}else if(d instanceof RegExp&&d.test(b))return!0;return!1}},validateSnapshotMode:function(a){if(!j.includes(a))throw new d(`Invalid snapshot mode: ${a}. Must be one of: ${j.join(", ")}`)}}},48047:(a,b,c)=>{"use strict";c.d(b,{f:()=>e,u:()=>d});let d="1.0.70",e=`grok-pager/${d} grok-shell/${d} (linux; x86_64)`},48841:(a,b,c)=>{"use strict";let{kProxy:d,kClose:e,kDestroy:f,kDispatch:g}=c(49176),h=c(37417),i=c(35689),j=c(5318),{InvalidArgumentError:k,RequestAbortedError:l,SecureProxyConnectionError:m,ProxyConnectionError:n}=c(61448),o=c(55285),p=c(40106),{channels:q}=c(62571),r=c(64156),{hasSafeIterator:s}=c(84285),t=Symbol("proxy agent"),u=Symbol("proxy client"),v=Symbol("proxy headers"),w=Symbol("request tls settings"),x=Symbol("proxy tls settings"),y=Symbol("connect endpoint function"),z=Symbol("connect endpoint function (http/1.1 only)"),A=Symbol("tunnel proxy"),B="proxy-authorization";function C(a,b){return new i(a,b)}let D=()=>{};function E(a,b){return 1===b.connections?new p(a,b):new i(a,b)}class F extends j{#bM;#bN;constructor(a,{headers:b={},connect:c,factory:d,proxyServername:e}){if(!a)throw new k("Proxy URL is mandatory");super(),this[v]=b,this.#bN=e,d?this.#bM=d(a,{connect:c}):this.#bM=new p(a,{connect:c})}[g](a,b){let c=b.onResponseStart;b.onResponseStart=function(a,d,e,f){if(407===d){"function"==typeof b.onResponseError&&b.onResponseError(a,new k("Proxy Authentication Required (407)"));return}c&&c.call(this,a,d,e,f)};let{origin:d,path:e="/",headers:f={}}=a;return a.path=d+e,a.headers={...this[v],...f},I(f)||(a.headers.host=new URL(d).host),null!=this.#bN&&(a.servername=this.#bN),this.#bM[g](a,b)}[e](){return this.#bM.close()}[f](a){return this.#bM.destroy(a)}}class G extends j{constructor(a){if(!a||"object"==typeof a&&!(a instanceof URL)&&!a.uri)throw new k("Proxy uri is mandatory");let{clientFactory:b=C}=a;if("function"!=typeof b)throw new k("Proxy opts.clientFactory must be a function.");let{proxyTunnel:c,connectTimeout:e}=a;super(a);let f=this.#bO(a),{href:g,origin:i,port:j,protocol:p,username:s,password:B,hostname:G}=f;if(this[d]={uri:g,protocol:p},this[w]=a.requestTls,this[x]=a.proxyTls,this[v]=a.headers||{},this[A]=c,a.auth&&a.token)throw new k("opts.auth cannot be used in combination with opts.token");a.auth?this[v]["proxy-authorization"]=`Basic ${a.auth}`:a.token?this[v]["proxy-authorization"]=a.token:s&&B?this[v]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(s)}:${decodeURIComponent(B)}`).toString("base64")}`:s&&(this[v]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(s)}:`).toString("base64")}`);let H=o({timeout:e,...a.proxyTls}),I=o({timeout:e,...a.proxyTls,allowH2:!1});this[y]=o({timeout:e,...a.requestTls}),this[z]=o({timeout:e,...a.requestTls,allowH2:!1});let J=a.factory||E,K=(b,c)=>{let{protocol:f}=new URL(b);if("socks5:"===this[d].protocol||"socks:"===this[d].protocol)return new r(this[d].uri,{headers:this[v],connect:H,factory:J,username:a.username||s,password:a.password||B,connectTimeout:e,proxyTls:a.proxyTls,requestTls:a.requestTls});if(!0!==this[A]&&"http:"===f){let a="https:"===this[d].protocol?(a,b)=>I(a,(a,c)=>{a&&"ERR_TLS_CERT_ALTNAME_INVALID"===a.code?b(new m(a)):b(a,c)}):I;return new F(this[d].uri,{headers:this[v],connect:a,factory:J,proxyServername:"https:"===this[d].protocol?this[x]?.servername||G:void 0})}return J(b,c)};"socks5:"===p||"socks:"===p?this[u]=null:this[u]=b(f,{connect:H}),this[t]=new h({...a,factory:K,connect:async(a,b)=>{if(!this[u])return void b(new k("Cannot establish tunnel connection without a proxy client"));let c=a.host;a.port||(c+=`:${"https:"===a.protocol?443:80}`);try{let d,e={origin:i,port:j,path:c,signal:a.signal,headers:{...this[v],host:a.host,...null==a.connections||a.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[x]?.servername||G},{socket:f,statusCode:g}=await this[u].connect(e);if(200!==g){f.on("error",D).destroy(),b(new l(`Proxy response (${g}) !== 200 when HTTP Tunneling`));return}if(q.proxyConnected.hasSubscribers&&q.proxyConnected.publish({socket:f,connectParams:e}),"https:"!==a.protocol)return void b(null,f);d=this[w]?this[w].servername:a.servername,(!1===a.allowH2?this[z]:this[y])({...a,servername:d,httpSocket:f},b)}catch(a){b("ERR_TLS_CERT_ALTNAME_INVALID"===a.code?new m(a):"UND_ERR_SOCKET"===a.code?new n(a):a)}}})}dispatch(a,b){let c=function(a){if(Array.isArray(a)){let b={};for(let c=0;c<a.length;c+=2)H(a[c])&&J(),b[a[c]]=a[c+1];return b}if(a&&"object"==typeof a&&s(a)){let b={};for(let[c,d]of a){if(!Object.hasOwn(b,c)){b[c]=d;continue}let a=b[c],e=[];void 0!==a&&e.push(...Array.isArray(a)?a:[a]),void 0!==d&&e.push(...Array.isArray(d)?d:[d]),b[c]=e.length>1?e:e[0]}return b}return a}(a.headers);return function(a){for(let b in a)H(b)&&J()}(c),c&&!I(c)&&(c===a.headers&&(c={...c}),c.host=new URL(a.origin).host),this[t].dispatch({...a,headers:c},b)}#bO(a){return"string"==typeof a?new URL(a):a instanceof URL?a:new URL(a.uri)}[e](){let a=[this[t].close()];return this[u]&&a.push(this[u].close()),Promise.all(a)}[f](){let a=[this[t].destroy()];return this[u]&&a.push(this[u].destroy()),Promise.all(a)}}function H(a){return a.length===B.length&&a.toLowerCase()===B}function I(a){for(let b in a)if(4===b.length&&"host"===b.toLowerCase())return!0;return!1}function J(){throw new k("Proxy-Authorization should be sent in ProxyAgent constructor")}a.exports=G},48991:(a,b,c)=>{"use strict";c.d(b,{A9:()=>l,Ch:()=>g,Cn:()=>m,Co:()=>v,Hi:()=>h,Ic:()=>t,NA:()=>x,P0:()=>p,Wu:()=>w,buildKimiHeaders:()=>y,cw:()=>i,dw:()=>o,go:()=>e,nZ:()=>s,p8:()=>q,rJ:()=>r,sX:()=>f,uR:()=>n,x0:()=>j,zv:()=>u});var d=c(21820);let e="google-genai-sdk/1.41.0 gl-node/v22.19.0";function f(a="unknown"){let b;return`GeminiCLI/0.34.0/${a||"unknown"} (${(0,d.platform)()}; ${"ia32"===(b=(0,d.arch)())?"x86":b}; terminal)`}let g="0.159.0",h="codex_cli_rs";function i(){return`${h}/${g}`}let j={VSCODE_VERSION:"1.110.0",COPILOT_CHAT_VERSION:"0.38.0",USER_AGENT:"GitHubCopilotChat/0.38.0",API_VERSION:"2025-04-01"};function k(){let a=(0,d.platform)(),b=(0,d.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}function l(){return`Antigravity/1.125.0 (${function(){switch((0,d.platform)()){case"darwin":return"Macintosh; Intel Mac OS X 10_15_7";case"win32":return"Windows NT 10.0; Win64; x64";default:return"X11; Linux x86_64"}}()}) Chrome/142.0.7444.175 Electron/39.2.7`}let m={ideType:9,platform:k(),pluginType:2},n="_ide",o=new Set(["Task","TaskOutput","TaskStop","TaskCreate","TaskGet","TaskUpdate","TaskList","Bash","Glob","Grep","Read","Edit","Write","NotebookEdit","WebFetch","WebSearch","AskUserQuestion","Skill","EnterPlanMode","ExitPlanMode"]);function p(){return`antigravity/cli/1.1.13 (aidev_client; os_type=${"win32"===(0,d.platform)()?"windows":(0,d.platform)()}; arch=${"x64"===(0,d.arch)()?"amd64":"ia32"===(0,d.arch)()?"x86":(0,d.arch)()}; cl=964361259; auth_method=consumer)`}function q(){return"antigravity/ide/2.1.1 darwin/arm64"}function r(a){return"string"==typeof a&&/(?:^|\/)gemini-3\.(?:7|8)(?:-|$)/i.test(a)?p():q()}q();let s={loadCodeAssist:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUser:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser"},t={"Content-Type":"application/json","User-Agent":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"google-cloud-sdk vscode_cloudshelleditor/0.1","Client-Metadata":JSON.stringify({ideType:9,platform:k(),pluginType:2})},u={ideType:9,platform:k(),pluginType:2},v="You are Claude Code, Anthropic's official CLI for Claude.",w={codex:6e5,claude:144e5,iflow:864e5,qwen:12e5,codebuddy:12e5,kimi:3e5,"kimi-coding":3e5,antigravity:3e5,"grok-cli":3e5,xai:3e5},x={google:{token:"https://oauth2.googleapis.com/token",auth:"https://accounts.google.com/o/oauth2/auth"},openai:{token:"https://auth.openai.com/oauth/token",auth:"https://auth.openai.com/oauth/authorize"},anthropic:{token:"https://api.anthropic.com/v1/oauth/token",auth:"https://api.anthropic.com/v1/oauth/authorize"},qwen:{token:"https://qwen.ai/api/v1/oauth2/token",auth:"https://qwen.ai/api/v1/oauth2/device/code"},iflow:{token:"https://iflow.cn/oauth/token",auth:"https://iflow.cn/oauth"},github:{token:"https://github.com/login/oauth/access_token",auth:"https://github.com/login/oauth/authorize",deviceCode:"https://github.com/login/device/code"}};function y(a){let b="string"==typeof a&&a.trim()?a.trim():`kimi-${Date.now()}`;return{"X-Msh-Platform":"zevairouter","X-Msh-Version":"2.1.2","X-Msh-Device-Model":"u">typeof process?`${process.platform} ${process.arch}`:"unknown","X-Msh-Device-Id":b}}},49166:(a,b,c)=>{"use strict";let{Cache:d}=c(50027),{webidl:e}=c(32984),{kEnumerableProperty:f}=c(84285),{kConstruct:g}=c(49176);class h{#bP=new Map;constructor(){arguments[0]!==g&&e.illegalConstructor(),e.util.markAsUncloneable(this)}async match(a,b={}){if(e.brandCheck(this,e.is.CacheStorage),e.argumentLengthCheck(arguments,1,"CacheStorage.match"),a=e.converters.RequestInfo(a),null!=(b=e.converters.MultiCacheQueryOptions(b)).cacheName){if(this.#bP.has(b.cacheName)){let c=new d(g,this.#bP.get(b.cacheName));return await c.match(a,b)}}else for(let c of this.#bP.values()){let e=new d(g,c),f=await e.match(a,b);if(void 0!==f)return f}}async has(a){e.brandCheck(this,e.is.CacheStorage);let b="CacheStorage.has";return e.argumentLengthCheck(arguments,1,b),a=e.converters.DOMString(a,b,"cacheName"),this.#bP.has(a)}async open(a){e.brandCheck(this,e.is.CacheStorage);let b="CacheStorage.open";if(e.argumentLengthCheck(arguments,1,b),a=e.converters.DOMString(a,b,"cacheName"),this.#bP.has(a))return new d(g,this.#bP.get(a));let c=[];return this.#bP.set(a,c),new d(g,c)}async delete(a){e.brandCheck(this,e.is.CacheStorage);let b="CacheStorage.delete";return e.argumentLengthCheck(arguments,1,b),a=e.converters.DOMString(a,b,"cacheName"),this.#bP.delete(a)}async keys(){return e.brandCheck(this,e.is.CacheStorage),[...this.#bP.keys()]}static{e.is.CacheStorage=a=>null!=a&&"object"==typeof a&&#bP in a}}Object.defineProperties(h.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:f,has:f,open:f,delete:f,keys:f}),a.exports={CacheStorage:h}},49176:a=>{"use strict";a.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kRequestOrigin:Symbol("request origin"),kRedirectCacheControl:Symbol("redirect cache control"),kOriginless:Symbol("originless"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2Options:Symbol("http2 options"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kHostAuthority:Symbol("host authority"),kHTTP2InitialWindowSize:Symbol("http2 initial window size"),kHTTP2ConnectionWindowSize:Symbol("http2 connection window size"),kEnableConnectProtocol:Symbol("http2session connect protocol"),kRemoteSettings:Symbol("http2session remote settings"),kHTTP2Stream:Symbol("http2session client stream"),kPingInterval:Symbol("ping interval"),kUseMilo:Symbol("use milo"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent"),kSocks5ProxyAgent:Symbol("socks5 proxy agent")}},49971:(a,b,c)=>{"use strict";c.d(b,{N:()=>g});var d=c(59602);let e={"Content-Type":"text/event-stream","Cache-Control":"no-cache","X-Accel-Buffering":"no"};async function f(a,b,c){let e=await a.text();try{let f=JSON.parse(e),g=f?.choices?.[0]?.message?.content||"",{content:h,toolCalls:i,finishReason:j}=(0,d.mU)(g,b,c);return i?(f.choices[0].message={role:"assistant",content:null,tool_calls:i},f.choices[0].finish_reason=j):f.choices[0].message.content=h,new Response(JSON.stringify(f),{status:a.status,headers:{"Content-Type":"application/json"}})}catch{return new Response(e,{status:a.status,headers:{"Content-Type":"application/json"}})}}async function g(a,b,c,d){var g,h,i,j;let k,l,m,n,o;if(!a.ok)return a;let p=await f(a,b,d.idSeed??"cgpt");return c?new Response((g=await p.json(),h=d.cid,i=d.created,j=d.model,k=new TextEncoder,m=(l=g?.choices?.[0]??{}).message??{},n=l.finish_reason??"stop",o=(a,b)=>{var c;return k.encode((c={id:h,object:"chat.completion.chunk",created:i,model:j,system_fingerprint:null,choices:[{index:0,delta:a,finish_reason:b,logprobs:null}]},`data: ${JSON.stringify(c)}
251
251
 
252
- `))},new ReadableStream({start(a){a.enqueue(o({role:"assistant"},null)),Array.isArray(m.tool_calls)&&m.tool_calls.length>0?(m.tool_calls.forEach((b,c)=>{a.enqueue(o({tool_calls:[{index:c,...b}]},null))}),a.enqueue(o({},n))):a.enqueue(o({content:m.content??""},n)),a.enqueue(k.encode("data: [DONE]\n\n")),a.close()}})),{status:200,headers:e}):p}},50027:(a,b,c)=>{"use strict";let d=c(34589),{kConstruct:e}=c(49176),{urlEquals:f,getFieldValues:g}=c(68531),{kEnumerableProperty:h,isDisturbed:i}=c(84285),{webidl:j}=c(32984),{cloneResponse:k,fromInnerResponse:l,getResponseState:m}=c(78196),{Request:n,fromInnerRequest:o,getRequestState:p}=c(12600),{fetching:q}=c(76403),{urlIsHttpHttpsScheme:r,readAllBytes:s}=c(42425);class t{#bO;constructor(){arguments[0]!==e&&j.illegalConstructor(),j.util.markAsUncloneable(this),this.#bO=arguments[1]}async match(a,b={}){j.brandCheck(this,j.is.Cache);let c="Cache.match";j.argumentLengthCheck(arguments,1,c),a=j.converters.RequestInfo(a),b=j.converters.CacheQueryOptions(b,c,"options");let d=this.#bP(a,b,1);if(0!==d.length)return d[0]}async matchAll(a,b={}){return j.brandCheck(this,j.is.Cache),void 0!==a&&(a=j.converters.RequestInfo(a)),b=j.converters.CacheQueryOptions(b,"Cache.matchAll","options"),this.#bP(a,b)}async add(a){j.brandCheck(this,j.is.Cache),j.argumentLengthCheck(arguments,1,"Cache.add");let b=[a=j.converters.RequestInfo(a)],c=this.addAll(b);return await c}async addAll(a){j.brandCheck(this,j.is.Cache);let b="Cache.addAll";j.argumentLengthCheck(arguments,1,b);let c=[],d=[];for(let c of a){if(void 0===c)throw j.errors.conversionFailed({prefix:b,argument:"Argument 1",types:["undefined is not allowed"]});if("string"==typeof(c=j.converters.RequestInfo(c)))continue;let a=p(c);if(!r(a.url)||"GET"!==a.method)throw j.errors.exception({header:b,message:"Expected http/s scheme when method is not GET."})}let e=[];for(let f of a){let a=p(new n(f));if(!r(a.url))throw j.errors.exception({header:b,message:"Expected http/s scheme."});a.initiator="fetch",a.destination="subresource",d.push(a);let h=Promise.withResolvers();e.push(q({request:a,processResponse(a){if("error"===a.type||206===a.status||a.status<200||a.status>299)h.reject(j.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(a.headersList.contains("vary")){for(let b of g(a.headersList.get("vary")))if("*"===b){for(let a of(h.reject(j.errors.exception({header:"Cache.addAll",message:"invalid vary field value"})),e))a.abort();return}}},processResponseConsumeBody(a){a.aborted?h.reject(new DOMException("aborted","AbortError")):h.resolve(a)}})),c.push(h.promise)}let f=Promise.all(c),h=await f,i=[],k=0;for(let a of h){let b={type:"put",request:d[k],response:a};i.push(b),k++}let l=Promise.withResolvers(),m=null;try{this.#bQ(i)}catch(a){m=a}return queueMicrotask(()=>{null===m?l.resolve(void 0):l.reject(m)}),l.promise}async put(a,b){j.brandCheck(this,j.is.Cache);let c="Cache.put";j.argumentLengthCheck(arguments,2,c),a=j.converters.RequestInfo(a),b=j.converters.Response(b,c,"response");let d=null;if(!r((d=j.is.Request(a)?p(a):p(new n(a))).url)||"GET"!==d.method)throw j.errors.exception({header:c,message:"Expected an http/s scheme when method is not GET"});let e=m(b);if(206===e.status)throw j.errors.exception({header:c,message:"Got 206 status"});if(e.headersList.contains("vary")){for(let a of g(e.headersList.get("vary")))if("*"===a)throw j.errors.exception({header:c,message:"Got * vary field value"})}if(e.body&&(i(e.body.stream)||e.body.stream.locked))throw j.errors.exception({header:c,message:"Response body is locked or disturbed"});let f=k(e),h=Promise.withResolvers();null!=e.body?s(e.body.stream.getReader(),h.resolve,h.reject):h.resolve(void 0);let l=[],o={type:"put",request:d,response:f};l.push(o);let q=await h.promise;null!=f.body&&(f.body.source=q);let t=Promise.withResolvers(),u=null;try{this.#bQ(l)}catch(a){u=a}return queueMicrotask(()=>{null===u?t.resolve():t.reject(u)}),t.promise}async delete(a,b={}){let c;j.brandCheck(this,j.is.Cache);let e="Cache.delete";j.argumentLengthCheck(arguments,1,e),a=j.converters.RequestInfo(a),b=j.converters.CacheQueryOptions(b,e,"options");let f=null;if(j.is.Request(a)){if("GET"!==(f=p(a)).method&&!b.ignoreMethod)return!1}else d("string"==typeof a),f=p(new n(a));let g=[],h={type:"delete",request:f,options:b};g.push(h);let i=Promise.withResolvers(),k=null;try{c=this.#bQ(g)}catch(a){k=a}return queueMicrotask(()=>{null===k?i.resolve(!!c?.length):i.reject(k)}),i.promise}async keys(a,b={}){j.brandCheck(this,j.is.Cache),void 0!==a&&(a=j.converters.RequestInfo(a)),b=j.converters.CacheQueryOptions(b,"Cache.keys","options");let c=null;if(void 0!==a)if(j.is.Request(a)){if("GET"!==(c=p(a)).method&&!b.ignoreMethod)return[]}else"string"==typeof a&&(c=p(new n(a)));let d=Promise.withResolvers(),e=[];if(void 0===a)for(let a of this.#bO)e.push(a[0]);else for(let a of this.#bR(c,b))e.push(a[0]);return queueMicrotask(()=>{let a=[];for(let b of e){let c=o(b,void 0,new AbortController().signal,"immutable");a.push(c)}d.resolve(Object.freeze(a))}),d.promise}#bQ(a){let b=this.#bO,c=[...b],e=[],f=[];try{for(let c of a){let a;if("delete"!==c.type&&"put"!==c.type)throw j.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if("delete"===c.type&&null!=c.response)throw j.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#bR(c.request,c.options,e).length)throw new DOMException("???","InvalidStateError");if("delete"===c.type){if(a=this.#bR(c.request,c.options),0===a.length)return[];for(let c of a){let a=b.indexOf(c);d(-1!==a),b.splice(a,1)}}else if("put"===c.type){if(null==c.response)throw j.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let f=c.request;if(!r(f.url))throw j.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if("GET"!==f.method)throw j.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(null!=c.options)throw j.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});for(let e of a=this.#bR(c.request)){let a=b.indexOf(e);d(-1!==a),b.splice(a,1)}b.push([c.request,c.response]),e.push([c.request,c.response])}f.push([c.request,c.response])}return f}catch(a){throw this.#bO.length=0,this.#bO=c,a}}#bR(a,b,c){let d=[];for(let e of c??this.#bO){let[c,f]=e;this.#bS(a,c,f,b)&&d.push(e)}return d}#bS(a,b,c=null,d){let e=new URL(a.url),h=new URL(b.url);if(d?.ignoreSearch&&(h.search="",e.search=""),!f(e,h,!0))return!1;if(null==c||d?.ignoreVary||!c.headersList.contains("vary"))return!0;for(let d of g(c.headersList.get("vary")))if("*"===d||b.headersList.get(d)!==a.headersList.get(d))return!1;return!0}#bP(a,b,c=1/0){let d=null;if(void 0!==a)if(j.is.Request(a)){if("GET"!==(d=p(a)).method&&!b.ignoreMethod)return[]}else"string"==typeof a&&(d=p(new n(a)));let e=[];if(void 0===a)for(let a of this.#bO)e.push(a[1]);else for(let a of this.#bR(d,b))e.push(a[1]);let f=[];for(let a of e){let b=l(k(a),"immutable");if(f.push(b),f.length>=c)break}return Object.freeze(f)}static{j.is.Cache=a=>null!=a&&"object"==typeof a&&#bO in a}}Object.defineProperties(t.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:h,matchAll:h,add:h,addAll:h,put:h,delete:h,keys:h});let u=[{key:"ignoreSearch",converter:j.converters.boolean,defaultValue:()=>!1},{key:"ignoreMethod",converter:j.converters.boolean,defaultValue:()=>!1},{key:"ignoreVary",converter:j.converters.boolean,defaultValue:()=>!1}];j.converters.CacheQueryOptions=j.dictionaryConverter(u),j.converters.MultiCacheQueryOptions=j.dictionaryConverter([...u,{key:"cacheName",converter:j.converters.DOMString}]),j.converters.Response=j.interfaceConverter(j.is.Response,"Response"),j.converters["sequence<RequestInfo>"]=j.sequenceConverter(j.converters.RequestInfo),a.exports={Cache:t}},50294:(a,b,c)=>{"use strict";c.d(b,{R:()=>j});var d=c(88164),e=c(30395),f=c(48991),g=c(11484);let h="QwenCode/0.12.3 (linux; x64)",i={role:"system",content:[{type:"text",text:"",cache_control:{type:"ephemeral"}}]};class j extends d.L{constructor(){super("qwen")}buildUrl(a,b,c=0,d=null){let e=d?.providerSpecificData?.resourceUrl,f=e?e.replace(/^https?:\/\//,"").replace(/\/$/,""):"portal.qwen.ai";return`https://${f}/v1/chat/completions`}buildHeaders(a,b=!0){return function(a,b=!0){let c=a?.apiKey||a?.accessToken||"",d={"Content-Type":"application/json",Authorization:`Bearer ${c}`,"User-Agent":h,"X-DashScope-AuthType":"qwen-oauth","X-DashScope-CacheControl":"enable","X-DashScope-UserAgent":h,"X-Stainless-Arch":"x64","X-Stainless-Lang":"js","X-Stainless-Os":"Linux","X-Stainless-Package-Version":"5.11.0","X-Stainless-Retry-Count":"1","X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":"v18.19.1",Connection:"keep-alive","Accept-Language":"*","Sec-Fetch-Mode":"cors"};return d.Accept=b?"text/event-stream":"application/json",d}(a,b)}transformRequest(a,b,c,d){let e=b&&"object"==typeof b?{...b}:b;c&&e?.messages&&!e.stream_options&&!e.thinking&&!e.enable_thinking&&!1!==e.stream&&(e.stream_options={include_usage:!0});var f=e=function(a){let b;if(!0!==(b=a?.thinking)&&a?.enable_thinking!==!0&&("object"!=typeof b||null===b||Array.isArray(b)||"enabled"!==b.type))return a;let c=a.tool_choice;return"required"!==c&&("object"!=typeof c||null===c)?a:{...a,tool_choice:"auto"}}(e);if(!f||"object"!=typeof f)return f;let g={...f};return Array.isArray(g.messages)?g.messages=[i,...g.messages]:g.messages=[i],g}async refreshCredentials(a,b){if(!a?.refreshToken)return null;try{let c=await fetch(f.NA.qwen.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a.refreshToken,client_id:e.xq.qwen.clientId})});if(!c.ok)return await (0,g.aI)(c),null;let d=await c.json();return b?.info?.("TOKEN","qwen refreshed"),{accessToken:d.access_token,refreshToken:d.refresh_token||a.refreshToken,expiresIn:d.expires_in,providerSpecificData:{...a.providerSpecificData||{},...d.resource_url?{resourceUrl:d.resource_url}:{}}}}catch(a){return b?.error?.("TOKEN",`qwen refresh error: ${a.message}`),null}}}},50329:a=>{"use strict";class b{bottom=0;top=0;list=Array(2048).fill(void 0);next=null;isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(a){this.list[this.top]=a,this.top=this.top+1&2047}shift(){let a=this.list[this.bottom];return void 0===a?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,a)}}a.exports=class{constructor(){this.head=this.tail=new b}isEmpty(){return this.head.isEmpty()}push(a){this.head.isFull()&&(this.head=this.head.next=new b),this.head.push(a)}shift(){let a=this.tail,b=a.shift();return a.isEmpty()&&null!==a.next&&(this.tail=a.next,a.next=null),b}}},50570:(a,b,c)=>{"use strict";c(42541)},50743:(a,b,c)=>{"use strict";function d(a,b=null){if(null==a)return b;if("string"!=typeof a)return a;try{return JSON.parse(a)}catch{return b}}function e(a){return JSON.stringify(a??null)}c.d(b,{q:()=>d,s:()=>e})},51047:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"bai",alias:"bai",aliases:["b-ai"],category:"apikey",authModes:["apikey"],passthroughModels:!0,modelsFetcher:{url:"https://api.b.ai/v1/models",type:"openai"},display:{name:"B.AI",icon:"account_balance",color:"#0369A1",textIcon:"BA",website:"https://b.ai",notice:{text:"OpenAI-compatible gateway. Model ids are fetched live after a key is saved.",apiKeyUrl:"https://b.ai"}},transport:{baseUrl:"https://api.b.ai/v1/chat/completions",validateUrl:"https://api.b.ai/v1/models",format:"openai"},models:[],serviceKinds:["llm"]}},51091:(a,b,c)=>{"use strict";c.d(b,{MB:()=>f});let d=/^[A-Za-z0-9-]+$/,e=new Set(["host","content-length","content-type","connection","transfer-encoding","authorization","cookie"]);function f(a,b){let c=b?.headers;if(!a||!c||"object"!=typeof c||Array.isArray(c))return a;for(let[b,f]of Object.entries(c))!d.test(b)||"string"!=typeof f||0===f.length||/[\r\n]/.test(f)||f.length>8192||e.has(b.toLowerCase())||(a[b]=f);return a}},51525:(a,b,c)=>{"use strict";c(76816)},51529:(a,b,c)=>{},51590:(a,b,c)=>{"use strict";var d=c(42541);c(21904),d.h.GEMINI,d.h.GEMINI_CLI,d.h.VERTEX,d.h.ANTIGRAVITY,d.h.OLLAMA,d.h.KIRO,d.h.COMMANDCODE},51658:(a,b,c)=>{"use strict";c(42541),c(85450),c(43212),c(11484),c(64323),c(83651),c(72610),c(51525),c(1899)},51705:(a,b,c)=>{"use strict";a.exports=c.p+"static/media/server.b857786a.js"},51753:(a,b,c)=>{"use strict";let d,{webidl:e}=c(32984),{kEnumerableProperty:f}=c(84285),{kConstruct:g}=c(49176);class h extends Event{#bT;constructor(a,b={}){if(a===g){super(arguments[1],arguments[2]),e.util.markAsUncloneable(this);return}let c="MessageEvent constructor";e.argumentLengthCheck(arguments,1,c),super(a=e.converters.DOMString(a,c,"type"),b=e.converters.MessageEventInit(b,c,"eventInitDict")),this.#bT=b,e.util.markAsUncloneable(this)}get data(){return e.brandCheck(this,e.is.MessageEvent),this.#bT.data}get origin(){return e.brandCheck(this,e.is.MessageEvent),this.#bT.origin}get lastEventId(){return e.brandCheck(this,e.is.MessageEvent),this.#bT.lastEventId}get source(){return e.brandCheck(this,e.is.MessageEvent),this.#bT.source}get ports(){return e.brandCheck(this,e.is.MessageEvent),Object.isFrozen(this.#bT.ports)||Object.freeze(this.#bT.ports),this.#bT.ports}initMessageEvent(a,b=!1,c=!1,d=null,f="",g="",i=null,j=[]){return e.brandCheck(this,e.is.MessageEvent),e.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new h(a,{bubbles:b,cancelable:c,data:d,origin:f,lastEventId:g,source:i,ports:j})}static{d=(a,b)=>{let c=new h(g,a,b);return c.#bT=b,c.#bT.data??=null,c.#bT.origin??="",c.#bT.lastEventId??="",c.#bT.source??=null,c.#bT.ports??=[],c},e.is.MessageEvent=a=>null!=a&&"object"==typeof a&&#bT in a}}class i extends Event{#bT;constructor(a,b={}){let c="CloseEvent constructor";e.argumentLengthCheck(arguments,1,c),super(a=e.converters.DOMString(a,c,"type"),b=e.converters.CloseEventInit(b)),this.#bT=b,e.util.markAsUncloneable(this)}get wasClean(){return e.brandCheck(this,e.is.CloseEvent),this.#bT.wasClean}get code(){return e.brandCheck(this,e.is.CloseEvent),this.#bT.code}get reason(){return e.brandCheck(this,e.is.CloseEvent),this.#bT.reason}static{e.is.CloseEvent=a=>null!=a&&"object"==typeof a&&#bT in a}}class j extends Event{#bT;constructor(a,b){let c="ErrorEvent constructor";e.argumentLengthCheck(arguments,1,c),super(a,b),e.util.markAsUncloneable(this),a=e.converters.DOMString(a,c,"type"),b=e.converters.ErrorEventInit(b??{}),this.#bT=b}get message(){return e.brandCheck(this,e.is.ErrorEvent),this.#bT.message}get filename(){return e.brandCheck(this,e.is.ErrorEvent),this.#bT.filename}get lineno(){return e.brandCheck(this,e.is.ErrorEvent),this.#bT.lineno}get colno(){return e.brandCheck(this,e.is.ErrorEvent),this.#bT.colno}get error(){return e.brandCheck(this,e.is.ErrorEvent),this.#bT.error}static{e.is.ErrorEvent=a=>null!=a&&"object"==typeof a&&#bT in a}}Object.defineProperties(h.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:f,origin:f,lastEventId:f,source:f,ports:f,initMessageEvent:f}),Object.defineProperties(i.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:f,code:f,wasClean:f}),Object.defineProperties(j.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:f,filename:f,lineno:f,colno:f,error:f}),e.converters.MessagePort=e.interfaceConverter(e.is.MessagePort,"MessagePort"),e.converters["sequence<MessagePort>"]=e.sequenceConverter(e.converters.MessagePort);let k=[{key:"bubbles",converter:e.converters.boolean,defaultValue:()=>!1},{key:"cancelable",converter:e.converters.boolean,defaultValue:()=>!1},{key:"composed",converter:e.converters.boolean,defaultValue:()=>!1}];e.converters.MessageEventInit=e.dictionaryConverter([...k,{key:"data",converter:e.converters.any,defaultValue:()=>null},{key:"origin",converter:e.converters.USVString,defaultValue:()=>""},{key:"lastEventId",converter:e.converters.DOMString,defaultValue:()=>""},{key:"source",converter:e.nullableConverter(e.converters.MessagePort),defaultValue:()=>null},{key:"ports",converter:e.converters["sequence<MessagePort>"],defaultValue:()=>[]}]),e.converters.CloseEventInit=e.dictionaryConverter([...k,{key:"wasClean",converter:e.converters.boolean,defaultValue:()=>!1},{key:"code",converter:e.converters["unsigned short"],defaultValue:()=>0},{key:"reason",converter:e.converters.USVString,defaultValue:()=>""}]),e.converters.ErrorEventInit=e.dictionaryConverter([...k,{key:"message",converter:e.converters.DOMString,defaultValue:()=>""},{key:"filename",converter:e.converters.USVString,defaultValue:()=>""},{key:"lineno",converter:e.converters["unsigned long"],defaultValue:()=>0},{key:"colno",converter:e.converters["unsigned long"],defaultValue:()=>0},{key:"error",converter:e.converters.any}]),a.exports={MessageEvent:h,CloseEvent:i,ErrorEvent:j,createFastMessageEvent:d}},52039:(a,b,c)=>{"use strict";let d,{isArrayBuffer:e}=c(73429),{webidl:f}=c(32984),{URLSerializer:g}=c(16537),{environmentSettingsObject:h}=c(42425),{staticPropertyDescriptors:i,states:j,sentCloseFrameState:k,sendHints:l,opcodes:m}=c(62026),{isConnecting:n,isEstablished:o,isClosing:p,isClosed:q,isValidSubprotocol:r,fireEvent:s,utf8Decode:t,toArrayBuffer:u,getURLRecord:v}=c(94050),{establishWebSocketConnection:w,closeWebSocketConnection:x,failWebsocketConnection:y}=c(4654),{ByteParser:z}=c(64821),{kEnumerableProperty:A}=c(84285),{getGlobalDispatcher:B}=c(59970),{ErrorEvent:C,CloseEvent:D,createFastMessageEvent:E}=c(51753),{SendQueue:F}=c(54849),{WebsocketFrameSend:G}=c(45221),{channels:H}=c(62571),I=Symbol.for("nodejs.ref"),J=Symbol.for("nodejs.unref");class K extends EventTarget{#bE={open:null,error:null,close:null,message:null};#bU=0;#bV="";#bW="";#bX=!0;#bY;#a$={onConnectionEstablished:(a,b)=>this.#a_(a,b),onMessage:(a,b)=>this.#a0(a,b),onParserError:a=>y(this.#a$,null,a.message),onParserDrain:()=>this.#bZ(),onSocketData:a=>{this.#a1.write(a)||this.#a$.socket.pause()},onSocketError:a=>{this.#a$.readyState=j.CLOSING,H.socketError.hasSubscribers&&H.socketError.publish(a),this.#a$.socket.destroy()},onSocketClose:()=>this.#a2(),onPing:a=>{H.ping.hasSubscribers&&H.ping.publish({payload:a,websocket:this})},onPong:a=>{H.pong.hasSubscribers&&H.pong.publish({payload:a,websocket:this})},readyState:j.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#aT;#b$;#a1;constructor(a,b=[]){super(),f.util.markAsUncloneable(this);let c="WebSocket constructor";f.argumentLengthCheck(arguments,1,c);let d=f.converters["DOMString or sequence<DOMString> or WebSocketInit"](b,c,"options");a=f.converters.USVString(a),b=d.protocols;let e=v(a,h.settingsObject.baseUrl);if("string"==typeof b&&(b=[b]),b.length!==new Set(b.map(a=>a.toLowerCase())).size||b.length>0&&!b.every(a=>r(a)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#aT=new URL(e.href);let g=h.settingsObject;this.#a$.controller=w(e,b,g,this.#a$,d),this.#a$.readyState=K.CONNECTING,this.#b$="blob"}[I](){this.#bX=!0,this.#a$.socket?.ref?.()}[J](){this.#bX=!1,this.#a$.socket?.unref?.()}close(a,b){f.brandCheck(this,f.is.WebSocket),void 0!==a&&(a=f.converters["unsigned short"](a,"WebSocket.close","code",f.attributes.Clamp)),void 0!==b&&(b=f.converters.USVString(b)),a??=null,b??="",x(this.#a$,a,b,!0)}send(a){f.brandCheck(this,f.is.WebSocket);let b="WebSocket.send";if(f.argumentLengthCheck(arguments,1,b),a=f.converters.WebSocketSendData(a,b,"data"),n(this.#a$.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!o(this.#a$.readyState)||p(this.#a$.readyState)))if("string"==typeof a){let b=Buffer.from(a);this.#bU+=b.byteLength,this.#bY.add(b,()=>{this.#bU-=b.byteLength},l.text)}else e(a)?(this.#bU+=a.byteLength,this.#bY.add(a,()=>{this.#bU-=a.byteLength},l.arrayBuffer)):ArrayBuffer.isView(a)?(this.#bU+=a.byteLength,this.#bY.add(a,()=>{this.#bU-=a.byteLength},l.typedArray)):f.is.Blob(a)&&(this.#bU+=a.size,this.#bY.add(a,()=>{this.#bU-=a.size},l.blob))}get readyState(){return f.brandCheck(this,f.is.WebSocket),this.#a$.readyState}get bufferedAmount(){return f.brandCheck(this,f.is.WebSocket),this.#bU}get url(){return f.brandCheck(this,f.is.WebSocket),g(this.#aT)}get extensions(){return f.brandCheck(this,f.is.WebSocket),this.#bW}get protocol(){return f.brandCheck(this,f.is.WebSocket),this.#bV}get onopen(){return f.brandCheck(this,f.is.WebSocket),this.#bE.open}set onopen(a){f.brandCheck(this,f.is.WebSocket),this.#bE.open&&this.removeEventListener("open",this.#bE.open);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("open",b),this.#bE.open=a):this.#bE.open=null}get onerror(){return f.brandCheck(this,f.is.WebSocket),this.#bE.error}set onerror(a){f.brandCheck(this,f.is.WebSocket),this.#bE.error&&this.removeEventListener("error",this.#bE.error);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("error",b),this.#bE.error=a):this.#bE.error=null}get onclose(){return f.brandCheck(this,f.is.WebSocket),this.#bE.close}set onclose(a){f.brandCheck(this,f.is.WebSocket),this.#bE.close&&this.removeEventListener("close",this.#bE.close);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("close",b),this.#bE.close=a):this.#bE.close=null}get onmessage(){return f.brandCheck(this,f.is.WebSocket),this.#bE.message}set onmessage(a){f.brandCheck(this,f.is.WebSocket),this.#bE.message&&this.removeEventListener("message",this.#bE.message);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("message",b),this.#bE.message=a):this.#bE.message=null}get binaryType(){return f.brandCheck(this,f.is.WebSocket),this.#b$}set binaryType(a){f.brandCheck(this,f.is.WebSocket),"blob"!==a&&"arraybuffer"!==a?this.#b$="blob":this.#b$=a}#a_(a,b){this.#a$.socket=a.socket,this.#bX||this.#a$.socket.unref?.();let c=this.#a$.controller.dispatcher?.webSocketOptions?.maxFragments,d=this.#a$.controller.dispatcher?.webSocketOptions?.maxPayloadSize,e=new z(this.#a$,b,{maxFragments:c,maxPayloadSize:d});e.on("drain",()=>this.#a$.onParserDrain()),e.on("error",a=>this.#a$.onParserError(a)),this.#a1=e,this.#bY=new F(a.socket),this.#a$.readyState=j.OPEN;let f=a.headersList.get("sec-websocket-extensions");null!==f&&(this.#bW=f);let g=a.headersList.get("sec-websocket-protocol");if(null!==g&&(this.#bV=g),s("open",this),H.open.hasSubscribers){var h;let b=a.headersList.entries;H.open.publish({address:(h=a.socket,"function"==typeof h?.address?h.address():"function"==typeof h?.session?.socket?.address?h.session.socket.address():null),protocol:this.#bV,extensions:this.#bW,websocket:this,handshakeResponse:{status:a.status,statusText:a.statusText,headers:b}})}}#a0(a,b){let c;if(this.#a$.readyState===j.OPEN){if(a===m.TEXT)try{c=t(b)}catch{y(this.#a$,1007,"Received invalid UTF-8 in text frame.");return}else a===m.BINARY&&(c="blob"===this.#b$?new Blob([b]):u(b));s("message",this,E,{origin:this.#aT.origin,data:c})}}#bZ(){this.#a$.socket.resume()}#a2(){let a=this.#a$.closeState.has(k.SENT)&&this.#a$.closeState.has(k.RECEIVED),b=1005,c="",d=this.#a1?.closingInfo;d&&!d.error&&(b=d.code??1005,c=d.reason),this.#a$.readyState=j.CLOSED,this.#a$.closeState.has(k.RECEIVED)||(b=1006,s("error",this,(a,b)=>new C(a,b),{error:TypeError(c)})),s("close",this,(a,b)=>new D(a,b),{wasClean:a,code:b,reason:c}),H.close.hasSubscribers&&H.close.publish({websocket:this,code:b,reason:c})}static{d=(a,b)=>{if(Buffer.isBuffer(b)){if(b.length>125)throw TypeError("A PING frame cannot have a body larger than 125 bytes.")}else if(void 0!==b)throw TypeError("Expected buffer payload");let c=a.#a$.readyState;if(o(c)&&!p(c)&&!q(c)){let c=new G(b);a.#a$.socket.write(c.createFrame(m.PING))}},f.is.WebSocket=a=>null!=a&&"object"==typeof a&&#a$ in a}}K.CONNECTING=K.prototype.CONNECTING=j.CONNECTING,K.OPEN=K.prototype.OPEN=j.OPEN,K.CLOSING=K.prototype.CLOSING=j.CLOSING,K.CLOSED=K.prototype.CLOSED=j.CLOSED,Object.defineProperties(K.prototype,{CONNECTING:i,OPEN:i,CLOSING:i,CLOSED:i,url:A,readyState:A,bufferedAmount:A,onopen:A,onerror:A,onclose:A,close:A,onmessage:A,binaryType:A,send:A,extensions:A,protocol:A,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}}),Object.defineProperties(K,{CONNECTING:i,OPEN:i,CLOSING:i,CLOSED:i}),f.converters["sequence<DOMString>"]=f.sequenceConverter(f.converters.DOMString),f.converters["DOMString or sequence<DOMString>"]=function(a,b,c){return f.util.Type(a)===f.util.Types.OBJECT&&Symbol.iterator in a?f.converters["sequence<DOMString>"](a):f.converters.DOMString(a,b,c)},f.converters.WebSocketInit=f.dictionaryConverter([{key:"protocols",converter:f.converters["DOMString or sequence<DOMString>"],defaultValue:()=>[]},{key:"dispatcher",converter:f.converters.any,defaultValue:()=>B()},{key:"headers",converter:f.nullableConverter(f.converters.HeadersInit)}]),f.converters["DOMString or sequence<DOMString> or WebSocketInit"]=function(a){return f.util.Type(a)!==f.util.Types.OBJECT||Symbol.iterator in a?{protocols:f.converters["DOMString or sequence<DOMString>"](a)}:f.converters.WebSocketInit(a)},f.converters.WebSocketSendData=function(a){return f.util.Type(a)===f.util.Types.OBJECT&&(f.is.Blob(a)||f.is.BufferSource(a))?a:f.converters.USVString(a)},a.exports={WebSocket:K,ping:d}},52825:(a,b,c)=>{"use strict";c.d(b,{y5:()=>m,cK:()=>l});var d=c(62239);function e(a){return"string"==typeof a&&a.includes("\0")?a.replace(/\0/g,""):a}global._dbAdapter||(global._dbAdapter={instance:null,initPromise:null,closePromise:null,logged:!1});let f=global._dbAdapter;async function g(){if(!process.versions.bun)return null;try{let{createBunSqliteAdapter:a}=await c.e(8062).then(c.bind(c,38062));return await a(d.AL)}catch(a){return console.warn(`[DB] bun:sqlite unavailable: ${a.message}`),null}}async function h(){if(process.versions.bun)return null;try{let{createBetterSqliteAdapter:a}=await c.e(8469).then(c.bind(c,88469));return a(d.AL)}catch(a){return console.warn(`[DB] better-sqlite3 unavailable: ${a.message}`),null}}async function i(){if(process.versions.bun)return null;let[a,b]=process.versions.node.split(".").map(Number);if(a<22||22===a&&b<5)return null;try{let{createNodeSqliteAdapter:a}=await c.e(4803).then(c.bind(c,54803));return await a(d.AL)}catch(a){return console.warn(`[DB] node:sqlite unavailable: ${a.message}`),null}}async function j(){try{let{createSqlJsAdapter:a}=await c.e(6252).then(c.bind(c,66252));return await a(d.AL)}catch(a){return console.warn(`[DB] sql.js unavailable: ${a.message}`),null}}async function k(){var a;let b;(0,d.Jh)();let k=await g();if(k||(k=await i()),k||(k=await h()),k||(k=await j()),!k)throw Error("[DB] No SQLite driver available (bun/node/better/sql.js all failed)");for(let c of(a=k,b=a=>Array.isArray(a)?a.map(e):a,k={...a,run:(c,d=[])=>a.run(c,b(d)),get:(c,d=[])=>a.get(c,b(d)),all:(c,d=[])=>a.all(c,b(d))},f.logged||(console.log(`[DB] Driver: ${k.driver} | file: ${d.AL}`),f.logged=!0),[d.AL,`${d.AL}-wal`,`${d.AL}-shm`]))(0,d.lo)(c);try{let{runMigrationOnce:a}=await c.e(7210).then(c.bind(c,24829));await a(k);let{runStartupMaintenanceOnce:b}=await c.e(281).then(c.bind(c,281));return b(k),k}catch(a){try{await k.close?.()}catch(a){console.warn(`[DB] failed to close partially initialized adapter: ${a.message}`)}throw a}}async function l(){if(f.instance)return f.instance;if(!f.initPromise){let a=k().then(a=>(f.instance=a,a)).catch(b=>{throw f.initPromise===a&&(f.initPromise=null),b});f.initPromise=a}return f.initPromise}async function m(){return f.closePromise||(f.closePromise=(async()=>{try{let{stopStartupMaintenance:a}=await c.e(281).then(c.bind(c,281));a();let b=f.instance||(f.initPromise?await f.initPromise:null);await b?.close?.()}finally{f.instance=null,f.initPromise=null,f.closePromise=null}})()),f.closePromise}"closePromise"in f||(f.closePromise=null)},53552:(a,b,c)=>{"use strict";let{InvalidArgumentError:d}=c(61448),e=c(40106);class f extends e{constructor(a,b){if("string"==typeof a&&(a=new URL(a)),"http:"!==a.protocol)throw new d("h2c-client: Only h2c protocol is supported");let{maxConcurrentStreams:c,pipelining:e,...f}=b??{},g=c??100,h=100;if(null!=c&&(!Number.isInteger(c)||c<1))throw new d("maxConcurrentStreams must be a positive integer, greater than 0");if(null!=e&&Number.isInteger(e)&&e>0&&(h=e),h>g)throw new d("h2c-client: pipelining cannot be greater than maxConcurrentStreams");super(a,{...f,maxConcurrentStreams:g,pipelining:h,allowH2:!0,useH2c:!0})}}a.exports=f},53859:(a,b,c)=>{"use strict";c.d(b,{n:()=>l});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j="zevai";function k(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),j):g().join(i().homedir(),`.${j}`)}let l=function(){let a=process.env.DATA_DIR;if(!a)return k();try{return e().mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${j}`),k();throw b}}()},54027:(a,b,c)=>{"use strict";c(29565)},54838:(a,b,c)=>{"use strict";c.d(b,{$D:()=>x,Oj:()=>g,P9:()=>s,QR:()=>j,VE:()=>o,We:()=>k,Y2:()=>m,ZF:()=>t,Zm:()=>f,aZ:()=>F,cr:()=>D,h3:()=>h,rG:()=>r,rx:()=>i,vR:()=>B,yh:()=>E});let d="-agentic",e="-thinking",f=64,g=10237,h=64,i="AmazonCodeWhispererStreamingService.GenerateAssistantResponse",j=new Set([401,403,404]);function k(a){return"google"===a||"github"===a?"arn:aws:codewhisperer:us-east-1:699475941385:profile/EHGA3GRVQMUK":"arn:aws:codewhisperer:us-east-1:638616132270:profile/AAAACCCCXXXX"}let l={minimal:512,low:1024,medium:8192,high:24576,xhigh:32768,max:128e3},m=process.env.ZEVAI_KIRO_IDE_VERSION||"1.4.154";process.env.ZEVAI_KIRO_CLI_VERSION;let n="1.0.0";function o(a){return{userAgent:`aws-sdk-js/${n} ua/2.1 os/windows#10.0.26200 lang/js md/nodejs#22.21.1 api/codewhispererruntime#${n} m/N,E KiroIDE-${m}-${a}`,amzUserAgent:`aws-sdk-js/${n} KiroIDE-${m}-${a}`}}let p=new Set(["1","true","yes","on"]),q=new Set(["0","false","no","off"]),r=`
252
+ `))},new ReadableStream({start(a){a.enqueue(o({role:"assistant"},null)),Array.isArray(m.tool_calls)&&m.tool_calls.length>0?(m.tool_calls.forEach((b,c)=>{a.enqueue(o({tool_calls:[{index:c,...b}]},null))}),a.enqueue(o({},n))):a.enqueue(o({content:m.content??""},n)),a.enqueue(k.encode("data: [DONE]\n\n")),a.close()}})),{status:200,headers:e}):p}},50027:(a,b,c)=>{"use strict";let d=c(34589),{kConstruct:e}=c(49176),{urlEquals:f,getFieldValues:g}=c(68531),{kEnumerableProperty:h,isDisturbed:i}=c(84285),{webidl:j}=c(32984),{cloneResponse:k,fromInnerResponse:l,getResponseState:m}=c(78196),{Request:n,fromInnerRequest:o,getRequestState:p}=c(12600),{fetching:q}=c(76403),{urlIsHttpHttpsScheme:r,readAllBytes:s}=c(42425);class t{#bQ;constructor(){arguments[0]!==e&&j.illegalConstructor(),j.util.markAsUncloneable(this),this.#bQ=arguments[1]}async match(a,b={}){j.brandCheck(this,j.is.Cache);let c="Cache.match";j.argumentLengthCheck(arguments,1,c),a=j.converters.RequestInfo(a),b=j.converters.CacheQueryOptions(b,c,"options");let d=this.#bR(a,b,1);if(0!==d.length)return d[0]}async matchAll(a,b={}){return j.brandCheck(this,j.is.Cache),void 0!==a&&(a=j.converters.RequestInfo(a)),b=j.converters.CacheQueryOptions(b,"Cache.matchAll","options"),this.#bR(a,b)}async add(a){j.brandCheck(this,j.is.Cache),j.argumentLengthCheck(arguments,1,"Cache.add");let b=[a=j.converters.RequestInfo(a)],c=this.addAll(b);return await c}async addAll(a){j.brandCheck(this,j.is.Cache);let b="Cache.addAll";j.argumentLengthCheck(arguments,1,b);let c=[],d=[];for(let c of a){if(void 0===c)throw j.errors.conversionFailed({prefix:b,argument:"Argument 1",types:["undefined is not allowed"]});if("string"==typeof(c=j.converters.RequestInfo(c)))continue;let a=p(c);if(!r(a.url)||"GET"!==a.method)throw j.errors.exception({header:b,message:"Expected http/s scheme when method is not GET."})}let e=[];for(let f of a){let a=p(new n(f));if(!r(a.url))throw j.errors.exception({header:b,message:"Expected http/s scheme."});a.initiator="fetch",a.destination="subresource",d.push(a);let h=Promise.withResolvers();e.push(q({request:a,processResponse(a){if("error"===a.type||206===a.status||a.status<200||a.status>299)h.reject(j.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(a.headersList.contains("vary")){for(let b of g(a.headersList.get("vary")))if("*"===b){for(let a of(h.reject(j.errors.exception({header:"Cache.addAll",message:"invalid vary field value"})),e))a.abort();return}}},processResponseConsumeBody(a){a.aborted?h.reject(new DOMException("aborted","AbortError")):h.resolve(a)}})),c.push(h.promise)}let f=Promise.all(c),h=await f,i=[],k=0;for(let a of h){let b={type:"put",request:d[k],response:a};i.push(b),k++}let l=Promise.withResolvers(),m=null;try{this.#bS(i)}catch(a){m=a}return queueMicrotask(()=>{null===m?l.resolve(void 0):l.reject(m)}),l.promise}async put(a,b){j.brandCheck(this,j.is.Cache);let c="Cache.put";j.argumentLengthCheck(arguments,2,c),a=j.converters.RequestInfo(a),b=j.converters.Response(b,c,"response");let d=null;if(!r((d=j.is.Request(a)?p(a):p(new n(a))).url)||"GET"!==d.method)throw j.errors.exception({header:c,message:"Expected an http/s scheme when method is not GET"});let e=m(b);if(206===e.status)throw j.errors.exception({header:c,message:"Got 206 status"});if(e.headersList.contains("vary")){for(let a of g(e.headersList.get("vary")))if("*"===a)throw j.errors.exception({header:c,message:"Got * vary field value"})}if(e.body&&(i(e.body.stream)||e.body.stream.locked))throw j.errors.exception({header:c,message:"Response body is locked or disturbed"});let f=k(e),h=Promise.withResolvers();null!=e.body?s(e.body.stream.getReader(),h.resolve,h.reject):h.resolve(void 0);let l=[],o={type:"put",request:d,response:f};l.push(o);let q=await h.promise;null!=f.body&&(f.body.source=q);let t=Promise.withResolvers(),u=null;try{this.#bS(l)}catch(a){u=a}return queueMicrotask(()=>{null===u?t.resolve():t.reject(u)}),t.promise}async delete(a,b={}){let c;j.brandCheck(this,j.is.Cache);let e="Cache.delete";j.argumentLengthCheck(arguments,1,e),a=j.converters.RequestInfo(a),b=j.converters.CacheQueryOptions(b,e,"options");let f=null;if(j.is.Request(a)){if("GET"!==(f=p(a)).method&&!b.ignoreMethod)return!1}else d("string"==typeof a),f=p(new n(a));let g=[],h={type:"delete",request:f,options:b};g.push(h);let i=Promise.withResolvers(),k=null;try{c=this.#bS(g)}catch(a){k=a}return queueMicrotask(()=>{null===k?i.resolve(!!c?.length):i.reject(k)}),i.promise}async keys(a,b={}){j.brandCheck(this,j.is.Cache),void 0!==a&&(a=j.converters.RequestInfo(a)),b=j.converters.CacheQueryOptions(b,"Cache.keys","options");let c=null;if(void 0!==a)if(j.is.Request(a)){if("GET"!==(c=p(a)).method&&!b.ignoreMethod)return[]}else"string"==typeof a&&(c=p(new n(a)));let d=Promise.withResolvers(),e=[];if(void 0===a)for(let a of this.#bQ)e.push(a[0]);else for(let a of this.#bT(c,b))e.push(a[0]);return queueMicrotask(()=>{let a=[];for(let b of e){let c=o(b,void 0,new AbortController().signal,"immutable");a.push(c)}d.resolve(Object.freeze(a))}),d.promise}#bS(a){let b=this.#bQ,c=[...b],e=[],f=[];try{for(let c of a){let a;if("delete"!==c.type&&"put"!==c.type)throw j.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if("delete"===c.type&&null!=c.response)throw j.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#bT(c.request,c.options,e).length)throw new DOMException("???","InvalidStateError");if("delete"===c.type){if(a=this.#bT(c.request,c.options),0===a.length)return[];for(let c of a){let a=b.indexOf(c);d(-1!==a),b.splice(a,1)}}else if("put"===c.type){if(null==c.response)throw j.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let f=c.request;if(!r(f.url))throw j.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if("GET"!==f.method)throw j.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(null!=c.options)throw j.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});for(let e of a=this.#bT(c.request)){let a=b.indexOf(e);d(-1!==a),b.splice(a,1)}b.push([c.request,c.response]),e.push([c.request,c.response])}f.push([c.request,c.response])}return f}catch(a){throw this.#bQ.length=0,this.#bQ=c,a}}#bT(a,b,c){let d=[];for(let e of c??this.#bQ){let[c,f]=e;this.#bU(a,c,f,b)&&d.push(e)}return d}#bU(a,b,c=null,d){let e=new URL(a.url),h=new URL(b.url);if(d?.ignoreSearch&&(h.search="",e.search=""),!f(e,h,!0))return!1;if(null==c||d?.ignoreVary||!c.headersList.contains("vary"))return!0;for(let d of g(c.headersList.get("vary")))if("*"===d||b.headersList.get(d)!==a.headersList.get(d))return!1;return!0}#bR(a,b,c=1/0){let d=null;if(void 0!==a)if(j.is.Request(a)){if("GET"!==(d=p(a)).method&&!b.ignoreMethod)return[]}else"string"==typeof a&&(d=p(new n(a)));let e=[];if(void 0===a)for(let a of this.#bQ)e.push(a[1]);else for(let a of this.#bT(d,b))e.push(a[1]);let f=[];for(let a of e){let b=l(k(a),"immutable");if(f.push(b),f.length>=c)break}return Object.freeze(f)}static{j.is.Cache=a=>null!=a&&"object"==typeof a&&#bQ in a}}Object.defineProperties(t.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:h,matchAll:h,add:h,addAll:h,put:h,delete:h,keys:h});let u=[{key:"ignoreSearch",converter:j.converters.boolean,defaultValue:()=>!1},{key:"ignoreMethod",converter:j.converters.boolean,defaultValue:()=>!1},{key:"ignoreVary",converter:j.converters.boolean,defaultValue:()=>!1}];j.converters.CacheQueryOptions=j.dictionaryConverter(u),j.converters.MultiCacheQueryOptions=j.dictionaryConverter([...u,{key:"cacheName",converter:j.converters.DOMString}]),j.converters.Response=j.interfaceConverter(j.is.Response,"Response"),j.converters["sequence<RequestInfo>"]=j.sequenceConverter(j.converters.RequestInfo),a.exports={Cache:t}},50294:(a,b,c)=>{"use strict";c.d(b,{R:()=>j});var d=c(88164),e=c(30395),f=c(48991),g=c(11484);let h="QwenCode/0.12.3 (linux; x64)",i={role:"system",content:[{type:"text",text:"",cache_control:{type:"ephemeral"}}]};class j extends d.L{constructor(){super("qwen")}buildUrl(a,b,c=0,d=null){let e=d?.providerSpecificData?.resourceUrl,f=e?e.replace(/^https?:\/\//,"").replace(/\/$/,""):"portal.qwen.ai";return`https://${f}/v1/chat/completions`}buildHeaders(a,b=!0){return function(a,b=!0){let c=a?.apiKey||a?.accessToken||"",d={"Content-Type":"application/json",Authorization:`Bearer ${c}`,"User-Agent":h,"X-DashScope-AuthType":"qwen-oauth","X-DashScope-CacheControl":"enable","X-DashScope-UserAgent":h,"X-Stainless-Arch":"x64","X-Stainless-Lang":"js","X-Stainless-Os":"Linux","X-Stainless-Package-Version":"5.11.0","X-Stainless-Retry-Count":"1","X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":"v18.19.1",Connection:"keep-alive","Accept-Language":"*","Sec-Fetch-Mode":"cors"};return d.Accept=b?"text/event-stream":"application/json",d}(a,b)}transformRequest(a,b,c,d){let e=b&&"object"==typeof b?{...b}:b;c&&e?.messages&&!e.stream_options&&!e.thinking&&!e.enable_thinking&&!1!==e.stream&&(e.stream_options={include_usage:!0});var f=e=function(a){let b;if(!0!==(b=a?.thinking)&&a?.enable_thinking!==!0&&("object"!=typeof b||null===b||Array.isArray(b)||"enabled"!==b.type))return a;let c=a.tool_choice;return"required"!==c&&("object"!=typeof c||null===c)?a:{...a,tool_choice:"auto"}}(e);if(!f||"object"!=typeof f)return f;let g={...f};return Array.isArray(g.messages)?g.messages=[i,...g.messages]:g.messages=[i],g}async refreshCredentials(a,b){if(!a?.refreshToken)return null;try{let c=await fetch(f.NA.qwen.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a.refreshToken,client_id:e.xq.qwen.clientId})});if(!c.ok)return await (0,g.aI)(c),null;let d=await c.json();return b?.info?.("TOKEN","qwen refreshed"),{accessToken:d.access_token,refreshToken:d.refresh_token||a.refreshToken,expiresIn:d.expires_in,providerSpecificData:{...a.providerSpecificData||{},...d.resource_url?{resourceUrl:d.resource_url}:{}}}}catch(a){return b?.error?.("TOKEN",`qwen refresh error: ${a.message}`),null}}}},50329:a=>{"use strict";class b{bottom=0;top=0;list=Array(2048).fill(void 0);next=null;isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(a){this.list[this.top]=a,this.top=this.top+1&2047}shift(){let a=this.list[this.bottom];return void 0===a?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,a)}}a.exports=class{constructor(){this.head=this.tail=new b}isEmpty(){return this.head.isEmpty()}push(a){this.head.isFull()&&(this.head=this.head.next=new b),this.head.push(a)}shift(){let a=this.tail,b=a.shift();return a.isEmpty()&&null!==a.next&&(this.tail=a.next,a.next=null),b}}},50570:(a,b,c)=>{"use strict";c(42541)},50743:(a,b,c)=>{"use strict";function d(a,b=null){if(null==a)return b;if("string"!=typeof a)return a;try{return JSON.parse(a)}catch{return b}}function e(a){return JSON.stringify(a??null)}c.d(b,{q:()=>d,s:()=>e})},51047:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"bai",alias:"bai",aliases:["b-ai"],category:"apikey",authModes:["apikey"],passthroughModels:!0,modelsFetcher:{url:"https://api.b.ai/v1/models",type:"openai"},display:{name:"B.AI",icon:"account_balance",color:"#0369A1",textIcon:"BA",website:"https://b.ai",notice:{text:"OpenAI-compatible gateway. Model ids are fetched live after a key is saved.",apiKeyUrl:"https://b.ai"}},transport:{baseUrl:"https://api.b.ai/v1/chat/completions",validateUrl:"https://api.b.ai/v1/models",format:"openai"},models:[],serviceKinds:["llm"]}},51091:(a,b,c)=>{"use strict";c.d(b,{MB:()=>f});let d=/^[A-Za-z0-9-]+$/,e=new Set(["host","content-length","content-type","connection","transfer-encoding","authorization","cookie"]);function f(a,b){let c=b?.headers;if(!a||!c||"object"!=typeof c||Array.isArray(c))return a;for(let[b,f]of Object.entries(c))!d.test(b)||"string"!=typeof f||0===f.length||/[\r\n]/.test(f)||f.length>8192||e.has(b.toLowerCase())||(a[b]=f);return a}},51525:(a,b,c)=>{"use strict";c(76816)},51529:(a,b,c)=>{},51590:(a,b,c)=>{"use strict";var d=c(42541);c(21904),d.h.GEMINI,d.h.GEMINI_CLI,d.h.VERTEX,d.h.ANTIGRAVITY,d.h.OLLAMA,d.h.KIRO,d.h.COMMANDCODE},51658:(a,b,c)=>{"use strict";c(42541),c(85450),c(43212),c(11484),c(64323),c(83651),c(72610),c(51525),c(1899)},51705:(a,b,c)=>{"use strict";a.exports=c.p+"static/media/server.b857786a.js"},51753:(a,b,c)=>{"use strict";let d,{webidl:e}=c(32984),{kEnumerableProperty:f}=c(84285),{kConstruct:g}=c(49176);class h extends Event{#bV;constructor(a,b={}){if(a===g){super(arguments[1],arguments[2]),e.util.markAsUncloneable(this);return}let c="MessageEvent constructor";e.argumentLengthCheck(arguments,1,c),super(a=e.converters.DOMString(a,c,"type"),b=e.converters.MessageEventInit(b,c,"eventInitDict")),this.#bV=b,e.util.markAsUncloneable(this)}get data(){return e.brandCheck(this,e.is.MessageEvent),this.#bV.data}get origin(){return e.brandCheck(this,e.is.MessageEvent),this.#bV.origin}get lastEventId(){return e.brandCheck(this,e.is.MessageEvent),this.#bV.lastEventId}get source(){return e.brandCheck(this,e.is.MessageEvent),this.#bV.source}get ports(){return e.brandCheck(this,e.is.MessageEvent),Object.isFrozen(this.#bV.ports)||Object.freeze(this.#bV.ports),this.#bV.ports}initMessageEvent(a,b=!1,c=!1,d=null,f="",g="",i=null,j=[]){return e.brandCheck(this,e.is.MessageEvent),e.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new h(a,{bubbles:b,cancelable:c,data:d,origin:f,lastEventId:g,source:i,ports:j})}static{d=(a,b)=>{let c=new h(g,a,b);return c.#bV=b,c.#bV.data??=null,c.#bV.origin??="",c.#bV.lastEventId??="",c.#bV.source??=null,c.#bV.ports??=[],c},e.is.MessageEvent=a=>null!=a&&"object"==typeof a&&#bV in a}}class i extends Event{#bV;constructor(a,b={}){let c="CloseEvent constructor";e.argumentLengthCheck(arguments,1,c),super(a=e.converters.DOMString(a,c,"type"),b=e.converters.CloseEventInit(b)),this.#bV=b,e.util.markAsUncloneable(this)}get wasClean(){return e.brandCheck(this,e.is.CloseEvent),this.#bV.wasClean}get code(){return e.brandCheck(this,e.is.CloseEvent),this.#bV.code}get reason(){return e.brandCheck(this,e.is.CloseEvent),this.#bV.reason}static{e.is.CloseEvent=a=>null!=a&&"object"==typeof a&&#bV in a}}class j extends Event{#bV;constructor(a,b){let c="ErrorEvent constructor";e.argumentLengthCheck(arguments,1,c),super(a,b),e.util.markAsUncloneable(this),a=e.converters.DOMString(a,c,"type"),b=e.converters.ErrorEventInit(b??{}),this.#bV=b}get message(){return e.brandCheck(this,e.is.ErrorEvent),this.#bV.message}get filename(){return e.brandCheck(this,e.is.ErrorEvent),this.#bV.filename}get lineno(){return e.brandCheck(this,e.is.ErrorEvent),this.#bV.lineno}get colno(){return e.brandCheck(this,e.is.ErrorEvent),this.#bV.colno}get error(){return e.brandCheck(this,e.is.ErrorEvent),this.#bV.error}static{e.is.ErrorEvent=a=>null!=a&&"object"==typeof a&&#bV in a}}Object.defineProperties(h.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:f,origin:f,lastEventId:f,source:f,ports:f,initMessageEvent:f}),Object.defineProperties(i.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:f,code:f,wasClean:f}),Object.defineProperties(j.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:f,filename:f,lineno:f,colno:f,error:f}),e.converters.MessagePort=e.interfaceConverter(e.is.MessagePort,"MessagePort"),e.converters["sequence<MessagePort>"]=e.sequenceConverter(e.converters.MessagePort);let k=[{key:"bubbles",converter:e.converters.boolean,defaultValue:()=>!1},{key:"cancelable",converter:e.converters.boolean,defaultValue:()=>!1},{key:"composed",converter:e.converters.boolean,defaultValue:()=>!1}];e.converters.MessageEventInit=e.dictionaryConverter([...k,{key:"data",converter:e.converters.any,defaultValue:()=>null},{key:"origin",converter:e.converters.USVString,defaultValue:()=>""},{key:"lastEventId",converter:e.converters.DOMString,defaultValue:()=>""},{key:"source",converter:e.nullableConverter(e.converters.MessagePort),defaultValue:()=>null},{key:"ports",converter:e.converters["sequence<MessagePort>"],defaultValue:()=>[]}]),e.converters.CloseEventInit=e.dictionaryConverter([...k,{key:"wasClean",converter:e.converters.boolean,defaultValue:()=>!1},{key:"code",converter:e.converters["unsigned short"],defaultValue:()=>0},{key:"reason",converter:e.converters.USVString,defaultValue:()=>""}]),e.converters.ErrorEventInit=e.dictionaryConverter([...k,{key:"message",converter:e.converters.DOMString,defaultValue:()=>""},{key:"filename",converter:e.converters.USVString,defaultValue:()=>""},{key:"lineno",converter:e.converters["unsigned long"],defaultValue:()=>0},{key:"colno",converter:e.converters["unsigned long"],defaultValue:()=>0},{key:"error",converter:e.converters.any}]),a.exports={MessageEvent:h,CloseEvent:i,ErrorEvent:j,createFastMessageEvent:d}},52039:(a,b,c)=>{"use strict";let d,{isArrayBuffer:e}=c(73429),{webidl:f}=c(32984),{URLSerializer:g}=c(16537),{environmentSettingsObject:h}=c(42425),{staticPropertyDescriptors:i,states:j,sentCloseFrameState:k,sendHints:l,opcodes:m}=c(62026),{isConnecting:n,isEstablished:o,isClosing:p,isClosed:q,isValidSubprotocol:r,fireEvent:s,utf8Decode:t,toArrayBuffer:u,getURLRecord:v}=c(94050),{establishWebSocketConnection:w,closeWebSocketConnection:x,failWebsocketConnection:y}=c(4654),{ByteParser:z}=c(64821),{kEnumerableProperty:A}=c(84285),{getGlobalDispatcher:B}=c(59970),{ErrorEvent:C,CloseEvent:D,createFastMessageEvent:E}=c(51753),{SendQueue:F}=c(54849),{WebsocketFrameSend:G}=c(45221),{channels:H}=c(62571),I=Symbol.for("nodejs.ref"),J=Symbol.for("nodejs.unref");class K extends EventTarget{#bG={open:null,error:null,close:null,message:null};#bW=0;#bX="";#bY="";#bZ=!0;#b$;#a$={onConnectionEstablished:(a,b)=>this.#a_(a,b),onMessage:(a,b)=>this.#a0(a,b),onParserError:a=>y(this.#a$,null,a.message),onParserDrain:()=>this.#b_(),onSocketData:a=>{this.#a1.write(a)||this.#a$.socket.pause()},onSocketError:a=>{this.#a$.readyState=j.CLOSING,H.socketError.hasSubscribers&&H.socketError.publish(a),this.#a$.socket.destroy()},onSocketClose:()=>this.#a2(),onPing:a=>{H.ping.hasSubscribers&&H.ping.publish({payload:a,websocket:this})},onPong:a=>{H.pong.hasSubscribers&&H.pong.publish({payload:a,websocket:this})},readyState:j.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#aT;#b0;#a1;constructor(a,b=[]){super(),f.util.markAsUncloneable(this);let c="WebSocket constructor";f.argumentLengthCheck(arguments,1,c);let d=f.converters["DOMString or sequence<DOMString> or WebSocketInit"](b,c,"options");a=f.converters.USVString(a),b=d.protocols;let e=v(a,h.settingsObject.baseUrl);if("string"==typeof b&&(b=[b]),b.length!==new Set(b.map(a=>a.toLowerCase())).size||b.length>0&&!b.every(a=>r(a)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#aT=new URL(e.href);let g=h.settingsObject;this.#a$.controller=w(e,b,g,this.#a$,d),this.#a$.readyState=K.CONNECTING,this.#b0="blob"}[I](){this.#bZ=!0,this.#a$.socket?.ref?.()}[J](){this.#bZ=!1,this.#a$.socket?.unref?.()}close(a,b){f.brandCheck(this,f.is.WebSocket),void 0!==a&&(a=f.converters["unsigned short"](a,"WebSocket.close","code",f.attributes.Clamp)),void 0!==b&&(b=f.converters.USVString(b)),a??=null,b??="",x(this.#a$,a,b,!0)}send(a){f.brandCheck(this,f.is.WebSocket);let b="WebSocket.send";if(f.argumentLengthCheck(arguments,1,b),a=f.converters.WebSocketSendData(a,b,"data"),n(this.#a$.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!o(this.#a$.readyState)||p(this.#a$.readyState)))if("string"==typeof a){let b=Buffer.from(a);this.#bW+=b.byteLength,this.#b$.add(b,()=>{this.#bW-=b.byteLength},l.text)}else e(a)?(this.#bW+=a.byteLength,this.#b$.add(a,()=>{this.#bW-=a.byteLength},l.arrayBuffer)):ArrayBuffer.isView(a)?(this.#bW+=a.byteLength,this.#b$.add(a,()=>{this.#bW-=a.byteLength},l.typedArray)):f.is.Blob(a)&&(this.#bW+=a.size,this.#b$.add(a,()=>{this.#bW-=a.size},l.blob))}get readyState(){return f.brandCheck(this,f.is.WebSocket),this.#a$.readyState}get bufferedAmount(){return f.brandCheck(this,f.is.WebSocket),this.#bW}get url(){return f.brandCheck(this,f.is.WebSocket),g(this.#aT)}get extensions(){return f.brandCheck(this,f.is.WebSocket),this.#bY}get protocol(){return f.brandCheck(this,f.is.WebSocket),this.#bX}get onopen(){return f.brandCheck(this,f.is.WebSocket),this.#bG.open}set onopen(a){f.brandCheck(this,f.is.WebSocket),this.#bG.open&&this.removeEventListener("open",this.#bG.open);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("open",b),this.#bG.open=a):this.#bG.open=null}get onerror(){return f.brandCheck(this,f.is.WebSocket),this.#bG.error}set onerror(a){f.brandCheck(this,f.is.WebSocket),this.#bG.error&&this.removeEventListener("error",this.#bG.error);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("error",b),this.#bG.error=a):this.#bG.error=null}get onclose(){return f.brandCheck(this,f.is.WebSocket),this.#bG.close}set onclose(a){f.brandCheck(this,f.is.WebSocket),this.#bG.close&&this.removeEventListener("close",this.#bG.close);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("close",b),this.#bG.close=a):this.#bG.close=null}get onmessage(){return f.brandCheck(this,f.is.WebSocket),this.#bG.message}set onmessage(a){f.brandCheck(this,f.is.WebSocket),this.#bG.message&&this.removeEventListener("message",this.#bG.message);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("message",b),this.#bG.message=a):this.#bG.message=null}get binaryType(){return f.brandCheck(this,f.is.WebSocket),this.#b0}set binaryType(a){f.brandCheck(this,f.is.WebSocket),"blob"!==a&&"arraybuffer"!==a?this.#b0="blob":this.#b0=a}#a_(a,b){this.#a$.socket=a.socket,this.#bZ||this.#a$.socket.unref?.();let c=this.#a$.controller.dispatcher?.webSocketOptions?.maxFragments,d=this.#a$.controller.dispatcher?.webSocketOptions?.maxPayloadSize,e=new z(this.#a$,b,{maxFragments:c,maxPayloadSize:d});e.on("drain",()=>this.#a$.onParserDrain()),e.on("error",a=>this.#a$.onParserError(a)),this.#a1=e,this.#b$=new F(a.socket),this.#a$.readyState=j.OPEN;let f=a.headersList.get("sec-websocket-extensions");null!==f&&(this.#bY=f);let g=a.headersList.get("sec-websocket-protocol");if(null!==g&&(this.#bX=g),s("open",this),H.open.hasSubscribers){var h;let b=a.headersList.entries;H.open.publish({address:(h=a.socket,"function"==typeof h?.address?h.address():"function"==typeof h?.session?.socket?.address?h.session.socket.address():null),protocol:this.#bX,extensions:this.#bY,websocket:this,handshakeResponse:{status:a.status,statusText:a.statusText,headers:b}})}}#a0(a,b){let c;if(this.#a$.readyState===j.OPEN){if(a===m.TEXT)try{c=t(b)}catch{y(this.#a$,1007,"Received invalid UTF-8 in text frame.");return}else a===m.BINARY&&(c="blob"===this.#b0?new Blob([b]):u(b));s("message",this,E,{origin:this.#aT.origin,data:c})}}#b_(){this.#a$.socket.resume()}#a2(){let a=this.#a$.closeState.has(k.SENT)&&this.#a$.closeState.has(k.RECEIVED),b=1005,c="",d=this.#a1?.closingInfo;d&&!d.error&&(b=d.code??1005,c=d.reason),this.#a$.readyState=j.CLOSED,this.#a$.closeState.has(k.RECEIVED)||(b=1006,s("error",this,(a,b)=>new C(a,b),{error:TypeError(c)})),s("close",this,(a,b)=>new D(a,b),{wasClean:a,code:b,reason:c}),H.close.hasSubscribers&&H.close.publish({websocket:this,code:b,reason:c})}static{d=(a,b)=>{if(Buffer.isBuffer(b)){if(b.length>125)throw TypeError("A PING frame cannot have a body larger than 125 bytes.")}else if(void 0!==b)throw TypeError("Expected buffer payload");let c=a.#a$.readyState;if(o(c)&&!p(c)&&!q(c)){let c=new G(b);a.#a$.socket.write(c.createFrame(m.PING))}},f.is.WebSocket=a=>null!=a&&"object"==typeof a&&#a$ in a}}K.CONNECTING=K.prototype.CONNECTING=j.CONNECTING,K.OPEN=K.prototype.OPEN=j.OPEN,K.CLOSING=K.prototype.CLOSING=j.CLOSING,K.CLOSED=K.prototype.CLOSED=j.CLOSED,Object.defineProperties(K.prototype,{CONNECTING:i,OPEN:i,CLOSING:i,CLOSED:i,url:A,readyState:A,bufferedAmount:A,onopen:A,onerror:A,onclose:A,close:A,onmessage:A,binaryType:A,send:A,extensions:A,protocol:A,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}}),Object.defineProperties(K,{CONNECTING:i,OPEN:i,CLOSING:i,CLOSED:i}),f.converters["sequence<DOMString>"]=f.sequenceConverter(f.converters.DOMString),f.converters["DOMString or sequence<DOMString>"]=function(a,b,c){return f.util.Type(a)===f.util.Types.OBJECT&&Symbol.iterator in a?f.converters["sequence<DOMString>"](a):f.converters.DOMString(a,b,c)},f.converters.WebSocketInit=f.dictionaryConverter([{key:"protocols",converter:f.converters["DOMString or sequence<DOMString>"],defaultValue:()=>[]},{key:"dispatcher",converter:f.converters.any,defaultValue:()=>B()},{key:"headers",converter:f.nullableConverter(f.converters.HeadersInit)}]),f.converters["DOMString or sequence<DOMString> or WebSocketInit"]=function(a){return f.util.Type(a)!==f.util.Types.OBJECT||Symbol.iterator in a?{protocols:f.converters["DOMString or sequence<DOMString>"](a)}:f.converters.WebSocketInit(a)},f.converters.WebSocketSendData=function(a){return f.util.Type(a)===f.util.Types.OBJECT&&(f.is.Blob(a)||f.is.BufferSource(a))?a:f.converters.USVString(a)},a.exports={WebSocket:K,ping:d}},52825:(a,b,c)=>{"use strict";c.d(b,{y5:()=>m,cK:()=>l});var d=c(62239);function e(a){return"string"==typeof a&&a.includes("\0")?a.replace(/\0/g,""):a}global._dbAdapter||(global._dbAdapter={instance:null,initPromise:null,closePromise:null,logged:!1});let f=global._dbAdapter;async function g(){if(!process.versions.bun)return null;try{let{createBunSqliteAdapter:a}=await c.e(8062).then(c.bind(c,38062));return await a(d.AL)}catch(a){return console.warn(`[DB] bun:sqlite unavailable: ${a.message}`),null}}async function h(){if(process.versions.bun)return null;try{let{createBetterSqliteAdapter:a}=await c.e(8469).then(c.bind(c,88469));return a(d.AL)}catch(a){return console.warn(`[DB] better-sqlite3 unavailable: ${a.message}`),null}}async function i(){if(process.versions.bun)return null;let[a,b]=process.versions.node.split(".").map(Number);if(a<22||22===a&&b<5)return null;try{let{createNodeSqliteAdapter:a}=await c.e(4803).then(c.bind(c,54803));return await a(d.AL)}catch(a){return console.warn(`[DB] node:sqlite unavailable: ${a.message}`),null}}async function j(){try{let{createSqlJsAdapter:a}=await c.e(6252).then(c.bind(c,66252));return await a(d.AL)}catch(a){return console.warn(`[DB] sql.js unavailable: ${a.message}`),null}}async function k(){var a;let b;(0,d.Jh)();let k=await g();if(k||(k=await i()),k||(k=await h()),k||(k=await j()),!k)throw Error("[DB] No SQLite driver available (bun/node/better/sql.js all failed)");for(let c of(a=k,b=a=>Array.isArray(a)?a.map(e):a,k={...a,run:(c,d=[])=>a.run(c,b(d)),get:(c,d=[])=>a.get(c,b(d)),all:(c,d=[])=>a.all(c,b(d))},f.logged||(console.log(`[DB] Driver: ${k.driver} | file: ${d.AL}`),f.logged=!0),[d.AL,`${d.AL}-wal`,`${d.AL}-shm`]))(0,d.lo)(c);try{let{runMigrationOnce:a}=await c.e(7210).then(c.bind(c,24829));await a(k);let{runStartupMaintenanceOnce:b}=await c.e(281).then(c.bind(c,281));return b(k),k}catch(a){try{await k.close?.()}catch(a){console.warn(`[DB] failed to close partially initialized adapter: ${a.message}`)}throw a}}async function l(){if(f.instance)return f.instance;if(!f.initPromise){let a=k().then(a=>(f.instance=a,a)).catch(b=>{throw f.initPromise===a&&(f.initPromise=null),b});f.initPromise=a}return f.initPromise}async function m(){return f.closePromise||(f.closePromise=(async()=>{try{let{stopStartupMaintenance:a}=await c.e(281).then(c.bind(c,281));a();let b=f.instance||(f.initPromise?await f.initPromise:null);await b?.close?.()}finally{f.instance=null,f.initPromise=null,f.closePromise=null}})()),f.closePromise}"closePromise"in f||(f.closePromise=null)},53552:(a,b,c)=>{"use strict";let{InvalidArgumentError:d}=c(61448),e=c(40106);class f extends e{constructor(a,b){if("string"==typeof a&&(a=new URL(a)),"http:"!==a.protocol)throw new d("h2c-client: Only h2c protocol is supported");let{maxConcurrentStreams:c,pipelining:e,...f}=b??{},g=c??100,h=100;if(null!=c&&(!Number.isInteger(c)||c<1))throw new d("maxConcurrentStreams must be a positive integer, greater than 0");if(null!=e&&Number.isInteger(e)&&e>0&&(h=e),h>g)throw new d("h2c-client: pipelining cannot be greater than maxConcurrentStreams");super(a,{...f,maxConcurrentStreams:g,pipelining:h,allowH2:!0,useH2c:!0})}}a.exports=f},53859:(a,b,c)=>{"use strict";c.d(b,{n:()=>l});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j="zevai";function k(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),j):g().join(i().homedir(),`.${j}`)}let l=function(){let a=process.env.DATA_DIR;if(!a)return k();try{return e().mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${j}`),k();throw b}}()},54027:(a,b,c)=>{"use strict";c(29565)},54838:(a,b,c)=>{"use strict";c.d(b,{$D:()=>x,Oj:()=>g,P9:()=>s,QR:()=>j,VE:()=>o,We:()=>k,Y2:()=>m,ZF:()=>t,Zm:()=>f,aZ:()=>F,cr:()=>D,h3:()=>h,rG:()=>r,rx:()=>i,vR:()=>B,yh:()=>E});let d="-agentic",e="-thinking",f=64,g=10237,h=64,i="AmazonCodeWhispererStreamingService.GenerateAssistantResponse",j=new Set([401,403,404]);function k(a){return"google"===a||"github"===a?"arn:aws:codewhisperer:us-east-1:699475941385:profile/EHGA3GRVQMUK":"arn:aws:codewhisperer:us-east-1:638616132270:profile/AAAACCCCXXXX"}let l={minimal:512,low:1024,medium:8192,high:24576,xhigh:32768,max:128e3},m=process.env.ZEVAI_KIRO_IDE_VERSION||"1.4.154";process.env.ZEVAI_KIRO_CLI_VERSION;let n="1.0.0";function o(a){return{userAgent:`aws-sdk-js/${n} ua/2.1 os/windows#10.0.26200 lang/js md/nodejs#22.21.1 api/codewhispererruntime#${n} m/N,E KiroIDE-${m}-${a}`,amzUserAgent:`aws-sdk-js/${n} KiroIDE-${m}-${a}`}}let p=new Set(["1","true","yes","on"]),q=new Set(["0","false","no","off"]),r=`
253
253
  # CRITICAL: CHUNKED WRITE PROTOCOL (MANDATORY)
254
254
 
255
255
  You MUST follow these rules for ALL file operations. Violation causes server timeouts and task failure.
@@ -299,7 +299,7 @@ WRONG: Generating massive code blocks without chunking -> TIMEOUT
299
299
 
300
300
  REMEMBER: When in doubt, write LESS per operation. Multiple small operations > one large operation.
301
301
  `.trim();function s(a,b,c){if(function(a){if(!a||"object"!=typeof a)return!1;let b=a.thinking;if(b&&"object"==typeof b&&"disabled"===b.type)return!0;let c=a.reasoning_effort??a.output_config?.effort??(a.reasoning&&"object"==typeof a.reasoning?a.reasoning.effort:null);return"string"==typeof c&&["none","off","disabled"].includes(c.toLowerCase())}(a))return null;let d=a?.output_config?.effort;if("string"==typeof d){let a=l[d.toLowerCase()];if(a)return a}let e=a?.thinking,f=e&&"object"==typeof e?e.type:null,g="enabled"===f||"adaptive"===f;if(g){let a=Number(e.budget_tokens);if(Number.isFinite(a)&&a>0)return a}let h=a?.reasoning_effort??(a?.reasoning&&"object"==typeof a.reasoning?a.reasoning.effort:null);if("string"==typeof h){let a=h.toLowerCase();if("auto"===a)return l.medium;let b=l[a];if(b)return b}if(g)return 16e3;if(b){let a=function(a,b){if(!a)return;if("function"==typeof a.get)return a.get(b);let c=b.toLowerCase();for(let b of Object.keys(a))if(b.toLowerCase()===c)return a[b]}(b,"anthropic-beta");if("string"==typeof a&&a.toLowerCase().includes("interleaved-thinking"))return 16e3}if(function(a){for(let b of Array.isArray(a?.messages)?a.messages:[]){if(!b||"system"!==b.role&&"user"!==b.role)continue;let a=b.content;if("string"==typeof a){if(G(a))return!0}else if(Array.isArray(a))for(let b of a){let a=b?.text;if("string"==typeof a&&G(a))return!0}}return!!("string"==typeof a?.system&&G(a.system))}(a))return 16e3;if("string"==typeof c&&c){let a=c.toLowerCase();if(a.includes("thinking")||a.includes("-reason"))return 16e3}return null}function t(a,b=!1){let c=I(H(a?.kiro_expose_reasoning,a?.kiroExposeReasoning,a?.metadata?.kiro_expose_reasoning,a?.metadata?.kiroExposeReasoning,a?.extra_body?.kiro_expose_reasoning,a?.extra_body?.kiroExposeReasoning));if(null!==c)return c;let d="u">typeof process?process.env:{},e=I(H(d.KIRO_EXPOSE_REASONING,d.ZEVAI_EXPOSE_REASONING));return null!==e?e:!0===b}function u(a){return"string"==typeof a&&a.endsWith(d)}function v(a){return"string"==typeof a&&a.endsWith(e)}let w=/-\d{8}$/;function x(a){var b,c;let f=a,g=!1,h=!1;return u(f)&&(g=!0,f=u(b=f)?b.slice(0,-d.length):b),v(f)&&(h=!0,f=v(c=f)?c.slice(0,-e.length):c),{upstream:function(a){if("string"!=typeof a||""===a)return a;let b=a.toLowerCase().replace(w,"");if(b.includes("sonnet"))return b.includes("5.5")||b.includes("5-5")?"claude-sonnet-5.5":b.includes("4.6")||b.includes("4-6")?"claude-sonnet-4.6":b.includes("sonnet-5")||b.includes("sonnet.5")?"claude-sonnet-5":b.includes("4.5")||b.includes("4-5")?"claude-sonnet-4.5":b.includes("sonnet-4")||b.includes("sonnet.4")?"claude-sonnet-4":"claude-sonnet-4.5";if(b.includes("fable"))return"claude-fable-5";if(b.includes("opus"))return b.includes("5.5")||b.includes("5-5")?"claude-opus-5.5":b.includes("opus-5")||b.includes("opus.5")||b.includes("opus 5")?"claude-opus-5":b.includes("4.8")||b.includes("4-8")?"claude-opus-4.8":b.includes("4.7")||b.includes("4-7")?"claude-opus-4.7":b.includes("4.5")||b.includes("4-5")?"claude-opus-4.5":"claude-opus-4.6";if(b.includes("haiku"))return b.includes("5.5")||b.includes("5-5")?"claude-haiku-5.5":"claude-haiku-4.5";if("auto"===b)return"auto";if("deepseek-3.2"===b||"glm-5"===b||"qwen3-coder-next"===b||"kimi-k3"===b||"minimax-m2.5"===b||"minimax-m2.1"===b||"gpt-5.6-sol"===b||"gpt-5.6-terra"===b||"gpt-5.6-luna"===b)return b;if(b.includes("gpt")){if(b.includes("terra"))return"gpt-5.6-terra";if(b.includes("luna"))return"gpt-5.6-luna";if(b.includes("sol")||b.includes("5.6")||b.includes("5-6"))return"gpt-5.6-sol"}return a}(f),agentic:g,thinking:h}}function y(a){let b=a?.output_config?.effort??a?.reasoning_effort??("object"==typeof a?.reasoning?a.reasoning.effort:null);if("string"!=typeof b)return null;let c=b.toLowerCase();return c&&"none"!==c&&"off"!==c&&"disabled"!==c?"auto"===c?"medium":c:null}function z(a){if("string"!=typeof a)return null;let b=a.toLowerCase().replace(/-/g,".").match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);return b?{major:Number(b[1]),minor:void 0===b[2]?null:Number(b[2])}:null}function A(a){let b=y(a);return b?"max"===b?"xhigh":["low","medium","high","xhigh"].includes(b)?b:null:null}function B(a,b,{force:c=!1}={}){if(!a||"object"!=typeof a||!C(b))return a;let d=a.output_config?.effort??a.reasoning_effort??("object"==typeof a.reasoning?a.reasoning.effort:null);if("string"==typeof d&&""!==d.trim())return a;let e=a.thinking?.type==="adaptive";return c||e?{...a,reasoning_effort:e?"high":"medium"}:a}function C(a){if("string"!=typeof a)return null;let b=a.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(b))return"reasoning";if(!b.includes("claude"))return null;let c=z(a);if(!c)return null;let{major:d,minor:e}=c;return d<4||4===d&&(null===e||e<=5||null!==e&&e>=1e3)?null:"output_config"}function D(a,b){return"reasoning"===C(b)&&null!==A(a)}function E(a,b){let c=C(b);if(!c)return;if("reasoning"===c){let b=A(a);return b?{reasoning:{effort:b}}:void 0}let d=function(a,b){let c=y(a);if(!c)return null;if("xhigh"===c){let a;return(a=z(b))&&(4!==a.major||null===a.minor||!(a.minor<=6))?"xhigh":"high"}return"max"===c?"max":["low","medium","high"].includes(c)?c:null}(a,b);return d?{thinking:{type:"adaptive",display:"summarized"},output_config:{effort:d}}:void 0}function F(a=16e3){let b=Math.max(1,Math.min(32e3,Number(a)||16e3));return`<thinking_mode>enabled</thinking_mode>
302
- <max_thinking_length>${b}</max_thinking_length>`}function G(a){return!!a&&!!a.includes("<thinking_mode>")&&(a.includes("<thinking_mode>enabled</thinking_mode>")||a.includes("<thinking_mode>interleaved</thinking_mode>"))}function H(...a){return a.find(a=>null!=a)}function I(a){if("boolean"==typeof a)return a;if("number"==typeof a)return 1===a||0!==a&&null;if("string"!=typeof a)return null;let b=a.trim().toLowerCase();return!!p.has(b)||!q.has(b)&&null}},54849:(a,b,c)=>{"use strict";let{WebsocketFrameSend:d}=c(45221),{opcodes:e,sendHints:f}=c(62026),g=c(50329);class h{#b_=new g;#b0=!1;#b1;constructor(a){this.#b1=a}add(a,b,c){if(c!==f.blob){if(this.#b0){let d={promise:null,callback:b,frame:i(a,c)};this.#b_.push(d)}else if(c===f.text){let{0:c,1:e}=d.createFastTextFrame(a);this.#b1.cork(),this.#b1.write(c),this.#b1.write(e,b),this.#b1.uncork()}else this.#b1.write(i(a,c),b);return}let e={promise:a.arrayBuffer().then(a=>{e.promise=null,e.frame=i(a,c)}),callback:b,frame:null};this.#b_.push(e),this.#b0||this.#b2()}async #b2(){this.#b0=!0;let a=this.#b_;for(;!a.isEmpty();){let b=a.shift();null!==b.promise&&await b.promise,this.#b1.write(b.frame,b.callback),b.callback=b.frame=null}this.#b0=!1}}function i(a,b){return new d(function(a,b){switch(b){case f.text:case f.typedArray:return new Uint8Array(a.buffer,a.byteOffset,a.byteLength);case f.arrayBuffer:case f.blob:return new Uint8Array(a)}}(a,b)).createFrame(b===f.text?e.TEXT:e.BINARY)}a.exports={SendQueue:h}},54913:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"runcrate",alias:"runcrate",aliases:["rc"],category:"apikey",authModes:["apikey"],passthroughModels:!0,display:{name:"Runcrate",icon:"terminal",color:"#1A2B79",textIcon:"RC",website:"https://www.runcrate.ai",notice:{apiKeyUrl:"https://www.runcrate.ai/dashboard/api-keys"}},transport:{baseUrl:"https://api.runcrate.ai/v1/chat/completions",validateUrl:"https://www.runcrate.ai/api/v1/billing/balance",format:"openai"},models:[{id:"deepseek-ai/DeepSeek-V4.1-Flash",name:"DeepSeek V4.1 Flash"},{id:"deepseek-ai/DeepSeek-V4.1-Flash-1017",name:"DeepSeek V4.1 Flash 1017"},{id:"zai-org/GLM-5.3",name:"GLM 5.3"},{id:"zai-org/GLM-5.3-Flash",name:"GLM 5.3 Flash"},{id:"Qwen/Qwen3.8-Flash",name:"Qwen3.8 Flash"},{id:"openai/gpt-oss-120b",name:"gpt-oss 120B"}],serviceKinds:["llm"]}},54940:(a,b,c)=>{"use strict";c.d(b,{c:()=>o});var d=c(31421),e=c(76760),f=c.n(e),g=c(48161),h=c.n(g),i=c(73024),j=c.n(i),k=c(69384);let l=`
302
+ <max_thinking_length>${b}</max_thinking_length>`}function G(a){return!!a&&!!a.includes("<thinking_mode>")&&(a.includes("<thinking_mode>enabled</thinking_mode>")||a.includes("<thinking_mode>interleaved</thinking_mode>"))}function H(...a){return a.find(a=>null!=a)}function I(a){if("boolean"==typeof a)return a;if("number"==typeof a)return 1===a||0!==a&&null;if("string"!=typeof a)return null;let b=a.trim().toLowerCase();return!!p.has(b)||!q.has(b)&&null}},54849:(a,b,c)=>{"use strict";let{WebsocketFrameSend:d}=c(45221),{opcodes:e,sendHints:f}=c(62026),g=c(50329);class h{#b1=new g;#b2=!1;#b3;constructor(a){this.#b3=a}add(a,b,c){if(c!==f.blob){if(this.#b2){let d={promise:null,callback:b,frame:i(a,c)};this.#b1.push(d)}else if(c===f.text){let{0:c,1:e}=d.createFastTextFrame(a);this.#b3.cork(),this.#b3.write(c),this.#b3.write(e,b),this.#b3.uncork()}else this.#b3.write(i(a,c),b);return}let e={promise:a.arrayBuffer().then(a=>{e.promise=null,e.frame=i(a,c)}),callback:b,frame:null};this.#b1.push(e),this.#b2||this.#b4()}async #b4(){this.#b2=!0;let a=this.#b1;for(;!a.isEmpty();){let b=a.shift();null!==b.promise&&await b.promise,this.#b3.write(b.frame,b.callback),b.callback=b.frame=null}this.#b2=!1}}function i(a,b){return new d(function(a,b){switch(b){case f.text:case f.typedArray:return new Uint8Array(a.buffer,a.byteOffset,a.byteLength);case f.arrayBuffer:case f.blob:return new Uint8Array(a)}}(a,b)).createFrame(b===f.text?e.TEXT:e.BINARY)}a.exports={SendQueue:h}},54913:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"runcrate",alias:"runcrate",aliases:["rc"],category:"apikey",authModes:["apikey"],passthroughModels:!0,display:{name:"Runcrate",icon:"terminal",color:"#1A2B79",textIcon:"RC",website:"https://www.runcrate.ai",notice:{apiKeyUrl:"https://www.runcrate.ai/dashboard/api-keys"}},transport:{baseUrl:"https://api.runcrate.ai/v1/chat/completions",validateUrl:"https://www.runcrate.ai/api/v1/billing/balance",format:"openai"},models:[{id:"deepseek-ai/DeepSeek-V4.1-Flash",name:"DeepSeek V4.1 Flash"},{id:"deepseek-ai/DeepSeek-V4.1-Flash-1017",name:"DeepSeek V4.1 Flash 1017"},{id:"zai-org/GLM-5.3",name:"GLM 5.3"},{id:"zai-org/GLM-5.3-Flash",name:"GLM 5.3 Flash"},{id:"Qwen/Qwen3.8-Flash",name:"Qwen3.8 Flash"},{id:"openai/gpt-oss-120b",name:"gpt-oss 120B"}],serviceKinds:["llm"]}},54940:(a,b,c)=>{"use strict";c.d(b,{c:()=>o});var d=c(31421),e=c(76760),f=c.n(e),g=c(48161),h=c.n(g),i=c(73024),j=c.n(i),k=c(69384);let l=`
303
303
  import readline from "node:readline";
304
304
  const TOOLS = JSON.parse(process.env.DEVIN_MCP_TOOLS || "[]");
305
305
  const RESULTS = JSON.parse(process.env.DEVIN_MCP_RESULTS || "{}");
@@ -347,7 +347,7 @@ ${d}`))}return b.join("\n\n")||"(empty)"}(k),p=function(a){let b=[],c=a=>{"strin
347
347
 
348
348
  `):f(`data: ${JSON.stringify({id:z,object:"chat.completion.chunk",created:A,model:a,choices:[{index:0,delta:{},finish_reason:d}],usage:{prompt_tokens:Math.ceil(o.length/4),completion_tokens:Math.ceil(C.length/4),total_tokens:Math.ceil((o.length+C.length)/4),estimated:!0}})}
349
349
 
350
- `),f("data: [DONE]\n\n");try{n||(n=!0,k.stdin.end())}catch{}let e=setTimeout(()=>{k.killed||k.kill("SIGKILL")},2e3);e.unref?.(),b.close(),y()},K="";k.stdout.on("data",b=>{let c;for(K+=b.toString("utf8");-1!==(c=K.indexOf("\n"));){let b,e=K.slice(0,c).trim();if(K=K.slice(c+1),e){try{b=JSON.parse(e)}catch{continue}if(!u&&void 0!==b.result&&!b.method){u=!0,E("session/new",{cwd:p,mcpServers:[],model:a||void 0});continue}if(u&&!v&&void 0!==b.result&&!b.method){if(!(t=(b.result||{}).sessionId||null))return void J("Devin ACP: session/new returned no sessionId");v=!0,w=!0,E("session/prompt",{sessionId:t,prompt:[{type:"text",text:o}]});continue}if(v&&w&&void 0!==b.result&&!b.method){if(!B){let a=b.result||void 0,c=function(a){if("string"==typeof a.content)return a.content;if("string"==typeof a.text)return a.text;let b=a.message;if(b&&"string"==typeof b.content)return b.content;let c=a.messages;return Array.isArray(c)?c.filter(a=>"assistant"===a.role).map(a=>String(a.content||"")).join("\n"):""}(a);c&&(C=c,F(c));let d=a&&a.stopReason||"";if(d&&"cancelled"!==d)return void J()}continue}if("session/request_permission"===b.method&&void 0!==b.id){let a=b.params?.options||[],c=a.find(a=>/allow/i.test(String(a.kind||"")))||a[0];c&&k.stdin.write(JSON.stringify({jsonrpc:"2.0",id:b.id,result:{outcome:{outcome:"selected",optionId:c.optionId}}})+"\n");continue}if("_cognition.ai/agent_stopped"===b.method||"$/agent_stopped"===b.method)return void("error"===b.params?.cause?J(String(b.params?.errorMessage||b.params?.message||b.params?.error||"Devin agent error")):J());if("session/update"===b.method||"$/update"===b.method){let a=b.params;if(!a)continue;let c=a.update||{},e=c.sessionUpdate||a.type,f=void 0!==c.content?c.content:a.content,g="string"==typeof f?f:f?.text??a.delta??a.text??"";if(x&&!G&&("tool_call"===e||"tool_call_update"===e)){let a=c.toolCallId;if("string"==typeof c.title&&c.title.startsWith("Calling mcp_")&&/from clientTools\b/.test(c.title)){var d;let b=c.title.match(/^Calling (mcp_\S+)\b/),e=(d=b?b[1]:"").startsWith(m)?d.slice(m.length):d;a&&e&&H.set(a,e)}let b=a?H.get(a):null;if(b&&c.rawInput){G=!0,H.delete(a),I(b,c.rawInput,a||`call_${Date.now()}`),J(null,"tool_calls");return}continue}if("agent_message_chunk"===e||"message_delta"===e||"text_delta"===e||"content_delta"===e)g&&F(g);else if("agent_thought_chunk"===e);else if("message_stop"===e||"stop"===e||"done"===e)return void J();else if("error"===e)return void J(String(a.message||a.error||"Devin ACP error"));continue}if(b.error)return void J(`Devin ACP error ${b.error.code}: ${b.error.message}`)}}}),k.stderr.on("data",a=>{g?.debug?.("DEVIN",`stderr: ${a.toString("utf8").slice(0,200)}`)}),k.on("close",a=>{D?y():0===a||l?J():J(B?void 0:`Devin CLI exited with code ${a}`)}),E("initialize",{protocolVersion:"0.3",clientInfo:{name:"zevai",version:"1.0"},capabilities:{}})}}),{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}}),url:"devin://acp/stdio",headers:{},transformedBody:{model:a,cwd:p,clientTools:u.map(a=>a?.function?.name||a?.name).filter(Boolean),clientToolResults:Object.keys(v),mcpServers:Object.keys(s),promptLength:Array.isArray(b?.messages)?b.messages.length:Array.isArray(b?.input)?b.input.length:0}}}}},55285:(a,b,c)=>{"use strict";let d,e=c(77030),f=c(34589),g=c(84285),{InvalidArgumentError:h,ConnectTimeoutError:i}=c(61448),j=class{constructor(a){this._maxCachedSessions=a,this._sessionCache=new Map,this._sessionRegistry=new FinalizationRegistry(a=>{if(this._sessionCache.size<this._maxCachedSessions)return;let b=this._sessionCache.get(a);void 0!==b&&void 0===b.deref()&&this._sessionCache.delete(a)})}get(a){let b=this._sessionCache.get(a);return b?b.deref():null}set(a,b){if(0!==this._maxCachedSessions){if(this._sessionCache.has(a))this._sessionCache.delete(a);else if(this._sessionCache.size>=this._maxCachedSessions){let a=!1;for(let[b,c]of this._sessionCache)if(void 0===c.deref()){this._sessionCache.delete(b),a=!0;break}if(!a){let a=this._sessionCache.keys().next();a.done||this._sessionCache.delete(a.value)}}this._sessionCache.set(a,new WeakRef(b)),this._sessionRegistry.register(b,a)}}};a.exports=function({allowH2:a,preferH2:b,useH2c:k,maxCachedSessions:l,socketPath:m,timeout:n,session:o,...p}){if(null!=l&&(!Number.isInteger(l)||l<0))throw new h("maxCachedSessions must be a positive integer or zero");let q={path:m,...p},r=new j(null==l?100:l);return n=null==n?1e4:n,a=null==a||a,function({hostname:h,host:j,protocol:l,port:m,servername:p,localAddress:s,httpSocket:t},u){let v;if("https:"===l){d||(d=c(41692));let e=(p=p||q.servername||g.getServerName(j)||null)||h;f(e);let i=o||r.get(e)||null;m=m||443,(v=d.connect({highWaterMark:16384,...q,servername:p,session:i,localAddress:s,ALPNProtocols:a?b?["h2","http/1.1"]:["http/1.1","h2"]:["http/1.1"],socket:t,port:m,host:h})).on("session",function(a){r.set(e,a)})}else{f(!t,"httpSocket can only be sent on TLS update"),m=m||80;let a={highWaterMark:65536,...q,localAddress:s,port:m,host:h},b=e.isIP(h);0!==b&&p&&p!==h&&(a.host=p,a.lookup=(a,c,d)=>{c.all?d(null,[{address:h,family:b}]):d(null,h,b)}),v=e.connect(a),!0===k&&(v.alpnProtocol="h2")}if(null==q.keepAlive||q.keepAlive){let a=void 0===q.keepAliveInitialDelay?6e4:q.keepAliveInitialDelay;v.setKeepAlive(!0,a)}let w=g.setupConnectTimeout(new WeakRef(v),{timeout:n,hostname:h,port:m});return v.setNoDelay(!0).once("https:"===l?"secureConnect":"connect",function(){if(queueMicrotask(w),u){let a=u;u=null,a(null,this)}}).on("error",function(a){if(queueMicrotask(w),u){let b=u;u=null,b(function(a,b,c){if(a instanceof AggregateError&&("ETIMEDOUT"===a.code||a.errors.some(a=>null!=a&&"ETIMEDOUT"===a.code))){let d="Connect Timeout Error";Array.isArray(b.autoSelectFamilyAttemptedAddresses)?d+=` (attempted addresses: ${b.autoSelectFamilyAttemptedAddresses.join(", ")},`:d+=` (attempted address: ${c.hostname}:${c.port},`;let e=new i(d+=` timeout: ${c.timeout}ms)`);return e.cause=a,e}return a}(a,this,{timeout:n,hostname:h,port:m}))}}),v}}},55599:(a,b,c)=>{"use strict";c(1758),c(8735),c(1899),c(42541),c(90943),c(72610),c(51525),c(43212),c(16605),Symbol("streamFailure")},55720:(a,b,c)=>{"use strict";let{getResponseData:d,buildKey:e,addMockDispatch:f}=c(70634),{kDispatches:g,kDispatchKey:h,kDefaultHeaders:i,kDefaultTrailers:j,kContentLength:k,kMockDispatch:l,kIgnoreTrailingSlash:m}=c(80830),{InvalidArgumentError:n}=c(61448),{serializePathWithQuery:o}=c(84285),{types:{isPromise:p}}=c(57975);class q{constructor(a){this[l]=a}delay(a){if("number"!=typeof a||!Number.isInteger(a)||a<=0)throw new n("waitInMs must be a valid integer > 0");return this[l].delay=a,this}persist(){return this[l].persist=!0,this}times(a){if("number"!=typeof a||!Number.isInteger(a)||a<=0)throw new n("repeatTimes must be a valid integer > 0");return this[l].times=a,this}}class r{constructor(a,b){if("object"!=typeof a)throw new n("opts must be an object");if(void 0===a.path)throw new n("opts.path must be defined");if(void 0===a.method&&(a.method="GET"),"string"==typeof a.path)if(a.query)a.path=o(a.path,a.query);else{let b=new URL(a.path,"data://");a.path=b.pathname+b.search}"string"==typeof a.method&&(a.method=a.method.toUpperCase()),this[h]=e(a),this[g]=b,this[m]=a.ignoreTrailingSlash??!1,this[i]={},this[j]={},this[k]=!1}createMockScopeDispatchData({statusCode:a,data:b,responseOptions:c}){let e=d(b),f=this[k]?{"content-length":e.length}:{};return{statusCode:a,data:b,headers:{...this[i],...f,...c.headers},trailers:{...this[j],...c.trailers}}}validateReplyParameters(a){if(void 0===a.statusCode)throw new n("statusCode must be defined");if("object"!=typeof a.responseOptions||null===a.responseOptions)throw new n("responseOptions must be an object")}reply(a){if("function"==typeof a){let b=a=>{if("object"!=typeof a||null===a)throw new n("reply options callback must return an object");let b={data:"",responseOptions:{},...a};return this.validateReplyParameters(b),{...this.createMockScopeDispatchData(b)}};return new q(f(this[g],this[h],c=>{let d=a(c);return p(d)?d.then(b):b(d)},{ignoreTrailingSlash:this[m]}))}let b={statusCode:a,data:void 0===arguments[1]?"":arguments[1],responseOptions:void 0===arguments[2]?{}:arguments[2]};this.validateReplyParameters(b);let c=this.createMockScopeDispatchData(b);return new q(f(this[g],this[h],c,{ignoreTrailingSlash:this[m]}))}replyWithError(a){if(void 0===a)throw new n("error must be defined");return new q(f(this[g],this[h],{error:a},{ignoreTrailingSlash:this[m]}))}defaultReplyHeaders(a){if(void 0===a)throw new n("headers must be defined");return this[i]=a,this}defaultReplyTrailers(a){if(void 0===a)throw new n("trailers must be defined");return this[j]=a,this}replyContentLength(){return this[k]=!0,this}}a.exports.MockInterceptor=r,a.exports.MockScope=q},56248:(a,b,c)=>{"use strict";c.d(b,{v:()=>s});var d=c(57861),e=c(69762),f=c(42541);function g(a){if(!a||"object"!=typeof a)return null;let b=[a.input_tokens,a.prompt_tokens].find(Number.isInteger),c=[a.output_tokens,a.completion_tokens].find(Number.isInteger);if(void 0===b||void 0===c||b+c<=0)return null;let d={input_tokens:b,output_tokens:c,total_tokens:b+c},e=[a.input_tokens_details?.cached_tokens,a.prompt_tokens_details?.cached_tokens].find(Number.isInteger),f=[a.output_tokens_details?.reasoning_tokens,a.completion_tokens_details?.reasoning_tokens].find(Number.isInteger);return Number.isInteger(e)&&(d.input_tokens_details={cached_tokens:e}),Number.isInteger(f)&&(d.output_tokens_details={reasoning_tokens:f}),d}function h(a){let b=Number.isInteger(a.nextOutputIndex)?a.nextOutputIndex:0;return a.nextOutputIndex=b+1,b}function i(a,b,c){a.reasoningId||(a.reasoningId=`rs_${a.responseId}_${c}`,a.reasoningIndex=h(a),b("response.output_item.added",{type:"response.output_item.added",output_index:c,item:{id:a.reasoningId,type:"reasoning",summary:[]}}),b("response.reasoning_summary_part.added",{type:"response.reasoning_summary_part.added",item_id:a.reasoningId,output_index:c,summary_index:0,part:{type:"summary_text",text:""}}),a.reasoningPartAdded=!0)}function j(a,b,c){c&&(a.reasoningBuf+=c,b("response.reasoning_summary_text.delta",{type:"response.reasoning_summary_text.delta",item_id:a.reasoningId,output_index:a.reasoningIndex,summary_index:0,delta:c}))}function k(a,b){a.reasoningId&&!a.reasoningDone&&(a.reasoningDone=!0,b("response.reasoning_summary_text.done",{type:"response.reasoning_summary_text.done",item_id:a.reasoningId,output_index:a.reasoningIndex,summary_index:0,text:a.reasoningBuf}),b("response.reasoning_summary_part.done",{type:"response.reasoning_summary_part.done",item_id:a.reasoningId,output_index:a.reasoningIndex,summary_index:0,part:{type:"summary_text",text:a.reasoningBuf}}),b("response.output_item.done",{type:"response.output_item.done",output_index:a.reasoningIndex,item:{id:a.reasoningId,type:"reasoning",summary:[{type:"summary_text",text:a.reasoningBuf}]}}))}function l(a,b,c){if(a.msgItemAdded[c]&&!a.msgItemDone[c]){a.msgItemDone[c]=!0;let d=a.msgTextBuf[c]||"",e=`msg_${a.responseId}_${c}`,f=a.msgOutputIndices[c];b("response.output_text.done",{type:"response.output_text.done",item_id:e,output_index:f,content_index:0,text:d,logprobs:[]}),b("response.content_part.done",{type:"response.content_part.done",item_id:e,output_index:f,content_index:0,part:{type:"output_text",annotations:[],logprobs:[],text:d}}),b("response.output_item.done",{type:"response.output_item.done",output_index:f,item:{id:e,type:"message",content:[{type:"output_text",annotations:[],logprobs:[],text:d}],role:"assistant"}})}}function m(a,b){return`${b?"ctc":"fc"}_${a}`}function n(a,b,c,{allowUnnamed:d=!1}={}){if(a.funcItemAdded||(a.funcItemAdded={}),a.funcItemAdded[c])return!1;let e=a.funcCallIds[c],f=a.funcNames[c];if(!e||!f&&!d)return!1;a.funcItemAdded[c]=!0;let g="custom"===a.funcTypes[c],h=m(e,g);return b("response.output_item.added",{type:"response.output_item.added",output_index:a.funcOutputIndices[c],item:g?{id:h,type:"custom_tool_call",call_id:e,name:f||"",input:""}:{id:h,type:"function_call",arguments:"",call_id:e,name:f||""}}),!g&&a.funcArgsBuf[c]&&b("response.function_call_arguments.delta",{type:"response.function_call_arguments.delta",item_id:h,output_index:a.funcOutputIndices[c],delta:a.funcArgsBuf[c]}),!0}function o(a,b,c){let d=a.funcCallIds[c];if(d&&!a.funcItemDone[c]){a.funcItemAdded?.[c]||n(a,b,c,{allowUnnamed:!0});let e="custom"===a.funcTypes[c],f=a.funcArgsBuf[c]||(e?"":"{}"),g=e?function(a){if("string"!=typeof a)return"";try{let b=JSON.parse(a);if(b&&"object"==typeof b&&"string"==typeof b.input)return b.input}catch{}return a}(f):f,h=a.funcOutputIndices[c],i=m(d,e);e&&g&&b("response.custom_tool_call_input.delta",{type:"response.custom_tool_call_input.delta",item_id:i,output_index:h,delta:g}),b(e?"response.custom_tool_call_input.done":"response.function_call_arguments.done",{type:e?"response.custom_tool_call_input.done":"response.function_call_arguments.done",item_id:i,output_index:h,...e?{input:g}:{arguments:g}}),b("response.output_item.done",{type:"response.output_item.done",output_index:h,item:e?{id:i,type:"custom_tool_call",input:g,call_id:d,name:a.funcNames[c]||""}:{id:i,type:"function_call",arguments:g,call_id:d,name:a.funcNames[c]||""}}),a.funcArgsBuf[c]=g,a.funcItemDone[c]=!0,a.funcArgsDone[c]=!0}}function p(a,b){if(!a.completedSent){a.completedSent=!0;let c={id:a.responseId,object:"response",created_at:a.created,status:"completed",background:!1,error:null,output:function(a){let b=[];for(let c in a.reasoningId&&b.push({index:a.reasoningIndex,item:{id:a.reasoningId,type:"reasoning",summary:a.reasoningBuf?[{type:"summary_text",text:a.reasoningBuf}]:[]}}),a.msgItemAdded)a.msgItemAdded[c]&&b.push({index:a.msgOutputIndices[c]??0,item:{id:`msg_${a.responseId}_${c}`,type:"message",status:"completed",role:"assistant",content:[{type:"output_text",annotations:[],logprobs:[],text:a.msgTextBuf[c]||""}]}});for(let c in a.funcCallIds){let d=a.funcCallIds[c];if(!d)continue;let e="custom"===a.funcTypes[c],f=m(d,e);b.push({index:a.funcOutputIndices[c]??0,item:e?{id:f,type:"custom_tool_call",input:a.funcArgsBuf[c]||"",call_id:d,name:a.funcNames[c]||""}:{id:f,type:"function_call",arguments:a.funcArgsBuf[c]||"{}",call_id:d,name:a.funcNames[c]||""}})}return b.sort((a,b)=>a.index-b.index),b.map(a=>a.item)}(a)};a.model&&(c.model=a.model);let d=a.responsesUsage||g(a.usage);d&&(c.usage=d),b("response.completed",{type:"response.completed",response:c})}}function q(a){if(a.completedSent)return[];let b=[],c=(c,d)=>{d.sequence_number=++a.seq,b.push({event:c,data:d})};for(let b in a.msgItemAdded)l(a,c,b);for(let b in k(a,c),a.funcCallIds)o(a,c,b);return p(a,c),b}function r(a){return a.toolCallIndex>0||a.currentToolCallId?"tool_calls":"stop"}function s(a,b){if(!a){if(b.finishReasonSent||!b.started)return null;let a=r(b);b.finishReasonSent=!0,b.finishReason=a;let c={id:b.chatId||`chatcmpl-${Date.now()}`,object:"chat.completion.chunk",created:b.created||Math.floor(Date.now()/1e3),model:b.model||"unknown",choices:[{index:0,delta:{},finish_reason:a}]};return b.usage&&"object"==typeof b.usage&&(c.usage=b.usage),c}let c=a.type||a.event,d=a.data||a;if(b.started||(b.started=!0,b.chatId=`chatcmpl-${Date.now()}`,b.created=Math.floor(Date.now()/1e3),b.toolCallIndex=0,b.currentToolCallId=null,b.respToolChatIndex??=Object.create(null),b.respToolArgsEmitted??=Object.create(null)),"error"===c||"response.failed"===c||d?.response?.status==="failed"||!c&&d?.error){let a,e,f,g,h,i,j,k,l;if(b.finishReasonSent||b.errorSent)return null;let m=(g=(f=(e=(a=d&&"object"==typeof d?d:{}).error??a.response?.error)&&"object"==typeof e&&!Array.isArray(e)?e:{}).code??a.code??("response.failed"===c?"response_failed":"stream_error"),h=f.message||("string"==typeof e?e:null)||a.message||("response.failed"===c?"Responses API request failed":"Responses API stream error"),i=a.type&&a.type!==c&&"error"!==a.type?a.type:null,j="string"==typeof g&&(g.endsWith("_error")||"server_error"===g)?g:null,k=f.type||a.error_type||i||j||"server_error",!("param"in(l={...f,message:h,type:k}))&&"param"in a&&(l.param=a.param),l.code=g,l);return b.error=m,b.errorSent=!0,b.finishReasonSent=!0,{error:m}}if(b.errorSent)return null;if("response.output_text.delta"===c){let a=d.delta||"";return a?{id:b.chatId,object:"chat.completion.chunk",created:b.created,model:b.model||"unknown",choices:[{index:0,delta:{content:a},finish_reason:null}]}:null}if("response.output_text.done"===c)return null;if("response.output_item.added"===c&&(d.item?.type==="function_call"||d.item?.type==="custom_tool_call")){let a,c=d.item;b.currentToolCallId=c.call_id||`call_${Date.now()}`,b.respToolChatIndex??=Object.create(null);let e=c.id||d.item_id||b.currentToolCallId;return e&&Object.prototype.hasOwnProperty.call(b.respToolChatIndex,e)?a=b.respToolChatIndex[e]:(a=b.toolCallIndex++,e&&(b.respToolChatIndex[e]=a)),{id:b.chatId,object:"chat.completion.chunk",created:b.created,model:b.model||"unknown",choices:[{index:0,delta:{tool_calls:[{index:a,id:b.currentToolCallId,type:"function",function:{name:c.name||"",arguments:""}}]},finish_reason:null}]}}if("response.function_call_arguments.delta"===c||"response.custom_tool_call_input.delta"===c){let a=d.delta||"";if(!a)return null;let c=(null!=d.item_id?b.respToolChatIndex?.[d.item_id]:void 0)??Math.max(0,(b.toolCallIndex||1)-1);return b.respToolArgsEmitted??=Object.create(null),b.respToolArgsEmitted[c]=!0,{id:b.chatId,object:"chat.completion.chunk",created:b.created,model:b.model||"unknown",choices:[{index:0,delta:{tool_calls:[{index:c,function:{arguments:a}}]},finish_reason:null}]}}if("response.output_item.done"===c&&(d.item?.type==="function_call"||d.item?.type==="custom_tool_call")){let a=d.item?.id||d.item_id,c=a&&b.respToolChatIndex?.[a]!=null?b.respToolChatIndex[a]:Math.max(0,(b.toolCallIndex||1)-1),e=d.item?.arguments;return"string"==typeof e&&e&&(b.respToolArgsEmitted??=Object.create(null),!b.respToolArgsEmitted[c])?(b.respToolArgsEmitted[c]=!0,{id:b.chatId,object:"chat.completion.chunk",created:b.created,model:b.model||"unknown",choices:[{index:0,delta:{tool_calls:[{index:c,function:{arguments:e}}]},finish_reason:null}]}):null}if("response.completed"===c||"response.done"===c){let a=d.response?.usage;if(a&&"object"==typeof a){let c=a.input_tokens||a.prompt_tokens||0,d=a.output_tokens||a.completion_tokens||0,e=a.input_tokens_details?.cached_tokens||a.cache_read_input_tokens||0;b.usage={prompt_tokens:c,completion_tokens:d,total_tokens:c+d},e>0&&(b.usage.prompt_tokens_details={cached_tokens:e})}if(!b.finishReasonSent){let a=r(b);b.finishReasonSent=!0,b.finishReason=a;let c={id:b.chatId,object:"chat.completion.chunk",created:b.created,model:b.model||"unknown",choices:[{index:0,delta:{},finish_reason:a}]};return b.usage&&"object"==typeof b.usage&&(c.usage=b.usage),c}return null}if("response.reasoning_summary_text.delta"===c){let a=d.delta||"";return a?{id:b.chatId,object:"chat.completion.chunk",created:b.created,model:b.model||"unknown",choices:[{index:0,delta:{reasoning_content:a},finish_reason:null}]}:null}return null}(0,e.kz)(f.h.OPENAI,f.h.OPENAI_RESPONSES,null,function(a,b){if(!a)return q(b);let c=g(a.usage);if(c&&(b.responsesUsage=c),!a.choices?.length)return b.completionPending&&b.responsesUsage?q(b):[];let e=[],f=(a,c)=>{c.sequence_number=++b.seq,e.push({event:a,data:c})},r=a.choices[0],s=r.index||0,t=r.delta||{};b.started||(b.started=!0,b.responseId=a.id?`resp_${a.id}`:b.responseId,f("response.created",{type:"response.created",response:{id:b.responseId,object:"response",created_at:b.created,status:"in_progress",background:!1,error:null,output:[]}}),f("response.in_progress",{type:"response.in_progress",response:{id:b.responseId,object:"response",created_at:b.created,status:"in_progress"}}));let u=(0,d.V)(t);if(u&&(i(b,f,s),j(b,f,u)),t.content){let a=t.content;if(a.includes("<think>")&&(b.inThinking=!0,a=a.replace("<think>",""),i(b,f,s)),a.includes("</think>")){let c=a.split("</think>"),d=c[0],e=c.slice(1).join("</think>");d&&j(b,f,d),k(b,f),b.inThinking=!1,a=e}if(b.inThinking&&a)return j(b,f,a),e;a&&(k(b,f),function(a,b,c,d){if(!a.msgItemAdded[c]){a.msgItemAdded[c]=!0,a.msgOutputIndices[c]=h(a);let d=`msg_${a.responseId}_${c}`;b("response.output_item.added",{type:"response.output_item.added",output_index:a.msgOutputIndices[c],item:{id:d,type:"message",content:[],role:"assistant"}})}a.msgContentAdded[c]||(a.msgContentAdded[c]=!0,b("response.content_part.added",{type:"response.content_part.added",item_id:`msg_${a.responseId}_${c}`,output_index:a.msgOutputIndices[c],content_index:0,part:{type:"output_text",annotations:[],logprobs:[],text:""}})),b("response.output_text.delta",{type:"response.output_text.delta",item_id:`msg_${a.responseId}_${c}`,output_index:a.msgOutputIndices[c],content_index:0,delta:d,logprobs:[]}),a.msgTextBuf[c]||(a.msgTextBuf[c]=""),a.msgTextBuf[c]+=d}(b,f,s,a))}if(Array.isArray(t.tool_calls)&&t.tool_calls.length>0)for(let a of(k(b,f),l(b,f,s),t.tool_calls))!function(a,b,c){let d=c.index??0,e=c.id,f=c.function?.name;if(void 0===a.funcOutputIndices[d]&&(a.funcOutputIndices[d]=h(a)),a.funcItemAdded||(a.funcItemAdded={}),f){let b=a.toolNameMap?.get(f)||f;a.funcNames[d]=b,a.toolNameMap?.customToolNames?.has(b)&&(a.funcTypes[d]="custom")}e&&!a.funcCallIds[d]&&(a.funcCallIds[d]=e),a.funcArgsBuf[d]||(a.funcArgsBuf[d]="");let g=!!a.funcItemAdded[d];c.function?.arguments&&(a.funcArgsBuf[d]+=c.function.arguments);let i=n(a,b,d);"custom"!==a.funcTypes[d]&&g&&!i&&c.function?.arguments&&a.funcCallIds[d]&&b("response.function_call_arguments.delta",{type:"response.function_call_arguments.delta",item_id:m(a.funcCallIds[d],!1),output_index:a.funcOutputIndices[d],delta:c.function.arguments})}(b,f,a);if(r.finish_reason){for(let a in b.msgItemAdded)l(b,f,a);for(let a in k(b,f),b.funcCallIds)o(b,f,a);b.responsesUsage||!b.deferResponsesCompletion?p(b,f):b.completionPending=!0}return e}),(0,e.kz)(f.h.OPENAI_RESPONSES,f.h.OPENAI,null,s)},56250:a=>{let b=new WebAssembly.Module(Buffer.from("AGFzbQEAAAABQgtgA39/fwBgAX8Bf2ACf38AYAF/AGABfwF+YAJ/fgBgBH9/f38AYAABf2AIf39/f39/f3wAYAN/f38Bf2ACf38BfwKUBBwDZW52CG9uX2Vycm9yAAADZW52Cm9uX2hlYWRlcnMACANlbnYJb25fZmluaXNoAAADZW52EG9uX21lc3NhZ2Vfc3RhcnQAAANlbnYTb25fbWVzc2FnZV9jb21wbGV0ZQAAA2Vudgpvbl9yZXF1ZXN0AAADZW52C29uX3Jlc3BvbnNlAAADZW52CG9uX3J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8EQCACIANBCGsiB0sNAQNAQYCChAggAigCACABcyIGayAGckGAgYKEeHFBgIGChHhHDQJBgIKECCACQQRqKAIAIAFzIgZrIAZyQYCBgoR4cUGAgYKEeEcNAiACQQhqIgIgB00NAAsMAQsgAiADTw0CDAELIAIgA08NAQsgA0EBa0EBIQQDQCAFIAItAABGDQEgAkEBaiICIANHDQALIQJBACEECyAAIAI2AgQgACAENgIACyYAAkAgAEEATgRAIABFBEBBASEADAILIABBARBVIgANAQsACyAACzMAIABCADcDKCAAQQA6ABUgAEIANwMwIABCADcDOCAAQgA3A0AgAEIANwNIIABBADYCUAvSAwIDfwF+AkAgACIBLQAkIgBBDk1BAEEBIAB0QYDPAXEbRQRAIAFBAzoAJiABQQI6ACQgAUENOgD0AkEAIQAgAUEAOgB5IAFBp5jAACkAADcAbCABQayYwAApAAA3AHECQCABKQNYIAEpA2CEp0EBcUUEQCABKAL4AiECDAELIAEoAvgCIgJBAToAACACQQVqQQM6AAAgAkEBaiABKAIgNgAAQQYhAAsgACACakEAOgAADAELAn9BACABKQNYIAEpA2CEIgRCyACDUA0AGiAEQgiDQgBSBEAgASgC+AIiAEEEOgAAIABBBWpBADYAACAAQQFqIAEoAiA2AABBCSECCyACIARCwACDUA0AGiABKAL4AiACaiIAQQc6AAAgAEEFakEANgAAIABBAWogASgCIDYAACACQQlqCyECIAFBADoAFiABQQA6ABQCQCABLQBSQQFGBEBBDiEAIAEtABFBAXENAQsgAS0AUCEDIARCAoNQBEAgAyEADAELQQEhACADQQFxRQRAIAMhAAwBCyABKAL4AiACaiIDQQI6AAAgA0EFakEANgAAIANBAWogASgCIDYAACACQQlqIQILIAEgADoAJCABKAL4AiACakEAOgAACwvfAgEDfyMAQeAAayIAJAACQEGAgAQQViICRQ0AIAJBBGstAABBA3FFDQAgAkEAQYCABPwLAAsCQCACRQ0AIABBADYAXCAAQgA3AFQgAEIANwBMIABCADcARCAAQgA3ADwgAEIANwA0IABCADcCHCAAQgA3AiQgAEEANgIsIABCADcADyAAQQA6ABdBgANBCBBVIgFFDQAgAUIANwARIAFBAToAECABQgA3AwggAUKAwICAgIAINwMAIAFCADcAGSABQgA3AB8gASAAKQAzNwAnIAEgACkAOzcALyABIAApAEM3ADcgASAAKQBLNwA/IAEgACkAUzcARyABIAApAFg3AEwgASAAKAIoNgJkIAEgACkCIDcCXCABIAApAhg3AlQgAUHsAGpBAEH/AfwLACABIAI2AvgCIAEgAC8AFjsA8wIgASAAKQAONwDrAiABIAE2AmggAEHgAGokACABDwsACxUAAkAgAEUNACABRQ0AIAAgARBXCws4AQF/IAAEQCAAKALwAiIBBEAgACgC7AIgARBXCyAAKAL4AiIBBEAgAUGAgAQQVwsgAEGAAxBXCwuSAQEBfyAAIAE6ACYgAEECOgAkIABB7ABqIQRB/gEgAyADQf4BTxsiAwRAIAQgAiAD/AoAAAsgACADOgD0AiADIARqQQA6AABBACEDIAApA1ggACkDYIRCAYOnBH8gACgC+AIiAkEBOgAAIAJBBWogAToAACACQQFqIAAoAiA2AABBBgVBAAsgACgC+AJqQQA6AAALrAIBAn8CQAJAAkAgAC0AJCIBQQlNBEBBASABdEEbcQ0BIAFBAkYNAyABQQlGDQILIABBBToAJiAAQQI6ACQgAEEWOgD0AiAAQQA6AIIBIABBgIjAACkAADcAbCAAQYiIwAApAAA3AHQgAEGOiMAAKQAANwB6AkAgACkDWCAAKQNghKdBAXFFBEAgACgC+AIhAQwBCyAAKAL4AiIBQQE6AAAgAUEFakEFOgAAIAFBAWogACgCIDYAAEEGIQILIAEgAmpBADoAAA8LIABBAToAJA8LAn8gACkDWCAAKQNghEIIg1AEQCAAKAL4AiEBQQAMAQsgACgC+AIiAUEEOgAAIAFBBWpBADYAACABQQFqIAAoAiA2AABBCQshAiAAQQE6ACQgASACakEAOgAACwsHACAAKQMwCwcAIAApAygLBwAgAC0AJgsTACAAMQD0AiAAQewAaq1CIIaECwcAIAApAwgLBwAgACgCBAsHACAAKAIACwcAIAAtAEwLBwAgACkDGAsHACAAKAIgCwc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ACQQFqIgINAAsMAwtBBCANQQNxIhxrIgEgD2ohAiABIA1qIQEgC0EJTwRAAkAgAiAqSg0AA0BBgIKECCABKAIAIgJBosSIkQJzayACckGAgYKEeHFBgIGChHhHDQFBgIKECCABQQRqKAIAIgJBosSIkQJzayACckGAgYKEeHFBgIGChHhHDQEgAUEIaiIBICtNDQALCyABIBBPDQMDQCABLQAAQSJGDQIgECABQQFqIgFHDQALDAMLIAIgDksNAiAcICxqIA9rIQIDQCABLQAAQSJGDQEgAUEBaiEBIAJBAWsiAg0ACwwCCyABIA1rIA9qIQsCQCABIA1GDQAgASApaiECIAEgBCAPamshDUEAIQECQANAIAIgCk8NTCACIARqLQAAQdwARw0BIAFBAWohASACIA9LIAJBAWshAg0ACyANIQELIAFBAXFFDQAgC0EBaiEPIAsgDkkNAQwCCwsgBiALSQRAIAYhAQNAIAEgCk8NSgJAAkAgASAEai0AACICQdwARgRAIAFBAWoiASALRg0BIAEgCk8NTSABIARqLQAALQCAgkBBAUcNAQwCCyACLQCAhEANAQsgA0EGOgAmIANBAjoAJCADQYuWwAApAAA3AGwgA0GTlsAAKQAANwB0IANBm5bAACkAADcAfCADQaOWwAApAAA3AIQBIANBq5bAACkAADcAjAEgA0GxlsAAKQAANwCSAUEuIQhBmgEMTwsgAUEBaiIBIAtJDQALCyALQQFqIQIMAgsgA0EGOgAmIANBAjoAJCADQduVwAApAAA3AGwgA0HjlcAAKQAANwB0IANB65XAACkAADcAfCADQfOVwAApAAA3AIQBIANB+5XAACkAADcAjAEgA0GDlsAAKQAANwCUAQwKCyAOIgIgCU8EQCAMQTs6AHQgDEHYAGogDEH0AGogCyALIAIgBmtqEBwgDCgCWEEBcSICBH8gDCgCXCALawUgAQsgCWogDiACGyECCwJAIAIgCSIGTQ0AIAogBiAGIApJGyEBA0AgASAGRg1IIAQgBmotAAAiC0EJRyALQSBHcQ0BIAIgBkEBaiIGRw0ACyACIQYLIAIhCwJAIAIgBk0NACAEQQFrIQ0DQCALQQFrIgEgC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icAAKQAANwB8DAgLIAJBAmohACADLQAkQQJGDScgA0EGOgAkDCcLIANBDDoAJiADQQI6ACQgA0HPisAAKQAANwBsIANB14rAACkAADcAdCADQd+KwAApAAA3AHwgA0HnisAAKAAANgCEAQwcCyADKAIAIAhLDS0gA0EGOgAmIANBAjoAJCADQbuKwAApAAA3AGwgA0HDisAAKQAANwB0IANBy4rAACgAADYAfAwdCyAIRQ0FIAhBAWsgCk8NBQJAIAhBBE8EQCAIIQEgBCEAQYCChAggBCgAACICQY2atOgAc2sgAnJBgIGChHhxQYCBgoR4RgRAIARBBCAEQQNxIgJrIgZqIQAgAUEJTwRAIAEgBGohAgJAIAYgAUEIa0sNACACQQhrIQEDQEGAgoQIIAAoAgAiBkGNmrToAHNrIAZyQYCBgoR4cUGAgYKEeEcNAUGAgoQIIABBBGooAgAiBkGNmrToAHNrIAZyQYCBgoR4cUGAgYKEeEcNASAAQQhqIgAgAU0NAAsLIAAgAk8NCQNAIAAtAABBDUYNBCACIABBAWoiAEcNAAsMCQsgBiAITw0IIAIgCGpBBGshAQNAIAAtAABBDUYNAyAAQQFqIQAgAUEBayIBDQALDAgLA0AgAC0AAEENRg0CIABBAWohACABQQFrIgENAAsMBwsgBCEAIAQtAABBDUYNACAIQQFGDQYgBC0AAUENRgRAIARBAWohAAwBCyAIQQJGDQYgBC0AAkENRw0GIARBAmohAAsgACAEayIOQQFqIgEgCEYNLCABIApPDScCQCABIARqIgItAABBCkYEQEEAIQEgACAERw0BQQIhAAwmCyADQQY6ACYgA0ECOgAkIANBrorAACkAADcAbCADQbOKwAApAAA3AHEMIQsCQAJAAkACfwJAIA5BDk8EQCASQgA3AwAgA0EAOgAVIBJCADcDCCASQgA3AxAgEkIANwMYIBJCADcDICASQQA2AiggDEEgOgB0IAxBEGogDEH0AGogBCACEBwCQCAMKAIQQQFxBEAgDCgCFCIAIARHDQELIANBBjoAJiADQQI6ACQgA0H9icAAKQAANwBsIANBhYrAACkAADcAdCADQY2KwAApAAA3AHwg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cUARw0CIAQtAAVBwwBHDQIgBC0ABkHUAEcNAiADQQE6ABVBBiEADAQLIAQtAAFB0ABHDQEgBC0AAkHUAEcNASAELQADQckARw0BIAQtAARBzwBHDQEgBC0ABUHOAEcNASAELQAGQdMARw0BQQchAAwDCyAELQABQcUARg0ECyADQQA6AEwgAiEHIAQhAAwECyADQQY6ACYgA0ECOgAkIANBmIrAACkAADcAbCADQaCKwAApAAA3AHQgA0GmisAAKQAANwB6QRYhCEGCAQwwC0EACyEPIAMgADoATAwCCyADIAQtAAJB1ABGIg86AEwgAiEHIAQhACAPRQ0AQQAhDwwBCwJAA0AgAC0AAC0AgIBARQ0BIABBAWohACAHQQFrIgcNAAtBACEPDAELIANBBjoAJiADQQI6ACQgA0G6iMAAKQAANwBsIANBwojAACkAADcAdCADQcqIwAApAAA3AHwMBQsgEyANayITIAtqIRUgCSEHIAYhAAJAA0AgACAKTw0pIAAgBGotAAAtAICGQARAIABBAWohACAHQQFrIgdFDQIMAQsLIANBBjoAJiADQQI6ACQgA0HSiMAAKQAANwBsIANB2ojAACkAADcAdCADQd+IwAApAAA3AHkMBwsgDiAQQQlqRw0CAkAgDiALa0EIRw0AIA0pAAAiLkLIqNGC9cWMlzBRDQIgLkLIqNGC9aWMlzFSDQAgD0UNBCADQRE6ACYgA0ECOgAkIANB54jAACkAADcAbCADQe+IwAApAAA3AHQgA0H3iMAAKQAANwB8IANB/ojAACkAADcAgwEMHgsLIANBBjoAJiADQQI6ACQgA0GeicAAKQAANwBsIANBponAACkAADcAdEEQIQhB/AAMKgsgDw0BIANBEToAJiADQQI6ACQgA0GGicAAKQAANwBsIANBjonAACkAADcAdCADQZaJwAApAAA3AHwMAgsgA0EGOgAmIANBAjoAJCADQa6JwAApAAA3AGwgA0G2icAAKQAANwB0IANBu4nAACkAADcAeQwDCwJAICNFDQAgQEIAUgRAIAVBEGpBgYAETw0qIAMoAiAhACADKAL4AiAFakEIOgAAIAMoAvgCIAVqQQFqIAA2AAAgAygC+AIgBW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H+kcAAKQAANwBsIANBhpLAACkAADcAdCADQY6SwAApAAA3AHwgA0GWksAAKQAANwCEASADQZ2SwAAoAAA2AIsBQSMhCEGPAQwSCyADKAIEIAhLDRIgA0EGOgAmIANBAjoAJCADQYGMwAApAAA3AGwgA0GJjMAAKQAANwB0IANBkYzAACgAADYAfAwCC0EcIQhBiAEMEAtBHSEIQYkBDA8LQRQhCEGAAQwOC0EfIQhBiwEMDQsgAygC+AIgBWogAToAACADKAL4AiAFakEBaiAXNgAAIAMoAvgCIAVqQQVqIAc2AAAgBUEJagshBUEAIQEgAEECaiIADQQMBQtBDSEIQfkADAoLAkAgFkUNACAzQgBSBEAgBUFwSA0MIAMoAiAhASADKAL4AiAFaiIAQQQ6AAAgAEEFakEANgAAIABBAWogAUECajYAACAFQQlqIQULIDJQDQAgBUFwSA0LIAMoAiAhASADKAL4AiAFaiIAQQc6AAAgAEEFakEANgAAIABBAWogAUECajYAACAFQQlqIQULIANBADoAFiADQQA6ABQCQAJAIAMtAFJBAUYEQCADLQARQQFxDQELIAMtAFANAUECIQAgAy0AJEECRw0CQQAhAQwEC0ECIQBBACEBIAMtACRBAkYNAyADQQ46ACQMAwsgGUUNASAFQXBIDQogAygCICEBIAMoAvgCIAVqIgBBAjoAACAAQQVqQQA2AAAgAEEBaiABNgAAIAVBCWohBQwBC0EAIQEgA0EAOgAkDAELQQIhAEEAIQEgAy0AJEECRg0AIANBAToAJAsgAyADKAIgIABqNgIgIAAgCksNAiAIIABrIQggACAEaiEEIAogAGshCgtBASEXIAFBAXENBiADLQAlQQFxRQ0ACwwFCwALAAsgAygC+AJBADoAAAwDCyADQQY6ACYgA0ECOgAkIANBlojAACkAADcAbCADQZ2IwAApAAA3AHNBDyEIQfsACyADIAg6APQCQQAhFyADakEAOgAACyADIAMpAxggAygCICIBrXw3AxgCQCADLQATRQ0AIAMoAvACIgAEQCADKALsAiAAEFcLIANCADcC7AIgASAUTw0AAkACQCAKRQRAQQEhCAwBCyAKQQEQVSIIRQ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EBaigAACAAQQVqKAAAEBsgBEEJaiEEDAALAAsgICAYQQBHcUUNACARIBgQVwsgDEGQAWokACABCwkAIABBAToAJQuFAQAgAEEAOwEkIAFFBEAgAEIANwMYCyAAQQA6APQCIABBADoAbCAAQQA6ACYgACgC8AIiAQRAIAAoAuwCIAEQVwsgAEIANwMoIABBADsAFSAAQgA3AuwCIABCADcDMCAAQgA3AzggAEIANwNAIABCADcDSCAAQQA2AlAgACgC+AJBADoAAAsJACAAQQA6ACULCQAgACABNwNYCwkAIAAgATcDYAsJACAAIAE6ABcLCQAgACABOgAVCwkAIAAgAToAEQsJACAAIAE3AwgLCQAgACABNgIECwkAIAAgATYCAAsJACAAIAE6ABALCQAgACABOgAUCwkAIAAgAToAEwsJACAAIAE6ABYLCQAgACABOgASCwcAIAAtABQLBwAgAC0AEwsHACAALQAWCwcAIAAtABIL9AIBBX8gAUEJTwRAAkAgAEHN/3tBECABIAFBEE0bIgJrTw0AIAJBECAAQQtqQXhxIABBC0kbIgRqQQxqEFYiAEUNACAAQQhrIQECQCACQQFrIgMgAHFFBEAgASEADAELIABBBGsiBSgCACIGQXhxIAAgA2pBACACa3FBCGsiACACQQAgACABa0EQTRtqIgAgAWsiAmshAyAGQQNxBEAgACADIAAoAgRBAXFyQQJyNgIEIAAgA2oiAyADKAIEQQFyNgIEIAUgAiAFKAIAQQFxckECcjYCACABIAJqIgMgAygCBEEBcjYCBCABIAIQWgwBCyABKAIAIQEgACADNgIEIAAgASACajYCAAsCQCAAKAIEIgFBA3FFDQAgAUF4cSICIARBEGpNDQAgACAEIAFBAXFyQQJyNgIEIAAgBGoiASACIARrIgRBA3I2AgQgACACaiICIAIoAgRBAXI2AgQgASAEEFoLIABBCGohAwsgAw8LIAAQVguTJgIJfwF+IwBBEGsiCCQAAkACQAJAIABB9QFPBEAgAEHM/3tLBEBBACEADAQLIABBC2oiAUF4cSEFQdCbwAAoAgAiCUUNAkEfIQYgAEH1//8HTw0BIAVBJiABQQh2ZyIAa3ZB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AJAQfSbwAACfwJAAkACQAJAIAIoAgQiA0ECcUUEQCACQeCbwAAoAgBGDQIgAkHcm8AAKAIARg0DIAIgA0F4cSICEFkgASAAIAJqIgBBAXI2AgQgACABaiAANgIAIAFB3JvAACgCAEcNAUHUm8AAIAA2AgAPCyACIANBfnE2AgQgASAAQQFyNgIEIAAgAWogADYCAAsgAEGAAkkNBCABIAAQW0H0m8AAQfSbwAAoAgBBAWsiADYCACAADQZBvJnAACgCACIADQJB/x8MAwtB4JvAACABNgIAQdibwABB2JvAACgCACAAaiIANgIAIAEgAEEBcjYCBEHcm8AAKAIAIAFGBEBB1JvAAEEANgIAQdybwABBADYCAAsgAEHsm8AAKAIAIgJNDQVB4JvAACgCACIARQ0FQdibwAAoAgAiA0EpSQ0EQbSZwAAhAQNAIAAgASgCACIETwRAIAAgBCABKAIEakkNBgsgASgCCCEBDAALAAtB3JvAACABNgIAQdSbwABB1JvAACgCACAAaiIANgIAIAEgAEEBcjYCBCAAIAFqIAA2AgAPC0EAIQEDQCABQQFqIQEgACgCCCIADQALQf8fIAEgAUH/H00bCzYCAA8LAkBBzJvAACgCACICQQEgAEEDdnQiA3FFBEBBzJvAACACIANyNgIAIABB+AFxQcSZwABqIgAhAgwBCyAAQfgBcSIAQcSZwABqIQIgAEHMmcAAaigCACEACyACIAE2AgggACABNgIMIAEgAjYCDCABIAA2AggPC0H0m8AAQbyZwAAoAgAiAAR/QQAhAQNAIAFBAWohASAAKAIIIgANAAtB/x8gASABQf8fTRsFQf8fCzYCACACIANPDQBB7JvAAEF/NgIACwuCAwEEfyAAKAIMIQICQAJAAkAgAUGAAk8EQCAAKAIYIQMCQAJAIAAgAkYEQCAAQRRBECAAKAIUIgIbaigCACIBDQFBACECDAILIAAoAggiASACNgIMIAIgATYCCAwBCyAAQRRqIABBEGogAhshBANAIAQhBSABIgJBFGogAkEQaiACKAIUIgEbIQQgAkEUQRAgARtqKAIAIgENAAsgBUEANgIACyADRQ0CAkAgACgCHEECdEG0mMAAa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gdXNpbmcgY2h1bmtlZCB0cmFuc2ZlciBlbmNvZGluZ1VuZXhwZWN0ZWQgY29udGVudCBmb3IgdGhlIHJlcXVlc3QgKEdFVCBvciBIRUFEKVRyYW5zZmVyLUVuY29kaW5nIGxhc3QgaGVhZGVyIHZhbHVlIG11c3QgYmUgImNodW5rZWQiIGlmIHRoZSBoZWFkZXIgaXMgcHJlc2VudENodW5rIGhlYWRlciB0b28gbG9uZ0ludmFsaWQgY2h1bmsgbGVuZ3RoIGNoYXJhY3RlckludmFsaWQgY2h1bmsgbGVuZ3RoIHNpemVFeHBlY3RlZCBjaHVuayBleHRlbnNpb24gbmFtZUludmFsaWQgY2h1bmsgZXh0ZW5zaW9uIG5hbWUgY2hhcmFjdGVyRXhwZWN0ZWQgY2xvc2luZyBxdW90ZSBmb3IgY2h1bmsgZXh0ZW5zaW9uIHZhbHVlSW52YWxpZCBjaHVuayBleHRlbnNpb24gcXVvdGVkIHZhbHVlIGNoYXJhY3RlckV4cGVjdGVkIGNodW5rIGV4dGVuc2lvbiB2YWx1ZUludmFsaWQgY2h1bmsgZXh0ZW5zaW9uIHZhbHVlIGNoYXJhY3RlckludmFsaWQgY2h1bmsgZXh0ZW5zaW9uIGNoYXJhY3RlciBhZnRlciB2YWx1ZUV4cGVjdGVkIENSTEYgYWZ0ZXIgY2h1bmsgZGF0YVRyYWlsZXIgbGluZSB0b28gbG9uZ0ludmFsaWQgdHJhaWxlciBmaWVsZCBuYW1lIGNoYXJhY3RlckludmFsaWQgdHJhaWxlciBmaWVsZCB2YWx1ZSBjaGFyYWN0ZXJJbnZhbGlkIHN0YXRl","base64")),c=new TextEncoder,d=new TextDecoder;function e(a,b){let c=Number(BigInt.asUintN(32,b)),e=Number(b>>32n);a(d.decode(new Uint8Array(this.memory.buffer,e,c)))}function f(a){return this.alloc(a)>>>0}function g(a,b){return this.dealloc(a,b)}function h(){return this.create()>>>0}function i(a){this.destroy(a)}function j(a,b,c){return this.parse(a,b,c)>>>0}function k(a,b,d){let e=d.length,f=this.alloc(e),g=new Uint8Array(this.memory.buffer,f,e);c.encodeInto(d,g),this.fail(a,b,f,e),this.dealloc(f,e)}function l(){return 0!==this.milo_has_debug()}let m=Object.freeze({NONE:0,USER:1,CALLBACK_ERROR:2,UNEXPECTED_STATE:3,UNEXPECTED_DATA:4,UNEXPECTED_EOF:5,UNEXPECTED_CHARACTER:6,UNEXPECTED_CONTENT_LENGTH:7,UNEXPECTED_TRANSFER_ENCODING:8,UNEXPECTED_CONTENT:9,UNEXPECTED_TRAILERS:10,INVALID_VERSION:11,INVALID_STATUS:12,INVALID_CONTENT_LENGTH:13,INVALID_TRANSFER_ENCODING:14,INVALID_CHUNK_SIZE:15,MISSING_CONNECTION_UPGRADE:16,UNSUPPORTED_HTTP_VERSION:17,0:"NONE",1:"USER",2:"CALLBACK_ERROR",3:"UNEXPECTED_STATE",4:"UNEXPECTED_DATA",5:"UNEXPECTED_EOF",6:"UNEXPECTED_CHARACTER",7:"UNEXPECTED_CONTENT_LENGTH",8:"UNEXPECTED_TRANSFER_ENCODING",9:"UNEXPECTED_CONTENT",10:"UNEXPECTED_TRAILERS",11:"INVALID_VERSION",12:"INVALID_STATUS",13:"INVALID_CONTENT_LENGTH",14:"INVALID_TRANSFER_ENCODING",15:"INVALID_CHUNK_SIZE",16:"MISSING_CONNECTION_UPGRADE",17:"UNSUPPORTED_HTTP_VERSION"}),n=Object.freeze({OTHER:0,GET:1,HEAD:2,POST:3,PUT:4,DELETE:5,CONNECT:6,OPTIONS:7,TRACE:8,PATCH:9,PRI:10,0:"OTHER",1:"GET",2:"HEAD",3:"POST",4:"PUT",5:"DELETE",6:"CONNECT",7:"OPTIONS",8:"TRACE",9:"PATCH",10:"PRI"}),o=Object.freeze({ON_ERROR:0,ON_FINISH:1,ON_MESSAGE_START:2,ON_MESSAGE_COMPLETE:3,ON_REQUEST:4,ON_RESPONSE:5,ON_RESET:6,ON_METHOD:7,ON_URL:8,ON_PROTOCOL:9,ON_VERSION:10,ON_STATUS:11,ON_REASON:12,ON_HEADER_NAME:13,ON_HEADER_VALUE:14,ON_HEADERS:15,ON_CONNECT:16,ON_UPGRADE:17,ON_CHUNK_LENGTH:18,ON_CHUNK_EXTENSION_NAME:19,ON_CHUNK_EXTENSION_VALUE:20,ON_CHUNK:21,ON_BODY:22,ON_DATA:23,ON_TRAILER_NAME:24,ON_TRAILER_VALUE:25,ON_TRAILERS:26,ON_STATE_CHANGE:27,0:"ON_ERROR",1:"ON_FINISH",2:"ON_MESSAGE_START",3:"ON_MESSAGE_COMPLETE",4:"ON_REQUEST",5:"ON_RESPONSE",6:"ON_RESET",7:"ON_METHOD",8:"ON_URL",9:"ON_PROTOCOL",10:"ON_VERSION",11:"ON_STATUS",12:"ON_REASON",13:"ON_HEADER_NAME",14:"ON_HEADER_VALUE",15:"ON_HEADERS",16:"ON_CONNECT",17:"ON_UPGRADE",18:"ON_CHUNK_LENGTH",19:"ON_CHUNK_EXTENSION_NAME",20:"ON_CHUNK_EXTENSION_VALUE",21:"ON_CHUNK",22:"ON_BODY",23:"ON_DATA",24:"ON_TRAILER_NAME",25:"ON_TRAILER_VALUE",26:"ON_TRAILERS",27:"ON_STATE_CHANGE"}),p=Object.freeze({NONE:0n,ON_ERROR:1n,ON_FINISH:2n,ON_MESSAGE_START:4n,ON_MESSAGE_COMPLETE:8n,ON_REQUEST:16n,ON_RESPONSE:32n,ON_RESET:64n,ON_METHOD:128n,ON_URL:256n,ON_PROTOCOL:512n,ON_VERSION:1024n,ON_STATUS:2048n,ON_REASON:4096n,ON_HEADER_NAME:8192n,ON_HEADER_VALUE:16384n,ON_HEADERS:32768n,ON_CONNECT:65536n,ON_UPGRADE:131072n,ON_CHUNK_LENGTH:262144n,ON_CHUNK_EXTENSION_NAME:524288n,ON_CHUNK_EXTENSION_VALUE:1048576n,ON_CHUNK:2097152n,ON_BODY:4194304n,ON_DATA:8388608n,ON_TRAILER_NAME:16777216n,ON_TRAILER_VALUE:33554432n,ON_TRAILERS:67108864n,ON_STATE_CHANGE:134217728n,ALL:268435455n,0n:"NONE",1n:"ON_ERROR",2n:"ON_FINISH",4n:"ON_MESSAGE_START",8n:"ON_MESSAGE_COMPLETE",16n:"ON_REQUEST",32n:"ON_RESPONSE",64n:"ON_RESET",128n:"ON_METHOD",256n:"ON_URL",512n:"ON_PROTOCOL",1024n:"ON_VERSION",2048n:"ON_STATUS",4096n:"ON_REASON",8192n:"ON_HEADER_NAME",16384n:"ON_HEADER_VALUE",32768n:"ON_HEADERS",65536n:"ON_CONNECT",131072n:"ON_UPGRADE",262144n:"ON_CHUNK_LENGTH",524288n:"ON_CHUNK_EXTENSION_NAME",1048576n:"ON_CHUNK_EXTENSION_VALUE",2097152n:"ON_CHUNK",4194304n:"ON_BODY",8388608n:"ON_DATA",16777216n:"ON_TRAILER_NAME",33554432n:"ON_TRAILER_VALUE",67108864n:"ON_TRAILERS",134217728n:"ON_STATE_CHANGE",268435455n:"ALL"}),q=Object.freeze({END:0,ERROR:1,FINISH:2,MESSAGE_START:3,MESSAGE_COMPLETE:4,REQUEST:5,RESPONSE:6,RESET:7,METHOD:8,URL:9,PROTOCOL:10,VERSION:11,STATUS:12,REASON:13,HEADER_NAME:14,HEADER_VALUE:15,HEADERS:16,CONNECT:17,UPGRADE:18,CHUNK_LENGTH:19,CHUNK_EXTENSION_NAME:20,CHUNK_EXTENSION_VALUE:21,CHUNK:22,BODY:23,DATA:24,TRAILER_NAME:25,TRAILER_VALUE:26,TRAILERS:27,STATE_CHANGE:28,0:"END",1:"ERROR",2:"FINISH",3:"MESSAGE_START",4:"MESSAGE_COMPLETE",5:"REQUEST",6:"RESPONSE",7:"RESET",8:"METHOD",9:"URL",10:"PROTOCOL",11:"VERSION",12:"STATUS",13:"REASON",14:"HEADER_NAME",15:"HEADER_VALUE",16:"HEADERS",17:"CONNECT",18:"UPGRADE",19:"CHUNK_LENGTH",20:"CHUNK_EXTENSION_NAME",21:"CHUNK_EXTENSION_VALUE",22:"CHUNK",23:"BODY",24:"DATA",25:"TRAILER_NAME",26:"TRAILER_VALUE",27:"TRAILERS",28:"STATE_CHANGE"}),r=Object.freeze({NONE:0n,ON_ERROR:1n,ON_FINISH:2n,ON_MESSAGE_START:4n,ON_MESSAGE_COMPLETE:8n,ON_REQUEST:16n,ON_RESPONSE:32n,ON_RESET:64n,ON_METHOD:128n,ON_URL:256n,ON_PROTOCOL:512n,ON_VERSION:1024n,ON_STATUS:2048n,ON_REASON:4096n,ON_HEADER_NAME:8192n,ON_HEADER_VALUE:16384n,ON_HEADERS:32768n,ON_CONNECT:65536n,ON_UPGRADE:131072n,ON_CHUNK_LENGTH:262144n,ON_CHUNK_EXTENSION_NAME:524288n,ON_CHUNK_EXTENSION_VALUE:1048576n,ON_CHUNK:2097152n,ON_BODY:4194304n,ON_DATA:8388608n,ON_TRAILER_NAME:16777216n,ON_TRAILER_VALUE:33554432n,ON_TRAILERS:67108864n,ON_STATE_CHANGE:134217728n,ALL:268435455n,0n:"NONE",1n:"ON_ERROR",2n:"ON_FINISH",4n:"ON_MESSAGE_START",8n:"ON_MESSAGE_COMPLETE",16n:"ON_REQUEST",32n:"ON_RESPONSE",64n:"ON_RESET",128n:"ON_METHOD",256n:"ON_URL",512n:"ON_PROTOCOL",1024n:"ON_VERSION",2048n:"ON_STATUS",4096n:"ON_REASON",8192n:"ON_HEADER_NAME",16384n:"ON_HEADER_VALUE",32768n:"ON_HEADERS",65536n:"ON_CONNECT",131072n:"ON_UPGRADE",262144n:"ON_CHUNK_LENGTH",524288n:"ON_CHUNK_EXTENSION_NAME",1048576n:"ON_CHUNK_EXTENSION_VALUE",2097152n:"ON_CHUNK",4194304n:"ON_BODY",8388608n:"ON_DATA",16777216n:"ON_TRAILER_NAME",33554432n:"ON_TRAILER_VALUE",67108864n:"ON_TRAILERS",134217728n:"ON_STATE_CHANGE",268435455n:"ALL"}),s=Object.freeze({START:0,FINISH:1,ERROR:2,REQUEST_LINE:3,STATUS_LINE:4,HTTP2_PREFACE:5,HEADER:6,BODY_DECISION:7,BODY_VIA_CONTENT_LENGTH:8,BODY_WITH_NO_LENGTH:9,CHUNK_HEADER:10,CHUNK_EXTENSIONS:11,CHUNK_DATA:12,TRAILER:13,TUNNEL:14,0:"START",1:"FINISH",2:"ERROR",3:"REQUEST_LINE",4:"STATUS_LINE",5:"HTTP2_PREFACE",6:"HEADER",7:"BODY_DECISION",8:"BODY_VIA_CONTENT_LENGTH",9:"BODY_WITH_NO_LENGTH",10:"CHUNK_HEADER",11:"CHUNK_EXTENSIONS",12:"CHUNK_DATA",13:"TRAILER",14:"TUNNEL"}),t=Object.freeze({MAX_START_LINE_LENGTH:0,MAX_HEADER_LENGTH:4,MAX_BODY_PAYLOAD:8,AUTODETECT:16,IS_REQUEST:17,SUSPEND_AFTER_HEADERS:18,MANAGE_UNCONSUMED:19,CONTINUE_WITHOUT_DATA:20,IS_CONNECT:21,SKIP_BODY:22,DEBUG:23,PARSED:24,POSITION:32,STATE:36,PAUSED:37,ERROR_CODE:38,CONTENT_LENGTH:40,CHUNK_SIZE:48,REMAINING_CONTENT_LENGTH:56,REMAINING_CHUNK_SIZE:64,STATUS:72,METHOD:76,HAS_CONTENT_LENGTH:77,HAS_TRANSFER_ENCODING:78,HAS_CHUNKED_TRANSFER_ENCODING:79,HAS_CONNECTION_CLOSE:80,HAS_CONNECTION_UPGRADE:81,HAS_UPGRADE:82,HAS_TRAILERS:83,ACTIVE_CALLBACKS:88,ACTIVE_EVENTS:96,PTR:104,ERROR_DESCRIPTION:108,UNCONSUMED:364,UNCONSUMED_LEN:368,ERROR_DESCRIPTION_LEN:372,EVENTS:376,0:"MAX_START_LINE_LENGTH",4:"MAX_HEADER_LENGTH",8:"MAX_BODY_PAYLOAD",16:"AUTODETECT",17:"IS_REQUEST",18:"SUSPEND_AFTER_HEADERS",19:"MANAGE_UNCONSUMED",20:"CONTINUE_WITHOUT_DATA",21:"IS_CONNECT",22:"SKIP_BODY",23:"DEBUG",24:"PARSED",32:"POSITION",36:"STATE",37:"PAUSED",38:"ERROR_CODE",40:"CONTENT_LENGTH",48:"CHUNK_SIZE",56:"REMAINING_CONTENT_LENGTH",64:"REMAINING_CHUNK_SIZE",72:"STATUS",76:"METHOD",77:"HAS_CONTENT_LENGTH",78:"HAS_TRANSFER_ENCODING",79:"HAS_CHUNKED_TRANSFER_ENCODING",80:"HAS_CONNECTION_CLOSE",81:"HAS_CONNECTION_UPGRADE",82:"HAS_UPGRADE",83:"HAS_TRAILERS",88:"ACTIVE_CALLBACKS",96:"ACTIVE_EVENTS",104:"PTR",108:"ERROR_DESCRIPTION",364:"UNCONSUMED",368:"UNCONSUMED_LEN",372:"ERROR_DESCRIPTION_LEN",376:"EVENTS"});function u(a){return 0!==this.is_autodetect(a)}function v(a){return 0!==this.is_request(a)}function w(a){return 0!==this.is_paused(a)}function x(a){return 0!==this.should_manage_unconsumed(a)}function y(a){return 0!==this.should_suspend_after_headers(a)}function z(a){return this.get_max_start_line_length(a)>>>0}function A(a){return this.get_max_header_length(a)>>>0}function B(a){return BigInt.asUintN(64,this.get_max_body_payload(a))}function C(a){return 0!==this.should_continue_without_data(a)}function D(a){return 0!==this.is_connect(a)}function E(a){return 0!==this.is_debug(a)}function F(a){return 0!==this.should_skip_body(a)}function G(a){return this.get_state(a)>>>0}function H(a){return this.get_position(a)>>>0}function I(a){return BigInt.asUintN(64,this.get_parsed(a))}function J(a){return this.get_error_code(a)>>>0}function K(a){return this.get_method(a)>>>0}function L(a){return this.get_status(a)>>>0}function M(a){return 0!==this.has_connection_close(a)}function N(a){return 0!==this.has_connection_upgrade(a)}function O(a){return BigInt.asUintN(64,this.get_content_length(a))}function P(a){return BigInt.asUintN(64,this.get_chunk_size(a))}function Q(a){return BigInt.asUintN(64,this.get_remaining_content_length(a))}function R(a){return BigInt.asUintN(64,this.get_remaining_chunk_size(a))}function S(a){return 0!==this.has_content_length(a)}function T(a){return 0!==this.has_transfer_encoding(a)}function U(a){return 0!==this.has_chunked_transfer_encoding(a)}function V(a){return 0!==this.has_upgrade(a)}function W(a){return 0!==this.has_trailers(a)}function X(a){let b=this.get_error_description_raw(a),c=Number(BigInt.asUintN(32,b)),e=Number(b>>32n);return d.decode(new Uint8Array(this.memory.buffer,e,c))}function Y(a,b){this.set_should_autodetect(a,b)}function Z(a,b){this.set_should_continue_without_data(a,b)}function $(a,b){this.set_is_request(a,b)}function _(a,b){this.set_is_connect(a,b)}function aa(a,b){this.set_debug(a,b)}function ab(a,b){this.set_should_manage_unconsumed(a,b)}function ac(a,b){this.set_should_suspend_after_headers(a,b)}function ad(a,b){this.set_max_start_line_length(a,b)}function ae(a,b){this.set_max_header_length(a,b)}function af(a,b){this.set_max_body_payload(a,b)}function ag(a,b){this.set_should_skip_body(a,b)}function ah(a,b){this.set_active_callbacks(a,b)}function ai(a,b){this.set_active_events(a,b)}function aj(a,b){let c=b();return a[c]=[],this.setActiveCallbacks(c,this.CALLBACK_ACTIVE_ALL),c}function ak(a,b,c){a[c]=void 0,b(c)}function al(){}function am(a={}){let{logger:c,...d}=a,aj=al,ak={};c&&("function"!=typeof c&&(c=console.log),aj=e.bind(ak,c));let an=new WebAssembly.Instance(b,{env:{logger:aj,on_error:al,on_finish:al,on_message_start:al,on_message_complete:al,on_request:al,on_response:al,on_reset:al,on_method:al,on_url:al,on_protocol:al,on_version:al,on_status:al,on_reason:al,on_header_name:al,on_header_value:al,on_headers:al,on_connect:al,on_upgrade:al,on_chunk_length:al,on_chunk_extension_name:al,on_chunk_extension_value:al,on_chunk:al,on_body:al,on_data:al,on_trailer_name:al,on_trailer_value:al,on_trailers:al,on_state_change:al,...d}}).exports;return ak.memory=an.memory,{version:{raw:"0.9.0",major:0,minor:9,patch:0,prerelease:""},METHOD_OTHER:0,METHOD_GET:1,METHOD_HEAD:2,METHOD_POST:3,METHOD_PUT:4,METHOD_DELETE:5,METHOD_CONNECT:6,METHOD_OPTIONS:7,METHOD_TRACE:8,METHOD_PATCH:9,METHOD_PRI:10,CALLBACK_ON_ERROR:0,CALLBACK_ON_FINISH:1,CALLBACK_ON_MESSAGE_START:2,CALLBACK_ON_MESSAGE_COMPLETE:3,CALLBACK_ON_REQUEST:4,CALLBACK_ON_RESPONSE:5,CALLBACK_ON_RESET:6,CALLBACK_ON_METHOD:7,CALLBACK_ON_URL:8,CALLBACK_ON_PROTOCOL:9,CALLBACK_ON_VERSION:10,CALLBACK_ON_STATUS:11,CALLBACK_ON_REASON:12,CALLBACK_ON_HEADER_NAME:13,CALLBACK_ON_HEADER_VALUE:14,CALLBACK_ON_HEADERS:15,CALLBACK_ON_CONNECT:16,CALLBACK_ON_UPGRADE:17,CALLBACK_ON_CHUNK_LENGTH:18,CALLBACK_ON_CHUNK_EXTENSION_NAME:19,CALLBACK_ON_CHUNK_EXTENSION_VALUE:20,CALLBACK_ON_CHUNK:21,CALLBACK_ON_BODY:22,CALLBACK_ON_DATA:23,CALLBACK_ON_TRAILER_NAME:24,CALLBACK_ON_TRAILER_VALUE:25,CALLBACK_ON_TRAILERS:26,CALLBACK_ON_STATE_CHANGE:27,EVENT_END:0,EVENT_ERROR:1,EVENT_FINISH:2,EVENT_MESSAGE_START:3,EVENT_MESSAGE_COMPLETE:4,EVENT_REQUEST:5,EVENT_RESPONSE:6,EVENT_RESET:7,EVENT_METHOD:8,EVENT_URL:9,EVENT_PROTOCOL:10,EVENT_VERSION:11,EVENT_STATUS:12,EVENT_REASON:13,EVENT_HEADER_NAME:14,EVENT_HEADER_VALUE:15,EVENT_HEADERS:16,EVENT_CONNECT:17,EVENT_UPGRADE:18,EVENT_CHUNK_LENGTH:19,EVENT_CHUNK_EXTENSION_NAME:20,EVENT_CHUNK_EXTENSION_VALUE:21,EVENT_CHUNK:22,EVENT_BODY:23,EVENT_DATA:24,EVENT_TRAILER_NAME:25,EVENT_TRAILER_VALUE:26,EVENT_TRAILERS:27,EVENT_STATE_CHANGE:28,CALLBACK_ACTIVE_NONE:0n,EVENT_ACTIVE_NONE:0n,CALLBACK_ACTIVE_ON_ERROR:1n,EVENT_ACTIVE_ON_ERROR:1n,CALLBACK_ACTIVE_ON_FINISH:2n,EVENT_ACTIVE_ON_FINISH:2n,CALLBACK_ACTIVE_ON_MESSAGE_START:4n,EVENT_ACTIVE_ON_MESSAGE_START:4n,CALLBACK_ACTIVE_ON_MESSAGE_COMPLETE:8n,EVENT_ACTIVE_ON_MESSAGE_COMPLETE:8n,CALLBACK_ACTIVE_ON_REQUEST:16n,EVENT_ACTIVE_ON_REQUEST:16n,CALLBACK_ACTIVE_ON_RESPONSE:32n,EVENT_ACTIVE_ON_RESPONSE:32n,CALLBACK_ACTIVE_ON_RESET:64n,EVENT_ACTIVE_ON_RESET:64n,CALLBACK_ACTIVE_ON_METHOD:128n,EVENT_ACTIVE_ON_METHOD:128n,CALLBACK_ACTIVE_ON_URL:256n,EVENT_ACTIVE_ON_URL:256n,CALLBACK_ACTIVE_ON_PROTOCOL:512n,EVENT_ACTIVE_ON_PROTOCOL:512n,CALLBACK_ACTIVE_ON_VERSION:1024n,EVENT_ACTIVE_ON_VERSION:1024n,CALLBACK_ACTIVE_ON_STATUS:2048n,EVENT_ACTIVE_ON_STATUS:2048n,CALLBACK_ACTIVE_ON_REASON:4096n,EVENT_ACTIVE_ON_REASON:4096n,CALLBACK_ACTIVE_ON_HEADER_NAME:8192n,EVENT_ACTIVE_ON_HEADER_NAME:8192n,CALLBACK_ACTIVE_ON_HEADER_VALUE:16384n,EVENT_ACTIVE_ON_HEADER_VALUE:16384n,CALLBACK_ACTIVE_ON_HEADERS:32768n,EVENT_ACTIVE_ON_HEADERS:32768n,CALLBACK_ACTIVE_ON_CONNECT:65536n,EVENT_ACTIVE_ON_CONNECT:65536n,CALLBACK_ACTIVE_ON_UPGRADE:131072n,EVENT_ACTIVE_ON_UPGRADE:131072n,CALLBACK_ACTIVE_ON_CHUNK_LENGTH:262144n,EVENT_ACTIVE_ON_CHUNK_LENGTH:262144n,CALLBACK_ACTIVE_ON_CHUNK_EXTENSION_NAME:524288n,EVENT_ACTIVE_ON_CHUNK_EXTENSION_NAME:524288n,CALLBACK_ACTIVE_ON_CHUNK_EXTENSION_VALUE:1048576n,EVENT_ACTIVE_ON_CHUNK_EXTENSION_VALUE:1048576n,CALLBACK_ACTIVE_ON_CHUNK:2097152n,EVENT_ACTIVE_ON_CHUNK:2097152n,CALLBACK_ACTIVE_ON_BODY:4194304n,EVENT_ACTIVE_ON_BODY:4194304n,CALLBACK_ACTIVE_ON_DATA:8388608n,EVENT_ACTIVE_ON_DATA:8388608n,CALLBACK_ACTIVE_ON_TRAILER_NAME:16777216n,EVENT_ACTIVE_ON_TRAILER_NAME:16777216n,CALLBACK_ACTIVE_ON_TRAILER_VALUE:33554432n,EVENT_ACTIVE_ON_TRAILER_VALUE:33554432n,CALLBACK_ACTIVE_ON_TRAILERS:67108864n,EVENT_ACTIVE_ON_TRAILERS:67108864n,CALLBACK_ACTIVE_ON_STATE_CHANGE:134217728n,EVENT_ACTIVE_ON_STATE_CHANGE:134217728n,CALLBACK_ACTIVE_ALL:268435455n,EVENT_ACTIVE_ALL:268435455n,ERROR_NONE:0,ERROR_USER:1,ERROR_CALLBACK_ERROR:2,ERROR_UNEXPECTED_STATE:3,ERROR_UNEXPECTED_DATA:4,ERROR_UNEXPECTED_EOF:5,ERROR_UNEXPECTED_CHARACTER:6,ERROR_UNEXPECTED_CONTENT_LENGTH:7,ERROR_UNEXPECTED_TRANSFER_ENCODING:8,ERROR_UNEXPECTED_CONTENT:9,ERROR_UNEXPECTED_TRAILERS:10,ERROR_INVALID_VERSION:11,ERROR_INVALID_STATUS:12,ERROR_INVALID_CONTENT_LENGTH:13,ERROR_INVALID_TRANSFER_ENCODING:14,ERROR_INVALID_CHUNK_SIZE:15,ERROR_MISSING_CONNECTION_UPGRADE:16,ERROR_UNSUPPORTED_HTTP_VERSION:17,STATE_START:0,STATE_FINISH:1,STATE_ERROR:2,STATE_REQUEST_LINE:3,STATE_STATUS_LINE:4,STATE_HTTP2_PREFACE:5,STATE_HEADER:6,STATE_BODY_DECISION:7,STATE_BODY_VIA_CONTENT_LENGTH:8,STATE_BODY_WITH_NO_LENGTH:9,STATE_CHUNK_HEADER:10,STATE_CHUNK_EXTENSIONS:11,STATE_CHUNK_DATA:12,STATE_TRAILER:13,STATE_TUNNEL:14,PARSER_FIELD_MAX_START_LINE_LENGTH:0,PARSER_FIELD_MAX_HEADER_LENGTH:4,PARSER_FIELD_MAX_BODY_PAYLOAD:8,PARSER_FIELD_AUTODETECT:16,PARSER_FIELD_IS_REQUEST:17,PARSER_FIELD_SUSPEND_AFTER_HEADERS:18,PARSER_FIELD_MANAGE_UNCONSUMED:19,PARSER_FIELD_CONTINUE_WITHOUT_DATA:20,PARSER_FIELD_IS_CONNECT:21,PARSER_FIELD_SKIP_BODY:22,PARSER_FIELD_DEBUG:23,PARSER_FIELD_PARSED:24,PARSER_FIELD_POSITION:32,PARSER_FIELD_STATE:36,PARSER_FIELD_PAUSED:37,PARSER_FIELD_ERROR_CODE:38,PARSER_FIELD_CONTENT_LENGTH:40,PARSER_FIELD_CHUNK_SIZE:48,PARSER_FIELD_REMAINING_CONTENT_LENGTH:56,PARSER_FIELD_REMAINING_CHUNK_SIZE:64,PARSER_FIELD_STATUS:72,PARSER_FIELD_METHOD:76,PARSER_FIELD_HAS_CONTENT_LENGTH:77,PARSER_FIELD_HAS_TRANSFER_ENCODING:78,PARSER_FIELD_HAS_CHUNKED_TRANSFER_ENCODING:79,PARSER_FIELD_HAS_CONNECTION_CLOSE:80,PARSER_FIELD_HAS_CONNECTION_UPGRADE:81,PARSER_FIELD_HAS_UPGRADE:82,PARSER_FIELD_HAS_TRAILERS:83,PARSER_FIELD_ACTIVE_CALLBACKS:88,PARSER_FIELD_ACTIVE_EVENTS:96,PARSER_FIELD_PTR:104,PARSER_FIELD_ERROR_DESCRIPTION:108,PARSER_FIELD_UNCONSUMED:364,PARSER_FIELD_UNCONSUMED_LEN:368,PARSER_FIELD_ERROR_DESCRIPTION_LEN:372,PARSER_FIELD_EVENTS:376,Errors:m,Methods:n,Callbacks:o,CallbackActives:p,Events:q,EventActives:r,States:s,ParserFields:t,isAutodetect:u.bind(an),isRequest:v.bind(an),isPaused:w.bind(an),shouldManageUnconsumed:x.bind(an),shouldSuspendAfterHeaders:y.bind(an),getMaxStartLineLength:z.bind(an),getMaxHeaderLength:A.bind(an),getMaxBodyPayload:B.bind(an),shouldContinueWithoutData:C.bind(an),isConnect:D.bind(an),isDebug:E.bind(an),shouldSkipBody:F.bind(an),getState:G.bind(an),getPosition:H.bind(an),getParsed:I.bind(an),getErrorCode:J.bind(an),getMethod:K.bind(an),getStatus:L.bind(an),hasConnectionClose:M.bind(an),hasConnectionUpgrade:N.bind(an),getContentLength:O.bind(an),getChunkSize:P.bind(an),getRemainingContentLength:Q.bind(an),getRemainingChunkSize:R.bind(an),hasContentLength:S.bind(an),hasTransferEncoding:T.bind(an),hasChunkedTransferEncoding:U.bind(an),hasUpgrade:V.bind(an),hasTrailers:W.bind(an),getErrorDescription:X.bind(an),setShouldAutodetect:Y.bind(an),setShouldContinueWithoutData:Z.bind(an),setIsRequest:$.bind(an),setIsConnect:_.bind(an),setDebug:aa.bind(an),setShouldManageUnconsumed:ab.bind(an),setShouldSuspendAfterHeaders:ac.bind(an),setMaxStartLineLength:ad.bind(an),setMaxHeaderLength:ae.bind(an),setMaxBodyPayload:af.bind(an),setShouldSkipBody:ag.bind(an),setActiveCallbacks:ah.bind(an),setActiveEvents:ai.bind(an),memory:an.memory,alloc:f.bind(an),dealloc:g.bind(an),create:h.bind(an),destroy:i.bind(an),parse:j.bind(an),fail:k.bind(an),hasDebug:l.bind(an),clear:an.clear,complete:an.complete,finish:an.finish,pause:an.pause,reset:an.reset,resume:an.resume}}a.exports={wasmModule:b,noop:al,setup:am,simple:function(){let a={},b=am({});return b.spans=a,b.create=aj.bind(b,a,b.create),b.destroy=ak.bind(b,a,b.destroy),b}}},56698:(a,b,c)=>{"use strict";let d=c(34589);class e{#b3=!1;#b4;#a$;#R;#b5;constructor(a,b,c){if("function"!=typeof a)throw TypeError("callback must be a function");this.#b4=a,this.#a$=b,this.#b5=c}onRequestStart(a,b){this.#b3=!1,this.#R=b}onRequestUpgrade(a,b,c,d){this.#a$.onRequestUpgrade?.(a,b,c,d)}onResponseStart(a,b,c,e){if(d(null!=this.#b4),this.#b3=304===b||this.#b5&&b>=500&&b<=504,this.#b4(this.#b3,this.#R,b,c),this.#b4=null,this.#b3)return!0;this.#a$.onRequestStart?.(a,this.#R),this.#a$.onResponseStart?.(a,b,c,e)}onResponseData(a,b){if(!this.#b3)return this.#a$.onResponseData?.(a,b)}onResponseEnd(a,b){this.#b3||this.#a$.onResponseEnd?.(a,b)}onResponseError(a,b){if(!this.#b3){if(this.#b4){if(this.#b5){this.#b3=!0,this.#b4(!0,this.#R),this.#b4=null;return}this.#b4(!1),this.#b4=null}if("function"==typeof this.#a$.onResponseError)this.#a$.onResponseError(a,b);else throw b}}}a.exports=e},56758:(a,b,c)=>{"use strict";let d={__proto__:null,"node:crypto":()=>c(77598),"node:sqlite":()=>c(79868)},e=["crypto","sqlite"];class f{#b6=new Map;clear(){this.#b6.clear()}has(a){return this.#b6.get(a)??this.#b7(a)}set(a,b){if(!1===e.includes(a))throw TypeError(`unknown feature: ${a}`);this.#b6.set(a,b)}#b7(a){let b=function(a){if(e.includes(a)){var b=`node:${a}`;try{return d[b](),!0}catch(a){if("ERR_UNKNOWN_BUILTIN_MODULE"!==a.code&&"ERR_NO_CRYPTO"!==a.code)throw a;return!1}}throw TypeError(`unknown feature: ${a}`)}(a);return this.#b6.set(a,b),b}}let g=new f;a.exports.runtimeFeatures=g,a.exports.default=g},57317:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{FD:()=>o,nl:()=>m});var e=c(55511),f=c(21616),g=c(79499);let a=null;if(!("u">typeof caches&&"object"==typeof caches||"u">typeof EdgeRuntime))try{a=await Promise.resolve().then(c.t.bind(c,73496,23))}catch{}let p=new Map;function h(a,b){let c=a.get(b)?.[0]?.value;return c&&"number"!=typeof c?Buffer.from(c).toString("utf8"):""}function i(a,b){let c=b,d=0n;for(let b=0;b<10;b+=1){if(c>=a.length)throw Error("truncated protobuf varint");let e=a[c++];if(d|=BigInt(127&e)<<BigInt(7*b),(128&e)==0){if(d>BigInt(Number.MAX_SAFE_INTEGER))throw Error("protobuf varint exceeds safe range");return[Number(d),c]}}throw Error("protobuf varint exceeds 10 bytes")}function j(a){let b=Buffer.from(a),c=0;for(;c<b.length;){let a,d;[a,c]=i(b,c);let e=Math.floor(a/8),f=a%8;if(0===e)throw Error("protobuf field zero is invalid");if(0===f){[,c]=i(b,c);continue}let g=1===f?8:5===f?4:null;if(null!==g){if(g>b.length-c)throw Error("truncated fixed protobuf field");c+=g;continue}if(2!==f)throw Error(`unsupported protobuf wire type ${f}`);if([d,c]=i(b,c),d>b.length-c)throw Error("truncated protobuf field");c+=d}}function k({url:b,headers:c,signal:d}){return a?new Promise((e,f)=>{let g,h=new URL(b),i=a.connect(`${h.protocol}//${h.host}`),j=[],k={},l=!1,m=(a,b)=>{if(!l){l=!0,clearTimeout(o),d?.removeEventListener?.("abort",n);try{g?.close?.()}catch{}try{i.close()}catch{}a(b)}},n=()=>{let a=Error("Cursor model request aborted");a.name="AbortError",m(f,a)},o=setTimeout(()=>{m(f,Error("Cursor model request timed out"))},1e4);o.unref?.(),i.on("error",a=>m(f,a)),(g=i.request({":method":"POST",":path":h.pathname,":authority":h.host,":scheme":h.protocol.slice(0,-1),...c})).on("response",a=>{k=a}),g.on("data",a=>j.push(a)),g.on("error",a=>m(f,a)),g.on("end",()=>m(e,{status:Number(k[":status"]||0),body:Buffer.concat(j)})),d?.aborted?n():d?.addEventListener?.("abort",n,{once:!0}),l||g.end()}):Promise.reject(Error("HTTP/2 is unavailable for Cursor model discovery"))}function l(a,b){return a.get(b)?.[0]?.value===1}function m(a){if(!Array.isArray(a)||0===a.length)return null;let b=a.filter(a=>a.supportsAgent&&!a.isChatOnly&&!a.isHidden);return 0===b.length?null:{modelId:(b.find(a=>a.defaultOn)||b[0]).id,matchedBy:"auto-default"}}function n(a,b){return{models:a,source:"static",warning:b}}async function o(a={},b={}){let c,d=Array.isArray(b.staticModels)?b.staticModels:[];if(!a.accessToken||!a.providerSpecificData?.machineId)return n(d,"Cursor live catalog needs a valid token and machine ID; using static catalog.");let i=(c=[a?.id,a?.providerSpecificData?.machineId].filter(Boolean).join(":"))?(0,e.createHash)("sha256").update(`cursor:${c}`).digest("hex"):null,m=Date.now();if(!b.forceRefresh&&i){let a=p.get(i);if(a?.expiresAt>m)return{models:a.models,source:"live"}}let q=b.requestFn||k;try{let c,e=await q({url:"https://agent.api5.cursor.sh/agent.v1.AgentService/GetUsableModels",headers:(c={...(0,f.JA)(a.accessToken,a.providerSpecificData.machineId,!1!==a.providerSpecificData.ghostMode),accept:"application/proto","content-type":"application/proto"},delete c["connect-accept-encoding"],delete c["connect-protocol-version"],c),signal:b.signal});if(e?.status!==200)return n(d,`Cursor live catalog returned HTTP ${Number(e?.status)||502}; using static catalog.`);let k=function(a,b){let c=function(a){let b=(0,g.Y8)(a),c=new Set,d=[];for(let a of b.get(2)||[]){if(!a?.value||"number"==typeof a.value)continue;let b=(0,g.Y8)(a.value),e=h(b,1).trim();!e||c.has(e)||(c.add(e),d.push({id:e,defaultOn:l(b,2),isChatOnly:l(b,4),supportsAgent:l(b,5),isHidden:l(b,35)}))}return d}(b);if(!c.length||!Array.isArray(a))return a;let d=new Map(c.map(a=>[a.id,a]));return a.map(a=>{let b=d.get(a.id);return b?{...a,...b}:a})}(function(a){j(a);let b=(0,g.Y8)(new Uint8Array(a)),c=new Set,d=[];for(let a of b.get(1)||[]){if(!a?.value||"number"==typeof a.value)continue;j(a.value);let b=(0,g.Y8)(a.value),e=h(b,1).trim();if(!e||c.has(e))continue;c.add(e);let f=(h(b,4)||h(b,5)||h(b,3)||e).trim();d.push({id:e,name:f})}return d}(e.body),e.body);if(!k.length)return n(d,"Cursor returned a malformed model catalog; using static catalog.");return i&&p.set(i,{expiresAt:m+3e5,models:k}),{models:k,source:"live"}}catch(c){let a=c?.name==="AbortError"?"Cursor live catalog request was cancelled; using static catalog.":"Cursor live catalog temporarily unavailable; using static catalog.";return b.log?.warn?.("CURSOR_MODELS",a),n(d,a)}}d()}catch(a){d(a)}},1)},57431:(a,b,c)=>{"use strict";c.r(b),c.d(b,{admitApiKeyRequest:()=>p,checkApiKeyBudget:()=>w,checkApiKeyTokenQuota:()=>u,createApiKey:()=>m,deleteApiKey:()=>q,getApiKeyById:()=>l,getApiKeyConnectionPolicy:()=>t,getApiKeyPolicy:()=>s,getApiKeys:()=>k,incrementKeyTokens:()=>v,maskApiKey:()=>i,rotateApiKey:()=>o,updateApiKey:()=>n,validateApiKey:()=>r});var d=c(27137),e=c(52825);let f=new Map,g=new Map;function h(a){let b=a;if(!Array.isArray(b)){if(!b)return[];try{b=JSON.parse(b)}catch{return[]}}return Array.isArray(b)?[...new Set(b.filter(a=>"string"==typeof a).map(a=>a.trim()).filter(Boolean))]:[]}function i(a){return a?a.length<=12?`${a.slice(0,4)}…`:`${a.slice(0,8)}…${a.slice(-4)}`:null}function j(a,b=!1){return a?{id:a.id,key:b?a.key:void 0,maskedKey:i(a.key),name:a.name,machineId:a.machineId,isActive:1===a.isActive||!0===a.isActive,createdAt:a.createdAt,budgetDaily:a.budgetDaily||0,budgetMonthly:a.budgetMonthly||0,requestsPerMinute:a.requestsPerMinute||0,tokenLimit:Number(a.tokenLimit)||0,usedTokens:Number(a.usedTokens)||0,allowedModels:function(a){if(Array.isArray(a))return a;if(!a)return[];try{return JSON.parse(a)}catch{return[]}}(a.allowedModels),allowedConnectionIds:h(a.allowedConnectionIds),allowedCombos:h(a.allowedCombos)}:null}async function k(a=!1){return(await (0,e.cK)()).all("SELECT * FROM apiKeys ORDER BY createdAt ASC").map(b=>j(b,a))}async function l(a,b=!1){return j((await (0,e.cK)()).get("SELECT * FROM apiKeys WHERE id = ?",[a]),b)}async function m(a,b){if(!b)throw Error("machineId is required");let f=await (0,e.cK)(),{generateApiKeyWithMachine:g}=await c.e(6103).then(c.bind(c,86103)),h=g(b),i={id:(0,d.A)(),name:a,key:h.key,machineId:b,isActive:!0,createdAt:new Date().toISOString()};return f.run("INSERT INTO apiKeys(id, key, name, machineId, isActive, createdAt) VALUES(?, ?, ?, ?, ?, ?)",[i.id,i.key,i.name,i.machineId,1,i.createdAt]),i}async function n(a,b){let c=await (0,e.cK)(),d=null;return c.transaction(()=>{let e=c.get("SELECT * FROM apiKeys WHERE id = ?",[a]);if(!e)return;let f={...j(e,!0),...b};c.run("UPDATE apiKeys SET key = ?, name = ?, machineId = ?, isActive = ?, budgetDaily = ?, budgetMonthly = ?, requestsPerMinute = ?, tokenLimit = ?, usedTokens = ?, allowedModels = ?, allowedConnectionIds = ?, allowedCombos = ? WHERE id = ?",[f.key,f.name,f.machineId,+!!f.isActive,Number(f.budgetDaily)||0,Number(f.budgetMonthly)||0,Number(f.requestsPerMinute)||0,Math.max(0,Number(f.tokenLimit)||0),Math.max(0,Number(f.usedTokens)||0),JSON.stringify(f.allowedModels||[]),JSON.stringify(h(f.allowedConnectionIds)),JSON.stringify(h(f.allowedCombos)),a]),d=f}),d}async function o(a){let b=await (0,e.cK)(),d=b.get("SELECT * FROM apiKeys WHERE id = ?",[a]);if(!d)return null;let{generateApiKeyWithMachine:f}=await c.e(6103).then(c.bind(c,86103)),g=f(d.machineId).key;return b.run("UPDATE apiKeys SET key = ? WHERE id = ?",[g,a]),{...j({...d,key:g}),key:g}}async function p(a){let b=(await (0,e.cK)()).get("SELECT budgetDaily, budgetMonthly, requestsPerMinute FROM apiKeys WHERE key = ?",[a]);if(!b)return{allowed:!0,touch(){},release(){}};let c=Number(b.requestsPerMinute)||0;if(c>0){let b=Date.now(),d=(g.get(a)||[]).filter(a=>b-a<6e4);if(d.length>=c){let c=Math.max(1,Math.ceil((6e4-(b-d[0]))/1e3));return g.set(a,d),{allowed:!1,status:429,retryAfter:c,reason:"API key rate limit exceeded"}}d.push(b),!g.has(a)&&g.size>=1e4&&function(a){for(let[b,c]of g)(0===c.length||a-c[c.length-1]>=6e4)&&g.delete(b)}(b),g.set(a,d)}if(!(Number(b.budgetDaily)>0||Number(b.budgetMonthly)>0))return{allowed:!0,touch(){},release(){}};let d=Date.now(),h=f.get(a);if(h&&d-h.activeAt<6e4)return{allowed:!1,status:429,retryAfter:1,reason:"A budgeted request is already in progress"};let i={token:Symbol("budget-slot"),activeAt:d};return f.set(a,i),{allowed:!0,touch:()=>{let b=f.get(a);b?.token===i.token&&(b.activeAt=Date.now())},release:()=>{f.get(a)?.token===i.token&&f.delete(a)}}}async function q(a){let b=(await (0,e.cK)()).run("DELETE FROM apiKeys WHERE id = ?",[a]);return(b?.changes??0)>0}async function r(a){let b=(await (0,e.cK)()).get("SELECT isActive FROM apiKeys WHERE key = ?",[a]);return!!b&&(1===b.isActive||!0===b.isActive)}async function s(a){if(!a)return null;let b=(await (0,e.cK)()).get("SELECT isActive, allowedModels, allowedConnectionIds, allowedCombos FROM apiKeys WHERE key = ?",[a]);return b?Object.freeze({active:1===b.isActive||!0===b.isActive,allowedModels:Object.freeze(h(b.allowedModels)),allowedConnectionIds:Object.freeze(h(b.allowedConnectionIds)),allowedCombos:Object.freeze(h(b.allowedCombos))}):null}async function t(a){if(!a)return null;let b=(await (0,e.cK)()).get("SELECT allowedConnectionIds FROM apiKeys WHERE key = ?",[a]);return b?h(b.allowedConnectionIds):null}async function u(a){if(!a)return{allowed:!0};let b=(await (0,e.cK)()).get("SELECT isActive, tokenLimit, usedTokens FROM apiKeys WHERE key = ?",[a]);if(!b)return{allowed:!0};if(1!==b.isActive&&!0!==b.isActive)return{allowed:!1,status:401,reason:"API key is paused"};let c=Number(b.tokenLimit)||0,d=Number(b.usedTokens)||0;return c>0&&d>=c?{allowed:!1,status:429,reason:`Token limit exceeded for this API key (${d} / ${c} tokens used)`}:{allowed:!0,tokenLimit:c,usedTokens:d}}async function v(a,b){let c=Math.floor(Number(b));a&&Number.isFinite(c)&&!(c<=0)&&(await (0,e.cK)()).run("UPDATE apiKeys SET usedTokens = COALESCE(usedTokens, 0) + ? WHERE key = ?",[c,a])}async function w(a){let b=await (0,e.cK)(),c=b.get("SELECT budgetDaily, budgetMonthly FROM apiKeys WHERE key = ?",[a]);if(!c)return{allowed:!0};let d=c.budgetDaily||0,f=c.budgetMonthly||0;if(d<=0&&f<=0)return{allowed:!0,budgetDaily:d,budgetMonthly:f};let g=0,h=0;try{if(d>0){let c=new Date;c.setHours(0,0,0,0);let d=b.get("SELECT COALESCE(SUM(cost), 0) AS total FROM usageHistory WHERE apiKey = ? AND timestamp >= ?",[a,c.toISOString()]);g=d?.total||0}if(f>0){let c=new Date;c.setDate(1),c.setHours(0,0,0,0);let d=b.get("SELECT COALESCE(SUM(cost), 0) AS total FROM usageHistory WHERE apiKey = ? AND timestamp >= ?",[a,c.toISOString()]);h=d?.total||0}}catch(a){return{allowed:!1,error:!0,reason:"Budget accounting unavailable"}}return d>0&&g>=d?{allowed:!1,reason:`Daily budget exceeded ($${g.toFixed(4)} / $${d})`,spentDaily:g,spentMonthly:h,budgetDaily:d,budgetMonthly:f}:f>0&&h>=f?{allowed:!1,reason:`Monthly budget exceeded ($${h.toFixed(4)} / $${f})`,spentDaily:g,spentMonthly:h,budgetDaily:d,budgetMonthly:f}:{allowed:!0,spentDaily:g,spentMonthly:h,budgetDaily:d,budgetMonthly:f}}},57435:(a,b,c)=>{"use strict";let{Readable:d,Duplex:e,PassThrough:f}=c(57075),g=c(34589),{AsyncResource:h}=c(16698),{InvalidArgumentError:i,InvalidReturnValueError:j,RequestAbortedError:k}=c(61448),l=c(84285),{kBodyUsed:m}=c(49176),{addSignal:n,removeSignal:o}=c(73135);function p(){}let q=Symbol("resume");class r extends d{constructor(){super({autoDestroy:!0}),this[q]=null,this[m]=!0}_read(){let{[q]:a}=this;a&&(this[q]=null,a())}_destroy(a,b){this._read(),b(a)}}class s extends d{constructor(a){super({autoDestroy:!0}),this[q]=a}_read(){this[q]()}_destroy(a,b){a||this._readableState.endEmitted||(a=new k),b(a)}}class t extends h{constructor(a,b){if(!a||"object"!=typeof a)throw new i("invalid opts");if("function"!=typeof b)throw new i("invalid handler");let{signal:c,method:d,opaque:f,onInfo:g,responseHeaders:h}=a;if(c&&"function"!=typeof c.on&&"function"!=typeof c.addEventListener)throw new i("signal must be an EventEmitter or EventTarget");if("CONNECT"===d)throw new i("invalid method");if(g&&"function"!=typeof g)throw new i("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=f||null,this.responseHeaders=h||null,this.handler=b,this.abort=null,this.context=null,this.onInfo=g||null,this.req=new r().on("error",p),this.ret=new e({readableObjectMode:a.objectMode,autoDestroy:!0,read:()=>{let{body:a}=this;a?.resume&&a.resume()},write:(a,b,c)=>{let{req:d}=this;d.push(a,b)||d._readableState.destroyed?c():d[q]=c},destroy:(a,b)=>{let{body:c,req:d,res:e,ret:f,abort:g}=this;a||f._readableState.endEmitted||(a=new k),g&&a&&g(),l.destroy(c,a),l.destroy(d,a),l.destroy(e,a),o(this),b(a)}}).on("prefinish",()=>{let{req:a}=this;a.push(null)}),this.res=null,n(this,c)}onRequestStart(a,b){let{res:c}=this;this.reason?a.abort(this.reason):(g(!c,"pipeline cannot be retried"),this.abort=b=>a.abort(b),this.context=b)}onResponseStart(a,b,c,d){let e,{opaque:f,handler:g,context:h}=this;if(b<200){if(this.onInfo){let d=a?.rawHeaders,e="raw"===this.responseHeaders?l.parseRawHeaders(d):c;this.onInfo({statusCode:b,headers:e})}return}this.res=new s(()=>a.resume());try{this.handler=null;let d=a?.rawHeaders,i="raw"===this.responseHeaders?l.parseRawHeaders(d):c;e=this.runInAsyncScope(g,null,{statusCode:b,headers:i,opaque:f,body:this.res,context:h})}catch(a){throw this.res.on("error",p),a}if(!e||"function"!=typeof e.on)throw new j("expected Readable");e.on("data",a=>{let{ret:b,body:c}=this;!b.push(a)&&c.pause&&c.pause()}).on("error",a=>{let{ret:b}=this;l.destroy(b,a)}).on("end",()=>{let{ret:a}=this;a.push(null)}).on("close",()=>{let{ret:a}=this;a._readableState.ended||l.destroy(a,new k)}),this.body=e}onResponseData(a,b){let{res:c}=this;!1===c.push(b)&&a.pause()}onResponseEnd(a,b){let{res:c}=this;c.push(null)}onResponseError(a,b){let{ret:c}=this;this.handler=null,l.destroy(c,b)}}a.exports=function(a,b){try{let c=new t(a,b);return this.dispatch({...a,body:c.req},c),c.ret}catch(a){return new f().destroy(a)}}},57472:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"tencent",alias:"hunyuan",aliases:["tencent-hunyuan"],category:"apikey",authModes:["apikey"],display:{name:"Tencent Hunyuan",icon:"cloud",color:"#0052D9",textIcon:"HY",website:"https://cloud.tencent.com/product/hunyuan",notice:{apiKeyUrl:"https://console.cloud.tencent.com/hunyuan/api-key"}},transport:{baseUrl:"https://api.hunyuan.cloud.tencent.com/v1/chat/completions",validateUrl:"https://api.hunyuan.cloud.tencent.com/v1/models",format:"openai"},models:[{id:"hunyuan-turbos-latest",name:"Hunyuan TurboS Latest",contextLength:2e5},{id:"hunyuan-t1-latest",name:"Hunyuan T1 Latest",contextLength:256e3}],serviceKinds:["llm"]}},57861:(a,b,c)=>{"use strict";function d(a){return a&&"object"==typeof a?"string"==typeof a.reasoning_content&&a.reasoning_content?a.reasoning_content:"string"==typeof a.reasoning&&a.reasoning?a.reasoning:Array.isArray(a.reasoning_details)?a.reasoning_details.map(a=>"string"==typeof a?a:a?.text||a?.content||"").join(""):"":""}c.d(b,{V:()=>d})},58001:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"agnes",alias:"agnes",aliases:["agnes-ai"],category:"freeTier",authModes:["apikey"],passthroughModels:!0,display:{name:"Agnes AI",icon:"auto_awesome",color:"#7C3AED",textIcon:"AG",website:"https://agnes-ai.com",notice:{text:"OpenAI-compatible gateway. Accepts a bearer token. The live catalogue needs a key, so the seed list is a starting set.",apiKeyUrl:"https://platform.agnes-ai.com"}},transport:{baseUrl:"https://apihub.agnes-ai.com/v1/chat/completions",validateUrl:"https://apihub.agnes-ai.com/v1/models",format:"openai"},models:[{id:"agnes-2.5-flash",name:"Agnes 2.5 Flash"},{id:"agnes-2.5-pro",name:"Agnes 2.5 Pro"},{id:"agnes-2.5-pro-beta",name:"Agnes 2.5 Pro Beta"},{id:"agnes-3.0-flash",name:"Agnes 3.0 Flash"}],serviceKinds:["llm"]}},58455:(a,b,c)=>{"use strict";c.d(b,{M:()=>e});var d=c(8735);function e(a){let b=a.max_tokens||d.Uc;return a.tools&&Array.isArray(a.tools)&&a.tools.length>0&&b<d.eo&&(b=d.eo),a.thinking?.budget_tokens&&b<=a.thinking.budget_tokens&&(b=a.thinking.budget_tokens+1024),b}},58609:(a,b,c)=>{"use strict";c.d(b,{U:()=>f});var d=c(52825),e=c(50743);function f(a){return{async get(b,c=null){let f=(await (0,d.cK)()).get("SELECT value FROM kv WHERE scope = ? AND key = ?",[a,b]);return f?(0,e.q)(f.value,c):c},async getAll(){let b=(await (0,d.cK)()).all("SELECT key, value FROM kv WHERE scope = ?",[a]),c={};for(let a of b)c[a.key]=(0,e.q)(a.value);return c},async set(b,c){(await (0,d.cK)()).run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,b,(0,e.s)(c)])},async setMany(b){let c=await (0,d.cK)();c.transaction(()=>{for(let[d,f]of Object.entries(b))c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,d,(0,e.s)(f)])})},async remove(b){(await (0,d.cK)()).run("DELETE FROM kv WHERE scope = ? AND key = ?",[a,b])},async clear(){(await (0,d.cK)()).run("DELETE FROM kv WHERE scope = ?",[a])}}}},59011:(a,b,c)=>{"use strict";c.d(b,{T:()=>I});var d=c(55511),e=c(69384);let f=`You are Codex, based on GPT-5. You are running as a coding agent in the Codex CLI on a user's computer.
350
+ `),f("data: [DONE]\n\n");try{n||(n=!0,k.stdin.end())}catch{}let e=setTimeout(()=>{k.killed||k.kill("SIGKILL")},2e3);e.unref?.(),b.close(),y()},K="";k.stdout.on("data",b=>{let c;for(K+=b.toString("utf8");-1!==(c=K.indexOf("\n"));){let b,e=K.slice(0,c).trim();if(K=K.slice(c+1),e){try{b=JSON.parse(e)}catch{continue}if(!u&&void 0!==b.result&&!b.method){u=!0,E("session/new",{cwd:p,mcpServers:[],model:a||void 0});continue}if(u&&!v&&void 0!==b.result&&!b.method){if(!(t=(b.result||{}).sessionId||null))return void J("Devin ACP: session/new returned no sessionId");v=!0,w=!0,E("session/prompt",{sessionId:t,prompt:[{type:"text",text:o}]});continue}if(v&&w&&void 0!==b.result&&!b.method){if(!B){let a=b.result||void 0,c=function(a){if("string"==typeof a.content)return a.content;if("string"==typeof a.text)return a.text;let b=a.message;if(b&&"string"==typeof b.content)return b.content;let c=a.messages;return Array.isArray(c)?c.filter(a=>"assistant"===a.role).map(a=>String(a.content||"")).join("\n"):""}(a);c&&(C=c,F(c));let d=a&&a.stopReason||"";if(d&&"cancelled"!==d)return void J()}continue}if("session/request_permission"===b.method&&void 0!==b.id){let a=b.params?.options||[],c=a.find(a=>/allow/i.test(String(a.kind||"")))||a[0];c&&k.stdin.write(JSON.stringify({jsonrpc:"2.0",id:b.id,result:{outcome:{outcome:"selected",optionId:c.optionId}}})+"\n");continue}if("_cognition.ai/agent_stopped"===b.method||"$/agent_stopped"===b.method)return void("error"===b.params?.cause?J(String(b.params?.errorMessage||b.params?.message||b.params?.error||"Devin agent error")):J());if("session/update"===b.method||"$/update"===b.method){let a=b.params;if(!a)continue;let c=a.update||{},e=c.sessionUpdate||a.type,f=void 0!==c.content?c.content:a.content,g="string"==typeof f?f:f?.text??a.delta??a.text??"";if(x&&!G&&("tool_call"===e||"tool_call_update"===e)){let a=c.toolCallId;if("string"==typeof c.title&&c.title.startsWith("Calling mcp_")&&/from clientTools\b/.test(c.title)){var d;let b=c.title.match(/^Calling (mcp_\S+)\b/),e=(d=b?b[1]:"").startsWith(m)?d.slice(m.length):d;a&&e&&H.set(a,e)}let b=a?H.get(a):null;if(b&&c.rawInput){G=!0,H.delete(a),I(b,c.rawInput,a||`call_${Date.now()}`),J(null,"tool_calls");return}continue}if("agent_message_chunk"===e||"message_delta"===e||"text_delta"===e||"content_delta"===e)g&&F(g);else if("agent_thought_chunk"===e);else if("message_stop"===e||"stop"===e||"done"===e)return void J();else if("error"===e)return void J(String(a.message||a.error||"Devin ACP error"));continue}if(b.error)return void J(`Devin ACP error ${b.error.code}: ${b.error.message}`)}}}),k.stderr.on("data",a=>{g?.debug?.("DEVIN",`stderr: ${a.toString("utf8").slice(0,200)}`)}),k.on("close",a=>{D?y():0===a||l?J():J(B?void 0:`Devin CLI exited with code ${a}`)}),E("initialize",{protocolVersion:"0.3",clientInfo:{name:"zevai",version:"1.0"},capabilities:{}})}}),{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}}),url:"devin://acp/stdio",headers:{},transformedBody:{model:a,cwd:p,clientTools:u.map(a=>a?.function?.name||a?.name).filter(Boolean),clientToolResults:Object.keys(v),mcpServers:Object.keys(s),promptLength:Array.isArray(b?.messages)?b.messages.length:Array.isArray(b?.input)?b.input.length:0}}}}},55285:(a,b,c)=>{"use strict";let d,e=c(77030),f=c(34589),g=c(84285),{InvalidArgumentError:h,ConnectTimeoutError:i}=c(61448),j=class{constructor(a){this._maxCachedSessions=a,this._sessionCache=new Map,this._sessionRegistry=new FinalizationRegistry(a=>{if(this._sessionCache.size<this._maxCachedSessions)return;let b=this._sessionCache.get(a);void 0!==b&&void 0===b.deref()&&this._sessionCache.delete(a)})}get(a){let b=this._sessionCache.get(a);return b?b.deref():null}set(a,b){if(0!==this._maxCachedSessions){if(this._sessionCache.has(a))this._sessionCache.delete(a);else if(this._sessionCache.size>=this._maxCachedSessions){let a=!1;for(let[b,c]of this._sessionCache)if(void 0===c.deref()){this._sessionCache.delete(b),a=!0;break}if(!a){let a=this._sessionCache.keys().next();a.done||this._sessionCache.delete(a.value)}}this._sessionCache.set(a,new WeakRef(b)),this._sessionRegistry.register(b,a)}}};a.exports=function({allowH2:a,preferH2:b,useH2c:k,maxCachedSessions:l,socketPath:m,timeout:n,session:o,...p}){if(null!=l&&(!Number.isInteger(l)||l<0))throw new h("maxCachedSessions must be a positive integer or zero");let q={path:m,...p},r=new j(null==l?100:l);return n=null==n?1e4:n,a=null==a||a,function({hostname:h,host:j,protocol:l,port:m,servername:p,localAddress:s,httpSocket:t},u){let v;if("https:"===l){d||(d=c(41692));let e=(p=p||q.servername||g.getServerName(j)||null)||h;f(e);let i=o||r.get(e)||null;m=m||443,(v=d.connect({highWaterMark:16384,...q,servername:p,session:i,localAddress:s,ALPNProtocols:a?b?["h2","http/1.1"]:["http/1.1","h2"]:["http/1.1"],socket:t,port:m,host:h})).on("session",function(a){r.set(e,a)})}else{f(!t,"httpSocket can only be sent on TLS update"),m=m||80;let a={highWaterMark:65536,...q,localAddress:s,port:m,host:h},b=e.isIP(h);0!==b&&p&&p!==h&&(a.host=p,a.lookup=(a,c,d)=>{c.all?d(null,[{address:h,family:b}]):d(null,h,b)}),v=e.connect(a),!0===k&&(v.alpnProtocol="h2")}if(null==q.keepAlive||q.keepAlive){let a=void 0===q.keepAliveInitialDelay?6e4:q.keepAliveInitialDelay;v.setKeepAlive(!0,a)}let w=g.setupConnectTimeout(new WeakRef(v),{timeout:n,hostname:h,port:m});return v.setNoDelay(!0).once("https:"===l?"secureConnect":"connect",function(){if(queueMicrotask(w),u){let a=u;u=null,a(null,this)}}).on("error",function(a){if(queueMicrotask(w),u){let b=u;u=null,b(function(a,b,c){if(a instanceof AggregateError&&("ETIMEDOUT"===a.code||a.errors.some(a=>null!=a&&"ETIMEDOUT"===a.code))){let d="Connect Timeout Error";Array.isArray(b.autoSelectFamilyAttemptedAddresses)?d+=` (attempted addresses: ${b.autoSelectFamilyAttemptedAddresses.join(", ")},`:d+=` (attempted address: ${c.hostname}:${c.port},`;let e=new i(d+=` timeout: ${c.timeout}ms)`);return e.cause=a,e}return a}(a,this,{timeout:n,hostname:h,port:m}))}}),v}}},55599:(a,b,c)=>{"use strict";c(1758),c(8735),c(1899),c(42541),c(90943),c(72610),c(51525),c(43212),c(16605),Symbol("streamFailure")},55720:(a,b,c)=>{"use strict";let{getResponseData:d,buildKey:e,addMockDispatch:f}=c(70634),{kDispatches:g,kDispatchKey:h,kDefaultHeaders:i,kDefaultTrailers:j,kContentLength:k,kMockDispatch:l,kIgnoreTrailingSlash:m}=c(80830),{InvalidArgumentError:n}=c(61448),{serializePathWithQuery:o}=c(84285),{types:{isPromise:p}}=c(57975);class q{constructor(a){this[l]=a}delay(a){if("number"!=typeof a||!Number.isInteger(a)||a<=0)throw new n("waitInMs must be a valid integer > 0");return this[l].delay=a,this}persist(){return this[l].persist=!0,this}times(a){if("number"!=typeof a||!Number.isInteger(a)||a<=0)throw new n("repeatTimes must be a valid integer > 0");return this[l].times=a,this}}class r{constructor(a,b){if("object"!=typeof a)throw new n("opts must be an object");if(void 0===a.path)throw new n("opts.path must be defined");if(void 0===a.method&&(a.method="GET"),"string"==typeof a.path)if(a.query)a.path=o(a.path,a.query);else{let b=new URL(a.path,"data://");a.path=b.pathname+b.search}"string"==typeof a.method&&(a.method=a.method.toUpperCase()),this[h]=e(a),this[g]=b,this[m]=a.ignoreTrailingSlash??!1,this[i]={},this[j]={},this[k]=!1}createMockScopeDispatchData({statusCode:a,data:b,responseOptions:c}){let e=d(b),f=this[k]?{"content-length":e.length}:{};return{statusCode:a,data:b,headers:{...this[i],...f,...c.headers},trailers:{...this[j],...c.trailers}}}validateReplyParameters(a){if(void 0===a.statusCode)throw new n("statusCode must be defined");if("object"!=typeof a.responseOptions||null===a.responseOptions)throw new n("responseOptions must be an object")}reply(a){if("function"==typeof a){let b=a=>{if("object"!=typeof a||null===a)throw new n("reply options callback must return an object");let b={data:"",responseOptions:{},...a};return this.validateReplyParameters(b),{...this.createMockScopeDispatchData(b)}};return new q(f(this[g],this[h],c=>{let d=a(c);return p(d)?d.then(b):b(d)},{ignoreTrailingSlash:this[m]}))}let b={statusCode:a,data:void 0===arguments[1]?"":arguments[1],responseOptions:void 0===arguments[2]?{}:arguments[2]};this.validateReplyParameters(b);let c=this.createMockScopeDispatchData(b);return new q(f(this[g],this[h],c,{ignoreTrailingSlash:this[m]}))}replyWithError(a){if(void 0===a)throw new n("error must be defined");return new q(f(this[g],this[h],{error:a},{ignoreTrailingSlash:this[m]}))}defaultReplyHeaders(a){if(void 0===a)throw new n("headers must be defined");return this[i]=a,this}defaultReplyTrailers(a){if(void 0===a)throw new n("trailers must be defined");return this[j]=a,this}replyContentLength(){return this[k]=!0,this}}a.exports.MockInterceptor=r,a.exports.MockScope=q},56248:(a,b,c)=>{"use strict";c.d(b,{v:()=>s});var d=c(57861),e=c(69762),f=c(42541);function g(a){if(!a||"object"!=typeof a)return null;let b=[a.input_tokens,a.prompt_tokens].find(Number.isInteger),c=[a.output_tokens,a.completion_tokens].find(Number.isInteger);if(void 0===b||void 0===c||b+c<=0)return null;let d={input_tokens:b,output_tokens:c,total_tokens:b+c},e=[a.input_tokens_details?.cached_tokens,a.prompt_tokens_details?.cached_tokens].find(Number.isInteger),f=[a.output_tokens_details?.reasoning_tokens,a.completion_tokens_details?.reasoning_tokens].find(Number.isInteger);return Number.isInteger(e)&&(d.input_tokens_details={cached_tokens:e}),Number.isInteger(f)&&(d.output_tokens_details={reasoning_tokens:f}),d}function h(a){let b=Number.isInteger(a.nextOutputIndex)?a.nextOutputIndex:0;return a.nextOutputIndex=b+1,b}function i(a,b,c){a.reasoningId||(a.reasoningId=`rs_${a.responseId}_${c}`,a.reasoningIndex=h(a),b("response.output_item.added",{type:"response.output_item.added",output_index:c,item:{id:a.reasoningId,type:"reasoning",summary:[]}}),b("response.reasoning_summary_part.added",{type:"response.reasoning_summary_part.added",item_id:a.reasoningId,output_index:c,summary_index:0,part:{type:"summary_text",text:""}}),a.reasoningPartAdded=!0)}function j(a,b,c){c&&(a.reasoningBuf+=c,b("response.reasoning_summary_text.delta",{type:"response.reasoning_summary_text.delta",item_id:a.reasoningId,output_index:a.reasoningIndex,summary_index:0,delta:c}))}function k(a,b){a.reasoningId&&!a.reasoningDone&&(a.reasoningDone=!0,b("response.reasoning_summary_text.done",{type:"response.reasoning_summary_text.done",item_id:a.reasoningId,output_index:a.reasoningIndex,summary_index:0,text:a.reasoningBuf}),b("response.reasoning_summary_part.done",{type:"response.reasoning_summary_part.done",item_id:a.reasoningId,output_index:a.reasoningIndex,summary_index:0,part:{type:"summary_text",text:a.reasoningBuf}}),b("response.output_item.done",{type:"response.output_item.done",output_index:a.reasoningIndex,item:{id:a.reasoningId,type:"reasoning",summary:[{type:"summary_text",text:a.reasoningBuf}]}}))}function l(a,b,c){if(a.msgItemAdded[c]&&!a.msgItemDone[c]){a.msgItemDone[c]=!0;let d=a.msgTextBuf[c]||"",e=`msg_${a.responseId}_${c}`,f=a.msgOutputIndices[c];b("response.output_text.done",{type:"response.output_text.done",item_id:e,output_index:f,content_index:0,text:d,logprobs:[]}),b("response.content_part.done",{type:"response.content_part.done",item_id:e,output_index:f,content_index:0,part:{type:"output_text",annotations:[],logprobs:[],text:d}}),b("response.output_item.done",{type:"response.output_item.done",output_index:f,item:{id:e,type:"message",content:[{type:"output_text",annotations:[],logprobs:[],text:d}],role:"assistant"}})}}function m(a,b){return`${b?"ctc":"fc"}_${a}`}function n(a,b,c,{allowUnnamed:d=!1}={}){if(a.funcItemAdded||(a.funcItemAdded={}),a.funcItemAdded[c])return!1;let e=a.funcCallIds[c],f=a.funcNames[c];if(!e||!f&&!d)return!1;a.funcItemAdded[c]=!0;let g="custom"===a.funcTypes[c],h=m(e,g);return b("response.output_item.added",{type:"response.output_item.added",output_index:a.funcOutputIndices[c],item:g?{id:h,type:"custom_tool_call",call_id:e,name:f||"",input:""}:{id:h,type:"function_call",arguments:"",call_id:e,name:f||""}}),!g&&a.funcArgsBuf[c]&&b("response.function_call_arguments.delta",{type:"response.function_call_arguments.delta",item_id:h,output_index:a.funcOutputIndices[c],delta:a.funcArgsBuf[c]}),!0}function o(a,b,c){let d=a.funcCallIds[c];if(d&&!a.funcItemDone[c]){a.funcItemAdded?.[c]||n(a,b,c,{allowUnnamed:!0});let e="custom"===a.funcTypes[c],f=a.funcArgsBuf[c]||(e?"":"{}"),g=e?function(a){if("string"!=typeof a)return"";try{let b=JSON.parse(a);if(b&&"object"==typeof b&&"string"==typeof b.input)return b.input}catch{}return a}(f):f,h=a.funcOutputIndices[c],i=m(d,e);e&&g&&b("response.custom_tool_call_input.delta",{type:"response.custom_tool_call_input.delta",item_id:i,output_index:h,delta:g}),b(e?"response.custom_tool_call_input.done":"response.function_call_arguments.done",{type:e?"response.custom_tool_call_input.done":"response.function_call_arguments.done",item_id:i,output_index:h,...e?{input:g}:{arguments:g}}),b("response.output_item.done",{type:"response.output_item.done",output_index:h,item:e?{id:i,type:"custom_tool_call",input:g,call_id:d,name:a.funcNames[c]||""}:{id:i,type:"function_call",arguments:g,call_id:d,name:a.funcNames[c]||""}}),a.funcArgsBuf[c]=g,a.funcItemDone[c]=!0,a.funcArgsDone[c]=!0}}function p(a,b){if(!a.completedSent){a.completedSent=!0;let c={id:a.responseId,object:"response",created_at:a.created,status:"completed",background:!1,error:null,output:function(a){let b=[];for(let c in a.reasoningId&&b.push({index:a.reasoningIndex,item:{id:a.reasoningId,type:"reasoning",summary:a.reasoningBuf?[{type:"summary_text",text:a.reasoningBuf}]:[]}}),a.msgItemAdded)a.msgItemAdded[c]&&b.push({index:a.msgOutputIndices[c]??0,item:{id:`msg_${a.responseId}_${c}`,type:"message",status:"completed",role:"assistant",content:[{type:"output_text",annotations:[],logprobs:[],text:a.msgTextBuf[c]||""}]}});for(let c in a.funcCallIds){let d=a.funcCallIds[c];if(!d)continue;let e="custom"===a.funcTypes[c],f=m(d,e);b.push({index:a.funcOutputIndices[c]??0,item:e?{id:f,type:"custom_tool_call",input:a.funcArgsBuf[c]||"",call_id:d,name:a.funcNames[c]||""}:{id:f,type:"function_call",arguments:a.funcArgsBuf[c]||"{}",call_id:d,name:a.funcNames[c]||""}})}return b.sort((a,b)=>a.index-b.index),b.map(a=>a.item)}(a)};a.model&&(c.model=a.model);let d=a.responsesUsage||g(a.usage);d&&(c.usage=d),b("response.completed",{type:"response.completed",response:c})}}function q(a){if(a.completedSent)return[];let b=[],c=(c,d)=>{d.sequence_number=++a.seq,b.push({event:c,data:d})};for(let b in a.msgItemAdded)l(a,c,b);for(let b in k(a,c),a.funcCallIds)o(a,c,b);return p(a,c),b}function r(a){return a.toolCallIndex>0||a.currentToolCallId?"tool_calls":"stop"}function s(a,b){if(!a){if(b.finishReasonSent||!b.started)return null;let a=r(b);b.finishReasonSent=!0,b.finishReason=a;let c={id:b.chatId||`chatcmpl-${Date.now()}`,object:"chat.completion.chunk",created:b.created||Math.floor(Date.now()/1e3),model:b.model||"unknown",choices:[{index:0,delta:{},finish_reason:a}]};return b.usage&&"object"==typeof b.usage&&(c.usage=b.usage),c}let c=a.type||a.event,d=a.data||a;if(b.started||(b.started=!0,b.chatId=`chatcmpl-${Date.now()}`,b.created=Math.floor(Date.now()/1e3),b.toolCallIndex=0,b.currentToolCallId=null,b.respToolChatIndex??=Object.create(null),b.respToolArgsEmitted??=Object.create(null)),"error"===c||"response.failed"===c||d?.response?.status==="failed"||!c&&d?.error){let a,e,f,g,h,i,j,k,l;if(b.finishReasonSent||b.errorSent)return null;let m=(g=(f=(e=(a=d&&"object"==typeof d?d:{}).error??a.response?.error)&&"object"==typeof e&&!Array.isArray(e)?e:{}).code??a.code??("response.failed"===c?"response_failed":"stream_error"),h=f.message||("string"==typeof e?e:null)||a.message||("response.failed"===c?"Responses API request failed":"Responses API stream error"),i=a.type&&a.type!==c&&"error"!==a.type?a.type:null,j="string"==typeof g&&(g.endsWith("_error")||"server_error"===g)?g:null,k=f.type||a.error_type||i||j||"server_error",!("param"in(l={...f,message:h,type:k}))&&"param"in a&&(l.param=a.param),l.code=g,l);return b.error=m,b.errorSent=!0,b.finishReasonSent=!0,{error:m}}if(b.errorSent)return null;if("response.output_text.delta"===c){let a=d.delta||"";return a?{id:b.chatId,object:"chat.completion.chunk",created:b.created,model:b.model||"unknown",choices:[{index:0,delta:{content:a},finish_reason:null}]}:null}if("response.output_text.done"===c)return null;if("response.output_item.added"===c&&(d.item?.type==="function_call"||d.item?.type==="custom_tool_call")){let a,c=d.item;b.currentToolCallId=c.call_id||`call_${Date.now()}`,b.respToolChatIndex??=Object.create(null);let e=c.id||d.item_id||b.currentToolCallId;return e&&Object.prototype.hasOwnProperty.call(b.respToolChatIndex,e)?a=b.respToolChatIndex[e]:(a=b.toolCallIndex++,e&&(b.respToolChatIndex[e]=a)),{id:b.chatId,object:"chat.completion.chunk",created:b.created,model:b.model||"unknown",choices:[{index:0,delta:{tool_calls:[{index:a,id:b.currentToolCallId,type:"function",function:{name:c.name||"",arguments:""}}]},finish_reason:null}]}}if("response.function_call_arguments.delta"===c||"response.custom_tool_call_input.delta"===c){let a=d.delta||"";if(!a)return null;let c=(null!=d.item_id?b.respToolChatIndex?.[d.item_id]:void 0)??Math.max(0,(b.toolCallIndex||1)-1);return b.respToolArgsEmitted??=Object.create(null),b.respToolArgsEmitted[c]=!0,{id:b.chatId,object:"chat.completion.chunk",created:b.created,model:b.model||"unknown",choices:[{index:0,delta:{tool_calls:[{index:c,function:{arguments:a}}]},finish_reason:null}]}}if("response.output_item.done"===c&&(d.item?.type==="function_call"||d.item?.type==="custom_tool_call")){let a=d.item?.id||d.item_id,c=a&&b.respToolChatIndex?.[a]!=null?b.respToolChatIndex[a]:Math.max(0,(b.toolCallIndex||1)-1),e=d.item?.arguments;return"string"==typeof e&&e&&(b.respToolArgsEmitted??=Object.create(null),!b.respToolArgsEmitted[c])?(b.respToolArgsEmitted[c]=!0,{id:b.chatId,object:"chat.completion.chunk",created:b.created,model:b.model||"unknown",choices:[{index:0,delta:{tool_calls:[{index:c,function:{arguments:e}}]},finish_reason:null}]}):null}if("response.completed"===c||"response.done"===c){let a=d.response?.usage;if(a&&"object"==typeof a){let c=a.input_tokens||a.prompt_tokens||0,d=a.output_tokens||a.completion_tokens||0,e=a.input_tokens_details?.cached_tokens||a.cache_read_input_tokens||0;b.usage={prompt_tokens:c,completion_tokens:d,total_tokens:c+d},e>0&&(b.usage.prompt_tokens_details={cached_tokens:e})}if(!b.finishReasonSent){let a=r(b);b.finishReasonSent=!0,b.finishReason=a;let c={id:b.chatId,object:"chat.completion.chunk",created:b.created,model:b.model||"unknown",choices:[{index:0,delta:{},finish_reason:a}]};return b.usage&&"object"==typeof b.usage&&(c.usage=b.usage),c}return null}if("response.reasoning_summary_text.delta"===c){let a=d.delta||"";return a?{id:b.chatId,object:"chat.completion.chunk",created:b.created,model:b.model||"unknown",choices:[{index:0,delta:{reasoning_content:a},finish_reason:null}]}:null}return null}(0,e.kz)(f.h.OPENAI,f.h.OPENAI_RESPONSES,null,function(a,b){if(!a)return q(b);let c=g(a.usage);if(c&&(b.responsesUsage=c),!a.choices?.length)return b.completionPending&&b.responsesUsage?q(b):[];let e=[],f=(a,c)=>{c.sequence_number=++b.seq,e.push({event:a,data:c})},r=a.choices[0],s=r.index||0,t=r.delta||{};b.started||(b.started=!0,b.responseId=a.id?`resp_${a.id}`:b.responseId,f("response.created",{type:"response.created",response:{id:b.responseId,object:"response",created_at:b.created,status:"in_progress",background:!1,error:null,output:[]}}),f("response.in_progress",{type:"response.in_progress",response:{id:b.responseId,object:"response",created_at:b.created,status:"in_progress"}}));let u=(0,d.V)(t);if(u&&(i(b,f,s),j(b,f,u)),t.content){let a=t.content;if(a.includes("<think>")&&(b.inThinking=!0,a=a.replace("<think>",""),i(b,f,s)),a.includes("</think>")){let c=a.split("</think>"),d=c[0],e=c.slice(1).join("</think>");d&&j(b,f,d),k(b,f),b.inThinking=!1,a=e}if(b.inThinking&&a)return j(b,f,a),e;a&&(k(b,f),function(a,b,c,d){if(!a.msgItemAdded[c]){a.msgItemAdded[c]=!0,a.msgOutputIndices[c]=h(a);let d=`msg_${a.responseId}_${c}`;b("response.output_item.added",{type:"response.output_item.added",output_index:a.msgOutputIndices[c],item:{id:d,type:"message",content:[],role:"assistant"}})}a.msgContentAdded[c]||(a.msgContentAdded[c]=!0,b("response.content_part.added",{type:"response.content_part.added",item_id:`msg_${a.responseId}_${c}`,output_index:a.msgOutputIndices[c],content_index:0,part:{type:"output_text",annotations:[],logprobs:[],text:""}})),b("response.output_text.delta",{type:"response.output_text.delta",item_id:`msg_${a.responseId}_${c}`,output_index:a.msgOutputIndices[c],content_index:0,delta:d,logprobs:[]}),a.msgTextBuf[c]||(a.msgTextBuf[c]=""),a.msgTextBuf[c]+=d}(b,f,s,a))}if(Array.isArray(t.tool_calls)&&t.tool_calls.length>0)for(let a of(k(b,f),l(b,f,s),t.tool_calls))!function(a,b,c){let d=c.index??0,e=c.id,f=c.function?.name;if(void 0===a.funcOutputIndices[d]&&(a.funcOutputIndices[d]=h(a)),a.funcItemAdded||(a.funcItemAdded={}),f){let b=a.toolNameMap?.get(f)||f;a.funcNames[d]=b,a.toolNameMap?.customToolNames?.has(b)&&(a.funcTypes[d]="custom")}e&&!a.funcCallIds[d]&&(a.funcCallIds[d]=e),a.funcArgsBuf[d]||(a.funcArgsBuf[d]="");let g=!!a.funcItemAdded[d];c.function?.arguments&&(a.funcArgsBuf[d]+=c.function.arguments);let i=n(a,b,d);"custom"!==a.funcTypes[d]&&g&&!i&&c.function?.arguments&&a.funcCallIds[d]&&b("response.function_call_arguments.delta",{type:"response.function_call_arguments.delta",item_id:m(a.funcCallIds[d],!1),output_index:a.funcOutputIndices[d],delta:c.function.arguments})}(b,f,a);if(r.finish_reason){for(let a in b.msgItemAdded)l(b,f,a);for(let a in k(b,f),b.funcCallIds)o(b,f,a);b.responsesUsage||!b.deferResponsesCompletion?p(b,f):b.completionPending=!0}return e}),(0,e.kz)(f.h.OPENAI_RESPONSES,f.h.OPENAI,null,s)},56250:a=>{let b=new WebAssembly.Module(Buffer.from("AGFzbQEAAAABQgt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UBxzaG91bGRfY29udGludWVfd2l0aG91dF9kYXRhAFEYc2hvdWxkX21hbmFnZV91bmNvbnN1bWVkAFIQc2hvdWxkX3NraXBfYm9keQBTHHNob3VsZF9zdXNwZW5kX2FmdGVyX2hlYWRlcnMAVAr7pwJAlgIBBH8CQCACIANPDQAgAS0AACEFAkAgAyACayIHQQNNBEAMAQtBgIKECCAFQYGChAhsIgEgAigAAHMiBmsgBnJBgIGChHhxQYCBgoR4RwRADAELIAJBfHFBBGohAgJAIAdBCU8EQCACIANBCGsiB0sNAQNAQYCChAggAigCACABcyIGayAGckGAgYKEeHFBgIGChHhHDQJBgIKECCACQQRqKAIAIAFzIgZrIAZyQYCBgoR4cUGAgYKEeEcNAiACQQhqIgIgB00NAAsMAQsgAiADTw0CDAELIAIgA08NAQsgA0EBa0EBIQQDQCAFIAItAABGDQEgAkEBaiICIANHDQALIQJBACEECyAAIAI2AgQgACAENgIACyYAAkAgAEEATgRAIABFBEBBASEADAILIABBARBVIgANAQsACyAACzMAIABCADcDKCAAQQA6ABUgAEIANwMwIABCADcDOCAAQgA3A0AgAEIANwNIIABBADYCUAvSAwIDfwF+AkAgACIBLQAkIgBBDk1BAEEBIAB0QYDPAXEbRQRAIAFBAzoAJiABQQI6ACQgAUENOgD0AkEAIQAgAUEAOgB5IAFBp5jAACkAADcAbCABQayYwAApAAA3AHECQCABKQNYIAEpA2CEp0EBcUUEQCABKAL4AiECDAELIAEoAvgCIgJBAToAACACQQVqQQM6AAAgAkEBaiABKAIgNgAAQQYhAAsgACACakEAOgAADAELAn9BACABKQNYIAEpA2CEIgRCyACDUA0AGiAEQgiDQgBSBEAgASgC+AIiAEEEOgAAIABBBWpBADYAACAAQQFqIAEoAiA2AABBCSECCyACIARCwACDUA0AGiABKAL4AiACaiIAQQc6AAAgAEEFakEANgAAIABBAWogASgCIDYAACACQQlqCyECIAFBADoAFiABQQA6ABQCQCABLQBSQQFGBEBBDiEAIAEtABFBAXENAQsgAS0AUCEDIARCAoNQBEAgAyEADAELQQEhACADQQFxRQRAIAMhAAwBCyABKAL4AiACaiIDQQI6AAAgA0EFakEANgAAIANBAWogASgCIDYAACACQQlqIQILIAEgADoAJCABKAL4AiACakEAOgAACwvfAgEDfyMAQeAAayIAJAACQEGAgAQQViICRQ0AIAJBBGstAABBA3FFDQAgAkEAQYCABPwLAAsCQCACRQ0AIABBADYAXCAAQgA3AFQgAEIANwBMIABCADcARCAAQgA3ADwgAEIANwA0IABCADcCHCAAQgA3AiQgAEEANgIsIABCADcADyAAQQA6ABdBgANBCBBVIgFFDQAgAUIANwARIAFBAToAECABQgA3AwggAUKAwICAgIAINwMAIAFCADcAGSABQgA3AB8gASAAKQAzNwAnIAEgACkAOzcALyABIAApAEM3ADcgASAAKQBLNwA/IAEgACkAUzcARyABIAApAFg3AEwgASAAKAIoNgJkIAEgACkCIDcCXCABIAApAhg3AlQgAUHsAGpBAEH/AfwLACABIAI2AvgCIAEgAC8AFjsA8wIgASAAKQAONwDrAiABIAE2AmggAEHgAGokACABDwsACxUAAkAgAEUNACABRQ0AIAAgARBXCws4AQF/IAAEQCAAKALwAiIBBEAgACgC7AIgARBXCyAAKAL4AiIBBEAgAUGAgAQQVwsgAEGAAxBXCwuSAQEBfyAAIAE6ACYgAEECOgAkIABB7ABqIQRB/gEgAyADQf4BTxsiAwRAIAQgAiAD/AoAAAsgACADOgD0AiADIARqQQA6AABBACEDIAApA1ggACkDYIRCAYOnBH8gACgC+AIiAkEBOgAAIAJBBWogAToAACACQQFqIAAoAiA2AABBBgVBAAsgACgC+AJqQQA6AAALrAIBAn8CQAJAAkAgAC0AJCIBQQlNBEBBASABdEEbcQ0BIAFBAkYNAyABQQlGDQILIABBBToAJiAAQQI6ACQgAEEWOgD0AiAAQQA6AIIBIABBgIjAACkAADcAbCAAQYiIwAApAAA3AHQgAEGOiMAAKQAANwB6AkAgACkDWCAAKQNghKdBAXFFBEAgACgC+AIhAQwBCyAAKAL4AiIBQQE6AAAgAUEFakEFOgAAIAFBAW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oAmwiASAERw0CCyADQQY6ACYgA0ECOgAkIANB3pfAACkAADcAbCADQeaXwAApAAA3AHQgA0Hul8AAKQAANwB8IANB9pfAACkAADcAhAEgA0H+l8AAKAAANgCMAQw8CyADQQE6ABQgBUFeTg1LDFYLIAEgBGsiCUEBaiEBIB9FBEAgASEGIAAMCgsgCUECaiIGIABPDQcgASAKTw1QIAEgBGotAABBIEcNByAEIAZqLQAAIg5BCUYNByAOQSBGDQcgAkEBay0AACICQQlGDQcgACACQSBHDQkaDAcLAkAgAUEgTwRAIAFB/wBGDQEMBwsgAUEJRg0GCyAAIApPDQQgAEECTQRAIABBAWohAEEAIQgDQCAEIAhqLQAAQTpGDQUgACAIQQFqIghHDQALDAULQYCChAggBCgAACIBQbr06NEDc2sgAXJBgIGChHhxQYCBgoR4RwRAIABBAWohAEEAIQgDQCAEIAhqLQAAQTpGDQUgACAIQQFqIghHDQALDAULQQQgBEEDcSIGayEBIABBCEkNASACQQFqIQYgASAEaiEIIAEgAEEHayIASw0CIAAgBGohAANAQYCChAggCCgCACIBQbr06NEDc2sgAXJBgIGChHhxQYCBgoR4Rw0DQYCChAggCEEEaigCACIBQbr06NEDc2sgAXJBgIGChHhxQYCBgoR4Rw0DIAhBCGoiCCAATQ0ACwwCCyADQQY6ACYgA0ECOgAkIANBrorAACkAADcAbCADQbOKwAApAAA3AHEMRwsgACABSQ0CIARBBGohASAAQQNrIQBBACAGayEIA0AgASAIai0AAEE6Rg0CIAhBAWoiCCAARw0ACwwCCyAGIAhNDQEDQCAILQAAQTpGDQEgAiAIRiAIQQFqIQhFDQALDAELIANBBjoAJiADQQI6ACQgA0GCmMAAKQAANwBsIANBipjAACkAADcAdCADQZKYwAApAAA3AHwgA0GamMAAKQAANwCEASADQZ+YwAApAAA3AIkBQSUhCEGRAQxPCyADQQY6ACYgA0ECOgAkIANB3pfAACkAADcAbCADQeaXwAApAAA3AHQgA0Hul8AAKQAANwB8IANB9pfAACkAADcAhAEgA0H+l8AAKAAANgCMA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gA0GKi8AAKQAANwBsIANBkovAACkAADcAdCADQZqLwAApAAA3AHwgA0Gii8AAKQAANwCEASADQaqLwAApAAA3AIwBIANBsYvAACgAADYAkwFBKyEIQZcBDDELIANBBjoAJiADQQI6ACQgA0HSi8AAKQAANwBsIANB2ovAACkAADcAdCADQd+LwAApAAA3AHkMCwsgBC0AAkHUAEcNBCAELQADQdAARw0EIAQtAARBL0cNBCADQRE6ACYgA0ECOgAkIANBhonAACkAADcAbCADQY6JwAApAAA3AHQgA0GWicAAKQAANwB8DAgLIAJBAmohACADLQAkQQJGDScgA0EGOgAkDCcLIANBDDoAJiADQQI6ACQgA0HPisAAKQAANwBsIANB14rAACkAADcAdCADQd+KwAApAAA3AHwgA0HnisAAKAAANgCEAQwcCyADKAIAIAhLDS0gA0EGOgAmIANBAjoAJCADQbuKwAApAAA3AGwgA0HDisAAKQAANwB0IANBy4rAACgAADYAfAwdCyAIRQ0FIAhBAWsgCk8NBQJAIAhBBE8EQCAIIQEgBCEAQYCChAggBCgAACICQY2atOgAc2sgAnJBgIGChHhxQYCBgoR4RgRAIARBBCAEQQNxIgJrIgZqIQAgAUEJTwRAIAEgBGohAgJAIAYgAUEIa0sNACACQQhrIQEDQEGAgoQIIAAoAgAiBkGNmrToAHNrIAZyQYCBgoR4cUGAgYKEeEcNAUGAgoQIIABBBGooAgAiBkGNmrToAHNrIAZyQYCBgoR4cUGAgYKEeEcNASAAQQhqIgAgAU0NAAsLIAAgAk8NCQNAIAAtAABBDUYNBCACIABBAWoiAEcNAAsMCQsgBiAITw0IIAIgCGpBBGshAQNAIAAtAABBDUYNAyAAQQFqIQAgAUEBayIBDQALDAgLA0AgAC0AAEENRg0CIABBAWohACABQQFrIgENAAsMBwsgBCEAIAQtAABBDUYNACAIQQFGDQYgBC0AAUENRgRAIARBAWohAAwBCyAIQQJGDQYgBC0AAkENRw0GIARBAmohAAsgACAEayIOQQFqIgEgCEYNLCABIApPDScCQCABIARqIgItAABBCkYEQEEAIQEgACAERw0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BAsgOUIAUgRAIAVBEGpBgYAETw0mIAMoAiAhACADKAL4AiAFakEGOgAAIAMoAvgCIAVqQQFqIAA2AAAgAygC+AIgBWpBBWpBADYAACAFQQlqIQULIDRQDQQgBUEQakGAgARLDSUgAygCICEAIAMoAvgCIAVqQQM6AAAgAygC+AIgBWpBAWogADYAACADKAL4AiAFakEFakEANgAAIAVBCWohBQwECwJAIApBBE0EQCAKQQFNDQMMAQsgBC0ABEEvRw0AIAQoAABByKjRggVHDQAgA0EAOgARAkAgHUUNACA5QgBSBEAgBUEQakGBgARPDScgAygCICEAIAMoAvgCIAVqQQY6AAAgAygC+AIgBWpBAWogADYAACADKAL4AiAFakEFakEANgAAIAVBCWohBQsgNFANACAFQRBqQYCABEsNJiADKAIgIQAgAygC+AIgBWpBAzoAACADKAL4AiAFakEBaiAANgAAIAMoAvgCIAVqQQVqQQA2AAAgBUEJaiEFC0EAIQEgAy0AJEECRg0eIANBBDoAJAweCyAELwAAQY0URw0BC0EAIQFBAiEADBsLIANBAToAEQJAIB5FDQAgOEIAUgRAIAVBEGpBgYAETw0kIAMoAiAhACADKAL4AiAFakEFOgAAIAMoAvgCIAVqQQFqIAA2AAAgAygC+AIgBWpBBWpBADYAACAFQQlqIQULIDRQDQAgBUEQakGAgARLDSMgAygCICEAIAMoAvgCIAVqQQM6AAAgAygC+AIgBWpBAWogADYAACADKAL4AiAFakEFakEANgAAIAVBCWohBQtBACEBIAMtACRBAkYNGyADQQM6ACQMGwtBACEBIAMtACRBAkYNGiADQQM6ACQMGgtBACEBIAMtACRBAkYNGSADQQQ6ACQMGQsgA0EDOgAmIANBAjoAJCADQaeYwAApAAA3AGwgA0GsmMAAKQAANwBxDBMLIAhFDQtBACEAQX8hBwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAA0ACQAJAAkACQAJAAkACQAJAIAAgBGoiCS0AACIBQQ1GBEAgCEEBayAARg04IABBAWoiDyAKTw0zIAlBAWoiAS0AAEEKRw0BAkACQAJAA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DSAgAiAEai0AACITQQlGDQAgBiECIBNBIEcNAQsCfwJAIAYgB00NACAHIAogByAKSxshAgNAIAIgB0YNIiAEIAdqLQAAIgtBCUcgC0EgR3ENASAGIAdBAWoiB0cNAAsgBgwBCyAHCyELAkAgCyAGIgJPDQADQCACQQFrIgcgCk8NISACIA9qLQAAIhNBCUcgE0EgR3ENASAHIgIgC0sNAAsgCyECCyACIAtHDQAgA0EGOgAmIANBAjoAJCADQcGOwAApAAA3AGwgA0HJjsAAKQAANwB0IANB0Y7AACkAADcAfCADQdmOwAApAAA3AIQBIANB4I7AACkAADcAiwEMBgsgA0EBOgBOIAIgCksNHiACIAtJDR4CQAJAIAIgC2tBB0cNACAEIAtqIgctAABBIHJB4wBHDQAgBy0AAUEgckHoAEcNACAHLQACQSByQfUARw0AIActAANBIHJB7gBHDQAgBy0ABEEgckHrAEcNACAHLQAFQSByQeUARw0AIActAAZBIHJB5ABHDQAgDUEBcUUEQEEBIQ0gA0EBOgBPDAILIANBDjoAJiADQQI6ACRB6wAhCCADQewAakHojsAAQesA/AoAAEHXAQwkCyANQQFxQQAhDUUNACADQQ46ACYgA0ECOgAkQc0AIQggA0HsAGpB04/AAEHNAPwKAABBuQEMIwsgBiAJRg0OIAZBAWohBwwACwALIAMtAE9FBEAgA0EBOgBPDA0LIANBDjoAJiADQQI6ACRB6wAhCCADQewAakHojsAAQesA/AoAAEHXAQwgCyADQQg6ACYgA0ECOgAkIANBgo7AACkAADcAbCADQYqOwAApAAA3AHQgA0GSjsAAKQAANwB8IANBmo7AACkAADcAhAEgA0GijsAAKQAANwCMASADQaqOwAApAAA3AJQBIANBso7AACkAADcAnAEgA0G5jsAAKQAANwCjAUE/IQhBqwEMHwsgAEERSQ0AIAJBIEcNACAELQAQIgFBCUYNACABQSBGDQBBECEBIAAhCSALRQ0FC0EPIQECQANAIAEgBGotAAAiAkEJRyACQSBHcQ0BIAAgAUEBaiIBRw0ACyAAIQELAn8gACAAIAFNDQAaAkADQCAHIApPDRw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AAQQFqKAAAIABBBWooAAAQFiAEQQlqIQQMBwtBCSECIEZQDQQgBiAAQQFqKAAAIABBBWooAAAQFyAEQQlqIQQMBgtBCSECIDdQDQMgBiAAQQFqKAAAIABBBWooAAAQGCAEQQlqIQQMBQtBCSECIEdQDQIgBiAAQQFqKAAAIABBBWooAAAQGSAEQQlqIQQMBAtBCSECIEhQDQEgBiAAQQFqKAAAIABBBWooAAAQGiAEQQlqIQQMAwtBCSECIC1CAFINAQsgAiAEaiEEDAELIAYgAEEBaigAACAAQQVqKAAAEBsgBEEJaiEEDAALAAsgICAYQQBHcUUNACARIBgQVwsgDEGQAWokACABCwkAIABBAToAJQuFAQAgAEEAOwEkIAFFBEAgAEIANwMYCyAAQQA6APQCIABBADoAbCAAQQA6ACYgACgC8AIiAQRAIAAoAuwCIAEQVwsgAEIANwMoIABBADsAFSAAQgA3AuwCIABCADcDMCAAQgA3AzggAEIANwNAIABCADcDSCAAQQA2AlAgACgC+AJBADoAAAsJACAAQQA6ACULCQAgACABNwNYCwkAIAAgATcDYAsJACAAIAE6ABcLCQAgACABOgAVCwkAIAAgAToAEQsJACAAIAE3AwgLCQAgACABNgIECwkAIAAgATYCAAsJACAAIAE6ABALCQAgACABOgAUCwkAIAAgAToAEwsJACAAIAE6ABYLCQAgACABOgASCwcAIAAtABQLBwAgAC0AEwsHACAALQAWCwcAIAAtABIL9AIBBX8gAUEJTwRAAkAgAEHN/3tBECABIAFBEE0bIgJrTw0AIAJBECAAQQtqQXhxIABBC0kbIgRqQQxqEFYiAEUNACAAQQhrIQECQCACQQFrIgMgAHFFBEAgASEADAELIABBBGsiBSgCACIGQXhxIAAgA2pBACACa3FBCGsiACACQQAgACABa0EQTRtqIgAgAWsiAmshAyAGQQNxBEAgACADIAAoAgRBAXFyQQJyNgIEIAAgA2oiAyADKAIEQQFyNgIEIAUgAiAFKAIAQQFxckECcjYCACABIAJqIgMgAygCBEEBcjYCBCABIAIQWgwBCyABKAIAIQEgACADNgIEIAAgASACajY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mcAAQeyZwAA2AgBBiJrAAEH8mcAANgIAQfyZwABB9JnAADYCAEGQmsAAQYSawAA2AgBBhJrAAEH8mcAANgIAQYyawABBhJrAADYCAEGYmsAAQYyawAA2AgBBlJrAAEGMmsAANgIAQaCawABBlJrAADYCAEGcmsAAQZSawAA2AgBBqJrAAEGcmsAANgIAQaSawABBnJrAADYCAEGwmsAAQaSawAA2AgBBrJrAAEGkmsAANgIAQbiawABBrJrAADYCAEG0msAAQayawAA2AgBBwJrAAEG0msAANgIAQbyawABBtJrAADYCAEHImsAAQbyawAA2AgBBxJrAAEG8msAANgIAQdCawABBxJrAADYCAEHYmsAAQcyawAA2AgBBzJrAAEHEmsAANgIAQeCawABB1JrAADYCAEHUmsAAQcyawAA2AgBB6JrAAEHcmsAANgIAQdyawABB1JrAADYCAEHwmsAAQeSawAA2AgBB5JrAAEHcmsAANgIAQfiawABB7JrAADYCAEHsmsAAQeSawAA2AgBBgJvAAEH0msAANgIAQfSawABB7JrAADYCAEGIm8AAQfyawAA2AgBB/JrAAEH0msAANgIAQZCbwABBhJvAADYCAEGEm8AAQfyawAA2AgBBmJvAAEGMm8AANgIAQYybwABBhJvAADYCAEGgm8AAQZSbwAA2AgBBlJvAAEGMm8AANgIAQaibwABBnJvAADYCAEGcm8AAQZSbwAA2AgBBsJvAAEGkm8AANgIAQaSbwABBnJvAADYCAEG4m8AAQaybwAA2AgBBrJvAAEGkm8AANgIAQcCbwABBtJvAADYCAEG0m8AAQaybwAA2AgBByJvAAEG8m8AANgIAQbybwABBtJvAADYCAEHgm8AAIAFBD2pBeHEiAEEIayICNgIAQcSbwABBvJvAADYCAEHYm8AAIARBKGsiBCABIABrakEIaiIANgIAIAIgAEEBcjYCBCABIARqQSg2AgRB7JvAAEGAgIABNgIAC0EAIQBB2JvAACgCACIBIAVNDQBB2JvAACABIAVrIgE2AgBB4JvAAEHgm8AAKAIAIgAgBWoiAjYCACACIAFBAXI2AgQgACAFQQNyNgIEIABBCGohAAsgCEEQaiQ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Y3RlckludmFsaWQgdHJhaWxlciBmaWVsZCB2YWx1ZSBjaGFyYWN0ZXJJbnZhbGlkIHN0YXRl","base64")),c=new TextEncoder,d=new TextDecoder;function e(a,b){let c=Number(BigInt.asUintN(32,b)),e=Number(b>>32n);a(d.decode(new Uint8Array(this.memory.buffer,e,c)))}function f(a){return this.alloc(a)>>>0}function g(a,b){return this.dealloc(a,b)}function h(){return this.create()>>>0}function i(a){this.destroy(a)}function j(a,b,c){return this.parse(a,b,c)>>>0}function k(a,b,d){let e=d.length,f=this.alloc(e),g=new Uint8Array(this.memory.buffer,f,e);c.encodeInto(d,g),this.fail(a,b,f,e),this.dealloc(f,e)}function l(){return 0!==this.milo_has_debug()}let m=Object.freeze({NONE:0,USER:1,CALLBACK_ERROR:2,UNEXPECTED_STATE:3,UNEXPECTED_DATA:4,UNEXPECTED_EOF:5,UNEXPECTED_CHARACTER:6,UNEXPECTED_CONTENT_LENGTH:7,UNEXPECTED_TRANSFER_ENCODING:8,UNEXPECTED_CONTENT:9,UNEXPECTED_TRAILERS:10,INVALID_VERSION:11,INVALID_STATUS:12,INVALID_CONTENT_LENGTH:13,INVALID_TRANSFER_ENCODING:14,INVALID_CHUNK_SIZE:15,MISSING_CONNECTION_UPGRADE:16,UNSUPPORTED_HTTP_VERSION:17,0:"NONE",1:"USER",2:"CALLBACK_ERROR",3:"UNEXPECTED_STATE",4:"UNEXPECTED_DATA",5:"UNEXPECTED_EOF",6:"UNEXPECTED_CHARACTER",7:"UNEXPECTED_CONTENT_LENGTH",8:"UNEXPECTED_TRANSFER_ENCODING",9:"UNEXPECTED_CONTENT",10:"UNEXPECTED_TRAILERS",11:"INVALID_VERSION",12:"INVALID_STATUS",13:"INVALID_CONTENT_LENGTH",14:"INVALID_TRANSFER_ENCODING",15:"INVALID_CHUNK_SIZE",16:"MISSING_CONNECTION_UPGRADE",17:"UNSUPPORTED_HTTP_VERSION"}),n=Object.freeze({OTHER:0,GET:1,HEAD:2,POST:3,PUT:4,DELETE:5,CONNECT:6,OPTIONS:7,TRACE:8,PATCH:9,PRI:10,0:"OTHER",1:"GET",2:"HEAD",3:"POST",4:"PUT",5:"DELETE",6:"CONNECT",7:"OPTIONS",8:"TRACE",9:"PATCH",10:"PRI"}),o=Object.freeze({ON_ERROR:0,ON_FINISH:1,ON_MESSAGE_START:2,ON_MESSAGE_COMPLETE:3,ON_REQUEST:4,ON_RESPONSE:5,ON_RESET:6,ON_METHOD:7,ON_URL:8,ON_PROTOCOL:9,ON_VERSION:10,ON_STATUS:11,ON_REASON:12,ON_HEADER_NAME:13,ON_HEADER_VALUE:14,ON_HEADERS:15,ON_CONNECT:16,ON_UPGRADE:17,ON_CHUNK_LENGTH:18,ON_CHUNK_EXTENSION_NAME:19,ON_CHUNK_EXTENSION_VALUE:20,ON_CHUNK:21,ON_BODY:22,ON_DATA:23,ON_TRAILER_NAME:24,ON_TRAILER_VALUE:25,ON_TRAILERS:26,ON_STATE_CHANGE:27,0:"ON_ERROR",1:"ON_FINISH",2:"ON_MESSAGE_START",3:"ON_MESSAGE_COMPLETE",4:"ON_REQUEST",5:"ON_RESPONSE",6:"ON_RESET",7:"ON_METHOD",8:"ON_URL",9:"ON_PROTOCOL",10:"ON_VERSION",11:"ON_STATUS",12:"ON_REASON",13:"ON_HEADER_NAME",14:"ON_HEADER_VALUE",15:"ON_HEADERS",16:"ON_CONNECT",17:"ON_UPGRADE",18:"ON_CHUNK_LENGTH",19:"ON_CHUNK_EXTENSION_NAME",20:"ON_CHUNK_EXTENSION_VALUE",21:"ON_CHUNK",22:"ON_BODY",23:"ON_DATA",24:"ON_TRAILER_NAME",25:"ON_TRAILER_VALUE",26:"ON_TRAILERS",27:"ON_STATE_CHANGE"}),p=Object.freeze({NONE:0n,ON_ERROR:1n,ON_FINISH:2n,ON_MESSAGE_START:4n,ON_MESSAGE_COMPLETE:8n,ON_REQUEST:16n,ON_RESPONSE:32n,ON_RESET:64n,ON_METHOD:128n,ON_URL:256n,ON_PROTOCOL:512n,ON_VERSION:1024n,ON_STATUS:2048n,ON_REASON:4096n,ON_HEADER_NAME:8192n,ON_HEADER_VALUE:16384n,ON_HEADERS:32768n,ON_CONNECT:65536n,ON_UPGRADE:131072n,ON_CHUNK_LENGTH:262144n,ON_CHUNK_EXTENSION_NAME:524288n,ON_CHUNK_EXTENSION_VALUE:1048576n,ON_CHUNK:2097152n,ON_BODY:4194304n,ON_DATA:8388608n,ON_TRAILER_NAME:16777216n,ON_TRAILER_VALUE:33554432n,ON_TRAILERS:67108864n,ON_STATE_CHANGE:134217728n,ALL:268435455n,0n:"NONE",1n:"ON_ERROR",2n:"ON_FINISH",4n:"ON_MESSAGE_START",8n:"ON_MESSAGE_COMPLETE",16n:"ON_REQUEST",32n:"ON_RESPONSE",64n:"ON_RESET",128n:"ON_METHOD",256n:"ON_URL",512n:"ON_PROTOCOL",1024n:"ON_VERSION",2048n:"ON_STATUS",4096n:"ON_REASON",8192n:"ON_HEADER_NAME",16384n:"ON_HEADER_VALUE",32768n:"ON_HEADERS",65536n:"ON_CONNECT",131072n:"ON_UPGRADE",262144n:"ON_CHUNK_LENGTH",524288n:"ON_CHUNK_EXTENSION_NAME",1048576n:"ON_CHUNK_EXTENSION_VALUE",2097152n:"ON_CHUNK",4194304n:"ON_BODY",8388608n:"ON_DATA",16777216n:"ON_TRAILER_NAME",33554432n:"ON_TRAILER_VALUE",67108864n:"ON_TRAILERS",134217728n:"ON_STATE_CHANGE",268435455n:"ALL"}),q=Object.freeze({END:0,ERROR:1,FINISH:2,MESSAGE_START:3,MESSAGE_COMPLETE:4,REQUEST:5,RESPONSE:6,RESET:7,METHOD:8,URL:9,PROTOCOL:10,VERSION:11,STATUS:12,REASON:13,HEADER_NAME:14,HEADER_VALUE:15,HEADERS:16,CONNECT:17,UPGRADE:18,CHUNK_LENGTH:19,CHUNK_EXTENSION_NAME:20,CHUNK_EXTENSION_VALUE:21,CHUNK:22,BODY:23,DATA:24,TRAILER_NAME:25,TRAILER_VALUE:26,TRAILERS:27,STATE_CHANGE:28,0:"END",1:"ERROR",2:"FINISH",3:"MESSAGE_START",4:"MESSAGE_COMPLETE",5:"REQUEST",6:"RESPONSE",7:"RESET",8:"METHOD",9:"URL",10:"PROTOCOL",11:"VERSION",12:"STATUS",13:"REASON",14:"HEADER_NAME",15:"HEADER_VALUE",16:"HEADERS",17:"CONNECT",18:"UPGRADE",19:"CHUNK_LENGTH",20:"CHUNK_EXTENSION_NAME",21:"CHUNK_EXTENSION_VALUE",22:"CHUNK",23:"BODY",24:"DATA",25:"TRAILER_NAME",26:"TRAILER_VALUE",27:"TRAILERS",28:"STATE_CHANGE"}),r=Object.freeze({NONE:0n,ON_ERROR:1n,ON_FINISH:2n,ON_MESSAGE_START:4n,ON_MESSAGE_COMPLETE:8n,ON_REQUEST:16n,ON_RESPONSE:32n,ON_RESET:64n,ON_METHOD:128n,ON_URL:256n,ON_PROTOCOL:512n,ON_VERSION:1024n,ON_STATUS:2048n,ON_REASON:4096n,ON_HEADER_NAME:8192n,ON_HEADER_VALUE:16384n,ON_HEADERS:32768n,ON_CONNECT:65536n,ON_UPGRADE:131072n,ON_CHUNK_LENGTH:262144n,ON_CHUNK_EXTENSION_NAME:524288n,ON_CHUNK_EXTENSION_VALUE:1048576n,ON_CHUNK:2097152n,ON_BODY:4194304n,ON_DATA:8388608n,ON_TRAILER_NAME:16777216n,ON_TRAILER_VALUE:33554432n,ON_TRAILERS:67108864n,ON_STATE_CHANGE:134217728n,ALL:268435455n,0n:"NONE",1n:"ON_ERROR",2n:"ON_FINISH",4n:"ON_MESSAGE_START",8n:"ON_MESSAGE_COMPLETE",16n:"ON_REQUEST",32n:"ON_RESPONSE",64n:"ON_RESET",128n:"ON_METHOD",256n:"ON_URL",512n:"ON_PROTOCOL",1024n:"ON_VERSION",2048n:"ON_STATUS",4096n:"ON_REASON",8192n:"ON_HEADER_NAME",16384n:"ON_HEADER_VALUE",32768n:"ON_HEADERS",65536n:"ON_CONNECT",131072n:"ON_UPGRADE",262144n:"ON_CHUNK_LENGTH",524288n:"ON_CHUNK_EXTENSION_NAME",1048576n:"ON_CHUNK_EXTENSION_VALUE",2097152n:"ON_CHUNK",4194304n:"ON_BODY",8388608n:"ON_DATA",16777216n:"ON_TRAILER_NAME",33554432n:"ON_TRAILER_VALUE",67108864n:"ON_TRAILERS",134217728n:"ON_STATE_CHANGE",268435455n:"ALL"}),s=Object.freeze({START:0,FINISH:1,ERROR:2,REQUEST_LINE:3,STATUS_LINE:4,HTTP2_PREFACE:5,HEADER:6,BODY_DECISION:7,BODY_VIA_CONTENT_LENGTH:8,BODY_WITH_NO_LENGTH:9,CHUNK_HEADER:10,CHUNK_EXTENSIONS:11,CHUNK_DATA:12,TRAILER:13,TUNNEL:14,0:"START",1:"FINISH",2:"ERROR",3:"REQUEST_LINE",4:"STATUS_LINE",5:"HTTP2_PREFACE",6:"HEADER",7:"BODY_DECISION",8:"BODY_VIA_CONTENT_LENGTH",9:"BODY_WITH_NO_LENGTH",10:"CHUNK_HEADER",11:"CHUNK_EXTENSIONS",12:"CHUNK_DATA",13:"TRAILER",14:"TUNNEL"}),t=Object.freeze({MAX_START_LINE_LENGTH:0,MAX_HEADER_LENGTH:4,MAX_BODY_PAYLOAD:8,AUTODETECT:16,IS_REQUEST:17,SUSPEND_AFTER_HEADERS:18,MANAGE_UNCONSUMED:19,CONTINUE_WITHOUT_DATA:20,IS_CONNECT:21,SKIP_BODY:22,DEBUG:23,PARSED:24,POSITION:32,STATE:36,PAUSED:37,ERROR_CODE:38,CONTENT_LENGTH:40,CHUNK_SIZE:48,REMAINING_CONTENT_LENGTH:56,REMAINING_CHUNK_SIZE:64,STATUS:72,METHOD:76,HAS_CONTENT_LENGTH:77,HAS_TRANSFER_ENCODING:78,HAS_CHUNKED_TRANSFER_ENCODING:79,HAS_CONNECTION_CLOSE:80,HAS_CONNECTION_UPGRADE:81,HAS_UPGRADE:82,HAS_TRAILERS:83,ACTIVE_CALLBACKS:88,ACTIVE_EVENTS:96,PTR:104,ERROR_DESCRIPTION:108,UNCONSUMED:364,UNCONSUMED_LEN:368,ERROR_DESCRIPTION_LEN:372,EVENTS:376,0:"MAX_START_LINE_LENGTH",4:"MAX_HEADER_LENGTH",8:"MAX_BODY_PAYLOAD",16:"AUTODETECT",17:"IS_REQUEST",18:"SUSPEND_AFTER_HEADERS",19:"MANAGE_UNCONSUMED",20:"CONTINUE_WITHOUT_DATA",21:"IS_CONNECT",22:"SKIP_BODY",23:"DEBUG",24:"PARSED",32:"POSITION",36:"STATE",37:"PAUSED",38:"ERROR_CODE",40:"CONTENT_LENGTH",48:"CHUNK_SIZE",56:"REMAINING_CONTENT_LENGTH",64:"REMAINING_CHUNK_SIZE",72:"STATUS",76:"METHOD",77:"HAS_CONTENT_LENGTH",78:"HAS_TRANSFER_ENCODING",79:"HAS_CHUNKED_TRANSFER_ENCODING",80:"HAS_CONNECTION_CLOSE",81:"HAS_CONNECTION_UPGRADE",82:"HAS_UPGRADE",83:"HAS_TRAILERS",88:"ACTIVE_CALLBACKS",96:"ACTIVE_EVENTS",104:"PTR",108:"ERROR_DESCRIPTION",364:"UNCONSUMED",368:"UNCONSUMED_LEN",372:"ERROR_DESCRIPTION_LEN",376:"EVENTS"});function u(a){return 0!==this.is_autodetect(a)}function v(a){return 0!==this.is_request(a)}function w(a){return 0!==this.is_paused(a)}function x(a){return 0!==this.should_manage_unconsumed(a)}function y(a){return 0!==this.should_suspend_after_headers(a)}function z(a){return this.get_max_start_line_length(a)>>>0}function A(a){return this.get_max_header_length(a)>>>0}function B(a){return BigInt.asUintN(64,this.get_max_body_payload(a))}function C(a){return 0!==this.should_continue_without_data(a)}function D(a){return 0!==this.is_connect(a)}function E(a){return 0!==this.is_debug(a)}function F(a){return 0!==this.should_skip_body(a)}function G(a){return this.get_state(a)>>>0}function H(a){return this.get_position(a)>>>0}function I(a){return BigInt.asUintN(64,this.get_parsed(a))}function J(a){return this.get_error_code(a)>>>0}function K(a){return this.get_method(a)>>>0}function L(a){return this.get_status(a)>>>0}function M(a){return 0!==this.has_connection_close(a)}function N(a){return 0!==this.has_connection_upgrade(a)}function O(a){return BigInt.asUintN(64,this.get_content_length(a))}function P(a){return BigInt.asUintN(64,this.get_chunk_size(a))}function Q(a){return BigInt.asUintN(64,this.get_remaining_content_length(a))}function R(a){return BigInt.asUintN(64,this.get_remaining_chunk_size(a))}function S(a){return 0!==this.has_content_length(a)}function T(a){return 0!==this.has_transfer_encoding(a)}function U(a){return 0!==this.has_chunked_transfer_encoding(a)}function V(a){return 0!==this.has_upgrade(a)}function W(a){return 0!==this.has_trailers(a)}function X(a){let b=this.get_error_description_raw(a),c=Number(BigInt.asUintN(32,b)),e=Number(b>>32n);return d.decode(new Uint8Array(this.memory.buffer,e,c))}function Y(a,b){this.set_should_autodetect(a,b)}function Z(a,b){this.set_should_continue_without_data(a,b)}function $(a,b){this.set_is_request(a,b)}function _(a,b){this.set_is_connect(a,b)}function aa(a,b){this.set_debug(a,b)}function ab(a,b){this.set_should_manage_unconsumed(a,b)}function ac(a,b){this.set_should_suspend_after_headers(a,b)}function ad(a,b){this.set_max_start_line_length(a,b)}function ae(a,b){this.set_max_header_length(a,b)}function af(a,b){this.set_max_body_payload(a,b)}function ag(a,b){this.set_should_skip_body(a,b)}function ah(a,b){this.set_active_callbacks(a,b)}function ai(a,b){this.set_active_events(a,b)}function aj(a,b){let c=b();return a[c]=[],this.setActiveCallbacks(c,this.CALLBACK_ACTIVE_ALL),c}function ak(a,b,c){a[c]=void 0,b(c)}function al(){}function am(a={}){let{logger:c,...d}=a,aj=al,ak={};c&&("function"!=typeof c&&(c=console.log),aj=e.bind(ak,c));let an=new WebAssembly.Instance(b,{env:{logger:aj,on_error:al,on_finish:al,on_message_start:al,on_message_complete:al,on_request:al,on_response:al,on_reset:al,on_method:al,on_url:al,on_protocol:al,on_version:al,on_status:al,on_reason:al,on_header_name:al,on_header_value:al,on_headers:al,on_connect:al,on_upgrade:al,on_chunk_length:al,on_chunk_extension_name:al,on_chunk_extension_value:al,on_chunk:al,on_body:al,on_data:al,on_trailer_name:al,on_trailer_value:al,on_trailers:al,on_state_change:al,...d}}).exports;return ak.memory=an.memory,{version:{raw:"0.9.0",major:0,minor:9,patch:0,prerelease:""},METHOD_OTHER:0,METHOD_GET:1,METHOD_HEAD:2,METHOD_POST:3,METHOD_PUT:4,METHOD_DELETE:5,METHOD_CONNECT:6,METHOD_OPTIONS:7,METHOD_TRACE:8,METHOD_PATCH:9,METHOD_PRI:10,CALLBACK_ON_ERROR:0,CALLBACK_ON_FINISH:1,CALLBACK_ON_MESSAGE_START:2,CALLBACK_ON_MESSAGE_COMPLETE:3,CALLBACK_ON_REQUEST:4,CALLBACK_ON_RESPONSE:5,CALLBACK_ON_RESET:6,CALLBACK_ON_METHOD:7,CALLBACK_ON_URL:8,CALLBACK_ON_PROTOCOL:9,CALLBACK_ON_VERSION:10,CALLBACK_ON_STATUS:11,CALLBACK_ON_REASON:12,CALLBACK_ON_HEADER_NAME:13,CALLBACK_ON_HEADER_VALUE:14,CALLBACK_ON_HEADERS:15,CALLBACK_ON_CONNECT:16,CALLBACK_ON_UPGRADE:17,CALLBACK_ON_CHUNK_LENGTH:18,CALLBACK_ON_CHUNK_EXTENSION_NAME:19,CALLBACK_ON_CHUNK_EXTENSION_VALUE:20,CALLBACK_ON_CHUNK:21,CALLBACK_ON_BODY:22,CALLBACK_ON_DATA:23,CALLBACK_ON_TRAILER_NAME:24,CALLBACK_ON_TRAILER_VALUE:25,CALLBACK_ON_TRAILERS:26,CALLBACK_ON_STATE_CHANGE:27,EVENT_END:0,EVENT_ERROR:1,EVENT_FINISH:2,EVENT_MESSAGE_START:3,EVENT_MESSAGE_COMPLETE:4,EVENT_REQUEST:5,EVENT_RESPONSE:6,EVENT_RESET:7,EVENT_METHOD:8,EVENT_URL:9,EVENT_PROTOCOL:10,EVENT_VERSION:11,EVENT_STATUS:12,EVENT_REASON:13,EVENT_HEADER_NAME:14,EVENT_HEADER_VALUE:15,EVENT_HEADERS:16,EVENT_CONNECT:17,EVENT_UPGRADE:18,EVENT_CHUNK_LENGTH:19,EVENT_CHUNK_EXTENSION_NAME:20,EVENT_CHUNK_EXTENSION_VALUE:21,EVENT_CHUNK:22,EVENT_BODY:23,EVENT_DATA:24,EVENT_TRAILER_NAME:25,EVENT_TRAILER_VALUE:26,EVENT_TRAILERS:27,EVENT_STATE_CHANGE:28,CALLBACK_ACTIVE_NONE:0n,EVENT_ACTIVE_NONE:0n,CALLBACK_ACTIVE_ON_ERROR:1n,EVENT_ACTIVE_ON_ERROR:1n,CALLBACK_ACTIVE_ON_FINISH:2n,EVENT_ACTIVE_ON_FINISH:2n,CALLBACK_ACTIVE_ON_MESSAGE_START:4n,EVENT_ACTIVE_ON_MESSAGE_START:4n,CALLBACK_ACTIVE_ON_MESSAGE_COMPLETE:8n,EVENT_ACTIVE_ON_MESSAGE_COMPLETE:8n,CALLBACK_ACTIVE_ON_REQUEST:16n,EVENT_ACTIVE_ON_REQUEST:16n,CALLBACK_ACTIVE_ON_RESPONSE:32n,EVENT_ACTIVE_ON_RESPONSE:32n,CALLBACK_ACTIVE_ON_RESET:64n,EVENT_ACTIVE_ON_RESET:64n,CALLBACK_ACTIVE_ON_METHOD:128n,EVENT_ACTIVE_ON_METHOD:128n,CALLBACK_ACTIVE_ON_URL:256n,EVENT_ACTIVE_ON_URL:256n,CALLBACK_ACTIVE_ON_PROTOCOL:512n,EVENT_ACTIVE_ON_PROTOCOL:512n,CALLBACK_ACTIVE_ON_VERSION:1024n,EVENT_ACTIVE_ON_VERSION:1024n,CALLBACK_ACTIVE_ON_STATUS:2048n,EVENT_ACTIVE_ON_STATUS:2048n,CALLBACK_ACTIVE_ON_REASON:4096n,EVENT_ACTIVE_ON_REASON:4096n,CALLBACK_ACTIVE_ON_HEADER_NAME:8192n,EVENT_ACTIVE_ON_HEADER_NAME:8192n,CALLBACK_ACTIVE_ON_HEADER_VALUE:16384n,EVENT_ACTIVE_ON_HEADER_VALUE:16384n,CALLBACK_ACTIVE_ON_HEADERS:32768n,EVENT_ACTIVE_ON_HEADERS:32768n,CALLBACK_ACTIVE_ON_CONNECT:65536n,EVENT_ACTIVE_ON_CONNECT:65536n,CALLBACK_ACTIVE_ON_UPGRADE:131072n,EVENT_ACTIVE_ON_UPGRADE:131072n,CALLBACK_ACTIVE_ON_CHUNK_LENGTH:262144n,EVENT_ACTIVE_ON_CHUNK_LENGTH:262144n,CALLBACK_ACTIVE_ON_CHUNK_EXTENSION_NAME:524288n,EVENT_ACTIVE_ON_CHUNK_EXTENSION_NAME:524288n,CALLBACK_ACTIVE_ON_CHUNK_EXTENSION_VALUE:1048576n,EVENT_ACTIVE_ON_CHUNK_EXTENSION_VALUE:1048576n,CALLBACK_ACTIVE_ON_CHUNK:2097152n,EVENT_ACTIVE_ON_CHUNK:2097152n,CALLBACK_ACTIVE_ON_BODY:4194304n,EVENT_ACTIVE_ON_BODY:4194304n,CALLBACK_ACTIVE_ON_DATA:8388608n,EVENT_ACTIVE_ON_DATA:8388608n,CALLBACK_ACTIVE_ON_TRAILER_NAME:16777216n,EVENT_ACTIVE_ON_TRAILER_NAME:16777216n,CALLBACK_ACTIVE_ON_TRAILER_VALUE:33554432n,EVENT_ACTIVE_ON_TRAILER_VALUE:33554432n,CALLBACK_ACTIVE_ON_TRAILERS:67108864n,EVENT_ACTIVE_ON_TRAILERS:67108864n,CALLBACK_ACTIVE_ON_STATE_CHANGE:134217728n,EVENT_ACTIVE_ON_STATE_CHANGE:134217728n,CALLBACK_ACTIVE_ALL:268435455n,EVENT_ACTIVE_ALL:268435455n,ERROR_NONE:0,ERROR_USER:1,ERROR_CALLBACK_ERROR:2,ERROR_UNEXPECTED_STATE:3,ERROR_UNEXPECTED_DATA:4,ERROR_UNEXPECTED_EOF:5,ERROR_UNEXPECTED_CHARACTER:6,ERROR_UNEXPECTED_CONTENT_LENGTH:7,ERROR_UNEXPECTED_TRANSFER_ENCODING:8,ERROR_UNEXPECTED_CONTENT:9,ERROR_UNEXPECTED_TRAILERS:10,ERROR_INVALID_VERSION:11,ERROR_INVALID_STATUS:12,ERROR_INVALID_CONTENT_LENGTH:13,ERROR_INVALID_TRANSFER_ENCODING:14,ERROR_INVALID_CHUNK_SIZE:15,ERROR_MISSING_CONNECTION_UPGRADE:16,ERROR_UNSUPPORTED_HTTP_VERSION:17,STATE_START:0,STATE_FINISH:1,STATE_ERROR:2,STATE_REQUEST_LINE:3,STATE_STATUS_LINE:4,STATE_HTTP2_PREFACE:5,STATE_HEADER:6,STATE_BODY_DECISION:7,STATE_BODY_VIA_CONTENT_LENGTH:8,STATE_BODY_WITH_NO_LENGTH:9,STATE_CHUNK_HEADER:10,STATE_CHUNK_EXTENSIONS:11,STATE_CHUNK_DATA:12,STATE_TRAILER:13,STATE_TUNNEL:14,PARSER_FIELD_MAX_START_LINE_LENGTH:0,PARSER_FIELD_MAX_HEADER_LENGTH:4,PARSER_FIELD_MAX_BODY_PAYLOAD:8,PARSER_FIELD_AUTODETECT:16,PARSER_FIELD_IS_REQUEST:17,PARSER_FIELD_SUSPEND_AFTER_HEADERS:18,PARSER_FIELD_MANAGE_UNCONSUMED:19,PARSER_FIELD_CONTINUE_WITHOUT_DATA:20,PARSER_FIELD_IS_CONNECT:21,PARSER_FIELD_SKIP_BODY:22,PARSER_FIELD_DEBUG:23,PARSER_FIELD_PARSED:24,PARSER_FIELD_POSITION:32,PARSER_FIELD_STATE:36,PARSER_FIELD_PAUSED:37,PARSER_FIELD_ERROR_CODE:38,PARSER_FIELD_CONTENT_LENGTH:40,PARSER_FIELD_CHUNK_SIZE:48,PARSER_FIELD_REMAINING_CONTENT_LENGTH:56,PARSER_FIELD_REMAINING_CHUNK_SIZE:64,PARSER_FIELD_STATUS:72,PARSER_FIELD_METHOD:76,PARSER_FIELD_HAS_CONTENT_LENGTH:77,PARSER_FIELD_HAS_TRANSFER_ENCODING:78,PARSER_FIELD_HAS_CHUNKED_TRANSFER_ENCODING:79,PARSER_FIELD_HAS_CONNECTION_CLOSE:80,PARSER_FIELD_HAS_CONNECTION_UPGRADE:81,PARSER_FIELD_HAS_UPGRADE:82,PARSER_FIELD_HAS_TRAILERS:83,PARSER_FIELD_ACTIVE_CALLBACKS:88,PARSER_FIELD_ACTIVE_EVENTS:96,PARSER_FIELD_PTR:104,PARSER_FIELD_ERROR_DESCRIPTION:108,PARSER_FIELD_UNCONSUMED:364,PARSER_FIELD_UNCONSUMED_LEN:368,PARSER_FIELD_ERROR_DESCRIPTION_LEN:372,PARSER_FIELD_EVENTS:376,Errors:m,Methods:n,Callbacks:o,CallbackActives:p,Events:q,EventActives:r,States:s,ParserFields:t,isAutodetect:u.bind(an),isRequest:v.bind(an),isPaused:w.bind(an),shouldManageUnconsumed:x.bind(an),shouldSuspendAfterHeaders:y.bind(an),getMaxStartLineLength:z.bind(an),getMaxHeaderLength:A.bind(an),getMaxBodyPayload:B.bind(an),shouldContinueWithoutData:C.bind(an),isConnect:D.bind(an),isDebug:E.bind(an),shouldSkipBody:F.bind(an),getState:G.bind(an),getPosition:H.bind(an),getParsed:I.bind(an),getErrorCode:J.bind(an),getMethod:K.bind(an),getStatus:L.bind(an),hasConnectionClose:M.bind(an),hasConnectionUpgrade:N.bind(an),getContentLength:O.bind(an),getChunkSize:P.bind(an),getRemainingContentLength:Q.bind(an),getRemainingChunkSize:R.bind(an),hasContentLength:S.bind(an),hasTransferEncoding:T.bind(an),hasChunkedTransferEncoding:U.bind(an),hasUpgrade:V.bind(an),hasTrailers:W.bind(an),getErrorDescription:X.bind(an),setShouldAutodetect:Y.bind(an),setShouldContinueWithoutData:Z.bind(an),setIsRequest:$.bind(an),setIsConnect:_.bind(an),setDebug:aa.bind(an),setShouldManageUnconsumed:ab.bind(an),setShouldSuspendAfterHeaders:ac.bind(an),setMaxStartLineLength:ad.bind(an),setMaxHeaderLength:ae.bind(an),setMaxBodyPayload:af.bind(an),setShouldSkipBody:ag.bind(an),setActiveCallbacks:ah.bind(an),setActiveEvents:ai.bind(an),memory:an.memory,alloc:f.bind(an),dealloc:g.bind(an),create:h.bind(an),destroy:i.bind(an),parse:j.bind(an),fail:k.bind(an),hasDebug:l.bind(an),clear:an.clear,complete:an.complete,finish:an.finish,pause:an.pause,reset:an.reset,resume:an.resume}}a.exports={wasmModule:b,noop:al,setup:am,simple:function(){let a={},b=am({});return b.spans=a,b.create=aj.bind(b,a,b.create),b.destroy=ak.bind(b,a,b.destroy),b}}},56698:(a,b,c)=>{"use strict";let d=c(34589);class e{#b5=!1;#b6;#a$;#R;#b7;constructor(a,b,c){if("function"!=typeof a)throw TypeError("callback must be a function");this.#b6=a,this.#a$=b,this.#b7=c}onRequestStart(a,b){this.#b5=!1,this.#R=b}onRequestUpgrade(a,b,c,d){this.#a$.onRequestUpgrade?.(a,b,c,d)}onResponseStart(a,b,c,e){if(d(null!=this.#b6),this.#b5=304===b||this.#b7&&b>=500&&b<=504,this.#b6(this.#b5,this.#R,b,c),this.#b6=null,this.#b5)return!0;this.#a$.onRequestStart?.(a,this.#R),this.#a$.onResponseStart?.(a,b,c,e)}onResponseData(a,b){if(!this.#b5)return this.#a$.onResponseData?.(a,b)}onResponseEnd(a,b){this.#b5||this.#a$.onResponseEnd?.(a,b)}onResponseError(a,b){if(!this.#b5){if(this.#b6){if(this.#b7){this.#b5=!0,this.#b6(!0,this.#R),this.#b6=null;return}this.#b6(!1),this.#b6=null}if("function"==typeof this.#a$.onResponseError)this.#a$.onResponseError(a,b);else throw b}}}a.exports=e},56758:(a,b,c)=>{"use strict";let d={__proto__:null,"node:crypto":()=>c(77598),"node:sqlite":()=>c(79868)},e=["crypto","sqlite"];class f{#b8=new Map;clear(){this.#b8.clear()}has(a){return this.#b8.get(a)??this.#b9(a)}set(a,b){if(!1===e.includes(a))throw TypeError(`unknown feature: ${a}`);this.#b8.set(a,b)}#b9(a){let b=function(a){if(e.includes(a)){var b=`node:${a}`;try{return d[b](),!0}catch(a){if("ERR_UNKNOWN_BUILTIN_MODULE"!==a.code&&"ERR_NO_CRYPTO"!==a.code)throw a;return!1}}throw TypeError(`unknown feature: ${a}`)}(a);return this.#b8.set(a,b),b}}let g=new f;a.exports.runtimeFeatures=g,a.exports.default=g},57317:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{FD:()=>o,nl:()=>m});var e=c(55511),f=c(21616),g=c(79499);let a=null;if(!("u">typeof caches&&"object"==typeof caches||"u">typeof EdgeRuntime))try{a=await Promise.resolve().then(c.t.bind(c,73496,23))}catch{}let p=new Map;function h(a,b){let c=a.get(b)?.[0]?.value;return c&&"number"!=typeof c?Buffer.from(c).toString("utf8"):""}function i(a,b){let c=b,d=0n;for(let b=0;b<10;b+=1){if(c>=a.length)throw Error("truncated protobuf varint");let e=a[c++];if(d|=BigInt(127&e)<<BigInt(7*b),(128&e)==0){if(d>BigInt(Number.MAX_SAFE_INTEGER))throw Error("protobuf varint exceeds safe range");return[Number(d),c]}}throw Error("protobuf varint exceeds 10 bytes")}function j(a){let b=Buffer.from(a),c=0;for(;c<b.length;){let a,d;[a,c]=i(b,c);let e=Math.floor(a/8),f=a%8;if(0===e)throw Error("protobuf field zero is invalid");if(0===f){[,c]=i(b,c);continue}let g=1===f?8:5===f?4:null;if(null!==g){if(g>b.length-c)throw Error("truncated fixed protobuf field");c+=g;continue}if(2!==f)throw Error(`unsupported protobuf wire type ${f}`);if([d,c]=i(b,c),d>b.length-c)throw Error("truncated protobuf field");c+=d}}function k({url:b,headers:c,signal:d}){return a?new Promise((e,f)=>{let g,h=new URL(b),i=a.connect(`${h.protocol}//${h.host}`),j=[],k={},l=!1,m=(a,b)=>{if(!l){l=!0,clearTimeout(o),d?.removeEventListener?.("abort",n);try{g?.close?.()}catch{}try{i.close()}catch{}a(b)}},n=()=>{let a=Error("Cursor model request aborted");a.name="AbortError",m(f,a)},o=setTimeout(()=>{m(f,Error("Cursor model request timed out"))},1e4);o.unref?.(),i.on("error",a=>m(f,a)),(g=i.request({":method":"POST",":path":h.pathname,":authority":h.host,":scheme":h.protocol.slice(0,-1),...c})).on("response",a=>{k=a}),g.on("data",a=>j.push(a)),g.on("error",a=>m(f,a)),g.on("end",()=>m(e,{status:Number(k[":status"]||0),body:Buffer.concat(j)})),d?.aborted?n():d?.addEventListener?.("abort",n,{once:!0}),l||g.end()}):Promise.reject(Error("HTTP/2 is unavailable for Cursor model discovery"))}function l(a,b){return a.get(b)?.[0]?.value===1}function m(a){if(!Array.isArray(a)||0===a.length)return null;let b=a.filter(a=>a.supportsAgent&&!a.isChatOnly&&!a.isHidden);return 0===b.length?null:{modelId:(b.find(a=>a.defaultOn)||b[0]).id,matchedBy:"auto-default"}}function n(a,b){return{models:a,source:"static",warning:b}}async function o(a={},b={}){let c,d=Array.isArray(b.staticModels)?b.staticModels:[];if(!a.accessToken||!a.providerSpecificData?.machineId)return n(d,"Cursor live catalog needs a valid token and machine ID; using static catalog.");let i=(c=[a?.id,a?.providerSpecificData?.machineId].filter(Boolean).join(":"))?(0,e.createHash)("sha256").update(`cursor:${c}`).digest("hex"):null,m=Date.now();if(!b.forceRefresh&&i){let a=p.get(i);if(a?.expiresAt>m)return{models:a.models,source:"live"}}let q=b.requestFn||k;try{let c,e=await q({url:"https://agent.api5.cursor.sh/agent.v1.AgentService/GetUsableModels",headers:(c={...(0,f.JA)(a.accessToken,a.providerSpecificData.machineId,!1!==a.providerSpecificData.ghostMode),accept:"application/proto","content-type":"application/proto"},delete c["connect-accept-encoding"],delete c["connect-protocol-version"],c),signal:b.signal});if(e?.status!==200)return n(d,`Cursor live catalog returned HTTP ${Number(e?.status)||502}; using static catalog.`);let k=function(a,b){let c=function(a){let b=(0,g.Y8)(a),c=new Set,d=[];for(let a of b.get(2)||[]){if(!a?.value||"number"==typeof a.value)continue;let b=(0,g.Y8)(a.value),e=h(b,1).trim();!e||c.has(e)||(c.add(e),d.push({id:e,defaultOn:l(b,2),isChatOnly:l(b,4),supportsAgent:l(b,5),isHidden:l(b,35)}))}return d}(b);if(!c.length||!Array.isArray(a))return a;let d=new Map(c.map(a=>[a.id,a]));return a.map(a=>{let b=d.get(a.id);return b?{...a,...b}:a})}(function(a){j(a);let b=(0,g.Y8)(new Uint8Array(a)),c=new Set,d=[];for(let a of b.get(1)||[]){if(!a?.value||"number"==typeof a.value)continue;j(a.value);let b=(0,g.Y8)(a.value),e=h(b,1).trim();if(!e||c.has(e))continue;c.add(e);let f=(h(b,4)||h(b,5)||h(b,3)||e).trim();d.push({id:e,name:f})}return d}(e.body),e.body);if(!k.length)return n(d,"Cursor returned a malformed model catalog; using static catalog.");return i&&p.set(i,{expiresAt:m+3e5,models:k}),{models:k,source:"live"}}catch(c){let a=c?.name==="AbortError"?"Cursor live catalog request was cancelled; using static catalog.":"Cursor live catalog temporarily unavailable; using static catalog.";return b.log?.warn?.("CURSOR_MODELS",a),n(d,a)}}d()}catch(a){d(a)}},1)},57431:(a,b,c)=>{"use strict";c.r(b),c.d(b,{admitApiKeyRequest:()=>p,checkApiKeyBudget:()=>w,checkApiKeyTokenQuota:()=>u,createApiKey:()=>m,deleteApiKey:()=>q,getApiKeyById:()=>l,getApiKeyConnectionPolicy:()=>t,getApiKeyPolicy:()=>s,getApiKeys:()=>k,incrementKeyTokens:()=>v,maskApiKey:()=>i,rotateApiKey:()=>o,updateApiKey:()=>n,validateApiKey:()=>r});var d=c(27137),e=c(52825);let f=new Map,g=new Map;function h(a){let b=a;if(!Array.isArray(b)){if(!b)return[];try{b=JSON.parse(b)}catch{return[]}}return Array.isArray(b)?[...new Set(b.filter(a=>"string"==typeof a).map(a=>a.trim()).filter(Boolean))]:[]}function i(a){return a?a.length<=12?`${a.slice(0,4)}…`:`${a.slice(0,8)}…${a.slice(-4)}`:null}function j(a,b=!1){return a?{id:a.id,key:b?a.key:void 0,maskedKey:i(a.key),name:a.name,machineId:a.machineId,isActive:1===a.isActive||!0===a.isActive,createdAt:a.createdAt,budgetDaily:a.budgetDaily||0,budgetMonthly:a.budgetMonthly||0,requestsPerMinute:a.requestsPerMinute||0,tokenLimit:Number(a.tokenLimit)||0,usedTokens:Number(a.usedTokens)||0,allowedModels:function(a){if(Array.isArray(a))return a;if(!a)return[];try{return JSON.parse(a)}catch{return[]}}(a.allowedModels),allowedConnectionIds:h(a.allowedConnectionIds),allowedCombos:h(a.allowedCombos)}:null}async function k(a=!1){return(await (0,e.cK)()).all("SELECT * FROM apiKeys ORDER BY createdAt ASC").map(b=>j(b,a))}async function l(a,b=!1){return j((await (0,e.cK)()).get("SELECT * FROM apiKeys WHERE id = ?",[a]),b)}async function m(a,b){if(!b)throw Error("machineId is required");let f=await (0,e.cK)(),{generateApiKeyWithMachine:g}=await c.e(6103).then(c.bind(c,86103)),h=g(b),i={id:(0,d.A)(),name:a,key:h.key,machineId:b,isActive:!0,createdAt:new Date().toISOString()};return f.run("INSERT INTO apiKeys(id, key, name, machineId, isActive, createdAt) VALUES(?, ?, ?, ?, ?, ?)",[i.id,i.key,i.name,i.machineId,1,i.createdAt]),i}async function n(a,b){let c=await (0,e.cK)(),d=null;return c.transaction(()=>{let e=c.get("SELECT * FROM apiKeys WHERE id = ?",[a]);if(!e)return;let f={...j(e,!0),...b};c.run("UPDATE apiKeys SET key = ?, name = ?, machineId = ?, isActive = ?, budgetDaily = ?, budgetMonthly = ?, requestsPerMinute = ?, tokenLimit = ?, usedTokens = ?, allowedModels = ?, allowedConnectionIds = ?, allowedCombos = ? WHERE id = ?",[f.key,f.name,f.machineId,+!!f.isActive,Number(f.budgetDaily)||0,Number(f.budgetMonthly)||0,Number(f.requestsPerMinute)||0,Math.max(0,Number(f.tokenLimit)||0),Math.max(0,Number(f.usedTokens)||0),JSON.stringify(f.allowedModels||[]),JSON.stringify(h(f.allowedConnectionIds)),JSON.stringify(h(f.allowedCombos)),a]),d=f}),d}async function o(a){let b=await (0,e.cK)(),d=b.get("SELECT * FROM apiKeys WHERE id = ?",[a]);if(!d)return null;let{generateApiKeyWithMachine:f}=await c.e(6103).then(c.bind(c,86103)),g=f(d.machineId).key;return b.run("UPDATE apiKeys SET key = ? WHERE id = ?",[g,a]),{...j({...d,key:g}),key:g}}async function p(a){let b=(await (0,e.cK)()).get("SELECT budgetDaily, budgetMonthly, requestsPerMinute FROM apiKeys WHERE key = ?",[a]);if(!b)return{allowed:!0,touch(){},release(){}};let c=Number(b.requestsPerMinute)||0;if(c>0){let b=Date.now(),d=(g.get(a)||[]).filter(a=>b-a<6e4);if(d.length>=c){let c=Math.max(1,Math.ceil((6e4-(b-d[0]))/1e3));return g.set(a,d),{allowed:!1,status:429,retryAfter:c,reason:"API key rate limit exceeded"}}d.push(b),!g.has(a)&&g.size>=1e4&&function(a){for(let[b,c]of g)(0===c.length||a-c[c.length-1]>=6e4)&&g.delete(b)}(b),g.set(a,d)}if(!(Number(b.budgetDaily)>0||Number(b.budgetMonthly)>0))return{allowed:!0,touch(){},release(){}};let d=Date.now(),h=f.get(a);if(h&&d-h.activeAt<6e4)return{allowed:!1,status:429,retryAfter:1,reason:"A budgeted request is already in progress"};let i={token:Symbol("budget-slot"),activeAt:d};return f.set(a,i),{allowed:!0,touch:()=>{let b=f.get(a);b?.token===i.token&&(b.activeAt=Date.now())},release:()=>{f.get(a)?.token===i.token&&f.delete(a)}}}async function q(a){let b=(await (0,e.cK)()).run("DELETE FROM apiKeys WHERE id = ?",[a]);return(b?.changes??0)>0}async function r(a){let b=(await (0,e.cK)()).get("SELECT isActive FROM apiKeys WHERE key = ?",[a]);return!!b&&(1===b.isActive||!0===b.isActive)}async function s(a){if(!a)return null;let b=(await (0,e.cK)()).get("SELECT isActive, allowedModels, allowedConnectionIds, allowedCombos FROM apiKeys WHERE key = ?",[a]);return b?Object.freeze({active:1===b.isActive||!0===b.isActive,allowedModels:Object.freeze(h(b.allowedModels)),allowedConnectionIds:Object.freeze(h(b.allowedConnectionIds)),allowedCombos:Object.freeze(h(b.allowedCombos))}):null}async function t(a){if(!a)return null;let b=(await (0,e.cK)()).get("SELECT allowedConnectionIds FROM apiKeys WHERE key = ?",[a]);return b?h(b.allowedConnectionIds):null}async function u(a){if(!a)return{allowed:!0};let b=(await (0,e.cK)()).get("SELECT isActive, tokenLimit, usedTokens FROM apiKeys WHERE key = ?",[a]);if(!b)return{allowed:!0};if(1!==b.isActive&&!0!==b.isActive)return{allowed:!1,status:401,reason:"API key is paused"};let c=Number(b.tokenLimit)||0,d=Number(b.usedTokens)||0;return c>0&&d>=c?{allowed:!1,status:429,reason:`Token limit exceeded for this API key (${d} / ${c} tokens used)`}:{allowed:!0,tokenLimit:c,usedTokens:d}}async function v(a,b){let c=Math.floor(Number(b));a&&Number.isFinite(c)&&!(c<=0)&&(await (0,e.cK)()).run("UPDATE apiKeys SET usedTokens = COALESCE(usedTokens, 0) + ? WHERE key = ?",[c,a])}async function w(a){let b=await (0,e.cK)(),c=b.get("SELECT budgetDaily, budgetMonthly FROM apiKeys WHERE key = ?",[a]);if(!c)return{allowed:!0};let d=c.budgetDaily||0,f=c.budgetMonthly||0;if(d<=0&&f<=0)return{allowed:!0,budgetDaily:d,budgetMonthly:f};let g=0,h=0;try{if(d>0){let c=new Date;c.setHours(0,0,0,0);let d=b.get("SELECT COALESCE(SUM(cost), 0) AS total FROM usageHistory WHERE apiKey = ? AND timestamp >= ?",[a,c.toISOString()]);g=d?.total||0}if(f>0){let c=new Date;c.setDate(1),c.setHours(0,0,0,0);let d=b.get("SELECT COALESCE(SUM(cost), 0) AS total FROM usageHistory WHERE apiKey = ? AND timestamp >= ?",[a,c.toISOString()]);h=d?.total||0}}catch(a){return{allowed:!1,error:!0,reason:"Budget accounting unavailable"}}return d>0&&g>=d?{allowed:!1,reason:`Daily budget exceeded ($${g.toFixed(4)} / $${d})`,spentDaily:g,spentMonthly:h,budgetDaily:d,budgetMonthly:f}:f>0&&h>=f?{allowed:!1,reason:`Monthly budget exceeded ($${h.toFixed(4)} / $${f})`,spentDaily:g,spentMonthly:h,budgetDaily:d,budgetMonthly:f}:{allowed:!0,spentDaily:g,spentMonthly:h,budgetDaily:d,budgetMonthly:f}}},57435:(a,b,c)=>{"use strict";let{Readable:d,Duplex:e,PassThrough:f}=c(57075),g=c(34589),{AsyncResource:h}=c(16698),{InvalidArgumentError:i,InvalidReturnValueError:j,RequestAbortedError:k}=c(61448),l=c(84285),{kBodyUsed:m}=c(49176),{addSignal:n,removeSignal:o}=c(73135);function p(){}let q=Symbol("resume");class r extends d{constructor(){super({autoDestroy:!0}),this[q]=null,this[m]=!0}_read(){let{[q]:a}=this;a&&(this[q]=null,a())}_destroy(a,b){this._read(),b(a)}}class s extends d{constructor(a){super({autoDestroy:!0}),this[q]=a}_read(){this[q]()}_destroy(a,b){a||this._readableState.endEmitted||(a=new k),b(a)}}class t extends h{constructor(a,b){if(!a||"object"!=typeof a)throw new i("invalid opts");if("function"!=typeof b)throw new i("invalid handler");let{signal:c,method:d,opaque:f,onInfo:g,responseHeaders:h}=a;if(c&&"function"!=typeof c.on&&"function"!=typeof c.addEventListener)throw new i("signal must be an EventEmitter or EventTarget");if("CONNECT"===d)throw new i("invalid method");if(g&&"function"!=typeof g)throw new i("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=f||null,this.responseHeaders=h||null,this.handler=b,this.abort=null,this.context=null,this.onInfo=g||null,this.req=new r().on("error",p),this.ret=new e({readableObjectMode:a.objectMode,autoDestroy:!0,read:()=>{let{body:a}=this;a?.resume&&a.resume()},write:(a,b,c)=>{let{req:d}=this;d.push(a,b)||d._readableState.destroyed?c():d[q]=c},destroy:(a,b)=>{let{body:c,req:d,res:e,ret:f,abort:g}=this;a||f._readableState.endEmitted||(a=new k),g&&a&&g(),l.destroy(c,a),l.destroy(d,a),l.destroy(e,a),o(this),b(a)}}).on("prefinish",()=>{let{req:a}=this;a.push(null)}),this.res=null,n(this,c)}onRequestStart(a,b){let{res:c}=this;this.reason?a.abort(this.reason):(g(!c,"pipeline cannot be retried"),this.abort=b=>a.abort(b),this.context=b)}onResponseStart(a,b,c,d){let e,{opaque:f,handler:g,context:h}=this;if(b<200){if(this.onInfo){let d=a?.rawHeaders,e="raw"===this.responseHeaders?l.parseRawHeaders(d):c;this.onInfo({statusCode:b,headers:e})}return}this.res=new s(()=>a.resume());try{this.handler=null;let d=a?.rawHeaders,i="raw"===this.responseHeaders?l.parseRawHeaders(d):c;e=this.runInAsyncScope(g,null,{statusCode:b,headers:i,opaque:f,body:this.res,context:h})}catch(a){throw this.res.on("error",p),a}if(!e||"function"!=typeof e.on)throw new j("expected Readable");e.on("data",a=>{let{ret:b,body:c}=this;!b.push(a)&&c.pause&&c.pause()}).on("error",a=>{let{ret:b}=this;l.destroy(b,a)}).on("end",()=>{let{ret:a}=this;a.push(null)}).on("close",()=>{let{ret:a}=this;a._readableState.ended||l.destroy(a,new k)}),this.body=e}onResponseData(a,b){let{res:c}=this;!1===c.push(b)&&a.pause()}onResponseEnd(a,b){let{res:c}=this;c.push(null)}onResponseError(a,b){let{ret:c}=this;this.handler=null,l.destroy(c,b)}}a.exports=function(a,b){try{let c=new t(a,b);return this.dispatch({...a,body:c.req},c),c.ret}catch(a){return new f().destroy(a)}}},57472:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"tencent",alias:"hunyuan",aliases:["tencent-hunyuan"],category:"apikey",authModes:["apikey"],display:{name:"Tencent Hunyuan",icon:"cloud",color:"#0052D9",textIcon:"HY",website:"https://cloud.tencent.com/product/hunyuan",notice:{apiKeyUrl:"https://console.cloud.tencent.com/hunyuan/api-key"}},transport:{baseUrl:"https://api.hunyuan.cloud.tencent.com/v1/chat/completions",validateUrl:"https://api.hunyuan.cloud.tencent.com/v1/models",format:"openai"},models:[{id:"hunyuan-turbos-latest",name:"Hunyuan TurboS Latest",contextLength:2e5},{id:"hunyuan-t1-latest",name:"Hunyuan T1 Latest",contextLength:256e3}],serviceKinds:["llm"]}},57861:(a,b,c)=>{"use strict";function d(a){return a&&"object"==typeof a?"string"==typeof a.reasoning_content&&a.reasoning_content?a.reasoning_content:"string"==typeof a.reasoning&&a.reasoning?a.reasoning:Array.isArray(a.reasoning_details)?a.reasoning_details.map(a=>"string"==typeof a?a:a?.text||a?.content||"").join(""):"":""}c.d(b,{V:()=>d})},58001:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"agnes",alias:"agnes",aliases:["agnes-ai"],category:"freeTier",authModes:["apikey"],passthroughModels:!0,display:{name:"Agnes AI",icon:"auto_awesome",color:"#7C3AED",textIcon:"AG",website:"https://agnes-ai.com",notice:{text:"OpenAI-compatible gateway. Accepts a bearer token. The live catalogue needs a key, so the seed list is a starting set.",apiKeyUrl:"https://platform.agnes-ai.com"}},transport:{baseUrl:"https://apihub.agnes-ai.com/v1/chat/completions",validateUrl:"https://apihub.agnes-ai.com/v1/models",format:"openai"},models:[{id:"agnes-2.5-flash",name:"Agnes 2.5 Flash"},{id:"agnes-2.5-pro",name:"Agnes 2.5 Pro"},{id:"agnes-2.5-pro-beta",name:"Agnes 2.5 Pro Beta"},{id:"agnes-3.0-flash",name:"Agnes 3.0 Flash"}],serviceKinds:["llm"]}},58455:(a,b,c)=>{"use strict";c.d(b,{M:()=>e});var d=c(8735);function e(a){let b=a.max_tokens||d.Uc;return a.tools&&Array.isArray(a.tools)&&a.tools.length>0&&b<d.eo&&(b=d.eo),a.thinking?.budget_tokens&&b<=a.thinking.budget_tokens&&(b=a.thinking.budget_tokens+1024),b}},58609:(a,b,c)=>{"use strict";c.d(b,{U:()=>f});var d=c(52825),e=c(50743);function f(a){return{async get(b,c=null){let f=(await (0,d.cK)()).get("SELECT value FROM kv WHERE scope = ? AND key = ?",[a,b]);return f?(0,e.q)(f.value,c):c},async getAll(){let b=(await (0,d.cK)()).all("SELECT key, value FROM kv WHERE scope = ?",[a]),c={};for(let a of b)c[a.key]=(0,e.q)(a.value);return c},async set(b,c){(await (0,d.cK)()).run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,b,(0,e.s)(c)])},async setMany(b){let c=await (0,d.cK)();c.transaction(()=>{for(let[d,f]of Object.entries(b))c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,d,(0,e.s)(f)])})},async remove(b){(await (0,d.cK)()).run("DELETE FROM kv WHERE scope = ? AND key = ?",[a,b])},async clear(){(await (0,d.cK)()).run("DELETE FROM kv WHERE scope = ?",[a])}}}},59011:(a,b,c)=>{"use strict";c.d(b,{T:()=>I});var d=c(55511),e=c(69384);let f=`You are Codex, based on GPT-5. You are running as a coding agent in the Codex CLI on a user's computer.
351
351
 
352
352
  ## General
353
353
 
@@ -474,7 +474,7 @@ ${o}`),!i)throw Error("DeepSeek web session ended before completion (no FINISHED
474
474
  ${b}`})),s(),r({},"stop"),j.enqueue(a.encode(e.$U)),j.close()},o=!1,{finishOnce:()=>{if(!o){o=!0;try{n()}catch{}}},hasFinished:()=>o}),{scheduleFinishAfterDrain:v,clearFinishedDrain:w,isDrainPending:x}=function(a,b=750){let c=null,d=()=>{c&&(clearTimeout(c),c=null)};return{scheduleFinishAfterDrain:()=>{d(),c=setTimeout(()=>{c=null,a()},b)},clearFinishedDrain:d,isDrainPending:()=>null!==c}}(t),y=a=>{let b=Y(a,c);if(!b)return;s();let d=k;!d&&l?d="thinking":!d&&X(c)&&(d="content"),"thinking"===d?r({reasoning_content:b}):r({content:b})},z=(a,b=!1)=>{let c;if(b&&("THINK"===(c=String(a?.type||"").toUpperCase())?k="thinking":("ANSWER"===c||"RESPONSE"===c)&&(k="content")),"string"==typeof a?.content&&0!==a.content.length){if(!b){let b=String(a?.type||"").toUpperCase();"THINK"===b?k="thinking":("ANSWER"===b||"RESPONSE"===b)&&(k="content")}y(a.content)}};try{for(;;){let{done:a,value:c}=await p.read();if(a)break;let d=(q+=b.decode(c,{stream:!0})).split("\n");for(let a of(q=d.pop()||"",d)){let b;if(!a.startsWith("data: ")&&!a.startsWith("data:"))continue;let c=a.replace(/^data:\s*/,"").trim();if("[DONE]"===c)return void t();try{b=JSON.parse(c)}catch{continue}let d=b?.p,e=b?.o,f=b?.v;if(f&&"object"==typeof f&&f.response){!0===f.response.thinking_enabled?k="thinking":!1===f.response.thinking_enabled&&(k="content");let a=f.response.fragments;if(Array.isArray(a))for(let b of a)z(b,!1)}if("response/fragments"===d)if(Array.isArray(f))for(let a of f)z(a,!0);else f&&"object"==typeof f&&z(f,!0);if("response"===d&&Array.isArray(f))for(let a of f)a?.p==="response"&&a?.v?.thinking_enabled===!0&&(k="thinking");if("response/search_status"!==d){if("response/search_results"===d&&Array.isArray(f)){if("BATCH"!==e)m.length=0,m.push(...f);else for(let a of f){let b=String(a?.p||"").match(/^(\d+)\/cite_index$/);if(b){let c=parseInt(b[1],10);m[c]&&(m[c].cite_index=a.v)}}continue}if("string"==typeof f)y(f);else if(Array.isArray(f)&&"response"===d){for(let a of f)if(Array.isArray(a?.v)){let b=a.v.map(a=>a?.content||"").join("");b&&y(b)}}if("response/status"===d&&"FINISHED"===f){v();continue}x()&&v()}}}}catch(a){w(),u()||j.error(a);return}t()},cancel(){}},{highWaterMark:16384}),n=j.getReader(),new ReadableStream({async pull(a){let{done:b,value:c}=await n.read();if(b){a.close(),H().catch(()=>{});return}a.enqueue(c)},cancel(){n.cancel(),H().catch(()=>{})}}));return{response:new Response(o,{status:200,headers:{...e.uB}}),url:aa,headers:F,transformedBody:G}}let{content:J,reasoningContent:K}=await aj(E.body,I);await H();let L={role:"assistant",content:J};K&&(L.reasoning_content=K);let M={id:`chatcmpl-${Date.now()}`,object:"chat.completion",created:Math.floor(Date.now()/1e3),model:a||v,choices:[{index:0,message:L,finish_reason:"stop",logprobs:null}],usage:{prompt_tokens:0,completion_tokens:0,total_tokens:0}};return{response:new Response(JSON.stringify(M),{status:200,headers:{"Content-Type":"application/json"}}),url:aa,headers:F,transformedBody:G}}catch(c){let a=c instanceof Error?c.message:String(c);if(h?.error?.("DEEPSEEK-WEB",`Execute failed: ${a}`),c instanceof Error&&"AbortError"===c.name)return{response:ag(499,"Request cancelled"),url:aa,headers:{},transformedBody:b};return{response:ag(502,`DeepSeek error: ${a}`),url:aa,headers:{},transformedBody:b}}}}new ao},60856:(a,b,c)=>{"use strict";c.d(b,{Nm:()=>h});var d=c(91824);let e=new Set(["connect","first_event","progress_idle","total"]),f=/\((?:none|minimal|low|medium|high|xhigh|max|thinking)\)$/i;function g(a,b,c=120){return String(a||"").trim().toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,c)||b}function h(a){return g((String(a||"").trim().split("/").at(-1)||"").replace(f,""),"unknown-model")}function i(a={}){let b,c=g(a.phase,"unknown-phase",40);return{provider:(b=g(a.provider,"unknown-provider",80),g((0,d.g2)(b),"unknown-provider",80)),modelFamily:h(a.modelFamily||a.model),operation:g(a.operation,"chat",40),phase:c}}function j(a){return[a.provider,a.modelFamily,a.operation,a.phase].join("\x1f")}function k(a,b){if(0===a.length)return null;let c=Math.max(1,Math.ceil(b*a.length));return a[c-1]}!function(a={}){let b=Number(a.maxSamples),c=Number(a.alpha),d=Number.isInteger(b)&&b>0?Math.min(b,256):256,f=Number.isFinite(c)&&c>0&&c<=1?c:.2,g="function"==typeof a.now?a.now:Date.now,h=new Map;Object.freeze({record:function(a={}){if(!Number.isFinite(a.durationMs)||a.durationMs<=0)return!1;let b=i(a);if(!e.has(b.phase))return!1;let c=j(b),k=h.get(c);return k||(k={dimensions:b,samples:[],ewmaMs:null,updatedAtMs:null},h.set(c,k)),k.samples.push(a.durationMs),k.samples.length>d&&k.samples.shift(),k.ewmaMs=null===k.ewmaMs?a.durationMs:f*a.durationMs+(1-f)*k.ewmaMs,k.updatedAtMs=g(),!0},snapshot:function(a={}){let b=i(a),c=h.get(j(b));if(!c)return Object.freeze({...b,count:0,learned:!1,minMs:null,maxMs:null,p50Ms:null,p95Ms:null,p99Ms:null,ewmaMs:null,updatedAtMs:null});let d=[...c.samples].sort((a,b)=>a-b);return Object.freeze({...c.dimensions,count:d.length,learned:d.length>=20,minMs:d[0],maxMs:d.at(-1),p50Ms:k(d,.5),p95Ms:k(d,.95),p99Ms:k(d,.99),ewmaMs:c.ewmaMs,updatedAtMs:c.updatedAtMs})}})}()},61330:(a,b,c)=>{"use strict";let{BalancedPoolMissingUpstreamError:d,InvalidArgumentError:e}=c(61448),{PoolBase:f,kClients:g,kNeedDrain:h,kAddClient:i,kRemoveClient:j,kGetDispatcher:k}=c(39065),l=c(35689),{kOriginless:m,kUrl:n}=c(49176),o=c(84285),p=Symbol("factory"),q=Symbol("options"),r=Symbol("kGreatestCommonDivisor"),s=Symbol("kCurrentWeight"),t=Symbol("kIndex"),u=Symbol("kWeight"),v=Symbol("kMaxWeightPerServer"),w=Symbol("kErrorPenalty");function x(a,b){return new l(a,b)}class y extends f{constructor(a=[],{factory:b=x,connect:c,tls:d,...f}={}){if("function"!=typeof b)throw new e("factory must be a function.");for(let e of(super(f),this[m]=!0,c&&"function"!=typeof c&&(c={...c}),d&&"function"!=typeof d&&(d={...d}),this[q]={...o.deepClone(f),connect:c,tls:d},this[t]=-1,this[s]=0,this[v]=this[q].maxWeightPerServer||100,this[w]=this[q].errorPenalty||15,Array.isArray(a)||(a=[a]),this[p]=b,a))this.addUpstream(e);this._updateBalancedPoolStats()}addUpstream(a){let b=o.parseOrigin(a).origin;if(this[g].find(a=>a[n].origin===b&&!0!==a.closed&&!0!==a.destroyed))return this;let c=this[p](b,this[q]);for(let a of(this[i](c),c.on("connect",()=>{c[u]=Math.min(this[v],c[u]+this[w])}),c.on("connectionError",()=>{c[u]=Math.max(1,c[u]-this[w]),this._updateBalancedPoolStats()}),c.on("disconnect",(...a)=>{let b=a[2];b&&"UND_ERR_SOCKET"===b.code&&(c[u]=Math.max(1,c[u]-this[w]),this._updateBalancedPoolStats())}),this[g]))a[u]=this[v];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let a=0;for(let b=0;b<this[g].length;b++)a=function(a,b){if(0===a)return b;for(;0!==b;){let c=b;b=a%b,a=c}return a}(this[g][b][u],a);this[r]=a}removeUpstream(a){let b=o.parseOrigin(a).origin,c=this[g].find(a=>a[n].origin===b&&!0!==a.closed&&!0!==a.destroyed);return c&&this[j](c),this}getUpstream(a){let b=o.parseOrigin(a).origin;return this[g].find(a=>a[n].origin===b&&!0!==a.closed&&!0!==a.destroyed)}get upstreams(){return this[g].filter(a=>!0!==a.closed&&!0!==a.destroyed).map(a=>a[n].origin)}[k](){if(0===this[g].length)throw new d;let a=0,b=-1;for(;a++<this[g].length;){this[t]=(this[t]+1)%this[g].length;let a=this[g][this[t]];if((0===this[t]&&(this[s]=this[s]-this[r],this[s]<=0&&(this[s]=this[v])),!a[h]&&!0!==a.closed&&!0!==a.destroyed)&&((-1===b||a[u]>this[g][b][u])&&(b=this[t]),a[u]>=this[s]))return a}if(-1!==b)return this[s]=this[g][b][u],this[t]=b,this[g][b]}}a.exports=y},61448:a=>{"use strict";let b=Symbol.for("undici.error.UND_ERR");class c extends Error{constructor(a,b){super(a,b),this.name="UndiciError",this.code="UND_ERR"}static[Symbol.hasInstance](a){return a&&!0===a[b]}get[b](){return!0}}let d=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT");class e extends c{constructor(a){super(a),this.name="ConnectTimeoutError",this.message=a||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](a){return a&&!0===a[d]}get[d](){return!0}}let f=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT");class g extends c{constructor(a){super(a),this.name="HeadersTimeoutError",this.message=a||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](a){return a&&!0===a[f]}get[f](){return!0}}let h=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW");class i extends c{constructor(a){super(a),this.name="HeadersOverflowError",this.message=a||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](a){return a&&!0===a[h]}get[h](){return!0}}let j=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT");class k extends c{constructor(a){super(a),this.name="BodyTimeoutError",this.message=a||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}static[Symbol.hasInstance](a){return a&&!0===a[j]}get[j](){return!0}}let l=Symbol.for("undici.error.UND_ERR_INVALID_ARG");class m extends c{constructor(a){super(a),this.name="InvalidArgumentError",this.message=a||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}static[Symbol.hasInstance](a){return a&&!0===a[l]}get[l](){return!0}}let n=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE");class o extends c{constructor(a){super(a),this.name="InvalidReturnValueError",this.message=a||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}static[Symbol.hasInstance](a){return a&&!0===a[n]}get[n](){return!0}}let p=Symbol.for("undici.error.UND_ERR_ABORT");class q extends c{constructor(a){super(a),this.name="AbortError",this.message=a||"The operation was aborted",this.code="UND_ERR_ABORT"}static[Symbol.hasInstance](a){return a&&!0===a[p]}get[p](){return!0}}let r=Symbol.for("undici.error.UND_ERR_ABORTED");class s extends q{constructor(a){super(a),this.name="AbortError",this.message=a||"Request aborted",this.code="UND_ERR_ABORTED"}static[Symbol.hasInstance](a){return a&&!0===a[r]}get[r](){return!0}}let t=Symbol.for("undici.error.UND_ERR_INFO");class u extends c{constructor(a,b){super(a,b),this.name="InformationalError",this.message=a||"Request information",this.code="UND_ERR_INFO"}static[Symbol.hasInstance](a){return a&&!0===a[t]}get[t](){return!0}}let v=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH");class w extends c{constructor(a){super(a),this.name="RequestContentLengthMismatchError",this.message=a||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](a){return a&&!0===a[v]}get[v](){return!0}}let x=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH");class y extends c{constructor(a){super(a),this.name="ResponseContentLengthMismatchError",this.message=a||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](a){return a&&!0===a[x]}get[x](){return!0}}let z=Symbol.for("undici.error.UND_ERR_DESTROYED");class A extends c{constructor(a){super(a),this.name="ClientDestroyedError",this.message=a||"The client is destroyed",this.code="UND_ERR_DESTROYED"}static[Symbol.hasInstance](a){return a&&!0===a[z]}get[z](){return!0}}let B=Symbol.for("undici.error.UND_ERR_CLOSED");class C extends c{constructor(a){super(a),this.name="ClientClosedError",this.message=a||"The client is closed",this.code="UND_ERR_CLOSED"}static[Symbol.hasInstance](a){return a&&!0===a[B]}get[B](){return!0}}let D=Symbol.for("undici.error.UND_ERR_SOCKET");class E extends c{constructor(a,b){super(a),this.name="SocketError",this.message=a||"Socket error",this.code="UND_ERR_SOCKET",this.socket=b}static[Symbol.hasInstance](a){return a&&!0===a[D]}get[D](){return!0}}let F=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED");class G extends c{constructor(a){super(a),this.name="NotSupportedError",this.message=a||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}static[Symbol.hasInstance](a){return a&&!0===a[F]}get[F](){return!0}}let H=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM");class I extends c{constructor(a){super(a),this.name="MissingUpstreamError",this.message=a||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}static[Symbol.hasInstance](a){return a&&!0===a[H]}get[H](){return!0}}let J=Symbol.for("undici.error.ERR_WEBASSEMBLY_NOT_SUPPORTED");class K extends Error{constructor(a){super(a||"WebAssembly is not supported in this environment, but is required for HTTP/1 parsing"),this.code="ERR_WEBASSEMBLY_NOT_SUPPORTED"}static[Symbol.hasInstance](a){return a&&!0===a[J]}get[J](){return!0}}let L=Symbol.for("undici.error.UND_ERR_HTTP_PARSER");class M extends Error{constructor(a,b,c){super(a),this.name="HTTPParserError",this.code=b?`HPE_${b}`:void 0,this.data=c?c.toString():void 0}static[Symbol.hasInstance](a){return a&&!0===a[L]}get[L](){return!0}}let N=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE");class O extends c{constructor(a){super(a),this.name="ResponseExceededMaxSizeError",this.message=a||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}static[Symbol.hasInstance](a){return a&&!0===a[N]}get[N](){return!0}}let P=Symbol.for("undici.error.UND_ERR_REQ_RETRY");class Q extends c{constructor(a,b,{headers:c,data:d}){super(a),this.name="RequestRetryError",this.message=a||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=b,this.data=d,this.headers=c}static[Symbol.hasInstance](a){return a&&!0===a[P]}get[P](){return!0}}let R=Symbol.for("undici.error.UND_ERR_RESPONSE");class S extends c{constructor(a,b,{headers:c,body:d,bodyTruncated:e=!1}){super(a),this.name="ResponseError",this.message=a||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=b,this.body=d,this.bodyTruncated=e,this.headers=c}static[Symbol.hasInstance](a){return a&&!0===a[R]}get[R](){return!0}}let T=Symbol.for("undici.error.UND_ERR_PRX_TLS");class U extends c{constructor(a,b,c={}){super(b,{cause:a,...c}),this.name="SecureProxyConnectionError",this.message=b||"Secure Proxy Connection failed",this.code="UND_ERR_PRX_TLS",this.cause=a}static[Symbol.hasInstance](a){return a&&!0===a[T]}get[T](){return!0}}let V=Symbol.for("undici.error.UND_ERR_PRX_CONN");class W extends c{constructor(a,b,c={}){super(b,{cause:a,...c}),this.name="ProxyConnectionError",this.message=b||"Proxy Connection failed",this.code="UND_ERR_PRX_CONN",this.cause=a}static[Symbol.hasInstance](a){return a&&!0===a[V]}get[V](){return!0}}let X=Symbol.for("undici.error.UND_ERR_REDIRECT_MAX");class Y extends c{constructor(a){super(a),this.name="MaxRedirectsError",this.message=a||"max redirects",this.code="UND_ERR_REDIRECT_MAX"}static[Symbol.hasInstance](a){return a&&!0===a[X]}get[X](){return!0}}let Z=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED");class $ extends c{constructor(a){super(a),this.name="MaxOriginsReachedError",this.message=a||"Maximum allowed origins reached",this.code="UND_ERR_MAX_ORIGINS_REACHED"}static[Symbol.hasInstance](a){return a&&!0===a[Z]}get[Z](){return!0}}class _ extends c{constructor(a,b){super(a),this.name="Socks5ProxyError",this.message=a||"SOCKS5 proxy error",this.code=b||"UND_ERR_SOCKS5"}}let aa=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED");class ab extends c{constructor(a){super(a),this.name="MessageSizeExceededError",this.message=a||"Max decompressed message size exceeded",this.code="UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"}static[Symbol.hasInstance](a){return a&&!0===a[aa]}get[aa](){return!0}}a.exports={AbortError:q,WebAssemblyNotSupportedError:K,HTTPParserError:M,UndiciError:c,HeadersTimeoutError:g,HeadersOverflowError:i,BodyTimeoutError:k,RequestContentLengthMismatchError:w,ConnectTimeoutError:e,InvalidArgumentError:m,InvalidReturnValueError:o,RequestAbortedError:s,ClientDestroyedError:A,ClientClosedError:C,InformationalError:u,SocketError:E,NotSupportedError:G,ResponseContentLengthMismatchError:y,BalancedPoolMissingUpstreamError:I,ResponseExceededMaxSizeError:O,RequestRetryError:Q,ResponseError:S,SecureProxyConnectionError:U,ProxyConnectionError:W,MaxOriginsReachedError:$,MaxRedirectsError:Y,Socks5ProxyError:_,MessageSizeExceededError:ab}},61691:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"tokenrouter",alias:"tokenrouter",aliases:["tr"],category:"apikey",authModes:["apikey"],passthroughModels:!0,display:{name:"TokenRouter",icon:"router",color:"#6366F1",textIcon:"TR",website:"https://tokenrouter.com",notice:{apiKeyUrl:"https://tokenrouter.com/dashboard/keys"}},transport:{baseUrl:"https://api.tokenrouter.com/v1/chat/completions",validateUrl:"https://api.tokenrouter.com/v1/models",format:"openai"},modelsFetcher:{url:"https://api.tokenrouter.com/v1/models",type:"openai"},models:[{id:"anthropic/claude-opus-4.7",name:"Claude Opus 4.7"},{id:"anthropic/claude-sonnet-4.6",name:"Claude Sonnet 4.6"},{id:"anthropic/claude-haiku-4.5",name:"Claude Haiku 4.5"},{id:"openai/gpt-5.4",name:"GPT-5.4"},{id:"google/gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview"},{id:"deepseek/deepseek-v4",name:"DeepSeek V4"},{id:"moonshotai/kimi-k2.5",name:"Kimi K2.5"},{id:"z-ai/glm-5.1",name:"GLM 5.1"}],serviceKinds:["llm","embedding","image"]}},62026:a=>{"use strict";a.exports={uid:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",sentCloseFrameState:{SENT:1,RECEIVED:2},staticPropertyDescriptors:{enumerable:!0,writable:!1,configurable:!1},states:{CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},opcodes:{CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},maxUnsigned16Bit:65535,parserStates:{INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},emptyBuffer:Buffer.allocUnsafe(0),sendHints:{text:1,typedArray:2,arrayBuffer:3,blob:4}}},62239:(a,b,c)=>{"use strict";c.d(b,{KQ:()=>o,AL:()=>n,HG:()=>m,Or:()=>p,Jh:()=>r,lo:()=>q});var d=c(76760),e=c.n(d),f=c(73024),g=c.n(f),h=c(53859),i=c(48161),j=c.n(i);let k=String.fromCharCode(57,114,111,117,116,101,114),l=".migrated-from-legacy",m=e().join(h.n,"db"),n=e().join(m,"data.sqlite"),o=e().join(m,"backups"),p={main:e().join(h.n,"db.json"),usage:e().join(h.n,"usage.json"),disabled:e().join(h.n,"disabledModels.json"),details:e().join(h.n,"request-details.json")};function q(a){if("win32"!==process.platform)try{g().chmodSync(a,384)}catch{}}function r(){for(let a of(!function(a){if(!a||process.env.DATA_DIR)return;let b=e().join(a,l);if(g().existsSync(b))return;let c="win32"===process.platform?e().join(process.env.APPDATA||e().join(j().homedir(),"AppData","Roaming"),k):e().join(j().homedir(),`.${k}`);if(g().existsSync(c))try{if(g().existsSync(a)){if(g().readdirSync(a).filter(a=>a!==l).length>0)return void g().writeFileSync(b,new Date().toISOString())}else g().mkdirSync(a,{recursive:!0});g().cpSync(c,a,{recursive:!0,force:!1,errorOnExist:!1}),g().writeFileSync(b,new Date().toISOString()),console.log(`[dataDir] Migrated legacy data from ${c} → ${a}`)}catch(a){console.warn(`[dataDir] Legacy migration skipped: ${a?.message||a}`)}}(h.n),g().existsSync(h.n)||g().mkdirSync(h.n,{recursive:!0}),[m,o]))if(g().existsSync(a)||g().mkdirSync(a,{recursive:!0,mode:448}),"win32"!==process.platform)try{g().chmodSync(a,448)}catch{}}},62571:(a,b,c)=>{"use strict";let d=c(53053),e=c(57975),f=e.debuglog("undici"),g=e.debuglog("fetch"),h=e.debuglog("websocket"),i={beforeConnect:d.channel("undici:client:beforeConnect"),connected:d.channel("undici:client:connected"),connectError:d.channel("undici:client:connectError"),sendHeaders:d.channel("undici:client:sendHeaders"),create:d.channel("undici:request:create"),bodySent:d.channel("undici:request:bodySent"),bodyChunkSent:d.channel("undici:request:bodyChunkSent"),bodyChunkReceived:d.channel("undici:request:bodyChunkReceived"),headers:d.channel("undici:request:headers"),trailers:d.channel("undici:request:trailers"),error:d.channel("undici:request:error"),open:d.channel("undici:websocket:open"),close:d.channel("undici:websocket:close"),socketError:d.channel("undici:websocket:socket_error"),ping:d.channel("undici:websocket:ping"),pong:d.channel("undici:websocket:pong"),proxyConnected:d.channel("undici:proxy:connected")},j=!1;function k(a=f){if(!j){if(i.beforeConnect.hasSubscribers||i.connected.hasSubscribers||i.connectError.hasSubscribers||i.sendHeaders.hasSubscribers){j=!0;return}j=!0,d.subscribe("undici:client:beforeConnect",b=>{let{connectParams:{version:c,protocol:d,port:e,host:f}}=b;a("connecting to %s%s using %s%s",f,e?`:${e}`:"",d,c)}),d.subscribe("undici:client:connected",b=>{let{connectParams:{version:c,protocol:d,port:e,host:f}}=b;a("connected to %s%s using %s%s",f,e?`:${e}`:"",d,c)}),d.subscribe("undici:client:connectError",b=>{let{connectParams:{version:c,protocol:d,port:e,host:f},error:g}=b;a("connection to %s%s using %s%s errored - %s",f,e?`:${e}`:"",d,c,g.message)}),d.subscribe("undici:client:sendHeaders",b=>{let{request:{method:c,path:d,origin:e}}=b;a("sending request to %s %s%s",c,e,d)})}}let l=!1,m=!1;(f.enabled||g.enabled)&&(k(g.enabled?g:f),function(a=f){if(!l){if(i.headers.hasSubscribers||i.trailers.hasSubscribers||i.error.hasSubscribers){l=!0;return}l=!0,d.subscribe("undici:request:headers",b=>{let{request:{method:c,path:d,origin:e},response:{statusCode:f}}=b;a("received response to %s %s%s - HTTP %d",c,e,d,f)}),d.subscribe("undici:request:trailers",b=>{let{request:{method:c,path:d,origin:e}}=b;a("trailers received from %s %s%s",c,e,d)}),d.subscribe("undici:request:error",b=>{let{request:{method:c,path:d,origin:e},error:f}=b;a("request to %s %s%s errored - %s",c,e,d,f.message)})}}(g.enabled?g:f)),h.enabled&&(k(f.enabled?f:h),function(a=h){if(!m){if(i.open.hasSubscribers||i.close.hasSubscribers||i.socketError.hasSubscribers||i.ping.hasSubscribers||i.pong.hasSubscribers){m=!0;return}m=!0,d.subscribe("undici:websocket:open",b=>{if(null!=b.address){let{address:c,port:d}=b.address;a("connection opened %s%s",c,d?`:${d}`:"")}else a("connection opened")}),d.subscribe("undici:websocket:close",b=>{let{websocket:c,code:d,reason:e}=b;a("closed connection to %s - %s %s",c.url,d,e)}),d.subscribe("undici:websocket:socket_error",b=>{a("connection errored - %s",b.message)}),d.subscribe("undici:websocket:ping",b=>{a("ping received")}),d.subscribe("undici:websocket:pong",b=>{a("pong received")})}}(h)),a.exports={channels:i}},63993:(a,b,c)=>{"use strict";c.d(b,{B:()=>f});var d=c(97753);function e(a){return null==a?"":String(a).trim()}async function f(a={}){try{let b=e(a?.proxyPoolId),c="__none__"===b?"":b,f=function(a={}){let b=a?.connectionProxyEnabled===!0;return{connectionProxyEnabled:b,connectionProxyUrl:e(a?.connectionProxyUrl),connectionNoProxy:e(a?.connectionNoProxy)}}(a),g=!1;if(c){let a=await (0,d.hr)(c),b=e(a?.proxyUrl),f=e(a?.noProxy),h=a&&!0===a.isActive&&b;if(g=a?.strictProxy===!0,h){if("vercel"===a.type||"cloudflare"===a.type||"deno"===a.type)return{source:a.type,proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:f,strictProxy:!0===a.strictProxy,vercelRelayUrl:b};return{source:"pool",proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!0,connectionProxyUrl:b,connectionNoProxy:f,strictProxy:!0===a.strictProxy}}}if(f.connectionProxyEnabled&&f.connectionProxyUrl)return{source:"legacy",proxyPoolId:c||null,proxyPool:null,strictProxy:g,...f};return{source:"none",proxyPoolId:c||null,proxyPool:null,strictProxy:g,...f}}catch(a){return console.error("[resolveConnectionProxyConfig] Failed to resolve proxy config:",a),{source:"error",proxyPoolId:null,proxyPool:null,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:"",strictProxy:!1}}}},64156:(a,b,c)=>{"use strict";let d,{URL:e}=c(73136),f=c(5318),{ConnectTimeoutError:g,InvalidArgumentError:h}=c(61448),{Socks5Client:i,STATES:j}=c(40603),{kBusy:k,kConnected:l,kDispatch:m,kClose:n,kDestroy:o}=c(49176),p=c(35689),q=c(55285),{setupConnectTimeout:r}=c(84285),{debuglog:s}=c(57975),t=s("undici:socks5-proxy"),u=Symbol("proxy url"),v=Symbol("proxy headers"),w=Symbol("proxy auth"),x=Symbol("proxy protocol"),y=Symbol("pools"),z=Symbol("connector"),A=Symbol("connect timeout"),B=Symbol("request tls settings"),C=Symbol("request tls timeout");function D(a,b,c){return new g(`Connect Timeout Error (attempted address: ${a}:${b}, timeout: ${c}ms)`)}let E=!1;class F extends f{constructor(a,b={}){if(super(b),E||(process.emitWarning("SOCKS5 proxy support is experimental and subject to change","ExperimentalWarning"),E=!0),!a)throw new h("Proxy URL is mandatory");let c="string"==typeof a?new e(a):a;if("socks5:"!==c.protocol&&"socks:"!==c.protocol)throw new h("Proxy URL must use socks5:// or socks:// protocol");this[u]=c,this[v]=b.headers||{},this[x]=b.proxyTls?"https:":"http:";let d=b.connectTimeout??5e3;if(!Number.isFinite(d)||d<0)throw new h("invalid connectTimeout");this[A]=d;let{timeout:f,...g}=b.requestTls||{},i=f??d;if(!Number.isFinite(i)||i<0)throw new h("invalid requestTls.timeout");this[B]=g,this[C]=i,this[w]={username:b.username||(c.username?decodeURIComponent(c.username):null),password:b.password||(c.password?decodeURIComponent(c.password):null)};let j=b.proxyTls?.timeout??d;if(!Number.isFinite(j)||j<0)throw new h("invalid proxyTls.timeout");this[z]=b.connect||q({...b.proxyTls,timeout:j,servername:b.proxyTls?.servername||c.hostname}),this[y]=new Map}async createSocks5Connection(a,b){let c=this[u].hostname,d=parseInt(this[u].port)||1080;t("creating SOCKS5 connection to",c,d);let e=Promise.withResolvers();this[z]({hostname:c,host:c,port:d,protocol:this[x]},(a,b)=>{a?e.reject(a):e.resolve(b)});let f=await e.promise,g=new i(f,this[w]);g.on("error",a=>{t("SOCKS5 error:",a),f.destroy()}),await g.handshake();let h=Promise.withResolvers(),k=0===this[A]?null:setTimeout(()=>{l(),g.destroy(),h.reject(D(c,d,this[A]))},this[A]),l=()=>{clearTimeout(k),g.removeListener("authenticated",m),g.removeListener("error",n)},m=()=>{l(),h.resolve()},n=a=>{l(),h.reject(a)};g.state===j.AUTHENTICATED?(clearTimeout(k),h.resolve()):(g.once("authenticated",m),g.once("error",n)),await h.promise,await g.connect(a,b);let o=Promise.withResolvers(),p=0===this[A]?null:setTimeout(()=>{q(),g.destroy(),o.reject(D(a,b,this[A]))},this[A]),q=()=>{clearTimeout(p),g.removeListener("connected",r),g.removeListener("error",s)},r=c=>{t("SOCKS5 tunnel established to",a,b,"via",c),q(),o.resolve()},s=a=>{q(),o.reject(a)};return g.once("connected",r),g.once("error",s),await o.promise,f}[m](a,b){let{origin:f}=a;t("dispatching request to",f,"via SOCKS5");try{let g=String(f),h=this[y].get(g);if(!h||h.destroyed||h.closed){h=new p(f,{pipelining:a.pipelining,connections:a.connections,connect:async(a,b)=>{try{let a=new e(f),g=a.hostname,h=parseInt(a.port)||("https:"===a.protocol?443:80);t("establishing SOCKS5 connection to",g,h);let i=await this.createSocks5Connection(g,h),j=i;if("https:"===a.protocol){d||(d=c(41692)),t("upgrading to TLS"),j=d.connect({...this[B],socket:i,servername:this[B]?.servername||g});let a=Promise.withResolvers(),b=()=>{queueMicrotask(k),j.removeListener("secureConnect",e),j.removeListener("error",f)},e=()=>{b(),a.resolve()},f=c=>{b(),a.reject(c)},k=r(new WeakRef(j),{timeout:this[C],hostname:g,port:h});j.once("secureConnect",e),j.once("error",f),await a.promise}b(null,j)}catch(a){t("SOCKS5 connection error:",a),b(a)}}}),this[y].set(g,h);let b=()=>{this[y].get(g)!==h||h[l]>0||h[k]||(this[y].delete(g),h.destroyed||h.close())};h.on("disconnect",b),h.on("connectionError",b)}return h[m](a,b)}catch(a){if(t("dispatch error:",a),"function"==typeof b.onResponseError)return b.onResponseError(null,a),!1;if("function"==typeof b.onError)return b.onError(a),!1;throw a}}async [n](){let a=[];for(let b of this[y].values())a.push(b.close());this[y].clear(),await Promise.all(a)}async [o](a){let b=[];for(let c of this[y].values())b.push(c.destroy(a));this[y].clear(),await Promise.all(b)}}a.exports=F},64271:(a,b,c)=>{"use strict";c.d(b,{Bu:()=>d,se:()=>e});let d=Object.freeze({minimal:4,low:1,medium:2,high:3});Object.freeze({4:"minimal",1:"low",2:"medium",3:"high"});let e=Object.freeze([4,1,2,3])},64304:(a,b,c)=>{"use strict";c.d(b,{Ay:()=>z});var d=c(69384),e=c(30395),f=c(51091);let g=e.xq["perplexity-web"].baseUrl,h="2.18",i={"pplx-auto":["concise","pplx_pro"],"pplx-sonar":["copilot","experimental"],"pplx-gpt":["copilot","gpt54"],"pplx-gemini":["copilot","gemini31pro_high"],"pplx-sonnet":["copilot","claude46sonnet"],"pplx-opus":["copilot","claude46opus"],"pplx-nemotron":["copilot","nv_nemotron_3_super"]},j={"pplx-gpt":"gpt54_thinking","pplx-sonnet":"claude46sonnetthinking","pplx-opus":"claude46opusthinking"},k=/\[\d+\]/g,l=/<grok:[^>]*>.*?<\/grok:[^>]*>/gs,m=/<grok:[^>]*\/>/g,n=/<[?]xml[^?]*[?]>/g,o=/<\/?response\b[^>]*>/gi,p=/ {2,}/g,q=/\n{3,}/g,r=new Map;function s(a){let b=a.map(a=>`${a.role}:${a.content}`).join("\n"),c=0x811c9dc5;for(let a=0;a<b.length;a++)c^=b.charCodeAt(a),c=0x1000193*c>>>0;return c.toString(16).padStart(8,"0")}function t(a,b,c,d){if(!d)return;let e=s([...a,{role:"user",content:b},{role:"assistant",content:c}]);if(r.set(e,{backendUuid:d,ts:Date.now()}),r.size>200){let a=null,b=1/0;for(let[c,d]of r)d.ts<b&&(b=d.ts,a=c);a&&r.delete(a)}}function u(a,b=!0){let c=a;return c=(c=(c=(c=(c=c.replace(n,"")).replace(k,"")).replace(l,"")).replace(m,"")).replace(o,""),b&&(c=(c=(c=c.replace(p," ")).replace(q,"\n\n")).trim()),c}async function*v(a,b){let c=a.getReader(),d=new TextDecoder,e="",f=[];function g(){if(0===f.length)return null;let a=f.join("\n");f=[];let b=a.trim();if(!b||"[DONE]"===b)return"done";try{return JSON.parse(b)}catch{return null}}try{for(;;){if(b?.aborted)return;let{value:a,done:h}=await c.read();if(h)break;for(e+=d.decode(a,{stream:!0});;){let a=e.indexOf("\n");if(a<0)break;let b=e.slice(0,a);e=e.slice(a+1);let c=b.endsWith("\r")?b.slice(0,-1):b;if(""===c){let a=g();if("done"===a)return;a&&(yield a);continue}if(c.startsWith("data:")&&f.push(c.slice(5).trimStart()),"event: end_of_stream"===c)return}}(e+=d.decode()).trim().startsWith("data:")&&f.push(e.trim().slice(5).trimStart());let a=g();a&&"done"!==a&&(yield a)}finally{c.releaseLock()}}async function*w(a,b){let c="",d=null,e=0,f=new Set;for await(let g of v(a,b)){if(g.error_code||g.error_message)return void(yield{error:g.error_message||`Perplexity error: ${g.error_code}`,done:!0});g.backend_uuid&&(d=g.backend_uuid);let a=g.blocks??[];for(let b of a){let a=b.intended_usage??"";if("pro_search_steps"===a&&b.plan_block?.steps){for(let a of b.plan_block.steps)if("SEARCH_WEB"===a.step_type)for(let b of a.search_web_content?.queries??[]){let a=b.query??"";a&&!f.has(a)&&(f.add(a),yield{thinking:`Searching: ${a}`,backendUuid:d??void 0})}else if("READ_RESULTS"===a.step_type)for(let b of(a.read_results_content?.urls??[]).slice(0,3))b&&!f.has(b)&&(f.add(b),yield{thinking:`Reading: ${b}`,backendUuid:d??void 0})}if("plan"===a&&b.plan_block?.goals)for(let a of b.plan_block.goals){let b=a.description??"";b&&!f.has(b)&&(f.add(b),yield{thinking:b,backendUuid:d??void 0})}if(!a.includes("markdown"))continue;let g=b.markdown_block;if(!g)continue;let h=g.chunks??[];if(0!==h.length)if("DONE"===g.progress)c=h.join("");else{let a=c+h.join("");if(a.length>e){let b=a.slice(e);c=a,e=a.length,yield{delta:b,answer:c,backendUuid:d??void 0}}}}if(0===a.length&&g.text){let a=g.text.trim();if(a.length>e){let b=a.slice(e);c=a,e=a.length,yield{delta:b,answer:c,backendUuid:d??void 0}}}if(g.final||"COMPLETED"===g.status)break}yield{delta:"",answer:c,backendUuid:d??void 0,done:!0}}function x(a){return`data: ${JSON.stringify(a)}
475
475
 
476
476
  `}async function y(a,b,c,d,e,f,g){let h="",i=null,j=[];for await(let b of w(a,g)){if(b.backendUuid&&(i=b.backendUuid),b.error)return new Response(JSON.stringify({error:{message:b.error,type:"upstream_error",code:"PPLX_ERROR"}}),{status:502,headers:{"Content-Type":"application/json"}});if(b.thinking){j.push(b.thinking);continue}if(b.done){h=b.answer||h;break}b.answer&&(h=b.answer)}t(e,f,h=u(h),i);let k=j.length>0?j.join("\n"):void 0,l={role:"assistant",content:h};k&&(l.reasoning_content=k);let m=Math.ceil(f.length/4),n=Math.ceil(h.length/4);return new Response(JSON.stringify({id:c,object:"chat.completion",created:d,model:b,system_fingerprint:null,choices:[{index:0,message:l,finish_reason:"stop",logprobs:null}],usage:{prompt_tokens:m,completion_tokens:n,total_tokens:m+n}}),{status:200,headers:{"Content-Type":"application/json"}})}class z extends d.Hv{constructor(){super("perplexity-web",e.xq["perplexity-web"])}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:k,providerOverrides:l=null}){var m,n,o,p,q;let v,z,A,B,C,D=b?.messages;if(!D||!Array.isArray(D)||0===D.length)return{response:new Response(JSON.stringify({error:{message:"Missing or empty messages array",type:"invalid_request"}}),{status:400,headers:{"Content-Type":"application/json"}}),url:g,headers:{},transformedBody:b};(b?.thinking===!0||b?.reasoning_effort!=null&&"none"!==b.reasoning_effort)&&j[a]?(v="copilot",z=j[a],k?.info?.("PPLX-WEB",`Thinking mode → ${a} using ${z}`)):i[a]?[v,z]=i[a]:(v="copilot",z=a,k?.info?.("PPLX-WEB",`Unmapped model ${a}, using as raw preference`));let E=function(a){let b="",c=[];for(let d of a){let a=String(d.role||"user");"developer"===a&&(a="system");let e="";"string"==typeof d.content?e=d.content:Array.isArray(d.content)&&(e=d.content.filter(a=>"text"===a.type).map(a=>String(a.text||"")).join(" ")),e.trim()&&("system"===a?b+=e+"\n":("user"===a||"assistant"===a)&&c.push({role:a,content:e}))}let d="";return c.length>0&&"user"===c[c.length-1].role&&(d=c.pop().content),{systemMsg:b,history:c,currentMsg:d}}(D),F=function(a){if(0===a.length)return null;let b=s(a),c=r.get(b);return c?Date.now()-c.ts>36e5?(r.delete(b),null):c.backendUuid:null}(E.history);F&&k?.info?.("PPLX-WEB",`Session continue: ${F.slice(0,12)}...`);let G=function(a,b,c){if(b)return a.currentMsg;let d={},e=[];a.systemMsg.trim()&&e.push(a.systemMsg.trim());let f=function(a){if(!Array.isArray(a)||0===a.length)return"";let b=a.map(a=>{let b=a?.function||a||{},c=b.name||"unnamed",d=(b.description||"").split("\n")[0].slice(0,200);return`- ${c}: ${d}`});return`Available tools (reference only, cannot invoke):
477
- ${b.join("\n")}`}(c);f&&e.push(f),e.push("You have built-in web search. Answer questions directly using search results."),d.instructions=e,a.history.length>0&&(d.history=a.history),a.currentMsg?d.query=a.currentMsg:0===a.history.length&&(d.query="");let g=JSON.stringify(d);return g.length>96e3?g.slice(-96e3):g}(E,F,b?.tools);if(!G.trim())return{response:new Response(JSON.stringify({error:{message:"Empty query after processing",type:"invalid_request"}}),{status:400,headers:{"Content-Type":"application/json"}}),url:g,headers:{},transformedBody:b};let H=(m=v,n=z,C="u">typeof Intl?Intl.DateTimeFormat().resolvedOptions().timeZone:"UTC",{query_str:G,params:{query_str:G,search_focus:"internet",mode:m,model_preference:n,sources:["web"],attachments:[],frontend_uuid:crypto.randomUUID(),frontend_context_uuid:crypto.randomUUID(),version:h,language:"en-US",timezone:C,search_recency_filter:null,is_incognito:!0,use_schematized_api:!0,last_backend_uuid:F}}),I={"Content-Type":"application/json",Accept:"text/event-stream",Origin:"https://www.perplexity.ai",Referer:"https://www.perplexity.ai/","User-Agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36","X-App-ApiClient":"default","X-App-ApiVersion":h};d.accessToken?I.Authorization=`Bearer ${d.accessToken}`:d.apiKey&&(I.Cookie=`__Secure-next-auth.session-token=${d.apiKey}`),(0,f.MB)(I,l),k?.info?.("PPLX-WEB",`Query to ${a} (pref=${z}, mode=${v}), len=${G.length}`);let J={method:"POST",headers:I,body:JSON.stringify(H)};e&&(J.signal=e);try{A=await fetch(g,J)}catch(a){return k?.error?.("PPLX-WEB",`Fetch failed: ${a.message||String(a)}`),{response:new Response(JSON.stringify({error:{message:`Perplexity connection failed: ${a.message||String(a)}`,type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:g,headers:I,transformedBody:H}}if(!A.ok){let a=A.status,b=`Perplexity returned HTTP ${a}`;return 401===a||403===a?b="Perplexity auth failed — session cookie may be expired. Re-paste your __Secure-next-auth.session-token.":429===a&&(b="Perplexity rate limited. Wait a moment and retry."),k?.warn?.("PPLX-WEB",b),{response:new Response(JSON.stringify({error:{message:b,type:"upstream_error",code:`HTTP_${a}`}}),{status:a,headers:{"Content-Type":"application/json"}}),url:g,headers:I,transformedBody:H}}if(!A.body)return{response:new Response(JSON.stringify({error:{message:"Perplexity returned empty response body",type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:g,headers:I,transformedBody:H};let K=`chatcmpl-pplx-${crypto.randomUUID().slice(0,12)}`,L=Math.floor(Date.now()/1e3);if(c){let b;B=new Response((o=A.body,p=E.history,q=E.currentMsg,b=new TextEncoder,new ReadableStream({async start(c){try{c.enqueue(b.encode(x({id:K,object:"chat.completion.chunk",created:L,model:a,system_fingerprint:null,choices:[{index:0,delta:{role:"assistant"},finish_reason:null,logprobs:null}]})));let d="",f=null;for await(let g of w(o,e)){if(g.backendUuid&&(f=g.backendUuid),g.error){c.enqueue(b.encode(x({id:K,object:"chat.completion.chunk",created:L,model:a,system_fingerprint:null,choices:[{index:0,delta:{content:`[Error: ${g.error}]`},finish_reason:null,logprobs:null}]})));break}if(g.thinking){c.enqueue(b.encode(x({id:K,object:"chat.completion.chunk",created:L,model:a,system_fingerprint:null,choices:[{index:0,delta:{reasoning_content:g.thinking+"\n"},finish_reason:null,logprobs:null}]})));continue}if(g.done){d=g.answer||d;break}let e=g.delta||"";e&&(e=u(e,!1))&&c.enqueue(b.encode(x({id:K,object:"chat.completion.chunk",created:L,model:a,system_fingerprint:null,choices:[{index:0,delta:{content:e},finish_reason:null,logprobs:null}]}))),g.answer&&(d=g.answer)}c.enqueue(b.encode(x({id:K,object:"chat.completion.chunk",created:L,model:a,system_fingerprint:null,choices:[{index:0,delta:{},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode("data: [DONE]\n\n")),t(p,q,u(d),f)}catch(d){c.enqueue(b.encode(x({id:K,object:"chat.completion.chunk",created:L,model:a,system_fingerprint:null,choices:[{index:0,delta:{content:`[Stream error: ${d.message||String(d)}]`},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode("data: [DONE]\n\n"))}finally{c.close()}}})),{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache","X-Accel-Buffering":"no"}})}else B=await y(A.body,a,K,L,E.history,E.currentMsg,e);return{response:B,url:g,headers:I,transformedBody:H}}}},64323:(a,b,c)=>{"use strict";c(42541),c(92843),new TextEncoder},64334:(a,b,c)=>{"use strict";c.d(b,{nl:()=>w,dn:()=>z});let d="[-_/:.]",e=RegExp(`(^|${d})(image|img)(${d}|$)|stable-image|gen[0-9]_image|nanobanana|imagine|t2v|i2v|flux|dall|sdxl|diffusion|embed|rerank|guard|moderation|tts|stt|whisper|voice|speech|audio`,"i"),f=RegExp(`(^|${d})(vision|vl|vlm|multimodal|omni|visual)(${d}|$)|[0-9]\\.[0-9]+v(${d}|$)|(^|${d})glm-[0-9]+v(${d}|$)|(^|[-_/:.])(llava|pixtral|internvl|cogvlm|minicpm-v|moondream|idefics|fuyu)`,"i");var g=c(2206),h=c(92693),i=c(92367);function j(a,b){if("string"!=typeof a||"string"!=typeof b)return!1;let c=a.split("*").map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join(".*");return RegExp(`^${c}$`,"i").test(b)}let k={vision:!1,pdf:!1,audioInput:!1,videoInput:!1,imageOutput:!1,audioOutput:!1,search:!1,tools:!0,reasoning:!1,thinkingFormat:null,thinkingCanDisable:!0,thinkingRange:null,contextWindow:2e5,maxOutput:64e3},l={"claude-opus-5.5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingCanDisable:!1,forcedToolChoice:!1},"claude-opus-5.5-thinking":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingCanDisable:!1,forcedToolChoice:!1},"claude-opus-5.5-agentic":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingCanDisable:!1,forcedToolChoice:!1},"claude-opus-5.5-thinking-agentic":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingCanDisable:!1,forcedToolChoice:!1},"claude-opus-5-5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingCanDisable:!1,forcedToolChoice:!1},"claude-opus-5-5-high":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingCanDisable:!1,forcedToolChoice:!1},"claude-opus-5-5-medium":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingCanDisable:!1,forcedToolChoice:!1},"claude-opus-5-5-low":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingCanDisable:!1,forcedToolChoice:!1},"claude-sonnet-5.5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingOffType:"between_tools",forcedToolChoice:!1},"claude-sonnet-5-5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingOffType:"between_tools",forcedToolChoice:!1},"claude-sonnet-5-5-high":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingOffType:"between_tools",forcedToolChoice:!1},"claude-sonnet-5-5-medium":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingOffType:"between_tools",forcedToolChoice:!1},"claude-sonnet-5-5-low":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingOffType:"between_tools",forcedToolChoice:!1},"claude-opus-5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-5-thinking":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-5-agentic":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-5-thinking-agentic":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.6":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.7":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-7":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.8":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-6":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-8":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-8-thinking":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-4.6":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-thinking":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-agentic":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-thinking-agentic":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"gpt-image-1":{imageOutput:!0,tools:!1},"glm-4.6v":{vision:!0,reasoning:!0,thinkingFormat:"zai",contextWindow:128e3},"vision-model":{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6},"coder-model":{reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6},"kimi-k3":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:131072},k3:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:131072},"kimi-for-coding":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:262144,maxOutput:65536},"kimi-for-coding-highspeed":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:262144,maxOutput:65536},"kimi-k2.7-code":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:262144,maxOutput:65536},"kimi-k2.7-code-highspeed":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:262144,maxOutput:65536},"deepseek-v4.1-flash":{vision:!0,reasoning:!0,thinkingFormat:"deepseek",contextWindow:1e6,maxOutput:384e3},"deepseek-v4-1-flash":{vision:!0,reasoning:!0,thinkingFormat:"deepseek",contextWindow:1e6,maxOutput:384e3},"deepseek-flash":{vision:!0,reasoning:!0,thinkingFormat:"deepseek",contextWindow:128e3,maxOutput:64e3}},m={vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:372e3,maxOutput:128e3},n={vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:272e3,maxOutput:128e3},o={auto:{contextWindow:2e5,maxOutput:32768},efficient:{contextWindow:2e5,maxOutput:32768},lite:{contextWindow:2e5,maxOutput:32768},ultimate:{vision:!0,reasoning:!0,contextWindow:2e5,maxOutput:65536},performance:{vision:!0,contextWindow:2e5,maxOutput:65536},qmodel_38max:{vision:!0,reasoning:!0,contextWindow:2e5,maxOutput:65536},qmodel_latest:{vision:!0,contextWindow:2e5,maxOutput:65536},qmodel:{vision:!0,contextWindow:2e5,maxOutput:65536},qfmodel:{vision:!0,reasoning:!0,contextWindow:2e5,maxOutput:65536},kmodel_latest:{vision:!0,contextWindow:2e5,maxOutput:65536},kmodel:{vision:!0,contextWindow:2e5,maxOutput:65536},gmodel:{vision:!0,reasoning:!0,contextWindow:2e5,maxOutput:65536},gfmodel:{vision:!0,reasoning:!0,contextWindow:2e5,maxOutput:65536},dmodel:{vision:!0,reasoning:!0,contextWindow:2e5,maxOutput:65536},dfmodel:{vision:!0,reasoning:!0,contextWindow:2e5,maxOutput:65536},mmodel:{vision:!0,contextWindow:2e5,maxOutput:65536},smodel:{vision:!0,reasoning:!0,contextWindow:18e4,maxOutput:65536},cmodel:{vision:!0,reasoning:!0,contextWindow:18e4,maxOutput:65536}},p={reasoning:!0,thinkingFormat:"zai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:131072},q={glm:{"glm-5.3":p,"glm-5.3-flash":{...p,vision:!0,videoInput:!0,pdf:!0}},"glm-cn":{"glm-5.3":p,"glm-5.3-flash":{...p,vision:!0,videoInput:!0,pdf:!0}},qoder:o,qd:o,"qoder-cn":o,qdcn:o,xai:{"grok-4.3":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:64e3},"grok-4.20-0309-reasoning":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:64e3},"grok-4.20-0309-non-reasoning":{vision:!0,reasoning:!1,search:!0,contextWindow:1e6,maxOutput:64e3},"grok-4.20-multi-agent-0309":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:64e3},"grok-build-0.1":{reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:256e3,maxOutput:64e3}},"nvidia-build":{"moonshotai/kimi-k3.1-pro":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:262144,maxOutput:65536},"minimaxai/minimax-m3.1-flash":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:131072,maxOutput:65536},"stepfun-ai/step-5-preview":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:131072,maxOutput:65536},"nvidia/nemotron-3-ultra-550b-a55b":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:131072,maxOutput:65536}},nvidia:{"minimaxai/minimax-m2.7":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:131072},"minimaxai/minimax-m3":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:512e3,maxOutput:131072},"z-ai/glm-5.2":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:128e3},"deepseek-ai/deepseek-v4-pro":{reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:65536},"deepseek-ai/deepseek-v4-flash":{reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:65536}},codex:{"gpt-6-astra":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:272e3,maxOutput:128e3},"gpt-6-sol":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:272e3,maxOutput:128e3},"gpt-6.1-sol":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:272e3,maxOutput:128e3},"gpt-6.1-terra":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:5e5,maxOutput:128e3},"gpt-6-luna":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:272e3,maxOutput:128e3},"gpt-5.6-sol":m,"gpt-5.6-sol-review":m,"gpt-5.6-terra":n,"gpt-5.6-terra-review":n,"gpt-5.6-luna":n,"gpt-5.6-luna-review":n},"codebuddy-cn":{"glm-5.2":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:48e3},"glm-5.1":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:48e3},"glm-5v-turbo":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:38e3},"minimax-m3":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:512e3,maxOutput:48e3},"kimi-k2.7":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:256e3,maxOutput:32e3},"kimi-k2.6":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:256e3,maxOutput:32e3},hy3:{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:192e3,maxOutput:64e3},"hy4-preview":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:192e3,maxOutput:64e3},"glm-5.3":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!0,contextWindow:1e6,maxOutput:131072},"glm-5.3-flash":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!0,contextWindow:1e6,maxOutput:131072},"kimi-k3-1":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:32e3},"deepseek-v4-pro":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:5e4},"deepseek-v4.1-flash":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:5e4}},commandcode:{"claude-haiku-5-5":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"commandcode",thinkingEffortSupported:!0,contextWindow:1e6,maxOutput:128e3}},github:{"claude-haiku-5.5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3}},kiro:{"claude-haiku-5.5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3}},tokenharbor:{"claude-haiku-5.5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3}},"opencode-go":{"glm-5.3-flash":{vision:!0,videoInput:!0,pdf:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:131072},"kimi-k3.1-pro":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:131072},"grok-4.7":{vision:!0,pdf:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:5e5,maxOutput:5e5},"gpt-6-luna":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:105e4,maxOutput:128e3},"mimo-v2.6-flash":{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:131072},"mimo-v2.6-pro":{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:131072},"minimax-m3.1-flash":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:512e3},"step-5-preview":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:65536},hy4:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:65536},"beam-free":{reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:131072},"iceman-contributor-free":{reasoning:!0,thinkingFormat:"openai",contextWindow:262144,maxOutput:131072},"gemini-4-argon":{vision:!0,pdf:!0,reasoning:!0,thinkingFormat:"gemini-level",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:65536},"claude-haiku-5-5":{vision:!0,pdf:!0,reasoning:!0,thinkingFormat:"claude-adaptive",contextWindow:2e5,maxOutput:64e3}},opencode:{"deepseek-v4.1-flash-free":{reasoning:!0,thinkingFormat:"deepseek",thinkingCanDisable:!1,contextWindow:33e4,maxOutput:128e3},"glm-5.3-flash-free":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:128e3},"mimo-v2.6-flash-free":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!0},"pulse-alpha-free":{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:131072},"crouton-alpha-free":{vision:!0,videoInput:!0,pdf:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:27e4},"longcat-2.5-free":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!0,contextWindow:1e6,maxOutput:262144},"iceman-free":{reasoning:!0,thinkingFormat:"openai",contextWindow:262144,maxOutput:131072},"inkling-2-small-free":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!0,contextWindow:1048576,maxOutput:131072},"minimax-m3.1-flash-free":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:131072}},"opencode-zen":{"claude-haiku-5-5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-5-5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"gpt-6-sol":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:105e4,maxOutput:128e3},"gpt-6.1-sol":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:105e4,maxOutput:128e3},"gpt-6-luna":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:105e4,maxOutput:128e3},"grok-4.7":{vision:!0,pdf:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:5e5,maxOutput:5e5},"muse-wonder-1.0":{vision:!0,pdf:!0,videoInput:!0,audioInput:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:131072},"qwen3.8-flash":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:131072},"qwen3.8-max":{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:262144,maxOutput:131072},"deepseek-v4.1-flash":{vision:!0,reasoning:!0,thinkingFormat:"deepseek",contextWindow:1e6,maxOutput:384e3},"mistral-large-4":{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:524288,maxOutput:262144},"beam-free":{reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:131072},"flint-40b-free":{reasoning:!0,thinkingFormat:"openai",contextWindow:262144,maxOutput:65536},"nemotron-3.5-super-vl-free":{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:131072},"deepseek-v4.1-flash-free":{vision:!0,reasoning:!0,thinkingFormat:"deepseek",contextWindow:2e5,maxOutput:32e3},"glm-5.3-flash-free":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:32e3},"pulse-alpha-free":{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:131072},"crouton-alpha-free":{vision:!0,videoInput:!0,pdf:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:27e4}},venice:h.hG,chutes:i.XY,mistral:{"mistral-large-4":{vision:!0,reasoning:!0,contextWindow:1e6},"mistral-large-4-0":{vision:!0,reasoning:!0,contextWindow:1e6},"mistral-small-2603":{vision:!0,reasoning:!0,contextWindow:256e3},"zai-glm-5-3":{reasoning:!0,thinkingFormat:"zai",contextWindow:1e6,maxOutput:128e3},"zai-glm-5-3-flash":{vision:!0,reasoning:!0,thinkingFormat:"zai",contextWindow:1e6,maxOutput:128e3},"deepseek-v4-1-flash-1017":{vision:!0,reasoning:!0,thinkingFormat:"deepseek",contextWindow:1e6,maxOutput:128e3},"ministral-14b-2512":{vision:!0,reasoning:!1,contextWindow:256e3},"ministral-8b-2512":{vision:!0,reasoning:!1,contextWindow:256e3},"ministral-3b-2512":{vision:!0,reasoning:!1,contextWindow:256e3},"codestral-2508":{vision:!1,reasoning:!1,contextWindow:128e3},"codestral-latest":{vision:!1,reasoning:!1,contextWindow:128e3}},together:{"deepseek-ai/DeepSeek-V4-Pro-0813":{contextWindow:1048576},"deepseek-ai/DeepSeek-V4.1-Flash":{contextWindow:1e6},"deepseek-ai/DeepSeek-V4.1-Flash-1017":{contextWindow:1e6},"meta-models/Muse-Glimmer-30B":{contextWindow:131072},"meta-models/Muse-Spark-Open-816B-A42B":{contextWindow:1048576},"MiniMaxAI/MiniMax-M3.1-Flash":{contextWindow:1048576},"moonshotai/Kimi-K3":{vision:!0,contextWindow:1048576},"moonshotai/Kimi-K3.1-Pro":{vision:!0,contextWindow:1048576},"nvidia/NVIDIA-Nemotron-3.5-Super-VL":{vision:!0,contextWindow:262144},"openai/gpt-oss-120b":{reasoning:!0,thinkingFormat:"openai",contextWindow:131072},"Prism-ML/Ternary-Bonsai-27B":{contextWindow:262144},"Qwen/Qwen3.5-9B":{vision:!0,contextWindow:262144},"Qwen/Qwen3.6-Plus":{contextWindow:1e6},"Qwen/Qwen3.7-Plus":{contextWindow:1e6},"Qwen/Qwen3.8-Flash":{contextWindow:1e6},"reflection/Beam-1.0-501B-A23B":{contextWindow:1048576},"together/Tev1-4B-experimental":{contextWindow:32768},"zai-org/GLM-5.2":{contextWindow:1048575},"zai-org/GLM-5.3":{contextWindow:1048575},"zai-org/GLM-5.3-Flash":{contextWindow:1048575}},sambanova:{"MiniMax-M3.1-Flash":{contextWindow:1048576,maxOutput:1048576},"gemma-4-31B-it":{contextWindow:262144,maxOutput:262144},"gpt-oss-120b":{reasoning:!0,thinkingFormat:"openai",contextWindow:131072,maxOutput:131072},"Meta-Llama-3.3-70B-Instruct":{contextWindow:131072,maxOutput:3072}},cohere:{"command-a-plus-05-2026":{vision:!0,reasoning:!0,contextWindow:128e3,maxOutput:64e3},"command-a-03-2025":{contextWindow:256e3,maxOutput:8e3},"command-a-reasoning-08-2025":{reasoning:!0,contextWindow:256e3,maxOutput:32e3},"command-a-vision-07-2025":{vision:!0,contextWindow:128e3,maxOutput:8e3},"command-a-translate-08-2025":{contextWindow:8e3,maxOutput:8e3},"command-r7b-12-2024":{contextWindow:128e3,maxOutput:4e3},"command-r-plus-08-2024":{contextWindow:128e3,maxOutput:4e3},"command-r-08-2024":{contextWindow:128e3,maxOutput:4e3},"north-mini-code-1.0":{contextWindow:256e3,maxOutput:64e3},"north-small-translate-1.0":{contextWindow:16e3,maxOutput:16e3},"c4ai-aya-expanse-32b":{contextWindow:128e3,maxOutput:4e3},"c4ai-aya-vision-32b":{vision:!0,contextWindow:16e3,maxOutput:4e3},"tiny-aya-global":{contextWindow:8e3,maxOutput:8e3},"tiny-aya-earth":{contextWindow:8e3,maxOutput:8e3},"tiny-aya-fire":{contextWindow:8e3,maxOutput:8e3},"tiny-aya-water":{contextWindow:8e3,maxOutput:8e3}},cerebras:{"qwen-3.8-27b":{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:131072,maxOutput:40960}},"perplexity-agent":{"perplexity/nemotron-3.5-super-120b-a12b":{vision:!1,reasoning:!0,contextWindow:1048576,maxOutput:131072}},groq:{"llama-3.1-8b-instant":{contextWindow:131072,maxOutput:131072},"llama-3.3-70b-versatile":{contextWindow:131072,maxOutput:32768},"openai/gpt-oss-120b":{reasoning:!0,thinkingFormat:"openai",contextWindow:131072,maxOutput:65536},"openai/gpt-oss-20b":{reasoning:!0,thinkingFormat:"openai",contextWindow:131072,maxOutput:65536},"openai/gpt-oss-safeguard-20b":{reasoning:!0,thinkingFormat:"openai",contextWindow:131072,maxOutput:65536},"qwen/qwen3.8-27b":{vision:!0,reasoning:!0,contextWindow:131072,maxOutput:16384},"minimaxai/minimax-m2.7":{reasoning:!0,contextWindow:196608,maxOutput:131072},"meta-models/muse-spark-open":{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:131072,maxOutput:131072},"meta-llama/llama-prompt-guard-2-22m":{contextWindow:512,maxOutput:512},"meta-llama/llama-prompt-guard-2-86m":{contextWindow:512,maxOutput:512}},poolside:{"laguna-s-2.1":{reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:32e3},"laguna-xs-2.1":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:32e3}}},r=[{pattern:"*claude*opus-5*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude*opus-4.6*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*opus-4.7*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*opus-4.8*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet-4.6*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet-4.7*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet-5*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude*haiku-5*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*haiku-4*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*opus-4*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*sonnet-4*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*haiku*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*opus*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*sonnet*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*fable*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget",contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude*mythos*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget",contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude-3*",caps:{vision:!0}},{pattern:"*claude*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*gemini-4*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-level",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini*image*",caps:{vision:!0,imageOutput:!0,contextWindow:1048576}},{pattern:"*gemini-3*pro*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-level",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:65535}},{pattern:"*gemini-3*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-level",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini-2.5*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-budget",thinkingRange:{min:0,max:24576},contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini-2*",caps:{vision:!0,audioInput:!0,videoInput:!0,search:!0,contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini*",caps:{vision:!0,search:!0,contextWindow:1048576}},{pattern:"*gemma*",caps:{vision:!0,contextWindow:128e3}},{pattern:"*nanobanana*",caps:{vision:!0,imageOutput:!0}},{pattern:"*gpt-6*image*",caps:{imageOutput:!0}},{pattern:"*gpt-6*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:105e4,maxOutput:128e3}},{pattern:"*gpt-5*image*",caps:{imageOutput:!0}},{pattern:"*gpt-5*codex*",caps:{reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:4e5,maxOutput:128e3}},{pattern:"*gpt-5.4-mini*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:4e5,maxOutput:128e3}},{pattern:"*gpt-5.4-nano*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:4e5,maxOutput:128e3}},{pattern:"*gpt-5.4*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:105e4,maxOutput:128e3}},{pattern:"*gpt-5.5*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:105e4,maxOutput:128e3}},{pattern:"*gpt-5.6*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:105e4,maxOutput:128e3}},{pattern:"*gpt-5*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:4e5,maxOutput:128e3}},{pattern:"*gpt-4o*",caps:{vision:!0,search:!0,contextWindow:128e3,maxOutput:16384}},{pattern:"*gpt-4.1*",caps:{vision:!0,contextWindow:1e6,maxOutput:32768}},{pattern:"*gpt-4-turbo*",caps:{vision:!0,contextWindow:128e3}},{pattern:"*gpt-4*",caps:{contextWindow:128e3}},{pattern:"*gpt-3.5*",caps:{contextWindow:16385,maxOutput:4096}},{pattern:"*gpt-oss*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:128e3}},{pattern:"*o1-mini*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:128e3}},{pattern:"*o1*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*o3*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*o4*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*grok*image*",caps:{imageOutput:!0}},{pattern:"*grok-code*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:256e3}},{pattern:"*grok-4.7*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:5e5,maxOutput:64e3}},{pattern:"*grok-4.6*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:5e5,maxOutput:64e3}},{pattern:"*grok-4.5*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:5e5,maxOutput:64e3}},{pattern:"*grok-4*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:256e3}},{pattern:"*grok-3*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:131072}},{pattern:"*grok*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:256e3}},{pattern:"*qwen*vl*",caps:{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:262144}},{pattern:"*qwen*omni*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:262144,maxOutput:65536}},{pattern:"*qwen*coder*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6}},{pattern:"*qwen*max*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen3.5*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen3.6*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen3.7*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen*plus*",caps:{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen*235b*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:262144}},{pattern:"*qwq*",caps:{reasoning:!0,thinkingFormat:"qwen",thinkingCanDisable:!1,contextWindow:131072}},{pattern:"*qwen*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:262144}},{pattern:"*kimi*k3*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:131072}},{pattern:"*kimi*for-coding*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:262144,maxOutput:65536}},{pattern:"*kimi*k2.7*code*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:262144,maxOutput:65536}},{pattern:"*kimi*k2*",caps:{vision:!0,reasoning:!0,thinkingFormat:"kimi",contextWindow:262144,maxOutput:262144}},{pattern:"*kimi*",caps:{reasoning:!0,thinkingFormat:"kimi",contextWindow:262144}},{pattern:"*glm-5.3*",caps:{reasoning:!0,thinkingFormat:"zai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:128e3}},{pattern:"*glm-5*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5,maxOutput:128e3}},{pattern:"*glm-4.7*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5,maxOutput:128e3}},{pattern:"*glm-4*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5}},{pattern:"*glm*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5}},{pattern:"*deepseek-v4*",caps:{reasoning:!0,thinkingFormat:"deepseek",contextWindow:1e6,maxOutput:384e3}},{pattern:"*reasoner*",caps:{reasoning:!0,thinkingFormat:"deepseek",thinkingCanDisable:!1,contextWindow:128e3}},{pattern:"*deepseek-r*",caps:{reasoning:!0,thinkingFormat:"deepseek",thinkingCanDisable:!1,contextWindow:128e3}},{pattern:"*deepseek-chat*",caps:{contextWindow:128e3}},{pattern:"*deepseek*",caps:{reasoning:!0,thinkingFormat:"deepseek",contextWindow:128e3}},{pattern:"*minimax*image*",caps:{imageOutput:!0}},{pattern:"*minimax-m3*",caps:{vision:!0,reasoning:!0,thinkingFormat:"minimax",contextWindow:1048576,maxOutput:512e3}},{pattern:"*minimax-m2.7*",caps:{reasoning:!0,thinkingFormat:"minimax",thinkingCanDisable:!1,contextWindow:204800,maxOutput:131072}},{pattern:"*minimax*",caps:{reasoning:!0,thinkingFormat:"minimax",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:131072}},{pattern:"*mimo*v2.5*",caps:{vision:!0,contextWindow:1048576,maxOutput:131072}},{pattern:"*mimo*omni*",caps:{vision:!0,audioInput:!0,contextWindow:262144,maxOutput:131072}},{pattern:"*mimo*",caps:{vision:!0,contextWindow:262144,maxOutput:131072}},{pattern:"*llama-4*",caps:{vision:!0,contextWindow:1e6}},{pattern:"*llama*",caps:{contextWindow:128e3}},{pattern:"*codestral*",caps:{contextWindow:256e3}},{pattern:"*mistral-large*",caps:{vision:!0,contextWindow:256e3}},{pattern:"*mistral*",caps:{contextWindow:128e3}},{pattern:"*command-a-vision*",caps:{vision:!0,contextWindow:128e3}},{pattern:"*command*",caps:{contextWindow:128e3}},{pattern:"*sonar*",caps:{search:!0,contextWindow:128e3}},{pattern:"*pplx*",caps:{search:!0,contextWindow:128e3}},{pattern:"*perplexity*",caps:{search:!0,contextWindow:128e3}},{pattern:"*laguna-s-2.1*free*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:32e3}},{pattern:"*laguna-s-2.1*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:32e3}},{pattern:"*laguna*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:32e3}},{pattern:"*hunyuan*",caps:{reasoning:!0,thinkingFormat:"hunyuan",contextWindow:262144,maxOutput:262144}},{pattern:"hy3*",caps:{reasoning:!0,thinkingFormat:"hunyuan",contextWindow:262144,maxOutput:262144}},{pattern:"*step-*",caps:{reasoning:!0,thinkingFormat:"step",contextWindow:128e3}},{pattern:"*nemotron*",caps:{reasoning:!0,contextWindow:128e3}},{pattern:"*ling-*",caps:{reasoning:!0,contextWindow:128e3}}];function s(a){if(!a||"object"!=typeof a)return{};let b=Array.isArray(a.modalities?.input)?a.modalities.input:[],c=Array.isArray(a.modalities?.output)?a.modalities.output:[],d=Number(a.contextWindow??a.contextLength??a.maxInputTokens??a.limit?.context),e=Number(a.maxOutput??a.maxOutputTokens??a.limit?.output),f={...b.includes("image")?{vision:!0}:{},...b.includes("pdf")?{pdf:!0}:{},...b.includes("audio")?{audioInput:!0}:{},...b.includes("video")?{videoInput:!0}:{},...c.includes("image")?{imageOutput:!0}:{},...c.includes("audio")?{audioOutput:!0}:{}};return"boolean"==typeof a.reasoning&&(f.reasoning=a.reasoning),"boolean"==typeof a.tool_call&&(f.tools=a.tool_call),"boolean"==typeof a.tools&&(f.tools=a.tools),Number.isSafeInteger(d)&&d>0&&(f.contextWindow=d),Number.isSafeInteger(e)&&e>0&&(f.maxOutput=e),f}let t={"deepseek-v4.1-flash-free":33e4},u=new Set(["deepseek/deepseek-v4-pro","deepseek/deepseek-v4-flash","deepseek/deepseek-v4-flash-fast","zai-org/glm-5.3","zai-org/glm-5.2","zai-org/glm-5.2-fast","zai-org/glm-5.1","zai-org/glm-5","minimaxai/minimax-m2.7","minimax/minimax-m2.7-free","minimaxai/minimax-m2.5","xiaomi/mimo-v2.5-pro","qwen/qwen3.6-max-preview","qwen/qwen3.7-max","meituan/longcat-2.0:free","stepfun/step-3.5-flash","tencent/hy4-preview","tencent/hy3","tencent/hy3-paid","nvidia/nemotron-3-ultra-550b-a55b","poolside/laguna-s-2.1-free","inclusionai/ling-3.0-flash-free","inclusionai/ling-3.0-flash-sante:free"]),v={"glm-5.3-flash":{vision:!0},"deepseek-v4.1-flash:1017":{vision:!0},"muse-spark-open":{vision:!0,reasoning:!0},"mimo-v2.6-pro":{reasoning:!0},"mimo-v2.6-flash":{reasoning:!0},beam:{reasoning:!0},"gemma4:31b":{reasoning:!0},"mistral-large-4":{reasoning:!0}};function w(a,b,c=null){if(!b)return{...k};let d=b.includes("/")?b.split("/").pop():b,h=c=>{let g=function(a,b,c){let d="u"<typeof globalThis?null:globalThis.__zevaiCatalogSource||null;if(!d)return c;let e={...c};if("commandcode"!==a&&"cmc"!==a){let c=d.getModalities?.(a,b);if(c)for(let a of x)!0===c[a]&&(e[a]=!0)}if(!y.has(a)&&!function(a,b){let c=q[a];if(!c)return!1;let d=b?.includes("/")?b.split("/").pop():b;return!!(c[b]||c[d])}(a,b)){let c=d.getLimits?.(a,b);c?.contextWindow>0&&(e.contextWindow=c.contextWindow),c?.maxOutput>0&&(e.maxOutput=c.maxOutput)}return e}(a,d,c),h=function(a,b,c){if("ollama"!==a)return c;let d=v[b];return d?{...c,...d.vision?{vision:!0}:{},...d.reasoning?{reasoning:!0}:{}}:c}(a,b,function(a,b,c){if("opencode"!==a&&"oc"!==a)return c;let d=c,e=t[b];return e&&d?.contextWindow>e&&(d={...d,contextWindow:e}),"mimo-v2.6-flash-free"===b&&(d={...d,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!0}),d}(a,d,g));return h?.vision||!function(a){if(!a)return!1;let b=String(a).toLowerCase();return!e.test(b)&&f.test(b)}(b)?h:{...h,vision:!0}};if("commandcode"===a||"cmc"===a){let a=q.commandcode;return a?.[b]?h({...k,...a[b],...s(c)}):a?.[d]?h({...k,...a[d],...s(c)}):h({...k,reasoning:!0,thinkingFormat:"commandcode",thinkingEffortSupported:!0,vision:!function(a){let b=String(a||"").toLowerCase();if(u.has(b))return!0;for(let a of u){let c=a.includes("/")?a.slice(a.lastIndexOf("/")+1):a;if(b===c||b.endsWith("/"+c))return!0}return!1}(b),contextWindow:1e6,maxOutput:384e3,...s(c)})}if((0,g.ui)(a)){let a=(0,g.wu)(d);if(a)return h({...k,...s(a),thinkingFormat:"gemini-level",...s(c)})}if(a){let e=q[a]||("oc"===a?q.opencode:null)||("ocz"===a?q["opencode-zen"]:null)||("ch"===a?q.chutes:null)||("pa"===a?q["perplexity-agent"]:null)||("samba"===a?q.sambanova:null)||("nvb"===a?q["nvidia-build"]:null);if(e?.[b])return h({...k,...e[b],...s(c)});if(e?.[d])return h({...k,...e[d],...s(c)})}if(l[d])return h({...k,...l[d],...s(c)});if(l[b])return h({...k,...l[b],...s(c)});for(let{pattern:a,caps:e}of r)if(j(a,d)||j(a,b))return h({...k,...e,...s(c)});return h({...k,...s(c)})}let x=["vision","pdf","audioInput","videoInput"],y=new Set(["codex","kiro","opencode-go","ocg","commandcode","cmc"]);function z(a){return/(?:^|\/)gemini-4(?:$|[-.])/i.test(String(a||""))}},64371:(a,b,c)=>{"use strict";let d,e=c(34589),{runtimeFeatures:f}=c(56758),{asciiLowercase:g}=c(70745),h=new Map([["sha256",0],["sha384",1],["sha512",2]]);if(f.has("crypto")){let a=(d=c(77598)).getHashes();for(let b of(0===a.length&&h.clear(),h.keys()))!1===a.includes(b)&&h.delete(b)}else h.clear();let i=Map.prototype.get.bind(h),j=a=>h.has(g(a)),k=!1===f.has("crypto")||0===h.size?()=>!0:(a,b)=>{let c=m(b);if(0===c.length)return!0;for(let b of l(c)){let c=b.alg,d=b.val;if(o(n(c,a),d))return!0}return!1};function l(a){let b=[],c=null;for(let d of a){if(e(j(d.alg),"Invalid SRI hash algorithm token"),0===b.length){b.push(d),c=d;continue}let a=i(c.alg),f=i(d.alg);f<a||(f>a?(c=d,b[0]=d,b.length=1):b.push(d))}return b}function m(a){let b=[];for(let c of a.split(" ")){let a=c.split("?",1)[0],d="",e=[a.slice(0,6),a.slice(7)],f=e[0];if(!j(f))continue;e[1]&&(d=e[1]);let h={alg:g(f),val:d};b.push(h)}return b}let n=(a,b)=>d.hash(a,b,"base64");function o(a,b){let c=a.length;0!==c&&"="===a[c-1]&&(c-=1),0!==c&&"="===a[c-1]&&(c-=1);let d=b.length;if(0!==d&&"="===b[d-1]&&(d-=1),0!==d&&"="===b[d-1]&&(d-=1),c!==d)return!1;for(let d=0;d<c;++d)if(a[d]!==b[d]&&("+"!==a[d]||"-"!==b[d])&&("/"!==a[d]||"_"!==b[d]))return!1;return!0}a.exports={applyAlgorithmToBytes:n,bytesMatch:k,caseSensitiveMatch:o,isValidSRIHashAlgorithm:j,getStrongestMetadata:l,parseMetadata:m}},64375:(a,b,c)=>{"use strict";function d(a){let b=Number(a);return!b||b<=0?null:b<=768?"minimal":b<=4096?"low":b<=16384?"medium":b<=28672?"high":b<=80384?"xhigh":"max"}c.d(b,{v:()=>d})},64704:a=>{"use strict";let b,c=0,d=Symbol("kFastTimer"),e=[];function f(){c+=499;let a=0,b=e.length;for(;a<b;){let d=e[a];0===d._state?(d._idleStart=c-499,d._state=1):1===d._state&&c>=d._idleStart+d._idleTimeout&&(d._state=-1,d._idleStart=-1,d._onTimeout(d._timerArg)),-1===d._state?(d._state=-2,0!=--b&&(e[a]=e[b])):++a}e.length=b,0!==e.length&&g()}function g(){b?.refresh?b.refresh():(clearTimeout(b),b=setTimeout(f,499),b?.unref())}class h{[d]=!0;_state=-2;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(a,b,c){this._onTimeout=a,this._idleTimeout=b,this._timerArg=c,this.refresh()}refresh(){-2===this._state&&e.push(this),b&&1!==e.length||g(),this._state=0}clear(){this._state=-1,this._idleStart=-1}}a.exports={setTimeout:(a,b,c)=>b<=1e3?setTimeout(a,b,c):new h(a,b,c),clearTimeout(a){a[d]?a.clear():clearTimeout(a)},setFastTimeout:(a,b,c)=>new h(a,b,c),clearFastTimeout(a){a.clear()},now:()=>c,tick(a=0){c+=a-1e3+1,f(),f()},reset(){c=0,e.length=0,clearTimeout(b),b=null},kFastTimer:d}},64821:(a,b,c)=>{"use strict";let{Writable:d}=c(57075),e=c(34589),{parserStates:f,opcodes:g,states:h,emptyBuffer:i,sentCloseFrameState:j}=c(62026),{isValidStatusCode:k,isValidOpcode:l,websocketMessageReceived:m,utf8Decode:n,isControlFrame:o,isTextBinaryFrame:p,isContinuationFrame:q}=c(94050),{failWebsocketConnection:r}=c(4654),{WebsocketFrameSend:s}=c(45221),{PerMessageDeflate:t}=c(97210),{MessageSizeExceededError:u}=c(61448),{defaultWebSocketMaxFragments:v,defaultWebSocketMaxPayloadSize:w}=c(28820);class x extends d{#b8=[];#b9=0;#ca=0;#cb=!1;#a=f.INFO;#cc={};#cd=[];#bW;#a$;#ce;#cf;constructor(a,b,c={}){super(),this.#a$=a,this.#bW=null==b?new Map:b,this.#ce=c.maxFragments??v,this.#cf=c.maxPayloadSize??w,this.#bW.has("permessage-deflate")&&this.#bW.set("permessage-deflate",new t(b,{maxPayloadSize:this.#cf}))}_write(a,b,c){this.#b8.push(a),this.#ca+=a.length,this.#cb=!0,this.run(c)}#cg(){return!(this.#cf>0)||!!o(this.#cc.opcode)||!(this.#cc.payloadLength+this.#b9>this.#cf)||(r(this.#a$,1009,"Payload size exceeds maximum allowed size"),!1)}run(a){for(;this.#cb;)if(this.#a===f.INFO){if(this.#ca<2)return a();let b=this.consume(2),c=(128&b[0])!=0,d=15&b[0],e=(128&b[1])==128,h=!c&&d!==g.CONTINUATION,i=127&b[1],j=64&b[0],k=32&b[0],m=16&b[0];if(!l(d))return r(this.#a$,1002,"Invalid opcode received"),a();if(e)return r(this.#a$,1002,"Frame cannot be masked"),a();if(0!==j&&!this.#bW.has("permessage-deflate"))return void r(this.#a$,1002,"Expected RSV1 to be clear.");if(0!==k||0!==m)return void r(this.#a$,1002,"RSV1, RSV2, RSV3 must be clear");if(h&&!p(d))return void r(this.#a$,1002,"Invalid frame type was fragmented.");if(p(d)&&this.#cd.length>0)return void r(this.#a$,1002,"Expected continuation frame");if(this.#cc.fragmented&&h)return void r(this.#a$,1002,"Fragmented frame exceeded 125 bytes.");if((i>125||h)&&o(d))return void r(this.#a$,1002,"Control frame either too large or fragmented");if(q(d)&&0===this.#cd.length&&!this.#cc.compressed)return void r(this.#a$,1002,"Unexpected continuation frame");if(i<=125){if(this.#cc.payloadLength=i,this.#a=f.READ_DATA,!this.#cg())return}else 126===i?this.#a=f.PAYLOADLENGTH_16:127===i&&(this.#a=f.PAYLOADLENGTH_64);p(d)&&(this.#cc.binaryType=d,this.#cc.compressed=0!==j),this.#cc.opcode=d,this.#cc.masked=e,this.#cc.fin=c,this.#cc.fragmented=h}else if(this.#a===f.PAYLOADLENGTH_16){if(this.#ca<2)return a();let b=this.consume(2);if(this.#cc.payloadLength=b.readUInt16BE(0),this.#a=f.READ_DATA,!this.#cg())return}else if(this.#a===f.PAYLOADLENGTH_64){if(this.#ca<8)return a();let b=this.consume(8),c=b.readUInt32BE(0),d=b.readUInt32BE(4);if(0!==c||d>0x7fffffff)return void r(this.#a$,1009,"Received payload length > 2^31 bytes.");if(this.#cc.payloadLength=d,this.#a=f.READ_DATA,!this.#cg())return}else if(this.#a===f.READ_DATA){if(this.#ca<this.#cc.payloadLength)return a();let b=this.consume(this.#cc.payloadLength);if(o(this.#cc.opcode)){if(this.#cb=this.parseControlFrame(b),this.#a=f.INFO,this.#cb&&this.#a$.socket.writableNeedDrain){this.#cb=!1,this.#a$.socket.once("drain",()=>{this.destroyed||(this.#cb=!0,this.run(a))});return}}else if(this.#cc.compressed){this.#bW.get("permessage-deflate").decompress(b,this.#cc.fin,(b,c)=>{if(b){let a=b instanceof u?1009:1007;r(this.#a$,a,b.message);return}if(this.writeFragments(c)){if(this.#cf>0&&this.#b9>this.#cf)return void r(this.#a$,1009,new u().message);if(!this.#cc.fin){this.#a=f.INFO,this.#cb=!0,this.run(a);return}m(this.#a$,this.#cc.binaryType,this.consumeFragments()),this.#cb=!0,this.#a=f.INFO,this.run(a)}},this.#b9),this.#cb=!1;break}else{if(!this.writeFragments(b))return;!this.#cc.fragmented&&this.#cc.fin&&m(this.#a$,this.#cc.binaryType,this.consumeFragments()),this.#a=f.INFO}}}consume(a){if(a>this.#ca)throw Error("Called consume() before buffers satiated.");if(0===a)return i;this.#ca-=a;let b=this.#b8[0];if(b.length>a)return this.#b8[0]=b.subarray(a,b.length),b.subarray(0,a);{if(b.length===a)return this.#b8.shift();let c=0,d=Buffer.allocUnsafeSlow(a);for(;c!==a;){let b=this.#b8[0],e=b.length;if(e+c===a){d.set(this.#b8.shift(),c);break}if(e+c>a){d.set(b.subarray(0,a-c),c),this.#b8[0]=b.subarray(a-c);break}d.set(this.#b8.shift(),c),c+=e}return d}}writeFragments(a){return this.#ce>0&&this.#cd.length===this.#ce?(r(this.#a$,1008,"Too many message fragments"),!1):(this.#b9+=a.length,this.#cd.push(a),!0)}consumeFragments(){let a=this.#cd;if(this.#cc.compressed=!1,1===a.length)return this.#b9=0,a.shift();let b=0,c=Buffer.allocUnsafeSlow(this.#b9);for(let d=0;d<a.length;++d){let e=a[d];c.set(e,b),b+=e.length}return this.#cd=[],this.#b9=0,c}parseCloseBody(a){let b;if(e(1!==a.length),a.length>=2&&(b=a.readUInt16BE(0)),void 0!==b&&!k(b))return{code:1002,reason:"Invalid status code",error:!0};let c=a.subarray(2);239===c[0]&&187===c[1]&&191===c[2]&&(c=c.subarray(3));try{c=n(c)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:b,reason:c,error:!1}}parseControlFrame(a){let{opcode:b,payloadLength:c}=this.#cc;if(b===g.CLOSE){if(1===c)return r(this.#a$,1002,"Received close frame with a 1-byte body."),!1;if(this.#cc.closeInfo=this.parseCloseBody(a),this.#cc.closeInfo.error){let{code:a,reason:b}=this.#cc.closeInfo;return r(this.#a$,a,b),!1}if(!this.#a$.closeState.has(j.SENT)&&!this.#a$.closeState.has(j.RECEIVED)){let a=i;this.#cc.closeInfo.code&&(a=Buffer.allocUnsafe(2)).writeUInt16BE(this.#cc.closeInfo.code,0);let b=new s(a);this.#a$.socket.write(b.createFrame(g.CLOSE)),this.#a$.closeState.add(j.SENT)}return this.#a$.readyState=h.CLOSING,this.#a$.closeState.add(j.RECEIVED),!1}if(b===g.PING){if(!this.#a$.closeState.has(j.RECEIVED)){let b=new s(a);this.#a$.socket.write(b.createFrame(g.PONG)),this.#a$.onPing(a)}}else b===g.PONG&&this.#a$.onPong(a);return!0}get closingInfo(){return this.#cc.closeInfo}}a.exports={ByteParser:x}},65294:(a,b,c)=>{"use strict";c.d(b,{x:()=>h});var d=c(69762),e=c(42541),f=c(90943);function g(a,b,c=null){return{id:a.responseId,object:"chat.completion.chunk",created:a.created,model:a.model,choices:[{index:0,delta:b,finish_reason:c}]}}function h(a,b){var c;if(!a)return null;if(a&&"object"==typeof a&&"chat.completion.chunk"===a.object)return a;let d=a;if("string"==typeof a){let b=a.trim();if(!b)return null;let c=b.startsWith("data:")?b.slice(5).trim():b;if(!c||"[DONE]"===c)return null;try{d=JSON.parse(c)}catch{return null}}if(!d||"object"!=typeof d||!d.type)return null;c=d.model,b.responseId||(b.responseId=`chatcmpl-${Date.now()}`,b.created=Math.floor(Date.now()/1e3),b.model=b.model||c||"commandcode",b.chunkIndex=0,b.toolIndex=0,b.toolIndexById=new Map,b.openTools=new Set,b.openText=!1,b.finishReason=null,b.finishReasonSent=!1,b.usage=null);let h=[];switch(d.type){case"text-delta":{let a=d.text||d.delta||"";if(!a)break;let c=0===b.chunkIndex?{role:"assistant",content:a}:{content:a};b.chunkIndex++,b.openText=!0,h.push(g(b,c));break}case"reasoning-delta":{let a=d.text||"";if(!a)break;let c=0===b.chunkIndex?{role:"assistant",reasoning_content:a}:{reasoning_content:a};b.chunkIndex++,h.push(g(b,c));break}case"tool-input-start":{let a=d.id||d.toolCallId||`call_${Date.now()}_${b.toolIndex}`,c=b.toolIndexById.get(a);null==c&&(c=b.toolIndex++,b.toolIndexById.set(a,c)),b.openTools.add(a);let e={...0===b.chunkIndex?{role:"assistant"}:{},tool_calls:[{index:c,id:a,type:"function",function:{name:d.toolName||"",arguments:""}}]};b.chunkIndex++,h.push(g(b,e));break}case"tool-input-delta":{let a=d.id||d.toolCallId,c=b.toolIndexById.get(a);if(null==c)break;let e={tool_calls:[{index:c,function:{arguments:d.delta||d.inputTextDelta||""}}]};h.push(g(b,e));break}case"tool-call":{let a=d.toolCallId;if(b.toolIndexById.has(a))break;let c=b.toolIndex++;b.toolIndexById.set(a,c);let e="string"==typeof d.input?d.input:JSON.stringify(d.input??{}),f={...0===b.chunkIndex?{role:"assistant"}:{},tool_calls:[{index:c,id:a,type:"function",function:{name:d.toolName||"",arguments:e}}]};b.chunkIndex++,h.push(g(b,f));break}case"finish-step":b.finishReason=(0,f.Jm)(d.finishReason,{format:e.h.COMMANDCODE,hasToolCalls:b.toolIndex>0}),d.usage&&(b.usage=d.usage);break;case"finish":{if(b.finishReasonSent)break;let a=b.finishReason||(0,f.Jm)(d.finishReason,{format:e.h.COMMANDCODE,hasToolCalls:b.toolIndex>0}),c=g(b,{},a),i=d.totalUsage||b.usage;i&&(c.usage={prompt_tokens:i.inputTokens??0,completion_tokens:i.outputTokens??0,total_tokens:i.totalTokens??(i.inputTokens??0)+(i.outputTokens??0)}),b.finishReasonSent=!0,h.push(c);break}case"error":{b.finishReason="stop";let a=d.error??d.message??"unknown",c="string"==typeof a?a:JSON.stringify(a);h.push(g(b,{content:`
477
+ ${b.join("\n")}`}(c);f&&e.push(f),e.push("You have built-in web search. Answer questions directly using search results."),d.instructions=e,a.history.length>0&&(d.history=a.history),a.currentMsg?d.query=a.currentMsg:0===a.history.length&&(d.query="");let g=JSON.stringify(d);return g.length>96e3?g.slice(-96e3):g}(E,F,b?.tools);if(!G.trim())return{response:new Response(JSON.stringify({error:{message:"Empty query after processing",type:"invalid_request"}}),{status:400,headers:{"Content-Type":"application/json"}}),url:g,headers:{},transformedBody:b};let H=(m=v,n=z,C="u">typeof Intl?Intl.DateTimeFormat().resolvedOptions().timeZone:"UTC",{query_str:G,params:{query_str:G,search_focus:"internet",mode:m,model_preference:n,sources:["web"],attachments:[],frontend_uuid:crypto.randomUUID(),frontend_context_uuid:crypto.randomUUID(),version:h,language:"en-US",timezone:C,search_recency_filter:null,is_incognito:!0,use_schematized_api:!0,last_backend_uuid:F}}),I={"Content-Type":"application/json",Accept:"text/event-stream",Origin:"https://www.perplexity.ai",Referer:"https://www.perplexity.ai/","User-Agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36","X-App-ApiClient":"default","X-App-ApiVersion":h};d.accessToken?I.Authorization=`Bearer ${d.accessToken}`:d.apiKey&&(I.Cookie=`__Secure-next-auth.session-token=${d.apiKey}`),(0,f.MB)(I,l),k?.info?.("PPLX-WEB",`Query to ${a} (pref=${z}, mode=${v}), len=${G.length}`);let J={method:"POST",headers:I,body:JSON.stringify(H)};e&&(J.signal=e);try{A=await fetch(g,J)}catch(a){return k?.error?.("PPLX-WEB",`Fetch failed: ${a.message||String(a)}`),{response:new Response(JSON.stringify({error:{message:`Perplexity connection failed: ${a.message||String(a)}`,type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:g,headers:I,transformedBody:H}}if(!A.ok){let a=A.status,b=`Perplexity returned HTTP ${a}`;return 401===a||403===a?b="Perplexity auth failed — session cookie may be expired. Re-paste your __Secure-next-auth.session-token.":429===a&&(b="Perplexity rate limited. Wait a moment and retry."),k?.warn?.("PPLX-WEB",b),{response:new Response(JSON.stringify({error:{message:b,type:"upstream_error",code:`HTTP_${a}`}}),{status:a,headers:{"Content-Type":"application/json"}}),url:g,headers:I,transformedBody:H}}if(!A.body)return{response:new Response(JSON.stringify({error:{message:"Perplexity returned empty response body",type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:g,headers:I,transformedBody:H};let K=`chatcmpl-pplx-${crypto.randomUUID().slice(0,12)}`,L=Math.floor(Date.now()/1e3);if(c){let b;B=new Response((o=A.body,p=E.history,q=E.currentMsg,b=new TextEncoder,new ReadableStream({async start(c){try{c.enqueue(b.encode(x({id:K,object:"chat.completion.chunk",created:L,model:a,system_fingerprint:null,choices:[{index:0,delta:{role:"assistant"},finish_reason:null,logprobs:null}]})));let d="",f=null;for await(let g of w(o,e)){if(g.backendUuid&&(f=g.backendUuid),g.error){c.enqueue(b.encode(x({id:K,object:"chat.completion.chunk",created:L,model:a,system_fingerprint:null,choices:[{index:0,delta:{content:`[Error: ${g.error}]`},finish_reason:null,logprobs:null}]})));break}if(g.thinking){c.enqueue(b.encode(x({id:K,object:"chat.completion.chunk",created:L,model:a,system_fingerprint:null,choices:[{index:0,delta:{reasoning_content:g.thinking+"\n"},finish_reason:null,logprobs:null}]})));continue}if(g.done){d=g.answer||d;break}let e=g.delta||"";e&&(e=u(e,!1))&&c.enqueue(b.encode(x({id:K,object:"chat.completion.chunk",created:L,model:a,system_fingerprint:null,choices:[{index:0,delta:{content:e},finish_reason:null,logprobs:null}]}))),g.answer&&(d=g.answer)}c.enqueue(b.encode(x({id:K,object:"chat.completion.chunk",created:L,model:a,system_fingerprint:null,choices:[{index:0,delta:{},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode("data: [DONE]\n\n")),t(p,q,u(d),f)}catch(d){c.enqueue(b.encode(x({id:K,object:"chat.completion.chunk",created:L,model:a,system_fingerprint:null,choices:[{index:0,delta:{content:`[Stream error: ${d.message||String(d)}]`},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode("data: [DONE]\n\n"))}finally{c.close()}}})),{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache","X-Accel-Buffering":"no"}})}else B=await y(A.body,a,K,L,E.history,E.currentMsg,e);return{response:B,url:g,headers:I,transformedBody:H}}}},64323:(a,b,c)=>{"use strict";c(42541),c(92843),new TextEncoder},64334:(a,b,c)=>{"use strict";c.d(b,{nl:()=>w,dn:()=>z});let d="[-_/:.]",e=RegExp(`(^|${d})(image|img)(${d}|$)|stable-image|gen[0-9]_image|nanobanana|imagine|t2v|i2v|flux|dall|sdxl|diffusion|embed|rerank|guard|moderation|tts|stt|whisper|voice|speech|audio`,"i"),f=RegExp(`(^|${d})(vision|vl|vlm|multimodal|omni|visual)(${d}|$)|[0-9]\\.[0-9]+v(${d}|$)|(^|${d})glm-[0-9]+v(${d}|$)|(^|[-_/:.])(llava|pixtral|internvl|cogvlm|minicpm-v|moondream|idefics|fuyu)`,"i");var g=c(2206),h=c(92693),i=c(92367);function j(a,b){if("string"!=typeof a||"string"!=typeof b)return!1;let c=a.split("*").map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join(".*");return RegExp(`^${c}$`,"i").test(b)}let k={vision:!1,pdf:!1,audioInput:!1,videoInput:!1,imageOutput:!1,audioOutput:!1,search:!1,tools:!0,reasoning:!1,thinkingFormat:null,thinkingCanDisable:!0,thinkingRange:null,contextWindow:2e5,maxOutput:64e3},l={"claude-opus-5.5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingCanDisable:!1,forcedToolChoice:!1},"claude-opus-5.5-thinking":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingCanDisable:!1,forcedToolChoice:!1},"claude-opus-5.5-agentic":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingCanDisable:!1,forcedToolChoice:!1},"claude-opus-5.5-thinking-agentic":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingCanDisable:!1,forcedToolChoice:!1},"claude-opus-5-5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingCanDisable:!1,forcedToolChoice:!1},"claude-opus-5-5-high":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingCanDisable:!1,forcedToolChoice:!1},"claude-opus-5-5-medium":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingCanDisable:!1,forcedToolChoice:!1},"claude-opus-5-5-low":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingCanDisable:!1,forcedToolChoice:!1},"claude-sonnet-5.5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingOffType:"between_tools",forcedToolChoice:!1},"claude-sonnet-5-5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingOffType:"between_tools",forcedToolChoice:!1},"claude-sonnet-5-5-high":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingOffType:"between_tools",forcedToolChoice:!1},"claude-sonnet-5-5-medium":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingOffType:"between_tools",forcedToolChoice:!1},"claude-sonnet-5-5-low":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3,thinkingOffType:"between_tools",forcedToolChoice:!1},"claude-opus-5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-5-thinking":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-5-agentic":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-5-thinking-agentic":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.6":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.7":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-7":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.8":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-6":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-8":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-8-thinking":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-4.6":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-thinking":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-agentic":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-thinking-agentic":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"gpt-image-1":{imageOutput:!0,tools:!1},"glm-4.6v":{vision:!0,reasoning:!0,thinkingFormat:"zai",contextWindow:128e3},"vision-model":{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6},"coder-model":{reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6},"kimi-k3":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:131072},k3:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:131072},"kimi-for-coding":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:262144,maxOutput:65536},"kimi-for-coding-highspeed":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:262144,maxOutput:65536},"kimi-k2.7-code":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:262144,maxOutput:65536},"kimi-k2.7-code-highspeed":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:262144,maxOutput:65536},"deepseek-v4.1-flash":{vision:!0,reasoning:!0,thinkingFormat:"deepseek",contextWindow:1e6,maxOutput:384e3},"deepseek-v4-1-flash":{vision:!0,reasoning:!0,thinkingFormat:"deepseek",contextWindow:1e6,maxOutput:384e3},"deepseek-flash":{vision:!0,reasoning:!0,thinkingFormat:"deepseek",contextWindow:128e3,maxOutput:64e3}},m={vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:372e3,maxOutput:128e3},n={vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:272e3,maxOutput:128e3},o={auto:{contextWindow:2e5,maxOutput:32768},efficient:{contextWindow:2e5,maxOutput:32768},lite:{contextWindow:2e5,maxOutput:32768},ultimate:{vision:!0,reasoning:!0,contextWindow:2e5,maxOutput:65536},performance:{vision:!0,contextWindow:2e5,maxOutput:65536},qmodel_38max:{vision:!0,reasoning:!0,contextWindow:2e5,maxOutput:65536},qmodel_latest:{vision:!0,contextWindow:2e5,maxOutput:65536},qmodel:{vision:!0,contextWindow:2e5,maxOutput:65536},qfmodel:{vision:!0,reasoning:!0,contextWindow:2e5,maxOutput:65536},kmodel_latest:{vision:!0,contextWindow:2e5,maxOutput:65536},kmodel:{vision:!0,contextWindow:2e5,maxOutput:65536},gmodel:{vision:!0,reasoning:!0,contextWindow:2e5,maxOutput:65536},gfmodel:{vision:!0,reasoning:!0,contextWindow:2e5,maxOutput:65536},dmodel:{vision:!0,reasoning:!0,contextWindow:2e5,maxOutput:65536},dfmodel:{vision:!0,reasoning:!0,contextWindow:2e5,maxOutput:65536},mmodel:{vision:!0,contextWindow:2e5,maxOutput:65536},smodel:{vision:!0,reasoning:!0,contextWindow:18e4,maxOutput:65536},cmodel:{vision:!0,reasoning:!0,contextWindow:18e4,maxOutput:65536}},p={reasoning:!0,thinkingFormat:"zai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:131072},q={glm:{"glm-5.3":p,"glm-5.3-flash":{...p,vision:!0,videoInput:!0,pdf:!0}},"glm-cn":{"glm-5.3":p,"glm-5.3-flash":{...p,vision:!0,videoInput:!0,pdf:!0}},qoder:o,qd:o,"qoder-cn":o,qdcn:o,xai:{"grok-4.3":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:64e3},"grok-4.20-0309-reasoning":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:64e3},"grok-4.20-0309-non-reasoning":{vision:!0,reasoning:!1,search:!0,contextWindow:1e6,maxOutput:64e3},"grok-4.20-multi-agent-0309":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:64e3},"grok-build-0.1":{reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:256e3,maxOutput:64e3}},"nvidia-build":{"moonshotai/kimi-k3.1-pro":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:262144,maxOutput:65536},"minimaxai/minimax-m3.1-flash":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:131072,maxOutput:65536},"stepfun-ai/step-5-preview":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:131072,maxOutput:65536},"nvidia/nemotron-3-ultra-550b-a55b":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:131072,maxOutput:65536}},nvidia:{"minimaxai/minimax-m2.7":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:131072},"minimaxai/minimax-m3":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:512e3,maxOutput:131072},"z-ai/glm-5.2":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:128e3},"deepseek-ai/deepseek-v4-pro":{reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:65536},"deepseek-ai/deepseek-v4-flash":{reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:65536}},codex:{"gpt-6-astra":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:272e3,maxOutput:128e3},"gpt-6-sol":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:272e3,maxOutput:128e3},"gpt-6.1-sol":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:272e3,maxOutput:128e3},"gpt-6.1-terra":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:5e5,maxOutput:128e3},"gpt-6-luna":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:272e3,maxOutput:128e3},"gpt-5.6-sol":m,"gpt-5.6-sol-review":m,"gpt-5.6-terra":n,"gpt-5.6-terra-review":n,"gpt-5.6-luna":n,"gpt-5.6-luna-review":n},"codebuddy-cn":{"glm-5.2":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:48e3},"glm-5.1":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:48e3},"glm-5v-turbo":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:38e3},"minimax-m3":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:512e3,maxOutput:48e3},"kimi-k2.7":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:256e3,maxOutput:32e3},"kimi-k2.6":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:256e3,maxOutput:32e3},hy3:{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:192e3,maxOutput:64e3},"hy4-preview":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:192e3,maxOutput:64e3},"glm-5.3":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!0,contextWindow:1e6,maxOutput:131072},"glm-5.3-flash":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!0,contextWindow:1e6,maxOutput:131072},"kimi-k3-1":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:32e3},"deepseek-v4-pro":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:5e4},"deepseek-v4.1-flash":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:5e4}},commandcode:{"claude-haiku-5-5":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"commandcode",thinkingEffortSupported:!0,contextWindow:1e6,maxOutput:128e3}},github:{"claude-haiku-5.5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3}},kiro:{"claude-haiku-5.5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3}},tokenharbor:{"claude-haiku-5.5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3}},"opencode-go":{"glm-5.3-flash":{vision:!0,videoInput:!0,pdf:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:131072},"kimi-k3.1-pro":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:131072},"grok-4.7":{vision:!0,pdf:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:5e5,maxOutput:5e5},"gpt-6-luna":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:105e4,maxOutput:128e3},"mimo-v2.6-flash":{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:131072},"mimo-v2.6-pro":{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:131072},"minimax-m3.1-flash":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:512e3},"step-5-preview":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:65536},hy4:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:65536},"beam-free":{reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:131072},"iceman-contributor-free":{reasoning:!0,thinkingFormat:"openai",contextWindow:262144,maxOutput:131072},"gemini-4-argon":{vision:!0,pdf:!0,reasoning:!0,thinkingFormat:"gemini-level",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:65536},"claude-haiku-5-5":{vision:!0,pdf:!0,reasoning:!0,thinkingFormat:"claude-adaptive",contextWindow:2e5,maxOutput:64e3}},opencode:{"deepseek-v4.1-flash-free":{reasoning:!0,thinkingFormat:"deepseek",thinkingCanDisable:!1,contextWindow:33e4,maxOutput:128e3},"glm-5.3-flash-free":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:128e3},"mimo-v2.6-flash-free":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!0},"pulse-alpha-free":{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:131072},"crouton-alpha-free":{vision:!0,videoInput:!0,pdf:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:27e4},"longcat-2.5-free":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!0,contextWindow:1e6,maxOutput:262144},"iceman-free":{reasoning:!0,thinkingFormat:"openai",contextWindow:262144,maxOutput:131072},"inkling-2-small-free":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!0,contextWindow:1048576,maxOutput:131072},"minimax-m3.1-flash-free":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:131072}},"opencode-zen":{"claude-haiku-5-5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-5-5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-5":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"gpt-6-sol":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:105e4,maxOutput:128e3},"gpt-6.1-sol":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:105e4,maxOutput:128e3},"gpt-6-luna":{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:105e4,maxOutput:128e3},"grok-4.7":{vision:!0,pdf:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:5e5,maxOutput:5e5},"muse-wonder-1.0":{vision:!0,pdf:!0,videoInput:!0,audioInput:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:131072},"qwen3.8-flash":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:131072},"qwen3.8-max":{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:262144,maxOutput:131072},"deepseek-v4.1-flash":{vision:!0,reasoning:!0,thinkingFormat:"deepseek",contextWindow:1e6,maxOutput:384e3},"mistral-large-4":{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:524288,maxOutput:262144},"beam-free":{reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:131072},"flint-40b-free":{reasoning:!0,thinkingFormat:"openai",contextWindow:262144,maxOutput:65536},"nemotron-3.5-super-vl-free":{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:131072},"deepseek-v4.1-flash-free":{vision:!0,reasoning:!0,thinkingFormat:"deepseek",contextWindow:2e5,maxOutput:32e3},"glm-5.3-flash-free":{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:32e3},"pulse-alpha-free":{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:131072},"crouton-alpha-free":{vision:!0,videoInput:!0,pdf:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:27e4}},venice:h.hG,chutes:i.XY,mistral:{"mistral-large-4":{vision:!0,reasoning:!0,contextWindow:1e6},"mistral-large-4-0":{vision:!0,reasoning:!0,contextWindow:1e6},"mistral-small-2603":{vision:!0,reasoning:!0,contextWindow:256e3},"zai-glm-5-3":{reasoning:!0,thinkingFormat:"zai",contextWindow:1e6,maxOutput:128e3},"zai-glm-5-3-flash":{vision:!0,reasoning:!0,thinkingFormat:"zai",contextWindow:1e6,maxOutput:128e3},"deepseek-v4-1-flash-1017":{vision:!0,reasoning:!0,thinkingFormat:"deepseek",contextWindow:1e6,maxOutput:128e3},"ministral-14b-2512":{vision:!0,reasoning:!1,contextWindow:256e3},"ministral-8b-2512":{vision:!0,reasoning:!1,contextWindow:256e3},"ministral-3b-2512":{vision:!0,reasoning:!1,contextWindow:256e3},"codestral-2508":{vision:!1,reasoning:!1,contextWindow:128e3},"codestral-latest":{vision:!1,reasoning:!1,contextWindow:128e3}},together:{"deepseek-ai/DeepSeek-V4-Pro-0813":{contextWindow:1048576},"deepseek-ai/DeepSeek-V4.1-Flash":{contextWindow:1e6},"deepseek-ai/DeepSeek-V4.1-Flash-1017":{contextWindow:1e6},"meta-models/Muse-Glimmer-30B":{contextWindow:131072},"meta-models/Muse-Spark-Open-816B-A42B":{contextWindow:1048576},"MiniMaxAI/MiniMax-M3.1-Flash":{contextWindow:1048576},"moonshotai/Kimi-K3":{vision:!0,contextWindow:1048576},"moonshotai/Kimi-K3.1-Pro":{vision:!0,contextWindow:1048576},"nvidia/NVIDIA-Nemotron-3.5-Super-VL":{vision:!0,contextWindow:262144},"openai/gpt-oss-120b":{reasoning:!0,thinkingFormat:"openai",contextWindow:131072},"Prism-ML/Ternary-Bonsai-27B":{contextWindow:262144},"Qwen/Qwen3.5-9B":{vision:!0,contextWindow:262144},"Qwen/Qwen3.6-Plus":{contextWindow:1e6},"Qwen/Qwen3.7-Plus":{contextWindow:1e6},"Qwen/Qwen3.8-Flash":{contextWindow:1e6},"reflection/Beam-1.0-501B-A23B":{contextWindow:1048576},"together/Tev1-4B-experimental":{contextWindow:32768},"zai-org/GLM-5.2":{contextWindow:1048575},"zai-org/GLM-5.3":{contextWindow:1048575},"zai-org/GLM-5.3-Flash":{contextWindow:1048575}},sambanova:{"MiniMax-M3.1-Flash":{contextWindow:1048576,maxOutput:1048576},"gemma-4-31B-it":{contextWindow:262144,maxOutput:262144},"gpt-oss-120b":{reasoning:!0,thinkingFormat:"openai",contextWindow:131072,maxOutput:131072},"Meta-Llama-3.3-70B-Instruct":{contextWindow:131072,maxOutput:3072}},cohere:{"command-a-plus-05-2026":{vision:!0,reasoning:!0,contextWindow:128e3,maxOutput:64e3},"command-a-03-2025":{contextWindow:256e3,maxOutput:8e3},"command-a-reasoning-08-2025":{reasoning:!0,contextWindow:256e3,maxOutput:32e3},"command-a-vision-07-2025":{vision:!0,contextWindow:128e3,maxOutput:8e3},"command-a-translate-08-2025":{contextWindow:8e3,maxOutput:8e3},"command-r7b-12-2024":{contextWindow:128e3,maxOutput:4e3},"command-r-plus-08-2024":{contextWindow:128e3,maxOutput:4e3},"command-r-08-2024":{contextWindow:128e3,maxOutput:4e3},"north-mini-code-1.0":{contextWindow:256e3,maxOutput:64e3},"north-small-translate-1.0":{contextWindow:16e3,maxOutput:16e3},"c4ai-aya-expanse-32b":{contextWindow:128e3,maxOutput:4e3},"c4ai-aya-vision-32b":{vision:!0,contextWindow:16e3,maxOutput:4e3},"tiny-aya-global":{contextWindow:8e3,maxOutput:8e3},"tiny-aya-earth":{contextWindow:8e3,maxOutput:8e3},"tiny-aya-fire":{contextWindow:8e3,maxOutput:8e3},"tiny-aya-water":{contextWindow:8e3,maxOutput:8e3}},cerebras:{"qwen-3.8-27b":{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:131072,maxOutput:40960}},"perplexity-agent":{"perplexity/nemotron-3.5-super-120b-a12b":{vision:!1,reasoning:!0,contextWindow:1048576,maxOutput:131072}},groq:{"llama-3.1-8b-instant":{contextWindow:131072,maxOutput:131072},"llama-3.3-70b-versatile":{contextWindow:131072,maxOutput:32768},"openai/gpt-oss-120b":{reasoning:!0,thinkingFormat:"openai",contextWindow:131072,maxOutput:65536},"openai/gpt-oss-20b":{reasoning:!0,thinkingFormat:"openai",contextWindow:131072,maxOutput:65536},"openai/gpt-oss-safeguard-20b":{reasoning:!0,thinkingFormat:"openai",contextWindow:131072,maxOutput:65536},"qwen/qwen3.8-27b":{vision:!0,reasoning:!0,contextWindow:131072,maxOutput:16384},"minimaxai/minimax-m2.7":{reasoning:!0,contextWindow:196608,maxOutput:131072},"meta-models/muse-spark-open":{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:131072,maxOutput:131072},"meta-llama/llama-prompt-guard-2-22m":{contextWindow:512,maxOutput:512},"meta-llama/llama-prompt-guard-2-86m":{contextWindow:512,maxOutput:512}},poolside:{"laguna-s-2.1":{reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:32e3},"laguna-xs-2.1":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:32e3}}},r=[{pattern:"*claude*opus-5*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude*opus-4.6*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*opus-4.7*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*opus-4.8*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet-4.6*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet-4.7*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet-5*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude*haiku-5*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*haiku-4*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*opus-4*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*sonnet-4*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*haiku*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*opus*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*sonnet*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*fable*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget",contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude*mythos*",caps:{vision:!0,pdf:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget",contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude-3*",caps:{vision:!0}},{pattern:"*claude*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*gemini-4*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-level",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini*image*",caps:{vision:!0,imageOutput:!0,contextWindow:1048576}},{pattern:"*gemini-3*pro*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-level",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:65535}},{pattern:"*gemini-3*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-level",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini-2.5*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-budget",thinkingRange:{min:0,max:24576},contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini-2*",caps:{vision:!0,audioInput:!0,videoInput:!0,search:!0,contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini*",caps:{vision:!0,search:!0,contextWindow:1048576}},{pattern:"*gemma*",caps:{vision:!0,contextWindow:128e3}},{pattern:"*nanobanana*",caps:{vision:!0,imageOutput:!0}},{pattern:"*gpt-6*image*",caps:{imageOutput:!0}},{pattern:"*gpt-6*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:105e4,maxOutput:128e3}},{pattern:"*gpt-5*image*",caps:{imageOutput:!0}},{pattern:"*gpt-5*codex*",caps:{reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:4e5,maxOutput:128e3}},{pattern:"*gpt-5.4-mini*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:4e5,maxOutput:128e3}},{pattern:"*gpt-5.4-nano*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:4e5,maxOutput:128e3}},{pattern:"*gpt-5.4*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:105e4,maxOutput:128e3}},{pattern:"*gpt-5.5*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:105e4,maxOutput:128e3}},{pattern:"*gpt-5.6*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:105e4,maxOutput:128e3}},{pattern:"*gpt-5*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:4e5,maxOutput:128e3}},{pattern:"*gpt-4o*",caps:{vision:!0,search:!0,contextWindow:128e3,maxOutput:16384}},{pattern:"*gpt-4.1*",caps:{vision:!0,contextWindow:1e6,maxOutput:32768}},{pattern:"*gpt-4-turbo*",caps:{vision:!0,contextWindow:128e3}},{pattern:"*gpt-4*",caps:{contextWindow:128e3}},{pattern:"*gpt-3.5*",caps:{contextWindow:16385,maxOutput:4096}},{pattern:"*gpt-oss*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:128e3}},{pattern:"*o1-mini*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:128e3}},{pattern:"*o1*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*o3*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*o4*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*grok*image*",caps:{imageOutput:!0}},{pattern:"*grok-code*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:256e3}},{pattern:"*grok-4.7*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:5e5,maxOutput:64e3}},{pattern:"*grok-4.6*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:5e5,maxOutput:64e3}},{pattern:"*grok-4.5*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:5e5,maxOutput:64e3}},{pattern:"*grok-4*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:256e3}},{pattern:"*grok-3*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:131072}},{pattern:"*grok*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:256e3}},{pattern:"*qwen*vl*",caps:{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:262144}},{pattern:"*qwen*omni*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:262144,maxOutput:65536}},{pattern:"*qwen*coder*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6}},{pattern:"*qwen*max*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen3.5*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen3.6*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen3.7*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen*plus*",caps:{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen*235b*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:262144}},{pattern:"*qwq*",caps:{reasoning:!0,thinkingFormat:"qwen",thinkingCanDisable:!1,contextWindow:131072}},{pattern:"*qwen*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:262144}},{pattern:"*kimi*k3*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:131072}},{pattern:"*kimi*for-coding*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:262144,maxOutput:65536}},{pattern:"*kimi*k2.7*code*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:262144,maxOutput:65536}},{pattern:"*kimi*k2*",caps:{vision:!0,reasoning:!0,thinkingFormat:"kimi",contextWindow:262144,maxOutput:262144}},{pattern:"*kimi*",caps:{reasoning:!0,thinkingFormat:"kimi",contextWindow:262144}},{pattern:"*glm-5.3*",caps:{reasoning:!0,thinkingFormat:"zai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:128e3}},{pattern:"*glm-5*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5,maxOutput:128e3}},{pattern:"*glm-4.7*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5,maxOutput:128e3}},{pattern:"*glm-4*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5}},{pattern:"*glm*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5}},{pattern:"*deepseek-v4*",caps:{reasoning:!0,thinkingFormat:"deepseek",contextWindow:1e6,maxOutput:384e3}},{pattern:"*reasoner*",caps:{reasoning:!0,thinkingFormat:"deepseek",thinkingCanDisable:!1,contextWindow:128e3}},{pattern:"*deepseek-r*",caps:{reasoning:!0,thinkingFormat:"deepseek",thinkingCanDisable:!1,contextWindow:128e3}},{pattern:"*deepseek-chat*",caps:{contextWindow:128e3}},{pattern:"*deepseek*",caps:{reasoning:!0,thinkingFormat:"deepseek",contextWindow:128e3}},{pattern:"*minimax*image*",caps:{imageOutput:!0}},{pattern:"*minimax-m3*",caps:{vision:!0,reasoning:!0,thinkingFormat:"minimax",contextWindow:1048576,maxOutput:512e3}},{pattern:"*minimax-m2.7*",caps:{reasoning:!0,thinkingFormat:"minimax",thinkingCanDisable:!1,contextWindow:204800,maxOutput:131072}},{pattern:"*minimax*",caps:{reasoning:!0,thinkingFormat:"minimax",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:131072}},{pattern:"*mimo*v2.5*",caps:{vision:!0,contextWindow:1048576,maxOutput:131072}},{pattern:"*mimo*omni*",caps:{vision:!0,audioInput:!0,contextWindow:262144,maxOutput:131072}},{pattern:"*mimo*",caps:{vision:!0,contextWindow:262144,maxOutput:131072}},{pattern:"*llama-4*",caps:{vision:!0,contextWindow:1e6}},{pattern:"*llama*",caps:{contextWindow:128e3}},{pattern:"*codestral*",caps:{contextWindow:256e3}},{pattern:"*mistral-large*",caps:{vision:!0,contextWindow:256e3}},{pattern:"*mistral*",caps:{contextWindow:128e3}},{pattern:"*command-a-vision*",caps:{vision:!0,contextWindow:128e3}},{pattern:"*command*",caps:{contextWindow:128e3}},{pattern:"*sonar*",caps:{search:!0,contextWindow:128e3}},{pattern:"*pplx*",caps:{search:!0,contextWindow:128e3}},{pattern:"*perplexity*",caps:{search:!0,contextWindow:128e3}},{pattern:"*laguna-s-2.1*free*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:32e3}},{pattern:"*laguna-s-2.1*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:32e3}},{pattern:"*laguna*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:32e3}},{pattern:"*hunyuan*",caps:{reasoning:!0,thinkingFormat:"hunyuan",contextWindow:262144,maxOutput:262144}},{pattern:"hy3*",caps:{reasoning:!0,thinkingFormat:"hunyuan",contextWindow:262144,maxOutput:262144}},{pattern:"*step-*",caps:{reasoning:!0,thinkingFormat:"step",contextWindow:128e3}},{pattern:"*nemotron*",caps:{reasoning:!0,contextWindow:128e3}},{pattern:"*ling-*",caps:{reasoning:!0,contextWindow:128e3}}];function s(a){if(!a||"object"!=typeof a)return{};let b=Array.isArray(a.modalities?.input)?a.modalities.input:[],c=Array.isArray(a.modalities?.output)?a.modalities.output:[],d=Number(a.contextWindow??a.contextLength??a.maxInputTokens??a.limit?.context),e=Number(a.maxOutput??a.maxOutputTokens??a.limit?.output),f={...b.includes("image")?{vision:!0}:{},...b.includes("pdf")?{pdf:!0}:{},...b.includes("audio")?{audioInput:!0}:{},...b.includes("video")?{videoInput:!0}:{},...c.includes("image")?{imageOutput:!0}:{},...c.includes("audio")?{audioOutput:!0}:{}};return"boolean"==typeof a.reasoning&&(f.reasoning=a.reasoning),"boolean"==typeof a.tool_call&&(f.tools=a.tool_call),"boolean"==typeof a.tools&&(f.tools=a.tools),Number.isSafeInteger(d)&&d>0&&(f.contextWindow=d),Number.isSafeInteger(e)&&e>0&&(f.maxOutput=e),f}let t={"deepseek-v4.1-flash-free":33e4},u=new Set(["deepseek/deepseek-v4-pro","deepseek/deepseek-v4-flash","deepseek/deepseek-v4-flash-fast","zai-org/glm-5.3","zai-org/glm-5.2","zai-org/glm-5.2-fast","zai-org/glm-5.1","zai-org/glm-5","minimaxai/minimax-m2.7","minimax/minimax-m2.7-free","minimaxai/minimax-m2.5","xiaomi/mimo-v2.5-pro","qwen/qwen3.6-max-preview","qwen/qwen3.7-max","meituan/longcat-2.0:free","stepfun/step-3.5-flash","tencent/hy4-preview","tencent/hy3","tencent/hy3-paid","nvidia/nemotron-3-ultra-550b-a55b","poolside/laguna-s-2.1-free","inclusionai/ling-3.0-flash-free","inclusionai/ling-3.0-flash-sante:free"]),v={"glm-5.3-flash":{vision:!0},"deepseek-v4.1-flash:1017":{vision:!0},"muse-spark-open":{vision:!0,reasoning:!0},"mimo-v2.6-pro":{reasoning:!0},"mimo-v2.6-flash":{reasoning:!0},beam:{reasoning:!0},"gemma4:31b":{reasoning:!0},"mistral-large-4":{reasoning:!0}};function w(a,b,c=null){if(!b)return{...k};let d=b.includes("/")?b.split("/").pop():b,h=c=>{let g=function(a,b,c){let d="u"<typeof globalThis?null:globalThis.__zevaiCatalogSource||null;if(!d)return c;let e={...c};if("commandcode"!==a&&"cmc"!==a){let c=d.getModalities?.(a,b);if(c)for(let a of x)!0===c[a]&&(e[a]=!0)}if(!y.has(a)&&!function(a,b){let c=q[a];if(!c)return!1;let d=b?.includes("/")?b.split("/").pop():b;return!!(c[b]||c[d])}(a,b)){let c=d.getLimits?.(a,b);c?.contextWindow>0&&(e.contextWindow=c.contextWindow),c?.maxOutput>0&&(e.maxOutput=c.maxOutput)}return e}(a,d,c),h=function(a,b,c){if("ollama"!==a)return c;let d=v[b];return d?{...c,...d.vision?{vision:!0}:{},...d.reasoning?{reasoning:!0}:{}}:c}(a,b,function(a,b,c){if("opencode"!==a&&"oc"!==a)return c;let d=c,e=t[b];return e&&d?.contextWindow>e&&(d={...d,contextWindow:e}),"mimo-v2.6-flash-free"===b&&(d={...d,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!0}),d}(a,d,g));return h?.vision||!function(a){if(!a)return!1;let b=String(a).toLowerCase();return!e.test(b)&&f.test(b)}(b)?h:{...h,vision:!0}};if("commandcode"===a||"cmc"===a){let a=q.commandcode;return a?.[b]?h({...k,...a[b],...s(c)}):a?.[d]?h({...k,...a[d],...s(c)}):h({...k,reasoning:!0,thinkingFormat:"commandcode",thinkingEffortSupported:!0,vision:!function(a){let b=String(a||"").toLowerCase();if(u.has(b))return!0;for(let a of u){let c=a.includes("/")?a.slice(a.lastIndexOf("/")+1):a;if(b===c||b.endsWith("/"+c))return!0}return!1}(b),contextWindow:1e6,maxOutput:384e3,...s(c)})}if((0,g.ui)(a)){let a=(0,g.wu)(d);if(a)return h({...k,...s(a),thinkingFormat:"gemini-level",...s(c)})}if(a){let e=q[a]||("oc"===a?q.opencode:null)||("ocz"===a?q["opencode-zen"]:null)||("ch"===a?q.chutes:null)||("pa"===a?q["perplexity-agent"]:null)||("samba"===a?q.sambanova:null)||("nvb"===a?q["nvidia-build"]:null);if(e?.[b])return h({...k,...e[b],...s(c)});if(e?.[d])return h({...k,...e[d],...s(c)})}if(l[d])return h({...k,...l[d],...s(c)});if(l[b])return h({...k,...l[b],...s(c)});for(let{pattern:a,caps:e}of r)if(j(a,d)||j(a,b))return h({...k,...e,...s(c)});return h({...k,...s(c)})}let x=["vision","pdf","audioInput","videoInput"],y=new Set(["codex","kiro","opencode-go","ocg","commandcode","cmc"]);function z(a){return/(?:^|\/)gemini-4(?:$|[-.])/i.test(String(a||""))}},64371:(a,b,c)=>{"use strict";let d,e=c(34589),{runtimeFeatures:f}=c(56758),{asciiLowercase:g}=c(70745),h=new Map([["sha256",0],["sha384",1],["sha512",2]]);if(f.has("crypto")){let a=(d=c(77598)).getHashes();for(let b of(0===a.length&&h.clear(),h.keys()))!1===a.includes(b)&&h.delete(b)}else h.clear();let i=Map.prototype.get.bind(h),j=a=>h.has(g(a)),k=!1===f.has("crypto")||0===h.size?()=>!0:(a,b)=>{let c=m(b);if(0===c.length)return!0;for(let b of l(c)){let c=b.alg,d=b.val;if(o(n(c,a),d))return!0}return!1};function l(a){let b=[],c=null;for(let d of a){if(e(j(d.alg),"Invalid SRI hash algorithm token"),0===b.length){b.push(d),c=d;continue}let a=i(c.alg),f=i(d.alg);f<a||(f>a?(c=d,b[0]=d,b.length=1):b.push(d))}return b}function m(a){let b=[];for(let c of a.split(" ")){let a=c.split("?",1)[0],d="",e=[a.slice(0,6),a.slice(7)],f=e[0];if(!j(f))continue;e[1]&&(d=e[1]);let h={alg:g(f),val:d};b.push(h)}return b}let n=(a,b)=>d.hash(a,b,"base64");function o(a,b){let c=a.length;0!==c&&"="===a[c-1]&&(c-=1),0!==c&&"="===a[c-1]&&(c-=1);let d=b.length;if(0!==d&&"="===b[d-1]&&(d-=1),0!==d&&"="===b[d-1]&&(d-=1),c!==d)return!1;for(let d=0;d<c;++d)if(a[d]!==b[d]&&("+"!==a[d]||"-"!==b[d])&&("/"!==a[d]||"_"!==b[d]))return!1;return!0}a.exports={applyAlgorithmToBytes:n,bytesMatch:k,caseSensitiveMatch:o,isValidSRIHashAlgorithm:j,getStrongestMetadata:l,parseMetadata:m}},64375:(a,b,c)=>{"use strict";function d(a){let b=Number(a);return!b||b<=0?null:b<=768?"minimal":b<=4096?"low":b<=16384?"medium":b<=28672?"high":b<=80384?"xhigh":"max"}c.d(b,{v:()=>d})},64704:a=>{"use strict";let b,c=0,d=Symbol("kFastTimer"),e=[];function f(){c+=499;let a=0,b=e.length;for(;a<b;){let d=e[a];0===d._state?(d._idleStart=c-499,d._state=1):1===d._state&&c>=d._idleStart+d._idleTimeout&&(d._state=-1,d._idleStart=-1,d._onTimeout(d._timerArg)),-1===d._state?(d._state=-2,0!=--b&&(e[a]=e[b])):++a}e.length=b,0!==e.length&&g()}function g(){b?.refresh?b.refresh():(clearTimeout(b),b=setTimeout(f,499),b?.unref())}class h{[d]=!0;_state=-2;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(a,b,c){this._onTimeout=a,this._idleTimeout=b,this._timerArg=c,this.refresh()}refresh(){-2===this._state&&e.push(this),b&&1!==e.length||g(),this._state=0}clear(){this._state=-1,this._idleStart=-1}}a.exports={setTimeout:(a,b,c)=>b<=1e3?setTimeout(a,b,c):new h(a,b,c),clearTimeout(a){a[d]?a.clear():clearTimeout(a)},setFastTimeout:(a,b,c)=>new h(a,b,c),clearFastTimeout(a){a.clear()},now:()=>c,tick(a=0){c+=a-1e3+1,f(),f()},reset(){c=0,e.length=0,clearTimeout(b),b=null},kFastTimer:d}},64821:(a,b,c)=>{"use strict";let{Writable:d}=c(57075),e=c(34589),{parserStates:f,opcodes:g,states:h,emptyBuffer:i,sentCloseFrameState:j}=c(62026),{isValidStatusCode:k,isValidOpcode:l,websocketMessageReceived:m,utf8Decode:n,isControlFrame:o,isTextBinaryFrame:p,isContinuationFrame:q}=c(94050),{failWebsocketConnection:r}=c(4654),{WebsocketFrameSend:s}=c(45221),{PerMessageDeflate:t}=c(97210),{MessageSizeExceededError:u}=c(61448),{defaultWebSocketMaxFragments:v,defaultWebSocketMaxPayloadSize:w}=c(28820);class x extends d{#ca=[];#cb=0;#cc=0;#cd=!1;#a=f.INFO;#ce={};#cf=[];#bY;#a$;#cg;#ch;constructor(a,b,c={}){super(),this.#a$=a,this.#bY=null==b?new Map:b,this.#cg=c.maxFragments??v,this.#ch=c.maxPayloadSize??w,this.#bY.has("permessage-deflate")&&this.#bY.set("permessage-deflate",new t(b,{maxPayloadSize:this.#ch}))}_write(a,b,c){this.#ca.push(a),this.#cc+=a.length,this.#cd=!0,this.run(c)}#ci(){return!(this.#ch>0)||!!o(this.#ce.opcode)||!(this.#ce.payloadLength+this.#cb>this.#ch)||(r(this.#a$,1009,"Payload size exceeds maximum allowed size"),!1)}run(a){for(;this.#cd;)if(this.#a===f.INFO){if(this.#cc<2)return a();let b=this.consume(2),c=(128&b[0])!=0,d=15&b[0],e=(128&b[1])==128,h=!c&&d!==g.CONTINUATION,i=127&b[1],j=64&b[0],k=32&b[0],m=16&b[0];if(!l(d))return r(this.#a$,1002,"Invalid opcode received"),a();if(e)return r(this.#a$,1002,"Frame cannot be masked"),a();if(0!==j&&!this.#bY.has("permessage-deflate"))return void r(this.#a$,1002,"Expected RSV1 to be clear.");if(0!==k||0!==m)return void r(this.#a$,1002,"RSV1, RSV2, RSV3 must be clear");if(h&&!p(d))return void r(this.#a$,1002,"Invalid frame type was fragmented.");if(p(d)&&this.#cf.length>0)return void r(this.#a$,1002,"Expected continuation frame");if(this.#ce.fragmented&&h)return void r(this.#a$,1002,"Fragmented frame exceeded 125 bytes.");if((i>125||h)&&o(d))return void r(this.#a$,1002,"Control frame either too large or fragmented");if(q(d)&&0===this.#cf.length&&!this.#ce.compressed)return void r(this.#a$,1002,"Unexpected continuation frame");if(i<=125){if(this.#ce.payloadLength=i,this.#a=f.READ_DATA,!this.#ci())return}else 126===i?this.#a=f.PAYLOADLENGTH_16:127===i&&(this.#a=f.PAYLOADLENGTH_64);p(d)&&(this.#ce.binaryType=d,this.#ce.compressed=0!==j),this.#ce.opcode=d,this.#ce.masked=e,this.#ce.fin=c,this.#ce.fragmented=h}else if(this.#a===f.PAYLOADLENGTH_16){if(this.#cc<2)return a();let b=this.consume(2);if(this.#ce.payloadLength=b.readUInt16BE(0),this.#a=f.READ_DATA,!this.#ci())return}else if(this.#a===f.PAYLOADLENGTH_64){if(this.#cc<8)return a();let b=this.consume(8),c=b.readUInt32BE(0),d=b.readUInt32BE(4);if(0!==c||d>0x7fffffff)return void r(this.#a$,1009,"Received payload length > 2^31 bytes.");if(this.#ce.payloadLength=d,this.#a=f.READ_DATA,!this.#ci())return}else if(this.#a===f.READ_DATA){if(this.#cc<this.#ce.payloadLength)return a();let b=this.consume(this.#ce.payloadLength);if(o(this.#ce.opcode)){if(this.#cd=this.parseControlFrame(b),this.#a=f.INFO,this.#cd&&this.#a$.socket.writableNeedDrain){this.#cd=!1,this.#a$.socket.once("drain",()=>{this.destroyed||(this.#cd=!0,this.run(a))});return}}else if(this.#ce.compressed){this.#bY.get("permessage-deflate").decompress(b,this.#ce.fin,(b,c)=>{if(b){let a=b instanceof u?1009:1007;r(this.#a$,a,b.message);return}if(this.writeFragments(c)){if(this.#ch>0&&this.#cb>this.#ch)return void r(this.#a$,1009,new u().message);if(!this.#ce.fin){this.#a=f.INFO,this.#cd=!0,this.run(a);return}m(this.#a$,this.#ce.binaryType,this.consumeFragments()),this.#cd=!0,this.#a=f.INFO,this.run(a)}},this.#cb),this.#cd=!1;break}else{if(!this.writeFragments(b))return;!this.#ce.fragmented&&this.#ce.fin&&m(this.#a$,this.#ce.binaryType,this.consumeFragments()),this.#a=f.INFO}}}consume(a){if(a>this.#cc)throw Error("Called consume() before buffers satiated.");if(0===a)return i;this.#cc-=a;let b=this.#ca[0];if(b.length>a)return this.#ca[0]=b.subarray(a,b.length),b.subarray(0,a);{if(b.length===a)return this.#ca.shift();let c=0,d=Buffer.allocUnsafeSlow(a);for(;c!==a;){let b=this.#ca[0],e=b.length;if(e+c===a){d.set(this.#ca.shift(),c);break}if(e+c>a){d.set(b.subarray(0,a-c),c),this.#ca[0]=b.subarray(a-c);break}d.set(this.#ca.shift(),c),c+=e}return d}}writeFragments(a){return this.#cg>0&&this.#cf.length===this.#cg?(r(this.#a$,1008,"Too many message fragments"),!1):(this.#cb+=a.length,this.#cf.push(a),!0)}consumeFragments(){let a=this.#cf;if(this.#ce.compressed=!1,1===a.length)return this.#cb=0,a.shift();let b=0,c=Buffer.allocUnsafeSlow(this.#cb);for(let d=0;d<a.length;++d){let e=a[d];c.set(e,b),b+=e.length}return this.#cf=[],this.#cb=0,c}parseCloseBody(a){let b;if(e(1!==a.length),a.length>=2&&(b=a.readUInt16BE(0)),void 0!==b&&!k(b))return{code:1002,reason:"Invalid status code",error:!0};let c=a.subarray(2);239===c[0]&&187===c[1]&&191===c[2]&&(c=c.subarray(3));try{c=n(c)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:b,reason:c,error:!1}}parseControlFrame(a){let{opcode:b,payloadLength:c}=this.#ce;if(b===g.CLOSE){if(1===c)return r(this.#a$,1002,"Received close frame with a 1-byte body."),!1;if(this.#ce.closeInfo=this.parseCloseBody(a),this.#ce.closeInfo.error){let{code:a,reason:b}=this.#ce.closeInfo;return r(this.#a$,a,b),!1}if(!this.#a$.closeState.has(j.SENT)&&!this.#a$.closeState.has(j.RECEIVED)){let a=i;this.#ce.closeInfo.code&&(a=Buffer.allocUnsafe(2)).writeUInt16BE(this.#ce.closeInfo.code,0);let b=new s(a);this.#a$.socket.write(b.createFrame(g.CLOSE)),this.#a$.closeState.add(j.SENT)}return this.#a$.readyState=h.CLOSING,this.#a$.closeState.add(j.RECEIVED),!1}if(b===g.PING){if(!this.#a$.closeState.has(j.RECEIVED)){let b=new s(a);this.#a$.socket.write(b.createFrame(g.PONG)),this.#a$.onPing(a)}}else b===g.PONG&&this.#a$.onPong(a);return!0}get closingInfo(){return this.#ce.closeInfo}}a.exports={ByteParser:x}},65294:(a,b,c)=>{"use strict";c.d(b,{x:()=>h});var d=c(69762),e=c(42541),f=c(90943);function g(a,b,c=null){return{id:a.responseId,object:"chat.completion.chunk",created:a.created,model:a.model,choices:[{index:0,delta:b,finish_reason:c}]}}function h(a,b){var c;if(!a)return null;if(a&&"object"==typeof a&&"chat.completion.chunk"===a.object)return a;let d=a;if("string"==typeof a){let b=a.trim();if(!b)return null;let c=b.startsWith("data:")?b.slice(5).trim():b;if(!c||"[DONE]"===c)return null;try{d=JSON.parse(c)}catch{return null}}if(!d||"object"!=typeof d||!d.type)return null;c=d.model,b.responseId||(b.responseId=`chatcmpl-${Date.now()}`,b.created=Math.floor(Date.now()/1e3),b.model=b.model||c||"commandcode",b.chunkIndex=0,b.toolIndex=0,b.toolIndexById=new Map,b.openTools=new Set,b.openText=!1,b.finishReason=null,b.finishReasonSent=!1,b.usage=null);let h=[];switch(d.type){case"text-delta":{let a=d.text||d.delta||"";if(!a)break;let c=0===b.chunkIndex?{role:"assistant",content:a}:{content:a};b.chunkIndex++,b.openText=!0,h.push(g(b,c));break}case"reasoning-delta":{let a=d.text||"";if(!a)break;let c=0===b.chunkIndex?{role:"assistant",reasoning_content:a}:{reasoning_content:a};b.chunkIndex++,h.push(g(b,c));break}case"tool-input-start":{let a=d.id||d.toolCallId||`call_${Date.now()}_${b.toolIndex}`,c=b.toolIndexById.get(a);null==c&&(c=b.toolIndex++,b.toolIndexById.set(a,c)),b.openTools.add(a);let e={...0===b.chunkIndex?{role:"assistant"}:{},tool_calls:[{index:c,id:a,type:"function",function:{name:d.toolName||"",arguments:""}}]};b.chunkIndex++,h.push(g(b,e));break}case"tool-input-delta":{let a=d.id||d.toolCallId,c=b.toolIndexById.get(a);if(null==c)break;let e={tool_calls:[{index:c,function:{arguments:d.delta||d.inputTextDelta||""}}]};h.push(g(b,e));break}case"tool-call":{let a=d.toolCallId;if(b.toolIndexById.has(a))break;let c=b.toolIndex++;b.toolIndexById.set(a,c);let e="string"==typeof d.input?d.input:JSON.stringify(d.input??{}),f={...0===b.chunkIndex?{role:"assistant"}:{},tool_calls:[{index:c,id:a,type:"function",function:{name:d.toolName||"",arguments:e}}]};b.chunkIndex++,h.push(g(b,f));break}case"finish-step":b.finishReason=(0,f.Jm)(d.finishReason,{format:e.h.COMMANDCODE,hasToolCalls:b.toolIndex>0}),d.usage&&(b.usage=d.usage);break;case"finish":{if(b.finishReasonSent)break;let a=b.finishReason||(0,f.Jm)(d.finishReason,{format:e.h.COMMANDCODE,hasToolCalls:b.toolIndex>0}),c=g(b,{},a),i=d.totalUsage||b.usage;i&&(c.usage={prompt_tokens:i.inputTokens??0,completion_tokens:i.outputTokens??0,total_tokens:i.totalTokens??(i.inputTokens??0)+(i.outputTokens??0)}),b.finishReasonSent=!0,h.push(c);break}case"error":{b.finishReason="stop";let a=d.error??d.message??"unknown",c="string"==typeof a?a:JSON.stringify(a);h.push(g(b,{content:`
478
478
 
479
479
  [CommandCode error: ${c}]`})),b.finishReasonSent||(b.finishReasonSent=!0,h.push(g(b,{},"stop")))}}return h.length?h:null}(0,d.kz)(e.h.COMMANDCODE,e.h.OPENAI,null,h)},65333:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{SB:()=>T});var e=c(18936),f=c(24524),g=c(84955),h=c(3338),i=c(24644),j=c(34210),k=c(73770),l=c(59011),m=c(28477),n=c(12529),o=c(50294),p=c(80328),q=c(60083),r=c(120),s=c(16608),t=c(64304),u=c(44991),v=c(69881),w=c(22409),x=c(94231),y=c(17371),z=c(91358),A=c(38810),B=c(59067),C=c(88164),D=c(67911),E=c(74760),F=c(28639),G=c(91492),H=c(84269),I=c(80437),J=c(54940),K=c(77306),L=c(60426),M=c(24928),N=c(65689),O=c(74262),P=c(31318),Q=c(42805),R=c(46870);c(69384);var S=a([m]);m=(S.then?(await S)():S)[0];let U=new R.kF,V={antigravity:new e.cV,azure:new f.P,"gemini-cli":new g.V,github:new h.x,iflow:new i.r,qoder:new j.DH,"qoder-cn":new j.DH("qoder-cn"),kiro:new k.Br,codex:new l.T,cursor:new m.o,cu:new m.o,vertex:new n.w("vertex"),"vertex-partner":new n.w("vertex-partner"),qwen:new o.R,opencode:new p.j9,"opencode-go":new q.H_,"opencode-zen":new r.mO,"grok-web":new s.$,"perplexity-web":new t.Ay,"ollama-local":new u.D,commandcode:new v.Ak,"xiaomi-tokenplan":new w.F,"xiaomi-mimo":new x.R,autoclaw:new y.q,"codebuddy-cn":new z.K,kimchi:new A.BL,"grok-cli":new B.hG,bedrock:new D.UD("bedrock"),"bedrock-xai":new D.UD("bedrock-xai"),gcli:new B.hG,"codebuddy-intl":new E.m,trae:new F.A,zed:new G.A,windsurf:new H.Ay,"minimax-code":new I.M("minimax-code"),"minimax-code-global":new I.M("minimax-code-global"),"devin-cli":new J.c,"chatgpt-web":new K.RF,"deepseek-web":new L.id,"gemini-web":new M.dQ,"muse-web":new N._5,"veoaifree-web":new O.Q,"veo-free":new O.Q,"uc-web":new P.sh,"nvidia-build":new Q.n,nvb:new Q.n,aistudio:U,ais:U},W=new Map;function T(a){return V[a]?V[a]:(W.has(a)||W.set(a,new C.L(a)),W.get(a))}d()}catch(a){d(a)}})},65429:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.SPECIAL_HEADERS=b.MINOR=b.MAJOR=b.HTAB_SP_VCHAR_OBS_TEXT=b.QUOTED_STRING=b.CONNECTION_TOKEN_CHARS=b.HEADER_CHARS=b.TOKEN=b.HEX=b.URL_CHAR=b.USERINFO_CHARS=b.MARK=b.ALPHANUM=b.NUM=b.HEX_MAP=b.NUM_MAP=b.ALPHA=b.STATUSES_HTTP=b.H_METHOD_MAP=b.METHOD_MAP=b.METHODS_RTSP=b.METHODS_ICE=b.METHODS_HTTP=b.HEADER_STATE=b.FINISH=b.STATUSES=b.METHODS=b.LENIENT_FLAGS=b.FLAGS=b.TYPE=b.ERROR=void 0;let d=c(33629);b.ERROR={OK:0,INTERNAL:1,STRICT:2,CR_EXPECTED:25,LF_EXPECTED:3,UNEXPECTED_CONTENT_LENGTH:4,UNEXPECTED_SPACE:30,CLOSED_CONNECTION:5,INVALID_METHOD:6,INVALID_URL:7,INVALID_CONSTANT:8,INVALID_VERSION:9,INVALID_HEADER_TOKEN:10,INVALID_CONTENT_LENGTH:11,INVALID_CHUNK_SIZE:12,INVALID_STATUS:13,INVALID_EOF_STATE:14,INVALID_TRANSFER_ENCODING:15,CB_MESSAGE_BEGIN:16,CB_HEADERS_COMPLETE:17,CB_MESSAGE_COMPLETE:18,CB_CHUNK_HEADER:19,CB_CHUNK_COMPLETE:20,PAUSED:21,PAUSED_UPGRADE:22,PAUSED_H2_UPGRADE:23,USER:24,CB_URL_COMPLETE:26,CB_STATUS_COMPLETE:27,CB_METHOD_COMPLETE:32,CB_VERSION_COMPLETE:33,CB_HEADER_FIELD_COMPLETE:28,CB_HEADER_VALUE_COMPLETE:29,CB_CHUNK_EXTENSION_NAME_COMPLETE:34,CB_CHUNK_EXTENSION_VALUE_COMPLETE:35,CB_RESET:31,CB_PROTOCOL_COMPLETE:38},b.TYPE={BOTH:0,REQUEST:1,RESPONSE:2},b.FLAGS={CONNECTION_KEEP_ALIVE:1,CONNECTION_CLOSE:2,CONNECTION_UPGRADE:4,CHUNKED:8,UPGRADE:16,CONTENT_LENGTH:32,SKIPBODY:64,TRAILING:128,TRANSFER_ENCODING:512},b.LENIENT_FLAGS={HEADERS:1,CHUNKED_LENGTH:2,KEEP_ALIVE:4,TRANSFER_ENCODING:8,VERSION:16,DATA_AFTER_CLOSE:32,OPTIONAL_LF_AFTER_CR:64,OPTIONAL_CRLF_AFTER_CHUNK:128,OPTIONAL_CR_BEFORE_LF:256,SPACES_AFTER_CHUNK_SIZE:512},b.METHODS={DELETE:0,GET:1,HEAD:2,POST:3,PUT:4,CONNECT:5,OPTIONS:6,TRACE:7,COPY:8,LOCK:9,MKCOL:10,MOVE:11,PROPFIND:12,PROPPATCH:13,SEARCH:14,UNLOCK:15,BIND:16,REBIND:17,UNBIND:18,ACL:19,REPORT:20,MKACTIVITY:21,CHECKOUT:22,MERGE:23,"M-SEARCH":24,NOTIFY:25,SUBSCRIBE:26,UNSUBSCRIBE:27,PATCH:28,PURGE:29,MKCALENDAR:30,LINK:31,UNLINK:32,SOURCE:33,PRI:34,DESCRIBE:35,ANNOUNCE:36,SETUP:37,PLAY:38,PAUSE:39,TEARDOWN:40,GET_PARAMETER:41,SET_PARAMETER:42,REDIRECT:43,RECORD:44,FLUSH:45,QUERY:46},b.STATUSES={CONTINUE:100,SWITCHING_PROTOCOLS:101,PROCESSING:102,EARLY_HINTS:103,RESPONSE_IS_STALE:110,REVALIDATION_FAILED:111,DISCONNECTED_OPERATION:112,HEURISTIC_EXPIRATION:113,MISCELLANEOUS_WARNING:199,OK:200,CREATED:201,ACCEPTED:202,NON_AUTHORITATIVE_INFORMATION:203,NO_CONTENT:204,RESET_CONTENT:205,PARTIAL_CONTENT:206,MULTI_STATUS:207,ALREADY_REPORTED:208,TRANSFORMATION_APPLIED:214,IM_USED:226,MISCELLANEOUS_PERSISTENT_WARNING:299,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,USE_PROXY:305,SWITCH_PROXY:306,TEMPORARY_REDIRECT:307,PERMANENT_REDIRECT:308,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,IM_A_TEAPOT:418,PAGE_EXPIRED:419,ENHANCE_YOUR_CALM:420,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL:430,REQUEST_HEADER_FIELDS_TOO_LARGE:431,LOGIN_TIMEOUT:440,NO_RESPONSE:444,RETRY_WITH:449,BLOCKED_BY_PARENTAL_CONTROL:450,UNAVAILABLE_FOR_LEGAL_REASONS:451,CLIENT_CLOSED_LOAD_BALANCED_REQUEST:460,INVALID_X_FORWARDED_FOR:463,REQUEST_HEADER_TOO_LARGE:494,SSL_CERTIFICATE_ERROR:495,SSL_CERTIFICATE_REQUIRED:496,HTTP_REQUEST_SENT_TO_HTTPS_PORT:497,INVALID_TOKEN:498,CLIENT_CLOSED_REQUEST:499,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,BANDWIDTH_LIMIT_EXCEEDED:509,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511,WEB_SERVER_UNKNOWN_ERROR:520,WEB_SERVER_IS_DOWN:521,CONNECTION_TIMEOUT:522,ORIGIN_IS_UNREACHABLE:523,TIMEOUT_OCCURED:524,SSL_HANDSHAKE_FAILED:525,INVALID_SSL_CERTIFICATE:526,RAILGUN_ERROR:527,SITE_IS_OVERLOADED:529,SITE_IS_FROZEN:530,IDENTITY_PROVIDER_AUTHENTICATION_ERROR:561,NETWORK_READ_TIMEOUT:598,NETWORK_CONNECT_TIMEOUT:599},b.FINISH={SAFE:0,SAFE_WITH_CB:1,UNSAFE:2},b.HEADER_STATE={GENERAL:0,CONNECTION:1,CONTENT_LENGTH:2,TRANSFER_ENCODING:3,UPGRADE:4,CONNECTION_KEEP_ALIVE:5,CONNECTION_CLOSE:6,CONNECTION_UPGRADE:7,TRANSFER_ENCODING_CHUNKED:8},b.METHODS_HTTP=[b.METHODS.DELETE,b.METHODS.GET,b.METHODS.HEAD,b.METHODS.POST,b.METHODS.PUT,b.METHODS.CONNECT,b.METHODS.OPTIONS,b.METHODS.TRACE,b.METHODS.COPY,b.METHODS.LOCK,b.METHODS.MKCOL,b.METHODS.MOVE,b.METHODS.PROPFIND,b.METHODS.PROPPATCH,b.METHODS.SEARCH,b.METHODS.UNLOCK,b.METHODS.BIND,b.METHODS.REBIND,b.METHODS.UNBIND,b.METHODS.ACL,b.METHODS.REPORT,b.METHODS.MKACTIVITY,b.METHODS.CHECKOUT,b.METHODS.MERGE,b.METHODS["M-SEARCH"],b.METHODS.NOTIFY,b.METHODS.SUBSCRIBE,b.METHODS.UNSUBSCRIBE,b.METHODS.PATCH,b.METHODS.PURGE,b.METHODS.MKCALENDAR,b.METHODS.LINK,b.METHODS.UNLINK,b.METHODS.PRI,b.METHODS.SOURCE,b.METHODS.QUERY],b.METHODS_ICE=[b.METHODS.SOURCE],b.METHODS_RTSP=[b.METHODS.OPTIONS,b.METHODS.DESCRIBE,b.METHODS.ANNOUNCE,b.METHODS.SETUP,b.METHODS.PLAY,b.METHODS.PAUSE,b.METHODS.TEARDOWN,b.METHODS.GET_PARAMETER,b.METHODS.SET_PARAMETER,b.METHODS.REDIRECT,b.METHODS.RECORD,b.METHODS.FLUSH,b.METHODS.GET,b.METHODS.POST],b.METHOD_MAP=(0,d.enumToMap)(b.METHODS),b.H_METHOD_MAP=Object.fromEntries(Object.entries(b.METHODS).filter(([a])=>a.startsWith("H"))),b.STATUSES_HTTP=[b.STATUSES.CONTINUE,b.STATUSES.SWITCHING_PROTOCOLS,b.STATUSES.PROCESSING,b.STATUSES.EARLY_HINTS,b.STATUSES.RESPONSE_IS_STALE,b.STATUSES.REVALIDATION_FAILED,b.STATUSES.DISCONNECTED_OPERATION,b.STATUSES.HEURISTIC_EXPIRATION,b.STATUSES.MISCELLANEOUS_WARNING,b.STATUSES.OK,b.STATUSES.CREATED,b.STATUSES.ACCEPTED,b.STATUSES.NON_AUTHORITATIVE_INFORMATION,b.STATUSES.NO_CONTENT,b.STATUSES.RESET_CONTENT,b.STATUSES.PARTIAL_CONTENT,b.STATUSES.MULTI_STATUS,b.STATUSES.ALREADY_REPORTED,b.STATUSES.TRANSFORMATION_APPLIED,b.STATUSES.IM_USED,b.STATUSES.MISCELLANEOUS_PERSISTENT_WARNING,b.STATUSES.MULTIPLE_CHOICES,b.STATUSES.MOVED_PERMANENTLY,b.STATUSES.FOUND,b.STATUSES.SEE_OTHER,b.STATUSES.NOT_MODIFIED,b.STATUSES.USE_PROXY,b.STATUSES.SWITCH_PROXY,b.STATUSES.TEMPORARY_REDIRECT,b.STATUSES.PERMANENT_REDIRECT,b.STATUSES.BAD_REQUEST,b.STATUSES.UNAUTHORIZED,b.STATUSES.PAYMENT_REQUIRED,b.STATUSES.FORBIDDEN,b.STATUSES.NOT_FOUND,b.STATUSES.METHOD_NOT_ALLOWED,b.STATUSES.NOT_ACCEPTABLE,b.STATUSES.PROXY_AUTHENTICATION_REQUIRED,b.STATUSES.REQUEST_TIMEOUT,b.STATUSES.CONFLICT,b.STATUSES.GONE,b.STATUSES.LENGTH_REQUIRED,b.STATUSES.PRECONDITION_FAILED,b.STATUSES.PAYLOAD_TOO_LARGE,b.STATUSES.URI_TOO_LONG,b.STATUSES.UNSUPPORTED_MEDIA_TYPE,b.STATUSES.RANGE_NOT_SATISFIABLE,b.STATUSES.EXPECTATION_FAILED,b.STATUSES.IM_A_TEAPOT,b.STATUSES.PAGE_EXPIRED,b.STATUSES.ENHANCE_YOUR_CALM,b.STATUSES.MISDIRECTED_REQUEST,b.STATUSES.UNPROCESSABLE_ENTITY,b.STATUSES.LOCKED,b.STATUSES.FAILED_DEPENDENCY,b.STATUSES.TOO_EARLY,b.STATUSES.UPGRADE_REQUIRED,b.STATUSES.PRECONDITION_REQUIRED,b.STATUSES.TOO_MANY_REQUESTS,b.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL,b.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE,b.STATUSES.LOGIN_TIMEOUT,b.STATUSES.NO_RESPONSE,b.STATUSES.RETRY_WITH,b.STATUSES.BLOCKED_BY_PARENTAL_CONTROL,b.STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS,b.STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST,b.STATUSES.INVALID_X_FORWARDED_FOR,b.STATUSES.REQUEST_HEADER_TOO_LARGE,b.STATUSES.SSL_CERTIFICATE_ERROR,b.STATUSES.SSL_CERTIFICATE_REQUIRED,b.STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT,b.STATUSES.INVALID_TOKEN,b.STATUSES.CLIENT_CLOSED_REQUEST,b.STATUSES.INTERNAL_SERVER_ERROR,b.STATUSES.NOT_IMPLEMENTED,b.STATUSES.BAD_GATEWAY,b.STATUSES.SERVICE_UNAVAILABLE,b.STATUSES.GATEWAY_TIMEOUT,b.STATUSES.HTTP_VERSION_NOT_SUPPORTED,b.STATUSES.VARIANT_ALSO_NEGOTIATES,b.STATUSES.INSUFFICIENT_STORAGE,b.STATUSES.LOOP_DETECTED,b.STATUSES.BANDWIDTH_LIMIT_EXCEEDED,b.STATUSES.NOT_EXTENDED,b.STATUSES.NETWORK_AUTHENTICATION_REQUIRED,b.STATUSES.WEB_SERVER_UNKNOWN_ERROR,b.STATUSES.WEB_SERVER_IS_DOWN,b.STATUSES.CONNECTION_TIMEOUT,b.STATUSES.ORIGIN_IS_UNREACHABLE,b.STATUSES.TIMEOUT_OCCURED,b.STATUSES.SSL_HANDSHAKE_FAILED,b.STATUSES.INVALID_SSL_CERTIFICATE,b.STATUSES.RAILGUN_ERROR,b.STATUSES.SITE_IS_OVERLOADED,b.STATUSES.SITE_IS_FROZEN,b.STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR,b.STATUSES.NETWORK_READ_TIMEOUT,b.STATUSES.NETWORK_CONNECT_TIMEOUT],b.ALPHA=[];for(let a=65;a<=90;a++)b.ALPHA.push(String.fromCharCode(a)),b.ALPHA.push(String.fromCharCode(a+32));b.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9},b.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},b.NUM=["0","1","2","3","4","5","6","7","8","9"],b.ALPHANUM=b.ALPHA.concat(b.NUM),b.MARK=["-","_",".","!","~","*","'","(",")"],b.USERINFO_CHARS=b.ALPHANUM.concat(b.MARK).concat(["%",";",":","&","=","+","$",","]),b.URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(b.ALPHANUM),b.HEX=b.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]),b.TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(b.ALPHANUM),b.HEADER_CHARS=[" "];for(let a=32;a<=255;a++)127!==a&&b.HEADER_CHARS.push(a);b.CONNECTION_TOKEN_CHARS=b.HEADER_CHARS.filter(a=>44!==a),b.QUOTED_STRING=[" "," "];for(let a=33;a<=255;a++)34!==a&&92!==a&&b.QUOTED_STRING.push(a);b.HTAB_SP_VCHAR_OBS_TEXT=[" "," "];for(let a=33;a<=126;a++)b.HTAB_SP_VCHAR_OBS_TEXT.push(a);for(let a=128;a<=255;a++)b.HTAB_SP_VCHAR_OBS_TEXT.push(a);b.MAJOR=b.NUM_MAP,b.MINOR=b.MAJOR,b.SPECIAL_HEADERS={connection:b.HEADER_STATE.CONNECTION,"content-length":b.HEADER_STATE.CONTENT_LENGTH,"proxy-connection":b.HEADER_STATE.CONNECTION,"transfer-encoding":b.HEADER_STATE.TRANSFER_ENCODING,upgrade:b.HEADER_STATE.UPGRADE},b.default={ERROR:b.ERROR,TYPE:b.TYPE,FLAGS:b.FLAGS,LENIENT_FLAGS:b.LENIENT_FLAGS,METHODS:b.METHODS,STATUSES:b.STATUSES,FINISH:b.FINISH,HEADER_STATE:b.HEADER_STATE,ALPHA:b.ALPHA,NUM_MAP:b.NUM_MAP,HEX_MAP:b.HEX_MAP,NUM:b.NUM,ALPHANUM:b.ALPHANUM,MARK:b.MARK,USERINFO_CHARS:b.USERINFO_CHARS,URL_CHAR:b.URL_CHAR,HEX:b.HEX,TOKEN:b.TOKEN,HEADER_CHARS:b.HEADER_CHARS,CONNECTION_TOKEN_CHARS:b.CONNECTION_TOKEN_CHARS,QUOTED_STRING:b.QUOTED_STRING,HTAB_SP_VCHAR_OBS_TEXT:b.HTAB_SP_VCHAR_OBS_TEXT,MAJOR:b.MAJOR,MINOR:b.MINOR,SPECIAL_HEADERS:b.SPECIAL_HEADERS,METHODS_HTTP:b.METHODS_HTTP,METHODS_ICE:b.METHODS_ICE,METHODS_RTSP:b.METHODS_RTSP,METHOD_MAP:b.METHOD_MAP,H_METHOD_MAP:b.H_METHOD_MAP,STATUSES_HTTP:b.STATUSES_HTTP}},65556:(a,b,c)=>{"use strict";c.d(b,{$G:()=>g,bf:()=>e,n6:()=>f,xr:()=>d});let d="EpwGCkYIChgCKkCzVUuRrg7CcglSUWEef4rH6o35g9UYS8ZPe0/VomQTBsFx6sttYNj5l8GqgW6ejuHyYqpFToxIbZl0bw17l5dJEgzCnqDO0Z8fRlMrNgsaDLS1cnCjC53KBqE0CCIwAADQdo1eO+7qPAmo8J4WR3JPmr92S97kmvr5K1iPMiOpkZNj8mEXW8uzBoOJs/9ZKoMFiqHJ3UObwaJDqFOW70E9oCwDoc6jesaWVAEdN5vWfKMpIkjFJjECdjIdkxyJNJ8Ib8yXVal3qwE7uThoPRqSZDdHB5mmwPEjWE/90cSYCbtX2YsJki1265CabBb8/QEkODXg4kgRrL+c8e8rRXz/dr1RswvaPuzEdGKHRNi9UooNUeOK4/ebx1KkP9YZttyohN9GWqlts36kOoW0Cfie/ABDgF9g534BPth/sstxDM6d79QlRmh6NxizyTF74DXJI34u0M4tTRchqE5pAq85SgdJaa+dix1yJPMji8m6nZkwJbscJb9rdc2MKyKWjz8QL2+rTSSuZ2F1k1qSsW0xNcI7qLcI12Vncfn/VqY6YOIZy/saZBR0ezXvN6g+UYbuIdyVg7AyIFZt3nbrO7/kmOEb2VKzygwklHGEIJHfFgMpH3JSrAzbZIowVHOF7VaJ+KXRFDCFin7hHTOiOsdg+1ij1mML9Z/x/9CP4b7OUcaQm1llDZPSHc6rZMNL3DdB+fW5YfmNgKU35S+7AMtA10nVILzDAk1UV4T2K9Do09JlI6rjOs9UuULlIN2Z0eE8YTlANR6uQc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Xx+T0tuY8AcnjPZbiDyOq2bE11Fjhsk6p5axqayaapC/Pt9GczcgIQf1z15WTxCeKWAPYKYQGPPWtfDYj0nlNFNoTlU39RC91Z16xFKJ2MLEmkm+NvimsoOJ6be3g2BssNPtJ/9BKDXRA5cVs17tBeeW72lH8TMB5999udtxHM2SiUsnWsrHlfVuGSCpNQQ+5REw8HNvEKkgEBjz1rXzBNWrqZGbjun55K+vgYPBhJO2qZ67uRWXUA5/qcU12U/mbi5XoA3swoxYE8LEXfZvFFC9WG/W28QNCA0Qd4Trk/WkWiAwZmB8a84Fs14rkv3wqyxwFavPkJorqurAfd2XzGiFy0sB0ITCOPYi1HzDGV5WfXk6b9k+jT66/RuzGa8EcSOWo/QtC3Bkhgowo4AY89a1/f/tw8A02zjIoK7JVDAbf8W4UfmbApJJhwXIiGtu1M0JItObx7g2reYqT+HHL2Q/R4VDc="},65630:(a,b,c)=>{"use strict";let{kClients:d}=c(49176),e=c(37417),{kAgent:f,kMockAgentSet:g,kMockAgentGet:h,kDispatches:i,kIsMockActive:j,kNetConnect:k,kGetNetConnect:l,kOptions:m,kFactory:n,kMockAgentRegisterCallHistory:o,kMockAgentIsCallHistoryEnabled:p,kMockAgentAddCallHistoryLog:q,kMockAgentMockCallHistoryInstance:r,kMockAgentAcceptsNonStandardSearchParameters:s,kMockCallHistoryAddLog:t,kIgnoreTrailingSlash:u}=c(80830),v=c(66498),w=c(86625),{matchValue:x,normalizeSearchParams:y,buildAndValidateMockOptions:z,normalizeOrigin:A}=c(70634),{InvalidArgumentError:B,UndiciError:C}=c(61448),D=c(7344),E=c(70459),{MockCallHistory:F}=c(43904);class G extends D{constructor(a={}){super(a);let b=z(a);if(this[k]=!0,this[j]=!0,this[p]=b.enableCallHistory??!1,this[s]=b.acceptNonStandardSearchParameters??!1,this[u]=b.ignoreTrailingSlash??!1,a?.agent&&"function"!=typeof a.agent.dispatch)throw new B("Argument opts.agent must implement Agent");let c=a?.agent?a.agent:new e(a);this[f]=c,this[d]=c[d],this[m]=b,this[p]&&this[o]()}get webSocketOptions(){return this[f].webSocketOptions}get eventSourceOptions(){return this[f].eventSourceOptions}get(a){let b=A(a),c=this[u]?b.replace(/\/$/,""):b,d=this[h](c);return d||(d=this[n](c),this[g](c,d)),d}dispatch(a,b){a.origin=A(a.origin);let c=this.get(a.origin);this[q](a);let e=this[s],h={...a};if(!1===h.allowH2){let a=`${h.origin}#http1-only`;if(!this[d].has(a)){let b=this[n](h.origin);b[i]=c[i],this[g](a,b)}}if(e&&h.path){let[a,b]=h.path.split("?"),c=y(b,e);h.path=`${a}?${c}`}return this[f].dispatch(h,b)}async close(){this.clearCallHistory(),await this[f].close(),this[d].clear()}deactivate(){this[j]=!1}activate(){this[j]=!0}enableNetConnect(a){if("string"==typeof a||"function"==typeof a||a instanceof RegExp)Array.isArray(this[k])?this[k].push(a):this[k]=[a];else if(void 0===a)this[k]=!0;else throw new B("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[k]=!1}enableCallHistory(){return this[p]=!0,this}disableCallHistory(){return this[p]=!1,this}getCallHistory(){return this[r]}clearCallHistory(){void 0!==this[r]&&this[r].clear()}get isMockActive(){return this[j]}[o](){void 0===this[r]&&(this[r]=new F)}[q](a){this[p]&&(this[o](),this[r][t](a))}[g](a,b){this[d].set(a,b)}[n](a){let b=Object.assign({agent:this},this[m]);return this[m]&&1===this[m].connections?new v(a,b):new w(a,b)}[h](a){let b=this[d].get(a);if(b)return b;if("string"!=typeof a){let b=this[n]("http://localhost:9999");return this[g](a,b),b}for(let[b,c]of Array.from(this[d]))if(c&&"string"!=typeof b&&x(b,a)){let b=this[n](a);return this[g](a,b),b[i]=c[i],b}}[l](){return this[k]}pendingInterceptors(){return Array.from(this[d].entries()).flatMap(([a,b])=>b[i].map(b=>({...b,origin:a}))).filter(({pending:a})=>a)}assertNoPendingInterceptors({pendingInterceptorsFormatter:a=new E}={}){let b=this.pendingInterceptors();if(0!==b.length)throw new C(1===b.length?`1 interceptor is pending:
480
480
 
@@ -623,7 +623,7 @@ data: [DONE]
623
623
 
624
624
  `)}if(!0===a.stop&&(null===h.inputKind&&void 0===g||"string"===h.inputKind&&""===h.inputChunks.join("")))await O(c,d,"{}"),h.emptyArgumentsEmitted=!0;else if(void 0!==g&&""!==g){let a="string"==typeof g?g:JSON.stringify(g);await O(c,d,a)}}}if("messageStopEvent"===f&&(H.endDetected=!0,await P(c)),"contextUsageEvent"===f&&a.payload?.contextUsagePercentage&&(H.contextUsagePercentage=a.payload.contextUsagePercentage,H.hasContextUsage=!0),"meteringEvent"===f&&(H.hasMeteringEvent=!0),"metricsEvent"===f){let b=a.payload?.metricsEvent||a.payload;if(b&&"object"==typeof b){let a=b.inputTokens||0,c=b.outputTokens||0;(a>0||c>0)&&(H.usage=function(a,b=null){let c=Number(a?.inputTokens)||0,d=Number(a?.outputTokens)||0,e={...b&&"object"==typeof b?b:{},prompt_tokens:c,completion_tokens:d,total_tokens:c+d},f=M(a,"cacheReadInputTokens","cache_read_input_tokens"),g=M(a,"cacheCreationInputTokens","cache_creation_input_tokens");return void 0!==f&&(e.cache_read_input_tokens=f),void 0!==g&&(e.cache_creation_input_tokens=g),e}(b,H.usage))}}if(H.hasMeteringEvent&&H.hasContextUsage&&!H.usage){let a=H.totalContentLength>0?Math.max(1,Math.floor(H.totalContentLength/4)):0,b=H.contextUsagePercentage>0?Math.floor(2e5*H.contextUsagePercentage/100):0;H.usage={prompt_tokens:b,completion_tokens:a,total_tokens:b+a}}}}},async flush(a){if(!H.streamFailed&&G)for(let b of y(H.taggedThinking))"reasoning"===b.type?await Q(a,b.text):await R(a,b.text);if(!H.streamFailed)try{i.finish(),H.endDetected=!0,await P(a)}catch(b){if(!(b?.code==="KIRO_STREAM_MISSING_TERMINAL"&&(H.hasTextContent||H.hasReasoningContent||H.hasCodeContent||H.hasToolCalls||H.contentFiltered))){H.streamFailed=!0,H.protocolFailed=!0,H.finishEmitted=!0;let c=K(e,b?.code);await J(a,c)}}if(!H.streamFailed&&H.hasToolCalls)try{for(let a of H.toolFrames.values()){let b,c=a.stopped||H.endDetected;if("object"===a.inputKind)b=a.inputObject;else if("string"===a.inputKind){let d=a.inputChunks.join("");b=""===d&&c?{}:JSON.parse(d)}else if(c)b={};else throw Error("missing tool input");if(!b||"object"!=typeof b||Array.isArray(b))throw Error("tool input must be an object");if("tool_call"===a.name){if("string"!=typeof b.name||!b.name.trim())throw Error("missing nested tool name");if(!Object.prototype.hasOwnProperty.call(b,"arguments"))throw Error("missing nested tool arguments")}}}catch{await N(a)}if(!H.finishEmitted&&!H.streamFailed){H.finishEmitted=!0;let c={id:s,object:"chat.completion.chunk",created:w,model:b,choices:[{index:0,delta:{},finish_reason:H.contentFiltered?"content_filter":H.hasToolCalls?"tool_calls":"stop"}]};if(H.usage)c.usage=H.usage;else if(H.contentFiltered&&(H.hasContextUsage||H.contextUsagePercentage>0)){let a=H.contextUsagePercentage>0?Math.floor(2e5*H.contextUsagePercentage/100):0,b=H.totalContentLength>0?Math.max(1,Math.floor(H.totalContentLength/4)):0;c.usage={prompt_tokens:a,completion_tokens:b,total_tokens:a+b}}"number"==typeof H.contextUsagePercentage&&Number.isFinite(H.contextUsagePercentage)&&(c.context_usage_percentage=H.contextUsagePercentage),await I(a,`data: ${JSON.stringify(c)}
625
625
 
626
- `)}if(H.streamFailed){j&&!H.protocolFailed&&u(g),a.enqueue(l.encode("data: [DONE]\n\n"));return}if(await I(a,"data: [DONE]\n\n"),j){let b=await j.readAll();await j.cleanup(),u(g),a.enqueue(b)}}});if(!a.body)return t(g),j?.cleanup?.().catch(()=>{}),L(a,K(e));let U=a.body.pipeThrough(T);if(j){let a=U.getReader();U=new ReadableStream({async pull(b){try{let c=await a.read();if(c.done){await j.cleanup(),b.close();return}b.enqueue(c.value)}catch(a){v(g),await j.cleanup(),b.error(a)}},async cancel(b){try{await a.cancel(b)}finally{v(g),await j.cleanup()}}})}return new Response(U,{status:a.status,statusText:a.statusText,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}async refreshCredentials(a,b,c=null,d=null){if(!a.refreshToken){let a=Error("Kiro refresh credential is missing");throw a.name="KiroRefreshCredentialError",a.status=k.gx.UNAUTHORIZED,a.code="MISSING_REFRESH_TOKEN",a.permanent=!0,a}try{return await (0,g.Ql)(a.refreshToken,a.providerSpecificData,b,c,d)}catch(a){if(d?.aborted||a?.name==="AbortError"||(b?.error?.("TOKEN",a?.permanent===!0?"Kiro refresh credential was rejected":"Kiro refresh failed due to a transient error"),a?.permanent===!0))throw a;return null}}canRefreshCredentials(){return!0}}},73952:(a,b,c)=>{"use strict";c.d(b,{$O:()=>k,AUTOCLAW_WALLET_ENDPOINT:()=>i,Cw:()=>g,VR:()=>h,_V:()=>j,buildAutoClawWalletHeaders:()=>m,df:()=>e,p8:()=>l});var d=c(55511);let e="100003",f="https://autoglm-api.autoglm.ai",g=`${f}/autoclaw-proxy/proxy/autoclaw`,h=`${f}/userapi/v1/refresh`,i=`${f}/agent-assetmgr/api/v2/wallets?biz_app_id=autoclaw`,j="1.10.0";function k(a){let b=`${e}&${a}&38d2391985e2369a5fb8227d8e6cd5e5`;return(0,d.createHash)("md5").update(b).digest("hex")}function l(a={}){let b=String(Math.floor(Date.now()/1e3));return{accept:"*/*","content-type":"application/json",origin:"https://autoclaw.z.ai",referer:"https://autoclaw.z.ai/","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36","x-auth-appid":e,"x-auth-timestamp":b,"x-auth-sign":k(b),"x-product":"autoclaw","x-version":j,"x-tm":"web","x-channel":"official","x-client-type":"web","x-trace-id":(0,d.randomUUID)(),"x-lang":"zh-CN",...a}}function m(a){let b=String(a||"").replace(/^Bearer\s+/i,"");return l({authorization:`Bearer ${b}`})}},73997:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"gemini-web",priority:220,alias:"gemini-web",aliases:["gweb"],uiAlias:"gemini-web",category:"webCookie",authType:"cookie",authModes:["cookie"],serviceKinds:["image"],display:{name:"Gemini Web",icon:"auto_awesome",color:"#4285F4",textIcon:"GW",website:"https://gemini.google.com",notice:{text:"Paste your __Secure-1PSID (and __Secure-1PSIDTS) cookie value(s) from gemini.google.com"}},transport:{baseUrl:"https://gemini.google.com/app",format:"openai",authType:"cookie"},models:[{id:"gemini-3.1-pro",name:"Gemini 3.1 Pro"},{id:"gemini-3.7-flash",name:"Gemini 3.7 Flash"},{id:"gemini-3.1-flash-lite",name:"Gemini 3.1 Flash-Lite"},{id:"gemini-image",name:"Gemini Image (web)",params:["n","size"],kind:"image"}]}},74262:(a,b,c)=>{"use strict";c.d(b,{Q:()=>s});var d=c(40610),e=c.n(d),f=c(77030),g=c(69384);let h="https://veoaifree.com",i=`${h}/wp-admin/admin-ajax.php`,j=new Set([202,404,409,425]);function k(a){let b=String(a).toLowerCase().replace(/^\[|\]$/g,""),c=b.startsWith("::ffff:")?b.slice(7):b;if(c.includes(".")){let[a,b]=c.split(".").map(Number);return 0===a||10===a||127===a||a>=224||172===a&&b>=16&&b<=31||192===a&&168===b||169===a&&254===b}return"::1"===c||c.startsWith("fc")||c.startsWith("fd")||c.startsWith("fe80")||c.startsWith("fe9")||c.startsWith("fea")||c.startsWith("feb")}async function l(a){let b=a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a;if((0,f.isIP)(b)){if(k(b))throw Error("artifact host is a blocked address");return}let c=await e().promises.lookup(b,{all:!0}).catch(()=>[]);if(!c.length)throw Error("artifact host could not be resolved");for(let{address:a}of c)if(k(a))throw Error("artifact host resolves to a blocked address")}async function m(a,b,c={}){let d=new AbortController,e=setTimeout(()=>d.abort(Error("veoaifree request timed out")),3e4),f=()=>d.abort(a.signal?.reason||Error("aborted"));a.signal?.aborted?f():a.signal?.addEventListener("abort",f,{once:!0});try{let e={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36",Referer:`${h}/`,...c.headers||{}};a.cookieHeader&&void 0===e.Cookie&&(e.Cookie=a.cookieHeader);let f=await fetch(b,{...c,headers:e,signal:d.signal});return!function(a,b){let c="function"==typeof b.headers.getSetCookie?b.headers.getSetCookie():b.headers.get("set-cookie")?[b.headers.get("set-cookie")]:[];if(!c.length)return;let d=new Map(a.cookieHeader.split(";").filter(Boolean).map(a=>{let b=a.trim().indexOf("=");return b>0?[a.trim().slice(0,b),a.trim().slice(b+1)]:null}).filter(Boolean));for(let a of c){let b=a.split(";")[0]?.trim(),c=b?.indexOf("=");c>0&&b.slice(c+1)&&d.set(b.slice(0,c).trim(),b.slice(c+1))}a.cookieHeader=[...d.entries()].map(([a,b])=>`${a}=${b}`).join("; ")}(a,f),f}finally{clearTimeout(e),a.signal?.removeEventListener("abort",f)}}async function n(a){let b=await m(a,h),c=(await b.text()).match(/nonce":"([a-f0-9]+)"/);if(!c)throw Error("failed to extract CSRF nonce from veoaifree.com (site layout changed or rate limited)");return c[1]}async function o(a,b,c){let d=new URLSearchParams({action:"veo_video_generator",nonce:b,...c});return(await m(a,i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Origin:h},body:d.toString()})).text()}function p(a,b){let c=String(a||"").toLowerCase();return/9:16|portrait/.test(c)?`${b}_PORTRAIT`:/1:1|square/.test(c)?`${b}_SQUARE`:`${b}_LANDSCAPE`}async function q(a,b){let c=b;for(let b=0;b<=3;b++){let b=new URL(c);if("https:"!==b.protocol)throw Error("artifact URL must use HTTPS");await l(b.hostname);let d=await m(a,b.toString(),{method:"GET",redirect:"manual"});if(d.status>=300&&d.status<400){let a=d.headers.get("location");if(!a)throw Error("artifact redirect is missing a destination");c=new URL(a,b.toString()).toString();continue}if(j.has(d.status))throw Object.assign(Error("artifact not available yet"),{retryable:!0});if(!d.ok)throw Error(`artifact download failed (HTTP ${d.status})`);let e=(d.headers.get("content-type")||"").split(";")[0].trim().toLowerCase();if(!["video/mp4","application/octet-stream"].includes(e))throw Error(`artifact returned unsupported content type (${e})`);let f=Buffer.from(await d.arrayBuffer());if(f.byteLength>0x6400000)throw Error("artifact exceeds 100MB limit");if(f.length<12||"ftyp"!==f.toString("ascii",4,8))throw Error("artifact is not a valid MP4 file");return f}throw Error("artifact exceeded the redirect limit")}async function r(a,b){let c=null;for(let d=0;d<12;d++)try{return await q(a,b)}catch(a){if(!a.retryable)throw a;c=a,await new Promise(a=>setTimeout(a,5e3))}throw c||Error("artifact did not become available in time")}class s extends g.Hv{constructor(){super("veoaifree-web",{id:"veoaifree-web",baseUrl:h})}async execute(){return{response:new Response(JSON.stringify({error:{message:"veoaifree-web is a media provider — use /v1/images/generations or /v1/videos/generations",type:"invalid_request"}}),{status:400,headers:{"Content-Type":"application/json"}}),url:i,headers:{},transformedBody:{}}}async generateMedia({prompt:a,kind:b="video",size:c,credentials:d,signal:e,log:f}){if("video"!==b&&"image"!==b)throw Error("veoaifree-web supports image and video generation only");if(!a?.trim())throw Error("prompt is required");let g={cookieHeader:"",signal:e},h=await n(g);if("image"===b){let b=(await o(g,h,{promptIMG:a,totalVariationsIMG:"1",aspectRatioIMG:p(c,"IMAGE_ASPECT_RATIO"),actionType:"banan-image-generator"})).trim();if(!b||"0"===b||b.toLowerCase().includes("error"))throw Error(`veoaifree image generation failed: ${b.slice(0,120)}`);return b.split(",").map(a=>a.trim()).filter(Boolean).map(a=>/^https?:\/\//i.test(a)?{url:a}:{b64:a,mime:"image/png"})}let i=(await o(g,h,{prompt:a,totalVariations:"1",aspectRatio:p(c,"VIDEO_ASPECT_RATIO"),actionType:"full-video-generate"})).trim();if(!i||"0"===i||i.toLowerCase().includes("error"))throw Error(`veoaifree video submit failed: ${i.slice(0,120)}`);for(let a=0;a<30;a++){if(e?.aborted)throw Error("aborted");await new Promise(a=>setTimeout(a,2e4));let b=(await o(g,h,{sceneData:i,actionType:"final-video-results"})).trim();if(!b||"0"===b||b.toLowerCase().includes("error"))continue;let c=b.split(/[,\n]/).map(a=>a.trim()).find(a=>/^https?:\/\//i.test(a));if(!c)continue;let d=await r(g,c);return f?.info?.("VEOAI-FREE",`video ready after ${a+1} poll(s)`),[{b64:d.toString("base64"),mime:"video/mp4"}]}throw Error("veoaifree video generation timed out after 10 minutes")}}},74345:(a,b,c)=>{"use strict";let d;c.d(b,{A:()=>w});var e=c(31421),f=c(73024),g=c.n(f),h=c(76760),i=c.n(h),j=c(73136),k=c(53859);let l={"playwright-core":"^1.54.2"};function m(){return i().join(k.n,"runtime")}function n(){return d??=import("node:module").then(a=>a.createRequire)}function o(a){let b=String(a?.code||"");return"MODULE_NOT_FOUND"===b||"ERR_MODULE_NOT_FOUND"===b}async function p(){try{let{pruneForeignNativeBinaries:a}=(await n())("file:///zevairouter-build/open-sse/services/lazyRuntime.js")("../../cli/hooks/pruneNativeBinaries.js");a(m(),{silent:!0})}catch{}}async function q(a,b){let c,d,f,h,j=m(),k=await (c=m(),g().mkdirSync(c,{recursive:!0}),d=i().join(c,"package.json"),!g().existsSync(d)&&g().writeFileSync(d,JSON.stringify({name:"zevai-runtime",private:!0},null,2)),f="win32"===process.platform?"npm.cmd":"npm",h=["install","--no-audit","--no-fund","--prefer-online",`${a}@${b}`],new Promise(a=>{let b=(0,e.spawn)(f,h,{cwd:c,stdio:["ignore","pipe","pipe"],shell:"win32"===process.platform}),d="";b.stderr?.on("data",a=>{d+=String(a)}),b.on("error",b=>a({ok:!1,stderr:String(b.message||b)})),b.on("close",b=>a({ok:0===b,stderr:d}))}));if(!k.ok){let c=(k.stderr.match(/npm ERR! ?(.+)/)||[])[1]||k.stderr.split("\n").filter(Boolean).pop()||"unknown npm error";throw Error(`${a} is missing and the on-demand install failed (${String(c).slice(0,160)}) — install it manually: cd "${j}" && npm install ${a}@${b}`)}await p()}let r=new Map;function s(a){if(!a||"object"!=typeof a)return a;let b=a.default;return b&&"object"==typeof b&&(b.chromium&&!a.chromium||"function"==typeof b.createSession&&"function"!=typeof a.createSession)?b:a}async function t(a){return s(await import(a))}async function u(a,b){let c=a.resolve(b),d=i().dirname(c),e=i().join(d,"index.mjs");if(g().existsSync(e))try{return s(await import((0,j.pathToFileURL)(e).href))}catch(a){if(!o(a))throw a}return s(await import((0,j.pathToFileURL)(c).href))}async function v(a){if(!Object.hasOwn(l,a))throw Error(`${a} is not a supported runtime dependency`);try{return await t(a)}catch(a){if(!o(a))throw a}let b=(await n())(i().join(m(),"package.json"));try{return s(b(a))}catch(a){if(!o(a))throw a}try{return await u(b,a)}catch(a){if(!o(a))throw a}let c=l[a],d=()=>{try{return s(b(a))}catch(c){if(!o(c))throw c;return u(b,a)}};await q(a,c);try{return await d()}catch(b){if(!o(b))throw b;return g().rmSync(i().join(m(),"node_modules",a),{recursive:!0,force:!0}),await q(a,c),d()}}function w(a){return r.has(a)||r.set(a,v(a).finally(()=>r.delete(a))),r.get(a)}},74399:(a,b,c)=>{"use strict";let d=c(7344),{InvalidArgumentError:e}=c(61448),{toRawHeaders:f}=c(84285),{kOriginless:g,kUrl:h}=c(49176);class i{#a$;constructor(a){this.#a$=a}onRequestStart(a,b){this.#a$.onConnect?.(b=>a.abort(b),b)}onRequestUpgrade(a,b,c,d){let e=Array.isArray(a?.rawHeaders)?a.rawHeaders:f(a?.rawHeaders??c??{});this.#a$.onUpgrade?.(b,e,d)}onResponseStart(a,b,c,d){let e=Array.isArray(a?.rawHeaders)?a.rawHeaders:f(a?.rawHeaders??c??{});this.#a$.onHeaders?.(b,e,()=>a.resume(),d)===!1&&a.pause()}onResponseData(a,b){this.#a$.onData?.(b)===!1&&a.pause()}onResponseEnd(a,b){let c=Array.isArray(a?.rawTrailers)?a.rawTrailers:f(a?.rawTrailers??b??{});this.#a$.onComplete?.(c)}onResponseError(a,b){if(!this.#a$.onError)throw b;this.#a$.onError(b)}onBodySent(a){this.#a$.onBodySent?.(a)}onRequestSent(){this.#a$.onRequestSent?.()}onResponseStarted(){this.#a$.onResponseStarted?.()}}class j extends d{#d;constructor(a){if(super(),!a||"function"!=typeof a.dispatch)throw new e("Argument dispatcher must implement dispatch");this.#d=a,this[h]=a[h],this[g]=a[g]}static wrapHandler(a){if(!a||"object"!=typeof a)throw new e("handler must be an object");return"function"==typeof a.onRequestStart?a:new i(a)}dispatch(a,b){return!1!==a.allowH2&&(a={...a,allowH2:!1}),this.#d.dispatch(a,j.wrapHandler(b))}get webSocketOptions(){return this.#d.webSocketOptions}get eventSourceOptions(){return this.#d.eventSourceOptions}close(...a){return this.#d.close(...a)}destroy(...a){return this.#d.destroy(...a)}}a.exports=j},74760:(a,b,c)=>{"use strict";c.d(b,{m:()=>g});var d=c(88164),e=c(30395);let f={id:"codebuddy-intl",baseUrl:"https://www.codebuddy.ai/v2/chat/completions",format:"openai",forceStream:!0,thinkingFormat:"openai",domain:"www.codebuddy.ai",refreshUrl:"https://www.codebuddy.ai/v2/plugin/auth/token/refresh",headers:{"User-Agent":"IDE/2.108.1 CodeBuddy/2.108.1","X-Product":"SaaS","X-IDE-Type":"IDE","X-IDE-Name":"IDE","x-requested-with":"XMLHttpRequest","x-codebuddy-request":"1"}};class g extends d.L{constructor(){super("codebuddy-intl",e.xq["codebuddy-intl"]||f)}transformRequest(a,b,c,d){let e=super.transformRequest(a,b,c,d);e.stream=!0;let f=e.reasoning_effort;"none"===f||"off"===f?delete e.reasoning_effort:f&&(e.reasoning_summary="auto");let g=Array.isArray(e.messages)?e.messages:[];for(let a of(e.messages=[{role:"system",content:"You are CodeBuddy Code."}],g))!a||"object"!=typeof a||["system","developer"].includes(a.role)||("user"===a.role&&"string"==typeof a.content?e.messages.push({...a,content:[{type:"text",text:a.content}]}):e.messages.push({...a}));return e}parseError(a,b){if(b)try{let a=JSON.parse(b),c=a?.msg||a?.message||a?.error?.message||"";if(a?.code===6004||/超出频率限制|frequency limit|限额/i.test(c)){let a=null,b=c.match(/(\d{4}-\d{2}-\d{2})\s+(\d{2}:\d{2}:\d{2})(?:\s*UTC\+?([0-9:]+))?/i);if(b){let c=b[1],d=b[2],e=b[3]?b[3].includes(":")?b[3].startsWith("+")?b[3]:`+${b[3]}`:`+${b[3].padStart(2,"0")}:00`:"+08:00",f=new Date(`${c}T${d}${e}`);isNaN(f.getTime())||(a=f.getTime())}return{status:429,message:c||"CodeBuddy frequency limit (6004)",resetsAtMs:a}}}catch{}return super.parseError(a,b)}}},76316:(a,b,c)=>{"use strict";let d,{InvalidArgumentError:e,NotSupportedError:f}=c(61448),g=c(34589),{isValidHTTPToken:h,isValidHeaderValue:i,isStream:j,destroy:k,isBuffer:l,isFormDataLike:m,isIterable:n,hasSafeIterator:o,isBlobLike:p,serializePathWithQuery:q,parseHeaders:r,assertRequestHandler:s,getServerName:t,normalizedMethodRecords:u,getProtocolFromUrlString:v}=c(84285),{channels:w}=c(62571),{headerNameLowerCasedRecord:x}=c(28820),y=/[^\u0021-\u00ff]/,z=Symbol("handler"),A=Symbol("controller"),B=Symbol("resume");class C{#N=!1;#ch=null;#W=!1;#ci;[B]=null;rawHeaders=null;rawTrailers=null;constructor(a){this.#ci=a}pause(){this.#N=!0}resume(){this.#N&&(this.#N=!1,this[B]?.())}abort(a){this.#W||(this.#W=!0,this.#ch=a,this.#ci(a))}get aborted(){return this.#W}get reason(){return this.#ch}get paused(){return this.#N}}class D{constructor(a,{path:b,method:f,body:g,headers:r,query:x,idempotent:A,blocking:B,upgrade:C,headersTimeout:D,bodyTimeout:F,reset:G,expectContinue:H,servername:I,throwOnError:J,maxRedirections:K,typeOfService:L},M){if("string"!=typeof b)throw new e("path must be a string");if("/"===b[0]||b.startsWith("http://")||b.startsWith("https://")||"CONNECT"===f){if(y.test(b))throw new e("invalid request path")}else throw new e("path must be an absolute URL or start with a slash");if("string"!=typeof f)throw new e("method must be a string");if(void 0===u[f]&&!h(f))throw new e("invalid request method");if(C&&"string"!=typeof C)throw new e("upgrade must be a string");if(C&&!i(C))throw new e("invalid upgrade header");if(null!=D&&(!Number.isFinite(D)||D<0))throw new e("invalid headersTimeout");if(null!=F&&(!Number.isFinite(F)||F<0))throw new e("invalid bodyTimeout");if(null!=G&&"boolean"!=typeof G)throw new e("invalid reset");if(null!=H&&"boolean"!=typeof H)throw new e("invalid expectContinue");if(null!=J)throw new e("invalid throwOnError");if(null!=K&&0!==K)throw new e("maxRedirections is not supported, use the redirect interceptor");if(null!=L&&(!Number.isInteger(L)||L<0||L>255))throw new e("typeOfService must be an integer between 0 and 255");if(this.headersTimeout=D,this.bodyTimeout=F,this.method=f,this.typeOfService=L,this.abort=null,null==g)this.body=null;else if(j(g)){this.body=g;let a=this.body._readableState;a&&a.autoDestroy||(this.endHandler=function(){k(this)},this.body.on("end",this.endHandler)),this.errorHandler=a=>{this.abort?this.abort(a):this.error=a},this.body.on("error",this.errorHandler)}else if(l(g))this.body=g.byteLength?g:null;else if(ArrayBuffer.isView(g))this.body=g.buffer.byteLength?Buffer.from(g.buffer,g.byteOffset,g.byteLength):null;else if(g instanceof ArrayBuffer)this.body=g.byteLength?Buffer.from(g):null;else if("string"==typeof g)this.body=g.length?Buffer.from(g):null;else if(m(g)){var N;if(N=g,void 0===d&&(c(2887),d=c(32984).webidl.is.FormData),!d(N))throw new e("body must be a FormData created by this undici package instance; FormData from other sources, such as the built-in FormData provided by Node.js, is not supported");this.body=g}else if(n(g)||p(g))this.body=g;else throw new e("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");if(this.completed=!1,this.aborted=!1,this.upgrade=C||null,this.path=x?q(b,x):b,this.origin=a,this.protocol=v(a),this.idempotent=null==A?"HEAD"===f||"GET"===f||"QUERY"===f:A,this.blocking=B??"HEAD"!==this.method,this.reset=null==G?null:G,this.host=null,this.contentLength=null,this.contentType=null,this.headers=[],this.expectContinue=null!=H&&H,Array.isArray(r)){if(r.length%2!=0)throw new e("headers array must be even");for(let a=0;a<r.length;a+=2)E(this,r[a],r[a+1])}else if(r&&"object"==typeof r)if(o(r))for(let a of r){if(!Array.isArray(a)||2!==a.length)throw new e("headers must be in key-value pair format");E(this,a[0],a[1])}else{let a=Object.keys(r);for(let b=0;b<a.length;++b)E(this,a[b],r[a[b]])}else if(null!=r)throw new e("headers must be an object or an array");s(M,f,C),this.servername=I||t(this.host)||null,this[z]=M,w.create.hasSubscribers&&w.create.publish({request:this})}onBodySent(a){if(w.bodyChunkSent.hasSubscribers&&w.bodyChunkSent.publish({request:this,chunk:a}),this[z].onBodySent)try{return this[z].onBodySent(a)}catch(a){this.abort(a)}}onRequestSent(){if(w.bodySent.hasSubscribers&&w.bodySent.publish({request:this}),this[z].onRequestSent)try{return this[z].onRequestSent()}catch(a){this.abort(a)}}onRequestStart(a,b){return(g(!this.aborted),g(!this.completed),this[A]=new C(a),this.error)?void this[A].abort(this.error):(this.abort=a,this[z].onRequestStart(this[A],b))}onResponseStarted(){return this[z].onResponseStarted?.()}onResponseStart(a,b,c,d){g(!this.aborted),g(!this.completed),w.headers.hasSubscribers&&w.headers.publish({request:this,response:{statusCode:a,headers:b,statusText:d}});let e=this[A];e&&(e[B]=c,e.rawHeaders=b);let f=Array.isArray(b)?r(b):b;try{return this[z].onResponseStart?.(e,a,f,d),!e?.paused}catch(a){return this.abort(a),!1}}onResponseData(a){g(!this.aborted),g(!this.completed),w.bodyChunkReceived.hasSubscribers&&w.bodyChunkReceived.publish({request:this,chunk:a});let b=this[A];try{return this[z].onResponseData?.(b,a),!b?.paused}catch(a){return this.abort(a),!1}}onRequestUpgrade(a,b,c,d=""){this.onFinally(),g(!this.aborted),g(!this.completed),w.headers.hasSubscribers&&w.headers.publish({request:this,response:{statusCode:a,headers:b,statusText:d}});let e=this[A];e&&(e.rawHeaders=b);let f=Array.isArray(b)?r(b):b,h=this[z].onRequestUpgrade?.(e,a,f,c);return!this.aborted&&(this.completed=!0,w.trailers.hasSubscribers&&w.trailers.publish({request:this,trailers:[]})),h}onResponseEnd(a){this.onFinally(),g(!this.aborted),g(!this.completed),this.completed=!0,w.trailers.hasSubscribers&&w.trailers.publish({request:this,trailers:a});let b=this[A];b&&(b.rawTrailers=a);let c=Array.isArray(a)?r(a):a;try{return this[z].onResponseEnd?.(b,c)}catch(a){this.onResponseError(a)}}onResponseError(a){if(this.onFinally(),w.error.hasSubscribers&&w.error.publish({request:this,error:a}),this.aborted)return;this.aborted=!0;let b=this[A];return this[z].onResponseError?.(b,a)}onFinally(){this.errorHandler&&(this.body.off("error",this.errorHandler),this.errorHandler=null),this.endHandler&&(this.body.off("end",this.endHandler),this.endHandler=null)}addHeader(a,b){return E(this,a,b),this}}function E(a,b,c){if(c&&"object"==typeof c&&!Array.isArray(c))throw new e(`invalid ${b} header`);if(void 0===c)return;let d=x[b];if(void 0===d&&void 0===x[d=b.toLowerCase()]&&!h(d))throw new e("invalid header key");if(Array.isArray(c)){let a=[];for(let d=0;d<c.length;d++)if("string"==typeof c[d]){if(!i(c[d]))throw new e(`invalid ${b} header`);a.push(c[d])}else if(null===c[d])a.push("");else if("object"==typeof c[d])throw new e(`invalid ${b} header`);else{let f=`${c[d]}`;if(!i(f))throw new e(`invalid ${b} header`);a.push(f)}c=a}else if("string"==typeof c){if(!i(c))throw new e(`invalid ${b} header`)}else if(null===c)c="";else if(!i(c=`${c}`))throw new e(`invalid ${b} header`);if("host"===d){if(null!==a.host)throw new e("duplicate host header");if("string"!=typeof c)throw new e("invalid host header");a.host=c}else if("content-length"===d){if(null!==a.contentLength)throw new e("duplicate content-length header");if(!function(a){if("string"!=typeof a||0===a.length)return!1;for(let b=0;b<a.length;b++){let c=a.charCodeAt(b);if(c<48||c>57)return!1}return!0}(c))throw new e("invalid content-length header");a.contentLength=parseInt(c,10)}else if(null===a.contentType&&"content-type"===d)a.contentType=c,a.headers.push(b,c);else if("transfer-encoding"===d||"keep-alive"===d||"upgrade"===d)throw new e(`invalid ${d} header`);else if("connection"===d){let b="string"==typeof c?c:null;if(null===b)throw new e("invalid connection header");for(let c of b.toLowerCase().split(",")){let b=c.trim();if(!h(b))throw new e("invalid connection header");"close"===b&&(a.reset=!0)}}else if("expect"===d)throw new f("expect header not supported");else a.headers.push(b,c)}a.exports=D},76394:(a,b,c)=>{"use strict";c.d(b,{iC:()=>l});var d=c(77598),e=c(46956),f=c(32185);let g=new Map,h=new Map;async function i(a,b,c){try{let d=await (0,e.Fm)((0,f.oj)(c)||f._G,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","User-Agent":"qodercli/1.0.0"},signal:b.signal},b.proxyOptions);if(!d.ok)return"";let g=await d.json().catch(()=>null);return g?.id||g?.userId||g?.user_id||""}catch{return""}}async function j(a,b,c){let d=await (0,e.Fm)((0,f.uR)(c)||f.OQ,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"qodercli/1.0.0","Cosy-Version":f.cT,"Cosy-ClientType":f.Ty},body:JSON.stringify({personal_token:a}),signal:b.signal},b.proxyOptions);if(!d.ok){let a=Error(`Qoder PAT exchange failed with HTTP ${d.status}`);throw a.status=d.status,a.code=401===d.status||403===d.status?"QODER_PAT_REJECTED":"QODER_PAT_EXCHANGE_FAILED",a}let g=await d.json().catch(()=>null),h=g?.token||g?.access_token;if("string"!=typeof h||!h.startsWith("jt-")){let a=Error("Qoder PAT exchange returned an invalid job token");throw a.code="QODER_JOB_TOKEN_INVALID",a}let j=g.userId||g.user_id||await i(h,b,c);return{accessToken:h,userId:j||"",expiresAt:function(a,b){if(a?.expires_at){let b=Date.parse(a.expires_at);if(Number.isFinite(b))return b}let c=Number(a?.expires_in);return Number.isFinite(c)&&c>0?b+1e3*c:null}(g,Date.now())}}async function k(a,b,c){let e=(0,d.createHash)("sha256").update(`qoder-pat:${c}:${a}`).digest("hex"),f=g.get(e);if(f&&f.expiresAt-Date.now()>3e5)return f;if(h.has(e))return h.get(e);let i=j(a,b,c).then(a=>(Number.isFinite(a.expiresAt)&&g.set(e,a),a)).finally(()=>{h.get(e)===i&&h.delete(e)});return h.set(e,i),i}async function l(a,b={}){let c=a?.apiKey||a?.accessToken;if(!("string"==typeof c&&/^pt-.+/.test(c)&&c.length>6))return a;let d=function(a,b={}){return b.region||(0,f.ty)(a?.provider||b.provider)}(a,b),e=await k(c,b,d);return{...a,provider:a?.provider||("cn"===d?"qoder-cn":"qoder"),apiKey:void 0,accessToken:e.accessToken,providerSpecificData:{...a.providerSpecificData||{},authMethod:"pat",userId:e.userId||a.providerSpecificData?.userId||"",machineId:a.providerSpecificData?.machineId||""}}}},76403:(a,b,c)=>{"use strict";let d,{makeNetworkError:e,makeAppropriateNetworkError:f,filterResponse:g,makeResponse:h,fromInnerResponse:i,getResponseState:j}=c(78196),{HeadersList:k}=c(28665),{Request:l,cloneRequest:m,getRequestDispatcher:n,getRequestState:o,removeRequestAbortListener:p}=c(12600),q=c(38522),{makePolicyContainer:r,clonePolicyContainer:s,requestBadPort:t,TAOCheck:u,appendRequestOriginHeader:v,responseLocationURL:w,requestCurrentURL:x,setRequestReferrerPolicyOnRedirect:y,tryUpgradeRequestToAPotentiallyTrustworthyURL:z,createOpaqueTimingInfo:A,appendFetchMetadata:B,corsCheck:C,crossOriginResourcePolicyCheck:D,determineRequestsReferrer:E,coarsenedSharedCurrentTime:F,sameOrigin:G,isCancelled:H,isAborted:I,isErrorLike:J,fullyReadBody:K,readableStreamClose:L,urlIsLocal:M,urlIsHttpHttpsScheme:N,urlHasHttpsScheme:O,clampAndCoarsenConnectionTimingInfo:P,simpleRangeHeaderValue:Q,buildContentRange:R,createInflate:S,extractMimeType:T,hasAuthenticationEntry:U,includesCredentials:V,isTraversableNavigable:W}=c(42425),X=c(34589),{safelyExtractBody:Y,extractBody:Z}=c(35381),{redirectStatusSet:$,nullBodyStatus:_,safeMethodsSet:aa,requestBodyHeader:ab,subresourceSet:ac}=c(19608),ad=c(78474),{Readable:ae,pipeline:af,finished:ag,isErrored:ah,isReadable:ai}=c(57075),{addAbortListener:aj,bufferToLowerCasedHeaderName:ak}=c(84285),{SocketError:al}=c(61448),{dataURLProcessor:am,serializeAMimeType:an,minimizeSupportedMimeType:ao}=c(16537),{getGlobalDispatcher:ap}=c(59970),{webidl:aq}=c(32984),{STATUS_CODES:ar}=c(37067),{bytesMatch:as}=c(64371),{isomorphicEncode:at}=c(70745),au=["GET","HEAD"],av="u">typeof __UNDICI_IS_NODE__||"u">typeof esbuildDetection?"node":"undici";function aw(a,b,c){if(Array.isArray(c)){for(let b=0;b<c.length;b+=2){let d=ak(c[b]),e=c[b+1];if(Array.isArray(e)&&!Buffer.isBuffer(e))for(let b of e)a.append(d,b.toString("latin1"),!0);else a.append(d,e.toString("latin1"),!0)}return}for(let[c,d]of Object.entries(b??{}))if(Array.isArray(d))for(let b of d)a.append(c,`${b}`,!0);else a.append(c,`${d}`,!0)}class ax extends ad{constructor(a){super(),this.dispatcher=a,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(a){"ongoing"===this.state&&(this.state="terminated",this.connection?.destroy(a),this.emit("terminated",a))}abort(a){"ongoing"===this.state&&(this.state="aborted",a||(a=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=a,this.connection?.destroy(a),this.emit("terminated",a))}}function ay(a,b="other"){if("error"===a.type&&a.aborted||!a.urlList?.length)return;let c=a.urlList[0],d=a.timingInfo,e=a.cacheState;N(c)&&null!==d&&(a.timingAllowPassed||(d=A({startTime:d.startTime}),e=""),d.endTime=F(),a.timingInfo=d,az(d,c.href,b,globalThis,e,"",a.status))}let az=performance.markResourceTiming;function aA(a,b,c,d,e){if(a&&a.reject(d),b.body?.stream!=null&&ai(b.body.stream)&&b.body.stream.cancel(d).catch(a=>{if("ERR_INVALID_STATE"!==a.code)throw a}),null==c)return;let f=j(c);f.body?.stream!=null&&ai(f.body.stream)&&e.error(d)}function aB({request:a,processRequestBodyChunkLength:b,processRequestEndOfBody:c,processResponse:d,processResponseEndOfBody:e,processResponseConsumeBody:f,useParallelQueue:g=!1,dispatcher:h=ap(),requestObject:i=null}){X(h);let j=null,k=!1;null!=a.client&&(j=a.client.globalObject,k=a.client.crossOriginIsolatedCapability);let l=A({startTime:F(k)}),m={controller:new ax(h),request:a,timingInfo:l,processRequestBodyChunkLength:b,processRequestEndOfBody:c,processResponse:d,processResponseConsumeBody:f,processResponseEndOfBody:e,taskDestination:j,crossOriginIsolatedCapability:k,requestObject:i};return X(!a.body||a.body.stream),"client"===a.window&&(a.window=a.client?.globalObject?.constructor?.name==="Window"?a.client:"no-window"),"client"===a.origin&&(a.origin=a.client.origin),"client"===a.policyContainer&&(null!=a.client?a.policyContainer=s(a.client.policyContainer):a.policyContainer=r()),a.headersList.contains("accept",!0)||a.headersList.append("accept","*/*",!0),a.headersList.contains("accept-language",!0)||a.headersList.append("accept-language","*",!0),a.priority,ac.has(a.destination),aC(m,!1),m.controller}async function aC(a,b){try{let c=a.request,d=null;if(c.localURLsOnly&&!M(x(c))&&(d=e("local URLs only")),z(c),"blocked"===t(c)&&(d=e("bad port")),""===c.referrerPolicy&&(c.referrerPolicy=c.policyContainer.referrerPolicy),"no-referrer"!==c.referrer&&(c.referrer=E(c)),null===d){let b=x(c);G(b,c.url)&&"basic"===c.responseTainting||"data:"===b.protocol||"navigate"===c.mode||"websocket"===c.mode?(c.responseTainting="basic",d=await aD(a)):"same-origin"===c.mode?d=e('request mode cannot be "same-origin"'):"no-cors"===c.mode?"follow"!==c.redirect?d=e('redirect mode cannot be "follow" for "no-cors" request'):(c.responseTainting="opaque",d=await aD(a)):N(x(c))?(c.responseTainting="cors",d=await aF(a)):d=e("URL scheme must be a HTTP(S) scheme")}if(b)return d;0===d.status||d.internalResponse||(c.responseTainting,"basic"===c.responseTainting?d=g(d,"basic"):"cors"===c.responseTainting?d=g(d,"cors"):"opaque"===c.responseTainting?d=g(d,"opaque"):X(!1));let f=0===d.status?d:d.internalResponse;if(0===f.urlList.length&&f.urlList.push(...c.urlList),c.timingAllowFailed||(d.timingAllowPassed=!0),"opaque"===d.type&&206===f.status&&f.rangeRequested&&!c.headers.contains("range",!0)&&(d=f=e()),0!==d.status&&("HEAD"===c.method||"CONNECT"===c.method||_.includes(f.status))&&(f.body=null,a.controller.dump=!0),c.integrity){let b=b=>aE(a,e(b));if("opaque"===c.responseTainting||null==d.body)return void b(d.error);K(d.body,e=>{as(e,c.integrity)?(d.body=Y(e)[0],aE(a,d)):b("integrity mismatch")},b)}else aE(a,d)}catch(b){a.controller.terminate(b)}}function aD(a){if(H(a))return Promise.resolve(f(a));let{request:b}=a,{protocol:g}=x(b);switch(g){case"about:":return Promise.resolve(e("about scheme is not supported"));case"blob:":{d||(d=c(4573).resolveObjectURL);let a=x(b);if(0!==a.search.length)return Promise.resolve(e("NetworkError when attempting to fetch resource."));let f=d(a.toString());if("GET"!==b.method||!aq.is.Blob(f))return Promise.resolve(e("invalid method"));let g=h(),i=f.size,j=at(`${i}`),k=f.type;if(b.headersList.contains("range",!0)){g.rangeRequested=!0;let a=Q(b.headersList.get("range",!0),!0);if("failure"===a)return Promise.resolve(e("failed to fetch the data URL"));let{rangeStartValue:c,rangeEndValue:d}=a;if(null===c)d=(c=i-d)+d-1;else{if(c>=i)return Promise.resolve(e("Range start is greater than the blob's size."));(null===d||d>=i)&&(d=i-1)}let h=f.slice(c,d+1,k);g.body=Z(h)[0];let j=at(`${h.size}`),l=R(c,d,i);g.status=206,g.statusText="Partial Content",g.headersList.set("content-length",j,!0),g.headersList.set("content-type",k,!0),g.headersList.set("content-range",l,!0)}else{let a=Z(f);g.statusText="OK",g.body=a[0],g.headersList.set("content-length",j,!0),g.headersList.set("content-type",k,!0)}return Promise.resolve(g)}case"data:":{let a=am(x(b));if("failure"===a)return Promise.resolve(e("failed to fetch the data URL"));return Promise.resolve(h({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:an(a.mimeType)}]],body:Y(a.body)[0]}))}case"file:":return Promise.resolve(e("not implemented... yet..."));case"http:":case"https:":return aF(a).catch(a=>e(a));default:return Promise.resolve(e("unknown scheme"))}}function aE(a,b){let c=a.timingInfo;"document"===a.request.destination&&(a.controller.fullTimingInfo=c);let d=()=>{let d=Date.now();a.controller.reportTimingSteps=()=>{if(!N(a.request.url))return;c.endTime=d;let e=b.cacheState,f=b.bodyInfo;b.timingAllowPassed||(c=A(c),e="");let g=0;if("navigate"!==a.request.mode||!b.hasCrossOriginRedirects){g=b.status;let a=T(b.headersList);"failure"!==a&&(f.contentType=ao(a))}null!=a.request.initiatorType&&az(c,a.request.url.href,a.request.initiatorType,globalThis,e,f,g)},queueMicrotask(()=>void(a.request.done=!0,null!=a.processResponseEndOfBody&&queueMicrotask(()=>a.processResponseEndOfBody(b)),null!=a.request.initiatorType&&a.controller.reportTimingSteps()))};null!=a.processResponse&&queueMicrotask(()=>{a.processResponse(b),a.processResponse=null});let e="error"===b.type?b:b.internalResponse??b;if(null==e.body?d():ag(e.body.stream,()=>{d()}),null!=a.processResponseConsumeBody){let c=c=>a.processResponseConsumeBody(b,c);null==e.body?queueMicrotask(()=>c(null)):K(e.body,c,()=>a.processResponseConsumeBody(b,"failure"))}}async function aF(a){let b=a.request,c=null,d=null,f=a.timingInfo;if(b.serviceWorkers,null===c){if("follow"===b.redirect&&(b.serviceWorkers="none"),d=c=await aG(a),"cors"===b.responseTainting&&"failure"===C(b,c))return e("cors failure");"failure"===u(b,c)&&(b.timingAllowFailed=!0)}return("opaque"===b.responseTainting||"opaque"===c.type)&&"blocked"===D(b.origin,b.client,b.destination,d)?e("blocked"):($.has(d.status)&&("manual"!==b.redirect&&a.controller.connection.destroy(),"error"===b.redirect?c=e("unexpected redirect"):"manual"===b.redirect?c=d:"follow"===b.redirect?c=await function(a,b){let c,d=a.request,f=b.internalResponse?b.internalResponse:b;try{if(c=w(f,x(d).hash),null==c)return b}catch(a){return Promise.resolve(e(a))}if(!N(c))return Promise.resolve(e("URL scheme must be a HTTP(S) scheme"));if(20===d.redirectCount)return Promise.resolve(e("redirect count exceeded"));if(d.redirectCount+=1,"cors"===d.mode&&(c.username||c.password)&&!G(d,c))return Promise.resolve(e('cross origin not allowed for request mode "cors"'));if("cors"===d.responseTainting&&(c.username||c.password))return Promise.resolve(e('URL cannot contain credentials for request mode "cors"'));if(303!==f.status&&null!=d.body&&null==d.body.source)return Promise.resolve(e());if([301,302].includes(f.status)&&"POST"===d.method||303===f.status&&!au.includes(d.method))for(let a of(d.method="GET",d.body=null,ab))d.headersList.delete(a);G(x(d),c)||(d.headersList.delete("authorization",!0),d.headersList.delete("proxy-authorization",!0),d.headersList.delete("cookie",!0),d.headersList.delete("host",!0)),null!=d.body&&(X(null!=d.body.source),d.body=Y(d.body.source)[0]);let g=a.timingInfo;return g.redirectEndTime=g.postRedirectStartTime=F(a.crossOriginIsolatedCapability),0===g.redirectStartTime&&(g.redirectStartTime=g.startTime),d.urlList.push(c),y(d,f),aC(a,!0)}(a,c):X(!1)),c.timingInfo=f,c)}async function aG(a,b=!1,c=!1){let d=a.request,g=null,h=null,i=null;"no-window"===d.window&&"error"===d.redirect?(g=a,h=d):(d.body?.source!=null?h=m(d):(h=m({...d,body:null})).body=d.body,(g={...a}).request=h);let j="include"===d.credentials||"same-origin"===d.credentials&&"basic"===d.responseTainting,k=h.body?h.body.length:null,l=null;if(null==h.body&&["POST","PUT"].includes(h.method)&&(l="0"),null!=k&&(l=at(`${k}`)),null==l||h.headersList.contains("content-length",!0)||h.headersList.append("content-length",l,!0),null!=k&&h.keepalive,aq.is.URL(h.referrer)&&h.headersList.append("referer",at(h.referrer.href),!0),v(h),B(h),h.headersList.contains("user-agent",!0)||h.headersList.append("user-agent",av,!0),"default"===h.cache&&(h.headersList.contains("if-modified-since",!0)||h.headersList.contains("if-none-match",!0)||h.headersList.contains("if-unmodified-since",!0)||h.headersList.contains("if-match",!0)||h.headersList.contains("if-range",!0))&&(h.cache="no-store"),"no-cache"!==h.cache||h.preventNoCacheCacheControlHeaderModification||h.headersList.contains("cache-control",!0)||h.headersList.append("cache-control","max-age=0",!0),("no-store"===h.cache||"reload"===h.cache)&&(h.headersList.contains("pragma",!0)||h.headersList.append("pragma","no-cache",!0),h.headersList.contains("cache-control",!0)||h.headersList.append("cache-control","no-cache",!0)),h.headersList.contains("range",!0)&&h.headersList.append("accept-encoding","identity",!0),h.headersList.contains("accept-encoding",!0)||(O(x(h))?h.headersList.append("accept-encoding","br, gzip, deflate, zstd",!0):h.headersList.append("accept-encoding","gzip, deflate",!0)),h.headersList.delete("host",!0),j&&!h.headersList.contains("authorization",!0)){let a=null;if(U(h)&&(void 0===h.useURLCredentials||!V(x(h))));else if(V(x(h))&&b){let{username:b,password:c}=x(h);a=`Basic ${Buffer.from(`${b}:${c}`).toString("base64")}`}null!==a&&h.headersList.append("Authorization",a,!1)}if(h.cache="no-store","no-store"!==h.cache&&h.cache,null==i){if("only-if-cached"===h.cache)return e("only if cached");let a=await aH(g,j,c);!aa.has(h.method)&&a.status>=200&&a.status,null==i&&(i=a)}if(i.urlList=[...h.urlList],h.headersList.contains("range",!0)&&(i.rangeRequested=!0),i.requestIncludesCredentials=j,401===i.status&&"cors"!==h.responseTainting&&j&&(void 0!==d.useURLCredentials||W(d.traversableForUserPrompts))){if(null!=d.body){if(null==d.body.source)return i;d.body=Y(d.body.source)[0]}if(void 0===d.useURLCredentials||b)return H(a)?f(a):i;a.controller.connection.destroy(),i=await aG(a,!0)}if(407===i.status)return"no-window"===d.window?e():H(a)?f(a):e("proxy authentication required");if(421===i.status&&!c&&(null==d.body||null!=d.body.source)){if(H(a))return f(a);a.controller.connection.destroy(),i=await aG(a,b,!0)}return i}async function aH(a,b=!1,c=!1){X(!a.controller.connection||a.controller.connection.destroyed),a.controller.connection={abort:null,destroyed:!1,destroy(a){this.destroyed||(this.destroyed=!0,this.abort?.(a??new DOMException("The operation was aborted.","AbortError")))}};let d=a.request,g=null,i=a.timingInfo;d.cache="no-store",d.mode;let j=null;if(null==d.body&&a.processRequestEndOfBody)queueMicrotask(()=>a.processRequestEndOfBody());else if(null!=d.body){let b=async function*(b){H(a)||(yield b,a.processRequestBodyChunkLength?.(b.byteLength))};j=async function*(){try{for await(let a of d.body.stream)yield*b(a);!H(a)&&a.processRequestEndOfBody&&a.processRequestEndOfBody()}catch(b){H(a)||("AbortError"===b.name?a.controller.abort():a.controller.terminate(b))}}()}try{let{body:b,status:c,statusText:e,headersList:f,socket:l}=await function({body:b}){let c=x(d),e=a.controller.dispatcher,f=c.pathname+c.search,g=0===c.search.length&&"?"===c.href[c.href.length-c.hash.length-1];return function b(h,j){return new Promise((l,m)=>e.dispatch({path:g?`${f}?`:f,origin:c.origin,method:d.method,body:e.isMockActive?d.body&&(d.body.source||d.body.stream):h,__mockAgentBodyForDispatch:h,headers:d.headersList.entries,maxRedirections:0,upgrade:"websocket"===d.mode?"websocket":void 0,...!1===j?{allowH2:j}:null},{body:null,abort:null,onRequestStart(b){let{connection:c}=a.controller;i.finalConnectionTimingInfo=P(void 0,i.postRedirectStartTime,a.crossOriginIsolatedCapability);let d=a=>b.abort(a);c.destroyed?d(new DOMException("The operation was aborted.","AbortError")):(a.controller.on("terminated",d),this.abort=c.abort=d),i.finalNetworkRequestStartTime=F(a.crossOriginIsolatedCapability)},onResponseStarted(){i.finalNetworkResponseStartTime=F(a.crossOriginIsolatedCapability)},onResponseStart(a,b,c,e){if(b<200)return;let f=a?.rawHeaders??[],g=new k;aw(g,c,f);let h=g.get("location",!0)&&"follow"===d.redirect&&$.has(b),i=[];if("HEAD"!==d.method&&"CONNECT"!==d.method&&!_.includes(b)&&!h){let b=g.get("content-encoding",!0),c=b?b.toLowerCase().split(","):[];if(c.length>5)return void a.abort(Error(`too many content-encodings in response: ${c.length}, maximum allowed is 5`));for(let a=c.length-1;a>=0;--a){let b=c[a].trim();if("x-gzip"===b||"gzip"===b)i.push(q.createGunzip({flush:q.constants.Z_SYNC_FLUSH,finishFlush:q.constants.Z_SYNC_FLUSH}));else if("deflate"===b)i.push(S({flush:q.constants.Z_SYNC_FLUSH,finishFlush:q.constants.Z_SYNC_FLUSH}));else if("br"===b)i.push(q.createBrotliDecompress({flush:q.constants.BROTLI_OPERATION_FLUSH,finishFlush:q.constants.BROTLI_OPERATION_FLUSH}));else if("zstd"===b)i.push(q.createZstdDecompress({flush:q.constants.ZSTD_e_continue,finishFlush:q.constants.ZSTD_e_end,params:{[q.constants.ZSTD_d_windowLogMax]:23}}));else{i.length=0;break}}}this.body=new ae({read:()=>a.resume()});let j=b=>this.onResponseError(a,b);l({status:b,statusText:e,headersList:g,body:i.length?af(this.body,...i,b=>{b&&this.onResponseError(a,b)}).on("error",j):this.body.on("error",j)})},onResponseData(b,c){a.controller.dump||(i.encodedBodySize+=c.byteLength,!1===this.body.push(c)&&b.pause())},onResponseEnd(){this.abort&&a.controller.off("terminated",this.abort),a.controller.ended=!0,this.body?.push(null)},onResponseError(c,e){(this.abort&&a.controller.off("terminated",this.abort),"websocket"===d.mode&&!1!==j&&e?.code==="UND_ERR_INFO"&&e?.message==="HTTP/2: Extended CONNECT protocol not supported by server")?l(b(h,!1)):(this.body?.destroy(e),c?.aborted||a.controller.terminate(e),m(e))},onRequestUpgrade(a,b,c,d){if(null!=d.session&&200!==b||null==d.session&&101!==b)return null!=d.session&&a.abort(new al("bad upgrade",null)),!1;let e=a?.rawHeaders??[],f=new k;return aw(f,c,e),l({status:b,statusText:ar[b],headersList:f,socket:d}),!0}}))}(b)}({body:j});if(l)g=h({status:c,statusText:e,headersList:f,socket:l});else{let d=b[Symbol.asyncIterator]();a.controller.next=()=>d.next(),g=h({status:c,statusText:e,headersList:f})}}catch(b){if("AbortError"===b.name)return a.controller.connection.destroy(),f(a,b);return e(b)}let l=new ReadableStream({start(b){a.controller.controller=b},pull:()=>a.controller.resume(),cancel:b=>{H(a)||a.controller.abort(b)},type:"bytes"});return g.body={stream:l,source:null,length:null},a.controller.resume||a.controller.on("terminated",function(b){I(a)?(g.aborted=!0,ai(l)&&a.controller.controller.error(a.controller.serializedAbortReason)):ai(l)&&a.controller.controller.error(TypeError("terminated",{cause:J(b)?b:void 0})),a.controller.connection.destroy()}),a.controller.resume=async()=>{for(;;){let b,c;try{let{done:c,value:d}=await a.controller.next();if(I(a))break;b=c?void 0:d}catch(d){a.controller.ended&&!i.encodedBodySize?b=void 0:(b=d,c=!0)}if(void 0===b){L(a.controller.controller),function(a,b){a.request.done=!0,null!=a.processResponseDone&&queueMicrotask(()=>a.processResponseDone(b))}(a,g);return}if(i.decodedBodySize+=b?.byteLength??0,c)return void a.controller.terminate(b);let d=new Uint8Array(b);if(d.byteLength&&a.controller.controller.enqueue(d),ah(l))return void a.controller.terminate();if(a.controller.controller.desiredSize<=0)return}},g}a.exports={fetch:function(a,b){let c;aq.argumentLengthCheck(arguments,1,"globalThis.fetch");let d=Promise.withResolvers();try{c=new l(a,b)}catch(a){return d.reject(a),d.promise}let e=o(c);if(c.signal.aborted)return aA(d,e,null,c.signal.reason,null),d.promise;let f=e.client.globalObject;f?.constructor?.name==="ServiceWorkerGlobalScope"&&(e.serviceWorkers="none");let g=null,h=!1,j=null,k=aj(c.signal,()=>{h=!0,X(null!=j),j.abort(c.signal.reason);let a=g?.deref();aA(d,e,a,c.signal.reason,j.controller)}),m=()=>{k(),p(c)};return j=aB({request:e,processResponseEndOfBody:a=>{ay(a,"fetch"),m()},processResponse:a=>{if(!h){if(a.aborted){aA(d,e,g,j.serializedAbortReason,j.controller),m();return}if("error"===a.type){d.reject(TypeError("fetch failed",{cause:a.error})),m();return}g=new WeakRef(i(a,"immutable")),d.resolve(g.deref()),d=null}},dispatcher:n(c),requestObject:c}),d.promise},Fetch:ax,fetching:aB,finalizeAndReportTiming:ay}},76816:(a,b,c)=>{"use strict";c.d(b,{bI:()=>f.cleanupProviderConnections,iE:()=>f.createProviderConnection,tV:()=>l,PX:()=>n.getApiKeys,Mc:()=>f.getProviderConnectionById,P:()=>f.getProviderConnections,hr:()=>h,LF:()=>k,OH:()=>m,mt:()=>e.getSettings,Op:()=>f.mutateProviderConnection,Iu:()=>f.mutateProviderConnectionQuota,KK:()=>i,rj:()=>f.updateProviderConnection,Xx:()=>e.Xx});var d=c(52825);c(34050);var e=c(45874),f=c(92216);c(7044);var g=c(50743);async function h(a){var b;return(b=(await (0,d.cK)()).get("SELECT * FROM proxyPools WHERE id = ?",[a]))?{...(0,g.q)(b.data,{}),id:b.id,isActive:1===b.isActive||!0===b.isActive,testStatus:b.testStatus,createdAt:b.createdAt,updatedAt:b.updatedAt}:null}async function i(a,b,c){if(!a)return;let e=await (0,d.cK)(),f=new Date().toISOString();e.run(`INSERT INTO quotaCache(connectionId, provider, data, fetchedAt) VALUES(?, ?, ?, ?)
626
+ `)}if(H.streamFailed){j&&!H.protocolFailed&&u(g),a.enqueue(l.encode("data: [DONE]\n\n"));return}if(await I(a,"data: [DONE]\n\n"),j){let b=await j.readAll();await j.cleanup(),u(g),a.enqueue(b)}}});if(!a.body)return t(g),j?.cleanup?.().catch(()=>{}),L(a,K(e));let U=a.body.pipeThrough(T);if(j){let a=U.getReader();U=new ReadableStream({async pull(b){try{let c=await a.read();if(c.done){await j.cleanup(),b.close();return}b.enqueue(c.value)}catch(a){v(g),await j.cleanup(),b.error(a)}},async cancel(b){try{await a.cancel(b)}finally{v(g),await j.cleanup()}}})}return new Response(U,{status:a.status,statusText:a.statusText,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}async refreshCredentials(a,b,c=null,d=null){if(!a.refreshToken){let a=Error("Kiro refresh credential is missing");throw a.name="KiroRefreshCredentialError",a.status=k.gx.UNAUTHORIZED,a.code="MISSING_REFRESH_TOKEN",a.permanent=!0,a}try{return await (0,g.Ql)(a.refreshToken,a.providerSpecificData,b,c,d)}catch(a){if(d?.aborted||a?.name==="AbortError"||(b?.error?.("TOKEN",a?.permanent===!0?"Kiro refresh credential was rejected":"Kiro refresh failed due to a transient error"),a?.permanent===!0))throw a;return null}}canRefreshCredentials(){return!0}}},73952:(a,b,c)=>{"use strict";c.d(b,{$O:()=>k,AUTOCLAW_WALLET_ENDPOINT:()=>i,Cw:()=>g,VR:()=>h,_V:()=>j,buildAutoClawWalletHeaders:()=>m,df:()=>e,p8:()=>l});var d=c(55511);let e="100003",f="https://autoglm-api.autoglm.ai",g=`${f}/autoclaw-proxy/proxy/autoclaw`,h=`${f}/userapi/v1/refresh`,i=`${f}/agent-assetmgr/api/v2/wallets?biz_app_id=autoclaw`,j="1.10.0";function k(a){let b=`${e}&${a}&38d2391985e2369a5fb8227d8e6cd5e5`;return(0,d.createHash)("md5").update(b).digest("hex")}function l(a={}){let b=String(Math.floor(Date.now()/1e3));return{accept:"*/*","content-type":"application/json",origin:"https://autoclaw.z.ai",referer:"https://autoclaw.z.ai/","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36","x-auth-appid":e,"x-auth-timestamp":b,"x-auth-sign":k(b),"x-product":"autoclaw","x-version":j,"x-tm":"web","x-channel":"official","x-client-type":"web","x-trace-id":(0,d.randomUUID)(),"x-lang":"zh-CN",...a}}function m(a){let b=String(a||"").replace(/^Bearer\s+/i,"");return l({authorization:`Bearer ${b}`})}},73997:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"gemini-web",priority:220,alias:"gemini-web",aliases:["gweb"],uiAlias:"gemini-web",category:"webCookie",authType:"cookie",authModes:["cookie"],serviceKinds:["image"],display:{name:"Gemini Web",icon:"auto_awesome",color:"#4285F4",textIcon:"GW",website:"https://gemini.google.com",notice:{text:"Paste your __Secure-1PSID (and __Secure-1PSIDTS) cookie value(s) from gemini.google.com"}},transport:{baseUrl:"https://gemini.google.com/app",format:"openai",authType:"cookie"},models:[{id:"gemini-3.1-pro",name:"Gemini 3.1 Pro"},{id:"gemini-3.7-flash",name:"Gemini 3.7 Flash"},{id:"gemini-3.1-flash-lite",name:"Gemini 3.1 Flash-Lite"},{id:"gemini-image",name:"Gemini Image (web)",params:["n","size"],kind:"image"}]}},74262:(a,b,c)=>{"use strict";c.d(b,{Q:()=>s});var d=c(40610),e=c.n(d),f=c(77030),g=c(69384);let h="https://veoaifree.com",i=`${h}/wp-admin/admin-ajax.php`,j=new Set([202,404,409,425]);function k(a){let b=String(a).toLowerCase().replace(/^\[|\]$/g,""),c=b.startsWith("::ffff:")?b.slice(7):b;if(c.includes(".")){let[a,b]=c.split(".").map(Number);return 0===a||10===a||127===a||a>=224||172===a&&b>=16&&b<=31||192===a&&168===b||169===a&&254===b}return"::1"===c||c.startsWith("fc")||c.startsWith("fd")||c.startsWith("fe80")||c.startsWith("fe9")||c.startsWith("fea")||c.startsWith("feb")}async function l(a){let b=a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a;if((0,f.isIP)(b)){if(k(b))throw Error("artifact host is a blocked address");return}let c=await e().promises.lookup(b,{all:!0}).catch(()=>[]);if(!c.length)throw Error("artifact host could not be resolved");for(let{address:a}of c)if(k(a))throw Error("artifact host resolves to a blocked address")}async function m(a,b,c={}){let d=new AbortController,e=setTimeout(()=>d.abort(Error("veoaifree request timed out")),3e4),f=()=>d.abort(a.signal?.reason||Error("aborted"));a.signal?.aborted?f():a.signal?.addEventListener("abort",f,{once:!0});try{let e={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36",Referer:`${h}/`,...c.headers||{}};a.cookieHeader&&void 0===e.Cookie&&(e.Cookie=a.cookieHeader);let f=await fetch(b,{...c,headers:e,signal:d.signal});return!function(a,b){let c="function"==typeof b.headers.getSetCookie?b.headers.getSetCookie():b.headers.get("set-cookie")?[b.headers.get("set-cookie")]:[];if(!c.length)return;let d=new Map(a.cookieHeader.split(";").filter(Boolean).map(a=>{let b=a.trim().indexOf("=");return b>0?[a.trim().slice(0,b),a.trim().slice(b+1)]:null}).filter(Boolean));for(let a of c){let b=a.split(";")[0]?.trim(),c=b?.indexOf("=");c>0&&b.slice(c+1)&&d.set(b.slice(0,c).trim(),b.slice(c+1))}a.cookieHeader=[...d.entries()].map(([a,b])=>`${a}=${b}`).join("; ")}(a,f),f}finally{clearTimeout(e),a.signal?.removeEventListener("abort",f)}}async function n(a){let b=await m(a,h),c=(await b.text()).match(/nonce":"([a-f0-9]+)"/);if(!c)throw Error("failed to extract CSRF nonce from veoaifree.com (site layout changed or rate limited)");return c[1]}async function o(a,b,c){let d=new URLSearchParams({action:"veo_video_generator",nonce:b,...c});return(await m(a,i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Origin:h},body:d.toString()})).text()}function p(a,b){let c=String(a||"").toLowerCase();return/9:16|portrait/.test(c)?`${b}_PORTRAIT`:/1:1|square/.test(c)?`${b}_SQUARE`:`${b}_LANDSCAPE`}async function q(a,b){let c=b;for(let b=0;b<=3;b++){let b=new URL(c);if("https:"!==b.protocol)throw Error("artifact URL must use HTTPS");await l(b.hostname);let d=await m(a,b.toString(),{method:"GET",redirect:"manual"});if(d.status>=300&&d.status<400){let a=d.headers.get("location");if(!a)throw Error("artifact redirect is missing a destination");c=new URL(a,b.toString()).toString();continue}if(j.has(d.status))throw Object.assign(Error("artifact not available yet"),{retryable:!0});if(!d.ok)throw Error(`artifact download failed (HTTP ${d.status})`);let e=(d.headers.get("content-type")||"").split(";")[0].trim().toLowerCase();if(!["video/mp4","application/octet-stream"].includes(e))throw Error(`artifact returned unsupported content type (${e})`);let f=Buffer.from(await d.arrayBuffer());if(f.byteLength>0x6400000)throw Error("artifact exceeds 100MB limit");if(f.length<12||"ftyp"!==f.toString("ascii",4,8))throw Error("artifact is not a valid MP4 file");return f}throw Error("artifact exceeded the redirect limit")}async function r(a,b){let c=null;for(let d=0;d<12;d++)try{return await q(a,b)}catch(a){if(!a.retryable)throw a;c=a,await new Promise(a=>setTimeout(a,5e3))}throw c||Error("artifact did not become available in time")}class s extends g.Hv{constructor(){super("veoaifree-web",{id:"veoaifree-web",baseUrl:h})}async execute(){return{response:new Response(JSON.stringify({error:{message:"veoaifree-web is a media provider — use /v1/images/generations or /v1/videos/generations",type:"invalid_request"}}),{status:400,headers:{"Content-Type":"application/json"}}),url:i,headers:{},transformedBody:{}}}async generateMedia({prompt:a,kind:b="video",size:c,credentials:d,signal:e,log:f}){if("video"!==b&&"image"!==b)throw Error("veoaifree-web supports image and video generation only");if(!a?.trim())throw Error("prompt is required");let g={cookieHeader:"",signal:e},h=await n(g);if("image"===b){let b=(await o(g,h,{promptIMG:a,totalVariationsIMG:"1",aspectRatioIMG:p(c,"IMAGE_ASPECT_RATIO"),actionType:"banan-image-generator"})).trim();if(!b||"0"===b||b.toLowerCase().includes("error"))throw Error(`veoaifree image generation failed: ${b.slice(0,120)}`);return b.split(",").map(a=>a.trim()).filter(Boolean).map(a=>/^https?:\/\//i.test(a)?{url:a}:{b64:a,mime:"image/png"})}let i=(await o(g,h,{prompt:a,totalVariations:"1",aspectRatio:p(c,"VIDEO_ASPECT_RATIO"),actionType:"full-video-generate"})).trim();if(!i||"0"===i||i.toLowerCase().includes("error"))throw Error(`veoaifree video submit failed: ${i.slice(0,120)}`);for(let a=0;a<30;a++){if(e?.aborted)throw Error("aborted");await new Promise(a=>setTimeout(a,2e4));let b=(await o(g,h,{sceneData:i,actionType:"final-video-results"})).trim();if(!b||"0"===b||b.toLowerCase().includes("error"))continue;let c=b.split(/[,\n]/).map(a=>a.trim()).find(a=>/^https?:\/\//i.test(a));if(!c)continue;let d=await r(g,c);return f?.info?.("VEOAI-FREE",`video ready after ${a+1} poll(s)`),[{b64:d.toString("base64"),mime:"video/mp4"}]}throw Error("veoaifree video generation timed out after 10 minutes")}}},74345:(a,b,c)=>{"use strict";let d;c.d(b,{A:()=>w});var e=c(31421),f=c(73024),g=c.n(f),h=c(76760),i=c.n(h),j=c(73136),k=c(53859);let l={"playwright-core":"^1.54.2"};function m(){return i().join(k.n,"runtime")}function n(){return d??=import("node:module").then(a=>a.createRequire)}function o(a){let b=String(a?.code||"");return"MODULE_NOT_FOUND"===b||"ERR_MODULE_NOT_FOUND"===b}async function p(){try{let{pruneForeignNativeBinaries:a}=(await n())("file:///zevairouter-build/open-sse/services/lazyRuntime.js")("../../cli/hooks/pruneNativeBinaries.js");a(m(),{silent:!0})}catch{}}async function q(a,b){let c,d,f,h,j=m(),k=await (c=m(),g().mkdirSync(c,{recursive:!0}),d=i().join(c,"package.json"),!g().existsSync(d)&&g().writeFileSync(d,JSON.stringify({name:"zevai-runtime",private:!0},null,2)),f="win32"===process.platform?"npm.cmd":"npm",h=["install","--no-audit","--no-fund","--prefer-online",`${a}@${b}`],new Promise(a=>{let b=(0,e.spawn)(f,h,{cwd:c,stdio:["ignore","pipe","pipe"],shell:"win32"===process.platform}),d="";b.stderr?.on("data",a=>{d+=String(a)}),b.on("error",b=>a({ok:!1,stderr:String(b.message||b)})),b.on("close",b=>a({ok:0===b,stderr:d}))}));if(!k.ok){let c=(k.stderr.match(/npm ERR! ?(.+)/)||[])[1]||k.stderr.split("\n").filter(Boolean).pop()||"unknown npm error";throw Error(`${a} is missing and the on-demand install failed (${String(c).slice(0,160)}) — install it manually: cd "${j}" && npm install ${a}@${b}`)}await p()}let r=new Map;function s(a){if(!a||"object"!=typeof a)return a;let b=a.default;return b&&"object"==typeof b&&(b.chromium&&!a.chromium||"function"==typeof b.createSession&&"function"!=typeof a.createSession)?b:a}async function t(a){return s(await import(a))}async function u(a,b){let c=a.resolve(b),d=i().dirname(c),e=i().join(d,"index.mjs");if(g().existsSync(e))try{return s(await import((0,j.pathToFileURL)(e).href))}catch(a){if(!o(a))throw a}return s(await import((0,j.pathToFileURL)(c).href))}async function v(a){if(!Object.hasOwn(l,a))throw Error(`${a} is not a supported runtime dependency`);try{return await t(a)}catch(a){if(!o(a))throw a}let b=(await n())(i().join(m(),"package.json"));try{return s(b(a))}catch(a){if(!o(a))throw a}try{return await u(b,a)}catch(a){if(!o(a))throw a}let c=l[a],d=()=>{try{return s(b(a))}catch(c){if(!o(c))throw c;return u(b,a)}};await q(a,c);try{return await d()}catch(b){if(!o(b))throw b;return g().rmSync(i().join(m(),"node_modules",a),{recursive:!0,force:!0}),await q(a,c),d()}}function w(a){return r.has(a)||r.set(a,v(a).finally(()=>r.delete(a))),r.get(a)}},74399:(a,b,c)=>{"use strict";let d=c(7344),{InvalidArgumentError:e}=c(61448),{toRawHeaders:f}=c(84285),{kOriginless:g,kUrl:h}=c(49176);class i{#a$;constructor(a){this.#a$=a}onRequestStart(a,b){this.#a$.onConnect?.(b=>a.abort(b),b)}onRequestUpgrade(a,b,c,d){let e=Array.isArray(a?.rawHeaders)?a.rawHeaders:f(a?.rawHeaders??c??{});this.#a$.onUpgrade?.(b,e,d)}onResponseStart(a,b,c,d){let e=Array.isArray(a?.rawHeaders)?a.rawHeaders:f(a?.rawHeaders??c??{});this.#a$.onHeaders?.(b,e,()=>a.resume(),d)===!1&&a.pause()}onResponseData(a,b){this.#a$.onData?.(b)===!1&&a.pause()}onResponseEnd(a,b){let c=Array.isArray(a?.rawTrailers)?a.rawTrailers:f(a?.rawTrailers??b??{});this.#a$.onComplete?.(c)}onResponseError(a,b){if(!this.#a$.onError)throw b;this.#a$.onError(b)}onBodySent(a){this.#a$.onBodySent?.(a)}onRequestSent(){this.#a$.onRequestSent?.()}onResponseStarted(){this.#a$.onResponseStarted?.()}}class j extends d{#d;constructor(a){if(super(),!a||"function"!=typeof a.dispatch)throw new e("Argument dispatcher must implement dispatch");this.#d=a,this[h]=a[h],this[g]=a[g]}static wrapHandler(a){if(!a||"object"!=typeof a)throw new e("handler must be an object");return"function"==typeof a.onRequestStart?a:new i(a)}dispatch(a,b){return!1!==a.allowH2&&(a={...a,allowH2:!1}),this.#d.dispatch(a,j.wrapHandler(b))}get webSocketOptions(){return this.#d.webSocketOptions}get eventSourceOptions(){return this.#d.eventSourceOptions}close(...a){return this.#d.close(...a)}destroy(...a){return this.#d.destroy(...a)}}a.exports=j},74760:(a,b,c)=>{"use strict";c.d(b,{m:()=>g});var d=c(88164),e=c(30395);let f={id:"codebuddy-intl",baseUrl:"https://www.codebuddy.ai/v2/chat/completions",format:"openai",forceStream:!0,thinkingFormat:"openai",domain:"www.codebuddy.ai",refreshUrl:"https://www.codebuddy.ai/v2/plugin/auth/token/refresh",headers:{"User-Agent":"IDE/2.108.1 CodeBuddy/2.108.1","X-Product":"SaaS","X-IDE-Type":"IDE","X-IDE-Name":"IDE","x-requested-with":"XMLHttpRequest","x-codebuddy-request":"1"}};class g extends d.L{constructor(){super("codebuddy-intl",e.xq["codebuddy-intl"]||f)}transformRequest(a,b,c,d){let e=super.transformRequest(a,b,c,d);e.stream=!0;let f=e.reasoning_effort;"none"===f||"off"===f?delete e.reasoning_effort:f&&(e.reasoning_summary="auto");let g=Array.isArray(e.messages)?e.messages:[];for(let a of(e.messages=[{role:"system",content:"You are CodeBuddy Code."}],g))!a||"object"!=typeof a||["system","developer"].includes(a.role)||("user"===a.role&&"string"==typeof a.content?e.messages.push({...a,content:[{type:"text",text:a.content}]}):e.messages.push({...a}));return e}parseError(a,b){if(b)try{let a=JSON.parse(b),c=a?.msg||a?.message||a?.error?.message||"";if(a?.code===6004||/超出频率限制|frequency limit|限额/i.test(c)){let a=null,b=c.match(/(\d{4}-\d{2}-\d{2})\s+(\d{2}:\d{2}:\d{2})(?:\s*UTC\+?([0-9:]+))?/i);if(b){let c=b[1],d=b[2],e=b[3]?b[3].includes(":")?b[3].startsWith("+")?b[3]:`+${b[3]}`:`+${b[3].padStart(2,"0")}:00`:"+08:00",f=new Date(`${c}T${d}${e}`);isNaN(f.getTime())||(a=f.getTime())}return{status:429,message:c||"CodeBuddy frequency limit (6004)",resetsAtMs:a}}}catch{}return super.parseError(a,b)}}},76316:(a,b,c)=>{"use strict";let d,{InvalidArgumentError:e,NotSupportedError:f}=c(61448),g=c(34589),{isValidHTTPToken:h,isValidHeaderValue:i,isStream:j,destroy:k,isBuffer:l,isFormDataLike:m,isIterable:n,hasSafeIterator:o,isBlobLike:p,serializePathWithQuery:q,parseHeaders:r,assertRequestHandler:s,getServerName:t,normalizedMethodRecords:u,getProtocolFromUrlString:v}=c(84285),{channels:w}=c(62571),{headerNameLowerCasedRecord:x}=c(28820),y=/[^\u0021-\u00ff]/,z=Symbol("handler"),A=Symbol("controller"),B=Symbol("resume");class C{#N=!1;#cj=null;#W=!1;#ck;[B]=null;rawHeaders=null;rawTrailers=null;constructor(a){this.#ck=a}pause(){this.#N=!0}resume(){this.#N&&(this.#N=!1,this[B]?.())}abort(a){this.#W||(this.#W=!0,this.#cj=a,this.#ck(a))}get aborted(){return this.#W}get reason(){return this.#cj}get paused(){return this.#N}}class D{constructor(a,{path:b,method:f,body:g,headers:r,query:x,idempotent:A,blocking:B,upgrade:C,headersTimeout:D,bodyTimeout:F,reset:G,expectContinue:H,servername:I,throwOnError:J,maxRedirections:K,typeOfService:L},M){if("string"!=typeof b)throw new e("path must be a string");if("/"===b[0]||b.startsWith("http://")||b.startsWith("https://")||"CONNECT"===f){if(y.test(b))throw new e("invalid request path")}else throw new e("path must be an absolute URL or start with a slash");if("string"!=typeof f)throw new e("method must be a string");if(void 0===u[f]&&!h(f))throw new e("invalid request method");if(C&&"string"!=typeof C)throw new e("upgrade must be a string");if(C&&!i(C))throw new e("invalid upgrade header");if(null!=D&&(!Number.isFinite(D)||D<0))throw new e("invalid headersTimeout");if(null!=F&&(!Number.isFinite(F)||F<0))throw new e("invalid bodyTimeout");if(null!=G&&"boolean"!=typeof G)throw new e("invalid reset");if(null!=H&&"boolean"!=typeof H)throw new e("invalid expectContinue");if(null!=J)throw new e("invalid throwOnError");if(null!=K&&0!==K)throw new e("maxRedirections is not supported, use the redirect interceptor");if(null!=L&&(!Number.isInteger(L)||L<0||L>255))throw new e("typeOfService must be an integer between 0 and 255");if(this.headersTimeout=D,this.bodyTimeout=F,this.method=f,this.typeOfService=L,this.abort=null,null==g)this.body=null;else if(j(g)){this.body=g;let a=this.body._readableState;a&&a.autoDestroy||(this.endHandler=function(){k(this)},this.body.on("end",this.endHandler)),this.errorHandler=a=>{this.abort?this.abort(a):this.error=a},this.body.on("error",this.errorHandler)}else if(l(g))this.body=g.byteLength?g:null;else if(ArrayBuffer.isView(g))this.body=g.buffer.byteLength?Buffer.from(g.buffer,g.byteOffset,g.byteLength):null;else if(g instanceof ArrayBuffer)this.body=g.byteLength?Buffer.from(g):null;else if("string"==typeof g)this.body=g.length?Buffer.from(g):null;else if(m(g)){var N;if(N=g,void 0===d&&(c(2887),d=c(32984).webidl.is.FormData),!d(N))throw new e("body must be a FormData created by this undici package instance; FormData from other sources, such as the built-in FormData provided by Node.js, is not supported");this.body=g}else if(n(g)||p(g))this.body=g;else throw new e("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");if(this.completed=!1,this.aborted=!1,this.upgrade=C||null,this.path=x?q(b,x):b,this.origin=a,this.protocol=v(a),this.idempotent=null==A?"HEAD"===f||"GET"===f||"QUERY"===f:A,this.blocking=B??"HEAD"!==this.method,this.reset=null==G?null:G,this.host=null,this.contentLength=null,this.contentType=null,this.headers=[],this.expectContinue=null!=H&&H,Array.isArray(r)){if(r.length%2!=0)throw new e("headers array must be even");for(let a=0;a<r.length;a+=2)E(this,r[a],r[a+1])}else if(r&&"object"==typeof r)if(o(r))for(let a of r){if(!Array.isArray(a)||2!==a.length)throw new e("headers must be in key-value pair format");E(this,a[0],a[1])}else{let a=Object.keys(r);for(let b=0;b<a.length;++b)E(this,a[b],r[a[b]])}else if(null!=r)throw new e("headers must be an object or an array");s(M,f,C),this.servername=I||t(this.host)||null,this[z]=M,w.create.hasSubscribers&&w.create.publish({request:this})}onBodySent(a){if(w.bodyChunkSent.hasSubscribers&&w.bodyChunkSent.publish({request:this,chunk:a}),this[z].onBodySent)try{return this[z].onBodySent(a)}catch(a){this.abort(a)}}onRequestSent(){if(w.bodySent.hasSubscribers&&w.bodySent.publish({request:this}),this[z].onRequestSent)try{return this[z].onRequestSent()}catch(a){this.abort(a)}}onRequestStart(a,b){return(g(!this.aborted),g(!this.completed),this[A]=new C(a),this.error)?void this[A].abort(this.error):(this.abort=a,this[z].onRequestStart(this[A],b))}onResponseStarted(){return this[z].onResponseStarted?.()}onResponseStart(a,b,c,d){g(!this.aborted),g(!this.completed),w.headers.hasSubscribers&&w.headers.publish({request:this,response:{statusCode:a,headers:b,statusText:d}});let e=this[A];e&&(e[B]=c,e.rawHeaders=b);let f=Array.isArray(b)?r(b):b;try{return this[z].onResponseStart?.(e,a,f,d),!e?.paused}catch(a){return this.abort(a),!1}}onResponseData(a){g(!this.aborted),g(!this.completed),w.bodyChunkReceived.hasSubscribers&&w.bodyChunkReceived.publish({request:this,chunk:a});let b=this[A];try{return this[z].onResponseData?.(b,a),!b?.paused}catch(a){return this.abort(a),!1}}onRequestUpgrade(a,b,c,d=""){this.onFinally(),g(!this.aborted),g(!this.completed),w.headers.hasSubscribers&&w.headers.publish({request:this,response:{statusCode:a,headers:b,statusText:d}});let e=this[A];e&&(e.rawHeaders=b);let f=Array.isArray(b)?r(b):b,h=this[z].onRequestUpgrade?.(e,a,f,c);return!this.aborted&&(this.completed=!0,w.trailers.hasSubscribers&&w.trailers.publish({request:this,trailers:[]})),h}onResponseEnd(a){this.onFinally(),g(!this.aborted),g(!this.completed),this.completed=!0,w.trailers.hasSubscribers&&w.trailers.publish({request:this,trailers:a});let b=this[A];b&&(b.rawTrailers=a);let c=Array.isArray(a)?r(a):a;try{return this[z].onResponseEnd?.(b,c)}catch(a){this.onResponseError(a)}}onResponseError(a){if(this.onFinally(),w.error.hasSubscribers&&w.error.publish({request:this,error:a}),this.aborted)return;this.aborted=!0;let b=this[A];return this[z].onResponseError?.(b,a)}onFinally(){this.errorHandler&&(this.body.off("error",this.errorHandler),this.errorHandler=null),this.endHandler&&(this.body.off("end",this.endHandler),this.endHandler=null)}addHeader(a,b){return E(this,a,b),this}}function E(a,b,c){if(c&&"object"==typeof c&&!Array.isArray(c))throw new e(`invalid ${b} header`);if(void 0===c)return;let d=x[b];if(void 0===d&&void 0===x[d=b.toLowerCase()]&&!h(d))throw new e("invalid header key");if(Array.isArray(c)){let a=[];for(let d=0;d<c.length;d++)if("string"==typeof c[d]){if(!i(c[d]))throw new e(`invalid ${b} header`);a.push(c[d])}else if(null===c[d])a.push("");else if("object"==typeof c[d])throw new e(`invalid ${b} header`);else{let f=`${c[d]}`;if(!i(f))throw new e(`invalid ${b} header`);a.push(f)}c=a}else if("string"==typeof c){if(!i(c))throw new e(`invalid ${b} header`)}else if(null===c)c="";else if(!i(c=`${c}`))throw new e(`invalid ${b} header`);if("host"===d){if(null!==a.host)throw new e("duplicate host header");if("string"!=typeof c)throw new e("invalid host header");a.host=c}else if("content-length"===d){if(null!==a.contentLength)throw new e("duplicate content-length header");if(!function(a){if("string"!=typeof a||0===a.length)return!1;for(let b=0;b<a.length;b++){let c=a.charCodeAt(b);if(c<48||c>57)return!1}return!0}(c))throw new e("invalid content-length header");a.contentLength=parseInt(c,10)}else if(null===a.contentType&&"content-type"===d)a.contentType=c,a.headers.push(b,c);else if("transfer-encoding"===d||"keep-alive"===d||"upgrade"===d)throw new e(`invalid ${d} header`);else if("connection"===d){let b="string"==typeof c?c:null;if(null===b)throw new e("invalid connection header");for(let c of b.toLowerCase().split(",")){let b=c.trim();if(!h(b))throw new e("invalid connection header");"close"===b&&(a.reset=!0)}}else if("expect"===d)throw new f("expect header not supported");else a.headers.push(b,c)}a.exports=D},76394:(a,b,c)=>{"use strict";c.d(b,{iC:()=>l});var d=c(77598),e=c(46956),f=c(32185);let g=new Map,h=new Map;async function i(a,b,c){try{let d=await (0,e.Fm)((0,f.oj)(c)||f._G,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","User-Agent":"qodercli/1.0.0"},signal:b.signal},b.proxyOptions);if(!d.ok)return"";let g=await d.json().catch(()=>null);return g?.id||g?.userId||g?.user_id||""}catch{return""}}async function j(a,b,c){let d=await (0,e.Fm)((0,f.uR)(c)||f.OQ,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"qodercli/1.0.0","Cosy-Version":f.cT,"Cosy-ClientType":f.Ty},body:JSON.stringify({personal_token:a}),signal:b.signal},b.proxyOptions);if(!d.ok){let a=Error(`Qoder PAT exchange failed with HTTP ${d.status}`);throw a.status=d.status,a.code=401===d.status||403===d.status?"QODER_PAT_REJECTED":"QODER_PAT_EXCHANGE_FAILED",a}let g=await d.json().catch(()=>null),h=g?.token||g?.access_token;if("string"!=typeof h||!h.startsWith("jt-")){let a=Error("Qoder PAT exchange returned an invalid job token");throw a.code="QODER_JOB_TOKEN_INVALID",a}let j=g.userId||g.user_id||await i(h,b,c);return{accessToken:h,userId:j||"",expiresAt:function(a,b){if(a?.expires_at){let b=Date.parse(a.expires_at);if(Number.isFinite(b))return b}let c=Number(a?.expires_in);return Number.isFinite(c)&&c>0?b+1e3*c:null}(g,Date.now())}}async function k(a,b,c){let e=(0,d.createHash)("sha256").update(`qoder-pat:${c}:${a}`).digest("hex"),f=g.get(e);if(f&&f.expiresAt-Date.now()>3e5)return f;if(h.has(e))return h.get(e);let i=j(a,b,c).then(a=>(Number.isFinite(a.expiresAt)&&g.set(e,a),a)).finally(()=>{h.get(e)===i&&h.delete(e)});return h.set(e,i),i}async function l(a,b={}){let c=a?.apiKey||a?.accessToken;if(!("string"==typeof c&&/^pt-.+/.test(c)&&c.length>6))return a;let d=function(a,b={}){return b.region||(0,f.ty)(a?.provider||b.provider)}(a,b),e=await k(c,b,d);return{...a,provider:a?.provider||("cn"===d?"qoder-cn":"qoder"),apiKey:void 0,accessToken:e.accessToken,providerSpecificData:{...a.providerSpecificData||{},authMethod:"pat",userId:e.userId||a.providerSpecificData?.userId||"",machineId:a.providerSpecificData?.machineId||""}}}},76403:(a,b,c)=>{"use strict";let d,{makeNetworkError:e,makeAppropriateNetworkError:f,filterResponse:g,makeResponse:h,fromInnerResponse:i,getResponseState:j}=c(78196),{HeadersList:k}=c(28665),{Request:l,cloneRequest:m,getRequestDispatcher:n,getRequestState:o,removeRequestAbortListener:p}=c(12600),q=c(38522),{makePolicyContainer:r,clonePolicyContainer:s,requestBadPort:t,TAOCheck:u,appendRequestOriginHeader:v,responseLocationURL:w,requestCurrentURL:x,setRequestReferrerPolicyOnRedirect:y,tryUpgradeRequestToAPotentiallyTrustworthyURL:z,createOpaqueTimingInfo:A,appendFetchMetadata:B,corsCheck:C,crossOriginResourcePolicyCheck:D,determineRequestsReferrer:E,coarsenedSharedCurrentTime:F,sameOrigin:G,isCancelled:H,isAborted:I,isErrorLike:J,fullyReadBody:K,readableStreamClose:L,urlIsLocal:M,urlIsHttpHttpsScheme:N,urlHasHttpsScheme:O,clampAndCoarsenConnectionTimingInfo:P,simpleRangeHeaderValue:Q,buildContentRange:R,createInflate:S,extractMimeType:T,hasAuthenticationEntry:U,includesCredentials:V,isTraversableNavigable:W}=c(42425),X=c(34589),{safelyExtractBody:Y,extractBody:Z}=c(35381),{redirectStatusSet:$,nullBodyStatus:_,safeMethodsSet:aa,requestBodyHeader:ab,subresourceSet:ac}=c(19608),ad=c(78474),{Readable:ae,pipeline:af,finished:ag,isErrored:ah,isReadable:ai}=c(57075),{addAbortListener:aj,bufferToLowerCasedHeaderName:ak}=c(84285),{SocketError:al}=c(61448),{dataURLProcessor:am,serializeAMimeType:an,minimizeSupportedMimeType:ao}=c(16537),{getGlobalDispatcher:ap}=c(59970),{webidl:aq}=c(32984),{STATUS_CODES:ar}=c(37067),{bytesMatch:as}=c(64371),{isomorphicEncode:at}=c(70745),au=["GET","HEAD"],av="u">typeof __UNDICI_IS_NODE__||"u">typeof esbuildDetection?"node":"undici";function aw(a,b,c){if(Array.isArray(c)){for(let b=0;b<c.length;b+=2){let d=ak(c[b]),e=c[b+1];if(Array.isArray(e)&&!Buffer.isBuffer(e))for(let b of e)a.append(d,b.toString("latin1"),!0);else a.append(d,e.toString("latin1"),!0)}return}for(let[c,d]of Object.entries(b??{}))if(Array.isArray(d))for(let b of d)a.append(c,`${b}`,!0);else a.append(c,`${d}`,!0)}class ax extends ad{constructor(a){super(),this.dispatcher=a,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(a){"ongoing"===this.state&&(this.state="terminated",this.connection?.destroy(a),this.emit("terminated",a))}abort(a){"ongoing"===this.state&&(this.state="aborted",a||(a=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=a,this.connection?.destroy(a),this.emit("terminated",a))}}function ay(a,b="other"){if("error"===a.type&&a.aborted||!a.urlList?.length)return;let c=a.urlList[0],d=a.timingInfo,e=a.cacheState;N(c)&&null!==d&&(a.timingAllowPassed||(d=A({startTime:d.startTime}),e=""),d.endTime=F(),a.timingInfo=d,az(d,c.href,b,globalThis,e,"",a.status))}let az=performance.markResourceTiming;function aA(a,b,c,d,e){if(a&&a.reject(d),b.body?.stream!=null&&ai(b.body.stream)&&b.body.stream.cancel(d).catch(a=>{if("ERR_INVALID_STATE"!==a.code)throw a}),null==c)return;let f=j(c);f.body?.stream!=null&&ai(f.body.stream)&&e.error(d)}function aB({request:a,processRequestBodyChunkLength:b,processRequestEndOfBody:c,processResponse:d,processResponseEndOfBody:e,processResponseConsumeBody:f,useParallelQueue:g=!1,dispatcher:h=ap(),requestObject:i=null}){X(h);let j=null,k=!1;null!=a.client&&(j=a.client.globalObject,k=a.client.crossOriginIsolatedCapability);let l=A({startTime:F(k)}),m={controller:new ax(h),request:a,timingInfo:l,processRequestBodyChunkLength:b,processRequestEndOfBody:c,processResponse:d,processResponseConsumeBody:f,processResponseEndOfBody:e,taskDestination:j,crossOriginIsolatedCapability:k,requestObject:i};return X(!a.body||a.body.stream),"client"===a.window&&(a.window=a.client?.globalObject?.constructor?.name==="Window"?a.client:"no-window"),"client"===a.origin&&(a.origin=a.client.origin),"client"===a.policyContainer&&(null!=a.client?a.policyContainer=s(a.client.policyContainer):a.policyContainer=r()),a.headersList.contains("accept",!0)||a.headersList.append("accept","*/*",!0),a.headersList.contains("accept-language",!0)||a.headersList.append("accept-language","*",!0),a.priority,ac.has(a.destination),aC(m,!1),m.controller}async function aC(a,b){try{let c=a.request,d=null;if(c.localURLsOnly&&!M(x(c))&&(d=e("local URLs only")),z(c),"blocked"===t(c)&&(d=e("bad port")),""===c.referrerPolicy&&(c.referrerPolicy=c.policyContainer.referrerPolicy),"no-referrer"!==c.referrer&&(c.referrer=E(c)),null===d){let b=x(c);G(b,c.url)&&"basic"===c.responseTainting||"data:"===b.protocol||"navigate"===c.mode||"websocket"===c.mode?(c.responseTainting="basic",d=await aD(a)):"same-origin"===c.mode?d=e('request mode cannot be "same-origin"'):"no-cors"===c.mode?"follow"!==c.redirect?d=e('redirect mode cannot be "follow" for "no-cors" request'):(c.responseTainting="opaque",d=await aD(a)):N(x(c))?(c.responseTainting="cors",d=await aF(a)):d=e("URL scheme must be a HTTP(S) scheme")}if(b)return d;0===d.status||d.internalResponse||(c.responseTainting,"basic"===c.responseTainting?d=g(d,"basic"):"cors"===c.responseTainting?d=g(d,"cors"):"opaque"===c.responseTainting?d=g(d,"opaque"):X(!1));let f=0===d.status?d:d.internalResponse;if(0===f.urlList.length&&f.urlList.push(...c.urlList),c.timingAllowFailed||(d.timingAllowPassed=!0),"opaque"===d.type&&206===f.status&&f.rangeRequested&&!c.headers.contains("range",!0)&&(d=f=e()),0!==d.status&&("HEAD"===c.method||"CONNECT"===c.method||_.includes(f.status))&&(f.body=null,a.controller.dump=!0),c.integrity){let b=b=>aE(a,e(b));if("opaque"===c.responseTainting||null==d.body)return void b(d.error);K(d.body,e=>{as(e,c.integrity)?(d.body=Y(e)[0],aE(a,d)):b("integrity mismatch")},b)}else aE(a,d)}catch(b){a.controller.terminate(b)}}function aD(a){if(H(a))return Promise.resolve(f(a));let{request:b}=a,{protocol:g}=x(b);switch(g){case"about:":return Promise.resolve(e("about scheme is not supported"));case"blob:":{d||(d=c(4573).resolveObjectURL);let a=x(b);if(0!==a.search.length)return Promise.resolve(e("NetworkError when attempting to fetch resource."));let f=d(a.toString());if("GET"!==b.method||!aq.is.Blob(f))return Promise.resolve(e("invalid method"));let g=h(),i=f.size,j=at(`${i}`),k=f.type;if(b.headersList.contains("range",!0)){g.rangeRequested=!0;let a=Q(b.headersList.get("range",!0),!0);if("failure"===a)return Promise.resolve(e("failed to fetch the data URL"));let{rangeStartValue:c,rangeEndValue:d}=a;if(null===c)d=(c=i-d)+d-1;else{if(c>=i)return Promise.resolve(e("Range start is greater than the blob's size."));(null===d||d>=i)&&(d=i-1)}let h=f.slice(c,d+1,k);g.body=Z(h)[0];let j=at(`${h.size}`),l=R(c,d,i);g.status=206,g.statusText="Partial Content",g.headersList.set("content-length",j,!0),g.headersList.set("content-type",k,!0),g.headersList.set("content-range",l,!0)}else{let a=Z(f);g.statusText="OK",g.body=a[0],g.headersList.set("content-length",j,!0),g.headersList.set("content-type",k,!0)}return Promise.resolve(g)}case"data:":{let a=am(x(b));if("failure"===a)return Promise.resolve(e("failed to fetch the data URL"));return Promise.resolve(h({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:an(a.mimeType)}]],body:Y(a.body)[0]}))}case"file:":return Promise.resolve(e("not implemented... yet..."));case"http:":case"https:":return aF(a).catch(a=>e(a));default:return Promise.resolve(e("unknown scheme"))}}function aE(a,b){let c=a.timingInfo;"document"===a.request.destination&&(a.controller.fullTimingInfo=c);let d=()=>{let d=Date.now();a.controller.reportTimingSteps=()=>{if(!N(a.request.url))return;c.endTime=d;let e=b.cacheState,f=b.bodyInfo;b.timingAllowPassed||(c=A(c),e="");let g=0;if("navigate"!==a.request.mode||!b.hasCrossOriginRedirects){g=b.status;let a=T(b.headersList);"failure"!==a&&(f.contentType=ao(a))}null!=a.request.initiatorType&&az(c,a.request.url.href,a.request.initiatorType,globalThis,e,f,g)},queueMicrotask(()=>void(a.request.done=!0,null!=a.processResponseEndOfBody&&queueMicrotask(()=>a.processResponseEndOfBody(b)),null!=a.request.initiatorType&&a.controller.reportTimingSteps()))};null!=a.processResponse&&queueMicrotask(()=>{a.processResponse(b),a.processResponse=null});let e="error"===b.type?b:b.internalResponse??b;if(null==e.body?d():ag(e.body.stream,()=>{d()}),null!=a.processResponseConsumeBody){let c=c=>a.processResponseConsumeBody(b,c);null==e.body?queueMicrotask(()=>c(null)):K(e.body,c,()=>a.processResponseConsumeBody(b,"failure"))}}async function aF(a){let b=a.request,c=null,d=null,f=a.timingInfo;if(b.serviceWorkers,null===c){if("follow"===b.redirect&&(b.serviceWorkers="none"),d=c=await aG(a),"cors"===b.responseTainting&&"failure"===C(b,c))return e("cors failure");"failure"===u(b,c)&&(b.timingAllowFailed=!0)}return("opaque"===b.responseTainting||"opaque"===c.type)&&"blocked"===D(b.origin,b.client,b.destination,d)?e("blocked"):($.has(d.status)&&("manual"!==b.redirect&&a.controller.connection.destroy(),"error"===b.redirect?c=e("unexpected redirect"):"manual"===b.redirect?c=d:"follow"===b.redirect?c=await function(a,b){let c,d=a.request,f=b.internalResponse?b.internalResponse:b;try{if(c=w(f,x(d).hash),null==c)return b}catch(a){return Promise.resolve(e(a))}if(!N(c))return Promise.resolve(e("URL scheme must be a HTTP(S) scheme"));if(20===d.redirectCount)return Promise.resolve(e("redirect count exceeded"));if(d.redirectCount+=1,"cors"===d.mode&&(c.username||c.password)&&!G(d,c))return Promise.resolve(e('cross origin not allowed for request mode "cors"'));if("cors"===d.responseTainting&&(c.username||c.password))return Promise.resolve(e('URL cannot contain credentials for request mode "cors"'));if(303!==f.status&&null!=d.body&&null==d.body.source)return Promise.resolve(e());if([301,302].includes(f.status)&&"POST"===d.method||303===f.status&&!au.includes(d.method))for(let a of(d.method="GET",d.body=null,ab))d.headersList.delete(a);G(x(d),c)||(d.headersList.delete("authorization",!0),d.headersList.delete("proxy-authorization",!0),d.headersList.delete("cookie",!0),d.headersList.delete("host",!0)),null!=d.body&&(X(null!=d.body.source),d.body=Y(d.body.source)[0]);let g=a.timingInfo;return g.redirectEndTime=g.postRedirectStartTime=F(a.crossOriginIsolatedCapability),0===g.redirectStartTime&&(g.redirectStartTime=g.startTime),d.urlList.push(c),y(d,f),aC(a,!0)}(a,c):X(!1)),c.timingInfo=f,c)}async function aG(a,b=!1,c=!1){let d=a.request,g=null,h=null,i=null;"no-window"===d.window&&"error"===d.redirect?(g=a,h=d):(d.body?.source!=null?h=m(d):(h=m({...d,body:null})).body=d.body,(g={...a}).request=h);let j="include"===d.credentials||"same-origin"===d.credentials&&"basic"===d.responseTainting,k=h.body?h.body.length:null,l=null;if(null==h.body&&["POST","PUT"].includes(h.method)&&(l="0"),null!=k&&(l=at(`${k}`)),null==l||h.headersList.contains("content-length",!0)||h.headersList.append("content-length",l,!0),null!=k&&h.keepalive,aq.is.URL(h.referrer)&&h.headersList.append("referer",at(h.referrer.href),!0),v(h),B(h),h.headersList.contains("user-agent",!0)||h.headersList.append("user-agent",av,!0),"default"===h.cache&&(h.headersList.contains("if-modified-since",!0)||h.headersList.contains("if-none-match",!0)||h.headersList.contains("if-unmodified-since",!0)||h.headersList.contains("if-match",!0)||h.headersList.contains("if-range",!0))&&(h.cache="no-store"),"no-cache"!==h.cache||h.preventNoCacheCacheControlHeaderModification||h.headersList.contains("cache-control",!0)||h.headersList.append("cache-control","max-age=0",!0),("no-store"===h.cache||"reload"===h.cache)&&(h.headersList.contains("pragma",!0)||h.headersList.append("pragma","no-cache",!0),h.headersList.contains("cache-control",!0)||h.headersList.append("cache-control","no-cache",!0)),h.headersList.contains("range",!0)&&h.headersList.append("accept-encoding","identity",!0),h.headersList.contains("accept-encoding",!0)||(O(x(h))?h.headersList.append("accept-encoding","br, gzip, deflate, zstd",!0):h.headersList.append("accept-encoding","gzip, deflate",!0)),h.headersList.delete("host",!0),j&&!h.headersList.contains("authorization",!0)){let a=null;if(U(h)&&(void 0===h.useURLCredentials||!V(x(h))));else if(V(x(h))&&b){let{username:b,password:c}=x(h);a=`Basic ${Buffer.from(`${b}:${c}`).toString("base64")}`}null!==a&&h.headersList.append("Authorization",a,!1)}if(h.cache="no-store","no-store"!==h.cache&&h.cache,null==i){if("only-if-cached"===h.cache)return e("only if cached");let a=await aH(g,j,c);!aa.has(h.method)&&a.status>=200&&a.status,null==i&&(i=a)}if(i.urlList=[...h.urlList],h.headersList.contains("range",!0)&&(i.rangeRequested=!0),i.requestIncludesCredentials=j,401===i.status&&"cors"!==h.responseTainting&&j&&(void 0!==d.useURLCredentials||W(d.traversableForUserPrompts))){if(null!=d.body){if(null==d.body.source)return i;d.body=Y(d.body.source)[0]}if(void 0===d.useURLCredentials||b)return H(a)?f(a):i;a.controller.connection.destroy(),i=await aG(a,!0)}if(407===i.status)return"no-window"===d.window?e():H(a)?f(a):e("proxy authentication required");if(421===i.status&&!c&&(null==d.body||null!=d.body.source)){if(H(a))return f(a);a.controller.connection.destroy(),i=await aG(a,b,!0)}return i}async function aH(a,b=!1,c=!1){X(!a.controller.connection||a.controller.connection.destroyed),a.controller.connection={abort:null,destroyed:!1,destroy(a){this.destroyed||(this.destroyed=!0,this.abort?.(a??new DOMException("The operation was aborted.","AbortError")))}};let d=a.request,g=null,i=a.timingInfo;d.cache="no-store",d.mode;let j=null;if(null==d.body&&a.processRequestEndOfBody)queueMicrotask(()=>a.processRequestEndOfBody());else if(null!=d.body){let b=async function*(b){H(a)||(yield b,a.processRequestBodyChunkLength?.(b.byteLength))};j=async function*(){try{for await(let a of d.body.stream)yield*b(a);!H(a)&&a.processRequestEndOfBody&&a.processRequestEndOfBody()}catch(b){H(a)||("AbortError"===b.name?a.controller.abort():a.controller.terminate(b))}}()}try{let{body:b,status:c,statusText:e,headersList:f,socket:l}=await function({body:b}){let c=x(d),e=a.controller.dispatcher,f=c.pathname+c.search,g=0===c.search.length&&"?"===c.href[c.href.length-c.hash.length-1];return function b(h,j){return new Promise((l,m)=>e.dispatch({path:g?`${f}?`:f,origin:c.origin,method:d.method,body:e.isMockActive?d.body&&(d.body.source||d.body.stream):h,__mockAgentBodyForDispatch:h,headers:d.headersList.entries,maxRedirections:0,upgrade:"websocket"===d.mode?"websocket":void 0,...!1===j?{allowH2:j}:null},{body:null,abort:null,onRequestStart(b){let{connection:c}=a.controller;i.finalConnectionTimingInfo=P(void 0,i.postRedirectStartTime,a.crossOriginIsolatedCapability);let d=a=>b.abort(a);c.destroyed?d(new DOMException("The operation was aborted.","AbortError")):(a.controller.on("terminated",d),this.abort=c.abort=d),i.finalNetworkRequestStartTime=F(a.crossOriginIsolatedCapability)},onResponseStarted(){i.finalNetworkResponseStartTime=F(a.crossOriginIsolatedCapability)},onResponseStart(a,b,c,e){if(b<200)return;let f=a?.rawHeaders??[],g=new k;aw(g,c,f);let h=g.get("location",!0)&&"follow"===d.redirect&&$.has(b),i=[];if("HEAD"!==d.method&&"CONNECT"!==d.method&&!_.includes(b)&&!h){let b=g.get("content-encoding",!0),c=b?b.toLowerCase().split(","):[];if(c.length>5)return void a.abort(Error(`too many content-encodings in response: ${c.length}, maximum allowed is 5`));for(let a=c.length-1;a>=0;--a){let b=c[a].trim();if("x-gzip"===b||"gzip"===b)i.push(q.createGunzip({flush:q.constants.Z_SYNC_FLUSH,finishFlush:q.constants.Z_SYNC_FLUSH}));else if("deflate"===b)i.push(S({flush:q.constants.Z_SYNC_FLUSH,finishFlush:q.constants.Z_SYNC_FLUSH}));else if("br"===b)i.push(q.createBrotliDecompress({flush:q.constants.BROTLI_OPERATION_FLUSH,finishFlush:q.constants.BROTLI_OPERATION_FLUSH}));else if("zstd"===b)i.push(q.createZstdDecompress({flush:q.constants.ZSTD_e_continue,finishFlush:q.constants.ZSTD_e_end,params:{[q.constants.ZSTD_d_windowLogMax]:23}}));else{i.length=0;break}}}this.body=new ae({read:()=>a.resume()});let j=b=>this.onResponseError(a,b);l({status:b,statusText:e,headersList:g,body:i.length?af(this.body,...i,b=>{b&&this.onResponseError(a,b)}).on("error",j):this.body.on("error",j)})},onResponseData(b,c){a.controller.dump||(i.encodedBodySize+=c.byteLength,!1===this.body.push(c)&&b.pause())},onResponseEnd(){this.abort&&a.controller.off("terminated",this.abort),a.controller.ended=!0,this.body?.push(null)},onResponseError(c,e){(this.abort&&a.controller.off("terminated",this.abort),"websocket"===d.mode&&!1!==j&&e?.code==="UND_ERR_INFO"&&e?.message==="HTTP/2: Extended CONNECT protocol not supported by server")?l(b(h,!1)):(this.body?.destroy(e),c?.aborted||a.controller.terminate(e),m(e))},onRequestUpgrade(a,b,c,d){if(null!=d.session&&200!==b||null==d.session&&101!==b)return null!=d.session&&a.abort(new al("bad upgrade",null)),!1;let e=a?.rawHeaders??[],f=new k;return aw(f,c,e),l({status:b,statusText:ar[b],headersList:f,socket:d}),!0}}))}(b)}({body:j});if(l)g=h({status:c,statusText:e,headersList:f,socket:l});else{let d=b[Symbol.asyncIterator]();a.controller.next=()=>d.next(),g=h({status:c,statusText:e,headersList:f})}}catch(b){if("AbortError"===b.name)return a.controller.connection.destroy(),f(a,b);return e(b)}let l=new ReadableStream({start(b){a.controller.controller=b},pull:()=>a.controller.resume(),cancel:b=>{H(a)||a.controller.abort(b)},type:"bytes"});return g.body={stream:l,source:null,length:null},a.controller.resume||a.controller.on("terminated",function(b){I(a)?(g.aborted=!0,ai(l)&&a.controller.controller.error(a.controller.serializedAbortReason)):ai(l)&&a.controller.controller.error(TypeError("terminated",{cause:J(b)?b:void 0})),a.controller.connection.destroy()}),a.controller.resume=async()=>{for(;;){let b,c;try{let{done:c,value:d}=await a.controller.next();if(I(a))break;b=c?void 0:d}catch(d){a.controller.ended&&!i.encodedBodySize?b=void 0:(b=d,c=!0)}if(void 0===b){L(a.controller.controller),function(a,b){a.request.done=!0,null!=a.processResponseDone&&queueMicrotask(()=>a.processResponseDone(b))}(a,g);return}if(i.decodedBodySize+=b?.byteLength??0,c)return void a.controller.terminate(b);let d=new Uint8Array(b);if(d.byteLength&&a.controller.controller.enqueue(d),ah(l))return void a.controller.terminate();if(a.controller.controller.desiredSize<=0)return}},g}a.exports={fetch:function(a,b){let c;aq.argumentLengthCheck(arguments,1,"globalThis.fetch");let d=Promise.withResolvers();try{c=new l(a,b)}catch(a){return d.reject(a),d.promise}let e=o(c);if(c.signal.aborted)return aA(d,e,null,c.signal.reason,null),d.promise;let f=e.client.globalObject;f?.constructor?.name==="ServiceWorkerGlobalScope"&&(e.serviceWorkers="none");let g=null,h=!1,j=null,k=aj(c.signal,()=>{h=!0,X(null!=j),j.abort(c.signal.reason);let a=g?.deref();aA(d,e,a,c.signal.reason,j.controller)}),m=()=>{k(),p(c)};return j=aB({request:e,processResponseEndOfBody:a=>{ay(a,"fetch"),m()},processResponse:a=>{if(!h){if(a.aborted){aA(d,e,g,j.serializedAbortReason,j.controller),m();return}if("error"===a.type){d.reject(TypeError("fetch failed",{cause:a.error})),m();return}g=new WeakRef(i(a,"immutable")),d.resolve(g.deref()),d=null}},dispatcher:n(c),requestObject:c}),d.promise},Fetch:ax,fetching:aB,finalizeAndReportTiming:ay}},76816:(a,b,c)=>{"use strict";c.d(b,{bI:()=>f.cleanupProviderConnections,iE:()=>f.createProviderConnection,tV:()=>l,PX:()=>n.getApiKeys,Mc:()=>f.getProviderConnectionById,P:()=>f.getProviderConnections,hr:()=>h,LF:()=>k,OH:()=>m,mt:()=>e.getSettings,Op:()=>f.mutateProviderConnection,Iu:()=>f.mutateProviderConnectionQuota,KK:()=>i,rj:()=>f.updateProviderConnection,Xx:()=>e.Xx});var d=c(52825);c(34050);var e=c(45874),f=c(92216);c(7044);var g=c(50743);async function h(a){var b;return(b=(await (0,d.cK)()).get("SELECT * FROM proxyPools WHERE id = ?",[a]))?{...(0,g.q)(b.data,{}),id:b.id,isActive:1===b.isActive||!0===b.isActive,testStatus:b.testStatus,createdAt:b.createdAt,updatedAt:b.updatedAt}:null}async function i(a,b,c){if(!a)return;let e=await (0,d.cK)(),f=new Date().toISOString();e.run(`INSERT INTO quotaCache(connectionId, provider, data, fetchedAt) VALUES(?, ?, ?, ?)
627
627
  ON CONFLICT(connectionId) DO UPDATE SET provider = excluded.provider, data = excluded.data, fetchedAt = excluded.fetchedAt`,[a,b||"",(0,g.s)(c||{}),f])}function j(a){return a?{connectionId:a.connectionId,provider:a.provider,fetchedAt:a.fetchedAt,usage:(0,g.q)(a.data,{})}:null}async function k(a){return a?j((await (0,d.cK)()).get("SELECT connectionId, provider, data, fetchedAt FROM quotaCache WHERE connectionId = ?",[a])):null}async function l(a=null){let b=await (0,d.cK)();return(a?b.all("SELECT connectionId, provider, data, fetchedAt FROM quotaCache WHERE provider = ?",[a]):b.all("SELECT connectionId, provider, data, fetchedAt FROM quotaCache")).map(j)}async function m(a=[]){let b=[...new Set((a||[]).filter(Boolean))];if(0===b.length)return[];let c=await (0,d.cK)(),e=[];for(let a=0;a<b.length;a+=400){let d=b.slice(a,a+400),f=d.map(()=>"?").join(","),g=c.all(`SELECT connectionId, provider, data, fetchedAt FROM quotaCache WHERE connectionId IN (${f})`,d);e.push(...g.map(j))}return e}c(50570);var n=c(57431);c(37703),c(90181),c(2965),c(18922)},77306:(a,b,c)=>{"use strict";c.d(b,{RF:()=>bc});var d=c(69384),e=c(77598),f=c(73024),g=c(76760),h=c(41913);let i={"image/gif":"gif","image/jpeg":"jpg","image/jpg":"jpg","image/png":"png","image/webp":"webp"};class j extends Error{constructor(a){super(a),this.name="ChatGptWebAttachmentError",this.status=400}}function k(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function l(a){return"string"==typeof a&&a.trim()?a.trim():void 0}function m(a,b){return((a??"").split(/[\\/]/).pop()?.replace(/[\u0000-\u001f\u007f]/g,"").trim()||b).slice(0,180)}function n(a){let b=/^data:([^;,]+);base64,/i.exec(a);return b?.[1]?.trim().toLowerCase()}async function o(a){if(a.length>10)throw new j("ChatGPT Web accepts at most 10 attachments per request");let b=[],c=0;for(let d of a){let a="image"===d.kind?0x1400000:0x3200000;if(!d.ref.toLowerCase().startsWith("data:"))throw new j("ChatGPT Web attachments must be data URLs");let e=function(a){let b=a.indexOf(",");if(b<0)throw new j("Attachment data URL is malformed");let c=a.slice(5,b);if(!/(?:^|;)base64(?:;|$)/i.test(c))throw new j("Attachment data URL must be base64 encoded");let d=(c.split(";")[0]||"application/octet-stream").toLowerCase(),e=a.slice(b+1);if(e.length>0x6400000)throw new j("Attachment is too large");let f=e.replace(/\s/g,"");if(!f||f.length%4!=0||!/^[A-Za-z0-9+/]+={0,2}$/.test(f))throw new j("Attachment contains invalid base64 data");let g=Buffer.from(f,"base64");if(!g.length||g.toString("base64").replace(/=+$/,"")!==f.replace(/=+$/,""))throw new j("Attachment contains invalid base64 data");return{bytes:g,mimeType:d}}(d.ref);if(!e.bytes.length)throw new j("Attachment is empty");if(e.bytes.length>a)throw new j("Attachment is too large");if((c+=e.bytes.length)>0x3200000)throw new j("Combined ChatGPT Web attachments are too large");if("image"===d.kind){let a=function(a,b){let c=a.length>=8&&0x89504e47===a.readUInt32BE(0)?"png":a.length>=3&&255===a[0]&&216===a[1]?"jpeg":a.length>=3&&"GIF"===a.toString("ascii",0,3)?"gif":a.length>=12&&"RIFF"===a.toString("ascii",0,4)&&"WEBP"===a.toString("ascii",8,12)?"webp":null,d=(a.length<24||0x89504e47!==a.readUInt32BE(0)?null:{width:a.readUInt32BE(16),height:a.readUInt32BE(20)})??function(a){if(a.length<4||255!==a[0]||216!==a[1])return null;let b=2;for(;b+9<a.length;){if(255!==a[b]){b+=1;continue}let c=a[b+1];if(c>=192&&c<=195||c>=197&&c<=199||c>=201&&c<=203||c>=205&&c<=207)return{height:a.readUInt16BE(b+5),width:a.readUInt16BE(b+7)};if(216===c||1===c||c>=208&&c<=215){b+=2;continue}b+=2+a.readUInt16BE(b+2)}return null}(a)??(a.length<10||"GIF"!==a.toString("ascii",0,3)?null:{width:a.readUInt16LE(6),height:a.readUInt16LE(8)})??function(a){if(a.length<30||"RIFF"!==a.toString("ascii",0,4)||"WEBP"!==a.toString("ascii",8,12))return null;let b=a.toString("ascii",12,16);if("VP8X"===b)return a.length<30?null:{width:1+((a[24]|a[25]<<8|a[26]<<16)&0xffffff),height:1+((a[27]|a[28]<<8|a[29]<<16)&0xffffff)};if("VP8 "===b)return a.length<30?null:{width:16383&a.readUInt16LE(26),height:16383&a.readUInt16LE(28)};if("VP8L"===b){if(a.length<25)return null;let b=a.readUInt32LE(21);return{width:(16383&b)+1,height:(b>>14&16383)+1}}return null}(a),e="jpeg"===c?"image/jpeg":c?`image/${c}`:void 0;if(!e||!d)throw new j("Image attachment is undecodable or unsupported");if(b.startsWith("image/")&&b!==e&&("image/jpg"!==b||"image/jpeg"!==e))throw new j("Image attachment type does not match its data");if(Math.max(d.width,d.height)>11264||d.width*d.height>4e7)throw new j("Image attachment dimensions are too large");return{mimeType:e,width:d.width,height:d.height}}(e.bytes,d.mimeType??e.mimeType);b.push({kind:"image",name:d.name,mimeType:a.mimeType,size:e.bytes.length,data:e.bytes,width:a.width,height:a.height});continue}b.push({kind:"file",name:d.name,mimeType:d.mimeType??e.mimeType,size:e.bytes.length,data:e.bytes})}return b}function p(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function q(a){return structuredClone(a)}let r=new Set(["add","append","patch","replace"]),s=new Set(["__proto__","constructor","prototype"]);function t(a){if(Array.isArray(a)){for(let b of a)t(b);return}if(p(a))for(let[b,c]of Object.entries(a)){if(s.has(b))throw Error(`Unsafe object key in ChatGPT Web delta: ${b}`);t(c)}}function u(a){let b=[],c=a.replace(/\r\n?/g,"\n").split("\n"),d="message",e=[],f=!1,g=()=>{if(!f){d="message",e=[];return}let a=e.join("\n"),c="[DONE]"===a?{parsed:!1}:function(a){try{return{parsed:!0,value:JSON.parse(a)}}catch{return{parsed:!1}}}(a);b.push({event:d,data:a,...c.parsed?{json:c.value}:{},done:"[DONE]"===a}),d="message",e=[],f=!1};for(let a of c){if(""===a){g();continue}if(a.startsWith(":"))continue;let b=a.indexOf(":"),c=b>=0?a.slice(0,b):a,h=b>=0?a.slice(b+1):"";h.startsWith(" ")&&(h=h.slice(1)),"event"===c?d=h||"message":"data"===c&&(e.push(h),f=!0)}return g(),b}function v(a,b,c){if(c&&"-"===a)return b;if(!/^(?:0|[1-9]\d*)$/.test(a))throw Error(`Invalid ChatGPT Web array index: ${a}`);let d=Number(a);if(!Number.isSafeInteger(d)||d<0||d>(c?b:b-1))throw Error(`ChatGPT Web array index is out of bounds: ${a}`);return d}function w(a,b){if(t(b),null==a)return q(b);if("string"==typeof a&&"string"==typeof b)return a+b;if(Array.isArray(a)){let c=q(a);return Array.isArray(b)?c.push(...q(b)):c.push(q(b)),c}if(p(a)&&p(b))return{...q(a),...q(b)};throw Error(`Cannot append ChatGPT Web delta values (${typeof a}, ${typeof b})`)}function x(a){if("string"!=typeof a||!r.has(a))throw Error(`Unsupported delta operation: ${String(a)}`);return a}class y{constructor(){this.document=null,this.lastPath=null,this.lastOperation=null,this.streamDone=!1}snapshot(){return q(this.document)}ingest(a){let b=u(a),c=!1;for(let a of b){if("delta_encoding"===a.event){if("v1"!==a.json)throw Error(`Unsupported ChatGPT Web delta encoding: ${String(a.json)}`);this.document=null,this.lastPath=null,this.lastOperation=null,this.streamDone=!1;continue}"delta"===a.event&&(this.applyDelta(a.json),c=!0),a.done&&(this.streamDone=!0)}return{events:b,changed:c,done:this.streamDone}}applyDelta(a){if(!p(a))throw Error("ChatGPT Web delta payload must be an object");let b=void 0===a.p?this.lastPath:a.p,c=void 0===a.o?this.lastOperation:x(a.o);if("string"!=typeof b||null===c)throw Error("ChatGPT Web delta requires a current or inherited path and operation");this.lastPath=b,this.lastOperation=c,this.applyAt(b,c,a.v)}applyAt(a,b,c){t(c);let d=function(a){if(""===a)return[];if(!a.startsWith("/"))throw Error(`Invalid ChatGPT Web JSON Pointer: ${a}`);return a.slice(1).split("/").map(a=>{let b=a.replace(/~1/g,"/").replace(/~0/g,"~");if(s.has(b))throw Error(`Unsafe JSON Pointer segment: ${b}`);return b})}(a);if(0===d.length)return void this.applyAtRoot(b,c);let e=this.document;for(let b of d.slice(0,-1))if(Array.isArray(e))e=e[v(b,e.length,!1)];else if(p(e)&&Object.hasOwn(e,b))e=e[b];else throw Error(`ChatGPT Web delta path does not exist: ${a}`);let f=d[d.length-1];if(Array.isArray(e))return void this.applyToArray(e,f,b,c);if(!p(e))throw Error(`ChatGPT Web delta path is not mutable: ${a}`);this.applyToObject(e,f,b,c)}applyAtRoot(a,b){if("add"===a||"replace"===a){this.document=q(b);return}if("append"===a){this.document=w(this.document,b);return}if(!Array.isArray(b))throw Error("ChatGPT Web patch value must be an array");for(let a of b){if(!p(a)||"string"!=typeof a.p)throw Error("ChatGPT Web patch entry requires an explicit path and operation");this.applyAt(a.p,x(a.o),a.v)}}applyToArray(a,b,c,d){if("patch"===c)throw Error("Nested ChatGPT Web patch is unsupported");if("add"===c)return void a.splice(v(b,a.length,!0),0,q(d));let e=v(b,a.length,!1);a[e]="append"===c?w(a[e],d):q(d)}applyToObject(a,b,c,d){if("patch"===c)throw Error("Nested ChatGPT Web patch is unsupported");if("add"!==c&&!Object.hasOwn(a,b))throw Error(`ChatGPT Web delta target does not exist: ${b}`);a[b]="append"===c?w(a[b],d):q(d)}}let z="https://chatgpt.com",A=/^\/(?:cdn|unauth-mweb|auth-mweb)\/(?:assets|scripts)\/[A-Za-z0-9._-]+\.js$/,B=/(?:^|\.)oaiusercontent\.com$/i,C="__zevaiChatGptFirstPartyV1",D="__zevaiChatGptAbortV1",E="__zevaiChatGptRequestV1",F=new Map,G=new WeakMap,H=null;function I(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function J(a,b){let c=a.lastIndexOf("export{");if(c<0)return null;let d=a.slice(c+7).match(RegExp(`(?:^|,)${I(b)} as ([A-Za-z_$][\\w$]*)`));return d?.[1]??null}function K(a){let b=new URL(a);if(b.origin!==z||!A.test(b.pathname))throw Error("ChatGPT Web exposed an invalid first-party asset URL");return b.toString()}async function L(a){let b=new AbortController,c=setTimeout(()=>b.abort(),2e4);c.unref?.();try{let c=await fetch(a,{signal:b.signal});if(!c.ok)throw Error("ChatGPT Web first-party asset could not be loaded");let d=Number(c.headers.get("content-length")??"0");if(Number.isFinite(d)&&d>0x1800000)throw Error("ChatGPT Web first-party asset exceeded the size limit");let e=new Uint8Array(await c.arrayBuffer());if(e.byteLength>0x1800000)throw Error("ChatGPT Web first-party asset exceeded the size limit");return new TextDecoder().decode(e)}finally{clearTimeout(c)}}function M(a,b){return a instanceof Error?a:Error(b)}async function N(a){let b=await a.evaluate(()=>({modulePreloadUrls:Array.from(document.querySelectorAll('link[rel="modulepreload"][href]'),a=>a.href),resourceUrls:performance.getEntriesByType("resource").map(a=>a.name)}));return Array.from(new Set([...b.resourceUrls,...b.modulePreloadUrls])).filter(a=>{try{let b=new URL(a);return b.origin===z&&A.test(b.pathname)}catch{return!1}})}async function O(a,b){let c,d;try{c=K(a)}catch(a){return b.lastError=M(a,"Invalid ChatGPT asset URL"),null}if(b.visited.has(c))return null;b.visited.add(c);let e=F.get(c);if(e)try{return{assetUrl:c,contract:await e}}catch{F.delete(c)}try{d=await L(c)}catch(a){return b.lastError=M(a,"ChatGPT asset discovery failed"),null}try{let a=function(a){let b=a.match(/function ([A-Za-z_$][\w$]*)\(e=!1,t=`none`(?:,n=[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)?)?\)\{return [A-Za-z_$][\w$]*\(`finalized`,e,t(?:,n)?\)\}/)?.[1],c=a.match(/Promise\.all\(\[([A-Za-z_$][\w$]*)\.getEnforcementToken\(t,\{forceSync:!0\}\),([A-Za-z_$][\w$]*)\.getEnforcementToken\(t\)\]\)/),d=a.match(/([A-Za-z_$][\w$]*)\.safePost\(`\/sentinel\/chat-requirements\/prepare`/)?.[1],e=a.match(/function ([A-Za-z_$][\w$]*)\(e,t,n,r,i,a\)\{let o=\{\};return e\?\.token\?o\[`OpenAI-Sentinel-Chat-Requirements-Token`\]/)?.[1],f=c?.[1],g=c?.[2];if(!b||!f||!g||!d||!e)throw Error("ChatGPT Web first-party module contract was not found");let h={finalizeRequirements:J(a,b),proofManager:J(a,f),turnstileManager:J(a,g),requestClient:J(a,d),buildSentinelHeaders:J(a,e)};if(Object.values(h).some(a=>null===a))throw Error("ChatGPT Web first-party module contract exports were not found");return h}(d);return F.set(c,Promise.resolve(a)),H=c,{assetUrl:c,contract:a}}catch(f){for(let[a,e]of Object.entries(function(a){let b={},c=a.match(/function ([A-Za-z_$][\w$]*)\(e=!1,t=`none`(?:,n=[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)?)?\)\{return [A-Za-z_$][\w$]*\(`finalized`,e,t(?:,n)?\)\}/)?.[1]??a.match(/finalizeChatRequirements\s*:\s*\(\)\s*=>\s*([A-Za-z_$][\w$]*)/)?.[1];c&&(b.finalizeRequirements=J(a,c)??c);let d=a.match(/Promise\.all\(\[([A-Za-z_$][\w$]*)\.getEnforcementToken\(t,\{forceSync:!0\}\),([A-Za-z_$][\w$]*)\.getEnforcementToken\(t\)\]\)/),e=d?.[1]??a.match(/([A-Za-z_$][\w$]*)\.getEnforcementToken\([^)]*forceSync\s*:\s*!0/)?.[1],f=d?.[2];e&&(b.proofManager=J(a,e)??e),f&&(b.turnstileManager=J(a,f)??f);let g=a.match(/([A-Za-z_$][\w$]*)\.safePost\(`\/sentinel\/chat-requirements\/prepare`/)?.[1]??a.match(/([A-Za-z_$][\w$]*)\.(?:safePost|post)\([`"]\/sentinel\/chat-requirements\/prepare[`"]/)?.[1];g&&(b.requestClient=J(a,g)??g);let h=a.match(/function ([A-Za-z_$][\w$]*)\(e,t,n,r,i,a\)\{let o=\{\};return e\?\.token\?o\[`OpenAI-Sentinel-Chat-Requirements-Token`\]/)?.[1]??a.match(/([A-Za-z_$][\w$]*)\s*=\s*[^;]{0,1200}OpenAI-Sentinel-Chat-Requirements-Token/)?.[1];h&&(b.buildSentinelHeaders=J(a,h)??h);let i=a.match(/(?:^|\}\),)([A-Za-z0-9_$]+):\(function\(e,t,n\)\{n\.d\(t,\{([^}]+)\}\);[\s\S]{0,1800}?async function ([A-Za-z_$][\w$]*)\(e\)\{let t=[A-Za-z_$][\w$]*\(\),n=[A-Za-z_$][\w$]*\(await e\(t\)\)/);if(i){let[,a,c,d]=i,e=c.match(RegExp(`(?:^|,)\\s*([A-Za-z_$][\\w$]*):\\(\\)=>${I(d)}(?:,|$)`))?.[1];e&&(b.resolveIntegrity=e,b.resolveIntegrityModule=a)}return b}(d)))b.partial[a]||(b.partial[a]=e,b.symbolAssetUrls[a]=c);if(b.partial.requestClient&&(b.partial.resolveIntegrity&&b.partial.resolveIntegrityModule||b.partial.finalizeRequirements&&b.partial.proofManager&&b.partial.buildSentinelHeaders)){let a={finalizeRequirements:b.partial.finalizeRequirements??"",proofManager:b.partial.proofManager??"",turnstileManager:b.partial.turnstileManager??b.partial.proofManager??"",requestClient:b.partial.requestClient,buildSentinelHeaders:b.partial.buildSentinelHeaders??"",...b.partial.resolveIntegrity?{resolveIntegrity:b.partial.resolveIntegrity,resolveIntegrityModule:b.partial.resolveIntegrityModule}:{}},d=b.symbolAssetUrls.finalizeRequirements??c;return H=d,{assetUrl:d,contract:a}}let a=Object.keys(b.partial);b.lastError=a.length?Error(`ChatGPT module discovery incomplete: found ${a.join(", ")}`):M(f,"ChatGPT module discovery failed");let e=function(a,b){let c=[],d=new Set,e=/["']\.\/([A-Za-z0-9_-]+\.js)["']/g;for(let f=e.exec(a);f;f=e.exec(a)){let a;try{a=K(new URL(`./${f[1]}`,b).toString())}catch{continue}d.has(a)||(d.add(a),c.push(a))}return c}(d,c);return b.queue.push(...e.filter(a=>!b.visited.has(a))),null}}async function P(a){for(;a.index<a.queue.length&&a.visited.size<512;){let b=a.queue[a.index];a.index+=1;let c=await O(b,a);if(c)return c}return null}async function Q(a){let b={queue:[...H?[H]:[]],visited:new Set,index:0,lastError:null,partial:{},symbolAssetUrls:{}},c=Date.now()+15e3;for(;Date.now()<=c&&b.visited.size<512;){b.queue.push(...await N(a));let d=await P(b);if(d)return d;Date.now()<c&&await new Promise(a=>setTimeout(a,250))}throw Error("ChatGPT Web first-party request module was not loaded")}async function R(a){let b,c,d,e,f,g;if(await a.evaluate(a=>{let b=globalThis;return"object"==typeof b[a]&&null!==b[a]},C))return;let{assetUrl:h,contract:i}=await Q(a),j=(b=JSON.stringify(K(h)),c=JSON.stringify(i),d=JSON.stringify(C),i.resolveIntegrity&&i.resolveIntegrityModule?`import * as upstream from ${b};const names = ${c};const modules = upstream.__webpack_modules__;const factory = modules?.[names.resolveIntegrityModule];if (typeof factory !== "function") throw new Error("ChatGPT integrity module factory is unavailable");const exports = {};const requireShim = id => {if (id === "TI" || id === "DD") return { a: () => crypto.randomUUID() };const real = modules[id];if (typeof real === "function") {const nested = {};real({}, nested, requireShim);return nested;}throw new Error("Unsupported ChatGPT integrity dependency: " + id);};requireShim.d = (target, definitions) => {for (const [name, getter] of Object.entries(definitions)) {Object.defineProperty(target, name, { enumerable: true, get: getter });}};factory({}, exports, requireShim);const resolveIntegrity = exports[names.resolveIntegrity];if (typeof resolveIntegrity !== "function") throw new Error("ChatGPT integrity resolver is unavailable");const sessionPromise = fetch("/api/auth/session", { credentials: "include" }).then(async response => {if (!response.ok) throw new Error("ChatGPT browser session is unavailable");return response.json();});const requestClient = {safePost: async (path, options = {}) => {const headers = new Headers(options.additionalHeaders || {});const session = await sessionPromise;if (typeof session?.accessToken === "string" && session.accessToken) {headers.set("Authorization", "Bearer " + session.accessToken);}headers.set("Accept", "application/json");if (!headers.has("Content-Type")) headers.set("Content-Type", "application/json");const body = typeof options.requestBody === "string" ? options.requestBody : JSON.stringify(options.requestBody ?? {});const response = await fetch("/backend-api" + path, {method: "POST", credentials: "include", headers, body, signal: options.signal});if (options.skipJsonTransform) return response;if (!response.ok) throw new Error("ChatGPT request failed with status " + response.status);return response.json();}};window[${d}] = { requestClient, resolveIntegrity };`:`import * as upstream from ${b};const names = ${c};window[${d}] = {finalizeRequirements: upstream[names.finalizeRequirements],proofManager: upstream[names.proofManager],turnstileManager: upstream[names.turnstileManager],requestClient: upstream[names.requestClient],buildSentinelHeaders: upstream[names.buildSentinelHeaders],resolveIntegrity: names.resolveIntegrity ? upstream[names.resolveIntegrity] : undefined};`),k=(e=[],f=a=>{let b=a.url();(b===h||b.startsWith("blob:"))&&e.push({kind:"requestfailed",detail:`${b} failed: ${a.failure()?.errorText??"unknown error"}`})},g=a=>{e.push({kind:"pageerror",detail:a instanceof Error?a.message:String(a)})},a.on("requestfailed",f),a.on("pageerror",g),{signals:e,dispose:()=>{a.off("requestfailed",f),a.off("pageerror",g)}});try{await a.evaluate(({bridgeKey:a,moduleSource:b})=>new Promise((c,d)=>{let e=globalThis;if("object"==typeof e[a]&&null!==e[a])return void c();let f="",g=new AbortController;document.addEventListener("securitypolicyviolation",a=>{f||(f=`${a.violatedDirective} blocked ${a.blockedURI}`)},{signal:g.signal});let h=URL.createObjectURL(new Blob([b],{type:"text/javascript"})),i=document.createElement("script");i.type="module",i.src=h,i.onload=()=>{URL.revokeObjectURL(h),g.abort(),"object"==typeof e[a]&&null!==e[a]?c():d(Error("ChatGPT Web first-party bridge did not initialize"))},i.onerror=()=>{URL.revokeObjectURL(h),g.abort(),d(Error(f?`csp: ${f}`:"no in-page reason"))},document.head.appendChild(i)}),{bridgeKey:C,moduleSource:j})}catch(c){let a=c instanceof Error?c.message:String(c),b=[...k.signals];throw a.startsWith("csp: ")?b.unshift({kind:"csp",detail:a.slice(5)}):a&&"no in-page reason"!==a&&b.push({kind:"pageerror",detail:a}),Error(function(a){let b="ChatGPT Web first-party bridge module failed to load";if(0===a.length)return`${b} (no CSP violation, failed request or page error was captured)`;let c=a.find(a=>"csp"===a.kind)??a.find(a=>"requestfailed"===a.kind)??a[0];return`${b}: ${c.kind}: ${c.detail}`}(b))}finally{k.dispose()}}async function S(a,b,c){return a.evaluate(async({abortKey:a,attachments:b,bridgeKey:c,requestId:d})=>{let e=globalThis,f=e[c];if("function"!=typeof f?.requestClient?.safePost)throw Error("ChatGPT Web first-party request client is unavailable");let g=e[a]??={},h=new AbortController;g[d]=h;let i=[];for(let a of b){let b="image"===a.kind?"multimodal":"my_files",c=await f.requestClient.safePost("/files",{requestBody:{file_name:a.name,file_size:a.size,use_case:b,timezone_offset_min:new Date().getTimezoneOffset(),reset_rate_limits:!1,supports_direct_azure_multipart:!0,mime_type:a.mimeType,entry_surface:"chat_composer",selection_method:"file_picker",client_resolved_mime_type:a.mimeType,mime_resolution_source:"filename_extension",store_in_library:!1},signal:h.signal}),d=c;if(c instanceof Response){if(!c.ok){let a=c.status;throw await c.body?.cancel().catch(()=>{}),Error(`ChatGPT Web file registration failed with status ${a}`)}d=await c.json()}if(!d||"object"!=typeof d||"string"!=typeof d.file_id||"string"!=typeof d.upload_url)throw Error("ChatGPT Web file registration returned an invalid response");i.push({fileId:d.file_id,uploadUrl:d.upload_url})}return i},{abortKey:D,attachments:c.map(({kind:a,mimeType:b,name:c,size:d})=>({kind:a,mimeType:b,name:c,size:d})),bridgeKey:C,requestId:b})}async function T(a,b){for(let c of a){let a=await fetch(function(a){let b=new URL(a);if("https:"!==b.protocol||!B.test(b.hostname))throw Error("ChatGPT Web returned an invalid upload destination");return b.toString()}(c.uploadUrl),{method:"PUT",headers:{Accept:"application/json, text/plain, */*","Content-Type":c.attachment.mimeType,"x-ms-blob-type":"BlockBlob","x-ms-version":"2020-04-08"},body:new Uint8Array(c.attachment.data),signal:b??void 0});if(!a.ok)throw Error(`ChatGPT Web attachment upload failed with status ${a.status}`)}}async function U(a,b,c){await a.evaluate(async({abortKey:a,bridgeKey:b,registered:c,requestId:d})=>{let e=globalThis,f=e[b];if("function"!=typeof f?.requestClient?.safePost)throw Error("ChatGPT Web first-party request client is unavailable");let g=e[a],h=g?.[d];if(!h)throw Error("ChatGPT Web request cancellation scope is unavailable");for(let a of c){let b="image"===a.kind?"multimodal":"my_files",c=await f.requestClient.safePost("/files/process_upload_stream",{requestBody:{file_id:a.fileId,use_case:b,index_for_retrieval:"image"!==a.kind,file_name:a.name,entry_surface:"chat_composer",metadata:{store_in_library:!1,is_temporary_chat:!0,library_eligibility_reason:"eligible",is_project_thread:!1}},signal:h.signal,skipJsonTransform:!0});if(c instanceof Response){let a=c.status,b=c.ok;if(await c.text(),!b)throw Error(`ChatGPT Web file processing failed with status ${a}`)}}},{abortKey:D,bridgeKey:C,registered:c,requestId:b})}async function V(a,b,c,d){let e=function(a){if("free"===a.kind)return{model:"auto",reason:a.thinkEnabled};let b="GPT-5.6 Sol"===a.modelLabel?"gpt-5-6":"gpt-5-5";return 4===a.effortIndex?{model:`${b}-pro`,reason:!1}:{model:b,reason:a.effortIndex>0}}(b.selection);await a.evaluate(({mode:a,prompt:b,registered:c,requestId:d,requestKey:e,pluginHints:f})=>{let g=globalThis,h=c.filter(a=>"image"===a.kind),i=c.map(a=>({id:a.fileId,size:a.size,name:a.name,mime_type:a.mimeType,..."image"===a.kind?{width:a.width,height:a.height}:{non_library_my_files_injest_upload:!0},source:"local",is_big_paste:!1})),j=[...a.reason?["reason"]:[],...Array.isArray(f)?f:[]],k={...j.length?{system_hints:j}:{},...i.length?{attachments:i}:{},serialization_metadata:{custom_symbol_offsets:[]}},l=h.length?{content_type:"multimodal_text",parts:[...h.map(a=>({content_type:"image_asset_pointer",asset_pointer:`sediment://${a.fileId}`,size_bytes:a.size,width:a.width,height:a.height})),b]}:{content_type:"text",parts:[b]};(g[e]??={})[d]={body:{action:"next",messages:[{id:crypto.randomUUID(),author:{role:"user"},create_time:Date.now()/1e3,content:l,metadata:k}],parent_message_id:"client-created-root",model:a.model,timezone_offset_min:new Date().getTimezoneOffset(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,history_and_training_disabled:!0,conversation_mode:{kind:"primary_assistant"},system_hints:j,supports_buffering:!0,supported_encodings:["v1"]}}},{mode:e,prompt:b.prompt,registered:d,requestId:c,requestKey:E,pluginHints:Array.isArray(b.pluginHints)?b.pluginHints:[]})}async function W(a,b){await a.evaluate(async({abortKey:a,bridgeKey:b,requestId:c,requestKey:d})=>{let e=globalThis,f=e[b],g=[f?.finalizeRequirements,f?.proofManager?.getEnforcementToken,f?.turnstileManager?.getEnforcementToken,f?.buildSentinelHeaders].every(a=>"function"==typeof a),h="function"==typeof f?.resolveIntegrity&&"function"==typeof f?.requestClient?.safePost;if(!g&&!h)throw Error("ChatGPT Web first-party challenge bridge is incomplete");let i=e[a]?.[c],j=e[d]?.[c];if(!i||!j)throw Error("ChatGPT Web request scope is unavailable");if(h){let a=await f.resolveIntegrity(async a=>f.requestClient.safePost("/sentinel/chat-requirements/prepare",{requestBody:{p:a},signal:i.signal}));j.additionalHeaders=a?.headers??{}}else{let a=await f.finalizeRequirements(!1,"none");if(i.signal.aborted)throw new DOMException("Aborted","AbortError");let[b,c]=await Promise.all([f.proofManager.getEnforcementToken(a,{forceSync:!0}),f.turnstileManager.getEnforcementToken(a)]);j.additionalHeaders=f.buildSentinelHeaders(a,c,b,null,null,null)}},{abortKey:D,bridgeKey:C,requestId:b,requestKey:E})}async function X(a,b){await a.evaluate(async({abortKey:a,bridgeKey:b,requestId:c,requestKey:d})=>{let e=globalThis,f=e[b]?.requestClient,g=e[a]?.[c],h=e[d]?.[c];if("function"!=typeof f?.safePost||!g||!h)throw Error("ChatGPT Web conversation request scope is unavailable");let i=await f.safePost("/f/conversation",{requestBody:h.body,additionalHeaders:h.additionalHeaders,signal:g.signal,skipJsonTransform:!0});if(!(i instanceof Response))throw Error("ChatGPT Web conversation returned an invalid response");if(!i.ok){let a=i.status,b="";try{let a=await i.json(),c=a.detail&&"object"==typeof a.detail?a.detail:a.error&&"object"==typeof a.error?a.error:a,d=c.code??c.message??c.type;"string"==typeof d&&(b=d.slice(0,160))}catch{await i.body?.cancel().catch(()=>{})}throw Error(`ChatGPT Web conversation failed with status ${a}${b?` (${b})`:""}`)}h.response=i},{abortKey:D,bridgeKey:C,requestId:b,requestKey:E})}async function Y(a,b){return a.evaluate(async({requestId:a,requestKey:b,responseLimit:c})=>{let d=globalThis,e=d[b]?.[a],f=e?.response;if(!(f instanceof Response))throw Error("ChatGPT Web conversation response is unavailable");let g=f.body?.getReader();if(!g)throw Error("ChatGPT Web conversation returned an empty stream");let h=new TextDecoder,i=[],j=0;try{for(;;){let{done:a,value:b}=await g.read();if(a)break;if(b){if((j+=b.byteLength)>c)throw await g.cancel().catch(()=>{}),Error("ChatGPT Web conversation response exceeded the size limit");i.push(h.decode(b,{stream:!0}))}}i.push(h.decode())}finally{try{g.releaseLock()}catch{}}return i.join("")},{requestId:b,requestKey:E,responseLimit:0x1000000})}async function Z(a,b,c,d){let e=d.map(({attachment:a,fileId:b})=>({fileId:b,kind:a.kind,mimeType:a.mimeType,name:a.name,size:a.size,width:a.width,height:a.height}));return await U(a,c,e),await V(a,b,c,e),await W(a,c),await X(a,c),Y(a,c)}async function $(a,b){await a.evaluate(({abortKey:a,requestId:b,requestKey:c})=>{let d=globalThis,e=d[a],f=d[c];delete e?.[b],delete f?.[b]},{abortKey:D,requestId:b,requestKey:E}).catch(()=>{})}async function _(a,b){await a.evaluate(({abortKey:a,requestId:b})=>{let c=globalThis[a];c?.[b]?.abort()},{abortKey:D,requestId:b}).catch(()=>{})}async function aa(a,b){let c=G.get(a)??Promise.resolve(),d=()=>{},e=new Promise(a=>{d=a}),f=c.catch(()=>{}).then(()=>e);G.set(a,f),await c.catch(()=>{});try{return await b()}finally{d(),G.get(a)===f&&G.delete(a)}}async function ab(a,b,c={}){let d=c.requestId??crypto.randomUUID();return aa(a,async()=>{if(c.signal?.aborted)throw new DOMException("Aborted","AbortError");let e=()=>{_(a,d)};c.signal?.addEventListener("abort",e,{once:!0});try{await R(a);let e=(await S(a,d,b.attachments)).map((a,c)=>({...a,attachment:b.attachments[c]}));return await T(e,c.signal),await Z(a,b,d,e)}finally{c.signal?.removeEventListener("abort",e),await $(a,d)}})}let ac="https://chatgpt.com";function ad(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function ae(a){if("string"!=typeof a||!a.trim())throw Error("ChatGPT Web browser turn requires a non-empty prompt");return a}function af(a){let b;try{b=new URL(a)}catch{throw Error("ChatGPT Web browser session requires a valid URL")}if(b.origin!==ac)throw Error("ChatGPT Web browser session requires the first-party chatgpt.com origin")}function ag(a,b,c){if(!ad(a)||!ad(a.message))return null;let d=a.message,e=ad(d.author)?d.author:null,f=ad(d.content)?d.content:null,g=Array.isArray(f?.parts)?f.parts:[];return e?.role==="assistant"&&f?.content_type==="text"&&g.every(a=>"string"==typeof a)&&"finished_successfully"===d.status&&!0===d.end_turn?{conversationId:b,turnExchangeId:c,text:g.join(""),status:d.status,endTurn:!0}:null}class ah{constructor(a,b={}){this.page=a,this.pageUrl=b.pageUrl??"https://chatgpt.com/?temporary-chat=true",this.selection=b.selection,this.closePageOnCleanup=!0===b.closePageOnCleanup,this.executePageRequest=b.executePageRequest??ab}url(){return this.pageUrl}async start(){af(this.pageUrl);let a=async()=>{this.closePageOnCleanup&&await this.page.close().catch(()=>{})};try{let b=!1;try{b=new URL(this.page.url()).origin===ac}catch{b=!1}return b||await this.page.goto(this.pageUrl,{waitUntil:"domcontentloaded",timeout:3e4}),af(this.page.url()),a}catch(b){throw await a(),b}}async submitPrompt(a){if(!this.selection)throw Error("ChatGPT Web direct request requires a model selection");return af(this.page.url()),this.executePageRequest(this.page,{prompt:ae(a.prompt),attachments:a.attachments,selection:this.selection,pluginHints:a.pluginHints??[]},{signal:a.signal})}}async function ai(a,b){let c;if(b.signal?.aborted)throw Error("ChatGPT Web browser turn aborted");let d=ae(b.prompt);af(a.url());let e=b.timeoutMs??18e4;if(!Number.isFinite(e)||e<=0)throw Error("ChatGPT Web browser turn requires a positive timeout");let f=null,g=new Promise((a,b)=>{c=setTimeout(()=>b(Error("ChatGPT Web browser turn timed out")),e),c.unref?.()});try{let c=(async()=>(f=await a.start(),function(a){if("string"!=typeof a||!a.trim())throw Error("ChatGPT Web direct conversation returned an empty stream");let b=new y,c="",d="",e=null;for(let f of u(a))ad(f.json)&&("string"==typeof f.json.conversation_id&&(c=f.json.conversation_id),"string"==typeof f.json.turn_exchange_id&&(d=f.json.turn_exchange_id)),"delta_encoding"===f.event&&(e=ag(b.snapshot(),c,d)??e,b=new y),b.ingest(function(a){let b="message"===a.event?"":`event: ${a.event}
628
628
  `;return`${b}data: ${a.data}
629
629
 
@@ -635,7 +635,7 @@ ${c.join("\n")}`);continue}if("tool"===f.role){let c=f.tool_call_id&&b.get(f.too
635
635
 
636
636
  ${i}
637
637
 
638
- Respond with ONLY <tool> blocks, one per line. No prose, no code fences, no explanation before or after the blocks.`:i);if(!m.trim())throw Object.assign(Error("ChatGPT Web requires non-empty text"),{status:400});let n={...await aR({baseUrl:a,accessToken:b,userAgent:d,signal:g}),Authorization:`Bearer ${b}`,"User-Agent":d,...c?{Cookie:c}:{},"Content-Type":"application/json"},o=await a4(`${a}/backend-api/f/conversation/prepare`,{method:"POST",headers:{...n,Accept:"application/json"},body:JSON.stringify({action:"next",parent_message_id:(0,e.randomUUID)(),model:"auto",client_prepare_state:"success",timezone_offset_min:0,timezone:"UTC",conversation_mode:{kind:"primary_assistant"},partial_query:{id:(0,e.randomUUID)(),author:{role:"user"},content:{content_type:"text",parts:[m]}},supports_buffering:!0,supported_encodings:["v1"],client_contextual_info:{app_name:"chatgpt.com"}})},6e4,g);if(!o.ok){let a=(await o.text().catch(()=>"")).slice(0,200);throw Object.assign(Error(`ChatGPT prepare failed (HTTP ${o.status}) ${a}`),{status:o.status||502})}let p=await o.json().catch(()=>null),q=await a4(`${a}/backend-api/f/conversation`,{method:"POST",headers:{...n,Accept:"text/event-stream","X-Conduit-Token":p?.conduit_token||"","X-Oai-Turn-Trace-Id":(0,e.randomUUID)()},body:JSON.stringify({action:"next",messages:[{id:(0,e.randomUUID)(),author:{role:"user"},create_time:Date.now()/1e3,content:{content_type:"text",parts:[m]},metadata:{serialization_metadata:{custom_symbol_offsets:[]}}}],parent_message_id:(0,e.randomUUID)(),model:"auto",client_prepare_state:"sent",timezone_offset_min:0,timezone:"UTC",conversation_mode:{kind:"primary_assistant"},enable_message_followups:!0,supports_buffering:!0,supported_encodings:["v1"],client_contextual_info:{app_name:"chatgpt.com"},force_parallel_switch:"auto"})},135e3,g);if(!q.ok)throw Object.assign(Error(`ChatGPT conversation failed (HTTP ${q.status})`),{status:q.status||502});let r=((await a5(q,0x1000000,12e4)).match(/"conversation_id"\s*:\s*"([0-9a-f-]{36})"/)||[])[1]||"";if(!r)throw Object.assign(Error("ChatGPT conversation produced no conversation id"),{status:502});let s=Date.now();for(;Date.now()-s<=18e4;){if(g?.aborted)throw Error("Request aborted");let e=await a4(`${a}/backend-api/conversation/${r}`,{headers:{Authorization:`Bearer ${b}`,"User-Agent":d,Accept:"application/json",...c?{Cookie:c}:{}}},3e4,g).catch(()=>null);if(e?.ok){let a=await e.json().catch(()=>null),b=a?function(a){let b=a?.mapping||{},c="",d=!1,e="";for(let a of Object.values(b)){let b=a?.message;if(b&&"assistant"===String(b.author?.role||"").toLowerCase()&&(b.metadata?.is_complete===!0&&(d=!0),b.content?.content_type==="text"&&(c+=(b.content.parts||[]).filter(a=>"string"==typeof a).join("")),b.metadata?.is_error)){let a=(b.content?.parts||[]).filter(a=>"string"==typeof a).join("");a&&(e=a)}}return d?{text:c,errorText:e}:null}(a):null;if(b){if(!b.text.trim()&&b.errorText)throw Object.assign(Error(`ChatGPT refused the turn: ${b.errorText.slice(0,200)}`),{status:400});return h&&!l.hasTools&&h.debug?.("CGPT-WEB",`chat turn complete (${b.text.length} chars)`),{text:b.text,hasTools:l.hasTools,requestedTools:l.requestedTools}}}else h&&h.debug?.("CGPT-WEB",`conversation poll status ${e?.status??"network"}, retrying`);await a3(1500)}throw Object.assign(Error("ChatGPT chat turn timed out"),{status:504})}var a7=c(36215);let a8="https://chatgpt.com",a9="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36";async function ba({storageState:a,userAgent:b,signal:c}){let d=aW(a),e=await fetch(`${a8}/api/auth/session`,{headers:{"User-Agent":b,Accept:"application/json",...d?{Cookie:d}:{}},signal:c});if(!e.ok)throw Object.assign(Error(`ChatGPT session unavailable (HTTP ${e.status})`),{status:403===e.status?401:e.status||502});let f=await e.json().catch(()=>null);if("string"!=typeof f?.accessToken||!f.accessToken)throw Object.assign(Error("ChatGPT session is not signed in"),{status:401});return f.accessToken}function bb(a,b){return new Response(JSON.stringify({error:{message:b}}),{status:a,headers:{"Content-Type":"application/json"}})}class bc extends d.Hv{constructor(){super("chatgpt-web",{id:"chatgpt-web",baseUrl:a8})}async testConnection(a){try{let b=a?.providerSpecificData?.storageState??a?.apiKey;if("string"!=typeof b||!b.trim())return!1;if(b.trim().startsWith("{"))return JSON.parse(b),!0;return/__Secure-next-auth\.session-token|^[\w-]+\.[\w-]+\.[\w-]+$/.test(b.trim())}catch{return!1}}async execute(a){try{let b=await this.#cj(a);if(b)return b;return{response:await ay(a),url:a8,headers:{},transformedBody:a.body}}catch(c){let b=c instanceof Error?c.message:"ChatGPT Web browser execution failed";if((0,a7.BE)(b))return{response:bb(503,"ChatGPT Web requires a Chrome/Chromium browser (headed). Install Google Chrome on the host (or set CHATGPT_WEB_CHROME_PATH), and run `npx playwright-core install chromium`."),url:a8,headers:{},transformedBody:a.body};return{response:bb(/storage state|credentials|connection ID/i.test(b)?401:/(?:\bHTTP[_\s-]*429\b|\bstatus\s+429\b|\brate[-_\s]?limit(?:ed)?\b|\bquota\s+(?:exhausted|reached|exceeded)\b|\b(?:image(?:\s+upload)?|upload|usage)\s+limit\s+(?:reached|exceeded)\b|\breached\s+(?:your\s+)?(?:image(?:\s+upload)?|upload|usage)\s+limit\b)/i.test(b)?429:/request|messages|prompt|model|tools|text content|reasoning effort/i.test(b)?400:502,b),url:a8,headers:{},transformedBody:a.body}}}async #cj(a){let b,c,{credentials:d,body:f,model:g,stream:h}=a;try{b=at(d)}catch{return null}let i=d?.providerSpecificData,j="string"==typeof i?.customUserAgent&&i.customUserAgent.trim()?i.customUserAgent.trim():a9;try{let d=await ba({storageState:b,userAgent:j,signal:a.signal});c=await a6({baseUrl:a8,accessToken:d,cookie:aW(b),userAgent:j,body:f,signal:a.signal,log:a.log})}catch(a){if(a?.code==="TURNSTILE_REQUIRED"||/Turnstile/i.test(a?.message||""))return null;throw a}if(!c.hasTools)return{response:ax(g,{text:c.text},h),url:a8,headers:{},transformedBody:f};let k=ax(g,{text:c.text},!1);return{response:await (0,ak.N)(k,c.requestedTools,h,{idSeed:"call",cid:`chatcmpl-${(0,e.randomUUID)()}`,created:Math.floor(Date.now()/1e3),model:g}),url:a8,headers:{},transformedBody:f}}async generateMedia({prompt:a,n:b=1,size:c,credentials:d,signal:e,log:f}){if(!a)throw Error("prompt is required for image generation");let g=at(d),h=d.providerSpecificData,i="string"==typeof h?.customUserAgent&&h.customUserAgent.trim()?h.customUserAgent.trim():a9,j=[];for(let h=0;h<Math.max(1,b);h++)j.push(await this.#ck({prompt:a,size:c,storageState:g,userAgent:i,signal:e,log:f,credentials:d}));return j}async #ck({prompt:a,size:b,storageState:c,userAgent:d,signal:e,log:f,credentials:g}){try{let g=await ba({storageState:c,userAgent:d,signal:e});return await a2({baseUrl:a8,accessToken:g,cookie:aW(c),userAgent:d,prompt:a,sizeHint:b,signal:e,log:f})}catch(a){if(a?.code!=="TURNSTILE_REQUIRED"&&!/Turnstile/i.test(a?.message||""))throw a;f?.warn?.("CGPT-WEB","Sentinel demanded Turnstile — falling back to the browser path")}let h="string"==typeof g?.connectionId&&g.connectionId.trim()?g.connectionId.trim():null;if(!h)throw Error("ChatGPT Web image generation requires a connection ID");let i=g.providerSpecificData,j=await aw({connectionId:h,storageState:c,selection:{kind:"picker",modelLabel:"GPT-5.6 Sol",effortIndex:0},userAgent:d,locale:"string"==typeof i?.locale?i.locale:void 0,timezone:"string"==typeof i?.timezone?i.timezone:void 0,chromeExecutablePath:av(i?.chromeExecutablePath)});try{return await j.start(),await aH(j.page,{prompt:a,sizeHint:b,signal:e,log:f})}finally{await j.page.close().catch(()=>{})}}}},77490:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"deepseek-web",priority:220,alias:"deepseek-web",aliases:["ds-web"],uiAlias:"deepseek-web",category:"webCookie",authType:"cookie",authModes:["cookie"],display:{name:"DeepSeek Web",icon:"auto_awesome",color:"#4D6BFE",textIcon:"DS",website:"https://chat.deepseek.com",notice:{text:"Paste your userToken from chat.deepseek.com localStorage (DevTools → Application → Local Storage)"}},transport:{baseUrl:"https://chat.deepseek.com/api/v0/chat/completion",format:"openai",authType:"cookie"},models:[{id:"deepseek-v4-pro",name:"DeepSeek V4 Pro"},{id:"deepseek-v4-pro-think",name:"DeepSeek V4 Pro Think",supportsReasoning:!0},{id:"deepseek-v4-pro-search",name:"DeepSeek V4 Pro Search"},{id:"deepseek-v4-pro-think-search",name:"DeepSeek V4 Pro Think+Search",supportsReasoning:!0},{id:"deepseek-v4-flash",name:"DeepSeek V4 Flash"},{id:"deepseek-v4-flash-think",name:"DeepSeek V4 Flash Think",supportsReasoning:!0},{id:"deepseek-v4-flash-search",name:"DeepSeek V4 Flash Search"},{id:"deepseek-v4-flash-think-search",name:"DeepSeek V4 Flash Think+Search",supportsReasoning:!0},{id:"deepseek-chat",name:"DeepSeek Chat"},{id:"deepseek-reasoner",name:"DeepSeek Reasoner",supportsReasoning:!0},{id:"DeepSeek-R1",name:"DeepSeek R1",supportsReasoning:!0},{id:"DeepSeek-R1-Search",name:"DeepSeek R1 Search",supportsReasoning:!0},{id:"DeepSeek-V3.2",name:"DeepSeek V3.2"},{id:"DeepSeek-Search",name:"DeepSeek Search"}]}},77935:(a,b,c)=>{"use strict";let{InvalidArgumentError:d,SocketError:e}=c(61448),{AsyncResource:f}=c(16698),g=c(34589),h=c(84285),{kHTTP2Stream:i}=c(49176),{addSignal:j,removeSignal:k}=c(73135);class l extends f{constructor(a,b){if(!a||"object"!=typeof a)throw new d("invalid opts");if("function"!=typeof b)throw new d("invalid callback");let{signal:c,opaque:e,responseHeaders:f}=a;if(c&&"function"!=typeof c.on&&"function"!=typeof c.addEventListener)throw new d("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=f||null,this.opaque=e||null,this.callback=b,this.abort=null,this.context=null,j(this,c)}onRequestStart(a,b){this.reason?a.abort(this.reason):(g(this.callback),this.abort=b=>a.abort(b),this.context=b)}onResponseStart(){throw new e("bad upgrade",null)}onRequestUpgrade(a,b,c,d){if(b!==(!0===d[i]?200:101)){let b=!0===d[i]?null:h.getSocketInfo(d);a.abort(new e("bad upgrade",b));return}let{callback:f,opaque:g,context:j}=this;k(this),this.callback=null;let l=a?.rawHeaders,m="raw"===this.responseHeaders?h.parseRawHeaders(l):c;this.runInAsyncScope(f,null,null,{headers:m,socket:d,opaque:g,context:j})}onResponseError(a,b){let{callback:c,opaque:d}=this;k(this),c&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(c,null,b,{opaque:d})}))}}a.exports=function a(b,c){if(void 0===c)return new Promise((c,d)=>{a.call(this,b,(a,b)=>a?d(a):c(b))});try{let a=new l(b,c),d={...b,method:b.method||"GET",upgrade:b.protocol||"Websocket"};this.dispatch(d,a)}catch(d){if("function"!=typeof c)throw d;let a=b?.opaque;queueMicrotask(()=>c(d,{opaque:a}))}}},78075:(a,b,c)=>{"use strict";let d=c(31825);a.exports=a=>b=>function(c,e){return b(c,new d({...c,retryOptions:{...a,...c.retryOptions}},{handler:e,dispatch:b}))}},78196:(a,b,c)=>{"use strict";let d,e,f,g,{Headers:h,HeadersList:i,fill:j,getHeadersGuard:k,setHeadersGuard:l,setHeadersList:m}=c(28665),{extractBody:n,cloneBody:o,mixinBody:p,streamRegistry:q,bodyUnusable:r}=c(35381),s=c(84285),t=c(57975),{kEnumerableProperty:u}=s,{isValidReasonPhrase:v,isCancelled:w,isAborted:x,isErrorLike:y,environmentSettingsObject:z}=c(42425),{redirectStatusSet:A,nullBodyStatus:B}=c(19608),{webidl:C}=c(32984),{URLSerializer:D}=c(16537),{kConstruct:E}=c(49176),F=c(34589),{isomorphicEncode:G,serializeJavascriptValueToJSONString:H}=c(70745),I=new TextEncoder("utf-8");class J{#e;#a;static error(){return Q(M(),"immutable")}static json(a,b){C.argumentLengthCheck(arguments,1,"Response.json"),b=C.converters.ResponseInit(b);let c=n(I.encode(H(a))),d=Q(L({}),"response");return P(d,b,{body:c[0],type:"application/json"}),d}static redirect(a,b=302){let c;C.argumentLengthCheck(arguments,1,"Response.redirect"),a=C.converters.USVString(a),b=C.converters["unsigned short"](b);try{c=new URL(a,z.settingsObject.baseUrl)}catch(b){throw TypeError(`Failed to parse URL from ${a}`,{cause:b})}if(!A.has(b))throw RangeError(`Invalid status code ${b}`);let d=Q(L({}),"immutable");d.#a.status=b;let e=G(D(c));return d.#a.headersList.append("location",e,!0),d}constructor(a=null,b){if(C.util.markAsUncloneable(this),a===E)return;null!==a&&(a=C.converters.BodyInit(a,"Response","body")),b=C.converters.ResponseInit(b),this.#a=L({}),this.#e=new h(E),l(this.#e,"response"),m(this.#e,this.#a.headersList);let c=null;if(null!=a){let[b,d]=n(a);c={body:b,type:d}}P(this,b,c)}get type(){return C.brandCheck(this,C.is.Response),this.#a.type}get url(){C.brandCheck(this,C.is.Response);let a=this.#a.urlList,b=a[a.length-1]??null;return null===b?"":D(b,!0)}get redirected(){return C.brandCheck(this,C.is.Response),this.#a.urlList.length>1}get status(){return C.brandCheck(this,C.is.Response),this.#a.status}get ok(){return C.brandCheck(this,C.is.Response),this.#a.status>=200&&this.#a.status<=299}get statusText(){return C.brandCheck(this,C.is.Response),this.#a.statusText}get headers(){return C.brandCheck(this,C.is.Response),this.#e}get body(){return C.brandCheck(this,C.is.Response),this.#a.body?this.#a.body.stream:null}get bodyUsed(){return C.brandCheck(this,C.is.Response),!!this.#a.body&&s.isDisturbed(this.#a.body.stream)}clone(){if(C.brandCheck(this,C.is.Response),r(this.#a))throw C.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let a=K(this.#a);return 0!==this.#a.urlList.length&&this.#a.body?.stream&&q.register(this,new WeakRef(this.#a.body.stream)),Q(a,k(this.#e))}[t.inspect.custom](a,b){null===b.depth&&(b.depth=2),b.colors??=!0;let c={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${t.formatWithOptions(b,c)}`}static{d=a=>a.#e,e=(a,b)=>{a.#e=b},f=a=>a.#a,g=(a,b)=>{a.#a=b},C.is.Response=a=>null!=a&&"object"==typeof a&&#a in a}}function K(a){if(a.internalResponse)return O(K(a.internalResponse),a.type);let b=L({...a,body:null});return null!=a.body&&(b.body=o(a.body)),b}function L(a){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...a,headersList:a?.headersList?new i(a?.headersList):new i,urlList:a?.urlList?[...a.urlList]:[]}}function M(a){return L({type:"error",status:0,error:y(a)?a:Error(a?String(a):a),aborted:a&&"AbortError"===a.name})}function N(a,b){return b={internalResponse:a,...b},new Proxy(a,{get:(a,c)=>c in b?b[c]:a[c],set:(a,c,d)=>(F(!(c in b)),a[c]=d,!0)})}function O(a,b){return"basic"===b?N(a,{type:"basic",headersList:a.headersList}):"cors"===b?N(a,{type:"cors",headersList:a.headersList}):"opaque"===b?N(a,{type:"opaque",urlList:[],status:0,statusText:"",body:null}):"opaqueredirect"===b?N(a,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null}):void F(!1)}function P(a,b,c){if(null!==b.status&&(b.status<200||b.status>599))throw RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in b&&null!=b.statusText&&!v(String(b.statusText)))throw TypeError("Invalid statusText");if("status"in b&&null!=b.status&&(f(a).status=b.status),"statusText"in b&&null!=b.statusText&&(f(a).statusText=b.statusText),"headers"in b&&null!=b.headers&&j(d(a),b.headers),c){if(B.includes(a.status))throw C.errors.exception({header:"Response constructor",message:`Invalid response status code ${a.status}`});f(a).body=c.body,null==c.type||f(a).headersList.contains("content-type",!0)||f(a).headersList.append("content-type",c.type,!0)}}function Q(a,b){let c=new J(E);g(c,a);let d=new h(E);return e(c,d),m(d,a.headersList),l(d,b),0!==a.urlList.length&&a.body?.stream&&q.register(c,new WeakRef(a.body.stream)),c}p(J,f,C.is.Response),Object.defineProperties(J.prototype,{type:u,url:u,status:u,ok:u,redirected:u,statusText:u,headers:u,clone:u,body:u,bodyUsed:u,[Symbol.toStringTag]:{value:"Response",configurable:!0}}),Object.defineProperties(J,{json:u,redirect:u,error:u}),C.converters.XMLHttpRequestBodyInit=function(a,b,c){return"string"==typeof a?C.converters.USVString(a,b,c):C.is.Blob(a)||C.is.BufferSource(a)||C.is.FormData(a)||C.is.URLSearchParams(a)?a:C.converters.DOMString(a,b,c)},C.converters.BodyInit=function(a,b,c){return C.is.ReadableStream(a)||a?.[Symbol.asyncIterator]?a:C.converters.XMLHttpRequestBodyInit(a,b,c)},C.converters.ResponseInit=C.dictionaryConverter([{key:"status",converter:C.converters["unsigned short"],defaultValue:()=>200},{key:"statusText",converter:C.converters.ByteString,defaultValue:()=>""},{key:"headers",converter:C.converters.HeadersInit}]),a.exports={isNetworkError:function(a){return"error"===a.type&&0===a.status},makeNetworkError:M,makeResponse:L,makeAppropriateNetworkError:function(a,b=null){return F(w(a)),x(a)?M(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:b})):M(Object.assign(new DOMException("Request was cancelled."),{cause:b}))},filterResponse:O,Response:J,cloneResponse:K,fromInnerResponse:Q,getResponseState:f}},78419:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"muse",alias:"muse",aliases:["muse-ai","meta-model-api","muse-code","muse-subscription"],category:"oauth",authModes:["oauth","apikey"],hasOAuth:!0,priority:120,passthroughModels:!0,display:{name:"Muse (Meta Model API)",icon:"auto_awesome",color:"#0866FF",textIcon:"MU",website:"https://muse.ai",notice:{text:"Sign in with your Meta account (Muse Code subscription) or paste a Model API key from dev.meta.ai. Subscription keys are minted per account; Meta may train on contributor-tier data.",apiKeyUrl:"https://dev.meta.ai",signupUrl:"https://muse.ai"}},transport:{baseUrl:"https://api.meta.ai/v1/chat/completions",validateUrl:"https://api.meta.ai/v1/models",modelsUrl:"https://api.meta.ai/v1/models",format:"openai",auth:{combined:!0,header:"Authorization",scheme:"bearer",hooks:["museHeaders"]},transports:[{format:"openai",baseUrl:"https://api.meta.ai/v1/chat/completions",auth:{combined:!0,header:"Authorization",scheme:"bearer",hooks:["museHeaders"]}},{format:"openai-responses",baseUrl:"https://api.meta.ai/v1/responses",auth:{combined:!0,header:"Authorization",scheme:"bearer",hooks:["museHeaders"]},thinkingFormat:"openai-responses"}]},oauth:{clientId:"1031625952748946",deviceCodeUrl:"https://auth.meta.com/oidc/device/authorization/",tokenUrl:"https://auth.meta.com/oidc/device/token/"},models:[{id:"muse-spark-1.3",name:"Muse Spark 1.3",targetFormat:"openai-responses",supportedFormats:["openai-responses"]},{id:"muse-spark-1.2",name:"Muse Spark 1.2",targetFormat:"openai-responses",supportedFormats:["openai-responses"]},{id:"muse-spark-1.1",name:"Muse Spark 1.1",targetFormat:"openai-responses",supportedFormats:["openai-responses"]},{id:"muse-spark-1.3-contributor",name:"Muse Spark 1.3 Contributor",targetFormat:"openai-responses",supportedFormats:["openai-responses"]},{id:"muse-spark-1.2-contributor",name:"Muse Spark 1.2 Contributor",targetFormat:"openai-responses",supportedFormats:["openai-responses"]}],serviceKinds:["llm"]}},79154:(a,b,c)=>{"use strict";c.d(b,{Dz:()=>g,Vq:()=>j,fp:()=>h});var d=c(99939);let e=new Map;function f(a){if(null==a||""===a)return null;if("number"==typeof a)return a<1e12?1e3*a:a;let b=new Date(a).getTime();return Number.isFinite(b)?b:null}function g(a){return f(a?.expiresAt??a?.tokenExpiresAt)}function h(a,b,c=Date.now()){if(!b||"codex"===a&&b.providerSpecificData?.codexRefreshBlockedAt)return!1;let e=g(b);return!!(null!==e&&e-c<(0,d.Og)(a)||"codex"===a&&b.refreshToken&&function(a,b=Date.now()){let c=f(a?.lastRefreshAt??a?.lastRefresh??a?.providerSpecificData?.lastRefreshAt);return!c||b-c>=6912e5}(b,c))}async function i(a,b,c){let d,f=(d=b?.connectionId||b?.id||b?.email||b?.name||b?.refreshToken?.slice?.(-16)||"default",`${a}:${d}`),g=e.get(f);if(g)return g;let h=Promise.resolve().then(c).finally(()=>{e.delete(f)});return e.set(f,h),h}async function j(a,b,c){return b?i(a,b,async()=>{if("codex"===a&&b.providerSpecificData?.codexRefreshBlockedAt)throw(0,d.R_)({error:"unrecoverable_refresh_error",code:b.providerSpecificData.codexRefreshErrorCode||"invalid_refresh_token"});let e=await (0,d.$B)(a,b,c);if((0,d.jT)(e))throw(0,d.R_)(e);return function(a,b,c,e=Date.now()){var f,g;if(!c)return null;if((0,d.jT)(c))return c;let h={},i=new Date(e).toISOString();c.accessToken&&(h.accessToken=c.accessToken),c.apiKey&&(h.apiKey=c.apiKey),c.token&&(h.token=c.token);let j=c.refreshToken??b?.refreshToken;j&&(h.refreshToken=j);let k=c.idToken??b?.idToken;return k&&(h.idToken=k),c.expiresIn?(h.expiresIn=c.expiresIn,h.expiresAt=function(a,b=Date.now()){return a?new Date(b+1e3*a).toISOString():null}(c.expiresIn,e)):c.expiresAt&&(h.expiresAt=c.expiresAt),c.projectId&&(h.projectId=c.projectId),c.providerSpecificData&&(f=b?.providerSpecificData,h.providerSpecificData=(g=c.providerSpecificData)&&"object"==typeof g?{...f||{},...g}:f),c.copilotToken&&(h.copilotToken=c.copilotToken),c.copilotTokenExpiresAt&&(h.copilotTokenExpiresAt=c.copilotTokenExpiresAt),("codex"===a||h.accessToken||h.apiKey||h.token||h.refreshToken||h.copilotToken)&&(h.lastRefreshAt=c.lastRefreshAt||i),h}(a,b,e)}):null}},79263:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"nvidia-build",priority:220,alias:"nvb",aliases:["nv-build","nv-kimi"],uiAlias:"nvidia-build",category:"webCookie",authType:"cookie",authModes:["cookie"],display:{name:"NVIDIA Build (Playground)",icon:"memory",color:"#76B900",textIcon:"NB",website:"https://build.nvidia.com/moonshotai/kimi-k3_1-pro",notice:{text:"One connection per NVIDIA account. Paste the cookie export (JSON array, e.g. an nv-kimi-bridge sessions/*.json file) from a logged-in build.nvidia.com session. A headless page is opened only while requests are flowing and closed after 5 idle minutes."}},transport:{baseUrl:"https://buildapi.ngc.nvidia.com/v2/predict/models/qc69jvmznzxy",format:"openai",authType:"cookie"},models:[{id:"moonshotai/kimi-k3.1-pro",name:"Kimi K3.1 Pro",supportsReasoning:!0},{id:"minimaxai/minimax-m3.1-flash",name:"MiniMax M3.1 Flash",supportsReasoning:!0},{id:"stepfun-ai/step-5-preview",name:"StepFun Step 5 Preview",supportsReasoning:!0},{id:"nvidia/nemotron-3-ultra-550b-a55b",name:"Nemotron 3 Ultra 550B",supportsReasoning:!0}]}},79412:a=>{"use strict";let b=Symbol.for("undici.globalOrigin.1");a.exports={getGlobalOrigin:function(){return globalThis[b]},setGlobalOrigin:function(a){if(void 0===a)return void Object.defineProperty(globalThis,b,{value:void 0,writable:!0,enumerable:!1,configurable:!1});let c=new URL(a);if("http:"!==c.protocol&&"https:"!==c.protocol)throw TypeError(`Only http & https urls are allowed, received ${c.protocol}`);Object.defineProperty(globalThis,b,{value:c,writable:!0,enumerable:!1,configurable:!1})}}},79468:(a,b,c)=>{"use strict";let{safeHTTPMethods:d,pathHasQueryOrFragment:e,hasSafeIterator:f,isValidHTTPToken:g,setHeader:h}=c(84285),{serializePathWithQuery:i}=c(84285),{kRequestOrigin:j}=c(49176),k=["no-store","private","no-cache"],l=Symbol("invalid cache-control directives");function m(a){return a.replace(/^[\t ]+|[\t ]+$/g,"")}function n(a,b){for(let c=0;c<a.length;c++)if(a[c]===b)return!0;return!1}function o(a){return a.replace(/^[\t ]+/,"")}function p(a){return a.replace(/[\t ]+$/,"")}function q(a,b){let c=!1;for(let d=b;d<a.length;d++)if(c)c=!1;else if("\\"===a[d])c=!0;else if('"'===a[d])return d;return -1}function r(a,b){let c=a[l];void 0===c&&Object.defineProperty(a,l,{value:c=new Set}),c.add(b)}function s(a){let b=void 0===a[j]?a.origin:a[j];return"string"==typeof b||b instanceof URL?b:null}function t(a,b,c){let d=b.toLowerCase(),e=Object.hasOwn(a,d)?a[d]:void 0,f=Array.isArray(c)?c:[c];void 0===e?h(a,d,Array.isArray(c)?c.slice():c):Array.isArray(e)?e.push(...f):h(a,d,[e,...f])}function u(a){let b=Array.isArray(a)?a:[a],c=[];for(let a=0;a<b.length;a++){let d=b[a].split(",");for(let a=0;a<d.length;a++)c.push(d[a])}return c}function v(a){let b=u(a);for(let a=0;a<b.length;a++)if(-1!==m(b[a]).indexOf("*"))return!0;return!1}function w(a,b){if(v(a))return b;let c={};for(let d of u(a)){let a=m(d).toLowerCase();if(0===a.length)continue;if(!g(a))return;let e=b[a];c[a]=Array.isArray(e)?e.slice():e??null}return c}a.exports={getInterceptorOrigin:function(a,b){let c=s(a);if(void 0===b)return c;if(null===b)return null;if(c)try{if(new URL(c).origin!==b)return null}catch{}return b},getRequestOrigin:s,makeCacheKey:function(a,b=s(a)){if(!b)throw Error("opts.origin is undefined");let c=a.path||"/";return a.query&&!e(c)&&(c=i(c,a.query)),{origin:b.toString(),method:a.method,path:c,headers:a.headers}},normalizeHeaders:function(a){let b;if(null==a.headers)b={};else if("object"==typeof a.headers)if(b={},f(a.headers))if(Array.isArray(a.headers))if(Array.isArray(a.headers[0]))for(let c of a.headers){if(!Array.isArray(c))throw Error("opts.headers is not a valid header map");let[a,d]=c;if("string"!=typeof a||"string"!=typeof d)throw Error("opts.headers is not a valid header map");t(b,a,d)}else{let c=a.headers.length;if(c%2!=0)throw Error("opts.headers is not a valid header map");for(let d=0;d<c;d+=2){let c=a.headers[d],e=a.headers[d+1];if("string"!=typeof c||"string"!=typeof e&&!Array.isArray(e))throw Error("opts.headers is not a valid header map");if("string"==typeof e)t(b,c,e);else{let a=[];for(let b=0;b<e.length;b++){let c=e[b];a.push("string"==typeof c?c:c.toString("latin1"))}t(b,c,a)}}}else for(let c of a.headers){if(!Array.isArray(c))throw Error("opts.headers is not a valid header map");let[a,d]=c;if("string"!=typeof a||"string"!=typeof d)throw Error("opts.headers is not a valid header map");t(b,a,d)}else for(let c of Object.keys(a.headers))t(b,c,a.headers[c]);else throw Error("opts.headers is not an object");return b},assertCacheKey:function(a){if("object"!=typeof a)throw TypeError(`expected key to be object, got ${typeof a}`);for(let b of["origin","method","path"])if("string"!=typeof a[b])throw TypeError(`expected key.${b} to be string, got ${typeof a[b]}`);if(void 0!==a.headers&&"object"!=typeof a.headers)throw TypeError(`expected headers to be object, got ${typeof a}`)},assertCacheValue:function(a){if("object"!=typeof a)throw TypeError(`expected value to be object, got ${typeof a}`);for(let b of["statusCode","cachedAt","staleAt","deleteAt"])if("number"!=typeof a[b])throw TypeError(`expected value.${b} to be number, got ${typeof a[b]}`);if("string"!=typeof a.statusMessage)throw TypeError(`expected value.statusMessage to be string, got ${typeof a.statusMessage}`);if(null!=a.headers&&"object"!=typeof a.headers)throw TypeError(`expected value.rawHeaders to be object, got ${typeof a.headers}`);if(void 0!==a.vary&&"object"!=typeof a.vary)throw TypeError(`expected value.vary to be object, got ${typeof a.vary}`);if(void 0!==a.etag&&"string"!=typeof a.etag)throw TypeError(`expected value.etag to be string, got ${typeof a.etag}`)},parseCacheControlHeader:function(a){let b={},c=new Set,d=new Set,e=function(a){let b=[],c=0,d=-1,e=!1,f=!1;for(let g=0;g<a.length;g++)e?f?f=!1:"\\"===a[g]?f=!0:'"'===a[g]&&(e=!1,d=-1):'"'===a[g]?(e=!0,d=g):","===a[g]&&(b.push({value:a.substring(c,g),fromMalformedQuote:!1}),c=g+1);if(!e)return b.push({value:a.substring(c),fromMalformedQuote:!1}),b;let g=a.substring(c),h=d-c,i=0;for(let a=0;a<g.length;a++)","===g[a]&&(b.push({value:g.substring(i,a),fromMalformedQuote:i>h}),i=a+1);return b.push({value:g.substring(i),fromMalformedQuote:i>h}),b}(Array.isArray(a)?a.join(","):a);for(let a=0;a<e.length;a++){let f,h,i=e[a],j=i.value.toLowerCase(),l=i.fromMalformedQuote,s=j.indexOf("="),t=!1,u=!1;if(-1!==s){let a=j.substring(0,s),b=j.substring(s+1);t=p(a)!==a,u=o(b)!==b,f=m(a),h=o(b)}else f=m(j);let v=function(a){for(let b of k)if(a.startsWith(b)&&a.length>b.length&&!g(a[b.length]))return b;let b="",c=!1;for(let d=0;d<a.length;d++)g(a[d])?b+=a[d]:c=!0;if(c&&n(k,b))return b}(f);if(void 0!==v){b[v]=!0;continue}switch(f){case"min-fresh":case"max-stale":case"max-age":case"s-maxage":case"stale-while-revalidate":case"stale-if-error":{if(l||c.has(f))continue;if(void 0===h||t||u||(h.length>=2&&'"'===h[0]&&'"'===h[h.length-1]&&(h=h.substring(1,h.length-1)),!/^[0-9]+$/.test(h))){delete b[f],c.add(f),r(b,f);continue}let a=Math.min(parseInt(h,10),0x7fffffff);"min-fresh"===f?f in b&&!(b[f]<a)||(b[f]=a):f in b&&!(b[f]>a)||(b[f]=a);break}case"private":case"no-cache":if(l||void 0!==h&&0===h.length){b[f]=!0;break}if(h){if('"'===h[0]){h=p(h);let c="",d=a,i=!1,j=q(h,1);if(-1!==j)c=h.substring(1,j),i=!0;else{let b=[h.substring(1)];for(let c=a+1;c<e.length;c++){let a=m(e[c].value),f=q(a,0);if(d=c,-1!==f){b.push(a.substring(0,f)),i=!0;break}b.push(a)}c=b.join(",")}if(!i){b[f]=!0;break}a=d;let k=c.split(","),l=!0;for(let a=0;a<k.length;a++)k[a]=m(k[a]),g(k[a])||(l=!1);l?!0!==b[f]&&(f in b?b[f]=b[f].concat(k):b[f]=k):b[f]=!0}else{let a=m(h);g(a)?!0!==b[f]&&(f in b?b[f]=b[f].concat(a):b[f]=[a]):b[f]=!0}break}case"public":case"must-revalidate":case"proxy-revalidate":case"immutable":case"no-transform":case"must-understand":case"only-if-cached":if(l||d.has(f))continue;if(void 0!==h){delete b[f],d.add(f);continue}b[f]=!0;break;case"no-store":b[f]=!0;break;default:continue}}return b},hasInvalidCacheControlDirective:function(a,b){return a[l]?.has(b)===!0},parseVaryHeader:w,hasVaryStar:v,isInvalidOrWildcardVaryHeader:function(a){return v(a)||void 0===w(a,{})},isEtagUsable:function(a){return!(a.length<=2)&&('"'===a[0]&&'"'===a[a.length-1]?!('"'===a[1]||a.startsWith('"W/')):!!a.startsWith('W/"')&&'"'===a[a.length-1]&&4!==a.length)},assertCacheMethods:function(a,b="CacheMethods"){if(!Array.isArray(a))throw TypeError(`expected type of ${b} needs to be an array, got ${null===a?"null":typeof a}`);if(0===a.length)throw TypeError(`${b} needs to have at least one method`);for(let c of a)if(!n(d,c))throw TypeError(`element of ${b}-array needs to be one of following values: ${d.join(", ")}, got ${c}`)},assertCacheStore:function(a,b="CacheStore"){if("object"!=typeof a||null===a)throw TypeError(`expected type of ${b} to be a CacheStore, got ${null===a?"null":typeof a}`);for(let c of["get","createWriteStream","delete"])if("function"!=typeof a[c])throw TypeError(`${b} needs to have a \`${c}()\` function`)},makeDeduplicationKey:function(a,b){let c={};if(a.headers)for(let d of Object.keys(a.headers).sort())b?.has(d.toLowerCase())||h(c,d,a.headers[d]);return JSON.stringify([a.origin,a.method,a.path,c])}}},79499:(a,b,c)=>{"use strict";c.d(b,{CP:()=>r,Xh:()=>l,Y8:()=>q,tM:()=>n,yI:()=>o});var d=c(27137),e=c(74075),f=c.n(e);let g="1"===process.env.CURSOR_PROTOBUF_DEBUG,h=(a,...b)=>g&&console.log(`[PROTOBUF:${a}]`,...b);new TextDecoder;let i="1.1.3",j=new Set([1,2,3,9,10,11,27,1,25]);function k(a){let b=[];for(;a>=128;)b.push(127&a|128),a>>>=7;return b.push(127&a),new Uint8Array(b)}function l(a,b,c){let d=k(a<<3|b);if(0===b)return m(d,k(c));if(2===b){let a="string"==typeof c?new TextEncoder().encode(c):c instanceof Uint8Array?c:Buffer.isBuffer(c)?new Uint8Array(c):new Uint8Array(0);return m(d,k(a.length),a)}return new Uint8Array(0)}function m(...a){let b=new Uint8Array(a.reduce((a,b)=>a+b.length,0)),c=0;for(let d of a)b.set(d,c),c+=d.length;return b}function n(a,b=!1){let c=a,d=0;b&&(c=new Uint8Array(f().gzipSync(Buffer.from(a))),d=1);let e=new Uint8Array(5+c.length);return e[0]=d,e[1]=c.length>>24&255,e[2]=c.length>>16&255,e[3]=c.length>>8&255,e[4]=255&c.length,e.set(c,5),e}function o(a,b,c=[],e=null,f=!1){h("BODY",`Generating: ${a.length} msgs, model=${b}, tools=${c.length}, reasoning=${e||"none"}, forceAgentMode=${f}`);let g=function(a,b,c=[],e=null,f=!1){return l(1,2,function(a,b,c=[],e=null,f=!1){let g,i=c?.length>0,j=i||f,n=[],o=[],p=[];for(let b=0;b<a.length;b++){let c=a[b],d=Array.isArray(c?.tool_calls)&&c.tool_calls.length>0,e=Array.isArray(c?.tool_results)&&c.tool_results.length>0;if(c?.role==="assistant"&&d&&e){h("ENCODE",`normalizing mixed assistant tool payload at msg[${b}] (calls=${c.tool_calls.length}, results=${c.tool_results.length})`),p.push({...c,tool_results:[]});let d=a[b+1],e=d?.role==="assistant"&&Array.isArray(d?.tool_results)&&d.tool_results.length>0,f=new Set(c.tool_results.map(a=>a?.tool_call_id).filter(a=>"string"==typeof a)),g=new Set((d?.tool_results||[]).map(a=>a?.tool_call_id).filter(a=>"string"==typeof a)),i=f.size>0&&f.size===g.size;if(i){for(let a of f)if(!g.has(a)){i=!1;break}}e&&i||p.push({role:"assistant",content:"",tool_results:c.tool_results});continue}p.push(c)}for(let a=0;a<p.length;a++){let b=p[a],c="user"===b.role?1:2,e=(0,d.A)(),f=a===p.length-1;n.push({content:b.content,role:c,messageId:e,isLast:f,hasTools:i,toolResults:b.tool_results||[]}),o.push({messageId:e,role:c})}let q=0;return"medium"===e?q=1:"high"===e&&(q=2),m(...n.map(a=>l(1,2,function(a,b,c,d=!1,e=!1,f=[],g=null){let h=f.length>0;return m(l(1,2,a),l(2,0,b),l(13,2,c),...g?[l(32,2,g)]:[],...h?f.map(a=>l(18,2,function(a){var b;let c,d,e=function(a){let b="string"==typeof a&&a.length>0?a:"tool";if(b.startsWith("mcp__")){let a=b.slice(5),c=a.indexOf("__");if(c>=0){let b=a.slice(0,c)||"custom",d=a.slice(c+2)||"tool";return`mcp_${b}_${d}`}return`mcp_custom_${a||"tool"}`}return b.startsWith("mcp_")?b:`mcp_custom_${b}`}(a.tool_name||a.name||""),f=a.raw_args||"{}",g=a.result_content||a.result||"",{toolCallId:h,modelCallId:i}=(b=a.tool_call_id||"",c="\nmc_",(d=b.indexOf(c))>=0?{toolCallId:b.slice(0,d),modelCallId:b.slice(d+c.length)}:{toolCallId:b,modelCallId:null}),j=a.tool_index||a.index||1,{serverName:k,selectedTool:n}=function(a){if("string"!=typeof a||!a.startsWith("mcp_"))return{serverName:"custom",selectedTool:a||"tool"};let b=a.slice(4),c=b.indexOf("_");return c<0?{serverName:"custom",selectedTool:b||"tool"}:{serverName:b.slice(0,c)||"custom",selectedTool:b.slice(c+1)||"tool"}}(e);return m(l(1,2,h),l(2,2,e),l(3,0,j>0?j:1),...i?[l(12,2,i)]:[],l(5,2,f),l(8,2,function(a,b,c,d,e=1){return m(l(1,0,19),l(28,2,m(l(1,2,c),l(2,2,d))),l(35,2,a),...b?[l(48,2,b)]:[],l(49,0,e>0?e:1))}(h,i,n,g,j)),l(11,2,function(a,b,c,d,e,f,g=1){let h;return m(l(1,0,19),l(27,2,(h=m(l(1,2,c),l(3,2,e),l(4,2,d)),l(1,2,h))),l(3,2,a),l(9,2,b),l(10,2,e),l(48,0,g>0?g:1),...f?[l(49,2,f)]:[])}(h,e,n,k,f,i,j)))}(a))):[],l(29,0,+!!e),l(47,0,e?2:1),...d&&e?[l(51,2,k(1))]:[])}(a.content,a.role,a.messageId,a.isLast,a.hasTools,a.toolResults))),l(2,0,1),l(3,2,new Uint8Array(0)),l(4,0,1),l(5,2,m(l(1,2,b),l(4,2,new Uint8Array(0)))),l(8,2,""),l(13,0,1),l(15,2,(g=m(l(1,2,new Uint8Array(0)),l(2,2,new Uint8Array(0))),m(l(1,2,"cursor\\aisettings"),l(3,2,new Uint8Array(0)),l(6,2,g),l(8,0,1),l(9,0,1)))),l(19,0,1),l(23,2,(0,d.A)()),l(26,2,m(l(1,2,process.platform||"linux"),l(2,2,process.arch||"x64"),l(3,2,process.version||"v20.0.0"),l(4,2,process.cwd?.()||"/"),l(5,2,new Date().toISOString()))),l(27,0,+!!j),...j?[l(29,2,k(1))]:[],...o.map(a=>l(30,2,function(a,b,c=null){return m(l(1,2,a),...c?[l(2,2,c)]:[],l(3,0,b))}(a.messageId,a.role))),...c?.length>0?c.map(a=>{let b,c,d;return l(34,2,(b=a.function?.name||a.name||"",c=a.function?.description||a.description||"",d=a.function?.parameters||a.input_schema||{},m(...b?[l(1,2,b)]:[],...c?[l(2,2,c)]:[],...Object.keys(d).length>0?[l(3,2,JSON.stringify(d))]:[],l(4,2,"custom"))))}):[],l(35,0,0),l(38,0,0),l(46,0,j?2:1),l(47,2,""),l(48,0,+!j),l(49,0,q),l(51,0,0),l(53,0,1),l(54,2,j?"Agent":"Ask"))}(a,b,c,e,f))}(a,b,c,e,f),i=n(g,!1);return h("BODY",`Protobuf=${g.length}B, Framed=${i.length}B`),i}function p(a,b){let c=0,d=0,e=b;for(;e<a.length;){let b=a[e];if(c|=(127&b)<<d,e++,!(128&b))break;d+=7}return[c,e]}function q(a){let b=new Map,c=0;for(;c<a.length;){let[d,e,f,g]=function(a,b){let c;if(b>=a.length)return[null,null,null,b];let[d,e]=p(a,b),f=7&d,g=e;if(0===f)[c,g]=p(a,g);else if(2===f){let[b,d]=p(a,g);c=a.slice(d,d+b),g=d+b}else 1===f?(c=a.slice(g,g+8),g+=8):5===f?(c=a.slice(g,g+4),g+=4):c=null;return[d>>3,f,c,g]}(a,c);if(null===d)break;b.has(d)||b.set(d,[]),b.get(d).push({wireType:e,value:f}),c=g}return b}function r(a){try{let b=q(a);for(let a of b.keys())j.has(a)||h("SCHEMA",`Unknown response field #${a} detected. Schema v${i} may be outdated.`);if(b.has(1)){let a=function(a){let b=q(a),c="",d="",e="",f=!1;if(b.has(3)&&(c=new TextDecoder().decode(b.get(3)[0].value).split("\n")[0]),b.has(9)&&(d=new TextDecoder().decode(b.get(9)[0].value)),b.has(11)&&(f=0!==b.get(11)[0].value),b.has(27))try{let a=q(b.get(27)[0].value);if(a.has(1)){let b=q(a.get(1)[0].value);b.has(1)&&(d=new TextDecoder().decode(b.get(1)[0].value)),b.has(3)&&(e=new TextDecoder().decode(b.get(3)[0].value))}}catch(a){h("EXTRACT",`MCP parse error: ${a.message}`)}return(!e&&b.has(10)&&(e=new TextDecoder().decode(b.get(10)[0].value)),c&&d)?{id:c,type:"function",function:{name:d,arguments:e||"{}"},isLast:f}:null}(b.get(1)[0].value);if(a)return h("EXTRACT",`Tool call: ${a.function.name}`),{text:null,error:null,toolCall:a,thinking:null}}if(b.has(2)){let{text:a,thinking:c}=function(a){let b=q(a),c=null,d=null;if(b.has(1)&&(c=new TextDecoder().decode(b.get(1)[0].value)),b.has(25))try{let a=q(b.get(25)[0].value);a.has(1)&&(d=new TextDecoder().decode(a.get(1)[0].value))}catch(a){h("EXTRACT",`Thinking parse error: ${a.message}`)}return{text:c,thinking:d}}(b.get(2)[0].value);if(a||c)return{text:a,error:null,toolCall:null,thinking:c}}return{text:null,error:null,toolCall:null,thinking:null}}catch(b){return h("EXTRACT",`Decode failed (schema v${i}): ${b.message}`),{text:null,error:null,toolCall:null,thinking:null,raw:Buffer.from(a).toString("base64"),decodeError:b.message}}}},80015:(a,b,c)=>{"use strict";c.d(b,{Z:()=>i});let d={deepseek:{scope:"all"},minimax:{scope:"all"},"minimax-cn":{scope:"all"}},e=[{match:a=>/^kimi-/i.test(a||""),scope:"toolCalls"},{match:a=>/deepseek/i.test(a||""),scope:"all"}],f="deepseek-v4-pro",g={[`${f}-max`]:{thinkingType:"enabled",reasoningEffort:"max"},[`${f}-none`]:{thinkingType:"disabled",reasoningEffort:null}},h=["reasoning","thought","thinking"];function i({provider:a,model:b,body:c}){let j=d[a],k=e.find(a=>a.match(b)),l="nvidia"===a?function(a){if(!Array.isArray(a?.messages))return a;let b=!1,c=a.messages.map(a=>{if(!a||"assistant"!==a.role||!h.find(b=>"string"==typeof a[b]))return a;b=!0;let c={...a};if("string"!=typeof c.reasoning_content||0===c.reasoning_content.length){let a=h.map(a=>c[a]).find(a=>"string"==typeof a&&a.length>0);a&&(c.reasoning_content=a)}for(let a of h)"string"==typeof c[a]&&delete c[a];return c});return b?{...a,messages:c}:a}(c):c;var m=function({provider:a,model:b,body:c}){let d=g[b];if("deepseek"!==a||!d||!c)return c;let e={...c,model:f,extra_body:{...c.extra_body||{},thinking:{...c.extra_body?.thinking||{},type:d.thinkingType}}};return d.reasoningEffort?e.reasoning_effort=d.reasoningEffort:delete e.reasoning_effort,e}({provider:a,model:b,body:l}),n=j||k;if(!n||!m?.messages)return m;let o=m.messages.map(a=>!function(a,b){if(a?.role!=="assistant")return!1;let c=a.reasoning_content;return("string"!=typeof c||!(c.length>0))&&("toolCalls"!==b||Array.isArray(a.tool_calls)&&a.tool_calls.length>0)}(a,n.scope)?a:{...a,reasoning_content:" "});return{...m,messages:o}}},80328:(a,b,c)=>{"use strict";c.d(b,{j9:()=>X,cA:()=>O,Em:()=>V});var d=c(77598),e=c.n(d),f=c(69384),g=c(30395),h=c(80015),i=c(26574),j=c(16605),k=c(31421),l=c(73024),m=c.n(l),n=c(48161),o=c.n(n),p=c(76760),q=c.n(p);let r=`
638
+ Respond with ONLY <tool> blocks, one per line. No prose, no code fences, no explanation before or after the blocks.`:i);if(!m.trim())throw Object.assign(Error("ChatGPT Web requires non-empty text"),{status:400});let n={...await aR({baseUrl:a,accessToken:b,userAgent:d,signal:g}),Authorization:`Bearer ${b}`,"User-Agent":d,...c?{Cookie:c}:{},"Content-Type":"application/json"},o=await a4(`${a}/backend-api/f/conversation/prepare`,{method:"POST",headers:{...n,Accept:"application/json"},body:JSON.stringify({action:"next",parent_message_id:(0,e.randomUUID)(),model:"auto",client_prepare_state:"success",timezone_offset_min:0,timezone:"UTC",conversation_mode:{kind:"primary_assistant"},partial_query:{id:(0,e.randomUUID)(),author:{role:"user"},content:{content_type:"text",parts:[m]}},supports_buffering:!0,supported_encodings:["v1"],client_contextual_info:{app_name:"chatgpt.com"}})},6e4,g);if(!o.ok){let a=(await o.text().catch(()=>"")).slice(0,200);throw Object.assign(Error(`ChatGPT prepare failed (HTTP ${o.status}) ${a}`),{status:o.status||502})}let p=await o.json().catch(()=>null),q=await a4(`${a}/backend-api/f/conversation`,{method:"POST",headers:{...n,Accept:"text/event-stream","X-Conduit-Token":p?.conduit_token||"","X-Oai-Turn-Trace-Id":(0,e.randomUUID)()},body:JSON.stringify({action:"next",messages:[{id:(0,e.randomUUID)(),author:{role:"user"},create_time:Date.now()/1e3,content:{content_type:"text",parts:[m]},metadata:{serialization_metadata:{custom_symbol_offsets:[]}}}],parent_message_id:(0,e.randomUUID)(),model:"auto",client_prepare_state:"sent",timezone_offset_min:0,timezone:"UTC",conversation_mode:{kind:"primary_assistant"},enable_message_followups:!0,supports_buffering:!0,supported_encodings:["v1"],client_contextual_info:{app_name:"chatgpt.com"},force_parallel_switch:"auto"})},135e3,g);if(!q.ok)throw Object.assign(Error(`ChatGPT conversation failed (HTTP ${q.status})`),{status:q.status||502});let r=((await a5(q,0x1000000,12e4)).match(/"conversation_id"\s*:\s*"([0-9a-f-]{36})"/)||[])[1]||"";if(!r)throw Object.assign(Error("ChatGPT conversation produced no conversation id"),{status:502});let s=Date.now();for(;Date.now()-s<=18e4;){if(g?.aborted)throw Error("Request aborted");let e=await a4(`${a}/backend-api/conversation/${r}`,{headers:{Authorization:`Bearer ${b}`,"User-Agent":d,Accept:"application/json",...c?{Cookie:c}:{}}},3e4,g).catch(()=>null);if(e?.ok){let a=await e.json().catch(()=>null),b=a?function(a){let b=a?.mapping||{},c="",d=!1,e="";for(let a of Object.values(b)){let b=a?.message;if(b&&"assistant"===String(b.author?.role||"").toLowerCase()&&(b.metadata?.is_complete===!0&&(d=!0),b.content?.content_type==="text"&&(c+=(b.content.parts||[]).filter(a=>"string"==typeof a).join("")),b.metadata?.is_error)){let a=(b.content?.parts||[]).filter(a=>"string"==typeof a).join("");a&&(e=a)}}return d?{text:c,errorText:e}:null}(a):null;if(b){if(!b.text.trim()&&b.errorText)throw Object.assign(Error(`ChatGPT refused the turn: ${b.errorText.slice(0,200)}`),{status:400});return h&&!l.hasTools&&h.debug?.("CGPT-WEB",`chat turn complete (${b.text.length} chars)`),{text:b.text,hasTools:l.hasTools,requestedTools:l.requestedTools}}}else h&&h.debug?.("CGPT-WEB",`conversation poll status ${e?.status??"network"}, retrying`);await a3(1500)}throw Object.assign(Error("ChatGPT chat turn timed out"),{status:504})}var a7=c(36215);let a8="https://chatgpt.com",a9="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36";async function ba({storageState:a,userAgent:b,signal:c}){let d=aW(a),e=await fetch(`${a8}/api/auth/session`,{headers:{"User-Agent":b,Accept:"application/json",...d?{Cookie:d}:{}},signal:c});if(!e.ok)throw Object.assign(Error(`ChatGPT session unavailable (HTTP ${e.status})`),{status:403===e.status?401:e.status||502});let f=await e.json().catch(()=>null);if("string"!=typeof f?.accessToken||!f.accessToken)throw Object.assign(Error("ChatGPT session is not signed in"),{status:401});return f.accessToken}function bb(a,b){return new Response(JSON.stringify({error:{message:b}}),{status:a,headers:{"Content-Type":"application/json"}})}class bc extends d.Hv{constructor(){super("chatgpt-web",{id:"chatgpt-web",baseUrl:a8})}async testConnection(a){try{let b=a?.providerSpecificData?.storageState??a?.apiKey;if("string"!=typeof b||!b.trim())return!1;if(b.trim().startsWith("{"))return JSON.parse(b),!0;return/__Secure-next-auth\.session-token|^[\w-]+\.[\w-]+\.[\w-]+$/.test(b.trim())}catch{return!1}}async execute(a){try{let b=await this.#cl(a);if(b)return b;return{response:await ay(a),url:a8,headers:{},transformedBody:a.body}}catch(c){let b=c instanceof Error?c.message:"ChatGPT Web browser execution failed";if((0,a7.BE)(b))return{response:bb(503,"ChatGPT Web requires a Chrome/Chromium browser (headed). Install Google Chrome on the host (or set CHATGPT_WEB_CHROME_PATH), and run `npx playwright-core install chromium`."),url:a8,headers:{},transformedBody:a.body};return{response:bb(/storage state|credentials|connection ID/i.test(b)?401:/(?:\bHTTP[_\s-]*429\b|\bstatus\s+429\b|\brate[-_\s]?limit(?:ed)?\b|\bquota\s+(?:exhausted|reached|exceeded)\b|\b(?:image(?:\s+upload)?|upload|usage)\s+limit\s+(?:reached|exceeded)\b|\breached\s+(?:your\s+)?(?:image(?:\s+upload)?|upload|usage)\s+limit\b)/i.test(b)?429:/request|messages|prompt|model|tools|text content|reasoning effort/i.test(b)?400:502,b),url:a8,headers:{},transformedBody:a.body}}}async #cl(a){let b,c,{credentials:d,body:f,model:g,stream:h}=a;try{b=at(d)}catch{return null}let i=d?.providerSpecificData,j="string"==typeof i?.customUserAgent&&i.customUserAgent.trim()?i.customUserAgent.trim():a9;try{let d=await ba({storageState:b,userAgent:j,signal:a.signal});c=await a6({baseUrl:a8,accessToken:d,cookie:aW(b),userAgent:j,body:f,signal:a.signal,log:a.log})}catch(a){if(a?.code==="TURNSTILE_REQUIRED"||/Turnstile/i.test(a?.message||""))return null;throw a}if(!c.hasTools)return{response:ax(g,{text:c.text},h),url:a8,headers:{},transformedBody:f};let k=ax(g,{text:c.text},!1);return{response:await (0,ak.N)(k,c.requestedTools,h,{idSeed:"call",cid:`chatcmpl-${(0,e.randomUUID)()}`,created:Math.floor(Date.now()/1e3),model:g}),url:a8,headers:{},transformedBody:f}}async generateMedia({prompt:a,n:b=1,size:c,credentials:d,signal:e,log:f}){if(!a)throw Error("prompt is required for image generation");let g=at(d),h=d.providerSpecificData,i="string"==typeof h?.customUserAgent&&h.customUserAgent.trim()?h.customUserAgent.trim():a9,j=[];for(let h=0;h<Math.max(1,b);h++)j.push(await this.#cm({prompt:a,size:c,storageState:g,userAgent:i,signal:e,log:f,credentials:d}));return j}async #cm({prompt:a,size:b,storageState:c,userAgent:d,signal:e,log:f,credentials:g}){try{let g=await ba({storageState:c,userAgent:d,signal:e});return await a2({baseUrl:a8,accessToken:g,cookie:aW(c),userAgent:d,prompt:a,sizeHint:b,signal:e,log:f})}catch(a){if(a?.code!=="TURNSTILE_REQUIRED"&&!/Turnstile/i.test(a?.message||""))throw a;f?.warn?.("CGPT-WEB","Sentinel demanded Turnstile — falling back to the browser path")}let h="string"==typeof g?.connectionId&&g.connectionId.trim()?g.connectionId.trim():null;if(!h)throw Error("ChatGPT Web image generation requires a connection ID");let i=g.providerSpecificData,j=await aw({connectionId:h,storageState:c,selection:{kind:"picker",modelLabel:"GPT-5.6 Sol",effortIndex:0},userAgent:d,locale:"string"==typeof i?.locale?i.locale:void 0,timezone:"string"==typeof i?.timezone?i.timezone:void 0,chromeExecutablePath:av(i?.chromeExecutablePath)});try{return await j.start(),await aH(j.page,{prompt:a,sizeHint:b,signal:e,log:f})}finally{await j.page.close().catch(()=>{})}}}},77490:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"deepseek-web",priority:220,alias:"deepseek-web",aliases:["ds-web"],uiAlias:"deepseek-web",category:"webCookie",authType:"cookie",authModes:["cookie"],display:{name:"DeepSeek Web",icon:"auto_awesome",color:"#4D6BFE",textIcon:"DS",website:"https://chat.deepseek.com",notice:{text:"Paste your userToken from chat.deepseek.com localStorage (DevTools → Application → Local Storage)"}},transport:{baseUrl:"https://chat.deepseek.com/api/v0/chat/completion",format:"openai",authType:"cookie"},models:[{id:"deepseek-v4-pro",name:"DeepSeek V4 Pro"},{id:"deepseek-v4-pro-think",name:"DeepSeek V4 Pro Think",supportsReasoning:!0},{id:"deepseek-v4-pro-search",name:"DeepSeek V4 Pro Search"},{id:"deepseek-v4-pro-think-search",name:"DeepSeek V4 Pro Think+Search",supportsReasoning:!0},{id:"deepseek-v4-flash",name:"DeepSeek V4 Flash"},{id:"deepseek-v4-flash-think",name:"DeepSeek V4 Flash Think",supportsReasoning:!0},{id:"deepseek-v4-flash-search",name:"DeepSeek V4 Flash Search"},{id:"deepseek-v4-flash-think-search",name:"DeepSeek V4 Flash Think+Search",supportsReasoning:!0},{id:"deepseek-chat",name:"DeepSeek Chat"},{id:"deepseek-reasoner",name:"DeepSeek Reasoner",supportsReasoning:!0},{id:"DeepSeek-R1",name:"DeepSeek R1",supportsReasoning:!0},{id:"DeepSeek-R1-Search",name:"DeepSeek R1 Search",supportsReasoning:!0},{id:"DeepSeek-V3.2",name:"DeepSeek V3.2"},{id:"DeepSeek-Search",name:"DeepSeek Search"}]}},77935:(a,b,c)=>{"use strict";let{InvalidArgumentError:d,SocketError:e}=c(61448),{AsyncResource:f}=c(16698),g=c(34589),h=c(84285),{kHTTP2Stream:i}=c(49176),{addSignal:j,removeSignal:k}=c(73135);class l extends f{constructor(a,b){if(!a||"object"!=typeof a)throw new d("invalid opts");if("function"!=typeof b)throw new d("invalid callback");let{signal:c,opaque:e,responseHeaders:f}=a;if(c&&"function"!=typeof c.on&&"function"!=typeof c.addEventListener)throw new d("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=f||null,this.opaque=e||null,this.callback=b,this.abort=null,this.context=null,j(this,c)}onRequestStart(a,b){this.reason?a.abort(this.reason):(g(this.callback),this.abort=b=>a.abort(b),this.context=b)}onResponseStart(){throw new e("bad upgrade",null)}onRequestUpgrade(a,b,c,d){if(b!==(!0===d[i]?200:101)){let b=!0===d[i]?null:h.getSocketInfo(d);a.abort(new e("bad upgrade",b));return}let{callback:f,opaque:g,context:j}=this;k(this),this.callback=null;let l=a?.rawHeaders,m="raw"===this.responseHeaders?h.parseRawHeaders(l):c;this.runInAsyncScope(f,null,null,{headers:m,socket:d,opaque:g,context:j})}onResponseError(a,b){let{callback:c,opaque:d}=this;k(this),c&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(c,null,b,{opaque:d})}))}}a.exports=function a(b,c){if(void 0===c)return new Promise((c,d)=>{a.call(this,b,(a,b)=>a?d(a):c(b))});try{let a=new l(b,c),d={...b,method:b.method||"GET",upgrade:b.protocol||"Websocket"};this.dispatch(d,a)}catch(d){if("function"!=typeof c)throw d;let a=b?.opaque;queueMicrotask(()=>c(d,{opaque:a}))}}},78075:(a,b,c)=>{"use strict";let d=c(31825);a.exports=a=>b=>function(c,e){return b(c,new d({...c,retryOptions:{...a,...c.retryOptions}},{handler:e,dispatch:b}))}},78196:(a,b,c)=>{"use strict";let d,e,f,g,{Headers:h,HeadersList:i,fill:j,getHeadersGuard:k,setHeadersGuard:l,setHeadersList:m}=c(28665),{extractBody:n,cloneBody:o,mixinBody:p,streamRegistry:q,bodyUnusable:r}=c(35381),s=c(84285),t=c(57975),{kEnumerableProperty:u}=s,{isValidReasonPhrase:v,isCancelled:w,isAborted:x,isErrorLike:y,environmentSettingsObject:z}=c(42425),{redirectStatusSet:A,nullBodyStatus:B}=c(19608),{webidl:C}=c(32984),{URLSerializer:D}=c(16537),{kConstruct:E}=c(49176),F=c(34589),{isomorphicEncode:G,serializeJavascriptValueToJSONString:H}=c(70745),I=new TextEncoder("utf-8");class J{#e;#a;static error(){return Q(M(),"immutable")}static json(a,b){C.argumentLengthCheck(arguments,1,"Response.json"),b=C.converters.ResponseInit(b);let c=n(I.encode(H(a))),d=Q(L({}),"response");return P(d,b,{body:c[0],type:"application/json"}),d}static redirect(a,b=302){let c;C.argumentLengthCheck(arguments,1,"Response.redirect"),a=C.converters.USVString(a),b=C.converters["unsigned short"](b);try{c=new URL(a,z.settingsObject.baseUrl)}catch(b){throw TypeError(`Failed to parse URL from ${a}`,{cause:b})}if(!A.has(b))throw RangeError(`Invalid status code ${b}`);let d=Q(L({}),"immutable");d.#a.status=b;let e=G(D(c));return d.#a.headersList.append("location",e,!0),d}constructor(a=null,b){if(C.util.markAsUncloneable(this),a===E)return;null!==a&&(a=C.converters.BodyInit(a,"Response","body")),b=C.converters.ResponseInit(b),this.#a=L({}),this.#e=new h(E),l(this.#e,"response"),m(this.#e,this.#a.headersList);let c=null;if(null!=a){let[b,d]=n(a);c={body:b,type:d}}P(this,b,c)}get type(){return C.brandCheck(this,C.is.Response),this.#a.type}get url(){C.brandCheck(this,C.is.Response);let a=this.#a.urlList,b=a[a.length-1]??null;return null===b?"":D(b,!0)}get redirected(){return C.brandCheck(this,C.is.Response),this.#a.urlList.length>1}get status(){return C.brandCheck(this,C.is.Response),this.#a.status}get ok(){return C.brandCheck(this,C.is.Response),this.#a.status>=200&&this.#a.status<=299}get statusText(){return C.brandCheck(this,C.is.Response),this.#a.statusText}get headers(){return C.brandCheck(this,C.is.Response),this.#e}get body(){return C.brandCheck(this,C.is.Response),this.#a.body?this.#a.body.stream:null}get bodyUsed(){return C.brandCheck(this,C.is.Response),!!this.#a.body&&s.isDisturbed(this.#a.body.stream)}clone(){if(C.brandCheck(this,C.is.Response),r(this.#a))throw C.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let a=K(this.#a);return 0!==this.#a.urlList.length&&this.#a.body?.stream&&q.register(this,new WeakRef(this.#a.body.stream)),Q(a,k(this.#e))}[t.inspect.custom](a,b){null===b.depth&&(b.depth=2),b.colors??=!0;let c={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${t.formatWithOptions(b,c)}`}static{d=a=>a.#e,e=(a,b)=>{a.#e=b},f=a=>a.#a,g=(a,b)=>{a.#a=b},C.is.Response=a=>null!=a&&"object"==typeof a&&#a in a}}function K(a){if(a.internalResponse)return O(K(a.internalResponse),a.type);let b=L({...a,body:null});return null!=a.body&&(b.body=o(a.body)),b}function L(a){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...a,headersList:a?.headersList?new i(a?.headersList):new i,urlList:a?.urlList?[...a.urlList]:[]}}function M(a){return L({type:"error",status:0,error:y(a)?a:Error(a?String(a):a),aborted:a&&"AbortError"===a.name})}function N(a,b){return b={internalResponse:a,...b},new Proxy(a,{get:(a,c)=>c in b?b[c]:a[c],set:(a,c,d)=>(F(!(c in b)),a[c]=d,!0)})}function O(a,b){return"basic"===b?N(a,{type:"basic",headersList:a.headersList}):"cors"===b?N(a,{type:"cors",headersList:a.headersList}):"opaque"===b?N(a,{type:"opaque",urlList:[],status:0,statusText:"",body:null}):"opaqueredirect"===b?N(a,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null}):void F(!1)}function P(a,b,c){if(null!==b.status&&(b.status<200||b.status>599))throw RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in b&&null!=b.statusText&&!v(String(b.statusText)))throw TypeError("Invalid statusText");if("status"in b&&null!=b.status&&(f(a).status=b.status),"statusText"in b&&null!=b.statusText&&(f(a).statusText=b.statusText),"headers"in b&&null!=b.headers&&j(d(a),b.headers),c){if(B.includes(a.status))throw C.errors.exception({header:"Response constructor",message:`Invalid response status code ${a.status}`});f(a).body=c.body,null==c.type||f(a).headersList.contains("content-type",!0)||f(a).headersList.append("content-type",c.type,!0)}}function Q(a,b){let c=new J(E);g(c,a);let d=new h(E);return e(c,d),m(d,a.headersList),l(d,b),0!==a.urlList.length&&a.body?.stream&&q.register(c,new WeakRef(a.body.stream)),c}p(J,f,C.is.Response),Object.defineProperties(J.prototype,{type:u,url:u,status:u,ok:u,redirected:u,statusText:u,headers:u,clone:u,body:u,bodyUsed:u,[Symbol.toStringTag]:{value:"Response",configurable:!0}}),Object.defineProperties(J,{json:u,redirect:u,error:u}),C.converters.XMLHttpRequestBodyInit=function(a,b,c){return"string"==typeof a?C.converters.USVString(a,b,c):C.is.Blob(a)||C.is.BufferSource(a)||C.is.FormData(a)||C.is.URLSearchParams(a)?a:C.converters.DOMString(a,b,c)},C.converters.BodyInit=function(a,b,c){return C.is.ReadableStream(a)||a?.[Symbol.asyncIterator]?a:C.converters.XMLHttpRequestBodyInit(a,b,c)},C.converters.ResponseInit=C.dictionaryConverter([{key:"status",converter:C.converters["unsigned short"],defaultValue:()=>200},{key:"statusText",converter:C.converters.ByteString,defaultValue:()=>""},{key:"headers",converter:C.converters.HeadersInit}]),a.exports={isNetworkError:function(a){return"error"===a.type&&0===a.status},makeNetworkError:M,makeResponse:L,makeAppropriateNetworkError:function(a,b=null){return F(w(a)),x(a)?M(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:b})):M(Object.assign(new DOMException("Request was cancelled."),{cause:b}))},filterResponse:O,Response:J,cloneResponse:K,fromInnerResponse:Q,getResponseState:f}},78419:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"muse",alias:"muse",aliases:["muse-ai","meta-model-api","muse-code","muse-subscription"],category:"oauth",authModes:["oauth","apikey"],hasOAuth:!0,priority:120,passthroughModels:!0,display:{name:"Muse (Meta Model API)",icon:"auto_awesome",color:"#0866FF",textIcon:"MU",website:"https://muse.ai",notice:{text:"Sign in with your Meta account (Muse Code subscription) or paste a Model API key from dev.meta.ai. Subscription keys are minted per account; Meta may train on contributor-tier data.",apiKeyUrl:"https://dev.meta.ai",signupUrl:"https://muse.ai"}},transport:{baseUrl:"https://api.meta.ai/v1/chat/completions",validateUrl:"https://api.meta.ai/v1/models",modelsUrl:"https://api.meta.ai/v1/models",format:"openai",auth:{combined:!0,header:"Authorization",scheme:"bearer",hooks:["museHeaders"]},transports:[{format:"openai",baseUrl:"https://api.meta.ai/v1/chat/completions",auth:{combined:!0,header:"Authorization",scheme:"bearer",hooks:["museHeaders"]}},{format:"openai-responses",baseUrl:"https://api.meta.ai/v1/responses",auth:{combined:!0,header:"Authorization",scheme:"bearer",hooks:["museHeaders"]},thinkingFormat:"openai-responses"}]},oauth:{clientId:"1031625952748946",deviceCodeUrl:"https://auth.meta.com/oidc/device/authorization/",tokenUrl:"https://auth.meta.com/oidc/device/token/"},models:[{id:"muse-spark-1.3",name:"Muse Spark 1.3",targetFormat:"openai-responses",supportedFormats:["openai-responses"]},{id:"muse-spark-1.2",name:"Muse Spark 1.2",targetFormat:"openai-responses",supportedFormats:["openai-responses"]},{id:"muse-spark-1.1",name:"Muse Spark 1.1",targetFormat:"openai-responses",supportedFormats:["openai-responses"]},{id:"muse-spark-1.3-contributor",name:"Muse Spark 1.3 Contributor",targetFormat:"openai-responses",supportedFormats:["openai-responses"]},{id:"muse-spark-1.2-contributor",name:"Muse Spark 1.2 Contributor",targetFormat:"openai-responses",supportedFormats:["openai-responses"]}],serviceKinds:["llm"]}},79154:(a,b,c)=>{"use strict";c.d(b,{Dz:()=>g,Vq:()=>j,fp:()=>h});var d=c(99939);let e=new Map;function f(a){if(null==a||""===a)return null;if("number"==typeof a)return a<1e12?1e3*a:a;let b=new Date(a).getTime();return Number.isFinite(b)?b:null}function g(a){return f(a?.expiresAt??a?.tokenExpiresAt)}function h(a,b,c=Date.now()){if(!b||"codex"===a&&b.providerSpecificData?.codexRefreshBlockedAt)return!1;let e=g(b);return!!(null!==e&&e-c<(0,d.Og)(a)||"codex"===a&&b.refreshToken&&function(a,b=Date.now()){let c=f(a?.lastRefreshAt??a?.lastRefresh??a?.providerSpecificData?.lastRefreshAt);return!c||b-c>=6912e5}(b,c))}async function i(a,b,c){let d,f=(d=b?.connectionId||b?.id||b?.email||b?.name||b?.refreshToken?.slice?.(-16)||"default",`${a}:${d}`),g=e.get(f);if(g)return g;let h=Promise.resolve().then(c).finally(()=>{e.delete(f)});return e.set(f,h),h}async function j(a,b,c){return b?i(a,b,async()=>{if("codex"===a&&b.providerSpecificData?.codexRefreshBlockedAt)throw(0,d.R_)({error:"unrecoverable_refresh_error",code:b.providerSpecificData.codexRefreshErrorCode||"invalid_refresh_token"});let e=await (0,d.$B)(a,b,c);if((0,d.jT)(e))throw(0,d.R_)(e);return function(a,b,c,e=Date.now()){var f,g;if(!c)return null;if((0,d.jT)(c))return c;let h={},i=new Date(e).toISOString();c.accessToken&&(h.accessToken=c.accessToken),c.apiKey&&(h.apiKey=c.apiKey),c.token&&(h.token=c.token);let j=c.refreshToken??b?.refreshToken;j&&(h.refreshToken=j);let k=c.idToken??b?.idToken;return k&&(h.idToken=k),c.expiresIn?(h.expiresIn=c.expiresIn,h.expiresAt=function(a,b=Date.now()){return a?new Date(b+1e3*a).toISOString():null}(c.expiresIn,e)):c.expiresAt&&(h.expiresAt=c.expiresAt),c.projectId&&(h.projectId=c.projectId),c.providerSpecificData&&(f=b?.providerSpecificData,h.providerSpecificData=(g=c.providerSpecificData)&&"object"==typeof g?{...f||{},...g}:f),c.copilotToken&&(h.copilotToken=c.copilotToken),c.copilotTokenExpiresAt&&(h.copilotTokenExpiresAt=c.copilotTokenExpiresAt),("codex"===a||h.accessToken||h.apiKey||h.token||h.refreshToken||h.copilotToken)&&(h.lastRefreshAt=c.lastRefreshAt||i),h}(a,b,e)}):null}},79263:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"nvidia-build",priority:220,alias:"nvb",aliases:["nv-build","nv-kimi"],uiAlias:"nvidia-build",category:"webCookie",authType:"cookie",authModes:["cookie"],display:{name:"NVIDIA Build (Playground)",icon:"memory",color:"#76B900",textIcon:"NB",website:"https://build.nvidia.com/moonshotai/kimi-k3_1-pro",notice:{text:"One connection per NVIDIA account. Paste the cookie export (JSON array, e.g. an nv-kimi-bridge sessions/*.json file) from a logged-in build.nvidia.com session. A headless page is opened only while requests are flowing and closed after 5 idle minutes."}},transport:{baseUrl:"https://buildapi.ngc.nvidia.com/v2/predict/models/qc69jvmznzxy",format:"openai",authType:"cookie"},models:[{id:"moonshotai/kimi-k3.1-pro",name:"Kimi K3.1 Pro",supportsReasoning:!0},{id:"minimaxai/minimax-m3.1-flash",name:"MiniMax M3.1 Flash",supportsReasoning:!0},{id:"stepfun-ai/step-5-preview",name:"StepFun Step 5 Preview",supportsReasoning:!0},{id:"nvidia/nemotron-3-ultra-550b-a55b",name:"Nemotron 3 Ultra 550B",supportsReasoning:!0}]}},79412:a=>{"use strict";let b=Symbol.for("undici.globalOrigin.1");a.exports={getGlobalOrigin:function(){return globalThis[b]},setGlobalOrigin:function(a){if(void 0===a)return void Object.defineProperty(globalThis,b,{value:void 0,writable:!0,enumerable:!1,configurable:!1});let c=new URL(a);if("http:"!==c.protocol&&"https:"!==c.protocol)throw TypeError(`Only http & https urls are allowed, received ${c.protocol}`);Object.defineProperty(globalThis,b,{value:c,writable:!0,enumerable:!1,configurable:!1})}}},79468:(a,b,c)=>{"use strict";let{safeHTTPMethods:d,pathHasQueryOrFragment:e,hasSafeIterator:f,isValidHTTPToken:g,setHeader:h}=c(84285),{serializePathWithQuery:i}=c(84285),{kRequestOrigin:j}=c(49176),k=["no-store","private","no-cache"],l=Symbol("invalid cache-control directives");function m(a){return a.replace(/^[\t ]+|[\t ]+$/g,"")}function n(a,b){for(let c=0;c<a.length;c++)if(a[c]===b)return!0;return!1}function o(a){return a.replace(/^[\t ]+/,"")}function p(a){return a.replace(/[\t ]+$/,"")}function q(a,b){let c=!1;for(let d=b;d<a.length;d++)if(c)c=!1;else if("\\"===a[d])c=!0;else if('"'===a[d])return d;return -1}function r(a,b){let c=a[l];void 0===c&&Object.defineProperty(a,l,{value:c=new Set}),c.add(b)}function s(a){let b=void 0===a[j]?a.origin:a[j];return"string"==typeof b||b instanceof URL?b:null}function t(a,b,c){let d=b.toLowerCase(),e=Object.hasOwn(a,d)?a[d]:void 0,f=Array.isArray(c)?c:[c];void 0===e?h(a,d,Array.isArray(c)?c.slice():c):Array.isArray(e)?e.push(...f):h(a,d,[e,...f])}function u(a){let b=Array.isArray(a)?a:[a],c=[];for(let a=0;a<b.length;a++){let d=b[a].split(",");for(let a=0;a<d.length;a++)c.push(d[a])}return c}function v(a){let b=u(a);for(let a=0;a<b.length;a++)if(-1!==m(b[a]).indexOf("*"))return!0;return!1}function w(a,b){if(v(a))return b;let c={};for(let d of u(a)){let a=m(d).toLowerCase();if(0===a.length)continue;if(!g(a))return;let e=b[a];c[a]=Array.isArray(e)?e.slice():e??null}return c}a.exports={getInterceptorOrigin:function(a,b){let c=s(a);if(void 0===b)return c;if(null===b)return null;if(c)try{if(new URL(c).origin!==b)return null}catch{}return b},getRequestOrigin:s,makeCacheKey:function(a,b=s(a)){if(!b)throw Error("opts.origin is undefined");let c=a.path||"/";return a.query&&!e(c)&&(c=i(c,a.query)),{origin:b.toString(),method:a.method,path:c,headers:a.headers}},normalizeHeaders:function(a){let b;if(null==a.headers)b={};else if("object"==typeof a.headers)if(b={},f(a.headers))if(Array.isArray(a.headers))if(Array.isArray(a.headers[0]))for(let c of a.headers){if(!Array.isArray(c))throw Error("opts.headers is not a valid header map");let[a,d]=c;if("string"!=typeof a||"string"!=typeof d)throw Error("opts.headers is not a valid header map");t(b,a,d)}else{let c=a.headers.length;if(c%2!=0)throw Error("opts.headers is not a valid header map");for(let d=0;d<c;d+=2){let c=a.headers[d],e=a.headers[d+1];if("string"!=typeof c||"string"!=typeof e&&!Array.isArray(e))throw Error("opts.headers is not a valid header map");if("string"==typeof e)t(b,c,e);else{let a=[];for(let b=0;b<e.length;b++){let c=e[b];a.push("string"==typeof c?c:c.toString("latin1"))}t(b,c,a)}}}else for(let c of a.headers){if(!Array.isArray(c))throw Error("opts.headers is not a valid header map");let[a,d]=c;if("string"!=typeof a||"string"!=typeof d)throw Error("opts.headers is not a valid header map");t(b,a,d)}else for(let c of Object.keys(a.headers))t(b,c,a.headers[c]);else throw Error("opts.headers is not an object");return b},assertCacheKey:function(a){if("object"!=typeof a)throw TypeError(`expected key to be object, got ${typeof a}`);for(let b of["origin","method","path"])if("string"!=typeof a[b])throw TypeError(`expected key.${b} to be string, got ${typeof a[b]}`);if(void 0!==a.headers&&"object"!=typeof a.headers)throw TypeError(`expected headers to be object, got ${typeof a}`)},assertCacheValue:function(a){if("object"!=typeof a)throw TypeError(`expected value to be object, got ${typeof a}`);for(let b of["statusCode","cachedAt","staleAt","deleteAt"])if("number"!=typeof a[b])throw TypeError(`expected value.${b} to be number, got ${typeof a[b]}`);if("string"!=typeof a.statusMessage)throw TypeError(`expected value.statusMessage to be string, got ${typeof a.statusMessage}`);if(null!=a.headers&&"object"!=typeof a.headers)throw TypeError(`expected value.rawHeaders to be object, got ${typeof a.headers}`);if(void 0!==a.vary&&"object"!=typeof a.vary)throw TypeError(`expected value.vary to be object, got ${typeof a.vary}`);if(void 0!==a.etag&&"string"!=typeof a.etag)throw TypeError(`expected value.etag to be string, got ${typeof a.etag}`)},parseCacheControlHeader:function(a){let b={},c=new Set,d=new Set,e=function(a){let b=[],c=0,d=-1,e=!1,f=!1;for(let g=0;g<a.length;g++)e?f?f=!1:"\\"===a[g]?f=!0:'"'===a[g]&&(e=!1,d=-1):'"'===a[g]?(e=!0,d=g):","===a[g]&&(b.push({value:a.substring(c,g),fromMalformedQuote:!1}),c=g+1);if(!e)return b.push({value:a.substring(c),fromMalformedQuote:!1}),b;let g=a.substring(c),h=d-c,i=0;for(let a=0;a<g.length;a++)","===g[a]&&(b.push({value:g.substring(i,a),fromMalformedQuote:i>h}),i=a+1);return b.push({value:g.substring(i),fromMalformedQuote:i>h}),b}(Array.isArray(a)?a.join(","):a);for(let a=0;a<e.length;a++){let f,h,i=e[a],j=i.value.toLowerCase(),l=i.fromMalformedQuote,s=j.indexOf("="),t=!1,u=!1;if(-1!==s){let a=j.substring(0,s),b=j.substring(s+1);t=p(a)!==a,u=o(b)!==b,f=m(a),h=o(b)}else f=m(j);let v=function(a){for(let b of k)if(a.startsWith(b)&&a.length>b.length&&!g(a[b.length]))return b;let b="",c=!1;for(let d=0;d<a.length;d++)g(a[d])?b+=a[d]:c=!0;if(c&&n(k,b))return b}(f);if(void 0!==v){b[v]=!0;continue}switch(f){case"min-fresh":case"max-stale":case"max-age":case"s-maxage":case"stale-while-revalidate":case"stale-if-error":{if(l||c.has(f))continue;if(void 0===h||t||u||(h.length>=2&&'"'===h[0]&&'"'===h[h.length-1]&&(h=h.substring(1,h.length-1)),!/^[0-9]+$/.test(h))){delete b[f],c.add(f),r(b,f);continue}let a=Math.min(parseInt(h,10),0x7fffffff);"min-fresh"===f?f in b&&!(b[f]<a)||(b[f]=a):f in b&&!(b[f]>a)||(b[f]=a);break}case"private":case"no-cache":if(l||void 0!==h&&0===h.length){b[f]=!0;break}if(h){if('"'===h[0]){h=p(h);let c="",d=a,i=!1,j=q(h,1);if(-1!==j)c=h.substring(1,j),i=!0;else{let b=[h.substring(1)];for(let c=a+1;c<e.length;c++){let a=m(e[c].value),f=q(a,0);if(d=c,-1!==f){b.push(a.substring(0,f)),i=!0;break}b.push(a)}c=b.join(",")}if(!i){b[f]=!0;break}a=d;let k=c.split(","),l=!0;for(let a=0;a<k.length;a++)k[a]=m(k[a]),g(k[a])||(l=!1);l?!0!==b[f]&&(f in b?b[f]=b[f].concat(k):b[f]=k):b[f]=!0}else{let a=m(h);g(a)?!0!==b[f]&&(f in b?b[f]=b[f].concat(a):b[f]=[a]):b[f]=!0}break}case"public":case"must-revalidate":case"proxy-revalidate":case"immutable":case"no-transform":case"must-understand":case"only-if-cached":if(l||d.has(f))continue;if(void 0!==h){delete b[f],d.add(f);continue}b[f]=!0;break;case"no-store":b[f]=!0;break;default:continue}}return b},hasInvalidCacheControlDirective:function(a,b){return a[l]?.has(b)===!0},parseVaryHeader:w,hasVaryStar:v,isInvalidOrWildcardVaryHeader:function(a){return v(a)||void 0===w(a,{})},isEtagUsable:function(a){return!(a.length<=2)&&('"'===a[0]&&'"'===a[a.length-1]?!('"'===a[1]||a.startsWith('"W/')):!!a.startsWith('W/"')&&'"'===a[a.length-1]&&4!==a.length)},assertCacheMethods:function(a,b="CacheMethods"){if(!Array.isArray(a))throw TypeError(`expected type of ${b} needs to be an array, got ${null===a?"null":typeof a}`);if(0===a.length)throw TypeError(`${b} needs to have at least one method`);for(let c of a)if(!n(d,c))throw TypeError(`element of ${b}-array needs to be one of following values: ${d.join(", ")}, got ${c}`)},assertCacheStore:function(a,b="CacheStore"){if("object"!=typeof a||null===a)throw TypeError(`expected type of ${b} to be a CacheStore, got ${null===a?"null":typeof a}`);for(let c of["get","createWriteStream","delete"])if("function"!=typeof a[c])throw TypeError(`${b} needs to have a \`${c}()\` function`)},makeDeduplicationKey:function(a,b){let c={};if(a.headers)for(let d of Object.keys(a.headers).sort())b?.has(d.toLowerCase())||h(c,d,a.headers[d]);return JSON.stringify([a.origin,a.method,a.path,c])}}},79499:(a,b,c)=>{"use strict";c.d(b,{CP:()=>r,Xh:()=>l,Y8:()=>q,tM:()=>n,yI:()=>o});var d=c(27137),e=c(74075),f=c.n(e);let g="1"===process.env.CURSOR_PROTOBUF_DEBUG,h=(a,...b)=>g&&console.log(`[PROTOBUF:${a}]`,...b);new TextDecoder;let i="1.1.3",j=new Set([1,2,3,9,10,11,27,1,25]);function k(a){let b=[];for(;a>=128;)b.push(127&a|128),a>>>=7;return b.push(127&a),new Uint8Array(b)}function l(a,b,c){let d=k(a<<3|b);if(0===b)return m(d,k(c));if(2===b){let a="string"==typeof c?new TextEncoder().encode(c):c instanceof Uint8Array?c:Buffer.isBuffer(c)?new Uint8Array(c):new Uint8Array(0);return m(d,k(a.length),a)}return new Uint8Array(0)}function m(...a){let b=new Uint8Array(a.reduce((a,b)=>a+b.length,0)),c=0;for(let d of a)b.set(d,c),c+=d.length;return b}function n(a,b=!1){let c=a,d=0;b&&(c=new Uint8Array(f().gzipSync(Buffer.from(a))),d=1);let e=new Uint8Array(5+c.length);return e[0]=d,e[1]=c.length>>24&255,e[2]=c.length>>16&255,e[3]=c.length>>8&255,e[4]=255&c.length,e.set(c,5),e}function o(a,b,c=[],e=null,f=!1){h("BODY",`Generating: ${a.length} msgs, model=${b}, tools=${c.length}, reasoning=${e||"none"}, forceAgentMode=${f}`);let g=function(a,b,c=[],e=null,f=!1){return l(1,2,function(a,b,c=[],e=null,f=!1){let g,i=c?.length>0,j=i||f,n=[],o=[],p=[];for(let b=0;b<a.length;b++){let c=a[b],d=Array.isArray(c?.tool_calls)&&c.tool_calls.length>0,e=Array.isArray(c?.tool_results)&&c.tool_results.length>0;if(c?.role==="assistant"&&d&&e){h("ENCODE",`normalizing mixed assistant tool payload at msg[${b}] (calls=${c.tool_calls.length}, results=${c.tool_results.length})`),p.push({...c,tool_results:[]});let d=a[b+1],e=d?.role==="assistant"&&Array.isArray(d?.tool_results)&&d.tool_results.length>0,f=new Set(c.tool_results.map(a=>a?.tool_call_id).filter(a=>"string"==typeof a)),g=new Set((d?.tool_results||[]).map(a=>a?.tool_call_id).filter(a=>"string"==typeof a)),i=f.size>0&&f.size===g.size;if(i){for(let a of f)if(!g.has(a)){i=!1;break}}e&&i||p.push({role:"assistant",content:"",tool_results:c.tool_results});continue}p.push(c)}for(let a=0;a<p.length;a++){let b=p[a],c="user"===b.role?1:2,e=(0,d.A)(),f=a===p.length-1;n.push({content:b.content,role:c,messageId:e,isLast:f,hasTools:i,toolResults:b.tool_results||[]}),o.push({messageId:e,role:c})}let q=0;return"medium"===e?q=1:"high"===e&&(q=2),m(...n.map(a=>l(1,2,function(a,b,c,d=!1,e=!1,f=[],g=null){let h=f.length>0;return m(l(1,2,a),l(2,0,b),l(13,2,c),...g?[l(32,2,g)]:[],...h?f.map(a=>l(18,2,function(a){var b;let c,d,e=function(a){let b="string"==typeof a&&a.length>0?a:"tool";if(b.startsWith("mcp__")){let a=b.slice(5),c=a.indexOf("__");if(c>=0){let b=a.slice(0,c)||"custom",d=a.slice(c+2)||"tool";return`mcp_${b}_${d}`}return`mcp_custom_${a||"tool"}`}return b.startsWith("mcp_")?b:`mcp_custom_${b}`}(a.tool_name||a.name||""),f=a.raw_args||"{}",g=a.result_content||a.result||"",{toolCallId:h,modelCallId:i}=(b=a.tool_call_id||"",c="\nmc_",(d=b.indexOf(c))>=0?{toolCallId:b.slice(0,d),modelCallId:b.slice(d+c.length)}:{toolCallId:b,modelCallId:null}),j=a.tool_index||a.index||1,{serverName:k,selectedTool:n}=function(a){if("string"!=typeof a||!a.startsWith("mcp_"))return{serverName:"custom",selectedTool:a||"tool"};let b=a.slice(4),c=b.indexOf("_");return c<0?{serverName:"custom",selectedTool:b||"tool"}:{serverName:b.slice(0,c)||"custom",selectedTool:b.slice(c+1)||"tool"}}(e);return m(l(1,2,h),l(2,2,e),l(3,0,j>0?j:1),...i?[l(12,2,i)]:[],l(5,2,f),l(8,2,function(a,b,c,d,e=1){return m(l(1,0,19),l(28,2,m(l(1,2,c),l(2,2,d))),l(35,2,a),...b?[l(48,2,b)]:[],l(49,0,e>0?e:1))}(h,i,n,g,j)),l(11,2,function(a,b,c,d,e,f,g=1){let h;return m(l(1,0,19),l(27,2,(h=m(l(1,2,c),l(3,2,e),l(4,2,d)),l(1,2,h))),l(3,2,a),l(9,2,b),l(10,2,e),l(48,0,g>0?g:1),...f?[l(49,2,f)]:[])}(h,e,n,k,f,i,j)))}(a))):[],l(29,0,+!!e),l(47,0,e?2:1),...d&&e?[l(51,2,k(1))]:[])}(a.content,a.role,a.messageId,a.isLast,a.hasTools,a.toolResults))),l(2,0,1),l(3,2,new Uint8Array(0)),l(4,0,1),l(5,2,m(l(1,2,b),l(4,2,new Uint8Array(0)))),l(8,2,""),l(13,0,1),l(15,2,(g=m(l(1,2,new Uint8Array(0)),l(2,2,new Uint8Array(0))),m(l(1,2,"cursor\\aisettings"),l(3,2,new Uint8Array(0)),l(6,2,g),l(8,0,1),l(9,0,1)))),l(19,0,1),l(23,2,(0,d.A)()),l(26,2,m(l(1,2,process.platform||"linux"),l(2,2,process.arch||"x64"),l(3,2,process.version||"v20.0.0"),l(4,2,process.cwd?.()||"/"),l(5,2,new Date().toISOString()))),l(27,0,+!!j),...j?[l(29,2,k(1))]:[],...o.map(a=>l(30,2,function(a,b,c=null){return m(l(1,2,a),...c?[l(2,2,c)]:[],l(3,0,b))}(a.messageId,a.role))),...c?.length>0?c.map(a=>{let b,c,d;return l(34,2,(b=a.function?.name||a.name||"",c=a.function?.description||a.description||"",d=a.function?.parameters||a.input_schema||{},m(...b?[l(1,2,b)]:[],...c?[l(2,2,c)]:[],...Object.keys(d).length>0?[l(3,2,JSON.stringify(d))]:[],l(4,2,"custom"))))}):[],l(35,0,0),l(38,0,0),l(46,0,j?2:1),l(47,2,""),l(48,0,+!j),l(49,0,q),l(51,0,0),l(53,0,1),l(54,2,j?"Agent":"Ask"))}(a,b,c,e,f))}(a,b,c,e,f),i=n(g,!1);return h("BODY",`Protobuf=${g.length}B, Framed=${i.length}B`),i}function p(a,b){let c=0,d=0,e=b;for(;e<a.length;){let b=a[e];if(c|=(127&b)<<d,e++,!(128&b))break;d+=7}return[c,e]}function q(a){let b=new Map,c=0;for(;c<a.length;){let[d,e,f,g]=function(a,b){let c;if(b>=a.length)return[null,null,null,b];let[d,e]=p(a,b),f=7&d,g=e;if(0===f)[c,g]=p(a,g);else if(2===f){let[b,d]=p(a,g);c=a.slice(d,d+b),g=d+b}else 1===f?(c=a.slice(g,g+8),g+=8):5===f?(c=a.slice(g,g+4),g+=4):c=null;return[d>>3,f,c,g]}(a,c);if(null===d)break;b.has(d)||b.set(d,[]),b.get(d).push({wireType:e,value:f}),c=g}return b}function r(a){try{let b=q(a);for(let a of b.keys())j.has(a)||h("SCHEMA",`Unknown response field #${a} detected. Schema v${i} may be outdated.`);if(b.has(1)){let a=function(a){let b=q(a),c="",d="",e="",f=!1;if(b.has(3)&&(c=new TextDecoder().decode(b.get(3)[0].value).split("\n")[0]),b.has(9)&&(d=new TextDecoder().decode(b.get(9)[0].value)),b.has(11)&&(f=0!==b.get(11)[0].value),b.has(27))try{let a=q(b.get(27)[0].value);if(a.has(1)){let b=q(a.get(1)[0].value);b.has(1)&&(d=new TextDecoder().decode(b.get(1)[0].value)),b.has(3)&&(e=new TextDecoder().decode(b.get(3)[0].value))}}catch(a){h("EXTRACT",`MCP parse error: ${a.message}`)}return(!e&&b.has(10)&&(e=new TextDecoder().decode(b.get(10)[0].value)),c&&d)?{id:c,type:"function",function:{name:d,arguments:e||"{}"},isLast:f}:null}(b.get(1)[0].value);if(a)return h("EXTRACT",`Tool call: ${a.function.name}`),{text:null,error:null,toolCall:a,thinking:null}}if(b.has(2)){let{text:a,thinking:c}=function(a){let b=q(a),c=null,d=null;if(b.has(1)&&(c=new TextDecoder().decode(b.get(1)[0].value)),b.has(25))try{let a=q(b.get(25)[0].value);a.has(1)&&(d=new TextDecoder().decode(a.get(1)[0].value))}catch(a){h("EXTRACT",`Thinking parse error: ${a.message}`)}return{text:c,thinking:d}}(b.get(2)[0].value);if(a||c)return{text:a,error:null,toolCall:null,thinking:c}}return{text:null,error:null,toolCall:null,thinking:null}}catch(b){return h("EXTRACT",`Decode failed (schema v${i}): ${b.message}`),{text:null,error:null,toolCall:null,thinking:null,raw:Buffer.from(a).toString("base64"),decodeError:b.message}}}},80015:(a,b,c)=>{"use strict";c.d(b,{Z:()=>i});let d={deepseek:{scope:"all"},minimax:{scope:"all"},"minimax-cn":{scope:"all"}},e=[{match:a=>/^kimi-/i.test(a||""),scope:"toolCalls"},{match:a=>/deepseek/i.test(a||""),scope:"all"}],f="deepseek-v4-pro",g={[`${f}-max`]:{thinkingType:"enabled",reasoningEffort:"max"},[`${f}-none`]:{thinkingType:"disabled",reasoningEffort:null}},h=["reasoning","thought","thinking"];function i({provider:a,model:b,body:c}){let j=d[a],k=e.find(a=>a.match(b)),l="nvidia"===a?function(a){if(!Array.isArray(a?.messages))return a;let b=!1,c=a.messages.map(a=>{if(!a||"assistant"!==a.role||!h.find(b=>"string"==typeof a[b]))return a;b=!0;let c={...a};if("string"!=typeof c.reasoning_content||0===c.reasoning_content.length){let a=h.map(a=>c[a]).find(a=>"string"==typeof a&&a.length>0);a&&(c.reasoning_content=a)}for(let a of h)"string"==typeof c[a]&&delete c[a];return c});return b?{...a,messages:c}:a}(c):c;var m=function({provider:a,model:b,body:c}){let d=g[b];if("deepseek"!==a||!d||!c)return c;let e={...c,model:f,extra_body:{...c.extra_body||{},thinking:{...c.extra_body?.thinking||{},type:d.thinkingType}}};return d.reasoningEffort?e.reasoning_effort=d.reasoningEffort:delete e.reasoning_effort,e}({provider:a,model:b,body:l}),n=j||k;if(!n||!m?.messages)return m;let o=m.messages.map(a=>!function(a,b){if(a?.role!=="assistant")return!1;let c=a.reasoning_content;return("string"!=typeof c||!(c.length>0))&&("toolCalls"!==b||Array.isArray(a.tool_calls)&&a.tool_calls.length>0)}(a,n.scope)?a:{...a,reasoning_content:" "});return{...m,messages:o}}},80328:(a,b,c)=>{"use strict";c.d(b,{j9:()=>X,cA:()=>O,Em:()=>V});var d=c(77598),e=c.n(d),f=c(69384),g=c(30395),h=c(80015),i=c(26574),j=c(16605),k=c(31421),l=c(73024),m=c.n(l),n=c(48161),o=c.n(n),p=c(76760),q=c.n(p);let r=`
639
639
  import { spawn, spawnSync } from "node:child_process";
640
640
  import fs from "node:fs";
641
641
  import os from "node:os";
@@ -1039,7 +1039,7 @@ ${b.content.slice(-800)}`,e-=Math.max(0,a-Buffer.byteLength(b.content,"utf8"))}"
1039
1039
  ${b.content.slice(-60)}`,e-=Math.max(0,a-Buffer.byteLength(b.content,"utf8"))}else if("assistant"===b.role&&b.content.length>400){let a=Buffer.byteLength(b.content,"utf8");b.content=`${b.content.slice(0,250)}
1040
1040
  ...[omitted]...`,e-=Math.max(0,a-Buffer.byteLength(b.content,"utf8"))}}}if((e=Buffer.byteLength(JSON.stringify(a),"utf8"))<=b)return;let g=a.messages.findIndex(a=>a?.role==="user"),h=g>=0?g+1:1;for(;e>b&&a.messages.length-h>8;){let b=1;for(a.messages[h]?.role==="user"&&a.messages[h+1]?.role==="assistant"&&b++;h+b<a.messages.length-6&&a.messages[h+b]?.role==="tool";)b++;a.messages.splice(h,b),e=Buffer.byteLength(JSON.stringify(a),"utf8")}}(e),d?.size&&(0,j.sj)(e,d),e}buildUrl(a){let b="https://opencode.ai";return K.has(a)?`${b}/inference/v1/messages`:`${b}/inference/v1/chat/completions`}buildHeaders(a,b=!0,c){let d,e,f=V(c?.body,a);return{"Content-Type":"application/json",Authorization:"Bearer public","User-Agent":(e=(d=U(a?.rawHeaders,"user-agent")||"").match(L))&&Number(e[1])>=2?d:I.B,"x-opencode-client":U(a?.rawHeaders,"x-opencode-client")||"cli","x-opencode-session":f,"x-opencode-session-id":f,"x-session-affinity":f,"x-session-id":f,"x-opencode-project":U(a?.rawHeaders,"x-opencode-project")||"global",Accept:b?"text/event-stream":"*/*"}}async fetchUpstream(a,b,c){let d=(0,H.ip)(a,c);"string"==typeof d&&d.includes("mode=free-warp")&&await G();let e=await u(a,b,{proxyUrl:d});for(let c=0;c<2&&429===e.status;c++){Q.clear(),R.clear();let c=O(!0),f={...b?.headers||{},"x-opencode-session":c,"x-opencode-session-id":c,"x-session-affinity":c,"x-session-id":c};await e.body?.cancel?.().catch(()=>{}),await new Promise(a=>setTimeout(a,1200)),e=await u(a,{...b,headers:f},{proxyUrl:d})}if(429===e.status&&e.headers?.has?.("retry-after")){let a=new Headers(e.headers);return a.set("retry-after","2"),new Response(e.body,{status:e.status,statusText:e.statusText,headers:a})}return e}}},80437:(a,b,c)=>{"use strict";c.d(b,{M:()=>I});var d=c(77598),e=c.n(d),f=c(88164),g=c(30395);let h=new Map,i={"minimax-code":"https://account.minimax.cn/oauth2/token","minimax-code-global":"https://account.minimax.io/oauth2/token"};async function j(a,b,c,d){if(!b)return c();let e=`${a}:${b}`,f=h.get(e);if(f){if(f.promise)return d?.info?.("TOKEN_REFRESH",`Reusing in-flight refresh for ${a}`),f.promise;if(f.expiresAt>Date.now())return d?.info?.("TOKEN_REFRESH",`Reusing recent refresh result for ${a}`),f.result;h.delete(e)}let g=(async()=>{try{let a=await c();return h.set(e,{result:a,expiresAt:Date.now()+1e4}),a}catch(a){throw h.delete(e),a}})();return h.set(e,{promise:g}),g}async function k(a,b,c){let d=i[a];return d&&b?j(a,b,async()=>{try{let e=await fetch(d,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:b,client_id:"mcode-public",scope:"agent.default",audience:"agent-backend"}).toString(),signal:AbortSignal.timeout(3e4)}),f=await e.json().catch(()=>null);if(!e.ok||f&&"string"==typeof f.error&&f.error){let b=f?.error||`HTTP ${e.status}`;if(400===e.status&&f?.error==="invalid_grant")return c?.warn?.("TOKEN_REFRESH",`MiniMax refresh token spent/rejected (${a}) — sign-in gone`),{error:"invalid_grant"};return c?.error?.("TOKEN_REFRESH",`MiniMax token refresh failed (${a})`,{status:e.status,error:b}),null}if(!f?.access_token)return c?.error?.("TOKEN_REFRESH",`MiniMax refresh returned no access_token (${a})`),null;return{accessToken:f.access_token,refreshToken:f.refresh_token||b,expiresIn:f.expires_in}}catch(b){return c?.error?.("TOKEN_REFRESH",`Error refreshing MiniMax token (${a}): ${b.message}`),null}},c):null}var l=c(77030),m=c.n(l),n=c(73024),o=c.n(n),p=c(48161),q=c.n(p),r=c(76760),s=c.n(r);let t="mcode-auth-lease-v1.cap",u=s().join(q().homedir(),".minimax"),v=Object.freeze({AUTH_REQUIRED:"Desktop authentication is required.",BROKER_UNAVAILABLE:"Desktop authentication integration is unavailable.",CAPABILITY_REJECTED:"Desktop authentication capability was rejected.",PROTOCOL_MISMATCH:"Desktop authentication protocol is incompatible.",INVALID_REQUEST:"Desktop authentication request is invalid.",INTERNAL_ERROR:"Desktop authentication request failed."});class w extends Error{constructor(a,b,c){super(b??v[a]??"auth lease failed"),this.name="AuthLeaseError",this.code=a,c&&(this.cause=c)}}function x(a){return a?.authType==="mcode-lease"}function y(a){let b=a?.providerSpecificData?.mcodeDataDir;if("string"==typeof b&&b.trim())return s().resolve(b.trim());let c=process.env.MINIMAX_DESKTOP_DATA_DIR;return"string"==typeof c&&c.trim()?s().resolve(c.trim()):u}function z(a,b=process.platform){if("win32"===b){if(!s().win32.isAbsolute(a))throw new w("INVALID_REQUEST","dataDir must be an absolute path on Windows.");let b=s().win32.normalize(a).replace(/[\\/]+$/u,""),c=e().createHash("sha256").update(b.toLowerCase()).digest("hex").slice(0,16);return{transport:"pipe",endpoint:`\\\\.\\pipe\\mcode-auth-lease-${c}`,capabilityFile:s().win32.join(b,"run",t)}}if(!s().isAbsolute(a))throw new w("INVALID_REQUEST","dataDir must be an absolute path.");let c=s().normalize(a).replace(/[\\/]+$/u,"");return{transport:"unix",endpoint:s().join(c,"run","mcode-auth-lease-v1.sock"),capabilityFile:s().join(c,"run",t)}}class A{constructor(){this.buffer=Buffer.alloc(0)}push(a){this.buffer=Buffer.concat([this.buffer,Buffer.from(a)]);let b=[];for(;this.buffer.length>=4;){let a=this.buffer.readUInt32BE(0);if(0===a||a>65536)throw new w("PROTOCOL_MISMATCH","Broker sent an invalid frame length.");let c=4+a;if(this.buffer.length<c)break;let d=this.buffer.subarray(4,c);this.buffer=this.buffer.subarray(c);try{b.push(JSON.parse(d.toString("utf8")))}catch{throw new w("PROTOCOL_MISMATCH","Broker sent a non-JSON frame.")}}return b}}async function B(a,b=3e5,c=1e4){var d;let e=z(a),f=function(a){let b,{capabilityFile:c}=z(a);try{b=o().readFileSync(c,"utf8").trim()}catch(a){throw new w("BROKER_UNAVAILABLE",`Cannot read capability file ${c}. Is the MiniMax Code desktop app installed and logged in on this machine? (${a?.code??a?.message})`)}if(!/^[A-Za-z0-9_-]{43}$/u.test(b))throw new w("BROKER_UNAVAILABLE","Capability file has unexpected content.");return b}(a),g=Math.max(0,Math.min(Math.floor(b),3e5)),h=function(a){if(a&&!0===a.ok)return a;throw new w(a&&!1===a.ok&&a.error&&v[a.error.code]?a.error.code:"INTERNAL_ERROR")}(await (d={version:1,requestId:`zevai-lease-${Date.now().toString(36)}`,capability:f,method:"lease",minValidityMs:g},new Promise((a,b)=>{let f=m().connect(e.endpoint),g=new A,h=!1,i=(c,d)=>{h||(h=!0,clearTimeout(j),f.destroy(),c?b(c):a(d))},j=setTimeout(()=>{i(new w("BROKER_UNAVAILABLE",`Broker did not respond within ${c}ms.`))},c);f.on("connect",()=>{f.write(function(a){let b=Buffer.from(JSON.stringify(a),"utf8");if(0===b.length||b.length>65536)throw new w("INVALID_REQUEST","Frame payload out of bounds.");let c=Buffer.alloc(4);return c.writeUInt32BE(b.length,0),Buffer.concat([c,b])}(d))}),f.on("data",a=>{try{let b=g.push(a);b.length>0&&i(void 0,b[0])}catch(a){i(a)}}),f.on("error",a=>{i(new w("BROKER_UNAVAILABLE",`Cannot reach auth broker at ${e.endpoint}: ${a.message}. Is the MiniMax Code desktop app running?`))}),f.on("close",()=>{i(new w("BROKER_UNAVAILABLE","Broker closed the connection early."))})}))).result;return{accessToken:h.accessToken,expiresAtMs:h.expiresAtMs,generation:h.generation}}let C=new Map;function D(a,b){let c=C.get(a);return c||(c=function({requestLease:a,log:b}={}){let c=a||B;return{cached:null,inflight:null,async getToken(a){let d=Date.now();return this.cached&&this.cached.expiresAtMs-d>6e4?this.cached:(this.inflight||(this.inflight=c(a,3e5).then(a=>(this.cached=a,b?.debug?.("MCODE_LEASE",`leased access token (generation ${a.generation}, expires in ${Math.max(0,Math.round((a.expiresAtMs-d)/1e3))}s)`),a)).finally(()=>{this.inflight=null})),this.inflight)},invalidate(a){this.cached&&(b?.debug?.("MCODE_LEASE",`invalidating leased token: ${a}`),this.cached=null)}}}({log:b}),C.set(a,c)),c}async function E(a,b){let c=y(a);return D(c,b).getToken(c)}let F={"minimax-code":{id:"minimax-code",baseUrl:"https://agent.minimax.cn/mavis/api/v1/llm/v1/messages",format:"claude",thinkingFormat:"claude-adaptive",headers:{"User-Agent":"MiniMaxAgent","X-Mavis-Agent-Id":"main"}},"minimax-code-global":{id:"minimax-code-global",baseUrl:"https://agent.minimax.io/mavis/api/v1/llm/v1/messages",format:"claude",thinkingFormat:"claude-adaptive",headers:{"User-Agent":"MiniMaxAgent","X-Mavis-Agent-Id":"main"}}},G=/insufficient|balance|credit|quota|exhaust|limit|余额|积分|额度|不足|用完|上限/i;async function H(a){let b=a?.status;if(!a||402!==b&&403!==b&&429!==b)return a;let c=await a.text().catch(()=>"");if(429===b||!G.test(c)){let d=new Headers(a.headers);return d.delete("content-length"),d.delete("content-encoding"),new Response(c,{status:b,statusText:a.statusText,headers:d})}let d=c.trim();try{let a=JSON.parse(c);d=a?.error?.message??a?.message??a?.msg??a?.base_resp?.status_msg??d}catch{}let e=new Headers(a.headers);return e.delete("content-length"),e.delete("content-encoding"),e.set("content-type","application/json"),new Response(JSON.stringify({type:"error",error:{type:"rate_limit_error",message:`usage limit reached: ${d}`}}),{status:429,statusText:"Too Many Requests",headers:e})}class I extends f.L{constructor(a="minimax-code"){super(a,g.xq[a]||F[a]||F["minimax-code"])}canRefreshCredentials(a){return!!x(a)||!!a?.refreshToken}buildHeaders(a,b=!0,c=null){let e=super.buildHeaders(a,b,c),f=a?.apiKey||a?.accessToken||"";return e.Authorization=`Bearer ${f}`,e["x-api-key"]="sk-xxx",e["anthropic-version"]||(e["anthropic-version"]="2023-06-01"),e["User-Agent"]=e["User-Agent"]||"MiniMaxAgent",e["X-Mavis-Agent-Id"]=e["X-Mavis-Agent-Id"]||"main",e["X-Mavis-Timezone-Offset"]=String(-60*new Date().getTimezoneOffset()),e["X-Mavis-Session-Id"]||(e["X-Mavis-Session-Id"]=(0,d.randomUUID)()),e}async execute(a){if(x(a?.credentials)){let b=await E(a.credentials,a.log);a={...a,credentials:{...a.credentials,accessToken:b.accessToken}}}let b=await super.execute(a);return b?.response?{...b,response:await H(b.response)}:b}async refreshCredentials(a,b){if(x(a))try{return D(y(a),b).invalidate("upstream 401"),{accessToken:(await E(a,b)).accessToken}}catch(a){return b?.warn?.("TOKEN",`MCODE lease refresh failed: ${a.message}`),null}return a?.refreshToken?k(this.provider,a.refreshToken,b):null}}},80668:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"bazaarlink",alias:"bzl",aliases:["bazaar-link"],category:"freeTier",authModes:["apikey"],display:{name:"Bazaarlink",icon:"storefront",color:"#DC2626",textIcon:"BZ",website:"https://bazaarlink.ai",notice:{apiKeyUrl:"https://bazaarlink.ai"}},transport:{baseUrl:"https://bazaarlink.ai/api/v1/chat/completions",validateUrl:"https://bazaarlink.ai/api/v1/models",format:"openai"},models:[{id:"auto:free",name:"Auto Free (Zero Cost)"},{id:"auto",name:"Auto (Best Model)"}],serviceKinds:["llm"]}},80742:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"poolside",alias:"poolside",aliases:["ps"],category:"freeTier",authModes:["apikey"],display:{name:"Poolside",icon:"water_drop",color:"#0EA5E9",textIcon:"PS",website:"https://poolside.ai",notice:{apiKeyUrl:"https://platform.poolside.ai/api-keys"}},transport:{baseUrl:"https://inference.poolside.ai/v1/chat/completions",validateUrl:"https://inference.poolside.ai/v1/models",format:"openai"},models:[{id:"poolside/laguna-s-2.1",name:"Laguna S 2.1"},{id:"poolside/laguna-xs-2.1",name:"Laguna XS 2.1"}],serviceKinds:["llm"]}},80830:a=>{"use strict";a.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOriginalDispatch:Symbol("original dispatch"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected"),kIgnoreTrailingSlash:Symbol("ignore trailing slash"),kMockAgentMockCallHistoryInstance:Symbol("mock agent mock call history name"),kMockAgentRegisterCallHistory:Symbol("mock agent register mock call history"),kMockAgentAddCallHistoryLog:Symbol("mock agent add call history log"),kMockAgentIsCallHistoryEnabled:Symbol("mock agent is call history enabled"),kMockAgentAcceptsNonStandardSearchParameters:Symbol("mock agent accepts non standard search parameters"),kMockCallHistoryAddLog:Symbol("mock call history add log"),kTotalDispatchCount:Symbol("total dispatch count")}},80985:(a,b,c)=>{"use strict";let d,e,f=c(34589),{pipeline:g}=c(57075),h=c(84285),{RequestContentLengthMismatchError:i,ResponseContentLengthMismatchError:j,RequestAbortedError:k,SocketError:l,InformationalError:m,InvalidArgumentError:n,HeadersTimeoutError:o,BodyTimeoutError:p,ResponseExceededMaxSizeError:q}=c(61448),{kUrl:r,kReset:s,kClient:t,kRunning:u,kPending:v,kQueue:w,kPendingIdx:x,kRunningIdx:y,kError:z,kSocket:A,kStrictContentLength:B,kOnError:C,kMaxConcurrentStreams:D,kHTTP2Session:E,kHostAuthority:F,kResume:G,kSize:H,kHTTPContext:I,kClosed:J,kKeepAliveDefaultTimeout:K,kHeadersTimeout:L,kBodyTimeout:M,kEnableConnectProtocol:N,kRemoteSettings:O,kHTTP2Stream:P,kHTTP2SessionState:Q,kHTTP2Options:R,kMaxResponseSize:S}=c(49176),{channels:T}=c(62571),U=Symbol("open streams"),V=Symbol("request stream id"),W=Symbol("request stream"),X=Symbol("request stream cleanup"),Y=Symbol("request stream state"),Z=Symbol("received goaway"),$=Symbol("goaway replay attempts"),_=Symbol("refused stream retry");try{e=c(32467)}catch{e={constants:{}}}let{constants:{HTTP2_HEADER_AUTHORITY:aa,HTTP2_HEADER_METHOD:ab,HTTP2_HEADER_PATH:ac,HTTP2_HEADER_SCHEME:ad,HTTP2_HEADER_CONTENT_LENGTH:ae,HTTP2_HEADER_EXPECT:af,HTTP2_HEADER_STATUS:ag,HTTP2_HEADER_PROTOCOL:ah,NGHTTP2_NO_ERROR:ai,NGHTTP2_REFUSED_STREAM:aj}}=e;function ak(a,b){let c=a[t],d=a[A];if(c[E]===a&&(c[A]=null,c[I]=null,c[E]=null),null!=d&&null==d[z]&&(d[z]=b),!a.closed&&!a.destroyed)try{a.destroy(b)}catch{}h.destroy(d,b)}function al(a){a[V]=null,a[W]=null,a[X]=null}function am(a,b,c){let d=a[X],e=a[W];al(a),d?.(e),a[V]=b.id,a[W]=b,a[X]=c}function an(a){let b=a[X],c=a[W];al(a),b?.(c)}function ao(a,b,c=!1){let d=a[w],e=a[y];if(e<a[x]&&d[e]===b){d[e]=null,a[y]=e+1;return}let f=d.indexOf(b,e);-1!==f&&!(f>=a[x])&&(d.splice(f,1),a[x]--,c&&a[x]<a[y]&&(a[x]=a[y]))}function ap(a){let{body:b}=a;return null==b||h.isBuffer(b)||h.isBlobLike(b)}function aq(a){var b;let c=a[W];return an(a),null!=(b=c)&&null!=b[Y]&&(b[Y]=null,b.off("close",aP),b.off("close",aO),null!=b[E]&&aN(b),b.destroyed||b.closed||b.once("error",aM)),c}function ar(a){let b=a[Q];!1===b.refed&&(b.refed=!0,a.ref())}function as(a){let b=a[Q];!0===b.refed&&(b.refed=!1,a.unref())}function at(a){let b=a[Q];b?.noStreamsTimeout!=null&&(clearTimeout(b.noStreamsTimeout),b.noStreamsTimeout=null)}function au(a){let b=a[t];if(a[Q].noStreamsTimeout=null,b[E]!==a||0!==b[D]||0!==b[u]||0===b[v])return;let c=new o(`HTTP/2: server did not accept a new stream within ${b[L]}`),d=b[w].splice(b[x]);for(let a=0;a<d.length;a++)null!=d[a]&&h.errorRequest(b,d[a],c);a[z]=c,ak(a,c)}function av(a){let b=a[Q];b?.probeTimeout!=null&&(clearTimeout(b.probeTimeout),b.probeTimeout=null)}function aw(){null!=this[Q].probeTimeout&&(av(this),this[t][G]())}function ax(a){if(a[Q].probeTimeout=null,a.closed||a.destroyed)return;let b=new l("HTTP/2: connection unresponsive",h.getSocketInfo(a[A]));a[z]=b,ak(a,b)}function ay(a){let b=a[Q];b?.idleTimeout!=null&&(clearTimeout(b.idleTimeout),b.idleTimeout=null)}function az(a){let b=a[t];if(b[E]!==a||a.closed||a.destroyed)return;if(0!==a[U]||0!==b[H])return void ay(a);let c=a[Q];null==c.idleTimeout&&(c.idleTimeout=setTimeout(aA,b[K],a).unref())}function aA(a){let b=a[t],c=a[A];if(a[Q].idleTimeout=null,b[E]!==a||0!==a[U]||0!==b[H]||a.closed||a.destroyed)return;let d=new m("socket idle timeout");c[z]=d,h.destroy(c,d)}function aB(a){try{"function"==typeof this.setLocalWindowSize&&this.setLocalWindowSize(a)}catch{}}function aC(a){let b=this[t],c=b[R].maxConcurrentStreams,d=a.maxConcurrentStreams??b[D]??c;if(b[D]=Math.min(d,c),!0===this[O]&&!0===this[N]&&!1===a.enableConnectProtocol){let a=new m("HTTP/2: Server disabled extended CONNECT protocol against RFC-8441");this[A][z]=a,this[t][C](a);return}this[N]=a.enableConnectProtocol??this[N],this[O]=!0,this[t][G]()}function aD(a){let b=a[Q];if((a.closed||a.destroyed)&&null!=b.ping.interval){clearInterval(b.ping.interval),b.ping.interval=null;return}a.ping((function(a,b){let c=this[t],d=this[A];if(null!=a){let b=new m(`HTTP/2: "PING" errored - type ${a.message}`);d[z]=b,c[C](b)}else c.emit("ping",b)}).bind(a))}function aE(a){this[A][z]=a,this[Z]||this[t][C](a)}function aF(a,b,c){if(0===c){if(this[Z])return;let c=new m(`HTTP/2: "frameError" received - type ${a}, code ${b}`);this[A][z]=c,this[t][C](c)}}function aG(a,b){if(this[Z])return;this[Z]=!0;let c=this[z]||(a===ai?new m(`HTTP/2: "GOAWAY" frame received with code ${a}`):new l(`HTTP/2: "GOAWAY" frame received with code ${a}`,h.getSocketInfo(this[A]))),d=this[t],e=d[x],f=function(a,b){let c=Number.isInteger(b)?b:Number.MAX_SAFE_INTEGER;for(let b=a[y];b<a[x];b++){let d=a[w][b];if(null!=d&&("number"!=typeof d[V]||d[V]>c))return b}return a[x]}(d,b),g=[],i=[];for(let a=f;a<e;a++){let b=d[w][a];if(null!=b){let a=function(a){let b=a[W]?.[Y];return b?.responseReceived===!0}(b);i.push(aq(b)),!a&&ap(b)&&function(a){let b=(a[$]??0)+1;return a[$]=b,b<=1}(b)?g.push(b):h.errorRequest(d,b,c)}}for(let a=0;a<i.length;a++)!function(a,b=aj){if(null!=a&&!a.destroyed&&!a.closed)try{a.close(b)}catch{}}(i[a]);if(f!==e){let a=d[w].slice(e);d[w].length=f,d[w].push(...g,...a)}d[E]===this&&(d[A]=null,d[I]=null,d[E]=null),0===this[U]&&as(this),ay(this),at(this),av(this),this.closed||this.destroyed||this.close(),d[x]=f,d.emit("disconnect",d[r],[d],c),d[G]()}function aH(){let{[t]:a,[Q]:b,[A]:c}=this,d=c[z]||this[z]||new l("closed",h.getSocketInfo(c));if(a[E]===this&&(a[A]=null,a[I]=null,a[E]=null),ay(this),at(this),av(this),null!=b.ping.interval&&(clearInterval(b.ping.interval),b.ping.interval=null),a.destroyed){f(0===a[v]);let b=a[w].splice(a[y]);for(let c=0;c<b.length;c++){let e=b[c];null!=e&&h.errorRequest(a,e,d)}}}function aI(){let a=this[z]||new l("closed",h.getSocketInfo(this)),b=this[E],c=b[t];c[A]!==this&&(b[Z]||null!=c[E]&&c[E]!==b)||(c[A]=null,c[I]=null,c[E]===b&&(c[E]=null),b.destroy(a),c[x]=c[y],f(0===c[u]),c.emit("disconnect",c[r],[c],a),c[G]())}function aJ(a){this[z]=a,this[E]?.[Z]||this[E]?.[t]?.[C](a)}function aK(){h.destroy(this,new l("other side closed",h.getSocketInfo(this)))}function aL(){this[J]=!0}function aM(){}function aN(a){let b=a[E],c=b[t];a[E]=null,b[U]-=1,0===b[U]&&(0===c[H]||b[Z])&&(as(b),az(b))}function aO(){this.off("error",aM);let a=this[Y];this[Y]=null,aS(a,new m("HTTP/2: stream closed before response headers")),aN(this)}function aP(){let a=this[Y];null!=a&&(a$(this),!a.pendingEnd||a.request.aborted||a.request.completed?a.request.aborted||a.request.completed||h.errorRequest(a.client,a.request,new m("HTTP/2: stream closed before the response was complete")):a.request.onResponseEnd(a.trailers||{}),aY(a),aN(this),this[Y]=null)}function aQ(a){a.off("response",aW),a.off("error",aT),a.off("end",aU),a.off("timeout",aV),a.off("error",aM)}function aR(a){if(null==a)return;let b=a[Y];if(null==b)return;let{request:c}=b;c[W]===a&&al(c),aQ(a),a.destroyed||a.closed||a.once("error",aM)}function aS(a,b){if(null==a)return;let{request:c}=a;a.responseReceived||c.aborted||c.completed||(aR(a.stream),a.abort(b,!0))}function aT(){let a=this[Y];"number"==typeof this.rstCode&&0!==this.rstCode?aS(a,new m(`HTTP/2: "stream error" received - code ${this.rstCode}`)):aS(a,new m("HTTP/2: stream errored before response headers"))}function aU(){aS(this[Y],new m("HTTP/2: stream half-closed (remote)"))}function aV(){let a=this[Y];aS(a,new m(`HTTP/2: "stream timeout after ${a.headersTimeout}"`))}function aW(a,b){let c=this[Y],{request:d}=c;c.responseReceived=!0;let e=a[ag];delete a[ag];try{d.onRequestUpgrade(e,a,this)}catch(a){c.abort(a);return}d.aborted||(aQ(this),al(d),aY(c))}function aX(a,b){let{request:c,headersTimeout:d,session:e}=b;a[P]=!0,a[E]=e,a[Y]=b,b.stream=a,am(c,a,aR),a.once("response",aW),a.on("error",aT),a.once("end",aU),a.on("timeout",aV),a.once("close",aO),ay(e),++e[U],a.setTimeout(d)}function aY(a,b=!1){a.requestFinalized||(a.requestFinalized=!0,ao(a.client,a.request,b),a.client[G]())}function aZ(a,b,c,d,e,f){try{return c.request(e,f)}catch(f){if(f?.code==="ERR_HTTP2_INVALID_SESSION"||f?.code==="ERR_HTTP2_GOAWAY_SESSION"){let d=new l(f.message,h.getSocketInfo(c[A]));return d.cause=f,c[z]=d,ak(c,d),a[w].splice(a[x]+1,0,b),null}let e=new m(f.message,{cause:f});return c[z]=e,c[A][z]=e,c.destroy(e),h.destroy(c[A],e),d(e),null}}function a$(a){if(null==a)return;let b=a[Y];if(null==b)return;let{request:c}=b;(c[W]===a&&al(c),!a.destroyed&&!a.closed)&&(a.off("error",aM),a.off("continue",ba),a.off("response",a3),a.off("headers",a2),a.off("end",a4),a.off("error",a5),a.off("frameError",a6),a.off("aborted",a7),a.off("timeout",a8),a.off("trailers",a9),a.off("data",a_),a.once("error",aM))}function a_(a){let b=this[Y];if(null==b)return;let{request:c,maxResponseSize:d,responseContentLength:e}=b;if(!c.aborted&&!c.completed){if(null!=e&&b.bytesRead+a.length>e)return void b.abort(new j);if(d>-1&&b.bytesRead+a.length>d)return void b.abort(new q);b.bytesRead+=a.length,!1===c.onResponseData(a)&&a0(this,b)}}function a0(a,b){a.pause(),b.bodyTimeout&&a.setTimeout(0)}function a1(){let a=this[Y];null!=a&&a.bodyTimeout&&this.isPaused()&&this.setTimeout(a.bodyTimeout),this.resume()}function a2(a){let b=this[Y];if(null==b)return;let{request:c}=b;if(c.aborted||c.completed)return;let d=a[ag];delete a[ag],c.onResponseStart(Number(d),a,aM,"")}function a3(a){let b=this[Y];if(null==b)return;let{request:c}=b;this.off("response",a3),null==b.body||b.bodySent||this.writableEnded||(this.removeListener("continue",ba),this.end());let d=Number(a[ag]);if(delete a[ag],c.onResponseStarted(),b.responseReceived=!0,"HEAD"!==c.method&&304!==d){let c=a[ae];b.responseContentLength=null==c?null:Number(c)}((b.headersTimeout||b.bodyTimeout)&&this.setTimeout(b.bodyTimeout),c.aborted||c.completed)?a$(this):(!1===c.onResponseStart(d,a,a1.bind(this),"")&&a0(this,b),this.on("data",a_))}function a4(){let a=this[Y];if(null==a)return;let{request:b}=a;if(this.off("end",a4),a.responseReceived){if(!b.aborted&&!b.completed){if(null!=a.responseContentLength&&a.bytesRead!==a.responseContentLength)return void a.abort(new j);a.pendingEnd=!0,aP.call(this)}}else a.abort(new m("HTTP/2: stream half-closed (remote)"),!0)}function a5(a){let b=this[Y];null==b||(this.off("error",a5),null!=b.responseContentLength&&b.bytesRead!==b.responseContentLength&&(a=new j),"number"==typeof this.rstCode&&this.rstCode!==ai&&(a.http2ErrorCode=this.rstCode),this.rstCode===aj&&function(a){let{client:b,request:c}=a;return!a.responseReceived&&!c.aborted&&!c.completed&&!c[_]&&!!ap(c)&&(c[_]=!0,aq(c),a.stream=null,a.requestFinalized=!0,ao(b,c),b[w].splice(b[x],0,c),b[G](),!0)}(b)||b.abort(a))}function a6(a,b){let c=this[Y];null!=c&&(this.off("frameError",a6),c.abort(new m(`HTTP/2: "frameError" received - type ${a}, code ${b}`)))}function a7(){this.off("data",a_)}function a8(){let a=this[Y];if(null==a)return;this.off("timeout",a8);let{responseReceived:b,session:c,bodyTimeout:d,headersTimeout:e}=a,f=b?new p(`HTTP/2: "stream timeout after ${d}"`):new o(`HTTP/2: "headers timeout after ${e}"`);!function(a,b){let c=a[Q];if(null==c.probeTimeout&&!a.closed&&!a.destroyed){try{a.ping(aw.bind(a))}catch{return}c.probeTimeout=setTimeout(ax,Math.max(b,1e3),a).unref()}}(c,b?d:e),a.abort(f)}function a9(a){let b=this[Y];if(null==b)return;let{request:c}=b;this.off("trailers",a9),this.off("data",a_),c.aborted||c.completed||(b.trailers=a)}function ba(){var a,b,c,d,e,i,j;let k,l=this[Y];l.bodySent=!0;let{abort:m,body:n,client:o,contentLength:p,expectsPayload:q,request:r}=l;n&&0!==p?h.isBuffer(n)?bb(m,this,n,o,r,o[A],p,q):h.isBlobLike(n)?"function"==typeof n.stream?bd(m,this,n.stream(),o,r,o[A],p,q):bc(m,this,n,o,r,o[A],p,q):h.isStream(n)?(a=m,b=o[A],c=q,d=this,e=n,i=o,j=r,f(0!==p||0===i[u],"stream body cannot be pipelined"),k=g(e,d,d=>{d?(h.destroy(k,d),a(d)):(h.removeAllListeners(k),j.onRequestSent(),c||(b[s]=!0),i[G]())}),h.addListener(k,"data",function(a){j.onBodySent(a)})):h.isIterable(n)?bd(m,this,n,o,r,o[A],p,q):f(!1):bb(m,this,null,o,r,o[A],p,q)}function bb(a,b,c,d,e,g,i,j){try{null!=c&&h.isBuffer(c)&&(f(i===c.byteLength,"buffer body must have content length"),b.cork(),b.write(c),b.uncork(),b.end(),e.onBodySent(c)),j||(g[s]=!0),e.onRequestSent(),d[G]()}catch(b){a(b)}}async function bc(a,b,c,d,e,f,g,h){try{if(null!=g&&g!==c.size)throw new i;let a=Buffer.from(await c.arrayBuffer());b.cork(),b.write(a),b.uncork(),b.end(),e.onBodySent(a),e.onRequestSent(),h||(f[s]=!0),d[G]()}catch(b){a(b)}}async function bd(a,b,c,d,e,g,h,i){f(0!==h||0===d[u],"iterator body cannot be pipelined");let j=null;function k(){if(j){let a=j;j=null,a()}}let l=()=>new Promise((a,b)=>{f(null===j),g[z]?b(g[z]):j=a});b.on("close",k).on("drain",k);try{for await(let a of c){if(g[z])throw g[z];let c=b.write(a);e.onBodySent(a),c||await l()}b.end(),e.onRequestSent(),i||(g[s]=!0),d[G]()}catch(b){a(b)}finally{b.off("close",k).off("drain",k)}}a.exports=function(a,b){a[A]=b;let g=a[R].sessionOptions?.initialWindowSize,j=a[R].connectionWindowSize,l=e.connect(a[r],{createConnection:()=>b,peerMaxConcurrentStreams:a[R].maxConcurrentStreams,settings:{enablePush:!1,...null!=g?{initialWindowSize:g}:null}});return a[A]=b,l[U]=0,l[t]=a,l[A]=b,l[Q]={idleTimeout:null,noStreamsTimeout:null,probeTimeout:null,refed:!0,ping:{interval:0===a[R].pingInterval?null:setInterval(aD,a[R].pingInterval,l).unref()}},l[Z]=!1,l[N]=!1,l[O]=!1,j&&h.addListener(l,"connect",aB.bind(l,j)),h.addListener(l,"error",aE),h.addListener(l,"frameError",aF),h.addListener(l,"goaway",aG),h.addListener(l,"close",aH),h.addListener(l,"remoteSettings",aC),as(l),a[E]=l,b[E]=l,h.addListener(b,"error",aJ),h.addListener(b,"end",aK),h.addListener(b,"close",aI),b[J]=!1,b.on("close",aL),{version:"h2",defaultPipelining:1/0,write:b=>(function(a,b){let e=b.headersTimeout??a[L],g=b.bodyTimeout??a[M],j=a[E],{method:l,path:o,host:p,upgrade:q,expectContinue:r,signal:s,protocol:t,headers:u}=b;if(null!=q&&"websocket"!==q)return h.errorRequest(a,b,new n(`Custom upgrade "${q}" not supported over HTTP/2`)),!1;let v=function(a){let b={};for(let c=0;c<a.length;c+=2){let d=a[c+0],e=a[c+1],f=Object.hasOwn(b,d)?b[d]:void 0;if("cookie"===d){null!=f?h.setHeader(b,d,Array.isArray(f)?(f.push(e),f):[f,e]):h.setHeader(b,d,e);continue}if("string"==typeof e){h.setHeader(b,d,f?`${f}, ${e}`:e);continue}for(let a=0;a<e.length;a++)h.setHeader(b,d,Object.hasOwn(b,d)?`${b[d]}, ${e[a]}`:e[a])}return b}(u);v[aa]=p||a[F],v[ab]=l;let w={abort:null,body:b.body,bytesRead:0,client:a,contentLength:null,expectsPayload:!1,maxResponseSize:a[S],request:b,headersTimeout:e,bodyTimeout:g,requestFinalized:!1,responseContentLength:null,responseReceived:!1,bodySent:!1,pendingEnd:!1,trailers:null,session:j,stream:null},x=(c,d=!1)=>{if(!b.aborted&&!b.completed){if(c=c||new k,h.errorRequest(a,b,c),null!=w.stream){an(b);let e=w.stream;e.close(),e.destroyed||h.destroy(e),a[C](c),aY(w,d)}h.destroy(w.body,c)}};w.abort=x;let y=null;try{b.onRequestStart(x,null)}catch(c){h.errorRequest(a,b,c)}if(b.aborted)return!1;if(q||"CONNECT"===l)return(ar(j),"websocket"===q)?!1===j[N]?(h.errorRequest(a,b,new m("HTTP/2: Extended CONNECT protocol not supported by server")),as(j),!1):(v[ab]="CONNECT",v[ah]="websocket",v[ac]=o,"ws:"===t||"wss:"===t?v[ad]="ws:"===t?"http":"https":v[ad]="http:"===t?"http":"https",null==(y=aZ(a,b,j,x,v,{endStream:!1,signal:s})))?(as(j),!1):(aX(y,w),!0):null==(y=aZ(a,b,j,x,v,{endStream:!1,signal:s}))?(as(j),!1):(aX(y,w),!0);v[ac]=o,v[ad]="http:"===t?"http":"https";let z="PUT"===l||"POST"===l||"PATCH"===l||"QUERY"===l||"PROPFIND"===l||"PROPPATCH"===l,D=w.body;D&&"function"==typeof D.read&&D.read(0);let G=h.bodyLength(D);if(h.isFormDataLike(D)){let[a,b]=(d??=c(35381).extractBody)(D);v["content-type"]=b,D=a.stream,G=a.length}if(null==G&&(G=b.contentLength),0!==G||z||(G=null),"GET"!==l&&"HEAD"!==l&&"OPTIONS"!==l&&"TRACE"!==l&&"CONNECT"!==l&&G>0&&null!=b.contentLength&&b.contentLength!==G){if(a[B])return h.errorRequest(a,b,new i),!1;process.emitWarning(new i)}if(null!=G&&(f(D||0===G,"no body must not have content length"),v[ae]=`${G}`),ar(j),T.sendHeaders.hasSubscribers){let a="";for(let b in v)a+=`${b}: ${v[b]}\r
1041
1041
  `;T.sendHeaders.publish({request:b,headers:a,socket:j[A]})}let H=null===D||0===G;return w.body=D,w.contentLength=G,w.expectsPayload=z,r&&(v[af]="100-continue"),null!=(y=aZ(a,b,j,x,v,{endStream:H,signal:s}))&&(y[P]=!0,y[Y]=w,w.stream=y,ay(j),++j[U],e&&y.setTimeout(e),y[E]=j,y.on("close",aP),am(b,y,a$),r&&y.once("continue",ba),y.on("response",a3),y.on("headers",a2),y.on("end",a4),y.on("error",a5),y.on("frameError",a6),y.on("aborted",a7),(e||g)&&y.on("timeout",a8),y.on("trailers",a9),r||ba.call(y),!0)})(a,b),resume(){var b,c;let d,e,f,g,h;d=(b=a)[A],e=b[E],d?.destroyed===!1&&(0===e[U]&&0===b[H]?as(e):ar(e),0===b[H]&&0===e[U]?az(e):ay(e),0===b[D]&&0===b[u]&&b[v]>0?(f=(c=e)[t],g=c[Q],(h=f[L])&&null==g.noStreamsTimeout&&(g.noStreamsTimeout=setTimeout(au,h,c).unref())):at(e))},destroy(a,c){b[J]?queueMicrotask(c):b.destroy(a).on("close",c)},get destroyed(){return b.destroyed},busy(b){if(!1===l[O]&&a[u]>0||null!=l[Q].probeTimeout||a[u]>=a[D])return!0;if(null!=b){if(!(a[u]>0))return("websocket"===b.upgrade||"CONNECT"===b.method)&&!1===l[O];else if(("websocket"===b.upgrade||"CONNECT"===b.method)&&!1===l[O])return!0}return!1}}}},80993:(a,b,c)=>{"use strict";function d(a){return"string"==typeof a?[{type:"message",role:"user",content:[{type:"input_text",text:""===a.trim()?"...":a}]}]:Array.isArray(a)?0===a.length?[{type:"message",role:"user",content:[{type:"input_text",text:"..."}]}]:a:null}c.d(b,{AP:()=>j,DP:()=>i,Fz:()=>k,N8:()=>g,We:()=>h,me:()=>d,zV:()=>e});let e=128,f=0;function g(a){return"string"==typeof a&&a?a.length>64?a.slice(0,64):a:`call_${Date.now()}_${f+=1}`}function h(a){if(null==a||""===a)return"{}";if("string"!=typeof a)try{return JSON.stringify(a)}catch{return"{}"}try{return JSON.parse(a),a}catch{return"{}"}}function i(a){if("string"==typeof a)return a;if(null==a)return"";if(Array.isArray(a))return a.map(a=>{if("string"==typeof a?.text)return a.text;try{return JSON.stringify(a)}catch{return String(a)}}).join("");try{return JSON.stringify(a)}catch{return String(a)}}function j(a){return a&&"object"==typeof a&&Array.isArray(a.input)&&(a.input=a.input.filter(a=>{if(!a||"object"!=typeof a||Array.isArray(a))return!0;if("function_call"===a.type){let b="string"==typeof a.name?a.name.trim():"";return!!b&&(a.name=b.slice(0,e),a.call_id=g(a.call_id),a.arguments=h(a.arguments),!0)}return"function_call_output"===a.type&&(a.call_id=g(a.call_id),a.output=i(a.output)),!0})),a}function k(a){var b;if(!a||"object"!=typeof a||!("input"in a))return a;let c={...a};c.messages=[],a.instructions&&c.messages.push({role:"system",content:a.instructions});let e=null,f="",g="",h=(a,b)=>{if("assistant"!==b){f="",g="";return}f&&(a.reasoning_content=f),g&&(a.encrypted_content=g),f="",g=""},i=d(a.input);if(!i)return a;let j=function(a,b){let c=[],d=a=>{if(!(!a||"object"!=typeof a||Array.isArray(a))){if("namespace"===a.type){for(let b of Array.isArray(a.tools)?a.tools:[])d(b);return}c.push(a)}};for(let b of Array.isArray(a.tools)?a.tools:[])d(b);for(let a of b)if(a?.type==="additional_tools")for(let b of Array.isArray(a.tools)?a.tools:[])d(b);return c}(a,i),k=a=>{if(Array.isArray(a.summary)){let b=a.summary.map(a=>a?.text||"").filter(Boolean).join("\n");if(b)return b}return Array.isArray(a.content)?a.content.map(a=>a?.text||"").filter(Boolean).join("\n"):""};for(let a of i){let b=a.type||(a.role?"message":null);if("message"===b){e&&(c.messages.push(e),e=null);let b=Array.isArray(a.content)?a.content.map(a=>{if("input_text"===a.type||"output_text"===a.type)return{type:"text",text:a.text};if("input_image"===a.type){if(a.image_url)return{type:"image_url",image_url:{url:a.image_url,detail:a.detail||"auto"}};if(a.file_id)return{type:"text",text:`[Image file reference: ${a.file_id}]`}}return a}):a.content,d={role:a.role,content:b};h(d,a.role),c.messages.push(d)}else if("function_call"===b||"custom_tool_call"===b){let c="custom_tool_call"===b;e||(e={role:"assistant",content:null,tool_calls:[]});let d="string"==typeof a.input?a.input:JSON.stringify(a.input??"");e.tool_calls.push({id:a.call_id,type:"function",function:{name:"string"==typeof a.name&&a.name.trim()?a.name.trim():"_unknown",arguments:c?JSON.stringify({input:d}):"string"==typeof a.arguments?a.arguments:JSON.stringify(a.arguments??{})}}),h(e,"assistant")}else if("function_call_output"===b||"custom_tool_call_output"===b)e&&(c.messages.push(e),e=null),c.messages.push({role:"tool",tool_call_id:a.call_id,content:"string"==typeof a.output?a.output:JSON.stringify(a.output)});else if("reasoning"===b){let b=k(a);b&&(f=f?`${f}
1042
- ${b}`:b),"string"==typeof a.encrypted_content&&a.encrypted_content&&(g=a.encrypted_content);continue}}if(e&&c.messages.push(e),j.length>0){let a=new Set;c.tools=j.map(b=>{var c;if(b.function)return b;let d="string"==typeof b.name?b.name.trim():"";if(!d)return null;let e="custom"===b.type;e&&a.add(d);let f=e?[b.format?.syntax,b.format?.definition].filter(Boolean).join("\n"):"";return{type:"function",function:{name:d,description:[String(b.description||""),f].filter(Boolean).join("\n\n"),parameters:e?{type:"object",properties:{input:{type:"string"}},required:["input"],additionalProperties:!1}:(c=b.parameters)?"object"!==c.type||c.properties?c:{...c,properties:{}}:{type:"object",properties:{}},strict:b.strict}}}).filter(Boolean),a.size>0&&Object.defineProperty(c,"_customToolNames",{value:a,enumerable:!1})}if(void 0!==a.max_output_tokens&&void 0===c.max_tokens&&(c.max_tokens=a.max_output_tokens),"string"==typeof a.reasoning?.effort&&void 0===c.reasoning_effort&&(c.reasoning_effort=a.reasoning.effort),a.reasoning&&"object"==typeof a.reasoning&&!Array.isArray(a.reasoning)){let b=a.reasoning.summary;Object.defineProperty(c,"_responsesReasoning",{value:{display:"string"==typeof b&&b&&"none"!==b?"summarized":void 0},enumerable:!1})}let l=function(a){if(!a||"object"!=typeof a)return null;if("json_schema"!==a.type)return{...a};let{type:b,name:c,description:d,schema:e,strict:f}=a;return{type:b,json_schema:{...void 0!==c&&{name:c},...void 0!==d&&{description:d},...void 0!==e&&{schema:e},...void 0!==f&&{strict:f}}}}(a.text?.format);return l&&(c.response_format=l),c.tool_choice=(b=a.tool_choice)&&"object"==typeof b&&!b.function?"function"===b.type&&"string"==typeof b.name&&b.name.trim()?{type:"function",function:{name:b.name.trim()}}:b:b,delete c.input,delete c.instructions,delete c.include,delete c.prompt_cache_key,delete c.store,delete c.reasoning,delete c.text,delete c.max_output_tokens,c}},81112:(a,b,c)=>{"use strict";c.d(b,{Bc:()=>t,Sk:()=>g,cC:()=>h}),c(64271);let d=Object.freeze({CHAT:1,CODE_EXECUTION:9,FUNCTIONS:10,GOOGLE_SEARCH:12,VIDEO_ROUTE:20,IMAGE_ROUTE:21,THINKING:25,LIVE_ROUTE:26,ASPECT_RATIO:47,OUTPUT_RESOLUTION:49,THINKING_BUDGET:35,SPEECH_ROUTE:37,THINKING_LEVEL:52,MUSIC_ROUTE:53,SPEECH_METADATA:85,OUTPUT_CONTINUATION:91}),e=[74,76,77,80,81,84],f=Object.freeze({0:"Free",1:"Pro",2:"Ultra",3:"Plus"});Object.freeze({1:"TIER1",2:"TIER2",3:"TIER0"});let g="gemini-3.8-flash",h=Object.freeze([{id:"gemini-3.8-flash",name:"Gemini 3.8 Flash",thinking:!0,functions:!0},{id:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview",thinking:!0,functions:!0},{id:"gemini-3.5-flash-lite",name:"Gemini 3.5 Flash Lite",thinking:!0,functions:!0}]);function i(a,b=0){let c=Number(a);return Number.isFinite(c)?c:b}function j(a){return Array.isArray(a)?a.map(a=>i(a,0/0)).filter(Number.isFinite):[]}function k(a){let b,c,e,f,g,h;if(!Array.isArray(a)||"string"!=typeof a[0])return null;let k=a[0].replace(/^models\//,"");if(!k)return null;let l=j(a[64]),m=i(a[5]),n=i(a[6]),o=Array.isArray(a[71])?a[71]:null,p={id:k,name:"string"==typeof a[3]&&a[3]?a[3]:k,inputLimit:m,outputLimit:n,methods:Array.isArray(a[7])?a[7].filter(a=>"string"==typeof a):[],capabilities:l,accessModes:j(a[82]),interaction:Array.isArray(a[78]),thinking:(b=d.THINKING,l.includes(b)),thinkingBudget:(c=d.THINKING_BUDGET,l.includes(c)),thinkingLevel:(e=d.THINKING_LEVEL,l.includes(e)),defaultThinkingLevel:o&&i(o[5])>0?i(o[5]):2,thinkingLevels:o?j(o[6]):[],functions:(f=d.FUNCTIONS,l.includes(f)),imageRoute:(g=d.IMAGE_ROUTE,l.includes(g)),continuedOutputTokens:(h=d.OUTPUT_CONTINUATION,l.includes(h))?m:0};return null!==a[8]&&void 0!==a[8]&&(p.temperature=i(a[8])),null!==a[9]&&void 0!==a[9]&&(p.topP=i(a[9])),null!==a[10]&&void 0!==a[10]&&(p.topK=i(a[10])),p}function l(a,b){let c=a?.accessModes||[];return 0===c.length||c.some(a=>3===a&&(1===b||2===b)||4===a&&2===b)}let m=Object.freeze({1:"1:1",2:"9:16",3:"16:9",4:"3:4",5:"4:3",6:"3:2",7:"2:3",8:"5:4",9:"4:5",10:"21:9",11:"9:21",12:"1:4",13:"4:1",14:"1:8",15:"8:1"}),n=Object.freeze({1:"1K",2:"2K",3:"4K",4:"512"}),o=Object.freeze({1:"720p",2:"1080p",3:"4k",4:"368p",5:"360p"}),p=Object.freeze({1:"text_to_video",2:"image_to_video",3:"reference_to_video",4:"edit",5:"extend"});function q(a,b){return j(a).map(a=>b[a]).filter(Boolean)}function r(a){let b=k(a);if(!b)return null;let c=b.capabilities,e=Array.isArray(a[78])?a[78]:null,f=!!e&&(!0===e[2]||1===e[2]),g=!!e&&2===i(e[3])&&!f,h=Array.isArray(a[70])?a[70]:null,l=h?q(h[9],o):[];!l.length&&h&&j(h[7]).includes(3)&&(l=["720p","1080p","4k"]);let r={id:b.id,name:b.name,outputLimit:b.outputLimit,accessModes:b.accessModes,...b.thinking?{thinking:!0}:{},...b.thinkingBudget?{thinkingBudget:!0}:{},...b.thinkingLevel?{thinkingLevel:!0,thinkingLevels:b.thinkingLevels,defaultThinkingLevel:b.defaultThinkingLevel}:{},..."number"==typeof b.temperature?{temperature:b.temperature}:{},..."number"==typeof b.topP?{topP:b.topP}:{},..."number"==typeof b.topK?{topK:b.topK}:{}};if(l.length&&g){let b=Array.isArray(h[10])?h[10]:null;return{...r,kind:"video",videoAspectRatios:q(h[4],m),videoResolutions:l,defaultVideoResolution:l[0],...j(h[5]).length?{videoDurations:j(h[5])}:{},...b?{videoDurationRange:{min:i(b[0]),max:i(b[1]),step:i(b[2]),default:i(b[3])}}:{},...j(h[11]).length?{videoFps:j(h[11])}:{},videoTasks:q(a[84],p)}}if(c.includes(d.SPEECH_ROUTE)&&b.methods.includes("generateContent")){let b=(Array.isArray(a[66])?a[66]:[]).map(a=>Array.isArray(a)?a.find(a=>"string"==typeof a&&a):null).filter(Boolean);return{...r,kind:"tts",...c.includes(d.SPEECH_METADATA)?{speechMetadata:!0}:{},voices:b}}return c.includes(d.MUSIC_ROUTE)&&b.methods.includes("generateContent")?{...r,kind:"music"}:b.imageRoute&&b.methods.includes("generateContent")?{...r,kind:"image",...c.includes(d.OUTPUT_RESOLUTION)?{outputResolution:!0}:{},imageAspectRatios:q(a[75],m),imageSizes:q(a[76],n)}:null}function s(a){let b={id:a.id,name:a.name,inputLimit:a.inputLimit,outputLimit:a.outputLimit};for(let c of["thinking","thinkingBudget","thinkingLevel","functions"])a[c]&&(b[c]=!0);for(let c of(a.thinkingLevel&&(b.thinkingLevels=a.thinkingLevels,b.defaultThinkingLevel=a.defaultThinkingLevel),a.continuedOutputTokens&&(b.continuedOutputTokens=a.continuedOutputTokens),["temperature","topP","topK"]))"number"==typeof a[c]&&(b[c]=a[c]);return b}function t({listModels:a,tierRaw:b,tier:c}){let g,h,j=c??((h=(g=Array.isArray(b)?b:null)?i(g[0]):0)>=0&&h<=3?h:0);return{tier:j,tierName:f[j]||"Free",updatedAt:new Date().toISOString(),models:(function(a,b=0){return(Array.isArray(a)&&Array.isArray(a[0])?a[0]:[]).map(k).filter(a=>a&&function(a){if(!a||!a.methods.includes("generateContent"))return!1;let b=a.capabilities||[];return!(!b.includes(d.CHAT)||a.interaction||a.imageRoute||[d.VIDEO_ROUTE,d.LIVE_ROUTE,d.SPEECH_ROUTE,d.MUSIC_ROUTE].some(a=>b.includes(a)))&&!e.some(a=>b.includes(a))}(a)&&l(a,b))})(a,j).map(s),media:function(a,b=0){return(Array.isArray(a)&&Array.isArray(a[0])?a[0]:[]).map(r).filter(a=>a&&l(a,b)).map(({accessModes:a,...b})=>b)}(a,j)}}},81912:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"veoaifree-web",priority:160,alias:"veo-free",category:"apikey",authType:"none",noAuth:!0,authModes:[],serviceKinds:["image","video"],videoConfig:{executorDriven:!0},display:{name:"Veo AI Free Web",icon:"movie",color:"#EA4335",textIcon:"VF",website:"https://veoaifree.com",notice:{text:"No credentials needed — veoaifree.com free tier (about 6 requests/hour per IP)"}},transport:{baseUrl:"https://veoaifree.com",format:"openai"},models:[{id:"veo",name:"VEO 3.1 (Free)",params:["seconds","size"],kind:"video"},{id:"seedance",name:"Seedance (Free)",params:["seconds","size"],kind:"video"},{id:"nano-banana",name:"Nano Banana (Free)",params:["n","size"],kind:"image"}]}},82009:(a,b,c)=>{"use strict";c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},82706:(a,b,c)=>{"use strict";c.d(b,{V6:()=>y,HU:()=>t,F2:()=>p,Bz:()=>A});var d=c(8735),e=c(65556),f=c(64334),g=c(15783);c(58455);var h=c(42946),i=c(93745),j=c(41207);let k=/claude-opus-5(?:\.5|-5)(?:-|$)/i,l=/claude-sonnet-5(?:\.5|-5)(?:-|$)/i,m=/claude-haiku-5(?:\.5|-5)(?:-|$)/i;function n(a){if(!a||"object"!=typeof a)return;let b={...a};return delete b.effort,Object.keys(b).length?b:void 0}var o=c(69231);function p(a){return Array.isArray(a)?a:"string"==typeof a?[{type:"text",text:a}]:null!==a&&"object"==typeof a?[a]:[]}let q=new Set(["tool_use","tool_result","server_tool_use","image","audio","document","container_upload"]),r=/^srvtoolu_[a-zA-Z0-9_]+$/;function s(a){return!!a&&"object"==typeof a&&("text"===a.type?!!a.text?.trim():q.has(a.type))}function t(a,b){return Array.isArray(a)&&"assistant"!==b&&a[a.length-1]?.role==="assistant"?[...a,{role:"user",content:[{type:"text",text:"Continue."}]}]:a}let u=new Set([void 0,"5m","1h"]);function v(a){return!(!a||"object"!=typeof a||Array.isArray(a))&&"thinking"!==a.type&&"redacted_thinking"!==a.type&&("text"===a.type?"string"==typeof a.text&&a.text.trim().length>0:"tool_use"===a.type||"tool_result"===a.type||"image"===a.type||"audio"===a.type)}function w(a){return a&&"object"==typeof a&&!a.defer_loading&&(!a.type||"function"===a.type)&&!!a.name}function x(a){var b;if(!a||"object"!=typeof a||Array.isArray(a))return{value:a,hadValidMarker:!1};let c=(b=a.cache_control,b?.type==="ephemeral"&&u.has(b.ttl)),{cache_control:d,...e}=a;return{value:e,hadValidMarker:c}}function y(a,{maxMarkers:b=4}={}){let c="number"==typeof b&&Number.isFinite(b)?Math.min(4,Math.max(0,Math.trunc(b))):4,d=[];Array.isArray(a.system)&&(a.system=a.system.map(a=>{let b=x(a);return d.push(b),b.value}));let e=[];Array.isArray(a.tools)&&(a.tools=a.tools.map(a=>{let b=x(a);return e.push(b),b.value}));let f=[];if(Array.isArray(a.messages)&&(a.messages=a.messages.map(a=>{let b=function(a){if(Array.isArray(a))return a;if(!a||"object"!=typeof a)return null;let{cache_control:b,...c}=a;return[c]}(a?.content);if(!b)return f.push([]),a;let c=b.map(x);return f.push(c),{...a,content:c.map(a=>a.value)}})),c<=0)return a;let g=[],h=new Set,i=(a,b={type:"ephemeral"})=>{!a||h.has(a)||g.length>=c||(h.add(a),g.push({block:a,cacheControl:b}))};if(Array.isArray(a.system)){for(let b=a.system.length-1;b>=0;b--)if(v(a.system[b])){i(a.system[b],{type:"ephemeral",ttl:"1h"});break}}if(Array.isArray(a.tools))for(let b=a.tools.length-1;b>=0;b--){let c=a.tools[b];if(w(c)){i(c,{type:"ephemeral",ttl:"1h"});break}}if(Array.isArray(a.messages)){let b=!1;for(let c=a.messages.length-1;c>=0&&!b;c--){let d=a.messages[c];if("assistant"===d.role&&Array.isArray(d.content)){for(let a=d.content.length-1;a>=0;a--)if(v(d.content[a])){i(d.content[a]),b=!0;break}}}}if(Array.isArray(a.messages)&&a.messages.length>0){let b=a.messages[a.messages.length-1];if(b?.role==="user"&&Array.isArray(b.content)&&b.content.some(a=>a?.type==="tool_result")){for(let a=b.content.length-1;a>=0;a--)if(v(b.content[a])){i(b.content[a]);break}}}for(let a=f.length-1;a>=0;a--)for(let b=f[a].length-1;b>=0;b--){let c=f[a][b];c.hadValidMarker&&v(c.value)&&i(c.value)}for(let a=e.length-1;a>=0;a--){let b=e[a],c=b.value;b.hadValidMarker&&w(c)&&i(c)}for(let a=d.length-1;a>=0;a--){let b=d[a];b.hadValidMarker&&v(b.value)&&i(b.value)}for(let{block:a,cacheControl:b}of g)a.cache_control=b;return a}let z=new Set(["minimax","minimax-cn"]);function A(a,b=null,c=null,q=null,u={},v=null){if(z.has(b)&&delete a.output_config,"claude"===b||String(b||"").startsWith("anthropic-compatible-")||delete a.context_management,a.messages&&Array.isArray(a.messages)){let c=a.messages[a.messages.length-1]?.role;a.messages=function(a){if(!Array.isArray(a)||!a.some(a=>a?.role==="system"))return a;let b=[];for(let d of a){var c;if(d?.role!=="system"){b.push(d);continue}let a=("string"==typeof(c=d.content)?c:Array.isArray(c)?c.map(a=>"string"==typeof a?a:a?.text||"").join("\n"):c&&"object"==typeof c&&c.text||"").trim();if(!a)continue;let e={type:"text",text:a},f=b[b.length-1];if(f?.role==="user"){let a=p(f.content);b[b.length-1]={...f,content:[...a,e]};continue}b.push({role:"user",content:[e]})}return b}(a.messages);let d=a.messages.length,f=[];!function(a){let b=new Set;for(let c of a){c.content=p(c?.content);let a=[],d=!1;for(let e of c.content){if(e?.type==="text"&&!String(e.text??"").trim()){d=!0;continue}if(e?.type==="server_tool_use"&&!r.test(String(e.id??""))){null!=e.id&&b.add(String(e.id)),d=!0;continue}a.push(e)}d&&(c.content=a)}if(0!==b.size)for(let c of a){if(!Array.isArray(c?.content))continue;let a=c.content.filter(a=>!((a?.type==="tool_result"||a?.type==="web_search_tool_result")&&b.has(String(a.tool_use_id??""))));a.length!==c.content.length&&(c.content=a)}}(a.messages);for(let b=0;b<d;b++){let c=a.messages[b];c.content=p(c.content),(b===d-1&&"assistant"===c.role||p(c.content).some(s))&&f.push(c)}f=t(f=function(a){if(0===a.length)return a;for(let b of a){let a=p(b.content);if(b.content=a,"assistant"===b.role&&a.some(a=>"tool_use"===a.type)){let c=[],d=!1;for(let b of a)"tool_use"===b.type?(d=!0,c.push(b)):"thinking"===b.type||"redacted_thinking"===b.type?c.push(b):d||c.push(b);b.content=c}}let b=[];for(let c of a){let a=b[b.length-1],d=p(c.content);if(a&&a.role===c.role){let b=p(a.content);a.content=[...b.filter(a=>"tool_result"===a.type),...d.filter(a=>"tool_result"===a.type),...b.filter(a=>"tool_result"!==a.type),...d.filter(a=>"tool_result"!==a.type)]}else b.push({role:c.role,content:[...d]})}return b}(f),c),a.messages=f;let h=f[f.length-1],i=h?.role==="user",j=a.thinking?.type==="enabled"&&i,k="deepseek"===b||"opencode-go"===b&&(0,g.w)(v||a?.model);for(let a=f.length-1;a>=0;a--){let c=f[a];if("assistant"===c.role&&Array.isArray(c.content)){if(k){let a=!1,b=!1,d=[];for(let e of c.content){if("thinking"===e.type){if(!String(e.thinking??"").trim())continue;b=!0,d.push(e);continue}if("redacted_thinking"===e.type){if("string"!=typeof e.data||!e.data.trim())continue;b=!0,d.push(e);continue}"tool_use"===e.type&&(a=!0),d.push(e)}c.content=d,j&&!b&&a&&c.content.unshift({type:"thinking",thinking:"."})}else if("claude"===b||b?.startsWith("anthropic-compatible")){let a="claude"===b,d=!1,f=!1,g=[];for(let b of c.content){if("redacted_thinking"===b.type){a?"string"==typeof b.data&&b.data.trim()&&(f=!0,g.push(b)):(b.signature=e.xr,f=!0,g.push(b));continue}if("thinking"===b.type){if(!String(b.thinking??"").trim())continue;if(a){if(!function(a){let b=function(a){let b="string"==typeof a?a.trim():"";if(!b)return"";let c=b.indexOf("#");return c>=0?b.slice(c+1).trim():b}(a);if(!b||b.length>0x2000000)return!1;try{if("E"===b[0]){let a=Buffer.from(b,"base64");return a.length>0&&18===a[0]}if("R"===b[0]){let a=Buffer.from(b,"base64");if(!a.length||69!==a[0])return!1;let c=Buffer.from(a.toString(),"base64");return c.length>0&&18===c[0]}return!1}catch{return!1}}(b.signature))continue;f=!0,g.push(b);continue}b.signature=e.xr,f=!0,g.push(b);continue}"tool_use"===b.type&&(d=!0),g.push(b)}c.content=g,j&&!f&&d&&c.content.unshift({type:"thinking",thinking:".",signature:e.xr})}}}}if(a.tools&&Array.isArray(a.tools)){let c=u?.preserveAnthropicToolTypes===!0||"claude"===b&&u?.preserveAnthropicToolTypes!==!1,d=Array.isArray(u?.claudeSupportedToolTypes)?u.claudeSupportedToolTypes:null;c&&d?a.tools=a.tools.filter(a=>{let b=a?.type;return!b||"function"===b||d.includes(b)}):c||(a.tools=a.tools.filter(a=>!a.type||"function"===a.type)),a.tools=a.tools.map(a=>{let b={...a};return b.input_schema&&"object"==typeof b.input_schema&&(b.input_schema=(0,j.e)(b.input_schema)),b}),0===a.tools.length&&(delete a.tools,delete a.tool_choice)}if(("claude"===b||b?.startsWith("anthropic-compatible"))&&c){let b=q?(0,i.RF)(q):null;a=(0,h.fO)(a,c,b)}return"claude"===b||b?.startsWith?.("anthropic-compatible")||(a=function(a){if(!Array.isArray(a?.messages))return a;let b=!1,c=a.messages.map(a=>{if(a?.role!=="user"||!Array.isArray(a.content))return a;let c=[],d=a.content.map(a=>{if(a?.type!=="tool_result"||!Array.isArray(a.content))return a;let b=a.content.filter(a=>a?.type==="image");if(!b.length)return a;let d=a.content.filter(a=>a?.type!=="image");return c.push({type:"text",text:`[Image from tool result ${a.tool_use_id}]`},...b),{...a,content:d.length?d:[{type:"text",text:"(image attached below)"}]}});return c.length?(b=!0,{...a,content:[...d,...c]}):a});return b?{...a,messages:c}:a}(a)),y(a),a=function(a,b){if(!b||"object"!=typeof b)return b;let c=String(a||b.model||""),d={...b,...b.thinking&&"object"==typeof b.thinking?{thinking:{...b.thinking}}:{},...b.output_config&&"object"==typeof b.output_config?{output_config:{...b.output_config}}:{},...b.tool_choice&&"object"==typeof b.tool_choice?{tool_choice:{...b.tool_choice}}:{}};if(function(a){if(!/haiku/i.test(a||""))return!1;let b=String(a).match(/haiku[-._]?(\d+)|(?<![\d.])(\d+)(?:[-._]\d+)?[-._]?haiku/i);return!b||5>Number(b[1]||b[2])}(c)){d.thinking?.type==="adaptive"&&(d.thinking={type:"enabled",budget_tokens:1e4});let a=n(d.output_config);return a?d.output_config=a:delete d.output_config,d}if(m.test(c)){let a=d.thinking;if(a?.type==="enabled"||a?.type==="adaptive"){let b,c={type:"adaptive"};"string"==typeof a.display&&a.display&&(c.display=a.display),d.thinking=c,d.output_config={...d.output_config||{},effort:d.output_config?.effort||(4096===(b=Number(a.budget_tokens))?"low":8e3===b||8192===b?"medium":16384===b?"high":32768===b?"xhigh":!Number.isFinite(b)||b<=0?"high":b<=4096?"low":b<=16384?"medium":"high")}}else if(a?.type==="disabled"){d.thinking={type:"disabled"};let a=n(d.output_config);a?d.output_config=a:delete d.output_config}return d}if(!k.test(c)&&!l.test(c))return b;if(d.tool_choice?.type==="any"||d.tool_choice?.type==="tool"){let a=d.tool_choice.disable_parallel_tool_use;d.tool_choice={type:"auto",...void 0!==a?{disable_parallel_tool_use:a}:{}}}return d.thinking?.type!=="disabled"||(k.test(c)?(delete d.thinking,d.output_config={...d.output_config||{},effort:"low"}):d.thinking={type:"between_tools"}),d}(v||a?.model,a),(0,o.s)(a,b,v||a?.model),function(a,b,c){if(!a||"object"!=typeof a||!Number.isFinite(a.max_tokens)||a.max_tokens<=0)return a;let e=(0,f.nl)(b,c||a.model),g=Number(e?.maxOutput),h=Number.isFinite(g)&&g>0?g:d.Uc;a.max_tokens>h&&(a.max_tokens=h);let i=a.thinking?.budget_tokens;return a.thinking?.type==="enabled"&&Number.isFinite(i)&&i>=a.max_tokens&&(a.max_tokens=Math.min(i+1024,h),i>=a.max_tokens&&(a.thinking.budget_tokens=Math.max(1024,a.max_tokens-1024))),a}(a,b,v||a?.model)}},83204:(a,b,c)=>{"use strict";let d=c(34589);a.exports=class{#a$;#cl=!1;#cm=!1;#cn=!1;constructor(a){if("object"!=typeof a||null===a)throw TypeError("handler must be an object");this.#a$=a}onRequestStart(...a){this.#a$.onRequestStart?.(...a)}onRequestUpgrade(...a){return d(!this.#cl),d(!this.#cm),this.#a$.onRequestUpgrade?.(...a)}onResponseStart(...a){return d(!this.#cl),d(!this.#cm),d(!this.#cn),this.#cn=!0,this.#a$.onResponseStart?.(...a)}onResponseData(...a){return d(!this.#cl),d(!this.#cm),this.#a$.onResponseData?.(...a)}onResponseEnd(...a){return d(!this.#cl),d(!this.#cm),this.#cl=!0,this.#a$.onResponseEnd?.(...a)}onResponseError(...a){return this.#cm=!0,this.#a$.onResponseError?.(...a)}onBodySent(...a){return this.#a$.onBodySent?.(...a)}onRequestSent(...a){return this.#a$.onRequestSent?.(...a)}}},83287:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"kilo-gateway",alias:"kgw",aliases:["kilo-gateway","kilogateway"],category:"freeTier",authModes:["apikey"],display:{name:"Kilo Gateway",icon:"login",color:"#8B5CF6",textIcon:"KG",website:"https://kilo.ai",notice:{apiKeyUrl:"https://kilo.ai/dashboard?tab=apiKeys"}},transport:{baseUrl:"https://api.kilo.ai/api/gateway/chat/completions",validateUrl:"https://api.kilo.ai/api/gateway/models",format:"openai"},models:[{id:"kilo-auto/free",name:"Kilo Auto Free",contextLength:256e3},{id:"nvidia/nemotron-3-super-120b-a12b:free",name:"Nemotron 3 Super 120B (Free)",contextLength:262144},{id:"nvidia/nemotron-3-ultra-550b-a55b:free",name:"Nemotron 3 Ultra 550B (Free)",contextLength:1e6},{id:"kwaipilot/kat-coder-pro-v2.5:free",name:"Kat Coder Pro v2.5 (Free)",contextLength:256e3},{id:"kilo-auto/frontier",name:"Kilo Auto Frontier",contextLength:1e6},{id:"kilo-auto/balanced",name:"Kilo Auto Balanced",contextLength:1e6}],serviceKinds:["llm"]}},83651:(a,b,c)=>{"use strict";c(8735),c(60856)},84238:(a,b,c)=>{"use strict";c.d(b,{OF:()=>f}),c(51525);var d=c(42541);function e(a){if(!a||"object"!=typeof a)return a;let b={...a};return void 0!==b.input_tokens&&(b.input_tokens+=2e3),void 0!==b.prompt_tokens&&(b.prompt_tokens+=2e3),void 0!==b.total_tokens?b.total_tokens+=2e3:void 0!==b.prompt_tokens&&void 0!==b.completion_tokens&&(b.total_tokens=b.prompt_tokens+b.completion_tokens),b}function f(a,b,c=d.h.OPENAI){var g,h;return g=function(a){if(!a||"object"!=typeof a)return 0;try{let b=JSON.stringify(a).length;return Math.ceil(b/4)}catch(a){return 0}}(a),h=b&&!(b<=0)?Math.max(1,Math.floor(b/4)):0,c===d.h.CLAUDE?e({input_tokens:g,output_tokens:h,estimated:!0}):e({prompt_tokens:g,completion_tokens:h,total_tokens:g+h,estimated:!0})}process.env.LOG_USAGE_VERBOSE},84269:(a,b,c)=>{"use strict";c.d(b,{Ay:()=>t});var d=c(69384),e=c(46956),f=c(30395),g=c(77598);let h="https://server.codeium.com/exa.language_server_pb.LanguageServerService/GetChatMessage",i="3.14.0",j={"swe-1.6-fast":"swe-1-6-fast","swe-1.6":"swe-1-6","swe-1.5-fast":"swe-1-5-fast","swe-1.5":"swe-1-5","claude-opus-4.7-max":"claude-opus-4-7-max","claude-opus-4.7-xhigh":"claude-opus-4-7-xhigh","claude-opus-4.7-high":"claude-opus-4-7-high","claude-opus-4.7-medium":"claude-opus-4-7-medium","claude-opus-4.7-low":"claude-opus-4-7-low","claude-opus-4.7-review":"opus-4-7-review","claude-sonnet-4.6-thinking-1m":"claude-sonnet-4-6-thinking-1m","claude-sonnet-4.6-1m":"claude-sonnet-4-6-1m","claude-sonnet-4.6-thinking":"claude-sonnet-4-6-thinking","claude-sonnet-4.6":"claude-sonnet-4-6","claude-opus-4.6-thinking":"claude-opus-4-6-thinking","claude-opus-4.6":"claude-opus-4-6","claude-opus-4.5-thinking":"MODEL_CLAUDE_4_5_OPUS_THINKING","claude-opus-4.5":"MODEL_CLAUDE_4_5_OPUS","claude-sonnet-4.5-thinking":"MODEL_PRIVATE_3","claude-sonnet-4.5":"MODEL_PRIVATE_2","claude-haiku-4.5":"MODEL_PRIVATE_11","gpt-5.5-xhigh-fast":"gpt-5-5-xhigh-priority","gpt-5.5-high-fast":"gpt-5-5-high-priority","gpt-5.5-medium-fast":"gpt-5-5-medium-priority","gpt-5.5-low-fast":"gpt-5-5-low-priority","gpt-5.5-none-fast":"gpt-5-5-none-priority","gpt-5.5-xhigh":"gpt-5-5-xhigh","gpt-5.5-high":"gpt-5-5-high","gpt-5.5-medium":"gpt-5-5-medium","gpt-5.5-low":"gpt-5-5-low","gpt-5.5-none":"gpt-5-5-none","gpt-5.5-review":"gpt-5-5-review","gpt-5.5":"gpt-5-5-medium","gpt-5.4-xhigh-fast":"gpt-5-4-xhigh-priority","gpt-5.4-high-fast":"gpt-5-4-high-priority","gpt-5.4-medium-fast":"gpt-5-4-medium-priority","gpt-5.4-low-fast":"gpt-5-4-low-priority","gpt-5.4-none-fast":"gpt-5-4-none-priority","gpt-5.4-xhigh":"gpt-5-4-xhigh","gpt-5.4-high":"gpt-5-4-high","gpt-5.4-medium":"gpt-5-4-medium","gpt-5.4-low":"gpt-5-4-low","gpt-5.4-none":"gpt-5-4-none","gpt-5.4-mini-xhigh":"gpt-5-4-mini-xhigh","gpt-5.4-mini-high":"gpt-5-4-mini-high","gpt-5.4-mini-medium":"gpt-5-4-mini-medium","gpt-5.4-mini-low":"gpt-5-4-mini-low","gpt-5.4":"gpt-5-4-medium","gpt-5.3-codex-xhigh-fast":"gpt-5-3-codex-xhigh-priority","gpt-5.3-codex-high-fast":"gpt-5-3-codex-high-priority","gpt-5.3-codex-medium-fast":"gpt-5-3-codex-medium-priority","gpt-5.3-codex-low-fast":"gpt-5-3-codex-low-priority","gpt-5.3-codex-xhigh":"gpt-5-3-codex-xhigh","gpt-5.3-codex-high":"gpt-5-3-codex-high","gpt-5.3-codex-medium":"gpt-5-3-codex-medium","gpt-5.3-codex-low":"gpt-5-3-codex-low","gpt-5.3-codex":"gpt-5-3-codex-medium","gpt-5.2-xhigh":"MODEL_GPT_5_2_XHIGH","gpt-5.2-high":"MODEL_GPT_5_2_HIGH","gpt-5.2-medium":"MODEL_GPT_5_2_MEDIUM","gpt-5.2-low":"MODEL_GPT_5_2_LOW","gpt-5.2-none":"MODEL_GPT_5_2_NONE","gpt-5.2":"MODEL_GPT_5_2_MEDIUM","gpt-5":"gpt-5","gpt-4.1":"MODEL_CHAT_GPT_4_1_2025_04_14","gpt-4.1-mini":"gpt-4.1-mini","gpt-4o":"MODEL_CHAT_GPT_4O_2024_08_06","gemini-3.1-pro-high":"gemini-3-1-pro-high","gemini-3.1-pro-low":"gemini-3-1-pro-low","gemini-3.1-pro":"gemini-3-1-pro-high","gemini-3.0-flash-high":"MODEL_GOOGLE_GEMINI_3_0_FLASH_HIGH","gemini-3.0-flash-medium":"MODEL_GOOGLE_GEMINI_3_0_FLASH_MEDIUM","gemini-3.0-flash-low":"MODEL_GOOGLE_GEMINI_3_0_FLASH_LOW","gemini-3.0-flash-minimal":"MODEL_GOOGLE_GEMINI_3_0_FLASH_MINIMAL","gemini-3.0-flash":"MODEL_GOOGLE_GEMINI_3_0_FLASH_HIGH","gemini-2.5-pro":"MODEL_GOOGLE_GEMINI_2_5_PRO","deepseek-v4":"deepseek-v4","kimi-k2.6":"kimi-k2-6","kimi-k2.5":"kimi-k2-5","glm-5.1":"glm-5-1"};function k(a){let b=[],c=a>>>0;for(;c>127;)b.push(127&c|128),c>>>=7;return b.push(127&c),new Uint8Array(b)}function l(a){let b=new Uint8Array(a.reduce((a,b)=>a+b.length,0)),c=0;for(let d of a)b.set(d,c),c+=d.length;return b}let m=new TextEncoder,n=new TextDecoder;function o(a,b){return l([k(a<<3|2),k(b.length),b])}function p(a,b){return o(a,m.encode(b))}function q(a,b){let c=0,d=0;for(;b<a.length;){let e=a[b++];if(c|=(127&e)<<d,(128&e)==0)break;d+=7}return[c>>>0,b]}function r(a,b){let c=0;for(;c<a.length;){let d;[d,c]=q(a,c);let e=d>>>3,f=7&d;if(2===f){let d;[d,c]=q(a,c);let f=a.slice(c,c+d);if(c+=d,e===b)return n.decode(f)}else if(0===f){let b;[b,c]=q(a,c)}else if(1===f)c+=8;else if(5===f)c+=4;else break}return null}class s extends d.Hv{constructor(){super("windsurf",f.xq.windsurf||{id:"windsurf",baseUrl:h})}buildUrl(){return h}buildHeaders(a,b=!0){let c=a?.accessToken||a?.apiKey||"";return{"Content-Type":"application/grpc-web+proto",Accept:"application/grpc-web+proto",...c?{Authorization:`Bearer ${c}`}:{},"User-Agent":`windsurf/${i}`,"X-Grpc-Web":"1"}}transformRequest(){return null}async execute({model:a,body:b,stream:c,credentials:d,signal:f,log:h,upstreamExtraHeaders:k,proxyOptions:m=null}){let n,q=d?.accessToken||d?.apiKey||"",r=j[a]??a,s=b??{},t=function(a){let b=[];for(let c of a){let a=String(c.role||"user"),d="";if("string"==typeof c.content)d=c.content;else if(Array.isArray(c.content))for(let a of c.content)a&&"object"==typeof a&&"text"===a.type&&(d+=String(a.text||""));b.push({role:a,content:d,toolCallId:c.tool_call_id})}return b}(Array.isArray(s.messages)?s.messages:[]);0===t.length&&t.push({role:"user",content:""});let u=function(a,b,c){let d=(0,g.randomUUID)(),e=(0,g.randomUUID)(),f=[o(1,l([p(1,a),p(2,"windsurf"),p(3,i),p(4,"3.14.0"),p(5,d),p(6,"en-US")])),p(2,e),o(3,p(1,b))];for(let a of c)f.push(o(4,function(a){let b=[p(1,a.role),p(2,a.content)];return a.toolCallId&&b.push(p(3,a.toolCallId)),l(b)}(a)));return l(f)}(q,r,t),v=((n=new Uint8Array(5+u.length))[0]=0,new DataView(n.buffer).setUint32(1,u.length,!1),n.set(u,5),n),w=this.buildUrl(),x=this.buildHeaders(d);k&&Object.assign(x,k),h?.debug?.("WS",`Windsurf → ${r} (${t.length} messages)`);let y=await (0,e.Fm)(w,{method:"POST",headers:x,body:v,signal:f},m);return y.ok||200===y.status?{response:this.transformToSSE(y,a),url:w,headers:x,transformedBody:u}:{response:y,url:w,headers:x,transformedBody:u}}transformToSSE(a,b){let c=`chatcmpl-ws-${Date.now()}`,d=Math.floor(Date.now()/1e3),e=this;return new Response(new ReadableStream({async start(f){let g=new TextEncoder,h=!1,i="",j=0,k=0,m=null,o=a=>f.enqueue(g.encode(a));try{let g=new Uint8Array(0),p=a.body?.getReader(),s=(a,f)=>{if(128===a){let a=n.decode(f),b=/grpc-status:\s*(\d+)/i.exec(a);if(b&&"0"!==b[1]){let c=/grpc-message:\s*(.+)/i.exec(a);m=c?decodeURIComponent(c[1].trim()):`gRPC status ${b[1]}`}return}if(0!==a)return;let g=e.constructor.decodeCompletionChunk?e.constructor.decodeCompletionChunk(f):function(a){let b=0;for(;b<a.length;){let c;[c,b]=q(a,b);let d=c>>>3,e=7&c;if(2===e){let c;[c,b]=q(a,b);let e=a.slice(b,b+c);if(b+=c,1===d){let a=r(e,1);if(null!==a)return{kind:"content",text:a}}else if(3===d){let a=function(a){let b=0,c=null;for(;b<a.length;){let d;[d,b]=q(a,b);let e=d>>>3,f=7&d;if(2===f){let d;[d,b]=q(a,b),1===e&&(c=a.slice(b,b+d)),b+=d}else if(0===f){let c;[c,b]=q(a,b)}else break}if(!c)return[0,0];let d=0,e=0;for(b=0;b<c.length;){let a;[a,b]=q(c,b);let f=a>>>3,g=7&a;if(0===g){let a;[a,b]=q(c,b),1===f?d=a:2===f&&(e=a)}else if(2===g){let a;[a,b]=q(c,b),b+=a}else break}return[d,e]}(e);return{kind:"done",promptTokens:a[0],completionTokens:a[1]}}else if(4===d)return{kind:"error",message:r(e,1)??"unknown windsurf error"}}else if(0===e){let c;[c,b]=q(a,b)}else if(1===e)b+=8;else if(5===e)b+=4;else break}return{kind:"unknown"}}(f);"content"===g.kind&&g.text?(i+=g.text,h||(o(`data: ${JSON.stringify({id:c,object:"chat.completion.chunk",created:d,model:b,choices:[{index:0,delta:{role:"assistant",content:""},finish_reason:null}]})}
1042
+ ${b}`:b),"string"==typeof a.encrypted_content&&a.encrypted_content&&(g=a.encrypted_content);continue}}if(e&&c.messages.push(e),j.length>0){let a=new Set;c.tools=j.map(b=>{var c;if(b.function)return b;let d="string"==typeof b.name?b.name.trim():"";if(!d)return null;let e="custom"===b.type;e&&a.add(d);let f=e?[b.format?.syntax,b.format?.definition].filter(Boolean).join("\n"):"";return{type:"function",function:{name:d,description:[String(b.description||""),f].filter(Boolean).join("\n\n"),parameters:e?{type:"object",properties:{input:{type:"string"}},required:["input"],additionalProperties:!1}:(c=b.parameters)?"object"!==c.type||c.properties?c:{...c,properties:{}}:{type:"object",properties:{}},strict:b.strict}}}).filter(Boolean),a.size>0&&Object.defineProperty(c,"_customToolNames",{value:a,enumerable:!1})}if(void 0!==a.max_output_tokens&&void 0===c.max_tokens&&(c.max_tokens=a.max_output_tokens),"string"==typeof a.reasoning?.effort&&void 0===c.reasoning_effort&&(c.reasoning_effort=a.reasoning.effort),a.reasoning&&"object"==typeof a.reasoning&&!Array.isArray(a.reasoning)){let b=a.reasoning.summary;Object.defineProperty(c,"_responsesReasoning",{value:{display:"string"==typeof b&&b&&"none"!==b?"summarized":void 0},enumerable:!1})}let l=function(a){if(!a||"object"!=typeof a)return null;if("json_schema"!==a.type)return{...a};let{type:b,name:c,description:d,schema:e,strict:f}=a;return{type:b,json_schema:{...void 0!==c&&{name:c},...void 0!==d&&{description:d},...void 0!==e&&{schema:e},...void 0!==f&&{strict:f}}}}(a.text?.format);return l&&(c.response_format=l),c.tool_choice=(b=a.tool_choice)&&"object"==typeof b&&!b.function?"function"===b.type&&"string"==typeof b.name&&b.name.trim()?{type:"function",function:{name:b.name.trim()}}:b:b,delete c.input,delete c.instructions,delete c.include,delete c.prompt_cache_key,delete c.store,delete c.reasoning,delete c.text,delete c.max_output_tokens,c}},81112:(a,b,c)=>{"use strict";c.d(b,{Bc:()=>t,Sk:()=>g,cC:()=>h}),c(64271);let d=Object.freeze({CHAT:1,CODE_EXECUTION:9,FUNCTIONS:10,GOOGLE_SEARCH:12,VIDEO_ROUTE:20,IMAGE_ROUTE:21,THINKING:25,LIVE_ROUTE:26,ASPECT_RATIO:47,OUTPUT_RESOLUTION:49,THINKING_BUDGET:35,SPEECH_ROUTE:37,THINKING_LEVEL:52,MUSIC_ROUTE:53,SPEECH_METADATA:85,OUTPUT_CONTINUATION:91}),e=[74,76,77,80,81,84],f=Object.freeze({0:"Free",1:"Pro",2:"Ultra",3:"Plus"});Object.freeze({1:"TIER1",2:"TIER2",3:"TIER0"});let g="gemini-3.8-flash",h=Object.freeze([{id:"gemini-3.8-flash",name:"Gemini 3.8 Flash",thinking:!0,functions:!0},{id:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview",thinking:!0,functions:!0},{id:"gemini-3.5-flash-lite",name:"Gemini 3.5 Flash Lite",thinking:!0,functions:!0}]);function i(a,b=0){let c=Number(a);return Number.isFinite(c)?c:b}function j(a){return Array.isArray(a)?a.map(a=>i(a,0/0)).filter(Number.isFinite):[]}function k(a){let b,c,e,f,g,h;if(!Array.isArray(a)||"string"!=typeof a[0])return null;let k=a[0].replace(/^models\//,"");if(!k)return null;let l=j(a[64]),m=i(a[5]),n=i(a[6]),o=Array.isArray(a[71])?a[71]:null,p={id:k,name:"string"==typeof a[3]&&a[3]?a[3]:k,inputLimit:m,outputLimit:n,methods:Array.isArray(a[7])?a[7].filter(a=>"string"==typeof a):[],capabilities:l,accessModes:j(a[82]),interaction:Array.isArray(a[78]),thinking:(b=d.THINKING,l.includes(b)),thinkingBudget:(c=d.THINKING_BUDGET,l.includes(c)),thinkingLevel:(e=d.THINKING_LEVEL,l.includes(e)),defaultThinkingLevel:o&&i(o[5])>0?i(o[5]):2,thinkingLevels:o?j(o[6]):[],functions:(f=d.FUNCTIONS,l.includes(f)),imageRoute:(g=d.IMAGE_ROUTE,l.includes(g)),continuedOutputTokens:(h=d.OUTPUT_CONTINUATION,l.includes(h))?m:0};return null!==a[8]&&void 0!==a[8]&&(p.temperature=i(a[8])),null!==a[9]&&void 0!==a[9]&&(p.topP=i(a[9])),null!==a[10]&&void 0!==a[10]&&(p.topK=i(a[10])),p}function l(a,b){let c=a?.accessModes||[];return 0===c.length||c.some(a=>3===a&&(1===b||2===b)||4===a&&2===b)}let m=Object.freeze({1:"1:1",2:"9:16",3:"16:9",4:"3:4",5:"4:3",6:"3:2",7:"2:3",8:"5:4",9:"4:5",10:"21:9",11:"9:21",12:"1:4",13:"4:1",14:"1:8",15:"8:1"}),n=Object.freeze({1:"1K",2:"2K",3:"4K",4:"512"}),o=Object.freeze({1:"720p",2:"1080p",3:"4k",4:"368p",5:"360p"}),p=Object.freeze({1:"text_to_video",2:"image_to_video",3:"reference_to_video",4:"edit",5:"extend"});function q(a,b){return j(a).map(a=>b[a]).filter(Boolean)}function r(a){let b=k(a);if(!b)return null;let c=b.capabilities,e=Array.isArray(a[78])?a[78]:null,f=!!e&&(!0===e[2]||1===e[2]),g=!!e&&2===i(e[3])&&!f,h=Array.isArray(a[70])?a[70]:null,l=h?q(h[9],o):[];!l.length&&h&&j(h[7]).includes(3)&&(l=["720p","1080p","4k"]);let r={id:b.id,name:b.name,outputLimit:b.outputLimit,accessModes:b.accessModes,...b.thinking?{thinking:!0}:{},...b.thinkingBudget?{thinkingBudget:!0}:{},...b.thinkingLevel?{thinkingLevel:!0,thinkingLevels:b.thinkingLevels,defaultThinkingLevel:b.defaultThinkingLevel}:{},..."number"==typeof b.temperature?{temperature:b.temperature}:{},..."number"==typeof b.topP?{topP:b.topP}:{},..."number"==typeof b.topK?{topK:b.topK}:{}};if(l.length&&g){let b=Array.isArray(h[10])?h[10]:null;return{...r,kind:"video",videoAspectRatios:q(h[4],m),videoResolutions:l,defaultVideoResolution:l[0],...j(h[5]).length?{videoDurations:j(h[5])}:{},...b?{videoDurationRange:{min:i(b[0]),max:i(b[1]),step:i(b[2]),default:i(b[3])}}:{},...j(h[11]).length?{videoFps:j(h[11])}:{},videoTasks:q(a[84],p)}}if(c.includes(d.SPEECH_ROUTE)&&b.methods.includes("generateContent")){let b=(Array.isArray(a[66])?a[66]:[]).map(a=>Array.isArray(a)?a.find(a=>"string"==typeof a&&a):null).filter(Boolean);return{...r,kind:"tts",...c.includes(d.SPEECH_METADATA)?{speechMetadata:!0}:{},voices:b}}return c.includes(d.MUSIC_ROUTE)&&b.methods.includes("generateContent")?{...r,kind:"music"}:b.imageRoute&&b.methods.includes("generateContent")?{...r,kind:"image",...c.includes(d.OUTPUT_RESOLUTION)?{outputResolution:!0}:{},imageAspectRatios:q(a[75],m),imageSizes:q(a[76],n)}:null}function s(a){let b={id:a.id,name:a.name,inputLimit:a.inputLimit,outputLimit:a.outputLimit};for(let c of["thinking","thinkingBudget","thinkingLevel","functions"])a[c]&&(b[c]=!0);for(let c of(a.thinkingLevel&&(b.thinkingLevels=a.thinkingLevels,b.defaultThinkingLevel=a.defaultThinkingLevel),a.continuedOutputTokens&&(b.continuedOutputTokens=a.continuedOutputTokens),["temperature","topP","topK"]))"number"==typeof a[c]&&(b[c]=a[c]);return b}function t({listModels:a,tierRaw:b,tier:c}){let g,h,j=c??((h=(g=Array.isArray(b)?b:null)?i(g[0]):0)>=0&&h<=3?h:0);return{tier:j,tierName:f[j]||"Free",updatedAt:new Date().toISOString(),models:(function(a,b=0){return(Array.isArray(a)&&Array.isArray(a[0])?a[0]:[]).map(k).filter(a=>a&&function(a){if(!a||!a.methods.includes("generateContent"))return!1;let b=a.capabilities||[];return!(!b.includes(d.CHAT)||a.interaction||a.imageRoute||[d.VIDEO_ROUTE,d.LIVE_ROUTE,d.SPEECH_ROUTE,d.MUSIC_ROUTE].some(a=>b.includes(a)))&&!e.some(a=>b.includes(a))}(a)&&l(a,b))})(a,j).map(s),media:function(a,b=0){return(Array.isArray(a)&&Array.isArray(a[0])?a[0]:[]).map(r).filter(a=>a&&l(a,b)).map(({accessModes:a,...b})=>b)}(a,j)}}},81912:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"veoaifree-web",priority:160,alias:"veo-free",category:"apikey",authType:"none",noAuth:!0,authModes:[],serviceKinds:["image","video"],videoConfig:{executorDriven:!0},display:{name:"Veo AI Free Web",icon:"movie",color:"#EA4335",textIcon:"VF",website:"https://veoaifree.com",notice:{text:"No credentials needed — veoaifree.com free tier (about 6 requests/hour per IP)"}},transport:{baseUrl:"https://veoaifree.com",format:"openai"},models:[{id:"veo",name:"VEO 3.1 (Free)",params:["seconds","size"],kind:"video"},{id:"seedance",name:"Seedance (Free)",params:["seconds","size"],kind:"video"},{id:"nano-banana",name:"Nano Banana (Free)",params:["n","size"],kind:"image"}]}},82009:(a,b,c)=>{"use strict";c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},82706:(a,b,c)=>{"use strict";c.d(b,{V6:()=>y,HU:()=>t,F2:()=>p,Bz:()=>A});var d=c(8735),e=c(65556),f=c(64334),g=c(15783);c(58455);var h=c(42946),i=c(93745),j=c(41207);let k=/claude-opus-5(?:\.5|-5)(?:-|$)/i,l=/claude-sonnet-5(?:\.5|-5)(?:-|$)/i,m=/claude-haiku-5(?:\.5|-5)(?:-|$)/i;function n(a){if(!a||"object"!=typeof a)return;let b={...a};return delete b.effort,Object.keys(b).length?b:void 0}var o=c(69231);function p(a){return Array.isArray(a)?a:"string"==typeof a?[{type:"text",text:a}]:null!==a&&"object"==typeof a?[a]:[]}let q=new Set(["tool_use","tool_result","server_tool_use","image","audio","document","container_upload"]),r=/^srvtoolu_[a-zA-Z0-9_]+$/;function s(a){return!!a&&"object"==typeof a&&("text"===a.type?!!a.text?.trim():q.has(a.type))}function t(a,b){return Array.isArray(a)&&"assistant"!==b&&a[a.length-1]?.role==="assistant"?[...a,{role:"user",content:[{type:"text",text:"Continue."}]}]:a}let u=new Set([void 0,"5m","1h"]);function v(a){return!(!a||"object"!=typeof a||Array.isArray(a))&&"thinking"!==a.type&&"redacted_thinking"!==a.type&&("text"===a.type?"string"==typeof a.text&&a.text.trim().length>0:"tool_use"===a.type||"tool_result"===a.type||"image"===a.type||"audio"===a.type)}function w(a){return a&&"object"==typeof a&&!a.defer_loading&&(!a.type||"function"===a.type)&&!!a.name}function x(a){var b;if(!a||"object"!=typeof a||Array.isArray(a))return{value:a,hadValidMarker:!1};let c=(b=a.cache_control,b?.type==="ephemeral"&&u.has(b.ttl)),{cache_control:d,...e}=a;return{value:e,hadValidMarker:c}}function y(a,{maxMarkers:b=4}={}){let c="number"==typeof b&&Number.isFinite(b)?Math.min(4,Math.max(0,Math.trunc(b))):4,d=[];Array.isArray(a.system)&&(a.system=a.system.map(a=>{let b=x(a);return d.push(b),b.value}));let e=[];Array.isArray(a.tools)&&(a.tools=a.tools.map(a=>{let b=x(a);return e.push(b),b.value}));let f=[];if(Array.isArray(a.messages)&&(a.messages=a.messages.map(a=>{let b=function(a){if(Array.isArray(a))return a;if(!a||"object"!=typeof a)return null;let{cache_control:b,...c}=a;return[c]}(a?.content);if(!b)return f.push([]),a;let c=b.map(x);return f.push(c),{...a,content:c.map(a=>a.value)}})),c<=0)return a;let g=[],h=new Set,i=(a,b={type:"ephemeral"})=>{!a||h.has(a)||g.length>=c||(h.add(a),g.push({block:a,cacheControl:b}))};if(Array.isArray(a.system)){for(let b=a.system.length-1;b>=0;b--)if(v(a.system[b])){i(a.system[b],{type:"ephemeral",ttl:"1h"});break}}if(Array.isArray(a.tools))for(let b=a.tools.length-1;b>=0;b--){let c=a.tools[b];if(w(c)){i(c,{type:"ephemeral",ttl:"1h"});break}}if(Array.isArray(a.messages)){let b=!1;for(let c=a.messages.length-1;c>=0&&!b;c--){let d=a.messages[c];if("assistant"===d.role&&Array.isArray(d.content)){for(let a=d.content.length-1;a>=0;a--)if(v(d.content[a])){i(d.content[a]),b=!0;break}}}}if(Array.isArray(a.messages)&&a.messages.length>0){let b=a.messages[a.messages.length-1];if(b?.role==="user"&&Array.isArray(b.content)&&b.content.some(a=>a?.type==="tool_result")){for(let a=b.content.length-1;a>=0;a--)if(v(b.content[a])){i(b.content[a]);break}}}for(let a=f.length-1;a>=0;a--)for(let b=f[a].length-1;b>=0;b--){let c=f[a][b];c.hadValidMarker&&v(c.value)&&i(c.value)}for(let a=e.length-1;a>=0;a--){let b=e[a],c=b.value;b.hadValidMarker&&w(c)&&i(c)}for(let a=d.length-1;a>=0;a--){let b=d[a];b.hadValidMarker&&v(b.value)&&i(b.value)}for(let{block:a,cacheControl:b}of g)a.cache_control=b;return a}let z=new Set(["minimax","minimax-cn"]);function A(a,b=null,c=null,q=null,u={},v=null){if(z.has(b)&&delete a.output_config,"claude"===b||String(b||"").startsWith("anthropic-compatible-")||delete a.context_management,a.messages&&Array.isArray(a.messages)){let c=a.messages[a.messages.length-1]?.role;a.messages=function(a){if(!Array.isArray(a)||!a.some(a=>a?.role==="system"))return a;let b=[];for(let d of a){var c;if(d?.role!=="system"){b.push(d);continue}let a=("string"==typeof(c=d.content)?c:Array.isArray(c)?c.map(a=>"string"==typeof a?a:a?.text||"").join("\n"):c&&"object"==typeof c&&c.text||"").trim();if(!a)continue;let e={type:"text",text:a},f=b[b.length-1];if(f?.role==="user"){let a=p(f.content);b[b.length-1]={...f,content:[...a,e]};continue}b.push({role:"user",content:[e]})}return b}(a.messages);let d=a.messages.length,f=[];!function(a){let b=new Set;for(let c of a){c.content=p(c?.content);let a=[],d=!1;for(let e of c.content){if(e?.type==="text"&&!String(e.text??"").trim()){d=!0;continue}if(e?.type==="server_tool_use"&&!r.test(String(e.id??""))){null!=e.id&&b.add(String(e.id)),d=!0;continue}a.push(e)}d&&(c.content=a)}if(0!==b.size)for(let c of a){if(!Array.isArray(c?.content))continue;let a=c.content.filter(a=>!((a?.type==="tool_result"||a?.type==="web_search_tool_result")&&b.has(String(a.tool_use_id??""))));a.length!==c.content.length&&(c.content=a)}}(a.messages);for(let b=0;b<d;b++){let c=a.messages[b];c.content=p(c.content),(b===d-1&&"assistant"===c.role||p(c.content).some(s))&&f.push(c)}f=t(f=function(a){if(0===a.length)return a;for(let b of a){let a=p(b.content);if(b.content=a,"assistant"===b.role&&a.some(a=>"tool_use"===a.type)){let c=[],d=!1;for(let b of a)"tool_use"===b.type?(d=!0,c.push(b)):"thinking"===b.type||"redacted_thinking"===b.type?c.push(b):d||c.push(b);b.content=c}}let b=[];for(let c of a){let a=b[b.length-1],d=p(c.content);if(a&&a.role===c.role){let b=p(a.content);a.content=[...b.filter(a=>"tool_result"===a.type),...d.filter(a=>"tool_result"===a.type),...b.filter(a=>"tool_result"!==a.type),...d.filter(a=>"tool_result"!==a.type)]}else b.push({role:c.role,content:[...d]})}return b}(f),c),a.messages=f;let h=f[f.length-1],i=h?.role==="user",j=a.thinking?.type==="enabled"&&i,k="deepseek"===b||"opencode-go"===b&&(0,g.w)(v||a?.model);for(let a=f.length-1;a>=0;a--){let c=f[a];if("assistant"===c.role&&Array.isArray(c.content)){if(k){let a=!1,b=!1,d=[];for(let e of c.content){if("thinking"===e.type){if(!String(e.thinking??"").trim())continue;b=!0,d.push(e);continue}if("redacted_thinking"===e.type){if("string"!=typeof e.data||!e.data.trim())continue;b=!0,d.push(e);continue}"tool_use"===e.type&&(a=!0),d.push(e)}c.content=d,j&&!b&&a&&c.content.unshift({type:"thinking",thinking:"."})}else if("claude"===b||b?.startsWith("anthropic-compatible")){let a="claude"===b,d=!1,f=!1,g=[];for(let b of c.content){if("redacted_thinking"===b.type){a?"string"==typeof b.data&&b.data.trim()&&(f=!0,g.push(b)):(b.signature=e.xr,f=!0,g.push(b));continue}if("thinking"===b.type){if(!String(b.thinking??"").trim())continue;if(a){if(!function(a){let b=function(a){let b="string"==typeof a?a.trim():"";if(!b)return"";let c=b.indexOf("#");return c>=0?b.slice(c+1).trim():b}(a);if(!b||b.length>0x2000000)return!1;try{if("E"===b[0]){let a=Buffer.from(b,"base64");return a.length>0&&18===a[0]}if("R"===b[0]){let a=Buffer.from(b,"base64");if(!a.length||69!==a[0])return!1;let c=Buffer.from(a.toString(),"base64");return c.length>0&&18===c[0]}return!1}catch{return!1}}(b.signature))continue;f=!0,g.push(b);continue}b.signature=e.xr,f=!0,g.push(b);continue}"tool_use"===b.type&&(d=!0),g.push(b)}c.content=g,j&&!f&&d&&c.content.unshift({type:"thinking",thinking:".",signature:e.xr})}}}}if(a.tools&&Array.isArray(a.tools)){let c=u?.preserveAnthropicToolTypes===!0||"claude"===b&&u?.preserveAnthropicToolTypes!==!1,d=Array.isArray(u?.claudeSupportedToolTypes)?u.claudeSupportedToolTypes:null;c&&d?a.tools=a.tools.filter(a=>{let b=a?.type;return!b||"function"===b||d.includes(b)}):c||(a.tools=a.tools.filter(a=>!a.type||"function"===a.type)),a.tools=a.tools.map(a=>{let b={...a};return b.input_schema&&"object"==typeof b.input_schema&&(b.input_schema=(0,j.e)(b.input_schema)),b}),0===a.tools.length&&(delete a.tools,delete a.tool_choice)}if(("claude"===b||b?.startsWith("anthropic-compatible"))&&c){let b=q?(0,i.RF)(q):null;a=(0,h.fO)(a,c,b)}return"claude"===b||b?.startsWith?.("anthropic-compatible")||(a=function(a){if(!Array.isArray(a?.messages))return a;let b=!1,c=a.messages.map(a=>{if(a?.role!=="user"||!Array.isArray(a.content))return a;let c=[],d=a.content.map(a=>{if(a?.type!=="tool_result"||!Array.isArray(a.content))return a;let b=a.content.filter(a=>a?.type==="image");if(!b.length)return a;let d=a.content.filter(a=>a?.type!=="image");return c.push({type:"text",text:`[Image from tool result ${a.tool_use_id}]`},...b),{...a,content:d.length?d:[{type:"text",text:"(image attached below)"}]}});return c.length?(b=!0,{...a,content:[...d,...c]}):a});return b?{...a,messages:c}:a}(a)),y(a),a=function(a,b){if(!b||"object"!=typeof b)return b;let c=String(a||b.model||""),d={...b,...b.thinking&&"object"==typeof b.thinking?{thinking:{...b.thinking}}:{},...b.output_config&&"object"==typeof b.output_config?{output_config:{...b.output_config}}:{},...b.tool_choice&&"object"==typeof b.tool_choice?{tool_choice:{...b.tool_choice}}:{}};if(function(a){if(!/haiku/i.test(a||""))return!1;let b=String(a).match(/haiku[-._]?(\d+)|(?<![\d.])(\d+)(?:[-._]\d+)?[-._]?haiku/i);return!b||5>Number(b[1]||b[2])}(c)){d.thinking?.type==="adaptive"&&(d.thinking={type:"enabled",budget_tokens:1e4});let a=n(d.output_config);return a?d.output_config=a:delete d.output_config,d}if(m.test(c)){let a=d.thinking;if(a?.type==="enabled"||a?.type==="adaptive"){let b,c={type:"adaptive"};"string"==typeof a.display&&a.display&&(c.display=a.display),d.thinking=c,d.output_config={...d.output_config||{},effort:d.output_config?.effort||(4096===(b=Number(a.budget_tokens))?"low":8e3===b||8192===b?"medium":16384===b?"high":32768===b?"xhigh":!Number.isFinite(b)||b<=0?"high":b<=4096?"low":b<=16384?"medium":"high")}}else if(a?.type==="disabled"){d.thinking={type:"disabled"};let a=n(d.output_config);a?d.output_config=a:delete d.output_config}return d}if(!k.test(c)&&!l.test(c))return b;if(d.tool_choice?.type==="any"||d.tool_choice?.type==="tool"){let a=d.tool_choice.disable_parallel_tool_use;d.tool_choice={type:"auto",...void 0!==a?{disable_parallel_tool_use:a}:{}}}return d.thinking?.type!=="disabled"||(k.test(c)?(delete d.thinking,d.output_config={...d.output_config||{},effort:"low"}):d.thinking={type:"between_tools"}),d}(v||a?.model,a),(0,o.s)(a,b,v||a?.model),function(a,b,c){if(!a||"object"!=typeof a||!Number.isFinite(a.max_tokens)||a.max_tokens<=0)return a;let e=(0,f.nl)(b,c||a.model),g=Number(e?.maxOutput),h=Number.isFinite(g)&&g>0?g:d.Uc;a.max_tokens>h&&(a.max_tokens=h);let i=a.thinking?.budget_tokens;return a.thinking?.type==="enabled"&&Number.isFinite(i)&&i>=a.max_tokens&&(a.max_tokens=Math.min(i+1024,h),i>=a.max_tokens&&(a.thinking.budget_tokens=Math.max(1024,a.max_tokens-1024))),a}(a,b,v||a?.model)}},83204:(a,b,c)=>{"use strict";let d=c(34589);a.exports=class{#a$;#cn=!1;#co=!1;#cp=!1;constructor(a){if("object"!=typeof a||null===a)throw TypeError("handler must be an object");this.#a$=a}onRequestStart(...a){this.#a$.onRequestStart?.(...a)}onRequestUpgrade(...a){return d(!this.#cn),d(!this.#co),this.#a$.onRequestUpgrade?.(...a)}onResponseStart(...a){return d(!this.#cn),d(!this.#co),d(!this.#cp),this.#cp=!0,this.#a$.onResponseStart?.(...a)}onResponseData(...a){return d(!this.#cn),d(!this.#co),this.#a$.onResponseData?.(...a)}onResponseEnd(...a){return d(!this.#cn),d(!this.#co),this.#cn=!0,this.#a$.onResponseEnd?.(...a)}onResponseError(...a){return this.#co=!0,this.#a$.onResponseError?.(...a)}onBodySent(...a){return this.#a$.onBodySent?.(...a)}onRequestSent(...a){return this.#a$.onRequestSent?.(...a)}}},83287:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"kilo-gateway",alias:"kgw",aliases:["kilo-gateway","kilogateway"],category:"freeTier",authModes:["apikey"],display:{name:"Kilo Gateway",icon:"login",color:"#8B5CF6",textIcon:"KG",website:"https://kilo.ai",notice:{apiKeyUrl:"https://kilo.ai/dashboard?tab=apiKeys"}},transport:{baseUrl:"https://api.kilo.ai/api/gateway/chat/completions",validateUrl:"https://api.kilo.ai/api/gateway/models",format:"openai"},models:[{id:"kilo-auto/free",name:"Kilo Auto Free",contextLength:256e3},{id:"nvidia/nemotron-3-super-120b-a12b:free",name:"Nemotron 3 Super 120B (Free)",contextLength:262144},{id:"nvidia/nemotron-3-ultra-550b-a55b:free",name:"Nemotron 3 Ultra 550B (Free)",contextLength:1e6},{id:"kwaipilot/kat-coder-pro-v2.5:free",name:"Kat Coder Pro v2.5 (Free)",contextLength:256e3},{id:"kilo-auto/frontier",name:"Kilo Auto Frontier",contextLength:1e6},{id:"kilo-auto/balanced",name:"Kilo Auto Balanced",contextLength:1e6}],serviceKinds:["llm"]}},83651:(a,b,c)=>{"use strict";c(8735),c(60856)},84238:(a,b,c)=>{"use strict";c.d(b,{OF:()=>f}),c(51525);var d=c(42541);function e(a){if(!a||"object"!=typeof a)return a;let b={...a};return void 0!==b.input_tokens&&(b.input_tokens+=2e3),void 0!==b.prompt_tokens&&(b.prompt_tokens+=2e3),void 0!==b.total_tokens?b.total_tokens+=2e3:void 0!==b.prompt_tokens&&void 0!==b.completion_tokens&&(b.total_tokens=b.prompt_tokens+b.completion_tokens),b}function f(a,b,c=d.h.OPENAI){var g,h;return g=function(a){if(!a||"object"!=typeof a)return 0;try{let b=JSON.stringify(a).length;return Math.ceil(b/4)}catch(a){return 0}}(a),h=b&&!(b<=0)?Math.max(1,Math.floor(b/4)):0,c===d.h.CLAUDE?e({input_tokens:g,output_tokens:h,estimated:!0}):e({prompt_tokens:g,completion_tokens:h,total_tokens:g+h,estimated:!0})}process.env.LOG_USAGE_VERBOSE},84269:(a,b,c)=>{"use strict";c.d(b,{Ay:()=>t});var d=c(69384),e=c(46956),f=c(30395),g=c(77598);let h="https://server.codeium.com/exa.language_server_pb.LanguageServerService/GetChatMessage",i="3.14.0",j={"swe-1.6-fast":"swe-1-6-fast","swe-1.6":"swe-1-6","swe-1.5-fast":"swe-1-5-fast","swe-1.5":"swe-1-5","claude-opus-4.7-max":"claude-opus-4-7-max","claude-opus-4.7-xhigh":"claude-opus-4-7-xhigh","claude-opus-4.7-high":"claude-opus-4-7-high","claude-opus-4.7-medium":"claude-opus-4-7-medium","claude-opus-4.7-low":"claude-opus-4-7-low","claude-opus-4.7-review":"opus-4-7-review","claude-sonnet-4.6-thinking-1m":"claude-sonnet-4-6-thinking-1m","claude-sonnet-4.6-1m":"claude-sonnet-4-6-1m","claude-sonnet-4.6-thinking":"claude-sonnet-4-6-thinking","claude-sonnet-4.6":"claude-sonnet-4-6","claude-opus-4.6-thinking":"claude-opus-4-6-thinking","claude-opus-4.6":"claude-opus-4-6","claude-opus-4.5-thinking":"MODEL_CLAUDE_4_5_OPUS_THINKING","claude-opus-4.5":"MODEL_CLAUDE_4_5_OPUS","claude-sonnet-4.5-thinking":"MODEL_PRIVATE_3","claude-sonnet-4.5":"MODEL_PRIVATE_2","claude-haiku-4.5":"MODEL_PRIVATE_11","gpt-5.5-xhigh-fast":"gpt-5-5-xhigh-priority","gpt-5.5-high-fast":"gpt-5-5-high-priority","gpt-5.5-medium-fast":"gpt-5-5-medium-priority","gpt-5.5-low-fast":"gpt-5-5-low-priority","gpt-5.5-none-fast":"gpt-5-5-none-priority","gpt-5.5-xhigh":"gpt-5-5-xhigh","gpt-5.5-high":"gpt-5-5-high","gpt-5.5-medium":"gpt-5-5-medium","gpt-5.5-low":"gpt-5-5-low","gpt-5.5-none":"gpt-5-5-none","gpt-5.5-review":"gpt-5-5-review","gpt-5.5":"gpt-5-5-medium","gpt-5.4-xhigh-fast":"gpt-5-4-xhigh-priority","gpt-5.4-high-fast":"gpt-5-4-high-priority","gpt-5.4-medium-fast":"gpt-5-4-medium-priority","gpt-5.4-low-fast":"gpt-5-4-low-priority","gpt-5.4-none-fast":"gpt-5-4-none-priority","gpt-5.4-xhigh":"gpt-5-4-xhigh","gpt-5.4-high":"gpt-5-4-high","gpt-5.4-medium":"gpt-5-4-medium","gpt-5.4-low":"gpt-5-4-low","gpt-5.4-none":"gpt-5-4-none","gpt-5.4-mini-xhigh":"gpt-5-4-mini-xhigh","gpt-5.4-mini-high":"gpt-5-4-mini-high","gpt-5.4-mini-medium":"gpt-5-4-mini-medium","gpt-5.4-mini-low":"gpt-5-4-mini-low","gpt-5.4":"gpt-5-4-medium","gpt-5.3-codex-xhigh-fast":"gpt-5-3-codex-xhigh-priority","gpt-5.3-codex-high-fast":"gpt-5-3-codex-high-priority","gpt-5.3-codex-medium-fast":"gpt-5-3-codex-medium-priority","gpt-5.3-codex-low-fast":"gpt-5-3-codex-low-priority","gpt-5.3-codex-xhigh":"gpt-5-3-codex-xhigh","gpt-5.3-codex-high":"gpt-5-3-codex-high","gpt-5.3-codex-medium":"gpt-5-3-codex-medium","gpt-5.3-codex-low":"gpt-5-3-codex-low","gpt-5.3-codex":"gpt-5-3-codex-medium","gpt-5.2-xhigh":"MODEL_GPT_5_2_XHIGH","gpt-5.2-high":"MODEL_GPT_5_2_HIGH","gpt-5.2-medium":"MODEL_GPT_5_2_MEDIUM","gpt-5.2-low":"MODEL_GPT_5_2_LOW","gpt-5.2-none":"MODEL_GPT_5_2_NONE","gpt-5.2":"MODEL_GPT_5_2_MEDIUM","gpt-5":"gpt-5","gpt-4.1":"MODEL_CHAT_GPT_4_1_2025_04_14","gpt-4.1-mini":"gpt-4.1-mini","gpt-4o":"MODEL_CHAT_GPT_4O_2024_08_06","gemini-3.1-pro-high":"gemini-3-1-pro-high","gemini-3.1-pro-low":"gemini-3-1-pro-low","gemini-3.1-pro":"gemini-3-1-pro-high","gemini-3.0-flash-high":"MODEL_GOOGLE_GEMINI_3_0_FLASH_HIGH","gemini-3.0-flash-medium":"MODEL_GOOGLE_GEMINI_3_0_FLASH_MEDIUM","gemini-3.0-flash-low":"MODEL_GOOGLE_GEMINI_3_0_FLASH_LOW","gemini-3.0-flash-minimal":"MODEL_GOOGLE_GEMINI_3_0_FLASH_MINIMAL","gemini-3.0-flash":"MODEL_GOOGLE_GEMINI_3_0_FLASH_HIGH","gemini-2.5-pro":"MODEL_GOOGLE_GEMINI_2_5_PRO","deepseek-v4":"deepseek-v4","kimi-k2.6":"kimi-k2-6","kimi-k2.5":"kimi-k2-5","glm-5.1":"glm-5-1"};function k(a){let b=[],c=a>>>0;for(;c>127;)b.push(127&c|128),c>>>=7;return b.push(127&c),new Uint8Array(b)}function l(a){let b=new Uint8Array(a.reduce((a,b)=>a+b.length,0)),c=0;for(let d of a)b.set(d,c),c+=d.length;return b}let m=new TextEncoder,n=new TextDecoder;function o(a,b){return l([k(a<<3|2),k(b.length),b])}function p(a,b){return o(a,m.encode(b))}function q(a,b){let c=0,d=0;for(;b<a.length;){let e=a[b++];if(c|=(127&e)<<d,(128&e)==0)break;d+=7}return[c>>>0,b]}function r(a,b){let c=0;for(;c<a.length;){let d;[d,c]=q(a,c);let e=d>>>3,f=7&d;if(2===f){let d;[d,c]=q(a,c);let f=a.slice(c,c+d);if(c+=d,e===b)return n.decode(f)}else if(0===f){let b;[b,c]=q(a,c)}else if(1===f)c+=8;else if(5===f)c+=4;else break}return null}class s extends d.Hv{constructor(){super("windsurf",f.xq.windsurf||{id:"windsurf",baseUrl:h})}buildUrl(){return h}buildHeaders(a,b=!0){let c=a?.accessToken||a?.apiKey||"";return{"Content-Type":"application/grpc-web+proto",Accept:"application/grpc-web+proto",...c?{Authorization:`Bearer ${c}`}:{},"User-Agent":`windsurf/${i}`,"X-Grpc-Web":"1"}}transformRequest(){return null}async execute({model:a,body:b,stream:c,credentials:d,signal:f,log:h,upstreamExtraHeaders:k,proxyOptions:m=null}){let n,q=d?.accessToken||d?.apiKey||"",r=j[a]??a,s=b??{},t=function(a){let b=[];for(let c of a){let a=String(c.role||"user"),d="";if("string"==typeof c.content)d=c.content;else if(Array.isArray(c.content))for(let a of c.content)a&&"object"==typeof a&&"text"===a.type&&(d+=String(a.text||""));b.push({role:a,content:d,toolCallId:c.tool_call_id})}return b}(Array.isArray(s.messages)?s.messages:[]);0===t.length&&t.push({role:"user",content:""});let u=function(a,b,c){let d=(0,g.randomUUID)(),e=(0,g.randomUUID)(),f=[o(1,l([p(1,a),p(2,"windsurf"),p(3,i),p(4,"3.14.0"),p(5,d),p(6,"en-US")])),p(2,e),o(3,p(1,b))];for(let a of c)f.push(o(4,function(a){let b=[p(1,a.role),p(2,a.content)];return a.toolCallId&&b.push(p(3,a.toolCallId)),l(b)}(a)));return l(f)}(q,r,t),v=((n=new Uint8Array(5+u.length))[0]=0,new DataView(n.buffer).setUint32(1,u.length,!1),n.set(u,5),n),w=this.buildUrl(),x=this.buildHeaders(d);k&&Object.assign(x,k),h?.debug?.("WS",`Windsurf → ${r} (${t.length} messages)`);let y=await (0,e.Fm)(w,{method:"POST",headers:x,body:v,signal:f},m);return y.ok||200===y.status?{response:this.transformToSSE(y,a),url:w,headers:x,transformedBody:u}:{response:y,url:w,headers:x,transformedBody:u}}transformToSSE(a,b){let c=`chatcmpl-ws-${Date.now()}`,d=Math.floor(Date.now()/1e3),e=this;return new Response(new ReadableStream({async start(f){let g=new TextEncoder,h=!1,i="",j=0,k=0,m=null,o=a=>f.enqueue(g.encode(a));try{let g=new Uint8Array(0),p=a.body?.getReader(),s=(a,f)=>{if(128===a){let a=n.decode(f),b=/grpc-status:\s*(\d+)/i.exec(a);if(b&&"0"!==b[1]){let c=/grpc-message:\s*(.+)/i.exec(a);m=c?decodeURIComponent(c[1].trim()):`gRPC status ${b[1]}`}return}if(0!==a)return;let g=e.constructor.decodeCompletionChunk?e.constructor.decodeCompletionChunk(f):function(a){let b=0;for(;b<a.length;){let c;[c,b]=q(a,b);let d=c>>>3,e=7&c;if(2===e){let c;[c,b]=q(a,b);let e=a.slice(b,b+c);if(b+=c,1===d){let a=r(e,1);if(null!==a)return{kind:"content",text:a}}else if(3===d){let a=function(a){let b=0,c=null;for(;b<a.length;){let d;[d,b]=q(a,b);let e=d>>>3,f=7&d;if(2===f){let d;[d,b]=q(a,b),1===e&&(c=a.slice(b,b+d)),b+=d}else if(0===f){let c;[c,b]=q(a,b)}else break}if(!c)return[0,0];let d=0,e=0;for(b=0;b<c.length;){let a;[a,b]=q(c,b);let f=a>>>3,g=7&a;if(0===g){let a;[a,b]=q(c,b),1===f?d=a:2===f&&(e=a)}else if(2===g){let a;[a,b]=q(c,b),b+=a}else break}return[d,e]}(e);return{kind:"done",promptTokens:a[0],completionTokens:a[1]}}else if(4===d)return{kind:"error",message:r(e,1)??"unknown windsurf error"}}else if(0===e){let c;[c,b]=q(a,b)}else if(1===e)b+=8;else if(5===e)b+=4;else break}return{kind:"unknown"}}(f);"content"===g.kind&&g.text?(i+=g.text,h||(o(`data: ${JSON.stringify({id:c,object:"chat.completion.chunk",created:d,model:b,choices:[{index:0,delta:{role:"assistant",content:""},finish_reason:null}]})}
1043
1043
 
1044
1044
  `),h=!0),o(`data: ${JSON.stringify({id:c,object:"chat.completion.chunk",created:d,model:b,choices:[{index:0,delta:{content:g.text},finish_reason:null}]})}
1045
1045
 
@@ -1073,7 +1073,7 @@ ${s}
1073
1073
  ${t}`);let u=[];k&&!n&&u.push((0,x.aZ)(j)),u.push(`[Context: Current time is ${new Date().toISOString()}]`),g&&u.push(x.rG),t=`${u.join("\n\n")}
1074
1074
 
1075
1075
  ${t}`;let v={userInputMessage:{...q.currentMessage.userInputMessage,content:t,...s&&{systemInstruction:s}}},w=Z({history:q.history,currentMessage:v,modelId:f,toolSpecs:o,nameMap:p});if(!w.valid)return console.error(`[Kiro] refusing invalid conversation (claude -> kiro): ${w.errors.join(", ")||"unknown"}`),null;let y={conversationState:{chatTriggerType:"MANUAL",conversationId:r,currentMessage:{userInputMessage:{...w.currentMessage.userInputMessage,origin:"AI_EDITOR"}},history:w.history}},z=d?.providerSpecificData?.authMethod,A="api_key"===z||"idc"===z||"external_idp"===z?d?.providerSpecificData?.profileArn||"":d?.providerSpecificData?.profileArn||(0,x.We)(z);A&&(y.profileArn=A),m&&(y.additionalModelRequestFields=m);let B=b.max_tokens??b.max_output_tokens??32e3;(B||void 0!==b.temperature||void 0!==b.top_p)&&(y.inferenceConfig={},B&&(y.inferenceConfig.maxTokens=B),void 0!==b.temperature&&(y.inferenceConfig.temperature=b.temperature),void 0!==b.top_p&&(y.inferenceConfig.topP=b.top_p)),Object.defineProperty(y,"_kiroUpstreamModel",{value:f,enumerable:!1}),Object.defineProperty(y,"_kiroThinkingEnabled",{value:k,enumerable:!1}),Object.defineProperty(y,"_kiroExposeReasoning",{value:l,enumerable:!1});let C=new Map([...p.entries()].filter(([a,b])=>a!==b).map(([a,b])=>[b,a]));return C.size&&Object.defineProperty(y,"_toolNameMap",{value:C,enumerable:!1,configurable:!0}),y},null),(0,p.kz)(d.h.OPENAI,d.h.CURSOR,function(a,b,c,d){let e=function(a){let b=[],c=new Map,d=(a,b)=>{if(!a)return;let d=b||"tool";c.set(a,{name:d});let e=ai(a);e&&e!==a&&c.set(e,{name:d})};for(let b of a){if("assistant"===b.role&&b.tool_calls)for(let a of b.tool_calls)d(a.id||"",a.function?.name||"tool");if("assistant"===b.role&&Array.isArray(b.content))for(let a of b.content)a?.type==="tool_use"&&d(a.id||"",a.name||"tool")}for(let d=0;d<a.length;d++){let e=a[d];if("system"===e.role){b.push({role:"user",content:`[System Instructions]
1076
- ${af(e.content)}`});continue}if("tool"===e.role){let a=af(e.content),d=e.tool_call_id||"",f=c.get(d)||{},g=e.name||f.name||"tool";b.push({role:"user",content:ah(g,d,a)});continue}if("user"===e.role||"assistant"===e.role){if("user"===e.role&&Array.isArray(e.content)){let a=[];for(let b of e.content)if(b&&"object"==typeof b){if("text"===b.type){"string"==typeof b.text&&a.push(b.text||"");continue}if("tool_result"===b.type){let d=b.tool_use_id||"",e=c.get(d)||c.get(ai(d)),f=e?.name||"tool",g=af(b.content);a.push(ah(f,d,g))}else{let c=af([b]);c&&a.push(c)}}let d=a.filter(Boolean).join("\n");d&&b.push({role:"user",content:d});continue}let a=af(e.content);if("assistant"===e.role&&e.tool_calls&&e.tool_calls.length>0){let c={role:"assistant",content:a||""};c.tool_calls=e.tool_calls.map(a=>{let{index:b,...c}=a||{};return c}),b.push(c)}else if("assistant"===e.role&&Array.isArray(e.content)){let c=e.content.filter(a=>a?.type==="tool_use").map(a=>({id:a.id||"",type:"function",function:{name:a.name||"tool",arguments:JSON.stringify(a.input||{})}})).filter(a=>a.id);c.length>0?b.push({role:"assistant",content:a||"",tool_calls:c}):a&&b.push({role:"assistant",content:a})}else a&&b.push({role:e.role,content:a})}}return b}(b.messages||[]),{user:f,metadata:g,tool_choice:h,stream_options:i,system:j,...k}=b;return{...k,messages:e,max_tokens:b.max_tokens??b.max_output_tokens??32e3}},null),(0,p.kz)(d.h.OPENAI,d.h.OLLAMA,function(a,b,c){let d={model:a,messages:function(a){if(!Array.isArray(a))return a;let b=[],c=new Map;for(let b of a)if("assistant"===b.role&&b.tool_calls)for(let a of b.tool_calls)a.id&&a.function?.name&&c.set(a.id,a.function.name);for(let d of a){if("tool"===d.role){let a=aj(d.content);if(!a)continue;let e=c.get(d.tool_call_id)||d.name||"unknown_tool";b.push({role:"tool",tool_name:e,content:a});continue}if("assistant"===d.role&&d.tool_calls){let a=aj(d.content)||"",c=d.tool_calls.map(a=>({type:"function",function:{index:a.index||0,name:a.function?.name||"",arguments:function(a){if("string"!=typeof a)return a||{};try{return JSON.parse(a||"{}")}catch{return{}}}(a.function?.arguments)}}));b.push({role:"assistant",content:a,tool_calls:c});continue}let a=d.role,e=aj(d.content),f=function(a){if(!Array.isArray(a))return[];let b=[];for(let c of a){if(!c||"image_url"!==c.type)continue;let a="string"==typeof c.image_url?c.image_url:c.image_url?.url;if("string"!=typeof a||!a)continue;let d=a.match(/^data:[^;]+;base64,([\s\S]+)$/);d&&b.push(d[1])}return b}(d.content);if(!e&&"assistant"!==a)continue;let g={role:a,content:e};f.length>0&&(g.images=f),b.push(g)}return b}(b.messages),stream:c};return void 0!==b.temperature&&(d.options=d.options||{},d.options.temperature=b.temperature),void 0!==b.max_tokens&&(d.options=d.options||{},d.options.num_predict=b.max_tokens),void 0!==b.top_p&&(d.options=d.options||{},d.options.top_p=b.top_p),b.tools&&Array.isArray(b.tools)&&(d.tools=b.tools),b.tool_choice&&(d.tool_choice=b.tool_choice),d},null);var ak=c(44282);function al(a){if(null==a)return"";if("string"==typeof a)return a;if(Array.isArray(a)){let b=[];for(let c of a)"string"==typeof c?b.push(c):c&&"object"==typeof c&&"string"==typeof c.text&&b.push(c.text);return b.join("\n")}return String(a)}(0,p.kz)(d.h.OPENAI,d.h.COMMANDCODE,function(a,b,c,d){let{messages:e,system:f}=function(a=[]){let b=[],c=[];for(let d of a){if(!d)continue;let a=d.role;if("system"===a){let a=al(d.content);a&&c.push(a);continue}if("tool"===a){let a="string"==typeof d.content?d.content:al(d.content);b.push({role:"tool",content:[{type:"tool-result",toolCallId:d.tool_call_id||"",toolName:d.name||"",output:{type:"text",value:a}}]});continue}if("assistant"===a){let a=[],c=al(d.content);if(c&&a.push({type:"text",text:c}),Array.isArray(d.tool_calls))for(let b of d.tool_calls){let c=b.function||{};a.push({type:"tool-call",toolCallId:b.id||"",toolName:c.name||"",input:function(a){if(null==a)return{};if("string"!=typeof a)return a;try{return JSON.parse(a)}catch{return{_raw:a}}}(c.arguments)})}b.push({role:"assistant",content:a.length?a:[{type:"text",text:""}]});continue}b.push({role:"user",content:function(a){if(null==a)return[{type:"text",text:""}];if("string"==typeof a)return[{type:"text",text:a}];if(Array.isArray(a)){let b=[];for(let c of a)if("string"==typeof c)b.push({type:"text",text:c});else if(c&&"object"==typeof c)if("text"===c.type&&"string"==typeof c.text)b.push({type:"text",text:c.text});else if("image_url"===c.type){let a="string"==typeof c.image_url?c.image_url:c.image_url?.url;a&&b.push({type:"image",image:a})}else if("image"===c.type&&c.source)if("base64"===c.source.type&&c.source.data){let a=c.source.media_type||"image/png";b.push({type:"image",image:`data:${a};base64,${c.source.data}`})}else"url"===c.source.type&&c.source.url&&b.push({type:"image",image:c.source.url});else"string"==typeof c.text&&b.push({type:"text",text:c.text});return b.length?b:[{type:"text",text:""}]}return[{type:"text",text:String(a)}]}(d.content)})}return{messages:b,system:c.join("\n\n")}}(b.messages),g={model:a,messages:e,stream:!1!==c,max_tokens:b.max_tokens??b.max_output_tokens??64e3,temperature:b.temperature??.3};f&&(g.system=f);let h=function(a){if(!Array.isArray(a)||0===a.length)return;let b=[];for(let c of a)c&&("function"===c.type&&c.function?b.push({name:c.function.name,description:c.function.description,input_schema:c.function.parameters||{type:"object"}}):c.name&&(c.input_schema||c.parameters)&&b.push({name:c.name,description:c.description,input_schema:c.input_schema||c.parameters}));return b.length?b:void 0}(b.tools);h&&(g.tools=h),null!=b.top_p&&(g.top_p=b.top_p);let i=new Date().toISOString().slice(0,10);return{threadId:(0,ak.VR)(d?._clientSessionId),memory:"",config:{workingDir:ak.Ie,date:i,environment:process.platform,structure:[],isGitRepo:!1,currentBranch:"",mainBranch:"",gitStatus:"",recentCommits:[]},params:g}},null),c(41222);var am=c(57861);let an="proxy_";function ao(a,b){a.thinkingBlockStarted&&(b.push({type:"content_block_stop",index:a.thinkingBlockIndex}),a.thinkingBlockStarted=!1)}function ap(a,b){a.textBlockStarted&&!a.textBlockClosed&&(a.textBlockClosed=!0,b.push({type:"content_block_stop",index:a.textBlockIndex}),a.textBlockStarted=!1)}function aq(a,b){let c="number"==typeof a.prompt_tokens?a.prompt_tokens:0,d="number"==typeof a.completion_tokens?a.completion_tokens:0,e=a.prompt_tokens_details?.cached_tokens,f=a.prompt_tokens_details?.cache_creation_tokens,g="number"==typeof e?e:0,h="number"==typeof f?f:0;b.usage={input_tokens:c-g-h,output_tokens:d},g>0&&(b.usage.cache_read_input_tokens=g),h>0&&(b.usage.cache_creation_input_tokens=h)}function ar(a,b){a.pendingStopReason&&(b.push({type:"message_delta",delta:{stop_reason:a.pendingStopReason},usage:a.usage||{input_tokens:0,output_tokens:0}}),b.push({type:"message_stop"}),a.pendingStopReason=null)}function as(a,b){if(!a){let a=[];return ar(b,a),a.length>0?a:null}if(!a.choices?.[0]){if(!a.usage||"object"!=typeof a.usage)return null;aq(a.usage,b);let c=[];return ar(b,c),c.length>0?c:null}let c=[],d=a.choices[0],e=d.delta;a.usage&&"object"==typeof a.usage&&aq(a.usage,b),b.messageStartSent||(b.messageStartSent=!0,b.messageId=a.id?.replace("chatcmpl-","")||`msg_${Date.now()}`,(!b.messageId||"chat"===b.messageId||b.messageId.length<8)&&(b.messageId=a.extend_fields?.requestId||a.extend_fields?.traceId||`msg_${Date.now()}`),b.model=a.model||"unknown",b.nextBlockIndex=0,c.push({type:"message_start",message:{id:b.messageId,type:"message",role:"assistant",model:b.model,content:[],stop_reason:null,stop_sequence:null,usage:{input_tokens:0,output_tokens:0}}}));let f=(0,am.V)(e);if(f&&(ap(b,c),b.thinkingBlockStarted||(b.thinkingBlockIndex=b.nextBlockIndex++,b.thinkingBlockStarted=!0,c.push({type:"content_block_start",index:b.thinkingBlockIndex,content_block:{type:"thinking",thinking:""}})),c.push({type:"content_block_delta",index:b.thinkingBlockIndex,delta:{type:"thinking_delta",thinking:f}})),e?.content&&(ao(b,c),b.textBlockStarted||(b.textBlockIndex=b.nextBlockIndex++,b.textBlockStarted=!0,b.textBlockClosed=!1,c.push({type:"content_block_start",index:b.textBlockIndex,content_block:{type:"text",text:""}})),c.push({type:"content_block_delta",index:b.textBlockIndex,delta:{type:"text_delta",text:e.content}})),e?.tool_calls)for(let a of e.tool_calls){let d=a.index??0;if(a.id){ao(b,c),ap(b,c);let e=b.nextBlockIndex++;b.toolCalls.set(d,{id:a.id,name:a.function?.name||"",blockIndex:e});let f=a.function?.name||"";f.startsWith(an)&&(f=f.slice(an.length)),c.push({type:"content_block_start",index:e,content_block:{type:"tool_use",id:a.id,name:f,input:{}}})}a.function?.arguments&&b.toolCalls.get(d)&&(b.toolArgBuffers||(b.toolArgBuffers=new Map),b.toolArgBuffers.set(d,(b.toolArgBuffers.get(d)||"")+a.function.arguments))}if(d.finish_reason){for(let[a,d]of(ao(b,c),ap(b,c),b.toolCalls)){let e=b.toolArgBuffers?.get(a);if(e){let a=function(a,b){try{let c=JSON.parse(b),d=a.startsWith(an)?a.slice(an.length):a;return"Read"===d&&function(a){var b,c;"string"==typeof a.limit&&/^\d+$/.test(a.limit)&&(a.limit=Number(a.limit)),"string"==typeof a.offset&&/^-?\d+$/.test(a.offset)&&(a.offset=Number(a.offset)),"number"==typeof a.limit&&(a.limit>2e3&&(a.limit=2e3),a.limit<1&&delete a.limit),"number"==typeof a.offset&&a.offset<0&&(a.offset=0),"pages"in a&&(b=a.file_path,c=a.pages,!("string"==typeof b&&b.toLowerCase().endsWith(".pdf")&&"string"==typeof c&&/^\d+(?:-\d+)?$/.test(c)))&&delete a.pages}(c),JSON.stringify(c)}catch{return b}}(d.name,e);c.push({type:"content_block_delta",index:d.blockIndex,delta:{type:"input_json_delta",partial_json:a}})}c.push({type:"content_block_stop",index:d.blockIndex})}b.finishReason=d.finish_reason,b.pendingStopReason=function(a){switch(a){case"stop":default:return"end_turn";case"length":return"max_tokens";case"tool_calls":return"tool_use"}}(d.finish_reason),b.usage&&ar(b,c)}return c.length>0?c:null}function at(a){let b={promptTokenCount:a.prompt_tokens||0,candidatesTokenCount:a.completion_tokens||0,totalTokenCount:a.total_tokens||0};return a.completion_tokens_details?.reasoning_tokens&&(b.thoughtsTokenCount=a.completion_tokens_details.reasoning_tokens),a.prompt_tokens_details?.cached_tokens&&(b.cachedContentTokenCount=a.prompt_tokens_details.cached_tokens),b}function au(a){return"number"==typeof a&&Number.isFinite(a)?a:void 0}function av(a,b,c,i,k=!0,q=null,r=null,s=null,t=[],u=null,v=null,w=q?.runtimeTransport||null){let x=function(a){if(Array.isArray(a?.messages))return a.messages[a.messages.length-1]?.role;let b=Array.isArray(a?.contents)?a.contents:Array.isArray(a?.input)?a.input:null;if(!b)return;let c=b[b.length-1]?.role;return"assistant"===c||"model"===c?"assistant":void 0}(i),y=i;if(!function(a,b=[]){if(!b.length||!a.messages||!Array.isArray(a.messages))return;let c=new Set(["image_url","image"]),d=new Set(["audio_url","input_audio"]),e=a=>c.has(a)?b.includes("image"):!!d.has(a)&&b.includes("audio");for(let b of a.messages)Array.isArray(b.content)&&(b.content=b.content.filter(a=>!e(a.type)),0===b.content.length&&(b.content=""))}(y,t),(0,n.SZ)(y),!function(a){if(a.messages&&Array.isArray(a.messages))for(let b=0;b<a.messages.length;b++){let c=a.messages[b];if("assistant"===c.role&&c.tool_calls&&Array.isArray(c.tool_calls))for(let a=0;a<c.tool_calls.length;a++){let d=c.tool_calls[a];if(!d.id||!e.test(d.id)){let c=g(d.id);d.id=c||f(b,a,d.function?.name)}d.type||(d.type="function"),d.function?.arguments&&"string"!=typeof d.function.arguments&&(d.function.arguments=JSON.stringify(d.function.arguments))}if("tool"===c.role&&c.tool_call_id&&!e.test(c.tool_call_id)){let a=g(c.tool_call_id);c.tool_call_id=a||f(b,0)}if(Array.isArray(c.content))for(let a=0;a<c.content.length;a++){let d=c.content[a];if("tool_use"===d.type&&d.id&&!e.test(d.id)){let c=g(d.id);d.id=c||f(b,a,d.name)}if("tool_result"===d.type&&d.tool_use_id&&!e.test(d.tool_use_id)){let c=g(d.tool_use_id);d.tool_use_id=c||f(b,a)}}}}(y),!function(a){if(!a.messages||!Array.isArray(a.messages))return;let b=[];for(let c=0;c<a.messages.length;c++){let d=a.messages[c],e=a.messages[c+1];b.push(d);let f=function(a){if("assistant"!==a.role)return[];let b=[];if(a.tool_calls&&Array.isArray(a.tool_calls))for(let c of a.tool_calls)c.id&&b.push(c.id);if(Array.isArray(a.content))for(let c of a.content)"tool_use"===c.type&&c.id&&b.push(c.id);return b}(d);if(0!==f.length&&e&&!function(a,b){if(!a||!b.length)return!1;if("tool"===a.role&&a.tool_call_id)return b.includes(a.tool_call_id);if("user"===a.role&&Array.isArray(a.content)){for(let c of a.content)if("tool_result"===c.type&&b.includes(c.tool_use_id))return!0}return!1}(e,f))for(let a of f)b.push({role:"tool",tool_call_id:a,content:""})}a.messages=b}(y),q&&(b===d.h.ANTIGRAVITY||b===d.h.COMMANDCODE||"commandcode"===r)&&(q._clientSessionId=(0,o.YC)(y,q,u,b)),a!==b){let e=a!==d.h.OPENAI&&b!==d.h.OPENAI?p.rV.get(`${a}:${b}`):null;if(e)y=e(c,y,k,q,r);else{if(a!==d.h.OPENAI){let b=p.rV.get(`${a}:${d.h.OPENAI}`);b&&(y=b(c,y,k,q),s?.logOpenAIRequest?.(y))}if(b!==d.h.OPENAI){let a=p.rV.get(`${d.h.OPENAI}:${b}`);a&&(y=a(c,y,k,q,r))}}}if(b===d.h.OPENAI&&(y=function(a,b={}){if(!a.messages||!Array.isArray(a.messages))return a;let c=!!b.preserveCacheControl;function d(a){let{signature:b,cache_control:d,...e}=a;return c&&d?{...e,cache_control:d}:e}if(a.messages=a.messages.map(a=>{if("developer"===a.role&&(a={...a,role:"system"}),"tool"===a.role||"assistant"===a.role&&a.tool_calls||"string"==typeof a.content)return a;if(Array.isArray(a.content)){let b=[];for(let c of a.content)if("thinking"!==c.type&&"redacted_thinking"!==c.type)if(l.includes(c.type))b.push(d(c));else{if("tool_use"===c.type)continue;"tool_result"===c.type&&b.push(d(c))}return 0===b.length&&b.push({type:"text",text:""}),{...a,content:b}}return a}),a.messages=a.messages.filter(a=>"tool"===a.role||"assistant"===a.role&&!!a.tool_calls||("string"==typeof a.content?""!==a.content.trim():!Array.isArray(a.content)||a.content.some(a=>"text"===a.type&&a.text?.trim()||"text"!==a.type))),a.tools&&Array.isArray(a.tools)&&0===a.tools.length&&delete a.tools,a.tools&&Array.isArray(a.tools)&&a.tools.length>0&&(a.tools=a.tools.map(a=>"function"===a.type&&a.function?a:a.name&&(a.input_schema||a.description)?{type:"function",function:{name:a.name,description:String(a.description||""),parameters:a.input_schema||{type:"object",properties:{}}}}:a.functionDeclarations&&Array.isArray(a.functionDeclarations)?a.functionDeclarations.map(a=>({type:"function",function:{name:a.name,description:String(a.description||""),parameters:a.parameters||{type:"object",properties:{}}}})):a).flat()),a.tool_choice&&"object"==typeof a.tool_choice){let b=a.tool_choice;"auto"===b.type?a.tool_choice="auto":"any"===b.type?a.tool_choice="required":"tool"===b.type&&b.name&&(a.tool_choice={type:"function",function:{name:b.name}})}return a}(y,{preserveCacheControl:!!m.xq[r]?.quirks?.preserveCacheControl}),("github"===r||"gh"===r)&&a===d.h.CLAUDE&&i?.thinking?.type==="disabled"&&y&&!y.thinking&&(y={...y,thinking:{type:"disabled"}})),b===d.h.CLAUDE){let a=q?.accessToken||q?.apiKey||null;y=(0,h.Bz)(y,r,a,u,w||{},c),Array.isArray(y?.messages)&&(y.messages=(0,h.HU)(y.messages,x))}if("claude"===r){let a=q?.accessToken||q?.apiKey||null;if(a?.includes("sk-ant-oat")){let{body:a,toolNameMap:b}=(0,j.Az)(y);y=a,b?.size>0&&(y._toolNameMap=b)}}return y}function aw(a,b){return b?.toolNameMap?.size&&a&&"object"==typeof a?(0,k.HR)(a,b.toolNameMap):a}function ax(a,b){if(!b?.toolNameMap?.size||!Array.isArray(a))return a;let c=a.map(a=>aw(a,b));return a._openaiIntermediate&&(c._openaiIntermediate=a._openaiIntermediate),c}function ay(a,b,c,e){if(e&&b===d.h.OPENAI_RESPONSES&&a===d.h.OPENAI&&(e.deferResponsesCompletion=!0),b===a)return e&&c&&"object"==typeof c&&(e.streamToolCallIds||(e.streamToolCallIds=new Map),(0,i.RW)(c,e.streamToolCallIds)),[aw((0,j.F5)(c,e?.toolNameMap),e)];let f=[c],g=null,h=a!==d.h.OPENAI&&b!==d.h.OPENAI?p.hi.get(`${a}:${b}`):null;if(h){let a=h(c,e);return a?ax(Array.isArray(a)?a:[a],e):[]}if(a!==d.h.OPENAI){let b=p.hi.get(`${a}:${d.h.OPENAI}`);if(b){f=[];let a=b(c,e);a&&(g=f=Array.isArray(a)?a:[a])}}if(b!==d.h.OPENAI){let g=p.hi.get(`${d.h.OPENAI}:${b}`);if(g){let b=[];for(let h of null===c&&a!==d.h.OPENAI?[...f,null]:f){let a=g(h,e);a&&b.push(...Array.isArray(a)?a:[a])}f=b}}return g&&b!==d.h.OPENAI&&a!==d.h.OPENAI&&(f._openaiIntermediate=g),ax(f,e)}function az(a){let b={messageId:null,model:null,textBlockStarted:!1,thinkingBlockStarted:!1,inThinkingBlock:!1,currentBlockIndex:null,toolCalls:new Map,finishReason:null,finishReasonSent:!1,usage:null,contentBlockIndex:-1};return a===d.h.OPENAI_RESPONSES?{...b,seq:0,responseId:`resp_${Date.now()}`,created:Math.floor(Date.now()/1e3),started:!1,nextOutputIndex:0,msgTextBuf:{},msgItemAdded:{},msgContentAdded:{},msgItemDone:{},msgOutputIndices:{},reasoningId:"",reasoningIndex:-1,reasoningBuf:"",reasoningPartAdded:!1,reasoningDone:!1,inThinking:!1,funcArgsBuf:{},funcNames:{},funcTypes:{},funcCallIds:{},funcItemAdded:{},funcArgsDone:{},funcItemDone:{},funcOutputIndices:{},completedSent:!1,responsesUsage:null,completionPending:!1}:b}(0,p.kz)(d.h.OPENAI,d.h.CLAUDE,null,as),c(28113),(0,p.kz)(d.h.OPENAI,d.h.ANTIGRAVITY,null,function(a,b){if(!a)return null;let c=a.choices?.[0];if(!c)return a.usage?(b._usage=a.usage,{response:{candidates:[],modelVersion:b._modelVersion||a.model||"",responseId:b._responseId||a.id||`resp_${Date.now()}`,usageMetadata:at(a.usage)}}):null;let d=c.delta||{},e=c.finish_reason;b._toolCallAccum||(b._toolCallAccum={}),b._responseId||(b._responseId=a.id||`resp_${Date.now()}`),b._modelVersion||(b._modelVersion=a.model||"");let f=[],g=(0,am.V)(d);if(g&&f.push({thought:!0,text:g}),d.content&&f.push({text:d.content}),d.tool_calls){for(let a of d.tool_calls){let c=a.index??0;b._toolCallAccum[c]||(b._toolCallAccum[c]={id:"",name:"",arguments:""});let d=b._toolCallAccum[c];a.id&&(d.id=a.id),a.function?.name&&(d.name+=a.function.name),a.function?.arguments&&(d.arguments+=a.function.arguments)}if(0===f.length&&!e)return null}if(e)for(let a of Object.keys(b._toolCallAccum)){let c=b._toolCallAccum[a],d={};try{d=JSON.parse(c.arguments)}catch{}let e=b.toolNameMap?.get(c.name)||c.name;f.push({functionCall:{name:e,args:d}})}if(0===f.length&&!e)return null;0===f.length&&e&&f.push({text:""});let h={content:{role:"model",parts:f}};e&&(h.finishReason=({stop:"STOP",length:"MAX_TOKENS",tool_calls:"STOP",content_filter:"SAFETY"})[e]||"STOP");let i={candidates:[h],modelVersion:b._modelVersion,responseId:b._responseId},j=a.usage||b._usage;return j&&(i.usageMetadata=at(j)),{response:i}}),c(56248),(0,p.kz)(d.h.KIRO,d.h.OPENAI,null,function(a,b){if(!a)return null;if("chat.completion.chunk"===a.object&&a.choices)return a;let c=a;if("string"==typeof a){let b=a.split("\n"),d="",e="";for(let a of b)a.startsWith("event:")?d=a.slice(6).trim():a.startsWith(":event-type:")?d=a.slice(12).trim():a.startsWith("data:")?e=a.slice(5).trim():a.startsWith(":content-type:")||a.trim()&&!a.startsWith(":")&&(e=a.trim());if(!e)return null;try{(c=JSON.parse(e))._eventType=d}catch{c={text:e,_eventType:d}}}b.responseId||(b.responseId=`chatcmpl-${Date.now()}`,b.created=Math.floor(Date.now()/1e3),b.chunkIndex=0);let d=c._eventType||c.event||"";if("assistantResponseEvent"===d||c.assistantResponseEvent){let a=c.assistantResponseEvent?.content||c.content||"";if(!a)return null;let d={id:b.responseId,object:"chat.completion.chunk",created:b.created,model:b.model||"kiro",choices:[{index:0,delta:{...0===b.chunkIndex?{role:"assistant"}:{},content:a},finish_reason:null}]};return b.chunkIndex++,d}if("reasoningContentEvent"===d||c.reasoningContentEvent){let a=c.reasoningContentEvent||c,d="string"==typeof a?a:a.text||a.content||c.content||"";if(!d)return null;let e={id:b.responseId,object:"chat.completion.chunk",created:b.created,model:b.model||"kiro",choices:[{index:0,delta:{...0===b.chunkIndex?{role:"assistant"}:{},reasoning_content:d},finish_reason:null}]};return b.chunkIndex++,e}if("toolUseEvent"===d||c.toolUseEvent){let a=c.toolUseEvent||c,d=a.toolUseId||`call_${Date.now()}`,e=a.name||"",f=b.toolNameMap?.get(e)||e,g=a.input||{},h={id:b.responseId,object:"chat.completion.chunk",created:b.created,model:b.model||"kiro",choices:[{index:0,delta:{...0===b.chunkIndex?{role:"assistant"}:{},tool_calls:[{index:0,id:d,type:"function",function:{name:f,arguments:JSON.stringify(g)}}]},finish_reason:null}]};return b.chunkIndex++,h}if("messageStopEvent"===d||"done"===d||c.messageStopEvent){b.finishReason="stop";let a={id:b.responseId,object:"chat.completion.chunk",created:b.created,model:b.model||"kiro",choices:[{index:0,delta:{},finish_reason:"stop"}]};return b.usage&&"object"==typeof b.usage&&(a.usage=b.usage),a}if("usageEvent"===d||c.usageEvent){let a=c.usageEvent||c;a&&"object"==typeof a&&(b.usage={prompt_tokens:a.inputTokens||0,completion_tokens:a.outputTokens||0,total_tokens:(a.inputTokens||0)+(a.outputTokens||0)})}return null}),(0,p.kz)(d.h.KIRO,d.h.CLAUDE,null,function(a,b){let c=a&&"object"==typeof a?a.usage:null,d=as(a,b),e=function(a){if(!a||"object"!=typeof a)return null;let b=au(a.prompt_tokens),c=au(a.completion_tokens);if(void 0===b&&void 0===c)return null;let d=au(a.cache_read_input_tokens)??au(a.prompt_tokens_details?.cached_tokens),e=au(a.cache_creation_input_tokens)??au(a.prompt_tokens_details?.cache_creation_tokens);return{input_tokens:b||0,output_tokens:c||0,...void 0!==d?{cache_read_input_tokens:d}:{},...void 0!==e?{cache_creation_input_tokens:e}:{}}}(c);if(e&&(b.usage=e),!d)return d;let f=Array.isArray(d)?d:[d];return e?f.map(a=>a?.type==="message_delta"?{...a,usage:e}:a):f}),(0,p.kz)(d.h.CURSOR,d.h.OPENAI,null,function(a,b){return a?("chat.completion.chunk"===a.object&&a.choices||"chat.completion"===a.object&&a.choices,a):null}),c(23242),c(65294)},86625:(a,b,c)=>{"use strict";let{promisify:d}=c(57975),e=c(35689),{buildMockDispatch:f}=c(70634),{kDispatches:g,kMockAgent:h,kClose:i,kOriginalClose:j,kOrigin:k,kOriginalDispatch:l,kConnected:m,kIgnoreTrailingSlash:n}=c(80830),{MockInterceptor:o}=c(55720),p=c(49176),{InvalidArgumentError:q}=c(61448);class r extends e{constructor(a,b){if(!b||!b.agent||"function"!=typeof b.agent.dispatch)throw new q("Argument opts.agent must implement Agent");super(a,b),this[h]=b.agent,this[k]=a,this[n]=b.ignoreTrailingSlash??!1,this[g]=[],this[m]=1,this[l]=this.dispatch,this[j]=this.close.bind(this),this.dispatch=f.call(this),this.close=this[i]}get[p.kConnected](){return this[m]}intercept(a){return new o(a&&{ignoreTrailingSlash:this[n],...a},this[g])}cleanMocks(){this[g]=[]}async [i](){await d(this[j])(),this[m]=0,this[h][p.kClients].delete(this[k])}}a.exports=r},86767:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{EW:()=>j,UT:()=>k});var e=c(70321),f=c(21263),g=a([f]);f=(g.then?(await g)():g)[0],globalThis._quotaRefreshState||(globalThis._quotaRefreshState={started:!1,startTimer:null,timer:null,running:!1,runningPromise:null});let l=globalThis._quotaRefreshState;async function h(a,b={}){return(await (0,f.J4)({connections:a,force:!0===b.force,...void 0!==b.concurrency?{concurrency:b.concurrency}:{},...b.resolveUsage?{resolveUsage:b.resolveUsage}:{},replaceAccounts:!1,retainWithoutSubscribers:!0})).attempted}function i(){if(l.runningPromise)return l.runningPromise;l.running=!0;let a=(async()=>{let a=[];try{a=await (0,e.getProviderConnections)({isActive:!0})}catch(a){console.warn(`[QuotaRefresh] failed to list connections: ${a.message}`);return}await h(a)})().finally(()=>{l.runningPromise===a&&(l.runningPromise=null,l.running=!1)});return l.runningPromise=a,a}function j(){!l.started&&(l.started=!0,l.startTimer=setTimeout(()=>{l.startTimer=null,i(),l.timer=setInterval(()=>void i(),3e5),l.timer.unref&&l.timer.unref()},15e3),l.startTimer.unref&&l.startTimer.unref())}function k(){return l.startTimer&&clearTimeout(l.startTimer),l.timer&&clearInterval(l.timer),l.startTimer=null,l.timer=null,l.started=!1,l.runningPromise||Promise.resolve()}l.runningPromise??=null,d()}catch(a){d(a)}})},87085:(a,b,c)=>{"use strict";let{InvalidArgumentError:d,RequestAbortedError:e}=c(61448),f=c(83204);class g extends f{#am=1048576;#co=!1;#aL=0;aborted=!1;reason=!1;constructor({maxSize:a,signal:b},c){if(null!=a&&(!Number.isFinite(a)||a<1))throw new d("maxSize must be a number greater than 0");super(c),this.#am=a??this.#am}#ci(a){this.aborted=!0,this.reason=a}onRequestStart(a,b){return a.abort=this.#ci.bind(this),super.onRequestStart(a,b)}onResponseStart(a,b,c,d){let f=c["content-length"];if(null!=f&&f>this.#am)throw new e(`Response size (${f}) larger than maxSize (${this.#am})`);return!0===this.aborted||super.onResponseStart(a,b,c,d)}onResponseError(a,b){super.onResponseError(a,!0===this.aborted?this.reason:b)}onResponseData(a,b){if(this.#aL=this.#aL+b.length,this.#aL>this.#am)throw new e(`Response size (${this.#aL}) larger than maxSize (${this.#am})`);return this.#aL===this.#am&&(this.#co=!0),!0}onResponseEnd(a,b){!0===this.aborted?super.onResponseError(a,this.reason):super.onResponseEnd(a,this.#co?{}:b)}}a.exports=function({maxSize:a}={maxSize:1048576}){return b=>function(c,d){let{dumpMaxSize:e=a}=c,f=new g({maxSize:e,signal:c.signal},d);return b(c,f)}}},87404:(a,b,c)=>{"use strict";let d,{webidl:e}=c(32984),{validateCloseCodeAndReason:f}=c(94050),{kConstruct:g}=c(49176),{kEnumerableProperty:h}=c(84285);function i(){class a extends DOMException{get reason(){return""}}return void 0!==new a().reason?DOMException:new Proxy(DOMException,{construct(a,b,c){let d=Reflect.construct(a,b,a);return Object.setPrototypeOf(d,c.prototype),d}})}class j extends i(){#cp;#ch;constructor(a="",b){if(super(a=e.converters.DOMString(a,"WebSocketError","message"),"WebSocketError"),b===g)return;null!==b&&(b=e.converters.WebSocketCloseInfo(b));let c=b.closeCode??null,d=b.reason??"";f(c,d),0!==d.length&&null===c&&(c=1e3),this.#cp=c,this.#ch=d}get closeCode(){return this.#cp}get reason(){return this.#ch}static{d=(a,b,c)=>{let d=new j(a,g);return d.#cp=b,d.#ch=c,d},e.is.WebSocketError=a=>null!=a&&"object"==typeof a&&#ch in a}}Object.defineProperties(j.prototype,{closeCode:h,reason:h,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}}),a.exports={WebSocketError:j,createUnvalidatedWebSocketError:d}},87585:a=>{"use strict";let b=[{open:"<thinking>",close:"</thinking>"},{open:"<think>",close:"</think>"}];function c(a,b,c){if(!c)return;let d=a[a.length-1];d?.type===b?d.text+=c:a.push({type:b,text:c})}function d(a,b){let c=a.toLowerCase(),d=0;for(let a of b){let b=Math.min(c.length,a.length-1);for(let e=b;e>d;e--)if(c.endsWith(a.slice(0,e))){d=e;break}}return d}a.exports={createTaggedThinkingState:function(){return{mode:"text",closeTag:null,buffer:""}},flushTaggedThinking:function(a){if(!a)return[];let b=[];return c(b,"reasoning"===a.mode?"reasoning":"text",a.buffer),a.mode="text",a.closeTag=null,a.buffer="",b},pushTaggedThinking:function(a,e){if(!a||"string"!=typeof e||0===e.length)return[];a.buffer+=e;let f=[];for(;a.buffer;){let e=a.buffer.toLowerCase();if("text"===a.mode){let g=null;for(let a of b){let b=e.indexOf(a.open);b>=0&&(!g||b<g.index)&&(g={...a,index:b})}if(g){c(f,"text",a.buffer.slice(0,g.index)),a.buffer=a.buffer.slice(g.index+g.open.length),a.mode="reasoning",a.closeTag=g.close;continue}let h=d(a.buffer,b.map(a=>a.open));c(f,"text",a.buffer.slice(0,a.buffer.length-h)),a.buffer=h?a.buffer.slice(-h):"";break}let g=a.closeTag||"</thinking>",h=e.indexOf(g);if(h>=0){c(f,"reasoning",a.buffer.slice(0,h)),a.buffer=a.buffer.slice(h+g.length),a.mode="text",a.closeTag=null;continue}let i=d(a.buffer,[g]);c(f,"reasoning",a.buffer.slice(0,a.buffer.length-i)),a.buffer=i?a.buffer.slice(-i):"";break}return f}}},87792:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"minimax-code",priority:80,alias:"mm",display:{name:"MiniMax Code",icon:"smart_toy",color:"#FF4D4F",textIcon:"MM",website:"https://agent.minimax.cn"},category:"oauth",authModes:["oauth"],hasOAuth:!0,features:{usage:!0},modelsFetcher:{url:"https://agent.minimax.cn/mavis/api/v1/models?region=cn&buildEnv=prod",type:"minimax-code"},transport:{baseUrl:"https://agent.minimax.cn/mavis/api/v1/llm/v1/messages",format:"claude",thinkingFormat:"claude-adaptive",headers:{"User-Agent":"MiniMaxAgent","X-Mavis-Agent-Id":"main"},auth:{combined:!0,header:"Authorization",scheme:"bearer",anthropicVersion:!0,hooks:["minimaxHeaders"]}},oauth:{clientId:"mcode-public",deviceUrl:"https://account.minimax.cn/oauth2/device/code",tokenUrl:"https://account.minimax.cn/oauth2/token",scope:"agent.default",audience:"agent-backend",refreshLeadMs:6e5},models:[{id:"MiniMax-M3.1-Flash-Preview",name:"MiniMax M3.1 Flash Preview"},{id:"MiniMax-M3",name:"MiniMax M3"},{id:"MiniMax-M2.7",name:"MiniMax M2.7"},{id:"MiniMax-M2.7-highspeed",name:"MiniMax M2.7 Highspeed"}],serviceKinds:["llm"]}},87886:(a,b,c)=>{"use strict";c.r(b),c.d(b,{debug:()=>o,error:()=>r,errorLine:()=>l,fmtThink:()=>m,info:()=>p,line:()=>k,maskKey:()=>v,nextTag:()=>i,request:()=>s,response:()=>t,stream:()=>u,tagForSession:()=>j,warn:()=>q});let d={DEBUG:0,INFO:1,WARN:2,ERROR:3},e=d[process.env.LOG_LEVEL?.toUpperCase?.()]??d.INFO;function f(){return new Date().toLocaleTimeString("en-US",{hour12:!1})}let g=["\uD83D\uDFE2","\uD83D\uDD35","\uD83D\uDFE3","\uD83D\uDFE1","\uD83D\uDFE0","\uD83D\uDD34","⚪","\uD83D\uDFE4"],h=0;function i(){let a=g[h%g.length];return h+=1,a}function j(a){if(!a)return i();let b=0,c=String(a);for(let a=0;a<c.length;a+=1)b=31*b+c.charCodeAt(a)|0;return g[Math.abs(b)%g.length]}function k(a,b,c){e>d.INFO||console.log(`[${f()}] ${a||"⚪"} ${b} ${c}`)}function l(a,b,c){console.log(`[${f()}] ${a||"⚪"} ${b} ${c}`)}function m(a){return a&&a.mode?"none"===a.mode?"off":"auto"===a.mode?"auto":"budget"===a.mode?a.budget>=1e3?`${Math.round(a.budget/1e3)}k`:`${a.budget}`:"level"===a.mode?a.level:null:null}function n(a){if(!a)return"";if("string"==typeof a)return a;try{return JSON.stringify(a)}catch{return String(a)}}function o(a,b,c){if(e<=d.DEBUG){let d=c?` ${n(c)}`:"";console.log(`[${f()}] 🔍 [${a}] ${b}${d}`)}}function p(a,b,c){if(e<=d.INFO){let d=c?` ${n(c)}`:"";console.log(`[${f()}] ℹ️ [${a}] ${b}${d}`)}}function q(a,b,c){if(e<=d.WARN){let d=c?` ${n(c)}`:"";console.warn(`[${f()}] ⚠️ [${a}] ${b}${d}`)}}function r(a,b,c){if(e<=d.ERROR){let d=c?` ${n(c)}`:"";console.log(`[${f()}] ❌ [${a}] ${b}${d}`)}}function s(a,b,c){let d=c?` ${n(c)}`:"";console.log(`\x1b[36m[${f()}] 📥 ${a} ${b}${d}\x1b[0m`)}function t(a,b,c){let d=c?` ${n(c)}`:"";console.log(`[${f()}] ${a<400?"\uD83D\uDCE4":"\uD83D\uDCA5"} ${a} (${b}ms)${d}`)}function u(a,b){let c=b?` ${n(b)}`:"";console.log(`[${f()}] 🌊 [STREAM] ${a}${c}`)}function v(a){return!a||a.length<8?"***":`${a.slice(0,4)}...${a.slice(-4)}`}},88164:(a,b,c)=>{"use strict";c.d(b,{L:()=>z});var d=c(69384),e=c(19458),f=c(30395),g=c(48991),h=c(43469),i=c(46956),j=c(11484),k=c(80015),l=c(42946);let m=["claude-code-20250219","oauth-2025-04-20","interleaved-thinking-2025-05-14","context-management-2025-06-27","prompt-caching-scope-2026-01-05","structured-outputs-2025-12-15","fast-mode-2026-02-01","redact-thinking-2026-02-12","token-efficient-tools-2026-03-28"],n=["advanced-tool-use-2025-11-20","effort-2025-11-24"];var o=c(69231),p=c(15059),q=c(13335),r=c(55511),s=c(74075);let t=["temperature","top_p","presence_penalty","frequency_penalty","stop","tool_choice","parallel_tool_calls","response_format"];function u(...a){return[...new Set(a.flatMap(a=>"string"==typeof a?a.split(","):[]).map(a=>a.trim()).filter(Boolean))].join(",")}function v(a){return a&&"object"==typeof a&&(a["anthropic-beta"]||a["Anthropic-Beta"])||""}function w(){return(0,r.randomUUID)().replace(/-/g,"")}function x(a,b,c="truncated for CodeBuddy"){if("string"!=typeof a||a.length<=b)return a;let d=Math.floor(.75*b),e=Math.max(0,b-d-c.length-12);return`${a.slice(0,d)}
1076
+ ${af(e.content)}`});continue}if("tool"===e.role){let a=af(e.content),d=e.tool_call_id||"",f=c.get(d)||{},g=e.name||f.name||"tool";b.push({role:"user",content:ah(g,d,a)});continue}if("user"===e.role||"assistant"===e.role){if("user"===e.role&&Array.isArray(e.content)){let a=[];for(let b of e.content)if(b&&"object"==typeof b){if("text"===b.type){"string"==typeof b.text&&a.push(b.text||"");continue}if("tool_result"===b.type){let d=b.tool_use_id||"",e=c.get(d)||c.get(ai(d)),f=e?.name||"tool",g=af(b.content);a.push(ah(f,d,g))}else{let c=af([b]);c&&a.push(c)}}let d=a.filter(Boolean).join("\n");d&&b.push({role:"user",content:d});continue}let a=af(e.content);if("assistant"===e.role&&e.tool_calls&&e.tool_calls.length>0){let c={role:"assistant",content:a||""};c.tool_calls=e.tool_calls.map(a=>{let{index:b,...c}=a||{};return c}),b.push(c)}else if("assistant"===e.role&&Array.isArray(e.content)){let c=e.content.filter(a=>a?.type==="tool_use").map(a=>({id:a.id||"",type:"function",function:{name:a.name||"tool",arguments:JSON.stringify(a.input||{})}})).filter(a=>a.id);c.length>0?b.push({role:"assistant",content:a||"",tool_calls:c}):a&&b.push({role:"assistant",content:a})}else a&&b.push({role:e.role,content:a})}}return b}(b.messages||[]),{user:f,metadata:g,tool_choice:h,stream_options:i,system:j,...k}=b;return{...k,messages:e,max_tokens:b.max_tokens??b.max_output_tokens??32e3}},null),(0,p.kz)(d.h.OPENAI,d.h.OLLAMA,function(a,b,c){let d={model:a,messages:function(a){if(!Array.isArray(a))return a;let b=[],c=new Map;for(let b of a)if("assistant"===b.role&&b.tool_calls)for(let a of b.tool_calls)a.id&&a.function?.name&&c.set(a.id,a.function.name);for(let d of a){if("tool"===d.role){let a=aj(d.content);if(!a)continue;let e=c.get(d.tool_call_id)||d.name||"unknown_tool";b.push({role:"tool",tool_name:e,content:a});continue}if("assistant"===d.role&&d.tool_calls){let a=aj(d.content)||"",c=d.tool_calls.map(a=>({type:"function",function:{index:a.index||0,name:a.function?.name||"",arguments:function(a){if("string"!=typeof a)return a||{};try{return JSON.parse(a||"{}")}catch{return{}}}(a.function?.arguments)}}));b.push({role:"assistant",content:a,tool_calls:c});continue}let a=d.role,e=aj(d.content),f=function(a){if(!Array.isArray(a))return[];let b=[];for(let c of a){if(!c||"image_url"!==c.type)continue;let a="string"==typeof c.image_url?c.image_url:c.image_url?.url;if("string"!=typeof a||!a)continue;let d=a.match(/^data:[^;]+;base64,([\s\S]+)$/);d&&b.push(d[1])}return b}(d.content);if(!e&&"assistant"!==a)continue;let g={role:a,content:e};f.length>0&&(g.images=f),b.push(g)}return b}(b.messages),stream:c};return void 0!==b.temperature&&(d.options=d.options||{},d.options.temperature=b.temperature),void 0!==b.max_tokens&&(d.options=d.options||{},d.options.num_predict=b.max_tokens),void 0!==b.top_p&&(d.options=d.options||{},d.options.top_p=b.top_p),b.tools&&Array.isArray(b.tools)&&(d.tools=b.tools),b.tool_choice&&(d.tool_choice=b.tool_choice),d},null);var ak=c(44282);function al(a){if(null==a)return"";if("string"==typeof a)return a;if(Array.isArray(a)){let b=[];for(let c of a)"string"==typeof c?b.push(c):c&&"object"==typeof c&&"string"==typeof c.text&&b.push(c.text);return b.join("\n")}return String(a)}(0,p.kz)(d.h.OPENAI,d.h.COMMANDCODE,function(a,b,c,d){let{messages:e,system:f}=function(a=[]){let b=[],c=[];for(let d of a){if(!d)continue;let a=d.role;if("system"===a){let a=al(d.content);a&&c.push(a);continue}if("tool"===a){let a="string"==typeof d.content?d.content:al(d.content);b.push({role:"tool",content:[{type:"tool-result",toolCallId:d.tool_call_id||"",toolName:d.name||"",output:{type:"text",value:a}}]});continue}if("assistant"===a){let a=[],c=al(d.content);if(c&&a.push({type:"text",text:c}),Array.isArray(d.tool_calls))for(let b of d.tool_calls){let c=b.function||{};a.push({type:"tool-call",toolCallId:b.id||"",toolName:c.name||"",input:function(a){if(null==a)return{};if("string"!=typeof a)return a;try{return JSON.parse(a)}catch{return{_raw:a}}}(c.arguments)})}b.push({role:"assistant",content:a.length?a:[{type:"text",text:""}]});continue}b.push({role:"user",content:function(a){if(null==a)return[{type:"text",text:""}];if("string"==typeof a)return[{type:"text",text:a}];if(Array.isArray(a)){let b=[];for(let c of a)if("string"==typeof c)b.push({type:"text",text:c});else if(c&&"object"==typeof c)if("text"===c.type&&"string"==typeof c.text)b.push({type:"text",text:c.text});else if("image_url"===c.type){let a="string"==typeof c.image_url?c.image_url:c.image_url?.url;a&&b.push({type:"image",image:a})}else if("image"===c.type&&c.source)if("base64"===c.source.type&&c.source.data){let a=c.source.media_type||"image/png";b.push({type:"image",image:`data:${a};base64,${c.source.data}`})}else"url"===c.source.type&&c.source.url&&b.push({type:"image",image:c.source.url});else"string"==typeof c.text&&b.push({type:"text",text:c.text});return b.length?b:[{type:"text",text:""}]}return[{type:"text",text:String(a)}]}(d.content)})}return{messages:b,system:c.join("\n\n")}}(b.messages),g={model:a,messages:e,stream:!1!==c,max_tokens:b.max_tokens??b.max_output_tokens??64e3,temperature:b.temperature??.3};f&&(g.system=f);let h=function(a){if(!Array.isArray(a)||0===a.length)return;let b=[];for(let c of a)c&&("function"===c.type&&c.function?b.push({name:c.function.name,description:c.function.description,input_schema:c.function.parameters||{type:"object"}}):c.name&&(c.input_schema||c.parameters)&&b.push({name:c.name,description:c.description,input_schema:c.input_schema||c.parameters}));return b.length?b:void 0}(b.tools);h&&(g.tools=h),null!=b.top_p&&(g.top_p=b.top_p);let i=new Date().toISOString().slice(0,10);return{threadId:(0,ak.VR)(d?._clientSessionId),memory:"",config:{workingDir:ak.Ie,date:i,environment:process.platform,structure:[],isGitRepo:!1,currentBranch:"",mainBranch:"",gitStatus:"",recentCommits:[]},params:g}},null),c(41222);var am=c(57861);let an="proxy_";function ao(a,b){a.thinkingBlockStarted&&(b.push({type:"content_block_stop",index:a.thinkingBlockIndex}),a.thinkingBlockStarted=!1)}function ap(a,b){a.textBlockStarted&&!a.textBlockClosed&&(a.textBlockClosed=!0,b.push({type:"content_block_stop",index:a.textBlockIndex}),a.textBlockStarted=!1)}function aq(a,b){let c="number"==typeof a.prompt_tokens?a.prompt_tokens:0,d="number"==typeof a.completion_tokens?a.completion_tokens:0,e=a.prompt_tokens_details?.cached_tokens,f=a.prompt_tokens_details?.cache_creation_tokens,g="number"==typeof e?e:0,h="number"==typeof f?f:0;b.usage={input_tokens:c-g-h,output_tokens:d},g>0&&(b.usage.cache_read_input_tokens=g),h>0&&(b.usage.cache_creation_input_tokens=h)}function ar(a,b){a.pendingStopReason&&(b.push({type:"message_delta",delta:{stop_reason:a.pendingStopReason},usage:a.usage||{input_tokens:0,output_tokens:0}}),b.push({type:"message_stop"}),a.pendingStopReason=null)}function as(a,b){if(!a){let a=[];return ar(b,a),a.length>0?a:null}if(!a.choices?.[0]){if(!a.usage||"object"!=typeof a.usage)return null;aq(a.usage,b);let c=[];return ar(b,c),c.length>0?c:null}let c=[],d=a.choices[0],e=d.delta;a.usage&&"object"==typeof a.usage&&aq(a.usage,b),b.messageStartSent||(b.messageStartSent=!0,b.messageId=a.id?.replace("chatcmpl-","")||`msg_${Date.now()}`,(!b.messageId||"chat"===b.messageId||b.messageId.length<8)&&(b.messageId=a.extend_fields?.requestId||a.extend_fields?.traceId||`msg_${Date.now()}`),b.model=a.model||"unknown",b.nextBlockIndex=0,c.push({type:"message_start",message:{id:b.messageId,type:"message",role:"assistant",model:b.model,content:[],stop_reason:null,stop_sequence:null,usage:{input_tokens:0,output_tokens:0}}}));let f=(0,am.V)(e);if(f&&(ap(b,c),b.thinkingBlockStarted||(b.thinkingBlockIndex=b.nextBlockIndex++,b.thinkingBlockStarted=!0,c.push({type:"content_block_start",index:b.thinkingBlockIndex,content_block:{type:"thinking",thinking:""}})),c.push({type:"content_block_delta",index:b.thinkingBlockIndex,delta:{type:"thinking_delta",thinking:f}})),e?.content&&(ao(b,c),b.textBlockStarted||(b.textBlockIndex=b.nextBlockIndex++,b.textBlockStarted=!0,b.textBlockClosed=!1,c.push({type:"content_block_start",index:b.textBlockIndex,content_block:{type:"text",text:""}})),c.push({type:"content_block_delta",index:b.textBlockIndex,delta:{type:"text_delta",text:e.content}})),e?.tool_calls)for(let a of e.tool_calls){let d=a.index??0;if(a.id){ao(b,c),ap(b,c);let e=b.nextBlockIndex++;b.toolCalls.set(d,{id:a.id,name:a.function?.name||"",blockIndex:e});let f=a.function?.name||"";f.startsWith(an)&&(f=f.slice(an.length)),c.push({type:"content_block_start",index:e,content_block:{type:"tool_use",id:a.id,name:f,input:{}}})}a.function?.arguments&&b.toolCalls.get(d)&&(b.toolArgBuffers||(b.toolArgBuffers=new Map),b.toolArgBuffers.set(d,(b.toolArgBuffers.get(d)||"")+a.function.arguments))}if(d.finish_reason){for(let[a,d]of(ao(b,c),ap(b,c),b.toolCalls)){let e=b.toolArgBuffers?.get(a);if(e){let a=function(a,b){try{let c=JSON.parse(b),d=a.startsWith(an)?a.slice(an.length):a;return"Read"===d&&function(a){var b,c;"string"==typeof a.limit&&/^\d+$/.test(a.limit)&&(a.limit=Number(a.limit)),"string"==typeof a.offset&&/^-?\d+$/.test(a.offset)&&(a.offset=Number(a.offset)),"number"==typeof a.limit&&(a.limit>2e3&&(a.limit=2e3),a.limit<1&&delete a.limit),"number"==typeof a.offset&&a.offset<0&&(a.offset=0),"pages"in a&&(b=a.file_path,c=a.pages,!("string"==typeof b&&b.toLowerCase().endsWith(".pdf")&&"string"==typeof c&&/^\d+(?:-\d+)?$/.test(c)))&&delete a.pages}(c),JSON.stringify(c)}catch{return b}}(d.name,e);c.push({type:"content_block_delta",index:d.blockIndex,delta:{type:"input_json_delta",partial_json:a}})}c.push({type:"content_block_stop",index:d.blockIndex})}b.finishReason=d.finish_reason,b.pendingStopReason=function(a){switch(a){case"stop":default:return"end_turn";case"length":return"max_tokens";case"tool_calls":return"tool_use"}}(d.finish_reason),b.usage&&ar(b,c)}return c.length>0?c:null}function at(a){let b={promptTokenCount:a.prompt_tokens||0,candidatesTokenCount:a.completion_tokens||0,totalTokenCount:a.total_tokens||0};return a.completion_tokens_details?.reasoning_tokens&&(b.thoughtsTokenCount=a.completion_tokens_details.reasoning_tokens),a.prompt_tokens_details?.cached_tokens&&(b.cachedContentTokenCount=a.prompt_tokens_details.cached_tokens),b}function au(a){return"number"==typeof a&&Number.isFinite(a)?a:void 0}function av(a,b,c,i,k=!0,q=null,r=null,s=null,t=[],u=null,v=null,w=q?.runtimeTransport||null){let x=function(a){if(Array.isArray(a?.messages))return a.messages[a.messages.length-1]?.role;let b=Array.isArray(a?.contents)?a.contents:Array.isArray(a?.input)?a.input:null;if(!b)return;let c=b[b.length-1]?.role;return"assistant"===c||"model"===c?"assistant":void 0}(i),y=i;if(!function(a,b=[]){if(!b.length||!a.messages||!Array.isArray(a.messages))return;let c=new Set(["image_url","image"]),d=new Set(["audio_url","input_audio"]),e=a=>c.has(a)?b.includes("image"):!!d.has(a)&&b.includes("audio");for(let b of a.messages)Array.isArray(b.content)&&(b.content=b.content.filter(a=>!e(a.type)),0===b.content.length&&(b.content=""))}(y,t),(0,n.SZ)(y),!function(a){if(a.messages&&Array.isArray(a.messages))for(let b=0;b<a.messages.length;b++){let c=a.messages[b];if("assistant"===c.role&&c.tool_calls&&Array.isArray(c.tool_calls))for(let a=0;a<c.tool_calls.length;a++){let d=c.tool_calls[a];if(!d.id||!e.test(d.id)){let c=g(d.id);d.id=c||f(b,a,d.function?.name)}d.type||(d.type="function"),d.function?.arguments&&"string"!=typeof d.function.arguments&&(d.function.arguments=JSON.stringify(d.function.arguments))}if("tool"===c.role&&c.tool_call_id&&!e.test(c.tool_call_id)){let a=g(c.tool_call_id);c.tool_call_id=a||f(b,0)}if(Array.isArray(c.content))for(let a=0;a<c.content.length;a++){let d=c.content[a];if("tool_use"===d.type&&d.id&&!e.test(d.id)){let c=g(d.id);d.id=c||f(b,a,d.name)}if("tool_result"===d.type&&d.tool_use_id&&!e.test(d.tool_use_id)){let c=g(d.tool_use_id);d.tool_use_id=c||f(b,a)}}}}(y),!function(a){if(!a.messages||!Array.isArray(a.messages))return;let b=[];for(let c=0;c<a.messages.length;c++){let d=a.messages[c],e=a.messages[c+1];b.push(d);let f=function(a){if("assistant"!==a.role)return[];let b=[];if(a.tool_calls&&Array.isArray(a.tool_calls))for(let c of a.tool_calls)c.id&&b.push(c.id);if(Array.isArray(a.content))for(let c of a.content)"tool_use"===c.type&&c.id&&b.push(c.id);return b}(d);if(0!==f.length&&e&&!function(a,b){if(!a||!b.length)return!1;if("tool"===a.role&&a.tool_call_id)return b.includes(a.tool_call_id);if("user"===a.role&&Array.isArray(a.content)){for(let c of a.content)if("tool_result"===c.type&&b.includes(c.tool_use_id))return!0}return!1}(e,f))for(let a of f)b.push({role:"tool",tool_call_id:a,content:""})}a.messages=b}(y),q&&(b===d.h.ANTIGRAVITY||b===d.h.COMMANDCODE||"commandcode"===r)&&(q._clientSessionId=(0,o.YC)(y,q,u,b)),a!==b){let e=a!==d.h.OPENAI&&b!==d.h.OPENAI?p.rV.get(`${a}:${b}`):null;if(e)y=e(c,y,k,q,r);else{if(a!==d.h.OPENAI){let b=p.rV.get(`${a}:${d.h.OPENAI}`);b&&(y=b(c,y,k,q),s?.logOpenAIRequest?.(y))}if(b!==d.h.OPENAI){let a=p.rV.get(`${d.h.OPENAI}:${b}`);a&&(y=a(c,y,k,q,r))}}}if(b===d.h.OPENAI&&(y=function(a,b={}){if(!a.messages||!Array.isArray(a.messages))return a;let c=!!b.preserveCacheControl;function d(a){let{signature:b,cache_control:d,...e}=a;return c&&d?{...e,cache_control:d}:e}if(a.messages=a.messages.map(a=>{if("developer"===a.role&&(a={...a,role:"system"}),"tool"===a.role||"assistant"===a.role&&a.tool_calls||"string"==typeof a.content)return a;if(Array.isArray(a.content)){let b=[];for(let c of a.content)if("thinking"!==c.type&&"redacted_thinking"!==c.type)if(l.includes(c.type))b.push(d(c));else{if("tool_use"===c.type)continue;"tool_result"===c.type&&b.push(d(c))}return 0===b.length&&b.push({type:"text",text:""}),{...a,content:b}}return a}),a.messages=a.messages.filter(a=>"tool"===a.role||"assistant"===a.role&&!!a.tool_calls||("string"==typeof a.content?""!==a.content.trim():!Array.isArray(a.content)||a.content.some(a=>"text"===a.type&&a.text?.trim()||"text"!==a.type))),a.tools&&Array.isArray(a.tools)&&0===a.tools.length&&delete a.tools,a.tools&&Array.isArray(a.tools)&&a.tools.length>0&&(a.tools=a.tools.map(a=>"function"===a.type&&a.function?a:a.name&&(a.input_schema||a.description)?{type:"function",function:{name:a.name,description:String(a.description||""),parameters:a.input_schema||{type:"object",properties:{}}}}:a.functionDeclarations&&Array.isArray(a.functionDeclarations)?a.functionDeclarations.map(a=>({type:"function",function:{name:a.name,description:String(a.description||""),parameters:a.parameters||{type:"object",properties:{}}}})):a).flat()),a.tool_choice&&"object"==typeof a.tool_choice){let b=a.tool_choice;"auto"===b.type?a.tool_choice="auto":"any"===b.type?a.tool_choice="required":"tool"===b.type&&b.name&&(a.tool_choice={type:"function",function:{name:b.name}})}return a}(y,{preserveCacheControl:!!m.xq[r]?.quirks?.preserveCacheControl}),("github"===r||"gh"===r)&&a===d.h.CLAUDE&&i?.thinking?.type==="disabled"&&y&&!y.thinking&&(y={...y,thinking:{type:"disabled"}})),b===d.h.CLAUDE){let a=q?.accessToken||q?.apiKey||null;y=(0,h.Bz)(y,r,a,u,w||{},c),Array.isArray(y?.messages)&&(y.messages=(0,h.HU)(y.messages,x))}if("claude"===r){let a=q?.accessToken||q?.apiKey||null;if(a?.includes("sk-ant-oat")){let{body:a,toolNameMap:b}=(0,j.Az)(y);y=a,b?.size>0&&(y._toolNameMap=b)}}return y}function aw(a,b){return b?.toolNameMap?.size&&a&&"object"==typeof a?(0,k.HR)(a,b.toolNameMap):a}function ax(a,b){if(!b?.toolNameMap?.size||!Array.isArray(a))return a;let c=a.map(a=>aw(a,b));return a._openaiIntermediate&&(c._openaiIntermediate=a._openaiIntermediate),c}function ay(a,b,c,e){if(e&&b===d.h.OPENAI_RESPONSES&&a===d.h.OPENAI&&(e.deferResponsesCompletion=!0),b===a)return e&&c&&"object"==typeof c&&(e.streamToolCallIds||(e.streamToolCallIds=new Map),(0,i.RW)(c,e.streamToolCallIds)),[aw((0,j.F5)(c,e?.toolNameMap),e)];let f=[c],g=null,h=a!==d.h.OPENAI&&b!==d.h.OPENAI?p.hi.get(`${a}:${b}`):null;if(h){let a=h(c,e);return a?ax(Array.isArray(a)?a:[a],e):[]}if(a!==d.h.OPENAI){let b=p.hi.get(`${a}:${d.h.OPENAI}`);if(b){f=[];let a=b(c,e);a&&(g=f=Array.isArray(a)?a:[a])}}if(b!==d.h.OPENAI){let g=p.hi.get(`${d.h.OPENAI}:${b}`);if(g){let b=[];for(let h of null===c&&a!==d.h.OPENAI?[...f,null]:f){let a=g(h,e);a&&b.push(...Array.isArray(a)?a:[a])}f=b}}return g&&b!==d.h.OPENAI&&a!==d.h.OPENAI&&(f._openaiIntermediate=g),ax(f,e)}function az(a){let b={messageId:null,model:null,textBlockStarted:!1,thinkingBlockStarted:!1,inThinkingBlock:!1,currentBlockIndex:null,toolCalls:new Map,finishReason:null,finishReasonSent:!1,usage:null,contentBlockIndex:-1};return a===d.h.OPENAI_RESPONSES?{...b,seq:0,responseId:`resp_${Date.now()}`,created:Math.floor(Date.now()/1e3),started:!1,nextOutputIndex:0,msgTextBuf:{},msgItemAdded:{},msgContentAdded:{},msgItemDone:{},msgOutputIndices:{},reasoningId:"",reasoningIndex:-1,reasoningBuf:"",reasoningPartAdded:!1,reasoningDone:!1,inThinking:!1,funcArgsBuf:{},funcNames:{},funcTypes:{},funcCallIds:{},funcItemAdded:{},funcArgsDone:{},funcItemDone:{},funcOutputIndices:{},completedSent:!1,responsesUsage:null,completionPending:!1}:b}(0,p.kz)(d.h.OPENAI,d.h.CLAUDE,null,as),c(28113),(0,p.kz)(d.h.OPENAI,d.h.ANTIGRAVITY,null,function(a,b){if(!a)return null;let c=a.choices?.[0];if(!c)return a.usage?(b._usage=a.usage,{response:{candidates:[],modelVersion:b._modelVersion||a.model||"",responseId:b._responseId||a.id||`resp_${Date.now()}`,usageMetadata:at(a.usage)}}):null;let d=c.delta||{},e=c.finish_reason;b._toolCallAccum||(b._toolCallAccum={}),b._responseId||(b._responseId=a.id||`resp_${Date.now()}`),b._modelVersion||(b._modelVersion=a.model||"");let f=[],g=(0,am.V)(d);if(g&&f.push({thought:!0,text:g}),d.content&&f.push({text:d.content}),d.tool_calls){for(let a of d.tool_calls){let c=a.index??0;b._toolCallAccum[c]||(b._toolCallAccum[c]={id:"",name:"",arguments:""});let d=b._toolCallAccum[c];a.id&&(d.id=a.id),a.function?.name&&(d.name+=a.function.name),a.function?.arguments&&(d.arguments+=a.function.arguments)}if(0===f.length&&!e)return null}if(e)for(let a of Object.keys(b._toolCallAccum)){let c=b._toolCallAccum[a],d={};try{d=JSON.parse(c.arguments)}catch{}let e=b.toolNameMap?.get(c.name)||c.name;f.push({functionCall:{name:e,args:d}})}if(0===f.length&&!e)return null;0===f.length&&e&&f.push({text:""});let h={content:{role:"model",parts:f}};e&&(h.finishReason=({stop:"STOP",length:"MAX_TOKENS",tool_calls:"STOP",content_filter:"SAFETY"})[e]||"STOP");let i={candidates:[h],modelVersion:b._modelVersion,responseId:b._responseId},j=a.usage||b._usage;return j&&(i.usageMetadata=at(j)),{response:i}}),c(56248),(0,p.kz)(d.h.KIRO,d.h.OPENAI,null,function(a,b){if(!a)return null;if("chat.completion.chunk"===a.object&&a.choices)return a;let c=a;if("string"==typeof a){let b=a.split("\n"),d="",e="";for(let a of b)a.startsWith("event:")?d=a.slice(6).trim():a.startsWith(":event-type:")?d=a.slice(12).trim():a.startsWith("data:")?e=a.slice(5).trim():a.startsWith(":content-type:")||a.trim()&&!a.startsWith(":")&&(e=a.trim());if(!e)return null;try{(c=JSON.parse(e))._eventType=d}catch{c={text:e,_eventType:d}}}b.responseId||(b.responseId=`chatcmpl-${Date.now()}`,b.created=Math.floor(Date.now()/1e3),b.chunkIndex=0);let d=c._eventType||c.event||"";if("assistantResponseEvent"===d||c.assistantResponseEvent){let a=c.assistantResponseEvent?.content||c.content||"";if(!a)return null;let d={id:b.responseId,object:"chat.completion.chunk",created:b.created,model:b.model||"kiro",choices:[{index:0,delta:{...0===b.chunkIndex?{role:"assistant"}:{},content:a},finish_reason:null}]};return b.chunkIndex++,d}if("reasoningContentEvent"===d||c.reasoningContentEvent){let a=c.reasoningContentEvent||c,d="string"==typeof a?a:a.text||a.content||c.content||"";if(!d)return null;let e={id:b.responseId,object:"chat.completion.chunk",created:b.created,model:b.model||"kiro",choices:[{index:0,delta:{...0===b.chunkIndex?{role:"assistant"}:{},reasoning_content:d},finish_reason:null}]};return b.chunkIndex++,e}if("toolUseEvent"===d||c.toolUseEvent){let a=c.toolUseEvent||c,d=a.toolUseId||`call_${Date.now()}`,e=a.name||"",f=b.toolNameMap?.get(e)||e,g=a.input||{},h={id:b.responseId,object:"chat.completion.chunk",created:b.created,model:b.model||"kiro",choices:[{index:0,delta:{...0===b.chunkIndex?{role:"assistant"}:{},tool_calls:[{index:0,id:d,type:"function",function:{name:f,arguments:JSON.stringify(g)}}]},finish_reason:null}]};return b.chunkIndex++,h}if("messageStopEvent"===d||"done"===d||c.messageStopEvent){b.finishReason="stop";let a={id:b.responseId,object:"chat.completion.chunk",created:b.created,model:b.model||"kiro",choices:[{index:0,delta:{},finish_reason:"stop"}]};return b.usage&&"object"==typeof b.usage&&(a.usage=b.usage),a}if("usageEvent"===d||c.usageEvent){let a=c.usageEvent||c;a&&"object"==typeof a&&(b.usage={prompt_tokens:a.inputTokens||0,completion_tokens:a.outputTokens||0,total_tokens:(a.inputTokens||0)+(a.outputTokens||0)})}return null}),(0,p.kz)(d.h.KIRO,d.h.CLAUDE,null,function(a,b){let c=a&&"object"==typeof a?a.usage:null,d=as(a,b),e=function(a){if(!a||"object"!=typeof a)return null;let b=au(a.prompt_tokens),c=au(a.completion_tokens);if(void 0===b&&void 0===c)return null;let d=au(a.cache_read_input_tokens)??au(a.prompt_tokens_details?.cached_tokens),e=au(a.cache_creation_input_tokens)??au(a.prompt_tokens_details?.cache_creation_tokens);return{input_tokens:b||0,output_tokens:c||0,...void 0!==d?{cache_read_input_tokens:d}:{},...void 0!==e?{cache_creation_input_tokens:e}:{}}}(c);if(e&&(b.usage=e),!d)return d;let f=Array.isArray(d)?d:[d];return e?f.map(a=>a?.type==="message_delta"?{...a,usage:e}:a):f}),(0,p.kz)(d.h.CURSOR,d.h.OPENAI,null,function(a,b){return a?("chat.completion.chunk"===a.object&&a.choices||"chat.completion"===a.object&&a.choices,a):null}),c(23242),c(65294)},86625:(a,b,c)=>{"use strict";let{promisify:d}=c(57975),e=c(35689),{buildMockDispatch:f}=c(70634),{kDispatches:g,kMockAgent:h,kClose:i,kOriginalClose:j,kOrigin:k,kOriginalDispatch:l,kConnected:m,kIgnoreTrailingSlash:n}=c(80830),{MockInterceptor:o}=c(55720),p=c(49176),{InvalidArgumentError:q}=c(61448);class r extends e{constructor(a,b){if(!b||!b.agent||"function"!=typeof b.agent.dispatch)throw new q("Argument opts.agent must implement Agent");super(a,b),this[h]=b.agent,this[k]=a,this[n]=b.ignoreTrailingSlash??!1,this[g]=[],this[m]=1,this[l]=this.dispatch,this[j]=this.close.bind(this),this.dispatch=f.call(this),this.close=this[i]}get[p.kConnected](){return this[m]}intercept(a){return new o(a&&{ignoreTrailingSlash:this[n],...a},this[g])}cleanMocks(){this[g]=[]}async [i](){await d(this[j])(),this[m]=0,this[h][p.kClients].delete(this[k])}}a.exports=r},86767:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{EW:()=>j,UT:()=>k});var e=c(70321),f=c(21263),g=a([f]);f=(g.then?(await g)():g)[0],globalThis._quotaRefreshState||(globalThis._quotaRefreshState={started:!1,startTimer:null,timer:null,running:!1,runningPromise:null});let l=globalThis._quotaRefreshState;async function h(a,b={}){return(await (0,f.J4)({connections:a,force:!0===b.force,...void 0!==b.concurrency?{concurrency:b.concurrency}:{},...b.resolveUsage?{resolveUsage:b.resolveUsage}:{},replaceAccounts:!1,retainWithoutSubscribers:!0})).attempted}function i(){if(l.runningPromise)return l.runningPromise;l.running=!0;let a=(async()=>{let a=[];try{a=await (0,e.getProviderConnections)({isActive:!0})}catch(a){console.warn(`[QuotaRefresh] failed to list connections: ${a.message}`);return}await h(a)})().finally(()=>{l.runningPromise===a&&(l.runningPromise=null,l.running=!1)});return l.runningPromise=a,a}function j(){!l.started&&(l.started=!0,l.startTimer=setTimeout(()=>{l.startTimer=null,i(),l.timer=setInterval(()=>void i(),3e5),l.timer.unref&&l.timer.unref()},15e3),l.startTimer.unref&&l.startTimer.unref())}function k(){return l.startTimer&&clearTimeout(l.startTimer),l.timer&&clearInterval(l.timer),l.startTimer=null,l.timer=null,l.started=!1,l.runningPromise||Promise.resolve()}l.runningPromise??=null,d()}catch(a){d(a)}})},87085:(a,b,c)=>{"use strict";let{InvalidArgumentError:d,RequestAbortedError:e}=c(61448),f=c(83204);class g extends f{#am=1048576;#cq=!1;#aL=0;aborted=!1;reason=!1;constructor({maxSize:a,signal:b},c){if(null!=a&&(!Number.isFinite(a)||a<1))throw new d("maxSize must be a number greater than 0");super(c),this.#am=a??this.#am}#ck(a){this.aborted=!0,this.reason=a}onRequestStart(a,b){return a.abort=this.#ck.bind(this),super.onRequestStart(a,b)}onResponseStart(a,b,c,d){let f=c["content-length"];if(null!=f&&f>this.#am)throw new e(`Response size (${f}) larger than maxSize (${this.#am})`);return!0===this.aborted||super.onResponseStart(a,b,c,d)}onResponseError(a,b){super.onResponseError(a,!0===this.aborted?this.reason:b)}onResponseData(a,b){if(this.#aL=this.#aL+b.length,this.#aL>this.#am)throw new e(`Response size (${this.#aL}) larger than maxSize (${this.#am})`);return this.#aL===this.#am&&(this.#cq=!0),!0}onResponseEnd(a,b){!0===this.aborted?super.onResponseError(a,this.reason):super.onResponseEnd(a,this.#cq?{}:b)}}a.exports=function({maxSize:a}={maxSize:1048576}){return b=>function(c,d){let{dumpMaxSize:e=a}=c,f=new g({maxSize:e,signal:c.signal},d);return b(c,f)}}},87404:(a,b,c)=>{"use strict";let d,{webidl:e}=c(32984),{validateCloseCodeAndReason:f}=c(94050),{kConstruct:g}=c(49176),{kEnumerableProperty:h}=c(84285);function i(){class a extends DOMException{get reason(){return""}}return void 0!==new a().reason?DOMException:new Proxy(DOMException,{construct(a,b,c){let d=Reflect.construct(a,b,a);return Object.setPrototypeOf(d,c.prototype),d}})}class j extends i(){#cr;#cj;constructor(a="",b){if(super(a=e.converters.DOMString(a,"WebSocketError","message"),"WebSocketError"),b===g)return;null!==b&&(b=e.converters.WebSocketCloseInfo(b));let c=b.closeCode??null,d=b.reason??"";f(c,d),0!==d.length&&null===c&&(c=1e3),this.#cr=c,this.#cj=d}get closeCode(){return this.#cr}get reason(){return this.#cj}static{d=(a,b,c)=>{let d=new j(a,g);return d.#cr=b,d.#cj=c,d},e.is.WebSocketError=a=>null!=a&&"object"==typeof a&&#cj in a}}Object.defineProperties(j.prototype,{closeCode:h,reason:h,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}}),a.exports={WebSocketError:j,createUnvalidatedWebSocketError:d}},87585:a=>{"use strict";let b=[{open:"<thinking>",close:"</thinking>"},{open:"<think>",close:"</think>"}];function c(a,b,c){if(!c)return;let d=a[a.length-1];d?.type===b?d.text+=c:a.push({type:b,text:c})}function d(a,b){let c=a.toLowerCase(),d=0;for(let a of b){let b=Math.min(c.length,a.length-1);for(let e=b;e>d;e--)if(c.endsWith(a.slice(0,e))){d=e;break}}return d}a.exports={createTaggedThinkingState:function(){return{mode:"text",closeTag:null,buffer:""}},flushTaggedThinking:function(a){if(!a)return[];let b=[];return c(b,"reasoning"===a.mode?"reasoning":"text",a.buffer),a.mode="text",a.closeTag=null,a.buffer="",b},pushTaggedThinking:function(a,e){if(!a||"string"!=typeof e||0===e.length)return[];a.buffer+=e;let f=[];for(;a.buffer;){let e=a.buffer.toLowerCase();if("text"===a.mode){let g=null;for(let a of b){let b=e.indexOf(a.open);b>=0&&(!g||b<g.index)&&(g={...a,index:b})}if(g){c(f,"text",a.buffer.slice(0,g.index)),a.buffer=a.buffer.slice(g.index+g.open.length),a.mode="reasoning",a.closeTag=g.close;continue}let h=d(a.buffer,b.map(a=>a.open));c(f,"text",a.buffer.slice(0,a.buffer.length-h)),a.buffer=h?a.buffer.slice(-h):"";break}let g=a.closeTag||"</thinking>",h=e.indexOf(g);if(h>=0){c(f,"reasoning",a.buffer.slice(0,h)),a.buffer=a.buffer.slice(h+g.length),a.mode="text",a.closeTag=null;continue}let i=d(a.buffer,[g]);c(f,"reasoning",a.buffer.slice(0,a.buffer.length-i)),a.buffer=i?a.buffer.slice(-i):"";break}return f}}},87792:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"minimax-code",priority:80,alias:"mm",display:{name:"MiniMax Code",icon:"smart_toy",color:"#FF4D4F",textIcon:"MM",website:"https://agent.minimax.cn"},category:"oauth",authModes:["oauth"],hasOAuth:!0,features:{usage:!0},modelsFetcher:{url:"https://agent.minimax.cn/mavis/api/v1/models?region=cn&buildEnv=prod",type:"minimax-code"},transport:{baseUrl:"https://agent.minimax.cn/mavis/api/v1/llm/v1/messages",format:"claude",thinkingFormat:"claude-adaptive",headers:{"User-Agent":"MiniMaxAgent","X-Mavis-Agent-Id":"main"},auth:{combined:!0,header:"Authorization",scheme:"bearer",anthropicVersion:!0,hooks:["minimaxHeaders"]}},oauth:{clientId:"mcode-public",deviceUrl:"https://account.minimax.cn/oauth2/device/code",tokenUrl:"https://account.minimax.cn/oauth2/token",scope:"agent.default",audience:"agent-backend",refreshLeadMs:6e5},models:[{id:"MiniMax-M3.1-Flash-Preview",name:"MiniMax M3.1 Flash Preview"},{id:"MiniMax-M3",name:"MiniMax M3"},{id:"MiniMax-M2.7",name:"MiniMax M2.7"},{id:"MiniMax-M2.7-highspeed",name:"MiniMax M2.7 Highspeed"}],serviceKinds:["llm"]}},87886:(a,b,c)=>{"use strict";c.r(b),c.d(b,{debug:()=>o,error:()=>r,errorLine:()=>l,fmtThink:()=>m,info:()=>p,line:()=>k,maskKey:()=>v,nextTag:()=>i,request:()=>s,response:()=>t,stream:()=>u,tagForSession:()=>j,warn:()=>q});let d={DEBUG:0,INFO:1,WARN:2,ERROR:3},e=d[process.env.LOG_LEVEL?.toUpperCase?.()]??d.INFO;function f(){return new Date().toLocaleTimeString("en-US",{hour12:!1})}let g=["\uD83D\uDFE2","\uD83D\uDD35","\uD83D\uDFE3","\uD83D\uDFE1","\uD83D\uDFE0","\uD83D\uDD34","⚪","\uD83D\uDFE4"],h=0;function i(){let a=g[h%g.length];return h+=1,a}function j(a){if(!a)return i();let b=0,c=String(a);for(let a=0;a<c.length;a+=1)b=31*b+c.charCodeAt(a)|0;return g[Math.abs(b)%g.length]}function k(a,b,c){e>d.INFO||console.log(`[${f()}] ${a||"⚪"} ${b} ${c}`)}function l(a,b,c){console.log(`[${f()}] ${a||"⚪"} ${b} ${c}`)}function m(a){return a&&a.mode?"none"===a.mode?"off":"auto"===a.mode?"auto":"budget"===a.mode?a.budget>=1e3?`${Math.round(a.budget/1e3)}k`:`${a.budget}`:"level"===a.mode?a.level:null:null}function n(a){if(!a)return"";if("string"==typeof a)return a;try{return JSON.stringify(a)}catch{return String(a)}}function o(a,b,c){if(e<=d.DEBUG){let d=c?` ${n(c)}`:"";console.log(`[${f()}] 🔍 [${a}] ${b}${d}`)}}function p(a,b,c){if(e<=d.INFO){let d=c?` ${n(c)}`:"";console.log(`[${f()}] ℹ️ [${a}] ${b}${d}`)}}function q(a,b,c){if(e<=d.WARN){let d=c?` ${n(c)}`:"";console.warn(`[${f()}] ⚠️ [${a}] ${b}${d}`)}}function r(a,b,c){if(e<=d.ERROR){let d=c?` ${n(c)}`:"";console.log(`[${f()}] ❌ [${a}] ${b}${d}`)}}function s(a,b,c){let d=c?` ${n(c)}`:"";console.log(`\x1b[36m[${f()}] 📥 ${a} ${b}${d}\x1b[0m`)}function t(a,b,c){let d=c?` ${n(c)}`:"";console.log(`[${f()}] ${a<400?"\uD83D\uDCE4":"\uD83D\uDCA5"} ${a} (${b}ms)${d}`)}function u(a,b){let c=b?` ${n(b)}`:"";console.log(`[${f()}] 🌊 [STREAM] ${a}${c}`)}function v(a){return!a||a.length<8?"***":`${a.slice(0,4)}...${a.slice(-4)}`}},88164:(a,b,c)=>{"use strict";c.d(b,{L:()=>z});var d=c(69384),e=c(19458),f=c(30395),g=c(48991),h=c(43469),i=c(46956),j=c(11484),k=c(80015),l=c(42946);let m=["claude-code-20250219","oauth-2025-04-20","interleaved-thinking-2025-05-14","context-management-2025-06-27","prompt-caching-scope-2026-01-05","structured-outputs-2025-12-15","fast-mode-2026-02-01","redact-thinking-2026-02-12","token-efficient-tools-2026-03-28"],n=["advanced-tool-use-2025-11-20","effort-2025-11-24"];var o=c(69231),p=c(15059),q=c(13335),r=c(55511),s=c(74075);let t=["temperature","top_p","presence_penalty","frequency_penalty","stop","tool_choice","parallel_tool_calls","response_format"];function u(...a){return[...new Set(a.flatMap(a=>"string"==typeof a?a.split(","):[]).map(a=>a.trim()).filter(Boolean))].join(",")}function v(a){return a&&"object"==typeof a&&(a["anthropic-beta"]||a["Anthropic-Beta"])||""}function w(){return(0,r.randomUUID)().replace(/-/g,"")}function x(a,b,c="truncated for CodeBuddy"){if("string"!=typeof a||a.length<=b)return a;let d=Math.floor(.75*b),e=Math.max(0,b-d-c.length-12);return`${a.slice(0,d)}
1077
1077
 
1078
1078
  [${c}]
1079
1079
 
@@ -1085,7 +1085,7 @@ Respond ONLY with the JSON object, no other text.`,e=Array.isArray(a.messages)?a
1085
1085
 
1086
1086
  ${d}`:Array.isArray(f.content)&&f.content.push({type:"text",text:`
1087
1087
 
1088
- ${d}`}):e.unshift({role:"system",content:d}),{...a,messages:e,response_format:{type:"json_object"}}}buildUrl(a,b,c=0,d=null,f=null){if(this.provider?.startsWith?.("openai-compatible-")){let a=(d?.providerSpecificData?.baseUrl||"https://api.openai.com/v1").replace(/\/$/,""),b="responses"===(0,e.jD)(this.provider,d)?"/responses":"/chat/completions";return`${a}${b}`}if(this.provider?.startsWith?.("anthropic-compatible-")){let a=(d?.providerSpecificData?.baseUrl||"https://api.anthropic.com/v1").replace(/\/$/,"");return`${a}/messages`}switch(this.provider){case"claude":case"glm":case"kimi":case"kimi-coding":var g;let h;return g=this.config,h=f?.runtimeTransport,h?.baseUrl?`${h.baseUrl}${h.urlSuffix||""}`:`${g.baseUrl}?beta=true`;case"minimax":case"minimax-cn":{let a=f?.runtimeTransport;if(a?.baseUrl)return`${a.baseUrl}${a.urlSuffix||""}`;return`${this.config.baseUrl}?beta=true`}case"gemini":return`${this.config.baseUrl}/${a}:${b?"streamGenerateContent?alt=sse":"generateContent"}`;default:{let a=this.config.baseUrl;if(a?.includes("{accountId}")){let b=d?.providerSpecificData?.accountId;if(!b)throw Error(`${this.provider} requires accountId in providerSpecificData`);return a.replace("{accountId}",b)}return a}}}buildHeaders(a,b=!0,c=null){let d={"Content-Type":"application/json",...this.config.headers};switch(this.provider){case"gemini":a.apiKey?d["x-goog-api-key"]=a.apiKey:d.Authorization=`Bearer ${a.accessToken}`;break;case"claude":{let b=a?.rawHeaders?{...a.rawHeaders}:null;if(b){for(let a of Object.keys(b)){let c=a.replace(/(^|-)([a-z])/g,(a,b,c)=>b+c.toUpperCase());if("anthropic-beta"===a){let e=new Set((d[c]||d[a]||"").split(",").map(a=>a.trim()).filter(Boolean)),f=new Set(b[a].split(",").map(a=>a.trim()).filter(Boolean));for(let a of e)f.add(a);b[a]=Array.from(f).join(",")}c!==a&&void 0!==d[c]&&delete d[c]}Object.assign(d,b)}a.apiKey?d["x-api-key"]=a.apiKey:d.Authorization=`Bearer ${a.accessToken}`;let e=a.accessToken||a.apiKey||"";if(!Object.keys(d).some(a=>"x-claude-code-session-id"===a.toLowerCase()&&d[a])&&e.includes("sk-ant-oat")){let a=(0,l.tV)(c?.body?.metadata?.user_id);a&&(d["x-claude-code-session-id"]=a)}break}case"glm":!function(a,b,c){let d=c?.runtimeTransport,e=b?.apiKey||b?.accessToken;if(d?.authHeader==="bearer"){for(let b of["Anthropic-Version","Anthropic-Beta","anthropic-version","anthropic-beta","x-api-key"])delete a[b];a.Authorization=`Bearer ${e}`;return}a["x-api-key"]=e,Object.assign(a,(0,g.buildKimiHeaders)())}(d,a,c);break;case"kimi":case"kimi-coding":let e,f;e=c?.runtimeTransport,f=a?.apiKey||a?.accessToken,e?.authHeader==="bearer"?(delete d["Anthropic-Version"],delete d["Anthropic-Beta"],delete d["x-api-key"],d.Authorization=`Bearer ${f}`):d["x-api-key"]=f,Object.assign(d,(0,g.buildKimiHeaders)());break;case"minimax":case"minimax-cn":!function(a,b,c){let d=c?.runtimeTransport,e=b?.apiKey||b?.accessToken;if(d?.authHeader==="bearer"){for(let b of["Anthropic-Version","Anthropic-Beta","anthropic-version","anthropic-beta","x-api-key"])delete a[b];a.Authorization=`Bearer ${e}`;return}a["x-api-key"]=e}(d,a,c);break;default:if(this.provider?.startsWith?.("anthropic-compatible-")){let b=a?.rawHeaders?{...a.rawHeaders}:null;if(b){for(let a of Object.keys(b)){let c=a.replace(/(^|-)([a-z])/g,(a,b,c)=>b+c.toUpperCase());if("anthropic-beta"===a){let e=new Set((d[c]||d[a]||"").split(",").map(a=>a.trim()).filter(Boolean));for(let c of b[a].split(",").map(a=>a.trim()).filter(Boolean))e.add(c);b[a]=Array.from(e).join(",")}c!==a&&void 0!==d[c]&&delete d[c]}Object.assign(d,b)}a.apiKey?d["x-api-key"]=a.apiKey:a.accessToken&&(d.Authorization=`Bearer ${a.accessToken}`),d["anthropic-version"]||(d["anthropic-version"]="2023-06-01")}else if("gitlab"===this.provider)d.Authorization=`Bearer ${a.apiKey||a.accessToken}`;else if(this.provider?.startsWith?.("codebuddy")){let b=w(),c=w();a.apiKey?d["X-Api-Key"]=a.apiKey:d.Authorization=`Bearer ${a.accessToken}`,d.Accept="text/event-stream",d["Content-Type"]="application/json; charset=utf-8",d["User-Agent"]=q.C,d["X-App"]="cli",d["X-Stainless-Runtime"]="node",d["X-Stainless-Lang"]="js",d["X-Stainless-Helper-Method"]="stream",d["X-Stainless-Retry-Count"]="0",d["X-Requested-With"]="XMLHttpRequest",d["X-Domain"]=a.providerSpecificData?.domain||this.config?.domain||"www.codebuddy.ai",d["X-Request-ID"]=b,d["X-Conversation-ID"]=c,d["X-Conversation-Request-ID"]=b,d["X-Conversation-Message-ID"]=b,d["X-Agent-Intent"]="craft",d["X-IDE-Type"]="CLI",d["X-IDE-Name"]="CLI",d["X-IDE-Version"]=q.A,d["X-Private-Data"]="false"}else if("kilocode"===this.provider)d.Authorization=`Bearer ${a.apiKey||a.accessToken}`,a.providerSpecificData?.orgId&&(d["X-Kilocode-OrganizationID"]=a.providerSpecificData.orgId);else if("cline"===this.provider||"clinepass"===this.provider){let{token:b,isApiKey:c}=(0,h.resolveClineCredential)(a);Object.assign(d,(0,h.buildClineHeaders)(b,{},{isApiKey:c}))}else this.config?.format==="claude"?(d["x-api-key"]=a.apiKey||a.accessToken,d["anthropic-version"]||(d["anthropic-version"]="2023-06-01")):d.Authorization=`Bearer ${a.apiKey||a.accessToken}`}let i=c?.model,j=c?.transformedBody||c?.body,k="string"==typeof i&&/^claude-/.test(i);if(i&&("claude"===this.provider||this.provider?.startsWith?.("anthropic-compatible-")&&k)){let b=u(function(a="",b=null){let c=m.filter(a=>"redact-thinking-2026-02-12"!==a||b?.thinking?.display!=="summarized");return/^claude-(opus|sonnet)/.test(a)&&c.push(...n),c.join(",")}(i,j),v(a?.rawHeaders));delete d["anthropic-beta"],b&&(d["Anthropic-Beta"]=b)}if(this.provider?.startsWith?.("anthropic-compatible-")){let b=a?.providerSpecificData?.baseUrl||"";if(!(""===b||b.includes("api.anthropic.com"))){for(let a of(delete d["anthropic-dangerous-direct-browser-access"],delete d["Anthropic-Dangerous-Direct-Browser-Access"],delete d["x-app"],delete d["X-App"],["anthropic-beta","Anthropic-Beta"]))if(d[a]){let b=d[a].split(",").map(a=>a.trim()).filter(a=>a&&"claude-code-20250219"!==a).join(",");b?d[a]=b:delete d[a]}}}if("anthropic"===this.provider){let b=v(a?.rawHeaders);if(b){let a=u(d["Anthropic-Beta"]||d["anthropic-beta"],b);delete d["anthropic-beta"],a&&(d["Anthropic-Beta"]=a)}}return b&&(d.Accept="text/event-stream"),d}async refreshCredentials(a,b,c=null){if(!a.refreshToken)return null;let d={claude:()=>this.refreshWithJSON(g.NA.anthropic.token,{grant_type:"refresh_token",refresh_token:a.refreshToken,client_id:f.xq.claude.clientId},c),codex:()=>this.refreshWithForm(g.NA.openai.token,{grant_type:"refresh_token",refresh_token:a.refreshToken,client_id:f.xq.codex.clientId,scope:"openid profile email offline_access"},c),qwen:()=>this.refreshWithForm(g.NA.qwen.token,{grant_type:"refresh_token",refresh_token:a.refreshToken,client_id:f.xq.qwen.clientId},c),iflow:()=>this.refreshIflow(a.refreshToken,c),gemini:()=>this.refreshGoogle(a.refreshToken,c),kiro:()=>this.refreshKiro(a.refreshToken,c),codebuddy:()=>this.refreshCodeBuddy(a.refreshToken,c),"codebuddy-cn":()=>this.refreshCodeBuddy(a.refreshToken,c),cline:()=>this.refreshCline(a.refreshToken,c),clinepass:()=>this.refreshCline(a.refreshToken,c),kimi:()=>this.refreshKimiCoding(a.refreshToken,c),"kimi-coding":()=>this.refreshKimiCoding(a.refreshToken,c),kilocode:()=>this.refreshKilocode(a.refreshToken,c)}[this.provider];if(!d)return null;try{let a=await d();return a&&b?.info?.("TOKEN",`${this.provider} refreshed`),a}catch(a){return b?.error?.("TOKEN",`${this.provider} refresh error: ${a.message}`),null}}async refreshWithJSON(a,b,c=null){let d=await (0,i.Fm)(a,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(b)},c);if(!d.ok)return await (0,j.aI)(d),null;let e=await d.json();return{accessToken:e.access_token,refreshToken:e.refresh_token||b.refresh_token,expiresIn:e.expires_in}}async refreshWithForm(a,b,c=null){let d=await (0,i.Fm)(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams(b)},c);if(!d.ok)return await (0,j.aI)(d),null;let e=await d.json();return{accessToken:e.access_token,refreshToken:e.refresh_token||b.refresh_token,expiresIn:e.expires_in}}async refreshIflow(a,b=null){let c=btoa(`${f.xq.iflow.clientId}:${f.xq.iflow.clientSecret}`),d=await (0,i.Fm)(g.NA.iflow.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${c}`},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:f.xq.iflow.clientId,client_secret:f.xq.iflow.clientSecret})},b);if(!d.ok)return await (0,j.aI)(d),null;let e=await d.json();return{accessToken:e.access_token,refreshToken:e.refresh_token||a,expiresIn:e.expires_in}}async refreshGoogle(a,b=null){let c=await (0,i.Fm)(g.NA.google.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:this.config.clientId,client_secret:this.config.clientSecret})},b);if(!c.ok)return await (0,j.aI)(c),null;let d=await c.json();return{accessToken:d.access_token,refreshToken:d.refresh_token||a,expiresIn:d.expires_in}}async refreshKiro(a,b=null){let c=await (0,i.Fm)(f.xq.kiro.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"kiro-cli/2.12.2"},body:JSON.stringify({refreshToken:a})},b);if(!c.ok)return await (0,j.aI)(c),null;let d=await c.json();return{accessToken:d.accessToken,refreshToken:d.refreshToken||a,expiresIn:d.expiresIn}}async refreshCodeBuddy(a,b=null){let c=this.config?.refreshUrl||f.xq.codebuddy?.refreshUrl||"https://www.codebuddy.ai/v2/plugin/auth/token/refresh",d=this.config?.domain||"www.codebuddy.ai",e=await (0,i.Fm)(c,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":q.C,"X-Requested-With":"XMLHttpRequest","X-Domain":d,"X-Refresh-Token":a,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"},b);if(!e.ok)return await (0,j.aI)(e),null;let g=await e.json(),h=g?.data||g,k=h?.accessToken||h?.access_token;return k?{accessToken:k,refreshToken:h?.refreshToken||h?.refresh_token||a,expiresIn:h?.expiresIn||h?.expires_in||86400}:null}async refreshCline(a,b=null){let c=await (0,i.Fm)("https://api.cline.bot/api/v1/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:a,grantType:"refresh_token",clientType:"extension"})},b);if(!c.ok)return await c.text(),null;let d=await c.json(),e=d?.data||d,f=e?.expiresAt,g=f?Math.max(1,Math.floor((new Date(f).getTime()-Date.now())/1e3)):void 0;return{accessToken:e?.accessToken,refreshToken:e?.refreshToken||a,expiresIn:g}}async refreshKimiCoding(a,b=null){let c=(0,g.buildKimiHeaders)(),d=await (0,i.Fm)("https://auth.kimi.com/api/oauth/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",...c},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:"17e5f671-d194-4dfb-9706-5516cb48c098"})},b);if(!d.ok)return await (0,j.aI)(d),null;let e=await d.json();return{accessToken:e.access_token,refreshToken:e.refresh_token||a,expiresIn:e.expires_in}}async refreshKilocode(a,b=null){return null}}},88998:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{A:()=>n});var e=c(70321),f=c(18922),g=c(2965),h=c(52825),i=c(86767),j=c(96947),k=c(39193),l=a([i]);i=(l.then?(await l)():l)[0],process.setMaxListeners(20);let m=globalThis.__appSingleton??={signalHandlersRegistered:!1,optionalConfigTimer:null,watchdogInterval:null,networkMonitorInterval:null,shutdownPromise:null,shuttingDown:!1},n=async function(){!function(){if(m.signalHandlersRegistered)return;let a=()=>(m.shutdownPromise||(m.shuttingDown=!0,m.optionalConfigTimer&&clearTimeout(m.optionalConfigTimer),m.optionalConfigTimer=null,m.shutdownPromise=(async()=>{try{await (0,k.fD)()}catch(a){console.error("[InitApp] optional services stop failed:",a)}try{await (0,j.DO)()}catch(a){console.error("[InitApp] token refresh stop failed:",a)}try{await (0,i.UT)()}catch(a){console.error("[InitApp] quota refresh stop failed:",a)}try{await (0,g.d_)()}catch(a){console.error("[InitApp] usage flush failed:",a)}try{await (0,f.cj)()}catch(a){console.error("[InitApp] request detail flush failed:",a)}try{await (0,h.y5)()}catch(a){console.error("[InitApp] database close failed:",a)}process.exit()})()),m.shutdownPromise);process.on("SIGINT",a),process.on("SIGTERM",a),m.signalHandlersRegistered=!0}();try{await (0,e.bI)(),await (0,e.mt)(),(0,i.EW)(),(0,j.LP)(),m.optionalConfigTimer||m.shuttingDown||(m.optionalConfigTimer=setTimeout(()=>{m.optionalConfigTimer=null,(0,e.mt)().then(a=>(0,k.rg)(a,"startup")).catch(a=>{console.error("[InitApp] optional service configuration failed:",a)})},3e3),m.optionalConfigTimer.unref?.())}catch(a){console.error("[InitApp] Error:",a)}};d()}catch(a){d(a)}})},89106:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"zed",priority:999,alias:"zd",uiAlias:"zd",display:{name:"Zed",icon:"code",color:"#A855F7",website:"https://zed.dev",notice:{signupUrl:"https://zed.dev/native_app_signin"}},category:"oauth",authType:"oauth",hasOAuth:!0,transport:{baseUrl:"https://cloud.zed.dev/completions",format:"openai",forceStream:!0,headers:{"content-type":"application/json"},auth:{combined:!0,header:"Authorization",scheme:"<user_id> <access_token>"},usage:{url:"https://cloud.zed.dev/client/users/me"},modelsUrl:"https://cloud.zed.dev/models"},models:[],passthroughModels:!0,oauth:{authorizeUrl:"https://zed.dev/native_app_signin",platform:"zed",rsaKeyExchange:!0},features:{usage:!0},serviceKinds:["llm"]}},89409:(a,b,c)=>{"use strict";let d=c(84285),{kRedirectCacheControl:e}=c(49176),{parseCacheControlHeader:f,hasInvalidCacheControlDirective:g,parseVaryHeader:h,hasVaryStar:i,isInvalidOrWildcardVaryHeader:j,isEtagUsable:k}=c(79468),{parseHttpDate:l}=c(24214);function m(){}class n{#cq=!1;#cr=!1;constructor(a){this.target=a}block(){this.#cq=!0}release(){this.#cq=!1,this.#cr||this.target.resume()}pause(){this.#cr=!0,this.target.pause()}resume(){this.#cr=!1,this.#cq||this.target.resume()}abort(a){this.target.abort(a)}get paused(){return this.#cr}get aborted(){return this.target.aborted}get reason(){return this.target.reason}get rawHeaders(){return this.target.rawHeaders}set rawHeaders(a){this.target.rawHeaders=a}get rawTrailers(){return this.target.rawTrailers}set rawTrailers(a){this.target.rawTrailers=a}}let o=[200,203,204,206,300,301,308,404,405,410,414,501],p=[206];function q(a,b){for(let c=0;c<a.length;c++)if(a[c]===b)return!0;return!1}function r(a,b,c){u(a,{...b,path:c});for(let e=0;e<d.safeHTTPMethods.length;e++){let f=d.safeHTTPMethods[e];f!==b.method&&u(a,{...b,method:f,path:c})}}function s(a,b,c){if(void 0===c)return;let d=Array.isArray(c)?c:[c];for(let c=0;c<d.length;c++){let e=function(a,b){let c,d,e;if("string"==typeof b){try{c=new URL(a.origin),d=new URL(a.path,c),e=new URL(b,d)}catch{return}if(e.origin===c.origin)return e.pathname+e.search}}(b,d[c]);void 0!==e&&r(a,b,e)}}class t{#cs;#ct;#cu;#cv;#a$;#cw;#cx;#cy;constructor({store:a,type:b,cacheByDefault:c},d,e){this.#cv=a,this.#ct=b,this.#cu=c,this.#cs=d,this.#a$=e}onRequestStart(a,b){this.#cx?.destroy(),this.#cx=void 0,this.#cw=new n(a),this.#cy=b?.history,this.#a$.onRequestStart?.(this.#cw,b)}onBodySent(a){this.#a$.onBodySent?.(a)}onRequestSent(){this.#a$.onRequestSent?.()}onRequestUpgrade(a,b,c,d){this.#a$.onRequestUpgrade?.(this.#cw,b,c,d)}onResponseStart(a,b,c,m){var n,t,x,y,z,A,B,C;let D,E=()=>this.#a$.onResponseStart?.(this.#cw,b,c,m),F=this;if(!q(d.safeHTTPMethods,this.#cs.method)&&b>=200&&b<=399){return n=this.#cv,t=this.#cs,r(n,t,t.path),s(n,t,c.location),s(n,t,c["content-location"]),E()}if(this.#cy&&this.#cy.length>0&&!function(a,b){try{return new URL(String(a)).origin===new URL(String(b)).origin}catch{return String(a)===String(b)}}(this.#cy[this.#cy.length-1].origin,this.#cs.origin))return E();let G=this.#cy?.[e];if(G)for(let a of G){let b=a?f(a):{};if(!0===b["no-store"]||"shared"===this.#ct&&!0===b.private)return E()}let H=c["cache-control"],I=H?f(H):{};if(w(this.#ct,c,I))return u(this.#cv,this.#cs),E();let J=c["last-modified"]&&q(o,b);if(!H&&!c.expires&&!J&&!this.#cu)return 304===b&&c.vary&&j(c.vary)&&u(this.#cv,this.#cs),E();if(x=this.#ct,y=this.#cs.method,z=b,A=c,B=I,C=this.#cs.headers,!q(d.safeHTTPMethods,y)||z<200||q(p,z)||!q(o,z)&&!A.expires&&!B.public&&void 0===B["max-age"]&&!(B.private&&"private"===x)&&(void 0===B["s-maxage"]||"shared"!==x)||B["no-store"]||"shared"===x&&(!0===B.private||Object.hasOwn(A,"set-cookie"))||A.vary&&i(A.vary)||null!=C&&Object.hasOwn(C,"authorization")&&(!B.public&&!B["s-maxage"]&&!B["must-revalidate"]||"string"!=typeof C.authorization||Array.isArray(B["no-cache"])&&q(B["no-cache"],"authorization")||Array.isArray(B.private)&&q(B.private,"authorization"))||0)return 304===b&&(H||w(this.#ct,c,I))&&u(this.#cv,this.#cs),E();let K=Date.now(),L=Object.hasOwn(c,"age")?function(a){let b=a;if(Array.isArray(b)){if(1!==b.length)return 2147483647e3;b=b[0]}if("string"!=typeof b||!/^[\t ]*[0-9]+[\t ]*$/.test(b))return 2147483647e3;let c=BigInt(b.replace(/^[\t ]+|[\t ]+$/g,""));return c>=BigInt(0x7fffffff)?2147483647e3:1e3*Number(c)}(c.age):void 0;if(void 0!==L&&L>=2147483647e3)return v(b,this.#cv,this.#cs),E();let M=Object.hasOwn(c,"date")?function(a){let b=a;if(Array.isArray(b)){if(1!==b.length)return null;b=b[0]}return"string"!=typeof b?null:l(b)}(c.date):void 0;if(null===M)return v(b,this.#cv,this.#cs),E();let N=Math.max(M?Math.max(0,K-M.getTime()):0,L??0),O="string"==typeof c.etag&&k(c.etag)||"string"==typeof c["last-modified"],P=function(a,b,c,d,e,f,h){if("shared"===a){if(g(f,"s-maxage"))return 0;let a=f["s-maxage"];if(void 0!==a)return a>0?1e3*a:0}if(g(f,"max-age"))return 0;let i=f["max-age"];if(void 0!==i)return i>0?1e3*i:0;if(Object.hasOwn(d,"expires")){if("string"!=typeof d.expires)return 0;let a=l(d.expires);if(!a||b>=a.getTime())return 0;if(e){if(e>=a)return 0;let b=a.getTime()-e.getTime();return void 0!==c&&c>=b?0:b}return a.getTime()-b}if("string"==typeof d["last-modified"]){let a=l(d["last-modified"]);if(a){if(a.getTime()>=b)return;return .1*(b-a.getTime())}}return f.immutable?31536e6:!0===f["no-cache"]&&h?0:void 0}(this.#ct,K,L,c,M,I,O)??this.#cu,Q=0===P&&O;if(void 0===P||N>=P&&!Q)return(H||void 0!==P)&&v(b,this.#cv,this.#cs),E();let R=K-N,S=P+R;if(K>=S&&!Q)return v(b,this.#cv,this.#cs),E();if(this.#cs.headers&&c.vary&&!(D=h(c.vary,this.#cs.headers)))return E();let T=function(a,b,c,d){let e=-1/0,f=-1/0,g=-1/0;if(c["stale-while-revalidate"]&&(e=d+1e3*c["stale-while-revalidate"]),c["stale-if-error"]&&(f=d+1e3*c["stale-if-error"]),c.immutable&&-1/0===e&&-1/0===f&&(g=b+31536e6),-1/0===e&&-1/0===f&&-1/0===g){let c=d-a;return c<=0?b+864e5:d+c+Math.min(Math.max(b-a,0),1e3)}return Math.max(d,e,f,g)}(R,K,I,S),U=function(a,b){let c,d=["connection","proxy-authenticate","proxy-authentication-info","proxy-authorization","proxy-connection","te","transfer-encoding","upgrade","age"];for(let e of(a.connection&&function(a,b){let c=Array.isArray(b)?b:[b];for(let b=0;b<c.length;b++){let d=c[b].split(",");for(let b=0;b<d.length;b++)a.push(d[b].replace(/^[\t ]+|[\t ]+$/g,"").toLowerCase())}}(d,a.connection),Array.isArray(b["no-cache"])&&d.push(...b["no-cache"]),Array.isArray(b.private)&&d.push(...b.private),d))Object.hasOwn(a,e)&&(c??={...a},delete c[e]);return c??a}(c,I),V={statusCode:b,statusMessage:m,headers:U,vary:D,cacheControlDirectives:I,cachedAt:R,staleAt:S,deleteAt:T};if(304===b){let b=!1,c=()=>{b||(b=!0,this.#cw.release())},d=a=>{if(!a){E(),c();return}if(V.statusCode=a.statusCode,V.statusMessage=a.statusMessage,V.etag=a.etag,V.vary=D??a.vary,V.headers={...a.headers,...U},E(),this.#cx=this.#cv.createWriteStream(this.#cs,V),!this.#cx||!a?.body)return void c();if("function"==typeof a.body.values){let d=a.body.values(),e=()=>{if(!b){for(let a of d){let b=this.#cx?.write(a)===!1;if(this.#a$.onResponseData?.(this.#cw,a),b)return}c()}};this.#cx.on("error",function(){F.#cx=void 0,F.#cv.delete(F.#cs),e()}).on("drain",()=>{e()}).on("close",function(){F.#cx===this&&(F.#cx=void 0,e())}),e()}else"function"==typeof a.body.on?(a.body.on("data",a=>{this.#cx?.write(a),this.#a$.onResponseData?.(this.#cw,a)}).on("end",()=>{this.#cx?.end(),c()}).on("error",()=>{this.#cx=void 0,this.#cv.delete(this.#cs),c()}),this.#cx.on("error",function(){F.#cx=void 0,F.#cv.delete(F.#cs)}).on("close",function(){F.#cx===this&&(F.#cx=void 0)})):c()},e=this.#cv.get(this.#cs);this.#cw.block(),a.pause(),e&&"function"==typeof e.then?e.then(d,()=>d(void 0)).catch(b=>{a.abort(b)}):d(e)}else{if("string"==typeof c.etag&&k(c.etag)&&(V.etag=c.etag),this.#cx=this.#cv.createWriteStream(this.#cs,V),!this.#cx)return E();this.#cx.on("drain",()=>a.resume()).on("error",function(){F.#cx=void 0,F.#cv.delete(F.#cs)}).on("close",function(){F.#cx===this&&(F.#cx=void 0),a.resume()}),E()}}onResponseData(a,b){this.#cx?.write(b)===!1&&a.pause(),this.#a$.onResponseData?.(this.#cw,b)}onResponseEnd(a,b){this.#cx?.end(),this.#a$.onResponseEnd?.(this.#cw,b)}onResponseError(a,b){this.#cx?.destroy(b),this.#cx=void 0,this.#a$.onResponseError?.(this.#cw,b)}}function u(a,b){try{a.delete(b)?.catch?.(m)}catch{}}function v(a,b,c){304===a&&u(b,c)}function w(a,b,c){return!0===c["no-store"]||"shared"===a&&(!0===c.private||Object.hasOwn(b,"set-cookie"))||!!b.vary&&j(b.vary)}a.exports=t},89512:(a,b,c)=>{"use strict";let d=c(37417),e=c(65630),{SnapshotRecorder:f}=c(94279),{InvalidArgumentError:g,UndiciError:h}=c(61448),i=c(84285),{validateSnapshotMode:j}=c(47800),k=Symbol("kSnapshotRecorder"),l=Symbol("kSnapshotMode"),m=Symbol("kSnapshotPath"),n=Symbol("kSnapshotLoaded"),o=Symbol("kRealAgent"),p=!1;class q extends e{constructor(a={}){p||(process.emitWarning("SnapshotAgent is experimental and subject to change","ExperimentalWarning"),p=!0);let{mode:b="record",snapshotPath:c=null,...e}=a;if(super(e),j(b),("playback"===b||"update"===b)&&!c)throw new g(`snapshotPath is required when mode is '${b}'`);this[l]=b,this[m]=c,this[k]=new f({snapshotPath:this[m],mode:this[l],maxSnapshots:a.maxSnapshots,autoFlush:a.autoFlush,flushInterval:a.flushInterval,matchHeaders:a.matchHeaders,ignoreHeaders:a.ignoreHeaders,excludeHeaders:a.excludeHeaders,matchBody:a.matchBody,normalizeBody:a.normalizeBody,matchQuery:a.matchQuery,normalizeQuery:a.normalizeQuery,caseSensitive:a.caseSensitive,shouldRecord:a.shouldRecord,shouldPlayback:a.shouldPlayback,excludeUrls:a.excludeUrls}),this[n]=!1,("record"===this[l]||"update"===this[l]||"playback"===this[l]&&a.excludeUrls&&a.excludeUrls.length>0)&&(this[o]=new d(a)),("playback"===this[l]||"update"===this[l])&&this[m]&&this.loadSnapshots().catch(()=>{})}dispatch(a,b){let c=this[l];if(this[k].isUrlExcluded(a))return this[o].dispatch(a,b);if("playback"===c||"update"===c){if(!this[n])return this.#cz(a,b);let d=this[k].findSnapshot(a);if(d)return this.#cA(d,b);{if("update"===c)return this.#cB(a,b);let d=new h(`No snapshot found for ${a.method||"GET"} ${a.path}`);if(b.onResponseError)return void b.onResponseError(null,d);throw d}}if("record"===c)return this.#cB(a,b)}async #cz(a,b){return await this.loadSnapshots(),this.dispatch(a,b)}#cB(a,b){let c={statusCode:null,headers:{},trailers:{},body:[]},d=this;return this[o].dispatch(a,{onRequestStart(a,c){return b.onRequestStart(a,{...c,history:this.history})},onRequestUpgrade:(a,c,d,e)=>b.onRequestUpgrade(a,c,d,e),onResponseStart:(a,d,e,f)=>(c.statusCode=d,c.headers=e,b.onResponseStart(a,d,e,f)),onResponseData:(a,d)=>(c.body.push(d),b.onResponseData(a,d)),onResponseEnd(e,f){c.trailers=f;let g=Buffer.concat(c.body);d[k].record(a,{statusCode:c.statusCode,headers:c.headers,body:g,trailers:c.trailers}).then(()=>b.onResponseEnd(e,f)).catch(a=>b.onResponseError(e,a))},onResponseError:(a,c)=>b.onResponseError(a,c)})}#cA(a,b){try{let{response:c}=a,d=c.headers?i.toRawHeaders(c.headers):[],e=c.trailers?i.toRawHeaders(c.trailers):[],f={rawHeaders:d,rawTrailers:e,pause(){},resume(){},abort(a){this.aborted=!0,this.reason=a},aborted:!1,paused:!1};b.onRequestStart(f),b.onResponseStart(f,c.statusCode,c.headers,c.statusMessage);let g=Buffer.from(c.body,"base64");b.onResponseData(f,g),b.onResponseEnd(f,c.trailers)}catch(a){b.onResponseError?.(null,a)}}async loadSnapshots(a){await this[k].loadSnapshots(a||this[m]),this[n]=!0,"playback"===this[l]&&this.#cC()}async saveSnapshots(a){return this[k].saveSnapshots(a||this[m])}#cC(){for(let a of this[k].getSnapshots()){let{request:b,responses:c,response:d}=a,e=new URL(b.url),f=this.get(e.origin),g=c?c[0]:d;g&&f.intercept({path:e.pathname+e.search,method:b.method,headers:b.headers,body:b.body}).reply(g.statusCode,g.body,{headers:g.headers,trailers:g.trailers}).persist()}}getRecorder(){return this[k]}getMode(){return this[l]}clearSnapshots(){this[k].clear()}resetCallCounts(){this[k].resetCallCounts()}deleteSnapshot(a){return this[k].deleteSnapshot(a)}getSnapshotInfo(a){return this[k].getSnapshotInfo(a)}replaceSnapshots(a){this[k].replaceSnapshots(a)}async close(){"playback"===this[l]?this[k].destroy():await this[k].close(),await this[o]?.close(),await super.close()}}a.exports=q},90053:a=>{"use strict";a.exports={rE:"1.1.74"}},90181:(a,b,c)=>{"use strict";c.d(b,{getPricingForModel:()=>f}),c(52825);let d=(0,c(58609).U)("pricing");async function e(){return await d.getAll()}async function f(a,b){if(!b)return null;let d=await e();if(a&&d[a]?.[b])return d[a][b];let{getPricingForModel:f}=await c.e(7464).then(c.bind(c,87464));return f(a,b)}},90249:(a,b,c)=>{"use strict";let d=c(53053),e=c(84285),f=c(32264),{getInterceptorOrigin:g,normalizeHeaders:h,makeCacheKey:i,makeDeduplicationKey:j}=c(79468),k=d.channel("undici:request:pending-requests");a.exports=(a={})=>{let{methods:b=["GET"],skipHeaderNames:c=[],excludeHeaderNames:d=[],maxBufferSize:l=5242880}=a;if("object"!=typeof a||null===a)throw TypeError(`expected type of opts to be an Object, got ${null===a?"null":typeof a}`);if(!Array.isArray(b))throw TypeError(`expected opts.methods to be an array, got ${typeof b}`);for(let a of b)if(!e.safeHTTPMethods.includes(a))throw TypeError(`expected opts.methods to only contain safe HTTP methods, got ${a}`);if(!Array.isArray(c))throw TypeError(`expected opts.skipHeaderNames to be an array, got ${typeof c}`);if(!Array.isArray(d))throw TypeError(`expected opts.excludeHeaderNames to be an array, got ${typeof d}`);if(!Number.isFinite(l)||l<=0)throw TypeError(`expected opts.maxBufferSize to be a positive finite number, got ${l}`);let m=new Set(c.map(a=>a.toLowerCase())),n=new Set(d.map(a=>a.toLowerCase())),o=new Map;return(a,c)=>(d,e)=>{let p=g(d,c);if(!p||d.upgrade||!1===b.includes(d.method))return a(d,e);if(d={...d,headers:h(d)},m.size>0){for(let b of Object.keys(d.headers))if(m.has(b.toLowerCase()))return a(d,e)}let q=j(i(d,p),n),r=o.get(q);if(r)return!!r.addWaitingHandler(e)||a(d,e);let s=new f(e,()=>{o.delete(q),k.hasSubscribers&&k.publish({size:o.size,key:q,type:"removed"})},l);return o.set(q,s),k.hasSubscribers&&k.publish({size:o.size,key:q,type:"added"}),a(d,s)}}},90548:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{RR:()=>E,bh:()=>s});var e=c(55511),f=c(74075),g=c.n(f),h=c(8735),i=c(42541),j=c(21616),k=c(79499),l=c(84238),m=c(51091),n=c(46956);let a="Cursor AgentService ended without a terminal event",F="Long session:",G=["temperature","top_p","max_completion_tokens","max_output_tokens","response_format","reasoning_effort","reasoning","tool_choice","parallel_tool_calls"],H=null;if(!("u">typeof caches&&"object"==typeof caches||"u">typeof EdgeRuntime))try{H=await Promise.resolve().then(c.t.bind(c,73496,23))}catch{}function o(...a){let b=a.filter(Boolean).map(a=>Buffer.from(a));return Buffer.concat(b)}function p(a,b){return(0,k.Xh)(a,2,b)}function q(a){return"string"==typeof a?a:Array.isArray(a)?a.filter(a=>a?.type==="text"&&"string"==typeof a.text).map(a=>a.text).join("\n"):""}function r(a){return!!(!a||"object"!=typeof a||"tool"===a.role||a.tool_call_id||Array.isArray(a.tool_calls)&&a.tool_calls.length>0||Array.isArray(a.tool_results)&&a.tool_results.length>0)||("string"==typeof a.content?/<(?:image_url|tool_result)>/i.test(a.content):Array.isArray(a.content)?a.content.some(a=>a?.type!=="text"||"string"!=typeof a.text):null!=a.content)}function s(a={}){let b=Array.isArray(a.messages)?a.messages.findLast(a=>a?.role!=="system"):null;return!0!==a.stream&&Array.isArray(a.messages)&&a.messages.length>0&&b?.role==="user"&&(!Array.isArray(a.tools)||0===a.tools.length)&&(void 0===a.max_tokens||32e3===a.max_tokens)&&!G.some(b=>void 0!==a[b])&&!a.messages.some(r)}function t(a){let b=q(a.content);if(!b)return null;let c=p(1,b);return"assistant"===a.role?p(2,p(1,p(1,c))):p(1,p(1,p(1,c)))}function u({url:a,headers:b,signal:c}){if(!H)throw Error("HTTP/2 is unavailable for Cursor AgentService");let d=new URL(a),e=H.connect(`${d.protocol}//${d.host}`),f=[],g=null,h=!1,i=null,j=e.request({":method":"POST",":path":d.pathname,":authority":d.host,":scheme":d.protocol.slice(0,-1),...b}),k=a=>{if(!g)return;let b=g;g=null,b(a)},l=a=>{i||(i=a,h=!0,k(null))},m=()=>{c?.removeEventListener?.("abort",n);try{j.destroy()}catch{}try{e.close()}catch{}},n=()=>{l(c?.reason instanceof Error?c.reason:Object.assign(Error("Cursor AgentService request aborted"),{name:"AbortError"})),m()};return e.on("error",l),j.on("error",l),j.on("data",a=>{g?k({value:a,done:!1}):f.push(a)}),j.on("end",()=>{h=!0,k({value:void 0,done:!0})}),c?.aborted?n():c?.addEventListener?.("abort",n,{once:!0}),{responseHeaders:new Promise((a,b)=>{j.once("response",a),j.once("error",b),e.once("error",b)}),write(a){j.destroyed||j.write(Buffer.from(a))},end(){j.destroyed||j.end()},close:m,async read(){if(f.length)return{value:f.shift(),done:!1};if(i)throw i;if(h)return{value:void 0,done:!0};let a=await new Promise(a=>{g=a});if(i)throw i;return a||{value:void 0,done:!0}}}}class I extends Error{constructor(a,b=!1,c={}){super(a,c),this.name="CursorAgentError",this.semanticCommitted=b}}function v(a,b){let c=a.get(b)?.[0]?.value;return c&&"number"!=typeof c?Buffer.from(c).toString("utf8"):""}let J={2:2,3:3,4:4,5:5,7:7,8:8,9:9,16:16,20:20,23:23};function w(a){return{id:Number(a?.get(1)?.[0]?.value||0),execId:v(a,15)}}function x(a,b,c,d){return Buffer.from((0,k.tM)(p(2,o(a?(0,k.Xh)(1,0,a):null,p(15,b||""),p(c,d||new Uint8Array)))))}function y(a,b,c,d){return Buffer.from((0,k.tM)(p(3,o(a?(0,k.Xh)(1,0,a):null,p(b,c||new Uint8Array),d&&d.length?p(4,d):null))))}function z(a,b){let c=0n;for(let d=0;d<10;d+=1){if(b>=a.length)throw Error("truncated protobuf varint");let e=a[b++];if(c|=BigInt(127&e)<<BigInt(7*d),(128&e)==0){if(c>BigInt(Number.MAX_SAFE_INTEGER))throw Error("protobuf varint exceeds safe range");return[Number(c),b]}}throw Error("protobuf varint exceeds 10 bytes")}function A(a){let b=Buffer.from(a),c=new Map,d=0;for(;d<b.length;){let a,[e,f]=z(b,d),g=Math.floor(e/8),h=e%8;if(0===g)throw Error("protobuf field zero is invalid");if(d=f,0===h)[a,d]=z(b,d);else if(2===h){let c;if([c,d]=z(b,d),c>b.length-d)throw Error("truncated protobuf field");a=b.subarray(d,d+c),d+=c}else if(1===h||5===h){let c=1===h?8:4;if(c>b.length-d)throw Error("truncated fixed protobuf field");a=b.subarray(d,d+c),d+=c}else throw Error(`unsupported protobuf wire type ${h}`);c.has(g)||c.set(g,[]),c.get(g).push({wireType:h,value:a})}return c}function B(){return{buffer:Buffer.alloc(0),content:"",semanticCommitted:!1,terminal:!1}}function C(a){return!!a&&!0!==a.semanticCommitted&&!a.content}async function D(b,c){let d=await b.responseHeaders,e=Number(d?.[":status"]||0);if(200!==e)throw new I(`Cursor AgentService returned HTTP ${e||h.gx.SERVER_ERROR}`);for(;!c.terminal;){let{done:a,value:d}=await b.read();if(a)break;c.buffer=Buffer.concat([c.buffer,Buffer.from(d)]),function(a,b){let c=a.buffer;for(;c.length>=5;){let d=c[0],e=c.readUInt32BE(1);if(e>0x1000000)throw new I("Cursor AgentService frame exceeded the safety limit",a.semanticCommitted);if(c.length<5+e)break;let f=c.subarray(5,5+e);if(c=c.subarray(5+e),1&d)try{f=g().gunzipSync(f)}catch(b){throw new I("Cursor AgentService sent an invalid compressed frame",a.semanticCommitted,{cause:b})}2&d||function(a,b,c){try{let d=A(a);if(d.has(1)){let a=A(d.get(1)[0].value);if(a.has(1)){let c=A(a.get(1)[0].value),d=v(c,1);d&&(b.content+=d,b.semanticCommitted=!0)}a.has(14)&&(b.terminal=!0)}if(d.has(4)){let a=A(d.get(4)[0].value),b=Number(a.get(1)?.[0]?.value||0),e=a.get(4)?.[0]?.value||null;a.has(2)?c.write(y(b,2,p(1,new Uint8Array),e)):a.has(3)&&c.write(y(b,3,new Uint8Array,e))}if(d.has(2)){let a=A(d.get(2)[0].value);if(a.has(10))c.write(function(a){let{id:b,execId:c}=w(a),d=p(1,new Uint8Array);return x(b,c,10,p(1,d))}(a));else{let d=function(a){let{id:b,execId:c}=w(a),d=[...a?.keys()||[]].find(a=>1!==a&&15!==a),e=J[d];return e?9===d?x(b,c,9,new Uint8Array):x(b,c,e,p(2,p(2,"Tool not available in this environment. Use the MCP tools provided instead."))):null}(a);if(!d)throw new I("Cursor AgentService requested an unsupported IDE tool",b.semanticCommitted);c.write(d)}}}catch(a){if(a instanceof I)throw a;throw new I("Cursor AgentService sent malformed protobuf",b.semanticCommitted,{cause:a})}}(f,a,b)}a.buffer=c}(c,b)}if(c.buffer.length>0)throw new I("Cursor AgentService ended with a truncated frame",c.semanticCommitted);if(!c.terminal)throw new I(a,c.semanticCommitted)}async function E(b){var c,d,f,g;let h,r,s,v,{model:w,body:x,credentials:y,signal:z,openStream:A=u}=b;if((0,n.QH)(b.proxyOptions))throw Error("Cursor AgentService requires a strict proxy that this HTTP/2 transport cannot honor; refusing to open a direct connection");let E=(c=b.timeoutMs||6e4,r=new AbortController,s=()=>{let a=z?.reason,b=a?.name==="AbortError"?a:Object.assign(Error("Cursor AgentService request aborted",{...a instanceof Error?{cause:a}:{}}),{name:"AbortError"});r.abort(b)},z?.aborted?s():z?.addEventListener?.("abort",s,{once:!0}),v=setTimeout(()=>{let a=Error("Cursor AgentService request timed out");a.name="TimeoutError",r.abort(a)},c),v.unref?.(),{signal:r.signal,cleanup(){clearTimeout(v),z?.removeEventListener?.("abort",s)}}),G=E.signal,H=b.url||"https://agent.api5.cursor.sh/agent.v1.AgentService/Run",J=(0,m.MB)(b.headers||(0,j.JA)(y.accessToken,y.providerSpecificData?.machineId,y.providerSpecificData?.ghostMode!==!1),b.providerOverrides),K=function(a={}){let b=Number(a.emptyTurnMaxRetries??process.env.CURSOR_EMPTY_TURN_MAX_RETRIES),c=Number(a.tailOnlyThreshold??process.env.CURSOR_TAIL_ONLY_THRESHOLD),d=Number(a.emptyTurnRetryDelayMs??process.env.CURSOR_EMPTY_TURN_RETRY_DELAY_MS);return{maxRetries:Number.isFinite(b)&&b>=0?Math.floor(b):1,threshold:Number.isFinite(c)&&c>0?Math.floor(c):80,delayMs:Number.isFinite(d)&&d>=0?Math.floor(d):400}}(b),L=Array.isArray(x?.messages)?x.messages:[],M=x,N=B(),O=0,P=()=>{let a=h;h=void 0;try{a?.end?.()}catch{}try{a?.close?.()}catch{}};try{let c;for(;;){N=B();let c=null;h=A({url:H,headers:J,signal:G});try{h.write(function(a,b={},c={}){let d=b.messages||[],f=d.filter(a=>a?.role==="system").map(a=>q(a.content)).filter(Boolean).join("\n\n"),g=d.filter(a=>a?.role!=="system"),h=g.map(a=>a?.role).lastIndexOf("user"),i=h>=0?g[h]:g.at(-1),j=g.slice(0,h>=0?h:-1).map(t).filter(Boolean),l=o(p(1,q(i?.content)||"Continue."),p(2,c.requestId||(0,e.randomUUID)())),m=j.length?o(...j.map(a=>p(1,a))):null,n=o(p(1,l),m?p(7,m):null),r=p(1,n),s=o(p(1,a),(0,k.Xh)(7,0,1)),u=o(p(1,new Uint8Array),p(2,r),f?p(8,f):null,p(9,s));return Buffer.from((0,k.tM)(p(1,u)))}(w,M)),await D(h,N)}catch(a){if(a?.name==="AbortError"&&z?.aborted)throw a.semanticCommitted=N.semanticCommitted,a;c=a}finally{P()}if(!(O<K.maxRetries&&L.length>=K.threshold&&!G.aborted&&(d=c,f=N,C(f)&&(d?d instanceof I&&d.message===a:!0===f.terminal)))){if(c)throw c;if(C(N)&&L.length>=K.threshold)throw new I("Cursor AgentService returned an empty turn",!1);break}O+=1,b.log?.info?.("CURSOR",`empty_turn on ${L.length}-message session; retry ${O}/${K.maxRetries} with tail-only frame`),M={...x,messages:function(a){if(!Array.isArray(a)||0===a.length)return Array.isArray(a)?a:[];let b=a.filter(a=>a?.role==="system"&&!String(a?.content||"").startsWith(F)),c=a.filter(a=>a?.role!=="system"),d=Math.max(0,c.length-1);for(let a=c.length-1;a>=0;a-=1)if(c[a]?.role==="user"||c[a]?.role==="tool"){d=a;break}let e=d>0&&c[d-1]?.role==="assistant"?d-1:d;return[...b,{role:"system",content:`${F} ${a.length} messages trimmed to the latest turn. Answer the current request; re-read files if needed.`},...c.slice(Math.max(0,e))]}(L)},await function(a,b){return a?new Promise((c,d)=>{if(b?.aborted)return void d(b.reason instanceof Error?b.reason:Object.assign(Error("Cursor AgentService request aborted"),{name:"AbortError"}));let e=()=>{clearTimeout(f),d(b.reason instanceof Error?b.reason:Object.assign(Error("Cursor AgentService request aborted"),{name:"AbortError"}))},f=setTimeout(()=>{b?.removeEventListener?.("abort",e),c()},a);b?.addEventListener?.("abort",e,{once:!0})}):Promise.resolve()}(K.delayMs,G)}return{response:(g=N.content,c=Math.floor(Date.now()/1e3),new Response(JSON.stringify({id:`chatcmpl-cursor-agent-${Date.now()}`,object:"chat.completion",created:c,model:w,choices:[{index:0,message:{role:"assistant",content:g||null},finish_reason:"stop"}],usage:(0,l.OF)(x,g.length,i.h.OPENAI)}),{status:200,headers:{"Content-Type":"application/json","X-Zevai-Transport":"cursor-agent"}})),url:H,headers:J,transformedBody:x,responseFormat:i.h.OPENAI,semanticCommitted:N.semanticCommitted,transport:"agent",debug:{cursorTransport:"agent"}}}catch(a){if(a?.name==="AbortError"&&z?.aborted)throw a.semanticCommitted=N.semanticCommitted,a;if(a instanceof I)throw a;throw new I("Cursor AgentService transport failed",N.semanticCommitted,{cause:a})}finally{E.cleanup(),P()}}d()}catch(a){d(a)}},1)},90943:(a,b,c)=>{"use strict";c.d(b,{Jm:()=>h,od:()=>i});let d=new Set(["blocklist","content-filter","content_filter","image_safety","model_armor","prohibited_content","recitation","refusal","safety","spii"]),e=new Set(["length","max-tokens","max_tokens"]),f=new Set(["tool-calls","tool-use","tool_calls","tool_use"]),g=new Set(["completed","end-turn","end_of_sequence","end_turn","eos","finish_reason_unspecified","stop","stop_sequence"]);function h(a,{hasToolCalls:b=!1}={}){let c=String(a||"").trim().toLowerCase();return d.has(c)?"content_filter":e.has(c)?"length":f.has(c)?"tool_calls":(g.has(c),b?"tool_calls":"stop")}function i(a){return d.has(String(a||"").trim().toLowerCase())}},91083:(a,b,c)=>{"use strict";"u">typeof process&&process.versions?.node,"u">typeof process&&process.env?.ENABLE_REQUEST_LOGS},91358:(a,b,c)=>{"use strict";c.d(b,{K:()=>e});var d=c(88164);class e extends d.L{constructor(){super("codebuddy-cn")}transformRequest(a,b,c,d){let e=super.transformRequest(a,b,c,d);e.stream=!0;let f=e.reasoning_effort;return"none"===f||"off"===f?delete e.reasoning_effort:f&&(e.reasoning_summary="auto"),e}parseError(a,b){if(b)try{let a=JSON.parse(b),c=a?.msg||a?.message||a?.error?.message||"";if(a?.code===6004||/超出频率限制|frequency limit|限额/i.test(c)){let a=null,b=c.match(/(\d{4}-\d{2}-\d{2})\s+(\d{2}:\d{2}:\d{2})(?:\s*UTC\+?([0-9:]+))?/i);if(b){let c=b[3]?b[3].includes(":")?b[3].startsWith("+")||b[3].startsWith("-")?b[3]:`+${b[3]}`:`+${b[3].padStart(2,"0")}:00`:"+08:00",d=new Date(`${b[1]}T${b[2]}${c}`);Number.isNaN(d.getTime())||(a=d.getTime())}return{status:429,message:c||"CodeBuddy frequency limit (6004)",resetsAtMs:a}}}catch{}return super.parseError(a,b)}}},91492:(a,b,c)=>{"use strict";c.d(b,{A:()=>w});var d=c(69384),e=c(42541),f=c(85450),g=c(15822),h=c(19897),i=c(70884),j=c(41222),k=c(28113),l=c(56248),m=c(98151);let n="anthropic",o="open_ai",p="google",q="x_ai";function r(a,b){let c=String(a||"").toLowerCase();if("anthropic"===c)return n;if("openai"===c||"open_ai"===c)return o;if("google"===c||"gemini"===c)return p;if("xai"===c||"x_ai"===c||"x-ai"===c)return q;let d=String(b||"").toLowerCase();return d.includes("claude")?n:d.includes("gemini")?p:d.includes("grok")||d.includes("xai")?q:o}function s(a,b,c){return a===n?(0,j.P)(b,c):a===p?(0,k.o)(b,c):a===o?(0,l.v)(b,c):b}function t(a,b,c){if(c)for(let d of Array.isArray(c)?c:[c])d&&a.enqueue(b.encode(`data: ${JSON.stringify(d)}
1088
+ ${d}`}):e.unshift({role:"system",content:d}),{...a,messages:e,response_format:{type:"json_object"}}}buildUrl(a,b,c=0,d=null,f=null){if(this.provider?.startsWith?.("openai-compatible-")){let a=(d?.providerSpecificData?.baseUrl||"https://api.openai.com/v1").replace(/\/$/,""),b="responses"===(0,e.jD)(this.provider,d)?"/responses":"/chat/completions";return`${a}${b}`}if(this.provider?.startsWith?.("anthropic-compatible-")){let a=(d?.providerSpecificData?.baseUrl||"https://api.anthropic.com/v1").replace(/\/$/,"");return`${a}/messages`}switch(this.provider){case"claude":case"glm":case"kimi":case"kimi-coding":var g;let h;return g=this.config,h=f?.runtimeTransport,h?.baseUrl?`${h.baseUrl}${h.urlSuffix||""}`:`${g.baseUrl}?beta=true`;case"minimax":case"minimax-cn":{let a=f?.runtimeTransport;if(a?.baseUrl)return`${a.baseUrl}${a.urlSuffix||""}`;return`${this.config.baseUrl}?beta=true`}case"gemini":return`${this.config.baseUrl}/${a}:${b?"streamGenerateContent?alt=sse":"generateContent"}`;default:{let a=this.config.baseUrl;if(a?.includes("{accountId}")){let b=d?.providerSpecificData?.accountId;if(!b)throw Error(`${this.provider} requires accountId in providerSpecificData`);return a.replace("{accountId}",b)}return a}}}buildHeaders(a,b=!0,c=null){let d={"Content-Type":"application/json",...this.config.headers};switch(this.provider){case"gemini":a.apiKey?d["x-goog-api-key"]=a.apiKey:d.Authorization=`Bearer ${a.accessToken}`;break;case"claude":{let b=a?.rawHeaders?{...a.rawHeaders}:null;if(b){for(let a of Object.keys(b)){let c=a.replace(/(^|-)([a-z])/g,(a,b,c)=>b+c.toUpperCase());if("anthropic-beta"===a){let e=new Set((d[c]||d[a]||"").split(",").map(a=>a.trim()).filter(Boolean)),f=new Set(b[a].split(",").map(a=>a.trim()).filter(Boolean));for(let a of e)f.add(a);b[a]=Array.from(f).join(",")}c!==a&&void 0!==d[c]&&delete d[c]}Object.assign(d,b)}a.apiKey?d["x-api-key"]=a.apiKey:d.Authorization=`Bearer ${a.accessToken}`;let e=a.accessToken||a.apiKey||"";if(!Object.keys(d).some(a=>"x-claude-code-session-id"===a.toLowerCase()&&d[a])&&e.includes("sk-ant-oat")){let a=(0,l.tV)(c?.body?.metadata?.user_id);a&&(d["x-claude-code-session-id"]=a)}break}case"glm":!function(a,b,c){let d=c?.runtimeTransport,e=b?.apiKey||b?.accessToken;if(d?.authHeader==="bearer"){for(let b of["Anthropic-Version","Anthropic-Beta","anthropic-version","anthropic-beta","x-api-key"])delete a[b];a.Authorization=`Bearer ${e}`;return}a["x-api-key"]=e,Object.assign(a,(0,g.buildKimiHeaders)())}(d,a,c);break;case"kimi":case"kimi-coding":let e,f;e=c?.runtimeTransport,f=a?.apiKey||a?.accessToken,e?.authHeader==="bearer"?(delete d["Anthropic-Version"],delete d["Anthropic-Beta"],delete d["x-api-key"],d.Authorization=`Bearer ${f}`):d["x-api-key"]=f,Object.assign(d,(0,g.buildKimiHeaders)());break;case"minimax":case"minimax-cn":!function(a,b,c){let d=c?.runtimeTransport,e=b?.apiKey||b?.accessToken;if(d?.authHeader==="bearer"){for(let b of["Anthropic-Version","Anthropic-Beta","anthropic-version","anthropic-beta","x-api-key"])delete a[b];a.Authorization=`Bearer ${e}`;return}a["x-api-key"]=e}(d,a,c);break;default:if(this.provider?.startsWith?.("anthropic-compatible-")){let b=a?.rawHeaders?{...a.rawHeaders}:null;if(b){for(let a of Object.keys(b)){let c=a.replace(/(^|-)([a-z])/g,(a,b,c)=>b+c.toUpperCase());if("anthropic-beta"===a){let e=new Set((d[c]||d[a]||"").split(",").map(a=>a.trim()).filter(Boolean));for(let c of b[a].split(",").map(a=>a.trim()).filter(Boolean))e.add(c);b[a]=Array.from(e).join(",")}c!==a&&void 0!==d[c]&&delete d[c]}Object.assign(d,b)}a.apiKey?d["x-api-key"]=a.apiKey:a.accessToken&&(d.Authorization=`Bearer ${a.accessToken}`),d["anthropic-version"]||(d["anthropic-version"]="2023-06-01")}else if("gitlab"===this.provider)d.Authorization=`Bearer ${a.apiKey||a.accessToken}`;else if(this.provider?.startsWith?.("codebuddy")){let b=w(),c=w();a.apiKey?d["X-Api-Key"]=a.apiKey:d.Authorization=`Bearer ${a.accessToken}`,d.Accept="text/event-stream",d["Content-Type"]="application/json; charset=utf-8",d["User-Agent"]=q.C,d["X-App"]="cli",d["X-Stainless-Runtime"]="node",d["X-Stainless-Lang"]="js",d["X-Stainless-Helper-Method"]="stream",d["X-Stainless-Retry-Count"]="0",d["X-Requested-With"]="XMLHttpRequest",d["X-Domain"]=a.providerSpecificData?.domain||this.config?.domain||"www.codebuddy.ai",d["X-Request-ID"]=b,d["X-Conversation-ID"]=c,d["X-Conversation-Request-ID"]=b,d["X-Conversation-Message-ID"]=b,d["X-Agent-Intent"]="craft",d["X-IDE-Type"]="CLI",d["X-IDE-Name"]="CLI",d["X-IDE-Version"]=q.A,d["X-Private-Data"]="false"}else if("kilocode"===this.provider)d.Authorization=`Bearer ${a.apiKey||a.accessToken}`,a.providerSpecificData?.orgId&&(d["X-Kilocode-OrganizationID"]=a.providerSpecificData.orgId);else if("cline"===this.provider||"clinepass"===this.provider){let{token:b,isApiKey:c}=(0,h.resolveClineCredential)(a);Object.assign(d,(0,h.buildClineHeaders)(b,{},{isApiKey:c}))}else this.config?.format==="claude"?(d["x-api-key"]=a.apiKey||a.accessToken,d["anthropic-version"]||(d["anthropic-version"]="2023-06-01")):d.Authorization=`Bearer ${a.apiKey||a.accessToken}`}let i=c?.model,j=c?.transformedBody||c?.body,k="string"==typeof i&&/^claude-/.test(i);if(i&&("claude"===this.provider||this.provider?.startsWith?.("anthropic-compatible-")&&k)){let b=u(function(a="",b=null){let c=m.filter(a=>"redact-thinking-2026-02-12"!==a||b?.thinking?.display!=="summarized");return/^claude-(opus|sonnet)/.test(a)&&c.push(...n),c.join(",")}(i,j),v(a?.rawHeaders));delete d["anthropic-beta"],b&&(d["Anthropic-Beta"]=b)}if(this.provider?.startsWith?.("anthropic-compatible-")){let b=a?.providerSpecificData?.baseUrl||"";if(!(""===b||b.includes("api.anthropic.com"))){for(let a of(delete d["anthropic-dangerous-direct-browser-access"],delete d["Anthropic-Dangerous-Direct-Browser-Access"],delete d["x-app"],delete d["X-App"],["anthropic-beta","Anthropic-Beta"]))if(d[a]){let b=d[a].split(",").map(a=>a.trim()).filter(a=>a&&"claude-code-20250219"!==a).join(",");b?d[a]=b:delete d[a]}}}if("anthropic"===this.provider){let b=v(a?.rawHeaders);if(b){let a=u(d["Anthropic-Beta"]||d["anthropic-beta"],b);delete d["anthropic-beta"],a&&(d["Anthropic-Beta"]=a)}}return b&&(d.Accept="text/event-stream"),d}async refreshCredentials(a,b,c=null){if(!a.refreshToken)return null;let d={claude:()=>this.refreshWithJSON(g.NA.anthropic.token,{grant_type:"refresh_token",refresh_token:a.refreshToken,client_id:f.xq.claude.clientId},c),codex:()=>this.refreshWithForm(g.NA.openai.token,{grant_type:"refresh_token",refresh_token:a.refreshToken,client_id:f.xq.codex.clientId,scope:"openid profile email offline_access"},c),qwen:()=>this.refreshWithForm(g.NA.qwen.token,{grant_type:"refresh_token",refresh_token:a.refreshToken,client_id:f.xq.qwen.clientId},c),iflow:()=>this.refreshIflow(a.refreshToken,c),gemini:()=>this.refreshGoogle(a.refreshToken,c),kiro:()=>this.refreshKiro(a.refreshToken,c),codebuddy:()=>this.refreshCodeBuddy(a.refreshToken,c),"codebuddy-cn":()=>this.refreshCodeBuddy(a.refreshToken,c),cline:()=>this.refreshCline(a.refreshToken,c),clinepass:()=>this.refreshCline(a.refreshToken,c),kimi:()=>this.refreshKimiCoding(a.refreshToken,c),"kimi-coding":()=>this.refreshKimiCoding(a.refreshToken,c),kilocode:()=>this.refreshKilocode(a.refreshToken,c)}[this.provider];if(!d)return null;try{let a=await d();return a&&b?.info?.("TOKEN",`${this.provider} refreshed`),a}catch(a){return b?.error?.("TOKEN",`${this.provider} refresh error: ${a.message}`),null}}async refreshWithJSON(a,b,c=null){let d=await (0,i.Fm)(a,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(b)},c);if(!d.ok)return await (0,j.aI)(d),null;let e=await d.json();return{accessToken:e.access_token,refreshToken:e.refresh_token||b.refresh_token,expiresIn:e.expires_in}}async refreshWithForm(a,b,c=null){let d=await (0,i.Fm)(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams(b)},c);if(!d.ok)return await (0,j.aI)(d),null;let e=await d.json();return{accessToken:e.access_token,refreshToken:e.refresh_token||b.refresh_token,expiresIn:e.expires_in}}async refreshIflow(a,b=null){let c=btoa(`${f.xq.iflow.clientId}:${f.xq.iflow.clientSecret}`),d=await (0,i.Fm)(g.NA.iflow.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${c}`},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:f.xq.iflow.clientId,client_secret:f.xq.iflow.clientSecret})},b);if(!d.ok)return await (0,j.aI)(d),null;let e=await d.json();return{accessToken:e.access_token,refreshToken:e.refresh_token||a,expiresIn:e.expires_in}}async refreshGoogle(a,b=null){let c=await (0,i.Fm)(g.NA.google.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:this.config.clientId,client_secret:this.config.clientSecret})},b);if(!c.ok)return await (0,j.aI)(c),null;let d=await c.json();return{accessToken:d.access_token,refreshToken:d.refresh_token||a,expiresIn:d.expires_in}}async refreshKiro(a,b=null){let c=await (0,i.Fm)(f.xq.kiro.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"kiro-cli/2.12.2"},body:JSON.stringify({refreshToken:a})},b);if(!c.ok)return await (0,j.aI)(c),null;let d=await c.json();return{accessToken:d.accessToken,refreshToken:d.refreshToken||a,expiresIn:d.expiresIn}}async refreshCodeBuddy(a,b=null){let c=this.config?.refreshUrl||f.xq.codebuddy?.refreshUrl||"https://www.codebuddy.ai/v2/plugin/auth/token/refresh",d=this.config?.domain||"www.codebuddy.ai",e=await (0,i.Fm)(c,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":q.C,"X-Requested-With":"XMLHttpRequest","X-Domain":d,"X-Refresh-Token":a,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"},b);if(!e.ok)return await (0,j.aI)(e),null;let g=await e.json(),h=g?.data||g,k=h?.accessToken||h?.access_token;return k?{accessToken:k,refreshToken:h?.refreshToken||h?.refresh_token||a,expiresIn:h?.expiresIn||h?.expires_in||86400}:null}async refreshCline(a,b=null){let c=await (0,i.Fm)("https://api.cline.bot/api/v1/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:a,grantType:"refresh_token",clientType:"extension"})},b);if(!c.ok)return await c.text(),null;let d=await c.json(),e=d?.data||d,f=e?.expiresAt,g=f?Math.max(1,Math.floor((new Date(f).getTime()-Date.now())/1e3)):void 0;return{accessToken:e?.accessToken,refreshToken:e?.refreshToken||a,expiresIn:g}}async refreshKimiCoding(a,b=null){let c=(0,g.buildKimiHeaders)(),d=await (0,i.Fm)("https://auth.kimi.com/api/oauth/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",...c},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:"17e5f671-d194-4dfb-9706-5516cb48c098"})},b);if(!d.ok)return await (0,j.aI)(d),null;let e=await d.json();return{accessToken:e.access_token,refreshToken:e.refresh_token||a,expiresIn:e.expires_in}}async refreshKilocode(a,b=null){return null}}},88998:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{A:()=>n});var e=c(70321),f=c(18922),g=c(2965),h=c(52825),i=c(86767),j=c(96947),k=c(39193),l=a([i]);i=(l.then?(await l)():l)[0],process.setMaxListeners(20);let m=globalThis.__appSingleton??={signalHandlersRegistered:!1,optionalConfigTimer:null,watchdogInterval:null,networkMonitorInterval:null,shutdownPromise:null,shuttingDown:!1},n=async function(){!function(){if(m.signalHandlersRegistered)return;let a=()=>(m.shutdownPromise||(m.shuttingDown=!0,m.optionalConfigTimer&&clearTimeout(m.optionalConfigTimer),m.optionalConfigTimer=null,m.shutdownPromise=(async()=>{try{await (0,k.fD)()}catch(a){console.error("[InitApp] optional services stop failed:",a)}try{await (0,j.DO)()}catch(a){console.error("[InitApp] token refresh stop failed:",a)}try{await (0,i.UT)()}catch(a){console.error("[InitApp] quota refresh stop failed:",a)}try{await (0,g.d_)()}catch(a){console.error("[InitApp] usage flush failed:",a)}try{await (0,f.cj)()}catch(a){console.error("[InitApp] request detail flush failed:",a)}try{await (0,h.y5)()}catch(a){console.error("[InitApp] database close failed:",a)}process.exit()})()),m.shutdownPromise);process.on("SIGINT",a),process.on("SIGTERM",a),m.signalHandlersRegistered=!0}();try{await (0,e.bI)(),await (0,e.mt)(),(0,i.EW)(),(0,j.LP)(),m.optionalConfigTimer||m.shuttingDown||(m.optionalConfigTimer=setTimeout(()=>{m.optionalConfigTimer=null,(0,e.mt)().then(a=>(0,k.rg)(a,"startup")).catch(a=>{console.error("[InitApp] optional service configuration failed:",a)})},3e3),m.optionalConfigTimer.unref?.())}catch(a){console.error("[InitApp] Error:",a)}};d()}catch(a){d(a)}})},89106:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"zed",priority:999,alias:"zd",uiAlias:"zd",display:{name:"Zed",icon:"code",color:"#A855F7",website:"https://zed.dev",notice:{signupUrl:"https://zed.dev/native_app_signin"}},category:"oauth",authType:"oauth",hasOAuth:!0,transport:{baseUrl:"https://cloud.zed.dev/completions",format:"openai",forceStream:!0,headers:{"content-type":"application/json"},auth:{combined:!0,header:"Authorization",scheme:"<user_id> <access_token>"},usage:{url:"https://cloud.zed.dev/client/users/me"},modelsUrl:"https://cloud.zed.dev/models"},models:[],passthroughModels:!0,oauth:{authorizeUrl:"https://zed.dev/native_app_signin",platform:"zed",rsaKeyExchange:!0},features:{usage:!0},serviceKinds:["llm"]}},89409:(a,b,c)=>{"use strict";let d=c(84285),{kRedirectCacheControl:e}=c(49176),{parseCacheControlHeader:f,hasInvalidCacheControlDirective:g,parseVaryHeader:h,hasVaryStar:i,isInvalidOrWildcardVaryHeader:j,isEtagUsable:k}=c(79468),{parseHttpDate:l}=c(24214);function m(){}class n{#cs=!1;#ct=!1;constructor(a){this.target=a}block(){this.#cs=!0}release(){this.#cs=!1,this.#ct||this.target.resume()}pause(){this.#ct=!0,this.target.pause()}resume(){this.#ct=!1,this.#cs||this.target.resume()}abort(a){this.target.abort(a)}get paused(){return this.#ct}get aborted(){return this.target.aborted}get reason(){return this.target.reason}get rawHeaders(){return this.target.rawHeaders}set rawHeaders(a){this.target.rawHeaders=a}get rawTrailers(){return this.target.rawTrailers}set rawTrailers(a){this.target.rawTrailers=a}}let o=[200,203,204,206,300,301,308,404,405,410,414,501],p=[206];function q(a,b){for(let c=0;c<a.length;c++)if(a[c]===b)return!0;return!1}function r(a,b,c){u(a,{...b,path:c});for(let e=0;e<d.safeHTTPMethods.length;e++){let f=d.safeHTTPMethods[e];f!==b.method&&u(a,{...b,method:f,path:c})}}function s(a,b,c){if(void 0===c)return;let d=Array.isArray(c)?c:[c];for(let c=0;c<d.length;c++){let e=function(a,b){let c,d,e;if("string"==typeof b){try{c=new URL(a.origin),d=new URL(a.path,c),e=new URL(b,d)}catch{return}if(e.origin===c.origin)return e.pathname+e.search}}(b,d[c]);void 0!==e&&r(a,b,e)}}class t{#cu;#cv;#cw;#cx;#a$;#cy;#cz;#cA;constructor({store:a,type:b,cacheByDefault:c},d,e){this.#cx=a,this.#cv=b,this.#cw=c,this.#cu=d,this.#a$=e}onRequestStart(a,b){this.#cz?.destroy(),this.#cz=void 0,this.#cy=new n(a),this.#cA=b?.history,this.#a$.onRequestStart?.(this.#cy,b)}onBodySent(a){this.#a$.onBodySent?.(a)}onRequestSent(){this.#a$.onRequestSent?.()}onRequestUpgrade(a,b,c,d){this.#a$.onRequestUpgrade?.(this.#cy,b,c,d)}onResponseStart(a,b,c,m){var n,t,x,y,z,A,B,C;let D,E=()=>this.#a$.onResponseStart?.(this.#cy,b,c,m),F=this;if(!q(d.safeHTTPMethods,this.#cu.method)&&b>=200&&b<=399){return n=this.#cx,t=this.#cu,r(n,t,t.path),s(n,t,c.location),s(n,t,c["content-location"]),E()}if(this.#cA&&this.#cA.length>0&&!function(a,b){try{return new URL(String(a)).origin===new URL(String(b)).origin}catch{return String(a)===String(b)}}(this.#cA[this.#cA.length-1].origin,this.#cu.origin))return E();let G=this.#cA?.[e];if(G)for(let a of G){let b=a?f(a):{};if(!0===b["no-store"]||"shared"===this.#cv&&!0===b.private)return E()}let H=c["cache-control"],I=H?f(H):{};if(w(this.#cv,c,I))return u(this.#cx,this.#cu),E();let J=c["last-modified"]&&q(o,b);if(!H&&!c.expires&&!J&&!this.#cw)return 304===b&&c.vary&&j(c.vary)&&u(this.#cx,this.#cu),E();if(x=this.#cv,y=this.#cu.method,z=b,A=c,B=I,C=this.#cu.headers,!q(d.safeHTTPMethods,y)||z<200||q(p,z)||!q(o,z)&&!A.expires&&!B.public&&void 0===B["max-age"]&&!(B.private&&"private"===x)&&(void 0===B["s-maxage"]||"shared"!==x)||B["no-store"]||"shared"===x&&(!0===B.private||Object.hasOwn(A,"set-cookie"))||A.vary&&i(A.vary)||null!=C&&Object.hasOwn(C,"authorization")&&(!B.public&&!B["s-maxage"]&&!B["must-revalidate"]||"string"!=typeof C.authorization||Array.isArray(B["no-cache"])&&q(B["no-cache"],"authorization")||Array.isArray(B.private)&&q(B.private,"authorization"))||0)return 304===b&&(H||w(this.#cv,c,I))&&u(this.#cx,this.#cu),E();let K=Date.now(),L=Object.hasOwn(c,"age")?function(a){let b=a;if(Array.isArray(b)){if(1!==b.length)return 2147483647e3;b=b[0]}if("string"!=typeof b||!/^[\t ]*[0-9]+[\t ]*$/.test(b))return 2147483647e3;let c=BigInt(b.replace(/^[\t ]+|[\t ]+$/g,""));return c>=BigInt(0x7fffffff)?2147483647e3:1e3*Number(c)}(c.age):void 0;if(void 0!==L&&L>=2147483647e3)return v(b,this.#cx,this.#cu),E();let M=Object.hasOwn(c,"date")?function(a){let b=a;if(Array.isArray(b)){if(1!==b.length)return null;b=b[0]}return"string"!=typeof b?null:l(b)}(c.date):void 0;if(null===M)return v(b,this.#cx,this.#cu),E();let N=Math.max(M?Math.max(0,K-M.getTime()):0,L??0),O="string"==typeof c.etag&&k(c.etag)||"string"==typeof c["last-modified"],P=function(a,b,c,d,e,f,h){if("shared"===a){if(g(f,"s-maxage"))return 0;let a=f["s-maxage"];if(void 0!==a)return a>0?1e3*a:0}if(g(f,"max-age"))return 0;let i=f["max-age"];if(void 0!==i)return i>0?1e3*i:0;if(Object.hasOwn(d,"expires")){if("string"!=typeof d.expires)return 0;let a=l(d.expires);if(!a||b>=a.getTime())return 0;if(e){if(e>=a)return 0;let b=a.getTime()-e.getTime();return void 0!==c&&c>=b?0:b}return a.getTime()-b}if("string"==typeof d["last-modified"]){let a=l(d["last-modified"]);if(a){if(a.getTime()>=b)return;return .1*(b-a.getTime())}}return f.immutable?31536e6:!0===f["no-cache"]&&h?0:void 0}(this.#cv,K,L,c,M,I,O)??this.#cw,Q=0===P&&O;if(void 0===P||N>=P&&!Q)return(H||void 0!==P)&&v(b,this.#cx,this.#cu),E();let R=K-N,S=P+R;if(K>=S&&!Q)return v(b,this.#cx,this.#cu),E();if(this.#cu.headers&&c.vary&&!(D=h(c.vary,this.#cu.headers)))return E();let T=function(a,b,c,d){let e=-1/0,f=-1/0,g=-1/0;if(c["stale-while-revalidate"]&&(e=d+1e3*c["stale-while-revalidate"]),c["stale-if-error"]&&(f=d+1e3*c["stale-if-error"]),c.immutable&&-1/0===e&&-1/0===f&&(g=b+31536e6),-1/0===e&&-1/0===f&&-1/0===g){let c=d-a;return c<=0?b+864e5:d+c+Math.min(Math.max(b-a,0),1e3)}return Math.max(d,e,f,g)}(R,K,I,S),U=function(a,b){let c,d=["connection","proxy-authenticate","proxy-authentication-info","proxy-authorization","proxy-connection","te","transfer-encoding","upgrade","age"];for(let e of(a.connection&&function(a,b){let c=Array.isArray(b)?b:[b];for(let b=0;b<c.length;b++){let d=c[b].split(",");for(let b=0;b<d.length;b++)a.push(d[b].replace(/^[\t ]+|[\t ]+$/g,"").toLowerCase())}}(d,a.connection),Array.isArray(b["no-cache"])&&d.push(...b["no-cache"]),Array.isArray(b.private)&&d.push(...b.private),d))Object.hasOwn(a,e)&&(c??={...a},delete c[e]);return c??a}(c,I),V={statusCode:b,statusMessage:m,headers:U,vary:D,cacheControlDirectives:I,cachedAt:R,staleAt:S,deleteAt:T};if(304===b){let b=!1,c=()=>{b||(b=!0,this.#cy.release())},d=a=>{if(!a){E(),c();return}if(V.statusCode=a.statusCode,V.statusMessage=a.statusMessage,V.etag=a.etag,V.vary=D??a.vary,V.headers={...a.headers,...U},E(),this.#cz=this.#cx.createWriteStream(this.#cu,V),!this.#cz||!a?.body)return void c();if("function"==typeof a.body.values){let d=a.body.values(),e=()=>{if(!b){for(let a of d){let b=this.#cz?.write(a)===!1;if(this.#a$.onResponseData?.(this.#cy,a),b)return}c()}};this.#cz.on("error",function(){F.#cz=void 0,F.#cx.delete(F.#cu),e()}).on("drain",()=>{e()}).on("close",function(){F.#cz===this&&(F.#cz=void 0,e())}),e()}else"function"==typeof a.body.on?(a.body.on("data",a=>{this.#cz?.write(a),this.#a$.onResponseData?.(this.#cy,a)}).on("end",()=>{this.#cz?.end(),c()}).on("error",()=>{this.#cz=void 0,this.#cx.delete(this.#cu),c()}),this.#cz.on("error",function(){F.#cz=void 0,F.#cx.delete(F.#cu)}).on("close",function(){F.#cz===this&&(F.#cz=void 0)})):c()},e=this.#cx.get(this.#cu);this.#cy.block(),a.pause(),e&&"function"==typeof e.then?e.then(d,()=>d(void 0)).catch(b=>{a.abort(b)}):d(e)}else{if("string"==typeof c.etag&&k(c.etag)&&(V.etag=c.etag),this.#cz=this.#cx.createWriteStream(this.#cu,V),!this.#cz)return E();this.#cz.on("drain",()=>a.resume()).on("error",function(){F.#cz=void 0,F.#cx.delete(F.#cu)}).on("close",function(){F.#cz===this&&(F.#cz=void 0),a.resume()}),E()}}onResponseData(a,b){this.#cz?.write(b)===!1&&a.pause(),this.#a$.onResponseData?.(this.#cy,b)}onResponseEnd(a,b){this.#cz?.end(),this.#a$.onResponseEnd?.(this.#cy,b)}onResponseError(a,b){this.#cz?.destroy(b),this.#cz=void 0,this.#a$.onResponseError?.(this.#cy,b)}}function u(a,b){try{a.delete(b)?.catch?.(m)}catch{}}function v(a,b,c){304===a&&u(b,c)}function w(a,b,c){return!0===c["no-store"]||"shared"===a&&(!0===c.private||Object.hasOwn(b,"set-cookie"))||!!b.vary&&j(b.vary)}a.exports=t},89512:(a,b,c)=>{"use strict";let d=c(37417),e=c(65630),{SnapshotRecorder:f}=c(94279),{InvalidArgumentError:g,UndiciError:h}=c(61448),i=c(84285),{validateSnapshotMode:j}=c(47800),k=Symbol("kSnapshotRecorder"),l=Symbol("kSnapshotMode"),m=Symbol("kSnapshotPath"),n=Symbol("kSnapshotLoaded"),o=Symbol("kRealAgent"),p=!1;class q extends e{constructor(a={}){p||(process.emitWarning("SnapshotAgent is experimental and subject to change","ExperimentalWarning"),p=!0);let{mode:b="record",snapshotPath:c=null,...e}=a;if(super(e),j(b),("playback"===b||"update"===b)&&!c)throw new g(`snapshotPath is required when mode is '${b}'`);this[l]=b,this[m]=c,this[k]=new f({snapshotPath:this[m],mode:this[l],maxSnapshots:a.maxSnapshots,autoFlush:a.autoFlush,flushInterval:a.flushInterval,matchHeaders:a.matchHeaders,ignoreHeaders:a.ignoreHeaders,excludeHeaders:a.excludeHeaders,matchBody:a.matchBody,normalizeBody:a.normalizeBody,matchQuery:a.matchQuery,normalizeQuery:a.normalizeQuery,caseSensitive:a.caseSensitive,shouldRecord:a.shouldRecord,shouldPlayback:a.shouldPlayback,excludeUrls:a.excludeUrls}),this[n]=!1,("record"===this[l]||"update"===this[l]||"playback"===this[l]&&a.excludeUrls&&a.excludeUrls.length>0)&&(this[o]=new d(a)),("playback"===this[l]||"update"===this[l])&&this[m]&&this.loadSnapshots().catch(()=>{})}dispatch(a,b){let c=this[l];if(this[k].isUrlExcluded(a))return this[o].dispatch(a,b);if("playback"===c||"update"===c){if(!this[n])return this.#cB(a,b);let d=this[k].findSnapshot(a);if(d)return this.#cC(d,b);{if("update"===c)return this.#cD(a,b);let d=new h(`No snapshot found for ${a.method||"GET"} ${a.path}`);if(b.onResponseError)return void b.onResponseError(null,d);throw d}}if("record"===c)return this.#cD(a,b)}async #cB(a,b){return await this.loadSnapshots(),this.dispatch(a,b)}#cD(a,b){let c={statusCode:null,headers:{},trailers:{},body:[]},d=this;return this[o].dispatch(a,{onRequestStart(a,c){return b.onRequestStart(a,{...c,history:this.history})},onRequestUpgrade:(a,c,d,e)=>b.onRequestUpgrade(a,c,d,e),onResponseStart:(a,d,e,f)=>(c.statusCode=d,c.headers=e,b.onResponseStart(a,d,e,f)),onResponseData:(a,d)=>(c.body.push(d),b.onResponseData(a,d)),onResponseEnd(e,f){c.trailers=f;let g=Buffer.concat(c.body);d[k].record(a,{statusCode:c.statusCode,headers:c.headers,body:g,trailers:c.trailers}).then(()=>b.onResponseEnd(e,f)).catch(a=>b.onResponseError(e,a))},onResponseError:(a,c)=>b.onResponseError(a,c)})}#cC(a,b){try{let{response:c}=a,d=c.headers?i.toRawHeaders(c.headers):[],e=c.trailers?i.toRawHeaders(c.trailers):[],f={rawHeaders:d,rawTrailers:e,pause(){},resume(){},abort(a){this.aborted=!0,this.reason=a},aborted:!1,paused:!1};b.onRequestStart(f),b.onResponseStart(f,c.statusCode,c.headers,c.statusMessage);let g=Buffer.from(c.body,"base64");b.onResponseData(f,g),b.onResponseEnd(f,c.trailers)}catch(a){b.onResponseError?.(null,a)}}async loadSnapshots(a){await this[k].loadSnapshots(a||this[m]),this[n]=!0,"playback"===this[l]&&this.#cE()}async saveSnapshots(a){return this[k].saveSnapshots(a||this[m])}#cE(){for(let a of this[k].getSnapshots()){let{request:b,responses:c,response:d}=a,e=new URL(b.url),f=this.get(e.origin),g=c?c[0]:d;g&&f.intercept({path:e.pathname+e.search,method:b.method,headers:b.headers,body:b.body}).reply(g.statusCode,g.body,{headers:g.headers,trailers:g.trailers}).persist()}}getRecorder(){return this[k]}getMode(){return this[l]}clearSnapshots(){this[k].clear()}resetCallCounts(){this[k].resetCallCounts()}deleteSnapshot(a){return this[k].deleteSnapshot(a)}getSnapshotInfo(a){return this[k].getSnapshotInfo(a)}replaceSnapshots(a){this[k].replaceSnapshots(a)}async close(){"playback"===this[l]?this[k].destroy():await this[k].close(),await this[o]?.close(),await super.close()}}a.exports=q},90053:a=>{"use strict";a.exports={rE:"1.1.75"}},90181:(a,b,c)=>{"use strict";c.d(b,{getPricingForModel:()=>f}),c(52825);let d=(0,c(58609).U)("pricing");async function e(){return await d.getAll()}async function f(a,b){if(!b)return null;let d=await e();if(a&&d[a]?.[b])return d[a][b];let{getPricingForModel:f}=await c.e(7464).then(c.bind(c,87464));return f(a,b)}},90249:(a,b,c)=>{"use strict";let d=c(53053),e=c(84285),f=c(32264),{getInterceptorOrigin:g,normalizeHeaders:h,makeCacheKey:i,makeDeduplicationKey:j}=c(79468),k=d.channel("undici:request:pending-requests");a.exports=(a={})=>{let{methods:b=["GET"],skipHeaderNames:c=[],excludeHeaderNames:d=[],maxBufferSize:l=5242880}=a;if("object"!=typeof a||null===a)throw TypeError(`expected type of opts to be an Object, got ${null===a?"null":typeof a}`);if(!Array.isArray(b))throw TypeError(`expected opts.methods to be an array, got ${typeof b}`);for(let a of b)if(!e.safeHTTPMethods.includes(a))throw TypeError(`expected opts.methods to only contain safe HTTP methods, got ${a}`);if(!Array.isArray(c))throw TypeError(`expected opts.skipHeaderNames to be an array, got ${typeof c}`);if(!Array.isArray(d))throw TypeError(`expected opts.excludeHeaderNames to be an array, got ${typeof d}`);if(!Number.isFinite(l)||l<=0)throw TypeError(`expected opts.maxBufferSize to be a positive finite number, got ${l}`);let m=new Set(c.map(a=>a.toLowerCase())),n=new Set(d.map(a=>a.toLowerCase())),o=new Map;return(a,c)=>(d,e)=>{let p=g(d,c);if(!p||d.upgrade||!1===b.includes(d.method))return a(d,e);if(d={...d,headers:h(d)},m.size>0){for(let b of Object.keys(d.headers))if(m.has(b.toLowerCase()))return a(d,e)}let q=j(i(d,p),n),r=o.get(q);if(r)return!!r.addWaitingHandler(e)||a(d,e);let s=new f(e,()=>{o.delete(q),k.hasSubscribers&&k.publish({size:o.size,key:q,type:"removed"})},l);return o.set(q,s),k.hasSubscribers&&k.publish({size:o.size,key:q,type:"added"}),a(d,s)}}},90548:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{RR:()=>E,bh:()=>s});var e=c(55511),f=c(74075),g=c.n(f),h=c(8735),i=c(42541),j=c(21616),k=c(79499),l=c(84238),m=c(51091),n=c(46956);let a="Cursor AgentService ended without a terminal event",F="Long session:",G=["temperature","top_p","max_completion_tokens","max_output_tokens","response_format","reasoning_effort","reasoning","tool_choice","parallel_tool_calls"],H=null;if(!("u">typeof caches&&"object"==typeof caches||"u">typeof EdgeRuntime))try{H=await Promise.resolve().then(c.t.bind(c,73496,23))}catch{}function o(...a){let b=a.filter(Boolean).map(a=>Buffer.from(a));return Buffer.concat(b)}function p(a,b){return(0,k.Xh)(a,2,b)}function q(a){return"string"==typeof a?a:Array.isArray(a)?a.filter(a=>a?.type==="text"&&"string"==typeof a.text).map(a=>a.text).join("\n"):""}function r(a){return!!(!a||"object"!=typeof a||"tool"===a.role||a.tool_call_id||Array.isArray(a.tool_calls)&&a.tool_calls.length>0||Array.isArray(a.tool_results)&&a.tool_results.length>0)||("string"==typeof a.content?/<(?:image_url|tool_result)>/i.test(a.content):Array.isArray(a.content)?a.content.some(a=>a?.type!=="text"||"string"!=typeof a.text):null!=a.content)}function s(a={}){let b=Array.isArray(a.messages)?a.messages.findLast(a=>a?.role!=="system"):null;return!0!==a.stream&&Array.isArray(a.messages)&&a.messages.length>0&&b?.role==="user"&&(!Array.isArray(a.tools)||0===a.tools.length)&&(void 0===a.max_tokens||32e3===a.max_tokens)&&!G.some(b=>void 0!==a[b])&&!a.messages.some(r)}function t(a){let b=q(a.content);if(!b)return null;let c=p(1,b);return"assistant"===a.role?p(2,p(1,p(1,c))):p(1,p(1,p(1,c)))}function u({url:a,headers:b,signal:c}){if(!H)throw Error("HTTP/2 is unavailable for Cursor AgentService");let d=new URL(a),e=H.connect(`${d.protocol}//${d.host}`),f=[],g=null,h=!1,i=null,j=e.request({":method":"POST",":path":d.pathname,":authority":d.host,":scheme":d.protocol.slice(0,-1),...b}),k=a=>{if(!g)return;let b=g;g=null,b(a)},l=a=>{i||(i=a,h=!0,k(null))},m=()=>{c?.removeEventListener?.("abort",n);try{j.destroy()}catch{}try{e.close()}catch{}},n=()=>{l(c?.reason instanceof Error?c.reason:Object.assign(Error("Cursor AgentService request aborted"),{name:"AbortError"})),m()};return e.on("error",l),j.on("error",l),j.on("data",a=>{g?k({value:a,done:!1}):f.push(a)}),j.on("end",()=>{h=!0,k({value:void 0,done:!0})}),c?.aborted?n():c?.addEventListener?.("abort",n,{once:!0}),{responseHeaders:new Promise((a,b)=>{j.once("response",a),j.once("error",b),e.once("error",b)}),write(a){j.destroyed||j.write(Buffer.from(a))},end(){j.destroyed||j.end()},close:m,async read(){if(f.length)return{value:f.shift(),done:!1};if(i)throw i;if(h)return{value:void 0,done:!0};let a=await new Promise(a=>{g=a});if(i)throw i;return a||{value:void 0,done:!0}}}}class I extends Error{constructor(a,b=!1,c={}){super(a,c),this.name="CursorAgentError",this.semanticCommitted=b}}function v(a,b){let c=a.get(b)?.[0]?.value;return c&&"number"!=typeof c?Buffer.from(c).toString("utf8"):""}let J={2:2,3:3,4:4,5:5,7:7,8:8,9:9,16:16,20:20,23:23};function w(a){return{id:Number(a?.get(1)?.[0]?.value||0),execId:v(a,15)}}function x(a,b,c,d){return Buffer.from((0,k.tM)(p(2,o(a?(0,k.Xh)(1,0,a):null,p(15,b||""),p(c,d||new Uint8Array)))))}function y(a,b,c,d){return Buffer.from((0,k.tM)(p(3,o(a?(0,k.Xh)(1,0,a):null,p(b,c||new Uint8Array),d&&d.length?p(4,d):null))))}function z(a,b){let c=0n;for(let d=0;d<10;d+=1){if(b>=a.length)throw Error("truncated protobuf varint");let e=a[b++];if(c|=BigInt(127&e)<<BigInt(7*d),(128&e)==0){if(c>BigInt(Number.MAX_SAFE_INTEGER))throw Error("protobuf varint exceeds safe range");return[Number(c),b]}}throw Error("protobuf varint exceeds 10 bytes")}function A(a){let b=Buffer.from(a),c=new Map,d=0;for(;d<b.length;){let a,[e,f]=z(b,d),g=Math.floor(e/8),h=e%8;if(0===g)throw Error("protobuf field zero is invalid");if(d=f,0===h)[a,d]=z(b,d);else if(2===h){let c;if([c,d]=z(b,d),c>b.length-d)throw Error("truncated protobuf field");a=b.subarray(d,d+c),d+=c}else if(1===h||5===h){let c=1===h?8:4;if(c>b.length-d)throw Error("truncated fixed protobuf field");a=b.subarray(d,d+c),d+=c}else throw Error(`unsupported protobuf wire type ${h}`);c.has(g)||c.set(g,[]),c.get(g).push({wireType:h,value:a})}return c}function B(){return{buffer:Buffer.alloc(0),content:"",semanticCommitted:!1,terminal:!1}}function C(a){return!!a&&!0!==a.semanticCommitted&&!a.content}async function D(b,c){let d=await b.responseHeaders,e=Number(d?.[":status"]||0);if(200!==e)throw new I(`Cursor AgentService returned HTTP ${e||h.gx.SERVER_ERROR}`);for(;!c.terminal;){let{done:a,value:d}=await b.read();if(a)break;c.buffer=Buffer.concat([c.buffer,Buffer.from(d)]),function(a,b){let c=a.buffer;for(;c.length>=5;){let d=c[0],e=c.readUInt32BE(1);if(e>0x1000000)throw new I("Cursor AgentService frame exceeded the safety limit",a.semanticCommitted);if(c.length<5+e)break;let f=c.subarray(5,5+e);if(c=c.subarray(5+e),1&d)try{f=g().gunzipSync(f)}catch(b){throw new I("Cursor AgentService sent an invalid compressed frame",a.semanticCommitted,{cause:b})}2&d||function(a,b,c){try{let d=A(a);if(d.has(1)){let a=A(d.get(1)[0].value);if(a.has(1)){let c=A(a.get(1)[0].value),d=v(c,1);d&&(b.content+=d,b.semanticCommitted=!0)}a.has(14)&&(b.terminal=!0)}if(d.has(4)){let a=A(d.get(4)[0].value),b=Number(a.get(1)?.[0]?.value||0),e=a.get(4)?.[0]?.value||null;a.has(2)?c.write(y(b,2,p(1,new Uint8Array),e)):a.has(3)&&c.write(y(b,3,new Uint8Array,e))}if(d.has(2)){let a=A(d.get(2)[0].value);if(a.has(10))c.write(function(a){let{id:b,execId:c}=w(a),d=p(1,new Uint8Array);return x(b,c,10,p(1,d))}(a));else{let d=function(a){let{id:b,execId:c}=w(a),d=[...a?.keys()||[]].find(a=>1!==a&&15!==a),e=J[d];return e?9===d?x(b,c,9,new Uint8Array):x(b,c,e,p(2,p(2,"Tool not available in this environment. Use the MCP tools provided instead."))):null}(a);if(!d)throw new I("Cursor AgentService requested an unsupported IDE tool",b.semanticCommitted);c.write(d)}}}catch(a){if(a instanceof I)throw a;throw new I("Cursor AgentService sent malformed protobuf",b.semanticCommitted,{cause:a})}}(f,a,b)}a.buffer=c}(c,b)}if(c.buffer.length>0)throw new I("Cursor AgentService ended with a truncated frame",c.semanticCommitted);if(!c.terminal)throw new I(a,c.semanticCommitted)}async function E(b){var c,d,f,g;let h,r,s,v,{model:w,body:x,credentials:y,signal:z,openStream:A=u}=b;if((0,n.QH)(b.proxyOptions))throw Error("Cursor AgentService requires a strict proxy that this HTTP/2 transport cannot honor; refusing to open a direct connection");let E=(c=b.timeoutMs||6e4,r=new AbortController,s=()=>{let a=z?.reason,b=a?.name==="AbortError"?a:Object.assign(Error("Cursor AgentService request aborted",{...a instanceof Error?{cause:a}:{}}),{name:"AbortError"});r.abort(b)},z?.aborted?s():z?.addEventListener?.("abort",s,{once:!0}),v=setTimeout(()=>{let a=Error("Cursor AgentService request timed out");a.name="TimeoutError",r.abort(a)},c),v.unref?.(),{signal:r.signal,cleanup(){clearTimeout(v),z?.removeEventListener?.("abort",s)}}),G=E.signal,H=b.url||"https://agent.api5.cursor.sh/agent.v1.AgentService/Run",J=(0,m.MB)(b.headers||(0,j.JA)(y.accessToken,y.providerSpecificData?.machineId,y.providerSpecificData?.ghostMode!==!1),b.providerOverrides),K=function(a={}){let b=Number(a.emptyTurnMaxRetries??process.env.CURSOR_EMPTY_TURN_MAX_RETRIES),c=Number(a.tailOnlyThreshold??process.env.CURSOR_TAIL_ONLY_THRESHOLD),d=Number(a.emptyTurnRetryDelayMs??process.env.CURSOR_EMPTY_TURN_RETRY_DELAY_MS);return{maxRetries:Number.isFinite(b)&&b>=0?Math.floor(b):1,threshold:Number.isFinite(c)&&c>0?Math.floor(c):80,delayMs:Number.isFinite(d)&&d>=0?Math.floor(d):400}}(b),L=Array.isArray(x?.messages)?x.messages:[],M=x,N=B(),O=0,P=()=>{let a=h;h=void 0;try{a?.end?.()}catch{}try{a?.close?.()}catch{}};try{let c;for(;;){N=B();let c=null;h=A({url:H,headers:J,signal:G});try{h.write(function(a,b={},c={}){let d=b.messages||[],f=d.filter(a=>a?.role==="system").map(a=>q(a.content)).filter(Boolean).join("\n\n"),g=d.filter(a=>a?.role!=="system"),h=g.map(a=>a?.role).lastIndexOf("user"),i=h>=0?g[h]:g.at(-1),j=g.slice(0,h>=0?h:-1).map(t).filter(Boolean),l=o(p(1,q(i?.content)||"Continue."),p(2,c.requestId||(0,e.randomUUID)())),m=j.length?o(...j.map(a=>p(1,a))):null,n=o(p(1,l),m?p(7,m):null),r=p(1,n),s=o(p(1,a),(0,k.Xh)(7,0,1)),u=o(p(1,new Uint8Array),p(2,r),f?p(8,f):null,p(9,s));return Buffer.from((0,k.tM)(p(1,u)))}(w,M)),await D(h,N)}catch(a){if(a?.name==="AbortError"&&z?.aborted)throw a.semanticCommitted=N.semanticCommitted,a;c=a}finally{P()}if(!(O<K.maxRetries&&L.length>=K.threshold&&!G.aborted&&(d=c,f=N,C(f)&&(d?d instanceof I&&d.message===a:!0===f.terminal)))){if(c)throw c;if(C(N)&&L.length>=K.threshold)throw new I("Cursor AgentService returned an empty turn",!1);break}O+=1,b.log?.info?.("CURSOR",`empty_turn on ${L.length}-message session; retry ${O}/${K.maxRetries} with tail-only frame`),M={...x,messages:function(a){if(!Array.isArray(a)||0===a.length)return Array.isArray(a)?a:[];let b=a.filter(a=>a?.role==="system"&&!String(a?.content||"").startsWith(F)),c=a.filter(a=>a?.role!=="system"),d=Math.max(0,c.length-1);for(let a=c.length-1;a>=0;a-=1)if(c[a]?.role==="user"||c[a]?.role==="tool"){d=a;break}let e=d>0&&c[d-1]?.role==="assistant"?d-1:d;return[...b,{role:"system",content:`${F} ${a.length} messages trimmed to the latest turn. Answer the current request; re-read files if needed.`},...c.slice(Math.max(0,e))]}(L)},await function(a,b){return a?new Promise((c,d)=>{if(b?.aborted)return void d(b.reason instanceof Error?b.reason:Object.assign(Error("Cursor AgentService request aborted"),{name:"AbortError"}));let e=()=>{clearTimeout(f),d(b.reason instanceof Error?b.reason:Object.assign(Error("Cursor AgentService request aborted"),{name:"AbortError"}))},f=setTimeout(()=>{b?.removeEventListener?.("abort",e),c()},a);b?.addEventListener?.("abort",e,{once:!0})}):Promise.resolve()}(K.delayMs,G)}return{response:(g=N.content,c=Math.floor(Date.now()/1e3),new Response(JSON.stringify({id:`chatcmpl-cursor-agent-${Date.now()}`,object:"chat.completion",created:c,model:w,choices:[{index:0,message:{role:"assistant",content:g||null},finish_reason:"stop"}],usage:(0,l.OF)(x,g.length,i.h.OPENAI)}),{status:200,headers:{"Content-Type":"application/json","X-Zevai-Transport":"cursor-agent"}})),url:H,headers:J,transformedBody:x,responseFormat:i.h.OPENAI,semanticCommitted:N.semanticCommitted,transport:"agent",debug:{cursorTransport:"agent"}}}catch(a){if(a?.name==="AbortError"&&z?.aborted)throw a.semanticCommitted=N.semanticCommitted,a;if(a instanceof I)throw a;throw new I("Cursor AgentService transport failed",N.semanticCommitted,{cause:a})}finally{E.cleanup(),P()}}d()}catch(a){d(a)}},1)},90943:(a,b,c)=>{"use strict";c.d(b,{Jm:()=>h,od:()=>i});let d=new Set(["blocklist","content-filter","content_filter","image_safety","model_armor","prohibited_content","recitation","refusal","safety","spii"]),e=new Set(["length","max-tokens","max_tokens"]),f=new Set(["tool-calls","tool-use","tool_calls","tool_use"]),g=new Set(["completed","end-turn","end_of_sequence","end_turn","eos","finish_reason_unspecified","stop","stop_sequence"]);function h(a,{hasToolCalls:b=!1}={}){let c=String(a||"").trim().toLowerCase();return d.has(c)?"content_filter":e.has(c)?"length":f.has(c)?"tool_calls":(g.has(c),b?"tool_calls":"stop")}function i(a){return d.has(String(a||"").trim().toLowerCase())}},91083:(a,b,c)=>{"use strict";"u">typeof process&&process.versions?.node,"u">typeof process&&process.env?.ENABLE_REQUEST_LOGS},91358:(a,b,c)=>{"use strict";c.d(b,{K:()=>e});var d=c(88164);class e extends d.L{constructor(){super("codebuddy-cn")}transformRequest(a,b,c,d){let e=super.transformRequest(a,b,c,d);e.stream=!0;let f=e.reasoning_effort;return"none"===f||"off"===f?delete e.reasoning_effort:f&&(e.reasoning_summary="auto"),e}parseError(a,b){if(b)try{let a=JSON.parse(b),c=a?.msg||a?.message||a?.error?.message||"";if(a?.code===6004||/超出频率限制|frequency limit|限额/i.test(c)){let a=null,b=c.match(/(\d{4}-\d{2}-\d{2})\s+(\d{2}:\d{2}:\d{2})(?:\s*UTC\+?([0-9:]+))?/i);if(b){let c=b[3]?b[3].includes(":")?b[3].startsWith("+")||b[3].startsWith("-")?b[3]:`+${b[3]}`:`+${b[3].padStart(2,"0")}:00`:"+08:00",d=new Date(`${b[1]}T${b[2]}${c}`);Number.isNaN(d.getTime())||(a=d.getTime())}return{status:429,message:c||"CodeBuddy frequency limit (6004)",resetsAtMs:a}}}catch{}return super.parseError(a,b)}}},91492:(a,b,c)=>{"use strict";c.d(b,{A:()=>w});var d=c(69384),e=c(42541),f=c(85450),g=c(15822),h=c(19897),i=c(70884),j=c(41222),k=c(28113),l=c(56248),m=c(98151);let n="anthropic",o="open_ai",p="google",q="x_ai";function r(a,b){let c=String(a||"").toLowerCase();if("anthropic"===c)return n;if("openai"===c||"open_ai"===c)return o;if("google"===c||"gemini"===c)return p;if("xai"===c||"x_ai"===c||"x-ai"===c)return q;let d=String(b||"").toLowerCase();return d.includes("claude")?n:d.includes("gemini")?p:d.includes("grok")||d.includes("xai")?q:o}function s(a,b,c){return a===n?(0,j.P)(b,c):a===p?(0,k.o)(b,c):a===o?(0,l.v)(b,c):b}function t(a,b,c){if(c)for(let d of Array.isArray(c)?c:[c])d&&a.enqueue(b.encode(`data: ${JSON.stringify(d)}
1089
1089
 
1090
1090
  `))}let u={id:"zed",baseUrl:"https://cloud.zed.dev/completions",llmBaseUrl:"https://cloud.zed.dev",cloudBaseUrl:"https://cloud.zed.dev",format:"openai",forceStream:!0};class v extends d.Hv{constructor(){super("zed",u)}async resolveModel(a,b,c,d){try{let d=await (0,m.w9)(b,{config:this.config,signal:c}),e=d?.rawById?.get(a)??null;if(!e){let d=await (0,m.w9)(b,{config:this.config,signal:c,forceRefresh:!0});e=d?.rawById?.get(a)??null}return{raw:e,provider:r(e?.provider,a)}}catch(c){let b=c instanceof Error?c.message:String(c);return d?.warn?.("ZED",`model catalog unavailable, inferring provider for ${a}: ${b}`),{raw:null,provider:r(null,a)}}}async execute({model:a,body:b,stream:c,credentials:d,signal:j,log:k,proxyOptions:l=null}){let{provider:q}=await this.resolveModel(a,d,j,k),r=function(a,b,c,d,e){if(a===n)return(0,g.p)(b,c,!0);if(a===p){let a=(0,h.m$)(b,c,!0);return delete a.safetySettings,a}return a===o?(0,i.h)(b,c,!0,e):{...c||{},model:b,stream:!1!==d}}(q,a,b,c,d),u=b||{},v={thread_id:u.thread_id||d?._clientSessionId,prompt_id:u.prompt_id,provider:q,model:a,provider_request:r},w=await (0,m.zn)(d,"/completions",{config:this.config,signal:j,fetchOptions:{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/x-ndjson, text/event-stream, */*","User-Agent":"zevai/zed","x-zed-version":this.config?.appVersion?.toString()||"0.200.0",[m.xK.clientSupportsStatus]:"true",[m.xK.clientSupportsStreamEnded]:"true"},body:JSON.stringify(v)}});return{response:w.ok?function(a,b,c){if(!a.ok||!a.body)return a;let d=new TextDecoder,g=new TextEncoder,h=function(a,b){if(a===n)return(0,f.Ws)(e.h.CLAUDE);if(a===p)return(0,f.Ws)(e.h.GEMINI);if(a===o)return(0,f.Ws)(e.h.OPENAI_RESPONSES);let c=(0,f.Ws)(e.h.OPENAI);return c.model=b,c}(b,c),i="",j=!1,k=a=>{j||(t(a,g,s(b,null,h)),a.enqueue(g.encode("data: [DONE]\n\n")),j=!0)},l=(a,d)=>{if(j)return;let e=function(a){let b=a.replace(/\r$/,"").trim();if(!b)return null;if(b.startsWith("data:")&&(b=b.slice(5).trimStart()),"[DONE]"===b)return{done:!0};try{let a=JSON.parse(b);if(a&&Object.prototype.hasOwnProperty.call(a,"event"))return{event:a.event};if(a&&Object.prototype.hasOwnProperty.call(a,"status"))return{status:a.status};return{event:a}}catch{return null}}(a);if(e){if(e.done)return void k(d);if(e.status){let a=function(a){if(!a)return null;if("string"==typeof a)return{type:a};if("object"==typeof a){let b=Object.keys(a)[0];return b&&"object"==typeof a[b]?{type:b,...a[b]}:a}return null}(e.status);if(a?.type==="failed"||a?.failed){let b=a.failed||a,e=String(b.message||b.error||b.code||"request failed");t(d,g,{id:`chatcmpl-zed-error-${Date.now()}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:c,choices:[{index:0,delta:{content:`[Zed error] ${e}`},finish_reason:"stop"}]}),k(d)}else(a?.type==="stream_ended"||"stream_ended"===a)&&k(d);return}t(d,g,s(b,e.event,h))}};return new Response(a.body.pipeThrough(new TransformStream({transform(a,b){let c;for(i+=d.decode(a,{stream:!0});-1!==(c=i.indexOf("\n"));){let a=i.slice(0,c);i=i.slice(c+1),l(a,b)}},flush(a){(i+=d.decode())&&(l(i,a),i=""),k(a)}})),{status:a.status,statusText:a.statusText,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache"}})}(w,q,a):w,url:`${this.config?.llmBaseUrl||"https://cloud.zed.dev"}/completions`,headers:{"Content-Type":"application/json",Authorization:"Bearer <zed-llm-token>"},transformedBody:v}}parseError(a,b){let c=null;try{c=JSON.parse(b||"{}")}catch{c=null}let d=c?.error||void 0,e=c?.code||d?.code||"",f=c?.message||d?.message||b||a.statusText;return"trial_blocked"===e?{status:a.status,message:`Zed trial access is blocked upstream. The account can list hosted models, but Zed is refusing completions until trial/billing access is enabled or unblocked. Zed says: ${f}`}:e?{status:a.status,message:`Zed ${e}: ${f}`}:{status:a.status,message:f||`Zed upstream error: ${a.status}`}}async refreshCredentials(){return null}needsRefresh(){return!1}}let w=v},91824:(a,b,c)=>{"use strict";c.d(b,{g2:()=>e});let d={cc:"claude",cx:"codex",gc:"gemini-cli",qw:"qwen",if:"iflow",ag:"antigravity",gh:"github",kr:"kiro",cu:"cursor",kc:"kilocode",kmc:"kimi","kimi-coding":"kimi",cl:"cline",oc:"opencode",ocg:"opencode-go",qd:"qoder",qoder:"qoder",acl:"autoclaw",autoclaw:"autoclaw",cb:"codebuddy","cb-cn":"codebuddy-cn",codebuddy:"codebuddy","codebuddy-cn":"codebuddy-cn",cbai:"codebuddy-intl","codebuddy-intl":"codebuddy-intl",zd:"zed",mm:"minimax-code",mmg:"minimax-code-global",el:"elevenlabs",openai:"openai",vercel:"vercel-ai-gateway","vercel-ai-gateway":"vercel-ai-gateway",anthropic:"anthropic",gemini:"gemini",openrouter:"openrouter",glm:"glm",kimi:"kimi",minimax:"minimax","minimax-cn":"minimax-cn",hf:"huggingface",huggingface:"huggingface",ds:"deepseek",deepseek:"deepseek",cmc:"commandcode",commandcode:"commandcode",groq:"groq",xai:"xai",gcli:"grok-cli","grok-cli":"grok-cli",pa:"perplexity-agent","perplexity-agent":"perplexity-agent",mistral:"mistral",pplx:"perplexity",perplexity:"perplexity",together:"together",fireworks:"fireworks",cerebras:"cerebras",cohere:"cohere",nvidia:"nvidia",nebius:"nebius",siliconflow:"siliconflow",hyp:"hyperbolic",hyperbolic:"hyperbolic",dg:"deepgram",deepgram:"deepgram",aai:"assemblyai",assemblyai:"assemblyai",nb:"nanobanana",nanobanana:"nanobanana",ch:"chutes",chutes:"chutes",ark:"volcengine-ark","volcengine-ark":"volcengine-ark",byteplus:"byteplus",bpm:"byteplus",cursor:"cursor",vx:"vertex",vertex:"vertex",vxp:"vertex-partner","vertex-partner":"vertex-partner",gw:"grok-web","grok-web":"grok-web",pw:"perplexity-web","perplexity-web":"perplexity-web",mimo:"xiaomi-mimo","mimo-desktop":"xiaomi-mimo",xmd:"xiaomi-mimo","xiaomi-mimo":"xiaomi-mimo",fish:"fish-audio","fish-audio":"fish-audio",xmtp:"xiaomi-tokenplan","xiaomi-tokenplan":"xiaomi-tokenplan",venice:"venice",fl:"featherless",featherless:"featherless",cf:"cloudflare-ai","cloudflare-ai":"cloudflare-ai",fal:"fal-ai","fal-ai":"fal-ai",stability:"stability-ai","stability-ai":"stability-ai",bfl:"black-forest-labs","black-forest-labs":"black-forest-labs",recraft:"recraft",topaz:"topaz",runway:"runwayml",runwayml:"runwayml",jina:"jina-ai","jina-ai":"jina-ai",polly:"aws-polly","aws-polly":"aws-polly",br:"bedrock",bedrock:"bedrock","aws-bedrock":"bedrock",brx:"bedrock-xai","bedrock-xai":"bedrock-xai","bedrock-grok":"bedrock-xai",agentrouter:"agentrouter",aimlapi:"aimlapi",aiml:"aimlapi",novita:"novita",modal:"modal",mdl:"modal",reka:"reka",nlpcloud:"nlpcloud",nlpc:"nlpcloud",bazaarlink:"bazaarlink",bzl:"bazaarlink",completions:"completions",cpl:"completions",enally:"enally",enly:"enally",freetheai:"freetheai",fta:"freetheai",llm7:"llm7",lepton:"lepton",kluster:"kluster",ai21:"ai21","inference-net":"inference-net",inet:"inference-net",predibase:"predibase",bytez:"bytez",morph:"morph",longcat:"longcat",lc:"longcat",puter:"puter",pu:"puter",uncloseai:"uncloseai",unc:"uncloseai",scaleway:"scaleway",scw:"scaleway",deepinfra:"deepinfra",sambanova:"sambanova",samba:"sambanova",nscale:"nscale",baseten:"baseten",publicai:"publicai","nous-research":"nous","nous-portal":"nous",nous:"nous",ns:"nous","veoaifree-web":"veoaifree-web","veo-free":"veoaifree-web",muse:"muse","muse-ai":"muse","meta-model-api":"muse","muse-code":"muse","muse-subscription":"muse",qdcn:"qoder-cn","qoder-cn":"qoder-cn",nace:"nace",drex:"nace",v1m:"v1m",uc:"uc-web","uc-web":"uc-web",glhf:"glhf",bb:"blackbox",blackbox:"blackbox",ps:"poolside",poolside:"poolside",tr:"tokenrouter",tokenrouter:"tokenrouter",alitp:"alitp-intl","alitp-intl":"alitp-intl",kgw:"kilo-gateway","kilo-gateway":"kilo-gateway",kilogateway:"kilo-gateway",hunyuan:"tencent",tencent:"tencent","tencent-hunyuan":"tencent",qianfan:"baidu",baidu:"baidu",ernie:"baidu","baidu-qianfan":"baidu","llm-7":"llm7",morphllm:"morph","bazaar-link":"bazaarlink",agnes:"agnes","agnes-ai":"agnes","api-airforce":"api-airforce",af:"api-airforce",airforce:"api-airforce",atria:"atria","atria-asi":"atria",bai:"bai","b-ai":"bai",dahl:"dahl","dahl-inference":"dahl","opencode-zen":"opencode-zen",ocz:"opencode-zen",runcrate:"runcrate",rc:"runcrate",sensenova:"sensenova",sn:"sensenova",tokenharbor:"tokenharbor",th:"tokenharbor",thh:"tokenharbor"};function e(a){return d[a]||a}[...Object.keys(d),...Object.values(d)]},92216:(a,b,c)=>{"use strict";c.r(b),c.d(b,{cleanupProviderConnections:()=>t,createProviderConnection:()=>m,deleteProviderConnection:()=>q,deleteProviderConnectionsByProvider:()=>r,getProviderConnectionById:()=>k,getProviderConnections:()=>j,mutateProviderConnection:()=>o,mutateProviderConnectionQuota:()=>p,reorderProviderConnections:()=>s,updateProviderConnection:()=>n});var d=c(27137),e=c(52825),f=c(50743);let g=["displayName","email","globalPriority","defaultModel","accessToken","refreshToken","expiresAt","tokenType","scope","projectId","apiKey","testStatus","lastTested","lastError","lastErrorAt","rateLimitedUntil","expiresIn","errorCode","consecutiveUseCount","idToken","lastRefreshAt"];function h(a){return a?{...(0,f.q)(a.data,{}),id:a.id,provider:a.provider,authType:a.authType,name:a.name,email:a.email,priority:a.priority,isActive:1===a.isActive||!0===a.isActive,createdAt:a.createdAt,updatedAt:a.updatedAt}:null}function i(a,b){let c=function(a){let{id:b,provider:c,authType:d,name:e,email:g,priority:h,isActive:i,createdAt:j,updatedAt:k,...l}=a;return{id:b,provider:c,authType:d,name:e??null,email:g??null,priority:h??null,isActive:+(!1!==i),data:(0,f.s)(l),createdAt:j,updatedAt:k}}(b);a.run(`INSERT INTO providerConnections(id, provider, authType, name, email, priority, isActive, data, createdAt, updatedAt)
1091
1091
  VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
@@ -1102,7 +1102,7 @@ data: ${JSON.stringify(a)}
1102
1102
  `:`data: ${JSON.stringify(a)}
1103
1103
 
1104
1104
  `}},92853:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"morph",alias:"morph",aliases:["morphllm"],category:"apikey",authModes:["apikey"],display:{name:"Morph",icon:"change_history",color:"#14B8A6",textIcon:"MP",website:"https://morphllm.com",notice:{apiKeyUrl:"https://morphllm.com"}},transport:{baseUrl:"https://api.morphllm.com/v1/chat/completions",validateUrl:"https://api.morphllm.com/v1/models",format:"openai"},models:[{id:"morph-v3-large",name:"Morph v3 Large"},{id:"morph-v3-fast",name:"Morph v3 Fast"},{id:"morph-qwen35-397b",name:"Qwen 3.5 397B (Morph)",contextLength:262144},{id:"morph-minimax27-230b",name:"MiniMax M2.7 (Morph)",contextLength:200704},{id:"morph-qwen36-27b",name:"Qwen 3.6 27B (Morph)",contextLength:262144},{id:"morph-dsv4flash",name:"DeepSeek V4 Flash (Morph)",contextLength:1048576}],serviceKinds:["llm"]}},93189:(a,b,c)=>{"use strict";c(42541),c(85450),c(90943),c(23242),c(84238),c(1758),c(8735),c(55599),c(30395),c(72610),c(51525),c(1899),c(42946),c(16605)},93554:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"nace",alias:"nace",aliases:["drex"],category:"apikey",authType:"apikey",authModes:["apikey"],hasProviderSpecificData:!0,priority:48,display:{name:"Nace Drex",icon:"psychology",color:"#1D1D16",textIcon:"DX",website:"https://console.nace.ai",notice:{text:"Drex decision models on the System One protocol (noul / choice / score questions, calibrated probabilities). drex-max also accepts a top-level `images` array; drex-v2.0 is text-only. Paste a console.nace.ai API key (sent as a Bearer token).",apiKeyUrl:"https://console.nace.ai/dashboard/api-keys"}},models:[{id:"drex-max",name:"Drex Max",kind:"systemone"},{id:"drex-v2.0",name:"Drex 2.0",kind:"systemone"}],serviceKinds:["systemone"],systemoneConfig:{baseUrl:"https://console.nace.ai/v1/systemone",path:"/v1/systemone",authType:"apikey",authHeader:"bearer"}}},93745:(a,b,c)=>{"use strict";c.d(b,{E9:()=>t,RF:()=>j,YC:()=>s,oV:()=>r});var d=c(55511),e=c.n(d),f=c(8735);let g=new Map,h=new Map,i=setInterval(()=>{let a=Date.now();for(let[b,c]of g)a-c.lastUsed>f.v1.sessionTtlMs&&g.delete(b)},f.v1.sessionCleanupIntervalMs);function j(a){if(!a)return k();let b=g.get(a);if(b)return b.lastUsed=Date.now(),b.sessionId;if(g.size>=1e3){let a=g.keys().next().value;g.delete(a)}let c=k();return g.set(a,{sessionId:c,lastUsed:Date.now()}),c}function k(){return e().randomUUID()+Date.now().toString()}i.unref&&i.unref();let l=new Map,m=["x-session-id","session-id","session_id","x-amp-thread-id"],n=/_session_([a-f0-9-]+)$/;function o(a){if("string"!=typeof a)return null;let b=a.trim();return!b||b.length>256?null:b}function p(a,b){return a&&"object"==typeof a?o(a[b]??a[b.toLowerCase()]):null}let q=/^[a-z]+\/([0-9a-f-]{36})\//i;function r(a={}){return function({headers:a,body:b,connectionId:c,workspaceId:d,scope:f=""}={}){let g=function(a,b,c=""){let d=function(a){if("string"!=typeof a||!a)return null;let b=a.match(n);if(b)return b[1];if("{"===a[0])try{return o(JSON.parse(a)?.session_id)}catch{}return null}(b?.metadata?.user_id)||p(a,"x-claude-code-session-id");if(d)return`claude:${d}`;let e=function(a){let b=a?.request?.sessionId;if(null!=b&&""!==b)return o(String(b));let c="string"==typeof a?.requestId?a.requestId.match(q):null;return c?o(c[1]):null}(b);if(e)return`antigravity:${e}`;for(let b of m){let c=p(a,b);if(c)return c}let f="kiro"===c?null:p(a,"x-client-request-id");return f||o(b?.prompt_cache_key)||o(b?.session_id)||o(b?.conversation_id)||("kiro"===c?null:o(b?.metadata?.user_id))||null}(a,b,f);if(g)return{sessionId:g,ephemeral:!1};let h="kiro"===f?null:function(a,b){var c;let d=function(a){let b=Array.isArray(a?.input)?a.input:Array.isArray(a?.messages)?a.messages:null;if(!b)return"";let c="";for(let a of b)if(a?.role==="assistant"){if("string"==typeof a.content)c+=a.content;else if(Array.isArray(a.content))for(let b of a.content)c+=b?.text||b?.output||"";if(c.length>=50)break}return c}(b);if(d.length<50)return null;let f=(c=`${a}:${d.slice(0,50)}`,e().createHash("sha256").update(c).digest("hex").slice(0,16)),g=l.get(f);if(g)return g.lastUsed=Date.now(),g.sessionId;l.size>=5e3&&l.delete(l.keys().next().value);let h=k();return l.set(f,{sessionId:h,lastUsed:Date.now()}),h}(`${f}:${c||""}`,b);if(h)return{sessionId:h,ephemeral:!1};let i=o(d);return i?{sessionId:i,ephemeral:!1}:"kiro"===f?{sessionId:k(),ephemeral:!0}:{sessionId:j(c),ephemeral:!1}}(a).sessionId}function s(a,b,c,d=""){return r({headers:b?.rawHeaders,body:a,connectionId:c,scope:d})}function t(a){let b=o(a);if(!b)return null;if(/^-?\d+$/.test(b))return b;let c=0x7fffffffffffffffn&e().createHash("sha256").update(b).digest().readBigUInt64BE(0);return`-${c.toString()}`}let u=setInterval(()=>{let a=Date.now();for(let[b,c]of l)a-c.lastUsed>f.v1.sessionTtlMs&&l.delete(b);for(let[b,c]of h)a-c.lastUsed>f.v1.sessionTtlMs&&h.delete(b)},f.v1.sessionCleanupIntervalMs);u.unref&&u.unref()},93818:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"baidu",alias:"qianfan",aliases:["ernie","baidu-qianfan"],category:"apikey",authModes:["apikey"],display:{name:"Baidu Qianfan",icon:"search",color:"#2932E1",textIcon:"BD",website:"https://cloud.baidu.com/product/qianfan.html",notice:{apiKeyUrl:"https://console.bce.baidu.com/qianfan/ais/console/applicationConsole/application"}},transport:{baseUrl:"https://qianfan.baidubce.com/v2/chat/completions",validateUrl:"https://qianfan.baidubce.com/v2/models",format:"openai"},models:[{id:"deepseek-v4-pro",name:"DeepSeek V4 Pro",contextLength:1048576},{id:"deepseek-v4-flash",name:"DeepSeek V4 Flash",contextLength:1048576},{id:"glm-5.2",name:"GLM 5.2",contextLength:512e3},{id:"glm-5.1",name:"GLM 5.1",contextLength:198e3},{id:"kimi-k2.6",name:"Kimi K2.6",contextLength:262144},{id:"qwen3.5-397b-a17b",name:"Qwen 3.5 397B A17B",contextLength:262144},{id:"qwen3.5-27b",name:"Qwen 3.5 27B",contextLength:262144}],serviceKinds:["llm"]}},94026:(a,b,c)=>{"use strict";c.d(b,{t:()=>j});var d=c(69762),e=c(42541),f=c(58455),g=c(18831),h=c(82706),i=c(64375);function j(a,b,c){let d={model:a,messages:[],stream:c};if(b.max_tokens&&(d.max_tokens=(0,f.M)(b)),void 0!==b.temperature&&(d.temperature=b.temperature),b.thinking?.type==="enabled"){let a=Number(b.thinking.budget_tokens);Number.isFinite(a)?a>0&&(d.reasoning_effort=a<=2048?"low":a<=16384?"medium":(0,i.v)(a)||"high"):d.reasoning_effort="medium"}else if(b.thinking?.type==="adaptive"){let a=(0,g.uA)(b);d.thinking=a.thinking,d.reasoning_effort=a.output_config.effort}if(!d.reasoning_effort){let a=b.output_config?.effort||b.reasoning_effort;"string"==typeof a&&a.trim()&&(d.reasoning_effort=a.trim())}if(b.system){let a=Array.isArray(b.system)?b.system.map(a=>a.text||"").join("\n"):b.system;a&&d.messages.push({role:"system",content:a})}if(b.messages&&Array.isArray(b.messages))for(let a=0;a<b.messages.length;a++){let c=function(a){let b="user"===a.role||"tool"===a.role?"user":"assistant";if("string"==typeof a.content)return{role:b,content:a.content};let c=(0,h.F2)(a.content);if(c.length>0||Array.isArray(a.content)){let a=[],d=[],e=[],f=[],g=[];for(let b of c)switch(b.type){case"text":a.push({type:"text",text:b.text});break;case"image":{let c=k(b.source);c&&a.push(c)}break;case"thinking":b.thinking&&g.push(b.thinking);break;case"redacted_thinking":b.data&&g.push(b.data);break;case"tool_use":d.push({id:b.id,type:"function",function:{name:b.name,arguments:JSON.stringify(b.input||{})}});break;case"tool_result":{let a="";if("string"==typeof b.content)a=b.content;else if(Array.isArray(b.content)){let c=b.content.filter(a=>"text"===a.type).map(a=>a.text).join("\n"),d=b.content.filter(a=>"image"===a.type).map(a=>k(a.source)).filter(Boolean);f.push(...d),a=c||(d.length>0?"Tool returned image attachment(s) in the following user message.":JSON.stringify(b.content))}else b.content&&(a=JSON.stringify(b.content));b.is_error&&(a=`Tool result error (is_error=true):
1105
- ${a}`),e.push({role:"tool",tool_call_id:b.tool_use_id,content:a})}}let h=g.join("\n");if(e.length>0){let b=[...a,...f],c=[...e];if(b.length>0){let a=1===b.length&&"text"===b[0].type?b[0].text:b;c.push({role:"user",content:a})}return d.length>0&&c.push(l(d,[],h)),c}if(d.length>0)return l(d,a,h);if(a.length>0||h){let c={role:b,...a.length>0&&{content:1===a.length&&"text"===a[0].type?a[0].text:a}};return"assistant"===b&&h&&(c.reasoning_content=h),c}if(0===c.length)return{role:b,content:""}}return null}(b.messages[a]);c&&(Array.isArray(c)?d.messages.push(...c):d.messages.push(c))}return function(a){for(let b=0;b<a.length;b++){let c=a[b];if("assistant"===c.role&&c.tool_calls&&c.tool_calls.length>0){let d=c.tool_calls.map(a=>a.id),e=new Set,f=b+1;for(let c=b+1;c<a.length;c++){let b=a[c];if("tool"===b.role&&b.tool_call_id)e.add(b.tool_call_id),f=c+1;else break}let g=d.filter(a=>!e.has(a));if(g.length>0){let c=g.map(a=>({role:"tool",tool_call_id:a,content:"[No response received]"}));a.splice(f,0,...c),b=f+c.length-1}}}}(d.messages),b.tools&&Array.isArray(b.tools)&&(d.tools=b.tools.filter(a=>!a.type||"function"===a.type).map(a=>({type:"function",function:{name:a.name,description:String(a.description||""),parameters:a.input_schema||{type:"object",properties:{}}}})),0===d.tools.length&&(delete d.tools,delete d.tool_choice)),b.tool_choice&&(d.tool_choice=function(a){if(!a)return"auto";if("string"==typeof a)return a;switch(a.type){case"auto":default:return"auto";case"any":return"required";case"tool":return{type:"function",function:{name:a.name}}}}(b.tool_choice)),d}function k(a){return a?.type==="base64"&&a.data?{type:"image_url",image_url:{url:`data:${a.media_type||"image/png"};base64,${a.data}`}}:a?.type==="url"&&/^https?:\/\//.test(a.url||"")?{type:"image_url",image_url:{url:a.url}}:null}function l(a,b,c){let d={role:"assistant",tool_calls:a};return b.length>0&&(d.content=1===b.length&&"text"===b[0].type?b[0].text:b),c&&(d.reasoning_content=c),d}(0,d.kz)(e.h.CLAUDE,e.h.OPENAI,j,null)},94050:(a,b,c)=>{"use strict";let{states:d,opcodes:e}=c(62026),{isUtf8:f}=c(4573),{removeHTTPWhitespace:g}=c(16537),{collectASequenceOfCodePointsFast:h}=c(70745);function i(a){return a===e.CLOSE||a===e.PING||a===e.PONG}function j(a){return a===e.CONTINUATION}function k(a){return a===e.TEXT||a===e.BINARY}a.exports={isConnecting:function(a){return a===d.CONNECTING},isEstablished:function(a){return a===d.OPEN},isClosing:function(a){return a===d.CLOSING},isClosed:function(a){return a===d.CLOSED},fireEvent:function(a,b,c=(a,b)=>new Event(a,b),d={}){let e=c(a,d);b.dispatchEvent(e)},isValidSubprotocol:function(a){if(0===a.length)return!1;for(let b=0;b<a.length;++b){let c=a.charCodeAt(b);if(c<33||c>126||34===c||40===c||41===c||44===c||47===c||58===c||59===c||60===c||61===c||62===c||63===c||64===c||91===c||92===c||93===c||123===c||125===c)return!1}return!0},isValidStatusCode:function(a){return a>=1e3&&a<1015?1004!==a&&1005!==a&&1006!==a:a>=3e3&&a<=4999},websocketMessageReceived:function(a,b,c){a.onMessage(b,c)},utf8Decode:(()=>{if("string"==typeof process.versions.icu){let a=new TextDecoder("utf-8",{fatal:!0});return a.decode.bind(a)}return function(a){if(f(a))return a.toString("utf-8");throw TypeError("Invalid utf-8 received.")}})(),isControlFrame:i,isContinuationFrame:j,isTextBinaryFrame:k,isValidOpcode:function(a){return k(a)||j(a)||i(a)},parseExtensions:function(a){let b={position:0},c=new Map;for(;b.position<a.length;){let[d,e=""]=h(";",a,b).split("=",2);c.set(g(d,!0,!1),g(e,!1,!0)),b.position++}return c},isValidClientWindowBits:function(a){if(0===a.length)return!1;for(let b=0;b<a.length;b++){let c=a.charCodeAt(b);if(c<48||c>57)return!1}let b=Number.parseInt(a,10);return b>=8&&b<=15},toArrayBuffer:function(a){return a.byteLength===a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer},getURLRecord:function(a,b){let c;try{c=new URL(a,b)}catch(a){throw new DOMException(a,"SyntaxError")}if("http:"===c.protocol?c.protocol="ws:":"https:"===c.protocol&&(c.protocol="wss:"),"ws:"!==c.protocol&&"wss:"!==c.protocol)throw new DOMException("expected a ws: or wss: url","SyntaxError");if(c.hash.length||c.href.endsWith("#"))throw new DOMException("hash","SyntaxError");return c},validateCloseCodeAndReason:function(a,b){if(null!==a&&1e3!==a&&(a<3e3||a>4999))throw new DOMException("invalid code","InvalidAccessError");if(null!==b){let a=Buffer.byteLength(b);if(a>123)throw new DOMException(`Reason must be less than 123 bytes; received ${a}`,"SyntaxError")}}}},94231:(a,b,c)=>{"use strict";c.d(b,{R:()=>k});var d=c(88164),e=c(11484),f=c(31719);let g=new Set(["mimo-x-pro-preview","mimo-x-flash-preview"]),h=`${f.SE}/api/chat/completions`,i=Symbol("xiaomiMimoServiceCookie");function j(){return{response:Response.json({error:{message:"Xiaomi MiMo Desktop session is unavailable. Open Xiaomi MiMo Desktop, sign in again, and retry.",type:"authentication_error"}},{status:401}),url:h,headers:{},transformedBody:null}}class k extends d.L{constructor(){super("xiaomi-mimo")}static isPreviewModel(a){return g.has(a)}buildUrl(a,b,c,d,e){return k.isPreviewModel(a)?h:e?.runtimeTransport?.baseUrl||super.buildUrl(a,b,c,d)}buildHeaders(a,b,c){if(a?.[i]){let c={"Content-Type":"application/json",Cookie:a[i],"User-Agent":f.$6};return b&&(c.Accept="text/event-stream"),c}let d=c?.runtimeTransport,e={"Content-Type":"application/json",...d?.headers||{}};return d?.authHeader==="x-api-key"?e["x-api-key"]=a.apiKey||a.accessToken:e.Authorization=`Bearer ${a.apiKey||a.accessToken}`,b&&(e.Accept="text/event-stream"),e}transformRequest(a,b,c,d,e){if(!k.isPreviewModel(a))return b;let f={...b,model:`xiaomi/${a}`};return Object.hasOwn(f,"thinking")||(f.thinking={type:"enabled"}),Object.hasOwn(f,"temperature")||(f.temperature=1),Object.hasOwn(f,"top_p")||(f.top_p=.95),Object.hasOwn(f,"max_tokens")||(f.max_tokens=4096),f}async execute(a){if(!k.isPreviewModel(a.model))return super.execute(a);let b=a.credentials?.providerSpecificData||{},c=()=>(0,f.Me)(b,a.proxyOptions,{signal:a.signal}),d=await c();if(!d)return j();let g=c=>{let d={...a.credentials,providerSpecificData:{...b}};return Object.defineProperty(d,i,{value:c}),super.execute({...a,credentials:d})},h=await g(d);return 401!==h.response.status?h:(await (0,e.aI)(h.response),(0,f.Nv)(b),d=await c())?h=await g(d):j()}}},94279:(a,b,c)=>{"use strict";let{writeFile:d,readFile:e,mkdir:f}=c(51455),{dirname:g,resolve:h}=c(76760),{setTimeout:i,clearTimeout:j}=c(87997),{InvalidArgumentError:k,UndiciError:l}=c(61448),{setHeader:m}=c(84285),{hashId:n,isUrlExcludedFactory:o,normalizeHeaders:p,createHeaderFilters:q}=c(47800);function r(a,b,c={}){var d,e,f;let g=new URL(a.path,a.origin),h=a._normalizedHeaders||p(a.headers);return a._normalizedHeaders||(a._normalizedHeaders=h),{method:a.method||"GET",url:function(a,b,c){if(!1===b)return`${a.origin}${a.pathname}`;if(c){let b=String(c(a.searchParams)??"");return b?`${a.origin}${a.pathname}?${b}`:`${a.origin}${a.pathname}`}return a.toString()}(g,c.matchQuery,c.normalizeQuery),headers:s(h,b,c),body:(d=a.body,e=c.matchBody,f=c.normalizeBody,!1===e?"":f?String(f(d)??""):d?String(d):"")}}function s(a,b,c={}){if(!a||"object"!=typeof a)return{};let{caseSensitive:d=!1}=c,e={},{ignore:f,exclude:g,match:h}=b;for(let[b,c]of Object.entries(a)){let a=d?b:b.toLowerCase();!(g.has(a)||f.has(a))&&(0===h.size||h.has(a))&&m(e,a,c)}return e}function t(a,b,c={}){if(!a||"object"!=typeof a)return{};let{caseSensitive:d=!1}=c,e={},{exclude:f}=b;for(let[b,c]of Object.entries(a)){let a=d?b:b.toLowerCase();f.has(a)||m(e,a,c)}return e}function u(a){let b=[a.method,a.url];if(a.headers&&"object"==typeof a.headers)for(let c of Object.keys(a.headers).sort()){let d=Array.isArray(a.headers[c])?a.headers[c]:[a.headers[c]];for(let a of(b.push(c),d.sort()))b.push(String(a))}return b.push(a.body),n(b.join("|"))}class v{#cD;#cE;#cF=new Map;#cG;#cH=1/0;#cI=!1;#cJ;constructor(a={}){this.#cG=a.snapshotPath,this.#cH=a.maxSnapshots||1/0,this.#cI=a.autoFlush||!1,this.flushInterval=a.flushInterval||3e4,this._flushTimer=null,this.matchOptions={matchHeaders:a.matchHeaders||[],ignoreHeaders:a.ignoreHeaders||[],excludeHeaders:a.excludeHeaders||[],matchBody:!1!==a.matchBody,normalizeBody:a.normalizeBody||void 0,matchQuery:!1!==a.matchQuery,normalizeQuery:a.normalizeQuery||void 0,caseSensitive:a.caseSensitive||!1},this.#cJ=q(this.matchOptions),this.shouldRecord=a.shouldRecord||(()=>!0),this.shouldPlayback=a.shouldPlayback||(()=>!0),this.#cE=o(a.excludeUrls),this.#cI&&this.#cG&&this.#cK()}async record(a,b){if(!this.shouldRecord(a)||this.isUrlExcluded(a))return;let c=r(a,this.#cJ,this.matchOptions),d=u(c),e=p(b.headers),f={statusCode:b.statusCode,headers:t(e,this.#cJ,this.matchOptions),body:Buffer.isBuffer(b.body)?b.body.toString("base64"):Buffer.from(String(b.body||"")).toString("base64"),trailers:b.trailers};if(this.#cF.size>=this.#cH&&!this.#cF.has(d)){let a=this.#cF.keys().next().value;this.#cF.delete(a)}let g=this.#cF.get(d);g&&g.responses?(g.responses.push(f),g.timestamp=new Date().toISOString()):this.#cF.set(d,{request:c,responses:[f],callCount:0,timestamp:new Date().toISOString()}),this.#cI&&this.#cG&&this.#cL()}isUrlExcluded(a){let b=new URL(a.path,a.origin).toString();return this.#cE(b)}findSnapshot(a){if(!this.shouldPlayback(a)||this.isUrlExcluded(a))return;let b=u(r(a,this.#cJ,this.matchOptions)),c=this.#cF.get(b);if(!c)return;let d=c.callCount||0,e=Math.min(d,c.responses.length-1);return c.callCount=d+1,{...c,response:c.responses[e]}}async loadSnapshots(a){let b=a||this.#cG;if(!b)throw new k("Snapshot path is required");try{let a=await e(h(b),"utf8"),c=JSON.parse(a);if(Array.isArray(c))for(let{hash:a,snapshot:b}of(this.#cF.clear(),c))this.#cF.set(a,b);else this.#cF=new Map(Object.entries(c))}catch(a){if("ENOENT"===a.code)this.#cF.clear();else throw new l(`Failed to load snapshots from ${b}`,{cause:a})}}async saveSnapshots(a){let b=a||this.#cG;if(!b)throw new k("Snapshot path is required");let c=h(b);await f(g(c),{recursive:!0});let e=Array.from(this.#cF.entries()).map(([a,b])=>({hash:a,snapshot:b}));await d(c,JSON.stringify(e,null,2),{flush:!0})}clear(){this.#cF.clear()}getSnapshots(){return Array.from(this.#cF.values())}size(){return this.#cF.size}resetCallCounts(){for(let a of this.#cF.values())a.callCount=0}deleteSnapshot(a){let b=u(r(a,this.#cJ,this.matchOptions));return this.#cF.delete(b)}getSnapshotInfo(a){let b=u(r(a,this.#cJ,this.matchOptions)),c=this.#cF.get(b);return c?{hash:b,request:c.request,responseCount:c.responses?c.responses.length:+!!c.response,callCount:c.callCount||0,timestamp:c.timestamp}:null}replaceSnapshots(a){if(this.#cF.clear(),Array.isArray(a))for(let{hash:b,snapshot:c}of a)this.#cF.set(b,c);else a&&"object"==typeof a&&(this.#cF=new Map(Object.entries(a)))}#cK(){return this.#cL()}#cM(){this.#cD&&(j(this.#cD),this.saveSnapshots().catch(()=>{}),this.#cD=null)}#cL(){this.#cD=i(()=>{this.saveSnapshots().catch(()=>{}),this.#cI?this.#cD?.refresh():this.#cD=null},1e3)}destroy(){this.#cM(),this.#cD&&(j(this.#cD),this.#cD=null)}async close(){this.#cG&&0!==this.#cF.size&&await this.saveSnapshots(),this.destroy()}}a.exports={SnapshotRecorder:v,formatRequestKey:r,createRequestHash:u,filterHeadersForMatching:s,filterHeadersForStorage:t,createHeaderFilters:q}},95095:(a,b,c)=>{"use strict";let d=c(7344),e=c(31825),{kOriginless:f,kUrl:g}=c(49176);class h extends d{#cN=null;#cO=null;constructor(a,b={}){super(b),this.#cN=a,this.#cO=b,this[g]=a[g],this[f]=a[f]}dispatch(a,b){let c=new e({...a,retryOptions:this.#cO},{dispatch:this.#cN.dispatch.bind(this.#cN),handler:b});return this.#cN.dispatch(a,c)}get webSocketOptions(){return this.#cN.webSocketOptions}get eventSourceOptions(){return this.#cN.eventSourceOptions}close(){return this.#cN.close()}destroy(){return this.#cN.destroy()}}a.exports=h},95956:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"chatgpt-web",priority:220,alias:"chatgpt-web",aliases:["cg"],uiAlias:"chatgpt-web",category:"webCookie",authType:"cookie",authModes:["cookie"],serviceKinds:["image"],display:{name:"ChatGPT Web",icon:"auto_awesome",color:"#10A37F",textIcon:"CG",website:"https://chatgpt.com",notice:{text:"Paste your chatgpt.com cookie header containing __Secure-next-auth.session-token (or a full Playwright storage-state JSON)"}},transport:{baseUrl:"https://chatgpt.com",format:"openai",authType:"cookie"},models:[{id:"gpt-5-6",name:"GPT-5.6 Sol — Instant"},{id:"gpt-5-6-thinking",name:"GPT-5.6 Sol — Thinking",supportsReasoning:!0},{id:"gpt-5-6-pro",name:"GPT-5.6 Sol — Pro",supportsReasoning:!0},{id:"gpt-5.6-luna-free",name:"GPT-5.6 Luna — Free"},{id:"gpt-5.6-luna-free-thinking",name:"GPT-5.6 Luna — Free Thinking",supportsReasoning:!0},{id:"gpt-5-5-instant",name:"GPT-5.5 — Instant"},{id:"gpt-5-5-thinking",name:"GPT-5.5 — Thinking",supportsReasoning:!0},{id:"gpt-5-5-pro",name:"GPT-5.5 — Pro",supportsReasoning:!0},{id:"gpt-image-2",name:"GPT Image 2 (web)",params:["n","size"],kind:"image"}]}},96050:(a,b,c)=>{"use strict";c.a(a,async(a,b)=>{try{c(19458),c(42541),c(36986),c(27696),c(8735);var d=c(65333);c(1447),c(54027),c(6699),c(93745),c(91083),c(60856),c(83651),c(98322),c(64334),c(2858),c(51590);var e=a([d]);d=(e.then?(await e)():e)[0],b()}catch(a){b(a)}})},96947:(a,b,c)=>{"use strict";c.d(b,{DO:()=>u,LP:()=>t});var d=c(77598),e=c(79154),f=c(99939),g=c(87886),h=c(14e3);globalThis._backgroundTokenRefreshState||(globalThis._backgroundTokenRefreshState={started:!1,startTimer:null,timer:null,runningPromise:null,retryByConnection:new Map});let i=globalThis._backgroundTokenRefreshState;function j(a){let b=a?.refreshToken;return b?(0,d.createHash)("sha256").update(String(b)).digest("hex"):null}async function k(a){let{getProviderConnectionById:b}=await Promise.resolve().then(c.bind(c,70321));return b(a)}async function l(a,b){let{mutateProviderConnection:d}=await Promise.resolve().then(c.bind(c,70321));return d(a,b)}async function m(a,b){return(0,e.Vq)(a,b,g)}function n(a,b){return!!(a&&b&&a.refreshToken===b.refreshToken&&a.accessToken===b.accessToken)}async function o(a,b,d={}){let e=d.mutateConnection||l,f=d.now||Date.now,{buildProviderCredentialUpdates:g}=await c.e(3815).then(c.bind(c,73815));return!!await e(a.id,c=>n(c,a)?g({...b,existingProviderSpecificData:c.providerSpecificData},f()):null)}async function p(a,b,c={}){let d=c.mutateConnection||l;return!!await d(a.id,c=>n(c,a)?{lastError:"OAuth refresh credential rejected; reconnect this account.",lastErrorAt:b.at,lastErrorType:"auth",errorCode:b.code,failureClass:"reauth_required"}:null)}async function q(a,b={}){let c,d=b.readConnection||k,e=b.refreshCredentials||m,f=b.persistCredentials,g=b.markReauthRequired,i=b.mutateConnection||l,j=b.now||Date.now,r=b.scheduler||h.iQ,s=await d(a.id);if(!s||!1===s.isActive)return{refreshed:!1,missing:!0};if(s.refreshToken!==a.refreshToken)return{refreshed:!1,stale:!0};try{c=await r.run(s.provider,()=>e(s.provider,{...s,connectionId:s.id}),{signal:b.signal})}catch(a){if(a?.permanent===!0){let b={code:String(a.code||"invalid_refresh_token").replace(/[^a-zA-Z0-9_.:-]/g,"_").slice(0,120)||"invalid_refresh_token",at:new Date(j()).toISOString()},c=!0;if(g?await g(s,b):c=await p(s,b,{mutateConnection:i}),!c)return{refreshed:!1,stale:!0}}throw a}if(!c||!c.accessToken&&!c.apiKey&&!c.token){let a=Error("OAuth refresh temporarily unavailable");throw a.name="OAuthRefreshTransientError",a.code="REFRESH_UNAVAILABLE",a.permanent=!1,a}let t={...c,lastRefreshAt:c.lastRefreshAt||new Date(j()).toISOString()};if(f){let b=await d(a.id);if(!n(b,s))return{refreshed:!1,stale:!0};await f(a.id,{...t,existingProviderSpecificData:b.providerSpecificData})}else if(!await o(s,t,{mutateConnection:i,now:j}))return{refreshed:!1,stale:!0};return{refreshed:!0}}async function r(a,b={}){let c=b.refreshConnection||q,d=Math.max(1,Number(b.concurrency)||4),e="function"==typeof b.now?b.now():Date.now(),f=0,h=0,k=0,l=Array.from({length:Math.min(d,a.length)},async()=>{for(;f<a.length;){let b=a[f++];try{await c(b),i.retryByConnection.delete(b.id),h+=1}catch(a){!function(a,b,c=!1){let d=i.retryByConnection.get(a.id),e=(d?.attempts||0)+1,f=Math.min(9e5,3e4*2**(e-1));i.retryByConnection.set(a.id,{attempts:e,retryAt:c?1/0:b+f,tokenFingerprint:j(a)})}(b,e,a?.permanent===!0),k+=1,g.warn("BG_TOKEN_REFRESH","Connection refresh failed",{id:b.id,provider:b.provider,code:a?.code||null,permanent:a?.permanent===!0})}}});return await Promise.all(l),{attempted:a.length,succeeded:h,failed:k}}async function s(){let{getProviderConnections:a}=await Promise.resolve().then(c.bind(c,70321));return a({isActive:!0})}function t(a={}){if(i.started)return!1;i.started=!0;let b=Number.isFinite(a.intervalMs)&&a.intervalMs>0?a.intervalMs:3e5,c=a.random||Math.random,d=async()=>{await function(a={}){let b,c;if(i.runningPromise)return i.runningPromise;let d=(b=a.listConnections||s,c=a.now||Date.now,(async()=>{try{let d=await b(),g=function(a,b=Date.now()){return Array.isArray(a)?a.filter(a=>{let c;if(!a||!1===a.isActive||"oauth"!==String(a.authType||"").trim().toLowerCase().replace(/[_ -]/g,"")||"reauth_required"===a.failureClass||!a.refreshToken||(c=i.retryByConnection.get(a.id))&&(c.tokenFingerprint!==j(a)?(i.retryByConnection.delete(a.id),!1):!(c.retryAt<=b)))return!1;let d=(0,e.Dz)(a);if(null===d)return!1;let g=(0,f.Og)(a.provider);return d-b<Math.max(18e5,Number.isFinite(g)?g:0)}):[]}(d,c());return await r(g,{...a,now:c})}catch(a){return g.warn("BG_TOKEN_REFRESH","Refresh sweep failed",{code:a?.code||null}),{attempted:0,succeeded:0,failed:0}}})()).finally(()=>{i.runningPromise===d&&(i.runningPromise=null)});return i.runningPromise=d,d}(a),i.started&&(i.timer=setTimeout(d,function(a,b=Math.random){return Math.round(a*(.9+.2*Math.max(0,Math.min(1,Number(b())||0))))}(b,c)),i.timer.unref?.())};return i.startTimer=setTimeout(()=>{i.startTimer=null,d()},1e4),i.startTimer.unref?.(),!0}function u(){return i.startTimer&&clearTimeout(i.startTimer),i.timer&&clearTimeout(i.timer),i.startTimer=null,i.timer=null,i.started=!1,i.runningPromise||Promise.resolve()}},97210:(a,b,c)=>{"use strict";let{createInflateRaw:d,Z_DEFAULT_WINDOWBITS:e}=c(38522),{isValidClientWindowBits:f}=c(94050),{MessageSizeExceededError:g}=c(61448),h=Buffer.from([0,0,255,255]),i=Symbol("kBuffer"),j=Symbol("kLength");class k{#cP;#cO={};#cf=0;constructor(a,b){this.#cO.serverNoContextTakeover=a.has("server_no_context_takeover"),this.#cO.serverMaxWindowBits=a.get("server_max_window_bits"),this.#cf=b.maxPayloadSize}decompress(a,b,c){if(!this.#cP){let a=e;if(this.#cO.serverMaxWindowBits){if(!f(this.#cO.serverMaxWindowBits))return void c(Error("Invalid server_max_window_bits"));a=Number.parseInt(this.#cO.serverMaxWindowBits)}try{this.#cP=d({windowBits:a})}catch(a){c(a);return}this.#cP[i]=[],this.#cP[j]=0,this.#cP.on("data",a=>{if(this.#cP[j]+=a.length,this.#cf>0&&this.#cP[j]>this.#cf){c(new g),this.#cP.removeAllListeners(),this.#cP.destroy(),this.#cP=null;return}this.#cP[i].push(a)}),this.#cP.on("error",a=>{this.#cP=null,c(a)})}this.#cP.write(a),b&&this.#cP.write(h),this.#cP.flush(()=>{if(!this.#cP)return;let a=Buffer.concat(this.#cP[i],this.#cP[j]);this.#cP[i].length=0,this.#cP[j]=0,c(null,a)})}}a.exports={PerMessageDeflate:k}},97356:(a,b,c)=>{"use strict";let d=c(4573),{Transform:e}=c(57075),{isASCIINumber:f,isValidLastEventId:g}=c(26376),h=d.kStringMaxLength,i=Buffer.from("data"),j=Buffer.from("event"),k=Buffer.from("id"),l=Buffer.from("retry");function m(a,b,c){if(b!==c.length)return!1;for(let d=0;d<b;d++)if(a[d]!==c[d])return!1;return!0}function n(){let a=Error("EventSource message size exceeded");return a.aborted=!1,a}class o extends e{state;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;chunks=[];chunkIndex=0;pos=0;lineChunkIndex=0;linePos=0;lineLength=0;eventSize=0;eventFieldSizes={data:0,event:0,id:0,retry:0};dataLineCount=0;maxEventSize;maxDataLines;maxBufferedChunks;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(a={}){a.readableObjectMode=!0,super(a),this.state=a.eventSourceSettings||{},this.maxEventSize=a.maxEventSize??h;let b=this.maxEventSize>0?Math.min(131072,Math.max(1024,Math.floor(this.maxEventSize/128))):0;this.maxDataLines=b,this.maxBufferedChunks=b,a.push&&(this.push=a.push)}_transform(a,b,c){if(0===a.length)return void c();if(this.maxEventSize>0&&this.chunks.length>=this.maxBufferedChunks&&10!==a[0]&&13!==a[0])return void c(n());if(this.chunks.push(a),this.checkBOM&&this.handleBOM())return void c();for(;this.hasCurrentByte();){let a=this.currentByte();if(this.eventEndCheck){if(this.crlfCheck){if(10===a){this.crlfCheck=!1,this.consumeCurrentByte();continue}this.crlfCheck=!1}if(10===a||13===a){13===a&&(this.crlfCheck=!0),this.consumeCurrentByte(),this.hasPendingEvent()&&this.processEvent(this.event),this.clearEvent();continue}this.eventEndCheck=!1;continue}if(10===a||13===a){13===a&&(this.crlfCheck=!0);try{this.parseLine(this.readLine(),this.event)}catch(a){c(a);return}this.consumeCurrentByte(),this.eventEndCheck=!0;continue}if(this.maxEventSize>0&&++this.lineLength>this.maxEventSize+7)return void c(n());this.advanceCursor()}c()}_destroy(a,b){this.chunks.length=0,this.clearEvent(),super._destroy(a,b)}parseLine(a,b){if(0===a.length)return;let c=a.indexOf(58);if(0===c)return;let d=a.length,e=a.length;if(-1!==c&&(d=c,32===a[e=c+1]&&++e),m(a,d,i)){if(this.maxEventSize>0&&this.dataLineCount>=this.maxDataLines)throw n();let c=a.length-e,d=this.eventFieldSizes.data+ +(void 0!==b.data)+c;this.setEventFieldSize("data",d);let f=a.toString("utf8",e);void 0===b.data?b.data=f:b.data+=`
1105
+ ${a}`),e.push({role:"tool",tool_call_id:b.tool_use_id,content:a})}}let h=g.join("\n");if(e.length>0){let b=[...a,...f],c=[...e];if(b.length>0){let a=1===b.length&&"text"===b[0].type?b[0].text:b;c.push({role:"user",content:a})}return d.length>0&&c.push(l(d,[],h)),c}if(d.length>0)return l(d,a,h);if(a.length>0||h){let c={role:b,...a.length>0&&{content:1===a.length&&"text"===a[0].type?a[0].text:a}};return"assistant"===b&&h&&(c.reasoning_content=h),c}if(0===c.length)return{role:b,content:""}}return null}(b.messages[a]);c&&(Array.isArray(c)?d.messages.push(...c):d.messages.push(c))}return function(a){for(let b=0;b<a.length;b++){let c=a[b];if("assistant"===c.role&&c.tool_calls&&c.tool_calls.length>0){let d=c.tool_calls.map(a=>a.id),e=new Set,f=b+1;for(let c=b+1;c<a.length;c++){let b=a[c];if("tool"===b.role&&b.tool_call_id)e.add(b.tool_call_id),f=c+1;else break}let g=d.filter(a=>!e.has(a));if(g.length>0){let c=g.map(a=>({role:"tool",tool_call_id:a,content:"[No response received]"}));a.splice(f,0,...c),b=f+c.length-1}}}}(d.messages),b.tools&&Array.isArray(b.tools)&&(d.tools=b.tools.filter(a=>!a.type||"function"===a.type).map(a=>({type:"function",function:{name:a.name,description:String(a.description||""),parameters:a.input_schema||{type:"object",properties:{}}}})),0===d.tools.length&&(delete d.tools,delete d.tool_choice)),b.tool_choice&&(d.tool_choice=function(a){if(!a)return"auto";if("string"==typeof a)return a;switch(a.type){case"auto":default:return"auto";case"any":return"required";case"tool":return{type:"function",function:{name:a.name}}}}(b.tool_choice)),d}function k(a){return a?.type==="base64"&&a.data?{type:"image_url",image_url:{url:`data:${a.media_type||"image/png"};base64,${a.data}`}}:a?.type==="url"&&/^https?:\/\//.test(a.url||"")?{type:"image_url",image_url:{url:a.url}}:null}function l(a,b,c){let d={role:"assistant",tool_calls:a};return b.length>0&&(d.content=1===b.length&&"text"===b[0].type?b[0].text:b),c&&(d.reasoning_content=c),d}(0,d.kz)(e.h.CLAUDE,e.h.OPENAI,j,null)},94050:(a,b,c)=>{"use strict";let{states:d,opcodes:e}=c(62026),{isUtf8:f}=c(4573),{removeHTTPWhitespace:g}=c(16537),{collectASequenceOfCodePointsFast:h}=c(70745);function i(a){return a===e.CLOSE||a===e.PING||a===e.PONG}function j(a){return a===e.CONTINUATION}function k(a){return a===e.TEXT||a===e.BINARY}a.exports={isConnecting:function(a){return a===d.CONNECTING},isEstablished:function(a){return a===d.OPEN},isClosing:function(a){return a===d.CLOSING},isClosed:function(a){return a===d.CLOSED},fireEvent:function(a,b,c=(a,b)=>new Event(a,b),d={}){let e=c(a,d);b.dispatchEvent(e)},isValidSubprotocol:function(a){if(0===a.length)return!1;for(let b=0;b<a.length;++b){let c=a.charCodeAt(b);if(c<33||c>126||34===c||40===c||41===c||44===c||47===c||58===c||59===c||60===c||61===c||62===c||63===c||64===c||91===c||92===c||93===c||123===c||125===c)return!1}return!0},isValidStatusCode:function(a){return a>=1e3&&a<1015?1004!==a&&1005!==a&&1006!==a:a>=3e3&&a<=4999},websocketMessageReceived:function(a,b,c){a.onMessage(b,c)},utf8Decode:(()=>{if("string"==typeof process.versions.icu){let a=new TextDecoder("utf-8",{fatal:!0});return a.decode.bind(a)}return function(a){if(f(a))return a.toString("utf-8");throw TypeError("Invalid utf-8 received.")}})(),isControlFrame:i,isContinuationFrame:j,isTextBinaryFrame:k,isValidOpcode:function(a){return k(a)||j(a)||i(a)},parseExtensions:function(a){let b={position:0},c=new Map;for(;b.position<a.length;){let[d,e=""]=h(";",a,b).split("=",2);c.set(g(d,!0,!1),g(e,!1,!0)),b.position++}return c},isValidClientWindowBits:function(a){if(0===a.length)return!1;for(let b=0;b<a.length;b++){let c=a.charCodeAt(b);if(c<48||c>57)return!1}let b=Number.parseInt(a,10);return b>=8&&b<=15},toArrayBuffer:function(a){return a.byteLength===a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer},getURLRecord:function(a,b){let c;try{c=new URL(a,b)}catch(a){throw new DOMException(a,"SyntaxError")}if("http:"===c.protocol?c.protocol="ws:":"https:"===c.protocol&&(c.protocol="wss:"),"ws:"!==c.protocol&&"wss:"!==c.protocol)throw new DOMException("expected a ws: or wss: url","SyntaxError");if(c.hash.length||c.href.endsWith("#"))throw new DOMException("hash","SyntaxError");return c},validateCloseCodeAndReason:function(a,b){if(null!==a&&1e3!==a&&(a<3e3||a>4999))throw new DOMException("invalid code","InvalidAccessError");if(null!==b){let a=Buffer.byteLength(b);if(a>123)throw new DOMException(`Reason must be less than 123 bytes; received ${a}`,"SyntaxError")}}}},94231:(a,b,c)=>{"use strict";c.d(b,{R:()=>k});var d=c(88164),e=c(11484),f=c(31719);let g=new Set(["mimo-x-pro-preview","mimo-x-flash-preview"]),h=`${f.SE}/api/chat/completions`,i=Symbol("xiaomiMimoServiceCookie");function j(){return{response:Response.json({error:{message:"Xiaomi MiMo Desktop session is unavailable. Open Xiaomi MiMo Desktop, sign in again, and retry.",type:"authentication_error"}},{status:401}),url:h,headers:{},transformedBody:null}}class k extends d.L{constructor(){super("xiaomi-mimo")}static isPreviewModel(a){return g.has(a)}buildUrl(a,b,c,d,e){return k.isPreviewModel(a)?h:e?.runtimeTransport?.baseUrl||super.buildUrl(a,b,c,d)}buildHeaders(a,b,c){if(a?.[i]){let c={"Content-Type":"application/json",Cookie:a[i],"User-Agent":f.$6};return b&&(c.Accept="text/event-stream"),c}let d=c?.runtimeTransport,e={"Content-Type":"application/json",...d?.headers||{}};return d?.authHeader==="x-api-key"?e["x-api-key"]=a.apiKey||a.accessToken:e.Authorization=`Bearer ${a.apiKey||a.accessToken}`,b&&(e.Accept="text/event-stream"),e}transformRequest(a,b,c,d,e){if(!k.isPreviewModel(a))return b;let f={...b,model:`xiaomi/${a}`};return Object.hasOwn(f,"thinking")||(f.thinking={type:"enabled"}),Object.hasOwn(f,"temperature")||(f.temperature=1),Object.hasOwn(f,"top_p")||(f.top_p=.95),Object.hasOwn(f,"max_tokens")||(f.max_tokens=4096),f}async execute(a){if(!k.isPreviewModel(a.model))return super.execute(a);let b=a.credentials?.providerSpecificData||{},c=()=>(0,f.Me)(b,a.proxyOptions,{signal:a.signal}),d=await c();if(!d)return j();let g=c=>{let d={...a.credentials,providerSpecificData:{...b}};return Object.defineProperty(d,i,{value:c}),super.execute({...a,credentials:d})},h=await g(d);return 401!==h.response.status?h:(await (0,e.aI)(h.response),(0,f.Nv)(b),d=await c())?h=await g(d):j()}}},94279:(a,b,c)=>{"use strict";let{writeFile:d,readFile:e,mkdir:f}=c(51455),{dirname:g,resolve:h}=c(76760),{setTimeout:i,clearTimeout:j}=c(87997),{InvalidArgumentError:k,UndiciError:l}=c(61448),{setHeader:m}=c(84285),{hashId:n,isUrlExcludedFactory:o,normalizeHeaders:p,createHeaderFilters:q}=c(47800);function r(a,b,c={}){var d,e,f;let g=new URL(a.path,a.origin),h=a._normalizedHeaders||p(a.headers);return a._normalizedHeaders||(a._normalizedHeaders=h),{method:a.method||"GET",url:function(a,b,c){if(!1===b)return`${a.origin}${a.pathname}`;if(c){let b=String(c(a.searchParams)??"");return b?`${a.origin}${a.pathname}?${b}`:`${a.origin}${a.pathname}`}return a.toString()}(g,c.matchQuery,c.normalizeQuery),headers:s(h,b,c),body:(d=a.body,e=c.matchBody,f=c.normalizeBody,!1===e?"":f?String(f(d)??""):d?String(d):"")}}function s(a,b,c={}){if(!a||"object"!=typeof a)return{};let{caseSensitive:d=!1}=c,e={},{ignore:f,exclude:g,match:h}=b;for(let[b,c]of Object.entries(a)){let a=d?b:b.toLowerCase();!(g.has(a)||f.has(a))&&(0===h.size||h.has(a))&&m(e,a,c)}return e}function t(a,b,c={}){if(!a||"object"!=typeof a)return{};let{caseSensitive:d=!1}=c,e={},{exclude:f}=b;for(let[b,c]of Object.entries(a)){let a=d?b:b.toLowerCase();f.has(a)||m(e,a,c)}return e}function u(a){let b=[a.method,a.url];if(a.headers&&"object"==typeof a.headers)for(let c of Object.keys(a.headers).sort()){let d=Array.isArray(a.headers[c])?a.headers[c]:[a.headers[c]];for(let a of(b.push(c),d.sort()))b.push(String(a))}return b.push(a.body),n(b.join("|"))}class v{#cF;#cG;#cH=new Map;#cI;#cJ=1/0;#cK=!1;#cL;constructor(a={}){this.#cI=a.snapshotPath,this.#cJ=a.maxSnapshots||1/0,this.#cK=a.autoFlush||!1,this.flushInterval=a.flushInterval||3e4,this._flushTimer=null,this.matchOptions={matchHeaders:a.matchHeaders||[],ignoreHeaders:a.ignoreHeaders||[],excludeHeaders:a.excludeHeaders||[],matchBody:!1!==a.matchBody,normalizeBody:a.normalizeBody||void 0,matchQuery:!1!==a.matchQuery,normalizeQuery:a.normalizeQuery||void 0,caseSensitive:a.caseSensitive||!1},this.#cL=q(this.matchOptions),this.shouldRecord=a.shouldRecord||(()=>!0),this.shouldPlayback=a.shouldPlayback||(()=>!0),this.#cG=o(a.excludeUrls),this.#cK&&this.#cI&&this.#cM()}async record(a,b){if(!this.shouldRecord(a)||this.isUrlExcluded(a))return;let c=r(a,this.#cL,this.matchOptions),d=u(c),e=p(b.headers),f={statusCode:b.statusCode,headers:t(e,this.#cL,this.matchOptions),body:Buffer.isBuffer(b.body)?b.body.toString("base64"):Buffer.from(String(b.body||"")).toString("base64"),trailers:b.trailers};if(this.#cH.size>=this.#cJ&&!this.#cH.has(d)){let a=this.#cH.keys().next().value;this.#cH.delete(a)}let g=this.#cH.get(d);g&&g.responses?(g.responses.push(f),g.timestamp=new Date().toISOString()):this.#cH.set(d,{request:c,responses:[f],callCount:0,timestamp:new Date().toISOString()}),this.#cK&&this.#cI&&this.#cN()}isUrlExcluded(a){let b=new URL(a.path,a.origin).toString();return this.#cG(b)}findSnapshot(a){if(!this.shouldPlayback(a)||this.isUrlExcluded(a))return;let b=u(r(a,this.#cL,this.matchOptions)),c=this.#cH.get(b);if(!c)return;let d=c.callCount||0,e=Math.min(d,c.responses.length-1);return c.callCount=d+1,{...c,response:c.responses[e]}}async loadSnapshots(a){let b=a||this.#cI;if(!b)throw new k("Snapshot path is required");try{let a=await e(h(b),"utf8"),c=JSON.parse(a);if(Array.isArray(c))for(let{hash:a,snapshot:b}of(this.#cH.clear(),c))this.#cH.set(a,b);else this.#cH=new Map(Object.entries(c))}catch(a){if("ENOENT"===a.code)this.#cH.clear();else throw new l(`Failed to load snapshots from ${b}`,{cause:a})}}async saveSnapshots(a){let b=a||this.#cI;if(!b)throw new k("Snapshot path is required");let c=h(b);await f(g(c),{recursive:!0});let e=Array.from(this.#cH.entries()).map(([a,b])=>({hash:a,snapshot:b}));await d(c,JSON.stringify(e,null,2),{flush:!0})}clear(){this.#cH.clear()}getSnapshots(){return Array.from(this.#cH.values())}size(){return this.#cH.size}resetCallCounts(){for(let a of this.#cH.values())a.callCount=0}deleteSnapshot(a){let b=u(r(a,this.#cL,this.matchOptions));return this.#cH.delete(b)}getSnapshotInfo(a){let b=u(r(a,this.#cL,this.matchOptions)),c=this.#cH.get(b);return c?{hash:b,request:c.request,responseCount:c.responses?c.responses.length:+!!c.response,callCount:c.callCount||0,timestamp:c.timestamp}:null}replaceSnapshots(a){if(this.#cH.clear(),Array.isArray(a))for(let{hash:b,snapshot:c}of a)this.#cH.set(b,c);else a&&"object"==typeof a&&(this.#cH=new Map(Object.entries(a)))}#cM(){return this.#cN()}#cO(){this.#cF&&(j(this.#cF),this.saveSnapshots().catch(()=>{}),this.#cF=null)}#cN(){this.#cF=i(()=>{this.saveSnapshots().catch(()=>{}),this.#cK?this.#cF?.refresh():this.#cF=null},1e3)}destroy(){this.#cO(),this.#cF&&(j(this.#cF),this.#cF=null)}async close(){this.#cI&&0!==this.#cH.size&&await this.saveSnapshots(),this.destroy()}}a.exports={SnapshotRecorder:v,formatRequestKey:r,createRequestHash:u,filterHeadersForMatching:s,filterHeadersForStorage:t,createHeaderFilters:q}},95095:(a,b,c)=>{"use strict";let d=c(7344),e=c(31825),{kOriginless:f,kUrl:g}=c(49176);class h extends d{#cP=null;#cQ=null;constructor(a,b={}){super(b),this.#cP=a,this.#cQ=b,this[g]=a[g],this[f]=a[f]}dispatch(a,b){let c=new e({...a,retryOptions:this.#cQ},{dispatch:this.#cP.dispatch.bind(this.#cP),handler:b});return this.#cP.dispatch(a,c)}get webSocketOptions(){return this.#cP.webSocketOptions}get eventSourceOptions(){return this.#cP.eventSourceOptions}close(){return this.#cP.close()}destroy(){return this.#cP.destroy()}}a.exports=h},95956:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"chatgpt-web",priority:220,alias:"chatgpt-web",aliases:["cg"],uiAlias:"chatgpt-web",category:"webCookie",authType:"cookie",authModes:["cookie"],serviceKinds:["image"],display:{name:"ChatGPT Web",icon:"auto_awesome",color:"#10A37F",textIcon:"CG",website:"https://chatgpt.com",notice:{text:"Paste your chatgpt.com cookie header containing __Secure-next-auth.session-token (or a full Playwright storage-state JSON)"}},transport:{baseUrl:"https://chatgpt.com",format:"openai",authType:"cookie"},models:[{id:"gpt-5-6",name:"GPT-5.6 Sol — Instant"},{id:"gpt-5-6-thinking",name:"GPT-5.6 Sol — Thinking",supportsReasoning:!0},{id:"gpt-5-6-pro",name:"GPT-5.6 Sol — Pro",supportsReasoning:!0},{id:"gpt-5.6-luna-free",name:"GPT-5.6 Luna — Free"},{id:"gpt-5.6-luna-free-thinking",name:"GPT-5.6 Luna — Free Thinking",supportsReasoning:!0},{id:"gpt-5-5-instant",name:"GPT-5.5 — Instant"},{id:"gpt-5-5-thinking",name:"GPT-5.5 — Thinking",supportsReasoning:!0},{id:"gpt-5-5-pro",name:"GPT-5.5 — Pro",supportsReasoning:!0},{id:"gpt-image-2",name:"GPT Image 2 (web)",params:["n","size"],kind:"image"}]}},96050:(a,b,c)=>{"use strict";c.a(a,async(a,b)=>{try{c(19458),c(42541),c(36986),c(27696),c(8735);var d=c(65333);c(1447),c(54027),c(6699),c(93745),c(91083),c(60856),c(83651),c(98322),c(64334),c(2858),c(51590);var e=a([d]);d=(e.then?(await e)():e)[0],b()}catch(a){b(a)}})},96947:(a,b,c)=>{"use strict";c.d(b,{DO:()=>u,LP:()=>t});var d=c(77598),e=c(79154),f=c(99939),g=c(87886),h=c(14e3);globalThis._backgroundTokenRefreshState||(globalThis._backgroundTokenRefreshState={started:!1,startTimer:null,timer:null,runningPromise:null,retryByConnection:new Map});let i=globalThis._backgroundTokenRefreshState;function j(a){let b=a?.refreshToken;return b?(0,d.createHash)("sha256").update(String(b)).digest("hex"):null}async function k(a){let{getProviderConnectionById:b}=await Promise.resolve().then(c.bind(c,70321));return b(a)}async function l(a,b){let{mutateProviderConnection:d}=await Promise.resolve().then(c.bind(c,70321));return d(a,b)}async function m(a,b){return(0,e.Vq)(a,b,g)}function n(a,b){return!!(a&&b&&a.refreshToken===b.refreshToken&&a.accessToken===b.accessToken)}async function o(a,b,d={}){let e=d.mutateConnection||l,f=d.now||Date.now,{buildProviderCredentialUpdates:g}=await c.e(3815).then(c.bind(c,73815));return!!await e(a.id,c=>n(c,a)?g({...b,existingProviderSpecificData:c.providerSpecificData},f()):null)}async function p(a,b,c={}){let d=c.mutateConnection||l;return!!await d(a.id,c=>n(c,a)?{lastError:"OAuth refresh credential rejected; reconnect this account.",lastErrorAt:b.at,lastErrorType:"auth",errorCode:b.code,failureClass:"reauth_required"}:null)}async function q(a,b={}){let c,d=b.readConnection||k,e=b.refreshCredentials||m,f=b.persistCredentials,g=b.markReauthRequired,i=b.mutateConnection||l,j=b.now||Date.now,r=b.scheduler||h.iQ,s=await d(a.id);if(!s||!1===s.isActive)return{refreshed:!1,missing:!0};if(s.refreshToken!==a.refreshToken)return{refreshed:!1,stale:!0};try{c=await r.run(s.provider,()=>e(s.provider,{...s,connectionId:s.id}),{signal:b.signal})}catch(a){if(a?.permanent===!0){let b={code:String(a.code||"invalid_refresh_token").replace(/[^a-zA-Z0-9_.:-]/g,"_").slice(0,120)||"invalid_refresh_token",at:new Date(j()).toISOString()},c=!0;if(g?await g(s,b):c=await p(s,b,{mutateConnection:i}),!c)return{refreshed:!1,stale:!0}}throw a}if(!c||!c.accessToken&&!c.apiKey&&!c.token){let a=Error("OAuth refresh temporarily unavailable");throw a.name="OAuthRefreshTransientError",a.code="REFRESH_UNAVAILABLE",a.permanent=!1,a}let t={...c,lastRefreshAt:c.lastRefreshAt||new Date(j()).toISOString()};if(f){let b=await d(a.id);if(!n(b,s))return{refreshed:!1,stale:!0};await f(a.id,{...t,existingProviderSpecificData:b.providerSpecificData})}else if(!await o(s,t,{mutateConnection:i,now:j}))return{refreshed:!1,stale:!0};return{refreshed:!0}}async function r(a,b={}){let c=b.refreshConnection||q,d=Math.max(1,Number(b.concurrency)||4),e="function"==typeof b.now?b.now():Date.now(),f=0,h=0,k=0,l=Array.from({length:Math.min(d,a.length)},async()=>{for(;f<a.length;){let b=a[f++];try{await c(b),i.retryByConnection.delete(b.id),h+=1}catch(a){!function(a,b,c=!1){let d=i.retryByConnection.get(a.id),e=(d?.attempts||0)+1,f=Math.min(9e5,3e4*2**(e-1));i.retryByConnection.set(a.id,{attempts:e,retryAt:c?1/0:b+f,tokenFingerprint:j(a)})}(b,e,a?.permanent===!0),k+=1,g.warn("BG_TOKEN_REFRESH","Connection refresh failed",{id:b.id,provider:b.provider,code:a?.code||null,permanent:a?.permanent===!0})}}});return await Promise.all(l),{attempted:a.length,succeeded:h,failed:k}}async function s(){let{getProviderConnections:a}=await Promise.resolve().then(c.bind(c,70321));return a({isActive:!0})}function t(a={}){if(i.started)return!1;i.started=!0;let b=Number.isFinite(a.intervalMs)&&a.intervalMs>0?a.intervalMs:3e5,c=a.random||Math.random,d=async()=>{await function(a={}){let b,c;if(i.runningPromise)return i.runningPromise;let d=(b=a.listConnections||s,c=a.now||Date.now,(async()=>{try{let d=await b(),g=function(a,b=Date.now()){return Array.isArray(a)?a.filter(a=>{let c;if(!a||!1===a.isActive||"oauth"!==String(a.authType||"").trim().toLowerCase().replace(/[_ -]/g,"")||"reauth_required"===a.failureClass||!a.refreshToken||(c=i.retryByConnection.get(a.id))&&(c.tokenFingerprint!==j(a)?(i.retryByConnection.delete(a.id),!1):!(c.retryAt<=b)))return!1;let d=(0,e.Dz)(a);if(null===d)return!1;let g=(0,f.Og)(a.provider);return d-b<Math.max(18e5,Number.isFinite(g)?g:0)}):[]}(d,c());return await r(g,{...a,now:c})}catch(a){return g.warn("BG_TOKEN_REFRESH","Refresh sweep failed",{code:a?.code||null}),{attempted:0,succeeded:0,failed:0}}})()).finally(()=>{i.runningPromise===d&&(i.runningPromise=null)});return i.runningPromise=d,d}(a),i.started&&(i.timer=setTimeout(d,function(a,b=Math.random){return Math.round(a*(.9+.2*Math.max(0,Math.min(1,Number(b())||0))))}(b,c)),i.timer.unref?.())};return i.startTimer=setTimeout(()=>{i.startTimer=null,d()},1e4),i.startTimer.unref?.(),!0}function u(){return i.startTimer&&clearTimeout(i.startTimer),i.timer&&clearTimeout(i.timer),i.startTimer=null,i.timer=null,i.started=!1,i.runningPromise||Promise.resolve()}},97210:(a,b,c)=>{"use strict";let{createInflateRaw:d,Z_DEFAULT_WINDOWBITS:e}=c(38522),{isValidClientWindowBits:f}=c(94050),{MessageSizeExceededError:g}=c(61448),h=Buffer.from([0,0,255,255]),i=Symbol("kBuffer"),j=Symbol("kLength");class k{#cR;#cQ={};#ch=0;constructor(a,b){this.#cQ.serverNoContextTakeover=a.has("server_no_context_takeover"),this.#cQ.serverMaxWindowBits=a.get("server_max_window_bits"),this.#ch=b.maxPayloadSize}decompress(a,b,c){if(!this.#cR){let a=e;if(this.#cQ.serverMaxWindowBits){if(!f(this.#cQ.serverMaxWindowBits))return void c(Error("Invalid server_max_window_bits"));a=Number.parseInt(this.#cQ.serverMaxWindowBits)}try{this.#cR=d({windowBits:a})}catch(a){c(a);return}this.#cR[i]=[],this.#cR[j]=0,this.#cR.on("data",a=>{if(this.#cR[j]+=a.length,this.#ch>0&&this.#cR[j]>this.#ch){c(new g),this.#cR.removeAllListeners(),this.#cR.destroy(),this.#cR=null;return}this.#cR[i].push(a)}),this.#cR.on("error",a=>{this.#cR=null,c(a)})}this.#cR.write(a),b&&this.#cR.write(h),this.#cR.flush(()=>{if(!this.#cR)return;let a=Buffer.concat(this.#cR[i],this.#cR[j]);this.#cR[i].length=0,this.#cR[j]=0,c(null,a)})}}a.exports={PerMessageDeflate:k}},97356:(a,b,c)=>{"use strict";let d=c(4573),{Transform:e}=c(57075),{isASCIINumber:f,isValidLastEventId:g}=c(26376),h=d.kStringMaxLength,i=Buffer.from("data"),j=Buffer.from("event"),k=Buffer.from("id"),l=Buffer.from("retry");function m(a,b,c){if(b!==c.length)return!1;for(let d=0;d<b;d++)if(a[d]!==c[d])return!1;return!0}function n(){let a=Error("EventSource message size exceeded");return a.aborted=!1,a}class o extends e{state;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;chunks=[];chunkIndex=0;pos=0;lineChunkIndex=0;linePos=0;lineLength=0;eventSize=0;eventFieldSizes={data:0,event:0,id:0,retry:0};dataLineCount=0;maxEventSize;maxDataLines;maxBufferedChunks;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(a={}){a.readableObjectMode=!0,super(a),this.state=a.eventSourceSettings||{},this.maxEventSize=a.maxEventSize??h;let b=this.maxEventSize>0?Math.min(131072,Math.max(1024,Math.floor(this.maxEventSize/128))):0;this.maxDataLines=b,this.maxBufferedChunks=b,a.push&&(this.push=a.push)}_transform(a,b,c){if(0===a.length)return void c();if(this.maxEventSize>0&&this.chunks.length>=this.maxBufferedChunks&&10!==a[0]&&13!==a[0])return void c(n());if(this.chunks.push(a),this.checkBOM&&this.handleBOM())return void c();for(;this.hasCurrentByte();){let a=this.currentByte();if(this.eventEndCheck){if(this.crlfCheck){if(10===a){this.crlfCheck=!1,this.consumeCurrentByte();continue}this.crlfCheck=!1}if(10===a||13===a){13===a&&(this.crlfCheck=!0),this.consumeCurrentByte(),this.hasPendingEvent()&&this.processEvent(this.event),this.clearEvent();continue}this.eventEndCheck=!1;continue}if(10===a||13===a){13===a&&(this.crlfCheck=!0);try{this.parseLine(this.readLine(),this.event)}catch(a){c(a);return}this.consumeCurrentByte(),this.eventEndCheck=!0;continue}if(this.maxEventSize>0&&++this.lineLength>this.maxEventSize+7)return void c(n());this.advanceCursor()}c()}_destroy(a,b){this.chunks.length=0,this.clearEvent(),super._destroy(a,b)}parseLine(a,b){if(0===a.length)return;let c=a.indexOf(58);if(0===c)return;let d=a.length,e=a.length;if(-1!==c&&(d=c,32===a[e=c+1]&&++e),m(a,d,i)){if(this.maxEventSize>0&&this.dataLineCount>=this.maxDataLines)throw n();let c=a.length-e,d=this.eventFieldSizes.data+ +(void 0!==b.data)+c;this.setEventFieldSize("data",d);let f=a.toString("utf8",e);void 0===b.data?b.data=f:b.data+=`
1106
1106
  ${f}`,this.dataLineCount++;return}if(m(a,d,l)){(function(a,b){if(b>=a.length)return!1;for(let c=b;c<a.length;c++)if(a[c]<48||a[c]>57)return!1;return!0})(a,e)&&(this.setEventFieldSize("retry",a.length-e),b.retry=a.toString("utf8",e));return}if(m(a,d,k)){(function(a,b){for(let c=b;c<a.length;c++)if(0===a[c])return!1;return!0})(a,e)&&(this.setEventFieldSize("id",a.length-e),b.id=a.toString("utf8",e));return}m(a,d,j)&&e<a.length&&(this.setEventFieldSize("event",a.length-e),b.event=a.toString("utf8",e))}setEventFieldSize(a,b){let c=this.eventSize-this.eventFieldSizes[a]+b;if(this.maxEventSize>0&&c>this.maxEventSize)throw n();this.eventSize=c,this.eventFieldSizes[a]=b}processEvent(a){a.retry&&f(a.retry)&&(this.state.reconnectionTime=parseInt(a.retry,10)),void 0!==a.id&&g(a.id)&&(this.state.lastEventId=a.id),void 0!==a.data&&this.push({type:a.event||"message",options:{data:a.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event.data=void 0,this.event.event=void 0,this.event.id=void 0,this.event.retry=void 0,this.eventSize=0,this.dataLineCount=0,this.eventFieldSizes.data=0,this.eventFieldSizes.event=0,this.eventFieldSizes.id=0,this.eventFieldSizes.retry=0}hasPendingEvent(){return void 0!==this.event.data||void 0!==this.event.event||void 0!==this.event.id||void 0!==this.event.retry}hasCurrentByte(){return this.chunkIndex<this.chunks.length&&this.pos<this.chunks[this.chunkIndex].length}currentByte(){return this.chunks[this.chunkIndex][this.pos]}consumeCurrentByte(){this.advanceCursor(),this.syncLineStartToCursor()}advanceCursor(){for(this.pos++;this.chunkIndex<this.chunks.length&&this.pos>=this.chunks[this.chunkIndex].length;)this.chunkIndex++,this.pos=0}syncLineStartToCursor(){this.lineChunkIndex=this.chunkIndex,this.linePos=this.pos,this.lineLength=0,this.dropConsumedChunks()}dropConsumedChunks(){if(this.lineChunkIndex>0){let a=this.lineChunkIndex;this.chunks.splice(0,a),this.lineChunkIndex=0,this.chunkIndex-=a}this.chunkIndex===this.chunks.length&&(this.chunks.length=0,this.chunkIndex=0,this.pos=0,this.lineChunkIndex=0,this.linePos=0)}readLine(){if(this.lineChunkIndex===this.chunkIndex)return this.chunks[this.chunkIndex].subarray(this.linePos,this.pos);let a=[],b=0;for(let c=this.lineChunkIndex;c<=this.chunkIndex;c++){let d=this.chunks[c],e=c===this.lineChunkIndex?this.linePos:0,f=c===this.chunkIndex?this.pos:d.length,g=d.subarray(e,f);b+=g.length,a.push(g)}return Buffer.concat(a,b)}peekBufferedByte(a){let b=this.lineChunkIndex,c=this.linePos;for(;b<this.chunks.length;){let d=this.chunks[b],e=d.length-c;if(a<e)return d[c+a];a-=e,b++,c=0}}discardLeadingBytes(a){for(;a>0&&this.lineChunkIndex<this.chunks.length;){let b=this.chunks[this.lineChunkIndex].length-this.linePos;a<b?(this.linePos+=a,a=0):(a-=b,this.lineChunkIndex++,this.linePos=0)}this.chunkIndex=this.lineChunkIndex,this.pos=this.linePos,this.dropConsumedChunks()}handleBOM(){let a=this.peekBufferedByte(0),b=this.peekBufferedByte(1),c=this.peekBufferedByte(2);return void 0===b?239===a||(this.checkBOM=!1,!0):void 0===c?239===a&&187===b||(this.checkBOM=!1,!1):(239===a&&187===b&&191===c&&this.discardLeadingBytes(3),this.checkBOM=!1,!this.hasCurrentByte())}}a.exports={EventSourceStream:o}},97465:(a,b,c)=>{"use strict";let d=c(34589),{AsyncResource:e}=c(16698),{InvalidArgumentError:f,SocketError:g}=c(61448),h=c(84285),{addSignal:i,removeSignal:j}=c(73135);class k extends e{constructor(a,b){if(!a||"object"!=typeof a)throw new f("invalid opts");if("function"!=typeof b)throw new f("invalid callback");let{signal:c,opaque:d,responseHeaders:e}=a;if(c&&"function"!=typeof c.on&&"function"!=typeof c.addEventListener)throw new f("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=d||null,this.responseHeaders=e||null,this.callback=b,this.abort=null,i(this,c)}onRequestStart(a,b){this.reason?a.abort(this.reason):(d(this.callback),this.abort=b=>a.abort(b),this.context=b)}onResponseStart(){throw new g("bad connect",null)}onRequestUpgrade(a,b,c,d){let{callback:e,opaque:f,context:g}=this;j(this),this.callback=null;let i=c,k=a?.rawHeaders;null!=i&&(i="raw"===this.responseHeaders?h.parseRawHeaders(k):c),this.runInAsyncScope(e,null,null,{statusCode:b,headers:i,socket:d,opaque:f,context:g})}onResponseError(a,b){let{callback:c,opaque:d}=this;j(this),c&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(c,null,b,{opaque:d})}))}}a.exports=function a(b,c){if(void 0===c)return new Promise((c,d)=>{a.call(this,b,(a,b)=>a?d(a):c(b))});try{let a=new k(b,c),d={...b,method:"CONNECT"};this.dispatch(d,a)}catch(d){if("function"!=typeof c)throw d;let a=b?.opaque;queueMicrotask(()=>c(d,{opaque:a}))}}},97474:(a,b,c)=>{"use strict";c.d(b,{JJ:()=>f});let d=Object.freeze({maxConcurrent:6,minDelayMs:0}),e=Object.freeze({kiro:Object.freeze({maxConcurrent:1,minDelayMs:3e3}),"cloudflare-ai":Object.freeze({maxConcurrent:16,minDelayMs:0}),"codebuddy-cn":Object.freeze({maxConcurrent:6,minDelayMs:50}),"codebuddy-intl":Object.freeze({maxConcurrent:4,minDelayMs:50}),xai:Object.freeze({maxConcurrent:8,minDelayMs:0}),antigravity:Object.freeze({maxConcurrent:4,minDelayMs:50})});function f(a){return e[String(a||"").trim().toLowerCase()]||d}},97678:(a,b,c)=>{"use strict";let d,e=c(34589),f=c(84285),{channels:g}=c(62571),h=c(64704),{RequestContentLengthMismatchError:i,ResponseContentLengthMismatchError:j,RequestAbortedError:k,InvalidArgumentError:l,HeadersTimeoutError:m,HeadersOverflowError:n,SocketError:o,InformationalError:p,BodyTimeoutError:q,HTTPParserError:r,WebAssemblyNotSupportedError:s,ResponseExceededMaxSizeError:t}=c(61448),{kUrl:u,kReset:v,kClient:w,kParser:x,kBlocking:y,kRunning:z,kPending:A,kSize:B,kWriting:C,kQueue:D,kNoRef:E,kKeepAliveDefaultTimeout:F,kHostHeader:G,kPendingIdx:H,kRunningIdx:I,kError:J,kPipelining:K,kSocket:L,kKeepAliveTimeoutValue:M,kMaxHeadersSize:N,kKeepAliveMaxTimeout:O,kKeepAliveTimeoutThreshold:P,kHeadersTimeout:Q,kBodyTimeout:R,kStrictContentLength:S,kMaxRequests:T,kCounter:U,kMaxResponseSize:V,kOnError:W,kResume:X,kHTTPContext:Y,kClosed:Z,kUseMilo:$}=c(49176),_=c(65429),{H1Parser:aa,getMiloEnabled:ab}="u"<typeof esbuildDetection?c(13046):{},ac=Buffer.alloc(0),ad=Buffer[Symbol.species],ae=f.removeAllListeners,af=Symbol("kIdleSocketValidation"),ag=Symbol("kIdleSocketValidationTimeout"),ah=Symbol("kSocketUsed"),ai=Symbol("kTypeOfService"),aj=null,ak=null,al=null,am=0,an=null,ao=null;class ap{constructor(a,b,{exports:c}){this.llhttp=c,this.ptr=this.llhttp.llhttp_alloc(_.TYPE.RESPONSE),this.client=a,this.socket=b,this.timeout=null,this.timeoutWeakRef=new WeakRef(this),this.timeoutValue=null,this.timeoutType=null,this.statusCode=0,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=a[N],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength=-1,this.hasTransferEncoding=!1,this.connection="",this.maxResponseSize=a[V]}setTimeout(a,b){a!==this.timeoutValue||1&b^1&this.timeoutType?(this.timeout&&(h.clearTimeout(this.timeout),this.timeout=null),a&&(1&b?this.timeout=h.setFastTimeout(aq,a,this.timeoutWeakRef):(this.timeout=setTimeout(aq,a,this.timeoutWeakRef),this.timeout?.unref())),this.timeoutValue=a):this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.timeoutType=b}resume(){!this.socket.destroyed&&this.paused&&(e(null!=this.ptr),e(null===ak),this.llhttp.llhttp_resume(this.ptr),e(5===this.timeoutType),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||ac),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let a=this.socket.read();if(null===a)break;this.execute(a)}}execute(a){e(null===ak),e(null!=this.ptr),e(!this.paused);let{socket:b,llhttp:c}=this;a.length>am&&(an&&c.free(an),am=4096*Math.ceil(a.length/4096),an=c.malloc(am)),(null===ao||ao.buffer!==c.memory.buffer||ao.byteOffset!==an||ao.byteLength!==am)&&(ao=new Uint8Array(c.memory.buffer,an,am)),ao.set(a);try{let d;try{al=a,ak=this,d=c.llhttp_execute(this.ptr,an,a.length)}finally{ak=null,al=null}if(d!==_.ERROR.OK){let e=a.subarray(c.llhttp_get_error_pos(this.ptr)-an);if(d===_.ERROR.PAUSED_UPGRADE)this.onUpgrade(e);else if(d===_.ERROR.PAUSED)this.paused=!0,b.unshift(e);else throw this.createError(d,e)}}catch(a){f.destroy(b,a)}}finish(){let a;e(null===ak),e(null!=this.ptr);let{llhttp:b}=this;if(this.paused){let a;do b.llhttp_resume(this.ptr),this.paused=!1,a=this.socket.read()||ac,this.execute(a);while(this.paused&&a.length>0);this.paused&&(b.llhttp_resume(this.ptr),this.paused=!1)}try{ak=this,a=b.llhttp_finish(this.ptr)}finally{ak=null}return a===_.ERROR.OK?null:a===_.ERROR.PAUSED||a===_.ERROR.PAUSED_UPGRADE?(this.paused=!0,null):this.createError(a,ac)}createError(a,b){let{llhttp:c,contentLength:d,bytesRead:e}=this;if(-1!==d&&e!==d)return new j;let f=c.llhttp_get_error_reason(this.ptr),g="";if(f){let a=new Uint8Array(c.memory.buffer,f).indexOf(0);g="Response does not match the HTTP/1.1 protocol ("+Buffer.from(c.memory.buffer,f,a).toString()+")"}return new r(g,_.ERROR[a],b)}destroy(){e(null===ak),e(null!=this.ptr),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&h.clearTimeout(this.timeout),this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.paused=!1}onStatus(a){return this.statusText=a.toString(),0}onMessageBegin(){let{socket:a,client:b}=this;if(a.destroyed)return -1;if(0===b[z])return f.destroy(a,new o("bad response",f.getSocketInfo(a))),-1;let c=b[D][b[I]];return c?(c.onResponseStarted(),0):-1}onHeaderField(a){let b=this.headers.length;return(1&b)==0?this.headers.push(a):this.headers[b-1]=Buffer.concat([this.headers[b-1],a]),this.trackHeader(a.length),0}onHeaderValue(a){let b=this.headers.length,c=(1&b)==0;(1&b)==1?(this.headers.push(a),b+=1):this.headers[b-1]=Buffer.concat([this.headers[b-1],a]);let d=this.headers[b-2];if(10===d.length){let b=f.bufferToLowerCasedHeaderName(d);"keep-alive"===b?this.keepAlive+=(c||0===this.keepAlive.length?"":",")+a.toString():"connection"===b&&(this.connection+=(c||0===this.connection.length?"":",")+a.toString())}else if(14===d.length&&"content-length"===f.bufferToLowerCasedHeaderName(d)){-1===this.contentLength&&(this.contentLength=0);for(let b=0;b<a.length;b++)this.contentLength=10*this.contentLength+(a[b]-48)}else 17===d.length&&"transfer-encoding"===f.bufferToLowerCasedHeaderName(d)&&(this.hasTransferEncoding=!0);return this.trackHeader(a.length),0}trackHeader(a){this.headersSize+=a,this.headersSize>=this.headersMaxSize&&f.destroy(this.socket,new n)}onUpgrade(a){let{upgrade:b,client:c,socket:d,headers:g,statusCode:h,statusText:i}=this;e(b),e(c[L]===d),e(!d.destroyed),e(!this.paused),e((1&g.length)==0);let j=c[D][c[I]];e(j),e(j.upgrade||"CONNECT"===j.method),this.statusCode=0,this.statusText="",this.shouldKeepAlive=!1,this.headers=[],this.headersSize=0,d.unshift(a),d[x].destroy(),d[x]=null,d[w]=null,d[J]=null,ae(d),c[L]=null,c[Y]=null,c[D][c[I]++]=null,c.emit("disconnect",c[u],[c],new p("upgrade"));try{j.onRequestUpgrade(h,g,d,i)}catch(a){f.errorRequest(c,j,a),f.destroy(d,a)}c[X]()}onHeadersComplete(a,b,c){let{client:d,socket:g,headers:h,statusText:i}=this;if(g.destroyed)return -1;if(0===d[z])return f.destroy(g,new o("bad response",f.getSocketInfo(g))),-1;let j=d[D][d[I]];if(!j)return -1;if(e(!this.upgrade),e(this.statusCode<200),100===a)return f.destroy(g,new o("bad response",f.getSocketInfo(g))),-1;if(b&&!j.upgrade)return f.destroy(g,new o("bad upgrade",f.getSocketInfo(g))),-1;if(e(3===this.timeoutType),this.statusCode=a,this.shouldKeepAlive=c||"HEAD"===j.method&&!g[v]&&/(?:^|,)[\t ]*keep-alive[\t ]*(?:,|$)/i.test(this.connection)&&!/(?:^|,)[\t ]*close[\t ]*(?:,|$)/i.test(this.connection),("HEAD"===j.method||204===a||304===a)&&("HEAD"!==j.method&&(this.contentLength>0||this.hasTransferEncoding)&&(this.shouldKeepAlive=!1),this.contentLength=-1),this.statusCode>=200){let a=null!=j.bodyTimeout?j.bodyTimeout:d[R];this.setTimeout(a,5)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if("CONNECT"===j.method||b)return e(1===d[z]),this.upgrade=!0,2;if(e((1&this.headers.length)==0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&d[K]){let a=this.keepAlive?f.parseKeepAliveTimeout(this.keepAlive):null;if(null!=a){let b=Math.min(a-d[P],d[O]);b<=0?g[v]=!0:d[M]=b}else d[M]=d[F]}else g[v]=!0;let k=!1===j.onResponseStart(a,h,this.resume,i);return j.aborted?-1:"HEAD"===j.method||a<200?1:(g[y]&&(g[y]=!1,d[X]()),k?_.ERROR.PAUSED:0)}onBody(a){let{client:b,socket:c,statusCode:d,maxResponseSize:g}=this;if(c.destroyed)return -1;let h=b[D][b[I]];return(e(h),e(5===this.timeoutType),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),e(d>=200),g>-1&&this.bytesRead+a.length>g)?(f.destroy(c,new t),-1):(this.bytesRead+=a.length,!1===h.onResponseData(a))?_.ERROR.PAUSED:0}onMessageComplete(){let{client:a,socket:b,statusCode:c,upgrade:d,headers:g,contentLength:h,bytesRead:i,shouldKeepAlive:k}=this;if(b.destroyed&&(!c||k))return -1;if(d)return 0;e(c>=100),e((1&this.headers.length)==0);let l=a[D][a[I]];return(e(l),this.statusCode=0,this.statusText="",this.bytesRead=0,this.contentLength=-1,this.hasTransferEncoding=!1,this.keepAlive="",this.connection="",this.headers=[],this.headersSize=0,c<200)?0:-1!==h&&i!==h?(f.destroy(b,new j),-1):(l.onResponseEnd(g),a[D][a[I]++]=null,b[ah]=0===a[A],b[C])?(e(0===a[z]),f.destroy(b,new p("reset")),_.ERROR.PAUSED):k?b[v]&&0===a[z]?(f.destroy(b,new p("reset")),_.ERROR.PAUSED):(null==a[K]||1===a[K]?setImmediate(a[X]):a[X](),0):(f.destroy(b,new p("reset")),_.ERROR.PAUSED)}}function aq(a){let b=a.deref();if(!b)return;let{socket:c,timeoutType:d,client:g,paused:h}=b;3===d?(!c[C]||c.writableNeedDrain||g[z]>1)&&(e(!h,"cannot be paused while waiting for headers"),f.destroy(c,new m)):5===d?h||f.destroy(c,new q):8===d&&(e(0===g[z]&&g[M]),f.destroy(c,new p("socket idle timeout")))}function ar(a){let b=this[x];if("ECONNRESET"===a.code&&b.statusCode&&!b.shouldKeepAlive){let a=b.finish();a&&(this[J]=a,this[w][W](a));return}this[J]=a,this[w][W](a)}function as(){this[x]?.readMore()}function at(){let a=this[x];if(a.statusCode&&!a.shouldKeepAlive){let b=a.finish();b&&f.destroy(this,b);return}f.destroy(this,new o("other side closed",f.getSocketInfo(this)))}function au(){let a=this[x];aw(this),a&&(this[J]||!a.statusCode||a.shouldKeepAlive||(this[J]=a.finish()||this[J]),this[x].destroy(),this[x]=null);let b=this[J]||new o("closed",f.getSocketInfo(this)),c=this[w];if(c[L]=null,c[Y]=null,c.destroyed){e(0===c[A]);let a=c[D].splice(c[I]);for(let d=0;d<a.length;d++){let e=a[d];f.errorRequest(c,e,b)}}else if(c[z]>0&&"UND_ERR_INFO"!==b.code){let a=c[D][c[I]];c[D][c[I]++]=null,f.errorRequest(c,a,b)}c[H]=c[I],e(0===c[z]),c.emit("disconnect",c[u],[c],b),c[X]()}function av(){this[Z]=!0}function aw(a){a[ag]&&(clearImmediate(a[ag]),a[ag]=null),a[af]=0}function ax(a,b,c,d,g,h,i,j){try{b?f.isBuffer(b)&&(e(h===b.byteLength,"buffer body must have content length"),g.cork(),g.write(`${i}content-length: ${h}\r
1107
1107
  \r
1108
1108
  `,"latin1"),g.write(b),g.uncork(),d.onBodySent(b),j||!1===d.reset||(g[v]=!0)):0===h?g.write(`${i}content-length: 0\r