@rsalmn/extremerouter 0.6.9 → 0.7.0

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 (999) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +4 -2
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/routes-manifest.json +16 -0
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page.js +2 -2
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page.js.nft.json +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +2 -2
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page.js +2 -2
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page.js.nft.json +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +2 -2
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +2 -2
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page.js +2 -2
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page.js.nft.json +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +2 -2
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js +2 -2
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js.nft.json +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +3 -3
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +2 -2
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page.js +2 -2
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page_client-reference-manifest.js +1 -1
  77. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +2 -2
  78. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  80. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  81. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  82. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  83. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  84. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  86. package/app/.next-cli-build/server/app/_global-error/page.js +3 -3
  87. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  88. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  89. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  90. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  91. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  92. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  93. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  94. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  95. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  96. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  97. package/app/.next-cli-build/server/app/_not-found/page.js +2 -2
  98. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  100. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  101. package/app/.next-cli-build/server/app/_not-found.rsc +5 -5
  102. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
  103. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  104. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +5 -5
  105. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  106. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  107. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  108. package/app/.next-cli-build/server/app/api/alerts/test/route.js +2 -2
  109. package/app/.next-cli-build/server/app/api/alerts/test/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  111. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  113. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  115. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  117. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  119. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  121. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  123. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/cache/route.js +1 -1
  125. package/app/.next-cli-build/server/app/api/cache/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +2 -2
  127. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
  129. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  133. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  135. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  139. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  141. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  143. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  147. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
  149. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
  151. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +1 -1
  153. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +1 -1
  155. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
  157. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  159. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  161. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  163. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  165. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  167. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +2 -2
  169. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/health/providers/route.js +1 -1
  171. package/app/.next-cli-build/server/app/api/health/providers/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/health/route.js +1 -1
  173. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/health/stream/route.js +2 -2
  175. package/app/.next-cli-build/server/app/api/health/stream/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/init/route.js +1 -1
  177. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  179. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  181. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  183. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +1 -1
  185. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +2 -2
  187. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  189. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  191. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  193. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  195. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  197. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  199. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  201. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  203. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  205. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  207. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  209. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  211. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  213. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  215. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  217. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  219. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  221. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  229. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  231. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  233. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  235. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  237. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  241. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  243. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/providers/[id]/freebuff-profile/route.js +1 -0
  245. package/app/.next-cli-build/server/app/api/providers/[id]/freebuff-profile/route.js.nft.json +1 -0
  246. package/app/.next-cli-build/server/app/api/providers/[id]/freebuff-profile/route_client-reference-manifest.js +1 -0
  247. package/app/.next-cli-build/server/app/api/providers/[id]/health-timeline/route.js +1 -1
  248. package/app/.next-cli-build/server/app/api/providers/[id]/health-timeline/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  250. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  252. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  254. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  256. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  257. package/app/.next-cli-build/server/app/api/providers/[id]/v0-profile/route.js +1 -0
  258. package/app/.next-cli-build/server/app/api/providers/[id]/v0-profile/route.js.nft.json +1 -0
  259. package/app/.next-cli-build/server/app/api/providers/[id]/v0-profile/route_client-reference-manifest.js +1 -0
  260. package/app/.next-cli-build/server/app/api/providers/[id]/vault-pool/route.js +1 -1
  261. package/app/.next-cli-build/server/app/api/providers/[id]/vault-pool/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/providers/[id]/zenmux-plans/route.js +1 -1
  263. package/app/.next-cli-build/server/app/api/providers/[id]/zenmux-plans/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  265. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  267. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  271. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  273. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  275. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  277. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  279. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  281. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
  283. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  285. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  287. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  289. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  290. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  291. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  292. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  293. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  294. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  295. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  297. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  298. package/app/.next-cli-build/server/app/api/swarm/active/route.js +1 -1
  299. package/app/.next-cli-build/server/app/api/swarm/active/route.js.nft.json +1 -1
  300. package/app/.next-cli-build/server/app/api/swarm/stream/route.js +2 -2
  301. package/app/.next-cli-build/server/app/api/swarm/stream/route.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  303. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  304. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  305. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  306. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  307. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  308. package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  309. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  310. package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  311. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  312. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  313. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  314. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  315. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  316. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  317. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  318. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  319. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  320. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  321. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  322. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  323. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  324. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  325. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  326. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  327. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  328. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +1 -1
  329. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  330. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  331. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  332. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  333. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  334. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  335. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  336. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  337. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  338. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  339. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  340. package/app/.next-cli-build/server/app/api/usage/meta/route.js +1 -1
  341. package/app/.next-cli-build/server/app/api/usage/meta/route.js.nft.json +1 -1
  342. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  343. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  344. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  345. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  346. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  347. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  348. package/app/.next-cli-build/server/app/api/usage/retry-stats/route.js +1 -1
  349. package/app/.next-cli-build/server/app/api/usage/retry-stats/route.js.nft.json +1 -1
  350. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  351. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  352. package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
  353. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  354. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  355. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  356. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  357. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  358. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  359. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  360. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  361. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  362. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  363. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  364. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  365. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  366. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  367. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  368. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  369. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  370. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  371. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  372. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  373. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  374. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  375. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  376. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  377. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  378. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  379. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  380. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  381. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  382. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  383. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  384. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  385. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  386. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  387. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  388. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  389. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  390. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  391. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  392. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  393. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  394. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  395. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  396. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  397. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  398. package/app/.next-cli-build/server/app/callback/page.js +2 -2
  399. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  400. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  401. package/app/.next-cli-build/server/app/callback.html +1 -1
  402. package/app/.next-cli-build/server/app/callback.rsc +5 -5
  403. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +5 -5
  404. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  405. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +5 -5
  406. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  407. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  408. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  409. package/app/.next-cli-build/server/app/dashboard/alerts.html +1 -1
  410. package/app/.next-cli-build/server/app/dashboard/alerts.rsc +7 -7
  411. package/app/.next-cli-build/server/app/dashboard/alerts.segments/!KGRhc2hib2FyZCk/dashboard/alerts/__PAGE__.segment.rsc +2 -2
  412. package/app/.next-cli-build/server/app/dashboard/alerts.segments/!KGRhc2hib2FyZCk/dashboard/alerts.segment.rsc +1 -1
  413. package/app/.next-cli-build/server/app/dashboard/alerts.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  414. package/app/.next-cli-build/server/app/dashboard/alerts.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  415. package/app/.next-cli-build/server/app/dashboard/alerts.segments/_full.segment.rsc +7 -7
  416. package/app/.next-cli-build/server/app/dashboard/alerts.segments/_head.segment.rsc +1 -1
  417. package/app/.next-cli-build/server/app/dashboard/alerts.segments/_index.segment.rsc +5 -5
  418. package/app/.next-cli-build/server/app/dashboard/alerts.segments/_tree.segment.rsc +2 -2
  419. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  420. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +7 -7
  421. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  422. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  423. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  424. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  425. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +7 -7
  426. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  427. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +5 -5
  428. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  429. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  430. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +7 -7
  431. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  432. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  433. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  434. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  435. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
  436. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  437. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +5 -5
  438. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  439. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  440. package/app/.next-cli-build/server/app/dashboard/combos.rsc +7 -7
  441. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  442. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  443. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  444. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  445. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
  446. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  447. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +5 -5
  448. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  449. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  450. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +7 -7
  451. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  452. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  453. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  454. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  455. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
  456. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  457. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +5 -5
  458. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  459. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  460. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +7 -7
  461. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  462. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  463. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  464. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  465. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  466. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +7 -7
  467. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  468. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +5 -5
  469. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  470. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  471. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +7 -7
  472. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  473. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  474. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  475. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  476. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +7 -7
  477. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  478. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +5 -5
  479. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  480. package/app/.next-cli-build/server/app/dashboard/overview.html +1 -1
  481. package/app/.next-cli-build/server/app/dashboard/overview.rsc +7 -7
  482. package/app/.next-cli-build/server/app/dashboard/overview.segments/!KGRhc2hib2FyZCk/dashboard/overview/__PAGE__.segment.rsc +2 -2
  483. package/app/.next-cli-build/server/app/dashboard/overview.segments/!KGRhc2hib2FyZCk/dashboard/overview.segment.rsc +1 -1
  484. package/app/.next-cli-build/server/app/dashboard/overview.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  485. package/app/.next-cli-build/server/app/dashboard/overview.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  486. package/app/.next-cli-build/server/app/dashboard/overview.segments/_full.segment.rsc +7 -7
  487. package/app/.next-cli-build/server/app/dashboard/overview.segments/_head.segment.rsc +1 -1
  488. package/app/.next-cli-build/server/app/dashboard/overview.segments/_index.segment.rsc +5 -5
  489. package/app/.next-cli-build/server/app/dashboard/overview.segments/_tree.segment.rsc +2 -2
  490. package/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
  491. package/app/.next-cli-build/server/app/dashboard/playground.rsc +7 -7
  492. package/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +2 -2
  493. package/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground.segment.rsc +1 -1
  494. package/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  495. package/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  496. package/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +7 -7
  497. package/app/.next-cli-build/server/app/dashboard/playground.segments/_head.segment.rsc +1 -1
  498. package/app/.next-cli-build/server/app/dashboard/playground.segments/_index.segment.rsc +5 -5
  499. package/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +2 -2
  500. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  501. package/app/.next-cli-build/server/app/dashboard/profile.rsc +7 -7
  502. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  503. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  504. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  505. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  506. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
  507. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  508. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +5 -5
  509. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  510. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  511. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +7 -7
  512. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  513. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  514. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  515. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  516. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  517. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
  518. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  519. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +5 -5
  520. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  521. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  522. package/app/.next-cli-build/server/app/dashboard/providers.rsc +7 -7
  523. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  524. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  525. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  526. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  527. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
  528. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  529. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +5 -5
  530. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  531. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  532. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +7 -7
  533. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  534. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  535. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  536. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  537. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -7
  538. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  539. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +5 -5
  540. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  541. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  542. package/app/.next-cli-build/server/app/dashboard/quota.rsc +8 -8
  543. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  544. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  545. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  546. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  547. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +8 -8
  548. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  549. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +5 -5
  550. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  551. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +2 -2
  552. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  553. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  554. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  555. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +5 -5
  556. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
  557. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  558. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +5 -5
  559. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  560. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  561. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  562. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  563. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  564. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  565. package/app/.next-cli-build/server/app/dashboard/skills.rsc +7 -7
  566. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  567. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  568. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  569. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  570. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +7 -7
  571. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  572. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +5 -5
  573. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  574. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  575. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +7 -7
  576. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  577. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  578. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  579. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  580. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +7 -7
  581. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  582. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +5 -5
  583. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  584. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  585. package/app/.next-cli-build/server/app/dashboard/translator.rsc +7 -7
  586. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  587. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  588. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  589. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  590. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +7 -7
  591. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  592. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +5 -5
  593. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  594. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  595. package/app/.next-cli-build/server/app/dashboard/usage.rsc +7 -7
  596. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  597. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  598. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  599. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  600. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
  601. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  602. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +5 -5
  603. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  604. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  605. package/app/.next-cli-build/server/app/dashboard.rsc +7 -7
  606. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  607. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  608. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  609. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +7 -7
  610. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  611. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +5 -5
  612. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  613. package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
  614. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  615. package/app/.next-cli-build/server/app/index.html +1 -1
  616. package/app/.next-cli-build/server/app/index.rsc +5 -5
  617. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  618. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +5 -5
  619. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  620. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +5 -5
  621. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  622. package/app/.next-cli-build/server/app/landing/page.js +2 -2
  623. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  624. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  625. package/app/.next-cli-build/server/app/landing.html +1 -1
  626. package/app/.next-cli-build/server/app/landing.rsc +5 -5
  627. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
  628. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  629. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +5 -5
  630. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  631. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  632. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  633. package/app/.next-cli-build/server/app/login/page.js +2 -2
  634. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  635. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  636. package/app/.next-cli-build/server/app/login.html +1 -1
  637. package/app/.next-cli-build/server/app/login.rsc +6 -6
  638. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +6 -6
  639. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  640. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +5 -5
  641. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  642. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  643. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  644. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  645. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  646. package/app/.next-cli-build/server/app/page.js +2 -2
  647. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  648. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  649. package/app/.next-cli-build/server/app-paths-manifest.json +4 -2
  650. package/app/.next-cli-build/server/chunks/1051.js +1 -1
  651. package/app/.next-cli-build/server/chunks/1350.js +1 -1
  652. package/app/.next-cli-build/server/chunks/1719.js +1 -1
  653. package/app/.next-cli-build/server/chunks/2231.js +1 -1
  654. package/app/.next-cli-build/server/chunks/2701.js +1 -1
  655. package/app/.next-cli-build/server/chunks/318.js +10 -7
  656. package/app/.next-cli-build/server/chunks/412.js +2 -2
  657. package/app/.next-cli-build/server/chunks/5612.js +1 -1
  658. package/app/.next-cli-build/server/chunks/5699.js +1 -1
  659. package/app/.next-cli-build/server/chunks/5961.js +1 -1
  660. package/app/.next-cli-build/server/chunks/6070.js +1 -1
  661. package/app/.next-cli-build/server/chunks/615.js +1 -1
  662. package/app/.next-cli-build/server/chunks/6182.js +1 -1
  663. package/app/.next-cli-build/server/chunks/6306.js +1 -1
  664. package/app/.next-cli-build/server/chunks/6316.js +2 -2
  665. package/app/.next-cli-build/server/chunks/7524.js +1 -1
  666. package/app/.next-cli-build/server/chunks/788.js +1 -1
  667. package/app/.next-cli-build/server/chunks/8142.js +1 -0
  668. package/app/.next-cli-build/server/chunks/8238.js +1 -1
  669. package/app/.next-cli-build/server/chunks/8271.js +1 -1
  670. package/app/.next-cli-build/server/chunks/8833.js +1 -1
  671. package/app/.next-cli-build/server/chunks/8895.js +1 -1
  672. package/app/.next-cli-build/server/chunks/9630.js +1 -1
  673. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  674. package/app/.next-cli-build/server/pages/404.html +1 -1
  675. package/app/.next-cli-build/server/pages/500.html +1 -1
  676. package/app/.next-cli-build/static/chunks/1321-c2673b86ae099f7a.js +1 -0
  677. package/app/.next-cli-build/static/chunks/{5497-b52a89f9755eb560.js → 5497-4a46de726a80ec4c.js} +2 -2
  678. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-0858623d4e6bc8d9.js +1 -0
  679. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/overview/page-02c60e92de70e467.js +1 -0
  680. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-bc74cf85727e59c8.js +10 -0
  681. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-88b8c16ff41dc468.js +1 -0
  682. package/app/.next-cli-build/static/chunks/app/_global-error/page-7321cb331506637b.js +1 -0
  683. package/app/.next-cli-build/static/chunks/app/api/alerts/test/route-7321cb331506637b.js +1 -0
  684. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-7321cb331506637b.js +1 -0
  685. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-7321cb331506637b.js +1 -0
  686. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-7321cb331506637b.js +1 -0
  687. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-7321cb331506637b.js +1 -0
  688. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-7321cb331506637b.js +1 -0
  689. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-7321cb331506637b.js +1 -0
  690. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-7321cb331506637b.js +1 -0
  691. package/app/.next-cli-build/static/chunks/app/api/cache/route-7321cb331506637b.js +1 -0
  692. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-7321cb331506637b.js +1 -0
  693. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-7321cb331506637b.js +1 -0
  694. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-7321cb331506637b.js +1 -0
  695. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-7321cb331506637b.js +1 -0
  696. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-7321cb331506637b.js +1 -0
  697. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-7321cb331506637b.js +1 -0
  698. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-7321cb331506637b.js +1 -0
  699. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-7321cb331506637b.js +1 -0
  700. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-7321cb331506637b.js +1 -0
  701. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-7321cb331506637b.js +1 -0
  702. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-7321cb331506637b.js +1 -0
  703. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-7321cb331506637b.js +1 -0
  704. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-7321cb331506637b.js +1 -0
  705. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-7321cb331506637b.js +1 -0
  706. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-7321cb331506637b.js +1 -0
  707. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-7321cb331506637b.js +1 -0
  708. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-7321cb331506637b.js +1 -0
  709. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-7321cb331506637b.js +1 -0
  710. package/app/.next-cli-build/static/chunks/app/api/combos/route-7321cb331506637b.js +1 -0
  711. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-7321cb331506637b.js +1 -0
  712. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-7321cb331506637b.js +1 -0
  713. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-7321cb331506637b.js +1 -0
  714. package/app/.next-cli-build/static/chunks/app/api/health/providers/route-7321cb331506637b.js +1 -0
  715. package/app/.next-cli-build/static/chunks/app/api/health/route-7321cb331506637b.js +1 -0
  716. package/app/.next-cli-build/static/chunks/app/api/health/stream/route-7321cb331506637b.js +1 -0
  717. package/app/.next-cli-build/static/chunks/app/api/init/route-7321cb331506637b.js +1 -0
  718. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-7321cb331506637b.js +1 -0
  719. package/app/.next-cli-build/static/chunks/app/api/keys/route-7321cb331506637b.js +1 -0
  720. package/app/.next-cli-build/static/chunks/app/api/locale/route-7321cb331506637b.js +1 -0
  721. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-7321cb331506637b.js +1 -0
  722. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-7321cb331506637b.js +1 -0
  723. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-7321cb331506637b.js +1 -0
  724. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-7321cb331506637b.js +1 -0
  725. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-7321cb331506637b.js +1 -0
  726. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-7321cb331506637b.js +1 -0
  727. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-7321cb331506637b.js +1 -0
  728. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-7321cb331506637b.js +1 -0
  729. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-7321cb331506637b.js +1 -0
  730. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-7321cb331506637b.js +1 -0
  731. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-7321cb331506637b.js +1 -0
  732. package/app/.next-cli-build/static/chunks/app/api/models/route-7321cb331506637b.js +1 -0
  733. package/app/.next-cli-build/static/chunks/app/api/models/test/route-7321cb331506637b.js +1 -0
  734. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-7321cb331506637b.js +1 -0
  735. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-7321cb331506637b.js +1 -0
  736. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-7321cb331506637b.js +1 -0
  737. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-7321cb331506637b.js +1 -0
  738. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-7321cb331506637b.js +1 -0
  739. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-7321cb331506637b.js +1 -0
  740. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-7321cb331506637b.js +1 -0
  741. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-7321cb331506637b.js +1 -0
  742. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-7321cb331506637b.js +1 -0
  743. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-7321cb331506637b.js +1 -0
  744. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-7321cb331506637b.js +1 -0
  745. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-7321cb331506637b.js +1 -0
  746. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-7321cb331506637b.js +1 -0
  747. package/app/.next-cli-build/static/chunks/app/api/pricing/route-7321cb331506637b.js +1 -0
  748. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-7321cb331506637b.js +1 -0
  749. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-7321cb331506637b.js +1 -0
  750. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-7321cb331506637b.js +1 -0
  751. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/freebuff-profile/route-7321cb331506637b.js +1 -0
  752. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/health-timeline/route-7321cb331506637b.js +1 -0
  753. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-7321cb331506637b.js +1 -0
  754. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-7321cb331506637b.js +1 -0
  755. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-7321cb331506637b.js +1 -0
  756. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-7321cb331506637b.js +1 -0
  757. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/v0-profile/route-7321cb331506637b.js +1 -0
  758. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/vault-pool/route-7321cb331506637b.js +1 -0
  759. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/zenmux-plans/route-7321cb331506637b.js +1 -0
  760. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-7321cb331506637b.js +1 -0
  761. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-7321cb331506637b.js +1 -0
  762. package/app/.next-cli-build/static/chunks/app/api/providers/route-7321cb331506637b.js +1 -0
  763. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-7321cb331506637b.js +1 -0
  764. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-7321cb331506637b.js +1 -0
  765. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-7321cb331506637b.js +1 -0
  766. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-7321cb331506637b.js +1 -0
  767. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-7321cb331506637b.js +1 -0
  768. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-7321cb331506637b.js +1 -0
  769. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-7321cb331506637b.js +1 -0
  770. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-7321cb331506637b.js +1 -0
  771. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-7321cb331506637b.js +1 -0
  772. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-7321cb331506637b.js +1 -0
  773. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-7321cb331506637b.js +1 -0
  774. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-7321cb331506637b.js +1 -0
  775. package/app/.next-cli-build/static/chunks/app/api/settings/route-7321cb331506637b.js +1 -0
  776. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-7321cb331506637b.js +1 -0
  777. package/app/.next-cli-build/static/chunks/app/api/swarm/active/route-7321cb331506637b.js +1 -0
  778. package/app/.next-cli-build/static/chunks/app/api/swarm/stream/route-7321cb331506637b.js +1 -0
  779. package/app/.next-cli-build/static/chunks/app/api/tags/route-7321cb331506637b.js +1 -0
  780. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-7321cb331506637b.js +1 -0
  781. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-7321cb331506637b.js +1 -0
  782. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-7321cb331506637b.js +1 -0
  783. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-7321cb331506637b.js +1 -0
  784. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-7321cb331506637b.js +1 -0
  785. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-7321cb331506637b.js +1 -0
  786. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-7321cb331506637b.js +1 -0
  787. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-7321cb331506637b.js +1 -0
  788. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-7321cb331506637b.js +1 -0
  789. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-7321cb331506637b.js +1 -0
  790. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-7321cb331506637b.js +1 -0
  791. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-7321cb331506637b.js +1 -0
  792. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-7321cb331506637b.js +1 -0
  793. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-7321cb331506637b.js +1 -0
  794. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-7321cb331506637b.js +1 -0
  795. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-7321cb331506637b.js +1 -0
  796. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-7321cb331506637b.js +1 -0
  797. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-7321cb331506637b.js +1 -0
  798. package/app/.next-cli-build/static/chunks/app/api/usage/meta/route-7321cb331506637b.js +1 -0
  799. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-7321cb331506637b.js +1 -0
  800. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-7321cb331506637b.js +1 -0
  801. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-7321cb331506637b.js +1 -0
  802. package/app/.next-cli-build/static/chunks/app/api/usage/retry-stats/route-7321cb331506637b.js +1 -0
  803. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-7321cb331506637b.js +1 -0
  804. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-7321cb331506637b.js +1 -0
  805. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-7321cb331506637b.js +1 -0
  806. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-7321cb331506637b.js +1 -0
  807. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-7321cb331506637b.js +1 -0
  808. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-7321cb331506637b.js +1 -0
  809. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-7321cb331506637b.js +1 -0
  810. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-7321cb331506637b.js +1 -0
  811. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-7321cb331506637b.js +1 -0
  812. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-7321cb331506637b.js +1 -0
  813. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-7321cb331506637b.js +1 -0
  814. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-7321cb331506637b.js +1 -0
  815. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-7321cb331506637b.js +1 -0
  816. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-7321cb331506637b.js +1 -0
  817. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-7321cb331506637b.js +1 -0
  818. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-7321cb331506637b.js +1 -0
  819. package/app/.next-cli-build/static/chunks/app/api/v1/route-7321cb331506637b.js +1 -0
  820. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-7321cb331506637b.js +1 -0
  821. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-7321cb331506637b.js +1 -0
  822. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-7321cb331506637b.js +1 -0
  823. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-7321cb331506637b.js +1 -0
  824. package/app/.next-cli-build/static/chunks/app/api/version/route-7321cb331506637b.js +1 -0
  825. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-7321cb331506637b.js +1 -0
  826. package/app/.next-cli-build/static/chunks/app/api/version/update/route-7321cb331506637b.js +1 -0
  827. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-7321cb331506637b.js +1 -0
  828. package/app/.next-cli-build/static/chunks/app/page-7321cb331506637b.js +1 -0
  829. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-7321cb331506637b.js +1 -0
  830. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-7321cb331506637b.js +1 -0
  831. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-7321cb331506637b.js +1 -0
  832. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-7321cb331506637b.js +1 -0
  833. package/app/.next-cli-build/static/css/a024ae3118bec883.css +1 -0
  834. package/app/cli/.build-home/AppData/Roaming/extremerouter/db/data.sqlite-shm +0 -0
  835. package/app/cli/.build-home/AppData/Roaming/extremerouter/db/data.sqlite-wal +0 -0
  836. package/app/package.json +80 -80
  837. package/app/public/providers/freebuff-web.svg +6 -0
  838. package/app/public/providers/openvecta.svg +7 -0
  839. package/app/public/providers/zenmux-free.svg +9 -0
  840. package/package.json +66 -66
  841. package/app/.next-cli-build/server/chunks/5141.js +0 -1
  842. package/app/.next-cli-build/static/chunks/1321-a9f1e563607e27d2.js +0 -1
  843. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-13dd1e8e32f7d580.js +0 -1
  844. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/overview/page-d88cff439c2fa57d.js +0 -1
  845. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-944559757580c50e.js +0 -10
  846. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-92152010fe3fda37.js +0 -1
  847. package/app/.next-cli-build/static/chunks/app/_global-error/page-f15c4c0893999b8c.js +0 -1
  848. package/app/.next-cli-build/static/chunks/app/api/alerts/test/route-f15c4c0893999b8c.js +0 -1
  849. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-f15c4c0893999b8c.js +0 -1
  850. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-f15c4c0893999b8c.js +0 -1
  851. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-f15c4c0893999b8c.js +0 -1
  852. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-f15c4c0893999b8c.js +0 -1
  853. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-f15c4c0893999b8c.js +0 -1
  854. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-f15c4c0893999b8c.js +0 -1
  855. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-f15c4c0893999b8c.js +0 -1
  856. package/app/.next-cli-build/static/chunks/app/api/cache/route-f15c4c0893999b8c.js +0 -1
  857. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-f15c4c0893999b8c.js +0 -1
  858. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-f15c4c0893999b8c.js +0 -1
  859. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-f15c4c0893999b8c.js +0 -1
  860. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-f15c4c0893999b8c.js +0 -1
  861. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-f15c4c0893999b8c.js +0 -1
  862. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-f15c4c0893999b8c.js +0 -1
  863. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-f15c4c0893999b8c.js +0 -1
  864. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-f15c4c0893999b8c.js +0 -1
  865. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-f15c4c0893999b8c.js +0 -1
  866. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-f15c4c0893999b8c.js +0 -1
  867. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-f15c4c0893999b8c.js +0 -1
  868. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-f15c4c0893999b8c.js +0 -1
  869. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-f15c4c0893999b8c.js +0 -1
  870. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-f15c4c0893999b8c.js +0 -1
  871. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-f15c4c0893999b8c.js +0 -1
  872. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-f15c4c0893999b8c.js +0 -1
  873. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-f15c4c0893999b8c.js +0 -1
  874. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-f15c4c0893999b8c.js +0 -1
  875. package/app/.next-cli-build/static/chunks/app/api/combos/route-f15c4c0893999b8c.js +0 -1
  876. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-f15c4c0893999b8c.js +0 -1
  877. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-f15c4c0893999b8c.js +0 -1
  878. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-f15c4c0893999b8c.js +0 -1
  879. package/app/.next-cli-build/static/chunks/app/api/health/providers/route-f15c4c0893999b8c.js +0 -1
  880. package/app/.next-cli-build/static/chunks/app/api/health/route-f15c4c0893999b8c.js +0 -1
  881. package/app/.next-cli-build/static/chunks/app/api/health/stream/route-f15c4c0893999b8c.js +0 -1
  882. package/app/.next-cli-build/static/chunks/app/api/init/route-f15c4c0893999b8c.js +0 -1
  883. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-f15c4c0893999b8c.js +0 -1
  884. package/app/.next-cli-build/static/chunks/app/api/keys/route-f15c4c0893999b8c.js +0 -1
  885. package/app/.next-cli-build/static/chunks/app/api/locale/route-f15c4c0893999b8c.js +0 -1
  886. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-f15c4c0893999b8c.js +0 -1
  887. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-f15c4c0893999b8c.js +0 -1
  888. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-f15c4c0893999b8c.js +0 -1
  889. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-f15c4c0893999b8c.js +0 -1
  890. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-f15c4c0893999b8c.js +0 -1
  891. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-f15c4c0893999b8c.js +0 -1
  892. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-f15c4c0893999b8c.js +0 -1
  893. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-f15c4c0893999b8c.js +0 -1
  894. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-f15c4c0893999b8c.js +0 -1
  895. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-f15c4c0893999b8c.js +0 -1
  896. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-f15c4c0893999b8c.js +0 -1
  897. package/app/.next-cli-build/static/chunks/app/api/models/route-f15c4c0893999b8c.js +0 -1
  898. package/app/.next-cli-build/static/chunks/app/api/models/test/route-f15c4c0893999b8c.js +0 -1
  899. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-f15c4c0893999b8c.js +0 -1
  900. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-f15c4c0893999b8c.js +0 -1
  901. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-f15c4c0893999b8c.js +0 -1
  902. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-f15c4c0893999b8c.js +0 -1
  903. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-f15c4c0893999b8c.js +0 -1
  904. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-f15c4c0893999b8c.js +0 -1
  905. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-f15c4c0893999b8c.js +0 -1
  906. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-f15c4c0893999b8c.js +0 -1
  907. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-f15c4c0893999b8c.js +0 -1
  908. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-f15c4c0893999b8c.js +0 -1
  909. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-f15c4c0893999b8c.js +0 -1
  910. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-f15c4c0893999b8c.js +0 -1
  911. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-f15c4c0893999b8c.js +0 -1
  912. package/app/.next-cli-build/static/chunks/app/api/pricing/route-f15c4c0893999b8c.js +0 -1
  913. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-f15c4c0893999b8c.js +0 -1
  914. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-f15c4c0893999b8c.js +0 -1
  915. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-f15c4c0893999b8c.js +0 -1
  916. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/health-timeline/route-f15c4c0893999b8c.js +0 -1
  917. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-f15c4c0893999b8c.js +0 -1
  918. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-f15c4c0893999b8c.js +0 -1
  919. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-f15c4c0893999b8c.js +0 -1
  920. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-f15c4c0893999b8c.js +0 -1
  921. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/vault-pool/route-f15c4c0893999b8c.js +0 -1
  922. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/zenmux-plans/route-f15c4c0893999b8c.js +0 -1
  923. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-f15c4c0893999b8c.js +0 -1
  924. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-f15c4c0893999b8c.js +0 -1
  925. package/app/.next-cli-build/static/chunks/app/api/providers/route-f15c4c0893999b8c.js +0 -1
  926. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-f15c4c0893999b8c.js +0 -1
  927. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-f15c4c0893999b8c.js +0 -1
  928. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-f15c4c0893999b8c.js +0 -1
  929. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-f15c4c0893999b8c.js +0 -1
  930. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-f15c4c0893999b8c.js +0 -1
  931. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-f15c4c0893999b8c.js +0 -1
  932. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-f15c4c0893999b8c.js +0 -1
  933. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-f15c4c0893999b8c.js +0 -1
  934. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-f15c4c0893999b8c.js +0 -1
  935. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-f15c4c0893999b8c.js +0 -1
  936. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-f15c4c0893999b8c.js +0 -1
  937. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-f15c4c0893999b8c.js +0 -1
  938. package/app/.next-cli-build/static/chunks/app/api/settings/route-f15c4c0893999b8c.js +0 -1
  939. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-f15c4c0893999b8c.js +0 -1
  940. package/app/.next-cli-build/static/chunks/app/api/swarm/active/route-f15c4c0893999b8c.js +0 -1
  941. package/app/.next-cli-build/static/chunks/app/api/swarm/stream/route-f15c4c0893999b8c.js +0 -1
  942. package/app/.next-cli-build/static/chunks/app/api/tags/route-f15c4c0893999b8c.js +0 -1
  943. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-f15c4c0893999b8c.js +0 -1
  944. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-f15c4c0893999b8c.js +0 -1
  945. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-f15c4c0893999b8c.js +0 -1
  946. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-f15c4c0893999b8c.js +0 -1
  947. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-f15c4c0893999b8c.js +0 -1
  948. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-f15c4c0893999b8c.js +0 -1
  949. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-f15c4c0893999b8c.js +0 -1
  950. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-f15c4c0893999b8c.js +0 -1
  951. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-f15c4c0893999b8c.js +0 -1
  952. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-f15c4c0893999b8c.js +0 -1
  953. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-f15c4c0893999b8c.js +0 -1
  954. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-f15c4c0893999b8c.js +0 -1
  955. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-f15c4c0893999b8c.js +0 -1
  956. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-f15c4c0893999b8c.js +0 -1
  957. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-f15c4c0893999b8c.js +0 -1
  958. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-f15c4c0893999b8c.js +0 -1
  959. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-f15c4c0893999b8c.js +0 -1
  960. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-f15c4c0893999b8c.js +0 -1
  961. package/app/.next-cli-build/static/chunks/app/api/usage/meta/route-f15c4c0893999b8c.js +0 -1
  962. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-f15c4c0893999b8c.js +0 -1
  963. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-f15c4c0893999b8c.js +0 -1
  964. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-f15c4c0893999b8c.js +0 -1
  965. package/app/.next-cli-build/static/chunks/app/api/usage/retry-stats/route-f15c4c0893999b8c.js +0 -1
  966. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-f15c4c0893999b8c.js +0 -1
  967. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-f15c4c0893999b8c.js +0 -1
  968. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-f15c4c0893999b8c.js +0 -1
  969. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-f15c4c0893999b8c.js +0 -1
  970. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-f15c4c0893999b8c.js +0 -1
  971. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-f15c4c0893999b8c.js +0 -1
  972. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-f15c4c0893999b8c.js +0 -1
  973. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-f15c4c0893999b8c.js +0 -1
  974. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-f15c4c0893999b8c.js +0 -1
  975. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-f15c4c0893999b8c.js +0 -1
  976. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-f15c4c0893999b8c.js +0 -1
  977. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-f15c4c0893999b8c.js +0 -1
  978. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-f15c4c0893999b8c.js +0 -1
  979. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-f15c4c0893999b8c.js +0 -1
  980. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-f15c4c0893999b8c.js +0 -1
  981. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-f15c4c0893999b8c.js +0 -1
  982. package/app/.next-cli-build/static/chunks/app/api/v1/route-f15c4c0893999b8c.js +0 -1
  983. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-f15c4c0893999b8c.js +0 -1
  984. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-f15c4c0893999b8c.js +0 -1
  985. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-f15c4c0893999b8c.js +0 -1
  986. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-f15c4c0893999b8c.js +0 -1
  987. package/app/.next-cli-build/static/chunks/app/api/version/route-f15c4c0893999b8c.js +0 -1
  988. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-f15c4c0893999b8c.js +0 -1
  989. package/app/.next-cli-build/static/chunks/app/api/version/update/route-f15c4c0893999b8c.js +0 -1
  990. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-f15c4c0893999b8c.js +0 -1
  991. package/app/.next-cli-build/static/chunks/app/page-f15c4c0893999b8c.js +0 -1
  992. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-f15c4c0893999b8c.js +0 -1
  993. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-f15c4c0893999b8c.js +0 -1
  994. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-f15c4c0893999b8c.js +0 -1
  995. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-f15c4c0893999b8c.js +0 -1
  996. package/app/.next-cli-build/static/css/aec867583ca6b35b.css +0 -1
  997. /package/app/.next-cli-build/static/{A3MT7HriWgGsipwlBgRY7 → p-3kW8XDeBLQg0sl_rzmI}/_buildManifest.js +0 -0
  998. /package/app/.next-cli-build/static/{A3MT7HriWgGsipwlBgRY7 → p-3kW8XDeBLQg0sl_rzmI}/_ssgManifest.js +0 -0
  999. /package/app/cli/.build-home/AppData/Roaming/extremerouter/db/backups/{upgrade-0.6.4-to-0.6.5-0.6.5-20260705-054523 → upgrade-0.6.8-to-0.6.9-0.6.9-20260713-141714}/data.sqlite +0 -0
@@ -1 +1 @@
1
- "use strict";exports.id=8271,exports.ids=[615,1998,8271],exports.modules={6551:(a,b,c)=>{c.d(b,{RO:()=>m,Tl:()=>k,Yt:()=>l});var d=c(39609),e=c(24295);let f={usageUrl:(0,e.U)("codex").url,resetCreditsUrl:(0,e.U)("codex").resetCreditsUrl,resetCreditsConsumeUrl:(0,e.U)("codex").resetCreditsConsumeUrl};function g(a){if(!a)return null;let b=a instanceof Date?a:new Date("number"==typeof a&&a<1e12?1e3*a:a);return Number.isFinite(b.getTime())?b.toISOString():null}function h(a){return!a||"object"!=typeof a||Array.isArray(a)?null:a.rate_limit&&"object"==typeof a.rate_limit?a.rate_limit:a}function i(a){let b=Math.max(0,Math.min(100,(0,e.IQ)(a?.used_percent??a?.percent_used,0)));return{used:b,total:100,remaining:Math.max(0,100-b),resetAt:(0,e.eZ)(a?.reset_at??a?.resets_at??a?.resetAt??null),unlimited:!1}}function j(a,b,c){let d=h(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;return e&&(a[b?`${b}_session`:"session"]=i(e),g=!0),f&&(a[b?`${b}_weekly`:"weekly"]=i(f),g=!0),g}async function k(a,b=null){try{let c=await (0,d.proxyAwareFetch)(f.usageUrl,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},b);if(!c.ok)return{message:`Codex connected. Usage API temporarily unavailable (${c.status}).`};let g=await c.json(),i=g.rate_limit||g.rate_limits||g.rate_limits_by_limit_id?.codex||{},k=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}(g),l=Math.max(0,(0,e.IQ)(g.rate_limit_reset_credits?.available_count,0)),m={};return j(m,"",i),j(m,"review",k),{plan:g.plan_type||g.summary?.plan||"unknown",limitReached:h(i)?.limit_reached||!1,reviewLimitReached:h(k)?.limit_reached||!1,resetCredits:{availableCount:l},quotas:m}}catch(a){throw Error(`Failed to fetch Codex usage: ${a.message}`)}}async function l(a,b=null,c=null){if(!a)throw Error("No Codex access token available. Please re-authorize the connection.");let h=c?.workspaceId||c?.accountId||c?.chatgptAccountId||null,i={Authorization:`Bearer ${a}`,Accept:"application/json","OpenAI-Beta":"codex-1",originator:"codex_cli_rs"};h&&(i["ChatGPT-Account-ID"]=h);let j=await (0,d.proxyAwareFetch)(f.resetCreditsUrl,{method:"GET",headers:i},b),k=null;try{k=await j.json()}catch{k=null}if(!j.ok)throw Error(k?.message||k?.error||k?.detail||`Codex reset credits API unavailable (${j.status}).`);let m=Array.isArray(k?.credits)?k.credits:[];return{availableCount:Math.max(0,(0,e.IQ)(k?.available_count??k?.availableCount,0)),credits:m.map(a=>({status:String(a?.status||"unknown"),grantedAt:g(a?.granted_at??a?.grantedAt),expiresAt:g(a?.expires_at??a?.expiresAt)}))}}async function m(a,b,c=null){let g;if(!a)throw Error("No Codex access token available. Please re-authorize the connection.");if(!b||"string"!=typeof b)throw Error("A redeem request id is required to consume a Codex reset credit.");let h=null;try{g=await (0,d.proxyAwareFetch)(f.resetCreditsConsumeUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({redeem_request_id:b})},c);let e=await g.text();h=e?JSON.parse(e):null}catch(a){throw Error(`Failed to consume Codex reset credit: ${a.message}`)}let i=h?.code||null,j=(0,e.IQ)(h?.windows_reset,0);return{ok:g.ok&&("reset"===i||j>0),noCredit:g.ok&&"no_credit"===i,status:g.status,code:i,windowsReset:j,message:h?.message||null,raw:h}}},18271:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>m,refreshAndUpdateCredentials:()=>l});var e=c(48895),f=c(89718),g=c(99002),h=c(55330),i=c(39326),j=c(40615),k=a([e,h]);[e,h]=k.then?(await k)():k;let n=["expired","authentication","unauthorized","401","re-authorize"];async function l(a,b=!1,c=null){let d=(0,h.SB)(a.provider),e={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||d.needsRefresh(e)))return{connection:a,refreshed:!1};let g=await d.refreshCredentials(e,console,c);if(!g){if(a.accessToken)return{connection:a,refreshed:!1};throw Error("Failed to refresh credentials. Please re-authorize the connection.")}let i={updatedAt:new Date().toISOString()};g.accessToken&&(i.accessToken=g.accessToken),g.refreshToken&&(i.refreshToken=g.refreshToken),g.idToken&&(i.idToken=g.idToken),g.lastRefreshAt&&(i.lastRefreshAt=g.lastRefreshAt),g.expiresIn?(i.expiresAt=new Date(Date.now()+1e3*g.expiresIn).toISOString(),i.expiresIn=g.expiresIn):g.expiresAt&&(i.expiresAt=g.expiresAt);let j={...g.providerSpecificData||{},...g.copilotToken?{copilotToken:g.copilotToken}:{},...g.copilotTokenExpiresAt?{copilotTokenExpiresAt:g.copilotTokenExpiresAt}:{}};return Object.keys(j).length>0&&(i.providerSpecificData={...a.providerSpecificData||{},...j}),await (0,f.updateProviderConnection)(a.id,i),{connection:{...a,...i,providerSpecificData:i.providerSpecificData||a.providerSpecificData},refreshed:!0}}async function m(a,{params:b}){let c;try{let{connectionId:a}=await b;if(!(c=await (0,f.Mc)(a)))return Response.json({error:"Connection not found"},{status:404});let d="oauth"===c.authType,e=("apikey"===c.authType||"api_key"===c.authType)&&j.jO.includes(c.provider);if(!d&&!e)return Response.json({message:"Usage not available for this connection"});let h=await (0,i.B)(c.providerSpecificData),k={connectionProxyEnabled:!0===h.connectionProxyEnabled,connectionProxyUrl:h.connectionProxyUrl||"",connectionNoProxy:h.connectionNoProxy||"",vercelRelayUrl:h.vercelRelayUrl||"",strictProxy:!1};if(d)try{c=(await l(c,!1,k)).connection}catch(a){return console.error("[Usage API] Credential refresh failed:",a),Response.json({error:`Credential refresh failed: ${a.message}`},{status:401})}let m=await (0,g.my)(c,k);if(d&&function(a){if(!a?.message)return!1;let b=a.message.toLowerCase();return n.some(a=>b.includes(a))}(m)&&c.refreshToken)try{c=(await l(c,!0,k)).connection,m=await (0,g.my)(c,k)}catch(a){console.warn(`[Usage] ${c.provider}: force refresh failed: ${a.message}`)}return Response.json(m)}catch(b){let a=c?.provider??"unknown";return console.warn(`[Usage] ${a}: ${b.message}`),Response.json({error:b.message},{status:500})}}d()}catch(a){d(a)}})},24295:(a,b,c)=>{c.d(b,{IQ:()=>h,U:()=>f,eZ:()=>g,gD:()=>i,u9:()=>j});var d=c(26070),e=c(39609);let f=a=>d.xq[a]?.usage||{};function g(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 h(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 i(a){return"string"==typeof a?a.trim()||null:a&&"object"==typeof a&&"string"==typeof a.id&&a.id.trim()||null}async function j(a,b,c=1e4,d=null){let f=new AbortController,g=setTimeout(()=>f.abort(),c);try{return await (0,e.proxyAwareFetch)(a,{...b,signal:f.signal},d)}finally{clearTimeout(g)}}},39326:(a,b,c)=>{c.d(b,{B:()=>f});var d=c(71998);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}}}},40615:(a,b,c)=>{c.d(b,{AI_PROVIDERS:()=>s,js:()=>w,DI:()=>n,fg:()=>k,Pd:()=>o,IS:()=>h,nJ:()=>i,zN:()=>j,JH:()=>m,jO:()=>y,wb:()=>x,br:()=>l,wG:()=>v,zt:()=>t,gb:()=>q,gC:()=>r,mq:()=>p,rs:()=>u});var d=c(7001);let e="⚠️ 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.";Object.fromEntries(d.A.filter(a=>a.display).map(a=>{let b;return[a.id,"RISK_NOTICE"===(b=a.display).deprecationNotice?{...b,deprecationNotice:e}:b]}));let f=["serviceKinds","ttsConfig","sttConfig","embeddingConfig","imageConfig","imageToTextConfig","videoConfig","musicConfig","searchViaChat","searchConfig","fetchConfig","modelsFetcher","mediaPriority","hiddenKinds"],g=a=>Object.fromEntries(d.A.filter(b=>b.category===a).map(a=>[a.id,function(a){let b={};for(let c of(a.media&&Object.assign(b,a.media),f))void 0!==a[c]&&(b[c]=a[c]);let c={...a.display||{}};return"RISK_NOTICE"===c.deprecationNotice&&(c.deprecationNotice=e),{...c,id:a.id,alias:a.uiAlias||a.alias,...a.hidden?{hidden:!0}:{},...b,...void 0!==a.priority?{priority:a.priority}:{},...a.hasFree?{hasFree:!0}:{},...a.thinkingConfig?{thinkingConfig:a.thinkingConfig}:{},...a.regions?{regions:a.regions,defaultRegion:a.defaultRegion}:{},...a.hasProviderSpecificData?{hasProviderSpecificData:!0}:{},...a.noAuth?{noAuth:!0}:{},...a.passthroughModels?{passthroughModels:!0}:{},...a.hasOAuth?{hasOAuth:!0}:{},...a.authModes?{authModes:a.authModes}:{},...a.authType?{authType:a.authType}:{},...a.authHint?{authHint:a.authHint}:{},...a.comingSoon?{comingSoon:!0}:{}}}(a)])),h=g("free"),i=g("freeTier"),j=g("oauth"),k=g("apikey"),l=g("webCookie"),m="openai-compatible-",n="anthropic-compatible-",o="custom-embedding-";function p(a){return"string"==typeof a&&a.startsWith(m)}function q(a){return"string"==typeof a&&a.startsWith(n)}function r(a){return"string"==typeof a&&a.startsWith(o)}let s={...h,...i,...j,...k,...l};function t(a){for(let b of Object.values(s))if(b.alias===a||b.id===a)return b;return null}function u(a){let b=t(a);return b?.id||a}function v(a){let b=s[a];return b?.alias||a}let w=Object.values(s).reduce((a,b)=>(a[b.alias]=b.id,a),{});Object.values(s).reduce((a,b)=>(a[b.id]=b.alias,a),{});let x=d.A.filter(a=>a.features?.usage).map(a=>a.id),y=d.A.filter(a=>a.features?.usageApikey).map(a=>a.id)},69788:(a,b,c)=>{c.d(b,{g:()=>i});var d=c(39609),e=c(74129),f=c(24295);let g={oauthUsageUrl:(0,f.U)("claude").oauthUrl,usageUrl:(0,f.U)("claude").orgUrl,settingsUrl:(0,f.U)("claude").settingsUrl,apiVersion:e.b8},h=new Map;async function i(a,b=null){try{let c=h.get(a);if(c&&Date.now()<c)return await j(a,b);let e=await (0,d.proxyAwareFetch)(g.oauthUsageUrl,{method:"GET",headers:{Authorization:`Bearer ${a}`,"anthropic-beta":"oauth-2025-04-20","anthropic-version":g.apiVersion}},b);if(e.ok){let a=await e.json(),b={},c=a=>a&&"object"==typeof a&&"number"==typeof a.utilization,d=a=>{let b=a.utilization,c=Math.max(0,100-b);return{used:b,total:100,remaining:c,remainingPercentage:c,resetAt:(0,f.eZ)(a.resets_at),unlimited:!1}};for(let[e,f]of(c(a.five_hour)&&(b["session (5h)"]=d(a.five_hour)),c(a.seven_day)&&(b["weekly (7d)"]=d(a.seven_day)),Object.entries(a)))if(e.startsWith("seven_day_")&&"seven_day"!==e&&c(f)){let a=e.replace("seven_day_","");b[`weekly ${a} (7d)`]=d(f)}return{plan:"Claude Code",extraUsage:a.extra_usage??null,quotas:b}}return 429===e.status&&h.set(a,Date.now()+18e4),console.warn(`[Claude Usage] OAuth endpoint returned ${e.status}, falling back to legacy`),await j(a,b)}catch(a){return{message:`Claude connected. Unable to fetch usage: ${a.message}`}}}async function j(a,b=null){try{let c=await (0,d.proxyAwareFetch)(g.settingsUrl,{method:"GET",headers:{Authorization:`Bearer ${a}`,"anthropic-version":g.apiVersion}},b);if(c.ok){let e=await c.json();if(e.organization_id){let c=await (0,d.proxyAwareFetch)(g.usageUrl.replace("{org_id}",e.organization_id),{method:"GET",headers:{Authorization:`Bearer ${a}`,"anthropic-version":g.apiVersion}},b);if(c.ok){let a=await c.json();return{plan:e.plan||"Unknown",organization:e.organization_name,quotas:a}}}return{plan:e.plan||"Unknown",organization:e.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}`}}}},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(89718)},99002:(a,b,c)=>{c.d(b,{RO:()=>r.RO,Yt:()=>r.Yt,my:()=>O});var d=c(39609),e=c(26070),f=c(24295);let g={apiVersion:e.sr.github?.apiVersion,userAgent:e.sr.github?.userAgent};async function h(a,b,c=null){try{if(!a)throw Error("No GitHub access token available. Please re-authorize the connection.");let b=await (0,d.proxyAwareFetch)((0,f.U)("github").url,{headers:{Authorization:`token ${a}`,Accept:"application/json","X-GitHub-Api-Version":g.apiVersion,"User-Agent":g.userAgent,"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 e=await b.json();if(e.quota_snapshots){let a=e.quota_snapshots,b=(0,f.eZ)(e.quota_reset_date);return{plan:e.copilot_plan,resetDate:e.quota_reset_date,quotas:{chat:{...i(a.chat),resetAt:b},completions:{...i(a.completions),resetAt:b},premium_interactions:{...i(a.premium_interactions),resetAt:b}}}}if(e.monthly_quotas||e.limited_user_quotas){let a=e.monthly_quotas||{},b=e.limited_user_quotas||{},c=(0,f.eZ)(e.limited_user_reset_date);return{plan:e.copilot_plan||e.access_type_sku,resetDate:e.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 i(a){return a?{used:a.entitlement-a.remaining,total:a.entitlement,remaining:a.remaining,unlimited:a.unlimited||!1}:{used:0,total:0,unlimited:!0}}var j=c(75924),k=c(74129);let l={...(0,f.U)("antigravity"),...k.XP,userAgent:(0,j.A9)()};async function m(a,b,c=null){if(!a)return{plan:"Free",message:"Gemini CLI access token not available."};try{let d=(0,f.gD)(b?.projectId),e="Free";if(!d){let b=await n(a,c);d=(0,f.gD)(b?.cloudaicompanionProject),e=b?.currentTier?.name||e}if(!d)return{plan:e,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 g=await (0,f.u9)((0,f.U)("gemini-cli").quotaUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify({project:d})},1e4,c);if(!g.ok)return{plan:e,message:`Gemini CLI quota error (${g.status}).`};let h=await g.json(),i={};if(Array.isArray(h.buckets))for(let a of h.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);i[a.modelId]={used:d,total:1e3,resetAt:(0,f.eZ)(a.resetTime),remainingPercentage:100*b,unlimited:!1}}return{plan:e,quotas:i}}catch(a){return{message:`Gemini CLI error: ${a.message}`}}}async function n(a,b=null){try{let c=await (0,f.u9)((0,f.U)("gemini-cli").loadCodeAssistUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify({metadata:j.Cn})},1e4,b);if(!c.ok)return null;return await c.json()}catch{return null}}async function o(a,b,c=null){try{let b=await p(a,c),d=b?.cloudaicompanionProject||null,e=await (0,f.u9)(l.quotaApiUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,"User-Agent":l.userAgent,"Content-Type":"application/json","X-Client-Name":"antigravity","X-Client-Version":"1.107.0","x-request-source":"local"},body:JSON.stringify({...d?{project:d}:{}})},1e4,c);if(403===e.status)return{message:"Antigravity quota API access forbidden. Chat may still work.",quotas:{}};if(401===e.status)return{message:"Antigravity quota API authentication expired. Chat may still work.",quotas:{}};if(!e.ok)throw Error(`Antigravity API error: ${e.status}`);let g=await e.json(),h={};if(g.models){let a=["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","gemini-3.1-flash-image","gemini-3-pro-image"];for(let[b,c]of Object.entries(g.models)){if(!c.quotaInfo||c.isInternal||!a.includes(b))continue;let d=c.quotaInfo.remainingFraction||0,e=100*d,g=Math.round(1e3*d),i=1e3-g;h[b]={used:i,total:1e3,resetAt:(0,f.eZ)(c.quotaInfo.resetTime),remainingPercentage:e,unlimited:!1,displayName:c.displayName||b}}}return{plan:b?.currentTier?.name||"Unknown",quotas:h,subscriptionInfo:b}}catch(a){return console.error("[Antigravity Usage] Error:",a.message,a.cause),{message:`Antigravity error: ${a.message}`}}}async function p(a,b=null){try{let c=await (0,f.u9)(l.loadProjectApiUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,"User-Agent":l.userAgent,"Content-Type":"application/json","x-request-source":"local"},body:JSON.stringify({metadata:j.Cn,mode:1})},1e4,b);if(!c.ok)return null;return await c.json()}catch(a){return console.error("[Antigravity Subscription] Error:",a.message),null}}var q=c(69788),r=c(6551),s=c(6382);async function t(a,b,c=null){let e=b?.authMethod||"builder-id",g="api_key"===e,h=g?{tokentype:"API_KEY"}:{},i="external_idp"===e?{TokenType:"EXTERNAL_IDP"}:{},j=g?b?.profileArn||"":b?.profileArn||(0,s.We)(e),k=new URLSearchParams({isEmailRequired:"true",origin:"AI_EDITOR",resourceType:"AGENTIC_REQUEST"}),l=!1,m=[];for(let b of[{name:"codewhisperer-get",run:async()=>(0,d.proxyAwareFetch)(`${(0,f.U)("kiro").cwHost}${(0,f.U)("kiro").limitsPath}?${k.toString()}`,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","x-amz-user-agent":"aws-sdk-js/1.0.0 KiroIDE","user-agent":"aws-sdk-js/1.0.0 KiroIDE",...h,...i}},c)},{name:"codewhisperer-post",run:async()=>(0,d.proxyAwareFetch)((0,f.U)("kiro").cwHost,{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/x-amz-json-1.0","x-amz-target":"AmazonCodeWhispererService.GetUsageLimits",Accept:"application/json",...h,...i},body:JSON.stringify({origin:"AI_EDITOR",...j?{profileArn:j}:{},resourceType:"AGENTIC_REQUEST"})},c)},{name:"q-get",run:async()=>{let b=new URLSearchParams({origin:"AI_EDITOR",...j?{profileArn:j}:{},resourceType:"AGENTIC_REQUEST"});return(0,d.proxyAwareFetch)(`${(0,f.U)("kiro").qHost}${(0,f.U)("kiro").limitsPath}?${b}`,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json",...h,...i}},c)}}])try{let a=await b.run();if(!a.ok){let c=await a.text().catch(()=>"");(401===a.status||403===a.status)&&(l=!0),m.push(`${b.name}:${a.status}${c?`:${c}`:""}`);continue}let c=await a.json();return function(a){let b=a.usageBreakdownList||[],c={},d=(0,f.eZ)(a.nextDateReset||a.resetDate);return b.forEach(a=>{let b=a.resourceType?.toLowerCase()||"unknown",e=a.currentUsageWithPrecision||0,g=a.usageLimitWithPrecision||0;if(c[b]={used:e,total:g,remaining:g-e,resetAt:d,unlimited:!1},a.freeTrialInfo){let e=a.freeTrialInfo.currentUsageWithPrecision||0,g=a.freeTrialInfo.usageLimitWithPrecision||0;c[`${b}_freetrial`]={used:e,total:g,remaining:g-e,resetAt:(0,f.eZ)(a.freeTrialInfo.freeTrialExpiry||d),unlimited:!1}}}),{plan:a.subscriptionInfo?.subscriptionTitle||"Kiro",quotas:c}}(c)}catch(a){m.push(`${b.name}:${a.message}`)}return l&&"idc"===e?{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:{}}:l&&("google"===e||"github"===e)?{message:"Kiro quota API authentication expired. Chat may still work.",quotas:{}}:l?{message:"Kiro quota API rejected the current token. Chat may still work.",quotas:{}}:{message:m.length>0?`Unable to fetch Kiro usage right now. (${m[m.length-1]})`:"Unable to fetch Kiro usage right now.",quotas:{}}}let u={minimax:(0,f.U)("minimax").urls,"minimax-cn":(0,f.U)("minimax-cn").urls};function v(a,b,c){return a&&"object"==typeof a?a[b]??a[c]??null:null}function w(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 x(a){return Math.max(0,Number(v(a,"current_interval_total_count","currentIntervalTotalCount"))||0)}function y(a){return Math.max(0,Number(v(a,"current_weekly_total_count","currentWeeklyTotalCount"))||0)}function z(a){return!!(x(a)>0||y(a)>0)||null!==w(a,"current_interval_remaining_percent","currentIntervalRemainingPercent")||null!==w(a,"current_weekly_remaining_percent","currentWeeklyRemainingPercent")}function A(a,b,c,d,e,g,h,i,j,k){let l=d(c),m=w(c,h,i);if(l<=0&&null===m)return;let n=Math.max(0,Number(v(c,e,g))||0),o=l,p=n;l<=0&&(o=100,p=k?Math.round(m/100*o):Math.round(o*(1-m/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}}(o,p,function(a,b,c,d,e,g){let h=Number(v(a,c,d))||0;return h>0?new Date(b+h).toISOString():(0,f.eZ)(v(a,e,g))}(c,...j),k,m)}async function B(a,b,c=null){if(!a)return{message:"MiniMax API key not available."};let e=u[b]||[],f="";for(let b=0;b<e.length;b+=1){let g=e[b],h=b<e.length-1;try{let b=await (0,d.proxyAwareFetch)(g,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","Content-Type":"application/json"}},c),e=await b.text(),i={};if(e)try{i=JSON.parse(e)}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} ${e}`.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(z);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(v(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);A(s,`${b} (5h)`,a,x,"current_interval_usage_count","currentIntervalUsageCount","current_interval_remaining_percent","currentIntervalRemainingPercent",[q,"remains_time","remainsTime","end_time","endTime"],r),A(s,`${b} (7d)`,a,y,"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."}}let C="codebuddy-cn";function D(a,b){let c=Number(a??b);return Number.isFinite(c)?c:0}async function E(a,b,c,g=null){let h=a||b;if(!h)return{message:"CodeBuddy CN credential not available."};try{let a=await (0,d.proxyAwareFetch)((0,f.U)(C).url,{method:"POST",headers:{...e.xq[C]?.headers||{},Authorization:`Bearer ${h}`,"Content-Type":"application/json",Accept:"application/json"},body:"{}"},g);if(401===a.status||403===a.status)return{message:"CodeBuddy CN credential invalid or expired."};if(!a.ok)return{message:`CodeBuddy CN quota API error (${a.status}).`};let b=await a.json();if(b?.code!==0)return{message:`CodeBuddy CN quota error: ${b?.msg||"unknown"}`};let c=b?.data?.Response?.Data||{},i=Array.isArray(c.Accounts)?c.Accounts:[];if(0===i.length)return{message:"CodeBuddy CN connected. No credit package found."};let j=a=>{let b=(0,f.eZ)(a.CycleEndTime);return b?new Date(b).getTime():1/0},k=a=>{let b=j(a),c=Number(a.DeductionEndTime);return Number.isFinite(b)&&Number.isFinite(c)&&c-b>1728e5},l=(a,b)=>j(a)-j(b),m=i.filter(k).sort(l),n=i.filter(a=>!k(a)).sort(l),o={},p={};m.forEach(a=>{let b=function(a){let b=(0,f.eZ)(a.CycleStartTime),c=(0,f.eZ)(a.CycleEndTime);if(b&&c){let a=(new Date(c).getTime()-new Date(b).getTime())/864e5;if(a<=1.5)return"Daily";if(a<=10)return"Weekly"}return"Monthly"}(a);p[b]=(p[b]||0)+1,o[p[b]>1?`${b} ${p[b]}`:b]={used:D(a.CycleCapacityUsedPrecise,a.CycleCapacityUsed),total:D(a.CycleCapacitySizePrecise,a.CycleCapacitySize),resetAt:(0,f.eZ)(a.CycleEndTime),unlimited:!1,recurring:!0}}),n.forEach((a,b)=>{o[`Bonus Pack ${b+1}`]={used:D(a.CapacityUsedPrecise,a.CapacityUsed),total:D(a.CapacitySizePrecise,a.CapacitySize),resetAt:(0,f.eZ)(a.CycleEndTime),unlimited:!1,recurring:!1}});let q=m[0]||i[0]||{};return{plan:q.PackageName||q.SubProductName||"CodeBuddy CN",quotas:o}}catch(a){return{message:`CodeBuddy CN error: ${a.message}`}}}let F={international:(0,f.U)("glm").url,china:(0,f.U)("glm-cn").url},G=(0,f.U)("vercel-ai-gateway").url;async function H(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 I(a){try{return{message:"iFlow connected. Usage tracked per request."}}catch(a){return{message:"Unable to fetch iFlow usage."}}}async function J(a,b){try{return{plan:b?.plan||"Free",message:"Ollama Cloud uses a free tier with light usage limits (resets every 5h & 7d). For detailed usage tracking, visit ollama.com/settings/keys.",quotas:[]}}catch(a){return{message:"Unable to fetch Ollama Cloud usage."}}}async function K(a,b,c=null){if(!a)return{message:"GLM API key not available."};let e=F["glm-cn"===b?"china":"international"];try{let b=await (0,d.proxyAwareFetch)(e,{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}`}}}async function L(a,b=null){if(!a)return{message:"Vercel AI Gateway API key not available."};try{let c=await (0,d.proxyAwareFetch)(G,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},b);if(401===c.status||403===c.status)return{message:"Vercel AI Gateway API key invalid or expired."};if(!c.ok){let a=await c.text().catch(()=>""),b=a?`: ${a.slice(0,200)}`:"";return{message:`Vercel AI Gateway credits API error (${c.status})${b}`}}let e=await c.json(),f=Number(e?.balance)||0,g=Number(e?.total_used)||0;if(f<=0&&g<=0)return{plan:"Pay-as-you-go",message:"Vercel AI Gateway connected. No credit allocation found (BYOK or unfunded account).",quotas:{}};return{plan:"Pay-as-you-go",quotas:{"Used (USD)":{used:g,total:0,remaining:0,remainingPercentage:100,unlimited:!0},"Remaining (USD)":{used:f,total:5,remaining:f,remainingPercentage:f/5*100,unlimited:!1}}}}catch(a){return{message:`Vercel AI Gateway error: ${a.message}`}}}async function M(a,b=null){if(!a)return{message:"Qoder usage unavailable: no access token"};try{let c=await (0,d.proxyAwareFetch)((0,f.U)("qoder").url,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},b);if(!c.ok)return{message:`Qoder connected. Usage fetch returned ${c.status}.`};let e=await c.json().catch(()=>null);if(!e)return{message:"Qoder connected. Usage response was not JSON."};let g=e.userQuota||{},h=e.orgResourcePackage||{},i=Number.isFinite(Number(e.expiresAt))&&Number(e.expiresAt)>0?Number(e.expiresAt):null,j=i?new Date(i).toISOString():null;return{quotas:{user:{total:Number(g.total)||0,used:Number(g.used)||0,remaining:Number(g.remaining)||0,unit:g.unit||"credits",resetAt:j},organization:{total:Number(h.total)||0,used:Number(h.used)||0,remaining:Number(h.remaining)||0,unit:h.unit||"credits",resetAt:j}},totalUsagePercentage:Number(e.totalUsagePercentage)||0,isQuotaExceeded:!!e.isQuotaExceeded,expiresAt:i}}catch(a){return{message:`Qoder connected. Unable to fetch usage: ${a.message}`}}}let N={github:a=>h(a.accessToken,a.providerSpecificData,a.proxyOptions),"gemini-cli":a=>m(a.accessToken,a.providerDataWithProjectId,a.proxyOptions),antigravity:a=>o(a.accessToken,a.providerSpecificData,a.proxyOptions),claude:a=>(0,q.g)(a.accessToken,a.proxyOptions),codex:a=>(0,r.Tl)(a.accessToken,a.proxyOptions),kiro:a=>t(a.accessToken,a.providerSpecificData,a.proxyOptions),qoder:a=>M(a.accessToken,a.proxyOptions),qwen:a=>H(a.accessToken,a.providerSpecificData),iflow:a=>I(a.accessToken),ollama:a=>J(a.accessToken),glm:a=>K(a.apiKey,a.provider,a.proxyOptions),"glm-cn":a=>K(a.apiKey,a.provider,a.proxyOptions),minimax:a=>B(a.apiKey,a.provider,a.proxyOptions),"minimax-cn":a=>B(a.apiKey,a.provider,a.proxyOptions),"vercel-ai-gateway":a=>L(a.apiKey,a.proxyOptions),"codebuddy-cn":a=>E(a.accessToken,a.apiKey,a.providerSpecificData,a.proxyOptions)};async function O(a,b=null){let{provider:c,accessToken:d,apiKey:e,providerSpecificData:f,projectId:g}=a,h={...f||{},...g?{projectId:g}:{}},i=N[c];return i?await i({provider:c,accessToken:d,apiKey:e,providerSpecificData:f,providerDataWithProjectId:h,proxyOptions:b}):{message:`Usage API not implemented for ${c}`}}}};
1
+ "use strict";exports.id=8271,exports.ids=[615,1998,8271],exports.modules={6551:(a,b,c)=>{c.d(b,{RO:()=>m,Tl:()=>k,Yt:()=>l});var d=c(39609),e=c(24295);let f={usageUrl:(0,e.U)("codex").url,resetCreditsUrl:(0,e.U)("codex").resetCreditsUrl,resetCreditsConsumeUrl:(0,e.U)("codex").resetCreditsConsumeUrl};function g(a){if(!a)return null;let b=a instanceof Date?a:new Date("number"==typeof a&&a<1e12?1e3*a:a);return Number.isFinite(b.getTime())?b.toISOString():null}function h(a){return!a||"object"!=typeof a||Array.isArray(a)?null:a.rate_limit&&"object"==typeof a.rate_limit?a.rate_limit:a}function i(a){let b=Math.max(0,Math.min(100,(0,e.IQ)(a?.used_percent??a?.percent_used,0)));return{used:b,total:100,remaining:Math.max(0,100-b),resetAt:(0,e.eZ)(a?.reset_at??a?.resets_at??a?.resetAt??null),unlimited:!1}}function j(a,b,c){let d=h(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;return e&&(a[b?`${b}_session`:"session"]=i(e),g=!0),f&&(a[b?`${b}_weekly`:"weekly"]=i(f),g=!0),g}async function k(a,b=null){try{let c=await (0,d.proxyAwareFetch)(f.usageUrl,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},b);if(!c.ok)return{message:`Codex connected. Usage API temporarily unavailable (${c.status}).`};let g=await c.json(),i=g.rate_limit||g.rate_limits||g.rate_limits_by_limit_id?.codex||{},k=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}(g),l=Math.max(0,(0,e.IQ)(g.rate_limit_reset_credits?.available_count,0)),m={};return j(m,"",i),j(m,"review",k),{plan:g.plan_type||g.summary?.plan||"unknown",limitReached:h(i)?.limit_reached||!1,reviewLimitReached:h(k)?.limit_reached||!1,resetCredits:{availableCount:l},quotas:m}}catch(a){throw Error(`Failed to fetch Codex usage: ${a.message}`)}}async function l(a,b=null,c=null){if(!a)throw Error("No Codex access token available. Please re-authorize the connection.");let h=c?.workspaceId||c?.accountId||c?.chatgptAccountId||null,i={Authorization:`Bearer ${a}`,Accept:"application/json","OpenAI-Beta":"codex-1",originator:"codex_cli_rs"};h&&(i["ChatGPT-Account-ID"]=h);let j=await (0,d.proxyAwareFetch)(f.resetCreditsUrl,{method:"GET",headers:i},b),k=null;try{k=await j.json()}catch{k=null}if(!j.ok)throw Error(k?.message||k?.error||k?.detail||`Codex reset credits API unavailable (${j.status}).`);let m=Array.isArray(k?.credits)?k.credits:[];return{availableCount:Math.max(0,(0,e.IQ)(k?.available_count??k?.availableCount,0)),credits:m.map(a=>({status:String(a?.status||"unknown"),grantedAt:g(a?.granted_at??a?.grantedAt),expiresAt:g(a?.expires_at??a?.expiresAt)}))}}async function m(a,b,c=null){let g;if(!a)throw Error("No Codex access token available. Please re-authorize the connection.");if(!b||"string"!=typeof b)throw Error("A redeem request id is required to consume a Codex reset credit.");let h=null;try{g=await (0,d.proxyAwareFetch)(f.resetCreditsConsumeUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({redeem_request_id:b})},c);let e=await g.text();h=e?JSON.parse(e):null}catch(a){throw Error(`Failed to consume Codex reset credit: ${a.message}`)}let i=h?.code||null,j=(0,e.IQ)(h?.windows_reset,0);return{ok:g.ok&&("reset"===i||j>0),noCredit:g.ok&&"no_credit"===i,status:g.status,code:i,windowsReset:j,message:h?.message||null,raw:h}}},18271:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>m,refreshAndUpdateCredentials:()=>l});var e=c(48895),f=c(89718),g=c(99002),h=c(55330),i=c(39326),j=c(40615),k=a([e,h]);[e,h]=k.then?(await k)():k;let n=["expired","authentication","unauthorized","401","re-authorize"];async function l(a,b=!1,c=null){let d=(0,h.SB)(a.provider),e={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||d.needsRefresh(e)))return{connection:a,refreshed:!1};let g=await d.refreshCredentials(e,console,c);if(!g){if(a.accessToken)return{connection:a,refreshed:!1};throw Error("Failed to refresh credentials. Please re-authorize the connection.")}let i={updatedAt:new Date().toISOString()};g.accessToken&&(i.accessToken=g.accessToken),g.refreshToken&&(i.refreshToken=g.refreshToken),g.idToken&&(i.idToken=g.idToken),g.lastRefreshAt&&(i.lastRefreshAt=g.lastRefreshAt),g.expiresIn?(i.expiresAt=new Date(Date.now()+1e3*g.expiresIn).toISOString(),i.expiresIn=g.expiresIn):g.expiresAt&&(i.expiresAt=g.expiresAt);let j={...g.providerSpecificData||{},...g.copilotToken?{copilotToken:g.copilotToken}:{},...g.copilotTokenExpiresAt?{copilotTokenExpiresAt:g.copilotTokenExpiresAt}:{}};return Object.keys(j).length>0&&(i.providerSpecificData={...a.providerSpecificData||{},...j}),await (0,f.updateProviderConnection)(a.id,i),{connection:{...a,...i,providerSpecificData:i.providerSpecificData||a.providerSpecificData},refreshed:!0}}async function m(a,{params:b}){let c;try{let{connectionId:a}=await b;if(!(c=await (0,f.Mc)(a)))return Response.json({error:"Connection not found"},{status:404});let d="oauth"===c.authType,e=("apikey"===c.authType||"api_key"===c.authType)&&j.jO.includes(c.provider);if(!d&&!e)return Response.json({message:"Usage not available for this connection"});let h=await (0,i.B)(c.providerSpecificData),k={connectionProxyEnabled:!0===h.connectionProxyEnabled,connectionProxyUrl:h.connectionProxyUrl||"",connectionNoProxy:h.connectionNoProxy||"",vercelRelayUrl:h.vercelRelayUrl||"",strictProxy:!1};if(d)try{c=(await l(c,!1,k)).connection}catch(a){return console.error("[Usage API] Credential refresh failed:",a),Response.json({error:`Credential refresh failed: ${a.message}`},{status:401})}let m=await (0,g.my)(c,k);if(d&&function(a){if(!a?.message)return!1;let b=a.message.toLowerCase();return n.some(a=>b.includes(a))}(m)&&c.refreshToken)try{c=(await l(c,!0,k)).connection,m=await (0,g.my)(c,k)}catch(a){console.warn(`[Usage] ${c.provider}: force refresh failed: ${a.message}`)}return Response.json(m)}catch(b){let a=c?.provider??"unknown";return console.warn(`[Usage] ${a}: ${b.message}`),Response.json({error:b.message},{status:500})}}d()}catch(a){d(a)}})},24295:(a,b,c)=>{c.d(b,{IQ:()=>h,U:()=>f,eZ:()=>g,gD:()=>i,u9:()=>j});var d=c(26070),e=c(39609);let f=a=>d.xq[a]?.usage||{};function g(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 h(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 i(a){return"string"==typeof a?a.trim()||null:a&&"object"==typeof a&&"string"==typeof a.id&&a.id.trim()||null}async function j(a,b,c=1e4,d=null){let f=new AbortController,g=setTimeout(()=>f.abort(),c);try{return await (0,e.proxyAwareFetch)(a,{...b,signal:f.signal},d)}finally{clearTimeout(g)}}},39326:(a,b,c)=>{c.d(b,{B:()=>f});var d=c(71998);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}}}},40615:(a,b,c)=>{c.d(b,{AI_PROVIDERS:()=>s,js:()=>w,DI:()=>n,fg:()=>k,Pd:()=>o,IS:()=>h,nJ:()=>i,zN:()=>j,JH:()=>m,jO:()=>y,wb:()=>x,br:()=>l,wG:()=>v,zt:()=>t,gb:()=>q,gC:()=>r,mq:()=>p,rs:()=>u});var d=c(76282);let e="⚠️ 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.";Object.fromEntries(d.A.filter(a=>a.display).map(a=>{let b;return[a.id,"RISK_NOTICE"===(b=a.display).deprecationNotice?{...b,deprecationNotice:e}:b]}));let f=["serviceKinds","ttsConfig","sttConfig","embeddingConfig","imageConfig","imageToTextConfig","videoConfig","musicConfig","searchViaChat","searchConfig","fetchConfig","modelsFetcher","mediaPriority","hiddenKinds"],g=a=>Object.fromEntries(d.A.filter(b=>b.category===a).map(a=>[a.id,function(a){let b={};for(let c of(a.media&&Object.assign(b,a.media),f))void 0!==a[c]&&(b[c]=a[c]);let c={...a.display||{}};return"RISK_NOTICE"===c.deprecationNotice&&(c.deprecationNotice=e),{...c,id:a.id,alias:a.uiAlias||a.alias,...a.hidden?{hidden:!0}:{},...b,...void 0!==a.priority?{priority:a.priority}:{},...a.hasFree?{hasFree:!0}:{},...a.thinkingConfig?{thinkingConfig:a.thinkingConfig}:{},...a.regions?{regions:a.regions,defaultRegion:a.defaultRegion}:{},...a.hasProviderSpecificData?{hasProviderSpecificData:!0}:{},...a.noAuth?{noAuth:!0}:{},...a.passthroughModels?{passthroughModels:!0}:{},...a.hasOAuth?{hasOAuth:!0}:{},...a.authModes?{authModes:a.authModes}:{},...a.authType?{authType:a.authType}:{},...a.authHint?{authHint:a.authHint}:{},...a.comingSoon?{comingSoon:!0}:{}}}(a)])),h=g("free"),i=g("freeTier"),j=g("oauth"),k=g("apikey"),l=g("webCookie"),m="openai-compatible-",n="anthropic-compatible-",o="custom-embedding-";function p(a){return"string"==typeof a&&a.startsWith(m)}function q(a){return"string"==typeof a&&a.startsWith(n)}function r(a){return"string"==typeof a&&a.startsWith(o)}let s={...h,...i,...j,...k,...l};function t(a){for(let b of Object.values(s))if(b.alias===a||b.id===a)return b;return null}function u(a){let b=t(a);return b?.id||a}function v(a){let b=s[a];return b?.alias||a}let w=Object.values(s).reduce((a,b)=>(a[b.alias]=b.id,a),{});Object.values(s).reduce((a,b)=>(a[b.id]=b.alias,a),{});let x=d.A.filter(a=>a.features?.usage).map(a=>a.id),y=d.A.filter(a=>a.features?.usageApikey).map(a=>a.id)},69788:(a,b,c)=>{c.d(b,{g:()=>i});var d=c(39609),e=c(74129),f=c(24295);let g={oauthUsageUrl:(0,f.U)("claude").oauthUrl,usageUrl:(0,f.U)("claude").orgUrl,settingsUrl:(0,f.U)("claude").settingsUrl,apiVersion:e.b8},h=new Map;async function i(a,b=null){try{let c=h.get(a);if(c&&Date.now()<c)return await j(a,b);let e=await (0,d.proxyAwareFetch)(g.oauthUsageUrl,{method:"GET",headers:{Authorization:`Bearer ${a}`,"anthropic-beta":"oauth-2025-04-20","anthropic-version":g.apiVersion}},b);if(e.ok){let a=await e.json(),b={},c=a=>a&&"object"==typeof a&&"number"==typeof a.utilization,d=a=>{let b=a.utilization,c=Math.max(0,100-b);return{used:b,total:100,remaining:c,remainingPercentage:c,resetAt:(0,f.eZ)(a.resets_at),unlimited:!1}};for(let[e,f]of(c(a.five_hour)&&(b["session (5h)"]=d(a.five_hour)),c(a.seven_day)&&(b["weekly (7d)"]=d(a.seven_day)),Object.entries(a)))if(e.startsWith("seven_day_")&&"seven_day"!==e&&c(f)){let a=e.replace("seven_day_","");b[`weekly ${a} (7d)`]=d(f)}return{plan:"Claude Code",extraUsage:a.extra_usage??null,quotas:b}}return 429===e.status&&h.set(a,Date.now()+18e4),console.warn(`[Claude Usage] OAuth endpoint returned ${e.status}, falling back to legacy`),await j(a,b)}catch(a){return{message:`Claude connected. Unable to fetch usage: ${a.message}`}}}async function j(a,b=null){try{let c=await (0,d.proxyAwareFetch)(g.settingsUrl,{method:"GET",headers:{Authorization:`Bearer ${a}`,"anthropic-version":g.apiVersion}},b);if(c.ok){let e=await c.json();if(e.organization_id){let c=await (0,d.proxyAwareFetch)(g.usageUrl.replace("{org_id}",e.organization_id),{method:"GET",headers:{Authorization:`Bearer ${a}`,"anthropic-version":g.apiVersion}},b);if(c.ok){let a=await c.json();return{plan:e.plan||"Unknown",organization:e.organization_name,quotas:a}}}return{plan:e.plan||"Unknown",organization:e.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}`}}}},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(89718)},99002:(a,b,c)=>{c.d(b,{RO:()=>r.RO,Yt:()=>r.Yt,my:()=>O});var d=c(39609),e=c(26070),f=c(24295);let g={apiVersion:e.sr.github?.apiVersion,userAgent:e.sr.github?.userAgent};async function h(a,b,c=null){try{if(!a)throw Error("No GitHub access token available. Please re-authorize the connection.");let b=await (0,d.proxyAwareFetch)((0,f.U)("github").url,{headers:{Authorization:`token ${a}`,Accept:"application/json","X-GitHub-Api-Version":g.apiVersion,"User-Agent":g.userAgent,"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 e=await b.json();if(e.quota_snapshots){let a=e.quota_snapshots,b=(0,f.eZ)(e.quota_reset_date);return{plan:e.copilot_plan,resetDate:e.quota_reset_date,quotas:{chat:{...i(a.chat),resetAt:b},completions:{...i(a.completions),resetAt:b},premium_interactions:{...i(a.premium_interactions),resetAt:b}}}}if(e.monthly_quotas||e.limited_user_quotas){let a=e.monthly_quotas||{},b=e.limited_user_quotas||{},c=(0,f.eZ)(e.limited_user_reset_date);return{plan:e.copilot_plan||e.access_type_sku,resetDate:e.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 i(a){return a?{used:a.entitlement-a.remaining,total:a.entitlement,remaining:a.remaining,unlimited:a.unlimited||!1}:{used:0,total:0,unlimited:!0}}var j=c(75924),k=c(74129);let l={...(0,f.U)("antigravity"),...k.XP,userAgent:(0,j.A9)()};async function m(a,b,c=null){if(!a)return{plan:"Free",message:"Gemini CLI access token not available."};try{let d=(0,f.gD)(b?.projectId),e="Free";if(!d){let b=await n(a,c);d=(0,f.gD)(b?.cloudaicompanionProject),e=b?.currentTier?.name||e}if(!d)return{plan:e,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 g=await (0,f.u9)((0,f.U)("gemini-cli").quotaUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify({project:d})},1e4,c);if(!g.ok)return{plan:e,message:`Gemini CLI quota error (${g.status}).`};let h=await g.json(),i={};if(Array.isArray(h.buckets))for(let a of h.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);i[a.modelId]={used:d,total:1e3,resetAt:(0,f.eZ)(a.resetTime),remainingPercentage:100*b,unlimited:!1}}return{plan:e,quotas:i}}catch(a){return{message:`Gemini CLI error: ${a.message}`}}}async function n(a,b=null){try{let c=await (0,f.u9)((0,f.U)("gemini-cli").loadCodeAssistUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify({metadata:j.Cn})},1e4,b);if(!c.ok)return null;return await c.json()}catch{return null}}async function o(a,b,c=null){try{let b=await p(a,c),d=b?.cloudaicompanionProject||null,e=await (0,f.u9)(l.quotaApiUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,"User-Agent":l.userAgent,"Content-Type":"application/json","X-Client-Name":"antigravity","X-Client-Version":"1.107.0","x-request-source":"local"},body:JSON.stringify({...d?{project:d}:{}})},1e4,c);if(403===e.status)return{message:"Antigravity quota API access forbidden. Chat may still work.",quotas:{}};if(401===e.status)return{message:"Antigravity quota API authentication expired. Chat may still work.",quotas:{}};if(!e.ok)throw Error(`Antigravity API error: ${e.status}`);let g=await e.json(),h={};if(g.models){let a=["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","gemini-3.1-flash-image","gemini-3-pro-image"];for(let[b,c]of Object.entries(g.models)){if(!c.quotaInfo||c.isInternal||!a.includes(b))continue;let d=c.quotaInfo.remainingFraction||0,e=100*d,g=Math.round(1e3*d),i=1e3-g;h[b]={used:i,total:1e3,resetAt:(0,f.eZ)(c.quotaInfo.resetTime),remainingPercentage:e,unlimited:!1,displayName:c.displayName||b}}}return{plan:b?.currentTier?.name||"Unknown",quotas:h,subscriptionInfo:b}}catch(a){return console.error("[Antigravity Usage] Error:",a.message,a.cause),{message:`Antigravity error: ${a.message}`}}}async function p(a,b=null){try{let c=await (0,f.u9)(l.loadProjectApiUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,"User-Agent":l.userAgent,"Content-Type":"application/json","x-request-source":"local"},body:JSON.stringify({metadata:j.Cn,mode:1})},1e4,b);if(!c.ok)return null;return await c.json()}catch(a){return console.error("[Antigravity Subscription] Error:",a.message),null}}var q=c(69788),r=c(6551),s=c(6382);async function t(a,b,c=null){let e=b?.authMethod||"builder-id",g="api_key"===e,h=g?{tokentype:"API_KEY"}:{},i="external_idp"===e?{TokenType:"EXTERNAL_IDP"}:{},j=g?b?.profileArn||"":b?.profileArn||(0,s.We)(e),k=new URLSearchParams({isEmailRequired:"true",origin:"AI_EDITOR",resourceType:"AGENTIC_REQUEST"}),l=!1,m=[];for(let b of[{name:"codewhisperer-get",run:async()=>(0,d.proxyAwareFetch)(`${(0,f.U)("kiro").cwHost}${(0,f.U)("kiro").limitsPath}?${k.toString()}`,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","x-amz-user-agent":"aws-sdk-js/1.0.0 KiroIDE","user-agent":"aws-sdk-js/1.0.0 KiroIDE",...h,...i}},c)},{name:"codewhisperer-post",run:async()=>(0,d.proxyAwareFetch)((0,f.U)("kiro").cwHost,{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/x-amz-json-1.0","x-amz-target":"AmazonCodeWhispererService.GetUsageLimits",Accept:"application/json",...h,...i},body:JSON.stringify({origin:"AI_EDITOR",...j?{profileArn:j}:{},resourceType:"AGENTIC_REQUEST"})},c)},{name:"q-get",run:async()=>{let b=new URLSearchParams({origin:"AI_EDITOR",...j?{profileArn:j}:{},resourceType:"AGENTIC_REQUEST"});return(0,d.proxyAwareFetch)(`${(0,f.U)("kiro").qHost}${(0,f.U)("kiro").limitsPath}?${b}`,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json",...h,...i}},c)}}])try{let a=await b.run();if(!a.ok){let c=await a.text().catch(()=>"");(401===a.status||403===a.status)&&(l=!0),m.push(`${b.name}:${a.status}${c?`:${c}`:""}`);continue}let c=await a.json();return function(a){let b=a.usageBreakdownList||[],c={},d=(0,f.eZ)(a.nextDateReset||a.resetDate);return b.forEach(a=>{let b=a.resourceType?.toLowerCase()||"unknown",e=a.currentUsageWithPrecision||0,g=a.usageLimitWithPrecision||0;if(c[b]={used:e,total:g,remaining:g-e,resetAt:d,unlimited:!1},a.freeTrialInfo){let e=a.freeTrialInfo.currentUsageWithPrecision||0,g=a.freeTrialInfo.usageLimitWithPrecision||0;c[`${b}_freetrial`]={used:e,total:g,remaining:g-e,resetAt:(0,f.eZ)(a.freeTrialInfo.freeTrialExpiry||d),unlimited:!1}}}),{plan:a.subscriptionInfo?.subscriptionTitle||"Kiro",quotas:c}}(c)}catch(a){m.push(`${b.name}:${a.message}`)}return l&&"idc"===e?{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:{}}:l&&("google"===e||"github"===e)?{message:"Kiro quota API authentication expired. Chat may still work.",quotas:{}}:l?{message:"Kiro quota API rejected the current token. Chat may still work.",quotas:{}}:{message:m.length>0?`Unable to fetch Kiro usage right now. (${m[m.length-1]})`:"Unable to fetch Kiro usage right now.",quotas:{}}}let u={minimax:(0,f.U)("minimax").urls,"minimax-cn":(0,f.U)("minimax-cn").urls};function v(a,b,c){return a&&"object"==typeof a?a[b]??a[c]??null:null}function w(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 x(a){return Math.max(0,Number(v(a,"current_interval_total_count","currentIntervalTotalCount"))||0)}function y(a){return Math.max(0,Number(v(a,"current_weekly_total_count","currentWeeklyTotalCount"))||0)}function z(a){return!!(x(a)>0||y(a)>0)||null!==w(a,"current_interval_remaining_percent","currentIntervalRemainingPercent")||null!==w(a,"current_weekly_remaining_percent","currentWeeklyRemainingPercent")}function A(a,b,c,d,e,g,h,i,j,k){let l=d(c),m=w(c,h,i);if(l<=0&&null===m)return;let n=Math.max(0,Number(v(c,e,g))||0),o=l,p=n;l<=0&&(o=100,p=k?Math.round(m/100*o):Math.round(o*(1-m/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}}(o,p,function(a,b,c,d,e,g){let h=Number(v(a,c,d))||0;return h>0?new Date(b+h).toISOString():(0,f.eZ)(v(a,e,g))}(c,...j),k,m)}async function B(a,b,c=null){if(!a)return{message:"MiniMax API key not available."};let e=u[b]||[],f="";for(let b=0;b<e.length;b+=1){let g=e[b],h=b<e.length-1;try{let b=await (0,d.proxyAwareFetch)(g,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","Content-Type":"application/json"}},c),e=await b.text(),i={};if(e)try{i=JSON.parse(e)}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} ${e}`.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(z);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(v(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);A(s,`${b} (5h)`,a,x,"current_interval_usage_count","currentIntervalUsageCount","current_interval_remaining_percent","currentIntervalRemainingPercent",[q,"remains_time","remainsTime","end_time","endTime"],r),A(s,`${b} (7d)`,a,y,"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."}}let C="codebuddy-cn";function D(a,b){let c=Number(a??b);return Number.isFinite(c)?c:0}async function E(a,b,c,g=null){let h=a||b;if(!h)return{message:"CodeBuddy CN credential not available."};try{let a=await (0,d.proxyAwareFetch)((0,f.U)(C).url,{method:"POST",headers:{...e.xq[C]?.headers||{},Authorization:`Bearer ${h}`,"Content-Type":"application/json",Accept:"application/json"},body:"{}"},g);if(401===a.status||403===a.status)return{message:"CodeBuddy CN credential invalid or expired."};if(!a.ok)return{message:`CodeBuddy CN quota API error (${a.status}).`};let b=await a.json();if(b?.code!==0)return{message:`CodeBuddy CN quota error: ${b?.msg||"unknown"}`};let c=b?.data?.Response?.Data||{},i=Array.isArray(c.Accounts)?c.Accounts:[];if(0===i.length)return{message:"CodeBuddy CN connected. No credit package found."};let j=a=>{let b=(0,f.eZ)(a.CycleEndTime);return b?new Date(b).getTime():1/0},k=a=>{let b=j(a),c=Number(a.DeductionEndTime);return Number.isFinite(b)&&Number.isFinite(c)&&c-b>1728e5},l=(a,b)=>j(a)-j(b),m=i.filter(k).sort(l),n=i.filter(a=>!k(a)).sort(l),o={},p={};m.forEach(a=>{let b=function(a){let b=(0,f.eZ)(a.CycleStartTime),c=(0,f.eZ)(a.CycleEndTime);if(b&&c){let a=(new Date(c).getTime()-new Date(b).getTime())/864e5;if(a<=1.5)return"Daily";if(a<=10)return"Weekly"}return"Monthly"}(a);p[b]=(p[b]||0)+1,o[p[b]>1?`${b} ${p[b]}`:b]={used:D(a.CycleCapacityUsedPrecise,a.CycleCapacityUsed),total:D(a.CycleCapacitySizePrecise,a.CycleCapacitySize),resetAt:(0,f.eZ)(a.CycleEndTime),unlimited:!1,recurring:!0}}),n.forEach((a,b)=>{o[`Bonus Pack ${b+1}`]={used:D(a.CapacityUsedPrecise,a.CapacityUsed),total:D(a.CapacitySizePrecise,a.CapacitySize),resetAt:(0,f.eZ)(a.CycleEndTime),unlimited:!1,recurring:!1}});let q=m[0]||i[0]||{};return{plan:q.PackageName||q.SubProductName||"CodeBuddy CN",quotas:o}}catch(a){return{message:`CodeBuddy CN error: ${a.message}`}}}let F={international:(0,f.U)("glm").url,china:(0,f.U)("glm-cn").url},G=(0,f.U)("vercel-ai-gateway").url;async function H(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 I(a){try{return{message:"iFlow connected. Usage tracked per request."}}catch(a){return{message:"Unable to fetch iFlow usage."}}}async function J(a,b){try{return{plan:b?.plan||"Free",message:"Ollama Cloud uses a free tier with light usage limits (resets every 5h & 7d). For detailed usage tracking, visit ollama.com/settings/keys.",quotas:[]}}catch(a){return{message:"Unable to fetch Ollama Cloud usage."}}}async function K(a,b,c=null){if(!a)return{message:"GLM API key not available."};let e=F["glm-cn"===b?"china":"international"];try{let b=await (0,d.proxyAwareFetch)(e,{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}`}}}async function L(a,b=null){if(!a)return{message:"Vercel AI Gateway API key not available."};try{let c=await (0,d.proxyAwareFetch)(G,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},b);if(401===c.status||403===c.status)return{message:"Vercel AI Gateway API key invalid or expired."};if(!c.ok){let a=await c.text().catch(()=>""),b=a?`: ${a.slice(0,200)}`:"";return{message:`Vercel AI Gateway credits API error (${c.status})${b}`}}let e=await c.json(),f=Number(e?.balance)||0,g=Number(e?.total_used)||0;if(f<=0&&g<=0)return{plan:"Pay-as-you-go",message:"Vercel AI Gateway connected. No credit allocation found (BYOK or unfunded account).",quotas:{}};return{plan:"Pay-as-you-go",quotas:{"Used (USD)":{used:g,total:0,remaining:0,remainingPercentage:100,unlimited:!0},"Remaining (USD)":{used:f,total:5,remaining:f,remainingPercentage:f/5*100,unlimited:!1}}}}catch(a){return{message:`Vercel AI Gateway error: ${a.message}`}}}async function M(a,b=null){if(!a)return{message:"Qoder usage unavailable: no access token"};try{let c=await (0,d.proxyAwareFetch)((0,f.U)("qoder").url,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},b);if(!c.ok)return{message:`Qoder connected. Usage fetch returned ${c.status}.`};let e=await c.json().catch(()=>null);if(!e)return{message:"Qoder connected. Usage response was not JSON."};let g=e.userQuota||{},h=e.orgResourcePackage||{},i=Number.isFinite(Number(e.expiresAt))&&Number(e.expiresAt)>0?Number(e.expiresAt):null,j=i?new Date(i).toISOString():null;return{quotas:{user:{total:Number(g.total)||0,used:Number(g.used)||0,remaining:Number(g.remaining)||0,unit:g.unit||"credits",resetAt:j},organization:{total:Number(h.total)||0,used:Number(h.used)||0,remaining:Number(h.remaining)||0,unit:h.unit||"credits",resetAt:j}},totalUsagePercentage:Number(e.totalUsagePercentage)||0,isQuotaExceeded:!!e.isQuotaExceeded,expiresAt:i}}catch(a){return{message:`Qoder connected. Unable to fetch usage: ${a.message}`}}}let N={github:a=>h(a.accessToken,a.providerSpecificData,a.proxyOptions),"gemini-cli":a=>m(a.accessToken,a.providerDataWithProjectId,a.proxyOptions),antigravity:a=>o(a.accessToken,a.providerSpecificData,a.proxyOptions),claude:a=>(0,q.g)(a.accessToken,a.proxyOptions),codex:a=>(0,r.Tl)(a.accessToken,a.proxyOptions),kiro:a=>t(a.accessToken,a.providerSpecificData,a.proxyOptions),qoder:a=>M(a.accessToken,a.proxyOptions),qwen:a=>H(a.accessToken,a.providerSpecificData),iflow:a=>I(a.accessToken),ollama:a=>J(a.accessToken),glm:a=>K(a.apiKey,a.provider,a.proxyOptions),"glm-cn":a=>K(a.apiKey,a.provider,a.proxyOptions),minimax:a=>B(a.apiKey,a.provider,a.proxyOptions),"minimax-cn":a=>B(a.apiKey,a.provider,a.proxyOptions),"vercel-ai-gateway":a=>L(a.apiKey,a.proxyOptions),"codebuddy-cn":a=>E(a.accessToken,a.apiKey,a.providerSpecificData,a.proxyOptions)};async function O(a,b=null){let{provider:c,accessToken:d,apiKey:e,providerSpecificData:f,projectId:g}=a,h={...f||{},...g?{projectId:g}:{}},i=N[c];return i?await i({provider:c,accessToken:d,apiKey:e,providerSpecificData:f,providerDataWithProjectId:h,proxyOptions:b}):{message:`Usage API not implemented for ${c}`}}}};
@@ -54,7 +54,7 @@ ${b}
54
54
  \`\`\`
55
55
  Respond ONLY with the JSON object, no other text.`)}else"json_object"===a.type&&l.push("You must respond with valid JSON. Respond ONLY with a JSON object, no other text.")}let n={type:k.R4.TEXT,text:f.Co};if(l.length>0){let a=l.join("\n");e.system=[n,{type:k.R4.TEXT,text:a,cache_control:{type:"ephemeral",ttl:"1h"}}]}else e.system=[n];if(b.tools&&Array.isArray(b.tools)){for(let a of(e.tools=[],b.tools)){let b=a.type;if(b&&b!==k.x4.FUNCTION){e.tools.push(a);continue}let c=b===k.x4.FUNCTION&&a.function?a.function:a,f=c.name,g=""+f;d.set(g,f),e.tools.push({name:g,description:c.description||"",input_schema:c.parameters||c.input_schema||{type:"object",properties:{},required:[]}})}e.tools.length>0&&(e.tools[e.tools.length-1].cache_control={type:"ephemeral",ttl:"1h"})}return b.tool_choice&&(e.tool_choice=function(a){if(!a)return{type:"auto"};if("string"==typeof a)return"required"===a?{type:"any"}:{type:"auto"};if("object"==typeof a){if(a.function?.name)return{type:"tool",name:a.function.name};if(m.has(a.type))return a}return{type:"auto"}}(b.tool_choice)),d.size>0&&(e._toolNameMap=d),e}let m=new Set(["auto","any","tool","none"]);function n(a,b,c){let d=l(a,b,c);return d.system&&Array.isArray(d.system)&&(d.system=d.system.filter(a=>!a.text||!a.text.includes("You are Claude Code")),0===d.system.length&&delete d.system),d.tools&&Array.isArray(d.tools)&&(d.tools=d.tools.map(a=>a.name&&a.name.startsWith("")?{...a,name:a.name.slice(0)}:a)),d.messages&&Array.isArray(d.messages)&&(d.messages=d.messages.map(a=>{if(!a.content||!Array.isArray(a.content))return a;let b=a.content.map(a=>a.type===k.R4.TOOL_USE&&a.name&&a.name.startsWith("")?{...a,name:a.name.slice(0)}:a);return{...a,content:b}})),d}(0,d.kz)(e.h.OPENAI,e.h.CLAUDE,l,null)},21855:(a,b,c)=>{c.d(b,{F:()=>e,Q:()=>f});var d=c(69320);function e(a,b){switch(b){case"claude":switch(a){case d.Ut.END_TURN:return d.bC.STOP;case d.Ut.MAX_TOKENS:return d.bC.LENGTH;case d.Ut.TOOL_USE:return d.bC.TOOL_CALLS;case d.Ut.STOP_SEQUENCE:default:return d.bC.STOP}case"commandcode":switch(a){case"stop":case"error":return d.bC.STOP;case"length":return d.bC.LENGTH;case"tool-calls":case"tool_use":return d.bC.TOOL_CALLS;case"content-filter":return d.bC.CONTENT_FILTER;default:return a||d.bC.STOP}case"gemini":switch(String(a).toUpperCase()){case d.a_.STOP:return d.bC.STOP;case d.a_.MAX_TOKENS:return d.bC.LENGTH;case d.a_.SAFETY:case d.a_.RECITATION:case d.a_.BLOCKLIST:case d.a_.PROHIBITED_CONTENT:return d.bC.CONTENT_FILTER;default:return d.bC.STOP}case"kiro":case"ollama":switch(a){case"tool_calls":case"tool_use":return d.bC.TOOL_CALLS;case"length":case"max_tokens":return d.bC.LENGTH;default:return d.bC.STOP}default:return a||d.bC.STOP}}function f(a,b){if("claude"!==b)return a;switch(a){case d.bC.STOP:return d.Ut.END_TURN;case d.bC.LENGTH:return d.Ut.MAX_TOKENS;case d.bC.TOOL_CALLS:return d.Ut.TOOL_USE;default:return d.Ut.END_TURN}}},26922:(a,b,c)=>{c.d(b,{KZ:()=>k,S6:()=>h,Yr:()=>o,f6:()=>l,fc:()=>g,kU:()=>i,pT:()=>j,w_:()=>m});var d=c(62842),e=c(55673);let f=["minLength","maxLength","exclusiveMinimum","exclusiveMaximum","minItems","maxItems","format","default","examples","$schema","$defs","definitions","const","$ref","$comment","deprecated","readOnly","writeOnly","additionalProperties","propertyNames","patternProperties","enumDescriptions","anyOf","oneOf","allOf","not","dependencies","dependentSchemas","dependentRequired","title","optional","deprecated","if","then","else","contentMediaType","contentEncoding","cornerRadius","fillColor","fontFamily","fontSize","fontWeight","gap","padding","strokeColor","strokeThickness","textColor"],g=[{category:"HARM_CATEGORY_HATE_SPEECH",threshold:"OFF"},{category:"HARM_CATEGORY_DANGEROUS_CONTENT",threshold:"OFF"},{category:"HARM_CATEGORY_SEXUALLY_EXPLICIT",threshold:"OFF"},{category:"HARM_CATEGORY_HARASSMENT",threshold:"OFF"},{category:"HARM_CATEGORY_CIVIC_INTEGRITY",threshold:"OFF"}];function h(a){let b=[];if("string"==typeof a)b.push({text:a});else if(Array.isArray(a)){for(let c of a)if(c.type===e.x4.TEXT)b.push({text:c.text});else if(c.type===e.x4.IMAGE_URL&&c.image_url?.url?.startsWith("data:")){let a=c.image_url.url,d=a.indexOf(",");if(-1!==d){let c=a.substring(5,d),e=a.substring(d+1),f=c.split(";")[0];b.push({inlineData:{mime_type:f,data:e}})}}else if(c.type===e.x4.IMAGE_URL&&c.image_url?.url&&(c.image_url.url.startsWith("http://")||c.image_url.url.startsWith("https://")))b.push({fileData:{fileUri:c.image_url.url,mimeType:"image/*"}});else if(c.type===e.x4.INPUT_AUDIO&&c.input_audio?.data){let a=c.input_audio.format||"wav",d="mp3"===a?"audio/mpeg":`audio/${a}`;b.push({inlineData:{mime_type:d,data:c.input_audio.data}})}else if(c.type===e.x4.AUDIO_URL&&c.audio_url?.url?.startsWith("data:")){let a=c.audio_url.url,d=a.indexOf(",");if(-1!==d){let c=a.substring(5,d),e=a.substring(d+1),f=c.split(";")[0];b.push({inlineData:{mime_type:f,data:e}})}}else if(c.type===e.x4.FILE&&c.file?.file_data?.startsWith("data:")){let a=c.file.file_data,d=a.indexOf(",");if(-1!==d){let c=a.substring(5,d).split(";")[0],e=a.substring(d+1);b.push({inlineData:{mime_type:c,data:e}})}}}return b}function i(a,b=""){return"string"==typeof a?a:Array.isArray(a)?a.filter(a=>a.type===e.x4.TEXT).map(a=>a.text).join(b):""}function j(a){return(0,d.N)(a,null)}function k(){return`agent-${crypto.randomUUID()}`}function l(){return crypto.randomUUID()+Date.now().toString()}function m(){let a=["useful","bright","swift","calm","bold"],b=["fuze","wave","spark","flow","core"],c=a[Math.floor(Math.random()*a.length)],d=b[Math.floor(Math.random()*b.length)];return`${c}-${d}-${crypto.randomUUID().slice(0,5)}`}function n(a){let b=0,c=-1;for(let d=0;d<a.length;d++){let e=a[d],f=0,g=e.type;"object"===g||e.properties?f=3:"array"===g||e.items?f=2:g&&"null"!==g&&(f=1),f>c&&(c=f,b=d)}return b}function o(a){return a&&"object"==typeof a&&(!function a(b){if(b&&"object"==typeof b)for(let c of(void 0===b.const||b.enum||(b.enum=[b.const],delete b.const),Object.values(b)))c&&"object"==typeof c&&a(c)}(a),!function a(b){if(b&&"object"==typeof b)for(let c of(b.enum&&Array.isArray(b.enum)&&(b.enum=b.enum.map(a=>String(a)),b.type||(b.type="string")),Object.values(b)))c&&"object"==typeof c&&a(c)}(a),!function a(b){if(b&&"object"==typeof b){if(b.allOf&&Array.isArray(b.allOf)){let a={};for(let c of b.allOf)if(c.properties&&(a.properties||(a.properties={}),Object.assign(a.properties,c.properties)),c.required&&Array.isArray(c.required))for(let b of(a.required||(a.required=[]),c.required))a.required.includes(b)||a.required.push(b);delete b.allOf,a.properties&&(b.properties={...b.properties,...a.properties}),a.required&&(b.required=[...b.required||[],...a.required])}for(let c of Object.values(b))c&&"object"==typeof c&&a(c)}}(a),!function a(b){if(b&&"object"==typeof b){if(b.anyOf&&Array.isArray(b.anyOf)&&b.anyOf.length>0){let a=b.anyOf.filter(a=>a&&"null"!==a.type);if(a.length>0){let c=n(a),d=a[c];delete b.anyOf,Object.assign(b,d)}}if(b.oneOf&&Array.isArray(b.oneOf)&&b.oneOf.length>0){let a=b.oneOf.filter(a=>a&&"null"!==a.type);if(a.length>0){let c=n(a),d=a[c];delete b.oneOf,Object.assign(b,d)}}for(let c of Object.values(b))c&&"object"==typeof c&&a(c)}}(a),!function a(b){if(b&&"object"==typeof b){if(b.type&&Array.isArray(b.type)){let a=b.type.filter(a=>"null"!==a);b.type=a.length>0?a[0]:"string"}for(let c of Object.values(b))c&&"object"==typeof c&&a(c)}}(a),!function a(b){if(b&&"object"==typeof b)for(let c of(b.properties&&!b.type&&(b.type="object"),Object.values(b)))c&&"object"==typeof c&&a(c)}(a),!function a(b,c){if(b&&"object"==typeof b){if(Array.isArray(b)){for(let d of b)a(d,c);return}for(let d of Object.keys(b)){if(c.includes(d)||d.startsWith("x-")){delete b[d];continue}let e=b[d];e&&"object"==typeof e&&a(e,c)}}}(a,f),!function a(b){if(b&&"object"==typeof b){if(b.required&&Array.isArray(b.required)&&b.properties){let a=b.required.filter(a=>Object.prototype.hasOwnProperty.call(b.properties,a));0===a.length?delete b.required:b.required=a}for(let c of Object.values(b))c&&"object"==typeof c&&a(c)}}(a),!function a(b){if(b&&"object"==typeof b)for(let c of("object"!==b.type||b.properties&&0!==Object.keys(b.properties).length||(b.properties={reason:{type:"string",description:"Brief explanation of why you are calling this tool"}},b.required=["reason"]),Object.values(b)))c&&"object"==typeof c&&a(c)}(a)),a}},32271:(a,b,c)=>{c.d(b,{k:()=>d});function d({id:a,created:b,model:c},e,f=null){return{id:a,object:"chat.completion.chunk",created:b,model:c,choices:[{index:0,delta:e,finish_reason:f}]}}},34097:(a,b,c)=>{function d({promptTokens:a,completionTokens:b,totalTokens:c,cachedTokens:e=0,cacheCreationTokens:f=0,reasoningTokens:g=0}){let h={prompt_tokens:a,completion_tokens:b,total_tokens:c};return(e>0||f>0)&&(h.prompt_tokens_details={},e>0&&(h.prompt_tokens_details.cached_tokens=e),f>0&&(h.prompt_tokens_details.cache_creation_tokens=f)),g>0&&(h.completion_tokens_details={reasoning_tokens:g}),h}c.d(b,{B:()=>g,c:()=>d});let e=a=>"number"==typeof a?a:0,f={claude(a){let b=e(a.input_tokens),c=e(a.output_tokens),d=e(a.cache_read_input_tokens),f=e(a.cache_creation_input_tokens),g=b+d+f;return{promptTokens:g,completionTokens:c,totalTokens:g+c,cachedTokens:d,cacheCreationTokens:f}},gemini(a){let b=e(a.cachedContentTokenCount),c=e(a.promptTokenCount),d=e(a.thoughtsTokenCount),f=e(a.totalTokenCount),g=e(a.candidatesTokenCount);return 0===g&&f>0&&(g=f-c-d)<0&&(g=0),{promptTokens:c,completionTokens:g+d,totalTokens:f,cachedTokens:b,reasoningTokens:d}},kiro(a){let b=e(a.inputTokens),c=e(a.outputTokens),d=e(a.cache_read_input_tokens)||e(a.cachedTokens)||e(a.cached_tokens),f=e(a.cache_creation_input_tokens),g={promptTokens:b,completionTokens:c,totalTokens:b+c};return d>0&&(g.cachedTokens=d),f>0&&(g.cacheCreationTokens=f),g},ollama(a){let b=e(a.prompt_eval_count),c=e(a.eval_count);return{promptTokens:b,completionTokens:c,totalTokens:b+c}},commandcode(a){let b=e(a.inputTokens),c=e(a.outputTokens),d="number"==typeof a.totalTokens?a.totalTokens:b+c;return{promptTokens:b,completionTokens:c,totalTokens:d}}};function g(a,b){let c=f[b];return c&&a&&"object"==typeof a?d(c(a)):null}},37981:(a,b,c)=>{c.d(b,{m:()=>e});var d=c(55673);function e(a){if("string"==typeof a){let b=""===a.trim()?"...":a;return[{type:d.Du.MESSAGE,role:d.z7.USER,content:[{type:d.Du.INPUT_TEXT,text:b}]}]}return Array.isArray(a)?0===a.length?[{type:d.Du.MESSAGE,role:d.z7.USER,content:[{type:d.Du.INPUT_TEXT,text:"..."}]}]:a:null}},39536:(a,b,c)=>{c.d(b,{c:()=>t});var d=c(55511),e=c.n(d),f=c(74957),g=c(35024),h=c(75924),i=c(41004),j=c(80662),k=c(39609),l=c(26922),m=c(96281);let n=[/high\s+traffic/i,/agent\s+(execution\s+)?terminated\s+due\s+to\s+error/i,/capacity/i,/temporarily\s+unavailable/i,/timeout/i,/stream\s+(ended|closed|terminated|interrupted)/i,/empty\s+response/i],o=new Set([i.gx.SERVER_ERROR,i.gx.BAD_GATEWAY,i.gx.SERVICE_UNAVAILABLE,i.gx.GATEWAY_TIMEOUT]),p=["output_config","thinking","reasoning_effort","reasoning","enable_thinking","thinking_budget","thinkingConfig"],q=a=>{for(let b of p)delete a[b]},r=[/image/i,/imagen/i,/image-generation/i];function s(a){return!!a&&r.some(b=>b.test(a))}class t extends f.H{constructor(){super("antigravity",g.xq.antigravity)}buildUrl(a,b,c=0){let d=this.getBaseUrls(),e=d[c]||d[0],f=s(a);return`${e}/v1internal:${b&&!f?"streamGenerateContent?alt=sse":"generateContent"}`}buildHeaders(a,b=!0,c=null){let d=c||this._lastSessionId;return{"Content-Type":"application/json",Authorization:`Bearer ${a.accessToken}`,"User-Agent":this.config.headers?.["User-Agent"]||h.K["User-Agent"],[h.Ox.name]:h.Ox.value,...d&&{"X-Machine-Session-Id":d},Accept:b?"text/event-stream":"application/json"}}transformRequest(a,b,c,d){let f=d?.projectId||this.generateProjectId();if(s(a)){let c=function(a){let b={aspectRatio:"1:1"},c=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);b.aspectRatio=`${a/e}:${d/e}`}}return b}(a),g=a.replace(/-(\d+)x(\d+)$/,""),h=[];for(let a of b.request?.contents||b.contents||[]){let b=(a.parts||[]).filter(a=>void 0!==a.text).map(a=>({text:a.text}));b.length>0&&h.push({role:a.role||"user",parts:b})}let i=(0,j.oV)({headers:d?.rawHeaders,body:b,connectionId:d?.email||d?.connectionId,scope:"antigravity"});return this._lastSessionId=i,{project:f,model:g,userAgent:"antigravity",requestType:"image_gen",requestId:`agent-${e().randomUUID()}`,request:{contents:h,generationConfig:{temperature:1,topP:.95,topK:40,maxOutputTokens:8192,imageConfig:c},sessionId:i}}}let g=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)),d=c?.some(a=>a.functionCall&&!a.thoughtSignature)??!1;return b!==a.role||c?.length!==a.parts?.length||d?{...a,role:b,parts:d?c.map(a=>a.functionCall&&!a.thoughtSignature?{...a,thoughtSignature:m.bf}:a):c}:a}),h=b.request?.tools;if(h&&h.length>0){let a=new Set,b=[];for(let c of h)for(let d of c.functionDeclarations||[]){let c=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)}(d.name);a.has(c)||(a.add(c),b.push({...d,name:c,parameters:d.parameters?(0,l.Yr)(structuredClone(d.parameters)):{type:"object",properties:{reason:{type:"string",description:"Brief explanation"}},required:["reason"]}}))}h=b.length>0?[{functionDeclarations:b}]:[]}let{tools:i,toolConfig:k,...n}=b.request||{};q(n);let o={...n.generationConfig||{}};o.maxOutputTokens>16384&&(o.maxOutputTokens=16384);let p={...n,generationConfig:o,...g&&{contents:g},...h&&{tools:h},sessionId:b.request?.sessionId||(0,j.oV)({headers:d?.rawHeaders,body:b,connectionId:d?.email||d?.connectionId,scope:"antigravity"}),safetySettings:void 0,...h?.length>0&&{toolConfig:{functionCallingConfig:{mode:"VALIDATED"}}}};return q(b),this._lastSessionId=p.sessionId,{...b,project:f,model:a,userAgent:"antigravity",requestType:"agent",requestId:`agent-${e().randomUUID()}`,request:p}}async refreshCredentials(a,b,c=null){if(!a.refreshToken)return null;try{let d=await (0,k.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 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 after (\d+h)?(\d+m)?(\d+s)?/i);if(!b)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+=1e3*parseInt(b[3])),c>0?c:null}extractErrorMessage(a,b=""){return[a?.error?.message,a?.message,a?.error,b].filter(Boolean).map(a=>"string"==typeof a?a:JSON.stringify(a)).join("\n")}isTransientAntigravityError(a,b){return!!(a===i.gx.RATE_LIMITED||o.has(a))||n.some(a=>a.test(b||""))}async computeRetryDelay(a,b){let c="",d=null,e=this.parseRetryHeaders(a.headers);try{d=(c=await a.clone().text())?JSON.parse(c):null}catch{}let f=this.extractErrorMessage(d,c);return(e||(e=this.parseRetryFromErrorMessage(f)),e)?e<=1e4&&e:!!this.isTransientAntigravityError(a.status,f)&&Math.min(1e3*2**b,a.status===i.gx.RATE_LIMITED?1e4:15e3)}static cloakTools(a,b=null){let c=a.request?.tools;if(!c||0===c.length)return{cloakedBody:a,toolNameMap:null};let d="github-copilot"===b,e=new Map,f=[],g=new Set(u.map(a=>a.name));for(let a of c)if(a.functionDeclarations)for(let b of a.functionDeclarations){if(d&&h.J5.has(b.name)||d&&g.has(b.name))continue;if(h.J5.has(b.name)){f.push(b);continue}let a=`${b.name}${h.QH}`;e.set(a,b.name),f.push({...b,name:a})}let i=[],j=new Set;for(let a of[...f,...u])!a?.name||j.has(a.name)||(j.add(a.name),i.push(a));let k=a.request?.contents?.map(a=>{if(!a.parts)return a;let b=a.parts.map(a=>a.functionCall&&!h.J5.has(a.functionCall.name)?{...a,functionCall:{...a.functionCall,name:`${a.functionCall.name}${h.QH}`}}:a.functionResponse&&!h.J5.has(a.functionResponse.name)?{...a,functionResponse:{...a.functionResponse,name:`${a.functionResponse.name}${h.QH}`}}:a);return{...a,parts:b}});return{cloakedBody:{...a,request:{...a.request,tools:[{functionDeclarations:i}],contents:k||a.request.contents}},toolNameMap:e}}}let u=[{name:"browser_subagent",description:"This tool is currently unavailable.",parameters:{type:"OBJECT",properties:{},required:[]}},{name:"command_status",description:"This tool is currently unavailable.",parameters:{type:"OBJECT",properties:{},required:[]}},{name:"find_by_name",description:"This tool is currently unavailable.",parameters:{type:"OBJECT",properties:{},required:[]}},{name:"generate_image",description:"This tool is currently unavailable.",parameters:{type:"OBJECT",properties:{},required:[]}},{name:"grep_search",description:"This tool is currently unavailable.",parameters:{type:"OBJECT",properties:{},required:[]}},{name:"list_dir",description:"This tool is currently unavailable.",parameters:{type:"OBJECT",properties:{},required:[]}},{name:"list_resources",description:"This tool is currently unavailable.",parameters:{type:"OBJECT",properties:{},required:[]}},{name:"mcp_sequential-thinking_sequentialthinking",description:"This tool is currently unavailable.",parameters:{type:"OBJECT",properties:{},required:[]}},{name:"multi_replace_file_content",description:"This tool is currently unavailable.",parameters:{type:"OBJECT",properties:{},required:[]}},{name:"notify_user",description:"This tool is currently unavailable.",parameters:{type:"OBJECT",properties:{},required:[]}},{name:"read_resource",description:"This tool is currently unavailable.",parameters:{type:"OBJECT",properties:{},required:[]}},{name:"read_terminal",description:"This tool is currently unavailable.",parameters:{type:"OBJECT",properties:{},required:[]}},{name:"read_url_content",description:"This tool is currently unavailable.",parameters:{type:"OBJECT",properties:{},required:[]}},{name:"replace_file_content",description:"This tool is currently unavailable.",parameters:{type:"OBJECT",properties:{},required:[]}},{name:"run_command",description:"This tool is currently unavailable.",parameters:{type:"OBJECT",properties:{},required:[]}},{name:"search_web",description:"This tool is currently unavailable.",parameters:{type:"OBJECT",properties:{},required:[]}},{name:"send_command_input",description:"This tool is currently unavailable.",parameters:{type:"OBJECT",properties:{},required:[]}},{name:"task_boundary",description:"This tool is currently unavailable.",parameters:{type:"OBJECT",properties:{},required:[]}},{name:"view_content_chunk",description:"This tool is currently unavailable.",parameters:{type:"OBJECT",properties:{},required:[]}},{name:"view_file",description:"This tool is currently unavailable.",parameters:{type:"OBJECT",properties:{},required:[]}},{name:"write_to_file",description:"This tool is currently unavailable.",parameters:{type:"OBJECT",properties:{},required:[]}}]},39551:(a,b,c)=>{c.d(b,{_:()=>m});var d=c(78833),e=c(14170),f=c(55673),g=c(32271),h=c(34097),i=c(17242),j=c(21855);function k(a){return(0,h.B)(a,"ollama")}function l(a){return a.map((a,b)=>({index:a.function?.index??b,id:a.id||(0,i.eG)(b),type:f.x4.FUNCTION,function:{name:a.function?.name||"",arguments:"string"==typeof a.function?.arguments?a.function.arguments:JSON.stringify(a.function?.arguments||{})}}))}function m(a){let b=a.message||{},c=b.content||"",d=b.thinking||"",e=Array.isArray(b.tool_calls)?b.tool_calls:[],g={role:f.z7.ASSISTANT};c&&(g.content=c),d&&(g.reasoning_content=d),e.length>0&&(g.tool_calls=l(e)),g.content||g.tool_calls||(g.content="");let h=(0,j.F)(a.done_reason,"ollama");return e.length>0&&(h=f.bC.TOOL_CALLS),{id:`chatcmpl-${Date.now()}`,object:"chat.completion",created:Math.floor(Date.now()/1e3),model:a.model||"ollama",choices:[{index:0,message:g,finish_reason:h}],usage:k(a)}}(0,d.kz)(e.h.OLLAMA,e.h.OPENAI,null,function(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:e}=b.ollama;if(a.done){let h=k(a),i=(0,j.F)(a.done_reason,"ollama");(a.done_reason===f.bC.TOOL_CALLS||b.hadToolCalls)&&(i=f.bC.TOOL_CALLS);let l=(0,g.k)({id:c,created:d,model:e},{},i);return l.usage=h,l}let h=a.message;if(!h)return null;let i="string"==typeof h.content?h.content:"",m="string"==typeof h.thinking?h.thinking:"",n=Array.isArray(h.tool_calls)?h.tool_calls:null;if(!i&&!m&&!n)return null;i&&(b.accumulatedContent=(b.accumulatedContent||"")+i),m&&(b.accumulatedThinking=(b.accumulatedThinking||"")+m);let o={};return i&&(o.content=i),m&&(o.reasoning_content=m),n&&(b.hadToolCalls=!0,o.tool_calls=l(n)),(0,g.k)({id:c,created:d,model:e},o,null)})},44090:(a,b,c)=>{c.d(b,{B:()=>e,V:()=>f});var d=c(55673);function e(a,b=!1){return b?{role:d.z7.ASSISTANT,reasoning_content:a}:{reasoning_content:a}}function f(a){if(!a||"object"!=typeof a)return"";if("string"==typeof a.reasoning_content&&a.reasoning_content)return a.reasoning_content;if("string"==typeof a.reasoning&&a.reasoning)return a.reasoning;let b=a.reasoning_details;return Array.isArray(b)?b.map(a=>"string"==typeof a?a:a?.text||a?.content||"").join(""):""}},47723:(a,b,c)=>{c.d(b,{H:()=>n});var d=c(78833),e=c(14170),f=c(55673),g=c(32271),h=c(34097),i=c(44090),j=c(17242),k=c(21855);function l(a,b,c=null){return(0,g.k)({id:a.responseId,created:a.created,model:a.model},b,c)}let m=a=>(0,k.F)(a,"commandcode");function n(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.usage=null);let e=[];switch(d.type){case"text-delta":{let a=d.text||d.delta||"";if(!a)break;let c=0===b.chunkIndex?{role:f.z7.ASSISTANT,content:a}:{content:a};b.chunkIndex++,b.openText=!0,e.push(l(b,c));break}case"reasoning-delta":{let a=d.text||"";if(!a)break;let c=(0,i.B)(a,0===b.chunkIndex);b.chunkIndex++,e.push(l(b,c));break}case"tool-input-start":{let a=d.id||d.toolCallId||(0,j.eG)(b.toolIndex),c=b.toolIndexById.get(a);null==c&&(c=b.toolIndex++,b.toolIndexById.set(a,c)),b.openTools.add(a);let g={...0===b.chunkIndex?{role:f.z7.ASSISTANT}:{},tool_calls:[{index:c,id:a,type:f.x4.FUNCTION,function:{name:d.toolName||"",arguments:""}}]};b.chunkIndex++,e.push(l(b,g));break}case"tool-input-delta":{let a=d.id||d.toolCallId,c=b.toolIndexById.get(a);if(null==c)break;let f={tool_calls:[{index:c,function:{arguments:d.delta||d.inputTextDelta||""}}]};e.push(l(b,f));break}case"tool-call":{let a=d.toolCallId;if(b.toolIndexById.has(a))break;let c=b.toolIndex++;b.toolIndexById.set(a,c);let g="string"==typeof d.input?d.input:JSON.stringify(d.input??{}),h={...0===b.chunkIndex?{role:f.z7.ASSISTANT}:{},tool_calls:[{index:c,id:a,type:f.x4.FUNCTION,function:{name:d.toolName||"",arguments:g}}]};b.chunkIndex++,e.push(l(b,h));break}case"finish-step":b.finishReason=m(d.finishReason),d.usage&&(b.usage=d.usage);break;case"finish":{let a=b.finishReason||m(d.finishReason||"stop"),c=l(b,{},a),f=d.totalUsage||b.usage,g=(0,h.B)(f,"commandcode");g&&(c.usage=g),e.push(c);break}case"error":{b.finishReason=f.bC.STOP;let a=d.error??d.message??"unknown",c="string"==typeof a?a:JSON.stringify(a);e.push(l(b,{content:`
56
56
 
57
- [CommandCode error: ${c}]`})),e.push(l(b,{},f.bC.STOP))}}return e.length?e:null}(0,d.kz)(e.h.COMMANDCODE,e.h.OPENAI,null,n)},52136:(a,b,c)=>{c.d(b,{NU:()=>j,nF:()=>h,sS:()=>i,z:()=>o});var d=c(66306),e=c(26070),f=c(58028);let g={openai:"openai","openai-responses":"openai","openai-response":"openai",codex:"openai",claude:"claude-budget",gemini:"gemini-budget","gemini-cli":"gemini-budget",vertex:"gemini-budget",antigravity:"gemini-budget",kiro:"kiro"};function h(a){if("string"!=typeof a)return{cleanModel:a,override:null};let b=a.match(/^(.*)\(([^()]+)\)\s*$/);if(!b)return{cleanModel:a,override:null};let c=b[1].trim(),d=b[2].trim().toLowerCase();return"none"===d||"off"===d?{cleanModel:c,override:{mode:"none"}}:"auto"===d?{cleanModel:c,override:{mode:"auto"}}:/^\d+$/.test(d)?{cleanModel:c,override:{mode:"budget",budget:Number(d)}}:void 0!==f.Dl[d]?{cleanModel:c,override:{mode:"level",level:d}}:{cleanModel:c,override:null}}function i(a){if(!a||"object"!=typeof a)return null;let b=a.output_config?.effort;if("string"==typeof b&&b){let a=b.toLowerCase();return"none"===a||"off"===a?{mode:"none"}:"auto"===a?{mode:"auto"}:{mode:"level",level:a}}let c=a.thinking;if(c&&"object"==typeof c){if("disabled"===c.type)return{mode:"none"};if("adaptive"===c.type||"enabled"===c.type){let a=Number(c.budget_tokens);return Number.isFinite(a)&&a>0?{mode:"budget",budget:a}:{mode:"auto"}}}let d=a.reasoning_effort??("object"==typeof a.reasoning?a.reasoning?.effort:null);if("string"==typeof d&&d){let a=d.toLowerCase();return"none"===a||"off"===a?{mode:"none"}:"auto"===a?{mode:"auto"}:{mode:"level",level:a}}let e=a.thinkingConfig||a.generationConfig?.thinkingConfig||a.request?.generationConfig?.thinkingConfig;if(e&&"object"==typeof e){if("string"==typeof e.thinkingLevel)return{mode:"level",level:e.thinkingLevel.toLowerCase()};let a=Number(e.thinkingBudget);if(Number.isFinite(a))return 0===a?{mode:"none"}:a<0?{mode:"auto"}:{mode:"budget",budget:a}}if(!1===a.enable_thinking)return{mode:"none"};if(!0===a.enable_thinking){let b=Number(a.thinking_budget);return Number.isFinite(b)&&b>0?{mode:"budget",budget:b}:{mode:"auto"}}return null}let j=i;function k(a,b){let c;if("budget"===a.mode)c=a.budget;else if("level"===a.mode)c=(0,f.nE)(a.level);else if("auto"===a.mode)return -1;if(Number.isFinite(c))return b&&(null!=b.min&&c<b.min&&(c=b.min),null!=b.max&&c>b.max&&(c=b.max)),c}function l(a){return"level"===a.mode?a.level:"budget"===a.mode?(0,f.vz)(a.budget)||"medium":"auto"===a.mode?"auto":null}function m(a,b){(a.request?.generationConfig?a.request.generationConfig:a.generationConfig&&"object"==typeof a.generationConfig?a.generationConfig:a.generationConfig={}).thinkingConfig=b}function n(a){delete a.thinking,delete a.reasoning_effort,delete a.reasoning,delete a.thinkingConfig,delete a.enable_thinking,delete a.thinking_budget,delete a.output_config,a.generationConfig&&delete a.generationConfig.thinkingConfig,a.request?.generationConfig&&delete a.request.generationConfig.thinkingConfig}function o(a,b,c,j=null,p){if(!c||"object"!=typeof c)return c;let{cleanModel:q,override:r}=h(b),s=r||p||i(c),t=(0,d.nl)(j,q);if(!t.reasoning)return n(c),c;if(!s)return c;let u=function(a,b,c){let f=c?e.xq[c]?.thinkingFormat:null;if(f)return f;let h=(0,d.nl)(c,b);return h.thinkingFormat?h.thinkingFormat:g[a]||"openai"}(a,q,j);return n(c),!function(a,b,c,d){let e="none"===c.mode,g=!1!==d.thinkingCanDisable,h=e&&!g?{mode:"level",level:"minimal"}:c;switch(a){case"openai":{if(e&&g){b.reasoning_effort="none";break}let a=l(h);a&&(b.reasoning_effort=a);break}case"claude-adaptive":{if(e&&g){b.thinking={type:"disabled"};break}let a=l(h);b.output_config={effort:"xhigh"===a?"high":a};break}case"claude-budget":{if(e&&g){b.thinking={type:"disabled"};break}let a=k(h,d.thinkingRange);b.thinking=-1===a?{type:"enabled"}:{type:"enabled",budget_tokens:a||8192};break}case"gemini-level":{let a,c=e?"minimal":(a="auto"===h.mode?"high":l(h)||"high",(0,f.wd)(a));m(b,{thinkingLevel:c,includeThoughts:"minimal"!==c});break}case"gemini-budget":if(e&&g){m(b,{thinkingBudget:0,includeThoughts:!1});break}m(b,{thinkingBudget:k(h,d.thinkingRange)??-1,includeThoughts:!0});break;case"zai":if(e&&g){b.enable_thinking=!1,delete b.thinking;break}b.thinking={type:"enabled"};break;case"qwen":{if(e&&g){b.enable_thinking=!1;break}b.enable_thinking=!0;let a=k(h,d.thinkingRange);Number.isFinite(a)&&a>0&&(b.thinking_budget=a);break}case"deepseek":{if(e&&g){b.thinking={type:"disabled"};break}b.thinking={type:"enabled"};let a=l(h);b.reasoning_effort="xhigh"===a||"max"===a?"max":"high";break}case"kimi":{if(e&&g){b.thinking={type:"disabled"};break}let a=l(h);a&&"auto"!==a&&(b.reasoning_effort="minimal"===a?"low":"xhigh"===a||"max"===a?"high":a);break}case"minimax":b.thinking={type:e&&g?"disabled":"adaptive"};break;case"hunyuan":{if(e&&g){b.thinking={type:"disabled"};break}let a=k(h,d.thinkingRange);b.thinking=-1===a?{type:"enabled"}:{type:"enabled",budget_tokens:a||8192};break}case"step":{if(e&&g)break;let a=l(h);a&&"auto"!==a&&(b.reasoning_effort="minimal"===a?"low":"xhigh"===a||"max"===a?"high":a)}}}(u,c,s,t),c}},55399:(a,b,c)=>{c.d(b,{Az:()=>f,fO:()=>i,kR:()=>g});var d=c(55511),e=c(75924);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,g=[];for(let a of b){if(a.type){g.push(a);continue}let b=c(a.name);d.set(b,a.name),f.add(a.name),g.push({...a,name:b})}let i=[...g,...h],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}}function g(a,b){if(!b?.size||!Array.isArray(a?.content))return a;let c=a.content.map(a=>a?.type==="tool_use"&&b.has(a.name)?{...a,name:b.get(a.name)}:a);return{...a,content:c}}let h=[{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 i(a,b,c){var e;let f,g,h,i,j,k,l;if(!b||!b.includes("sk-ant-oat"))return a;let m={...a},n={type:"text",text:(f=JSON.stringify(a),g=(0,d.createHash)("sha256").update(f).digest("hex").slice(0,5),h=(0,d.randomBytes)(2).toString("hex").slice(0,3),`x-anthropic-billing-header: cc_version=2.1.92.${h}; cc_entrypoint=sdk-cli; cch=${g};`)};return Array.isArray(m.system)?m.system[0]?.text?.startsWith("x-anthropic-billing-header:")||(m.system=[n,...m.system]):"string"==typeof m.system?m.system=[n,{type:"text",text:m.system}]:m.system=[n],m.metadata?.user_id||(m.metadata={...m.metadata,user_id:(i=b?(0,d.createHash)("sha256").update(`device:${b}`).digest("hex"):(0,d.randomBytes)(32).toString("hex"),k=b?(e=`account:${b}`,j=(0,d.createHash)("sha256").update(e).digest("hex"),`${j.slice(0,8)}-${j.slice(8,12)}-4${j.slice(13,16)}-${(3&parseInt(j[16],16)|8).toString(16)}${j.slice(17,20)}-${j.slice(20,32)}`):(0,d.randomUUID)(),l=c||(0,d.randomUUID)(),`{"device_id":"${i}","account_uuid":"${k}","session_id":"${l}"}`)}),m}},55673:(a,b,c)=>{c.d(b,{R4:()=>g,BY:()=>l,a_:()=>j.a_,RV:()=>e,rP:()=>k,x4:()=>f,bC:()=>j.bC,Du:()=>h,z7:()=>d,m8:()=>i});let d={USER:"user",ASSISTANT:"assistant",TOOL:"tool",SYSTEM:"system",DEVELOPER:"developer"},e={USER:"user",MODEL:"model"},f={TEXT:"text",IMAGE_URL:"image_url",IMAGE:"image",INPUT_AUDIO:"input_audio",AUDIO_URL:"audio_url",FILE:"file",FUNCTION:"function"},g={TEXT:"text",IMAGE:"image",DOCUMENT:"document",TOOL_USE:"tool_use",TOOL_RESULT:"tool_result",THINKING:"thinking",REDACTED_THINKING:"redacted_thinking"},h={MESSAGE:"message",FUNCTION_CALL:"function_call",FUNCTION_CALL_OUTPUT:"function_call_output",REASONING:"reasoning",OUTPUT_TEXT:"output_text",INPUT_TEXT:"input_text",INPUT_IMAGE:"input_image",SUMMARY_TEXT:"summary_text"},i=[f.TEXT,f.IMAGE_URL,f.IMAGE,f.INPUT_AUDIO,f.AUDIO_URL,f.FILE];f.TEXT,f.IMAGE_URL,f.IMAGE,g.TOOL_RESULT;var j=c(69320);let k="unknown",l="image/png"},57647:(a,b,c)=>{c.d(b,{SZ:()=>n,Tz:()=>k,jJ:()=>l,oF:()=>m});var d=c(35024),e=c(74129);let f={baseUrl:e.Es},g={baseUrl:e.ky};function h(a){return"string"==typeof a&&a.startsWith("openai-compatible-")}function i(a){return"string"==typeof a&&a.startsWith("anthropic-compatible-")}function j(a){return h(a)&&a.includes("responses")?"responses":"chat"}function k(a){if(a.input&&(Array.isArray(a.input)||"string"==typeof a.input)&&!a.messages)return"openai-responses";if(a.request?.contents&&"antigravity"===a.userAgent)return"antigravity";if(a.contents&&Array.isArray(a.contents))return"gemini";if(a.stream_options||a.response_format||void 0!==a.logprobs||void 0!==a.top_logprobs||void 0!==a.n||void 0!==a.presence_penalty||void 0!==a.frequency_penalty||a.logit_bias||a.user)return"openai";if(a.messages&&Array.isArray(a.messages)){let b=a.messages[0];if(b?.content&&Array.isArray(b.content)){let c=b.content[0];if(c?.type==="text"&&!a.model?.includes("/")){if(a.system||a.anthropic_version)return"claude";let c=b.content.some(a=>"image"===a.type&&a.source?.type==="base64"),d=b.content.some(a=>"image_url"===a.type&&a.image_url?.url);if(c)return"claude";if(d)return"openai";if(b.content.some(a=>"tool_use"===a.type||"tool_result"===a.type))return"claude"}}if(void 0!==a.system||a.anthropic_version)return"claude"}return"openai"}function l(a){return h(a)?"responses"===j(a)?"openai-responses":"openai":i(a)?"claude":function(a){if(h(a)){let b=j(a);return{...d.xq.openai,format:"responses"===b?"openai-responses":"openai",baseUrl:f.baseUrl}}return i(a)?{...d.xq.anthropic,format:"claude",baseUrl:g.baseUrl}:d.xq[a]||d.xq.openai}(a).format||"openai"}function m(a,b){let c=d.xq[a],e=c?.transports;return Array.isArray(e)&&e.length&&e.find(a=>a.format===b)||null}function n(a){return!function(a){let b=a.messages||a.contents;if(!b?.length)return!0;let c=b[b.length-1];return c?.role==="user"}(a)&&delete a.thinking,a}},58028:(a,b,c)=>{c.d(b,{Dl:()=>d,Vp:()=>h,nE:()=>e,vz:()=>g,wd:()=>f});let d={none:0,minimal:512,low:1024,medium:8192,high:24576,xhigh:32768,max:128e3};function e(a){if(a)return d[String(a).toLowerCase()]}function f(a){let b=String(a).toLowerCase().trim();return"none"===b||"off"===b?"minimal":"xhigh"===b||"max"===b?"high":b}function g(a){let b=Number(a);return!b||b<=0?null:b<=768?"minimal":b<=4096?"low":b<=16384?"medium":b<=28672?"high":"xhigh"}function h(a){return!a||a<=0?null:a<=2048?"low":a<=16384?"medium":"high"}},60983:(a,b,c)=>{c.d(b,{t:()=>k});var d=c(78833),e=c(14170),f=c(74525),g=c(71301),h=c(55673),i=c(97721);function j(a){return"string"!=typeof a?"":a.replace(/^x-anthropic-billing-header:[^\n]*(?:\r?\n)?/i,"")}function k(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.system){let a=Array.isArray(b.system)?b.system.map(a=>j(a.text||"")).filter(Boolean).join("\n"):j(b.system);a&&d.messages.push({role:h.z7.SYSTEM,content:a})}if(b.messages&&Array.isArray(b.messages))for(let a=0;a<b.messages.length;a++){let c=function(a){if(a.role===h.z7.SYSTEM){var b;let c,d=(c=(Array.isArray(b=a.content)?b.filter(a=>a?.type===h.R4.TEXT).map(a=>a.text||""):["string"==typeof b?b:""]).filter(Boolean).join("\n")).trim()?`<system-reminder>
57
+ [CommandCode error: ${c}]`})),e.push(l(b,{},f.bC.STOP))}}return e.length?e:null}(0,d.kz)(e.h.COMMANDCODE,e.h.OPENAI,null,n)},52136:(a,b,c)=>{c.d(b,{NU:()=>j,nF:()=>h,sS:()=>i,z:()=>p});var d=c(66306),e=c(26070),f=c(58028);let g={openai:"openai","openai-responses":"openai","openai-response":"openai",codex:"openai",claude:"claude-budget",gemini:"gemini-budget","gemini-cli":"gemini-budget",vertex:"gemini-budget",antigravity:"gemini-budget",kiro:"kiro"};function h(a){if("string"!=typeof a)return{cleanModel:a,override:null};let b=a.match(/^(.*)\(([^()]+)\)\s*$/);if(!b)return{cleanModel:a,override:null};let c=b[1].trim(),d=b[2].trim().toLowerCase();return"none"===d||"off"===d?{cleanModel:c,override:{mode:"none"}}:"auto"===d?{cleanModel:c,override:{mode:"auto"}}:/^\d+$/.test(d)?{cleanModel:c,override:{mode:"budget",budget:Number(d)}}:void 0!==f.Dl[d]?{cleanModel:c,override:{mode:"level",level:d}}:{cleanModel:c,override:null}}function i(a){if(!a||"object"!=typeof a)return null;let b=a.output_config?.effort;if("string"==typeof b&&b){let a=b.toLowerCase();return"none"===a||"off"===a?{mode:"none"}:"auto"===a?{mode:"auto"}:{mode:"level",level:a}}let c=a.thinking;if(c&&"object"==typeof c){if("disabled"===c.type)return{mode:"none"};if("adaptive"===c.type||"enabled"===c.type){let a=Number(c.budget_tokens);return Number.isFinite(a)&&a>0?{mode:"budget",budget:a}:{mode:"auto"}}}let d=a.reasoning_effort??("object"==typeof a.reasoning?a.reasoning?.effort:null);if("string"==typeof d&&d){let a=d.toLowerCase();return"none"===a||"off"===a?{mode:"none"}:"auto"===a?{mode:"auto"}:{mode:"level",level:a}}let e=a.thinkingConfig||a.generationConfig?.thinkingConfig||a.request?.generationConfig?.thinkingConfig;if(e&&"object"==typeof e){if("string"==typeof e.thinkingLevel)return{mode:"level",level:e.thinkingLevel.toLowerCase()};let a=Number(e.thinkingBudget);if(Number.isFinite(a))return 0===a?{mode:"none"}:a<0?{mode:"auto"}:{mode:"budget",budget:a}}if(!1===a.enable_thinking)return{mode:"none"};if(!0===a.enable_thinking){let b=Number(a.thinking_budget);return Number.isFinite(b)&&b>0?{mode:"budget",budget:b}:{mode:"auto"}}return null}let j=i;function k(a,b){let c;if("budget"===a.mode)c=a.budget;else if("level"===a.mode)c=(0,f.nE)(a.level);else if("auto"===a.mode)return -1;if(Number.isFinite(c))return b&&(null!=b.min&&c<b.min&&(c=b.min),null!=b.max&&c>b.max&&(c=b.max)),c}let l=new Set(["minimal","low","medium","high","xhigh","max"]);function m(a){return"level"===a.mode?l.has(a.level)?a.level:null:"level"===a.mode?a.level:"budget"===a.mode?(0,f.vz)(a.budget)||"medium":"auto"===a.mode?"auto":null}function n(a,b){(a.request?.generationConfig?a.request.generationConfig:a.generationConfig&&"object"==typeof a.generationConfig?a.generationConfig:a.generationConfig={}).thinkingConfig=b}function o(a){delete a.thinking,delete a.reasoning_effort,delete a.reasoning,delete a.thinkingConfig,delete a.enable_thinking,delete a.thinking_budget,delete a.output_config,a.generationConfig&&delete a.generationConfig.thinkingConfig,a.request?.generationConfig&&delete a.request.generationConfig.thinkingConfig}function p(a,b,c,j=null,l){if(!c||"object"!=typeof c)return c;let{cleanModel:q,override:r}=h(b),s=r||l||i(c),t=(0,d.nl)(j,q);if(!t.reasoning)return o(c),c;if(!s)return c;let u=function(a,b,c){let f=c?e.xq[c]?.thinkingFormat:null;if(f)return f;let h=(0,d.nl)(c,b);return h.thinkingFormat?h.thinkingFormat:g[a]||"openai"}(a,q,j);return o(c),!function(a,b,c,d){let e="none"===c.mode,g=!1!==d.thinkingCanDisable,h=e&&!g?{mode:"level",level:"minimal"}:c;switch(a){case"openai":{if(e&&g){b.reasoning_effort="none";break}let a=m(h);a&&(b.reasoning_effort=a);break}case"claude-adaptive":{if(e&&g){b.thinking={type:"disabled"};break}let a=m(h);b.output_config={effort:"xhigh"===a?"high":a};break}case"claude-budget":{if(e&&g){b.thinking={type:"disabled"};break}let a=k(h,d.thinkingRange);b.thinking=-1===a?{type:"enabled"}:{type:"enabled",budget_tokens:a||8192};break}case"gemini-level":{let a,c=e?"minimal":(a="auto"===h.mode?"high":m(h)||"high",(0,f.wd)(a));n(b,{thinkingLevel:c,includeThoughts:"minimal"!==c});break}case"gemini-budget":if(e&&g){n(b,{thinkingBudget:0,includeThoughts:!1});break}n(b,{thinkingBudget:k(h,d.thinkingRange)??-1,includeThoughts:!0});break;case"zai":if(e&&g){b.enable_thinking=!1,delete b.thinking;break}b.thinking={type:"enabled"};break;case"qwen":{if(e&&g){b.enable_thinking=!1;break}b.enable_thinking=!0;let a=k(h,d.thinkingRange);Number.isFinite(a)&&a>0&&(b.thinking_budget=a);break}case"deepseek":{if(e&&g){b.thinking={type:"disabled"};break}b.thinking={type:"enabled"};let a=m(h);b.reasoning_effort="xhigh"===a||"max"===a?"max":"high";break}case"kimi":{if(e&&g){b.thinking={type:"disabled"};break}let a=m(h);a&&"auto"!==a&&(b.reasoning_effort="minimal"===a?"low":"xhigh"===a||"max"===a?"high":a);break}case"minimax":b.thinking={type:e&&g?"disabled":"adaptive"};break;case"hunyuan":{if(e&&g){b.thinking={type:"disabled"};break}let a=k(h,d.thinkingRange);b.thinking=-1===a?{type:"enabled"}:{type:"enabled",budget_tokens:a||8192};break}case"step":{if(e&&g)break;let a=m(h);a&&"auto"!==a&&(b.reasoning_effort="minimal"===a?"low":"xhigh"===a||"max"===a?"high":a)}}}(u,c,s,t),c}},55399:(a,b,c)=>{c.d(b,{Az:()=>f,fO:()=>i,kR:()=>g});var d=c(55511),e=c(75924);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,g=[];for(let a of b){if(a.type){g.push(a);continue}let b=c(a.name);d.set(b,a.name),f.add(a.name),g.push({...a,name:b})}let i=[...g,...h],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}}function g(a,b){if(!b?.size||!Array.isArray(a?.content))return a;let c=a.content.map(a=>a?.type==="tool_use"&&b.has(a.name)?{...a,name:b.get(a.name)}:a);return{...a,content:c}}let h=[{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 i(a,b,c){var e;let f,g,h,i,j,k,l;if(!b||!b.includes("sk-ant-oat"))return a;let m={...a},n={type:"text",text:(f=JSON.stringify(a),g=(0,d.createHash)("sha256").update(f).digest("hex").slice(0,5),h=(0,d.randomBytes)(2).toString("hex").slice(0,3),`x-anthropic-billing-header: cc_version=2.1.92.${h}; cc_entrypoint=sdk-cli; cch=${g};`)};return Array.isArray(m.system)?m.system[0]?.text?.startsWith("x-anthropic-billing-header:")||(m.system=[n,...m.system]):"string"==typeof m.system?m.system=[n,{type:"text",text:m.system}]:m.system=[n],m.metadata?.user_id||(m.metadata={...m.metadata,user_id:(i=b?(0,d.createHash)("sha256").update(`device:${b}`).digest("hex"):(0,d.randomBytes)(32).toString("hex"),k=b?(e=`account:${b}`,j=(0,d.createHash)("sha256").update(e).digest("hex"),`${j.slice(0,8)}-${j.slice(8,12)}-4${j.slice(13,16)}-${(3&parseInt(j[16],16)|8).toString(16)}${j.slice(17,20)}-${j.slice(20,32)}`):(0,d.randomUUID)(),l=c||(0,d.randomUUID)(),`{"device_id":"${i}","account_uuid":"${k}","session_id":"${l}"}`)}),m}},55673:(a,b,c)=>{c.d(b,{R4:()=>g,BY:()=>l,a_:()=>j.a_,RV:()=>e,rP:()=>k,x4:()=>f,bC:()=>j.bC,Du:()=>h,z7:()=>d,m8:()=>i});let d={USER:"user",ASSISTANT:"assistant",TOOL:"tool",SYSTEM:"system",DEVELOPER:"developer"},e={USER:"user",MODEL:"model"},f={TEXT:"text",IMAGE_URL:"image_url",IMAGE:"image",INPUT_AUDIO:"input_audio",AUDIO_URL:"audio_url",FILE:"file",FUNCTION:"function"},g={TEXT:"text",IMAGE:"image",DOCUMENT:"document",TOOL_USE:"tool_use",TOOL_RESULT:"tool_result",THINKING:"thinking",REDACTED_THINKING:"redacted_thinking"},h={MESSAGE:"message",FUNCTION_CALL:"function_call",FUNCTION_CALL_OUTPUT:"function_call_output",REASONING:"reasoning",OUTPUT_TEXT:"output_text",INPUT_TEXT:"input_text",INPUT_IMAGE:"input_image",SUMMARY_TEXT:"summary_text"},i=[f.TEXT,f.IMAGE_URL,f.IMAGE,f.INPUT_AUDIO,f.AUDIO_URL,f.FILE];f.TEXT,f.IMAGE_URL,f.IMAGE,g.TOOL_RESULT;var j=c(69320);let k="unknown",l="image/png"},57647:(a,b,c)=>{c.d(b,{SZ:()=>n,Tz:()=>k,jJ:()=>l,oF:()=>m});var d=c(35024),e=c(74129);let f={baseUrl:e.Es},g={baseUrl:e.ky};function h(a){return"string"==typeof a&&a.startsWith("openai-compatible-")}function i(a){return"string"==typeof a&&a.startsWith("anthropic-compatible-")}function j(a){return h(a)&&a.includes("responses")?"responses":"chat"}function k(a){if(a.input&&(Array.isArray(a.input)||"string"==typeof a.input)&&!a.messages)return"openai-responses";if(a.request?.contents&&"antigravity"===a.userAgent)return"antigravity";if(a.contents&&Array.isArray(a.contents))return"gemini";if(a.stream_options||a.response_format||void 0!==a.logprobs||void 0!==a.top_logprobs||void 0!==a.n||void 0!==a.presence_penalty||void 0!==a.frequency_penalty||a.logit_bias||a.user)return"openai";if(a.messages&&Array.isArray(a.messages)){let b=a.messages[0];if(b?.content&&Array.isArray(b.content)){let c=b.content[0];if(c?.type==="text"&&!a.model?.includes("/")){if(a.system||a.anthropic_version)return"claude";let c=b.content.some(a=>"image"===a.type&&a.source?.type==="base64"),d=b.content.some(a=>"image_url"===a.type&&a.image_url?.url);if(c)return"claude";if(d)return"openai";if(b.content.some(a=>"tool_use"===a.type||"tool_result"===a.type))return"claude"}}if(void 0!==a.system||a.anthropic_version)return"claude"}return"openai"}function l(a){return h(a)?"responses"===j(a)?"openai-responses":"openai":i(a)?"claude":function(a){if(h(a)){let b=j(a);return{...d.xq.openai,format:"responses"===b?"openai-responses":"openai",baseUrl:f.baseUrl}}return i(a)?{...d.xq.anthropic,format:"claude",baseUrl:g.baseUrl}:d.xq[a]||d.xq.openai}(a).format||"openai"}function m(a,b){let c=d.xq[a],e=c?.transports;return Array.isArray(e)&&e.length&&e.find(a=>a.format===b)||null}function n(a){return!function(a){let b=a.messages||a.contents;if(!b?.length)return!0;let c=b[b.length-1];return c?.role==="user"}(a)&&delete a.thinking,a}},58028:(a,b,c)=>{c.d(b,{Dl:()=>d,Vp:()=>h,nE:()=>e,vz:()=>g,wd:()=>f});let d={none:0,minimal:512,low:1024,medium:8192,high:24576,xhigh:32768,max:128e3};function e(a){if(a)return d[String(a).toLowerCase()]}function f(a){let b=String(a).toLowerCase().trim();return"none"===b||"off"===b?"minimal":"xhigh"===b||"max"===b?"high":b}function g(a){let b=Number(a);return!b||b<=0?null:b<=768?"minimal":b<=4096?"low":b<=16384?"medium":b<=28672?"high":"xhigh"}function h(a){return!a||a<=0?null:a<=2048?"low":a<=16384?"medium":"high"}},60983:(a,b,c)=>{c.d(b,{t:()=>k});var d=c(78833),e=c(14170),f=c(74525),g=c(71301),h=c(55673),i=c(97721);function j(a){return"string"!=typeof a?"":a.replace(/^x-anthropic-billing-header:[^\n]*(?:\r?\n)?/i,"")}function k(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.system){let a=Array.isArray(b.system)?b.system.map(a=>j(a.text||"")).filter(Boolean).join("\n"):j(b.system);a&&d.messages.push({role:h.z7.SYSTEM,content:a})}if(b.messages&&Array.isArray(b.messages))for(let a=0;a<b.messages.length;a++){let c=function(a){if(a.role===h.z7.SYSTEM){var b;let c,d=(c=(Array.isArray(b=a.content)?b.filter(a=>a?.type===h.R4.TEXT).map(a=>a.text||""):["string"==typeof b?b:""]).filter(Boolean).join("\n")).trim()?`<system-reminder>
58
58
  ${c}
59
59
  </system-reminder>`:"";return d?{role:h.z7.USER,content:d}:null}let c=a.role===h.z7.USER||a.role===h.z7.TOOL?h.z7.USER:h.z7.ASSISTANT;if("string"==typeof a.content)return{role:c,content:a.content};if(Array.isArray(a.content)){let b=[],d=[],e=[];for(let c of a.content)switch(c.type){case h.R4.TEXT:b.push({type:h.x4.TEXT,text:c.text});break;case h.R4.IMAGE:c.source?.type==="base64"&&b.push({type:h.x4.IMAGE_URL,image_url:{url:(0,g.$q)(c.source.media_type,c.source.data)}});break;case h.R4.TOOL_USE:d.push({id:c.id,type:h.x4.FUNCTION,function:{name:c.name,arguments:JSON.stringify(c.input||{})}});break;case h.R4.TOOL_RESULT:let a="";"string"==typeof c.content?a=c.content:Array.isArray(c.content)?a=c.content.filter(a=>a.type===h.R4.TEXT).map(a=>a.text).join("\n")||JSON.stringify(c.content):c.content&&(a=JSON.stringify(c.content)),e.push({role:h.z7.TOOL,tool_call_id:c.tool_use_id,content:a})}if(e.length>0)return b.length>0?[...e,{role:h.z7.USER,content:(0,i.z)(b)}]:e;if(d.length>0){let a={role:h.z7.ASSISTANT};return b.length>0&&(a.content=(0,i.z)(b)),a.tool_calls=d,a}if(b.length>0)return{role:c,content:(0,i.z)(b)};if(0===a.content.length)return{role:c,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(c.role===h.z7.ASSISTANT&&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(b.role===h.z7.TOOL&&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:h.z7.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.map(a=>({type:h.x4.FUNCTION,function:{name:a.name,description:String(a.description||""),parameters:a.input_schema||{type:"object",properties:{}}}}))),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:h.x4.FUNCTION,function:{name:a.name}}}}(b.tool_choice)),void 0!==b.reasoning_effort?d.reasoning_effort=b.reasoning_effort:b.reasoning?.effort!==void 0&&(d.reasoning_effort=b.reasoning.effort),void 0!==b.reasoning&&(d.reasoning=b.reasoning),d}(0,d.kz)(e.h.CLAUDE,e.h.OPENAI,k,null)},62842:(a,b,c)=>{c.d(b,{N:()=>d});function d(a,b){if("string"!=typeof a)return a;try{return JSON.parse(a)}catch{return b}}},65377:(a,b,c)=>{c.d(b,{Z:()=>i,h:()=>k});var d=c(78833),e=c(14170),f=c(37981),g=c(55673);let h=a=>"string"==typeof a&&a.length>64?a.substring(0,64):a;function i(a,b,c,d){if(!b.input)return b;let e={...b};e.messages=[],b.instructions&&e.messages.push({role:g.z7.SYSTEM,content:b.instructions});let h=null,i=[],k="",l=(0,f.m)(b.input);if(!l)return b;let m=a=>{if(Array.isArray(a.summary)){let b=a.summary.map(a=>a?.text||"").filter(Boolean).join("\n");if(b)return b}if(Array.isArray(a.content)){let b=a.content.map(a=>a?.text||"").filter(Boolean).join("\n");if(b)return b}return""};for(let a of l){let b=a.type||(a.role?g.Du.MESSAGE:null);if(b===g.Du.MESSAGE){if(h&&(e.messages.push(h),h=null),i.length>0){for(let a of i)e.messages.push(a);i=[]}let b=Array.isArray(a.content)?a.content.map(a=>{if(a.type===g.Du.INPUT_TEXT||a.type===g.Du.OUTPUT_TEXT)return{type:g.x4.TEXT,text:a.text};if(a.type===g.Du.INPUT_IMAGE){let b=a.image_url||a.file_id||"";return{type:g.x4.IMAGE_URL,image_url:{url:b,detail:a.detail||"auto"}}}return a}):a.content,c={role:a.role,content:b};a.role===g.z7.ASSISTANT&&k&&(c.reasoning_content=k),k="",e.messages.push(c)}else if(b===g.Du.FUNCTION_CALL){if(!h&&(h={role:g.z7.ASSISTANT,content:null,tool_calls:[]},k&&(h.reasoning_content=k,k="")),!a.name||"string"!=typeof a.name||""===a.name.trim())continue;h.tool_calls.push({id:a.call_id,type:g.x4.FUNCTION,function:{name:a.name,arguments:a.arguments}})}else if(b===g.Du.FUNCTION_CALL_OUTPUT){if(h&&(e.messages.push(h),h=null),i.length>0){for(let a of i)e.messages.push(a);i=[]}e.messages.push({role:g.z7.TOOL,tool_call_id:a.call_id,content:"string"==typeof a.output?a.output:JSON.stringify(a.output)})}else if(b===g.Du.REASONING){let b=m(a);b&&(k=k?`${k}
60
60
  ${b}`:b);continue}}if(h&&e.messages.push(h),i.length>0)for(let a of i)e.messages.push(a);return b.tools&&Array.isArray(b.tools)&&(e.tools=b.tools.map(a=>{if(a.function)return a;let b=a.name;return b&&"string"==typeof b&&""!==b.trim()?{type:g.x4.FUNCTION,function:{name:b,description:String(a.description||""),parameters:j(a.parameters),strict:a.strict}}:null}).filter(Boolean)),void 0!==e.max_output_tokens&&(void 0===e.max_tokens&&(e.max_tokens=e.max_output_tokens),delete e.max_output_tokens),delete e.input,delete e.instructions,delete e.include,delete e.prompt_cache_key,delete e.store,delete e.reasoning,e}function j(a){return a?"object"!==a.type||a.properties?a:{...a,properties:{}}:{type:"object",properties:{}}}function k(a,b,c,d){if(b.input)return{...b,model:a,stream:!0};let e={model:a,input:[],stream:!0,store:!1},f=!1;for(let a of b.messages||[]){if(a.role===g.z7.SYSTEM){f||(e.instructions="string"==typeof a.content?a.content:"",f=!0);continue}if(a.role===g.z7.USER||a.role===g.z7.ASSISTANT){let b=a.role===g.z7.USER?g.Du.INPUT_TEXT:g.Du.OUTPUT_TEXT,c="string"==typeof a.content?[{type:b,text:a.content}]:Array.isArray(a.content)?a.content.map(a=>{if(a.type===g.x4.TEXT)return{type:b,text:a.text};if(a.type===g.x4.IMAGE_URL){let b="string"==typeof a.image_url?a.image_url:a.image_url?.url;return{type:g.Du.INPUT_IMAGE,image_url:b,detail:a.image_url?.detail||"auto"}}if(a.type===g.Du.INPUT_IMAGE)return a;let c=a.text||a.content||JSON.stringify(a);return{type:b,text:"string"==typeof c?c:JSON.stringify(c)}}):[];c.length>0&&e.input.push({type:g.Du.MESSAGE,role:a.role,content:c})}if(a.role===g.z7.ASSISTANT&&a.tool_calls)for(let b of a.tool_calls)e.input.push({type:g.Du.FUNCTION_CALL,call_id:h(b.id),name:b.function?.name||"_unknown",arguments:b.function?.arguments||"{}"});if(a.role===g.z7.TOOL){let b="string"==typeof a.content?a.content:Array.isArray(a.content)?a.content.map(a=>a.text||JSON.stringify(a)).join(""):JSON.stringify(a.content);e.input.push({type:g.Du.FUNCTION_CALL_OUTPUT,call_id:h(a.tool_call_id),output:b})}}return f||(e.instructions=""),b.tools&&Array.isArray(b.tools)&&(e.tools=b.tools.map(a=>a.type===g.x4.FUNCTION?{type:g.x4.FUNCTION,name:a.function.name,description:String(a.function.description||""),parameters:j(a.function.parameters),strict:a.function.strict}:a)),void 0!==b.temperature&&(e.temperature=b.temperature),void 0!==b.max_tokens&&(e.max_tokens=b.max_tokens),void 0!==b.top_p&&(e.top_p=b.top_p),void 0!==b.reasoning&&(e.reasoning=b.reasoning),void 0!==b.reasoning_effort&&(e.reasoning={effort:b.reasoning_effort,summary:"auto"}),e}(0,d.kz)(e.h.OPENAI_RESPONSES,e.h.OPENAI,i,null),(0,d.kz)(e.h.OPENAI,e.h.OPENAI_RESPONSES,k,null)},69320:(a,b,c)=>{c.d(b,{Ut:()=>e,a_:()=>f,bC:()=>d});let d={STOP:"stop",LENGTH:"length",TOOL_CALLS:"tool_calls",CONTENT_FILTER:"content_filter"},e={END_TURN:"end_turn",MAX_TOKENS:"max_tokens",TOOL_USE:"tool_use",STOP_SEQUENCE:"stop_sequence"},f={STOP:"STOP",MAX_TOKENS:"MAX_TOKENS",SAFETY:"SAFETY",RECITATION:"RECITATION",BLOCKLIST:"BLOCKLIST",PROHIBITED_CONTENT:"PROHIBITED_CONTENT"}},71301:(a,b,c)=>{c.d(b,{$q:()=>h,ni:()=>l,W$:()=>j});var d=c(71553),e=c(47774);let f=[{sig:[137,80,78,71],offset:0,mime:"image/png"},{sig:[255,216,255],offset:0,mime:"image/jpeg"},{sig:[71,73,70,56],offset:0,mime:"image/gif"},{sig:[82,73,70,70],offset:0,mime:"image/webp",verifyWebp:!0},{sig:[66,77],offset:0,mime:"image/bmp"}],g=new Set(["localhost","127.0.0.1","0.0.0.0","::1","169.254.169.254","metadata.google.internal"]);function h(a,b){return`data:${a};base64,${b}`}let i=/^data:([^;]+);base64,([\s\S]+)$/;function j(a){if("string"!=typeof a)return null;let b=a.match(i);return b?{mimeType:b[1],base64:b[2]}:null}async function k(a){if(!a||g.has(a.toLowerCase()))return null;try{let b=await (0,d.lookup)(a,{all:!0});if(!b.length||b.some(a=>(function(a){if(!a||"::1"===a||a.startsWith("fc")||a.startsWith("fd")||a.startsWith("fe80"))return!0;let b=(a.includes(".")?a.split(":").pop():a).split(".").map(a=>Number.parseInt(a,10));if(4!==b.length||b.some(a=>Number.isNaN(a)))return!a.includes(":");let[c,d]=b;return 10===c||127===c||0===c||172===c&&d>=16&&d<=31||192===c&&168===d||169===c&&254===d||100===c&&d>=64&&d<=127||!1})(a.address)))return null;return b}catch{return null}}async function l(a,b={}){let c,{signal:d,timeoutMs:g=1e4,maxBytes:h=0xa00000}=b;if(!a||!a.startsWith("http://")&&!a.startsWith("https://"))return null;try{c=new URL(a)}catch{return null}let i=await k(c.hostname);if(!i)return null;let j=new AbortController,m=d?null:setTimeout(()=>j.abort(),g),n=d||j.signal,o=new e.g6({connect:{lookup:(a,b,c)=>c(null,[{address:i[0].address,family:i[0].family}])}});try{let b=await fetch(a,{signal:n,redirect:"manual",dispatcher:o});if(!b.ok||!b.body)return null;let c=b.body.getReader(),d=[],e=0;for(;;){let{done:a,value:b}=await c.read();if(a)break;if((e+=b.length)>h){try{await c.cancel()}catch{}return null}d.push(b)}let g=Buffer.concat(d.map(a=>Buffer.from(a))),i=function(a){for(let{sig:b,offset:c,mime:d,verifyWebp:e}of f){if(a.length<c+b.length)continue;let f=!0;for(let d=0;d<b.length;d++)if(a[c+d]!==b[d]){f=!1;break}if(f&&(!e||a.length>=12&&87===a[8]&&69===a[9]&&66===a[10]&&80===a[11]))return d}return null}(g);if(!i)return null;return{url:`data:${i};base64,${g.toString("base64")}`,mimeType:i}}catch{return null}finally{m&&clearTimeout(m),o.close().catch(()=>{})}}},74525:(a,b,c)=>{c.d(b,{M:()=>e});var d=c(41004);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>d.Uc&&(b=d.Uc),b}},74957:(a,b,c)=>{c.d(b,{H:()=>i});var d=c(41004),e=c(93943),f=c(39609),g=c(92306),h=c(74129);class i{constructor(a,b){this.provider=a,this.config=b,this.noAuth=b?.noAuth||!1}getProvider(){return this.provider}getBaseUrls(){return this.config.baseUrls||(this.config.baseUrl?[this.config.baseUrl]:[])}getFallbackCount(){return this.getBaseUrls().length||1}buildUrl(a,b,c=0,d=null){if(this.provider?.startsWith?.("openai-compatible-")){let a=(d?.providerSpecificData?.baseUrl||h.Es).replace(/\/$/,""),b=this.provider.includes("responses")?"/responses":"/chat/completions";return`${a}${b}`}if(this.provider?.startsWith?.("anthropic-compatible-")){let a=(d?.providerSpecificData?.baseUrl||h.ky).replace(/\/$/,"");return`${a}/messages`}let e=this.getBaseUrls();return e[c]||e[0]||this.config.baseUrl}buildHeaders(a,b=!0){let c={"Content-Type":"application/json",...this.config.headers};return this.provider?.startsWith?.("anthropic-compatible-")?(a.apiKey?c["x-api-key"]=a.apiKey:a.accessToken&&(c.Authorization=`Bearer ${a.accessToken}`),c["anthropic-version"]||(c["anthropic-version"]=h.b8)):a.accessToken?c.Authorization=`Bearer ${a.accessToken}`:a.apiKey&&(c.Authorization=`Bearer ${a.apiKey}`),b&&(c.Accept="text/event-stream"),c}transformRequest(a,b,c,d){return b}shouldRetry(a,b){return a===d.gx.RATE_LIMITED&&b+1<this.getFallbackCount()}async refreshCredentials(a,b,c=null){return null}needsRefresh(a){return(0,e.fp)(this.provider,a)}parseError(a,b){return{status:a.status,message:b||`HTTP ${a.status}`}}async execute({model:a,body:b,stream:c,credentials:e,signal:h,log:i,proxyOptions:j=null}){let k=this.getFallbackCount(),l=null,m=0,n=0,o={},p={...d.cI,...this.config.retry},q=async(a,b,c,e=null)=>{let{attempts:f,delayMs:g}=(0,d.DR)(p[b]);if(f<=0||o[a]>=f)return!1;let h=g;if(e&&this.computeRetryDelay){let b=await this.computeRetryDelay(e,o[a]+1,g);if(!1===b)return!1;null!=b&&(h=b)}let j=o[a]+1;return e&&this.computeRetryDelay||(h=Math.min(g*Math.pow(2,j-1)+.25*g*Math.random(),3e4)),o[a]++,n++,i?.debug?.("RETRY",`${c} retry ${o[a]}/${f} after ${(h/1e3).toFixed(1)}s (exp backoff attempt ${j})`),await new Promise(a=>setTimeout(a,h)),!0};for(let p=0;p<k;p++){let r=this.buildUrl(a,c,p,e),s=this.transformRequest(a,b,c,e),t=this.buildHeaders(e,c);o[p]||(o[p]=0);let u=new AbortController,v=this.config?.timeoutMs||d.pH,w=setTimeout(()=>u.abort(Error("fetch connect timeout")),v),x=h?AbortSignal.any([h,u.signal]):u.signal;try{let a=JSON.stringify(s),b=Date.now();(0,g.s)("FETCH",`${this.provider.toUpperCase()} → ${r} | body=${a.length}B | connectTimeout=${v}ms`);let c=await (0,f.proxyAwareFetch)(r,{method:"POST",headers:t,body:a,signal:x},j);clearTimeout(w);let d=c.headers?.get?.("content-type")||"",e=c.headers?.get?.("content-length")||"?";if((0,g.s)("FETCH",`${this.provider.toUpperCase()} ← ${c.status} | ttft=${Date.now()-b}ms | ct=${d} | cl=${e}`),await q(p,c.status,`status ${c.status}`,c)){p--;continue}if(this.shouldRetry(c.status,p)){i?.debug?.("RETRY",`${c.status} on ${r}, trying fallback ${p+1}`),m=c.status;continue}return{response:c,url:r,headers:t,transformedBody:s,retryCount:n}}catch(b){clearTimeout(w),l=b;let a=u.signal.aborted&&"AbortError"===b.name;if((0,g.s)("FETCH",`${this.provider.toUpperCase()} ✖ ${b.name}: ${b.message}${a?" (connect timeout)":""}`),"AbortError"===b.name&&!a)throw b;if(await q(p,d.gx.BAD_GATEWAY,`network "${b.message}"`)){p--;continue}if(p+1<k){i?.debug?.("RETRY",`Error on ${r}, trying fallback ${p+1}`);continue}throw b}}throw l||Error(`All ${k} URLs failed with status ${m}`)}}},78833:(a,b,c)=>{c.d(b,{Ws:()=>af,Ai:()=>ag,nZ:()=>ae,kz:()=>ab,GH:()=>ac,Y8:()=>ad});var d,e,f=c(14170),g=c(17242),h=c(95189),i=c(55399),j=c(55673),k=c(57647),l=c(52136),m=c(80662);c(39536);var n=c(26070);c(60983);var o=c(19979),p=c(74525),q=c(71301),r=c(97721);function s(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,p.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:j.z7.SYSTEM,content:a})}if(b.contents&&Array.isArray(b.contents))for(let a of b.contents){let b=function(a){let b=a.role===j.RV.USER?j.z7.USER:j.z7.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:j.x4.TEXT,text:b.text}),b.inlineData&&c.push({type:j.x4.IMAGE_URL,image_url:{url:(0,q.$q)(b.inlineData.mimeType,b.inlineData.data)}}),b.functionCall&&d.push({id:b.functionCall.id||`call_${b.functionCall.name}`,type:j.x4.FUNCTION,function:{name:b.functionCall.name,arguments:JSON.stringify(b.functionCall.args||{})}}),b.functionResponse)return{role:j.z7.TOOL,tool_call_id:b.functionResponse.id||`call_${b.functionResponse.name}`,content:JSON.stringify(b.functionResponse.response?.result||b.functionResponse.response||{})};if(d.length>0){let a={role:j.z7.ASSISTANT};return c.length>0&&(a.content=1===c.length?c[0].text:c),a.tool_calls=d,a}return c.length>0?{role:b,content:(0,r.z)(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:j.x4.FUNCTION,function:{name:b.name,description:b.description||"",parameters:b.parameters||{type:"object",properties:{}}}})}return d}ab(f.h.GEMINI,f.h.OPENAI,s,null),ab(f.h.GEMINI_CLI,f.h.OPENAI,s,null);var t=c(96281),u=c(75924),v=c(26922);function w(){return crypto.randomUUID()}function x(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)}function y(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}function z(a,b,c,d=t.bf){let e={model:a,contents:[],generationConfig:{},safetySettings:v.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),void 0!==b.max_tokens&&(e.generationConfig.maxOutputTokens=b.max_tokens);let f={};if(b.messages&&Array.isArray(b.messages)){for(let a of b.messages)if(a.role===j.z7.ASSISTANT&&a.tool_calls)for(let b of a.tool_calls)b.type===j.x4.FUNCTION&&b.id&&b.function?.name&&(f[b.id]=b.function.name)}let g={};if(b.messages&&Array.isArray(b.messages))for(let a of b.messages)a.role===j.z7.TOOL&&a.tool_call_id&&(g[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],h=c.role,i=c.content;if(h===j.z7.SYSTEM&&b.messages.length>1)e.systemInstruction={role:j.RV.USER,parts:[{text:"string"==typeof i?i:(0,v.kU)(i)}]};else if(h===j.z7.USER||h===j.z7.SYSTEM&&1===b.messages.length){let a=(0,v.S6)(i);a.length>0&&e.contents.push({role:j.RV.USER,parts:a})}else if(h===j.z7.ASSISTANT){let a=[];if(c.reasoning_content&&(a.push({thought:!0,text:c.reasoning_content}),a.push({thoughtSignature:d,text:""})),i){let b="string"==typeof i?i:(0,v.kU)(i);b&&a.push({text:b})}if(c.tool_calls&&Array.isArray(c.tool_calls)){let b=[];for(let e of c.tool_calls){if(e.type!==j.x4.FUNCTION)continue;let c=(0,v.pT)(e.function?.arguments||"{}");a.push({thoughtSignature:d,functionCall:{id:e.id,name:x(e.function.name),args:c}}),b.push(e.id)}if(a.length>0&&e.contents.push({role:j.RV.MODEL,parts:a}),b.some(a=>g[a])){let a=[];for(let c of b){if(!g[c])continue;let b=f[c];if(!b){let a=c.split("-");b=a.length>2?a.slice(0,-2).join("-"):c}let d=g[c],e=(0,v.pT)(d);null===e?e={result:d}:"object"!=typeof e&&(e={result:e}),a.push({functionResponse:{id:c,name:x(b),response:{result:e}}})}a.length>0&&e.contents.push({role:j.RV.USER,parts:a})}}else a.length>0&&e.contents.push({role:j.RV.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,v.Yr)(structuredClone(c.input_schema||{type:"object",properties:{}}));a.push({name:x(c.name),description:c.description||"",parameters:b})}else if(c.type===j.x4.FUNCTION&&c.function){let b=c.function,d=(0,v.Yr)(structuredClone(b.parameters||{type:"object",properties:{}}));a.push({name:x(b.name),description:b.description||"",parameters:d})}a.length>0&&(e.tools=[{functionDeclarations:a}])}return e.contents=y(e.contents),e}function A(a,b,c){return z(a,b,c)}function B(a,b,c){let d=z(a,b,c,t.$G);if(d.tools?.[0]?.functionDeclarations){for(let a of d.tools[0].functionDeclarations)if(a.parameters){let b=(0,v.Yr)(a.parameters);a.parameters=b}}return d}function C(a,b,c=null,d=!1){let e={project:c?.projectId||(0,v.w_)(),model:a,userAgent:d?"antigravity":"gemini-cli",requestId:d?`agent-${w()}`:(0,v.KZ)(),request:{sessionId:(0,m.E9)(c?._clientSessionId)||(d?(0,m.RF)(c?.email||c?.connectionId):(0,v.f6)()),contents:b.contents,systemInstruction:b.systemInstruction,generationConfig:b.generationConfig,tools:b.tools}};if(d){e.requestType="agent";let a=[{text:u.$V},{text:`Please ignore the following [ignore]${u.$V}[/ignore]`}];e.request.systemInstruction?.parts?e.request.systemInstruction.parts.unshift(...a):e.request.systemInstruction={role:j.RV.USER,parts:a},b.tools?.length>0&&(e.request.toolConfig={functionCallingConfig:{mode:"VALIDATED"}})}else e.request.safetySettings=b.safetySettings;return e}ab(f.h.OPENAI,f.h.GEMINI,A,null),ab(f.h.OPENAI,f.h.GEMINI_CLI,(a,b,c,d)=>C(a,B(a,b,c),d),null),ab(f.h.OPENAI,f.h.ANTIGRAVITY,function(a,b,c,d=null){if(a.toLowerCase().includes("claude")){let e=(0,o.C)(a,b,c);return function(a,b,c=null,d=t.bf){let e={project:c?.projectId||(0,v.w_)(),model:a,userAgent:"antigravity",requestId:`agent-${w()}`,requestType:"agent",request:{sessionId:(0,m.E9)(c?._clientSessionId)||(0,m.RF)(c?.email||c?.connectionId),contents:[],generationConfig:{temperature:b.temperature||1,maxOutputTokens:b.max_tokens||4096}}},f={};if(b.messages&&Array.isArray(b.messages)){for(let a of b.messages)if(Array.isArray(a.content))for(let b of a.content)b.type===j.R4.TOOL_USE&&b.id&&b.name&&(f[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(c.type===j.R4.TEXT)b.push({text:c.text});else if(c.type===j.R4.TOOL_USE)b.push({thoughtSignature:d,functionCall:{id:c.id,name:x(c.name),args:c.input||{}}});else if(c.type===j.R4.TOOL_RESULT){let a=c.content;Array.isArray(a)&&(a=a.map(a=>a.type===j.R4.TEXT?a.text:JSON.stringify(a)).join("\n"));let d=f[c.tool_use_id]?x(f[c.tool_use_id]):"tool";b.push({functionResponse:{id:c.tool_use_id,name:d,response:{result:(0,v.pT)(a)||a}}})}}else"string"==typeof a.content&&b.push({text:a.content});b.length>0&&e.request.contents.push({role:a.role===j.z7.ASSISTANT?j.RV.MODEL:j.RV.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,v.Yr)(c.input_schema);a.push({name:x(c.name),description:c.description||"",parameters:b})}a.length>0&&(e.request.tools=[{functionDeclarations:a}],e.request.toolConfig={functionCallingConfig:{mode:"VALIDATED"}})}let g=[{text:u.$V},{text:`Please ignore the following [ignore]${u.$V}[/ignore]`}];if(b.system)if(Array.isArray(b.system))for(let a of b.system)a.text&&g.push({text:a.text});else"string"==typeof b.system&&g.push({text:b.system});return e.request.systemInstruction?.parts?e.request.systemInstruction.parts.unshift(...g):e.request.systemInstruction={role:j.RV.USER,parts:g},e.request.contents=y(e.request.contents),e}(a,e,d)}let e=B(a,b,c);return C(a,e,d,!0)},null),ab(f.h.OPENAI,f.h.VERTEX,function(a,b,c,d){var e=A(a,b,c,d);if(!e?.contents)return e;for(let a of e.contents)if(Array.isArray(a.parts))for(let b of a.parts)void 0!==b.thoughtSignature&&(b.thoughtSignature=t.n6),b.functionCall&&"id"in b.functionCall&&delete b.functionCall.id,b.functionResponse&&"id"in b.functionResponse&&delete b.functionResponse.id;return e},null);var D=c(58028);ab(f.h.ANTIGRAVITY,f.h.OPENAI,function(a,b,c){let d=b.request||b,e={model:a,messages:[],stream:c};if(d.generationConfig){let a=d.generationConfig;if(a.maxOutputTokens){let b={max_tokens:a.maxOutputTokens,tools:d.tools};e.max_tokens=(0,p.M)(b)}if(void 0!==a.temperature&&(e.temperature=a.temperature),void 0!==a.topP&&(e.top_p=a.topP),void 0!==a.topK&&(e.top_k=a.topK),a.thinkingConfig){let b=(0,D.Vp)(a.thinkingConfig.thinkingBudget||0);b&&(e.reasoning_effort=b)}}if(d.systemInstruction){var f;let a="string"==typeof(f=d.systemInstruction)?f:f.parts&&Array.isArray(f.parts)?f.parts.map(a=>a.text||"").join(""):"";a&&e.messages.push({role:j.z7.SYSTEM,content:a})}if(d.contents&&Array.isArray(d.contents))for(let a of d.contents){let b=function(a){let b=a.role===j.RV.MODEL?j.z7.ASSISTANT:a.role===j.RV.USER?j.z7.USER:a.role;if(!a.parts||!Array.isArray(a.parts))return null;let c=[],d=[],e=[],f="";for(let b of a.parts){if(!0===b.thought&&b.text){f+=b.text;continue}if(b.thoughtSignature&&void 0!==b.text){b.text&&c.push({type:j.x4.TEXT,text:b.text});continue}void 0!==b.text&&""!==b.text&&c.push({type:j.x4.TEXT,text:b.text}),b.inlineData&&c.push({type:j.x4.IMAGE_URL,image_url:{url:(0,q.$q)(b.inlineData.mimeType,b.inlineData.data)}}),b.functionCall&&d.push({id:b.functionCall.id||`call_${b.functionCall.name}`,type:j.x4.FUNCTION,function:{name:b.functionCall.name,arguments:JSON.stringify(b.functionCall.args||{})}}),b.functionResponse&&e.push({role:j.z7.TOOL,tool_call_id:b.functionResponse.id||`call_${b.functionResponse.name}`,content:JSON.stringify(b.functionResponse.response?.result||b.functionResponse.response||{})})}if(e.length>0){if(d.length>0||c.length>0||f){let a={role:j.z7.ASSISTANT};return c.length>0&&(a.content=(0,r.z)(c)),f&&(a.reasoning_content=f),d.length>0&&(a.tool_calls=d),[...e,a]}return e}if(d.length>0){let a={role:j.z7.ASSISTANT};return c.length>0&&(a.content=(0,r.z)(c)),f&&(a.reasoning_content=f),a.tool_calls=d,a}if(c.length>0||f){let a={role:b};return c.length>0&&(a.content=(0,r.z)(c)),f&&(a.reasoning_content=f),a}return null}(a);b&&(Array.isArray(b)?e.messages.push(...b):e.messages.push(b))}if(d.tools&&Array.isArray(d.tools)){for(let a of(e.tools=[],d.tools))if(a.functionDeclarations)for(let b of a.functionDeclarations)e.tools.push({type:j.x4.FUNCTION,function:{name:b.name,description:b.description||"",parameters:function a(b){if(!b||"object"!=typeof b)return b;let c=Array.isArray(b)?[...b]:{...b};if("string"==typeof c.type&&(c.type=c.type.toLowerCase()),delete c.enumDescriptions,c.properties){let b={};for(let[d,e]of Object.entries(c.properties))b[d]=a(e);c.properties=b}return c.items&&(c.items=a(c.items)),c}(b.parameters)||{type:"object",properties:{}}}})}return e},null),c(65377);var E=c(94755),F=c(6382);function G(a,b){let c;try{c="string"==typeof b?b:JSON.stringify(b??{})}catch{c="{}"}return`[Tool call: ${a||"unknown"}(${c})]`}function H(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}]`}ab(f.h.OPENAI,f.h.KIRO,function(a,b,c,d){let e=b.messages||[],f=b.tools||[],g=b.temperature,h=b.top_p,{upstream:i,agentic:k}=(0,F.$D)(a),l=(0,F.P9)(b,d?.rawHeaders,a),{history:n,currentMessage:o}=function(a,b,c){let d=[],e=null,f=b&&b.length>0;f||(a=function(a){let b=[];for(let c of a){if(c.role===j.z7.TOOL){b.push({role:j.z7.USER,content:H(c.content)});continue}if(c.role===j.z7.ASSISTANT){let a=[];if(Array.isArray(c.content))for(let b of c.content)b.type===j.R4.TOOL_USE?a.push(G(b.name,b.input)):(b.type===j.x4.TEXT||b.text)&&a.push(b.text||"");else"string"==typeof c.content&&a.push(c.content);for(let b of c.tool_calls||[])a.push(G(b.function?.name,b.function?.arguments));b.push({role:j.z7.ASSISTANT,content:a.filter(Boolean).join("\n")});continue}if(c.role===j.z7.USER&&Array.isArray(c.content)){let a=c.content.map(a=>a.type===j.R4.TOOL_RESULT?{type:j.x4.TEXT,text:H(a.content)}:a);b.push({...c,content:a});continue}b.push(c)}return b}(a));let g=[],h=[],i=[],k=[],l=null,m=!1,n=()=>{if("user"===l){let a={userInputMessage:{content:g.join("\n\n").trim()||"continue",modelId:""}};k.length>0&&(a.userInputMessage.images=k),i.length>0&&(a.userInputMessage.userInputMessageContext={toolResults:i}),f&&!m&&(a.userInputMessage.userInputMessageContext||(a.userInputMessage.userInputMessageContext={}),a.userInputMessage.userInputMessageContext.tools=b.map(a=>{let b=a.function?.name||a.name,c=a.function?.description||a.description||"";c.trim()||(c=`Tool: ${b}`);let d=a.function?.parameters||a.parameters||a.input_schema||{};return{toolSpecification:{name:b,description:c,inputSchema:{json:0===Object.keys(d).length?{type:"object",properties:{},required:[]}:{...d,required:d.required??[]}}}}}),m=!0),d.push(a),e=a,g=[],i=[],k=[]}else if("assistant"===l){let a=h.join("\n\n").trim()||"...";d.push({assistantResponseMessage:{content:a}}),h=[]}};for(let b=0;b<a.length;b++){let c=a[b],e=c.role;if((e===j.z7.SYSTEM||e===j.z7.TOOL)&&(e=j.z7.USER),e!==l&&null!==l&&n(),l=e,e===j.z7.USER){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(a.type===j.x4.TEXT||a.text)b.push(a.text||"");else if(a.type===j.x4.IMAGE_URL){let c=a.image_url?.url||"",d=(0,q.W$)(c);if(d){let a=d.mimeType.split("/")[1]||d.mimeType;k.push({format:a,source:{bytes:d.base64}})}else(c.startsWith("http://")||c.startsWith("https://"))&&b.push(`[Image: ${c}]`)}else if(a.type===j.R4.IMAGE&&a.source?.type==="base64"&&a.source?.data){let b=a.source.media_type||j.BY,c=b.split("/")[1]||b;k.push({format:c,source:{bytes:a.source.data}})}a=b.join("\n");let d=c.content.filter(a=>a.type===j.R4.TOOL_RESULT);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:"";i.push({toolUseId:a.tool_use_id,status:"success",content:[{text:b}]})})}if(c.role===j.z7.TOOL){let a="string"==typeof c.content?c.content:"";i.push({toolUseId:c.tool_call_id,status:"success",content:[{text:a}]})}else a&&g.push(a)}else if(e===j.z7.ASSISTANT){let a="",b=[];if(Array.isArray(c.content)?(a=c.content.filter(a=>a.type===j.x4.TEXT).map(a=>a.text).join("\n").trim(),b=c.content.filter(a=>a.type===j.R4.TOOL_USE)):"string"==typeof c.content&&(a=c.content.trim()),c.tool_calls&&c.tool_calls.length>0&&(b=c.tool_calls),a&&h.push(a),b.length>0){n();let a=d[d.length-1];a?.assistantResponseMessage&&(a.assistantResponseMessage.toolUses=b.map(a=>a.function?{toolUseId:a.id||(0,E.A)(),name:a.function.name,input:function(a,b){if("string"!=typeof a)return a??b;try{return JSON.parse(a)}catch{return b}}(a.function.arguments,{})}:{toolUseId:a.id||(0,E.A)(),name:a.name,input:a.input||{}})),l=null}}}null!==l&&n();for(let a=d.length-1;a>=0;a--)if(d[a].userInputMessage){e=d.splice(a,1)[0];break}let o=d[0]?.userInputMessage?.userInputMessageContext?.tools;d.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 p=[];for(let a=0;a<d.length;a++){let b=d[a];if(b.userInputMessage&&p.length>0&&p[p.length-1].userInputMessage){let a=p[p.length-1];a.userInputMessage.content+="\n\n"+b.userInputMessage.content;let c=a.userInputMessage.userInputMessageContext,d=b.userInputMessage.userInputMessageContext;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 p.push(b)}return e||(e={userInputMessage:{content:"",modelId:c}}),f&&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(H(a.content));if(0===f.length)continue;let g=f.join("\n");a.content=a.content?`${a.content}
@@ -55,4 +55,4 @@ ${e.length} files in ${g.length} dirs:
55
55
  `,b.slice(0,10)))h+=` ${c}
56
56
  `;b.length>10&&(h+=` +${b.length-10}
57
57
  `),h+="\n"}return g.length>20&&(h+=`+${g.length-20} more dirs
58
- `),h.replace(/\n+$/,"")}y.filterName="search-list";let z=/^Result of search in '[^']*' \(total (\d+) files?\):/,A=/^diff --git /m,B=/^@@ /m,C=/^On branch |^nothing to commit|^Changes (not |to be )|^Untracked files:/m,D=/^[ MADRCU?!][ MADRCU?!] \S/m,E=/^(npm (warn|error|ERR!)|yarn (warn|error)|\s*Compiling\s+\S+|\s*Downloading\s+\S+|added \d+ package|\[ERROR\]|BUILD (SUCCESS|FAILED)|\s*Finished\s+|Successfully (installed|built)|ERROR:)/im,F=/[├└]──|│ /,G=/^[-dlbcps][rwx-]{9}/m,H=/^total \d+$/m;function I(a){let b=a.indexOf(":");if(-1===b)return!1;let c=a.indexOf(":",b+1);if(-1===c)return!1;let d=a.slice(b+1,c);return/^\d+$/.test(d)}function J(a){let b=a.trim();return!(0===b.length||b.includes(":"))&&(b.startsWith(".")||b.startsWith("/")||b.includes("/"))}function K(a,b){if(!b||!a)return null;if(a.conversationState){var c=a;let b={bytesBefore:0,bytesAfter:0,hits:[]};try{let a=c.conversationState,d=[...Array.isArray(a?.history)?a.history:[]];for(let c of(a?.currentMessage&&d.push(a.currentMessage),d)){let a=c?.userInputMessage?.userInputMessageContext?.toolResults;if(Array.isArray(a)){for(let c of a)if("error"!==c.status&&Array.isArray(c.content))for(let a of c.content)a&&"string"==typeof a.text&&(a.text=L(a.text,b,"kiro-tool-result"))}}}catch(a){return console.warn("[RTK] compressKiroFormat error:",a.message),null}return b}let d=Array.isArray(a.messages)?a.messages:Array.isArray(a.input)?a.input:null;if(!d)return null;let e={bytesBefore:0,bytesAfter:0,hits:[]};try{for(let a=0;a<d.length;a++){let b=d[a];if(b){if("function_call_output"===b.type){if("string"==typeof b.output)b.output=L(b.output,e,"openai-responses-string");else if(Array.isArray(b.output))for(let a=0;a<b.output.length;a++){let c=b.output[a];c&&"input_text"===c.type&&"string"==typeof c.text&&(c.text=L(c.text,e,"openai-responses-array"))}continue}if("tool"===b.role&&"string"==typeof b.content){b.content=L(b.content,e,"openai-tool");continue}if(Array.isArray(b.content)){if("tool"===b.role){for(let a=0;a<b.content.length;a++){let c=b.content[a];c&&"text"===c.type&&"string"==typeof c.text&&(c.text=L(c.text,e,"openai-tool-array"))}continue}for(let a=0;a<b.content.length;a++){let c=b.content[a];if(c&&"tool_result"===c.type&&!0!==c.is_error){if("string"==typeof c.content)c.content=L(c.content,e,"claude-string");else if(Array.isArray(c.content))for(let a=0;a<c.content.length;a++){let b=c.content[a];b&&"text"===b.type&&"string"==typeof b.text&&(b.text=L(b.text,e,"claude-array"))}}}}}}}catch(a){return console.warn("[RTK] compressMessages error:",a.message),null}return e}function L(a,b,c){let d=a.length;if(b.bytesBefore+=d,d<500||d>0xa00000)return b.bytesAfter+=d,a;let g=function(a){var b,c;let d,g,h=a.length>1024?a.slice(0,1024):a;if(A.test(h)||B.test(h))return e;if(C.test(h))return f;if(E.test(h))return o;if(!((d=h.split("\n").filter(a=>a.trim())).length<3)&&d.filter(a=>D.test(a)).length/d.length>=.6)return f;if(function(a){let b=0;for(let c of a.split("\n")){let a=c.trimStart();if(!/^[*|\/\\ ]+$/.test(a)&&(/^commit [0-9a-f]{4,40}/.test(a)||/^(Author|Date|Merge):\s/.test(a)||/^[0-9a-f]{7,40} /.test(a))){b++;continue}}return b}(h)>=2)return m;let i=h.split("\n"),j=i.filter(a=>a.trim().length>0);return j.slice(0,5).some(I)?p:j.length>=3&&j.every(J)?q:F.test(h)?u:H.test(h)||(b=h,g=new RegExp((c=G).source,c.flags.includes("g")?c.flags:c.flags+"g"),(b.match(g)||[]).length>=3)?t:z.test(h)?y:i.length>=250&&function(a){let b=0,c=0;for(let d of a.slice(0,100))0!==d.length&&(c++,x.test(d)&&b++);return!(c<5)&&b/c>=.7}(i)?w:j.length>=5?r:a.split("\n").length>=250?v:null}(a);if(!g)return b.bytesAfter+=d,a;let h=function(a,b){if("function"!=typeof a)return b;try{let c=a(b);if("string"!=typeof c)return b;return c}catch(d){let c=a.filterName||a.name||"anonymous";return console.warn(`[rtk] warning: filter '${c}' panicked — passing through raw output: ${d?.message||d}`),b}}(g,a);return!h||0===h.length||h.length>=d?(b.bytesAfter+=d,a):(b.bytesAfter+=h.length,b.hits.push({shape:c,filter:g.filterName||g.name,saved:d-h.length}),h)}function M(a){if(!a||!a.hits||0===a.hits.length)return null;let b=a.bytesBefore-a.bytesAfter,c=a.bytesBefore>0?(b/a.bytesBefore*100).toFixed(1):"0",d=Array.from(new Set(a.hits.map(a=>a.filter))).join(",");return`[RTK] saved ${b}B / ${a.bytesBefore}B (${c}%) via [${d}] hits=${a.hits.length}`}},76083:(a,b,c)=>{c.d(b,{C:()=>h});var d=c(14170),e=c(71301);let f=new Set([d.h.GEMINI,d.h.GEMINI_CLI,d.h.VERTEX,d.h.ANTIGRAVITY,d.h.OLLAMA,d.h.KIRO]);function g(a){return"string"==typeof a&&(a.startsWith("http://")||a.startsWith("https://"))}async function h(a,b,c,i={}){if(!a||!f.has(c))return 0;let j=function(a,b){let c=[],e=a=>{for(let b of a||[])if(Array.isArray(b.content)){for(let a of b.content)if(a?.type==="image_url"){let b="string"==typeof a.image_url?a.image_url:a.image_url?.url;g(b)&&c.push({get:()=>b,set:b=>{"string"==typeof a.image_url?a.image_url=b:a.image_url.url=b}})}}},f=a=>{for(let b of a||[])for(let a of b.parts||[]){let b=a?.fileData?.fileUri;g(b)&&c.push({get:()=>b,part:a})}};switch(b){case d.h.OPENAI:case d.h.OLLAMA:case d.h.KIRO:case d.h.CURSOR:case d.h.COMMANDCODE:e(a.messages);break;case d.h.CLAUDE:for(let b of a.messages||[])if(Array.isArray(b.content))for(let a of b.content)a?.type==="image"&&a.source?.type==="url"&&g(a.source.url)&&c.push({get:()=>a.source.url,claudeBlock:a});break;case d.h.GEMINI:case d.h.GEMINI_CLI:case d.h.VERTEX:f(a.contents);break;case d.h.ANTIGRAVITY:f(a?.request?.contents);break;default:e(a.messages)}return c}(a,b);if(!j.length)return 0;let k=0;for(let a of j){let b=a.get();if((0,e.W$)(b))continue;let c=await (0,e.ni)(b,i);c&&(a.set?a.set(c.url):a.part?(delete a.part.fileData,a.part.inlineData={mimeType:c.mimeType,data:c.url.split(",")[1]}):a.claudeBlock&&(a.claudeBlock.source={type:"base64",media_type:c.mimeType,data:c.url.split(",")[1]}),k++)}return k}},81626:(a,b,c)=>{function d(a,b){let c;if(!a.trim())return;let d=a.match(/^event:\s*(.+)$/m),e=a.match(/^data:\s*(.+)$/m);if(!d||!e)return;let f=d[1].trim(),g=e[1].trim();if("[DONE]"!==g){try{c=JSON.parse(g)}catch{return}"response.created"===f?(b.responseId=c.response?.id||b.responseId,b.created=c.response?.created_at||b.created):"response.output_item.done"===f?b.items.set(c.output_index??0,c.item):"response.completed"===f||"response.done"===f?(b.status="completed",c.response?.usage&&(b.usage.input_tokens=c.response.usage.input_tokens||0,b.usage.output_tokens=c.response.usage.output_tokens||0,b.usage.total_tokens=c.response.usage.total_tokens||0)):"response.failed"===f&&(b.status="failed")}}c.d(b,{I:()=>p,F:()=>o});let e={input_tokens:0,output_tokens:0,total_tokens:0};async function f(a){if(!a||"function"!=typeof a.getReader)return{id:`resp_${Date.now()}`,object:"response",created_at:Math.floor(Date.now()/1e3),status:"failed",output:[],usage:{...e}};let b=a.getReader(),c=new TextDecoder,f="",g={responseId:"",created:Math.floor(Date.now()/1e3),status:"in_progress",usage:{...e},items:new Map};try{for(;;){let{done:a,value:e}=await b.read();if(a)break;let h=(f+=c.decode(e,{stream:!0})).split("\n\n");for(let a of(f=h.pop()||"",h))d(a,g)}f.trim()&&d(f,g)}finally{b.releaseLock()}let h=[],i=g.items.size>0?Math.max(...g.items.keys()):-1;for(let a=0;a<=i;a++)h.push(g.items.get(a)||{type:"message",content:[],role:"assistant"});return{id:g.responseId||`resp_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,object:"response",created_at:g.created,status:g.status||"completed",output:h,usage:g.usage}}var g=c(43659),h=c(41004),i=c(14170),j=c(35024),k=c(86171),l=c(47370);let m=a=>j.xq[a]?.format===i.h.OPENAI_RESPONSES;function n(a){if(!a?.content||!Array.isArray(a.content))return"";let b=a.content.find(a=>"output_text"===a.type);if("string"==typeof b?.text)return b.text;let c=a.content.find(a=>"string"==typeof a.text);return"string"==typeof c?.text?c.text:""}function o(a,b){let c=[];for(let b of String(a||"").split("\n")){let a=b.trim();if(!a.startsWith("data:"))continue;let d=a.slice(5).trim();if(d&&"[DONE]"!==d)try{c.push(JSON.parse(d))}catch{}}if(0===c.length)return null;let d=c[0],e=[],f=[],g=new Map,h="stop",i=null;for(let a of c){let b=a?.choices?.[0],c=b?.delta||{};if("string"==typeof c.content&&c.content.length>0&&e.push(c.content),"string"==typeof c.reasoning_content&&c.reasoning_content.length>0&&f.push(c.reasoning_content),b?.finish_reason&&(h=b.finish_reason),a?.usage&&"object"==typeof a.usage&&(i=a.usage),Array.isArray(c.tool_calls))for(let a of c.tool_calls){let b=a.index??0;g.has(b)||g.set(b,{id:a.id||"",type:"function",function:{name:"",arguments:""}});let c=g.get(b);a.id&&(c.id=a.id),a.function?.name&&(c.function.name+=a.function.name),a.function?.arguments&&(c.function.arguments+=a.function.arguments)}}let j={role:"assistant",content:e.join("")||(g.size>0?null:"")};f.length>0&&(j.reasoning_content=f.join("")),g.size>0&&(j.tool_calls=[...g.entries()].sort((a,b)=>a[0]-b[0]).map(([,a])=>a));let k={id:d.id||`chatcmpl-${Date.now()}`,object:"chat.completion",created:d.created||Math.floor(Date.now()/1e3),model:d.model||b||"unknown",choices:[{index:0,message:j,finish_reason:h}]};return i&&(k.usage=i),k}async function p({providerResponse:a,sourceFormat:b,provider:c,model:d,body:e,stream:j,translatedBody:q,finalBody:r,requestStartTime:s,connectionId:t,apiKey:u,clientRawRequest:v,onRequestSuccess:w,trackDone:x,appendLog:y,savedTokens:z}){let A=a.headers.get("content-type")||"";if(!(A.includes("text/event-stream")||""===A&&m(c)))return null;x();let B={provider:c,model:d,connectionId:t,request:(0,k.Fo)(e,j),providerRequest:r||q||null};if(m(c)||b===i.h.OPENAI_RESPONSES)try{let e,g=await f(a.body);w&&await w();let h=g.usage||{},j=Date.now()-s;y({tokens:h,status:"200 OK"}),(0,k.qr)({provider:c,model:d,tokens:h,connectionId:t,apiKey:u,endpoint:v?.endpoint,latency:{ttft:j,total:j},savedTokens:z});let{msgItem:m,textContent:o}=function(a){if(!Array.isArray(a))return{msgItem:null,textContent:null};let b=a.filter(a=>a?.type==="message");if(0===b.length)return{msgItem:null,textContent:null};for(let a=b.length-1;a>=0;a--){let c=n(b[a]);if(c.length>0)return{msgItem:b[a],textContent:c}}let c=b[b.length-1];return{msgItem:c,textContent:n(c)}}(g.output);if((0,l.ox)((0,k.$R)({...B,latency:{ttft:j,total:j},tokens:{prompt_tokens:h.input_tokens||0,completion_tokens:h.output_tokens||0},response:{content:o,thinking:null,finish_reason:g.status||"unknown"},status:"success"},{endpoint:v?.endpoint||null})).catch(()=>{}),b===i.h.OPENAI_RESPONSES)return{success:!0,response:new Response(JSON.stringify(g),{headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})};let p=h.input_tokens||0,q=h.output_tokens||0,r=(g.output||[]).filter(a=>"function_call"===a.type).map((a,b)=>({id:a.call_id||`call_${a.name}_${Date.now()}_${b}`,type:"function",function:{name:a.name,arguments:"string"==typeof a.arguments?a.arguments:JSON.stringify(a.arguments||{})}})),x=r.length>0;if(b===i.h.ANTIGRAVITY||b===i.h.GEMINI||b===i.h.GEMINI_CLI)e={response:{candidates:[{content:{role:"model",parts:[{text:o||""}]},finishReason:"STOP",index:0}],usageMetadata:{promptTokenCount:p,candidatesTokenCount:q,totalTokenCount:p+q},modelVersion:d,responseId:g.id||`resp_${Date.now()}`}};else{let a={role:"assistant",content:o||(x?null:"")};x&&(a.tool_calls=r);let b="completed"===g.status||"done"===g.status,c=x?"tool_calls":b?"stop":g.status||"stop";e={id:g.id||`chatcmpl-${Date.now()}`,object:"chat.completion",created:g.created_at||Math.floor(Date.now()/1e3),model:g.model||d,choices:[{index:0,message:a,finish_reason:c}],usage:{prompt_tokens:p,completion_tokens:q,total_tokens:p+q}}}return{success:!0,response:new Response(JSON.stringify(e),{headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})}}catch(a){return console.error("[ChatCore] Responses API SSE→JSON failed:",a),(0,g.A1)(h.gx.BAD_GATEWAY,"Failed to convert streaming response to JSON")}try{let b=await a.text(),e=o(b,d);if(!e)return(0,g.A1)(h.gx.BAD_GATEWAY,"Invalid SSE response for non-streaming request");w&&await w();let f=e.usage||{},i=Date.now()-s;if(y({tokens:f,status:"200 OK"}),(0,k.qr)({provider:c,model:d,tokens:f,connectionId:t,apiKey:u,endpoint:v?.endpoint,latency:{ttft:i,total:i}}),(0,l.ox)((0,k.$R)({...B,latency:{ttft:i,total:i},tokens:f,response:{content:e.choices?.[0]?.message?.content||null,thinking:e.choices?.[0]?.message?.reasoning_content||null,finish_reason:e.choices?.[0]?.finish_reason||"unknown"},status:"success"},{endpoint:v?.endpoint||null})).catch(()=>{}),e?.choices)for(let a of e.choices)a?.message?.reasoning_content&&a.message.content&&delete a.message.reasoning_content;return{success:!0,response:new Response(JSON.stringify(e),{headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})}}catch(a){return console.error("[ChatCore] Chat Completions SSE→JSON failed:",a),(0,g.A1)(h.gx.BAD_GATEWAY,"Failed to convert streaming response to JSON")}}},86171:(a,b,c)=>{c.d(b,{$R:()=>j,Fo:()=>h,MK:()=>i,qr:()=>k});var d=c(47370),e=c(71857),f=c(73483);let g=["temperature","top_p","top_k","max_tokens","max_completion_tokens","thinking","reasoning","enable_thinking","presence_penalty","frequency_penalty","seed","stop","tools","tool_choice","response_format","prediction","store","metadata","n","logprobs","top_logprobs","logit_bias","user","parallel_tool_calls"];function h(a,b){let c={messages:a.messages||[],model:a.model,stream:b};for(let b of g)void 0!==a[b]&&(c[b]=a[b]);return c}function i(a){return a&&"object"==typeof a?a.usage?.input_tokens!==void 0?{prompt_tokens:a.usage.input_tokens||0,completion_tokens:a.usage.output_tokens||0,cache_read_input_tokens:a.usage.cache_read_input_tokens,cache_creation_input_tokens:a.usage.cache_creation_input_tokens}:a.usage?.prompt_tokens!==void 0?{prompt_tokens:a.usage.prompt_tokens||0,completion_tokens:a.usage.completion_tokens||0,cached_tokens:a.usage.prompt_tokens_details?.cached_tokens,reasoning_tokens:a.usage.completion_tokens_details?.reasoning_tokens}:a.usageMetadata?{prompt_tokens:a.usageMetadata.promptTokenCount||0,completion_tokens:a.usageMetadata.candidatesTokenCount||0,cached_tokens:a.usageMetadata.cachedContentTokenCount||0,reasoning_tokens:a.usageMetadata.thoughtsTokenCount||0}:null:null}function j(a,b={}){return{provider:a.provider||"unknown",model:a.model||"unknown",connectionId:a.connectionId||void 0,timestamp:new Date().toISOString(),latency:a.latency||{ttft:0,total:0},tokens:a.tokens||{prompt_tokens:0,completion_tokens:0},request:a.request,providerRequest:a.providerRequest||null,providerResponse:a.providerResponse||null,response:a.response||{},status:a.status||"success",...b}}function k({provider:a,model:b,tokens:c,connectionId:g,apiKey:h,endpoint:i,latency:j,savedTokens:l,retryCount:m,label:n="USAGE"}){if(!c||"object"!=typeof c)return;let o=c.input_tokens??c.prompt_tokens??0,p=c.output_tokens??c.completion_tokens??0;if(0===o&&0===p)return;let q=new Date().toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),r=g?` | account=${g.slice(0,8)}...`:"";console.log(`${e.lm.green}[${q}] 📊 [${n}] ${a.toUpperCase()} | in=${o} | out=${p}${r}${e.lm.reset}`);let s=(0,f._6)(c)||{prompt_tokens:c.prompt_tokens??c.input_tokens??0,completion_tokens:c.completion_tokens??c.output_tokens??0};(0,d.sZ)({provider:a||"unknown",model:b||"unknown",tokens:s,timestamp:new Date().toISOString(),connectionId:g||void 0,apiKey:h||void 0,endpoint:i||null,latency:j||{ttft:0,total:0},savedTokens:l||0,meta:m?JSON.stringify({retryCount:m}):null}).catch(()=>{})}},89630:(a,b,c)=>{c.d(b,{IL:()=>m,QS:()=>l,TZ:()=>i,fQ:()=>j,ww:()=>k});let d=global._semanticCache??=new Map,e=global._semanticCacheStats??={hits:0,misses:0,nearHits:0,stored:0,evicted:0};function f(a){return new Set(String(a).toLowerCase().replace(/[^\w\s]/g," ").split(/\s+/).filter(a=>a.length>=2))}function g(a){if(!Array.isArray(a))return"";let b=[];for(let c of a)if("user"===c.role){if("string"==typeof c.content)b.push(c.content);else if(Array.isArray(c.content))for(let a of c.content)"text"===a.type&&a.text&&b.push(a.text)}return b.join("\n")}function h(a,b,c){let d=0x811c9dc5,e=`${a}::${b}::${c}`;for(let a=0;a<e.length;a++)d^=e.charCodeAt(a),d=Math.imul(d,0x1000193);return d>>>0}function i(a,b,c,d){if(b||!a?.messages||a.tools||a.tool_choice||a.functions||g(a.messages).length<10)return!1;for(let b of a.messages)if("system"===b.role&&"string"==typeof b.content&&/do not cache|no cache/i.test(b.content))return!1;return!0}function j(a,b,c,i=.85){let k=g(c.messages);if(!k)return e.misses++,null;let l=h(a,b,k),m=Date.now(),n=d.get(l);if(n&&n.expiresAt>m)return n.lastAccessed=m,e.hits++,{response:n.response,similarity:1,exact:!0};n&&d.delete(l);let o=f(k),p=null,q=0;for(let[c,f]of d){if(f.expiresAt<=m){d.delete(c),e.evicted++;continue}if(f.provider!==a||f.model!==b)continue;let g=function(a,b){if(0===a.size||0===b.size)return 0;let c=0;for(let d of a)b.has(d)&&c++;return c/(a.size+b.size-c)}(o,f.tokenSet);g>=i&&g>q&&(q=g,p=f)}return p?(p.lastAccessed=m,e.nearHits++,{response:p.response,similarity:q,exact:!1}):(e.misses++,null)}function k(a,b,c,i,j=18e5){let l=g(c.messages);if(!l)return;let m=h(a,b,l),n=Date.now();if(d.size>=200){let a=null,b=1/0;for(let[c,e]of d)e.lastAccessed<b&&(b=e.lastAccessed,a=c);a&&(d.delete(a),e.evicted++)}d.set(m,{provider:a,model:b,response:i,tokenSet:f(l),text:l,createdAt:n,lastAccessed:n,expiresAt:n+j}),e.stored++}function l(){let a=0,b=Date.now();for(let c of d.values())c.expiresAt<=b&&a++;return{size:d.size,active:d.size-a,expired:a,...e,hitRate:e.hits+e.nearHits+e.misses>0?Math.round((e.hits+e.nearHits)/(e.hits+e.nearHits+e.misses)*100):0}}function m(){let a=d.size;return d.clear(),e.hits=0,e.misses=0,e.nearHits=0,e.stored=0,e.evicted=0,a}},92500:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{w:()=>J});var e=c(57647),f=c(78833),g=c(14170),h=c(95189),i=c(71857),j=c(59657),k=c(8521),l=c(71336),m=c(45699),n=c(52136),o=c(89630),p=c(35024),q=c(43659),r=c(41004),s=c(27349),t=c(47370),u=c(55330),v=c(86171),w=c(81626),x=c(5016),y=c(20623),z=c(324),A=c(14724),B=c(60125),C=c(60475),D=c(72758),E=c(70190),F=c(66306),G=c(5263),H=c(76083),I=a([u]);async function J({body:a,modelInfo:b,credentials:c,log:d,onCredentialsRefreshed:I,onRequestSuccess:K,onDisconnect:L,clientRawRequest:M,connectionId:N,userAgent:O,apiKey:P,ccFilterNaming:Q,rtkEnabled:R,headroomEnabled:S,headroomUrl:T,headroomCompressUserMessages:U,cavemanEnabled:V,cavemanLevel:W,ponytailEnabled:X,ponytailLevel:Y,sourceFormatOverride:Z,providerThinking:$,semanticCacheEnabled:_,semanticCacheThreshold:aa}){let ab,ac,{provider:ad,model:ae}=b,af=Date.now(),ag=Z||(0,e.Tz)(a),ah=(0,s.c)(a,ae,O,Q);if(ah)return ah;if(_&&(0,o.TZ)(a,!1,ad,ae)){let b=(0,o.fQ)(ad,ae,a,"number"==typeof aa?aa:.85);if(b)return d?.info?.("CACHE",`semantic cache ${b.exact?"HIT":"near-hit"} (${(100*b.similarity).toFixed(0)}% similarity) — returning cached response`),{response:b.response.clone?b.response.clone():b.response,url:"(cache)",headers:{},transformedBody:a,fromCache:!0,cacheSimilarity:b.similarity}}let ai=m.Xg[ad]||ad,aj=(0,m.ux)(ai,ae),ak=(0,e.oF)(ad,ag),al=aj||ak?.format||(0,e.jJ)(ad);ak&&c&&(c.runtimeTransport=ak);let am=(0,m.cY)(ai,ae),{cleanModel:an}=(0,n.nF)(ae),ao=(0,m.kt)(ai,an);if($?.mode&&"auto"!==$.mode){let b=$.mode;"on"!==b||a.thinking?"off"!==b||a.thinking?a.reasoning_effort||(a={...a,reasoning_effort:b}):a={...a,thinking:{type:"disabled"}}:(console.log("Injecting provider-level thinking config override: on"),a={...a,thinking:{type:"enabled",budget_tokens:1e4}})}let ap=!0===a.stream||ag===g.h.ANTIGRAVITY||ag===g.h.GEMINI||ag===g.h.GEMINI_CLI,aq=p.xq[ad]?.forceStream===!0,ar=!!aq||!1!==a.stream,as=(0,m.OA)(ai,ae);("imageGen"===as||/image|imagen|image-generation/i.test(ae))&&("antigravity"===ad||"gemini-cli"===ad)&&(ar=!1);let at=(0,z.J)(M?.headers||{},a);"deepseek-tui"===at&&!0!==a.stream&&(ar=!1);let au=M?.headers?.accept||"",av=au.includes("application/json"),aw=au.includes("text/event-stream");!av||aw||!0===a.stream||aq||(ar=!1);let ax=await (0,l.q7)(ag,al,ae);M&&ax.logClientRawRequest(M.endpoint,M.body,M.headers),ax.logRawRequest(a),d?.debug?.("FORMAT",`${ag} → ${al} | stream=${ar}`);let ay=(0,z.J)(M?.headers||{},a),az=(0,z.Q)(ay,ad);if(c&&(c.rawHeaders=M?.headers||{}),!az){let b=(0,F.nl)(ad,ae);(0,G.X)(a,ag,b)&&d?.debug?.("MODALITY",`stripped unsupported media for ${ad}/${ae}`);try{let b=await (0,H.C)(a,ag,al,{signal:void 0});b>0&&d?.debug?.("MODALITY",`prefetched ${b} remote image(s) for ${al}`)}catch(a){d?.warn?.("MODALITY",`image prefetch failed: ${a.message}`)}}if(az)d?.debug?.("PASSTHROUGH",`${ay} → ${ad} | native lossless`),ab={...a,model:ao},"claude"===ay&&(0,h.ui)(ab,ao);else{if(!(ab=(0,f.GH)(ag,al,ao,a,ar,c,ad,ax,am,N,ay)))return(0,t.uw)(ae,ad,N,!1,!0),(0,q.A1)(r.gx.BAD_REQUEST,`Failed to translate request for ${ag} → ${al}`);ac=ab._toolNameMap,delete ab._toolNameMap,ab.model=ao}if("claude"===ay&&Array.isArray(ab.tools)){let{tools:a,stripped:b}=(0,A.F)(ab.tools);b.length>0&&(ab.tools=a,d?.debug?.("TOOLDEDUP",`stripped ${b.length}: ${b.slice(0,3).join(", ")}${b.length>3?"...":""}`))}let aA=az?ag:al;"tts"===(0,m.OA)(ai,ae)&&ab.messages&&(ab.messages=ab.messages.filter(a=>"tool"!==a.role),delete ab.tools);let aB=(0,D.B)(ab,R),aC=(0,D.f)(aB);aC&&console.log(aC);let aD={},aE=await (0,E.SI)(ab,{enabled:S,url:T,model:ao,format:aA,compressUserMessages:U,diagnostics:aD}),aF=(0,E.Nv)(aE),aG=(0,E.O2)(aD);aF?(d?.info?.("HEADROOM",`${aF}${aG?` | ${aG}`:""}`),(0,E.cB)(aE,aD)&&d?.warn?.("HEADROOM",`reported token delta, but outbound JSON shrank <5%; provider may bill near-original payload | ${aG}`)):S&&d?.warn?.("HEADROOM",`skipped: ${aD.reason||"compression unavailable"}${aD.endpoint?` (${aD.endpoint})`:""}`),V&&W&&((0,B.p)(ab,aA,W),d?.debug?.("CAVEMAN",`${W} | ${aA}`)),X&&Y&&((0,C.U)(ab,aA,Y),d?.debug?.("PONYTAIL",`${Y} | ${aA}`));let aH=aB?(aB.bytesBefore||0)-(aB.bytesAfter||0):0,aI=Math.round(aH/4),aJ=aE?.tokens_saved||0,aK=(0,u.SB)(ad);(0,t.uw)(ae,ad,N,!0),(0,t.E5)({model:ae,provider:ad,connectionId:N,status:"PENDING"}).catch(()=>{});let aL=ab.messages?.length||ab.input?.length||ab.contents?.length||ab.request?.contents?.length||0;d?.debug?.("REQUEST",`${ad.toUpperCase()} | ${ae} | ${aL} msgs`);let aM=(0,j.jd)({onDisconnect:a=>{(0,t.uw)(ae,ad,N,!1),L&&L(a)},onError:()=>(0,t.uw)(ae,ad,N,!1),log:d,provider:ad,model:ae}),aN={connectionProxyEnabled:c?.providerSpecificData?.connectionProxyEnabled===!0,connectionProxyUrl:c?.providerSpecificData?.connectionProxyUrl||"",connectionNoProxy:c?.providerSpecificData?.connectionNoProxy||"",vercelRelayUrl:c?.providerSpecificData?.vercelRelayUrl||""};if(aN.vercelRelayUrl){let a=c?.connectionName||c?.connectionId||"unknown",b=c?.providerSpecificData?.connectionProxyPoolId||"none";d?.info?.("PROXY",`${ad.toUpperCase()} | ${ae} | conn=${a} | pool=${b} | vercel-relay=${aN.vercelRelayUrl}`)}else if(aN.connectionProxyEnabled&&aN.connectionProxyUrl){let a=aN.connectionProxyUrl;try{let b=new URL(aN.connectionProxyUrl),c=b.hostname||"",d=b.port?`:${b.port}`:"",e=b.protocol||"http:";a=`${e}//${c}${d}`}catch{}let b=c?.providerSpecificData?.connectionProxyPoolId||"none",e=c?.connectionName||c?.connectionId||"unknown";d?.info?.("PROXY",`${ad.toUpperCase()} | ${ae} | conn=${e} | pool=${b} | url=${a}`)}if(aN.connectionProxyEnabled&&aN.connectionNoProxy){let a=c?.connectionName||c?.connectionId||"unknown";d?.debug?.("PROXY",`${ad.toUpperCase()} | ${ae} | conn=${a} | no_proxy=${aN.connectionNoProxy}`)}let aO,aP,aQ,aR,aS=0;try{let b=await aK.execute({model:ae,body:ab,stream:ar,credentials:c,signal:aM.signal,log:d,proxyOptions:aN});if(aO=b.response,aP=b.url,aQ=b.headers,aR=b.transformedBody,aS=b.retryCount||0,ax.logTargetRequest(aP,aQ,aR),_&&!ar&&aO?.ok&&(0,o.TZ)(a,!1,ad,ae))try{let b=aO.clone?aO.clone():aO;(0,o.ww)(ad,ae,a,b)}catch{}}catch(c){if((0,t.uw)(ae,ad,N,!1,!0),(0,t.E5)({model:ae,provider:ad,connectionId:N,status:`FAILED ${"AbortError"===c.name?499:r.gx.BAD_GATEWAY}`}).catch(()=>{}),(0,t.ox)((0,v.$R)({provider:ad,model:ae,connectionId:N,latency:{ttft:0,total:Date.now()-af},tokens:{prompt_tokens:0,completion_tokens:0},request:(0,v.Fo)(a,ar),providerRequest:ab||null,response:{error:c.message||String(c),status:"AbortError"===c.name?499:502,thinking:null},status:"error"})).catch(()=>{}),"AbortError"===c.name)return aM.handleError(c),(0,q.A1)(499,"Request aborted");let b=(0,q.lR)(c,ad,ae,r.gx.BAD_GATEWAY);return console.log(`${i.lm.red}[ERROR] ${b}${i.lm.reset}`),(0,q.A1)(r.gx.BAD_GATEWAY,b)}if(!aK.noAuth&&(aO.status===r.gx.UNAUTHORIZED||aO.status===r.gx.FORBIDDEN))try{let a=await (0,k.qZ)(()=>aK.refreshCredentials(c,d),3,d);if(a?.accessToken||a?.copilotToken){if(d?.info?.("TOKEN",`${ad.toUpperCase()} | refreshed`),Object.assign(c,a),I)try{await I(a)}catch(a){d?.warn?.("TOKEN",`onCredentialsRefreshed failed: ${a.message}`)}try{let a=await aK.execute({model:ae,body:ab,stream:ar,credentials:c,signal:aM.signal,log:d,proxyOptions:aN});a.response.ok&&(aO=a.response,aP=a.url)}catch{d?.warn?.("TOKEN",`${ad.toUpperCase()} | retry after refresh failed`)}}else d?.warn?.("TOKEN",`${ad.toUpperCase()} | refresh failed`)}catch(a){d?.warn?.("TOKEN",`${ad.toUpperCase()} | refresh threw: ${a.message}`)}if(!aO.ok){(0,t.uw)(ae,ad,N,!1,!0);let{statusCode:b,message:c,resetsAtMs:d}=await (0,q.zL)(aO,aK);(0,t.E5)({model:ae,provider:ad,connectionId:N,status:`FAILED ${b}`}).catch(()=>{}),(0,t.ox)((0,v.$R)({provider:ad,model:ae,connectionId:N,latency:{ttft:0,total:Date.now()-af},tokens:{prompt_tokens:0,completion_tokens:0},request:(0,v.Fo)(a,ar),providerRequest:aR||ab||null,response:{error:c,status:b,thinking:null},status:"error"})).catch(()=>{});let e=(0,q.lR)(Error(c),ad,ae,b);return console.log(`${i.lm.red}[ERROR] ${e}${i.lm.reset}`),ax.logError(Error(c),aR||ab),(0,q.A1)(b,e,d)}let aT={provider:ad,model:ae,body:a,stream:ar,translatedBody:ab,finalBody:aR,requestStartTime:af,connectionId:N,apiKey:P,clientRawRequest:M,onRequestSuccess:K,savedTokens:aI+aJ,retryCount:aS},aU=a=>(0,t.E5)({model:ae,provider:ad,connectionId:N,...a}).catch(()=>{}),aV=()=>(0,t.uw)(ae,ad,N,!1);if(!ap&&aq){let a=await (0,w.I)({...aT,providerResponse:aO,sourceFormat:ag,trackDone:aV,appendLog:aU});if(a)return aM.handleComplete(),a}if(!ar){let a=await (0,x.N)({...aT,providerResponse:aO,sourceFormat:ag,targetFormat:al,reqLogger:ax,toolNameMap:ac,trackDone:aV,appendLog:aU});return aM.handleComplete(),a}let{onStreamComplete:aW,streamDetailId:aX}=(0,y.$)({...aT});return(0,y.M)({...aT,providerResponse:aO,sourceFormat:ag,targetFormat:al,userAgent:O,reqLogger:ax,toolNameMap:ac,streamController:aM,onStreamComplete:aW,streamDetailId:aX})}u=(I.then?(await I)():I)[0],d()}catch(a){d(a)}})}};
58
+ `),h.replace(/\n+$/,"")}y.filterName="search-list";let z=/^Result of search in '[^']*' \(total (\d+) files?\):/,A=/^diff --git /m,B=/^@@ /m,C=/^On branch |^nothing to commit|^Changes (not |to be )|^Untracked files:/m,D=/^[ MADRCU?!][ MADRCU?!] \S/m,E=/^(npm (warn|error|ERR!)|yarn (warn|error)|\s*Compiling\s+\S+|\s*Downloading\s+\S+|added \d+ package|\[ERROR\]|BUILD (SUCCESS|FAILED)|\s*Finished\s+|Successfully (installed|built)|ERROR:)/im,F=/[├└]──|│ /,G=/^[-dlbcps][rwx-]{9}/m,H=/^total \d+$/m;function I(a){let b=a.indexOf(":");if(-1===b)return!1;let c=a.indexOf(":",b+1);if(-1===c)return!1;let d=a.slice(b+1,c);return/^\d+$/.test(d)}function J(a){let b=a.trim();return!(0===b.length||b.includes(":"))&&(b.startsWith(".")||b.startsWith("/")||b.includes("/"))}function K(a,b){if(!b||!a)return null;if(a.conversationState){var c=a;let b={bytesBefore:0,bytesAfter:0,hits:[]};try{let a=c.conversationState,d=[...Array.isArray(a?.history)?a.history:[]];for(let c of(a?.currentMessage&&d.push(a.currentMessage),d)){let a=c?.userInputMessage?.userInputMessageContext?.toolResults;if(Array.isArray(a)){for(let c of a)if("error"!==c.status&&Array.isArray(c.content))for(let a of c.content)a&&"string"==typeof a.text&&(a.text=L(a.text,b,"kiro-tool-result"))}}}catch(a){return console.warn("[RTK] compressKiroFormat error:",a.message),null}return b}let d=Array.isArray(a.messages)?a.messages:Array.isArray(a.input)?a.input:null;if(!d)return null;let e={bytesBefore:0,bytesAfter:0,hits:[]};try{for(let a=0;a<d.length;a++){let b=d[a];if(b){if("function_call_output"===b.type){if("string"==typeof b.output)b.output=L(b.output,e,"openai-responses-string");else if(Array.isArray(b.output))for(let a=0;a<b.output.length;a++){let c=b.output[a];c&&"input_text"===c.type&&"string"==typeof c.text&&(c.text=L(c.text,e,"openai-responses-array"))}continue}if("tool"===b.role&&"string"==typeof b.content){b.content=L(b.content,e,"openai-tool");continue}if(Array.isArray(b.content)){if("tool"===b.role){for(let a=0;a<b.content.length;a++){let c=b.content[a];c&&"text"===c.type&&"string"==typeof c.text&&(c.text=L(c.text,e,"openai-tool-array"))}continue}for(let a=0;a<b.content.length;a++){let c=b.content[a];if(c&&"tool_result"===c.type&&!0!==c.is_error){if("string"==typeof c.content)c.content=L(c.content,e,"claude-string");else if(Array.isArray(c.content))for(let a=0;a<c.content.length;a++){let b=c.content[a];b&&"text"===b.type&&"string"==typeof b.text&&(b.text=L(b.text,e,"claude-array"))}}}}}}}catch(a){return console.warn("[RTK] compressMessages error:",a.message),null}return e}function L(a,b,c){let d=a.length;if(b.bytesBefore+=d,d<500||d>0xa00000)return b.bytesAfter+=d,a;let g=function(a){var b,c;let d,g,h=a.length>1024?a.slice(0,1024):a;if(A.test(h)||B.test(h))return e;if(C.test(h))return f;if(E.test(h))return o;if(!((d=h.split("\n").filter(a=>a.trim())).length<3)&&d.filter(a=>D.test(a)).length/d.length>=.6)return f;if(function(a){let b=0;for(let c of a.split("\n")){let a=c.trimStart();if(!/^[*|\/\\ ]+$/.test(a)&&(/^commit [0-9a-f]{4,40}/.test(a)||/^(Author|Date|Merge):\s/.test(a)||/^[0-9a-f]{7,40} /.test(a))){b++;continue}}return b}(h)>=2)return m;let i=h.split("\n"),j=i.filter(a=>a.trim().length>0);return j.slice(0,5).some(I)?p:j.length>=3&&j.every(J)?q:F.test(h)?u:H.test(h)||(b=h,g=new RegExp((c=G).source,c.flags.includes("g")?c.flags:c.flags+"g"),(b.match(g)||[]).length>=3)?t:z.test(h)?y:i.length>=250&&function(a){let b=0,c=0;for(let d of a.slice(0,100))0!==d.length&&(c++,x.test(d)&&b++);return!(c<5)&&b/c>=.7}(i)?w:j.length>=5?r:a.split("\n").length>=250?v:null}(a);if(!g)return b.bytesAfter+=d,a;let h=function(a,b){if("function"!=typeof a)return b;try{let c=a(b);if("string"!=typeof c)return b;return c}catch(d){let c=a.filterName||a.name||"anonymous";return console.warn(`[rtk] warning: filter '${c}' panicked — passing through raw output: ${d?.message||d}`),b}}(g,a);return!h||0===h.length||h.length>=d?(b.bytesAfter+=d,a):(b.bytesAfter+=h.length,b.hits.push({shape:c,filter:g.filterName||g.name,saved:d-h.length}),h)}function M(a){if(!a||!a.hits||0===a.hits.length)return null;let b=a.bytesBefore-a.bytesAfter,c=a.bytesBefore>0?(b/a.bytesBefore*100).toFixed(1):"0",d=Array.from(new Set(a.hits.map(a=>a.filter))).join(",");return`[RTK] saved ${b}B / ${a.bytesBefore}B (${c}%) via [${d}] hits=${a.hits.length}`}},76083:(a,b,c)=>{c.d(b,{C:()=>h});var d=c(14170),e=c(71301);let f=new Set([d.h.GEMINI,d.h.GEMINI_CLI,d.h.VERTEX,d.h.ANTIGRAVITY,d.h.OLLAMA,d.h.KIRO]);function g(a){return"string"==typeof a&&(a.startsWith("http://")||a.startsWith("https://"))}async function h(a,b,c,i={}){if(!a||!f.has(c))return 0;let j=function(a,b){let c=[],e=a=>{for(let b of a||[])if(Array.isArray(b.content)){for(let a of b.content)if(a?.type==="image_url"){let b="string"==typeof a.image_url?a.image_url:a.image_url?.url;g(b)&&c.push({get:()=>b,set:b=>{"string"==typeof a.image_url?a.image_url=b:a.image_url.url=b}})}}},f=a=>{for(let b of a||[])for(let a of b.parts||[]){let b=a?.fileData?.fileUri;g(b)&&c.push({get:()=>b,part:a})}};switch(b){case d.h.OPENAI:case d.h.OLLAMA:case d.h.KIRO:case d.h.CURSOR:case d.h.COMMANDCODE:e(a.messages);break;case d.h.CLAUDE:for(let b of a.messages||[])if(Array.isArray(b.content))for(let a of b.content)a?.type==="image"&&a.source?.type==="url"&&g(a.source.url)&&c.push({get:()=>a.source.url,claudeBlock:a});break;case d.h.GEMINI:case d.h.GEMINI_CLI:case d.h.VERTEX:f(a.contents);break;case d.h.ANTIGRAVITY:f(a?.request?.contents);break;default:e(a.messages)}return c}(a,b);if(!j.length)return 0;let k=0;for(let a of j){let b=a.get();if((0,e.W$)(b))continue;let c=await (0,e.ni)(b,i);c&&(a.set?a.set(c.url):a.part?(delete a.part.fileData,a.part.inlineData={mimeType:c.mimeType,data:c.url.split(",")[1]}):a.claudeBlock&&(a.claudeBlock.source={type:"base64",media_type:c.mimeType,data:c.url.split(",")[1]}),k++)}return k}},81626:(a,b,c)=>{function d(a,b){let c;if(!a.trim())return;let d=a.match(/^event:\s*(.+)$/m),e=a.match(/^data:\s*(.+)$/m);if(!d||!e)return;let f=d[1].trim(),g=e[1].trim();if("[DONE]"!==g){try{c=JSON.parse(g)}catch{return}"response.created"===f?(b.responseId=c.response?.id||b.responseId,b.created=c.response?.created_at||b.created):"response.output_item.done"===f?b.items.set(c.output_index??0,c.item):"response.completed"===f||"response.done"===f?(b.status="completed",c.response?.usage&&(b.usage.input_tokens=c.response.usage.input_tokens||0,b.usage.output_tokens=c.response.usage.output_tokens||0,b.usage.total_tokens=c.response.usage.total_tokens||0)):"response.failed"===f&&(b.status="failed")}}c.d(b,{I:()=>p,F:()=>o});let e={input_tokens:0,output_tokens:0,total_tokens:0};async function f(a){if(!a||"function"!=typeof a.getReader)return{id:`resp_${Date.now()}`,object:"response",created_at:Math.floor(Date.now()/1e3),status:"failed",output:[],usage:{...e}};let b=a.getReader(),c=new TextDecoder,f="",g={responseId:"",created:Math.floor(Date.now()/1e3),status:"in_progress",usage:{...e},items:new Map};try{for(;;){let{done:a,value:e}=await b.read();if(a)break;let h=(f+=c.decode(e,{stream:!0})).split("\n\n");for(let a of(f=h.pop()||"",h))d(a,g)}f.trim()&&d(f,g)}finally{b.releaseLock()}let h=[],i=g.items.size>0?Math.max(...g.items.keys()):-1;for(let a=0;a<=i;a++)h.push(g.items.get(a)||{type:"message",content:[],role:"assistant"});return{id:g.responseId||`resp_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,object:"response",created_at:g.created,status:g.status||"completed",output:h,usage:g.usage}}var g=c(43659),h=c(41004),i=c(14170),j=c(35024),k=c(86171),l=c(47370);let m=a=>j.xq[a]?.format===i.h.OPENAI_RESPONSES;function n(a){if(!a?.content||!Array.isArray(a.content))return"";let b=a.content.find(a=>"output_text"===a.type);if("string"==typeof b?.text)return b.text;let c=a.content.find(a=>"string"==typeof a.text);return"string"==typeof c?.text?c.text:""}function o(a,b){let c=[];for(let b of String(a||"").split("\n")){let a=b.trim();if(!a.startsWith("data:"))continue;let d=a.slice(5).trim();if(d&&"[DONE]"!==d)try{c.push(JSON.parse(d))}catch{}}if(0===c.length)return null;let d=c[0],e=[],f=[],g=new Map,h="stop",i=null;for(let a of c){let b=a?.choices?.[0],c=b?.delta||{};if("string"==typeof c.content&&c.content.length>0&&e.push(c.content),"string"==typeof c.reasoning_content&&c.reasoning_content.length>0&&f.push(c.reasoning_content),b?.finish_reason&&(h=b.finish_reason),a?.usage&&"object"==typeof a.usage&&(i=a.usage),Array.isArray(c.tool_calls))for(let a of c.tool_calls){let b=a.index??0;g.has(b)||g.set(b,{id:a.id||"",type:"function",function:{name:"",arguments:""}});let c=g.get(b);a.id&&(c.id=a.id),a.function?.name&&(c.function.name+=a.function.name),a.function?.arguments&&(c.function.arguments+=a.function.arguments)}}let j={role:"assistant",content:e.join("")||(g.size>0?null:"")};f.length>0&&(j.reasoning_content=f.join("")),g.size>0&&(j.tool_calls=[...g.entries()].sort((a,b)=>a[0]-b[0]).map(([,a])=>a));let k={id:d.id||`chatcmpl-${Date.now()}`,object:"chat.completion",created:d.created||Math.floor(Date.now()/1e3),model:d.model||b||"unknown",choices:[{index:0,message:j,finish_reason:h}]};return i&&(k.usage=i),k}async function p({providerResponse:a,sourceFormat:b,provider:c,model:d,body:e,stream:j,translatedBody:q,finalBody:r,requestStartTime:s,connectionId:t,apiKey:u,clientRawRequest:v,onRequestSuccess:w,trackDone:x,appendLog:y,savedTokens:z,retryCount:A}){let B=a.headers.get("content-type")||"";if(!(B.includes("text/event-stream")||""===B&&m(c)))return null;x();let C={provider:c,model:d,connectionId:t,request:(0,k.Fo)(e,j),providerRequest:r||q||null};if(m(c)||b===i.h.OPENAI_RESPONSES)try{let e,g=await f(a.body);w&&await w();let h=g.usage||{},j=Date.now()-s;y({tokens:h,status:"200 OK"}),(0,k.qr)({provider:c,model:d,tokens:h,connectionId:t,apiKey:u,endpoint:v?.endpoint,latency:{ttft:j,total:j},savedTokens:z,retryCount:A});let{msgItem:m,textContent:o}=function(a){if(!Array.isArray(a))return{msgItem:null,textContent:null};let b=a.filter(a=>a?.type==="message");if(0===b.length)return{msgItem:null,textContent:null};for(let a=b.length-1;a>=0;a--){let c=n(b[a]);if(c.length>0)return{msgItem:b[a],textContent:c}}let c=b[b.length-1];return{msgItem:c,textContent:n(c)}}(g.output);if((0,l.ox)((0,k.$R)({...C,latency:{ttft:j,total:j},tokens:{prompt_tokens:h.input_tokens||0,completion_tokens:h.output_tokens||0},response:{content:o,thinking:null,finish_reason:g.status||"unknown"},status:"success"},{endpoint:v?.endpoint||null})).catch(()=>{}),b===i.h.OPENAI_RESPONSES)return{success:!0,response:new Response(JSON.stringify(g),{headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})};let p=h.input_tokens||0,q=h.output_tokens||0,r=(g.output||[]).filter(a=>"function_call"===a.type).map((a,b)=>({id:a.call_id||`call_${a.name}_${Date.now()}_${b}`,type:"function",function:{name:a.name,arguments:"string"==typeof a.arguments?a.arguments:JSON.stringify(a.arguments||{})}})),x=r.length>0;if(b===i.h.ANTIGRAVITY||b===i.h.GEMINI||b===i.h.GEMINI_CLI)e={response:{candidates:[{content:{role:"model",parts:[{text:o||""}]},finishReason:"STOP",index:0}],usageMetadata:{promptTokenCount:p,candidatesTokenCount:q,totalTokenCount:p+q},modelVersion:d,responseId:g.id||`resp_${Date.now()}`}};else{let a={role:"assistant",content:o||(x?null:"")};x&&(a.tool_calls=r);let b="completed"===g.status||"done"===g.status,c=x?"tool_calls":b?"stop":g.status||"stop";e={id:g.id||`chatcmpl-${Date.now()}`,object:"chat.completion",created:g.created_at||Math.floor(Date.now()/1e3),model:g.model||d,choices:[{index:0,message:a,finish_reason:c}],usage:{prompt_tokens:p,completion_tokens:q,total_tokens:p+q}}}return{success:!0,response:new Response(JSON.stringify(e),{headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})}}catch(a){return console.error("[ChatCore] Responses API SSE→JSON failed:",a),(0,g.A1)(h.gx.BAD_GATEWAY,"Failed to convert streaming response to JSON")}try{let b=await a.text(),e=o(b,d);if(!e)return(0,g.A1)(h.gx.BAD_GATEWAY,"Invalid SSE response for non-streaming request");w&&await w();let f=e.usage||{},i=Date.now()-s;if(y({tokens:f,status:"200 OK"}),(0,k.qr)({provider:c,model:d,tokens:f,connectionId:t,apiKey:u,endpoint:v?.endpoint,latency:{ttft:i,total:i},retryCount:A}),(0,l.ox)((0,k.$R)({...C,latency:{ttft:i,total:i},tokens:f,response:{content:e.choices?.[0]?.message?.content||null,thinking:e.choices?.[0]?.message?.reasoning_content||null,finish_reason:e.choices?.[0]?.finish_reason||"unknown"},status:"success"},{endpoint:v?.endpoint||null})).catch(()=>{}),e?.choices)for(let a of e.choices)a?.message?.reasoning_content&&a.message.content&&delete a.message.reasoning_content;return{success:!0,response:new Response(JSON.stringify(e),{headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})}}catch(a){return console.error("[ChatCore] Chat Completions SSE→JSON failed:",a),(0,g.A1)(h.gx.BAD_GATEWAY,"Failed to convert streaming response to JSON")}}},86171:(a,b,c)=>{c.d(b,{$R:()=>j,Fo:()=>h,MK:()=>i,qr:()=>k});var d=c(47370),e=c(71857),f=c(73483);let g=["temperature","top_p","top_k","max_tokens","max_completion_tokens","thinking","reasoning","enable_thinking","presence_penalty","frequency_penalty","seed","stop","tools","tool_choice","response_format","prediction","store","metadata","n","logprobs","top_logprobs","logit_bias","user","parallel_tool_calls"];function h(a,b){let c={messages:a.messages||[],model:a.model,stream:b};for(let b of g)void 0!==a[b]&&(c[b]=a[b]);return c}function i(a){return a&&"object"==typeof a?a.usage?.input_tokens!==void 0?{prompt_tokens:a.usage.input_tokens||0,completion_tokens:a.usage.output_tokens||0,cache_read_input_tokens:a.usage.cache_read_input_tokens,cache_creation_input_tokens:a.usage.cache_creation_input_tokens}:a.usage?.prompt_tokens!==void 0?{prompt_tokens:a.usage.prompt_tokens||0,completion_tokens:a.usage.completion_tokens||0,cached_tokens:a.usage.prompt_tokens_details?.cached_tokens,reasoning_tokens:a.usage.completion_tokens_details?.reasoning_tokens}:a.usageMetadata?{prompt_tokens:a.usageMetadata.promptTokenCount||0,completion_tokens:a.usageMetadata.candidatesTokenCount||0,cached_tokens:a.usageMetadata.cachedContentTokenCount||0,reasoning_tokens:a.usageMetadata.thoughtsTokenCount||0}:null:null}function j(a,b={}){return{provider:a.provider||"unknown",model:a.model||"unknown",connectionId:a.connectionId||void 0,timestamp:new Date().toISOString(),latency:a.latency||{ttft:0,total:0},tokens:a.tokens||{prompt_tokens:0,completion_tokens:0},request:a.request,providerRequest:a.providerRequest||null,providerResponse:a.providerResponse||null,response:a.response||{},status:a.status||"success",...b}}function k({provider:a,model:b,tokens:c,connectionId:g,apiKey:h,endpoint:i,latency:j,savedTokens:l,retryCount:m,label:n="USAGE"}){if(!c||"object"!=typeof c)return;let o=c.input_tokens??c.prompt_tokens??0,p=c.output_tokens??c.completion_tokens??0;if(0===o&&0===p)return;let q=new Date().toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),r=g?` | account=${g.slice(0,8)}...`:"";console.log(`${e.lm.green}[${q}] 📊 [${n}] ${a.toUpperCase()} | in=${o} | out=${p}${r}${e.lm.reset}`);let s=(0,f._6)(c)||{prompt_tokens:c.prompt_tokens??c.input_tokens??0,completion_tokens:c.completion_tokens??c.output_tokens??0};(0,d.sZ)({provider:a||"unknown",model:b||"unknown",tokens:s,timestamp:new Date().toISOString(),connectionId:g||void 0,apiKey:h||void 0,endpoint:i||null,latency:j||{ttft:0,total:0},savedTokens:l||0,meta:m?JSON.stringify({retryCount:m}):null}).catch(()=>{})}},89630:(a,b,c)=>{c.d(b,{IL:()=>m,QS:()=>l,TZ:()=>i,fQ:()=>j,ww:()=>k});let d=global._semanticCache??=new Map,e=global._semanticCacheStats??={hits:0,misses:0,nearHits:0,stored:0,evicted:0};function f(a){return new Set(String(a).toLowerCase().replace(/[^\w\s]/g," ").split(/\s+/).filter(a=>a.length>=2))}function g(a){if(!Array.isArray(a))return"";let b=[];for(let c of a)if("user"===c.role){if("string"==typeof c.content)b.push(c.content);else if(Array.isArray(c.content))for(let a of c.content)"text"===a.type&&a.text&&b.push(a.text)}return b.join("\n")}function h(a,b,c){let d=0x811c9dc5,e=`${a}::${b}::${c}`;for(let a=0;a<e.length;a++)d^=e.charCodeAt(a),d=Math.imul(d,0x1000193);return d>>>0}function i(a,b,c,d){if(b||!a?.messages||a.tools||a.tool_choice||a.functions||g(a.messages).length<10)return!1;for(let b of a.messages)if("system"===b.role&&"string"==typeof b.content&&/do not cache|no cache/i.test(b.content))return!1;return!0}function j(a,b,c,i=.85){let k=g(c.messages);if(!k)return e.misses++,null;let l=h(a,b,k),m=Date.now(),n=d.get(l);if(n&&n.expiresAt>m)return n.lastAccessed=m,e.hits++,{response:n.response,similarity:1,exact:!0};n&&d.delete(l);let o=f(k),p=null,q=0;for(let[c,f]of d){if(f.expiresAt<=m){d.delete(c),e.evicted++;continue}if(f.provider!==a||f.model!==b)continue;let g=function(a,b){if(0===a.size||0===b.size)return 0;let c=0;for(let d of a)b.has(d)&&c++;return c/(a.size+b.size-c)}(o,f.tokenSet);g>=i&&g>q&&(q=g,p=f)}return p?(p.lastAccessed=m,e.nearHits++,{response:p.response,similarity:q,exact:!1}):(e.misses++,null)}function k(a,b,c,i,j=18e5){let l=g(c.messages);if(!l)return;let m=h(a,b,l),n=Date.now();if(d.size>=200){let a=null,b=1/0;for(let[c,e]of d)e.lastAccessed<b&&(b=e.lastAccessed,a=c);a&&(d.delete(a),e.evicted++)}d.set(m,{provider:a,model:b,response:i,tokenSet:f(l),text:l,createdAt:n,lastAccessed:n,expiresAt:n+j}),e.stored++}function l(){let a=0,b=Date.now();for(let c of d.values())c.expiresAt<=b&&a++;return{size:d.size,active:d.size-a,expired:a,...e,hitRate:e.hits+e.nearHits+e.misses>0?Math.round((e.hits+e.nearHits)/(e.hits+e.nearHits+e.misses)*100):0}}function m(){let a=d.size;return d.clear(),e.hits=0,e.misses=0,e.nearHits=0,e.stored=0,e.evicted=0,a}},92500:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{w:()=>J});var e=c(57647),f=c(78833),g=c(14170),h=c(95189),i=c(71857),j=c(59657),k=c(8521),l=c(71336),m=c(45699),n=c(52136),o=c(89630),p=c(35024),q=c(43659),r=c(41004),s=c(27349),t=c(47370),u=c(55330),v=c(86171),w=c(81626),x=c(5016),y=c(20623),z=c(324),A=c(14724),B=c(60125),C=c(60475),D=c(72758),E=c(70190),F=c(66306),G=c(5263),H=c(76083),I=a([u]);u=(I.then?(await I)():I)[0];let K=new Set;async function J({body:a,modelInfo:b,credentials:d,log:I,onCredentialsRefreshed:L,onRequestSuccess:M,onDisconnect:N,clientRawRequest:O,connectionId:P,userAgent:Q,apiKey:R,ccFilterNaming:S,rtkEnabled:T,headroomEnabled:U,headroomUrl:V,headroomCompressUserMessages:W,cavemanEnabled:X,cavemanLevel:Y,ponytailEnabled:Z,ponytailLevel:$,sourceFormatOverride:_,providerThinking:aa,semanticCacheEnabled:ab,semanticCacheThreshold:ac}){let ad,ae,{provider:af,model:ag}=b,ah=Date.now(),ai=_||(0,e.Tz)(a),aj=(0,s.c)(a,ag,Q,S);if(aj)return aj;if(ab&&(0,o.TZ)(a,!1,af,ag)){let b=(0,o.fQ)(af,ag,a,"number"==typeof ac?ac:.85);if(b)return I?.info?.("CACHE",`semantic cache ${b.exact?"HIT":"near-hit"} (${(100*b.similarity).toFixed(0)}% similarity) — returning cached response`),{response:b.response.clone?b.response.clone():b.response,url:"(cache)",headers:{},transformedBody:a,fromCache:!0,cacheSimilarity:b.similarity}}let ak=m.Xg[af]||af,al=(0,m.ux)(ak,ag),am=(0,e.oF)(af,ai),an=al||am?.format||(0,e.jJ)(af);am&&d&&(d.runtimeTransport=am);let ao=(0,m.cY)(ak,ag),{cleanModel:ap}=(0,n.nF)(ag),aq=(0,m.kt)(ak,ap);if(aa?.mode&&"auto"!==aa.mode){let b=aa.mode;"on"!==b||a.thinking?"off"!==b||a.thinking?a.reasoning_effort||(a={...a,reasoning_effort:b}):a={...a,thinking:{type:"disabled"}}:(console.log("Injecting provider-level thinking config override: on"),a={...a,thinking:{type:"enabled",budget_tokens:1e4}})}let ar=!0===a.stream||ai===g.h.ANTIGRAVITY||ai===g.h.GEMINI||ai===g.h.GEMINI_CLI,as=p.xq[af]?.forceStream===!0,at=!!as||!1!==a.stream,au=(0,m.OA)(ak,ag);("imageGen"===au||/image|imagen|image-generation/i.test(ag))&&("antigravity"===af||"gemini-cli"===af)&&(at=!1);let av=(0,z.J)(O?.headers||{},a);"deepseek-tui"===av&&!0!==a.stream&&(at=!1);let aw=O?.headers?.accept||"",ax=aw.includes("application/json"),ay=aw.includes("text/event-stream");!ax||ay||!0===a.stream||as||(at=!1);let az=await (0,l.q7)(ai,an,ag);O&&az.logClientRawRequest(O.endpoint,O.body,O.headers),az.logRawRequest(a),I?.debug?.("FORMAT",`${ai} → ${an} | stream=${at}`);let aA=(0,z.J)(O?.headers||{},a),aB=(0,z.Q)(aA,af);if(d&&(d.rawHeaders=O?.headers||{}),!aB){let b=(0,F.nl)(af,ag);(0,G.X)(a,ai,b)&&I?.debug?.("MODALITY",`stripped unsupported media for ${af}/${ag}`);try{let b=await (0,H.C)(a,ai,an,{signal:void 0});b>0&&I?.debug?.("MODALITY",`prefetched ${b} remote image(s) for ${an}`)}catch(a){I?.warn?.("MODALITY",`image prefetch failed: ${a.message}`)}}if(aB)I?.debug?.("PASSTHROUGH",`${aA} → ${af} | native lossless`),ad={...a,model:aq},"claude"===aA&&(0,h.ui)(ad,aq);else{if(!(ad=(0,f.GH)(ai,an,ag,a,at,d,af,az,ao,P,aA)))return(0,t.uw)(ag,af,P,!1,!0),(0,q.A1)(r.gx.BAD_REQUEST,`Failed to translate request for ${ai} → ${an}`);ae=ad._toolNameMap,delete ad._toolNameMap,ad.model=aq}if("claude"===aA&&Array.isArray(ad.tools)){let{tools:a,stripped:b}=(0,A.F)(ad.tools);b.length>0&&(ad.tools=a,I?.debug?.("TOOLDEDUP",`stripped ${b.length}: ${b.slice(0,3).join(", ")}${b.length>3?"...":""}`))}let aC=aB?ai:an;"tts"===(0,m.OA)(ak,ag)&&ad.messages&&(ad.messages=ad.messages.filter(a=>"tool"!==a.role),delete ad.tools);let aD=(0,D.B)(ad,T),aE=(0,D.f)(aD);aE&&console.log(aE);let aF={},aG=await (0,E.SI)(ad,{enabled:U,url:V,model:aq,format:aC,compressUserMessages:W,diagnostics:aF}),aH=(0,E.Nv)(aG),aI=(0,E.O2)(aF);aH?(I?.info?.("HEADROOM",`${aH}${aI?` | ${aI}`:""}`),(0,E.cB)(aG,aF)&&I?.warn?.("HEADROOM",`reported token delta, but outbound JSON shrank <5%; provider may bill near-original payload | ${aI}`)):U&&I?.warn?.("HEADROOM",`skipped: ${aF.reason||"compression unavailable"}${aF.endpoint?` (${aF.endpoint})`:""}`),X&&Y&&((0,B.p)(ad,aC,Y),I?.debug?.("CAVEMAN",`${Y} | ${aC}`)),Z&&$&&((0,C.U)(ad,aC,$),I?.debug?.("PONYTAIL",`${$} | ${aC}`));let aJ=aD?(aD.bytesBefore||0)-(aD.bytesAfter||0):0,aK=Math.round(aJ/4),aL=aG?.tokens_saved||0,aM=(0,u.SB)(af);(0,t.uw)(ag,af,P,!0),(0,t.E5)({model:ag,provider:af,connectionId:P,status:"PENDING"}).catch(()=>{});let aN=ad.messages?.length||ad.input?.length||ad.contents?.length||ad.request?.contents?.length||0;I?.debug?.("REQUEST",`${af.toUpperCase()} | ${ag} | ${aN} msgs`);let aO=(0,j.jd)({onDisconnect:a=>{(0,t.uw)(ag,af,P,!1),N&&N(a)},onError:()=>(0,t.uw)(ag,af,P,!1),log:I,provider:af,model:ag}),aP={connectionProxyEnabled:d?.providerSpecificData?.connectionProxyEnabled===!0,connectionProxyUrl:d?.providerSpecificData?.connectionProxyUrl||"",connectionNoProxy:d?.providerSpecificData?.connectionNoProxy||"",vercelRelayUrl:d?.providerSpecificData?.vercelRelayUrl||""};if(aP.vercelRelayUrl){let a=d?.connectionName||d?.connectionId||"unknown",b=d?.providerSpecificData?.connectionProxyPoolId||"none";I?.info?.("PROXY",`${af.toUpperCase()} | ${ag} | conn=${a} | pool=${b} | vercel-relay=${aP.vercelRelayUrl}`)}else if(aP.connectionProxyEnabled&&aP.connectionProxyUrl){let a=aP.connectionProxyUrl;try{let b=new URL(aP.connectionProxyUrl),c=b.hostname||"",d=b.port?`:${b.port}`:"",e=b.protocol||"http:";a=`${e}//${c}${d}`}catch{}let b=d?.providerSpecificData?.connectionProxyPoolId||"none",c=d?.connectionName||d?.connectionId||"unknown";I?.info?.("PROXY",`${af.toUpperCase()} | ${ag} | conn=${c} | pool=${b} | url=${a}`)}if(aP.connectionProxyEnabled&&aP.connectionNoProxy){let a=d?.connectionName||d?.connectionId||"unknown";I?.debug?.("PROXY",`${af.toUpperCase()} | ${ag} | conn=${a} | no_proxy=${aP.connectionNoProxy}`)}let aQ,aR,aS,aT,aU=0;try{let b=await aM.execute({model:ag,body:ad,stream:at,credentials:d,signal:aO.signal,log:I,proxyOptions:aP});if(aQ=b.response,aR=b.url,aS=b.headers,aT=b.transformedBody,aU=b.retryCount||0,b.refreshedCookie&&d?.connectionId){let a=d.connectionId;if(!K.has(a)){K.add(a);try{let{updateProviderConnection:d}=await Promise.resolve().then(c.bind(c,89718));await d(a,{apiKey:b.refreshedCookie}),I?.debug?.("COOKIE-REFRESH",`${af} | auto-refreshed session cookie for ${a.slice(0,8)}`)}catch{}finally{K.delete(a)}}}if(az.logTargetRequest(aR,aS,aT),ab&&!at&&aQ?.ok&&(0,o.TZ)(a,!1,af,ag))try{let b=aQ.clone?aQ.clone():aQ;(0,o.ww)(af,ag,a,b)}catch{}}catch(c){if((0,t.uw)(ag,af,P,!1,!0),(0,t.E5)({model:ag,provider:af,connectionId:P,status:`FAILED ${"AbortError"===c.name?499:r.gx.BAD_GATEWAY}`}).catch(()=>{}),(0,t.ox)((0,v.$R)({provider:af,model:ag,connectionId:P,latency:{ttft:0,total:Date.now()-ah},tokens:{prompt_tokens:0,completion_tokens:0},request:(0,v.Fo)(a,at),providerRequest:ad||null,response:{error:c.message||String(c),status:"AbortError"===c.name?499:502,thinking:null},status:"error"})).catch(()=>{}),"AbortError"===c.name)return aO.handleError(c),(0,q.A1)(499,"Request aborted");let b=(0,q.lR)(c,af,ag,r.gx.BAD_GATEWAY);return console.log(`${i.lm.red}[ERROR] ${b}${i.lm.reset}`),(0,q.A1)(r.gx.BAD_GATEWAY,b)}if(!aM.noAuth&&(aQ.status===r.gx.UNAUTHORIZED||aQ.status===r.gx.FORBIDDEN))try{let a=await (0,k.qZ)(()=>aM.refreshCredentials(d,I),3,I);if(a?.accessToken||a?.copilotToken){if(I?.info?.("TOKEN",`${af.toUpperCase()} | refreshed`),Object.assign(d,a),L)try{await L(a)}catch(a){I?.warn?.("TOKEN",`onCredentialsRefreshed failed: ${a.message}`)}try{let a=await aM.execute({model:ag,body:ad,stream:at,credentials:d,signal:aO.signal,log:I,proxyOptions:aP});a.response.ok&&(aQ=a.response,aR=a.url)}catch{I?.warn?.("TOKEN",`${af.toUpperCase()} | retry after refresh failed`)}}else I?.warn?.("TOKEN",`${af.toUpperCase()} | refresh failed`)}catch(a){I?.warn?.("TOKEN",`${af.toUpperCase()} | refresh threw: ${a.message}`)}if(!aQ.ok){(0,t.uw)(ag,af,P,!1,!0);let{statusCode:b,message:c,resetsAtMs:d}=await (0,q.zL)(aQ,aM);(0,t.E5)({model:ag,provider:af,connectionId:P,status:`FAILED ${b}`}).catch(()=>{}),(0,t.ox)((0,v.$R)({provider:af,model:ag,connectionId:P,latency:{ttft:0,total:Date.now()-ah},tokens:{prompt_tokens:0,completion_tokens:0},request:(0,v.Fo)(a,at),providerRequest:aT||ad||null,response:{error:c,status:b,thinking:null},status:"error"})).catch(()=>{});let e=(0,q.lR)(Error(c),af,ag,b);return console.log(`${i.lm.red}[ERROR] ${e}${i.lm.reset}`),az.logError(Error(c),aT||ad),(0,q.A1)(b,e,d)}let aV={provider:af,model:ag,body:a,stream:at,translatedBody:ad,finalBody:aT,requestStartTime:ah,connectionId:P,apiKey:R,clientRawRequest:O,onRequestSuccess:M,savedTokens:aK+aL,retryCount:aU},aW=a=>(0,t.E5)({model:ag,provider:af,connectionId:P,...a}).catch(()=>{}),aX=()=>(0,t.uw)(ag,af,P,!1);if(!ar&&as){let a=await (0,w.I)({...aV,providerResponse:aQ,sourceFormat:ai,trackDone:aX,appendLog:aW});if(a)return aO.handleComplete(),a}if(!at){let a=await (0,x.N)({...aV,providerResponse:aQ,sourceFormat:ai,targetFormat:an,reqLogger:az,toolNameMap:ae,trackDone:aX,appendLog:aW});return aO.handleComplete(),a}let{onStreamComplete:aY,streamDetailId:aZ}=(0,y.$)({...aV});return(0,y.M)({...aV,providerResponse:aQ,sourceFormat:ai,targetFormat:an,userAgent:Q,reqLogger:az,toolNameMap:ae,streamController:aO,onStreamComplete:aY,streamDetailId:aZ})}d()}catch(a){d(a)}})}};