@sifxprime/krouter 0.5.111 → 0.5.112

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 (416) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +7 -7
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/environment/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  34. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  35. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  36. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  37. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  38. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  39. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  40. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  41. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  43. package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  44. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  45. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  46. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
  47. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  48. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  49. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  50. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  51. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  52. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  54. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  56. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  57. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  58. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  60. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  61. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  63. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/api/import/route.js.nft.json +1 -1
  65. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  66. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  67. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  69. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  70. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/api/mitm/cert/route.js.nft.json +1 -1
  72. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  75. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/api/models/live/route.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/api/models/live-by-connection/route.js.nft.json +1 -1
  78. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  79. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  81. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  82. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  88. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  90. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  91. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  96. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  97. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  100. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  103. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/providers/zenith/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js +2 -2
  112. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
  114. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js +2 -2
  116. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +2 -2
  118. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js +2 -2
  120. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -2
  122. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js +2 -2
  124. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  129. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  130. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  167. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  168. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  170. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  172. package/app/.next-cli-build/server/app/callback.html +1 -1
  173. package/app/.next-cli-build/server/app/callback.rsc +3 -3
  174. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  175. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  176. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
  177. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  178. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  179. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  180. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  181. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
  182. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  183. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  184. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  185. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  186. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
  187. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  188. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
  189. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  190. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  191. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
  192. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  193. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  194. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  195. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  196. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  197. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  198. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
  199. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  200. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  201. package/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  202. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  203. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  204. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  205. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  206. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  207. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  208. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
  209. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  210. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  211. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
  212. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  213. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  214. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  215. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  216. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
  217. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  218. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
  219. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  220. package/app/.next-cli-build/server/app/dashboard/environment.html +1 -1
  221. package/app/.next-cli-build/server/app/dashboard/environment.rsc +5 -5
  222. package/app/.next-cli-build/server/app/dashboard/environment.segments/!KGRhc2hib2FyZCk/dashboard/environment/__PAGE__.segment.rsc +2 -2
  223. package/app/.next-cli-build/server/app/dashboard/environment.segments/!KGRhc2hib2FyZCk/dashboard/environment.segment.rsc +1 -1
  224. package/app/.next-cli-build/server/app/dashboard/environment.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  225. package/app/.next-cli-build/server/app/dashboard/environment.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  226. package/app/.next-cli-build/server/app/dashboard/environment.segments/_full.segment.rsc +5 -5
  227. package/app/.next-cli-build/server/app/dashboard/environment.segments/_head.segment.rsc +1 -1
  228. package/app/.next-cli-build/server/app/dashboard/environment.segments/_index.segment.rsc +3 -3
  229. package/app/.next-cli-build/server/app/dashboard/environment.segments/_tree.segment.rsc +1 -1
  230. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  231. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  232. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  233. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  234. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  235. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  236. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  237. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  238. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  239. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
  240. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  241. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  242. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  243. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  244. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  245. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  246. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  247. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  248. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  249. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
  250. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  251. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  252. package/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  253. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  254. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  255. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  256. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  257. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  258. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  259. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
  260. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  261. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  262. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  263. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  264. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  265. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  266. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  267. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  268. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  269. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  270. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
  271. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  272. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  273. package/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  274. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  275. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  276. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  277. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  278. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  279. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  280. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
  281. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  282. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  283. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
  284. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  285. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  286. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  287. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  288. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
  289. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  290. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
  291. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  292. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  293. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
  294. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  295. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  296. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  297. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  298. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
  299. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  300. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +3 -3
  301. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  302. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  303. package/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
  304. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  305. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  306. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  307. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  308. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  309. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  310. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
  311. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  312. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  313. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  314. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  315. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  316. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  317. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
  318. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  319. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  320. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  321. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  322. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  323. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  324. package/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
  325. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  326. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  327. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  328. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  329. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
  330. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  331. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +3 -3
  332. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  333. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  334. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
  335. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  336. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  337. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  338. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  339. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
  340. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  341. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +3 -3
  342. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  343. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  344. package/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  345. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  346. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  347. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  348. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  349. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  350. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  351. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
  352. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  353. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  354. package/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  355. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  356. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  357. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  358. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  359. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  360. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  361. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
  362. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  363. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  364. package/app/.next-cli-build/server/app/dashboard.rsc +5 -5
  365. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  366. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  367. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  368. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
  369. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  370. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
  371. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  372. package/app/.next-cli-build/server/app/index.html +1 -1
  373. package/app/.next-cli-build/server/app/index.rsc +3 -3
  374. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  375. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  376. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  377. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
  378. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  379. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  380. package/app/.next-cli-build/server/app/landing.html +1 -1
  381. package/app/.next-cli-build/server/app/landing.rsc +3 -3
  382. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  383. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  384. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
  385. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  386. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  387. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  388. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  389. package/app/.next-cli-build/server/app/login.html +1 -1
  390. package/app/.next-cli-build/server/app/login.rsc +4 -4
  391. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  392. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  393. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
  394. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  395. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  396. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  397. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  398. package/app/.next-cli-build/server/app-paths-manifest.json +7 -7
  399. package/app/.next-cli-build/server/chunks/2365.js +1 -1
  400. package/app/.next-cli-build/server/chunks/4884.js +1 -1
  401. package/app/.next-cli-build/server/chunks/706.js +1 -1
  402. package/app/.next-cli-build/server/chunks/7153.js +1 -1
  403. package/app/.next-cli-build/server/chunks/7276.js +1 -1
  404. package/app/.next-cli-build/server/chunks/9489.js +2 -2
  405. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  406. package/app/.next-cli-build/server/middleware.js +1 -1
  407. package/app/.next-cli-build/server/pages/404.html +1 -1
  408. package/app/.next-cli-build/server/pages/500.html +1 -1
  409. package/app/.next-cli-build/static/chunks/{1321-6d19b90c4f2378b4.js → 1321-ffdd023d81507554.js} +1 -1
  410. package/app/cli/.build-home/.krouter/db/backups/{upgrade-0.5.106-to-0.5.107-0.5.107-20260717-150407 → upgrade-0.5.111-to-0.5.112-0.5.112-20260718-000242}/data.sqlite +0 -0
  411. package/app/cli/.build-home/.krouter/db/data.sqlite +0 -0
  412. package/app/cli/package.json +1 -1
  413. package/app/package.json +1 -1
  414. package/package.json +1 -1
  415. /package/app/.next-cli-build/static/{5HBIq4jyylYlDb9lMtDIi → dQT84PkQ8Jxtq9s6IM1j4}/_buildManifest.js +0 -0
  416. /package/app/.next-cli-build/static/{5HBIq4jyylYlDb9lMtDIi → dQT84PkQ8Jxtq9s6IM1j4}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";exports.id=7153,exports.ids=[1998,7153],exports.modules={15626:(a,b,c)=>{c.d(b,{w$:()=>e});let d=c(39006).rE||"0.0.0";function e(a,b={}){let c,f=(c=function(a){if("string"!=typeof a)return"";let b=a.trim();return b?b.startsWith("workos:")?b:`workos:${b}`:""}(a))?`Bearer ${c}`:"",g={"HTTP-Referer":"https://cline.bot","X-Title":"Cline","User-Agent":`kRouter/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"9router","X-CLIENT-VERSION":d,"X-CORE-VERSION":d,"X-IS-MULTIROOT":"false",...b};return f&&(g.Authorization=f),g}},30869:(a,b,c)=>{c.d(b,{AA:()=>h,Rg:()=>i,UY:()=>j,X3:()=>k,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g});var d=c(39006),e=c(75681),f=c(81329);d.rE;let g={npmPackageName:"@sifxprime/krouter",installCmd:"npm i -g @sifxprime/krouter",installCmdLatest:"npm i -g @sifxprime/krouter@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:20128},h={settingsKey:"claudeAutoPing",tickIntervalMs:6e4,pingLeadMs:5e3,pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1,refreshAheadMs:3e5,fiveHourKey:"session (5h)"},i={settingsKey:"codexAutoPing",tickIntervalMs:6e4,pingLeadMs:5e3,pingModel:"gpt-5-mini",pingText:"hi",pingMaxTokens:1,refreshAheadMs:3e5,fiveHourKey:"session"},j={maxLines:200,pollIntervalMs:1e3},k={openrouter:"https://openrouter.ai/api/v1/chat/completions",glm:"https://api.z.ai/api/anthropic/v1/messages","glm-cn":"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",kimi:"https://api.kimi.com/coding/v1/messages",minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages",alicode:"https://coding.dashscope.aliyuncs.com/v1/chat/completions","alicode-intl":"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions","volcengine-ark":"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",byteplus:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",openai:"https://api.openai.com/v1/chat/completions","vercel-ai-gateway":"https://ai-gateway.vercel.sh/v1/chat/completions",anthropic:"https://api.anthropic.com/v1/messages",gemini:"https://generativelanguage.googleapis.com/v1beta/models",ollama:"https://ollama.com/api/chat","ollama-local":"http://localhost:11434/api/chat"}},39006:a=>{a.exports={rE:"0.5.111"}},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()}},66811:(a,b,c)=>{c.d(b,{F:()=>t});var d=c(89718),e=c(39326),f=c(74926),g=c(75681),h=c(30869),i=c(44404),j=c(35024),k=c(93943),l=c(92990),m=c(15626);let n={claude:{checkExpiry:!0,refreshable:!0},codex:{url:"https://chatgpt.com/backend-api/codex/responses",method:"POST",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"Content-Type":"application/json",originator:"codex_cli_rs","User-Agent":"codex_cli_rs/0.136.0"},body:JSON.stringify({model:"gpt-5.3-codex",input:[],stream:!1,store:!1}),acceptStatuses:[400],refreshable:!0},"gemini-cli":{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},antigravity:{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},github:{url:"https://api.github.com/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"User-Agent":"kRouter",Accept:"application/vnd.github+json"}},iflow:{buildUrl:a=>`https://iflow.cn/api/oauth/getUserInfo?accessToken=${encodeURIComponent(a)}`,method:"GET",noAuth:!0},qwen:{checkExpiry:!0,refreshable:!0},kiro:{checkExpiry:!0,refreshable:!0},qoder:{url:"https://openapi.qoder.sh/api/v1/userinfo",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!1},"kimi-coding":{checkExpiry:!0,refreshable:!1},cursor:{tokenExists:!0},kilocode:{url:`${l.MZ.apiBaseUrl}/api/profile`,method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},cline:{refreshable:!0},gitlab:{url:"https://gitlab.com/api/v4/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},"codebuddy-cn":{tokenExists:!0}};async function o(a){return await fetch("https://api.cline.bot/api/v1/users/me",{method:"GET",headers:(0,m.w$)(a,{Accept:"application/json"})})}async function p(a){let b=a.provider,c=a.refreshToken;if(!c)return null;try{if("gemini-cli"===b||"antigravity"===b){let a="gemini-cli"===b?l.LT:l.YT,d=await fetch("https://oauth2.googleapis.com/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:a.clientId,client_secret:a.clientSecret,grant_type:"refresh_token",refresh_token:c})});if(!d.ok)return null;let e=await d.json();return{accessToken:e.access_token,expiresIn:e.expires_in,refreshToken:e.refresh_token||c}}if("codex"===b)return await (0,k.Vq)(b,a,console);if("claude"===b){let a=await fetch(l.OV.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:c,client_id:l.OV.clientId})});if(!a.ok)return null;let b=await a.json();return{accessToken:b.access_token,expiresIn:b.expires_in,refreshToken:b.refresh_token||c}}if("kiro"===b){let b=a.providerSpecificData||{},d=b.clientId||a.clientId,e=b.clientSecret||a.clientSecret,f=b.region||a.region;if(d&&e){let a=`https://oidc.${f||"us-east-1"}.amazonaws.com/token`,b=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:d,clientSecret:e,refreshToken:c,grantType:"refresh_token"})});if(!b.ok)return null;let g=await b.json();return{accessToken:g.accessToken,expiresIn:g.expiresIn||3600,refreshToken:g.refreshToken||c}}let g=await fetch(l.Tx.socialRefreshUrl,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":"kiro-cli/1.0.0"},body:JSON.stringify({refreshToken:c})});if(!g.ok)return null;let h=await g.json();return{accessToken:h.accessToken,expiresIn:h.expiresIn||3600,refreshToken:h.refreshToken||c}}if("qwen"===b){let a=await fetch(l.Hp.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:c,client_id:l.Hp.clientId})});if(!a.ok)return null;let b=await a.json();return{accessToken:b.access_token,expiresIn:b.expires_in,refreshToken:b.refresh_token||c}}if("cline"===b){let a=await fetch(l.lB.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:c,grantType:"refresh_token",clientType:"extension"})});if(!a.ok)return null;let b=await a.json(),d=b?.data||b,e=d?.expiresAt?Math.max(1,Math.floor((new Date(d.expiresAt).getTime()-Date.now())/1e3)):3600;return{accessToken:d?.accessToken,expiresIn:e,refreshToken:d?.refreshToken||c}}return null}catch(a){return console.log(`Error refreshing ${b} token:`,a.message),null}}async function q(a,b=null){let c=n[a.provider];if(!c)return{valid:!1,error:"Provider test not supported",refreshed:!1};if(!a.accessToken)return{valid:!1,error:"No access token",refreshed:!1};if(c.tokenExists)return{valid:!0,error:null,refreshed:!1,newTokens:null};let d=a.accessToken,e=!1,f=null,g=(0,k.fp)(a.provider,a);if(c.refreshable&&g&&a.refreshToken){let b=await p(a);if(!b)return{valid:!1,error:"Token expired and refresh failed",refreshed:!1};d=b.accessToken,e=!0,f=b}if(c.checkExpiry)return e?{valid:!0,error:null,refreshed:e,newTokens:f}:g?{valid:!1,error:"Token expired",refreshed:!1}:{valid:!0,error:null,refreshed:!1,newTokens:null};if("cline"===a.provider){let b=async a=>{let b=await o(a);return b.ok?{valid:!0,error:null,refreshed:e,newTokens:f}:401===b.status?{valid:!1,error:"Token invalid or revoked",refreshed:e}:403===b.status?{valid:!1,error:"Access denied",refreshed:e}:{valid:!1,error:`API returned ${b.status}`,refreshed:e}},c=await b(d);if(c.valid||"Token invalid or revoked"!==c.error||!a.refreshToken)return c;let g=await p(a);return g?.accessToken?(e=!0,f=g,d=g.accessToken,await b(d)):{valid:!1,error:"Token invalid or revoked",refreshed:!1}}try{let g=c.buildUrl?c.buildUrl(d):c.url,h=c.noAuth?{...c.extraHeaders}:{[c.authHeader]:`${c.authPrefix}${d}`,...c.extraHeaders},i={method:c.method,headers:h};c.body&&(i.body=c.body);let j=await r(g,i,b);if(j.ok||c.acceptStatuses&&c.acceptStatuses.includes(j.status))return{valid:!0,error:null,refreshed:e,newTokens:f};if(401===j.status&&c.refreshable&&!e&&a.refreshToken){let d=await p(a);if(d){let a=c.buildUrl?c.buildUrl(d.accessToken):g,e=c.noAuth?{...c.extraHeaders}:{[c.authHeader]:`${c.authPrefix}${d.accessToken}`,...c.extraHeaders},f={method:c.method,headers:e};c.body&&(f.body=c.body);let h=await r(a,f,b);if(h.ok||c.acceptStatuses&&c.acceptStatuses.includes(h.status))return{valid:!0,error:null,refreshed:!0,newTokens:d}}return{valid:!1,error:"Token invalid or revoked",refreshed:!1}}if(401===j.status)return{valid:!1,error:"Token invalid or revoked",refreshed:e};if(403===j.status)return{valid:!1,error:"Access denied",refreshed:e};return{valid:!1,error:`API returned ${j.status}`,refreshed:e}}catch(a){return{valid:!1,error:a.message,refreshed:e}}}async function r(a,b={},d=null){if(d?.vercelRelayUrl){let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,39609));return e(a,b,{vercelRelayUrl:d.vercelRelayUrl})}if(!d?.connectionProxyEnabled||!d?.connectionProxyUrl)return fetch(a,b);let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,39609));return e(a,b,{connectionProxyEnabled:!0,connectionProxyUrl:d.connectionProxyUrl,connectionNoProxy:d.connectionNoProxy||""})}async function s(a,b=null){if((0,g.mq)(a.provider)){let c=a.providerSpecificData?.baseUrl;if(!c)return{valid:!1,error:"Missing base URL"};try{let d=await r(`${c.replace(/\/$/,"")}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:d.ok,error:d.ok?null:"Invalid API key or base URL"}}catch(a){return{valid:!1,error:a.message}}}if((0,g.gb)(a.provider)){let c=a.providerSpecificData?.baseUrl;if(!c)return{valid:!1,error:"Missing base URL"};try{(c=c.replace(/\/$/,"")).endsWith("/messages")&&(c=c.slice(0,-9));let d=`${c}/v1/messages`,e=a.defaultModel||"claude-3-haiku-20240307",f=await r(d,{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json",Authorization:`Bearer ${a.apiKey}`},body:JSON.stringify({model:e,max_tokens:1,messages:[{role:"user",content:"test"}]})},b),g=401!==f.status&&403!==f.status;return{valid:g,error:g?null:"Invalid API key or base URL"}}catch(a){return{valid:!1,error:a.message}}}try{switch(a.provider){case"cloudflare-ai":{let c=(a.providerSpecificData||{}).accountId;if(!c)return{valid:!1,error:"Missing Account ID"};let d=`https://api.cloudflare.com/client/v4/accounts/${c}/ai/v1/chat/completions`,e=await r(d,{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json"},body:JSON.stringify({model:(0,i.fZ)("cloudflare-ai"),messages:[{role:"user",content:"test"}],max_tokens:1})},b),f=401!==e.status&&403!==e.status&&404!==e.status;return{valid:f,error:f?null:"Invalid API token or Account ID"}}case"azure":{let c=a.providerSpecificData||{},d=(c.azureEndpoint||"").replace(/\/$/,""),e=c.deployment||"gpt-4",f=c.apiVersion||"2024-10-01-preview",g=`${d}/openai/deployments/${e}/chat/completions?api-version=${f}`,h={"api-key":a.apiKey,"Content-Type":"application/json"};c.organization&&(h["OpenAI-Organization"]=c.organization);let i=await r(g,{method:"POST",headers:h,body:JSON.stringify({messages:[{role:"user",content:"test"}],max_completion_tokens:1})},b),j=401!==i.status&&403!==i.status;return{valid:j,error:j?null:"Invalid API key or Azure configuration"}}case"openai":{let c=await r("https://api.openai.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"atomesus":{let c=await r("https://api.atomesus.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"vercel-ai-gateway":{let c=await r("https://ai-gateway.vercel.sh/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"anthropic":{let c=await r("https://api.anthropic.com/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"claude-3-haiku-20240307",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"gemini":{let c=await r(`https://generativelanguage.googleapis.com/v1/models?key=${a.apiKey}`,{},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"openrouter":{let c=await r("https://openrouter.ai/api/v1/auth/key",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"glm":{let c=await r("https://api.z.ai/api/anthropic/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"glm-4.7",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"glm-cn":{let c=await r("https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:"glm-4.7",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"minimax":case"minimax-cn":{let c=await r({minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages"}[a.provider],{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"minimax-m2",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"kimi":{let c=await r("https://api.kimi.com/coding/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"kimi-latest",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"alicode":case"alicode-intl":{let c="alicode-intl"===a.provider?"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions":"https://coding.dashscope.aliyuncs.com/v1/chat/completions",d=await r(c,{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:(0,i.fZ)(a.provider),max_tokens:1,messages:[{role:"user",content:"test"}]})},b),e=401!==d.status&&403!==d.status;return{valid:e,error:e?null:"Invalid API key"}}case"volcengine-ark":case"byteplus":{let c=await r(h.X3[a.provider],{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:(0,i.fZ)(a.provider),max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"deepseek":{let c=await r("https://api.deepseek.com/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"groq":{let c=await r("https://api.groq.com/openai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"mistral":{let c=await r("https://api.mistral.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"xai":{let c=await r("https://api.x.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nvidia":{let c=await r("https://integrate.api.nvidia.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"perplexity":{let c=await r("https://api.perplexity.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"together":{let c=await r("https://api.together.xyz/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"fireworks":{let c=await r("https://api.fireworks.ai/inference/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"cerebras":{let c=await r("https://api.cerebras.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"cohere":{let c=await r("https://api.cohere.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nebius":{let c=await r("https://api.studio.nebius.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"siliconflow":{let c=await r("https://api.siliconflow.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"hyperbolic":{let c=await r("https://api.hyperbolic.xyz/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"ollama":{let b=await fetch("https://ollama.com/api/tags",{headers:{Authorization:`Bearer ${a.apiKey}`}});return{valid:b.ok,error:b.ok?null:"Invalid API key"}}case"ollama-local":{let b=(0,j.Ak)(a),c=await fetch(`${b}/api/tags`);return{valid:c.ok,error:c.ok?null:`Ollama not reachable at ${b}`}}case"deepgram":{let c=await r("https://api.deepgram.com/v1/projects",{headers:{Authorization:`Token ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"assemblyai":{let c=await r("https://api.assemblyai.com/v1/account",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nanobanana":{let c=await r("https://api.nanobananaapi.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"fal-ai":{let c=await r("https://api.fal.ai/v1/models?limit=1",{headers:{Authorization:`Key ${a.apiKey}`}},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"chutes":{let c=await r("https://llm.chutes.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"grok-web":{let c=a.apiKey.startsWith("sso=")?a.apiKey.slice(4):a.apiKey,d=a=>Array.from(crypto.getRandomValues(new Uint8Array(a)),a=>a.toString(16).padStart(2,"0")).join(""),e=Buffer.from("e:TypeError: Cannot read properties of null (reading 'children')").toString("base64"),f=await r("https://grok.com/rest/app-chat/conversations/new",{method:"POST",headers:{Accept:"*/*","Content-Type":"application/json",Cookie:`sso=${c}`,Origin:"https://grok.com",Referer:"https://grok.com/","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36","x-statsig-id":e,"x-xai-request-id":crypto.randomUUID(),traceparent:`00-${d(16)}-${d(8)}-00`},body:JSON.stringify({temporary:!0,modelName:"grok-4",message:"ping",fileAttachments:[],imageAttachments:[],disableSearch:!1,enableImageGeneration:!1,sendFinalMetadata:!0})},b),g=401!==f.status&&403!==f.status;return{valid:g,error:g?null:"Invalid SSO cookie"}}case"perplexity-web":{let c=a.apiKey;c.startsWith("__Secure-next-auth.session-token=")&&(c=c.slice(33));let d=await r("https://www.perplexity.ai/api/auth/session",{method:"GET",headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",Cookie:`__Secure-next-auth.session-token=${c}`}},b);if(!d.ok)return{valid:!1,error:"Invalid session cookie"};let e=await d.json().catch(()=>null),f=!!(e&&e.user);return{valid:f,error:f?null:"Session expired — re-paste cookie"}}case"opencode-go":{let c=await r("https://opencode.ai/zen/go/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a.apiKey}`},body:JSON.stringify({model:(0,i.fZ)("opencode-go"),messages:[{role:"user",content:"ping"}],max_tokens:1,stream:!1})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"xiaomi-mimo":case"xiaomi-tokenplan":{let c=await r(`${{"xiaomi-mimo":"https://api.xiaomimimo.com/v1","xiaomi-tokenplan":"https://token-plan-sgp.xiaomimimo.com/v1"}[a.provider]}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}default:return{valid:!1,error:"Provider test not supported"}}}catch(a){return{valid:!1,error:a.message}}}async function t(a){let b,c=await (0,d.Mc)(a);if(!c)return{valid:!1,error:"Connection not found",latencyMs:0,testedAt:new Date().toISOString()};let g=await (0,e.B)(c.providerSpecificData||{});if(g.connectionProxyEnabled&&g.connectionProxyUrl&&!g.vercelRelayUrl){let b=await (0,f.C)({proxyUrl:g.connectionProxyUrl});if(!b.ok){let c=b.error||`Proxy test failed with status ${b.status}`;return await (0,d.updateProviderConnection)(a,{testStatus:"error",lastError:c,lastErrorAt:new Date().toISOString()}),{valid:!1,error:c,latencyMs:0,testedAt:new Date().toISOString()}}}let h=Date.now();b="apikey"===c.authType||"cookie"===c.authType?await s(c,g):await q(c,g);let i=Date.now()-h,j={testStatus:b.valid?"active":"error",lastError:b.valid?null:b.error,lastErrorAt:b.valid?null:new Date().toISOString()};if(b.valid){for(let a of Object.keys(c||{}))a.startsWith("modelLock_")&&(j[a]=null);j.backoffLevel=0,j.rateLimitedUntil=null,j.isPermanentlyBanned=!1,j.bannedAt=null}return b.refreshed&&b.newTokens&&(b.newTokens.accessToken&&(j.accessToken=b.newTokens.accessToken),b.newTokens.refreshToken&&(j.refreshToken=b.newTokens.refreshToken),b.newTokens.idToken&&(j.idToken=b.newTokens.idToken),b.newTokens.lastRefreshAt&&(j.lastRefreshAt=b.newTokens.lastRefreshAt),b.newTokens.expiresIn&&(j.expiresIn=b.newTokens.expiresIn),b.newTokens.expiresIn?j.expiresAt=new Date(Date.now()+1e3*b.newTokens.expiresIn).toISOString():b.newTokens.expiresAt&&(j.expiresAt=b.newTokens.expiresAt),b.newTokens.providerSpecificData&&(j.providerSpecificData={...c.providerSpecificData||{},...b.newTokens.providerSpecificData})),await (0,d.updateProviderConnection)(a,j),{valid:b.valid,error:b.error,refreshed:!!b.refreshed,latencyMs:i,testedAt:new Date().toISOString()}}},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)},73159:(a,b,c)=>{c.d(b,{Ue:()=>j,oT:()=>k,xz:()=>d});let d="b1a00492-073a-47ea-816f-4c329264a828",e="https://auth.x.ai",f="/oauth2/authorize",g="/oauth2/token",h="/.well-known/openid-configuration",i="/callback",j=96,k={clientId:d,issuer:e,authEndpointPath:f,tokenEndpointPath:g,discoveryPath:h,authorizeUrl:`${e}${f}`,tokenUrl:`${e}${g}`,discoveryUrl:`${e}${h}`,scope:"openid profile email offline_access grok-cli:access api:access",apiBaseUrl:"https://api.x.ai/v1",redirectUri:`http://127.0.0.1:56121${i}`,loopbackPort:56121,callbackPath:i,pkceVerifierBytes:96,refreshLeadSeconds:300,userAgent:"grok-cli/9router",codeChallengeMethod:"S256"}},74926:(a,b,c)=>{c.d(b,{C:()=>f});var d=c(47774);function e(a){return null==a?"":String(a).trim()}async function f({proxyUrl:a,testUrl:b,timeoutMs:c}={}){let g,h=e(a);if(!h)return{ok:!1,status:400,error:"proxyUrl is required"};let i=e(b)||"https://google.com/",j=Number(c),k=Number.isFinite(j)&&j>0?Math.min(j,3e4):8e3;try{try{g=new d.ProxyAgent({uri:h})}catch(a){return{ok:!1,status:400,error:`Invalid proxy URL: ${a?.message||String(a)}`}}let a=new AbortController,b=Date.now(),c=setTimeout(()=>a.abort(),k);try{let c=await (0,d.hd)(i,{method:"HEAD",dispatcher:g,signal:a.signal,headers:{"User-Agent":"kRouter"}});return{ok:c.ok,status:c.status,statusText:c.statusText,url:i,elapsedMs:Date.now()-b}}catch(b){let a=b?.name==="AbortError"?"Proxy test timed out":function(a){if(!a)return"Unknown error";let b=a?.message||String(a),c=a?.cause?.code||a?.code,d=a?.cause?.message;return d&&d!==b?c?`${b}: ${d} (${c})`:`${b}: ${d}`:c&&!b.includes(c)?`${b} (${c})`:b}(b);return{ok:!1,status:500,error:a}}finally{clearTimeout(c)}}finally{try{await g?.close?.()}catch{}}}},81329:(a,b,c)=>{c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(44404);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))},92990:(a,b,c)=>{c.d(b,{DI:()=>h,Hp:()=>j,LT:()=>i,MZ:()=>u,Nl:()=>A,Nu:()=>o,OV:()=>g,S6:()=>q,Td:()=>x,Tx:()=>r,WN:()=>s,Ww:()=>B,YT:()=>m,ZL:()=>l,cD:()=>n,f7:()=>z,hF:()=>k,lB:()=>v,qp:()=>w,t:()=>t,w1:()=>y});var d=c(21820),e=c(73159);function f(){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)}let g={clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",authorizeUrl:"https://claude.ai/oauth/authorize",tokenUrl:"https://api.anthropic.com/v1/oauth/token",scopes:["org:create_api_key","user:profile","user:inference"],codeChallengeMethod:"S256"},h={clientId:"app_EMoamEEZ73f0CkXaXp7hrann",authorizeUrl:"https://auth.openai.com/oauth/authorize",tokenUrl:"https://auth.openai.com/oauth/token",scope:"openid profile email offline_access",codeChallengeMethod:"S256",extraParams:{id_token_add_organizations:"true",codex_cli_simplified_flow:"true",originator:"codex_cli_rs"}},i={clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile"]},j={clientId:"f0304373b74a44d2b584a3fb70ca9e56",deviceCodeUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",scope:"openid profile email model.completion",codeChallengeMethod:"S256"},k={openApiBaseUrl:"https://openapi.qoder.sh",centerBaseUrl:"https://center.qoder.sh",chatBaseUrl:"https://api3.qoder.sh",deviceTokenUrl:"https://openapi.qoder.sh/api/v1/deviceToken/poll",refreshUrl:"https://center.qoder.sh/algo/api/v3/user/refresh_token",userInfoUrl:"https://openapi.qoder.sh/api/v1/userinfo",quotaUsageUrl:"https://openapi.qoder.sh/api/v2/quota/usage",loginUrl:"https://qoder.com/device/selectAccounts"},l={clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",authorizeUrl:"https://iflow.cn/oauth",tokenUrl:"https://iflow.cn/oauth/token",userInfoUrl:"https://iflow.cn/api/oauth/getUserInfo",extraParams:{loginMethod:"phone",type:"phone"}},m={clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/cclog","https://www.googleapis.com/auth/experimentsandconfigs"],apiEndpoint:"https://cloudcode-pa.googleapis.com",apiVersion:"v1internal",loadCodeAssistEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUserEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser",loadCodeAssistUserAgent:"google-api-nodejs-client/9.15.1",loadCodeAssistApiClient:"google-cloud-sdk vscode_cloudshelleditor/0.1",loadCodeAssistClientMetadata:JSON.stringify({ideType:9,platform:f(),pluginType:2})};function n(){return{ideType:9,platform:f(),pluginType:2}}let o={clientId:"Iv1.b507a08c87ecfe98",deviceCodeUrl:"https://github.com/login/device/code",tokenUrl:"https://github.com/login/oauth/access_token",userInfoUrl:"https://api.github.com/user",scopes:"read:user",apiVersion:"2022-11-28",copilotTokenUrl:"https://api.github.com/copilot_internal/v2/token",userAgent:"GitHubCopilotChat/0.26.7",editorVersion:"vscode/1.85.0",editorPluginVersion:"copilot-chat/0.26.7"},p=/^[a-z]{2}-[a-z]+-\d{1,2}$/;function q(a){if("string"!=typeof a||!p.test(a))throw Error("Invalid region");return a}let r={ssoOidcEndpoint:"https://oidc.us-east-1.amazonaws.com",registerClientUrl:"https://oidc.us-east-1.amazonaws.com/client/register",deviceAuthUrl:"https://oidc.us-east-1.amazonaws.com/device_authorization",tokenUrl:"https://oidc.us-east-1.amazonaws.com/token",startUrl:"https://view.awsapps.com/start",clientName:"kiro-oauth-client",clientType:"public",scopes:["codewhisperer:completions","codewhisperer:analysis","codewhisperer:conversations"],grantTypes:["urn:ietf:params:oauth:grant-type:device_code","refresh_token"],issuerUrl:"https://identitycenter.amazonaws.com/ssoins-722374e8c3c8e6c6",socialAuthEndpoint:"https://prod.us-east-1.auth.desktop.kiro.dev",socialLoginUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/login",socialTokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/oauth/token",socialRefreshUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",socialClientId:process.env.KIRO_OAUTH_CLIENT_ID||"kiro-cli",socialDeviceAuthorizeUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/oauth/device/authorization",socialDevicePollUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/oauth/device/poll",authMethods:["builder-id","idc","google","github","import"]},s={apiEndpoint:"https://api2.cursor.sh",chatEndpoint:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",modelsEndpoint:"/aiserver.v1.AiService/GetDefaultModelNudgeData",api3Endpoint:"https://api3.cursor.sh",agentEndpoint:"https://agent.api5.cursor.sh",agentNonPrivacyEndpoint:"https://agentn.api5.cursor.sh",clientVersion:"3.1.0",clientType:"ide",tokenStoragePaths:{linux:"~/.config/Cursor/User/globalStorage/state.vscdb",macos:"/Users/<user>/Library/Application Support/Cursor/User/globalStorage/state.vscdb",windows:"%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb"},dbKeys:{accessToken:"cursorAuth/accessToken",machineId:"storage.serviceMachineId"}},t={clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||"17e5f671-d194-4dfb-9706-5516cb48c098",deviceCodeUrl:"https://auth.kimi.com/api/oauth/device_authorization",tokenUrl:"https://auth.kimi.com/api/oauth/token"},u={apiBaseUrl:"https://api.kilo.ai",initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},v={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},w={clientId:e.xz,deviceCodeUrl:"https://auth.x.ai/oauth2/device/code",tokenUrl:"https://auth.x.ai/oauth2/token",refreshUrl:"https://auth.x.ai/oauth2/token",scope:"openid profile email offline_access grok-cli:access api:access conversations:read conversations:write",referrer:"grok-build",pollInterval:5e3},x={webAppUrl:"https://app.kimchi.dev",validationUrl:"https://api.cast.ai/v1/llm/openai/supported-providers",userInfoUrl:"https://app.kimchi.dev/api/v1/me",modelsUrl:"https://llm.kimchi.dev/v1/models/metadata?include_in_cli=true"},y={...v},z={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},A={baseUrl:"https://copilot.tencent.com",stateUrl:"https://copilot.tencent.com/v2/plugin/auth/state",tokenUrl:"https://copilot.tencent.com/v2/plugin/auth/token",refreshUrl:"https://copilot.tencent.com/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",platform:"CLI",pollInterval:5e3},B=3e5},93943:(a,b,c)=>{c.d(b,{Vq:()=>i,fp:()=>g});var d=c(8590);let e=new Map;function f(a){if(null==a||""===a)return null;if("number"==typeof a)return a<1e12?1e3*a:a;let b=new Date(a).getTime();return Number.isFinite(b)?b:null}function g(a,b,c=Date.now()){if(!b)return!1;let e=f(b?.expiresAt??b?.tokenExpiresAt);return!!(null!==e&&e-c<(0,d.Og)(a)||"codex"===a&&b.refreshToken&&function(a,b=Date.now()){let c=f(a?.lastRefreshAt??a?.lastRefresh??a?.providerSpecificData?.lastRefreshAt);return!c||b-c>=6912e5}(b,c))}async function h(a,b,c){let d,f=(d=b?.connectionId||b?.id||b?.email||b?.name||b?.refreshToken?.slice?.(-16)||"default",`${a}:${d}`),g=e.get(f);if(g)return g;let h=Promise.resolve().then(c).finally(()=>{e.delete(f)});return e.set(f,h),h}async function i(a,b,c){return b?h(a,b,async()=>{let e=await (0,d.$B)(a,b,c);return function(a,b,c,e=Date.now()){var f,g;if(!c)return null;if((0,d.jT)(c))return c;let h={},i=new Date(e).toISOString();c.accessToken&&(h.accessToken=c.accessToken),c.apiKey&&(h.apiKey=c.apiKey),c.token&&(h.token=c.token);let j=c.refreshToken??b?.refreshToken;j&&(h.refreshToken=j);let k=c.idToken??b?.idToken;return k&&(h.idToken=k),c.expiresIn?(h.expiresIn=c.expiresIn,h.expiresAt=function(a,b=Date.now()){return a?new Date(b+1e3*a).toISOString():null}(c.expiresIn,e)):c.expiresAt&&(h.expiresAt=c.expiresAt),c.projectId&&(h.projectId=c.projectId),c.providerSpecificData&&(f=b?.providerSpecificData,h.providerSpecificData=(g=c.providerSpecificData)&&"object"==typeof g?{...f||{},...g}:f),c.copilotToken&&(h.copilotToken=c.copilotToken),c.copilotTokenExpiresAt&&(h.copilotTokenExpiresAt=c.copilotTokenExpiresAt),("codex"===a||h.accessToken||h.apiKey||h.token||h.refreshToken||h.copilotToken)&&(h.lastRefreshAt=c.lastRefreshAt||i),h}(a,b,e)}):null}},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
+ "use strict";exports.id=7153,exports.ids=[1998,7153],exports.modules={15626:(a,b,c)=>{c.d(b,{w$:()=>e});let d=c(39006).rE||"0.0.0";function e(a,b={}){let c,f=(c=function(a){if("string"!=typeof a)return"";let b=a.trim();return b?b.startsWith("workos:")?b:`workos:${b}`:""}(a))?`Bearer ${c}`:"",g={"HTTP-Referer":"https://cline.bot","X-Title":"Cline","User-Agent":`kRouter/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"9router","X-CLIENT-VERSION":d,"X-CORE-VERSION":d,"X-IS-MULTIROOT":"false",...b};return f&&(g.Authorization=f),g}},30869:(a,b,c)=>{c.d(b,{AA:()=>h,Rg:()=>i,UY:()=>j,X3:()=>k,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g});var d=c(39006),e=c(75681),f=c(81329);d.rE;let g={npmPackageName:"@sifxprime/krouter",installCmd:"npm i -g @sifxprime/krouter",installCmdLatest:"npm i -g @sifxprime/krouter@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:20128},h={settingsKey:"claudeAutoPing",tickIntervalMs:6e4,pingLeadMs:5e3,pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1,refreshAheadMs:3e5,fiveHourKey:"session (5h)"},i={settingsKey:"codexAutoPing",tickIntervalMs:6e4,pingLeadMs:5e3,pingModel:"gpt-5-mini",pingText:"hi",pingMaxTokens:1,refreshAheadMs:3e5,fiveHourKey:"session"},j={maxLines:200,pollIntervalMs:1e3},k={openrouter:"https://openrouter.ai/api/v1/chat/completions",glm:"https://api.z.ai/api/anthropic/v1/messages","glm-cn":"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",kimi:"https://api.kimi.com/coding/v1/messages",minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages",alicode:"https://coding.dashscope.aliyuncs.com/v1/chat/completions","alicode-intl":"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions","volcengine-ark":"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",byteplus:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",openai:"https://api.openai.com/v1/chat/completions","vercel-ai-gateway":"https://ai-gateway.vercel.sh/v1/chat/completions",anthropic:"https://api.anthropic.com/v1/messages",gemini:"https://generativelanguage.googleapis.com/v1beta/models",ollama:"https://ollama.com/api/chat","ollama-local":"http://localhost:11434/api/chat"}},39006:a=>{a.exports={rE:"0.5.112"}},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()}},66811:(a,b,c)=>{c.d(b,{F:()=>t});var d=c(89718),e=c(39326),f=c(74926),g=c(75681),h=c(30869),i=c(44404),j=c(35024),k=c(93943),l=c(92990),m=c(15626);let n={claude:{checkExpiry:!0,refreshable:!0},codex:{url:"https://chatgpt.com/backend-api/codex/responses",method:"POST",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"Content-Type":"application/json",originator:"codex_cli_rs","User-Agent":"codex_cli_rs/0.136.0"},body:JSON.stringify({model:"gpt-5.3-codex",input:[],stream:!1,store:!1}),acceptStatuses:[400],refreshable:!0},"gemini-cli":{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},antigravity:{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},github:{url:"https://api.github.com/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"User-Agent":"kRouter",Accept:"application/vnd.github+json"}},iflow:{buildUrl:a=>`https://iflow.cn/api/oauth/getUserInfo?accessToken=${encodeURIComponent(a)}`,method:"GET",noAuth:!0},qwen:{checkExpiry:!0,refreshable:!0},kiro:{checkExpiry:!0,refreshable:!0},qoder:{url:"https://openapi.qoder.sh/api/v1/userinfo",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!1},"kimi-coding":{checkExpiry:!0,refreshable:!1},cursor:{tokenExists:!0},kilocode:{url:`${l.MZ.apiBaseUrl}/api/profile`,method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},cline:{refreshable:!0},gitlab:{url:"https://gitlab.com/api/v4/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},"codebuddy-cn":{tokenExists:!0}};async function o(a){return await fetch("https://api.cline.bot/api/v1/users/me",{method:"GET",headers:(0,m.w$)(a,{Accept:"application/json"})})}async function p(a){let b=a.provider,c=a.refreshToken;if(!c)return null;try{if("gemini-cli"===b||"antigravity"===b){let a="gemini-cli"===b?l.LT:l.YT,d=await fetch("https://oauth2.googleapis.com/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:a.clientId,client_secret:a.clientSecret,grant_type:"refresh_token",refresh_token:c})});if(!d.ok)return null;let e=await d.json();return{accessToken:e.access_token,expiresIn:e.expires_in,refreshToken:e.refresh_token||c}}if("codex"===b)return await (0,k.Vq)(b,a,console);if("claude"===b){let a=await fetch(l.OV.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:c,client_id:l.OV.clientId})});if(!a.ok)return null;let b=await a.json();return{accessToken:b.access_token,expiresIn:b.expires_in,refreshToken:b.refresh_token||c}}if("kiro"===b){let b=a.providerSpecificData||{},d=b.clientId||a.clientId,e=b.clientSecret||a.clientSecret,f=b.region||a.region;if(d&&e){let a=`https://oidc.${f||"us-east-1"}.amazonaws.com/token`,b=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:d,clientSecret:e,refreshToken:c,grantType:"refresh_token"})});if(!b.ok)return null;let g=await b.json();return{accessToken:g.accessToken,expiresIn:g.expiresIn||3600,refreshToken:g.refreshToken||c}}let g=await fetch(l.Tx.socialRefreshUrl,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":"kiro-cli/1.0.0"},body:JSON.stringify({refreshToken:c})});if(!g.ok)return null;let h=await g.json();return{accessToken:h.accessToken,expiresIn:h.expiresIn||3600,refreshToken:h.refreshToken||c}}if("qwen"===b){let a=await fetch(l.Hp.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:c,client_id:l.Hp.clientId})});if(!a.ok)return null;let b=await a.json();return{accessToken:b.access_token,expiresIn:b.expires_in,refreshToken:b.refresh_token||c}}if("cline"===b){let a=await fetch(l.lB.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:c,grantType:"refresh_token",clientType:"extension"})});if(!a.ok)return null;let b=await a.json(),d=b?.data||b,e=d?.expiresAt?Math.max(1,Math.floor((new Date(d.expiresAt).getTime()-Date.now())/1e3)):3600;return{accessToken:d?.accessToken,expiresIn:e,refreshToken:d?.refreshToken||c}}return null}catch(a){return console.log(`Error refreshing ${b} token:`,a.message),null}}async function q(a,b=null){let c=n[a.provider];if(!c)return{valid:!1,error:"Provider test not supported",refreshed:!1};if(!a.accessToken)return{valid:!1,error:"No access token",refreshed:!1};if(c.tokenExists)return{valid:!0,error:null,refreshed:!1,newTokens:null};let d=a.accessToken,e=!1,f=null,g=(0,k.fp)(a.provider,a);if(c.refreshable&&g&&a.refreshToken){let b=await p(a);if(!b)return{valid:!1,error:"Token expired and refresh failed",refreshed:!1};d=b.accessToken,e=!0,f=b}if(c.checkExpiry)return e?{valid:!0,error:null,refreshed:e,newTokens:f}:g?{valid:!1,error:"Token expired",refreshed:!1}:{valid:!0,error:null,refreshed:!1,newTokens:null};if("cline"===a.provider){let b=async a=>{let b=await o(a);return b.ok?{valid:!0,error:null,refreshed:e,newTokens:f}:401===b.status?{valid:!1,error:"Token invalid or revoked",refreshed:e}:403===b.status?{valid:!1,error:"Access denied",refreshed:e}:{valid:!1,error:`API returned ${b.status}`,refreshed:e}},c=await b(d);if(c.valid||"Token invalid or revoked"!==c.error||!a.refreshToken)return c;let g=await p(a);return g?.accessToken?(e=!0,f=g,d=g.accessToken,await b(d)):{valid:!1,error:"Token invalid or revoked",refreshed:!1}}try{let g=c.buildUrl?c.buildUrl(d):c.url,h=c.noAuth?{...c.extraHeaders}:{[c.authHeader]:`${c.authPrefix}${d}`,...c.extraHeaders},i={method:c.method,headers:h};c.body&&(i.body=c.body);let j=await r(g,i,b);if(j.ok||c.acceptStatuses&&c.acceptStatuses.includes(j.status))return{valid:!0,error:null,refreshed:e,newTokens:f};if(401===j.status&&c.refreshable&&!e&&a.refreshToken){let d=await p(a);if(d){let a=c.buildUrl?c.buildUrl(d.accessToken):g,e=c.noAuth?{...c.extraHeaders}:{[c.authHeader]:`${c.authPrefix}${d.accessToken}`,...c.extraHeaders},f={method:c.method,headers:e};c.body&&(f.body=c.body);let h=await r(a,f,b);if(h.ok||c.acceptStatuses&&c.acceptStatuses.includes(h.status))return{valid:!0,error:null,refreshed:!0,newTokens:d}}return{valid:!1,error:"Token invalid or revoked",refreshed:!1}}if(401===j.status)return{valid:!1,error:"Token invalid or revoked",refreshed:e};if(403===j.status)return{valid:!1,error:"Access denied",refreshed:e};return{valid:!1,error:`API returned ${j.status}`,refreshed:e}}catch(a){return{valid:!1,error:a.message,refreshed:e}}}async function r(a,b={},d=null){if(d?.vercelRelayUrl){let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,39609));return e(a,b,{vercelRelayUrl:d.vercelRelayUrl})}if(!d?.connectionProxyEnabled||!d?.connectionProxyUrl)return fetch(a,b);let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,39609));return e(a,b,{connectionProxyEnabled:!0,connectionProxyUrl:d.connectionProxyUrl,connectionNoProxy:d.connectionNoProxy||""})}async function s(a,b=null){if((0,g.mq)(a.provider)){let c=a.providerSpecificData?.baseUrl;if(!c)return{valid:!1,error:"Missing base URL"};try{let d=await r(`${c.replace(/\/$/,"")}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:d.ok,error:d.ok?null:"Invalid API key or base URL"}}catch(a){return{valid:!1,error:a.message}}}if((0,g.gb)(a.provider)){let c=a.providerSpecificData?.baseUrl;if(!c)return{valid:!1,error:"Missing base URL"};try{(c=c.replace(/\/$/,"")).endsWith("/messages")&&(c=c.slice(0,-9));let d=`${c}/v1/messages`,e=a.defaultModel||"claude-3-haiku-20240307",f=await r(d,{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json",Authorization:`Bearer ${a.apiKey}`},body:JSON.stringify({model:e,max_tokens:1,messages:[{role:"user",content:"test"}]})},b),g=401!==f.status&&403!==f.status;return{valid:g,error:g?null:"Invalid API key or base URL"}}catch(a){return{valid:!1,error:a.message}}}try{switch(a.provider){case"cloudflare-ai":{let c=(a.providerSpecificData||{}).accountId;if(!c)return{valid:!1,error:"Missing Account ID"};let d=`https://api.cloudflare.com/client/v4/accounts/${c}/ai/v1/chat/completions`,e=await r(d,{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json"},body:JSON.stringify({model:(0,i.fZ)("cloudflare-ai"),messages:[{role:"user",content:"test"}],max_tokens:1})},b),f=401!==e.status&&403!==e.status&&404!==e.status;return{valid:f,error:f?null:"Invalid API token or Account ID"}}case"azure":{let c=a.providerSpecificData||{},d=(c.azureEndpoint||"").replace(/\/$/,""),e=c.deployment||"gpt-4",f=c.apiVersion||"2024-10-01-preview",g=`${d}/openai/deployments/${e}/chat/completions?api-version=${f}`,h={"api-key":a.apiKey,"Content-Type":"application/json"};c.organization&&(h["OpenAI-Organization"]=c.organization);let i=await r(g,{method:"POST",headers:h,body:JSON.stringify({messages:[{role:"user",content:"test"}],max_completion_tokens:1})},b),j=401!==i.status&&403!==i.status;return{valid:j,error:j?null:"Invalid API key or Azure configuration"}}case"openai":{let c=await r("https://api.openai.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"atomesus":{let c=await r("https://api.atomesus.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"vercel-ai-gateway":{let c=await r("https://ai-gateway.vercel.sh/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"anthropic":{let c=await r("https://api.anthropic.com/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"claude-3-haiku-20240307",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"gemini":{let c=await r(`https://generativelanguage.googleapis.com/v1/models?key=${a.apiKey}`,{},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"openrouter":{let c=await r("https://openrouter.ai/api/v1/auth/key",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"glm":{let c=await r("https://api.z.ai/api/anthropic/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"glm-4.7",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"glm-cn":{let c=await r("https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:"glm-4.7",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"minimax":case"minimax-cn":{let c=await r({minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages"}[a.provider],{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"minimax-m2",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"kimi":{let c=await r("https://api.kimi.com/coding/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"kimi-latest",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"alicode":case"alicode-intl":{let c="alicode-intl"===a.provider?"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions":"https://coding.dashscope.aliyuncs.com/v1/chat/completions",d=await r(c,{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:(0,i.fZ)(a.provider),max_tokens:1,messages:[{role:"user",content:"test"}]})},b),e=401!==d.status&&403!==d.status;return{valid:e,error:e?null:"Invalid API key"}}case"volcengine-ark":case"byteplus":{let c=await r(h.X3[a.provider],{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:(0,i.fZ)(a.provider),max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"deepseek":{let c=await r("https://api.deepseek.com/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"groq":{let c=await r("https://api.groq.com/openai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"mistral":{let c=await r("https://api.mistral.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"xai":{let c=await r("https://api.x.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nvidia":{let c=await r("https://integrate.api.nvidia.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"perplexity":{let c=await r("https://api.perplexity.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"together":{let c=await r("https://api.together.xyz/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"fireworks":{let c=await r("https://api.fireworks.ai/inference/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"cerebras":{let c=await r("https://api.cerebras.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"cohere":{let c=await r("https://api.cohere.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nebius":{let c=await r("https://api.studio.nebius.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"siliconflow":{let c=await r("https://api.siliconflow.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"hyperbolic":{let c=await r("https://api.hyperbolic.xyz/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"ollama":{let b=await fetch("https://ollama.com/api/tags",{headers:{Authorization:`Bearer ${a.apiKey}`}});return{valid:b.ok,error:b.ok?null:"Invalid API key"}}case"ollama-local":{let b=(0,j.Ak)(a),c=await fetch(`${b}/api/tags`);return{valid:c.ok,error:c.ok?null:`Ollama not reachable at ${b}`}}case"deepgram":{let c=await r("https://api.deepgram.com/v1/projects",{headers:{Authorization:`Token ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"assemblyai":{let c=await r("https://api.assemblyai.com/v1/account",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nanobanana":{let c=await r("https://api.nanobananaapi.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"fal-ai":{let c=await r("https://api.fal.ai/v1/models?limit=1",{headers:{Authorization:`Key ${a.apiKey}`}},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"chutes":{let c=await r("https://llm.chutes.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"grok-web":{let c=a.apiKey.startsWith("sso=")?a.apiKey.slice(4):a.apiKey,d=a=>Array.from(crypto.getRandomValues(new Uint8Array(a)),a=>a.toString(16).padStart(2,"0")).join(""),e=Buffer.from("e:TypeError: Cannot read properties of null (reading 'children')").toString("base64"),f=await r("https://grok.com/rest/app-chat/conversations/new",{method:"POST",headers:{Accept:"*/*","Content-Type":"application/json",Cookie:`sso=${c}`,Origin:"https://grok.com",Referer:"https://grok.com/","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36","x-statsig-id":e,"x-xai-request-id":crypto.randomUUID(),traceparent:`00-${d(16)}-${d(8)}-00`},body:JSON.stringify({temporary:!0,modelName:"grok-4",message:"ping",fileAttachments:[],imageAttachments:[],disableSearch:!1,enableImageGeneration:!1,sendFinalMetadata:!0})},b),g=401!==f.status&&403!==f.status;return{valid:g,error:g?null:"Invalid SSO cookie"}}case"perplexity-web":{let c=a.apiKey;c.startsWith("__Secure-next-auth.session-token=")&&(c=c.slice(33));let d=await r("https://www.perplexity.ai/api/auth/session",{method:"GET",headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",Cookie:`__Secure-next-auth.session-token=${c}`}},b);if(!d.ok)return{valid:!1,error:"Invalid session cookie"};let e=await d.json().catch(()=>null),f=!!(e&&e.user);return{valid:f,error:f?null:"Session expired — re-paste cookie"}}case"opencode-go":{let c=await r("https://opencode.ai/zen/go/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a.apiKey}`},body:JSON.stringify({model:(0,i.fZ)("opencode-go"),messages:[{role:"user",content:"ping"}],max_tokens:1,stream:!1})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"xiaomi-mimo":case"xiaomi-tokenplan":{let c=await r(`${{"xiaomi-mimo":"https://api.xiaomimimo.com/v1","xiaomi-tokenplan":"https://token-plan-sgp.xiaomimimo.com/v1"}[a.provider]}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}default:return{valid:!1,error:"Provider test not supported"}}}catch(a){return{valid:!1,error:a.message}}}async function t(a){let b,c=await (0,d.Mc)(a);if(!c)return{valid:!1,error:"Connection not found",latencyMs:0,testedAt:new Date().toISOString()};let g=await (0,e.B)(c.providerSpecificData||{});if(g.connectionProxyEnabled&&g.connectionProxyUrl&&!g.vercelRelayUrl){let b=await (0,f.C)({proxyUrl:g.connectionProxyUrl});if(!b.ok){let c=b.error||`Proxy test failed with status ${b.status}`;return await (0,d.updateProviderConnection)(a,{testStatus:"error",lastError:c,lastErrorAt:new Date().toISOString()}),{valid:!1,error:c,latencyMs:0,testedAt:new Date().toISOString()}}}let h=Date.now();b="apikey"===c.authType||"cookie"===c.authType?await s(c,g):await q(c,g);let i=Date.now()-h,j={testStatus:b.valid?"active":"error",lastError:b.valid?null:b.error,lastErrorAt:b.valid?null:new Date().toISOString()};if(b.valid){for(let a of Object.keys(c||{}))a.startsWith("modelLock_")&&(j[a]=null);j.backoffLevel=0,j.rateLimitedUntil=null,j.isPermanentlyBanned=!1,j.bannedAt=null}return b.refreshed&&b.newTokens&&(b.newTokens.accessToken&&(j.accessToken=b.newTokens.accessToken),b.newTokens.refreshToken&&(j.refreshToken=b.newTokens.refreshToken),b.newTokens.idToken&&(j.idToken=b.newTokens.idToken),b.newTokens.lastRefreshAt&&(j.lastRefreshAt=b.newTokens.lastRefreshAt),b.newTokens.expiresIn&&(j.expiresIn=b.newTokens.expiresIn),b.newTokens.expiresIn?j.expiresAt=new Date(Date.now()+1e3*b.newTokens.expiresIn).toISOString():b.newTokens.expiresAt&&(j.expiresAt=b.newTokens.expiresAt),b.newTokens.providerSpecificData&&(j.providerSpecificData={...c.providerSpecificData||{},...b.newTokens.providerSpecificData})),await (0,d.updateProviderConnection)(a,j),{valid:b.valid,error:b.error,refreshed:!!b.refreshed,latencyMs:i,testedAt:new Date().toISOString()}}},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)},73159:(a,b,c)=>{c.d(b,{Ue:()=>j,oT:()=>k,xz:()=>d});let d="b1a00492-073a-47ea-816f-4c329264a828",e="https://auth.x.ai",f="/oauth2/authorize",g="/oauth2/token",h="/.well-known/openid-configuration",i="/callback",j=96,k={clientId:d,issuer:e,authEndpointPath:f,tokenEndpointPath:g,discoveryPath:h,authorizeUrl:`${e}${f}`,tokenUrl:`${e}${g}`,discoveryUrl:`${e}${h}`,scope:"openid profile email offline_access grok-cli:access api:access",apiBaseUrl:"https://api.x.ai/v1",redirectUri:`http://127.0.0.1:56121${i}`,loopbackPort:56121,callbackPath:i,pkceVerifierBytes:96,refreshLeadSeconds:300,userAgent:"grok-cli/9router",codeChallengeMethod:"S256"}},74926:(a,b,c)=>{c.d(b,{C:()=>f});var d=c(47774);function e(a){return null==a?"":String(a).trim()}async function f({proxyUrl:a,testUrl:b,timeoutMs:c}={}){let g,h=e(a);if(!h)return{ok:!1,status:400,error:"proxyUrl is required"};let i=e(b)||"https://google.com/",j=Number(c),k=Number.isFinite(j)&&j>0?Math.min(j,3e4):8e3;try{try{g=new d.ProxyAgent({uri:h})}catch(a){return{ok:!1,status:400,error:`Invalid proxy URL: ${a?.message||String(a)}`}}let a=new AbortController,b=Date.now(),c=setTimeout(()=>a.abort(),k);try{let c=await (0,d.hd)(i,{method:"HEAD",dispatcher:g,signal:a.signal,headers:{"User-Agent":"kRouter"}});return{ok:c.ok,status:c.status,statusText:c.statusText,url:i,elapsedMs:Date.now()-b}}catch(b){let a=b?.name==="AbortError"?"Proxy test timed out":function(a){if(!a)return"Unknown error";let b=a?.message||String(a),c=a?.cause?.code||a?.code,d=a?.cause?.message;return d&&d!==b?c?`${b}: ${d} (${c})`:`${b}: ${d}`:c&&!b.includes(c)?`${b} (${c})`:b}(b);return{ok:!1,status:500,error:a}}finally{clearTimeout(c)}}finally{try{await g?.close?.()}catch{}}}},81329:(a,b,c)=>{c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(44404);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))},92990:(a,b,c)=>{c.d(b,{DI:()=>h,Hp:()=>j,LT:()=>i,MZ:()=>u,Nl:()=>A,Nu:()=>o,OV:()=>g,S6:()=>q,Td:()=>x,Tx:()=>r,WN:()=>s,Ww:()=>B,YT:()=>m,ZL:()=>l,cD:()=>n,f7:()=>z,hF:()=>k,lB:()=>v,qp:()=>w,t:()=>t,w1:()=>y});var d=c(21820),e=c(73159);function f(){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)}let g={clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",authorizeUrl:"https://claude.ai/oauth/authorize",tokenUrl:"https://api.anthropic.com/v1/oauth/token",scopes:["org:create_api_key","user:profile","user:inference"],codeChallengeMethod:"S256"},h={clientId:"app_EMoamEEZ73f0CkXaXp7hrann",authorizeUrl:"https://auth.openai.com/oauth/authorize",tokenUrl:"https://auth.openai.com/oauth/token",scope:"openid profile email offline_access",codeChallengeMethod:"S256",extraParams:{id_token_add_organizations:"true",codex_cli_simplified_flow:"true",originator:"codex_cli_rs"}},i={clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile"]},j={clientId:"f0304373b74a44d2b584a3fb70ca9e56",deviceCodeUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",scope:"openid profile email model.completion",codeChallengeMethod:"S256"},k={openApiBaseUrl:"https://openapi.qoder.sh",centerBaseUrl:"https://center.qoder.sh",chatBaseUrl:"https://api3.qoder.sh",deviceTokenUrl:"https://openapi.qoder.sh/api/v1/deviceToken/poll",refreshUrl:"https://center.qoder.sh/algo/api/v3/user/refresh_token",userInfoUrl:"https://openapi.qoder.sh/api/v1/userinfo",quotaUsageUrl:"https://openapi.qoder.sh/api/v2/quota/usage",loginUrl:"https://qoder.com/device/selectAccounts"},l={clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",authorizeUrl:"https://iflow.cn/oauth",tokenUrl:"https://iflow.cn/oauth/token",userInfoUrl:"https://iflow.cn/api/oauth/getUserInfo",extraParams:{loginMethod:"phone",type:"phone"}},m={clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/cclog","https://www.googleapis.com/auth/experimentsandconfigs"],apiEndpoint:"https://cloudcode-pa.googleapis.com",apiVersion:"v1internal",loadCodeAssistEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUserEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser",loadCodeAssistUserAgent:"google-api-nodejs-client/9.15.1",loadCodeAssistApiClient:"google-cloud-sdk vscode_cloudshelleditor/0.1",loadCodeAssistClientMetadata:JSON.stringify({ideType:9,platform:f(),pluginType:2})};function n(){return{ideType:9,platform:f(),pluginType:2}}let o={clientId:"Iv1.b507a08c87ecfe98",deviceCodeUrl:"https://github.com/login/device/code",tokenUrl:"https://github.com/login/oauth/access_token",userInfoUrl:"https://api.github.com/user",scopes:"read:user",apiVersion:"2022-11-28",copilotTokenUrl:"https://api.github.com/copilot_internal/v2/token",userAgent:"GitHubCopilotChat/0.26.7",editorVersion:"vscode/1.85.0",editorPluginVersion:"copilot-chat/0.26.7"},p=/^[a-z]{2}-[a-z]+-\d{1,2}$/;function q(a){if("string"!=typeof a||!p.test(a))throw Error("Invalid region");return a}let r={ssoOidcEndpoint:"https://oidc.us-east-1.amazonaws.com",registerClientUrl:"https://oidc.us-east-1.amazonaws.com/client/register",deviceAuthUrl:"https://oidc.us-east-1.amazonaws.com/device_authorization",tokenUrl:"https://oidc.us-east-1.amazonaws.com/token",startUrl:"https://view.awsapps.com/start",clientName:"kiro-oauth-client",clientType:"public",scopes:["codewhisperer:completions","codewhisperer:analysis","codewhisperer:conversations"],grantTypes:["urn:ietf:params:oauth:grant-type:device_code","refresh_token"],issuerUrl:"https://identitycenter.amazonaws.com/ssoins-722374e8c3c8e6c6",socialAuthEndpoint:"https://prod.us-east-1.auth.desktop.kiro.dev",socialLoginUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/login",socialTokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/oauth/token",socialRefreshUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",socialClientId:process.env.KIRO_OAUTH_CLIENT_ID||"kiro-cli",socialDeviceAuthorizeUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/oauth/device/authorization",socialDevicePollUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/oauth/device/poll",authMethods:["builder-id","idc","google","github","import"]},s={apiEndpoint:"https://api2.cursor.sh",chatEndpoint:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",modelsEndpoint:"/aiserver.v1.AiService/GetDefaultModelNudgeData",api3Endpoint:"https://api3.cursor.sh",agentEndpoint:"https://agent.api5.cursor.sh",agentNonPrivacyEndpoint:"https://agentn.api5.cursor.sh",clientVersion:"3.1.0",clientType:"ide",tokenStoragePaths:{linux:"~/.config/Cursor/User/globalStorage/state.vscdb",macos:"/Users/<user>/Library/Application Support/Cursor/User/globalStorage/state.vscdb",windows:"%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb"},dbKeys:{accessToken:"cursorAuth/accessToken",machineId:"storage.serviceMachineId"}},t={clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||"17e5f671-d194-4dfb-9706-5516cb48c098",deviceCodeUrl:"https://auth.kimi.com/api/oauth/device_authorization",tokenUrl:"https://auth.kimi.com/api/oauth/token"},u={apiBaseUrl:"https://api.kilo.ai",initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},v={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},w={clientId:e.xz,deviceCodeUrl:"https://auth.x.ai/oauth2/device/code",tokenUrl:"https://auth.x.ai/oauth2/token",refreshUrl:"https://auth.x.ai/oauth2/token",scope:"openid profile email offline_access grok-cli:access api:access conversations:read conversations:write",referrer:"grok-build",pollInterval:5e3},x={webAppUrl:"https://app.kimchi.dev",validationUrl:"https://api.cast.ai/v1/llm/openai/supported-providers",userInfoUrl:"https://app.kimchi.dev/api/v1/me",modelsUrl:"https://llm.kimchi.dev/v1/models/metadata?include_in_cli=true"},y={...v},z={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},A={baseUrl:"https://copilot.tencent.com",stateUrl:"https://copilot.tencent.com/v2/plugin/auth/state",tokenUrl:"https://copilot.tencent.com/v2/plugin/auth/token",refreshUrl:"https://copilot.tencent.com/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",platform:"CLI",pollInterval:5e3},B=3e5},93943:(a,b,c)=>{c.d(b,{Vq:()=>i,fp:()=>g});var d=c(8590);let e=new Map;function f(a){if(null==a||""===a)return null;if("number"==typeof a)return a<1e12?1e3*a:a;let b=new Date(a).getTime();return Number.isFinite(b)?b:null}function g(a,b,c=Date.now()){if(!b)return!1;let e=f(b?.expiresAt??b?.tokenExpiresAt);return!!(null!==e&&e-c<(0,d.Og)(a)||"codex"===a&&b.refreshToken&&function(a,b=Date.now()){let c=f(a?.lastRefreshAt??a?.lastRefresh??a?.providerSpecificData?.lastRefreshAt);return!c||b-c>=6912e5}(b,c))}async function h(a,b,c){let d,f=(d=b?.connectionId||b?.id||b?.email||b?.name||b?.refreshToken?.slice?.(-16)||"default",`${a}:${d}`),g=e.get(f);if(g)return g;let h=Promise.resolve().then(c).finally(()=>{e.delete(f)});return e.set(f,h),h}async function i(a,b,c){return b?h(a,b,async()=>{let e=await (0,d.$B)(a,b,c);return function(a,b,c,e=Date.now()){var f,g;if(!c)return null;if((0,d.jT)(c))return c;let h={},i=new Date(e).toISOString();c.accessToken&&(h.accessToken=c.accessToken),c.apiKey&&(h.apiKey=c.apiKey),c.token&&(h.token=c.token);let j=c.refreshToken??b?.refreshToken;j&&(h.refreshToken=j);let k=c.idToken??b?.idToken;return k&&(h.idToken=k),c.expiresIn?(h.expiresIn=c.expiresIn,h.expiresAt=function(a,b=Date.now()){return a?new Date(b+1e3*a).toISOString():null}(c.expiresIn,e)):c.expiresAt&&(h.expiresAt=c.expiresAt),c.projectId&&(h.projectId=c.projectId),c.providerSpecificData&&(f=b?.providerSpecificData,h.providerSpecificData=(g=c.providerSpecificData)&&"object"==typeof g?{...f||{},...g}:f),c.copilotToken&&(h.copilotToken=c.copilotToken),c.copilotTokenExpiresAt&&(h.copilotTokenExpiresAt=c.copilotTokenExpiresAt),("codex"===a||h.accessToken||h.apiKey||h.token||h.refreshToken||h.copilotToken)&&(h.lastRefreshAt=c.lastRefreshAt||i),h}(a,b,e)}):null}},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)}}};
@@ -3,7 +3,7 @@ MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDA8iMH5c02LilrsERw9t6Pv5Nc
3
3
  4k6Pz1EaDicBMpdpxKduSZu5OANqUq8er4GM95omAGIOPOh+Nx0spthYA2BqGz+l
4
4
  6HRkPJ7S236FZz73In/KVuLnwI8JJ2CbuJap8kvheCCZpmAWpb/cPx/3Vr/J6I17
5
5
  XcW+ML9FoCI6AOvOzwIDAQAB
6
- -----END PUBLIC KEY-----`},39006:a=>{a.exports={rE:"0.5.111"}},52007:(a,b,c)=>{c.d(b,{av:()=>o,gK:()=>m});var d=c(55511),e=c(39609);let f="https://llm.kimchi.dev",g=new Set([429,500,502,503,504]),h=new Map,i=new Map;function j(a){return(("string"==typeof a?a.trim():"")||f).replace(/\/+$/,"")}function k(a){return a?.accessToken||a?.apiKey||a?.providerSpecificData?.apiKey||null}function l(a){if(!a||"object"!=typeof a)return null;let b=a.slug||a.id||a.model||a.name;if("string"!=typeof b||""===b.trim())return null;let c=Array.isArray(a.input_modalities)?a.input_modalities.filter(a=>"text"===a||"image"===a):[],d=a.limits&&"object"==typeof a.limits?a.limits:{},e=Number(d.context_window||a.contextLength||a.context_length)||void 0,f=Number(d.max_output_tokens||a.maxOutputTokens||a.max_output_tokens)||void 0,g="string"==typeof a.provider?a.provider:"",h=!0===a.reasoning,i=Array.isArray(c)&&c.includes("image")?"imageToText":"llm",j={...a,id:b.trim(),name:String(a.display_name||a.displayName||a.name||b).trim(),provider:g,upstreamProvider:g,reasoning:h,inputModalities:c,kind:i,type:i,capabilities:{vision:c.includes("image"),reasoning:h,...e?{contextWindow:e}:{},...f?{maxOutput:f}:{},...g?{upstreamProvider:g}:{}},...e?{contextLength:e}:{},...f?{maxOutputTokens:f}:{}};return"anthropic"===g&&(j.compat={supportsReasoningEffort:!1,cacheControlFormat:"anthropic"}),j}function m(a){if("string"!=typeof a||""===a.trim())return null;let b=a.includes("/")?a.split("/").pop():a;return i.get(b)||i.get(b.toLowerCase())||null}async function n(a,b,c={}){let d=`${j(b)}/v1/models/metadata?include_in_cli=true`,f=new AbortController,h=setTimeout(()=>f.abort(Error("Kimchi models fetch timeout")),2e4),i=c.signal?AbortSignal.any([c.signal,f.signal]):f.signal;try{let b=await (0,e.proxyAwareFetch)(d,{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${a}`,"User-Agent":"kimchi/0.1.40"},cache:"no-store",signal:i},c.proxyOptions||null);if(!b.ok){let a=Error(`Kimchi models ${b.status}: ${b.statusText}`);throw a.status=b.status,a.retryable=g.has(b.status),a}let f=await b.json();return Array.isArray(f?.models)?f.models:[]}finally{clearTimeout(h)}}async function o(a,b={}){let c,e,g,m=k(a);if(!m)return null;let p=a?.providerSpecificData?.kimchiEndpoint||b.endpoint||f,q=(g=(e=a?.providerSpecificData||{}).userId||e.username||a?.refreshToken||k(a)||"anonymous",(0,d.createHash)("sha256").update(`kimchi:${j(p)}:${g}`).digest("hex")),r=Date.now();if(!b.forceRefresh){let a=h.get(q);if(a&&a.expiresAt>r)return a}try{c=await n(m,p,b)}catch(a){return b.log?.warn?.("KIMCHI_MODELS",a.message),null}let s=c.map(l).filter(Boolean);if(0===s.length)return null;for(let a of s||[])a?.id&&(i.set(a.id,a),i.set(a.id.toLowerCase(),a));let t={expiresAt:Date.now()+3e5,models:s,rawModels:c};return h.set(q,t),t}},53225:(a,b,c)=>{c.d(b,{EV:()=>l,X5:()=>k});var d=c(55511),e=c(39609),f=c(78085),g=c(30022);let h=new Map,i=new Map;async function j(a,b,c=null){let d,h,i={userId:(h=a?.providerSpecificData||{}).userId,authToken:a.accessToken,name:a.displayName||"",email:a.email||"",machineId:h.machineId||""};if(!i.userId||!i.authToken)return null;let k={Accept:"application/json","Accept-Encoding":"identity",...(0,f.d)(Buffer.alloc(0),g.t6,i)},l=new AbortController,m=null,n=null;try{m=setTimeout(()=>l.abort("timeout"),15e3),b&&"function"==typeof b.addEventListener&&(b.aborted?l.abort(b.reason):(n=()=>l.abort(b.reason),b.addEventListener("abort",n))),d=await (0,e.proxyAwareFetch)(g.t6,{method:"GET",headers:k,signal:l.signal},c)}finally{m&&clearTimeout(m),b&&n&&b.removeEventListener("abort",n)}if(!d.ok)return null;let o=await d.json().catch(()=>null);if(!o||!Array.isArray(o.chat))return null;let p=[],q=new Map;for(let a of o.chat){if(!a||"object"!=typeof a)continue;let b=a.key;if(!b||(q.set(b,a),!1===a.enable))continue;let c=a.display_name||b,d=Number(a.max_input_tokens)||131072;p.push({id:b,name:`${c}`,contextLength:d,isVL:!!a.is_vl,isReasoning:!!a.is_reasoning,maxOutputTokens:Number(a.max_output_tokens)||0,description:a.description||""})}return{models:p,rawConfigs:q}}async function k(a,b,c={}){let d=await l(a,c);if(!d)return null;let e=d.rawConfigs.get(b);return e?{...e,key:b}:null}async function l(a,b={}){let c;if(!a?.accessToken||!(a.providerSpecificData||{}).userId)return null;let e=(c=(a?.providerSpecificData||{}).userId||a?.refreshToken||a?.accessToken||"anonymous",(0,d.createHash)("sha256").update(`qoder:${c}`).digest("hex")),f=Date.now();if(!b.forceRefresh){let a=h.get(e);if(a&&a.expiresAt>f)return a}let g=i.get(e);if(g&&!b.forceRefresh)return g;let k=(async()=>{let c=await j(a,b.signal,b.proxyOptions);if(!c)return null;let d={expiresAt:Date.now()+36e5,models:c.models,rawConfigs:c.rawConfigs,fetched:!0};return h.set(e,d),d})();i.set(e,k);try{return await k}finally{i.get(e)===k&&i.delete(e)}}},78085:(a,b,c)=>{c.d(b,{d:()=>i});var d=c(55511),e=c.n(d),f=c(94755),g=c(30022);function h(a){return e().createHash("md5").update(a).digest("hex")}function i(a,b,c){var d;let i,j;if(!c?.userId)throw Error("cosy: user id is empty");if(!c?.authToken)throw Error("cosy: auth token is empty");let k=Buffer.isBuffer(a)?a:"string"==typeof a?Buffer.from(a,"latin1"):Buffer.from(a||[]),{cosyKey:l,info:m}=(d={uid:c.userId,security_oauth_token:c.authToken,name:c.name||"",aid:"",email:c.email||""},i=(0,f.A)().slice(0,16),j=function(a,b){var c;let d,f,g=Buffer.from(b,"utf8");if(16!==g.length)throw Error(`aes key must be 16 bytes, got ${g.length}`);let h=g.subarray(0,16),i=e().createCipheriv("aes-128-cbc",g,h);i.setAutoPadding(!1);let j=(d=16-(c=Buffer.from(a,"utf8")).length%16,f=Buffer.alloc(c.length+d,d),c.copy(f,0),f);return Buffer.concat([i.update(j),i.final()]).toString("base64")}(JSON.stringify(d),i),{cosyKey:e().publicEncrypt({key:g.pr,padding:e().constants.RSA_PKCS1_PADDING},Buffer.from(i,"utf8")).toString("base64"),info:j}),n=String(Math.floor(Date.now()/1e3)),o=JSON.stringify({version:"v1",requestId:(0,f.A)(),info:m,cosyVersion:g.cT,ideVersion:""}),p=Buffer.from(o,"utf8").toString("base64"),q=function(a){let b;try{b=new URL(a).pathname||""}catch{return""}return b.startsWith("/algo")?b.slice(5):b}(b),r=`${p}
6
+ -----END PUBLIC KEY-----`},39006:a=>{a.exports={rE:"0.5.112"}},52007:(a,b,c)=>{c.d(b,{av:()=>o,gK:()=>m});var d=c(55511),e=c(39609);let f="https://llm.kimchi.dev",g=new Set([429,500,502,503,504]),h=new Map,i=new Map;function j(a){return(("string"==typeof a?a.trim():"")||f).replace(/\/+$/,"")}function k(a){return a?.accessToken||a?.apiKey||a?.providerSpecificData?.apiKey||null}function l(a){if(!a||"object"!=typeof a)return null;let b=a.slug||a.id||a.model||a.name;if("string"!=typeof b||""===b.trim())return null;let c=Array.isArray(a.input_modalities)?a.input_modalities.filter(a=>"text"===a||"image"===a):[],d=a.limits&&"object"==typeof a.limits?a.limits:{},e=Number(d.context_window||a.contextLength||a.context_length)||void 0,f=Number(d.max_output_tokens||a.maxOutputTokens||a.max_output_tokens)||void 0,g="string"==typeof a.provider?a.provider:"",h=!0===a.reasoning,i=Array.isArray(c)&&c.includes("image")?"imageToText":"llm",j={...a,id:b.trim(),name:String(a.display_name||a.displayName||a.name||b).trim(),provider:g,upstreamProvider:g,reasoning:h,inputModalities:c,kind:i,type:i,capabilities:{vision:c.includes("image"),reasoning:h,...e?{contextWindow:e}:{},...f?{maxOutput:f}:{},...g?{upstreamProvider:g}:{}},...e?{contextLength:e}:{},...f?{maxOutputTokens:f}:{}};return"anthropic"===g&&(j.compat={supportsReasoningEffort:!1,cacheControlFormat:"anthropic"}),j}function m(a){if("string"!=typeof a||""===a.trim())return null;let b=a.includes("/")?a.split("/").pop():a;return i.get(b)||i.get(b.toLowerCase())||null}async function n(a,b,c={}){let d=`${j(b)}/v1/models/metadata?include_in_cli=true`,f=new AbortController,h=setTimeout(()=>f.abort(Error("Kimchi models fetch timeout")),2e4),i=c.signal?AbortSignal.any([c.signal,f.signal]):f.signal;try{let b=await (0,e.proxyAwareFetch)(d,{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${a}`,"User-Agent":"kimchi/0.1.40"},cache:"no-store",signal:i},c.proxyOptions||null);if(!b.ok){let a=Error(`Kimchi models ${b.status}: ${b.statusText}`);throw a.status=b.status,a.retryable=g.has(b.status),a}let f=await b.json();return Array.isArray(f?.models)?f.models:[]}finally{clearTimeout(h)}}async function o(a,b={}){let c,e,g,m=k(a);if(!m)return null;let p=a?.providerSpecificData?.kimchiEndpoint||b.endpoint||f,q=(g=(e=a?.providerSpecificData||{}).userId||e.username||a?.refreshToken||k(a)||"anonymous",(0,d.createHash)("sha256").update(`kimchi:${j(p)}:${g}`).digest("hex")),r=Date.now();if(!b.forceRefresh){let a=h.get(q);if(a&&a.expiresAt>r)return a}try{c=await n(m,p,b)}catch(a){return b.log?.warn?.("KIMCHI_MODELS",a.message),null}let s=c.map(l).filter(Boolean);if(0===s.length)return null;for(let a of s||[])a?.id&&(i.set(a.id,a),i.set(a.id.toLowerCase(),a));let t={expiresAt:Date.now()+3e5,models:s,rawModels:c};return h.set(q,t),t}},53225:(a,b,c)=>{c.d(b,{EV:()=>l,X5:()=>k});var d=c(55511),e=c(39609),f=c(78085),g=c(30022);let h=new Map,i=new Map;async function j(a,b,c=null){let d,h,i={userId:(h=a?.providerSpecificData||{}).userId,authToken:a.accessToken,name:a.displayName||"",email:a.email||"",machineId:h.machineId||""};if(!i.userId||!i.authToken)return null;let k={Accept:"application/json","Accept-Encoding":"identity",...(0,f.d)(Buffer.alloc(0),g.t6,i)},l=new AbortController,m=null,n=null;try{m=setTimeout(()=>l.abort("timeout"),15e3),b&&"function"==typeof b.addEventListener&&(b.aborted?l.abort(b.reason):(n=()=>l.abort(b.reason),b.addEventListener("abort",n))),d=await (0,e.proxyAwareFetch)(g.t6,{method:"GET",headers:k,signal:l.signal},c)}finally{m&&clearTimeout(m),b&&n&&b.removeEventListener("abort",n)}if(!d.ok)return null;let o=await d.json().catch(()=>null);if(!o||!Array.isArray(o.chat))return null;let p=[],q=new Map;for(let a of o.chat){if(!a||"object"!=typeof a)continue;let b=a.key;if(!b||(q.set(b,a),!1===a.enable))continue;let c=a.display_name||b,d=Number(a.max_input_tokens)||131072;p.push({id:b,name:`${c}`,contextLength:d,isVL:!!a.is_vl,isReasoning:!!a.is_reasoning,maxOutputTokens:Number(a.max_output_tokens)||0,description:a.description||""})}return{models:p,rawConfigs:q}}async function k(a,b,c={}){let d=await l(a,c);if(!d)return null;let e=d.rawConfigs.get(b);return e?{...e,key:b}:null}async function l(a,b={}){let c;if(!a?.accessToken||!(a.providerSpecificData||{}).userId)return null;let e=(c=(a?.providerSpecificData||{}).userId||a?.refreshToken||a?.accessToken||"anonymous",(0,d.createHash)("sha256").update(`qoder:${c}`).digest("hex")),f=Date.now();if(!b.forceRefresh){let a=h.get(e);if(a&&a.expiresAt>f)return a}let g=i.get(e);if(g&&!b.forceRefresh)return g;let k=(async()=>{let c=await j(a,b.signal,b.proxyOptions);if(!c)return null;let d={expiresAt:Date.now()+36e5,models:c.models,rawConfigs:c.rawConfigs,fetched:!0};return h.set(e,d),d})();i.set(e,k);try{return await k}finally{i.get(e)===k&&i.delete(e)}}},78085:(a,b,c)=>{c.d(b,{d:()=>i});var d=c(55511),e=c.n(d),f=c(94755),g=c(30022);function h(a){return e().createHash("md5").update(a).digest("hex")}function i(a,b,c){var d;let i,j;if(!c?.userId)throw Error("cosy: user id is empty");if(!c?.authToken)throw Error("cosy: auth token is empty");let k=Buffer.isBuffer(a)?a:"string"==typeof a?Buffer.from(a,"latin1"):Buffer.from(a||[]),{cosyKey:l,info:m}=(d={uid:c.userId,security_oauth_token:c.authToken,name:c.name||"",aid:"",email:c.email||""},i=(0,f.A)().slice(0,16),j=function(a,b){var c;let d,f,g=Buffer.from(b,"utf8");if(16!==g.length)throw Error(`aes key must be 16 bytes, got ${g.length}`);let h=g.subarray(0,16),i=e().createCipheriv("aes-128-cbc",g,h);i.setAutoPadding(!1);let j=(d=16-(c=Buffer.from(a,"utf8")).length%16,f=Buffer.alloc(c.length+d,d),c.copy(f,0),f);return Buffer.concat([i.update(j),i.final()]).toString("base64")}(JSON.stringify(d),i),{cosyKey:e().publicEncrypt({key:g.pr,padding:e().constants.RSA_PKCS1_PADDING},Buffer.from(i,"utf8")).toString("base64"),info:j}),n=String(Math.floor(Date.now()/1e3)),o=JSON.stringify({version:"v1",requestId:(0,f.A)(),info:m,cosyVersion:g.cT,ideVersion:""}),p=Buffer.from(o,"utf8").toString("base64"),q=function(a){let b;try{b=new URL(a).pathname||""}catch{return""}return b.startsWith("/algo")?b.slice(5):b}(b),r=`${p}
7
7
  ${l}
8
8
  ${n}
9
9
  ${k.toString("latin1")}
@@ -1,3 +1,3 @@
1
- "use strict";exports.id=9489,exports.ids=[9489],exports.modules={9999:(a,b,c)=>{c.d(b,{$S:()=>l,$T:()=>m,QS:()=>n,e3:()=>o});var d=c(77598),e=c.n(d);let f=globalThis;f.__krouterResponseCache||(f.__krouterResponseCache=new Map,f.__krouterResponseCacheStats={hits:0,misses:0,skipped:0,bytesSaved:0,tokensSaved:0,lastResetAt:Date.now()});let g=f.__krouterResponseCache,h=f.__krouterResponseCacheStats;function i({model:a,body:b}){let c=JSON.stringify({model:a,system:b?.system??null,instructions:b?.instructions??null,messages:b?.messages??null,input:b?.input??null,contents:b?.contents??null,temperature:b?.temperature??null,max_tokens:b?.max_tokens??b?.max_output_tokens??null,tools:b?.tools??null,tool_choice:b?.tool_choice??null,response_format:b?.response_format??null});return e().createHash("sha256").update(c).digest("hex")}let j=new Set(["antigravity","ag","gemini","gemini-cli","gc"]);function k(a,b=null){if(!a||"object"!=typeof a||!0===a.stream||"number"==typeof a.temperature&&a.temperature>.3||"required"===a.tool_choice)return!1;let c=function(a){if("string"!=typeof a)return null;let b=a.indexOf("/");return b>0?a.slice(0,b):null}(b);if(c&&j.has(c))return!1;let d=a.max_tokens??a.max_output_tokens??null;return"number"!=typeof d||!(d<32)}function l({model:a,body:b}){if(!k(b,a))return h.skipped++,null;let c=i({model:a,body:b}),d=g.get(c);return d?d.expiresAt<Date.now()?(g.delete(c),h.misses++,null):(g.delete(c),g.set(c,d),h.hits++,h.bytesSaved+=d.bodyBytes||0,h.tokensSaved+=d.estimatedTokens||0,d):(h.misses++,null)}function m({model:a,body:b,status:c,contentType:d,responseBody:e,estimatedTokens:f=0,ttlMs:h=3e5,maxEntries:j=500}){if(!k(b,a)||200!==c||!e||"string"==typeof e&&e.length<100)return!1;let l=i({model:a,body:b}),n="string"==typeof e?e:JSON.stringify(e),o={key:l,status:c,contentType:d||"application/json",body:n,bodyBytes:Buffer.byteLength(n,"utf-8"),estimatedTokens:f,expiresAt:Date.now()+h,storedAt:Date.now(),model:a};for(g.set(l,o);g.size>j;){let a=g.keys().next().value;if(void 0===a)break;g.delete(a)}return!0}function n(){let a=h.hits+h.misses;return{enabled:!0,entries:g.size,hits:h.hits,misses:h.misses,skipped:h.skipped,hitRate:a>0?h.hits/a:0,bytesSaved:h.bytesSaved,tokensSaved:h.tokensSaved,lastResetAt:h.lastResetAt}}function o(){g.clear(),h.hits=0,h.misses=0,h.skipped=0,h.bytesSaved=0,h.tokensSaved=0,h.lastResetAt=Date.now()}},24253:(a,b,c)=>{c.d(b,{Mo:()=>h,RG:()=>l,V:()=>i,Y8:()=>k,xl:()=>m});var d=c(1932),e=c(87155);let f=null,g=null;function h(){return f?{loaded:!0,version:f.version,loadedAt:f.loadedAt}:{loaded:!1}}async function i(){return f||g||(g=j().finally(()=>{g=null}))}async function j(){let a=(0,e.S1)();if(!a.installed){let a=Error("PXPIPE is not installed");throw a.code="NOT_INSTALLED",a}let b=`${(0,d.pathToFileURL)((0,e.CG)()).href}?v=${encodeURIComponent(a.version||"0")}`,c=await import(b);if("function"!=typeof c.transformAnthropicMessages)throw Error("installed pxpipe package does not export transformAnthropicMessages");return f={module:c,version:a.version,loadedAt:Date.now()}}function k(){let a=!!f;return f=null,a}async function l({autoLoad:a=!0}={}){try{if(!f&&!a)return null;let{module:b}=await i();return b.transformAnthropicMessages}catch{return null}}async function m(){let a=Date.now(),{module:b}=await i(),c=new TextEncoder().encode(JSON.stringify({model:"claude-fable-5",max_tokens:16,messages:[{role:"user",content:"ping"}]})),d=await b.transformAnthropicMessages({body:c,model:"claude-fable-5"});if(!d||"boolean"!=typeof d.applied||!(d.body instanceof Uint8Array))throw Error("transform returned an unexpected shape");return{ok:!0,reason:d.reason,durationMs:Date.now()-a}}},38775:(a,b,c)=>{c.d(b,{d_:()=>k,mA:()=>j});var d=c(89718),e=c(40669),f=c(35024),g=c(44404);let h={xmtp:"xiaomi-tokenplan","xiaomi-tokenplan":"xiaomi-tokenplan"},i=new Set([...Object.keys(h),...Object.keys(f.xq),...Object.keys(g.Xg),...Object.values(g.Xg)]);async function j(a){let b,c=(b=(0,e.Xh)(a),b?.providerAlias&&h[b.providerAlias]?{...b,provider:h[b.providerAlias]}:b);if(!c.isAlias){if(!i.has(c.providerAlias)){let a=(await (0,d.Fh)({type:"openai-compatible"})).find(a=>a.prefix===c.providerAlias);if(a)return{provider:a.id,model:c.model};let b=(await (0,d.Fh)({type:"anthropic-compatible"})).find(a=>a.prefix===c.providerAlias);if(b)return{provider:b.id,model:c.model};let e=(await (0,d.Fh)({type:"custom-embedding"})).find(a=>a.prefix===c.providerAlias);if(e)return{provider:e.id,model:c.model}}return{provider:c.provider,model:c.model}}return await (0,d.Dj)(c.model)?{provider:null,model:c.model}:(0,e.js)(a,d.OM)}async function k(a){if(a.includes("/"))return null;let b=await (0,d.Dj)(a);return b&&b.models&&b.models.length>0?b.models:null}},74388:(a,b,c)=>{c.d(b,{Az:()=>l,SP:()=>o,T0:()=>k});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(87155);let i=g().join(h.XF,"events.jsonl"),j=g().join(h.XF,"events.jsonl.1");function k(a){try{e().existsSync(h.XF)||e().mkdirSync(h.XF,{recursive:!0});try{e().statSync(i).size>5242880&&e().renameSync(i,j)}catch{}e().appendFile(i,JSON.stringify({ts:Date.now(),...a})+"\n",()=>{})}catch{}}function l({sinceMs:a=null,limit:b=null}={}){let c=[];for(let b of[j,i])try{if(!e().existsSync(b))continue;for(let d of e().readFileSync(b,"utf8").split("\n"))if(d)try{let b=JSON.parse(d);if(a&&b.ts<a)continue;c.push(b)}catch{}}catch{}return c.sort((a,b)=>a.ts-b.ts),b?c.slice(-b):c}function m(){return{requests:0,compressed:0,bypassed:0,errors:0,tokensBeforeEst:0,tokensAfterEst:0,tokensSavedEst:0,savedPct:0,imagesGenerated:0,compressionTimeMs:0,avgCompressionMs:0}}function n(a,b){a.requests++,b.applied?(a.compressed++,a.tokensBeforeEst+=b.tokensBeforeEst||0,a.tokensAfterEst+=b.tokensAfterEst||0,a.tokensSavedEst+=b.tokensSavedEst||0,a.imagesGenerated+=b.imageCount||0,a.compressionTimeMs+=b.durationMs||0):"transform_error"===b.reason||"timeout"===b.reason?a.errors++:a.bypassed++}function o({timelineDays:a=30,recentLimit:b=100}={}){let c=l(),d=Date.now(),e=new Date(new Date(d).setHours(0,0,0,0)).getTime(),f={all:m(),today:m(),yesterday:m(),last7d:m(),last30d:m()},g=new Map;for(let b=a-1;b>=0;b--){let a=new Date(e-864e5*b);g.set(a.toISOString().slice(0,10),{date:a.toISOString().slice(0,10),tokensSavedEst:0,compressed:0,requests:0})}for(let a of c){n(f.all,a),a.ts>=e?n(f.today,a):a.ts>=e-864e5&&n(f.yesterday,a),a.ts>=d-6048e5&&n(f.last7d,a),a.ts>=d-2592e6&&n(f.last30d,a);let b=new Date(a.ts).toISOString().slice(0,10),c=g.get(b);c&&(c.requests++,a.applied&&(c.compressed++,c.tokensSavedEst+=a.tokensSavedEst||0))}for(let a of Object.values(f))a.savedPct=a.tokensBeforeEst>0?+(a.tokensSavedEst/a.tokensBeforeEst*100).toFixed(2):0,a.avgCompressionMs=a.compressed>0?Math.round(a.compressionTimeMs/a.compressed):0;return{windows:f,timeline:[...g.values()],recent:c.slice(-b).reverse()}}},79489:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{P:()=>y});var e=c(48895),f=c(80238),g=c(71750),h=c(89718),i=c(38775),j=c(92500),k=c(43659),l=c(38962),m=c(27349),n=c(24253),o=c(74388),p=c(9999),q=c(41004),r=c(53258),s=c(14170),t=c(7803),u=c(67828),v=c(38160),w=c(29385),x=a([e,j]);async function y(a,b=null){let d;try{d=await a.json()}catch{return t.warn("CHAT","Invalid JSON body"),(0,k.yj)(q.gx.BAD_REQUEST,"Invalid JSON body")}b||(b={endpoint:new URL(a.url).pathname,body:d,headers:Object.fromEntries(a.headers.entries())}),(0,g.n)(b.headers);let e=new URL(a.url),j=d.model,n=d.messages?.length||d.input?.length||0,o=d.tools?.length||0,r=d.reasoning_effort||d.reasoning?.effort||null;t.request("POST",`${e.pathname} | ${j} | ${n} msgs${o?` | ${o} tools`:""}${r?` | effort=${r}`:""}`);let s=a.headers.get("Authorization"),u=(0,f.Tr)(a);if(s&&u){let a=t.maskKey(u);t.debug("AUTH",`API Key: ${a}`)}else t.debug("AUTH","No API key provided (local mode)");let v=await (0,h.mt)();if(v.requireApiKey){if(!u)return t.warn("AUTH","Missing API key (requireApiKey=true)"),(0,k.yj)(q.gx.UNAUTHORIZED,"Missing API key");if(!await (0,f.kI)(u))return t.warn("AUTH","Invalid API key (requireApiKey=true)"),(0,k.yj)(q.gx.UNAUTHORIZED,"Invalid API key")}if(!j)return t.warn("CHAT","Missing model"),(0,k.yj)(q.gx.BAD_REQUEST,"Missing model");try{let{classifyPromptIntent:a}=await c.e(9849).then(c.bind(c,49849)),{classifyRequestComplexity:b}=await c.e(3523).then(c.bind(c,23523)),e=(d?.messages||[]).find(a=>a?.role==="user"),f="string"==typeof e?.content?e.content:Array.isArray(e?.content)&&e.content.find(a=>a?.text)?.text||"",g=(d?.messages||[]).find(a=>a?.role==="system"),h="string"==typeof g?.content?g.content:"",i=a(f,h),j=b(d);t.debug("ROUTING",`intent=${i} | complexity=${j.level} score=${j.score} tier=${j.recommendedTier}${j.hasToolUse?" tools=yes":""}`)}catch(a){t.debug("ROUTING",`classify failed: ${a?.message}`)}let w=a?.headers?.get("user-agent")||"",x=(0,m.c)(d,j,w,!!v.ccFilterNaming);if(x)return x.response||x;if(v.responseCacheEnabled){let a=(0,p.$S)({model:j,body:d});if(a)return t.info("CHAT",`[CACHE HIT] ${j} (${a.bodyBytes}B saved)`),new Response(a.body,{status:a.status,headers:{"Content-Type":a.contentType,"X-Cache":"HIT","X-Cache-Age-Ms":String(Date.now()-a.storedAt)}})}let A=await (0,i.d_)(j);if(A){let c=v.comboStrategies||{},e=c[j]?.fallbackStrategy||v.comboStrategy||"fallback";if("fusion"===e)return t.info("CHAT",`Combo "${j}" with ${A.length} models (strategy: fusion)`),(0,l.vt)({body:d,models:A,handleSingleModel:(c,d)=>z(c,d,b,a,u,v,1),log:t,comboName:j,judgeModel:c[j]?.judgeModel,tuning:c[j]?.fusionTuning});let f=v.comboStickyRoundRobinLimit;return t.info("CHAT",`Combo "${j}" with ${A.length} models (strategy: ${e}, sticky: ${f})`),(0,l.Pr)({body:d,models:A,handleSingleModel:(c,d)=>z(c,d,b,a,u,v,1),log:t,comboName:j,comboStrategy:e,comboStickyLimit:f})}return z(d,j,b,a,u,v,0)}async function z(a,b,c=null,d=null,e=null,g=null,m=0){g||(g=await (0,h.mt)());let x=await (0,i.mA)(b);if(!x.provider){let f=await (0,i.d_)(b);if(f){if(m>=3)return t.warn("CHAT",`Combo recursion limit hit for "${b}" at depth ${m} — refusing to dispatch`),(0,k.yj)(q.gx.BAD_REQUEST,`Combo recursion limit (3) exceeded for "${b}"`);let h=g.comboStrategies||{},i=h[b]?.fallbackStrategy||g.comboStrategy||"fallback";if("fusion"===i)return t.info("CHAT",`Combo "${b}" with ${f.length} models (strategy: fusion, depth: ${m})`),(0,l.vt)({body:a,models:f,handleSingleModel:(a,b)=>z(a,b,c,d,e,g,m+1),log:t,comboName:b,judgeModel:h[b]?.judgeModel,tuning:h[b]?.fusionTuning});let j=g.comboStickyRoundRobinLimit;return t.info("CHAT",`Combo "${b}" with ${f.length} models (strategy: ${i}, sticky: ${j}, depth: ${m})`),(0,l.Pr)({body:a,models:f,handleSingleModel:(a,b)=>z(a,b,c,d,e,g,m+1),log:t,comboName:b,comboStrategy:i,comboStickyLimit:j})}return t.warn("CHAT","Invalid model format",{model:b}),(0,k.yj)(q.gx.BAD_REQUEST,"Invalid model format")}let{provider:y,model:A}=x;b!==`${y}/${A}`?t.info("ROUTING",`${b} → ${y}/${A}`):t.info("ROUTING",`Provider: ${y}, Model: ${A}`);let B=d?.headers?.get("user-agent")||"",C=d?.headers?.get("x-bypass-modellock")==="1",D=new Set,E=null,F=null,G=(g.providerStrategies||{})[y]||{},H="round-robin"===G.fallbackStrategy,I=(0,w.bI)(a,{provider:y}),J=!H&&I?(0,w.Wq)(I):null;for(;;){let h=await (0,f.c1)(y,D,A,{bypassModelLock:C,preferredConnectionId:J&&!D.has(J)?J:null});if(!h||h.allRateLimited){if(h?.allRateLimited){let a=E||h.lastError||"Unavailable",b=F||Number(h.lastErrorCode)||q.gx.SERVICE_UNAVAILABLE;return t.warn("CHAT",`[${y}/${A}] ${a} (${h.retryAfterHuman})`),(0,k.wO)(b,`[${y}/${A}] ${a}`,h.retryAfter,h.retryAfterHuman)}if(0===D.size)return t.warn("AUTH",`No active credentials for provider: ${y}`),(0,k.yj)(q.gx.SERVICE_UNAVAILABLE,`No active credentials for provider: ${y}`);return t.warn("CHAT","No more accounts available",{provider:y}),(0,k.yj)(F||q.gx.SERVICE_UNAVAILABLE,E||"All accounts unavailable")}t.info("AUTH",`\x1b[32mUsing ${y} account: ${h.connectionName}\x1b[0m`);let i=await (0,u.eU)(y,h);if(("antigravity"===y||"gemini-cli"===y)&&!i.projectId){let a=await (0,v.eG)(h.connectionId,i.accessToken);a&&(i.projectId=a,(0,u.vN)(h.connectionId,{projectId:a}).catch(()=>{}))}let l=(g.providerThinking||{})[y]||null,m=Date.now(),x=await (0,j.w)({body:{...a,model:`${y}/${A}`},modelInfo:{provider:y,model:A},credentials:i,log:t,clientRawRequest:c,connectionId:h.connectionId,userAgent:B,apiKey:e,ccFilterNaming:!!g.ccFilterNaming,rtkEnabled:!!g.rtkEnabled,cavemanEnabled:!!g.cavemanEnabled,cavemanLevel:g.cavemanLevel||"full",ponytailEnabled:!!g.ponytailEnabled,ponytailLevel:g.ponytailLevel||"full",pxpipeEnabled:!!g.pxpipeEnabled,pxpipeMinChars:g.pxpipeMinChars,pxpipeTimeoutMs:g.pxpipeTimeoutMs,pxpipeTransform:g.pxpipeEnabled?await (0,n.RG)():null,onPxpipeEvent:o.T0,providerThinking:l,settings:g,sourceFormatOverride:d?.url?(0,s.t)(new URL(d.url).pathname,a):null,onCredentialsRefreshed:async a=>{await (0,u.vN)(h.connectionId,{...a,existingProviderSpecificData:h.providerSpecificData,testStatus:"active"})},onRequestSuccess:async()=>{await (0,f.Pt)(h.connectionId,h,A)}});if((0,r.Up)(h.connectionId,!!x.success,Date.now()-m,{provider:y,model:A,strategy:"zenith"}),x.success){if(!H&&I&&h.connectionId&&(0,w.BO)(I,h.connectionId),g.responseCacheEnabled&&!0!==a.stream)try{let c=x.response.clone(),d=c.headers.get("content-type")||"application/json";c.text().then(e=>{(0,p.$T)({model:b,body:a,status:c.status,contentType:d,responseBody:e,estimatedTokens:Math.ceil(e.length/4),ttlMs:1e3*(g.responseCacheTtlSec||300)})}).catch(()=>{})}catch{}return x.response}if(x.emergencyFallback&&!a.__emergencyFallbackUsed){let b=x.emergencyFallback;t.info("EMERGENCY",`${y}/${A} → ${b.provider}/${b.model} (${b.reason})`);try{let h=await (0,f.c1)(b.provider,new Set,b.model);if(h&&!h.allRateLimited){let f={...a,__emergencyFallbackUsed:!0,model:`${b.provider}/${b.model}`};b.maxOutputTokens&&(f.max_tokens=Math.min(f.max_tokens||b.maxOutputTokens,b.maxOutputTokens));let i=await (0,j.w)({body:f,modelInfo:{provider:b.provider,model:b.model},credentials:h,log:t,clientRawRequest:c,userAgent:B,apiKey:e,connectionId:h.connectionId,ccFilterNaming:!!g.ccFilterNaming,rtkEnabled:!!g.rtkEnabled,cavemanEnabled:!!g.cavemanEnabled,cavemanLevel:g.cavemanLevel||"full",ponytailEnabled:!!g.ponytailEnabled,ponytailLevel:g.ponytailLevel||"full",pxpipeEnabled:!!g.pxpipeEnabled,pxpipeMinChars:g.pxpipeMinChars,pxpipeTimeoutMs:g.pxpipeTimeoutMs,pxpipeTransform:g.pxpipeEnabled?await (0,n.RG)():null,onPxpipeEvent:o.T0,providerThinking:(g.providerThinking||{})[b.provider]||null,sourceFormatOverride:d?.url?(0,s.t)(new URL(d.url).pathname,a):null,settings:g});if(i.success)return i.response;t.warn("EMERGENCY",`fallback ${b.provider}/${b.model} also failed: ${i.status}`)}else t.warn("EMERGENCY",`no credentials for fallback ${b.provider}, skipping`)}catch(a){t.warn("EMERGENCY",`fallback path threw: ${a.message}`)}}let{shouldFallback:z}=await (0,f.vk)(h.connectionId,x.status,x.error,y,A,x.resetsAtMs);if(z){t.warn("AUTH",`Account ${h.connectionName} unavailable (${x.status}), trying fallback`),D.add(h.connectionId),E=x.error,F=x.status;continue}return x.response}}[e,j]=x.then?(await x)():x,d()}catch(a){d(a)}})},87155:(a,b,c)=>{c.d(b,{CG:()=>q,ED:()=>u,S1:()=>s,XF:()=>j,_g:()=>t,no:()=>r,sW:()=>w});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(79646),i=c(49120);let j=g().join(i.n,"pxpipe"),k="pxpipe-proxy",l=g().join(j,"install.log"),m="win32"===process.platform,n=[...m?[`${process.env.ProgramFiles||""}\\nodejs`,`${process.env.APPDATA||""}\\npm`]:["/usr/local/bin","/opt/homebrew/bin",`${process.env.HOME||""}/.local/bin`,"/usr/bin","/bin"],process.env.PATH||""].filter(Boolean).join(g().delimiter),o=null;function p(){return g().join(j,"node_modules",k)}function q(){return g().join(p(),"dist","core","library.js")}function r(){try{let a=(0,h.execSync)(`${m?"where":"which"} npm`,{stdio:["ignore","pipe","ignore"],windowsHide:!0,env:{...process.env,PATH:n}}).toString().trim();return a?a.split(/\r?\n/)[0].trim():null}catch{return null}}function s(){try{let a=g().join(p(),"package.json");if(!e().existsSync(a)||!e().existsSync(q()))return{installed:!1,version:null,path:null};let b=JSON.parse(e().readFileSync(a,"utf8"));return{installed:!0,version:b.version||null,path:p()}}catch{return{installed:!1,version:null,path:null}}}function t(){return null!==o}function u(){return o||(o=v().finally(()=>{o=null}))}async function v(){let a=r();if(!a){let a=Error("npm not found on PATH — Node.js/npm is required to install PXPIPE");throw a.code="NPM_NOT_FOUND",a}e().existsSync(j)||e().mkdirSync(j,{recursive:!0});let b=g().join(j,"package.json");e().existsSync(b)||e().writeFileSync(b,JSON.stringify({name:"9router-pxpipe-host",private:!0},null,2));let c=e().openSync(l,"a");e().writeSync(c,`
1
+ "use strict";exports.id=9489,exports.ids=[9489],exports.modules={9999:(a,b,c)=>{c.d(b,{$S:()=>l,$T:()=>m,QS:()=>n,e3:()=>o});var d=c(77598),e=c.n(d);let f=globalThis;f.__krouterResponseCache||(f.__krouterResponseCache=new Map,f.__krouterResponseCacheStats={hits:0,misses:0,skipped:0,bytesSaved:0,tokensSaved:0,lastResetAt:Date.now()});let g=f.__krouterResponseCache,h=f.__krouterResponseCacheStats;function i({model:a,body:b}){let c=JSON.stringify({model:a,system:b?.system??null,instructions:b?.instructions??null,messages:b?.messages??null,input:b?.input??null,contents:b?.contents??null,temperature:b?.temperature??null,max_tokens:b?.max_tokens??b?.max_output_tokens??null,tools:b?.tools??null,tool_choice:b?.tool_choice??null,response_format:b?.response_format??null});return e().createHash("sha256").update(c).digest("hex")}let j=new Set(["antigravity","ag","gemini","gemini-cli","gc"]);function k(a,b=null){if(!a||"object"!=typeof a||!0===a.stream||"number"==typeof a.temperature&&a.temperature>.3||"required"===a.tool_choice)return!1;let c=function(a){if("string"!=typeof a)return null;let b=a.indexOf("/");return b>0?a.slice(0,b):null}(b);if(c&&j.has(c))return!1;let d=a.max_tokens??a.max_output_tokens??null;return"number"!=typeof d||!(d<32)}function l({model:a,body:b}){if(!k(b,a))return h.skipped++,null;let c=i({model:a,body:b}),d=g.get(c);return d?d.expiresAt<Date.now()?(g.delete(c),h.misses++,null):(g.delete(c),g.set(c,d),h.hits++,h.bytesSaved+=d.bodyBytes||0,h.tokensSaved+=d.estimatedTokens||0,d):(h.misses++,null)}function m({model:a,body:b,status:c,contentType:d,responseBody:e,estimatedTokens:f=0,ttlMs:h=3e5,maxEntries:j=500}){if(!k(b,a)||200!==c||!e||"string"==typeof e&&e.length<100)return!1;let l=i({model:a,body:b}),n="string"==typeof e?e:JSON.stringify(e),o={key:l,status:c,contentType:d||"application/json",body:n,bodyBytes:Buffer.byteLength(n,"utf-8"),estimatedTokens:f,expiresAt:Date.now()+h,storedAt:Date.now(),model:a};for(g.set(l,o);g.size>j;){let a=g.keys().next().value;if(void 0===a)break;g.delete(a)}return!0}function n(){let a=h.hits+h.misses;return{enabled:!0,entries:g.size,hits:h.hits,misses:h.misses,skipped:h.skipped,hitRate:a>0?h.hits/a:0,bytesSaved:h.bytesSaved,tokensSaved:h.tokensSaved,lastResetAt:h.lastResetAt}}function o(){g.clear(),h.hits=0,h.misses=0,h.skipped=0,h.bytesSaved=0,h.tokensSaved=0,h.lastResetAt=Date.now()}},24253:(a,b,c)=>{c.d(b,{I6:()=>n,Mo:()=>i,RG:()=>m,V:()=>j,Y8:()=>l,xl:()=>o});var d=c(1932),e=c(87155);let f=null,g=null,h=null;function i(){return g?{loaded:!0,version:g.version,loadedAt:g.loadedAt}:{loaded:!1}}async function j(){return g||h||(h=k().finally(()=>{h=null}))}async function k(){let a=(0,e.S1)();if(!a.installed){let a=Error("PXPIPE is not installed");throw a.code="NOT_INSTALLED",a}let b=`${(0,d.pathToFileURL)((0,e.CG)()).href}?v=${encodeURIComponent(a.version||"0")}`,c=await import(b);if("function"!=typeof c.transformAnthropicMessages)throw Error("installed pxpipe package does not export transformAnthropicMessages");return g={module:c,version:a.version,loadedAt:Date.now()}}function l(){let a=!!g;return g=null,a}async function m({autoLoad:a=!0}={}){try{if(!g&&!a)return null;let{module:b}=await j();return b.transformAnthropicMessages}catch{return null}}async function n(a){let b=Array.isArray(a)?a.map(a=>String(a).trim()).filter(Boolean):[],c=b.slice().sort().join(",");if(c!==f)try{if(!(0,e.S1)().installed)return;let a=await import((0,d.pathToFileURL)((0,e.kC)()).href);"function"==typeof a.setAllowedModelBases&&(a.setAllowedModelBases(b.length?b:null),f=c)}catch{}}async function o(){let a=Date.now(),{module:b}=await j(),c=new TextEncoder().encode(JSON.stringify({model:"claude-fable-5",max_tokens:16,messages:[{role:"user",content:"ping"}]})),d=await b.transformAnthropicMessages({body:c,model:"claude-fable-5"});if(!d||"boolean"!=typeof d.applied||!(d.body instanceof Uint8Array))throw Error("transform returned an unexpected shape");return{ok:!0,reason:d.reason,durationMs:Date.now()-a}}},38775:(a,b,c)=>{c.d(b,{d_:()=>k,mA:()=>j});var d=c(89718),e=c(40669),f=c(35024),g=c(44404);let h={xmtp:"xiaomi-tokenplan","xiaomi-tokenplan":"xiaomi-tokenplan"},i=new Set([...Object.keys(h),...Object.keys(f.xq),...Object.keys(g.Xg),...Object.values(g.Xg)]);async function j(a){let b,c=(b=(0,e.Xh)(a),b?.providerAlias&&h[b.providerAlias]?{...b,provider:h[b.providerAlias]}:b);if(!c.isAlias){if(!i.has(c.providerAlias)){let a=(await (0,d.Fh)({type:"openai-compatible"})).find(a=>a.prefix===c.providerAlias);if(a)return{provider:a.id,model:c.model};let b=(await (0,d.Fh)({type:"anthropic-compatible"})).find(a=>a.prefix===c.providerAlias);if(b)return{provider:b.id,model:c.model};let e=(await (0,d.Fh)({type:"custom-embedding"})).find(a=>a.prefix===c.providerAlias);if(e)return{provider:e.id,model:c.model}}return{provider:c.provider,model:c.model}}return await (0,d.Dj)(c.model)?{provider:null,model:c.model}:(0,e.js)(a,d.OM)}async function k(a){if(a.includes("/"))return null;let b=await (0,d.Dj)(a);return b&&b.models&&b.models.length>0?b.models:null}},74388:(a,b,c)=>{c.d(b,{Az:()=>l,SP:()=>o,T0:()=>k});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(87155);let i=g().join(h.XF,"events.jsonl"),j=g().join(h.XF,"events.jsonl.1");function k(a){try{e().existsSync(h.XF)||e().mkdirSync(h.XF,{recursive:!0});try{e().statSync(i).size>5242880&&e().renameSync(i,j)}catch{}e().appendFile(i,JSON.stringify({ts:Date.now(),...a})+"\n",()=>{})}catch{}}function l({sinceMs:a=null,limit:b=null}={}){let c=[];for(let b of[j,i])try{if(!e().existsSync(b))continue;for(let d of e().readFileSync(b,"utf8").split("\n"))if(d)try{let b=JSON.parse(d);if(a&&b.ts<a)continue;c.push(b)}catch{}}catch{}return c.sort((a,b)=>a.ts-b.ts),b?c.slice(-b):c}function m(){return{requests:0,compressed:0,bypassed:0,errors:0,tokensBeforeEst:0,tokensAfterEst:0,tokensSavedEst:0,savedPct:0,imagesGenerated:0,compressionTimeMs:0,avgCompressionMs:0}}function n(a,b){a.requests++,b.applied?(a.compressed++,a.tokensBeforeEst+=b.tokensBeforeEst||0,a.tokensAfterEst+=b.tokensAfterEst||0,a.tokensSavedEst+=b.tokensSavedEst||0,a.imagesGenerated+=b.imageCount||0,a.compressionTimeMs+=b.durationMs||0):"transform_error"===b.reason||"timeout"===b.reason?a.errors++:a.bypassed++}function o({timelineDays:a=30,recentLimit:b=100}={}){let c=l(),d=Date.now(),e=new Date(new Date(d).setHours(0,0,0,0)).getTime(),f={all:m(),today:m(),yesterday:m(),last7d:m(),last30d:m()},g=new Map;for(let b=a-1;b>=0;b--){let a=new Date(e-864e5*b);g.set(a.toISOString().slice(0,10),{date:a.toISOString().slice(0,10),tokensSavedEst:0,compressed:0,requests:0})}for(let a of c){n(f.all,a),a.ts>=e?n(f.today,a):a.ts>=e-864e5&&n(f.yesterday,a),a.ts>=d-6048e5&&n(f.last7d,a),a.ts>=d-2592e6&&n(f.last30d,a);let b=new Date(a.ts).toISOString().slice(0,10),c=g.get(b);c&&(c.requests++,a.applied&&(c.compressed++,c.tokensSavedEst+=a.tokensSavedEst||0))}for(let a of Object.values(f))a.savedPct=a.tokensBeforeEst>0?+(a.tokensSavedEst/a.tokensBeforeEst*100).toFixed(2):0,a.avgCompressionMs=a.compressed>0?Math.round(a.compressionTimeMs/a.compressed):0;return{windows:f,timeline:[...g.values()],recent:c.slice(-b).reverse()}}},79489:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{P:()=>z});var e=c(48895),f=c(80238),g=c(71750),h=c(89718),i=c(38775),j=c(92500),k=c(43659),l=c(38962),m=c(27349),n=c(24253),o=c(74388),p=c(9999),q=c(41004),r=c(53258),s=c(14170),t=c(7803),u=c(67828),v=c(38160),w=c(29385),x=a([e,j]);async function y(a){return a?.pxpipeEnabled?(await (0,n.I6)(a.pxpipeModels),(0,n.RG)()):null}async function z(a,b=null){let d;try{d=await a.json()}catch{return t.warn("CHAT","Invalid JSON body"),(0,k.yj)(q.gx.BAD_REQUEST,"Invalid JSON body")}b||(b={endpoint:new URL(a.url).pathname,body:d,headers:Object.fromEntries(a.headers.entries())}),(0,g.n)(b.headers);let e=new URL(a.url),j=d.model,n=d.messages?.length||d.input?.length||0,o=d.tools?.length||0,r=d.reasoning_effort||d.reasoning?.effort||null;t.request("POST",`${e.pathname} | ${j} | ${n} msgs${o?` | ${o} tools`:""}${r?` | effort=${r}`:""}`);let s=a.headers.get("Authorization"),u=(0,f.Tr)(a);if(s&&u){let a=t.maskKey(u);t.debug("AUTH",`API Key: ${a}`)}else t.debug("AUTH","No API key provided (local mode)");let v=await (0,h.mt)();if(v.requireApiKey){if(!u)return t.warn("AUTH","Missing API key (requireApiKey=true)"),(0,k.yj)(q.gx.UNAUTHORIZED,"Missing API key");if(!await (0,f.kI)(u))return t.warn("AUTH","Invalid API key (requireApiKey=true)"),(0,k.yj)(q.gx.UNAUTHORIZED,"Invalid API key")}if(!j)return t.warn("CHAT","Missing model"),(0,k.yj)(q.gx.BAD_REQUEST,"Missing model");try{let{classifyPromptIntent:a}=await c.e(9849).then(c.bind(c,49849)),{classifyRequestComplexity:b}=await c.e(3523).then(c.bind(c,23523)),e=(d?.messages||[]).find(a=>a?.role==="user"),f="string"==typeof e?.content?e.content:Array.isArray(e?.content)&&e.content.find(a=>a?.text)?.text||"",g=(d?.messages||[]).find(a=>a?.role==="system"),h="string"==typeof g?.content?g.content:"",i=a(f,h),j=b(d);t.debug("ROUTING",`intent=${i} | complexity=${j.level} score=${j.score} tier=${j.recommendedTier}${j.hasToolUse?" tools=yes":""}`)}catch(a){t.debug("ROUTING",`classify failed: ${a?.message}`)}let w=a?.headers?.get("user-agent")||"",x=(0,m.c)(d,j,w,!!v.ccFilterNaming);if(x)return x.response||x;if(v.responseCacheEnabled){let a=(0,p.$S)({model:j,body:d});if(a)return t.info("CHAT",`[CACHE HIT] ${j} (${a.bodyBytes}B saved)`),new Response(a.body,{status:a.status,headers:{"Content-Type":a.contentType,"X-Cache":"HIT","X-Cache-Age-Ms":String(Date.now()-a.storedAt)}})}let y=await (0,i.d_)(j);if(y){let c=v.comboStrategies||{},e=c[j]?.fallbackStrategy||v.comboStrategy||"fallback";if("fusion"===e)return t.info("CHAT",`Combo "${j}" with ${y.length} models (strategy: fusion)`),(0,l.vt)({body:d,models:y,handleSingleModel:(c,d)=>A(c,d,b,a,u,v,1),log:t,comboName:j,judgeModel:c[j]?.judgeModel,tuning:c[j]?.fusionTuning});let f=v.comboStickyRoundRobinLimit;return t.info("CHAT",`Combo "${j}" with ${y.length} models (strategy: ${e}, sticky: ${f})`),(0,l.Pr)({body:d,models:y,handleSingleModel:(c,d)=>A(c,d,b,a,u,v,1),log:t,comboName:j,comboStrategy:e,comboStickyLimit:f})}return A(d,j,b,a,u,v,0)}async function A(a,b,c=null,d=null,e=null,g=null,m=0){g||(g=await (0,h.mt)());let n=await (0,i.mA)(b);if(!n.provider){let f=await (0,i.d_)(b);if(f){if(m>=3)return t.warn("CHAT",`Combo recursion limit hit for "${b}" at depth ${m} — refusing to dispatch`),(0,k.yj)(q.gx.BAD_REQUEST,`Combo recursion limit (3) exceeded for "${b}"`);let h=g.comboStrategies||{},i=h[b]?.fallbackStrategy||g.comboStrategy||"fallback";if("fusion"===i)return t.info("CHAT",`Combo "${b}" with ${f.length} models (strategy: fusion, depth: ${m})`),(0,l.vt)({body:a,models:f,handleSingleModel:(a,b)=>A(a,b,c,d,e,g,m+1),log:t,comboName:b,judgeModel:h[b]?.judgeModel,tuning:h[b]?.fusionTuning});let j=g.comboStickyRoundRobinLimit;return t.info("CHAT",`Combo "${b}" with ${f.length} models (strategy: ${i}, sticky: ${j}, depth: ${m})`),(0,l.Pr)({body:a,models:f,handleSingleModel:(a,b)=>A(a,b,c,d,e,g,m+1),log:t,comboName:b,comboStrategy:i,comboStickyLimit:j})}return t.warn("CHAT","Invalid model format",{model:b}),(0,k.yj)(q.gx.BAD_REQUEST,"Invalid model format")}let{provider:x,model:z}=n;b!==`${x}/${z}`?t.info("ROUTING",`${b} → ${x}/${z}`):t.info("ROUTING",`Provider: ${x}, Model: ${z}`);let B=d?.headers?.get("user-agent")||"",C=d?.headers?.get("x-bypass-modellock")==="1",D=new Set,E=null,F=null,G=(g.providerStrategies||{})[x]||{},H="round-robin"===G.fallbackStrategy,I=(0,w.bI)(a,{provider:x}),J=!H&&I?(0,w.Wq)(I):null;for(;;){let h=await (0,f.c1)(x,D,z,{bypassModelLock:C,preferredConnectionId:J&&!D.has(J)?J:null});if(!h||h.allRateLimited){if(h?.allRateLimited){let a=E||h.lastError||"Unavailable",b=F||Number(h.lastErrorCode)||q.gx.SERVICE_UNAVAILABLE;return t.warn("CHAT",`[${x}/${z}] ${a} (${h.retryAfterHuman})`),(0,k.wO)(b,`[${x}/${z}] ${a}`,h.retryAfter,h.retryAfterHuman)}if(0===D.size)return t.warn("AUTH",`No active credentials for provider: ${x}`),(0,k.yj)(q.gx.SERVICE_UNAVAILABLE,`No active credentials for provider: ${x}`);return t.warn("CHAT","No more accounts available",{provider:x}),(0,k.yj)(F||q.gx.SERVICE_UNAVAILABLE,E||"All accounts unavailable")}t.info("AUTH",`\x1b[32mUsing ${x} account: ${h.connectionName}\x1b[0m`);let i=await (0,u.eU)(x,h);if(("antigravity"===x||"gemini-cli"===x)&&!i.projectId){let a=await (0,v.eG)(h.connectionId,i.accessToken);a&&(i.projectId=a,(0,u.vN)(h.connectionId,{projectId:a}).catch(()=>{}))}let l=(g.providerThinking||{})[x]||null,m=Date.now(),n=await (0,j.w)({body:{...a,model:`${x}/${z}`},modelInfo:{provider:x,model:z},credentials:i,log:t,clientRawRequest:c,connectionId:h.connectionId,userAgent:B,apiKey:e,ccFilterNaming:!!g.ccFilterNaming,rtkEnabled:!!g.rtkEnabled,cavemanEnabled:!!g.cavemanEnabled,cavemanLevel:g.cavemanLevel||"full",ponytailEnabled:!!g.ponytailEnabled,ponytailLevel:g.ponytailLevel||"full",pxpipeEnabled:!!g.pxpipeEnabled,pxpipeMinChars:g.pxpipeMinChars,pxpipeTimeoutMs:g.pxpipeTimeoutMs,pxpipeTransform:await y(g),onPxpipeEvent:o.T0,providerThinking:l,settings:g,sourceFormatOverride:d?.url?(0,s.t)(new URL(d.url).pathname,a):null,onCredentialsRefreshed:async a=>{await (0,u.vN)(h.connectionId,{...a,existingProviderSpecificData:h.providerSpecificData,testStatus:"active"})},onRequestSuccess:async()=>{await (0,f.Pt)(h.connectionId,h,z)}});if((0,r.Up)(h.connectionId,!!n.success,Date.now()-m,{provider:x,model:z,strategy:"zenith"}),n.success){if(!H&&I&&h.connectionId&&(0,w.BO)(I,h.connectionId),g.responseCacheEnabled&&!0!==a.stream)try{let c=n.response.clone(),d=c.headers.get("content-type")||"application/json";c.text().then(e=>{(0,p.$T)({model:b,body:a,status:c.status,contentType:d,responseBody:e,estimatedTokens:Math.ceil(e.length/4),ttlMs:1e3*(g.responseCacheTtlSec||300)})}).catch(()=>{})}catch{}return n.response}if(n.emergencyFallback&&!a.__emergencyFallbackUsed){let b=n.emergencyFallback;t.info("EMERGENCY",`${x}/${z} → ${b.provider}/${b.model} (${b.reason})`);try{let h=await (0,f.c1)(b.provider,new Set,b.model);if(h&&!h.allRateLimited){let f={...a,__emergencyFallbackUsed:!0,model:`${b.provider}/${b.model}`};b.maxOutputTokens&&(f.max_tokens=Math.min(f.max_tokens||b.maxOutputTokens,b.maxOutputTokens));let i=await (0,j.w)({body:f,modelInfo:{provider:b.provider,model:b.model},credentials:h,log:t,clientRawRequest:c,userAgent:B,apiKey:e,connectionId:h.connectionId,ccFilterNaming:!!g.ccFilterNaming,rtkEnabled:!!g.rtkEnabled,cavemanEnabled:!!g.cavemanEnabled,cavemanLevel:g.cavemanLevel||"full",ponytailEnabled:!!g.ponytailEnabled,ponytailLevel:g.ponytailLevel||"full",pxpipeEnabled:!!g.pxpipeEnabled,pxpipeMinChars:g.pxpipeMinChars,pxpipeTimeoutMs:g.pxpipeTimeoutMs,pxpipeTransform:await y(g),onPxpipeEvent:o.T0,providerThinking:(g.providerThinking||{})[b.provider]||null,sourceFormatOverride:d?.url?(0,s.t)(new URL(d.url).pathname,a):null,settings:g});if(i.success)return i.response;t.warn("EMERGENCY",`fallback ${b.provider}/${b.model} also failed: ${i.status}`)}else t.warn("EMERGENCY",`no credentials for fallback ${b.provider}, skipping`)}catch(a){t.warn("EMERGENCY",`fallback path threw: ${a.message}`)}}let{shouldFallback:A}=await (0,f.vk)(h.connectionId,n.status,n.error,x,z,n.resetsAtMs);if(A){t.warn("AUTH",`Account ${h.connectionName} unavailable (${n.status}), trying fallback`),D.add(h.connectionId),E=n.error,F=n.status;continue}return n.response}}[e,j]=x.then?(await x)():x,d()}catch(a){d(a)}})},87155:(a,b,c)=>{c.d(b,{CG:()=>q,ED:()=>v,S1:()=>t,XF:()=>j,_g:()=>u,kC:()=>r,no:()=>s,sW:()=>x});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(79646),i=c(49120);let j=g().join(i.n,"pxpipe"),k="pxpipe-proxy",l=g().join(j,"install.log"),m="win32"===process.platform,n=[...m?[`${process.env.ProgramFiles||""}\\nodejs`,`${process.env.APPDATA||""}\\npm`]:["/usr/local/bin","/opt/homebrew/bin",`${process.env.HOME||""}/.local/bin`,"/usr/bin","/bin"],process.env.PATH||""].filter(Boolean).join(g().delimiter),o=null;function p(){return g().join(j,"node_modules",k)}function q(){return g().join(p(),"dist","core","library.js")}function r(){return g().join(p(),"dist","core","applicability.js")}function s(){try{let a=(0,h.execSync)(`${m?"where":"which"} npm`,{stdio:["ignore","pipe","ignore"],windowsHide:!0,env:{...process.env,PATH:n}}).toString().trim();return a?a.split(/\r?\n/)[0].trim():null}catch{return null}}function t(){try{let a=g().join(p(),"package.json");if(!e().existsSync(a)||!e().existsSync(q()))return{installed:!1,version:null,path:null};let b=JSON.parse(e().readFileSync(a,"utf8"));return{installed:!0,version:b.version||null,path:p()}}catch{return{installed:!1,version:null,path:null}}}function u(){return null!==o}function v(){return o||(o=w().finally(()=>{o=null}))}async function w(){let a=s();if(!a){let a=Error("npm not found on PATH — Node.js/npm is required to install PXPIPE");throw a.code="NPM_NOT_FOUND",a}e().existsSync(j)||e().mkdirSync(j,{recursive:!0});let b=g().join(j,"package.json");e().existsSync(b)||e().writeFileSync(b,JSON.stringify({name:"9router-pxpipe-host",private:!0},null,2));let c=e().openSync(l,"a");e().writeSync(c,`
2
2
  [${new Date().toISOString()}] npm install ${k}@latest
3
- `),await new Promise((b,d)=>{let e=(0,h.spawn)(a,["install",`${k}@latest`,"--no-audit","--no-fund","--omit=dev"],{cwd:j,stdio:["ignore",c,c],windowsHide:!0,env:{...process.env,PATH:n}}),f=setTimeout(()=>{e.kill("SIGKILL"),d(Error("npm install timed out after 5 minutes — see install.log"))},3e5);e.once("error",a=>{clearTimeout(f),d(a)}),e.once("exit",a=>{clearTimeout(f),0===a?b():d(Error(`npm install exited with code ${a} — see install.log`))})}).finally(()=>e().closeSync(c));let d=s();if(!d.installed)throw Error("install finished but package is missing — see install.log");return d}function w(a=200){try{if(!e().existsSync(l))return"";return e().readFileSync(l,"utf8").split(/\r?\n/).filter(Boolean).slice(-a).join("\n")}catch{return""}}}};
3
+ `),await new Promise((b,d)=>{let e=(0,h.spawn)(a,["install",`${k}@latest`,"--no-audit","--no-fund","--omit=dev"],{cwd:j,stdio:["ignore",c,c],windowsHide:!0,env:{...process.env,PATH:n}}),f=setTimeout(()=>{e.kill("SIGKILL"),d(Error("npm install timed out after 5 minutes — see install.log"))},3e5);e.once("error",a=>{clearTimeout(f),d(a)}),e.once("exit",a=>{clearTimeout(f),0===a?b():d(Error(`npm install exited with code ${a} — see install.log`))})}).finally(()=>e().closeSync(c));let d=t();if(!d.installed)throw Error("install finished but package is missing — see install.log");return d}function x(a=200){try{if(!e().existsSync(l))return"";return e().readFileSync(l,"utf8").split(/\r?\n/).filter(Boolean).slice(-a).join("\n")}catch{return""}}}};
@@ -1 +1 @@
1
- globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/5HBIq4jyylYlDb9lMtDIi/_buildManifest.js","static/5HBIq4jyylYlDb9lMtDIi/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-9b32012c794c6add.js","static/chunks/4bd1b696-e356ca5ba0218e27.js","static/chunks/3794-e569667691edc8f7.js","static/chunks/main-app-ab5d6b7f8bfbd85e.js"],rootMainFilesTree:{},pages:{"/_app":[]}};
1
+ globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/dQT84PkQ8Jxtq9s6IM1j4/_buildManifest.js","static/dQT84PkQ8Jxtq9s6IM1j4/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-9b32012c794c6add.js","static/chunks/4bd1b696-e356ca5ba0218e27.js","static/chunks/3794-e569667691edc8f7.js","static/chunks/main-app-ab5d6b7f8bfbd85e.js"],rootMainFilesTree:{},pages:{"/_app":[]}};