@jheavenknows/bluerouter 5.2.64 → 5.2.66

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 (378) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +5 -5
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/server/app/(dashboard)/dashboard/ai-power-index/page_client-reference-manifest.js +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page_client-reference-manifest.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/model-profiles/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cluster/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/local-ai-report/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovider/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovidermonitor/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalquota/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/resource-monitor/page.js +11 -4
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/resource-monitor/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  46. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  47. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  48. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  49. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  50. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  52. package/app/.next-cli-build/server/app/_not-found.rsc +5 -5
  53. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
  54. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -5
  55. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  56. package/app/.next-cli-build/server/app/api/auth/ldap/test/route.js.nft.json +1 -1
  57. package/app/.next-cli-build/server/app/api/auth/ldap/users/route.js.nft.json +1 -1
  58. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  60. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  61. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  63. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/api/branding/[asset]/route.js.nft.json +1 -1
  65. package/app/.next-cli-build/server/app/api/branding/route.js.nft.json +1 -1
  66. package/app/.next-cli-build/server/app/api/branding/upload/route.js.nft.json +1 -1
  67. package/app/.next-cli-build/server/app/api/cli-model-profiles/cloud-models/route.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/api/cli-model-profiles/route.js.nft.json +1 -1
  69. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  70. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/autostart/route.js.nft.json +1 -1
  72. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/prompt-log-db/route.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/root-ca/route.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  75. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/api/cluster/config/route.js.nft.json +1 -1
  78. package/app/.next-cli-build/server/app/api/cluster/heartbeat/route.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/api/cluster/peers/[id]/command/route.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/api/cluster/peers/[id]/route.js.nft.json +1 -1
  81. package/app/.next-cli-build/server/app/api/cluster/peers/route.js.nft.json +1 -1
  82. package/app/.next-cli-build/server/app/api/cluster/snapshot/route.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/api/cluster/sync/route.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/api/cluster/test/route.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/api/dashboard/ai-power-index/route.js.nft.json +1 -1
  88. package/app/.next-cli-build/server/app/api/dashboard/analytics/ai-models/route.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/api/dashboard/analytics/analyze/route.js.nft.json +1 -1
  90. package/app/.next-cli-build/server/app/api/dashboard/analytics/route.js.nft.json +1 -1
  91. package/app/.next-cli-build/server/app/api/dashboard/combos/route.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/api/dashboard/endpoint/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/dashboard/local-ai-report/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/[id]/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/options/route.js.nft.json +1 -1
  96. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/dashboard/token-saver/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/keys/[id]/caveman-test/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  113. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  115. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/api-key-models/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/import-models/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/models/[...routeModel]/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/usage/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/personal-cloud-providers/client/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/personal-cloud-providers/monitor/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/personal-cloud-providers/permissions/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/personal-cloud-providers/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/personal-cloud-providers/routing/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/pricing/catalog/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/pricing/recalculate/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/provider-health/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  144. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  147. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/resource-monitor/[id]/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/resource-monitor/ai-models/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/resource-monitor/analyze/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/resource-monitor/history/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/resource-monitor/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  165. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  166. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/tunnel/tailscale-login/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/tunnel/tailscale-start-daemon/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  202. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  204. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  206. package/app/.next-cli-build/server/app/callback.html +1 -1
  207. package/app/.next-cli-build/server/app/callback.rsc +5 -5
  208. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +5 -5
  209. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  210. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +5 -5
  211. package/app/.next-cli-build/server/app/dashboard/ai-power-index.html +1 -1
  212. package/app/.next-cli-build/server/app/dashboard/ai-power-index.rsc +6 -6
  213. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/!KGRhc2hib2FyZCk/dashboard/ai-power-index/__PAGE__.segment.rsc +6 -6
  214. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/_full.segment.rsc +6 -6
  215. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/_tree.segment.rsc +1 -1
  216. package/app/.next-cli-build/server/app/dashboard/analytics.html +1 -1
  217. package/app/.next-cli-build/server/app/dashboard/analytics.rsc +6 -6
  218. package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics/__PAGE__.segment.rsc +6 -6
  219. package/app/.next-cli-build/server/app/dashboard/analytics.segments/_full.segment.rsc +6 -6
  220. package/app/.next-cli-build/server/app/dashboard/analytics.segments/_tree.segment.rsc +1 -1
  221. package/app/.next-cli-build/server/app/dashboard/api-keys.html +1 -1
  222. package/app/.next-cli-build/server/app/dashboard/api-keys.rsc +8 -8
  223. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys/__PAGE__.segment.rsc +8 -8
  224. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_full.segment.rsc +8 -8
  225. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_tree.segment.rsc +1 -1
  226. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  227. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +7 -7
  228. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +7 -7
  229. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +7 -7
  230. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  231. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.html +1 -1
  232. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.rsc +7 -7
  233. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/model-profiles/__PAGE__.segment.rsc +7 -7
  234. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/_full.segment.rsc +7 -7
  235. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/_tree.segment.rsc +1 -1
  236. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  237. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +7 -7
  238. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +7 -7
  239. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
  240. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  241. package/app/.next-cli-build/server/app/dashboard/cluster.html +1 -1
  242. package/app/.next-cli-build/server/app/dashboard/cluster.rsc +6 -6
  243. package/app/.next-cli-build/server/app/dashboard/cluster.segments/!KGRhc2hib2FyZCk/dashboard/cluster/__PAGE__.segment.rsc +6 -6
  244. package/app/.next-cli-build/server/app/dashboard/cluster.segments/_full.segment.rsc +6 -6
  245. package/app/.next-cli-build/server/app/dashboard/cluster.segments/_tree.segment.rsc +1 -1
  246. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  247. package/app/.next-cli-build/server/app/dashboard/combos.rsc +7 -7
  248. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +7 -7
  249. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
  250. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  251. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  252. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +7 -7
  253. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +7 -7
  254. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
  255. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  256. package/app/.next-cli-build/server/app/dashboard/local-ai-report.html +1 -1
  257. package/app/.next-cli-build/server/app/dashboard/local-ai-report.rsc +6 -6
  258. package/app/.next-cli-build/server/app/dashboard/local-ai-report.segments/!KGRhc2hib2FyZCk/dashboard/local-ai-report/__PAGE__.segment.rsc +6 -6
  259. package/app/.next-cli-build/server/app/dashboard/local-ai-report.segments/_full.segment.rsc +6 -6
  260. package/app/.next-cli-build/server/app/dashboard/local-ai-report.segments/_tree.segment.rsc +1 -1
  261. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  262. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +7 -7
  263. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +7 -7
  264. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +7 -7
  265. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  266. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  267. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +7 -7
  268. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +7 -7
  269. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +7 -7
  270. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  271. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  272. package/app/.next-cli-build/server/app/dashboard/profile.rsc +7 -7
  273. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +7 -7
  274. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
  275. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  276. package/app/.next-cli-build/server/app/dashboard/prompt-logs.html +1 -1
  277. package/app/.next-cli-build/server/app/dashboard/prompt-logs.rsc +6 -6
  278. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs/__PAGE__.segment.rsc +6 -6
  279. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_full.segment.rsc +6 -6
  280. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_tree.segment.rsc +1 -1
  281. package/app/.next-cli-build/server/app/dashboard/provider-health.html +1 -1
  282. package/app/.next-cli-build/server/app/dashboard/provider-health.rsc +6 -6
  283. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health/__PAGE__.segment.rsc +6 -6
  284. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_full.segment.rsc +6 -6
  285. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_tree.segment.rsc +1 -1
  286. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  287. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +7 -7
  288. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +7 -7
  289. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
  290. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  291. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  292. package/app/.next-cli-build/server/app/dashboard/providers.rsc +7 -7
  293. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +7 -7
  294. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
  295. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  296. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  297. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +7 -7
  298. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +7 -7
  299. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -7
  300. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  301. package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  302. package/app/.next-cli-build/server/app/dashboard/quota.rsc +8 -8
  303. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +8 -8
  304. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +8 -8
  305. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  306. package/app/.next-cli-build/server/app/dashboard/resource-monitor.html +1 -1
  307. package/app/.next-cli-build/server/app/dashboard/resource-monitor.rsc +7 -7
  308. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/!KGRhc2hib2FyZCk/dashboard/resource-monitor/__PAGE__.segment.rsc +7 -7
  309. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/_full.segment.rsc +7 -7
  310. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/_tree.segment.rsc +1 -1
  311. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  312. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +6 -6
  313. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +6 -6
  314. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +6 -6
  315. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  316. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  317. package/app/.next-cli-build/server/app/dashboard/skills.rsc +7 -7
  318. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +7 -7
  319. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +7 -7
  320. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  321. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  322. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
  323. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +6 -6
  324. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  325. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  326. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  327. package/app/.next-cli-build/server/app/dashboard/translator.rsc +7 -7
  328. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +7 -7
  329. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +7 -7
  330. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  331. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  332. package/app/.next-cli-build/server/app/dashboard/usage.rsc +7 -7
  333. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +7 -7
  334. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
  335. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  336. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  337. package/app/.next-cli-build/server/app/dashboard.rsc +7 -7
  338. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +7 -7
  339. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +7 -7
  340. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  341. package/app/.next-cli-build/server/app/index.html +1 -1
  342. package/app/.next-cli-build/server/app/index.rsc +5 -5
  343. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +5 -5
  344. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +5 -5
  345. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  346. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  347. package/app/.next-cli-build/server/app/landing.html +1 -1
  348. package/app/.next-cli-build/server/app/landing.rsc +5 -5
  349. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
  350. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  351. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +5 -5
  352. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  353. package/app/.next-cli-build/server/app/login.html +1 -1
  354. package/app/.next-cli-build/server/app/login.rsc +6 -6
  355. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +6 -6
  356. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  357. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +6 -6
  358. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  359. package/app/.next-cli-build/server/app-paths-manifest.json +5 -5
  360. package/app/.next-cli-build/server/chunks/3110.js +1 -1
  361. package/app/.next-cli-build/server/chunks/4746.js +1 -1
  362. package/app/.next-cli-build/server/chunks/6328.js +1 -1
  363. package/app/.next-cli-build/server/chunks/6759.js +1 -1
  364. package/app/.next-cli-build/server/chunks/6811.js +1 -1
  365. package/app/.next-cli-build/server/chunks/7478.js +257 -52
  366. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  367. package/app/.next-cli-build/server/pages/404.html +1 -1
  368. package/app/.next-cli-build/server/pages/500.html +1 -1
  369. package/app/.next-cli-build/static/chunks/{5263-af988354b69d51af.js → 5263-6a8e6891c8539833.js} +1 -1
  370. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/resource-monitor/template-242512623b234cbb.js +47 -0
  371. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/upgrade-5.2.63-to-5.2.64-5.2.64-20260813-155705/data.sqlite +0 -0
  372. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/upgrade-5.2.64-to-5.2.65-5.2.65-20260813-161747/data.sqlite +0 -0
  373. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite +0 -0
  374. package/app/package.json +1 -1
  375. package/package.json +1 -1
  376. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/resource-monitor/template-5098beee04073e9d.js +0 -39
  377. /package/app/.next-cli-build/static/{e-OmSLzZVG_gAV18Tsiq5 → pYxEv0SqQ62JV673mWiaH}/_buildManifest.js +0 -0
  378. /package/app/.next-cli-build/static/{e-OmSLzZVG_gAV18Tsiq5 → pYxEv0SqQ62JV673mWiaH}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";exports.id=6811,exports.ids=[6811],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":`Bluerouter/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"bluerouter","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,{UY:()=>h,X3:()=>i,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g});var d=c(39006),e=c(75681),f=c(81329);d.rE;let g={npmPackageName:"@jheavenknows/bluerouter",installCmd:"npm i -g @jheavenknows/bluerouter",installCmdLatest:"npm install -g @jheavenknows/bluerouter@latest",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={maxLines:200,pollIntervalMs:1e3},i={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","alims-intl":"https://dashscope-intl.aliyuncs.com/compatible-mode/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:"5.2.64"}},66811:(a,b,c)=>{c.d(b,{F:()=>s});var d=c(89718),e=c(39326),f=c(74926),g=c(75681),h=c(30869),i=c(44404),j=c(35024),k=c(92990),l=c(15626);let m={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","User-Agent":"codex-cli/1.0.18 (macOS; arm64)"},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":"Bluerouter",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},"kimi-coding":{checkExpiry:!0,refreshable:!1},cursor:{tokenExists:!0},kilocode:{url:`${k.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:{tokenExists:!0}};async function n(a){return await fetch("https://api.cline.bot/api/v1/users/me",{method:"GET",headers:(0,l.w$)(a,{Accept:"application/json"})})}async function o(a){let b=a.provider,c=a.refreshToken;if(!c)return null;try{if("gemini-cli"===b||"antigravity"===b){let a="gemini-cli"===b?k.LT:k.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){let a=await fetch(k.DI.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"refresh_token",client_id:k.DI.clientId,refresh_token:c})});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("claude"===b){let a=await fetch(k.OV.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:c,client_id:k.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(k.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(k.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:k.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(k.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 p(a,b=null){var c;let d=m[a.provider];if(!d)return{valid:!1,error:"Provider test not supported",refreshed:!1};if(!a.accessToken)return{valid:!1,error:"No access token",refreshed:!1};if(d.tokenExists)return{valid:!0,error:null,refreshed:!1,newTokens:null};let e=a.accessToken,f=!1,g=null,h=!!(c=a).expiresAt&&new Date(c.expiresAt).getTime()<=Date.now()+3e5;if(d.refreshable&&h&&a.refreshToken){let b=await o(a);if(!b)return{valid:!1,error:"Token expired and refresh failed",refreshed:!1};e=b.accessToken,f=!0,g=b}if(d.checkExpiry)return f?{valid:!0,error:null,refreshed:f,newTokens:g}:h?{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 n(a);return b.ok?{valid:!0,error:null,refreshed:f,newTokens:g}:401===b.status?{valid:!1,error:"Token invalid or revoked",refreshed:f}:403===b.status?{valid:!1,error:"Access denied",refreshed:f}:{valid:!1,error:`API returned ${b.status}`,refreshed:f}},c=await b(e);if(c.valid||"Token invalid or revoked"!==c.error||!a.refreshToken)return c;let d=await o(a);return d?.accessToken?(f=!0,g=d,e=d.accessToken,await b(e)):{valid:!1,error:"Token invalid or revoked",refreshed:!1}}try{let c=d.buildUrl?d.buildUrl(e):d.url,h=d.noAuth?{...d.extraHeaders}:{[d.authHeader]:`${d.authPrefix}${e}`,...d.extraHeaders},i={method:d.method,headers:h};d.body&&(i.body=d.body);let j=await q(c,i,b);if(j.ok||d.acceptStatuses&&d.acceptStatuses.includes(j.status))return{valid:!0,error:null,refreshed:f,newTokens:g};if(401===j.status&&d.refreshable&&!f&&a.refreshToken){let e=await o(a);if(e){let a=d.buildUrl?d.buildUrl(e.accessToken):c,f=d.noAuth?{...d.extraHeaders}:{[d.authHeader]:`${d.authPrefix}${e.accessToken}`,...d.extraHeaders},g={method:d.method,headers:f};d.body&&(g.body=d.body);let h=await q(a,g,b);if(h.ok||d.acceptStatuses&&d.acceptStatuses.includes(h.status))return{valid:!0,error:null,refreshed:!0,newTokens:e}}return{valid:!1,error:"Token invalid or revoked",refreshed:!1}}if(401===j.status)return{valid:!1,error:"Token invalid or revoked",refreshed:f};if(403===j.status)return{valid:!1,error:"Access denied",refreshed:f};return{valid:!1,error:`API returned ${j.status}`,refreshed:f}}catch(a){return{valid:!1,error:a.message,refreshed:f}}}async function q(a,b={},d=null){if(d?.vercelRelayUrl){let{proxyAwareFetch:e}=await c.e(9609).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 c.e(9609).then(c.bind(c,39609));return e(a,b,{connectionProxyEnabled:!0,connectionProxyUrl:d.connectionProxyUrl,connectionNoProxy:d.connectionNoProxy||""})}async function r(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 q(`${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=await q(`${c}/models`,{headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01",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}}}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 q(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 q(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 q("https://api.openai.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 q("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 q("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 q(`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 q("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 q("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 q("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 q({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 q("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":case"alims-intl":{let c="alicode-intl"===a.provider?"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions":"alims-intl"===a.provider?"https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions":"https://coding.dashscope.aliyuncs.com/v1/chat/completions",d=await q(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 q(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 q("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 q("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 q("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 q("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 q("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 q("https://api.perplexity.ai/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"together":{let c=await q("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 q("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 q("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 q("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 q("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 q("https://api.siliconflow.cn/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"hyperbolic":{let c=await q("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 q("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 q("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 q("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 q("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 q("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 q("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 q("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"}}default:return{valid:!1,error:"Provider test not supported"}}}catch(a){return{valid:!1,error:a.message}}}async function s(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 r(c,g):await p(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()};return b.refreshed&&b.newTokens&&(j.accessToken=b.newTokens.accessToken,b.newTokens.refreshToken&&(j.refreshToken=b.newTokens.refreshToken),b.newTokens.expiresIn&&(j.expiresAt=new Date(Date.now()+1e3*b.newTokens.expiresIn).toISOString())),await (0,d.updateProviderConnection)(a,j),{valid:b.valid,error:b.error,latencyMs:i,testedAt:new Date().toISOString()}}},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":"Bluerouter"}});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{}}}},92990:(a,b,c)=>{c.d(b,{DI:()=>g,Hp:()=>i,LT:()=>h,MZ:()=>r,Nl:()=>u,Nu:()=>n,OV:()=>f,Tx:()=>o,WN:()=>p,Ww:()=>v,YT:()=>l,ZL:()=>k,cD:()=>m,f7:()=>t,hF:()=>j,lB:()=>s,t:()=>q});var d=c(21820);function e(){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 f={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"},g={clientId:"app_EMoamEEZ73f0CkXaXp7hrann",authorizeUrl:"https://auth.openai.com/oauth/authorize",tokenUrl:"https://auth.openai.com/oauth/token",revocationUrl:"https://auth.openai.com/api/accounts/oauth/revoke",scope:"openid profile email offline_access",codeChallengeMethod:"S256",extraParams:{id_token_add_organizations:"true",codex_cli_simplified_flow:"true",originator:"codex_cli_rs"}},h={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"]},i={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"},j={apiBaseUrl:"https://api2.qoder.sh",deviceTokenUrl:"https://api2.qoder.sh/api/v1/deviceToken/poll",deviceRefreshUrl:"https://api2.qoder.sh/api/v1/deviceToken/refresh",refreshUrl:"https://api2.qoder.sh/api/v3/user/refresh_token",userInfoUrl:"https://api2.qoder.sh/api/v1/userinfo",statusUrl:"https://api2.qoder.sh/api/v3/user/status",loginUrl:"https://qoder.com/login"},k={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"}},l={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",revocationUrl:"https://oauth2.googleapis.com/revoke",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:e(),pluginType:2})};function m(){return{ideType:9,platform:e(),pluginType:2}}let n={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"},o={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",authMethods:["builder-id","idc","google","github","import"]},p={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"}},q={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"},r={apiBaseUrl:"https://api.kilo.ai",initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},s={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"},t={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},u={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},v=3e5}};
1
+ "use strict";exports.id=6811,exports.ids=[6811],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":`Bluerouter/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"bluerouter","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,{UY:()=>h,X3:()=>i,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g});var d=c(39006),e=c(75681),f=c(81329);d.rE;let g={npmPackageName:"@jheavenknows/bluerouter",installCmd:"npm i -g @jheavenknows/bluerouter",installCmdLatest:"npm install -g @jheavenknows/bluerouter@latest",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={maxLines:200,pollIntervalMs:1e3},i={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","alims-intl":"https://dashscope-intl.aliyuncs.com/compatible-mode/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:"5.2.66"}},66811:(a,b,c)=>{c.d(b,{F:()=>s});var d=c(89718),e=c(39326),f=c(74926),g=c(75681),h=c(30869),i=c(44404),j=c(35024),k=c(92990),l=c(15626);let m={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","User-Agent":"codex-cli/1.0.18 (macOS; arm64)"},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":"Bluerouter",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},"kimi-coding":{checkExpiry:!0,refreshable:!1},cursor:{tokenExists:!0},kilocode:{url:`${k.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:{tokenExists:!0}};async function n(a){return await fetch("https://api.cline.bot/api/v1/users/me",{method:"GET",headers:(0,l.w$)(a,{Accept:"application/json"})})}async function o(a){let b=a.provider,c=a.refreshToken;if(!c)return null;try{if("gemini-cli"===b||"antigravity"===b){let a="gemini-cli"===b?k.LT:k.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){let a=await fetch(k.DI.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"refresh_token",client_id:k.DI.clientId,refresh_token:c})});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("claude"===b){let a=await fetch(k.OV.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:c,client_id:k.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(k.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(k.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:k.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(k.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 p(a,b=null){var c;let d=m[a.provider];if(!d)return{valid:!1,error:"Provider test not supported",refreshed:!1};if(!a.accessToken)return{valid:!1,error:"No access token",refreshed:!1};if(d.tokenExists)return{valid:!0,error:null,refreshed:!1,newTokens:null};let e=a.accessToken,f=!1,g=null,h=!!(c=a).expiresAt&&new Date(c.expiresAt).getTime()<=Date.now()+3e5;if(d.refreshable&&h&&a.refreshToken){let b=await o(a);if(!b)return{valid:!1,error:"Token expired and refresh failed",refreshed:!1};e=b.accessToken,f=!0,g=b}if(d.checkExpiry)return f?{valid:!0,error:null,refreshed:f,newTokens:g}:h?{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 n(a);return b.ok?{valid:!0,error:null,refreshed:f,newTokens:g}:401===b.status?{valid:!1,error:"Token invalid or revoked",refreshed:f}:403===b.status?{valid:!1,error:"Access denied",refreshed:f}:{valid:!1,error:`API returned ${b.status}`,refreshed:f}},c=await b(e);if(c.valid||"Token invalid or revoked"!==c.error||!a.refreshToken)return c;let d=await o(a);return d?.accessToken?(f=!0,g=d,e=d.accessToken,await b(e)):{valid:!1,error:"Token invalid or revoked",refreshed:!1}}try{let c=d.buildUrl?d.buildUrl(e):d.url,h=d.noAuth?{...d.extraHeaders}:{[d.authHeader]:`${d.authPrefix}${e}`,...d.extraHeaders},i={method:d.method,headers:h};d.body&&(i.body=d.body);let j=await q(c,i,b);if(j.ok||d.acceptStatuses&&d.acceptStatuses.includes(j.status))return{valid:!0,error:null,refreshed:f,newTokens:g};if(401===j.status&&d.refreshable&&!f&&a.refreshToken){let e=await o(a);if(e){let a=d.buildUrl?d.buildUrl(e.accessToken):c,f=d.noAuth?{...d.extraHeaders}:{[d.authHeader]:`${d.authPrefix}${e.accessToken}`,...d.extraHeaders},g={method:d.method,headers:f};d.body&&(g.body=d.body);let h=await q(a,g,b);if(h.ok||d.acceptStatuses&&d.acceptStatuses.includes(h.status))return{valid:!0,error:null,refreshed:!0,newTokens:e}}return{valid:!1,error:"Token invalid or revoked",refreshed:!1}}if(401===j.status)return{valid:!1,error:"Token invalid or revoked",refreshed:f};if(403===j.status)return{valid:!1,error:"Access denied",refreshed:f};return{valid:!1,error:`API returned ${j.status}`,refreshed:f}}catch(a){return{valid:!1,error:a.message,refreshed:f}}}async function q(a,b={},d=null){if(d?.vercelRelayUrl){let{proxyAwareFetch:e}=await c.e(9609).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 c.e(9609).then(c.bind(c,39609));return e(a,b,{connectionProxyEnabled:!0,connectionProxyUrl:d.connectionProxyUrl,connectionNoProxy:d.connectionNoProxy||""})}async function r(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 q(`${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=await q(`${c}/models`,{headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01",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}}}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 q(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 q(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 q("https://api.openai.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 q("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 q("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 q(`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 q("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 q("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 q("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 q({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 q("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":case"alims-intl":{let c="alicode-intl"===a.provider?"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions":"alims-intl"===a.provider?"https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions":"https://coding.dashscope.aliyuncs.com/v1/chat/completions",d=await q(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 q(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 q("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 q("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 q("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 q("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 q("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 q("https://api.perplexity.ai/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"together":{let c=await q("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 q("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 q("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 q("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 q("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 q("https://api.siliconflow.cn/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"hyperbolic":{let c=await q("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 q("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 q("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 q("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 q("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 q("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 q("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 q("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"}}default:return{valid:!1,error:"Provider test not supported"}}}catch(a){return{valid:!1,error:a.message}}}async function s(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 r(c,g):await p(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()};return b.refreshed&&b.newTokens&&(j.accessToken=b.newTokens.accessToken,b.newTokens.refreshToken&&(j.refreshToken=b.newTokens.refreshToken),b.newTokens.expiresIn&&(j.expiresAt=new Date(Date.now()+1e3*b.newTokens.expiresIn).toISOString())),await (0,d.updateProviderConnection)(a,j),{valid:b.valid,error:b.error,latencyMs:i,testedAt:new Date().toISOString()}}},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":"Bluerouter"}});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{}}}},92990:(a,b,c)=>{c.d(b,{DI:()=>g,Hp:()=>i,LT:()=>h,MZ:()=>r,Nl:()=>u,Nu:()=>n,OV:()=>f,Tx:()=>o,WN:()=>p,Ww:()=>v,YT:()=>l,ZL:()=>k,cD:()=>m,f7:()=>t,hF:()=>j,lB:()=>s,t:()=>q});var d=c(21820);function e(){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 f={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"},g={clientId:"app_EMoamEEZ73f0CkXaXp7hrann",authorizeUrl:"https://auth.openai.com/oauth/authorize",tokenUrl:"https://auth.openai.com/oauth/token",revocationUrl:"https://auth.openai.com/api/accounts/oauth/revoke",scope:"openid profile email offline_access",codeChallengeMethod:"S256",extraParams:{id_token_add_organizations:"true",codex_cli_simplified_flow:"true",originator:"codex_cli_rs"}},h={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"]},i={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"},j={apiBaseUrl:"https://api2.qoder.sh",deviceTokenUrl:"https://api2.qoder.sh/api/v1/deviceToken/poll",deviceRefreshUrl:"https://api2.qoder.sh/api/v1/deviceToken/refresh",refreshUrl:"https://api2.qoder.sh/api/v3/user/refresh_token",userInfoUrl:"https://api2.qoder.sh/api/v1/userinfo",statusUrl:"https://api2.qoder.sh/api/v3/user/status",loginUrl:"https://qoder.com/login"},k={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"}},l={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",revocationUrl:"https://oauth2.googleapis.com/revoke",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:e(),pluginType:2})};function m(){return{ideType:9,platform:e(),pluginType:2}}let n={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"},o={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",authMethods:["builder-id","idc","google","github","import"]},p={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"}},q={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"},r={apiBaseUrl:"https://api.kilo.ai",initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},s={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"},t={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},u={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},v=3e5}};
@@ -20,10 +20,11 @@ from urllib.request import ProxyHandler, Request, build_opener
20
20
 
21
21
  PORT = int(os.environ.get("AGENT_PORT", "19998"))
22
22
  TOKEN = os.environ.get("AGENT_TOKEN", "")
23
- AGENT_VERSION = "2.0.0"
23
+ AGENT_VERSION = "2.2.0"
24
24
  NETWORK_SAMPLE = None
25
25
  VLLM_DISCOVERY_AT = 0.0
26
- VLLM_TARGETS = {}
26
+ VLLM_TARGETS = []
27
+ VLLM_DISCOVERY_MODE = "none"
27
28
  VLLM_DISCOVERY_INTERVAL = 30.0
28
29
  VLLM_MAX_DISCOVERY_PORTS = 64
29
30
  HTTP_OPENER = build_opener(ProxyHandler({}))
@@ -199,6 +200,8 @@ def parse_vllm_metrics(text):
199
200
  values = {
200
201
  "running": [],
201
202
  "waiting": [],
203
+ "waitingCapacity": [],
204
+ "waitingDeferred": [],
202
205
  "kv": [],
203
206
  "preemptions": [],
204
207
  }
@@ -223,7 +226,17 @@ def parse_vllm_metrics(text):
223
226
  name = token.split("{", 1)[0]
224
227
  if name.startswith("vllm:"):
225
228
  found_vllm = True
226
- key = aliases.get(name)
229
+
230
+ if name == "vllm:num_requests_waiting_by_reason":
231
+ if 'reason="capacity"' in token:
232
+ key = "waitingCapacity"
233
+ elif 'reason="deferred"' in token:
234
+ key = "waitingDeferred"
235
+ else:
236
+ key = None
237
+ else:
238
+ key = aliases.get(name)
239
+
227
240
  if not key:
228
241
  continue
229
242
  value = metric_float(columns[1])
@@ -237,47 +250,60 @@ def parse_vllm_metrics(text):
237
250
  return None
238
251
  running = sum(values["running"]) if values["running"] else 0
239
252
  waiting = sum(values["waiting"]) if values["waiting"] else 0
253
+ waiting_capacity = sum(values["waitingCapacity"]) if values["waitingCapacity"] else 0
254
+ waiting_deferred = sum(values["waitingDeferred"]) if values["waitingDeferred"] else 0
240
255
  kv = max(values["kv"]) if values["kv"] else None
241
256
  preemptions = sum(values["preemptions"]) if values["preemptions"] else 0
242
257
  return {
243
258
  "running": round(running, 2),
244
259
  "waiting": round(waiting, 2),
260
+ "waitingCapacity": round(waiting_capacity, 2),
261
+ "waitingDeferred": round(waiting_deferred, 2),
245
262
  "kvCacheUsagePercent": round(kv * 100, 1) if kv is not None else None,
246
263
  "preemptions": round(preemptions, 2),
247
264
  "models": sorted(models),
248
265
  }
249
266
 
250
267
 
251
- def probe_vllm_target(port, hosts, timeout=0.45):
268
+ def http_vllm_metrics(host, port, timeout=0.6):
269
+ url_host = "[%s]" % host if ":" in host else host
270
+ try:
271
+ request = Request(
272
+ "http://%s:%d/metrics" % (url_host, int(port)),
273
+ headers={"User-Agent": "BlueRouter-Resource-Agent/%s" % AGENT_VERSION},
274
+ )
275
+ with HTTP_OPENER.open(request, timeout=timeout) as response:
276
+ if response.status != 200:
277
+ return None
278
+ text = response.read(6 * 1024 * 1024).decode("utf-8", errors="ignore")
279
+ return parse_vllm_metrics(text)
280
+ except Exception:
281
+ return None
282
+
283
+
284
+ def probe_socket_target(port, hosts, timeout=0.45):
252
285
  for host in hosts or ["127.0.0.1", "::1"]:
253
- url_host = "[%s]" % host if ":" in host else host
254
- try:
255
- request = Request(
256
- "http://%s:%d/metrics" % (url_host, port),
257
- headers={"User-Agent": "BlueRouter-Resource-Agent/%s" % AGENT_VERSION},
258
- )
259
- with HTTP_OPENER.open(request, timeout=timeout) as response:
260
- if response.status != 200:
261
- continue
262
- text = response.read(6 * 1024 * 1024).decode("utf-8", errors="ignore")
263
- metrics = parse_vllm_metrics(text)
264
- if metrics is None:
265
- continue
266
- metrics.update({"port": port, "probeHost": host})
267
- return metrics
268
- except Exception:
286
+ metrics = http_vllm_metrics(host, port, timeout)
287
+ if metrics is None:
269
288
  continue
289
+ metrics.update({
290
+ "port": int(port),
291
+ "endpoint": "%s:%d" % (host, int(port)),
292
+ "metricsAvailable": True,
293
+ "discovery": "socket",
294
+ })
295
+ return metrics
270
296
  return None
271
297
 
272
298
 
273
- def scrape_vllm_targets(targets, timeout):
299
+ def scrape_socket_targets(targets, timeout):
274
300
  if not targets:
275
301
  return []
276
302
  items = list(targets.items())
277
303
  results = []
278
304
  with ThreadPoolExecutor(max_workers=min(8, len(items))) as pool:
279
305
  futures = {
280
- pool.submit(probe_vllm_target, port, hosts, timeout): (port, hosts)
306
+ pool.submit(probe_socket_target, port, hosts, timeout): (port, hosts)
281
307
  for port, hosts in items
282
308
  }
283
309
  for future in as_completed(futures):
@@ -290,52 +316,231 @@ def scrape_vllm_targets(targets, timeout):
290
316
  return sorted(results, key=lambda item: item.get("port", 0))
291
317
 
292
318
 
319
+ def docker_command_tokens(config):
320
+ tokens = []
321
+ for value in (config.get("Entrypoint"), config.get("Cmd")):
322
+ if isinstance(value, list):
323
+ tokens.extend(str(item) for item in value if item is not None)
324
+ elif value:
325
+ tokens.append(str(value))
326
+ return tokens
327
+
328
+
329
+ def docker_service_port(config):
330
+ tokens = docker_command_tokens(config)
331
+ for index, token in enumerate(tokens):
332
+ if token == "--port" and index + 1 < len(tokens):
333
+ try: return int(tokens[index + 1])
334
+ except Exception: pass
335
+ if token.startswith("--port="):
336
+ try: return int(token.split("=", 1)[1])
337
+ except Exception: pass
338
+ return 8000
339
+
340
+
341
+ def add_endpoint(endpoints, seen, host, port, kind):
342
+ try:
343
+ port = int(port)
344
+ except Exception:
345
+ return
346
+ host = str(host or "").strip()
347
+ if not host or port <= 0 or port > 65535:
348
+ return
349
+ key = (host, port)
350
+ if key in seen:
351
+ return
352
+ seen.add(key)
353
+ endpoints.append({"host": host, "port": port, "kind": kind})
354
+
355
+
356
+ def docker_vllm_targets():
357
+ if not shutil.which("docker"):
358
+ return []
359
+ container_ids = [item.strip() for item in cmd(["docker", "ps", "-q"], 5).splitlines() if item.strip()]
360
+ if not container_ids:
361
+ return []
362
+ raw = cmd(["docker", "inspect"] + container_ids[:128], 10)
363
+ if not raw:
364
+ return []
365
+ try:
366
+ containers = json.loads(raw)
367
+ except Exception:
368
+ return []
369
+
370
+ targets = []
371
+ for item in containers:
372
+ config = item.get("Config") or {}
373
+ host_config = item.get("HostConfig") or {}
374
+ network = item.get("NetworkSettings") or {}
375
+ name = str(item.get("Name") or "").lstrip("/")
376
+ image = str(config.get("Image") or "")
377
+ labels = config.get("Labels") or {}
378
+ tokens = docker_command_tokens(config)
379
+ identity = " ".join([
380
+ name,
381
+ image,
382
+ " ".join(tokens),
383
+ " ".join("%s=%s" % (key, value) for key, value in labels.items()),
384
+ ]).lower()
385
+ if "vllm" not in identity:
386
+ continue
387
+
388
+ service_port = docker_service_port(config)
389
+ internal_ports = {service_port}
390
+ for key in (config.get("ExposedPorts") or {}).keys():
391
+ try: internal_ports.add(int(str(key).split("/", 1)[0]))
392
+ except Exception: pass
393
+ for key in (network.get("Ports") or {}).keys():
394
+ try: internal_ports.add(int(str(key).split("/", 1)[0]))
395
+ except Exception: pass
396
+
397
+ endpoints = []
398
+ seen = set()
399
+ network_mode = str(host_config.get("NetworkMode") or "")
400
+
401
+ if network_mode == "host":
402
+ add_endpoint(endpoints, seen, "127.0.0.1", service_port, "host-network")
403
+
404
+ for port_key, bindings in (network.get("Ports") or {}).items():
405
+ if not bindings:
406
+ continue
407
+ for binding in bindings:
408
+ host_port = binding.get("HostPort")
409
+ host_ip = str(binding.get("HostIp") or "127.0.0.1")
410
+ if host_ip in ("0.0.0.0", "::", ""):
411
+ host_ip = "127.0.0.1"
412
+ add_endpoint(endpoints, seen, host_ip, host_port, "published")
413
+
414
+ for network_info in (network.get("Networks") or {}).values():
415
+ ip = str((network_info or {}).get("IPAddress") or "").strip()
416
+ if not ip:
417
+ continue
418
+ for internal_port in sorted(internal_ports):
419
+ add_endpoint(endpoints, seen, ip, internal_port, "container-ip")
420
+
421
+ add_endpoint(endpoints, seen, "127.0.0.1", service_port, "localhost-fallback")
422
+ targets.append({
423
+ "containerId": str(item.get("Id") or "")[:12],
424
+ "containerName": name or str(item.get("Id") or "")[:12],
425
+ "image": image,
426
+ "servicePort": service_port,
427
+ "endpoints": endpoints,
428
+ })
429
+
430
+ return targets
431
+
432
+
433
+ def probe_docker_target(target, timeout=0.7):
434
+ result = {
435
+ "containerId": target.get("containerId"),
436
+ "containerName": target.get("containerName"),
437
+ "image": target.get("image"),
438
+ "port": target.get("servicePort") or 8000,
439
+ "metricsAvailable": False,
440
+ "discovery": "docker",
441
+ "running": 0,
442
+ "waiting": 0,
443
+ "waitingCapacity": 0,
444
+ "waitingDeferred": 0,
445
+ "kvCacheUsagePercent": None,
446
+ "preemptions": 0,
447
+ "models": [],
448
+ }
449
+ for endpoint in target.get("endpoints") or []:
450
+ metrics = http_vllm_metrics(endpoint.get("host"), endpoint.get("port"), timeout)
451
+ if metrics is None:
452
+ continue
453
+ result.update(metrics)
454
+ result.update({
455
+ "port": int(endpoint.get("port") or target.get("servicePort") or 8000),
456
+ "endpoint": "%s:%d" % (endpoint.get("host"), int(endpoint.get("port"))),
457
+ "endpointKind": endpoint.get("kind"),
458
+ "metricsAvailable": True,
459
+ })
460
+ break
461
+ return result
462
+
463
+
464
+ def scrape_docker_targets(targets, timeout=0.7):
465
+ if not targets:
466
+ return []
467
+ results = []
468
+ with ThreadPoolExecutor(max_workers=min(8, len(targets))) as pool:
469
+ futures = [pool.submit(probe_docker_target, target, timeout) for target in targets]
470
+ for future in as_completed(futures):
471
+ try:
472
+ results.append(future.result())
473
+ except Exception:
474
+ pass
475
+ return sorted(results, key=lambda item: (item.get("containerName") or "", item.get("containerId") or ""))
476
+
477
+
293
478
  def vllm_status():
294
- global VLLM_DISCOVERY_AT, VLLM_TARGETS
479
+ global VLLM_DISCOVERY_AT, VLLM_TARGETS, VLLM_DISCOVERY_MODE
295
480
  current = time.monotonic()
296
481
  full_discovery = current - VLLM_DISCOVERY_AT >= VLLM_DISCOVERY_INTERVAL
297
482
 
298
483
  if full_discovery:
299
- candidates = listening_targets()
300
- known_ports = set(VLLM_TARGETS)
301
- ordered = sorted(
302
- candidates.items(),
303
- key=lambda item: (
304
- 0 if item[0] in known_ports else 1,
305
- 0 if 7000 <= item[0] <= 9999 else 1,
306
- item[0],
307
- ),
308
- )[:VLLM_MAX_DISCOVERY_PORTS]
309
- candidates = dict(ordered)
310
- instances = scrape_vllm_targets(candidates, 0.35)
311
- VLLM_TARGETS = {
312
- int(instance["port"]): [instance.get("probeHost") or "127.0.0.1"]
313
- for instance in instances
314
- }
484
+ docker_targets = docker_vllm_targets()
485
+ if docker_targets:
486
+ VLLM_TARGETS = docker_targets
487
+ VLLM_DISCOVERY_MODE = "docker"
488
+ instances = scrape_docker_targets(VLLM_TARGETS, 0.7)
489
+ else:
490
+ candidates = listening_targets()
491
+ ordered = sorted(
492
+ candidates.items(),
493
+ key=lambda item: (0 if 7000 <= item[0] <= 9999 else 1, item[0]),
494
+ )[:VLLM_MAX_DISCOVERY_PORTS]
495
+ VLLM_TARGETS = [
496
+ {"port": port, "hosts": hosts}
497
+ for port, hosts in ordered
498
+ ]
499
+ VLLM_DISCOVERY_MODE = "socket"
500
+ instances = scrape_socket_targets(
501
+ {target["port"]: target["hosts"] for target in VLLM_TARGETS},
502
+ 0.35,
503
+ )
504
+ VLLM_TARGETS = [
505
+ {"port": instance.get("port"), "hosts": [str(instance.get("endpoint") or "127.0.0.1").rsplit(":", 1)[0]]}
506
+ for instance in instances
507
+ if instance.get("port")
508
+ ]
315
509
  VLLM_DISCOVERY_AT = current
510
+ elif VLLM_DISCOVERY_MODE == "docker":
511
+ instances = scrape_docker_targets(VLLM_TARGETS, 0.7)
512
+ elif VLLM_DISCOVERY_MODE == "socket":
513
+ instances = scrape_socket_targets(
514
+ {target["port"]: target.get("hosts") or ["127.0.0.1"] for target in VLLM_TARGETS},
515
+ 0.7,
516
+ )
316
517
  else:
317
- instances = scrape_vllm_targets(VLLM_TARGETS, 0.7)
318
-
319
- for instance in instances:
320
- instance.pop("probeHost", None)
321
-
322
- running = sum(float(instance.get("running") or 0) for instance in instances)
323
- waiting = sum(float(instance.get("waiting") or 0) for instance in instances)
324
- preemptions = sum(float(instance.get("preemptions") or 0) for instance in instances)
518
+ instances = []
519
+
520
+ available = [instance for instance in instances if instance.get("metricsAvailable") is not False]
521
+ running = sum(float(instance.get("running") or 0) for instance in available)
522
+ waiting = sum(float(instance.get("waiting") or 0) for instance in available)
523
+ waiting_capacity = sum(float(instance.get("waitingCapacity") or 0) for instance in available)
524
+ waiting_deferred = sum(float(instance.get("waitingDeferred") or 0) for instance in available)
525
+ preemptions = sum(float(instance.get("preemptions") or 0) for instance in available)
325
526
  kv_values = [
326
527
  float(instance["kvCacheUsagePercent"])
327
- for instance in instances
528
+ for instance in available
328
529
  if instance.get("kvCacheUsagePercent") is not None
329
530
  ]
330
531
  return {
331
532
  "instances": instances,
332
533
  "summary": {
333
534
  "instanceCount": len(instances),
535
+ "metricsInstanceCount": len(available),
334
536
  "running": round(running, 2),
335
537
  "waiting": round(waiting, 2),
538
+ "waitingCapacity": round(waiting_capacity, 2),
539
+ "waitingDeferred": round(waiting_deferred, 2),
336
540
  "kvCacheUsagePercent": round(max(kv_values), 1) if kv_values else None,
337
541
  "preemptions": round(preemptions, 2),
338
542
  },
543
+ "discovery": VLLM_DISCOVERY_MODE,
339
544
  "discoveryIntervalSeconds": int(VLLM_DISCOVERY_INTERVAL),
340
545
  }
341
546
 
@@ -421,14 +626,14 @@ for _ in range(20):
421
626
  with urlopen(req, timeout=3) as res:
422
627
  if res.status == 200:
423
628
  payload = res.read().decode("utf-8", errors="ignore")
424
- if '"agentVersion": "2.0.0"' in payload:
425
- print("Agent local token + vLLM monitor check: ok")
629
+ if '"agentVersion": "2.2.0"' in payload:
630
+ print("Agent local token + vLLM waiting-reason monitor check: ok")
426
631
  sys.exit(0)
427
632
  except Exception:
428
633
  time.sleep(0.5)
429
- print("Agent local token + vLLM monitor check: failed", file=sys.stderr)
634
+ print("Agent local token + vLLM waiting-reason monitor check: failed", file=sys.stderr)
430
635
  sys.exit(1)
431
636
  PY_VERIFY
432
- echo "BlueRouter Resource Agent v2.0.0 installed on port ${Number(a.agentPort)}"
637
+ echo "BlueRouter Resource Agent v2.2.0 installed on port ${Number(a.agentPort)}"
433
638
  `),l=h?`${j}
434
639
  ${k}`:k,m=["-p",String(a.sshPort||22),"-o","StrictHostKeyChecking=accept-new","-o","ConnectTimeout=12",d,h?"sudo -S -p '' bash -s":"bash -s"];return i?f("sshpass",["-e","ssh","-o","PreferredAuthentications=password,keyboard-interactive","-o","PubkeyAuthentication=no","-o","NumberOfPasswordPrompts=1",...m],{input:l,env:{SSHPASS:i}}):f("ssh",m,{input:l})}async function h(a){let b=await fetch(`http://${a.host}:${a.agentPort}/status`,{headers:{Authorization:`Bearer ${a.agentToken}`},cache:"no-store",signal:AbortSignal.timeout(7e3)});if(!b.ok){let a=await b.text().catch(()=>"");if(401===b.status)throw Error("Agent returned HTTP 401: token dashboard kh\xf4ng khớp với token agent. H\xe3y c\xe0i lại agent từ n\xfat sửa server.");throw Error(`Agent returned HTTP ${b.status}${a?`: ${a.slice(0,200)}`:""}`)}return b.json()}},62763:(a,b,c)=>{c.d(b,{Jc:()=>r,NY:()=>w,Q1:()=>s,WR:()=>v,X_:()=>u,gX:()=>t});var d=c(77598),e=c.n(d),f=c(51455),g=c.n(f),h=c(76760),i=c.n(h),j=c(49120);let k=i().join(j.DATA_DIR,"cluster-config.json"),l=new Set(["standalone","master","slave"]),m="__blueRouterClusterConfigMutation",n={version:1,nodeId:"",role:"standalone",enabled:!1,masterUrl:"",syncToken:"",intervalMinutes:5,lastAttemptAt:null,lastSyncAt:null,lastSnapshotHash:"",lastError:"",lastResult:null,commandAck:null};function o(a={}){let b=l.has(a.role)?a.role:"standalone";return{...n,...a,version:1,nodeId:String(a.nodeId||"").trim()||e().randomUUID(),role:b,enabled:!0===a.enabled,masterUrl:function(a){let b=String(a||"").trim().replace(/\/+$/,"");if(!b)return"";let c=new URL(b);if(!["http:","https:"].includes(c.protocol))throw Error("Master URL must use http:// or https://");if(c.username||c.password)throw Error("Master URL must not contain credentials");return c.toString().replace(/\/+$/,"")}(a.masterUrl),syncToken:String(a.syncToken||"").trim(),intervalMinutes:Math.min(1440,Math.max(1,Number(a.intervalMinutes)||5))}}async function p(a){await g().mkdir(j.DATA_DIR,{recursive:!0});let b=`${k}.${process.pid}.${e().randomUUID()}.tmp`;try{await g().writeFile(b,JSON.stringify(a,null,2),{mode:384}),await g().rename(b,k)}catch(a){throw await g().unlink(b).catch(()=>{}),a}}function q(a){let b=(globalThis[m]||Promise.resolve()).then(a,a);return globalThis[m]=b.catch(()=>{}),b}async function r({includeSecrets:a=!1}={}){let b={};try{b=JSON.parse(await g().readFile(k,"utf8"))}catch(a){a?.code!=="ENOENT"&&console.warn("[cluster] failed to read config:",a?.message||a)}let c=o(b);if(b.nodeId||await p(c),a)return c;let{syncToken:d,...e}=c;return{...e,hasSyncToken:!!c.syncToken}}async function s(a={}){if(!a||"object"!=typeof a||Array.isArray(a))throw Error("Invalid cluster config payload");return q(async()=>{let b=await r({includeSecrets:!0}),c={};for(let b of["role","enabled","masterUrl","syncToken","intervalMinutes"])Object.prototype.hasOwnProperty.call(a,b)&&(c[b]=a[b]);let d=o({...b,...c});if("master"!==d.role||d.syncToken||(d.syncToken=e().randomBytes(32).toString("base64url")),d.enabled&&"slave"===d.role){if(!d.masterUrl)throw Error("Master URL is required for Standby mode");if(!d.syncToken)throw Error("Sync token is required for Standby mode")}return await p(d),d})}async function t(){return q(async()=>{let a={...await r({includeSecrets:!0}),syncToken:e().randomBytes(32).toString("base64url")};return await p(a),a})}async function u(a={}){return q(async()=>{let b=await r({includeSecrets:!0}),c=o({...b,...a,nodeId:b.nodeId,role:b.role,enabled:b.enabled,masterUrl:b.masterUrl,syncToken:b.syncToken,intervalMinutes:b.intervalMinutes});return await p(c),c})}async function v(){return"slave"===(await r({includeSecrets:!0})).role}function w(a,b){let c=Buffer.from(String(a||"")),d=Buffer.from(String(b||""));return c.length>0&&c.length===d.length&&e().timingSafeEqual(c,d)}}};
@@ -1 +1 @@
1
- globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/e-OmSLzZVG_gAV18Tsiq5/_buildManifest.js","static/e-OmSLzZVG_gAV18Tsiq5/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-7f2a8541ddb15fce.js","static/chunks/4bd1b696-8a4ab4fdf0ae305a.js","static/chunks/3794-d7cddff008311ab3.js","static/chunks/main-app-eacc433ef218cf40.js"],rootMainFilesTree:{},pages:{"/_app":[]}};
1
+ globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/pYxEv0SqQ62JV673mWiaH/_buildManifest.js","static/pYxEv0SqQ62JV673mWiaH/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-7f2a8541ddb15fce.js","static/chunks/4bd1b696-8a4ab4fdf0ae305a.js","static/chunks/3794-d7cddff008311ab3.js","static/chunks/main-app-eacc433ef218cf40.js"],rootMainFilesTree:{},pages:{"/_app":[]}};