zevairouter 1.1.13 → 1.1.15

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 (351) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/cli/app/.next-cli-build/BUILD_ID +1 -1
  3. package/cli/app/.next-cli-build/app-path-routes-manifest.json +6 -6
  4. package/cli/app/.next-cli-build/build-manifest.json +2 -2
  5. package/cli/app/.next-cli-build/prerender-manifest.json +3 -3
  6. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page_client-reference-manifest.js +1 -1
  7. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  8. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  9. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  10. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  11. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  12. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page_client-reference-manifest.js +1 -1
  13. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  14. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  15. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  16. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  17. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  18. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  19. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  20. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  21. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  22. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  23. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  24. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  25. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  26. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  27. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  28. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  29. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  30. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page_client-reference-manifest.js +1 -1
  31. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  32. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  33. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  34. package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  35. package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
  36. package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  37. package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  38. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  39. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  40. package/cli/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  41. package/cli/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  42. package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  43. package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  44. package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
  45. package/cli/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  46. package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  47. package/cli/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  48. package/cli/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
  49. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  50. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  51. package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  52. package/cli/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +4 -4
  53. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  54. package/cli/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  55. package/cli/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  56. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  57. package/cli/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  58. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  59. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  60. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +2 -2
  61. package/cli/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +3 -3
  62. package/cli/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
  63. package/cli/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
  64. package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +1 -1
  65. package/cli/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  66. package/cli/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  67. package/cli/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  68. package/cli/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  69. package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
  70. package/cli/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  71. package/cli/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  72. package/cli/app/.next-cli-build/server/app/api/providers/bulk-delete/route.js +1 -1
  73. package/cli/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  74. package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js +3 -3
  75. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  76. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  77. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  78. package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
  79. package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  80. package/cli/app/.next-cli-build/server/app/callback.html +1 -1
  81. package/cli/app/.next-cli-build/server/app/callback.rsc +3 -3
  82. package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  83. package/cli/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  84. package/cli/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
  85. package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  86. package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  87. package/cli/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  88. package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
  89. package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +5 -5
  90. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +2 -2
  91. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation.segment.rsc +1 -1
  92. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  93. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  94. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +5 -5
  95. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_head.segment.rsc +1 -1
  96. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_index.segment.rsc +3 -3
  97. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +1 -1
  98. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  99. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
  100. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  101. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  102. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  103. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  104. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
  105. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  106. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
  107. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  108. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  109. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
  110. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  111. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  112. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  113. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  114. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  115. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  116. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
  117. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  118. package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  119. package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  120. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  121. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  122. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  123. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  124. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  125. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  126. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
  127. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  128. package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
  129. package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +5 -5
  130. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +2 -2
  131. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context.segment.rsc +1 -1
  132. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  133. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  134. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +5 -5
  135. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_head.segment.rsc +1 -1
  136. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_index.segment.rsc +3 -3
  137. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +1 -1
  138. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  139. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
  140. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  141. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  142. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  143. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  144. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
  145. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  146. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
  147. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  148. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  149. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  150. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  151. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  152. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  153. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  154. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  155. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  156. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  157. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
  158. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  159. package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  160. package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  161. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  162. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  163. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  164. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  165. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  166. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  167. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
  168. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  169. package/cli/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
  170. package/cli/app/.next-cli-build/server/app/dashboard/playground.rsc +5 -5
  171. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +2 -2
  172. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground.segment.rsc +1 -1
  173. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  174. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  175. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +5 -5
  176. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_head.segment.rsc +1 -1
  177. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_index.segment.rsc +3 -3
  178. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +1 -1
  179. package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  180. package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  181. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  182. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  183. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  184. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  185. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  186. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  187. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
  188. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  189. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  190. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  191. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  192. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  193. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  194. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  195. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  196. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  197. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  198. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
  199. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  200. package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  201. package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  202. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  203. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  204. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  205. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  206. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  207. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  208. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
  209. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  210. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  211. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
  212. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  213. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  214. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  215. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  216. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
  217. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  218. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
  219. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  220. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  221. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
  222. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  223. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  224. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  225. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  226. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
  227. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  228. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +3 -3
  229. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  230. package/cli/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  231. package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
  232. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  233. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  234. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  235. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  236. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  237. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  238. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
  239. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  240. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  241. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  242. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  243. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing.segment.rsc +1 -1
  244. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +1 -1
  245. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  246. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  247. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  248. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  249. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
  250. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  251. package/cli/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  252. package/cli/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
  253. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  254. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  255. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  256. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  257. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
  258. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  259. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +3 -3
  260. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  261. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  262. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
  263. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  264. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  265. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  266. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  267. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
  268. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  269. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +3 -3
  270. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  271. package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  272. package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  273. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  274. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  275. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  276. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  277. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  278. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  279. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
  280. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  281. package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  282. package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  283. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  284. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  285. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  286. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  287. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  288. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  289. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
  290. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  291. package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
  292. package/cli/app/.next-cli-build/server/app/dashboard.rsc +5 -5
  293. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  294. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  295. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  296. package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
  297. package/cli/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  298. package/cli/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
  299. package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  300. package/cli/app/.next-cli-build/server/app/index.html +1 -1
  301. package/cli/app/.next-cli-build/server/app/index.rsc +3 -3
  302. package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  303. package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  304. package/cli/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  305. package/cli/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
  306. package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  307. package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  308. package/cli/app/.next-cli-build/server/app/landing.html +1 -1
  309. package/cli/app/.next-cli-build/server/app/landing.rsc +4 -4
  310. package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  311. package/cli/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  312. package/cli/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
  313. package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  314. package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  315. package/cli/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  316. package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  317. package/cli/app/.next-cli-build/server/app/login.html +1 -1
  318. package/cli/app/.next-cli-build/server/app/login.rsc +4 -4
  319. package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  320. package/cli/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  321. package/cli/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
  322. package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  323. package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  324. package/cli/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  325. package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  326. package/cli/app/.next-cli-build/server/app-paths-manifest.json +6 -6
  327. package/cli/app/.next-cli-build/server/chunks/1131.js +1 -1
  328. package/cli/app/.next-cli-build/server/chunks/1350.js +1 -1
  329. package/cli/app/.next-cli-build/server/chunks/220.js +1 -1
  330. package/cli/app/.next-cli-build/server/chunks/2760.js +1 -1
  331. package/cli/app/.next-cli-build/server/chunks/3949.js +1 -1
  332. package/cli/app/.next-cli-build/server/chunks/4827.js +1 -1
  333. package/cli/app/.next-cli-build/server/chunks/5295.js +3 -3
  334. package/cli/app/.next-cli-build/server/chunks/6651.js +14 -10
  335. package/cli/app/.next-cli-build/server/chunks/7319.js +23 -19
  336. package/cli/app/.next-cli-build/server/chunks/7634.js +1 -1
  337. package/cli/app/.next-cli-build/server/chunks/8255.js +1 -1
  338. package/cli/app/.next-cli-build/server/chunks/8306.js +1 -1
  339. package/cli/app/.next-cli-build/server/chunks/8491.js +1 -1
  340. package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  341. package/cli/app/.next-cli-build/server/pages/404.html +1 -1
  342. package/cli/app/.next-cli-build/server/pages/500.html +1 -1
  343. package/cli/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  344. package/cli/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  345. package/cli/app/.next-cli-build/static/chunks/{620-92e97ab01cb4c25a.js → 620-2e6639e4ca9afb1d.js} +1 -1
  346. package/cli/app/CHANGELOG.md +10 -0
  347. package/cli/app/package.json +1 -1
  348. package/cli/package.json +1 -1
  349. package/package.json +1 -1
  350. /package/cli/app/.next-cli-build/static/{JzhJR_QLUCS172Am3eS9H → S4Ni0EVNQQgndbz1Kanxu}/_buildManifest.js +0 -0
  351. /package/cli/app/.next-cli-build/static/{JzhJR_QLUCS172Am3eS9H → S4Ni0EVNQQgndbz1Kanxu}/_ssgManifest.js +0 -0
@@ -114,7 +114,14 @@ You are producing plain text that will later be styled by the CLI. Follow these
114
114
  * Optionally include line/column (1‑based): :line[:column] or #Lline[Ccolumn] (column defaults to 1).
115
115
  * Do not use URIs like file://, vscode://, or https://.
116
116
  * Do not provide range of lines
117
- * Examples: src/app.ts, src/app.ts:42, b/server/index.js#L10, C:\\repo\\project\\main.rs:12:5`;var g=c(30395),h=c(79154),i=c(80993),j=c(21904),k=c(32210),l=c(41310),m=c(8735),n=c(32557),o=c(46714);let p=["server_is_overloaded","service_unavailable_error"],q=new Map,r=/^(rs|fc|resp|msg)_/,s=new Set(["image_generation","web_search","web_search_preview","file_search","computer","computer_use_preview","code_interpreter","mcp","local_shell","custom"]),t=new Set(["model","input","instructions","tools","tool_choice","stream","store","reasoning","service_tier","include","prompt_cache_key","client_metadata"]),u=null;function v(a){return(0,d.createHash)("sha256").update(a).digest("hex").slice(0,16)}function w(){return`sess_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,9)}`}function x(a){if("string"!=typeof a)return null;let b=a.trim();return!b||b.length>256?null:b}(0,l.Xj)().then(a=>{u=a}),setInterval(()=>{let a=Date.now();for(let[b,c]of q)a-c.lastUsed>36e5&&q.delete(b)},6e5);class y extends e.Hv{constructor(){super("codex",g.xq.codex),this._currentSessionId=null}buildHeaders(a,b=!0){let c=super.buildHeaders(a,b);c.session_id=this._currentSessionId||a?.connectionId||"default",c.originator||(c.originator="codex_cli_rs");let d=a?.providerSpecificData?.workspaceId;return"string"==typeof d&&d&&!c["chatgpt-account-id"]&&(c["chatgpt-account-id"]=d),c}buildUrl(a,b,c=0,d=null){let e=super.buildUrl(a,b,c,d);return this._isCompact?`${e}/compact`:e}async refreshCredentials(a,b){return a?.refreshToken?(0,h.Vq)("codex",a,b):null}needsRefresh(a){return(0,h.fp)("codex",a)}async prefetchImages(a){if(Array.isArray(a?.input))for(let b of a.input){if(!Array.isArray(b.content))continue;let a=b.content.map(async a=>{if("image_url"!==a.type)return a;let b="string"==typeof a.image_url?a.image_url:a.image_url?.url,c=a.image_url?.detail||"auto";if(!b)return a;if(b.startsWith("data:"))return{type:"input_image",image_url:b,detail:c};let d=await (0,j.n)(b,{timeoutMs:15e3});return{type:"input_image",image_url:d?.url||b,detail:c}});b.content=await Promise.all(a)}}async execute(a){let b=Array.isArray(a.body?.input)?a.body.input.reduce((a,b)=>a+(Array.isArray(b.content)?b.content.filter(a=>"image_url"===a.type).length:0),0):0,c=Array.isArray(a.body?.input)?a.body.input.length:0;if((0,n.s)("CODEX",`execute start | inputItems=${c} | images=${b} | sessionId=${this._currentSessionId||"pending"}`),b>0){let b=Date.now();await this.prefetchImages(a.body),(0,n.s)("CODEX",`prefetchImages done | ${Date.now()-b}ms`)}else await this.prefetchImages(a.body);let d={...m.cI,...this.config.retry},{attempts:e,delayMs:f}=(0,m.DR)(d[503]),g=0;for(;;){let b=await super.execute(a),c=await this._peekSseOverloaded(b.response);if(!c.matched)return c.replacementBody&&(b.response=new Response(c.replacementBody,{status:b.response.status,statusText:b.response.statusText,headers:b.response.headers})),b;if(g>=e)return a.log?.warn?.("RETRY",`CODEX | SSE overloaded "${c.matched}" — retries exhausted (${g}/${e})`),c.replacementBody&&(b.response=new Response(c.replacementBody,{status:b.response.status,statusText:b.response.statusText,headers:b.response.headers})),b;g++,a.log?.debug?.("RETRY",`CODEX | SSE "${c.matched}" retry ${g}/${e} after ${f/1e3}s`),(0,n.s)("CODEX",`SSE overloaded "${c.matched}" → retry ${g}/${e} in ${f}ms`);try{await c.replacementBody?.cancel?.(`retry ${g}`)}catch{}await new Promise(a=>setTimeout(a,f))}}async _peekSseOverloaded(a){if(!a||!a.ok||!a.body)return{matched:null,replacementBody:null};let b=a.body.getReader(),c=new TextDecoder,d=[],e="",f=null;try{for(;e.length<4096;){let{done:a,value:g}=await b.read();if(a)break;d.push(g),e+=c.decode(g,{stream:!0});let h=p.find(a=>e.includes(a));if(h){f=h;break}}}catch(a){(0,n.s)("CODEX",`peek read error: ${a.message}`)}b.releaseLock();let g=a.body,h=null;return{matched:f,replacementBody:new ReadableStream({start(a){for(let b of d)a.enqueue(b);h=g.getReader()},async pull(a){try{let{done:b,value:c}=await h.read();if(b)return void a.close();a.enqueue(c)}catch(b){a.error(b)}},cancel(a){try{h?.cancel(a)}catch{}}})}}parseError(a,b){if(429===a.status&&b)try{let a=JSON.parse(b),c=a?.error;if(c?.type==="usage_limit_reached"){let a=Date.now(),d=null;if("number"==typeof c.resets_at&&c.resets_at>0){let b=1e3*c.resets_at;b>a&&(d=b)}if(!d&&"number"==typeof c.resets_in_seconds&&c.resets_in_seconds>0&&(d=a+1e3*c.resets_in_seconds),d)return{status:429,message:c.message||b,resetsAtMs:d}}}catch{}return super.parseError(a,b)}transformRequest(a,b,c,d){this._isCompact=!!b._compact,delete b._compact,this._currentSessionId=function(a,b,c){let d=x(a?.prompt_cache_key)||x(a?.session_id)||x(a?.conversation_id);if(d)return d;if(Array.isArray(a?.input)&&a.input.length>0){let b="";for(let c of a.input){if(c?.role!=="assistant")continue;let a=c?"string"==typeof c.content?c.content:Array.isArray(c.content)?c.content.map(a=>a.text||a.output||"").filter(Boolean).join(""):"":"";if(a&&(b+=a).length>=200)break}if(b.length>=50){let a=v((c||"")+b.slice(0,200)),d=q.get(a);if(d)return d.lastUsed=Date.now(),d.sessionId;let e=w();return q.set(a,{sessionId:e,lastUsed:Date.now()}),e}}let e=x(b?.providerSpecificData?.workspaceId);return e||(c?`sess_${v(c)}`:w())}(b,d,u);let e=(0,i.m)(b.input);if(e&&(b.input=e),(!b.input||Array.isArray(b.input)&&0===b.input.length)&&(b.input=[{type:"message",role:"user",content:[{type:"input_text",text:"..."}]}]),function(a){if(!Array.isArray(a.input))return;let b=[];a.input=a.input.filter(a=>a?.type!=="additional_tools"||(Array.isArray(a.tools)&&b.push(...a.tools),!1)),b.length&&(a.tools=[...Array.isArray(a.tools)?a.tools:[],...b])}(b),Array.isArray(b.input))for(let a of b.input)!(!a||"object"!=typeof a||Array.isArray(a))&&("system"!==a.role||a.type&&"message"!==a.type||(a.role="developer"));Array.isArray(b.input)&&(b.input=b.input.filter(a=>{if("string"==typeof a&&r.test(a))return!1;if(a&&"object"==typeof a&&!Array.isArray(a)){if("item_reference"===a.type)return!1;"string"==typeof a.id&&r.test(a.id)&&delete a.id}return!0})),function(a){if(!Array.isArray(a.tools))return;let b=new Set;if(a.tools=a.tools.filter(a=>{if(!a||"object"!=typeof a||Array.isArray(a))return!1;let c="string"==typeof a.type?a.type:"";if("namespace"===c){if(Array.isArray(a.tools))for(let c of a.tools){let a="string"==typeof c?.name?c.name.trim().slice(0,128):"";a&&b.add(a)}return!0}if("function"!==c)return!!c&&!("function"in a)&&!!s.has(c)&&("custom"===c?"string"==typeof a.name&&""!==a.name.trim():!("name"in a));let d=a.function&&"object"==typeof a.function&&!Array.isArray(a.function)?a.function:null,e=("string"==typeof a.name?a.name:"string"==typeof d?.name?d.name:"").trim();if(!e)return!1;let f="string"==typeof a.description?a.description:"string"==typeof d?.description?d.description:"",g=a.parameters&&"object"==typeof a.parameters&&!Array.isArray(a.parameters)?a.parameters:d?.parameters&&"object"==typeof d.parameters&&!Array.isArray(d.parameters)?d.parameters:{type:"object",properties:{}};for(let b of Object.keys(a))delete a[b];return a.type="function",a.name=e.slice(0,128),f&&(a.description=f),a.parameters=g,b.add(e),!0}),a.tool_choice&&"object"==typeof a.tool_choice&&!Array.isArray(a.tool_choice)&&"function"===a.tool_choice.type){let c="string"==typeof a.tool_choice.name?a.tool_choice.name.trim():"";c&&b.has(c)||delete a.tool_choice}}(b),b.stream=!0,b.instructions&&""!==b.instructions.trim()||(b.instructions=f),b.store=!1,!b.prompt_cache_key&&this._currentSessionId&&(b.prompt_cache_key=this._currentSessionId);let g=(0,k.kt)("cx",a||b.model),{cleanModel:h,effort:j}=(0,o.dv)(g);b.model=(0,k.kt)("cx",h);let l=b.reasoning&&"object"==typeof b.reasoning?b.reasoning:{},m=l.effort??b.reasoning_effort??j??"low";for(let a of(b.reasoning={...l,effort:(0,o.fM)(b.model,m),summary:l.summary||"auto"},delete b.reasoning_effort,b.reasoning&&b.reasoning.effort&&"none"!==b.reasoning.effort&&(b.include=["reasoning.encrypted_content"]),delete b.temperature,delete b.top_p,delete b.frequency_penalty,delete b.presence_penalty,delete b.logprobs,delete b.top_logprobs,delete b.n,delete b.seed,delete b.max_tokens,delete b.max_completion_tokens,delete b.max_output_tokens,delete b.user,delete b.prompt_cache_retention,delete b.metadata,delete b.stream_options,delete b.safety_identifier,delete b.previous_response_id,Object.keys(b)))t.has(a)||delete b[a];return b}}},2887:(a,b,c)=>{"use strict";let{iteratorMixin:d}=c(42425),{kEnumerableProperty:e}=c(84285),{webidl:f}=c(32984),g=c(57975),{runtimeFeatures:h}=c(56758),i=h.has("crypto")?c(77598).randomInt:a=>Math.floor(Math.random()*a);class j{#a=[];#b=null;constructor(a){if(f.util.markAsUncloneable(this),void 0!==a)throw f.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]})}append(a,b,c){f.brandCheck(this,j);let d="FormData.append";f.argumentLengthCheck(arguments,2,d),a=f.converters.USVString(a),3==arguments.length||f.is.Blob(b)?(b=f.converters.Blob(b,d,"value"),void 0!==c&&(c=f.converters.USVString(c))):b=f.converters.USVString(b);let e=n(a,b,c);this.#a.push(e)}delete(a){f.brandCheck(this,j),f.argumentLengthCheck(arguments,1,"FormData.delete"),a=f.converters.USVString(a),this.#a=this.#a.filter(b=>b.name!==a)}get(a){f.brandCheck(this,j),f.argumentLengthCheck(arguments,1,"FormData.get"),a=f.converters.USVString(a);let b=this.#a.findIndex(b=>b.name===a);return -1===b?null:this.#a[b].value}getAll(a){return f.brandCheck(this,j),f.argumentLengthCheck(arguments,1,"FormData.getAll"),a=f.converters.USVString(a),this.#a.filter(b=>b.name===a).map(a=>a.value)}has(a){return f.brandCheck(this,j),f.argumentLengthCheck(arguments,1,"FormData.has"),a=f.converters.USVString(a),-1!==this.#a.findIndex(b=>b.name===a)}set(a,b,c){f.brandCheck(this,j);let d="FormData.set";f.argumentLengthCheck(arguments,2,d),a=f.converters.USVString(a),3==arguments.length||f.is.Blob(b)?(b=f.converters.Blob(b,d,"value"),void 0!==c&&(c=f.converters.USVString(c))):b=f.converters.USVString(b);let e=n(a,b,c),g=this.#a.findIndex(b=>b.name===a);-1!==g?this.#a=[...this.#a.slice(0,g),e,...this.#a.slice(g+1).filter(b=>b.name!==a)]:this.#a.push(e)}[g.inspect.custom](a,b){let c=this.#a.reduce((a,b)=>(a[b.name]?Array.isArray(a[b.name])?a[b.name].push(b.value):a[b.name]=[a[b.name],b.value]:a[b.name]=b.value,a),{__proto__:null});b.depth??=a,b.colors??=!0;let d=g.formatWithOptions(b,c);return`FormData ${d.slice(d.indexOf("]")+2)}`}static getFormDataState(a){return a.#a}static setFormDataState(a,b){a.#a=b}static getFormDataBoundary(a){let b=a.#b;return null!=b?b:a.#b=`----formdata-undici-0${`${i(1e11)}`.padStart(11,"0")}`}}let{getFormDataState:k,setFormDataState:l,getFormDataBoundary:m}=j;function n(a,b,c){if("string"==typeof b);else if(f.is.File(b)||(b=new File([b],"blob",{type:b.type})),void 0!==c){let a={type:b.type,lastModified:b.lastModified};b=new File([b],c,a)}return{name:a,value:b}}Reflect.deleteProperty(j,"getFormDataState"),Reflect.deleteProperty(j,"setFormDataState"),Reflect.deleteProperty(j,"getFormDataBoundary"),d("FormData",j,k,"name","value"),Object.defineProperties(j.prototype,{append:e,delete:e,get:e,getAll:e,has:e,set:e,[Symbol.toStringTag]:{value:"FormData",configurable:!0}}),f.is.FormData=f.util.MakeTypeAssertion(j),a.exports={FormData:j,makeEntry:n,setFormDataState:l,getFormDataBoundary:m}},3338:(a,b,c)=>{"use strict";c.d(b,{x:()=>q});var d=c(69384),e=c(30395),f=c(48991),g=c(8735),h=c(70884),i=c(56248),j=c(56294),k=c(42541),l=c(92843),m=c(46956),n=c(55511),o=c.n(n),p=c(11484);class q extends d.Hv{constructor(){super("github",e.xq.github),this.knownCodexModels=new Set}isClaudeModel(a){return/claude/i.test(a||"")}buildUrl(a,b,c=0){return this.config.baseUrl}buildHeaders(a,b=!0){let c=a.copilotToken||a.accessToken;return{Authorization:`Bearer ${c}`,"Content-Type":"application/json","copilot-integration-id":"vscode-chat","editor-version":`vscode/${f.x0.VSCODE_VERSION}`,"editor-plugin-version":`copilot-chat/${f.x0.COPILOT_CHAT_VERSION}`,"user-agent":f.x0.USER_AGENT,"openai-intent":"conversation-panel","x-github-api-version":f.x0.API_VERSION,"x-request-id":o().randomUUID?.()||`${Date.now()}-${Math.random().toString(36).slice(2)}`,"x-vscode-user-agent-library-version":"electron-fetch","X-Initiator":"user","anthropic-version":"2023-06-01",Accept:b?"text/event-stream":"application/json"}}sanitizeMessagesForChatCompletions(a){if(!a?.messages)return a;let b={...a};if(a.response_format&&a.model?.includes("claude")){let b=a.response_format,c="";if("json_schema"===b.type&&b.json_schema?.schema?c="CRITICAL: You must ONLY output raw JSON. Never use markdown code blocks. Never use backticks. Never wrap JSON in triple backticks. Output ONLY the raw JSON object.":"json_object"===b.type&&(c="CRITICAL: You must ONLY output raw JSON. Never use markdown code blocks. Never use backticks."),c){let b=a.messages.findIndex(a=>"system"===a.role);b>=0?a.messages[b].content=c+"\n\n"+a.messages[b].content:a.messages.unshift({role:"system",content:c});let d=a.messages.map((a,b)=>"user"===a.role?b:-1).filter(a=>a>=0).pop();if(d>=0){let b=a.messages[d],c="string"==typeof b.content?b.content:JSON.stringify(b.content);b.content="Respond with ONLY raw JSON (no markdown, no backticks, no code blocks): "+c}}}return b.messages=a.messages.map(a=>{if(!a.content||"string"==typeof a.content)return a;if(Array.isArray(a.content)){let b=a.content.map(a=>{if("text"===a.type||"image_url"===a.type)return a;let b=a.text||a.content||JSON.stringify(a);return{type:"text",text:"string"==typeof b?b:JSON.stringify(b)}}).filter(a=>""!==a.text);return{...a,content:b.length>0?b:null}}return a}),b}requiresMaxCompletionTokens(a){return/gpt-5|o[134]-/i.test(a)}supportsTemperature(a){return!/gpt-5\.4/i.test(a)}supportsThinking(a){return!/claude/i.test(a)}supportsReasoningEffort(a){let b=a.toLowerCase();return!!(/claude.*opus.*4\.6/i.test(b)||/claude.*sonnet.*4\.6/i.test(b))||!/claude/i.test(a)}transformRequest(a,b,c,d){let e={...b};return this.requiresMaxCompletionTokens(a)&&void 0!==e.max_tokens&&(e.max_completion_tokens=e.max_tokens,delete e.max_tokens),this.supportsTemperature(a)||void 0===e.temperature||delete e.temperature,this.supportsThinking(a)||delete e.thinking,"none"===e.reasoning_effort&&delete e.reasoning_effort,this.supportsReasoningEffort(a)||void 0===e.reasoning_effort||delete e.reasoning_effort,e}supportsResponsesEndpoint(a){let b=(a||"").toLowerCase();return!(b.includes("gemini")||b.includes("claude"))}async execute(a){let{model:b,log:c}=a;if(this.isClaudeModel(b))return c?.debug("GITHUB",`Using /v1/messages route for ${b}`),this.executeWithMessagesEndpoint(a);if(this.knownCodexModels.has(b)&&this.supportsResponsesEndpoint(b))return c?.debug("GITHUB",`Using cached /responses route for ${b}`),this.executeWithResponsesEndpoint(a);let d={...a,body:this.sanitizeMessagesForChatCompletions(a.body)},e=await super.execute({...d,proxyOptions:a.proxyOptions||null});if(e.response.status===g.gx.BAD_REQUEST&&this.supportsResponsesEndpoint(b)){let d=await e.response.clone().text();if(d.includes("not accessible via the /chat/completions endpoint")||d.includes("The requested model is not supported"))return c?.warn("GITHUB",`Model ${b} requires /responses. Switching...`),this.knownCodexModels.add(b),this.executeWithResponsesEndpoint(a)}return e}async executeWithResponsesEndpoint({model:a,body:b,stream:c,credentials:d,signal:e,log:f,proxyOptions:g=null}){let k=this.config.responsesUrl,n=this.buildHeaders(d,!0),o=(0,h.openaiToOpenAIResponsesRequest)(a,b,!0,d);f?.debug("GITHUB","Sending translated request to /responses");let p=await (0,m.proxyAwareFetch)(k,{method:"POST",headers:n,body:JSON.stringify(o),signal:e},g);if(!p.ok)return{response:p,url:k,headers:n,transformedBody:o};let q=(0,j.Ws)("openai-responses");q.model=a;let r=new TextDecoder,s="",t=new TransformStream({async transform(a,b){let c=(s+=r.decode(a,{stream:!0})).split("\n");for(let a of(s=c.pop()||"",c)){let c=a.trim();if(!c)continue;let d=(0,l.tV)(c);if(!d)continue;if(d.done&&1){b.enqueue(new TextEncoder().encode("data: [DONE]\n\n"));continue}let e=(0,i.openaiResponsesToOpenAIResponse)(d,q);if(e){let a=(0,l.v8)(e,"openai");b.enqueue(new TextEncoder().encode(a))}}},flush(a){if(s.trim()){let b=(0,l.tV)(s.trim());if(b&&!b.done){let c=(0,i.openaiResponsesToOpenAIResponse)(b,q);c&&a.enqueue(new TextEncoder().encode((0,l.v8)(c,"openai")))}}}});return p.body?{response:new Response(p.body.pipeThrough(t),{status:p.status,statusText:p.statusText,headers:p.headers}),url:k,headers:n,transformedBody:o}:{response:new Response("",{status:p.status,headers:p.headers}),url:k,headers:n,transformedBody:o}}async executeWithMessagesEndpoint({model:a,body:b,stream:c,credentials:d,signal:e,log:f,proxyOptions:g=null}){let h=this.config.messagesUrl,i=this.buildHeaders(d,!0),n=(0,j.GH)(k.h.OPENAI,k.h.CLAUDE,a,b,!0,d,"github"),o=n?._toolNameMap;n&&delete n._toolNameMap,f?.debug("GITHUB","Sending translated request to /v1/messages");let p=await (0,m.proxyAwareFetch)(h,{method:"POST",headers:i,body:JSON.stringify(n),signal:e},g);if(!p.ok)return{response:p,url:h,headers:i,transformedBody:n};let q=(0,j.Ws)(k.h.CLAUDE);if(q.model=a,o&&(q.toolNameMap=o),!p.body)return{response:new Response("",{status:p.status,headers:p.headers}),url:h,headers:i,transformedBody:n};let r=new TextDecoder,s=new TextEncoder,t="",u=(a,b)=>{for(let c of(0,j.Y8)(k.h.CLAUDE,k.h.OPENAI,b,q)||[])a.enqueue(s.encode((0,l.v8)(c,k.h.OPENAI)))},v=new TransformStream({transform(a,b){let d=(t+=r.decode(a,{stream:!0})).split("\n");for(let a of(t=d.pop()||"",d)){let d=(0,l.tV)(a.trim());if(d){if(d.done){!0===c&&b.enqueue(s.encode("data: [DONE]\n\n"));continue}u(b,d)}}},flush(a){if(!(t+=r.decode()).trim())return;let b=(0,l.tV)(t.trim());b&&!b.done&&u(a,b)}});return{response:new Response(p.body.pipeThrough(v),{status:p.status,statusText:p.statusText,headers:p.headers}),url:h,headers:i,transformedBody:n}}async refreshCopilotToken(a,b,c=null){try{let d=await (0,m.proxyAwareFetch)("https://api.github.com/copilot_internal/v2/token",{headers:{Authorization:`token ${a}`,"User-Agent":f.x0.USER_AGENT,"Editor-Version":`vscode/${f.x0.VSCODE_VERSION}`,"Editor-Plugin-Version":`copilot-chat/${f.x0.COPILOT_CHAT_VERSION}`,Accept:"application/json","x-github-api-version":f.x0.API_VERSION}},c);if(!d.ok){let a=await d.text();return b?.error?.("TOKEN",`Copilot token refresh failed: ${d.status} ${a}`),null}let e=await d.json();return b?.info?.("TOKEN","Copilot token refreshed"),{token:e.token,expiresAt:e.expires_at}}catch(a){return b?.error?.("TOKEN",`Copilot refresh error: ${a.message}`),null}}async refreshGitHubToken(a,b,c=null){try{let d={grant_type:"refresh_token",refresh_token:a,client_id:this.config.clientId};this.config.clientSecret&&(d.client_secret=this.config.clientSecret);let e=await (0,m.proxyAwareFetch)(f.NA.github.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams(d)},c);if(!e.ok)return await (0,p.aI)(e),null;let g=await e.json();return b?.info?.("TOKEN","GitHub token refreshed"),{accessToken:g.access_token,refreshToken:g.refresh_token||a,expiresIn:g.expires_in}}catch(a){return b?.error?.("TOKEN",`GitHub refresh error: ${a.message}`),null}}async refreshCredentials(a,b,c=null){let d=await this.refreshCopilotToken(a.accessToken,b,c);if(!d&&a.refreshToken){let e=await this.refreshGitHubToken(a.refreshToken,b,c);if(e?.accessToken)return(d=await this.refreshCopilotToken(e.accessToken,b,c))?{...e,copilotToken:d.token,copilotTokenExpiresAt:d.expiresAt}:e}return d?{accessToken:a.accessToken,refreshToken:a.refreshToken,copilotToken:d.token,copilotTokenExpiresAt:d.expiresAt}:null}needsRefresh(a){if(!a.copilotToken)return!0;if(a.copilotTokenExpiresAt){let b=a.copilotTokenExpiresAt;if("number"==typeof b&&b<1e12?b*=1e3:"string"==typeof b&&(b=new Date(b).getTime()),b-Date.now()<3e5)return!0}return super.needsRefresh(a)}}},3433:(a,b,c)=>{"use strict";c(40106);let d=c(7344),e=(c(35689),c(61330),c(34441),c(37417)),f=(c(74399),c(48841)),g=(c(64156),c(43086),c(95095),c(53552),c(61448)),h=c(84285),{InvalidArgumentError:i}=g,j=c(99528),{MockCallHistory:k,MockCallHistoryLog:l}=(c(55285),c(66498),c(43904)),{getGlobalDispatcher:m,setGlobalDispatcher:n}=(c(65630),c(86625),c(89512),c(28998),c(31825),c(59970));function o(a){return(b,c,d)=>{if("function"==typeof c&&(d=c,c=null),!b||"string"!=typeof b&&"object"!=typeof b&&!(b instanceof URL))throw new i("invalid url");if(null!=c&&"object"!=typeof c)throw new i("invalid opts");if(c&&null!=c.path){if("string"!=typeof c.path)throw new i("invalid opts.path");let a=c.path;c.path.startsWith("/")||(a=`/${a}`),b=new URL(h.parseOrigin(b).origin+a)}else c||(c="object"==typeof b?b:{}),b=h.parseURL(b);let{agent:e,dispatcher:f=m(),...g}=c;if(e)throw new i("unsupported opts.agent. Did you mean opts.client?");return a.call(f,{...g,origin:b.origin,path:b.search?`${b.pathname}${b.search}`:b.pathname,method:c.method||(c.body?"PUT":"GET")},d)}}c(83204),c(67519),Object.assign(d.prototype,j),a.exports.g6=e,a.exports.ProxyAgent=f,c(70707),c(47335),c(78075),c(87085),c(27060),c(19431),c(37858),c(90249),c(38650),c(20579),h.parseHeaders,h.headerNameToString;let p=c(76403).fetch,q=__filename;a.exports.hd=function(b,c){return p(b,c).catch(b=>{throw q?!function a(b,c){if(!b||"object"!=typeof b)return;let d="string"==typeof b.stack?b.stack:"",e=c.replace(/\\/g,"/");if(d&&(d.includes(c)||d.includes(e)))return;let f={};if(Error.captureStackTrace(f,a),!f.stack)return;let g=f.stack.split("\n").slice(1).join("\n");b.stack=d?`${d}
117
+ * Examples: src/app.ts, src/app.ts:42, b/server/index.js#L10, C:\\repo\\project\\main.rs:12:5`;var g=c(30395),h=c(79154),i=c(80993),j=c(21904),k=c(32210),l=c(41310),m=c(8735),n=c(32557),o=c(46714);let p=["server_is_overloaded","service_unavailable_error"],q=new Map,r=/^(rs|fc|resp|msg)_/,s=new Set(["image_generation","web_search","web_search_preview","file_search","computer","computer_use_preview","code_interpreter","mcp","local_shell","custom"]),t=new Set(["model","input","instructions","tools","tool_choice","stream","store","reasoning","service_tier","include","prompt_cache_key","client_metadata"]),u=null;function v(a){return(0,d.createHash)("sha256").update(a).digest("hex").slice(0,16)}function w(){return`sess_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,9)}`}function x(a){if("string"!=typeof a)return null;let b=a.trim();return!b||b.length>256?null:b}(0,l.Xj)().then(a=>{u=a}),setInterval(()=>{let a=Date.now();for(let[b,c]of q)a-c.lastUsed>36e5&&q.delete(b)},6e5);class y extends e.Hv{constructor(){super("codex",g.xq.codex),this._currentSessionId=null}buildHeaders(a,b=!0){let c=super.buildHeaders(a,b);c.session_id=this._currentSessionId||a?.connectionId||"default",c.originator||(c.originator="codex_cli_rs");let d=a?.providerSpecificData?.workspaceId;return"string"==typeof d&&d&&!c["chatgpt-account-id"]&&(c["chatgpt-account-id"]=d),c}buildUrl(a,b,c=0,d=null){let e=super.buildUrl(a,b,c,d);return this._isCompact?`${e}/compact`:e}async refreshCredentials(a,b){return a?.refreshToken?(0,h.Vq)("codex",a,b):null}needsRefresh(a){return(0,h.fp)("codex",a)}async prefetchImages(a){if(Array.isArray(a?.input))for(let b of a.input){if(!Array.isArray(b.content))continue;let a=b.content.map(async a=>{if("image_url"!==a.type)return a;let b="string"==typeof a.image_url?a.image_url:a.image_url?.url,c=a.image_url?.detail||"auto";if(!b)return a;if(b.startsWith("data:"))return{type:"input_image",image_url:b,detail:c};let d=await (0,j.n)(b,{timeoutMs:15e3});return{type:"input_image",image_url:d?.url||b,detail:c}});b.content=await Promise.all(a)}}async execute(a){let b=Array.isArray(a.body?.input)?a.body.input.reduce((a,b)=>a+(Array.isArray(b.content)?b.content.filter(a=>"image_url"===a.type).length:0),0):0,c=Array.isArray(a.body?.input)?a.body.input.length:0;if((0,n.s)("CODEX",`execute start | inputItems=${c} | images=${b} | sessionId=${this._currentSessionId||"pending"}`),b>0){let b=Date.now();await this.prefetchImages(a.body),(0,n.s)("CODEX",`prefetchImages done | ${Date.now()-b}ms`)}else await this.prefetchImages(a.body);let d={...m.cI,...this.config.retry},{attempts:e,delayMs:f}=(0,m.DR)(d[503]),g=0;for(;;){let b=await super.execute(a),c=await this._peekSseOverloaded(b.response);if(!c.matched)return c.replacementBody&&(b.response=new Response(c.replacementBody,{status:b.response.status,statusText:b.response.statusText,headers:b.response.headers})),b;if(g>=e)return a.log?.warn?.("RETRY",`CODEX | SSE overloaded "${c.matched}" — retries exhausted (${g}/${e})`),c.replacementBody&&(b.response=new Response(c.replacementBody,{status:b.response.status,statusText:b.response.statusText,headers:b.response.headers})),b;g++,a.log?.debug?.("RETRY",`CODEX | SSE "${c.matched}" retry ${g}/${e} after ${f/1e3}s`),(0,n.s)("CODEX",`SSE overloaded "${c.matched}" → retry ${g}/${e} in ${f}ms`);try{await c.replacementBody?.cancel?.(`retry ${g}`)}catch{}await new Promise(a=>setTimeout(a,f))}}async _peekSseOverloaded(a){if(!a||!a.ok||!a.body)return{matched:null,replacementBody:null};let b=a.body.getReader(),c=new TextDecoder,d=[],e="",f=null;try{for(;e.length<4096;){let{done:a,value:g}=await b.read();if(a)break;d.push(g),e+=c.decode(g,{stream:!0});let h=p.find(a=>e.includes(a));if(h){f=h;break}}}catch(a){(0,n.s)("CODEX",`peek read error: ${a.message}`)}b.releaseLock();let g=a.body,h=null;return{matched:f,replacementBody:new ReadableStream({start(a){for(let b of d)a.enqueue(b);h=g.getReader()},async pull(a){try{let{done:b,value:c}=await h.read();if(b)return void a.close();a.enqueue(c)}catch(b){a.error(b)}},cancel(a){try{h?.cancel(a)}catch{}}})}}parseError(a,b){if(429===a.status&&b)try{let a=JSON.parse(b),c=a?.error;if(c?.type==="usage_limit_reached"){let a=Date.now(),d=null;if("number"==typeof c.resets_at&&c.resets_at>0){let b=1e3*c.resets_at;b>a&&(d=b)}if(!d&&"number"==typeof c.resets_in_seconds&&c.resets_in_seconds>0&&(d=a+1e3*c.resets_in_seconds),d)return{status:429,message:c.message||b,resetsAtMs:d}}}catch{}return super.parseError(a,b)}transformRequest(a,b,c,d){this._isCompact=!!b._compact,delete b._compact,this._currentSessionId=function(a,b,c){let d=x(a?.prompt_cache_key)||x(a?.session_id)||x(a?.conversation_id);if(d)return d;if(Array.isArray(a?.input)&&a.input.length>0){let b="";for(let c of a.input){if(c?.role!=="assistant")continue;let a=c?"string"==typeof c.content?c.content:Array.isArray(c.content)?c.content.map(a=>a.text||a.output||"").filter(Boolean).join(""):"":"";if(a&&(b+=a).length>=200)break}if(b.length>=50){let a=v((c||"")+b.slice(0,200)),d=q.get(a);if(d)return d.lastUsed=Date.now(),d.sessionId;let e=w();return q.set(a,{sessionId:e,lastUsed:Date.now()}),e}}let e=x(b?.providerSpecificData?.workspaceId);return e||(c?`sess_${v(c)}`:w())}(b,d,u);let e=(0,i.m)(b.input);if(e&&(b.input=e),(!b.input||Array.isArray(b.input)&&0===b.input.length)&&(b.input=[{type:"message",role:"user",content:[{type:"input_text",text:"..."}]}]),function(a){if(!Array.isArray(a.input))return;let b=[];a.input=a.input.filter(a=>a?.type!=="additional_tools"||(Array.isArray(a.tools)&&b.push(...a.tools),!1)),b.length&&(a.tools=[...Array.isArray(a.tools)?a.tools:[],...b])}(b),Array.isArray(b.input))for(let a of b.input)!(!a||"object"!=typeof a||Array.isArray(a))&&("system"!==a.role||a.type&&"message"!==a.type||(a.role="developer"));Array.isArray(b.input)&&(b.input=b.input.filter(a=>{if("string"==typeof a&&r.test(a))return!1;if(a&&"object"==typeof a&&!Array.isArray(a)){if("item_reference"===a.type)return!1;"string"==typeof a.id&&r.test(a.id)&&delete a.id}return!0})),function(a){if(!Array.isArray(a.tools))return;let b=new Set;if(a.tools=a.tools.filter(a=>{if(!a||"object"!=typeof a||Array.isArray(a))return!1;let c="string"==typeof a.type?a.type:"";if("namespace"===c){if(Array.isArray(a.tools))for(let c of a.tools){let a="string"==typeof c?.name?c.name.trim().slice(0,128):"";a&&b.add(a)}return!0}if("function"!==c)return!!c&&!("function"in a)&&!!s.has(c)&&("custom"===c?"string"==typeof a.name&&""!==a.name.trim():!("name"in a));let d=a.function&&"object"==typeof a.function&&!Array.isArray(a.function)?a.function:null,e=("string"==typeof a.name?a.name:"string"==typeof d?.name?d.name:"").trim();if(!e)return!1;let f="string"==typeof a.description?a.description:"string"==typeof d?.description?d.description:"",g=a.parameters&&"object"==typeof a.parameters&&!Array.isArray(a.parameters)?a.parameters:d?.parameters&&"object"==typeof d.parameters&&!Array.isArray(d.parameters)?d.parameters:{type:"object",properties:{}};for(let b of Object.keys(a))delete a[b];return a.type="function",a.name=e.slice(0,128),f&&(a.description=f),a.parameters=g,b.add(e),!0}),a.tool_choice&&"object"==typeof a.tool_choice&&!Array.isArray(a.tool_choice)&&"function"===a.tool_choice.type){let c="string"==typeof a.tool_choice.name?a.tool_choice.name.trim():"";c&&b.has(c)||delete a.tool_choice}}(b),b.stream=!0,b.instructions&&""!==b.instructions.trim()||(b.instructions=f),b.store=!1,!b.prompt_cache_key&&this._currentSessionId&&(b.prompt_cache_key=this._currentSessionId);let g=(0,k.kt)("cx",a||b.model),{cleanModel:h,effort:j}=(0,o.dv)(g);b.model=(0,k.kt)("cx",h);let l=b.reasoning&&"object"==typeof b.reasoning?b.reasoning:{},m=l.effort??b.reasoning_effort??j??"low";for(let a of(b.reasoning={...l,effort:(0,o.fM)(b.model,m),summary:l.summary||"auto"},delete b.reasoning_effort,b.reasoning&&b.reasoning.effort&&"none"!==b.reasoning.effort&&(b.include=["reasoning.encrypted_content"]),delete b.temperature,delete b.top_p,delete b.frequency_penalty,delete b.presence_penalty,delete b.logprobs,delete b.top_logprobs,delete b.n,delete b.seed,delete b.max_tokens,delete b.max_completion_tokens,delete b.max_output_tokens,delete b.user,delete b.prompt_cache_retention,delete b.metadata,delete b.stream_options,delete b.safety_identifier,delete b.previous_response_id,Object.keys(b)))t.has(a)||delete b[a];return b}}},2887:(a,b,c)=>{"use strict";let{iteratorMixin:d}=c(42425),{kEnumerableProperty:e}=c(84285),{webidl:f}=c(32984),g=c(57975),{runtimeFeatures:h}=c(56758),i=h.has("crypto")?c(77598).randomInt:a=>Math.floor(Math.random()*a);class j{#a=[];#b=null;constructor(a){if(f.util.markAsUncloneable(this),void 0!==a)throw f.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]})}append(a,b,c){f.brandCheck(this,j);let d="FormData.append";f.argumentLengthCheck(arguments,2,d),a=f.converters.USVString(a),3==arguments.length||f.is.Blob(b)?(b=f.converters.Blob(b,d,"value"),void 0!==c&&(c=f.converters.USVString(c))):b=f.converters.USVString(b);let e=n(a,b,c);this.#a.push(e)}delete(a){f.brandCheck(this,j),f.argumentLengthCheck(arguments,1,"FormData.delete"),a=f.converters.USVString(a),this.#a=this.#a.filter(b=>b.name!==a)}get(a){f.brandCheck(this,j),f.argumentLengthCheck(arguments,1,"FormData.get"),a=f.converters.USVString(a);let b=this.#a.findIndex(b=>b.name===a);return -1===b?null:this.#a[b].value}getAll(a){return f.brandCheck(this,j),f.argumentLengthCheck(arguments,1,"FormData.getAll"),a=f.converters.USVString(a),this.#a.filter(b=>b.name===a).map(a=>a.value)}has(a){return f.brandCheck(this,j),f.argumentLengthCheck(arguments,1,"FormData.has"),a=f.converters.USVString(a),-1!==this.#a.findIndex(b=>b.name===a)}set(a,b,c){f.brandCheck(this,j);let d="FormData.set";f.argumentLengthCheck(arguments,2,d),a=f.converters.USVString(a),3==arguments.length||f.is.Blob(b)?(b=f.converters.Blob(b,d,"value"),void 0!==c&&(c=f.converters.USVString(c))):b=f.converters.USVString(b);let e=n(a,b,c),g=this.#a.findIndex(b=>b.name===a);-1!==g?this.#a=[...this.#a.slice(0,g),e,...this.#a.slice(g+1).filter(b=>b.name!==a)]:this.#a.push(e)}[g.inspect.custom](a,b){let c=this.#a.reduce((a,b)=>(a[b.name]?Array.isArray(a[b.name])?a[b.name].push(b.value):a[b.name]=[a[b.name],b.value]:a[b.name]=b.value,a),{__proto__:null});b.depth??=a,b.colors??=!0;let d=g.formatWithOptions(b,c);return`FormData ${d.slice(d.indexOf("]")+2)}`}static getFormDataState(a){return a.#a}static setFormDataState(a,b){a.#a=b}static getFormDataBoundary(a){let b=a.#b;return null!=b?b:a.#b=`----formdata-undici-0${`${i(1e11)}`.padStart(11,"0")}`}}let{getFormDataState:k,setFormDataState:l,getFormDataBoundary:m}=j;function n(a,b,c){if("string"==typeof b);else if(f.is.File(b)||(b=new File([b],"blob",{type:b.type})),void 0!==c){let a={type:b.type,lastModified:b.lastModified};b=new File([b],c,a)}return{name:a,value:b}}Reflect.deleteProperty(j,"getFormDataState"),Reflect.deleteProperty(j,"setFormDataState"),Reflect.deleteProperty(j,"getFormDataBoundary"),d("FormData",j,k,"name","value"),Object.defineProperties(j.prototype,{append:e,delete:e,get:e,getAll:e,has:e,set:e,[Symbol.toStringTag]:{value:"FormData",configurable:!0}}),f.is.FormData=f.util.MakeTypeAssertion(j),a.exports={FormData:j,makeEntry:n,setFormDataState:l,getFormDataBoundary:m}},3143:(a,b,c)=>{"use strict";c.r(b),c.d(b,{buildKiroPayload:()=>y});var d=c(56294),e=c(42541),f=c(27137),g=c(54838),h=c(55511),i=c.n(h),j=c(8735);let k=new Map;function l(a){return null==a?a:JSON.parse(JSON.stringify(a))}function m(a,b){return a?.userInputMessage&&!a.userInputMessage.modelId&&b&&(a.userInputMessage.modelId=b),a}function n(a,b){for(let c of a||[])m(c,b);return a}function o(a,b,c){let d=l(a)||{userInputMessage:{content:""}};if(d.userInputMessage||(d.userInputMessage={content:""}),m(d,c),b){let a=d.userInputMessage.content||"";d.userInputMessage.content=a?`${b}
118
+
119
+ ${a}`:b}return d}function p(a){return a.findIndex(a=>a?.userInputMessage)}function q(a,b){var c;return 0===b&&(c=a[b],!c?.userInputMessage?.userInputMessageContext?.toolResults?.length)}let r=setInterval(()=>{let a=Date.now();for(let[b,c]of k)a-c.lastUsed>j.v1.sessionTtlMs&&k.delete(b)},j.v1.sessionCleanupIntervalMs);r.unref&&r.unref();var s=c(77855);let t=/[^a-zA-Z0-9_-]/g;function u(a,b,c=4096){var d;return d="string"==typeof a&&a.trim()?a:`Tool: ${b}`,"string"!=typeof d||d.length<=c?d:`${d.slice(0,c)}
120
+
121
+ [truncated for Kiro payload limit]`}function v(a,b){return a.map(a=>({...a,toolSpecification:{...a.toolSpecification,description:u(a.toolSpecification?.description||"",a.toolSpecification?.name,b)}}))}function w(a,b){let c;try{c="string"==typeof b?b:JSON.stringify(b??{})}catch{c="{}"}return`[Tool call: ${a||"unknown"}(${c})]`}function x(a){let b=Array.isArray(a)?a.map(a=>"string"==typeof a?a:a.text||"").join("\n"):"string"==typeof a?a:"";return`[Tool result: ${b}]`}function y(a,b,c,d){let e,h,j,r,y,z=b.messages||[],A=b.tools||[],B=b.max_tokens??b.max_output_tokens??32e3,C=b.temperature,D=b.top_p,{upstream:E,agentic:F}=(0,g.$D)(a),G=(0,g.gI)(b,null,a),H=(0,g.ZF)(b),{forward:I,reverse:J}=(e=new Set,h=new Map,j=new Map,(Array.isArray(A)?A:[]).forEach((a,b)=>{let c=a?.function?.name||a?.name;if("string"!=typeof c||!c.trim()||h.has(c))return;let d=function(a,b,c){let d=(String(a||"").trim().replace(t,"_").replace(/_+/g,"_").replace(/^_+|_+$/g,"")||`tool_${b+1}`).slice(0,64),e=d,f=2;for(;c.has(e);){let a=`_${f++}`;e=`${d.slice(0,64-a.length)}${a}`}return c.add(e),e}(c,b,e);h.set(c,d),d!==c&&j.set(d,c)}),{forward:h,reverse:j}),{history:K,currentMessage:L}=function(a,b,c,d=null){let e=[],g=null,h=b&&b.length>0;h||(a=function(a){let b=[];for(let c of a){if("tool"===c.role){b.push({role:"user",content:x(c.content)});continue}if("assistant"===c.role){let a=[];if(Array.isArray(c.content))for(let b of c.content)"tool_use"===b.type?a.push(w(b.name,b.input)):("text"===b.type||b.text)&&a.push(b.text||"");else"string"==typeof c.content&&a.push(c.content);for(let b of c.tool_calls||[])a.push(w(b.function?.name,b.function?.arguments));b.push({role:"assistant",content:a.filter(Boolean).join("\n")});continue}if("user"===c.role&&Array.isArray(c.content)){let a=c.content.map(a=>"tool_result"===a.type?{type:"text",text:x(a.content)}:a);b.push({...c,content:a});continue}b.push(c)}return b}(a));let i=[],j=[],k=[],l=[],m=null,n=!1,o=()=>{if("user"===m){let a={userInputMessage:{content:i.join("\n\n").trim()||"continue",modelId:""}};l.length>0&&(a.userInputMessage.images=l),k.length>0&&(a.userInputMessage.userInputMessageContext={toolResults:k}),h&&!n&&(a.userInputMessage.userInputMessageContext||(a.userInputMessage.userInputMessageContext={}),a.userInputMessage.userInputMessageContext.tools=function(a){if(JSON.stringify(a).length<=262144)return a;let b=v(a,1024);return JSON.stringify(b).length<=262144?b:b=v(a,256)}(b.map(a=>(function(a,b=null){let c=a.function?.name||a.name,d=b?.get(c)||c,e=a.function?{...a,function:{...a.function,name:d}}:{...a,name:d},f=(0,s.tH)([e]).specs[0]||null;return f&&(f.toolSpecification.description=u(f.toolSpecification.description,d)),f})(a,d)).filter(Boolean)),n=!0),e.push(a),g=a,i=[],k=[],l=[]}else if("assistant"===m){let a=j.join("\n\n").trim()||"...";e.push({assistantResponseMessage:{content:a}}),j=[]}};for(let b=0;b<a.length;b++){let c=a[b],g=c.role;if(("system"===g||"tool"===g)&&(g="user"),g!==m&&null!==m&&o(),m=g,"user"===g){let a="";if("string"==typeof c.content)a=c.content;else if(Array.isArray(c.content)){let b=[];for(let a of c.content)if("text"===a.type||a.text)b.push(a.text||"");else if("image_url"===a.type){let b=a.image_url?.url||"",c=b.match(/^data:([^;]+);base64,(.+)$/);if(c){let a=c[1],b=a.split("/")[1]||a;l.push({format:b,source:{bytes:c[2]}})}else if(b.startsWith("http://")||b.startsWith("https://")){let a=(()=>{try{return new URL(b).pathname}catch{return""}})(),c=a.match(/\.([a-zA-Z0-9]+)$/)?.[1]?.toLowerCase();l.push({format:"jpg"===c?"jpeg":c||"jpeg",source:{url:b}})}}else if("image"===a.type&&a.source?.type==="base64"&&a.source?.data){let b=a.source.media_type||"image/png",c=b.split("/")[1]||b;l.push({format:c,source:{bytes:a.source.data}})}a=b.join("\n");let d=c.content.filter(a=>"tool_result"===a.type);d.length>0&&d.forEach(a=>{let b=Array.isArray(a.content)?a.content.map(a=>a.text||"").join("\n"):"string"==typeof a.content?a.content:"";k.push({toolUseId:a.tool_use_id,status:"success",content:[{text:b}]})})}if("tool"===c.role){let a="string"==typeof c.content?c.content:"";k.push({toolUseId:c.tool_call_id,status:"success",content:[{text:a}]})}else a&&i.push(a)}else if("assistant"===g){let a="",b=[];if(Array.isArray(c.content)?(a=c.content.filter(a=>"text"===a.type).map(a=>a.text).join("\n").trim(),b=c.content.filter(a=>"tool_use"===a.type)):"string"==typeof c.content&&(a=c.content.trim()),c.tool_calls&&c.tool_calls.length>0&&(b=c.tool_calls),a&&j.push(a),b.length>0){o();let a=e[e.length-1];a?.assistantResponseMessage&&(a.assistantResponseMessage.toolUses=b.map(a=>{if(!a.function)return{toolUseId:a.id||(0,f.A)(),name:d?.get(a.name)||a.name,input:a.input||{}};{let b=a.function.name;return{toolUseId:a.id||(0,f.A)(),name:d?.get(b)||b,input:function(a,b){if("string"!=typeof a)return a??b;try{return JSON.parse(a)}catch{return b}}(a.function.arguments,{})}}})),m=null}}}null!==m&&o();for(let a=e.length-1;a>=0;a--)if(e[a].userInputMessage){g=e.splice(a,1)[0];break}let p=e[0]?.userInputMessage?.userInputMessageContext?.tools;e.forEach(a=>{a.userInputMessage?.userInputMessageContext?.tools&&delete a.userInputMessage.userInputMessageContext.tools,a.userInputMessage?.userInputMessageContext&&0===Object.keys(a.userInputMessage.userInputMessageContext).length&&delete a.userInputMessage.userInputMessageContext,a.userInputMessage&&!a.userInputMessage.modelId&&(a.userInputMessage.modelId=c)});let q=[];for(let a=0;a<e.length;a++){let b=e[a];if(b.userInputMessage&&q.length>0&&q[q.length-1].userInputMessage){let a=q[q.length-1];a.userInputMessage.content+="\n\n"+b.userInputMessage.content;let c=a.userInputMessage.userInputMessageContext,d=b.userInputMessage.userInputMessageContext;b.userInputMessage.images?.length>0&&(a.userInputMessage.images=[...a.userInputMessage.images||[],...b.userInputMessage.images]),d&&(c?(d.toolResults?.length>0&&(c.toolResults=[...c.toolResults||[],...d.toolResults]),d.tools?.length>0&&(c.tools=[...c.tools||[],...d.tools])):a.userInputMessage.userInputMessageContext=d)}else q.push(b)}return g||(g={userInputMessage:{content:"",modelId:c}}),h&&function(a,b){let c=new Set;for(let b of a){let a=b.assistantResponseMessage;if(a)for(let b of a.toolUses||[])b.toolUseId&&c.add(b.toolUseId)}for(let d of b?[...a,b]:a){let a=d.userInputMessage,b=a?.userInputMessageContext;if(!b?.toolResults?.length)continue;let e=[],f=[];for(let a of b.toolResults)c.has(a.toolUseId)?e.push(a):f.push(x(a.content));if(0===f.length)continue;let g=f.join("\n");a.content=a.content?`${a.content}
122
+
123
+ ${g}`:g,b.toolResults=e,0!==e.length||b.tools?.length||delete a.userInputMessageContext}}(q,g),p?.length>0&&!g.userInputMessage.userInputMessageContext?.tools&&(g.userInputMessage.userInputMessageContext||(g.userInputMessage.userInputMessageContext={}),g.userInputMessage.userInputMessageContext.tools=p),{history:q,currentMessage:g}}(z,A,E,I),M=d?.providerSpecificData?.profileArn||"",N=[];G&&N.push((0,g.aZ)()),F&&N.push(g.rG);let O=N.join("\n\n"),P=`[Context: Current time is ${new Date().toISOString()}]`,Q=d?.connectionId||d?.providerSpecificData?.connectionId||"",R=K.find(a=>a?.userInputMessage)?.userInputMessage?.content??L?.userInputMessage?.content??"",S=(r=`${Q||"anon"}:${String(R||"").slice(0,4096)}`,[(y=i().createHash("sha256").update(r).digest("hex")).slice(0,8),y.slice(8,12),`4${y.slice(13,16)}`,`8${y.slice(17,20)}`,y.slice(20,32)].join("-")),T=A.map(a=>a?.function?.name||a?.name).filter(Boolean).sort().join(","),U=function({conversationId:a,connectionId:b,modelId:c,systemPrompt:d="",contentPrefix:e="",currentContentPrefix:f="",history:g=[],currentMessage:h}={}){var i;let j,r=`${b||""}:${a||""}`,s=a?k.get(r):null,t=l(g)||[],u=l(h)||{userInputMessage:{content:""}};if(s&&s.modelId===c&&s.systemPrompt===d){s.lastUsed=Date.now();let a=p(t),b=m(l(s.sessionStart),c);return q(t,a)?t[a]=b:(t.unshift(b),1===t.length&&t.push({assistantResponseMessage:{content:"..."}})),{history:n(t,c),currentMessage:o(u,f,c),replayed:!0}}let v=p(t),w=m(u,c);return q(t,v)?(j=o(t[v],e,c),t[v]=l(j),w=o(u,f,c)):v>=0?(j=o({userInputMessage:{content:"",modelId:c}},e,c),t.unshift(l(j)),w=o(u,f,c)):w=l(j=o(u,e,c)),a&&(i={sessionStart:l(j),modelId:c,systemPrompt:d},k.size>=5e3&&k.delete(k.keys().next().value),k.set(r,{...i,lastUsed:Date.now()})),{history:n(t,c),currentMessage:w,replayed:!1}}({conversationId:S,connectionId:Q,modelId:E,systemPrompt:`${O}
124
+ [tools:${T}]`,contentPrefix:O,currentContentPrefix:P,history:K,currentMessage:L}),V=U.currentMessage?.userInputMessage?.userInputMessageContext?.tools||[],W=(0,s.rR)({history:U.history,currentMessage:U.currentMessage,modelId:E,toolSpecs:V,nameMap:I});if(!W.valid)return console.error(`[Kiro] refusing invalid conversation (openai -> kiro): ${W.errors.join(", ")||"unknown"}`),null;let X=W.history,Y=W.currentMessage,Z={conversationState:{chatTriggerType:"MANUAL",conversationId:S,currentMessage:{userInputMessage:{content:Y?.userInputMessage?.content||"",modelId:E,origin:"AI_EDITOR",...Y?.userInputMessage?.images?.length>0&&{images:Y.userInputMessage.images},...Y?.userInputMessage?.userInputMessageContext&&{userInputMessageContext:Y.userInputMessage.userInputMessageContext}}},history:X}};return M&&(Z.profileArn=M),(B||void 0!==C||void 0!==D)&&(Z.inferenceConfig={},B&&(Z.inferenceConfig.maxTokens=B),void 0!==C&&(Z.inferenceConfig.temperature=C),void 0!==D&&(Z.inferenceConfig.topP=D)),Object.defineProperty(Z,"_kiroUpstreamModel",{value:E,enumerable:!1}),Object.defineProperty(Z,"_kiroThinkingEnabled",{value:G,enumerable:!1}),Object.defineProperty(Z,"_kiroExposeReasoning",{value:H,enumerable:!1}),J.size>0&&Object.defineProperty(Z,"_toolNameMap",{value:J,enumerable:!1,configurable:!0}),Z}(0,d.kz)(e.h.OPENAI,e.h.KIRO,y,null)},3338:(a,b,c)=>{"use strict";c.d(b,{x:()=>q});var d=c(69384),e=c(30395),f=c(48991),g=c(8735),h=c(70884),i=c(56248),j=c(56294),k=c(42541),l=c(92843),m=c(46956),n=c(55511),o=c.n(n),p=c(11484);class q extends d.Hv{constructor(){super("github",e.xq.github),this.knownCodexModels=new Set}isClaudeModel(a){return/claude/i.test(a||"")}buildUrl(a,b,c=0){return this.config.baseUrl}buildHeaders(a,b=!0){let c=a.copilotToken||a.accessToken;return{Authorization:`Bearer ${c}`,"Content-Type":"application/json","copilot-integration-id":"vscode-chat","editor-version":`vscode/${f.x0.VSCODE_VERSION}`,"editor-plugin-version":`copilot-chat/${f.x0.COPILOT_CHAT_VERSION}`,"user-agent":f.x0.USER_AGENT,"openai-intent":"conversation-panel","x-github-api-version":f.x0.API_VERSION,"x-request-id":o().randomUUID?.()||`${Date.now()}-${Math.random().toString(36).slice(2)}`,"x-vscode-user-agent-library-version":"electron-fetch","X-Initiator":"user","anthropic-version":"2023-06-01",Accept:b?"text/event-stream":"application/json"}}sanitizeMessagesForChatCompletions(a){if(!a?.messages)return a;let b={...a};if(a.response_format&&a.model?.includes("claude")){let b=a.response_format,c="";if("json_schema"===b.type&&b.json_schema?.schema?c="CRITICAL: You must ONLY output raw JSON. Never use markdown code blocks. Never use backticks. Never wrap JSON in triple backticks. Output ONLY the raw JSON object.":"json_object"===b.type&&(c="CRITICAL: You must ONLY output raw JSON. Never use markdown code blocks. Never use backticks."),c){let b=a.messages.findIndex(a=>"system"===a.role);b>=0?a.messages[b].content=c+"\n\n"+a.messages[b].content:a.messages.unshift({role:"system",content:c});let d=a.messages.map((a,b)=>"user"===a.role?b:-1).filter(a=>a>=0).pop();if(d>=0){let b=a.messages[d],c="string"==typeof b.content?b.content:JSON.stringify(b.content);b.content="Respond with ONLY raw JSON (no markdown, no backticks, no code blocks): "+c}}}return b.messages=a.messages.map(a=>{if(!a.content||"string"==typeof a.content)return a;if(Array.isArray(a.content)){let b=a.content.map(a=>{if("text"===a.type||"image_url"===a.type)return a;let b=a.text||a.content||JSON.stringify(a);return{type:"text",text:"string"==typeof b?b:JSON.stringify(b)}}).filter(a=>""!==a.text);return{...a,content:b.length>0?b:null}}return a}),b}requiresMaxCompletionTokens(a){return/gpt-5|o[134]-/i.test(a)}supportsTemperature(a){return!/gpt-5\.4/i.test(a)}supportsThinking(a){return!/claude/i.test(a)}supportsReasoningEffort(a){let b=a.toLowerCase();return!!(/claude.*opus.*4\.6/i.test(b)||/claude.*sonnet.*4\.6/i.test(b))||!/claude/i.test(a)}transformRequest(a,b,c,d){let e={...b};return this.requiresMaxCompletionTokens(a)&&void 0!==e.max_tokens&&(e.max_completion_tokens=e.max_tokens,delete e.max_tokens),this.supportsTemperature(a)||void 0===e.temperature||delete e.temperature,this.supportsThinking(a)||delete e.thinking,"none"===e.reasoning_effort&&delete e.reasoning_effort,this.supportsReasoningEffort(a)||void 0===e.reasoning_effort||delete e.reasoning_effort,e}supportsResponsesEndpoint(a){let b=(a||"").toLowerCase();return!(b.includes("gemini")||b.includes("claude"))}async execute(a){let{model:b,log:c}=a;if(this.isClaudeModel(b))return c?.debug("GITHUB",`Using /v1/messages route for ${b}`),this.executeWithMessagesEndpoint(a);if(this.knownCodexModels.has(b)&&this.supportsResponsesEndpoint(b))return c?.debug("GITHUB",`Using cached /responses route for ${b}`),this.executeWithResponsesEndpoint(a);let d={...a,body:this.sanitizeMessagesForChatCompletions(a.body)},e=await super.execute({...d,proxyOptions:a.proxyOptions||null});if(e.response.status===g.gx.BAD_REQUEST&&this.supportsResponsesEndpoint(b)){let d=await e.response.clone().text();if(d.includes("not accessible via the /chat/completions endpoint")||d.includes("The requested model is not supported"))return c?.warn("GITHUB",`Model ${b} requires /responses. Switching...`),this.knownCodexModels.add(b),this.executeWithResponsesEndpoint(a)}return e}async executeWithResponsesEndpoint({model:a,body:b,stream:c,credentials:d,signal:e,log:f,proxyOptions:g=null}){let k=this.config.responsesUrl,n=this.buildHeaders(d,!0),o=(0,h.openaiToOpenAIResponsesRequest)(a,b,!0,d);f?.debug("GITHUB","Sending translated request to /responses");let p=await (0,m.proxyAwareFetch)(k,{method:"POST",headers:n,body:JSON.stringify(o),signal:e},g);if(!p.ok)return{response:p,url:k,headers:n,transformedBody:o};let q=(0,j.Ws)("openai-responses");q.model=a;let r=new TextDecoder,s="",t=new TransformStream({async transform(a,b){let c=(s+=r.decode(a,{stream:!0})).split("\n");for(let a of(s=c.pop()||"",c)){let c=a.trim();if(!c)continue;let d=(0,l.tV)(c);if(!d)continue;if(d.done&&1){b.enqueue(new TextEncoder().encode("data: [DONE]\n\n"));continue}let e=(0,i.openaiResponsesToOpenAIResponse)(d,q);if(e){let a=(0,l.v8)(e,"openai");b.enqueue(new TextEncoder().encode(a))}}},flush(a){if(s.trim()){let b=(0,l.tV)(s.trim());if(b&&!b.done){let c=(0,i.openaiResponsesToOpenAIResponse)(b,q);c&&a.enqueue(new TextEncoder().encode((0,l.v8)(c,"openai")))}}}});return p.body?{response:new Response(p.body.pipeThrough(t),{status:p.status,statusText:p.statusText,headers:p.headers}),url:k,headers:n,transformedBody:o}:{response:new Response("",{status:p.status,headers:p.headers}),url:k,headers:n,transformedBody:o}}async executeWithMessagesEndpoint({model:a,body:b,stream:c,credentials:d,signal:e,log:f,proxyOptions:g=null}){let h=this.config.messagesUrl,i=this.buildHeaders(d,!0),n=(0,j.GH)(k.h.OPENAI,k.h.CLAUDE,a,b,!0,d,"github"),o=n?._toolNameMap;n&&delete n._toolNameMap,f?.debug("GITHUB","Sending translated request to /v1/messages");let p=await (0,m.proxyAwareFetch)(h,{method:"POST",headers:i,body:JSON.stringify(n),signal:e},g);if(!p.ok)return{response:p,url:h,headers:i,transformedBody:n};let q=(0,j.Ws)(k.h.CLAUDE);if(q.model=a,o&&(q.toolNameMap=o),!p.body)return{response:new Response("",{status:p.status,headers:p.headers}),url:h,headers:i,transformedBody:n};let r=new TextDecoder,s=new TextEncoder,t="",u=(a,b)=>{for(let c of(0,j.Y8)(k.h.CLAUDE,k.h.OPENAI,b,q)||[])a.enqueue(s.encode((0,l.v8)(c,k.h.OPENAI)))},v=new TransformStream({transform(a,b){let d=(t+=r.decode(a,{stream:!0})).split("\n");for(let a of(t=d.pop()||"",d)){let d=(0,l.tV)(a.trim());if(d){if(d.done){!0===c&&b.enqueue(s.encode("data: [DONE]\n\n"));continue}u(b,d)}}},flush(a){if(!(t+=r.decode()).trim())return;let b=(0,l.tV)(t.trim());b&&!b.done&&u(a,b)}});return{response:new Response(p.body.pipeThrough(v),{status:p.status,statusText:p.statusText,headers:p.headers}),url:h,headers:i,transformedBody:n}}async refreshCopilotToken(a,b,c=null){try{let d=await (0,m.proxyAwareFetch)("https://api.github.com/copilot_internal/v2/token",{headers:{Authorization:`token ${a}`,"User-Agent":f.x0.USER_AGENT,"Editor-Version":`vscode/${f.x0.VSCODE_VERSION}`,"Editor-Plugin-Version":`copilot-chat/${f.x0.COPILOT_CHAT_VERSION}`,Accept:"application/json","x-github-api-version":f.x0.API_VERSION}},c);if(!d.ok){let a=await d.text();return b?.error?.("TOKEN",`Copilot token refresh failed: ${d.status} ${a}`),null}let e=await d.json();return b?.info?.("TOKEN","Copilot token refreshed"),{token:e.token,expiresAt:e.expires_at}}catch(a){return b?.error?.("TOKEN",`Copilot refresh error: ${a.message}`),null}}async refreshGitHubToken(a,b,c=null){try{let d={grant_type:"refresh_token",refresh_token:a,client_id:this.config.clientId};this.config.clientSecret&&(d.client_secret=this.config.clientSecret);let e=await (0,m.proxyAwareFetch)(f.NA.github.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams(d)},c);if(!e.ok)return await (0,p.aI)(e),null;let g=await e.json();return b?.info?.("TOKEN","GitHub token refreshed"),{accessToken:g.access_token,refreshToken:g.refresh_token||a,expiresIn:g.expires_in}}catch(a){return b?.error?.("TOKEN",`GitHub refresh error: ${a.message}`),null}}async refreshCredentials(a,b,c=null){let d=await this.refreshCopilotToken(a.accessToken,b,c);if(!d&&a.refreshToken){let e=await this.refreshGitHubToken(a.refreshToken,b,c);if(e?.accessToken)return(d=await this.refreshCopilotToken(e.accessToken,b,c))?{...e,copilotToken:d.token,copilotTokenExpiresAt:d.expiresAt}:e}return d?{accessToken:a.accessToken,refreshToken:a.refreshToken,copilotToken:d.token,copilotTokenExpiresAt:d.expiresAt}:null}needsRefresh(a){if(!a.copilotToken)return!0;if(a.copilotTokenExpiresAt){let b=a.copilotTokenExpiresAt;if("number"==typeof b&&b<1e12?b*=1e3:"string"==typeof b&&(b=new Date(b).getTime()),b-Date.now()<3e5)return!0}return super.needsRefresh(a)}}},3433:(a,b,c)=>{"use strict";c(40106);let d=c(7344),e=(c(35689),c(61330),c(34441),c(37417)),f=(c(74399),c(48841)),g=(c(64156),c(43086),c(95095),c(53552),c(61448)),h=c(84285),{InvalidArgumentError:i}=g,j=c(99528),{MockCallHistory:k,MockCallHistoryLog:l}=(c(55285),c(66498),c(43904)),{getGlobalDispatcher:m,setGlobalDispatcher:n}=(c(65630),c(86625),c(89512),c(28998),c(31825),c(59970));function o(a){return(b,c,d)=>{if("function"==typeof c&&(d=c,c=null),!b||"string"!=typeof b&&"object"!=typeof b&&!(b instanceof URL))throw new i("invalid url");if(null!=c&&"object"!=typeof c)throw new i("invalid opts");if(c&&null!=c.path){if("string"!=typeof c.path)throw new i("invalid opts.path");let a=c.path;c.path.startsWith("/")||(a=`/${a}`),b=new URL(h.parseOrigin(b).origin+a)}else c||(c="object"==typeof b?b:{}),b=h.parseURL(b);let{agent:e,dispatcher:f=m(),...g}=c;if(e)throw new i("unsupported opts.agent. Did you mean opts.client?");return a.call(f,{...g,origin:b.origin,path:b.search?`${b.pathname}${b.search}`:b.pathname,method:c.method||(c.body?"PUT":"GET")},d)}}c(83204),c(67519),Object.assign(d.prototype,j),a.exports.g6=e,a.exports.ProxyAgent=f,c(70707),c(47335),c(78075),c(87085),c(27060),c(19431),c(37858),c(90249),c(38650),c(20579),h.parseHeaders,h.headerNameToString;let p=c(76403).fetch,q=__filename;a.exports.hd=function(b,c){return p(b,c).catch(b=>{throw q?!function a(b,c){if(!b||"object"!=typeof b)return;let d="string"==typeof b.stack?b.stack:"",e=c.replace(/\\/g,"/");if(d&&(d.includes(c)||d.includes(e)))return;let f={};if(Error.captureStackTrace(f,a),!f.stack)return;let g=f.stack.split("\n").slice(1).join("\n");b.stack=d?`${d}
118
125
  ${g}`:f.stack}(b,q):b&&"object"==typeof b&&Error.captureStackTrace(b,a.exports.hd),b})},a.exports.Headers=c(28665).Headers,a.exports.Response=c(78196).Response,a.exports.Request=c(12600).Request,a.exports.FormData=c(2887).FormData;let{setGlobalOrigin:r,getGlobalOrigin:s}=c(79412),{CacheStorage:t}=c(49166),{kConstruct:u}=c(49176);new t(u);let{deleteCookie:v,getCookies:w,getSetCookies:x,setCookie:y,parseCookie:z}=c(70106),{parseMIMEType:A,serializeAMimeType:B}=c(16537),{CloseEvent:C,ErrorEvent:D,MessageEvent:E}=c(51753),{WebSocket:F,ping:G}=c(52039);a.exports.kb=F,a.exports.rd=C,a.exports.NN=D,a.exports.aM=E,c(42430).WebSocketStream,c(87404).WebSocketError,o(j.request),o(j.stream),o(j.pipeline),o(j.connect),o(j.upgrade);let{EventSource:H}=c(47703);a.exports.GD=H},4654:(a,b,c)=>{"use strict";let{uid:d,states:e,sentCloseFrameState:f,emptyBuffer:g,opcodes:h}=c(62026),{parseExtensions:i,isClosed:j,isClosing:k,isEstablished:l,isConnecting:m,validateCloseCodeAndReason:n}=c(94050),{makeRequest:o}=c(12600),{fetching:p}=c(76403),{Headers:q,getHeadersList:r}=c(28665),{getDecodeSplit:s}=c(42425),{WebsocketFrameSend:t}=c(45221),u=c(34589),{runtimeFeatures:v}=c(56758),w=v.has("crypto")?c(77598):null,x=!1;function y(a,b,c,d=!1){if(b??=null,c??="",d&&n(b,c),j(a.readyState)||k(a.readyState));else if(l(a.readyState))if(a.closeState.has(f.SENT)||a.closeState.has(f.RECEIVED))a.readyState=e.CLOSING;else{let d=new t;0!==c.length&&null===b&&(b=1e3),u(null===b||Number.isInteger(b)),null===b&&0===c.length?d.frameData=g:null!==b&&null===c?(d.frameData=Buffer.allocUnsafe(2),d.frameData.writeUInt16BE(b,0)):null!==b&&null!==c?(d.frameData=Buffer.allocUnsafe(2+Buffer.byteLength(c)),d.frameData.writeUInt16BE(b,0),d.frameData.write(c,2,"utf-8")):d.frameData=g,a.socket.write(d.createFrame(h.CLOSE)),a.closeState.add(f.SENT),a.readyState=e.CLOSING}else z(a),a.readyState=e.CLOSING}function z(a,b,c,d){l(a.readyState)&&y(a,b,c,!1),a.controller.abort(),m(a.readyState)?a.onSocketClose():a.socket?.destroyed===!1&&a.socket.destroy()}a.exports={establishWebSocketConnection:function(a,b,c,e,f){a.protocol="ws:"===a.protocol?"http:":"https:";let g=o({urlList:[a],client:c,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error",useURLCredentials:!0});f.headers&&(g.headersList=r(new q(f.headers)));let h=w.randomBytes(16).toString("base64");for(let a of(g.headersList.append("sec-websocket-key",h,!0),g.headersList.append("sec-websocket-version","13",!0),b))g.headersList.append("sec-websocket-protocol",a,!0);return g.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits",!0),p({request:g,useParallelQueue:!0,dispatcher:f.dispatcher,processResponse(a){let c;if("error"===a.type||101!==a.status){if(a.socket?.session==null)return void z(e,1002,"Received network error or non-101 status code.",a.error);if(200!==a.status)return void z(e,1002,"Received network error or non-200 status code.",a.error)}if(!1===x&&a.socket?.session!=null&&(process.emitWarning("WebSocket over HTTP2 is experimental, and subject to change.","ExperimentalWarning"),x=!0),0!==b.length&&!a.headersList.get("Sec-WebSocket-Protocol"))return void z(e,1002,"Server did not respond with sent protocols.");if(null==a.socket.session&&a.headersList.get("Upgrade")?.toLowerCase()!=="websocket")return void z(e,1002,'Server did not set Upgrade header to "websocket".');if(null==a.socket.session&&a.headersList.get("Connection")?.toLowerCase()!=="upgrade")return void z(e,1002,'Server did not set Connection header to "upgrade".');if(a.headersList.get("Sec-WebSocket-Accept")!==w.hash("sha1",h+d,"base64"))return void z(e,1002,"Incorrect hash received in Sec-WebSocket-Accept header.");let f=a.headersList.get("Sec-WebSocket-Extensions");if(null!==f&&!(c=i(f)).has("permessage-deflate"))return void z(e,1002,"Sec-WebSocket-Extensions header does not match.");let j=a.headersList.get("Sec-WebSocket-Protocol");null===j||s("sec-websocket-protocol",g.headersList).includes(j)?(a.socket.on("data",e.onSocketData),a.socket.on("close",e.onSocketClose),a.socket.on("error",e.onSocketError),e.wasEverConnected=!0,e.onConnectionEstablished(a,c)):z(e,1002,"Protocol was not set in the opening handshake.")}})},failWebsocketConnection:z,closeWebSocketConnection:y}},4818:(a,b,c)=>{"use strict";c(42541);let d="Code blocks, file paths, commands, errors, URLs: keep exact. Security warnings, irreversible action confirmations, multi-step ordered sequences: write normal. Resume terse style after.",e='Not: "Sure! I\'d be happy to help you with that. The issue you\'re experiencing is likely caused by..." Yes: "Bug in auth middleware. Token expiry check use `<` not `<=`. Fix:"',f="Auto-Clarity: drop caveman for security warnings, irreversible actions, multi-step sequences where fragment ambiguity risks misread, or when user repeats a question. Resume after the clear part.",g="ACTIVE EVERY RESPONSE. No revert after many turns. No filler drift. Still active if unsure.";["Respond tersely. Keep grammar and full sentences but drop filler, hedging and pleasantries (just/really/basically/sure/of course/I'd be happy to). Pattern: state the thing, the action, the reason. Then next step.",e,d,f,g].join(" "),["Respond like terse caveman. All technical substance stay exact, only fluff die. Drop: articles (a/an/the), filler (just/really/basically/actually/simply), pleasantries, hedging. Fragments OK. Short synonyms (big not extensive, fix not implement a solution for). Pattern: [thing] [action] [reason]. [next step].",e,d,f,g].join(" "),["Respond ultra-terse. Maximum compression. Telegraphic. Abbreviate (DB/auth/config/req/res/fn/impl), strip conjunctions, use arrows for causality (X → Y). One word when one word enough. Pattern: [thing] → [result]. [fix].",e,d,f,g].join(" "),["Respond semi-classical. Drop filler/hedging but keep grammar structure, classical register. Use classical Chinese sentence patterns where natural. Keep English for technical terms.",e,d,f,g].join(" "),["Respond classical Chinese (文言文). Maximum classical terseness. 80-90% character reduction. Classical sentence patterns, verbs precede objects, subjects often omitted, classical particles (之/乃/為/其). Keep English for code, commands, function names, API names, error strings.",e,d,f,g].join(" "),["Respond extreme classical compression (文言文 ultra). Maximum compression, ultra terse. Same classical rules as wenyan-full but even more compressed. One classical particle per clause.",e,d,f,g].join(" ")},5210:(a,b,c)=>{"use strict";c.a(a,async(a,b)=>{try{c(46956),c(30395),c(48991),c(8735),c(32210),c(42541),c(56294),c(19458),c(27432),c(97688),c(87164),c(79154);var d=c(59039);c(11484);var e=c(65333);c(1758),c(43212);var f=a([d,e]);[d,e]=f.then?(await f)():f,b()}catch(a){b(a)}})},5275:(a,b,c)=>{"use strict";c(42541),c(56294),c(90943),c(23242),c(84238),c(1758),c(8735),c(55599),c(72610),c(51525),c(42946)},5318:(a,b,c)=>{"use strict";let d=c(7344),{ClientDestroyedError:e,ClientClosedError:f,InvalidArgumentError:g}=c(61448),{kDestroy:h,kClose:i,kClosed:j,kDestroyed:k,kDispatch:l}=c(49176),m=Symbol("onDestroyed"),n=Symbol("onClosed"),o=Symbol("webSocketOptions");class p extends d{[k]=!1;[m]=null;[j]=!1;[n]=null;constructor(a){super(),this[o]=a?.webSocket??{}}get webSocketOptions(){return{maxFragments:this[o].maxFragments??131072,maxPayloadSize:this[o].maxPayloadSize??0x8000000}}get destroyed(){return this[k]}get closed(){return this[j]}close(a){if(void 0===a)return new Promise((a,b)=>{this.close((c,d)=>c?b(c):a(d))});if("function"!=typeof a)throw new g("invalid callback");if(this[k]){let b=new e;queueMicrotask(()=>a(b,null));return}if(this[j])return void(this[n]?this[n].push(a):queueMicrotask(()=>a(null,null)));this[j]=!0,this[n]??=[],this[n].push(a);let b=()=>{let a=this[n];this[n]=null;for(let b=0;b<a.length;b++)a[b](null,null)};this[i]().then(()=>this.destroy()).then(()=>queueMicrotask(b))}destroy(a,b){if("function"==typeof a&&(b=a,a=null),void 0===b)return new Promise((b,c)=>{this.destroy(a,(a,d)=>a?c(a):b(d))});if("function"!=typeof b)throw new g("invalid callback");if(this[k])return void(this[m]?this[m].push(b):queueMicrotask(()=>b(null,null)));a||(a=new e),this[k]=!0,this[m]??=[],this[m].push(b);let c=()=>{let a=this[m];this[m]=null;for(let b=0;b<a.length;b++)a[b](null,null)};this[h](a).then(()=>queueMicrotask(c))}dispatch(a,b){if(!b||"object"!=typeof b)throw new g("handler must be an object");try{if(!a||"object"!=typeof a)throw new g("opts must be an object.");if(a.dispatcher)throw new g("opts.dispatcher is not supported by instance methods. Pass opts.dispatcher to the top-level undici functions or call the dispatcher instance method directly.");if(this[k]||this[m])throw new e;if(this[j])throw new f;return this[l](a,b)}catch(a){if("function"!=typeof b.onResponseError)throw a;return b.onResponseError(null,a),!1}}}a.exports=p},5831:(a,b,c)=>{"use strict";let{collectASequenceOfCodePointsFast:d}=c(70745),{maxNameValuePairSize:e,maxAttributeValueSize:f}=c(29653),{isCTLExcludingHtab:g}=c(84698),h=c(34589);function i(a,b={}){if(0===a.length)return b;h(";"===a[0]);let c="";(a=a.slice(1)).includes(";")?(c=d(";",a,{position:0}),a=a.slice(c.length)):(c=a,a="");let e="",g="";if(c.includes("=")){let a={position:0};e=d("=",c,a),g=c.slice(a.position+1)}else e=c;if(e=e.trim(),(g=g.trim()).length>f)return i(a,b);let j=e.toLowerCase();if("expires"===j){let a=new Date(g);Number.isNaN(a.getTime())||(b.expires=a)}else if("max-age"===j){let c=g.charCodeAt(0);if((c<48||c>57)&&"-"!==g[0]||!/^\d+$/.test(g))return i(a,b);b.maxAge=Number(g)}else if("domain"===j){let a=g;"."===a[0]&&(a=a.slice(1)),b.domain=a=a.toLowerCase()}else if("path"===j)b.path=0===g.length||"/"!==g[0]?"/":g;else if("secure"===j)b.secure=!0;else if("httponly"===j)b.httpOnly=!0;else if("samesite"===j){let a=g.toLowerCase();"none"===a?b.sameSite="None":"strict"===a?b.sameSite="Strict":"lax"===a&&(b.sameSite="Lax")}else b.unparsed??=[],b.unparsed.push(`${e}=${g}`);return i(a,b)}a.exports={parseSetCookie:function(a){if(g(a))return null;let b="",c="",f="",h="";if(a.includes(";")){let e={position:0};b=d(";",a,e),c=a.slice(e.position)}else b=a;if(b.includes("=")){let a={position:0};f=d("=",b,a),h=b.slice(a.position+1)}else h=b;return(f=f.trim(),h=h.trim(),f.length+h.length>e)?null:{name:f,value:h,...i(c)}},parseUnparsedAttributes:i}},6699:(a,b,c)=>{},7044:(a,b,c)=>{"use strict";c.r(b),c.d(b,{createProviderNode:()=>l,deleteProviderNode:()=>n,getProviderNodeById:()=>k,getProviderNodes:()=>j,updateProviderNode:()=>m});var d=c(27137),e=c(24081),f=c(50743),g=c(37703);function h(a){return a?{...(0,f.q)(a.data,{}),id:a.id,type:a.type,name:a.name,createdAt:a.createdAt,updatedAt:a.updatedAt}:null}function i(a,b){let c=function(a){let{id:b,type:c,name:d,createdAt:e,updatedAt:g,...h}=a;return{id:b,type:c??null,name:d??null,data:(0,f.s)(h),createdAt:e,updatedAt:g}}(b);a.run(`INSERT INTO providerNodes(id, type, name, data, createdAt, updatedAt)
119
126
  VALUES(?, ?, ?, ?, ?, ?)
120
127
  ON CONFLICT(id) DO UPDATE SET
@@ -206,12 +213,7 @@ Respond ONLY with the JSON object, no other text.`)}else"json_object"===a.type&&
206
213
  ORDER BY cachedAt ASC
207
214
  LIMIT ?
208
215
  )
209
- `)}close(){this.#n.close()}get(a){f(a);let b=this.#v(a);return b?{body:b.body?Buffer.from(b.body.buffer,b.body.byteOffset,b.body.byteLength):void 0,statusCode:b.statusCode,statusMessage:b.statusMessage,headers:b.headers?JSON.parse(b.headers):void 0,etag:b.etag?b.etag:void 0,vary:b.vary?JSON.parse(b.vary):void 0,cacheControlDirectives:b.cacheControlDirectives?JSON.parse(b.cacheControlDirectives):void 0,cachedAt:b.cachedAt,staleAt:b.staleAt,deleteAt:b.deleteAt}:void 0}set(a,b){f(a);let c=this.#w(a),d=Array.isArray(b.body)?Buffer.concat(b.body):b.body,e=d?.byteLength;if(e&&e>this.#l)return;let g=this.#v(a,!0);g?this.#p.run(d,b.deleteAt,b.statusCode,b.statusMessage,b.headers?JSON.stringify(b.headers):null,b.etag?b.etag:null,b.cacheControlDirectives?JSON.stringify(b.cacheControlDirectives):null,b.vary?JSON.stringify(b.vary):null,b.cachedAt,b.staleAt,g.id):(this.#q.run(c,a.method,d,b.deleteAt,b.statusCode,b.statusMessage,b.headers?JSON.stringify(b.headers):null,b.etag?b.etag:null,b.cacheControlDirectives?JSON.stringify(b.cacheControlDirectives):null,b.vary?JSON.stringify(b.vary):null,b.cachedAt,b.staleAt),this.#x())}createWriteStream(a,b){f(a),g(b);let c=0,d=[],h=this;return new e({decodeStrings:!0,write(a,b,e){(c+=a.byteLength)<=h.#l?d.push(a):this.destroy(),e()},final(c){h.set(a,{...b,body:d}),c()}})}delete(a){if("object"!=typeof a)throw TypeError(`expected key to be object, got ${typeof a}`);this.#s.run(this.#w(a))}#x(){if(Number.isFinite(this.#m)&&this.size<=this.#m)return 0;{let a=this.#r.run(Date.now()).changes;if(a)return a}{let a=this.#u?.run(Math.max(Math.floor(.1*this.#m),1)).changes;if(a)return a}return 0}get size(){let{total:a}=this.#t.get();return a}#w(a){return`${a.origin}/${a.path}`}#v(a,b=!1){let c=this.#w(a),{headers:d,method:e}=a,f=this.#o.all(c,e);if(0===f.length)return;let g=Date.now();for(let a of f){if(g>=a.deleteAt&&!b)continue;let c=!0;if(a.vary){let b=JSON.parse(a.vary);for(let a in b)if(!function(a,b){if(null==a&&null==b)return!0;if(null==a&&null!=b||null!=a&&null==b)return!1;if(Array.isArray(a)&&Array.isArray(b)){if(a.length!==b.length)return!1;for(let c=0;c<a.length;c++)if(a[c]!==b[c])return!1;return!0}return a===b}(d[a],b[a])){c=!1;break}}if(c)return a}}}},20585:(a,b,c)=>{"use strict";c.r(b),c.d(b,{buildKiroPayload:()=>o});var d=c(56294),e=c(42541),f=c(27137),g=c(54838),h=c(94414),i=c(77855);let j=/[^a-zA-Z0-9_-]/g;function k(a,b,c=4096){var d;return d="string"==typeof a&&a.trim()?a:`Tool: ${b}`,"string"!=typeof d||d.length<=c?d:`${d.slice(0,c)}
210
-
211
- [truncated for Kiro payload limit]`}function l(a,b){return a.map(a=>({...a,toolSpecification:{...a.toolSpecification,description:k(a.toolSpecification?.description||"",a.toolSpecification?.name,b)}}))}function m(a,b){let c;try{c="string"==typeof b?b:JSON.stringify(b??{})}catch{c="{}"}return`[Tool call: ${a||"unknown"}(${c})]`}function n(a){let b=Array.isArray(a)?a.map(a=>"string"==typeof a?a:a.text||"").join("\n"):"string"==typeof a?a:"";return`[Tool result: ${b}]`}function o(a,b,c,d){let e,o,p,q=b.messages||[],r=b.tools||[],s=b.max_tokens??b.max_output_tokens??32e3,t=b.temperature,u=b.top_p,{upstream:v,agentic:w}=(0,g.$D)(a),x=(0,g.gI)(b,null,a),y=(0,g.ZF)(b),{forward:z,reverse:A}=(e=new Set,o=new Map,p=new Map,(Array.isArray(r)?r:[]).forEach((a,b)=>{let c=a?.function?.name||a?.name;if("string"!=typeof c||!c.trim()||o.has(c))return;let d=function(a,b,c){let d=(String(a||"").trim().replace(j,"_").replace(/_+/g,"_").replace(/^_+|_+$/g,"")||`tool_${b+1}`).slice(0,64),e=d,f=2;for(;c.has(e);){let a=`_${f++}`;e=`${d.slice(0,64-a.length)}${a}`}return c.add(e),e}(c,b,e);o.set(c,d),d!==c&&p.set(d,c)}),{forward:o,reverse:p}),{history:B,currentMessage:C}=function(a,b,c,d=null){let e=[],g=null,h=b&&b.length>0;h||(a=function(a){let b=[];for(let c of a){if("tool"===c.role){b.push({role:"user",content:n(c.content)});continue}if("assistant"===c.role){let a=[];if(Array.isArray(c.content))for(let b of c.content)"tool_use"===b.type?a.push(m(b.name,b.input)):("text"===b.type||b.text)&&a.push(b.text||"");else"string"==typeof c.content&&a.push(c.content);for(let b of c.tool_calls||[])a.push(m(b.function?.name,b.function?.arguments));b.push({role:"assistant",content:a.filter(Boolean).join("\n")});continue}if("user"===c.role&&Array.isArray(c.content)){let a=c.content.map(a=>"tool_result"===a.type?{type:"text",text:n(a.content)}:a);b.push({...c,content:a});continue}b.push(c)}return b}(a));let j=[],o=[],p=[],q=[],r=null,s=!1,t=()=>{if("user"===r){let a={userInputMessage:{content:j.join("\n\n").trim()||"continue",modelId:""}};q.length>0&&(a.userInputMessage.images=q),p.length>0&&(a.userInputMessage.userInputMessageContext={toolResults:p}),h&&!s&&(a.userInputMessage.userInputMessageContext||(a.userInputMessage.userInputMessageContext={}),a.userInputMessage.userInputMessageContext.tools=function(a){if(JSON.stringify(a).length<=262144)return a;let b=l(a,1024);return JSON.stringify(b).length<=262144?b:b=l(a,256)}(b.map(a=>(function(a,b=null){let c=a.function?.name||a.name,d=b?.get(c)||c,e=a.function?{...a,function:{...a.function,name:d}}:{...a,name:d},f=(0,i.tH)([e]).specs[0]||null;return f&&(f.toolSpecification.description=k(f.toolSpecification.description,d)),f})(a,d)).filter(Boolean)),s=!0),e.push(a),g=a,j=[],p=[],q=[]}else if("assistant"===r){let a=o.join("\n\n").trim()||"...";e.push({assistantResponseMessage:{content:a}}),o=[]}};for(let b=0;b<a.length;b++){let c=a[b],g=c.role;if(("system"===g||"tool"===g)&&(g="user"),g!==r&&null!==r&&t(),r=g,"user"===g){let a="";if("string"==typeof c.content)a=c.content;else if(Array.isArray(c.content)){let b=[];for(let a of c.content)if("text"===a.type||a.text)b.push(a.text||"");else if("image_url"===a.type){let b=a.image_url?.url||"",c=b.match(/^data:([^;]+);base64,(.+)$/);if(c){let a=c[1],b=a.split("/")[1]||a;q.push({format:b,source:{bytes:c[2]}})}else if(b.startsWith("http://")||b.startsWith("https://")){let a=(()=>{try{return new URL(b).pathname}catch{return""}})(),c=a.match(/\.([a-zA-Z0-9]+)$/)?.[1]?.toLowerCase();q.push({format:"jpg"===c?"jpeg":c||"jpeg",source:{url:b}})}}else if("image"===a.type&&a.source?.type==="base64"&&a.source?.data){let b=a.source.media_type||"image/png",c=b.split("/")[1]||b;q.push({format:c,source:{bytes:a.source.data}})}a=b.join("\n");let d=c.content.filter(a=>"tool_result"===a.type);d.length>0&&d.forEach(a=>{let b=Array.isArray(a.content)?a.content.map(a=>a.text||"").join("\n"):"string"==typeof a.content?a.content:"";p.push({toolUseId:a.tool_use_id,status:"success",content:[{text:b}]})})}if("tool"===c.role){let a="string"==typeof c.content?c.content:"";p.push({toolUseId:c.tool_call_id,status:"success",content:[{text:a}]})}else a&&j.push(a)}else if("assistant"===g){let a="",b=[];if(Array.isArray(c.content)?(a=c.content.filter(a=>"text"===a.type).map(a=>a.text).join("\n").trim(),b=c.content.filter(a=>"tool_use"===a.type)):"string"==typeof c.content&&(a=c.content.trim()),c.tool_calls&&c.tool_calls.length>0&&(b=c.tool_calls),a&&o.push(a),b.length>0){t();let a=e[e.length-1];a?.assistantResponseMessage&&(a.assistantResponseMessage.toolUses=b.map(a=>{if(!a.function)return{toolUseId:a.id||(0,f.A)(),name:d?.get(a.name)||a.name,input:a.input||{}};{let b=a.function.name;return{toolUseId:a.id||(0,f.A)(),name:d?.get(b)||b,input:function(a,b){if("string"!=typeof a)return a??b;try{return JSON.parse(a)}catch{return b}}(a.function.arguments,{})}}})),r=null}}}null!==r&&t();for(let a=e.length-1;a>=0;a--)if(e[a].userInputMessage){g=e.splice(a,1)[0];break}let u=e[0]?.userInputMessage?.userInputMessageContext?.tools;e.forEach(a=>{a.userInputMessage?.userInputMessageContext?.tools&&delete a.userInputMessage.userInputMessageContext.tools,a.userInputMessage?.userInputMessageContext&&0===Object.keys(a.userInputMessage.userInputMessageContext).length&&delete a.userInputMessage.userInputMessageContext,a.userInputMessage&&!a.userInputMessage.modelId&&(a.userInputMessage.modelId=c)});let v=[];for(let a=0;a<e.length;a++){let b=e[a];if(b.userInputMessage&&v.length>0&&v[v.length-1].userInputMessage){let a=v[v.length-1];a.userInputMessage.content+="\n\n"+b.userInputMessage.content;let c=a.userInputMessage.userInputMessageContext,d=b.userInputMessage.userInputMessageContext;b.userInputMessage.images?.length>0&&(a.userInputMessage.images=[...a.userInputMessage.images||[],...b.userInputMessage.images]),d&&(c?(d.toolResults?.length>0&&(c.toolResults=[...c.toolResults||[],...d.toolResults]),d.tools?.length>0&&(c.tools=[...c.tools||[],...d.tools])):a.userInputMessage.userInputMessageContext=d)}else v.push(b)}return g||(g={userInputMessage:{content:"",modelId:c}}),h&&function(a,b){let c=new Set;for(let b of a){let a=b.assistantResponseMessage;if(a)for(let b of a.toolUses||[])b.toolUseId&&c.add(b.toolUseId)}for(let d of b?[...a,b]:a){let a=d.userInputMessage,b=a?.userInputMessageContext;if(!b?.toolResults?.length)continue;let e=[],f=[];for(let a of b.toolResults)c.has(a.toolUseId)?e.push(a):f.push(n(a.content));if(0===f.length)continue;let g=f.join("\n");a.content=a.content?`${a.content}
212
-
213
- ${g}`:g,b.toolResults=e,0!==e.length||b.tools?.length||delete a.userInputMessageContext}}(v,g),u?.length>0&&!g.userInputMessage.userInputMessageContext?.tools&&(g.userInputMessage.userInputMessageContext||(g.userInputMessage.userInputMessageContext={}),g.userInputMessage.userInputMessageContext.tools=u),{history:v,currentMessage:g}}(q,r,v,z),D=d?.providerSpecificData?.profileArn||"",E=[];x&&E.push((0,g.aZ)()),w&&E.push(g.rG);let F=E.join("\n\n"),G=`[Context: Current time is ${new Date().toISOString()}]`,H=d?.connectionId||d?.providerSpecificData?.connectionId||"",I=B.find(a=>a?.userInputMessage)?.userInputMessage?.content??C?.userInputMessage?.content??"",J=(0,h.jS)(H,I),K=r.map(a=>a?.function?.name||a?.name).filter(Boolean).sort().join(","),L=(0,h.L4)({conversationId:J,connectionId:H,modelId:v,systemPrompt:`${F}
214
- [tools:${K}]`,contentPrefix:F,currentContentPrefix:G,history:B,currentMessage:C}),M=L.currentMessage?.userInputMessage?.userInputMessageContext?.tools||[],N=(0,i.rR)({history:L.history,currentMessage:L.currentMessage,modelId:v,toolSpecs:M,nameMap:z});if(!N.valid)return console.error(`[Kiro] refusing invalid conversation (openai -> kiro): ${N.errors.join(", ")||"unknown"}`),null;let O=N.history,P=N.currentMessage,Q={conversationState:{chatTriggerType:"MANUAL",conversationId:J,currentMessage:{userInputMessage:{content:P?.userInputMessage?.content||"",modelId:v,origin:"AI_EDITOR",...P?.userInputMessage?.images?.length>0&&{images:P.userInputMessage.images},...P?.userInputMessage?.userInputMessageContext&&{userInputMessageContext:P.userInputMessage.userInputMessageContext}}},history:O}};return D&&(Q.profileArn=D),(s||void 0!==t||void 0!==u)&&(Q.inferenceConfig={},s&&(Q.inferenceConfig.maxTokens=s),void 0!==t&&(Q.inferenceConfig.temperature=t),void 0!==u&&(Q.inferenceConfig.topP=u)),Object.defineProperty(Q,"_kiroUpstreamModel",{value:v,enumerable:!1}),Object.defineProperty(Q,"_kiroThinkingEnabled",{value:x,enumerable:!1}),Object.defineProperty(Q,"_kiroExposeReasoning",{value:y,enumerable:!1}),A.size>0&&Object.defineProperty(Q,"_toolNameMap",{value:A,enumerable:!1,configurable:!0}),Q}(0,d.kz)(e.h.OPENAI,e.h.KIRO,o,null)},21263:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{J4:()=>l});var e=c(70321),f=c(97474),g=c(46455),h=a([g]);g=(h.then?(await h)():h)[0];let m=globalThis._quotaProgressState??={accounts:{},generation:0,runningPromise:null,run:null,subscribers:new Set};function i(a,b=new WeakMap){if(null===a||"object"!=typeof a)return a;if(b.has(a))return b.get(a);let c=Array.isArray(a)?[]:{};for(let[d,e]of(b.set(a,c),Object.entries(a)))c[d]=i(e,b);return Object.freeze(c)}function j(a){let b=i(a);for(let a of[...m.subscribers])try{a(b)}catch{}return b}async function k(a,b){let c=b.getRefreshProfile(a[0]?.provider)||{},d=b.concurrency??c.maxConcurrent,e=Math.min(Math.max(1,Number(d)||1),a.length),f=Math.max(0,Number(c.minDelayMs)||0),g=0,h=0,k=Promise.resolve();async function l(){let a,b=k;k=new Promise(b=>{a=b}),await b;let c=Math.max(0,h-Date.now());await (c>0?new Promise(a=>setTimeout(a,c)):Promise.resolve()),h=Date.now()+f,a()}let n=Array.from({length:e},async()=>{for(;!b.controller.signal.aborted&&g<a.length;){let c=a[g++];if(await l(),b.controller.signal.aborted)break;b.counts.attempted+=1;try{let a=await b.resolveUsage(c.id,{writeCache:!0,force:b.force}),d=i({connectionId:c.id,provider:c.provider,usage:a||{},provenance:{cached:a?.stale===!0,stale:a?.stale===!0,fetchedAt:a?.fetchedAt||new Date().toISOString()}});m.accounts={...m.accounts,[c.id]:d},d.provenance.stale?b.counts.stale+=1:b.counts.refreshed+=1,j({type:"update",generation:b.generation,...d})}catch(a){b.counts.failed+=1,j({type:"error",generation:b.generation,connectionId:c.id,provider:c.provider,error:function(a){let b=String(a?.code||"QUOTA_REFRESH_FAILED").replace(/[^a-zA-Z0-9_.:-]/g,"_").slice(0,80)||"QUOTA_REFRESH_FAILED";return Object.freeze({code:b,message:"Quota refresh failed"})}(a),previous:m.accounts[c.id]||null})}}});await Promise.all(n)}function l(a={}){if(m.runningPromise)return!1!==a.retainWithoutSubscribers&&m.run&&(m.run.retainWithoutSubscribers=!0),m.runningPromise;let b=new AbortController;m.run={controller:b,retainWithoutSubscribers:!1!==a.retainWithoutSubscribers};let c=(async()=>{m.generation+=1;let c=m.generation,d=a.getConnections||e.getProviderConnections,h=a.getSnapshots||e.tV,l=a.resolveUsage||g.dg,n=a.getRefreshProfile||f.JJ,o=(a.connections||await d()).filter(g.NS),p=o.filter(a=>a.isActive??!0),q=new Set(o.map(({id:a})=>a)),r=await h(),s=Object.fromEntries(r.filter(({connectionId:a})=>q.has(a)).map(a=>[a.connectionId,i({connectionId:a.connectionId,provider:a.provider,usage:a.usage||{},provenance:{cached:!0,stale:a.usage?.stale===!0,fetchedAt:a.fetchedAt||null}})]));m.accounts=!1===a.replaceAccounts?{...m.accounts,...s}:s,j(i({type:"snapshot",generation:m.generation,accounts:m.accounts,provenance:{source:"quota-cache"}}));let t={attempted:0,refreshed:0,stale:0,failed:0},u=new Map;for(let a of p){let b=u.get(a.provider)||[];b.push(a),u.set(a.provider,b)}return await Promise.all([...u.values()].map(d=>k(d,{concurrency:a.concurrency,controller:b,counts:t,force:!0===a.force,generation:c,getRefreshProfile:n,resolveUsage:l}))),j({type:"complete",generation:c,...t,...b.signal.aborted?{cancelled:!0}:{}})})().finally(()=>{m.runningPromise===c&&(m.runningPromise=null,m.run=null)});return m.runningPromise=c,c}d()}catch(a){d(a)}})},21616:(a,b,c)=>{"use strict";c.d(b,{JA:()=>m});var d=c(55511),e=c.n(d),f=c(77598);let g=function(a){return Array.isArray(a)?a=Buffer.from(a):"string"==typeof a&&(a=Buffer.from(a,"utf8")),(0,f.createHash)("sha1").update(a).digest()},h=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i,i=function(a){let b;if(!("string"==typeof a&&h.test(a)))throw TypeError("Invalid UUID");return Uint8Array.of((b=parseInt(a.slice(0,8),16))>>>24,b>>>16&255,b>>>8&255,255&b,(b=parseInt(a.slice(9,13),16))>>>8,255&b,(b=parseInt(a.slice(14,18),16))>>>8,255&b,(b=parseInt(a.slice(19,23),16))>>>8,255&b,(b=parseInt(a.slice(24,36),16))/0x10000000000&255,b/0x100000000&255,b>>>24&255,b>>>16&255,b>>>8&255,255&b)};var j=c(82009);function k(a,b,c,d){var e=b,f=d;let h="string"==typeof a?function(a){let b=new Uint8Array((a=unescape(encodeURIComponent(a))).length);for(let c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b}(a):a,k="string"==typeof e?i(e):e;if("string"==typeof e&&(e=i(e)),e?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let l=new Uint8Array(16+h.length);if(l.set(k),l.set(h,k.length),(l=g(l))[6]=15&l[6]|80,l[8]=63&l[8]|128,c){if((f??=0)<0||f+16>c.length)throw RangeError(`UUID byte range ${f}:${f+15} is out of buffer bounds`);for(let a=0;a<16;++a)c[f+a]=l[a];return c}return(0,j.k)(l)}function l(a,b=""){return e().createHash("sha256").update(a+b).digest("hex")}function m(a,b=null,c=!0){let d=a.includes("::")?a.split("::")[1]:a,f=b||l(d,"machineId"),g=k(d,k.DNS),h=l(d),i=function(a){let b=Math.floor(Date.now()/1e6),c=new Uint8Array([b>>40&255,b>>32&255,b>>24&255,b>>16&255,b>>8&255,255&b]),d=165;for(let a=0;a<c.length;a++)c[a]=(c[a]^d)+a%256&255,d=c[a];let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",f="";for(let a=0;a<c.length;a+=3){let b=c[a],d=a+1<c.length?c[a+1]:0,g=a+2<c.length?c[a+2]:0;f+=e[b>>2],f+=e[(3&b)<<4|d>>4],a+1<c.length&&(f+=e[(15&d)<<2|g>>6]),a+2<c.length&&(f+=e[63&g])}return`${f}${a}`}(f),j="linux";"u">typeof process&&("win32"===process.platform?j="windows":"darwin"===process.platform&&(j="macos"));let n="x64";return"u">typeof process&&"arm64"===process.arch&&(n="aarch64"),{authorization:`Bearer ${d}`,"connect-accept-encoding":"gzip","connect-protocol-version":"1","content-type":"application/connect+proto","user-agent":"connect-es/1.6.1","x-amzn-trace-id":`Root=${e().randomUUID()}`,"x-client-key":h,"x-cursor-checksum":i,"x-cursor-client-version":"3.12.17","x-cursor-client-type":"ide","x-cursor-client-os":j,"x-cursor-client-arch":n,"x-cursor-client-device-type":"desktop","x-cursor-config-version":e().randomUUID(),"x-cursor-timezone":Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC","x-ghost-mode":c?"true":"false","x-request-id":e().randomUUID(),"x-session-id":g}}k.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",k.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8"},21904:(a,b,c)=>{"use strict";c.d(b,{n:()=>w});var d=c(3433),e=c(71553),f=c.n(e),g=c(77030),h=c.n(g);let i=new Set(["http:","https:"]),j=new Set(["public","trusted-lan","legacy-trusted","loopback-service"]);function k(a){return a?.reason?a.reason:Object.assign(Error("The operation was aborted"),{name:"AbortError"})}async function l(a,b,c){if(b?.aborted)throw k(b);let d=Promise.resolve(c(a,{all:!0}));return b?new Promise((a,c)=>{let e=!1,f=(d,f)=>{e||(e=!0,b.removeEventListener("abort",g),d?c(d):a(f))},g=()=>f(k(b));b.addEventListener("abort",g,{once:!0}),d.then(a=>f(null,a),a=>f(a))}):d}function m(a){return a.split(".").reduce((a,b)=>a<<8n|BigInt(b),0n)}function n(a){return(function(a){let[b="",c=""]=a.toLowerCase().replace(/^\[|\]$/g,"").split("::"),d=b?b.split(":"):[],e=c?c.split(":"):[],f=8-d.length-e.length;return[...d,...Array(Math.max(0,f)).fill("0"),...e].map(a=>Number.parseInt(a||"0",16))})(a).reduce((a,b)=>a<<16n|BigInt(b),0n)}function o(a,b){let[c,d]=b.split("/"),e=h().isIP(a);if(!e||e!==h().isIP(c))return!1;let f=4===e?32:128,g=Number(d);if(!Number.isInteger(g)||g<0||g>f)return!1;let i=BigInt(f-g);return(4===e?m(a):n(a))>>i==(4===e?m(c):n(c))>>i}function p(a){return a.port?Number(a.port):"https:"===a.protocol?443:80}function q(a,{httpsOnly:b=!1,expectedOrigin:c}={}){let d;try{d=new URL(a)}catch{throw Error("URL is not an allowed HTTP endpoint")}if(!i.has(d.protocol)||b&&"https:"!==d.protocol||d.username||d.password||c&&d.origin!==c)throw Error("URL is not an allowed HTTP endpoint");return d}async function r(a,b={}){let c=b.trust||"public";if(!j.has(c))throw Error("Unknown outbound target trust mode");let d=q(a,b),e=await l(d.hostname,b.signal,b.lookup||f().lookup);if(!Array.isArray(e)||0===e.length||e.some(({address:a})=>!h().isIP(a)))throw Error("URL did not resolve to valid addresses");let g=null;if("public"===c&&e.some(({address:a})=>(function(a){let b=String(a||"").toLowerCase().replace(/^::ffff:/,"");if(h().isIPv4(b)){let[a,c,d]=b.split(".").map(Number);return 0===a||10===a||127===a||100===a&&c>=64&&c<=127||169===a&&254===c||172===a&&c>=16&&c<=31||192===a&&(0===c||168===c||88===c&&99===d)||198===a&&(18===c||19===c||51===c&&100===d)||203===a&&0===c&&113===d||a>=224}if(!h().isIPv6(b))return!0;let[c,d="0"]=b.split(":"),e=Number.parseInt(c,16),f=Number.parseInt(d,16);return"::"===b||"::1"===b||e<8192||e>16383||8193===e&&(f<=511||3512===f)||8194===e||16383===e})(a)))throw Error("URL must resolve only to public addresses");if("trusted-lan"===c&&!(g=function(a,b,c){let d=a.hostname.toLowerCase().replace(/^\[|\]$/g,""),e=p(a);for(let a of Array.isArray(c)?c:[]){let c;try{c=function(a){if(!a||"object"!=typeof a)throw Error("Trusted target must be an object");let b="string"==typeof a.id?a.id.trim():"",c="string"==typeof a.host?a.host.trim().toLowerCase().replace(/^\[|\]$/g,""):"",d="string"==typeof a.cidr?a.cidr.trim().toLowerCase():"";if(!b||!c&&!d)throw Error("Trusted target requires id and host or CIDR");if(c&&(c.includes("/")||c.includes("@")||c.includes(":"))&&!h().isIP(c))throw Error("Trusted target host is invalid");if(d&&!o(d.split("/")[0],d))throw Error("Trusted target CIDR is invalid");let e=[...new Set((Array.isArray(a.ports)?a.ports:[]).map(Number).filter(a=>Number.isInteger(a)&&a>=1&&a<=65535))].sort((a,b)=>a-b);if(0===e.length)throw Error("Trusted target requires an allowed port");return Object.freeze({id:b,host:c||null,cidr:d||null,ports:Object.freeze(e)})}(a)}catch{continue}if(c.ports.includes(e)&&(c.host&&c.host===d||c.cidr&&b.every(({address:a})=>o(a,c.cidr))))return c}return null}(d,e,b.trustedTargets)))throw Error("URL must match an explicitly trusted host and port");if("legacy-trusted"===c){let a=q(b.legacyOrigin||"").origin;if(d.origin!==a)throw Error("URL must preserve the saved legacy origin")}if("loopback-service"===c){let a=q(b.expectedOrigin||"").origin;if(d.origin!==a||e.some(({address:a})=>{let b=a.toLowerCase().replace(/^::ffff:/,"");return"::1"!==b&&!b.startsWith("127.")}))throw Error("URL must match the owned loopback service")}return Object.freeze({url:d.href,trust:c,origin:d.origin,pinnedAddresses:Object.freeze(e.map(({address:a})=>a)),pinnedAddressFamilies:Object.freeze(e.map(({family:a,address:b})=>a||h().isIP(b))),allowedPorts:Object.freeze(g?[...g.ports]:[p(d)]),trustedTargetId:g?.id||null})}async function s(a,b={}){if(!a||!Array.isArray(a.pinnedAddresses)||0===a.pinnedAddresses.length||!a.url)throw Error("A resolved outbound target decision is required");let c=new URL(a.url),e=a.pinnedAddresses.map((b,c)=>({address:b,family:a.pinnedAddressFamilies?.[c]||(b.includes(":")?6:4)})),f=0,g=new d.g6({connect:{lookup(a,b,c){let d=e.filter(({family:a})=>!b.family||a===b.family),g=d.length?d:e;if(b.all)return c(null,g);let h=g[f++%g.length];c(null,h.address,h.family)}}});try{let a=await (0,d.hd)(c,{...b,redirect:"error",dispatcher:g}),e=function(a,b,c){if(!a.body?.getReader)return null;let d=a.body.getReader(),e=null,f=!1,g=()=>{f||(f=!0,d.releaseLock())},h=()=>(c?.removeEventListener("abort",i),e||=Promise.resolve(b.close()).catch(()=>{})),i=()=>{h()};c?.aborted?i():c?.addEventListener("abort",i,{once:!0});let j=new Response(new ReadableStream({async pull(a){try{let{done:b,value:c}=await d.read();if(!b)return void a.enqueue(c);g(),await h(),a.close()}catch(b){g(),await h(),a.error(b)}},async cancel(a){try{await d.cancel(a)}finally{g(),await h()}}}),{headers:a.headers,status:a.status,statusText:a.statusText});for(let b of["url","redirected","type"])Object.defineProperty(j,b,{configurable:!0,value:a[b]});return j}(a,g,b.signal);if(e)return e;return await g.close(),a}catch(a){throw await g.close(),a}}async function t(a,b={},c={}){return s(await r(a,{...c,trust:c.trust||"public",signal:b.signal}),b)}async function u(a){try{await a?.body?.cancel?.()}catch{}}async function v(a,b){if(!a.body?.getReader){let c=Buffer.from(await a.arrayBuffer());return c.byteLength<=b?c:null}let c=a.body.getReader(),d=[],e=0;try{for(;;){let{done:a,value:f}=await c.read();if(a)break;if((e+=f.byteLength)>b)return await c.cancel(),null;d.push(Buffer.from(f))}return Buffer.concat(d,e)}finally{c.releaseLock?.()}}async function w(a,b={}){let c,{signal:d,timeoutMs:e=1e4,maxBytes:f=0x1400000}=b;if(!a||!a.startsWith("http://")&&!a.startsWith("https://"))return null;let g=new AbortController,h=()=>g.abort(d?.reason);d?.aborted?h():d?.addEventListener("abort",h,{once:!0});let i=Number.isFinite(e)&&e>0?setTimeout(()=>g.abort(),e):null;try{if(!(c=await t(a,{signal:g.signal})).ok)return await u(c),null;let b=Number(c.headers.get("Content-Length"));if(Number.isFinite(b)&&b>f)return await u(c),null;let d=(c.headers.get("Content-Type")||"image/jpeg").split(";",1)[0].trim().toLowerCase();if(!d.startsWith("image/"))return await u(c),null;let e=await v(c,f);if(!e)return null;let h=e.toString("base64");return{url:`data:${d};base64,${h}`,mimeType:d}}catch{return await u(c),null}finally{i&&clearTimeout(i),d?.removeEventListener("abort",h)}}},22067:(a,b,c)=>{"use strict";c.d(b,{VC:()=>m,Xv:()=>i,a0:()=>n});var d=c(55511),e=c.n(d);let f=-0x340d631b7bdddcdbn;e().randomUUID();try{let a=c(39852);a.machineIdSync||a.default?.machineIdSync}catch{}function g(a){return"string"==typeof a&&a.trim().length>0?a.trim():null}function h(a,b){let c=a?.providerSpecificData;return c&&"object"==typeof c?g(c[b]):null}function i(){return"antigravity"}let j="[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",k=RegExp(`^agent/${j}/\\d{13}/${j}/[1-9]\\d{0,9}$`,"i");function l(a){let b=e().createHash("sha256").update(String(a||"antigravity")).digest().subarray(0,16);b[6]=15&b[6]|80,b[8]=63&b[8]|128;let c=b.toString("hex");return`${c.slice(0,8)}-${c.slice(8,12)}-${c.slice(12,16)}-${c.slice(16,20)}-${c.slice(20)}`}function m({body:a,request:b,credentials:c,model:d,requestType:e}={}){if(k.test(a?.requestId||""))return a.requestId;let f=b?.sessionId||a?.request?.sessionId||c?._clientSessionId||c?.connectionId||c?.email||"anonymous",g=l(`antigravity:conversation:${f}`),h=l(`antigravity:trajectory:${f}:${d||"unknown"}:${e||"agent"}`),i=Math.max(1,2*(Array.isArray(b?.contents)?b.contents.length:1)-1);return`agent/${g}/${Date.now()}/${h}/${i}`}function n(a,b){return function(a){let b=g(a);if(!b)return null;let c=f;for(let a of Buffer.from(b,"utf8"))c=BigInt.asIntN(64,1099511628211n*(c=BigInt.asIntN(64,c^BigInt(a))));return c.toString()}(g(a?.email)||h(a,"email")||h(a,"accountId")||g(a?.connectionId)||null)||g(b)||function(){let a,b=0xffffffffffffffffn-0xffffffffffffffffn%0x7ce66c50e2840000n;do a=e().randomBytes(8).readBigUInt64BE();while(a>=b);return`-${(a%0x7ce66c50e2840000n).toString()}`}()}},22409:(a,b,c)=>{"use strict";c.d(b,{F:()=>h});var d=c(66678),e=c(30395),f=c(32210),g=c(42541);class h extends d.L{constructor(){super("xiaomi-tokenplan")}buildUrl(a,b,c=0,d=null){let h=(0,e.Yg)(d);return(0,f.ux)(a,a)===g.h.CLAUDE?`${h.replace(/\/v1\/?$/,"/anthropic/v1")}/messages`:`${h}/chat/completions`}}},23242:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ollamaBodyToOpenAI:()=>j,ollamaToOpenAI:()=>g});var d=c(56294),e=c(42541),f=c(90943);function g(a,b){if(!a||"object"!=typeof a)return null;b.ollama||(b.ollama={id:`chatcmpl-${Date.now()}`,created:Math.floor(Date.now()/1e3),model:a.model||b.model});let{id:c,created:d,model:g}=b.ollama;if(a.done){let i=h(a);return{id:c,object:"chat.completion.chunk",created:d,model:g,choices:[{index:0,delta:{},finish_reason:(0,f.Jm)(a.done_reason,{format:e.h.OLLAMA,hasToolCalls:b.hadToolCalls})}],usage:i}}let j=a.message;if(!j)return null;let k="string"==typeof j.content?j.content:"",l="string"==typeof j.thinking?j.thinking:"",m=Array.isArray(j.tool_calls)?j.tool_calls:null;if(!k&&!l&&!m)return null;k&&(b.accumulatedContent=(b.accumulatedContent||"")+k),l&&(b.accumulatedThinking=(b.accumulatedThinking||"")+l);let n={};return k&&(n.content=k),l&&(n.reasoning_content=l),m&&(b.hadToolCalls=!0,n.tool_calls=i(m)),{id:c,object:"chat.completion.chunk",created:d,model:g,choices:[{index:0,delta:n,finish_reason:null}]}}function h(a){return{prompt_tokens:a.prompt_eval_count||0,completion_tokens:a.eval_count||0,total_tokens:(a.prompt_eval_count||0)+(a.eval_count||0)}}function i(a){return a.map((a,b)=>({index:a.function?.index??b,id:a.id||`call_${b}_${Date.now()}`,type:"function",function:{name:a.function?.name||"",arguments:"string"==typeof a.function?.arguments?a.function.arguments:JSON.stringify(a.function?.arguments||{})}}))}function j(a){let b=a.message||{},c=b.content||"",d=b.thinking||"",g=Array.isArray(b.tool_calls)?b.tool_calls:[],j={role:"assistant"};c&&(j.content=c),d&&(j.reasoning_content=d),g.length>0&&(j.tool_calls=i(g)),j.content||j.tool_calls||(j.content="");let k=(0,f.Jm)(a.done_reason,{format:e.h.OLLAMA,hasToolCalls:g.length>0});return{id:`chatcmpl-${Date.now()}`,object:"chat.completion",created:Math.floor(Date.now()/1e3),model:a.model||"ollama",choices:[{index:0,message:j,finish_reason:k}],usage:h(a)}}(0,d.kz)(e.h.OLLAMA,e.h.OPENAI,null,g)},23423:(a,b,c)=>{"use strict";let d;a=c.nmd(a);let{Buffer:e}=c(4573);Object.defineProperty(a,"exports",{get:()=>d||(d=e.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52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ABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgLhocCAwd/A34BeyABIAJqIQQCQCAAIgMoAgwiAA0AIAMoAgQEQCADIAE2AgQLIwBBEGsiCSQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ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wsC0G0AQwrC0G1AQwqC0G2AQwpC0G3AQwoC0G4AQwnC0G5AQwmC0G6AQwlC0G7AQwkC0G8AQwjC0G9AQwiC0G+AQwhC0G/AQwgC0HAAQwfC0HBAQweC0HCAQwdC0EBDBwLQcMBDBsLQcQBDBoLQcUBDBkLQcYBDBgLQccBDBcLQcgBDBYLQckBDBULQcoBDBQLQcsBDBMLQcwBDBILQc0BDBELQc4BDBALQc8BDA8LQdABDA4LQdEBDA0LQdIBDAwLQdMBDAsLQdQBDAoLQdUBDAkLQdYBDAgLQeMBDAcLQdcBDAYLQdgBDAULQdkBDAQLQdoBDAMLQdsBDAILQd0BDAELQdwBCyECA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAn8CQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAwJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQ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ABQQFqNgIUQQAhAgzzAgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDOsCCyADQR02AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8gILIABBO0cNASABQQFqIQELQSYhAgzXAgtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwM7wILIAEgBEcEQANAIAEtAABBIEcNhAIgBCABQQFqIgFHDQALQSwhAgzvAgtBLCECDO4CCyABIARGBEBBNCECDO4CCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtBNCECDO8CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNnwIgA0EyNgIcIAMgATYCFCADIAA2AgxBACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUEQCABQQFqIQEMnwILIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgztAgsgASAERwRAAkADQCABLQAAQTBrIgBB/wFxQQpPBEBBOiECDNcCCyADKQMgIgtCmbPmzJmz5swZVg0BIAMgC0IKfiIKNwMgIAogAK1C/wGDIgtCf4VWDQEgAyAKIAt8NwMgIAQgAUEBaiIBRw0AC0HAACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABQQFqIgEQMSIADRcM4gILQcAAIQIM7AILIAEgBEYEQEHJACECDOwCCwJAA0ACQCABLQAAQQlrDhgAAqICogKpAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAgCiAgsgBCABQQFqIgFHDQALQckAIQIM7AILIAFBAWohASADQS9qLQAAQQFxDaUCIANBADYCHCADIAE2AhQgA0GXEDYCECADQQo2AgxBACECDOsCCyABIARHBEADQCABLQAAQSBHDRUgBCABQQFqIgFHDQALQfgAIQIM6wILQfgAIQIM6gILIANBAjoAKAw4C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAzoAgtBACECDM4CC0ENIQIMzQILQRMhAgzMAgtBFSECDMsCC0EWIQIMygILQRghAgzJAgtBGSECDMgC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AEYNASADQQE6ACgLQcABIQIMrgILQdoBIQIMrQILIAEgBEcEQCADQQw2AgggAyABNgIEQdkBIQIMrQILQfkBIQIMxQILIAEgBEYEQEH4ASECDMUCCyABLQAAQcgARw0EIAFBAWohAUHYASECDKsCCyABIARGBEBB9wEhAgzEAgsCQAJAIAEtAABBxQBrDhAABQUFBQUFBQUFBQUFBQUBBQsgAUEBaiEBQdYBIQIMqwILIAFBAWohAUHXASECDKoCC0H2ASECIAEgBEYNwgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABButUAai0AAEcNAyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMwwILIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgBFBEBB4wEhAgyqAgsgA0H1ATYCHCADIAE2AhQgAyAANgIMQQAhAgzCAgtB9AEhAiABIARGDcECIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjVAGotAABHDQIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMICCyADQYEEOwEoIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgANAwwCCyADQQA2AgALQQAhAiADQQA2AhwgAyABNgIUIANB5R82AhAgA0EINgIMDL8CC0HVASECDKUCCyADQfMBNgIcIAMgATYCFCADIAA2AgxBACECDL0CC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ1uIABBFUcEQCADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgy9AgsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDLwCCyABIARHBEAgA0ENNgIIIAMgATYCBEHTASECDKMCC0HyASECDLsCCyABIARGBEBB8QEhAgy7AgsCQAJAAkAgAS0AAEHIAGsOCwABCAgICAgICAgCCAsgAUEBaiEBQdABIQIMowILIAFBAWohAUHRASECDKICCyABQQFqIQFB0gEhAgyhAgtB8AEhAiABIARGDbkCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEG11QBqLQAARw0EIABBAkYNAyAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy5AgtB7wEhAiABIARGDbgCIAMoAgAiACAEIAFraiEGIAEgAGtBAWohBQNAIAEtAAAgAEGz1QBqLQAARw0DIABBAUYNAiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy4AgtB7gEhAiABIARGDbcCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEGw1QBqLQAARw0CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy3AgsgAygCBCEAIANCADcDACADIAAgBUEBaiIBECsiAEUNAiADQewBNgIcIAMgATYCFCADIAA2AgxBACECDLYCCyADQQA2AgALIAMoAgQhACADQQA2AgQgAyAAIAEQKyIARQ2cAiADQe0BNgIcIAMgATYCFCADIAA2AgxBACECDLQCC0HPASECDJoCC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMtAILQc4BIQIMmgILIANB6wE2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyyAgsgASAERgRAQesBIQIMsgILIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMsQILQc0BIQIMlwILIAEgBEcEQCADQQ42AgggAyABNgIEQcwBIQIMlwILQeoBIQIMrwILIAEgBEYEQEHpASECDK8CCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHLASECDJYCCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNlwIgA0HoATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgASAERgRAQecBIQIMrgILAkAgAS0AAEEuRgRAIAFBAWohAQwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmAIgA0HmATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgtBygEhAgyUAgsgASAERgRAQeUBIQIMrQILQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIBNgIcIAMgATYCFCADIAA2AgxBACECDK8CCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmgIgA0HjATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5AE2AhwgAyABNgIUIAMgADYCDAytAgtByQEhAgyTAgtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GkDTYCECADQSE2AgxBACECDK0CC0HIASECDJMCCyADQeEBNgIcIAMgATYCFCADQdAaNgIQIANBFTYCDEEAIQIMqwILIAEgBEYEQEHhASECDKsCCwJAIAEtAABBIEYEQCADQQA7ATQgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GZETYCECADQQk2AgxBACECDKsCC0HHASECDJECCyABIARGBEBB4AEhAgyqAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKsCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyqAgtBxgEhAgyQAgsgASAERgRAQd8BIQIMqQILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyqAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqQILQcUBIQIMjwILIAEgBEYEQEHeASECDKgCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqQILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKgCC0HEASECDI4CCyABIARGBEBB3QEhAgynAgsCQAJAAkACQCABLQAAQQprDhcCAwMAAwMDAwMDAwMDAwMDAwMDAwMDAQMLIAFBAWoMBQsgAUEBaiEBQcMBIQIMjwILIAFBAWohASADQS9qLQAAQQFxDQggA0EANgIcIAMgATYCFCADQY0LNgIQIANBDTYCDEEAIQIMpwILIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKYCCyABIARHBEAgA0EPNgIIIAMgATYCBEEBIQIMjQILQdwBIQIMpQILAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0HbASECDKYCCyADKAIEIQAgA0EANgIEIAMgACABEC0iAEUEQCABQQFqIQEMBAsgA0HaATYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgylAgsgAygCBCEAIANBADYCBCADIAAgARAtIgANASABQQFqCyEBQcEBIQIMigILIANB2QE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMogILQcIBIQIMiAILIANBL2otAABBAXENASADQQA2AhwgAyABNgIUIANB5Bw2AhAgA0EZNgIMQQAhAgygAgsgASAERgRAQdkBIQIMoAIL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sgAUEBaiEBQbIBIQIM+AELIAFBAWohAUGzASECDPcBC0HLASECIAEgBEYNjwIgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCABLQAAIABBkdUAai0AAEcNPCAAQQZGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkAILIANBADYCACAGQQFqIQFBGgw8C0HKASECIAEgBEYNjgIgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBjdUAai0AAEcNOyAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMjwILIANBADYCACAGQQFqIQFBIQw7CyABIARGBEBByQEhAgyOAgsCQAJAIAEtAABBwQBrDhQAPT09PT09PT09PT09PT09PT09AT0LIAFBAWohAUGtASECDPUBCyABQQFqIQFBsAEhAgz0AQsgASAERgRAQcgBIQIMjQILAkACQCABLQAAQdUAaw4LADw8PDw8PDw8PAE8CyABQQFqIQFBrgEhAgz0AQsgAUEBaiEBQa8BIQIM8wELQccBIQIgASAERg2LAiADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw04IABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyMAgsgA0EANgIAIAZBAWohAUEqDDgLIAEgBEYEQEHGASECDIsCCyABLQAAQdAARw04IAFBAWohAUElDDcLQcUBIQIgASAERg2JAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGB1QBqLQAARw02IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyKAgsgA0EANgIAIAZBAWohAUEODDYLIAEgBEYEQEHEASECDIkCCyABLQAAQcUARw02IAFBAWohAUGrASECDO8BCyABIARGBEBBwwEhAgyIAgsCQAJAAkACQCABLQAAQcIAaw4PAAECOTk5OTk5OTk5OTkDOQsgAUEBaiEBQacBIQIM8QELIAFBAWohAUGoASECDPABCyABQQFqIQFBqQEhAgzvAQsgAUEBaiEBQao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DO8BCyABLQAAQcwARw0cIAFBAWohAUEKDBsLQakBIQIgASAERg3tASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHR1ABqLQAARw0aIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzuAQsgA0EANgIAIAZBAWohAUEeDBoLQagBIQIgASAERg3sASADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEHK1ABqLQAARw0ZIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAztAQsgA0EANgIAIAZBAWohAUEVDBkLQacBIQIgASAERg3rASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHH1ABqLQAARw0YIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzsAQsgA0EANgIAIAZBAWohAUEXDBgLQaYBIQIgASAERg3qASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHB1ABqLQAARw0XIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzrAQsgA0EANgIAIAZBAWohAUEYDBcLIAEgBEYEQEGlASECDOoBCwJAAkAgAS0AAEHJAGsOBwAZGRkZGQEZCyABQQFqIQFBiwEhAgzRAQsgAUEBaiEBQYwBIQIM0AELQaQBIQIgASAERg3oASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw0VIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzpAQsgA0EANgIAIAZBAWohAUEJDBULQaMBIQIgASAERg3nASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw0UIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzoAQsgA0EANgIAIAZBAWohAUEfDBQLQaIBIQIgASAERg3mASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEG+1ABqLQAARw0TIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAznAQsgA0EANgIAIAZBAWohAUECDBMLQaEBIQIgASAERg3lASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYDQCABLQAAIABBvNQAai0AAEcNESAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5QELIAEgBEYEQEGgASECDOUBC0EBIAEtAABB3wBHDREaIAFBAWohAUGHASECDMsBCyADQQA2AgAgBkEBaiEBQYgBIQIMygELQZ8BIQIgASAERg3iASADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw0PIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzjAQsgA0EANgIAIAZBAWohAUEpDA8LQZ4BIQIgASAERg3hASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEG41ABqLQAARw0OIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAziAQsgA0EANgIAIAZBAWohAUEtDA4LIAEgBEYEQEGdASECDOEBCyABLQAAQcUARw0OIAFBAWohAUGEASECDMcBCyABIARGBEBBnAEhAgzgAQsCQAJAIAEtAABBzABrDggADw8PDw8PAQ8LIAFBAWohAUGCASECDMcBCyABQQFqIQFBgwEhAgzGAQtBmwEhAiABIARGDd4BIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQbPUAGotAABHDQsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN8BCyADQQA2AgAgBkEBaiEBQSMMCwtBmgEhAiABIARGDd0BIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDUAGotAABHDQogAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN4BCyADQQA2AgAgBkEBaiEBQQAMCgsgASAERgRAQZkBIQIM3QELAkACQCABLQAAQcgAaw4IAAwMD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zwELQQAhAAJAIAMoAjgiAkUNACACKAJAIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GCDzYCECADQSA2AgxBACECDM4BC0H3ACECDLQBCyADQY8BNgIcIAMgATYCFCADQewbNgIQIANBFTYCDEEAIQIMzAELIAEgBEYEQEGPASECDMwBCwJAIAEtAABBIEYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZsfNgIQIANBBjYCDEEAIQIMzAELQQIhAgyyAQsDQCABLQAAQSBHDQIgBCABQQFqIgFHDQALQY4BIQIMygELIAEgBEYEQEGNASECDMoBCwJAIAEtAABBCWsOBEoAAEoAC0H1ACECDLABCyADLQApQQVGBEBB9gAhAgywAQtB9AAhAgyvAQsgASAERgRAQYwBIQIMyAELIANBEDYCCCADIAE2AgQMCgsgASAERgRAQYsBIQIMxwELAkAgAS0AAEEJaw4ERwAARwALQfMAIQIMrQELIAEgBEcEQCADQRA2AgggAyABNgIEQfEAIQIMrQELQYoBIQIMxQELAkAgASAERwRAA0AgAS0AAEGg0ABqLQAAIgBBA0cEQAJAIABBAWsOAkkABAtB8AAhAgyvAQsgBCABQQFqIgFHDQALQYgBIQIMxgELQYgBIQIMxQELIANBADYCHCADIAE2AhQgA0HbIDYCECADQQc2AgxBACECDMQBCyABIARGBEBBiQEhAgzEAQsCQAJAAkAgAS0AAEGg0gBqLQAAQQFrDgNGAgABC0HyACECDKwBCyADQQA2AhwgAyABNgIUIANBtBI2AhAgA0EHNgIMQQAhAgzEAQtB6gAhAgyqAQsgASAERwRAIAFBAWohAUHvACECDKoBC0GHASECDMIBCyAEIAEiAEYEQEGGASECDMIBCyAALQAAIgFBL0YEQCAAQQFqIQFB7gAhAgypAQsgAUEJayICQRdLDQEgACEBQQEgAnRBm4CABHENQQwBCyAEIAEiAEYEQEGFASECDMEBCyAALQAAQS9HDQAgAEEBaiEBDAMLQQAhAiADQQA2AhwgAyAANgIUIANB2yA2AhAgA0EHNgIMDL8BCwJAAkACQAJAAkADQCABLQAAQaDOAGotAAAiAEEFRwRAAkACQCAAQQFrDghHBQYHCAAEAQgLQesAIQIMrQELIAFBAWohAUHtACECDKwBCyAEIAFBAWoiAUcNAAtBhAEhAgzDAQsgAUEBagwUCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDMEBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDMABCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDL8BCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy+AQsgASAERgRAQYMBIQIMvgELAkAgAS0AAEGgzgBqLQAAQQFrDgg+BAUGAAgCAwcLIAFBAWohAQtBAyECDKMBCyABQQFqDA0LQQAhAiADQQA2AhwgA0HREjYCECADQQc2AgwgAyABQQFqNgIUDLoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDLkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDLgBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDLcBCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy2AQtB7AAhAgycAQsgASAERgRAQYIBIQIMtQELIAFBAWoMAgsgASAERgRAQYEBIQIMtAELIAFBAWoMAQsgASAERg0BIAFBAWoLIQFBBCECDJgBC0GAASECDLABCwNAIAEtAABBoMwAai0AACIAQQJHBEAgAEEBRwRAQekAIQIMmQELDDELIAQgAUEBaiIBRw0AC0H/ACECDK8BCyABIARGBEBB/gAhAgyvAQsCQCABLQAAQQlrDjcvAwYvBAYGBgYGBgYGBgYGBgYGBgYGBgUGBgIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYABgsgAUEBagshAUEFIQIMlAELIAFBAWoMBgsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgyrAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgyqAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgypAQsgA0EANgIcIAMgATYCFCADQY0UNgIQIANBBzYCDEEAIQIMqAELAkACQAJAAkADQCABLQAAQaDKAGotAAAiAEEFRwRAAkAgAEEBaw4GLgMEBQYABgtB6AAhAgyUAQsgBCABQQFqIgFHDQALQf0AIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqAELIANBADYCHCADIAE2AhQgA0HkCDYCECADQQc2AgxBACECDKcBCyABIARGDQEgAUEBagshAUEGIQIMjAELQfwAIQIMpAELAkACQAJAAkADQCABLQAAQaDIAGotAAAiAEEFRwRAIABBAWsOBCkCAwQFCyAEIAFBAWoiAUcNAAtB+wAhAgynAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgymAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgylAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgykAQsgA0EANgIcIAMgATYCFCADQbwKNgIQIANBBzYCDEEAIQIMowELQc8AIQIMiQELQdEAIQIMiAELQecAIQIMhwELIAEgBEYEQEH6ACECDKABCwJAIAEtAABBCWsOBCAAACAACyABQQFqIQFB5gAhAgyGAQsgASAERgRAQfkAIQIMnwELAkAgAS0AAEEJaw4EHwAAHwALQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFBEBB4gEhAgyGAQsgAEEVRwRAIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDJ8BCyADQfgANgIcIAMgATYCFCADQeoaNgIQIANBFTYCDEEAIQIMngELIAEgBEcEQCADQQ02AgggAyABNgIEQeQAIQIMhQELQfcAIQIMnQELIAEgBEYEQEH2ACECDJ0BCwJAAkACQCABLQAAQcgAaw4LAAELCwsLCwsLCwILCyABQQFqIQFB3QAhAgyFAQsgAUEBaiEBQeAAIQIMhAELIAFBAWohAUHjACECDIMBC0H1ACECIAEgBEYNmwEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBtdUAai0AAEcNCCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMnAELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfQANgIcIAMgATYCFCADIAA2AgxBACECDJwBC0HiACECDIIBC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMnAELQeEAIQIMggELIANB8wA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyaAQsgAy0AKSIAQSNrQQtJDQkCQCAAQQZLDQBBASAAdEHKAHFFDQAMCgtBACECIANBADYCHCADIAE2AhQgA0HtCTYCECADQQg2AgwMmQELQfIAIQIgASAERg2YASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGz1QBqLQAARw0FIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAQsgAygCBCEAIANCADcDACADIAAgBkEBaiIBECsiAARAIANB8QA2AhwgAyABNgIUIAMgADYCDEEAIQIMmQELQd8AIQIMfwtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJkBC0HeACECDH8LIANB8AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyXAQsgAy0AKUEhRg0GIANBADYCHCADIAE2AhQgA0GRCjYCECADQQg2AgxBACECDJYBC0HvACECIAEgBEYNlQEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMlgELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgBFDQIgA0HtADYCHCADIAE2AhQgAyAANgIMQQAhAgyVAQsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNgAEgA0HuADYCHCADIAE2AhQgAyAANgIMQQAhAgyTAQtB3AAhAgx5C0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMkwELQdsAIQIMeQsgA0HsADYCHCADIAE2AhQgA0GAGzYCECADQRU2AgxBACECDJEBCyADLQApIgBBI0kNACAAQS5GDQAgA0EANgIcIAMgATYCFCADQckJNgIQIANBCDYCDEEAIQIMkAELQdoAIQIMdgsgASAERgRAQesAIQIMjwELAkAgAS0AAEEvRgRAIAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMQQAhAgyPAQtB2QAhAgx1CyABIARHBEAgA0EONgIIIAMgATYCBEHYACECDHULQeoAIQIMjQELIAEgBEYEQEHpACECDI0BCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHXACECDHQLIAMoAgQhAC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AgA0EVNgIMQQAhAgxnCyABIARHBEAgASECA0AgBCACIgFrQRBOBEAgAUEQaiEC/Qz/////////////////////IAH9AAAAIg1BB/1sIA39DODg4ODg4ODg4ODg4ODg4OD9bv0MX19fX19fX19fX19fX19fX/0mIA39DAkJCQkJCQkJCQkJCQkJCQn9I/1Q/VL9ZEF/c2giAEEQRg0BIAAgAWohAQwYCyABIARGBEBBxAAhAgxpCyABLQAAQcDBAGotAABBAUcNFyAEIAFBAWoiAkcNAAtBxAAhAgxnC0HEACECDGYLIAEgBEcEQANAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXEiAEEJRg0AIABBIEYNAAJAAkACQAJAIABB4wBrDhMAAwMDAwMDAwEDAwMDAwMDAwMCAwsgAUEBaiEBQTYhAgxSCyABQQFqIQFBNyECDFELIAFBAWohAUE4IQIMUAsMFQsgBCABQQFqIgFHDQALQTwhAgxmC0E8IQIMZQsgASAERgRAQcgAIQIMZQsgA0ESNgIIIAMgATYCBAJAAkACQAJAAkAgAy0ALEEBaw4EFAABAgkLIAMtADJBIHENA0HgASECDE8LAkAgAy8BMiIAQQhxRQ0AIAMtAChBAUcNACADLQAuQQhxRQ0CCyADIABB9/sDcUGABHI7ATIMCwsgAyADLwEyQRByOwEyDAQLIANBADYCBCADIAEgARAxIgAEQCADQcEANgIcIAMgADYCDCADIAFBAWo2AhRBACECDGYLIAFBAWohAQxYCyADQQA2AhwgAyABNgIUIANB9BM2AhAgA0EENgIMQQAhAgxkC0HHACECIAEgBEYNYyADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIABBwMUAai0AACABLQAAQSByRw0BIABBBkYNSiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAxkCyADQQA2AgAMBQsCQCABIARHBEADQCABLQAAQcDDAGotAAAiAEEBRwRAIABBAkcNAyABQQFqIQEMBQsgBCABQQFqIgFHDQALQcUAIQIMZAtBxQAhAgxjCwsgA0EAOgAsDAELQQshAgxHC0E/IQIMR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JET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==","base64"))})},23740:(a,b,c)=>{"use strict";c.d(b,{Q2:()=>u,jO:()=>v});var d=c(38929),e=c(37149),f=c(93818),g=c(80668),h=c(83287),i=c(9757),j=c(92853),k=c(80742),l=c(57472),m=c(61691),n=c(14041);c(46777);let o="⚠️ Risk Notice: This provider uses a subscription/OAuth session not officially licensed for proxy/router use. Account may be restricted or banned. Use at your own risk.";function p(a){return{id:a.id,alias:a.alias,aliases:a.aliases,...a.display,authModes:a.authModes,passthroughModels:a.passthroughModels,serviceKinds:a.serviceKinds}}let q={poolside:p(k.A),"kilo-gateway":p(h.A),bazaarlink:p(g.A),llm7:p(i.A),openrouter:{id:"openrouter",alias:"openrouter",name:"OpenRouter",icon:"router",color:"#F97316",textIcon:"OR",website:"https://openrouter.ai",notice:{text:"Free tier: 27+ free models, 200 req/day; after $10 credit: 1,000 req/day (OpenRouter terms).",apiKeyUrl:"https://openrouter.ai/settings/keys"},modelsFetcher:{url:"https://openrouter.ai/api/v1/models",type:"openrouter-free"},passthroughModels:!0,serviceKinds:["llm","embedding","tts","imageToText"],embeddingConfig:{baseUrl:"https://openrouter.ai/api/v1/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"openai/text-embedding-3-small",name:"Text Embedding 3 Small (OpenRouter)",dimensions:1536},{id:"openai/text-embedding-3-large",name:"Text Embedding 3 Large (OpenRouter)",dimensions:3072},{id:"openai/text-embedding-ada-002",name:"Text Embedding Ada 002 (OpenRouter)",dimensions:1536}]}},nvidia:{id:"nvidia",alias:"nvidia",name:"NVIDIA NIM",icon:"developer_board",color:"#76B900",textIcon:"NV",website:"https://developer.nvidia.com/nim",notice:{text:"Free access for NVIDIA Developer Program members (prototyping & testing).",apiKeyUrl:"https://build.nvidia.com/settings/api-keys"},serviceKinds:["llm","tts","embedding"],ttsConfig:{baseUrl:"https://integrate.api.nvidia.com/v1/audio/speech",authType:"apikey",authHeader:"bearer",format:"nvidia-tts",models:[{id:"fastpitch",name:"FastPitch"},{id:"tacotron2",name:"Tacotron2"}]},embeddingConfig:{baseUrl:"https://integrate.api.nvidia.com/v1/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"nvidia/nv-embedqa-e5-v5",name:"NV EmbedQA E5 v5",dimensions:1024}]}},ollama:{id:"ollama",alias:"ollama",name:"Ollama Cloud",icon:"cloud",color:"#ffffffff",textIcon:"OL",website:"https://ollama.com",notice:{text:"Free tier: light usage, 1 cloud model at a time (limits reset every 5h & 7d). Pro $20/mo \xb7 Max $100/mo.",apiKeyUrl:"https://ollama.com/settings/keys"}},vertex:{id:"vertex",alias:"vx",name:"Vertex AI",icon:"cloud",color:"#4285F4",textIcon:"VX",website:"https://cloud.google.com/vertex-ai",notice:{text:"New Google Cloud accounts get $300 free credits. Requires GCP project + Service Account with Vertex AI API enabled.",apiKeyUrl:"https://console.cloud.google.com/iam-admin/serviceaccounts"}},gemini:{id:"gemini",alias:"gemini",name:"Gemini",icon:"diamond",color:"#4285F4",textIcon:"GE",mediaPriority:1,website:"https://ai.google.dev",notice:{apiKeyUrl:"https://aistudio.google.com/app/apikey"},serviceKinds:["llm","embedding","image","imageToText","webSearch","tts","stt"],sttConfig:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",authType:"apikey",authHeader:"key",format:"gemini-stt",models:[{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro (Best)"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash"},{id:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite (Cheapest)"},{id:"gemini-2.0-flash",name:"Gemini 2.0 Flash"}]},searchViaChat:{defaultModel:"gemini-2.5-flash",pricingUrl:"https://ai.google.dev/pricing",freeTier:"Free tier: 15 RPM, 1M tokens/day on gemini-2.5-flash via AI Studio."},embeddingConfig:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",authType:"apikey",authHeader:"key",models:[{id:"text-embedding-004",name:"Text Embedding 004",dimensions:768},{id:"embedding-001",name:"Embedding 001",dimensions:768}]},ttsConfig:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",authType:"apikey",authHeader:"key",format:"gemini-tts",models:[{id:"gemini-2.5-flash-preview-tts",name:"Gemini 2.5 Flash TTS"},{id:"gemini-2.5-pro-preview-tts",name:"Gemini 2.5 Pro TTS"}]}},"cloudflare-ai":{id:"cloudflare-ai",alias:"cf",name:"Cloudflare",icon:"cloud",color:"#F38020",textIcon:"CF",website:"https://developers.cloudflare.com/workers-ai/",notice:{text:"Workers AI free tier. Requires a Cloudflare API token and Account ID.",apiKeyUrl:"https://dash.cloudflare.com/profile/api-tokens"},serviceKinds:["llm","image"],hasProviderSpecificData:!0},byteplus:{id:"byteplus",alias:"bpm",name:"BytePlus ModelArk",icon:"cloud",color:"#2563EB",textIcon:"BP",website:"https://console.byteplus.com/ark",notice:{text:"Free credits for new accounts. Access to Seed 2.0, Kimi K2 Thinking, GLM 4.7, GPT-OSS-120B models.",apiKeyUrl:"https://console.byteplus.com/ark/region:ark+ap-southeast-1/apiKey"},serviceKinds:["llm"]}},r=[{id:"speech-2.8-hd",name:"Speech 2.8 HD"},{id:"speech-2.8-turbo",name:"Speech 2.8 Turbo"},{id:"speech-2.6-hd",name:"Speech 2.6 HD"},{id:"speech-2.6-turbo",name:"Speech 2.6 Turbo"},{id:"speech-02-hd",name:"Speech 02 HD"},{id:"speech-02-turbo",name:"Speech 02 Turbo"},{id:"speech-01-hd",name:"Speech 01 HD"},{id:"speech-01-turbo",name:"Speech 01 Turbo"}],s={claude:{id:"claude",alias:"cc",name:"Claude Code",icon:"smart_toy",color:"#D97757",deprecated:!0,deprecationNotice:o,website:"https://claude.ai",notice:{signupUrl:"https://claude.ai"}},antigravity:{id:"antigravity",alias:"ag",name:"Antigravity",icon:"rocket_launch",color:"#F59E0B",deprecated:!0,deprecationNotice:"⚠️ Risk Notice: This provider uses a subscription/OAuth session not officially licensed for proxy/router use. Account may be restricted or banned. Use at your own risk.",serviceKinds:["llm","image"],website:"https://antigravity.google",notice:{signupUrl:"https://antigravity.google"}},codex:{id:"codex",alias:"cx",name:"OpenAI Codex",icon:"code",color:"#3B82F6",deprecated:!0,deprecationNotice:o,thinkingConfig:{options:["auto","none","minimal","low","medium","high","xhigh","max","ultra"],defaultMode:"auto"},serviceKinds:["llm","image"],kindNotice:{image:"Requires a ChatGPT Plus (or higher) account. Free accounts are not supported for image generation."},website:"https://chatgpt.com/codex",notice:{signupUrl:"https://chatgpt.com/codex"}},github:{id:"github",alias:"gh",name:"GitHub Copilot",icon:"code",color:"#333333",deprecated:!0,deprecationNotice:o,serviceKinds:["llm","embedding"],embeddingConfig:{baseUrl:"https://models.github.ai/inference/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"text-embedding-3-small",name:"Text Embedding 3 Small (GitHub)",dimensions:1536},{id:"text-embedding-3-large",name:"Text Embedding 3 Large (GitHub)",dimensions:3072}]},website:"https://github.com/features/copilot",notice:{signupUrl:"https://github.com/features/copilot"}},cursor:{id:"cursor",alias:"cu",name:"Cursor IDE",icon:"edit_note",color:"#00D4AA",website:"https://cursor.com",notice:{signupUrl:"https://cursor.com"}},trae:{id:"trae",alias:"trae",name:"Trae",icon:"bolt",color:"#FF6A00",textIcon:"TR",deprecated:!0,deprecationNotice:o,hidden:!0,authModes:["oauth","apikey"],website:"https://www.trae.ai",notice:{text:"Sign in with Trae (browser), or paste a Cloud-IDE-JWT token from DevTools. Token lasts ~14 days.",signupUrl:"https://www.trae.ai"}},windsurf:{id:"windsurf",alias:"ws",name:"Windsurf",icon:"sailing",color:"#09B6A2",textIcon:"WS",deprecated:!0,deprecationNotice:o,hidden:!0,authModes:["oauth","apikey"],website:"https://windsurf.com",notice:{text:"Sign in with Windsurf (browser), or paste a Codeium API key (sk-ws-…). Chat runs over Codeium's gRPC-web backend.",signupUrl:"https://windsurf.com"}},zed:{id:"zed",alias:"zd",name:"Zed",icon:"bolt",color:"#084CCF",textIcon:"ZD",deprecated:!0,deprecationNotice:o,hidden:!0,authModes:["oauth"],website:"https://zed.dev",notice:{text:"Sign in with Zed (browser) — a local RSA keypair secures the callback. Zed fronts Anthropic/OpenAI/Google/xAI via cloud.zed.dev.",signupUrl:"https://zed.dev"}},"devin-cli":{id:"devin-cli",alias:"dv",name:"Devin CLI",icon:"terminal",color:"#6E56CF",textIcon:"DV",deprecated:!0,deprecationNotice:o,hidden:!0,noAuth:!0,authModes:["none"],website:"https://devin.ai",notice:{text:"Runs the local `devin acp` binary over stdio — requires the Devin CLI installed and logged in (devin auth login) on this host. Can execute host shell commands."}},xai:{id:d.A.id,alias:d.A.alias,...d.A.display,serviceKinds:d.A.serviceKinds,imageConfig:d.A.imageConfig,videoConfig:d.A.videoConfig,searchViaChat:d.A.searchViaChat,authModes:d.A.authModes,hasOAuth:d.A.hasOAuth},kimi:{id:"kimi",alias:"kimi",aliases:["kimi-coding","kmc"],name:"Kimi",icon:"psychology",color:"#1E3A8A",textIcon:"KM",website:"https://kimi.moonshot.cn",notice:{apiKeyUrl:"https://platform.moonshot.ai/console/api-keys",signupUrl:"https://www.kimi.com/code"},serviceKinds:["llm","webSearch"],searchViaChat:{defaultModel:"kimi-k3",pricingUrl:"https://platform.kimi.ai/docs/pricing/chat"},authModes:["oauth","apikey"],hasOAuth:!0},kilocode:{id:"kilocode",alias:"kc",name:"Kilo Code",icon:"code",color:"#FF6B35",textIcon:"KC",website:"https://kilocode.ai",notice:{signupUrl:"https://kilocode.ai"}},cline:{id:"cline",alias:"cl",name:"Cline",icon:"smart_toy",color:"#5B9BD5",textIcon:"CL",website:"https://cline.bot",notice:{signupUrl:"https://cline.bot"}},clinepass:{id:"clinepass",alias:"clinepass",name:"ClinePass",icon:"vpn_key",color:"#5B9BD5",textIcon:"CP",website:"https://cline.bot",notice:{signupUrl:"https://app.cline.bot"},authModes:["oauth","apikey"],hasOAuth:!0,thinkingConfig:{options:["auto","on","off"],defaultMode:"auto",defaultBudgetTokens:1e4}},kimchi:{id:"kimchi",alias:"kimchi",name:"Kimchi",icon:"restaurant",color:"#FF521D",textIcon:"KC",website:"https://kimchi.dev",notice:{signupUrl:"https://app.kimchi.dev"},hasOAuth:!0,passthroughModels:!0,serviceKinds:["llm","imageToText"]},"grok-cli":{id:"grok-cli",alias:"gcli",name:"Grok CLI (Grok Build)",icon:"auto_awesome",color:"#1DA1F2",textIcon:"GC",website:"https://x.ai",notice:{text:"Sign in with your xAI / Grok account via device code. Uses Grok Build subscription credits (cli-chat-proxy.grok.com).",signupUrl:"https://grok.com/supergrok"},hasOAuth:!0,thinkingConfig:{options:["low","medium","high"],defaultMode:"high"}},autoclaw:{id:"autoclaw",alias:"acl",name:"AutoClaw",icon:"bolt",color:"#7C3AED",textIcon:"AC",website:"https://autoclaw.z.ai",notice:{signupUrl:"https://autoclaw.z.ai"}}},t={"alims-intl":p(e.A),baidu:p(f.A),tokenrouter:p(m.A),"alitp-intl":p(n.A),morph:p(j.A),tencent:p(l.A),glm:{id:"glm",alias:"glm",name:"GLM Coding",icon:"code",color:"#2563EB",textIcon:"GL",website:"https://open.bigmodel.cn",notice:{apiKeyUrl:"https://open.bigmodel.cn/usercenter/apikeys"}},"glm-cn":{id:"glm-cn",alias:"glm-cn",name:"GLM (China)",icon:"code",color:"#DC2626",textIcon:"GC",website:"https://open.bigmodel.cn",notice:{apiKeyUrl:"https://open.bigmodel.cn/usercenter/apikeys"}},minimax:{id:"minimax",alias:"minimax",name:"Minimax Coding",icon:"memory",color:"#7C3AED",textIcon:"MM",website:"https://www.minimaxi.com",notice:{apiKeyUrl:"https://platform.minimaxi.com/user-center/basic-information/interface-key"},serviceKinds:["llm","image","imageToText","webSearch","tts"],searchViaChat:{defaultModel:"MiniMax-M2.7",pricingUrl:"https://www.minimaxi.com/document/price"},ttsConfig:{baseUrl:"https://api.minimax.io/v1/t2a_v2",authType:"apikey",authHeader:"bearer",format:"minimax-tts",models:r}},"minimax-cn":{id:"minimax-cn",alias:"minimax-cn",name:"Minimax (China)",icon:"memory",color:"#DC2626",textIcon:"MC",website:"https://www.minimaxi.com",notice:{apiKeyUrl:"https://platform.minimaxi.com/user-center/basic-information/interface-key"},serviceKinds:["llm","tts"],ttsConfig:{baseUrl:"https://api.minimaxi.com/v1/t2a_v2",authType:"apikey",authHeader:"bearer",format:"minimax-tts",models:r}},alicode:{id:"alicode",alias:"alicode",name:"Alibaba",icon:"cloud",color:"#FF6A00",textIcon:"ALi",website:"https://bailian.console.aliyun.com",notice:{apiKeyUrl:"https://bailian.console.aliyun.com/?apiKey=1"}},"alicode-intl":{id:"alicode-intl",alias:"alicode-intl",name:"Alibaba Intl",icon:"cloud",color:"#FF6A00",textIcon:"ALi",website:"https://modelstudio.console.alibabacloud.com",notice:{apiKeyUrl:"https://modelstudio.console.alibabacloud.com/?apiKey=1"}},"xiaomi-mimo":{id:"xiaomi-mimo",alias:"mimo",name:"Xiaomi MiMo",icon:"smart_toy",color:"#FF6900",textIcon:"XM",website:"https://xiaomimimo.com",notice:{apiKeyUrl:"https://platform.xiaomimimo.com/console/api-keys"},serviceKinds:["llm","tts"],ttsConfig:{baseUrl:"https://api.xiaomimimo.com/v1/chat/completions",authType:"apikey",authHeader:"bearer",format:"xiaomi-mimo-tts",models:[{id:"mimo-v2.5-tts",name:"MiMo V2.5 TTS"}]}},"xiaomi-tokenplan":{id:"xiaomi-tokenplan",alias:"xmtp",name:"Xiaomi MiMo (Token Plan)",icon:"smart_toy",color:"#FF6700",textIcon:"XT",website:"https://mimo.xiaomi.com",notice:{text:"Xiaomi MiMo Token Plan subscription (API key starts with tp-). Token Plan keys are cluster-specific — select the region matching your subscription.",apiKeyUrl:"https://mimo.xiaomi.com"},hasProviderSpecificData:!0,regions:[{id:"sgp",label:"Singapore",baseUrl:"https://token-plan-sgp.xiaomimimo.com/v1"},{id:"cn",label:"China",baseUrl:"https://token-plan-cn.xiaomimimo.com/v1"},{id:"ams",label:"Europe",baseUrl:"https://token-plan-ams.xiaomimimo.com/v1"}],defaultRegion:"sgp"},"volcengine-ark":{id:"volcengine-ark",alias:"ark",name:"Volcengine Ark",icon:"cloud",color:"#1677FF",textIcon:"ARK",website:"https://ark.cn-beijing.volces.com",notice:{apiKeyUrl:"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey"}},openai:{id:"openai",alias:"openai",name:"OpenAI",icon:"auto_awesome",color:"#10A37F",textIcon:"OA",website:"https://platform.openai.com",notice:{apiKeyUrl:"https://platform.openai.com/api-keys"},serviceKinds:["llm","embedding","tts","stt","image","imageToText","webSearch"],thinkingConfig:{options:["auto","none","minimal","low","medium","high","xhigh","max"],defaultMode:"auto"},searchViaChat:{defaultModel:"gpt-4o-mini",pricingUrl:"https://openai.com/api/pricing"},ttsConfig:{baseUrl:"https://api.openai.com/v1/audio/speech",authType:"apikey",authHeader:"bearer",format:"openai",models:[{id:"tts-1",name:"TTS-1"},{id:"tts-1-hd",name:"TTS-1 HD"},{id:"gpt-4o-mini-tts",name:"GPT-4o Mini TTS"}]},sttConfig:{baseUrl:"https://api.openai.com/v1/audio/transcriptions",authType:"apikey",authHeader:"bearer",format:"openai",models:[{id:"whisper-1",name:"Whisper 1"},{id:"gpt-4o-transcribe",name:"GPT-4o Transcribe"},{id:"gpt-4o-mini-transcribe",name:"GPT-4o Mini Transcribe"}]},embeddingConfig:{baseUrl:"https://api.openai.com/v1/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"text-embedding-3-small",name:"Text Embedding 3 Small",dimensions:1536},{id:"text-embedding-3-large",name:"Text Embedding 3 Large",dimensions:3072},{id:"text-embedding-ada-002",name:"Text Embedding Ada 002",dimensions:1536}]}},"vercel-ai-gateway":{id:"vercel-ai-gateway",alias:"vercel",name:"Vercel AI Gateway",icon:"deployed_code",color:"#111827",textIcon:"VG",website:"https://vercel.com/ai-gateway",notice:{text:"Unified OpenAI-compatible endpoint from Vercel. Use your AI Gateway API key, then pick models with provider/model IDs like anthropic/claude-sonnet-4.6 or openai/gpt-5.4.",apiKeyUrl:"https://vercel.com/dashboard/~/ai-gateway"},passthroughModels:!0,serviceKinds:["llm","image"]},anthropic:{id:"anthropic",alias:"anthropic",name:"Anthropic",icon:"smart_toy",color:"#D97757",textIcon:"AN",website:"https://console.anthropic.com",notice:{apiKeyUrl:"https://console.anthropic.com/settings/keys"},serviceKinds:["llm","imageToText"]},"opencode-go":{id:"opencode-go",alias:"ocg",name:"OpenCode Go",icon:"terminal",color:"#E87040",textIcon:"OC",website:"https://opencode.ai/auth",notice:{text:"OpenCode Go subscription: $5/mo (then $10/mo). Access to Kimi, GLM, Qwen, MiMo, MiniMax models.",apiKeyUrl:"https://opencode.ai/auth"}},azure:{id:"azure",alias:"azure",name:"Azure OpenAI",icon:"cloud",color:"#0078D4",textIcon:"AZ",website:"https://azure.microsoft.com/en-us/products/ai-services/openai-service",notice:{apiKeyUrl:"https://portal.azure.com/#view/Microsoft_Azure_ProjectOxford/CognitiveServicesHub/~/OpenAI"},hasProviderSpecificData:!0},deepseek:{id:"deepseek",alias:"ds",name:"DeepSeek",icon:"bolt",color:"#4D6BFE",textIcon:"DS",website:"https://deepseek.com",notice:{apiKeyUrl:"https://platform.deepseek.com/api_keys"}},commandcode:{id:"commandcode",alias:"cmc",name:"Command Code",icon:"smart_toy",color:"#000000",textIcon:"CC",website:"https://commandcode.ai",notice:{text:"Use your CommandCode CLI API key (starts with user_...) from ~/.commandcode/auth.json or commandcode.ai/studio.",apiKeyUrl:"https://commandcode.ai/studio"}},groq:{id:"groq",alias:"groq",name:"Groq",icon:"speed",color:"#F55036",textIcon:"GQ",website:"https://groq.com",notice:{apiKeyUrl:"https://console.groq.com/keys"},serviceKinds:["llm","imageToText","stt"],sttConfig:{baseUrl:"https://api.groq.com/openai/v1/audio/transcriptions",authType:"apikey",authHeader:"bearer",format:"openai",models:[{id:"whisper-large-v3",name:"Whisper Large v3"},{id:"whisper-large-v3-turbo",name:"Whisper Large v3 Turbo"},{id:"distil-whisper-large-v3-en",name:"Distil Whisper Large v3 EN"}]}},mistral:{id:"mistral",alias:"mistral",name:"Mistral",icon:"air",color:"#FF7000",textIcon:"MI",website:"https://mistral.ai",notice:{apiKeyUrl:"https://console.mistral.ai/api-keys"},serviceKinds:["llm","imageToText","embedding"],embeddingConfig:{baseUrl:"https://api.mistral.ai/v1/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"mistral-embed",name:"Mistral Embed",dimensions:1024}]}},perplexity:{id:"perplexity",alias:"pplx",name:"Perplexity",icon:"search",color:"#20808D",textIcon:"PP",website:"https://www.perplexity.ai",notice:{apiKeyUrl:"https://www.perplexity.ai/settings/api"},serviceKinds:["llm","webSearch"],searchConfig:{baseUrl:"https://api.perplexity.ai/search",method:"POST",authType:"apikey",authHeader:"bearer",costPerQuery:.005,freeMonthlyQuota:0,searchTypes:["web"],defaultMaxResults:5,maxMaxResults:20,timeoutMs:1e4,cacheTTLMs:3e5}},"perplexity-agent":{id:"perplexity-agent",alias:"pa",name:"Perplexity Agent",icon:"travel_explore",color:"#20808D",textIcon:"PA",website:"https://www.perplexity.ai",notice:{text:"Perplexity Agent API exposes GPT, Claude, Gemini, Grok, GLM, Kimi, and Sonar models through one OpenAI-compatible Responses API.",apiKeyUrl:"https://www.perplexity.ai/settings/api"},passthroughModels:!0,modelsFetcher:{url:"https://api.perplexity.ai/v1/models",type:"openai"},serviceKinds:["llm","webSearch"],searchViaChat:{defaultModel:"perplexity/sonar",endpoint:"https://api.perplexity.ai/v1/responses",pricingUrl:"https://docs.perplexity.ai/docs/agent-api/models"}},clinepass:{id:"clinepass",alias:"clinepass",name:"ClinePass",icon:"vpn_key",color:"#5B9BD5",textIcon:"CP",website:"https://cline.bot",notice:{signupUrl:"https://app.cline.bot",apiKeyUrl:"https://app.cline.bot"},authModes:["oauth","apikey"],hasOAuth:!0},together:{id:"together",alias:"together",name:"Together AI",icon:"group_work",color:"#0F6FFF",textIcon:"TG",website:"https://www.together.ai",notice:{apiKeyUrl:"https://api.together.xyz/settings/api-keys"},serviceKinds:["llm","embedding"],embeddingConfig:{baseUrl:"https://api.together.xyz/v1/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"BAAI/bge-large-en-v1.5",name:"BGE Large EN v1.5",dimensions:1024},{id:"togethercomputer/m2-bert-80M-8k-retrieval",name:"M2 BERT 80M 8K",dimensions:768}]}},fireworks:{id:"fireworks",alias:"fireworks",name:"Fireworks AI",icon:"local_fire_department",color:"#7B2EF2",textIcon:"FW",website:"https://fireworks.ai",notice:{apiKeyUrl:"https://fireworks.ai/account/api-keys"},serviceKinds:["llm","embedding"],embeddingConfig:{baseUrl:"https://api.fireworks.ai/inference/v1/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"nomic-ai/nomic-embed-text-v1.5",name:"Nomic Embed Text v1.5",dimensions:768}]}},venice:{id:"venice",alias:"venice",name:"Venice AI",icon:"shield",color:"#DC2626",textIcon:"VE",website:"https://venice.ai",notice:{text:"OpenAI-compatible. Private inference + uncensored models (Venice Uncensored, GLM, Qwen, DeepSeek, Llama).",apiKeyUrl:"https://venice.ai/settings/api"},passthroughModels:!0,modelsFetcher:{url:"https://api.venice.ai/api/v1/models",type:"openai"},serviceKinds:["llm","embedding","image"],embeddingConfig:{baseUrl:"https://api.venice.ai/api/v1/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"text-embedding-3-large",name:"Text Embedding 3 Large",dimensions:3072},{id:"text-embedding-bge-m3",name:"BGE-M3 Embedding",dimensions:1024}]}},featherless:{id:"featherless",alias:"fl",name:"Featherless",icon:"flutter_dash",color:"#111827",textIcon:"FL",website:"https://featherless.ai",notice:{apiKeyUrl:"https://featherless.ai/account/api-keys"},passthroughModels:!0,modelsFetcher:{url:"https://api.featherless.ai/v1/models",type:"openai"}},cerebras:{id:"cerebras",alias:"cerebras",name:"Cerebras",icon:"memory",color:"#FF4F00",textIcon:"CB",website:"https://www.cerebras.ai",notice:{apiKeyUrl:"https://cloud.cerebras.ai/platform"}},cohere:{id:"cohere",alias:"cohere",name:"Cohere",icon:"hub",color:"#39594D",textIcon:"CO",website:"https://cohere.com",notice:{apiKeyUrl:"https://dashboard.cohere.com/api-keys"}},nebius:{id:"nebius",alias:"nebius",name:"Nebius AI",icon:"cloud",color:"#6C5CE7",textIcon:"NB",website:"https://nebius.com",notice:{apiKeyUrl:"https://studio.nebius.com/settings/api-keys"},serviceKinds:["llm","embedding"],embeddingConfig:{baseUrl:"https://api.tokenfactory.nebius.com/v1/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"Qwen/Qwen3-Embedding-8B",name:"Qwen3 Embedding 8B",dimensions:4096}]}},siliconflow:{id:"siliconflow",alias:"siliconflow",name:"SiliconFlow",icon:"cloud_queue",color:"#5B6EF5",textIcon:"SF",website:"https://cloud.siliconflow.com",notice:{apiKeyUrl:"https://cloud.siliconflow.com/account/ak"}},hyperbolic:{id:"hyperbolic",alias:"hyp",name:"Hyperbolic",icon:"bolt",color:"#00D4FF",textIcon:"HY",website:"https://hyperbolic.xyz",notice:{apiKeyUrl:"https://app.hyperbolic.xyz/settings"},serviceKinds:["llm","tts"],ttsConfig:{baseUrl:"https://api.hyperbolic.xyz/v1/audio/generation",authType:"apikey",authHeader:"bearer",format:"hyperbolic",models:[{id:"melo-tts",name:"Melo TTS"}]}},deepgram:{id:"deepgram",alias:"dg",name:"Deepgram",icon:"mic",color:"#13EF93",textIcon:"DG",website:"https://deepgram.com",notice:{text:"$200 free credit on signup (no card required). Aura-1: $0.015/1k chars, Aura-2: $0.030/1k chars (Pay-As-You-Go).",apiKeyUrl:"https://console.deepgram.com/api-keys"},serviceKinds:["stt","imageToText","tts"],ttsConfig:{baseUrl:"https://api.deepgram.com/v1/speak",authType:"apikey",authHeader:"token",format:"deepgram",models:[]},sttConfig:{baseUrl:"https://api.deepgram.com/v1/listen",authType:"apikey",authHeader:"token",format:"deepgram",models:[{id:"nova-3",name:"Nova 3"},{id:"nova-2",name:"Nova 2"},{id:"whisper-large",name:"Whisper Large"}]}},assemblyai:{id:"assemblyai",alias:"aai",name:"AssemblyAI",icon:"record_voice_over",color:"#0062FF",textIcon:"AA",website:"https://assemblyai.com",notice:{apiKeyUrl:"https://www.assemblyai.com/app/api-keys"},serviceKinds:["stt"],sttConfig:{baseUrl:"https://api.assemblyai.com/v2/transcript",authType:"apikey",authHeader:"bearer",format:"assemblyai",async:!0,models:[{id:"universal-3-pro",name:"Universal 3 Pro"},{id:"universal-2",name:"Universal 2"}]}},nanobanana:{id:"nanobanana",alias:"nb",name:"NanoBanana API",icon:"extension",color:"#FFD700",textIcon:"\uD83C\uDF4C",website:"https://nanobananaapi.ai",notice:{text:"3rd-party proxy for Google Nano Banana (Gemini 2.5/3 Flash Image). For official, use Gemini provider.",apiKeyUrl:"https://nanobananaapi.ai/dashboard"},serviceKinds:["image"]},elevenlabs:{id:"elevenlabs",alias:"el",name:"ElevenLabs",icon:"record_voice_over",color:"#6C47FF",textIcon:"EL",website:"https://elevenlabs.io",notice:{apiKeyUrl:"https://elevenlabs.io/app/settings/api-keys"},serviceKinds:["tts"],ttsConfig:{baseUrl:"https://api.elevenlabs.io/v1/text-to-speech",authType:"apikey",authHeader:"xi-api-key",format:"elevenlabs",models:[{id:"eleven_multilingual_v2",name:"Eleven Multilingual v2"},{id:"eleven_turbo_v2_5",name:"Eleven Turbo v2.5"}]}},"fish-audio":{id:"fish-audio",alias:"fish",name:"Fish Audio",icon:"graphic_eq",color:"#00C2FF",textIcon:"FA",website:"https://fish.audio",notice:{apiKeyUrl:"https://fish.audio/app/api-keys/"},serviceKinds:["tts"],ttsConfig:{baseUrl:"https://api.fish.audio/v1/tts",authType:"apikey",authHeader:"bearer",format:"fish-audio",models:[{id:"s2.1-pro-free",name:"S2.1 Pro Free"},{id:"s2.1-pro",name:"S2.1 Pro"},{id:"s2-pro",name:"S2 Pro"},{id:"s1",name:"S1"}]}},cartesia:{id:"cartesia",alias:"cartesia",name:"Cartesia",icon:"spatial_audio",color:"#FF4F8B",textIcon:"CA",website:"https://cartesia.ai",notice:{apiKeyUrl:"https://play.cartesia.ai/keys"},serviceKinds:["tts"],hidden:!0,ttsConfig:{baseUrl:"https://api.cartesia.ai/tts/bytes",authType:"apikey",authHeader:"x-api-key",format:"cartesia",models:[{id:"sonic-2",name:"Sonic 2"},{id:"sonic-3",name:"Sonic 3"}]}},playht:{id:"playht",alias:"playht",name:"PlayHT",icon:"play_circle",color:"#00B4D8",textIcon:"PH",website:"https://play.ht",notice:{apiKeyUrl:"https://play.ht/studio/api-access"},serviceKinds:["tts"],hidden:!0,ttsConfig:{baseUrl:"https://api.play.ht/api/v2/tts/stream",authType:"apikey",authHeader:"playht",format:"playht",models:[{id:"PlayDialog",name:"PlayDialog"},{id:"Play3.0-mini",name:"Play 3.0 Mini"}]}},"local-device":{id:"local-device",alias:"local-device",name:"Local Device",icon:"speaker",color:"#64748B",textIcon:"LD",mediaPriority:5,serviceKinds:["tts"],noAuth:!0,ttsConfig:{baseUrl:"local-device",authType:"none",authHeader:"none",format:"local-device",models:[]}},"google-tts":{id:"google-tts",alias:"google-tts",name:"Google TTS",icon:"record_voice_over",color:"#4285F4",textIcon:"GT",mediaPriority:5,serviceKinds:["tts"],noAuth:!0,ttsConfig:{baseUrl:"google-tts",authType:"none",authHeader:"none",format:"google-tts",models:[]}},"edge-tts":{id:"edge-tts",alias:"edge-tts",name:"Edge TTS",icon:"record_voice_over",color:"#0078D4",textIcon:"ET",mediaPriority:5,serviceKinds:["tts"],noAuth:!0,ttsConfig:{baseUrl:"edge-tts",authType:"none",authHeader:"none",format:"edge-tts",models:[]}},coqui:{id:"coqui",alias:"coqui",name:"Coqui TTS",icon:"record_voice_over",color:"#10B981",textIcon:"CQ",website:"https://github.com/coqui-ai/TTS",serviceKinds:["tts"],hidden:!0,noAuth:!0,ttsConfig:{baseUrl:"http://localhost:5002/api/tts",authType:"none",authHeader:"none",format:"coqui",models:[{id:"tts_models/en/ljspeech/tacotron2-DDC",name:"Tacotron2 DDC (LJSpeech)"}]}},tortoise:{id:"tortoise",alias:"tortoise",name:"Tortoise TTS",icon:"record_voice_over",color:"#7C3AED",textIcon:"TT",website:"https://github.com/neonbjb/tortoise-tts",serviceKinds:["tts"],hidden:!0,noAuth:!0,ttsConfig:{baseUrl:"http://localhost:5000/api/tts",authType:"none",authHeader:"none",format:"tortoise",models:[{id:"tortoise-v2",name:"Tortoise v2"}]}},inworld:{id:"inworld",alias:"inworld",name:"Inworld TTS",icon:"record_voice_over",color:"#FF6B6B",textIcon:"IW",website:"https://inworld.ai",notice:{text:"Free tier: 40 minutes/month TTS. Paid: TTS-1.5 Mini $0.01/min ($15/1M chars), TTS-1.5 Max $0.025/min ($30/1M chars). 270+ voices, 15 languages.",apiKeyUrl:"https://platform.inworld.ai/api-keys"},serviceKinds:["tts"],ttsConfig:{baseUrl:"https://api.inworld.ai/tts/v1/voice",authType:"apikey",authHeader:"basic",format:"inworld",models:[{id:"inworld-tts-1.5-mini",name:"Inworld TTS 1.5 Mini ($0.01/min)"},{id:"inworld-tts-1.5-max",name:"Inworld TTS 1.5 Max ($0.025/min)"}]}},"voyage-ai":{id:"voyage-ai",alias:"voyage",name:"Voyage AI",icon:"data_array",color:"#0EA5E9",textIcon:"VG",website:"https://www.voyageai.com",notice:{apiKeyUrl:"https://dash.voyageai.com/api-keys"},serviceKinds:["embedding"],embeddingConfig:{baseUrl:"https://api.voyageai.com/v1/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"voyage-3-large",name:"Voyage 3 Large",dimensions:1024},{id:"voyage-3.5",name:"Voyage 3.5",dimensions:1024},{id:"voyage-3.5-lite",name:"Voyage 3.5 Lite",dimensions:1024},{id:"voyage-code-3",name:"Voyage Code 3",dimensions:1024},{id:"voyage-finance-2",name:"Voyage Finance 2",dimensions:1024},{id:"voyage-law-2",name:"Voyage Law 2",dimensions:1024},{id:"voyage-multilingual-2",name:"Voyage Multilingual 2",dimensions:1024}]}},sdwebui:{id:"sdwebui",alias:"sdwebui",name:"SD WebUI",icon:"brush",color:"#FF7043",textIcon:"SD",website:"https://github.com/AUTOMATIC1111/stable-diffusion-webui",serviceKinds:["image"]},comfyui:{id:"comfyui",alias:"comfyui",name:"ComfyUI",icon:"account_tree",color:"#4CAF50",textIcon:"CF",website:"https://github.com/comfyanonymous/ComfyUI",serviceKinds:["image"]},huggingface:{id:"huggingface",alias:"hf",name:"HuggingFace",icon:"face",color:"#FFD21E",textIcon:"HF",website:"https://huggingface.co",notice:{apiKeyUrl:"https://huggingface.co/settings/tokens"},serviceKinds:["image","imageToText","tts","stt"],hiddenKinds:["tts"],ttsConfig:{baseUrl:"https://api-inference.huggingface.co/models",authType:"apikey",authHeader:"bearer",format:"huggingface-tts",models:[{id:"facebook/mms-tts-eng",name:"MMS TTS English"},{id:"microsoft/speecht5_tts",name:"SpeechT5 TTS"}]},sttConfig:{baseUrl:"https://api-inference.huggingface.co/models",authType:"apikey",authHeader:"bearer",format:"huggingface-asr",models:[{id:"openai/whisper-large-v3",name:"Whisper Large v3 (HF)"},{id:"openai/whisper-small",name:"Whisper Small (HF)"}]}},blackbox:{id:"blackbox",alias:"bb",name:"Blackbox AI",icon:"smart_toy",color:"#5B5FEF",textIcon:"BB",website:"https://blackbox.ai",notice:{apiKeyUrl:"https://www.blackbox.ai/api-management"},serviceKinds:["llm"]},chutes:{id:"chutes",alias:"ch",name:"Chutes AI",icon:"water_drop",color:"#ffffffff",textIcon:"CH",website:"https://chutes.ai",notice:{apiKeyUrl:"https://chutes.ai/app/api"}},"ollama-local":{id:"ollama-local",alias:"ollama-local",name:"Ollama Local",icon:"cloud",color:"#ffffffff",textIcon:"OL",website:"https://ollama.com"},"vertex-partner":{id:"vertex-partner",alias:"vxp",name:"Vertex Partner",icon:"cloud",color:"#34A853",textIcon:"VP",website:"https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-partner-models",notice:{apiKeyUrl:"https://console.cloud.google.com/iam-admin/serviceaccounts"}},tavily:{id:"tavily",alias:"tavily",name:"Tavily",icon:"search",color:"#5B21B6",textIcon:"TV",website:"https://tavily.com",notice:{apiKeyUrl:"https://app.tavily.com/home"},serviceKinds:["webSearch","webFetch"],searchConfig:{baseUrl:"https://api.tavily.com/search",method:"POST",authType:"apikey",authHeader:"bearer",costPerQuery:.008,freeMonthlyQuota:1e3,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:20,timeoutMs:1e4,cacheTTLMs:3e5},fetchConfig:{baseUrl:"https://api.tavily.com/extract",method:"POST",authType:"apikey",authHeader:"bearer",costPerQuery:.008,freeMonthlyQuota:1e3,formats:["markdown","text"],maxCharacters:1e5,timeoutMs:15e3}},"brave-search":{id:"brave-search",alias:"brave",name:"Brave Search",icon:"travel_explore",color:"#FB542B",textIcon:"BR",website:"https://brave.com/search/api",notice:{apiKeyUrl:"https://api-dashboard.search.brave.com/app/keys"},serviceKinds:["webSearch"],searchConfig:{baseUrl:"https://api.search.brave.com/res/v1",method:"GET",authType:"apikey",authHeader:"x-subscription-token",costPerQuery:.005,freeMonthlyQuota:1e3,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:20,timeoutMs:1e4,cacheTTLMs:3e5}},serper:{id:"serper",alias:"serper",name:"Serper",icon:"search",color:"#4F46E5",textIcon:"SP",website:"https://serper.dev",notice:{apiKeyUrl:"https://serper.dev/api-key"},serviceKinds:["webSearch"],searchConfig:{baseUrl:"https://google.serper.dev",method:"POST",authType:"apikey",authHeader:"x-api-key",costPerQuery:.001,freeMonthlyQuota:2500,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:100,timeoutMs:1e4,cacheTTLMs:3e5}},exa:{id:"exa",alias:"exa",name:"Exa",icon:"manage_search",color:"#2563EB",textIcon:"EX",website:"https://exa.ai",notice:{apiKeyUrl:"https://dashboard.exa.ai/api-keys"},serviceKinds:["webSearch","webFetch"],searchConfig:{baseUrl:"https://api.exa.ai/search",method:"POST",authType:"apikey",authHeader:"x-api-key",costPerQuery:.007,freeMonthlyQuota:1e3,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:100,timeoutMs:1e4,cacheTTLMs:3e5},fetchConfig:{baseUrl:"https://api.exa.ai/contents",method:"POST",authType:"apikey",authHeader:"x-api-key",costPerQuery:.001,freeMonthlyQuota:1e3,formats:["text","markdown"],maxCharacters:1e5,timeoutMs:15e3}},searxng:{id:"searxng",alias:"searxng",name:"SearXNG",icon:"saved_search",color:"#3B82F6",textIcon:"SX",website:"https://docs.searxng.org",serviceKinds:["webSearch"],noAuth:!0,searchConfig:{baseUrl:"http://localhost:8888/search",method:"GET",authType:"none",authHeader:"none",costPerQuery:0,freeMonthlyQuota:999999,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:50,timeoutMs:1e4,cacheTTLMs:18e4}},"google-pse":{id:"google-pse",alias:"gpse",name:"Google PSE",icon:"search",color:"#4285F4",textIcon:"GP",website:"https://programmablesearchengine.google.com",notice:{apiKeyUrl:"https://programmablesearchengine.google.com/controlpanel/create"},serviceKinds:["webSearch"],searchConfig:{baseUrl:"https://www.googleapis.com/customsearch/v1",method:"GET",authType:"apikey",authHeader:"key",costPerQuery:.005,freeMonthlyQuota:3e3,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:10,timeoutMs:1e4,cacheTTLMs:3e5}},linkup:{id:"linkup",alias:"linkup",name:"Linkup",icon:"link",color:"#0EA5E9",textIcon:"LK",website:"https://linkup.so",notice:{apiKeyUrl:"https://app.linkup.so/api-keys"},serviceKinds:["webSearch"],searchConfig:{baseUrl:"https://api.linkup.so/v1/search",method:"POST",authType:"apikey",authHeader:"bearer",costPerQuery:.005,freeMonthlyQuota:1e3,searchTypes:["web"],defaultMaxResults:5,maxMaxResults:50,timeoutMs:1e4,cacheTTLMs:3e5}},searchapi:{id:"searchapi",alias:"searchapi",name:"SearchAPI",icon:"search",color:"#0EA5A4",textIcon:"SA",website:"https://www.searchapi.io",notice:{apiKeyUrl:"https://www.searchapi.io/dashboard"},serviceKinds:["webSearch"],searchConfig:{baseUrl:"https://www.searchapi.io/api/v1/search",method:"GET",authType:"apikey",authHeader:"api_key",costPerQuery:.004,freeMonthlyQuota:100,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:100,timeoutMs:1e4,cacheTTLMs:3e5}},youcom:{id:"youcom",alias:"youcom",name:"You.com Search",icon:"search",color:"#7C3AED",textIcon:"YC",website:"https://you.com",notice:{apiKeyUrl:"https://api.you.com"},serviceKinds:["webSearch"],searchConfig:{baseUrl:"https://ydc-index.io/v1/search",method:"GET",authType:"apikey",authHeader:"x-api-key",costPerQuery:.005,freeMonthlyQuota:0,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:100,timeoutMs:1e4,cacheTTLMs:3e5}},firecrawl:{id:"firecrawl",alias:"firecrawl",name:"Firecrawl",icon:"local_fire_department",color:"#F59E0B",textIcon:"FC",website:"https://firecrawl.dev",notice:{apiKeyUrl:"https://www.firecrawl.dev/app/api-keys"},serviceKinds:["webFetch"],fetchConfig:{baseUrl:"https://api.firecrawl.dev/v1/scrape",method:"POST",authType:"apikey",authHeader:"bearer",costPerQuery:.002,freeMonthlyQuota:500,formats:["markdown","html","text"],maxCharacters:2e5,timeoutMs:3e4}},"fal-ai":{id:"fal-ai",alias:"fal",name:"Fal.ai",icon:"image",color:"#2563EB",textIcon:"FL",website:"https://fal.ai",notice:{apiKeyUrl:"https://fal.ai/dashboard/keys"},serviceKinds:["image"],imageConfig:{baseUrl:"https://api.fal.ai/v1/models?limit=1",method:"GET",authType:"apikey",authHeader:"key"}},"stability-ai":{id:"stability-ai",alias:"stability",name:"Stability AI",icon:"image",color:"#8B5CF6",textIcon:"SA",website:"https://stability.ai",notice:{apiKeyUrl:"https://platform.stability.ai/account/keys"},serviceKinds:["image"],imageConfig:{baseUrl:"https://api.stability.ai/v1/user/account",method:"GET",authType:"apikey",authHeader:"bearer"}},"black-forest-labs":{id:"black-forest-labs",alias:"bfl",name:"Black Forest Labs",icon:"image",color:"#111827",textIcon:"BF",website:"https://blackforestlabs.ai",notice:{apiKeyUrl:"https://api.bfl.ai"},serviceKinds:["image"],imageConfig:{baseUrl:"https://api.bfl.ai/v1/get_result?id=ping",method:"GET",authType:"apikey",authHeader:"x-key"}},recraft:{id:"recraft",alias:"recraft",name:"Recraft",icon:"image",color:"#EC4899",textIcon:"RC",website:"https://recraft.ai",notice:{apiKeyUrl:"https://www.recraft.ai/profile/api"},serviceKinds:["image"],imageConfig:{baseUrl:"https://external.api.recraft.ai/v1/users/me",method:"GET",authType:"apikey",authHeader:"bearer"}},topaz:{id:"topaz",alias:"topaz",name:"Topaz",icon:"image",color:"#059669",textIcon:"TP",website:"https://topazlabs.com",notice:{apiKeyUrl:"https://topazlabs.com/account"},serviceKinds:["image"]},runwayml:{id:"runwayml",alias:"runway",name:"Runway ML",icon:"movie",color:"#000000",textIcon:"RW",website:"https://runwayml.com",notice:{apiKeyUrl:"https://dev.runwayml.com"},serviceKinds:["image","video"],imageConfig:{baseUrl:"https://api.dev.runwayml.com/v1/organization",method:"GET",authType:"apikey",authHeader:"bearer",extraHeaders:{"X-Runway-Version":"2024-11-06"}}},"aws-polly":{id:"aws-polly",alias:"polly",name:"AWS Polly",icon:"record_voice_over",color:"#FF9900",textIcon:"PL",website:"https://aws.amazon.com/polly/",notice:{text:"Use AWS Secret Access Key as API key; set providerSpecificData.accessKeyId and optional region.",apiKeyUrl:"https://console.aws.amazon.com/iam/home#/security_credentials"},serviceKinds:["tts"],hasProviderSpecificData:!0,ttsConfig:{baseUrl:"https://polly.{region}.amazonaws.com/v1/speech",authType:"apikey",authHeader:"aws-sigv4",format:"aws-polly",models:[{id:"standard",name:"Standard"},{id:"neural",name:"Neural"},{id:"long-form",name:"Long-form"},{id:"generative",name:"Generative"}]}},"jina-ai":{id:"jina-ai",alias:"jina",name:"Jina AI",icon:"blur_on",color:"#2563EB",textIcon:"JA",website:"https://jina.ai",notice:{text:"10M free tokens on signup (non-commercial; Jina terms apply).",apiKeyUrl:"https://jina.ai/?sui=apikey"},serviceKinds:["embedding"],embeddingConfig:{baseUrl:"https://api.jina.ai/v1/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"jina-embeddings-v3",name:"Jina Embeddings v3",dimensions:1024},{id:"jina-embeddings-v2-base-en",name:"Jina Embeddings v2 Base EN",dimensions:768},{id:"jina-embeddings-v2-base-code",name:"Jina Embeddings v2 Base Code",dimensions:768}]}},"jina-reader":{id:"jina-reader",alias:"jina",name:"Jina Reader",icon:"menu_book",color:"#000000",textIcon:"JR",website:"https://jina.ai/reader",notice:{apiKeyUrl:"https://jina.ai/?sui=apikey"},serviceKinds:["webFetch"],fetchConfig:{baseUrl:"https://r.jina.ai",method:"GET",authType:"apikey",authHeader:"bearer",costPerQuery:0,freeMonthlyQuota:1e6,formats:["markdown","text","html"],maxCharacters:2e5,timeoutMs:3e4}}},u={kiro:{id:"kiro",alias:"kr",name:"Kiro AI",icon:"psychology_alt",color:"#FF6B35",deprecated:!0,deprecationNotice:o,website:"https://kiro.dev",notice:{signupUrl:"https://kiro.dev"},authModes:["oauth","apikey"]},"gemini-cli":{id:"gemini-cli",alias:"gc",name:"Gemini CLI",icon:"terminal",color:"#4285F4",deprecated:!0,deprecationNotice:o,website:"https://github.com/google-gemini/gemini-cli",notice:{signupUrl:"https://github.com/google-gemini/gemini-cli"}},codebuddy:{id:"codebuddy",alias:"cb",name:"CodeBuddy",icon:"smart_toy",color:"#006EFF",deprecated:!0,deprecationNotice:o,website:"https://www.codebuddy.ai",notice:{signupUrl:"https://www.codebuddy.ai/login",apiKeyUrl:"https://www.codebuddy.ai/profile"},authModes:["oauth","apikey"]},"codebuddy-cn":{id:"codebuddy-cn",alias:"cb-cn",name:"CodeBuddy CN",icon:"smart_toy",color:"#1E40AF",deprecated:!0,deprecationNotice:o,website:"https://www.codebuddy.cn",notice:{signupUrl:"https://copilot.tencent.com",apiKeyUrl:"https://copilot.tencent.com/profile/"},authModes:["oauth","apikey"]},qoder:{id:"qoder",alias:"qd",name:"Qoder",icon:"water_drop",color:"#EC4899",deprecated:!0,deprecationNotice:o,website:"https://qoder.com",notice:{signupUrl:"https://qoder.com",apiKeyUrl:"https://qoder.com/account"},authModes:["oauth","apikey"]},opencode:{id:"opencode",alias:"oc",name:"OpenCode Free",icon:"terminal",color:"#E87040",textIcon:"OC",noAuth:!0,passthroughModels:!0,modelsFetcher:{url:"https://opencode.ai/zen/v1/models",type:"opencode-free"}},"mimo-free":{id:"mimo-free",alias:"mmf",name:"MiMo Code Free",icon:"smart_toy",color:"#FF6900",textIcon:"MF",noAuth:!0,hasFree:!0,passthroughModels:!0,website:"https://xiaomimimo.com",notice:{text:"Free Xiaomi MiMo Code endpoint (no API key). Uses bootstrap JWT + Chrome UA. May rate-limit or break if upstream anti-abuse changes."}},...q,...s,...t,"grok-web":{id:"grok-web",alias:"gw",name:"Grok Web (Subscription)",icon:"auto_awesome",color:"#1DA1F2",textIcon:"GW",website:"https://grok.com",authType:"cookie",authHint:"Paste your sso= cookie value from grok.com",passthroughModels:!0,serviceKinds:["llm"]},"perplexity-web":{id:"perplexity-web",alias:"pw",name:"Perplexity Web (Pro/Max)",icon:"search",color:"#20808D",textIcon:"PW",website:"https://www.perplexity.ai",authType:"cookie",authHint:"Paste your __Secure-next-auth.session-token cookie value from perplexity.ai",serviceKinds:["llm"]},"notion-ai":{id:"notion-ai",alias:"na",name:"Notion AI (Experimental)",icon:"auto_awesome",color:"#111111",textIcon:"NA",website:"https://www.notion.so",authType:"cookie",authHint:"Paste the token_v2 cookie (or full Cookie header) from your own Notion session. Space ID and user ID are optional and can be auto-resolved.",serviceKinds:["llm"]}};Object.values(u).reduce((a,b)=>{for(let c of(a[b.alias]=b.id,b.aliases||[]))a[c]=b.id;return a},{}),Object.values(u).reduce((a,b)=>(a[b.id]=b.alias,a),{});let v=["glm","glm-cn","minimax","minimax-cn","codebuddy","codebuddy-cn","qoder","cloudflare-ai","xai","clinepass","blackbox","ollama","kimi","deepseek","kiro"]},24081:(a,b,c)=>{"use strict";c.d(b,{cK:()=>k,y5:()=>l});var d=c(62239);global._dbAdapter||(global._dbAdapter={instance:null,initPromise:null,closePromise:null,logged:!1});let e=global._dbAdapter;async function f(){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 g(){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 h(){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 i(){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 j(){(0,d.Jh)();let a=await f();if(a||(a=await h()),a||(a=await g()),a||(a=await i()),!a)throw Error("[DB] No SQLite driver available (bun/node/better/sql.js all failed)");e.logged||(console.log(`[DB] Driver: ${a.driver} | file: ${d.AL}`),e.logged=!0);try{let{runMigrationOnce:b}=await c.e(5800).then(c.bind(c,85800));await b(a);let{runStartupMaintenanceOnce:d}=await c.e(3696).then(c.bind(c,33696));return d(a),a}catch(b){try{await a.close?.()}catch(a){console.warn(`[DB] failed to close partially initialized adapter: ${a.message}`)}throw b}}async function k(){if(e.instance)return e.instance;if(!e.initPromise){let a=j().then(a=>(e.instance=a,a)).catch(b=>{throw e.initPromise===a&&(e.initPromise=null),b});e.initPromise=a}return e.initPromise}async function l(){return e.closePromise||(e.closePromise=(async()=>{try{let{stopStartupMaintenance:a}=await c.e(3696).then(c.bind(c,33696));a();let b=e.instance||(e.initPromise?await e.initPromise:null);await b?.close?.()}finally{e.instance=null,e.initPromise=null,e.closePromise=null}})()),e.closePromise}"closePromise"in e||(e.closePromise=null)},24214:a=>{"use strict";function b(a,b,c,d,e,f,g){let h=new Date(Date.UTC(a,b,c,d,e,f));return a>=0&&a<=99&&h.setUTCFullYear(a),h.getUTCFullYear()===a&&h.getUTCMonth()===b&&h.getUTCDate()===c&&h.getUTCHours()===d&&h.getUTCMinutes()===e&&h.getUTCSeconds()===f&&h.getUTCDay()===g?h:void 0}a.exports={parseHttpDate:function(a){switch(a[3]){case",":return function(a){if(29!==a.length||" "!==a[4]||" "!==a[7]||" "!==a[11]||" "!==a[16]||":"!==a[19]||":"!==a[22]||" "!==a[25]||"G"!==a[26]||"M"!==a[27]||"T"!==a[28])return;let c=-1;if("S"===a[0]&&"u"===a[1]&&"n"===a[2])c=0;else if("M"===a[0]&&"o"===a[1]&&"n"===a[2])c=1;else if("T"===a[0]&&"u"===a[1]&&"e"===a[2])c=2;else if("W"===a[0]&&"e"===a[1]&&"d"===a[2])c=3;else if("T"===a[0]&&"h"===a[1]&&"u"===a[2])c=4;else if("F"===a[0]&&"r"===a[1]&&"i"===a[2])c=5;else{if("S"!==a[0]||"a"!==a[1]||"t"!==a[2])return;c=6}let d=0;if("0"===a[5]){let b=a.charCodeAt(6);if(b<49||b>57)return;d=b-48}else{let b=a.charCodeAt(5);if(b<49||b>51)return;let c=a.charCodeAt(6);if(c<48||c>57)return;d=(b-48)*10+(c-48)}let e=-1;if("J"===a[8]&&"a"===a[9]&&"n"===a[10])e=0;else if("F"===a[8]&&"e"===a[9]&&"b"===a[10])e=1;else if("M"===a[8]&&"a"===a[9])if("r"===a[10])e=2;else{if("y"!==a[10])return;e=4}else if("J"===a[8])if("a"===a[9]&&"n"===a[10])e=0;else if("u"!==a[9])return;else if("n"===a[10])e=5;else{if("l"!==a[10])return;e=6}else if("A"===a[8])if("p"===a[9]&&"r"===a[10])e=3;else{if("u"!==a[9]||"g"!==a[10])return;e=7}else if("S"===a[8]&&"e"===a[9]&&"p"===a[10])e=8;else if("O"===a[8]&&"c"===a[9]&&"t"===a[10])e=9;else if("N"===a[8]&&"o"===a[9]&&"v"===a[10])e=10;else{if("D"!==a[8]||"e"!==a[9]||"c"!==a[10])return;e=11}let f=a.charCodeAt(12);if(f<48||f>57)return;let g=a.charCodeAt(13);if(g<48||g>57)return;let h=a.charCodeAt(14);if(h<48||h>57)return;let i=a.charCodeAt(15);if(i<48||i>57)return;let j=0;if("0"===a[17]){let b=a.charCodeAt(18);if(b<48||b>57)return;j=b-48}else{let b=a.charCodeAt(17);if(b<48||b>50)return;let c=a.charCodeAt(18);if(c<48||c>57||50===b&&c>51)return;j=(b-48)*10+(c-48)}let k=0;if("0"===a[20]){let b=a.charCodeAt(21);if(b<48||b>57)return;k=b-48}else{let b=a.charCodeAt(20);if(b<48||b>53)return;let c=a.charCodeAt(21);if(c<48||c>57)return;k=(b-48)*10+(c-48)}let l=0;if("0"===a[23]){let b=a.charCodeAt(24);if(b<48||b>57)return;l=b-48}else{let b=a.charCodeAt(23);if(b<48||b>53)return;let c=a.charCodeAt(24);if(c<48||c>57)return;l=(b-48)*10+(c-48)}return b((f-48)*1e3+(g-48)*100+(h-48)*10+(i-48),e,d,j,k,l,c)}(a);case" ":return function(a){if(24!==a.length||" "!==a[7]||" "!==a[10]||" "!==a[19])return;let c=-1;if("S"===a[0]&&"u"===a[1]&&"n"===a[2])c=0;else if("M"===a[0]&&"o"===a[1]&&"n"===a[2])c=1;else if("T"===a[0]&&"u"===a[1]&&"e"===a[2])c=2;else if("W"===a[0]&&"e"===a[1]&&"d"===a[2])c=3;else if("T"===a[0]&&"h"===a[1]&&"u"===a[2])c=4;else if("F"===a[0]&&"r"===a[1]&&"i"===a[2])c=5;else{if("S"!==a[0]||"a"!==a[1]||"t"!==a[2])return;c=6}let d=-1;if("J"===a[4]&&"a"===a[5]&&"n"===a[6])d=0;else if("F"===a[4]&&"e"===a[5]&&"b"===a[6])d=1;else if("M"===a[4]&&"a"===a[5])if("r"===a[6])d=2;else{if("y"!==a[6])return;d=4}else if("J"===a[4])if("a"===a[5]&&"n"===a[6])d=0;else if("u"!==a[5])return;else if("n"===a[6])d=5;else{if("l"!==a[6])return;d=6}else if("A"===a[4])if("p"===a[5]&&"r"===a[6])d=3;else{if("u"!==a[5]||"g"!==a[6])return;d=7}else if("S"===a[4]&&"e"===a[5]&&"p"===a[6])d=8;else if("O"===a[4]&&"c"===a[5]&&"t"===a[6])d=9;else if("N"===a[4]&&"o"===a[5]&&"v"===a[6])d=10;else{if("D"!==a[4]||"e"!==a[5]||"c"!==a[6])return;d=11}let e=0;if(" "===a[8]){let b=a.charCodeAt(9);if(b<49||b>57)return;e=b-48}else{let b=a.charCodeAt(8);if(b<49||b>51)return;let c=a.charCodeAt(9);if(c<48||c>57)return;e=(b-48)*10+(c-48)}let f=0;if("0"===a[11]){let b=a.charCodeAt(12);if(b<48||b>57)return;f=b-48}else{let b=a.charCodeAt(11);if(b<48||b>50)return;let c=a.charCodeAt(12);if(c<48||c>57||50===b&&c>51)return;f=(b-48)*10+(c-48)}let g=0;if("0"===a[14]){let b=a.charCodeAt(15);if(b<48||b>57)return;g=b-48}else{let b=a.charCodeAt(14);if(b<48||b>53)return;let c=a.charCodeAt(15);if(c<48||c>57)return;g=(b-48)*10+(c-48)}let h=0;if("0"===a[17]){let b=a.charCodeAt(18);if(b<48||b>57)return;h=b-48}else{let b=a.charCodeAt(17);if(b<48||b>53)return;let c=a.charCodeAt(18);if(c<48||c>57)return;h=(b-48)*10+(c-48)}let i=a.charCodeAt(20);if(i<48||i>57)return;let j=a.charCodeAt(21);if(j<48||j>57)return;let k=a.charCodeAt(22);if(k<48||k>57)return;let l=a.charCodeAt(23);if(!(l<48)&&!(l>57))return b((i-48)*1e3+(j-48)*100+(k-48)*10+(l-48),d,e,f,g,h,c)}(a);default:return function(a){let c=-1,d=-1;if("S"===a[0])"u"===a[1]&&"n"===a[2]&&"d"===a[3]&&"a"===a[4]&&"y"===a[5]?(d=0,c=6):"a"===a[1]&&"t"===a[2]&&"u"===a[3]&&"r"===a[4]&&"d"===a[5]&&"a"===a[6]&&"y"===a[7]&&(d=6,c=8);else if("M"===a[0]&&"o"===a[1]&&"n"===a[2]&&"d"===a[3]&&"a"===a[4]&&"y"===a[5])d=1,c=6;else if("T"===a[0])"u"===a[1]&&"e"===a[2]&&"s"===a[3]&&"d"===a[4]&&"a"===a[5]&&"y"===a[6]?(d=2,c=7):"h"===a[1]&&"u"===a[2]&&"r"===a[3]&&"s"===a[4]&&"d"===a[5]&&"a"===a[6]&&"y"===a[7]&&(d=4,c=8);else if("W"===a[0]&&"e"===a[1]&&"d"===a[2]&&"n"===a[3]&&"e"===a[4]&&"s"===a[5]&&"d"===a[6]&&"a"===a[7]&&"y"===a[8])d=3,c=9;else{if("F"!==a[0]||"r"!==a[1]||"i"!==a[2]||"d"!==a[3]||"a"!==a[4]||"y"!==a[5])return;d=5,c=6}if(","!==a[c]||a.length-c-1!=23||" "!==a[c+1]||"-"!==a[c+4]||"-"!==a[c+8]||" "!==a[c+11]||":"!==a[c+14]||":"!==a[c+17]||" "!==a[c+20]||"G"!==a[c+21]||"M"!==a[c+22]||"T"!==a[c+23])return;let e=0;if("0"===a[c+2]){let b=a.charCodeAt(c+3);if(b<49||b>57)return;e=b-48}else{let b=a.charCodeAt(c+2);if(b<49||b>51)return;let d=a.charCodeAt(c+3);if(d<48||d>57)return;e=(b-48)*10+(d-48)}let f=-1;if("J"===a[c+5]&&"a"===a[c+6]&&"n"===a[c+7])f=0;else if("F"===a[c+5]&&"e"===a[c+6]&&"b"===a[c+7])f=1;else if("M"===a[c+5]&&"a"===a[c+6]&&"r"===a[c+7])f=2;else if("A"===a[c+5]&&"p"===a[c+6]&&"r"===a[c+7])f=3;else if("M"===a[c+5]&&"a"===a[c+6]&&"y"===a[c+7])f=4;else if("J"===a[c+5]&&"u"===a[c+6]&&"n"===a[c+7])f=5;else if("J"===a[c+5]&&"u"===a[c+6]&&"l"===a[c+7])f=6;else if("A"===a[c+5]&&"u"===a[c+6]&&"g"===a[c+7])f=7;else if("S"===a[c+5]&&"e"===a[c+6]&&"p"===a[c+7])f=8;else if("O"===a[c+5]&&"c"===a[c+6]&&"t"===a[c+7])f=9;else if("N"===a[c+5]&&"o"===a[c+6]&&"v"===a[c+7])f=10;else{if("D"!==a[c+5]||"e"!==a[c+6]||"c"!==a[c+7])return;f=11}let g=a.charCodeAt(c+9);if(g<48||g>57)return;let h=a.charCodeAt(c+10);if(h<48||h>57)return;let i=(g-48)*10+(h-48);i+=i<70?2e3:1900;let j=0;if("0"===a[c+12]){let b=a.charCodeAt(c+13);if(b<48||b>57)return;j=b-48}else{let b=a.charCodeAt(c+12);if(b<48||b>50)return;let d=a.charCodeAt(c+13);if(d<48||d>57||50===b&&d>51)return;j=(b-48)*10+(d-48)}let k=0;if("0"===a[c+15]){let b=a.charCodeAt(c+16);if(b<48||b>57)return;k=b-48}else{let b=a.charCodeAt(c+15);if(b<48||b>53)return;let d=a.charCodeAt(c+16);if(d<48||d>57)return;k=(b-48)*10+(d-48)}let l=0;if("0"===a[c+18]){let b=a.charCodeAt(c+19);if(b<48||b>57)return;l=b-48}else{let b=a.charCodeAt(c+18);if(b<48||b>53)return;let d=a.charCodeAt(c+19);if(d<48||d>57)return;l=(b-48)*10+(d-48)}return b(i,f,e,j,k,l,d)}(a)}}}},24524:(a,b,c)=>{"use strict";c.d(b,{P:()=>e});var d=c(66678);class e extends d.L{constructor(){super("azure")}buildUrl(a,b,c=0,d=null){let e=d?.providerSpecificData?.azureEndpoint||process.env.AZURE_ENDPOINT||"https://api.openai.com",f=d?.providerSpecificData?.apiVersion||process.env.AZURE_API_VERSION||"2024-10-01-preview",g=d?.providerSpecificData?.deployment||a||process.env.AZURE_DEPLOYMENT||"gpt-4",h=e.replace(/\/$/,"");return`${h}/openai/deployments/${g}/chat/completions?api-version=${f}`}buildHeaders(a,b=!0){let c={"Content-Type":"application/json",...this.config.headers},d=a?.apiKey||a?.accessToken||process.env.OPENAI_API_KEY;d&&(c["api-key"]=d);let e=a?.providerSpecificData?.organization||process.env.AZURE_ORGANIZATION;return e&&(c["OpenAI-Organization"]=e),b&&(c.Accept="text/event-stream"),c}transformRequest(a,b,c,d){return b}}},24644:(a,b,c)=>{"use strict";c.d(b,{r:()=>h});var d=c(55511),e=c.n(d),f=c(69384),g=c(30395);class h extends f.Hv{constructor(){super("iflow",g.xq.iflow)}generateUUID(){return e().randomUUID()}createIFlowSignature(a,b,c,d){if(!d)return"";let f=`${a}:${b}:${c}`,g=e().createHmac("sha256",d);return g.update(f),g.digest("hex")}buildHeaders(a,b=!0){let c=`session-${this.generateUUID()}`,d=Date.now(),e=this.config.headers["User-Agent"]||"iFlow-Cli",f=a.apiKey||a.accessToken||"",g=this.createIFlowSignature(e,c,d,f),h={"Content-Type":"application/json",...this.config.headers,"session-id":c,"x-iflow-timestamp":d.toString(),"x-iflow-signature":g};return a.apiKey&&(h.Authorization=`Bearer ${a.apiKey}`),b&&(h.Accept="text/event-stream"),h}buildUrl(a,b,c=0,d=null){return this.config.baseUrl}transformRequest(a,b,c,d){return c&&b.messages&&!b.stream_options&&(b.stream_options={include_usage:!0}),b}}},25346:(a,b,c)=>{"use strict";c.d(b,{d_:()=>f});var d=c(94735);c(77598),c(24081),c(8677),global._pendingRequests||(global._pendingRequests={byModel:{},byAccount:{}}),global._lastErrorProvider||(global._lastErrorProvider={provider:"",ts:0}),global._statsEmitter||(global._statsEmitter=new d.EventEmitter,global._statsEmitter.setMaxListeners(50)),global._pendingTimers||(global._pendingTimers={}),global._recentRing||(global._recentRing={items:[],initialized:!1}),global._connectionMapCache||(global._connectionMapCache={map:{},ts:0}),global._usageWritesInFlight||(global._usageWritesInFlight=new Set),global._pendingRequests,global._lastErrorProvider,global._pendingTimers,global._recentRing,global._connectionMapCache;let e=global._usageWritesInFlight;async function f(){for(;e.size>0;)await Promise.allSettled([...e])}global._statsEmitter},26376:(a,b,c)=>{"use strict";let{makeRequest:d}=c(12600);a.exports={isValidLastEventId:function(a){return -1===a.indexOf("\0")},isASCIINumber:function(a){if(0===a.length)return!1;for(let b=0;b<a.length;b++)if(48>a.charCodeAt(b)||a.charCodeAt(b)>57)return!1;return!0},createPotentialCORSRequest:function(a,b,c,e){let f="no cors"===c?"no-cors":"cors";e&&"no-cors"===f&&(f="same-origin");let g="include";return"anonymous"===c&&(g="same-origin"),d({urlList:[a],destination:b,mode:f,credentials:g,useURLCredentials:!0})}}},26421:(a,b,c)=>{"use strict";c.d(b,{B:()=>aj});var d=c(69384),e=c(30395),f=c(46956),g=c(11484),h=c(48161),i=c.n(h),j=c(76760),k=c.n(j);let l="function"==typeof require?require:void 0,m=null,n=!1;class o extends Error{constructor(a){super(a),this.name="TlsClientUnavailableError"}}class p extends Error{constructor(a){super(a),this.name="TlsClientHangError"}}function q(a){let b=a?.reason;if(b instanceof Error)return b;let c=Error("string"==typeof b?b:"The operation was aborted");return c.name="AbortError",c}async function r(){return m||(m=(async()=>{try{let a=function(){let a,b=[process.env.ZEVAI_NOTION_TLS_MODULE,"tls-client-node",k().join((a=("string"==typeof process.env.DATA_DIR?process.env.DATA_DIR.trim():"")||("win32"===process.platform?k().join(process.env.APPDATA||k().join(i().homedir(),"AppData","Roaming"),"zevai"):k().join(i().homedir(),".zevai")),k().join(a,"runtime","node_modules")),"tls-client-node")].filter(Boolean),c=null;for(let a of b)try{return l(a)}catch(a){c=a}throw c||Error("tls-client-node is not installed")}(),b=a.TLSClient||a.default?.TLSClient;if("function"!=typeof b)throw Error("TLSClient export is missing");let c=new b({runtimeMode:"native"});return await c.start(),!function(){if(n)return;n=!0;let a=async()=>{if(m)try{let a=await m;await a?.stop?.()}catch{}};process.once("beforeExit",a),process.once("SIGINT",()=>void a()),process.once("SIGTERM",()=>void a())}(),c}catch(a){throw m=null,new o(`Notion Chrome TLS transport unavailable: ${a?.message||"install tls-client-node"}`)}})()),m}async function s(a,b,c){let d,e;try{let f=[a,new Promise((a,c)=>{d=setTimeout(()=>{c(new p(`Notion TLS request exceeded ${b}ms`))},b)})];return c&&f.push(new Promise((a,b)=>{c.aborted?b(q(c)):(e=()=>b(q(c)),c.addEventListener("abort",e,{once:!0}))})),await Promise.race(f)}finally{d&&clearTimeout(d),c&&e&&c.removeEventListener("abort",e)}}async function t(a){return"string"==typeof a?.body?a.body:"function"==typeof a?.text?a.text():""}async function u(a,b={}){let c,d;if(b.signal?.aborted)throw q(b.signal);let e=Number.isFinite(d=Number.parseInt(String(b.timeoutMs||process.env.ZEVAI_NOTION_TLS_TIMEOUT_MS||""),10))&&d>0?d:18e4,f=await r();if(b.signal?.aborted)throw q(b.signal);let g={method:b.method||"GET",headers:b.headers||{},body:b.body,tlsClientIdentifier:"chrome_146",timeoutMilliseconds:e,followRedirects:!0,withRandomTLSExtensionOrder:!0},h=b.proxyUrl||process.env.ZEVAI_NOTION_TLS_PROXY_URL||process.env.HTTPS_PROXY||process.env.https_proxy||process.env.ALL_PROXY||process.env.all_proxy;h&&(g.proxyUrl=h);try{c=await s(f.request(a,g),e+1e4,b.signal)}catch(a){throw a instanceof p&&(m=null),a}if(b.signal?.aborted)throw q(b.signal);return{status:Number(c?.status??c?.statusCode??0),headers:function(a){let b=new Headers;if(a instanceof Headers)return a;for(let[c,d]of Object.entries(a||{}))if(Array.isArray(d))for(let a of d)b.append(c,String(a));else null!=d&&b.set(c,String(d));return b}(c?.headers),text:await t(c)}}async function v(a,b={}){try{var d;return(d=await u(a,b))instanceof Response?d:new Response(d?.text||"",{status:d?.status||502,headers:d?.headers})}catch(g){if(!(g instanceof o))throw g;let{proxyUrl:d,...e}=b,{proxyAwareFetch:f}=await Promise.resolve().then(c.bind(c,46956));return f(a,e,d?{connectionProxyEnabled:!0,connectionProxyUrl:d}:null)}}var w=c(77598);let x="https://app.notion.com/api/v3/runInferenceTranscript",y="https://app.notion.com",z="23.13.20260720.1949",A={"sec-ch-ua":'"Chromium";v="146", "Not)A;Brand";v="24"',"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"Windows"',"sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin",priority:"u=1, i","cache-control":"no-cache",pragma:"no-cache"};function B(){return globalThis.crypto?.randomUUID?globalThis.crypto.randomUUID():`zevai-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function C(a){return"string"==typeof a?a.trim():""}function D(...a){for(let b of a){let a=C(b);if(a)return a}return""}function E(a){let b=C(a).replace(/^Cookie:\s*/i,"");if(!b)return"";let c=function(a){let b;if(!a.startsWith("[")&&!a.startsWith("{"))return"";try{b=JSON.parse(a)}catch{return""}let c=(Array.isArray(b)?b:Array.isArray(b?.cookies)?b.cookies:b?.name?[b]:[]).map(a=>{let b=C(a?.name),c="string"==typeof a?.value?a.value:"",d=C(a?.domain).replace(/^\./,"").toLowerCase(),e=!d||/(^|\.)notion\.(?:com|so)$/.test(d);return!(!b||!/^[A-Za-z0-9_.-]+$/.test(b)||!c||/[\r\n;]/.test(c))&&e?`${b}=${c}`:null}).filter(Boolean);return c.some(a=>/^token_v2=/i.test(a))?c.join("; "):""}(b);if(c)return c;if(/[\r\n]/.test(b))return"";let d=/^(?:token_v2|token|notion_user_id|device_id)\s*=/i.test(b),e=b.includes(";")&&/^[a-zA-Z0-9_.-]+\s*=/.test(b);return d||e?b:`token_v2=${b}`}function F(a,b){if(!a||!b)return"";let c=b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),d=a.match(RegExp(`(?:^|;\\s*)${c}=([^;]*)`,"i"));return d?.[1]?.trim()||""}function G(a={},b=""){let c=a&&"object"==typeof a?a:{},d=E(b),e=D(c.spaceId,F(d,"space_id"),F(d,"spaceId"));return{spaceId:e,userId:D(c.userId,c.notionUserId,F(d,"notion_user_id"),F(d,"user_id")),spaceViewId:D(c.spaceViewId,e,F(d,"space_view_id"),F(d,"spaceViewId")),spaceName:D(c.spaceName,"Notion"),userName:D(c.userName,"ZevaiRouter"),userEmail:C(c.userEmail),timezone:D(c.timezone,"UTC"),clientVersion:D(c.clientVersion,c.notionClientVersion,z),cell:D(c.cell,c.notionCell)}}function H(a,b){return{id:B(),type:"user",value:[[a]],userId:b,createdAt:new Date().toISOString()}}function I(a,b){let c=b.trim();if(c&&"[DONE]"!==c)try{let b=JSON.parse(c);Array.isArray(b)?a.push(...b):a.push(b)}catch{}}function J(a,b=!1){let c=[],d=0;for(;d<a.length;){for(;/\s/.test(a[d]||"");)d+=1;if(d>=a.length)break;if(a.startsWith("data:",d)){let e=a.indexOf("\n",d);if(e<0&&!b)break;let f=e<0?a.length:e;I(c,a.slice(d+5,f).replace(/\r$/,"")),d=e<0?a.length:e+1;continue}if(a.startsWith("event:",d)||a.startsWith("id:",d)){let c=a.indexOf("\n",d);if(c<0&&!b)break;d=c<0?a.length:c+1;continue}let e=a[d];if("{"!==e&&"["!==e){let c=a.indexOf("\n",d);if(c<0&&!b)break;d=c<0?a.length:c+1;continue}let f=function(a,b){let c=a[b],d="{"===c?"}":"["===c?"]":null;if(!d)return -1;let e=0,f=!1,g=!1;for(let h=b;h<a.length;h+=1){let b=a[h];if(f){g?g=!1:"\\"===b?g=!0:'"'===b&&(f=!1);continue}if('"'===b){f=!0;continue}if(b===c)e+=1;else if(b===d&&0==(e-=1))return h+1}return -1}(a,d);if(f<0)break;I(c,a.slice(d,f)),d=f}return{frames:c,remainder:a.slice(d)}}async function*K(a,b){if(!a?.getReader)return;let c=a.getReader(),d=new TextDecoder,e="";try{for(;;){if(b?.aborted)return;let{value:a,done:f}=await c.read();if(f)break;e+=d.decode(a,{stream:!0});let g=J(e);for(let a of(e=g.remainder,g.frames))yield a}for(let a of(e+=d.decode(),J(e,!0).frames))yield a}finally{try{c.releaseLock()}catch{}}}function L(a){if(!a||"object"!=typeof a)return[];let b=a.value??a.content;if("string"==typeof b)return[{type:"text",content:b}];if(b&&"object"==typeof b&&!Array.isArray(b)){if(["text","thinking"].includes(b.type)&&"string"==typeof b.content)return[{type:b.type,content:b.content}];if("string"==typeof b.content)return[{type:"text",content:b.content}]}return Array.isArray(b)?b.filter(a=>a&&["text","thinking"].includes(a.type)&&"string"==typeof a.content).map(a=>({type:a.type,content:a.content})):[]}let M=new Map;function N(a){return a?.connectionProxyEnabled!==!0?"":"string"==typeof a.connectionProxyUrl?a.connectionProxyUrl.trim():""}let O=[{id:"notion-auto",name:"Notion Auto",owned_by:"notion"},{id:"gpt-5.6-sol",name:"GPT-5.6 Sol",owned_by:"openai",notionCodename:"orange-mousse"},{id:"gpt-5.6-terra",name:"GPT-5.6 Terra",owned_by:"openai",notionCodename:"orchid-muffin"},{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",owned_by:"openai",notionCodename:"olive-jellyroll"},{id:"gpt-5.5",name:"GPT-5.5",owned_by:"openai",notionCodename:"opal-quince-medium"},{id:"gpt-5.4",name:"GPT-5.4",owned_by:"openai",notionCodename:"oval-kumquat-medium"},{id:"gpt-5.4-mini",name:"GPT-5.4 Mini",owned_by:"openai",notionCodename:"oregon-grape-medium"},{id:"gpt-5.4-nano",name:"GPT-5.4 Nano",owned_by:"openai",notionCodename:"otaheite-apple-medium"},{id:"gemini-3.5-flash",name:"Gemini 3.5 Flash",owned_by:"gemini",notionCodename:"vertex-gemini-3.5-flash"},{id:"gemini-3-flash",name:"Gemini 3 Flash",owned_by:"gemini",notionCodename:"gingerbread"},{id:"sonnet-4.6",name:"Sonnet 4.6",owned_by:"anthropic",notionCodename:"almond-croissant-low"},{id:"opus-4.8",name:"Opus 4.8",owned_by:"anthropic",notionCodename:"ambrosia-tart-high"},{id:"haiku-4.5",name:"Haiku 4.5",owned_by:"anthropic",notionCodename:"anthropic-haiku-4.5"},{id:"fable-5",name:"Fable 5",owned_by:"anthropic",notionCodename:"acai-budino-high"},{id:"openai-gpt-4.1-mini",name:"GPT-4.1 Mini (legacy)",owned_by:"openai",notionCodename:"openai-gpt-4.1-mini"},{id:"openai-gpt-5-mini",name:"GPT-5 Mini (legacy)",owned_by:"openai",notionCodename:"openai-gpt-5-mini"},{id:"openai-o4-mini",name:"o4-mini (legacy)",owned_by:"openai",notionCodename:"openai-o4-mini"},{id:"oregon-grape-low",name:"Oregon Grape Low (legacy)",owned_by:"openai",notionCodename:"oregon-grape-low"},{id:"oregon-grape-high",name:"Oregon Grape High (legacy)",owned_by:"openai",notionCodename:"oregon-grape-high"},{id:"otaheite-apple-low",name:"Otaheite Apple Low (legacy)",owned_by:"openai",notionCodename:"otaheite-apple-low"},{id:"otaheite-apple-high",name:"Otaheite Apple High (legacy)",owned_by:"openai",notionCodename:"otaheite-apple-high"}];function P(a){return String(a||"").trim().toLowerCase().replace(/[^a-z0-9.]+/g,"-").replace(/\.{2,}/g,".").replace(/^[-.]+|[-.]+$/g,"")}function Q(a,b,c="*/*"){let d={"Content-Type":"application/json",Accept:c,Cookie:a,Origin:y,Referer:`${y}/ai`,"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36","Accept-Language":"en-US,en;q=0.9","notion-client-version":b.clientVersion||z,"notion-audit-log-platform":"web",...A};return b.userId&&(d["x-notion-active-user-header"]=b.userId),b.spaceId&&(d["x-notion-space-id"]=b.spaceId),d}async function R(a,b){if(!a?.ok){let c=await a?.text?.().catch(()=>"")||"";throw Error(`${b} returned HTTP ${a?.status||0}${c?`: ${c.slice(0,180)}`:""}`)}return a.json()}async function S(a,b,c,d,e=""){let f=await c("https://app.notion.com/api/v3/getSpaces",{method:"POST",headers:Q(a,b,"application/json"),body:"{}",...e?{proxyUrl:e}:{},signal:d}),g=function(a){if(!a||"object"!=typeof a||Array.isArray(a))return{userId:"",spaceIds:[]};let b=[],c="";for(let[d,e]of Object.entries(a)){let a=e?.space;if(!(!a||"object"!=typeof a||Array.isArray(a)))for(let e of(c||!d||d.includes(" ")||(c=d),Object.keys(a)))e&&!b.includes(e)&&b.push(e)}if(0===b.length&&Array.isArray(a.spaces))for(let c of a.spaces)"string"==typeof c?.id&&c.id&&!b.includes(c.id)&&b.push(c.id);if(0===b.length&&Array.isArray(a.spaceIds))for(let c of a.spaceIds)"string"==typeof c&&c&&!b.includes(c)&&b.push(c);return{userId:c,spaceIds:b}}(await R(f,"Notion getSpaces"));return{userId:b.userId||g.userId,spaceIds:g.spaceIds}}async function T(a,b,c,d,e,f=""){let g,h,i,j,k=Q(a,{...b,spaceId:c}),l=await d("https://app.notion.com/api/v3/getAvailableModels",{method:"POST",headers:k,body:JSON.stringify({spaceId:c}),...f?{proxyUrl:f}:{},signal:e}),m=await R(l,"Notion getAvailableModels"),n=function(a){let b=Array.isArray(a?.models)?a.models:[],c=new Set,d=[];for(let a of b){let b=function(a,b){if(!a||"object"!=typeof a||!0===a.isDisabled)return null;let c="string"==typeof a.model?a.model.trim():"";if(!c)return null;let d=String(a.modelMessage||a.displayName||a.name||c).trim(),e=P(d)||c;return b.has(e)||b.has(c)?null:(b.add(e),b.add(c),{id:e,name:d,owned_by:String(a.modelFamily||"notion"),...e!==c?{notionCodename:c}:{},...Array.isArray(a.modelConfiguration?.supportedReasoningEfforts)&&a.modelConfiguration.supportedReasoningEfforts.length>0?{supportsReasoning:!0}:{}})}(a,c);b&&d.push(b)}return d.some(a=>"notion-auto"===a.id)||d.unshift({id:"notion-auto",name:"Notion Auto",owned_by:"notion"}),d}(m);return{models:n,data:m,score:(g=n.filter(a=>"notion-auto"!==a.id).length,h=Array.isArray(m?.models)?m.models:[],i=n.some(a=>"fable-5"===a.id||"acai-budino-high"===a.notionCodename),j=h.some(a=>a?.isDisabled===!0&&(a?.model==="acai-budino-high"||"fable-5"===P(a?.modelMessage))),10*g+(i?1e3:j?-50:0))}}async function U({apiKey:a,providerSpecificData:b={},fetchImpl:c=v,signal:d}={}){let e=E(a),f=G(b,a),g=N(b);if(f.spaceId&&f.userId)return{...f,source:"credentials"};let h=await S(e,f,c,d,g),i=f.spaceId||h.spaceIds[0]||"",j=f.userId||h.userId||"";if(!i||!j)throw Error("Notion workspace metadata could not be resolved from getSpaces");return{...f,spaceId:i,userId:j,source:"getSpaces"}}async function V({apiKey:a,providerSpecificData:b={},fetchImpl:c=v,signal:d}={}){let e,f=E(a);if(!f)throw Error("Missing Notion token_v2 cookie");let g=G(b,a),h=N(b),i=`${(0,w.createHash)("sha256").update((e="token_v2".replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),f.match(RegExp(`(?:^|;\\s*)${e}=([^;]*)`,"i"))?.[1]?.trim()||f)).digest("hex").slice(0,32)}:${g.spaceId||"auto"}`,j=M.get(i);if(j&&j.expiresAt>Date.now())return j.value;let k=g.spaceId?[g.spaceId]:[],l=g.userId;if(0===k.length||!l){let a=await S(f,g,c,d,h);l=l||a.userId,0===k.length&&(k=a.spaceIds)}if(0===k.length)throw Error("No Notion workspace was returned by getSpaces");let m=null;for(let a of k.slice(0,8))try{let b=await T(f,{...g,userId:l},a,c,d,h);(!m||b.score>m.score)&&(m={...b,spaceId:a})}catch{}if(!m)throw Error("Notion getAvailableModels failed for every workspace");let n={models:m.models,spaceId:m.spaceId,userId:l,source:"api"};return M.set(i,{value:n,expiresAt:Date.now()+18e5}),n}function W(a,b=[]){let c="string"==typeof a?a.trim():"";if(c.startsWith("notion-ai/")&&(c=c.slice(10)),c.startsWith("na/")&&(c=c.slice(3)),!c||["notion-auto","auto","default"].includes(c))return"";let d=function(a){let b=new Map;for(let c of a){let a=c.notionCodename||("notion-auto"===c.id?"":c.id);if(a)for(let d of[c.id,c.name,a,P(c.name)])d&&b.set(String(d).toLowerCase(),a)}return b}([...O,...b]);return d.get(c.toLowerCase())||d.get(P(c))||c}let X=new Map;function Y(a){return"string"==typeof a?a.trim():Array.isArray(a)?a.map(a=>"string"==typeof a?a:a&&"object"==typeof a?"string"==typeof a.text?a.text:"string"==typeof a.content?a.content:"":"").filter(Boolean).join("\n").trim():""}function Z(a){return(0,w.createHash)("sha256").update(String(a||"")).digest("hex").slice(0,24)}function $(a=Date.now()){for(let[b,c]of X)a-c.updatedAt>216e5&&X.delete(b);for(;X.size>500;){let a=[...X.entries()].reduce((a,b)=>b[1].updatedAt<a[1].updatedAt?b:a)[0];X.delete(a)}}function _({key:a,threadId:b}={}){if(!a)return;let c=X.get(a);c&&(!b||c.threadId===b)&&X.delete(a)}function aa(a,b=200){return new Response(JSON.stringify(a),{status:b,headers:{"Content-Type":"application/json"}})}function ab(a,b=502,c="NOTION_ERROR"){return aa({error:{message:a,type:"upstream_error",code:c}},b)}function ac(a){return`data: ${JSON.stringify(a)}
216
+ `)}close(){this.#n.close()}get(a){f(a);let b=this.#v(a);return b?{body:b.body?Buffer.from(b.body.buffer,b.body.byteOffset,b.body.byteLength):void 0,statusCode:b.statusCode,statusMessage:b.statusMessage,headers:b.headers?JSON.parse(b.headers):void 0,etag:b.etag?b.etag:void 0,vary:b.vary?JSON.parse(b.vary):void 0,cacheControlDirectives:b.cacheControlDirectives?JSON.parse(b.cacheControlDirectives):void 0,cachedAt:b.cachedAt,staleAt:b.staleAt,deleteAt:b.deleteAt}:void 0}set(a,b){f(a);let c=this.#w(a),d=Array.isArray(b.body)?Buffer.concat(b.body):b.body,e=d?.byteLength;if(e&&e>this.#l)return;let g=this.#v(a,!0);g?this.#p.run(d,b.deleteAt,b.statusCode,b.statusMessage,b.headers?JSON.stringify(b.headers):null,b.etag?b.etag:null,b.cacheControlDirectives?JSON.stringify(b.cacheControlDirectives):null,b.vary?JSON.stringify(b.vary):null,b.cachedAt,b.staleAt,g.id):(this.#q.run(c,a.method,d,b.deleteAt,b.statusCode,b.statusMessage,b.headers?JSON.stringify(b.headers):null,b.etag?b.etag:null,b.cacheControlDirectives?JSON.stringify(b.cacheControlDirectives):null,b.vary?JSON.stringify(b.vary):null,b.cachedAt,b.staleAt),this.#x())}createWriteStream(a,b){f(a),g(b);let c=0,d=[],h=this;return new e({decodeStrings:!0,write(a,b,e){(c+=a.byteLength)<=h.#l?d.push(a):this.destroy(),e()},final(c){h.set(a,{...b,body:d}),c()}})}delete(a){if("object"!=typeof a)throw TypeError(`expected key to be object, got ${typeof a}`);this.#s.run(this.#w(a))}#x(){if(Number.isFinite(this.#m)&&this.size<=this.#m)return 0;{let a=this.#r.run(Date.now()).changes;if(a)return a}{let a=this.#u?.run(Math.max(Math.floor(.1*this.#m),1)).changes;if(a)return a}return 0}get size(){let{total:a}=this.#t.get();return a}#w(a){return`${a.origin}/${a.path}`}#v(a,b=!1){let c=this.#w(a),{headers:d,method:e}=a,f=this.#o.all(c,e);if(0===f.length)return;let g=Date.now();for(let a of f){if(g>=a.deleteAt&&!b)continue;let c=!0;if(a.vary){let b=JSON.parse(a.vary);for(let a in b)if(!function(a,b){if(null==a&&null==b)return!0;if(null==a&&null!=b||null!=a&&null==b)return!1;if(Array.isArray(a)&&Array.isArray(b)){if(a.length!==b.length)return!1;for(let c=0;c<a.length;c++)if(a[c]!==b[c])return!1;return!0}return a===b}(d[a],b[a])){c=!1;break}}if(c)return a}}}},21263:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{J4:()=>l});var e=c(70321),f=c(97474),g=c(46455),h=a([g]);g=(h.then?(await h)():h)[0];let m=globalThis._quotaProgressState??={accounts:{},generation:0,runningPromise:null,run:null,subscribers:new Set};function i(a,b=new WeakMap){if(null===a||"object"!=typeof a)return a;if(b.has(a))return b.get(a);let c=Array.isArray(a)?[]:{};for(let[d,e]of(b.set(a,c),Object.entries(a)))c[d]=i(e,b);return Object.freeze(c)}function j(a){let b=i(a);for(let a of[...m.subscribers])try{a(b)}catch{}return b}async function k(a,b){let c=b.getRefreshProfile(a[0]?.provider)||{},d=b.concurrency??c.maxConcurrent,e=Math.min(Math.max(1,Number(d)||1),a.length),f=Math.max(0,Number(c.minDelayMs)||0),g=0,h=0,k=Promise.resolve();async function l(){let a,b=k;k=new Promise(b=>{a=b}),await b;let c=Math.max(0,h-Date.now());await (c>0?new Promise(a=>setTimeout(a,c)):Promise.resolve()),h=Date.now()+f,a()}let n=Array.from({length:e},async()=>{for(;!b.controller.signal.aborted&&g<a.length;){let c=a[g++];if(await l(),b.controller.signal.aborted)break;b.counts.attempted+=1;try{let a=await b.resolveUsage(c.id,{writeCache:!0,force:b.force}),d=i({connectionId:c.id,provider:c.provider,usage:a||{},provenance:{cached:a?.stale===!0,stale:a?.stale===!0,fetchedAt:a?.fetchedAt||new Date().toISOString()}});m.accounts={...m.accounts,[c.id]:d},d.provenance.stale?b.counts.stale+=1:b.counts.refreshed+=1,j({type:"update",generation:b.generation,...d})}catch(a){b.counts.failed+=1,j({type:"error",generation:b.generation,connectionId:c.id,provider:c.provider,error:function(a){let b=String(a?.code||"QUOTA_REFRESH_FAILED").replace(/[^a-zA-Z0-9_.:-]/g,"_").slice(0,80)||"QUOTA_REFRESH_FAILED";return Object.freeze({code:b,message:"Quota refresh failed"})}(a),previous:m.accounts[c.id]||null})}}});await Promise.all(n)}function l(a={}){if(m.runningPromise)return!1!==a.retainWithoutSubscribers&&m.run&&(m.run.retainWithoutSubscribers=!0),m.runningPromise;let b=new AbortController;m.run={controller:b,retainWithoutSubscribers:!1!==a.retainWithoutSubscribers};let c=(async()=>{m.generation+=1;let c=m.generation,d=a.getConnections||e.getProviderConnections,h=a.getSnapshots||e.tV,l=a.resolveUsage||g.dg,n=a.getRefreshProfile||f.JJ,o=(a.connections||await d()).filter(g.NS),p=o.filter(a=>a.isActive??!0),q=new Set(o.map(({id:a})=>a)),r=await h(),s=Object.fromEntries(r.filter(({connectionId:a})=>q.has(a)).map(a=>[a.connectionId,i({connectionId:a.connectionId,provider:a.provider,usage:a.usage||{},provenance:{cached:!0,stale:a.usage?.stale===!0,fetchedAt:a.fetchedAt||null}})]));m.accounts=!1===a.replaceAccounts?{...m.accounts,...s}:s,j(i({type:"snapshot",generation:m.generation,accounts:m.accounts,provenance:{source:"quota-cache"}}));let t={attempted:0,refreshed:0,stale:0,failed:0},u=new Map;for(let a of p){let b=u.get(a.provider)||[];b.push(a),u.set(a.provider,b)}return await Promise.all([...u.values()].map(d=>k(d,{concurrency:a.concurrency,controller:b,counts:t,force:!0===a.force,generation:c,getRefreshProfile:n,resolveUsage:l}))),j({type:"complete",generation:c,...t,...b.signal.aborted?{cancelled:!0}:{}})})().finally(()=>{m.runningPromise===c&&(m.runningPromise=null,m.run=null)});return m.runningPromise=c,c}d()}catch(a){d(a)}})},21616:(a,b,c)=>{"use strict";c.d(b,{JA:()=>m});var d=c(55511),e=c.n(d),f=c(77598);let g=function(a){return Array.isArray(a)?a=Buffer.from(a):"string"==typeof a&&(a=Buffer.from(a,"utf8")),(0,f.createHash)("sha1").update(a).digest()},h=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i,i=function(a){let b;if(!("string"==typeof a&&h.test(a)))throw TypeError("Invalid UUID");return Uint8Array.of((b=parseInt(a.slice(0,8),16))>>>24,b>>>16&255,b>>>8&255,255&b,(b=parseInt(a.slice(9,13),16))>>>8,255&b,(b=parseInt(a.slice(14,18),16))>>>8,255&b,(b=parseInt(a.slice(19,23),16))>>>8,255&b,(b=parseInt(a.slice(24,36),16))/0x10000000000&255,b/0x100000000&255,b>>>24&255,b>>>16&255,b>>>8&255,255&b)};var j=c(82009);function k(a,b,c,d){var e=b,f=d;let h="string"==typeof a?function(a){let b=new Uint8Array((a=unescape(encodeURIComponent(a))).length);for(let c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b}(a):a,k="string"==typeof e?i(e):e;if("string"==typeof e&&(e=i(e)),e?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let l=new Uint8Array(16+h.length);if(l.set(k),l.set(h,k.length),(l=g(l))[6]=15&l[6]|80,l[8]=63&l[8]|128,c){if((f??=0)<0||f+16>c.length)throw RangeError(`UUID byte range ${f}:${f+15} is out of buffer bounds`);for(let a=0;a<16;++a)c[f+a]=l[a];return c}return(0,j.k)(l)}function l(a,b=""){return e().createHash("sha256").update(a+b).digest("hex")}function m(a,b=null,c=!0){let d=a.includes("::")?a.split("::")[1]:a,f=b||l(d,"machineId"),g=k(d,k.DNS),h=l(d),i=function(a){let b=Math.floor(Date.now()/1e6),c=new Uint8Array([b>>40&255,b>>32&255,b>>24&255,b>>16&255,b>>8&255,255&b]),d=165;for(let a=0;a<c.length;a++)c[a]=(c[a]^d)+a%256&255,d=c[a];let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",f="";for(let a=0;a<c.length;a+=3){let b=c[a],d=a+1<c.length?c[a+1]:0,g=a+2<c.length?c[a+2]:0;f+=e[b>>2],f+=e[(3&b)<<4|d>>4],a+1<c.length&&(f+=e[(15&d)<<2|g>>6]),a+2<c.length&&(f+=e[63&g])}return`${f}${a}`}(f),j="linux";"u">typeof process&&("win32"===process.platform?j="windows":"darwin"===process.platform&&(j="macos"));let n="x64";return"u">typeof process&&"arm64"===process.arch&&(n="aarch64"),{authorization:`Bearer ${d}`,"connect-accept-encoding":"gzip","connect-protocol-version":"1","content-type":"application/connect+proto","user-agent":"connect-es/1.6.1","x-amzn-trace-id":`Root=${e().randomUUID()}`,"x-client-key":h,"x-cursor-checksum":i,"x-cursor-client-version":"3.12.17","x-cursor-client-type":"ide","x-cursor-client-os":j,"x-cursor-client-arch":n,"x-cursor-client-device-type":"desktop","x-cursor-config-version":e().randomUUID(),"x-cursor-timezone":Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC","x-ghost-mode":c?"true":"false","x-request-id":e().randomUUID(),"x-session-id":g}}k.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",k.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8"},21904:(a,b,c)=>{"use strict";c.d(b,{n:()=>w});var d=c(3433),e=c(71553),f=c.n(e),g=c(77030),h=c.n(g);let i=new Set(["http:","https:"]),j=new Set(["public","trusted-lan","legacy-trusted","loopback-service"]);function k(a){return a?.reason?a.reason:Object.assign(Error("The operation was aborted"),{name:"AbortError"})}async function l(a,b,c){if(b?.aborted)throw k(b);let d=Promise.resolve(c(a,{all:!0}));return b?new Promise((a,c)=>{let e=!1,f=(d,f)=>{e||(e=!0,b.removeEventListener("abort",g),d?c(d):a(f))},g=()=>f(k(b));b.addEventListener("abort",g,{once:!0}),d.then(a=>f(null,a),a=>f(a))}):d}function m(a){return a.split(".").reduce((a,b)=>a<<8n|BigInt(b),0n)}function n(a){return(function(a){let[b="",c=""]=a.toLowerCase().replace(/^\[|\]$/g,"").split("::"),d=b?b.split(":"):[],e=c?c.split(":"):[],f=8-d.length-e.length;return[...d,...Array(Math.max(0,f)).fill("0"),...e].map(a=>Number.parseInt(a||"0",16))})(a).reduce((a,b)=>a<<16n|BigInt(b),0n)}function o(a,b){let[c,d]=b.split("/"),e=h().isIP(a);if(!e||e!==h().isIP(c))return!1;let f=4===e?32:128,g=Number(d);if(!Number.isInteger(g)||g<0||g>f)return!1;let i=BigInt(f-g);return(4===e?m(a):n(a))>>i==(4===e?m(c):n(c))>>i}function p(a){return a.port?Number(a.port):"https:"===a.protocol?443:80}function q(a,{httpsOnly:b=!1,expectedOrigin:c}={}){let d;try{d=new URL(a)}catch{throw Error("URL is not an allowed HTTP endpoint")}if(!i.has(d.protocol)||b&&"https:"!==d.protocol||d.username||d.password||c&&d.origin!==c)throw Error("URL is not an allowed HTTP endpoint");return d}async function r(a,b={}){let c=b.trust||"public";if(!j.has(c))throw Error("Unknown outbound target trust mode");let d=q(a,b),e=await l(d.hostname,b.signal,b.lookup||f().lookup);if(!Array.isArray(e)||0===e.length||e.some(({address:a})=>!h().isIP(a)))throw Error("URL did not resolve to valid addresses");let g=null;if("public"===c&&e.some(({address:a})=>(function(a){let b=String(a||"").toLowerCase().replace(/^::ffff:/,"");if(h().isIPv4(b)){let[a,c,d]=b.split(".").map(Number);return 0===a||10===a||127===a||100===a&&c>=64&&c<=127||169===a&&254===c||172===a&&c>=16&&c<=31||192===a&&(0===c||168===c||88===c&&99===d)||198===a&&(18===c||19===c||51===c&&100===d)||203===a&&0===c&&113===d||a>=224}if(!h().isIPv6(b))return!0;let[c,d="0"]=b.split(":"),e=Number.parseInt(c,16),f=Number.parseInt(d,16);return"::"===b||"::1"===b||e<8192||e>16383||8193===e&&(f<=511||3512===f)||8194===e||16383===e})(a)))throw Error("URL must resolve only to public addresses");if("trusted-lan"===c&&!(g=function(a,b,c){let d=a.hostname.toLowerCase().replace(/^\[|\]$/g,""),e=p(a);for(let a of Array.isArray(c)?c:[]){let c;try{c=function(a){if(!a||"object"!=typeof a)throw Error("Trusted target must be an object");let b="string"==typeof a.id?a.id.trim():"",c="string"==typeof a.host?a.host.trim().toLowerCase().replace(/^\[|\]$/g,""):"",d="string"==typeof a.cidr?a.cidr.trim().toLowerCase():"";if(!b||!c&&!d)throw Error("Trusted target requires id and host or CIDR");if(c&&(c.includes("/")||c.includes("@")||c.includes(":"))&&!h().isIP(c))throw Error("Trusted target host is invalid");if(d&&!o(d.split("/")[0],d))throw Error("Trusted target CIDR is invalid");let e=[...new Set((Array.isArray(a.ports)?a.ports:[]).map(Number).filter(a=>Number.isInteger(a)&&a>=1&&a<=65535))].sort((a,b)=>a-b);if(0===e.length)throw Error("Trusted target requires an allowed port");return Object.freeze({id:b,host:c||null,cidr:d||null,ports:Object.freeze(e)})}(a)}catch{continue}if(c.ports.includes(e)&&(c.host&&c.host===d||c.cidr&&b.every(({address:a})=>o(a,c.cidr))))return c}return null}(d,e,b.trustedTargets)))throw Error("URL must match an explicitly trusted host and port");if("legacy-trusted"===c){let a=q(b.legacyOrigin||"").origin;if(d.origin!==a)throw Error("URL must preserve the saved legacy origin")}if("loopback-service"===c){let a=q(b.expectedOrigin||"").origin;if(d.origin!==a||e.some(({address:a})=>{let b=a.toLowerCase().replace(/^::ffff:/,"");return"::1"!==b&&!b.startsWith("127.")}))throw Error("URL must match the owned loopback service")}return Object.freeze({url:d.href,trust:c,origin:d.origin,pinnedAddresses:Object.freeze(e.map(({address:a})=>a)),pinnedAddressFamilies:Object.freeze(e.map(({family:a,address:b})=>a||h().isIP(b))),allowedPorts:Object.freeze(g?[...g.ports]:[p(d)]),trustedTargetId:g?.id||null})}async function s(a,b={}){if(!a||!Array.isArray(a.pinnedAddresses)||0===a.pinnedAddresses.length||!a.url)throw Error("A resolved outbound target decision is required");let c=new URL(a.url),e=a.pinnedAddresses.map((b,c)=>({address:b,family:a.pinnedAddressFamilies?.[c]||(b.includes(":")?6:4)})),f=0,g=new d.g6({connect:{lookup(a,b,c){let d=e.filter(({family:a})=>!b.family||a===b.family),g=d.length?d:e;if(b.all)return c(null,g);let h=g[f++%g.length];c(null,h.address,h.family)}}});try{let a=await (0,d.hd)(c,{...b,redirect:"error",dispatcher:g}),e=function(a,b,c){if(!a.body?.getReader)return null;let d=a.body.getReader(),e=null,f=!1,g=()=>{f||(f=!0,d.releaseLock())},h=()=>(c?.removeEventListener("abort",i),e||=Promise.resolve(b.close()).catch(()=>{})),i=()=>{h()};c?.aborted?i():c?.addEventListener("abort",i,{once:!0});let j=new Response(new ReadableStream({async pull(a){try{let{done:b,value:c}=await d.read();if(!b)return void a.enqueue(c);g(),await h(),a.close()}catch(b){g(),await h(),a.error(b)}},async cancel(a){try{await d.cancel(a)}finally{g(),await h()}}}),{headers:a.headers,status:a.status,statusText:a.statusText});for(let b of["url","redirected","type"])Object.defineProperty(j,b,{configurable:!0,value:a[b]});return j}(a,g,b.signal);if(e)return e;return await g.close(),a}catch(a){throw await g.close(),a}}async function t(a,b={},c={}){return s(await r(a,{...c,trust:c.trust||"public",signal:b.signal}),b)}async function u(a){try{await a?.body?.cancel?.()}catch{}}async function v(a,b){if(!a.body?.getReader){let c=Buffer.from(await a.arrayBuffer());return c.byteLength<=b?c:null}let c=a.body.getReader(),d=[],e=0;try{for(;;){let{done:a,value:f}=await c.read();if(a)break;if((e+=f.byteLength)>b)return await c.cancel(),null;d.push(Buffer.from(f))}return Buffer.concat(d,e)}finally{c.releaseLock?.()}}async function w(a,b={}){let c,{signal:d,timeoutMs:e=1e4,maxBytes:f=0x1400000}=b;if(!a||!a.startsWith("http://")&&!a.startsWith("https://"))return null;let g=new AbortController,h=()=>g.abort(d?.reason);d?.aborted?h():d?.addEventListener("abort",h,{once:!0});let i=Number.isFinite(e)&&e>0?setTimeout(()=>g.abort(),e):null;try{if(!(c=await t(a,{signal:g.signal})).ok)return await u(c),null;let b=Number(c.headers.get("Content-Length"));if(Number.isFinite(b)&&b>f)return await u(c),null;let d=(c.headers.get("Content-Type")||"image/jpeg").split(";",1)[0].trim().toLowerCase();if(!d.startsWith("image/"))return await u(c),null;let e=await v(c,f);if(!e)return null;let h=e.toString("base64");return{url:`data:${d};base64,${h}`,mimeType:d}}catch{return await u(c),null}finally{i&&clearTimeout(i),d?.removeEventListener("abort",h)}}},22067:(a,b,c)=>{"use strict";c.d(b,{VC:()=>m,Xv:()=>i,a0:()=>n});var d=c(55511),e=c.n(d);let f=-0x340d631b7bdddcdbn;e().randomUUID();try{let a=c(39852);a.machineIdSync||a.default?.machineIdSync}catch{}function g(a){return"string"==typeof a&&a.trim().length>0?a.trim():null}function h(a,b){let c=a?.providerSpecificData;return c&&"object"==typeof c?g(c[b]):null}function i(){return"antigravity"}let j="[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",k=RegExp(`^agent/${j}/\\d{13}/${j}/[1-9]\\d{0,9}$`,"i");function l(a){let b=e().createHash("sha256").update(String(a||"antigravity")).digest().subarray(0,16);b[6]=15&b[6]|80,b[8]=63&b[8]|128;let c=b.toString("hex");return`${c.slice(0,8)}-${c.slice(8,12)}-${c.slice(12,16)}-${c.slice(16,20)}-${c.slice(20)}`}function m({body:a,request:b,credentials:c,model:d,requestType:e}={}){if(k.test(a?.requestId||""))return a.requestId;let f=b?.sessionId||a?.request?.sessionId||c?._clientSessionId||c?.connectionId||c?.email||"anonymous",g=l(`antigravity:conversation:${f}`),h=l(`antigravity:trajectory:${f}:${d||"unknown"}:${e||"agent"}`),i=Math.max(1,2*(Array.isArray(b?.contents)?b.contents.length:1)-1);return`agent/${g}/${Date.now()}/${h}/${i}`}function n(a,b){return function(a){let b=g(a);if(!b)return null;let c=f;for(let a of Buffer.from(b,"utf8"))c=BigInt.asIntN(64,1099511628211n*(c=BigInt.asIntN(64,c^BigInt(a))));return c.toString()}(g(a?.email)||h(a,"email")||h(a,"accountId")||g(a?.connectionId)||null)||g(b)||function(){let a,b=0xffffffffffffffffn-0xffffffffffffffffn%0x7ce66c50e2840000n;do a=e().randomBytes(8).readBigUInt64BE();while(a>=b);return`-${(a%0x7ce66c50e2840000n).toString()}`}()}},22409:(a,b,c)=>{"use strict";c.d(b,{F:()=>h});var d=c(66678),e=c(30395),f=c(32210),g=c(42541);class h extends d.L{constructor(){super("xiaomi-tokenplan")}buildUrl(a,b,c=0,d=null){let h=(0,e.Yg)(d);return(0,f.ux)(a,a)===g.h.CLAUDE?`${h.replace(/\/v1\/?$/,"/anthropic/v1")}/messages`:`${h}/chat/completions`}}},23242:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ollamaBodyToOpenAI:()=>j,ollamaToOpenAI:()=>g});var d=c(56294),e=c(42541),f=c(90943);function g(a,b){if(!a||"object"!=typeof a)return null;b.ollama||(b.ollama={id:`chatcmpl-${Date.now()}`,created:Math.floor(Date.now()/1e3),model:a.model||b.model});let{id:c,created:d,model:g}=b.ollama;if(a.done){let i=h(a);return{id:c,object:"chat.completion.chunk",created:d,model:g,choices:[{index:0,delta:{},finish_reason:(0,f.Jm)(a.done_reason,{format:e.h.OLLAMA,hasToolCalls:b.hadToolCalls})}],usage:i}}let j=a.message;if(!j)return null;let k="string"==typeof j.content?j.content:"",l="string"==typeof j.thinking?j.thinking:"",m=Array.isArray(j.tool_calls)?j.tool_calls:null;if(!k&&!l&&!m)return null;k&&(b.accumulatedContent=(b.accumulatedContent||"")+k),l&&(b.accumulatedThinking=(b.accumulatedThinking||"")+l);let n={};return k&&(n.content=k),l&&(n.reasoning_content=l),m&&(b.hadToolCalls=!0,n.tool_calls=i(m)),{id:c,object:"chat.completion.chunk",created:d,model:g,choices:[{index:0,delta:n,finish_reason:null}]}}function h(a){return{prompt_tokens:a.prompt_eval_count||0,completion_tokens:a.eval_count||0,total_tokens:(a.prompt_eval_count||0)+(a.eval_count||0)}}function i(a){return a.map((a,b)=>({index:a.function?.index??b,id:a.id||`call_${b}_${Date.now()}`,type:"function",function:{name:a.function?.name||"",arguments:"string"==typeof a.function?.arguments?a.function.arguments:JSON.stringify(a.function?.arguments||{})}}))}function j(a){let b=a.message||{},c=b.content||"",d=b.thinking||"",g=Array.isArray(b.tool_calls)?b.tool_calls:[],j={role:"assistant"};c&&(j.content=c),d&&(j.reasoning_content=d),g.length>0&&(j.tool_calls=i(g)),j.content||j.tool_calls||(j.content="");let k=(0,f.Jm)(a.done_reason,{format:e.h.OLLAMA,hasToolCalls:g.length>0});return{id:`chatcmpl-${Date.now()}`,object:"chat.completion",created:Math.floor(Date.now()/1e3),model:a.model||"ollama",choices:[{index:0,message:j,finish_reason:k}],usage:h(a)}}(0,d.kz)(e.h.OLLAMA,e.h.OPENAI,null,g)},23423:(a,b,c)=>{"use strict";let d;a=c.nmd(a);let{Buffer:e}=c(4573);Object.defineProperty(a,"exports",{get:()=>d||(d=e.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml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IHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgLhocCAwd/A34BeyABIAJqIQQCQCAAIgMoAgwiAA0AIAMoAgQEQCADIAE2AgQLIwBBEGsiCSQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADKAIcIgJBAmsO/AEB+QECAwQFBgcICQoLDA0ODxAREvgBE/cBFBX2ARYX9QEYGRobHB0eHyD9AfsBIfQBIiMkJSYnKCkqK/MBLC0uLzAx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Qc4BDBALQc8BDA8LQdABDA4LQdEBDA0LQdIBDAwLQdMBDAsLQdQBDAoLQdUBDAkLQdYBDAgLQeMBDAcLQdcBDAYLQdgBDAULQdkBDAQLQdoBDAMLQdsBDAILQd0BDAELQdwBCyECA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAn8CQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAwJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ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QBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDCULIANBEjYCHCADIAA2AgwgAyABQQFqNgIUDIEDCyADQS9qLQAAQQFxRQ0BC0EXIQIM5gILQQAhAiADQQA2AhwgAyABNgIUIANB4hc2AhAgA0EZNgIMDP4CCyAAQTtHDQAgAUEBaiEBDAwLQQAhAiADQQA2AhwgAyABNgIUIANBkhg2AhAgA0ECNgIMDPwCCyAAQRVGDShBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwM+wILIANBFDYCHCADIAE2AhQgAyAANgIMDPoCCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDPUCCyADQRU2AhwgAyAANgIMIAMgAUEBajYCFAz5AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzzAgsgA0EXNgIcIAMgADYCDCADIAFBAWo2AhQM+AILIABBFUYNI0EAIQIgA0EANgIcIAMgATYCFCADQdYMNgIQIANBIzYCDAz3AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQwdCyADQRk2AhwgAyAANgIMIAMgAUEBajYCFAz2AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzvAgsgA0EaNgIcIAMgADYCDCADIAFBAWo2AhQM9QILIABBFUYNH0EAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAz0AgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDBsLIANBHDYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgzzAgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDOsCCyADQR02AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8gILIABBO0cNASABQQFqIQELQSYhAgzXAgtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwM7wILIAEgBEcEQANAIAEtAABBIEcNhAIgBCABQQFqIgFHDQALQSwhAgzvAgtBLCECDO4CCyABIARGBEBBNCECDO4CCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtBNCECDO8CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNnwIgA0EyNgIcIAMgATYCFCADIAA2AgxBACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUEQCABQQFqIQEMnwILIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgztAgsgASAERwRAAkADQCABLQAAQTBrIgBB/wFxQQpPBEBBOiECDNcCCyADKQMgIgtCmbPmzJmz5swZVg0BIAMgC0IKfiIKNwMgIAogAK1C/wGDIgtCf4VWDQEgAyAKIAt8NwMgIAQgAUEBaiIBRw0AC0HAACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABQQFqIgEQMSIADRcM4gILQcAAIQIM7AILIAEgBEYEQEHJACECDOwCCwJAA0ACQCABLQAAQQlrDhgAAqICogKpAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAgCiAgsgBCABQQFqIgFHDQALQckAIQIM7AILIAFBAWohASADQS9qLQAAQQFxDaUCIANBADYCHCADIAE2AhQgA0GXEDYCECADQQo2AgxBACECDOsCCyABIARHBEADQCABLQAAQSBHDRUgBCABQQFqIgFHDQALQfgAIQIM6wILQfgAIQIM6gILIANBAjoAKAw4C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAzoAgtBACECDM4CC0ENIQIMzQILQRMhAgzMAgtBFSECDMsCC0EWIQIMygILQRghAgzJAgtBGSECDMgCC0EaIQIMxwILQRshAgzGAgtBHCECDMUCC0EdIQIMxAILQR4hAgzDAgtBHyECDMICC0EgIQIMwQILQSIhAgzAAgtBIyECDL8CC0ElIQIMvgILQeUAIQIMvQILIANBPTYCHCADIAE2AhQgAyAANgIMQQAhAgzVAgsgA0EbNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIM1AILIANBIDYCHCADIAE2AhQgA0G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qwILIAFBAWohAUHXASECDKoCC0H2ASECIAEgBEYNwgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABButUAai0AAEcNAyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMwwILIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgBFBEBB4wEhAgyqAgsgA0H1ATYCHCADIAE2AhQgAyAANgIMQQAhAgzCAgtB9AEhAiABIARGDcECIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjVAGotAABHDQIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMICCyADQYEEOwEoIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgANAwwCCyADQQA2AgALQQAhAiADQQA2AhwgAyABNgIUIANB5R82AhAgA0EINgIMDL8CC0HVASECDKUCCyADQfMBNgIcIAMgATYCFCADIAA2AgxBACECDL0CC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ1uIABBFUcEQCADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgy9AgsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDLwCCyABIARHBEAgA0ENNgIIIAMgATYCBEHTASECDKMCC0HyASECDLsCCyABIARGBEBB8QEhAgy7AgsCQAJAAkAgAS0AAEHIAGsOCwABCAgICAgICAgCCAsgAUEBaiEBQdABIQIMowILIAFBAWohAUHRASECDKICCyABQQFqIQFB0gEhAgyhAgtB8AEhAiABIARGDbkCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEG11QBqLQAARw0EIABBAkYNAyAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy5AgtB7wEhAiABIARGDbgCIAMoAgAiACAEIAFraiEGIAEgAGtBAWohBQNAIAEtAAAgAEGz1QBqLQAARw0DIABBAUYNAiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy4AgtB7gEhAiABIARGDbcCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEGw1QBqLQAARw0CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy3AgsgAygCBCEAIANCADcDACADIAAgBUEBaiIBECsiAEUNAiADQewBNgIcIAMgATYCFCADIAA2AgxBACECDLYCCyADQQA2AgALIAMoAgQhACADQQA2AgQgAyAAIAEQKyIARQ2cAiADQe0BNgIcIAMgATYCFCADIAA2AgxBACECDLQCC0HPASECDJoCC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMtAILQc4BIQIMmgILIANB6wE2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyyAgsgASAERgRAQesBIQIMsgILIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMsQILQc0BIQIMlwILIAEgBEcEQCADQQ42AgggAyABNgIEQcwBIQIMlwILQeoBIQIMrwILIAEgBEYEQEHpASECDK8CCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHLASECDJYCCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNlwIgA0HoATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgASAERgRAQecBIQIMrgILAkAgAS0AAEEuRgRAIAFBAWohAQwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmAIgA0HmATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgtBygEhAgyUAgsgASAERgRAQeUBIQIMrQILQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIBNgIcIAMgATYCFCADIAA2AgxBACECDK8CCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmgIgA0HjATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5AE2AhwgAyABNgIUIAMgADYCDAytAgtByQEhAgyTAgtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GkDTYCECADQSE2AgxBACECDK0CC0HIASECDJMCCyADQeEBNgIcIAMgATYCFCADQdAaNgIQIANBFTYCDEEAIQIMqwILIAEgBEYEQEHhASECDKsCCwJAIAEtAABBIEYEQCADQQA7ATQgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GZETYCECADQQk2AgxBACECDKsCC0HHASECDJECCyABIARGBEBB4AEhAgyqAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKsCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyqAgtBxgEhAgyQAgsgASAERgRAQd8BIQIMqQILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyqAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqQILQcUBIQIMjwILIAEgBEYEQEHeASECDKgCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqQILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKgCC0HEASECDI4CCyABIARGBEBB3QEhAgynAgsCQAJAAkACQCABLQAAQQprDhcCAwMAAwMDAwMDAwMDAwMDAwMDAwMDAQMLIAFBAWoMBQsgAUEBaiEBQcMBIQIMjwILIAFBAWohASADQS9qLQAAQQFxDQggA0EANgIcIAMgATYCFCADQY0LNgIQIANBDTYCDEEAIQIMpwILIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKYCCyABIARHBEAgA0EPNgIIIAMgATYCBEEBIQIMjQILQdwBIQIMpQILAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0HbASECDKYCCyADKAIEIQAgA0EANgIEIAMgACABEC0iAEUEQCABQQFqIQEMBAsgA0HaATYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgylAgsgAygCBCEAIANBADYCBCADIAAgARAtIgANASABQQFqCyEBQcEBIQIMigILIANB2QE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMogILQcIBIQIMiAILIANBL2otAABBAXENASADQQA2AhwgAyABNgIUIANB5Bw2AhAgA0EZNgIMQQAhAgygAgsgASAERgRAQdkBIQIMoAILAkACQAJAIAEtAABBCmsOBAECAgACCyABQQFqIQEMAgsgAUEBaiEBDAELIAMtAC5BwABxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCPCICRQ0AIAMgAhEAACEACyAARQ2gASAAQRVGBEAgA0HZADYCHCADIAE2AhQgA0G3GjYCECADQRU2AgxBACECDJ8CCyADQQA2AhwgAyABNgIUIANBgA02AhAgA0EbNgIMQQAhA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IQUgASAAa0EDaiEGAkADQCABLQAAIABBjdUAai0AAEcNOyAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMjwILIANBADYCACAGQQFqIQFBIQw7CyABIARGBEBByQEhAgyOAgsCQAJAIAEtAABBwQBrDhQAPT09PT09PT09PT09PT09PT09AT0LIAFBAWohAUGtASECDPUBCyABQQFqIQFBsAEhAgz0AQsgASAERgRAQcgBIQIMjQILAkACQCABLQAAQdUAaw4LADw8PDw8PDw8PAE8CyABQQFqIQFBrgEhAgz0AQsgAUEBaiEBQa8BIQIM8wELQccBIQIgASAERg2LAiADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw04IABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyMAgsgA0EANgIAIAZBAWohAUEqDDgLIAEgBEYEQEHGASECDIsCCyABLQAAQdAARw04IAFBAWohAUElDDcLQcUBIQIgASAERg2JAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGB1QBqLQAARw02IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyKAgsgA0EANgIAIAZBAWohAUEODDYLIAEgBEYEQEHEASECDIkCCyABLQAAQcUARw02IAFBAWohAUGrASECDO8BCyABIARGBEBBwwEhAgyIAgsCQAJAAkACQCABLQAAQcIAaw4PAAECOTk5OTk5OTk5OTkDOQsgAUEBaiEBQacBIQIM8QELIAFBAWohAUGoASECDPABCyABQQFqIQFBqQEhAgzvAQsgAUEBaiEBQaoBIQIM7gELQcIBIQIgASAERg2GAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH+1ABqLQAARw0zIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyHAgsgA0EANgIAIAZBAWohAUEUDDMLQcEBIQIgASAERg2FAiADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEH51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qIQYCQANAIAEtAAAgAEHK1ABqLQAARw0ZIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAztAQsgA0EANgIAIAZBAWohAUEVDBkLQacBIQIgASAERg3rASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHH1ABqLQAARw0YIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzsAQsgA0EANgIAIAZBAWohAUEXDBgLQaYBIQIgASAERg3qASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHB1ABqLQAARw0XIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzrAQsgA0EANgIAIAZBAWohAUEYDBcLIAEgBEYEQEGlASECDOoBCwJAAkAgAS0AAEHJAGsOBwAZGRkZGQEZCyABQQFqIQFBiwEhAgzRAQsgAUEBaiEBQYwBIQIM0AELQaQBIQIgASAERg3oASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw0VIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzpAQsgA0EANgIAIAZBAWohAUEJDBULQaMBIQIgASAERg3nASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw0UIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzoAQsgA0EANgIAIAZBAWohAUEfDBQLQaIBIQIgASAERg3mASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEG+1ABqLQAARw0TIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAznAQsgA0EANgIAIAZBAWohAUECDBMLQaEBIQIgASAERg3lASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYDQCABLQAAIABBvNQAai0AAEcNESAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5QELIAEgBEYEQEGgASECDOUBC0EBIAEtAABB3wBHDREaIAFBAWohAUGHASECDMsBCyADQQA2AgAgBkEBaiEBQYgBIQIMygELQZ8BIQIgASAERg3iASADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw0PIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzjAQsgA0EANgIAIAZBAWohAUEpDA8LQZ4BIQIgASAERg3hASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEG41ABqLQAARw0OIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAziAQsgA0EANgIAIAZBAWohAUEtDA4LIAEgBEYEQEGdASECDOEBCyABLQAAQcUARw0OIAFBAWohAUGEASECDMcBCyABIARGBEBBnAEhAgzgAQsCQAJAIAEtAABBzABrDggADw8PDw8PAQ8LIAFBAWohAUGCASECDMcBCyABQQFqIQFBgwEhAgzGAQtBmwEhAiABIARGDd4BIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQbPUAGotAABHDQsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN8BCyADQQA2AgAgBkEBaiEBQSMMCwtBmgEhAiABIARGDd0BIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDUAGotAABHDQogAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN4BCyADQQA2AgAgBkEBaiEBQQAMCgsgASAERgRAQZkBIQIM3QELAkACQCABLQAAQcgAaw4IAAwMDAwMDAEMCyABQQFqIQFB/QAhAgzEAQsgAUEBaiEBQYABIQIMwwELIAEgBEYEQEGYASECDNwBCwJAAkAgAS0AAEHOAGsOAwALAQsLIAFBAWohAUH+ACECDMMBCyABQQFqIQFB/wAhAgzCAQsgASAERgRAQZcBIQIM2wELIAEtAABB2QBHDQggAUEBaiEBQQgMBwtBlgEhAiABIARGDdkBIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQazUAGotAABHDQYgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNoBCyADQQA2AgAgBkEBaiEBQQUMBgtBlQEhAiABIARGDdgBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQabUAGotAABHDQUgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNkBCyADQQA2AgAgBkEBaiEBQRYMBQtBlAEhAiABIARGDdcBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDQQgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNgBCyADQQA2AgAgBkEBaiEBQRAMBAsgASAERgRAQZMBIQIM1wELAkACQCABLQAAQcMAaw4MAAYGBgYGBgYGBgYBBgsgAUEBaiEBQfkAIQIMvgELIAFBAWohAUH6ACECDL0BC0GSASECIAEgBEYN1QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBoNQAai0AAEcNAiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM1gELIANBADYCACAGQQFqIQFBJAwCCyADQQA2AgAMAgsgASAERgRAQZEBIQIM1AELIAEtAABBzABHDQEgAUEBaiEBQRMLOgApIAMoAgQhACADQQA2AgQgAyAAIAEQLiIADQIMAQtBACECIANBADYCHCADIAE2AhQgA0H+HzYCECADQQY2AgwM0QELQfgAIQIMtwELIANBkAE2AhwgAyABNgIUIAMgADYCDEEAIQIMzwELQQAhAAJAIAMoAjgiAkUNACACKAJAIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GCDzYCECADQSA2AgxBACECDM4BC0H3ACECDLQBCyADQY8BNgIcIAMgATYCFCADQewbNgIQIANBFTYCDEEAIQIMzAELIAEgBEYEQEGPASECDMwBCwJAIAEtAABBIEYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZsfNgIQIANBBjYCDEEAIQIMzAELQQIhAgyyAQsDQCABLQAAQSBHDQIgBCABQQFqIgFHDQALQY4BIQIMygELIAEgBEYEQEGNASECDMoBCwJAIAEtAABBCWsOBEoAAEoAC0H1ACECDLABCyADLQApQQVGBEBB9gAhAgywAQtB9AAhAgyvAQsgASAERgRAQYwBIQIMyAELIANBEDYCCCADIAE2AgQMCgsgASAERgRAQYsBIQIMxwELAkAgAS0AAEEJaw4ERwAARwALQfMAIQIMrQELIAEgBEcEQCADQRA2AgggAyABNgIEQfEAIQIMrQELQYoBIQIMxQELAkAgASAERwRAA0AgAS0AAEGg0ABqLQAAIgBBA0cEQAJAIABBAWsOAkkABAtB8AAhAgyvAQsgBCABQQFqIgFHDQALQYgBIQIMxgELQYgBIQIMxQELIANBADYCHCADIAE2AhQgA0HbIDYCECADQQc2AgxBACECDMQBCyABIARGBEBBiQEhAgzEAQsCQAJAAkAgAS0AAEGg0gBqLQAAQQFrDgNGAgABC0HyACECDKwBCyADQQA2AhwgAyABNgIUIANBtBI2AhAgA0EHNgIMQQAhAgzEAQtB6gAhAgyqAQsgASAERwRAIAFBAWohAUHvACECDKoBC0GHASECDMIBCyAEIAEiAEYEQEGGASECDMIBCyAALQAAIgFBL0YEQCAAQQFqIQFB7gAhAgypAQsgAUEJayICQRdLDQEgACEBQQEgAnRBm4CABHENQQwBCyAEIAEiAEYEQEGFASECDMEBCyAALQAAQS9HDQAgAEEBaiEBDAMLQQAhAiADQQA2AhwgAyAANgIUIANB2yA2AhAgA0EHNgIMDL8BCwJAAkACQAJAAkADQCABLQAAQaDOAGotAAAiAEEFRwRAAkACQCAAQQFrDghHBQYHCAAEAQgLQesAIQIMrQELIAFBAWohAUHtACECDKwBCyAEIAFBAWoiAUcNAAtBhAEhAgzDAQsgAUEBagwUCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDMEBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDMABCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDL8BCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy+AQsgASAERgRAQYMBIQIMvgELAkAgAS0AAEGgzgBqLQAAQQFrDgg+BAUGAAgCAwcLIAFBAWohAQtBAyECDKMBCyABQQFqDA0LQQAhAiADQQA2AhwgA0HREjYCECADQQc2AgwgAyABQQFqNgIUDLoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDLkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDLgBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDLcBCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy2AQtB7AAhAgycAQsgASAERgRAQYIBIQIMtQELIAFBAWoMAgsgASAERgRAQYEBIQIMtAELIAFBAWoMAQsgASAERg0BIAFBAWoLIQFBBCECDJgBC0GAASECDLABCwNAIAEtAABBoMwAai0AACIAQQJHBEAgAEEBRwRAQekAIQIMmQELDDELIAQgAUEBaiIBRw0AC0H/ACECDK8BCyABIARGBEBB/gAhAgyvAQsCQCABLQAAQQlrDjcvAwYvBAYGBgYGBgYGBgYGBgYGBgYGBgUGBgIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYABgsgAUEBagshAUEFIQIMlAELIAFBAWoMBgsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgyrAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgyqAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgypAQsgA0EANgIcIAMgATYCFCADQY0UNgIQIANBBzYCDEEAIQIMqAELAkACQAJAAkADQCABLQAAQaDKAGotAAAiAEEFRwRAAkAgAEEBaw4GLgMEBQYABgtB6AAhAgyUAQsgBCABQQFqIgFHDQALQf0AIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqAELIANBADYCHCADIAE2AhQgA0HkCDYCECADQQc2AgxBACECDKcBCyABIARGDQEgAUEBagshAUEGIQIMjAELQfwAIQIMpAELAkACQAJAAkADQCABLQAAQaDIAGotAAAiAEEFRwRAIABBAWsOBCkCAwQFCyAEIAFBAWoiAUcNAAtB+wAhAgynAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgymAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgylAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgykAQsgA0EANgIcIAMgATYCFCADQbwKNgIQIANBBzYCDEEAIQIMowELQc8AIQIMiQELQdEAIQIMiAELQecAIQIMhwELIAEgBEYEQEH6ACECDKABCwJAIAEtAABBCWsOBCAAACAACyABQQFqIQFB5gAhAgyGAQsgASAERgRAQfkAIQIMnwELAkAgAS0AAEEJaw4EHwAAHwALQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFBEBB4gEhAgyGAQsgAEEVRwRAIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDJ8BCyADQfgANgIcIAMgATYCFCADQeoaNgIQIANBFTYCDEEAIQIMngELIAEgBEcEQCADQQ02AgggAyABNgIEQeQAIQIMhQELQfcAIQIMnQELIAEgBEYEQEH2ACECDJ0BCwJAAkACQCABLQAAQcgAaw4LAAELCwsLCwsLCwILCyABQQFqIQFB3QAhAgyFAQsgAUEBaiEBQeAAIQIMhAELIAFBAWohAUHjACECDIMBC0H1ACECIAEgBEYNmwEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBtdUAai0AAEcNCCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMnAELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfQANgIcIAMgATYCFCADIAA2AgxBACECDJwBC0HiACECDIIBC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMnAELQeEAIQIMggELIANB8wA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyaAQsgAy0AKSIAQSNrQQtJDQkCQCAAQQZLDQBBASAAdEHKAHFFDQAMCgtBACECIANBADYCHCADIAE2AhQgA0HtCTYCECADQQg2AgwMmQELQfIAIQIgASAERg2YASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGz1QBqLQAARw0FIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAQsgAygCBCEAIANCADcDACADIAAgBkEBaiIBECsiAARAIANB8QA2AhwgAyABNgIUIAMgADYCDEEAIQIMmQELQd8AIQIMfwtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJkBC0HeACECDH8LIANB8AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyXAQsgAy0AKUEhRg0GIANBADYCHCADIAE2AhQgA0GRCjYCECADQQg2AgxBACECDJYBC0HvACECIAEgBEYNlQEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMlgELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgBFDQIgA0HtADYCHCADIAE2AhQgAyAANgIMQQAhAgyVAQsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNgAEgA0HuADYCHCADIAE2AhQgAyAANgIMQQAhAgyTAQtB3AAhAgx5C0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMkwELQdsAIQIMeQsgA0HsADYCHCADIAE2AhQgA0GAGzYCECADQRU2AgxBACECDJEBCyADLQApIgBBI0kNACAAQS5GDQAgA0EANgIcIAMgATYCFCADQckJNgIQIANBCDYCDEEAIQIMkAELQdoAIQIMdgsgASAERgRAQesAIQIMjwELAkAgAS0AAEEvRgRAIAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMQQAhAgyPAQtB2QAhAgx1CyABIARHBEAgA0EONgIIIAMgATYCBEHYACECDHULQeoAIQIMjQELIAEgBEYEQEHpACECDI0BCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHXACECDHQLIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ16IANB6AA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELIAEgBEYEQEHnACECDIwBCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDXsgA0HmADYCHCADIAE2AhQgAyAANgIMQQAhAgyMAQtB1gAhAgxyCyABIARGBEBB5QAhAgyLAQtBACEAQQE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QLIAMgAy8BMkEIcjsBMgwDC0ECIQIMAQtBBCECCyADQQE6ACwgAyADLwEyIAJyOwEyC0EvIQIMKwsgA0EANgIcIAMgATYCFCADQYQTNgIQIANBCzYCDEEAIQIMQwtB4QEhAgwpCyABIARGBEBBLiECDEILIANBADYCBCADQRI2AgggAyABIAEQMSIADQELQS4hAgwnCyADQS02AhwgAyABNgIUIAMgADYCDEEAIQIMPwtBACEAAkAgAygCOCICRQ0AIAIoAkwiAkUNACADIAIRAAAhAAsgAEUNACAAQRVHDQEgA0HYADYCHCADIAE2AhQgA0GzGzYCECADQRU2AgxBACECDD4LQcwAIQIMJAsgA0EANgIcIAMgATYCFCADQbMONgIQIANBHTYCDEEAIQIMPAsgASAERgRAQc4AIQIMPAsgAS0AACIAQSBGDQIgAEE6Rg0BCyADQQA6ACxBCSECDCELIAMoAgQhACADQQA2AgQgAyAAIAEQMCIADQEMAgsgAy0ALkEBcQRAQd4BIQIMIAsgAygCBCEAIANBADYCBCADIAAgARAwIgBFDQIgA0EqNgIcIAMgADYCDCADIAFBAWo2AhRBACECDDgLIANBywA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMNwsgAUEBaiEBQcAAIQIMHQsgAUEBaiEBDCwLIAEgBEYEQEErIQIMNQsCQCABLQAAQQpGBEAgAUEBaiEBDAELIAMtAC5BwABxRQ0GCyADLQAyQYABcQRAQQAhAAJAIAMoAjgiAkUNACACKAJcIgJFDQAgAyACEQAAIQALIABFDRIgAEEVRgRAIANBBTYCHCADIAE2AhQgA0GbGzYCECADQRU2AgxBACECDDYLIANBADYCHCADIAE2AhQgA0GQDjYCECADQRQ2AgxBACECDDULIANBMmohAiADEDVBACEAAkAgAygCOCIGRQ0AIAYoAigiBkUNACADIAYRAAAhAAsgAA4WAgEABAQEBAQEBAQEBAQEBAQEBAQEAwQLIANBAToAMAsgAiACLwEAQcAAcjsBAAtBKyECDBgLIANBKTYCHCADIAE2AhQgA0GsGTYCECADQRU2AgxBACECDDALIANBADYCH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NgIMIAMgAEEBajYCFEEAIQIMAwsgA0EANgIcIAMgADYCFCADQdceNgIQIANBCTYCDEEAIQIMAgsgASAERgRAQSghAgwCCyADQQk2AgggAyABNgIEQSchAgwBCyABIARGBEBBASECDAELA0ACQAJAAkAgAS0AAEEKaw4EAAEBAAELIAFBAWohAQwBCyABQQFqIQEgAy0ALkEgcQ0AQQAhAiADQQA2AhwgAyABNgIUIANBoSE2AhAgA0EFNgIMDAILQQEhAiABIARHDQALCyAJQRBqJAAgAkUEQCADKAIMIQAMAQsgAyACNgIcQQAhACADKAIEIgFFDQAgAyABIAQgAygCCBEBACIBRQ0AIAMgBDYCFCADIAE2AgwgASEACyAAC74CAQJ/IABBADoAACAAQeQAaiIBQQFrQQA6AAAgAEEAOgACIABBADoAASABQQNrQQA6AAAgAUECa0EAOgAAIABBADoAAyABQQRrQQA6AABBACAAa0EDcSIBIABqIgBBADYCAEHkACABa0F8cSICIABqIgFBBGtBADYCAAJAIAJBCUkNACAAQQA2AgggAEEANgIEIAFBCGtBADYCACABQQxrQQA2AgAgAkEZSQ0AIABBADYCGCAAQQA2AhQgAEEANgIQIABBADYCDCABQRBrQQA2AgAgAUEUa0EANgIAIAFBGGtBADYCACABQRxrQQA2AgAgAiAAQQRxQRhyIgJrIgFBIEkNACAAIAJqIQADQCAAQgA3AxggAEIANwMQIABCADcDCCAAQgA3AwAgAEEgaiEAIAFBIGsiAUEfSw0ACwsLVgEBfwJAIAAoAgwNAAJAAkACQAJAIAAtADEOAwEAAwILIAAoAjgiAUUNACABKAIwIgFFDQAgACABEQAAIgENAwtBAA8LAAsgAEHKGTYCEEEOIQELIAELGgAgACgCDEUEQCAAQd4fNgIQIABBFTYCDAsLFAAgACgCDEEVRgRAIABBADYCDAsLFAAgACgCDEEWRgRAIABBADYCDAsLBwAgACgCDAsHACAAKAIQCwkAIAAgATYCEAsHACAAKAIUCysAAkAgAEEnTw0AQv//////CSAArYhCAYNQDQAgAEECdEHQOGooAgAPCwALFwAgAEEvT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KAAtfBAUFBgUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanMAAsEAQAAAQBBwcwAC14CAgACAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAEGpzgALBQECAAEDAEHAzgALXwQFAAAFBQUFBQUFBQUFBQYFBQUFBQUFBQUFBQUABQAHCAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==","base64"))})},23740:(a,b,c)=>{"use strict";c.d(b,{Q2:()=>u,jO:()=>v});var d=c(38929),e=c(37149),f=c(93818),g=c(80668),h=c(83287),i=c(9757),j=c(92853),k=c(80742),l=c(57472),m=c(61691),n=c(14041);c(46777);let o="⚠️ Risk Notice: This provider uses a subscription/OAuth session not officially licensed for proxy/router use. Account may be restricted or banned. Use at your own risk.";function p(a){return{id:a.id,alias:a.alias,aliases:a.aliases,...a.display,authModes:a.authModes,passthroughModels:a.passthroughModels,serviceKinds:a.serviceKinds}}let q={poolside:p(k.A),"kilo-gateway":p(h.A),bazaarlink:p(g.A),llm7:p(i.A),openrouter:{id:"openrouter",alias:"openrouter",name:"OpenRouter",icon:"router",color:"#F97316",textIcon:"OR",website:"https://openrouter.ai",notice:{text:"Free tier: 27+ free models, 200 req/day; after $10 credit: 1,000 req/day (OpenRouter terms).",apiKeyUrl:"https://openrouter.ai/settings/keys"},modelsFetcher:{url:"https://openrouter.ai/api/v1/models",type:"openrouter-free"},passthroughModels:!0,serviceKinds:["llm","embedding","tts","imageToText"],embeddingConfig:{baseUrl:"https://openrouter.ai/api/v1/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"openai/text-embedding-3-small",name:"Text Embedding 3 Small (OpenRouter)",dimensions:1536},{id:"openai/text-embedding-3-large",name:"Text Embedding 3 Large (OpenRouter)",dimensions:3072},{id:"openai/text-embedding-ada-002",name:"Text Embedding Ada 002 (OpenRouter)",dimensions:1536}]}},nvidia:{id:"nvidia",alias:"nvidia",name:"NVIDIA NIM",icon:"developer_board",color:"#76B900",textIcon:"NV",website:"https://developer.nvidia.com/nim",notice:{text:"Free access for NVIDIA Developer Program members (prototyping & testing).",apiKeyUrl:"https://build.nvidia.com/settings/api-keys"},serviceKinds:["llm","tts","embedding"],ttsConfig:{baseUrl:"https://integrate.api.nvidia.com/v1/audio/speech",authType:"apikey",authHeader:"bearer",format:"nvidia-tts",models:[{id:"fastpitch",name:"FastPitch"},{id:"tacotron2",name:"Tacotron2"}]},embeddingConfig:{baseUrl:"https://integrate.api.nvidia.com/v1/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"nvidia/nv-embedqa-e5-v5",name:"NV EmbedQA E5 v5",dimensions:1024}]}},ollama:{id:"ollama",alias:"ollama",name:"Ollama Cloud",icon:"cloud",color:"#ffffffff",textIcon:"OL",website:"https://ollama.com",notice:{text:"Free tier: light usage, 1 cloud model at a time (limits reset every 5h & 7d). Pro $20/mo \xb7 Max $100/mo.",apiKeyUrl:"https://ollama.com/settings/keys"}},vertex:{id:"vertex",alias:"vx",name:"Vertex AI",icon:"cloud",color:"#4285F4",textIcon:"VX",website:"https://cloud.google.com/vertex-ai",notice:{text:"New Google Cloud accounts get $300 free credits. Requires GCP project + Service Account with Vertex AI API enabled.",apiKeyUrl:"https://console.cloud.google.com/iam-admin/serviceaccounts"}},gemini:{id:"gemini",alias:"gemini",name:"Gemini",icon:"diamond",color:"#4285F4",textIcon:"GE",mediaPriority:1,website:"https://ai.google.dev",notice:{apiKeyUrl:"https://aistudio.google.com/app/apikey"},serviceKinds:["llm","embedding","image","imageToText","webSearch","tts","stt"],sttConfig:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",authType:"apikey",authHeader:"key",format:"gemini-stt",models:[{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro (Best)"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash"},{id:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite (Cheapest)"},{id:"gemini-2.0-flash",name:"Gemini 2.0 Flash"}]},searchViaChat:{defaultModel:"gemini-2.5-flash",pricingUrl:"https://ai.google.dev/pricing",freeTier:"Free tier: 15 RPM, 1M tokens/day on gemini-2.5-flash via AI Studio."},embeddingConfig:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",authType:"apikey",authHeader:"key",models:[{id:"text-embedding-004",name:"Text Embedding 004",dimensions:768},{id:"embedding-001",name:"Embedding 001",dimensions:768}]},ttsConfig:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",authType:"apikey",authHeader:"key",format:"gemini-tts",models:[{id:"gemini-2.5-flash-preview-tts",name:"Gemini 2.5 Flash TTS"},{id:"gemini-2.5-pro-preview-tts",name:"Gemini 2.5 Pro TTS"}]}},"cloudflare-ai":{id:"cloudflare-ai",alias:"cf",name:"Cloudflare",icon:"cloud",color:"#F38020",textIcon:"CF",website:"https://developers.cloudflare.com/workers-ai/",notice:{text:"Workers AI free tier. Requires a Cloudflare API token and Account ID.",apiKeyUrl:"https://dash.cloudflare.com/profile/api-tokens"},serviceKinds:["llm","image"],hasProviderSpecificData:!0},byteplus:{id:"byteplus",alias:"bpm",name:"BytePlus ModelArk",icon:"cloud",color:"#2563EB",textIcon:"BP",website:"https://console.byteplus.com/ark",notice:{text:"Free credits for new accounts. Access to Seed 2.0, Kimi K2 Thinking, GLM 4.7, GPT-OSS-120B models.",apiKeyUrl:"https://console.byteplus.com/ark/region:ark+ap-southeast-1/apiKey"},serviceKinds:["llm"]}},r=[{id:"speech-2.8-hd",name:"Speech 2.8 HD"},{id:"speech-2.8-turbo",name:"Speech 2.8 Turbo"},{id:"speech-2.6-hd",name:"Speech 2.6 HD"},{id:"speech-2.6-turbo",name:"Speech 2.6 Turbo"},{id:"speech-02-hd",name:"Speech 02 HD"},{id:"speech-02-turbo",name:"Speech 02 Turbo"},{id:"speech-01-hd",name:"Speech 01 HD"},{id:"speech-01-turbo",name:"Speech 01 Turbo"}],s={claude:{id:"claude",alias:"cc",name:"Claude Code",icon:"smart_toy",color:"#D97757",deprecated:!0,deprecationNotice:o,website:"https://claude.ai",notice:{signupUrl:"https://claude.ai"}},antigravity:{id:"antigravity",alias:"ag",name:"Antigravity",icon:"rocket_launch",color:"#F59E0B",deprecated:!0,deprecationNotice:"⚠️ Risk Notice: This provider uses a subscription/OAuth session not officially licensed for proxy/router use. Account may be restricted or banned. Use at your own risk.",serviceKinds:["llm","image"],website:"https://antigravity.google",notice:{signupUrl:"https://antigravity.google"}},codex:{id:"codex",alias:"cx",name:"OpenAI Codex",icon:"code",color:"#3B82F6",deprecated:!0,deprecationNotice:o,thinkingConfig:{options:["auto","none","minimal","low","medium","high","xhigh","max","ultra"],defaultMode:"auto"},serviceKinds:["llm","image"],kindNotice:{image:"Requires a ChatGPT Plus (or higher) account. Free accounts are not supported for image generation."},website:"https://chatgpt.com/codex",notice:{signupUrl:"https://chatgpt.com/codex"}},github:{id:"github",alias:"gh",name:"GitHub Copilot",icon:"code",color:"#333333",deprecated:!0,deprecationNotice:o,serviceKinds:["llm","embedding"],embeddingConfig:{baseUrl:"https://models.github.ai/inference/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"text-embedding-3-small",name:"Text Embedding 3 Small (GitHub)",dimensions:1536},{id:"text-embedding-3-large",name:"Text Embedding 3 Large (GitHub)",dimensions:3072}]},website:"https://github.com/features/copilot",notice:{signupUrl:"https://github.com/features/copilot"}},cursor:{id:"cursor",alias:"cu",name:"Cursor IDE",icon:"edit_note",color:"#00D4AA",website:"https://cursor.com",notice:{signupUrl:"https://cursor.com"}},trae:{id:"trae",alias:"trae",name:"Trae",icon:"bolt",color:"#FF6A00",textIcon:"TR",deprecated:!0,deprecationNotice:o,hidden:!0,authModes:["oauth","apikey"],website:"https://www.trae.ai",notice:{text:"Sign in with Trae (browser), or paste a Cloud-IDE-JWT token from DevTools. Token lasts ~14 days.",signupUrl:"https://www.trae.ai"}},windsurf:{id:"windsurf",alias:"ws",name:"Windsurf",icon:"sailing",color:"#09B6A2",textIcon:"WS",deprecated:!0,deprecationNotice:o,hidden:!0,authModes:["oauth","apikey"],website:"https://windsurf.com",notice:{text:"Sign in with Windsurf (browser), or paste a Codeium API key (sk-ws-…). Chat runs over Codeium's gRPC-web backend.",signupUrl:"https://windsurf.com"}},zed:{id:"zed",alias:"zd",name:"Zed",icon:"bolt",color:"#084CCF",textIcon:"ZD",deprecated:!0,deprecationNotice:o,hidden:!0,authModes:["oauth"],website:"https://zed.dev",notice:{text:"Sign in with Zed (browser) — a local RSA keypair secures the callback. Zed fronts Anthropic/OpenAI/Google/xAI via cloud.zed.dev.",signupUrl:"https://zed.dev"}},"devin-cli":{id:"devin-cli",alias:"dv",name:"Devin CLI",icon:"terminal",color:"#6E56CF",textIcon:"DV",deprecated:!0,deprecationNotice:o,hidden:!0,noAuth:!0,authModes:["none"],website:"https://devin.ai",notice:{text:"Runs the local `devin acp` binary over stdio — requires the Devin CLI installed and logged in (devin auth login) on this host. Can execute host shell commands."}},xai:{id:d.A.id,alias:d.A.alias,...d.A.display,serviceKinds:d.A.serviceKinds,imageConfig:d.A.imageConfig,videoConfig:d.A.videoConfig,searchViaChat:d.A.searchViaChat,authModes:d.A.authModes,hasOAuth:d.A.hasOAuth},kimi:{id:"kimi",alias:"kimi",aliases:["kimi-coding","kmc"],name:"Kimi",icon:"psychology",color:"#1E3A8A",textIcon:"KM",website:"https://kimi.moonshot.cn",notice:{apiKeyUrl:"https://platform.moonshot.ai/console/api-keys",signupUrl:"https://www.kimi.com/code"},serviceKinds:["llm","webSearch"],searchViaChat:{defaultModel:"kimi-k3",pricingUrl:"https://platform.kimi.ai/docs/pricing/chat"},authModes:["oauth","apikey"],hasOAuth:!0},kilocode:{id:"kilocode",alias:"kc",name:"Kilo Code",icon:"code",color:"#FF6B35",textIcon:"KC",website:"https://kilocode.ai",notice:{signupUrl:"https://kilocode.ai"}},cline:{id:"cline",alias:"cl",name:"Cline",icon:"smart_toy",color:"#5B9BD5",textIcon:"CL",website:"https://cline.bot",notice:{signupUrl:"https://cline.bot"}},clinepass:{id:"clinepass",alias:"clinepass",name:"ClinePass",icon:"vpn_key",color:"#5B9BD5",textIcon:"CP",website:"https://cline.bot",notice:{signupUrl:"https://app.cline.bot"},authModes:["oauth","apikey"],hasOAuth:!0,thinkingConfig:{options:["auto","on","off"],defaultMode:"auto",defaultBudgetTokens:1e4}},kimchi:{id:"kimchi",alias:"kimchi",name:"Kimchi",icon:"restaurant",color:"#FF521D",textIcon:"KC",website:"https://kimchi.dev",notice:{signupUrl:"https://app.kimchi.dev"},hasOAuth:!0,passthroughModels:!0,serviceKinds:["llm","imageToText"]},"grok-cli":{id:"grok-cli",alias:"gcli",name:"Grok CLI (Grok Build)",icon:"auto_awesome",color:"#1DA1F2",textIcon:"GC",website:"https://x.ai",notice:{text:"Sign in with your xAI / Grok account via device code. Uses Grok Build subscription credits (cli-chat-proxy.grok.com).",signupUrl:"https://grok.com/supergrok"},hasOAuth:!0,thinkingConfig:{options:["low","medium","high"],defaultMode:"high"}},autoclaw:{id:"autoclaw",alias:"acl",name:"AutoClaw",icon:"bolt",color:"#7C3AED",textIcon:"AC",website:"https://autoclaw.z.ai",notice:{signupUrl:"https://autoclaw.z.ai"}}},t={"alims-intl":p(e.A),baidu:p(f.A),tokenrouter:p(m.A),"alitp-intl":p(n.A),morph:p(j.A),tencent:p(l.A),glm:{id:"glm",alias:"glm",name:"GLM Coding",icon:"code",color:"#2563EB",textIcon:"GL",website:"https://open.bigmodel.cn",notice:{apiKeyUrl:"https://open.bigmodel.cn/usercenter/apikeys"}},"glm-cn":{id:"glm-cn",alias:"glm-cn",name:"GLM (China)",icon:"code",color:"#DC2626",textIcon:"GC",website:"https://open.bigmodel.cn",notice:{apiKeyUrl:"https://open.bigmodel.cn/usercenter/apikeys"}},minimax:{id:"minimax",alias:"minimax",name:"Minimax Coding",icon:"memory",color:"#7C3AED",textIcon:"MM",website:"https://www.minimaxi.com",notice:{apiKeyUrl:"https://platform.minimaxi.com/user-center/basic-information/interface-key"},serviceKinds:["llm","image","imageToText","webSearch","tts"],searchViaChat:{defaultModel:"MiniMax-M2.7",pricingUrl:"https://www.minimaxi.com/document/price"},ttsConfig:{baseUrl:"https://api.minimax.io/v1/t2a_v2",authType:"apikey",authHeader:"bearer",format:"minimax-tts",models:r}},"minimax-cn":{id:"minimax-cn",alias:"minimax-cn",name:"Minimax (China)",icon:"memory",color:"#DC2626",textIcon:"MC",website:"https://www.minimaxi.com",notice:{apiKeyUrl:"https://platform.minimaxi.com/user-center/basic-information/interface-key"},serviceKinds:["llm","tts"],ttsConfig:{baseUrl:"https://api.minimaxi.com/v1/t2a_v2",authType:"apikey",authHeader:"bearer",format:"minimax-tts",models:r}},alicode:{id:"alicode",alias:"alicode",name:"Alibaba",icon:"cloud",color:"#FF6A00",textIcon:"ALi",website:"https://bailian.console.aliyun.com",notice:{apiKeyUrl:"https://bailian.console.aliyun.com/?apiKey=1"}},"alicode-intl":{id:"alicode-intl",alias:"alicode-intl",name:"Alibaba Intl",icon:"cloud",color:"#FF6A00",textIcon:"ALi",website:"https://modelstudio.console.alibabacloud.com",notice:{apiKeyUrl:"https://modelstudio.console.alibabacloud.com/?apiKey=1"}},"xiaomi-mimo":{id:"xiaomi-mimo",alias:"mimo",name:"Xiaomi MiMo",icon:"smart_toy",color:"#FF6900",textIcon:"XM",website:"https://xiaomimimo.com",notice:{apiKeyUrl:"https://platform.xiaomimimo.com/console/api-keys"},serviceKinds:["llm","tts"],ttsConfig:{baseUrl:"https://api.xiaomimimo.com/v1/chat/completions",authType:"apikey",authHeader:"bearer",format:"xiaomi-mimo-tts",models:[{id:"mimo-v2.5-tts",name:"MiMo V2.5 TTS"}]}},"xiaomi-tokenplan":{id:"xiaomi-tokenplan",alias:"xmtp",name:"Xiaomi MiMo (Token Plan)",icon:"smart_toy",color:"#FF6700",textIcon:"XT",website:"https://mimo.xiaomi.com",notice:{text:"Xiaomi MiMo Token Plan subscription (API key starts with tp-). Token Plan keys are cluster-specific — select the region matching your subscription.",apiKeyUrl:"https://mimo.xiaomi.com"},hasProviderSpecificData:!0,regions:[{id:"sgp",label:"Singapore",baseUrl:"https://token-plan-sgp.xiaomimimo.com/v1"},{id:"cn",label:"China",baseUrl:"https://token-plan-cn.xiaomimimo.com/v1"},{id:"ams",label:"Europe",baseUrl:"https://token-plan-ams.xiaomimimo.com/v1"}],defaultRegion:"sgp"},"volcengine-ark":{id:"volcengine-ark",alias:"ark",name:"Volcengine Ark",icon:"cloud",color:"#1677FF",textIcon:"ARK",website:"https://ark.cn-beijing.volces.com",notice:{apiKeyUrl:"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey"}},openai:{id:"openai",alias:"openai",name:"OpenAI",icon:"auto_awesome",color:"#10A37F",textIcon:"OA",website:"https://platform.openai.com",notice:{apiKeyUrl:"https://platform.openai.com/api-keys"},serviceKinds:["llm","embedding","tts","stt","image","imageToText","webSearch"],thinkingConfig:{options:["auto","none","minimal","low","medium","high","xhigh","max"],defaultMode:"auto"},searchViaChat:{defaultModel:"gpt-4o-mini",pricingUrl:"https://openai.com/api/pricing"},ttsConfig:{baseUrl:"https://api.openai.com/v1/audio/speech",authType:"apikey",authHeader:"bearer",format:"openai",models:[{id:"tts-1",name:"TTS-1"},{id:"tts-1-hd",name:"TTS-1 HD"},{id:"gpt-4o-mini-tts",name:"GPT-4o Mini TTS"}]},sttConfig:{baseUrl:"https://api.openai.com/v1/audio/transcriptions",authType:"apikey",authHeader:"bearer",format:"openai",models:[{id:"whisper-1",name:"Whisper 1"},{id:"gpt-4o-transcribe",name:"GPT-4o Transcribe"},{id:"gpt-4o-mini-transcribe",name:"GPT-4o Mini Transcribe"}]},embeddingConfig:{baseUrl:"https://api.openai.com/v1/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"text-embedding-3-small",name:"Text Embedding 3 Small",dimensions:1536},{id:"text-embedding-3-large",name:"Text Embedding 3 Large",dimensions:3072},{id:"text-embedding-ada-002",name:"Text Embedding Ada 002",dimensions:1536}]}},"vercel-ai-gateway":{id:"vercel-ai-gateway",alias:"vercel",name:"Vercel AI Gateway",icon:"deployed_code",color:"#111827",textIcon:"VG",website:"https://vercel.com/ai-gateway",notice:{text:"Unified OpenAI-compatible endpoint from Vercel. Use your AI Gateway API key, then pick models with provider/model IDs like anthropic/claude-sonnet-4.6 or openai/gpt-5.4.",apiKeyUrl:"https://vercel.com/dashboard/~/ai-gateway"},passthroughModels:!0,serviceKinds:["llm","image"]},anthropic:{id:"anthropic",alias:"anthropic",name:"Anthropic",icon:"smart_toy",color:"#D97757",textIcon:"AN",website:"https://console.anthropic.com",notice:{apiKeyUrl:"https://console.anthropic.com/settings/keys"},serviceKinds:["llm","imageToText"]},"opencode-go":{id:"opencode-go",alias:"ocg",name:"OpenCode Go",icon:"terminal",color:"#E87040",textIcon:"OC",website:"https://opencode.ai/auth",notice:{text:"OpenCode Go subscription: $5/mo (then $10/mo). Access to Kimi, GLM, Qwen, MiMo, MiniMax models.",apiKeyUrl:"https://opencode.ai/auth"}},azure:{id:"azure",alias:"azure",name:"Azure OpenAI",icon:"cloud",color:"#0078D4",textIcon:"AZ",website:"https://azure.microsoft.com/en-us/products/ai-services/openai-service",notice:{apiKeyUrl:"https://portal.azure.com/#view/Microsoft_Azure_ProjectOxford/CognitiveServicesHub/~/OpenAI"},hasProviderSpecificData:!0},deepseek:{id:"deepseek",alias:"ds",name:"DeepSeek",icon:"bolt",color:"#4D6BFE",textIcon:"DS",website:"https://deepseek.com",notice:{apiKeyUrl:"https://platform.deepseek.com/api_keys"}},commandcode:{id:"commandcode",alias:"cmc",name:"Command Code",icon:"smart_toy",color:"#000000",textIcon:"CC",website:"https://commandcode.ai",notice:{text:"Use your CommandCode CLI API key (starts with user_...) from ~/.commandcode/auth.json or commandcode.ai/studio.",apiKeyUrl:"https://commandcode.ai/studio"}},groq:{id:"groq",alias:"groq",name:"Groq",icon:"speed",color:"#F55036",textIcon:"GQ",website:"https://groq.com",notice:{apiKeyUrl:"https://console.groq.com/keys"},serviceKinds:["llm","imageToText","stt"],sttConfig:{baseUrl:"https://api.groq.com/openai/v1/audio/transcriptions",authType:"apikey",authHeader:"bearer",format:"openai",models:[{id:"whisper-large-v3",name:"Whisper Large v3"},{id:"whisper-large-v3-turbo",name:"Whisper Large v3 Turbo"},{id:"distil-whisper-large-v3-en",name:"Distil Whisper Large v3 EN"}]}},mistral:{id:"mistral",alias:"mistral",name:"Mistral",icon:"air",color:"#FF7000",textIcon:"MI",website:"https://mistral.ai",notice:{apiKeyUrl:"https://console.mistral.ai/api-keys"},serviceKinds:["llm","imageToText","embedding"],embeddingConfig:{baseUrl:"https://api.mistral.ai/v1/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"mistral-embed",name:"Mistral Embed",dimensions:1024}]}},perplexity:{id:"perplexity",alias:"pplx",name:"Perplexity",icon:"search",color:"#20808D",textIcon:"PP",website:"https://www.perplexity.ai",notice:{apiKeyUrl:"https://www.perplexity.ai/settings/api"},serviceKinds:["llm","webSearch"],searchConfig:{baseUrl:"https://api.perplexity.ai/search",method:"POST",authType:"apikey",authHeader:"bearer",costPerQuery:.005,freeMonthlyQuota:0,searchTypes:["web"],defaultMaxResults:5,maxMaxResults:20,timeoutMs:1e4,cacheTTLMs:3e5}},"perplexity-agent":{id:"perplexity-agent",alias:"pa",name:"Perplexity Agent",icon:"travel_explore",color:"#20808D",textIcon:"PA",website:"https://www.perplexity.ai",notice:{text:"Perplexity Agent API exposes GPT, Claude, Gemini, Grok, GLM, Kimi, and Sonar models through one OpenAI-compatible Responses API.",apiKeyUrl:"https://www.perplexity.ai/settings/api"},passthroughModels:!0,modelsFetcher:{url:"https://api.perplexity.ai/v1/models",type:"openai"},serviceKinds:["llm","webSearch"],searchViaChat:{defaultModel:"perplexity/sonar",endpoint:"https://api.perplexity.ai/v1/responses",pricingUrl:"https://docs.perplexity.ai/docs/agent-api/models"}},clinepass:{id:"clinepass",alias:"clinepass",name:"ClinePass",icon:"vpn_key",color:"#5B9BD5",textIcon:"CP",website:"https://cline.bot",notice:{signupUrl:"https://app.cline.bot",apiKeyUrl:"https://app.cline.bot"},authModes:["oauth","apikey"],hasOAuth:!0},together:{id:"together",alias:"together",name:"Together AI",icon:"group_work",color:"#0F6FFF",textIcon:"TG",website:"https://www.together.ai",notice:{apiKeyUrl:"https://api.together.xyz/settings/api-keys"},serviceKinds:["llm","embedding"],embeddingConfig:{baseUrl:"https://api.together.xyz/v1/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"BAAI/bge-large-en-v1.5",name:"BGE Large EN v1.5",dimensions:1024},{id:"togethercomputer/m2-bert-80M-8k-retrieval",name:"M2 BERT 80M 8K",dimensions:768}]}},fireworks:{id:"fireworks",alias:"fireworks",name:"Fireworks AI",icon:"local_fire_department",color:"#7B2EF2",textIcon:"FW",website:"https://fireworks.ai",notice:{apiKeyUrl:"https://fireworks.ai/account/api-keys"},serviceKinds:["llm","embedding"],embeddingConfig:{baseUrl:"https://api.fireworks.ai/inference/v1/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"nomic-ai/nomic-embed-text-v1.5",name:"Nomic Embed Text v1.5",dimensions:768}]}},venice:{id:"venice",alias:"venice",name:"Venice AI",icon:"shield",color:"#DC2626",textIcon:"VE",website:"https://venice.ai",notice:{text:"OpenAI-compatible. Private inference + uncensored models (Venice Uncensored, GLM, Qwen, DeepSeek, Llama).",apiKeyUrl:"https://venice.ai/settings/api"},passthroughModels:!0,modelsFetcher:{url:"https://api.venice.ai/api/v1/models",type:"openai"},serviceKinds:["llm","embedding","image"],embeddingConfig:{baseUrl:"https://api.venice.ai/api/v1/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"text-embedding-3-large",name:"Text Embedding 3 Large",dimensions:3072},{id:"text-embedding-bge-m3",name:"BGE-M3 Embedding",dimensions:1024}]}},featherless:{id:"featherless",alias:"fl",name:"Featherless",icon:"flutter_dash",color:"#111827",textIcon:"FL",website:"https://featherless.ai",notice:{apiKeyUrl:"https://featherless.ai/account/api-keys"},passthroughModels:!0,modelsFetcher:{url:"https://api.featherless.ai/v1/models",type:"openai"}},cerebras:{id:"cerebras",alias:"cerebras",name:"Cerebras",icon:"memory",color:"#FF4F00",textIcon:"CB",website:"https://www.cerebras.ai",notice:{apiKeyUrl:"https://cloud.cerebras.ai/platform"}},cohere:{id:"cohere",alias:"cohere",name:"Cohere",icon:"hub",color:"#39594D",textIcon:"CO",website:"https://cohere.com",notice:{apiKeyUrl:"https://dashboard.cohere.com/api-keys"}},nebius:{id:"nebius",alias:"nebius",name:"Nebius AI",icon:"cloud",color:"#6C5CE7",textIcon:"NB",website:"https://nebius.com",notice:{apiKeyUrl:"https://studio.nebius.com/settings/api-keys"},serviceKinds:["llm","embedding"],embeddingConfig:{baseUrl:"https://api.tokenfactory.nebius.com/v1/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"Qwen/Qwen3-Embedding-8B",name:"Qwen3 Embedding 8B",dimensions:4096}]}},siliconflow:{id:"siliconflow",alias:"siliconflow",name:"SiliconFlow",icon:"cloud_queue",color:"#5B6EF5",textIcon:"SF",website:"https://cloud.siliconflow.com",notice:{apiKeyUrl:"https://cloud.siliconflow.com/account/ak"}},hyperbolic:{id:"hyperbolic",alias:"hyp",name:"Hyperbolic",icon:"bolt",color:"#00D4FF",textIcon:"HY",website:"https://hyperbolic.xyz",notice:{apiKeyUrl:"https://app.hyperbolic.xyz/settings"},serviceKinds:["llm","tts"],ttsConfig:{baseUrl:"https://api.hyperbolic.xyz/v1/audio/generation",authType:"apikey",authHeader:"bearer",format:"hyperbolic",models:[{id:"melo-tts",name:"Melo TTS"}]}},deepgram:{id:"deepgram",alias:"dg",name:"Deepgram",icon:"mic",color:"#13EF93",textIcon:"DG",website:"https://deepgram.com",notice:{text:"$200 free credit on signup (no card required). Aura-1: $0.015/1k chars, Aura-2: $0.030/1k chars (Pay-As-You-Go).",apiKeyUrl:"https://console.deepgram.com/api-keys"},serviceKinds:["stt","imageToText","tts"],ttsConfig:{baseUrl:"https://api.deepgram.com/v1/speak",authType:"apikey",authHeader:"token",format:"deepgram",models:[]},sttConfig:{baseUrl:"https://api.deepgram.com/v1/listen",authType:"apikey",authHeader:"token",format:"deepgram",models:[{id:"nova-3",name:"Nova 3"},{id:"nova-2",name:"Nova 2"},{id:"whisper-large",name:"Whisper Large"}]}},assemblyai:{id:"assemblyai",alias:"aai",name:"AssemblyAI",icon:"record_voice_over",color:"#0062FF",textIcon:"AA",website:"https://assemblyai.com",notice:{apiKeyUrl:"https://www.assemblyai.com/app/api-keys"},serviceKinds:["stt"],sttConfig:{baseUrl:"https://api.assemblyai.com/v2/transcript",authType:"apikey",authHeader:"bearer",format:"assemblyai",async:!0,models:[{id:"universal-3-pro",name:"Universal 3 Pro"},{id:"universal-2",name:"Universal 2"}]}},nanobanana:{id:"nanobanana",alias:"nb",name:"NanoBanana API",icon:"extension",color:"#FFD700",textIcon:"\uD83C\uDF4C",website:"https://nanobananaapi.ai",notice:{text:"3rd-party proxy for Google Nano Banana (Gemini 2.5/3 Flash Image). For official, use Gemini provider.",apiKeyUrl:"https://nanobananaapi.ai/dashboard"},serviceKinds:["image"]},elevenlabs:{id:"elevenlabs",alias:"el",name:"ElevenLabs",icon:"record_voice_over",color:"#6C47FF",textIcon:"EL",website:"https://elevenlabs.io",notice:{apiKeyUrl:"https://elevenlabs.io/app/settings/api-keys"},serviceKinds:["tts"],ttsConfig:{baseUrl:"https://api.elevenlabs.io/v1/text-to-speech",authType:"apikey",authHeader:"xi-api-key",format:"elevenlabs",models:[{id:"eleven_multilingual_v2",name:"Eleven Multilingual v2"},{id:"eleven_turbo_v2_5",name:"Eleven Turbo v2.5"}]}},"fish-audio":{id:"fish-audio",alias:"fish",name:"Fish Audio",icon:"graphic_eq",color:"#00C2FF",textIcon:"FA",website:"https://fish.audio",notice:{apiKeyUrl:"https://fish.audio/app/api-keys/"},serviceKinds:["tts"],ttsConfig:{baseUrl:"https://api.fish.audio/v1/tts",authType:"apikey",authHeader:"bearer",format:"fish-audio",models:[{id:"s2.1-pro-free",name:"S2.1 Pro Free"},{id:"s2.1-pro",name:"S2.1 Pro"},{id:"s2-pro",name:"S2 Pro"},{id:"s1",name:"S1"}]}},cartesia:{id:"cartesia",alias:"cartesia",name:"Cartesia",icon:"spatial_audio",color:"#FF4F8B",textIcon:"CA",website:"https://cartesia.ai",notice:{apiKeyUrl:"https://play.cartesia.ai/keys"},serviceKinds:["tts"],hidden:!0,ttsConfig:{baseUrl:"https://api.cartesia.ai/tts/bytes",authType:"apikey",authHeader:"x-api-key",format:"cartesia",models:[{id:"sonic-2",name:"Sonic 2"},{id:"sonic-3",name:"Sonic 3"}]}},playht:{id:"playht",alias:"playht",name:"PlayHT",icon:"play_circle",color:"#00B4D8",textIcon:"PH",website:"https://play.ht",notice:{apiKeyUrl:"https://play.ht/studio/api-access"},serviceKinds:["tts"],hidden:!0,ttsConfig:{baseUrl:"https://api.play.ht/api/v2/tts/stream",authType:"apikey",authHeader:"playht",format:"playht",models:[{id:"PlayDialog",name:"PlayDialog"},{id:"Play3.0-mini",name:"Play 3.0 Mini"}]}},"local-device":{id:"local-device",alias:"local-device",name:"Local Device",icon:"speaker",color:"#64748B",textIcon:"LD",mediaPriority:5,serviceKinds:["tts"],noAuth:!0,ttsConfig:{baseUrl:"local-device",authType:"none",authHeader:"none",format:"local-device",models:[]}},"google-tts":{id:"google-tts",alias:"google-tts",name:"Google TTS",icon:"record_voice_over",color:"#4285F4",textIcon:"GT",mediaPriority:5,serviceKinds:["tts"],noAuth:!0,ttsConfig:{baseUrl:"google-tts",authType:"none",authHeader:"none",format:"google-tts",models:[]}},"edge-tts":{id:"edge-tts",alias:"edge-tts",name:"Edge TTS",icon:"record_voice_over",color:"#0078D4",textIcon:"ET",mediaPriority:5,serviceKinds:["tts"],noAuth:!0,ttsConfig:{baseUrl:"edge-tts",authType:"none",authHeader:"none",format:"edge-tts",models:[]}},coqui:{id:"coqui",alias:"coqui",name:"Coqui TTS",icon:"record_voice_over",color:"#10B981",textIcon:"CQ",website:"https://github.com/coqui-ai/TTS",serviceKinds:["tts"],hidden:!0,noAuth:!0,ttsConfig:{baseUrl:"http://localhost:5002/api/tts",authType:"none",authHeader:"none",format:"coqui",models:[{id:"tts_models/en/ljspeech/tacotron2-DDC",name:"Tacotron2 DDC (LJSpeech)"}]}},tortoise:{id:"tortoise",alias:"tortoise",name:"Tortoise TTS",icon:"record_voice_over",color:"#7C3AED",textIcon:"TT",website:"https://github.com/neonbjb/tortoise-tts",serviceKinds:["tts"],hidden:!0,noAuth:!0,ttsConfig:{baseUrl:"http://localhost:5000/api/tts",authType:"none",authHeader:"none",format:"tortoise",models:[{id:"tortoise-v2",name:"Tortoise v2"}]}},inworld:{id:"inworld",alias:"inworld",name:"Inworld TTS",icon:"record_voice_over",color:"#FF6B6B",textIcon:"IW",website:"https://inworld.ai",notice:{text:"Free tier: 40 minutes/month TTS. Paid: TTS-1.5 Mini $0.01/min ($15/1M chars), TTS-1.5 Max $0.025/min ($30/1M chars). 270+ voices, 15 languages.",apiKeyUrl:"https://platform.inworld.ai/api-keys"},serviceKinds:["tts"],ttsConfig:{baseUrl:"https://api.inworld.ai/tts/v1/voice",authType:"apikey",authHeader:"basic",format:"inworld",models:[{id:"inworld-tts-1.5-mini",name:"Inworld TTS 1.5 Mini ($0.01/min)"},{id:"inworld-tts-1.5-max",name:"Inworld TTS 1.5 Max ($0.025/min)"}]}},"voyage-ai":{id:"voyage-ai",alias:"voyage",name:"Voyage AI",icon:"data_array",color:"#0EA5E9",textIcon:"VG",website:"https://www.voyageai.com",notice:{apiKeyUrl:"https://dash.voyageai.com/api-keys"},serviceKinds:["embedding"],embeddingConfig:{baseUrl:"https://api.voyageai.com/v1/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"voyage-3-large",name:"Voyage 3 Large",dimensions:1024},{id:"voyage-3.5",name:"Voyage 3.5",dimensions:1024},{id:"voyage-3.5-lite",name:"Voyage 3.5 Lite",dimensions:1024},{id:"voyage-code-3",name:"Voyage Code 3",dimensions:1024},{id:"voyage-finance-2",name:"Voyage Finance 2",dimensions:1024},{id:"voyage-law-2",name:"Voyage Law 2",dimensions:1024},{id:"voyage-multilingual-2",name:"Voyage Multilingual 2",dimensions:1024}]}},sdwebui:{id:"sdwebui",alias:"sdwebui",name:"SD WebUI",icon:"brush",color:"#FF7043",textIcon:"SD",website:"https://github.com/AUTOMATIC1111/stable-diffusion-webui",serviceKinds:["image"]},comfyui:{id:"comfyui",alias:"comfyui",name:"ComfyUI",icon:"account_tree",color:"#4CAF50",textIcon:"CF",website:"https://github.com/comfyanonymous/ComfyUI",serviceKinds:["image"]},huggingface:{id:"huggingface",alias:"hf",name:"HuggingFace",icon:"face",color:"#FFD21E",textIcon:"HF",website:"https://huggingface.co",notice:{apiKeyUrl:"https://huggingface.co/settings/tokens"},serviceKinds:["image","imageToText","tts","stt"],hiddenKinds:["tts"],ttsConfig:{baseUrl:"https://api-inference.huggingface.co/models",authType:"apikey",authHeader:"bearer",format:"huggingface-tts",models:[{id:"facebook/mms-tts-eng",name:"MMS TTS English"},{id:"microsoft/speecht5_tts",name:"SpeechT5 TTS"}]},sttConfig:{baseUrl:"https://api-inference.huggingface.co/models",authType:"apikey",authHeader:"bearer",format:"huggingface-asr",models:[{id:"openai/whisper-large-v3",name:"Whisper Large v3 (HF)"},{id:"openai/whisper-small",name:"Whisper Small (HF)"}]}},blackbox:{id:"blackbox",alias:"bb",name:"Blackbox AI",icon:"smart_toy",color:"#5B5FEF",textIcon:"BB",website:"https://blackbox.ai",notice:{apiKeyUrl:"https://www.blackbox.ai/api-management"},serviceKinds:["llm"]},chutes:{id:"chutes",alias:"ch",name:"Chutes AI",icon:"water_drop",color:"#ffffffff",textIcon:"CH",website:"https://chutes.ai",notice:{apiKeyUrl:"https://chutes.ai/app/api"}},"ollama-local":{id:"ollama-local",alias:"ollama-local",name:"Ollama Local",icon:"cloud",color:"#ffffffff",textIcon:"OL",website:"https://ollama.com"},"vertex-partner":{id:"vertex-partner",alias:"vxp",name:"Vertex Partner",icon:"cloud",color:"#34A853",textIcon:"VP",website:"https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-partner-models",notice:{apiKeyUrl:"https://console.cloud.google.com/iam-admin/serviceaccounts"}},tavily:{id:"tavily",alias:"tavily",name:"Tavily",icon:"search",color:"#5B21B6",textIcon:"TV",website:"https://tavily.com",notice:{apiKeyUrl:"https://app.tavily.com/home"},serviceKinds:["webSearch","webFetch"],searchConfig:{baseUrl:"https://api.tavily.com/search",method:"POST",authType:"apikey",authHeader:"bearer",costPerQuery:.008,freeMonthlyQuota:1e3,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:20,timeoutMs:1e4,cacheTTLMs:3e5},fetchConfig:{baseUrl:"https://api.tavily.com/extract",method:"POST",authType:"apikey",authHeader:"bearer",costPerQuery:.008,freeMonthlyQuota:1e3,formats:["markdown","text"],maxCharacters:1e5,timeoutMs:15e3}},"brave-search":{id:"brave-search",alias:"brave",name:"Brave Search",icon:"travel_explore",color:"#FB542B",textIcon:"BR",website:"https://brave.com/search/api",notice:{apiKeyUrl:"https://api-dashboard.search.brave.com/app/keys"},serviceKinds:["webSearch"],searchConfig:{baseUrl:"https://api.search.brave.com/res/v1",method:"GET",authType:"apikey",authHeader:"x-subscription-token",costPerQuery:.005,freeMonthlyQuota:1e3,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:20,timeoutMs:1e4,cacheTTLMs:3e5}},serper:{id:"serper",alias:"serper",name:"Serper",icon:"search",color:"#4F46E5",textIcon:"SP",website:"https://serper.dev",notice:{apiKeyUrl:"https://serper.dev/api-key"},serviceKinds:["webSearch"],searchConfig:{baseUrl:"https://google.serper.dev",method:"POST",authType:"apikey",authHeader:"x-api-key",costPerQuery:.001,freeMonthlyQuota:2500,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:100,timeoutMs:1e4,cacheTTLMs:3e5}},exa:{id:"exa",alias:"exa",name:"Exa",icon:"manage_search",color:"#2563EB",textIcon:"EX",website:"https://exa.ai",notice:{apiKeyUrl:"https://dashboard.exa.ai/api-keys"},serviceKinds:["webSearch","webFetch"],searchConfig:{baseUrl:"https://api.exa.ai/search",method:"POST",authType:"apikey",authHeader:"x-api-key",costPerQuery:.007,freeMonthlyQuota:1e3,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:100,timeoutMs:1e4,cacheTTLMs:3e5},fetchConfig:{baseUrl:"https://api.exa.ai/contents",method:"POST",authType:"apikey",authHeader:"x-api-key",costPerQuery:.001,freeMonthlyQuota:1e3,formats:["text","markdown"],maxCharacters:1e5,timeoutMs:15e3}},searxng:{id:"searxng",alias:"searxng",name:"SearXNG",icon:"saved_search",color:"#3B82F6",textIcon:"SX",website:"https://docs.searxng.org",serviceKinds:["webSearch"],noAuth:!0,searchConfig:{baseUrl:"http://localhost:8888/search",method:"GET",authType:"none",authHeader:"none",costPerQuery:0,freeMonthlyQuota:999999,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:50,timeoutMs:1e4,cacheTTLMs:18e4}},"google-pse":{id:"google-pse",alias:"gpse",name:"Google PSE",icon:"search",color:"#4285F4",textIcon:"GP",website:"https://programmablesearchengine.google.com",notice:{apiKeyUrl:"https://programmablesearchengine.google.com/controlpanel/create"},serviceKinds:["webSearch"],searchConfig:{baseUrl:"https://www.googleapis.com/customsearch/v1",method:"GET",authType:"apikey",authHeader:"key",costPerQuery:.005,freeMonthlyQuota:3e3,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:10,timeoutMs:1e4,cacheTTLMs:3e5}},linkup:{id:"linkup",alias:"linkup",name:"Linkup",icon:"link",color:"#0EA5E9",textIcon:"LK",website:"https://linkup.so",notice:{apiKeyUrl:"https://app.linkup.so/api-keys"},serviceKinds:["webSearch"],searchConfig:{baseUrl:"https://api.linkup.so/v1/search",method:"POST",authType:"apikey",authHeader:"bearer",costPerQuery:.005,freeMonthlyQuota:1e3,searchTypes:["web"],defaultMaxResults:5,maxMaxResults:50,timeoutMs:1e4,cacheTTLMs:3e5}},searchapi:{id:"searchapi",alias:"searchapi",name:"SearchAPI",icon:"search",color:"#0EA5A4",textIcon:"SA",website:"https://www.searchapi.io",notice:{apiKeyUrl:"https://www.searchapi.io/dashboard"},serviceKinds:["webSearch"],searchConfig:{baseUrl:"https://www.searchapi.io/api/v1/search",method:"GET",authType:"apikey",authHeader:"api_key",costPerQuery:.004,freeMonthlyQuota:100,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:100,timeoutMs:1e4,cacheTTLMs:3e5}},youcom:{id:"youcom",alias:"youcom",name:"You.com Search",icon:"search",color:"#7C3AED",textIcon:"YC",website:"https://you.com",notice:{apiKeyUrl:"https://api.you.com"},serviceKinds:["webSearch"],searchConfig:{baseUrl:"https://ydc-index.io/v1/search",method:"GET",authType:"apikey",authHeader:"x-api-key",costPerQuery:.005,freeMonthlyQuota:0,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:100,timeoutMs:1e4,cacheTTLMs:3e5}},firecrawl:{id:"firecrawl",alias:"firecrawl",name:"Firecrawl",icon:"local_fire_department",color:"#F59E0B",textIcon:"FC",website:"https://firecrawl.dev",notice:{apiKeyUrl:"https://www.firecrawl.dev/app/api-keys"},serviceKinds:["webFetch"],fetchConfig:{baseUrl:"https://api.firecrawl.dev/v1/scrape",method:"POST",authType:"apikey",authHeader:"bearer",costPerQuery:.002,freeMonthlyQuota:500,formats:["markdown","html","text"],maxCharacters:2e5,timeoutMs:3e4}},"fal-ai":{id:"fal-ai",alias:"fal",name:"Fal.ai",icon:"image",color:"#2563EB",textIcon:"FL",website:"https://fal.ai",notice:{apiKeyUrl:"https://fal.ai/dashboard/keys"},serviceKinds:["image"],imageConfig:{baseUrl:"https://api.fal.ai/v1/models?limit=1",method:"GET",authType:"apikey",authHeader:"key"}},"stability-ai":{id:"stability-ai",alias:"stability",name:"Stability AI",icon:"image",color:"#8B5CF6",textIcon:"SA",website:"https://stability.ai",notice:{apiKeyUrl:"https://platform.stability.ai/account/keys"},serviceKinds:["image"],imageConfig:{baseUrl:"https://api.stability.ai/v1/user/account",method:"GET",authType:"apikey",authHeader:"bearer"}},"black-forest-labs":{id:"black-forest-labs",alias:"bfl",name:"Black Forest Labs",icon:"image",color:"#111827",textIcon:"BF",website:"https://blackforestlabs.ai",notice:{apiKeyUrl:"https://api.bfl.ai"},serviceKinds:["image"],imageConfig:{baseUrl:"https://api.bfl.ai/v1/get_result?id=ping",method:"GET",authType:"apikey",authHeader:"x-key"}},recraft:{id:"recraft",alias:"recraft",name:"Recraft",icon:"image",color:"#EC4899",textIcon:"RC",website:"https://recraft.ai",notice:{apiKeyUrl:"https://www.recraft.ai/profile/api"},serviceKinds:["image"],imageConfig:{baseUrl:"https://external.api.recraft.ai/v1/users/me",method:"GET",authType:"apikey",authHeader:"bearer"}},topaz:{id:"topaz",alias:"topaz",name:"Topaz",icon:"image",color:"#059669",textIcon:"TP",website:"https://topazlabs.com",notice:{apiKeyUrl:"https://topazlabs.com/account"},serviceKinds:["image"]},runwayml:{id:"runwayml",alias:"runway",name:"Runway ML",icon:"movie",color:"#000000",textIcon:"RW",website:"https://runwayml.com",notice:{apiKeyUrl:"https://dev.runwayml.com"},serviceKinds:["image","video"],imageConfig:{baseUrl:"https://api.dev.runwayml.com/v1/organization",method:"GET",authType:"apikey",authHeader:"bearer",extraHeaders:{"X-Runway-Version":"2024-11-06"}}},"aws-polly":{id:"aws-polly",alias:"polly",name:"AWS Polly",icon:"record_voice_over",color:"#FF9900",textIcon:"PL",website:"https://aws.amazon.com/polly/",notice:{text:"Use AWS Secret Access Key as API key; set providerSpecificData.accessKeyId and optional region.",apiKeyUrl:"https://console.aws.amazon.com/iam/home#/security_credentials"},serviceKinds:["tts"],hasProviderSpecificData:!0,ttsConfig:{baseUrl:"https://polly.{region}.amazonaws.com/v1/speech",authType:"apikey",authHeader:"aws-sigv4",format:"aws-polly",models:[{id:"standard",name:"Standard"},{id:"neural",name:"Neural"},{id:"long-form",name:"Long-form"},{id:"generative",name:"Generative"}]}},"jina-ai":{id:"jina-ai",alias:"jina",name:"Jina AI",icon:"blur_on",color:"#2563EB",textIcon:"JA",website:"https://jina.ai",notice:{text:"10M free tokens on signup (non-commercial; Jina terms apply).",apiKeyUrl:"https://jina.ai/?sui=apikey"},serviceKinds:["embedding"],embeddingConfig:{baseUrl:"https://api.jina.ai/v1/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"jina-embeddings-v3",name:"Jina Embeddings v3",dimensions:1024},{id:"jina-embeddings-v2-base-en",name:"Jina Embeddings v2 Base EN",dimensions:768},{id:"jina-embeddings-v2-base-code",name:"Jina Embeddings v2 Base Code",dimensions:768}]}},"jina-reader":{id:"jina-reader",alias:"jina",name:"Jina Reader",icon:"menu_book",color:"#000000",textIcon:"JR",website:"https://jina.ai/reader",notice:{apiKeyUrl:"https://jina.ai/?sui=apikey"},serviceKinds:["webFetch"],fetchConfig:{baseUrl:"https://r.jina.ai",method:"GET",authType:"apikey",authHeader:"bearer",costPerQuery:0,freeMonthlyQuota:1e6,formats:["markdown","text","html"],maxCharacters:2e5,timeoutMs:3e4}}},u={kiro:{id:"kiro",alias:"kr",name:"Kiro AI",icon:"psychology_alt",color:"#FF6B35",deprecated:!0,deprecationNotice:o,website:"https://kiro.dev",notice:{signupUrl:"https://kiro.dev"},authModes:["oauth","apikey"]},"gemini-cli":{id:"gemini-cli",alias:"gc",name:"Gemini CLI",icon:"terminal",color:"#4285F4",deprecated:!0,deprecationNotice:o,website:"https://github.com/google-gemini/gemini-cli",notice:{signupUrl:"https://github.com/google-gemini/gemini-cli"}},codebuddy:{id:"codebuddy",alias:"cb",name:"CodeBuddy",icon:"smart_toy",color:"#006EFF",deprecated:!0,deprecationNotice:o,website:"https://www.codebuddy.ai",notice:{signupUrl:"https://www.codebuddy.ai/login",apiKeyUrl:"https://www.codebuddy.ai/profile"},authModes:["oauth","apikey"]},"codebuddy-cn":{id:"codebuddy-cn",alias:"cb-cn",name:"CodeBuddy CN",icon:"smart_toy",color:"#1E40AF",deprecated:!0,deprecationNotice:o,website:"https://www.codebuddy.cn",notice:{signupUrl:"https://copilot.tencent.com",apiKeyUrl:"https://copilot.tencent.com/profile/"},authModes:["oauth","apikey"]},qoder:{id:"qoder",alias:"qd",name:"Qoder",icon:"water_drop",color:"#EC4899",deprecated:!0,deprecationNotice:o,website:"https://qoder.com",notice:{signupUrl:"https://qoder.com",apiKeyUrl:"https://qoder.com/account"},authModes:["oauth","apikey"]},opencode:{id:"opencode",alias:"oc",name:"OpenCode Free",icon:"terminal",color:"#E87040",textIcon:"OC",noAuth:!0,passthroughModels:!0,modelsFetcher:{url:"https://opencode.ai/zen/v1/models",type:"opencode-free"}},"mimo-free":{id:"mimo-free",alias:"mmf",name:"MiMo Code Free",icon:"smart_toy",color:"#FF6900",textIcon:"MF",noAuth:!0,hasFree:!0,passthroughModels:!0,website:"https://xiaomimimo.com",notice:{text:"Free Xiaomi MiMo Code endpoint (no API key). Uses bootstrap JWT + Chrome UA. May rate-limit or break if upstream anti-abuse changes."}},...q,...s,...t,"grok-web":{id:"grok-web",alias:"gw",name:"Grok Web (Subscription)",icon:"auto_awesome",color:"#1DA1F2",textIcon:"GW",website:"https://grok.com",authType:"cookie",authHint:"Paste your sso= cookie value from grok.com",passthroughModels:!0,serviceKinds:["llm"]},"perplexity-web":{id:"perplexity-web",alias:"pw",name:"Perplexity Web (Pro/Max)",icon:"search",color:"#20808D",textIcon:"PW",website:"https://www.perplexity.ai",authType:"cookie",authHint:"Paste your __Secure-next-auth.session-token cookie value from perplexity.ai",serviceKinds:["llm"]},"notion-ai":{id:"notion-ai",alias:"na",name:"Notion AI (Experimental)",icon:"auto_awesome",color:"#111111",textIcon:"NA",website:"https://www.notion.so",authType:"cookie",authHint:"Paste the token_v2 cookie (or full Cookie header) from your own Notion session. Space ID and user ID are optional and can be auto-resolved.",serviceKinds:["llm"]}};Object.values(u).reduce((a,b)=>{for(let c of(a[b.alias]=b.id,b.aliases||[]))a[c]=b.id;return a},{}),Object.values(u).reduce((a,b)=>(a[b.id]=b.alias,a),{});let v=["glm","glm-cn","minimax","minimax-cn","codebuddy","codebuddy-cn","qoder","cloudflare-ai","xai","clinepass","blackbox","ollama","kimi","deepseek","kiro"]},24081:(a,b,c)=>{"use strict";c.d(b,{cK:()=>k,y5:()=>l});var d=c(62239);global._dbAdapter||(global._dbAdapter={instance:null,initPromise:null,closePromise:null,logged:!1});let e=global._dbAdapter;async function f(){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 g(){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 h(){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 i(){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 j(){(0,d.Jh)();let a=await f();if(a||(a=await h()),a||(a=await g()),a||(a=await i()),!a)throw Error("[DB] No SQLite driver available (bun/node/better/sql.js all failed)");e.logged||(console.log(`[DB] Driver: ${a.driver} | file: ${d.AL}`),e.logged=!0);try{let{runMigrationOnce:b}=await c.e(5800).then(c.bind(c,85800));await b(a);let{runStartupMaintenanceOnce:d}=await c.e(3696).then(c.bind(c,33696));return d(a),a}catch(b){try{await a.close?.()}catch(a){console.warn(`[DB] failed to close partially initialized adapter: ${a.message}`)}throw b}}async function k(){if(e.instance)return e.instance;if(!e.initPromise){let a=j().then(a=>(e.instance=a,a)).catch(b=>{throw e.initPromise===a&&(e.initPromise=null),b});e.initPromise=a}return e.initPromise}async function l(){return e.closePromise||(e.closePromise=(async()=>{try{let{stopStartupMaintenance:a}=await c.e(3696).then(c.bind(c,33696));a();let b=e.instance||(e.initPromise?await e.initPromise:null);await b?.close?.()}finally{e.instance=null,e.initPromise=null,e.closePromise=null}})()),e.closePromise}"closePromise"in e||(e.closePromise=null)},24214:a=>{"use strict";function b(a,b,c,d,e,f,g){let h=new Date(Date.UTC(a,b,c,d,e,f));return a>=0&&a<=99&&h.setUTCFullYear(a),h.getUTCFullYear()===a&&h.getUTCMonth()===b&&h.getUTCDate()===c&&h.getUTCHours()===d&&h.getUTCMinutes()===e&&h.getUTCSeconds()===f&&h.getUTCDay()===g?h:void 0}a.exports={parseHttpDate:function(a){switch(a[3]){case",":return function(a){if(29!==a.length||" "!==a[4]||" "!==a[7]||" "!==a[11]||" "!==a[16]||":"!==a[19]||":"!==a[22]||" "!==a[25]||"G"!==a[26]||"M"!==a[27]||"T"!==a[28])return;let c=-1;if("S"===a[0]&&"u"===a[1]&&"n"===a[2])c=0;else if("M"===a[0]&&"o"===a[1]&&"n"===a[2])c=1;else if("T"===a[0]&&"u"===a[1]&&"e"===a[2])c=2;else if("W"===a[0]&&"e"===a[1]&&"d"===a[2])c=3;else if("T"===a[0]&&"h"===a[1]&&"u"===a[2])c=4;else if("F"===a[0]&&"r"===a[1]&&"i"===a[2])c=5;else{if("S"!==a[0]||"a"!==a[1]||"t"!==a[2])return;c=6}let d=0;if("0"===a[5]){let b=a.charCodeAt(6);if(b<49||b>57)return;d=b-48}else{let b=a.charCodeAt(5);if(b<49||b>51)return;let c=a.charCodeAt(6);if(c<48||c>57)return;d=(b-48)*10+(c-48)}let e=-1;if("J"===a[8]&&"a"===a[9]&&"n"===a[10])e=0;else if("F"===a[8]&&"e"===a[9]&&"b"===a[10])e=1;else if("M"===a[8]&&"a"===a[9])if("r"===a[10])e=2;else{if("y"!==a[10])return;e=4}else if("J"===a[8])if("a"===a[9]&&"n"===a[10])e=0;else if("u"!==a[9])return;else if("n"===a[10])e=5;else{if("l"!==a[10])return;e=6}else if("A"===a[8])if("p"===a[9]&&"r"===a[10])e=3;else{if("u"!==a[9]||"g"!==a[10])return;e=7}else if("S"===a[8]&&"e"===a[9]&&"p"===a[10])e=8;else if("O"===a[8]&&"c"===a[9]&&"t"===a[10])e=9;else if("N"===a[8]&&"o"===a[9]&&"v"===a[10])e=10;else{if("D"!==a[8]||"e"!==a[9]||"c"!==a[10])return;e=11}let f=a.charCodeAt(12);if(f<48||f>57)return;let g=a.charCodeAt(13);if(g<48||g>57)return;let h=a.charCodeAt(14);if(h<48||h>57)return;let i=a.charCodeAt(15);if(i<48||i>57)return;let j=0;if("0"===a[17]){let b=a.charCodeAt(18);if(b<48||b>57)return;j=b-48}else{let b=a.charCodeAt(17);if(b<48||b>50)return;let c=a.charCodeAt(18);if(c<48||c>57||50===b&&c>51)return;j=(b-48)*10+(c-48)}let k=0;if("0"===a[20]){let b=a.charCodeAt(21);if(b<48||b>57)return;k=b-48}else{let b=a.charCodeAt(20);if(b<48||b>53)return;let c=a.charCodeAt(21);if(c<48||c>57)return;k=(b-48)*10+(c-48)}let l=0;if("0"===a[23]){let b=a.charCodeAt(24);if(b<48||b>57)return;l=b-48}else{let b=a.charCodeAt(23);if(b<48||b>53)return;let c=a.charCodeAt(24);if(c<48||c>57)return;l=(b-48)*10+(c-48)}return b((f-48)*1e3+(g-48)*100+(h-48)*10+(i-48),e,d,j,k,l,c)}(a);case" ":return function(a){if(24!==a.length||" "!==a[7]||" "!==a[10]||" "!==a[19])return;let c=-1;if("S"===a[0]&&"u"===a[1]&&"n"===a[2])c=0;else if("M"===a[0]&&"o"===a[1]&&"n"===a[2])c=1;else if("T"===a[0]&&"u"===a[1]&&"e"===a[2])c=2;else if("W"===a[0]&&"e"===a[1]&&"d"===a[2])c=3;else if("T"===a[0]&&"h"===a[1]&&"u"===a[2])c=4;else if("F"===a[0]&&"r"===a[1]&&"i"===a[2])c=5;else{if("S"!==a[0]||"a"!==a[1]||"t"!==a[2])return;c=6}let d=-1;if("J"===a[4]&&"a"===a[5]&&"n"===a[6])d=0;else if("F"===a[4]&&"e"===a[5]&&"b"===a[6])d=1;else if("M"===a[4]&&"a"===a[5])if("r"===a[6])d=2;else{if("y"!==a[6])return;d=4}else if("J"===a[4])if("a"===a[5]&&"n"===a[6])d=0;else if("u"!==a[5])return;else if("n"===a[6])d=5;else{if("l"!==a[6])return;d=6}else if("A"===a[4])if("p"===a[5]&&"r"===a[6])d=3;else{if("u"!==a[5]||"g"!==a[6])return;d=7}else if("S"===a[4]&&"e"===a[5]&&"p"===a[6])d=8;else if("O"===a[4]&&"c"===a[5]&&"t"===a[6])d=9;else if("N"===a[4]&&"o"===a[5]&&"v"===a[6])d=10;else{if("D"!==a[4]||"e"!==a[5]||"c"!==a[6])return;d=11}let e=0;if(" "===a[8]){let b=a.charCodeAt(9);if(b<49||b>57)return;e=b-48}else{let b=a.charCodeAt(8);if(b<49||b>51)return;let c=a.charCodeAt(9);if(c<48||c>57)return;e=(b-48)*10+(c-48)}let f=0;if("0"===a[11]){let b=a.charCodeAt(12);if(b<48||b>57)return;f=b-48}else{let b=a.charCodeAt(11);if(b<48||b>50)return;let c=a.charCodeAt(12);if(c<48||c>57||50===b&&c>51)return;f=(b-48)*10+(c-48)}let g=0;if("0"===a[14]){let b=a.charCodeAt(15);if(b<48||b>57)return;g=b-48}else{let b=a.charCodeAt(14);if(b<48||b>53)return;let c=a.charCodeAt(15);if(c<48||c>57)return;g=(b-48)*10+(c-48)}let h=0;if("0"===a[17]){let b=a.charCodeAt(18);if(b<48||b>57)return;h=b-48}else{let b=a.charCodeAt(17);if(b<48||b>53)return;let c=a.charCodeAt(18);if(c<48||c>57)return;h=(b-48)*10+(c-48)}let i=a.charCodeAt(20);if(i<48||i>57)return;let j=a.charCodeAt(21);if(j<48||j>57)return;let k=a.charCodeAt(22);if(k<48||k>57)return;let l=a.charCodeAt(23);if(!(l<48)&&!(l>57))return b((i-48)*1e3+(j-48)*100+(k-48)*10+(l-48),d,e,f,g,h,c)}(a);default:return function(a){let c=-1,d=-1;if("S"===a[0])"u"===a[1]&&"n"===a[2]&&"d"===a[3]&&"a"===a[4]&&"y"===a[5]?(d=0,c=6):"a"===a[1]&&"t"===a[2]&&"u"===a[3]&&"r"===a[4]&&"d"===a[5]&&"a"===a[6]&&"y"===a[7]&&(d=6,c=8);else if("M"===a[0]&&"o"===a[1]&&"n"===a[2]&&"d"===a[3]&&"a"===a[4]&&"y"===a[5])d=1,c=6;else if("T"===a[0])"u"===a[1]&&"e"===a[2]&&"s"===a[3]&&"d"===a[4]&&"a"===a[5]&&"y"===a[6]?(d=2,c=7):"h"===a[1]&&"u"===a[2]&&"r"===a[3]&&"s"===a[4]&&"d"===a[5]&&"a"===a[6]&&"y"===a[7]&&(d=4,c=8);else if("W"===a[0]&&"e"===a[1]&&"d"===a[2]&&"n"===a[3]&&"e"===a[4]&&"s"===a[5]&&"d"===a[6]&&"a"===a[7]&&"y"===a[8])d=3,c=9;else{if("F"!==a[0]||"r"!==a[1]||"i"!==a[2]||"d"!==a[3]||"a"!==a[4]||"y"!==a[5])return;d=5,c=6}if(","!==a[c]||a.length-c-1!=23||" "!==a[c+1]||"-"!==a[c+4]||"-"!==a[c+8]||" "!==a[c+11]||":"!==a[c+14]||":"!==a[c+17]||" "!==a[c+20]||"G"!==a[c+21]||"M"!==a[c+22]||"T"!==a[c+23])return;let e=0;if("0"===a[c+2]){let b=a.charCodeAt(c+3);if(b<49||b>57)return;e=b-48}else{let b=a.charCodeAt(c+2);if(b<49||b>51)return;let d=a.charCodeAt(c+3);if(d<48||d>57)return;e=(b-48)*10+(d-48)}let f=-1;if("J"===a[c+5]&&"a"===a[c+6]&&"n"===a[c+7])f=0;else if("F"===a[c+5]&&"e"===a[c+6]&&"b"===a[c+7])f=1;else if("M"===a[c+5]&&"a"===a[c+6]&&"r"===a[c+7])f=2;else if("A"===a[c+5]&&"p"===a[c+6]&&"r"===a[c+7])f=3;else if("M"===a[c+5]&&"a"===a[c+6]&&"y"===a[c+7])f=4;else if("J"===a[c+5]&&"u"===a[c+6]&&"n"===a[c+7])f=5;else if("J"===a[c+5]&&"u"===a[c+6]&&"l"===a[c+7])f=6;else if("A"===a[c+5]&&"u"===a[c+6]&&"g"===a[c+7])f=7;else if("S"===a[c+5]&&"e"===a[c+6]&&"p"===a[c+7])f=8;else if("O"===a[c+5]&&"c"===a[c+6]&&"t"===a[c+7])f=9;else if("N"===a[c+5]&&"o"===a[c+6]&&"v"===a[c+7])f=10;else{if("D"!==a[c+5]||"e"!==a[c+6]||"c"!==a[c+7])return;f=11}let g=a.charCodeAt(c+9);if(g<48||g>57)return;let h=a.charCodeAt(c+10);if(h<48||h>57)return;let i=(g-48)*10+(h-48);i+=i<70?2e3:1900;let j=0;if("0"===a[c+12]){let b=a.charCodeAt(c+13);if(b<48||b>57)return;j=b-48}else{let b=a.charCodeAt(c+12);if(b<48||b>50)return;let d=a.charCodeAt(c+13);if(d<48||d>57||50===b&&d>51)return;j=(b-48)*10+(d-48)}let k=0;if("0"===a[c+15]){let b=a.charCodeAt(c+16);if(b<48||b>57)return;k=b-48}else{let b=a.charCodeAt(c+15);if(b<48||b>53)return;let d=a.charCodeAt(c+16);if(d<48||d>57)return;k=(b-48)*10+(d-48)}let l=0;if("0"===a[c+18]){let b=a.charCodeAt(c+19);if(b<48||b>57)return;l=b-48}else{let b=a.charCodeAt(c+18);if(b<48||b>53)return;let d=a.charCodeAt(c+19);if(d<48||d>57)return;l=(b-48)*10+(d-48)}return b(i,f,e,j,k,l,d)}(a)}}}},24524:(a,b,c)=>{"use strict";c.d(b,{P:()=>e});var d=c(66678);class e extends d.L{constructor(){super("azure")}buildUrl(a,b,c=0,d=null){let e=d?.providerSpecificData?.azureEndpoint||process.env.AZURE_ENDPOINT||"https://api.openai.com",f=d?.providerSpecificData?.apiVersion||process.env.AZURE_API_VERSION||"2024-10-01-preview",g=d?.providerSpecificData?.deployment||a||process.env.AZURE_DEPLOYMENT||"gpt-4",h=e.replace(/\/$/,"");return`${h}/openai/deployments/${g}/chat/completions?api-version=${f}`}buildHeaders(a,b=!0){let c={"Content-Type":"application/json",...this.config.headers},d=a?.apiKey||a?.accessToken||process.env.OPENAI_API_KEY;d&&(c["api-key"]=d);let e=a?.providerSpecificData?.organization||process.env.AZURE_ORGANIZATION;return e&&(c["OpenAI-Organization"]=e),b&&(c.Accept="text/event-stream"),c}transformRequest(a,b,c,d){return b}}},24644:(a,b,c)=>{"use strict";c.d(b,{r:()=>h});var d=c(55511),e=c.n(d),f=c(69384),g=c(30395);class h extends f.Hv{constructor(){super("iflow",g.xq.iflow)}generateUUID(){return e().randomUUID()}createIFlowSignature(a,b,c,d){if(!d)return"";let f=`${a}:${b}:${c}`,g=e().createHmac("sha256",d);return g.update(f),g.digest("hex")}buildHeaders(a,b=!0){let c=`session-${this.generateUUID()}`,d=Date.now(),e=this.config.headers["User-Agent"]||"iFlow-Cli",f=a.apiKey||a.accessToken||"",g=this.createIFlowSignature(e,c,d,f),h={"Content-Type":"application/json",...this.config.headers,"session-id":c,"x-iflow-timestamp":d.toString(),"x-iflow-signature":g};return a.apiKey&&(h.Authorization=`Bearer ${a.apiKey}`),b&&(h.Accept="text/event-stream"),h}buildUrl(a,b,c=0,d=null){return this.config.baseUrl}transformRequest(a,b,c,d){return c&&b.messages&&!b.stream_options&&(b.stream_options={include_usage:!0}),b}}},25346:(a,b,c)=>{"use strict";c.d(b,{d_:()=>f});var d=c(94735);c(77598),c(24081),c(8677),global._pendingRequests||(global._pendingRequests={byModel:{},byAccount:{}}),global._lastErrorProvider||(global._lastErrorProvider={provider:"",ts:0}),global._statsEmitter||(global._statsEmitter=new d.EventEmitter,global._statsEmitter.setMaxListeners(50)),global._pendingTimers||(global._pendingTimers={}),global._recentRing||(global._recentRing={items:[],initialized:!1}),global._connectionMapCache||(global._connectionMapCache={map:{},ts:0}),global._usageWritesInFlight||(global._usageWritesInFlight=new Set),global._pendingRequests,global._lastErrorProvider,global._pendingTimers,global._recentRing,global._connectionMapCache;let e=global._usageWritesInFlight;async function f(){for(;e.size>0;)await Promise.allSettled([...e])}global._statsEmitter},26376:(a,b,c)=>{"use strict";let{makeRequest:d}=c(12600);a.exports={isValidLastEventId:function(a){return -1===a.indexOf("\0")},isASCIINumber:function(a){if(0===a.length)return!1;for(let b=0;b<a.length;b++)if(48>a.charCodeAt(b)||a.charCodeAt(b)>57)return!1;return!0},createPotentialCORSRequest:function(a,b,c,e){let f="no cors"===c?"no-cors":"cors";e&&"no-cors"===f&&(f="same-origin");let g="include";return"anonymous"===c&&(g="same-origin"),d({urlList:[a],destination:b,mode:f,credentials:g,useURLCredentials:!0})}}},26421:(a,b,c)=>{"use strict";c.d(b,{B:()=>aj});var d=c(69384),e=c(30395),f=c(46956),g=c(11484),h=c(48161),i=c.n(h),j=c(76760),k=c.n(j);let l="function"==typeof require?require:void 0,m=null,n=!1;class o extends Error{constructor(a){super(a),this.name="TlsClientUnavailableError"}}class p extends Error{constructor(a){super(a),this.name="TlsClientHangError"}}function q(a){let b=a?.reason;if(b instanceof Error)return b;let c=Error("string"==typeof b?b:"The operation was aborted");return c.name="AbortError",c}async function r(){return m||(m=(async()=>{try{let a=function(){let a,b=[process.env.ZEVAI_NOTION_TLS_MODULE,"tls-client-node",k().join((a=("string"==typeof process.env.DATA_DIR?process.env.DATA_DIR.trim():"")||("win32"===process.platform?k().join(process.env.APPDATA||k().join(i().homedir(),"AppData","Roaming"),"zevai"):k().join(i().homedir(),".zevai")),k().join(a,"runtime","node_modules")),"tls-client-node")].filter(Boolean),c=null;for(let a of b)try{return l(a)}catch(a){c=a}throw c||Error("tls-client-node is not installed")}(),b=a.TLSClient||a.default?.TLSClient;if("function"!=typeof b)throw Error("TLSClient export is missing");let c=new b({runtimeMode:"native"});return await c.start(),!function(){if(n)return;n=!0;let a=async()=>{if(m)try{let a=await m;await a?.stop?.()}catch{}};process.once("beforeExit",a),process.once("SIGINT",()=>void a()),process.once("SIGTERM",()=>void a())}(),c}catch(a){throw m=null,new o(`Notion Chrome TLS transport unavailable: ${a?.message||"install tls-client-node"}`)}})()),m}async function s(a,b,c){let d,e;try{let f=[a,new Promise((a,c)=>{d=setTimeout(()=>{c(new p(`Notion TLS request exceeded ${b}ms`))},b)})];return c&&f.push(new Promise((a,b)=>{c.aborted?b(q(c)):(e=()=>b(q(c)),c.addEventListener("abort",e,{once:!0}))})),await Promise.race(f)}finally{d&&clearTimeout(d),c&&e&&c.removeEventListener("abort",e)}}async function t(a){return"string"==typeof a?.body?a.body:"function"==typeof a?.text?a.text():""}async function u(a,b={}){let c,d;if(b.signal?.aborted)throw q(b.signal);let e=Number.isFinite(d=Number.parseInt(String(b.timeoutMs||process.env.ZEVAI_NOTION_TLS_TIMEOUT_MS||""),10))&&d>0?d:18e4,f=await r();if(b.signal?.aborted)throw q(b.signal);let g={method:b.method||"GET",headers:b.headers||{},body:b.body,tlsClientIdentifier:"chrome_146",timeoutMilliseconds:e,followRedirects:!0,withRandomTLSExtensionOrder:!0},h=b.proxyUrl||process.env.ZEVAI_NOTION_TLS_PROXY_URL||process.env.HTTPS_PROXY||process.env.https_proxy||process.env.ALL_PROXY||process.env.all_proxy;h&&(g.proxyUrl=h);try{c=await s(f.request(a,g),e+1e4,b.signal)}catch(a){throw a instanceof p&&(m=null),a}if(b.signal?.aborted)throw q(b.signal);return{status:Number(c?.status??c?.statusCode??0),headers:function(a){let b=new Headers;if(a instanceof Headers)return a;for(let[c,d]of Object.entries(a||{}))if(Array.isArray(d))for(let a of d)b.append(c,String(a));else null!=d&&b.set(c,String(d));return b}(c?.headers),text:await t(c)}}async function v(a,b={}){try{var d;return(d=await u(a,b))instanceof Response?d:new Response(d?.text||"",{status:d?.status||502,headers:d?.headers})}catch(g){if(!(g instanceof o))throw g;let{proxyUrl:d,...e}=b,{proxyAwareFetch:f}=await Promise.resolve().then(c.bind(c,46956));return f(a,e,d?{connectionProxyEnabled:!0,connectionProxyUrl:d}:null)}}var w=c(77598);let x="https://app.notion.com/api/v3/runInferenceTranscript",y="https://app.notion.com",z="23.13.20260720.1949",A={"sec-ch-ua":'"Chromium";v="146", "Not)A;Brand";v="24"',"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"Windows"',"sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin",priority:"u=1, i","cache-control":"no-cache",pragma:"no-cache"};function B(){return globalThis.crypto?.randomUUID?globalThis.crypto.randomUUID():`zevai-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function C(a){return"string"==typeof a?a.trim():""}function D(...a){for(let b of a){let a=C(b);if(a)return a}return""}function E(a){let b=C(a).replace(/^Cookie:\s*/i,"");if(!b)return"";let c=function(a){let b;if(!a.startsWith("[")&&!a.startsWith("{"))return"";try{b=JSON.parse(a)}catch{return""}let c=(Array.isArray(b)?b:Array.isArray(b?.cookies)?b.cookies:b?.name?[b]:[]).map(a=>{let b=C(a?.name),c="string"==typeof a?.value?a.value:"",d=C(a?.domain).replace(/^\./,"").toLowerCase(),e=!d||/(^|\.)notion\.(?:com|so)$/.test(d);return!(!b||!/^[A-Za-z0-9_.-]+$/.test(b)||!c||/[\r\n;]/.test(c))&&e?`${b}=${c}`:null}).filter(Boolean);return c.some(a=>/^token_v2=/i.test(a))?c.join("; "):""}(b);if(c)return c;if(/[\r\n]/.test(b))return"";let d=/^(?:token_v2|token|notion_user_id|device_id)\s*=/i.test(b),e=b.includes(";")&&/^[a-zA-Z0-9_.-]+\s*=/.test(b);return d||e?b:`token_v2=${b}`}function F(a,b){if(!a||!b)return"";let c=b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),d=a.match(RegExp(`(?:^|;\\s*)${c}=([^;]*)`,"i"));return d?.[1]?.trim()||""}function G(a={},b=""){let c=a&&"object"==typeof a?a:{},d=E(b),e=D(c.spaceId,F(d,"space_id"),F(d,"spaceId"));return{spaceId:e,userId:D(c.userId,c.notionUserId,F(d,"notion_user_id"),F(d,"user_id")),spaceViewId:D(c.spaceViewId,e,F(d,"space_view_id"),F(d,"spaceViewId")),spaceName:D(c.spaceName,"Notion"),userName:D(c.userName,"ZevaiRouter"),userEmail:C(c.userEmail),timezone:D(c.timezone,"UTC"),clientVersion:D(c.clientVersion,c.notionClientVersion,z),cell:D(c.cell,c.notionCell)}}function H(a,b){return{id:B(),type:"user",value:[[a]],userId:b,createdAt:new Date().toISOString()}}function I(a,b){let c=b.trim();if(c&&"[DONE]"!==c)try{let b=JSON.parse(c);Array.isArray(b)?a.push(...b):a.push(b)}catch{}}function J(a,b=!1){let c=[],d=0;for(;d<a.length;){for(;/\s/.test(a[d]||"");)d+=1;if(d>=a.length)break;if(a.startsWith("data:",d)){let e=a.indexOf("\n",d);if(e<0&&!b)break;let f=e<0?a.length:e;I(c,a.slice(d+5,f).replace(/\r$/,"")),d=e<0?a.length:e+1;continue}if(a.startsWith("event:",d)||a.startsWith("id:",d)){let c=a.indexOf("\n",d);if(c<0&&!b)break;d=c<0?a.length:c+1;continue}let e=a[d];if("{"!==e&&"["!==e){let c=a.indexOf("\n",d);if(c<0&&!b)break;d=c<0?a.length:c+1;continue}let f=function(a,b){let c=a[b],d="{"===c?"}":"["===c?"]":null;if(!d)return -1;let e=0,f=!1,g=!1;for(let h=b;h<a.length;h+=1){let b=a[h];if(f){g?g=!1:"\\"===b?g=!0:'"'===b&&(f=!1);continue}if('"'===b){f=!0;continue}if(b===c)e+=1;else if(b===d&&0==(e-=1))return h+1}return -1}(a,d);if(f<0)break;I(c,a.slice(d,f)),d=f}return{frames:c,remainder:a.slice(d)}}async function*K(a,b){if(!a?.getReader)return;let c=a.getReader(),d=new TextDecoder,e="";try{for(;;){if(b?.aborted)return;let{value:a,done:f}=await c.read();if(f)break;e+=d.decode(a,{stream:!0});let g=J(e);for(let a of(e=g.remainder,g.frames))yield a}for(let a of(e+=d.decode(),J(e,!0).frames))yield a}finally{try{c.releaseLock()}catch{}}}function L(a){if(!a||"object"!=typeof a)return[];let b=a.value??a.content;if("string"==typeof b)return[{type:"text",content:b}];if(b&&"object"==typeof b&&!Array.isArray(b)){if(["text","thinking"].includes(b.type)&&"string"==typeof b.content)return[{type:b.type,content:b.content}];if("string"==typeof b.content)return[{type:"text",content:b.content}]}return Array.isArray(b)?b.filter(a=>a&&["text","thinking"].includes(a.type)&&"string"==typeof a.content).map(a=>({type:a.type,content:a.content})):[]}let M=new Map;function N(a){return a?.connectionProxyEnabled!==!0?"":"string"==typeof a.connectionProxyUrl?a.connectionProxyUrl.trim():""}let O=[{id:"notion-auto",name:"Notion Auto",owned_by:"notion"},{id:"gpt-5.6-sol",name:"GPT-5.6 Sol",owned_by:"openai",notionCodename:"orange-mousse"},{id:"gpt-5.6-terra",name:"GPT-5.6 Terra",owned_by:"openai",notionCodename:"orchid-muffin"},{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",owned_by:"openai",notionCodename:"olive-jellyroll"},{id:"gpt-5.5",name:"GPT-5.5",owned_by:"openai",notionCodename:"opal-quince-medium"},{id:"gpt-5.4",name:"GPT-5.4",owned_by:"openai",notionCodename:"oval-kumquat-medium"},{id:"gpt-5.4-mini",name:"GPT-5.4 Mini",owned_by:"openai",notionCodename:"oregon-grape-medium"},{id:"gpt-5.4-nano",name:"GPT-5.4 Nano",owned_by:"openai",notionCodename:"otaheite-apple-medium"},{id:"gemini-3.5-flash",name:"Gemini 3.5 Flash",owned_by:"gemini",notionCodename:"vertex-gemini-3.5-flash"},{id:"gemini-3-flash",name:"Gemini 3 Flash",owned_by:"gemini",notionCodename:"gingerbread"},{id:"sonnet-4.6",name:"Sonnet 4.6",owned_by:"anthropic",notionCodename:"almond-croissant-low"},{id:"opus-4.8",name:"Opus 4.8",owned_by:"anthropic",notionCodename:"ambrosia-tart-high"},{id:"haiku-4.5",name:"Haiku 4.5",owned_by:"anthropic",notionCodename:"anthropic-haiku-4.5"},{id:"fable-5",name:"Fable 5",owned_by:"anthropic",notionCodename:"acai-budino-high"},{id:"openai-gpt-4.1-mini",name:"GPT-4.1 Mini (legacy)",owned_by:"openai",notionCodename:"openai-gpt-4.1-mini"},{id:"openai-gpt-5-mini",name:"GPT-5 Mini (legacy)",owned_by:"openai",notionCodename:"openai-gpt-5-mini"},{id:"openai-o4-mini",name:"o4-mini (legacy)",owned_by:"openai",notionCodename:"openai-o4-mini"},{id:"oregon-grape-low",name:"Oregon Grape Low (legacy)",owned_by:"openai",notionCodename:"oregon-grape-low"},{id:"oregon-grape-high",name:"Oregon Grape High (legacy)",owned_by:"openai",notionCodename:"oregon-grape-high"},{id:"otaheite-apple-low",name:"Otaheite Apple Low (legacy)",owned_by:"openai",notionCodename:"otaheite-apple-low"},{id:"otaheite-apple-high",name:"Otaheite Apple High (legacy)",owned_by:"openai",notionCodename:"otaheite-apple-high"}];function P(a){return String(a||"").trim().toLowerCase().replace(/[^a-z0-9.]+/g,"-").replace(/\.{2,}/g,".").replace(/^[-.]+|[-.]+$/g,"")}function Q(a,b,c="*/*"){let d={"Content-Type":"application/json",Accept:c,Cookie:a,Origin:y,Referer:`${y}/ai`,"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36","Accept-Language":"en-US,en;q=0.9","notion-client-version":b.clientVersion||z,"notion-audit-log-platform":"web",...A};return b.userId&&(d["x-notion-active-user-header"]=b.userId),b.spaceId&&(d["x-notion-space-id"]=b.spaceId),d}async function R(a,b){if(!a?.ok){let c=await a?.text?.().catch(()=>"")||"";throw Error(`${b} returned HTTP ${a?.status||0}${c?`: ${c.slice(0,180)}`:""}`)}return a.json()}async function S(a,b,c,d,e=""){let f=await c("https://app.notion.com/api/v3/getSpaces",{method:"POST",headers:Q(a,b,"application/json"),body:"{}",...e?{proxyUrl:e}:{},signal:d}),g=function(a){if(!a||"object"!=typeof a||Array.isArray(a))return{userId:"",spaceIds:[]};let b=[],c="";for(let[d,e]of Object.entries(a)){let a=e?.space;if(!(!a||"object"!=typeof a||Array.isArray(a)))for(let e of(c||!d||d.includes(" ")||(c=d),Object.keys(a)))e&&!b.includes(e)&&b.push(e)}if(0===b.length&&Array.isArray(a.spaces))for(let c of a.spaces)"string"==typeof c?.id&&c.id&&!b.includes(c.id)&&b.push(c.id);if(0===b.length&&Array.isArray(a.spaceIds))for(let c of a.spaceIds)"string"==typeof c&&c&&!b.includes(c)&&b.push(c);return{userId:c,spaceIds:b}}(await R(f,"Notion getSpaces"));return{userId:b.userId||g.userId,spaceIds:g.spaceIds}}async function T(a,b,c,d,e,f=""){let g,h,i,j,k=Q(a,{...b,spaceId:c}),l=await d("https://app.notion.com/api/v3/getAvailableModels",{method:"POST",headers:k,body:JSON.stringify({spaceId:c}),...f?{proxyUrl:f}:{},signal:e}),m=await R(l,"Notion getAvailableModels"),n=function(a){let b=Array.isArray(a?.models)?a.models:[],c=new Set,d=[];for(let a of b){let b=function(a,b){if(!a||"object"!=typeof a||!0===a.isDisabled)return null;let c="string"==typeof a.model?a.model.trim():"";if(!c)return null;let d=String(a.modelMessage||a.displayName||a.name||c).trim(),e=P(d)||c;return b.has(e)||b.has(c)?null:(b.add(e),b.add(c),{id:e,name:d,owned_by:String(a.modelFamily||"notion"),...e!==c?{notionCodename:c}:{},...Array.isArray(a.modelConfiguration?.supportedReasoningEfforts)&&a.modelConfiguration.supportedReasoningEfforts.length>0?{supportsReasoning:!0}:{}})}(a,c);b&&d.push(b)}return d.some(a=>"notion-auto"===a.id)||d.unshift({id:"notion-auto",name:"Notion Auto",owned_by:"notion"}),d}(m);return{models:n,data:m,score:(g=n.filter(a=>"notion-auto"!==a.id).length,h=Array.isArray(m?.models)?m.models:[],i=n.some(a=>"fable-5"===a.id||"acai-budino-high"===a.notionCodename),j=h.some(a=>a?.isDisabled===!0&&(a?.model==="acai-budino-high"||"fable-5"===P(a?.modelMessage))),10*g+(i?1e3:j?-50:0))}}async function U({apiKey:a,providerSpecificData:b={},fetchImpl:c=v,signal:d}={}){let e=E(a),f=G(b,a),g=N(b);if(f.spaceId&&f.userId)return{...f,source:"credentials"};let h=await S(e,f,c,d,g),i=f.spaceId||h.spaceIds[0]||"",j=f.userId||h.userId||"";if(!i||!j)throw Error("Notion workspace metadata could not be resolved from getSpaces");return{...f,spaceId:i,userId:j,source:"getSpaces"}}async function V({apiKey:a,providerSpecificData:b={},fetchImpl:c=v,signal:d}={}){let e,f=E(a);if(!f)throw Error("Missing Notion token_v2 cookie");let g=G(b,a),h=N(b),i=`${(0,w.createHash)("sha256").update((e="token_v2".replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),f.match(RegExp(`(?:^|;\\s*)${e}=([^;]*)`,"i"))?.[1]?.trim()||f)).digest("hex").slice(0,32)}:${g.spaceId||"auto"}`,j=M.get(i);if(j&&j.expiresAt>Date.now())return j.value;let k=g.spaceId?[g.spaceId]:[],l=g.userId;if(0===k.length||!l){let a=await S(f,g,c,d,h);l=l||a.userId,0===k.length&&(k=a.spaceIds)}if(0===k.length)throw Error("No Notion workspace was returned by getSpaces");let m=null;for(let a of k.slice(0,8))try{let b=await T(f,{...g,userId:l},a,c,d,h);(!m||b.score>m.score)&&(m={...b,spaceId:a})}catch{}if(!m)throw Error("Notion getAvailableModels failed for every workspace");let n={models:m.models,spaceId:m.spaceId,userId:l,source:"api"};return M.set(i,{value:n,expiresAt:Date.now()+18e5}),n}function W(a,b=[]){let c="string"==typeof a?a.trim():"";if(c.startsWith("notion-ai/")&&(c=c.slice(10)),c.startsWith("na/")&&(c=c.slice(3)),!c||["notion-auto","auto","default"].includes(c))return"";let d=function(a){let b=new Map;for(let c of a){let a=c.notionCodename||("notion-auto"===c.id?"":c.id);if(a)for(let d of[c.id,c.name,a,P(c.name)])d&&b.set(String(d).toLowerCase(),a)}return b}([...O,...b]);return d.get(c.toLowerCase())||d.get(P(c))||c}let X=new Map;function Y(a){return"string"==typeof a?a.trim():Array.isArray(a)?a.map(a=>"string"==typeof a?a:a&&"object"==typeof a?"string"==typeof a.text?a.text:"string"==typeof a.content?a.content:"":"").filter(Boolean).join("\n").trim():""}function Z(a){return(0,w.createHash)("sha256").update(String(a||"")).digest("hex").slice(0,24)}function $(a=Date.now()){for(let[b,c]of X)a-c.updatedAt>216e5&&X.delete(b);for(;X.size>500;){let a=[...X.entries()].reduce((a,b)=>b[1].updatedAt<a[1].updatedAt?b:a)[0];X.delete(a)}}function _({key:a,threadId:b}={}){if(!a)return;let c=X.get(a);c&&(!b||c.threadId===b)&&X.delete(a)}function aa(a,b=200){return new Response(JSON.stringify(a),{status:b,headers:{"Content-Type":"application/json"}})}function ab(a,b=502,c="NOTION_ERROR"){return aa({error:{message:a,type:"upstream_error",code:c}},b)}function ac(a){return`data: ${JSON.stringify(a)}
215
217
 
216
218
  `}function ad(a,b="NOTION_STREAM_ERROR"){return{error:{message:String(a||"Notion stream failed").slice(0,500),type:"upstream_error",code:b},failureMetadata:{failureClass:"upstream_transient",providerErrorCode:b}}}function ae(a){return Math.max(0,Math.ceil(String(a||"").length/4))}async function*af(a,b){let c={text:"",thinking:""};for await(let d of K(a,b)){let a=function(a){if(!a||"object"!=typeof a)return null;let b=[a];for(let c of[a.data?.s,a.s,a.value?.s])Array.isArray(c)&&b.push(...c);for(let a of b){if(!a||"object"!=typeof a)continue;let b="string"==typeof a.type?a.type.toLowerCase():"",c="string"==typeof a.subType?a.subType:"";if(!["error","agent-debug-error"].includes(b)&&!c)continue;let d=a.message||a.error||a.value||a.name,e="string"==typeof d?d:d?.message||d?.error||d?.name;return"string"==typeof e&&e.trim()?e.trim().slice(0,500):c||"Notion inference failed"}return null}(d);if(a)return void(yield{error:a});for(let a of function(a){let b=a&&"object"==typeof a?"agent-inference"===a.type?a:a.step?.type==="agent-inference"?a.step:a.value?.type==="agent-inference"?a.value:null:null;if(b)return L(b);if(a?.type==="markdown-chat"&&"string"==typeof a.value)return[{type:"text",content:a.value}];if(a?.type==="record-map"||a?.recordMap)return function(a){if(!a||"object"!=typeof a||Array.isArray(a))return[];let b=a.thread_message;if(!b||"object"!=typeof b||Array.isArray(b))return[];let c=[];for(let a of Object.values(b)){let b=a?.value?.value?.step;b&&"object"==typeof b&&("agent-inference"===b.type&&c.push(...L(b)),"markdown-chat"===b.type&&"string"==typeof b.value&&c.push({type:"text",content:b.value}))}return 0===c.length?[]:[c.reduce((a,b)=>b.content.length>a.content.length?b:a)]}(a.recordMap||a);if(a?.type==="patch"){if(!Array.isArray(a?.v))return[];let b=[];for(let c of a.v){if(!c||"object"!=typeof c)continue;let a="string"==typeof c.p?c.p:"",d=c.v;d&&"object"==typeof d&&!Array.isArray(d)?"agent-inference"===d.type?b.push(...L(d)):"markdown-chat"===d.type&&"string"==typeof d.value?b.push({type:"text",content:d.value}):"text"===d.type&&"string"==typeof d.content&&b.push({type:"text",content:d.content}):"string"==typeof d&&a.includes("/value")&&b.push({type:"text",content:d})}return b}return[]}(d)){let b=function(a,b=""){let c="string"==typeof a?a:"";return c&&c!==b?c.startsWith(b)?c.slice(b.length):b.startsWith(c)?"":c:""}(a.content,c[a.type]);b&&(c[a.type]=c[a.type].startsWith(a.content)?c[a.type]:a.content.startsWith(c[a.type])?a.content:`${c[a.type]}${b}`,yield{type:a.type,delta:b})}}yield{done:!0}}function ag({id:a,model:b,created:c,delta:d={},finishReason:e=null}){return{id:a,object:"chat.completion.chunk",created:c,model:b,system_fingerprint:null,choices:[{index:0,delta:d,finish_reason:e,logprobs:null}]}}async function ah(a,b,c,d,e,f){let g="",h="",i=null;for await(let b of af(a,f)){if(b.error){i=b.error;break}if(b.done)break;"thinking"===b.type&&(h+=b.delta),"text"===b.type&&(g+=b.delta)}if(i)return ab(i,502,"NOTION_STREAM_ERROR");if(!g&&!h)return ab("Notion returned no assistant text",502,"NOTION_EMPTY_RESPONSE");let j={role:"assistant",content:g};h&&(j.reasoning_content=h);let k=ae((e?.messages||[]).map(a=>"string"==typeof a?.content?a.content:"").join("\n")),l=ae(`${g}${h}`);return aa({id:c,object:"chat.completion",created:d,model:b,choices:[{index:0,message:j,finish_reason:"stop",logprobs:null}],usage:{prompt_tokens:k,completion_tokens:l,total_tokens:k+l}})}async function ai(a,b,c){if(c?.vercelRelayUrl)return(0,f.proxyAwareFetch)(a,b,c);try{let d=await u(a,{...b,proxyUrl:(c?.connectionProxyEnabled&&"string"==typeof c.connectionProxyUrl?c.connectionProxyUrl.trim():"")||void 0});if(d instanceof Response)return d;let e="function"==typeof d?.text?await d.text():d?.text||"";return new Response(e,{status:d.status||502,headers:d.headers})}catch(d){if(!(d instanceof o))throw d;return(0,f.proxyAwareFetch)(a,b,c)}}class aj extends d.Hv{constructor(){super("notion-ai",e.xq["notion-ai"])}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:f,proxyOptions:h=null}){let i,j,k=d?.providerSpecificData||{},l=function({apiKey:a,providerSpecificData:b}={}){return E(a)?{valid:!0,metadata:G(b,a)}:{valid:!1,error:"Notion cookie is required"}}({apiKey:d?.apiKey,providerSpecificData:k});if(!l.valid)return{response:aa({error:{message:l.error,type:"invalid_request"}},400),url:x,headers:{},transformedBody:b};let m={...k},n=null;if(!(m.spaceId&&m.userId))try{let a=await V({apiKey:d?.apiKey,providerSpecificData:m,signal:e});n=a.models,m={...m,spaceId:a.spaceId,...a.userId?{userId:a.userId}:{}}}catch(a){try{let a=await U({apiKey:d?.apiKey,providerSpecificData:m,signal:e});m={...m,spaceId:a.spaceId,userId:a.userId,...a.spaceViewId?{spaceViewId:a.spaceViewId}:{}}}catch(c){return{response:ab(c?.message||a?.message||"Could not resolve Notion workspace",400,"NOTION_WORKSPACE_ERROR"),url:x,headers:{},transformedBody:b}}}let o=O.map(a=>({...a})),p=n||o,q=W(a,p),r="string"==typeof a?a.replace(/^(?:notion-ai|na)\//,"").trim():"";if(!(!r||["notion-auto","auto","default"].includes(r)||p.some(a=>[a.id,a.notionCodename,a.name].filter(Boolean).some(a=>String(a).toLowerCase()===r.toLowerCase()))))try{let b=await V({apiKey:d?.apiKey,providerSpecificData:m,signal:e});p=b.models,q=W(a,p),m={...m,spaceId:b.spaceId,userId:b.userId||m.userId}}catch{}let s=null;try{s=function({body:a,cookie:b,connectionId:c,spaceId:d}={}){let e=Date.now();$(e);let f=function(a){for(let b of["notion_thread_id","notionThreadId","thread_id"])if("string"==typeof a?.[b]&&a[b].trim())return a[b].trim();return""}(a),g=function({body:a,cookie:b,connectionId:c,spaceId:d}){let e=Array.isArray(a?.messages)?a.messages:[],f=[];for(let a of e){let b=String(a?.role||"user").toLowerCase();if(["system","developer"].includes(b)){f.push(`${b}:${Y(a?.content)}`);continue}if("user"===b){f.push(`user:${Y(a?.content)}`);break}}if(!f.some(a=>a.startsWith("user:")))return"";let g=c||Z(b);return`${g}:${d}:${Z(f.join("\n"))}`}({body:a,cookie:b,connectionId:c,spaceId:d});if(f)return g&&X.set(g,{threadId:f,updatedAt:e}),{threadId:f,createThread:!1,key:g};if(!g)return{threadId:(0,w.randomUUID)(),createThread:!0,key:""};let h=X.get(g);if(h)return h.updatedAt=e,{threadId:h.threadId,createThread:!1,key:g};let i=(0,w.randomUUID)();return X.set(g,{threadId:i,updatedAt:e}),$(e),{threadId:i,createThread:!0,key:g}}({body:b,cookie:d?.apiKey,connectionId:d?.connectionId,spaceId:m.spaceId}),i=function({body:a,model:b,providerSpecificData:c,apiKey:d,traceId:e=B(),threadId:f=B(),createThread:g=!0}={}){let h=G(c,d),i=b&&!["notion-auto","auto","default"].includes(b)?b:null,j={annotationInferences:{},cachedInferences:{},emitAgentSearchExtractedResults:!0,emitInferences:!1};return i&&(j.model=i),{traceId:e,spaceId:h.spaceId,transcript:function({body:a,model:b,metadata:c}){var d;let e,f=Array.isArray(a?.messages)?a.messages:[];if(0===f.length)throw Error("Missing or empty messages array");let g=f.map(a=>{var b;return{role:String(a?.role||"user").toLowerCase(),content:(b=a?.content,"string"==typeof b?b:Array.isArray(b)?b.map(a=>"string"==typeof a?a:a&&"object"==typeof a?"text"===a.type&&"string"==typeof a.text?a.text:"image_url"===a.type||"image"===a.type?"[Image input omitted]":"string"==typeof a.content?a.content:"string"==typeof a.text?a.text:"":"").filter(Boolean).join("\n"):b&&"object"==typeof b&&"string"==typeof b.text?b.text:"")}}).filter(a=>a.content.trim()),h=g.filter(a=>"system"===a.role||"developer"===a.role).map(a=>a.content.trim()).filter(Boolean).join("\n\n"),i=g.filter(a=>!["system","developer"].includes(a.role)),j=[(e={type:"workflow",enableAgentAutomations:!0,enableAgentIntegrations:!0,enableCustomAgents:!0,enableScriptAgent:!0,enableAgentDiffs:!0,enableCsvAttachmentSupport:!0,enableComputer:!0,enableCreateAndRunThread:!0,enableAgentGenerateImage:!0,useWebSearch:!0,searchScopes:[{type:"everything"}],availableConnectors:[],enableUserSessionContext:!1,isCustomAgent:!1,isCustomAgentBuilder:!1,isCustomAgentCreate:!1,isAgentResearchRequest:!1,useCustomAgentDraft:!1,databaseAgentConfigMode:!1,isOnboardingAgent:!1,isMobile:!1,modelFromUser:!!(b&&!["notion-auto","auto","default"].includes(b))},b&&!["notion-auto","auto","default"].includes(b)&&(e.model=b),{id:B(),type:"config",value:e}),function(a,b=""){return{id:B(),type:"context",value:{timezone:a.timezone,userName:a.userName,userEmail:a.userEmail,userId:a.userId,spaceName:a.spaceName,spaceId:a.spaceId,spaceViewId:a.spaceViewId,currentDatetime:new Date().toISOString(),surface:"ai_module",...b?{instructions:b}:{}}}}(c,h)],k=0;for(let a of i){if("assistant"===a.role){j.push((d=a.content,{id:B(),type:"agent-inference",value:[{type:"text",content:d}]}));continue}let b="tool"===a.role?"Tool result":null,e=b?`${b}:
217
219
  ${a.content}`:a.content;j.push(H(e,c.userId)),k+=1}return 0===k&&j.push(H("Please respond to the request.",c.userId)),j}({body:a,model:i,metadata:h}),threadId:f,threadParentPointer:{table:"space",id:h.spaceId,spaceId:h.spaceId},createThread:g,debugOverrides:j,generateTitle:g,saveAllThreadOperations:!0,setUnreadState:g,createdSource:"ai_module",threadType:"workflow",isPartialTranscript:!g,asPatchResponse:!0,patchResponseVersion:2,isUserInAnySalesAssistedSpace:!1,isSpaceSalesAssisted:!1,supportsCustomAgentNudgeTranscriptStep:!0}}({body:b,model:q||a,apiKey:d?.apiKey,providerSpecificData:m,threadId:s.threadId,createThread:s.createThread})}catch(a){return s?.createThread&&_(s),{response:aa({error:{message:a.message,type:"invalid_request"}},400),url:x,headers:{},transformedBody:b}}let t=function({apiKey:a,providerSpecificData:b,stream:c=!0,userAgent:d="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36"}={}){let e=G(b,a),f={"Content-Type":"application/json",Accept:!1===c?"application/json":"application/x-ndjson",Cookie:E(a),Origin:y,Referer:`${y}/ai`,"User-Agent":d,"Accept-Language":"en-US,en;q=0.9","notion-audit-log-platform":"web",...A};return e.userId&&(f["x-notion-active-user-header"]=e.userId),e.spaceId&&(f["x-notion-space-id"]=e.spaceId),e.clientVersion&&(f["notion-client-version"]=e.clientVersion),e.cell&&(f["x-notion-cell"]=e.cell),f}({apiKey:d.apiKey,providerSpecificData:m,stream:!0}),u=function(a={}){return Object.fromEntries(Object.entries(a).map(([a,b])=>[a,"cookie"===a.toLowerCase()?"[redacted]":b]))}(t),v={method:"POST",headers:t,body:JSON.stringify(i),signal:e};f?.info?.("NOTION-AI",`Requesting ${a} via private Notion web protocol`);try{j=await ai(x,v,h)}catch(a){if(e?.aborted||a?.name==="AbortError")throw a;return s?.createThread&&_(s),{response:ab("Could not connect to Notion",502,"NOTION_CONNECTION_ERROR"),url:x,headers:u,transformedBody:i}}if(!j.ok){let a=j.status||502;return await (0,g.aI)(j),s?.createThread&&_(s),{response:ab(401===a||403===a?"Notion session rejected - re-paste the cookie and verify the workspace IDs":429===a?"Notion rate limited this session - wait and retry":a>=500?`Notion returned HTTP ${a}`:`Notion rejected the request with HTTP ${a}`,a,`HTTP_${a}`),url:x,headers:u,transformedBody:i}}if(!j.body)return s?.createThread&&_(s),{response:ab("Notion returned an empty response body",502,"NOTION_EMPTY_BODY"),url:x,headers:u,transformedBody:i};let z=`chatcmpl-notion-${globalThis.crypto?.randomUUID?.().slice(0,12)||Date.now().toString(36)}`,C=Math.floor(Date.now()/1e3),D=c?new Response(function(a,b,c,d,e,f=null){let g=new TextEncoder;return new ReadableStream({async start(h){let i=!1,j=a=>{i||h.enqueue(g.encode(a))};try{j(ac(ag({id:c,model:b,created:d,delta:{role:"assistant"}})));let g=null;for await(let f of af(a,e)){if(f.error){g=f.error;break}if(f.done)break;"thinking"===f.type?j(ac(ag({id:c,model:b,created:d,delta:{reasoning_content:f.delta}}))):"text"===f.type&&j(ac(ag({id:c,model:b,created:d,delta:{content:f.delta}})))}g&&(f?.(),j(ac(ad(g)))),g||j(ac(ag({id:c,model:b,created:d,delta:{},finishReason:"stop"}))),j("data: [DONE]\n\n")}catch(a){if(e?.aborted||a?.name==="AbortError"){i||h.error(a);return}f?.(),j(ac(ad(a.message||"unknown error"))),j("data: [DONE]\n\n")}finally{i||(i=!0,h.close())}},cancel:b=>a?.cancel?.(b)})}(j.body,a,z,C,e,()=>{s?.createThread&&_(s)}),{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive","X-Accel-Buffering":"no"}}):await ah(j.body,a,z,C,b,e);return!D.ok&&s?.createThread&&_(s),{response:D,url:x,headers:u,transformedBody:i}}}},26757:(a,b,c)=>{"use strict";let d=c(34589),{AsyncResource:e}=c(16698),{InvalidArgumentError:f,InvalidReturnValueError:g}=c(61448),h=c(84285),{addSignal:i,removeSignal:j}=c(73135);function k(){}class l extends e{constructor(a,b,c){if(!a||"object"!=typeof a)throw new f("invalid opts");const{signal:d,method:e,opaque:g,body:j,onInfo:l,responseHeaders:m}=a;try{if("function"!=typeof c)throw new f("invalid callback");if("function"!=typeof b)throw new f("invalid factory");if(d&&"function"!=typeof d.on&&"function"!=typeof d.addEventListener)throw new f("signal must be an EventEmitter or EventTarget");if("CONNECT"===e)throw new f("invalid method");if(l&&"function"!=typeof l)throw new f("invalid onInfo callback");super("UNDICI_STREAM")}catch(a){throw h.isStream(j)&&h.destroy(j.on("error",k),a),a}this.responseHeaders=m||null,this.opaque=g||null,this.factory=b,this.callback=c,this.res=null,this.abort=null,this.context=null,this.controller=null,this.trailers=null,this.body=j,this.onInfo=l||null,h.isStream(j)&&j.on("error",a=>{this.onResponseError(this.controller,a)}),i(this,d)}onRequestStart(a,b){this.reason?a.abort(this.reason):(d(this.callback),this.controller=a,this.abort=b=>a.abort(b),this.context=b)}onResponseStart(a,b,c,d){var e;let f,i,j,k,l,{factory:m,opaque:n,context:o,responseHeaders:p}=this,q=a?.rawHeaders,r="raw"===p?h.parseRawHeaders(q):c;if(b<200){this.onInfo&&this.onInfo({statusCode:b,headers:r});return}if(this.factory=null,null===m)return;let s=this.runInAsyncScope(m,null,{statusCode:b,headers:r,opaque:n,context:o});if(!s||"function"!=typeof s.write||"function"!=typeof s.end||"function"!=typeof s.on)throw new g("expected Writable");e=(a,b)=>{let{callback:c,res:d,opaque:e,trailers:f,abort:g}=this;this.res=null,(a||!d?.readable)&&h.destroy(d,b?void 0:a),this.callback=null,this.runInAsyncScope(c,null,a||null,{opaque:e,trailers:f}),a&&g(a)},f=!1,i=(a,b=!1)=>{f||(f=!0,s.removeListener("close",j),s.removeListener("error",k),s.removeListener("finish",l),e(a,b))},j=()=>{let a;i(s.errored??s.writableErrored??s._writableState?.errored??(s.writableFinished?void 0:((a=Error("Premature close")).code="ERR_STREAM_PREMATURE_CLOSE",a)))},k=a=>i(a,!0),l=()=>i(),s.on("close",j),s.on("error",k),s.on("finish",l),s.closed?process.nextTick(j):s.writableFinished&&process.nextTick(l),s.on("drain",()=>a.resume()),this.res=s,!0===(void 0!==s.writableNeedDrain?s.writableNeedDrain:s._writableState?.needDrain)&&a.pause()}onResponseData(a,b){let{res:c}=this;c&&!1===c.write(b)&&a.pause()}onResponseEnd(a,b){let{res:c}=this;j(this),c&&(b&&"object"==typeof b&&(this.trailers=b),c.end())}onResponseError(a,b){let{res:c,callback:d,opaque:e,body:f}=this;j(this),this.factory=null,c?(this.res=null,h.destroy(c,b)):d&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(d,null,b,{opaque:e})})),f&&(this.body=null,h.destroy(f,b))}}a.exports=function a(b,c,d){if(void 0===d)return new Promise((d,e)=>{a.call(this,b,c,(a,b)=>a?e(a):d(b))});try{let a=new l(b,c,d);this.dispatch(b,a)}catch(c){if("function"!=typeof d)throw c;let a=b?.opaque;queueMicrotask(()=>d(c,{opaque:a}))}}},27060:(a,b,c)=>{"use strict";let{isIP:d}=c(77030),{lookup:e}=c(40610),f=c(83204),{InvalidArgumentError:g,InformationalError:h}=c(61448);function i(a){return"string"==typeof a&&"host"===a.toLowerCase()}function j(a,b){let c=function(a){let b;if(null==a)return null;if(Array.isArray(a)){if(0===a.length||!Array.isArray(a[0]))return a;let b=[];for(let c of a)Array.isArray(c)&&2===c.length?b.push(c[0],c[1]):b.push(c);return b}if("object"==typeof a&&(b=Object.getPrototypeOf(a),Object.hasOwn(a,Symbol.iterator)||null!=b&&b!==Object.prototype&&"function"==typeof a[Symbol.iterator])){let b=[];for(let c of a)Array.isArray(c)&&2===c.length?b.push(c[0],c[1]):b.push(c);return b}return a}(b);return!function(a){if(null==a)return!1;if(Array.isArray(a)){if(0===a.length)return!1;for(let b=0;b<a.length;b+=2)if(i(a[b]))return!0;return!1}if("object"==typeof a){for(let b in a)if(i(b))return!0}return!1}(c)?Array.isArray(c)?["host",a,...c]:c&&"object"==typeof c?{host:a,...c}:{host:a}:c}class k{#y=0;#z=new Map;constructor(a){this.#y=a.maxItems}get size(){return this.#z.size}get(a){return this.#z.get(a)??null}set(a,b){this.#z.set(a,b)}delete(a){this.#z.delete(a)}full(){return this.size>=this.#y}}class l{#A=0;#y=0;dualStack=!0;affinity=null;lookup=null;pick=null;storage=null;constructor(a){this.#A=a.maxTTL,this.#y=a.maxItems,this.dualStack=a.dualStack,this.affinity=a.affinity,this.lookup=a.lookup??this.#B,this.pick=a.pick??this.#C,this.storage=a.storage??new k(a)}runLookup(a,b,c){let d=this.storage.get(a.hostname);if(null==d&&this.storage.full())return void c(null,a);let e={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...b.dns,maxTTL:this.#A,maxItems:this.#y};if(null==d)this.lookup(a,e,(b,d)=>{let f;if(b||null==d||0===d.length)return void c(b??new h("No DNS entries found"));this.setRecords(a,d);let g=this.storage.get(a.hostname),i=this.pick(a,g,e.affinity);f="number"==typeof i.port?`:${i.port}`:""!==a.port?`:${a.port}`:"",c(null,new URL(`${a.protocol}//${6===i.family?`[${i.address}]`:i.address}${f}`))});else{let f,g=this.pick(a,d,e.affinity);if(null==g){this.storage.delete(a.hostname),this.runLookup(a,b,c);return}f="number"==typeof g.port?`:${g.port}`:""!==a.port?`:${a.port}`:"",c(null,new URL(`${a.protocol}//${6===g.family?`[${g.address}]`:g.address}${f}`))}}#B(a,b,c){e(a.hostname,{all:!0,family:!1===this.dualStack?this.affinity:0,order:"ipv4first"},(a,b)=>{if(a)return c(a);let d=new Map;for(let a of b)d.set(`${a.address}:${a.family}`,a);c(null,d.values())})}#C(a,b,c){let d,e=null,{records:f,offset:g}=b;if(this.dualStack?(null==c&&(null==g||0x7fffffff===g?(b.offset=0,c=4):(b.offset++,c=(1&b.offset)==1?6:4)),d=null!=f[c]&&f[c].ips.length>0?f[c]:f[4===c?6:4]):d=f[c],null==d||0===d.ips.length)return e;null==d.offset||0x7fffffff===d.offset?d.offset=0:d.offset++;let h=d.offset%d.ips.length;return null==(e=d.ips[h]??null)?e:Date.now()-e.timestamp>e.ttl?(d.ips.splice(h,1),this.pick(a,b,c)):e}pickFamily(a,b){let c=this.storage.get(a.hostname)?.records;if(!c)return null;let d=c[b];if(!d)return null;null==d.offset||0x7fffffff===d.offset?d.offset=0:d.offset++;let e=d.offset%d.ips.length,f=d.ips[e]??null;return null==f||Date.now()-f.timestamp>f.ttl&&d.ips.splice(e,1),f}setRecords(a,b){let c=Date.now(),d={records:{4:null,6:null}},e=this.#A;for(let a of b){a.timestamp=c,"number"==typeof a.ttl?(a.ttl=Math.min(a.ttl,this.#A),e=Math.min(e,a.ttl)):a.ttl=this.#A;let b=d.records[a.family]??{ips:[]};b.ips.push(a),d.records[a.family]=b}this.storage.set(a.hostname,d,{ttl:e})}deleteRecords(a){this.storage.delete(a.hostname)}getHandler(a,b){return new m(this,a,b)}}class m extends f{#a=null;#D=null;#E=null;#F=null;#G=null;#H=null;#I=!0;constructor(a,{origin:b,handler:c,dispatch:d,newOrigin:e},f){super(c),this.#F=b,this.#H=e,this.#D={...f},this.#a=a,this.#E=d}onResponseError(a,b){switch(b.code){case"ETIMEDOUT":case"ECONNREFUSED":if(this.#a.dualStack){let c;if(!this.#I)return void super.onResponseError(a,b);this.#I=!1;let d="["===this.#H.hostname[0]?4:6,e=this.#a.pickFamily(this.#F,d);if(null==e)return void super.onResponseError(a,b);c="number"==typeof e.port?`:${e.port}`:""!==this.#F.port?`:${this.#F.port}`:"";let f={...this.#D,origin:`${this.#F.protocol}//${6===e.family?`[${e.address}]`:e.address}${c}`,headers:j(this.#F.host,this.#D.headers)};this.#E(f,this);return}super.onResponseError(a,b);break;case"ENOTFOUND":this.#a.deleteRecords(this.#F),super.onResponseError(a,b);break;default:super.onResponseError(a,b)}}}a.exports=a=>{let b;if(a?.maxTTL!=null&&("number"!=typeof a?.maxTTL||a?.maxTTL<0))throw new g("Invalid maxTTL. Must be a positive number");if(a?.maxItems!=null&&("number"!=typeof a?.maxItems||a?.maxItems<1))throw new g("Invalid maxItems. Must be a positive number and greater than zero");if(a?.affinity!=null&&a?.affinity!==4&&a?.affinity!==6)throw new g("Invalid affinity. Must be either 4 or 6");if(a?.dualStack!=null&&"boolean"!=typeof a?.dualStack)throw new g("Invalid dualStack. Must be a boolean");if(a?.lookup!=null&&"function"!=typeof a?.lookup)throw new g("Invalid lookup. Must be a function");if(a?.pick!=null&&"function"!=typeof a?.pick)throw new g("Invalid pick. Must be a function");if(a?.storage!=null&&("function"!=typeof a?.storage?.get||"function"!=typeof a?.storage?.set||"function"!=typeof a?.storage?.full||"function"!=typeof a?.storage?.delete))throw new g("Invalid storage. Must be a object with methods: { get, set, full, delete }");let c=a?.dualStack??!0;b=c?a?.affinity??null:a?.affinity??4;let e=new l({maxTTL:a?.maxTTL??1e4,lookup:a?.lookup??null,pick:a?.pick??null,dualStack:c,affinity:b,maxItems:a?.maxItems??1/0,storage:a?.storage});return a=>function(b,c){if(null==b.origin)return a(b,c);let f=b.origin.constructor===URL?b.origin:new URL(b.origin);return 0!==d(f.hostname)?a(b,c):(e.runLookup(f,b,(d,g)=>{if(d)return c.onResponseError(null,d);a({...b,servername:f.hostname,origin:g.origin,headers:j(f.host,b.headers)},e.getHandler({origin:f,dispatch:a,handler:c,newOrigin:g},b))}),!0)}}},27137:(a,b,c)=>{"use strict";c.d(b,{A:()=>f});let d=new Uint8Array(16);var e=c(82009);let f=function(a,b,c){return b||a||!crypto.randomUUID?function(a,b,c){let f=(a=a||{}).random??a.rng?.()??crypto.getRandomValues(d);if(f.length<16)throw Error("Random bytes length must be >= 16");if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=f[a];return b}return(0,e.k)(f)}(a,b,c):crypto.randomUUID()}},27432:(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",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",na:"notion-ai","notion-ai":"notion-ai",mimo:"xiaomi-mimo","xiaomi-mimo":"xiaomi-mimo",fish:"fish-audio","fish-audio":"fish-audio",trae:"trae",marscode:"trae",ws:"windsurf",windsurf:"windsurf",zd:"zed",zed:"zed",dv:"devin-cli",devin:"devin-cli","devin-cli":"devin-cli",xmtp:"xiaomi-tokenplan","xiaomi-tokenplan":"xiaomi-tokenplan",mmf:"mimo-free","mimo-free":"mimo-free",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",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-research",nous:"nous-research",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"};function e(a){return d[a]||a}},27696:(a,b,c)=>{"use strict";c(19458),c(56294),c(42541),c(8735),c(43212)},28113:(a,b,c)=>{"use strict";c.r(b),c.d(b,{geminiToOpenAIResponse:()=>j});var d=c(56294),e=c(42541),f=c(90943);function g(a){return"number"==typeof a&&Number.isFinite(a)?Math.max(0,a):0}function h(a,b){a.messageId||(a.messageId=b.responseId||`msg_${Date.now()}`,a.model=b.modelVersion||"gemini",a.functionIndex=0)}function i(a,b=null){if(!a.responseStarted||a.finishReasonSent)return null;let c=(0,f.Jm)(b,{format:e.h.GEMINI,hasToolCalls:(a.toolCalls?.size||0)>0});return a.finishReason=c,a.finishReasonSent=!0,{id:`chatcmpl-${a.messageId}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:a.model,choices:[{index:0,delta:{},finish_reason:c}],...a.usage?{usage:a.usage}:{}}}function j(a,b){let c;if(!a){if("antigravity"!==b.provider)return null;let a=i(b);return a?[a]:null}let d=a.response||a;if(!d)return null;if((c=function(a){if(!a||"object"!=typeof a)return null;let b=g(a.promptTokenCount),c=g(a.thoughtsTokenCount),d=g(a.cachedContentTokenCount),e="number"==typeof a.candidatesTokenCount&&Number.isFinite(a.candidatesTokenCount),f=g(a.candidatesTokenCount),h=g(a.totalTokenCount);!e&&h>0&&(f=Math.max(0,h-b-c));let i=f+c;0===h&&(h=b+i);let j={prompt_tokens:b,completion_tokens:i,total_tokens:h};return d>0&&(j.prompt_tokens_details={cached_tokens:d}),c>0&&(j.completion_tokens_details={reasoning_tokens:c}),j}(d?.usageMetadata||a?.usageMetadata))&&(b.usage=c),!d.candidates?.[0]){let a=d.promptFeedback?.blockReason;if(!(0,f.od)(a))return null;h(b,d),b.responseStarted=!0;let c=i(b,a);return c?[c]:null}let e=[],j=d.candidates[0],k=j.content;if(b.responseStarted=!0,b.messageId||(h(b,d),e.push({id:`chatcmpl-${b.messageId}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:b.model,choices:[{index:0,delta:{role:"assistant"},finish_reason:null}]})),k?.parts)for(let a of k.parts){let c=a.thoughtSignature||a.thought_signature,d=!0===a.thought;if(c){let c=void 0!==a.text&&""!==a.text,f=!!a.functionCall;if(c&&e.push({id:`chatcmpl-${b.messageId}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:b.model,choices:[{index:0,delta:d?{reasoning_content:a.text}:{content:a.text},finish_reason:null}]}),f){let c=a.functionCall.name,d=b.toolNameMap?.get(c)||c,f=a.functionCall.args||{},g=b.functionIndex++,h={id:`${d}-${Date.now()}-${g}`,index:g,type:"function",function:{name:d,arguments:JSON.stringify(f)}};b.toolCalls.set(g,h),e.push({id:`chatcmpl-${b.messageId}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:b.model,choices:[{index:0,delta:{tool_calls:[h]},finish_reason:null}]})}continue}if(void 0!==a.text&&""!==a.text&&e.push({id:`chatcmpl-${b.messageId}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:b.model,choices:[{index:0,delta:{content:a.text},finish_reason:null}]}),a.functionCall){let c=a.functionCall.name,d=b.toolNameMap?.get(c)||c,f=a.functionCall.args||{},g=b.functionIndex++,h={id:`${d}-${Date.now()}-${g}`,index:g,type:"function",function:{name:d,arguments:JSON.stringify(f)}};b.toolCalls.set(g,h),e.push({id:`chatcmpl-${b.messageId}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:b.model,choices:[{index:0,delta:{tool_calls:[h]},finish_reason:null}]})}let f=a.inlineData||a.inline_data;if(f?.data){let a=f.mimeType||f.mime_type||"image/png";e.push({id:`chatcmpl-${b.messageId}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:b.model,choices:[{index:0,delta:{images:[{type:"image_url",image_url:{url:`data:${a};base64,${f.data}`}}]},finish_reason:null}]})}}if(j.finishReason){let a=i(b,j.finishReason);a&&e.push(a)}return e.length>0?e:null}(0,d.kz)(e.h.GEMINI,e.h.OPENAI,null,j),(0,d.kz)(e.h.GEMINI_CLI,e.h.OPENAI,null,j),(0,d.kz)(e.h.ANTIGRAVITY,e.h.OPENAI,null,j),(0,d.kz)(e.h.VERTEX,e.h.OPENAI,null,j)},28477:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{o:()=>y});var e=c(69384),f=c(30395),g=c(8735),h=c(79499),i=c(21616),j=c(84238),k=c(42541),l=c(46956),m=c(90548),n=c(74075),o=c.n(n),p=a([m]);m=(p.then?(await p)():p)[0];let v=null;if(!("u">typeof caches&&"object"==typeof caches||"u">typeof EdgeRuntime))try{v=await Promise.resolve().then(c.t.bind(c,73496,23))}catch{}let w="1"===process.env.CURSOR_STREAM_DEBUG,x=(...a)=>{w&&console.log(...a)};function q(a,b){return{...a,transport:b,debug:{...a?.debug||{},cursorTransport:b}}}function r(a){let b=String(a||"").split("/").pop();return/^composer(?:-|$)/i.test(b)}function s(a){if(!a)return"";let b="</think>",c=a.lastIndexOf(b);return c<0?"":a.slice(c+b.length).trimStart()}function t(a,b){if(a.length>10&&123===a[0]&&34===a[1])try{if(a.toString("utf-8").startsWith('{"error"'))return x("[DECOMPRESS] Detected JSON error, skipping decompression"),a}catch{}if(1===b||2===b||3===b)try{return o().gunzipSync(a)}catch(c){try{return o().inflateSync(a)}catch(d){try{return o().inflateRawSync(a)}catch(e){x(`[DECOMPRESS ERROR] flags=${b}, payloadSize=${a.length}, gzip=${c.message}, deflate=${d.message}, raw=${e.message}`),x("[DECOMPRESS ERROR] First 50 bytes (hex):",a.slice(0,50).toString("hex"))}}}return a}function u(a){let b=a?.error?.details?.[0]?.debug?.details?.title||a?.error?.details?.[0]?.debug?.details?.detail||a?.error?.message||"API Error",c=a?.error?.code==="resource_exhausted";return new Response(JSON.stringify({error:{message:b,type:c?"rate_limit_error":"api_error",code:a?.error?.details?.[0]?.debug?.error||"unknown"}}),{status:c?g.gx.RATE_LIMITED:g.gx.BAD_REQUEST,headers:{"Content-Type":"application/json"}})}class y extends e.Hv{constructor(){super("cursor",f.xq.cursor)}buildUrl(){return`${this.config.baseUrl}${this.config.chatPath}`}buildHeaders(a){let b=a.accessToken,c=a.providerSpecificData?.machineId,d=a.providerSpecificData?.ghostMode!==!1;if(!c)throw Error("Machine ID is required for Cursor API");return(0,i.JA)(b,c,d)}transformRequest(a,b,c,d){let e=b.messages||[],f=b.tools||[],g=b.reasoning_effort||null,i=d?.rawHeaders?.["user-agent"]||"",j=i.includes("claude-cli")||i.includes("claude-code")||i.includes("Claude Code");return(0,h.yI)(e,a,f,g,j)}async makeFetchRequest(a,b,c,d,e=null){let f=await (0,l.proxyAwareFetch)(a,{method:"POST",headers:b,body:c,signal:d},e);return{status:f.status,headers:Object.fromEntries(f.headers.entries()),body:Buffer.from(await f.arrayBuffer())}}makeHttp2Request(a,b,c,d){if(!v)throw Error("http2 module not available");return new Promise((e,f)=>{let g=new URL(a),h=v.connect(`https://${g.host}`),i=[],j={},k=!1,l=a=>(...b)=>{k||(k=!0,clearTimeout(m),h.close(),a(...b))},m=setTimeout(l(()=>{f(Error("HTTP/2 request timed out"))}),6e4);h.on("error",l(f));let n=h.request({":method":"POST",":path":g.pathname,":authority":g.host,":scheme":"https",...b});if(n.on("response",a=>{j=a}),n.on("data",a=>{i.push(a)}),n.on("end",l(()=>{e({status:j[":status"],headers:j,body:Buffer.concat(i)})})),n.on("error",l(f)),d){let a=l(()=>f(Error("Request aborted")));d.addEventListener("abort",a,{once:!0})}n.write(c),n.end()})}executeAgent(a){return(0,m.RR)(a)}async executeLegacy({model:a,body:b,stream:c,credentials:d,signal:e,proxyOptions:f=null}){let h=this.buildUrl(),i=this.buildHeaders(d),j=this.transformRequest(a,b,c,d);try{let d=f?.enabled===!0||f?.connectionProxyEnabled===!0||!!f?.vercelRelayUrl,g=v&&!d?await this.makeHttp2Request(h,i,j,e):await this.makeFetchRequest(h,i,j,e,f);if(200!==g.status){let a=g.body?.toString()||"Unknown error",c=new Response(JSON.stringify({error:{message:`[${g.status}]: ${a}`,type:"invalid_request_error",code:""}}),{status:g.status,headers:{"Content-Type":"application/json"}});return q({response:c,url:h,headers:i,transformedBody:b},"legacy")}return{response:!1!==c?this.transformProtobufToSSE(g.body,a,b):this.transformProtobufToJSON(g.body,a,b),url:h,headers:i,transformedBody:b,transport:"legacy"}}catch(a){return{response:new Response(JSON.stringify({error:{message:a.message,type:"connection_error",code:""}}),{status:g.gx.SERVER_ERROR,headers:{"Content-Type":"application/json"}}),url:h,headers:i,transformedBody:b,transport:"legacy"}}}async execute(a){var b;let c={...a.body,stream:!0===a.stream};if(!(0,m.bh)(c)||(b=a.proxyOptions,b?.enabled===!0||b?.connectionProxyEnabled===!0||b?.vercelRelayUrl))return q(await this.executeLegacy(a),"legacy");try{return a.log?.debug?.("CURSOR","Using capability-gated AgentService transport"),q(await this.executeAgent({...a,body:c}),"agent")}catch(b){if(b?.name==="AbortError")throw b;if(b?.semanticCommitted!==!0&&b?.name!=="AbortError")return a.log?.warn?.("CURSOR","AgentService failed before output; using legacy transport"),q(await this.executeLegacy(a),"legacy");return{response:new Response(JSON.stringify({error:{message:"Cursor AgentService failed after producing output",type:"connection_error",code:"cursor_agent_committed_failure"}}),{status:g.gx.BAD_GATEWAY,headers:{"Content-Type":"application/json","X-Zevai-Transport":"cursor-agent"}}),url:"https://agent.api5.cursor.sh/agent.v1.AgentService/Run",headers:{},transformedBody:a.body,semanticCommitted:b?.semanticCommitted===!0,retryable:!1,transport:"agent",debug:{cursorTransport:"agent"}}}}transformProtobufToJSON(a,b,c){let d=`chatcmpl-cursor-${Date.now()}`,e=Math.floor(Date.now()/1e3),f=0,i="",l="",m=[],n=new Map,o=new Set,p=0;for(x(`[CURSOR BUFFER] Total length: ${a.length} bytes`);f<a.length;){if(f+5>a.length){x(`[CURSOR BUFFER] Reached end, offset=${f}, remaining=${a.length-f}`);break}let b=a[f],c=a.readUInt32BE(f+1);if(x(`[CURSOR BUFFER] Frame ${p+1}: flags=0x${b.toString(16).padStart(2,"0")}, length=${c}`),f+5+c>a.length){x(`[CURSOR BUFFER] Incomplete frame, offset=${f}, length=${c}, buffer.length=${a.length}`);break}let d=a.slice(f+5,f+5+c);if(f+=5+c,p++,!(d=t(d,b))){x(`[CURSOR BUFFER] Frame ${p}: decompression failed, skipping`);continue}if(d.length>0&&123===d[0])try{let a=d.toString("utf-8");if(a.includes('"error"')){let b=i||n.size>0;if(x(`[CURSOR BUFFER] Error frame (hasContent=${b}): ${a.slice(0,500)}`),b)break;return u(JSON.parse(a))}}catch{}let e=(0,h.CP)(new Uint8Array(d));if(x(`[CURSOR DECODED] Frame ${p}:`,e),e.error){let a=i||n.size>0;if(x(`[CURSOR BUFFER] Decoded error (hasContent=${a}): ${e.error}`),a)break;return new Response(JSON.stringify({error:{message:e.error,type:"rate_limit_error",code:"rate_limited"}}),{status:g.gx.RATE_LIMITED,headers:{"Content-Type":"application/json"}})}if(e.toolCall){let a=e.toolCall;if(n.has(a.id)){let b=n.get(a.id);b.function.arguments+=a.function.arguments,b.isLast=a.isLast}else n.set(a.id,{...a});if(a.isLast){let b=n.get(a.id);o.add(a.id),m.push({id:b.id,type:b.type,function:{name:b.function.name,arguments:b.function.arguments}})}}e.text&&(i+=e.text),e.thinking&&(l+=e.thinking)}let q=r(b)?s(l):"",v=i||q;for(let[a,b]of(x(`[CURSOR BUFFER] Parsed ${p} frames, toolCallsMap size: ${n.size}, finalized toolCalls: ${m.length}`),n.entries()))o.has(a)||(x(`[CURSOR BUFFER] Finalizing incomplete tool call: ${a}, isLast=${b.isLast}`),m.push({id:b.id,type:b.type,function:{name:b.function.name,arguments:b.function.arguments}}));x(`[CURSOR BUFFER] Final toolCalls count: ${m.length}`);let w={role:"assistant",content:v||null};m.length>0&&(w.tool_calls=m);let y=(0,j.OF)(c,v.length,k.h.OPENAI),z={id:d,object:"chat.completion",created:e,model:b,choices:[{index:0,message:w,finish_reason:m.length>0?"tool_calls":"stop"}],usage:y};return new Response(JSON.stringify(z),{status:200,headers:{"Content-Type":"application/json"}})}transformProtobufToSSE(a,b,c){let d=`chatcmpl-cursor-${Date.now()}`,e=Math.floor(Date.now()/1e3),f=[],i=0,l="",m="",n=0,o=[],p=new Map,q=new Set,v=new Set,w=0;for(x(`[CURSOR BUFFER SSE] Total length: ${a.length} bytes`);i<a.length;){if(i+5>a.length){x(`[CURSOR BUFFER SSE] Reached end, offset=${i}, remaining=${a.length-i}`);break}let c=a[i],j=a.readUInt32BE(i+1);if(x(`[CURSOR BUFFER SSE] Frame ${w+1}: flags=0x${c.toString(16).padStart(2,"0")}, length=${j}`),i+5+j>a.length){x(`[CURSOR BUFFER SSE] Incomplete frame, offset=${i}, length=${j}, buffer.length=${a.length}`);break}let k=a.slice(i+5,i+5+j);if(i+=5+j,w++,!(k=t(k,c))){x(`[CURSOR BUFFER SSE] Frame ${w}: decompression failed, skipping`);continue}if(123===k[0])try{let a=k.toString("utf-8");if(a.includes('"error"')){let b=f.length>0||l||p.size>0;if(x(`[CURSOR BUFFER SSE] Error frame (hasContent=${b}): ${a.slice(0,500)}`),b)break;return u(JSON.parse(a))}}catch{}let y=(0,h.CP)(new Uint8Array(k));if(x(`[CURSOR DECODED SSE] Frame ${w}:`,y),y.error){let a=f.length>0||l||p.size>0;if(x(`[CURSOR BUFFER SSE] Decoded error (hasContent=${a}): ${y.error}`),a)break;return new Response(JSON.stringify({error:{message:y.error,type:"rate_limit_error",code:"rate_limited"}}),{status:g.gx.RATE_LIMITED,headers:{"Content-Type":"application/json"}})}if(y.toolCall){let a=y.toolCall;if(0===f.length&&f.push(`data: ${JSON.stringify({id:d,object:"chat.completion.chunk",created:e,model:b,choices:[{index:0,delta:{role:"assistant",content:""},finish_reason:null}]})}
@@ -234,9 +236,13 @@ ${a.content}`:a.content;j.push(H(e,c.userId)),k+=1}return 0===k&&j.push(H("Pleas
234
236
  ${a}`):"assistant"===c.role?b.push(`[Assistant]
235
237
  ${a}`):b.push(a)}return JSON.stringify([{type:"text",data:{content:b.join("\n\n")}}])}(b?.messages||[]),j=`chatcmpl-trae-${Date.now()}`,k=Math.floor(Date.now()/1e3),l=(a,b)=>new Response(JSON.stringify({error:{message:b,type:"api_error",code:""}}),{status:a,headers:{"Content-Type":"application/json"}});try{f=await this.createSession(g,i,a,h,e)}catch(a){return{response:l(502,a?.message?String(a.message):String(a)),url:this.base(),headers:g,transformedBody:b}}let m=[],n={},o=0,p=null,q=null,r=a=>{let b=a.id;if(!b)return"";b in n||m.push(b);let c=a.thought||"";c.length>=(n[b]||"").length&&(n[b]=c);let d=m.map(a=>n[a]).join(""),e=d.slice(o);return o=d.length,e};if(!1!==c){let c=new TextEncoder;return{response:new Response(new ReadableStream({start:async b=>{let d=a=>b.enqueue(c.encode(`data: ${JSON.stringify(a)}
236
238
 
237
- `));d({id:j,object:"chat.completion.chunk",created:k,model:a,choices:[{index:0,delta:{role:"assistant"},finish_reason:null}]});try{await this.streamEvents(g,f.sessionId,f.messageId,(b,c)=>{if("error"===b)return q=c,!0;if("token_usage"===b&&(p=c),"plan_item"===b){let b=r(c);b&&d({id:j,object:"chat.completion.chunk",created:k,model:a,choices:[{index:0,delta:{content:b},finish_reason:null}]})}return"done"===b},e),q?d({id:j,object:"chat.completion.chunk",created:k,model:a,choices:[],error:{message:`trae ${q.code||""}: ${q.message||""}`,type:"api_error"}}):(d({id:j,object:"chat.completion.chunk",created:k,model:a,choices:[{index:0,delta:{},finish_reason:"stop"}]}),p&&d({id:j,object:"chat.completion.chunk",created:k,model:a,choices:[],usage:{prompt_tokens:p.prompt_tokens||0,completion_tokens:p.completion_tokens||0,total_tokens:p.total_tokens||0}})),b.enqueue(c.encode("data: [DONE]\n\n")),b.close()}catch(a){b.error(a)}}}),{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}}),url:this.base(),headers:g,transformedBody:b}}try{await this.streamEvents(g,f.sessionId,f.messageId,(a,b)=>"error"===a?(q=b,!0):("token_usage"===a&&(p=b),"plan_item"===a&&r(b),"done"===a),e)}catch(a){return{response:l(502,a?.message?String(a.message):String(a)),url:this.base(),headers:g,transformedBody:b}}if(q)return{response:l(502,`trae ${q.code||""}: ${q.message||""}`),url:this.base(),headers:g,transformedBody:b};let s={id:j,object:"chat.completion",created:k,model:a,choices:[{index:0,message:{role:"assistant",content:m.map(a=>n[a]).join("")},finish_reason:"stop"}]};return p&&(s.usage={prompt_tokens:p.prompt_tokens||0,completion_tokens:p.completion_tokens||0,total_tokens:p.total_tokens||0}),{response:new Response(JSON.stringify(s),{status:200,headers:{"Content-Type":"application/json"}}),url:this.base(),headers:g,transformedBody:b}}async refreshCredentials(){return null}}},28665:(a,b,c)=>{"use strict";let{kConstruct:d}=c(49176),{kEnumerableProperty:e}=c(84285),{iteratorMixin:f,isValidHeaderName:g,isValidHeaderValue:h}=c(42425),{webidl:i}=c(32984),j=c(34589),k=c(57975);function l(a){return 10===a||13===a||9===a||32===a}function m(a){let b=0,c=a.length;for(;c>b&&l(a.charCodeAt(c-1));)--c;for(;c>b&&l(a.charCodeAt(b));)++b;return 0===b&&c===a.length?a:a.substring(b,c)}function n(a,b){if(Array.isArray(b))for(let c=0;c<b.length;++c){let d=b[c];if(2!==d.length)throw i.errors.exception({header:"Headers constructor",message:`expected name/value pair to be length 2, found ${d.length}.`});o(a,d[0],d[1])}else if("object"==typeof b&&null!==b){let c=Object.keys(b);for(let d=0;d<c.length;++d)o(a,c[d],b[c[d]])}else throw i.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence<sequence<ByteString>>","record<ByteString, ByteString>"]})}function o(a,b,c){if(c=m(c),g(b)){if(!h(c))throw i.errors.invalidArgument({prefix:"Headers.append",value:c,type:"header value"})}else throw i.errors.invalidArgument({prefix:"Headers.append",value:b,type:"header name"});if("immutable"===s(a))throw TypeError("immutable");return u(a).append(b,c,!1)}function p(a,b){return a[0]<b[0]?-1:1}class q{cookies=null;sortedMap;headersMap;constructor(a){a instanceof q?(this.headersMap=new Map(a.headersMap),this.sortedMap=a.sortedMap,this.cookies=null===a.cookies?null:[...a.cookies]):(this.headersMap=new Map(a),this.sortedMap=null)}contains(a,b){return this.headersMap.has(b?a:a.toLowerCase())}clear(){this.headersMap.clear(),this.sortedMap=null,this.cookies=null}append(a,b,c){this.sortedMap=null;let d=c?a:a.toLowerCase(),e=this.headersMap.get(d);if(e){let a="cookie"===d?"; ":", ";this.headersMap.set(d,{name:e.name,value:`${e.value}${a}${b}`})}else this.headersMap.set(d,{name:a,value:b});"set-cookie"===d&&(this.cookies??=[]).push(b)}set(a,b,c){this.sortedMap=null;let d=c?a:a.toLowerCase();"set-cookie"===d&&(this.cookies=[b]),this.headersMap.set(d,{name:a,value:b})}delete(a,b){this.sortedMap=null,b||(a=a.toLowerCase()),"set-cookie"===a&&(this.cookies=null),this.headersMap.delete(a)}get(a,b){return this.headersMap.get(b?a:a.toLowerCase())?.value??null}*[Symbol.iterator](){for(let{0:a,1:{value:b}}of this.headersMap)yield[a,b]}get entries(){let a={};if(0!==this.headersMap.size)for(let{name:b,value:c}of this.headersMap.values())a[b]=c;return a}rawValues(){return this.headersMap.values()}get entriesList(){let a=[];if(0!==this.headersMap.size)for(let{0:b,1:{name:c,value:d}}of this.headersMap)if("set-cookie"===b)for(let b of this.cookies)a.push([c,b]);else a.push([c,d]);return a}toSortedArray(){let a=this.headersMap.size,b=Array(a);if(a<=32){if(0===a)return b;let c=this.headersMap[Symbol.iterator](),d=c.next().value;b[0]=[d[0],d[1].value],j(null!==d[1].value);for(let d=1,e=0,f=0,g=0,h=0,i,k;d<a;++d){for(k=c.next().value,j(null!==(i=b[d]=[k[0],k[1].value])[1]),g=0,f=d;g<f;)b[h=g+(f-g>>1)][0]<=i[0]?g=h+1:f=h;if(d!==h){for(e=d;e>g;)b[e]=b[--e];b[g]=i}}if(!c.next().done)throw TypeError("Unreachable");return b}{let a=0;for(let{0:c,1:{value:d}}of this.headersMap)b[a++]=[c,d],j(null!==d);return b.sort(p)}}}class r{#J;#K;constructor(a){if(i.util.markAsUncloneable(this),a===d)return;this.#K=new q,this.#J="none",void 0!==a&&n(this,a=i.converters.HeadersInit(a,"Headers constructor","init"))}append(a,b){i.brandCheck(this,r),i.argumentLengthCheck(arguments,2,"Headers.append");let c="Headers.append";return a=i.converters.ByteString(a,c,"name"),b=i.converters.ByteString(b,c,"value"),o(this,a,b)}delete(a){if(i.brandCheck(this,r),i.argumentLengthCheck(arguments,1,"Headers.delete"),!g(a=i.converters.ByteString(a,"Headers.delete","name")))throw i.errors.invalidArgument({prefix:"Headers.delete",value:a,type:"header name"});if("immutable"===this.#J)throw TypeError("immutable");this.#K.contains(a,!1)&&this.#K.delete(a,!1)}get(a){i.brandCheck(this,r),i.argumentLengthCheck(arguments,1,"Headers.get");let b="Headers.get";if(!g(a=i.converters.ByteString(a,b,"name")))throw i.errors.invalidArgument({prefix:b,value:a,type:"header name"});return this.#K.get(a,!1)}has(a){i.brandCheck(this,r),i.argumentLengthCheck(arguments,1,"Headers.has");let b="Headers.has";if(!g(a=i.converters.ByteString(a,b,"name")))throw i.errors.invalidArgument({prefix:b,value:a,type:"header name"});return this.#K.contains(a,!1)}set(a,b){i.brandCheck(this,r),i.argumentLengthCheck(arguments,2,"Headers.set");let c="Headers.set";if(a=i.converters.ByteString(a,c,"name"),b=m(b=i.converters.ByteString(b,c,"value")),g(a)){if(!h(b))throw i.errors.invalidArgument({prefix:c,value:b,type:"header value"})}else throw i.errors.invalidArgument({prefix:c,value:a,type:"header name"});if("immutable"===this.#J)throw TypeError("immutable");this.#K.set(a,b,!1)}getSetCookie(){i.brandCheck(this,r);let a=this.#K.cookies;return a?[...a]:[]}[k.inspect.custom](a,b){return b.depth??=a,`Headers ${k.formatWithOptions(b,this.#K.entries)}`}static getHeadersGuard(a){return a.#J}static setHeadersGuard(a,b){a.#J=b}static getHeadersList(a){return a.#K}static setHeadersList(a,b){a.#K=b}}let{getHeadersGuard:s,setHeadersGuard:t,getHeadersList:u,setHeadersList:v}=r;Reflect.deleteProperty(r,"getHeadersGuard"),Reflect.deleteProperty(r,"setHeadersGuard"),Reflect.deleteProperty(r,"getHeadersList"),Reflect.deleteProperty(r,"setHeadersList"),f("Headers",r,function(a){let b=u(a);if(!b)return[];if(b.sortedMap)return b.sortedMap;let c=[],d=b.toSortedArray(),e=b.cookies;if(null===e||1===e.length)return b.sortedMap=d;for(let a=0;a<d.length;++a){let{0:b,1:f}=d[a];if("set-cookie"===b)for(let a=0;a<e.length;++a)c.push([b,e[a]]);else c.push([b,f])}return b.sortedMap=c},0,1),Object.defineProperties(r.prototype,{append:e,delete:e,get:e,has:e,set:e,getSetCookie:e,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[k.inspect.custom]:{enumerable:!1}}),i.converters.HeadersInit=function(a,b,c){if(i.util.Type(a)===i.util.Types.OBJECT){let d=Reflect.get(a,Symbol.iterator);if(!k.types.isProxy(a)&&d===r.prototype.entries)try{return u(a).entriesList}catch{}return"function"==typeof d?i.converters["sequence<sequence<ByteString>>"](a,b,c,d.bind(a)):i.converters["record<ByteString, ByteString>"](a,b,c)}throw i.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence<sequence<ByteString>>","record<ByteString, ByteString>"]})},a.exports={fill:n,compareHeaderName:p,Headers:r,HeadersList:q,getHeadersGuard:s,setHeadersGuard:t,setHeadersList:v,getHeadersList:u}},28820:a=>{"use strict";let b=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"],c={};Object.setPrototypeOf(c,null);for(let a=0;a<b.length;++a){let d=b[a],e=d.toLowerCase();c[d]=c[e]=e}a.exports={wellknownHeaderNames:b,headerNameLowerCasedRecord:c}},28998:(a,b,c)=>{"use strict";let{UndiciError:d}=c(61448),e=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED");class f extends d{constructor(a){super(a),this.name="MockNotMatchedError",this.message=a||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}static[Symbol.hasInstance](a){return a&&!0===a[e]}get[e](){return!0}}a.exports={MockNotMatchedError:f}},29101:(a,b,c)=>{"use strict";c.r(b),c.d(b,{claudeToKiroRequest:()=>k});var d=c(56294),e=c(42541),f=c(54838),g=c(77855),h=c(94414),i=c(93745);function j(a){if("string"==typeof a)return a;if(null==a)return"";try{return JSON.stringify(a)}catch{return String(a)}}function k(a,b,c,d){var e,k,l;let{upstream:m,agentic:n,thinking:o}=(0,f.$D)(a),p=o||(0,f.gI)(b,d?.rawHeaders,a),q=(0,f.ZF)(b),{specs:r,nameMap:s}=(0,g.tH)(b.tools),t=function(a,b){let c=[];for(let d of Array.isArray(a)?a:[]){if(d?.role==="user"){let a=[],e=[],f=[];if("string"==typeof d.content)a.push(d.content);else if(Array.isArray(d.content))for(let b of d.content){b?.type==="text"&&"string"==typeof b.text&&a.push(b.text);let c=function(a){if(a?.type!=="image"||a.source?.type!=="base64"||!a.source.data)return null;let b=a.source.media_type||"image/png";return{format:b.split("/")[1]||b,source:{bytes:a.source.data}}}(b);c&&e.push(c),b?.type==="tool_result"&&f.push(function(a){let b=Array.isArray(a.content)?a.content.map(a=>j(a?.text??a)).filter(Boolean).join("\n"):j(a.content);return{toolUseId:a.tool_use_id,status:a.is_error?"error":"success",content:[{text:b}]}}(b))}let g={content:a.join("\n").trim()||"continue",modelId:b};e.length&&(g.images=e),f.length&&(g.userInputMessageContext={toolResults:f}),c.push({userInputMessage:g});continue}if(d?.role==="assistant"){let a=[],b=[];if("string"==typeof d.content)a.push(d.content);else if(Array.isArray(d.content))for(let c of d.content)c?.type==="text"&&"string"==typeof c.text&&a.push(c.text),c?.type==="tool_use"&&b.push({toolUseId:c.id,name:c.name,input:c.input??{}});let e={content:a.join("\n").trim()||"..."};b.length&&(e.toolUses=b),c.push({assistantResponseMessage:e})}}let d=null;for(let a=c.length-1;a>=0;a--)if(c[a].userInputMessage){d=c.splice(a,1)[0];break}return{history:c,currentMessage:d||={userInputMessage:{content:"continue",modelId:b}}}}(b.messages,m),u=[];p&&u.push((0,f.aZ)(b.thinking?.budget_tokens)),n&&u.push(f.rG);let v="string"==typeof(e=b.system)?e:Array.isArray(e)?e.map(a=>"string"==typeof a?a:a?.text||"").filter(Boolean).join("\n"):"";v&&u.push(`<instructions>
238
- ${v}
239
- </instructions>`);let w=u.join("\n\n"),x=`[Context: Current time is ${new Date().toISOString()}]`,y=d?.connectionId||d?.providerSpecificData?.connectionId||"",z=!function(a,b){if(a?.metadata?.user_id||a?.prompt_cache_key||a?.session_id||a?.conversation_id)return!0;let c=b&&"object"==typeof b?b:{};return["x-session-id","session-id","session_id","x-amp-thread-id"].some(a=>"string"==typeof c[a]&&c[a].trim())}(b,d?.rawHeaders)?(0,h.jS)(y,(k=t.history,l=t.currentMessage,k.find(a=>a?.userInputMessage)?.userInputMessage?.content??l?.userInputMessage?.content??"")):(0,i.oV)({headers:d?.rawHeaders,body:b,connectionId:y,scope:"kiro"}),A=(0,h.L4)({conversationId:z,connectionId:y,modelId:m,systemPrompt:w,contentPrefix:w,currentContentPrefix:x,history:t.history,currentMessage:t.currentMessage}),B=(0,g.rR)({history:A.history,currentMessage:A.currentMessage,modelId:m,toolSpecs:r,nameMap:s});if(!B.valid)return console.error(`[Kiro] refusing invalid conversation (claude -> kiro): ${B.errors.join(", ")||"unknown"}`),null;let C={conversationState:{chatTriggerType:"MANUAL",conversationId:z,currentMessage:{userInputMessage:{...B.currentMessage.userInputMessage,origin:"AI_EDITOR"}},history:B.history}},D=d?.providerSpecificData?.profileArn||"";D&&(C.profileArn=D);let E=b.max_tokens??b.max_output_tokens??32e3;(E||void 0!==b.temperature||void 0!==b.top_p)&&(C.inferenceConfig={},E&&(C.inferenceConfig.maxTokens=E),void 0!==b.temperature&&(C.inferenceConfig.temperature=b.temperature),void 0!==b.top_p&&(C.inferenceConfig.topP=b.top_p)),Object.defineProperty(C,"_kiroUpstreamModel",{value:m,enumerable:!1}),Object.defineProperty(C,"_kiroThinkingEnabled",{value:p,enumerable:!1}),Object.defineProperty(C,"_kiroExposeReasoning",{value:q,enumerable:!1});let F=new Map([...s.entries()].filter(([a,b])=>a!==b).map(([a,b])=>[b,a]));return F.size&&Object.defineProperty(C,"_toolNameMap",{value:F,enumerable:!1,configurable:!0}),C}(0,d.kz)(e.h.CLAUDE,e.h.KIRO,k,null)},29653:a=>{"use strict";a.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}},29991:(a,b,c)=>{"use strict";c.d(b,{Br:()=>H});var d=c(69384),e=c(30395),f=c(27137),g=c(87164),h=c(46956),i=c(11484),j=c(8735),k=c(21904);let l=new Set(["assistantResponseEvent","reasoningContentEvent","codeEvent","toolUseEvent"]),m=new Uint32Array(256);for(let a=0;a<m.length;a++){let b=a;for(let a=0;a<8;a++)b=1&b?0xedb88320^b>>>1:b>>>1;m[a]=b>>>0}function n(a){let b=0xffffffff;for(let c of a)b=m[(b^c)&255]^b>>>8;return(0xffffffff^b)>>>0}function o(a,b={}){let c=Error(a);return c.name="AwsEventStreamError",c.code=a,Object.assign(c,b),c}var p=c(51455),q=c(48161),r=c(76760),s=c(77598);let t=new Map;function u(a,{now:b=Date.now()}={}){return t.set(a,{verifiedUntil:b+9e5,cleanProbes:0,probeInFlight:!1}),"verified"}function v(a,{now:b=Date.now()}={}){let c=t.get(a);return c?c.probeInFlight?(c.probeInFlight=!1,c.cleanProbes+=1,c.cleanProbes>=5)?(t.delete(a),"live"):(c.verifiedUntil=b,"verified"):"verified":"live"}function w(a,{now:b=Date.now()}={}){let c=t.get(a);c?.probeInFlight&&(c.probeInFlight=!1,c.verifiedUntil=Math.min(c.verifiedUntil,b))}function x(...a){for(let b of a)if(("string"==typeof b||"number"==typeof b)&&String(b).trim())return String(b).trim();return""}function y(...a){for(let b of a){if("string"!=typeof b&&"number"!=typeof b)continue;let a=String(b).trim();if(/^[A-Za-z0-9_.:#/-]{1,200}$/.test(a)&&!(/^aor[A-Za-z0-9._~+/=-]{8,}$/.test(a)||/^eyJ[A-Za-z0-9_-]{8,}\./.test(a)))return a}return null}function z(a,b){let c=a?.headers;if(!c)return null;if("function"==typeof c.get)return c.get(b);let d=Object.entries(c).find(([a])=>a.toLowerCase()===b.toLowerCase());return d?.[1]??null}function A(a,b){return B(a,b)[0]??null}function B(a,b){if(!a||"object"!=typeof a)return[];let c=new Set(b.map(a=>a.toLowerCase())),d=[{value:a,depth:0}],e=new Set,f=[];for(;d.length>0&&e.size<64;){let{value:a,depth:b}=d.shift();if(!(!a||"object"!=typeof a||e.has(a)))for(let[g,h]of(e.add(a),Object.entries(a)))c.has(g.toLowerCase())&&null!=h&&""!==h&&f.push(h),b<3&&h&&"object"==typeof h&&d.push({value:h,depth:b+1})}return f}function C(a){return a&&"object"==typeof a?[...new Set(B(a,["reason","code","errorCode","type","__type","status"]).map(a=>y(a)).filter(Boolean))]:[]}function D(a,b){if(null==a||""===a)return null;let c="number"==typeof a?a:Number(String(a).trim());if(Number.isFinite(c)){let a=c>=1e12?c:c>=1e9?1e3*c:null;return a&&a>b?Math.round(a):null}let d=Date.parse(String(a));return Number.isFinite(d)&&d>b?d:null}function E(a,b){if(null==a||""===a)return null;let c=String(a).trim().toLowerCase().match(/^(\d+(?:\.\d+)?)\s*(ms|s|m|h)?$/);if(!c)return null;let d=Number(c[1]);return!Number.isFinite(d)||d<=0?null:b+Math.round(d*("ms"===c[2]?1:"m"===c[2]?6e4:"h"===c[2]?36e5:1e3))}function F(a,b="KIRO_STREAM_PROTOCOL_ERROR",c="Kiro upstream returned an invalid event stream"){let d=/^(?:AWS_EVENTSTREAM|KIRO_STREAM|KIRO_VERIFIED)_[A-Z0-9_]+$/.test(String(b||""))?String(b):"KIRO_STREAM_PROTOCOL_ERROR",e=a.parseError({status:j.gx.BAD_GATEWAY,headers:{}},JSON.stringify({code:d,message:c}));return{error:{message:e.message,type:"kiro_stream_error",code:e.providerErrorCode||d,status:e.status},failureMetadata:{failureClass:"KIRO_STREAM_PROTOCOL_ERROR"===d?"upstream_protocol":/(?:CRC_MISMATCH|INVALID_|TRUNCATED|TOO_LARGE)/.test(d)?"protocol_corruption":"upstream_protocol",providerErrorCode:e.providerErrorCode,upstreamRequestId:e.upstreamRequestId,resetsAtMs:e.resetsAtMs,authLifecycle:{initialStatus:e.status,refreshAttempted:!1,refreshOutcome:"not_attempted",retryStatus:null}}}}function G(a,b){return new Response(`data: ${JSON.stringify(b)}
239
+ `));d({id:j,object:"chat.completion.chunk",created:k,model:a,choices:[{index:0,delta:{role:"assistant"},finish_reason:null}]});try{await this.streamEvents(g,f.sessionId,f.messageId,(b,c)=>{if("error"===b)return q=c,!0;if("token_usage"===b&&(p=c),"plan_item"===b){let b=r(c);b&&d({id:j,object:"chat.completion.chunk",created:k,model:a,choices:[{index:0,delta:{content:b},finish_reason:null}]})}return"done"===b},e),q?d({id:j,object:"chat.completion.chunk",created:k,model:a,choices:[],error:{message:`trae ${q.code||""}: ${q.message||""}`,type:"api_error"}}):(d({id:j,object:"chat.completion.chunk",created:k,model:a,choices:[{index:0,delta:{},finish_reason:"stop"}]}),p&&d({id:j,object:"chat.completion.chunk",created:k,model:a,choices:[],usage:{prompt_tokens:p.prompt_tokens||0,completion_tokens:p.completion_tokens||0,total_tokens:p.total_tokens||0}})),b.enqueue(c.encode("data: [DONE]\n\n")),b.close()}catch(a){b.error(a)}}}),{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}}),url:this.base(),headers:g,transformedBody:b}}try{await this.streamEvents(g,f.sessionId,f.messageId,(a,b)=>"error"===a?(q=b,!0):("token_usage"===a&&(p=b),"plan_item"===a&&r(b),"done"===a),e)}catch(a){return{response:l(502,a?.message?String(a.message):String(a)),url:this.base(),headers:g,transformedBody:b}}if(q)return{response:l(502,`trae ${q.code||""}: ${q.message||""}`),url:this.base(),headers:g,transformedBody:b};let s={id:j,object:"chat.completion",created:k,model:a,choices:[{index:0,message:{role:"assistant",content:m.map(a=>n[a]).join("")},finish_reason:"stop"}]};return p&&(s.usage={prompt_tokens:p.prompt_tokens||0,completion_tokens:p.completion_tokens||0,total_tokens:p.total_tokens||0}),{response:new Response(JSON.stringify(s),{status:200,headers:{"Content-Type":"application/json"}}),url:this.base(),headers:g,transformedBody:b}}async refreshCredentials(){return null}}},28665:(a,b,c)=>{"use strict";let{kConstruct:d}=c(49176),{kEnumerableProperty:e}=c(84285),{iteratorMixin:f,isValidHeaderName:g,isValidHeaderValue:h}=c(42425),{webidl:i}=c(32984),j=c(34589),k=c(57975);function l(a){return 10===a||13===a||9===a||32===a}function m(a){let b=0,c=a.length;for(;c>b&&l(a.charCodeAt(c-1));)--c;for(;c>b&&l(a.charCodeAt(b));)++b;return 0===b&&c===a.length?a:a.substring(b,c)}function n(a,b){if(Array.isArray(b))for(let c=0;c<b.length;++c){let d=b[c];if(2!==d.length)throw i.errors.exception({header:"Headers constructor",message:`expected name/value pair to be length 2, found ${d.length}.`});o(a,d[0],d[1])}else if("object"==typeof b&&null!==b){let c=Object.keys(b);for(let d=0;d<c.length;++d)o(a,c[d],b[c[d]])}else throw i.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence<sequence<ByteString>>","record<ByteString, ByteString>"]})}function o(a,b,c){if(c=m(c),g(b)){if(!h(c))throw i.errors.invalidArgument({prefix:"Headers.append",value:c,type:"header value"})}else throw i.errors.invalidArgument({prefix:"Headers.append",value:b,type:"header name"});if("immutable"===s(a))throw TypeError("immutable");return u(a).append(b,c,!1)}function p(a,b){return a[0]<b[0]?-1:1}class q{cookies=null;sortedMap;headersMap;constructor(a){a instanceof q?(this.headersMap=new Map(a.headersMap),this.sortedMap=a.sortedMap,this.cookies=null===a.cookies?null:[...a.cookies]):(this.headersMap=new Map(a),this.sortedMap=null)}contains(a,b){return this.headersMap.has(b?a:a.toLowerCase())}clear(){this.headersMap.clear(),this.sortedMap=null,this.cookies=null}append(a,b,c){this.sortedMap=null;let d=c?a:a.toLowerCase(),e=this.headersMap.get(d);if(e){let a="cookie"===d?"; ":", ";this.headersMap.set(d,{name:e.name,value:`${e.value}${a}${b}`})}else this.headersMap.set(d,{name:a,value:b});"set-cookie"===d&&(this.cookies??=[]).push(b)}set(a,b,c){this.sortedMap=null;let d=c?a:a.toLowerCase();"set-cookie"===d&&(this.cookies=[b]),this.headersMap.set(d,{name:a,value:b})}delete(a,b){this.sortedMap=null,b||(a=a.toLowerCase()),"set-cookie"===a&&(this.cookies=null),this.headersMap.delete(a)}get(a,b){return this.headersMap.get(b?a:a.toLowerCase())?.value??null}*[Symbol.iterator](){for(let{0:a,1:{value:b}}of this.headersMap)yield[a,b]}get entries(){let a={};if(0!==this.headersMap.size)for(let{name:b,value:c}of this.headersMap.values())a[b]=c;return a}rawValues(){return this.headersMap.values()}get entriesList(){let a=[];if(0!==this.headersMap.size)for(let{0:b,1:{name:c,value:d}}of this.headersMap)if("set-cookie"===b)for(let b of this.cookies)a.push([c,b]);else a.push([c,d]);return a}toSortedArray(){let a=this.headersMap.size,b=Array(a);if(a<=32){if(0===a)return b;let c=this.headersMap[Symbol.iterator](),d=c.next().value;b[0]=[d[0],d[1].value],j(null!==d[1].value);for(let d=1,e=0,f=0,g=0,h=0,i,k;d<a;++d){for(k=c.next().value,j(null!==(i=b[d]=[k[0],k[1].value])[1]),g=0,f=d;g<f;)b[h=g+(f-g>>1)][0]<=i[0]?g=h+1:f=h;if(d!==h){for(e=d;e>g;)b[e]=b[--e];b[g]=i}}if(!c.next().done)throw TypeError("Unreachable");return b}{let a=0;for(let{0:c,1:{value:d}}of this.headersMap)b[a++]=[c,d],j(null!==d);return b.sort(p)}}}class r{#J;#K;constructor(a){if(i.util.markAsUncloneable(this),a===d)return;this.#K=new q,this.#J="none",void 0!==a&&n(this,a=i.converters.HeadersInit(a,"Headers constructor","init"))}append(a,b){i.brandCheck(this,r),i.argumentLengthCheck(arguments,2,"Headers.append");let c="Headers.append";return a=i.converters.ByteString(a,c,"name"),b=i.converters.ByteString(b,c,"value"),o(this,a,b)}delete(a){if(i.brandCheck(this,r),i.argumentLengthCheck(arguments,1,"Headers.delete"),!g(a=i.converters.ByteString(a,"Headers.delete","name")))throw i.errors.invalidArgument({prefix:"Headers.delete",value:a,type:"header name"});if("immutable"===this.#J)throw TypeError("immutable");this.#K.contains(a,!1)&&this.#K.delete(a,!1)}get(a){i.brandCheck(this,r),i.argumentLengthCheck(arguments,1,"Headers.get");let b="Headers.get";if(!g(a=i.converters.ByteString(a,b,"name")))throw i.errors.invalidArgument({prefix:b,value:a,type:"header name"});return this.#K.get(a,!1)}has(a){i.brandCheck(this,r),i.argumentLengthCheck(arguments,1,"Headers.has");let b="Headers.has";if(!g(a=i.converters.ByteString(a,b,"name")))throw i.errors.invalidArgument({prefix:b,value:a,type:"header name"});return this.#K.contains(a,!1)}set(a,b){i.brandCheck(this,r),i.argumentLengthCheck(arguments,2,"Headers.set");let c="Headers.set";if(a=i.converters.ByteString(a,c,"name"),b=m(b=i.converters.ByteString(b,c,"value")),g(a)){if(!h(b))throw i.errors.invalidArgument({prefix:c,value:b,type:"header value"})}else throw i.errors.invalidArgument({prefix:c,value:a,type:"header name"});if("immutable"===this.#J)throw TypeError("immutable");this.#K.set(a,b,!1)}getSetCookie(){i.brandCheck(this,r);let a=this.#K.cookies;return a?[...a]:[]}[k.inspect.custom](a,b){return b.depth??=a,`Headers ${k.formatWithOptions(b,this.#K.entries)}`}static getHeadersGuard(a){return a.#J}static setHeadersGuard(a,b){a.#J=b}static getHeadersList(a){return a.#K}static setHeadersList(a,b){a.#K=b}}let{getHeadersGuard:s,setHeadersGuard:t,getHeadersList:u,setHeadersList:v}=r;Reflect.deleteProperty(r,"getHeadersGuard"),Reflect.deleteProperty(r,"setHeadersGuard"),Reflect.deleteProperty(r,"getHeadersList"),Reflect.deleteProperty(r,"setHeadersList"),f("Headers",r,function(a){let b=u(a);if(!b)return[];if(b.sortedMap)return b.sortedMap;let c=[],d=b.toSortedArray(),e=b.cookies;if(null===e||1===e.length)return b.sortedMap=d;for(let a=0;a<d.length;++a){let{0:b,1:f}=d[a];if("set-cookie"===b)for(let a=0;a<e.length;++a)c.push([b,e[a]]);else c.push([b,f])}return b.sortedMap=c},0,1),Object.defineProperties(r.prototype,{append:e,delete:e,get:e,has:e,set:e,getSetCookie:e,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[k.inspect.custom]:{enumerable:!1}}),i.converters.HeadersInit=function(a,b,c){if(i.util.Type(a)===i.util.Types.OBJECT){let d=Reflect.get(a,Symbol.iterator);if(!k.types.isProxy(a)&&d===r.prototype.entries)try{return u(a).entriesList}catch{}return"function"==typeof d?i.converters["sequence<sequence<ByteString>>"](a,b,c,d.bind(a)):i.converters["record<ByteString, ByteString>"](a,b,c)}throw i.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence<sequence<ByteString>>","record<ByteString, ByteString>"]})},a.exports={fill:n,compareHeaderName:p,Headers:r,HeadersList:q,getHeadersGuard:s,setHeadersGuard:t,setHeadersList:v,getHeadersList:u}},28820:a=>{"use strict";let b=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"],c={};Object.setPrototypeOf(c,null);for(let a=0;a<b.length;++a){let d=b[a],e=d.toLowerCase();c[d]=c[e]=e}a.exports={wellknownHeaderNames:b,headerNameLowerCasedRecord:c}},28998:(a,b,c)=>{"use strict";let{UndiciError:d}=c(61448),e=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED");class f extends d{constructor(a){super(a),this.name="MockNotMatchedError",this.message=a||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}static[Symbol.hasInstance](a){return a&&!0===a[e]}get[e](){return!0}}a.exports={MockNotMatchedError:f}},29101:(a,b,c)=>{"use strict";c.r(b),c.d(b,{claudeToKiroRequest:()=>k});var d=c(55511),e=c.n(d),f=c(56294),g=c(42541),h=c(54838),i=c(77855);function j(a){if("string"==typeof a)return a;if(null==a)return"";try{return JSON.stringify(a)}catch{return String(a)}}function k(a,b,c,d){var f;let{upstream:g,agentic:k}=(0,h.$D)(a),l=(0,h.P9)(b,d?.rawHeaders,a),m=null!==l,n=(0,h.ZF)(b),o=(0,h.yh)(b,g),p=(0,h.cr)(b,g),{specs:q,nameMap:r}=(0,i.tH)(b.tools),s=function(a,b){let c=[];for(let d of Array.isArray(a)?a:[]){if(d?.role==="user"){let a=[],e=[],f=[];if("string"==typeof d.content)a.push(d.content);else if(Array.isArray(d.content))for(let b of d.content){b?.type==="text"&&"string"==typeof b.text&&a.push(b.text);let c=function(a){if(a?.type!=="image"||a.source?.type!=="base64"||!a.source.data)return null;let b=a.source.media_type||"image/png";return{format:b.split("/")[1]||b,source:{bytes:a.source.data}}}(b);c&&e.push(c),b?.type==="tool_result"&&f.push(function(a){let b=Array.isArray(a.content)?a.content.map(a=>j(a?.text??a)).filter(Boolean).join("\n"):j(a.content);return{toolUseId:a.tool_use_id,status:a.is_error?"error":"success",content:[{text:b}]}}(b))}let g={content:a.join("\n").trim()||"continue",modelId:b};e.length&&(g.images=e),f.length&&(g.userInputMessageContext={toolResults:f}),c.push({userInputMessage:g});continue}if(d?.role==="assistant"){let a=[],b=[];if("string"==typeof d.content)a.push(d.content);else if(Array.isArray(d.content))for(let c of d.content)c?.type==="text"&&"string"==typeof c.text&&a.push(c.text),c?.type==="tool_use"&&b.push({toolUseId:c.id,name:c.name,input:c.input??{}});let e={content:a.join("\n").trim()||"..."};b.length&&(e.toolUses=b),c.push({assistantResponseMessage:e})}}let d=null;for(let a=c.length-1;a>=0;a--)if(c[a].userInputMessage){d=c.splice(a,1)[0];break}return{history:c,currentMessage:d||={userInputMessage:{content:"continue",modelId:b}}}}(b.messages,g),t="string"==typeof(f=b.system)?f:Array.isArray(f)?f.map(a=>"string"==typeof a?a:a?.text||"").filter(Boolean).join("\n"):"",u=s.currentMessage.userInputMessage.content||"";t&&(u=`<instructions>
240
+ ${t}
241
+ </instructions>
242
+
243
+ ${u}`);let v=[];m&&!p&&v.push((0,h.aZ)(l)),v.push(`[Context: Current time is ${new Date().toISOString()}]`),k&&v.push(h.rG),u=`${v.join("\n\n")}
244
+
245
+ ${u}`;let w={userInputMessage:{...s.currentMessage.userInputMessage,content:u,...t&&{systemInstruction:t}}},x=(0,i.rR)({history:s.history,currentMessage:w,modelId:g,toolSpecs:q,nameMap:r});if(!x.valid)return console.error(`[Kiro] refusing invalid conversation (claude -> kiro): ${x.errors.join(", ")||"unknown"}`),null;let y=x.currentMessage.userInputMessage,z={conversationState:{chatTriggerType:"MANUAL",conversationId:e().randomUUID(),currentMessage:{userInputMessage:{...y,origin:"AI_EDITOR"}},history:x.history}},A=d?.providerSpecificData?.authMethod,B="api_key"===A||"idc"===A||"external_idp"===A?d?.providerSpecificData?.profileArn||"":d?.providerSpecificData?.profileArn||(0,h.We)(A);B&&(z.profileArn=B),o&&(z.additionalModelRequestFields=o);let C=b.max_tokens??b.max_output_tokens??32e3;(C||void 0!==b.temperature||void 0!==b.top_p)&&(z.inferenceConfig={},C&&(z.inferenceConfig.maxTokens=C),void 0!==b.temperature&&(z.inferenceConfig.temperature=b.temperature),void 0!==b.top_p&&(z.inferenceConfig.topP=b.top_p)),Object.defineProperty(z,"_kiroUpstreamModel",{value:g,enumerable:!1}),Object.defineProperty(z,"_kiroThinkingEnabled",{value:m,enumerable:!1}),Object.defineProperty(z,"_kiroExposeReasoning",{value:n,enumerable:!1});let D=new Map([...r.entries()].filter(([a,b])=>a!==b).map(([a,b])=>[b,a]));return D.size&&Object.defineProperty(z,"_toolNameMap",{value:D,enumerable:!1,configurable:!0}),z}(0,f.kz)(g.h.CLAUDE,g.h.KIRO,k,null)},29653:a=>{"use strict";a.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}},29991:(a,b,c)=>{"use strict";c.d(b,{Br:()=>H});var d=c(69384),e=c(30395),f=c(27137),g=c(87164),h=c(46956),i=c(11484),j=c(8735),k=c(21904);let l=new Set(["assistantResponseEvent","reasoningContentEvent","codeEvent","toolUseEvent"]),m=new Uint32Array(256);for(let a=0;a<m.length;a++){let b=a;for(let a=0;a<8;a++)b=1&b?0xedb88320^b>>>1:b>>>1;m[a]=b>>>0}function n(a){let b=0xffffffff;for(let c of a)b=m[(b^c)&255]^b>>>8;return(0xffffffff^b)>>>0}function o(a,b={}){let c=Error(a);return c.name="AwsEventStreamError",c.code=a,Object.assign(c,b),c}var p=c(51455),q=c(48161),r=c(76760),s=c(77598);let t=new Map;function u(a,{now:b=Date.now()}={}){return t.set(a,{verifiedUntil:b+9e5,cleanProbes:0,probeInFlight:!1}),"verified"}function v(a,{now:b=Date.now()}={}){let c=t.get(a);return c?c.probeInFlight?(c.probeInFlight=!1,c.cleanProbes+=1,c.cleanProbes>=5)?(t.delete(a),"live"):(c.verifiedUntil=b,"verified"):"verified":"live"}function w(a,{now:b=Date.now()}={}){let c=t.get(a);c?.probeInFlight&&(c.probeInFlight=!1,c.verifiedUntil=Math.min(c.verifiedUntil,b))}function x(...a){for(let b of a)if(("string"==typeof b||"number"==typeof b)&&String(b).trim())return String(b).trim();return""}function y(...a){for(let b of a){if("string"!=typeof b&&"number"!=typeof b)continue;let a=String(b).trim();if(/^[A-Za-z0-9_.:#/-]{1,200}$/.test(a)&&!(/^aor[A-Za-z0-9._~+/=-]{8,}$/.test(a)||/^eyJ[A-Za-z0-9_-]{8,}\./.test(a)))return a}return null}function z(a,b){let c=a?.headers;if(!c)return null;if("function"==typeof c.get)return c.get(b);let d=Object.entries(c).find(([a])=>a.toLowerCase()===b.toLowerCase());return d?.[1]??null}function A(a,b){return B(a,b)[0]??null}function B(a,b){if(!a||"object"!=typeof a)return[];let c=new Set(b.map(a=>a.toLowerCase())),d=[{value:a,depth:0}],e=new Set,f=[];for(;d.length>0&&e.size<64;){let{value:a,depth:b}=d.shift();if(!(!a||"object"!=typeof a||e.has(a)))for(let[g,h]of(e.add(a),Object.entries(a)))c.has(g.toLowerCase())&&null!=h&&""!==h&&f.push(h),b<3&&h&&"object"==typeof h&&d.push({value:h,depth:b+1})}return f}function C(a){return a&&"object"==typeof a?[...new Set(B(a,["reason","code","errorCode","type","__type","status"]).map(a=>y(a)).filter(Boolean))]:[]}function D(a,b){if(null==a||""===a)return null;let c="number"==typeof a?a:Number(String(a).trim());if(Number.isFinite(c)){let a=c>=1e12?c:c>=1e9?1e3*c:null;return a&&a>b?Math.round(a):null}let d=Date.parse(String(a));return Number.isFinite(d)&&d>b?d:null}function E(a,b){if(null==a||""===a)return null;let c=String(a).trim().toLowerCase().match(/^(\d+(?:\.\d+)?)\s*(ms|s|m|h)?$/);if(!c)return null;let d=Number(c[1]);return!Number.isFinite(d)||d<=0?null:b+Math.round(d*("ms"===c[2]?1:"m"===c[2]?6e4:"h"===c[2]?36e5:1e3))}function F(a,b="KIRO_STREAM_PROTOCOL_ERROR",c="Kiro upstream returned an invalid event stream"){let d=/^(?:AWS_EVENTSTREAM|KIRO_STREAM|KIRO_VERIFIED)_[A-Z0-9_]+$/.test(String(b||""))?String(b):"KIRO_STREAM_PROTOCOL_ERROR",e=a.parseError({status:j.gx.BAD_GATEWAY,headers:{}},JSON.stringify({code:d,message:c}));return{error:{message:e.message,type:"kiro_stream_error",code:e.providerErrorCode||d,status:e.status},failureMetadata:{failureClass:"KIRO_STREAM_PROTOCOL_ERROR"===d?"upstream_protocol":/(?:CRC_MISMATCH|INVALID_|TRUNCATED|TOO_LARGE)/.test(d)?"protocol_corruption":"upstream_protocol",providerErrorCode:e.providerErrorCode,upstreamRequestId:e.upstreamRequestId,resetsAtMs:e.resetsAtMs,authLifecycle:{initialStatus:e.status,refreshAttempted:!1,refreshOutcome:"not_attempted",retryStatus:null}}}}function G(a,b){return new Response(`data: ${JSON.stringify(b)}
240
246
 
241
247
  data: [DONE]
242
248
 
@@ -287,7 +293,7 @@ ${e(h)}\r
287
293
  ${d.content}`:Array.isArray(d.content)&&d.content.unshift({type:"text",text:c}):a.messages.unshift({role:"system",content:c})}(h),f))void 0!==h[a]&&delete h[a];if(delete h.system,g=function(a){if("string"!=typeof a||""===a.trim())return null;let b=a.includes("/")?a.split("/").pop():a;return e.get(b)||e.get(b.toLowerCase())||null}(a),(g?.provider==="anthropic"||g?.upstreamProvider==="anthropic"||/(^|[-_/])(?:claude|anthropic)(?:[-_/]|$)/i.test(String(a||"")))&&(delete h.reasoning_effort,delete h.reasoning,delete h.thinking),Array.isArray(h?.messages))for(let a of h.messages)a&&"object"==typeof a&&(delete a.cache_control,Array.isArray(a.content)&&(a.content=a.content.map(a=>{if(!a||"object"!=typeof a)return a;let{cache_control:b,signature:c,...d}=a;return d})));Array.isArray(h?.tools)&&(h.tools=h.tools.map(a=>{if(!a||"object"!=typeof a)return a;let{cache_control:b,...c}=a;return c}));if(Array.isArray(h?.messages))for(let a of h.messages)a&&"assistant"===a.role&&"string"==typeof a.reasoning_content&&a.reasoning_content.length>8&&delete a.reasoning_content;return h}}},38929:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"xai",alias:"xai",category:"oauth",authModes:["oauth","apikey"],hasOAuth:!0,display:{name:"xAI (Grok)",icon:"auto_awesome",color:"#1DA1F2",textIcon:"XA",website:"https://x.ai",notice:{apiKeyUrl:"https://console.x.ai",signupUrl:"https://x.ai"}},models:[{id:"grok-imagine-video",name:"Grok Imagine Video",type:"video",params:["duration","aspect_ratio","resolution"]}],serviceKinds:["llm","imageToText","webSearch","image","video"],imageConfig:{baseUrl:"https://api.x.ai/v1/images/generations",bodyFields:["model","prompt","n","response_format"]},videoConfig:{baseUrl:"https://api.x.ai/v1/videos"},searchViaChat:{defaultModel:"grok-4.20-reasoning",endpoint:"https://api.x.ai/v1/responses",pricingUrl:"https://x.ai/api#pricing"}}},39065:(a,b,c)=>{"use strict";let{PoolStats:d}=c(19071),e=c(5318),f=c(50329),{kConnected:g,kSize:h,kRunning:i,kPending:j,kQueued:k,kBusy:l,kFree:m,kUrl:n,kClose:o,kDestroy:p,kDispatch:q}=c(49176),r=Symbol("clients"),s=Symbol("needDrain"),t=Symbol("queue"),u=Symbol("closed resolve"),v=Symbol("onDrain"),w=Symbol("onConnect"),x=Symbol("onDisconnect"),y=Symbol("onConnectionError"),z=Symbol("get dispatcher"),A=Symbol("has dispatcher"),B=Symbol("add client"),C=Symbol("remove client");class D extends e{[t]=new f;[k]=0;[r]=[];[s]=!1;[v](a,b,c){let d=this[t],e=!1;for(;!e;){let b=d.shift();if(!b)break;this[k]--,e=!a.dispatch(b.opts,b.handler)}if(a[s]=e,!e&&this[s]&&(this[s]=!1,this.emit("drain",b,[this,...c])),this[u]&&d.isEmpty()){let a=[];for(let b=0;b<this[r].length;b++){let c=this[r][b];c.destroyed||a.push(c.close())}return Promise.all(a).then(this[u])}}[w]=(a,b)=>{this.emit("connect",a,[this,...b])};[x]=(a,b,c)=>{this.emit("disconnect",a,[this,...b],c)};[y]=(a,b,c)=>{this.emit("connectionError",a,[this,...b],c)};get[l](){return this[s]}get[g](){let a=0;for(let{[g]:b}of this[r])a+=b;return a}get[m](){let a=0;for(let{[g]:b,[s]:c}of this[r])a+=b&&!c;return a}get[j](){let a=this[k];for(let{[j]:b}of this[r])a+=b;return a}get[i](){let a=0;for(let{[i]:b}of this[r])a+=b;return a}get[h](){let a=this[k];for(let{[h]:b}of this[r])a+=b;return a}get stats(){return new d(this)}[o](){if(!this[t].isEmpty())return new Promise(a=>{this[u]=a});{let a=[];for(let b=0;b<this[r].length;b++){let c=this[r][b];c.destroyed||a.push(c.close())}return Promise.all(a)}}[p](a){for(;;){let b=this[t].shift();if(!b)break;b.handler.onResponseError(null,a)}let b=Array(this[r].length);for(let c=0;c<this[r].length;c++)b[c]=this[r][c].destroy(a);return Promise.all(b)}[q](a,b){let c=this[z]();return c?c.dispatch(a,b)||(c[s]=!0,this[s]=!this[A]()):(this[s]=!0,this[t].push({opts:a,handler:b}),this[k]++),!this[s]}[A](){for(let a=0;a<this[r].length;a++){let b=this[r][a];if(!b[s]&&!0!==b.closed&&!0!==b.destroyed)return!0}return!1}[B](a){return a.on("drain",this[v].bind(this,a)).on("connect",this[w]).on("disconnect",this[x]).on("connectionError",this[y]),this[r].push(a),this[s]&&queueMicrotask(()=>{this[s]&&this[v](a,a[n],[a,this])}),this}[C](a){let b=this[r].indexOf(a);-1!==b&&this[r].splice(b,1),a.close(()=>{}),this[s]=!this[r].some(a=>!a[s]&&!0!==a.closed&&!0!==a.destroyed)}}a.exports={PoolBase:D,kClients:r,kNeedDrain:s,kAddClient:B,kRemoveClient:C,kGetDispatcher:z,kHasDispatcher:A}},39193:(a,b,c)=>{"use strict";c.d(b,{fD:()=>v,rg:()=>u});var d=c(70321);let e=globalThis.__zevaiOptionalServices??={tunnelModule:null,mitmModule:null,autoPingModule:null,watchdogInterval:null,networkMonitorInterval:null,lastNetworkFingerprint:null,lastWatchdogTick:Date.now(),lastOnline:null,tunnelActive:!1,tailscaleActive:!1,mitmActive:!1,headroomActive:!1,headroomSignature:null,autoPingSignature:null,shuttingDown:!1,configuration:Promise.resolve(),shutdownPromise:null};Object.assign(e,{tunnelModule:e.tunnelModule??null,mitmModule:e.mitmModule??null,autoPingModule:e.autoPingModule??null,watchdogInterval:e.watchdogInterval??null,networkMonitorInterval:e.networkMonitorInterval??null,lastNetworkFingerprint:e.lastNetworkFingerprint??null,lastWatchdogTick:e.lastWatchdogTick??Date.now(),lastOnline:e.lastOnline??null,tunnelActive:e.tunnelActive??!1,tailscaleActive:e.tailscaleActive??!1,tunnelExitRecoveryRegistered:e.tunnelExitRecoveryRegistered??!1,mitmActive:e.mitmActive??!1,headroomActive:e.headroomActive??!1,headroomSignature:e.headroomSignature??null,autoPingSignature:e.autoPingSignature??null,shuttingDown:e.shuttingDown??!1,configuration:e.configuration??Promise.resolve(),shutdownPromise:e.shutdownPromise??null});let f=/^(startup|settings|netchange|sleep|sleep\+netchange|online|unexpected-exit)$/;async function g({cloudflare:a=!1,tailscale:b=!1}={}){if(!e.tunnelModule){let[a,b]=await Promise.all([c.e(6200).then(c.bind(c,26200)),c.e(5936).then(c.bind(c,15936))]);e.tunnelModule={...a,...b}}if(a&&!e.tunnelModule.getTunnelService){let[a,b]=await Promise.all([c.e(4322).then(c.bind(c,54322)),c.e(40).then(c.bind(c,40040))]);Object.assign(e.tunnelModule,a,b)}if(b&&!e.tunnelModule.getTailscaleService){let[a,b]=await Promise.all([Promise.all([c.e(1283),c.e(8655)]).then(c.bind(c,98655)),Promise.all([c.e(1283),c.e(5752)]).then(c.bind(c,75752))]);Object.assign(e.tunnelModule,a,b)}return e.tunnelModule}async function h(a){if(e.shuttingDown)return;let b=await g({cloudflare:!0}),c=b.getTunnelService();if(!(!(await (0,d.mt)()).tunnelEnabled||c.cancelToken.cancelled||c.spawnInProgress||b.isCloudflaredRunning()||!f.test(a)&&Date.now()-c.lastRestartAt<b.RESTART_COOLDOWN_MS)&&await b.checkInternet())try{await b.enableTunnel(),c.lastRestartAt=Date.now()}catch(a){/cloudflared killed|tunnel cancelled/.test(a.message)||console.log("[Tunnel] restart failed:",a.message)}}async function i(a){if(e.shuttingDown)return;let b=await g({tailscale:!0}),c=b.getTailscaleService();if(!(!(await (0,d.mt)()).tailscaleEnabled||c.cancelToken.cancelled||c.spawnInProgress||("startup"===a?b.isTailscaleRunningStrict():b.isTailscaleRunning())||!f.test(a)&&Date.now()-c.lastRestartAt<b.RESTART_COOLDOWN_MS)&&await b.checkInternet())try{await b.enableTailscale(),c.lastRestartAt=Date.now()}catch(a){console.log("[Tailscale] restart failed:",a.message)}}function j(a,b){let c=[];for(let[d,e]of Object.entries(a()))if(!(!e||b.test(d)))for(let a of e)a.internal||"IPv4"!==a.family||c.push(`${d}:${a.address}`);return c.sort().join("|")}function k(a){a&&!e.tunnelExitRecoveryRegistered?(e.tunnelModule?.setTunnelUnexpectedExitCallback?.(()=>{h("unexpected-exit")}),e.tunnelExitRecoveryRegistered=!0):!a&&e.tunnelExitRecoveryRegistered&&(e.tunnelModule?.setTunnelUnexpectedExitCallback?.(null),e.tunnelExitRecoveryRegistered=!1)}async function l(){if(e.watchdogInterval||e.networkMonitorInterval)return;let a=await g({cloudflare:e.tunnelActive,tailscale:e.tailscaleActive}),{networkInterfaces:b}=await Promise.resolve().then(c.t.bind(c,48161,23));k(e.tunnelActive),e.watchdogInterval=setInterval(()=>{!e.shuttingDown&&(e.tunnelActive&&h("watchdog"),e.tailscaleActive&&i("watchdog"))},a.WATCHDOG_INTERVAL_MS),e.watchdogInterval.unref?.(),e.lastNetworkFingerprint=j(b,a.VIRTUAL_IFACE_REGEX),e.lastWatchdogTick=Date.now(),e.lastOnline=null,e.networkMonitorInterval=setInterval(async()=>{if(!e.shuttingDown)try{let c=Date.now(),d=c-e.lastWatchdogTick;e.lastWatchdogTick=c;let f=j(b,a.VIRTUAL_IFACE_REGEX),g=f!==e.lastNetworkFingerprint,k=d>6*a.NETWORK_CHECK_INTERVAL_MS;g&&(e.lastNetworkFingerprint=f);let l=await a.checkInternet(),m=!1===e.lastOnline&&l;if(e.lastOnline=l,!l||!g&&!k&&!m)return;await new Promise(b=>setTimeout(b,a.NETWORK_SETTLE_MS));let n=m?"online":k&&g?"sleep+netchange":k?"sleep":"netchange";e.tunnelActive&&h(n),e.tailscaleActive&&i(n)}catch(a){console.log("[NetworkMonitor] error:",a.message)}},a.NETWORK_CHECK_INTERVAL_MS),e.networkMonitorInterval.unref?.()}function m(){e.watchdogInterval&&clearInterval(e.watchdogInterval),e.networkMonitorInterval&&clearInterval(e.networkMonitorInterval),e.watchdogInterval=null,e.networkMonitorInterval=null,k(!1)}async function n(a,b){let c=a?.tunnelEnabled===!0,d=a?.tailscaleEnabled===!0;if(!c&&!d&&!e.tunnelActive&&!e.tailscaleActive&&!e.tunnelModule)return;let f=await g({cloudflare:c||e.tunnelActive,tailscale:d||e.tailscaleActive});e.tunnelActive&&!c&&await f.disableTunnel?.(),e.tailscaleActive&&!d&&await f.disableTailscale?.();let j=c&&!e.tunnelActive,n=d&&!e.tailscaleActive;e.tunnelActive=e.tunnelActive&&c,e.tailscaleActive=e.tailscaleActive&&d,j&&(await f.ensureCloudflared(),e.tunnelActive=!0),n&&(e.tailscaleActive=!0),c||d?await l():m(),k(c),j&&h(b),n&&i(b)}async function o(a){if(!process.env.MITM_SERVER_PATH)try{let[{fileURLToPath:a},{existsSync:b}]=await Promise.all([Promise.resolve().then(c.t.bind(c,73136,23)),Promise.resolve().then(c.t.bind(c,73024,23))]),d=a(new c.U(c(51705)));b(d)&&(process.env.MITM_SERVER_PATH=d)}catch{}a.initDbHooks(d.mt,d.Xx)}async function p(){let a=e.mitmModule??=await Promise.all([c.e(5019),c.e(1283),c.e(3721)]).then(c.t.bind(c,3721,23));await o(a);let b=await c.e(6951).then(c.bind(c,6951));if(await b.syncToJson(),(await a.getMitmStatus()).running)return!0;let f=await a.loadEncryptedPassword();if(!f&&"win32"!==process.platform)return console.log("[InitApp] MITM enabled without a saved password; auto-start skipped"),!1;let g=(await (0,d.PX)(!0)).find(a=>!1!==a.isActive);return await a.startMitm(g?.key||"sk_zevai",f),await a.restoreToolDNS(f),!0}async function q(a){let b=a?.mitmEnabled===!0;if(b||e.mitmModule)if(b&&!e.mitmActive)try{e.mitmActive=await p()}catch(a){e.mitmActive=!1,console.log("[InitApp] MITM auto-start failed:",a.message)}else!b&&e.mitmActive&&(e.mitmActive=!1,await e.mitmModule.stopMitm?.())}async function r(a){let b=a?.headroomEnabled===!0,d=b?JSON.stringify([a?.headroomUrl||"",a?.headroomCodeAware===!0,a?.headroomKompress!==!1]):null;if(b&&(!e.headroomActive||e.headroomSignature!==d))try{let{ensureHeadroomAvailable:b}=await c.e(3926).then(c.bind(c,63926));await b(a),e.headroomActive=!0,e.headroomSignature=d}catch(a){e.headroomActive=!1,e.headroomSignature=null,console.log("[InitApp] Headroom auto-start failed:",a.message)}else if(!b&&e.headroomActive){e.headroomActive=!1,e.headroomSignature=null;let{stopHeadroomProxy:a}=await c.e(6843).then(c.bind(c,96843));a()}}async function s(a){let b=[a?.claudeAutoPing,a?.codexAutoPing].some(a=>Object.values(a?.connections||{}).some(Boolean)),d=JSON.stringify([a?.claudeAutoPing?.connections||{},a?.codexAutoPing?.connections||{}]);if(d!==e.autoPingSignature){if(!b&&!e.autoPingModule){e.autoPingSignature=d;return}e.autoPingModule??=await c.e(3792).then(c.bind(c,73792)),e.autoPingModule.configureQuotaAutoPing(a),e.autoPingSignature=d}}async function t(a,b){await n(a,b),await q(a),await r(a),await s(a)}function u(a,b="settings"){return e.shuttingDown?e.shutdownPromise??Promise.resolve():(e.configuration=e.configuration.catch(()=>{}).then(()=>t(a,b)),e.configuration)}function v(){return e.shutdownPromise||(e.shuttingDown=!0,e.shutdownPromise=(async()=>{if(await e.configuration.catch(()=>{}),m(),e.autoPingModule?.stopQuotaAutoPing?.(),e.headroomActive){let{stopHeadroomProxy:a}=await c.e(6843).then(c.bind(c,96843));a()}e.mitmActive?await e.mitmModule?.stopMitm?.(void 0,{preserveEnabled:!0}):e.mitmModule?.removeAllDNSEntriesSync?.(),e.tunnelModule?.killCloudflared?.(),e.tunnelActive=!1,e.tailscaleActive=!1,e.mitmActive=!1,e.headroomActive=!1,e.headroomSignature=null,e.autoPingSignature=null})()),e.shutdownPromise}},39817:(a,b,c)=>{"use strict";function d(a){return a?.provider==="codebuddy"||a?.provider==="codebuddy-cn"}function e(a,b){if(!d(b))return a;let c=b?.provider!=="codebuddy-cn"?null:b.providerSpecificData?.codebuddyRuntimeRejectedAt||null,e=d(b)&&b.providerSpecificData?.codebuddyRuntimeExhaustedAt||null;if(!c&&!e)return a;let f=a?.billingQuotas||a?.quotas||{};if(c)return{...a||{},message:"CodeBuddy CN chat API rejected this credential (11140); billing package balance is nominal and does not prove chat access.",billingQuotas:f,runtimeStatus:"credential_rejected",chatUsable:!1,runtimeRejectedAt:c,runtimeRejectedCode:Number(b.providerSpecificData?.codebuddyRuntimeRejectedCode)||11140};let g=Object.fromEntries(Object.entries(f).map(([a,b])=>{let c=Number(b?.total);return[a,{...b||{},...Number.isFinite(c)?{used:c}:{},remaining:0,remainingPercentage:0}]}));return{...a||{},message:"CodeBuddy chat API reported exhausted credits (14018); billing package balance is nominal until a chat request succeeds.",billingQuotas:f,quotas:g,runtimeStatus:"exhausted",chatUsable:!1,runtimeExhausted:!0,runtimeExhaustedAt:e,runtimeExhaustedCode:14018}}c.d(b,{pX:()=>e})},39852:function(a,b,c){a.exports=function(a,b){var d=[function(a,b,c){a.exports=c(34)},function(a,b,c){var d=c(29)("wks"),e=c(33),f=c(2).Symbol,g="function"==typeof f;(a.exports=function(a){return d[a]||(d[a]=g&&f[a]||(g?f:e)("Symbol."+a))}).store=d},function(a,b){var c=a.exports="u">typeof window&&window.Math==Math?window:"u">typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=c)},function(a,b,c){var d=c(9);a.exports=function(a){if(!d(a))throw TypeError(a+" is not an object!");return a}},function(a,b,c){a.exports=!c(24)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(a,b,c){var d=c(12),e=c(17);a.exports=c(4)?function(a,b,c){return d.f(a,b,e(1,c))}:function(a,b,c){return a[b]=c,a}},function(a,b){var c=a.exports={version:"2.4.0"};"number"==typeof __e&&(__e=c)},function(a,b,c){var d=c(14);a.exports=function(a,b,c){if(d(a),void 0===b)return a;switch(c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}}},function(a,b){var c={}.hasOwnProperty;a.exports=function(a,b){return c.call(a,b)}},function(a,b){a.exports=function(a){return"object"==typeof a?null!==a:"function"==typeof a}},function(a,b){a.exports={}},function(a,b){var c={}.toString;a.exports=function(a){return c.call(a).slice(8,-1)}},function(a,b,c){var d=c(3),e=c(26),f=c(32),g=Object.defineProperty;b.f=c(4)?Object.defineProperty:function(a,b,c){if(d(a),b=f(b,!0),d(c),e)try{return g(a,b,c)}catch(a){}if("get"in c||"set"in c)throw TypeError("Accessors not supported!");return"value"in c&&(a[b]=c.value),a}},function(a,b,c){var d=c(42),e=c(15);a.exports=function(a){return d(e(a))}},function(a,b){a.exports=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function!");return a}},function(a,b){a.exports=function(a){if(void 0==a)throw TypeError("Can't call method on "+a);return a}},function(a,b,c){var d=c(9),e=c(2).document,f=d(e)&&d(e.createElement);a.exports=function(a){return f?e.createElement(a):{}}},function(a,b){a.exports=function(a,b){return{enumerable:!(1&a),configurable:!(2&a),writable:!(4&a),value:b}}},function(a,b,c){var d=c(12).f,e=c(8),f=c(1)("toStringTag");a.exports=function(a,b,c){a&&!e(a=c?a:a.prototype,f)&&d(a,f,{configurable:!0,value:b})}},function(a,b,c){var d=c(29)("keys"),e=c(33);a.exports=function(a){return d[a]||(d[a]=e(a))}},function(a,b){var c=Math.ceil,d=Math.floor;a.exports=function(a){return isNaN(a*=1)?0:(a>0?d:c)(a)}},function(a,b,c){var d=c(11),e=c(1)("toStringTag"),f="Arguments"==d(function(){return arguments}()),g=function(a,b){try{return a[b]}catch(a){}};a.exports=function(a){var b,c,h;return void 0===a?"Undefined":null===a?"Null":"string"==typeof(c=g(b=Object(a),e))?c:f?d(b):"Object"==(h=d(b))&&"function"==typeof b.callee?"Arguments":h}},function(a,b){a.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(a,b,c){var d=c(2),e=c(6),f=c(7),g=c(5),h="prototype",i=function(a,b,c){var j,k,l,m=a&i.F,n=a&i.G,o=a&i.S,p=a&i.P,q=a&i.B,r=a&i.W,s=n?e:e[b]||(e[b]={}),t=s[h],u=n?d:o?d[b]:(d[b]||{})[h];for(j in n&&(c=b),c)(k=!m&&u&&void 0!==u[j])&&j in s||(l=k?u[j]:c[j],s[j]=n&&"function"!=typeof u[j]?c[j]:q&&k?f(l,d):r&&u[j]==l?function(a){var b=function(b,c,d){if(this instanceof a){switch(arguments.length){case 0:return new a;case 1:return new a(b);case 2:return new a(b,c)}return new a(b,c,d)}return a.apply(this,arguments)};return b[h]=a[h],b}(l):p&&"function"==typeof l?f(Function.call,l):l,p&&((s.virtual||(s.virtual={}))[j]=l,a&i.R&&t&&!t[j]&&g(t,j,l)))};i.F=1,i.G=2,i.S=4,i.P=8,i.B=16,i.W=32,i.U=64,i.R=128,a.exports=i},function(a,b){a.exports=function(a){try{return!!a()}catch(a){return!0}}},function(a,b,c){a.exports=c(2).document&&document.documentElement},function(a,b,c){a.exports=!c(4)&&!c(24)(function(){return 7!=Object.defineProperty(c(16)("div"),"a",{get:function(){return 7}}).a})},function(a,b,c){"use strict";var d=c(28),e=c(23),f=c(57),g=c(5),h=c(8),i=c(10),j=c(45),k=c(18),l=c(52),m=c(1)("iterator"),n=!([].keys&&"next"in[].keys()),o="keys",p="values",q=function(){return this};a.exports=function(a,b,c,r,s,t,u){j(c,b,r);var v,w,x,y=function(a){if(!n&&a in C)return C[a];switch(a){case o:case p:return function(){return new c(this,a)}}return function(){return new c(this,a)}},z=b+" Iterator",A=s==p,B=!1,C=a.prototype,D=C[m]||C["@@iterator"]||s&&C[s],E=D||y(s),F=s?A?y("entries"):E:void 0,G="Array"==b&&C.entries||D;if(G&&(x=l(G.call(new a)))!==Object.prototype&&(k(x,z,!0),d||h(x,m)||g(x,m,q)),A&&D&&D.name!==p&&(B=!0,E=function(){return D.call(this)}),(!d||u)&&(n||B||!C[m])&&g(C,m,E),i[b]=E,i[z]=q,s)if(v={values:A?E:y(p),keys:t?E:y(o),entries:F},u)for(w in v)w in C||f(C,w,v[w]);else e(e.P+e.F*(n||B),b,v);return v}},function(a,b){a.exports=!0},function(a,b,c){var d=c(2),e="__core-js_shared__",f=d[e]||(d[e]={});a.exports=function(a){return f[a]||(f[a]={})}},function(a,b,c){var d,e,f,g=c(7),h=c(41),i=c(25),j=c(16),k=c(2),l=k.process,m=k.setImmediate,n=k.clearImmediate,o=k.MessageChannel,p=0,q={},r="onreadystatechange",s=function(){var a=+this;if(q.hasOwnProperty(a)){var b=q[a];delete q[a],b()}},t=function(a){s.call(a.data)};m&&n||(m=function(a){for(var b=[],c=1;arguments.length>c;)b.push(arguments[c++]);return q[++p]=function(){h("function"==typeof a?a:Function(a),b)},d(p),p},n=function(a){delete q[a]},"process"==c(11)(l)?d=function(a){l.nextTick(g(s,a,1))}:o?(f=(e=new o).port2,e.port1.onmessage=t,d=g(f.postMessage,f,1)):k.addEventListener&&"function"==typeof postMessage&&!k.importScripts?(d=function(a){k.postMessage(a+"","*")},k.addEventListener("message",t,!1)):d=r in j("script")?function(a){i.appendChild(j("script"))[r]=function(){i.removeChild(this),s.call(a)}}:function(a){setTimeout(g(s,a,1),0)}),a.exports={set:m,clear:n}},function(a,b,c){var d=c(20),e=Math.min;a.exports=function(a){return a>0?e(d(a),0x1fffffffffffff):0}},function(a,b,c){var d=c(9);a.exports=function(a,b){var c,e;if(!d(a))return a;if(b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a))||"function"==typeof(c=a.valueOf)&&!d(e=c.call(a))||!b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;throw TypeError("Can't convert object to primitive value")}},function(a,b){var c=0,d=Math.random();a.exports=function(a){return"Symbol(".concat(void 0===a?"":a,")_",(++c+d).toString(36))}},function(a,b,c){"use strict";function d(a){return(0,i.createHash)("sha256").update(a).digest("hex")}function e(a){switch(j){case"darwin":return a.split("IOPlatformUUID")[1].split("\n")[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return a.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":case"freebsd":return a.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw Error("Unsupported platform: "+process.platform)}}Object.defineProperty(b,"__esModule",{value:!0});var f,g=(f=c(35))&&f.__esModule?f:{default:f};b.machineIdSync=function(a){var b=e((0,h.execSync)(k[j]).toString());return a?b:d(b)},b.machineId=function(a){return new g.default(function(b,c){return(0,h.exec)(k[j],{},function(f,g,h){if(f)return c(Error("Error while obtaining machine id: "+f.stack));var i=e(g.toString());return b(a?i:d(i))})})};var h=c(70),i=c(71),j=process.platform,k={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:{native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"}["win32"!==process.platform?"":"ia32"===process.arch&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(a,b,c){a.exports={default:c(36),__esModule:!0}},function(a,b,c){c(66),c(68),c(69),c(67),a.exports=c(6).Promise},function(a,b){a.exports=function(){}},function(a,b){a.exports=function(a,b,c,d){if(!(a instanceof b)||void 0!==d&&d in a)throw TypeError(c+": incorrect invocation!");return a}},function(a,b,c){var d=c(13),e=c(31),f=c(62);a.exports=function(a){return function(b,c,g){var h,i=d(b),j=e(i.length),k=f(g,j);if(a&&c!=c){for(;j>k;)if((h=i[k++])!=h)return!0}else for(;j>k;k++)if((a||k in i)&&i[k]===c)return a||k||0;return!a&&-1}}},function(a,b,c){var d=c(7),e=c(44),f=c(43),g=c(3),h=c(31),i=c(64),j={},k={},b=a.exports=function(a,b,c,l,m){var n,o,p,q,r=m?function(){return a}:i(a),s=d(c,l,b?2:1),t=0;if("function"!=typeof r)throw TypeError(a+" is not iterable!");if(f(r)){for(n=h(a.length);n>t;t++)if((q=b?s(g(o=a[t])[0],o[1]):s(a[t]))===j||q===k)return q}else for(p=r.call(a);!(o=p.next()).done;)if((q=e(p,s,o.value,b))===j||q===k)return q};b.BREAK=j,b.RETURN=k},function(a,b){a.exports=function(a,b,c){var d=void 0===c;switch(b.length){case 0:return d?a():a.call(c);case 1:return d?a(b[0]):a.call(c,b[0]);case 2:return d?a(b[0],b[1]):a.call(c,b[0],b[1]);case 3:return d?a(b[0],b[1],b[2]):a.call(c,b[0],b[1],b[2]);case 4:return d?a(b[0],b[1],b[2],b[3]):a.call(c,b[0],b[1],b[2],b[3])}return a.apply(c,b)}},function(a,b,c){var d=c(11);a.exports=Object("z").propertyIsEnumerable(0)?Object:function(a){return"String"==d(a)?a.split(""):Object(a)}},function(a,b,c){var d=c(10),e=c(1)("iterator"),f=Array.prototype;a.exports=function(a){return void 0!==a&&(d.Array===a||f[e]===a)}},function(a,b,c){var d=c(3);a.exports=function(a,b,c,e){try{return e?b(d(c)[0],c[1]):b(c)}catch(b){var f=a.return;throw void 0!==f&&d(f.call(a)),b}}},function(a,b,c){"use strict";var d=c(49),e=c(17),f=c(18),g={};c(5)(g,c(1)("iterator"),function(){return this}),a.exports=function(a,b,c){a.prototype=d(g,{next:e(1,c)}),f(a,b+" Iterator")}},function(a,b,c){var d=c(1)("iterator"),e=!1;try{var f=[7][d]();f.return=function(){e=!0},Array.from(f,function(){throw 2})}catch(a){}a.exports=function(a,b){if(!b&&!e)return!1;var c=!1;try{var f=[7],g=f[d]();g.next=function(){return{done:c=!0}},f[d]=function(){return g},a(f)}catch(a){}return c}},function(a,b){a.exports=function(a,b){return{value:b,done:!!a}}},function(a,b,c){var d=c(2),e=c(30).set,f=d.MutationObserver||d.WebKitMutationObserver,g=d.process,h=d.Promise,i="process"==c(11)(g);a.exports=function(){var a,b,c,j=function(){var d,e;for(i&&(d=g.domain)&&d.exit();a;){e=a.fn,a=a.next;try{e()}catch(d){throw a?c():b=void 0,d}}b=void 0,d&&d.enter()};if(i)c=function(){g.nextTick(j)};else if(f){var k=!0,l=document.createTextNode("");new f(j).observe(l,{characterData:!0}),c=function(){l.data=k=!k}}else if(h&&h.resolve){var m=h.resolve();c=function(){m.then(j)}}else c=function(){e.call(d,j)};return function(d){var e={fn:d,next:void 0};b&&(b.next=e),a||(a=e,c()),b=e}}},function(a,b,c){var d=c(3),e=c(50),f=c(22),g=c(19)("IE_PROTO"),h=function(){},i="prototype",j=function(){var a,b=c(16)("iframe"),d=f.length;for(b.style.display="none",c(25).appendChild(b),b.src="javascript:",(a=b.contentWindow.document).open(),a.write("<script>document.F=Object<\/script>"),a.close(),j=a.F;d--;)delete j[i][f[d]];return j()};a.exports=Object.create||function(a,b){var c;return null!==a?(h[i]=d(a),c=new h,h[i]=null,c[g]=a):c=j(),void 0===b?c:e(c,b)}},function(a,b,c){var d=c(12),e=c(3),f=c(54);a.exports=c(4)?Object.defineProperties:function(a,b){e(a);for(var c,g=f(b),h=g.length,i=0;h>i;)d.f(a,c=g[i++],b[c]);return a}},function(a,b,c){var d=c(55),e=c(17),f=c(13),g=c(32),h=c(8),i=c(26),j=Object.getOwnPropertyDescriptor;b.f=c(4)?j:function(a,b){if(a=f(a),b=g(b,!0),i)try{return j(a,b)}catch(a){}if(h(a,b))return e(!d.f.call(a,b),a[b])}},function(a,b,c){var d=c(8),e=c(63),f=c(19)("IE_PROTO"),g=Object.prototype;a.exports=Object.getPrototypeOf||function(a){return d(a=e(a),f)?a[f]:"function"==typeof a.constructor&&a instanceof a.constructor?a.constructor.prototype:a instanceof Object?g:null}},function(a,b,c){var d=c(8),e=c(13),f=c(39)(!1),g=c(19)("IE_PROTO");a.exports=function(a,b){var c,h=e(a),i=0,j=[];for(c in h)c!=g&&d(h,c)&&j.push(c);for(;b.length>i;)d(h,c=b[i++])&&(~f(j,c)||j.push(c));return j}},function(a,b,c){var d=c(53),e=c(22);a.exports=Object.keys||function(a){return d(a,e)}},function(a,b){b.f=({}).propertyIsEnumerable},function(a,b,c){var d=c(5);a.exports=function(a,b,c){for(var e in b)c&&a[e]?a[e]=b[e]:d(a,e,b[e]);return a}},function(a,b,c){a.exports=c(5)},function(a,b,c){var d=c(9),e=c(3),f=function(a,b){if(e(a),!d(b)&&null!==b)throw TypeError(b+": can't set as prototype!")};a.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(a,b,d){try{(d=c(7)(Function.call,c(51).f(Object.prototype,"__proto__").set,2))(a,[]),b=!(a instanceof Array)}catch(a){b=!0}return function(a,c){return f(a,c),b?a.__proto__=c:d(a,c),a}}({},!1):void 0),check:f}},function(a,b,c){"use strict";var d=c(2),e=c(6),f=c(12),g=c(4),h=c(1)("species");a.exports=function(a){var b="function"==typeof e[a]?e[a]:d[a];g&&b&&!b[h]&&f.f(b,h,{configurable:!0,get:function(){return this}})}},function(a,b,c){var d=c(3),e=c(14),f=c(1)("species");a.exports=function(a,b){var c,g=d(a).constructor;return void 0===g||void 0==(c=d(g)[f])?b:e(c)}},function(a,b,c){var d=c(20),e=c(15);a.exports=function(a){return function(b,c){var f,g,h=String(e(b)),i=d(c),j=h.length;return i<0||i>=j?a?"":void 0:(f=h.charCodeAt(i))<55296||f>56319||i+1===j||(g=h.charCodeAt(i+1))<56320||g>57343?a?h.charAt(i):f:a?h.slice(i,i+2):(f-55296<<10)+(g-56320)+65536}}},function(a,b,c){var d=c(20),e=Math.max,f=Math.min;a.exports=function(a,b){return(a=d(a))<0?e(a+b,0):f(a,b)}},function(a,b,c){var d=c(15);a.exports=function(a){return Object(d(a))}},function(a,b,c){var d=c(21),e=c(1)("iterator"),f=c(10);a.exports=c(6).getIteratorMethod=function(a){if(void 0!=a)return a[e]||a["@@iterator"]||f[d(a)]}},function(a,b,c){"use strict";var d=c(37),e=c(47),f=c(10),g=c(13);a.exports=c(27)(Array,"Array",function(a,b){this._t=g(a),this._i=0,this._k=b},function(){var a=this._t,b=this._k,c=this._i++;return!a||c>=a.length?(this._t=void 0,e(1)):"keys"==b?e(0,c):"values"==b?e(0,a[c]):e(0,[c,a[c]])},"values"),f.Arguments=f.Array,d("keys"),d("values"),d("entries")},function(a,b){},function(a,b,c){"use strict";var d,e,f,g=c(28),h=c(2),i=c(7),j=c(21),k=c(23),l=c(9),m=(c(3),c(14)),n=c(38),o=c(40),p=(c(58).set,c(60)),q=c(30).set,r=c(48)(),s="Promise",t=h.TypeError,u=h.process,v=h[s],u=h.process,w="process"==j(u),x=function(){},y=!!function(){try{var a=v.resolve(1),b=(a.constructor={})[c(1)("species")]=function(a){a(x,x)};return(w||"function"==typeof PromiseRejectionEvent)&&a.then(x)instanceof b}catch(a){}}(),z=function(a,b){return a===b||a===v&&b===f},A=function(a){var b;return!(!l(a)||"function"!=typeof(b=a.then))&&b},B=function(a){return z(v,a)?new C(a):new e(a)},C=e=function(a){var b,c;this.promise=new a(function(a,d){if(void 0!==b||void 0!==c)throw t("Bad Promise constructor");b=a,c=d}),this.resolve=m(b),this.reject=m(c)},D=function(a){try{a()}catch(a){return{error:a}}},E=function(a,b){if(!a._n){a._n=!0;var c=a._c;r(function(){for(var d=a._v,e=1==a._s,f=0;c.length>f;)!function(b){var c,f,g=e?b.ok:b.fail,h=b.resolve,i=b.reject,j=b.domain;try{g?(e||(2==a._h&&H(a),a._h=1),!0===g?c=d:(j&&j.enter(),c=g(d),j&&j.exit()),c===b.promise?i(t("Promise-chain cycle")):(f=A(c))?f.call(c,h,i):h(c)):i(d)}catch(a){i(a)}}(c[f++]);a._c=[],a._n=!1,b&&!a._h&&F(a)})}},F=function(a){q.call(h,function(){var b,c,d,e=a._v;if(G(a)&&(b=D(function(){w?u.emit("unhandledRejection",e,a):(c=h.onunhandledrejection)?c({promise:a,reason:e}):(d=h.console)&&d.error&&d.error("Unhandled promise rejection",e)}),a._h=w||G(a)?2:1),a._a=void 0,b)throw b.error})},G=function(a){if(1==a._h)return!1;for(var b,c=a._a||a._c,d=0;c.length>d;)if((b=c[d++]).fail||!G(b.promise))return!1;return!0},H=function(a){q.call(h,function(){var b;w?u.emit("rejectionHandled",a):(b=h.onrejectionhandled)&&b({promise:a,reason:a._v})})},I=function(a){var b=this;b._d||(b._d=!0,(b=b._w||b)._v=a,b._s=2,b._a||(b._a=b._c.slice()),E(b,!0))},J=function(a){var b,c=this;if(!c._d){c._d=!0,c=c._w||c;try{if(c===a)throw t("Promise can't be resolved itself");(b=A(a))?r(function(){var d={_w:c,_d:!1};try{b.call(a,i(J,d,1),i(I,d,1))}catch(a){I.call(d,a)}}):(c._v=a,c._s=1,E(c,!1))}catch(a){I.call({_w:c,_d:!1},a)}}};y||(v=function(a){n(this,v,s,"_h"),m(a),d.call(this);try{a(i(J,this,1),i(I,this,1))}catch(a){I.call(this,a)}},(d=function(a){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=c(56)(v.prototype,{then:function(a,b){var c=B(p(this,v));return c.ok="function"!=typeof a||a,c.fail="function"==typeof b&&b,c.domain=w?u.domain:void 0,this._c.push(c),this._a&&this._a.push(c),this._s&&E(this,!1),c.promise},catch:function(a){return this.then(void 0,a)}}),C=function(){var a=new d;this.promise=a,this.resolve=i(J,a,1),this.reject=i(I,a,1)}),k(k.G+k.W+!y*k.F,{Promise:v}),c(18)(v,s),c(59)(s),f=c(6)[s],k(k.S+!y*k.F,s,{reject:function(a){var b=B(this);return(0,b.reject)(a),b.promise}}),k(k.S+k.F*(g||!y),s,{resolve:function(a){if(a instanceof v&&z(a.constructor,this))return a;var b=B(this);return(0,b.resolve)(a),b.promise}}),k(k.S+!(y&&c(46)(function(a){v.all(a).catch(x)}))*k.F,s,{all:function(a){var b=this,c=B(b),d=c.resolve,e=c.reject,f=D(function(){var c=[],f=0,g=1;o(a,!1,function(a){var h=f++,i=!1;c.push(void 0),g++,b.resolve(a).then(function(a){i||(i=!0,c[h]=a,--g||d(c))},e)}),--g||d(c)});return f&&e(f.error),c.promise},race:function(a){var b=this,c=B(b),d=c.reject,e=D(function(){o(a,!1,function(a){b.resolve(a).then(c.resolve,d)})});return e&&d(e.error),c.promise}})},function(a,b,c){"use strict";var d=c(61)(!0);c(27)(String,"String",function(a){this._t=String(a),this._i=0},function(){var a,b=this._t,c=this._i;return c>=b.length?{value:void 0,done:!0}:(a=d(b,c),this._i+=a.length,{value:a,done:!1})})},function(a,b,c){c(65);for(var d=c(2),e=c(5),f=c(10),g=c(1)("toStringTag"),h=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],i=0;i<5;i++){var j=h[i],k=d[j],l=k&&k.prototype;l&&!l[g]&&e(l,g,j),f[j]=f.Array}},function(a,b){a.exports=c(79646)},function(a,b){a.exports=c(55511)}];function e(a){if(f[a])return f[a].exports;var b=f[a]={exports:{},id:a,loaded:!1};return d[a].call(b.exports,b,b.exports,e),b.loaded=!0,b.exports}var f={};return e.m=d,e.c=f,e.p="",e(0)}(c(79646),c(55511))},40106:(a,b,c)=>{"use strict";let d=c(34589),e=c(77030),f=c(37067),g=c(84285),{ClientStats:h}=c(19071),{channels:i}=c(62571),j=c(76316),k=c(5318),{InvalidArgumentError:l,InformationalError:m,ClientDestroyedError:n}=c(61448),o=c(55285),{kUrl:p,kServerName:q,kClient:r,kBusy:s,kConnect:t,kResuming:u,kRunning:v,kPending:w,kSize:x,kQueue:y,kConnected:z,kConnecting:A,kNeedDrain:B,kKeepAliveDefaultTimeout:C,kHostHeader:D,kPendingIdx:E,kRunningIdx:F,kError:G,kPipelining:H,kKeepAliveTimeoutValue:I,kMaxHeadersSize:J,kKeepAliveMaxTimeout:K,kKeepAliveTimeoutThreshold:L,kHeadersTimeout:M,kBodyTimeout:N,kStrictContentLength:O,kConnector:P,kMaxRequests:Q,kCounter:R,kClose:S,kDestroy:T,kDispatch:U,kLocalAddress:V,kMaxResponseSize:W,kOnError:X,kHTTPContext:Y,kMaxConcurrentStreams:Z,kHostAuthority:$,kResume:_,kHTTP2Options:aa}=c(49176),ab=c(97678),ac=c(80985),ad=Symbol("kClosedResolve"),ae=f&&f.maxHeaderSize&&Number.isInteger(f.maxHeaderSize)&&f.maxHeaderSize>0?()=>f.maxHeaderSize:()=>{throw new l("http module not available or http.maxHeaderSize invalid")},af=()=>{},ag=!1;function ah(a){!0!==ag&&(process.emitWarning(`Use h2Options.${a} instead. ${a} for H2 will be deprecated in future major.`,{code:"UNDICI-H2-OPTIONS"}),ag=!0)}function ai(a){return a[Y]?.version==="h2"?a[Z]:a[H]??a[Y]?.defaultPipelining??1}class aj extends k{constructor(a,{maxHeaderSize:b,headersTimeout:c,socketTimeout:d,requestTimeout:f,connectTimeout:h,bodyTimeout:i,idleTimeout:j,keepAlive:k,keepAliveTimeout:m,maxKeepAliveTimeout:n,keepAliveMaxTimeout:r,keepAliveTimeoutThreshold:s,socketPath:t,pipelining:v,tls:w,strictContentLength:x,maxCachedSessions:z,connect:A,maxRequestsPerClient:G,localAddress:R,maxResponseSize:S,autoSelectFamily:T,autoSelectFamilyAttemptTimeout:U,maxConcurrentStreams:Z,allowH2:ab,useH2c:ac,initialWindowSize:af,connectionWindowSize:ag,pingInterval:ai,webSocket:aj,h2Options:al}={}){if(void 0!==k)throw new l("unsupported keepAlive, use pipelining=0 instead");if(void 0!==d)throw new l("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(void 0!==f)throw new l("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(void 0!==j)throw new l("unsupported idleTimeout, use keepAliveTimeout instead");if(void 0!==n)throw new l("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(null!=b){if(!Number.isInteger(b)||b<1)throw new l("invalid maxHeaderSize")}else b=ae();if(null!=t&&"string"!=typeof t)throw new l("invalid socketPath");if(null!=h&&(!Number.isFinite(h)||h<0))throw new l("invalid connectTimeout");if(null!=m&&(!Number.isFinite(m)||m<=0))throw new l("invalid keepAliveTimeout");if(null!=r&&(!Number.isFinite(r)||r<=0))throw new l("invalid keepAliveMaxTimeout");if(null!=s&&!Number.isFinite(s))throw new l("invalid keepAliveTimeoutThreshold");if(null!=c&&(!Number.isInteger(c)||c<0))throw new l("headersTimeout must be a positive integer or zero");if(null!=i&&(!Number.isInteger(i)||i<0))throw new l("bodyTimeout must be a positive integer or zero");if(null!=A&&"function"!=typeof A&&"object"!=typeof A)throw new l("connect must be a function or an object");if(null!=G&&(!Number.isInteger(G)||G<0))throw new l("maxRequestsPerClient must be a positive number");if(null!=R&&("string"!=typeof R||0===e.isIP(R)))throw new l("localAddress must be valid string IP address");if(null!=S&&(!Number.isInteger(S)||S<-1))throw new l("maxResponseSize must be a positive number");if(null!=U&&(!Number.isInteger(U)||U<-1))throw new l("autoSelectFamilyAttemptTimeout must be a positive number");if(null!=ab&&"boolean"!=typeof ab)throw new l("allowH2 must be a valid boolean value");if(!1!==ab)if(null!=al){if(null!=al.useH2c&&"boolean"!=typeof al.useH2c)throw new l("h2Options.useH2c must be a valid boolean value");if(al.settings?.initialWindowSize!=null&&(!Number.isInteger(al.settings.initialWindowSize)||al.settings.initialWindowSize<1))throw new l("h2Options.settings.initialWindowSize must be a positive integer, greater than 0");if(null!=al.maxConcurrentStreams&&(!Number.isInteger(al.connectionWindowSize)||al.maxConcurrentStreams<1))throw new l("h2Options.maxConcurrentStreams must be a positive integer, greater than 0");if(null!=al.connectionWindowSize&&(!Number.isInteger(al.connectionWindowSize)||al.connectionWindowSize<1))throw new l("h2Options.connectionWindowSize must be a positive integer, greater than 0");if(null!=al.pingInterval&&("number"!=typeof al.pingInterval||!Number.isInteger(al.pingInterval)||al.pingInterval<0))throw new l("h2Options.pingInterval must be a positive integer, greater or equal to 0")}else{if(null!=ac&&"boolean"!=typeof ac)throw ah("useH2c"),new l("useH2c must be a valid boolean value");if(null!=Z&&("number"!=typeof Z||Z<1))throw ah("maxConcurrentStreams"),new l("maxConcurrentStreams must be a positive integer, greater than 0");if(null!=af&&(!Number.isInteger(af)||af<1))throw ah("initialWindowSize"),new l("initialWindowSize must be a positive integer, greater than 0");if(null!=ag&&(!Number.isInteger(ag)||ag<1))throw ah("connectionWindowSize"),new l("connectionWindowSize must be a positive integer, greater than 0");if(null!=ai&&("number"!=typeof ai||!Number.isInteger(ai)||ai<0))throw ah("pingInterval"),new l("pingInterval must be a positive integer, greater or equal to 0")}if(super({webSocket:aj}),"function"!=typeof A)A=o({...w,maxCachedSessions:z,allowH2:ab,socketPath:t,useH2c:al?.useH2c??ac,timeout:h,..."boolean"==typeof T?{autoSelectFamily:T,autoSelectFamilyAttemptTimeout:U}:void 0,...A});else{const a=A;A=(b,c)=>a({...b,...null!=t?{socketPath:t}:null,...null!=ab?{allowH2:ab}:null},c)}this[p]=g.parseOrigin(a),this[$]=`${this[p].hostname}${this[p].port?`:${this[p].port}`:""}`,this[P]=A,this[H]=null!=v?v:1,this[J]=b,this[C]=null==m?4e3:m,this[K]=null==r?6e5:r,this[L]=null==s?2e3:s,this[I]=this[C],this[q]=null,this[V]=null!=R?R:null,this[u]=0,this[B]=0,this[D]=`host: ${this[$]}\r
288
294
  `,this[N]=null!=i?i:3e5,this[M]=null!=c?c:3e5,this[O]=null==x||x,this[Q]=G,this[ad]=null,this[W]=S>-1?S:-1,this[Y]=null,this[aa]={pingInterval:al?.pingInterval??ai??6e4,connectionWindowSize:al?.connectionWindowSize??ag??524288,maxConcurrentStreams:al?.maxConcurrentStreams??Z??100,sessionOptions:{initialWindowSize:al?.initialWindowSize??af??262144}},this[y]=[],this[F]=0,this[E]=0,this[_]=a=>ao(this,a),this[X]=a=>ak(this,a)}get pipelining(){return this[H]}set pipelining(a){this[H]=a,this[_](!0)}get stats(){return new h(this)}get[w](){return this[y].length-this[E]}get[v](){return this[E]-this[F]}get[x](){return this[y].length-this[F]}get[z](){return!!this[Y]&&!this[A]&&!this[Y].destroyed}get[s](){let a=this[Y]?.version==="h2";return!!(this[Y]?.busy(null)||this[x]>=(ai(this)||1)||this[w]>0&&!a)}[t](a){al(this),this.once("connect",a)}[U](a,b){let c=new j(this[p].origin,a,b);return this[y].push(c),this[u]||(null==g.bodyLength(c.body)&&g.isIterable(c.body)?(this[u]=1,queueMicrotask(()=>ao(this))):this[_](!0)),this[u]&&2!==this[B]&&this[s]&&(this[B]=2),this[B]<2}[S](){return new Promise(a=>{this[x]?this[ad]=a:a(null)})}[T](a){return new Promise(b=>{let c=this[y].splice(this[E]);for(let b=0;b<c.length;b++){let d=c[b];null!=d&&g.errorRequest(this,d,a)}let d=()=>{this[ad]&&(this[ad](),this[ad]=null),b(null)};this[Y]?(this[Y].destroy(a,d),this[Y]=null):queueMicrotask(d),this[_]()})}}function ak(a,b){if(0===a[v]&&"UND_ERR_INFO"!==b.code&&"UND_ERR_SOCKET"!==b.code){d(a[E]===a[F]);let c=a[y].splice(a[F]);for(let d=0;d<c.length;d++){let e=c[d];null!=e&&g.errorRequest(a,e,b)}d(0===a[x])}}function al(a){d(!a[A]),d(!a[Y]);let{host:b,hostname:c,protocol:f,port:h}=a[p];if("["===c[0]){let a=c.indexOf("]");d(-1!==a);let b=c.substring(1,a);d(e.isIPv6(b)),c=b}a[A]=!0,i.beforeConnect.hasSubscribers&&i.beforeConnect.publish({connectParams:{host:b,hostname:c,protocol:f,port:h,version:a[Y]?.version,servername:a[q],localAddress:a[V]},connector:a[P]});try{a[P]({host:b,hostname:c,protocol:f,port:h,servername:a[q],localAddress:a[V]},(e,j)=>{if(e){am(a,e,{host:b,hostname:c,protocol:f,port:h}),a[_]();return}if(a.destroyed){g.destroy(j.on("error",af),new n),a[_]();return}d(j);try{a[Y]="h2"===j.alpnProtocol?ac(a,j):ab(a,j)}catch(d){j.destroy().on("error",af),am(a,d,{host:b,hostname:c,protocol:f,port:h}),a[_]();return}a[A]=!1,j[R]=0,j[Q]=a[Q],j[r]=a,j[G]=null,i.connected.hasSubscribers&&i.connected.publish({connectParams:{host:b,hostname:c,protocol:f,port:h,version:a[Y]?.version,servername:a[q],localAddress:a[V]},connector:a[P],socket:j}),a.emit("connect",a[p],[a]),a[_]()})}catch(d){am(a,d,{host:b,hostname:c,protocol:f,port:h}),a[_]()}}function am(a,b,{host:c,hostname:d,protocol:e,port:f}){if(!a.destroyed){if(a[A]=!1,i.connectError.hasSubscribers&&i.connectError.publish({connectParams:{host:c,hostname:d,protocol:e,port:f,version:a[Y]?.version,servername:a[q],localAddress:a[V]},connector:a[P],error:b}),"ERR_TLS_CERT_ALTNAME_INVALID"===b.code){let c=a[y].splice(a[F],a[v]);a[E]=a[F];for(let d=0;d<c.length;d++)g.errorRequest(a,c[d],b);for(;a[w]>0&&a[y][a[E]].servername===a[q];){let c=a[y].splice(a[E],1)[0];g.errorRequest(a,c,b)}}else ak(a,b);a.emit("connectionError",a[p],[a],b)}}function an(a){a[B]=0,a.emit("drain",a[p],[a])}function ao(a,b){2!==a[u]&&(a[u]=2,function(a,b){for(;;){if(a.destroyed)return void d(0===a[w]);if(a[ad]&&!a[x]){a[ad](),a[ad]=null;return}if(a[Y]&&a[Y].resume(),a[s])a[B]=2;else if(2===a[B]){b?(a[B]=1,queueMicrotask(()=>an(a))):an(a);continue}if(0===a[w]||a[v]>=(ai(a)||1))return;let c=a[y][a[E]];if(null===c)return;if("https:"===a[p].protocol&&a[q]!==c.servername){if(a[v]>0)return;a[q]=c.servername,a[Y]?.destroy(new m("servername changed"),()=>{a[Y]=null,ao(a)})}if(a[A])return;if(!a[Y]){a[q]=c.servername,al(a);return}if(a[Y].destroyed||a[Y].busy(c))return;!c.aborted&&a[Y].write(c)?a[E]++:a[y].splice(a[E],1)}}(a,b),a[u]=0,a[F]>256&&(a[y].splice(0,a[F]),a[E]-=a[F],a[F]=0))}a.exports=aj},40603:(a,b,c)=>{"use strict";let{EventEmitter:d}=c(78474),{Buffer:e}=c(4573),{InvalidArgumentError:f,Socks5ProxyError:g}=c(61448),{debuglog:h}=c(57975),{parseAddress:i}=c(33297),j=h("undici:socks5"),k=e.alloc(0),l={NO_AUTH:0,GSSAPI:1,USERNAME_PASSWORD:2,NO_ACCEPTABLE:255},m={CONNECT:1,BIND:2,UDP_ASSOCIATE:3},n={IPV4:1,DOMAIN:3,IPV6:4},o={SUCCEEDED:0,GENERAL_FAILURE:1,CONNECTION_NOT_ALLOWED:2,NETWORK_UNREACHABLE:3,HOST_UNREACHABLE:4,CONNECTION_REFUSED:5,TTL_EXPIRED:6,COMMAND_NOT_SUPPORTED:7,ADDRESS_TYPE_NOT_SUPPORTED:8},p={INITIAL:"initial",HANDSHAKING:"handshaking",AUTHENTICATING:"authenticating",AUTHENTICATED:"authenticated",CONNECTING:"connecting",CONNECTED:"connected",ERROR:"error",CLOSED:"closed"};class q extends d{constructor(a,b={}){if(super(),!a)throw new f("socket is required");this.socket=a,this.options=b,this.state=p.INITIAL,this.buffer=k,this.onSocketData=this.onData.bind(this),this.onSocketError=this.onError.bind(this),this.onSocketClose=this.onClose.bind(this),this.authMethods=[],b.username&&b.password&&this.authMethods.push(l.USERNAME_PASSWORD),this.authMethods.push(l.NO_AUTH),this.socket.on("data",this.onSocketData),this.socket.on("error",this.onSocketError),this.socket.on("close",this.onSocketClose)}onData(a){j("received data",a.length,"bytes in state",this.state),this.buffer=e.concat([this.buffer,a]);try{switch(this.state){case p.HANDSHAKING:this.handleHandshakeResponse();break;case p.AUTHENTICATING:this.handleAuthResponse();break;case p.CONNECTING:this.handleConnectResponse()}}catch(a){this.onError(a)}}onError(a){j("socket error",a),this.state=p.ERROR,this.emit("error",a),this.destroy()}onClose(){j("socket closed"),this.state=p.CLOSED,this.emit("close")}destroy(){this.socket&&!this.socket.destroyed&&this.socket.destroy()}markAuthenticated(){this.state=p.AUTHENTICATED,this.emit("authenticated")}handshake(){if(this.state!==p.INITIAL)throw new f("Handshake already started");j("starting handshake with",this.authMethods.length,"auth methods"),this.state=p.HANDSHAKING;let a=e.alloc(2+this.authMethods.length);a[0]=5,a[1]=this.authMethods.length,this.authMethods.forEach((b,c)=>{a[2+c]=b}),this.socket.write(a)}handleHandshakeResponse(){if(this.buffer.length<2)return;let a=this.buffer[0],b=this.buffer[1];if(5!==a)throw new g(`Invalid SOCKS version: ${a}`,"UND_ERR_SOCKS5_VERSION");if(b===l.NO_ACCEPTABLE)throw new g("No acceptable authentication method","UND_ERR_SOCKS5_AUTH_REJECTED");if(this.buffer=this.buffer.subarray(2),j("server selected auth method",b),b===l.NO_AUTH)this.markAuthenticated();else if(b===l.USERNAME_PASSWORD)this.state=p.AUTHENTICATING,this.sendAuthRequest();else throw new g(`Unsupported authentication method: ${b}`,"UND_ERR_SOCKS5_AUTH_METHOD")}sendAuthRequest(){let{username:a,password:b}=this.options;if(!a||!b)throw new f("Username and password required for authentication");j("sending username/password auth");let c=e.from(a),d=e.from(b);if(c.length>255||d.length>255)throw new f("Username or password too long");let g=e.alloc(3+c.length+d.length);g[0]=1,g[1]=c.length,c.copy(g,2),g[2+c.length]=d.length,d.copy(g,3+c.length),this.socket.write(g)}handleAuthResponse(){if(this.buffer.length<2)return;let a=this.buffer[0],b=this.buffer[1];if(1!==a)throw new g(`Invalid auth sub-negotiation version: ${a}`,"UND_ERR_SOCKS5_AUTH_VERSION");if(0!==b)throw new g("Authentication failed","UND_ERR_SOCKS5_AUTH_FAILED");this.buffer=this.buffer.subarray(2),j("authentication successful"),this.markAuthenticated()}connect(a,b){if(this.state===p.CONNECTING||this.state===p.CONNECTED)throw new f("Connection already in progress");if(this.state!==p.AUTHENTICATED)throw new f("Client must be authenticated before CONNECT");j("connecting to",a,b),this.state=p.CONNECTING;let c=this.buildConnectRequest(m.CONNECT,a,b);this.socket.write(c)}buildConnectRequest(a,b,c){let{type:d,buffer:f}=i(b),g=e.alloc(4+f.length+2);return g[0]=5,g[1]=a,g[2]=0,g[3]=d,f.copy(g,4),g.writeUInt16BE(c,4+f.length),g}handleConnectResponse(){let a;if(this.buffer.length<4)return;let b=this.buffer[0],c=this.buffer[1],d=this.buffer[3];if(5!==b)throw new g(`Invalid SOCKS version in reply: ${b}`,"UND_ERR_SOCKS5_REPLY_VERSION");let e=4;if(d===n.IPV4)e+=6;else if(d===n.DOMAIN){if(this.buffer.length<5)return;e+=1+this.buffer[4]+2}else if(d===n.IPV6)e+=18;else throw new g(`Invalid address type in reply: ${d}`,"UND_ERR_SOCKS5_ADDR_TYPE");if(this.buffer.length<e)return;if(c!==o.SUCCEEDED){let a=this.getReplyErrorMessage(c);throw new g(`SOCKS5 connection failed: ${a}`,`UND_ERR_SOCKS5_REPLY_${c}`)}let f=4;if(d===n.IPV4)a=Array.from(this.buffer.subarray(f,f+4)).join("."),f+=4;else if(d===n.DOMAIN){let b=this.buffer[f];f+=1,a=this.buffer.subarray(f,f+b).toString(),f+=b}else if(d===n.IPV6){let b=[];for(let a=0;a<8;a++){let c=this.buffer.readUInt16BE(f+2*a);b.push(c.toString(16))}a=b.join(":"),f+=16}let h=this.buffer.readUInt16BE(f);this.buffer=k,this.state=p.CONNECTED,this.socket.removeListener("data",this.onSocketData),j("connected, bound address:",a,"port:",h),this.emit("connected",{address:a,port:h})}getReplyErrorMessage(a){switch(a){case o.GENERAL_FAILURE:return"General SOCKS server failure";case o.CONNECTION_NOT_ALLOWED:return"Connection not allowed by ruleset";case o.NETWORK_UNREACHABLE:return"Network unreachable";case o.HOST_UNREACHABLE:return"Host unreachable";case o.CONNECTION_REFUSED:return"Connection refused";case o.TTL_EXPIRED:return"TTL expired";case o.COMMAND_NOT_SUPPORTED:return"Command not supported";case o.ADDRESS_TYPE_NOT_SUPPORTED:return"Address type not supported";default:return`Unknown error code: ${a}`}}}a.exports={Socks5Client:q,AUTH_METHODS:l,COMMANDS:m,ADDRESS_TYPES:n,REPLY_CODES:o,STATES:p}},40784:(a,b,c)=>{"use strict";c.r(b),c.d(b,{openaiToCommandCode:()=>h});var d=c(56294),e=c(42541),f=c(55511);function g(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)}function h(a,b,c){let{messages:d,system:e}=function(a=[]){let b=[],c=[];for(let d of a){if(!d)continue;let a=d.role;if("system"===a){let a=g(d.content);a&&c.push(a);continue}if("tool"===a){let a="string"==typeof d.content?d.content:g(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=g(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),h={model:a,messages:d,stream:!1!==c,max_tokens:b.max_tokens??b.max_output_tokens??64e3,temperature:b.temperature??.3};e&&(h.system=e);let i=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);i&&(h.tools=i),null!=b.top_p&&(h.top_p=b.top_p);let j=new Date().toISOString().slice(0,10);return{threadId:(0,f.randomUUID)(),memory:"",config:{workingDir:process.cwd(),date:j,environment:process.platform,structure:[],isGitRepo:!1,currentBranch:"",mainBranch:"",gitStatus:"",recentCommits:[]},params:h}}(0,d.kz)(e.h.OPENAI,e.h.COMMANDCODE,h,null)},41207:(a,b,c)=>{"use strict";c.d(b,{e:()=>function a(b){if(!b||"object"!=typeof b)return b;if(Array.isArray(b)){for(let c of b)a(c);return b}if(b.properties&&"object"==typeof b.properties&&!Array.isArray(b.properties)){let a=new Map,c=new Set(Object.keys(b.properties).filter(a=>d.test(a)));for(let e of Object.keys(b.properties))d.test(e)||a.set(e,function(a,b){let c=a.replace(/[^a-zA-Z0-9_.-]/g,"_").slice(0,64);0===c.length&&(c="_");let d=c,e=1;for(;b.has(d);){let a=`_${e++}`;d=c.slice(0,64-a.length)+a}return b.add(d),d}(e,c));for(let[c,d]of a)b.properties[d]=b.properties[c],delete b.properties[c];a.size>0&&Array.isArray(b.required)&&(b.required=b.required.map(b=>a.get(b)||b))}for(let c of Object.values(b))c&&"object"==typeof c&&a(c);return b}});let d=/^[a-zA-Z0-9_.-]{1,64}$/},41222:(a,b,c)=>{"use strict";c.r(b),c.d(b,{claudeToOpenAIResponse:()=>g});var d=c(56294),e=c(42541);function f(a,b,c=null){return{id:`chatcmpl-${a.messageId}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:a.model,choices:[{index:0,delta:b,finish_reason:c}]}}function g(a,b){if(!a)return null;let c=[];switch(a.type){case"message_start":b.messageId=a.message?.id||`msg_${Date.now()}`,b.model=a.message?.model,b.toolCallIndex=0,c.push(f(b,{role:"assistant"}));break;case"content_block_start":{let d=a.content_block;if(d?.type==="server_tool_use"){b.serverToolBlockIndex=a.index;break}if(d?.type==="text")b.textBlockStarted=!0;else if(d?.type==="thinking")b.inThinkingBlock=!0,b.currentBlockIndex=a.index,c.push(f(b,{content:"<think>"}));else if(d?.type==="tool_use"){let e=b.toolCallIndex++,g=b.toolNameMap?.get(d.name)||d.name,h={index:e,id:d.id,type:"function",function:{name:g,arguments:""}};b.toolCalls.set(a.index,h),c.push(f(b,{tool_calls:[h]}))}break}case"content_block_delta":{if(a.index===b.serverToolBlockIndex)break;let d=a.delta;if(d?.type==="text_delta"&&d.text)c.push(f(b,{content:d.text}));else if(d?.type==="thinking_delta"&&d.thinking)c.push(f(b,{reasoning_content:d.thinking}));else if(d?.type==="input_json_delta"&&d.partial_json){let e=b.toolCalls.get(a.index);e&&(e.function.arguments+=d.partial_json,c.push(f(b,{tool_calls:[{index:e.index,id:e.id,function:{arguments:d.partial_json}}]})))}break}case"content_block_stop":if(a.index===b.serverToolBlockIndex){b.serverToolBlockIndex=-1;break}b.inThinkingBlock&&a.index===b.currentBlockIndex&&(c.push(f(b,{content:"</think>"})),b.inThinkingBlock=!1),b.textBlockStarted=!1,b.thinkingBlockStarted=!1;break;case"message_delta":if(a.usage&&"object"==typeof a.usage){let c="number"==typeof a.usage.input_tokens?a.usage.input_tokens:0,d="number"==typeof a.usage.output_tokens?a.usage.output_tokens:0,e="number"==typeof a.usage.cache_read_input_tokens?a.usage.cache_read_input_tokens:0,f="number"==typeof a.usage.cache_creation_input_tokens?a.usage.cache_creation_input_tokens:0,g=c+e+f;b.usage={prompt_tokens:g,completion_tokens:d,total_tokens:g+d,input_tokens:c,output_tokens:d},e>0&&(b.usage.cache_read_input_tokens=e),f>0&&(b.usage.cache_creation_input_tokens=f)}if(a.delta?.stop_reason){b.finishReason=function(a){switch(a){case"end_turn":case"stop_sequence":default:return"stop";case"max_tokens":return"length";case"tool_use":return"tool_calls"}}(a.delta.stop_reason);let d={id:`chatcmpl-${b.messageId}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:b.model,choices:[{index:0,delta:{},finish_reason:b.finishReason}]};if(b.usage){d.usage={prompt_tokens:b.usage.prompt_tokens,completion_tokens:b.usage.completion_tokens,total_tokens:b.usage.total_tokens};let a=b.usage.cache_read_input_tokens,c=b.usage.cache_creation_input_tokens;(a>0||c>0)&&(d.usage.prompt_tokens_details={},a>0&&(d.usage.prompt_tokens_details.cached_tokens=a),c>0&&(d.usage.prompt_tokens_details.cache_creation_tokens=c))}c.push(d),b.finishReasonSent=!0}break;case"message_stop":if(!b.finishReasonSent){let a=b.finishReason||(b.toolCalls?.size>0?"tool_calls":"stop"),d=b.usage&&"object"==typeof b.usage?{usage:{prompt_tokens:b.usage.input_tokens||0,completion_tokens:b.usage.output_tokens||0,total_tokens:(b.usage.input_tokens||0)+(b.usage.output_tokens||0)}}:{};c.push({id:`chatcmpl-${b.messageId}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:b.model,choices:[{index:0,delta:{},finish_reason:a}],...d}),b.finishReasonSent=!0}}return c.length>0?c:null}(0,d.kz)(e.h.CLAUDE,e.h.OPENAI,null,g)},41310:(a,b,c)=>{"use strict";c.d(b,{Xj:()=>q});var d=c(39852),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(53859);let l=h().join(k.n,"machine-id"),m=h().join(k.n,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.n,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="zevai-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},41815:(a,b,c)=>{"use strict";c.d(b,{$:()=>o});var d=c(69384),e=c(30395),f=c(11484);let g=e.xq["grok-web"].baseUrl,h={"grok-3":{grokModel:"grok-3",modelMode:"MODEL_MODE_GROK_3",isThinking:!1},"grok-3-mini":{grokModel:"grok-3",modelMode:"MODEL_MODE_GROK_3_MINI_THINKING",isThinking:!0},"grok-3-thinking":{grokModel:"grok-3",modelMode:"MODEL_MODE_GROK_3_THINKING",isThinking:!0},"grok-4":{grokModel:"grok-4",modelMode:"MODEL_MODE_GROK_4",isThinking:!1},"grok-4-mini":{grokModel:"grok-4-mini",modelMode:"MODEL_MODE_GROK_4_MINI_THINKING",isThinking:!0},"grok-4-thinking":{grokModel:"grok-4",modelMode:"MODEL_MODE_GROK_4_THINKING",isThinking:!0},"grok-4-heavy":{grokModel:"grok-4",modelMode:"MODEL_MODE_HEAVY",isThinking:!0},"grok-4.1-mini":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_GROK_4_1_MINI_THINKING",isThinking:!0},"grok-4.1-fast":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_FAST",isThinking:!1},"grok-4.1-expert":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_EXPERT",isThinking:!0},"grok-4.1-thinking":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_GROK_4_1_THINKING",isThinking:!0},"grok-4.2":{grokModel:"grok-420",modelMode:"MODEL_MODE_GROK_420",isThinking:!1},"grok-4.20":{grokModel:"grok-420",modelMode:"MODEL_MODE_GROK_420",isThinking:!1},"grok-4.20-beta":{grokModel:"grok-420",modelMode:"MODEL_MODE_GROK_420",isThinking:!1}};function i(a,b=!1){let c=b?"abcdefghijklmnopqrstuvwxyz0123456789":"abcdefghijklmnopqrstuvwxyz",d="";for(let b=0;b<a;b++)d+=c[Math.floor(Math.random()*c.length)];return d}function j(a){let b=new Uint8Array(a);return crypto.getRandomValues(b),Array.from(b,a=>a.toString(16).padStart(2,"0")).join("")}async function*k(a,b){let c=a.getReader(),d=new TextDecoder,e="";try{for(;;){if(b?.aborted)return;let{value:a,done:f}=await c.read();if(f)break;for(e+=d.decode(a,{stream:!0});;){let a=e.indexOf("\n");if(a<0)break;let b=e.slice(0,a).trim();if(e=e.slice(a+1),b)try{yield JSON.parse(b)}catch{}}}let a=(e+=d.decode()).trim();if(a)try{yield JSON.parse(a)}catch{}}finally{c.releaseLock()}}async function*l(a,b,c){let d="",e="",f=!1;for await(let g of k(a,c)){if(g.error)return void(yield{error:g.error.message||`Grok error: ${g.error.code}`,done:!0});let a=g.result?.response;if(a){if(a.llmInfo?.modelHash&&!d&&(d=a.llmInfo.modelHash),a.responseId&&(e=a.responseId),a.modelResponse){let c=a.modelResponse;f&&b&&(c.message&&(yield{thinking:c.message}),f=!1),c.message&&(yield{fullMessage:c.message,fingerprint:d,responseId:e}),c.metadata?.llm_info?.modelHash&&(d=c.metadata.llm_info.modelHash);continue}null!=a.token&&(yield{delta:a.token,fingerprint:d,responseId:e})}}yield{done:!0,fingerprint:d,responseId:e}}function m(a){return`data: ${JSON.stringify(a)}
289
295
 
290
- `}async function n(a,b,c,d,e,f){let g="",h="",i=[];for await(let b of l(a,e,f)){if(b.fingerprint&&(h=b.fingerprint),b.error)return new Response(JSON.stringify({error:{message:b.error,type:"upstream_error",code:"GROK_ERROR"}}),{status:502,headers:{"Content-Type":"application/json"}});if(b.thinking){i.push(b.thinking);continue}if(b.done)break;b.fullMessage?g=b.fullMessage:b.delta&&(g+=b.delta)}let j={role:"assistant",content:g};i.length>0&&(j.reasoning_content=i.join("\n"));let k=Math.ceil(g.length/4),m=Math.ceil(g.length/4);return new Response(JSON.stringify({id:c,object:"chat.completion",created:d,model:b,system_fingerprint:h||null,choices:[{index:0,message:j,finish_reason:"stop",logprobs:null}],usage:{prompt_tokens:k,completion_tokens:m,total_tokens:k+m}}),{status:200,headers:{"Content-Type":"application/json"}})}class o extends d.Hv{constructor(){super("grok-web",e.xq["grok-web"])}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:k}){let o,p,q=b?.messages;if(!q||!Array.isArray(q)||0===q.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};let r=h[a];r||k?.info?.("GROK-WEB",`Unmapped model ${a}, defaulting to grok-4.1-fast`);let{grokModel:s,modelMode:t,isThinking:u}=r||h["grok-4.1-fast"],v=function(a){let b=[];for(let c of a){let a=String(c.role||"user");"developer"===a&&(a="system");let d="";"string"==typeof c.content?d=c.content:Array.isArray(c.content)&&(d=c.content.filter(a=>"text"===a.type).map(a=>String(a.text||"")).join(" ")),d.trim()&&b.push({role:a,text:d})}let c=-1;for(let a=b.length-1;a>=0;a--)if("user"===b[a].role){c=a;break}let d=[];for(let a=0;a<b.length;a++){let{role:e,text:f}=b[a];d.push(a===c?f:`${e}: ${f}`)}return d.join("\n\n")}(q);if(!v.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 w={temporary:!0,modelName:s,modelMode:t,message:v,fileAttachments:[],imageAttachments:[],disableSearch:!1,enableImageGeneration:!1,returnImageBytes:!1,returnRawGrokInXaiRequest:!1,enableImageStreaming:!1,imageGenerationCount:0,forceConcise:!1,toolOverrides:{},enableSideBySide:!0,sendFinalMetadata:!0,isReasoning:!1,disableTextFollowUps:!1,disableMemory:!0,forceSideBySide:!1,isAsyncChat:!1,disableSelfHarmShortCircuit:!1,deviceEnvInfo:{darkModeEnabled:!1,devicePixelRatio:2,screenWidth:2056,screenHeight:1329,viewportWidth:2056,viewportHeight:1083}},x=j(16),y=j(8),z={Accept:"*/*","Accept-Encoding":"gzip, deflate, br, zstd","Accept-Language":"en-US,en;q=0.9",Baggage:"sentry-environment=production,sentry-release=d6add6fb0460641fd482d767a335ef72b9b6abb8,sentry-public_key=b311e0f2690c81f25e2c4cf6d4f7ce1c","Cache-Control":"no-cache","Content-Type":"application/json",Origin:"https://grok.com",Pragma:"no-cache",Referer:"https://grok.com/","Sec-Ch-Ua":'"Google Chrome";v="136", "Chromium";v="136", "Not(A:Brand";v="24"',"Sec-Ch-Ua-Mobile":"?0","Sec-Ch-Ua-Platform":'"macOS"',"Sec-Fetch-Dest":"empty","Sec-Fetch-Mode":"cors","Sec-Fetch-Site":"same-origin","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36","x-statsig-id":btoa(.5>Math.random()?`e:TypeError: Cannot read properties of null (reading 'children["${i(5,!0)}"]')`:`e:TypeError: Cannot read properties of undefined (reading '${i(10)}')`),"x-xai-request-id":crypto.randomUUID(),traceparent:`00-${x}-${y}-00`};if(d.apiKey){let a=d.apiKey;a.startsWith("sso=")&&(a=a.slice(4)),z.Cookie=`sso=${a}`}k?.info?.("GROK-WEB",`Query to ${a} (grok=${s}, mode=${t}), len=${v.length}`);try{o=await fetch(g,{method:"POST",headers:z,body:JSON.stringify(w),signal:e})}catch(a){return k?.error?.("GROK-WEB",`Fetch failed: ${a.message||String(a)}`),{response:new Response(JSON.stringify({error:{message:`Grok connection failed: ${a.message||String(a)}`,type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:g,headers:z,transformedBody:w}}if(!o.ok){let a=o.status,b=`Grok returned HTTP ${a}`;return 401===a||403===a?b="Grok auth failed — SSO cookie may be expired. Re-paste your sso cookie value from grok.com.":429===a&&(b="Grok rate limited. Wait a moment and retry, or rotate cookies."),k?.warn?.("GROK-WEB",b),await (0,f.aI)(o),{response:new Response(JSON.stringify({error:{message:b,type:"upstream_error",code:`HTTP_${a}`}}),{status:a,headers:{"Content-Type":"application/json"}}),url:g,headers:z,transformedBody:w}}if(!o.body)return{response:new Response(JSON.stringify({error:{message:"Grok returned empty response body",type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:g,headers:z,transformedBody:w};let A=`chatcmpl-grok-${crypto.randomUUID().slice(0,12)}`,B=Math.floor(Date.now()/1e3);if(c){var C;let b;p=new Response((C=o.body,b=new TextEncoder,new ReadableStream({async start(c){try{c.enqueue(b.encode(m({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:null,choices:[{index:0,delta:{role:"assistant"},finish_reason:null,logprobs:null}]})));let d="";for await(let f of l(C,u,e)){if(f.fingerprint&&(d=f.fingerprint),f.error){c.enqueue(b.encode(m({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{content:`[Error: ${f.error}]`},finish_reason:null,logprobs:null}]})));break}if(f.thinking){c.enqueue(b.encode(m({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{reasoning_content:f.thinking},finish_reason:null,logprobs:null}]})));continue}if(f.done)break;f.delta&&c.enqueue(b.encode(m({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{content:f.delta},finish_reason:null,logprobs:null}]})))}c.enqueue(b.encode(m({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode("data: [DONE]\n\n"))}catch(d){c.enqueue(b.encode(m({id:A,object:"chat.completion.chunk",created:B,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 p=await n(o.body,a,A,B,u,e);return{response:p,url:g,headers:z,transformedBody:w}}}},42425:(a,b,c)=>{"use strict";let{Transform:d}=c(57075),e=c(38522),{redirectStatusSet:f,referrerPolicyTokens:g,badPortsSet:h}=c(19608),{getGlobalOrigin:i}=c(79412),{collectAnHTTPQuotedString:j,parseMIMEType:k}=c(16537),{performance:l}=c(643),{ReadableStreamFrom:m,isValidHTTPToken:n,normalizedMethodRecordsBase:o}=c(84285),p=c(34589),{isUint8Array:q}=c(73429),{webidl:r}=c(32984),{isomorphicEncode:s,collectASequenceOfCodePoints:t,removeChars:u}=c(70745);function v(a){let b=a.urlList,c=b.length;return 0===c?null:b[c-1].toString()}function w(a){for(let b=0;b<a.length;++b){let c=a.charCodeAt(b);if(c>126||c<32)return!1}return!0}function x(a){return a.urlList[a.urlList.length-1]}function y(a){return!1===(" "===a[0]||" "===a[0]||" "===a[a.length-1]||" "===a[a.length-1]||a.includes("\n")||a.includes("\r")||a.includes("\0"))}function z(){return{referrerPolicy:"strict-origin-when-cross-origin"}}function A(a,b=!1){return(p(r.is.URL(a)),J(a=new URL(a)))?"no-referrer":(a.username="",a.password="",a.hash="",!0===b&&(a.pathname="",a.search=""),a)}let B=RegExp.prototype.test.bind(/^127\.(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){2}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)$/),C=RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);function D(a){return a.includes(":")?("["===a[0]&&"]"===a[a.length-1]&&(a=a.slice(1,-1)),C(a)):B(a)}function E(a){var b;return!!r.is.URL(a)&&("about:blank"===a.href||"about:srcdoc"===a.href||"data:"===a.protocol||"blob:"===a.protocol||null!=(b=a.origin)&&"null"!==b&&(!!("https:"===(b=new URL(b)).protocol||"wss:"===b.protocol||D(b.hostname)||"localhost"===b.hostname||"localhost."===b.hostname||b.hostname.endsWith(".localhost")||b.hostname.endsWith(".localhost."))||"file:"===b.protocol))}function F(a,b){return a.origin===b.origin&&"null"===a.origin||a.protocol===b.protocol&&a.hostname===b.hostname&&a.port===b.port}let G=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function H(a,b,c=0,d=1){class e{#an;#ao;#ap;constructor(a,b){this.#an=a,this.#ao=b,this.#ap=0}next(){let e;if("object"!=typeof this||this===null||!(#an in this))throw TypeError(`'next' called on an object that does not implement interface ${a} Iterator.`);let f=this.#ap,g=b(this.#an);if(f>=g.length)return{value:void 0,done:!0};let{[c]:h,[d]:i}=g[f];switch(this.#ap=f+1,this.#ao){case"key":e=h;break;case"value":e=i;break;case"key+value":e=[h,i]}return{value:e,done:!1}}}return delete e.prototype.constructor,Object.setPrototypeOf(e.prototype,G),Object.defineProperties(e.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${a} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(a,b){return new e(a,b)}}async function I(a,b,c){try{let d=[],e=0;for(;;){let{done:f,value:g}=await a.read();if(f)return void b(Buffer.concat(d,e));if(!q(g))return void c(TypeError("Received non-Uint8Array chunk"));d.push(g),e+=g.length}}catch(a){c(a)}}function J(a){p("protocol"in a);let b=a.protocol;return"about:"===b||"blob:"===b||"data:"===b}function K(a){return"string"==typeof a&&":"===a[5]&&"h"===a[0]&&"t"===a[1]&&"t"===a[2]&&"p"===a[3]&&"s"===a[4]||"https:"===a.protocol}function L(a){p("protocol"in a);let b=a.protocol;return"http:"===b||"https:"===b}class M extends d{#aq;constructor(a){super(),this.#aq=a}_transform(a,b,c){if(!this._inflateStream){if(0===a.length)return void c();this._inflateStream=(15&a[0])==8?e.createInflate(this.#aq):e.createInflateRaw(this.#aq),this._inflateStream.on("data",this.push.bind(this)),this._inflateStream.on("end",()=>this.push(null)),this._inflateStream.on("error",a=>this.destroy(a))}this._inflateStream.write(a,b,c)}_final(a){this._inflateStream&&(this._inflateStream.end(),this._inflateStream=null),a()}}function N(a,b){let c=b.get(a,!0);if(null===c)return null;let d={position:0},e=[],f="";for(;d.position<c.length;){if(f+=t(a=>'"'!==a&&","!==a,c,d),d.position<c.length)if(34===c.charCodeAt(d.position)){if(f+=j(c,d),d.position<c.length)continue}else p(44===c.charCodeAt(d.position)),d.position++;f=u(f,!0,!0,a=>9===a||32===a),e.push(f),f=""}return e}class O{get baseUrl(){return i()}get origin(){return this.baseUrl?.origin}policyContainer=z()}class P{settingsObject=new O}a.exports={isAborted:function(a){return"aborted"===a.controller.state},isCancelled:function(a){return"aborted"===a.controller.state||"terminated"===a.controller.state},isValidEncodedURL:w,ReadableStreamFrom:m,tryUpgradeRequestToAPotentiallyTrustworthyURL:function(a){},clampAndCoarsenConnectionTimingInfo:function(a,b,c){return!a?.startTime||a.startTime<b?{domainLookupStartTime:b,domainLookupEndTime:b,connectionStartTime:b,connectionEndTime:b,secureConnectionStartTime:b,ALPNNegotiatedProtocol:a?.ALPNNegotiatedProtocol}:{domainLookupStartTime:a.domainLookupStartTime,domainLookupEndTime:a.domainLookupEndTime,connectionStartTime:a.connectionStartTime,connectionEndTime:a.connectionEndTime,secureConnectionStartTime:a.secureConnectionStartTime,ALPNNegotiatedProtocol:a.ALPNNegotiatedProtocol}},coarsenedSharedCurrentTime:function(a){return l.now()},determineRequestsReferrer:function(a){let b=a.referrerPolicy;p(b);let c=null;if("client"===a.referrer){let a=i();if(!a||"null"===a.origin)return"no-referrer";c=new URL(a)}else r.is.URL(a.referrer)&&(c=a.referrer);let d=A(c),e=A(c,!0);switch(d.toString().length>4096&&(d=e),b){case"no-referrer":return"no-referrer";case"origin":if(null!=e)return e;return A(c,!0);case"unsafe-url":return d;case"strict-origin":{let b=x(a);if(E(d)&&!E(b))return"no-referrer";return e}case"strict-origin-when-cross-origin":{let b=x(a);if(F(d,b))return d;if(E(d)&&!E(b))return"no-referrer";return e}case"same-origin":if(F(a,d))return d;return"no-referrer";case"origin-when-cross-origin":if(F(a,d))return d;return e;case"no-referrer-when-downgrade":{let b=x(a);if(E(d)&&!E(b))return"no-referrer";return d}}},makePolicyContainer:z,clonePolicyContainer:function(a){return{referrerPolicy:a.referrerPolicy}},appendFetchMetadata:function(a){let b=null;b=a.mode,a.headersList.set("sec-fetch-mode",b,!0)},appendRequestOriginHeader:function(a){let b=a.origin;if("client"!==b&&void 0!==b){if("cors"===a.responseTainting||"websocket"===a.mode)a.headersList.append("origin",b,!0);else if("GET"!==a.method&&"HEAD"!==a.method){switch(a.referrerPolicy){case"no-referrer":b=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":a.origin&&K(a.origin)&&!K(x(a))&&(b=null);break;case"same-origin":F(a,x(a))||(b=null)}a.headersList.append("origin",b,!0)}}},TAOCheck:function(){return"success"},corsCheck:function(){return"success"},crossOriginResourcePolicyCheck:function(){return"allowed"},createOpaqueTimingInfo:function(a){return{startTime:a.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:a.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}},setRequestReferrerPolicyOnRedirect:function(a,b){let c=function(a){let b=(a.headersList.get("referrer-policy",!0)??"").split(","),c="";if(b.length)for(let a=b.length;0!==a;a--){let d=b[a-1].trim();if(g.has(d)){c=d;break}}return c}(b);""!==c&&(a.referrerPolicy=c)},isValidHTTPToken:n,requestBadPort:function(a){let b=x(a);return L(b)&&h.has(b.port)?"blocked":"allowed"},requestCurrentURL:x,responseURL:v,responseLocationURL:function(a,b){var c;if(!f.has(a.status))return null;let d=a.headersList.get("location",!0);return null!==d&&y(d)&&(w(d)||(c=d,d=Buffer.from(c,"binary").toString("utf8")),d=new URL(d,v(a))),d&&!d.hash&&(d.hash=b),d},isURLPotentiallyTrustworthy:E,isValidReasonPhrase:function(a){for(let b=0;b<a.length;++b){let c=a.charCodeAt(b);if(!(9===c||c>=32&&c<=126||c>=128&&c<=255))return!1}return!0},sameOrigin:F,normalizeMethod:function(a){return o[a.toLowerCase()]??a},iteratorMixin:function(a,b,c,d=0,e=1){let f=H(a,c,d,e),g={keys:{writable:!0,enumerable:!0,configurable:!0,value:function(){return r.brandCheck(this,b),f(this,"key")}},values:{writable:!0,enumerable:!0,configurable:!0,value:function(){return r.brandCheck(this,b),f(this,"value")}},entries:{writable:!0,enumerable:!0,configurable:!0,value:function(){return r.brandCheck(this,b),f(this,"key+value")}},forEach:{writable:!0,enumerable:!0,configurable:!0,value:function(c,d=globalThis){if(r.brandCheck(this,b),r.argumentLengthCheck(arguments,1,`${a}.forEach`),"function"!=typeof c)throw TypeError(`Failed to execute 'forEach' on '${a}': parameter 1 is not of type 'Function'.`);for(let{0:a,1:b}of f(this,"key+value"))c.call(d,b,a,this)}}};return Object.defineProperties(b.prototype,{...g,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:g.entries.value}})},createIterator:H,isValidHeaderName:n,isValidHeaderValue:y,isErrorLike:function(a){return a instanceof Error||a?.constructor?.name==="Error"||a?.constructor?.name==="DOMException"},fullyReadBody:function(a,b,c){try{let d=a.stream.getReader();I(d,b,c)}catch(a){c(a)}},readableStreamClose:function(a){try{a.close(),a.byobRequest?.respond(0)}catch(a){if(!a.message.includes("Controller is already closed")&&!a.message.includes("ReadableStream is already closed"))throw a}},urlIsLocal:J,urlHasHttpsScheme:K,urlIsHttpHttpsScheme:L,readAllBytes:I,simpleRangeHeaderValue:function(a,b){if(!a.startsWith("bytes"))return"failure";let c={position:5};if(b&&t(a=>" "===a||" "===a,a,c),61!==a.charCodeAt(c.position))return"failure";c.position++,b&&t(a=>" "===a||" "===a,a,c);let d=t(a=>{let b=a.charCodeAt(0);return b>=48&&b<=57},a,c),e=d.length?Number(d):null;if(b&&t(a=>" "===a||" "===a,a,c),45!==a.charCodeAt(c.position))return"failure";c.position++,b&&t(a=>" "===a||" "===a,a,c);let f=t(a=>{let b=a.charCodeAt(0);return b>=48&&b<=57},a,c),g=f.length?Number(f):null;return c.position<a.length||null===g&&null===e||null!==e&&null!==g&&e>g?"failure":{rangeStartValue:e,rangeEndValue:g}},buildContentRange:function(a,b,c){let d="bytes ";return d+=s(`${a}`),d+="-",d+=s(`${b}`),d+="/",d+=s(`${c}`)},createInflate:function(a){return new M(a)},extractMimeType:function(a){let b=null,c=null,d=null,e=N("content-type",a);if(null===e)return"failure";for(let a of e){let e=k(a);"failure"!==e&&"*/*"!==e.essence&&((d=e).essence!==c?(b=null,d.parameters.has("charset")&&(b=d.parameters.get("charset")),c=d.essence):d.parameters.has("charset")||null===b||d.parameters.set("charset",b))}return null==d?"failure":d},getDecodeSplit:N,environmentSettingsObject:new P,isOriginIPPotentiallyTrustworthy:D,hasAuthenticationEntry:function(a){return!1},includesCredentials:function(a){return!!(a.username||a.password)},isTraversableNavigable:function(a){return null!=a&&"client"!==a&&"no-traversable"!==a}}},42430:(a,b,c)=>{"use strict";let{addAbortListener:d}=c(78474),{environmentSettingsObject:e,readableStreamClose:f}=c(42425),{states:g,opcodes:h,sentCloseFrameState:i}=c(62026),{webidl:j}=c(32984),{getURLRecord:k,isValidSubprotocol:l,isEstablished:m,utf8Decode:n}=c(94050),{establishWebSocketConnection:o,failWebsocketConnection:p,closeWebSocketConnection:q}=c(4654),{channels:r}=c(62571),{WebsocketFrameSend:s}=c(45221),{ByteParser:t}=c(64821),{WebSocketError:u,createUnvalidatedWebSocketError:v}=c(87404),{kEnumerableProperty:w}=c(84285),{utf8DecodeBytes:x}=c(67449),y=!1;class z{#ar;#as;#at;#au;#av;#aw;#ax=!1;#ay={onConnectionEstablished:(a,b)=>this.#az(a,b),onMessage:(a,b)=>this.#aA(a,b),onParserError:a=>p(this.#ay,null,a.message),onParserDrain:()=>this.#ay.socket.resume(),onSocketData:a=>{this.#aB.write(a)||this.#ay.socket.pause()},onSocketError:a=>{this.#ay.readyState=g.CLOSING,r.socketError.hasSubscribers&&r.socketError.publish(a),this.#ay.socket.destroy()},onSocketClose:()=>this.#aC(),onPing:()=>{},onPong:()=>{},readyState:g.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#aB;constructor(a,b){y||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),y=!0),j.argumentLengthCheck(arguments,1,"WebSocket"),a=j.converters.USVString(a),null!==b&&(b=j.converters.WebSocketStreamOptions(b));const c=k(a,e.settingsObject.baseUrl),f=b.protocols;if(f.length!==new Set(f.map(a=>a.toLowerCase())).size||f.length>0&&!f.every(a=>l(a)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#ar=c.toString(),this.#as=Promise.withResolvers(),this.#at=Promise.withResolvers(),null!=b.signal){const a=b.signal;if(a.aborted){this.#as.reject(a.reason),this.#at.reject(a.reason);return}d(a,()=>{m(this.#ay.readyState)||(p(this.#ay),this.#ay.readyState=g.CLOSING,this.#as.reject(a.reason),this.#at.reject(a.reason),this.#ax=!0)})}const h=e.settingsObject;this.#ay.controller=o(c,f,h,this.#ay,b)}get url(){return this.#ar.toString()}get opened(){return this.#as.promise}get closed(){return this.#at.promise}close(a){null!==a&&(a=j.converters.WebSocketCloseInfo(a));let b=a.closeCode??null,c=a.reason;q(this.#ay,b,c,!0)}#aD(a){a=j.converters.WebSocketStreamWrite(a);let b=Promise.withResolvers(),c=null,d=null;if(j.is.BufferSource(a))c=new Uint8Array(ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):a.slice()),d=h.BINARY;else{let e;try{e=j.converters.DOMString(a)}catch(a){return b.reject(a),b.promise}c=new TextEncoder().encode(e),d=h.TEXT}if(!this.#ay.closeState.has(i.SENT)&&!this.#ay.closeState.has(i.RECEIVED)){let a=new s(c);this.#ay.socket.write(a.createFrame(d),()=>{b.resolve(void 0)})}return b.promise}#az(a,b){this.#ay.socket=a.socket;let c=this.#ay.controller.dispatcher?.webSocketOptions?.maxFragments,d=this.#ay.controller.dispatcher?.webSocketOptions?.maxPayloadSize,e=new t(this.#ay,b,{maxFragments:c,maxPayloadSize:d});e.on("drain",()=>this.#ay.onParserDrain()),e.on("error",a=>this.#ay.onParserError(a)),this.#aB=e,this.#ay.readyState=g.OPEN;let f=b??"",h=a.headersList.get("sec-websocket-protocol")??"",i=new ReadableStream({start:a=>{this.#av=a},cancel:a=>this.#aE(a)}),j=new WritableStream({write:a=>this.#aD(a),close:()=>q(this.#ay,null,null),abort:a=>this.#aF(a)});this.#au=i,this.#aw=j,this.#as.resolve({extensions:f,protocol:h,readable:i,writable:j})}#aA(a,b){let c;if(this.#ay.readyState===g.OPEN){if(a===h.TEXT)try{c=n(b)}catch{p(this.#ay,1007,"Received invalid UTF-8 in text frame.");return}else a===h.BINARY&&(c=new Uint8Array(b.buffer,b.byteOffset,b.byteLength));this.#av.enqueue(c)}}#aC(){let a=this.#ay.closeState.has(i.SENT)&&this.#ay.closeState.has(i.RECEIVED);if(this.#ay.readyState=g.CLOSED,this.#ax)return;this.#ay.wasEverConnected||this.#as.reject(new u("Socket never opened"));let b=this.#aB?.closingInfo,c=b?.code??1005;this.#ay.closeState.has(i.SENT)||this.#ay.closeState.has(i.RECEIVED)||(c=1006);let d=b?.reason==null?"":x(Buffer.from(b.reason));if(a)f(this.#av),this.#aw.locked||this.#aw.abort(new DOMException("A closed WebSocketStream cannot be written to","InvalidStateError")),this.#at.resolve({closeCode:c,reason:d});else{let a=v("unclean close",c,d);this.#av?.error(a),this.#aw?.abort(a),this.#at.reject(a)}}#aF(a){let b=null,c="";j.is.WebSocketError(a)&&(b=a.closeCode,c=a.reason),q(this.#ay,b,c)}#aE(a){this.#aF(a)}}Object.defineProperties(z.prototype,{url:w,opened:w,closed:w,close:w,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}}),j.converters.WebSocketStreamOptions=j.dictionaryConverter([{key:"protocols",converter:j.sequenceConverter(j.converters.USVString),defaultValue:()=>[]},{key:"signal",converter:j.nullableConverter(j.converters.AbortSignal),defaultValue:()=>null}]),j.converters.WebSocketCloseInfo=j.dictionaryConverter([{key:"closeCode",converter:a=>j.converters["unsigned short"](a,j.attributes.EnforceRange)},{key:"reason",converter:j.converters.USVString,defaultValue:()=>""}]),j.converters.WebSocketStreamWrite=function(a){return"string"==typeof a?j.converters.USVString(a):j.converters.BufferSource(a)},a.exports={WebSocketStream:z}},42541:(a,b,c)=>{"use strict";c.d(b,{h:()=>d});let d={OPENAI:"openai",OPENAI_RESPONSES:"openai-responses",OPENAI_RESPONSE:"openai-response",CLAUDE:"claude",GEMINI:"gemini",GEMINI_CLI:"gemini-cli",VERTEX:"vertex",CODEX:"codex",ANTIGRAVITY:"antigravity",KIRO:"kiro",CURSOR:"cursor",OLLAMA:"ollama",COMMANDCODE:"commandcode"}},42671:(a,b,c)=>{"use strict";c.r(b),c.d(b,{openaiToAntigravityRequest:()=>I,openaiToGeminiCLIRequest:()=>F,openaiToGeminiRequest:()=>D});var d=c(56294),e=c(42541),f=c(65556),g=c(15822),h=c(13324),i=c(93745),j=c(22067);function k(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 l={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},m={"claude-opus-5":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-5-thinking":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-5-agentic":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-5-thinking-agentic":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.7":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-7":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.8":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-8":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-8-thinking":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-4.6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-thinking":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-agentic":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-thinking-agentic":{vision:!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}},n={vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:272e3,maxOutput:128e3},o={vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:372e3,maxOutput:128e3},p={vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:272e3,maxOutput:128e3},q={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-5.6-sol":o,"gpt-5.6-sol-review":o,"gpt-5.6-terra":p,"gpt-5.6-terra-review":p,"gpt-5.6-luna":p,"gpt-5.6-luna-review":p},kiro:{"gpt-5.6-sol":n,"gpt-5.6-terra":n,"gpt-5.6-luna":n,"gpt-5.6-sol-thinking":n,"gpt-5.6-terra-thinking":n,"gpt-5.6-luna-thinking":n,"gpt-5.6-sol-agentic":n,"gpt-5.6-terra-agentic":n,"gpt-5.6-luna-agentic":n,"gpt-5.6-sol-thinking-agentic":n,"gpt-5.6-terra-thinking-agentic":n,"gpt-5.6-luna-thinking-agentic":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-5.0":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:48e3},"glm-5.0-turbo":{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},"glm-4.7":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:48e3},"minimax-m3":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:512e3,maxOutput:48e3},"minimax-m2.7":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,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},"kimi-k2.5":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:164e3,maxOutput:32e3},"hy3-preview":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:192e3,maxOutput:64e3},"deepseek-v4-pro":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:5e4},"deepseek-v4-flash":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:5e4},"deepseek-v3-2-volc":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:96e3,maxOutput:32e3}},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,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude*opus-4.6*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*opus-4.7*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*opus-4.8*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet-4.6*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet-4.7*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{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,reasoning:!0,search:!0,thinkingFormat:"claude-budget",contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude*mythos*",caps:{vision:!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*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-5*image*",caps:{imageOutput:!0}},{pattern:"*gpt-5*codex*",caps:{reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:4e5,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.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*",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}function t(a,b,c=null){if(!b)return{...l};let d=b.includes("/")?b.split("/").pop():b;if(a){let e=q[a];if(e?.[b])return{...l,...e[b],...s(c)};if(e?.[d])return{...l,...e[d],...s(c)}}if(m[d])return{...l,...m[d],...s(c)};if(m[b])return{...l,...m[b],...s(c)};for(let{pattern:a,caps:e}of r)if(k(a,d)||k(a,b))return{...l,...e,...s(c)};return{...l,...s(c)}}function u(){return crypto.randomUUID()}function v(a){return(0,i.E9)(a?._clientSessionId)||(0,j.a0)(a)}function w(a){if(!a)return"_unknown";let b=a.replace(/[^a-zA-Z0-9_.:\-]/g,"_");return/^[a-zA-Z_]/.test(b)||(b="_"+b),b.substring(0,64)}let x=/^[a-zA-Z_][a-zA-Z0-9_.:\-]{0,63}$/,y=/^[a-zA-Z_][a-zA-Z0-9_\-]{0,63}$/;function z(a){return a?.type==="function"&&a.function?a.function.name:a?.name}function A(a){return w(a).replace(/[.:]/g,"_")}function B(a){let b=[];for(let c of a||[]){if(!c?.role||!Array.isArray(c.parts)||0===c.parts.length)continue;let a=b.at(-1);a?.role===c.role?a.parts.push(...c.parts):b.push({...c,parts:[...c.parts]})}return b.at(-1)?.role==="model"&&b.push({role:"user",parts:[{text:"Please continue."}]}),b}function C(a,b,c,d=f.bf){let e={model:a,contents:[],generationConfig:{},safetySettings:h.fc};void 0!==b.temperature&&(e.generationConfig.temperature=b.temperature),void 0!==b.top_p&&(e.generationConfig.topP=b.top_p),void 0!==b.top_k&&(e.generationConfig.topK=b.top_k);let g=b.max_output_tokens??b.max_completion_tokens??b.max_tokens;void 0!==g&&(e.generationConfig.maxOutputTokens=g);let i={};if(b.messages&&Array.isArray(b.messages)){for(let a of b.messages)if("assistant"===a.role&&a.tool_calls)for(let b of a.tool_calls)"function"===b.type&&b.id&&b.function?.name&&(i[b.id]=b.function.name)}let j={};if(b.messages&&Array.isArray(b.messages))for(let a of b.messages)"tool"===a.role&&a.tool_call_id&&(j[a.tool_call_id]=a.content);if(b.messages&&Array.isArray(b.messages))for(let a=0;a<b.messages.length;a++){let c=b.messages[a],f=c.role,g=c.content;if("system"===f&&b.messages.length>1){let a="string"==typeof g?g:(0,h.kU)(g);a&&(e.systemInstruction||(e.systemInstruction={role:"user",parts:[]}),e.systemInstruction.parts.push({text:a}))}else if("user"===f||"system"===f&&1===b.messages.length){let a=(0,h.S6)(g);a.length>0&&e.contents.push({role:"user",parts:a})}else if("assistant"===f){let a=[];if(c.reasoning_content&&(a.push({thought:!0,text:c.reasoning_content}),a.push({thoughtSignature:d,text:""})),g){let b="string"==typeof g?g:(0,h.kU)(g);b&&a.push({text:b})}if(c.tool_calls&&Array.isArray(c.tool_calls)){let b=[];for(let e of c.tool_calls){if("function"!==e.type)continue;let c=(0,h.pT)(e.function?.arguments||"{}");a.push({thoughtSignature:d,functionCall:{id:e.id,name:w(e.function.name),args:c}}),b.push(e.id)}if(a.length>0&&e.contents.push({role:"model",parts:a}),b.some(a=>j[a])){let a=[];for(let c of b){if(!j[c])continue;let b=i[c];if(!b){let a=c.split("-");b=a.length>2?a.slice(0,-2).join("-"):c}let d=j[c],e=(0,h.pT)(d);null===e?e={result:d}:"object"!=typeof e&&(e={result:e}),a.push({functionResponse:{id:c,name:w(b),response:{result:e}}})}a.length>0&&e.contents.push({role:"user",parts:a})}}else a.length>0&&e.contents.push({role:"model",parts:a})}}if(b.tools&&Array.isArray(b.tools)&&b.tools.length>0){let a=[];for(let c of b.tools)if(c.name&&c.input_schema){let b=(0,h.Yr)(structuredClone(c.input_schema||{type:"object",properties:{}}));a.push({name:w(c.name),description:c.description||"",parameters:b})}else if("function"===c.type&&c.function){let b=c.function,d=(0,h.Yr)(structuredClone(b.parameters||{type:"object",properties:{}}));a.push({name:w(b.name),description:b.description||"",parameters:d})}a.length>0&&(e.tools=[{functionDeclarations:a}])}return e.contents=B(e.contents),e}function D(a,b,c){return C(a,b,c)}let E={minimal:4096,low:8192,medium:16384,high:65535};function F(a,b,c,d=!0){let e=C(a,b,c,f.$G),g=t("gemini-cli",a);if(d&&b.reasoning_effort){let c=String(b.reasoning_effort).toLowerCase();if(/gemini-3/i.test(a)){e.generationConfig.thinkingConfig={thinkingLevel:c,includeThoughts:!0};let a="high"===c?g.maxOutput:"medium"===c?Math.min(g.maxOutput,32768):Math.min(g.maxOutput,16384);e.generationConfig.maxOutputTokens=Math.max(Number(e.generationConfig.maxOutputTokens)||0,a)}else e.generationConfig.thinkingConfig={thinkingBudget:({none:0,low:1024,medium:8192,high:24576})[c]??8192,includeThoughts:!0}}if(d&&b.thinking?.type==="enabled"&&b.thinking.budget_tokens&&(e.generationConfig.thinkingConfig={thinkingBudget:b.thinking.budget_tokens,includeThoughts:!0}),e.tools?.[0]?.functionDeclarations){for(let a of e.tools[0].functionDeclarations)if(a.parameters){let b=(0,h.Yr)(a.parameters);a.parameters=b}}return e}function G(a,b,c=null,d=!1){let e={project:c?.projectId||c?.providerSpecificData?.projectId||(0,h.w_)(),model:a,userAgent:d?"antigravity":"gemini-cli",requestId:d?`agent-${u()}`:(0,h.KZ)(),request:{sessionId:d?v(c):(0,h.f6)(),contents:b.contents,systemInstruction:b.systemInstruction,generationConfig:b.generationConfig,tools:b.tools}};return d?(e.requestType="agent",e.request.systemInstruction?.parts&&(e.request.systemInstruction={parts:e.request.systemInstruction.parts})):e.request.safetySettings=b.safetySettings,b.tools?.length>0&&(e.request.toolConfig={functionCallingConfig:{mode:"VALIDATED"}}),e}function H(a){return a.toLowerCase().includes("claude")}function I(a,b,c,d=null){let e,f=function(a,b){let c=structuredClone(b),{forward:d,reverse:e}=function(a,b){let c=H(b),d=c?y:x,e=c?A:w,f=(a||[]).map(z).filter(a=>"string"==typeof a&&a.length>0),g=new Set(f.filter(a=>d.test(a))),h=new Map,i=new Map;for(let a of f){if(h.has(a))continue;let b=d.test(a)?a:function(a,b,c=w){let d=c(a);if(!b.has(d))return b.add(d),d;for(let a=2;;a++){let c=`_${a}`,e=`${d.slice(0,64-c.length)}${c}`;if(!b.has(e))return b.add(e),e}}(a,g,e);h.set(a,b),b!==a&&i.set(b,a)}return{forward:h,reverse:i}}(c.tools,a);if(0===d.size)return{body:c,reverse:e};let f=a=>d.get(a)||a;return c.tools=c.tools.map(a=>a?.type==="function"&&a.function?{...a,function:{...a.function,name:f(a.function.name)}}:a?.name?{...a,name:f(a.name)}:a),Array.isArray(c.messages)&&(c.messages=c.messages.map(a=>{let b=a;return Array.isArray(a.tool_calls)&&(b={...b,tool_calls:a.tool_calls.map(a=>a?.function?{...a,function:{...a.function,name:f(a.function.name)}}:a)}),Array.isArray(a.content)&&(b={...b,content:a.content.map(a=>a?.type==="tool_use"&&a.name?{...a,name:f(a.name)}:a)}),b})),c.tool_choice?.type==="function"&&c.tool_choice.function?.name?c.tool_choice={...c.tool_choice,function:{...c.tool_choice.function,name:f(c.tool_choice.function.name)}}:c.tool_choice?.type==="tool"&&c.tool_choice.name&&(c.tool_choice={...c.tool_choice,name:f(c.tool_choice.name)}),{body:c,reverse:e}}(a,b);if(H(a)){let b=(0,g.openaiToClaudeRequestForAntigravity)(a,f.body,c);e=function(a,b,c=null){let d={project:c?.projectId||c?.providerSpecificData?.projectId||(0,h.w_)(),model:a,userAgent:"antigravity",requestId:`agent-${u()}`,requestType:"agent",request:{sessionId:v(c),contents:[],generationConfig:{temperature:b.temperature||1,maxOutputTokens:b.max_tokens||4096}}},e={};if(b.messages&&Array.isArray(b.messages)){for(let a of b.messages)if(Array.isArray(a.content))for(let b of a.content)"tool_use"===b.type&&b.id&&b.name&&(e[b.id]=b.name)}if(b.messages&&Array.isArray(b.messages))for(let a of b.messages){let b=[];if(Array.isArray(a.content)){for(let c of a.content)if("text"===c.type)b.push({text:c.text});else if("tool_use"===c.type)b.push({functionCall:{id:c.id,name:w(c.name),args:c.input||{}}});else if("tool_result"===c.type){let a=c.content;Array.isArray(a)&&(a=a.map(a=>"text"===a.type?a.text:JSON.stringify(a)).join("\n"));let d=e[c.tool_use_id]?w(e[c.tool_use_id]):"tool";b.push({functionResponse:{id:c.tool_use_id,name:d,response:{result:(0,h.pT)(a)||a}}})}}else"string"==typeof a.content&&b.push({text:a.content});b.length>0&&d.request.contents.push({role:"assistant"===a.role?"model":"user",parts:b})}if(b.tools&&Array.isArray(b.tools)){let a=[];for(let c of b.tools)if(c.name&&c.input_schema){let b=(0,h.Yr)(c.input_schema);a.push({name:w(c.name),description:c.description||"",parameters:b})}if(a.length>0){let c=b.tool_choice,e=c?.type==="tool"&&c.name?a.filter(a=>a.name===c.name):a;d.request.tools=[{functionDeclarations:e}];let f=c?.type==="none"?{mode:"NONE"}:c?.type==="any"?{mode:"ANY"}:c?.type==="tool"&&c.name?{mode:"ANY",allowedFunctionNames:[c.name]}:{mode:"VALIDATED"};d.request.toolConfig={functionCallingConfig:f}}}let f=[];if(b.system)if(Array.isArray(b.system))for(let a of b.system)a.text&&f.push({text:a.text});else"string"==typeof b.system&&f.push({text:b.system});return f.length>0&&(d.request.systemInstruction={parts:f}),d.request.contents=B(d.request.contents),d}(a,b,d)}else{let b=F(a,f.body,c,!1);!function(a,b,c){let d=t("antigravity",a);if(b.reasoning_effort){let e=String(b.reasoning_effort).toLowerCase();if(/gemini-3/i.test(a)){let a,b="none"===(a=String(e).toLowerCase().trim())||"off"===a?"minimal":"xhigh"===a||"max"===a||"auto"===a?"high":a;c.generationConfig.thinkingConfig={thinkingLevel:b,includeThoughts:"minimal"!==b};let f=E[b]||E.high;c.generationConfig.maxOutputTokens=Math.max(Number(c.generationConfig.maxOutputTokens)||0,Math.min(f,d.maxOutput))}else c.generationConfig.thinkingConfig={thinkingBudget:({none:0,low:1024,medium:8192,high:24576})[e]??8192,includeThoughts:!0}}b.thinking?.type==="enabled"&&b.thinking.budget_tokens&&(c.generationConfig.thinkingConfig={thinkingBudget:b.thinking.budget_tokens,includeThoughts:!0})}(a,f.body,b),e=G(a,b,d,!0)}return f.reverse.size>0&&(e._toolNameMap=f.reverse),e}(0,d.kz)(e.h.OPENAI,e.h.GEMINI,D,null),(0,d.kz)(e.h.OPENAI,e.h.GEMINI_CLI,(a,b,c,d)=>G(a,F(a,b,c),d),null),(0,d.kz)(e.h.OPENAI,e.h.ANTIGRAVITY,I,null)},42946:(a,b,c)=>{"use strict";c.d(b,{Az:()=>f,fO:()=>h});var d=c(55511),e=c(48991);function f(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,h=[];for(let a of b){let b=c(a.name);d.set(b,a.name),f.add(a.name),h.push({...a,name:b})}let i=[...h,...g],j=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:i,messages:j||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}}let g=[{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 h(a,b,c){let e,f,g,h,i,j;if(!b||!b.includes("sk-ant-oat"))return a;let k={...a},l={type:"text",text:(e=JSON.stringify(a),f=(0,d.createHash)("sha256").update(e).digest("hex").slice(0,5),g=(0,d.randomBytes)(2).toString("hex").slice(0,3),`x-anthropic-billing-header: cc_version=2.1.92.${g}; cc_entrypoint=sdk-cli; cch=${f};`)};return Array.isArray(k.system)?k.system[0]?.text?.startsWith("x-anthropic-billing-header:")||(k.system=[l,...k.system]):"string"==typeof k.system?k.system=[l,{type:"text",text:k.system}]:k.system=[l],k.metadata?.user_id||(k.metadata={...k.metadata,user_id:(h=(0,d.randomBytes)(32).toString("hex"),i=(0,d.randomUUID)(),j=c||(0,d.randomUUID)(),`{"device_id":"${h}","account_uuid":"${i}","session_id":"${j}"}`)}),k}},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{#aG=null;#aH=null;#D=null;constructor(a={}){super(),this.#D=a;const{httpProxy:b,httpsProxy:c,noProxy:d,...e}=a;this[j]=new n(e);const f=b??process.env.http_proxy??process.env.HTTP_PROXY;f?this[k]=new m({...e,uri:f}):this[k]=this[j];const g=c??process.env.https_proxy??process.env.HTTPS_PROXY;g?this[l]=new m({...e,uri:g}):this[l]=this[k],this.#aI()}[i](a,b){let c=new URL(a.origin);return this.#aJ(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)])}#aJ(a){let{protocol:b,host:c,port:d}=a;return(c=c.replace(/:\d*$/,"").replace(/^\[(.+)\]$/,"$1").toLowerCase(),d=Number.parseInt(d,10)||o[b]||0,this.#aK(c,d))?"https:"===b?this[l]:this[k]:this[j]}#aK(a,b){if(this.#aL&&this.#aI(),0===this.#aH.length)return!0;if("*"===this.#aG)return!1;for(let c=0;c<this.#aH.length;c++){let d=this.#aH[c];if((!d.port||d.port===b)&&(a===d.hostname||a.slice(-(d.hostname.length+1))===`.${d.hostname}`))return!1}return!0}#aI(){let a=this.#D.noProxy??this.#aM,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}c.push({hostname:d.replace(/^\*?\./,"").toLowerCase(),port:e})}this.#aG=a,this.#aH=c}get #aL(){return void 0===this.#D.noProxy&&this.#aG!==this.#aM}get #aM(){return process.env.no_proxy??process.env.NO_PROXY??""}}a.exports=p},43212:(a,b,c)=>{"use strict";c(56294),c(42541),c(90943),c(51525),c(84238),c(92843),c(64323),new TextEncoder},43469:(a,b,c)=>{"use strict";c.d(b,{buildClineHeaders:()=>e});let d=c(90053).rE||"0.0.0";function e(a,b={}){let c,f=(c=function(a){if("string"!=typeof a)return"";let b=a.trim();return b?b.startsWith("workos:")?b:`workos:${b}`:""}(a))?`Bearer ${c}`:"",g={"HTTP-Referer":"https://cline.bot","X-Title":"Cline","User-Agent":`ZevaiRouter/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"zevairouter","X-CLIENT-VERSION":d,"X-CORE-VERSION":d,"X-IS-MULTIROOT":"false",...b};return f&&(g.Authorization=f),g}},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;const 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},44089:(a,b,c)=>{"use strict";c(94026),c(15822),c(70884)},44991:(a,b,c)=>{"use strict";c.d(b,{D:()=>f});var d=c(66678),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(24081),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,headroomCodeAware:!1,headroomKompress:!0,cavemanEnabled:!1,cavemanLevel:"full",ponytailEnabled:!1,ponytailLevel:"full",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:""};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:()=>u,dg:()=>w,qX:()=>t});var e=c(5210),f=c(70321),g=c(94479),h=c(65333),i=c(87164),j=c(63993),k=c(23740),l=c(39817),m=a([e,h]);[e,h]=m.then?(await m)():m;let x=["expired","authentication","unauthorized","401","re-authorize"],y=globalThis._quotaUsageInflight??=new Map;function n(a){return a?.provider==="codex"&&!!a.providerSpecificData?.codexRefreshBlockedAt}function o(a){return String(a?.code||"invalid_refresh_token").replace(/[^a-zA-Z0-9_.:-]/g,"_").slice(0,120)||"invalid_refresh_token"}async function p(a,b){let c=new Date().toISOString(),d=o(b),e={providerSpecificData:{...a.providerSpecificData||{},codexRefreshBlockedAt:c,codexRefreshErrorCode:d},lastError:"Codex refresh token rejected; reconnect this account.",lastErrorAt:c,lastErrorType:"auth",errorCode:d,failureClass:"reauth_required"};try{return await (0,f.updateProviderConnection)(a.id,e)||{...a,...e}}catch(b){return console.warn(`[Usage] Codex refresh rejection state was not persisted: ${b.message}`),{...a,...e}}}async function q(a,b){let c=b?.permanent===!0?b:(0,i.R_)({code:o(b)}),d=await p(a,c);if(a.accessToken)return{connection:d,refreshed:!1,refreshBlocked:!0,refreshError:c};throw c}function r(a){return!!(a?.quotas&&"object"==typeof a.quotas&&Object.keys(a.quotas).length>0)}function s(a,b){return!!(a?.quotaFetchFailed===!0&&!a.accountDead&&!r(a)&&r(b?.usage))}async function t(a,b=!1,c=null){let d,e=(0,h.SB)(a.provider);if(n(a))return a.accessToken?{connection:a,refreshed:!1,refreshBlocked:!0}:q(a,(0,i.R_)({code:a.providerSpecificData.codexRefreshErrorCode||"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};try{d=await e.refreshCredentials(g,console,c)}catch(b){if("codex"===a.provider&&b?.permanent===!0)return q(a,b);throw b}if("codex"===a.provider&&(0,i.jT)(d))return q(a,(0,i.R_)(d));if(!d){if(a.accessToken)return{connection:a,refreshed:!1};throw Error("Failed to refresh credentials. Please re-authorize the connection.")}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 u(a){var b;let c;if(!a)return!1;let d=(b=a.authType,c=String(b||"").toLowerCase().trim(),"api-key"===c||"api_key"===c||"api key"===c?"apikey":c);return"oauth"===d||"apikey"===d&&k.jO.includes(a.provider)}async function v(a,b,c){let{writeCache:d=!1,force:e=!1}=b,h=await (0,f.getProviderConnectionById)(a);if(!h)return{error:"Connection not found",notFound:!0};if(!u(h))return{message:"Usage not available for this connection"};let i=await (0,j.B)(h.providerSpecificData),k={connectionProxyEnabled:!0===i.connectionProxyEnabled,connectionProxyUrl:i.connectionProxyUrl||"",connectionNoProxy:i.connectionNoProxy||"",vercelRelayUrl:i.vercelRelayUrl||"",strictProxy:!1},m=h,o="oauth"===m.authType;if(o){let a;try{a=await t(m,e,k)}catch(a){if("codex"===m.provider&&a?.permanent===!0)return{message:"Codex refresh token rejected; reconnect this account.",reauthRequired:!0,quotas:{}};throw a}m=a.connection}let p=await (0,g.my)(m,k);if(o&&function(a){if(!a?.message)return!1;let b=a.message.toLowerCase();return x.some(a=>b.includes(a))}(p)&&m.refreshToken&&!n(m))try{m=(await t(m,!0,k)).connection,p=await (0,g.my)(m,k)}catch(a){console.warn(`[Usage] ${m.provider}: force refresh failed: ${a.message}`)}if((d||c.writeCache)&&p&&!p.error)try{if("codebuddy"===m.provider||"codebuddy-cn"===m.provider){let a=null,b=await (0,f.Iu)(m.id,(b,c)=>{if(s(p,c)){var d;return d=p,a={...(0,l.pX)(c.usage,b),stale:!0,refreshError:d.message},{}}return{quotaUsage:(0,l.pX)(p,b)}});p=a||b?.quotaUsage||p}else{let a=await (0,f.getQuotaSnapshot)(m.id);s(p,a)?p={...a.usage,stale:!0,refreshError:p.message}:await (0,f.KK)(m.id,m.provider,p)}}catch(a){console.warn(`[QuotaCache] save failed for ${m.id}: ${a.message}`)}else if("codebuddy"===m.provider||"codebuddy-cn"===m.provider){let a=await (0,f.getProviderConnectionById)(m.id)||m;p=(0,l.pX)(p,a)}return p}async function w(a,b={}){let c=y.get(a);if(c||(c={active:null,queuedForce:null},y.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||y.get(a)!==c||y.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,v(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=v(a,b,e).finally(()=>d(e)),e.promise}d()}catch(a){d(a)}})},46714:(a,b,c)=>{"use strict";c.d(b,{dv:()=>j,fM:()=>i,vP:()=>h});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"]);function h(a){let b;return 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 i(a,b){let c="string"==typeof b?b.trim().toLowerCase():"",e=f[c]||c,g=d.indexOf(e);if(-1===g)return"low";let i=h(a),j=i[i.length-1],k=d.indexOf(j);return d[Math.min(g,k)]}function j(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}}},46777:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"trae",alias:"trae",aliases:["marscode"],uiAlias:"trae",category:"oauth",authType:"oauth",hasOAuth:!0,authModes:["oauth"],display:{name:"Trae",icon:"bolt",color:"#FF6A00",textIcon:"TR",website:"https://www.trae.ai",deprecated:!0,notice:{signupUrl:"https://www.trae.ai"}},transport:{baseUrl:"https://core-normal.trae.ai/api/remote/v1",format:"openai",headers:{"X-Trae-Client-Type":"web","X-Preferenced-Language":"en",Referer:"https://solo.trae.ai/"},auth:{combined:!0,header:"Authorization",scheme:"Cloud-IDE-JWT"},usage:{url:"https://api.marscode.com/cloudide/api/v3/trae/GetUserInfo"},regions:{cn:"https://api.marscode.com",sg:"https://api.trae.ai",us:"https://www.trae.ai"},defaultRegion:"cn"},models:[{id:"auto",name:"Auto (Server Picks)"},{id:"work",name:"Work (Fast)"},{id:"gemini-3.1-pro",name:"Gemini 3.1 Pro"},{id:"gemini-3-flash-solo",name:"Gemini 3 Flash"},{id:"minimax-m3",name:"MiniMax M3"},{id:"minimax-m2.7",name:"MiniMax M2.7"},{id:"kimi-k2.5",name:"Kimi K2.5"},{id:"gpt-5.4",name:"GPT 5.4"},{id:"gpt-5.2",name:"GPT 5.2"}],features:{usage:!0}}},46956:(a,b,c)=>{"use strict";c.d(b,{proxyAwareFetch:()=>s});var d=c(3433),e=c(27910),f=c(8735);let g=globalThis.fetch,h=new Map,i=new Map,j=["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"],k=["8.8.8.8","8.8.4.4"];function l(){let a=Error("Request aborted");return a.name="AbortError",a}function m(a){return null==a?"":String(a).trim()}async function n(a,b=null){let d,e=i.get(a);if(e&&Date.now()<e.expiry)return e.ip;if(b?.aborted)throw l();try{let e=await Promise.resolve().then(c.t.bind(c,14985,23)),{promisify:g}=await Promise.resolve().then(c.t.bind(c,28354,23)),h=new e.Resolver;h.setServers(k);let j=g(h.resolve4.bind(h)),m=b?await Promise.race([j(a),new Promise((a,c)=>{d=()=>{h.cancel?.(),c(l())},b.addEventListener("abort",d,{once:!0})})]):await j(a);return i.set(a,{ip:m[0],expiry:Date.now()+f.v1.dnsCacheTtlMs}),m[0]}catch(c){if(b?.aborted||c?.name==="AbortError")throw l();return console.warn(`[ProxyFetch] DNS resolve failed for ${a}:`,c.message),null}finally{d&&b?.removeEventListener?.("abort",d)}}function o(a,b){let c,d=m(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 p(a){let b=m(a);if(!b)return null;try{return new URL(b),b}catch{return`http://${b}`}}async function q(a){let b=p(a);if(!b)return null;if(!h.has(b)){h.size>=f.v1.proxyDispatchersMaxSize&&h.delete(h.keys().next().value);let{ProxyAgent:a}=await Promise.resolve().then(c.t.bind(c,3433,19));h.set(b,new a({uri:b}))}return h.get(b)}async function r(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,i=g.default??g;return new Promise((c,f)=>{let g=new i.Socket,j=d.signal,k=null,m=null,n=!1,o=()=>j?.removeEventListener?.("abort",q),p=a=>{n||(n=!0,o(),f(a))},q=()=>{!function({upstreamResponse:a,request:b,socket:c,rejectOnce:d}){let e=l();d?.(e),a?.destroy?.(),b?.destroy?.(),c?.destroy?.()}({upstreamResponse:m,request:k,socket:g,rejectOnce:p})};j?.aborted?q():(j?.addEventListener?.("abort",q,{once:!0}),g.connect(443,b,()=>{if(n||j?.aborted)return;let b={socket:g,servername:a.hostname,path:a.pathname+a.search,method:d.method||"POST",headers:{...d.headers,Host:a.hostname}};(k=h.request(b,a=>{m=a,n=!0,a.once("close",o);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=>p(a)),d.body&&k.write("string"==typeof d.body?d.body:JSON.stringify(d.body)),k.end()}),g.on("error",a=>p(a)))})}async function s(a,b={},c=null){let e="string"==typeof a?a:a.toString(),f=m(c?.vercelRelayUrl);if(f){let a=new URL(e),c={...b.headers,"x-relay-target":`${a.protocol}//${a.host}`,"x-relay-path":`${a.pathname}${a.search}`};return g(f,{...b,headers:c})}let h=function(a,b){if(b?.enabled!==!0&&b?.connectionProxyEnabled!==!0)return null;let c=m(b?.url??b?.connectionProxyUrl);if(!c)return null;let d=m(b?.noProxy??b?.connectionNoProxy);return d&&o(a,d)?null:p(c)}(e,c),i=h?null:p(function(a){let b;if(o(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}(e)),k=h||i;if(function(a){try{let b=new URL(a).hostname;return j.some(a=>b.includes(a))}catch{return!1}}(e)){if(k)try{let c=await q(k);return await (0,d.hd)(a,{...b,dispatcher:c})}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 f=new URL(e),h=await n(f.hostname,b.signal);return h?r(f,h,b):g(a,b)}if(k)try{let c=await q(k);return await (0,d.hd)(a,{...b,dispatcher:c})}catch(a){if(b.signal?.aborted||a?.name==="AbortError")throw a;if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${a.message}`);if(c?.singleTransportAttempt===!0)throw Error("[ProxyFetch] Proxy request failed for single-attempt upstream");console.warn(`[ProxyFetch] Proxy failed, falling back to direct: ${a.message}`)}return g(a,b)}async function t(a,b={}){return s(a,b,null)}globalThis.fetch!==t&&(globalThis.fetch=t)},47335:(a,b,c)=>{"use strict";let d=c(83204),{ResponseError:e}=c(61448);class f extends d{#O;#aN;#aO;#e;#aP;constructor(a,{handler:b}){super(b)}#aQ(a){return 0===(this.#aN??"").indexOf(a)}onRequestStart(a,b){return this.#O=0,this.#aN=null,this.#aO=null,this.#e=null,this.#aP="",super.onRequestStart(a,b)}onResponseStart(a,b,c,d){if(this.#O=b,this.#e=c,this.#aN=c["content-type"],this.#O<400)return super.onResponseStart(a,b,c,d);(this.#aQ("application/json")||this.#aQ("text/plain"))&&(this.#aO=new TextDecoder("utf-8"))}onResponseData(a,b){if(this.#O<400)return super.onResponseData(a,b);this.#aP+=this.#aO?.decode(b,{stream:!0})??""}onResponseEnd(a,b){if(this.#O>=400){let b;if(this.#aP+=this.#aO?.decode(void 0,{stream:!1})??"",this.#aQ("application/json"))try{this.#aP=JSON.parse(this.#aP)}catch{}let c=Error.stackTraceLimit;Error.stackTraceLimit=0;try{b=new e("Response Error",this.#O,{body:this.#aP,headers:this.#e})}finally{Error.stackTraceLimit=c}super.onResponseError(a,b)}else super.onResponseEnd(a,b)}onResponseError(a,b){super.onResponseError(a,b)}}a.exports=()=>a=>function(b,c){return a(b,new f(b,{handler:c}))}},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),{kEnumerableProperty:k}=c(84285),{environmentSettingsObject:l}=c(42425),{createPotentialCORSRequest:m}=c(26376),n=!1;class o extends EventTarget{#aR={open:null,error:null,message:null};#ar;#aS=!1;#aT=0;#aU=null;#G=null;#d;#a;constructor(a,b={}){let c;super(),f.util.markAsUncloneable(this);const d="EventSource constructor";f.argumentLengthCheck(arguments,1,d),n||(n=!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,l.settingsObject.baseUrl),this.#a.origin=c.origin}catch(a){throw new DOMException(a,"SyntaxError")}this.#ar=c.href;let e="anonymous";!0===b.withCredentials&&(e="use-credentials",this.#aS=!0);const g=m(c,"",e);g.client=l.settingsObject,g.headersList.set("Accept","text/event-stream"),g.cache="no-store",g.initiator="other",this.#aU=g,this.#aV()}get readyState(){return this.#aT}get url(){return this.#ar}get withCredentials(){return this.#aS}#aV(){if(2===this.#aT)return;this.#aT=0;let a={request:this.#aU,dispatcher:this.#d};a.processResponseEndOfBody=a=>{if(!j(a))return this.#aW()},a.processResponse=a=>{if(j(a))if(!a.aborted)return void this.#aW();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.#aT=1,this.dispatchEvent(new Event("open")),this.#a.origin=a.urlList[a.urlList.length-1].origin;let f=new g({eventSourceSettings:this.#a,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.#G=e(a)}#aW(){2!==this.#aT&&(this.#aT=0,this.dispatchEvent(new Event("error")),setTimeout(()=>{0===this.#aT&&(this.#a.lastEventId.length&&this.#aU.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#aV())},this.#a.reconnectionTime)?.unref())}close(){f.brandCheck(this,o),2!==this.#aT&&(this.#aT=2,this.#G.abort(),this.#aU=null)}get onopen(){return this.#aR.open}set onopen(a){this.#aR.open&&this.removeEventListener("open",this.#aR.open);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("open",b),this.#aR.open=a):this.#aR.open=null}get onmessage(){return this.#aR.message}set onmessage(a){this.#aR.message&&this.removeEventListener("message",this.#aR.message);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("message",b),this.#aR.message=a):this.#aR.message=null}get onerror(){return this.#aR.error}set onerror(a){this.#aR.error&&this.removeEventListener("error",this.#aR.error);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("error",b),this.#aR.error=a):this.#aR.error=null}}let p={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(o,p),Object.defineProperties(o.prototype,p),Object.defineProperties(o.prototype,{close:k,onerror:k,onmessage:k,onopen:k,readyState:k,url:k,withCredentials:k}),f.converters.EventSourceInitDict=f.dictionaryConverter([{key:"withCredentials",converter:f.converters.boolean,defaultValue:()=>!1},{key:"dispatcher",converter:f.converters.any},{key:"node",converter:f.dictionaryConverter([{key:"reconnectionTime",converter:f.converters["unsigned long"],defaultValue:()=>3e3},{key:"dispatcher",converter:f.converters.any}]),defaultValue:()=>({})}]),a.exports={EventSource:o,defaultReconnectionTime:3e3}},47800:(a,b,c)=>{"use strict";let{InvalidArgumentError:d}=c(61448),{runtimeFeatures:e}=c(56758),f=e.has("crypto")?c(77598):null,g=f?.hash?a=>f.hash("sha256",a,"base64url"):a=>Buffer.from(a).toString("base64url");function h(a){return Array.isArray(a)&&(1&a.length)==0}let i=["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:g,isUndiciHeaders:h,normalizeHeaders:function(a){let b={};if(!a)return b;if(h(a)){for(let c=0;c<a.length;c+=2){let d=a[c],e=a[c+1];if(d&&void 0!==e){let a=Buffer.isBuffer(d)?d.toString():d,c=Buffer.isBuffer(e)?e.toString():e;b[a.toLowerCase()]=c}}return b}if(a&&"object"==typeof a)for(let[c,d]of Object.entries(a))c&&"string"==typeof c&&(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(!i.includes(a))throw new d(`Invalid snapshot mode: ${a}. Must be one of: ${i.join(", ")}`)}}},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),s=Symbol("proxy agent"),t=Symbol("proxy client"),u=Symbol("proxy headers"),v=Symbol("request tls settings"),w=Symbol("proxy tls settings"),x=Symbol("connect endpoint function"),y=Symbol("connect endpoint function (http/1.1 only)"),z=Symbol("tunnel proxy"),A="proxy-authorization";function B(a,b){return new i(a,b)}let C=()=>{};function D(a,b){return 1===b.connections?new p(a,b):new i(a,b)}class E extends j{#aX;#aY;constructor(a,{headers:b={},connect:c,factory:d,proxyServername:e}){if(!a)throw new k("Proxy URL is mandatory");super(),this[u]=b,this.#aY=e,d?this.#aX=d(a,{connect:c}):this.#aX=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;if(a.path=d+e,!("host"in f)&&!("Host"in f)){let{host:a}=new URL(d);f.host=a}return a.headers={...this[u],...f},null!=this.#aY&&(a.servername=this.#aY),this.#aX[g](a,b)}[e](){return this.#aX.close()}[f](a){return this.#aX.destroy(a)}}class F extends j{constructor(a){if(!a||"object"==typeof a&&!(a instanceof URL)&&!a.uri)throw new k("Proxy uri is mandatory");const{clientFactory:b=B}=a;if("function"!=typeof b)throw new k("Proxy opts.clientFactory must be a function.");const{proxyTunnel:c,connectTimeout:e}=a;super();const f=this.#aZ(a),{href:g,origin:i,port:j,protocol:p,username:A,password:F,hostname:G}=f;if(this[d]={uri:g,protocol:p},this[v]=a.requestTls,this[w]=a.proxyTls,this[u]=a.headers||{},this[z]=c,a.auth&&a.token)throw new k("opts.auth cannot be used in combination with opts.token");a.auth?this[u]["proxy-authorization"]=`Basic ${a.auth}`:a.token?this[u]["proxy-authorization"]=a.token:A&&F?this[u]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(A)}:${decodeURIComponent(F)}`).toString("base64")}`:A&&(this[u]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(A)}:`).toString("base64")}`);const H=o({timeout:e,...a.proxyTls}),I=o({timeout:e,...a.proxyTls,allowH2:!1});this[x]=o({timeout:e,...a.requestTls}),this[y]=o({timeout:e,...a.requestTls,allowH2:!1});const J=a.factory||D,K=(b,c)=>{let{protocol:e}=new URL(b);if("socks5:"===this[d].protocol||"socks:"===this[d].protocol)return new r(this[d].uri,{headers:this[u],connect:H,factory:J,username:a.username||A,password:a.password||F,proxyTls:a.proxyTls,requestTls:a.requestTls});if(!0!==this[z]&&"http:"===e){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 E(this[d].uri,{headers:this[u],connect:a,factory:J,proxyServername:"https:"===this[d].protocol?this[w]?.servername||G:void 0})}return J(b,c)};"socks5:"===p||"socks:"===p?this[t]=null:this[t]=b(f,{connect:H}),this[s]=new h({...a,factory:K,connect:async(a,b)=>{if(!this[t])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[u],host:a.host,...null==a.connections||a.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[w]?.servername||G},{socket:f,statusCode:g}=await this[t].connect(e);if(200!==g){f.on("error",C).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[v]?this[v].servername:a.servername,(!1===a.allowH2?this[y]:this[x])({...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)G(a[c])&&H(),b[a[c]]=a[c+1];return b}return a}(a.headers);if(function(a){for(let b in a)G(b)&&H()}(c),c&&!("host"in c)&&!("Host"in c)){let{host:b}=new URL(a.origin);c.host=b}return this[s].dispatch({...a,headers:c},b)}#aZ(a){return"string"==typeof a?new URL(a):a instanceof URL?a:new URL(a.uri)}[e](){let a=[this[s].close()];return this[t]&&a.push(this[t].close()),Promise.all(a)}[f](){let a=[this[s].destroy()];return this[t]&&a.push(this[t].destroy()),Promise.all(a)}}function G(a){return a.length===A.length&&a.toLowerCase()===A}function H(){throw new k("Proxy-Authorization should be sent in ProxyAgent constructor")}a.exports=F},48991:(a,b,c)=>{"use strict";c.d(b,{A9:()=>i,Cn:()=>j,Co:()=>r,Ic:()=>p,NA:()=>t,P0:()=>l,VK:()=>u,Wu:()=>s,go:()=>e,nZ:()=>o,p8:()=>m,rJ:()=>n,sX:()=>f,uR:()=>k,x0:()=>g,zv:()=>q});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={VSCODE_VERSION:"1.110.0",COPILOT_CHAT_VERSION:"0.38.0",USER_AGENT:"GitHubCopilotChat/0.38.0",API_VERSION:"2025-04-01"};function h(){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 i(){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 j={ideType:9,platform:h(),pluginType:2},k="_ide";function l(){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 m(){return"antigravity/ide/2.1.1 darwin/arm64"}function n(a){return"string"==typeof a&&/(?:^|\/)gemini-3\.7(?:-|$)/i.test(a)?l():m()}m();let o={loadCodeAssist:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUser:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser"},p={"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:h(),pluginType:2})},q={ideType:9,platform:h(),pluginType:2},r="You are Claude Code, Anthropic's official CLI for Claude.",s={codex:432e6,claude:144e5,iflow:864e5,qwen:12e5,codebuddy:12e5,kimi:3e5,"kimi-coding":3e5,antigravity:3e5,"grok-cli":3e5,xai:3e5},t={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 u(){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":`kimi-${Date.now()}`}}},49065:(a,b,c)=>{"use strict";c.r(b),c.d(b,{geminiToOpenAIRequest:()=>g});var d=c(56294),e=c(42541),f=c(58455);function g(a,b,c){let d={model:a,messages:[],stream:c};if(b.generationConfig){let a=b.generationConfig;if(a.maxOutputTokens){let c={max_tokens:a.maxOutputTokens,tools:b.tools};d.max_tokens=(0,f.M)(c)}void 0!==a.temperature&&(d.temperature=a.temperature),void 0!==a.topP&&(d.top_p=a.topP)}if(b.systemInstruction){var e;let a="string"==typeof(e=b.systemInstruction)?e:e.parts&&Array.isArray(e.parts)?e.parts.map(a=>a.text||"").join(""):"";a&&d.messages.push({role:"system",content:a})}if(b.contents&&Array.isArray(b.contents))for(let a of b.contents){let b=function(a){let b="user"===a.role?"user":"assistant";if(!a.parts||!Array.isArray(a.parts))return null;let c=[],d=[];for(let b of a.parts)if(void 0!==b.text&&c.push({type:"text",text:b.text}),b.inlineData&&c.push({type:"image_url",image_url:{url:`data:${b.inlineData.mimeType};base64,${b.inlineData.data}`}}),b.functionCall&&d.push({id:`call_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,type:"function",function:{name:b.functionCall.name,arguments:JSON.stringify(b.functionCall.args||{})}}),b.functionResponse)return{role:"tool",tool_call_id:b.functionResponse.id||b.functionResponse.name,content:JSON.stringify(b.functionResponse.response?.result||b.functionResponse.response||{})};if(d.length>0){let a={role:"assistant"};return c.length>0&&(a.content=1===c.length&&"text"===c[0].type?c[0].text:c),a.tool_calls=d,a}return c.length>0?{role:b,content:1===c.length&&"text"===c[0].type?c[0].text:c}:null}(a);b&&d.messages.push(b)}if(b.tools&&Array.isArray(b.tools)){for(let a of(d.tools=[],b.tools))if(a.functionDeclarations)for(let b of a.functionDeclarations)d.tools.push({type:"function",function:{name:b.name,description:b.description||"",parameters:b.parameters||{type:"object",properties:{}}}})}return d}(0,d.kz)(e.h.GEMINI,e.h.OPENAI,g,null),(0,d.kz)(e.h.GEMINI_CLI,e.h.OPENAI,g,null)},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{#a$=new Map;constructor(){arguments[0]!==g&&e.illegalConstructor(),e.util.markAsUncloneable(this)}async match(a,b={}){if(e.brandCheck(this,h),e.argumentLengthCheck(arguments,1,"CacheStorage.match"),a=e.converters.RequestInfo(a),null!=(b=e.converters.MultiCacheQueryOptions(b)).cacheName){if(this.#a$.has(b.cacheName)){let c=new d(g,this.#a$.get(b.cacheName));return await c.match(a,b)}}else for(let c of this.#a$.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,h);let b="CacheStorage.has";return e.argumentLengthCheck(arguments,1,b),a=e.converters.DOMString(a,b,"cacheName"),this.#a$.has(a)}async open(a){e.brandCheck(this,h);let b="CacheStorage.open";if(e.argumentLengthCheck(arguments,1,b),a=e.converters.DOMString(a,b,"cacheName"),this.#a$.has(a))return new d(g,this.#a$.get(a));let c=[];return this.#a$.set(a,c),new d(g,c)}async delete(a){e.brandCheck(this,h);let b="CacheStorage.delete";return e.argumentLengthCheck(arguments,1,b),a=e.converters.DOMString(a,b,"cacheName"),this.#a$.delete(a)}async keys(){return e.brandCheck(this,h),[...this.#a$.keys()]}}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"),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"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent"),kSocks5ProxyAgent:Symbol("socks5 proxy agent")}},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{#a_;constructor(){arguments[0]!==e&&j.illegalConstructor(),j.util.markAsUncloneable(this),this.#a_=arguments[1]}async match(a,b={}){j.brandCheck(this,t);let c="Cache.match";j.argumentLengthCheck(arguments,1,c),a=j.converters.RequestInfo(a),b=j.converters.CacheQueryOptions(b,c,"options");let d=this.#a0(a,b,1);if(0!==d.length)return d[0]}async matchAll(a,b={}){return j.brandCheck(this,t),void 0!==a&&(a=j.converters.RequestInfo(a)),b=j.converters.CacheQueryOptions(b,"Cache.matchAll","options"),this.#a0(a,b)}async add(a){j.brandCheck(this,t),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,t);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}}},processResponseEndOfBody(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.#a1(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,t);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 u=Promise.withResolvers(),v=null;try{this.#a1(l)}catch(a){v=a}return queueMicrotask(()=>{null===v?u.resolve():u.reject(v)}),u.promise}async delete(a,b={}){let c;j.brandCheck(this,t);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.#a1(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,t),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.#a_)e.push(a[0]);else for(let a of this.#a2(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}#a1(a){let b=this.#a_,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.#a2(c.request,c.options,e).length)throw new DOMException("???","InvalidStateError");if("delete"===c.type){if(a=this.#a2(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.#a2(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.#a_.length=0,this.#a_=c,a}}#a2(a,b,c){let d=[];for(let e of c??this.#a_){let[c,f]=e;this.#a3(a,c,f,b)&&d.push(e)}return d}#a3(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}#a0(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.#a_)e.push(a[1]);else for(let a of this.#a2(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)}}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}},50270:(a,b,c)=>{"use strict";c.r(b),c.d(b,{openaiToAntigravityResponse:()=>f});var d=c(56294),e=c(42541);function f(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:g(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=[];if(d.reasoning_content&&f.push({thought:!0,text:d.reasoning_content}),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=g(j)),{response:i}}function g(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}(0,d.kz)(e.h.OPENAI,e.h.ANTIGRAVITY,null,f)},50294:(a,b,c)=>{"use strict";c.d(b,{R:()=>j});var d=c(66678),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})},51525:(a,b,c)=>{"use strict";c(76816)},51529:(a,b,c)=>{},51658:(a,b,c)=>{"use strict";c(42541),c(56294),c(43212),c(11484),c(64323),c(83651),c(72610),c(51525)},51705:(a,b,c)=>{"use strict";a.exports=c.p+"static/media/server.f66733f4.js"},51753:(a,b,c)=>{"use strict";let{webidl:d}=c(32984),{kEnumerableProperty:e}=c(84285),{kConstruct:f}=c(49176);class g extends Event{#a4;constructor(a,b={}){if(a===f){super(arguments[1],arguments[2]),d.util.markAsUncloneable(this);return}const c="MessageEvent constructor";d.argumentLengthCheck(arguments,1,c),super(a=d.converters.DOMString(a,c,"type"),b=d.converters.MessageEventInit(b,c,"eventInitDict")),this.#a4=b,d.util.markAsUncloneable(this)}get data(){return d.brandCheck(this,g),this.#a4.data}get origin(){return d.brandCheck(this,g),this.#a4.origin}get lastEventId(){return d.brandCheck(this,g),this.#a4.lastEventId}get source(){return d.brandCheck(this,g),this.#a4.source}get ports(){return d.brandCheck(this,g),Object.isFrozen(this.#a4.ports)||Object.freeze(this.#a4.ports),this.#a4.ports}initMessageEvent(a,b=!1,c=!1,e=null,f="",h="",i=null,j=[]){return d.brandCheck(this,g),d.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new g(a,{bubbles:b,cancelable:c,data:e,origin:f,lastEventId:h,source:i,ports:j})}static createFastMessageEvent(a,b){let c=new g(f,a,b);return c.#a4=b,c.#a4.data??=null,c.#a4.origin??="",c.#a4.lastEventId??="",c.#a4.source??=null,c.#a4.ports??=[],c}}let{createFastMessageEvent:h}=g;delete g.createFastMessageEvent;class i extends Event{#a4;constructor(a,b={}){const c="CloseEvent constructor";d.argumentLengthCheck(arguments,1,c),super(a=d.converters.DOMString(a,c,"type"),b=d.converters.CloseEventInit(b)),this.#a4=b,d.util.markAsUncloneable(this)}get wasClean(){return d.brandCheck(this,i),this.#a4.wasClean}get code(){return d.brandCheck(this,i),this.#a4.code}get reason(){return d.brandCheck(this,i),this.#a4.reason}}class j extends Event{#a4;constructor(a,b){const c="ErrorEvent constructor";d.argumentLengthCheck(arguments,1,c),super(a,b),d.util.markAsUncloneable(this),a=d.converters.DOMString(a,c,"type"),b=d.converters.ErrorEventInit(b??{}),this.#a4=b}get message(){return d.brandCheck(this,j),this.#a4.message}get filename(){return d.brandCheck(this,j),this.#a4.filename}get lineno(){return d.brandCheck(this,j),this.#a4.lineno}get colno(){return d.brandCheck(this,j),this.#a4.colno}get error(){return d.brandCheck(this,j),this.#a4.error}}Object.defineProperties(g.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:e,origin:e,lastEventId:e,source:e,ports:e,initMessageEvent:e}),Object.defineProperties(i.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:e,code:e,wasClean:e}),Object.defineProperties(j.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:e,filename:e,lineno:e,colno:e,error:e}),d.converters.MessagePort=d.interfaceConverter(d.is.MessagePort,"MessagePort"),d.converters["sequence<MessagePort>"]=d.sequenceConverter(d.converters.MessagePort);let k=[{key:"bubbles",converter:d.converters.boolean,defaultValue:()=>!1},{key:"cancelable",converter:d.converters.boolean,defaultValue:()=>!1},{key:"composed",converter:d.converters.boolean,defaultValue:()=>!1}];d.converters.MessageEventInit=d.dictionaryConverter([...k,{key:"data",converter:d.converters.any,defaultValue:()=>null},{key:"origin",converter:d.converters.USVString,defaultValue:()=>""},{key:"lastEventId",converter:d.converters.DOMString,defaultValue:()=>""},{key:"source",converter:d.nullableConverter(d.converters.MessagePort),defaultValue:()=>null},{key:"ports",converter:d.converters["sequence<MessagePort>"],defaultValue:()=>[]}]),d.converters.CloseEventInit=d.dictionaryConverter([...k,{key:"wasClean",converter:d.converters.boolean,defaultValue:()=>!1},{key:"code",converter:d.converters["unsigned short"],defaultValue:()=>0},{key:"reason",converter:d.converters.USVString,defaultValue:()=>""}]),d.converters.ErrorEventInit=d.dictionaryConverter([...k,{key:"message",converter:d.converters.DOMString,defaultValue:()=>""},{key:"filename",converter:d.converters.USVString,defaultValue:()=>""},{key:"lineno",converter:d.converters["unsigned long"],defaultValue:()=>0},{key:"colno",converter:d.converters["unsigned long"],defaultValue:()=>0},{key:"error",converter:d.converters.any}]),a.exports={MessageEvent:g,CloseEvent:i,ErrorEvent:j,createFastMessageEvent:h}},52039:(a,b,c)=>{"use strict";let{isArrayBuffer:d}=c(73429),{webidl:e}=c(32984),{URLSerializer:f}=c(16537),{environmentSettingsObject:g}=c(42425),{staticPropertyDescriptors:h,states:i,sentCloseFrameState:j,sendHints:k,opcodes:l}=c(62026),{isConnecting:m,isEstablished:n,isClosing:o,isClosed:p,isValidSubprotocol:q,fireEvent:r,utf8Decode:s,toArrayBuffer:t,getURLRecord:u}=c(94050),{establishWebSocketConnection:v,closeWebSocketConnection:w,failWebsocketConnection:x}=c(4654),{ByteParser:y}=c(64821),{kEnumerableProperty:z}=c(84285),{getGlobalDispatcher:A}=c(59970),{ErrorEvent:B,CloseEvent:C,createFastMessageEvent:D}=c(51753),{SendQueue:E}=c(54849),{WebsocketFrameSend:F}=c(45221),{channels:G}=c(62571),H=Symbol.for("nodejs.ref"),I=Symbol.for("nodejs.unref");class J extends EventTarget{#aR={open:null,error:null,close:null,message:null};#a5=0;#a6="";#a7="";#a8=!0;#a9;#ay={onConnectionEstablished:(a,b)=>this.#az(a,b),onMessage:(a,b)=>this.#aA(a,b),onParserError:a=>x(this.#ay,null,a.message),onParserDrain:()=>this.#ba(),onSocketData:a=>{this.#aB.write(a)||this.#ay.socket.pause()},onSocketError:a=>{this.#ay.readyState=i.CLOSING,G.socketError.hasSubscribers&&G.socketError.publish(a),this.#ay.socket.destroy()},onSocketClose:()=>this.#aC(),onPing:a=>{G.ping.hasSubscribers&&G.ping.publish({payload:a,websocket:this})},onPong:a=>{G.pong.hasSubscribers&&G.pong.publish({payload:a,websocket:this})},readyState:i.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#ar;#bb;#aB;constructor(a,b=[]){super(),e.util.markAsUncloneable(this);const c="WebSocket constructor";e.argumentLengthCheck(arguments,1,c);const d=e.converters["DOMString or sequence<DOMString> or WebSocketInit"](b,c,"options");a=e.converters.USVString(a),b=d.protocols;const f=u(a,g.settingsObject.baseUrl);if("string"==typeof b&&(b=[b]),b.length!==new Set(b.map(a=>a.toLowerCase())).size||b.length>0&&!b.every(a=>q(a)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#ar=new URL(f.href);const h=g.settingsObject;this.#ay.controller=v(f,b,h,this.#ay,d),this.#ay.readyState=J.CONNECTING,this.#bb="blob"}[H](){e.brandCheck(this,J),this.#a8=!0,this.#ay.socket?.ref?.()}[I](){e.brandCheck(this,J),this.#a8=!1,this.#ay.socket?.unref?.()}close(a,b){e.brandCheck(this,J),void 0!==a&&(a=e.converters["unsigned short"](a,"WebSocket.close","code",e.attributes.Clamp)),void 0!==b&&(b=e.converters.USVString(b)),a??=null,b??="",w(this.#ay,a,b,!0)}send(a){e.brandCheck(this,J);let b="WebSocket.send";if(e.argumentLengthCheck(arguments,1,b),a=e.converters.WebSocketSendData(a,b,"data"),m(this.#ay.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!n(this.#ay.readyState)||o(this.#ay.readyState)))if("string"==typeof a){let b=Buffer.from(a);this.#a5+=b.byteLength,this.#a9.add(b,()=>{this.#a5-=b.byteLength},k.text)}else d(a)?(this.#a5+=a.byteLength,this.#a9.add(a,()=>{this.#a5-=a.byteLength},k.arrayBuffer)):ArrayBuffer.isView(a)?(this.#a5+=a.byteLength,this.#a9.add(a,()=>{this.#a5-=a.byteLength},k.typedArray)):e.is.Blob(a)&&(this.#a5+=a.size,this.#a9.add(a,()=>{this.#a5-=a.size},k.blob))}get readyState(){return e.brandCheck(this,J),this.#ay.readyState}get bufferedAmount(){return e.brandCheck(this,J),this.#a5}get url(){return e.brandCheck(this,J),f(this.#ar)}get extensions(){return e.brandCheck(this,J),this.#a7}get protocol(){return e.brandCheck(this,J),this.#a6}get onopen(){return e.brandCheck(this,J),this.#aR.open}set onopen(a){e.brandCheck(this,J),this.#aR.open&&this.removeEventListener("open",this.#aR.open);let b=e.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("open",b),this.#aR.open=a):this.#aR.open=null}get onerror(){return e.brandCheck(this,J),this.#aR.error}set onerror(a){e.brandCheck(this,J),this.#aR.error&&this.removeEventListener("error",this.#aR.error);let b=e.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("error",b),this.#aR.error=a):this.#aR.error=null}get onclose(){return e.brandCheck(this,J),this.#aR.close}set onclose(a){e.brandCheck(this,J),this.#aR.close&&this.removeEventListener("close",this.#aR.close);let b=e.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("close",b),this.#aR.close=a):this.#aR.close=null}get onmessage(){return e.brandCheck(this,J),this.#aR.message}set onmessage(a){e.brandCheck(this,J),this.#aR.message&&this.removeEventListener("message",this.#aR.message);let b=e.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("message",b),this.#aR.message=a):this.#aR.message=null}get binaryType(){return e.brandCheck(this,J),this.#bb}set binaryType(a){e.brandCheck(this,J),"blob"!==a&&"arraybuffer"!==a?this.#bb="blob":this.#bb=a}#az(a,b){this.#ay.socket=a.socket,this.#a8||this.#ay.socket.unref?.();let c=this.#ay.controller.dispatcher?.webSocketOptions?.maxFragments,d=this.#ay.controller.dispatcher?.webSocketOptions?.maxPayloadSize,e=new y(this.#ay,b,{maxFragments:c,maxPayloadSize:d});e.on("drain",()=>this.#ay.onParserDrain()),e.on("error",a=>this.#ay.onParserError(a)),this.#aB=e,this.#a9=new E(a.socket),this.#ay.readyState=i.OPEN;let f=a.headersList.get("sec-websocket-extensions");null!==f&&(this.#a7=f);let g=a.headersList.get("sec-websocket-protocol");if(null!==g&&(this.#a6=g),r("open",this),G.open.hasSubscribers){var h;let b=a.headersList.entries;G.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.#a6,extensions:this.#a7,websocket:this,handshakeResponse:{status:a.status,statusText:a.statusText,headers:b}})}}#aA(a,b){let c;if(this.#ay.readyState===i.OPEN){if(a===l.TEXT)try{c=s(b)}catch{x(this.#ay,1007,"Received invalid UTF-8 in text frame.");return}else a===l.BINARY&&(c="blob"===this.#bb?new Blob([b]):t(b));r("message",this,D,{origin:this.#ar.origin,data:c})}}#ba(){this.#ay.socket.resume()}#aC(){let a=this.#ay.closeState.has(j.SENT)&&this.#ay.closeState.has(j.RECEIVED),b=1005,c="",d=this.#aB?.closingInfo;d&&!d.error&&(b=d.code??1005,c=d.reason),this.#ay.readyState=i.CLOSED,this.#ay.closeState.has(j.RECEIVED)||(b=1006,r("error",this,(a,b)=>new B(a,b),{error:TypeError(c)})),r("close",this,(a,b)=>new C(a,b),{wasClean:a,code:b,reason:c}),G.close.hasSubscribers&&G.close.publish({websocket:this,code:b,reason:c})}static ping(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.#ay.readyState;if(n(c)&&!o(c)&&!p(c)){let c=new F(b);a.#ay.socket.write(c.createFrame(l.PING))}}}let{ping:K}=J;Reflect.deleteProperty(J,"ping"),J.CONNECTING=J.prototype.CONNECTING=i.CONNECTING,J.OPEN=J.prototype.OPEN=i.OPEN,J.CLOSING=J.prototype.CLOSING=i.CLOSING,J.CLOSED=J.prototype.CLOSED=i.CLOSED,Object.defineProperties(J.prototype,{CONNECTING:h,OPEN:h,CLOSING:h,CLOSED:h,url:z,readyState:z,bufferedAmount:z,onopen:z,onerror:z,onclose:z,close:z,onmessage:z,binaryType:z,send:z,extensions:z,protocol:z,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}}),Object.defineProperties(J,{CONNECTING:h,OPEN:h,CLOSING:h,CLOSED:h}),e.converters["sequence<DOMString>"]=e.sequenceConverter(e.converters.DOMString),e.converters["DOMString or sequence<DOMString>"]=function(a,b,c){return e.util.Type(a)===e.util.Types.OBJECT&&Symbol.iterator in a?e.converters["sequence<DOMString>"](a):e.converters.DOMString(a,b,c)},e.converters.WebSocketInit=e.dictionaryConverter([{key:"protocols",converter:e.converters["DOMString or sequence<DOMString>"],defaultValue:()=>[]},{key:"dispatcher",converter:e.converters.any,defaultValue:()=>A()},{key:"headers",converter:e.nullableConverter(e.converters.HeadersInit)}]),e.converters["DOMString or sequence<DOMString> or WebSocketInit"]=function(a){return e.util.Type(a)!==e.util.Types.OBJECT||Symbol.iterator in a?{protocols:e.converters["DOMString or sequence<DOMString>"](a)}:e.converters.WebSocketInit(a)},e.converters.WebSocketSendData=function(a){return e.util.Type(a)===e.util.Types.OBJECT&&(e.is.Blob(a)||e.is.BufferSource(a))?a:e.converters.USVString(a)},a.exports={WebSocket:J,ping:K}},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");const{maxConcurrentStreams:c,pipelining:e,...f}=b??{},g=c??100;let 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}}()},54838:(a,b,c)=>{"use strict";c.d(b,{$D:()=>p,Oj:()=>g,ZF:()=>m,Zm:()=>f,aZ:()=>q,gI:()=>l,h3:()=>h,rG:()=>k});let d="-agentic",e="-thinking",f=64,g=10237,h=64,i=new Set(["1","true","yes","on"]),j=new Set(["0","false","no","off"]),k=`
296
+ `}async function n(a,b,c,d,e,f){let g="",h="",i=[];for await(let b of l(a,e,f)){if(b.fingerprint&&(h=b.fingerprint),b.error)return new Response(JSON.stringify({error:{message:b.error,type:"upstream_error",code:"GROK_ERROR"}}),{status:502,headers:{"Content-Type":"application/json"}});if(b.thinking){i.push(b.thinking);continue}if(b.done)break;b.fullMessage?g=b.fullMessage:b.delta&&(g+=b.delta)}let j={role:"assistant",content:g};i.length>0&&(j.reasoning_content=i.join("\n"));let k=Math.ceil(g.length/4),m=Math.ceil(g.length/4);return new Response(JSON.stringify({id:c,object:"chat.completion",created:d,model:b,system_fingerprint:h||null,choices:[{index:0,message:j,finish_reason:"stop",logprobs:null}],usage:{prompt_tokens:k,completion_tokens:m,total_tokens:k+m}}),{status:200,headers:{"Content-Type":"application/json"}})}class o extends d.Hv{constructor(){super("grok-web",e.xq["grok-web"])}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:k}){let o,p,q=b?.messages;if(!q||!Array.isArray(q)||0===q.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};let r=h[a];r||k?.info?.("GROK-WEB",`Unmapped model ${a}, defaulting to grok-4.1-fast`);let{grokModel:s,modelMode:t,isThinking:u}=r||h["grok-4.1-fast"],v=function(a){let b=[];for(let c of a){let a=String(c.role||"user");"developer"===a&&(a="system");let d="";"string"==typeof c.content?d=c.content:Array.isArray(c.content)&&(d=c.content.filter(a=>"text"===a.type).map(a=>String(a.text||"")).join(" ")),d.trim()&&b.push({role:a,text:d})}let c=-1;for(let a=b.length-1;a>=0;a--)if("user"===b[a].role){c=a;break}let d=[];for(let a=0;a<b.length;a++){let{role:e,text:f}=b[a];d.push(a===c?f:`${e}: ${f}`)}return d.join("\n\n")}(q);if(!v.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 w={temporary:!0,modelName:s,modelMode:t,message:v,fileAttachments:[],imageAttachments:[],disableSearch:!1,enableImageGeneration:!1,returnImageBytes:!1,returnRawGrokInXaiRequest:!1,enableImageStreaming:!1,imageGenerationCount:0,forceConcise:!1,toolOverrides:{},enableSideBySide:!0,sendFinalMetadata:!0,isReasoning:!1,disableTextFollowUps:!1,disableMemory:!0,forceSideBySide:!1,isAsyncChat:!1,disableSelfHarmShortCircuit:!1,deviceEnvInfo:{darkModeEnabled:!1,devicePixelRatio:2,screenWidth:2056,screenHeight:1329,viewportWidth:2056,viewportHeight:1083}},x=j(16),y=j(8),z={Accept:"*/*","Accept-Encoding":"gzip, deflate, br, zstd","Accept-Language":"en-US,en;q=0.9",Baggage:"sentry-environment=production,sentry-release=d6add6fb0460641fd482d767a335ef72b9b6abb8,sentry-public_key=b311e0f2690c81f25e2c4cf6d4f7ce1c","Cache-Control":"no-cache","Content-Type":"application/json",Origin:"https://grok.com",Pragma:"no-cache",Referer:"https://grok.com/","Sec-Ch-Ua":'"Google Chrome";v="136", "Chromium";v="136", "Not(A:Brand";v="24"',"Sec-Ch-Ua-Mobile":"?0","Sec-Ch-Ua-Platform":'"macOS"',"Sec-Fetch-Dest":"empty","Sec-Fetch-Mode":"cors","Sec-Fetch-Site":"same-origin","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36","x-statsig-id":btoa(.5>Math.random()?`e:TypeError: Cannot read properties of null (reading 'children["${i(5,!0)}"]')`:`e:TypeError: Cannot read properties of undefined (reading '${i(10)}')`),"x-xai-request-id":crypto.randomUUID(),traceparent:`00-${x}-${y}-00`};if(d.apiKey){let a=d.apiKey;a.startsWith("sso=")&&(a=a.slice(4)),z.Cookie=`sso=${a}`}k?.info?.("GROK-WEB",`Query to ${a} (grok=${s}, mode=${t}), len=${v.length}`);try{o=await fetch(g,{method:"POST",headers:z,body:JSON.stringify(w),signal:e})}catch(a){return k?.error?.("GROK-WEB",`Fetch failed: ${a.message||String(a)}`),{response:new Response(JSON.stringify({error:{message:`Grok connection failed: ${a.message||String(a)}`,type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:g,headers:z,transformedBody:w}}if(!o.ok){let a=o.status,b=`Grok returned HTTP ${a}`;return 401===a||403===a?b="Grok auth failed — SSO cookie may be expired. Re-paste your sso cookie value from grok.com.":429===a&&(b="Grok rate limited. Wait a moment and retry, or rotate cookies."),k?.warn?.("GROK-WEB",b),await (0,f.aI)(o),{response:new Response(JSON.stringify({error:{message:b,type:"upstream_error",code:`HTTP_${a}`}}),{status:a,headers:{"Content-Type":"application/json"}}),url:g,headers:z,transformedBody:w}}if(!o.body)return{response:new Response(JSON.stringify({error:{message:"Grok returned empty response body",type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:g,headers:z,transformedBody:w};let A=`chatcmpl-grok-${crypto.randomUUID().slice(0,12)}`,B=Math.floor(Date.now()/1e3);if(c){var C;let b;p=new Response((C=o.body,b=new TextEncoder,new ReadableStream({async start(c){try{c.enqueue(b.encode(m({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:null,choices:[{index:0,delta:{role:"assistant"},finish_reason:null,logprobs:null}]})));let d="";for await(let f of l(C,u,e)){if(f.fingerprint&&(d=f.fingerprint),f.error){c.enqueue(b.encode(m({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{content:`[Error: ${f.error}]`},finish_reason:null,logprobs:null}]})));break}if(f.thinking){c.enqueue(b.encode(m({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{reasoning_content:f.thinking},finish_reason:null,logprobs:null}]})));continue}if(f.done)break;f.delta&&c.enqueue(b.encode(m({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{content:f.delta},finish_reason:null,logprobs:null}]})))}c.enqueue(b.encode(m({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode("data: [DONE]\n\n"))}catch(d){c.enqueue(b.encode(m({id:A,object:"chat.completion.chunk",created:B,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 p=await n(o.body,a,A,B,u,e);return{response:p,url:g,headers:z,transformedBody:w}}}},42425:(a,b,c)=>{"use strict";let{Transform:d}=c(57075),e=c(38522),{redirectStatusSet:f,referrerPolicyTokens:g,badPortsSet:h}=c(19608),{getGlobalOrigin:i}=c(79412),{collectAnHTTPQuotedString:j,parseMIMEType:k}=c(16537),{performance:l}=c(643),{ReadableStreamFrom:m,isValidHTTPToken:n,normalizedMethodRecordsBase:o}=c(84285),p=c(34589),{isUint8Array:q}=c(73429),{webidl:r}=c(32984),{isomorphicEncode:s,collectASequenceOfCodePoints:t,removeChars:u}=c(70745);function v(a){let b=a.urlList,c=b.length;return 0===c?null:b[c-1].toString()}function w(a){for(let b=0;b<a.length;++b){let c=a.charCodeAt(b);if(c>126||c<32)return!1}return!0}function x(a){return a.urlList[a.urlList.length-1]}function y(a){return!1===(" "===a[0]||" "===a[0]||" "===a[a.length-1]||" "===a[a.length-1]||a.includes("\n")||a.includes("\r")||a.includes("\0"))}function z(){return{referrerPolicy:"strict-origin-when-cross-origin"}}function A(a,b=!1){return(p(r.is.URL(a)),J(a=new URL(a)))?"no-referrer":(a.username="",a.password="",a.hash="",!0===b&&(a.pathname="",a.search=""),a)}let B=RegExp.prototype.test.bind(/^127\.(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){2}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)$/),C=RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);function D(a){return a.includes(":")?("["===a[0]&&"]"===a[a.length-1]&&(a=a.slice(1,-1)),C(a)):B(a)}function E(a){var b;return!!r.is.URL(a)&&("about:blank"===a.href||"about:srcdoc"===a.href||"data:"===a.protocol||"blob:"===a.protocol||null!=(b=a.origin)&&"null"!==b&&(!!("https:"===(b=new URL(b)).protocol||"wss:"===b.protocol||D(b.hostname)||"localhost"===b.hostname||"localhost."===b.hostname||b.hostname.endsWith(".localhost")||b.hostname.endsWith(".localhost."))||"file:"===b.protocol))}function F(a,b){return a.origin===b.origin&&"null"===a.origin||a.protocol===b.protocol&&a.hostname===b.hostname&&a.port===b.port}let G=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function H(a,b,c=0,d=1){class e{#an;#ao;#ap;constructor(a,b){this.#an=a,this.#ao=b,this.#ap=0}next(){let e;if("object"!=typeof this||this===null||!(#an in this))throw TypeError(`'next' called on an object that does not implement interface ${a} Iterator.`);let f=this.#ap,g=b(this.#an);if(f>=g.length)return{value:void 0,done:!0};let{[c]:h,[d]:i}=g[f];switch(this.#ap=f+1,this.#ao){case"key":e=h;break;case"value":e=i;break;case"key+value":e=[h,i]}return{value:e,done:!1}}}return delete e.prototype.constructor,Object.setPrototypeOf(e.prototype,G),Object.defineProperties(e.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${a} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(a,b){return new e(a,b)}}async function I(a,b,c){try{let d=[],e=0;for(;;){let{done:f,value:g}=await a.read();if(f)return void b(Buffer.concat(d,e));if(!q(g))return void c(TypeError("Received non-Uint8Array chunk"));d.push(g),e+=g.length}}catch(a){c(a)}}function J(a){p("protocol"in a);let b=a.protocol;return"about:"===b||"blob:"===b||"data:"===b}function K(a){return"string"==typeof a&&":"===a[5]&&"h"===a[0]&&"t"===a[1]&&"t"===a[2]&&"p"===a[3]&&"s"===a[4]||"https:"===a.protocol}function L(a){p("protocol"in a);let b=a.protocol;return"http:"===b||"https:"===b}class M extends d{#aq;constructor(a){super(),this.#aq=a}_transform(a,b,c){if(!this._inflateStream){if(0===a.length)return void c();this._inflateStream=(15&a[0])==8?e.createInflate(this.#aq):e.createInflateRaw(this.#aq),this._inflateStream.on("data",this.push.bind(this)),this._inflateStream.on("end",()=>this.push(null)),this._inflateStream.on("error",a=>this.destroy(a))}this._inflateStream.write(a,b,c)}_final(a){this._inflateStream&&(this._inflateStream.end(),this._inflateStream=null),a()}}function N(a,b){let c=b.get(a,!0);if(null===c)return null;let d={position:0},e=[],f="";for(;d.position<c.length;){if(f+=t(a=>'"'!==a&&","!==a,c,d),d.position<c.length)if(34===c.charCodeAt(d.position)){if(f+=j(c,d),d.position<c.length)continue}else p(44===c.charCodeAt(d.position)),d.position++;f=u(f,!0,!0,a=>9===a||32===a),e.push(f),f=""}return e}class O{get baseUrl(){return i()}get origin(){return this.baseUrl?.origin}policyContainer=z()}class P{settingsObject=new O}a.exports={isAborted:function(a){return"aborted"===a.controller.state},isCancelled:function(a){return"aborted"===a.controller.state||"terminated"===a.controller.state},isValidEncodedURL:w,ReadableStreamFrom:m,tryUpgradeRequestToAPotentiallyTrustworthyURL:function(a){},clampAndCoarsenConnectionTimingInfo:function(a,b,c){return!a?.startTime||a.startTime<b?{domainLookupStartTime:b,domainLookupEndTime:b,connectionStartTime:b,connectionEndTime:b,secureConnectionStartTime:b,ALPNNegotiatedProtocol:a?.ALPNNegotiatedProtocol}:{domainLookupStartTime:a.domainLookupStartTime,domainLookupEndTime:a.domainLookupEndTime,connectionStartTime:a.connectionStartTime,connectionEndTime:a.connectionEndTime,secureConnectionStartTime:a.secureConnectionStartTime,ALPNNegotiatedProtocol:a.ALPNNegotiatedProtocol}},coarsenedSharedCurrentTime:function(a){return l.now()},determineRequestsReferrer:function(a){let b=a.referrerPolicy;p(b);let c=null;if("client"===a.referrer){let a=i();if(!a||"null"===a.origin)return"no-referrer";c=new URL(a)}else r.is.URL(a.referrer)&&(c=a.referrer);let d=A(c),e=A(c,!0);switch(d.toString().length>4096&&(d=e),b){case"no-referrer":return"no-referrer";case"origin":if(null!=e)return e;return A(c,!0);case"unsafe-url":return d;case"strict-origin":{let b=x(a);if(E(d)&&!E(b))return"no-referrer";return e}case"strict-origin-when-cross-origin":{let b=x(a);if(F(d,b))return d;if(E(d)&&!E(b))return"no-referrer";return e}case"same-origin":if(F(a,d))return d;return"no-referrer";case"origin-when-cross-origin":if(F(a,d))return d;return e;case"no-referrer-when-downgrade":{let b=x(a);if(E(d)&&!E(b))return"no-referrer";return d}}},makePolicyContainer:z,clonePolicyContainer:function(a){return{referrerPolicy:a.referrerPolicy}},appendFetchMetadata:function(a){let b=null;b=a.mode,a.headersList.set("sec-fetch-mode",b,!0)},appendRequestOriginHeader:function(a){let b=a.origin;if("client"!==b&&void 0!==b){if("cors"===a.responseTainting||"websocket"===a.mode)a.headersList.append("origin",b,!0);else if("GET"!==a.method&&"HEAD"!==a.method){switch(a.referrerPolicy){case"no-referrer":b=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":a.origin&&K(a.origin)&&!K(x(a))&&(b=null);break;case"same-origin":F(a,x(a))||(b=null)}a.headersList.append("origin",b,!0)}}},TAOCheck:function(){return"success"},corsCheck:function(){return"success"},crossOriginResourcePolicyCheck:function(){return"allowed"},createOpaqueTimingInfo:function(a){return{startTime:a.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:a.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}},setRequestReferrerPolicyOnRedirect:function(a,b){let c=function(a){let b=(a.headersList.get("referrer-policy",!0)??"").split(","),c="";if(b.length)for(let a=b.length;0!==a;a--){let d=b[a-1].trim();if(g.has(d)){c=d;break}}return c}(b);""!==c&&(a.referrerPolicy=c)},isValidHTTPToken:n,requestBadPort:function(a){let b=x(a);return L(b)&&h.has(b.port)?"blocked":"allowed"},requestCurrentURL:x,responseURL:v,responseLocationURL:function(a,b){var c;if(!f.has(a.status))return null;let d=a.headersList.get("location",!0);return null!==d&&y(d)&&(w(d)||(c=d,d=Buffer.from(c,"binary").toString("utf8")),d=new URL(d,v(a))),d&&!d.hash&&(d.hash=b),d},isURLPotentiallyTrustworthy:E,isValidReasonPhrase:function(a){for(let b=0;b<a.length;++b){let c=a.charCodeAt(b);if(!(9===c||c>=32&&c<=126||c>=128&&c<=255))return!1}return!0},sameOrigin:F,normalizeMethod:function(a){return o[a.toLowerCase()]??a},iteratorMixin:function(a,b,c,d=0,e=1){let f=H(a,c,d,e),g={keys:{writable:!0,enumerable:!0,configurable:!0,value:function(){return r.brandCheck(this,b),f(this,"key")}},values:{writable:!0,enumerable:!0,configurable:!0,value:function(){return r.brandCheck(this,b),f(this,"value")}},entries:{writable:!0,enumerable:!0,configurable:!0,value:function(){return r.brandCheck(this,b),f(this,"key+value")}},forEach:{writable:!0,enumerable:!0,configurable:!0,value:function(c,d=globalThis){if(r.brandCheck(this,b),r.argumentLengthCheck(arguments,1,`${a}.forEach`),"function"!=typeof c)throw TypeError(`Failed to execute 'forEach' on '${a}': parameter 1 is not of type 'Function'.`);for(let{0:a,1:b}of f(this,"key+value"))c.call(d,b,a,this)}}};return Object.defineProperties(b.prototype,{...g,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:g.entries.value}})},createIterator:H,isValidHeaderName:n,isValidHeaderValue:y,isErrorLike:function(a){return a instanceof Error||a?.constructor?.name==="Error"||a?.constructor?.name==="DOMException"},fullyReadBody:function(a,b,c){try{let d=a.stream.getReader();I(d,b,c)}catch(a){c(a)}},readableStreamClose:function(a){try{a.close(),a.byobRequest?.respond(0)}catch(a){if(!a.message.includes("Controller is already closed")&&!a.message.includes("ReadableStream is already closed"))throw a}},urlIsLocal:J,urlHasHttpsScheme:K,urlIsHttpHttpsScheme:L,readAllBytes:I,simpleRangeHeaderValue:function(a,b){if(!a.startsWith("bytes"))return"failure";let c={position:5};if(b&&t(a=>" "===a||" "===a,a,c),61!==a.charCodeAt(c.position))return"failure";c.position++,b&&t(a=>" "===a||" "===a,a,c);let d=t(a=>{let b=a.charCodeAt(0);return b>=48&&b<=57},a,c),e=d.length?Number(d):null;if(b&&t(a=>" "===a||" "===a,a,c),45!==a.charCodeAt(c.position))return"failure";c.position++,b&&t(a=>" "===a||" "===a,a,c);let f=t(a=>{let b=a.charCodeAt(0);return b>=48&&b<=57},a,c),g=f.length?Number(f):null;return c.position<a.length||null===g&&null===e||null!==e&&null!==g&&e>g?"failure":{rangeStartValue:e,rangeEndValue:g}},buildContentRange:function(a,b,c){let d="bytes ";return d+=s(`${a}`),d+="-",d+=s(`${b}`),d+="/",d+=s(`${c}`)},createInflate:function(a){return new M(a)},extractMimeType:function(a){let b=null,c=null,d=null,e=N("content-type",a);if(null===e)return"failure";for(let a of e){let e=k(a);"failure"!==e&&"*/*"!==e.essence&&((d=e).essence!==c?(b=null,d.parameters.has("charset")&&(b=d.parameters.get("charset")),c=d.essence):d.parameters.has("charset")||null===b||d.parameters.set("charset",b))}return null==d?"failure":d},getDecodeSplit:N,environmentSettingsObject:new P,isOriginIPPotentiallyTrustworthy:D,hasAuthenticationEntry:function(a){return!1},includesCredentials:function(a){return!!(a.username||a.password)},isTraversableNavigable:function(a){return null!=a&&"client"!==a&&"no-traversable"!==a}}},42430:(a,b,c)=>{"use strict";let{addAbortListener:d}=c(78474),{environmentSettingsObject:e,readableStreamClose:f}=c(42425),{states:g,opcodes:h,sentCloseFrameState:i}=c(62026),{webidl:j}=c(32984),{getURLRecord:k,isValidSubprotocol:l,isEstablished:m,utf8Decode:n}=c(94050),{establishWebSocketConnection:o,failWebsocketConnection:p,closeWebSocketConnection:q}=c(4654),{channels:r}=c(62571),{WebsocketFrameSend:s}=c(45221),{ByteParser:t}=c(64821),{WebSocketError:u,createUnvalidatedWebSocketError:v}=c(87404),{kEnumerableProperty:w}=c(84285),{utf8DecodeBytes:x}=c(67449),y=!1;class z{#ar;#as;#at;#au;#av;#aw;#ax=!1;#ay={onConnectionEstablished:(a,b)=>this.#az(a,b),onMessage:(a,b)=>this.#aA(a,b),onParserError:a=>p(this.#ay,null,a.message),onParserDrain:()=>this.#ay.socket.resume(),onSocketData:a=>{this.#aB.write(a)||this.#ay.socket.pause()},onSocketError:a=>{this.#ay.readyState=g.CLOSING,r.socketError.hasSubscribers&&r.socketError.publish(a),this.#ay.socket.destroy()},onSocketClose:()=>this.#aC(),onPing:()=>{},onPong:()=>{},readyState:g.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#aB;constructor(a,b){y||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),y=!0),j.argumentLengthCheck(arguments,1,"WebSocket"),a=j.converters.USVString(a),null!==b&&(b=j.converters.WebSocketStreamOptions(b));const c=k(a,e.settingsObject.baseUrl),f=b.protocols;if(f.length!==new Set(f.map(a=>a.toLowerCase())).size||f.length>0&&!f.every(a=>l(a)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#ar=c.toString(),this.#as=Promise.withResolvers(),this.#at=Promise.withResolvers(),null!=b.signal){const a=b.signal;if(a.aborted){this.#as.reject(a.reason),this.#at.reject(a.reason);return}d(a,()=>{m(this.#ay.readyState)||(p(this.#ay),this.#ay.readyState=g.CLOSING,this.#as.reject(a.reason),this.#at.reject(a.reason),this.#ax=!0)})}const h=e.settingsObject;this.#ay.controller=o(c,f,h,this.#ay,b)}get url(){return this.#ar.toString()}get opened(){return this.#as.promise}get closed(){return this.#at.promise}close(a){null!==a&&(a=j.converters.WebSocketCloseInfo(a));let b=a.closeCode??null,c=a.reason;q(this.#ay,b,c,!0)}#aD(a){a=j.converters.WebSocketStreamWrite(a);let b=Promise.withResolvers(),c=null,d=null;if(j.is.BufferSource(a))c=new Uint8Array(ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):a.slice()),d=h.BINARY;else{let e;try{e=j.converters.DOMString(a)}catch(a){return b.reject(a),b.promise}c=new TextEncoder().encode(e),d=h.TEXT}if(!this.#ay.closeState.has(i.SENT)&&!this.#ay.closeState.has(i.RECEIVED)){let a=new s(c);this.#ay.socket.write(a.createFrame(d),()=>{b.resolve(void 0)})}return b.promise}#az(a,b){this.#ay.socket=a.socket;let c=this.#ay.controller.dispatcher?.webSocketOptions?.maxFragments,d=this.#ay.controller.dispatcher?.webSocketOptions?.maxPayloadSize,e=new t(this.#ay,b,{maxFragments:c,maxPayloadSize:d});e.on("drain",()=>this.#ay.onParserDrain()),e.on("error",a=>this.#ay.onParserError(a)),this.#aB=e,this.#ay.readyState=g.OPEN;let f=b??"",h=a.headersList.get("sec-websocket-protocol")??"",i=new ReadableStream({start:a=>{this.#av=a},cancel:a=>this.#aE(a)}),j=new WritableStream({write:a=>this.#aD(a),close:()=>q(this.#ay,null,null),abort:a=>this.#aF(a)});this.#au=i,this.#aw=j,this.#as.resolve({extensions:f,protocol:h,readable:i,writable:j})}#aA(a,b){let c;if(this.#ay.readyState===g.OPEN){if(a===h.TEXT)try{c=n(b)}catch{p(this.#ay,1007,"Received invalid UTF-8 in text frame.");return}else a===h.BINARY&&(c=new Uint8Array(b.buffer,b.byteOffset,b.byteLength));this.#av.enqueue(c)}}#aC(){let a=this.#ay.closeState.has(i.SENT)&&this.#ay.closeState.has(i.RECEIVED);if(this.#ay.readyState=g.CLOSED,this.#ax)return;this.#ay.wasEverConnected||this.#as.reject(new u("Socket never opened"));let b=this.#aB?.closingInfo,c=b?.code??1005;this.#ay.closeState.has(i.SENT)||this.#ay.closeState.has(i.RECEIVED)||(c=1006);let d=b?.reason==null?"":x(Buffer.from(b.reason));if(a)f(this.#av),this.#aw.locked||this.#aw.abort(new DOMException("A closed WebSocketStream cannot be written to","InvalidStateError")),this.#at.resolve({closeCode:c,reason:d});else{let a=v("unclean close",c,d);this.#av?.error(a),this.#aw?.abort(a),this.#at.reject(a)}}#aF(a){let b=null,c="";j.is.WebSocketError(a)&&(b=a.closeCode,c=a.reason),q(this.#ay,b,c)}#aE(a){this.#aF(a)}}Object.defineProperties(z.prototype,{url:w,opened:w,closed:w,close:w,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}}),j.converters.WebSocketStreamOptions=j.dictionaryConverter([{key:"protocols",converter:j.sequenceConverter(j.converters.USVString),defaultValue:()=>[]},{key:"signal",converter:j.nullableConverter(j.converters.AbortSignal),defaultValue:()=>null}]),j.converters.WebSocketCloseInfo=j.dictionaryConverter([{key:"closeCode",converter:a=>j.converters["unsigned short"](a,j.attributes.EnforceRange)},{key:"reason",converter:j.converters.USVString,defaultValue:()=>""}]),j.converters.WebSocketStreamWrite=function(a){return"string"==typeof a?j.converters.USVString(a):j.converters.BufferSource(a)},a.exports={WebSocketStream:z}},42541:(a,b,c)=>{"use strict";c.d(b,{h:()=>d});let d={OPENAI:"openai",OPENAI_RESPONSES:"openai-responses",OPENAI_RESPONSE:"openai-response",CLAUDE:"claude",GEMINI:"gemini",GEMINI_CLI:"gemini-cli",VERTEX:"vertex",CODEX:"codex",ANTIGRAVITY:"antigravity",KIRO:"kiro",CURSOR:"cursor",OLLAMA:"ollama",COMMANDCODE:"commandcode"}},42671:(a,b,c)=>{"use strict";c.r(b),c.d(b,{openaiToAntigravityRequest:()=>I,openaiToGeminiCLIRequest:()=>F,openaiToGeminiRequest:()=>D});var d=c(56294),e=c(42541),f=c(65556),g=c(15822),h=c(13324),i=c(93745),j=c(22067);function k(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 l={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},m={"claude-opus-5":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-5-thinking":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-5-agentic":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-5-thinking-agentic":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.7":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-7":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.8":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-8":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-8-thinking":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-4.6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-thinking":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-agentic":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-thinking-agentic":{vision:!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}},n={vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:272e3,maxOutput:128e3},o={vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:372e3,maxOutput:128e3},p={vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:272e3,maxOutput:128e3},q={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-5.6-sol":o,"gpt-5.6-sol-review":o,"gpt-5.6-terra":p,"gpt-5.6-terra-review":p,"gpt-5.6-luna":p,"gpt-5.6-luna-review":p},kiro:{"gpt-5.6-sol":n,"gpt-5.6-terra":n,"gpt-5.6-luna":n,"gpt-5.6-sol-thinking":n,"gpt-5.6-terra-thinking":n,"gpt-5.6-luna-thinking":n,"gpt-5.6-sol-agentic":n,"gpt-5.6-terra-agentic":n,"gpt-5.6-luna-agentic":n,"gpt-5.6-sol-thinking-agentic":n,"gpt-5.6-terra-thinking-agentic":n,"gpt-5.6-luna-thinking-agentic":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-5.0":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:48e3},"glm-5.0-turbo":{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},"glm-4.7":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:48e3},"minimax-m3":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:512e3,maxOutput:48e3},"minimax-m2.7":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,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},"kimi-k2.5":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:164e3,maxOutput:32e3},"hy3-preview":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:192e3,maxOutput:64e3},"deepseek-v4-pro":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:5e4},"deepseek-v4-flash":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:5e4},"deepseek-v3-2-volc":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:96e3,maxOutput:32e3}},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,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude*opus-4.6*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*opus-4.7*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*opus-4.8*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet-4.6*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet-4.7*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{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,reasoning:!0,search:!0,thinkingFormat:"claude-budget",contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude*mythos*",caps:{vision:!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*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-5*image*",caps:{imageOutput:!0}},{pattern:"*gpt-5*codex*",caps:{reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:4e5,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.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*",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}function t(a,b,c=null){if(!b)return{...l};let d=b.includes("/")?b.split("/").pop():b;if(a){let e=q[a];if(e?.[b])return{...l,...e[b],...s(c)};if(e?.[d])return{...l,...e[d],...s(c)}}if(m[d])return{...l,...m[d],...s(c)};if(m[b])return{...l,...m[b],...s(c)};for(let{pattern:a,caps:e}of r)if(k(a,d)||k(a,b))return{...l,...e,...s(c)};return{...l,...s(c)}}function u(){return crypto.randomUUID()}function v(a){return(0,i.E9)(a?._clientSessionId)||(0,j.a0)(a)}function w(a){if(!a)return"_unknown";let b=a.replace(/[^a-zA-Z0-9_.:\-]/g,"_");return/^[a-zA-Z_]/.test(b)||(b="_"+b),b.substring(0,64)}let x=/^[a-zA-Z_][a-zA-Z0-9_.:\-]{0,63}$/,y=/^[a-zA-Z_][a-zA-Z0-9_\-]{0,63}$/;function z(a){return a?.type==="function"&&a.function?a.function.name:a?.name}function A(a){return w(a).replace(/[.:]/g,"_")}function B(a){let b=[];for(let c of a||[]){if(!c?.role||!Array.isArray(c.parts)||0===c.parts.length)continue;let a=b.at(-1);a?.role===c.role?a.parts.push(...c.parts):b.push({...c,parts:[...c.parts]})}return b.at(-1)?.role==="model"&&b.push({role:"user",parts:[{text:"Please continue."}]}),b}function C(a,b,c,d=f.bf){let e={model:a,contents:[],generationConfig:{},safetySettings:h.fc};void 0!==b.temperature&&(e.generationConfig.temperature=b.temperature),void 0!==b.top_p&&(e.generationConfig.topP=b.top_p),void 0!==b.top_k&&(e.generationConfig.topK=b.top_k);let g=b.max_output_tokens??b.max_completion_tokens??b.max_tokens;void 0!==g&&(e.generationConfig.maxOutputTokens=g);let i={};if(b.messages&&Array.isArray(b.messages)){for(let a of b.messages)if("assistant"===a.role&&a.tool_calls)for(let b of a.tool_calls)"function"===b.type&&b.id&&b.function?.name&&(i[b.id]=b.function.name)}let j={};if(b.messages&&Array.isArray(b.messages))for(let a of b.messages)"tool"===a.role&&a.tool_call_id&&(j[a.tool_call_id]=a.content);if(b.messages&&Array.isArray(b.messages))for(let a=0;a<b.messages.length;a++){let c=b.messages[a],f=c.role,g=c.content;if("system"===f&&b.messages.length>1){let a="string"==typeof g?g:(0,h.kU)(g);a&&(e.systemInstruction||(e.systemInstruction={role:"user",parts:[]}),e.systemInstruction.parts.push({text:a}))}else if("user"===f||"system"===f&&1===b.messages.length){let a=(0,h.S6)(g);a.length>0&&e.contents.push({role:"user",parts:a})}else if("assistant"===f){let a=[];if(c.reasoning_content&&(a.push({thought:!0,text:c.reasoning_content}),a.push({thoughtSignature:d,text:""})),g){let b="string"==typeof g?g:(0,h.kU)(g);b&&a.push({text:b})}if(c.tool_calls&&Array.isArray(c.tool_calls)){let b=[];for(let e of c.tool_calls){if("function"!==e.type)continue;let c=(0,h.pT)(e.function?.arguments||"{}");a.push({thoughtSignature:d,functionCall:{id:e.id,name:w(e.function.name),args:c}}),b.push(e.id)}if(a.length>0&&e.contents.push({role:"model",parts:a}),b.some(a=>j[a])){let a=[];for(let c of b){if(!j[c])continue;let b=i[c];if(!b){let a=c.split("-");b=a.length>2?a.slice(0,-2).join("-"):c}let d=j[c],e=(0,h.pT)(d);null===e?e={result:d}:"object"!=typeof e&&(e={result:e}),a.push({functionResponse:{id:c,name:w(b),response:{result:e}}})}a.length>0&&e.contents.push({role:"user",parts:a})}}else a.length>0&&e.contents.push({role:"model",parts:a})}}if(b.tools&&Array.isArray(b.tools)&&b.tools.length>0){let a=[];for(let c of b.tools)if(c.name&&c.input_schema){let b=(0,h.Yr)(structuredClone(c.input_schema||{type:"object",properties:{}}));a.push({name:w(c.name),description:c.description||"",parameters:b})}else if("function"===c.type&&c.function){let b=c.function,d=(0,h.Yr)(structuredClone(b.parameters||{type:"object",properties:{}}));a.push({name:w(b.name),description:b.description||"",parameters:d})}a.length>0&&(e.tools=[{functionDeclarations:a}])}return e.contents=B(e.contents),e}function D(a,b,c){return C(a,b,c)}let E={minimal:4096,low:8192,medium:16384,high:65535};function F(a,b,c,d=!0){let e=C(a,b,c,f.$G),g=t("gemini-cli",a);if(d&&b.reasoning_effort){let c=String(b.reasoning_effort).toLowerCase();if(/gemini-3/i.test(a)){e.generationConfig.thinkingConfig={thinkingLevel:c,includeThoughts:!0};let a="high"===c?g.maxOutput:"medium"===c?Math.min(g.maxOutput,32768):Math.min(g.maxOutput,16384);e.generationConfig.maxOutputTokens=Math.max(Number(e.generationConfig.maxOutputTokens)||0,a)}else e.generationConfig.thinkingConfig={thinkingBudget:({none:0,low:1024,medium:8192,high:24576})[c]??8192,includeThoughts:!0}}if(d&&b.thinking?.type==="enabled"&&b.thinking.budget_tokens&&(e.generationConfig.thinkingConfig={thinkingBudget:b.thinking.budget_tokens,includeThoughts:!0}),e.tools?.[0]?.functionDeclarations){for(let a of e.tools[0].functionDeclarations)if(a.parameters){let b=(0,h.Yr)(a.parameters);a.parameters=b}}return e}function G(a,b,c=null,d=!1){let e={project:c?.projectId||c?.providerSpecificData?.projectId||(0,h.w_)(),model:a,userAgent:d?"antigravity":"gemini-cli",requestId:d?`agent-${u()}`:(0,h.KZ)(),request:{sessionId:d?v(c):(0,h.f6)(),contents:b.contents,systemInstruction:b.systemInstruction,generationConfig:b.generationConfig,tools:b.tools}};return d?(e.requestType="agent",e.request.systemInstruction?.parts&&(e.request.systemInstruction={parts:e.request.systemInstruction.parts})):e.request.safetySettings=b.safetySettings,b.tools?.length>0&&(e.request.toolConfig={functionCallingConfig:{mode:"VALIDATED"}}),e}function H(a){return a.toLowerCase().includes("claude")}function I(a,b,c,d=null){let e,f=function(a,b){let c=structuredClone(b),{forward:d,reverse:e}=function(a,b){let c=H(b),d=c?y:x,e=c?A:w,f=(a||[]).map(z).filter(a=>"string"==typeof a&&a.length>0),g=new Set(f.filter(a=>d.test(a))),h=new Map,i=new Map;for(let a of f){if(h.has(a))continue;let b=d.test(a)?a:function(a,b,c=w){let d=c(a);if(!b.has(d))return b.add(d),d;for(let a=2;;a++){let c=`_${a}`,e=`${d.slice(0,64-c.length)}${c}`;if(!b.has(e))return b.add(e),e}}(a,g,e);h.set(a,b),b!==a&&i.set(b,a)}return{forward:h,reverse:i}}(c.tools,a);if(0===d.size)return{body:c,reverse:e};let f=a=>d.get(a)||a;return c.tools=c.tools.map(a=>a?.type==="function"&&a.function?{...a,function:{...a.function,name:f(a.function.name)}}:a?.name?{...a,name:f(a.name)}:a),Array.isArray(c.messages)&&(c.messages=c.messages.map(a=>{let b=a;return Array.isArray(a.tool_calls)&&(b={...b,tool_calls:a.tool_calls.map(a=>a?.function?{...a,function:{...a.function,name:f(a.function.name)}}:a)}),Array.isArray(a.content)&&(b={...b,content:a.content.map(a=>a?.type==="tool_use"&&a.name?{...a,name:f(a.name)}:a)}),b})),c.tool_choice?.type==="function"&&c.tool_choice.function?.name?c.tool_choice={...c.tool_choice,function:{...c.tool_choice.function,name:f(c.tool_choice.function.name)}}:c.tool_choice?.type==="tool"&&c.tool_choice.name&&(c.tool_choice={...c.tool_choice,name:f(c.tool_choice.name)}),{body:c,reverse:e}}(a,b);if(H(a)){let b=(0,g.openaiToClaudeRequestForAntigravity)(a,f.body,c);e=function(a,b,c=null){let d={project:c?.projectId||c?.providerSpecificData?.projectId||(0,h.w_)(),model:a,userAgent:"antigravity",requestId:`agent-${u()}`,requestType:"agent",request:{sessionId:v(c),contents:[],generationConfig:{temperature:b.temperature||1,maxOutputTokens:b.max_tokens||4096}}},e={};if(b.messages&&Array.isArray(b.messages)){for(let a of b.messages)if(Array.isArray(a.content))for(let b of a.content)"tool_use"===b.type&&b.id&&b.name&&(e[b.id]=b.name)}if(b.messages&&Array.isArray(b.messages))for(let a of b.messages){let b=[];if(Array.isArray(a.content)){for(let c of a.content)if("text"===c.type)b.push({text:c.text});else if("tool_use"===c.type)b.push({functionCall:{id:c.id,name:w(c.name),args:c.input||{}}});else if("tool_result"===c.type){let a=c.content;Array.isArray(a)&&(a=a.map(a=>"text"===a.type?a.text:JSON.stringify(a)).join("\n"));let d=e[c.tool_use_id]?w(e[c.tool_use_id]):"tool";b.push({functionResponse:{id:c.tool_use_id,name:d,response:{result:(0,h.pT)(a)||a}}})}}else"string"==typeof a.content&&b.push({text:a.content});b.length>0&&d.request.contents.push({role:"assistant"===a.role?"model":"user",parts:b})}if(b.tools&&Array.isArray(b.tools)){let a=[];for(let c of b.tools)if(c.name&&c.input_schema){let b=(0,h.Yr)(c.input_schema);a.push({name:w(c.name),description:c.description||"",parameters:b})}if(a.length>0){let c=b.tool_choice,e=c?.type==="tool"&&c.name?a.filter(a=>a.name===c.name):a;d.request.tools=[{functionDeclarations:e}];let f=c?.type==="none"?{mode:"NONE"}:c?.type==="any"?{mode:"ANY"}:c?.type==="tool"&&c.name?{mode:"ANY",allowedFunctionNames:[c.name]}:{mode:"VALIDATED"};d.request.toolConfig={functionCallingConfig:f}}}let f=[];if(b.system)if(Array.isArray(b.system))for(let a of b.system)a.text&&f.push({text:a.text});else"string"==typeof b.system&&f.push({text:b.system});return f.length>0&&(d.request.systemInstruction={parts:f}),d.request.contents=B(d.request.contents),d}(a,b,d)}else{let b=F(a,f.body,c,!1);!function(a,b,c){let d=t("antigravity",a);if(b.reasoning_effort){let e=String(b.reasoning_effort).toLowerCase();if(/gemini-3/i.test(a)){let a,b="none"===(a=String(e).toLowerCase().trim())||"off"===a?"minimal":"xhigh"===a||"max"===a||"auto"===a?"high":a;c.generationConfig.thinkingConfig={thinkingLevel:b,includeThoughts:"minimal"!==b};let f=E[b]||E.high;c.generationConfig.maxOutputTokens=Math.max(Number(c.generationConfig.maxOutputTokens)||0,Math.min(f,d.maxOutput))}else c.generationConfig.thinkingConfig={thinkingBudget:({none:0,low:1024,medium:8192,high:24576})[e]??8192,includeThoughts:!0}}b.thinking?.type==="enabled"&&b.thinking.budget_tokens&&(c.generationConfig.thinkingConfig={thinkingBudget:b.thinking.budget_tokens,includeThoughts:!0})}(a,f.body,b),e=G(a,b,d,!0)}return f.reverse.size>0&&(e._toolNameMap=f.reverse),e}(0,d.kz)(e.h.OPENAI,e.h.GEMINI,D,null),(0,d.kz)(e.h.OPENAI,e.h.GEMINI_CLI,(a,b,c,d)=>G(a,F(a,b,c),d),null),(0,d.kz)(e.h.OPENAI,e.h.ANTIGRAVITY,I,null)},42946:(a,b,c)=>{"use strict";c.d(b,{Az:()=>f,fO:()=>h});var d=c(55511),e=c(48991);function f(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,h=[];for(let a of b){let b=c(a.name);d.set(b,a.name),f.add(a.name),h.push({...a,name:b})}let i=[...h,...g],j=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:i,messages:j||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}}let g=[{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 h(a,b,c){let e,f,g,h,i,j;if(!b||!b.includes("sk-ant-oat"))return a;let k={...a},l={type:"text",text:(e=JSON.stringify(a),f=(0,d.createHash)("sha256").update(e).digest("hex").slice(0,5),g=(0,d.randomBytes)(2).toString("hex").slice(0,3),`x-anthropic-billing-header: cc_version=2.1.92.${g}; cc_entrypoint=sdk-cli; cch=${f};`)};return Array.isArray(k.system)?k.system[0]?.text?.startsWith("x-anthropic-billing-header:")||(k.system=[l,...k.system]):"string"==typeof k.system?k.system=[l,{type:"text",text:k.system}]:k.system=[l],k.metadata?.user_id||(k.metadata={...k.metadata,user_id:(h=(0,d.randomBytes)(32).toString("hex"),i=(0,d.randomUUID)(),j=c||(0,d.randomUUID)(),`{"device_id":"${h}","account_uuid":"${i}","session_id":"${j}"}`)}),k}},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{#aG=null;#aH=null;#D=null;constructor(a={}){super(),this.#D=a;const{httpProxy:b,httpsProxy:c,noProxy:d,...e}=a;this[j]=new n(e);const f=b??process.env.http_proxy??process.env.HTTP_PROXY;f?this[k]=new m({...e,uri:f}):this[k]=this[j];const g=c??process.env.https_proxy??process.env.HTTPS_PROXY;g?this[l]=new m({...e,uri:g}):this[l]=this[k],this.#aI()}[i](a,b){let c=new URL(a.origin);return this.#aJ(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)])}#aJ(a){let{protocol:b,host:c,port:d}=a;return(c=c.replace(/:\d*$/,"").replace(/^\[(.+)\]$/,"$1").toLowerCase(),d=Number.parseInt(d,10)||o[b]||0,this.#aK(c,d))?"https:"===b?this[l]:this[k]:this[j]}#aK(a,b){if(this.#aL&&this.#aI(),0===this.#aH.length)return!0;if("*"===this.#aG)return!1;for(let c=0;c<this.#aH.length;c++){let d=this.#aH[c];if((!d.port||d.port===b)&&(a===d.hostname||a.slice(-(d.hostname.length+1))===`.${d.hostname}`))return!1}return!0}#aI(){let a=this.#D.noProxy??this.#aM,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}c.push({hostname:d.replace(/^\*?\./,"").toLowerCase(),port:e})}this.#aG=a,this.#aH=c}get #aL(){return void 0===this.#D.noProxy&&this.#aG!==this.#aM}get #aM(){return process.env.no_proxy??process.env.NO_PROXY??""}}a.exports=p},43212:(a,b,c)=>{"use strict";c(56294),c(42541),c(90943),c(51525),c(84238),c(92843),c(64323),new TextEncoder},43469:(a,b,c)=>{"use strict";c.d(b,{buildClineHeaders:()=>e});let d=c(90053).rE||"0.0.0";function e(a,b={}){let c,f=(c=function(a){if("string"!=typeof a)return"";let b=a.trim();return b?b.startsWith("workos:")?b:`workos:${b}`:""}(a))?`Bearer ${c}`:"",g={"HTTP-Referer":"https://cline.bot","X-Title":"Cline","User-Agent":`ZevaiRouter/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"zevairouter","X-CLIENT-VERSION":d,"X-CORE-VERSION":d,"X-IS-MULTIROOT":"false",...b};return f&&(g.Authorization=f),g}},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;const 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},44089:(a,b,c)=>{"use strict";c(94026),c(15822),c(70884)},44991:(a,b,c)=>{"use strict";c.d(b,{D:()=>f});var d=c(66678),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(24081),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,headroomCodeAware:!1,headroomKompress:!0,cavemanEnabled:!1,cavemanLevel:"full",ponytailEnabled:!1,ponytailLevel:"full",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:""};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:()=>u,dg:()=>w,qX:()=>t});var e=c(5210),f=c(70321),g=c(94479),h=c(65333),i=c(87164),j=c(63993),k=c(23740),l=c(39817),m=a([e,h]);[e,h]=m.then?(await m)():m;let x=["expired","authentication","unauthorized","401","re-authorize"],y=globalThis._quotaUsageInflight??=new Map;function n(a){return a?.provider==="codex"&&!!a.providerSpecificData?.codexRefreshBlockedAt}function o(a){return String(a?.code||"invalid_refresh_token").replace(/[^a-zA-Z0-9_.:-]/g,"_").slice(0,120)||"invalid_refresh_token"}async function p(a,b){let c=new Date().toISOString(),d=o(b),e={providerSpecificData:{...a.providerSpecificData||{},codexRefreshBlockedAt:c,codexRefreshErrorCode:d},lastError:"Codex refresh token rejected; reconnect this account.",lastErrorAt:c,lastErrorType:"auth",errorCode:d,failureClass:"reauth_required"};try{return await (0,f.updateProviderConnection)(a.id,e)||{...a,...e}}catch(b){return console.warn(`[Usage] Codex refresh rejection state was not persisted: ${b.message}`),{...a,...e}}}async function q(a,b){let c=b?.permanent===!0?b:(0,i.R_)({code:o(b)}),d=await p(a,c);if(a.accessToken)return{connection:d,refreshed:!1,refreshBlocked:!0,refreshError:c};throw c}function r(a){return!!(a?.quotas&&"object"==typeof a.quotas&&Object.keys(a.quotas).length>0)}function s(a,b){return!!(a?.quotaFetchFailed===!0&&!a.accountDead&&!r(a)&&r(b?.usage))}async function t(a,b=!1,c=null){let d,e=(0,h.SB)(a.provider);if(n(a))return a.accessToken?{connection:a,refreshed:!1,refreshBlocked:!0}:q(a,(0,i.R_)({code:a.providerSpecificData.codexRefreshErrorCode||"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};try{d=await e.refreshCredentials(g,console,c)}catch(b){if("codex"===a.provider&&b?.permanent===!0)return q(a,b);throw b}if("codex"===a.provider&&(0,i.jT)(d))return q(a,(0,i.R_)(d));if(!d){if(a.accessToken)return{connection:a,refreshed:!1};throw Error("Failed to refresh credentials. Please re-authorize the connection.")}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 u(a){var b;let c;if(!a)return!1;let d=(b=a.authType,c=String(b||"").toLowerCase().trim(),"api-key"===c||"api_key"===c||"api key"===c?"apikey":c);return"oauth"===d||"apikey"===d&&k.jO.includes(a.provider)}async function v(a,b,c){let{writeCache:d=!1,force:e=!1}=b,h=await (0,f.getProviderConnectionById)(a);if(!h)return{error:"Connection not found",notFound:!0};if(!u(h))return{message:"Usage not available for this connection"};let i=await (0,j.B)(h.providerSpecificData),k={connectionProxyEnabled:!0===i.connectionProxyEnabled,connectionProxyUrl:i.connectionProxyUrl||"",connectionNoProxy:i.connectionNoProxy||"",vercelRelayUrl:i.vercelRelayUrl||"",strictProxy:!1},m=h,o="oauth"===m.authType;if(o){let a;try{a=await t(m,e,k)}catch(a){if("codex"===m.provider&&a?.permanent===!0)return{message:"Codex refresh token rejected; reconnect this account.",reauthRequired:!0,quotas:{}};throw a}m=a.connection}let p=await (0,g.my)(m,k);if(o&&function(a){if(!a?.message)return!1;let b=a.message.toLowerCase();return x.some(a=>b.includes(a))}(p)&&m.refreshToken&&!n(m))try{m=(await t(m,!0,k)).connection,p=await (0,g.my)(m,k)}catch(a){console.warn(`[Usage] ${m.provider}: force refresh failed: ${a.message}`)}if((d||c.writeCache)&&p&&!p.error)try{if("codebuddy"===m.provider||"codebuddy-cn"===m.provider){let a=null,b=await (0,f.Iu)(m.id,(b,c)=>{if(s(p,c)){var d;return d=p,a={...(0,l.pX)(c.usage,b),stale:!0,refreshError:d.message},{}}return{quotaUsage:(0,l.pX)(p,b)}});p=a||b?.quotaUsage||p}else{let a=await (0,f.getQuotaSnapshot)(m.id);s(p,a)?p={...a.usage,stale:!0,refreshError:p.message}:await (0,f.KK)(m.id,m.provider,p)}}catch(a){console.warn(`[QuotaCache] save failed for ${m.id}: ${a.message}`)}else if("codebuddy"===m.provider||"codebuddy-cn"===m.provider){let a=await (0,f.getProviderConnectionById)(m.id)||m;p=(0,l.pX)(p,a)}return p}async function w(a,b={}){let c=y.get(a);if(c||(c={active:null,queuedForce:null},y.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||y.get(a)!==c||y.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,v(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=v(a,b,e).finally(()=>d(e)),e.promise}d()}catch(a){d(a)}})},46714:(a,b,c)=>{"use strict";c.d(b,{dv:()=>j,fM:()=>i,vP:()=>h});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"]);function h(a){let b;return 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 i(a,b){let c="string"==typeof b?b.trim().toLowerCase():"",e=f[c]||c,g=d.indexOf(e);if(-1===g)return"low";let i=h(a),j=i[i.length-1],k=d.indexOf(j);return d[Math.min(g,k)]}function j(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}}},46777:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d={id:"trae",alias:"trae",aliases:["marscode"],uiAlias:"trae",category:"oauth",authType:"oauth",hasOAuth:!0,authModes:["oauth"],display:{name:"Trae",icon:"bolt",color:"#FF6A00",textIcon:"TR",website:"https://www.trae.ai",deprecated:!0,notice:{signupUrl:"https://www.trae.ai"}},transport:{baseUrl:"https://core-normal.trae.ai/api/remote/v1",format:"openai",headers:{"X-Trae-Client-Type":"web","X-Preferenced-Language":"en",Referer:"https://solo.trae.ai/"},auth:{combined:!0,header:"Authorization",scheme:"Cloud-IDE-JWT"},usage:{url:"https://api.marscode.com/cloudide/api/v3/trae/GetUserInfo"},regions:{cn:"https://api.marscode.com",sg:"https://api.trae.ai",us:"https://www.trae.ai"},defaultRegion:"cn"},models:[{id:"auto",name:"Auto (Server Picks)"},{id:"work",name:"Work (Fast)"},{id:"gemini-3.1-pro",name:"Gemini 3.1 Pro"},{id:"gemini-3-flash-solo",name:"Gemini 3 Flash"},{id:"minimax-m3",name:"MiniMax M3"},{id:"minimax-m2.7",name:"MiniMax M2.7"},{id:"kimi-k2.5",name:"Kimi K2.5"},{id:"gpt-5.4",name:"GPT 5.4"},{id:"gpt-5.2",name:"GPT 5.2"}],features:{usage:!0}}},46956:(a,b,c)=>{"use strict";c.d(b,{proxyAwareFetch:()=>s});var d=c(3433),e=c(27910),f=c(8735);let g=globalThis.fetch,h=new Map,i=new Map,j=["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"],k=["8.8.8.8","8.8.4.4"];function l(){let a=Error("Request aborted");return a.name="AbortError",a}function m(a){return null==a?"":String(a).trim()}async function n(a,b=null){let d,e=i.get(a);if(e&&Date.now()<e.expiry)return e.ip;if(b?.aborted)throw l();try{let e=await Promise.resolve().then(c.t.bind(c,14985,23)),{promisify:g}=await Promise.resolve().then(c.t.bind(c,28354,23)),h=new e.Resolver;h.setServers(k);let j=g(h.resolve4.bind(h)),m=b?await Promise.race([j(a),new Promise((a,c)=>{d=()=>{h.cancel?.(),c(l())},b.addEventListener("abort",d,{once:!0})})]):await j(a);return i.set(a,{ip:m[0],expiry:Date.now()+f.v1.dnsCacheTtlMs}),m[0]}catch(c){if(b?.aborted||c?.name==="AbortError")throw l();return console.warn(`[ProxyFetch] DNS resolve failed for ${a}:`,c.message),null}finally{d&&b?.removeEventListener?.("abort",d)}}function o(a,b){let c,d=m(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 p(a){let b=m(a);if(!b)return null;try{return new URL(b),b}catch{return`http://${b}`}}async function q(a){let b=p(a);if(!b)return null;if(!h.has(b)){h.size>=f.v1.proxyDispatchersMaxSize&&h.delete(h.keys().next().value);let{ProxyAgent:a}=await Promise.resolve().then(c.t.bind(c,3433,19));h.set(b,new a({uri:b}))}return h.get(b)}async function r(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,i=g.default??g;return new Promise((c,f)=>{let g=new i.Socket,j=d.signal,k=null,m=null,n=!1,o=()=>j?.removeEventListener?.("abort",q),p=a=>{n||(n=!0,o(),f(a))},q=()=>{!function({upstreamResponse:a,request:b,socket:c,rejectOnce:d}){let e=l();d?.(e),a?.destroy?.(),b?.destroy?.(),c?.destroy?.()}({upstreamResponse:m,request:k,socket:g,rejectOnce:p})};j?.aborted?q():(j?.addEventListener?.("abort",q,{once:!0}),g.connect(443,b,()=>{if(n||j?.aborted)return;let b={socket:g,servername:a.hostname,path:a.pathname+a.search,method:d.method||"POST",headers:{...d.headers,Host:a.hostname}};(k=h.request(b,a=>{m=a,n=!0,a.once("close",o);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=>p(a)),d.body&&k.write("string"==typeof d.body?d.body:JSON.stringify(d.body)),k.end()}),g.on("error",a=>p(a)))})}async function s(a,b={},c=null){let e="string"==typeof a?a:a.toString(),f=m(c?.vercelRelayUrl);if(f){let a=new URL(e),c={...b.headers,"x-relay-target":`${a.protocol}//${a.host}`,"x-relay-path":`${a.pathname}${a.search}`};return g(f,{...b,headers:c})}let h=function(a,b){if(b?.enabled!==!0&&b?.connectionProxyEnabled!==!0)return null;let c=m(b?.url??b?.connectionProxyUrl);if(!c)return null;let d=m(b?.noProxy??b?.connectionNoProxy);return d&&o(a,d)?null:p(c)}(e,c),i=h?null:p(function(a){let b;if(o(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}(e)),k=h||i;if(function(a){try{let b=new URL(a).hostname;return j.some(a=>b.includes(a))}catch{return!1}}(e)){if(k)try{let c=await q(k);return await (0,d.hd)(a,{...b,dispatcher:c})}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 f=new URL(e),h=await n(f.hostname,b.signal);return h?r(f,h,b):g(a,b)}if(k)try{let c=await q(k);return await (0,d.hd)(a,{...b,dispatcher:c})}catch(a){if(b.signal?.aborted||a?.name==="AbortError")throw a;if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${a.message}`);if(c?.singleTransportAttempt===!0)throw Error("[ProxyFetch] Proxy request failed for single-attempt upstream");console.warn(`[ProxyFetch] Proxy failed, falling back to direct: ${a.message}`)}return g(a,b)}async function t(a,b={}){return s(a,b,null)}globalThis.fetch!==t&&(globalThis.fetch=t)},47335:(a,b,c)=>{"use strict";let d=c(83204),{ResponseError:e}=c(61448);class f extends d{#O;#aN;#aO;#e;#aP;constructor(a,{handler:b}){super(b)}#aQ(a){return 0===(this.#aN??"").indexOf(a)}onRequestStart(a,b){return this.#O=0,this.#aN=null,this.#aO=null,this.#e=null,this.#aP="",super.onRequestStart(a,b)}onResponseStart(a,b,c,d){if(this.#O=b,this.#e=c,this.#aN=c["content-type"],this.#O<400)return super.onResponseStart(a,b,c,d);(this.#aQ("application/json")||this.#aQ("text/plain"))&&(this.#aO=new TextDecoder("utf-8"))}onResponseData(a,b){if(this.#O<400)return super.onResponseData(a,b);this.#aP+=this.#aO?.decode(b,{stream:!0})??""}onResponseEnd(a,b){if(this.#O>=400){let b;if(this.#aP+=this.#aO?.decode(void 0,{stream:!1})??"",this.#aQ("application/json"))try{this.#aP=JSON.parse(this.#aP)}catch{}let c=Error.stackTraceLimit;Error.stackTraceLimit=0;try{b=new e("Response Error",this.#O,{body:this.#aP,headers:this.#e})}finally{Error.stackTraceLimit=c}super.onResponseError(a,b)}else super.onResponseEnd(a,b)}onResponseError(a,b){super.onResponseError(a,b)}}a.exports=()=>a=>function(b,c){return a(b,new f(b,{handler:c}))}},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),{kEnumerableProperty:k}=c(84285),{environmentSettingsObject:l}=c(42425),{createPotentialCORSRequest:m}=c(26376),n=!1;class o extends EventTarget{#aR={open:null,error:null,message:null};#ar;#aS=!1;#aT=0;#aU=null;#G=null;#d;#a;constructor(a,b={}){let c;super(),f.util.markAsUncloneable(this);const d="EventSource constructor";f.argumentLengthCheck(arguments,1,d),n||(n=!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,l.settingsObject.baseUrl),this.#a.origin=c.origin}catch(a){throw new DOMException(a,"SyntaxError")}this.#ar=c.href;let e="anonymous";!0===b.withCredentials&&(e="use-credentials",this.#aS=!0);const g=m(c,"",e);g.client=l.settingsObject,g.headersList.set("Accept","text/event-stream"),g.cache="no-store",g.initiator="other",this.#aU=g,this.#aV()}get readyState(){return this.#aT}get url(){return this.#ar}get withCredentials(){return this.#aS}#aV(){if(2===this.#aT)return;this.#aT=0;let a={request:this.#aU,dispatcher:this.#d};a.processResponseEndOfBody=a=>{if(!j(a))return this.#aW()},a.processResponse=a=>{if(j(a))if(!a.aborted)return void this.#aW();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.#aT=1,this.dispatchEvent(new Event("open")),this.#a.origin=a.urlList[a.urlList.length-1].origin;let f=new g({eventSourceSettings:this.#a,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.#G=e(a)}#aW(){2!==this.#aT&&(this.#aT=0,this.dispatchEvent(new Event("error")),setTimeout(()=>{0===this.#aT&&(this.#a.lastEventId.length&&this.#aU.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#aV())},this.#a.reconnectionTime)?.unref())}close(){f.brandCheck(this,o),2!==this.#aT&&(this.#aT=2,this.#G.abort(),this.#aU=null)}get onopen(){return this.#aR.open}set onopen(a){this.#aR.open&&this.removeEventListener("open",this.#aR.open);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("open",b),this.#aR.open=a):this.#aR.open=null}get onmessage(){return this.#aR.message}set onmessage(a){this.#aR.message&&this.removeEventListener("message",this.#aR.message);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("message",b),this.#aR.message=a):this.#aR.message=null}get onerror(){return this.#aR.error}set onerror(a){this.#aR.error&&this.removeEventListener("error",this.#aR.error);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("error",b),this.#aR.error=a):this.#aR.error=null}}let p={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(o,p),Object.defineProperties(o.prototype,p),Object.defineProperties(o.prototype,{close:k,onerror:k,onmessage:k,onopen:k,readyState:k,url:k,withCredentials:k}),f.converters.EventSourceInitDict=f.dictionaryConverter([{key:"withCredentials",converter:f.converters.boolean,defaultValue:()=>!1},{key:"dispatcher",converter:f.converters.any},{key:"node",converter:f.dictionaryConverter([{key:"reconnectionTime",converter:f.converters["unsigned long"],defaultValue:()=>3e3},{key:"dispatcher",converter:f.converters.any}]),defaultValue:()=>({})}]),a.exports={EventSource:o,defaultReconnectionTime:3e3}},47800:(a,b,c)=>{"use strict";let{InvalidArgumentError:d}=c(61448),{runtimeFeatures:e}=c(56758),f=e.has("crypto")?c(77598):null,g=f?.hash?a=>f.hash("sha256",a,"base64url"):a=>Buffer.from(a).toString("base64url");function h(a){return Array.isArray(a)&&(1&a.length)==0}let i=["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:g,isUndiciHeaders:h,normalizeHeaders:function(a){let b={};if(!a)return b;if(h(a)){for(let c=0;c<a.length;c+=2){let d=a[c],e=a[c+1];if(d&&void 0!==e){let a=Buffer.isBuffer(d)?d.toString():d,c=Buffer.isBuffer(e)?e.toString():e;b[a.toLowerCase()]=c}}return b}if(a&&"object"==typeof a)for(let[c,d]of Object.entries(a))c&&"string"==typeof c&&(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(!i.includes(a))throw new d(`Invalid snapshot mode: ${a}. Must be one of: ${i.join(", ")}`)}}},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),s=Symbol("proxy agent"),t=Symbol("proxy client"),u=Symbol("proxy headers"),v=Symbol("request tls settings"),w=Symbol("proxy tls settings"),x=Symbol("connect endpoint function"),y=Symbol("connect endpoint function (http/1.1 only)"),z=Symbol("tunnel proxy"),A="proxy-authorization";function B(a,b){return new i(a,b)}let C=()=>{};function D(a,b){return 1===b.connections?new p(a,b):new i(a,b)}class E extends j{#aX;#aY;constructor(a,{headers:b={},connect:c,factory:d,proxyServername:e}){if(!a)throw new k("Proxy URL is mandatory");super(),this[u]=b,this.#aY=e,d?this.#aX=d(a,{connect:c}):this.#aX=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;if(a.path=d+e,!("host"in f)&&!("Host"in f)){let{host:a}=new URL(d);f.host=a}return a.headers={...this[u],...f},null!=this.#aY&&(a.servername=this.#aY),this.#aX[g](a,b)}[e](){return this.#aX.close()}[f](a){return this.#aX.destroy(a)}}class F extends j{constructor(a){if(!a||"object"==typeof a&&!(a instanceof URL)&&!a.uri)throw new k("Proxy uri is mandatory");const{clientFactory:b=B}=a;if("function"!=typeof b)throw new k("Proxy opts.clientFactory must be a function.");const{proxyTunnel:c,connectTimeout:e}=a;super();const f=this.#aZ(a),{href:g,origin:i,port:j,protocol:p,username:A,password:F,hostname:G}=f;if(this[d]={uri:g,protocol:p},this[v]=a.requestTls,this[w]=a.proxyTls,this[u]=a.headers||{},this[z]=c,a.auth&&a.token)throw new k("opts.auth cannot be used in combination with opts.token");a.auth?this[u]["proxy-authorization"]=`Basic ${a.auth}`:a.token?this[u]["proxy-authorization"]=a.token:A&&F?this[u]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(A)}:${decodeURIComponent(F)}`).toString("base64")}`:A&&(this[u]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(A)}:`).toString("base64")}`);const H=o({timeout:e,...a.proxyTls}),I=o({timeout:e,...a.proxyTls,allowH2:!1});this[x]=o({timeout:e,...a.requestTls}),this[y]=o({timeout:e,...a.requestTls,allowH2:!1});const J=a.factory||D,K=(b,c)=>{let{protocol:e}=new URL(b);if("socks5:"===this[d].protocol||"socks:"===this[d].protocol)return new r(this[d].uri,{headers:this[u],connect:H,factory:J,username:a.username||A,password:a.password||F,proxyTls:a.proxyTls,requestTls:a.requestTls});if(!0!==this[z]&&"http:"===e){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 E(this[d].uri,{headers:this[u],connect:a,factory:J,proxyServername:"https:"===this[d].protocol?this[w]?.servername||G:void 0})}return J(b,c)};"socks5:"===p||"socks:"===p?this[t]=null:this[t]=b(f,{connect:H}),this[s]=new h({...a,factory:K,connect:async(a,b)=>{if(!this[t])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[u],host:a.host,...null==a.connections||a.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[w]?.servername||G},{socket:f,statusCode:g}=await this[t].connect(e);if(200!==g){f.on("error",C).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[v]?this[v].servername:a.servername,(!1===a.allowH2?this[y]:this[x])({...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)G(a[c])&&H(),b[a[c]]=a[c+1];return b}return a}(a.headers);if(function(a){for(let b in a)G(b)&&H()}(c),c&&!("host"in c)&&!("Host"in c)){let{host:b}=new URL(a.origin);c.host=b}return this[s].dispatch({...a,headers:c},b)}#aZ(a){return"string"==typeof a?new URL(a):a instanceof URL?a:new URL(a.uri)}[e](){let a=[this[s].close()];return this[t]&&a.push(this[t].close()),Promise.all(a)}[f](){let a=[this[s].destroy()];return this[t]&&a.push(this[t].destroy()),Promise.all(a)}}function G(a){return a.length===A.length&&a.toLowerCase()===A}function H(){throw new k("Proxy-Authorization should be sent in ProxyAgent constructor")}a.exports=F},48991:(a,b,c)=>{"use strict";c.d(b,{A9:()=>i,Cn:()=>j,Co:()=>r,Ic:()=>p,NA:()=>t,P0:()=>l,VK:()=>u,Wu:()=>s,go:()=>e,nZ:()=>o,p8:()=>m,rJ:()=>n,sX:()=>f,uR:()=>k,x0:()=>g,zv:()=>q});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={VSCODE_VERSION:"1.110.0",COPILOT_CHAT_VERSION:"0.38.0",USER_AGENT:"GitHubCopilotChat/0.38.0",API_VERSION:"2025-04-01"};function h(){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 i(){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 j={ideType:9,platform:h(),pluginType:2},k="_ide";function l(){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 m(){return"antigravity/ide/2.1.1 darwin/arm64"}function n(a){return"string"==typeof a&&/(?:^|\/)gemini-3\.7(?:-|$)/i.test(a)?l():m()}m();let o={loadCodeAssist:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUser:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser"},p={"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:h(),pluginType:2})},q={ideType:9,platform:h(),pluginType:2},r="You are Claude Code, Anthropic's official CLI for Claude.",s={codex:432e6,claude:144e5,iflow:864e5,qwen:12e5,codebuddy:12e5,kimi:3e5,"kimi-coding":3e5,antigravity:3e5,"grok-cli":3e5,xai:3e5},t={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 u(){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":`kimi-${Date.now()}`}}},49065:(a,b,c)=>{"use strict";c.r(b),c.d(b,{geminiToOpenAIRequest:()=>g});var d=c(56294),e=c(42541),f=c(58455);function g(a,b,c){let d={model:a,messages:[],stream:c};if(b.generationConfig){let a=b.generationConfig;if(a.maxOutputTokens){let c={max_tokens:a.maxOutputTokens,tools:b.tools};d.max_tokens=(0,f.M)(c)}void 0!==a.temperature&&(d.temperature=a.temperature),void 0!==a.topP&&(d.top_p=a.topP)}if(b.systemInstruction){var e;let a="string"==typeof(e=b.systemInstruction)?e:e.parts&&Array.isArray(e.parts)?e.parts.map(a=>a.text||"").join(""):"";a&&d.messages.push({role:"system",content:a})}if(b.contents&&Array.isArray(b.contents))for(let a of b.contents){let b=function(a){let b="user"===a.role?"user":"assistant";if(!a.parts||!Array.isArray(a.parts))return null;let c=[],d=[];for(let b of a.parts)if(void 0!==b.text&&c.push({type:"text",text:b.text}),b.inlineData&&c.push({type:"image_url",image_url:{url:`data:${b.inlineData.mimeType};base64,${b.inlineData.data}`}}),b.functionCall&&d.push({id:`call_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,type:"function",function:{name:b.functionCall.name,arguments:JSON.stringify(b.functionCall.args||{})}}),b.functionResponse)return{role:"tool",tool_call_id:b.functionResponse.id||b.functionResponse.name,content:JSON.stringify(b.functionResponse.response?.result||b.functionResponse.response||{})};if(d.length>0){let a={role:"assistant"};return c.length>0&&(a.content=1===c.length&&"text"===c[0].type?c[0].text:c),a.tool_calls=d,a}return c.length>0?{role:b,content:1===c.length&&"text"===c[0].type?c[0].text:c}:null}(a);b&&d.messages.push(b)}if(b.tools&&Array.isArray(b.tools)){for(let a of(d.tools=[],b.tools))if(a.functionDeclarations)for(let b of a.functionDeclarations)d.tools.push({type:"function",function:{name:b.name,description:b.description||"",parameters:b.parameters||{type:"object",properties:{}}}})}return d}(0,d.kz)(e.h.GEMINI,e.h.OPENAI,g,null),(0,d.kz)(e.h.GEMINI_CLI,e.h.OPENAI,g,null)},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{#a$=new Map;constructor(){arguments[0]!==g&&e.illegalConstructor(),e.util.markAsUncloneable(this)}async match(a,b={}){if(e.brandCheck(this,h),e.argumentLengthCheck(arguments,1,"CacheStorage.match"),a=e.converters.RequestInfo(a),null!=(b=e.converters.MultiCacheQueryOptions(b)).cacheName){if(this.#a$.has(b.cacheName)){let c=new d(g,this.#a$.get(b.cacheName));return await c.match(a,b)}}else for(let c of this.#a$.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,h);let b="CacheStorage.has";return e.argumentLengthCheck(arguments,1,b),a=e.converters.DOMString(a,b,"cacheName"),this.#a$.has(a)}async open(a){e.brandCheck(this,h);let b="CacheStorage.open";if(e.argumentLengthCheck(arguments,1,b),a=e.converters.DOMString(a,b,"cacheName"),this.#a$.has(a))return new d(g,this.#a$.get(a));let c=[];return this.#a$.set(a,c),new d(g,c)}async delete(a){e.brandCheck(this,h);let b="CacheStorage.delete";return e.argumentLengthCheck(arguments,1,b),a=e.converters.DOMString(a,b,"cacheName"),this.#a$.delete(a)}async keys(){return e.brandCheck(this,h),[...this.#a$.keys()]}}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"),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"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent"),kSocks5ProxyAgent:Symbol("socks5 proxy agent")}},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{#a_;constructor(){arguments[0]!==e&&j.illegalConstructor(),j.util.markAsUncloneable(this),this.#a_=arguments[1]}async match(a,b={}){j.brandCheck(this,t);let c="Cache.match";j.argumentLengthCheck(arguments,1,c),a=j.converters.RequestInfo(a),b=j.converters.CacheQueryOptions(b,c,"options");let d=this.#a0(a,b,1);if(0!==d.length)return d[0]}async matchAll(a,b={}){return j.brandCheck(this,t),void 0!==a&&(a=j.converters.RequestInfo(a)),b=j.converters.CacheQueryOptions(b,"Cache.matchAll","options"),this.#a0(a,b)}async add(a){j.brandCheck(this,t),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,t);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}}},processResponseEndOfBody(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.#a1(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,t);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 u=Promise.withResolvers(),v=null;try{this.#a1(l)}catch(a){v=a}return queueMicrotask(()=>{null===v?u.resolve():u.reject(v)}),u.promise}async delete(a,b={}){let c;j.brandCheck(this,t);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.#a1(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,t),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.#a_)e.push(a[0]);else for(let a of this.#a2(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}#a1(a){let b=this.#a_,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.#a2(c.request,c.options,e).length)throw new DOMException("???","InvalidStateError");if("delete"===c.type){if(a=this.#a2(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.#a2(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.#a_.length=0,this.#a_=c,a}}#a2(a,b,c){let d=[];for(let e of c??this.#a_){let[c,f]=e;this.#a3(a,c,f,b)&&d.push(e)}return d}#a3(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}#a0(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.#a_)e.push(a[1]);else for(let a of this.#a2(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)}}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}},50270:(a,b,c)=>{"use strict";c.r(b),c.d(b,{openaiToAntigravityResponse:()=>f});var d=c(56294),e=c(42541);function f(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:g(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=[];if(d.reasoning_content&&f.push({thought:!0,text:d.reasoning_content}),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=g(j)),{response:i}}function g(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}(0,d.kz)(e.h.OPENAI,e.h.ANTIGRAVITY,null,f)},50294:(a,b,c)=>{"use strict";c.d(b,{R:()=>j});var d=c(66678),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})},51525:(a,b,c)=>{"use strict";c(76816)},51529:(a,b,c)=>{},51658:(a,b,c)=>{"use strict";c(42541),c(56294),c(43212),c(11484),c(64323),c(83651),c(72610),c(51525)},51705:(a,b,c)=>{"use strict";a.exports=c.p+"static/media/server.f66733f4.js"},51753:(a,b,c)=>{"use strict";let{webidl:d}=c(32984),{kEnumerableProperty:e}=c(84285),{kConstruct:f}=c(49176);class g extends Event{#a4;constructor(a,b={}){if(a===f){super(arguments[1],arguments[2]),d.util.markAsUncloneable(this);return}const c="MessageEvent constructor";d.argumentLengthCheck(arguments,1,c),super(a=d.converters.DOMString(a,c,"type"),b=d.converters.MessageEventInit(b,c,"eventInitDict")),this.#a4=b,d.util.markAsUncloneable(this)}get data(){return d.brandCheck(this,g),this.#a4.data}get origin(){return d.brandCheck(this,g),this.#a4.origin}get lastEventId(){return d.brandCheck(this,g),this.#a4.lastEventId}get source(){return d.brandCheck(this,g),this.#a4.source}get ports(){return d.brandCheck(this,g),Object.isFrozen(this.#a4.ports)||Object.freeze(this.#a4.ports),this.#a4.ports}initMessageEvent(a,b=!1,c=!1,e=null,f="",h="",i=null,j=[]){return d.brandCheck(this,g),d.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new g(a,{bubbles:b,cancelable:c,data:e,origin:f,lastEventId:h,source:i,ports:j})}static createFastMessageEvent(a,b){let c=new g(f,a,b);return c.#a4=b,c.#a4.data??=null,c.#a4.origin??="",c.#a4.lastEventId??="",c.#a4.source??=null,c.#a4.ports??=[],c}}let{createFastMessageEvent:h}=g;delete g.createFastMessageEvent;class i extends Event{#a4;constructor(a,b={}){const c="CloseEvent constructor";d.argumentLengthCheck(arguments,1,c),super(a=d.converters.DOMString(a,c,"type"),b=d.converters.CloseEventInit(b)),this.#a4=b,d.util.markAsUncloneable(this)}get wasClean(){return d.brandCheck(this,i),this.#a4.wasClean}get code(){return d.brandCheck(this,i),this.#a4.code}get reason(){return d.brandCheck(this,i),this.#a4.reason}}class j extends Event{#a4;constructor(a,b){const c="ErrorEvent constructor";d.argumentLengthCheck(arguments,1,c),super(a,b),d.util.markAsUncloneable(this),a=d.converters.DOMString(a,c,"type"),b=d.converters.ErrorEventInit(b??{}),this.#a4=b}get message(){return d.brandCheck(this,j),this.#a4.message}get filename(){return d.brandCheck(this,j),this.#a4.filename}get lineno(){return d.brandCheck(this,j),this.#a4.lineno}get colno(){return d.brandCheck(this,j),this.#a4.colno}get error(){return d.brandCheck(this,j),this.#a4.error}}Object.defineProperties(g.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:e,origin:e,lastEventId:e,source:e,ports:e,initMessageEvent:e}),Object.defineProperties(i.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:e,code:e,wasClean:e}),Object.defineProperties(j.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:e,filename:e,lineno:e,colno:e,error:e}),d.converters.MessagePort=d.interfaceConverter(d.is.MessagePort,"MessagePort"),d.converters["sequence<MessagePort>"]=d.sequenceConverter(d.converters.MessagePort);let k=[{key:"bubbles",converter:d.converters.boolean,defaultValue:()=>!1},{key:"cancelable",converter:d.converters.boolean,defaultValue:()=>!1},{key:"composed",converter:d.converters.boolean,defaultValue:()=>!1}];d.converters.MessageEventInit=d.dictionaryConverter([...k,{key:"data",converter:d.converters.any,defaultValue:()=>null},{key:"origin",converter:d.converters.USVString,defaultValue:()=>""},{key:"lastEventId",converter:d.converters.DOMString,defaultValue:()=>""},{key:"source",converter:d.nullableConverter(d.converters.MessagePort),defaultValue:()=>null},{key:"ports",converter:d.converters["sequence<MessagePort>"],defaultValue:()=>[]}]),d.converters.CloseEventInit=d.dictionaryConverter([...k,{key:"wasClean",converter:d.converters.boolean,defaultValue:()=>!1},{key:"code",converter:d.converters["unsigned short"],defaultValue:()=>0},{key:"reason",converter:d.converters.USVString,defaultValue:()=>""}]),d.converters.ErrorEventInit=d.dictionaryConverter([...k,{key:"message",converter:d.converters.DOMString,defaultValue:()=>""},{key:"filename",converter:d.converters.USVString,defaultValue:()=>""},{key:"lineno",converter:d.converters["unsigned long"],defaultValue:()=>0},{key:"colno",converter:d.converters["unsigned long"],defaultValue:()=>0},{key:"error",converter:d.converters.any}]),a.exports={MessageEvent:g,CloseEvent:i,ErrorEvent:j,createFastMessageEvent:h}},52039:(a,b,c)=>{"use strict";let{isArrayBuffer:d}=c(73429),{webidl:e}=c(32984),{URLSerializer:f}=c(16537),{environmentSettingsObject:g}=c(42425),{staticPropertyDescriptors:h,states:i,sentCloseFrameState:j,sendHints:k,opcodes:l}=c(62026),{isConnecting:m,isEstablished:n,isClosing:o,isClosed:p,isValidSubprotocol:q,fireEvent:r,utf8Decode:s,toArrayBuffer:t,getURLRecord:u}=c(94050),{establishWebSocketConnection:v,closeWebSocketConnection:w,failWebsocketConnection:x}=c(4654),{ByteParser:y}=c(64821),{kEnumerableProperty:z}=c(84285),{getGlobalDispatcher:A}=c(59970),{ErrorEvent:B,CloseEvent:C,createFastMessageEvent:D}=c(51753),{SendQueue:E}=c(54849),{WebsocketFrameSend:F}=c(45221),{channels:G}=c(62571),H=Symbol.for("nodejs.ref"),I=Symbol.for("nodejs.unref");class J extends EventTarget{#aR={open:null,error:null,close:null,message:null};#a5=0;#a6="";#a7="";#a8=!0;#a9;#ay={onConnectionEstablished:(a,b)=>this.#az(a,b),onMessage:(a,b)=>this.#aA(a,b),onParserError:a=>x(this.#ay,null,a.message),onParserDrain:()=>this.#ba(),onSocketData:a=>{this.#aB.write(a)||this.#ay.socket.pause()},onSocketError:a=>{this.#ay.readyState=i.CLOSING,G.socketError.hasSubscribers&&G.socketError.publish(a),this.#ay.socket.destroy()},onSocketClose:()=>this.#aC(),onPing:a=>{G.ping.hasSubscribers&&G.ping.publish({payload:a,websocket:this})},onPong:a=>{G.pong.hasSubscribers&&G.pong.publish({payload:a,websocket:this})},readyState:i.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#ar;#bb;#aB;constructor(a,b=[]){super(),e.util.markAsUncloneable(this);const c="WebSocket constructor";e.argumentLengthCheck(arguments,1,c);const d=e.converters["DOMString or sequence<DOMString> or WebSocketInit"](b,c,"options");a=e.converters.USVString(a),b=d.protocols;const f=u(a,g.settingsObject.baseUrl);if("string"==typeof b&&(b=[b]),b.length!==new Set(b.map(a=>a.toLowerCase())).size||b.length>0&&!b.every(a=>q(a)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#ar=new URL(f.href);const h=g.settingsObject;this.#ay.controller=v(f,b,h,this.#ay,d),this.#ay.readyState=J.CONNECTING,this.#bb="blob"}[H](){e.brandCheck(this,J),this.#a8=!0,this.#ay.socket?.ref?.()}[I](){e.brandCheck(this,J),this.#a8=!1,this.#ay.socket?.unref?.()}close(a,b){e.brandCheck(this,J),void 0!==a&&(a=e.converters["unsigned short"](a,"WebSocket.close","code",e.attributes.Clamp)),void 0!==b&&(b=e.converters.USVString(b)),a??=null,b??="",w(this.#ay,a,b,!0)}send(a){e.brandCheck(this,J);let b="WebSocket.send";if(e.argumentLengthCheck(arguments,1,b),a=e.converters.WebSocketSendData(a,b,"data"),m(this.#ay.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!n(this.#ay.readyState)||o(this.#ay.readyState)))if("string"==typeof a){let b=Buffer.from(a);this.#a5+=b.byteLength,this.#a9.add(b,()=>{this.#a5-=b.byteLength},k.text)}else d(a)?(this.#a5+=a.byteLength,this.#a9.add(a,()=>{this.#a5-=a.byteLength},k.arrayBuffer)):ArrayBuffer.isView(a)?(this.#a5+=a.byteLength,this.#a9.add(a,()=>{this.#a5-=a.byteLength},k.typedArray)):e.is.Blob(a)&&(this.#a5+=a.size,this.#a9.add(a,()=>{this.#a5-=a.size},k.blob))}get readyState(){return e.brandCheck(this,J),this.#ay.readyState}get bufferedAmount(){return e.brandCheck(this,J),this.#a5}get url(){return e.brandCheck(this,J),f(this.#ar)}get extensions(){return e.brandCheck(this,J),this.#a7}get protocol(){return e.brandCheck(this,J),this.#a6}get onopen(){return e.brandCheck(this,J),this.#aR.open}set onopen(a){e.brandCheck(this,J),this.#aR.open&&this.removeEventListener("open",this.#aR.open);let b=e.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("open",b),this.#aR.open=a):this.#aR.open=null}get onerror(){return e.brandCheck(this,J),this.#aR.error}set onerror(a){e.brandCheck(this,J),this.#aR.error&&this.removeEventListener("error",this.#aR.error);let b=e.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("error",b),this.#aR.error=a):this.#aR.error=null}get onclose(){return e.brandCheck(this,J),this.#aR.close}set onclose(a){e.brandCheck(this,J),this.#aR.close&&this.removeEventListener("close",this.#aR.close);let b=e.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("close",b),this.#aR.close=a):this.#aR.close=null}get onmessage(){return e.brandCheck(this,J),this.#aR.message}set onmessage(a){e.brandCheck(this,J),this.#aR.message&&this.removeEventListener("message",this.#aR.message);let b=e.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("message",b),this.#aR.message=a):this.#aR.message=null}get binaryType(){return e.brandCheck(this,J),this.#bb}set binaryType(a){e.brandCheck(this,J),"blob"!==a&&"arraybuffer"!==a?this.#bb="blob":this.#bb=a}#az(a,b){this.#ay.socket=a.socket,this.#a8||this.#ay.socket.unref?.();let c=this.#ay.controller.dispatcher?.webSocketOptions?.maxFragments,d=this.#ay.controller.dispatcher?.webSocketOptions?.maxPayloadSize,e=new y(this.#ay,b,{maxFragments:c,maxPayloadSize:d});e.on("drain",()=>this.#ay.onParserDrain()),e.on("error",a=>this.#ay.onParserError(a)),this.#aB=e,this.#a9=new E(a.socket),this.#ay.readyState=i.OPEN;let f=a.headersList.get("sec-websocket-extensions");null!==f&&(this.#a7=f);let g=a.headersList.get("sec-websocket-protocol");if(null!==g&&(this.#a6=g),r("open",this),G.open.hasSubscribers){var h;let b=a.headersList.entries;G.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.#a6,extensions:this.#a7,websocket:this,handshakeResponse:{status:a.status,statusText:a.statusText,headers:b}})}}#aA(a,b){let c;if(this.#ay.readyState===i.OPEN){if(a===l.TEXT)try{c=s(b)}catch{x(this.#ay,1007,"Received invalid UTF-8 in text frame.");return}else a===l.BINARY&&(c="blob"===this.#bb?new Blob([b]):t(b));r("message",this,D,{origin:this.#ar.origin,data:c})}}#ba(){this.#ay.socket.resume()}#aC(){let a=this.#ay.closeState.has(j.SENT)&&this.#ay.closeState.has(j.RECEIVED),b=1005,c="",d=this.#aB?.closingInfo;d&&!d.error&&(b=d.code??1005,c=d.reason),this.#ay.readyState=i.CLOSED,this.#ay.closeState.has(j.RECEIVED)||(b=1006,r("error",this,(a,b)=>new B(a,b),{error:TypeError(c)})),r("close",this,(a,b)=>new C(a,b),{wasClean:a,code:b,reason:c}),G.close.hasSubscribers&&G.close.publish({websocket:this,code:b,reason:c})}static ping(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.#ay.readyState;if(n(c)&&!o(c)&&!p(c)){let c=new F(b);a.#ay.socket.write(c.createFrame(l.PING))}}}let{ping:K}=J;Reflect.deleteProperty(J,"ping"),J.CONNECTING=J.prototype.CONNECTING=i.CONNECTING,J.OPEN=J.prototype.OPEN=i.OPEN,J.CLOSING=J.prototype.CLOSING=i.CLOSING,J.CLOSED=J.prototype.CLOSED=i.CLOSED,Object.defineProperties(J.prototype,{CONNECTING:h,OPEN:h,CLOSING:h,CLOSED:h,url:z,readyState:z,bufferedAmount:z,onopen:z,onerror:z,onclose:z,close:z,onmessage:z,binaryType:z,send:z,extensions:z,protocol:z,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}}),Object.defineProperties(J,{CONNECTING:h,OPEN:h,CLOSING:h,CLOSED:h}),e.converters["sequence<DOMString>"]=e.sequenceConverter(e.converters.DOMString),e.converters["DOMString or sequence<DOMString>"]=function(a,b,c){return e.util.Type(a)===e.util.Types.OBJECT&&Symbol.iterator in a?e.converters["sequence<DOMString>"](a):e.converters.DOMString(a,b,c)},e.converters.WebSocketInit=e.dictionaryConverter([{key:"protocols",converter:e.converters["DOMString or sequence<DOMString>"],defaultValue:()=>[]},{key:"dispatcher",converter:e.converters.any,defaultValue:()=>A()},{key:"headers",converter:e.nullableConverter(e.converters.HeadersInit)}]),e.converters["DOMString or sequence<DOMString> or WebSocketInit"]=function(a){return e.util.Type(a)!==e.util.Types.OBJECT||Symbol.iterator in a?{protocols:e.converters["DOMString or sequence<DOMString>"](a)}:e.converters.WebSocketInit(a)},e.converters.WebSocketSendData=function(a){return e.util.Type(a)===e.util.Types.OBJECT&&(e.is.Blob(a)||e.is.BufferSource(a))?a:e.converters.USVString(a)},a.exports={WebSocket:J,ping:K}},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");const{maxConcurrentStreams:c,pipelining:e,...f}=b??{},g=c??100;let 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}}()},54838:(a,b,c)=>{"use strict";c.d(b,{$D:()=>s,Oj:()=>g,P9:()=>n,We:()=>i,ZF:()=>p,Zm:()=>f,aZ:()=>x,cr:()=>v,gI:()=>o,h3:()=>h,rG:()=>m,yh:()=>w});let d="-agentic",e="-thinking",f=64,g=10237,h=64;function i(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 j={minimal:512,low:1024,medium:8192,high:24576,xhigh:32768,max:128e3},k=new Set(["1","true","yes","on"]),l=new Set(["0","false","no","off"]),m=`
291
297
  # CRITICAL: CHUNKED WRITE PROTOCOL (MANDATORY)
292
298
 
293
299
  You MUST follow these rules for ALL file operations. Violation causes server timeouts and task failure.
@@ -336,8 +342,8 @@ WRONG: Generating massive code blocks without chunking -> TIMEOUT
336
342
  - Failed writes waste time and require retry
337
343
 
338
344
  REMEMBER: When in doubt, write LESS per operation. Multiple small operations > one large operation.
339
- `.trim();function l(a,b,c){if(function(a){if(!a||"object"!=typeof a)return!1;let b=a.thinking;if(b&&"object"==typeof b&&"disabled"===b.type)return!0;let c=a.reasoning_effort??(a.reasoning&&"object"==typeof a.reasoning?a.reasoning.effort:null);return"string"==typeof c&&"none"===c.toLowerCase()}(a))return!1;if(b){let a=function(a,b){if(!a)return;if("function"==typeof a.get)return a.get(b);let c=b.toLowerCase();for(let b of Object.keys(a))if(b.toLowerCase()===c)return a[b]}(b,"anthropic-beta");if("string"==typeof a&&a.toLowerCase().includes("interleaved-thinking"))return!0}if(a&&"object"==typeof a){let b=a.thinking;if(b&&"object"==typeof b&&"enabled"===b.type){let a=Number(b.budget_tokens);if(!Number.isFinite(a)||a>0)return!0}let c=a.reasoning_effort??(a.reasoning&&"object"==typeof a.reasoning?a.reasoning.effort:null);if("string"==typeof c){let a=c.toLowerCase();if(a&&"none"!==a&&("low"===a||"medium"===a||"high"===a||"auto"===a))return!0}if(function(a){for(let b of Array.isArray(a?.messages)?a.messages:[]){if(!b||"system"!==b.role&&"user"!==b.role)continue;let a=b.content;if("string"==typeof a){if(r(a))return!0}else if(Array.isArray(a))for(let b of a){let a=b?.text;if("string"==typeof a&&r(a))return!0}}return!!("string"==typeof a?.system&&r(a.system))}(a))return!0}if("string"==typeof c&&c){let a=c.toLowerCase();if(a.includes("thinking")||a.includes("-reason"))return!0}return!1}function m(a){let b=t(s(a?.kiro_expose_reasoning,a?.kiroExposeReasoning,a?.metadata?.kiro_expose_reasoning,a?.metadata?.kiroExposeReasoning,a?.extra_body?.kiro_expose_reasoning,a?.extra_body?.kiroExposeReasoning));if(null!==b)return b;let c="u">typeof process?process.env:{};return!0===t(s(c.KIRO_EXPOSE_REASONING,c.ZEVAI_EXPOSE_REASONING))}function n(a){return"string"==typeof a&&a.endsWith(d)}function o(a){return"string"==typeof a&&a.endsWith(e)}function p(a){var b,c;let f=a,g=!1,h=!1;return n(f)&&(g=!0,f=n(b=f)?b.slice(0,-d.length):b),o(f)&&(h=!0,f=o(c=f)?c.slice(0,-e.length):c),{upstream:f,agentic:g,thinking:h}}function q(a=16e3){let b=Math.max(1,Math.min(32e3,Number(a)||16e3));return`<thinking_mode>enabled</thinking_mode>
340
- <max_thinking_length>${b}</max_thinking_length>`}function r(a){return!!a&&!!a.includes("<thinking_mode>")&&(a.includes("<thinking_mode>enabled</thinking_mode>")||a.includes("<thinking_mode>interleaved</thinking_mode>"))}function s(...a){return a.find(a=>null!=a)}function t(a){if("boolean"==typeof a)return a;if("number"==typeof a)return 1===a||0!==a&&null;if("string"!=typeof a)return null;let b=a.trim().toLowerCase();return!!i.has(b)||!j.has(b)&&null}},54849:(a,b,c)=>{"use strict";let{WebsocketFrameSend:d}=c(45221),{opcodes:e,sendHints:f}=c(62026),g=c(50329);class h{#bc=new g;#bd=!1;#be;constructor(a){this.#be=a}add(a,b,c){if(c!==f.blob){if(this.#bd){let d={promise:null,callback:b,frame:i(a,c)};this.#bc.push(d)}else if(c===f.text){let{0:c,1:e}=d.createFastTextFrame(a);this.#be.cork(),this.#be.write(c),this.#be.write(e,b),this.#be.uncork()}else this.#be.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.#bc.push(e),this.#bd||this.#bf()}async #bf(){this.#bd=!0;let a=this.#bc;for(;!a.isEmpty();){let b=a.shift();null!==b.promise&&await b.promise,this.#be.write(b.frame,b.callback),b.callback=b.frame=null}this.#bd=!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}},54940:(a,b,c)=>{"use strict";c.d(b,{A:()=>p});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=`
345
+ `.trim();function n(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=j[d.toLowerCase()];if(a)return a}let e=a?.thinking;if(e&&"object"==typeof e&&"enabled"===e.type){let a=Number(e.budget_tokens);return Number.isFinite(a)&&a>0?a:16e3}let f=a?.reasoning_effort??(a?.reasoning&&"object"==typeof a.reasoning?a.reasoning.effort:null);if("string"==typeof f){let a=f.toLowerCase();if("auto"===a)return 16e3;let b=j[a];if(b)return b}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(y(a))return!0}else if(Array.isArray(a))for(let b of a){let a=b?.text;if("string"==typeof a&&y(a))return!0}}return!!("string"==typeof a?.system&&y(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 o(a,b,c){return null!==n(a,b,c)}function p(a){let b=A(z(a?.kiro_expose_reasoning,a?.kiroExposeReasoning,a?.metadata?.kiro_expose_reasoning,a?.metadata?.kiroExposeReasoning,a?.extra_body?.kiro_expose_reasoning,a?.extra_body?.kiroExposeReasoning));if(null!==b)return b;let c="u">typeof process?process.env:{};return!0===A(z(c.KIRO_EXPOSE_REASONING,c.ZEVAI_EXPOSE_REASONING))}function q(a){return"string"==typeof a&&a.endsWith(d)}function r(a){return"string"==typeof a&&a.endsWith(e)}function s(a){var b,c;let f=a,g=!1,h=!1;return q(f)&&(g=!0,f=q(b=f)?b.slice(0,-d.length):b),r(f)&&(h=!0,f=r(c=f)?c.slice(0,-e.length):c),{upstream:f,agentic:g,thinking:h}}function t(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"max"===c?"xhigh":["low","medium","high","xhigh"].includes(c)?c:null}function u(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=b.match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);if(!c)return null;let d=Number(c[1]),e=void 0===c[2]?null:Number(c[2]);return d<4||4===d&&(null===e||e<=5||null!==e&&e>=1e3)?null:"output_config"}function v(a,b){return"reasoning"===u(b)&&null!==t(a)}function w(a,b){let c=u(b);if(!c)return;if("reasoning"===c){let b=t(a);return b?{reasoning:{effort:b}}:void 0}let d=function(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"none"===c||"off"===c||"disabled"===c?null:"xhigh"===c||"max"===c?"high":["low","medium","high"].includes(c)?c:null}(a);return d?{thinking:{type:"adaptive",display:"summarized"},output_config:{effort:d}}:void 0}function x(a=16e3){let b=Math.max(1,Math.min(32e3,Number(a)||16e3));return`<thinking_mode>enabled</thinking_mode>
346
+ <max_thinking_length>${b}</max_thinking_length>`}function y(a){return!!a&&!!a.includes("<thinking_mode>")&&(a.includes("<thinking_mode>enabled</thinking_mode>")||a.includes("<thinking_mode>interleaved</thinking_mode>"))}function z(...a){return a.find(a=>null!=a)}function A(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!!k.has(b)||!l.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{#bc=new g;#bd=!1;#be;constructor(a){this.#be=a}add(a,b,c){if(c!==f.blob){if(this.#bd){let d={promise:null,callback:b,frame:i(a,c)};this.#bc.push(d)}else if(c===f.text){let{0:c,1:e}=d.createFastTextFrame(a);this.#be.cork(),this.#be.write(c),this.#be.write(e,b),this.#be.uncork()}else this.#be.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.#bc.push(e),this.#bd||this.#bf()}async #bf(){this.#bd=!0;let a=this.#bc;for(;!a.isEmpty();){let b=a.shift();null!==b.promise&&await b.promise,this.#be.write(b.frame,b.callback),b.callback=b.frame=null}this.#bd=!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}},54940:(a,b,c)=>{"use strict";c.d(b,{A:()=>p});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=`
341
347
  import readline from "node:readline";
342
348
  const TOOLS = JSON.parse(process.env.DEVIN_MCP_TOOLS || "[]");
343
349
  const RESULTS = JSON.parse(process.env.DEVIN_MCP_RESULTS || "{}");
@@ -385,7 +391,7 @@ ${d}`))}return b.join("\n\n")||"(empty)"}(k),p=function(a){let b=[],c=a=>{"strin
385
391
 
386
392
  `):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}})}
387
393
 
388
- `),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:"9router",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}}}}let p=o},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){for(let[a,b]of this._sessionCache)if(void 0===b.deref())return void this._sessionCache.delete(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(42541),c(90943),c(72610),c(51525),c(43212),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{const 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.r(b),c.d(b,{openaiResponsesToOpenAIResponse:()=>o,openaiToOpenAIResponsesResponse:()=>f});var d=c(56294),e=c(42541);function f(a,b){if(!a){var c=b;if(c.completedSent)return[];let a=[],d=(b,d)=>{d.sequence_number=++c.seq,a.push({event:b,data:d})};for(let a in c.msgItemAdded)k(c,d,a);for(let a in j(c,d),c.funcCallIds)l(c,d,a);return m(c,d),a}if(!a.choices?.length)return[];let d=[],e=(a,c)=>{c.sequence_number=++b.seq,d.push({event:a,data:c})},f=a.choices[0],n=f.index||0,o=f.delta||{};if(b.started||(b.started=!0,b.responseId=a.id?`resp_${a.id}`:b.responseId,e("response.created",{type:"response.created",response:{id:b.responseId,object:"response",created_at:b.created,status:"in_progress",background:!1,error:null,output:[]}}),e("response.in_progress",{type:"response.in_progress",response:{id:b.responseId,object:"response",created_at:b.created,status:"in_progress"}})),o.reasoning_content&&(h(b,e,n),i(b,e,o.reasoning_content)),o.content){let a=o.content;if(a.includes("<think>")&&(b.inThinking=!0,a=a.replace("<think>",""),h(b,e,n)),a.includes("</think>")){let c=a.split("</think>"),d=c[0],f=c.slice(1).join("</think>");d&&i(b,e,d),j(b,e),b.inThinking=!1,a=f}if(b.inThinking&&a)return i(b,e,a),d;a&&function(a,b,c,d){if(!a.msgItemAdded[c]){a.msgItemAdded[c]=!0,a.msgOutputIndices[c]=g(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,e,n,a)}if(o.tool_calls)for(let a of(k(b,e,n),o.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]=g(a)),f&&(a.funcNames[d]=f),!a.funcCallIds[d]&&e&&(a.funcCallIds[d]=e,b("response.output_item.added",{type:"response.output_item.added",output_index:a.funcOutputIndices[d],item:{id:`fc_${e}`,type:"function_call",arguments:"",call_id:e,name:a.funcNames[d]||""}})),a.funcArgsBuf[d]||(a.funcArgsBuf[d]=""),c.function?.arguments){let f=a.funcCallIds[d]||e;f&&b("response.function_call_arguments.delta",{type:"response.function_call_arguments.delta",item_id:`fc_${f}`,output_index:a.funcOutputIndices[d],delta:c.function.arguments}),a.funcArgsBuf[d]+=c.function.arguments}}(b,e,a);if(a.usage&&"object"==typeof a.usage&&!b.usage&&(b.usage=a.usage),f.finish_reason){for(let a in b.msgItemAdded)k(b,e,a);for(let a in j(b,e),b.funcCallIds)l(b,e,a);m(b,e)}return d}function g(a){let b=Number.isInteger(a.nextOutputIndex)?a.nextOutputIndex:0;return a.nextOutputIndex=b+1,b}function h(a,b,c){a.reasoningId||(a.reasoningId=`rs_${a.responseId}_${c}`,a.reasoningIndex=g(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 i(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 j(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 k(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 l(a,b,c){let d=a.funcCallIds[c];if(d&&!a.funcItemDone[c]){let e=a.funcArgsBuf[c]||"{}",f=a.funcOutputIndices[c];b("response.function_call_arguments.done",{type:"response.function_call_arguments.done",item_id:`fc_${d}`,output_index:f,arguments:e}),b("response.output_item.done",{type:"response.output_item.done",output_index:f,item:{id:`fc_${d}`,type:"function_call",arguments:e,call_id:d,name:a.funcNames[c]||""}}),a.funcItemDone[c]=!0,a.funcArgsDone[c]=!0}}function m(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];d&&b.push({index:a.funcOutputIndices[c]??0,item:{id:`fc_${d}`,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)};if(a.model&&(c.model=a.model),a.usage&&"object"==typeof a.usage){let b=a.usage.input_tokens??a.usage.prompt_tokens??0,d=a.usage.output_tokens??a.usage.completion_tokens??0,e=a.usage.input_tokens_details?.cached_tokens??a.usage.prompt_tokens_details?.cached_tokens??0,f=a.usage.output_tokens_details?.reasoning_tokens??a.usage.completion_tokens_details?.reasoning_tokens??0,g={input_tokens:b,output_tokens:d,total_tokens:a.usage.total_tokens??b+d};e>0&&(g.input_tokens_details={cached_tokens:e}),f>0&&(g.output_tokens_details={reasoning_tokens:f}),c.usage=g}b("response.completed",{type:"response.completed",response:c})}}function n(a){return a.toolCallIndex>0||a.currentToolCallId?"tool_calls":"stop"}function o(a,b){if(!a){if(b.finishReasonSent||!b.started)return null;let a=n(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),"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=d.item;return b.currentToolCallId=a.call_id||`call_${Date.now()}`,{id:b.chatId,object:"chat.completion.chunk",created:b.created,model:b.model||"unknown",choices:[{index:0,delta:{tool_calls:[{index:b.toolCallIndex,id:b.currentToolCallId,type:"function",function:{name:a.name||"",arguments:""}}]},finish_reason:null}]}}if("response.function_call_arguments.delta"===c||"response.custom_tool_call_input.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:{tool_calls:[{index:b.toolCallIndex,function:{arguments:a}}]},finish_reason:null}]}:null}if("response.output_item.done"===c&&(d.item?.type==="function_call"||d.item?.type==="custom_tool_call"))return b.toolCallIndex++,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=n(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,d.kz)(e.h.OPENAI,e.h.OPENAI_RESPONSES,null,f),(0,d.kz)(e.h.OPENAI_RESPONSES,e.h.OPENAI,null,o)},56294:(a,b,c)=>{"use strict";c.d(b,{Ws:()=>v,kz:()=>r,GH:()=>t,Y8:()=>u});var d=c(42541);let e=/^[a-zA-Z0-9_-]+$/;function f(a=0,b=0,c=""){let d=c?`_${c.replace(/[^a-zA-Z0-9_-]/g,"")}`:"";return`call_msg${a}_tc${b}${d}`}function g(a){if(!a||"string"!=typeof a)return null;let b=a.replace(/[^a-zA-Z0-9_-]/g,"");return b.length>0?b:null}var h=c(65556);c(58455);var i=c(42946),j=c(93745),k=c(41207);let l=new Set(["minimax","minimax-cn"]),m=["text","image_url","image","input_audio","audio_url"];var n=c(19458);let o=new Map,p=new Map,q=!1;function r(a,b,c,d){let e=`${a}:${b}`;c&&o.set(e,c),d&&p.set(e,d)}function s(){q||(q=!0,c(94026),c(15822),c(49065),c(42671),c(37582),c(76348),c(70884),c(20585),c(29101),c(65998),c(83010),c(40784),c(41222),c(87658),c(28113),c(50270),c(56248),c(77801),c(18686),c(23242),c(65294))}function t(a,b,c,p,q=!0,r=null,u=null,v=null,w=[],x=null,y=null){s();let z=p;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=""))}(z,w),(0,n.SZ)(z),!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)}}}}(z),!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}(z),b===d.h.ANTIGRAVITY&&r&&(r._clientSessionId=(0,j.YC)(z,r,x,b)),a!==b){let e=a!==d.h.OPENAI&&b!==d.h.OPENAI?o.get(`${a}:${b}`):null;if(e)z=e(c,z,q,r,u);else{if(a!==d.h.OPENAI){let b=o.get(`${a}:${d.h.OPENAI}`);b&&(z=b(c,z,q,r),v?.logOpenAIRequest?.(z))}if(b!==d.h.OPENAI){let a=o.get(`${d.h.OPENAI}:${b}`);a&&(z=a(c,z,q,r,u))}}}if(b===d.h.OPENAI&&(z=function(a){if(!a.messages||!Array.isArray(a.messages))return a;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(m.includes(c.type)){let{signature:a,cache_control:d,...e}=c;b.push(e)}else if("tool_use"===c.type)continue;else if("tool_result"===c.type){let{signature:a,cache_control:d,...e}=c;b.push(e)}}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}(z)),b===d.h.CLAUDE&&(z=function(a,b=null,c=null,d=null){if(l.has(b)&&delete a.output_config,a.system&&Array.isArray(a.system)&&(a.system=a.system.map((b,c)=>{let{cache_control:d,...e}=b;return c===a.system.length-1?{...e,cache_control:{type:"ephemeral",ttl:"1h"}}:e})),a.messages&&Array.isArray(a.messages)){let c=a.messages.length,d=[];for(let b=0;b<c;b++){let e=a.messages[b];if(Array.isArray(e.content))for(let a of e.content)delete a.cache_control;(b===c-1&&"assistant"===e.role||"string"==typeof e.content&&e.content.trim()||Array.isArray(e.content)&&e.content.some(a=>"text"===a.type&&a.text?.trim()||"tool_use"===a.type||"tool_result"===a.type||"image"===a.type||"audio"===a.type))&&d.push(e)}d=function(a){if(a.length<=1)return a;for(let b of a)if("assistant"===b.role&&Array.isArray(b.content)&&b.content.some(a=>"tool_use"===a.type)){let a=[],c=!1;for(let d of b.content)"tool_use"===d.type?(c=!0,a.push(d)):"thinking"===d.type||"redacted_thinking"===d.type?a.push(d):c||a.push(d);b.content=a}let b=[];for(let c of a){let a=b[b.length-1];if(a&&a.role===c.role){let b=Array.isArray(a.content)?a.content:[{type:"text",text:a.content}],d=Array.isArray(c.content)?c.content:[{type:"text",text:c.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{let a=Array.isArray(c.content)?c.content:[{type:"text",text:c.content}];b.push({role:c.role,content:[...a]})}}return b}(d),a.messages=d;let e=d[d.length-1],f=e?.role==="user",g=a.thinking?.type==="enabled"&&f,i=!1;for(let a=d.length-1;a>=0;a--){let c=d[a];if("assistant"===c.role&&Array.isArray(c.content)){if(!i&&c.content.length>0){for(let a=c.content.length-1;a>=0;a--){let b=c.content[a];if("thinking"!==b.type&&"redacted_thinking"!==b.type){b.cache_control={type:"ephemeral"};break}}i=!0}if("claude"===b||b?.startsWith("anthropic-compatible")){let a=!1,b=!1;for(let d of c.content)("thinking"===d.type||"redacted_thinking"===d.type)&&(d.signature=h.xr,b=!0),"tool_use"===d.type&&(a=!0);g&&!b&&a&&c.content.unshift({type:"thinking",thinking:".",signature:h.xr})}}}}if(a.tools&&Array.isArray(a.tools)&&("claude"!==b&&(a.tools=a.tools.filter(a=>!a.type||"function"===a.type)),a.tools=a.tools.map((b,c)=>{let{cache_control:d,...e}=b;return(e.input_schema&&"object"==typeof e.input_schema&&(e.input_schema=(0,k.e)(e.input_schema)),c===a.tools.length-1)?{...e,cache_control:{type:"ephemeral",ttl:"1h"}}:e}),0===a.tools.length&&(delete a.tools,delete a.tool_choice)),("claude"===b||b?.startsWith("anthropic-compatible"))&&c){let b=d?(0,j.RF)(d):null;a=(0,i.fO)(a,c,b)}return a}(z,u,r?.accessToken||r?.apiKey||null,x)),"claude"===u){let a=r?.accessToken||r?.apiKey||null;if(a?.includes("sk-ant-oat")){let{body:a,toolNameMap:b}=(0,i.Az)(z);z=a,b?.size>0&&(z._toolNameMap=b)}}return z}function u(a,b,c,e){if(s(),b===a)return[c];let f=[c],g=null,h=a!==d.h.OPENAI&&b!==d.h.OPENAI?p.get(`${a}:${b}`):null;if(h){let a=h(c,e);return a?Array.isArray(a)?a:[a]:[]}if(a!==d.h.OPENAI){let b=p.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 a=p.get(`${d.h.OPENAI}:${b}`);if(a){let b=[];for(let c of f){let d=a(c,e);d&&b.push(...Array.isArray(d)?d:[d])}f=b}}return g&&b!==d.h.OPENAI&&a!==d.h.OPENAI&&(f._openaiIntermediate=g),f}function v(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:{},funcCallIds:{},funcArgsDone:{},funcItemDone:{},funcOutputIndices:{},completedSent:!1}:b}},56698:(a,b,c)=>{"use strict";let d=c(34589);class e{#bg=!1;#bh;#ay;#bi;#bj;constructor(a,b,c){if("function"!=typeof a)throw TypeError("callback must be a function");this.#bh=a,this.#ay=b,this.#bj=c}onRequestStart(a,b){this.#bg=!1,this.#bi=b}onRequestUpgrade(a,b,c,d){this.#ay.onRequestUpgrade?.(a,b,c,d)}onResponseStart(a,b,c,e){if(d(null!=this.#bh),this.#bg=304===b||this.#bj&&b>=500&&b<=504,this.#bh(this.#bg,this.#bi,b,c),this.#bh=null,this.#bg)return!0;this.#ay.onRequestStart?.(a,this.#bi),this.#ay.onResponseStart?.(a,b,c,e)}onResponseData(a,b){if(!this.#bg)return this.#ay.onResponseData?.(a,b)}onResponseEnd(a,b){this.#bg||this.#ay.onResponseEnd?.(a,b)}onResponseError(a,b){if(!this.#bg){if(this.#bh){if(this.#bj){this.#bg=!0,this.#bh(!0,this.#bi),this.#bh=null;return}this.#bh(!1),this.#bh=null}if("function"==typeof this.#ay.onResponseError)this.#ay.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{#bk=new Map;clear(){this.#bk.clear()}has(a){return this.#bk.get(a)??this.#bl(a)}set(a,b){if(!1===e.includes(a))throw TypeError(`unknown feature: ${a}`);this.#bk.set(a,b)}#bl(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.#bk.set(a,b),b}}let g=new f;a.exports.runtimeFeatures=g,a.exports.default=g},57431:(a,b,c)=>{"use strict";c.r(b),c.d(b,{admitApiKeyRequest:()=>p,checkApiKeyBudget:()=>u,createApiKey:()=>m,deleteApiKey:()=>q,getApiKeyById:()=>l,getApiKeyConnectionPolicy:()=>t,getApiKeyPolicy:()=>s,getApiKeys:()=>k,maskApiKey:()=>i,rotateApiKey:()=>o,updateApiKey:()=>n,validateApiKey:()=>r});var d=c(27137),e=c(24081);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,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)}: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 = ?, allowedModels = ?, allowedConnectionIds = ? WHERE id = ?",[f.key,f.name,f.machineId,+!!f.isActive,Number(f.budgetDaily)||0,Number(f.budgetMonthly)||0,Number(f.requestsPerMinute)||0,JSON.stringify(f.allowedModels||[]),JSON.stringify(h(f.allowedConnectionIds)),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 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))}):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){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");const{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"]}},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(24081),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])}}}},59039:(a,b,c)=>{"use strict";c.a(a,async(a,b)=>{try{c(58500),c(19458),c(56294),c(42541),c(11484),c(87164),c(91083),c(32210),c(1758),c(8735),c(27696),c(51525),c(70321);var d=c(65333);c(72610),c(55599),c(5275),c(51658),c(1447),c(15783),c(4818),c(63299),c(50570),c(77745),c(44089),c(70474),c(6699),c(93745),c(60856),c(83651);var e=a([d]);d=(e.then?(await e)():e)[0],b()}catch(a){b(a)}})},59067:(a,b,c)=>{"use strict";c.d(b,{hG:()=>r});var d=c(77598),e=c.n(d),f=c(69384),g=c(30395),h=c(79154),i=c(80993),j=c(32210),k=c(93745),l=c(41310);let m=/^(rs|fc|resp|msg)_/,n=new Set(["web_search","x_search","web_search_preview","file_search","image_generation","code_interpreter","mcp","local_shell"]),o=new Set(["model","input","instructions","tools","tool_choice","stream","store","reasoning","include","temperature","top_p","max_output_tokens","parallel_tool_calls","text","metadata","prompt_cache_key"]),p=["low","medium","high"],q=new Map;class r extends f.Hv{constructor(){super("grok-cli",g.xq["grok-cli"]),this._currentSessionId=null,this._currentReqId=null,this._currentTurnIdx=1,this._agentId=null}buildUrl(){return this.config.baseUrl}async refreshCredentials(a,b){return a?.refreshToken?(0,h.Vq)("grok-cli",a,b):null}needsRefresh(a){return(0,h.fp)("grok-cli",a)}buildHeaders(a,b=!0){let c=super.buildHeaders(a,b);for(let[a,b]of Object.entries(this.config.headers||{}))null!=b&&void 0===c[a]&&(c[a]=b);c["x-xai-token-auth"]=this.config.tokenAuth||"xai-grok-cli",c["x-grok-client-identifier"]=this.config.clientIdentifier||c["x-grok-client-identifier"]||"grok-pager",c["x-grok-client-version"]=this.config.clientVersion||c["x-grok-client-version"]||"0.2.93",c["x-authenticateresponse"]="authenticate-response";let d=this._currentSessionId||a?.connectionId||e().randomUUID(),f=this._currentReqId||e().randomUUID();c["x-grok-session-id"]=d,c["x-grok-conv-id"]=d,c["x-grok-req-id"]=f,c["x-grok-turn-idx"]=String(this._currentTurnIdx||1),this._agentId&&(c["x-grok-agent-id"]=this._agentId),this._currentModel&&(c["x-grok-model-override"]=this._currentModel),this.config.compactionAt&&(c["x-compaction-at"]=String(this.config.compactionAt));let g=a?.providerSpecificData||{},h=g.email||a?.email,i=g.userId||a?.userId||a?.providerUserId;return h&&(c["x-email"]=h),i&&(c["x-userid"]=i),c}parseError(a,b){if(402===a.status&&b)try{let a=JSON.parse(b),c=a?.code||"",d=a?.error||a?.message||b;return{status:402,message:"string"==typeof d?d:b,code:"string"==typeof c?c:void 0}}catch{}return super.parseError(a,b)}transformRequest(a,b,c,d){this._currentSessionId=(0,k.oV)({headers:d?.rawHeaders,body:b,connectionId:d?.connectionId||d?.id,workspaceId:d?.providerSpecificData?.workspaceId,scope:"grok-cli"}),this._currentReqId=e().randomUUID(),this._agentId=d?.providerSpecificData?.deviceId||d?.providerSpecificData?.agentId||null;let f=(0,i.m)(b.input);f&&(b.input=f),(!b.input||Array.isArray(b.input)&&0===b.input.length)&&(Array.isArray(b.messages)&&b.messages.length>0?(b.input=b.messages.map(a=>({type:"message",role:a.role||"user",content:"string"==typeof a.content?a.content:JSON.stringify(a.content??"")})),delete b.messages):b.input=[{type:"message",role:"user",content:"..."}]),Array.isArray(b.input)&&(b.input=b.input.filter(a=>{if("string"==typeof a&&m.test(a))return!1;if(a&&"object"==typeof a&&!Array.isArray(a)){if("item_reference"===a.type)return!1;"string"==typeof a.id&&m.test(a.id)&&delete a.id}return!0})),function(a){if(!Array.isArray(a.tools))return;let b=new Set;if(a.tools=a.tools.filter(a=>{if(!a||"object"!=typeof a||Array.isArray(a))return!1;let c="string"==typeof a.type?a.type:"";if("function"!==c){if(n.has(c))return!0;if(!c&&a.function);else if(c&&"string"!=typeof a.name)return!1}if(!("function"===c||""===c||a.function||"string"==typeof a.name)||n.has(c))return n.has(c);let d=a.function&&"object"==typeof a.function&&!Array.isArray(a.function)?a.function:null,e=("string"==typeof a.name?a.name:"string"==typeof d?.name?d.name:"").trim();if(!e)return!1;let f="string"==typeof a.description?a.description:"string"==typeof d?.description?d.description:"",g=a.parameters&&"object"==typeof a.parameters&&!Array.isArray(a.parameters)?a.parameters:d?.parameters&&"object"==typeof d.parameters&&!Array.isArray(d.parameters)?d.parameters:{type:"object",properties:{}};for(let b of Object.keys(a))delete a[b];return a.type="function",a.name=e.slice(0,128),f&&(a.description=f),a.parameters=g,b.add(e),!0}),a.tool_choice&&"object"==typeof a.tool_choice&&!Array.isArray(a.tool_choice)&&"function"===a.tool_choice.type){let c="string"==typeof a.tool_choice.name?a.tool_choice.name.trim():"";c&&b.has(c)||delete a.tool_choice}}(b),this._currentTurnIdx=function(a,b){let c=function(a){if(!Array.isArray(a))return 1;let b=0;for(let c of a){if(!c||"object"!=typeof c||Array.isArray(c))continue;let a="string"==typeof c.type?c.type:"";"user"!==c.role||a&&"message"!==a||(b+=1)}return Math.max(1,b)}(b);if(!a)return c;let d=Date.now(),e=q.get(a),f=Math.max(c,e&&d-e.ts<=36e5?e.turn:0);return!e&&q.size>=5e3&&function(a){for(let[b,c]of q)a-c.ts>36e5&&q.delete(b);if(q.size<5e3)return;let b=null,c=1/0;for(let[a,d]of q)d.ts<c&&(c=d.ts,b=a);null!==b&&q.delete(b)}(d),q.set(a,{turn:f,ts:d}),f}(this._currentSessionId,b.input),b.stream=!0,b.store=!1;let g=function(a){if(!a||"string"!=typeof a)return null;for(let b of p)if(a.endsWith(`-${b}`))return b;return null}(b.model||a),h=b.model||a;if(g&&(h=h.replace(RegExp(`-${g}$`),"")),(h=(0,j.kt)("gcli",h)||h)===(b.model||a)&&(h=(0,j.kt)("grok-cli",h)||h),b.model=h,this._currentModel=h,b.reasoning&&"object"==typeof b.reasoning)b.reasoning.effort||(b.reasoning.effort=b.reasoning_effort||g||"high"),b.reasoning.summary||(b.reasoning.summary="concise");else{let a=b.reasoning_effort||g||"high";b.reasoning={effort:a,summary:"concise"}}if(delete b.reasoning_effort,b.reasoning?.effort&&"none"!==b.reasoning.effort){let a=Array.isArray(b.include)?b.include:[];a.includes("reasoning.encrypted_content")||a.push("reasoning.encrypted_content"),b.include=a}for(let a of(delete b.messages,delete b.max_tokens,delete b.max_completion_tokens,delete b.n,delete b.seed,delete b.logprobs,delete b.top_logprobs,delete b.frequency_penalty,delete b.presence_penalty,delete b.logit_bias,delete b.user,delete b.stream_options,delete b.prompt_cache_retention,delete b.safety_identifier,delete b.previous_response_id,Object.keys(b)))o.has(a)||delete b[a];return b}async execute(a){if(this._agentId||a.credentials?.providerSpecificData?.deviceId)a.credentials?.providerSpecificData?.deviceId&&(this._agentId=a.credentials.providerSpecificData.deviceId);else try{let a=await (0,l.Xj)("grok-cli-agent");this._agentId=[a.slice(0,8),a.slice(8,12),"5"+a.slice(13,16),"a"+a.slice(17,20),a.slice(0,12).padEnd(12,"0")].join("-")}catch{this._agentId=e().randomUUID()}return super.execute(a)}}},59970:(a,b,c)=>{"use strict";let d,e=Symbol.for("undici.globalDispatcher.2"),f=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:g}=c(61448),h=c(37417),i=c(74399);function j(a){if(!a||"function"!=typeof a.dispatch)throw new g("Argument agent must implement Agent");try{Object.defineProperty(globalThis,e,{value:a,writable:!0,enumerable:!1,configurable:!1})}catch(b){if(b instanceof TypeError){d=a;return}throw b}try{let b=a instanceof i?a:new i(a);Object.defineProperty(globalThis,f,{value:b,writable:!0,enumerable:!1,configurable:!1})}catch(a){if(!(a instanceof TypeError))throw a}}function k(){return globalThis[e]??d}void 0===k()&&j(new h),a.exports={setGlobalDispatcher:j,getGlobalDispatcher:k,installedExports:["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"]}},60083:(a,b,c)=>{"use strict";c.d(b,{H:()=>i});var d=c(69384),e=c(30395),f=c(80015);let g=new Set(["minimax-m2.5","minimax-m2.7"]),h="https://opencode.ai/zen/go/v1";class i extends d.Hv{constructor(){super("opencode-go",e.xq["opencode-go"])}buildUrl(a){return this._lastModel=a,g.has(a)?`${h}/messages`:`${h}/chat/completions`}buildHeaders(a,b=!0){let c=a?.apiKey||a?.accessToken,d={"Content-Type":"application/json"};return g.has(this._lastModel)?(d["x-api-key"]=c,d["anthropic-version"]="2023-06-01"):d.Authorization=`Bearer ${c}`,b&&(d.Accept="text/event-stream"),d}transformRequest(a,b){return(0,f.Z)({provider:this.provider,model:a,body:b})}}},60856:(a,b,c)=>{"use strict";c.d(b,{Nm:()=>h});var d=c(27432);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),{kUrl:m}=c(49176),n=c(84285),o=Symbol("factory"),p=Symbol("options"),q=Symbol("kGreatestCommonDivisor"),r=Symbol("kCurrentWeight"),s=Symbol("kIndex"),t=Symbol("kWeight"),u=Symbol("kMaxWeightPerServer"),v=Symbol("kErrorPenalty");function w(a,b){return new l(a,b)}class x extends f{constructor(a=[],{factory:b=w,...c}={}){if("function"!=typeof b)throw new e("factory must be a function.");for(const d of(super(),this[p]={...n.deepClone(c)},this[s]=-1,this[r]=0,this[u]=this[p].maxWeightPerServer||100,this[v]=this[p].errorPenalty||15,Array.isArray(a)||(a=[a]),this[o]=b,a))this.addUpstream(d);this._updateBalancedPoolStats()}addUpstream(a){let b=n.parseOrigin(a).origin;if(this[g].find(a=>a[m].origin===b&&!0!==a.closed&&!0!==a.destroyed))return this;let c=this[o](b,this[p]);for(let a of(this[i](c),c.on("connect",()=>{c[t]=Math.min(this[u],c[t]+this[v])}),c.on("connectionError",()=>{c[t]=Math.max(1,c[t]-this[v]),this._updateBalancedPoolStats()}),c.on("disconnect",(...a)=>{let b=a[2];b&&"UND_ERR_SOCKET"===b.code&&(c[t]=Math.max(1,c[t]-this[v]),this._updateBalancedPoolStats())}),this[g]))a[t]=this[u];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][t],a);this[q]=a}removeUpstream(a){let b=n.parseOrigin(a).origin,c=this[g].find(a=>a[m].origin===b&&!0!==a.closed&&!0!==a.destroyed);return c&&this[j](c),this}getUpstream(a){let b=n.parseOrigin(a).origin;return this[g].find(a=>a[m].origin===b&&!0!==a.closed&&!0!==a.destroyed)}get upstreams(){return this[g].filter(a=>!0!==a.closed&&!0!==a.destroyed).map(a=>a[m].origin)}[k](){if(0===this[g].length)throw new d;let a=0,b=-1;for(;a++<this[g].length;){this[s]=(this[s]+1)%this[g].length;let a=this[g][this[s]];if((0===this[s]&&(this[r]=this[r]-this[q],this[r]<=0&&(this[r]=this[u])),!a[h]&&!0!==a.closed&&!0!==a.destroyed)&&((-1===b||a[t]>this[g][b][t])&&(b=this[s]),a[t]>=this[r]))return a}if(-1!==b)return this[r]=this[g][b][t],this[s]=b,this[g][b]}}a.exports=x},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.UND_ERR_HTTP_PARSER");class K 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[J]}get[J](){return!0}}let L=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE");class M 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[L]}get[L](){return!0}}let N=Symbol.for("undici.error.UND_ERR_REQ_RETRY");class O 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[N]}get[N](){return!0}}let P=Symbol.for("undici.error.UND_ERR_RESPONSE");class Q extends c{constructor(a,b,{headers:c,body:d}){super(a),this.name="ResponseError",this.message=a||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=b,this.body=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_PRX_TLS");class S 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[R]}get[R](){return!0}}let T=Symbol.for("undici.error.UND_ERR_PRX_CONN");class U 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[T]}get[T](){return!0}}let V=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED");class W 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[V]}get[V](){return!0}}class X extends c{constructor(a,b){super(a),this.name="Socks5ProxyError",this.message=a||"SOCKS5 proxy error",this.code=b||"UND_ERR_SOCKS5"}}let Y=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED");class Z 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[Y]}get[Y](){return!0}}a.exports={AbortError:q,HTTPParserError:K,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:M,RequestRetryError:O,ResponseError:Q,SecureProxyConnectionError:S,ProxyConnectionError:U,MaxOriginsReachedError:W,Socks5ProxyError:X,MessageSizeExceededError:Z}},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:()=>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(){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),[h.n,m,o]))g().existsSync(a)||g().mkdirSync(a,{recursive:!0})}},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}},63299:(a,b,c)=>{"use strict";c(42541);let d='Before writing code, stop at the first rung that holds: 1) Does this need to exist? Skip if speculative (YAGNI). 2) Already in codebase? Reuse it. 3) Stdlib does it? Use stdlib. 4) Native platform feature? Use it (CSS over JS, <input type="date"> over picker lib, DB constraint over app code). 5) Installed dependency? Use it, never add new ones for what a few lines do. 6) One line? Write one line. 7) Only then: minimum code that works.',e="No unrequested abstractions. No boilerplate 'for later'. Deletion over addition. Fewest files. Shortest working diff. Mark simplifications: // ponytail: [reason]. Bug fix = root cause fix, not symptom patch.",f="Never simplify away: input validation at trust boundaries, error handling preventing data loss, security measures, accessibility, anything explicitly requested. User insists on full version → build it.",g="ACTIVE EVERY RESPONSE. No drift back to over-building. Still active if unsure.";["You are a lazy senior dev. Build what's asked, but name the lazier alternative in one line. User picks.",d,f,"Output: code first, then one line naming what could be simpler.",g].join(" "),["You are a lazy senior dev. The best code is the code never written. Enforce the ladder — stdlib and native first, shortest diff, shortest explanation.",d,e,f,"Output: code first, then at most 3 short lines: what was skipped, when to add it. Pattern: [code] → skipped: [X], add when [Y].",g].join(" "),["You are a YAGNI extremist. Deletion before addition. Ship the one-liner and challenge the rest of the requirement. The laziest solution that actually works.",d,e,f,"Output: one-liner or minimal code, then challenge: 'Do you actually need [X]?' No essays.",g].join(" ")},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,c=e(a?.connectionProxyUrl);return{connectionProxyEnabled:b,connectionProxyUrl:c,connectionNoProxy:e(a?.connectionNoProxy)}}(a);if(c){let a=await (0,d.hr)(c),b=e(a?.proxyUrl),f=e(a?.noProxy);if(a&&!0===a.isActive&&b){if("vercel"===a.type||"cloudflare"===a.type||"deno"===a.type)return{source:a.type,proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:f,strictProxy:!0===a.strictProxy,vercelRelayUrl:b};return{source:"pool",proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!0,connectionProxyUrl:b,connectionNoProxy:f,strictProxy:!0===a.strictProxy}}}if(f.connectionProxyEnabled&&f.connectionProxyUrl)return{source:"legacy",proxyPoolId:c||null,proxyPool:null,...f};return{source:"none",proxyPoolId:c||null,proxyPool:null,...f}}catch(a){return console.error("[resolveConnectionProxyConfig] Failed to resolve proxy config:",a),{source:"error",proxyPoolId:null,proxyPool:null,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:"",strictProxy:!1}}}},64156:(a,b,c)=>{"use strict";let d,{URL:e}=c(73136),f=c(5318),{InvalidArgumentError:g}=c(61448),{Socks5Client:h,STATES:i}=c(40603),{kBusy:j,kConnected:k,kDispatch:l,kClose:m,kDestroy:n}=c(49176),o=c(35689),p=c(55285),{debuglog:q}=c(57975),r=q("undici:socks5-proxy"),s=Symbol("proxy url"),t=Symbol("proxy headers"),u=Symbol("proxy auth"),v=Symbol("proxy protocol"),w=Symbol("pools"),x=Symbol("connector"),y=Symbol("request tls settings"),z=!1;class A extends f{constructor(a,b={}){if(super(),z||(process.emitWarning("SOCKS5 proxy support is experimental and subject to change","ExperimentalWarning"),z=!0),!a)throw new g("Proxy URL is mandatory");const c="string"==typeof a?new e(a):a;if("socks5:"!==c.protocol&&"socks:"!==c.protocol)throw new g("Proxy URL must use socks5:// or socks:// protocol");this[s]=c,this[t]=b.headers||{},this[v]=b.proxyTls?"https:":"http:",this[y]=b.requestTls,this[u]={username:b.username||(c.username?decodeURIComponent(c.username):null),password:b.password||(c.password?decodeURIComponent(c.password):null)},this[x]=b.connect||p({...b.proxyTls,servername:b.proxyTls?.servername||c.hostname}),this[w]=new Map}async createSocks5Connection(a,b){let c=this[s].hostname,d=parseInt(this[s].port)||1080;r("creating SOCKS5 connection to",c,d);let e=Promise.withResolvers();this[x]({hostname:c,host:c,port:d,protocol:this[v]},(a,b)=>{a?e.reject(a):e.resolve(b)});let f=await e.promise,g=new h(f,this[u]);g.on("error",a=>{r("SOCKS5 error:",a),f.destroy()}),await g.handshake();let j=Promise.withResolvers(),k=setTimeout(()=>{j.reject(Error("SOCKS5 authentication timeout"))},5e3),l=()=>{clearTimeout(k),g.removeListener("error",m),j.resolve()},m=a=>{clearTimeout(k),g.removeListener("authenticated",l),j.reject(a)};g.state===i.AUTHENTICATED?(clearTimeout(k),j.resolve()):(g.once("authenticated",l),g.once("error",m)),await j.promise,await g.connect(a,b);let n=Promise.withResolvers(),o=setTimeout(()=>{n.reject(Error("SOCKS5 connection timeout"))},5e3),p=c=>{r("SOCKS5 tunnel established to",a,b,"via",c),clearTimeout(o),g.removeListener("error",q),n.resolve()},q=a=>{clearTimeout(o),g.removeListener("connected",p),n.reject(a)};return g.once("connected",p),g.once("error",q),await n.promise,f}[l](a,b){let{origin:f}=a;r("dispatching request to",f,"via SOCKS5");try{let g=String(f),h=this[w].get(g);if(!h||h.destroyed||h.closed){h=new o(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);r("establishing SOCKS5 connection to",g,h);let i=await this.createSocks5Connection(g,h),j=i;if("https:"===a.protocol){d||(d=c(41692)),r("upgrading to TLS"),j=d.connect({...this[y],socket:i,servername:this[y]?.servername||g});let a=Promise.withResolvers();j.once("secureConnect",a.resolve),j.once("error",a.reject),await a.promise}b(null,j)}catch(a){r("SOCKS5 connection error:",a),b(a)}}}),this[w].set(g,h);let b=()=>{this[w].get(g)!==h||h[k]>0||h[j]||(this[w].delete(g),h.destroyed||h.close())};h.on("disconnect",b),h.on("connectionError",b)}return h[l](a,b)}catch(a){if(r("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 [m](){let a=[];for(let b of this[w].values())a.push(b.close());this[w].clear(),await Promise.all(a)}async [n](a){let b=[];for(let c of this[w].values())b.push(c.destroy(a));this[w].clear(),await Promise.all(b)}}a.exports=A},64304:(a,b,c)=>{"use strict";c.d(b,{Ay:()=>y});var d=c(69384),e=c(30395);let f=e.xq["perplexity-web"].baseUrl,g="2.18",h={"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"]},i={"pplx-gpt":"gpt54_thinking","pplx-sonnet":"claude46sonnetthinking","pplx-opus":"claude46opusthinking"},j=/\[\d+\]/g,k=/<grok:[^>]*>.*?<\/grok:[^>]*>/gs,l=/<grok:[^>]*\/>/g,m=/<[?]xml[^?]*[?]>/g,n=/<\/?response\b[^>]*>/gi,o=/ {2,}/g,p=/\n{3,}/g,q=new Map;function r(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 s(a,b,c,d){if(!d)return;let e=r([...a,{role:"user",content:b},{role:"assistant",content:c}]);if(q.set(e,{backendUuid:d,ts:Date.now()}),q.size>200){let a=null,b=1/0;for(let[c,d]of q)d.ts<b&&(b=d.ts,a=c);a&&q.delete(a)}}function t(a,b=!0){let c=a;return c=(c=(c=(c=(c=c.replace(m,"")).replace(j,"")).replace(k,"")).replace(l,"")).replace(n,""),b&&(c=(c=(c=c.replace(o," ")).replace(p,"\n\n")).trim()),c}async function*u(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*v(a,b){let c="",d=null,e=0,f=new Set;for await(let g of u(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 w(a){return`data: ${JSON.stringify(a)}
394
+ `),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:"9router",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}}}}let p=o},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){for(let[a,b]of this._sessionCache)if(void 0===b.deref())return void this._sessionCache.delete(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(42541),c(90943),c(72610),c(51525),c(43212),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{const 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.r(b),c.d(b,{openaiResponsesToOpenAIResponse:()=>o,openaiToOpenAIResponsesResponse:()=>f});var d=c(56294),e=c(42541);function f(a,b){if(!a){var c=b;if(c.completedSent)return[];let a=[],d=(b,d)=>{d.sequence_number=++c.seq,a.push({event:b,data:d})};for(let a in c.msgItemAdded)k(c,d,a);for(let a in j(c,d),c.funcCallIds)l(c,d,a);return m(c,d),a}if(!a.choices?.length)return[];let d=[],e=(a,c)=>{c.sequence_number=++b.seq,d.push({event:a,data:c})},f=a.choices[0],n=f.index||0,o=f.delta||{};if(b.started||(b.started=!0,b.responseId=a.id?`resp_${a.id}`:b.responseId,e("response.created",{type:"response.created",response:{id:b.responseId,object:"response",created_at:b.created,status:"in_progress",background:!1,error:null,output:[]}}),e("response.in_progress",{type:"response.in_progress",response:{id:b.responseId,object:"response",created_at:b.created,status:"in_progress"}})),o.reasoning_content&&(h(b,e,n),i(b,e,o.reasoning_content)),o.content){let a=o.content;if(a.includes("<think>")&&(b.inThinking=!0,a=a.replace("<think>",""),h(b,e,n)),a.includes("</think>")){let c=a.split("</think>"),d=c[0],f=c.slice(1).join("</think>");d&&i(b,e,d),j(b,e),b.inThinking=!1,a=f}if(b.inThinking&&a)return i(b,e,a),d;a&&function(a,b,c,d){if(!a.msgItemAdded[c]){a.msgItemAdded[c]=!0,a.msgOutputIndices[c]=g(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,e,n,a)}if(o.tool_calls)for(let a of(k(b,e,n),o.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]=g(a)),f&&(a.funcNames[d]=f),!a.funcCallIds[d]&&e&&(a.funcCallIds[d]=e,b("response.output_item.added",{type:"response.output_item.added",output_index:a.funcOutputIndices[d],item:{id:`fc_${e}`,type:"function_call",arguments:"",call_id:e,name:a.funcNames[d]||""}})),a.funcArgsBuf[d]||(a.funcArgsBuf[d]=""),c.function?.arguments){let f=a.funcCallIds[d]||e;f&&b("response.function_call_arguments.delta",{type:"response.function_call_arguments.delta",item_id:`fc_${f}`,output_index:a.funcOutputIndices[d],delta:c.function.arguments}),a.funcArgsBuf[d]+=c.function.arguments}}(b,e,a);if(a.usage&&"object"==typeof a.usage&&!b.usage&&(b.usage=a.usage),f.finish_reason){for(let a in b.msgItemAdded)k(b,e,a);for(let a in j(b,e),b.funcCallIds)l(b,e,a);m(b,e)}return d}function g(a){let b=Number.isInteger(a.nextOutputIndex)?a.nextOutputIndex:0;return a.nextOutputIndex=b+1,b}function h(a,b,c){a.reasoningId||(a.reasoningId=`rs_${a.responseId}_${c}`,a.reasoningIndex=g(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 i(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 j(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 k(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 l(a,b,c){let d=a.funcCallIds[c];if(d&&!a.funcItemDone[c]){let e=a.funcArgsBuf[c]||"{}",f=a.funcOutputIndices[c];b("response.function_call_arguments.done",{type:"response.function_call_arguments.done",item_id:`fc_${d}`,output_index:f,arguments:e}),b("response.output_item.done",{type:"response.output_item.done",output_index:f,item:{id:`fc_${d}`,type:"function_call",arguments:e,call_id:d,name:a.funcNames[c]||""}}),a.funcItemDone[c]=!0,a.funcArgsDone[c]=!0}}function m(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];d&&b.push({index:a.funcOutputIndices[c]??0,item:{id:`fc_${d}`,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)};if(a.model&&(c.model=a.model),a.usage&&"object"==typeof a.usage){let b=a.usage.input_tokens??a.usage.prompt_tokens??0,d=a.usage.output_tokens??a.usage.completion_tokens??0,e=a.usage.input_tokens_details?.cached_tokens??a.usage.prompt_tokens_details?.cached_tokens??0,f=a.usage.output_tokens_details?.reasoning_tokens??a.usage.completion_tokens_details?.reasoning_tokens??0,g={input_tokens:b,output_tokens:d,total_tokens:a.usage.total_tokens??b+d};e>0&&(g.input_tokens_details={cached_tokens:e}),f>0&&(g.output_tokens_details={reasoning_tokens:f}),c.usage=g}b("response.completed",{type:"response.completed",response:c})}}function n(a){return a.toolCallIndex>0||a.currentToolCallId?"tool_calls":"stop"}function o(a,b){if(!a){if(b.finishReasonSent||!b.started)return null;let a=n(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),"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=d.item;return b.currentToolCallId=a.call_id||`call_${Date.now()}`,{id:b.chatId,object:"chat.completion.chunk",created:b.created,model:b.model||"unknown",choices:[{index:0,delta:{tool_calls:[{index:b.toolCallIndex,id:b.currentToolCallId,type:"function",function:{name:a.name||"",arguments:""}}]},finish_reason:null}]}}if("response.function_call_arguments.delta"===c||"response.custom_tool_call_input.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:{tool_calls:[{index:b.toolCallIndex,function:{arguments:a}}]},finish_reason:null}]}:null}if("response.output_item.done"===c&&(d.item?.type==="function_call"||d.item?.type==="custom_tool_call"))return b.toolCallIndex++,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=n(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,d.kz)(e.h.OPENAI,e.h.OPENAI_RESPONSES,null,f),(0,d.kz)(e.h.OPENAI_RESPONSES,e.h.OPENAI,null,o)},56294:(a,b,c)=>{"use strict";c.d(b,{Ws:()=>v,kz:()=>r,GH:()=>t,Y8:()=>u});var d=c(42541);let e=/^[a-zA-Z0-9_-]+$/;function f(a=0,b=0,c=""){let d=c?`_${c.replace(/[^a-zA-Z0-9_-]/g,"")}`:"";return`call_msg${a}_tc${b}${d}`}function g(a){if(!a||"string"!=typeof a)return null;let b=a.replace(/[^a-zA-Z0-9_-]/g,"");return b.length>0?b:null}var h=c(65556);c(58455);var i=c(42946),j=c(93745),k=c(41207);let l=new Set(["minimax","minimax-cn"]),m=["text","image_url","image","input_audio","audio_url"];var n=c(19458);let o=new Map,p=new Map,q=!1;function r(a,b,c,d){let e=`${a}:${b}`;c&&o.set(e,c),d&&p.set(e,d)}function s(){q||(q=!0,c(94026),c(15822),c(49065),c(42671),c(37582),c(76348),c(70884),c(3143),c(29101),c(65998),c(83010),c(40784),c(41222),c(87658),c(28113),c(50270),c(56248),c(77801),c(18686),c(23242),c(65294))}function t(a,b,c,p,q=!0,r=null,u=null,v=null,w=[],x=null,y=null){s();let z=p;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=""))}(z,w),(0,n.SZ)(z),!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)}}}}(z),!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}(z),b===d.h.ANTIGRAVITY&&r&&(r._clientSessionId=(0,j.YC)(z,r,x,b)),a!==b){let e=a!==d.h.OPENAI&&b!==d.h.OPENAI?o.get(`${a}:${b}`):null;if(e)z=e(c,z,q,r,u);else{if(a!==d.h.OPENAI){let b=o.get(`${a}:${d.h.OPENAI}`);b&&(z=b(c,z,q,r),v?.logOpenAIRequest?.(z))}if(b!==d.h.OPENAI){let a=o.get(`${d.h.OPENAI}:${b}`);a&&(z=a(c,z,q,r,u))}}}if(b===d.h.OPENAI&&(z=function(a){if(!a.messages||!Array.isArray(a.messages))return a;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(m.includes(c.type)){let{signature:a,cache_control:d,...e}=c;b.push(e)}else if("tool_use"===c.type)continue;else if("tool_result"===c.type){let{signature:a,cache_control:d,...e}=c;b.push(e)}}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}(z)),b===d.h.CLAUDE&&(z=function(a,b=null,c=null,d=null){if(l.has(b)&&delete a.output_config,a.system&&Array.isArray(a.system)&&(a.system=a.system.map((b,c)=>{let{cache_control:d,...e}=b;return c===a.system.length-1?{...e,cache_control:{type:"ephemeral",ttl:"1h"}}:e})),a.messages&&Array.isArray(a.messages)){let c=a.messages.length,d=[];for(let b=0;b<c;b++){let e=a.messages[b];if(Array.isArray(e.content))for(let a of e.content)delete a.cache_control;(b===c-1&&"assistant"===e.role||"string"==typeof e.content&&e.content.trim()||Array.isArray(e.content)&&e.content.some(a=>"text"===a.type&&a.text?.trim()||"tool_use"===a.type||"tool_result"===a.type||"image"===a.type||"audio"===a.type))&&d.push(e)}d=function(a){if(a.length<=1)return a;for(let b of a)if("assistant"===b.role&&Array.isArray(b.content)&&b.content.some(a=>"tool_use"===a.type)){let a=[],c=!1;for(let d of b.content)"tool_use"===d.type?(c=!0,a.push(d)):"thinking"===d.type||"redacted_thinking"===d.type?a.push(d):c||a.push(d);b.content=a}let b=[];for(let c of a){let a=b[b.length-1];if(a&&a.role===c.role){let b=Array.isArray(a.content)?a.content:[{type:"text",text:a.content}],d=Array.isArray(c.content)?c.content:[{type:"text",text:c.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{let a=Array.isArray(c.content)?c.content:[{type:"text",text:c.content}];b.push({role:c.role,content:[...a]})}}return b}(d),a.messages=d;let e=d[d.length-1],f=e?.role==="user",g=a.thinking?.type==="enabled"&&f,i=!1;for(let a=d.length-1;a>=0;a--){let c=d[a];if("assistant"===c.role&&Array.isArray(c.content)){if(!i&&c.content.length>0){for(let a=c.content.length-1;a>=0;a--){let b=c.content[a];if("thinking"!==b.type&&"redacted_thinking"!==b.type){b.cache_control={type:"ephemeral"};break}}i=!0}if("claude"===b||b?.startsWith("anthropic-compatible")){let a=!1,b=!1;for(let d of c.content)("thinking"===d.type||"redacted_thinking"===d.type)&&(d.signature=h.xr,b=!0),"tool_use"===d.type&&(a=!0);g&&!b&&a&&c.content.unshift({type:"thinking",thinking:".",signature:h.xr})}}}}if(a.tools&&Array.isArray(a.tools)&&("claude"!==b&&(a.tools=a.tools.filter(a=>!a.type||"function"===a.type)),a.tools=a.tools.map((b,c)=>{let{cache_control:d,...e}=b;return(e.input_schema&&"object"==typeof e.input_schema&&(e.input_schema=(0,k.e)(e.input_schema)),c===a.tools.length-1)?{...e,cache_control:{type:"ephemeral",ttl:"1h"}}:e}),0===a.tools.length&&(delete a.tools,delete a.tool_choice)),("claude"===b||b?.startsWith("anthropic-compatible"))&&c){let b=d?(0,j.RF)(d):null;a=(0,i.fO)(a,c,b)}return a}(z,u,r?.accessToken||r?.apiKey||null,x)),"claude"===u){let a=r?.accessToken||r?.apiKey||null;if(a?.includes("sk-ant-oat")){let{body:a,toolNameMap:b}=(0,i.Az)(z);z=a,b?.size>0&&(z._toolNameMap=b)}}return z}function u(a,b,c,e){if(s(),b===a)return[c];let f=[c],g=null,h=a!==d.h.OPENAI&&b!==d.h.OPENAI?p.get(`${a}:${b}`):null;if(h){let a=h(c,e);return a?Array.isArray(a)?a:[a]:[]}if(a!==d.h.OPENAI){let b=p.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 a=p.get(`${d.h.OPENAI}:${b}`);if(a){let b=[];for(let c of f){let d=a(c,e);d&&b.push(...Array.isArray(d)?d:[d])}f=b}}return g&&b!==d.h.OPENAI&&a!==d.h.OPENAI&&(f._openaiIntermediate=g),f}function v(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:{},funcCallIds:{},funcArgsDone:{},funcItemDone:{},funcOutputIndices:{},completedSent:!1}:b}},56698:(a,b,c)=>{"use strict";let d=c(34589);class e{#bg=!1;#bh;#ay;#bi;#bj;constructor(a,b,c){if("function"!=typeof a)throw TypeError("callback must be a function");this.#bh=a,this.#ay=b,this.#bj=c}onRequestStart(a,b){this.#bg=!1,this.#bi=b}onRequestUpgrade(a,b,c,d){this.#ay.onRequestUpgrade?.(a,b,c,d)}onResponseStart(a,b,c,e){if(d(null!=this.#bh),this.#bg=304===b||this.#bj&&b>=500&&b<=504,this.#bh(this.#bg,this.#bi,b,c),this.#bh=null,this.#bg)return!0;this.#ay.onRequestStart?.(a,this.#bi),this.#ay.onResponseStart?.(a,b,c,e)}onResponseData(a,b){if(!this.#bg)return this.#ay.onResponseData?.(a,b)}onResponseEnd(a,b){this.#bg||this.#ay.onResponseEnd?.(a,b)}onResponseError(a,b){if(!this.#bg){if(this.#bh){if(this.#bj){this.#bg=!0,this.#bh(!0,this.#bi),this.#bh=null;return}this.#bh(!1),this.#bh=null}if("function"==typeof this.#ay.onResponseError)this.#ay.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{#bk=new Map;clear(){this.#bk.clear()}has(a){return this.#bk.get(a)??this.#bl(a)}set(a,b){if(!1===e.includes(a))throw TypeError(`unknown feature: ${a}`);this.#bk.set(a,b)}#bl(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.#bk.set(a,b),b}}let g=new f;a.exports.runtimeFeatures=g,a.exports.default=g},57431:(a,b,c)=>{"use strict";c.r(b),c.d(b,{admitApiKeyRequest:()=>p,checkApiKeyBudget:()=>u,createApiKey:()=>m,deleteApiKey:()=>q,getApiKeyById:()=>l,getApiKeyConnectionPolicy:()=>t,getApiKeyPolicy:()=>s,getApiKeys:()=>k,maskApiKey:()=>i,rotateApiKey:()=>o,updateApiKey:()=>n,validateApiKey:()=>r});var d=c(27137),e=c(24081);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,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)}: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 = ?, allowedModels = ?, allowedConnectionIds = ? WHERE id = ?",[f.key,f.name,f.machineId,+!!f.isActive,Number(f.budgetDaily)||0,Number(f.budgetMonthly)||0,Number(f.requestsPerMinute)||0,JSON.stringify(f.allowedModels||[]),JSON.stringify(h(f.allowedConnectionIds)),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 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))}):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){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");const{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"]}},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(24081),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])}}}},59039:(a,b,c)=>{"use strict";c.a(a,async(a,b)=>{try{c(58500),c(19458),c(56294),c(42541),c(11484),c(87164),c(91083),c(32210),c(1758),c(8735),c(27696),c(51525),c(70321);var d=c(65333);c(72610),c(55599),c(5275),c(51658),c(1447),c(15783),c(4818),c(63299),c(50570),c(77745),c(44089),c(70474),c(6699),c(93745),c(60856),c(83651);var e=a([d]);d=(e.then?(await e)():e)[0],b()}catch(a){b(a)}})},59067:(a,b,c)=>{"use strict";c.d(b,{hG:()=>r});var d=c(77598),e=c.n(d),f=c(69384),g=c(30395),h=c(79154),i=c(80993),j=c(32210),k=c(93745),l=c(41310);let m=/^(rs|fc|resp|msg)_/,n=new Set(["web_search","x_search","web_search_preview","file_search","image_generation","code_interpreter","mcp","local_shell"]),o=new Set(["model","input","instructions","tools","tool_choice","stream","store","reasoning","include","temperature","top_p","max_output_tokens","parallel_tool_calls","text","metadata","prompt_cache_key"]),p=["low","medium","high"],q=new Map;class r extends f.Hv{constructor(){super("grok-cli",g.xq["grok-cli"]),this._currentSessionId=null,this._currentReqId=null,this._currentTurnIdx=1,this._agentId=null}buildUrl(){return this.config.baseUrl}async refreshCredentials(a,b){return a?.refreshToken?(0,h.Vq)("grok-cli",a,b):null}needsRefresh(a){return(0,h.fp)("grok-cli",a)}buildHeaders(a,b=!0){let c=super.buildHeaders(a,b);for(let[a,b]of Object.entries(this.config.headers||{}))null!=b&&void 0===c[a]&&(c[a]=b);c["x-xai-token-auth"]=this.config.tokenAuth||"xai-grok-cli",c["x-grok-client-identifier"]=this.config.clientIdentifier||c["x-grok-client-identifier"]||"grok-pager",c["x-grok-client-version"]=this.config.clientVersion||c["x-grok-client-version"]||"0.2.93",c["x-authenticateresponse"]="authenticate-response";let d=this._currentSessionId||a?.connectionId||e().randomUUID(),f=this._currentReqId||e().randomUUID();c["x-grok-session-id"]=d,c["x-grok-conv-id"]=d,c["x-grok-req-id"]=f,c["x-grok-turn-idx"]=String(this._currentTurnIdx||1),this._agentId&&(c["x-grok-agent-id"]=this._agentId),this._currentModel&&(c["x-grok-model-override"]=this._currentModel),this.config.compactionAt&&(c["x-compaction-at"]=String(this.config.compactionAt));let g=a?.providerSpecificData||{},h=g.email||a?.email,i=g.userId||a?.userId||a?.providerUserId;return h&&(c["x-email"]=h),i&&(c["x-userid"]=i),c}parseError(a,b){if(402===a.status&&b)try{let a=JSON.parse(b),c=a?.code||"",d=a?.error||a?.message||b;return{status:402,message:"string"==typeof d?d:b,code:"string"==typeof c?c:void 0}}catch{}return super.parseError(a,b)}transformRequest(a,b,c,d){this._currentSessionId=(0,k.oV)({headers:d?.rawHeaders,body:b,connectionId:d?.connectionId||d?.id,workspaceId:d?.providerSpecificData?.workspaceId,scope:"grok-cli"}),this._currentReqId=e().randomUUID(),this._agentId=d?.providerSpecificData?.deviceId||d?.providerSpecificData?.agentId||null;let f=(0,i.m)(b.input);f&&(b.input=f),(!b.input||Array.isArray(b.input)&&0===b.input.length)&&(Array.isArray(b.messages)&&b.messages.length>0?(b.input=b.messages.map(a=>({type:"message",role:a.role||"user",content:"string"==typeof a.content?a.content:JSON.stringify(a.content??"")})),delete b.messages):b.input=[{type:"message",role:"user",content:"..."}]),Array.isArray(b.input)&&(b.input=b.input.filter(a=>{if("string"==typeof a&&m.test(a))return!1;if(a&&"object"==typeof a&&!Array.isArray(a)){if("item_reference"===a.type)return!1;"string"==typeof a.id&&m.test(a.id)&&delete a.id}return!0})),function(a){if(!Array.isArray(a.tools))return;let b=new Set;if(a.tools=a.tools.filter(a=>{if(!a||"object"!=typeof a||Array.isArray(a))return!1;let c="string"==typeof a.type?a.type:"";if("function"!==c){if(n.has(c))return!0;if(!c&&a.function);else if(c&&"string"!=typeof a.name)return!1}if(!("function"===c||""===c||a.function||"string"==typeof a.name)||n.has(c))return n.has(c);let d=a.function&&"object"==typeof a.function&&!Array.isArray(a.function)?a.function:null,e=("string"==typeof a.name?a.name:"string"==typeof d?.name?d.name:"").trim();if(!e)return!1;let f="string"==typeof a.description?a.description:"string"==typeof d?.description?d.description:"",g=a.parameters&&"object"==typeof a.parameters&&!Array.isArray(a.parameters)?a.parameters:d?.parameters&&"object"==typeof d.parameters&&!Array.isArray(d.parameters)?d.parameters:{type:"object",properties:{}};for(let b of Object.keys(a))delete a[b];return a.type="function",a.name=e.slice(0,128),f&&(a.description=f),a.parameters=g,b.add(e),!0}),a.tool_choice&&"object"==typeof a.tool_choice&&!Array.isArray(a.tool_choice)&&"function"===a.tool_choice.type){let c="string"==typeof a.tool_choice.name?a.tool_choice.name.trim():"";c&&b.has(c)||delete a.tool_choice}}(b),this._currentTurnIdx=function(a,b){let c=function(a){if(!Array.isArray(a))return 1;let b=0;for(let c of a){if(!c||"object"!=typeof c||Array.isArray(c))continue;let a="string"==typeof c.type?c.type:"";"user"!==c.role||a&&"message"!==a||(b+=1)}return Math.max(1,b)}(b);if(!a)return c;let d=Date.now(),e=q.get(a),f=Math.max(c,e&&d-e.ts<=36e5?e.turn:0);return!e&&q.size>=5e3&&function(a){for(let[b,c]of q)a-c.ts>36e5&&q.delete(b);if(q.size<5e3)return;let b=null,c=1/0;for(let[a,d]of q)d.ts<c&&(c=d.ts,b=a);null!==b&&q.delete(b)}(d),q.set(a,{turn:f,ts:d}),f}(this._currentSessionId,b.input),b.stream=!0,b.store=!1;let g=function(a){if(!a||"string"!=typeof a)return null;for(let b of p)if(a.endsWith(`-${b}`))return b;return null}(b.model||a),h=b.model||a;if(g&&(h=h.replace(RegExp(`-${g}$`),"")),(h=(0,j.kt)("gcli",h)||h)===(b.model||a)&&(h=(0,j.kt)("grok-cli",h)||h),b.model=h,this._currentModel=h,b.reasoning&&"object"==typeof b.reasoning)b.reasoning.effort||(b.reasoning.effort=b.reasoning_effort||g||"high"),b.reasoning.summary||(b.reasoning.summary="concise");else{let a=b.reasoning_effort||g||"high";b.reasoning={effort:a,summary:"concise"}}if(delete b.reasoning_effort,b.reasoning?.effort&&"none"!==b.reasoning.effort){let a=Array.isArray(b.include)?b.include:[];a.includes("reasoning.encrypted_content")||a.push("reasoning.encrypted_content"),b.include=a}for(let a of(delete b.messages,delete b.max_tokens,delete b.max_completion_tokens,delete b.n,delete b.seed,delete b.logprobs,delete b.top_logprobs,delete b.frequency_penalty,delete b.presence_penalty,delete b.logit_bias,delete b.user,delete b.stream_options,delete b.prompt_cache_retention,delete b.safety_identifier,delete b.previous_response_id,Object.keys(b)))o.has(a)||delete b[a];return b}async execute(a){if(this._agentId||a.credentials?.providerSpecificData?.deviceId)a.credentials?.providerSpecificData?.deviceId&&(this._agentId=a.credentials.providerSpecificData.deviceId);else try{let a=await (0,l.Xj)("grok-cli-agent");this._agentId=[a.slice(0,8),a.slice(8,12),"5"+a.slice(13,16),"a"+a.slice(17,20),a.slice(0,12).padEnd(12,"0")].join("-")}catch{this._agentId=e().randomUUID()}return super.execute(a)}}},59970:(a,b,c)=>{"use strict";let d,e=Symbol.for("undici.globalDispatcher.2"),f=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:g}=c(61448),h=c(37417),i=c(74399);function j(a){if(!a||"function"!=typeof a.dispatch)throw new g("Argument agent must implement Agent");try{Object.defineProperty(globalThis,e,{value:a,writable:!0,enumerable:!1,configurable:!1})}catch(b){if(b instanceof TypeError){d=a;return}throw b}try{let b=a instanceof i?a:new i(a);Object.defineProperty(globalThis,f,{value:b,writable:!0,enumerable:!1,configurable:!1})}catch(a){if(!(a instanceof TypeError))throw a}}function k(){return globalThis[e]??d}void 0===k()&&j(new h),a.exports={setGlobalDispatcher:j,getGlobalDispatcher:k,installedExports:["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"]}},60083:(a,b,c)=>{"use strict";c.d(b,{H:()=>i});var d=c(69384),e=c(30395),f=c(80015);let g=new Set(["minimax-m2.5","minimax-m2.7"]),h="https://opencode.ai/zen/go/v1";class i extends d.Hv{constructor(){super("opencode-go",e.xq["opencode-go"])}buildUrl(a){return this._lastModel=a,g.has(a)?`${h}/messages`:`${h}/chat/completions`}buildHeaders(a,b=!0){let c=a?.apiKey||a?.accessToken,d={"Content-Type":"application/json"};return g.has(this._lastModel)?(d["x-api-key"]=c,d["anthropic-version"]="2023-06-01"):d.Authorization=`Bearer ${c}`,b&&(d.Accept="text/event-stream"),d}transformRequest(a,b){return(0,f.Z)({provider:this.provider,model:a,body:b})}}},60856:(a,b,c)=>{"use strict";c.d(b,{Nm:()=>h});var d=c(27432);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),{kUrl:m}=c(49176),n=c(84285),o=Symbol("factory"),p=Symbol("options"),q=Symbol("kGreatestCommonDivisor"),r=Symbol("kCurrentWeight"),s=Symbol("kIndex"),t=Symbol("kWeight"),u=Symbol("kMaxWeightPerServer"),v=Symbol("kErrorPenalty");function w(a,b){return new l(a,b)}class x extends f{constructor(a=[],{factory:b=w,...c}={}){if("function"!=typeof b)throw new e("factory must be a function.");for(const d of(super(),this[p]={...n.deepClone(c)},this[s]=-1,this[r]=0,this[u]=this[p].maxWeightPerServer||100,this[v]=this[p].errorPenalty||15,Array.isArray(a)||(a=[a]),this[o]=b,a))this.addUpstream(d);this._updateBalancedPoolStats()}addUpstream(a){let b=n.parseOrigin(a).origin;if(this[g].find(a=>a[m].origin===b&&!0!==a.closed&&!0!==a.destroyed))return this;let c=this[o](b,this[p]);for(let a of(this[i](c),c.on("connect",()=>{c[t]=Math.min(this[u],c[t]+this[v])}),c.on("connectionError",()=>{c[t]=Math.max(1,c[t]-this[v]),this._updateBalancedPoolStats()}),c.on("disconnect",(...a)=>{let b=a[2];b&&"UND_ERR_SOCKET"===b.code&&(c[t]=Math.max(1,c[t]-this[v]),this._updateBalancedPoolStats())}),this[g]))a[t]=this[u];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][t],a);this[q]=a}removeUpstream(a){let b=n.parseOrigin(a).origin,c=this[g].find(a=>a[m].origin===b&&!0!==a.closed&&!0!==a.destroyed);return c&&this[j](c),this}getUpstream(a){let b=n.parseOrigin(a).origin;return this[g].find(a=>a[m].origin===b&&!0!==a.closed&&!0!==a.destroyed)}get upstreams(){return this[g].filter(a=>!0!==a.closed&&!0!==a.destroyed).map(a=>a[m].origin)}[k](){if(0===this[g].length)throw new d;let a=0,b=-1;for(;a++<this[g].length;){this[s]=(this[s]+1)%this[g].length;let a=this[g][this[s]];if((0===this[s]&&(this[r]=this[r]-this[q],this[r]<=0&&(this[r]=this[u])),!a[h]&&!0!==a.closed&&!0!==a.destroyed)&&((-1===b||a[t]>this[g][b][t])&&(b=this[s]),a[t]>=this[r]))return a}if(-1!==b)return this[r]=this[g][b][t],this[s]=b,this[g][b]}}a.exports=x},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.UND_ERR_HTTP_PARSER");class K 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[J]}get[J](){return!0}}let L=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE");class M 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[L]}get[L](){return!0}}let N=Symbol.for("undici.error.UND_ERR_REQ_RETRY");class O 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[N]}get[N](){return!0}}let P=Symbol.for("undici.error.UND_ERR_RESPONSE");class Q extends c{constructor(a,b,{headers:c,body:d}){super(a),this.name="ResponseError",this.message=a||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=b,this.body=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_PRX_TLS");class S 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[R]}get[R](){return!0}}let T=Symbol.for("undici.error.UND_ERR_PRX_CONN");class U 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[T]}get[T](){return!0}}let V=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED");class W 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[V]}get[V](){return!0}}class X extends c{constructor(a,b){super(a),this.name="Socks5ProxyError",this.message=a||"SOCKS5 proxy error",this.code=b||"UND_ERR_SOCKS5"}}let Y=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED");class Z 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[Y]}get[Y](){return!0}}a.exports={AbortError:q,HTTPParserError:K,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:M,RequestRetryError:O,ResponseError:Q,SecureProxyConnectionError:S,ProxyConnectionError:U,MaxOriginsReachedError:W,Socks5ProxyError:X,MessageSizeExceededError:Z}},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:()=>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(){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),[h.n,m,o]))g().existsSync(a)||g().mkdirSync(a,{recursive:!0})}},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}},63299:(a,b,c)=>{"use strict";c(42541);let d='Before writing code, stop at the first rung that holds: 1) Does this need to exist? Skip if speculative (YAGNI). 2) Already in codebase? Reuse it. 3) Stdlib does it? Use stdlib. 4) Native platform feature? Use it (CSS over JS, <input type="date"> over picker lib, DB constraint over app code). 5) Installed dependency? Use it, never add new ones for what a few lines do. 6) One line? Write one line. 7) Only then: minimum code that works.',e="No unrequested abstractions. No boilerplate 'for later'. Deletion over addition. Fewest files. Shortest working diff. Mark simplifications: // ponytail: [reason]. Bug fix = root cause fix, not symptom patch.",f="Never simplify away: input validation at trust boundaries, error handling preventing data loss, security measures, accessibility, anything explicitly requested. User insists on full version → build it.",g="ACTIVE EVERY RESPONSE. No drift back to over-building. Still active if unsure.";["You are a lazy senior dev. Build what's asked, but name the lazier alternative in one line. User picks.",d,f,"Output: code first, then one line naming what could be simpler.",g].join(" "),["You are a lazy senior dev. The best code is the code never written. Enforce the ladder — stdlib and native first, shortest diff, shortest explanation.",d,e,f,"Output: code first, then at most 3 short lines: what was skipped, when to add it. Pattern: [code] → skipped: [X], add when [Y].",g].join(" "),["You are a YAGNI extremist. Deletion before addition. Ship the one-liner and challenge the rest of the requirement. The laziest solution that actually works.",d,e,f,"Output: one-liner or minimal code, then challenge: 'Do you actually need [X]?' No essays.",g].join(" ")},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,c=e(a?.connectionProxyUrl);return{connectionProxyEnabled:b,connectionProxyUrl:c,connectionNoProxy:e(a?.connectionNoProxy)}}(a);if(c){let a=await (0,d.hr)(c),b=e(a?.proxyUrl),f=e(a?.noProxy);if(a&&!0===a.isActive&&b){if("vercel"===a.type||"cloudflare"===a.type||"deno"===a.type)return{source:a.type,proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:f,strictProxy:!0===a.strictProxy,vercelRelayUrl:b};return{source:"pool",proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!0,connectionProxyUrl:b,connectionNoProxy:f,strictProxy:!0===a.strictProxy}}}if(f.connectionProxyEnabled&&f.connectionProxyUrl)return{source:"legacy",proxyPoolId:c||null,proxyPool:null,...f};return{source:"none",proxyPoolId:c||null,proxyPool:null,...f}}catch(a){return console.error("[resolveConnectionProxyConfig] Failed to resolve proxy config:",a),{source:"error",proxyPoolId:null,proxyPool:null,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:"",strictProxy:!1}}}},64156:(a,b,c)=>{"use strict";let d,{URL:e}=c(73136),f=c(5318),{InvalidArgumentError:g}=c(61448),{Socks5Client:h,STATES:i}=c(40603),{kBusy:j,kConnected:k,kDispatch:l,kClose:m,kDestroy:n}=c(49176),o=c(35689),p=c(55285),{debuglog:q}=c(57975),r=q("undici:socks5-proxy"),s=Symbol("proxy url"),t=Symbol("proxy headers"),u=Symbol("proxy auth"),v=Symbol("proxy protocol"),w=Symbol("pools"),x=Symbol("connector"),y=Symbol("request tls settings"),z=!1;class A extends f{constructor(a,b={}){if(super(),z||(process.emitWarning("SOCKS5 proxy support is experimental and subject to change","ExperimentalWarning"),z=!0),!a)throw new g("Proxy URL is mandatory");const c="string"==typeof a?new e(a):a;if("socks5:"!==c.protocol&&"socks:"!==c.protocol)throw new g("Proxy URL must use socks5:// or socks:// protocol");this[s]=c,this[t]=b.headers||{},this[v]=b.proxyTls?"https:":"http:",this[y]=b.requestTls,this[u]={username:b.username||(c.username?decodeURIComponent(c.username):null),password:b.password||(c.password?decodeURIComponent(c.password):null)},this[x]=b.connect||p({...b.proxyTls,servername:b.proxyTls?.servername||c.hostname}),this[w]=new Map}async createSocks5Connection(a,b){let c=this[s].hostname,d=parseInt(this[s].port)||1080;r("creating SOCKS5 connection to",c,d);let e=Promise.withResolvers();this[x]({hostname:c,host:c,port:d,protocol:this[v]},(a,b)=>{a?e.reject(a):e.resolve(b)});let f=await e.promise,g=new h(f,this[u]);g.on("error",a=>{r("SOCKS5 error:",a),f.destroy()}),await g.handshake();let j=Promise.withResolvers(),k=setTimeout(()=>{j.reject(Error("SOCKS5 authentication timeout"))},5e3),l=()=>{clearTimeout(k),g.removeListener("error",m),j.resolve()},m=a=>{clearTimeout(k),g.removeListener("authenticated",l),j.reject(a)};g.state===i.AUTHENTICATED?(clearTimeout(k),j.resolve()):(g.once("authenticated",l),g.once("error",m)),await j.promise,await g.connect(a,b);let n=Promise.withResolvers(),o=setTimeout(()=>{n.reject(Error("SOCKS5 connection timeout"))},5e3),p=c=>{r("SOCKS5 tunnel established to",a,b,"via",c),clearTimeout(o),g.removeListener("error",q),n.resolve()},q=a=>{clearTimeout(o),g.removeListener("connected",p),n.reject(a)};return g.once("connected",p),g.once("error",q),await n.promise,f}[l](a,b){let{origin:f}=a;r("dispatching request to",f,"via SOCKS5");try{let g=String(f),h=this[w].get(g);if(!h||h.destroyed||h.closed){h=new o(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);r("establishing SOCKS5 connection to",g,h);let i=await this.createSocks5Connection(g,h),j=i;if("https:"===a.protocol){d||(d=c(41692)),r("upgrading to TLS"),j=d.connect({...this[y],socket:i,servername:this[y]?.servername||g});let a=Promise.withResolvers();j.once("secureConnect",a.resolve),j.once("error",a.reject),await a.promise}b(null,j)}catch(a){r("SOCKS5 connection error:",a),b(a)}}}),this[w].set(g,h);let b=()=>{this[w].get(g)!==h||h[k]>0||h[j]||(this[w].delete(g),h.destroyed||h.close())};h.on("disconnect",b),h.on("connectionError",b)}return h[l](a,b)}catch(a){if(r("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 [m](){let a=[];for(let b of this[w].values())a.push(b.close());this[w].clear(),await Promise.all(a)}async [n](a){let b=[];for(let c of this[w].values())b.push(c.destroy(a));this[w].clear(),await Promise.all(b)}}a.exports=A},64304:(a,b,c)=>{"use strict";c.d(b,{Ay:()=>y});var d=c(69384),e=c(30395);let f=e.xq["perplexity-web"].baseUrl,g="2.18",h={"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"]},i={"pplx-gpt":"gpt54_thinking","pplx-sonnet":"claude46sonnetthinking","pplx-opus":"claude46opusthinking"},j=/\[\d+\]/g,k=/<grok:[^>]*>.*?<\/grok:[^>]*>/gs,l=/<grok:[^>]*\/>/g,m=/<[?]xml[^?]*[?]>/g,n=/<\/?response\b[^>]*>/gi,o=/ {2,}/g,p=/\n{3,}/g,q=new Map;function r(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 s(a,b,c,d){if(!d)return;let e=r([...a,{role:"user",content:b},{role:"assistant",content:c}]);if(q.set(e,{backendUuid:d,ts:Date.now()}),q.size>200){let a=null,b=1/0;for(let[c,d]of q)d.ts<b&&(b=d.ts,a=c);a&&q.delete(a)}}function t(a,b=!0){let c=a;return c=(c=(c=(c=(c=c.replace(m,"")).replace(j,"")).replace(k,"")).replace(l,"")).replace(n,""),b&&(c=(c=(c=c.replace(o," ")).replace(p,"\n\n")).trim()),c}async function*u(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*v(a,b){let c="",d=null,e=0,f=new Set;for await(let g of u(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 w(a){return`data: ${JSON.stringify(a)}
389
395
 
390
396
  `}async function x(a,b,c,d,e,f,g){let h="",i=null,j=[];for await(let b of v(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)}s(e,f,h=t(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 y extends d.Hv{constructor(){super("perplexity-web",e.xq["perplexity-web"])}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:j}){var k,l,m,n,o;let p,u,y,z,A,B=b?.messages;if(!B||!Array.isArray(B)||0===B.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:f,headers:{},transformedBody:b};(b?.thinking===!0||b?.reasoning_effort!=null&&"none"!==b.reasoning_effort)&&i[a]?(p="copilot",u=i[a],j?.info?.("PPLX-WEB",`Thinking mode → ${a} using ${u}`)):h[a]?[p,u]=h[a]:(p="copilot",u=a,j?.info?.("PPLX-WEB",`Unmapped model ${a}, using as raw preference`));let C=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}}(B),D=function(a){if(0===a.length)return null;let b=r(a),c=q.get(b);return c?Date.now()-c.ts>36e5?(q.delete(b),null):c.backendUuid:null}(C.history);D&&j?.info?.("PPLX-WEB",`Session continue: ${D.slice(0,12)}...`);let E=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):
391
397
  ${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}(C,D,b?.tools);if(!E.trim())return{response:new Response(JSON.stringify({error:{message:"Empty query after processing",type:"invalid_request"}}),{status:400,headers:{"Content-Type":"application/json"}}),url:f,headers:{},transformedBody:b};let F=(k=p,l=u,A="u">typeof Intl?Intl.DateTimeFormat().resolvedOptions().timeZone:"UTC",{query_str:E,params:{query_str:E,search_focus:"internet",mode:k,model_preference:l,sources:["web"],attachments:[],frontend_uuid:crypto.randomUUID(),frontend_context_uuid:crypto.randomUUID(),version:g,language:"en-US",timezone:A,search_recency_filter:null,is_incognito:!0,use_schematized_api:!0,last_backend_uuid:D}}),G={"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":g};d.accessToken?G.Authorization=`Bearer ${d.accessToken}`:d.apiKey&&(G.Cookie=`__Secure-next-auth.session-token=${d.apiKey}`),j?.info?.("PPLX-WEB",`Query to ${a} (pref=${u}, mode=${p}), len=${E.length}`);let H={method:"POST",headers:G,body:JSON.stringify(F)};e&&(H.signal=e);try{y=await fetch(f,H)}catch(a){return j?.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:f,headers:G,transformedBody:F}}if(!y.ok){let a=y.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."),j?.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:f,headers:G,transformedBody:F}}if(!y.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:f,headers:G,transformedBody:F};let I=`chatcmpl-pplx-${crypto.randomUUID().slice(0,12)}`,J=Math.floor(Date.now()/1e3);if(c){let b;z=new Response((m=y.body,n=C.history,o=C.currentMsg,b=new TextEncoder,new ReadableStream({async start(c){try{c.enqueue(b.encode(w({id:I,object:"chat.completion.chunk",created:J,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 v(m,e)){if(g.backendUuid&&(f=g.backendUuid),g.error){c.enqueue(b.encode(w({id:I,object:"chat.completion.chunk",created:J,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(w({id:I,object:"chat.completion.chunk",created:J,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=t(e,!1))&&c.enqueue(b.encode(w({id:I,object:"chat.completion.chunk",created:J,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(w({id:I,object:"chat.completion.chunk",created:J,model:a,system_fingerprint:null,choices:[{index:0,delta:{},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode("data: [DONE]\n\n")),s(n,o,t(d),f)}catch(d){c.enqueue(b.encode(w({id:I,object:"chat.completion.chunk",created:J,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 z=await x(y.body,a,I,J,C.history,C.currentMsg,e);return{response:z,url:f,headers:G,transformedBody:F}}}},64323:(a,b,c)=>{"use strict";c(42541),c(92843),new TextEncoder},64371:(a,b,c)=>{"use strict";let d,e=c(34589),{runtimeFeatures:f}=c(56758),g=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&&g.clear(),g.keys()))!1===a.includes(b)&&g.delete(b)}else g.clear();let h=Map.prototype.get.bind(g),i=Map.prototype.has.bind(g),j=!1===f.has("crypto")||0===g.size?()=>!0:(a,b)=>{let c=l(b);if(0===c.length)return!0;for(let b of k(c)){let c=b.alg,d=b.val;if(n(m(c,a),d))return!0}return!1};function k(a){let b=[],c=null;for(let d of a){if(e(i(d.alg),"Invalid SRI hash algorithm token"),0===b.length){b.push(d),c=d;continue}let a=h(c.alg),f=h(d.alg);f<a||(f>a?(c=d,b[0]=d,b.length=1):b.push(d))}return b}function l(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(!i(f))continue;e[1]&&(d=e[1]);let g={alg:f,val:d};b.push(g)}return b}let m=(a,b)=>d.hash(a,b,"base64");function n(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:m,bytesMatch:j,caseSensitiveMatch:n,isValidSRIHashAlgorithm:i,getStrongestMetadata:k,parseMetadata:l}},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);class v extends d{#bm=[];#bn=0;#bo=0;#bp=!1;#a=f.INFO;#bq={};#br=[];#a7;#ay;#bs;#bt;constructor(a,b,c={}){super(),this.#ay=a,this.#a7=null==b?new Map:b,this.#bs=c.maxFragments??0,this.#bt=c.maxPayloadSize??0,this.#a7.has("permessage-deflate")&&this.#a7.set("permessage-deflate",new t(b,c))}_write(a,b,c){this.#bm.push(a),this.#bo+=a.length,this.#bp=!0,this.run(c)}#bu(){return!(this.#bt>0)||!!o(this.#bq.opcode)||!(this.#bq.payloadLength+this.#bn>this.#bt)||(r(this.#ay,1009,"Payload size exceeds maximum allowed size"),!1)}run(a){for(;this.#bp;)if(this.#a===f.INFO){if(this.#bo<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.#ay,1002,"Invalid opcode received"),a();if(e)return r(this.#ay,1002,"Frame cannot be masked"),a();if(0!==j&&!this.#a7.has("permessage-deflate"))return void r(this.#ay,1002,"Expected RSV1 to be clear.");if(0!==k||0!==m)return void r(this.#ay,1002,"RSV1, RSV2, RSV3 must be clear");if(h&&!p(d))return void r(this.#ay,1002,"Invalid frame type was fragmented.");if(p(d)&&this.#br.length>0)return void r(this.#ay,1002,"Expected continuation frame");if(this.#bq.fragmented&&h)return void r(this.#ay,1002,"Fragmented frame exceeded 125 bytes.");if((i>125||h)&&o(d))return void r(this.#ay,1002,"Control frame either too large or fragmented");if(q(d)&&0===this.#br.length&&!this.#bq.compressed)return void r(this.#ay,1002,"Unexpected continuation frame");if(i<=125){if(this.#bq.payloadLength=i,this.#a=f.READ_DATA,!this.#bu())return}else 126===i?this.#a=f.PAYLOADLENGTH_16:127===i&&(this.#a=f.PAYLOADLENGTH_64);p(d)&&(this.#bq.binaryType=d,this.#bq.compressed=0!==j),this.#bq.opcode=d,this.#bq.masked=e,this.#bq.fin=c,this.#bq.fragmented=h}else if(this.#a===f.PAYLOADLENGTH_16){if(this.#bo<2)return a();let b=this.consume(2);if(this.#bq.payloadLength=b.readUInt16BE(0),this.#a=f.READ_DATA,!this.#bu())return}else if(this.#a===f.PAYLOADLENGTH_64){if(this.#bo<8)return a();let b=this.consume(8),c=b.readUInt32BE(0),d=b.readUInt32BE(4);if(0!==c||d>0x80000000-1)return void r(this.#ay,1009,"Received payload length > 2^31 bytes.");if(this.#bq.payloadLength=d,this.#a=f.READ_DATA,!this.#bu())return}else if(this.#a===f.READ_DATA){if(this.#bo<this.#bq.payloadLength)return a();let b=this.consume(this.#bq.payloadLength);if(o(this.#bq.opcode))this.#bp=this.parseControlFrame(b),this.#a=f.INFO;else if(this.#bq.compressed){this.#a7.get("permessage-deflate").decompress(b,this.#bq.fin,(b,c)=>{if(b){let a=b instanceof u?1009:1007;r(this.#ay,a,b.message);return}if(this.writeFragments(c)){if(this.#bt>0&&this.#bn>this.#bt)return void r(this.#ay,1009,new u().message);if(!this.#bq.fin){this.#a=f.INFO,this.#bp=!0,this.run(a);return}m(this.#ay,this.#bq.binaryType,this.consumeFragments()),this.#bp=!0,this.#a=f.INFO,this.run(a)}},this.#bn),this.#bp=!1;break}else{if(!this.writeFragments(b))return;!this.#bq.fragmented&&this.#bq.fin&&m(this.#ay,this.#bq.binaryType,this.consumeFragments()),this.#a=f.INFO}}}consume(a){if(a>this.#bo)throw Error("Called consume() before buffers satiated.");if(0===a)return i;this.#bo-=a;let b=this.#bm[0];if(b.length>a)return this.#bm[0]=b.subarray(a,b.length),b.subarray(0,a);{if(b.length===a)return this.#bm.shift();let c=0,d=Buffer.allocUnsafeSlow(a);for(;c!==a;){let b=this.#bm[0],e=b.length;if(e+c===a){d.set(this.#bm.shift(),c);break}if(e+c>a){d.set(b.subarray(0,a-c),c),this.#bm[0]=b.subarray(a-c);break}d.set(this.#bm.shift(),c),c+=e}return d}}writeFragments(a){return this.#bs>0&&this.#br.length===this.#bs?(r(this.#ay,1008,"Too many message fragments"),!1):(this.#bn+=a.length,this.#br.push(a),!0)}consumeFragments(){let a=this.#br;if(1===a.length)return this.#bn=0,a.shift();let b=0,c=Buffer.allocUnsafeSlow(this.#bn);for(let d=0;d<a.length;++d){let e=a[d];c.set(e,b),b+=e.length}return this.#br=[],this.#bn=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.#bq;if(b===g.CLOSE){if(1===c)return r(this.#ay,1002,"Received close frame with a 1-byte body."),!1;if(this.#bq.closeInfo=this.parseCloseBody(a),this.#bq.closeInfo.error){let{code:a,reason:b}=this.#bq.closeInfo;return r(this.#ay,a,b),!1}if(!this.#ay.closeState.has(j.SENT)&&!this.#ay.closeState.has(j.RECEIVED)){let a=i;this.#bq.closeInfo.code&&(a=Buffer.allocUnsafe(2)).writeUInt16BE(this.#bq.closeInfo.code,0);let b=new s(a);this.#ay.socket.write(b.createFrame(g.CLOSE)),this.#ay.closeState.add(j.SENT)}return this.#ay.readyState=h.CLOSING,this.#ay.closeState.add(j.RECEIVED),!1}if(b===g.PING){if(!this.#ay.closeState.has(j.RECEIVED)){let b=new s(a);this.#ay.socket.write(b.createFrame(g.PONG)),this.#ay.onPing(a)}}else b===g.PONG&&this.#ay.onPong(a);return!0}get closingInfo(){return this.#bq.closeInfo}}a.exports={ByteParser:v}},65294:(a,b,c)=>{"use strict";c.r(b),c.d(b,{convertCommandCodeToOpenAI:()=>h});var d=c(56294),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:`
@@ -441,7 +447,7 @@ ${q}`,s=i(Buffer.from(r,"latin1")),t=c.machineId||(0,g.A)(),u=i(k),v=String(k.le
441
447
 
442
448
  `),o("data: [DONE]\n\n")}catch(b){let a=b?.message?String(b.message):String(b);o(`data: ${JSON.stringify({error:{message:`Windsurf stream error: ${a}`,type:"windsurf_error"}})}
443
449
 
444
- `),o("data: [DONE]\n\n")}f.close()}});return new Response(f,{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}async refreshCredentials(){return null}}},84285:(a,b,c)=>{"use strict";let d=c(34589),{kDestroyed:e,kBodyUsed:f,kListeners:g,kBody:h}=c(49176),{IncomingMessage:i}=c(37067),j=c(57075),k=c(77030),{stringify:l}=c(41792),{EventEmitter:m,addAbortListener:n}=c(78474),o=c(64704),{InvalidArgumentError:p,ConnectTimeoutError:q}=c(61448),{headerNameLowerCasedRecord:r}=c(28820),{tree:s}=c(36649);class t{constructor(a){this[h]=a,this[f]=!1}async *[Symbol.asyncIterator](){d(!this[f],"disturbed"),this[f]=!0,yield*this[h]}}function u(){}function v(a){return a&&"object"==typeof a&&"function"==typeof a.pipe&&"function"==typeof a.on}function w(a){return a instanceof Blob}function x(a){return a.includes("?")||a.includes("#")}function y(a){let b=parseInt(a,10);return b===Number(a)&&b>=0&&b<=65535}function z(a){return null!=a&&"h"===a[0]&&"t"===a[1]&&"t"===a[2]&&"p"===a[3]&&(":"===a[4]||"s"===a[4]&&":"===a[5])}function A(a){if("string"==typeof a){if(!z((a=new URL(a)).origin||a.protocol))throw new p("Invalid URL protocol: the URL must start with `http:` or `https:`.");return a}if(!a||"object"!=typeof a)throw new p("Invalid URL: The URL argument must be a non-null object.");if(!(a instanceof URL)){if(null!=a.port&&""!==a.port&&!1===y(a.port))throw new p("Invalid URL: port must be a valid integer or a string representation of an integer.");if(null!=a.path&&"string"!=typeof a.path)throw new p("Invalid URL path: the path must be a string or null/undefined.");if(null!=a.pathname&&"string"!=typeof a.pathname)throw new p("Invalid URL pathname: the pathname must be a string or null/undefined.");if(null!=a.hostname&&"string"!=typeof a.hostname)throw new p("Invalid URL hostname: the hostname must be a string or null/undefined.");if(null!=a.origin&&"string"!=typeof a.origin)throw new p("Invalid URL origin: the origin must be a string or null/undefined.");if(!z(a.origin||a.protocol))throw new p("Invalid URL protocol: the URL must start with `http:` or `https:`.");let b=null!=a.port?a.port:"https:"===a.protocol?443:80,c=null!=a.origin?a.origin:`${a.protocol||""}//${a.hostname||""}:${b}`,d=null!=a.path?a.path:`${a.pathname||""}${a.search||""}`;return"/"===c[c.length-1]&&(c=c.slice(0,c.length-1)),d&&"/"!==d[0]&&(d=`/${d}`),new URL(`${c}${d}`)}if(!z(a.origin||a.protocol))throw new p("Invalid URL protocol: the URL must start with `http:` or `https:`.");return a}function B(a){return null!=a&&("function"==typeof a[Symbol.iterator]||"function"==typeof a[Symbol.asyncIterator])}function C(a){if(null==a)return 0;if(v(a)){let b=a._readableState;return b&&!1===b.objectMode&&!0===b.ended&&Number.isFinite(b.length)?b.length:null}return w(a)?null!=a.size?a.size:null:H(a)?a.byteLength:null}function D(a){return a&&!!(a.destroyed||a[e]||j.isDestroyed?.(a))}function E(a,b){if(!(null==a||!v(a)||D(a))){if("function"==typeof a.destroy){Object.getPrototypeOf(a).constructor===i&&(a.socket=null);try{a.destroy(b)}catch{}}else b&&queueMicrotask(()=>{a.emit("error",b)});!0!==a.destroyed&&(a[e]=!0)}}let F=/timeout=(\d+)/;function G(a){return"string"==typeof a?r[a]??a.toLowerCase():s.lookup(a)??a.toString("latin1").toLowerCase()}function H(a){return a instanceof Uint8Array||Buffer.isBuffer(a)}function I(a){return a&&"object"==typeof a&&"function"==typeof a.append&&"function"==typeof a.delete&&"function"==typeof a.get&&"function"==typeof a.getAll&&"function"==typeof a.has&&"function"==typeof a.set&&"FormData"===a[Symbol.toStringTag]}let J=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),K=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/,L=/[^\t\x20-\x7e\x80-\xff]/,M=/^bytes (\d+)-(\d+)\/(\d+|\*)?$/,N="win32"===process.platform?(a,b)=>{if(!b.timeout)return u;let c=null,d=null,e=o.setFastTimeout(()=>{c=setImmediate(()=>{d=setImmediate(()=>O(a.deref(),b))})},b.timeout);return()=>{o.clearFastTimeout(e),clearImmediate(c),clearImmediate(d)}}:(a,b)=>{if(!b.timeout)return u;let c=null,d=o.setFastTimeout(()=>{c=setImmediate(()=>{O(a.deref(),b)})},b.timeout);return()=>{o.clearFastTimeout(d),clearImmediate(c)}};function O(a,b){if(null==a)return;let c="Connect Timeout Error";Array.isArray(a.autoSelectFamilyAttemptedAddresses)?c+=` (attempted addresses: ${a.autoSelectFamilyAttemptedAddresses.join(", ")},`:c+=` (attempted address: ${b.hostname}:${b.port},`,E(a,new q(c+=` timeout: ${b.timeout}ms)`))}let P=null,Q=null,R={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT",query:"QUERY",QUERY:"QUERY"},S={...R,patch:"patch",PATCH:"PATCH"};Object.setPrototypeOf(R,null),Object.setPrototypeOf(S,null),a.exports={kEnumerableProperty:{__proto__:null,enumerable:!0},isDisturbed:function(a){return!!(a&&(j.isDisturbed(a)||a[f]))},isBlobLike:w,parseOrigin:function(a){if("/"!==(a=A(a)).pathname||a.search||a.hash)throw new p("invalid url");return a},parseURL:A,getServerName:function(a){if(!a)return null;d("string"==typeof a);let b=function(a){if("["===a[0]){let b=a.indexOf("]");return d(-1!==b),a.substring(1,b)}let b=a.indexOf(":");return -1===b?a:a.substring(0,b)}(a);return k.isIP(b)?"":b},isStream:v,isIterable:B,hasSafeIterator:function(a){let b=Object.getPrototypeOf(a);return Object.hasOwn(a,Symbol.iterator)||null!=b&&b!==Object.prototype&&"function"==typeof a[Symbol.iterator]},isAsyncIterable:function(a){return null!=a&&"function"==typeof a[Symbol.asyncIterator]},isDestroyed:D,headerNameToString:G,bufferToLowerCasedHeaderName:function(a){return s.lookup(a)??a.toString("latin1").toLowerCase()},addListener:function(a,b,c){return(a[g]??=[]).push([b,c]),a.on(b,c),a},removeAllListeners:function(a){if(null!=a[g]){for(let[b,c]of a[g])a.removeListener(b,c);a[g]=null}return a},errorRequest:function(a,b,c){try{b.onResponseError(c),d(b.aborted)}catch(b){a.emit("error",b)}},parseRawHeaders:function(a){let b,c;if(null==a)return[];if(!Array.isArray(a)){let b=[];for(let[c,d]of Object.entries(a))if(Array.isArray(d))for(let a of d)b.push(c,`${a}`);else b.push(c,`${d}`);return b}let d=a.length,e=Array(d);for(let f=0;f<d;f+=2)b=a[f],c=a[f+1],"string"!=typeof b&&(b=b.toString()),"string"!=typeof c&&(c=c.toString("latin1")),e[f]=b,e[f+1]=c;return e},toRawHeaders:function(a){let b=[];for(let[c,d]of Object.entries(a))if(Array.isArray(d))for(let a of d)b.push(Buffer.from(c,"latin1"),Buffer.from(`${a}`,"latin1"));else b.push(Buffer.from(c,"latin1"),Buffer.from(`${d}`,"latin1"));return b},encodeRawHeaders:function(a){if(!Array.isArray(a))throw TypeError("expected headers to be an array");return a.map(a=>Buffer.from(a))},parseHeaders:function(a,b){void 0===b&&(b={});for(let c=0;c<a.length;c+=2){let d=G(a[c]),e=b[d];if(void 0!==e)if(Object.hasOwn(b,d))"string"==typeof e&&(e=[e],b[d]=e),e.push(a[c+1].toString("latin1"));else{let e="string"==typeof a[c+1]?a[c+1]:Array.isArray(a[c+1])?a[c+1].map(a=>a.toString("latin1")):a[c+1].toString("latin1");"__proto__"===d?Object.defineProperty(b,d,{value:e,enumerable:!0,configurable:!0,writable:!0}):b[d]=e}else{let e="string"==typeof a[c+1]?a[c+1]:Array.isArray(a[c+1])?a[c+1].map(a=>a.toString("latin1")):a[c+1].toString("latin1");b[d]=e}}return b},parseKeepAliveTimeout:function(a){let b=a.match(F);return b?1e3*parseInt(b[1],10):null},destroy:E,bodyLength:C,deepClone:function(a){return JSON.parse(JSON.stringify(a))},ReadableStreamFrom:function(a){let b;return new ReadableStream({start(){b=a[Symbol.asyncIterator]()},pull(a){return b.next().then(({done:b,value:c})=>{if(b)return queueMicrotask(()=>{a.close(),a.byobRequest?.respond(0)});{let b=Buffer.isBuffer(c)?c:Buffer.from(c);return b.byteLength?a.enqueue(new Uint8Array(b)):this.pull(a)}})},cancel:()=>b.return(),type:"bytes"})},isBuffer:H,assertRequestHandler:function(a,b,c){if(!a||"object"!=typeof a)throw new p("handler must be an object");if("function"!=typeof a.onRequestStart)throw new p("invalid onRequestStart method");if("function"!=typeof a.onResponseError)throw new p("invalid onResponseError method");if("function"!=typeof a.onBodySent&&void 0!==a.onBodySent)throw new p("invalid onBodySent method");if("function"!=typeof a.onRequestSent&&void 0!==a.onRequestSent)throw new p("invalid onRequestSent method");if(c||"CONNECT"===b){if("function"!=typeof a.onRequestUpgrade)throw new p("invalid onRequestUpgrade method")}else{if("function"!=typeof a.onResponseStart)throw new p("invalid onResponseStart method");if("function"!=typeof a.onResponseData)throw new p("invalid onResponseData method");if("function"!=typeof a.onResponseEnd)throw new p("invalid onResponseEnd method")}},getSocketInfo:function(a){return{localAddress:a.localAddress,localPort:a.localPort,remoteAddress:a.remoteAddress,remotePort:a.remotePort,remoteFamily:a.remoteFamily,timeout:a.timeout,bytesWritten:a.bytesWritten,bytesRead:a.bytesRead}},isFormDataLike:I,pathHasQueryOrFragment:x,serializePathWithQuery:function(a,b){if(x(a))throw Error('Query params cannot be passed when url already contains "?" or "#".');let c=l(b);return c&&(a+="?"+c),a},addAbortListener:function(a,b){return!a||"aborted"in a?n(a,b)[Symbol.dispose]:"function"==typeof a.addEventListener?(a.addEventListener("abort",b,{once:!0}),()=>a.removeEventListener("abort",b)):(a.once("abort",b),()=>a.removeListener("abort",b))},isValidHTTPToken:function(a){if(a.length>=12)return K.test(a);if(0===a.length)return!1;for(let b=0;b<a.length;b++)if(1!==J[a.charCodeAt(b)])return!1;return!0},isValidHeaderValue:function(a){return!L.test(a)},isTokenCharCode:function(a){return 1===J[a]},parseRangeHeader:function(a){if(null==a||""===a)return{start:0,end:null,size:null};if(!a)return null;let b=M.exec(a);return b?{start:parseInt(b[1]),end:b[2]?parseInt(b[2]):null,size:b[3]&&"*"!==b[3]?parseInt(b[3]):null}:null},normalizedMethodRecordsBase:R,normalizedMethodRecords:S,isValidPort:y,isHttpOrHttpsPrefixed:z,safeHTTPMethods:Object.freeze(["GET","HEAD","OPTIONS","TRACE"]),wrapRequestBody:function(a){return v(a)?(0===C(a)&&a.on("data",function(){d(!1)}),"boolean"!=typeof a.readableDidRead&&(a[f]=!1,m.prototype.on.call(a,"data",function(){this[f]=!0})),a):a&&"function"==typeof a.pipeTo?new t(a):a&&I(a)?a:a&&"string"!=typeof a&&!ArrayBuffer.isView(a)&&B(a)?new t(a):a},setupConnectTimeout:N,getProtocolFromUrlString:function(a){if(a===P)return Q;let b=function(a){if("h"===a[0]&&"t"===a[1]&&"t"===a[2]&&"p"===a[3])switch(a[4]){case":":return"http:";case"s":if(":"===a[5])return"https:"}return a.slice(0,a.indexOf(":")+1)}(a);return P=a,Q=b,b}}},84698:a=>{"use strict";function b(a){for(let b=0;b<a.length;++b){let c=a.charCodeAt(b);if(c<33||c>126||34===c||40===c||41===c||60===c||62===c||64===c||44===c||59===c||58===c||92===c||47===c||91===c||93===c||63===c||61===c||123===c||125===c)throw Error("Invalid cookie name")}}function c(a){let b=a.length,c=0;if('"'===a[0]){if(1===b||'"'!==a[b-1])throw Error("Invalid cookie value");--b,++c}for(;c<b;){let b=a.charCodeAt(c++);if(b<33||b>126||34===b||44===b||59===b||92===b)throw Error("Invalid cookie value")}}function d(a){for(let b=0;b<a.length;++b){let c=a.charCodeAt(b);if(c<32||c>126||59===c)throw Error("Invalid cookie path")}}function e(a){return a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122}let f=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],g=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],h=Array(61).fill(0).map((a,b)=>b.toString().padStart(2,"0"));function i(a){return"number"==typeof a&&(a=new Date(a)),`${f[a.getUTCDay()]}, ${h[a.getUTCDate()]} ${g[a.getUTCMonth()]} ${a.getUTCFullYear()} ${h[a.getUTCHours()]}:${h[a.getUTCMinutes()]}:${h[a.getUTCSeconds()]} GMT`}a.exports={isCTLExcludingHtab:function(a){for(let b=0;b<a.length;++b){let c=a.charCodeAt(b);if(c>=0&&c<=8||c>=10&&c<=31||127===c)return!0}return!1},validateCookieName:b,validateCookiePath:d,validateCookieValue:c,toIMFDate:i,stringify:function(a){if(0===a.name.length)return null;b(a.name),c(a.value);let f=[`${a.name}=${a.value}`];if(a.name.startsWith("__Secure-")&&(a.secure=!0),a.name.startsWith("__Host-")&&(a.secure=!0,a.domain=null,a.path="/"),a.secure&&f.push("Secure"),a.httpOnly&&f.push("HttpOnly"),"number"==typeof a.maxAge){if(a.maxAge<0)throw Error("Invalid cookie max-age");f.push(`Max-Age=${a.maxAge}`)}for(let g of(a.domain&&(!function(a){if(" "===a)return;if(a.length>255)throw Error("Invalid cookie domain");let b=0;for(let c=0;c<a.length;++c){let d=a.charCodeAt(c);if(46===d){if(0===b||45===a.charCodeAt(c-1))throw Error("Invalid cookie domain");b=0;continue}if(0===b&&!e(d)||!e(d)&&45!==d||++b>63)throw Error("Invalid cookie domain")}if(0===b||45===a.charCodeAt(a.length-1))throw Error("Invalid cookie domain")}(a.domain),f.push(`Domain=${a.domain}`)),a.path&&(d(a.path),f.push(`Path=${a.path}`)),a.expires&&"Invalid Date"!==a.expires.toString()&&f.push(`Expires=${i(a.expires)}`),a.sameSite&&f.push(`SameSite=${a.sameSite}`),a.unparsed)){if(!g.includes("="))throw Error("Invalid unparsed");let[a,...d]=g.split("="),e=a.trim(),h=d.join("=");b(e),c(h),f.push(`${e}=${h}`)}return f.join("; ")}}},84955:(a,b,c)=>{"use strict";c.d(b,{V:()=>h});var d=c(69384),e=c(30395),f=c(48991),g=c(11484);class h extends d.Hv{constructor(){super("gemini-cli",e.xq["gemini-cli"])}buildUrl(a,b,c=0){return`${this.config.baseUrl}:${b?"streamGenerateContent?alt=sse":"generateContent"}`}buildHeaders(a,b=!0){return{"Content-Type":"application/json",Authorization:`Bearer ${a.accessToken}`,"User-Agent":(0,f.sX)(this._currentModel),"X-Goog-Api-Client":f.go,Accept:b?"text/event-stream":"application/json"}}transformRequest(a,b,c,d){return(this._currentModel=a,b&&b.request&&b.model)?b:{project:d?.projectId||b?.project,model:a,request:b}}parseError(a,b){let c=super.parseError(a,b);if(429!==a.status||!b)return c;try{let a=JSON.parse(b),d=a?.error?.details;if(Array.isArray(d)){for(let a of d)if(a?.["@type"]==="type.googleapis.com/google.rpc.RetryInfo"&&a?.retryDelay){c.retryAfter=a.retryDelay;break}}}catch{}return c}async refreshCredentials(a,b){if(!a.refreshToken)return null;try{let c=await fetch(f.NA.google.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a.refreshToken,client_id:this.config.clientId,client_secret:this.config.clientSecret})});if(!c.ok)return await (0,g.aI)(c),null;let d=await c.json();return b?.info?.("TOKEN","Gemini CLI refreshed"),{accessToken:d.access_token,refreshToken:d.refresh_token||a.refreshToken,expiresIn:d.expires_in,projectId:a.projectId}}catch(a){return b?.error?.("TOKEN",`Gemini CLI refresh error: ${a.message}`),null}}}},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{#ai=1048576;#bB=!1;#aj=0;#G=null;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.#ai=a??this.#ai}#bx(a){this.aborted=!0,this.reason=a}onRequestStart(a,b){return a.abort=this.#bx.bind(this),this.#G=a,super.onRequestStart(a,b)}onResponseStart(a,b,c,d){let f=c["content-length"];if(null!=f&&f>this.#ai)throw new e(`Response size (${f}) larger than maxSize (${this.#ai})`);return!0===this.aborted||super.onResponseStart(a,b,c,d)}onResponseError(a,b){this.#bB||(b=this.#G?.reason??b,super.onResponseError(a,b))}onResponseData(a,b){return this.#aj=this.#aj+b.length,this.#aj>=this.#ai&&(this.#bB=!0,!0===this.aborted?super.onResponseError(a,this.reason):super.onResponseEnd(a,{})),!0}onResponseEnd(a,b){if(!this.#bB){if(!0===this.#G.aborted)return void super.onResponseError(a,this.reason);super.onResponseEnd(a,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)}}},87164:(a,b,c)=>{"use strict";c.d(b,{R_:()=>q,Og:()=>r,jT:()=>p,Sc:()=>H,Ql:()=>D,$B:()=>G,pb:()=>J});var d=c(30395),e=c(48991),f=c(46956);let g=new Set(["login.microsoftonline.com","login.microsoft.com","login.windows.net"]);function h(a){return"string"==typeof a?a.trim():""}var i=c(13335);let j=null;async function k(a,b){return a?o("xai",a,async()=>{try{j||(j=new(await c.e(4621).then(c.bind(c,14621))).XaiService);let b=await j.refreshAccessToken(a);return{accessToken:b.access_token,refreshToken:b.refresh_token||a,expiresIn:b.expires_in,idToken:b.id_token}}catch(c){b?.warn?.("TOKEN_REFRESH","xAI OAuth refresh failed",{status:c?.status||null,code:y(c?.code,c?.status),permanent:c?.permanent===!0});let a=String(c?.message||"");if(c?.permanent===!0||a.includes("invalid_grant")||a.includes("invalid_request"))return{error:"invalid_grant",code:y(c?.code||"invalid_grant",c?.status)};return null}},b):null}let l=new Map;function m(){let a=Error("Request aborted");return a.name="AbortError",a}function n(a,b){return a.waiterCount+=1,new Promise((c,d)=>{let e=!1,f=(c,d)=>{e||(e=!0,b?.removeEventListener?.("abort",g),a.waiterCount=Math.max(0,a.waiterCount-1),0!==a.waiterCount||a.settled||(a.acceptingWaiters=!1,a.controller.abort(m())),c(d))},g=()=>f(d,m());b?.addEventListener?.("abort",g,{once:!0}),b?.aborted&&g(),a.promise.then(a=>f(c,a),a=>f(d,a))})}async function o(a,b,c,d,e=null){let f,g;if(e?.aborted)throw m();if(!b)return c();let h=`${a}:${b}`,i=l.get(h);if(i){if(i.promise){if(!1===i.acceptingWaiters||i.controller.signal.aborted)try{return await (e?.aborted?Promise.reject(m()):new Promise((a,b)=>{let c=!1,d=(a,b)=>{c||(c=!0,e?.removeEventListener?.("abort",f),a(b))},f=()=>d(b,m());e?.addEventListener?.("abort",f,{once:!0}),e?.aborted&&f(),i.promise.then(b=>d(a,b),a=>d(b,a))}))}catch(f){if(e?.aborted)throw m();if(i.controller.signal.aborted&&f?.name==="AbortError")return o(a,b,c,d,e);throw f}return d?.info?.("TOKEN_REFRESH",`Reusing in-flight refresh for ${a}`),n(i,e)}if(i.expiresAt>Date.now())return d?.info?.("TOKEN_REFRESH",`Reusing recent refresh result for ${a}`),i.result;l.delete(h)}let j={controller:new AbortController,promise:new Promise((a,b)=>{f=a,g=b}),acceptingWaiters:!0,settled:!1,waiterCount:0};return l.set(h,j),(async()=>{try{let a=await c(j.controller.signal),b={result:a,expiresAt:Date.now()+1e4};l.set(h,b);let d=setTimeout(()=>{l.get(h)===b&&l.delete(h)},1e4);d.unref?.(),j.settled=!0,f(a)}catch(a){l.get(h)===j&&l.delete(h),j.settled=!0,g(a)}})(),n(j,e)}function p(a){return a&&"object"==typeof a&&("unrecoverable_refresh_error"===a.error||"refresh_token_reused"===a.error||"invalid_request"===a.error||"invalid_grant"===a.error)}function q(a={}){let b=String(a.code||a.error||"refresh_token_rejected").slice(0,120),c=Error("Refresh credential rejected; re-authentication required.");return c.name="RefreshCredentialError",c.code=b,c.permanent=!0,c}function r(a){return e.Wu[a]||3e5}async function s(a,b,c,e){let f=d.xq[a];return f&&f.refreshUrl?b?o(a,b,async()=>{try{let c=await fetch(f.refreshUrl,{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:f.clientId,client_secret:f.clientSecret})});if(!c.ok){let b=await c.text();return z(b,c.status,e,a)}let d=await c.json();return e?.info?.("TOKEN_REFRESH",`Successfully refreshed token for ${a}`,{hasNewAccessToken:!!d.access_token,hasNewRefreshToken:!!d.refresh_token,expiresIn:d.expires_in}),{accessToken:d.access_token,refreshToken:d.refresh_token||b,expiresIn:d.expires_in}}catch(b){return e?.error?.("TOKEN_REFRESH",`Error refreshing token for ${a}`,{error:b.message}),null}},e):(e?.warn?.("TOKEN_REFRESH",`No refresh token available for provider: ${a}`),null):(e?.warn?.("TOKEN_REFRESH",`No refresh URL configured for provider: ${a}`),null)}async function t(a,b){return a?o("claude",a,async()=>{try{let c=await fetch(e.NA.anthropic.token,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.claude.clientId})});if(!c.ok){let a=await c.text();return z(a,c.status,b,"Claude")}let f=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Claude OAuth token",{hasNewAccessToken:!!f.access_token,expiresIn:f.expires_in}),{accessToken:f.access_token,refreshToken:f.refresh_token||a,expiresIn:f.expires_in}}catch(a){return b?.error?.("TOKEN_REFRESH",`Network error refreshing Claude token: ${a.message}`),null}},b):null}async function u(a,b,c,d){return a?o(`google:${b}`,a,async()=>{try{let f=await fetch(e.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:b,client_secret:c})});if(!f.ok){let a=await f.text();return z(a,f.status,d,"Google")}let g=await f.json();return d?.info?.("TOKEN_REFRESH","Successfully refreshed Google token",{hasNewAccessToken:!!g.access_token,expiresIn:g.expires_in}),{accessToken:g.access_token,refreshToken:g.refresh_token||a,expiresIn:g.expires_in}}catch(a){return d?.error?.("TOKEN_REFRESH",`Network error refreshing Google token: ${a.message}`),null}},d):null}async function v(a,b){return a?o("qwen",a,async()=>{let c=e.NA.qwen.token;try{let e=await fetch(c,{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:d.xq.qwen.clientId})});if(200===e.status){let c=await e.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Qwen token",{hasNewAccessToken:!!c.access_token,hasNewRefreshToken:!!c.refresh_token,expiresIn:c.expires_in}),{accessToken:c.access_token,refreshToken:c.refresh_token||a,expiresIn:c.expires_in,providerSpecificData:c.resource_url?{resourceUrl:c.resource_url}:void 0}}{let a=await e.text().catch(()=>"");return z(a,e.status,b,"Qwen")}}catch(a){b?.warn?.("TOKEN_REFRESH","Network error trying Qwen endpoint",{error:a.message})}return b?.error?.("TOKEN_REFRESH","Failed to refresh Qwen token"),null},b):null}async function w(a,b,c="codebuddy"){return a?o(c,a,async()=>{try{let e=d.xq[c]||d.xq.codebuddy,g=e.refreshUrl,h=e.domain||"www.codebuddy.ai",j=await (0,f.proxyAwareFetch)(g,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":i.C,"X-Requested-With":"XMLHttpRequest","X-Domain":h,"X-Refresh-Token":a,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"});if(!j.ok){let a=await j.text().catch(()=>"");return z(a,j.status,b,c)}let k=await j.json(),l=k?.data||k,m=l?.accessToken||l?.access_token;if(!m)return null;return{accessToken:m,refreshToken:l?.refreshToken||l?.refresh_token||a,expiresIn:l?.expiresIn||l?.expires_in||86400}}catch(a){return b?.error?.("TOKEN_REFRESH",`Error refreshing token for ${c}`,{error:a.message}),null}},b):null}function x(a="",b=0){let c=null;try{c=a?JSON.parse(a):null}catch{c=null}let d=c?.error&&"object"==typeof c.error?c.error:null,e=d?.code||d?.type||("string"==typeof c?.error?c.error:"")||c?.error_code||"",f=d?.message||d?.error_description||c?.error_description||c?.message||a||"",g=`${e} ${f}`.toLowerCase(),h=400===b||401===b||["refresh_token_expired","refresh_token_reused","refresh_token_invalidated","invalid_refresh_token","invalid_grant"].some(a=>g.includes(a));return{status:b,code:e,description:f,permanent:h}}function y(a,b){let c="string"==typeof a?a.trim():"";return/^[a-zA-Z0-9_.:-]{1,120}$/.test(c)?c:`HTTP_${Number(b)||0}`}function z(a,b,c,d){let e=x(a,b),f=y(e.code,b);return c?.error?.("TOKEN_REFRESH",`${d} OAuth refresh failed`,{status:b,code:f,permanent:e.permanent}),e.permanent?{error:"unrecoverable_refresh_error",code:f}:null}function A(a,b,c,d){let e=function(a="",b=0){let c=null;try{c=a?JSON.parse(a):null}catch{c=null}let d=c?.error&&"object"==typeof c.error?c.error:c,e=[d?.reason,c?.reason,d?.code,c?.code,d?.errorCode,c?.errorCode,d?.type,c?.type,d?.__type,c?.__type,"string"==typeof c?.error?c.error:""].filter(a=>("string"==typeof a||"number"==typeof a)&&String(a).trim()),f=e.map(a=>String(a).trim()).find(a=>/^[A-Za-z0-9_.:#/-]{1,200}$/.test(a)&&!/^aor[A-Za-z0-9._~+/=-]{8,}$/.test(a)&&!/^eyJ[A-Za-z0-9_-]{8,}\./.test(a))||null,g=[d?.message,d?.Message,d?.error_description,c?.message,c?.Message,c?.error_description,c?"":a].find(a=>"string"==typeof a&&a.trim())||"",h=e.map(a=>String(a).replace(/([a-z0-9])([A-Z])/g,"$1_$2").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")),i=["invalid_grant","invalid_grant_exception","invalid_refresh_token","refresh_token_expired","refresh_token_revoked","refresh_token_reused","refresh_token_invalidated","expired_token","token_revoked","invalid_token","invalid_token_exception","invalid_client","invalid_client_exception","unauthorized_client"],j=h.some(a=>{let b=a.replace(/_exception$/,"");return i.some(a=>b===a||b.endsWith(`_${a}`))}),k=g.toLowerCase().slice(0,4e3),l=400===b||401===b||j||/\binvalid[_ -]?grant\b/.test(k)||/\brefresh token\b.{0,60}\b(?:expired|invalid|revoked|reused|disabled)\b/.test(k)||/\b(?:expired|invalid|revoked|reused|disabled)\b.{0,60}\brefresh token\b/.test(k);return{status:b,code:f,permanent:l}}(b,a.status);c?.error?.("TOKEN_REFRESH",`Kiro ${d} refresh failed`,{status:a.status,code:e.code,permanent:e.permanent});let f=Error(e.permanent?"Kiro refresh credential rejected":"Kiro refresh temporarily unavailable");throw f.name=e.permanent?"KiroRefreshCredentialError":"KiroRefreshTransientError",f.status=a.status,f.code=e.code,f.permanent=e.permanent,f}function B(a,b){a?.error?.("TOKEN_REFRESH",`Kiro ${b} refresh returned no access token`);let c=Error("Kiro refresh returned an invalid response");throw c.name="KiroRefreshTransientError",c.status=502,c.code="MISSING_ACCESS_TOKEN",c.permanent=!1,c}async function C(a,b){return a?o("codex",a,async()=>{try{let c=await fetch(e.NA.openai.token,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({client_id:d.xq.codex.clientId,grant_type:"refresh_token",refresh_token:a})});if(!c.ok){let a=await c.text();return x(a,c.status).permanent,z(a,c.status,b,"Codex")}let f=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Codex token",{hasNewAccessToken:!!f.access_token,hasNewRefreshToken:!!f.refresh_token,hasIdToken:!!f.id_token,expiresIn:f.expires_in}),{accessToken:f.access_token,refreshToken:f.refresh_token||a,idToken:f.id_token,expiresIn:f.expires_in}}catch(a){return b?.error?.("TOKEN_REFRESH",`Network error refreshing Codex token: ${a.message}`),null}},b):null}async function D(a,b,c,e=null,i=null){return a?o("kiro",a,async i=>{let j=b?.authMethod,k=b?.clientId,l=b?.clientSecret,m=b?.region;if("external_idp"===j){let d;try{d=function(a,b={}){var c;let d=h(b.clientId||b.client_id),e=function(a){let b,c=h(a);if(!c)throw Error("token_endpoint is required");try{b=new URL(c)}catch{throw Error("token_endpoint must be a valid URL")}if("https:"!==b.protocol)throw Error("token_endpoint must use https");if(!g.has(b.hostname.toLowerCase()))throw Error("token_endpoint must be a Microsoft login endpoint");return b.toString()}(b.tokenEndpoint||b.token_endpoint),f=Array.isArray(c=b.scope||b.scopes)?c.map(h).filter(Boolean).join(" "):h(c);if(!a)throw Error("refresh token is required");if(!d)throw Error("clientId is required for external_idp refresh");if(!f)throw Error("scope is required for external_idp refresh");return{tokenEndpoint:e,body:new URLSearchParams({grant_type:"refresh_token",client_id:d,refresh_token:a,scope:f}),providerSpecificData:{...b,authMethod:"external_idp",clientId:d,tokenEndpoint:e,scope:f}}}(a,b)}catch(a){return c?.warn?.("TOKEN_REFRESH",`Kiro external IdP refresh rejected: ${a.message}`),null}let j=await (0,f.proxyAwareFetch)(d.tokenEndpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:d.body,signal:i},{...e,singleTransportAttempt:!0});if(!j.ok){let a=await j.text();return A(j,a,c,"external IdP")}let k=await j.json();return k?.access_token?{accessToken:k.access_token,refreshToken:k.refresh_token||a,expiresIn:k.expires_in,providerSpecificData:d.providerSpecificData}:B(c,"external IdP")}if(k&&l){let b="idc"===j&&m?`https://oidc.${m}.amazonaws.com/token`:"https://oidc.us-east-1.amazonaws.com/token",d=await (0,f.proxyAwareFetch)(b,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:k,clientSecret:l,refreshToken:a,grantType:"refresh_token"}),signal:i},{...e,singleTransportAttempt:!0});if(!d.ok){let a=await d.text();return A(d,a,c,"AWS")}let g=await d.json();return g?.accessToken?(c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro AWS token",{hasNewAccessToken:!!g.accessToken,expiresIn:g.expiresIn}),{accessToken:g.accessToken,refreshToken:g.refreshToken||a,expiresIn:g.expiresIn}):B(c,"AWS")}let n=await (0,f.proxyAwareFetch)(d.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}),signal:i},{...e,singleTransportAttempt:!0});if(!n.ok){let a=await n.text();return A(n,a,c,"social")}let o=await n.json();return o?.accessToken?(c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro social token",{hasNewAccessToken:!!o.accessToken,expiresIn:o.expiresIn}),{accessToken:o.accessToken,refreshToken:o.refreshToken||a,expiresIn:o.expiresIn}):B(c,"social")},c,i):null}async function E(a,b){return a?o("iflow",a,async()=>{let c=btoa(`${d.xq.iflow.clientId}:${d.xq.iflow.clientSecret}`),f=await fetch(e.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:d.xq.iflow.clientId,client_secret:d.xq.iflow.clientSecret})});if(!f.ok)return z(await f.text(),f.status,b,"iFlow");let g=await f.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed iFlow token",{hasNewAccessToken:!!g.access_token,hasNewRefreshToken:!!g.refresh_token,expiresIn:g.expires_in}),{accessToken:g.access_token,refreshToken:g.refresh_token||a,expiresIn:g.expires_in}},b):null}async function F(a,b){return a?o("github",a,async()=>{let c={grant_type:"refresh_token",refresh_token:a,client_id:d.xq.github.clientId};d.xq.github.clientSecret&&(c.client_secret=d.xq.github.clientSecret);let f=await fetch(e.NA.github.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams(c)});if(!f.ok)return z(await f.text(),f.status,b,"GitHub");let g=await f.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed GitHub token",{hasNewAccessToken:!!g.access_token,hasNewRefreshToken:!!g.refresh_token,expiresIn:g.expires_in}),{accessToken:g.access_token,refreshToken:g.refresh_token||a,expiresIn:g.expires_in}},b):null}async function G(a,b,c){if(!b.refreshToken)return null;switch(a){case"gemini-cli":case"antigravity":return u(b.refreshToken,d.xq[a].clientId,d.xq[a].clientSecret,c);case"claude":return t(b.refreshToken,c);case"codex":return C(b.refreshToken,c);case"qwen":return v(b.refreshToken,c);case"codebuddy":return w(b.refreshToken,c,"codebuddy");case"codebuddy-cn":return w(b.refreshToken,c,"codebuddy-cn");case"iflow":return E(b.refreshToken,c);case"github":return F(b.refreshToken,c);case"kiro":return D(b.refreshToken,b.providerSpecificData,c);case"xai":case"grok-cli":return k(b.refreshToken,c);case"vertex":case"vertex-partner":{let a=H(b.apiKey);if(!a)return null;return J(a,c)}default:return s(a,b.refreshToken,b,c)}}function H(a){if("string"!=typeof a)return null;try{let b=JSON.parse(a);if("service_account"===b.type&&b.client_email&&b.private_key&&b.project_id)return b;return null}catch{return null}}let I=new Map;async function J(a,b){let d=a.client_email,e=I.get(d);if(e&&e.expiresAt-Date.now()>3e5)return{accessToken:e.token,expiresAt:e.expiresAt};try{let{SignJWT:e,importPKCS8:f}=await c.e(3675).then(c.bind(c,3675));b?.debug?.("TOKEN_REFRESH",`Vertex minting token for ${a.client_email}`);let g=await f(a.private_key.replace(/\\n/g,"\n"),"RS256"),h=Math.floor(Date.now()/1e3),i=await new e({scope:"https://www.googleapis.com/auth/cloud-platform"}).setProtectedHeader({alg:"RS256"}).setIssuer(a.client_email).setAudience("https://oauth2.googleapis.com/token").setIssuedAt(h).setExpirationTime(h+3600).sign(g),j=await fetch("https://oauth2.googleapis.com/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:i})});if(!j.ok){let a=await j.text();return b?.error?.("TOKEN_REFRESH",`Vertex token mint failed: ${a}`),null}let{access_token:k,expires_in:l}=await j.json(),m=Date.now()+(l??3600)*1e3;return I.set(d,{token:k,expiresAt:m}),b?.info?.("TOKEN_REFRESH",`Vertex token minted for ${a.client_email}`),{accessToken:k,expiresAt:m}}catch(a){return b?.error?.("TOKEN_REFRESH",`Vertex token error: ${a.message}`),null}}},87404:(a,b,c)=>{"use strict";let{webidl:d}=c(32984),{validateCloseCodeAndReason:e}=c(94050),{kConstruct:f}=c(49176),{kEnumerableProperty:g}=c(84285);function h(){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 i extends h(){#bC;#bw;constructor(a="",b){if(super(a=d.converters.DOMString(a,"WebSocketError","message"),"WebSocketError"),b===f)return;null!==b&&(b=d.converters.WebSocketCloseInfo(b));let c=b.closeCode??null;const g=b.reason??"";e(c,g),0!==g.length&&null===c&&(c=1e3),this.#bC=c,this.#bw=g}get closeCode(){return this.#bC}get reason(){return this.#bw}static createUnvalidatedWebSocketError(a,b,c){let d=new i(a,f);return d.#bC=b,d.#bw=c,d}}let{createUnvalidatedWebSocketError:j}=i;delete i.createUnvalidatedWebSocketError,Object.defineProperties(i.prototype,{closeCode:g,reason:g,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}}),d.is.WebSocketError=d.util.MakeTypeAssertion(i),a.exports={WebSocketError:i,createUnvalidatedWebSocketError:j}},87658:(a,b,c)=>{"use strict";c.r(b),c.d(b,{openaiToClaudeResponse:()=>i});var d=c(56294),e=c(42541);let f="proxy_";function g(a,b){a.thinkingBlockStarted&&(b.push({type:"content_block_stop",index:a.thinkingBlockIndex}),a.thinkingBlockStarted=!1)}function h(a,b){a.textBlockStarted&&!a.textBlockClosed&&(a.textBlockClosed=!0,b.push({type:"content_block_stop",index:a.textBlockIndex}),a.textBlockStarted=!1)}function i(a,b){if(!a||!a.choices?.[0])return null;let c=[],d=a.choices[0],e=d.delta;if(a.usage&&"object"==typeof a.usage){let c="number"==typeof a.usage.prompt_tokens?a.usage.prompt_tokens:0,d="number"==typeof a.usage.completion_tokens?a.usage.completion_tokens:0,e=a.usage.prompt_tokens_details?.cached_tokens,f=a.usage.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)}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 i=e?.reasoning_content||e?.reasoning;if(i&&(h(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:i}})),e?.content&&(g(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){g(b,c),h(b,c);let e=b.nextBlockIndex++;b.toolCalls.set(d,{id:a.id,name:a.function?.name||"",blockIndex:e});let i=a.function?.name||"";i.startsWith(f)&&(i=i.slice(f.length)),c.push({type:"content_block_start",index:e,content_block:{type:"tool_use",id:a.id,name:i,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(g(b,c),h(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(f)?a.slice(f.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;let a=b.usage||{input_tokens:0,output_tokens:0};c.push({type:"message_delta",delta:{stop_reason:function(a){switch(a){case"stop":default:return"end_turn";case"length":return"max_tokens";case"tool_calls":return"tool_use"}}(d.finish_reason)},usage:a}),c.push({type:"message_stop"})}return c.length>0?c:null}(0,d.kz)(e.h.OPENAI,e.h.CLAUDE,null,i)},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)}`}},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(25346),h=c(24081),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)}})},89409:(a,b,c)=>{"use strict";let d=c(84285),{parseCacheControlHeader:e,hasInvalidCacheControlDirective:f,parseVaryHeader:g,hasVaryStar:h,isInvalidOrWildcardVaryHeader:i,isEtagUsable:j}=c(79468),{parseHttpDate:k}=c(24214);function l(){}let m=[200,203,204,206,300,301,308,404,405,410,414,501],n=[206];function o(a,b){for(let c=0;c<a.length;c++)if(a[c]===b)return!0;return!1}function p(a,b,c){s(a,{...b,path:c});for(let e=0;e<d.safeHTTPMethods.length;e++){let f=d.safeHTTPMethods[e];f!==b.method&&s(a,{...b,method:f,path:c})}}function q(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&&p(a,b,e)}}class r{#bD;#bE;#bF;#bG;#ay;#bH;constructor({store:a,type:b,cacheByDefault:c},d,e){this.#bG=a,this.#bE=b,this.#bF=c,this.#bD=d,this.#ay=e}onRequestStart(a,b){this.#bH?.destroy(),this.#bH=void 0,this.#ay.onRequestStart?.(a,b)}onRequestUpgrade(a,b,c,d){this.#ay.onRequestUpgrade?.(a,b,c,d)}onResponseStart(a,b,c,l){var r,u,v,w,x,y,z,A,B,C;let D,E=()=>this.#ay.onResponseStart?.(a,b,c,l),F=this;if(!o(d.safeHTTPMethods,this.#bD.method)&&b>=200&&b<=399){return r=this.#bG,u=this.#bD,p(r,u,u.path),q(r,u,c.location),q(r,u,c["content-location"]),E()}let G=c["cache-control"],H=c["last-modified"]&&o(m,b);if(!G&&!c.expires&&!H&&!this.#bF)return 304===b&&c.vary&&i(c.vary)&&s(this.#bG,this.#bD),E();let I=G?e(G):{};if(v=this.#bE,w=b,x=c,y=I,z=this.#bD.headers,w<200||o(n,w)||!o(m,w)&&!x.expires&&!y.public&&void 0===y["max-age"]&&!(y.private&&"private"===v)&&(void 0===y["s-maxage"]||"shared"!==v)||y["no-store"]||"shared"===v&&!0===y.private||x.vary&&h(x.vary)||null!=z&&Object.hasOwn(z,"authorization")&&(!y.public&&!y["s-maxage"]&&!y["must-revalidate"]||"string"!=typeof z.authorization||Array.isArray(y["no-cache"])&&o(y["no-cache"],"authorization")||Array.isArray(y.private)&&o(y.private,"authorization"))||0){return 304===b&&(G||(A=this.#bE,B=c,!0===(C=I)["no-store"]||"shared"===A&&!0===C.private||B.vary&&i(B.vary)))&&s(this.#bG,this.#bD),E()}let J=Date.now(),K=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!==K&&K>=2147483647e3)return t(b,this.#bG,this.#bD),E();let L=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:k(b)}(c.date):void 0;if(null===L)return t(b,this.#bG,this.#bD),E();let M=Math.max(L?Math.max(0,J-L.getTime()):0,K??0),N="string"==typeof c.etag&&j(c.etag)||"string"==typeof c["last-modified"],O=function(a,b,c,d,e,g,h){if("shared"===a){if(f(g,"s-maxage"))return 0;let a=g["s-maxage"];if(void 0!==a)return a>0?1e3*a:0}if(f(g,"max-age"))return 0;let i=g["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=k(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=k(d["last-modified"]);if(a){if(a.getTime()>=b)return;return .1*(b-a.getTime())}}return g.immutable?31536e6:!0===g["no-cache"]&&h?0:void 0}(this.#bE,J,K,c,L,I,N)??this.#bF,P=0===O&&N;if(void 0===O||M>=O&&!P)return(G||void 0!==O)&&t(b,this.#bG,this.#bD),E();let Q=J-M,R=O+Q;if(J>=R&&!P)return t(b,this.#bG,this.#bD),E();if(this.#bD.headers&&c.vary&&!(D=g(c.vary,this.#bD.headers)))return E();let S=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&&e===-1/0&&f===-1/0&&(g=b+31536e6),e===-1/0&&f===-1/0&&g===-1/0){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)}(Q,J,I,R),T=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),U={statusCode:b,statusMessage:l,headers:T,vary:D,cacheControlDirectives:I,cachedAt:Q,staleAt:R,deleteAt:S};if(304===b){let b=b=>{if(!b)return E();if(U.statusCode=b.statusCode,U.statusMessage=b.statusMessage,U.etag=b.etag,U.vary=D??b.vary,U.headers={...b.headers,...T},E(),this.#bH=this.#bG.createWriteStream(this.#bD,U),this.#bH&&b?.body)if("function"==typeof b.body.values){let c=b.body.values(),d=()=>{for(let b of c){let c=!1===this.#bH.write(b);if(this.#ay.onResponseData?.(a,b),c)break}};this.#bH.on("error",function(){F.#bH=void 0,F.#bG.delete(F.#bD)}).on("drain",()=>{d()}).on("close",function(){F.#bH===this&&(F.#bH=void 0)}),d()}else"function"==typeof b.body.on&&(b.body.on("data",b=>{this.#bH.write(b),this.#ay.onResponseData?.(a,b)}).on("end",()=>{this.#bH.end()}).on("error",()=>{this.#bH=void 0,this.#bG.delete(this.#bD)}),this.#bH.on("error",function(){F.#bH=void 0,F.#bG.delete(F.#bD)}).on("close",function(){F.#bH===this&&(F.#bH=void 0)}))},c=this.#bG.get(this.#bD);c&&"function"==typeof c.then?c.then(b):b(c)}else{if("string"==typeof c.etag&&j(c.etag)&&(U.etag=c.etag),this.#bH=this.#bG.createWriteStream(this.#bD,U),!this.#bH)return E();this.#bH.on("drain",()=>a.resume()).on("error",function(){F.#bH=void 0,F.#bG.delete(F.#bD)}).on("close",function(){F.#bH===this&&(F.#bH=void 0),a.resume()}),E()}}onResponseData(a,b){this.#bH?.write(b)===!1&&a.pause(),this.#ay.onResponseData?.(a,b)}onResponseEnd(a,b){this.#bH?.end(),this.#ay.onResponseEnd?.(a,b)}onResponseError(a,b){this.#bH?.destroy(b),this.#bH=void 0,this.#ay.onResponseError?.(a,b)}}function s(a,b){try{a.delete(b)?.catch?.(l)}catch{}}function t(a,b,c){304===a&&s(b,c)}a.exports=r},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);const{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.#bI(a,b);let d=this[k].findSnapshot(a);if(d)return this.#bJ(d,b);{if("update"===c)return this.#bK(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.#bK(a,b)}async #bI(a,b){return await this.loadSnapshots(),this.dispatch(a,b)}#bK(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)})}#bJ(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.#bL()}async saveSnapshots(a){return this[k].saveSnapshots(a||this[m])}#bL(){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.13"}},90181:(a,b,c)=>{"use strict";c.d(b,{getPricingForModel:()=>f}),c(24081);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),{normalizeHeaders:g,makeCacheKey:h,makeDeduplicationKey:i}=c(79468),j=d.channel("undici:request:pending-requests");a.exports=(a={})=>{let{methods:b=["GET"],skipHeaderNames:c=[],excludeHeaderNames:d=[],maxBufferSize:k=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(k)||k<=0)throw TypeError(`expected opts.maxBufferSize to be a positive finite number, got ${k}`);let l=new Set(c.map(a=>a.toLowerCase())),m=new Set(d.map(a=>a.toLowerCase())),n=new Map;return a=>(c,d)=>{if(c.upgrade||!1===b.includes(c.method))return a(c,d);if(c={...c,headers:g(c)},l.size>0){for(let b of Object.keys(c.headers))if(l.has(b.toLowerCase()))return a(c,d)}let e=i(h(c),m),o=n.get(e);if(o)return!!o.addWaitingHandler(d)||a(c,d);let p=new f(d,()=>{n.delete(e),j.hasSubscribers&&j.publish({size:n.size,key:e,type:"removed"})},k);return n.set(e,p),j.hasSubscribers&&j.publish({size:n.size,key:e,type:"added"}),a(c,p)}}},90548:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{RR:()=>v,bh:()=>q});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);let a=["temperature","top_p","max_completion_tokens","max_output_tokens","response_format","reasoning_effort","reasoning","tool_choice","parallel_tool_calls"],w=null;if(!("u">typeof caches&&"object"==typeof caches||"u">typeof EdgeRuntime))try{w=await Promise.resolve().then(c.t.bind(c,73496,23))}catch{}function m(...a){let b=a.filter(Boolean).map(a=>Buffer.from(a));return Buffer.concat(b)}function n(a,b){return(0,k.Xh)(a,2,b)}function o(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 p(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 q(b={}){let c=Array.isArray(b.messages)?b.messages.findLast(a=>a?.role!=="system"):null;return!0!==b.stream&&Array.isArray(b.messages)&&b.messages.length>0&&c?.role==="user"&&(!Array.isArray(b.tools)||0===b.tools.length)&&(void 0===b.max_tokens||32e3===b.max_tokens)&&!a.some(a=>void 0!==b[a])&&!b.messages.some(p)}function r(a){let b=o(a.content);if(!b)return null;let c=n(1,b);return"assistant"===a.role?n(2,n(1,n(1,c))):n(1,n(1,n(1,c)))}function s({url:a,headers:b,signal:c}){if(!w)throw Error("HTTP/2 is unavailable for Cursor AgentService");let d=new URL(a),e=w.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=()=>{let a=c?.reason instanceof Error?c.reason:Object.assign(Error("Cursor AgentService request aborted"),{name:"AbortError"});l(a),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 x extends Error{constructor(a,b=!1,c={}){super(a,c),this.name="CursorAgentError",this.semanticCommitted=b}}function t(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 u(a){let b=Buffer.from(a),c=new Map,d=0;for(;d<b.length;){let a,[e,f]=t(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]=t(b,d);else if(2===h){let c;if([c,d]=t(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}async function v(a){var b,c;let d,f,p,q,{model:t,body:v,credentials:w,signal:y,openStream:z=s}=a,A=(b=a.timeoutMs||6e4,f=new AbortController,p=()=>{let a=y?.reason,b=a?.name==="AbortError"?a:Object.assign(Error("Cursor AgentService request aborted",{...a instanceof Error?{cause:a}:{}}),{name:"AbortError"});f.abort(b)},y?.aborted?p():y?.addEventListener?.("abort",p,{once:!0}),q=setTimeout(()=>{let a=Error("Cursor AgentService request timed out");a.name="TimeoutError",f.abort(a)},b),q.unref?.(),{signal:f.signal,cleanup(){clearTimeout(q),y?.removeEventListener?.("abort",p)}}),B=A.signal,C=a.url||"https://agent.api5.cursor.sh/agent.v1.AgentService/Run",D=a.headers||(0,j.JA)(w.accessToken,w.providerSpecificData?.machineId,w.providerSpecificData?.ghostMode!==!1),E={buffer:Buffer.alloc(0),content:"",semanticCommitted:!1,terminal:!1};try{let a;(d=z({url:C,headers:D,signal:B})).write(function(a,b={},c={}){let d=b.messages||[],f=d.filter(a=>a?.role==="system").map(a=>o(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(r).filter(Boolean),l=m(n(1,o(i?.content)||"Continue."),n(2,c.requestId||(0,e.randomUUID)())),p=j.length?m(...j.map(a=>n(1,a))):null,q=m(n(1,l),p?n(7,p):null),s=n(1,q),t=m(n(1,a),(0,k.Xh)(7,0,1)),u=m(n(1,new Uint8Array),n(2,s),f?n(8,f):null,n(9,t));return Buffer.from((0,k.tM)(n(1,u)))}(t,v));let b=await d.responseHeaders,f=Number(b?.[":status"]||0);if(200!==f)throw new x(`Cursor AgentService returned HTTP ${f||h.gx.SERVER_ERROR}`);for(;!E.terminal;){let{done:a,value:b}=await d.read();if(a)break;E.buffer=Buffer.concat([E.buffer,Buffer.from(b)]),function(a,b){let c=a.buffer;for(;c.length>=5;){let d=c[0],e=c.readUInt32BE(1);if(e>0x1000000)throw new x("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 x("Cursor AgentService sent an invalid compressed frame",a.semanticCommitted,{cause:b})}2&d||function(a,b,c){try{let e=u(a);if(e.has(1)){let a=u(e.get(1)[0].value);if(a.has(1)){var d;let c,e=(d=u(a.get(1)[0].value),(c=d.get(1)?.[0]?.value)&&"number"!=typeof c?Buffer.from(c).toString("utf8"):"");e&&(b.content+=e,b.semanticCommitted=!0)}a.has(14)&&(b.terminal=!0)}if(e.has(2))if(u(e.get(2)[0].value).has(10)){let a=n(1,new Uint8Array);c.write((0,k.tM)(n(2,n(10,n(1,a)))))}else throw new x("Cursor AgentService requested an unsupported IDE tool",b.semanticCommitted)}catch(a){if(a instanceof x)throw a;throw new x("Cursor AgentService sent malformed protobuf",b.semanticCommitted,{cause:a})}}(f,a,b)}a.buffer=c}(E,d)}if(E.buffer.length>0)throw new x("Cursor AgentService ended with a truncated frame",E.semanticCommitted);if(!E.terminal)throw new x("Cursor AgentService ended without a terminal event",E.semanticCommitted);return{response:(c=E.content,a=Math.floor(Date.now()/1e3),new Response(JSON.stringify({id:`chatcmpl-cursor-agent-${Date.now()}`,object:"chat.completion",created:a,model:t,choices:[{index:0,message:{role:"assistant",content:c||null},finish_reason:"stop"}],usage:(0,l.OF)(v,c.length,i.h.OPENAI)}),{status:200,headers:{"Content-Type":"application/json","X-Zevai-Transport":"cursor-agent"}})),url:C,headers:D,transformedBody:v,responseFormat:i.h.OPENAI,semanticCommitted:E.semanticCommitted,transport:"agent",debug:{cursorTransport:"agent"}}}catch(a){if(a?.name==="AbortError"&&y?.aborted)throw a.semanticCommitted=E.semanticCommitted,a;if(a instanceof x)throw a;throw new x("Cursor AgentService transport failed",E.semanticCommitted,{cause:a})}finally{A.cleanup();try{d?.end?.()}catch{}try{d?.close?.()}catch{}}}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},91120:(a,b,c)=>{"use strict";c.d(b,{j:()=>h});var d=c(69384),e=c(30395),f=c(80015);let g=new Set;class h extends d.Hv{constructor(){super("opencode",e.xq.opencode)}transformRequest(a,b){return(0,f.Z)({provider:this.provider,model:a,body:b})}buildUrl(a){let b="https://opencode.ai";return g.has(a)?`${b}/zen/v1/messages`:`${b}/zen/v1/chat/completions`}buildHeaders(){return{"Content-Type":"application/json",Authorization:"Bearer public","x-opencode-client":"desktop",Accept:"text/event-stream"}}}},91297:(a,b,c)=>{"use strict";c.d(b,{c:()=>w});var d=c(55511),e=c.n(d),f=c(69384),g=c(30395),h=c(48991),i=c(8735),j=c(46956),k=c(11484),l=c(13324);let m=["opencode","open-code","cline","roo-cline","roo_cline","cursor","windsurf","aider","continue.dev","copilot","avante","codecompanion","claude code","claude-code","kilo code","kilocode","zevairouter","zevairouter"],n=new Map,o=new Set(["properties","patternProperties","$defs","definitions","dependencies","dependentSchemas","dependentRequired"]),p=new Set(["name","enum","const"]),q=new Set(["args","arguments","response"]),r=new Set(["x-forwarded-for","x-forwarded-host","x-forwarded-proto","x-forwarded-port","x-real-ip","forwarded","via","x-title","x-stainless-lang","x-stainless-package-version","x-stainless-os","x-stainless-arch","x-stainless-runtime","x-stainless-runtime-version","x-stainless-timeout","x-stainless-retry-count","x-stainless-helper-method","http-referer","referer","sec-ch-ua","sec-ch-ua-mobile","sec-ch-ua-platform","sec-fetch-mode","sec-fetch-site","sec-fetch-dest","priority","accept-encoding"]);var s=c(22067);let t=/restricted from using Gemini Code Assist for individuals in your organization/i,u=[/image/i,/imagen/i];function v(a){return!!a&&u.some(b=>b.test(a))}class w extends f.Hv{constructor(){super("antigravity",g.xq.antigravity)}buildUrl(a,b,c=0){let d=this.getBaseUrls(),e=d[c]||d[0],f=v(a);return`${e}/v1internal:${b&&!f?"streamGenerateContent?alt=sse":"generateContent"}`}buildHeaders(a,b=!0,c=null,d=null){return{"Content-Type":"application/json",Authorization:`Bearer ${a.accessToken}`,"User-Agent":(0,h.rJ)(d)}}transformRequest(a,b,c,d){let e=d?.projectId||d?.providerSpecificData?.projectId||this.generateProjectId();if(v(a)){let c=function(a){let b={aspectRatio:"1:1"},c=String(a).match(/(\d+)x(\d+)$/);if(c){let a=parseInt(c[1]),d=parseInt(c[2]);if(a<=16&&d<=16)b.aspectRatio=`${a}:${d}`;else{let c=(a,b)=>b?c(b,a%b):a,e=c(a,d)||1;b.aspectRatio=`${a/e}:${d/e}`}}return b}(a),f=String(a).replace(/-(\d+)x(\d+)$/,""),g=[];for(let a of b.request?.contents||b.contents||[]){let b=(a.parts||[]).filter(a=>void 0!==a.text||void 0!==a.inlineData);b.length>0&&g.push({role:a.role||"user",parts:b})}let h={contents:g,generationConfig:{temperature:1,topP:.95,topK:40,maxOutputTokens:8192,imageConfig:c},sessionId:b.request?.sessionId||(0,s.a0)(d)};return{project:e,model:f,userAgent:(0,s.Xv)(d),requestType:"image_gen",requestId:(0,s.VC)({body:b,request:h,credentials:d,model:f,requestType:"image_gen"}),request:h}}let f=b.request?.contents?.map(a=>{let b=a.role;a.parts?.some(a=>a.functionResponse)&&(b="user");let c=a.parts?.filter(a=>(!a.thought||!!a.functionCall)&&(!a.thoughtSignature||!!a.functionCall||!!a.text));return b!==a.role||c?.length!==a.parts?.length?{...a,role:b,parts:c}:a}),g=b.request?.tools;if(g&&g.length>0){let a=g.flatMap(a=>(a.functionDeclarations||[]).map(a=>({...a,name:function(a){if(!a)return"_unknown";let b=a.replace(/[^a-zA-Z0-9_.:\-]/g,"_");return/^[a-zA-Z_]/.test(b)||(b="_"+b),b.substring(0,64)}(a.name),parameters:a.parameters?(0,l.Yr)(structuredClone(a.parameters)):{type:"object",properties:{reason:{type:"string",description:"Brief explanation"}},required:["reason"]}})));g=a.length>0?[{functionDeclarations:a}]:[]}let{tools:h,toolConfig:i,...j}=b.request||{},k={...j.generationConfig||{}};k.maxOutputTokens>64e3&&(k.maxOutputTokens=64e3);let m={...j,generationConfig:k,...f&&{contents:f},...g&&{tools:g},sessionId:b.request?.sessionId||(0,s.a0)(d),safetySettings:void 0,...g?.length>0&&{toolConfig:i?.functionCallingConfig?i:{functionCallingConfig:{mode:"VALIDATED"}}}};return{...b,project:e,model:a,userAgent:(0,s.Xv)(d),requestType:"agent",requestId:(0,s.VC)({body:b,request:m,credentials:d,model:a,requestType:"agent"}),request:m}}async refreshCredentials(a,b,c=null){if(!a.refreshToken)return null;try{let d=await (0,j.proxyAwareFetch)(h.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.refreshToken,client_id:this.config.clientId,client_secret:this.config.clientSecret})},c);if(!d.ok)return await (0,k.aI)(d),null;let e=await d.json();return b?.info?.("TOKEN","Antigravity refreshed"),{accessToken:e.access_token,refreshToken:e.refresh_token||a.refreshToken,expiresIn:e.expires_in,projectId:a.projectId}}catch(a){return b?.error?.("TOKEN",`Antigravity refresh error: ${a.message}`),null}}generateProjectId(){let a=["useful","bright","swift","calm","bold"][Math.floor(5*Math.random())],b=["fuze","wave","spark","flow","core"][Math.floor(5*Math.random())];return`${a}-${b}-${e().randomUUID().slice(0,5)}`}generateSessionId(){return e().randomUUID()+Date.now().toString()}parseRetryHeaders(a){if(!a?.get)return null;let b=a.get("retry-after");if(b){let a=parseInt(b,10);if(!isNaN(a)&&a>0)return 1e3*a;let c=new Date(b);if(!isNaN(c.getTime())){let a=c.getTime()-Date.now();return a>0?a:null}}let c=a.get("x-ratelimit-reset-after");if(c){let a=parseInt(c,10);if(!isNaN(a)&&a>0)return 1e3*a}let d=a.get("x-ratelimit-reset");if(d){let a=1e3*parseInt(d,10)-Date.now();return a>0?a:null}return null}parseRetryFromErrorMessage(a){if(!a||"string"!=typeof a)return null;let b=a.match(/reset(?:s)?(?: after| in)?\s*:?\s*(\d+h)?(\d+m)?(\d+(?:\.\d+)?s)?/i);if(!b||!b[1]&&!b[2]&&!b[3])return null;let c=0;return b[1]&&(c+=3600*parseInt(b[1])*1e3),b[2]&&(c+=60*parseInt(b[2])*1e3),b[3]&&(c+=Math.round(1e3*parseFloat(b[3]))),c>0?c:null}parseError(a,b){if(a.status===i.gx.FORBIDDEN&&t.test(b||"")){let a=b;try{let c=JSON.parse(b);a=c?.error?.message||c?.message||b}catch{}return{status:i.gx.FORBIDDEN,message:a,failureClass:"policy_suspended",providerErrorCode:"ORG_CODE_ASSIST_RESTRICTED",refreshRecommended:!1}}if(a.status===i.gx.RATE_LIMITED&&b)try{let a=JSON.parse(b),c=a?.error,d=Array.isArray(c?.details)?c.details:[],e=Date.now(),f=null;for(let a of d){let b=a?.metadata;if(b?.quotaResetTimeStamp){let a=Date.parse(b.quotaResetTimeStamp);if(!Number.isNaN(a)&&a>e){f=a;break}}let c=function(a){if("string"!=typeof a)return null;let b=a.trim();if(!b)return null;if(b.endsWith("ms")){let a=parseFloat(b.slice(0,-2));return Number.isFinite(a)?a:null}let c=b.match(/^(?:(\d+(?:\.\d+)?)h)?(?:(\d+(?:\.\d+)?)m)?(?:(\d+(?:\.\d+)?)s)?$/);if(c&&(c[1]||c[2]||c[3])){let a=parseFloat(c[1]||"0"),b=parseFloat(c[2]||"0");return Math.round((3600*a+60*b+parseFloat(c[3]||"0"))*1e3)}return null}(b?.quotaResetDelay||a?.retryDelay);if(null!==c&&c>0){let a=e+c;(!f||a>f)&&(f=a)}}if(f)return{status:429,message:c?.message||b,resetsAtMs:f}}catch{}return super.parseError(a,b)}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:f,proxyOptions:g=null}){let h=this.getFallbackCount(),l=null,s=0,t={},u={},v=!1,w=!1;for(let x=0;x<h;x++){let y=this.buildUrl(a,c,x),z=this.transformRequest(a,b,c,d);w&&z.request&&(z.enabledCreditTypes=["GOOGLE_ONE_AI"]),z=function(a){if(null==a||"object"!=typeof a)return a;try{let{value:b}=function a(b){if("string"==typeof b){let a=function(a){if(!a||0===m.length)return a;let b=a;for(let a of m){if(!a)continue;let c=function(a){let b=n.get(a);return b||(n.size>2e3&&n.clear(),b=RegExp(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi"),n.set(a,b)),b}(a);b=b.replace(c,a=>a.length<=1?a:a[0]+"‍"+a.slice(1))}return b}(b);return{value:a,changed:a!==b}}if(Array.isArray(b)){let c=!1,d=b.map(b=>{let d=a(b);return d.changed&&(c=!0),d.value});return c?{value:d,changed:!0}:{value:b,changed:!1}}if(b&&"object"==typeof b){let c=!1,d={};for(let[e,f]of Object.entries(b))if(o.has(e)&&f&&"object"==typeof f&&!Array.isArray(f)){let b={},g=!1;for(let[c,d]of Object.entries(f)){let e=a(d);e.changed&&(g=!0),b[c]=e.value}d[e]=g?b:f,g&&(c=!0)}else if("required"===e||"propertyNames"===e)d[e]=f;else if(p.has(e))d[e]=f;else if(q.has(e)||("input"===e?b?.type==="tool_use":"content"===e&&b?.type==="tool_result"))d[e]=f;else{let b=a(f);b.changed&&(c=!0),d[e]=b.value}return c?{value:d,changed:!0}:{value:b,changed:!1}}return{value:b,changed:!1}}(a);return b}catch{return a}}(z);let A=z.request?.sessionId,B=function(a){let b,c={};for(let[d,e]of Object.entries(a||{})){let a=d.toLowerCase();if(!(a.startsWith("x-zevai-")||r.has(a))){if("authorization"===a){b=e;continue}c[d]=e}}return void 0!==b&&(c.Authorization=b),c}(this.buildHeaders(d,c,A,a));t[x]||(t[x]=0),u[x]||(u[x]=0);try{let a=await (0,j.proxyAwareFetch)(y,{method:"POST",headers:B,body:JSON.stringify(z),signal:e},g);if(a.status===i.gx.RATE_LIMITED||a.status===i.gx.SERVICE_UNAVAILABLE){if(a.status===i.gx.RATE_LIMITED&&!1===this.config.retrySameCredential429)return{response:a,url:y,headers:B,transformedBody:z};let b=this.parseRetryHeaders(a.headers),c="";if(!b)try{let d=await a.clone().text(),e=JSON.parse(d);c=e?.error?.message||e?.message||"",b=this.parseRetryFromErrorMessage(c)}catch(a){}if(a.status===i.gx.RATE_LIMITED&&!v&&/quota[_ ]?exhausted|quota reached|individual quota|enable overages/i.test(c)){v=!0,w=!0,f?.debug?.("RETRY","429 quota exhausted → retrying once with GOOGLE_ONE_AI credits"),await (0,k.aI)(a),x--;continue}if(a.status===i.gx.RATE_LIMITED&&/quota[_ ]?exhausted|quota reached|individual quota|enable overages/i.test(c)&&(!b||b>1e4))return f?.debug?.("RETRY",`429 quota exhausted${b?` (resets in ${Math.ceil(b/36e5)}h)`:""} — skipping futile retries, moving to next account`),s=a.status,{response:a,url:y,headers:B,transformedBody:z};if(b&&b<=1e4&&u[x]<3){u[x]++,f?.debug?.("RETRY",`${a.status} with Retry-After: ${Math.ceil(b/1e3)}s, waiting... (${u[x]}/3)`),await (0,k.aI)(a),await new Promise(a=>setTimeout(a,b)),x--;continue}if(a.status===i.gx.RATE_LIMITED&&(!b||0===b)&&t[x]<3){t[x]++;let b=Math.min(1e3*2**t[x],1e4);f?.debug?.("RETRY",`429 auto retry ${t[x]}/3 after ${b/1e3}s`),await (0,k.aI)(a),await new Promise(a=>setTimeout(a,b)),x--;continue}if(f?.debug?.("RETRY",`${a.status}, Retry-After ${b?`too long (${Math.ceil(b/1e3)}s)`:"missing"}, trying fallback`),s=a.status,x+1<h){await (0,k.aI)(a);continue}}if(this.shouldRetry(a.status,x)){f?.debug?.("RETRY",`${a.status} on ${y}, trying fallback ${x+1}`),s=a.status,await (0,k.aI)(a);continue}return{response:a,url:y,headers:B,transformedBody:z}}catch(a){if(l=a,x+1<h){f?.debug?.("RETRY",`Error on ${y}, trying fallback ${x+1}`);continue}throw a}}throw l||Error(`All ${h} URLs failed with status ${s}`)}}},91358:(a,b,c)=>{"use strict";c.d(b,{K:()=>e});var d=c(66678);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}}},91492:(a,b,c)=>{"use strict";c.d(b,{A:()=>u});var d=c(69384),e=c(42541),f=c(56294),g=c(15822),h=c(42671),i=c(70884),j=c(41222),k=c(28113),l=c(56248),m=c(98151);let n="Anthropic",o="OpenAi",p="Google";function q(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"XAi";let d=String(b||"").toLowerCase();return d.includes("claude")?n:d.includes("gemini")?p:d.includes("grok")||d.includes("xai")?"XAi":o}function r(a,b,c){return a===n?(0,j.claudeToOpenAIResponse)(b,c):a===p?(0,k.geminiToOpenAIResponse)(b,c):a===o?(0,l.openaiResponsesToOpenAIResponse)(b,c):b}function s(a,b,c){if(c)for(let d of Array.isArray(c)?c:[c])d&&a.enqueue(b.encode(`data: ${JSON.stringify(d)}
450
+ `),o("data: [DONE]\n\n")}f.close()}});return new Response(f,{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}async refreshCredentials(){return null}}},84285:(a,b,c)=>{"use strict";let d=c(34589),{kDestroyed:e,kBodyUsed:f,kListeners:g,kBody:h}=c(49176),{IncomingMessage:i}=c(37067),j=c(57075),k=c(77030),{stringify:l}=c(41792),{EventEmitter:m,addAbortListener:n}=c(78474),o=c(64704),{InvalidArgumentError:p,ConnectTimeoutError:q}=c(61448),{headerNameLowerCasedRecord:r}=c(28820),{tree:s}=c(36649);class t{constructor(a){this[h]=a,this[f]=!1}async *[Symbol.asyncIterator](){d(!this[f],"disturbed"),this[f]=!0,yield*this[h]}}function u(){}function v(a){return a&&"object"==typeof a&&"function"==typeof a.pipe&&"function"==typeof a.on}function w(a){return a instanceof Blob}function x(a){return a.includes("?")||a.includes("#")}function y(a){let b=parseInt(a,10);return b===Number(a)&&b>=0&&b<=65535}function z(a){return null!=a&&"h"===a[0]&&"t"===a[1]&&"t"===a[2]&&"p"===a[3]&&(":"===a[4]||"s"===a[4]&&":"===a[5])}function A(a){if("string"==typeof a){if(!z((a=new URL(a)).origin||a.protocol))throw new p("Invalid URL protocol: the URL must start with `http:` or `https:`.");return a}if(!a||"object"!=typeof a)throw new p("Invalid URL: The URL argument must be a non-null object.");if(!(a instanceof URL)){if(null!=a.port&&""!==a.port&&!1===y(a.port))throw new p("Invalid URL: port must be a valid integer or a string representation of an integer.");if(null!=a.path&&"string"!=typeof a.path)throw new p("Invalid URL path: the path must be a string or null/undefined.");if(null!=a.pathname&&"string"!=typeof a.pathname)throw new p("Invalid URL pathname: the pathname must be a string or null/undefined.");if(null!=a.hostname&&"string"!=typeof a.hostname)throw new p("Invalid URL hostname: the hostname must be a string or null/undefined.");if(null!=a.origin&&"string"!=typeof a.origin)throw new p("Invalid URL origin: the origin must be a string or null/undefined.");if(!z(a.origin||a.protocol))throw new p("Invalid URL protocol: the URL must start with `http:` or `https:`.");let b=null!=a.port?a.port:"https:"===a.protocol?443:80,c=null!=a.origin?a.origin:`${a.protocol||""}//${a.hostname||""}:${b}`,d=null!=a.path?a.path:`${a.pathname||""}${a.search||""}`;return"/"===c[c.length-1]&&(c=c.slice(0,c.length-1)),d&&"/"!==d[0]&&(d=`/${d}`),new URL(`${c}${d}`)}if(!z(a.origin||a.protocol))throw new p("Invalid URL protocol: the URL must start with `http:` or `https:`.");return a}function B(a){return null!=a&&("function"==typeof a[Symbol.iterator]||"function"==typeof a[Symbol.asyncIterator])}function C(a){if(null==a)return 0;if(v(a)){let b=a._readableState;return b&&!1===b.objectMode&&!0===b.ended&&Number.isFinite(b.length)?b.length:null}return w(a)?null!=a.size?a.size:null:H(a)?a.byteLength:null}function D(a){return a&&!!(a.destroyed||a[e]||j.isDestroyed?.(a))}function E(a,b){if(!(null==a||!v(a)||D(a))){if("function"==typeof a.destroy){Object.getPrototypeOf(a).constructor===i&&(a.socket=null);try{a.destroy(b)}catch{}}else b&&queueMicrotask(()=>{a.emit("error",b)});!0!==a.destroyed&&(a[e]=!0)}}let F=/timeout=(\d+)/;function G(a){return"string"==typeof a?r[a]??a.toLowerCase():s.lookup(a)??a.toString("latin1").toLowerCase()}function H(a){return a instanceof Uint8Array||Buffer.isBuffer(a)}function I(a){return a&&"object"==typeof a&&"function"==typeof a.append&&"function"==typeof a.delete&&"function"==typeof a.get&&"function"==typeof a.getAll&&"function"==typeof a.has&&"function"==typeof a.set&&"FormData"===a[Symbol.toStringTag]}let J=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),K=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/,L=/[^\t\x20-\x7e\x80-\xff]/,M=/^bytes (\d+)-(\d+)\/(\d+|\*)?$/,N="win32"===process.platform?(a,b)=>{if(!b.timeout)return u;let c=null,d=null,e=o.setFastTimeout(()=>{c=setImmediate(()=>{d=setImmediate(()=>O(a.deref(),b))})},b.timeout);return()=>{o.clearFastTimeout(e),clearImmediate(c),clearImmediate(d)}}:(a,b)=>{if(!b.timeout)return u;let c=null,d=o.setFastTimeout(()=>{c=setImmediate(()=>{O(a.deref(),b)})},b.timeout);return()=>{o.clearFastTimeout(d),clearImmediate(c)}};function O(a,b){if(null==a)return;let c="Connect Timeout Error";Array.isArray(a.autoSelectFamilyAttemptedAddresses)?c+=` (attempted addresses: ${a.autoSelectFamilyAttemptedAddresses.join(", ")},`:c+=` (attempted address: ${b.hostname}:${b.port},`,E(a,new q(c+=` timeout: ${b.timeout}ms)`))}let P=null,Q=null,R={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT",query:"QUERY",QUERY:"QUERY"},S={...R,patch:"patch",PATCH:"PATCH"};Object.setPrototypeOf(R,null),Object.setPrototypeOf(S,null),a.exports={kEnumerableProperty:{__proto__:null,enumerable:!0},isDisturbed:function(a){return!!(a&&(j.isDisturbed(a)||a[f]))},isBlobLike:w,parseOrigin:function(a){if("/"!==(a=A(a)).pathname||a.search||a.hash)throw new p("invalid url");return a},parseURL:A,getServerName:function(a){if(!a)return null;d("string"==typeof a);let b=function(a){if("["===a[0]){let b=a.indexOf("]");return d(-1!==b),a.substring(1,b)}let b=a.indexOf(":");return -1===b?a:a.substring(0,b)}(a);return k.isIP(b)?"":b},isStream:v,isIterable:B,hasSafeIterator:function(a){let b=Object.getPrototypeOf(a);return Object.hasOwn(a,Symbol.iterator)||null!=b&&b!==Object.prototype&&"function"==typeof a[Symbol.iterator]},isAsyncIterable:function(a){return null!=a&&"function"==typeof a[Symbol.asyncIterator]},isDestroyed:D,headerNameToString:G,bufferToLowerCasedHeaderName:function(a){return s.lookup(a)??a.toString("latin1").toLowerCase()},addListener:function(a,b,c){return(a[g]??=[]).push([b,c]),a.on(b,c),a},removeAllListeners:function(a){if(null!=a[g]){for(let[b,c]of a[g])a.removeListener(b,c);a[g]=null}return a},errorRequest:function(a,b,c){try{b.onResponseError(c),d(b.aborted)}catch(b){a.emit("error",b)}},parseRawHeaders:function(a){let b,c;if(null==a)return[];if(!Array.isArray(a)){let b=[];for(let[c,d]of Object.entries(a))if(Array.isArray(d))for(let a of d)b.push(c,`${a}`);else b.push(c,`${d}`);return b}let d=a.length,e=Array(d);for(let f=0;f<d;f+=2)b=a[f],c=a[f+1],"string"!=typeof b&&(b=b.toString()),"string"!=typeof c&&(c=c.toString("latin1")),e[f]=b,e[f+1]=c;return e},toRawHeaders:function(a){let b=[];for(let[c,d]of Object.entries(a))if(Array.isArray(d))for(let a of d)b.push(Buffer.from(c,"latin1"),Buffer.from(`${a}`,"latin1"));else b.push(Buffer.from(c,"latin1"),Buffer.from(`${d}`,"latin1"));return b},encodeRawHeaders:function(a){if(!Array.isArray(a))throw TypeError("expected headers to be an array");return a.map(a=>Buffer.from(a))},parseHeaders:function(a,b){void 0===b&&(b={});for(let c=0;c<a.length;c+=2){let d=G(a[c]),e=b[d];if(void 0!==e)if(Object.hasOwn(b,d))"string"==typeof e&&(e=[e],b[d]=e),e.push(a[c+1].toString("latin1"));else{let e="string"==typeof a[c+1]?a[c+1]:Array.isArray(a[c+1])?a[c+1].map(a=>a.toString("latin1")):a[c+1].toString("latin1");"__proto__"===d?Object.defineProperty(b,d,{value:e,enumerable:!0,configurable:!0,writable:!0}):b[d]=e}else{let e="string"==typeof a[c+1]?a[c+1]:Array.isArray(a[c+1])?a[c+1].map(a=>a.toString("latin1")):a[c+1].toString("latin1");b[d]=e}}return b},parseKeepAliveTimeout:function(a){let b=a.match(F);return b?1e3*parseInt(b[1],10):null},destroy:E,bodyLength:C,deepClone:function(a){return JSON.parse(JSON.stringify(a))},ReadableStreamFrom:function(a){let b;return new ReadableStream({start(){b=a[Symbol.asyncIterator]()},pull(a){return b.next().then(({done:b,value:c})=>{if(b)return queueMicrotask(()=>{a.close(),a.byobRequest?.respond(0)});{let b=Buffer.isBuffer(c)?c:Buffer.from(c);return b.byteLength?a.enqueue(new Uint8Array(b)):this.pull(a)}})},cancel:()=>b.return(),type:"bytes"})},isBuffer:H,assertRequestHandler:function(a,b,c){if(!a||"object"!=typeof a)throw new p("handler must be an object");if("function"!=typeof a.onRequestStart)throw new p("invalid onRequestStart method");if("function"!=typeof a.onResponseError)throw new p("invalid onResponseError method");if("function"!=typeof a.onBodySent&&void 0!==a.onBodySent)throw new p("invalid onBodySent method");if("function"!=typeof a.onRequestSent&&void 0!==a.onRequestSent)throw new p("invalid onRequestSent method");if(c||"CONNECT"===b){if("function"!=typeof a.onRequestUpgrade)throw new p("invalid onRequestUpgrade method")}else{if("function"!=typeof a.onResponseStart)throw new p("invalid onResponseStart method");if("function"!=typeof a.onResponseData)throw new p("invalid onResponseData method");if("function"!=typeof a.onResponseEnd)throw new p("invalid onResponseEnd method")}},getSocketInfo:function(a){return{localAddress:a.localAddress,localPort:a.localPort,remoteAddress:a.remoteAddress,remotePort:a.remotePort,remoteFamily:a.remoteFamily,timeout:a.timeout,bytesWritten:a.bytesWritten,bytesRead:a.bytesRead}},isFormDataLike:I,pathHasQueryOrFragment:x,serializePathWithQuery:function(a,b){if(x(a))throw Error('Query params cannot be passed when url already contains "?" or "#".');let c=l(b);return c&&(a+="?"+c),a},addAbortListener:function(a,b){return!a||"aborted"in a?n(a,b)[Symbol.dispose]:"function"==typeof a.addEventListener?(a.addEventListener("abort",b,{once:!0}),()=>a.removeEventListener("abort",b)):(a.once("abort",b),()=>a.removeListener("abort",b))},isValidHTTPToken:function(a){if(a.length>=12)return K.test(a);if(0===a.length)return!1;for(let b=0;b<a.length;b++)if(1!==J[a.charCodeAt(b)])return!1;return!0},isValidHeaderValue:function(a){return!L.test(a)},isTokenCharCode:function(a){return 1===J[a]},parseRangeHeader:function(a){if(null==a||""===a)return{start:0,end:null,size:null};if(!a)return null;let b=M.exec(a);return b?{start:parseInt(b[1]),end:b[2]?parseInt(b[2]):null,size:b[3]&&"*"!==b[3]?parseInt(b[3]):null}:null},normalizedMethodRecordsBase:R,normalizedMethodRecords:S,isValidPort:y,isHttpOrHttpsPrefixed:z,safeHTTPMethods:Object.freeze(["GET","HEAD","OPTIONS","TRACE"]),wrapRequestBody:function(a){return v(a)?(0===C(a)&&a.on("data",function(){d(!1)}),"boolean"!=typeof a.readableDidRead&&(a[f]=!1,m.prototype.on.call(a,"data",function(){this[f]=!0})),a):a&&"function"==typeof a.pipeTo?new t(a):a&&I(a)?a:a&&"string"!=typeof a&&!ArrayBuffer.isView(a)&&B(a)?new t(a):a},setupConnectTimeout:N,getProtocolFromUrlString:function(a){if(a===P)return Q;let b=function(a){if("h"===a[0]&&"t"===a[1]&&"t"===a[2]&&"p"===a[3])switch(a[4]){case":":return"http:";case"s":if(":"===a[5])return"https:"}return a.slice(0,a.indexOf(":")+1)}(a);return P=a,Q=b,b}}},84698:a=>{"use strict";function b(a){for(let b=0;b<a.length;++b){let c=a.charCodeAt(b);if(c<33||c>126||34===c||40===c||41===c||60===c||62===c||64===c||44===c||59===c||58===c||92===c||47===c||91===c||93===c||63===c||61===c||123===c||125===c)throw Error("Invalid cookie name")}}function c(a){let b=a.length,c=0;if('"'===a[0]){if(1===b||'"'!==a[b-1])throw Error("Invalid cookie value");--b,++c}for(;c<b;){let b=a.charCodeAt(c++);if(b<33||b>126||34===b||44===b||59===b||92===b)throw Error("Invalid cookie value")}}function d(a){for(let b=0;b<a.length;++b){let c=a.charCodeAt(b);if(c<32||c>126||59===c)throw Error("Invalid cookie path")}}function e(a){return a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122}let f=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],g=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],h=Array(61).fill(0).map((a,b)=>b.toString().padStart(2,"0"));function i(a){return"number"==typeof a&&(a=new Date(a)),`${f[a.getUTCDay()]}, ${h[a.getUTCDate()]} ${g[a.getUTCMonth()]} ${a.getUTCFullYear()} ${h[a.getUTCHours()]}:${h[a.getUTCMinutes()]}:${h[a.getUTCSeconds()]} GMT`}a.exports={isCTLExcludingHtab:function(a){for(let b=0;b<a.length;++b){let c=a.charCodeAt(b);if(c>=0&&c<=8||c>=10&&c<=31||127===c)return!0}return!1},validateCookieName:b,validateCookiePath:d,validateCookieValue:c,toIMFDate:i,stringify:function(a){if(0===a.name.length)return null;b(a.name),c(a.value);let f=[`${a.name}=${a.value}`];if(a.name.startsWith("__Secure-")&&(a.secure=!0),a.name.startsWith("__Host-")&&(a.secure=!0,a.domain=null,a.path="/"),a.secure&&f.push("Secure"),a.httpOnly&&f.push("HttpOnly"),"number"==typeof a.maxAge){if(a.maxAge<0)throw Error("Invalid cookie max-age");f.push(`Max-Age=${a.maxAge}`)}for(let g of(a.domain&&(!function(a){if(" "===a)return;if(a.length>255)throw Error("Invalid cookie domain");let b=0;for(let c=0;c<a.length;++c){let d=a.charCodeAt(c);if(46===d){if(0===b||45===a.charCodeAt(c-1))throw Error("Invalid cookie domain");b=0;continue}if(0===b&&!e(d)||!e(d)&&45!==d||++b>63)throw Error("Invalid cookie domain")}if(0===b||45===a.charCodeAt(a.length-1))throw Error("Invalid cookie domain")}(a.domain),f.push(`Domain=${a.domain}`)),a.path&&(d(a.path),f.push(`Path=${a.path}`)),a.expires&&"Invalid Date"!==a.expires.toString()&&f.push(`Expires=${i(a.expires)}`),a.sameSite&&f.push(`SameSite=${a.sameSite}`),a.unparsed)){if(!g.includes("="))throw Error("Invalid unparsed");let[a,...d]=g.split("="),e=a.trim(),h=d.join("=");b(e),c(h),f.push(`${e}=${h}`)}return f.join("; ")}}},84955:(a,b,c)=>{"use strict";c.d(b,{V:()=>h});var d=c(69384),e=c(30395),f=c(48991),g=c(11484);class h extends d.Hv{constructor(){super("gemini-cli",e.xq["gemini-cli"])}buildUrl(a,b,c=0){return`${this.config.baseUrl}:${b?"streamGenerateContent?alt=sse":"generateContent"}`}buildHeaders(a,b=!0){return{"Content-Type":"application/json",Authorization:`Bearer ${a.accessToken}`,"User-Agent":(0,f.sX)(this._currentModel),"X-Goog-Api-Client":f.go,Accept:b?"text/event-stream":"application/json"}}transformRequest(a,b,c,d){return(this._currentModel=a,b&&b.request&&b.model)?b:{project:d?.projectId||b?.project,model:a,request:b}}parseError(a,b){let c=super.parseError(a,b);if(429!==a.status||!b)return c;try{let a=JSON.parse(b),d=a?.error?.details;if(Array.isArray(d)){for(let a of d)if(a?.["@type"]==="type.googleapis.com/google.rpc.RetryInfo"&&a?.retryDelay){c.retryAfter=a.retryDelay;break}}}catch{}return c}async refreshCredentials(a,b){if(!a.refreshToken)return null;try{let c=await fetch(f.NA.google.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a.refreshToken,client_id:this.config.clientId,client_secret:this.config.clientSecret})});if(!c.ok)return await (0,g.aI)(c),null;let d=await c.json();return b?.info?.("TOKEN","Gemini CLI refreshed"),{accessToken:d.access_token,refreshToken:d.refresh_token||a.refreshToken,expiresIn:d.expires_in,projectId:a.projectId}}catch(a){return b?.error?.("TOKEN",`Gemini CLI refresh error: ${a.message}`),null}}}},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{#ai=1048576;#bB=!1;#aj=0;#G=null;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.#ai=a??this.#ai}#bx(a){this.aborted=!0,this.reason=a}onRequestStart(a,b){return a.abort=this.#bx.bind(this),this.#G=a,super.onRequestStart(a,b)}onResponseStart(a,b,c,d){let f=c["content-length"];if(null!=f&&f>this.#ai)throw new e(`Response size (${f}) larger than maxSize (${this.#ai})`);return!0===this.aborted||super.onResponseStart(a,b,c,d)}onResponseError(a,b){this.#bB||(b=this.#G?.reason??b,super.onResponseError(a,b))}onResponseData(a,b){return this.#aj=this.#aj+b.length,this.#aj>=this.#ai&&(this.#bB=!0,!0===this.aborted?super.onResponseError(a,this.reason):super.onResponseEnd(a,{})),!0}onResponseEnd(a,b){if(!this.#bB){if(!0===this.#G.aborted)return void super.onResponseError(a,this.reason);super.onResponseEnd(a,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)}}},87164:(a,b,c)=>{"use strict";c.d(b,{R_:()=>q,Og:()=>r,jT:()=>p,Sc:()=>H,Ql:()=>D,$B:()=>G,pb:()=>J});var d=c(30395),e=c(48991),f=c(46956);let g=new Set(["login.microsoftonline.com","login.microsoft.com","login.windows.net"]);function h(a){return"string"==typeof a?a.trim():""}var i=c(13335);let j=null;async function k(a,b){return a?o("xai",a,async()=>{try{j||(j=new(await c.e(4621).then(c.bind(c,14621))).XaiService);let b=await j.refreshAccessToken(a);return{accessToken:b.access_token,refreshToken:b.refresh_token||a,expiresIn:b.expires_in,idToken:b.id_token}}catch(c){b?.warn?.("TOKEN_REFRESH","xAI OAuth refresh failed",{status:c?.status||null,code:y(c?.code,c?.status),permanent:c?.permanent===!0});let a=String(c?.message||"");if(c?.permanent===!0||a.includes("invalid_grant")||a.includes("invalid_request"))return{error:"invalid_grant",code:y(c?.code||"invalid_grant",c?.status)};return null}},b):null}let l=new Map;function m(){let a=Error("Request aborted");return a.name="AbortError",a}function n(a,b){return a.waiterCount+=1,new Promise((c,d)=>{let e=!1,f=(c,d)=>{e||(e=!0,b?.removeEventListener?.("abort",g),a.waiterCount=Math.max(0,a.waiterCount-1),0!==a.waiterCount||a.settled||(a.acceptingWaiters=!1,a.controller.abort(m())),c(d))},g=()=>f(d,m());b?.addEventListener?.("abort",g,{once:!0}),b?.aborted&&g(),a.promise.then(a=>f(c,a),a=>f(d,a))})}async function o(a,b,c,d,e=null){let f,g;if(e?.aborted)throw m();if(!b)return c();let h=`${a}:${b}`,i=l.get(h);if(i){if(i.promise){if(!1===i.acceptingWaiters||i.controller.signal.aborted)try{return await (e?.aborted?Promise.reject(m()):new Promise((a,b)=>{let c=!1,d=(a,b)=>{c||(c=!0,e?.removeEventListener?.("abort",f),a(b))},f=()=>d(b,m());e?.addEventListener?.("abort",f,{once:!0}),e?.aborted&&f(),i.promise.then(b=>d(a,b),a=>d(b,a))}))}catch(f){if(e?.aborted)throw m();if(i.controller.signal.aborted&&f?.name==="AbortError")return o(a,b,c,d,e);throw f}return d?.info?.("TOKEN_REFRESH",`Reusing in-flight refresh for ${a}`),n(i,e)}if(i.expiresAt>Date.now())return d?.info?.("TOKEN_REFRESH",`Reusing recent refresh result for ${a}`),i.result;l.delete(h)}let j={controller:new AbortController,promise:new Promise((a,b)=>{f=a,g=b}),acceptingWaiters:!0,settled:!1,waiterCount:0};return l.set(h,j),(async()=>{try{let a=await c(j.controller.signal),b={result:a,expiresAt:Date.now()+1e4};l.set(h,b);let d=setTimeout(()=>{l.get(h)===b&&l.delete(h)},1e4);d.unref?.(),j.settled=!0,f(a)}catch(a){l.get(h)===j&&l.delete(h),j.settled=!0,g(a)}})(),n(j,e)}function p(a){return a&&"object"==typeof a&&("unrecoverable_refresh_error"===a.error||"refresh_token_reused"===a.error||"invalid_request"===a.error||"invalid_grant"===a.error)}function q(a={}){let b=String(a.code||a.error||"refresh_token_rejected").slice(0,120),c=Error("Refresh credential rejected; re-authentication required.");return c.name="RefreshCredentialError",c.code=b,c.permanent=!0,c}function r(a){return e.Wu[a]||3e5}async function s(a,b,c,e){let f=d.xq[a];return f&&f.refreshUrl?b?o(a,b,async()=>{try{let c=await fetch(f.refreshUrl,{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:f.clientId,client_secret:f.clientSecret})});if(!c.ok){let b=await c.text();return z(b,c.status,e,a)}let d=await c.json();return e?.info?.("TOKEN_REFRESH",`Successfully refreshed token for ${a}`,{hasNewAccessToken:!!d.access_token,hasNewRefreshToken:!!d.refresh_token,expiresIn:d.expires_in}),{accessToken:d.access_token,refreshToken:d.refresh_token||b,expiresIn:d.expires_in}}catch(b){return e?.error?.("TOKEN_REFRESH",`Error refreshing token for ${a}`,{error:b.message}),null}},e):(e?.warn?.("TOKEN_REFRESH",`No refresh token available for provider: ${a}`),null):(e?.warn?.("TOKEN_REFRESH",`No refresh URL configured for provider: ${a}`),null)}async function t(a,b){return a?o("claude",a,async()=>{try{let c=await fetch(e.NA.anthropic.token,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.claude.clientId})});if(!c.ok){let a=await c.text();return z(a,c.status,b,"Claude")}let f=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Claude OAuth token",{hasNewAccessToken:!!f.access_token,expiresIn:f.expires_in}),{accessToken:f.access_token,refreshToken:f.refresh_token||a,expiresIn:f.expires_in}}catch(a){return b?.error?.("TOKEN_REFRESH",`Network error refreshing Claude token: ${a.message}`),null}},b):null}async function u(a,b,c,d){return a?o(`google:${b}`,a,async()=>{try{let f=await fetch(e.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:b,client_secret:c})});if(!f.ok){let a=await f.text();return z(a,f.status,d,"Google")}let g=await f.json();return d?.info?.("TOKEN_REFRESH","Successfully refreshed Google token",{hasNewAccessToken:!!g.access_token,expiresIn:g.expires_in}),{accessToken:g.access_token,refreshToken:g.refresh_token||a,expiresIn:g.expires_in}}catch(a){return d?.error?.("TOKEN_REFRESH",`Network error refreshing Google token: ${a.message}`),null}},d):null}async function v(a,b){return a?o("qwen",a,async()=>{let c=e.NA.qwen.token;try{let e=await fetch(c,{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:d.xq.qwen.clientId})});if(200===e.status){let c=await e.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Qwen token",{hasNewAccessToken:!!c.access_token,hasNewRefreshToken:!!c.refresh_token,expiresIn:c.expires_in}),{accessToken:c.access_token,refreshToken:c.refresh_token||a,expiresIn:c.expires_in,providerSpecificData:c.resource_url?{resourceUrl:c.resource_url}:void 0}}{let a=await e.text().catch(()=>"");return z(a,e.status,b,"Qwen")}}catch(a){b?.warn?.("TOKEN_REFRESH","Network error trying Qwen endpoint",{error:a.message})}return b?.error?.("TOKEN_REFRESH","Failed to refresh Qwen token"),null},b):null}async function w(a,b,c="codebuddy"){return a?o(c,a,async()=>{try{let e=d.xq[c]||d.xq.codebuddy,g=e.refreshUrl,h=e.domain||"www.codebuddy.ai",j=await (0,f.proxyAwareFetch)(g,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":i.C,"X-Requested-With":"XMLHttpRequest","X-Domain":h,"X-Refresh-Token":a,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"});if(!j.ok){let a=await j.text().catch(()=>"");return z(a,j.status,b,c)}let k=await j.json(),l=k?.data||k,m=l?.accessToken||l?.access_token;if(!m)return null;return{accessToken:m,refreshToken:l?.refreshToken||l?.refresh_token||a,expiresIn:l?.expiresIn||l?.expires_in||86400}}catch(a){return b?.error?.("TOKEN_REFRESH",`Error refreshing token for ${c}`,{error:a.message}),null}},b):null}function x(a="",b=0){let c=null;try{c=a?JSON.parse(a):null}catch{c=null}let d=c?.error&&"object"==typeof c.error?c.error:null,e=d?.code||d?.type||("string"==typeof c?.error?c.error:"")||c?.error_code||"",f=d?.message||d?.error_description||c?.error_description||c?.message||a||"",g=`${e} ${f}`.toLowerCase(),h=400===b||401===b||["refresh_token_expired","refresh_token_reused","refresh_token_invalidated","invalid_refresh_token","invalid_grant"].some(a=>g.includes(a));return{status:b,code:e,description:f,permanent:h}}function y(a,b){let c="string"==typeof a?a.trim():"";return/^[a-zA-Z0-9_.:-]{1,120}$/.test(c)?c:`HTTP_${Number(b)||0}`}function z(a,b,c,d){let e=x(a,b),f=y(e.code,b);return c?.error?.("TOKEN_REFRESH",`${d} OAuth refresh failed`,{status:b,code:f,permanent:e.permanent}),e.permanent?{error:"unrecoverable_refresh_error",code:f}:null}function A(a,b,c,d){let e=function(a="",b=0){let c=null;try{c=a?JSON.parse(a):null}catch{c=null}let d=c?.error&&"object"==typeof c.error?c.error:c,e=[d?.reason,c?.reason,d?.code,c?.code,d?.errorCode,c?.errorCode,d?.type,c?.type,d?.__type,c?.__type,"string"==typeof c?.error?c.error:""].filter(a=>("string"==typeof a||"number"==typeof a)&&String(a).trim()),f=e.map(a=>String(a).trim()).find(a=>/^[A-Za-z0-9_.:#/-]{1,200}$/.test(a)&&!/^aor[A-Za-z0-9._~+/=-]{8,}$/.test(a)&&!/^eyJ[A-Za-z0-9_-]{8,}\./.test(a))||null,g=[d?.message,d?.Message,d?.error_description,c?.message,c?.Message,c?.error_description,c?"":a].find(a=>"string"==typeof a&&a.trim())||"",h=e.map(a=>String(a).replace(/([a-z0-9])([A-Z])/g,"$1_$2").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")),i=["invalid_grant","invalid_grant_exception","invalid_refresh_token","refresh_token_expired","refresh_token_revoked","refresh_token_reused","refresh_token_invalidated","expired_token","token_revoked","invalid_token","invalid_token_exception","invalid_client","invalid_client_exception","unauthorized_client"],j=h.some(a=>{let b=a.replace(/_exception$/,"");return i.some(a=>b===a||b.endsWith(`_${a}`))}),k=g.toLowerCase().slice(0,4e3),l=400===b||401===b||j||/\binvalid[_ -]?grant\b/.test(k)||/\brefresh token\b.{0,60}\b(?:expired|invalid|revoked|reused|disabled)\b/.test(k)||/\b(?:expired|invalid|revoked|reused|disabled)\b.{0,60}\brefresh token\b/.test(k);return{status:b,code:f,permanent:l}}(b,a.status);c?.error?.("TOKEN_REFRESH",`Kiro ${d} refresh failed`,{status:a.status,code:e.code,permanent:e.permanent});let f=Error(e.permanent?"Kiro refresh credential rejected":"Kiro refresh temporarily unavailable");throw f.name=e.permanent?"KiroRefreshCredentialError":"KiroRefreshTransientError",f.status=a.status,f.code=e.code,f.permanent=e.permanent,f}function B(a,b){a?.error?.("TOKEN_REFRESH",`Kiro ${b} refresh returned no access token`);let c=Error("Kiro refresh returned an invalid response");throw c.name="KiroRefreshTransientError",c.status=502,c.code="MISSING_ACCESS_TOKEN",c.permanent=!1,c}async function C(a,b){return a?o("codex",a,async()=>{try{let c=await fetch(e.NA.openai.token,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({client_id:d.xq.codex.clientId,grant_type:"refresh_token",refresh_token:a})});if(!c.ok){let a=await c.text();return x(a,c.status).permanent,z(a,c.status,b,"Codex")}let f=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Codex token",{hasNewAccessToken:!!f.access_token,hasNewRefreshToken:!!f.refresh_token,hasIdToken:!!f.id_token,expiresIn:f.expires_in}),{accessToken:f.access_token,refreshToken:f.refresh_token||a,idToken:f.id_token,expiresIn:f.expires_in}}catch(a){return b?.error?.("TOKEN_REFRESH",`Network error refreshing Codex token: ${a.message}`),null}},b):null}async function D(a,b,c,e=null,i=null){return a?o("kiro",a,async i=>{let j=b?.authMethod,k=b?.clientId,l=b?.clientSecret,m=b?.region;if("external_idp"===j){let d;try{d=function(a,b={}){var c;let d=h(b.clientId||b.client_id),e=function(a){let b,c=h(a);if(!c)throw Error("token_endpoint is required");try{b=new URL(c)}catch{throw Error("token_endpoint must be a valid URL")}if("https:"!==b.protocol)throw Error("token_endpoint must use https");if(!g.has(b.hostname.toLowerCase()))throw Error("token_endpoint must be a Microsoft login endpoint");return b.toString()}(b.tokenEndpoint||b.token_endpoint),f=Array.isArray(c=b.scope||b.scopes)?c.map(h).filter(Boolean).join(" "):h(c);if(!a)throw Error("refresh token is required");if(!d)throw Error("clientId is required for external_idp refresh");if(!f)throw Error("scope is required for external_idp refresh");return{tokenEndpoint:e,body:new URLSearchParams({grant_type:"refresh_token",client_id:d,refresh_token:a,scope:f}),providerSpecificData:{...b,authMethod:"external_idp",clientId:d,tokenEndpoint:e,scope:f}}}(a,b)}catch(a){return c?.warn?.("TOKEN_REFRESH",`Kiro external IdP refresh rejected: ${a.message}`),null}let j=await (0,f.proxyAwareFetch)(d.tokenEndpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:d.body,signal:i},{...e,singleTransportAttempt:!0});if(!j.ok){let a=await j.text();return A(j,a,c,"external IdP")}let k=await j.json();return k?.access_token?{accessToken:k.access_token,refreshToken:k.refresh_token||a,expiresIn:k.expires_in,providerSpecificData:d.providerSpecificData}:B(c,"external IdP")}if(k&&l){let b="idc"===j&&m?`https://oidc.${m}.amazonaws.com/token`:"https://oidc.us-east-1.amazonaws.com/token",d=await (0,f.proxyAwareFetch)(b,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:k,clientSecret:l,refreshToken:a,grantType:"refresh_token"}),signal:i},{...e,singleTransportAttempt:!0});if(!d.ok){let a=await d.text();return A(d,a,c,"AWS")}let g=await d.json();return g?.accessToken?(c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro AWS token",{hasNewAccessToken:!!g.accessToken,expiresIn:g.expiresIn}),{accessToken:g.accessToken,refreshToken:g.refreshToken||a,expiresIn:g.expiresIn}):B(c,"AWS")}let n=await (0,f.proxyAwareFetch)(d.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}),signal:i},{...e,singleTransportAttempt:!0});if(!n.ok){let a=await n.text();return A(n,a,c,"social")}let o=await n.json();return o?.accessToken?(c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro social token",{hasNewAccessToken:!!o.accessToken,expiresIn:o.expiresIn}),{accessToken:o.accessToken,refreshToken:o.refreshToken||a,expiresIn:o.expiresIn}):B(c,"social")},c,i):null}async function E(a,b){return a?o("iflow",a,async()=>{let c=btoa(`${d.xq.iflow.clientId}:${d.xq.iflow.clientSecret}`),f=await fetch(e.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:d.xq.iflow.clientId,client_secret:d.xq.iflow.clientSecret})});if(!f.ok)return z(await f.text(),f.status,b,"iFlow");let g=await f.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed iFlow token",{hasNewAccessToken:!!g.access_token,hasNewRefreshToken:!!g.refresh_token,expiresIn:g.expires_in}),{accessToken:g.access_token,refreshToken:g.refresh_token||a,expiresIn:g.expires_in}},b):null}async function F(a,b){return a?o("github",a,async()=>{let c={grant_type:"refresh_token",refresh_token:a,client_id:d.xq.github.clientId};d.xq.github.clientSecret&&(c.client_secret=d.xq.github.clientSecret);let f=await fetch(e.NA.github.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams(c)});if(!f.ok)return z(await f.text(),f.status,b,"GitHub");let g=await f.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed GitHub token",{hasNewAccessToken:!!g.access_token,hasNewRefreshToken:!!g.refresh_token,expiresIn:g.expires_in}),{accessToken:g.access_token,refreshToken:g.refresh_token||a,expiresIn:g.expires_in}},b):null}async function G(a,b,c){if(!b.refreshToken)return null;switch(a){case"gemini-cli":case"antigravity":return u(b.refreshToken,d.xq[a].clientId,d.xq[a].clientSecret,c);case"claude":return t(b.refreshToken,c);case"codex":return C(b.refreshToken,c);case"qwen":return v(b.refreshToken,c);case"codebuddy":return w(b.refreshToken,c,"codebuddy");case"codebuddy-cn":return w(b.refreshToken,c,"codebuddy-cn");case"iflow":return E(b.refreshToken,c);case"github":return F(b.refreshToken,c);case"kiro":return D(b.refreshToken,b.providerSpecificData,c);case"xai":case"grok-cli":return k(b.refreshToken,c);case"vertex":case"vertex-partner":{let a=H(b.apiKey);if(!a)return null;return J(a,c)}default:return s(a,b.refreshToken,b,c)}}function H(a){if("string"!=typeof a)return null;try{let b=JSON.parse(a);if("service_account"===b.type&&b.client_email&&b.private_key&&b.project_id)return b;return null}catch{return null}}let I=new Map;async function J(a,b){let d=a.client_email,e=I.get(d);if(e&&e.expiresAt-Date.now()>3e5)return{accessToken:e.token,expiresAt:e.expiresAt};try{let{SignJWT:e,importPKCS8:f}=await c.e(3675).then(c.bind(c,3675));b?.debug?.("TOKEN_REFRESH",`Vertex minting token for ${a.client_email}`);let g=await f(a.private_key.replace(/\\n/g,"\n"),"RS256"),h=Math.floor(Date.now()/1e3),i=await new e({scope:"https://www.googleapis.com/auth/cloud-platform"}).setProtectedHeader({alg:"RS256"}).setIssuer(a.client_email).setAudience("https://oauth2.googleapis.com/token").setIssuedAt(h).setExpirationTime(h+3600).sign(g),j=await fetch("https://oauth2.googleapis.com/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:i})});if(!j.ok){let a=await j.text();return b?.error?.("TOKEN_REFRESH",`Vertex token mint failed: ${a}`),null}let{access_token:k,expires_in:l}=await j.json(),m=Date.now()+(l??3600)*1e3;return I.set(d,{token:k,expiresAt:m}),b?.info?.("TOKEN_REFRESH",`Vertex token minted for ${a.client_email}`),{accessToken:k,expiresAt:m}}catch(a){return b?.error?.("TOKEN_REFRESH",`Vertex token error: ${a.message}`),null}}},87404:(a,b,c)=>{"use strict";let{webidl:d}=c(32984),{validateCloseCodeAndReason:e}=c(94050),{kConstruct:f}=c(49176),{kEnumerableProperty:g}=c(84285);function h(){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 i extends h(){#bC;#bw;constructor(a="",b){if(super(a=d.converters.DOMString(a,"WebSocketError","message"),"WebSocketError"),b===f)return;null!==b&&(b=d.converters.WebSocketCloseInfo(b));let c=b.closeCode??null;const g=b.reason??"";e(c,g),0!==g.length&&null===c&&(c=1e3),this.#bC=c,this.#bw=g}get closeCode(){return this.#bC}get reason(){return this.#bw}static createUnvalidatedWebSocketError(a,b,c){let d=new i(a,f);return d.#bC=b,d.#bw=c,d}}let{createUnvalidatedWebSocketError:j}=i;delete i.createUnvalidatedWebSocketError,Object.defineProperties(i.prototype,{closeCode:g,reason:g,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}}),d.is.WebSocketError=d.util.MakeTypeAssertion(i),a.exports={WebSocketError:i,createUnvalidatedWebSocketError:j}},87658:(a,b,c)=>{"use strict";c.r(b),c.d(b,{openaiToClaudeResponse:()=>i});var d=c(56294),e=c(42541);let f="proxy_";function g(a,b){a.thinkingBlockStarted&&(b.push({type:"content_block_stop",index:a.thinkingBlockIndex}),a.thinkingBlockStarted=!1)}function h(a,b){a.textBlockStarted&&!a.textBlockClosed&&(a.textBlockClosed=!0,b.push({type:"content_block_stop",index:a.textBlockIndex}),a.textBlockStarted=!1)}function i(a,b){if(!a||!a.choices?.[0])return null;let c=[],d=a.choices[0],e=d.delta;if(a.usage&&"object"==typeof a.usage){let c="number"==typeof a.usage.prompt_tokens?a.usage.prompt_tokens:0,d="number"==typeof a.usage.completion_tokens?a.usage.completion_tokens:0,e=a.usage.prompt_tokens_details?.cached_tokens,f=a.usage.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)}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 i=e?.reasoning_content||e?.reasoning;if(i&&(h(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:i}})),e?.content&&(g(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){g(b,c),h(b,c);let e=b.nextBlockIndex++;b.toolCalls.set(d,{id:a.id,name:a.function?.name||"",blockIndex:e});let i=a.function?.name||"";i.startsWith(f)&&(i=i.slice(f.length)),c.push({type:"content_block_start",index:e,content_block:{type:"tool_use",id:a.id,name:i,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(g(b,c),h(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(f)?a.slice(f.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;let a=b.usage||{input_tokens:0,output_tokens:0};c.push({type:"message_delta",delta:{stop_reason:function(a){switch(a){case"stop":default:return"end_turn";case"length":return"max_tokens";case"tool_calls":return"tool_use"}}(d.finish_reason)},usage:a}),c.push({type:"message_stop"})}return c.length>0?c:null}(0,d.kz)(e.h.OPENAI,e.h.CLAUDE,null,i)},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)}`}},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(25346),h=c(24081),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)}})},89409:(a,b,c)=>{"use strict";let d=c(84285),{parseCacheControlHeader:e,hasInvalidCacheControlDirective:f,parseVaryHeader:g,hasVaryStar:h,isInvalidOrWildcardVaryHeader:i,isEtagUsable:j}=c(79468),{parseHttpDate:k}=c(24214);function l(){}let m=[200,203,204,206,300,301,308,404,405,410,414,501],n=[206];function o(a,b){for(let c=0;c<a.length;c++)if(a[c]===b)return!0;return!1}function p(a,b,c){s(a,{...b,path:c});for(let e=0;e<d.safeHTTPMethods.length;e++){let f=d.safeHTTPMethods[e];f!==b.method&&s(a,{...b,method:f,path:c})}}function q(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&&p(a,b,e)}}class r{#bD;#bE;#bF;#bG;#ay;#bH;constructor({store:a,type:b,cacheByDefault:c},d,e){this.#bG=a,this.#bE=b,this.#bF=c,this.#bD=d,this.#ay=e}onRequestStart(a,b){this.#bH?.destroy(),this.#bH=void 0,this.#ay.onRequestStart?.(a,b)}onRequestUpgrade(a,b,c,d){this.#ay.onRequestUpgrade?.(a,b,c,d)}onResponseStart(a,b,c,l){var r,u,v,w,x,y,z,A,B,C;let D,E=()=>this.#ay.onResponseStart?.(a,b,c,l),F=this;if(!o(d.safeHTTPMethods,this.#bD.method)&&b>=200&&b<=399){return r=this.#bG,u=this.#bD,p(r,u,u.path),q(r,u,c.location),q(r,u,c["content-location"]),E()}let G=c["cache-control"],H=c["last-modified"]&&o(m,b);if(!G&&!c.expires&&!H&&!this.#bF)return 304===b&&c.vary&&i(c.vary)&&s(this.#bG,this.#bD),E();let I=G?e(G):{};if(v=this.#bE,w=b,x=c,y=I,z=this.#bD.headers,w<200||o(n,w)||!o(m,w)&&!x.expires&&!y.public&&void 0===y["max-age"]&&!(y.private&&"private"===v)&&(void 0===y["s-maxage"]||"shared"!==v)||y["no-store"]||"shared"===v&&!0===y.private||x.vary&&h(x.vary)||null!=z&&Object.hasOwn(z,"authorization")&&(!y.public&&!y["s-maxage"]&&!y["must-revalidate"]||"string"!=typeof z.authorization||Array.isArray(y["no-cache"])&&o(y["no-cache"],"authorization")||Array.isArray(y.private)&&o(y.private,"authorization"))||0){return 304===b&&(G||(A=this.#bE,B=c,!0===(C=I)["no-store"]||"shared"===A&&!0===C.private||B.vary&&i(B.vary)))&&s(this.#bG,this.#bD),E()}let J=Date.now(),K=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!==K&&K>=2147483647e3)return t(b,this.#bG,this.#bD),E();let L=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:k(b)}(c.date):void 0;if(null===L)return t(b,this.#bG,this.#bD),E();let M=Math.max(L?Math.max(0,J-L.getTime()):0,K??0),N="string"==typeof c.etag&&j(c.etag)||"string"==typeof c["last-modified"],O=function(a,b,c,d,e,g,h){if("shared"===a){if(f(g,"s-maxage"))return 0;let a=g["s-maxage"];if(void 0!==a)return a>0?1e3*a:0}if(f(g,"max-age"))return 0;let i=g["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=k(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=k(d["last-modified"]);if(a){if(a.getTime()>=b)return;return .1*(b-a.getTime())}}return g.immutable?31536e6:!0===g["no-cache"]&&h?0:void 0}(this.#bE,J,K,c,L,I,N)??this.#bF,P=0===O&&N;if(void 0===O||M>=O&&!P)return(G||void 0!==O)&&t(b,this.#bG,this.#bD),E();let Q=J-M,R=O+Q;if(J>=R&&!P)return t(b,this.#bG,this.#bD),E();if(this.#bD.headers&&c.vary&&!(D=g(c.vary,this.#bD.headers)))return E();let S=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&&e===-1/0&&f===-1/0&&(g=b+31536e6),e===-1/0&&f===-1/0&&g===-1/0){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)}(Q,J,I,R),T=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),U={statusCode:b,statusMessage:l,headers:T,vary:D,cacheControlDirectives:I,cachedAt:Q,staleAt:R,deleteAt:S};if(304===b){let b=b=>{if(!b)return E();if(U.statusCode=b.statusCode,U.statusMessage=b.statusMessage,U.etag=b.etag,U.vary=D??b.vary,U.headers={...b.headers,...T},E(),this.#bH=this.#bG.createWriteStream(this.#bD,U),this.#bH&&b?.body)if("function"==typeof b.body.values){let c=b.body.values(),d=()=>{for(let b of c){let c=!1===this.#bH.write(b);if(this.#ay.onResponseData?.(a,b),c)break}};this.#bH.on("error",function(){F.#bH=void 0,F.#bG.delete(F.#bD)}).on("drain",()=>{d()}).on("close",function(){F.#bH===this&&(F.#bH=void 0)}),d()}else"function"==typeof b.body.on&&(b.body.on("data",b=>{this.#bH.write(b),this.#ay.onResponseData?.(a,b)}).on("end",()=>{this.#bH.end()}).on("error",()=>{this.#bH=void 0,this.#bG.delete(this.#bD)}),this.#bH.on("error",function(){F.#bH=void 0,F.#bG.delete(F.#bD)}).on("close",function(){F.#bH===this&&(F.#bH=void 0)}))},c=this.#bG.get(this.#bD);c&&"function"==typeof c.then?c.then(b):b(c)}else{if("string"==typeof c.etag&&j(c.etag)&&(U.etag=c.etag),this.#bH=this.#bG.createWriteStream(this.#bD,U),!this.#bH)return E();this.#bH.on("drain",()=>a.resume()).on("error",function(){F.#bH=void 0,F.#bG.delete(F.#bD)}).on("close",function(){F.#bH===this&&(F.#bH=void 0),a.resume()}),E()}}onResponseData(a,b){this.#bH?.write(b)===!1&&a.pause(),this.#ay.onResponseData?.(a,b)}onResponseEnd(a,b){this.#bH?.end(),this.#ay.onResponseEnd?.(a,b)}onResponseError(a,b){this.#bH?.destroy(b),this.#bH=void 0,this.#ay.onResponseError?.(a,b)}}function s(a,b){try{a.delete(b)?.catch?.(l)}catch{}}function t(a,b,c){304===a&&s(b,c)}a.exports=r},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);const{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.#bI(a,b);let d=this[k].findSnapshot(a);if(d)return this.#bJ(d,b);{if("update"===c)return this.#bK(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.#bK(a,b)}async #bI(a,b){return await this.loadSnapshots(),this.dispatch(a,b)}#bK(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)})}#bJ(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.#bL()}async saveSnapshots(a){return this[k].saveSnapshots(a||this[m])}#bL(){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.15"}},90181:(a,b,c)=>{"use strict";c.d(b,{getPricingForModel:()=>f}),c(24081);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),{normalizeHeaders:g,makeCacheKey:h,makeDeduplicationKey:i}=c(79468),j=d.channel("undici:request:pending-requests");a.exports=(a={})=>{let{methods:b=["GET"],skipHeaderNames:c=[],excludeHeaderNames:d=[],maxBufferSize:k=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(k)||k<=0)throw TypeError(`expected opts.maxBufferSize to be a positive finite number, got ${k}`);let l=new Set(c.map(a=>a.toLowerCase())),m=new Set(d.map(a=>a.toLowerCase())),n=new Map;return a=>(c,d)=>{if(c.upgrade||!1===b.includes(c.method))return a(c,d);if(c={...c,headers:g(c)},l.size>0){for(let b of Object.keys(c.headers))if(l.has(b.toLowerCase()))return a(c,d)}let e=i(h(c),m),o=n.get(e);if(o)return!!o.addWaitingHandler(d)||a(c,d);let p=new f(d,()=>{n.delete(e),j.hasSubscribers&&j.publish({size:n.size,key:e,type:"removed"})},k);return n.set(e,p),j.hasSubscribers&&j.publish({size:n.size,key:e,type:"added"}),a(c,p)}}},90548:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{RR:()=>v,bh:()=>q});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);let a=["temperature","top_p","max_completion_tokens","max_output_tokens","response_format","reasoning_effort","reasoning","tool_choice","parallel_tool_calls"],w=null;if(!("u">typeof caches&&"object"==typeof caches||"u">typeof EdgeRuntime))try{w=await Promise.resolve().then(c.t.bind(c,73496,23))}catch{}function m(...a){let b=a.filter(Boolean).map(a=>Buffer.from(a));return Buffer.concat(b)}function n(a,b){return(0,k.Xh)(a,2,b)}function o(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 p(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 q(b={}){let c=Array.isArray(b.messages)?b.messages.findLast(a=>a?.role!=="system"):null;return!0!==b.stream&&Array.isArray(b.messages)&&b.messages.length>0&&c?.role==="user"&&(!Array.isArray(b.tools)||0===b.tools.length)&&(void 0===b.max_tokens||32e3===b.max_tokens)&&!a.some(a=>void 0!==b[a])&&!b.messages.some(p)}function r(a){let b=o(a.content);if(!b)return null;let c=n(1,b);return"assistant"===a.role?n(2,n(1,n(1,c))):n(1,n(1,n(1,c)))}function s({url:a,headers:b,signal:c}){if(!w)throw Error("HTTP/2 is unavailable for Cursor AgentService");let d=new URL(a),e=w.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=()=>{let a=c?.reason instanceof Error?c.reason:Object.assign(Error("Cursor AgentService request aborted"),{name:"AbortError"});l(a),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 x extends Error{constructor(a,b=!1,c={}){super(a,c),this.name="CursorAgentError",this.semanticCommitted=b}}function t(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 u(a){let b=Buffer.from(a),c=new Map,d=0;for(;d<b.length;){let a,[e,f]=t(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]=t(b,d);else if(2===h){let c;if([c,d]=t(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}async function v(a){var b,c;let d,f,p,q,{model:t,body:v,credentials:w,signal:y,openStream:z=s}=a,A=(b=a.timeoutMs||6e4,f=new AbortController,p=()=>{let a=y?.reason,b=a?.name==="AbortError"?a:Object.assign(Error("Cursor AgentService request aborted",{...a instanceof Error?{cause:a}:{}}),{name:"AbortError"});f.abort(b)},y?.aborted?p():y?.addEventListener?.("abort",p,{once:!0}),q=setTimeout(()=>{let a=Error("Cursor AgentService request timed out");a.name="TimeoutError",f.abort(a)},b),q.unref?.(),{signal:f.signal,cleanup(){clearTimeout(q),y?.removeEventListener?.("abort",p)}}),B=A.signal,C=a.url||"https://agent.api5.cursor.sh/agent.v1.AgentService/Run",D=a.headers||(0,j.JA)(w.accessToken,w.providerSpecificData?.machineId,w.providerSpecificData?.ghostMode!==!1),E={buffer:Buffer.alloc(0),content:"",semanticCommitted:!1,terminal:!1};try{let a;(d=z({url:C,headers:D,signal:B})).write(function(a,b={},c={}){let d=b.messages||[],f=d.filter(a=>a?.role==="system").map(a=>o(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(r).filter(Boolean),l=m(n(1,o(i?.content)||"Continue."),n(2,c.requestId||(0,e.randomUUID)())),p=j.length?m(...j.map(a=>n(1,a))):null,q=m(n(1,l),p?n(7,p):null),s=n(1,q),t=m(n(1,a),(0,k.Xh)(7,0,1)),u=m(n(1,new Uint8Array),n(2,s),f?n(8,f):null,n(9,t));return Buffer.from((0,k.tM)(n(1,u)))}(t,v));let b=await d.responseHeaders,f=Number(b?.[":status"]||0);if(200!==f)throw new x(`Cursor AgentService returned HTTP ${f||h.gx.SERVER_ERROR}`);for(;!E.terminal;){let{done:a,value:b}=await d.read();if(a)break;E.buffer=Buffer.concat([E.buffer,Buffer.from(b)]),function(a,b){let c=a.buffer;for(;c.length>=5;){let d=c[0],e=c.readUInt32BE(1);if(e>0x1000000)throw new x("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 x("Cursor AgentService sent an invalid compressed frame",a.semanticCommitted,{cause:b})}2&d||function(a,b,c){try{let e=u(a);if(e.has(1)){let a=u(e.get(1)[0].value);if(a.has(1)){var d;let c,e=(d=u(a.get(1)[0].value),(c=d.get(1)?.[0]?.value)&&"number"!=typeof c?Buffer.from(c).toString("utf8"):"");e&&(b.content+=e,b.semanticCommitted=!0)}a.has(14)&&(b.terminal=!0)}if(e.has(2))if(u(e.get(2)[0].value).has(10)){let a=n(1,new Uint8Array);c.write((0,k.tM)(n(2,n(10,n(1,a)))))}else throw new x("Cursor AgentService requested an unsupported IDE tool",b.semanticCommitted)}catch(a){if(a instanceof x)throw a;throw new x("Cursor AgentService sent malformed protobuf",b.semanticCommitted,{cause:a})}}(f,a,b)}a.buffer=c}(E,d)}if(E.buffer.length>0)throw new x("Cursor AgentService ended with a truncated frame",E.semanticCommitted);if(!E.terminal)throw new x("Cursor AgentService ended without a terminal event",E.semanticCommitted);return{response:(c=E.content,a=Math.floor(Date.now()/1e3),new Response(JSON.stringify({id:`chatcmpl-cursor-agent-${Date.now()}`,object:"chat.completion",created:a,model:t,choices:[{index:0,message:{role:"assistant",content:c||null},finish_reason:"stop"}],usage:(0,l.OF)(v,c.length,i.h.OPENAI)}),{status:200,headers:{"Content-Type":"application/json","X-Zevai-Transport":"cursor-agent"}})),url:C,headers:D,transformedBody:v,responseFormat:i.h.OPENAI,semanticCommitted:E.semanticCommitted,transport:"agent",debug:{cursorTransport:"agent"}}}catch(a){if(a?.name==="AbortError"&&y?.aborted)throw a.semanticCommitted=E.semanticCommitted,a;if(a instanceof x)throw a;throw new x("Cursor AgentService transport failed",E.semanticCommitted,{cause:a})}finally{A.cleanup();try{d?.end?.()}catch{}try{d?.close?.()}catch{}}}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},91120:(a,b,c)=>{"use strict";c.d(b,{j:()=>h});var d=c(69384),e=c(30395),f=c(80015);let g=new Set;class h extends d.Hv{constructor(){super("opencode",e.xq.opencode)}transformRequest(a,b){return(0,f.Z)({provider:this.provider,model:a,body:b})}buildUrl(a){let b="https://opencode.ai";return g.has(a)?`${b}/zen/v1/messages`:`${b}/zen/v1/chat/completions`}buildHeaders(){return{"Content-Type":"application/json",Authorization:"Bearer public","x-opencode-client":"desktop",Accept:"text/event-stream"}}}},91297:(a,b,c)=>{"use strict";c.d(b,{c:()=>w});var d=c(55511),e=c.n(d),f=c(69384),g=c(30395),h=c(48991),i=c(8735),j=c(46956),k=c(11484),l=c(13324);let m=["opencode","open-code","cline","roo-cline","roo_cline","cursor","windsurf","aider","continue.dev","copilot","avante","codecompanion","claude code","claude-code","kilo code","kilocode","zevairouter","zevairouter"],n=new Map,o=new Set(["properties","patternProperties","$defs","definitions","dependencies","dependentSchemas","dependentRequired"]),p=new Set(["name","enum","const"]),q=new Set(["args","arguments","response"]),r=new Set(["x-forwarded-for","x-forwarded-host","x-forwarded-proto","x-forwarded-port","x-real-ip","forwarded","via","x-title","x-stainless-lang","x-stainless-package-version","x-stainless-os","x-stainless-arch","x-stainless-runtime","x-stainless-runtime-version","x-stainless-timeout","x-stainless-retry-count","x-stainless-helper-method","http-referer","referer","sec-ch-ua","sec-ch-ua-mobile","sec-ch-ua-platform","sec-fetch-mode","sec-fetch-site","sec-fetch-dest","priority","accept-encoding"]);var s=c(22067);let t=/restricted from using Gemini Code Assist for individuals in your organization/i,u=[/image/i,/imagen/i];function v(a){return!!a&&u.some(b=>b.test(a))}class w extends f.Hv{constructor(){super("antigravity",g.xq.antigravity)}buildUrl(a,b,c=0){let d=this.getBaseUrls(),e=d[c]||d[0],f=v(a);return`${e}/v1internal:${b&&!f?"streamGenerateContent?alt=sse":"generateContent"}`}buildHeaders(a,b=!0,c=null,d=null){return{"Content-Type":"application/json",Authorization:`Bearer ${a.accessToken}`,"User-Agent":(0,h.rJ)(d)}}transformRequest(a,b,c,d){let e=d?.projectId||d?.providerSpecificData?.projectId||this.generateProjectId();if(v(a)){let c=function(a){let b={aspectRatio:"1:1"},c=String(a).match(/(\d+)x(\d+)$/);if(c){let a=parseInt(c[1]),d=parseInt(c[2]);if(a<=16&&d<=16)b.aspectRatio=`${a}:${d}`;else{let c=(a,b)=>b?c(b,a%b):a,e=c(a,d)||1;b.aspectRatio=`${a/e}:${d/e}`}}return b}(a),f=String(a).replace(/-(\d+)x(\d+)$/,""),g=[];for(let a of b.request?.contents||b.contents||[]){let b=(a.parts||[]).filter(a=>void 0!==a.text||void 0!==a.inlineData);b.length>0&&g.push({role:a.role||"user",parts:b})}let h={contents:g,generationConfig:{temperature:1,topP:.95,topK:40,maxOutputTokens:8192,imageConfig:c},sessionId:b.request?.sessionId||(0,s.a0)(d)};return{project:e,model:f,userAgent:(0,s.Xv)(d),requestType:"image_gen",requestId:(0,s.VC)({body:b,request:h,credentials:d,model:f,requestType:"image_gen"}),request:h}}let f=b.request?.contents?.map(a=>{let b=a.role;a.parts?.some(a=>a.functionResponse)&&(b="user");let c=a.parts?.filter(a=>(!a.thought||!!a.functionCall)&&(!a.thoughtSignature||!!a.functionCall||!!a.text));return b!==a.role||c?.length!==a.parts?.length?{...a,role:b,parts:c}:a}),g=b.request?.tools;if(g&&g.length>0){let a=g.flatMap(a=>(a.functionDeclarations||[]).map(a=>({...a,name:function(a){if(!a)return"_unknown";let b=a.replace(/[^a-zA-Z0-9_.:\-]/g,"_");return/^[a-zA-Z_]/.test(b)||(b="_"+b),b.substring(0,64)}(a.name),parameters:a.parameters?(0,l.Yr)(structuredClone(a.parameters)):{type:"object",properties:{reason:{type:"string",description:"Brief explanation"}},required:["reason"]}})));g=a.length>0?[{functionDeclarations:a}]:[]}let{tools:h,toolConfig:i,...j}=b.request||{},k={...j.generationConfig||{}};k.maxOutputTokens>64e3&&(k.maxOutputTokens=64e3);let m={...j,generationConfig:k,...f&&{contents:f},...g&&{tools:g},sessionId:b.request?.sessionId||(0,s.a0)(d),safetySettings:void 0,...g?.length>0&&{toolConfig:i?.functionCallingConfig?i:{functionCallingConfig:{mode:"VALIDATED"}}}};return{...b,project:e,model:a,userAgent:(0,s.Xv)(d),requestType:"agent",requestId:(0,s.VC)({body:b,request:m,credentials:d,model:a,requestType:"agent"}),request:m}}async refreshCredentials(a,b,c=null){if(!a.refreshToken)return null;try{let d=await (0,j.proxyAwareFetch)(h.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.refreshToken,client_id:this.config.clientId,client_secret:this.config.clientSecret})},c);if(!d.ok)return await (0,k.aI)(d),null;let e=await d.json();return b?.info?.("TOKEN","Antigravity refreshed"),{accessToken:e.access_token,refreshToken:e.refresh_token||a.refreshToken,expiresIn:e.expires_in,projectId:a.projectId}}catch(a){return b?.error?.("TOKEN",`Antigravity refresh error: ${a.message}`),null}}generateProjectId(){let a=["useful","bright","swift","calm","bold"][Math.floor(5*Math.random())],b=["fuze","wave","spark","flow","core"][Math.floor(5*Math.random())];return`${a}-${b}-${e().randomUUID().slice(0,5)}`}generateSessionId(){return e().randomUUID()+Date.now().toString()}parseRetryHeaders(a){if(!a?.get)return null;let b=a.get("retry-after");if(b){let a=parseInt(b,10);if(!isNaN(a)&&a>0)return 1e3*a;let c=new Date(b);if(!isNaN(c.getTime())){let a=c.getTime()-Date.now();return a>0?a:null}}let c=a.get("x-ratelimit-reset-after");if(c){let a=parseInt(c,10);if(!isNaN(a)&&a>0)return 1e3*a}let d=a.get("x-ratelimit-reset");if(d){let a=1e3*parseInt(d,10)-Date.now();return a>0?a:null}return null}parseRetryFromErrorMessage(a){if(!a||"string"!=typeof a)return null;let b=a.match(/reset(?:s)?(?: after| in)?\s*:?\s*(\d+h)?(\d+m)?(\d+(?:\.\d+)?s)?/i);if(!b||!b[1]&&!b[2]&&!b[3])return null;let c=0;return b[1]&&(c+=3600*parseInt(b[1])*1e3),b[2]&&(c+=60*parseInt(b[2])*1e3),b[3]&&(c+=Math.round(1e3*parseFloat(b[3]))),c>0?c:null}parseError(a,b){if(a.status===i.gx.FORBIDDEN&&t.test(b||"")){let a=b;try{let c=JSON.parse(b);a=c?.error?.message||c?.message||b}catch{}return{status:i.gx.FORBIDDEN,message:a,failureClass:"policy_suspended",providerErrorCode:"ORG_CODE_ASSIST_RESTRICTED",refreshRecommended:!1}}if(a.status===i.gx.RATE_LIMITED&&b)try{let a=JSON.parse(b),c=a?.error,d=Array.isArray(c?.details)?c.details:[],e=Date.now(),f=null;for(let a of d){let b=a?.metadata;if(b?.quotaResetTimeStamp){let a=Date.parse(b.quotaResetTimeStamp);if(!Number.isNaN(a)&&a>e){f=a;break}}let c=function(a){if("string"!=typeof a)return null;let b=a.trim();if(!b)return null;if(b.endsWith("ms")){let a=parseFloat(b.slice(0,-2));return Number.isFinite(a)?a:null}let c=b.match(/^(?:(\d+(?:\.\d+)?)h)?(?:(\d+(?:\.\d+)?)m)?(?:(\d+(?:\.\d+)?)s)?$/);if(c&&(c[1]||c[2]||c[3])){let a=parseFloat(c[1]||"0"),b=parseFloat(c[2]||"0");return Math.round((3600*a+60*b+parseFloat(c[3]||"0"))*1e3)}return null}(b?.quotaResetDelay||a?.retryDelay);if(null!==c&&c>0){let a=e+c;(!f||a>f)&&(f=a)}}if(f)return{status:429,message:c?.message||b,resetsAtMs:f}}catch{}return super.parseError(a,b)}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:f,proxyOptions:g=null}){let h=this.getFallbackCount(),l=null,s=0,t={},u={},v=!1,w=!1;for(let x=0;x<h;x++){let y=this.buildUrl(a,c,x),z=this.transformRequest(a,b,c,d);w&&z.request&&(z.enabledCreditTypes=["GOOGLE_ONE_AI"]),z=function(a){if(null==a||"object"!=typeof a)return a;try{let{value:b}=function a(b){if("string"==typeof b){let a=function(a){if(!a||0===m.length)return a;let b=a;for(let a of m){if(!a)continue;let c=function(a){let b=n.get(a);return b||(n.size>2e3&&n.clear(),b=RegExp(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi"),n.set(a,b)),b}(a);b=b.replace(c,a=>a.length<=1?a:a[0]+"‍"+a.slice(1))}return b}(b);return{value:a,changed:a!==b}}if(Array.isArray(b)){let c=!1,d=b.map(b=>{let d=a(b);return d.changed&&(c=!0),d.value});return c?{value:d,changed:!0}:{value:b,changed:!1}}if(b&&"object"==typeof b){let c=!1,d={};for(let[e,f]of Object.entries(b))if(o.has(e)&&f&&"object"==typeof f&&!Array.isArray(f)){let b={},g=!1;for(let[c,d]of Object.entries(f)){let e=a(d);e.changed&&(g=!0),b[c]=e.value}d[e]=g?b:f,g&&(c=!0)}else if("required"===e||"propertyNames"===e)d[e]=f;else if(p.has(e))d[e]=f;else if(q.has(e)||("input"===e?b?.type==="tool_use":"content"===e&&b?.type==="tool_result"))d[e]=f;else{let b=a(f);b.changed&&(c=!0),d[e]=b.value}return c?{value:d,changed:!0}:{value:b,changed:!1}}return{value:b,changed:!1}}(a);return b}catch{return a}}(z);let A=z.request?.sessionId,B=function(a){let b,c={};for(let[d,e]of Object.entries(a||{})){let a=d.toLowerCase();if(!(a.startsWith("x-zevai-")||r.has(a))){if("authorization"===a){b=e;continue}c[d]=e}}return void 0!==b&&(c.Authorization=b),c}(this.buildHeaders(d,c,A,a));t[x]||(t[x]=0),u[x]||(u[x]=0);try{let a=await (0,j.proxyAwareFetch)(y,{method:"POST",headers:B,body:JSON.stringify(z),signal:e},g);if(a.status===i.gx.RATE_LIMITED||a.status===i.gx.SERVICE_UNAVAILABLE){if(a.status===i.gx.RATE_LIMITED&&!1===this.config.retrySameCredential429)return{response:a,url:y,headers:B,transformedBody:z};let b=this.parseRetryHeaders(a.headers),c="";if(!b)try{let d=await a.clone().text(),e=JSON.parse(d);c=e?.error?.message||e?.message||"",b=this.parseRetryFromErrorMessage(c)}catch(a){}if(a.status===i.gx.RATE_LIMITED&&!v&&/quota[_ ]?exhausted|quota reached|individual quota|enable overages/i.test(c)){v=!0,w=!0,f?.debug?.("RETRY","429 quota exhausted → retrying once with GOOGLE_ONE_AI credits"),await (0,k.aI)(a),x--;continue}if(a.status===i.gx.RATE_LIMITED&&/quota[_ ]?exhausted|quota reached|individual quota|enable overages/i.test(c)&&(!b||b>1e4))return f?.debug?.("RETRY",`429 quota exhausted${b?` (resets in ${Math.ceil(b/36e5)}h)`:""} — skipping futile retries, moving to next account`),s=a.status,{response:a,url:y,headers:B,transformedBody:z};if(b&&b<=1e4&&u[x]<3){u[x]++,f?.debug?.("RETRY",`${a.status} with Retry-After: ${Math.ceil(b/1e3)}s, waiting... (${u[x]}/3)`),await (0,k.aI)(a),await new Promise(a=>setTimeout(a,b)),x--;continue}if(a.status===i.gx.RATE_LIMITED&&(!b||0===b)&&t[x]<3){t[x]++;let b=Math.min(1e3*2**t[x],1e4);f?.debug?.("RETRY",`429 auto retry ${t[x]}/3 after ${b/1e3}s`),await (0,k.aI)(a),await new Promise(a=>setTimeout(a,b)),x--;continue}if(f?.debug?.("RETRY",`${a.status}, Retry-After ${b?`too long (${Math.ceil(b/1e3)}s)`:"missing"}, trying fallback`),s=a.status,x+1<h){await (0,k.aI)(a);continue}}if(this.shouldRetry(a.status,x)){f?.debug?.("RETRY",`${a.status} on ${y}, trying fallback ${x+1}`),s=a.status,await (0,k.aI)(a);continue}return{response:a,url:y,headers:B,transformedBody:z}}catch(a){if(l=a,x+1<h){f?.debug?.("RETRY",`Error on ${y}, trying fallback ${x+1}`);continue}throw a}}throw l||Error(`All ${h} URLs failed with status ${s}`)}}},91358:(a,b,c)=>{"use strict";c.d(b,{K:()=>e});var d=c(66678);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}}},91492:(a,b,c)=>{"use strict";c.d(b,{A:()=>u});var d=c(69384),e=c(42541),f=c(56294),g=c(15822),h=c(42671),i=c(70884),j=c(41222),k=c(28113),l=c(56248),m=c(98151);let n="Anthropic",o="OpenAi",p="Google";function q(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"XAi";let d=String(b||"").toLowerCase();return d.includes("claude")?n:d.includes("gemini")?p:d.includes("grok")||d.includes("xai")?"XAi":o}function r(a,b,c){return a===n?(0,j.claudeToOpenAIResponse)(b,c):a===p?(0,k.geminiToOpenAIResponse)(b,c):a===o?(0,l.openaiResponsesToOpenAIResponse)(b,c):b}function s(a,b,c){if(c)for(let d of Array.isArray(c)?c:[c])d&&a.enqueue(b.encode(`data: ${JSON.stringify(d)}
445
451
 
446
452
  `))}class t extends d.Hv{constructor(){super("zed")}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:q(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:q(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),t=q===n?(0,g.openaiToClaudeRequest)(a,b,!0):q===p?(0,h.openaiToGeminiRequest)(a,b,!0):q===o?(0,i.openaiToOpenAIResponsesRequest)(a,b,!0,d):{...b||{},model:a,stream:!1!==c},u=b||{},v={thread_id:u.thread_id||d?._clientSessionId,prompt_id:u.prompt_id,provider:q,model:a,provider_request:t},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":"9router/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||(s(a,g,r(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");s(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}s(d,g,r(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 u=t},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(24081),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)
447
453
  VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
@@ -457,10 +463,8 @@ data: ${JSON.stringify(a)}
457
463
 
458
464
  `:`data: ${JSON.stringify(a)}
459
465
 
460
- `}},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"]}},93745:(a,b,c)=>{"use strict";c.d(b,{E9:()=>r,RF:()=>i,YC:()=>q,oV:()=>p});var d=c(55511),e=c.n(d),f=c(8735);let g=new Map,h=setInterval(()=>{let a=Date.now();for(let[b,c]of g)a-c.lastUsed>f.v1.sessionTtlMs&&g.delete(b)},f.v1.sessionCleanupIntervalMs);function i(a){if(!a)return j();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=j();return g.set(a,{sessionId:c,lastUsed:Date.now()}),c}function j(){return e().randomUUID()+Date.now().toString()}h.unref&&h.unref();let k=new Map,l=["x-session-id","session-id","session_id","x-amp-thread-id","x-client-request-id"],m=/_session_([a-f0-9-]+)$/;function n(a){if("string"!=typeof a)return null;let b=a.trim();return!b||b.length>256?null:b}let o=/^[a-z]+\/([0-9a-f-]{36})\//i;function p({headers:a,body:b,connectionId:c,workspaceId:d,scope:f=""}={}){let g=function(a,b){let c=function(a){if("string"!=typeof a||!a)return null;let b=a.match(m);if(b)return b[1];if("{"===a[0])try{return n(JSON.parse(a)?.session_id)}catch{}return null}(b?.metadata?.user_id);if(c)return`claude:${c}`;let d=function(a){let b=a?.request?.sessionId;if(null!=b&&""!==b)return n(String(b));let c="string"==typeof a?.requestId?a.requestId.match(o):null;return c?n(c[1]):null}(b);if(d)return`antigravity:${d}`;for(let b of l){let c=a&&"object"==typeof a?n(a[b]??a[b.toLowerCase()]):null;if(c)return c}return n(b?.prompt_cache_key)||n(b?.session_id)||n(b?.conversation_id)||n(b?.metadata?.user_id)||null}(a,b);if(g)return g;let h=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=k.get(f);if(g)return g.lastUsed=Date.now(),g.sessionId;k.size>=5e3&&k.delete(k.keys().next().value);let h=j();return k.set(f,{sessionId:h,lastUsed:Date.now()}),h}(`${f}:${c||""}`,b);if(h)return h;let q=n(d);return q||i(c)}function q(a,b,c,d=""){return p({headers:b?.rawHeaders,body:a,connectionId:c,scope:d})}function r(a){let b=n(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 s=setInterval(()=>{let a=Date.now();for(let[b,c]of k)a-c.lastUsed>f.v1.sessionTtlMs&&k.delete(b)},f.v1.sessionCleanupIntervalMs);s.unref&&s.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.r(b),c.d(b,{claudeToOpenAIRequest:()=>h});var d=c(56294),e=c(42541),f=c(58455),g=c(18831);function h(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":"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(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};if(Array.isArray(a.content)){let c=[],d=[],e=[],f=[],g=[];for(let b of a.content)switch(b.type){case"text":c.push({type:"text",text:b.text});break;case"image":{let a=i(b.source);a&&c.push(a)}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=>i(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):
461
- ${a}`),e.push({role:"tool",tool_call_id:b.tool_use_id,content:a})}}let h=g.join("\n");if(e.length>0){let a=[...c,...f],b=[...e];if(a.length>0){let c=1===a.length&&"text"===a[0].type?a[0].text:a;b.push({role:"user",content:c})}return d.length>0&&b.push(j(d,[],h)),b}if(d.length>0)return j(d,c,h);if(c.length>0||h){let a={role:b,...c.length>0&&{content:1===c.length&&"text"===c[0].type?c[0].text:c}};return"assistant"===b&&h&&(a.reasoning_content=h),a}if(0===a.content.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 i(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 j(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,h,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")}}}},94084:(a,b,c)=>{"use strict";c.d(b,{Yh:()=>r});var d=c(69384),e=c(30395),f=c(46956),g=c(11484),h=c(55511),i=c(21820),j=c.n(i);let k=e.xq["mimo-free"]?.baseUrl||"https://api.xiaomimimo.com/api/free-ai/openai/chat",l="abcdefghijklmnopqrstuvwxyz0123456789",m=["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36","Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"],n="You are MiMoCode, an interactive CLI tool that helps users with software engineering tasks.",o=null,p=0;async function q(a=null){if(o&&Date.now()<p-3e5)return o;let b=await (0,f.proxyAwareFetch)("https://api.xiaomimimo.com/api/free-ai/bootstrap",{method:"POST",headers:{"Content-Type":"application/json","User-Agent":m[Math.floor(Math.random()*m.length)]},body:JSON.stringify({client:function(){let a="unknown-user";try{a=j().userInfo().username}catch{}let b=(j().cpus()[0]?.model||"unknown-cpu").trim(),c=`${j().hostname()}|${j().platform()}|${j().arch()}|${b}|${a}`;return(0,h.createHash)("sha256").update(c).digest("hex")}()})},a);if(!b.ok)throw Error(`MiMo bootstrap failed: ${b.status}`);let c=await b.json();if(!c.jwt)throw Error("MiMo bootstrap returned no JWT");return o=c.jwt,p=function(a){try{let b=JSON.parse(Buffer.from(a.split(".")[1],"base64").toString());if(b.exp)return 1e3*b.exp}catch{}return Date.now()+3e6}(c.jwt),o}class r extends d.Hv{constructor(){super("mimo-free",e.xq["mimo-free"]),this.sessionId=function(){let a="ses_";for(let b=0;b<24;b++)a+=l[Math.floor(Math.random()*l.length)];return a}()}buildUrl(){return k}buildHeaders(a,b=!0){return{"Content-Type":"application/json","X-Mimo-Source":"mimocode-cli-free","User-Agent":m[Math.floor(Math.random()*m.length)],"x-session-affinity":this.sessionId,Accept:b?"text/event-stream":"application/json"}}transformRequest(a,b){let c;return!Array.isArray(c=b?.messages)||c.some(a=>a?.role==="system"&&"string"==typeof a.content&&a.content.includes(n))?b:{...b,messages:[{role:"system",content:n},...c]}}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:h,proxyOptions:i=null}){let j;try{j=await q(i)}catch(a){throw h?.error?.("AUTH",`MiMo bootstrap failed: ${a.message}`),a}let k=this.buildUrl(),l=this.transformRequest(a,b),m={...this.buildHeaders(d,c),Authorization:`Bearer ${j}`},n=JSON.stringify(l);h?.debug?.("FETCH",`MIMO-FREE → ${k} | body=${n.length}B`);let r=await (0,f.proxyAwareFetch)(k,{method:"POST",headers:m,body:n,signal:e},i);return 401===r.status||403===r.status?(h?.debug?.("AUTH",`MiMo auth failed (${r.status}), re-bootstrapping...`),await (0,g.aI)(r),o=null,p=0,j=await q(i),m.Authorization=`Bearer ${j}`,{response:await (0,f.proxyAwareFetch)(k,{method:"POST",headers:m,body:n,signal:e},i),url:k,headers:m,transformedBody:l}):{response:r,url:k,headers:m,transformedBody:l}}}},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),{hashId:m,isUrlExcludedFactory:n,normalizeHeaders:o,createHeaderFilters:p}=c(47800);function q(a,b,c={}){var d,e,f;let g=new URL(a.path,a.origin),h=a._normalizedHeaders||o(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:r(h,b,c),body:(d=a.body,e=c.matchBody,f=c.normalizeBody,!1===e?"":f?String(f(d)??""):d?String(d):"")}}function r(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))&&(e[a]=c)}return e}function s(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)||(e[a]=c)}return e}function t(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),m(b.join("|"))}class u{#bM;#bN;#bO=new Map;#bP;#bQ=1/0;#bR=!1;#bS;constructor(a={}){this.#bP=a.snapshotPath,this.#bQ=a.maxSnapshots||1/0,this.#bR=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.#bS=p(this.matchOptions),this.shouldRecord=a.shouldRecord||(()=>!0),this.shouldPlayback=a.shouldPlayback||(()=>!0),this.#bN=n(a.excludeUrls),this.#bR&&this.#bP&&this.#bT()}async record(a,b){if(!this.shouldRecord(a)||this.isUrlExcluded(a))return;let c=q(a,this.#bS,this.matchOptions),d=t(c),e=o(b.headers),f={statusCode:b.statusCode,headers:s(e,this.#bS,this.matchOptions),body:Buffer.isBuffer(b.body)?b.body.toString("base64"):Buffer.from(String(b.body||"")).toString("base64"),trailers:b.trailers};if(this.#bO.size>=this.#bQ&&!this.#bO.has(d)){let a=this.#bO.keys().next().value;this.#bO.delete(a)}let g=this.#bO.get(d);g&&g.responses?(g.responses.push(f),g.timestamp=new Date().toISOString()):this.#bO.set(d,{request:c,responses:[f],callCount:0,timestamp:new Date().toISOString()}),this.#bR&&this.#bP&&this.#bU()}isUrlExcluded(a){let b=new URL(a.path,a.origin).toString();return this.#bN(b)}findSnapshot(a){if(!this.shouldPlayback(a)||this.isUrlExcluded(a))return;let b=t(q(a,this.#bS,this.matchOptions)),c=this.#bO.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.#bP;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.#bO.clear(),c))this.#bO.set(a,b);else this.#bO=new Map(Object.entries(c))}catch(a){if("ENOENT"===a.code)this.#bO.clear();else throw new l(`Failed to load snapshots from ${b}`,{cause:a})}}async saveSnapshots(a){let b=a||this.#bP;if(!b)throw new k("Snapshot path is required");let c=h(b);await f(g(c),{recursive:!0});let e=Array.from(this.#bO.entries()).map(([a,b])=>({hash:a,snapshot:b}));await d(c,JSON.stringify(e,null,2),{flush:!0})}clear(){this.#bO.clear()}getSnapshots(){return Array.from(this.#bO.values())}size(){return this.#bO.size}resetCallCounts(){for(let a of this.#bO.values())a.callCount=0}deleteSnapshot(a){let b=t(q(a,this.#bS,this.matchOptions));return this.#bO.delete(b)}getSnapshotInfo(a){let b=t(q(a,this.#bS,this.matchOptions)),c=this.#bO.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.#bO.clear(),Array.isArray(a))for(let{hash:b,snapshot:c}of a)this.#bO.set(b,c);else a&&"object"==typeof a&&(this.#bO=new Map(Object.entries(a)))}#bT(){return this.#bU()}#bV(){this.#bM&&(j(this.#bM),this.saveSnapshots().catch(()=>{}),this.#bM=null)}#bU(){this.#bM=i(()=>{this.saveSnapshots().catch(()=>{}),this.#bR?this.#bM?.refresh():this.#bM=null},1e3)}destroy(){this.#bV(),this.#bM&&(j(this.#bM),this.#bM=null)}async close(){this.#bP&&0!==this.#bO.size&&await this.saveSnapshots(),this.destroy()}}a.exports={SnapshotRecorder:u,formatRequestKey:q,createRequestHash:t,filterHeadersForMatching:r,filterHeadersForStorage:s,createHeaderFilters:p}},94414:(a,b,c)=>{"use strict";c.d(b,{L4:()=>o,jS:()=>i});var d=c(55511),e=c.n(d),f=c(8735);let g=new Map;function h(a){return null==a?a:JSON.parse(JSON.stringify(a))}function i(a,b){let c=`${a||"anon"}:${String(b||"").slice(0,4096)}`,d=e().createHash("sha256").update(c).digest("hex");return[d.slice(0,8),d.slice(8,12),`4${d.slice(13,16)}`,`8${d.slice(17,20)}`,d.slice(20,32)].join("-")}function j(a,b){return a?.userInputMessage&&!a.userInputMessage.modelId&&b&&(a.userInputMessage.modelId=b),a}function k(a,b){for(let c of a||[])j(c,b);return a}function l(a,b,c){let d=h(a)||{userInputMessage:{content:""}};if(d.userInputMessage||(d.userInputMessage={content:""}),j(d,c),b){let a=d.userInputMessage.content||"";d.userInputMessage.content=a?`${b}
462
-
463
- ${a}`:b}return d}function m(a){return a.findIndex(a=>a?.userInputMessage)}function n(a,b){var c;return 0===b&&(c=a[b],!c?.userInputMessage?.userInputMessageContext?.toolResults?.length)}function o({conversationId:a,connectionId:b,modelId:c,systemPrompt:d="",contentPrefix:e="",currentContentPrefix:f="",history:i=[],currentMessage:p}={}){var q;let r,s=`${b||""}:${a||""}`,t=a?g.get(s):null,u=h(i)||[],v=h(p)||{userInputMessage:{content:""}};if(t&&t.modelId===c&&t.systemPrompt===d){t.lastUsed=Date.now();let a=m(u),b=j(h(t.sessionStart),c);return n(u,a)?u[a]=b:(u.unshift(b),1===u.length&&u.push({assistantResponseMessage:{content:"..."}})),{history:k(u,c),currentMessage:l(v,f,c),replayed:!0}}let w=m(u),x=j(v,c);return n(u,w)?(r=l(u[w],e,c),u[w]=h(r),x=l(v,f,c)):w>=0?(r=l({userInputMessage:{content:"",modelId:c}},e,c),u.unshift(h(r)),x=l(v,f,c)):x=h(r=l(v,e,c)),a&&(q={sessionStart:h(r),modelId:c,systemPrompt:d},g.size>=5e3&&g.delete(g.keys().next().value),g.set(s,{...q,lastUsed:Date.now()})),{history:k(u,c),currentMessage:x,replayed:!1}}let p=setInterval(()=>{let a=Date.now();for(let[b,c]of g)a-c.lastUsed>f.v1.sessionTtlMs&&g.delete(b)},f.v1.sessionCleanupIntervalMs);p.unref&&p.unref()},94479:(a,b,c)=>{"use strict";c.d(b,{my:()=>G});var d=c(48991),e=c(46956);async function f(a){try{await a?.body?.cancel?.()}catch{}}async function g(a,b={}){let c=b.fetchImpl||fetch;if("string"!=typeof a||!a.trim())return null;try{let d,e=await c("https://api.blackbox.ai/key/info",{method:"GET",headers:(d={Accept:"application/json","Content-Type":"application/json"},"string"==typeof a&&a.trim()&&(d.Authorization=`Bearer ${a.trim()}`),d),signal:function(a={}){return a.signal?a.signal:AbortSignal.timeout(a.timeoutMs||8e3)}(b)});if(!e.ok)return await f(e),null;let g=await e.json();return g?.info||g||null}catch{return null}}async function h(a,b={}){let c=await g(a,b);if(!c)return{plan:"Blackbox API",message:"Blackbox spend data is unavailable for this key.",quotas:{},trackingMode:"unavailable"};let d=Number(c.spend),e=Number(c.max_budget),f=Number.isFinite(d)&&d>=0?d:0,i=Number.isFinite(e)&&e>0,j=i?e:0,k=i?Math.max(0,j-f):null,l=i?Math.max(0,Math.min(100,k/j*100)):100;return{plan:"Blackbox API",quotas:{Spend:{used:f,total:j,...null==k?{}:{remaining:k},remainingPercentage:l,unlimited:!1,unit:"USD",resetAt:c.budget_reset_at||c.expires||null,displayName:i?"API Budget":"API Spend"}},trackingMode:"upstream",spend:f,maxBudget:i?e:null}}function i(a,b=0){let c="string"==typeof a&&a.trim()?Number(a):a;return Number.isFinite(c)?c:b}function j(a,b){return{plan:a,quotas:{Credits:{used:1,total:1,remaining:0,remainingPercentage:0,resetAt:null,unlimited:!1}},authoritative:!0,limitReached:!0,message:b}}function k(a){let b=Error(a);return b.name="AbortError",b.code="USAGE_REQUEST_ABORTED",b}async function l(a,b={}){let c,d=new AbortController,e=b.parentSignal,f=Number.isFinite(b.timeoutMs)&&b.timeoutMs>0?b.timeoutMs:15e3,g=new Promise((a,b)=>{c=b}),h=a=>{let b=a instanceof Error?a:k("Usage request aborted");d.signal.aborted||d.abort(b),c(b)},i=()=>h(e.reason);e?.aborted?h(e.reason):e?.addEventListener("abort",i,{once:!0});let j=setTimeout(()=>h(k(`Usage request timed out after ${f}ms`)),f);j.unref?.();try{return await Promise.race([Promise.resolve().then(()=>a(d.signal)),g])}finally{clearTimeout(j),e?.removeEventListener("abort",i)}}function m(a){let b=Math.round(100*Math.max(0,Math.min(1,Number(a)||0))),c=100-b;return{used:b,total:100,remaining:c,remainingPercentage:c,resetAt:null,unlimited:!1}}function n(){return{quotaFetchFailed:!0,message:"Ollama Cloud usage temporarily unavailable."}}async function o(a,b=null){let c=a?.apiKey||a?.accessToken;if(!c)return{message:"Ollama Cloud API key not available."};let d={Authorization:`Bearer ${c}`,Accept:"application/json"};try{return await l(async a=>{let c=await (0,e.proxyAwareFetch)("https://ollama.com/api/usage",{method:"GET",headers:d,signal:a},b);if(401===c.status||403===c.status)return{authError:!0,accountDead:!0,message:"Ollama Cloud API key invalid or expired."};if(402===c.status||429===c.status)return j("Ollama Cloud","Ollama Cloud credits are exhausted.");if(!c.ok)return n();let f=await c.json().catch(()=>null);if(!f||"object"!=typeof f)return n();let g=await (0,e.proxyAwareFetch)("https://ollama.com/api/me",{method:"POST",headers:{...d,"Content-Length":"0"},signal:a},b).then(a=>a.ok?a.json():null).catch(b=>{if(a.aborted)throw b;return null}),h="string"==typeof g?.Plan?g.Plan.trim():"",i=h?h.charAt(0).toUpperCase()+h.slice(1).toLowerCase():"Ollama Cloud",k=f.limits&&"object"==typeof f.limits?f.limits:{},l={};return(Number.isFinite(Number(k.session?.usage))&&(l["Session (5h)"]=m(k.session.usage)),Number.isFinite(Number(k.weekly?.usage))&&(l["Weekly (7d)"]=m(k.weekly.usage)),0===Object.keys(l).length)?{plan:i,quotas:l,authoritative:!0,message:"Ollama Cloud connected. No usage limits reported."}:{plan:i,quotas:l,authoritative:!0}},{parentSignal:b?.signal})}catch{return n()}}let p={LEVEL_BASIC:"Moderato",LEVEL_INTERMEDIATE:"Allegretto",LEVEL_ADVANCED:"Allegro",LEVEL_STANDARD:"Vivace"};function q(){return{quotaFetchFailed:!0,message:"Kimi usage temporarily unavailable."}}function r(a,b,c,d){let e=Math.max(0,i(b)),f=Math.max(0,i(a)),g=Math.max(0,i(c,e-f));return{used:f,total:e,remaining:g,remainingPercentage:e>0?Math.min(100,g/e*100):0,resetAt:function(a){if(null==a||""===a)return null;try{if(a instanceof Date)return a.toISOString();if("number"==typeof a||/^\d+$/.test(String(a))){let b=Number(a);return new Date(b<1e12?1e3*b:b).toISOString()}return new Date(a).toISOString()}catch{return null}}(d),unlimited:!1}}async function s(a,b=null){let c="string"==typeof a?.apiKey?a.apiKey.trim():"",f="string"==typeof a?.accessToken?a.accessToken.trim():"";if(!c&&!f)return{message:"Kimi access token or API key not available."};let g=c?{"x-api-key":c}:{Authorization:`Bearer ${f}`,...(0,d.VK)(a?.providerSpecificData?.deviceId)};try{return await l(async a=>{let c,d=await (0,e.proxyAwareFetch)("https://api.kimi.com/coding/v1/usages",{method:"GET",headers:{...g,Accept:"application/json","Content-Type":"application/json"},signal:a},b),f=await d.text().catch(()=>"");if(401===d.status)return{authError:!0,accountDead:!0,message:"Kimi authentication expired. Please re-authorize."};if(403===d.status)return{plan:"Kimi Coding",quotaFetchFailed:!0,usageUnavailable:!0,message:"Kimi connected, but this account has no permission to view usage."};if(402===d.status||429===d.status)return j("Kimi Coding","Kimi credits are exhausted.");if(!d.ok)return q();try{c=JSON.parse(f||"{}")}catch{return q()}let h={},k=c.usage&&"object"==typeof c.usage?c.usage:{},l=i(k.limit??k.Limit);l>0&&(h.Weekly=r(k.used??k.Used,l,k.remaining??k.Remaining,k.resetTime??k.ResetTime??k.reset_at??k.resetAt));let m=(Array.isArray(c.limits)?c.limits:[]).filter(a=>{let b=a?.detail&&"object"==typeof a.detail?a.detail:{};return i(b.limit??b.Limit)>0}),n=new Set;for(let[a,b]of m.entries()){let c=b?.detail&&"object"==typeof b.detail?b.detail:{},d=i(c.limit??c.Limit),e=i(c.remaining??c.Remaining,d);h[function(a,b,c,d){if(1===c)return"Ratelimit";let e=a?.name??a?.type??a?.window??a?.detail?.name??a?.detail?.type??a?.detail?.window,f="string"==typeof e?e.replace(/[^a-zA-Z0-9._ -]/g," ").replace(/\s+/g," ").trim().slice(0,48):"",g=f?`Ratelimit (${f})`:`Ratelimit ${b+1}`,h=g,i=2;for(;d.has(h);)h=`${g} ${i++}`;return d.add(h),h}(b,a,m.length,n)]=r(Math.max(0,d-e),d,e,c.resetTime??c.reset_at??c.resetAt)}let o=c.user?.membership?.level;return{plan:p[o]||(o?String(o).replace(/^LEVEL_/,"").toLowerCase():"Kimi Coding"),quotas:h,authoritative:!0,...0===Object.keys(h).length?{message:"Kimi connected. No usage limits reported."}:{}}},{parentSignal:b?.signal})}catch{return q()}}function t(){return{quotaFetchFailed:!0,message:"DeepSeek balance temporarily unavailable."}}async function u(a,b=null){let c="string"==typeof a?.apiKey?a.apiKey.trim():"";if(!c)return{message:"DeepSeek API key not available. Add a key to view usage."};try{return await l(async a=>{let d=await (0,e.proxyAwareFetch)("https://api.deepseek.com/user/balance",{method:"GET",headers:{Authorization:`Bearer ${c}`,Accept:"application/json","Content-Type":"application/json"},signal:a},b);if(401===d.status||403===d.status)return{authError:!0,accountDead:!0,message:"DeepSeek authentication failed. Check the API key."};if(402===d.status||429===d.status)return j("DeepSeek","DeepSeek balance is exhausted.");if(!d.ok)return t();let f=await d.json().catch(()=>null);if(!f||"object"!=typeof f)return t();let g={};for(let a of Array.isArray(f.balance_infos)?f.balance_infos:[]){if(!a||"object"!=typeof a)continue;let b="string"==typeof a.currency?a.currency.trim().toUpperCase():"";if(!b)continue;let c=Math.max(0,i(a.total_balance??a.totalBalance));g[`Balance (${b})`]={used:0,total:c,remaining:c,remainingPercentage:100*(c>0),resetAt:null,unlimited:!1,unit:b,grantedBalance:Math.max(0,i(a.granted_balance??a.grantedBalance)),toppedUpBalance:Math.max(0,i(a.topped_up_balance??a.toppedUpBalance))}}if(0===Object.keys(g).length)return{plan:"DeepSeek",quotas:g,authoritative:!0,message:"DeepSeek connected. No balance data returned."};let h=!0===f.is_available||!0===f.isAvailable;return{plan:h?"DeepSeek":"DeepSeek (Insufficient Balance)",quotas:g,authoritative:!0,limitReached:!h}},{parentSignal:b?.signal})}catch{return t()}}var v=c(32185),w=c(76394);function x(a,b){let c=Math.max(0,Number(a?.total)||0),d=Math.max(0,Number(a?.used)||0),e=Math.max(0,Number(a?.remaining)||0);return{total:c,used:d,remaining:e,remainingPercentage:c>0?Math.min(100,e/c*100):0,unit:a?.unit||"credits",resetAt:b,unlimited:!1}}function y(){return{quotaFetchFailed:!0,message:"Qoder usage temporarily unavailable."}}async function z(a,b=null){try{return await l(async c=>{let d;try{d=await (0,w.iC)(a,{proxyOptions:b,signal:c})}catch(a){if(a?.status===401||a?.status===403)return{authError:!0,accountDead:!0,message:"Qoder PAT was rejected. Add a valid Personal Access Token."};throw a}if(!d?.accessToken)return{message:"Qoder usage unavailable: no access token"};let f=await (0,e.proxyAwareFetch)(v.x_,{method:"GET",headers:{Authorization:`Bearer ${d.accessToken}`,Accept:"application/json"},signal:c},b);if(401===f.status||403===f.status)return{authError:!0,accountDead:!0,message:"Qoder authentication expired. Reconnect this account."};if(!f.ok)return y();let g=await f.json().catch(()=>null);if(!g||"object"!=typeof g)return y();let h=Number(g.expiresAt),i=Number.isFinite(h)&&h>0?new Date(h).toISOString():null,j={user:x(g.userQuota,i)};return Number(g.orgResourcePackage?.total)>0&&(j.organization=x(g.orgResourcePackage,i)),{quotas:j,totalUsagePercentage:Number(g.totalUsagePercentage)||0,isQuotaExceeded:!0===g.isQuotaExceeded,limitReached:!0===g.isQuotaExceeded,expiresAt:Number.isFinite(h)?h:null,authoritative:!0}},{parentSignal:b?.signal})}catch(a){return y()}}let A={international:"https://api.z.ai/api/monitor/usage/quota/limit",china:"https://open.bigmodel.cn/api/monitor/usage/quota/limit"},B={minimax:["https://www.minimax.io/v1/token_plan/remains","https://api.minimax.io/v1/api/openplatform/coding_plan/remains"],"minimax-cn":["https://www.minimaxi.com/v1/api/openplatform/coding_plan/remains","https://api.minimaxi.com/v1/api/openplatform/coding_plan/remains"]},C={quotaApiHosts:["https://daily-cloudcode-pa.googleapis.com","https://cloudcode-pa.googleapis.com","https://daily-cloudcode-pa.sandbox.googleapis.com"],fetchAvailableModelsPath:"/v1internal:fetchAvailableModels",retrieveUserQuotaPath:"/v1internal:retrieveUserQuota",loadProjectApiUrl:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",tokenUrl:"https://oauth2.googleapis.com/token",clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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",userAgent:(0,d.A9)(),quotaUserAgent:(0,d.P0)()},D=["gemini-3.7-flash-high","gemini-3.7-flash-medium","gemini-3.7-flash-low","gemini-3.6-flash-high","gemini-3.6-flash-medium","gemini-3.6-flash-low","gemini-3-flash-agent","gemini-3.5-flash-low","gemini-3.5-flash-extra-low","gemini-pro-agent","gemini-3.1-pro-low","claude-sonnet-4-6","claude-opus-4-6-thinking","gpt-oss-120b-medium","gemini-3-flash"],E="2023-06-01",F={free:"TCACA_code_001_PqouKr6QWV",proMon:"TCACA_code_002_AkiJS3ZHF5",gift:"TCACA_code_006_DbXS0lrypC",activity:"TCACA_code_007_nzdH5h4Nl0",proYear:"TCACA_code_003_FAnt7lcmRT",freeMon:"TCACA_code_008_cfWoLwvjU4",extra:"TCACA_code_009_0XmEQc2xOf"};async function G(a,b=null){let{provider:c,accessToken:d,apiKey:f,providerSpecificData:g,projectId:i}=a,j={...g||{},...i?{projectId:i}:{}};switch(c){case"github":return await N(d,g,b);case"gemini-cli":return await P(d,j,b);case"antigravity":return await T(d,j,b);case"claude":return await W(d,b);case"codex":return await ab(d,b);case"kiro":return await ac(d,g,b);case"codebuddy":case"codebuddy-cn":return await I(d,g,b,f,c);case"qoder":return await z(a,b);case"autoclaw":return await an(d,b,a);case"qwen":return await ad(d,g);case"iflow":return await ae(d);case"ollama":return await o(a,b);case"kimi":case"kimi-coding":return await s(a,b);case"deepseek":return await u(a,b);case"glm":case"glm-cn":return await af(f,c,b);case"minimax":case"minimax-cn":return await am(f,c,b);case"grok-cli":return await ar(d,g,b);case"cloudflare-ai":return await ao(f||d,g,b);case"xai":return await aw(d||f,g,b);case"cline":case"clinepass":return await au(d||f,c,b);case"kimchi":return await av(d||f,g,b);case"blackbox":return await h(f||d,{fetchImpl:(a,c)=>(0,e.proxyAwareFetch)(a,c,b)});case"cursor":return await ax(d,g);default:return{message:`Usage API not implemented for ${c}`}}}async function H(a,b={},c=null,d="codebuddy"){let f=b?.uid||b?.rawAuth?.uid;if(f)return{uid:f,enterpriseId:b?.enterpriseId||null};let g=b?.domain||b?.rawAuth?.domain||("codebuddy-cn"===d?"www.codebuddy.cn":"www.codebuddy.ai");try{let b=await (0,e.proxyAwareFetch)(`https://${g}/v2/plugin/accounts`,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","X-Domain":g}},c);if(!b.ok)return{uid:null,enterpriseId:null};let d=await b.json(),f=d?.data?.accounts||[],h=f.find(a=>a.lastLogin)||f[0]||{};return{uid:h.uid||null,enterpriseId:h.enterpriseId||null}}catch{return{uid:null,enterpriseId:null}}}async function I(a,b={},c=null,d=null,f="codebuddy"){let g=b?.authMode==="generated-api-key",h=a||d,i=a?"oauth":d?"api-key":null;if(!h)return{plan:"CodeBuddy",message:"CodeBuddy upstream quota is unavailable because no valid IDE OAuth token or API key is stored.",quotas:{},trackingMode:"unavailable"};try{let a,j,{uid:k,enterpriseId:l}=await H(h,b,c,f),m=await (0,e.proxyAwareFetch)(function(a={},b="codebuddy"){let c=a?.domain||a?.rawAuth?.domain||("codebuddy-cn"===b?"www.codebuddy.cn":"www.codebuddy.ai");return`https://${c}/v2/billing/meter/get-user-resource`}(b,f),{method:"POST",headers:function(a,b={},c=null,d=null,e=null){let f={Authorization:`Bearer ${a}`,Accept:"application/json, text/plain, */*","Accept-Language":"zh-CN,zh;q=0.9","Content-Type":"application/json","X-Domain":b?.domain||b?.rawAuth?.domain||"www.codebuddy.ai"};return e&&(f["X-Api-Key"]=e),c&&(f["X-User-Id"]=c),d&&(f["X-Enterprise-Id"]=d,f["X-Tenant-Id"]=d),f}(h,b,k,l,d),body:JSON.stringify((a=new Date,(j=new Date(a)).setFullYear(j.getFullYear()+101),{PageNumber:1,PageSize:200,ProductCode:"p_tcaca",Status:[0,3],PackageEndTimeRangeBegin:K(a),PackageEndTimeRangeEnd:K(j)}))},c),n=await m.text(),o=null;try{o=n?JSON.parse(n):null}catch{o=null}if(401===m.status||403===m.status){if("oauth"===i)return{plan:"CodeBuddy",message:`CodeBuddy IDE OAuth token was rejected (${m.status}). Upstream quota is unavailable; use ZevaiRouter Usage for local request and token tracking.`,quotas:{},authMode:"oauth-rejected",trackingMode:"local-router"};return{plan:"CodeBuddy",message:"CodeBuddy chat key active. Upstream quota is unavailable without a valid IDE OAuth token; use ZevaiRouter Usage for local request and token tracking.",quotas:{},authMode:g?"generated-api-key":"api-key",trackingMode:"local-router"}}if(!m.ok){let a=408===m.status||425===m.status||429===m.status||m.status>=500;return{plan:"CodeBuddy",message:`CodeBuddy quota endpoint returned ${m.status}.`,quotas:{},...a?{quotaFetchFailed:!0}:{}}}return{...function(a){let b=a?.data?.Response?.Data||a?.Response?.Data||a?.data||a||{},c=Array.isArray(b?.Accounts)?b.Accounts:Array.isArray(b?.accounts)?b.accounts:[];if(0===c.length)return{plan:"CodeBuddy",message:"CodeBuddy connected. No quota records were returned.",quotas:{}};let d=a=>{let b=J(a.CycleEndTime);return b?new Date(b).getTime():1/0},e=a=>{let b=d(a),c=Number(a.DeductionEndTime);return Number.isFinite(b)&&Number.isFinite(c)&&c-b>1728e5},f=(a,b)=>d(a)-d(b),g=c.filter(e).sort(f),h=c.filter(a=>!e(a)).sort(f),i={},j=!1,k=(a,b,{recurring:c})=>{var d,e;let f=function(a,{useCycle:b=!0}={}){let c=L(a,"Cycle"),d=function(a,b,c){return c?a||b:a&&b?a.precision!==b.precision?a.precision>b.precision?a:b:Math.abs(a.values.total-b.values.total)>=1e-9||Math.abs(a.values.used-b.values.used)>=1e-9||Math.abs(a.values.remaining-b.values.remaining)>=1e-9?a:b:b||a}(c,L(a,""),b);return d?{...d.values,resetAt:J(a.CycleEndTime||a.DeductionEndTime||a.ExpiredTime)}:null}(b,{useCycle:c});f&&((b.PackageCode===F.proMon||b.PackageCode===F.proYear)&&(j=!0),i[a]||(i[a]={used:0,total:0,remaining:0,resetAt:null,unit:"credits",unlimited:!1,recurring:c}),i[a].used+=f.used,i[a].total+=f.total,i[a].remaining+=f.remaining,i[a].resetAt=(d=i[a].resetAt,e=f.resetAt,d?e&&new Date(e).getTime()<new Date(d).getTime()?e:d:e||null),i[a].recurring=i[a].recurring&&c)};for(let a of g)k("Monthly Credits",a,{recurring:!0});for(let a of h)k("Bonus Credits",a,{recurring:!1});if(h.length>0&&i["Bonus Credits"]&&(i["Bonus Credits"].packCount=h.length),0===Object.keys(i).length)for(let a of c){if(!a||"object"!=typeof a)continue;let b=function(a){switch(a){case F.free:case F.freeMon:case F.proMon:case F.proYear:return"Monthly Credits";case F.gift:return"Gift Credits";case F.extra:return"Extra Credits";case F.activity:return"Activity Credits";default:return a?"Other Credits":null}}(a.PackageCode)||"Other Credits",c="Activity Credits"!==b&&"Gift Credits"!==b;k(c?"Monthly Credits":"Bonus Credits",a,{recurring:c})}if(0===Object.keys(i).length)return{plan:j?"Pro":"Free",message:"CodeBuddy connected. Unable to extract quota values.",quotas:{}};for(let a of Object.values(i))a.remainingPercentage=a.total>0?Math.max(0,Math.min(100,a.remaining/a.total*100)):0;return{plan:j?"Pro":"Free",quotas:i}}(o),authMode:i}}catch(a){return{plan:"CodeBuddy",message:`CodeBuddy connected. Unable to fetch quota: ${a.message}`,quotas:{},quotaFetchFailed:!0}}}function J(a){if(!a)return null;try{if(a instanceof Date)return a.toISOString();if("number"==typeof a)return new Date(a<1e12?1e3*a:a).toISOString();if("string"==typeof a){if(/^\d+$/.test(a)){let b=Number(a);return new Date(b<1e12?1e3*b:b).toISOString()}return new Date(a).toISOString()}return null}catch(b){return console.warn(`Failed to parse reset time: ${a}`,b),null}}function K(a){let b=a=>String(a).padStart(2,"0");return`${a.getFullYear()}-${b(a.getMonth()+1)}-${b(a.getDate())} ${b(a.getHours())}:${b(a.getMinutes())}:${b(a.getSeconds())}`}function L(a,b){let c=M(a[`${b}CapacitySizePrecise`]),d=c??M(a[`${b}CapacitySize`]),e=M(a[`${b}CapacityUsedPrecise`]),f=M(a[`${b}CapacityRemainPrecise`]),g=e??(null===f?M(a[`${b}CapacityUsed`]):null),h=f??M(a[`${b}CapacityRemain`]);if(null===d||null===g&&null===h)return null;let i=Math.max(0,d),j=null!==g?Math.min(i,Math.max(0,g)):Math.max(0,i-Math.min(i,Math.max(0,h))),k=Math.max(0,i-j),l=null===h?null:Math.min(i,Math.max(0,h)),m=null!==l&&1e-9>Math.abs(j+l-i)?l:k;return{values:{total:i,used:j,remaining:m},precision:+(null!==c)+2*(null!==e||null!==f)}}function M(...a){for(let b of a){if(null==b||""===b)continue;let a=Number(b);if(Number.isFinite(a))return a}return null}async function N(a,b,c=null){try{if(!a)throw Error("No GitHub access token available. Please re-authorize the connection.");let b=await (0,e.proxyAwareFetch)("https://api.github.com/copilot_internal/user",{headers:{Authorization:`token ${a}`,Accept:"application/json","X-GitHub-Api-Version":"2022-11-28","User-Agent":"GitHubCopilotChat/0.26.7","Editor-Version":"vscode/1.100.0","Editor-Plugin-Version":"copilot-chat/0.26.7"}},c);if(!b.ok){let a=await b.text();throw Error(`GitHub API error: ${a}`)}let d=await b.json();if(d.quota_snapshots){let a=d.quota_snapshots,b=J(d.quota_reset_date);return{plan:d.copilot_plan,resetDate:d.quota_reset_date,quotas:{chat:{...O(a.chat),resetAt:b},completions:{...O(a.completions),resetAt:b},premium_interactions:{...O(a.premium_interactions),resetAt:b}}}}if(d.monthly_quotas||d.limited_user_quotas){let a=d.monthly_quotas||{},b=d.limited_user_quotas||{},c=J(d.limited_user_reset_date);return{plan:d.copilot_plan||d.access_type_sku,resetDate:d.limited_user_reset_date,quotas:{chat:{used:b.chat||0,total:a.chat||0,unlimited:!1,resetAt:c},completions:{used:b.completions||0,total:a.completions||0,unlimited:!1,resetAt:c}}}}return{message:"GitHub Copilot connected. Unable to parse quota data."}}catch(a){throw Error(`Failed to fetch GitHub usage: ${a.message}`)}}function O(a){return a?{used:a.entitlement-a.remaining,total:a.entitlement,remaining:a.remaining,unlimited:a.unlimited||!1}:{used:0,total:0,unlimited:!0}}async function P(a,b,c=null){if(!a)return{plan:"Free",message:"Gemini CLI access token not available."};try{let d,f=Q(b?.projectId),g="Free";if(!f){let b=await R(a,c);f=Q(b?.cloudaicompanionProject),g=b?.currentTier?.name||g}if(!f)return{plan:g,message:"Gemini CLI project ID not available. Reconnect Gemini CLI, or configure a Google Cloud project with Gemini Code Assist access before checking quota."};let h=new AbortController,i=setTimeout(()=>h.abort(),1e4);try{d=await (0,e.proxyAwareFetch)("https://cloudcode-pa.googleapis.com/v1internal:retrieveUserQuota",{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify({project:f}),signal:h.signal},c)}finally{clearTimeout(i)}if(!d.ok)return{plan:g,message:`Gemini CLI quota error (${d.status}).`};let j=await d.json(),k={};if(Array.isArray(j.buckets))for(let a of j.buckets){if(!a.modelId||null==a.remainingFraction)continue;let b=Number(a.remainingFraction)||0,c=Math.round(1e3*b),d=Math.max(0,1e3-c);k[a.modelId]={used:d,total:1e3,resetAt:J(a.resetTime),remainingPercentage:100*b,unlimited:!1}}return{plan:g,quotas:k}}catch(a){return{message:`Gemini CLI error: ${a.message}`}}}function Q(a){return"string"==typeof a?a.trim()||null:a&&"object"==typeof a&&"string"==typeof a.id&&a.id.trim()||null}async function R(a,b=null){let c=new AbortController,f=setTimeout(()=>c.abort(),1e4);try{let f=await (0,e.proxyAwareFetch)("https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify({metadata:d.Cn}),signal:c.signal},b);if(!f.ok)return null;return await f.json()}catch{return null}finally{clearTimeout(f)}}async function S(a,b,c,d){let f=null;for(let g of C.quotaApiHosts){let h=new AbortController,i=setTimeout(()=>h.abort(),1e4);try{let i=await (0,e.proxyAwareFetch)(`${g}${a}`,{method:"POST",headers:{Authorization:`Bearer ${b}`,"User-Agent":C.quotaUserAgent,"Content-Type":"application/json","x-request-source":"local"},body:JSON.stringify(c||{}),signal:h.signal},d);if(i.ok||401===i.status||403===i.status)return{response:i,host:g};f=Error(`Antigravity API error: ${i.status}`)}catch(a){f=a}finally{clearTimeout(i)}}if(f)throw f;throw Error("Antigravity API unavailable")}async function T(a,b,c=null){try{let d,e=Q(b?.projectId),f=await V(a,c),g=e||Q(f?.cloudaicompanionProject);try{d=await S(C.fetchAvailableModelsPath,a,g?{project:g}:{},c)}catch(a){return{message:`Antigravity quota unavailable: ${a.message}. Chat may still work.`}}let h=d.response;if(401===h.status){let a=await U(b,c);if(a)return{accountDead:!0,message:`Antigravity account ${a}. Reconnect won't help \u2014 recreate the account.`,quotas:{}};return{message:"Antigravity quota API authentication expired. Chat may still work.",quotas:{}}}if(403===h.status)return{message:"Antigravity quota API access forbidden (tier may not expose quota). Chat may still work.",quotas:{}};if(!h.ok)throw Error(`Antigravity API error: ${h.status}`);let i=await h.json(),j=new Map;try{let b=await S(C.retrieveUserQuotaPath,a,g?{project:g}:{},c);if(b.response.ok){let a=await b.response.json();if(Array.isArray(a.buckets))for(let b of a.buckets){let a=String(b.modelId||"").trim();a&&j.set(a,b)}}}catch{}let k={};if(i.models)for(let[a,b]of Object.entries(i.models)){if(b.isInternal||!D.includes(a))continue;let c=j.get(a),d=c||b.quotaInfo;if(!d)continue;let e=Number(d.remainingFraction)||0,f=100*e,g=Math.round(1e3*e),h=Math.max(0,1e3-g);k[a]={used:h,total:1e3,resetAt:J(d.resetTime),remainingPercentage:f,unlimited:!1,displayName:b.displayName||a,quotaSource:c?"retrieveUserQuota":"fetchAvailableModels"}}return{plan:f?.currentTier?.name||"Unknown",quotas:k,subscriptionInfo:f}}catch(a){return console.error("[Antigravity Usage] Error:",a.message,a.cause),{message:`Antigravity error: ${a.message}`}}}async function U(a,b=null){let c=a?.refreshToken;if(!c)return null;try{let a,d=new AbortController,f=setTimeout(()=>d.abort(),1e4);try{a=await (0,e.proxyAwareFetch)(C.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:C.clientId,client_secret:C.clientSecret,refresh_token:c,grant_type:"refresh_token"}),signal:d.signal},b)}finally{clearTimeout(f)}if(a.ok)return null;let g=await a.json().catch(()=>({}));if("invalid_grant"===g.error){let a=(g.error_description||"").toLowerCase();if(a.includes("deleted"))return"has been deleted";if(a.includes("disabled")||a.includes("suspend"))return"is disabled/suspended";return"authorization was revoked"}return null}catch{return null}}async function V(a,b=null){let c=new AbortController,f=setTimeout(()=>c.abort(),1e4);try{let f=await (0,e.proxyAwareFetch)(C.loadProjectApiUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,"User-Agent":C.userAgent,"Content-Type":"application/json","x-request-source":"local"},body:JSON.stringify({metadata:d.Cn,mode:1}),signal:c.signal},b);if(!f.ok)return null;return await f.json()}catch(a){return console.error("[Antigravity Subscription] Error:",a.message),null}finally{clearTimeout(f)}}async function W(a,b=null){try{let c=await (0,e.proxyAwareFetch)("https://api.anthropic.com/api/oauth/usage",{method:"GET",headers:{Authorization:`Bearer ${a}`,"anthropic-beta":"oauth-2025-04-20","anthropic-version":E}},b);if(c.ok){let a=await c.json(),b={},d=a=>a&&"object"==typeof a&&"number"==typeof a.utilization,e=a=>{let b=a.utilization,c=Math.max(0,100-b);return{used:b,total:100,remaining:c,remainingPercentage:c,resetAt:J(a.resets_at),unlimited:!1}};for(let[c,f]of(d(a.five_hour)&&(b["session (5h)"]=e(a.five_hour)),d(a.seven_day)&&(b["weekly (7d)"]=e(a.seven_day)),Object.entries(a)))if(c.startsWith("seven_day_")&&"seven_day"!==c&&d(f)){let a=c.replace("seven_day_","");b[`weekly ${a} (7d)`]=e(f)}return{plan:"Claude Code",extraUsage:a.extra_usage??null,quotas:b}}return console.warn(`[Claude Usage] OAuth endpoint returned ${c.status}, falling back to legacy`),await X(a,b)}catch(a){return{message:`Claude connected. Unable to fetch usage: ${a.message}`}}}async function X(a,b=null){try{let c=await (0,e.proxyAwareFetch)("https://api.anthropic.com/v1/settings",{method:"GET",headers:{Authorization:`Bearer ${a}`,"anthropic-version":E}},b);if(c.ok){let d=await c.json();if(d.organization_id){let c=await (0,e.proxyAwareFetch)("https://api.anthropic.com/v1/organizations/{org_id}/usage".replace("{org_id}",d.organization_id),{method:"GET",headers:{Authorization:`Bearer ${a}`,"anthropic-version":E}},b);if(c.ok){let a=await c.json();return{plan:d.plan||"Unknown",organization:d.organization_name,quotas:a}}}return{plan:d.plan||"Unknown",organization:d.organization_name,message:"Claude connected. Usage details require admin access."}}return{message:"Claude connected. Usage API requires admin permissions."}}catch(a){return{message:`Claude connected. Unable to fetch usage: ${a.message}`}}}function Y(a,b=0){if("number"==typeof a&&Number.isFinite(a))return a;if("string"==typeof a&&a.trim()){let b=Number(a);if(Number.isFinite(b))return b}return b}function Z(a){return!a||"object"!=typeof a||Array.isArray(a)?null:a.rate_limit&&"object"==typeof a.rate_limit?a.rate_limit:a}function $(a,b){let c=Y(a?.limit_window_seconds??a?.limitWindowSeconds??a?.window_seconds??a?.windowSeconds,null);return null===c||c<=0?b:c<=86400?"session":c<=1209600?"weekly":c<=3888e3?"monthly":b}function _(a){let b=Math.max(0,Math.min(100,Y(a?.used_percent??a?.percent_used,0)));return{used:b,total:100,remaining:Math.max(0,100-b),resetAt:J(a?.reset_at??a?.resets_at??a?.resetAt??null),unlimited:!1}}function aa(a,b,c){let d=Z(c);if(!d)return!1;let e=d.primary_window||d.primary||c.primary_window||c.primary,f=d.secondary_window||d.secondary||c.secondary_window||c.secondary,g=!1;if(e){let c=$(e,"session");a[b?`${b}_${c}`:c]=_(e),g=!0}if(f){let c=$(f,"weekly");a[b?`${b}_${c}`:c]=_(f),g=!0}return g}async function ab(a,b=null){try{let c=await (0,e.proxyAwareFetch)("https://chatgpt.com/backend-api/wham/usage",{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},b);if(!c.ok)return{message:`Codex connected. Usage API temporarily unavailable (${c.status}).`};let d=await c.json(),f=d.rate_limit||d.rate_limits||d.rate_limits_by_limit_id?.codex||{},g=function(a){if(a.code_review_rate_limit||a.review_rate_limit)return a.code_review_rate_limit||a.review_rate_limit;let b=a.rate_limits_by_limit_id;return b&&"object"==typeof b&&!Array.isArray(b)?b.code_review||b.codex_review||b.review||null:(Array.isArray(a.additional_rate_limits)?a.additional_rate_limits:[]).find(a=>{let b=String(a?.limit_name||a?.metered_feature||a?.id||"").toLowerCase();return"code_review"===b||"codex_review"===b||"review"===b||b.includes("review")})||null}(d),h=Math.max(0,Y(d.rate_limit_reset_credits?.available_count,0)),i={};return aa(i,"",f),aa(i,"review",g),{plan:d.plan_type||d.summary?.plan||"unknown",limitReached:Z(f)?.limit_reached||!1,reviewLimitReached:Z(g)?.limit_reached||!1,resetCredits:{availableCount:h},quotas:i}}catch(a){throw Error(`Failed to fetch Codex usage: ${a.message}`)}}async function ac(a,b,c=null){let d=b?.authMethod||"builder-id",f="api_key"===d,g={...f?{tokentype:"API_KEY"}:{},..."external_idp"===d?{TokenType:"EXTERNAL_IDP"}:{}},h=f?b?.profileArn||"":b?.profileArn||"arn:aws:codewhisperer:us-east-1:638616132270:profile/AAAACCCCXXXX",i=new URLSearchParams({isEmailRequired:"true",origin:"AI_EDITOR",resourceType:"AGENTIC_REQUEST"}),j=!1,k=[];for(let b of[{name:"codewhisperer-get",run:async()=>(0,e.proxyAwareFetch)(`https://codewhisperer.us-east-1.amazonaws.com/getUsageLimits?${i.toString()}`,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","x-amz-user-agent":"aws-sdk-js/1.0.0 KiroIDE-1.0.138","user-agent":"aws-sdk-js/1.0.0 KiroIDE-1.0.138",...g}},c)},{name:"codewhisperer-post",run:async()=>(0,e.proxyAwareFetch)("https://codewhisperer.us-east-1.amazonaws.com",{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/x-amz-json-1.0","x-amz-target":"AmazonCodeWhispererService.GetUsageLimits",Accept:"application/json",...g},body:JSON.stringify({origin:"AI_EDITOR",...h?{profileArn:h}:{},resourceType:"AGENTIC_REQUEST"})},c)},{name:"q-get",run:async()=>{let b=new URLSearchParams({origin:"AI_EDITOR",...h?{profileArn:h}:{},resourceType:"AGENTIC_REQUEST"});return(0,e.proxyAwareFetch)(`https://q.us-east-1.amazonaws.com/getUsageLimits?${b}`,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json",...g}},c)}}])try{let a=await b.run();if(!a.ok){let c=await a.text().catch(()=>"");(401===a.status||403===a.status)&&(j=!0),k.push(`${b.name}:${a.status}${c?`:${c}`:""}`);continue}let c=await a.json();return function(a){let b=a.usageBreakdownList||[],c={},d=J(a.nextDateReset||a.resetDate);return b.forEach(a=>{let b=a.resourceType?.toLowerCase()||"unknown",e=a.currentUsageWithPrecision||0,f=a.usageLimitWithPrecision||0;if(c[b]={used:e,total:f,remaining:f-e,resetAt:d,unlimited:!1},a.freeTrialInfo){let e=a.freeTrialInfo.currentUsageWithPrecision||0,f=a.freeTrialInfo.usageLimitWithPrecision||0;c[`${b}_freetrial`]={used:e,total:f,remaining:f-e,resetAt:J(a.freeTrialInfo.freeTrialExpiry||d),unlimited:!1}}}),{plan:a.subscriptionInfo?.subscriptionTitle||"Kiro",quotas:c}}(c)}catch(a){k.push(`${b.name}:${a.message}`)}return j&&"idc"===d?{message:"Kiro quota API is unavailable for the current AWS IAM Identity Center session. Chat may still work. If this persists after renewing your session, reconnect Kiro.",quotas:{}}:j&&("google"===d||"github"===d)?{message:"Kiro quota API authentication expired. Chat may still work.",quotas:{}}:j?{message:"Kiro quota API rejected the current token. Chat may still work.",quotas:{}}:{message:k.length>0?`Unable to fetch Kiro usage right now. (${k[k.length-1]})`:"Unable to fetch Kiro usage right now.",quotas:{}}}async function ad(a,b){try{if(!b?.resourceUrl)return{message:"Qwen connected. No resource URL available."};return{message:"Qwen connected. Usage tracked per request."}}catch(a){return{message:"Unable to fetch Qwen usage."}}}async function ae(a){try{return{message:"iFlow connected. Usage tracked per request."}}catch(a){return{message:"Unable to fetch iFlow usage."}}}async function af(a,b,c=null){if(!a)return{message:"GLM API key not available."};let d=A["glm-cn"===b?"china":"international"];try{let b=await (0,e.proxyAwareFetch)(d,{headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},c);if(!b.ok){if(401===b.status)return{message:"GLM API key invalid or expired."};return{message:`GLM quota API error (${b.status}).`}}let f=await b.json(),g=f?.data&&"object"==typeof f.data?f.data:{},h=Array.isArray(g.limits)?g.limits:[],i={};for(let a of h){if(!a||"TOKENS_LIMIT"!==a.type)continue;let b=Number(a.percentage)||0,c=Number(a.nextResetTime)||0,d=Math.max(0,100-b);i.session={used:b,total:100,remaining:d,remainingPercentage:d,resetAt:c>0?new Date(c).toISOString():null,unlimited:!1}}let j="string"==typeof g.level?g.level:"";return{plan:j?j.charAt(0).toUpperCase()+j.slice(1).toLowerCase():"Unknown",quotas:i}}catch(a){return{message:`GLM error: ${a.message}`}}}function ag(a,b,c){return a&&"object"==typeof a?a[b]??a[c]??null:null}function ah(a,b,c){if(!a||"object"!=typeof a)return null;let d=a[b]??a[c];if(null==d)return null;let e=Number(d);return Number.isFinite(e)?Math.max(0,Math.min(100,e)):null}function ai(a){return Math.max(0,Number(ag(a,"current_interval_total_count","currentIntervalTotalCount"))||0)}function aj(a){return Math.max(0,Number(ag(a,"current_weekly_total_count","currentWeeklyTotalCount"))||0)}function ak(a){return!!(ai(a)>0||aj(a)>0)||null!==ah(a,"current_interval_remaining_percent","currentIntervalRemainingPercent")||null!==ah(a,"current_weekly_remaining_percent","currentWeeklyRemainingPercent")}function al(a,b,c,d,e,f,g,h,i,j){let k=d(c),l=ah(c,g,h);if(k<=0&&null===l)return;let m=Math.max(0,Number(ag(c,e,f))||0),n=k,o=m;k<=0&&(n=100,o=j?Math.round(l/100*n):Math.round(n*(1-l/100))),a[b]=function(a,b,c,d,e=null){var f,g,h;let i=Math.max(0,a),j=d?Math.max(i-b,0):Math.min(Math.max(0,b),i),k=Math.max(i-j,0),l=(f=e,g=k,h=i,null!=f&&Number.isFinite(f)?Math.max(0,Math.min(100,f)):h>0?Math.max(0,Math.min(100,g/h*100)):0);return{used:j,total:i,remaining:k,remainingPercentage:l,resetAt:c,unlimited:!1}}(n,o,function(a,b,c,d,e,f){let g=Number(ag(a,c,d))||0;return g>0?new Date(b+g).toISOString():J(ag(a,e,f))}(c,...i),j,l)}async function am(a,b,c=null){if(!a)return{message:"MiniMax API key not available."};let d=B[b]||[],f="";for(let b=0;b<d.length;b+=1){let g=d[b],h=b<d.length-1;try{let b=await (0,e.proxyAwareFetch)(g,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","Content-Type":"application/json"}},c),d=await b.text(),i={};if(d)try{i=JSON.parse(d)}catch{i={}}let j=(i?.base_resp??i?.baseResp)||{},k=Number(j.status_code??j.statusCode)||0,l=String(j.status_msg??j.statusMsg??"").trim(),m=`${l} ${d}`.trim(),n=/token plan|coding plan|invalid api key|invalid key|unauthorized|inactive/i;if(401===b.status||403===b.status||1004===k||n.test(m))return{message:"MiniMax API key invalid or inactive. Use an active Token/Coding Plan key."};if(!b.ok){if(f=`MiniMax usage endpoint error (${b.status})`,(404===b.status||405===b.status||b.status>=500)&&h)continue;return{message:`MiniMax connected. ${f}`}}if(0!==k)return{message:`MiniMax connected. ${l||"Upstream quota API error"}`};let o=i?.model_remains??i?.modelRemains,p=(Array.isArray(o)?o:[]).filter(ak);if(0===p.length)return{message:"MiniMax connected. No quota data was returned."};let q=Date.now(),r=g.includes("/coding_plan/remains"),s={};for(let a of p){let b=function(a){let b=String(ag(a,"model_name","modelName")||"").trim();return b?"MiniMax-M*"===b||"general"===b?"M-series":b.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,a=>a.toUpperCase()).replace(/\bTo\b/g,"to").replace(/\bTts\b/g,"TTS").replace(/\bHd\b/g,"HD"):"MiniMax"}(a);al(s,`${b} (5h)`,a,ai,"current_interval_usage_count","currentIntervalUsageCount","current_interval_remaining_percent","currentIntervalRemainingPercent",[q,"remains_time","remainsTime","end_time","endTime"],r),al(s,`${b} (7d)`,a,aj,"current_weekly_usage_count","currentWeeklyUsageCount","current_weekly_remaining_percent","currentWeeklyRemainingPercent",[q,"weekly_remains_time","weeklyRemainsTime","weekly_end_time","weeklyEndTime"],r)}if(0===Object.keys(s).length)return{message:"MiniMax connected. Unable to extract quota usage."};return{quotas:s}}catch(a){if(f=a.message,!h)break}}return{message:f?`MiniMax connected. Unable to fetch usage: ${f}`:"MiniMax connected. Unable to fetch usage."}}async function an(a,b=null,d=null){if(!a)return{message:"AutoClaw usage unavailable: no access token"};try{let{AUTOCLAW_WALLET_ENDPOINT:f,buildAutoClawWalletHeaders:g}=await Promise.resolve().then(c.bind(c,73952)),h=await (0,e.proxyAwareFetch)(f,{method:"GET",headers:g(a)},b);if(!h.ok)return{message:`AutoClaw connected. Usage fetch returned ${h.status}.`};let i=await h.json().catch(()=>null);if(!i||0!==i.code)return{message:"AutoClaw connected. Unable to read balance."};let j=Number(i.data?.total_balance),k=Number.isFinite(j)?j:0,l=k;try{if(d?.id){let{getQuotaSnapshot:a}=await Promise.resolve().then(c.bind(c,70321)),b=await a(d.id),e=Number(b?.usage?.quotas?.points?.total)||0,f=Number(b?.usage?.quotas?.points?.remaining);l=Math.max(e,k,Number.isFinite(f)?f:0)}}catch{}let m=Math.max(0,l-k);return{quotas:{points:{total:l,used:m,remaining:k,unit:"points",resetAt:null}},totalUsagePercentage:l>0?Math.round(m/l*100):0,isQuotaExceeded:k<=0}}catch(a){return{message:`AutoClaw connected. Unable to fetch balance: ${a.message}`}}}async function ao(a,b=null,c=null){let d=String(a||"").trim(),f=String(b?.accountId||"").trim();if(!d)return{message:"Cloudflare API token not available."};if(!f)return{message:"Cloudflare account ID missing. Re-import or edit the connection."};try{let a=await (0,e.proxyAwareFetch)("https://api.cloudflare.com/client/v4/user/tokens/verify",{method:"GET",headers:{Authorization:`Bearer ${d}`,Accept:"application/json"}},c);if(401===a.status||403===a.status)return{message:"Cloudflare API token invalid or expired. Re-import the account."};if(!a.ok){let b=await a.text().catch(()=>"");return{message:`Cloudflare token verify failed (${a.status})${b?`: ${b.slice(0,160)}`:""}`}}let g=await a.json().catch(()=>null),h=g?.result?.status||(g?.success?"active":"unknown"),i=b?.accountName||"";try{let a=await (0,e.proxyAwareFetch)(`https://api.cloudflare.com/client/v4/accounts/${encodeURIComponent(f)}`,{method:"GET",headers:{Authorization:`Bearer ${d}`,Accept:"application/json"}},c);if(a?.ok){let b=await a.json().catch(()=>null);i=b?.result?.name||i}}catch{}let j=f.length>10?`${f.slice(0,8)}…`:f;return{plan:i?`Workers AI \xb7 ${i}`:`Workers AI \xb7 ${j}`,quotas:{"Workers AI":{used:0,total:0,remainingPercentage:100,resetAt:null,unlimited:!0}},message:h&&"active"!==h?`Token status: ${h}. Cloudflare does not publish remaining free-tier neurons via API.`:"Token valid. CF does not expose remaining free-tier neurons via API — model rate limits still apply."}}catch(a){return{message:`Cloudflare usage error: ${a.message}`}}}function ap(a,b=0){return null==a?b:"object"==typeof a&&!Array.isArray(a)&&"val"in a?Y(a.val,b):Y(a,b)}function aq({used:a,total:b,resetAt:c,unlimited:d=!1}){let e=Math.max(0,Y(b,0)),f=Math.max(0,Y(a,0));if(d||0===e)return{used:f,total:0,remainingPercentage:100*!!d,resetAt:c||null,unlimited:!0};let g=Math.max(0,e-f);return{used:f,total:e,remainingPercentage:g/e*100,resetAt:c||null,unlimited:!1}}async function ar(a,b=null,c=null){if(!a)return{message:"Grok CLI access token not available."};let d=function(a,b={}){let c=b||{},d={Authorization:`Bearer ${a}`,Accept:"application/json","User-Agent":"grok-pager/0.2.93 grok-shell/0.2.93 (linux; x86_64)","x-xai-token-auth":"xai-grok-cli","x-grok-client-identifier":"grok-pager","x-grok-client-version":"0.2.93"},e=c.email,f=c.userId||c.principalId;return e&&(d["x-email"]=e),f&&(d["x-userid"]=f),d}(a,b);try{let[a,b]=await Promise.all([(0,e.proxyAwareFetch)("https://cli-chat-proxy.grok.com/v1/billing?format=credits",{method:"GET",headers:d},c),(0,e.proxyAwareFetch)("https://cli-chat-proxy.grok.com/v1/user?include=subscription",{method:"GET",headers:d},c).catch(()=>null)]);if(401===a.status||403===a.status)return{message:"Grok CLI authentication expired. Please re-authorize."};if(!a.ok){let b=await a.text().catch(()=>""),c=b?`: ${b.slice(0,200)}`:"";return{message:`Grok CLI billing API error (${a.status})${c}`}}let f=await a.json().catch(()=>null);if(!f||"object"!=typeof f)return{message:"Grok CLI billing response was not JSON."};let g=null;b?.ok&&(g=await b.json().catch(()=>null));let h=function(a,b=null){let c,d=a&&"object"==typeof a?a:{},e=d.config&&"object"==typeof d.config&&!Array.isArray(d.config)?d.config:d,f=J(e.billingPeriodEnd)||J(e.currentPeriod?.end)||J(d.billingPeriodEnd)||null,g={},h=ap(e.onDemandCap??d.onDemandCap,NaN),i=ap(e.onDemandUsed??d.onDemandUsed,NaN);if(Number.isFinite(h)&&h>0){let a=Number.isFinite(i)?Math.max(0,i):0;g["On-demand"]=aq({used:a,total:h,resetAt:f})}let j=ap(e.monthlyLimit??d.monthlyLimit,NaN),k=ap(e.used??d.used,NaN);Number.isFinite(j)&&j>0&&(g.Monthly=aq({used:Number.isFinite(k)?Math.max(0,k):0,total:j,resetAt:f}));let l=ap(e.prepaidBalance??d.prepaidBalance,NaN);return Number.isFinite(l)&&l>0&&(g.Prepaid={used:0,total:l,remainingPercentage:100,resetAt:null,unlimited:!1}),(b?.hasGrokCodeAccess===!0||e?.isUnifiedBillingUser===!0)&&(g["Grok Code"]={used:0,total:0,remainingPercentage:100,resetAt:f,unlimited:!0}),0===Object.keys(g).length&&(g.Included={used:0,total:0,remainingPercentage:100,resetAt:f,unlimited:!0}),{plan:(c="string"==typeof b?.subscriptionTier?b.subscriptionTier.trim():"")?c.replace(/[_-]+/g," ").replace(/\b\w/g,a=>a.toUpperCase()):b?.hasGrokCodeAccess===!0?"Grok Code":(e?.isUnifiedBillingUser,"Grok Build"),quotas:g,periodEnd:f}}(f,g);if(!h.quotas||0===Object.keys(h.quotas).length)return{plan:h.plan,message:"Grok Build connected, but no credit allotment was returned. Free promo may be exhausted — upgrade at https://grok.com/supergrok or add credits at https://grok.com/?_s=usage.",quotas:{}};return{plan:h.plan,quotas:h.quotas}}catch(a){return{message:`Grok CLI usage error: ${a.message}`}}}function as(a,b=0,c=""){if(!a||"object"!=typeof a||b>4)return null;let d=[];for(let[e,f]of Object.entries(a)){let a=e.toLowerCase();if(f&&"object"==typeof f&&!Array.isArray(f)){let a=as(f,b+1,c?`${c}.${e}`:e);a&&d.push(a);continue}if("number"!=typeof f&&"string"!=typeof f)continue;let g=Y(f,NaN);Number.isFinite(g)&&/(remaining|balance|credit|quota|limit|allowance|cap|used|spent|consumed)/i.test(a)&&d.push({key:c?`${c}.${e}`:e,name:e,value:g,kind:a})}return d.length?d:null}function at(a){if(!a?.length)return null;let b=b=>a.find(a=>b.test(a.kind)||b.test(a.name)),c=b(/remaining|balance|credit(?!s_used)/i),d=b(/limit|cap|allowance|total|quota(?!_used)/i),e=b(/used|spent|consumed/i);if(d&&Number(d.value)>0){let a=e?Math.max(0,Number(e.value)):c?Math.max(0,Number(d.value)-Number(c.value)):0,b=Math.max(0,Number(d.value)-a);return{used:a,total:Number(d.value),remainingPercentage:b/Number(d.value)*100,resetAt:null,unlimited:!1}}if(c&&Number(c.value)>=0){let a=Number(c.value);return{used:0,total:a>0?a:1,remainingPercentage:100*(a>0),resetAt:null,unlimited:!1}}return null}async function au(a,b="cline",d=null){if(!a)return{message:"Cline access token not available."};try{let{buildClineHeaders:f}=await Promise.resolve().then(c.bind(c,43469)),g=f(a,{Accept:"application/json"}),h=await (0,e.proxyAwareFetch)("https://api.cline.bot/api/v1/users/me",{method:"GET",headers:g},d);if(401===h.status||403===h.status)return{message:"Cline authentication expired. Please re-authorize."};if(!h.ok)return{message:`Cline user API error (${h.status})`};let i=await h.json().catch(()=>null);if(!i||"object"!=typeof i)return{message:"Cline user response was not JSON."};let j=i.data&&"object"==typeof i.data?i.data:i,k=j.email||j.user?.email||null,l=j.plan||j.subscription?.plan||j.subscription?.name||j.organization?.plan||j.organizations?.[0]?.plan||("clinepass"===b?"ClinePass":"Cline"),m=as(j)||[],n=at(m),o={};n&&(o.Credits=n);let p=j.organizations||j.organization;if(!Object.keys(o).length&&p&&(o.Account={used:0,total:0,remainingPercentage:100,resetAt:null,unlimited:!0}),!Object.keys(o).length)return{plan:"string"==typeof l?l:"Cline",email:k,message:"Cline connected. No credit allotment was returned by the account API.",quotas:{}};return{plan:"string"==typeof l?l:"Cline",email:k,quotas:o}}catch(a){return{message:`Cline usage error: ${a.message}`}}}async function av(a,b=null,c=null){if(!a)return{message:"Kimchi access token not available."};try{let d=await (0,e.proxyAwareFetch)("https://app.kimchi.dev/api/v1/me",{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${a}`,"User-Agent":"kimchi/0.1.50"}},c);if(401===d.status||403===d.status)return{message:"Kimchi authentication expired. Please re-authorize."};if(!d.ok)return{message:`Kimchi user API error (${d.status})`};let f=await d.json().catch(()=>null);if(!f||"object"!=typeof f)return{message:"Kimchi user response was not JSON."};let g=f.email||b?.username||null,h=f.plan||f.tier||f.subscription?.name||"Kimchi",i=as(f)||[],j=at(i),k={};return j?k.Credits=j:k.Account={used:0,total:0,remainingPercentage:100,resetAt:null,unlimited:!0},{plan:"string"==typeof h?h:"Kimchi",email:g,quotas:k}}catch(a){return{message:`Kimchi usage error: ${a.message}`}}}async function aw(a,b=null,c=null){if(!a)return{message:"xAI token not available."};try{let d={Authorization:`Bearer ${a}`,Accept:"application/json"},f=0,g=null,h=null;for(let a of["https://api.x.ai/v1/api-key","https://api.x.ai/v1/models"]){let b=await (0,e.proxyAwareFetch)(a,{method:"GET",headers:d},c);if(f=b.status,401===b.status||403===b.status)return{message:"xAI authentication expired. Please re-authorize or update the API key."};if(b.ok){g=await b.json().catch(()=>null),h=a;break}}if(!g)return{message:`xAI API error (${f||"unknown"})`};let i=as(g)||[],j=at(i),k={};j?k.Credits=j:(Array.isArray(g?.data)&&g.data.length,k.API={used:0,total:0,remainingPercentage:100,resetAt:null,unlimited:!0});let l=b?.email||null,m=g.name||g.api_key_name||g.team?.name||(h?.includes("api-key")?"xAI API Key":"xAI");return{plan:"string"==typeof m?m:"xAI",email:l,quotas:k}}catch(a){return{message:`xAI usage error: ${a.message}`}}}async function ax(a,b=null){if(!a)return{message:"Cursor access token not available."};let c=b?.plan||b?.membershipType||"Cursor",d=b?.email||null;try{let b=String(a).split(".");if(3===b.length){let a=b[1].replace(/-/g,"+").replace(/_/g,"/"),e=a+"=".repeat((4-a.length%4)%4),f=JSON.parse(Buffer.from(e,"base64").toString("utf8"));d=d||f.email||f.preferred_username||null,c=f.plan||f.subscription||f.membershipType||f.tier||c}}catch{}return{plan:"string"==typeof c?c:"Cursor",email:d,quotas:{Session:{used:0,total:0,remainingPercentage:100,resetAt:null,unlimited:!0}}}}},95095:(a,b,c)=>{"use strict";let d=c(7344),e=c(31825);class f extends d{#bW=null;#bX=null;constructor(a,b={}){super(b),this.#bW=a,this.#bX=b}dispatch(a,b){let c=new e({...a,retryOptions:this.#bX},{dispatch:this.#bW.dispatch.bind(this.#bW),handler:b});return this.#bW.dispatch(a,c)}close(){return this.#bW.close()}destroy(){return this.#bW.destroy()}}a.exports=f},96947:(a,b,c)=>{"use strict";c.d(b,{DO:()=>s,LP:()=>r});var d=c(79154),e=c(87164),f=c(87886),g=c(14e3);globalThis._backgroundTokenRefreshState||(globalThis._backgroundTokenRefreshState={started:!1,startTimer:null,timer:null,runningPromise:null,retryByConnection:new Map});let h=globalThis._backgroundTokenRefreshState;async function i(a){let{getProviderConnectionById:b}=await Promise.resolve().then(c.bind(c,70321));return b(a)}async function j(a,b){let{mutateProviderConnection:d}=await Promise.resolve().then(c.bind(c,70321));return d(a,b)}async function k(a,b){return(0,d.Vq)(a,b,f)}function l(a,b){return!!(a&&b&&a.refreshToken===b.refreshToken&&a.accessToken===b.accessToken&&a.updatedAt===b.updatedAt)}async function m(a,b,d={}){let e=d.mutateConnection||j,f=d.now||Date.now,{buildProviderCredentialUpdates:g}=await c.e(3815).then(c.bind(c,73815));return!!await e(a.id,c=>l(c,a)?g({...b,existingProviderSpecificData:c.providerSpecificData},f()):null)}async function n(a,b,c={}){let d=c.mutateConnection||j;return!!await d(a.id,c=>l(c,a)?{lastError:"OAuth refresh credential rejected; reconnect this account.",lastErrorAt:b.at,lastErrorType:"auth",errorCode:b.code,failureClass:"reauth_required"}:null)}async function o(a,b={}){let c,d=b.readConnection||i,e=b.refreshCredentials||k,f=b.persistCredentials,h=b.markReauthRequired,p=b.mutateConnection||j,q=b.now||Date.now,r=b.scheduler||g.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(q()).toISOString()},c=!0;if(h?await h(s,b):c=await n(s,b,{mutateConnection:p}),!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(q()).toISOString()};if(f){let b=await d(a.id);if(!l(b,s))return{refreshed:!1,stale:!0};await f(a.id,{...t,existingProviderSpecificData:b.providerSpecificData})}else if(!await m(s,t,{mutateConnection:p,now:q}))return{refreshed:!1,stale:!0};return{refreshed:!0}}async function p(a,b={}){let c=b.refreshConnection||o,d=Math.max(1,Number(b.concurrency)||4),e="function"==typeof b.now?b.now():Date.now(),g=0,i=0,j=0,k=Array.from({length:Math.min(d,a.length)},async()=>{for(;g<a.length;){let b=a[g++];try{await c(b),h.retryByConnection.delete(b.id),i+=1}catch(a){!function(a,b,c=!1){let d=h.retryByConnection.get(a),e=(d?.attempts||0)+1,f=Math.min(9e5,3e4*2**(e-1));h.retryByConnection.set(a,{attempts:e,retryAt:c?1/0:b+f})}(b.id,e,a?.permanent===!0),j+=1,f.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(k),{attempted:a.length,succeeded:i,failed:j}}async function q(){let{getProviderConnections:a}=await Promise.resolve().then(c.bind(c,70321));return a({isActive:!0})}function r(a={}){if(h.started)return!1;h.started=!0;let b=Number.isFinite(a.intervalMs)&&a.intervalMs>0?a.intervalMs:3e5,c=a.random||Math.random,g=async()=>{await function(a={}){let b,c;if(h.runningPromise)return h.runningPromise;let g=(b=a.listConnections||q,c=a.now||Date.now,(async()=>{try{let f=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=h.retryByConnection.get(a.id))&&!(c.retryAt<=b))return!1;let f=(0,d.Dz)(a);if(null===f)return!1;let g=(0,e.Og)(a.provider);return f-b<Math.max(18e5,Number.isFinite(g)?g:0)}):[]}(f,c());return await p(g,{...a,now:c})}catch(a){return f.warn("BG_TOKEN_REFRESH","Refresh sweep failed",{code:a?.code||null}),{attempted:0,succeeded:0,failed:0}}})()).finally(()=>{h.runningPromise===g&&(h.runningPromise=null)});return h.runningPromise=g,g}(a),h.started&&(h.timer=setTimeout(g,function(a,b=Math.random){return Math.round(a*(.9+.2*Math.max(0,Math.min(1,Number(b())||0))))}(b,c)),h.timer.unref?.())};return h.startTimer=setTimeout(()=>{h.startTimer=null,g()},1e4),h.startTimer.unref?.(),!0}function s(){return h.startTimer&&clearTimeout(h.startTimer),h.timer&&clearTimeout(h.timer),h.startTimer=null,h.timer=null,h.started=!1,h.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{#bY;#bX={};#bt=0;constructor(a,b){this.#bX.serverNoContextTakeover=a.has("server_no_context_takeover"),this.#bX.serverMaxWindowBits=a.get("server_max_window_bits"),this.#bt=b.maxPayloadSize}decompress(a,b,c){if(!this.#bY){let a=e;if(this.#bX.serverMaxWindowBits){if(!f(this.#bX.serverMaxWindowBits))return void c(Error("Invalid server_max_window_bits"));a=Number.parseInt(this.#bX.serverMaxWindowBits)}try{this.#bY=d({windowBits:a})}catch(a){c(a);return}this.#bY[i]=[],this.#bY[j]=0,this.#bY.on("data",a=>{if(this.#bY[j]+=a.length,this.#bt>0&&this.#bY[j]>this.#bt){c(new g),this.#bY.removeAllListeners(),this.#bY=null;return}this.#bY[i].push(a)}),this.#bY.on("error",a=>{this.#bY=null,c(a)})}this.#bY.write(a),b&&this.#bY.write(h),this.#bY.flush(()=>{if(!this.#bY)return;let a=Buffer.concat(this.#bY[i],this.#bY[j]);this.#bY[i].length=0,this.#bY[j]=0,c(null,a)})}}a.exports={PerMessageDeflate:k}},97356:(a,b,c)=>{"use strict";let{Transform:d}=c(57075),{isASCIINumber:e,isValidLastEventId:f}=c(26376),g=Buffer.from("data"),h=Buffer.from("event"),i=Buffer.from("id"),j=Buffer.from("retry");function k(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}class l extends d{state;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;chunks=[];chunkIndex=0;pos=0;lineChunkIndex=0;linePos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(a={}){a.readableObjectMode=!0,super(a),this.state=a.eventSourceSettings||{},a.push&&(this.push=a.push)}_transform(a,b,c){if(0===a.length||(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),this.parseLine(this.readLine(),this.event),this.consumeCurrentByte(),this.eventEndCheck=!0;continue}this.advanceCursor()}c()}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),k(a,d,g)){let c=a.toString("utf8",e);void 0===b.data?b.data=c:b.data+=`
466
+ `}},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"]}},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);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.r(b),c.d(b,{claudeToOpenAIRequest:()=>h});var d=c(56294),e=c(42541),f=c(58455),g=c(18831);function h(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":"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(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};if(Array.isArray(a.content)){let c=[],d=[],e=[],f=[],g=[];for(let b of a.content)switch(b.type){case"text":c.push({type:"text",text:b.text});break;case"image":{let a=i(b.source);a&&c.push(a)}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=>i(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):
467
+ ${a}`),e.push({role:"tool",tool_call_id:b.tool_use_id,content:a})}}let h=g.join("\n");if(e.length>0){let a=[...c,...f],b=[...e];if(a.length>0){let c=1===a.length&&"text"===a[0].type?a[0].text:a;b.push({role:"user",content:c})}return d.length>0&&b.push(j(d,[],h)),b}if(d.length>0)return j(d,c,h);if(c.length>0||h){let a={role:b,...c.length>0&&{content:1===c.length&&"text"===c[0].type?c[0].text:c}};return"assistant"===b&&h&&(a.reasoning_content=h),a}if(0===a.content.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 i(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 j(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,h,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")}}}},94084:(a,b,c)=>{"use strict";c.d(b,{Yh:()=>r});var d=c(69384),e=c(30395),f=c(46956),g=c(11484),h=c(55511),i=c(21820),j=c.n(i);let k=e.xq["mimo-free"]?.baseUrl||"https://api.xiaomimimo.com/api/free-ai/openai/chat",l="abcdefghijklmnopqrstuvwxyz0123456789",m=["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36","Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"],n="You are MiMoCode, an interactive CLI tool that helps users with software engineering tasks.",o=null,p=0;async function q(a=null){if(o&&Date.now()<p-3e5)return o;let b=await (0,f.proxyAwareFetch)("https://api.xiaomimimo.com/api/free-ai/bootstrap",{method:"POST",headers:{"Content-Type":"application/json","User-Agent":m[Math.floor(Math.random()*m.length)]},body:JSON.stringify({client:function(){let a="unknown-user";try{a=j().userInfo().username}catch{}let b=(j().cpus()[0]?.model||"unknown-cpu").trim(),c=`${j().hostname()}|${j().platform()}|${j().arch()}|${b}|${a}`;return(0,h.createHash)("sha256").update(c).digest("hex")}()})},a);if(!b.ok)throw Error(`MiMo bootstrap failed: ${b.status}`);let c=await b.json();if(!c.jwt)throw Error("MiMo bootstrap returned no JWT");return o=c.jwt,p=function(a){try{let b=JSON.parse(Buffer.from(a.split(".")[1],"base64").toString());if(b.exp)return 1e3*b.exp}catch{}return Date.now()+3e6}(c.jwt),o}class r extends d.Hv{constructor(){super("mimo-free",e.xq["mimo-free"]),this.sessionId=function(){let a="ses_";for(let b=0;b<24;b++)a+=l[Math.floor(Math.random()*l.length)];return a}()}buildUrl(){return k}buildHeaders(a,b=!0){return{"Content-Type":"application/json","X-Mimo-Source":"mimocode-cli-free","User-Agent":m[Math.floor(Math.random()*m.length)],"x-session-affinity":this.sessionId,Accept:b?"text/event-stream":"application/json"}}transformRequest(a,b){let c;return!Array.isArray(c=b?.messages)||c.some(a=>a?.role==="system"&&"string"==typeof a.content&&a.content.includes(n))?b:{...b,messages:[{role:"system",content:n},...c]}}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:h,proxyOptions:i=null}){let j;try{j=await q(i)}catch(a){throw h?.error?.("AUTH",`MiMo bootstrap failed: ${a.message}`),a}let k=this.buildUrl(),l=this.transformRequest(a,b),m={...this.buildHeaders(d,c),Authorization:`Bearer ${j}`},n=JSON.stringify(l);h?.debug?.("FETCH",`MIMO-FREE → ${k} | body=${n.length}B`);let r=await (0,f.proxyAwareFetch)(k,{method:"POST",headers:m,body:n,signal:e},i);return 401===r.status||403===r.status?(h?.debug?.("AUTH",`MiMo auth failed (${r.status}), re-bootstrapping...`),await (0,g.aI)(r),o=null,p=0,j=await q(i),m.Authorization=`Bearer ${j}`,{response:await (0,f.proxyAwareFetch)(k,{method:"POST",headers:m,body:n,signal:e},i),url:k,headers:m,transformedBody:l}):{response:r,url:k,headers:m,transformedBody:l}}}},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),{hashId:m,isUrlExcludedFactory:n,normalizeHeaders:o,createHeaderFilters:p}=c(47800);function q(a,b,c={}){var d,e,f;let g=new URL(a.path,a.origin),h=a._normalizedHeaders||o(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:r(h,b,c),body:(d=a.body,e=c.matchBody,f=c.normalizeBody,!1===e?"":f?String(f(d)??""):d?String(d):"")}}function r(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))&&(e[a]=c)}return e}function s(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)||(e[a]=c)}return e}function t(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),m(b.join("|"))}class u{#bM;#bN;#bO=new Map;#bP;#bQ=1/0;#bR=!1;#bS;constructor(a={}){this.#bP=a.snapshotPath,this.#bQ=a.maxSnapshots||1/0,this.#bR=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.#bS=p(this.matchOptions),this.shouldRecord=a.shouldRecord||(()=>!0),this.shouldPlayback=a.shouldPlayback||(()=>!0),this.#bN=n(a.excludeUrls),this.#bR&&this.#bP&&this.#bT()}async record(a,b){if(!this.shouldRecord(a)||this.isUrlExcluded(a))return;let c=q(a,this.#bS,this.matchOptions),d=t(c),e=o(b.headers),f={statusCode:b.statusCode,headers:s(e,this.#bS,this.matchOptions),body:Buffer.isBuffer(b.body)?b.body.toString("base64"):Buffer.from(String(b.body||"")).toString("base64"),trailers:b.trailers};if(this.#bO.size>=this.#bQ&&!this.#bO.has(d)){let a=this.#bO.keys().next().value;this.#bO.delete(a)}let g=this.#bO.get(d);g&&g.responses?(g.responses.push(f),g.timestamp=new Date().toISOString()):this.#bO.set(d,{request:c,responses:[f],callCount:0,timestamp:new Date().toISOString()}),this.#bR&&this.#bP&&this.#bU()}isUrlExcluded(a){let b=new URL(a.path,a.origin).toString();return this.#bN(b)}findSnapshot(a){if(!this.shouldPlayback(a)||this.isUrlExcluded(a))return;let b=t(q(a,this.#bS,this.matchOptions)),c=this.#bO.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.#bP;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.#bO.clear(),c))this.#bO.set(a,b);else this.#bO=new Map(Object.entries(c))}catch(a){if("ENOENT"===a.code)this.#bO.clear();else throw new l(`Failed to load snapshots from ${b}`,{cause:a})}}async saveSnapshots(a){let b=a||this.#bP;if(!b)throw new k("Snapshot path is required");let c=h(b);await f(g(c),{recursive:!0});let e=Array.from(this.#bO.entries()).map(([a,b])=>({hash:a,snapshot:b}));await d(c,JSON.stringify(e,null,2),{flush:!0})}clear(){this.#bO.clear()}getSnapshots(){return Array.from(this.#bO.values())}size(){return this.#bO.size}resetCallCounts(){for(let a of this.#bO.values())a.callCount=0}deleteSnapshot(a){let b=t(q(a,this.#bS,this.matchOptions));return this.#bO.delete(b)}getSnapshotInfo(a){let b=t(q(a,this.#bS,this.matchOptions)),c=this.#bO.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.#bO.clear(),Array.isArray(a))for(let{hash:b,snapshot:c}of a)this.#bO.set(b,c);else a&&"object"==typeof a&&(this.#bO=new Map(Object.entries(a)))}#bT(){return this.#bU()}#bV(){this.#bM&&(j(this.#bM),this.saveSnapshots().catch(()=>{}),this.#bM=null)}#bU(){this.#bM=i(()=>{this.saveSnapshots().catch(()=>{}),this.#bR?this.#bM?.refresh():this.#bM=null},1e3)}destroy(){this.#bV(),this.#bM&&(j(this.#bM),this.#bM=null)}async close(){this.#bP&&0!==this.#bO.size&&await this.saveSnapshots(),this.destroy()}}a.exports={SnapshotRecorder:u,formatRequestKey:q,createRequestHash:t,filterHeadersForMatching:r,filterHeadersForStorage:s,createHeaderFilters:p}},94479:(a,b,c)=>{"use strict";c.d(b,{my:()=>G});var d=c(48991),e=c(46956);async function f(a){try{await a?.body?.cancel?.()}catch{}}async function g(a,b={}){let c=b.fetchImpl||fetch;if("string"!=typeof a||!a.trim())return null;try{let d,e=await c("https://api.blackbox.ai/key/info",{method:"GET",headers:(d={Accept:"application/json","Content-Type":"application/json"},"string"==typeof a&&a.trim()&&(d.Authorization=`Bearer ${a.trim()}`),d),signal:function(a={}){return a.signal?a.signal:AbortSignal.timeout(a.timeoutMs||8e3)}(b)});if(!e.ok)return await f(e),null;let g=await e.json();return g?.info||g||null}catch{return null}}async function h(a,b={}){let c=await g(a,b);if(!c)return{plan:"Blackbox API",message:"Blackbox spend data is unavailable for this key.",quotas:{},trackingMode:"unavailable"};let d=Number(c.spend),e=Number(c.max_budget),f=Number.isFinite(d)&&d>=0?d:0,i=Number.isFinite(e)&&e>0,j=i?e:0,k=i?Math.max(0,j-f):null,l=i?Math.max(0,Math.min(100,k/j*100)):100;return{plan:"Blackbox API",quotas:{Spend:{used:f,total:j,...null==k?{}:{remaining:k},remainingPercentage:l,unlimited:!1,unit:"USD",resetAt:c.budget_reset_at||c.expires||null,displayName:i?"API Budget":"API Spend"}},trackingMode:"upstream",spend:f,maxBudget:i?e:null}}function i(a,b=0){let c="string"==typeof a&&a.trim()?Number(a):a;return Number.isFinite(c)?c:b}function j(a,b){return{plan:a,quotas:{Credits:{used:1,total:1,remaining:0,remainingPercentage:0,resetAt:null,unlimited:!1}},authoritative:!0,limitReached:!0,message:b}}function k(a){let b=Error(a);return b.name="AbortError",b.code="USAGE_REQUEST_ABORTED",b}async function l(a,b={}){let c,d=new AbortController,e=b.parentSignal,f=Number.isFinite(b.timeoutMs)&&b.timeoutMs>0?b.timeoutMs:15e3,g=new Promise((a,b)=>{c=b}),h=a=>{let b=a instanceof Error?a:k("Usage request aborted");d.signal.aborted||d.abort(b),c(b)},i=()=>h(e.reason);e?.aborted?h(e.reason):e?.addEventListener("abort",i,{once:!0});let j=setTimeout(()=>h(k(`Usage request timed out after ${f}ms`)),f);j.unref?.();try{return await Promise.race([Promise.resolve().then(()=>a(d.signal)),g])}finally{clearTimeout(j),e?.removeEventListener("abort",i)}}function m(a){let b=Math.round(100*Math.max(0,Math.min(1,Number(a)||0))),c=100-b;return{used:b,total:100,remaining:c,remainingPercentage:c,resetAt:null,unlimited:!1}}function n(){return{quotaFetchFailed:!0,message:"Ollama Cloud usage temporarily unavailable."}}async function o(a,b=null){let c=a?.apiKey||a?.accessToken;if(!c)return{message:"Ollama Cloud API key not available."};let d={Authorization:`Bearer ${c}`,Accept:"application/json"};try{return await l(async a=>{let c=await (0,e.proxyAwareFetch)("https://ollama.com/api/usage",{method:"GET",headers:d,signal:a},b);if(401===c.status||403===c.status)return{authError:!0,accountDead:!0,message:"Ollama Cloud API key invalid or expired."};if(402===c.status||429===c.status)return j("Ollama Cloud","Ollama Cloud credits are exhausted.");if(!c.ok)return n();let f=await c.json().catch(()=>null);if(!f||"object"!=typeof f)return n();let g=await (0,e.proxyAwareFetch)("https://ollama.com/api/me",{method:"POST",headers:{...d,"Content-Length":"0"},signal:a},b).then(a=>a.ok?a.json():null).catch(b=>{if(a.aborted)throw b;return null}),h="string"==typeof g?.Plan?g.Plan.trim():"",i=h?h.charAt(0).toUpperCase()+h.slice(1).toLowerCase():"Ollama Cloud",k=f.limits&&"object"==typeof f.limits?f.limits:{},l={};return(Number.isFinite(Number(k.session?.usage))&&(l["Session (5h)"]=m(k.session.usage)),Number.isFinite(Number(k.weekly?.usage))&&(l["Weekly (7d)"]=m(k.weekly.usage)),0===Object.keys(l).length)?{plan:i,quotas:l,authoritative:!0,message:"Ollama Cloud connected. No usage limits reported."}:{plan:i,quotas:l,authoritative:!0}},{parentSignal:b?.signal})}catch{return n()}}let p={LEVEL_BASIC:"Moderato",LEVEL_INTERMEDIATE:"Allegretto",LEVEL_ADVANCED:"Allegro",LEVEL_STANDARD:"Vivace"};function q(){return{quotaFetchFailed:!0,message:"Kimi usage temporarily unavailable."}}function r(a,b,c,d){let e=Math.max(0,i(b)),f=Math.max(0,i(a)),g=Math.max(0,i(c,e-f));return{used:f,total:e,remaining:g,remainingPercentage:e>0?Math.min(100,g/e*100):0,resetAt:function(a){if(null==a||""===a)return null;try{if(a instanceof Date)return a.toISOString();if("number"==typeof a||/^\d+$/.test(String(a))){let b=Number(a);return new Date(b<1e12?1e3*b:b).toISOString()}return new Date(a).toISOString()}catch{return null}}(d),unlimited:!1}}async function s(a,b=null){let c="string"==typeof a?.apiKey?a.apiKey.trim():"",f="string"==typeof a?.accessToken?a.accessToken.trim():"";if(!c&&!f)return{message:"Kimi access token or API key not available."};let g=c?{"x-api-key":c}:{Authorization:`Bearer ${f}`,...(0,d.VK)(a?.providerSpecificData?.deviceId)};try{return await l(async a=>{let c,d=await (0,e.proxyAwareFetch)("https://api.kimi.com/coding/v1/usages",{method:"GET",headers:{...g,Accept:"application/json","Content-Type":"application/json"},signal:a},b),f=await d.text().catch(()=>"");if(401===d.status)return{authError:!0,accountDead:!0,message:"Kimi authentication expired. Please re-authorize."};if(403===d.status)return{plan:"Kimi Coding",quotaFetchFailed:!0,usageUnavailable:!0,message:"Kimi connected, but this account has no permission to view usage."};if(402===d.status||429===d.status)return j("Kimi Coding","Kimi credits are exhausted.");if(!d.ok)return q();try{c=JSON.parse(f||"{}")}catch{return q()}let h={},k=c.usage&&"object"==typeof c.usage?c.usage:{},l=i(k.limit??k.Limit);l>0&&(h.Weekly=r(k.used??k.Used,l,k.remaining??k.Remaining,k.resetTime??k.ResetTime??k.reset_at??k.resetAt));let m=(Array.isArray(c.limits)?c.limits:[]).filter(a=>{let b=a?.detail&&"object"==typeof a.detail?a.detail:{};return i(b.limit??b.Limit)>0}),n=new Set;for(let[a,b]of m.entries()){let c=b?.detail&&"object"==typeof b.detail?b.detail:{},d=i(c.limit??c.Limit),e=i(c.remaining??c.Remaining,d);h[function(a,b,c,d){if(1===c)return"Ratelimit";let e=a?.name??a?.type??a?.window??a?.detail?.name??a?.detail?.type??a?.detail?.window,f="string"==typeof e?e.replace(/[^a-zA-Z0-9._ -]/g," ").replace(/\s+/g," ").trim().slice(0,48):"",g=f?`Ratelimit (${f})`:`Ratelimit ${b+1}`,h=g,i=2;for(;d.has(h);)h=`${g} ${i++}`;return d.add(h),h}(b,a,m.length,n)]=r(Math.max(0,d-e),d,e,c.resetTime??c.reset_at??c.resetAt)}let o=c.user?.membership?.level;return{plan:p[o]||(o?String(o).replace(/^LEVEL_/,"").toLowerCase():"Kimi Coding"),quotas:h,authoritative:!0,...0===Object.keys(h).length?{message:"Kimi connected. No usage limits reported."}:{}}},{parentSignal:b?.signal})}catch{return q()}}function t(){return{quotaFetchFailed:!0,message:"DeepSeek balance temporarily unavailable."}}async function u(a,b=null){let c="string"==typeof a?.apiKey?a.apiKey.trim():"";if(!c)return{message:"DeepSeek API key not available. Add a key to view usage."};try{return await l(async a=>{let d=await (0,e.proxyAwareFetch)("https://api.deepseek.com/user/balance",{method:"GET",headers:{Authorization:`Bearer ${c}`,Accept:"application/json","Content-Type":"application/json"},signal:a},b);if(401===d.status||403===d.status)return{authError:!0,accountDead:!0,message:"DeepSeek authentication failed. Check the API key."};if(402===d.status||429===d.status)return j("DeepSeek","DeepSeek balance is exhausted.");if(!d.ok)return t();let f=await d.json().catch(()=>null);if(!f||"object"!=typeof f)return t();let g={};for(let a of Array.isArray(f.balance_infos)?f.balance_infos:[]){if(!a||"object"!=typeof a)continue;let b="string"==typeof a.currency?a.currency.trim().toUpperCase():"";if(!b)continue;let c=Math.max(0,i(a.total_balance??a.totalBalance));g[`Balance (${b})`]={used:0,total:c,remaining:c,remainingPercentage:100*(c>0),resetAt:null,unlimited:!1,unit:b,grantedBalance:Math.max(0,i(a.granted_balance??a.grantedBalance)),toppedUpBalance:Math.max(0,i(a.topped_up_balance??a.toppedUpBalance))}}if(0===Object.keys(g).length)return{plan:"DeepSeek",quotas:g,authoritative:!0,message:"DeepSeek connected. No balance data returned."};let h=!0===f.is_available||!0===f.isAvailable;return{plan:h?"DeepSeek":"DeepSeek (Insufficient Balance)",quotas:g,authoritative:!0,limitReached:!h}},{parentSignal:b?.signal})}catch{return t()}}var v=c(32185),w=c(76394);function x(a,b){let c=Math.max(0,Number(a?.total)||0),d=Math.max(0,Number(a?.used)||0),e=Math.max(0,Number(a?.remaining)||0);return{total:c,used:d,remaining:e,remainingPercentage:c>0?Math.min(100,e/c*100):0,unit:a?.unit||"credits",resetAt:b,unlimited:!1}}function y(){return{quotaFetchFailed:!0,message:"Qoder usage temporarily unavailable."}}async function z(a,b=null){try{return await l(async c=>{let d;try{d=await (0,w.iC)(a,{proxyOptions:b,signal:c})}catch(a){if(a?.status===401||a?.status===403)return{authError:!0,accountDead:!0,message:"Qoder PAT was rejected. Add a valid Personal Access Token."};throw a}if(!d?.accessToken)return{message:"Qoder usage unavailable: no access token"};let f=await (0,e.proxyAwareFetch)(v.x_,{method:"GET",headers:{Authorization:`Bearer ${d.accessToken}`,Accept:"application/json"},signal:c},b);if(401===f.status||403===f.status)return{authError:!0,accountDead:!0,message:"Qoder authentication expired. Reconnect this account."};if(!f.ok)return y();let g=await f.json().catch(()=>null);if(!g||"object"!=typeof g)return y();let h=Number(g.expiresAt),i=Number.isFinite(h)&&h>0?new Date(h).toISOString():null,j={user:x(g.userQuota,i)};return Number(g.orgResourcePackage?.total)>0&&(j.organization=x(g.orgResourcePackage,i)),{quotas:j,totalUsagePercentage:Number(g.totalUsagePercentage)||0,isQuotaExceeded:!0===g.isQuotaExceeded,limitReached:!0===g.isQuotaExceeded,expiresAt:Number.isFinite(h)?h:null,authoritative:!0}},{parentSignal:b?.signal})}catch(a){return y()}}let A={international:"https://api.z.ai/api/monitor/usage/quota/limit",china:"https://open.bigmodel.cn/api/monitor/usage/quota/limit"},B={minimax:["https://www.minimax.io/v1/token_plan/remains","https://api.minimax.io/v1/api/openplatform/coding_plan/remains"],"minimax-cn":["https://www.minimaxi.com/v1/api/openplatform/coding_plan/remains","https://api.minimaxi.com/v1/api/openplatform/coding_plan/remains"]},C={quotaApiHosts:["https://daily-cloudcode-pa.googleapis.com","https://cloudcode-pa.googleapis.com","https://daily-cloudcode-pa.sandbox.googleapis.com"],fetchAvailableModelsPath:"/v1internal:fetchAvailableModels",retrieveUserQuotaPath:"/v1internal:retrieveUserQuota",loadProjectApiUrl:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",tokenUrl:"https://oauth2.googleapis.com/token",clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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",userAgent:(0,d.A9)(),quotaUserAgent:(0,d.P0)()},D=["gemini-3.7-flash-high","gemini-3.7-flash-medium","gemini-3.7-flash-low","gemini-3.6-flash-high","gemini-3.6-flash-medium","gemini-3.6-flash-low","gemini-3-flash-agent","gemini-3.5-flash-low","gemini-3.5-flash-extra-low","gemini-pro-agent","gemini-3.1-pro-low","claude-sonnet-4-6","claude-opus-4-6-thinking","gpt-oss-120b-medium","gemini-3-flash"],E="2023-06-01",F={free:"TCACA_code_001_PqouKr6QWV",proMon:"TCACA_code_002_AkiJS3ZHF5",gift:"TCACA_code_006_DbXS0lrypC",activity:"TCACA_code_007_nzdH5h4Nl0",proYear:"TCACA_code_003_FAnt7lcmRT",freeMon:"TCACA_code_008_cfWoLwvjU4",extra:"TCACA_code_009_0XmEQc2xOf"};async function G(a,b=null){let{provider:c,accessToken:d,apiKey:f,providerSpecificData:g,projectId:i}=a,j={...g||{},...i?{projectId:i}:{}};switch(c){case"github":return await N(d,g,b);case"gemini-cli":return await P(d,j,b);case"antigravity":return await T(d,j,b);case"claude":return await W(d,b);case"codex":return await ab(d,b);case"kiro":return await ac(d,g,b);case"codebuddy":case"codebuddy-cn":return await I(d,g,b,f,c);case"qoder":return await z(a,b);case"autoclaw":return await an(d,b,a);case"qwen":return await ad(d,g);case"iflow":return await ae(d);case"ollama":return await o(a,b);case"kimi":case"kimi-coding":return await s(a,b);case"deepseek":return await u(a,b);case"glm":case"glm-cn":return await af(f,c,b);case"minimax":case"minimax-cn":return await am(f,c,b);case"grok-cli":return await ar(d,g,b);case"cloudflare-ai":return await ao(f||d,g,b);case"xai":return await aw(d||f,g,b);case"cline":case"clinepass":return await au(d||f,c,b);case"kimchi":return await av(d||f,g,b);case"blackbox":return await h(f||d,{fetchImpl:(a,c)=>(0,e.proxyAwareFetch)(a,c,b)});case"cursor":return await ax(d,g);default:return{message:`Usage API not implemented for ${c}`}}}async function H(a,b={},c=null,d="codebuddy"){let f=b?.uid||b?.rawAuth?.uid;if(f)return{uid:f,enterpriseId:b?.enterpriseId||null};let g=b?.domain||b?.rawAuth?.domain||("codebuddy-cn"===d?"www.codebuddy.cn":"www.codebuddy.ai");try{let b=await (0,e.proxyAwareFetch)(`https://${g}/v2/plugin/accounts`,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","X-Domain":g}},c);if(!b.ok)return{uid:null,enterpriseId:null};let d=await b.json(),f=d?.data?.accounts||[],h=f.find(a=>a.lastLogin)||f[0]||{};return{uid:h.uid||null,enterpriseId:h.enterpriseId||null}}catch{return{uid:null,enterpriseId:null}}}async function I(a,b={},c=null,d=null,f="codebuddy"){let g=b?.authMode==="generated-api-key",h=a||d,i=a?"oauth":d?"api-key":null;if(!h)return{plan:"CodeBuddy",message:"CodeBuddy upstream quota is unavailable because no valid IDE OAuth token or API key is stored.",quotas:{},trackingMode:"unavailable"};try{let a,j,{uid:k,enterpriseId:l}=await H(h,b,c,f),m=await (0,e.proxyAwareFetch)(function(a={},b="codebuddy"){let c=a?.domain||a?.rawAuth?.domain||("codebuddy-cn"===b?"www.codebuddy.cn":"www.codebuddy.ai");return`https://${c}/v2/billing/meter/get-user-resource`}(b,f),{method:"POST",headers:function(a,b={},c=null,d=null,e=null){let f={Authorization:`Bearer ${a}`,Accept:"application/json, text/plain, */*","Accept-Language":"zh-CN,zh;q=0.9","Content-Type":"application/json","X-Domain":b?.domain||b?.rawAuth?.domain||"www.codebuddy.ai"};return e&&(f["X-Api-Key"]=e),c&&(f["X-User-Id"]=c),d&&(f["X-Enterprise-Id"]=d,f["X-Tenant-Id"]=d),f}(h,b,k,l,d),body:JSON.stringify((a=new Date,(j=new Date(a)).setFullYear(j.getFullYear()+101),{PageNumber:1,PageSize:200,ProductCode:"p_tcaca",Status:[0,3],PackageEndTimeRangeBegin:K(a),PackageEndTimeRangeEnd:K(j)}))},c),n=await m.text(),o=null;try{o=n?JSON.parse(n):null}catch{o=null}if(401===m.status||403===m.status){if("oauth"===i)return{plan:"CodeBuddy",message:`CodeBuddy IDE OAuth token was rejected (${m.status}). Upstream quota is unavailable; use ZevaiRouter Usage for local request and token tracking.`,quotas:{},authMode:"oauth-rejected",trackingMode:"local-router"};return{plan:"CodeBuddy",message:"CodeBuddy chat key active. Upstream quota is unavailable without a valid IDE OAuth token; use ZevaiRouter Usage for local request and token tracking.",quotas:{},authMode:g?"generated-api-key":"api-key",trackingMode:"local-router"}}if(!m.ok){let a=408===m.status||425===m.status||429===m.status||m.status>=500;return{plan:"CodeBuddy",message:`CodeBuddy quota endpoint returned ${m.status}.`,quotas:{},...a?{quotaFetchFailed:!0}:{}}}return{...function(a){let b=a?.data?.Response?.Data||a?.Response?.Data||a?.data||a||{},c=Array.isArray(b?.Accounts)?b.Accounts:Array.isArray(b?.accounts)?b.accounts:[];if(0===c.length)return{plan:"CodeBuddy",message:"CodeBuddy connected. No quota records were returned.",quotas:{}};let d=a=>{let b=J(a.CycleEndTime);return b?new Date(b).getTime():1/0},e=a=>{let b=d(a),c=Number(a.DeductionEndTime);return Number.isFinite(b)&&Number.isFinite(c)&&c-b>1728e5},f=(a,b)=>d(a)-d(b),g=c.filter(e).sort(f),h=c.filter(a=>!e(a)).sort(f),i={},j=!1,k=(a,b,{recurring:c})=>{var d,e;let f=function(a,{useCycle:b=!0}={}){let c=L(a,"Cycle"),d=function(a,b,c){return c?a||b:a&&b?a.precision!==b.precision?a.precision>b.precision?a:b:Math.abs(a.values.total-b.values.total)>=1e-9||Math.abs(a.values.used-b.values.used)>=1e-9||Math.abs(a.values.remaining-b.values.remaining)>=1e-9?a:b:b||a}(c,L(a,""),b);return d?{...d.values,resetAt:J(a.CycleEndTime||a.DeductionEndTime||a.ExpiredTime)}:null}(b,{useCycle:c});f&&((b.PackageCode===F.proMon||b.PackageCode===F.proYear)&&(j=!0),i[a]||(i[a]={used:0,total:0,remaining:0,resetAt:null,unit:"credits",unlimited:!1,recurring:c}),i[a].used+=f.used,i[a].total+=f.total,i[a].remaining+=f.remaining,i[a].resetAt=(d=i[a].resetAt,e=f.resetAt,d?e&&new Date(e).getTime()<new Date(d).getTime()?e:d:e||null),i[a].recurring=i[a].recurring&&c)};for(let a of g)k("Monthly Credits",a,{recurring:!0});for(let a of h)k("Bonus Credits",a,{recurring:!1});if(h.length>0&&i["Bonus Credits"]&&(i["Bonus Credits"].packCount=h.length),0===Object.keys(i).length)for(let a of c){if(!a||"object"!=typeof a)continue;let b=function(a){switch(a){case F.free:case F.freeMon:case F.proMon:case F.proYear:return"Monthly Credits";case F.gift:return"Gift Credits";case F.extra:return"Extra Credits";case F.activity:return"Activity Credits";default:return a?"Other Credits":null}}(a.PackageCode)||"Other Credits",c="Activity Credits"!==b&&"Gift Credits"!==b;k(c?"Monthly Credits":"Bonus Credits",a,{recurring:c})}if(0===Object.keys(i).length)return{plan:j?"Pro":"Free",message:"CodeBuddy connected. Unable to extract quota values.",quotas:{}};for(let a of Object.values(i))a.remainingPercentage=a.total>0?Math.max(0,Math.min(100,a.remaining/a.total*100)):0;return{plan:j?"Pro":"Free",quotas:i}}(o),authMode:i}}catch(a){return{plan:"CodeBuddy",message:`CodeBuddy connected. Unable to fetch quota: ${a.message}`,quotas:{},quotaFetchFailed:!0}}}function J(a){if(!a)return null;try{if(a instanceof Date)return a.toISOString();if("number"==typeof a)return new Date(a<1e12?1e3*a:a).toISOString();if("string"==typeof a){if(/^\d+$/.test(a)){let b=Number(a);return new Date(b<1e12?1e3*b:b).toISOString()}return new Date(a).toISOString()}return null}catch(b){return console.warn(`Failed to parse reset time: ${a}`,b),null}}function K(a){let b=a=>String(a).padStart(2,"0");return`${a.getFullYear()}-${b(a.getMonth()+1)}-${b(a.getDate())} ${b(a.getHours())}:${b(a.getMinutes())}:${b(a.getSeconds())}`}function L(a,b){let c=M(a[`${b}CapacitySizePrecise`]),d=c??M(a[`${b}CapacitySize`]),e=M(a[`${b}CapacityUsedPrecise`]),f=M(a[`${b}CapacityRemainPrecise`]),g=e??(null===f?M(a[`${b}CapacityUsed`]):null),h=f??M(a[`${b}CapacityRemain`]);if(null===d||null===g&&null===h)return null;let i=Math.max(0,d),j=null!==g?Math.min(i,Math.max(0,g)):Math.max(0,i-Math.min(i,Math.max(0,h))),k=Math.max(0,i-j),l=null===h?null:Math.min(i,Math.max(0,h)),m=null!==l&&1e-9>Math.abs(j+l-i)?l:k;return{values:{total:i,used:j,remaining:m},precision:+(null!==c)+2*(null!==e||null!==f)}}function M(...a){for(let b of a){if(null==b||""===b)continue;let a=Number(b);if(Number.isFinite(a))return a}return null}async function N(a,b,c=null){try{if(!a)throw Error("No GitHub access token available. Please re-authorize the connection.");let b=await (0,e.proxyAwareFetch)("https://api.github.com/copilot_internal/user",{headers:{Authorization:`token ${a}`,Accept:"application/json","X-GitHub-Api-Version":"2022-11-28","User-Agent":"GitHubCopilotChat/0.26.7","Editor-Version":"vscode/1.100.0","Editor-Plugin-Version":"copilot-chat/0.26.7"}},c);if(!b.ok){let a=await b.text();throw Error(`GitHub API error: ${a}`)}let d=await b.json();if(d.quota_snapshots){let a=d.quota_snapshots,b=J(d.quota_reset_date);return{plan:d.copilot_plan,resetDate:d.quota_reset_date,quotas:{chat:{...O(a.chat),resetAt:b},completions:{...O(a.completions),resetAt:b},premium_interactions:{...O(a.premium_interactions),resetAt:b}}}}if(d.monthly_quotas||d.limited_user_quotas){let a=d.monthly_quotas||{},b=d.limited_user_quotas||{},c=J(d.limited_user_reset_date);return{plan:d.copilot_plan||d.access_type_sku,resetDate:d.limited_user_reset_date,quotas:{chat:{used:b.chat||0,total:a.chat||0,unlimited:!1,resetAt:c},completions:{used:b.completions||0,total:a.completions||0,unlimited:!1,resetAt:c}}}}return{message:"GitHub Copilot connected. Unable to parse quota data."}}catch(a){throw Error(`Failed to fetch GitHub usage: ${a.message}`)}}function O(a){return a?{used:a.entitlement-a.remaining,total:a.entitlement,remaining:a.remaining,unlimited:a.unlimited||!1}:{used:0,total:0,unlimited:!0}}async function P(a,b,c=null){if(!a)return{plan:"Free",message:"Gemini CLI access token not available."};try{let d,f=Q(b?.projectId),g="Free";if(!f){let b=await R(a,c);f=Q(b?.cloudaicompanionProject),g=b?.currentTier?.name||g}if(!f)return{plan:g,message:"Gemini CLI project ID not available. Reconnect Gemini CLI, or configure a Google Cloud project with Gemini Code Assist access before checking quota."};let h=new AbortController,i=setTimeout(()=>h.abort(),1e4);try{d=await (0,e.proxyAwareFetch)("https://cloudcode-pa.googleapis.com/v1internal:retrieveUserQuota",{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify({project:f}),signal:h.signal},c)}finally{clearTimeout(i)}if(!d.ok)return{plan:g,message:`Gemini CLI quota error (${d.status}).`};let j=await d.json(),k={};if(Array.isArray(j.buckets))for(let a of j.buckets){if(!a.modelId||null==a.remainingFraction)continue;let b=Number(a.remainingFraction)||0,c=Math.round(1e3*b),d=Math.max(0,1e3-c);k[a.modelId]={used:d,total:1e3,resetAt:J(a.resetTime),remainingPercentage:100*b,unlimited:!1}}return{plan:g,quotas:k}}catch(a){return{message:`Gemini CLI error: ${a.message}`}}}function Q(a){return"string"==typeof a?a.trim()||null:a&&"object"==typeof a&&"string"==typeof a.id&&a.id.trim()||null}async function R(a,b=null){let c=new AbortController,f=setTimeout(()=>c.abort(),1e4);try{let f=await (0,e.proxyAwareFetch)("https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify({metadata:d.Cn}),signal:c.signal},b);if(!f.ok)return null;return await f.json()}catch{return null}finally{clearTimeout(f)}}async function S(a,b,c,d){let f=null;for(let g of C.quotaApiHosts){let h=new AbortController,i=setTimeout(()=>h.abort(),1e4);try{let i=await (0,e.proxyAwareFetch)(`${g}${a}`,{method:"POST",headers:{Authorization:`Bearer ${b}`,"User-Agent":C.quotaUserAgent,"Content-Type":"application/json","x-request-source":"local"},body:JSON.stringify(c||{}),signal:h.signal},d);if(i.ok||401===i.status||403===i.status)return{response:i,host:g};f=Error(`Antigravity API error: ${i.status}`)}catch(a){f=a}finally{clearTimeout(i)}}if(f)throw f;throw Error("Antigravity API unavailable")}async function T(a,b,c=null){try{let d,e=Q(b?.projectId),f=await V(a,c),g=e||Q(f?.cloudaicompanionProject);try{d=await S(C.fetchAvailableModelsPath,a,g?{project:g}:{},c)}catch(a){return{message:`Antigravity quota unavailable: ${a.message}. Chat may still work.`}}let h=d.response;if(401===h.status){let a=await U(b,c);if(a)return{accountDead:!0,message:`Antigravity account ${a}. Reconnect won't help \u2014 recreate the account.`,quotas:{}};return{message:"Antigravity quota API authentication expired. Chat may still work.",quotas:{}}}if(403===h.status)return{message:"Antigravity quota API access forbidden (tier may not expose quota). Chat may still work.",quotas:{}};if(!h.ok)throw Error(`Antigravity API error: ${h.status}`);let i=await h.json(),j=new Map;try{let b=await S(C.retrieveUserQuotaPath,a,g?{project:g}:{},c);if(b.response.ok){let a=await b.response.json();if(Array.isArray(a.buckets))for(let b of a.buckets){let a=String(b.modelId||"").trim();a&&j.set(a,b)}}}catch{}let k={};if(i.models)for(let[a,b]of Object.entries(i.models)){if(b.isInternal||!D.includes(a))continue;let c=j.get(a),d=c||b.quotaInfo;if(!d)continue;let e=Number(d.remainingFraction)||0,f=100*e,g=Math.round(1e3*e),h=Math.max(0,1e3-g);k[a]={used:h,total:1e3,resetAt:J(d.resetTime),remainingPercentage:f,unlimited:!1,displayName:b.displayName||a,quotaSource:c?"retrieveUserQuota":"fetchAvailableModels"}}return{plan:f?.currentTier?.name||"Unknown",quotas:k,subscriptionInfo:f}}catch(a){return console.error("[Antigravity Usage] Error:",a.message,a.cause),{message:`Antigravity error: ${a.message}`}}}async function U(a,b=null){let c=a?.refreshToken;if(!c)return null;try{let a,d=new AbortController,f=setTimeout(()=>d.abort(),1e4);try{a=await (0,e.proxyAwareFetch)(C.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:C.clientId,client_secret:C.clientSecret,refresh_token:c,grant_type:"refresh_token"}),signal:d.signal},b)}finally{clearTimeout(f)}if(a.ok)return null;let g=await a.json().catch(()=>({}));if("invalid_grant"===g.error){let a=(g.error_description||"").toLowerCase();if(a.includes("deleted"))return"has been deleted";if(a.includes("disabled")||a.includes("suspend"))return"is disabled/suspended";return"authorization was revoked"}return null}catch{return null}}async function V(a,b=null){let c=new AbortController,f=setTimeout(()=>c.abort(),1e4);try{let f=await (0,e.proxyAwareFetch)(C.loadProjectApiUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,"User-Agent":C.userAgent,"Content-Type":"application/json","x-request-source":"local"},body:JSON.stringify({metadata:d.Cn,mode:1}),signal:c.signal},b);if(!f.ok)return null;return await f.json()}catch(a){return console.error("[Antigravity Subscription] Error:",a.message),null}finally{clearTimeout(f)}}async function W(a,b=null){try{let c=await (0,e.proxyAwareFetch)("https://api.anthropic.com/api/oauth/usage",{method:"GET",headers:{Authorization:`Bearer ${a}`,"anthropic-beta":"oauth-2025-04-20","anthropic-version":E}},b);if(c.ok){let a=await c.json(),b={},d=a=>a&&"object"==typeof a&&"number"==typeof a.utilization,e=a=>{let b=a.utilization,c=Math.max(0,100-b);return{used:b,total:100,remaining:c,remainingPercentage:c,resetAt:J(a.resets_at),unlimited:!1}};for(let[c,f]of(d(a.five_hour)&&(b["session (5h)"]=e(a.five_hour)),d(a.seven_day)&&(b["weekly (7d)"]=e(a.seven_day)),Object.entries(a)))if(c.startsWith("seven_day_")&&"seven_day"!==c&&d(f)){let a=c.replace("seven_day_","");b[`weekly ${a} (7d)`]=e(f)}return{plan:"Claude Code",extraUsage:a.extra_usage??null,quotas:b}}return console.warn(`[Claude Usage] OAuth endpoint returned ${c.status}, falling back to legacy`),await X(a,b)}catch(a){return{message:`Claude connected. Unable to fetch usage: ${a.message}`}}}async function X(a,b=null){try{let c=await (0,e.proxyAwareFetch)("https://api.anthropic.com/v1/settings",{method:"GET",headers:{Authorization:`Bearer ${a}`,"anthropic-version":E}},b);if(c.ok){let d=await c.json();if(d.organization_id){let c=await (0,e.proxyAwareFetch)("https://api.anthropic.com/v1/organizations/{org_id}/usage".replace("{org_id}",d.organization_id),{method:"GET",headers:{Authorization:`Bearer ${a}`,"anthropic-version":E}},b);if(c.ok){let a=await c.json();return{plan:d.plan||"Unknown",organization:d.organization_name,quotas:a}}}return{plan:d.plan||"Unknown",organization:d.organization_name,message:"Claude connected. Usage details require admin access."}}return{message:"Claude connected. Usage API requires admin permissions."}}catch(a){return{message:`Claude connected. Unable to fetch usage: ${a.message}`}}}function Y(a,b=0){if("number"==typeof a&&Number.isFinite(a))return a;if("string"==typeof a&&a.trim()){let b=Number(a);if(Number.isFinite(b))return b}return b}function Z(a){return!a||"object"!=typeof a||Array.isArray(a)?null:a.rate_limit&&"object"==typeof a.rate_limit?a.rate_limit:a}function $(a,b){let c=Y(a?.limit_window_seconds??a?.limitWindowSeconds??a?.window_seconds??a?.windowSeconds,null);return null===c||c<=0?b:c<=86400?"session":c<=1209600?"weekly":c<=3888e3?"monthly":b}function _(a){let b=Math.max(0,Math.min(100,Y(a?.used_percent??a?.percent_used,0)));return{used:b,total:100,remaining:Math.max(0,100-b),resetAt:J(a?.reset_at??a?.resets_at??a?.resetAt??null),unlimited:!1}}function aa(a,b,c){let d=Z(c);if(!d)return!1;let e=d.primary_window||d.primary||c.primary_window||c.primary,f=d.secondary_window||d.secondary||c.secondary_window||c.secondary,g=!1;if(e){let c=$(e,"session");a[b?`${b}_${c}`:c]=_(e),g=!0}if(f){let c=$(f,"weekly");a[b?`${b}_${c}`:c]=_(f),g=!0}return g}async function ab(a,b=null){try{let c=await (0,e.proxyAwareFetch)("https://chatgpt.com/backend-api/wham/usage",{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},b);if(!c.ok)return{message:`Codex connected. Usage API temporarily unavailable (${c.status}).`};let d=await c.json(),f=d.rate_limit||d.rate_limits||d.rate_limits_by_limit_id?.codex||{},g=function(a){if(a.code_review_rate_limit||a.review_rate_limit)return a.code_review_rate_limit||a.review_rate_limit;let b=a.rate_limits_by_limit_id;return b&&"object"==typeof b&&!Array.isArray(b)?b.code_review||b.codex_review||b.review||null:(Array.isArray(a.additional_rate_limits)?a.additional_rate_limits:[]).find(a=>{let b=String(a?.limit_name||a?.metered_feature||a?.id||"").toLowerCase();return"code_review"===b||"codex_review"===b||"review"===b||b.includes("review")})||null}(d),h=Math.max(0,Y(d.rate_limit_reset_credits?.available_count,0)),i={};return aa(i,"",f),aa(i,"review",g),{plan:d.plan_type||d.summary?.plan||"unknown",limitReached:Z(f)?.limit_reached||!1,reviewLimitReached:Z(g)?.limit_reached||!1,resetCredits:{availableCount:h},quotas:i}}catch(a){throw Error(`Failed to fetch Codex usage: ${a.message}`)}}async function ac(a,b,c=null){let d=b?.authMethod||"builder-id",f="api_key"===d,g={...f?{tokentype:"API_KEY"}:{},..."external_idp"===d?{TokenType:"EXTERNAL_IDP"}:{}},h=f?b?.profileArn||"":b?.profileArn||"arn:aws:codewhisperer:us-east-1:638616132270:profile/AAAACCCCXXXX",i=new URLSearchParams({isEmailRequired:"true",origin:"AI_EDITOR",resourceType:"AGENTIC_REQUEST"}),j=!1,k=[];for(let b of[{name:"codewhisperer-get",run:async()=>(0,e.proxyAwareFetch)(`https://codewhisperer.us-east-1.amazonaws.com/getUsageLimits?${i.toString()}`,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","x-amz-user-agent":"aws-sdk-js/1.0.0 KiroIDE-1.0.138","user-agent":"aws-sdk-js/1.0.0 KiroIDE-1.0.138",...g}},c)},{name:"codewhisperer-post",run:async()=>(0,e.proxyAwareFetch)("https://codewhisperer.us-east-1.amazonaws.com",{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/x-amz-json-1.0","x-amz-target":"AmazonCodeWhispererService.GetUsageLimits",Accept:"application/json",...g},body:JSON.stringify({origin:"AI_EDITOR",...h?{profileArn:h}:{},resourceType:"AGENTIC_REQUEST"})},c)},{name:"q-get",run:async()=>{let b=new URLSearchParams({origin:"AI_EDITOR",...h?{profileArn:h}:{},resourceType:"AGENTIC_REQUEST"});return(0,e.proxyAwareFetch)(`https://q.us-east-1.amazonaws.com/getUsageLimits?${b}`,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json",...g}},c)}}])try{let a=await b.run();if(!a.ok){let c=await a.text().catch(()=>"");(401===a.status||403===a.status)&&(j=!0),k.push(`${b.name}:${a.status}${c?`:${c}`:""}`);continue}let c=await a.json();return function(a){let b=a.usageBreakdownList||[],c={},d=J(a.nextDateReset||a.resetDate);return b.forEach(a=>{let b=a.resourceType?.toLowerCase()||"unknown",e=a.currentUsageWithPrecision||0,f=a.usageLimitWithPrecision||0;if(c[b]={used:e,total:f,remaining:f-e,resetAt:d,unlimited:!1},a.freeTrialInfo){let e=a.freeTrialInfo.currentUsageWithPrecision||0,f=a.freeTrialInfo.usageLimitWithPrecision||0;c[`${b}_freetrial`]={used:e,total:f,remaining:f-e,resetAt:J(a.freeTrialInfo.freeTrialExpiry||d),unlimited:!1}}}),{plan:a.subscriptionInfo?.subscriptionTitle||"Kiro",quotas:c}}(c)}catch(a){k.push(`${b.name}:${a.message}`)}return j&&"idc"===d?{message:"Kiro quota API is unavailable for the current AWS IAM Identity Center session. Chat may still work. If this persists after renewing your session, reconnect Kiro.",quotas:{}}:j&&("google"===d||"github"===d)?{message:"Kiro quota API authentication expired. Chat may still work.",quotas:{}}:j?{message:"Kiro quota API rejected the current token. Chat may still work.",quotas:{}}:{message:k.length>0?`Unable to fetch Kiro usage right now. (${k[k.length-1]})`:"Unable to fetch Kiro usage right now.",quotas:{}}}async function ad(a,b){try{if(!b?.resourceUrl)return{message:"Qwen connected. No resource URL available."};return{message:"Qwen connected. Usage tracked per request."}}catch(a){return{message:"Unable to fetch Qwen usage."}}}async function ae(a){try{return{message:"iFlow connected. Usage tracked per request."}}catch(a){return{message:"Unable to fetch iFlow usage."}}}async function af(a,b,c=null){if(!a)return{message:"GLM API key not available."};let d=A["glm-cn"===b?"china":"international"];try{let b=await (0,e.proxyAwareFetch)(d,{headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},c);if(!b.ok){if(401===b.status)return{message:"GLM API key invalid or expired."};return{message:`GLM quota API error (${b.status}).`}}let f=await b.json(),g=f?.data&&"object"==typeof f.data?f.data:{},h=Array.isArray(g.limits)?g.limits:[],i={};for(let a of h){if(!a||"TOKENS_LIMIT"!==a.type)continue;let b=Number(a.percentage)||0,c=Number(a.nextResetTime)||0,d=Math.max(0,100-b);i.session={used:b,total:100,remaining:d,remainingPercentage:d,resetAt:c>0?new Date(c).toISOString():null,unlimited:!1}}let j="string"==typeof g.level?g.level:"";return{plan:j?j.charAt(0).toUpperCase()+j.slice(1).toLowerCase():"Unknown",quotas:i}}catch(a){return{message:`GLM error: ${a.message}`}}}function ag(a,b,c){return a&&"object"==typeof a?a[b]??a[c]??null:null}function ah(a,b,c){if(!a||"object"!=typeof a)return null;let d=a[b]??a[c];if(null==d)return null;let e=Number(d);return Number.isFinite(e)?Math.max(0,Math.min(100,e)):null}function ai(a){return Math.max(0,Number(ag(a,"current_interval_total_count","currentIntervalTotalCount"))||0)}function aj(a){return Math.max(0,Number(ag(a,"current_weekly_total_count","currentWeeklyTotalCount"))||0)}function ak(a){return!!(ai(a)>0||aj(a)>0)||null!==ah(a,"current_interval_remaining_percent","currentIntervalRemainingPercent")||null!==ah(a,"current_weekly_remaining_percent","currentWeeklyRemainingPercent")}function al(a,b,c,d,e,f,g,h,i,j){let k=d(c),l=ah(c,g,h);if(k<=0&&null===l)return;let m=Math.max(0,Number(ag(c,e,f))||0),n=k,o=m;k<=0&&(n=100,o=j?Math.round(l/100*n):Math.round(n*(1-l/100))),a[b]=function(a,b,c,d,e=null){var f,g,h;let i=Math.max(0,a),j=d?Math.max(i-b,0):Math.min(Math.max(0,b),i),k=Math.max(i-j,0),l=(f=e,g=k,h=i,null!=f&&Number.isFinite(f)?Math.max(0,Math.min(100,f)):h>0?Math.max(0,Math.min(100,g/h*100)):0);return{used:j,total:i,remaining:k,remainingPercentage:l,resetAt:c,unlimited:!1}}(n,o,function(a,b,c,d,e,f){let g=Number(ag(a,c,d))||0;return g>0?new Date(b+g).toISOString():J(ag(a,e,f))}(c,...i),j,l)}async function am(a,b,c=null){if(!a)return{message:"MiniMax API key not available."};let d=B[b]||[],f="";for(let b=0;b<d.length;b+=1){let g=d[b],h=b<d.length-1;try{let b=await (0,e.proxyAwareFetch)(g,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","Content-Type":"application/json"}},c),d=await b.text(),i={};if(d)try{i=JSON.parse(d)}catch{i={}}let j=(i?.base_resp??i?.baseResp)||{},k=Number(j.status_code??j.statusCode)||0,l=String(j.status_msg??j.statusMsg??"").trim(),m=`${l} ${d}`.trim(),n=/token plan|coding plan|invalid api key|invalid key|unauthorized|inactive/i;if(401===b.status||403===b.status||1004===k||n.test(m))return{message:"MiniMax API key invalid or inactive. Use an active Token/Coding Plan key."};if(!b.ok){if(f=`MiniMax usage endpoint error (${b.status})`,(404===b.status||405===b.status||b.status>=500)&&h)continue;return{message:`MiniMax connected. ${f}`}}if(0!==k)return{message:`MiniMax connected. ${l||"Upstream quota API error"}`};let o=i?.model_remains??i?.modelRemains,p=(Array.isArray(o)?o:[]).filter(ak);if(0===p.length)return{message:"MiniMax connected. No quota data was returned."};let q=Date.now(),r=g.includes("/coding_plan/remains"),s={};for(let a of p){let b=function(a){let b=String(ag(a,"model_name","modelName")||"").trim();return b?"MiniMax-M*"===b||"general"===b?"M-series":b.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,a=>a.toUpperCase()).replace(/\bTo\b/g,"to").replace(/\bTts\b/g,"TTS").replace(/\bHd\b/g,"HD"):"MiniMax"}(a);al(s,`${b} (5h)`,a,ai,"current_interval_usage_count","currentIntervalUsageCount","current_interval_remaining_percent","currentIntervalRemainingPercent",[q,"remains_time","remainsTime","end_time","endTime"],r),al(s,`${b} (7d)`,a,aj,"current_weekly_usage_count","currentWeeklyUsageCount","current_weekly_remaining_percent","currentWeeklyRemainingPercent",[q,"weekly_remains_time","weeklyRemainsTime","weekly_end_time","weeklyEndTime"],r)}if(0===Object.keys(s).length)return{message:"MiniMax connected. Unable to extract quota usage."};return{quotas:s}}catch(a){if(f=a.message,!h)break}}return{message:f?`MiniMax connected. Unable to fetch usage: ${f}`:"MiniMax connected. Unable to fetch usage."}}async function an(a,b=null,d=null){if(!a)return{message:"AutoClaw usage unavailable: no access token"};try{let{AUTOCLAW_WALLET_ENDPOINT:f,buildAutoClawWalletHeaders:g}=await Promise.resolve().then(c.bind(c,73952)),h=await (0,e.proxyAwareFetch)(f,{method:"GET",headers:g(a)},b);if(!h.ok)return{message:`AutoClaw connected. Usage fetch returned ${h.status}.`};let i=await h.json().catch(()=>null);if(!i||0!==i.code)return{message:"AutoClaw connected. Unable to read balance."};let j=Number(i.data?.total_balance),k=Number.isFinite(j)?j:0,l=k;try{if(d?.id){let{getQuotaSnapshot:a}=await Promise.resolve().then(c.bind(c,70321)),b=await a(d.id),e=Number(b?.usage?.quotas?.points?.total)||0,f=Number(b?.usage?.quotas?.points?.remaining);l=Math.max(e,k,Number.isFinite(f)?f:0)}}catch{}let m=Math.max(0,l-k);return{quotas:{points:{total:l,used:m,remaining:k,unit:"points",resetAt:null}},totalUsagePercentage:l>0?Math.round(m/l*100):0,isQuotaExceeded:k<=0}}catch(a){return{message:`AutoClaw connected. Unable to fetch balance: ${a.message}`}}}async function ao(a,b=null,c=null){let d=String(a||"").trim(),f=String(b?.accountId||"").trim();if(!d)return{message:"Cloudflare API token not available."};if(!f)return{message:"Cloudflare account ID missing. Re-import or edit the connection."};try{let a=await (0,e.proxyAwareFetch)("https://api.cloudflare.com/client/v4/user/tokens/verify",{method:"GET",headers:{Authorization:`Bearer ${d}`,Accept:"application/json"}},c);if(401===a.status||403===a.status)return{message:"Cloudflare API token invalid or expired. Re-import the account."};if(!a.ok){let b=await a.text().catch(()=>"");return{message:`Cloudflare token verify failed (${a.status})${b?`: ${b.slice(0,160)}`:""}`}}let g=await a.json().catch(()=>null),h=g?.result?.status||(g?.success?"active":"unknown"),i=b?.accountName||"";try{let a=await (0,e.proxyAwareFetch)(`https://api.cloudflare.com/client/v4/accounts/${encodeURIComponent(f)}`,{method:"GET",headers:{Authorization:`Bearer ${d}`,Accept:"application/json"}},c);if(a?.ok){let b=await a.json().catch(()=>null);i=b?.result?.name||i}}catch{}let j=f.length>10?`${f.slice(0,8)}…`:f;return{plan:i?`Workers AI \xb7 ${i}`:`Workers AI \xb7 ${j}`,quotas:{"Workers AI":{used:0,total:0,remainingPercentage:100,resetAt:null,unlimited:!0}},message:h&&"active"!==h?`Token status: ${h}. Cloudflare does not publish remaining free-tier neurons via API.`:"Token valid. CF does not expose remaining free-tier neurons via API — model rate limits still apply."}}catch(a){return{message:`Cloudflare usage error: ${a.message}`}}}function ap(a,b=0){return null==a?b:"object"==typeof a&&!Array.isArray(a)&&"val"in a?Y(a.val,b):Y(a,b)}function aq({used:a,total:b,resetAt:c,unlimited:d=!1}){let e=Math.max(0,Y(b,0)),f=Math.max(0,Y(a,0));if(d||0===e)return{used:f,total:0,remainingPercentage:100*!!d,resetAt:c||null,unlimited:!0};let g=Math.max(0,e-f);return{used:f,total:e,remainingPercentage:g/e*100,resetAt:c||null,unlimited:!1}}async function ar(a,b=null,c=null){if(!a)return{message:"Grok CLI access token not available."};let d=function(a,b={}){let c=b||{},d={Authorization:`Bearer ${a}`,Accept:"application/json","User-Agent":"grok-pager/0.2.93 grok-shell/0.2.93 (linux; x86_64)","x-xai-token-auth":"xai-grok-cli","x-grok-client-identifier":"grok-pager","x-grok-client-version":"0.2.93"},e=c.email,f=c.userId||c.principalId;return e&&(d["x-email"]=e),f&&(d["x-userid"]=f),d}(a,b);try{let[a,b]=await Promise.all([(0,e.proxyAwareFetch)("https://cli-chat-proxy.grok.com/v1/billing?format=credits",{method:"GET",headers:d},c),(0,e.proxyAwareFetch)("https://cli-chat-proxy.grok.com/v1/user?include=subscription",{method:"GET",headers:d},c).catch(()=>null)]);if(401===a.status||403===a.status)return{message:"Grok CLI authentication expired. Please re-authorize."};if(!a.ok){let b=await a.text().catch(()=>""),c=b?`: ${b.slice(0,200)}`:"";return{message:`Grok CLI billing API error (${a.status})${c}`}}let f=await a.json().catch(()=>null);if(!f||"object"!=typeof f)return{message:"Grok CLI billing response was not JSON."};let g=null;b?.ok&&(g=await b.json().catch(()=>null));let h=function(a,b=null){let c,d=a&&"object"==typeof a?a:{},e=d.config&&"object"==typeof d.config&&!Array.isArray(d.config)?d.config:d,f=J(e.billingPeriodEnd)||J(e.currentPeriod?.end)||J(d.billingPeriodEnd)||null,g={},h=ap(e.onDemandCap??d.onDemandCap,NaN),i=ap(e.onDemandUsed??d.onDemandUsed,NaN);if(Number.isFinite(h)&&h>0){let a=Number.isFinite(i)?Math.max(0,i):0;g["On-demand"]=aq({used:a,total:h,resetAt:f})}let j=ap(e.monthlyLimit??d.monthlyLimit,NaN),k=ap(e.used??d.used,NaN);Number.isFinite(j)&&j>0&&(g.Monthly=aq({used:Number.isFinite(k)?Math.max(0,k):0,total:j,resetAt:f}));let l=ap(e.prepaidBalance??d.prepaidBalance,NaN);return Number.isFinite(l)&&l>0&&(g.Prepaid={used:0,total:l,remainingPercentage:100,resetAt:null,unlimited:!1}),(b?.hasGrokCodeAccess===!0||e?.isUnifiedBillingUser===!0)&&(g["Grok Code"]={used:0,total:0,remainingPercentage:100,resetAt:f,unlimited:!0}),0===Object.keys(g).length&&(g.Included={used:0,total:0,remainingPercentage:100,resetAt:f,unlimited:!0}),{plan:(c="string"==typeof b?.subscriptionTier?b.subscriptionTier.trim():"")?c.replace(/[_-]+/g," ").replace(/\b\w/g,a=>a.toUpperCase()):b?.hasGrokCodeAccess===!0?"Grok Code":(e?.isUnifiedBillingUser,"Grok Build"),quotas:g,periodEnd:f}}(f,g);if(!h.quotas||0===Object.keys(h.quotas).length)return{plan:h.plan,message:"Grok Build connected, but no credit allotment was returned. Free promo may be exhausted — upgrade at https://grok.com/supergrok or add credits at https://grok.com/?_s=usage.",quotas:{}};return{plan:h.plan,quotas:h.quotas}}catch(a){return{message:`Grok CLI usage error: ${a.message}`}}}function as(a,b=0,c=""){if(!a||"object"!=typeof a||b>4)return null;let d=[];for(let[e,f]of Object.entries(a)){let a=e.toLowerCase();if(f&&"object"==typeof f&&!Array.isArray(f)){let a=as(f,b+1,c?`${c}.${e}`:e);a&&d.push(a);continue}if("number"!=typeof f&&"string"!=typeof f)continue;let g=Y(f,NaN);Number.isFinite(g)&&/(remaining|balance|credit|quota|limit|allowance|cap|used|spent|consumed)/i.test(a)&&d.push({key:c?`${c}.${e}`:e,name:e,value:g,kind:a})}return d.length?d:null}function at(a){if(!a?.length)return null;let b=b=>a.find(a=>b.test(a.kind)||b.test(a.name)),c=b(/remaining|balance|credit(?!s_used)/i),d=b(/limit|cap|allowance|total|quota(?!_used)/i),e=b(/used|spent|consumed/i);if(d&&Number(d.value)>0){let a=e?Math.max(0,Number(e.value)):c?Math.max(0,Number(d.value)-Number(c.value)):0,b=Math.max(0,Number(d.value)-a);return{used:a,total:Number(d.value),remainingPercentage:b/Number(d.value)*100,resetAt:null,unlimited:!1}}if(c&&Number(c.value)>=0){let a=Number(c.value);return{used:0,total:a>0?a:1,remainingPercentage:100*(a>0),resetAt:null,unlimited:!1}}return null}async function au(a,b="cline",d=null){if(!a)return{message:"Cline access token not available."};try{let{buildClineHeaders:f}=await Promise.resolve().then(c.bind(c,43469)),g=f(a,{Accept:"application/json"}),h=await (0,e.proxyAwareFetch)("https://api.cline.bot/api/v1/users/me",{method:"GET",headers:g},d);if(401===h.status||403===h.status)return{message:"Cline authentication expired. Please re-authorize."};if(!h.ok)return{message:`Cline user API error (${h.status})`};let i=await h.json().catch(()=>null);if(!i||"object"!=typeof i)return{message:"Cline user response was not JSON."};let j=i.data&&"object"==typeof i.data?i.data:i,k=j.email||j.user?.email||null,l=j.plan||j.subscription?.plan||j.subscription?.name||j.organization?.plan||j.organizations?.[0]?.plan||("clinepass"===b?"ClinePass":"Cline"),m=as(j)||[],n=at(m),o={};n&&(o.Credits=n);let p=j.organizations||j.organization;if(!Object.keys(o).length&&p&&(o.Account={used:0,total:0,remainingPercentage:100,resetAt:null,unlimited:!0}),!Object.keys(o).length)return{plan:"string"==typeof l?l:"Cline",email:k,message:"Cline connected. No credit allotment was returned by the account API.",quotas:{}};return{plan:"string"==typeof l?l:"Cline",email:k,quotas:o}}catch(a){return{message:`Cline usage error: ${a.message}`}}}async function av(a,b=null,c=null){if(!a)return{message:"Kimchi access token not available."};try{let d=await (0,e.proxyAwareFetch)("https://app.kimchi.dev/api/v1/me",{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${a}`,"User-Agent":"kimchi/0.1.50"}},c);if(401===d.status||403===d.status)return{message:"Kimchi authentication expired. Please re-authorize."};if(!d.ok)return{message:`Kimchi user API error (${d.status})`};let f=await d.json().catch(()=>null);if(!f||"object"!=typeof f)return{message:"Kimchi user response was not JSON."};let g=f.email||b?.username||null,h=f.plan||f.tier||f.subscription?.name||"Kimchi",i=as(f)||[],j=at(i),k={};return j?k.Credits=j:k.Account={used:0,total:0,remainingPercentage:100,resetAt:null,unlimited:!0},{plan:"string"==typeof h?h:"Kimchi",email:g,quotas:k}}catch(a){return{message:`Kimchi usage error: ${a.message}`}}}async function aw(a,b=null,c=null){if(!a)return{message:"xAI token not available."};try{let d={Authorization:`Bearer ${a}`,Accept:"application/json"},f=0,g=null,h=null;for(let a of["https://api.x.ai/v1/api-key","https://api.x.ai/v1/models"]){let b=await (0,e.proxyAwareFetch)(a,{method:"GET",headers:d},c);if(f=b.status,401===b.status||403===b.status)return{message:"xAI authentication expired. Please re-authorize or update the API key."};if(b.ok){g=await b.json().catch(()=>null),h=a;break}}if(!g)return{message:`xAI API error (${f||"unknown"})`};let i=as(g)||[],j=at(i),k={};j?k.Credits=j:(Array.isArray(g?.data)&&g.data.length,k.API={used:0,total:0,remainingPercentage:100,resetAt:null,unlimited:!0});let l=b?.email||null,m=g.name||g.api_key_name||g.team?.name||(h?.includes("api-key")?"xAI API Key":"xAI");return{plan:"string"==typeof m?m:"xAI",email:l,quotas:k}}catch(a){return{message:`xAI usage error: ${a.message}`}}}async function ax(a,b=null){if(!a)return{message:"Cursor access token not available."};let c=b?.plan||b?.membershipType||"Cursor",d=b?.email||null;try{let b=String(a).split(".");if(3===b.length){let a=b[1].replace(/-/g,"+").replace(/_/g,"/"),e=a+"=".repeat((4-a.length%4)%4),f=JSON.parse(Buffer.from(e,"base64").toString("utf8"));d=d||f.email||f.preferred_username||null,c=f.plan||f.subscription||f.membershipType||f.tier||c}}catch{}return{plan:"string"==typeof c?c:"Cursor",email:d,quotas:{Session:{used:0,total:0,remainingPercentage:100,resetAt:null,unlimited:!0}}}}},95095:(a,b,c)=>{"use strict";let d=c(7344),e=c(31825);class f extends d{#bW=null;#bX=null;constructor(a,b={}){super(b),this.#bW=a,this.#bX=b}dispatch(a,b){let c=new e({...a,retryOptions:this.#bX},{dispatch:this.#bW.dispatch.bind(this.#bW),handler:b});return this.#bW.dispatch(a,c)}close(){return this.#bW.close()}destroy(){return this.#bW.destroy()}}a.exports=f},96947:(a,b,c)=>{"use strict";c.d(b,{DO:()=>s,LP:()=>r});var d=c(79154),e=c(87164),f=c(87886),g=c(14e3);globalThis._backgroundTokenRefreshState||(globalThis._backgroundTokenRefreshState={started:!1,startTimer:null,timer:null,runningPromise:null,retryByConnection:new Map});let h=globalThis._backgroundTokenRefreshState;async function i(a){let{getProviderConnectionById:b}=await Promise.resolve().then(c.bind(c,70321));return b(a)}async function j(a,b){let{mutateProviderConnection:d}=await Promise.resolve().then(c.bind(c,70321));return d(a,b)}async function k(a,b){return(0,d.Vq)(a,b,f)}function l(a,b){return!!(a&&b&&a.refreshToken===b.refreshToken&&a.accessToken===b.accessToken&&a.updatedAt===b.updatedAt)}async function m(a,b,d={}){let e=d.mutateConnection||j,f=d.now||Date.now,{buildProviderCredentialUpdates:g}=await c.e(3815).then(c.bind(c,73815));return!!await e(a.id,c=>l(c,a)?g({...b,existingProviderSpecificData:c.providerSpecificData},f()):null)}async function n(a,b,c={}){let d=c.mutateConnection||j;return!!await d(a.id,c=>l(c,a)?{lastError:"OAuth refresh credential rejected; reconnect this account.",lastErrorAt:b.at,lastErrorType:"auth",errorCode:b.code,failureClass:"reauth_required"}:null)}async function o(a,b={}){let c,d=b.readConnection||i,e=b.refreshCredentials||k,f=b.persistCredentials,h=b.markReauthRequired,p=b.mutateConnection||j,q=b.now||Date.now,r=b.scheduler||g.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(q()).toISOString()},c=!0;if(h?await h(s,b):c=await n(s,b,{mutateConnection:p}),!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(q()).toISOString()};if(f){let b=await d(a.id);if(!l(b,s))return{refreshed:!1,stale:!0};await f(a.id,{...t,existingProviderSpecificData:b.providerSpecificData})}else if(!await m(s,t,{mutateConnection:p,now:q}))return{refreshed:!1,stale:!0};return{refreshed:!0}}async function p(a,b={}){let c=b.refreshConnection||o,d=Math.max(1,Number(b.concurrency)||4),e="function"==typeof b.now?b.now():Date.now(),g=0,i=0,j=0,k=Array.from({length:Math.min(d,a.length)},async()=>{for(;g<a.length;){let b=a[g++];try{await c(b),h.retryByConnection.delete(b.id),i+=1}catch(a){!function(a,b,c=!1){let d=h.retryByConnection.get(a),e=(d?.attempts||0)+1,f=Math.min(9e5,3e4*2**(e-1));h.retryByConnection.set(a,{attempts:e,retryAt:c?1/0:b+f})}(b.id,e,a?.permanent===!0),j+=1,f.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(k),{attempted:a.length,succeeded:i,failed:j}}async function q(){let{getProviderConnections:a}=await Promise.resolve().then(c.bind(c,70321));return a({isActive:!0})}function r(a={}){if(h.started)return!1;h.started=!0;let b=Number.isFinite(a.intervalMs)&&a.intervalMs>0?a.intervalMs:3e5,c=a.random||Math.random,g=async()=>{await function(a={}){let b,c;if(h.runningPromise)return h.runningPromise;let g=(b=a.listConnections||q,c=a.now||Date.now,(async()=>{try{let f=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=h.retryByConnection.get(a.id))&&!(c.retryAt<=b))return!1;let f=(0,d.Dz)(a);if(null===f)return!1;let g=(0,e.Og)(a.provider);return f-b<Math.max(18e5,Number.isFinite(g)?g:0)}):[]}(f,c());return await p(g,{...a,now:c})}catch(a){return f.warn("BG_TOKEN_REFRESH","Refresh sweep failed",{code:a?.code||null}),{attempted:0,succeeded:0,failed:0}}})()).finally(()=>{h.runningPromise===g&&(h.runningPromise=null)});return h.runningPromise=g,g}(a),h.started&&(h.timer=setTimeout(g,function(a,b=Math.random){return Math.round(a*(.9+.2*Math.max(0,Math.min(1,Number(b())||0))))}(b,c)),h.timer.unref?.())};return h.startTimer=setTimeout(()=>{h.startTimer=null,g()},1e4),h.startTimer.unref?.(),!0}function s(){return h.startTimer&&clearTimeout(h.startTimer),h.timer&&clearTimeout(h.timer),h.startTimer=null,h.timer=null,h.started=!1,h.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{#bY;#bX={};#bt=0;constructor(a,b){this.#bX.serverNoContextTakeover=a.has("server_no_context_takeover"),this.#bX.serverMaxWindowBits=a.get("server_max_window_bits"),this.#bt=b.maxPayloadSize}decompress(a,b,c){if(!this.#bY){let a=e;if(this.#bX.serverMaxWindowBits){if(!f(this.#bX.serverMaxWindowBits))return void c(Error("Invalid server_max_window_bits"));a=Number.parseInt(this.#bX.serverMaxWindowBits)}try{this.#bY=d({windowBits:a})}catch(a){c(a);return}this.#bY[i]=[],this.#bY[j]=0,this.#bY.on("data",a=>{if(this.#bY[j]+=a.length,this.#bt>0&&this.#bY[j]>this.#bt){c(new g),this.#bY.removeAllListeners(),this.#bY=null;return}this.#bY[i].push(a)}),this.#bY.on("error",a=>{this.#bY=null,c(a)})}this.#bY.write(a),b&&this.#bY.write(h),this.#bY.flush(()=>{if(!this.#bY)return;let a=Buffer.concat(this.#bY[i],this.#bY[j]);this.#bY[i].length=0,this.#bY[j]=0,c(null,a)})}}a.exports={PerMessageDeflate:k}},97356:(a,b,c)=>{"use strict";let{Transform:d}=c(57075),{isASCIINumber:e,isValidLastEventId:f}=c(26376),g=Buffer.from("data"),h=Buffer.from("event"),i=Buffer.from("id"),j=Buffer.from("retry");function k(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}class l extends d{state;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;chunks=[];chunkIndex=0;pos=0;lineChunkIndex=0;linePos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(a={}){a.readableObjectMode=!0,super(a),this.state=a.eventSourceSettings||{},a.push&&(this.push=a.push)}_transform(a,b,c){if(0===a.length||(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),this.parseLine(this.readLine(),this.event),this.consumeCurrentByte(),this.eventEndCheck=!0;continue}this.advanceCursor()}c()}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),k(a,d,g)){let c=a.toString("utf8",e);void 0===b.data?b.data=c:b.data+=`
464
468
  ${c}`;return}if(k(a,d,j)){(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)&&(b.retry=a.toString("utf8",e));return}if(k(a,d,i)){(function(a,b){for(let c=b;c<a.length;c++)if(0===a[c])return!1;return!0})(a,e)&&(b.id=a.toString("utf8",e));return}if(k(a,d,h)){let c=a.toString("utf8",e);c.length>0&&(b.event=c)}}processEvent(a){a.retry&&e(a.retry)&&(this.state.reconnectionTime=parseInt(a.retry,10)),void 0!==a.id&&f(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}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.dropConsumedChunks()}dropConsumedChunks(){for(;this.lineChunkIndex>0;)this.chunks.shift(),this.lineChunkIndex--,this.chunkIndex--;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:l}},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");const{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:4,minDelayMs:0}),e=Object.freeze({kiro:Object.freeze({maxConcurrent:1,minDelayMs:3e3})});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,ResponseExceededMaxSizeError:s}=c(61448),{kUrl:t,kReset:u,kClient:v,kParser:w,kBlocking:x,kRunning:y,kPending:z,kSize:A,kWriting:B,kQueue:C,kNoRef:D,kKeepAliveDefaultTimeout:E,kHostHeader:F,kPendingIdx:G,kRunningIdx:H,kError:I,kPipelining:J,kSocket:K,kKeepAliveTimeoutValue:L,kMaxHeadersSize:M,kKeepAliveMaxTimeout:N,kKeepAliveTimeoutThreshold:O,kHeadersTimeout:P,kBodyTimeout:Q,kStrictContentLength:R,kMaxRequests:S,kCounter:T,kMaxResponseSize:U,kOnError:V,kResume:W,kHTTPContext:X,kClosed:Y}=c(49176),Z=c(65429),$=Buffer.alloc(0),_=Buffer[Symbol.species],aa=f.removeAllListeners,ab=Symbol("kIdleSocketValidation"),ac=Symbol("kIdleSocketValidationTimeout"),ad=Symbol("kSocketUsed"),ae=Symbol("kTypeOfService"),af=null,ag=null,ah=null,ai=0,aj=null,ak=null;class al{constructor(a,b,{exports:c}){this.llhttp=c,this.ptr=this.llhttp.llhttp_alloc(Z.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[M],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength=-1,this.connectionKeepAlive=!1,this.maxResponseSize=a[U]}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(am,a,this.timeoutWeakRef):(this.timeout=setTimeout(am,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===ag),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()||$),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let a=this.socket.read();if(null===a)break;this.execute(a)}}execute(a){e(null===ag),e(null!=this.ptr),e(!this.paused);let{socket:b,llhttp:c}=this;a.length>ai&&(aj&&c.free(aj),ai=4096*Math.ceil(a.length/4096),aj=c.malloc(ai)),(null===ak||ak.buffer!==c.memory.buffer||ak.byteOffset!==aj||ak.byteLength!==ai)&&(ak=new Uint8Array(c.memory.buffer,aj,ai)),ak.set(a);try{let d;try{ah=a,ag=this,d=c.llhttp_execute(this.ptr,aj,a.length)}finally{ag=null,ah=null}if(d!==Z.ERROR.OK){let e=a.subarray(c.llhttp_get_error_pos(this.ptr)-aj);if(d===Z.ERROR.PAUSED_UPGRADE)this.onUpgrade(e);else if(d===Z.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===ag),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()||$,this.execute(a);while(this.paused&&a.length>0);this.paused&&(b.llhttp_resume(this.ptr),this.paused=!1)}try{ag=this,a=b.llhttp_finish(this.ptr)}finally{ag=null}return a===Z.ERROR.OK?null:a===Z.ERROR.PAUSED||a===Z.ERROR.PAUSED_UPGRADE?(this.paused=!0,null):this.createError(a,$)}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,Z.ERROR[a],b)}destroy(){e(null===ag),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[y])return f.destroy(a,new o("bad response",f.getSocketInfo(a))),-1;let c=b[C][b[H]];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;(1&b)==1?(this.headers.push(a),b+=1):this.headers[b-1]=Buffer.concat([this.headers[b-1],a]);let c=this.headers[b-2];if(10===c.length){let d=f.bufferToLowerCasedHeaderName(c);"keep-alive"===d?this.keepAlive+=a.toString():"connection"===d&&(this.connectionKeepAlive=10===this.headers[b-1].length&&"keep-alive"===f.bufferToLowerCasedHeaderName(this.headers[b-1]))}else if(14===c.length&&"content-length"===f.bufferToLowerCasedHeaderName(c)){-1===this.contentLength&&(this.contentLength=0);for(let b=0;b<a.length;b++)this.contentLength=10*this.contentLength+(a[b]-48)}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}=this;e(b),e(c[K]===d),e(!d.destroyed),e(!this.paused),e((1&g.length)==0);let i=c[C][c[H]];e(i),e(i.upgrade||"CONNECT"===i.method),this.statusCode=0,this.statusText="",this.shouldKeepAlive=!1,this.headers=[],this.headersSize=0,d.unshift(a),d[w].destroy(),d[w]=null,d[v]=null,d[I]=null,aa(d),c[K]=null,c[X]=null,c[C][c[H]++]=null,c.emit("disconnect",c[t],[c],new p("upgrade"));try{i.onRequestUpgrade(h,g,d)}catch(a){f.destroy(d,a)}c[W]()}onHeadersComplete(a,b,c){let{client:d,socket:g,headers:h,statusText:i}=this;if(g.destroyed)return -1;if(0===d[y])return f.destroy(g,new o("bad response",f.getSocketInfo(g))),-1;let j=d[C][d[H]];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[u]&&this.connectionKeepAlive,this.statusCode>=200){let a=null!=j.bodyTimeout?j.bodyTimeout:d[Q];this.setTimeout(a,5)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if("CONNECT"===j.method||b)return e(1===d[y]),this.upgrade=!0,2;if(e((1&this.headers.length)==0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&d[J]){let a=this.keepAlive?f.parseKeepAliveTimeout(this.keepAlive):null;if(null!=a){let b=Math.min(a-d[O],d[N]);b<=0?g[u]=!0:d[L]=b}else d[L]=d[E]}else g[u]=!0;let k=!1===j.onResponseStart(a,h,this.resume,i);return j.aborted?-1:"HEAD"===j.method||a<200?1:(g[x]&&(g[x]=!1,d[W]()),k?Z.ERROR.PAUSED:0)}onBody(a){let{client:b,socket:c,statusCode:d,maxResponseSize:g}=this;if(c.destroyed)return -1;let h=b[C][b[H]];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 s),-1):(this.bytesRead+=a.length,!1===h.onResponseData(a))?Z.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[C][a[H]];return(e(l),this.statusCode=0,this.statusText="",this.bytesRead=0,this.contentLength=-1,this.keepAlive="",this.connectionKeepAlive=!1,this.headers=[],this.headersSize=0,c<200)?0:"HEAD"!==l.method&&-1!==h&&i!==h?(f.destroy(b,new j),-1):(l.onResponseEnd(g),a[C][a[H]++]=null,b[ad]=0===a[z],b[B])?(e(0===a[y]),f.destroy(b,new p("reset")),Z.ERROR.PAUSED):k?b[u]&&0===a[y]?(f.destroy(b,new p("reset")),Z.ERROR.PAUSED):(null==a[J]||1===a[J]?setImmediate(a[W]):a[W](),0):(f.destroy(b,new p("reset")),Z.ERROR.PAUSED)}}function am(a){let b=a.deref();if(!b)return;let{socket:c,timeoutType:d,client:g,paused:h}=b;3===d?(!c[B]||c.writableNeedDrain||g[y]>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[y]&&g[L]),f.destroy(c,new p("socket idle timeout")))}function an(a){e("ERR_TLS_CERT_ALTNAME_INVALID"!==a.code);let b=this[w];if("ECONNRESET"===a.code&&b.statusCode&&!b.shouldKeepAlive){let a=b.finish();a&&(this[I]=a,this[v][V](a));return}this[I]=a,this[v][V](a)}function ao(){this[w]?.readMore()}function ap(){let a=this[w];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 aq(){let a=this[w];as(this),a&&(this[I]||!a.statusCode||a.shouldKeepAlive||(this[I]=a.finish()||this[I]),this[w].destroy(),this[w]=null);let b=this[I]||new o("closed",f.getSocketInfo(this)),c=this[v];if(c[K]=null,c[X]=null,c.destroyed){e(0===c[z]);let a=c[C].splice(c[H]);for(let d=0;d<a.length;d++){let e=a[d];f.errorRequest(c,e,b)}}else if(c[y]>0&&"UND_ERR_INFO"!==b.code){let a=c[C][c[H]];c[C][c[H]++]=null,f.errorRequest(c,a,b)}c[G]=c[H],e(0===c[y]),c.emit("disconnect",c[t],[c],b),c[W]()}function ar(){this[Y]=!0}function as(a){a[ac]&&(clearTimeout(a[ac]),a[ac]=null),a[ab]=0}function at(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
465
469
  \r
466
470
  `,"latin1"),g.write(b),g.uncork(),d.onBodySent(b),j||!1===d.reset||(g[u]=!0)):0===h?g.write(`${i}content-length: 0\r