@rsalmn/extremerouter 0.8.3 → 0.8.4

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 (911) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +12 -8
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/prerender-manifest.json +3 -3
  5. package/app/.next-cli-build/routes-manifest.json +24 -0
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page.js +2 -2
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +3 -3
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +3 -3
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page.js +2 -2
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page.js.nft.json +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +3 -3
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +3 -3
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page.js +2 -0
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page.js.nft.json +1 -0
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page_client-reference-manifest.js +1 -0
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page.js +2 -2
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page.js.nft.json +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +2 -2
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js +2 -2
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js.nft.json +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +3 -3
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +2 -2
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +2 -2
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  78. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page.js +2 -2
  79. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page_client-reference-manifest.js +1 -1
  81. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +2 -2
  82. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  84. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  85. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  87. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  88. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  90. package/app/.next-cli-build/server/app/_global-error/page.js +3 -3
  91. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  93. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  94. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  95. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  96. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  97. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  98. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  99. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  100. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  101. package/app/.next-cli-build/server/app/_not-found/page.js +2 -2
  102. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  104. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  105. package/app/.next-cli-build/server/app/_not-found.rsc +6 -6
  106. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +6 -6
  107. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  108. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +6 -6
  109. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  110. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  111. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  112. package/app/.next-cli-build/server/app/api/alerts/test/route.js +2 -2
  113. package/app/.next-cli-build/server/app/api/alerts/test/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  115. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  117. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  119. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  121. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  123. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  125. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  127. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/breaker/route.js +1 -1
  129. package/app/.next-cli-build/server/app/api/breaker/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/cache/route.js +1 -1
  131. package/app/.next-cli-build/server/app/api/cache/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +4 -4
  133. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  135. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  139. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  145. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  147. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  149. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +2 -2
  151. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +3 -3
  153. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  155. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +3 -3
  157. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  159. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  161. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  163. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  165. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  167. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  169. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/combos/validate-roles/route.js +1 -1
  171. package/app/.next-cli-build/server/app/api/combos/validate-roles/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/dashboard/stream/route.js +2 -2
  173. package/app/.next-cli-build/server/app/api/dashboard/stream/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  175. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  177. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +2 -2
  179. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/health/providers/route.js +1 -1
  181. package/app/.next-cli-build/server/app/api/health/providers/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/health/route.js +1 -1
  183. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/health/stream/route.js +2 -2
  185. package/app/.next-cli-build/server/app/api/health/stream/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/init/route.js +1 -1
  187. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  189. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  191. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  193. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +1 -1
  195. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +2 -2
  197. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  199. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  201. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  203. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  205. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  207. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  209. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  211. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  213. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  215. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  217. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  219. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/oauth/1min/import/route.js +1 -1
  221. package/app/.next-cli-build/server/app/api/oauth/1min/import/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  229. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  231. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  233. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  235. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/auto-import/route.js +1 -0
  237. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/auto-import/route.js.nft.json +1 -0
  238. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/auto-import/route_client-reference-manifest.js +1 -0
  239. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/import/route.js +1 -0
  240. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/import/route.js.nft.json +1 -0
  241. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/import/route_client-reference-manifest.js +1 -0
  242. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/quota/route.js +1 -0
  243. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/quota/route.js.nft.json +1 -0
  244. package/app/.next-cli-build/server/app/api/oauth/kimi-desktop/quota/route_client-reference-manifest.js +1 -0
  245. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  246. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  248. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  250. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  252. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  254. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  256. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  257. package/app/.next-cli-build/server/app/api/oauth/qwen/import/route.js +1 -1
  258. package/app/.next-cli-build/server/app/api/oauth/qwen/import/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/oauth/wp-studio/import/route.js +1 -1
  260. package/app/.next-cli-build/server/app/api/oauth/wp-studio/import/route.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js +2 -2
  262. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  263. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
  264. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  265. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  266. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  268. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  269. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  270. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  271. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  272. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/providers/[id]/agnes-profile/route.js +1 -1
  274. package/app/.next-cli-build/server/app/api/providers/[id]/agnes-profile/route.js.nft.json +1 -1
  275. package/app/.next-cli-build/server/app/api/providers/[id]/freebuff-profile/route.js +1 -1
  276. package/app/.next-cli-build/server/app/api/providers/[id]/freebuff-profile/route.js.nft.json +1 -1
  277. package/app/.next-cli-build/server/app/api/providers/[id]/health-timeline/route.js +1 -1
  278. package/app/.next-cli-build/server/app/api/providers/[id]/health-timeline/route.js.nft.json +1 -1
  279. package/app/.next-cli-build/server/app/api/providers/[id]/inxora-profile/route.js +1 -1
  280. package/app/.next-cli-build/server/app/api/providers/[id]/inxora-profile/route.js.nft.json +1 -1
  281. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  282. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  283. package/app/.next-cli-build/server/app/api/providers/[id]/onemin-api-profile/route.js +1 -1
  284. package/app/.next-cli-build/server/app/api/providers/[id]/onemin-api-profile/route.js.nft.json +1 -1
  285. package/app/.next-cli-build/server/app/api/providers/[id]/onemin-profile/route.js +1 -1
  286. package/app/.next-cli-build/server/app/api/providers/[id]/onemin-profile/route.js.nft.json +1 -1
  287. package/app/.next-cli-build/server/app/api/providers/[id]/qwencloud-profile/route.js +1 -1
  288. package/app/.next-cli-build/server/app/api/providers/[id]/qwencloud-profile/route.js.nft.json +1 -1
  289. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  290. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  291. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  292. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  293. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  294. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  295. package/app/.next-cli-build/server/app/api/providers/[id]/v0-profile/route.js +1 -1
  296. package/app/.next-cli-build/server/app/api/providers/[id]/v0-profile/route.js.nft.json +1 -1
  297. package/app/.next-cli-build/server/app/api/providers/[id]/vault-pool/route.js +1 -1
  298. package/app/.next-cli-build/server/app/api/providers/[id]/vault-pool/route.js.nft.json +1 -1
  299. package/app/.next-cli-build/server/app/api/providers/[id]/zenmux-plans/route.js +1 -1
  300. package/app/.next-cli-build/server/app/api/providers/[id]/zenmux-plans/route.js.nft.json +1 -1
  301. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  302. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  303. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  304. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  305. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  306. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  307. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  308. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  309. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  310. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  311. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  312. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  313. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  314. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  315. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  316. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  317. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  318. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  319. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
  320. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  321. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  322. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  323. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  324. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  325. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
  326. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  327. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -2
  328. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  329. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  330. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  331. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  332. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  333. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  334. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  335. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  336. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  337. package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  338. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  339. package/app/.next-cli-build/server/app/api/swarm/active/route.js +1 -1
  340. package/app/.next-cli-build/server/app/api/swarm/active/route.js.nft.json +1 -1
  341. package/app/.next-cli-build/server/app/api/swarm/stream/route.js +2 -2
  342. package/app/.next-cli-build/server/app/api/swarm/stream/route.js.nft.json +1 -1
  343. package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  344. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  345. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  346. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  347. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  348. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  349. package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  350. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  351. package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  352. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  353. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  354. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  355. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  356. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  357. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  358. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  359. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  360. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  361. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  362. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  363. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  364. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  365. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  366. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  367. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  368. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  369. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  370. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  371. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  372. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  373. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  374. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  375. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  376. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  377. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  378. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  379. package/app/.next-cli-build/server/app/api/usage/leaderboard/route.js +1 -1
  380. package/app/.next-cli-build/server/app/api/usage/leaderboard/route.js.nft.json +1 -1
  381. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  382. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  383. package/app/.next-cli-build/server/app/api/usage/meta/route.js +1 -1
  384. package/app/.next-cli-build/server/app/api/usage/meta/route.js.nft.json +1 -1
  385. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  386. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  387. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  388. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  389. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  390. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  391. package/app/.next-cli-build/server/app/api/usage/retry-stats/route.js +1 -1
  392. package/app/.next-cli-build/server/app/api/usage/retry-stats/route.js.nft.json +1 -1
  393. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  394. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  395. package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
  396. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  397. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  398. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  399. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  400. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  401. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  402. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  403. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  404. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  405. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  406. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  407. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  408. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  409. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  410. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  411. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  412. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  413. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  414. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  415. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  416. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  417. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  418. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  419. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  420. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  421. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  422. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  423. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  424. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  425. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  426. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  427. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  428. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  429. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  430. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  431. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  432. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  433. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  434. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  435. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  436. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  437. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  438. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  439. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  440. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  441. package/app/.next-cli-build/server/app/callback/page.js +2 -2
  442. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  443. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  444. package/app/.next-cli-build/server/app/callback.html +1 -1
  445. package/app/.next-cli-build/server/app/callback.rsc +6 -6
  446. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +6 -6
  447. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  448. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +6 -6
  449. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  450. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  451. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  452. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +2 -2
  453. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  454. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  455. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  456. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +7 -7
  457. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +7 -7
  458. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  459. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +6 -6
  460. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  461. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
  462. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  463. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  464. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  465. package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
  466. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  467. package/app/.next-cli-build/server/app/index.html +1 -1
  468. package/app/.next-cli-build/server/app/index.rsc +6 -6
  469. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  470. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +6 -6
  471. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  472. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +6 -6
  473. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  474. package/app/.next-cli-build/server/app/landing/page.js +2 -2
  475. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  476. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  477. package/app/.next-cli-build/server/app/landing.html +1 -1
  478. package/app/.next-cli-build/server/app/landing.rsc +6 -6
  479. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +6 -6
  480. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  481. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +6 -6
  482. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  483. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  484. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  485. package/app/.next-cli-build/server/app/login/page.js +2 -2
  486. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  487. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  488. package/app/.next-cli-build/server/app/login.html +1 -1
  489. package/app/.next-cli-build/server/app/login.rsc +7 -7
  490. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +7 -7
  491. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  492. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +6 -6
  493. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  494. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  495. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  496. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  497. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  498. package/app/.next-cli-build/server/app/page.js +2 -2
  499. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  500. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  501. package/app/.next-cli-build/server/app-paths-manifest.json +12 -8
  502. package/app/.next-cli-build/server/chunks/1241.js +1 -1
  503. package/app/.next-cli-build/server/chunks/1350.js +1 -1
  504. package/app/.next-cli-build/server/chunks/1429.js +1 -0
  505. package/app/.next-cli-build/server/chunks/1719.js +1 -1
  506. package/app/.next-cli-build/server/chunks/212.js +1 -1
  507. package/app/.next-cli-build/server/chunks/2231.js +1 -1
  508. package/app/.next-cli-build/server/chunks/2409.js +1 -0
  509. package/app/.next-cli-build/server/chunks/2701.js +1 -1
  510. package/app/.next-cli-build/server/chunks/2742.js +1 -0
  511. package/app/.next-cli-build/server/chunks/3535.js +1 -1
  512. package/app/.next-cli-build/server/chunks/4046.js +1 -1
  513. package/app/.next-cli-build/server/chunks/412.js +2 -2
  514. package/app/.next-cli-build/server/chunks/5330.js +7 -5
  515. package/app/.next-cli-build/server/chunks/5612.js +1 -1
  516. package/app/.next-cli-build/server/chunks/5615.js +1 -1
  517. package/app/.next-cli-build/server/chunks/5699.js +1 -1
  518. package/app/.next-cli-build/server/chunks/5961.js +1 -1
  519. package/app/.next-cli-build/server/chunks/6070.js +1 -1
  520. package/app/.next-cli-build/server/chunks/6306.js +1 -1
  521. package/app/.next-cli-build/server/chunks/6560.js +1 -0
  522. package/app/.next-cli-build/server/chunks/6777.js +1 -1
  523. package/app/.next-cli-build/server/chunks/7187.js +1 -1
  524. package/app/.next-cli-build/server/chunks/8238.js +1 -1
  525. package/app/.next-cli-build/server/chunks/8271.js +1 -1
  526. package/app/.next-cli-build/server/chunks/8802.js +2 -2
  527. package/app/.next-cli-build/server/chunks/885.js +75 -0
  528. package/app/.next-cli-build/server/chunks/8895.js +5 -5
  529. package/app/.next-cli-build/server/chunks/8955.js +7 -7
  530. package/app/.next-cli-build/server/chunks/9422.js +1 -1
  531. package/app/.next-cli-build/server/chunks/9703.js +1 -1
  532. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  533. package/app/.next-cli-build/server/middleware.js +3 -3
  534. package/app/.next-cli-build/server/pages/404.html +1 -1
  535. package/app/.next-cli-build/server/pages/500.html +1 -1
  536. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  537. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  538. package/app/.next-cli-build/static/JRaGItQgERhBp83cHyRqE/_buildManifest.js +1 -0
  539. package/app/.next-cli-build/static/chunks/{1321-5792bb21361dcd65.js → 1321-a7bfb848c63bdbf7.js} +1 -1
  540. package/app/.next-cli-build/static/chunks/1992-7359483e85c66d42.js +1 -0
  541. package/app/.next-cli-build/static/chunks/5497-6eb58895074fec6d.js +7 -0
  542. package/app/.next-cli-build/static/chunks/{705-cfe5cd65ea2dc6f1.js → 705-35d16348285626c8.js} +1 -1
  543. package/app/.next-cli-build/static/chunks/8105-49cec265df0de251.js +1 -0
  544. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-b4a78d784383253c.js +3 -0
  545. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-3828106aa4f490c1.js → page-7d472b122fb182f0.js} +10 -10
  546. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-83272baae17d38f1.js +1 -0
  547. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/page-4069e1d40a3c70a6.js +1 -0
  548. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-201ce34cf7a0a9ed.js → page-6b500acebeff856b.js} +2 -2
  549. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-c02ccb0fd35970d1.js +1 -0
  550. package/app/.next-cli-build/static/chunks/app/(dashboard)/layout-0a63db83d5e05667.js +1 -0
  551. package/app/.next-cli-build/static/chunks/app/_global-error/page-158df2528a1edacc.js +1 -0
  552. package/app/.next-cli-build/static/chunks/app/api/alerts/test/route-158df2528a1edacc.js +1 -0
  553. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-158df2528a1edacc.js +1 -0
  554. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-158df2528a1edacc.js +1 -0
  555. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-158df2528a1edacc.js +1 -0
  556. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-158df2528a1edacc.js +1 -0
  557. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-158df2528a1edacc.js +1 -0
  558. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-158df2528a1edacc.js +1 -0
  559. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-158df2528a1edacc.js +1 -0
  560. package/app/.next-cli-build/static/chunks/app/api/breaker/route-158df2528a1edacc.js +1 -0
  561. package/app/.next-cli-build/static/chunks/app/api/cache/route-158df2528a1edacc.js +1 -0
  562. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-158df2528a1edacc.js +1 -0
  563. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-158df2528a1edacc.js +1 -0
  564. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-158df2528a1edacc.js +1 -0
  565. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-158df2528a1edacc.js +1 -0
  566. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-158df2528a1edacc.js +1 -0
  567. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-158df2528a1edacc.js +1 -0
  568. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-158df2528a1edacc.js +1 -0
  569. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-158df2528a1edacc.js +1 -0
  570. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-158df2528a1edacc.js +1 -0
  571. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-158df2528a1edacc.js +1 -0
  572. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-158df2528a1edacc.js +1 -0
  573. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-158df2528a1edacc.js +1 -0
  574. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-158df2528a1edacc.js +1 -0
  575. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-158df2528a1edacc.js +1 -0
  576. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-158df2528a1edacc.js +1 -0
  577. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-158df2528a1edacc.js +1 -0
  578. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-158df2528a1edacc.js +1 -0
  579. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-158df2528a1edacc.js +1 -0
  580. package/app/.next-cli-build/static/chunks/app/api/combos/route-158df2528a1edacc.js +1 -0
  581. package/app/.next-cli-build/static/chunks/app/api/combos/validate-roles/route-158df2528a1edacc.js +1 -0
  582. package/app/.next-cli-build/static/chunks/app/api/dashboard/stream/route-158df2528a1edacc.js +1 -0
  583. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-158df2528a1edacc.js +1 -0
  584. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-158df2528a1edacc.js +1 -0
  585. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-158df2528a1edacc.js +1 -0
  586. package/app/.next-cli-build/static/chunks/app/api/health/providers/route-158df2528a1edacc.js +1 -0
  587. package/app/.next-cli-build/static/chunks/app/api/health/route-158df2528a1edacc.js +1 -0
  588. package/app/.next-cli-build/static/chunks/app/api/health/stream/route-158df2528a1edacc.js +1 -0
  589. package/app/.next-cli-build/static/chunks/app/api/init/route-158df2528a1edacc.js +1 -0
  590. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-158df2528a1edacc.js +1 -0
  591. package/app/.next-cli-build/static/chunks/app/api/keys/route-158df2528a1edacc.js +1 -0
  592. package/app/.next-cli-build/static/chunks/app/api/locale/route-158df2528a1edacc.js +1 -0
  593. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-158df2528a1edacc.js +1 -0
  594. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-158df2528a1edacc.js +1 -0
  595. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-158df2528a1edacc.js +1 -0
  596. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-158df2528a1edacc.js +1 -0
  597. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-158df2528a1edacc.js +1 -0
  598. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-158df2528a1edacc.js +1 -0
  599. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-158df2528a1edacc.js +1 -0
  600. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-158df2528a1edacc.js +1 -0
  601. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-158df2528a1edacc.js +1 -0
  602. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-158df2528a1edacc.js +1 -0
  603. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-158df2528a1edacc.js +1 -0
  604. package/app/.next-cli-build/static/chunks/app/api/models/route-158df2528a1edacc.js +1 -0
  605. package/app/.next-cli-build/static/chunks/app/api/models/test/route-158df2528a1edacc.js +1 -0
  606. package/app/.next-cli-build/static/chunks/app/api/oauth/1min/import/route-158df2528a1edacc.js +1 -0
  607. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-158df2528a1edacc.js +1 -0
  608. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-158df2528a1edacc.js +1 -0
  609. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-158df2528a1edacc.js +1 -0
  610. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-158df2528a1edacc.js +1 -0
  611. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-158df2528a1edacc.js +1 -0
  612. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-158df2528a1edacc.js +1 -0
  613. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-158df2528a1edacc.js +1 -0
  614. package/app/.next-cli-build/static/chunks/app/api/oauth/kimi-desktop/auto-import/route-158df2528a1edacc.js +1 -0
  615. package/app/.next-cli-build/static/chunks/app/api/oauth/kimi-desktop/import/route-158df2528a1edacc.js +1 -0
  616. package/app/.next-cli-build/static/chunks/app/api/oauth/kimi-desktop/quota/route-158df2528a1edacc.js +1 -0
  617. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-158df2528a1edacc.js +1 -0
  618. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-158df2528a1edacc.js +1 -0
  619. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-158df2528a1edacc.js +1 -0
  620. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-158df2528a1edacc.js +1 -0
  621. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-158df2528a1edacc.js +1 -0
  622. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-158df2528a1edacc.js +1 -0
  623. package/app/.next-cli-build/static/chunks/app/api/oauth/qwen/import/route-158df2528a1edacc.js +1 -0
  624. package/app/.next-cli-build/static/chunks/app/api/oauth/wp-studio/import/route-158df2528a1edacc.js +1 -0
  625. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/auto-import/route-158df2528a1edacc.js +1 -0
  626. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/import/route-158df2528a1edacc.js +1 -0
  627. package/app/.next-cli-build/static/chunks/app/api/pricing/route-158df2528a1edacc.js +1 -0
  628. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-158df2528a1edacc.js +1 -0
  629. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-158df2528a1edacc.js +1 -0
  630. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-158df2528a1edacc.js +1 -0
  631. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/agnes-profile/route-158df2528a1edacc.js +1 -0
  632. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/freebuff-profile/route-158df2528a1edacc.js +1 -0
  633. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/health-timeline/route-158df2528a1edacc.js +1 -0
  634. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/inxora-profile/route-158df2528a1edacc.js +1 -0
  635. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-158df2528a1edacc.js +1 -0
  636. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/onemin-api-profile/route-158df2528a1edacc.js +1 -0
  637. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/onemin-profile/route-158df2528a1edacc.js +1 -0
  638. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/qwencloud-profile/route-158df2528a1edacc.js +1 -0
  639. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-158df2528a1edacc.js +1 -0
  640. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-158df2528a1edacc.js +1 -0
  641. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-158df2528a1edacc.js +1 -0
  642. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/v0-profile/route-158df2528a1edacc.js +1 -0
  643. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/vault-pool/route-158df2528a1edacc.js +1 -0
  644. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/zenmux-plans/route-158df2528a1edacc.js +1 -0
  645. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-158df2528a1edacc.js +1 -0
  646. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-158df2528a1edacc.js +1 -0
  647. package/app/.next-cli-build/static/chunks/app/api/providers/route-158df2528a1edacc.js +1 -0
  648. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-158df2528a1edacc.js +1 -0
  649. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-158df2528a1edacc.js +1 -0
  650. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-158df2528a1edacc.js +1 -0
  651. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-158df2528a1edacc.js +1 -0
  652. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-158df2528a1edacc.js +1 -0
  653. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-158df2528a1edacc.js +1 -0
  654. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-158df2528a1edacc.js +1 -0
  655. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-158df2528a1edacc.js +1 -0
  656. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-158df2528a1edacc.js +1 -0
  657. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-158df2528a1edacc.js +1 -0
  658. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-158df2528a1edacc.js +1 -0
  659. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-158df2528a1edacc.js +1 -0
  660. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-158df2528a1edacc.js +1 -0
  661. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-158df2528a1edacc.js +1 -0
  662. package/app/.next-cli-build/static/chunks/app/api/settings/route-158df2528a1edacc.js +1 -0
  663. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-158df2528a1edacc.js +1 -0
  664. package/app/.next-cli-build/static/chunks/app/api/swarm/active/route-158df2528a1edacc.js +1 -0
  665. package/app/.next-cli-build/static/chunks/app/api/swarm/stream/route-158df2528a1edacc.js +1 -0
  666. package/app/.next-cli-build/static/chunks/app/api/tags/route-158df2528a1edacc.js +1 -0
  667. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-158df2528a1edacc.js +1 -0
  668. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-158df2528a1edacc.js +1 -0
  669. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-158df2528a1edacc.js +1 -0
  670. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-158df2528a1edacc.js +1 -0
  671. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-158df2528a1edacc.js +1 -0
  672. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-158df2528a1edacc.js +1 -0
  673. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-158df2528a1edacc.js +1 -0
  674. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-158df2528a1edacc.js +1 -0
  675. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-158df2528a1edacc.js +1 -0
  676. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-158df2528a1edacc.js +1 -0
  677. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-158df2528a1edacc.js +1 -0
  678. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-158df2528a1edacc.js +1 -0
  679. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-158df2528a1edacc.js +1 -0
  680. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-158df2528a1edacc.js +1 -0
  681. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-158df2528a1edacc.js +1 -0
  682. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-158df2528a1edacc.js +1 -0
  683. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-158df2528a1edacc.js +1 -0
  684. package/app/.next-cli-build/static/chunks/app/api/usage/leaderboard/route-158df2528a1edacc.js +1 -0
  685. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-158df2528a1edacc.js +1 -0
  686. package/app/.next-cli-build/static/chunks/app/api/usage/meta/route-158df2528a1edacc.js +1 -0
  687. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-158df2528a1edacc.js +1 -0
  688. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-158df2528a1edacc.js +1 -0
  689. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-158df2528a1edacc.js +1 -0
  690. package/app/.next-cli-build/static/chunks/app/api/usage/retry-stats/route-158df2528a1edacc.js +1 -0
  691. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-158df2528a1edacc.js +1 -0
  692. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-158df2528a1edacc.js +1 -0
  693. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-158df2528a1edacc.js +1 -0
  694. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-158df2528a1edacc.js +1 -0
  695. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-158df2528a1edacc.js +1 -0
  696. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-158df2528a1edacc.js +1 -0
  697. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-158df2528a1edacc.js +1 -0
  698. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-158df2528a1edacc.js +1 -0
  699. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-158df2528a1edacc.js +1 -0
  700. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-158df2528a1edacc.js +1 -0
  701. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-158df2528a1edacc.js +1 -0
  702. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-158df2528a1edacc.js +1 -0
  703. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-158df2528a1edacc.js +1 -0
  704. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-158df2528a1edacc.js +1 -0
  705. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-158df2528a1edacc.js +1 -0
  706. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-158df2528a1edacc.js +1 -0
  707. package/app/.next-cli-build/static/chunks/app/api/v1/route-158df2528a1edacc.js +1 -0
  708. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-158df2528a1edacc.js +1 -0
  709. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-158df2528a1edacc.js +1 -0
  710. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-158df2528a1edacc.js +1 -0
  711. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-158df2528a1edacc.js +1 -0
  712. package/app/.next-cli-build/static/chunks/app/api/version/route-158df2528a1edacc.js +1 -0
  713. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-158df2528a1edacc.js +1 -0
  714. package/app/.next-cli-build/static/chunks/app/api/version/update/route-158df2528a1edacc.js +1 -0
  715. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-158df2528a1edacc.js +1 -0
  716. package/app/.next-cli-build/static/chunks/app/page-158df2528a1edacc.js +1 -0
  717. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-158df2528a1edacc.js +1 -0
  718. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-158df2528a1edacc.js +1 -0
  719. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-158df2528a1edacc.js +1 -0
  720. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-158df2528a1edacc.js +1 -0
  721. package/app/.next-cli-build/static/css/d25230f8c6390408.css +1 -0
  722. package/app/node_modules/nanoid/package.json +1 -1
  723. package/app/package.json +6 -4
  724. package/app/public/providers/codebuddy-intl.png +0 -0
  725. package/app/public/providers/inferx.svg +8 -0
  726. package/app/public/providers/kimi-desktop.svg +9 -0
  727. package/app/public/providers/novita.svg +6 -0
  728. package/app/public/providers/workbuddy.png +0 -0
  729. package/package.json +1 -1
  730. package/app/.next-cli-build/server/chunks/1212.js +0 -1
  731. package/app/.next-cli-build/server/chunks/3437.js +0 -75
  732. package/app/.next-cli-build/server/chunks/4632.js +0 -1
  733. package/app/.next-cli-build/server/chunks/615.js +0 -1
  734. package/app/.next-cli-build/server/chunks/6686.js +0 -1
  735. package/app/.next-cli-build/static/chunks/1992-b492aa3235a8c259.js +0 -1
  736. package/app/.next-cli-build/static/chunks/5497-b321fb89cc6d6e14.js +0 -7
  737. package/app/.next-cli-build/static/chunks/8105-37d0f6450b27ac6b.js +0 -1
  738. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-648e105b4f37fef0.js +0 -3
  739. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-e086fed7677d4852.js +0 -1
  740. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-0be4cac4f06ef3e2.js +0 -1
  741. package/app/.next-cli-build/static/chunks/app/(dashboard)/layout-d62e22634bbd6c94.js +0 -1
  742. package/app/.next-cli-build/static/chunks/app/_global-error/page-ab464cb25617d9dd.js +0 -1
  743. package/app/.next-cli-build/static/chunks/app/api/alerts/test/route-ab464cb25617d9dd.js +0 -1
  744. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-ab464cb25617d9dd.js +0 -1
  745. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-ab464cb25617d9dd.js +0 -1
  746. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-ab464cb25617d9dd.js +0 -1
  747. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-ab464cb25617d9dd.js +0 -1
  748. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-ab464cb25617d9dd.js +0 -1
  749. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-ab464cb25617d9dd.js +0 -1
  750. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-ab464cb25617d9dd.js +0 -1
  751. package/app/.next-cli-build/static/chunks/app/api/breaker/route-ab464cb25617d9dd.js +0 -1
  752. package/app/.next-cli-build/static/chunks/app/api/cache/route-ab464cb25617d9dd.js +0 -1
  753. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-ab464cb25617d9dd.js +0 -1
  754. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-ab464cb25617d9dd.js +0 -1
  755. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-ab464cb25617d9dd.js +0 -1
  756. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-ab464cb25617d9dd.js +0 -1
  757. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-ab464cb25617d9dd.js +0 -1
  758. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-ab464cb25617d9dd.js +0 -1
  759. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-ab464cb25617d9dd.js +0 -1
  760. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-ab464cb25617d9dd.js +0 -1
  761. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-ab464cb25617d9dd.js +0 -1
  762. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-ab464cb25617d9dd.js +0 -1
  763. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-ab464cb25617d9dd.js +0 -1
  764. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-ab464cb25617d9dd.js +0 -1
  765. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-ab464cb25617d9dd.js +0 -1
  766. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-ab464cb25617d9dd.js +0 -1
  767. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-ab464cb25617d9dd.js +0 -1
  768. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-ab464cb25617d9dd.js +0 -1
  769. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-ab464cb25617d9dd.js +0 -1
  770. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-ab464cb25617d9dd.js +0 -1
  771. package/app/.next-cli-build/static/chunks/app/api/combos/route-ab464cb25617d9dd.js +0 -1
  772. package/app/.next-cli-build/static/chunks/app/api/combos/validate-roles/route-ab464cb25617d9dd.js +0 -1
  773. package/app/.next-cli-build/static/chunks/app/api/dashboard/stream/route-ab464cb25617d9dd.js +0 -1
  774. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-ab464cb25617d9dd.js +0 -1
  775. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-ab464cb25617d9dd.js +0 -1
  776. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-ab464cb25617d9dd.js +0 -1
  777. package/app/.next-cli-build/static/chunks/app/api/health/providers/route-ab464cb25617d9dd.js +0 -1
  778. package/app/.next-cli-build/static/chunks/app/api/health/route-ab464cb25617d9dd.js +0 -1
  779. package/app/.next-cli-build/static/chunks/app/api/health/stream/route-ab464cb25617d9dd.js +0 -1
  780. package/app/.next-cli-build/static/chunks/app/api/init/route-ab464cb25617d9dd.js +0 -1
  781. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-ab464cb25617d9dd.js +0 -1
  782. package/app/.next-cli-build/static/chunks/app/api/keys/route-ab464cb25617d9dd.js +0 -1
  783. package/app/.next-cli-build/static/chunks/app/api/locale/route-ab464cb25617d9dd.js +0 -1
  784. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-ab464cb25617d9dd.js +0 -1
  785. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-ab464cb25617d9dd.js +0 -1
  786. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-ab464cb25617d9dd.js +0 -1
  787. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-ab464cb25617d9dd.js +0 -1
  788. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-ab464cb25617d9dd.js +0 -1
  789. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-ab464cb25617d9dd.js +0 -1
  790. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-ab464cb25617d9dd.js +0 -1
  791. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-ab464cb25617d9dd.js +0 -1
  792. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-ab464cb25617d9dd.js +0 -1
  793. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-ab464cb25617d9dd.js +0 -1
  794. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-ab464cb25617d9dd.js +0 -1
  795. package/app/.next-cli-build/static/chunks/app/api/models/route-ab464cb25617d9dd.js +0 -1
  796. package/app/.next-cli-build/static/chunks/app/api/models/test/route-ab464cb25617d9dd.js +0 -1
  797. package/app/.next-cli-build/static/chunks/app/api/oauth/1min/import/route-ab464cb25617d9dd.js +0 -1
  798. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-ab464cb25617d9dd.js +0 -1
  799. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-ab464cb25617d9dd.js +0 -1
  800. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-ab464cb25617d9dd.js +0 -1
  801. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-ab464cb25617d9dd.js +0 -1
  802. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-ab464cb25617d9dd.js +0 -1
  803. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-ab464cb25617d9dd.js +0 -1
  804. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-ab464cb25617d9dd.js +0 -1
  805. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-ab464cb25617d9dd.js +0 -1
  806. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-ab464cb25617d9dd.js +0 -1
  807. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-ab464cb25617d9dd.js +0 -1
  808. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-ab464cb25617d9dd.js +0 -1
  809. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-ab464cb25617d9dd.js +0 -1
  810. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-ab464cb25617d9dd.js +0 -1
  811. package/app/.next-cli-build/static/chunks/app/api/oauth/qwen/import/route-ab464cb25617d9dd.js +0 -1
  812. package/app/.next-cli-build/static/chunks/app/api/oauth/wp-studio/import/route-ab464cb25617d9dd.js +0 -1
  813. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/auto-import/route-ab464cb25617d9dd.js +0 -1
  814. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/import/route-ab464cb25617d9dd.js +0 -1
  815. package/app/.next-cli-build/static/chunks/app/api/pricing/route-ab464cb25617d9dd.js +0 -1
  816. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-ab464cb25617d9dd.js +0 -1
  817. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-ab464cb25617d9dd.js +0 -1
  818. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-ab464cb25617d9dd.js +0 -1
  819. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/agnes-profile/route-ab464cb25617d9dd.js +0 -1
  820. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/freebuff-profile/route-ab464cb25617d9dd.js +0 -1
  821. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/health-timeline/route-ab464cb25617d9dd.js +0 -1
  822. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/inxora-profile/route-ab464cb25617d9dd.js +0 -1
  823. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-ab464cb25617d9dd.js +0 -1
  824. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/onemin-api-profile/route-ab464cb25617d9dd.js +0 -1
  825. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/onemin-profile/route-ab464cb25617d9dd.js +0 -1
  826. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/qwencloud-profile/route-ab464cb25617d9dd.js +0 -1
  827. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-ab464cb25617d9dd.js +0 -1
  828. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-ab464cb25617d9dd.js +0 -1
  829. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-ab464cb25617d9dd.js +0 -1
  830. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/v0-profile/route-ab464cb25617d9dd.js +0 -1
  831. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/vault-pool/route-ab464cb25617d9dd.js +0 -1
  832. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/zenmux-plans/route-ab464cb25617d9dd.js +0 -1
  833. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-ab464cb25617d9dd.js +0 -1
  834. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-ab464cb25617d9dd.js +0 -1
  835. package/app/.next-cli-build/static/chunks/app/api/providers/route-ab464cb25617d9dd.js +0 -1
  836. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-ab464cb25617d9dd.js +0 -1
  837. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-ab464cb25617d9dd.js +0 -1
  838. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-ab464cb25617d9dd.js +0 -1
  839. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-ab464cb25617d9dd.js +0 -1
  840. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-ab464cb25617d9dd.js +0 -1
  841. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-ab464cb25617d9dd.js +0 -1
  842. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-ab464cb25617d9dd.js +0 -1
  843. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-ab464cb25617d9dd.js +0 -1
  844. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-ab464cb25617d9dd.js +0 -1
  845. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-ab464cb25617d9dd.js +0 -1
  846. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-ab464cb25617d9dd.js +0 -1
  847. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-ab464cb25617d9dd.js +0 -1
  848. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-ab464cb25617d9dd.js +0 -1
  849. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-ab464cb25617d9dd.js +0 -1
  850. package/app/.next-cli-build/static/chunks/app/api/settings/route-ab464cb25617d9dd.js +0 -1
  851. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-ab464cb25617d9dd.js +0 -1
  852. package/app/.next-cli-build/static/chunks/app/api/swarm/active/route-ab464cb25617d9dd.js +0 -1
  853. package/app/.next-cli-build/static/chunks/app/api/swarm/stream/route-ab464cb25617d9dd.js +0 -1
  854. package/app/.next-cli-build/static/chunks/app/api/tags/route-ab464cb25617d9dd.js +0 -1
  855. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-ab464cb25617d9dd.js +0 -1
  856. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-ab464cb25617d9dd.js +0 -1
  857. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-ab464cb25617d9dd.js +0 -1
  858. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-ab464cb25617d9dd.js +0 -1
  859. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-ab464cb25617d9dd.js +0 -1
  860. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-ab464cb25617d9dd.js +0 -1
  861. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-ab464cb25617d9dd.js +0 -1
  862. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-ab464cb25617d9dd.js +0 -1
  863. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-ab464cb25617d9dd.js +0 -1
  864. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-ab464cb25617d9dd.js +0 -1
  865. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-ab464cb25617d9dd.js +0 -1
  866. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-ab464cb25617d9dd.js +0 -1
  867. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-ab464cb25617d9dd.js +0 -1
  868. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-ab464cb25617d9dd.js +0 -1
  869. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-ab464cb25617d9dd.js +0 -1
  870. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-ab464cb25617d9dd.js +0 -1
  871. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-ab464cb25617d9dd.js +0 -1
  872. package/app/.next-cli-build/static/chunks/app/api/usage/leaderboard/route-ab464cb25617d9dd.js +0 -1
  873. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-ab464cb25617d9dd.js +0 -1
  874. package/app/.next-cli-build/static/chunks/app/api/usage/meta/route-ab464cb25617d9dd.js +0 -1
  875. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-ab464cb25617d9dd.js +0 -1
  876. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-ab464cb25617d9dd.js +0 -1
  877. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-ab464cb25617d9dd.js +0 -1
  878. package/app/.next-cli-build/static/chunks/app/api/usage/retry-stats/route-ab464cb25617d9dd.js +0 -1
  879. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-ab464cb25617d9dd.js +0 -1
  880. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-ab464cb25617d9dd.js +0 -1
  881. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-ab464cb25617d9dd.js +0 -1
  882. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-ab464cb25617d9dd.js +0 -1
  883. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-ab464cb25617d9dd.js +0 -1
  884. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-ab464cb25617d9dd.js +0 -1
  885. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-ab464cb25617d9dd.js +0 -1
  886. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-ab464cb25617d9dd.js +0 -1
  887. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-ab464cb25617d9dd.js +0 -1
  888. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-ab464cb25617d9dd.js +0 -1
  889. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-ab464cb25617d9dd.js +0 -1
  890. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-ab464cb25617d9dd.js +0 -1
  891. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-ab464cb25617d9dd.js +0 -1
  892. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-ab464cb25617d9dd.js +0 -1
  893. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-ab464cb25617d9dd.js +0 -1
  894. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-ab464cb25617d9dd.js +0 -1
  895. package/app/.next-cli-build/static/chunks/app/api/v1/route-ab464cb25617d9dd.js +0 -1
  896. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-ab464cb25617d9dd.js +0 -1
  897. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-ab464cb25617d9dd.js +0 -1
  898. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-ab464cb25617d9dd.js +0 -1
  899. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-ab464cb25617d9dd.js +0 -1
  900. package/app/.next-cli-build/static/chunks/app/api/version/route-ab464cb25617d9dd.js +0 -1
  901. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-ab464cb25617d9dd.js +0 -1
  902. package/app/.next-cli-build/static/chunks/app/api/version/update/route-ab464cb25617d9dd.js +0 -1
  903. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-ab464cb25617d9dd.js +0 -1
  904. package/app/.next-cli-build/static/chunks/app/page-ab464cb25617d9dd.js +0 -1
  905. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-ab464cb25617d9dd.js +0 -1
  906. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-ab464cb25617d9dd.js +0 -1
  907. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-ab464cb25617d9dd.js +0 -1
  908. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-ab464cb25617d9dd.js +0 -1
  909. package/app/.next-cli-build/static/css/27a3eadf22014a5b.css +0 -1
  910. package/app/.next-cli-build/static/j7bBgtavtSkTBPfbmetr9/_buildManifest.js +0 -1
  911. /package/app/.next-cli-build/static/{j7bBgtavtSkTBPfbmetr9 → JRaGItQgERhBp83cHyRqE}/_ssgManifest.js +0 -0
@@ -1,16 +1,16 @@
1
- "use strict";exports.id=8955,exports.ids=[8955],exports.modules={31589:(a,b,c)=>{c.d(b,{Ub:()=>l});var d=c(96970),e=c(40669);let f=Object.freeze({toolUse:!0,fileAccess:!0,streaming:!0,multiTurn:!0,controlRole:!0,reliableJson:!0}),g=Object.freeze({toolUse:!1,fileAccess:!1,streaming:!1,multiTurn:!1,controlRole:!1,reliableJson:!1}),h={webCookie:Object.freeze({toolUse:!1,fileAccess:!1,streaming:!0,multiTurn:!0,controlRole:!1,reliableJson:!1})},i=Object.freeze({manager:{controlRole:!0,reliableJson:!0,multiTurn:!0},staff:{controlRole:!0,reliableJson:!0,multiTurn:!0},audit:{controlRole:!0,reliableJson:!0,multiTurn:!0},judge:{controlRole:!0,reliableJson:!0,multiTurn:!0}}),j=new Map;for(let a of d.A)if(a.capabilities&&"object"==typeof a.capabilities)j.set(a.id,{...f,...a.capabilities});else{let b=h[a.category];j.set(a.id,b?{...b}:{...f})}function k(a,b){if(!a||"string"!=typeof a)return!0;let c=a.indexOf("/"),d=c>=0?a.slice(0,c):a;return function(a,b){let c,d=i[b];if(!d)return!0;let f=(c=(0,e.g2)(a),j.get(c)||{...g});for(let[a,b]of Object.entries(d))if(b&&!f[a])return!1;return!0}((0,e.g2)(d),b)}function l(a,b,c=[]){let d=[],e=Array.isArray(c)&&c.length>0?c[0]:"";if("swarm"===a){for(let{role:a,model:c}of[{role:"manager",model:b?.managerModel||e},{role:"staff",model:b?.staffModel||e},{role:"audit",model:b?.auditModel||e}])if(c&&!k(c,a)){let b=c.split("/")[0];d.push({role:a,model:c,reason:`Provider "${b}" cannot serve as ${a} — web cookie providers lack tool use and file access required for control roles.`})}}else if("fusion"===a){let a=b?.judgeModel||e;if(a&&!k(a,"judge")){let b=a.split("/")[0];d.push({role:"judge",model:a,reason:`Provider "${b}" cannot serve as judge — web cookie providers lack tool use and file access required for the judge role.`})}}return d}},36701:(a,b,c)=>{c.d(b,{SH:()=>l,ZW:()=>p,_5:()=>k,_s:()=>j,bt:()=>n,gF:()=>m,kA:()=>o,ni:()=>f});var d=c(78474),e=c(77598);global._swarmEmitter||(global._swarmEmitter=new d.EventEmitter,global._swarmEmitter.setMaxListeners(200),global._swarmRuns=new Map,global._swarmEmitTimers={});let f=global._swarmEmitter,g=global._swarmRuns,h=global._swarmEmitTimers;function i(a,b,c=120){let d=b?.worker!==void 0?`:w${b.worker}`:"",e=`${a}:${b?.runId||""}${d}`;h[e]&&clearTimeout(h[e]),h[e]=setTimeout(()=>{delete h[e],f.emit(a,b)},c)}function j({comboName:a,promptPreview:b,managerModel:c,staffModel:d,auditModel:f,workerCount:h}){let k=(0,e.randomUUID)(),l=Date.now(),m={runId:k,comboName:a,promptPreview:(b||"").slice(0,200),managerModel:c,staffModel:d,auditModel:f,workerCount:h||0,status:"running",startedAt:l,completedAt:null,totalDurationMs:null,stages:{gatekeeper:{status:"pending",startedAt:null,completedAt:null,durationMs:null,model:c,verdict:null},manager:{status:"pending",startedAt:null,completedAt:null,durationMs:null,model:c,strategy:null},workers:{status:"pending",startedAt:null,completedAt:null,durationMs:null,workers:[]},audit:{status:"pending",startedAt:null,completedAt:null,durationMs:null,model:d||f},synthesis:{status:"pending",startedAt:null,completedAt:null,durationMs:null,model:c}}};for(let a=0;a<(h||0);a++)m.stages.workers.workers.push({index:a,status:"pending",model:null,durationMs:null});if(g.set(k,m),g.size>50){let a=[...g.entries()].sort((a,b)=>a[1].startedAt-b[1].startedAt)[0];a&&g.delete(a[0])}return i("swarm:start",{runId:k,comboName:a,promptPreview:m.promptPreview,workerCount:m.workerCount},0),m}function k(a,b,c={}){let d=g.get(a);if(!d)return;let e=d.stages[b];e&&(e.status="running",e.startedAt=Date.now(),Object.assign(e,c),i("swarm:stage",{runId:a,stage:b,status:"running",...c}))}function l(a,b,c={}){let d=g.get(a);if(!d)return;let e=d.stages[b];e&&"done"!==e.status&&(e.status="done",e.completedAt=Date.now(),e.durationMs=e.startedAt?e.completedAt-e.startedAt:null,Object.assign(e,c),i("swarm:stage",{runId:a,stage:b,status:"done",durationMs:e.durationMs,...c}))}function m(a,b,c,d={}){let e=g.get(a);if(!e)return;for(;e.stages.workers.workers.length<=b;)e.stages.workers.workers.push({index:e.stages.workers.workers.length,status:"pending",model:null,durationMs:null});let f=e.stages.workers.workers[b];f&&(f.status=c,Object.assign(f,d),i("swarm:stage",{runId:a,stage:"workers",worker:b,status:c,...d}))}function n(a,b){let c=g.get(a);c&&"done"!==c.status&&"error"!==c.status&&(c.status="error",c.error=String(b?.message||b||"unknown"),c.completedAt=Date.now(),c.totalDurationMs=c.completedAt-c.startedAt,i("swarm:error",{runId:a,error:c.error,totalDurationMs:c.totalDurationMs},0))}function o(a,b={}){let c=g.get(a);c&&"done"!==c.status&&"error"!==c.status&&(c.status="done",c.completedAt=Date.now(),c.totalDurationMs=c.completedAt-c.startedAt,Object.assign(c,b),i("swarm:complete",{runId:a,totalDurationMs:c.totalDurationMs,...b},0))}function p(a=20){return[...g.values()].sort((a,b)=>b.startedAt-a.startedAt).slice(0,a)}},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},82121:(a,b,c)=>{c.d(b,{zH:()=>_,dW:()=>ac,Vt:()=>$,$x:()=>U,Vu:()=>Y,Ni:()=>af,Pr:()=>Z,vt:()=>ad,je:()=>L,UP:()=>X,wj:()=>ab});var d=c(12557),e=c(43659),f=c(66306),g=c(26922),h=c(24467),i=c(31589),j=c(40669);function k(a,b,c){let d,e=new AbortController,f=()=>e.abort(c?.reason||Error("parent aborted"));return c?.aborted?f():c?.addEventListener("abort",f,{once:!0}),{promise:new Promise(c=>{d=setTimeout(()=>{e.abort(Error("combo task timeout")),c({__timeout:!0})},b),Promise.resolve().then(()=>a(e.signal)).then(a=>c(a)).catch(a=>c({__error:a})).finally(()=>clearTimeout(d))}),signal:e.signal,abort(a="combo task cancelled"){e.signal.aborted||e.abort(Error(a))},cleanup(){clearTimeout(d),c?.removeEventListener("abort",f)}}}var l=c(14170);function m(a){return a?.request?.contents?l.h.ANTIGRAVITY:Array.isArray(a?.contents)?l.h.GEMINI:a?.input===void 0||a?.messages?a?.anthropic_version||a?.system!==void 0?l.h.CLAUDE:l.h.OPENAI:l.h.OPENAI_RESPONSES}function n(a,b,c=m(a)){let d={...a};if(c===l.h.ANTIGRAVITY){let c={...a.request||{}};c.contents=[...c.contents||[],{role:"user",parts:[{text:b}]}],d.request=c}else c===l.h.GEMINI?d.contents=[...a.contents||[],{role:"user",parts:[{text:b}]}]:c===l.h.OPENAI_RESPONSES?d.input=[..."string"==typeof a.input?[{role:"user",content:a.input}]:[...a.input||[]],{role:"user",content:[{type:"input_text",text:b}]}]:d.messages=[...a.messages||[],{role:"user",content:b}];return d}function o(a){return(a||[]).filter(Boolean).map(a=>{if("tool"===a.role||"function"===a.role)return{role:"assistant",content:`[Tool result: ${(0,g.kU)(a.content)||String(a.content??"")}]`};if("assistant"===a.role&&Array.isArray(a.tool_calls)){let{tool_calls:b,...c}=a,d=b.map(a=>a?.function?.name||a?.name||"tool").join(", "),e=(0,g.kU)(c.content)||"";return{...c,content:`${e}${e?"\n":""}[Called tools: ${d}]`}}if(Array.isArray(a.content)&&a.content.some(a=>a?.type==="tool_use"||a?.type==="tool_result")){let b=a.content.map(a=>a?.text||(a?.type==="tool_use"?`[Called tool: ${a.name||"tool"}]`:a?.type==="tool_result"?`[Tool result: ${(0,g.kU)(a.content)}]`:"")).filter(Boolean).join("\n");return{...a,content:b}}return a})}function p(a,b=m(a)){let{tools:c,tool_choice:d,...e}=a,f={...e,stream:!1};return b===l.h.OPENAI_RESPONSES?Array.isArray(f.input)&&(f.input=o(f.input)):b===l.h.ANTIGRAVITY?f.request={...f.request||{},tools:void 0}:Array.isArray(f.messages)&&(f.messages=o(f.messages)),f}function q(a,b){let c=String(a||"");return c.length<=b?c:`${c.slice(0,b)}
1
+ "use strict";exports.id=8955,exports.ids=[8955],exports.modules={31589:(a,b,c)=>{c.d(b,{Ub:()=>l});var d=c(47834),e=c(40669);let f=Object.freeze({toolUse:!0,fileAccess:!0,streaming:!0,multiTurn:!0,controlRole:!0,reliableJson:!0}),g=Object.freeze({toolUse:!1,fileAccess:!1,streaming:!1,multiTurn:!1,controlRole:!1,reliableJson:!1}),h={webCookie:Object.freeze({toolUse:!1,fileAccess:!1,streaming:!0,multiTurn:!0,controlRole:!1,reliableJson:!1})},i=Object.freeze({manager:{controlRole:!0,reliableJson:!0,multiTurn:!0},staff:{controlRole:!0,reliableJson:!0,multiTurn:!0},audit:{controlRole:!0,reliableJson:!0,multiTurn:!0},judge:{controlRole:!0,reliableJson:!0,multiTurn:!0}}),j=new Map;for(let a of d.A)if(a.capabilities&&"object"==typeof a.capabilities)j.set(a.id,{...f,...a.capabilities});else{let b=h[a.category];j.set(a.id,b?{...b}:{...f})}function k(a,b){if(!a||"string"!=typeof a)return!0;let c=a.indexOf("/"),d=c>=0?a.slice(0,c):a;return function(a,b){let c,d=i[b];if(!d)return!0;let f=(c=(0,e.g2)(a),j.get(c)||{...g});for(let[a,b]of Object.entries(d))if(b&&!f[a])return!1;return!0}((0,e.g2)(d),b)}function l(a,b,c=[]){let d=[],e=Array.isArray(c)&&c.length>0?c[0]:"";if("swarm"===a){for(let{role:a,model:c}of[{role:"manager",model:b?.managerModel||e},{role:"staff",model:b?.staffModel||e},{role:"audit",model:b?.auditModel||e}])if(c&&!k(c,a)){let b=c.split("/")[0];d.push({role:a,model:c,reason:`Provider "${b}" cannot serve as ${a} — web cookie providers lack tool use and file access required for control roles.`})}}else if("fusion"===a){let a=b?.judgeModel||e;if(a&&!k(a,"judge")){let b=a.split("/")[0];d.push({role:"judge",model:a,reason:`Provider "${b}" cannot serve as judge — web cookie providers lack tool use and file access required for the judge role.`})}}return d}},36701:(a,b,c)=>{c.d(b,{SH:()=>l,ZW:()=>p,_5:()=>k,_s:()=>j,bt:()=>n,gF:()=>m,kA:()=>o,ni:()=>f});var d=c(78474),e=c(77598);global._swarmEmitter||(global._swarmEmitter=new d.EventEmitter,global._swarmEmitter.setMaxListeners(200),global._swarmRuns=new Map,global._swarmEmitTimers={});let f=global._swarmEmitter,g=global._swarmRuns,h=global._swarmEmitTimers;function i(a,b,c=120){let d=b?.worker!==void 0?`:w${b.worker}`:"",e=`${a}:${b?.runId||""}${d}`;h[e]&&clearTimeout(h[e]),h[e]=setTimeout(()=>{delete h[e],f.emit(a,b)},c)}function j({comboName:a,promptPreview:b,managerModel:c,staffModel:d,auditModel:f,workerCount:h}){let k=(0,e.randomUUID)(),l=Date.now(),m={runId:k,comboName:a,promptPreview:(b||"").slice(0,200),managerModel:c,staffModel:d,auditModel:f,workerCount:h||0,status:"running",startedAt:l,completedAt:null,totalDurationMs:null,stages:{gatekeeper:{status:"pending",startedAt:null,completedAt:null,durationMs:null,model:c,verdict:null},manager:{status:"pending",startedAt:null,completedAt:null,durationMs:null,model:c,strategy:null},workers:{status:"pending",startedAt:null,completedAt:null,durationMs:null,workers:[]},audit:{status:"pending",startedAt:null,completedAt:null,durationMs:null,model:d||f},synthesis:{status:"pending",startedAt:null,completedAt:null,durationMs:null,model:c}}};for(let a=0;a<(h||0);a++)m.stages.workers.workers.push({index:a,status:"pending",model:null,durationMs:null});if(g.set(k,m),g.size>50){let a=[...g.entries()].sort((a,b)=>a[1].startedAt-b[1].startedAt)[0];a&&g.delete(a[0])}return i("swarm:start",{runId:k,comboName:a,promptPreview:m.promptPreview,workerCount:m.workerCount},0),m}function k(a,b,c={}){let d=g.get(a);if(!d)return;let e=d.stages[b];e&&(e.status="running",e.startedAt=Date.now(),Object.assign(e,c),i("swarm:stage",{runId:a,stage:b,status:"running",...c}))}function l(a,b,c={}){let d=g.get(a);if(!d)return;let e=d.stages[b];e&&"done"!==e.status&&(e.status="done",e.completedAt=Date.now(),e.durationMs=e.startedAt?e.completedAt-e.startedAt:null,Object.assign(e,c),i("swarm:stage",{runId:a,stage:b,status:"done",durationMs:e.durationMs,...c}))}function m(a,b,c,d={}){let e=g.get(a);if(!e)return;for(;e.stages.workers.workers.length<=b;)e.stages.workers.workers.push({index:e.stages.workers.workers.length,status:"pending",model:null,durationMs:null});let f=e.stages.workers.workers[b];f&&(f.status=c,Object.assign(f,d),i("swarm:stage",{runId:a,stage:"workers",worker:b,status:c,...d}))}function n(a,b){let c=g.get(a);c&&"done"!==c.status&&"error"!==c.status&&(c.status="error",c.error=String(b?.message||b||"unknown"),c.completedAt=Date.now(),c.totalDurationMs=c.completedAt-c.startedAt,i("swarm:error",{runId:a,error:c.error,totalDurationMs:c.totalDurationMs},0))}function o(a,b={}){let c=g.get(a);c&&"done"!==c.status&&"error"!==c.status&&(c.status="done",c.completedAt=Date.now(),c.totalDurationMs=c.completedAt-c.startedAt,Object.assign(c,b),i("swarm:complete",{runId:a,totalDurationMs:c.totalDurationMs,...b},0))}function p(a=20){return[...g.values()].sort((a,b)=>b.startedAt-a.startedAt).slice(0,a)}},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},82121:(a,b,c)=>{c.d(b,{zH:()=>_,dW:()=>ac,Vt:()=>$,$x:()=>U,Vu:()=>Y,Ni:()=>af,Pr:()=>Z,vt:()=>ad,je:()=>L,UP:()=>X,wj:()=>ab});var d=c(12557),e=c(43659),f=c(66306),g=c(26922),h=c(24467),i=c(31589),j=c(40669);function k(a,b,c){let d,e=new AbortController,f=()=>e.abort(c?.reason||Error("parent aborted"));return c?.aborted?f():c?.addEventListener("abort",f,{once:!0}),{promise:new Promise(c=>{d=setTimeout(()=>{e.abort(Error("combo task timeout")),c({__timeout:!0})},b),Promise.resolve().then(()=>a(e.signal)).then(a=>c(a)).catch(a=>c({__error:a})).finally(()=>clearTimeout(d))}),signal:e.signal,abort(a="combo task cancelled"){e.signal.aborted||e.abort(Error(a))},cleanup(){clearTimeout(d),c?.removeEventListener("abort",f)}}}var l=c(14170);function m(a){return a?.request?.contents?l.h.ANTIGRAVITY:Array.isArray(a?.contents)?l.h.GEMINI:a?.input===void 0||a?.messages?a?.anthropic_version||a?.system!==void 0?l.h.CLAUDE:l.h.OPENAI:l.h.OPENAI_RESPONSES}function n(a,b,c=m(a)){let d={...a};if(c===l.h.ANTIGRAVITY){let c={...a.request||{}};c.contents=[...c.contents||[],{role:"user",parts:[{text:b}]}],d.request=c}else c===l.h.GEMINI?d.contents=[...a.contents||[],{role:"user",parts:[{text:b}]}]:c===l.h.OPENAI_RESPONSES?d.input=[..."string"==typeof a.input?[{role:"user",content:a.input}]:[...a.input||[]],{role:"user",content:[{type:"input_text",text:b}]}]:d.messages=[...a.messages||[],{role:"user",content:b}];return d}function o(a){return(a||[]).filter(Boolean).map(a=>{if("tool"===a.role||"function"===a.role)return{role:"assistant",content:`[Tool result: ${(0,g.kU)(a.content)||String(a.content??"")}]`};if("assistant"===a.role&&Array.isArray(a.tool_calls)){let{tool_calls:b,...c}=a,d=b.map(a=>a?.function?.name||a?.name||"tool").join(", "),e=(0,g.kU)(c.content)||"";return{...c,content:`${e}${e?"\n":""}[Called tools: ${d}]`}}if(Array.isArray(a.content)&&a.content.some(a=>a?.type==="tool_use"||a?.type==="tool_result")){let b=a.content.map(a=>a?.text||(a?.type==="tool_use"?`[Called tool: ${a.name||"tool"}]`:a?.type==="tool_result"?`[Tool result: ${(0,g.kU)(a.content)}]`:"")).filter(Boolean).join("\n");return{...a,content:b}}return a})}function p(a,b=m(a)){let{tools:c,tool_choice:d,...e}=a,f={...e,stream:!1};return b===l.h.OPENAI_RESPONSES?Array.isArray(f.input)&&(f.input=o(f.input)):b===l.h.ANTIGRAVITY?f.request={...f.request||{},tools:void 0}:Array.isArray(f.messages)&&(f.messages=o(f.messages)),f}function q(a,b){let c=String(a||"");return c.length<=b?c:`${c.slice(0,b)}
2
2
  [truncated by combo budget]`}let r=[/you are (an? )?(expert|senior|principal|staff)?\s*(coding|programming|software|ai)\s*(assistant|agent|engineer|companion|specialist)/i,/you are (claude|cursor|cline|copilot|windsurf|aider|roo|cody|continue)/i,/your (primary )?(task|role|job|goal) is to (help|assist|act as)/i,/follow the user[''']?s instructions/i,/you are operating as (a |an )?(pair|interactive|autonomous)/i,/write (clean|idiomatic|production)[- ]ready code/i,/you have access to (a set of |various )?tools/i,/<environment|<context|<system_prompt>/i];function s(a){return!!a&&"string"==typeof a&&!(a.length<80)&&r.some(b=>b.test(a))}function t(a){if(!a)return a;let b={...a};for(let a of["messages","input"])Array.isArray(b[a])&&(b[a]=b[a].filter(a=>{var b;return a?.role!=="system"&&a?.role!=="developer"||!s("string"==typeof(b=a.content)?b:Array.isArray(b)?b.map(a=>"string"==typeof a?a:a?.text||"").join("\n"):"")}));if("string"==typeof b.system&&s(b.system))delete b.system;else if(Array.isArray(b.system)){let a=b.system.filter(a=>!(a?.type==="text"&&s(a.text)));b.system=a.length>0?a:void 0,void 0===b.system&&delete b.system}for(let a of["system_instruction","systemInstruction"]){let c=b[a];c&&s(Array.isArray(c.parts)?c.parts.map(a=>a?.text||"").join("\n"):"")&&delete b[a]}return b}let u={default:"You are a specialist worker in a swarm. Focus exclusively on your assigned subtask. Produce complete, production-ready output. Do not attempt other subtasks.",architecture:"You are a software architect. Design the structure, interfaces, and module boundaries for your assigned component. Prioritize clean separation of concerns.","game-logic":"You are a game-logic specialist. Implement mechanics, state machines, and rules with correctness and balance in mind.","data-layer":"You are a data/persistence specialist. Implement storage, schemas, serialization, and access patterns with integrity and performance in mind.",ui:"You are a UI/UX specialist. Build accessible, responsive interfaces with clean component structure.",testing:"You are a testing specialist. Write thorough tests covering happy paths, edge cases, and failure modes.",security:"You are a security specialist. Harden inputs, prevent injection/XSS, and enforce least-privilege.",devops:"You are a DevOps specialist. Handle deployment, configuration, and operational concerns."};function v(a){let b=u[a?.role]||u.default,c=a?.instruction||a?.title||"Complete your assigned subtask.";return["=== SWARM WORKER DIRECTIVE ===",b,"",`Subtask: ${a?.title||"Untitled"}`,"",c,"\nOutput ONLY your work for this subtask. Do not reference other workers or the orchestrator.\n=== END DIRECTIVE ==="].join("\n")}var w=c(36701);let x={workerHardTimeoutMs:9e4,workerQuorum:2,stragglerGraceMs:1e4,managerTimeoutMs:6e4,minWorkers:2,maxWorkers:8},y="=== SWARM GATEKEEPER ===\nYou are the GATEKEEPER of a hierarchical swarm. Classify the user's most recent request as SIMPLE or COMPLEX.\n\nSIMPLE = greeting, small talk, a factual question, a one-line clarification, or anything answerable in under ~50 tokens without decomposition.\nCOMPLEX = a coding task, multi-step build request, design problem, debugging session, or anything benefiting from decomposition into parallel specialist work.\n\nRespond with EXACTLY one line, nothing else:\nVERDICT: SIMPLE\nor\nVERDICT: COMPLEX";function z(a){return['=== SWARM MANAGER (STRATEGY) ===\nYou are the MANAGER of a hierarchical swarm. Analyze the user\'s request and produce a high-level execution strategy that decomposes it into independent parallel subtasks.\n\nRespond with ONLY a JSON object (no markdown fences, no prose) of this exact shape:\n{\n "assessment": "<1-2 sentence summary of what the request needs>",\n "subtasks": [\n { "id": 1, "title": "<short title>", "role": "<architecture|game-logic|data-layer|ui|testing|security|devops|default>", "instruction": "<detailed instruction for the specialist worker>" }\n ]\n}\n\nRules:\n- Aim for 2-5 subtasks. Each must be independently executable in parallel.\n- `role` must be one of the listed values; pick the best specialist fit.\n- `instruction` must be self-contained — a worker sees only its own subtask.\n- Do NOT include integration/assembly as a subtask; the Staff auditor + Manager synthesis handle that.\n\n=== USER REQUEST ===',a].join("\n")}function A(a){return["=== SWARM STAFF (AUDIT) ===\nYou are the STAFF auditor of a hierarchical swarm. Specialist workers have independently completed their assigned subtasks. Your job is to produce a TECHNICAL AUDIT REPORT that the Manager will use to synthesize the final answer.\n\nFor each worker output, evaluate:\n- Completeness: did it fulfill the subtask instruction?\n- Correctness: any bugs, type errors, logic flaws, or missing edge cases?\n- Consistency: naming conflicts, duplicated logic, or mismatched interfaces with other workers?\n- Integration risks: what will need reconciliation when combining outputs?\n\nThen provide a CONSOLIDATION PLAN: the order in which outputs should be merged, what conflicts to resolve, and what gaps remain.\n\n=== SUBTASKS & WORKER OUTPUTS ===",a.map(a=>{let b=a.output||"(worker did not produce output)";return`### Subtask ${a.id}: ${a.title}
3
3
  Role: ${a.role}
4
4
  Instruction: ${a.instruction}
5
5
 
6
6
  #### Worker Output
7
- ${b}`}).join("\n\n---\n\n"),"=== END ===\n\nNow write the technical audit report. Be concrete and specific. Reference subtask IDs."].join("\n")}function B(a,b){return["=== SWARM MANAGER (SYNTHESIS) ===\nYou are the MANAGER producing the FINAL ANSWER. A Staff auditor has reviewed the parallel worker outputs and produced a technical audit report below. Synthesize ONE cohesive, complete, production-quality answer for the user's original request.\n\nRules:\n- Resolve any conflicts the auditor flagged.\n- Integrate all worker outputs into a single coherent result (codebase, explanation, or both).\n- Do NOT mention the swarm, workers, audit, or that multiple agents were used. The user sees only your final answer.\n- Match the user's language and intent exactly.\n\n=== TECHNICAL AUDIT REPORT ===",a,"=== END AUDIT ===\n\n=== ORIGINAL USER REQUEST ===",b,"\nNow produce the final answer."].join("\n")}function C(a){for(let b of["messages","input"])if(Array.isArray(a[b]))for(let c=a[b].length-1;c>=0;c--){let d=a[b][c];if(d?.role==="user"){if("string"==typeof d.content)return d.content;if(Array.isArray(d.content))return d.content.map(a=>"string"==typeof a?a:a?.text||"").join("")}}if(Array.isArray(a.contents)){let b=a.contents[a.contents.length-1];if(b?.role==="user"&&Array.isArray(b.parts))return b.parts.map(a=>a?.text||"").join("")}return""}function D(a){if(!a)return null;let b=a.replace(/```json\s*/gi,"").replace(/```/g,"").trim(),c=b.indexOf("{"),d=b.lastIndexOf("}");if(-1!==c&&-1!==d&&d>c)try{let a=JSON.parse(b.slice(c,d+1));if(Array.isArray(a.subtasks)&&a.subtasks.length>0)return a}catch{}let e=[];for(let a of function*(a){let b=0,c=-1,d=!1,e=!1;for(let f=0;f<a.length;f++){let g=a[f];if(e){e=!1;continue}if("\\"===g){e=!0;continue}if('"'===g){d=!d;continue}!d&&("{"===g?(0===b&&(c=f),b++):"}"===g&&0==--b&&c>=0&&(yield a.slice(c,f+1),c=-1))}}(b))if(/"id"\s*:/.test(a))try{let b=JSON.parse(a);b&&(b.title||b.instruction||b.role)&&e.push({id:"number"==typeof b.id?b.id:e.length+1,title:b.title||`Subtask ${e.length+1}`,role:b.role||"default",instruction:b.instruction||b.title||""})}catch{}return e.length>0?{assessment:"(recovered from truncated output)",subtasks:e}:null}function E(a){let{tools:b,tool_choice:c,...d}=a,e={...d,stream:!1};return Array.isArray(e.messages)&&(e.messages=U(e.messages)),e}let F=new Map;async function G({runId:a,body:b,managerModel:c,handleSingleModel:d,cfg:e,log:f}){(0,w._5)(a,"gatekeeper",{model:c}),C(b);let g=_(t(E(b)),y);try{let b=await ab(d(g,c,{isPanel:!0,role:"gatekeeper"}),e.managerTimeoutMs);if(b?.__timeout||b?.__error)return(0,w.SH)(a,"gatekeeper",{verdict:"complex"}),H(c,f),"complex";let h=$(await b.clone().json().catch(()=>({}))),i=/VERDICT:\s*SIMPLE/i.test(h)?"simple":"complex";return(0,w.SH)(a,"gatekeeper",{verdict:i}),F.delete(c),f?.info?.("SWARM",`Gatekeeper verdict: ${i}`),i}catch(b){return f?.warn?.("SWARM",`Gatekeeper error, assuming complex: ${b?.message||b}`),(0,w.SH)(a,"gatekeeper",{verdict:"complex"}),H(c,f),"complex"}}function H(a,b){let c=(F.get(a)||0)+1;F.set(a,c),3===c&&b?.warn?.("SWARM",`Gatekeeper has failed ${c} consecutive times for ${a}. Every request is falling through to a full swarm pipeline — the manager model may be degraded.`)}async function I({runId:a,body:b,managerModel:c,handleSingleModel:d,cfg:e,log:f}){(0,w._5)(a,"manager",{model:c});let g=C(b),h=_(t(E(b)),z(g));try{let b=await ab(d(h,c,{isPanel:!0,role:"manager"}),e.managerTimeoutMs);if(b?.__timeout||b?.__error)return(0,w.SH)(a,"manager",{strategy:null}),null;let g=$(await b.clone().json().catch(()=>({}))),i=D(g);return(0,w.SH)(a,"manager",{strategy:i?{subtaskCount:i.subtasks.length}:null}),i||f?.warn?.("SWARM","Manager produced unparseable strategy"),i}catch(b){return f?.warn?.("SWARM",`Manager strategy error: ${b?.message||b}`),(0,w.SH)(a,"manager",{strategy:null}),null}}async function J({runId:a,strategy:b,models:c,body:d,handleSingleModel:e,cfg:f,log:g}){(0,w._5)(a,"workers",{workerCount:b.subtasks.length});let h=b.subtasks,i=c.filter(Boolean);if(0===i.length)return(0,w.SH)(a,"workers",{workers:[]}),[];let j=h.map((b,c)=>{let g=i[c%i.length],h=_(E(d),v(b));return(0,w.gF)(a,c,"running",{model:g}),ab(e(h,g,{isPanel:!0,role:"worker"}),f.workerHardTimeoutMs).then(async d=>{if(d?.__timeout||d?.__error)return(0,w.gF)(a,c,"error",{model:g}),{ok:!1,text:""};if(!d?.ok)return(0,w.gF)(a,c,"error",{model:g,status:d?.status}),{ok:!1,text:""};let e=$(await d.clone().json().catch(()=>({})));return(0,w.gF)(a,c,"done",{model:g,outputLen:e.length}),{ok:!0,text:e,subtask:b}}).catch(()=>((0,w.gF)(a,c,"error",{model:g}),{ok:!1,text:""}))}),k=await ac(j,{minPanel:Math.min(f.workerQuorum,j.length),stragglerGraceMs:f.stragglerGraceMs,panelHardTimeoutMs:f.workerHardTimeoutMs}),l=[];for(let a=0;a<k.length;a++){let b=k[a];b&&b.ok&&l.push({subtask:h[a],text:b.text})}return(0,w.SH)(a,"workers",{workers:k.map((a,b)=>({index:b,ok:!!a?.ok}))}),l}async function K({runId:a,strategy:b,workerOutputs:c,staffModel:d,auditModel:e,body:f,handleSingleModel:g,cfg:h,log:i}){let j=d||e;if(!j)return(0,w.SH)(a,"audit",{skipped:!0}),null;(0,w._5)(a,"audit",{model:j});let k=b.subtasks.map(a=>{let b=c.find(b=>b.subtask===a);return{...a,output:b?.text||"(no output)"}}),l=_(t(E(f)),A(k));try{let b=await ab(g(l,j,{isPanel:!0,role:"audit"}),h.managerTimeoutMs);if(b?.__timeout||b?.__error)return(0,w.SH)(a,"audit",{skipped:!0}),null;let c=$(await b.clone().json().catch(()=>({})));return(0,w.SH)(a,"audit",{reportLen:c.length}),c}catch(b){return i?.warn?.("SWARM",`Staff audit error: ${b?.message||b}`),(0,w.SH)(a,"audit",{skipped:!0}),null}}async function L({body:a,models:b,handleSingleModel:c,log:d,comboName:e,managerModel:f,staffModel:g,auditModel:h,workerCount:j,swarmTuning:k,telemetry:l=!0,signal:m,runBudget:n,principalId:o,autoScale:p}){let q=b.filter(Boolean);if(0===q.length)return new Response(JSON.stringify({error:"Swarm requires at least one worker model"}),{status:400});let r={...x,...k||{}},s=(f||"").trim()||q[0],t=C(a);if(1===q.length&&!f&&!g&&!h)return c(a,q[0],{role:"manager"});let u=(0,i.Ub)("swarm",{managerModel:f,staffModel:g,auditModel:h},q);if(u.length>0){let a=u.map(a=>a.reason).join(" ");return new Response(JSON.stringify({error:{message:`Swarm role validation failed: ${a}`,type:"capability_error"}}),{status:400,headers:{"Content-Type":"application/json"}})}let v=l?(0,w._s)({comboName:e,promptPreview:t,managerModel:s,staffModel:g,auditModel:h,workerCount:j||r.minWorkers}):null,y=v?.runId;try{let b,e=l?await G({runId:y,body:a,managerModel:s,handleSingleModel:c,cfg:r,log:d}):await M({body:a,managerModel:s,handleSingleModel:c,cfg:r,log:d});if("simple"===e)return d?.info?.("SWARM","Gatekeeper bypass — simple request, direct answer"),y&&(0,w.kA)(y,{bypassed:!0}),c(a,s,{role:"manager"});let f=l?await I({runId:y,body:a,managerModel:s,handleSingleModel:c,cfg:r,log:d}):await N({body:a,managerModel:s,handleSingleModel:c,cfg:r,log:d});if(!f||!Array.isArray(f.subtasks)||0===f.subtasks.length)return d?.warn?.("SWARM","Strategy decomposition failed — falling back to direct answer"),y&&(0,w.kA)(y,{fallback:!0}),c(a,s,{role:"manager"});p?.enabled?(b=Math.min(Math.max(f.subtasks.length,p.minWorkers||1),p.maxWorkers||r.maxWorkers),d?.info?.("SWARM",`Auto-scale: ${f.subtasks.length} subtasks → ${b} workers (${p.minWorkers||1}–${p.maxWorkers||r.maxWorkers})`)):b="number"==typeof j&&j>0?Math.min(j,r.maxWorkers):r.maxWorkers;let i=f.subtasks.slice(0,b),k=l?await J({runId:y,strategy:{subtasks:i},models:q,body:a,handleSingleModel:c,cfg:r,log:d}):await O({strategy:{subtasks:i},models:q,body:a,handleSingleModel:c,cfg:r,log:d});if(k.length<r.minWorkers){if(d?.warn?.("SWARM",`Only ${k.length}/${i.length} workers succeeded — fallback`),y&&(0,w.kA)(y,{fallback:!0}),1===k.length){let b=k[0].text||"";return c(_(a,`The specialist worker produced this answer for the subtask "${k[0].subtask?.title||""}". Output it verbatim to the user, adjusting only for formatting if needed:
7
+ ${b}`}).join("\n\n---\n\n"),"=== END ===\n\nNow write the technical audit report. Be concrete and specific. Reference subtask IDs."].join("\n")}function B(a,b){return["=== SWARM MANAGER (SYNTHESIS) ===\nYou are the MANAGER producing the FINAL ANSWER. A Staff auditor has reviewed the parallel worker outputs and produced a technical audit report below. Synthesize ONE cohesive, complete, production-quality answer for the user's original request.\n\nRules:\n- Resolve any conflicts the auditor flagged.\n- Integrate all worker outputs into a single coherent result (codebase, explanation, or both).\n- Do NOT mention the swarm, workers, audit, or that multiple agents were used. The user sees only your final answer.\n- Match the user's language and intent exactly.\n\n=== TECHNICAL AUDIT REPORT ===",a,"=== END AUDIT ===\n\n=== ORIGINAL USER REQUEST ===",b,"\nNow produce the final answer."].join("\n")}function C(a){for(let b of["messages","input"])if(Array.isArray(a[b]))for(let c=a[b].length-1;c>=0;c--){let d=a[b][c];if(d?.role==="user"){if("string"==typeof d.content)return d.content;if(Array.isArray(d.content))return d.content.map(a=>"string"==typeof a?a:a?.text||"").join("")}}if(Array.isArray(a.contents)){let b=a.contents[a.contents.length-1];if(b?.role==="user"&&Array.isArray(b.parts))return b.parts.map(a=>a?.text||"").join("")}return""}function D(a){if(!a)return null;let b=a.replace(/```json\s*/gi,"").replace(/```/g,"").trim(),c=b.indexOf("{"),d=b.lastIndexOf("}");if(-1!==c&&-1!==d&&d>c)try{let a=JSON.parse(b.slice(c,d+1));if(Array.isArray(a.subtasks)&&a.subtasks.length>0)return a}catch{}let e=[];for(let a of function*(a){let b=0,c=-1,d=!1,e=!1;for(let f=0;f<a.length;f++){let g=a[f];if(e){e=!1;continue}if("\\"===g){e=!0;continue}if('"'===g){d=!d;continue}!d&&("{"===g?(0===b&&(c=f),b++):"}"===g&&0==--b&&c>=0&&(yield a.slice(c,f+1),c=-1))}}(b))if(/"id"\s*:/.test(a))try{let b=JSON.parse(a);b&&(b.title||b.instruction||b.role)&&e.push({id:"number"==typeof b.id?b.id:e.length+1,title:b.title||`Subtask ${e.length+1}`,role:b.role||"default",instruction:b.instruction||b.title||""})}catch{}return e.length>0?{assessment:"(recovered from truncated output)",subtasks:e}:null}function E(a){let{tools:b,tool_choice:c,...d}=a,e={...d,stream:!1};return Array.isArray(e.messages)&&(e.messages=U(e.messages)),e}let F=new Map;async function G({runId:a,body:b,managerModel:c,handleSingleModel:d,cfg:e,log:f}){(0,w._5)(a,"gatekeeper",{model:c}),C(b);let g=_(t(E(b)),y);try{let b=await ab(d(g,c,{isPanel:!0,role:"gatekeeper"}),e.managerTimeoutMs);if(b?.__timeout||b?.__error)return(0,w.SH)(a,"gatekeeper",{verdict:"complex"}),H(c,f),"complex";let h=$(await b.clone().json().catch(()=>({}))),i=/VERDICT:\s*SIMPLE/i.test(h)?"simple":"complex";return(0,w.SH)(a,"gatekeeper",{verdict:i}),F.delete(c),f?.info?.("SWARM",`Gatekeeper verdict: ${i}`),i}catch(b){return f?.warn?.("SWARM",`Gatekeeper error, assuming complex: ${b?.message||b}`),(0,w.SH)(a,"gatekeeper",{verdict:"complex"}),H(c,f),"complex"}}function H(a,b){let c=(F.get(a)||0)+1;F.set(a,c),3===c&&b?.warn?.("SWARM",`Gatekeeper has failed ${c} consecutive times for ${a}. Every request is falling through to a full swarm pipeline — the manager model may be degraded.`)}async function I({runId:a,body:b,managerModel:c,handleSingleModel:d,cfg:e,log:f}){(0,w._5)(a,"manager",{model:c});let g=C(b),h=_(t(E(b)),z(g));try{let b=await ab(d(h,c,{isPanel:!0,role:"manager"}),e.managerTimeoutMs);if(b?.__timeout||b?.__error)return(0,w.SH)(a,"manager",{strategy:null}),null;let g=$(await b.clone().json().catch(()=>({}))),i=D(g);return(0,w.SH)(a,"manager",{strategy:i?{subtaskCount:i.subtasks.length}:null}),i||f?.warn?.("SWARM","Manager produced unparseable strategy"),i}catch(b){return f?.warn?.("SWARM",`Manager strategy error: ${b?.message||b}`),(0,w.SH)(a,"manager",{strategy:null}),null}}async function J({runId:a,strategy:b,models:c,body:d,handleSingleModel:e,cfg:f,log:g,runBudget:h}){(0,w._5)(a,"workers",{workerCount:b.subtasks.length});let i=b.subtasks,j=c.filter(Boolean);if(0===j.length)return(0,w.SH)(a,"workers",{workers:[]}),[];let k=i.map((b,c)=>{let g=j[c%j.length],i=_(E(d),v(b));return(0,w.gF)(a,c,"running",{model:g}),ab(e(i,g,{isPanel:!0,role:"worker"}),f.workerHardTimeoutMs).then(async d=>{if(d?.__timeout||d?.__error)return(0,w.gF)(a,c,"error",{model:g}),{ok:!1,text:""};if(!d?.ok)return(0,w.gF)(a,c,"error",{model:g,status:d?.status}),{ok:!1,text:""};let e=$(await d.clone().json().catch(()=>({}))),f=h?h.clampOutput(e):e;return e&&!f?((0,w.gF)(a,c,"error",{model:g,reason:"over_budget"}),{ok:!1,text:""}):((0,w.gF)(a,c,"done",{model:g,outputLen:f.length}),{ok:!0,text:f,subtask:b})}).catch(()=>((0,w.gF)(a,c,"error",{model:g}),{ok:!1,text:""}))}),l=await ac(k,{minPanel:Math.min(f.workerQuorum,k.length),stragglerGraceMs:f.stragglerGraceMs,panelHardTimeoutMs:f.workerHardTimeoutMs}),m=[];for(let a=0;a<l.length;a++){let b=l[a];b&&b.ok&&m.push({subtask:i[a],text:b.text})}return(0,w.SH)(a,"workers",{workers:l.map((a,b)=>({index:b,ok:!!a?.ok}))}),m}async function K({runId:a,strategy:b,workerOutputs:c,staffModel:d,auditModel:e,body:f,handleSingleModel:g,cfg:h,log:i,runBudget:j}){let k=d||e;if(!k)return(0,w.SH)(a,"audit",{skipped:!0}),null;(0,w._5)(a,"audit",{model:k});let l=b.subtasks.map(a=>{let b=c.find(b=>b.subtask===a);return{...a,output:b?.text||"(no output)"}}),m=_(t(E(f)),A(l));try{let b=await ab(g(m,k,{isPanel:!0,role:"audit"}),h.managerTimeoutMs);if(b?.__timeout||b?.__error)return(0,w.SH)(a,"audit",{skipped:!0}),null;let c=$(await b.clone().json().catch(()=>({})));return(0,w.SH)(a,"audit",{reportLen:c.length}),j?j.clampOutput(c):c}catch(b){return i?.warn?.("SWARM",`Staff audit error: ${b?.message||b}`),(0,w.SH)(a,"audit",{skipped:!0}),null}}async function L({body:a,models:b,handleSingleModel:c,log:d,comboName:e,managerModel:f,staffModel:g,auditModel:h,workerCount:j,swarmTuning:k,telemetry:l=!0,signal:m,runBudget:n,principalId:o,autoScale:p}){let q=b.filter(Boolean);if(0===q.length)return new Response(JSON.stringify({error:"Swarm requires at least one worker model"}),{status:400});let r={...x,...k||{}},s=(f||"").trim()||q[0],t=C(a);if(1===q.length&&!f&&!g&&!h)return c(a,q[0],{role:"manager"});let u=(0,i.Ub)("swarm",{managerModel:f,staffModel:g,auditModel:h},q);if(u.length>0){let a=u.map(a=>a.reason).join(" ");return new Response(JSON.stringify({error:{message:`Swarm role validation failed: ${a}`,type:"capability_error"}}),{status:400,headers:{"Content-Type":"application/json"}})}let v=l?(0,w._s)({comboName:e,promptPreview:t,managerModel:s,staffModel:g,auditModel:h,workerCount:j||r.minWorkers}):null,y=v?.runId;try{let b,e=l?await G({runId:y,body:a,managerModel:s,handleSingleModel:c,cfg:r,log:d}):await M({body:a,managerModel:s,handleSingleModel:c,cfg:r,log:d});if("simple"===e)return d?.info?.("SWARM","Gatekeeper bypass — simple request, direct answer"),y&&(0,w.kA)(y,{bypassed:!0}),c(a,s,{role:"manager"});let f=l?await I({runId:y,body:a,managerModel:s,handleSingleModel:c,cfg:r,log:d}):await N({body:a,managerModel:s,handleSingleModel:c,cfg:r,log:d});if(!f||!Array.isArray(f.subtasks)||0===f.subtasks.length)return d?.warn?.("SWARM","Strategy decomposition failed — falling back to direct answer"),y&&(0,w.kA)(y,{fallback:!0}),c(a,s,{role:"manager"});p?.enabled?(b=Math.min(Math.max(f.subtasks.length,p.minWorkers||1),p.maxWorkers||r.maxWorkers),d?.info?.("SWARM",`Auto-scale: ${f.subtasks.length} subtasks → ${b} workers (${p.minWorkers||1}–${p.maxWorkers||r.maxWorkers})`)):b="number"==typeof j&&j>0?Math.min(j,r.maxWorkers):r.maxWorkers;let i=f.subtasks.slice(0,b),k=l?await J({runId:y,strategy:{subtasks:i},models:q,body:a,handleSingleModel:c,cfg:r,log:d,runBudget:n}):await O({strategy:{subtasks:i},models:q,body:a,handleSingleModel:c,cfg:r,log:d,runBudget:n});if(k.length<r.minWorkers){if(d?.warn?.("SWARM",`Only ${k.length}/${i.length} workers succeeded — fallback`),y&&(0,w.kA)(y,{fallback:!0}),1===k.length){let b=k[0].text||"";return c(_(a,`The specialist worker produced this answer for the subtask "${k[0].subtask?.title||""}". Output it verbatim to the user, adjusting only for formatting if needed:
8
8
 
9
- ${b}`),s,{role:"manager"})}return c(a,s,{role:"manager"})}let m=l?await K({runId:y,strategy:{subtasks:i},workerOutputs:k,staffModel:g,auditModel:h,body:a,handleSingleModel:c,cfg:r,log:d}):await P({strategy:{subtasks:i},workerOutputs:k,staffModel:g,auditModel:h,body:a,handleSingleModel:c,cfg:r,log:d}),n=m?B(m,t):B(k.map(a=>a.text).join("\n\n---\n\n"),t),o=_(a,n);if(d?.info?.("SWARM",`Synthesizing final answer from ${k.length} worker outputs`),y){(0,w._5)(y,"synthesis",{model:s});let a=await c(o,s,{role:"manager"});if(a?.body){let b=a.body,c=new ReadableStream({start(a){let c=b.getReader(),d=()=>c.read().then(({done:b,value:c})=>{if(b){a.close(),(0,w.SH)(y,"synthesis"),(0,w.kA)(y,{workerCount:k.length});return}return a.enqueue(c),d()}).catch(()=>{try{a.close()}catch{}(0,w.SH)(y,"synthesis"),(0,w.kA)(y,{workerCount:k.length})});d()},cancel(a){(0,w.SH)(y,"synthesis"),(0,w.kA)(y,{workerCount:k.length})}});return new Response(c,{status:a.status,statusText:a.statusText,headers:a.headers})}return(0,w.SH)(y,"synthesis"),(0,w.kA)(y,{workerCount:k.length}),a}return c(o,s,{role:"manager"})}catch(b){return d?.error?.("SWARM",`Swarm failed: ${b?.message||b}`),y&&(0,w.bt)(y,b),c(a,s,{role:"manager"})}}async function M({body:a,managerModel:b,handleSingleModel:c,cfg:d,log:e}){let f=_(t(E(a)),y);try{let a=await ab(c(f,b,{isPanel:!0,role:"gatekeeper"}),d.managerTimeoutMs);if(a?.__timeout||a?.__error)return"complex";let e=$(await a.clone().json().catch(()=>({})));return/VERDICT:\s*SIMPLE/i.test(e)?"simple":"complex"}catch{return"complex"}}async function N({body:a,managerModel:b,handleSingleModel:c,cfg:d,log:e}){let f=C(a),g=_(t(E(a)),z(f));try{let a=await ab(c(g,b,{isPanel:!0,role:"manager"}),d.managerTimeoutMs);if(a?.__timeout||a?.__error)return null;let e=$(await a.clone().json().catch(()=>({})));return D(e)}catch{return null}}async function O({strategy:a,models:b,body:c,handleSingleModel:d,cfg:e}){let f=b.filter(Boolean);if(0===f.length)return[];let g=a.subtasks.map((a,b)=>{let g=f[b%f.length];return ab(d(_(E(c),v(a)),g,{isPanel:!0,role:"worker"}),e.workerHardTimeoutMs).then(async b=>b?.__timeout||b?.__error||!b?.ok?{ok:!1,text:""}:{ok:!0,text:$(await b.clone().json().catch(()=>({}))),subtask:a}).catch(()=>({ok:!1,text:""}))}),h=await ac(g,{minPanel:Math.min(e.workerQuorum,g.length),stragglerGraceMs:e.stragglerGraceMs,panelHardTimeoutMs:e.workerHardTimeoutMs}),i=[];for(let a of h)a&&a.ok&&a.text&&i.push({subtask:a.subtask,text:a.text});return i}async function P({strategy:a,workerOutputs:b,staffModel:c,auditModel:d,body:e,handleSingleModel:f,cfg:g}){let h=c||d;if(!h)return null;let i=a.subtasks.map(a=>{let c=b.find(b=>b.subtask===a);return{...a,output:c?.text||"(no output)"}}),j=_(t(E(e)),A(i));try{let a=await ab(f(j,h,{isPanel:!0,role:"audit"}),g.managerTimeoutMs);if(a?.__timeout||a?.__error)return null;return $(await a.clone().json().catch(()=>({})))}catch{return null}}let Q=new Set(["vision","pdf","audioInput","videoInput"]);async function R(a,b){if(!Array.isArray(a)||a.length<=1)return{active:a||[],skipped:[]};let d=[],e=[];for(let f of a){let a="string"==typeof f?f.indexOf("/"):-1,g=a>0?f.slice(0,a):"",i=g?(0,j.g2)(g):"";if(i&&(0,h.GK)(i,b))e.push(f);else if(i){let a=null;try{let{getProviderHealth:b}=await c.e(5628).then(c.bind(c,15628));a=b(i)}catch{}a&&a.total>=10&&null!==a.successRate&&a.successRate<.5?e.push(f):d.push(f)}else d.push(f)}return 0===d.length?{active:a,skipped:[]}:{active:d,skipped:e}}let S="[Called tools: ",T="[Tool result: ";function U(a){return a.filter(a=>a).map(a=>{if("tool"===a.role||"function"===a.role)return{role:"assistant",content:`${T}${(0,g.kU)(a.content)||String(a.content??"")}]`};if("assistant"===a.role&&Array.isArray(a.tool_calls)){let{tool_calls:b,...c}=a,d=b.map(a=>a?.function?.name||a?.name||"tool").join(", "),e=(0,g.kU)(c.content)||("string"==typeof c.content?c.content:"");return{...c,content:`${e}${e?"\n":""}${S}${d}]`}}if(Array.isArray(a.content)){let b=a.content.some(a=>"tool_use"===a.type),c=a.content.some(a=>"tool_result"===a.type);if(b||c){let b=[],c=[],d=[];for(let e of a.content)"text"===e.type&&e.text&&b.push(e.text),"tool_use"===e.type&&c.push(e.name||"tool"),"tool_result"===e.type&&d.push((0,g.kU)(e.content)||String(e.content??""));let{...e}=a,f=b.join("\n");return c.length>0&&(f=`${f}${f?"\n":""}${S}${c.join(", ")}]`),d.length>0&&(f=`${f}${f?"\n":""}${T}${d.join("\n")}]`),{...e,content:f}}}return a})}let V=new Map;function W(a){if(!Array.isArray(a)||0===a.length)return[];let b=a=>"assistant"===a||"model"===a,c=a.length-1;for(;c>=0&&!b(a[c]?.role);)c--;return a.slice(c+1)}function X(a){a?V.delete(a):V.clear()}function Y(a,b){if(a.includes("/"))return null;let c=(Array.isArray(b)?b:b?.combos||[]).find(b=>b.name===a);return c&&c.models&&c.models.length>0?c.models:null}async function Z({body:a,models:b,handleSingleModel:c,log:g,comboName:h,comboStrategy:i,comboStickyLimit:k=1,autoSwitch:l=!0,breakerSettings:m=null,signal:n,runBudget:o}){let p=function(a,b,c,d=1){let e;if(!a||a.length<=1||"round-robin"!==c)return a;let f=b||"__default__",g=Number.isFinite(e=Number.parseInt(d,10))&&e>0?e:1,h=V.get(f)||{index:0,consecutiveUseCount:0},i=h.index%a.length,j=function(a,b){let c=[...a];for(let a=0;a<b;a++){let a=c.shift();c.push(a)}return c}(a,i),k=h.consecutiveUseCount+1;return k>=g?V.set(f,{index:(i+1)%a.length,consecutiveUseCount:0}):V.set(f,{index:i,consecutiveUseCount:k}),j}(b,h,i,k);if(m){let{active:a,skipped:b}=await R(p,m);b.length>0&&(g.info("COMBO",`breaker pre-filter: skipped ${b.length} open-breaker model(s) [${b.join(", ")}]`),p=a)}if(l){let b=function(a){let b=new Set;if(!a||"object"!=typeof a)return b;let c=a=>{if(!a||"object"!=typeof a)return;let c=a.type;("image_url"===c||"image"===c||"input_image"===c)&&b.add("vision"),("file"===c||"document"===c||"input_file"===c)&&b.add("pdf");let d=a.inlineData?.mimeType||a.fileData?.mimeType;"string"==typeof d&&d.startsWith("image/")&&b.add("vision"),"application/pdf"===d&&b.add("pdf")},d=a=>{if(Array.isArray(a))for(let b of a)c(b)};for(let b of W(a.messages))d(b.content);for(let b of W(a.input))d(b.content);for(let b of W(a.contents||a.request?.contents))d(b.parts);return b}(a);if(b.size>0){let a=function(a,b){if(!b||0===b.size||!Array.isArray(a)||a.length<=1)return a;let c=[...b].filter(a=>Q.has(a)),d=[...b].filter(a=>!Q.has(a));return a.map((a,b)=>{let e,g,h,i;return{m:a,i:b,t:(g=(e="string"==typeof a?a.indexOf("/"):-1)>0?(0,j.g2)(a.slice(0,e)):"",h=e>0?a.slice(e+1):a,i=(0,f.nl)(g,h),c.every(a=>!0===i[a])?+!d.every(a=>!0===i[a]):2)}}).sort((a,b)=>a.t-b.t||a.i-b.i).map(a=>a.m)}(p,b);a[0]!==p[0]&&g.info("COMBO",`auto-switch for [${[...b].join(",")}] → ${a[0]}`),p=a}}let q=null,r=null,s=null;for(let b=0;b<p.length;b++){let e=p[b];g.info("COMBO",`Trying model ${b+1}/${p.length}: ${e}`);try{let b=await c(a,e,{role:"worker"});if(b.ok)return g.info("COMBO",`Model ${e} succeeded`),b;let f=b.statusText||"",h=null;try{let a=await b.clone().json();f=a?.error?.message||a?.error||a?.message||f,h=a?.retryAfter||null}catch{}if(h&&(!r||new Date(h)<new Date(r))&&(r=h),"string"!=typeof f)try{f=JSON.stringify(f)}catch{f=String(f)}let{shouldFallback:i,cooldownMs:j}=[400,405,406,413,415,422].includes(b.status)?{shouldFallback:!1,cooldownMs:0}:(0,d.hk)(b.status,f);if(!i)return g.warn("COMBO",`Model ${e} failed (no fallback)`,{status:b.status}),b;j&&j>0&&j<=5e3&&(503===b.status||502===b.status||504===b.status)&&(g.info("COMBO",`Model ${e} transient ${b.status}, waiting ${j}ms before next`),await new Promise(a=>setTimeout(a,j))),q=f||String(b.status),s||(s=b.status),g.warn("COMBO",`Model ${e} failed, trying next`,{status:b.status})}catch(a){q=a.message||String(a),s||(s=500),g.warn("COMBO",`Model ${e} threw error, trying next`,{error:q})}}let t=q&&q.toLowerCase().includes("no credentials")?503:s||503,u=q||"All combo models unavailable";if(r){let a=(0,d.Qo)(r);return g.warn("COMBO",`All models failed | ${u} (${a})`),(0,e.wO)(t,u,r,a)}return g.warn("COMBO",`All models failed | ${u}`),new Response(JSON.stringify({error:{message:u,type:"server_error",code:"all_models_failed"}}),{status:t,headers:{"Content-Type":"application/json"}})}function $(a){if(!a||"object"!=typeof a)return"";let b=a.choices?.[0];if(b){let a=b.message??b.delta??{},c=(0,g.kU)(a.content);if(c.trim())return c;if("string"==typeof b.text&&b.text.trim())return b.text}let c=(0,g.kU)(a.content);if(c.trim())return c;let d=a.candidates?.[0]?.content?.parts;if(Array.isArray(d)){let a=d.map(a=>a?.text||"").join("");if(a.trim())return a}if(Array.isArray(a.output)){let b=a.output.flatMap(a=>Array.isArray(a.content)?a.content.map(a=>a?.text||""):[]).join("");if(b.trim())return b}return""}function _(a,b){let c={...a};return Array.isArray(a.messages)?c.messages=[...a.messages,{role:"user",content:b}]:Array.isArray(a.input)?c.input=[...a.input,{role:"user",content:b}]:Array.isArray(a.contents)?c.contents=[...a.contents,{role:"user",parts:[{text:b}]}]:c.messages=[{role:"user",content:b}],c}let aa={minPanel:2,stragglerGraceMs:8e3,panelHardTimeoutMs:9e4};function ab(a,b,c){return"function"==typeof a?k(a,b,c).promise:new Promise(c=>{let d=setTimeout(()=>c({__timeout:!0}),b);Promise.resolve(a).then(a=>{clearTimeout(d),c(a)}).catch(a=>{clearTimeout(d),c({__error:a})})})}function ac(a,{minPanel:b,stragglerGraceMs:c,panelHardTimeoutMs:d,onFinish:e}){return new Promise(f=>{let g=Array(a.length),h=0,i=0,j=!1,k=null,l=()=>{j||(j=!0,clearTimeout(m),k&&clearTimeout(k),e?.(),f(g))},m=setTimeout(l,d);a.forEach((d,e)=>{Promise.resolve(d).then(a=>{g[e]=a}).catch(a=>{g[e]={__error:a}}).finally(()=>{if(h++,g[e]&&g[e].ok&&i++,h===a.length)return l();i>=b&&!k&&(k=setTimeout(l,c))})})})}async function ad({body:a,models:b,handleSingleModel:c,log:d,comboName:e,judgeModel:f,tuning:g,signal:h,runBudget:j}){let l,o=Array.isArray(b)?b.filter(Boolean):[];if(0===o.length)return new Response(JSON.stringify({error:{message:"Fusion combo has no models"}}),{status:400,headers:{"Content-Type":"application/json"}});if(1===o.length)return c(a,o[0],{role:"judge"});let r=(0,i.Ub)("fusion",{judgeModel:f},o);if(r.length>0){let a=r.map(a=>a.reason).join(" ");return new Response(JSON.stringify({error:{message:`Fusion role validation failed: ${a}`,type:"capability_error"}}),{status:400,headers:{"Content-Type":"application/json"}})}let s={...aa,...g||{}},t=Math.min(Math.max(2,s.minPanel),o.length),u=f&&f.trim()?f.trim():o[0];d.info("FUSION",`Combo "${e}" | panel=${o.length} [${o.join(", ")}] | judge=${u} | quorum=${t}`);let v=m(a),w=p(a,v),x=o.map(a=>k(b=>c(w,a,{isPanel:!0,signal:b,trafficClass:"panel",role:"panel"}),s.panelHardTimeoutMs,h)),y=Date.now(),z=await ac(x.map(a=>a.promise),{...s,minPanel:t,onFinish:()=>x.forEach(a=>a.abort("fusion panel closed"))});x.forEach(a=>a.cleanup()),d.info("FUSION",`fan-out collected in ${Date.now()-y}ms`);let A=[];for(let a=0;a<z.length;a++){let b=z[a],c=o[a];if(!b){d.warn("FUSION",`Panel ${c} dropped (straggler/timeout)`);continue}if(b.__timeout){d.warn("FUSION",`Panel ${c} timed out`);continue}if(b.__error){d.warn("FUSION",`Panel ${c} threw`,{error:b.__error?.message||String(b.__error)});continue}if(!b.ok){d.warn("FUSION",`Panel ${c} failed`,{status:b.status});continue}try{let a=await b.clone().json(),e=$(a);if(e){let a=j?j.clampOutput(e):e;if(!a){d.warn("FUSION",`Panel ${c} exceeded output budget`);continue}A.push({model:c,text:a,res:b}),d.info("FUSION",`Panel ${c} ok (${e.length} chars)`)}else d.warn("FUSION",`Panel ${c} returned empty content`)}catch(a){d.warn("FUSION",`Panel ${c} unparseable`,{error:a.message||String(a)})}}if(0===A.length)return d.warn("FUSION","All panel models failed"),new Response(JSON.stringify({error:{message:"All fusion panel models failed"}}),{status:503,headers:{"Content-Type":"application/json"}});if(1===A.length)return a?.stream===!0?(d.info("FUSION",`Only ${A[0].model} succeeded — re-running with stream:true to honor client SSE request (no fusion)`),c(a,A[0].model,{role:"panel",signal:h,trafficClass:"user"})):(d.info("FUSION",`Only ${A[0].model} succeeded — returning its response directly (no fusion, no re-run)`),A[0].res);let B=j?.limits?.maxOutputChars||12e4,C=n(a,q((l=A.map((a,b)=>`[Source ${b+1}]
10
- ${a.text}`).join("\n\n"),[`You are the JUDGE in a model-fusion panel. ${A.length} expert models independently answered the user's most recent request. Their responses are below, anonymized by source.`,"\nDo NOT mention that multiple models were used, and do NOT refer to the sources. Produce ONE authoritative final answer addressed directly to the user.\n\nFirst, internally analyze the panel along these dimensions: consensus (points most sources agree on — treat as higher-confidence), contradictions (where they disagree — resolve with your own judgment), partial coverage, unique insights only one source surfaced, and blind spots every source missed. Then write the best possible final answer grounded in that analysis — more complete and correct than any single response, with no filler.\n\n=== PANEL RESPONSES ===",l,"=== END PANEL RESPONSES ===\n\nNow write the final answer to the user's original request."].join("\n")),B),v);return d.info("FUSION",`Judging ${A.length} answers with ${u}`),c(C,u,{role:"judge",signal:h,trafficClass:"user"})}let ae={confidenceThreshold:70,confidencePrompt:"Rate your confidence in this answer from 0 to 100. End your response with exactly: CONFIDENCE: <number>",escalatePrompt:"A prior model gave the following answer with low confidence. Review it, correct any issues, and provide a better answer.",maxStages:3};async function af({body:a,models:b,handleSingleModel:c,log:d,comboName:e,tuning:f,signal:g}){let h=Array.isArray(b)?b.filter(Boolean):[];if(0===h.length)return new Response(JSON.stringify({error:{message:"Cascade combo has no models"}}),{status:400,headers:{"Content-Type":"application/json"}});let i={...ae,...f||{}},j=Math.min(Math.max(1,i.maxStages),h.length),k=m(a),l=p(a,k),o=null,r=null;for(let a=0;a<j;a++){var s;let b,e=h[a],f=a===j-1,m=l;m=null!=o?n(m,`${i.escalatePrompt}
9
+ ${b}`),s,{role:"manager"})}return c(a,s,{role:"manager"})}let m=l?await K({runId:y,strategy:{subtasks:i},workerOutputs:k,staffModel:g,auditModel:h,body:a,handleSingleModel:c,cfg:r,log:d,runBudget:n}):await P({strategy:{subtasks:i},workerOutputs:k,staffModel:g,auditModel:h,body:a,handleSingleModel:c,cfg:r,log:d,runBudget:n}),o=m?B(m,t):B(k.map(a=>a.text).join("\n\n---\n\n"),t),u=_(a,o);if(d?.info?.("SWARM",`Synthesizing final answer from ${k.length} worker outputs`),y){(0,w._5)(y,"synthesis",{model:s});let a=await c(u,s,{role:"manager"});if(a?.body){let b=a.body,c=new ReadableStream({start(a){let c=b.getReader(),d=()=>c.read().then(({done:b,value:c})=>{if(b){a.close(),(0,w.SH)(y,"synthesis"),(0,w.kA)(y,{workerCount:k.length});return}return a.enqueue(c),d()}).catch(()=>{try{a.close()}catch{}(0,w.SH)(y,"synthesis"),(0,w.kA)(y,{workerCount:k.length})});d()},cancel(a){(0,w.SH)(y,"synthesis"),(0,w.kA)(y,{workerCount:k.length})}});return new Response(c,{status:a.status,statusText:a.statusText,headers:a.headers})}return(0,w.SH)(y,"synthesis"),(0,w.kA)(y,{workerCount:k.length}),a}return c(u,s,{role:"manager"})}catch(b){return d?.error?.("SWARM",`Swarm failed: ${b?.message||b}`),y&&(0,w.bt)(y,b),c(a,s,{role:"manager"})}}async function M({body:a,managerModel:b,handleSingleModel:c,cfg:d,log:e}){let f=_(t(E(a)),y);try{let a=await ab(c(f,b,{isPanel:!0,role:"gatekeeper"}),d.managerTimeoutMs);if(a?.__timeout||a?.__error)return"complex";let e=$(await a.clone().json().catch(()=>({})));return/VERDICT:\s*SIMPLE/i.test(e)?"simple":"complex"}catch{return"complex"}}async function N({body:a,managerModel:b,handleSingleModel:c,cfg:d,log:e}){let f=C(a),g=_(t(E(a)),z(f));try{let a=await ab(c(g,b,{isPanel:!0,role:"manager"}),d.managerTimeoutMs);if(a?.__timeout||a?.__error)return null;let e=$(await a.clone().json().catch(()=>({})));return D(e)}catch{return null}}async function O({strategy:a,models:b,body:c,handleSingleModel:d,cfg:e,log:f,runBudget:g}){let h=b.filter(Boolean);if(0===h.length)return[];let i=a.subtasks.map((a,b)=>{let f=h[b%h.length];return ab(d(_(E(c),v(a)),f,{isPanel:!0,role:"worker"}),e.workerHardTimeoutMs).then(async b=>{if(b?.__timeout||b?.__error||!b?.ok)return{ok:!1,text:""};let c=$(await b.clone().json().catch(()=>({}))),d=g?g.clampOutput(c):c;return c&&!d?{ok:!1,text:""}:{ok:!0,text:d,subtask:a}}).catch(()=>({ok:!1,text:""}))}),j=await ac(i,{minPanel:Math.min(e.workerQuorum,i.length),stragglerGraceMs:e.stragglerGraceMs,panelHardTimeoutMs:e.workerHardTimeoutMs}),k=[];for(let a of j)a&&a.ok&&a.text&&k.push({subtask:a.subtask,text:a.text});return k}async function P({strategy:a,workerOutputs:b,staffModel:c,auditModel:d,body:e,handleSingleModel:f,cfg:g,log:h,runBudget:i}){let j=c||d;if(!j)return null;let k=a.subtasks.map(a=>{let c=b.find(b=>b.subtask===a);return{...a,output:c?.text||"(no output)"}}),l=_(t(E(e)),A(k));try{let a=await ab(f(l,j,{isPanel:!0,role:"audit"}),g.managerTimeoutMs);if(a?.__timeout||a?.__error)return null;let b=$(await a.clone().json().catch(()=>({})));return i?i.clampOutput(b):b}catch{return null}}let Q=new Set(["vision","pdf","audioInput","videoInput"]);async function R(a,b){if(!Array.isArray(a)||a.length<=1)return{active:a||[],skipped:[]};let d=[],e=[];for(let f of a){let a="string"==typeof f?f.indexOf("/"):-1,g=a>0?f.slice(0,a):"",i=g?(0,j.g2)(g):"";if(i&&(0,h.GK)(i,b))e.push(f);else if(i){let a=null;try{let{getProviderHealth:b}=await c.e(5628).then(c.bind(c,15628));a=b(i)}catch{}a&&a.total>=10&&null!==a.successRate&&a.successRate<.5?e.push(f):d.push(f)}else d.push(f)}return 0===d.length?{active:a,skipped:[]}:{active:d,skipped:e}}let S="[Called tools: ",T="[Tool result: ";function U(a){return a.filter(a=>a).map(a=>{if("tool"===a.role||"function"===a.role)return{role:"assistant",content:`${T}${(0,g.kU)(a.content)||String(a.content??"")}]`};if("assistant"===a.role&&Array.isArray(a.tool_calls)){let{tool_calls:b,...c}=a,d=b.map(a=>a?.function?.name||a?.name||"tool").join(", "),e=(0,g.kU)(c.content)||("string"==typeof c.content?c.content:"");return{...c,content:`${e}${e?"\n":""}${S}${d}]`}}if(Array.isArray(a.content)){let b=a.content.some(a=>"tool_use"===a.type),c=a.content.some(a=>"tool_result"===a.type);if(b||c){let b=[],c=[],d=[];for(let e of a.content)"text"===e.type&&e.text&&b.push(e.text),"tool_use"===e.type&&c.push(e.name||"tool"),"tool_result"===e.type&&d.push((0,g.kU)(e.content)||String(e.content??""));let{...e}=a,f=b.join("\n");return c.length>0&&(f=`${f}${f?"\n":""}${S}${c.join(", ")}]`),d.length>0&&(f=`${f}${f?"\n":""}${T}${d.join("\n")}]`),{...e,content:f}}}return a})}let V=new Map;function W(a){if(!Array.isArray(a)||0===a.length)return[];let b=a=>"assistant"===a||"model"===a,c=a.length-1;for(;c>=0&&!b(a[c]?.role);)c--;return a.slice(c+1)}function X(a){a?V.delete(a):V.clear()}function Y(a,b){if(a.includes("/"))return null;let c=(Array.isArray(b)?b:b?.combos||[]).find(b=>b.name===a);return c&&c.models&&c.models.length>0?c.models:null}async function Z({body:a,models:b,handleSingleModel:c,log:g,comboName:h,comboStrategy:i,comboStickyLimit:k=1,autoSwitch:l=!0,breakerSettings:m=null,signal:n,runBudget:o}){let p=function(a,b,c,d=1){let e;if(!a||a.length<=1||"round-robin"!==c)return a;let f=b||"__default__",g=Number.isFinite(e=Number.parseInt(d,10))&&e>0?e:1,h=V.get(f)||{index:0,consecutiveUseCount:0},i=h.index%a.length,j=function(a,b){let c=[...a];for(let a=0;a<b;a++){let a=c.shift();c.push(a)}return c}(a,i),k=h.consecutiveUseCount+1;return k>=g?V.set(f,{index:(i+1)%a.length,consecutiveUseCount:0}):V.set(f,{index:i,consecutiveUseCount:k}),j}(b,h,i,k);if(m){let{active:a,skipped:b}=await R(p,m);b.length>0&&(g.info("COMBO",`breaker pre-filter: skipped ${b.length} open-breaker model(s) [${b.join(", ")}]`),p=a)}if(l){let b=function(a){let b=new Set;if(!a||"object"!=typeof a)return b;let c=a=>{if(!a||"object"!=typeof a)return;let c=a.type;("image_url"===c||"image"===c||"input_image"===c)&&b.add("vision"),("file"===c||"document"===c||"input_file"===c)&&b.add("pdf");let d=a.inlineData?.mimeType||a.fileData?.mimeType;"string"==typeof d&&d.startsWith("image/")&&b.add("vision"),"application/pdf"===d&&b.add("pdf")},d=a=>{if(Array.isArray(a))for(let b of a)c(b)};for(let b of W(a.messages))d(b.content);for(let b of W(a.input))d(b.content);for(let b of W(a.contents||a.request?.contents))d(b.parts);return b}(a);if(b.size>0){let a=function(a,b){if(!b||0===b.size||!Array.isArray(a)||a.length<=1)return a;let c=[...b].filter(a=>Q.has(a)),d=[...b].filter(a=>!Q.has(a));return a.map((a,b)=>{let e,g,h,i;return{m:a,i:b,t:(g=(e="string"==typeof a?a.indexOf("/"):-1)>0?(0,j.g2)(a.slice(0,e)):"",h=e>0?a.slice(e+1):a,i=(0,f.nl)(g,h),c.every(a=>!0===i[a])?+!d.every(a=>!0===i[a]):2)}}).sort((a,b)=>a.t-b.t||a.i-b.i).map(a=>a.m)}(p,b);a[0]!==p[0]&&g.info("COMBO",`auto-switch for [${[...b].join(",")}] → ${a[0]}`),p=a}}let q=null,r=null,s=null;for(let b=0;b<p.length;b++){let e=p[b];g.info("COMBO",`Trying model ${b+1}/${p.length}: ${e}`);try{let b=await c(a,e,{role:"worker"});if(b.ok)return g.info("COMBO",`Model ${e} succeeded`),b;let f=b.statusText||"",h=null;try{let a=await b.clone().json();f=a?.error?.message||a?.error||a?.message||f,h=a?.retryAfter||null}catch{}if(h&&(!r||new Date(h)<new Date(r))&&(r=h),"string"!=typeof f)try{f=JSON.stringify(f)}catch{f=String(f)}let{shouldFallback:i,cooldownMs:j}=[400,405,406,413,415,422].includes(b.status)?{shouldFallback:!1,cooldownMs:0}:(0,d.hk)(b.status,f);if(!i)return g.warn("COMBO",`Model ${e} failed (no fallback)`,{status:b.status}),b;j&&j>0&&j<=5e3&&(503===b.status||502===b.status||504===b.status)&&(g.info("COMBO",`Model ${e} transient ${b.status}, waiting ${j}ms before next`),await new Promise(a=>setTimeout(a,j))),q=f||String(b.status),s||(s=b.status),g.warn("COMBO",`Model ${e} failed, trying next`,{status:b.status})}catch(a){q=a.message||String(a),s||(s=500),g.warn("COMBO",`Model ${e} threw error, trying next`,{error:q})}}let t=q&&q.toLowerCase().includes("no credentials")?503:s||503,u=q||"All combo models unavailable";if(r){let a=(0,d.Qo)(r);return g.warn("COMBO",`All models failed | ${u} (${a})`),(0,e.wO)(t,u,r,a)}return g.warn("COMBO",`All models failed | ${u}`),new Response(JSON.stringify({error:{message:u,type:"server_error",code:"all_models_failed"}}),{status:t,headers:{"Content-Type":"application/json"}})}function $(a){if(!a||"object"!=typeof a)return"";let b=a.choices?.[0];if(b){let a=b.message??b.delta??{},c=(0,g.kU)(a.content);if(c.trim())return c;if("string"==typeof b.text&&b.text.trim())return b.text}let c=(0,g.kU)(a.content);if(c.trim())return c;let d=a.candidates?.[0]?.content?.parts;if(Array.isArray(d)){let a=d.map(a=>a?.text||"").join("");if(a.trim())return a}if(Array.isArray(a.output)){let b=a.output.flatMap(a=>Array.isArray(a.content)?a.content.map(a=>a?.text||""):[]).join("");if(b.trim())return b}return""}function _(a,b){let c={...a};return Array.isArray(a.messages)?c.messages=[...a.messages,{role:"user",content:b}]:Array.isArray(a.input)?c.input=[...a.input,{role:"user",content:b}]:Array.isArray(a.contents)?c.contents=[...a.contents,{role:"user",parts:[{text:b}]}]:c.messages=[{role:"user",content:b}],c}let aa={minPanel:2,stragglerGraceMs:8e3,panelHardTimeoutMs:9e4};function ab(a,b,c){return"function"==typeof a?k(a,b,c).promise:new Promise(c=>{let d=setTimeout(()=>c({__timeout:!0}),b);Promise.resolve(a).then(a=>{clearTimeout(d),c(a)}).catch(a=>{clearTimeout(d),c({__error:a})})})}function ac(a,{minPanel:b,stragglerGraceMs:c,panelHardTimeoutMs:d,onFinish:e}){return new Promise(f=>{let g=Array(a.length),h=0,i=0,j=!1,k=null,l=()=>{j||(j=!0,clearTimeout(m),k&&clearTimeout(k),e?.(),f(g))},m=setTimeout(l,d);a.forEach((d,e)=>{Promise.resolve(d).then(a=>{g[e]=a}).catch(a=>{g[e]={__error:a}}).finally(()=>{if(h++,g[e]&&g[e].ok&&i++,h===a.length)return l();i>=b&&!k&&(k=setTimeout(l,c))})})})}async function ad({body:a,models:b,handleSingleModel:c,log:d,comboName:e,judgeModel:f,tuning:g,signal:h,runBudget:j}){let l,o=Array.isArray(b)?b.filter(Boolean):[];if(0===o.length)return new Response(JSON.stringify({error:{message:"Fusion combo has no models"}}),{status:400,headers:{"Content-Type":"application/json"}});if(1===o.length)return c(a,o[0],{role:"judge"});let r=(0,i.Ub)("fusion",{judgeModel:f},o);if(r.length>0){let a=r.map(a=>a.reason).join(" ");return new Response(JSON.stringify({error:{message:`Fusion role validation failed: ${a}`,type:"capability_error"}}),{status:400,headers:{"Content-Type":"application/json"}})}let s={...aa,...g||{}},t=Math.min(Math.max(2,s.minPanel),o.length),u=f&&f.trim()?f.trim():o[0];d.info("FUSION",`Combo "${e}" | panel=${o.length} [${o.join(", ")}] | judge=${u} | quorum=${t}`);let v=m(a),w=p(a,v),x=o.map(a=>k(b=>c(w,a,{isPanel:!0,signal:b,trafficClass:"panel",role:"panel"}),s.panelHardTimeoutMs,h)),y=Date.now(),z=await ac(x.map(a=>a.promise),{...s,minPanel:t,onFinish:()=>x.forEach(a=>a.abort("fusion panel closed"))});x.forEach(a=>a.cleanup()),d.info("FUSION",`fan-out collected in ${Date.now()-y}ms`);let A=[];for(let a=0;a<z.length;a++){let b=z[a],c=o[a];if(!b){d.warn("FUSION",`Panel ${c} dropped (straggler/timeout)`);continue}if(b.__timeout){d.warn("FUSION",`Panel ${c} timed out`);continue}if(b.__error){d.warn("FUSION",`Panel ${c} threw`,{error:b.__error?.message||String(b.__error)});continue}if(!b.ok){d.warn("FUSION",`Panel ${c} failed`,{status:b.status});continue}try{let a=await b.clone().json(),e=$(a);if(e){let a=j?j.clampOutput(e):e;if(!a){d.warn("FUSION",`Panel ${c} exceeded output budget`);continue}A.push({model:c,text:a,res:b}),d.info("FUSION",`Panel ${c} ok (${e.length} chars)`)}else d.warn("FUSION",`Panel ${c} returned empty content`)}catch(a){d.warn("FUSION",`Panel ${c} unparseable`,{error:a.message||String(a)})}}if(0===A.length)return d.warn("FUSION","All panel models failed"),new Response(JSON.stringify({error:{message:"All fusion panel models failed"}}),{status:503,headers:{"Content-Type":"application/json"}});if(1===A.length)return a?.stream===!0?(d.info("FUSION",`Only ${A[0].model} succeeded — re-running with stream:true to honor client SSE request (no fusion)`),c(a,A[0].model,{role:"panel",signal:h,trafficClass:"user"})):(d.info("FUSION",`Only ${A[0].model} succeeded — returning its response directly (no fusion, no re-run)`),A[0].res);let B=j?.limits?.maxOutputChars||12e4,C=n(a,q((l=A.map((a,b)=>`[Source ${b+1}]
10
+ ${a.text}`).join("\n\n"),[`You are the JUDGE in a model-fusion panel. ${A.length} expert models independently answered the user's most recent request. Their responses are below, anonymized by source.`,"\nDo NOT mention that multiple models were used, and do NOT refer to the sources. Produce ONE authoritative final answer addressed directly to the user.\n\nFirst, internally analyze the panel along these dimensions: consensus (points most sources agree on — treat as higher-confidence), contradictions (where they disagree — resolve with your own judgment), partial coverage, unique insights only one source surfaced, and blind spots every source missed. Then write the best possible final answer grounded in that analysis — more complete and correct than any single response, with no filler.\n\n=== PANEL RESPONSES ===",l,"=== END PANEL RESPONSES ===\n\nNow write the final answer to the user's original request."].join("\n")),B),v);return d.info("FUSION",`Judging ${A.length} answers with ${u}`),c(C,u,{role:"judge",signal:h,trafficClass:"user"})}let ae={confidenceThreshold:70,confidencePrompt:"Rate your confidence in this answer from 0 to 100. End your response with exactly: CONFIDENCE: <number>",escalatePrompt:"A prior model gave the following answer with low confidence. Review it, correct any issues, and provide a better answer.",maxStages:3};async function af({body:a,models:b,handleSingleModel:c,log:d,comboName:e,tuning:f,signal:g,runBudget:h}){let i=Array.isArray(b)?b.filter(Boolean):[];if(0===i.length)return new Response(JSON.stringify({error:{message:"Cascade combo has no models"}}),{status:400,headers:{"Content-Type":"application/json"}});let j={...ae,...f||{}},k=Math.min(Math.max(1,j.maxStages),i.length),l=m(a),o=p(a,l),r=null,s=null;for(let a=0;a<k;a++){var t;let b,e=i[a],f=a===k-1,m=o;m=null!=r?n(m,`${j.escalatePrompt}
11
11
 
12
- --- Prior Answer (${r}) ---
13
- ${q(o,6e4)}
12
+ --- Prior Answer (${s}) ---
13
+ ${q(r,6e4)}
14
14
  --- End Prior Answer ---
15
15
 
16
- ${i.confidencePrompt}`,k):n(m,i.confidencePrompt,k),d.info("CASCADE",`Stage ${a+1}/${j}: ${e}${o?" (escalated)":""}`);try{b=await c(m,e,{isPanel:!0,role:"worker",signal:g})}catch(b){if(b?.name==="AbortError")throw b;if(d.warn("CASCADE",`Stage ${a+1} (${e}) threw: ${b?.message||b}`),f)return new Response(JSON.stringify({error:{message:`Cascade failed at final stage: ${b?.message||"unknown"}`}}),{status:502,headers:{"Content-Type":"application/json"}});o=null,r=e;continue}if(b?.__timeout||b?.__error){if(d.warn("CASCADE",`Stage ${a+1} (${e}) ${b.__timeout?"timed out":"errored"}`),f)return new Response(JSON.stringify({error:{message:"Cascade failed at final stage"}}),{status:502,headers:{"Content-Type":"application/json"}});o=null,r=e;continue}if(!b?.ok){if(d.warn("CASCADE",`Stage ${a+1} (${e}) returned status ${b?.status}`),f)return b;o=null,r=e;continue}if(f)return d.info("CASCADE",`Final stage (${e}) returning`),b;let p="";try{let a=await b.clone().json().catch(()=>({}));p=$(a)}catch{}let t=function(a){if(!a||"string"!=typeof a)return -1;let b=a.match(/CONFIDENCE:\s*(\d{1,3})\s*$/i);if(!b)return -1;let c=Number.parseInt(b[1],10);return Number.isFinite(c)&&c>=0&&c<=100?c:-1}(p);if(d.info("CASCADE",`Stage ${a+1} (${e}) confidence=${t}`),t>=0&&t>=i.confidenceThreshold)return d.info("CASCADE",`Stage ${a+1} confident (${t} ≥ ${i.confidenceThreshold}) — returning`),b;o=((s=p)&&"string"==typeof s?s.replace(/\s*CONFIDENCE:\s*\d{1,3}\s*$/i,"").trim():s)||p,r=e}return new Response(JSON.stringify({error:{message:"Cascade exhausted all stages"}}),{status:502,headers:{"Content-Type":"application/json"}})}},94755:(a,b,c)=>{c.d(b,{A:()=>i});var d=c(77598);let e={randomUUID:d.randomUUID},f=new Uint8Array(256),g=f.length;var h=c(50122);let i=function(a,b,c){if(e.randomUUID&&!b&&!a)return e.randomUUID();var i=a,j=c;let k=(i=i||{}).random??i.rng?.()??(g>f.length-16&&((0,d.randomFillSync)(f),g=0),f.slice(g,g+=16));if(k.length<16)throw Error("Random bytes length must be >= 16");if(k[6]=15&k[6]|64,k[8]=63&k[8]|128,b){if((j=j||0)<0||j+16>b.length)throw RangeError(`UUID byte range ${j}:${j+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[j+a]=k[a];return b}return(0,h.k)(k)}}};
16
+ ${j.confidencePrompt}`,l):n(m,j.confidencePrompt,l),d.info("CASCADE",`Stage ${a+1}/${k}: ${e}${r?" (escalated)":""}`);try{b=await c(m,e,{isPanel:!0,role:"worker",signal:g})}catch(b){if(b?.name==="AbortError")throw b;if(d.warn("CASCADE",`Stage ${a+1} (${e}) threw: ${b?.message||b}`),f)return new Response(JSON.stringify({error:{message:`Cascade failed at final stage: ${b?.message||"unknown"}`}}),{status:502,headers:{"Content-Type":"application/json"}});r=null,s=e;continue}if(b?.__timeout||b?.__error){if(d.warn("CASCADE",`Stage ${a+1} (${e}) ${b.__timeout?"timed out":"errored"}`),f)return new Response(JSON.stringify({error:{message:"Cascade failed at final stage"}}),{status:502,headers:{"Content-Type":"application/json"}});r=null,s=e;continue}if(!b?.ok){if(d.warn("CASCADE",`Stage ${a+1} (${e}) returned status ${b?.status}`),f)return b;r=null,s=e;continue}if(f)return d.info("CASCADE",`Final stage (${e}) returning`),b;let p="";try{let a=await b.clone().json().catch(()=>({}));(p=$(a))&&h&&(p=h.clampOutput(p))}catch{}let u=function(a){if(!a||"string"!=typeof a)return -1;let b=a.match(/CONFIDENCE:\s*(\d{1,3})\s*$/i);if(!b)return -1;let c=Number.parseInt(b[1],10);return Number.isFinite(c)&&c>=0&&c<=100?c:-1}(p);if(d.info("CASCADE",`Stage ${a+1} (${e}) confidence=${u}`),u>=0&&u>=j.confidenceThreshold)return d.info("CASCADE",`Stage ${a+1} confident (${u} ≥ ${j.confidenceThreshold}) — returning`),b;r=((t=p)&&"string"==typeof t?t.replace(/\s*CONFIDENCE:\s*\d{1,3}\s*$/i,"").trim():t)||p,s=e}return new Response(JSON.stringify({error:{message:"Cascade exhausted all stages"}}),{status:502,headers:{"Content-Type":"application/json"}})}},94755:(a,b,c)=>{c.d(b,{A:()=>i});var d=c(77598);let e={randomUUID:d.randomUUID},f=new Uint8Array(256),g=f.length;var h=c(50122);let i=function(a,b,c){if(e.randomUUID&&!b&&!a)return e.randomUUID();var i=a,j=c;let k=(i=i||{}).random??i.rng?.()??(g>f.length-16&&((0,d.randomFillSync)(f),g=0),f.slice(g,g+=16));if(k.length<16)throw Error("Random bytes length must be >= 16");if(k[6]=15&k[6]|64,k[8]=63&k[8]|128,b){if((j=j||0)<0||j+16>b.length)throw RangeError(`UUID byte range ${j}:${j+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[j+a]=k[a];return b}return(0,h.k)(k)}}};
@@ -6,7 +6,7 @@
6
6
  ON CONFLICT(id) DO UPDATE SET
7
7
  provider=excluded.provider, authType=excluded.authType, name=excluded.name,
8
8
  email=excluded.email, priority=excluded.priority, isActive=excluded.isActive,
9
- data=excluded.data, updatedAt=excluded.updatedAt`,[c.id,c.provider,c.authType,c.name,c.email,c.priority,c.isActive,c.data,c.createdAt,c.updatedAt])}let j=new Map,k=new Set(["lastUsedAt","consecutiveUseCount","lastRefreshAt","lastTested","lastError","lastErrorAt","errorCode","expiresIn"]);async function l(a){let b=await (0,e.c)(),c=[],d=[];a.provider&&(c.push("provider = ?"),d.push(a.provider)),void 0!==a.isActive&&(c.push("isActive = ?"),d.push(+!!a.isActive));let f=`SELECT * FROM providerConnections${c.length?` WHERE ${c.join(" AND ")}`:""}`,g=b.all(f,d).map(h);return g.sort((a,b)=>(a.priority||999)-(b.priority||999)),g}async function m(a={}){let b=function(a={}){let b=[];return a.provider&&b.push(`p:${a.provider}`),void 0!==a.isActive&&b.push(`a:${+!!a.isActive}`),b.length?b.join("|"):"all"}(a),c=Date.now(),d=j.get(b);if(d&&c-d.at<2e3)return d.promise.then(a=>a.slice());let e=l(a).catch(a=>{throw j.delete(b),a});return j.set(b,{promise:e,at:c}),e.then(a=>a.slice())}function n(){j.clear()}async function o(a){return h((await (0,e.c)()).get("SELECT * FROM providerConnections WHERE id = ?",[a]))}function p(a,b){let c=a.all("SELECT * FROM providerConnections WHERE provider = ?",[b]).map(h);c.sort((a,b)=>{let c=(a.priority||0)-(b.priority||0);return 0!==c?c:new Date(b.updatedAt||0)-new Date(a.updatedAt||0)}),c.forEach((b,c)=>{a.run("UPDATE providerConnections SET priority = ? WHERE id = ?",[c+1,b.id])})}async function q(a){let b,c=await (0,e.c)(),f=new Date().toISOString();return c.transaction(()=>{let e=c.all("SELECT * FROM providerConnections WHERE provider = ?",[a.provider]).map(h),j=null;if("oauth"===a.authType&&a.email){let b=a.providerSpecificData?.username,c=a.providerSpecificData?.chatgptAccountId;j=e.find(d=>{if("oauth"!==d.authType||d.email!==a.email)return!1;let e=d.providerSpecificData?.chatgptAccountId;if(c&&e)return c===e;if(c&&!e||!c&&e)return!1;let f=d.providerSpecificData?.username;return b&&f?b===f:!b&&!f})}else"apikey"===a.authType&&a.name&&(j=e.find(b=>"apikey"===b.authType&&b.name===a.name));if(j){let d={...j,...a,updatedAt:f};i(c,d),b=d;return}let k=a.name||null;k||"oauth"!==a.authType&&"access_token"!==a.authType||(k=a.email||`Account ${e.length+1}`);let l=a.priority;l||(l=e.reduce((a,b)=>Math.max(a,b.priority||0),0)+1);let m={id:(0,d.A)(),provider:a.provider,authType:a.authType||"oauth",name:k,priority:l,isActive:void 0===a.isActive||a.isActive,createdAt:f,updatedAt:f};for(let b of g)void 0!==a[b]&&null!==a[b]&&(m[b]=a[b]);a.providerSpecificData&&Object.keys(a.providerSpecificData).length>0&&(m.providerSpecificData=a.providerSpecificData),void 0!==a.email&&(m.email=a.email),i(c,m),p(c,a.provider),b=m}),n(),b}async function r(a,b){let c,d=await (0,e.c)();return d.transaction(()=>{let e=d.get("SELECT * FROM providerConnections WHERE id = ?",[a]);if(!e){c=null;return}let f=h(e),g={...f,...b,updatedAt:new Date().toISOString()};i(d,g),void 0!==b.priority&&p(d,f.provider),c=g}),(!b||"object"!=typeof b||Object.keys(b).some(a=>!k.has(a)))&&n(),c}async function s(a){let b=await (0,e.c)(),c=!1;return b.transaction(()=>{let d=b.get("SELECT provider FROM providerConnections WHERE id = ?",[a]);d&&(b.run("DELETE FROM providerConnections WHERE id = ?",[a]),p(b,d.provider),c=!0)}),c&&n(),c}async function t(a){let b=await (0,e.c)(),c=b.get("SELECT COUNT(*) AS n FROM providerConnections WHERE provider = ?",[a]);return b.run("DELETE FROM providerConnections WHERE provider = ?",[a]),c?.n&&n(),c?.n||0}async function u(a){let b=await (0,e.c)();b.transaction(()=>p(b,a)),n()}async function v(){let a=await (0,e.c)(),b=["displayName","email","globalPriority","defaultModel","accessToken","refreshToken","expiresAt","tokenType","scope","projectId","apiKey","testStatus","lastTested","lastError","lastErrorAt","rateLimitedUntil","expiresIn","consecutiveUseCount"],c=0;return a.transaction(()=>{for(let d of a.all("SELECT * FROM providerConnections")){let e=h(d),f=!1;for(let a of b)(null===e[a]||void 0===e[a])&&a in e&&(delete e[a],c++,f=!0);e.providerSpecificData&&0===Object.keys(e.providerSpecificData).length&&(delete e.providerSpecificData,c++,f=!0),f&&i(a,e)}}),c&&n(),c}},9460:(a,b,c)=>{c.d(b,{L9:()=>r,OM:()=>j,S8:()=>o,fv:()=>l,getMitmAlias:()=>q,o5:()=>k,uL:()=>p,uv:()=>n});var d=c(36366),e=c(644),f=c(22846);let g=(0,f.U)("modelAliases"),h=(0,f.U)("customModels"),i=(0,f.U)("mitmAlias");async function j(){return await g.getAll()}async function k(a,b){await g.set(a,b)}async function l(a){await g.remove(a)}function m(a,b,c){return`${a}|${b}|${c}`}async function n(){return Object.values(await h.getAll())}async function o({providerAlias:a,id:b,type:c="llm",name:f}){let g=m(a,b,c),h=await (0,d.c)(),i=!1;return h.transaction(()=>{if(h.get("SELECT 1 FROM kv WHERE scope = 'customModels' AND key = ?",[g]))return;let d=(0,e.s)({providerAlias:a,id:b,type:c,name:f||b});h.run("INSERT INTO kv(scope, key, value) VALUES('customModels', ?, ?)",[g,d]),i=!0}),i}async function p({providerAlias:a,id:b,type:c="llm"}){await h.remove(m(a,b,c))}async function q(a){return a?await i.get(a)||{}:await i.getAll()}async function r(a,b){await i.set(a,b||{})}},12280:(a,b,c)=>{c.d(b,{X3:()=>k,jm:()=>m,uH:()=>l,wg:()=>f});let d=new Set(["fallback","round-robin","fusion","swarm","cascade"]),e=new Set(["llm","image","tts","stt","embedding","imageToText","webSearch","webFetch"]),f=Object.freeze({maxMembers:999,maxWorkers:8,maxConcurrentRunsPerPrincipal:2,maxConcurrentRunsGlobal:8,maxProviderFanout:4,minTimeoutMs:1e3,maxTimeoutMs:12e4,maxGraceMs:3e4,maxOutputChars:12e4,maxAggregateOutputChars:3e5,maxLogicalCalls:16,maxEstimatedCostUsd:100}),g=/^[a-zA-Z0-9_.-]+\/.+$/,h=(a,b,c,d)=>{let e=Number.parseInt(a,10);return Number.isFinite(e)?Math.min(d,Math.max(c,e)):b},i=new Set(["auto","off","extended","effort"]),j=new Set(["low","medium","high","max"]);function k(a={}){var b,c,e,g;let l,m,n,o=a&&"object"==typeof a&&!Array.isArray(a)?a:{},p=(l="string"==typeof(b=o.fallbackStrategy)?b.trim().toLowerCase():"fallback",d.has(l)?l:"fallback"),q=h(o.workerCount,4,1,f.maxWorkers),r=o.swarmTuning&&"object"==typeof o.swarmTuning?o.swarmTuning:{},s=o.fusionTuning&&"object"==typeof o.fusionTuning?o.fusionTuning:{},t=o.budgets&&"object"==typeof o.budgets?o.budgets:{},u=o.cascade&&"object"==typeof o.cascade?o.cascade:{};return{fallbackStrategy:p,judgeModel:"string"==typeof o.judgeModel?o.judgeModel.trim():"",managerModel:"string"==typeof o.managerModel?o.managerModel.trim():"",staffModel:"string"==typeof o.staffModel?o.staffModel.trim():"",auditModel:"string"==typeof o.auditModel?o.auditModel.trim():"",workerCount:q,enableTelemetry:!1!==o.enableTelemetry,thinking:function(a){let b=a&&"object"==typeof a&&!Array.isArray(a)?a:{},c=i.has(b.type)?b.type:"auto",d={type:c};if("effort"===c&&(d.effort="string"==typeof b.effort&&j.has(b.effort)?b.effort:"high"),"extended"===c&&(d.budgetTokens=h(b.budgetTokens,4096,1024,128e3)),b.roles&&"object"==typeof b.roles&&!Array.isArray(b.roles))for(let[a,c]of(d.roles={},Object.entries(b.roles))){if(!c||"object"!=typeof c)continue;let b=i.has(c.type)?c.type:"inherit";"inherit"===b?d.roles[a]={type:"inherit",...c.effort?{effort:c.effort}:{},...c.budgetTokens?{budgetTokens:c.budgetTokens}:{}}:"off"===b||"auto"===b?d.roles[a]={type:b}:"effort"===b?d.roles[a]={type:"effort",effort:j.has(c.effort)?c.effort:"high"}:"extended"===b&&(d.roles[a]={type:"extended",budgetTokens:h(c.budgetTokens,4096,1024,128e3)})}return d}(o.thinking),cascade:{confidenceThreshold:h((m=u&&"object"==typeof u&&!Array.isArray(u)?u:{}).confidenceThreshold,70,0,100),confidencePrompt:"string"==typeof m.confidencePrompt&&m.confidencePrompt.trim()?m.confidencePrompt.trim():"Rate your confidence in this answer from 0 to 100. End your response with exactly: CONFIDENCE: <number>",escalatePrompt:"string"==typeof m.escalatePrompt&&m.escalatePrompt.trim()?m.escalatePrompt.trim():"A prior model gave the following answer with low confidence. Review it, correct any issues, and provide a better answer.",maxStages:h(m.maxStages,3,1,8)},fusionTuning:{minPanel:h(s.minPanel,2,2,f.maxMembers),stragglerGraceMs:h(s.stragglerGraceMs,8e3,0,f.maxGraceMs),panelHardTimeoutMs:h(s.panelHardTimeoutMs,9e4,f.minTimeoutMs,f.maxTimeoutMs)},swarmTuning:{workerHardTimeoutMs:h(r.workerHardTimeoutMs,9e4,f.minTimeoutMs,f.maxTimeoutMs),workerQuorum:h(r.workerQuorum,Math.min(2,q),1,q),stragglerGraceMs:h(r.stragglerGraceMs,1e4,0,f.maxGraceMs),managerTimeoutMs:h(r.managerTimeoutMs,6e4,f.minTimeoutMs,f.maxTimeoutMs),minWorkers:h(r.minWorkers,Math.min(2,q),1,q),maxWorkers:h(r.maxWorkers,q,1,f.maxWorkers)},budgets:{maxLogicalCalls:h(t.maxLogicalCalls,f.maxLogicalCalls,1,f.maxLogicalCalls),maxOutputChars:h(t.maxOutputChars,f.maxOutputChars,1e3,f.maxOutputChars),maxAggregateOutputChars:h(t.maxAggregateOutputChars,f.maxAggregateOutputChars,5e3,f.maxAggregateOutputChars),maxEstimatedCostUsd:(c=t.maxEstimatedCostUsd,e=f.maxEstimatedCostUsd,g=f.maxEstimatedCostUsd,Number.isFinite(n=Number(c))?Math.min(g,Math.max(.01,n)):e)},autoScale:{enabled:o.autoScale?.enabled===!0,minWorkers:h(o.autoScale?.minWorkers,1,1,o.autoScale?.maxWorkers||f.maxWorkers),maxWorkers:h(o.autoScale?.maxWorkers,q||f.maxWorkers,1,f.maxWorkers)}}}function l(a,{allowPartial:b=!1}={}){let c=[];if((!b||void 0!==a.name)&&("string"==typeof a.name&&a.name.trim()?/^[a-zA-Z0-9_.-]+$/.test(a.name)||c.push("Name can only contain letters, numbers, -, _ and ."):c.push("Name is required")),!b||void 0!==a.models)if(Array.isArray(a.models)){let b=a.models.map(a=>"string"==typeof a?a.trim():"");b.length<1&&c.push("At least one model is required"),b.some(a=>!g.test(a))&&c.push("Every model must use provider/model format"),new Set(b).size!==b.length&&c.push("Duplicate models are not allowed")}else c.push("Models must be an array");if(void 0===a.kind||null===a.kind||e.has(a.kind)||c.push("Invalid combo kind"),void 0!==a.strategyConfig){let b=a.strategyConfig;if(!b||"object"!=typeof b||Array.isArray(b))c.push("strategyConfig must be an object");else{for(let a of["judgeModel","managerModel","staffModel","auditModel"])b[a]&&!g.test(String(b[a]).trim())&&c.push(`${a} must use provider/model format`);[b.fusionTuning,b.swarmTuning,b.budgets].filter(Boolean).some(a=>"object"!=typeof a||Array.isArray(a))&&c.push("Tuning and budgets must be objects")}}return{valid:0===c.length,errors:c}}function m(a,b){let c=k(a);return"fusion"===c.fallbackStrategy?Math.min(b,f.maxMembers)+1:"swarm"===c.fallbackStrategy?Math.min(c.workerCount,f.maxWorkers)+4:"cascade"===c.fallbackStrategy?Math.min(b,c.cascade?.maxStages||3):Math.max(1,Math.min(b,f.maxMembers))}},22846:(a,b,c)=>{c.d(b,{U:()=>f});var d=c(36366),e=c(644);function f(a){return{async get(b,c=null){let f=(await (0,d.c)()).get("SELECT value FROM kv WHERE scope = ? AND key = ?",[a,b]);return f?(0,e.q)(f.value,c):c},async getAll(){let b=(await (0,d.c)()).all("SELECT key, value FROM kv WHERE scope = ?",[a]),c={};for(let a of b)c[a.key]=(0,e.q)(a.value);return c},async set(b,c){(await (0,d.c)()).run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,b,(0,e.s)(c)])},async setMany(b){let c=await (0,d.c)();c.transaction(()=>{for(let[d,f]of Object.entries(b))c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,d,(0,e.s)(f)])})},async remove(b){(await (0,d.c)()).run("DELETE FROM kv WHERE scope = ? AND key = ?",[a,b])},async clear(){(await (0,d.c)()).run("DELETE FROM kv WHERE scope = ?",[a])}}}},39422:(a,b,c)=>{c.d(b,{S8:()=>z.S8,E5:()=>F.E5,bI:()=>g.cleanupProviderConnections,Iq:()=>q.createApiKey,jd:()=>w,iE:()=>g.createProviderConnection,i0:()=>h.createProviderNode,ZO:()=>n,Lh:()=>q.deleteApiKey,CG:()=>y,uL:()=>z.uL,fv:()=>z.fv,fK:()=>g.deleteProviderConnection,op:()=>g.deleteProviderConnectionsByProvider,Pc:()=>h.deleteProviderNode,Yd:()=>p,tm:()=>D,oF:()=>E,zP:()=>S,rg:()=>F.rg,yg:()=>q.getApiKeyById,mY:()=>q.getApiKeyByKey,PX:()=>q.getApiKeys,j$:()=>F.j$,L:()=>u,Dj:()=>v,Uv:()=>t,uv:()=>z.uv,vF:()=>C,Lk:()=>Q,Re:()=>F.Re,R0:()=>F.R0,c:()=>z.getMitmAlias,OM:()=>z.OM,r4:()=>A.r4,Mc:()=>g.getProviderConnectionById,P:()=>g.getProviderConnections,Qu:()=>h.getProviderNodeById,Fh:()=>h.getProviderNodes,hr:()=>m,ui:()=>l,Zx:()=>F.Zx,SL:()=>P,mt:()=>f.getSettings,Q5:()=>F.Q5,PK:()=>F.PK,M2:()=>F.M2,BY:()=>F.BY,K1:()=>T,VT:()=>A.VT,yF:()=>A.yF,ox:()=>O,sZ:()=>F.sZ,L9:()=>z.L9,o5:()=>z.o5,_V:()=>F._V,uw:()=>F.uw,XW:()=>q.updateApiKey,oG:()=>x,KJ:()=>A.KJ,rj:()=>g.updateProviderConnection,ho:()=>h.updateProviderNode,Q_:()=>o,Xx:()=>f.Xx,ek:()=>q.validateApiKey});var d=c(36366),e=c(644),f=c(42655),g=c(5781),h=c(1129),i=c(94755);function j(a){return a?{...(0,e.q)(a.data,{}),id:a.id,isActive:1===a.isActive||!0===a.isActive,testStatus:a.testStatus,createdAt:a.createdAt,updatedAt:a.updatedAt}:null}function k(a,b){let c=function(a){let{id:b,isActive:c,testStatus:d,createdAt:f,updatedAt:g,...h}=a;return{id:b,isActive:+(!1!==c),testStatus:d??null,data:(0,e.s)(h),createdAt:f,updatedAt:g}}(b);a.run(`INSERT INTO proxyPools(id, isActive, testStatus, data, createdAt, updatedAt)
9
+ data=excluded.data, updatedAt=excluded.updatedAt`,[c.id,c.provider,c.authType,c.name,c.email,c.priority,c.isActive,c.data,c.createdAt,c.updatedAt])}let j=new Map,k=new Set(["lastUsedAt","consecutiveUseCount","lastRefreshAt","lastTested","lastError","lastErrorAt","errorCode","expiresIn"]);async function l(a){let b=await (0,e.c)(),c=[],d=[];a.provider&&(c.push("provider = ?"),d.push(a.provider)),void 0!==a.isActive&&(c.push("isActive = ?"),d.push(+!!a.isActive));let f=`SELECT * FROM providerConnections${c.length?` WHERE ${c.join(" AND ")}`:""}`,g=b.all(f,d).map(h);return g.sort((a,b)=>(a.priority||999)-(b.priority||999)),g}async function m(a={}){let b=function(a={}){let b=[];return a.provider&&b.push(`p:${a.provider}`),void 0!==a.isActive&&b.push(`a:${+!!a.isActive}`),b.length?b.join("|"):"all"}(a),c=Date.now(),d=j.get(b);if(d&&c-d.at<2e3)return d.promise.then(a=>a.slice());let e=l(a).catch(a=>{throw j.delete(b),a});return j.set(b,{promise:e,at:c}),e.then(a=>a.slice())}function n(){j.clear()}async function o(a){return h((await (0,e.c)()).get("SELECT * FROM providerConnections WHERE id = ?",[a]))}function p(a,b){let c=a.all("SELECT * FROM providerConnections WHERE provider = ?",[b]).map(h);c.sort((a,b)=>{let c=(a.priority||0)-(b.priority||0);return 0!==c?c:new Date(b.updatedAt||0)-new Date(a.updatedAt||0)}),c.forEach((b,c)=>{a.run("UPDATE providerConnections SET priority = ? WHERE id = ?",[c+1,b.id])})}async function q(a){let b,c=await (0,e.c)(),f=new Date().toISOString();return c.transaction(()=>{let e=c.all("SELECT * FROM providerConnections WHERE provider = ?",[a.provider]).map(h),j=null;if("oauth"===a.authType&&a.email){let b=a.providerSpecificData?.username,c=a.providerSpecificData?.chatgptAccountId;j=e.find(d=>{if("oauth"!==d.authType||d.email!==a.email)return!1;let e=d.providerSpecificData?.chatgptAccountId;if(c&&e)return c===e;if(c&&!e||!c&&e)return!1;let f=d.providerSpecificData?.username;return b&&f?b===f:!b&&!f})}else"apikey"===a.authType&&a.name&&(j=e.find(b=>"apikey"===b.authType&&b.name===a.name));if(j){let d={...j,...a,updatedAt:f};i(c,d),b=d;return}let k=a.name||null;k||"oauth"!==a.authType&&"access_token"!==a.authType||(k=a.email||`Account ${e.length+1}`);let l=a.priority;l||(l=e.reduce((a,b)=>Math.max(a,b.priority||0),0)+1);let m={id:(0,d.A)(),provider:a.provider,authType:a.authType||"oauth",name:k,priority:l,isActive:void 0===a.isActive||a.isActive,createdAt:f,updatedAt:f};for(let b of g)void 0!==a[b]&&null!==a[b]&&(m[b]=a[b]);a.providerSpecificData&&Object.keys(a.providerSpecificData).length>0&&(m.providerSpecificData=a.providerSpecificData),void 0!==a.email&&(m.email=a.email),i(c,m),p(c,a.provider),b=m}),n(),b}async function r(a,b){let c,d=await (0,e.c)();return d.transaction(()=>{let e=d.get("SELECT * FROM providerConnections WHERE id = ?",[a]);if(!e){c=null;return}let f=h(e),g={...f,...b,updatedAt:new Date().toISOString()};i(d,g),void 0!==b.priority&&p(d,f.provider),c=g}),(!b||"object"!=typeof b||Object.keys(b).some(a=>!k.has(a)))&&n(),c}async function s(a){let b=await (0,e.c)(),c=!1;return b.transaction(()=>{let d=b.get("SELECT provider FROM providerConnections WHERE id = ?",[a]);d&&(b.run("DELETE FROM providerConnections WHERE id = ?",[a]),p(b,d.provider),c=!0)}),c&&n(),c}async function t(a){let b=await (0,e.c)(),c=b.get("SELECT COUNT(*) AS n FROM providerConnections WHERE provider = ?",[a]);return b.run("DELETE FROM providerConnections WHERE provider = ?",[a]),c?.n&&n(),c?.n||0}async function u(a){let b=await (0,e.c)();b.transaction(()=>p(b,a)),n()}async function v(){let a=await (0,e.c)(),b=["displayName","email","globalPriority","defaultModel","accessToken","refreshToken","expiresAt","tokenType","scope","projectId","apiKey","testStatus","lastTested","lastError","lastErrorAt","rateLimitedUntil","expiresIn","consecutiveUseCount"],c=0;return a.transaction(()=>{for(let d of a.all("SELECT * FROM providerConnections")){let e=h(d),f=!1;for(let a of b)(null===e[a]||void 0===e[a])&&a in e&&(delete e[a],c++,f=!0);e.providerSpecificData&&0===Object.keys(e.providerSpecificData).length&&(delete e.providerSpecificData,c++,f=!0),f&&i(a,e)}}),c&&n(),c}},9460:(a,b,c)=>{c.d(b,{L9:()=>r,OM:()=>j,S8:()=>o,fv:()=>l,getMitmAlias:()=>q,o5:()=>k,uL:()=>p,uv:()=>n});var d=c(36366),e=c(644),f=c(22846);let g=(0,f.U)("modelAliases"),h=(0,f.U)("customModels"),i=(0,f.U)("mitmAlias");async function j(){return await g.getAll()}async function k(a,b){await g.set(a,b)}async function l(a){await g.remove(a)}function m(a,b,c){return`${a}|${b}|${c}`}async function n(){return Object.values(await h.getAll())}async function o({providerAlias:a,id:b,type:c="llm",name:f}){let g=m(a,b,c),h=await (0,d.c)(),i=!1;return h.transaction(()=>{if(h.get("SELECT 1 FROM kv WHERE scope = 'customModels' AND key = ?",[g]))return;let d=(0,e.s)({providerAlias:a,id:b,type:c,name:f||b});h.run("INSERT INTO kv(scope, key, value) VALUES('customModels', ?, ?)",[g,d]),i=!0}),i}async function p({providerAlias:a,id:b,type:c="llm"}){await h.remove(m(a,b,c))}async function q(a){return a?await i.get(a)||{}:await i.getAll()}async function r(a,b){await i.set(a,b||{})}},12280:(a,b,c)=>{c.d(b,{X3:()=>k,jm:()=>m,uH:()=>l,wg:()=>f});let d=new Set(["fallback","round-robin","fusion","swarm","cascade"]),e=new Set(["llm","image","tts","stt","embedding","imageToText","webSearch","webFetch"]),f=Object.freeze({maxMembers:999,maxWorkers:8,maxConcurrentRunsPerPrincipal:2,maxConcurrentRunsGlobal:8,maxProviderFanout:4,minTimeoutMs:1e3,maxTimeoutMs:12e4,maxGraceMs:3e4,maxOutputChars:12e4,maxAggregateOutputChars:3e5,maxLogicalCalls:16,maxEstimatedCostUsd:1/0}),g=/^[a-zA-Z0-9_.-]+\/.+$/,h=(a,b,c,d)=>{let e=Number.parseInt(a,10);return Number.isFinite(e)?Math.min(d,Math.max(c,e)):b},i=new Set(["auto","off","extended","effort"]),j=new Set(["low","medium","high","max"]);function k(a={}){var b,c,e,g;let l,m,n,o=a&&"object"==typeof a&&!Array.isArray(a)?a:{},p=(l="string"==typeof(b=o.fallbackStrategy)?b.trim().toLowerCase():"fallback",d.has(l)?l:"fallback"),q=h(o.workerCount,4,1,f.maxWorkers),r=o.swarmTuning&&"object"==typeof o.swarmTuning?o.swarmTuning:{},s=o.fusionTuning&&"object"==typeof o.fusionTuning?o.fusionTuning:{},t=o.budgets&&"object"==typeof o.budgets?o.budgets:{},u=o.cascade&&"object"==typeof o.cascade?o.cascade:{};return{fallbackStrategy:p,judgeModel:"string"==typeof o.judgeModel?o.judgeModel.trim():"",managerModel:"string"==typeof o.managerModel?o.managerModel.trim():"",staffModel:"string"==typeof o.staffModel?o.staffModel.trim():"",auditModel:"string"==typeof o.auditModel?o.auditModel.trim():"",workerCount:q,enableTelemetry:!1!==o.enableTelemetry,thinking:function(a){let b=a&&"object"==typeof a&&!Array.isArray(a)?a:{},c=i.has(b.type)?b.type:"auto",d={type:c};if("effort"===c&&(d.effort="string"==typeof b.effort&&j.has(b.effort)?b.effort:"high"),"extended"===c&&(d.budgetTokens=h(b.budgetTokens,4096,1024,128e3)),b.roles&&"object"==typeof b.roles&&!Array.isArray(b.roles))for(let[a,c]of(d.roles={},Object.entries(b.roles))){if(!c||"object"!=typeof c)continue;let b=i.has(c.type)?c.type:"inherit";"inherit"===b?d.roles[a]={type:"inherit",...c.effort?{effort:c.effort}:{},...c.budgetTokens?{budgetTokens:c.budgetTokens}:{}}:"off"===b||"auto"===b?d.roles[a]={type:b}:"effort"===b?d.roles[a]={type:"effort",effort:j.has(c.effort)?c.effort:"high"}:"extended"===b&&(d.roles[a]={type:"extended",budgetTokens:h(c.budgetTokens,4096,1024,128e3)})}return d}(o.thinking),cascade:{confidenceThreshold:h((m=u&&"object"==typeof u&&!Array.isArray(u)?u:{}).confidenceThreshold,70,0,100),confidencePrompt:"string"==typeof m.confidencePrompt&&m.confidencePrompt.trim()?m.confidencePrompt.trim():"Rate your confidence in this answer from 0 to 100. End your response with exactly: CONFIDENCE: <number>",escalatePrompt:"string"==typeof m.escalatePrompt&&m.escalatePrompt.trim()?m.escalatePrompt.trim():"A prior model gave the following answer with low confidence. Review it, correct any issues, and provide a better answer.",maxStages:h(m.maxStages,3,1,8)},fusionTuning:{minPanel:h(s.minPanel,2,2,f.maxMembers),stragglerGraceMs:h(s.stragglerGraceMs,8e3,0,f.maxGraceMs),panelHardTimeoutMs:h(s.panelHardTimeoutMs,9e4,f.minTimeoutMs,f.maxTimeoutMs)},swarmTuning:{workerHardTimeoutMs:h(r.workerHardTimeoutMs,9e4,f.minTimeoutMs,f.maxTimeoutMs),workerQuorum:h(r.workerQuorum,Math.min(2,q),1,q),stragglerGraceMs:h(r.stragglerGraceMs,1e4,0,f.maxGraceMs),managerTimeoutMs:h(r.managerTimeoutMs,6e4,f.minTimeoutMs,f.maxTimeoutMs),minWorkers:h(r.minWorkers,Math.min(2,q),1,q),maxWorkers:h(r.maxWorkers,q,1,f.maxWorkers)},budgets:{enabled:!0===t.enabled,maxLogicalCalls:h(t.maxLogicalCalls,f.maxLogicalCalls,1,f.maxLogicalCalls),maxOutputChars:h(t.maxOutputChars,f.maxOutputChars,1e3,f.maxOutputChars),maxAggregateOutputChars:h(t.maxAggregateOutputChars,f.maxAggregateOutputChars,5e3,f.maxAggregateOutputChars),maxEstimatedCostUsd:(c=t.maxEstimatedCostUsd,e=f.maxEstimatedCostUsd,g=f.maxEstimatedCostUsd,Number.isFinite(n=Number(c))?Math.min(g,Math.max(.01,n)):e)},autoScale:{enabled:o.autoScale?.enabled===!0,minWorkers:h(o.autoScale?.minWorkers,1,1,o.autoScale?.maxWorkers||f.maxWorkers),maxWorkers:h(o.autoScale?.maxWorkers,q||f.maxWorkers,1,f.maxWorkers)}}}function l(a,{allowPartial:b=!1}={}){let c=[];if((!b||void 0!==a.name)&&("string"==typeof a.name&&a.name.trim()?/^[a-zA-Z0-9_.-]+$/.test(a.name)||c.push("Name can only contain letters, numbers, -, _ and ."):c.push("Name is required")),!b||void 0!==a.models)if(Array.isArray(a.models)){let b=a.models.map(a=>"string"==typeof a?a.trim():"");b.length<1&&c.push("At least one model is required"),b.some(a=>!g.test(a))&&c.push("Every model must use provider/model format"),new Set(b).size!==b.length&&c.push("Duplicate models are not allowed")}else c.push("Models must be an array");if(void 0===a.kind||null===a.kind||e.has(a.kind)||c.push("Invalid combo kind"),void 0!==a.strategyConfig){let b=a.strategyConfig;if(!b||"object"!=typeof b||Array.isArray(b))c.push("strategyConfig must be an object");else{for(let a of["judgeModel","managerModel","staffModel","auditModel"])b[a]&&!g.test(String(b[a]).trim())&&c.push(`${a} must use provider/model format`);[b.fusionTuning,b.swarmTuning,b.budgets].filter(Boolean).some(a=>"object"!=typeof a||Array.isArray(a))&&c.push("Tuning and budgets must be objects")}}return{valid:0===c.length,errors:c}}function m(a,b){let c=k(a);return"fusion"===c.fallbackStrategy?Math.min(b,f.maxMembers)+1:"swarm"===c.fallbackStrategy?Math.min(c.workerCount,f.maxWorkers)+4:"cascade"===c.fallbackStrategy?Math.min(b,c.cascade?.maxStages||3):Math.max(1,Math.min(b,f.maxMembers))}},22846:(a,b,c)=>{c.d(b,{U:()=>f});var d=c(36366),e=c(644);function f(a){return{async get(b,c=null){let f=(await (0,d.c)()).get("SELECT value FROM kv WHERE scope = ? AND key = ?",[a,b]);return f?(0,e.q)(f.value,c):c},async getAll(){let b=(await (0,d.c)()).all("SELECT key, value FROM kv WHERE scope = ?",[a]),c={};for(let a of b)c[a.key]=(0,e.q)(a.value);return c},async set(b,c){(await (0,d.c)()).run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,b,(0,e.s)(c)])},async setMany(b){let c=await (0,d.c)();c.transaction(()=>{for(let[d,f]of Object.entries(b))c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,d,(0,e.s)(f)])})},async remove(b){(await (0,d.c)()).run("DELETE FROM kv WHERE scope = ? AND key = ?",[a,b])},async clear(){(await (0,d.c)()).run("DELETE FROM kv WHERE scope = ?",[a])}}}},39422:(a,b,c)=>{c.d(b,{S8:()=>z.S8,E5:()=>F.E5,bI:()=>g.cleanupProviderConnections,Iq:()=>q.createApiKey,jd:()=>w,iE:()=>g.createProviderConnection,i0:()=>h.createProviderNode,ZO:()=>n,Lh:()=>q.deleteApiKey,CG:()=>y,uL:()=>z.uL,fv:()=>z.fv,fK:()=>g.deleteProviderConnection,op:()=>g.deleteProviderConnectionsByProvider,Pc:()=>h.deleteProviderNode,Yd:()=>p,tm:()=>D,oF:()=>E,zP:()=>S,rg:()=>F.rg,yg:()=>q.getApiKeyById,mY:()=>q.getApiKeyByKey,PX:()=>q.getApiKeys,j$:()=>F.j$,L:()=>u,Dj:()=>v,Uv:()=>t,uv:()=>z.uv,vF:()=>C,Lk:()=>Q,Re:()=>F.Re,R0:()=>F.R0,c:()=>z.getMitmAlias,OM:()=>z.OM,r4:()=>A.r4,Mc:()=>g.getProviderConnectionById,P:()=>g.getProviderConnections,Qu:()=>h.getProviderNodeById,Fh:()=>h.getProviderNodes,hr:()=>m,ui:()=>l,Zx:()=>F.Zx,SL:()=>P,mt:()=>f.getSettings,Q5:()=>F.Q5,PK:()=>F.PK,M2:()=>F.M2,BY:()=>F.BY,K1:()=>T,VT:()=>A.VT,yF:()=>A.yF,ox:()=>O,sZ:()=>F.sZ,L9:()=>z.L9,o5:()=>z.o5,_V:()=>F._V,uw:()=>F.uw,XW:()=>q.updateApiKey,oG:()=>x,KJ:()=>A.KJ,rj:()=>g.updateProviderConnection,ho:()=>h.updateProviderNode,Q_:()=>o,Xx:()=>f.Xx,ek:()=>q.validateApiKey});var d=c(36366),e=c(644),f=c(42655),g=c(5781),h=c(1129),i=c(94755);function j(a){return a?{...(0,e.q)(a.data,{}),id:a.id,isActive:1===a.isActive||!0===a.isActive,testStatus:a.testStatus,createdAt:a.createdAt,updatedAt:a.updatedAt}:null}function k(a,b){let c=function(a){let{id:b,isActive:c,testStatus:d,createdAt:f,updatedAt:g,...h}=a;return{id:b,isActive:+(!1!==c),testStatus:d??null,data:(0,e.s)(h),createdAt:f,updatedAt:g}}(b);a.run(`INSERT INTO proxyPools(id, isActive, testStatus, data, createdAt, updatedAt)
10
10
  VALUES(?, ?, ?, ?, ?, ?)
11
11
  ON CONFLICT(id) DO UPDATE SET
12
12
  isActive=excluded.isActive, testStatus=excluded.testStatus,
@@ -1,5 +1,5 @@
1
1
  "use strict";exports.id=9703,exports.ids=[9703],exports.modules={644:(a,b,c)=>{function d(a,b=null){if(null==a)return b;if("string"!=typeof a)return a;try{return JSON.parse(a)}catch{return b}}function e(a){return JSON.stringify(a??null)}c.d(b,{q:()=>d,s:()=>e})},36366:(a,b,c)=>{c.d(b,{c:()=>k});var d=c(95658);global._dbAdapter||(global._dbAdapter={instance:null,initPromise:null,logged:!1});let e=global._dbAdapter;async function f(){if(!process.versions.bun)return null;try{let{createBunSqliteAdapter:a}=await c.e(4739).then(c.bind(c,24739));return await a(d.AL)}catch(a){return console.warn(`[DB] bun:sqlite unavailable: ${a.message}`),null}}async function g(){if(process.versions.bun)return null;try{let{createBetterSqliteAdapter:a}=await c.e(5258).then(c.bind(c,25258));return a(d.AL)}catch(a){return console.warn(`[DB] better-sqlite3 unavailable: ${a.message}`),null}}async function h(){if(process.versions.bun)return null;let[a,b]=process.versions.node.split(".").map(Number);if(a<22||22===a&&b<5)return null;try{let{createNodeSqliteAdapter:a}=await c.e(8520).then(c.bind(c,88520));return await a(d.AL)}catch(a){return console.warn(`[DB] node:sqlite unavailable: ${a.message}`),null}}async function i(){try{let{createSqlJsAdapter:a}=await c.e(3593).then(c.bind(c,53593));return await a(d.AL)}catch(a){return console.warn(`[DB] sql.js unavailable: ${a.message}`),null}}async function j(){(0,d.Jh)();let a=await f();if(a||(a=await g()),a||(a=await h()),a||(a=await i()),!a)throw Error("[DB] No SQLite driver available (bun/better/node/sql.js all failed)");e.logged||(console.log(`[DB] Driver: ${a.driver} | file: ${d.AL}`),e.logged=!0);let{runMigrationOnce:b}=await c.e(874).then(c.bind(c,90874));return await b(a),a}async function k(){return e.instance?e.instance:(e.initPromise||(e.initPromise=j().then(a=>(e.instance=a,a))),e.initPromise)}},58273:(a,b,c)=>{c.d(b,{n:()=>r});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h),j=c(76760),k=c.n(j),l=c(48161),m=c.n(l);function n(a){if(!a)return!1;try{let b=k().join(a,".migrated-from");if(e().existsSync(b))return!1;let c="win32"===process.platform?k().join(process.env.APPDATA||k().join(m().homedir(),"AppData","Roaming"),"9router"):k().join(m().homedir(),".9router");if(!c||!e().existsSync(c))return e().mkdirSync(a,{recursive:!0}),e().writeFileSync(b,"none\n"),!1;if(function(a){let b=["db.sqlite","db.json","usage.json","settings.json"],c=[];try{for(let d of e().readdirSync(a))b.includes(d)&&c.push(d)}catch{}return c}(a).length>0)return e().writeFileSync(b,"skipped: new dir already populated\n"),!1;return e().mkdirSync(a,{recursive:!0}),function a(b,c){for(let d of(e().mkdirSync(c,{recursive:!0}),e().readdirSync(b,{withFileTypes:!0}))){if("runtime"===d.name)continue;let f=k().join(b,d.name),g=k().join(c,d.name);d.isDirectory()?a(f,g):e().copyFileSync(f,g)}}(c,a),e().writeFileSync(b,`${c}
2
- `),console.log(`[extremerouter] migrated data from ${c} → ${a}`),!0}catch(a){return console.warn(`[extremerouter] data migration skipped: ${a?.message||a}`),!1}}let o="extremerouter";function p(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),o):g().join(i().homedir(),`.${o}`)}function q(){let a=p();return e().mkdirSync(a,{recursive:!0}),n(a),a}let r=function(){let a=process.env.DATA_DIR,b=a||p();if("win32"===process.platform&&a&&/^\//.test(a))return console.warn(`[DATA_DIR] '${a}' is a Unix path on Windows → fallback to default`),q();try{return e().mkdirSync(b,{recursive:!0}),a||n(b),b}catch(a){if(a?.code==="EACCES"||a?.code==="EPERM")return console.warn(`[DATA_DIR] '${b}' not writable → fallback ~/.${o}`),q();throw a}}()},58920:(a,b,c)=>{c.d(b,{PROVIDER_PRICING:()=>e,ad:()=>i,calculateCostFromTokens:()=>j,gH:()=>g,getPricingForModel:()=>h});let d={"claude-opus-4-6":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-opus-4-5-20251101":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-sonnet-4-6":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-sonnet-4-5-20250929":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-haiku-4-5-20251001":{input:1,output:5,cached:.1,reasoning:5,cache_creation:1.25},"claude-sonnet-4-20250514":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-opus-4-20250514":{input:15,output:25,cached:7.5,reasoning:112.5,cache_creation:15},"claude-3-5-sonnet-20241022":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-haiku-4.5":{input:.5,output:2.5,cached:.05,reasoning:3.75,cache_creation:.5},"claude-opus-4.1":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.5":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.6":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-sonnet-4":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.6":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-opus-4-5-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4-6-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.7":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.8":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-sonnet-5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-5-thinking":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-fable-5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"gpt-3.5-turbo":{input:.5,output:1.5,cached:.25,reasoning:2.25,cache_creation:.5},"gpt-4":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4-turbo":{input:10,output:30,cached:5,reasoning:45,cache_creation:10},"gpt-4o":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4o-mini":{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15},"gpt-4.1":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-5":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5-mini":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"gpt-5-codex":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5.1":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex-mini":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"gpt-5.1-codex-mini-high":{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.2":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.2-codex":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.3-codex":{input:6,output:24,cached:3,reasoning:36,cache_creation:6},"gpt-5.3-codex-xhigh":{input:10,output:40,cached:5,reasoning:60,cache_creation:10},"gpt-5.3-codex-high":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.3-codex-low":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.3-codex-none":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5.3-codex-spark":{input:3,output:12,cached:.3,reasoning:12,cache_creation:3},"gpt-5.4":{input:6,output:24,cached:3,reasoning:36,cache_creation:6},"gpt-5.4-mini":{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"gpt-5.4-nano":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"gpt-5.5":{input:7,output:28,cached:3.5,reasoning:42,cache_creation:7},"gpt-5.6-luna":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.6-sol":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.6-terra":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},o1:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15},"o1-mini":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gemini-3-flash-preview":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-pro-preview":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3.1-pro-low":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3.1-pro-high":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-pro-agent":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-3-flash-agent":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3.5-flash-low":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3.5-flash-extra-low":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-flash":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"gemini-2.5-flash-lite":{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15},"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"qwen3-coder-flash":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"kimi-k2":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-k2-thinking":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"kimi-k2.5":{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2},"kimi-k2.5-thinking":{input:1.8,output:7.2,cached:.9,reasoning:10.8,cache_creation:1.8},"kimi-latest":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"deepseek-chat":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-r1":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v3.2-chat":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v3.2-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4-flash":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4-pro":{input:.435,output:.87,cached:.003625,reasoning:.87,cache_creation:.435},"glm-4.6":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.6v":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-5":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"MiniMax-M3":{input:.3,output:1.2,cached:.06,reasoning:1.8,cache_creation:.3},"MiniMax-M2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.5":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.7":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"minimax-m2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"minimax-m2.5":{input:.6,output:2.4,cached:.3,reasoning:3.6,cache_creation:.6},"grok-code-fast-1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},auto:{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"oswe-vscode-prime":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"gpt-oss-120b-medium":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"vision-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"coder-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},e={gh:{"gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},forge:{"gpt-5.6-sol":{input:5,output:30},"gpt-5.6-terra":{input:2.5,output:15},"gpt-5.6-luna":{input:1,output:6},"gpt-5.5":{input:5,output:40},"gpt-5.3-codex":{input:1.75,output:14},"claude-opus-4-5-20251101":{input:5,output:25},"claude-sonnet-4-5-20250929":{input:3,output:15},"claude-haiku-4-5-20251001":{input:1,output:5},"claude-sonnet-4-6":{input:3,output:15},"claude-sonnet-4-6-thinking":{input:3,output:15},"claude-sonnet-5":{input:2,output:10},"claude-fable-5":{input:10,output:50},"grok-4.5":{input:2,output:6},"grok-4.3":{input:1.25,output:2.5},"grok-build-0.1":{input:1,output:2},"deepseek-r1":{input:.401,output:1.605},"deepseek-v4-flash":{input:.098,output:.196},"deepseek-v4-pro":{input:.304,output:.609},"deepseek-v3.2":{input:.2,output:.301},"deepseek-v3.1":{input:.401,output:1.204},"deepseek-v3":{input:.2,output:.802},"kimi-k3":{input:3,output:15},"kimi-k2.7-code":{input:.625,output:2.599},"kimi-k2.6":{input:.625,output:2.599},"kimi-k2.5":{input:.401,output:2.107},"gemini-3-pro-preview":{input:2,output:12},"gemini-3.5-flash":{input:1.5,output:9},"tencent/hy3":{input:.2,output:.8},"mimo-v2.5":{input:.1,output:.2},"mimo-v2.5-pro":{input:.3,output:.6},"MiniMax-M3":{input:.21,output:.84},"MiniMax-M2.5":{input:.21,output:.84},"glm-5.2":{input:.77,output:2.695}},tokenrouter:{"MiniMax-M3":{input:.3,output:1.2,cached:.06,reasoning:1.2},"anthropic/claude-fable-5":{input:10,output:50,cached:1,cache_creation:12.5,reasoning:50},"anthropic/claude-haiku-4.5":{input:1,output:5,cached:.1,cache_creation:1.25,reasoning:5},"anthropic/claude-opus-4.5":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.6":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.7":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.7-fast":{input:30,output:150,cached:3,reasoning:150},"anthropic/claude-opus-4.8":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.8-fast":{input:10,output:50,cached:1,cache_creation:12.5,reasoning:50},"anthropic/claude-opus-5":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-5-fast":{input:10,output:50,cached:1,cache_creation:12.5,reasoning:50},"anthropic/claude-sonnet-4":{input:3,output:15,cached:.3,cache_creation:3.75,reasoning:15},"anthropic/claude-sonnet-4.5":{input:3,output:15,cached:.3,cache_creation:3.75,reasoning:15},"anthropic/claude-sonnet-4.6":{input:3,output:15,cached:.3,cache_creation:3.75,reasoning:15},"anthropic/claude-sonnet-5":{input:2,output:10,cached:.2,reasoning:10},"claude-opus-4-8-m-aws":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"deepseek/deepseek-v3.2":{input:.26,output:.38,cached:.13,reasoning:.38},"deepseek/deepseek-v4-flash":{input:.14,output:.28,cached:.0028,reasoning:.28},"deepseek/deepseek-v4-flash-0731":{input:.14,output:.28,cached:.0028,reasoning:.28},"deepseek/deepseek-v4-pro":{input:.435,output:.87,cached:.003625,reasoning:.87},"ex/gpt-5.4":{input:2.5,output:15,cached:.25,reasoning:15},"google/gemini-2.5-flash-image":{input:.3,output:2.5,reasoning:2.5},"google/gemini-3-flash-preview":{input:.5,output:3,cached:.05,cache_creation:.08333,reasoning:3},"google/gemini-3-pro-image-preview":{input:2,output:12,reasoning:12},"google/gemini-3.1-flash-image-preview":{input:.5,output:3,reasoning:3},"google/gemini-3.1-flash-lite-image":{input:.25,output:1.5,reasoning:1.5},"google/gemini-3.1-pro-preview":{input:2,output:12,cached:.2,cache_creation:.375,reasoning:12},"google/gemini-3.5-flash":{input:1.5,output:9,cached:.15,cache_creation:.08333,reasoning:9},"google/gemini-3.5-flash-lite":{input:.3,output:2.5,cached:.03,cache_creation:.08333,reasoning:2.5},"google/gemini-3.6-flash":{input:1.5,output:7.5,cached:.15,cache_creation:.08333,reasoning:7.5},"google/gemini-embedding-2":{input:1,output:6,cached:.1,reasoning:6},"google/gemma-4-26b-a4b-it":{input:.06,output:.33,reasoning:.33},"kling-3.0-turbo":{input:2.1,output:2.1,reasoning:2.1},"microsoft/mai-image-2.5":{input:5,output:47,reasoning:47},"minimax/minimax-m2-her":{input:.3,output:1.2,cached:.03,reasoning:1.2},"minimax/minimax-m2.1":{input:.3,output:1.2,cached:.03,reasoning:1.2},"minimax/minimax-m2.1-highspeed":{input:.6,output:2.4,cached:.06,reasoning:2.4},"minimax/minimax-m2.5":{input:.3,output:1.2,cached:.03,reasoning:1.2},"minimax/minimax-m2.7":{input:.3,output:1.2,cached:.06,reasoning:1.2},"minimax/minimax-m2.7-highspeed":{input:.6,output:2.4,cached:.06,reasoning:2.4},"miromind/mirothinker-1-7-deepresearch":{input:4,output:25,reasoning:25},"miromind/mirothinker-1-7-deepresearch-mini":{input:1.25,output:10,reasoning:10},"mistralai/devstral-2512":{input:.4,output:2,cached:.04,reasoning:2},"mistralai/mistral-medium-3-5":{input:1.5,output:7.5,reasoning:7.5},"mistralai/mistral-small-2603":{input:.15,output:.6,cached:.015,reasoning:.6},"mistralai/voxtral-small-24b-2507":{input:.1,output:.3,cached:.01,reasoning:.3},"moonshotai/kimi-k2.5":{input:.6,output:3,cached:.1,reasoning:3},"moonshotai/kimi-k2.6":{input:.95,output:4,cached:.16,reasoning:4},"moonshotai/kimi-k2.7-code":{input:.9286,output:3.8571,cached:.1857,reasoning:3.8571},"moonshotai/kimi-k3":{input:3,output:15,cached:.3,reasoning:15},"nvidia/nemotron-3-super-120b-a12b":{input:.3,output:.9,cached:.1,reasoning:.9},"openai/gpt-4o-mini":{input:.15,output:.6,cached:.075,reasoning:.6},"openai/gpt-5":{input:1.25,output:10,cached:.125,reasoning:10},"openai/gpt-5-image":{input:10,output:40,cached:2.5,reasoning:40},"openai/gpt-5-image-mini":{input:2.5,output:8,cached:.25,reasoning:8},"openai/gpt-5-mini":{input:.25,output:2,cached:.025,reasoning:2},"openai/gpt-5.2":{input:1.75,output:14,cached:.175,reasoning:14},"openai/gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14},"openai/gpt-5.4":{input:2.5,output:15,cached:.25,reasoning:15},"openai/gpt-5.4-image-2":{input:8,output:30,cached:2,reasoning:30},"openai/gpt-5.4-mini":{input:.75,output:4.5,cached:.075,reasoning:4.5},"openai/gpt-5.4-nano":{input:.2,output:1.25,cached:.02,reasoning:1.25},"openai/gpt-5.4-pro":{input:30,output:180,reasoning:180},"openai/gpt-5.5":{input:5,output:30,cached:.5,reasoning:30},"openai/gpt-5.5-pro":{input:30,output:180,reasoning:180},"openai/gpt-5.6-luna":{input:.2,output:1.2,cached:.02,cache_creation:.25,reasoning:1.2},"openai/gpt-5.6-sol":{input:5,output:30,cached:.5,cache_creation:6.25,reasoning:30},"openai/gpt-5.6-terra":{input:2,output:12,cached:.2,cache_creation:2.5,reasoning:12},"openai/gpt-audio":{input:2.5,output:10,reasoning:10},"openai/gpt-audio-mini":{input:.6,output:2.4,reasoning:2.4},"openai/gpt-oss-120b":{input:.039,output:.18,reasoning:.18},"qwen/qwen3-coder-next":{input:.12,output:.75,cached:.06,reasoning:.75},"qwen/qwen3.5-122b-a10b":{input:.26,output:2.08,reasoning:2.08},"qwen/qwen3.5-35b-a3b":{input:.1625,output:1.3,reasoning:1.3},"qwen/qwen3.5-397b-a17b":{input:.39,output:2.34,reasoning:2.34},"qwen/qwen3.5-9b":{input:.1,output:.15,reasoning:.15},"qwen/qwen3.5-flash":{input:.1048,output:.4194,reasoning:.4194},"qwen/qwen3.5-plus-02-15":{input:.26,output:1.56,reasoning:1.56},"qwen/qwen3.6-plus":{input:.54,output:3.21,reasoning:3.21},"qwen/qwen3.7-max":{input:1.25,output:3.75,cached:.25,reasoning:3.75},"qwen/qwen3.7-plus":{input:.4,output:1.6,cached:.08,reasoning:1.6},"qwen/qwen3.8-max":{input:2,output:6,cached:.25,cache_creation:2.5,reasoning:6},"qwen3.5-omni-plus":{input:1,output:5.7143,reasoning:5.7143},"qwen3.6-flash":{input:.171,output:1.029,cached:.017,cache_creation:.214,reasoning:1.029},"sakana/fugu-ultra":{input:5,output:30,cached:.5,reasoning:30},"seed-2-0-code-preview-260328":{input:1,output:6,cached:.2,cache_creation:.008333,reasoning:6},"seed-2-0-lite-260428":{input:.5,output:4,cached:.1,cache_creation:.008333,reasoning:4},"seed-2-0-mini-260428":{input:.2,output:.8,cached:.04,cache_creation:.00833,reasoning:.8},"seed-2-0-pro-260328":{input:1,output:6,cached:.2,cache_creation:.008333,reasoning:6},"stepfun/step-3.5-flash":{input:.1,output:.3,cached:.02,reasoning:.3},"stepfun/step-3.7-flash":{input:.2,output:1.15,cached:.04,reasoning:1.15},"tencent/hy3-preview":{input:.066,output:.26,cached:.029,reasoning:.26},"x-ai/grok-4.1-fast":{input:.2,output:.5,cached:.05,reasoning:.5},"x-ai/grok-4.20-beta":{input:2,output:6,cached:.2,reasoning:6},"x-ai/grok-4.3":{input:1.25,output:2.5,cached:.2,reasoning:2.5},"x-ai/grok-4.5":{input:2,output:6,cached:.5,reasoning:6},"x-ai/grok-build-0.1":{input:1,output:2,cached:.2,reasoning:2},"xiaomi/mimo-v2-flash":{input:.1,output:.3,cached:.01,reasoning:.3},"xiaomi/mimo-v2-omni":{input:.4,output:2,cached:.08,reasoning:2},"xiaomi/mimo-v2-pro":{input:1,output:3,cached:.2,reasoning:3},"xiaomi/mimo-v2.5":{input:.4,output:2,cached:.08,reasoning:2},"xiaomi/mimo-v2.5-pro":{input:1,output:3,cached:.2,reasoning:3},"z-ai/glm-4.5-air":{input:.13,output:.85,cached:.025,reasoning:.85},"z-ai/glm-4.6":{input:.6,output:2.2,cached:.11,reasoning:2.2},"z-ai/glm-4.6v":{input:.3,output:.9,reasoning:.9},"z-ai/glm-4.7":{input:.6,output:2.2,cached:.11,reasoning:2.2},"z-ai/glm-5":{input:1,output:3.2,cached:.2,reasoning:3.2},"z-ai/glm-5-turbo":{input:1.2,output:4,cached:.24,reasoning:4},"z-ai/glm-5.1":{input:1.05,output:3.5,cached:.525,reasoning:3.5},"z-ai/glm-5.2":{input:1.4,output:4.4,cached:.26,reasoning:4.4}}},f=[{pattern:"*-codex-xhigh",pricing:{input:10,output:40,cached:5,reasoning:60,cache_creation:10}},{pattern:"*-codex-high",pricing:{input:8,output:32,cached:4,reasoning:48,cache_creation:8}},{pattern:"*-codex-max",pricing:{input:8,output:32,cached:4,reasoning:48,cache_creation:8}},{pattern:"*-codex-mini-*",pricing:{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},{pattern:"*-codex-mini",pricing:{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},{pattern:"*-codex-low",pricing:{input:4,output:16,cached:2,reasoning:24,cache_creation:4}},{pattern:"*-codex-none",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"*-codex-spark",pricing:{input:3,output:12,cached:.3,reasoning:12,cache_creation:3}},{pattern:"codex-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"*-codex",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"claude-opus-*",pricing:{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25}},{pattern:"claude-sonnet-*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75}},{pattern:"claude-haiku-*",pricing:{input:1,output:5,cached:.1,reasoning:5,cache_creation:1.25}},{pattern:"claude-*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75}},{pattern:"gemini-*-flash-lite",pricing:{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},{pattern:"gemini-*-flash",pricing:{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3}},{pattern:"gemini-*-pro",pricing:{input:2,output:12,cached:.25,reasoning:18,cache_creation:2}},{pattern:"gemini-3-*",pricing:{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5}},{pattern:"gemini-2.5-*",pricing:{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3}},{pattern:"gemini-*",pricing:{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5}},{pattern:"gpt-5.3-*",pricing:{input:6,output:24,cached:3,reasoning:36,cache_creation:6}},{pattern:"gpt-5.2-*",pricing:{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5}},{pattern:"gpt-5.1-*",pricing:{input:4,output:16,cached:2,reasoning:24,cache_creation:4}},{pattern:"gpt-5-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"gpt-5*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"gpt-4o-*",pricing:{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15}},{pattern:"gpt-4o",pricing:{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5}},{pattern:"gpt-4*",pricing:{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5}},{pattern:"o1-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"o1",pricing:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15}},{pattern:"o3-*",pricing:{input:10,output:40,cached:5,reasoning:60,cache_creation:10}},{pattern:"o4-*",pricing:{input:2,output:8,cached:1,reasoning:12,cache_creation:2}},{pattern:"qwen3-coder-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"qwen*-coder-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"qwen*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"kimi-*-thinking",pricing:{input:1.8,output:7.2,cached:.9,reasoning:10.8,cache_creation:1.8}},{pattern:"kimi-k2*",pricing:{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2}},{pattern:"kimi-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"deepseek-*reasoner*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-r*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-v*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"glm-5*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"glm-4*",pricing:{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75}},{pattern:"glm-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"MiniMax-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"minimax-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"grok-code-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"grok-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}}];function g(a,b){return RegExp("^"+a.split("*").map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join(".*")+"$","i").test(b)}function h(a,b){if(!b)return null;if(a&&e[a]?.[b])return e[a][b];let c=b.includes("/")?b.split("/").pop():b;if(d[c])return d[c];if(d[b])return d[b];for(let{pattern:a,pricing:d}of f)if(g(a,c)||g(a,b))return d;return null}function i(){return e}function j(a,b){if(!a||!b)return 0;let c=0,d=a.prompt_tokens||a.input_tokens||0,e=a.cached_tokens||a.cache_read_input_tokens||0,f=a.cache_creation_input_tokens||0;c+=Math.max(0,d-e-f)*(b.input/1e6),e>0&&(c+=e*((b.cached||b.input)/1e6)),c+=(a.completion_tokens||a.output_tokens||0)*(b.output/1e6);let g=a.reasoning_tokens||0;return g>0&&(c+=g*((b.reasoning||b.output)/1e6)),f>0&&(c+=f*((b.cache_creation||b.input)/1e6)),c}},62674:(a,b,c)=>{c.d(b,{IQ:()=>e,dy:()=>f,np:()=>g});var d=c(36366);async function e(a,b=null){let c=(await (0,d.c)()).get("SELECT value FROM _meta WHERE key = ?",[a]);return c?c.value:b}function f(a,b,c=null){let d=a.get("SELECT value FROM _meta WHERE key = ?",[b]);return d?d.value:c}function g(a,b,c){a.run("INSERT INTO _meta(key, value) VALUES(?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value",[b,String(c)])}},95658:(a,b,c)=>{c.d(b,{AL:()=>j,HG:()=>i,Jh:()=>m,KQ:()=>k,Or:()=>l});var d=c(76760),e=c.n(d),f=c(73024),g=c.n(f),h=c(58273);let i=e().join(h.n,"db"),j=e().join(i,"data.sqlite"),k=e().join(i,"backups"),l={main:e().join(h.n,"db.json"),usage:e().join(h.n,"usage.json"),disabled:e().join(h.n,"disabledModels.json"),details:e().join(h.n,"request-details.json")};function m(){for(let a of[h.n,i,k])g().existsSync(a)||g().mkdirSync(a,{recursive:!0})}},99703:(a,b,c)=>{c.d(b,{BY:()=>F,E5:()=>M,G9:()=>P,M2:()=>D,PK:()=>v,Q5:()=>J,R0:()=>K,Re:()=>L,Rh:()=>O,Zx:()=>N,_V:()=>s,j$:()=>H,rg:()=>B,sZ:()=>C,uw:()=>A});var d=c(94735),e=c(36366),f=c(644);c(62674);var g=c(58920);function h(a){return a&&"string"==typeof a?a.length<=8?a.charAt(0)+"***":a.slice(0,8)+"***":null}let i={"24h":864e5,"7d":6048e5,"30d":2592e6,"60d":5184e6},j=Number(process.env.USAGE_RETENTION_DAYS)||90;global._pendingRequests||(global._pendingRequests={byModel:{},byAccount:{}}),global._lastErrorProvider||(global._lastErrorProvider={provider:"",ts:0}),global._statsEmitter||(global._statsEmitter=new d.EventEmitter,global._statsEmitter.setMaxListeners(50)),global._pendingTimers||(global._pendingTimers={}),global._recentRing||(global._recentRing={items:[],initialized:!1}),global._connectionMapCache||(global._connectionMapCache={map:{},ts:0}),global._statsEmitTimers||(global._statsEmitTimers={pending:null,update:null}),global._statsFrameCache||(global._statsFrameCache={frame:null,computing:null,ts:0}),global._usagePrune||(global._usagePrune={lastAt:0});let k=global._pendingRequests,l=global._lastErrorProvider,m=global._pendingTimers,n=global._recentRing,o=global._connectionMapCache,p=global._statsEmitTimers,q=global._statsFrameCache,r=global._usagePrune,s=global._statsEmitter;function t(a,b=150){let c="update"===a?"update":"pending";p[c]||(p[c]=setTimeout(()=>{p[c]=null,s.emit(a)},b),p[c]?.unref?.())}async function u(){let a=Date.now();if(!(a-r.lastAt<216e5)){r.lastAt=a;try{let b=await (0,e.c)(),c=new Date(a-864e5*j).toISOString();b.run("DELETE FROM usageHistory WHERE timestamp < ?",[c]),b.all("SELECT name FROM sqlite_master WHERE type='table' AND name='requestDetails'").length>0&&b.run("DELETE FROM requestDetails WHERE timestamp < ?",[c])}catch(a){console.warn("[usage] prune failed:",a?.message||a)}}}async function v(a="all"){let b=Date.now();return q.frame&&q.period===a&&b-q.ts<1e3?q.frame:(q.computing&&q.computingPeriod===a||(q.computingPeriod=a,q.computing=(async()=>{try{let b=await F(a);return q.frame=b,q.period=a,q.ts=Date.now(),b}finally{q.computing=null}})()),q.computing)}function w(a,b,c){a[b]||(a[b]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0}),a[b].requests+=c.requests||1,a[b].promptTokens+=c.promptTokens||0,a[b].completionTokens+=c.completionTokens||0,a[b].cachedTokens+=c.cachedTokens||0,a[b].cost+=c.cost||0,c.meta&&Object.assign(a[b],c.meta)}async function x(){if(Date.now()-o.ts<3e4)return o.map;try{let{getProviderConnections:a}=await c.e(5781).then(c.bind(c,5781)),b=await a(),d={};for(let a of b)d[a.id]=a.name||a.email||a.id;o.map=d,o.ts=Date.now()}catch{}return o.map}async function y(){if(!n.initialized){n.initialized=!0;try{n.items=(await (0,e.c)()).all("SELECT timestamp, provider, model, connectionId, apiKey, endpoint, cost, status, tokens FROM usageHistory ORDER BY id DESC LIMIT ?",[50]).reverse().map(a=>({timestamp:a.timestamp,provider:a.provider,model:a.model,connectionId:a.connectionId,apiKey:a.apiKey,endpoint:a.endpoint,cost:a.cost,status:a.status,tokens:(0,f.q)(a.tokens,{})}))}catch{}}}async function z(a,b,d){if(!d||!a||!b)return 0;try{let{getPricingForModel:e}=await c.e(7914).then(c.bind(c,97914)),f=await e(a,b);if(!f)return 0;let{calculateCostFromTokens:g}=await Promise.resolve().then(c.bind(c,58920));return g(d,f)}catch(a){return console.error("Error calculating cost:",a),0}}function A(a,b,c,d,e=!1){let f=b?`${a} (${b})`:a,g=`${c}|${f}`;k.byModel[f]||(k.byModel[f]=0),k.byModel[f]=Math.max(0,k.byModel[f]+(d?1:-1)),0===k.byModel[f]&&delete k.byModel[f],c&&(k.byAccount[c]||(k.byAccount[c]={}),k.byAccount[c][f]||(k.byAccount[c][f]=0),k.byAccount[c][f]=Math.max(0,k.byAccount[c][f]+(d?1:-1)),0===k.byAccount[c][f]&&(delete k.byAccount[c][f],0===Object.keys(k.byAccount[c]).length&&delete k.byAccount[c])),d?(clearTimeout(m[g]),m[g]=setTimeout(()=>{delete m[g],k.byModel[f]>0&&(k.byModel[f]=0),c&&k.byAccount[c]?.[f]>0&&(k.byAccount[c][f]=0),t("pending")},6e4)):(clearTimeout(m[g]),delete m[g]),!d&&e&&b&&(l.provider=b.toLowerCase(),l.ts=Date.now());let h=new Date().toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});console.log(`[${h}] [PENDING] ${d?"START":"END"}${e?" (ERROR)":""} | provider=${b} | model=${a}`),t("pending")}async function B(){let a=[],b=await x();for(let[c,d]of Object.entries(k.byAccount))for(let[e,f]of Object.entries(d))if(f>0){let d=b[c]||`Account ${c.slice(0,8)}...`,g=e.match(/^(.*) \((.*)\)$/);a.push({model:g?g[1]:e,provider:g?g[2]:"unknown",account:d,count:f})}await y();let c=new Set;return{activeRequests:a,recentRequests:[...n.items].sort((a,b)=>new Date(b.timestamp)-new Date(a.timestamp)).map(a=>{let b=a.tokens||{};return{timestamp:a.timestamp,model:a.model,provider:a.provider||"",promptTokens:b.prompt_tokens||b.input_tokens||0,completionTokens:b.completion_tokens||b.output_tokens||0,status:a.status||"ok"}}).filter(a=>{if(0===a.promptTokens&&0===a.completionTokens)return!1;let b=a.timestamp?a.timestamp.slice(0,16):"",d=`${a.model}|${a.provider}|${a.promptTokens}|${a.completionTokens}|${b}`;return!c.has(d)&&(c.add(d),!0)}).slice(0,20),errorProvider:Date.now()-l.ts<1e4?l.provider:""}}async function C(a){try{let b=await (0,e.c)();a.timestamp||(a.timestamp=new Date().toISOString()),a.cost=await z(a.provider,a.model,a.tokens);let c=a.tokens||{},d=c.prompt_tokens||c.input_tokens||0,h=c.completion_tokens||c.output_tokens||0,i=!1;(b.transaction(()=>{var e;let j,k,l,m,n,o,p,q,r,s,t,u,v=b.get(`SELECT id, endpoint FROM usageHistory
2
+ `),console.log(`[extremerouter] migrated data from ${c} → ${a}`),!0}catch(a){return console.warn(`[extremerouter] data migration skipped: ${a?.message||a}`),!1}}let o="extremerouter";function p(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),o):g().join(i().homedir(),`.${o}`)}function q(){let a=p();return e().mkdirSync(a,{recursive:!0}),n(a),a}let r=function(){let a=process.env.DATA_DIR,b=a||p();if("win32"===process.platform&&a&&/^\//.test(a))return console.warn(`[DATA_DIR] '${a}' is a Unix path on Windows → fallback to default`),q();try{return e().mkdirSync(b,{recursive:!0}),a||n(b),b}catch(a){if(a?.code==="EACCES"||a?.code==="EPERM")return console.warn(`[DATA_DIR] '${b}' not writable → fallback ~/.${o}`),q();throw a}}()},58920:(a,b,c)=>{c.d(b,{PROVIDER_PRICING:()=>e,ad:()=>i,calculateCostFromTokens:()=>j,gH:()=>g,getPricingForModel:()=>h});let d={"claude-opus-4-6":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-opus-4-5-20251101":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-sonnet-4-6":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-sonnet-4-5-20250929":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-haiku-4-5-20251001":{input:1,output:5,cached:.1,reasoning:5,cache_creation:1.25},"claude-sonnet-4-20250514":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-opus-4-20250514":{input:15,output:25,cached:7.5,reasoning:112.5,cache_creation:15},"claude-3-5-sonnet-20241022":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-haiku-4.5":{input:.5,output:2.5,cached:.05,reasoning:3.75,cache_creation:.5},"claude-opus-4.1":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.5":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.6":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-sonnet-4":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.6":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-opus-4-5-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4-6-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.7":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.8":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-sonnet-5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-5-thinking":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-fable-5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"gpt-3.5-turbo":{input:.5,output:1.5,cached:.25,reasoning:2.25,cache_creation:.5},"gpt-4":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4-turbo":{input:10,output:30,cached:5,reasoning:45,cache_creation:10},"gpt-4o":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4o-mini":{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15},"gpt-4.1":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-5":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5-mini":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"gpt-5-codex":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5.1":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex-mini":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"gpt-5.1-codex-mini-high":{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.2":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.2-codex":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.3-codex":{input:6,output:24,cached:3,reasoning:36,cache_creation:6},"gpt-5.3-codex-xhigh":{input:10,output:40,cached:5,reasoning:60,cache_creation:10},"gpt-5.3-codex-high":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.3-codex-low":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.3-codex-none":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5.3-codex-spark":{input:3,output:12,cached:.3,reasoning:12,cache_creation:3},"gpt-5.4":{input:6,output:24,cached:3,reasoning:36,cache_creation:6},"gpt-5.4-mini":{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"gpt-5.4-nano":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"gpt-5.5":{input:7,output:28,cached:3.5,reasoning:42,cache_creation:7},"gpt-5.6-luna":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.6-sol":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.6-terra":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},o1:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15},"o1-mini":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gemini-3-flash-preview":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-pro-preview":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3.1-pro-low":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3.1-pro-high":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-pro-agent":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-3-flash-agent":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3.5-flash-low":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3.5-flash-extra-low":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-flash":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"gemini-2.5-flash-lite":{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15},"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"qwen3-coder-flash":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"kimi-k2":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-k2-thinking":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"kimi-k2.5":{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2},"kimi-k2.5-thinking":{input:1.8,output:7.2,cached:.9,reasoning:10.8,cache_creation:1.8},"kimi-latest":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"deepseek-chat":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-r1":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v3.2-chat":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v3.2-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4-flash":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4-pro":{input:.435,output:.87,cached:.003625,reasoning:.87,cache_creation:.435},"glm-4.6":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.6v":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-5":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"MiniMax-M3":{input:.3,output:1.2,cached:.06,reasoning:1.8,cache_creation:.3},"MiniMax-M2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.5":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.7":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"minimax-m2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"minimax-m2.5":{input:.6,output:2.4,cached:.3,reasoning:3.6,cache_creation:.6},"grok-code-fast-1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},auto:{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"oswe-vscode-prime":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"gpt-oss-120b-medium":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"vision-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"coder-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},e={gh:{"gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},forge:{"gpt-5.6-sol":{input:5,output:30},"gpt-5.6-terra":{input:2.5,output:15},"gpt-5.6-luna":{input:1,output:6},"gpt-5.5":{input:5,output:40},"gpt-5.3-codex":{input:1.75,output:14},"claude-opus-4-5-20251101":{input:5,output:25},"claude-sonnet-4-5-20250929":{input:3,output:15},"claude-haiku-4-5-20251001":{input:1,output:5},"claude-sonnet-4-6":{input:3,output:15},"claude-sonnet-4-6-thinking":{input:3,output:15},"claude-sonnet-5":{input:2,output:10},"claude-fable-5":{input:10,output:50},"grok-4.5":{input:2,output:6},"grok-4.3":{input:1.25,output:2.5},"grok-build-0.1":{input:1,output:2},"deepseek-r1":{input:.401,output:1.605},"deepseek-v4-flash":{input:.098,output:.196},"deepseek-v4-pro":{input:.304,output:.609},"deepseek-v3.2":{input:.2,output:.301},"deepseek-v3.1":{input:.401,output:1.204},"deepseek-v3":{input:.2,output:.802},"kimi-k3":{input:3,output:15},"kimi-k2.7-code":{input:.625,output:2.599},"kimi-k2.6":{input:.625,output:2.599},"kimi-k2.5":{input:.401,output:2.107},"gemini-3-pro-preview":{input:2,output:12},"gemini-3.5-flash":{input:1.5,output:9},"tencent/hy3":{input:.2,output:.8},"mimo-v2.5":{input:.1,output:.2},"mimo-v2.5-pro":{input:.3,output:.6},"MiniMax-M3":{input:.21,output:.84},"MiniMax-M2.5":{input:.21,output:.84},"glm-5.2":{input:.77,output:2.695}},tokenrouter:{"MiniMax-M3":{input:.3,output:1.2,cached:.06,reasoning:1.2},"anthropic/claude-fable-5":{input:10,output:50,cached:1,cache_creation:12.5,reasoning:50},"anthropic/claude-haiku-4.5":{input:1,output:5,cached:.1,cache_creation:1.25,reasoning:5},"anthropic/claude-opus-4.5":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.6":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.7":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.7-fast":{input:30,output:150,cached:3,reasoning:150},"anthropic/claude-opus-4.8":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.8-fast":{input:10,output:50,cached:1,cache_creation:12.5,reasoning:50},"anthropic/claude-opus-5":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-5-fast":{input:10,output:50,cached:1,cache_creation:12.5,reasoning:50},"anthropic/claude-sonnet-4":{input:3,output:15,cached:.3,cache_creation:3.75,reasoning:15},"anthropic/claude-sonnet-4.5":{input:3,output:15,cached:.3,cache_creation:3.75,reasoning:15},"anthropic/claude-sonnet-4.6":{input:3,output:15,cached:.3,cache_creation:3.75,reasoning:15},"anthropic/claude-sonnet-5":{input:2,output:10,cached:.2,reasoning:10},"claude-opus-4-8-m-aws":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"deepseek/deepseek-v3.2":{input:.26,output:.38,cached:.13,reasoning:.38},"deepseek/deepseek-v4-flash":{input:.14,output:.28,cached:.0028,reasoning:.28},"deepseek/deepseek-v4-flash-0731":{input:.14,output:.28,cached:.0028,reasoning:.28},"deepseek/deepseek-v4-pro":{input:.435,output:.87,cached:.003625,reasoning:.87},"ex/gpt-5.4":{input:2.5,output:15,cached:.25,reasoning:15},"google/gemini-2.5-flash-image":{input:.3,output:2.5,reasoning:2.5},"google/gemini-3-flash-preview":{input:.5,output:3,cached:.05,cache_creation:.08333,reasoning:3},"google/gemini-3-pro-image-preview":{input:2,output:12,reasoning:12},"google/gemini-3.1-flash-image-preview":{input:.5,output:3,reasoning:3},"google/gemini-3.1-flash-lite-image":{input:.25,output:1.5,reasoning:1.5},"google/gemini-3.1-pro-preview":{input:2,output:12,cached:.2,cache_creation:.375,reasoning:12},"google/gemini-3.5-flash":{input:1.5,output:9,cached:.15,cache_creation:.08333,reasoning:9},"google/gemini-3.5-flash-lite":{input:.3,output:2.5,cached:.03,cache_creation:.08333,reasoning:2.5},"google/gemini-3.6-flash":{input:1.5,output:7.5,cached:.15,cache_creation:.08333,reasoning:7.5},"google/gemini-embedding-2":{input:1,output:6,cached:.1,reasoning:6},"google/gemma-4-26b-a4b-it":{input:.06,output:.33,reasoning:.33},"kling-3.0-turbo":{input:2.1,output:2.1,reasoning:2.1},"microsoft/mai-image-2.5":{input:5,output:47,reasoning:47},"minimax/minimax-m2-her":{input:.3,output:1.2,cached:.03,reasoning:1.2},"minimax/minimax-m2.1":{input:.3,output:1.2,cached:.03,reasoning:1.2},"minimax/minimax-m2.1-highspeed":{input:.6,output:2.4,cached:.06,reasoning:2.4},"minimax/minimax-m2.5":{input:.3,output:1.2,cached:.03,reasoning:1.2},"minimax/minimax-m2.7":{input:.3,output:1.2,cached:.06,reasoning:1.2},"minimax/minimax-m2.7-highspeed":{input:.6,output:2.4,cached:.06,reasoning:2.4},"miromind/mirothinker-1-7-deepresearch":{input:4,output:25,reasoning:25},"miromind/mirothinker-1-7-deepresearch-mini":{input:1.25,output:10,reasoning:10},"mistralai/devstral-2512":{input:.4,output:2,cached:.04,reasoning:2},"mistralai/mistral-medium-3-5":{input:1.5,output:7.5,reasoning:7.5},"mistralai/mistral-small-2603":{input:.15,output:.6,cached:.015,reasoning:.6},"mistralai/voxtral-small-24b-2507":{input:.1,output:.3,cached:.01,reasoning:.3},"moonshotai/kimi-k2.5":{input:.6,output:3,cached:.1,reasoning:3},"moonshotai/kimi-k2.6":{input:.95,output:4,cached:.16,reasoning:4},"moonshotai/kimi-k2.7-code":{input:.9286,output:3.8571,cached:.1857,reasoning:3.8571},"moonshotai/kimi-k3":{input:3,output:15,cached:.3,reasoning:15},"nvidia/nemotron-3-super-120b-a12b":{input:.3,output:.9,cached:.1,reasoning:.9},"openai/gpt-4o-mini":{input:.15,output:.6,cached:.075,reasoning:.6},"openai/gpt-5":{input:1.25,output:10,cached:.125,reasoning:10},"openai/gpt-5-image":{input:10,output:40,cached:2.5,reasoning:40},"openai/gpt-5-image-mini":{input:2.5,output:8,cached:.25,reasoning:8},"openai/gpt-5-mini":{input:.25,output:2,cached:.025,reasoning:2},"openai/gpt-5.2":{input:1.75,output:14,cached:.175,reasoning:14},"openai/gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14},"openai/gpt-5.4":{input:2.5,output:15,cached:.25,reasoning:15},"openai/gpt-5.4-image-2":{input:8,output:30,cached:2,reasoning:30},"openai/gpt-5.4-mini":{input:.75,output:4.5,cached:.075,reasoning:4.5},"openai/gpt-5.4-nano":{input:.2,output:1.25,cached:.02,reasoning:1.25},"openai/gpt-5.4-pro":{input:30,output:180,reasoning:180},"openai/gpt-5.5":{input:5,output:30,cached:.5,reasoning:30},"openai/gpt-5.5-pro":{input:30,output:180,reasoning:180},"openai/gpt-5.6-luna":{input:.2,output:1.2,cached:.02,cache_creation:.25,reasoning:1.2},"openai/gpt-5.6-sol":{input:5,output:30,cached:.5,cache_creation:6.25,reasoning:30},"openai/gpt-5.6-terra":{input:2,output:12,cached:.2,cache_creation:2.5,reasoning:12},"openai/gpt-audio":{input:2.5,output:10,reasoning:10},"openai/gpt-audio-mini":{input:.6,output:2.4,reasoning:2.4},"openai/gpt-oss-120b":{input:.039,output:.18,reasoning:.18},"qwen/qwen3-coder-next":{input:.12,output:.75,cached:.06,reasoning:.75},"qwen/qwen3.5-122b-a10b":{input:.26,output:2.08,reasoning:2.08},"qwen/qwen3.5-35b-a3b":{input:.1625,output:1.3,reasoning:1.3},"qwen/qwen3.5-397b-a17b":{input:.39,output:2.34,reasoning:2.34},"qwen/qwen3.5-9b":{input:.1,output:.15,reasoning:.15},"qwen/qwen3.5-flash":{input:.1048,output:.4194,reasoning:.4194},"qwen/qwen3.5-plus-02-15":{input:.26,output:1.56,reasoning:1.56},"qwen/qwen3.6-plus":{input:.54,output:3.21,reasoning:3.21},"qwen/qwen3.7-max":{input:1.25,output:3.75,cached:.25,reasoning:3.75},"qwen/qwen3.7-plus":{input:.4,output:1.6,cached:.08,reasoning:1.6},"qwen/qwen3.8-max":{input:2,output:6,cached:.25,cache_creation:2.5,reasoning:6},"qwen3.5-omni-plus":{input:1,output:5.7143,reasoning:5.7143},"qwen3.6-flash":{input:.171,output:1.029,cached:.017,cache_creation:.214,reasoning:1.029},"sakana/fugu-ultra":{input:5,output:30,cached:.5,reasoning:30},"seed-2-0-code-preview-260328":{input:1,output:6,cached:.2,cache_creation:.008333,reasoning:6},"seed-2-0-lite-260428":{input:.5,output:4,cached:.1,cache_creation:.008333,reasoning:4},"seed-2-0-mini-260428":{input:.2,output:.8,cached:.04,cache_creation:.00833,reasoning:.8},"seed-2-0-pro-260328":{input:1,output:6,cached:.2,cache_creation:.008333,reasoning:6},"stepfun/step-3.5-flash":{input:.1,output:.3,cached:.02,reasoning:.3},"stepfun/step-3.7-flash":{input:.2,output:1.15,cached:.04,reasoning:1.15},"tencent/hy3-preview":{input:.066,output:.26,cached:.029,reasoning:.26},"x-ai/grok-4.1-fast":{input:.2,output:.5,cached:.05,reasoning:.5},"x-ai/grok-4.20-beta":{input:2,output:6,cached:.2,reasoning:6},"x-ai/grok-4.3":{input:1.25,output:2.5,cached:.2,reasoning:2.5},"x-ai/grok-4.5":{input:2,output:6,cached:.5,reasoning:6},"x-ai/grok-build-0.1":{input:1,output:2,cached:.2,reasoning:2},"xiaomi/mimo-v2-flash":{input:.1,output:.3,cached:.01,reasoning:.3},"xiaomi/mimo-v2-omni":{input:.4,output:2,cached:.08,reasoning:2},"xiaomi/mimo-v2-pro":{input:1,output:3,cached:.2,reasoning:3},"xiaomi/mimo-v2.5":{input:.4,output:2,cached:.08,reasoning:2},"xiaomi/mimo-v2.5-pro":{input:1,output:3,cached:.2,reasoning:3},"z-ai/glm-4.5-air":{input:.13,output:.85,cached:.025,reasoning:.85},"z-ai/glm-4.6":{input:.6,output:2.2,cached:.11,reasoning:2.2},"z-ai/glm-4.6v":{input:.3,output:.9,reasoning:.9},"z-ai/glm-4.7":{input:.6,output:2.2,cached:.11,reasoning:2.2},"z-ai/glm-5":{input:1,output:3.2,cached:.2,reasoning:3.2},"z-ai/glm-5-turbo":{input:1.2,output:4,cached:.24,reasoning:4},"z-ai/glm-5.1":{input:1.05,output:3.5,cached:.525,reasoning:3.5},"z-ai/glm-5.2":{input:1.4,output:4.4,cached:.26,reasoning:4.4}},tokenharbor:{"claude-opus-5":{input:5,output:25,cached:.5,reasoning:25},"claude-fable-5":{input:10,output:50,cached:1,reasoning:50},"gpt-5.6-sol":{input:5,output:30,cached:.5,reasoning:30},"kimi-k3":{input:3,output:15,cached:.3,reasoning:15},"qwen3.8-max":{input:2,output:6,cached:.25,reasoning:6},"gpt-5.6-terra":{input:2,output:12,cached:.2,reasoning:12},"grok-4.5":{input:2,output:6,cached:.2,reasoning:6},"claude-sonnet-5":{input:2,output:10,cached:.2,reasoning:10},"glm-5.2":{input:1.4,output:4.4,cached:.26,reasoning:4.4},"gemini-3.6-flash":{input:1.5,output:7.5,cached:.15,reasoning:7.5}},"meta-ai":{"muse-spark-1.2":{input:1.25,output:4.25,cached:.15,reasoning:4.25},"muse-spark-1.2-contributor":{input:.1,output:.2,cached:.15,reasoning:.2},"muse-spark-1.1":{input:1.25,output:4.25,cached:.15,reasoning:4.25}}},f=[{pattern:"*-codex-xhigh",pricing:{input:10,output:40,cached:5,reasoning:60,cache_creation:10}},{pattern:"*-codex-high",pricing:{input:8,output:32,cached:4,reasoning:48,cache_creation:8}},{pattern:"*-codex-max",pricing:{input:8,output:32,cached:4,reasoning:48,cache_creation:8}},{pattern:"*-codex-mini-*",pricing:{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},{pattern:"*-codex-mini",pricing:{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},{pattern:"*-codex-low",pricing:{input:4,output:16,cached:2,reasoning:24,cache_creation:4}},{pattern:"*-codex-none",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"*-codex-spark",pricing:{input:3,output:12,cached:.3,reasoning:12,cache_creation:3}},{pattern:"codex-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"*-codex",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"claude-opus-*",pricing:{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25}},{pattern:"claude-sonnet-*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75}},{pattern:"claude-haiku-*",pricing:{input:1,output:5,cached:.1,reasoning:5,cache_creation:1.25}},{pattern:"claude-*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75}},{pattern:"gemini-*-flash-lite",pricing:{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},{pattern:"gemini-*-flash",pricing:{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3}},{pattern:"gemini-*-pro",pricing:{input:2,output:12,cached:.25,reasoning:18,cache_creation:2}},{pattern:"gemini-3-*",pricing:{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5}},{pattern:"gemini-2.5-*",pricing:{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3}},{pattern:"gemini-*",pricing:{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5}},{pattern:"gpt-5.3-*",pricing:{input:6,output:24,cached:3,reasoning:36,cache_creation:6}},{pattern:"gpt-5.2-*",pricing:{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5}},{pattern:"gpt-5.1-*",pricing:{input:4,output:16,cached:2,reasoning:24,cache_creation:4}},{pattern:"gpt-5-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"gpt-5*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"gpt-4o-*",pricing:{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15}},{pattern:"gpt-4o",pricing:{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5}},{pattern:"gpt-4*",pricing:{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5}},{pattern:"o1-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"o1",pricing:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15}},{pattern:"o3-*",pricing:{input:10,output:40,cached:5,reasoning:60,cache_creation:10}},{pattern:"o4-*",pricing:{input:2,output:8,cached:1,reasoning:12,cache_creation:2}},{pattern:"qwen3-coder-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"qwen*-coder-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"qwen*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"kimi-*-thinking",pricing:{input:1.8,output:7.2,cached:.9,reasoning:10.8,cache_creation:1.8}},{pattern:"kimi-k2*",pricing:{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2}},{pattern:"kimi-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"deepseek-*reasoner*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-r*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-v*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"glm-5*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"glm-4*",pricing:{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75}},{pattern:"glm-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"MiniMax-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"minimax-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"grok-code-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"grok-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}}];function g(a,b){return RegExp("^"+a.split("*").map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join(".*")+"$","i").test(b)}function h(a,b){if(!b)return null;if(a&&e[a]?.[b])return e[a][b];let c=b.includes("/")?b.split("/").pop():b;if(d[c])return d[c];if(d[b])return d[b];for(let{pattern:a,pricing:d}of f)if(g(a,c)||g(a,b))return d;return null}function i(){return e}function j(a,b){if(!a||!b)return 0;let c=0,d=a.prompt_tokens||a.input_tokens||0,e=a.cached_tokens||a.cache_read_input_tokens||0,f=a.cache_creation_input_tokens||0;c+=Math.max(0,d-e-f)*(b.input/1e6),e>0&&(c+=e*((b.cached||b.input)/1e6)),c+=(a.completion_tokens||a.output_tokens||0)*(b.output/1e6);let g=a.reasoning_tokens||0;return g>0&&(c+=g*((b.reasoning||b.output)/1e6)),f>0&&(c+=f*((b.cache_creation||b.input)/1e6)),c}},62674:(a,b,c)=>{c.d(b,{IQ:()=>e,dy:()=>f,np:()=>g});var d=c(36366);async function e(a,b=null){let c=(await (0,d.c)()).get("SELECT value FROM _meta WHERE key = ?",[a]);return c?c.value:b}function f(a,b,c=null){let d=a.get("SELECT value FROM _meta WHERE key = ?",[b]);return d?d.value:c}function g(a,b,c){a.run("INSERT INTO _meta(key, value) VALUES(?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value",[b,String(c)])}},95658:(a,b,c)=>{c.d(b,{AL:()=>j,HG:()=>i,Jh:()=>m,KQ:()=>k,Or:()=>l});var d=c(76760),e=c.n(d),f=c(73024),g=c.n(f),h=c(58273);let i=e().join(h.n,"db"),j=e().join(i,"data.sqlite"),k=e().join(i,"backups"),l={main:e().join(h.n,"db.json"),usage:e().join(h.n,"usage.json"),disabled:e().join(h.n,"disabledModels.json"),details:e().join(h.n,"request-details.json")};function m(){for(let a of[h.n,i,k])g().existsSync(a)||g().mkdirSync(a,{recursive:!0})}},99703:(a,b,c)=>{c.d(b,{BY:()=>F,E5:()=>M,G9:()=>P,M2:()=>D,PK:()=>v,Q5:()=>J,R0:()=>K,Re:()=>L,Rh:()=>O,Zx:()=>N,_V:()=>s,j$:()=>H,rg:()=>B,sZ:()=>C,uw:()=>A});var d=c(94735),e=c(36366),f=c(644);c(62674);var g=c(58920);function h(a){return a&&"string"==typeof a?a.length<=8?a.charAt(0)+"***":a.slice(0,8)+"***":null}let i={"24h":864e5,"7d":6048e5,"30d":2592e6,"60d":5184e6},j=Number(process.env.USAGE_RETENTION_DAYS)||90;global._pendingRequests||(global._pendingRequests={byModel:{},byAccount:{}}),global._lastErrorProvider||(global._lastErrorProvider={provider:"",ts:0}),global._statsEmitter||(global._statsEmitter=new d.EventEmitter,global._statsEmitter.setMaxListeners(50)),global._pendingTimers||(global._pendingTimers={}),global._recentRing||(global._recentRing={items:[],initialized:!1}),global._connectionMapCache||(global._connectionMapCache={map:{},ts:0}),global._statsEmitTimers||(global._statsEmitTimers={pending:null,update:null}),global._statsFrameCache||(global._statsFrameCache={frame:null,computing:null,ts:0}),global._usagePrune||(global._usagePrune={lastAt:0});let k=global._pendingRequests,l=global._lastErrorProvider,m=global._pendingTimers,n=global._recentRing,o=global._connectionMapCache,p=global._statsEmitTimers,q=global._statsFrameCache,r=global._usagePrune,s=global._statsEmitter;function t(a,b=150){let c="update"===a?"update":"pending";p[c]||(p[c]=setTimeout(()=>{p[c]=null,s.emit(a)},b),p[c]?.unref?.())}async function u(){let a=Date.now();if(!(a-r.lastAt<216e5)){r.lastAt=a;try{let b=await (0,e.c)(),c=new Date(a-864e5*j).toISOString();b.run("DELETE FROM usageHistory WHERE timestamp < ?",[c]),b.all("SELECT name FROM sqlite_master WHERE type='table' AND name='requestDetails'").length>0&&b.run("DELETE FROM requestDetails WHERE timestamp < ?",[c])}catch(a){console.warn("[usage] prune failed:",a?.message||a)}}}async function v(a="all"){let b=Date.now();return q.frame&&q.period===a&&b-q.ts<1e3?q.frame:(q.computing&&q.computingPeriod===a||(q.computingPeriod=a,q.computing=(async()=>{try{let b=await F(a);return q.frame=b,q.period=a,q.ts=Date.now(),b}finally{q.computing=null}})()),q.computing)}function w(a,b,c){a[b]||(a[b]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0}),a[b].requests+=c.requests||1,a[b].promptTokens+=c.promptTokens||0,a[b].completionTokens+=c.completionTokens||0,a[b].cachedTokens+=c.cachedTokens||0,a[b].cost+=c.cost||0,c.meta&&Object.assign(a[b],c.meta)}async function x(){if(Date.now()-o.ts<3e4)return o.map;try{let{getProviderConnections:a}=await c.e(5781).then(c.bind(c,5781)),b=await a(),d={};for(let a of b)d[a.id]=a.name||a.email||a.id;o.map=d,o.ts=Date.now()}catch{}return o.map}async function y(){if(!n.initialized){n.initialized=!0;try{n.items=(await (0,e.c)()).all("SELECT timestamp, provider, model, connectionId, apiKey, endpoint, cost, status, tokens FROM usageHistory ORDER BY id DESC LIMIT ?",[50]).reverse().map(a=>({timestamp:a.timestamp,provider:a.provider,model:a.model,connectionId:a.connectionId,apiKey:a.apiKey,endpoint:a.endpoint,cost:a.cost,status:a.status,tokens:(0,f.q)(a.tokens,{})}))}catch{}}}async function z(a,b,d){if(!d||!a||!b)return 0;try{let{getPricingForModel:e}=await c.e(7914).then(c.bind(c,97914)),f=await e(a,b);if(!f)return 0;let{calculateCostFromTokens:g}=await Promise.resolve().then(c.bind(c,58920));return g(d,f)}catch(a){return console.error("Error calculating cost:",a),0}}function A(a,b,c,d,e=!1){let f=b?`${a} (${b})`:a,g=`${c}|${f}`;k.byModel[f]||(k.byModel[f]=0),k.byModel[f]=Math.max(0,k.byModel[f]+(d?1:-1)),0===k.byModel[f]&&delete k.byModel[f],c&&(k.byAccount[c]||(k.byAccount[c]={}),k.byAccount[c][f]||(k.byAccount[c][f]=0),k.byAccount[c][f]=Math.max(0,k.byAccount[c][f]+(d?1:-1)),0===k.byAccount[c][f]&&(delete k.byAccount[c][f],0===Object.keys(k.byAccount[c]).length&&delete k.byAccount[c])),d?(clearTimeout(m[g]),m[g]=setTimeout(()=>{delete m[g],k.byModel[f]>0&&(k.byModel[f]=0),c&&k.byAccount[c]?.[f]>0&&(k.byAccount[c][f]=0),t("pending")},6e4)):(clearTimeout(m[g]),delete m[g]),!d&&e&&b&&(l.provider=b.toLowerCase(),l.ts=Date.now());let h=new Date().toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});console.log(`[${h}] [PENDING] ${d?"START":"END"}${e?" (ERROR)":""} | provider=${b} | model=${a}`),t("pending")}async function B(){let a=[],b=await x();for(let[c,d]of Object.entries(k.byAccount))for(let[e,f]of Object.entries(d))if(f>0){let d=b[c]||`Account ${c.slice(0,8)}...`,g=e.match(/^(.*) \((.*)\)$/);a.push({model:g?g[1]:e,provider:g?g[2]:"unknown",account:d,count:f})}await y();let c=new Set;return{activeRequests:a,recentRequests:[...n.items].sort((a,b)=>new Date(b.timestamp)-new Date(a.timestamp)).map(a=>{let b=a.tokens||{};return{timestamp:a.timestamp,model:a.model,provider:a.provider||"",promptTokens:b.prompt_tokens||b.input_tokens||0,completionTokens:b.completion_tokens||b.output_tokens||0,status:a.status||"ok"}}).filter(a=>{if(0===a.promptTokens&&0===a.completionTokens)return!1;let b=a.timestamp?a.timestamp.slice(0,16):"",d=`${a.model}|${a.provider}|${a.promptTokens}|${a.completionTokens}|${b}`;return!c.has(d)&&(c.add(d),!0)}).slice(0,20),errorProvider:Date.now()-l.ts<1e4?l.provider:""}}async function C(a){try{let b=await (0,e.c)();a.timestamp||(a.timestamp=new Date().toISOString()),a.cost=await z(a.provider,a.model,a.tokens);let c=a.tokens||{},d=c.prompt_tokens||c.input_tokens||0,h=c.completion_tokens||c.output_tokens||0,i=!1;(b.transaction(()=>{var e;let j,k,l,m,n,o,p,q,r,s,t,u,v=b.get(`SELECT id, endpoint FROM usageHistory
3
3
  WHERE timestamp = ?
4
4
  AND COALESCE(provider, '') = COALESCE(?, '')
5
5
  AND COALESCE(model, '') = COALESCE(?, '')
@@ -1 +1 @@
1
- globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/j7bBgtavtSkTBPfbmetr9/_buildManifest.js","static/j7bBgtavtSkTBPfbmetr9/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-c2bac8d80aa27536.js","static/chunks/4bd1b696-e356ca5ba0218e27.js","static/chunks/3794-1b03b52e3112452e.js","static/chunks/main-app-f661afc91c813cfe.js"],rootMainFilesTree:{},pages:{"/_app":[]}};
1
+ globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/JRaGItQgERhBp83cHyRqE/_buildManifest.js","static/JRaGItQgERhBp83cHyRqE/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-c2bac8d80aa27536.js","static/chunks/4bd1b696-e356ca5ba0218e27.js","static/chunks/3794-1b03b52e3112452e.js","static/chunks/main-app-f661afc91c813cfe.js"],rootMainFilesTree:{},pages:{"/_app":[]}};