@sifxprime/krouter 0.5.26 → 0.5.30

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 (527) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +4 -4
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/environment/page.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/environment/page.js.nft.json +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/environment/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  70. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  72. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  73. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  74. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  75. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  76. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  77. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  78. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  79. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  80. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  81. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  82. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  83. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  84. package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  85. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  86. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  87. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +4 -4
  88. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  89. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  90. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  91. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  96. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/cache/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +1 -1
  100. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  110. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  119. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/import/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  131. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  135. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/mitm/cert/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/models/live/route.js +1 -1
  142. package/app/.next-cli-build/server/app/api/models/live/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  144. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  146. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  148. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  150. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  152. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  166. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  169. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  171. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  173. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  176. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  179. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/providers/validate/route.js +51 -1
  181. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/settings/environment/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  193. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  197. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  199. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  203. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  205. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  214. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  230. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  232. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  234. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  237. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  242. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  244. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  245. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  246. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  248. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  250. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  252. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  254. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  259. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  261. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  263. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  265. package/app/.next-cli-build/server/app/callback.html +1 -1
  266. package/app/.next-cli-build/server/app/callback.rsc +4 -4
  267. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
  268. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  269. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +4 -4
  270. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  271. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  272. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  273. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  274. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
  275. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  276. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  277. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  278. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  279. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  280. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  281. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
  282. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  283. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  284. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
  285. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  286. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  287. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  288. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  289. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  290. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  291. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
  292. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  293. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  294. package/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
  295. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  296. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  297. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  298. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  299. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  300. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  301. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
  302. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  303. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  304. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
  305. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  306. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  307. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  308. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  309. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
  310. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  311. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
  312. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  313. package/app/.next-cli-build/server/app/dashboard/environment.html +1 -1
  314. package/app/.next-cli-build/server/app/dashboard/environment.rsc +6 -6
  315. package/app/.next-cli-build/server/app/dashboard/environment.segments/!KGRhc2hib2FyZCk/dashboard/environment/__PAGE__.segment.rsc +2 -2
  316. package/app/.next-cli-build/server/app/dashboard/environment.segments/!KGRhc2hib2FyZCk/dashboard/environment.segment.rsc +1 -1
  317. package/app/.next-cli-build/server/app/dashboard/environment.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  318. package/app/.next-cli-build/server/app/dashboard/environment.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  319. package/app/.next-cli-build/server/app/dashboard/environment.segments/_full.segment.rsc +6 -6
  320. package/app/.next-cli-build/server/app/dashboard/environment.segments/_head.segment.rsc +1 -1
  321. package/app/.next-cli-build/server/app/dashboard/environment.segments/_index.segment.rsc +4 -4
  322. package/app/.next-cli-build/server/app/dashboard/environment.segments/_tree.segment.rsc +2 -2
  323. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  324. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +6 -6
  325. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  326. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  327. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  328. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  329. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  330. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
  331. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  332. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +4 -4
  333. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  334. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  335. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
  336. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  337. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  338. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  339. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  340. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  341. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  342. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
  343. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  344. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  345. package/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
  346. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  347. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  348. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  349. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  350. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  351. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  352. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
  353. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  354. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  355. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
  356. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  357. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  358. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  359. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  360. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  361. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  362. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  363. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
  364. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  365. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  366. package/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
  367. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  368. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  369. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  370. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  371. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  372. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  373. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
  374. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  375. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  376. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  377. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  378. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  379. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  380. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  381. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  382. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  383. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
  384. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  385. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  386. package/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
  387. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  388. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  389. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  390. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  391. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  392. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  393. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
  394. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  395. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  396. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  397. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  398. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  399. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  400. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  401. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  402. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  403. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  404. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  405. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  406. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  407. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  408. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  409. package/app/.next-cli-build/server/app/dashboard/skills.rsc +6 -6
  410. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  411. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  412. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  413. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  414. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
  415. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  416. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +4 -4
  417. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  418. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  419. package/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
  420. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  421. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  422. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  423. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  424. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  425. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  426. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
  427. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  428. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  429. package/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
  430. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  431. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  432. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  433. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  434. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  435. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  436. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
  437. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  438. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  439. package/app/.next-cli-build/server/app/dashboard.rsc +6 -6
  440. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  441. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  442. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  443. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
  444. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  445. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +4 -4
  446. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  447. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  448. package/app/.next-cli-build/server/app/index.html +1 -1
  449. package/app/.next-cli-build/server/app/index.rsc +4 -4
  450. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  451. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  452. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  453. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +4 -4
  454. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  455. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  456. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  457. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  458. package/app/.next-cli-build/server/app/landing.html +1 -1
  459. package/app/.next-cli-build/server/app/landing.rsc +4 -4
  460. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  461. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  462. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +4 -4
  463. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  464. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  465. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  466. package/app/.next-cli-build/server/app/login/page.js +1 -1
  467. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  468. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  469. package/app/.next-cli-build/server/app/login.html +1 -1
  470. package/app/.next-cli-build/server/app/login.rsc +5 -5
  471. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  472. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  473. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +4 -4
  474. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  475. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  476. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  477. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  478. package/app/.next-cli-build/server/app/page.js +1 -1
  479. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  480. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  481. package/app/.next-cli-build/server/app-paths-manifest.json +4 -4
  482. package/app/.next-cli-build/server/chunks/2365.js +1 -0
  483. package/app/.next-cli-build/server/chunks/2549.js +1 -0
  484. package/app/.next-cli-build/server/chunks/3104.js +1 -1
  485. package/app/.next-cli-build/server/chunks/3523.js +1 -0
  486. package/app/.next-cli-build/server/chunks/412.js +1 -1
  487. package/app/.next-cli-build/server/chunks/4315.js +1 -0
  488. package/app/.next-cli-build/server/chunks/4632.js +1 -1
  489. package/app/.next-cli-build/server/chunks/4746.js +51 -1
  490. package/app/.next-cli-build/server/chunks/4884.js +1 -1
  491. package/app/.next-cli-build/server/chunks/5178.js +1 -0
  492. package/app/.next-cli-build/server/chunks/{318.js → 5330.js} +8 -8
  493. package/app/.next-cli-build/server/chunks/706.js +1 -1
  494. package/app/.next-cli-build/server/chunks/7153.js +1 -1
  495. package/app/.next-cli-build/server/chunks/7540.js +4 -54
  496. package/app/.next-cli-build/server/chunks/8263.js +1 -0
  497. package/app/.next-cli-build/server/chunks/8590.js +1 -0
  498. package/app/.next-cli-build/server/chunks/8895.js +4 -4
  499. package/app/.next-cli-build/server/chunks/8962.js +2 -0
  500. package/app/.next-cli-build/server/chunks/9489.js +1 -1
  501. package/app/.next-cli-build/server/chunks/9849.js +1 -0
  502. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  503. package/app/.next-cli-build/server/middleware.js +1 -1
  504. package/app/.next-cli-build/server/pages/404.html +1 -1
  505. package/app/.next-cli-build/server/pages/500.html +1 -1
  506. package/app/.next-cli-build/static/chunks/{1321-da9628bf80ed7629.js → 1321-5e208aaa5052fbba.js} +1 -1
  507. package/app/.next-cli-build/static/chunks/{5497-a9d6c3c0b25e6ea6.js → 5497-b4a898852a915ec6.js} +2 -2
  508. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-648664c0c9dec562.js +1 -0
  509. package/app/.next-cli-build/static/css/1d0820e29b021592.css +1 -0
  510. package/app/cli/.build-home/.krouter/db/backups/{upgrade-0.5.21-to-0.5.22-0.5.22-20260622-020434 → upgrade-0.5.25-to-0.5.26-0.5.26-20260622-151730}/data.sqlite +0 -0
  511. package/app/cli/.build-home/.krouter/db/backups/{upgrade-0.5.22-to-0.5.23-0.5.23-20260622-024554 → upgrade-0.5.26-to-0.5.27-0.5.27-20260622-155729}/data.sqlite +0 -0
  512. package/app/cli/.build-home/.krouter/db/data.sqlite +0 -0
  513. package/app/cli/package.json +1 -1
  514. package/app/open-sse/services/complexityRouter.js +112 -0
  515. package/app/open-sse/services/intentClassifier.js +650 -0
  516. package/app/package.json +1 -1
  517. package/app/src/mitm/server.js +25 -25
  518. package/package.json +1 -1
  519. package/app/.next-cli-build/server/chunks/4161.js +0 -1
  520. package/app/.next-cli-build/server/chunks/4177.js +0 -1
  521. package/app/.next-cli-build/server/chunks/7501.js +0 -1
  522. package/app/.next-cli-build/server/chunks/8271.js +0 -1
  523. package/app/.next-cli-build/server/chunks/8910.js +0 -2
  524. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-c50244ab3401e007.js +0 -1
  525. package/app/.next-cli-build/static/css/71d9e5cee6803236.css +0 -1
  526. /package/app/.next-cli-build/static/{tZGuO4mSfl17sFmAOFyRU → ZIIYQ_oaHGO5J8W-kKFmS}/_buildManifest.js +0 -0
  527. /package/app/.next-cli-build/static/{tZGuO4mSfl17sFmAOFyRU → ZIIYQ_oaHGO5J8W-kKFmS}/_ssgManifest.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sifxprime/krouter",
3
- "version": "0.5.26",
3
+ "version": "0.5.30",
4
4
  "description": "kRouter (Kodelyth Router) CLI — Kodelyth AI Infrastructure",
5
5
  "homepage": "https://github.com/sifxprime/krouter",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- "use strict";exports.id=4161,exports.ids=[1998,4161],exports.modules={7803:(a,b,c)=>{c.r(b),c.d(b,{debug:()=>f,error:()=>i,info:()=>g,maskKey:()=>m,request:()=>j,response:()=>k,stream:()=>l,warn:()=>h});function d(){return new Date().toLocaleTimeString("en-US",{hour12:!1})}function e(a){if(!a)return"";if("string"==typeof a)return a;try{return JSON.stringify(a)}catch{return String(a)}}function f(a,b,c){!0;{let f=c?` ${e(c)}`:"";console.log(`[${d()}] 🔍 [${a}] ${b}${f}`)}}function g(a,b,c){!0;{let f=c?` ${e(c)}`:"";console.log(`[${d()}] ℹ️ [${a}] ${b}${f}`)}}function h(a,b,c){c&&e(c)}function i(a,b,c){!0;{let f=c?` ${e(c)}`:"";console.log(`[${d()}] ❌ [${a}] ${b}${f}`)}}function j(a,b,c){let f=c?` ${e(c)}`:"";console.log(`\x1b[36m[${d()}] 📥 ${a} ${b}${f}\x1b[0m`)}function k(a,b,c){let f=c?` ${e(c)}`:"";console.log(`[${d()}] ${a<400?"\uD83D\uDCE4":"\uD83D\uDCA5"} ${a} (${b}ms)${f}`)}function l(a,b){let c=b?` ${e(b)}`:"";console.log(`[${d()}] 🌊 [STREAM] ${a}${c}`)}function m(a){return!a||a.length<8?"***":`${a.slice(0,4)}...${a.slice(-4)}`}},19225:(a,b,c)=>{a.exports=c(44870)},39326:(a,b,c)=>{c.d(b,{B:()=>f});var d=c(71998);function e(a){return null==a?"":String(a).trim()}async function f(a={}){try{let b=e(a?.proxyPoolId),c="__none__"===b?"":b,f=function(a={}){let b=a?.connectionProxyEnabled===!0,c=e(a?.connectionProxyUrl);return{connectionProxyEnabled:b,connectionProxyUrl:c,connectionNoProxy:e(a?.connectionNoProxy)}}(a);if(c){let a=await (0,d.hr)(c),b=e(a?.proxyUrl),f=e(a?.noProxy);if(a&&!0===a.isActive&&b){if("vercel"===a.type||"cloudflare"===a.type||"deno"===a.type)return{source:a.type,proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:f,strictProxy:!0===a.strictProxy,vercelRelayUrl:b};return{source:"pool",proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!0,connectionProxyUrl:b,connectionNoProxy:f,strictProxy:!0===a.strictProxy}}}if(f.connectionProxyEnabled&&f.connectionProxyUrl)return{source:"legacy",proxyPoolId:c||null,proxyPool:null,...f};return{source:"none",proxyPoolId:c||null,proxyPool:null,...f}}catch(a){return console.error("[resolveConnectionProxyConfig] Failed to resolve proxy config:",a),{source:"error",proxyPoolId:null,proxyPool:null,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:"",strictProxy:!1}}}},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()}},53258:(a,b,c)=>{c.d(b,{Up:()=>f,gH:()=>h,uw:()=>g});let d=global.__krouterConnHealth??={scores:new Map};function e(a,b){if(!a)return function(a=Date.now()){return{ewmaLatencyMs:3e3,successCount:5,failureCount:0,lastUpdate:a}}(b);let c=b-a.lastUpdate;if(c<6e4)return a;let d=Math.pow(.5,Math.min(8,c/3e5));return{ewmaLatencyMs:a.ewmaLatencyMs+(3e3-a.ewmaLatencyMs)*(1-d),successCount:Math.max(5,a.successCount*d+5*(1-d)),failureCount:Math.max(0,a.failureCount*d),lastUpdate:a.lastUpdate}}function f(a,b,c){if(!a||"noauth"===a)return;let f=Date.now(),g=e(d.scores.get(a),f),h=Math.max(0,Math.min(6e4,c||3e3)),i=b?.3*h+.7*g.ewmaLatencyMs:g.ewmaLatencyMs;d.scores.set(a,{ewmaLatencyMs:i,successCount:g.successCount+ +!!b,failureCount:g.failureCount+ +!b,lastUpdate:f})}function g(a){if(!a)return 0;let b=Date.now(),c=e(d.scores.get(a),b),f=c.successCount+c.failureCount;return 1e3*(f>0?c.successCount/f:1)-c.ewmaLatencyMs/100}function h(a){if(!Array.isArray(a)||a.length<2)return a||[];let b=a.map((a,b)=>({c:a,i:b,s:g(a.id)}));return b.sort((a,b)=>b.s-a.s||a.i-b.i),b.map(a=>a.c)}},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(89718)},80238:(a,b,c)=>{c.d(b,{Pt:()=>n,Tr:()=>o,c1:()=>l,kI:()=>p,vk:()=>m});var d=c(89718),e=c(39326),f=c(12557),g=c(53258),h=c(3662),i=c(75681),j=c(7803);let k=Promise.resolve();async function l(a,b=null,c=null,h={}){let m,n=b instanceof Set?b:b?new Set([b]):new Set,o=h?.preferredConnectionId||null,p=k;k=new Promise(a=>{m=a});try{let b;await p;let k=(0,i.rs)(a);if(i.IS[k]?.noAuth){let a=((await (0,d.mt)()).providerStrategies||{})[k]||{},b=await (0,e.B)({proxyPoolId:a.proxyPoolId||""});return{id:"noauth",connectionName:"Public",isActive:!0,accessToken:"public",providerSpecificData:{connectionProxyEnabled:b.connectionProxyEnabled,connectionProxyUrl:b.connectionProxyUrl,connectionNoProxy:b.connectionNoProxy,connectionProxyPoolId:b.proxyPoolId||null,vercelRelayUrl:b.vercelRelayUrl||""}}}let l=await (0,d.getProviderConnections)({provider:k,isActive:!0});if(j.debug("AUTH",`${a} | total connections: ${l.length}, excludeIds: ${n.size>0?[...n].join(","):"none"}, model: ${c||"any"}`),0===l.length)return j.warn("AUTH",`No credentials for ${a}`),null;let m=l.filter(a=>!(n.has(a.id)||!h.bypassModelLock&&(0,f.Bl)(a,c)));if(j.debug("AUTH",`${a} | available: ${m.length}/${l.length}`),l.forEach(a=>{let b=n.has(a.id),d=(0,f.Bl)(a,c);if(b||d){let e=(0,f.kJ)(a);j.debug("AUTH",` → ${a.id?.slice(0,8)} | ${b?"excluded":""} ${d?`modelLocked(${c}) until ${e}`:""}`)}}),0===m.length){let b=l.filter(a=>(0,f.Bl)(a,c)),d=b.map(a=>(0,f.kJ)(a)).filter(Boolean).sort()[0]||null;if(d){let e=b[0];return j.warn("AUTH",`${a} | all ${l.length} accounts locked for ${c||"all"} (${(0,f.Qo)(d)}) | lastError=${e?.lastError?.slice(0,50)}`),{allRateLimited:!0,retryAfter:d,retryAfterHuman:(0,f.Qo)(d),lastError:e?.lastError||null,lastErrorCode:e?.errorCode||null}}return j.warn("AUTH",`${a} | all ${l.length} accounts unavailable`),null}let q=await (0,d.mt)(),r=(q.providerStrategies||{})[k]||{},s=r.fallbackStrategy||q.fallbackStrategy||"fill-first";if(o&&(b=m.find(a=>a.id===o))&&j.info("AUTH",`${a} | pinned to ${b.id?.slice(0,8)} (${b.name||b.email||"unnamed"})`),b);else if("round-robin"===s){let a=r.stickyRoundRobinLimit||q.stickyRoundRobinLimit||3,c=[...m].sort((a,b)=>a.lastUsedAt||b.lastUsedAt?a.lastUsedAt?b.lastUsedAt?new Date(b.lastUsedAt)-new Date(a.lastUsedAt):-1:1:(a.priority||999)-(b.priority||999))[0],e=c?.consecutiveUseCount||0;c&&c.lastUsedAt&&e<a?(b=c,await (0,d.updateProviderConnection)(b.id,{lastUsedAt:new Date().toISOString(),consecutiveUseCount:(b.consecutiveUseCount||0)+1})):(b=[...m].sort((a,b)=>a.lastUsedAt||b.lastUsedAt?a.lastUsedAt?b.lastUsedAt?new Date(a.lastUsedAt)-new Date(b.lastUsedAt):1:-1:(a.priority||999)-(b.priority||999))[0],await (0,d.updateProviderConnection)(b.id,{lastUsedAt:new Date().toISOString(),consecutiveUseCount:1}))}else{let c=(0,g.gH)(m);b=c[0],c[0]!==m[0]&&j.debug("AUTH",`${a} | health re-rank promoted ${b.id?.slice(0,8)} (score ${(0,g.uw)(b.id).toFixed(0)}) over ${m[0].id?.slice(0,8)} (score ${(0,g.uw)(m[0].id).toFixed(0)})`)}let t=await (0,e.B)(b.providerSpecificData||{});return{authType:b.authType,apiKey:b.apiKey,accessToken:b.accessToken,refreshToken:b.refreshToken,idToken:b.idToken,expiresAt:b.expiresAt,expiresIn:b.expiresIn,lastRefreshAt:b.lastRefreshAt,projectId:b.projectId,connectionName:b.displayName||b.name||b.email||b.id,copilotToken:b.providerSpecificData?.copilotToken,providerSpecificData:{...b.providerSpecificData||{},connectionProxyEnabled:t.connectionProxyEnabled,connectionProxyUrl:t.connectionProxyUrl,connectionNoProxy:t.connectionNoProxy,connectionProxyPoolId:t.proxyPoolId||null,vercelRelayUrl:t.vercelRelayUrl||""},connectionId:b.id,testStatus:b.testStatus,lastError:b.lastError,_connection:b}}finally{m&&m()}}async function m(a,b,c,e=null,g=null,i=null){if(!a||"noauth"===a)return{shouldFallback:!1,cooldownMs:0};let k="string"==typeof c?c.slice(0,100):"Provider error",l=function(a){if("string"!=typeof a||!a.includes("accounts.google.com"))return null;let b=a.match(/https:\/\/accounts\.google\.com\/signin\/continue\?[^\s"'\\)]+/);return b?b[0]:null}("string"==typeof c?c:""),n={shouldFallback:!1,cooldownMs:0},o=null,p=a.slice(0,8);if(await (0,d.Q9)(a,a=>{let d,e,j,m,q=a?.backoffLevel||0;if(p=a?.displayName||a?.name||a?.email||p,i&&i>Date.now()?(d=!0,e=Math.min(i-Date.now(),h.fh),j=0):{shouldFallback:d,cooldownMs:e,newBackoffLevel:j,accountLock:m}=(0,f.hk)(b,c,q),!d&&(!e||e<=0))return n={shouldFallback:!1,cooldownMs:0},null;let r=m?(0,f.S5)(null,e):(0,f.S5)(g,e);return o=Object.keys(r)[0],n={shouldFallback:!1!==d,cooldownMs:e,accountLock:m||!1},{...r,testStatus:"unavailable",lastError:m&&l?`Verify your account: ${l}`:k,errorCode:b,lastErrorAt:new Date().toISOString(),backoffLevel:j??q}})&&n.shouldFallback){let a=n.accountLock?"WHOLE ACCOUNT":o;j.warn("AUTH",`${p} locked ${a} for ${Math.round(n.cooldownMs/1e3)}s [${b}]`),n.accountLock&&j.warn("AUTH",`🔒 ACCOUNT ${p} needs verification → ${l||"(URL not parsable from error body)"}`),e&&b&&k&&console.error(`❌ ${e} [${b}]: ${k}`)}return n}async function n(a,b,c=null){if(!a||"noauth"===a)return;let e=b._connection||b,f=Date.now(),g=Object.keys(e).filter(a=>a.startsWith("modelLock_"));if(!e.testStatus&&!e.lastError&&0===g.length)return;let h=g.filter(a=>{if(c&&a===`modelLock_${c}`||c&&"modelLock___all"===a)return!0;let b=e[a];return b&&new Date(b).getTime()<=f});if(0===h.length&&"unavailable"!==e.testStatus&&!e.lastError)return;let i=g.filter(a=>{if(h.includes(a))return!1;let b=e[a];return b&&new Date(b).getTime()>f}),j=Object.fromEntries(h.map(a=>[a,null]));0===i.length&&Object.assign(j,{testStatus:"active",lastError:null,lastErrorAt:null,backoffLevel:0}),await (0,d.updateProviderConnection)(a,j)}function o(a){let b=a.headers.get("Authorization");if(b?.startsWith("Bearer "))return b.slice(7);let c=a.headers.get("x-api-key");return c||null}async function p(a){return!!a&&await (0,d.ek)(a)}},92280:(a,b,c)=>{Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},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)}}};
@@ -1 +0,0 @@
1
- "use strict";exports.id=4177,exports.ids=[4177],exports.modules={74177:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{PY:()=>x,Re:()=>v,Su:()=>w,exchangeTokens:()=>u,extractCodexAccountInfo:()=>r,fetchKiroProfileArn:()=>q,kP:()=>t,sO:()=>s});var e=c(48895),f=c(55511),g=c.n(f),h=c(13808),i=c(92990),j=c(73159),k=a([e]);function l(a,b={}){let c={...b.headers||{},"x-request-source":"local"};return fetch(a,{...b,headers:c})}e=(k.then?(await k)():k)[0];let y=null;function m(a,b){let c,d=String(a||"").trim();if(!d)throw Error(`xai discovery ${b} is empty`);try{c=new URL(d)}catch(a){throw Error(`xai discovery ${b} is invalid: ${a.message}`)}if("https:"!==c.protocol)throw Error(`xai discovery ${b} must use https: ${d}`);let e=c.hostname.toLowerCase().trim();if("x.ai"!==e&&!e.endsWith(".x.ai"))throw Error(`xai discovery ${b} host ${e} is not on x.ai`);return d}async function n(){if(y)return y;try{let a=await fetch(j.oT.discoveryUrl,{headers:{Accept:"application/json"}});if(a.ok){let b=await a.json();return y={authorizeUrl:m(b.authorization_endpoint,"authorization_endpoint"),tokenUrl:m(b.token_endpoint,"token_endpoint")}}}catch{}return y={authorizeUrl:j.oT.authorizeUrl,tokenUrl:j.oT.tokenUrl}}function o(a){try{if(!a||"string"!=typeof a)return null;let b=a.split(".");if(3!==b.length)return null;let c=b[1].replace(/-/g,"+").replace(/_/g,"/"),d=(4-c.length%4)%4,e=c+"=".repeat(d);return JSON.parse(Buffer.from(e,"base64").toString("utf8"))}catch{return null}}function p(a){let b=o(a);if(b)return b.email||b.preferred_username||b.sub||void 0}async function q(a){if(!a)return null;try{let b=await fetch("https://codewhisperer.us-east-1.amazonaws.com/ListAvailableProfiles",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify({maxResults:10})});if(!b.ok)return null;let c=await b.json();return c.profiles?.find(a=>a.arn?.trim())?.arn?.trim()||null}catch{return null}}function r(a){let b=o(a);if(!b)return{};let c=b["https://api.openai.com/auth"]||{};return{email:b.email,chatgptAccountId:c.chatgpt_account_id||b.account_id,chatgptPlanType:c.chatgpt_plan_type||b.plan_type}}let z={claude:{config:i.OV,flowType:"authorization_code_pkce",buildAuthUrl:(a,b,c,d)=>{let e=new URLSearchParams({code:"true",client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),code_challenge:d,code_challenge_method:a.codeChallengeMethod,state:c});return`${a.authorizeUrl}?${e.toString()}`},exchangeToken:async(a,b,c,d,e)=>{let f=b,g="";if(f.includes("#")){let a=f.split("#");f=a[0],g=a[1]||""}let h=await l(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({code:f,state:g||e,grant_type:"authorization_code",client_id:a.clientId,redirect_uri:c,code_verifier:d})});if(!h.ok){let a=await h.text();throw Error(`Token exchange failed: ${a}`)}return await h.json()},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope})},codex:{config:i.DI,flowType:"authorization_code_pkce",fixedPort:1455,callbackPath:"/auth/callback",buildAuthUrl:(a,b,c,d)=>{let e={response_type:"code",client_id:a.clientId,redirect_uri:b,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod,...a.extraParams,state:c},f=Object.entries(e).map(([a,b])=>`${a}=${encodeURIComponent(b)}`).join("&");return`${a.authorizeUrl}?${f}`},exchangeToken:async(a,b,c,d)=>{let e=await l(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,code:b,redirect_uri:c,code_verifier:d})});if(!e.ok){let a=await e.text();throw Error(`Token exchange failed: ${a}`)}return await e.json()},mapTokens:a=>{let b=r(a.id_token),c={accessToken:a.access_token,refreshToken:a.refresh_token,idToken:a.id_token,expiresIn:a.expires_in,lastRefreshAt:new Date().toISOString()},d=b.email||p(a.access_token);return d&&(c.email=d),(b.chatgptAccountId||b.chatgptPlanType)&&(c.providerSpecificData={chatgptAccountId:b.chatgptAccountId,chatgptPlanType:b.chatgptPlanType}),c}},xai:{config:j.oT,flowType:"authorization_code_pkce",fixedPort:j.oT.loopbackPort,callbackPath:j.oT.callbackPath,pkceVerifierBytes:j.Ue,prepareConfig:async a=>{let b=await n();return{...a,authorizeUrl:b.authorizeUrl,tokenUrl:b.tokenUrl}},buildAuthUrl:(a,b,c,d)=>{let e=g().randomBytes(16).toString("hex"),f={response_type:"code",client_id:a.clientId,redirect_uri:b,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod,state:c,nonce:e,plan:"generic",referrer:"cli-proxy-api"},h=Object.entries(f).map(([a,b])=>`${a}=${encodeURIComponent(b)}`).join("&");return`${a.authorizeUrl}?${h}`},exchangeToken:async(a,b,c,d)=>{let e=await l(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,code:b,redirect_uri:c,code_verifier:d})});if(!e.ok){let a=await e.text();throw Error(`xAI token exchange failed: ${a}`)}return await e.json()},mapTokens:a=>{let b={accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope},c=function(a){if(!a||"string"!=typeof a)return;let b=a.split(".");if(3===b.length)try{let a=b[1].replace(/-/g,"+").replace(/_/g,"/"),c=(4-a.length%4)%4,d=Buffer.from(a+"=".repeat(c),"base64").toString("utf8"),e=JSON.parse(d);return e.email||e.preferred_username||e.sub||void 0}catch{return}}(a.id_token);return c&&(b.email=c),a.id_token&&(b.providerSpecificData={idToken:a.id_token}),b}},"gemini-cli":{config:i.LT,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),state:c,access_type:"offline",prompt:"consent"});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=await l(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,client_secret:a.clientSecret,code:b,redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Token exchange failed: ${a}`)}return await d.json()},postExchange:async a=>{let b=await fetch(`${i.LT.userInfoUrl}?alt=json`,{headers:{Authorization:`Bearer ${a.access_token}`}}),c=b.ok?await b.json():{},d="";try{let b=await fetch("https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",{method:"POST",headers:{Authorization:`Bearer ${a.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({metadata:(0,i.cD)(),mode:1})});if(b.ok){let a=await b.json();d=a.cloudaicompanionProject?.id||a.cloudaicompanionProject||""}}catch(a){console.log("Failed to fetch project ID:",a)}return{userInfo:c,projectId:d}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,email:b?.userInfo?.email,projectId:b?.projectId})},antigravity:{config:i.YT,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),state:c,access_type:"offline",prompt:"consent"});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=await l(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,client_secret:a.clientSecret,code:b,redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Token exchange failed: ${a}`)}return await d.json()},postExchange:async a=>{let b={Authorization:`Bearer ${a.access_token}`,"Content-Type":"application/json","User-Agent":i.YT.loadCodeAssistUserAgent,"X-Goog-Api-Client":i.YT.loadCodeAssistApiClient,"Client-Metadata":i.YT.loadCodeAssistClientMetadata,"x-request-source":"local"},c=(0,i.cD)(),d=await fetch(`${i.YT.userInfoUrl}?alt=json`,{headers:{Authorization:`Bearer ${a.access_token}`,"x-request-source":"local"}}),e=d.ok?await d.json():{},f="",g="legacy-tier";try{let a=await fetch(i.YT.loadCodeAssistEndpoint,{method:"POST",headers:b,body:JSON.stringify({metadata:c})});if(a.ok){let b=await a.json();if(f=b.cloudaicompanionProject?.id||b.cloudaicompanionProject||"",Array.isArray(b.allowedTiers)){for(let a of b.allowedTiers)if(a.isDefault&&a.id){g=a.id.trim();break}}}}catch(a){console.log("Failed to load code assist:",a)}return f&&(async()=>{for(let a=0;a<10;a++){try{let a=await fetch(i.YT.onboardUserEndpoint,{method:"POST",headers:b,body:JSON.stringify({tierId:g,metadata:c})});if(a.ok){let b=await a.json();if(!0===b.done)break}}catch(a){break}await new Promise(a=>setTimeout(a,5e3))}})().catch(()=>{}),{userInfo:e,projectId:f}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,email:b?.userInfo?.email,projectId:b?.projectId})},iflow:{config:i.ZL,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({loginMethod:a.extraParams.loginMethod,type:a.extraParams.type,redirect:b,state:c,client_id:a.clientId});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=Buffer.from(`${a.clientId}:${a.clientSecret}`).toString("base64"),e=await l(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${d}`},body:new URLSearchParams({grant_type:"authorization_code",code:b,redirect_uri:c,client_id:a.clientId,client_secret:a.clientSecret})});if(!e.ok){let a=await e.text();throw Error(`Token exchange failed: ${a}`)}return await e.json()},postExchange:async a=>{let b=await fetch(`${i.ZL.userInfoUrl}?accessToken=${encodeURIComponent(a.access_token)}`,{headers:{Accept:"application/json"}});if(!b.ok){let a=await b.text();throw Error(`Failed to fetch user info: ${a}`)}let c=await b.json();if(!c.success)throw Error(`User info request failed: ${c.message||"Unknown error"}`);let d=c.data||{};if(!d.apiKey||""===d.apiKey.trim())throw Error("Empty API key returned from iFlow");if(!(d.email?.trim()||d.phone?.trim()))throw Error("Missing account email/phone in user info");return{userInfo:d}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,apiKey:b?.userInfo?.apiKey,email:b?.userInfo?.email||b?.userInfo?.phone,displayName:b?.userInfo?.nickname||b?.userInfo?.name})},qoder:{config:i.hF,flowType:"device_code",requestDeviceCode:async a=>{let{QoderService:b}=await c.e(1531).then(c.bind(c,91531)),d=new b().initiateDeviceFlow();return{device_code:d.nonce,user_code:d.nonce.slice(0,8).toUpperCase(),verification_uri:a.loginUrl,verification_uri_complete:d.verificationUriComplete,expires_in:300,interval:2,codeVerifier:d.codeVerifier,_qoderNonce:d.nonce,_qoderMachineId:d.machineId}},pollToken:async(a,b,d,e)=>{let f,{QoderService:g}=await c.e(1531).then(c.bind(c,91531)),h=new g,i=b||e?._qoderNonce,j=d||e?._qoderVerifier;if(!i||!j)return{ok:!1,data:{error:"invalid_request",error_description:"Missing nonce/verifier"}};try{f=await h.pollDeviceToken({nonce:i,codeVerifier:j})}catch(a){return{ok:!1,data:{error:"poll_failed",error_description:a.message}}}if("pending"===f.status)return{ok:!1,data:{error:"authorization_pending"}};let k=await h.fetchUserInfo(f.accessToken),l=Math.floor((f.expireTime-Date.now())/1e3),m=Math.max(86400,l);return{ok:!0,data:{access_token:f.accessToken,refresh_token:f.refreshToken,expires_in:m,_qoderUserId:f.userId,_qoderMachineId:e?._qoderMachineId||"",_qoderName:k.name,_qoderEmail:k.email,_qoderOrganizationId:k.organizationId}}},mapTokens:a=>{let b=(a._qoderEmail||"").trim(),c=(a._qoderName||"").trim()||null,d=a._qoderUserId||"",e=b||(d?`qoder-user-${d}`:null);return{accessToken:a.access_token,refreshToken:a.refresh_token||null,expiresIn:a.expires_in,email:e,displayName:c,providerSpecificData:{authMethod:"device",userId:d,machineId:a._qoderMachineId||"",organizationId:a._qoderOrganizationId||""}}}},qwen:{config:i.Hp,flowType:"device_code",requestDeviceCode:async(a,b)=>{let c=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,scope:a.scope,code_challenge:b,code_challenge_method:a.codeChallengeMethod})});if(!c.ok){let a=await c.text();throw Error(`Device code request failed: ${a}`)}return await c.json()},pollToken:async(a,b,c)=>{let d=await l(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:a.clientId,device_code:b,code_verifier:c})});return{ok:d.ok,data:await d.json()}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,providerSpecificData:{resourceUrl:a.resource_url}})},github:{config:i.Nu,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,scope:a.scopes})});if(!b.ok){let a=await b.text();throw Error(`Device code request failed: ${a}`)}return await b.json()},pollToken:async(a,b)=>{let c,d=await l(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,device_code:b,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})});try{c=await d.json()}catch(b){let a=await d.text();c={error:"invalid_response",error_description:a}}return{ok:d.ok,data:c}},postExchange:async a=>{let b=await fetch(i.Nu.copilotTokenUrl,{headers:{Authorization:`Bearer ${a.access_token}`,Accept:"application/json","X-GitHub-Api-Version":i.Nu.apiVersion,"User-Agent":i.Nu.userAgent}}),c=b.ok?await b.json():{},d=await fetch(i.Nu.userInfoUrl,{headers:{Authorization:`Bearer ${a.access_token}`,Accept:"application/json","X-GitHub-Api-Version":i.Nu.apiVersion,"User-Agent":i.Nu.userAgent}}),e=d.ok?await d.json():{};return{copilotToken:c,userInfo:e}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,providerSpecificData:{copilotToken:b?.copilotToken?.token,copilotTokenExpiresAt:b?.copilotToken?.expires_at,githubUserId:b?.userInfo?.id,githubLogin:b?.userInfo?.login,githubName:b?.userInfo?.name,githubEmail:b?.userInfo?.email}})},kiro:{config:i.Tx,flowType:"device_code",requestDeviceCode:async(a,b,c={})=>{let d=("string"==typeof c.region?c.region.trim():"")||"us-east-1";(0,i.S6)(d);let e=("string"==typeof c.startUrl?c.startUrl.trim():"")||a.startUrl,f="idc"===c.authMethod?"idc":"builder-id",g=`https://oidc.${d}.amazonaws.com/client/register`,h=`https://oidc.${d}.amazonaws.com/device_authorization`,j=await fetch(g,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientName:a.clientName,clientType:a.clientType,scopes:a.scopes,grantTypes:a.grantTypes,issuerUrl:a.issuerUrl})});if(!j.ok){let a=await j.text();throw Error(`Client registration failed: ${a}`)}let k=await j.json(),l=await fetch(h,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:k.clientId,clientSecret:k.clientSecret,startUrl:e})});if(!l.ok){let a=await l.text();throw Error(`Device authorization failed: ${a}`)}let m=await l.json();return{device_code:m.deviceCode,user_code:m.userCode,verification_uri:m.verificationUri,verification_uri_complete:m.verificationUriComplete,expires_in:m.expiresIn,interval:m.interval||5,_clientId:k.clientId,_clientSecret:k.clientSecret,_region:d,_authMethod:f,_startUrl:e}},pollToken:async(a,b,c,d)=>{let e,f=d?._region||"us-east-1";(0,i.S6)(f);let g=`https://oidc.${f}.amazonaws.com/token`,h=await l(g,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:d?._clientId,clientSecret:d?._clientSecret,deviceCode:b,grantType:"urn:ietf:params:oauth:grant-type:device_code"})});try{e=await h.json()}catch(b){let a=await h.text();e={error:"invalid_response",error_description:a}}return e.accessToken?{ok:!0,data:{access_token:e.accessToken,refresh_token:e.refreshToken,expires_in:e.expiresIn,profile_arn:e?.profileArn||null,_clientId:d?._clientId,_clientSecret:d?._clientSecret,_region:d?._region,_authMethod:d?._authMethod,_startUrl:d?._startUrl}}:{ok:!1,data:{error:e.error||"authorization_pending",error_description:e.error_description||e.message}}},mapTokens:a=>{let b=p(a.access_token);return{accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,email:b,providerSpecificData:{profileArn:a?.profile_arn||null,clientId:a._clientId,clientSecret:a._clientSecret,region:a._region||"us-east-1",authMethod:a._authMethod||"builder-id",startUrl:a._startUrl||i.Tx.startUrl}}}},cursor:{config:i.WN,flowType:"import_token",mapTokens:a=>({accessToken:a.accessToken,refreshToken:null,expiresIn:a.expiresIn||86400,providerSpecificData:{machineId:a.machineId,authMethod:"imported"}})},"kimi-coding":{config:i.t,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId})});if(!b.ok){let a=await b.text();throw Error(`Device code request failed: ${a}`)}let c=await b.json();return{device_code:c.device_code,user_code:c.user_code,verification_uri:c.verification_uri||"https://www.kimi.com/code/authorize_device",verification_uri_complete:c.verification_uri_complete||`https://www.kimi.com/code/authorize_device?user_code=${c.user_code}`,expires_in:c.expires_in,interval:c.interval||5}},pollToken:async(a,b)=>{let c,d=await l(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:a.clientId,device_code:b})});try{c=await d.json()}catch(b){let a=await d.text();c={error:"invalid_response",error_description:a}}return{ok:d.ok,data:c}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in})},kilocode:{config:i.MZ,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.initiateUrl,{method:"POST",headers:{"Content-Type":"application/json"}});if(!b.ok){if(429===b.status)throw Error("Too many pending authorization requests. Please try again later.");let a=await b.text();throw Error(`Device auth initiation failed: ${a}`)}let c=await b.json();return{device_code:c.code,user_code:c.code,verification_uri:c.verificationUrl,verification_uri_complete:c.verificationUrl,expires_in:c.expiresIn||300,interval:3}},pollToken:async(a,b)=>{let c=await fetch(`${a.pollUrlBase}/${b}`);if(202===c.status)return{ok:!1,data:{error:"authorization_pending"}};if(403===c.status)return{ok:!1,data:{error:"access_denied",error_description:"Authorization denied by user"}};if(410===c.status)return{ok:!1,data:{error:"expired_token",error_description:"Authorization code expired"}};if(!c.ok)return{ok:!1,data:{error:"poll_failed",error_description:`Poll failed: ${c.status}`}};let d=await c.json();if("approved"===d.status&&d.token){let b=null;try{let c=await fetch(`${a.apiBaseUrl}/api/profile`,{headers:{Authorization:`Bearer ${d.token}`}});if(c.ok){let a=await c.json();b=a.organizations?.[0]?.id||null}}catch{}return{ok:!0,data:{access_token:d.token,_userEmail:d.userEmail,_orgId:b}}}return{ok:!1,data:{error:"authorization_pending"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:null,expiresIn:null,email:a._userEmail,...a._orgId?{providerSpecificData:{orgId:a._orgId}}:{}})},cline:{config:i.lB,flowType:"authorization_code",buildAuthUrl:(a,b)=>{let c=new URLSearchParams({client_type:"extension",callback_url:b,redirect_uri:b});return`${a.authorizeUrl}?${c.toString()}`},exchangeToken:async(a,b,c)=>{try{let a=b,c=4-a.length%4;4!==c&&(a+="=".repeat(c));let d=Buffer.from(a,"base64").toString("utf-8"),e=d.lastIndexOf("}");if(-1===e)throw Error("No JSON found in decoded code");let f=JSON.parse(d.substring(0,e+1));return{access_token:f.accessToken,refresh_token:f.refreshToken,email:f.email,firstName:f.firstName,lastName:f.lastName,expires_at:f.expiresAt}}catch(f){let d=await fetch(a.tokenExchangeUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"authorization_code",code:b,client_type:"extension",redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Cline token exchange failed: ${a}`)}let e=await d.json();return{access_token:e.data?.accessToken||e.accessToken,refresh_token:e.data?.refreshToken||e.refreshToken,email:e.data?.userInfo?.email||"",expires_at:e.data?.expiresAt||e.expiresAt}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_at?Math.floor((new Date(a.expires_at).getTime()-Date.now())/1e3):3600,email:a.email,providerSpecificData:{firstName:a.firstName,lastName:a.lastName}})},gitlab:{config:i.f7,flowType:"authorization_code_pkce",buildAuthUrl:(a,b,c,d,e={})=>{let f=e.baseUrl||a.defaultBaseUrl,g=e.clientId||"",h=new URLSearchParams({client_id:g,redirect_uri:b,response_type:"code",state:c,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod});return`${f}${a.authorizeUrlPath}?${h.toString()}`},exchangeToken:async(a,b,c,d,e,f={})=>{let g=f.baseUrl||a.defaultBaseUrl,h=f.clientId||"",i=f.clientSecret||"",j=new URLSearchParams({client_id:h,grant_type:"authorization_code",code:b,redirect_uri:c,code_verifier:d});i&&j.set("client_secret",i);let k=await fetch(`${g}${a.tokenUrlPath}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:j.toString()});if(!k.ok)throw Error(`GitLab token exchange failed: ${await k.text()}`);let l=await k.json(),m=await fetch(`${g}${a.userInfoUrlPath}`,{headers:{Authorization:`Bearer ${l.access_token}`}}),n=m.ok?await m.json():{};return{...l,_user:n,_baseUrl:g,_clientId:h}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,providerSpecificData:{username:a._user?.username||"",email:a._user?.email||a._user?.public_email||"",name:a._user?.name||"",baseUrl:a._baseUrl,clientId:a._clientId,authKind:"oauth"}})},codebuddy:{config:i.Nl,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(`${a.stateUrl}?platform=${a.platform}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"copilot.tencent.com","X-No-Authorization":"true","X-No-User-Id":"true","X-Product":"SaaS"},body:"{}"});if(!b.ok)throw Error(`CodeBuddy state request failed: ${await b.text()}`);let c=await b.json();if(0!==c.code||!c.data?.state||!c.data?.authUrl)throw Error(`CodeBuddy state error: ${c.msg||"missing state/authUrl"}`);return{device_code:c.data.state,verification_uri:c.data.authUrl,user_code:"",interval:a.pollInterval/1e3,_isCodeBuddy:!0}},pollToken:async(a,b)=>{let c=await l(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"copilot.tencent.com","X-No-Authorization":"true","X-No-User-Id":"true","X-Product":"SaaS"},body:JSON.stringify({state:b})});if(!c.ok)return{ok:!1,data:{error:"request_failed"}};let d=await c.json();return 0===d.code&&d.data?.accessToken?{ok:!0,data:{access_token:d.data.accessToken,refresh_token:d.data.refreshToken||"",token_type:d.data.tokenType||"Bearer"}}:11217===d.code?{ok:!0,data:{error:"authorization_pending"}}:{ok:!1,data:{error:d.msg||"unknown_error"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:86400,providerSpecificData:{}})}};function s(a){let b=z[a];if(!b)throw Error(`Unknown provider: ${a}`);return b}async function t(a,b,c){let d=s(a),e=d.prepareConfig?await d.prepareConfig(d.config,c||{}):d.config,{codeVerifier:f,codeChallenge:g,state:i}=(0,h.lz)(d.pkceVerifierBytes);return{authUrl:"device_code"===d.flowType?null:"authorization_code_pkce"===d.flowType?d.buildAuthUrl(e,b,i,g,c||{}):d.buildAuthUrl(e,b,i,void 0,c||{}),state:i,codeVerifier:f,codeChallenge:g,redirectUri:b,flowType:d.flowType,fixedPort:d.fixedPort,callbackPath:d.callbackPath||"/callback"}}async function u(a,b,c,d,e,f){let g=s(a),h=g.prepareConfig?await g.prepareConfig(g.config,f||{}):g.config,i=await g.exchangeToken(h,b,c,d,e,f||{}),j=null;return g.postExchange&&(j=await g.postExchange(i)),g.mapTokens(i,j)}async function v(a,b,c){let d=s(a);if("device_code"!==d.flowType)throw Error(`Provider ${a} does not support device code flow`);return await d.requestDeviceCode(d.config,b,c||{})}async function w(a,b,c,d){let e=s(a);if("device_code"!==e.flowType)throw Error(`Provider ${a} does not support device code flow`);let f=await e.pollToken(e.config,b,c,d);if(f.ok)if(f.data.access_token){let b=null;e.postExchange&&(b=await e.postExchange(f.data));let c=e.mapTokens(f.data,b);if("kiro"===a&&!c.providerSpecificData?.profileArn){let a=await q(c.accessToken);a&&(c.providerSpecificData.profileArn=a)}return{success:!0,tokens:c}}else if("authorization_pending"===f.data.error||"slow_down"===f.data.error)return{success:!1,error:f.data.error,errorDescription:f.data.error_description||f.data.message,pending:"authorization_pending"===f.data.error};else return{success:!1,error:f.data.error||"no_access_token",errorDescription:f.data.error_description||f.data.message||"No access token received"};return{success:!1,error:f.data.error,errorDescription:f.data.error_description}}let A=!1;async function x(){if(!A){A=!0;try{let{getProviderConnections:a,updateProviderConnection:b}=await Promise.resolve().then(c.bind(c,89718));for(let c of(await a()).filter(a=>{if("codex"!==a.provider||"oauth"!==a.authType||!a.idToken)return!1;let b=!!a.email,c=!!a.providerSpecificData?.chatgptAccountId;return!b||!c})){let a=r(c.idToken);if(!a.email&&!a.chatgptAccountId)continue;let d={};!c.email&&a.email&&(d.email=a.email),(a.chatgptAccountId||a.chatgptPlanType)&&(d.providerSpecificData={...c.providerSpecificData||{},chatgptAccountId:a.chatgptAccountId,chatgptPlanType:a.chatgptPlanType}),Object.keys(d).length&&await b(c.id,d)}}catch(a){A=!1,console.log("backfillCodexEmails failed:",a?.message||a)}}}d()}catch(a){d(a)}})}};
@@ -1 +0,0 @@
1
- "use strict";exports.id=7501,exports.ids=[7501],exports.modules={3662:(a,b,c)=>{c.d(b,{EQ:()=>f,LY:()=>d,O:()=>e,fh:()=>h,t2:()=>i,wf:()=>g});let d={400:{type:"invalid_request_error",code:"bad_request"},401:{type:"authentication_error",code:"invalid_api_key"},402:{type:"billing_error",code:"payment_required"},403:{type:"permission_error",code:"insufficient_quota"},404:{type:"invalid_request_error",code:"model_not_found"},406:{type:"invalid_request_error",code:"model_not_supported"},429:{type:"rate_limit_error",code:"rate_limit_exceeded"},500:{type:"server_error",code:"internal_server_error"},502:{type:"server_error",code:"bad_gateway"},503:{type:"server_error",code:"service_unavailable"},504:{type:"server_error",code:"gateway_timeout"}},e={400:"Bad request",401:"Invalid API key provided",402:"Payment required",403:"You exceeded your current quota",404:"Model not found",406:"Model not supported",429:"Rate limit exceeded",500:"Internal server error",502:"Bad gateway - upstream provider error",503:"Service temporarily unavailable",504:"Gateway timeout"},f={base:2e3,max:3e5,maxLevel:15},g=3e4,h=18e5,i=[{text:"verify your account",cooldownMs:36e5,accountLock:!0},{text:"no credentials",cooldownMs:12e4},{text:"request not allowed",cooldownMs:5e3},{text:"improperly formed request",cooldownMs:12e4},{text:"monthly_request_count",cooldownMs:2592e6,accountLock:!0},{text:"reached the limit",cooldownMs:2592e6,accountLock:!0},{text:"servicequotaexceeded",cooldownMs:2592e6,accountLock:!0},{text:"requested entity was not found",shouldFallback:!1,cooldownMs:18e5},{text:"404 page not found",shouldFallback:!1,cooldownMs:18e5},{text:"not_found",shouldFallback:!1,cooldownMs:18e5},{text:"model_not_found",shouldFallback:!1,cooldownMs:18e5},{text:"the model `",shouldFallback:!1,cooldownMs:18e5},{text:"rate limit",backoff:!0},{text:"too many requests",backoff:!0},{text:"quota exceeded",backoff:!0},{text:"no capacity available",shouldFallback:!1,cooldownMs:5e3},{text:"capacity",backoff:!0},{text:"overloaded",backoff:!0},{status:401,cooldownMs:12e4},{status:402,cooldownMs:12e4},{status:403,cooldownMs:12e4},{status:404,cooldownMs:12e4},{status:429,backoff:!0}]},8590:(a,b,c)=>{c.d(b,{$B:()=>x,I9:()=>p,Og:()=>m,Ql:()=>t,Sc:()=>y,jR:()=>w,jT:()=>l,oD:()=>i,pb:()=>A,qZ:()=>B});var d=c(35024),e=c(75924),f=c(39609);let g=null;async function h(a,b){return a?k("xai",a,async()=>{try{g||(g=new(await Promise.all([c.e(3104),c.e(5852)]).then(c.bind(c,33471))).XaiService);let b=await g.refreshAccessToken(a);return{accessToken:b.access_token,refreshToken:b.refresh_token||a,expiresIn:b.expires_in,idToken:b.id_token}}catch(c){b?.warn?.("TOKEN_REFRESH",`xai refresh failed: ${c?.message||c}`);let a=String(c?.message||"");if(a.includes("invalid_grant")||a.includes("invalid_request"))return{error:"invalid_grant"};return null}},b):null}let i=3e5,j=new Map;async function k(a,b,c,d){if(!b)return c();let e=`${a}:${b}`,f=j.get(e);if(f){if(f.promise)return d?.info?.("TOKEN_REFRESH",`Reusing in-flight refresh for ${a}`),f.promise;if(f.expiresAt>Date.now())return d?.info?.("TOKEN_REFRESH",`Reusing recent refresh result for ${a}`),f.result;j.delete(e)}let g=(async()=>{try{let a=await c();return j.set(e,{result:a,expiresAt:Date.now()+1e4}),a}catch(a){throw j.delete(e),a}})();return j.set(e,{promise:g}),g}function l(a){return a&&"object"==typeof a&&("unrecoverable_refresh_error"===a.error||"refresh_token_reused"===a.error||"invalid_request"===a.error||"invalid_grant"===a.error)}function m(a){return e.Wu[a]||i}async function n(a,b,c,e){let f=d.xq[a];return f&&f.refreshUrl?b?k(a,b,async()=>{try{let c=await fetch(f.refreshUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:b,client_id:f.clientId,client_secret:f.clientSecret})});if(!c.ok){let b=await c.text();return e?.error?.("TOKEN_REFRESH",`Failed to refresh token for ${a}`,{status:c.status,error:b}),null}let d=await c.json();return e?.info?.("TOKEN_REFRESH",`Successfully refreshed token for ${a}`,{hasNewAccessToken:!!d.access_token,hasNewRefreshToken:!!d.refresh_token,expiresIn:d.expires_in}),{accessToken:d.access_token,refreshToken:d.refresh_token||b,expiresIn:d.expires_in}}catch(b){return e?.error?.("TOKEN_REFRESH",`Error refreshing token for ${a}`,{error:b.message}),null}},e):(e?.warn?.("TOKEN_REFRESH",`No refresh token available for provider: ${a}`),null):(e?.warn?.("TOKEN_REFRESH",`No refresh URL configured for provider: ${a}`),null)}async function o(a,b){return a?k("claude",a,async()=>{try{let c=await fetch(e.NA.anthropic.token,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.claude.clientId})});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Claude OAuth token",{status:c.status,error:a}),null}let f=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Claude OAuth token",{hasNewAccessToken:!!f.access_token,expiresIn:f.expires_in}),{accessToken:f.access_token,refreshToken:f.refresh_token||a,expiresIn:f.expires_in}}catch(a){return b?.error?.("TOKEN_REFRESH",`Network error refreshing Claude token: ${a.message}`),null}},b):null}async function p(a,b,c,d){return a?k(`google:${b}`,a,async()=>{try{let f=await fetch(e.NA.google.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:b,client_secret:c})});if(!f.ok){let a=await f.text();return d?.error?.("TOKEN_REFRESH","Failed to refresh Google token",{status:f.status,error:a}),null}let g=await f.json();return d?.info?.("TOKEN_REFRESH","Successfully refreshed Google token",{hasNewAccessToken:!!g.access_token,expiresIn:g.expires_in}),{accessToken:g.access_token,refreshToken:g.refresh_token||a,expiresIn:g.expires_in}}catch(a){return d?.error?.("TOKEN_REFRESH",`Network error refreshing Google token: ${a.message}`),null}},d):null}async function q(a,b){return a?k("qwen",a,async()=>{let c=e.NA.qwen.token;try{let e=await fetch(c,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.qwen.clientId})});if(200===e.status){let c=await e.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Qwen token",{hasNewAccessToken:!!c.access_token,hasNewRefreshToken:!!c.refresh_token,expiresIn:c.expires_in}),{accessToken:c.access_token,refreshToken:c.refresh_token||a,expiresIn:c.expires_in,providerSpecificData:c.resource_url?{resourceUrl:c.resource_url}:void 0}}{let a=await e.text().catch(()=>"");b?.warn?.("TOKEN_REFRESH","Error with Qwen endpoint",{status:e.status,error:a})}}catch(a){b?.warn?.("TOKEN_REFRESH","Network error trying Qwen endpoint",{error:a.message})}return b?.error?.("TOKEN_REFRESH","Failed to refresh Qwen token"),null},b):null}async function r(a,b){return a?k("codex",a,async()=>{try{let c=await fetch(e.NA.openai.token,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({client_id:d.xq.codex.clientId,grant_type:"refresh_token",refresh_token:a})});if(!c.ok){let a=await c.text(),d=function(a="",b=0){let c=null;try{c=a?JSON.parse(a):null}catch{c=null}let d=c?.error?.code||c?.error||c?.error_code||"",e=c?.error_description||c?.message||a||"",f=`${d} ${e}`.toLowerCase();return{status:b,code:d,description:e,permanent:["refresh_token_expired","refresh_token_reused","refresh_token_invalidated","invalid_grant"].some(a=>f.includes(a))}}(a,c.status);if(d.permanent)return b?.error?.("TOKEN_REFRESH","Codex refresh token already used or invalid. Re-auth required.",{status:c.status,code:d.code}),{error:"unrecoverable_refresh_error",code:d.code};return b?.error?.("TOKEN_REFRESH","Failed to refresh Codex token",{status:c.status,error:a,code:d.code,permanent:d.permanent}),null}let f=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Codex token",{hasNewAccessToken:!!f.access_token,hasNewRefreshToken:!!f.refresh_token,hasIdToken:!!f.id_token,expiresIn:f.expires_in}),{accessToken:f.access_token,refreshToken:f.refresh_token||a,idToken:f.id_token,expiresIn:f.expires_in}}catch(a){return b?.error?.("TOKEN_REFRESH",`Network error refreshing Codex token: ${a.message}`),null}},b):null}async function s(a,b,d){if(a?.profileArn)return{};let e=d?.trim?.()||null;if(!e){let{fetchKiroProfileArn:a}=await Promise.all([c.e(7774),c.e(5433),c.e(4404),c.e(7540),c.e(318),c.e(8895),c.e(4177),c.e(3535)]).then(c.bind(c,74177));e=await a(b)}return e?{providerSpecificData:{profileArn:e}}:{}}async function t(a,b,c,e=null){return a?k("kiro",a,async()=>{let g=b?.authMethod,h=b?.clientId,i=b?.clientSecret,j=b?.region;if(h&&i){let d="idc"===g&&j?`https://oidc.${j}.amazonaws.com/token`:"https://oidc.us-east-1.amazonaws.com/token",k=await (0,f.proxyAwareFetch)(d,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:h,clientSecret:i,refreshToken:a,grantType:"refresh_token"})},e);if(!k.ok){let a=await k.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro AWS token",{status:k.status,error:a}),null}let l=await k.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro AWS token",{hasNewAccessToken:!!l.accessToken,expiresIn:l.expiresIn}),{accessToken:l.accessToken,refreshToken:l.refreshToken||a,expiresIn:l.expiresIn,...await s(b,l.accessToken,l.profileArn)}}let k=await (0,f.proxyAwareFetch)(d.xq.kiro.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"kiro-cli/1.0.0"},body:JSON.stringify({refreshToken:a})},e);if(!k.ok){let a=await k.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro social token",{status:k.status,error:a}),null}let l=await k.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro social token",{hasNewAccessToken:!!l.accessToken,expiresIn:l.expiresIn}),{accessToken:l.accessToken,refreshToken:l.refreshToken||a,expiresIn:l.expiresIn,...await s(b,l.accessToken,l.profileArn)}},c):null}async function u(a,b){return a?k("iflow",a,async()=>{let c=btoa(`${d.xq.iflow.clientId}:${d.xq.iflow.clientSecret}`),f=await fetch(e.NA.iflow.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${c}`},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:d.xq.iflow.clientId,client_secret:d.xq.iflow.clientSecret})});if(!f.ok){let a=await f.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh iFlow token",{status:f.status,error:a}),null}let g=await f.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed iFlow token",{hasNewAccessToken:!!g.access_token,hasNewRefreshToken:!!g.refresh_token,expiresIn:g.expires_in}),{accessToken:g.access_token,refreshToken:g.refresh_token||a,expiresIn:g.expires_in}},b):null}async function v(a,b){return a?k("github",a,async()=>{let c={grant_type:"refresh_token",refresh_token:a,client_id:d.xq.github.clientId};d.xq.github.clientSecret&&(c.client_secret=d.xq.github.clientSecret);let f=await fetch(e.NA.github.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams(c)});if(!f.ok){let a=await f.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh GitHub token",{status:f.status,error:a}),null}let g=await f.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed GitHub token",{hasNewAccessToken:!!g.access_token,hasNewRefreshToken:!!g.refresh_token,expiresIn:g.expires_in}),{accessToken:g.access_token,refreshToken:g.refresh_token||a,expiresIn:g.expires_in}},b):null}async function w(a,b){return a?k("copilot",a,async()=>{try{let c=await fetch("https://api.github.com/copilot_internal/v2/token",{headers:{Authorization:`token ${a}`,"User-Agent":e.x0.USER_AGENT,"Editor-Version":`vscode/${e.x0.VSCODE_VERSION}`,"Editor-Plugin-Version":`copilot-chat/${e.x0.COPILOT_CHAT_VERSION}`,Accept:"application/json","x-github-api-version":e.x0.API_VERSION}});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Copilot token",{status:c.status,error:a}),null}let d=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Copilot token",{hasToken:!!d.token,expiresAt:d.expires_at}),{token:d.token,expiresAt:d.expires_at}}catch(a){return b?.error?.("TOKEN_REFRESH","Error refreshing Copilot token",{error:a.message}),null}},b):null}async function x(a,b,c){if(!b.refreshToken)return null;switch(a){case"gemini-cli":case"antigravity":return p(b.refreshToken,d.xq[a].clientId,d.xq[a].clientSecret,c);case"claude":return o(b.refreshToken,c);case"codex":return r(b.refreshToken,c);case"qwen":return q(b.refreshToken,c);case"iflow":return u(b.refreshToken,c);case"github":return v(b.refreshToken,c);case"kiro":return t(b.refreshToken,b.providerSpecificData,c);case"xai":return h(b.refreshToken,c);case"vertex":case"vertex-partner":{let a=y(b.apiKey);if(!a)return null;return A(a,c)}default:return n(a,b.refreshToken,b,c)}}function y(a){if("string"!=typeof a)return null;try{let b=JSON.parse(a);if("service_account"===b.type&&b.client_email&&b.private_key&&b.project_id)return b;return null}catch{return null}}let z=new Map;async function A(a,b){let d=a.client_email,e=z.get(d);if(e&&e.expiresAt-Date.now()>3e5)return{accessToken:e.token,expiresAt:e.expiresAt};try{let{SignJWT:e,importPKCS8:f}=await Promise.all([c.e(6935),c.e(8971)]).then(c.bind(c,8971));b?.debug?.("TOKEN_REFRESH",`Vertex minting token for ${a.client_email}`);let g=await f(a.private_key.replace(/\\n/g,"\n"),"RS256"),h=Math.floor(Date.now()/1e3),i=await new e({scope:"https://www.googleapis.com/auth/cloud-platform"}).setProtectedHeader({alg:"RS256"}).setIssuer(a.client_email).setAudience("https://oauth2.googleapis.com/token").setIssuedAt(h).setExpirationTime(h+3600).sign(g),j=await fetch("https://oauth2.googleapis.com/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:i})});if(!j.ok){let a=await j.text();return b?.error?.("TOKEN_REFRESH",`Vertex token mint failed: ${a}`),null}let{access_token:k,expires_in:l}=await j.json(),m=Date.now()+(l??3600)*1e3;return z.set(d,{token:k,expiresAt:m}),b?.info?.("TOKEN_REFRESH",`Vertex token minted for ${a.client_email}`),{accessToken:k,expiresAt:m}}catch(a){return b?.error?.("TOKEN_REFRESH",`Vertex token error: ${a.message}`),null}}async function B(a,b=3,c=null){for(let d=0;d<b;d++){if(d>0){let a=1e3*d;c?.debug?.("TOKEN_REFRESH",`Retry ${d}/${b} after ${a}ms`),await new Promise(b=>setTimeout(b,a))}try{let b=await a();if(b)return b}catch(a){c?.warn?.("TOKEN_REFRESH",`Attempt ${d+1}/${b} failed: ${a.message}`)}}return c?.error?.("TOKEN_REFRESH",`All ${b} retry attempts failed`),null}},39609:(a,b,c)=>{c.d(b,{proxyAwareFetch:()=>u});var d=c(27910),e=c(41004);let f=globalThis.fetch,g=new Map,h=null;async function i(){if(h)return h;try{let{Agent:a}=await c.e(7774).then(c.t.bind(c,47774,19));h=new a({keepAliveTimeout:6e4,keepAliveMaxTimeout:6e5,connections:50,pipelining:1})}catch{h=null}return h}let j=new Map;async function k(a,b){let d=`${b}|${a}`,e=j.get(d);if(e)return e;let f=await Promise.resolve().then(c.t.bind(c,55591,23)),g=new(f.default??f).Agent({keepAlive:!0,keepAliveMsecs:3e4,maxSockets:50,maxFreeSockets:10,timeout:6e4,scheduling:"lifo"});return j.set(d,g),g}let l=new Map,m=["cloudcode-pa.googleapis.com","daily-cloudcode-pa.googleapis.com","api.individual.githubcopilot.com","q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com","api2.cursor.sh","api.anthropic.com"],n=["8.8.8.8","8.8.4.4"];function o(a){return null==a?"":String(a).trim()}async function p(a){let b=l.get(a);if(b&&Date.now()<b.expiry)return b.ip;try{let b=await Promise.resolve().then(c.t.bind(c,14985,23)),{promisify:d}=await Promise.resolve().then(c.t.bind(c,28354,23)),f=new b.Resolver;f.setServers(n);let g=d(f.resolve4.bind(f)),h=await g(a);return l.set(a,{ip:h[0],expiry:Date.now()+e.v1.dnsCacheTtlMs}),h[0]}catch(b){return console.warn(`[ProxyFetch] DNS resolve failed for ${a}:`,b.message),null}}function q(a,b){let c,d=o(b);if(!d)return!1;try{c=new URL(a).hostname.toLowerCase()}catch{return!1}return d.split(",").map(a=>a.trim().toLowerCase()).filter(Boolean).some(a=>"*"===a||(a.startsWith(".")?c.endsWith(a)||c===a.slice(1):c===a||c.endsWith(`.${a}`)))}function r(a){let b=o(a);if(!b)return null;try{return new URL(b),b}catch{return`http://${b}`}}async function s(a){let b=r(a);if(!b)return null;if(!g.has(b)){g.size>=e.v1.proxyDispatchersMaxSize&&g.delete(g.keys().next().value);let{ProxyAgent:a}=await c.e(7774).then(c.t.bind(c,47774,19));g.set(b,new a({uri:b}))}return g.get(b)}async function t(a,b,e){let f=await Promise.resolve().then(c.t.bind(c,55591,23)),g=f.default??f,h=await k(b,a.hostname);return new Promise((c,f)=>{let i={host:b,port:443,servername:a.hostname,path:a.pathname+a.search,method:e.method||"POST",headers:{...e.headers,Host:a.hostname,Connection:"keep-alive"},agent:h},j=g.request(i,a=>{let b={ok:a.statusCode>=200&&a.statusCode<300,status:a.statusCode,statusText:a.statusMessage,headers:new Map(Object.entries(a.headers)),body:d.Readable.toWeb(a),text:async()=>{let b=[];for await(let c of a)b.push(c);return Buffer.concat(b).toString()},json:async()=>JSON.parse(await b.text())};c(b)});j.on("error",f),e.body&&j.write("string"==typeof e.body?e.body:JSON.stringify(e.body)),j.end()})}async function u(a,b={},c=null){let d="string"==typeof a?a:a.toString(),e=o(c?.vercelRelayUrl);if(e){let a=new URL(d),c={...b.headers,"x-relay-target":`${a.protocol}//${a.host}`,"x-relay-path":`${a.pathname}${a.search}`};return f(e,{...b,headers:c})}let g=function(a,b){if(b?.enabled!==!0&&b?.connectionProxyEnabled!==!0)return null;let c=o(b?.url??b?.connectionProxyUrl);if(!c)return null;let d=o(b?.noProxy??b?.connectionNoProxy);return d&&q(a,d)?null:r(c)}(d,c),h=g?null:r(function(a){let b;if(q(a,process.env.NO_PROXY||process.env.no_proxy))return null;try{b=new URL(a).protocol}catch{return null}return"https:"===b?process.env.HTTPS_PROXY||process.env.https_proxy||process.env.ALL_PROXY||process.env.all_proxy:process.env.HTTP_PROXY||process.env.http_proxy||process.env.ALL_PROXY||process.env.all_proxy}(d)),j=g||h;if(function(a){try{let b=new URL(a).hostname;return m.some(a=>b.includes(a))}catch{return!1}}(d)){if(j)try{let c=await s(j);return await f(a,{...b,dispatcher:c})}catch(a){if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${a.message}`);console.warn(`[ProxyFetch] Proxy failed, falling back to direct bypass: ${a.message}`)}try{let a=new URL(d),c=await p(a.hostname);if(c)return await t(a,c,b)}catch(a){console.warn(`[ProxyFetch] MITM bypass failed: ${a.message}`)}}if(j)try{let c=await s(j);return await f(a,{...b,dispatcher:c})}catch(d){if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${d.message}`);return console.warn(`[ProxyFetch] Proxy failed, falling back to direct: ${d.message}`),f(a,b)}let k=await i();return k?f(a,{...b,dispatcher:k}):f(a,b)}async function v(a,b={}){return u(a,b,null)}globalThis.fetch!==v&&(globalThis.fetch=v)},41004:(a,b,c)=>{c.d(b,{C8:()=>l,DR:()=>k,Uc:()=>h,cI:()=>j,eo:()=>i,gx:()=>d,pH:()=>g,v1:()=>e,xM:()=>f}),c(3662);let d={BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,NOT_ACCEPTABLE:406,REQUEST_TIMEOUT:408,RATE_LIMITED:429,SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504},e={sessionTtlMs:72e5,sessionCleanupIntervalMs:18e5,dnsCacheTtlMs:3e5,proxyDispatchersMaxSize:20},f=6e4,g=6e4,h=64e3,i=32e3,j={429:{attempts:0,delayMs:0},502:{attempts:3,delayMs:3e3},503:{attempts:3,delayMs:2e3},504:{attempts:2,delayMs:3e3}};function k(a){return null==a?{attempts:0,delayMs:2e3}:"number"==typeof a?{attempts:a,delayMs:2e3}:{attempts:a.attempts||0,delayMs:null!=a.delayMs?a.delayMs:2e3}}let l=["Please write a 5-10 word title for the following conversation:"]},75924:(a,b,c)=>{c.d(b,{$V:()=>t,A9:()=>i,Cn:()=>j,Co:()=>s,Ic:()=>q,J5:()=>n,K:()=>o,NA:()=>v,Ox:()=>k,QH:()=>l,VK:()=>w,Wu:()=>u,go:()=>e,nZ:()=>p,sX:()=>f,uR:()=>m,x0:()=>g,zv:()=>r});var d=c(21820);let e="google-genai-sdk/1.41.0 gl-node/v22.19.0";function f(a="unknown"){let b;return`GeminiCLI/0.34.0/${a||"unknown"} (${(0,d.platform)()}; ${"ia32"===(b=(0,d.arch)())?"x86":b}; terminal)`}let g={VSCODE_VERSION:"1.110.0",COPILOT_CHAT_VERSION:"0.38.0",USER_AGENT:"GitHubCopilotChat/0.38.0",API_VERSION:"2025-04-01"};function h(){let a=(0,d.platform)(),b=(0,d.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}function i(){return`antigravity/1.104.0 ${(0,d.platform)()}/${(0,d.arch)()}`}let j={ideType:9,platform:h(),pluginType:2},k={name:"x-request-source",value:"local"},l="_ide",m="_ide",n=new Set(["browser_subagent","command_status","find_by_name","generate_image","grep_search","list_dir","list_resources","multi_replace_file_content","notify_user","read_resource","read_terminal","read_url_content","replace_file_content","run_command","search_web","send_command_input","task_boundary","view_content_chunk","view_file","write_to_file"]),o={"User-Agent":`antigravity/1.107.0 ${(0,d.platform)()}/${(0,d.arch)()}`},p={loadCodeAssist:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUser:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser"},q={"Content-Type":"application/json","User-Agent":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"google-cloud-sdk vscode_cloudshelleditor/0.1","Client-Metadata":JSON.stringify({ideType:9,platform:h(),pluginType:2})},r={ideType:9,platform:h(),pluginType:2},s="You are Claude Code, Anthropic's official CLI for Claude.",t="You are Antigravity, a powerful agentic AI coding assistant designed by the Google Deepmind team working on Advanced Agentic Coding.You are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.**Absolute paths only****Proactiveness**",u={codex:432e6,claude:144e5,iflow:864e5,qwen:12e5,"kimi-coding":3e5,antigravity:3e5},v={google:{token:"https://oauth2.googleapis.com/token",auth:"https://accounts.google.com/o/oauth2/auth"},openai:{token:"https://auth.openai.com/oauth/token",auth:"https://auth.openai.com/oauth/authorize"},anthropic:{token:"https://api.anthropic.com/v1/oauth/token",auth:"https://api.anthropic.com/v1/oauth/authorize"},qwen:{token:"https://qwen.ai/api/v1/oauth2/token",auth:"https://qwen.ai/api/v1/oauth2/device/code"},iflow:{token:"https://iflow.cn/oauth/token",auth:"https://iflow.cn/oauth"},github:{token:"https://github.com/login/oauth/access_token",auth:"https://github.com/login/oauth/authorize",deviceCode:"https://github.com/login/device/code"}};function w(){return{"X-Msh-Platform":"9router","X-Msh-Version":"2.1.2","X-Msh-Device-Model":"u">typeof process?`${process.platform} ${process.arch}`:"unknown","X-Msh-Device-Id":`kimi-${Date.now()}`}}},89718:(a,b,c)=>{c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q9:()=>d.Q9,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(9248)}};
@@ -1 +0,0 @@
1
- "use strict";exports.id=8271,exports.ids=[1998,8271],exports.modules={18271:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>m,refreshAndUpdateCredentials:()=>l});var e=c(48895),f=c(89718),g=c(99675),h=c(55330),i=c(39326),j=c(75681),k=a([e,h]);[e,h]=k.then?(await k)():k;let n=["expired","authentication","unauthorized","401","re-authorize"];async function l(a,b=!1,c=null){let d=(0,h.SB)(a.provider),e={accessToken:a.accessToken,refreshToken:a.refreshToken,idToken:a.idToken,expiresAt:a.expiresAt||a.tokenExpiresAt,lastRefreshAt:a.lastRefreshAt,connectionId:a.id,providerSpecificData:a.providerSpecificData,copilotToken:a.providerSpecificData?.copilotToken,copilotTokenExpiresAt:a.providerSpecificData?.copilotTokenExpiresAt};if(!(b||d.needsRefresh(e)))return{connection:a,refreshed:!1};let g=await d.refreshCredentials(e,console,c);if(!g){if(a.accessToken)return{connection:a,refreshed:!1};throw Error("Failed to refresh credentials. Please re-authorize the connection.")}let i={updatedAt:new Date().toISOString()};g.accessToken&&(i.accessToken=g.accessToken),g.refreshToken&&(i.refreshToken=g.refreshToken),g.idToken&&(i.idToken=g.idToken),g.lastRefreshAt&&(i.lastRefreshAt=g.lastRefreshAt),g.expiresIn?(i.expiresAt=new Date(Date.now()+1e3*g.expiresIn).toISOString(),i.expiresIn=g.expiresIn):g.expiresAt&&(i.expiresAt=g.expiresAt);let j={...g.providerSpecificData||{},...g.copilotToken?{copilotToken:g.copilotToken}:{},...g.copilotTokenExpiresAt?{copilotTokenExpiresAt:g.copilotTokenExpiresAt}:{}};return Object.keys(j).length>0&&(i.providerSpecificData={...a.providerSpecificData||{},...j}),await (0,f.updateProviderConnection)(a.id,i),{connection:{...a,...i,providerSpecificData:i.providerSpecificData||a.providerSpecificData},refreshed:!0}}async function m(a,{params:b}){let c;try{let{connectionId:a}=await b;if(!(c=await (0,f.Mc)(a)))return Response.json({error:"Connection not found"},{status:404});let d="oauth"===c.authType,e="apikey"===c.authType&&j.jO.includes(c.provider);if(!d&&!e)return Response.json({message:"Usage not available for this connection"});let h=await (0,i.B)(c.providerSpecificData),k={connectionProxyEnabled:!0===h.connectionProxyEnabled,connectionProxyUrl:h.connectionProxyUrl||"",connectionNoProxy:h.connectionNoProxy||"",vercelRelayUrl:h.vercelRelayUrl||"",strictProxy:!1};if(d)try{c=(await l(c,!1,k)).connection}catch(a){return console.error("[Usage API] Credential refresh failed:",a),Response.json({error:`Credential refresh failed: ${a.message}`},{status:401})}let m=await (0,g.m)(c,k);if(d&&function(a){if(!a?.message)return!1;let b=a.message.toLowerCase();return n.some(a=>b.includes(a))}(m)&&c.refreshToken)try{c=(await l(c,!0,k)).connection,m=await (0,g.m)(c,k)}catch(a){console.warn(`[Usage] ${c.provider}: force refresh failed: ${a.message}`)}return Response.json(m)}catch(b){let a=c?.provider??"unknown";return console.warn(`[Usage] ${a}: ${b.message}`),Response.json({error:b.message},{status:500})}}d()}catch(a){d(a)}})},39326:(a,b,c)=>{c.d(b,{B:()=>f});var d=c(71998);function e(a){return null==a?"":String(a).trim()}async function f(a={}){try{let b=e(a?.proxyPoolId),c="__none__"===b?"":b,f=function(a={}){let b=a?.connectionProxyEnabled===!0,c=e(a?.connectionProxyUrl);return{connectionProxyEnabled:b,connectionProxyUrl:c,connectionNoProxy:e(a?.connectionNoProxy)}}(a);if(c){let a=await (0,d.hr)(c),b=e(a?.proxyUrl),f=e(a?.noProxy);if(a&&!0===a.isActive&&b){if("vercel"===a.type||"cloudflare"===a.type||"deno"===a.type)return{source:a.type,proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:f,strictProxy:!0===a.strictProxy,vercelRelayUrl:b};return{source:"pool",proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!0,connectionProxyUrl:b,connectionNoProxy:f,strictProxy:!0===a.strictProxy}}}if(f.connectionProxyEnabled&&f.connectionProxyUrl)return{source:"legacy",proxyPoolId:c||null,proxyPool:null,...f};return{source:"none",proxyPoolId:c||null,proxyPool:null,...f}}catch(a){return console.error("[resolveConnectionProxyConfig] Failed to resolve proxy config:",a),{source:"error",proxyPoolId:null,proxyPool:null,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:"",strictProxy:!1}}}},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(89718)},99675:(a,b,c)=>{c.d(b,{g:()=>v,m:()=>k});var d=c(75924),e=c(39609),f=c(6382);let g={international:"https://api.z.ai/api/monitor/usage/quota/limit",china:"https://open.bigmodel.cn/api/monitor/usage/quota/limit"},h={minimax:["https://www.minimax.io/v1/token_plan/remains","https://api.minimax.io/v1/api/openplatform/coding_plan/remains"],"minimax-cn":["https://www.minimaxi.com/v1/api/openplatform/coding_plan/remains","https://api.minimaxi.com/v1/api/openplatform/coding_plan/remains"]},i={quotaApiUrl:"https://cloudcode-pa.googleapis.com/v1internal:fetchAvailableModels",loadProjectApiUrl:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",tokenUrl:"https://oauth2.googleapis.com/token",clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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",userAgent:(0,d.A9)()},j="2023-06-01";async function k(a,b=null){let{provider:c,accessToken:d,apiKey:e,providerSpecificData:f,projectId:g}=a,h={...f||{},...g?{projectId:g}:{}};switch(c){case"github":return await m(d,f,b);case"gemini-cli":return await o(d,h,b);case"antigravity":return await r(d,f,b);case"claude":return await v(d,b);case"codex":return await A(d,b);case"kiro":return await B(d,f,b);case"qoder":return await O(d,b);case"qwen":return await C(d,f);case"iflow":return await D(d);case"ollama":return await E(d);case"glm":case"glm-cn":return await F(e,c,b);case"minimax":case"minimax-cn":return await M(e,c,b);case"vercel-ai-gateway":return await N(e,b);default:return{message:`Usage API not implemented for ${c}`}}}function l(a){if(!a)return null;try{if(a instanceof Date)return a.toISOString();if("number"==typeof a)return new Date(a<1e12?1e3*a:a).toISOString();if("string"==typeof a){if(/^\d+$/.test(a)){let b=Number(a);return new Date(b<1e12?1e3*b:b).toISOString()}return new Date(a).toISOString()}return null}catch(b){return console.warn(`Failed to parse reset time: ${a}`,b),null}}async function m(a,b,c=null){try{if(!a)throw Error("No GitHub access token available. Please re-authorize the connection.");let b=await (0,e.proxyAwareFetch)("https://api.github.com/copilot_internal/user",{headers:{Authorization:`token ${a}`,Accept:"application/json","X-GitHub-Api-Version":"2022-11-28","User-Agent":"GitHubCopilotChat/0.26.7","Editor-Version":"vscode/1.100.0","Editor-Plugin-Version":"copilot-chat/0.26.7"}},c);if(!b.ok){let a=await b.text();throw Error(`GitHub API error: ${a}`)}let d=await b.json();if(d.quota_snapshots){let a=d.quota_snapshots,b=l(d.quota_reset_date);return{plan:d.copilot_plan,resetDate:d.quota_reset_date,quotas:{chat:{...n(a.chat),resetAt:b},completions:{...n(a.completions),resetAt:b},premium_interactions:{...n(a.premium_interactions),resetAt:b}}}}if(d.monthly_quotas||d.limited_user_quotas){let a=d.monthly_quotas||{},b=d.limited_user_quotas||{},c=l(d.limited_user_reset_date);return{plan:d.copilot_plan||d.access_type_sku,resetDate:d.limited_user_reset_date,quotas:{chat:{used:b.chat||0,total:a.chat||0,unlimited:!1,resetAt:c},completions:{used:b.completions||0,total:a.completions||0,unlimited:!1,resetAt:c}}}}return{message:"GitHub Copilot connected. Unable to parse quota data."}}catch(a){throw Error(`Failed to fetch GitHub usage: ${a.message}`)}}function n(a){return a?{used:a.entitlement-a.remaining,total:a.entitlement,remaining:a.remaining,unlimited:a.unlimited||!1}:{used:0,total:0,unlimited:!0}}async function o(a,b,c=null){if(!a)return{plan:"Free",message:"Gemini CLI access token not available."};try{let d,f=p(b?.projectId),g="Free";if(!f){let b=await q(a,c);f=p(b?.cloudaicompanionProject),g=b?.currentTier?.name||g}if(!f)return{plan:g,message:"Gemini CLI project ID not available. Reconnect Gemini CLI, or configure a Google Cloud project with Gemini Code Assist access before checking quota."};let h=new AbortController,i=setTimeout(()=>h.abort(),1e4);try{d=await (0,e.proxyAwareFetch)("https://cloudcode-pa.googleapis.com/v1internal:retrieveUserQuota",{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify({project:f}),signal:h.signal},c)}finally{clearTimeout(i)}if(!d.ok)return{plan:g,message:`Gemini CLI quota error (${d.status}).`};let j=await d.json(),k={};if(Array.isArray(j.buckets))for(let a of j.buckets){if(!a.modelId||null==a.remainingFraction)continue;let b=Number(a.remainingFraction)||0,c=100*b,d=Math.round(c),e=Math.max(0,100-d);k[a.modelId]={used:e,total:100,remaining:d,resetAt:l(a.resetTime),remainingPercentage:c,unlimited:!1}}return{plan:g,quotas:k}}catch(a){return{message:`Gemini CLI error: ${a.message}`}}}function p(a){return"string"==typeof a?a.trim()||null:a&&"object"==typeof a&&"string"==typeof a.id&&a.id.trim()||null}async function q(a,b=null){let c=new AbortController,f=setTimeout(()=>c.abort(),1e4);try{let f=await (0,e.proxyAwareFetch)("https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify({metadata:d.Cn}),signal:c.signal},b);if(!f.ok)return null;return await f.json()}catch{return null}finally{clearTimeout(f)}}async function r(a,b,c=null){try{let b,d=await s(a,c),f=d?.cloudaicompanionProject||null,g=new AbortController,h=setTimeout(()=>g.abort(),1e4);try{b=await (0,e.proxyAwareFetch)(i.quotaApiUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,"User-Agent":i.userAgent,"Content-Type":"application/json","X-Client-Name":"antigravity","X-Client-Version":"1.107.0","x-request-source":"local"},body:JSON.stringify({...f?{project:f}:{}}),signal:g.signal},c)}finally{clearTimeout(h)}if(403===b.status)return{message:"Antigravity quota API access forbidden. Chat may still work.",quotas:{}};if(401===b.status)return{message:"Antigravity quota API authentication expired. Chat may still work.",quotas:{}};if(!b.ok)throw Error(`Antigravity API error: ${b.status}`);let j=await b.json(),k={};if(j.models){let a=["gemini-3-flash-agent","gemini-3.5-flash-low","gemini-3.5-flash-extra-low","gemini-pro-agent","gemini-3.1-pro-low","claude-sonnet-4-6","claude-opus-4-6-thinking","gpt-oss-120b-medium","gemini-3-flash"];for(let[b,c]of Object.entries(j.models)){if(!c.quotaInfo||c.isInternal||!a.includes(b))continue;let d=c.quotaInfo.remainingFraction||0,e=100*d,f=Math.round(100-e),g=Math.round(e);k[b]={used:f,total:100,remaining:g,resetAt:l(c.quotaInfo.resetTime),remainingPercentage:e,unlimited:!1,displayName:c.displayName||b}}}return{plan:d?.currentTier?.name||"Unknown",quotas:k,subscriptionInfo:d}}catch(a){return console.error("[Antigravity Usage] Error:",a.message,a.cause),{message:`Antigravity error: ${a.message}`}}}async function s(a,b=null){let c=new AbortController,f=setTimeout(()=>c.abort(),1e4);try{let f=await (0,e.proxyAwareFetch)(i.loadProjectApiUrl,{method:"POST",headers:{Authorization:`Bearer ${a}`,"User-Agent":i.userAgent,"Content-Type":"application/json","x-request-source":"local"},body:JSON.stringify({metadata:d.Cn,mode:1}),signal:c.signal},b);if(!f.ok)return null;return await f.json()}catch(a){return console.error("[Antigravity Subscription] Error:",a.message),null}finally{clearTimeout(f)}}let t=new Map,u=new Map;async function v(a,b=null){try{let c=t.get(a);if(c&&Date.now()<c){let b=u.get(a);if(b&&Date.now()-b.at<48e4)return{...b.data,fromCache:!0};let d=Math.ceil((c-Date.now())/1e3);return{message:`Claude connected. Usage API rate-limited (HTTP 429) — retrying in ~${d}s.`}}let d=await (0,e.proxyAwareFetch)("https://api.anthropic.com/api/oauth/usage",{method:"GET",headers:{Authorization:`Bearer ${a}`,"anthropic-beta":"oauth-2025-04-20","anthropic-version":j,"x-request-source":"local"}},b);if(429===d.status){t.set(a,Date.now()+18e4);let b=u.get(a);if(b)return{...b.data,fromCache:!0};let c=Math.ceil(180);return{message:`Claude connected. Usage API rate-limited (HTTP 429) — retrying in ~${c}s.`}}if(d.ok){let b=await d.json(),c={},e=a=>a&&"object"==typeof a&&"number"==typeof a.utilization,f=a=>{let b=a.utilization,c=Math.max(0,100-b);return{used:b,total:100,remaining:c,remainingPercentage:c,resetAt:l(a.resets_at),unlimited:!1}};for(let[a,d]of(e(b.five_hour)&&(c["session (5h)"]=f(b.five_hour)),e(b.seven_day)&&(c["weekly (7d)"]=f(b.seven_day)),Object.entries(b)))if(a.startsWith("seven_day_")&&"seven_day"!==a&&e(d)){let b=a.replace("seven_day_","");c[`weekly ${b} (7d)`]=f(d)}let g={plan:"Claude Code",extraUsage:b.extra_usage??null,quotas:c};return u.set(a,{at:Date.now(),data:g}),g}return console.warn(`[Claude Usage] OAuth endpoint returned ${d.status}, falling back to legacy`),await w(a,b,d.status)}catch(a){return{message:`Claude connected. Unable to fetch usage: ${a.message}`}}}async function w(a,b=null,c=null){try{let d=await (0,e.proxyAwareFetch)("https://api.anthropic.com/v1/settings",{method:"GET",headers:{Authorization:`Bearer ${a}`,"anthropic-version":j,"x-request-source":"local"}},b);if(d.ok){let c=await d.json();if(c.organization_id){let d=await (0,e.proxyAwareFetch)("https://api.anthropic.com/v1/organizations/{org_id}/usage".replace("{org_id}",c.organization_id),{method:"GET",headers:{Authorization:`Bearer ${a}`,"anthropic-version":j,"x-request-source":"local"}},b);if(d.ok){let a=await d.json();return{plan:c.plan||"Unknown",organization:c.organization_name,quotas:a}}}return{plan:c.plan||"Unknown",organization:c.organization_name,message:"Claude connected. Usage details require admin access."}}if(429===c)return{message:"Claude connected. Usage API rate-limited (HTTP 429) — quota will refresh automatically."};if(401===c)return{message:"Claude connected. Usage API rejected the access token (HTTP 401) — try reconnecting Claude."};if(c&&c>=500)return{message:`Claude connected. Usage API upstream error (HTTP ${c}) — typically transient.`};return{message:"Claude connected. Usage API requires admin permissions on this token."}}catch(a){return{message:`Claude connected. Unable to fetch usage: ${a.message}`}}}function x(a){return!a||"object"!=typeof a||Array.isArray(a)?null:a.rate_limit&&"object"==typeof a.rate_limit?a.rate_limit:a}function y(a){let b=Math.max(0,Math.min(100,function(a,b=0){if("number"==typeof a&&Number.isFinite(a))return a;if("string"==typeof a&&a.trim()){let b=Number(a);if(Number.isFinite(b))return b}return b}(a?.used_percent??a?.percent_used,0)));return{used:b,total:100,remaining:Math.max(0,100-b),resetAt:l(a?.reset_at??a?.resets_at??a?.resetAt??null),unlimited:!1}}function z(a,b,c){let d=x(c);if(!d)return!1;let e=d.primary_window||d.primary||c.primary_window||c.primary,f=d.secondary_window||d.secondary||c.secondary_window||c.secondary,g=!1;return e&&(a[b?`${b}_session`:"session"]=y(e),g=!0),f&&(a[b?`${b}_weekly`:"weekly"]=y(f),g=!0),g}async function A(a,b=null){try{let c=await (0,e.proxyAwareFetch)("https://chatgpt.com/backend-api/wham/usage",{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},b);if(!c.ok)return{message:`Codex connected. Usage API temporarily unavailable (${c.status}).`};let d=await c.json(),f=d.rate_limit||d.rate_limits||d.rate_limits_by_limit_id?.codex||{},g=function(a){if(a.code_review_rate_limit||a.review_rate_limit)return a.code_review_rate_limit||a.review_rate_limit;let b=a.rate_limits_by_limit_id;return b&&"object"==typeof b&&!Array.isArray(b)?b.code_review||b.codex_review||b.review||null:(Array.isArray(a.additional_rate_limits)?a.additional_rate_limits:[]).find(a=>{let b=String(a?.limit_name||a?.metered_feature||a?.id||"").toLowerCase();return"code_review"===b||"codex_review"===b||"review"===b||b.includes("review")})||null}(d),h={};return z(h,"",f),z(h,"review",g),{plan:d.plan_type||d.summary?.plan||"unknown",limitReached:x(f)?.limit_reached||!1,reviewLimitReached:x(g)?.limit_reached||!1,quotas:h}}catch(a){throw Error(`Failed to fetch Codex usage: ${a.message}`)}}async function B(a,b,c=null){let d=b?.authMethod||"builder-id",g=b?.profileArn||(0,f.We)(d),h=new URLSearchParams({isEmailRequired:"true",origin:"AI_EDITOR",resourceType:"AGENTIC_REQUEST"}),i=!1,j=[];for(let b of[{name:"codewhisperer-get",run:async()=>(0,e.proxyAwareFetch)(`https://codewhisperer.us-east-1.amazonaws.com/getUsageLimits?${h.toString()}`,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","x-amz-user-agent":"aws-sdk-js/1.0.0 KiroIDE","user-agent":"aws-sdk-js/1.0.0 KiroIDE"}},c)},{name:"codewhisperer-post",run:async()=>(0,e.proxyAwareFetch)("https://codewhisperer.us-east-1.amazonaws.com",{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/x-amz-json-1.0","x-amz-target":"AmazonCodeWhispererService.GetUsageLimits",Accept:"application/json"},body:JSON.stringify({origin:"AI_EDITOR",profileArn:g,resourceType:"AGENTIC_REQUEST"})},c)},{name:"q-get",run:async()=>{let b=new URLSearchParams({origin:"AI_EDITOR",profileArn:g,resourceType:"AGENTIC_REQUEST"});return(0,e.proxyAwareFetch)(`https://q.us-east-1.amazonaws.com/getUsageLimits?${b}`,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},c)}}])try{let a=await b.run();if(!a.ok){let c=await a.text().catch(()=>"");(401===a.status||403===a.status)&&(i=!0),j.push(`${b.name}:${a.status}${c?`:${c}`:""}`);continue}let c=await a.json();return function(a){let b=a.usageBreakdownList||[],c={},d=l(a.nextDateReset||a.resetDate);return b.forEach(a=>{let b=a.resourceType?.toLowerCase()||"unknown",e=a.currentUsageWithPrecision||0,f=a.usageLimitWithPrecision||0;if(c[b]={used:e,total:f,remaining:f-e,resetAt:d,unlimited:!1},a.freeTrialInfo){let e=a.freeTrialInfo.currentUsageWithPrecision||0,f=a.freeTrialInfo.usageLimitWithPrecision||0;c[`${b}_freetrial`]={used:e,total:f,remaining:f-e,resetAt:l(a.freeTrialInfo.freeTrialExpiry||d),unlimited:!1}}}),{plan:a.subscriptionInfo?.subscriptionTitle||"Kiro",quotas:c}}(c)}catch(a){j.push(`${b.name}:${a.message}`)}return i&&"idc"===d?{message:"Kiro quota API is unavailable for the current AWS IAM Identity Center session. Chat may still work. If this persists after renewing your session, reconnect Kiro.",quotas:{}}:i&&("google"===d||"github"===d)?{message:"Kiro quota API authentication expired. Chat may still work.",quotas:{}}:i?{message:"Kiro quota API rejected the current token. Chat may still work.",quotas:{}}:{message:j.length>0?`Unable to fetch Kiro usage right now. (${j[j.length-1]})`:"Unable to fetch Kiro usage right now.",quotas:{}}}async function C(a,b){try{if(!b?.resourceUrl)return{message:"Qwen connected. No resource URL available."};return{message:"Qwen connected. Usage tracked per request."}}catch(a){return{message:"Unable to fetch Qwen usage."}}}async function D(a){try{return{message:"iFlow connected. Usage tracked per request."}}catch(a){return{message:"Unable to fetch iFlow usage."}}}async function E(a,b){try{return{plan:b?.plan||"Free",message:"Ollama Cloud uses a free tier with light usage limits (resets every 5h & 7d). For detailed usage tracking, visit ollama.com/settings/keys.",quotas:[]}}catch(a){return{message:"Unable to fetch Ollama Cloud usage."}}}async function F(a,b,c=null){if(!a)return{message:"GLM API key not available."};let d=g["glm-cn"===b?"china":"international"];try{let b=await (0,e.proxyAwareFetch)(d,{headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},c);if(!b.ok){if(401===b.status)return{message:"GLM API key invalid or expired."};return{message:`GLM quota API error (${b.status}).`}}let f=await b.json(),g=f?.data&&"object"==typeof f.data?f.data:{},h=Array.isArray(g.limits)?g.limits:[],i={};for(let a of h){if(!a||"TOKENS_LIMIT"!==a.type)continue;let b=Number(a.percentage)||0,c=Number(a.nextResetTime)||0,d=Math.max(0,100-b);i.session={used:b,total:100,remaining:d,remainingPercentage:d,resetAt:c>0?new Date(c).toISOString():null,unlimited:!1}}let j="string"==typeof g.level?g.level:"";return{plan:j?j.charAt(0).toUpperCase()+j.slice(1).toLowerCase():"Unknown",quotas:i}}catch(a){return{message:`GLM error: ${a.message}`}}}function G(a,b,c){return a&&"object"==typeof a?a[b]??a[c]??null:null}function H(a,b,c){if(!a||"object"!=typeof a)return null;let d=a[b]??a[c];if(null==d)return null;let e=Number(d);return Number.isFinite(e)?Math.max(0,Math.min(100,e)):null}function I(a){return Math.max(0,Number(G(a,"current_interval_total_count","currentIntervalTotalCount"))||0)}function J(a){return Math.max(0,Number(G(a,"current_weekly_total_count","currentWeeklyTotalCount"))||0)}function K(a){return!!(I(a)>0||J(a)>0)||null!==H(a,"current_interval_remaining_percent","currentIntervalRemainingPercent")||null!==H(a,"current_weekly_remaining_percent","currentWeeklyRemainingPercent")}function L(a,b,c,d,e,f,g,h,i,j){let k=d(c),m=H(c,g,h);if(k<=0&&null===m)return;let n=Math.max(0,Number(G(c,e,f))||0),o=k,p=n;k<=0&&(o=100,p=j?Math.round(m/100*o):Math.round(o*(1-m/100))),a[b]=function(a,b,c,d,e=null){var f,g,h;let i=Math.max(0,a),j=d?Math.max(i-b,0):Math.min(Math.max(0,b),i),k=Math.max(i-j,0),l=(f=e,g=k,h=i,null!=f&&Number.isFinite(f)?Math.max(0,Math.min(100,f)):h>0?Math.max(0,Math.min(100,g/h*100)):0);return{used:j,total:i,remaining:k,remainingPercentage:l,resetAt:c,unlimited:!1}}(o,p,function(a,b,c,d,e,f){let g=Number(G(a,c,d))||0;return g>0?new Date(b+g).toISOString():l(G(a,e,f))}(c,...i),j,m)}async function M(a,b,c=null){if(!a)return{message:"MiniMax API key not available."};let d=h[b]||[],f="";for(let b=0;b<d.length;b+=1){let g=d[b],h=b<d.length-1;try{let b=await (0,e.proxyAwareFetch)(g,{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","Content-Type":"application/json"}},c),d=await b.text(),i={};if(d)try{i=JSON.parse(d)}catch{i={}}let j=(i?.base_resp??i?.baseResp)||{},k=Number(j.status_code??j.statusCode)||0,l=String(j.status_msg??j.statusMsg??"").trim(),m=`${l} ${d}`.trim(),n=/token plan|coding plan|invalid api key|invalid key|unauthorized|inactive/i;if(401===b.status||403===b.status||1004===k||n.test(m))return{message:"MiniMax API key invalid or inactive. Use an active Token/Coding Plan key."};if(!b.ok){if(f=`MiniMax usage endpoint error (${b.status})`,(404===b.status||405===b.status||b.status>=500)&&h)continue;return{message:`MiniMax connected. ${f}`}}if(0!==k)return{message:`MiniMax connected. ${l||"Upstream quota API error"}`};let o=i?.model_remains??i?.modelRemains,p=(Array.isArray(o)?o:[]).filter(K);if(0===p.length)return{message:"MiniMax connected. No quota data was returned."};let q=Date.now(),r=g.includes("/coding_plan/remains"),s={};for(let a of p){let b=function(a){let b=String(G(a,"model_name","modelName")||"").trim();return b?"MiniMax-M*"===b||"general"===b?"M-series":b.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,a=>a.toUpperCase()).replace(/\bTo\b/g,"to").replace(/\bTts\b/g,"TTS").replace(/\bHd\b/g,"HD"):"MiniMax"}(a);L(s,`${b} (5h)`,a,I,"current_interval_usage_count","currentIntervalUsageCount","current_interval_remaining_percent","currentIntervalRemainingPercent",[q,"remains_time","remainsTime","end_time","endTime"],r),L(s,`${b} (7d)`,a,J,"current_weekly_usage_count","currentWeeklyUsageCount","current_weekly_remaining_percent","currentWeeklyRemainingPercent",[q,"weekly_remains_time","weeklyRemainsTime","weekly_end_time","weeklyEndTime"],r)}if(0===Object.keys(s).length)return{message:"MiniMax connected. Unable to extract quota usage."};return{quotas:s}}catch(a){if(f=a.message,!h)break}}return{message:f?`MiniMax connected. Unable to fetch usage: ${f}`:"MiniMax connected. Unable to fetch usage."}}async function N(a,b=null){if(!a)return{message:"Vercel AI Gateway API key not available."};try{let c=await (0,e.proxyAwareFetch)("https://ai-gateway.vercel.sh/v1/credits",{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},b);if(401===c.status||403===c.status)return{message:"Vercel AI Gateway API key invalid or expired."};if(!c.ok){let a=await c.text().catch(()=>""),b=a?`: ${a.slice(0,200)}`:"";return{message:`Vercel AI Gateway credits API error (${c.status})${b}`}}let d=await c.json(),f=Number(d?.balance)||0,g=Number(d?.total_used)||0;if(f<=0&&g<=0)return{plan:"Pay-as-you-go",message:"Vercel AI Gateway connected. No credit allocation found (BYOK or unfunded account).",quotas:{}};return{plan:"Pay-as-you-go",quotas:{"Used (USD)":{used:g,total:0,remaining:0,remainingPercentage:100,unlimited:!0},"Remaining (USD)":{used:f,total:5,remaining:f,remainingPercentage:f/5*100,unlimited:!1}}}}catch(a){return{message:`Vercel AI Gateway error: ${a.message}`}}}async function O(a,b=null){if(!a)return{message:"Qoder usage unavailable: no access token"};try{let c=await (0,e.proxyAwareFetch)("https://openapi.qoder.sh/api/v2/quota/usage",{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json"}},b);if(!c.ok)return{message:`Qoder connected. Usage fetch returned ${c.status}.`};let d=await c.json().catch(()=>null);if(!d)return{message:"Qoder connected. Usage response was not JSON."};let f=d.userQuota||{},g=d.orgResourcePackage||{},h=Number.isFinite(Number(d.expiresAt))&&Number(d.expiresAt)>0?Number(d.expiresAt):null,i=h?new Date(h).toISOString():null;return{quotas:{user:{total:Number(f.total)||0,used:Number(f.used)||0,remaining:Number(f.remaining)||0,unit:f.unit||"credits",resetAt:i},organization:{total:Number(g.total)||0,used:Number(g.used)||0,remaining:Number(g.remaining)||0,unit:g.unit||"credits",resetAt:i}},totalUsagePercentage:Number(d.totalUsagePercentage)||0,isQuotaExceeded:!!d.isQuotaExceeded,expiresAt:h}}catch(a){return{message:`Qoder connected. Unable to fetch usage: ${a.message}`}}}}};
@@ -1,2 +0,0 @@
1
- "use strict";exports.id=8910,exports.ids=[8910],exports.modules={18910:(a,b,c)=>{c.d(b,{Pr:()=>m,UP:()=>j,Vu:()=>k,vt:()=>o});var d=c(12557),e=c(43659),f=c(66306);let g=new Set(["vision","pdf","audioInput","videoInput"]);function h(a){return a?"string"==typeof a?a:Array.isArray(a)?a.map(a=>"string"==typeof a?a:a?.text||"").join(""):"":""}let i=new Map;function j(a){a?i.delete(a):i.clear()}function k(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}function l(a){if(!Array.isArray(a))return[];let b=[];for(let c=a.length-1;c>=0;c--){let d=a[c];if(d)if("user"===d.role)b.unshift(d);else break}return b}async function m({body:a,models:b,handleSingleModel:c,log:h,comboName:j,comboStrategy:k,comboStickyLimit:n=1,autoSwitch:o=!0}){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=i.get(f),j="number"==typeof h?{index:h,consecutiveUseCount:0}:h||{index:0,consecutiveUseCount:0},k=j.index%a.length,l=function(a,b){let c=[...a];for(let a=0;a<b;a++){let a=c.shift();c.push(a)}return c}(a,k),m=j.consecutiveUseCount+1;return m>=g?i.set(f,{index:(k+1)%a.length,consecutiveUseCount:0}):i.set(f,{index:k,consecutiveUseCount:m}),l}(b,j,k,n);if(o){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 l(a.messages))d(b.content);for(let b of l(a.input))d(b.content);for(let b of l(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=>g.has(a));return 0===c.length?a:a.map((a,b)=>{let d,e,g,h;return{m:a,i:b,t:(e=(d="string"==typeof a?a.indexOf("/"):-1)>0?a.slice(0,d):"",g=d>0?a.slice(d+1):a,h=(0,f.nl)(e,g),+!c.every(a=>!0===h[a]))}}).sort((a,b)=>a.t-b.t||a.i-b.i).map(a=>a.m)}(p,b);a[0]!==p[0]&&h?.info?.("COMBO",`Capacity auto-switch: ${[...b].join(",")} → reordered to ${a[0]} first`),p=a}}let q=null,r=null,s=null;for(let b=0;b<p.length;b++){let e=p[b];h.info("COMBO",`Trying model ${b+1}/${p.length}: ${e}`);try{let b=await c(a,e);if(b.ok)return h.info("COMBO",`Model ${e} succeeded`),b;let f=b.statusText||"",g=null;try{let a=await b.clone().json();f=a?.error?.message||a?.error||a?.message||f,g=a?.retryAfter||null}catch{}if(g&&(!r||new Date(g)<new Date(r))&&(r=g),"string"!=typeof f)try{f=JSON.stringify(f)}catch{f=String(f)}let{shouldFallback:i,cooldownMs:j}=(0,d.hk)(b.status,f),k=404===b.status&&/not[\s_]?found|requested entity/i.test(f||"");if(!i&&!k)return h.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)&&(h.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),h.warn("COMBO",`Model ${e} failed, trying next`,{status:b.status})}catch(a){q=a.message||String(a),s||(s=500),h.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 h.warn("COMBO",`All models failed | ${u} (${a})`),(0,e.wO)(t,u,r,a)}return h.warn("COMBO",`All models failed | ${u}`),new Response(JSON.stringify({error:{message:u}}),{status:t,headers:{"Content-Type":"application/json"}})}let n={minPanel:2,stragglerGraceMs:8e3,panelHardTimeoutMs:9e4};async function o({body:a,models:b,handleSingleModel:c,log:d,comboName:e,judgeModel:f,tuning:g}){var i;let j,k,l=Array.isArray(b)?b.filter(Boolean):[];if(0===l.length)return new Response(JSON.stringify({error:{message:"Fusion combo has no models"}}),{status:400,headers:{"Content-Type":"application/json"}});if(1===l.length)return c(a,l[0]);let m={...n,...g||{}},p=Math.min(Math.max(2,m.minPanel),l.length),q=f&&f.trim()?f.trim():l[0];d.info("FUSION",`Combo "${e}" | panel=${l.length} [${l.join(", ")}] | judge=${q} | quorum=${p}`);let{tools:r,tool_choice:s,...t}=a,u={...t,stream:!1},v=Date.now(),w=l.map(a=>{var b,d;return b=c(u,a),d=m.panelHardTimeoutMs,new Promise(a=>{let c=setTimeout(()=>a({__timeout:!0}),d);Promise.resolve(b).then(b=>{clearTimeout(c),a(b)}).catch(b=>{clearTimeout(c),a({__error:b})})})}),x=await function(a,{minPanel:b,stragglerGraceMs:c,panelHardTimeoutMs:d}){return new Promise(e=>{let f=Array(a.length),g=0,h=0,i=!1,j=null,k=()=>{i||(i=!0,clearTimeout(l),j&&clearTimeout(j),e(f))},l=setTimeout(k,d);a.forEach((d,e)=>{Promise.resolve(d).then(a=>{f[e]=a}).catch(a=>{f[e]={__error:a}}).finally(()=>{if(g++,f[e]&&f[e].ok&&h++,g===a.length)return k();h>=b&&!j&&(j=setTimeout(k,c))})})})}(w,{...m,minPanel:p});d.info("FUSION",`fan-out collected in ${Date.now()-v}ms`);let y=[];for(let a=0;a<x.length;a++){let b=x[a],c=l[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=function(a){if(!a||"object"!=typeof a)return"";let b=a.choices?.[0];if(b){let a=h((b.message??b.delta??{}).content);if(a.trim())return a;if("string"==typeof b.text&&b.text.trim())return b.text}let c=h(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""}(a);e?(y.push({model:c,text:e}),d.info("FUSION",`Panel ${c} ok (${e.length} chars)`)):d.warn("FUSION",`Panel ${c} returned empty content`)}catch(a){d.warn("FUSION",`Panel ${c} unparseable`,{error:a.message||String(a)})}}if(0===y.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===y.length)return d.info("FUSION",`Only ${y[0].model} succeeded — answering directly (no fusion)`),c(a,y[0].model);let z=(j=y.map((a,b)=>`[Source ${b+1}]
2
- ${a.text}`).join("\n\n"),i=[`You are the JUDGE in a model-fusion panel. ${y.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 ===",j,"=== END PANEL RESPONSES ===\n\nNow write the final answer to the user's original request."].join("\n"),k={...a},Array.isArray(a.messages)?k.messages=[...a.messages,{role:"user",content:i}]:Array.isArray(a.input)?k.input=[...a.input,{role:"user",content:i}]:Array.isArray(a.contents)?k.contents=[...a.contents,{role:"user",parts:[{text:i}]}]:k.messages=[{role:"user",content:i}],k);return d.info("FUSION",`Judging ${y.length} answers with ${q}`),c(z,q)}}};
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3471],{38048:(e,t,s)=>{Promise.resolve().then(s.bind(s,64561))},64561:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>u});var a=s(95155),r=s(12115),o=s(73321),i=s(35497),l=s(81127),n=s(21931),d=s(1620),c=s(31474),m=s(90620),x=s(93308),p=s(38202);function u(){let e=(0,o.useRouter)(),{theme:t,setTheme:s,isDark:u}=(0,d.D)(),[h,b]=(0,r.useState)("en"),[g,y]=(0,r.useState)(!1),[f,j]=(0,r.useState)(!1),[w,N]=(0,r.useState)(!1),[v,C]=(0,r.useState)({fallbackStrategy:"fill-first"}),[k,S]=(0,r.useState)(!0),[P,O]=(0,r.useState)({current:"",new:"",confirm:""}),[I,L]=(0,r.useState)({type:"",message:""}),[R,D]=(0,r.useState)(!1),[U,T]=(0,r.useState)(!1),[A,M]=(0,r.useState)({type:"",message:""}),[$,E]=(0,r.useState)({open:!1,mode:"",password:""}),F=(0,r.useRef)(null),[q,J]=(0,r.useState)({authMode:"password",oidcIssuerUrl:"",oidcClientId:"",oidcScopes:"openid profile email",oidcLoginLabel:"Sign in with OIDC"}),[_,H]=(0,r.useState)(""),[K,Z]=(0,r.useState)({type:"",message:""}),[z,B]=(0,r.useState)(!1),[W,Q]=(0,r.useState)(!1),[G,V]=(0,r.useState)({type:"",message:""}),[Y,X]=(0,r.useState)("/api/auth/oidc/callback"),[ee,et]=(0,r.useState)(!1),es=(0,r.useRef)(null),[ea,er]=(0,r.useState)({outboundProxyEnabled:!1,outboundProxyUrl:"",outboundNoProxy:""}),[eo,ei]=(0,r.useState)({type:"",message:""}),[el,en]=(0,r.useState)(!1),[ed,ec]=(0,r.useState)(!1);(0,r.useEffect)(()=>{b(function(){if("u"<typeof document)return"en";let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${x.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):"en";return(0,x.QC)(t)}())},[g]),(0,r.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{C(e),J({authMode:e?.authMode||"password",oidcIssuerUrl:e?.oidcIssuerUrl||"",oidcClientId:e?.oidcClientId||"",oidcScopes:e?.oidcScopes||"openid profile email",oidcLoginLabel:e?.oidcLoginLabel||"Sign in with OIDC"}),H(""),(e?.authMode==="oidc"||e?.authMode==="both")&&et(!0),er({outboundProxyEnabled:e?.outboundProxyEnabled===!0,outboundProxyUrl:e?.outboundProxyUrl||"",outboundNoProxy:e?.outboundNoProxy||""}),S(!1)}).catch(e=>{console.error("Failed to fetch settings:",e),S(!1)})},[]),(0,r.useEffect)(()=>{X(`${window.location.origin}/api/auth/oidc/callback`)},[]);let em=async e=>{if(e.preventDefault(),!0===v.outboundProxyEnabled){en(!0),ei({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyUrl:ea.outboundProxyUrl,outboundNoProxy:ea.outboundNoProxy})}),t=await e.json();e.ok?(C(e=>({...e,...t})),ei({type:"success",message:"Proxy settings applied"})):ei({type:"error",message:t.error||"Failed to update proxy settings"})}catch(e){ei({type:"error",message:"An error occurred"})}finally{en(!1)}}},ex=async()=>{if(!0!==v.outboundProxyEnabled)return;let e=(ea.outboundProxyUrl||"").trim();if(!e)return void ei({type:"error",message:"Please enter a Proxy URL to test"});ec(!0),ei({type:"",message:""});try{let t=await fetch("/api/settings/proxy-test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyUrl:e})}),s=await t.json();t.ok&&s?.ok?ei({type:"success",message:`Proxy test OK (${s.status}) in ${s.elapsedMs}ms`}):ei({type:"error",message:s?.error||"Proxy test failed"})}catch(e){ei({type:"error",message:"An error occurred"})}finally{ec(!1)}},ep=async e=>{en(!0),ei({type:"",message:""});try{let t=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyEnabled:e})}),s=await t.json();t.ok?(C(e=>({...e,...s})),er(e=>({...e,outboundProxyEnabled:s?.outboundProxyEnabled===!0})),ei({type:"success",message:e?"Proxy enabled":"Proxy disabled"})):ei({type:"error",message:s.error||"Failed to update proxy settings"})}catch(e){ei({type:"error",message:"An error occurred"})}finally{en(!1)}},eu=async e=>{if(e.preventDefault(),P.new!==P.confirm)return void L({type:"error",message:"Passwords do not match"});D(!0),L({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:P.current,newPassword:P.new})}),t=await e.json();e.ok?(L({type:"success",message:"Password updated successfully"}),O({current:"",new:"",confirm:""})):L({type:"error",message:t.error||"Failed to update password"})}catch(e){L({type:"error",message:"An error occurred"})}finally{D(!1)}},eh=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({fallbackStrategy:e})})).ok&&C(t=>({...t,fallbackStrategy:e}))}catch(e){console.error("Failed to update settings:",e)}},eb=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategy:e})})).ok&&C(t=>({...t,comboStrategy:e}))}catch(e){console.error("Failed to update combo strategy:",e)}},eg=async e=>{let t=parseInt(e);if(!isNaN(t)&&!(t<1))try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({stickyRoundRobinLimit:t})})).ok&&C(e=>({...e,stickyRoundRobinLimit:t}))}catch(e){console.error("Failed to update sticky limit:",e)}},ey=async e=>{let t=parseInt(e);if(!isNaN(t)&&!(t<1))try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStickyRoundRobinLimit:t})})).ok&&C(e=>({...e,comboStickyRoundRobinLimit:t}))}catch(e){console.error("Failed to update combo sticky limit:",e)}},ef=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:e})})).ok&&C(t=>({...t,requireLogin:e}))}catch(e){console.error("Failed to update require login:",e)}},ej=(e,t)=>{J(s=>({...s,[e]:t}))},ew=async(e=q.authMode||"password")=>{let t=q.oidcIssuerUrl.trim(),s=q.oidcClientId.trim(),a=q.oidcScopes.trim(),r=q.oidcLoginLabel.trim(),o=_.trim();if("password"!==e&&(!t||!s||!o)&&!v.oidcConfigured)return void Z({type:"error",message:"Issuer URL, client ID, and client secret are required to enable OIDC."});B(!0),Z({type:"",message:""}),V({type:"",message:""});try{let i={authMode:e,oidcIssuerUrl:t,oidcClientId:s,oidcScopes:a||"openid profile email",oidcLoginLabel:r||"Sign in with OIDC"};o&&(i.oidcClientSecret=o);let l=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}),n=await l.json();l.ok?(C(e=>({...e,...n})),J({authMode:n?.authMode||e,oidcIssuerUrl:n?.oidcIssuerUrl||t,oidcClientId:n?.oidcClientId||s,oidcScopes:n?.oidcScopes||a||"openid profile email",oidcLoginLabel:n?.oidcLoginLabel||r||"Sign in with OIDC"}),H(""),Z({type:"success",message:"oidc"===e?"OIDC login enabled":"both"===e?"Password and OIDC login enabled":"OIDC settings saved"})):Z({type:"error",message:n.error||"Failed to save OIDC settings"})}catch(e){Z({type:"error",message:"An error occurred"})}finally{B(!1)}},eN=async()=>{let e=q.oidcIssuerUrl.trim(),t=q.oidcClientId.trim(),s=q.oidcScopes.trim(),a=_.trim();if(!e||!t)return void V({type:"error",message:"Issuer URL and client ID are required to test the connection."});Q(!0),Z({type:"",message:""}),V({type:"",message:""});try{let r=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({authMode:q.authMode||v.authMode||"password",oidcIssuerUrl:e,oidcClientId:t,oidcScopes:s||"openid profile email",oidcLoginLabel:q.oidcLoginLabel.trim()||"Sign in with OIDC",...a?{oidcClientSecret:a}:{}})}),o=await r.json().catch(()=>({}));if(!r.ok)return void V({type:"error",message:o.error||"Failed to save OIDC settings before testing"});let i=await fetch("/api/auth/oidc/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({issuerUrl:o.oidcIssuerUrl||e,clientId:o.oidcClientId||t,scopes:o.oidcScopes||s||"openid profile email"})}),l=await i.json().catch(()=>({}));if(i.ok&&l?.ok){let e=l.clientSecretTested?!0===l.clientSecretValid?`Connection OK. Discovery loaded from ${l.issuerUrl}. Client secret validated too.`:`Connection OK. Discovery loaded from ${l.issuerUrl}. Client secret was not checked.`:`Connection OK. Discovery loaded from ${l.issuerUrl}.`;V({type:"success",message:e})}else V({type:"error",message:l.error||"OIDC connection test failed"})}catch(e){V({type:"error",message:"An error occurred"})}finally{Q(!1)}},ev=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enableObservability:e})})).ok&&C(t=>({...t,enableObservability:e}))}catch(e){console.error("Failed to update enableObservability:",e)}},eC=async()=>{try{let e=await fetch("/api/settings");if(!e.ok)return;let t=await e.json();C(t)}catch(e){console.error("Failed to reload settings:",e)}},ek=async e=>{T(!0),M({type:"",message:""});try{let t=await fetch("/api/settings/database",{headers:{"x-9r-password":e}});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||"Failed to export database")}let s=await t.json(),a=JSON.stringify(s,null,2),r=new Blob([a],{type:"application/json"}),o=URL.createObjectURL(r),i=document.createElement("a"),l=new Date().toISOString().replace(/[.:]/g,"-");i.href=o,i.download=`krouter-backup-${l}.json`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o),M({type:"success",message:"Database backup downloaded"})}catch(e){M({type:"error",message:e.message||"Failed to export database"})}finally{T(!1)}},eS=async e=>{let t=F.current;if(t){T(!0);try{let s=await t.text(),a=JSON.parse(s),r=await fetch("/api/settings/database",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...a,password:e})}),o=await r.json().catch(()=>({}));if(!r.ok)throw Error(o.error||"Failed to import database");await eC(),M({type:"success",message:"Database imported successfully"})}catch(e){M({type:"error",message:e.message||"Invalid backup file"})}finally{F.current=null,T(!1)}}},eP=async()=>{let{mode:e,password:t}=$;E({open:!1,mode:"",password:""}),"export"===e?await ek(t):"import"===e&&await eS(t)},eO=!0===v.enableObservability,eI=async()=>{N(!0);try{await fetch("/api/version/shutdown",{method:"POST"})}catch(e){}N(!1),j(!1)},eL=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&(e.push("/login"),e.refresh())}catch(e){console.error("Failed to logout:",e)}};return(0,a.jsxs)("div",{className:"max-w-2xl mx-auto px-4 sm:px-0",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"size-10 sm:size-12 rounded-lg bg-green-500/10 text-green-500 flex items-center justify-center shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-xl sm:text-2xl",children:"computer"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-lg sm:text-xl font-semibold",children:"Local Mode"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Running on your machine"})]})]}),(0,a.jsx)("div",{className:"inline-flex p-1 rounded-lg bg-black/5 dark:bg-white/5 w-full sm:w-auto",children:["light","dark","system"].map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>s(e),className:(0,c.cn)("flex items-center justify-center gap-1 sm:gap-1.5 px-2 sm:px-3 py-1.5 rounded-md font-medium transition-all flex-1 sm:flex-initial",t===e?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"light"===e?"light_mode":"dark"===e?"dark_mode":"contrast"}),(0,a.jsx)("span",{className:"capitalize text-xs sm:text-sm",children:e})]},e))})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 pt-4 border-t border-border",children:[(0,a.jsx)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between p-3 rounded-lg bg-bg border border-border gap-2",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Database Location"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted font-mono break-all",children:"~/.krouter/db/data.sqlite"})]})}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,a.jsx)(i.$n,{variant:"secondary",icon:"download",onClick:()=>E({open:!0,mode:"export",password:""}),loading:U,className:"w-full sm:w-auto",children:"Download Backup"}),(0,a.jsx)(i.$n,{variant:"outline",icon:"upload",onClick:()=>es.current?.click(),disabled:U,className:"w-full sm:w-auto",children:"Import Backup"}),(0,a.jsx)("input",{ref:es,type:"file",accept:"application/json,.json",className:"hidden",onChange:e=>{let t=e.target.files?.[0];es.current&&(es.current.value=""),t&&(F.current=t,M({type:"",message:""}),E({open:!0,mode:"import",password:""}))}})]}),A.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===A.type?"text-red-500":"text-green-600 dark:text-green-400"}`,children:A.message})]})]}),(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"size-10 rounded-lg bg-blue-500/10 text-blue-500 flex items-center justify-center shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"language"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"Language"})]}),(0,a.jsxs)("button",{onClick:()=>y(!0),className:"flex items-center justify-between w-full p-3 rounded-lg bg-bg border border-border hover:border-primary/50 transition-colors","data-i18n-skip":"true",children:[(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Display language"}),(0,a.jsx)("span",{className:"text-2xl",children:p.h[h]||"\uD83C\uDF10"})]})]}),(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"shield"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"Security"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Require login"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"When ON, dashboard requires password. When OFF, access without login."})]}),(0,a.jsx)(i.lM,{checked:!0===v.requireLogin,onChange:()=>ef(!v.requireLogin),disabled:k})]}),!0===v.requireLogin&&(0,a.jsxs)("form",{onSubmit:eu,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[v.hasPassword&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-xs sm:text-sm font-medium",children:"Current Password"}),(0,a.jsx)(i.pd,{type:"password",placeholder:"Enter current password",value:P.current,onChange:e=>O({...P,current:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-xs sm:text-sm font-medium",children:"New Password"}),(0,a.jsx)(i.pd,{type:"password",placeholder:"Enter new password",value:P.new,onChange:e=>O({...P,new:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-xs sm:text-sm font-medium",children:"Confirm New Password"}),(0,a.jsx)(i.pd,{type:"password",placeholder:"Confirm new password",value:P.confirm,onChange:e=>O({...P,confirm:e.target.value}),required:!0})]})]}),I.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===I.type?"text-red-500":"text-green-500"}`,children:I.message}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(i.$n,{type:"submit",variant:"primary",loading:R,className:"w-full sm:w-auto",children:v.hasPassword?"Update Password":"Set Password"})})]})]})]}),(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("button",{type:"button",onClick:()=>et(e=>!e),className:"w-full flex items-center gap-3 text-left",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-indigo-500/10 text-indigo-500 shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"lock_open"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"OIDC Dashboard Login"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"oidc"===v.authMode?"OIDC active":"both"===v.authMode?"Password + OIDC active":"Optional SSO via Authentik/Keycloak/Google"})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted shrink-0",children:ee?"expand_less":"expand_more"})]}),ee&&(0,a.jsxs)("div",{className:"flex flex-col gap-4 mt-4",children:[(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Use Authentik or any OIDC provider to sign in to the dashboard. You can enable password-only, OIDC-only, or both for the dashboard; model API access still uses API keys."}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Auth Mode"}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:[{value:"password",title:"Password only",desc:"Keep the legacy password login."},{value:"oidc",title:"OIDC only",desc:"Require OIDC for dashboard access."},{value:"both",title:"Both",desc:"Allow either password or OIDC."}].map(e=>{let t=q.authMode===e.value;return(0,a.jsxs)("button",{type:"button",onClick:()=>ej("authMode",e.value),className:(0,c.cn)("text-left rounded-lg border p-3 transition-colors",t?"border-primary bg-primary/5":"border-border bg-bg hover:bg-black/5 dark:hover:bg-white/5"),disabled:k||z,children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:e.title}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted mt-1",children:e.desc})]},e.value)})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Issuer URL"}),(0,a.jsx)(i.pd,{placeholder:"https://auth.example.com/application/o/krouter/",value:q.oidcIssuerUrl,onChange:e=>ej("oidcIssuerUrl",e.target.value),disabled:k||z})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Client ID"}),(0,a.jsx)(i.pd,{placeholder:"krouter-dashboard",value:q.oidcClientId,onChange:e=>ej("oidcClientId",e.target.value),disabled:k||z})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Client Secret"}),(0,a.jsx)(i.pd,{type:"password",placeholder:"Leave blank to keep existing secret",value:_,onChange:e=>H(e.target.value),disabled:k||z}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"This value is write-only after saving."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Scopes"}),(0,a.jsx)(i.pd,{placeholder:"openid profile email",value:q.oidcScopes,onChange:e=>ej("oidcScopes",e.target.value),disabled:k||z})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Login Button Label"}),(0,a.jsx)(i.pd,{placeholder:"Sign in with OIDC",value:q.oidcLoginLabel,onChange:e=>ej("oidcLoginLabel",e.target.value),disabled:k||z})]})]}),(0,a.jsxs)("div",{className:"rounded-lg border border-border bg-bg p-3 text-xs sm:text-sm text-text-muted",children:[(0,a.jsx)("p",{className:"font-medium text-text-main mb-1",children:"Redirect URI"}),(0,a.jsx)("code",{className:"block break-all font-mono",children:Y})]}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2 pt-2 border-t border-border/50",children:[(0,a.jsx)(i.$n,{type:"button",variant:"primary",loading:z,onClick:()=>ew(),className:"w-full sm:w-auto",children:"Save auth mode"}),(0,a.jsx)(i.$n,{type:"button",variant:"outline",loading:W,onClick:eN,className:"w-full sm:w-auto",children:"Test connection"})]}),G.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===G.type?"text-red-500":"text-green-500"}`,children:G.message}),K.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===K.type?"text-red-500":"text-green-500"}`,children:K.message}),"oidc"===v.authMode&&(0,a.jsx)("p",{className:"text-xs sm:text-sm text-amber-600 dark:text-amber-400",children:"OIDC login is currently active. Password login is disabled until you switch back."}),"both"===v.authMode&&(0,a.jsx)("p",{className:"text-xs sm:text-sm text-amber-600 dark:text-amber-400",children:"Password and OIDC login are both active."})]})]}),(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-blue-500/10 text-blue-500 shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"route"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"Routing Strategy"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Round Robin"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Cycle through accounts to distribute load"})]}),(0,a.jsx)(i.lM,{checked:"round-robin"===v.fallbackStrategy,onChange:()=>eh("round-robin"===v.fallbackStrategy?"fill-first":"round-robin"),disabled:k})]}),"round-robin"===v.fallbackStrategy&&(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4 pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Sticky Limit"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Calls per account before switching"})]}),(0,a.jsx)(i.pd,{type:"number",min:"1",max:"10",value:v.stickyRoundRobinLimit||3,onChange:e=>eg(e.target.value),disabled:k,className:"w-16 sm:w-20 text-center shrink-0"})]}),(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4 pt-4 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Combo Round Robin"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Cycle through providers in combos instead of always starting with first"})]}),(0,a.jsx)(i.lM,{checked:"round-robin"===v.comboStrategy,onChange:()=>eb("round-robin"===v.comboStrategy?"fallback":"round-robin"),disabled:k})]}),"round-robin"===v.comboStrategy&&(0,a.jsxs)("div",{className:"flex items-center justify-between pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Combo Sticky Limit"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Calls per combo model before switching"})]}),(0,a.jsx)(i.pd,{type:"number",min:"1",max:"100",value:v.comboStickyRoundRobinLimit||1,onChange:e=>ey(e.target.value),disabled:k,className:"w-20 text-center"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted italic pt-2 border-t border-border/50",children:["round-robin"===v.fallbackStrategy?`Currently distributing requests across all available accounts with ${v.stickyRoundRobinLimit||3} calls per account.`:"Currently using accounts in priority order (Fill First).","round-robin"===v.comboStrategy?` Combos rotate after ${v.comboStickyRoundRobinLimit||1} call${1===(v.comboStickyRoundRobinLimit||1)?"":"s"} per model.`:" Combos always start with their first model."]})]})]}),(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/10 text-purple-500 shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"wifi"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"Network"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Outbound Proxy"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Enable proxy for OAuth + provider outbound requests."})]}),(0,a.jsx)(i.lM,{checked:!0===v.outboundProxyEnabled,onChange:()=>ep(!0!==v.outboundProxyEnabled),disabled:k||el})]}),!0===v.outboundProxyEnabled&&(0,a.jsxs)("form",{onSubmit:em,className:"flex flex-col gap-4 pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Proxy URL"}),(0,a.jsx)(i.pd,{placeholder:"http://127.0.0.1:7897",value:ea.outboundProxyUrl,onChange:e=>er(t=>({...t,outboundProxyUrl:e.target.value})),disabled:k||el}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Leave empty to inherit existing env proxy (if any)."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 pt-2 border-t border-border/50",children:[(0,a.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"No Proxy"}),(0,a.jsx)(i.pd,{placeholder:"localhost,127.0.0.1",value:ea.outboundNoProxy,onChange:e=>er(t=>({...t,outboundNoProxy:e.target.value})),disabled:k||el}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Comma-separated hostnames/domains to bypass the proxy."})]}),(0,a.jsxs)("div",{className:"pt-2 border-t border-border/50 flex flex-col sm:flex-row items-stretch sm:items-center gap-2",children:[(0,a.jsx)(i.$n,{type:"button",variant:"secondary",loading:ed,disabled:k||el,onClick:ex,className:"w-full sm:w-auto",children:"Test proxy URL"}),(0,a.jsx)(i.$n,{type:"submit",variant:"primary",loading:el,className:"w-full sm:w-auto",children:"Apply"})]})]}),eo.message&&(0,a.jsx)("p",{className:`text-xs sm:text-sm ${"error"===eo.type?"text-red-500":"text-green-500"} pt-2 border-t border-border/50`,children:eo.message})]})]}),(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-orange-500/10 text-orange-500 shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"monitoring"})}),(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold",children:"Observability"})]}),(0,a.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Enable Observability"}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-text-muted",children:"Record request details for inspection in the logs view"})]}),(0,a.jsx)(i.lM,{checked:eO,onChange:ev,disabled:k})]})]}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,a.jsx)(i.$n,{variant:"outline",fullWidth:!0,icon:"power_settings_new",onClick:()=>j(!0),className:"text-red-500 border-red-200 hover:bg-red-50 hover:border-red-300",children:"Shutdown"}),(0,a.jsx)(i.$n,{variant:"outline",fullWidth:!0,icon:"logout",onClick:eL,children:"Logout"})]}),(0,a.jsxs)("div",{className:"text-center text-xs sm:text-sm text-text-muted py-4",children:[(0,a.jsxs)("p",{children:[m.vQ.name," v",m.vQ.version]}),(0,a.jsx)("p",{className:"mt-1",children:"Local Mode - All data stored on your machine"})]})]}),(0,a.jsx)(n.default,{hideTrigger:!0,isOpen:g,onClose:e=>{y(!1),b(e)}}),(0,a.jsx)(l.ConfirmModal,{isOpen:f,onClose:()=>j(!1),onConfirm:eI,title:"Close Proxy",message:"Are you sure you want to close the proxy server?",confirmText:"Close",cancelText:"Cancel",variant:"danger",loading:w}),(0,a.jsxs)(l.default,{isOpen:$.open,onClose:()=>E({open:!1,mode:"",password:""}),title:"Confirm Password",size:"sm",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.$n,{variant:"ghost",onClick:()=>E({open:!1,mode:"",password:""}),disabled:U,children:"Cancel"}),(0,a.jsx)(i.$n,{variant:"primary",onClick:eP,loading:U,disabled:!$.password,children:"Confirm"})]}),children:[(0,a.jsxs)("p",{className:"text-text-muted mb-3 text-sm",children:["Enter your current password to ","export"===$.mode?"export":"import"," the database."]}),(0,a.jsx)(i.pd,{type:"password",value:$.password,onChange:e=>E(t=>({...t,password:e.target.value})),onKeyDown:e=>{"Enter"===e.key&&$.password&&eP()},placeholder:"Current password",autoFocus:!0})]})]})}}},e=>{e.O(0,[2574,3862,2649,1321,5497,8441,3794,7358],()=>e(e.s=38048)),_N_E=e.O()}]);