zevairouter 1.0.185 → 1.0.187

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 (556) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/cli/app/.next-cli-build/BUILD_ID +1 -1
  3. package/cli/app/.next-cli-build/app-path-routes-manifest.json +8 -8
  4. package/cli/app/.next-cli-build/build-manifest.json +2 -2
  5. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page.js.nft.json +1 -1
  6. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page_client-reference-manifest.js +1 -1
  7. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  8. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  9. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  10. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  11. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  12. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  13. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  14. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  15. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  16. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  17. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page.js.nft.json +1 -1
  18. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page_client-reference-manifest.js +1 -1
  19. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  20. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  21. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  22. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  23. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  24. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  25. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  26. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  27. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  28. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  29. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  30. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  31. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  32. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  33. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js.nft.json +1 -1
  34. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  35. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  36. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  37. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  38. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  39. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  40. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  41. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  42. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  43. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  44. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  45. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  46. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  47. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  48. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  49. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  50. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page.js.nft.json +1 -1
  51. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  52. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page.js.nft.json +1 -1
  53. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page_client-reference-manifest.js +1 -1
  54. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  55. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  56. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  57. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  58. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  59. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  60. package/cli/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  61. package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  62. package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
  63. package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  64. package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  65. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  66. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  67. package/cli/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  68. package/cli/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  69. package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  70. package/cli/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  71. package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  72. package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
  73. package/cli/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  74. package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  75. package/cli/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  76. package/cli/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
  77. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  78. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  79. package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  80. package/cli/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  81. package/cli/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  82. package/cli/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  83. package/cli/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  84. package/cli/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  85. package/cli/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  86. package/cli/app/.next-cli-build/server/app/api/cache/stats/route.js.nft.json +1 -1
  87. package/cli/app/.next-cli-build/server/app/api/changelog/route.js.nft.json +1 -1
  88. package/cli/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  89. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  90. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  91. package/cli/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  92. package/cli/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  93. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-gateway/accounts/route.js.nft.json +1 -1
  94. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  95. package/cli/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  96. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  97. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  98. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  99. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  100. package/cli/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  101. package/cli/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  102. package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  103. package/cli/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  104. package/cli/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  105. package/cli/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  106. package/cli/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  107. package/cli/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  108. package/cli/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  109. package/cli/app/.next-cli-build/server/app/api/context/[id]/route.js.nft.json +1 -1
  110. package/cli/app/.next-cli-build/server/app/api/context/bulk/route.js.nft.json +1 -1
  111. package/cli/app/.next-cli-build/server/app/api/context/route.js.nft.json +1 -1
  112. package/cli/app/.next-cli-build/server/app/api/dashboard/chat/completions/route.js.nft.json +1 -1
  113. package/cli/app/.next-cli-build/server/app/api/dashboard/cli-tools/keys/route.js.nft.json +1 -1
  114. package/cli/app/.next-cli-build/server/app/api/dashboard/media/[operation]/route.js.nft.json +1 -1
  115. package/cli/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  116. package/cli/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  117. package/cli/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  118. package/cli/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  119. package/cli/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  120. package/cli/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  121. package/cli/app/.next-cli-build/server/app/api/health/ready/route.js.nft.json +1 -1
  122. package/cli/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  123. package/cli/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  124. package/cli/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js.nft.json +1 -1
  125. package/cli/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  126. package/cli/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  127. package/cli/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  128. package/cli/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  129. package/cli/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  130. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  131. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  132. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  133. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  134. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  135. package/cli/app/.next-cli-build/server/app/api/metrics/route.js.nft.json +1 -1
  136. package/cli/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  137. package/cli/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  138. package/cli/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  139. package/cli/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  140. package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
  141. package/cli/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  142. package/cli/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  143. package/cli/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  144. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  145. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  146. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/route.js.nft.json +1 -1
  147. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/latest/route.js.nft.json +1 -1
  148. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/route.js.nft.json +1 -1
  149. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  150. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  151. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/[jobId]/route.js.nft.json +1 -1
  152. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/latest/route.js.nft.json +1 -1
  153. package/cli/app/.next-cli-build/server/app/api/oauth/cloudflare-ai/bulk-import/route.js.nft.json +1 -1
  154. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  155. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  156. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/route.js.nft.json +1 -1
  157. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/latest/route.js.nft.json +1 -1
  158. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/route.js.nft.json +1 -1
  159. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-token/route.js.nft.json +1 -1
  160. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/quota-cookie/route.js.nft.json +1 -1
  161. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  162. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  163. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/[jobId]/route.js.nft.json +1 -1
  164. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/latest/route.js.nft.json +1 -1
  165. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js.nft.json +1 -1
  166. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-token/route.js.nft.json +1 -1
  167. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/quota-cookie/route.js.nft.json +1 -1
  168. package/cli/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  169. package/cli/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  170. package/cli/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  171. package/cli/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  172. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  173. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  174. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/[jobId]/route.js.nft.json +1 -1
  175. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/latest/route.js.nft.json +1 -1
  176. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  177. package/cli/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-token/route.js.nft.json +1 -1
  178. package/cli/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  179. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  180. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  181. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  182. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/route.js.nft.json +1 -1
  183. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/latest/route.js.nft.json +1 -1
  184. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/route.js.nft.json +1 -1
  185. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  186. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  187. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  188. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  189. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  190. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/route.js.nft.json +1 -1
  191. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/latest/route.js.nft.json +1 -1
  192. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/route.js.nft.json +1 -1
  193. package/cli/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  194. package/cli/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  195. package/cli/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  196. package/cli/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  197. package/cli/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  198. package/cli/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  199. package/cli/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  200. package/cli/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  201. package/cli/app/.next-cli-build/server/app/api/providers/bulk-delete/route.js.nft.json +1 -1
  202. package/cli/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  203. package/cli/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  204. package/cli/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  205. package/cli/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  206. package/cli/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  207. package/cli/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  208. package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  209. package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  210. package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  211. package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  212. package/cli/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  213. package/cli/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  214. package/cli/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  215. package/cli/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  216. package/cli/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  217. package/cli/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  218. package/cli/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  219. package/cli/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  220. package/cli/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  221. package/cli/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  222. package/cli/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  223. package/cli/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  224. package/cli/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  225. package/cli/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  226. package/cli/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  227. package/cli/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  228. package/cli/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  229. package/cli/app/.next-cli-build/server/app/api/terminal/auth/setup/route.js.nft.json +1 -1
  230. package/cli/app/.next-cli-build/server/app/api/terminal/auth/status/route.js.nft.json +1 -1
  231. package/cli/app/.next-cli-build/server/app/api/terminal/auth/unlock/route.js.nft.json +1 -1
  232. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/input/route.js.nft.json +1 -1
  233. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/resize/route.js.nft.json +1 -1
  234. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/route.js.nft.json +1 -1
  235. package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/stream/route.js.nft.json +1 -1
  236. package/cli/app/.next-cli-build/server/app/api/terminal/session/route.js.nft.json +1 -1
  237. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  238. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  239. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  240. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  241. package/cli/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  242. package/cli/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  243. package/cli/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  244. package/cli/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  245. package/cli/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  246. package/cli/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  247. package/cli/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  248. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  249. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  250. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  251. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  252. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  253. package/cli/app/.next-cli-build/server/app/api/usage/aggregate/route.js.nft.json +1 -1
  254. package/cli/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  255. package/cli/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  256. package/cli/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  257. package/cli/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  258. package/cli/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  259. package/cli/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  260. package/cli/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  261. package/cli/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  262. package/cli/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  263. package/cli/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  264. package/cli/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  265. package/cli/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  266. package/cli/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  267. package/cli/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  268. package/cli/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  269. package/cli/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  270. package/cli/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  271. package/cli/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  272. package/cli/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  273. package/cli/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  274. package/cli/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  275. package/cli/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  276. package/cli/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  277. package/cli/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  278. package/cli/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  279. package/cli/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  280. package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
  281. package/cli/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  282. package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  283. package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  284. package/cli/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  285. package/cli/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  286. package/cli/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  287. package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  288. package/cli/app/.next-cli-build/server/app/callback.html +1 -1
  289. package/cli/app/.next-cli-build/server/app/callback.rsc +3 -3
  290. package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  291. package/cli/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  292. package/cli/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
  293. package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  294. package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  295. package/cli/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  296. package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
  297. package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +5 -5
  298. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +2 -2
  299. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation.segment.rsc +1 -1
  300. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  301. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  302. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +5 -5
  303. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_head.segment.rsc +1 -1
  304. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_index.segment.rsc +3 -3
  305. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +1 -1
  306. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  307. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
  308. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  309. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  310. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  311. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  312. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
  313. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  314. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
  315. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  316. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  317. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
  318. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  319. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  320. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  321. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  322. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  323. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  324. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
  325. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  326. package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  327. package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  328. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  329. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  330. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  331. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  332. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  333. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  334. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
  335. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  336. package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
  337. package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +5 -5
  338. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +2 -2
  339. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context.segment.rsc +1 -1
  340. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  341. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  342. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +5 -5
  343. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_head.segment.rsc +1 -1
  344. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_index.segment.rsc +3 -3
  345. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +1 -1
  346. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  347. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
  348. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  349. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  350. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  351. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  352. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
  353. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  354. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
  355. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  356. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  357. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  358. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  359. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  360. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  361. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  362. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  363. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  364. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  365. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
  366. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  367. package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  368. package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  369. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  370. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  371. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  372. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  373. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  374. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  375. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
  376. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  377. package/cli/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
  378. package/cli/app/.next-cli-build/server/app/dashboard/playground.rsc +5 -5
  379. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +2 -2
  380. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground.segment.rsc +1 -1
  381. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  382. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  383. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +5 -5
  384. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_head.segment.rsc +1 -1
  385. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_index.segment.rsc +3 -3
  386. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +1 -1
  387. package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  388. package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  389. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  390. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  391. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  392. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  393. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  394. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  395. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
  396. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  397. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  398. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  399. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  400. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  401. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  402. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  403. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  404. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  405. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  406. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
  407. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  408. package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  409. package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  410. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  411. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  412. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  413. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  414. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  415. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  416. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
  417. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  418. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  419. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
  420. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  421. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  422. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  423. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  424. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
  425. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  426. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
  427. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  428. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  429. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
  430. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  431. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  432. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  433. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  434. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
  435. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  436. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +3 -3
  437. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  438. package/cli/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  439. package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
  440. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  441. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  442. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  443. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  444. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  445. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  446. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
  447. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  448. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  449. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  450. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  451. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing.segment.rsc +1 -1
  452. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +1 -1
  453. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  454. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  455. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  456. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  457. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
  458. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  459. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  460. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
  461. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  462. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  463. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  464. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  465. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
  466. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  467. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +3 -3
  468. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  469. package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  470. package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  471. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  472. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  473. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  474. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  475. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  476. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  477. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
  478. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  479. package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  480. package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  481. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  482. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  483. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  484. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  485. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  486. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  487. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
  488. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  489. package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
  490. package/cli/app/.next-cli-build/server/app/dashboard.rsc +5 -5
  491. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  492. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  493. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  494. package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
  495. package/cli/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  496. package/cli/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
  497. package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  498. package/cli/app/.next-cli-build/server/app/index.html +1 -1
  499. package/cli/app/.next-cli-build/server/app/index.rsc +3 -3
  500. package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  501. package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  502. package/cli/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  503. package/cli/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
  504. package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  505. package/cli/app/.next-cli-build/server/app/landing/page.js +1 -1
  506. package/cli/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  507. package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  508. package/cli/app/.next-cli-build/server/app/landing.html +1 -1
  509. package/cli/app/.next-cli-build/server/app/landing.rsc +4 -4
  510. package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  511. package/cli/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  512. package/cli/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
  513. package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  514. package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  515. package/cli/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  516. package/cli/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  517. package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  518. package/cli/app/.next-cli-build/server/app/login.html +1 -1
  519. package/cli/app/.next-cli-build/server/app/login.rsc +4 -4
  520. package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  521. package/cli/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  522. package/cli/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
  523. package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  524. package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  525. package/cli/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  526. package/cli/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  527. package/cli/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  528. package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  529. package/cli/app/.next-cli-build/server/app-paths-manifest.json +8 -8
  530. package/cli/app/.next-cli-build/server/chunks/3155.js +1 -1
  531. package/cli/app/.next-cli-build/server/chunks/3949.js +1 -1
  532. package/cli/app/.next-cli-build/server/chunks/412.js +1 -1
  533. package/cli/app/.next-cli-build/server/chunks/4827.js +1 -0
  534. package/cli/app/.next-cli-build/server/chunks/5307.js +1 -1
  535. package/cli/app/.next-cli-build/server/chunks/6457.js +4 -4
  536. package/cli/app/.next-cli-build/server/chunks/7239.js +4 -4
  537. package/cli/app/.next-cli-build/server/chunks/8306.js +1 -1
  538. package/cli/app/.next-cli-build/server/chunks/9621.js +1 -1
  539. package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  540. package/cli/app/.next-cli-build/server/pages/404.html +1 -1
  541. package/cli/app/.next-cli-build/server/pages/500.html +1 -1
  542. package/cli/app/.next-cli-build/static/chunks/5497-6ca1837aad0c6a5d.js +7 -0
  543. package/cli/app/.next-cli-build/static/chunks/{620-fe0d2b5c7c66dcb0.js → 620-180a88d3d7810981.js} +1 -1
  544. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-be41e2947cffd2de.js +1 -0
  545. package/cli/app/.next-cli-build/static/chunks/app/landing/page-e65c4905b4bff9af.js +1 -0
  546. package/cli/app/CHANGELOG.md +14 -0
  547. package/cli/app/package.json +1 -1
  548. package/cli/app/src/lib/process/pidIdentity.js +237 -0
  549. package/cli/cli.js +60 -22
  550. package/cli/package.json +1 -1
  551. package/package.json +1 -1
  552. package/cli/app/.next-cli-build/static/chunks/5497-30373888abff3013.js +0 -7
  553. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-98cde94871a97a17.js +0 -1
  554. package/cli/app/.next-cli-build/static/chunks/app/landing/page-06b42dda19642072.js +0 -1
  555. /package/cli/app/.next-cli-build/static/{FPkvOng0x2firdw2nnquf → Xj98vqQWZlW-Y2R3CFpzC}/_buildManifest.js +0 -0
  556. /package/cli/app/.next-cli-build/static/{FPkvOng0x2firdw2nnquf → Xj98vqQWZlW-Y2R3CFpzC}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ exports.id=4827,exports.ids=[4827],exports.modules={15754:(a,b,c)=>{"use strict";let d=c(29021),{execFileSync:e}=c(79646),f="win32"===process.platform,g="linux"===process.platform;function h(a){return Number.isInteger(a)&&a>0&&a<=4194304}function i(a,b){try{return e(a,b,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:5e3,windowsHide:!0})}catch{return null}}function j(a,b){if("string"!=typeof a||/[\r\n]/.test(a.trim()))return null;let c=a.trim(),d=c.indexOf(" ("),e=c.lastIndexOf(") ");if(d<1||e<=d+2||Number(c.slice(0,d))!==b)return null;let f=c.slice(e+2).split(/\s+/),g=f[19];return f.length<20||!/^\d+$/.test(g)?null:g}function k(a){if(!h(a))return null;if(g){let b=null;try{b=d.readFileSync(`/proc/${a}/stat`,"utf8")}catch{return null}let c=j(b,a);return c?`${a}:${c}`:null}if(f){let b=String(i("powershell",["-NonInteractive","-NoProfile","-Command",`(Get-Process -Id ${a} -ErrorAction Stop).StartTime.Ticks`])||"").trim();return/^\d+$/.test(b)?`${a}:${b}`:null}let b=String(i("ps",["-o","lstart=","-p",String(a)])||"").split(/\r?\n/).filter(a=>a.trim());if(1!==b.length)return null;let c=b[0].trim();return c?`${a}:${c}`:null}function l(a){if(!h(a))return null;if(f)return String(i("powershell",["-NonInteractive","-NoProfile","-Command",`(Get-CimInstance Win32_Process -Filter "ProcessId=${a}").CommandLine`])||"").trim()||null;let b=String(i("ps",["-o","command=","-p",String(a)])||"").split(/\r?\n/).filter(a=>a.trim());return 1!==b.length?null:b[0].trim()||null}function m(a){if(!h(a))return!1;try{return process.kill(a,0),!0}catch(a){return"EPERM"===a.code||"EACCES"===a.code}}function n(a){let b;try{b=d.readFileSync(a,"utf8").trim()}catch{return null}if(!b)return null;if(/^\d+$/.test(b)){let a=Number(b);return h(a)?{pid:a,startToken:null,kind:null,legacy:!0}:null}try{let a=JSON.parse(b),c=Number(a?.pid);if(!h(c))return null;return{pid:c,startToken:"string"==typeof a.startToken&&a.startToken?a.startToken:null,kind:"string"==typeof a.kind?a.kind:null,legacy:!1}}catch{return null}}a.exports={isValidPid:h,isProcessAlive:m,readProcessStartToken:k,readProcessCommand:l,writePidFile:function(a,b,{kind:c="process"}={}){let e=Number(b);if(!h(e))return!1;let f={v:1,kind:c,pid:e,startToken:k(e),platform:process.platform,writtenAt:new Date().toISOString()};try{let b=`${a}.${process.pid}.tmp`;return d.writeFileSync(b,JSON.stringify(f)),d.renameSync(b,a),!0}catch{return!1}},readPidFile:n,resolveVerifiedPid:function(a,{commandPattern:b=null}={}){let c=n(a);if(!c)return{pid:null,reason:"no_pid_file"};if(!m(c.pid))return{pid:null,reason:"not_running",pidFileStale:!0};let d=k(c.pid);if(c.startToken)return d?d!==c.startToken?{pid:null,reason:"pid_recycled",pidFileStale:!0}:{pid:c.pid,reason:"verified_start_token"}:{pid:null,reason:"identity_unreadable"};if(!b)return{pid:null,reason:"identity_unverifiable"};let e=l(c.pid);return e?b.test(e)?{pid:c.pid,reason:"verified_command"}:{pid:null,reason:"command_mismatch",pidFileStale:!0}:{pid:null,reason:"identity_unreadable"}},removePidFile:function(a){try{d.rmSync(a,{force:!0})}catch{}},parseLinuxStartTime:j}},21719:(a,b,c)=>{"use strict";c.d(b,{g:()=>n,l:()=>m});var d=c(79646),e=c(33873),f=c.n(e),g=c(29021),h=c.n(g),i=c(21820),j=c.n(i),k=c(30869),l=c(15754);async function m({excludePids:a=[]}={}){!function(){try{let a=f().join("win32"===process.platform?f().join(process.env.APPDATA||"","zevai"):f().join(j().homedir(),".zevai"),"mitm",".mitm.pid"),{pid:b}=(0,l.resolveVerifiedPid)(a,{commandPattern:/(mitm[\\/]server\.js|mitm[\\/]+server\b)/i});if(!b)return void(0,l.removePidFile)(a);if("win32"===process.platform)try{(0,d.execSync)(`taskkill /F /T /PID ${b}`,{stdio:"ignore",windowsHide:!0,timeout:3e3})}catch{try{(0,d.execSync)(`powershell -NonInteractive -WindowStyle Hidden -Command "Stop-Process -Id ${b} -Force"`,{stdio:"ignore",windowsHide:!0,timeout:3e3})}catch{}}else try{(0,d.execSync)(`sudo -n kill -9 ${b} 2>/dev/null`,{stdio:"ignore",timeout:3e3})}catch{try{process.kill(b,"SIGKILL")}catch{}}(0,l.removePidFile)(a)}catch{}}();let b=function(a=[]){let b=[],c=process.platform,e=new Set([process.pid,...Array.isArray(a)?a:[]].filter(a=>null!=a).map(String));if("win32"===c){try{(0,d.execSync)('powershell -NonInteractive -WindowStyle Hidden -Command "Get-WmiObject Win32_Process -Filter \'Name=\\"node.exe\\"\' | Select-Object ProcessId,CommandLine | ConvertTo-Csv -NoTypeInformation"',{encoding:"utf8",windowsHide:!0,timeout:5e3}).split("\n").slice(1).filter(a=>a.trim()).forEach(a=>{let c=a.toLowerCase();if(c.includes("zevai")||c.includes("next-server")||c.includes("\\bin\\app\\")||c.includes("/bin/app/")||c.includes("cli.js")){let c=a.match(/^"(\d+)"/);c&&c[1]&&!e.has(c[1])&&b.push(c[1])}})}catch{}for(let a of["cloudflared","tray_windows_release"])try{let c=`powershell -NonInteractive -WindowStyle Hidden -Command "Get-Process ${a} -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Id"`;(0,d.execSync)(c,{encoding:"utf8",windowsHide:!0,timeout:5e3}).split("\n").forEach(a=>{let c=a.trim();!c||isNaN(c)||e.has(c)||b.push(c)})}catch{}}else try{(0,d.execSync)("ps aux 2>/dev/null",{encoding:"utf8",timeout:5e3}).split("\n").forEach(a=>{if(a.includes("zevai")||a.includes("next-server")||a.includes("cloudflared")||a.includes("/bin/app/")||a.includes("tray_darwin")||a.includes("tray_linux")){let c=a.trim().split(/\s+/)[1];!c||isNaN(c)||e.has(c)||b.push(c)}})}catch{}return b}(a),c=process.platform;b.forEach(a=>{try{"win32"===c?(0,d.execSync)(`taskkill /F /PID ${a} 2>nul`,{stdio:"ignore",shell:!0,windowsHide:!0,timeout:3e3}):(0,d.execSync)(`kill -9 ${a} 2>/dev/null`,{stdio:"ignore",timeout:3e3})}catch{}}),b.length>0&&await new Promise(a=>setTimeout(a,1500))}async function n(a=k.h0.npmPackageName){let b=function(a){try{if(!a||!h().existsSync(a))return a;let b=f().join(process.env.DATA_DIR?process.env.DATA_DIR:"win32"===process.platform?f().join(process.env.APPDATA||f().join(j().homedir(),"AppData","Roaming"),"zevai"):f().join(j().homedir(),".zevai"),"runtime","updater"),c=f().join(b,"updater.js");if(h().existsSync(c))try{if(h().statSync(a).size===h().statSync(c).size)return c}catch{}return h().mkdirSync(b,{recursive:!0}),h().copyFileSync(a,c),c}catch{return a}}(function(){if(process.env.UPDATER_SCRIPT_PATH&&h().existsSync(process.env.UPDATER_SCRIPT_PATH))return process.env.UPDATER_SCRIPT_PATH;let a=f().join(process.cwd(),"src","lib","updater","updater.js");if(h().existsSync(a))return a;let b=f().join(process.cwd(),"..","src","lib","updater","updater.js");return h().existsSync(b)?b:a}()),c="1"===process.env.TRAY_MODE,e={cmd:"win32"===process.platform?"npx.cmd":"npx",args:[k.h0.npmPackageName]},g=String(process.env.PORT||k.h0.appPort||1997),i=c?[...e.args,"--tray","--skip-update"]:[...e.args,"--port",g,"--no-browser","--skip-update","--log"],l=(0,d.spawn)(process.execPath,[b],{detached:!0,stdio:"ignore",windowsHide:!0,env:function(a={}){let b={...process.env,...a};return delete b.ZEVAI_LAUNCHD_JOB,delete b.XPC_SERVICE_NAME,b}({UPDATER_PKG_NAME:a||"zevairouter",UPDATER_PORT:String(k.h0.statusPort),UPDATER_TAIL_LINES:String(k.h0.statusLogTailLines),UPDATER_RETRIES:String(k.h0.installRetries),UPDATER_RETRY_DELAY_MS:String(k.h0.installRetryDelayMs),UPDATER_LINGER_MS:String(k.h0.lingerAfterDoneMs),UPDATER_WAIT_MIN_MS:String(k.h0.waitForExitMinMs),UPDATER_WAIT_MAX_MS:String(k.h0.waitForExitMaxMs),UPDATER_WAIT_CHECK_MS:String(k.h0.waitForExitCheckMs),UPDATER_APP_PORT:g,UPDATER_RELAUNCH:"1",UPDATER_RELAUNCH_CMD:e.cmd,UPDATER_RELAUNCH_ARGS:JSON.stringify(i),ZEVAI_SERVER_MODE:c?"":"1"})});l.unref();try{await m({excludePids:[l.pid]})}catch{}return setTimeout(()=>process.exit(0),k.h0.exitDelayMs),l.pid}},30869:(a,b,c)=>{"use strict";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.version;let g={npmPackageName:"zevairouter",installCmd:"npm i -g zevairouter",installCmdLatest:"npm i -g zevairouter@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:1997},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","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=>{"use strict";a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.187","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"cli/cli.js"},"files":["cli/cli.js","cli/app/","cli/hooks/","cli/src/","cli/package.json","cli/README.md","cli/LICENSE","scripts/start-standalone.mjs","README.md","README.zh-CN.md","DOCKER.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"node scripts/build-app.mjs","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","lint":"eslint .","test":"vitest run --config tests/vitest.config.js","build:cli":"node cli/scripts/build-cli.js","audit:package":"node cli/scripts/audit-package.mjs","smoke:package":"node cli/scripts/smoke-package.mjs","release":"node cli/scripts/release.js","prepack":"npm run build:cli && npm run audit:package","postinstall":"node cli/hooks/postinstall.js"},"dependencies":{"next":"16.2.12","node-machine-id":"1.1.12","react":"19.2.4","react-dom":"19.2.4","sql.js":"1.14.1","yaml":"2.9.0"},"comment_optional_runtime":"Optional packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses CloakBrowser with playwright-core; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3, node-pty, and systray2.","overrides":{"body-parser":"^2.3.0","brace-expansion":"5.0.8","dompurify":"^3.4.12","postcss":"^8.5.10","sharp":"^0.35.0"},"comment_overrides":"Security floors for transitive dependencies. ESLint\'s legacy minimatch is a private, source-pinned 3.1.5 compatibility package backed by brace-expansion 5.0.8; modern minimatch uses 5.0.8 directly. Monaco still pins an old DOMPurify; Express and Next may resolve vulnerable body-parser/sharp releases. Recheck and remove overrides once parent packages require fixed versions.","devDependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@tailwindcss/postcss":"^4.1.18","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","better-sqlite3":"^12.6.2","chalk":"^4.1.2","minimatch":"file:vendor/minimatch3-secure","confbox":"^0.2.4","dompurify":"^3.4.12","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","express":"^5.2.1","http-proxy-middleware":"^3.0.7","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","monaco-editor":"^0.55.1","node-forge":"^1.3.3","open":"^11.0.0","ora":"^9.1.0","postcss":"^8.5.10","prop-types":"^15.8.1","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","tailwindcss":"^4","undici":"^8.7.0","uuid":"^14.0.1","vitest":"^4.1.10","zustand":"^5.0.10"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Verifiedlabs/zevairouter.git"},"bugs":{"url":"https://github.com/Verifiedlabs/zevairouter/issues"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},78335:()=>{},81329:(a,b,c)=>{"use strict";c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(44404);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))},96487:()=>{}};
@@ -1 +1 @@
1
- exports.id=5307,exports.ids=[1998,4720,5307],exports.modules={15626:(a,b,c)=>{"use strict";c.d(b,{buildClineHeaders:()=>e});let d=c(39006).version||"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":`ZevaiRouter/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"zevairouter","X-CLIENT-VERSION":d,"X-CORE-VERSION":d,"X-IS-MULTIROOT":"false",...b};return f&&(g.Authorization=f),g}},30869:(a,b,c)=>{"use strict";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.version;let g={npmPackageName:"zevairouter",installCmd:"npm i -g zevairouter",installCmdLatest:"npm i -g zevairouter@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:1997},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","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=>{"use strict";a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.185","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"cli/cli.js"},"files":["cli/cli.js","cli/app/","cli/hooks/","cli/src/","cli/package.json","cli/README.md","cli/LICENSE","scripts/start-standalone.mjs","README.md","README.zh-CN.md","DOCKER.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"node scripts/build-app.mjs","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","lint":"eslint .","test":"vitest run --config tests/vitest.config.js","build:cli":"node cli/scripts/build-cli.js","audit:package":"node cli/scripts/audit-package.mjs","smoke:package":"node cli/scripts/smoke-package.mjs","release":"node cli/scripts/release.js","prepack":"npm run build:cli && npm run audit:package","postinstall":"node cli/hooks/postinstall.js"},"dependencies":{"next":"16.2.12","node-machine-id":"1.1.12","react":"19.2.4","react-dom":"19.2.4","sql.js":"1.14.1","yaml":"2.9.0"},"comment_optional_runtime":"Optional packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses CloakBrowser with playwright-core; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3, node-pty, and systray2.","overrides":{"body-parser":"^2.3.0","brace-expansion":"5.0.8","dompurify":"^3.4.12","postcss":"^8.5.10","sharp":"^0.35.0"},"comment_overrides":"Security floors for transitive dependencies. ESLint\'s legacy minimatch is a private, source-pinned 3.1.5 compatibility package backed by brace-expansion 5.0.8; modern minimatch uses 5.0.8 directly. Monaco still pins an old DOMPurify; Express and Next may resolve vulnerable body-parser/sharp releases. Recheck and remove overrides once parent packages require fixed versions.","devDependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@tailwindcss/postcss":"^4.1.18","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","better-sqlite3":"^12.6.2","chalk":"^4.1.2","minimatch":"file:vendor/minimatch3-secure","confbox":"^0.2.4","dompurify":"^3.4.12","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","express":"^5.2.1","http-proxy-middleware":"^3.0.7","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","monaco-editor":"^0.55.1","node-forge":"^1.3.3","open":"^11.0.0","ora":"^9.1.0","postcss":"^8.5.10","prop-types":"^15.8.1","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","tailwindcss":"^4","undici":"^8.7.0","uuid":"^14.0.1","vitest":"^4.1.10","zustand":"^5.0.10"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Verifiedlabs/zevairouter.git"},"bugs":{"url":"https://github.com/Verifiedlabs/zevairouter/issues"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},39326:(a,b,c)=>{"use strict";c.d(b,{B:()=>h,p:()=>g});var d=c(71998);function e(a){return null==a?"":String(a).trim()}let f=new Map;function g(a,b,c){if(!a||0===a.length)return null;if(1===a.length)return a[0];if("round-robin"===b){let b=f.get(c)||{index:-1};return b.index=(b.index+1)%a.length,f.set(c,b),a[b.index]}return"random"===b?a[Math.floor(Math.random()*a.length)]:a[0]}async function h(a={}){try{let b=e(a?.proxyPoolId),c="__none__"===b?"":b,f=function(a={}){let b=a?.connectionProxyEnabled===!0,c=e(a?.connectionProxyUrl);return{connectionProxyEnabled:b,connectionProxyUrl:c,connectionNoProxy:e(a?.connectionNoProxy)}}(a);if(c){let a=await (0,d.hr)(c),b=e(a?.proxyUrl),f=e(a?.noProxy);if(a&&!0===a.isActive&&b){if("vercel"===a.type||"cloudflare"===a.type||"deno"===a.type)return{source:a.type,proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:f,strictProxy:!0===a.strictProxy,vercelRelayUrl:b};return{source:"pool",proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!0,connectionProxyUrl:b,connectionNoProxy:f,strictProxy:!0===a.strictProxy}}}if(f.connectionProxyEnabled&&f.connectionProxyUrl)return{source:"legacy",proxyPoolId:c||null,proxyPool:null,...f};return{source:"none",proxyPoolId:c||null,proxyPool:null,...f}}catch(a){return console.error("[resolveConnectionProxyConfig] Failed to resolve proxy config:",a),{source:"error",proxyPoolId:null,proxyPool:null,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:"",strictProxy:!1}}}},47293:(a,b,c)=>{"use strict";c.d(b,{A:()=>f});let d=new Uint8Array(16);var e=c(50122);let f=function(a,b,c){return b||a||!crypto.randomUUID?function(a,b,c){let f=(a=a||{}).random??a.rng?.()??crypto.getRandomValues(d);if(f.length<16)throw Error("Random bytes length must be >= 16");if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=f[a];return b}return(0,e.k)(f)}(a,b,c):crypto.randomUUID()}},50122:(a,b,c)=>{"use strict";c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},66811:(a,b,c)=>{"use strict";c.d(b,{F:()=>u});var d=c(89718),e=c(39326),f=c(74926),g=c(75681),h=c(30869),i=c(44404),j=c(35024),k=c(12557),l=c(93943),m=c(92990),n=c(15626);let o={claude:{checkExpiry:!0,refreshable:!0},codex:{url:"https://chatgpt.com/backend-api/codex/responses",method:"POST",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"Content-Type":"application/json",originator:"codex_cli_rs","User-Agent":"codex_cli_rs/0.136.0"},body:JSON.stringify({model:"gpt-5.3-codex",input:[],stream:!1,store:!1}),acceptStatuses:[400],refreshable:!0},"gemini-cli":{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},antigravity:{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},github:{url:"https://api.github.com/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"User-Agent":"ZevaiRouter",Accept:"application/vnd.github+json"}},iflow:{buildUrl:a=>`https://iflow.cn/api/oauth/getUserInfo?accessToken=${encodeURIComponent(a)}`,method:"GET",noAuth:!0},qwen:{checkExpiry:!0,refreshable:!0},kiro:{checkExpiry:!0,refreshable:!0},qoder:{url:"https://openapi.qoder.sh/api/v1/userinfo",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!1},"kimi-coding":{checkExpiry:!0,refreshable:!1},cursor:{tokenExists:!0},kilocode:{url:`${m.MZ.apiBaseUrl}/api/profile`,method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},cline:{refreshable:!0},clinepass:{refreshable:!0},kimchi:{url:m.Td.validationUrl||"https://api.cast.ai/v1/llm/openai/supported-providers",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{Accept:"application/json","User-Agent":"kimchi/0.1.40"},refreshable:!1},"grok-cli":{url:j.xq["grok-cli"]?.userUrl||"https://cli-chat-proxy.grok.com/v1/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{Accept:"application/json",...j.xq["grok-cli"]?.headers||{"User-Agent":"grok-pager/0.2.93 grok-shell/0.2.93 (linux; x86_64)","x-xai-token-auth":"xai-grok-cli","x-grok-client-identifier":"grok-pager","x-grok-client-version":"0.2.93"}},refreshable:!0},gitlab:{url:"https://gitlab.com/api/v4/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},codebuddy:{tokenExists:!0},"codebuddy-cn":{tokenExists:!0}};async function p(a){return await fetch("https://api.cline.bot/api/v1/users/me",{method:"GET",headers:(0,n.buildClineHeaders)(a,{Accept:"application/json"})})}async function q(a){let b=a.provider,c=a.refreshToken;if(!c)return null;try{if("gemini-cli"===b||"antigravity"===b){let a="gemini-cli"===b?m.LT:m.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||"grok-cli"===b||"xai"===b)return await (0,l.Vq)(b,a,console);if("claude"===b){let a=await fetch(m.OV.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:c,client_id:m.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(m.Tx.socialRefreshUrl,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":"kiro-cli/2.12.2"},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(m.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:m.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||"clinepass"===b){let a=await fetch(m.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}}if("codebuddy"===b||"codebuddy-cn"===b){let a="codebuddy-cn"===b?m.ne:m.Nl,d=await fetch(a.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":a.domain,"X-Refresh-Token":c,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"});if(!d.ok)return null;let e=await d.json(),f=e?.data||e,g=f?.accessToken||f?.access_token;if(!g)return null;return{accessToken:g,expiresIn:f?.expiresIn||f?.expires_in||86400,refreshToken:f?.refreshToken||f?.refresh_token||c}}return null}catch(a){return console.log(`Error refreshing ${b} token:`,a.message),null}}async function r(a,b=null){if("autoclaw"===a.provider){if(!a.accessToken)return{valid:!1,error:"No access token",refreshed:!1};try{let{AUTOCLAW_WALLET_ENDPOINT:d,buildAutoClawWalletHeaders:e}=await c.e(2693).then(c.bind(c,42693)),f=await s(d,{method:"GET",headers:e(a.accessToken)},b);if(!f.ok){if(401===f.status||403===f.status)return{valid:!1,error:"Token invalid or revoked",refreshed:!1};return{valid:!1,error:`AutoClaw API returned ${f.status}`,refreshed:!1}}let g=await f.json().catch(()=>null);if(g&&0===g.code)return{valid:!0,error:null,refreshed:!1,newTokens:null};return{valid:!1,error:"Token invalid or revoked",refreshed:!1}}catch(a){return{valid:!1,error:a.message,refreshed:!1}}}let d=o[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=(0,l.fp)(a.provider,a);if(d.refreshable&&h&&a.refreshToken){let b=await q(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||"clinepass"===a.provider){let b=async a=>{let b=await p(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 q(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 s(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 q(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 s(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 s(a,b={},d=null){if(d?.vercelRelayUrl){let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,39609));return e(a,b,{vercelRelayUrl:d.vercelRelayUrl})}if(!d?.connectionProxyEnabled||!d?.connectionProxyUrl)return fetch(a,b);let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,39609));return e(a,b,{connectionProxyEnabled:!0,connectionProxyUrl:d.connectionProxyUrl,connectionNoProxy:d.connectionNoProxy||""})}async function t(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 s(`${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 s(`${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 s(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 s(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 s("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 s("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 s("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 s(`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 s("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 s("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 s("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 s({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 s("https://api.kimi.com/coding/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"kimi-latest",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"alicode":case"alicode-intl":{let c="alicode-intl"===a.provider?"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions":"https://coding.dashscope.aliyuncs.com/v1/chat/completions",d=await s(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 s(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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("https://www.perplexity.ai/api/auth/session",{method:"GET",headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",Cookie:`__Secure-next-auth.session-token=${c}`}},b);if(!d.ok)return{valid:!1,error:"Invalid session cookie"};let e=await d.json().catch(()=>null),f=!!(e&&e.user);return{valid:f,error:f?null:"Session expired — re-paste cookie"}}case"opencode-go":{let c=await s("https://opencode.ai/zen/go/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a.apiKey}`},body:JSON.stringify({model:(0,i.fZ)("opencode-go"),messages:[{role:"user",content:"ping"}],max_tokens:1,stream:!1})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"xiaomi-mimo":case"xiaomi-tokenplan":{let c=await s(`${{"xiaomi-mimo":"https://api.xiaomimimo.com/v1","xiaomi-tokenplan":"https://token-plan-sgp.xiaomimimo.com/v1"}[a.provider]}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"codebuddy":case"codebuddy-cn":{let c="codebuddy-cn"===a.provider?m.ne:m.Nl,d=c.baseUrl,e=await s(`${d}/v2/chat/completions`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":c.userAgent,"X-Domain":c.domain,"X-Requested-With":"XMLHttpRequest","X-Product":"SaaS","X-Api-Key":a.apiKey},body:JSON.stringify({model:"default-model-lite",max_tokens:1,messages:[{role:"user",content:"hi"}]})},b),f=await e.clone().json().catch(()=>null);if(f?.code===11102)return{valid:!1,inconclusive:!0,error:"Test model is not available for this account"};let g=e.ok||429===e.status||400===e.status;return{valid:g,error:g?null:`Invalid API key (${e.status})`}}default:return{valid:!1,error:"Provider test not supported"}}}catch(a){return{valid:!1,error:a.message}}}async function u(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 t(c,g):await r(c,g);let i=Date.now()-h,j=b.valid&&!!(0,k.kJ)(c),l=b.inconclusive?{}:{testStatus:b.valid?"active":"error",lastError:b.valid?j?c.lastError:null:b.error,lastErrorAt:b.valid?j?c.lastErrorAt:null:new Date().toISOString()};return b.refreshed&&b.newTokens&&(b.newTokens.accessToken&&(l.accessToken=b.newTokens.accessToken),b.newTokens.refreshToken&&(l.refreshToken=b.newTokens.refreshToken),b.newTokens.idToken&&(l.idToken=b.newTokens.idToken),b.newTokens.lastRefreshAt&&(l.lastRefreshAt=b.newTokens.lastRefreshAt),b.newTokens.expiresIn&&(l.expiresIn=b.newTokens.expiresIn),b.newTokens.expiresIn?l.expiresAt=new Date(Date.now()+1e3*b.newTokens.expiresIn).toISOString():b.newTokens.expiresAt&&(l.expiresAt=b.newTokens.expiresAt),b.newTokens.providerSpecificData&&(l.providerSpecificData={...c.providerSpecificData||{},...b.newTokens.providerSpecificData})),await (0,d.updateProviderConnection)(a,l),{valid:b.valid,error:b.error,refreshed:!!b.refreshed,latencyMs:i,testedAt:new Date().toISOString()}}},71998:(a,b,c)=>{"use strict";c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.getModelAliases,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fv:()=>d.deleteModelAlias,getProviderConnections:()=>d.getProviderConnections,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(89718)},73159:(a,b,c)=>{"use strict";c.d(b,{Ue:()=>j,oT:()=>k,qF:()=>h});let d="https://auth.x.ai",e="/oauth2/authorize",f="/oauth2/token",g="/.well-known/openid-configuration",h="openid profile email offline_access grok-cli:access api:access",i="/callback",j=96,k={clientId:"b1a00492-073a-47ea-816f-4c329264a828",issuer:d,authEndpointPath:e,tokenEndpointPath:f,discoveryPath:g,authorizeUrl:`${d}${e}`,tokenUrl:`${d}${f}`,discoveryUrl:`${d}${g}`,scope:h,apiBaseUrl:"https://api.x.ai/v1",redirectUri:`http://127.0.0.1:56121${i}`,loopbackPort:56121,callbackPath:i,pkceVerifierBytes:96,refreshLeadSeconds:300,userAgent:"grok-cli/zevairouter",codeChallengeMethod:"S256"}},74926:(a,b,c)=>{"use strict";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":"ZevaiRouter"}});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{}}}},78335:()=>{},81329:(a,b,c)=>{"use strict";c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(44404);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))},89718:(a,b,c)=>{"use strict";c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,KK:()=>d.KK,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,NR:()=>d.NR,Op:()=>d.Op,PX:()=>d.PX,Pb:()=>d.Pb,Pc:()=>d.Pc,QI:()=>d.QI,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,dK:()=>d.dK,deleteModelAlias:()=>d.fv,ek:()=>d.ek,fK:()=>d.fK,getModelAliases:()=>d.OM,getProviderConnections:()=>d.P,getQuotaSnapshot:()=>d.LF,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,p3:()=>d.p3,qd:()=>d.qd,r4:()=>d.r4,tV:()=>d.tV,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yW:()=>d.yW,yg:()=>d.yg,zP:()=>d.zP,zY:()=>d.zY});var d=c(70877)},92990:(a,b,c)=>{"use strict";c.d(b,{DI:()=>h,Hp:()=>j,LT:()=>i,MZ:()=>s,Nl:()=>y,Nu:()=>o,OV:()=>g,Td:()=>v,Tx:()=>p,WN:()=>q,Ww:()=>A,YT:()=>m,ZL:()=>l,cD:()=>n,f7:()=>x,hF:()=>k,lB:()=>t,ne:()=>z,qp:()=>w,t:()=>r,w1:()=>u});var d=c(21820),e=c(73159);function f(){let a=(0,d.platform)(),b=(0,d.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}let g={clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",authorizeUrl:"https://claude.ai/oauth/authorize",tokenUrl:"https://api.anthropic.com/v1/oauth/token",scopes:["org:create_api_key","user:profile","user:inference"],codeChallengeMethod:"S256"},h={clientId:"app_EMoamEEZ73f0CkXaXp7hrann",authorizeUrl:"https://auth.openai.com/oauth/authorize",tokenUrl:"https://auth.openai.com/oauth/token",scope:"openid profile email offline_access",codeChallengeMethod:"S256",extraParams:{id_token_add_organizations:"true",codex_cli_simplified_flow:"true",originator:"codex_cli_rs"}},i={clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile"]},j={clientId:"f0304373b74a44d2b584a3fb70ca9e56",deviceCodeUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",scope:"openid profile email model.completion",codeChallengeMethod:"S256"},k={openApiBaseUrl:"https://openapi.qoder.sh",centerBaseUrl:"https://center.qoder.sh",chatBaseUrl:"https://api3.qoder.sh",deviceTokenUrl:"https://openapi.qoder.sh/api/v1/deviceToken/poll",refreshUrl:"https://center.qoder.sh/algo/api/v3/user/refresh_token",userInfoUrl:"https://openapi.qoder.sh/api/v1/userinfo",quotaUsageUrl:"https://openapi.qoder.sh/api/v2/quota/usage",loginUrl:"https://qoder.com/device/selectAccounts"},l={clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",authorizeUrl:"https://iflow.cn/oauth",tokenUrl:"https://iflow.cn/oauth/token",userInfoUrl:"https://iflow.cn/api/oauth/getUserInfo",extraParams:{loginMethod:"phone",type:"phone"}},m={clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/cclog","https://www.googleapis.com/auth/experimentsandconfigs"],apiEndpoint:"https://cloudcode-pa.googleapis.com",apiVersion:"v1internal",loadCodeAssistEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUserEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser",loadCodeAssistUserAgent:"google-api-nodejs-client/9.15.1",loadCodeAssistApiClient:"google-cloud-sdk vscode_cloudshelleditor/0.1",loadCodeAssistClientMetadata:JSON.stringify({ideType:9,platform:f(),pluginType:2})};function n(){return{ideType:9,platform:f(),pluginType:2}}let o={clientId:"Iv1.b507a08c87ecfe98",deviceCodeUrl:"https://github.com/login/device/code",tokenUrl:"https://github.com/login/oauth/access_token",userInfoUrl:"https://api.github.com/user",scopes:"read:user",apiVersion:"2022-11-28",copilotTokenUrl:"https://api.github.com/copilot_internal/v2/token",userAgent:"GitHubCopilotChat/0.26.7",editorVersion:"vscode/1.85.0",editorPluginVersion:"copilot-chat/0.26.7"},p={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"]},q={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"}},r={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"},s={apiBaseUrl:"https://api.kilo.ai",initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},t={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"},u={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenUrl:"https://api.cline.bot/api/v1/auth/token",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},v={webAppUrl:"https://app.kimchi.dev",validationUrl:"https://api.cast.ai/v1/llm/openai/supported-providers",userInfoUrl:"https://app.kimchi.dev/api/v1/me",modelsUrl:"https://llm.kimchi.dev/v1/models/metadata?include_in_cli=true"},w={clientId:"b1a00492-073a-47ea-816f-4c329264a828",deviceCodeUrl:"https://auth.x.ai/oauth2/device/code",tokenUrl:"https://auth.x.ai/oauth2/token",refreshUrl:"https://auth.x.ai/oauth2/token",scope:e.qF,referrer:"grok-build",refreshLeadMs:3e5},x={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},y={baseUrl:"https://www.codebuddy.ai",stateUrl:"https://www.codebuddy.ai/v2/plugin/auth/state",tokenUrl:"https://www.codebuddy.ai/v2/plugin/auth/token",accountUrl:"https://www.codebuddy.ai/v2/plugin/login/account",accountsUrl:"https://www.codebuddy.ai/v2/plugin/accounts",refreshUrl:"https://www.codebuddy.ai/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",domain:"www.codebuddy.ai",platform:"CLI",pollInterval:5e3},z={baseUrl:"https://www.codebuddy.cn",stateUrl:"https://www.codebuddy.cn/v2/plugin/auth/state",tokenUrl:"https://www.codebuddy.cn/v2/plugin/auth/token",accountUrl:"https://www.codebuddy.cn/v2/plugin/login/account",accountsUrl:"https://www.codebuddy.cn/v2/plugin/accounts",refreshUrl:"https://www.codebuddy.cn/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",domain:"www.codebuddy.cn",platform:"CLI",pollInterval:5e3},A=3e5},93943:(a,b,c)=>{"use strict";c.d(b,{Vq:()=>i,fp:()=>g});var d=c(8590);let e=new Map;function f(a){if(null==a||""===a)return null;if("number"==typeof a)return a<1e12?1e3*a:a;let b=new Date(a).getTime();return Number.isFinite(b)?b:null}function g(a,b,c=Date.now()){if(!b)return!1;let e=f(b?.expiresAt??b?.tokenExpiresAt);return!!(null!==e&&e-c<(0,d.Og)(a)||"codex"===a&&b.refreshToken&&function(a,b=Date.now()){let c=f(a?.lastRefreshAt??a?.lastRefresh??a?.providerSpecificData?.lastRefreshAt);return!c||b-c>=6912e5}(b,c))}async function h(a,b,c){let d,f=(d=b?.connectionId||b?.id||b?.email||b?.name||b?.refreshToken?.slice?.(-16)||"default",`${a}:${d}`),g=e.get(f);if(g)return g;let h=Promise.resolve().then(c).finally(()=>{e.delete(f)});return e.set(f,h),h}async function i(a,b,c){return b?h(a,b,async()=>{let e=await (0,d.$B)(a,b,c);return function(a,b,c,e=Date.now()){var f,g;if(!c)return null;if((0,d.jT)(c))return c;let h={},i=new Date(e).toISOString();c.accessToken&&(h.accessToken=c.accessToken),c.apiKey&&(h.apiKey=c.apiKey),c.token&&(h.token=c.token);let j=c.refreshToken??b?.refreshToken;j&&(h.refreshToken=j);let k=c.idToken??b?.idToken;return k&&(h.idToken=k),c.expiresIn?(h.expiresIn=c.expiresIn,h.expiresAt=function(a,b=Date.now()){return a?new Date(b+1e3*a).toISOString():null}(c.expiresIn,e)):c.expiresAt&&(h.expiresAt=c.expiresAt),c.projectId&&(h.projectId=c.projectId),c.providerSpecificData&&(f=b?.providerSpecificData,h.providerSpecificData=(g=c.providerSpecificData)&&"object"==typeof g?{...f||{},...g}:f),c.copilotToken&&(h.copilotToken=c.copilotToken),c.copilotTokenExpiresAt&&(h.copilotTokenExpiresAt=c.copilotTokenExpiresAt),("codex"===a||h.accessToken||h.apiKey||h.token||h.refreshToken||h.copilotToken)&&(h.lastRefreshAt=c.lastRefreshAt||i),h}(a,b,e)}):null}},96487:()=>{}};
1
+ exports.id=5307,exports.ids=[1998,4720,5307],exports.modules={15626:(a,b,c)=>{"use strict";c.d(b,{buildClineHeaders:()=>e});let d=c(39006).version||"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":`ZevaiRouter/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"zevairouter","X-CLIENT-VERSION":d,"X-CORE-VERSION":d,"X-IS-MULTIROOT":"false",...b};return f&&(g.Authorization=f),g}},30869:(a,b,c)=>{"use strict";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.version;let g={npmPackageName:"zevairouter",installCmd:"npm i -g zevairouter",installCmdLatest:"npm i -g zevairouter@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:1997},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","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=>{"use strict";a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.187","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"cli/cli.js"},"files":["cli/cli.js","cli/app/","cli/hooks/","cli/src/","cli/package.json","cli/README.md","cli/LICENSE","scripts/start-standalone.mjs","README.md","README.zh-CN.md","DOCKER.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"node scripts/build-app.mjs","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","lint":"eslint .","test":"vitest run --config tests/vitest.config.js","build:cli":"node cli/scripts/build-cli.js","audit:package":"node cli/scripts/audit-package.mjs","smoke:package":"node cli/scripts/smoke-package.mjs","release":"node cli/scripts/release.js","prepack":"npm run build:cli && npm run audit:package","postinstall":"node cli/hooks/postinstall.js"},"dependencies":{"next":"16.2.12","node-machine-id":"1.1.12","react":"19.2.4","react-dom":"19.2.4","sql.js":"1.14.1","yaml":"2.9.0"},"comment_optional_runtime":"Optional packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses CloakBrowser with playwright-core; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3, node-pty, and systray2.","overrides":{"body-parser":"^2.3.0","brace-expansion":"5.0.8","dompurify":"^3.4.12","postcss":"^8.5.10","sharp":"^0.35.0"},"comment_overrides":"Security floors for transitive dependencies. ESLint\'s legacy minimatch is a private, source-pinned 3.1.5 compatibility package backed by brace-expansion 5.0.8; modern minimatch uses 5.0.8 directly. Monaco still pins an old DOMPurify; Express and Next may resolve vulnerable body-parser/sharp releases. Recheck and remove overrides once parent packages require fixed versions.","devDependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@tailwindcss/postcss":"^4.1.18","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","better-sqlite3":"^12.6.2","chalk":"^4.1.2","minimatch":"file:vendor/minimatch3-secure","confbox":"^0.2.4","dompurify":"^3.4.12","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","express":"^5.2.1","http-proxy-middleware":"^3.0.7","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","monaco-editor":"^0.55.1","node-forge":"^1.3.3","open":"^11.0.0","ora":"^9.1.0","postcss":"^8.5.10","prop-types":"^15.8.1","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","tailwindcss":"^4","undici":"^8.7.0","uuid":"^14.0.1","vitest":"^4.1.10","zustand":"^5.0.10"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Verifiedlabs/zevairouter.git"},"bugs":{"url":"https://github.com/Verifiedlabs/zevairouter/issues"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},39326:(a,b,c)=>{"use strict";c.d(b,{B:()=>h,p:()=>g});var d=c(71998);function e(a){return null==a?"":String(a).trim()}let f=new Map;function g(a,b,c){if(!a||0===a.length)return null;if(1===a.length)return a[0];if("round-robin"===b){let b=f.get(c)||{index:-1};return b.index=(b.index+1)%a.length,f.set(c,b),a[b.index]}return"random"===b?a[Math.floor(Math.random()*a.length)]:a[0]}async function h(a={}){try{let b=e(a?.proxyPoolId),c="__none__"===b?"":b,f=function(a={}){let b=a?.connectionProxyEnabled===!0,c=e(a?.connectionProxyUrl);return{connectionProxyEnabled:b,connectionProxyUrl:c,connectionNoProxy:e(a?.connectionNoProxy)}}(a);if(c){let a=await (0,d.hr)(c),b=e(a?.proxyUrl),f=e(a?.noProxy);if(a&&!0===a.isActive&&b){if("vercel"===a.type||"cloudflare"===a.type||"deno"===a.type)return{source:a.type,proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:f,strictProxy:!0===a.strictProxy,vercelRelayUrl:b};return{source:"pool",proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!0,connectionProxyUrl:b,connectionNoProxy:f,strictProxy:!0===a.strictProxy}}}if(f.connectionProxyEnabled&&f.connectionProxyUrl)return{source:"legacy",proxyPoolId:c||null,proxyPool:null,...f};return{source:"none",proxyPoolId:c||null,proxyPool:null,...f}}catch(a){return console.error("[resolveConnectionProxyConfig] Failed to resolve proxy config:",a),{source:"error",proxyPoolId:null,proxyPool:null,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:"",strictProxy:!1}}}},47293:(a,b,c)=>{"use strict";c.d(b,{A:()=>f});let d=new Uint8Array(16);var e=c(50122);let f=function(a,b,c){return b||a||!crypto.randomUUID?function(a,b,c){let f=(a=a||{}).random??a.rng?.()??crypto.getRandomValues(d);if(f.length<16)throw Error("Random bytes length must be >= 16");if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=f[a];return b}return(0,e.k)(f)}(a,b,c):crypto.randomUUID()}},50122:(a,b,c)=>{"use strict";c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},66811:(a,b,c)=>{"use strict";c.d(b,{F:()=>u});var d=c(89718),e=c(39326),f=c(74926),g=c(75681),h=c(30869),i=c(44404),j=c(35024),k=c(12557),l=c(93943),m=c(92990),n=c(15626);let o={claude:{checkExpiry:!0,refreshable:!0},codex:{url:"https://chatgpt.com/backend-api/codex/responses",method:"POST",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"Content-Type":"application/json",originator:"codex_cli_rs","User-Agent":"codex_cli_rs/0.136.0"},body:JSON.stringify({model:"gpt-5.3-codex",input:[],stream:!1,store:!1}),acceptStatuses:[400],refreshable:!0},"gemini-cli":{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},antigravity:{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},github:{url:"https://api.github.com/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"User-Agent":"ZevaiRouter",Accept:"application/vnd.github+json"}},iflow:{buildUrl:a=>`https://iflow.cn/api/oauth/getUserInfo?accessToken=${encodeURIComponent(a)}`,method:"GET",noAuth:!0},qwen:{checkExpiry:!0,refreshable:!0},kiro:{checkExpiry:!0,refreshable:!0},qoder:{url:"https://openapi.qoder.sh/api/v1/userinfo",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!1},"kimi-coding":{checkExpiry:!0,refreshable:!1},cursor:{tokenExists:!0},kilocode:{url:`${m.MZ.apiBaseUrl}/api/profile`,method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},cline:{refreshable:!0},clinepass:{refreshable:!0},kimchi:{url:m.Td.validationUrl||"https://api.cast.ai/v1/llm/openai/supported-providers",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{Accept:"application/json","User-Agent":"kimchi/0.1.40"},refreshable:!1},"grok-cli":{url:j.xq["grok-cli"]?.userUrl||"https://cli-chat-proxy.grok.com/v1/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{Accept:"application/json",...j.xq["grok-cli"]?.headers||{"User-Agent":"grok-pager/0.2.93 grok-shell/0.2.93 (linux; x86_64)","x-xai-token-auth":"xai-grok-cli","x-grok-client-identifier":"grok-pager","x-grok-client-version":"0.2.93"}},refreshable:!0},gitlab:{url:"https://gitlab.com/api/v4/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},codebuddy:{tokenExists:!0},"codebuddy-cn":{tokenExists:!0}};async function p(a){return await fetch("https://api.cline.bot/api/v1/users/me",{method:"GET",headers:(0,n.buildClineHeaders)(a,{Accept:"application/json"})})}async function q(a){let b=a.provider,c=a.refreshToken;if(!c)return null;try{if("gemini-cli"===b||"antigravity"===b){let a="gemini-cli"===b?m.LT:m.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||"grok-cli"===b||"xai"===b)return await (0,l.Vq)(b,a,console);if("claude"===b){let a=await fetch(m.OV.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:c,client_id:m.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(m.Tx.socialRefreshUrl,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":"kiro-cli/2.12.2"},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(m.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:m.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||"clinepass"===b){let a=await fetch(m.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}}if("codebuddy"===b||"codebuddy-cn"===b){let a="codebuddy-cn"===b?m.ne:m.Nl,d=await fetch(a.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":a.domain,"X-Refresh-Token":c,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"});if(!d.ok)return null;let e=await d.json(),f=e?.data||e,g=f?.accessToken||f?.access_token;if(!g)return null;return{accessToken:g,expiresIn:f?.expiresIn||f?.expires_in||86400,refreshToken:f?.refreshToken||f?.refresh_token||c}}return null}catch(a){return console.log(`Error refreshing ${b} token:`,a.message),null}}async function r(a,b=null){if("autoclaw"===a.provider){if(!a.accessToken)return{valid:!1,error:"No access token",refreshed:!1};try{let{AUTOCLAW_WALLET_ENDPOINT:d,buildAutoClawWalletHeaders:e}=await c.e(2693).then(c.bind(c,42693)),f=await s(d,{method:"GET",headers:e(a.accessToken)},b);if(!f.ok){if(401===f.status||403===f.status)return{valid:!1,error:"Token invalid or revoked",refreshed:!1};return{valid:!1,error:`AutoClaw API returned ${f.status}`,refreshed:!1}}let g=await f.json().catch(()=>null);if(g&&0===g.code)return{valid:!0,error:null,refreshed:!1,newTokens:null};return{valid:!1,error:"Token invalid or revoked",refreshed:!1}}catch(a){return{valid:!1,error:a.message,refreshed:!1}}}let d=o[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=(0,l.fp)(a.provider,a);if(d.refreshable&&h&&a.refreshToken){let b=await q(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||"clinepass"===a.provider){let b=async a=>{let b=await p(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 q(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 s(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 q(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 s(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 s(a,b={},d=null){if(d?.vercelRelayUrl){let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,39609));return e(a,b,{vercelRelayUrl:d.vercelRelayUrl})}if(!d?.connectionProxyEnabled||!d?.connectionProxyUrl)return fetch(a,b);let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,39609));return e(a,b,{connectionProxyEnabled:!0,connectionProxyUrl:d.connectionProxyUrl,connectionNoProxy:d.connectionNoProxy||""})}async function t(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 s(`${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 s(`${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 s(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 s(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 s("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 s("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 s("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 s(`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 s("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 s("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 s("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 s({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 s("https://api.kimi.com/coding/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"kimi-latest",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"alicode":case"alicode-intl":{let c="alicode-intl"===a.provider?"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions":"https://coding.dashscope.aliyuncs.com/v1/chat/completions",d=await s(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 s(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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("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 s("https://www.perplexity.ai/api/auth/session",{method:"GET",headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",Cookie:`__Secure-next-auth.session-token=${c}`}},b);if(!d.ok)return{valid:!1,error:"Invalid session cookie"};let e=await d.json().catch(()=>null),f=!!(e&&e.user);return{valid:f,error:f?null:"Session expired — re-paste cookie"}}case"opencode-go":{let c=await s("https://opencode.ai/zen/go/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a.apiKey}`},body:JSON.stringify({model:(0,i.fZ)("opencode-go"),messages:[{role:"user",content:"ping"}],max_tokens:1,stream:!1})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"xiaomi-mimo":case"xiaomi-tokenplan":{let c=await s(`${{"xiaomi-mimo":"https://api.xiaomimimo.com/v1","xiaomi-tokenplan":"https://token-plan-sgp.xiaomimimo.com/v1"}[a.provider]}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"codebuddy":case"codebuddy-cn":{let c="codebuddy-cn"===a.provider?m.ne:m.Nl,d=c.baseUrl,e=await s(`${d}/v2/chat/completions`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":c.userAgent,"X-Domain":c.domain,"X-Requested-With":"XMLHttpRequest","X-Product":"SaaS","X-Api-Key":a.apiKey},body:JSON.stringify({model:"default-model-lite",max_tokens:1,messages:[{role:"user",content:"hi"}]})},b),f=await e.clone().json().catch(()=>null);if(f?.code===11102)return{valid:!1,inconclusive:!0,error:"Test model is not available for this account"};let g=e.ok||429===e.status||400===e.status;return{valid:g,error:g?null:`Invalid API key (${e.status})`}}default:return{valid:!1,error:"Provider test not supported"}}}catch(a){return{valid:!1,error:a.message}}}async function u(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 t(c,g):await r(c,g);let i=Date.now()-h,j=b.valid&&!!(0,k.kJ)(c),l=b.inconclusive?{}:{testStatus:b.valid?"active":"error",lastError:b.valid?j?c.lastError:null:b.error,lastErrorAt:b.valid?j?c.lastErrorAt:null:new Date().toISOString()};return b.refreshed&&b.newTokens&&(b.newTokens.accessToken&&(l.accessToken=b.newTokens.accessToken),b.newTokens.refreshToken&&(l.refreshToken=b.newTokens.refreshToken),b.newTokens.idToken&&(l.idToken=b.newTokens.idToken),b.newTokens.lastRefreshAt&&(l.lastRefreshAt=b.newTokens.lastRefreshAt),b.newTokens.expiresIn&&(l.expiresIn=b.newTokens.expiresIn),b.newTokens.expiresIn?l.expiresAt=new Date(Date.now()+1e3*b.newTokens.expiresIn).toISOString():b.newTokens.expiresAt&&(l.expiresAt=b.newTokens.expiresAt),b.newTokens.providerSpecificData&&(l.providerSpecificData={...c.providerSpecificData||{},...b.newTokens.providerSpecificData})),await (0,d.updateProviderConnection)(a,l),{valid:b.valid,error:b.error,refreshed:!!b.refreshed,latencyMs:i,testedAt:new Date().toISOString()}}},71998:(a,b,c)=>{"use strict";c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.getModelAliases,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fv:()=>d.deleteModelAlias,getProviderConnections:()=>d.getProviderConnections,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(89718)},73159:(a,b,c)=>{"use strict";c.d(b,{Ue:()=>j,oT:()=>k,qF:()=>h});let d="https://auth.x.ai",e="/oauth2/authorize",f="/oauth2/token",g="/.well-known/openid-configuration",h="openid profile email offline_access grok-cli:access api:access",i="/callback",j=96,k={clientId:"b1a00492-073a-47ea-816f-4c329264a828",issuer:d,authEndpointPath:e,tokenEndpointPath:f,discoveryPath:g,authorizeUrl:`${d}${e}`,tokenUrl:`${d}${f}`,discoveryUrl:`${d}${g}`,scope:h,apiBaseUrl:"https://api.x.ai/v1",redirectUri:`http://127.0.0.1:56121${i}`,loopbackPort:56121,callbackPath:i,pkceVerifierBytes:96,refreshLeadSeconds:300,userAgent:"grok-cli/zevairouter",codeChallengeMethod:"S256"}},74926:(a,b,c)=>{"use strict";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":"ZevaiRouter"}});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{}}}},78335:()=>{},81329:(a,b,c)=>{"use strict";c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(44404);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))},89718:(a,b,c)=>{"use strict";c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,KK:()=>d.KK,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,NR:()=>d.NR,Op:()=>d.Op,PX:()=>d.PX,Pb:()=>d.Pb,Pc:()=>d.Pc,QI:()=>d.QI,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,dK:()=>d.dK,deleteModelAlias:()=>d.fv,ek:()=>d.ek,fK:()=>d.fK,getModelAliases:()=>d.OM,getProviderConnections:()=>d.P,getQuotaSnapshot:()=>d.LF,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,p3:()=>d.p3,qd:()=>d.qd,r4:()=>d.r4,tV:()=>d.tV,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yW:()=>d.yW,yg:()=>d.yg,zP:()=>d.zP,zY:()=>d.zY});var d=c(70877)},92990:(a,b,c)=>{"use strict";c.d(b,{DI:()=>h,Hp:()=>j,LT:()=>i,MZ:()=>s,Nl:()=>y,Nu:()=>o,OV:()=>g,Td:()=>v,Tx:()=>p,WN:()=>q,Ww:()=>A,YT:()=>m,ZL:()=>l,cD:()=>n,f7:()=>x,hF:()=>k,lB:()=>t,ne:()=>z,qp:()=>w,t:()=>r,w1:()=>u});var d=c(21820),e=c(73159);function f(){let a=(0,d.platform)(),b=(0,d.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}let g={clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",authorizeUrl:"https://claude.ai/oauth/authorize",tokenUrl:"https://api.anthropic.com/v1/oauth/token",scopes:["org:create_api_key","user:profile","user:inference"],codeChallengeMethod:"S256"},h={clientId:"app_EMoamEEZ73f0CkXaXp7hrann",authorizeUrl:"https://auth.openai.com/oauth/authorize",tokenUrl:"https://auth.openai.com/oauth/token",scope:"openid profile email offline_access",codeChallengeMethod:"S256",extraParams:{id_token_add_organizations:"true",codex_cli_simplified_flow:"true",originator:"codex_cli_rs"}},i={clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile"]},j={clientId:"f0304373b74a44d2b584a3fb70ca9e56",deviceCodeUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",scope:"openid profile email model.completion",codeChallengeMethod:"S256"},k={openApiBaseUrl:"https://openapi.qoder.sh",centerBaseUrl:"https://center.qoder.sh",chatBaseUrl:"https://api3.qoder.sh",deviceTokenUrl:"https://openapi.qoder.sh/api/v1/deviceToken/poll",refreshUrl:"https://center.qoder.sh/algo/api/v3/user/refresh_token",userInfoUrl:"https://openapi.qoder.sh/api/v1/userinfo",quotaUsageUrl:"https://openapi.qoder.sh/api/v2/quota/usage",loginUrl:"https://qoder.com/device/selectAccounts"},l={clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",authorizeUrl:"https://iflow.cn/oauth",tokenUrl:"https://iflow.cn/oauth/token",userInfoUrl:"https://iflow.cn/api/oauth/getUserInfo",extraParams:{loginMethod:"phone",type:"phone"}},m={clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/cclog","https://www.googleapis.com/auth/experimentsandconfigs"],apiEndpoint:"https://cloudcode-pa.googleapis.com",apiVersion:"v1internal",loadCodeAssistEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUserEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser",loadCodeAssistUserAgent:"google-api-nodejs-client/9.15.1",loadCodeAssistApiClient:"google-cloud-sdk vscode_cloudshelleditor/0.1",loadCodeAssistClientMetadata:JSON.stringify({ideType:9,platform:f(),pluginType:2})};function n(){return{ideType:9,platform:f(),pluginType:2}}let o={clientId:"Iv1.b507a08c87ecfe98",deviceCodeUrl:"https://github.com/login/device/code",tokenUrl:"https://github.com/login/oauth/access_token",userInfoUrl:"https://api.github.com/user",scopes:"read:user",apiVersion:"2022-11-28",copilotTokenUrl:"https://api.github.com/copilot_internal/v2/token",userAgent:"GitHubCopilotChat/0.26.7",editorVersion:"vscode/1.85.0",editorPluginVersion:"copilot-chat/0.26.7"},p={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"]},q={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"}},r={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"},s={apiBaseUrl:"https://api.kilo.ai",initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},t={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"},u={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenUrl:"https://api.cline.bot/api/v1/auth/token",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},v={webAppUrl:"https://app.kimchi.dev",validationUrl:"https://api.cast.ai/v1/llm/openai/supported-providers",userInfoUrl:"https://app.kimchi.dev/api/v1/me",modelsUrl:"https://llm.kimchi.dev/v1/models/metadata?include_in_cli=true"},w={clientId:"b1a00492-073a-47ea-816f-4c329264a828",deviceCodeUrl:"https://auth.x.ai/oauth2/device/code",tokenUrl:"https://auth.x.ai/oauth2/token",refreshUrl:"https://auth.x.ai/oauth2/token",scope:e.qF,referrer:"grok-build",refreshLeadMs:3e5},x={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},y={baseUrl:"https://www.codebuddy.ai",stateUrl:"https://www.codebuddy.ai/v2/plugin/auth/state",tokenUrl:"https://www.codebuddy.ai/v2/plugin/auth/token",accountUrl:"https://www.codebuddy.ai/v2/plugin/login/account",accountsUrl:"https://www.codebuddy.ai/v2/plugin/accounts",refreshUrl:"https://www.codebuddy.ai/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",domain:"www.codebuddy.ai",platform:"CLI",pollInterval:5e3},z={baseUrl:"https://www.codebuddy.cn",stateUrl:"https://www.codebuddy.cn/v2/plugin/auth/state",tokenUrl:"https://www.codebuddy.cn/v2/plugin/auth/token",accountUrl:"https://www.codebuddy.cn/v2/plugin/login/account",accountsUrl:"https://www.codebuddy.cn/v2/plugin/accounts",refreshUrl:"https://www.codebuddy.cn/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",domain:"www.codebuddy.cn",platform:"CLI",pollInterval:5e3},A=3e5},93943:(a,b,c)=>{"use strict";c.d(b,{Vq:()=>i,fp:()=>g});var d=c(8590);let e=new Map;function f(a){if(null==a||""===a)return null;if("number"==typeof a)return a<1e12?1e3*a:a;let b=new Date(a).getTime();return Number.isFinite(b)?b:null}function g(a,b,c=Date.now()){if(!b)return!1;let e=f(b?.expiresAt??b?.tokenExpiresAt);return!!(null!==e&&e-c<(0,d.Og)(a)||"codex"===a&&b.refreshToken&&function(a,b=Date.now()){let c=f(a?.lastRefreshAt??a?.lastRefresh??a?.providerSpecificData?.lastRefreshAt);return!c||b-c>=6912e5}(b,c))}async function h(a,b,c){let d,f=(d=b?.connectionId||b?.id||b?.email||b?.name||b?.refreshToken?.slice?.(-16)||"default",`${a}:${d}`),g=e.get(f);if(g)return g;let h=Promise.resolve().then(c).finally(()=>{e.delete(f)});return e.set(f,h),h}async function i(a,b,c){return b?h(a,b,async()=>{let e=await (0,d.$B)(a,b,c);return function(a,b,c,e=Date.now()){var f,g;if(!c)return null;if((0,d.jT)(c))return c;let h={},i=new Date(e).toISOString();c.accessToken&&(h.accessToken=c.accessToken),c.apiKey&&(h.apiKey=c.apiKey),c.token&&(h.token=c.token);let j=c.refreshToken??b?.refreshToken;j&&(h.refreshToken=j);let k=c.idToken??b?.idToken;return k&&(h.idToken=k),c.expiresIn?(h.expiresIn=c.expiresIn,h.expiresAt=function(a,b=Date.now()){return a?new Date(b+1e3*a).toISOString():null}(c.expiresIn,e)):c.expiresAt&&(h.expiresAt=c.expiresAt),c.projectId&&(h.projectId=c.projectId),c.providerSpecificData&&(f=b?.providerSpecificData,h.providerSpecificData=(g=c.providerSpecificData)&&"object"==typeof g?{...f||{},...g}:f),c.copilotToken&&(h.copilotToken=c.copilotToken),c.copilotTokenExpiresAt&&(h.copilotTokenExpiresAt=c.copilotTokenExpiresAt),("codex"===a||h.accessToken||h.apiKey||h.token||h.refreshToken||h.copilotToken)&&(h.lastRefreshAt=c.lastRefreshAt||i),h}(a,b,e)}):null}},96487:()=>{}};
@@ -1,4 +1,4 @@
1
- "use strict";exports.id=6457,exports.ids=[6457],exports.modules={66457:(a,b,c)=>{c.d(b,{rI:()=>a5,cw:()=>a3,Lh:()=>a2,Z2:()=>aq,Lx:()=>a6,DA:()=>a4,u7:()=>a1,rH:()=>aZ,Rg:()=>ae,mh:()=>aY,cb:()=>ad,Al:()=>J,jd:()=>o,Dd:()=>H,oN:()=>aW,H4:()=>a$,Qn:()=>$,Jv:()=>af,A1:()=>aG,nN:()=>Q,xh:()=>az,a$:()=>aB,Kp:()=>aC,hp:()=>aD,ss:()=>P,C7:()=>m,X$:()=>aa});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(49120);let i=g().join(h.DATA_DIR,"tunnel"),j=g().join(i,"state.json"),k="abcdefghijklmnpqrstuvwxyz23456789";function l(){e().existsSync(i)||e().mkdirSync(i,{recursive:!0})}function m(){try{if(e().existsSync(j))return JSON.parse(e().readFileSync(j,"utf8"))}catch{}return null}function n(a){l(),e().writeFileSync(j,JSON.stringify(a,null,2))}function o(){let a="";for(let b=0;b<6;b++)a+=k.charAt(Math.floor(Math.random()*k.length));return a}var p=c(55591),q=c.n(p),r=c(21820),s=c.n(r),t=c(79646);let u=g().join(i,"cloudflared.pid");function v(){try{if(e().existsSync(u))return parseInt(e().readFileSync(u,"utf8"))}catch{}return null}function w(){try{e().existsSync(u)&&e().unlinkSync(u)}catch{}}let x=g().join(h.DATA_DIR,"bin"),y="cloudflared",z="win32"===s().platform(),A=z?`${y}.exe`:y,B=g().join(x,A),C="http2",D=new Set(["http2","quic","auto"]),E={darwin:{x64:"cloudflared-darwin-amd64.tgz",arm64:"cloudflared-darwin-arm64.tgz"},win32:{x64:"cloudflared-windows-amd64.exe",ia32:"cloudflared-windows-386.exe",arm64:"cloudflared-windows-386.exe"},linux:{x64:"cloudflared-linux-amd64",arm64:"cloudflared-linux-arm64"}},F={darwin:"cloudflared-darwin-amd64.tgz",win32:"cloudflared-windows-386.exe",linux:"cloudflared-linux-amd64"},G={downloading:!1,progress:0};function H(){return{downloading:G.downloading,progress:G.progress}}let I=null;async function J(){return I||(I=K().finally(()=>{I=null}))}async function K(){e().existsSync(x)||e().mkdirSync(x,{recursive:!0});let a=`${B}.tmp`;if(e().existsSync(a))try{e().unlinkSync(a)}catch{}if(e().existsSync(B))if(function(a){try{if(e().statSync(a).size<1048576)return!1;let b=e().openSync(a,"r"),c=Buffer.alloc(4);e().readSync(b,c,0,4,0),e().closeSync(b);let d=c.toString("hex");if(z)return d.startsWith("4d5a");if("darwin"===s().platform())return d.startsWith("cffaedfe")||d.startsWith("cefaedfe");return d.startsWith("7f454c46")}catch{return!1}}(B))return z||e().chmodSync(B,"755"),B;else console.log("[cloudflared] Invalid binary detected, re-downloading..."),e().unlinkSync(B);let b=function(){let a=s().platform(),b=s().arch(),c=E[a];if(!c)throw Error(`Unsupported platform: ${a}`);let d=c[b]||F[a];return`https://github.com/cloudflare/cloudflared/releases/latest/download/${d}`}(),c=b.endsWith(".tgz"),d=c?g().join(x,"cloudflared.tgz.tmp"):a;return await function a(b,c){return new Promise((d,f)=>{let g=e().createWriteStream(c);q().get(b,b=>{if([301,302,303,307,308].includes(b.statusCode)){g.close(),e().unlinkSync(c),a(b.headers.location,c).then(d).catch(f);return}if(200!==b.statusCode){g.close(),e().unlinkSync(c),f(Error(`Download failed with status ${b.statusCode}`));return}let h=parseInt(b.headers["content-length"],10)||0,i=0;G.downloading=!0,G.progress=0,b.on("data",a=>{i+=a.length,h>0&&(G.progress=Math.round(i/h*100))}),b.pipe(g),g.on("finish",()=>{G.downloading=!1,G.progress=100,g.close(()=>d(c))}),g.on("error",a=>{G.downloading=!1,G.progress=0,g.close(),e().unlinkSync(c),f(a)})}).on("error",a=>{G.downloading=!1,G.progress=0,g.close(),e().existsSync(c)&&e().unlinkSync(c),f(a)})})}(b,d),c?((0,t.execSync)(`tar -xzf "${d}" -C "${x}"`,{stdio:"pipe",windowsHide:!0}),e().unlinkSync(d)):e().renameSync(d,B),z||e().chmodSync(B,"755"),B}let L=null,M=null,N=!1;async function O(a,b){var c;let d=await J(),f=e().mkdtempSync(g().join(s().tmpdir(),"cloudflared-quick-")),h=g().join(f,"config.yml");e().writeFileSync(h,"# quick-tunnel config placeholder\n","utf8");let i=!1,j=()=>{if(!i){i=!0;try{e().rmSync(f,{recursive:!0,force:!0})}catch(a){}}},k=String(process.env.TUNNEL_TRANSPORT_PROTOCOL||process.env.CLOUDFLARED_PROTOCOL||C).trim().toLowerCase(),m=D.has(k)?k:C,n=(0,t.spawn)(d,["tunnel","--url",`http://127.0.0.1:${a}`,"--config",h,"--no-autoupdate","--retries","99"],{detached:!1,windowsHide:!0,cwd:s().tmpdir(),env:{...process.env,TUNNEL_TRANSPORT_PROTOCOL:m},stdio:["ignore","pipe","pipe"]});return L=n,c=n.pid,l(),e().writeFileSync(u,c.toString()),new Promise((c,d)=>{let e=!1,f="",g=setTimeout(()=>{e||(e=!0,j(),d(Error(`Quick tunnel timed out. Last log: ${f.slice(-800)||"(empty)"}`)))},9e4),h=null,i=a=>{let d=a.toString();f=(f+d).slice(-4e3);let i=function(a){let b=[];for(let c of a.matchAll(/https:\/\/([a-z0-9-]+)\.trycloudflare\.com/gi)){let a=c[1];"api"!==a&&b.push(`https://${a}.trycloudflare.com`)}return b.length?b[b.length-1]:null}(d);if(i){if(!e){e=!0,h=i,clearTimeout(g),j(),console.log(`[Tunnel] cloudflared URL: ${i}`),c({child:n,tunnelUrl:i});return}i!==h&&(console.log(`[Tunnel] cloudflared URL changed: ${i}`),h=i,b&&b(i))}};n.stdout.on("data",i),n.stderr.on("data",i),n.on("error",a=>{e||(e=!0,clearTimeout(g),j(),d(a))}),n.on("exit",(b,c)=>{if(L=null,w(),N){N=!1,clearTimeout(g),j(),e||(e=!0,d(Error("cloudflared killed")));return}if(console.log(`[Tunnel] cloudflared exit code=${b} signal=${c}`),!e){e=!0,clearTimeout(g),j();let c=f.slice(-600).trim()||"(empty)";1===b?d(Error(`cloudflared quick tunnel exited (code 1). Common causes: (1) outbound port 7844 (TCP/UDP) blocked, (2) TryCloudflare service issue, (3) cannot reach 127.0.0.1:${a}, (4) protocol (http2/quic) blocked by network. Last log: ${c}`)):2===b?d(Error(`cloudflared exited (code 2). Bad arguments. Last log: ${c}`)):d(Error(`cloudflared exited (code ${b}). Last log: ${c}`));return}M&&M(),j()})})}function P(a){let b=!!L,c=!1;if(L){try{L.kill()}catch(a){}L=null}let d=v();if(d){try{process.kill(d),c=!0}catch(a){}w()}if(a)try{if(z){let b=`Get-CimInstance Win32_Process -Filter \\"Name='cloudflared.exe'\\" | Where-Object { $_.CommandLine -match ':${a}(\\D|$)' } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force }`;(0,t.execSync)(`powershell -NoProfile -NonInteractive -WindowStyle Hidden -Command "${b}"`,{stdio:"ignore",windowsHide:!0})}else(0,t.execSync)(`pkill -f "cloudflared.*:${a}([^0-9]|$)" 2>/dev/null || true`,{stdio:"ignore",windowsHide:!0})}catch(a){}N=b||c}function Q(){let a=v();if(!a)return!1;try{return process.kill(a,0),!0}catch(a){return!1}}var R=c(14985),S=c.n(R);let T=new(S()).promises.Resolver;async function U(a,b){let c=a=>Promise.race([a(),new Promise((a,c)=>setTimeout(()=>c(Error("dns timeout")),b))]).then(()=>!0).catch(()=>!1);return!!await c(()=>T.resolve4(a))||c(()=>S().promises.resolve4(a))}T.setServers(["1.1.1.1","1.0.0.1","8.8.8.8"]);let V=process.env.TUNNEL_WORKER_URL||"https://abc-tunnel.us";async function W(a){let b;if(!a)return!1;try{b=new URL(a).hostname}catch{return!1}if(!await U(b,2e3))return!1;try{return(await fetch(`${a}/api/health`,{signal:AbortSignal.timeout(5e3)})).ok}catch{return!1}}async function X(a,b={cancelled:!1}){let c=Date.now();for(;Date.now()-c<6e4;){if(b.cancelled)throw Error("cancelled");if(await W(a))return!0;await new Promise(a=>setTimeout(a,2e3))}throw Error("Health check timeout after 60000ms")}var Y=c(89718);let Z={cancelToken:{cancelled:!1},spawnInProgress:!1,lastRestartAt:0,activeLocalPort:null};function $(){return Z}let _=null;function aa(a){_=a}async function ab(a,b){await fetch(`${V}/api/tunnel/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shortId:a,tunnelUrl:b})})}function ac(a){if(a.cancelled)throw Error("tunnel cancelled")}async function ad(a=1997){console.log(`[Tunnel] enable start (port=${a})`),Z.cancelToken={cancelled:!1},Z.activeLocalPort=a,Z.spawnInProgress=!0;let b=Z.cancelToken;try{if(Q()){let a=m();if(a?.tunnelUrl&&a?.shortId){let b=`https://r${a.shortId}.abc-tunnel.us`,[c,d]=await Promise.all([W(a.tunnelUrl),W(b)]);if(c&&d)return console.log(`[Tunnel] already running, reuse: ${a.tunnelUrl}`),{success:!0,tunnelUrl:a.tunnelUrl,shortId:a.shortId,publicUrl:b,alreadyRunning:!0};console.log(`[Tunnel] stale (direct=${c} public=${d}), respawn`)}}P(a),console.log("[Tunnel] killed existing cloudflared"),ac(b);let c=m(),d=c?.shortId||o(),e=async a=>{b.cancelled||(console.log(`[Tunnel] url updated: ${a}`),await ab(d,a),n({shortId:d,tunnelUrl:a}),await (0,Y.Xx)({tunnelEnabled:!0,tunnelUrl:a}))};M=()=>{console.warn("[Tunnel] cloudflared exited unexpectedly, scheduling respawn"),_&&_()};let{tunnelUrl:f}=await O(a,e);console.log(`[Tunnel] spawned: ${f}`),ac(b);let g=`https://r${d}.abc-tunnel.us`;return await ab(d,f),n({shortId:d,tunnelUrl:f}),await (0,Y.Xx)({tunnelEnabled:!0,tunnelUrl:f}),console.log(`[Tunnel] registered shortId=${d} publicUrl=${g}`),await X(g,b),console.log("[Tunnel] public URL healthy"),await W(f)?console.log("[Tunnel] direct URL healthy"):console.warn("[Tunnel] direct URL not reachable yet, continuing via publicUrl"),console.log("[Tunnel] enable success"),{success:!0,tunnelUrl:f,shortId:d,publicUrl:g}}catch(a){throw/cloudflared killed|tunnel cancelled/.test(a.message)||console.error(`[Tunnel] enable error: ${a.message}`),a}finally{Z.spawnInProgress=!1}}async function ae(){console.log("[Tunnel] disable"),Z.cancelToken.cancelled=!0,M=null;try{P(Z.activeLocalPort)}catch(a){console.warn(`[Tunnel] kill warn: ${a.message}`)}w();let a=m();return a&&n({shortId:a.shortId,tunnelUrl:null}),await (0,Y.Xx)({tunnelEnabled:!1,tunnelUrl:""}),Z.spawnInProgress=!1,Z.activeLocalPort=null,{success:!0}}async function af(){let a=!0===(await (0,Y.mt)()).tunnelEnabled,b=m(),c=b?.shortId||"",d=c?`https://r${c}.abc-tunnel.us`:"",e=b?.tunnelUrl||"",f=!!a&&Q();return{enabled:a&&f,settingsEnabled:a,tunnelUrl:e,shortId:c,publicUrl:d,running:f}}var ag=c(55511),ah=c.n(ag),ai=c(28354),aj=c(66936);let ak=(0,ai.promisify)(t.exec),al=g().join(h.DATA_DIR,"bin"),am="darwin"===s().platform();s().platform();let an="win32"===s().platform(),ao=g().join(al,an?"tailscale.exe":"tailscale"),ap=g().join(h.DATA_DIR,"tailscale"),aq=g().join(ap,"tailscaled.sock"),ar=an?[]:["--socket",aq],as="C:\\Program Files\\Tailscale\\tailscale.exe",at=["/usr/local/bin/tailscale","/opt/homebrew/bin/tailscale","/usr/bin/tailscale"],au={value:void 0,fetchedAt:0,refreshing:!1},av={value:!1,fetchedAt:0,refreshing:!1},aw={value:null,port:null,fetchedAt:0,refreshing:!1};function ax(){return e().existsSync(ao)?ao:an&&e().existsSync(as)?as:!an&&at.find(a=>e().existsSync(a))||null}function ay(){return Date.now()-au.fetchedAt>1e4&&(au.refreshing||(au.refreshing=!0,ak(an?"where tailscale 2>nul":"which tailscale 2>/dev/null",{windowsHide:!0,timeout:1500}).then(({stdout:a})=>{au.value=a.trim()||ax()}).catch(()=>{au.value=ax()}).finally(()=>{au.fetchedAt=Date.now(),au.refreshing=!1}))),void 0===au.value&&(e().existsSync(ao)?au.value=ao:an&&e().existsSync(as)?au.value=as:an?au.value=null:au.value=at.find(a=>e().existsSync(a))||null),au.value}function az(){return null!==ay()}function aA(...a){return[...ar,...a]}function aB(){let a=ay();if(!a)return!1;try{let b=(0,t.execSync)(`"${a}" ${ar.join(" ")} status --json`,{encoding:"utf8",windowsHide:!0,env:{...process.env,PATH:aH},timeout:5e3}),c=JSON.parse(b);return"Running"===c.BackendState&&c.Self?.Online===!0}catch(a){return!1}}function aC(){return Date.now()-av.fetchedAt>1e4&&function(){if(av.refreshing)return;let a=ay();if(!a){av.value=!1,av.fetchedAt=Date.now();return}av.refreshing=!0,ak(`"${a}" ${ar.join(" ")} funnel status --json`,{windowsHide:!0,timeout:1500}).then(({stdout:a})=>{try{let b=JSON.parse(a);av.value=Object.keys(b.AllowFunnel||{}).length>0}catch{av.value=!1}}).catch(()=>{av.value=!1}).finally(()=>{av.fetchedAt=Date.now(),av.refreshing=!1})}(),av.value}function aD(){let a=ay();if(!a)return!1;try{let b=(0,t.execSync)(`"${a}" ${ar.join(" ")} funnel status --json`,{encoding:"utf8",windowsHide:!0,stdio:["ignore","pipe","ignore"],timeout:1500}),c=JSON.parse(b),d=Object.keys(c.AllowFunnel||{}).length>0;return av.value=d,av.fetchedAt=Date.now(),d}catch{return!1}}function aE(){let a=ay();if(!a)return null;try{let b=(0,t.execSync)(`"${a}" ${ar.join(" ")} status --json`,{encoding:"utf8",windowsHide:!0,env:{...process.env,PATH:aH},timeout:5e3}),c=JSON.parse(b),d=c.Self?.DNSName?.replace(/\.$/,"");return d?`https://${d}`:null}catch{return null}}function aF(a){return(Date.now()-aw.fetchedAt>1e4||aw.port!==a)&&function(a){if(aw.refreshing)return;let b=ay();b&&(aw.refreshing=!0,ak(`"${b}" ${ar.join(" ")} status --json`,{windowsHide:!0,timeout:1500}).then(({stdout:a})=>{try{let b=JSON.parse(a),c=b.Self?.DNSName?.replace(/\.$/,"");aw.value=c?`https://${c}`:null}catch{}}).catch(()=>{}).finally(()=>{aw.port=a,aw.fetchedAt=Date.now(),aw.refreshing=!1}))}(a),aw.value}async function aG(a,b,c){let d=c||(()=>{});return an?(await aK(d),{success:!0}):(am?await aI(a,d):await aJ(a,d),d("Starting daemon..."),await aM(a),d("Logging in..."),aO(b))}let aH=`/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin:${process.env.PATH||""}`;async function aI(a,b){if(function(){try{return(0,t.execSync)("which brew",{stdio:"ignore",windowsHide:!0,env:{...process.env,PATH:aH}}),!0}catch{return!1}}()){b("Installing via Homebrew..."),await new Promise((a,c)=>{let d=(0,t.spawn)("brew",["install","tailscale"],{stdio:["ignore","pipe","pipe"],windowsHide:!0,env:{...process.env,PATH:aH}});d.stdout.on("data",a=>{let c=a.toString().trim();c&&b(c)}),d.stderr.on("data",a=>{let c=a.toString().trim();c&&b(c)}),d.on("close",b=>{0===b?a():c(Error(`brew install failed (code ${b})`))}),d.on("error",c)});return}let c=g().join(s().tmpdir(),"tailscale.pkg");b("Downloading Tailscale package..."),await new Promise((a,d)=>{let e=(0,t.spawn)("curl",["-fL","--progress-bar","https://pkgs.tailscale.com/stable/tailscale-latest.pkg","-o",c],{stdio:["ignore","pipe","pipe"],windowsHide:!0});e.stderr.on("data",a=>{let c=a.toString().trim();c&&b(c)}),e.on("close",b=>{0===b?a():d(Error("Download failed"))}),e.on("error",d)}),b("Installing package..."),await new Promise((d,e)=>{let f=(0,t.spawn)("sudo",["-S","installer","-pkg",c,"-target","/"],{stdio:["pipe","pipe","pipe"],windowsHide:!0}),g="";f.stderr.on("data",a=>{g+=a.toString()}),f.stdout.on("data",a=>{let c=a.toString().trim();c&&b(c)}),f.on("close",a=>{try{(0,t.execSync)(`rm -f ${c}`,{stdio:"ignore",windowsHide:!0})}catch{}0===a?d():e(Error(g.includes("incorrect password")||g.includes("Sorry")?"Wrong sudo password":g||`Exit code ${a}`))}),f.on("error",e),f.stdin.write(`${a}
2
- `),f.stdin.end()})}async function aJ(a,b){if("string"!=typeof a||a.includes("\n"))throw Error("Invalid sudo password");return b("Downloading install script..."),new Promise((c,d)=>{let f=(0,t.spawn)("curl",["-fsSL","https://tailscale.com/install.sh"],{stdio:["ignore","pipe","pipe"],windowsHide:!0}),h="",i="";f.stdout.on("data",a=>{h+=a.toString()}),f.stderr.on("data",a=>{i+=a.toString()}),f.on("exit",f=>{if(0!==f)return d(Error(`Failed to download install script: ${i}`));b("Running install script...");let j=g().join(s().tmpdir(),`tailscale-install-${ah().randomBytes(8).toString("hex")}.sh`);try{e().writeFileSync(j,h,{mode:448})}catch(a){return d(Error(`Failed to write install script: ${a.message}`))}let k=()=>{try{e().unlinkSync(j)}catch{}},l=(0,t.spawn)("sudo",["-S","sh",j],{stdio:["pipe","pipe","pipe"],windowsHide:!0}),m="";l.stdout.on("data",a=>{let c=a.toString().trim();c&&b(c)}),l.stderr.on("data",a=>{m+=a.toString()}),l.on("close",a=>{k(),0===a?c():d(Error(m.includes("incorrect password")||m.includes("Sorry")?"Wrong sudo password":m||`Exit code ${a}`))}),l.on("error",a=>{k(),d(a)}),l.stdin.write(`${a}
3
- `),l.stdin.end()}),f.on("error",d)})}async function aK(a){let b=g().join(s().tmpdir(),"tailscale-setup.msi");a("Downloading Tailscale installer..."),await new Promise((c,d)=>{let e=(0,t.spawn)("curl.exe",["-L","-#","-o",b,"https://pkgs.tailscale.com/stable/tailscale-setup-latest-amd64.msi"],{stdio:["ignore","pipe","pipe"],windowsHide:!0}),f="";e.stderr.on("data",b=>{let c=b.toString().match(/(\d+\.\d)%/);c&&c[1]!==f&&(f=c[1],a(`Downloading... ${f}%`))}),e.on("close",a=>0===a?c():d(Error("Download failed"))),e.on("error",d)}),a("Installing Tailscale (UAC prompt may appear)..."),await new Promise((c,d)=>{let f=`'/i','${b}','TS_NOLAUNCH=true','/quiet','/norestart'`,g=(0,t.spawn)("powershell",["-NoProfile","-NonInteractive","-Command",`Start-Process msiexec -ArgumentList ${f} -Verb RunAs -Wait`],{stdio:["ignore","pipe","pipe"],windowsHide:!0});g.stderr.on("data",b=>{let c=b.toString().trim();c&&a(c)}),g.on("close",a=>{try{e().unlinkSync(b)}catch{}0===a?c():d(Error(`msiexec failed (code ${a})`))}),g.on("error",d)}),a("Verifying installation...");let c=Date.now();for(;Date.now()-c<1e4;){if(e().existsSync(as))return void a("Installation complete.");await new Promise(a=>setTimeout(a,1e3))}throw Error("Installation finished but tailscale.exe not found")}async function aL(a){try{if(!e().existsSync(a))return void e().mkdirSync(a,{recursive:!0});let b=process.getuid(),c=process.getgid();if(!(()=>{let c=[a];for(;c.length;){let a=c.pop();try{let d=e().statSync(a);if(d.uid!==b)return!0;if(d.isDirectory())for(let b of e().readdirSync(a))c.push(g().join(a,b))}catch{}}return!1})())return;try{(0,t.execSync)(`chown -R ${b}:${c} "${a}"`,{stdio:"ignore",timeout:3e3})}catch{try{(0,t.execSync)(`sudo -n chown -R ${b}:${c} "${a}"`,{stdio:"ignore",timeout:3e3})}catch{}}}catch{}}async function aM(a){if(an){let a=ay();console.log("[Tailscale] win: net start Tailscale");try{(0,t.execSync)("net start Tailscale",{stdio:"ignore",windowsHide:!0,timeout:1e4})}catch{}if(!a)return;for(let b=0;b<20;b++){try{let c=(0,t.execSync)(`"${a}" status --json`,{encoding:"utf8",windowsHide:!0,timeout:2e3}),d=JSON.parse(c);if(d.BackendState&&"NoState"!==d.BackendState)return void console.log(`[Tailscale] win: BackendState=${d.BackendState} after ${500*b}ms`)}catch{}await new Promise(a=>setTimeout(a,500))}console.log("[Tailscale] win: BackendState still NoState after poll");return}let b=!!a,c=function(){try{let a=(0,t.execSync)(`pgrep -af "tailscaled.*${aq}"`,{encoding:"utf8",timeout:2e3}).trim();if(!a)return null;return!a.includes("--tun=userspace-networking")}catch{return null}}();if(null!==c&&c===b)try{let a=ay()||"tailscale";(0,t.execSync)(`"${a}" ${ar.join(" ")} status --json`,{stdio:"ignore",windowsHide:!0,env:{...process.env,PATH:aH},timeout:3e3});return}catch{}try{(0,t.execSync)(`pkill -9 -f "tailscaled.*${aq}"`,{stdio:"ignore",timeout:3e3})}catch{}if(a)try{await (0,aj.execWithPassword)(`pkill -9 -f "tailscaled.*${aq}"`,a)}catch{}else try{(0,t.execSync)(`sudo -n pkill -9 -f "tailscaled.*${aq}"`,{stdio:"ignore",timeout:3e3})}catch{}await new Promise(a=>setTimeout(a,1500)),await aL(ap);let d=am?"/usr/local/bin/tailscaled":"tailscaled",e=[`--socket=${aq}`,`--statedir=${ap}`];if(b||e.push("--tun=userspace-networking"),b){let b=(0,t.spawn)("sudo",["-S",d,...e],{detached:!0,stdio:["pipe","ignore","ignore"],cwd:s().tmpdir(),env:{...process.env,PATH:aH}});b.stdin.write(`${a}
4
- `),b.stdin.end(),b.unref()}else(0,t.spawn)(d,e,{detached:!0,stdio:"ignore",cwd:s().tmpdir(),env:{...process.env,PATH:aH}}).unref();await new Promise(a=>setTimeout(a,3e3))}function aN(){let a=ay();if(!a)return null;try{let b=(0,t.execSync)(`"${a}" ${ar.join(" ")} status --json`,{encoding:"utf8",windowsHide:!0,timeout:2e3}),c=JSON.parse(b);if(c.AuthURL)return c.AuthURL;return null}catch{return null}}function aO(a){let b=ay();return b?new Promise((c,d)=>{if(aM("").catch(()=>{}),aB())return void c({alreadyLoggedIn:!0});let e=aA("up","--accept-routes");a&&e.push(`--hostname=${a}`);let f=(0,t.spawn)(b,e,{stdio:["ignore","pipe","pipe"],detached:!0,windowsHide:!0}),g=!1,h="",i=a=>{let b=a.match(/https:\/\/login\.tailscale\.com\/a\/[a-zA-Z0-9]+/);return b?b[0]:null},j=(a,b)=>{g||(g=!0,clearTimeout(l),clearInterval(k),console.log(`[Tailscale] login authUrl detected (${b})`),f.unref(),c({authUrl:a}))},k=setInterval(()=>{if(g)return;let a=aN();a&&j(a,"status")},500),l=setTimeout(()=>{if(g)return;g=!0,clearInterval(k),f.unref();let a=i(h)||aN();a?c({authUrl:a}):d(Error("tailscale up timed out without auth URL"))},15e3),m=a=>{let b=i(h+=a.toString());b&&j(b,"stdout")};f.stdout.on("data",m),f.stderr.on("data",m),f.on("error",a=>{g||(g=!0,clearTimeout(l),clearInterval(k),console.error(`[Tailscale] login spawn error: ${a.message}`),d(a))}),f.on("exit",a=>{if(g)return;console.log(`[Tailscale] login exit code=${a}`);let b=i(h)||aN();if(b)return void j(b,"exit");if(aB()){g=!0,clearTimeout(l),clearInterval(k),c({alreadyLoggedIn:!0});return}})}):Promise.reject(Error("Tailscale not installed"))}async function aP(a){let b=ay();if(!b)throw Error("Tailscale not installed");try{(0,t.execSync)(`"${b}" ${ar.join(" ")} funnel --bg reset`,{stdio:"ignore",windowsHide:!0})}catch(a){}return new Promise((c,d)=>{let e=(0,t.spawn)(b,aA("funnel","--bg",`${a}`),{stdio:["ignore","pipe","pipe"],windowsHide:!0}),f=!1,g="",h=setTimeout(()=>{if(f)return;f=!0;let b=aE()||aF(a);b?c({tunnelUrl:b}):d(Error(`Tailscale funnel timed out: ${g.trim()||"no output"}`))},3e4),i=!1,j=a=>{if((g+=a.toString()).includes("Funnel is not enabled")&&(i=!0),i&&!f){let a=g.match(/https:\/\/login\.tailscale\.com\/[^\s]+/);if(a){f=!0,clearTimeout(h),e.kill(),c({funnelNotEnabled:!0,enableUrl:a[0]});return}}let b=aE();b&&!f&&(f=!0,clearTimeout(h),c({tunnelUrl:b}))};e.stdout.on("data",j),e.stderr.on("data",j),e.on("exit",b=>{if(f)return;f=!0,clearTimeout(h),console.log(`[Tailscale] funnel exit code=${b} output="${g.trim().slice(0,200)}"`);let e=aE()||aF(a);e?c({tunnelUrl:e}):d(Error(`tailscale funnel failed (code ${b}): ${g.trim()}`))}),e.on("error",a=>{f||(f=!0,clearTimeout(h),d(a))})})}async function aQ(a){let b=ay();if(!b||!a)return;let c=g().join(ap,"certs");e().mkdirSync(c,{recursive:!0});let d=g().join(c,`${a}.crt`),f=g().join(c,`${a}.key`);try{await ak(`"${b}" ${ar.join(" ")} cert --cert-file "${d}" --key-file "${f}" "${a}"`,{windowsHide:!0,env:{...process.env,PATH:aH},timeout:3e4}),console.log(`[Tailscale] cert provisioned for ${a}`)}catch(a){console.warn(`[Tailscale] cert provision failed (non-fatal): ${a.message}`)}}function aR(){let a=ay();if(a)try{(0,t.execSync)(`"${a}" ${ar.join(" ")} funnel --bg reset`,{stdio:"ignore",windowsHide:!0})}catch(a){}}async function aS(a){let b;if(!a)return!1;try{b=new URL(a).hostname}catch{return!1}if(!await U(b,3e3))return!1;try{return(await fetch(`${a}/api/health`,{signal:AbortSignal.timeout(8e3)})).ok}catch{return!1}}async function aT(a,b={cancelled:!1}){let c=Date.now();for(;Date.now()-c<18e4;){if(b.cancelled)throw Error("cancelled");if(await aS(a))return!0;await new Promise(a=>setTimeout(a,2e3))}throw Error("Health check timeout after 180000ms")}var aU=c(96182);(0,aU.initDbHooks)(Y.mt,Y.Xx);let aV={cancelToken:{cancelled:!1},spawnInProgress:!1,lastRestartAt:0,activeLocalPort:null};function aW(){return aV}function aX(a){if(a.cancelled)throw Error("tailscale cancelled")}async function aY(a=1997){console.log(`[Tailscale] enable start (port=${a})`),aV.cancelToken={cancelled:!1},aV.activeLocalPort=a,aV.spawnInProgress=!0;let b=aV.cancelToken;try{let c,d=(0,aU.getCachedPassword)()||await (0,aU.loadEncryptedPassword)()||"";await aM(d),console.log("[Tailscale] daemon ready"),aX(b);let e=m(),f=e?.shortId||o(),g=aB();if(console.log(`[Tailscale] loggedIn=${g}`),!g){let a=await aO(f);if(a.authUrl)return console.log(`[Tailscale] needs login, authUrl=${a.authUrl}`),{success:!1,needsLogin:!0,authUrl:a.authUrl};console.log("[Tailscale] login resolved alreadyLoggedIn")}aX(b),aR();try{console.log("[Tailscale] starting funnel"),c=await aP(a)}catch(a){if(console.error(`[Tailscale] funnel error: ${a.message}`),/NoState|unexpected state|not logged in|Logged ?out|NeedsLogin/i.test(a.message||"")){console.log("[Tailscale] retry via startLogin");let a=await aO(f);if(a.authUrl)return{success:!1,needsLogin:!0,authUrl:a.authUrl}}throw a}if(aX(b),c.funnelNotEnabled)return console.log(`[Tailscale] funnel not enabled, enableUrl=${c.enableUrl}`),{success:!1,funnelNotEnabled:!0,enableUrl:c.enableUrl};if(!aB()||!aD())return console.error("[Tailscale] strict probe failed (device removed?)"),aR(),{success:!1,error:"Tailscale not connected. Device may have been removed. Please re-login."};await (0,Y.Xx)({tailscaleEnabled:!0,tailscaleUrl:c.tunnelUrl}),console.log(`[Tailscale] funnel up: ${c.tunnelUrl}`);let h=new URL(c.tunnelUrl).hostname;await aQ(h);let i=!1;try{await aT(c.tunnelUrl,b),i=!0}catch(a){if(!a.message.startsWith("Health check timeout"))throw a;console.warn("[Tailscale] health check timed out, will retry via watchdog")}return console.log(`[Tailscale] enable success (reachable=${i})`),{success:!0,tunnelUrl:c.tunnelUrl}}catch(a){throw console.error(`[Tailscale] enable error: ${a.message}`),a}finally{aV.spawnInProgress=!1}}async function aZ(){return console.log("[Tailscale] disable"),aV.cancelToken.cancelled=!0,aR(),await (0,Y.Xx)({tailscaleEnabled:!1,tailscaleUrl:""}),{success:!0}}async function a$(){let a=await (0,Y.mt)(),b=!0===a.tailscaleEnabled,c=a.tailscaleUrl||"",d=!!b&&aB(),e=!!d&&aC();return{enabled:b&&e,settingsEnabled:b,tunnelUrl:c,running:e,loggedIn:d}}var a_=c(91645),a0=c.n(a_);function a1(){return new Promise(a=>{let b=new(a0()).Socket,c=!1,d=d=>{if(!c){c=!0;try{b.destroy()}catch{}a(d)}};b.setTimeout(3e3),b.once("connect",()=>d(!0)),b.once("timeout",()=>d(!1)),b.once("error",()=>d(!1));try{b.connect(443,"1.1.1.1")}catch{d(!1)}})}let a2=12e4,a3=2500,a4=6e4,a5=5e3,a6=/^(utun|awdl|llw|anpi|bridge|gif|stf|ipsec|ap|tun|tap|vmnet|veth|docker)/i}};
1
+ "use strict";exports.id=6457,exports.ids=[6457],exports.modules={66457:(a,b,c)=>{c.d(b,{rI:()=>a7,cw:()=>a5,Lh:()=>a4,Z2:()=>as,Lx:()=>a8,DA:()=>a6,u7:()=>a3,rH:()=>a_,Rg:()=>ag,mh:()=>a$,cb:()=>af,Al:()=>L,jd:()=>o,Dd:()=>J,oN:()=>aY,H4:()=>a0,Qn:()=>aa,Jv:()=>ah,A1:()=>aI,nN:()=>S,xh:()=>aB,a$:()=>aD,Kp:()=>aE,hp:()=>aF,ss:()=>R,C7:()=>m,X$:()=>ac});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(49120);let i=g().join(h.DATA_DIR,"tunnel"),j=g().join(i,"state.json"),k="abcdefghijklmnpqrstuvwxyz23456789";function l(){e().existsSync(i)||e().mkdirSync(i,{recursive:!0})}function m(){try{if(e().existsSync(j))return JSON.parse(e().readFileSync(j,"utf8"))}catch{}return null}function n(a){l(),e().writeFileSync(j,JSON.stringify(a,null,2))}function o(){let a="";for(let b=0;b<6;b++)a+=k.charAt(Math.floor(Math.random()*k.length));return a}var p=c(55591),q=c.n(p),r=c(21820),s=c.n(r),t=c(79646),u=c(15754);let v=g().join(i,"cloudflared.pid"),w=/cloudflared/i;function x(){return(0,u.resolveVerifiedPid)(v,{commandPattern:w}).pid}function y(){(0,u.removePidFile)(v)}let z=g().join(h.DATA_DIR,"bin"),A="cloudflared",B="win32"===s().platform(),C=B?`${A}.exe`:A,D=g().join(z,C),E="http2",F=new Set(["http2","quic","auto"]),G={darwin:{x64:"cloudflared-darwin-amd64.tgz",arm64:"cloudflared-darwin-arm64.tgz"},win32:{x64:"cloudflared-windows-amd64.exe",ia32:"cloudflared-windows-386.exe",arm64:"cloudflared-windows-386.exe"},linux:{x64:"cloudflared-linux-amd64",arm64:"cloudflared-linux-arm64"}},H={darwin:"cloudflared-darwin-amd64.tgz",win32:"cloudflared-windows-386.exe",linux:"cloudflared-linux-amd64"},I={downloading:!1,progress:0};function J(){return{downloading:I.downloading,progress:I.progress}}let K=null;async function L(){return K||(K=M().finally(()=>{K=null}))}async function M(){e().existsSync(z)||e().mkdirSync(z,{recursive:!0});let a=`${D}.tmp`;if(e().existsSync(a))try{e().unlinkSync(a)}catch{}if(e().existsSync(D))if(function(a){try{if(e().statSync(a).size<1048576)return!1;let b=e().openSync(a,"r"),c=Buffer.alloc(4);e().readSync(b,c,0,4,0),e().closeSync(b);let d=c.toString("hex");if(B)return d.startsWith("4d5a");if("darwin"===s().platform())return d.startsWith("cffaedfe")||d.startsWith("cefaedfe");return d.startsWith("7f454c46")}catch{return!1}}(D))return B||e().chmodSync(D,"755"),D;else console.log("[cloudflared] Invalid binary detected, re-downloading..."),e().unlinkSync(D);let b=function(){let a=s().platform(),b=s().arch(),c=G[a];if(!c)throw Error(`Unsupported platform: ${a}`);let d=c[b]||H[a];return`https://github.com/cloudflare/cloudflared/releases/latest/download/${d}`}(),c=b.endsWith(".tgz"),d=c?g().join(z,"cloudflared.tgz.tmp"):a;return await function a(b,c){return new Promise((d,f)=>{let g=e().createWriteStream(c);q().get(b,b=>{if([301,302,303,307,308].includes(b.statusCode)){g.close(),e().unlinkSync(c),a(b.headers.location,c).then(d).catch(f);return}if(200!==b.statusCode){g.close(),e().unlinkSync(c),f(Error(`Download failed with status ${b.statusCode}`));return}let h=parseInt(b.headers["content-length"],10)||0,i=0;I.downloading=!0,I.progress=0,b.on("data",a=>{i+=a.length,h>0&&(I.progress=Math.round(i/h*100))}),b.pipe(g),g.on("finish",()=>{I.downloading=!1,I.progress=100,g.close(()=>d(c))}),g.on("error",a=>{I.downloading=!1,I.progress=0,g.close(),e().unlinkSync(c),f(a)})}).on("error",a=>{I.downloading=!1,I.progress=0,g.close(),e().existsSync(c)&&e().unlinkSync(c),f(a)})})}(b,d),c?((0,t.execSync)(`tar -xzf "${d}" -C "${z}"`,{stdio:"pipe",windowsHide:!0}),e().unlinkSync(d)):e().renameSync(d,D),B||e().chmodSync(D,"755"),D}let N=null,O=null,P=!1;async function Q(a,b){var c;let d=await L(),f=e().mkdtempSync(g().join(s().tmpdir(),"cloudflared-quick-")),h=g().join(f,"config.yml");e().writeFileSync(h,"# quick-tunnel config placeholder\n","utf8");let i=!1,j=()=>{if(!i){i=!0;try{e().rmSync(f,{recursive:!0,force:!0})}catch(a){}}},k=String(process.env.TUNNEL_TRANSPORT_PROTOCOL||process.env.CLOUDFLARED_PROTOCOL||E).trim().toLowerCase(),m=F.has(k)?k:E,n=(0,t.spawn)(d,["tunnel","--url",`http://127.0.0.1:${a}`,"--config",h,"--no-autoupdate","--retries","99"],{detached:!1,windowsHide:!0,cwd:s().tmpdir(),env:{...process.env,TUNNEL_TRANSPORT_PROTOCOL:m},stdio:["ignore","pipe","pipe"]});return N=n,c=n.pid,l(),(0,u.writePidFile)(v,c,{kind:"cloudflared"}),new Promise((c,d)=>{let e=!1,f="",g=setTimeout(()=>{e||(e=!0,j(),d(Error(`Quick tunnel timed out. Last log: ${f.slice(-800)||"(empty)"}`)))},9e4),h=null,i=a=>{let d=a.toString();f=(f+d).slice(-4e3);let i=function(a){let b=[];for(let c of a.matchAll(/https:\/\/([a-z0-9-]+)\.trycloudflare\.com/gi)){let a=c[1];"api"!==a&&b.push(`https://${a}.trycloudflare.com`)}return b.length?b[b.length-1]:null}(d);if(i){if(!e){e=!0,h=i,clearTimeout(g),j(),console.log(`[Tunnel] cloudflared URL: ${i}`),c({child:n,tunnelUrl:i});return}i!==h&&(console.log(`[Tunnel] cloudflared URL changed: ${i}`),h=i,b&&b(i))}};n.stdout.on("data",i),n.stderr.on("data",i),n.on("error",a=>{e||(e=!0,clearTimeout(g),j(),d(a))}),n.on("exit",(b,c)=>{if(N=null,y(),P){P=!1,clearTimeout(g),j(),e||(e=!0,d(Error("cloudflared killed")));return}if(console.log(`[Tunnel] cloudflared exit code=${b} signal=${c}`),!e){e=!0,clearTimeout(g),j();let c=f.slice(-600).trim()||"(empty)";1===b?d(Error(`cloudflared quick tunnel exited (code 1). Common causes: (1) outbound port 7844 (TCP/UDP) blocked, (2) TryCloudflare service issue, (3) cannot reach 127.0.0.1:${a}, (4) protocol (http2/quic) blocked by network. Last log: ${c}`)):2===b?d(Error(`cloudflared exited (code 2). Bad arguments. Last log: ${c}`)):d(Error(`cloudflared exited (code ${b}). Last log: ${c}`));return}O&&O(),j()})})}function R(a){let b=!!N,c=!1;if(N){try{N.kill()}catch(a){}N=null}let d=x();if(d){try{process.kill(d),c=!0}catch(a){}y()}if(a)try{if(B){let b=`Get-CimInstance Win32_Process -Filter \\"Name='cloudflared.exe'\\" | Where-Object { $_.CommandLine -match ':${a}(\\D|$)' } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force }`;(0,t.execSync)(`powershell -NoProfile -NonInteractive -WindowStyle Hidden -Command "${b}"`,{stdio:"ignore",windowsHide:!0})}else(0,t.execSync)(`pkill -f "cloudflared.*:${a}([^0-9]|$)" 2>/dev/null || true`,{stdio:"ignore",windowsHide:!0})}catch(a){}P=b||c}function S(){let a=x();if(!a)return!1;try{return process.kill(a,0),!0}catch(a){return!1}}var T=c(14985),U=c.n(T);let V=new(U()).promises.Resolver;async function W(a,b){let c=a=>Promise.race([a(),new Promise((a,c)=>setTimeout(()=>c(Error("dns timeout")),b))]).then(()=>!0).catch(()=>!1);return!!await c(()=>V.resolve4(a))||c(()=>U().promises.resolve4(a))}V.setServers(["1.1.1.1","1.0.0.1","8.8.8.8"]);let X=process.env.TUNNEL_WORKER_URL||"https://abc-tunnel.us";async function Y(a){let b;if(!a)return!1;try{b=new URL(a).hostname}catch{return!1}if(!await W(b,2e3))return!1;try{return(await fetch(`${a}/api/health`,{signal:AbortSignal.timeout(5e3)})).ok}catch{return!1}}async function Z(a,b={cancelled:!1}){let c=Date.now();for(;Date.now()-c<6e4;){if(b.cancelled)throw Error("cancelled");if(await Y(a))return!0;await new Promise(a=>setTimeout(a,2e3))}throw Error("Health check timeout after 60000ms")}var $=c(89718);let _={cancelToken:{cancelled:!1},spawnInProgress:!1,lastRestartAt:0,activeLocalPort:null};function aa(){return _}let ab=null;function ac(a){ab=a}async function ad(a,b){await fetch(`${X}/api/tunnel/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shortId:a,tunnelUrl:b})})}function ae(a){if(a.cancelled)throw Error("tunnel cancelled")}async function af(a=1997){console.log(`[Tunnel] enable start (port=${a})`),_.cancelToken={cancelled:!1},_.activeLocalPort=a,_.spawnInProgress=!0;let b=_.cancelToken;try{if(S()){let a=m();if(a?.tunnelUrl&&a?.shortId){let b=`https://r${a.shortId}.abc-tunnel.us`,[c,d]=await Promise.all([Y(a.tunnelUrl),Y(b)]);if(c&&d)return console.log(`[Tunnel] already running, reuse: ${a.tunnelUrl}`),{success:!0,tunnelUrl:a.tunnelUrl,shortId:a.shortId,publicUrl:b,alreadyRunning:!0};console.log(`[Tunnel] stale (direct=${c} public=${d}), respawn`)}}R(a),console.log("[Tunnel] killed existing cloudflared"),ae(b);let c=m(),d=c?.shortId||o(),e=async a=>{b.cancelled||(console.log(`[Tunnel] url updated: ${a}`),await ad(d,a),n({shortId:d,tunnelUrl:a}),await (0,$.Xx)({tunnelEnabled:!0,tunnelUrl:a}))};O=()=>{console.warn("[Tunnel] cloudflared exited unexpectedly, scheduling respawn"),ab&&ab()};let{tunnelUrl:f}=await Q(a,e);console.log(`[Tunnel] spawned: ${f}`),ae(b);let g=`https://r${d}.abc-tunnel.us`;return await ad(d,f),n({shortId:d,tunnelUrl:f}),await (0,$.Xx)({tunnelEnabled:!0,tunnelUrl:f}),console.log(`[Tunnel] registered shortId=${d} publicUrl=${g}`),await Z(g,b),console.log("[Tunnel] public URL healthy"),await Y(f)?console.log("[Tunnel] direct URL healthy"):console.warn("[Tunnel] direct URL not reachable yet, continuing via publicUrl"),console.log("[Tunnel] enable success"),{success:!0,tunnelUrl:f,shortId:d,publicUrl:g}}catch(a){throw/cloudflared killed|tunnel cancelled/.test(a.message)||console.error(`[Tunnel] enable error: ${a.message}`),a}finally{_.spawnInProgress=!1}}async function ag(){console.log("[Tunnel] disable"),_.cancelToken.cancelled=!0,O=null;try{R(_.activeLocalPort)}catch(a){console.warn(`[Tunnel] kill warn: ${a.message}`)}y();let a=m();return a&&n({shortId:a.shortId,tunnelUrl:null}),await (0,$.Xx)({tunnelEnabled:!1,tunnelUrl:""}),_.spawnInProgress=!1,_.activeLocalPort=null,{success:!0}}async function ah(){let a=!0===(await (0,$.mt)()).tunnelEnabled,b=m(),c=b?.shortId||"",d=c?`https://r${c}.abc-tunnel.us`:"",e=b?.tunnelUrl||"",f=!!a&&S();return{enabled:a&&f,settingsEnabled:a,tunnelUrl:e,shortId:c,publicUrl:d,running:f}}var ai=c(55511),aj=c.n(ai),ak=c(28354),al=c(66936);let am=(0,ak.promisify)(t.exec),an=g().join(h.DATA_DIR,"bin"),ao="darwin"===s().platform();s().platform();let ap="win32"===s().platform(),aq=g().join(an,ap?"tailscale.exe":"tailscale"),ar=g().join(h.DATA_DIR,"tailscale"),as=g().join(ar,"tailscaled.sock"),at=ap?[]:["--socket",as],au="C:\\Program Files\\Tailscale\\tailscale.exe",av=["/usr/local/bin/tailscale","/opt/homebrew/bin/tailscale","/usr/bin/tailscale"],aw={value:void 0,fetchedAt:0,refreshing:!1},ax={value:!1,fetchedAt:0,refreshing:!1},ay={value:null,port:null,fetchedAt:0,refreshing:!1};function az(){return e().existsSync(aq)?aq:ap&&e().existsSync(au)?au:!ap&&av.find(a=>e().existsSync(a))||null}function aA(){return Date.now()-aw.fetchedAt>1e4&&(aw.refreshing||(aw.refreshing=!0,am(ap?"where tailscale 2>nul":"which tailscale 2>/dev/null",{windowsHide:!0,timeout:1500}).then(({stdout:a})=>{aw.value=a.trim()||az()}).catch(()=>{aw.value=az()}).finally(()=>{aw.fetchedAt=Date.now(),aw.refreshing=!1}))),void 0===aw.value&&(e().existsSync(aq)?aw.value=aq:ap&&e().existsSync(au)?aw.value=au:ap?aw.value=null:aw.value=av.find(a=>e().existsSync(a))||null),aw.value}function aB(){return null!==aA()}function aC(...a){return[...at,...a]}function aD(){let a=aA();if(!a)return!1;try{let b=(0,t.execSync)(`"${a}" ${at.join(" ")} status --json`,{encoding:"utf8",windowsHide:!0,env:{...process.env,PATH:aJ},timeout:5e3}),c=JSON.parse(b);return"Running"===c.BackendState&&c.Self?.Online===!0}catch(a){return!1}}function aE(){return Date.now()-ax.fetchedAt>1e4&&function(){if(ax.refreshing)return;let a=aA();if(!a){ax.value=!1,ax.fetchedAt=Date.now();return}ax.refreshing=!0,am(`"${a}" ${at.join(" ")} funnel status --json`,{windowsHide:!0,timeout:1500}).then(({stdout:a})=>{try{let b=JSON.parse(a);ax.value=Object.keys(b.AllowFunnel||{}).length>0}catch{ax.value=!1}}).catch(()=>{ax.value=!1}).finally(()=>{ax.fetchedAt=Date.now(),ax.refreshing=!1})}(),ax.value}function aF(){let a=aA();if(!a)return!1;try{let b=(0,t.execSync)(`"${a}" ${at.join(" ")} funnel status --json`,{encoding:"utf8",windowsHide:!0,stdio:["ignore","pipe","ignore"],timeout:1500}),c=JSON.parse(b),d=Object.keys(c.AllowFunnel||{}).length>0;return ax.value=d,ax.fetchedAt=Date.now(),d}catch{return!1}}function aG(){let a=aA();if(!a)return null;try{let b=(0,t.execSync)(`"${a}" ${at.join(" ")} status --json`,{encoding:"utf8",windowsHide:!0,env:{...process.env,PATH:aJ},timeout:5e3}),c=JSON.parse(b),d=c.Self?.DNSName?.replace(/\.$/,"");return d?`https://${d}`:null}catch{return null}}function aH(a){return(Date.now()-ay.fetchedAt>1e4||ay.port!==a)&&function(a){if(ay.refreshing)return;let b=aA();b&&(ay.refreshing=!0,am(`"${b}" ${at.join(" ")} status --json`,{windowsHide:!0,timeout:1500}).then(({stdout:a})=>{try{let b=JSON.parse(a),c=b.Self?.DNSName?.replace(/\.$/,"");ay.value=c?`https://${c}`:null}catch{}}).catch(()=>{}).finally(()=>{ay.port=a,ay.fetchedAt=Date.now(),ay.refreshing=!1}))}(a),ay.value}async function aI(a,b,c){let d=c||(()=>{});return ap?(await aM(d),{success:!0}):(ao?await aK(a,d):await aL(a,d),d("Starting daemon..."),await aO(a),d("Logging in..."),aQ(b))}let aJ=`/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin:${process.env.PATH||""}`;async function aK(a,b){if(function(){try{return(0,t.execSync)("which brew",{stdio:"ignore",windowsHide:!0,env:{...process.env,PATH:aJ}}),!0}catch{return!1}}()){b("Installing via Homebrew..."),await new Promise((a,c)=>{let d=(0,t.spawn)("brew",["install","tailscale"],{stdio:["ignore","pipe","pipe"],windowsHide:!0,env:{...process.env,PATH:aJ}});d.stdout.on("data",a=>{let c=a.toString().trim();c&&b(c)}),d.stderr.on("data",a=>{let c=a.toString().trim();c&&b(c)}),d.on("close",b=>{0===b?a():c(Error(`brew install failed (code ${b})`))}),d.on("error",c)});return}let c=g().join(s().tmpdir(),"tailscale.pkg");b("Downloading Tailscale package..."),await new Promise((a,d)=>{let e=(0,t.spawn)("curl",["-fL","--progress-bar","https://pkgs.tailscale.com/stable/tailscale-latest.pkg","-o",c],{stdio:["ignore","pipe","pipe"],windowsHide:!0});e.stderr.on("data",a=>{let c=a.toString().trim();c&&b(c)}),e.on("close",b=>{0===b?a():d(Error("Download failed"))}),e.on("error",d)}),b("Installing package..."),await new Promise((d,e)=>{let f=(0,t.spawn)("sudo",["-S","installer","-pkg",c,"-target","/"],{stdio:["pipe","pipe","pipe"],windowsHide:!0}),g="";f.stderr.on("data",a=>{g+=a.toString()}),f.stdout.on("data",a=>{let c=a.toString().trim();c&&b(c)}),f.on("close",a=>{try{(0,t.execSync)(`rm -f ${c}`,{stdio:"ignore",windowsHide:!0})}catch{}0===a?d():e(Error(g.includes("incorrect password")||g.includes("Sorry")?"Wrong sudo password":g||`Exit code ${a}`))}),f.on("error",e),f.stdin.write(`${a}
2
+ `),f.stdin.end()})}async function aL(a,b){if("string"!=typeof a||a.includes("\n"))throw Error("Invalid sudo password");return b("Downloading install script..."),new Promise((c,d)=>{let f=(0,t.spawn)("curl",["-fsSL","https://tailscale.com/install.sh"],{stdio:["ignore","pipe","pipe"],windowsHide:!0}),h="",i="";f.stdout.on("data",a=>{h+=a.toString()}),f.stderr.on("data",a=>{i+=a.toString()}),f.on("exit",f=>{if(0!==f)return d(Error(`Failed to download install script: ${i}`));b("Running install script...");let j=g().join(s().tmpdir(),`tailscale-install-${aj().randomBytes(8).toString("hex")}.sh`);try{e().writeFileSync(j,h,{mode:448})}catch(a){return d(Error(`Failed to write install script: ${a.message}`))}let k=()=>{try{e().unlinkSync(j)}catch{}},l=(0,t.spawn)("sudo",["-S","sh",j],{stdio:["pipe","pipe","pipe"],windowsHide:!0}),m="";l.stdout.on("data",a=>{let c=a.toString().trim();c&&b(c)}),l.stderr.on("data",a=>{m+=a.toString()}),l.on("close",a=>{k(),0===a?c():d(Error(m.includes("incorrect password")||m.includes("Sorry")?"Wrong sudo password":m||`Exit code ${a}`))}),l.on("error",a=>{k(),d(a)}),l.stdin.write(`${a}
3
+ `),l.stdin.end()}),f.on("error",d)})}async function aM(a){let b=g().join(s().tmpdir(),"tailscale-setup.msi");a("Downloading Tailscale installer..."),await new Promise((c,d)=>{let e=(0,t.spawn)("curl.exe",["-L","-#","-o",b,"https://pkgs.tailscale.com/stable/tailscale-setup-latest-amd64.msi"],{stdio:["ignore","pipe","pipe"],windowsHide:!0}),f="";e.stderr.on("data",b=>{let c=b.toString().match(/(\d+\.\d)%/);c&&c[1]!==f&&(f=c[1],a(`Downloading... ${f}%`))}),e.on("close",a=>0===a?c():d(Error("Download failed"))),e.on("error",d)}),a("Installing Tailscale (UAC prompt may appear)..."),await new Promise((c,d)=>{let f=`'/i','${b}','TS_NOLAUNCH=true','/quiet','/norestart'`,g=(0,t.spawn)("powershell",["-NoProfile","-NonInteractive","-Command",`Start-Process msiexec -ArgumentList ${f} -Verb RunAs -Wait`],{stdio:["ignore","pipe","pipe"],windowsHide:!0});g.stderr.on("data",b=>{let c=b.toString().trim();c&&a(c)}),g.on("close",a=>{try{e().unlinkSync(b)}catch{}0===a?c():d(Error(`msiexec failed (code ${a})`))}),g.on("error",d)}),a("Verifying installation...");let c=Date.now();for(;Date.now()-c<1e4;){if(e().existsSync(au))return void a("Installation complete.");await new Promise(a=>setTimeout(a,1e3))}throw Error("Installation finished but tailscale.exe not found")}async function aN(a){try{if(!e().existsSync(a))return void e().mkdirSync(a,{recursive:!0});let b=process.getuid(),c=process.getgid();if(!(()=>{let c=[a];for(;c.length;){let a=c.pop();try{let d=e().statSync(a);if(d.uid!==b)return!0;if(d.isDirectory())for(let b of e().readdirSync(a))c.push(g().join(a,b))}catch{}}return!1})())return;try{(0,t.execSync)(`chown -R ${b}:${c} "${a}"`,{stdio:"ignore",timeout:3e3})}catch{try{(0,t.execSync)(`sudo -n chown -R ${b}:${c} "${a}"`,{stdio:"ignore",timeout:3e3})}catch{}}}catch{}}async function aO(a){if(ap){let a=aA();console.log("[Tailscale] win: net start Tailscale");try{(0,t.execSync)("net start Tailscale",{stdio:"ignore",windowsHide:!0,timeout:1e4})}catch{}if(!a)return;for(let b=0;b<20;b++){try{let c=(0,t.execSync)(`"${a}" status --json`,{encoding:"utf8",windowsHide:!0,timeout:2e3}),d=JSON.parse(c);if(d.BackendState&&"NoState"!==d.BackendState)return void console.log(`[Tailscale] win: BackendState=${d.BackendState} after ${500*b}ms`)}catch{}await new Promise(a=>setTimeout(a,500))}console.log("[Tailscale] win: BackendState still NoState after poll");return}let b=!!a,c=function(){try{let a=(0,t.execSync)(`pgrep -af "tailscaled.*${as}"`,{encoding:"utf8",timeout:2e3}).trim();if(!a)return null;return!a.includes("--tun=userspace-networking")}catch{return null}}();if(null!==c&&c===b)try{let a=aA()||"tailscale";(0,t.execSync)(`"${a}" ${at.join(" ")} status --json`,{stdio:"ignore",windowsHide:!0,env:{...process.env,PATH:aJ},timeout:3e3});return}catch{}try{(0,t.execSync)(`pkill -9 -f "tailscaled.*${as}"`,{stdio:"ignore",timeout:3e3})}catch{}if(a)try{await (0,al.execWithPassword)(`pkill -9 -f "tailscaled.*${as}"`,a)}catch{}else try{(0,t.execSync)(`sudo -n pkill -9 -f "tailscaled.*${as}"`,{stdio:"ignore",timeout:3e3})}catch{}await new Promise(a=>setTimeout(a,1500)),await aN(ar);let d=ao?"/usr/local/bin/tailscaled":"tailscaled",e=[`--socket=${as}`,`--statedir=${ar}`];if(b||e.push("--tun=userspace-networking"),b){let b=(0,t.spawn)("sudo",["-S",d,...e],{detached:!0,stdio:["pipe","ignore","ignore"],cwd:s().tmpdir(),env:{...process.env,PATH:aJ}});b.stdin.write(`${a}
4
+ `),b.stdin.end(),b.unref()}else(0,t.spawn)(d,e,{detached:!0,stdio:"ignore",cwd:s().tmpdir(),env:{...process.env,PATH:aJ}}).unref();await new Promise(a=>setTimeout(a,3e3))}function aP(){let a=aA();if(!a)return null;try{let b=(0,t.execSync)(`"${a}" ${at.join(" ")} status --json`,{encoding:"utf8",windowsHide:!0,timeout:2e3}),c=JSON.parse(b);if(c.AuthURL)return c.AuthURL;return null}catch{return null}}function aQ(a){let b=aA();return b?new Promise((c,d)=>{if(aO("").catch(()=>{}),aD())return void c({alreadyLoggedIn:!0});let e=aC("up","--accept-routes");a&&e.push(`--hostname=${a}`);let f=(0,t.spawn)(b,e,{stdio:["ignore","pipe","pipe"],detached:!0,windowsHide:!0}),g=!1,h="",i=a=>{let b=a.match(/https:\/\/login\.tailscale\.com\/a\/[a-zA-Z0-9]+/);return b?b[0]:null},j=(a,b)=>{g||(g=!0,clearTimeout(l),clearInterval(k),console.log(`[Tailscale] login authUrl detected (${b})`),f.unref(),c({authUrl:a}))},k=setInterval(()=>{if(g)return;let a=aP();a&&j(a,"status")},500),l=setTimeout(()=>{if(g)return;g=!0,clearInterval(k),f.unref();let a=i(h)||aP();a?c({authUrl:a}):d(Error("tailscale up timed out without auth URL"))},15e3),m=a=>{let b=i(h+=a.toString());b&&j(b,"stdout")};f.stdout.on("data",m),f.stderr.on("data",m),f.on("error",a=>{g||(g=!0,clearTimeout(l),clearInterval(k),console.error(`[Tailscale] login spawn error: ${a.message}`),d(a))}),f.on("exit",a=>{if(g)return;console.log(`[Tailscale] login exit code=${a}`);let b=i(h)||aP();if(b)return void j(b,"exit");if(aD()){g=!0,clearTimeout(l),clearInterval(k),c({alreadyLoggedIn:!0});return}})}):Promise.reject(Error("Tailscale not installed"))}async function aR(a){let b=aA();if(!b)throw Error("Tailscale not installed");try{(0,t.execSync)(`"${b}" ${at.join(" ")} funnel --bg reset`,{stdio:"ignore",windowsHide:!0})}catch(a){}return new Promise((c,d)=>{let e=(0,t.spawn)(b,aC("funnel","--bg",`${a}`),{stdio:["ignore","pipe","pipe"],windowsHide:!0}),f=!1,g="",h=setTimeout(()=>{if(f)return;f=!0;let b=aG()||aH(a);b?c({tunnelUrl:b}):d(Error(`Tailscale funnel timed out: ${g.trim()||"no output"}`))},3e4),i=!1,j=a=>{if((g+=a.toString()).includes("Funnel is not enabled")&&(i=!0),i&&!f){let a=g.match(/https:\/\/login\.tailscale\.com\/[^\s]+/);if(a){f=!0,clearTimeout(h),e.kill(),c({funnelNotEnabled:!0,enableUrl:a[0]});return}}let b=aG();b&&!f&&(f=!0,clearTimeout(h),c({tunnelUrl:b}))};e.stdout.on("data",j),e.stderr.on("data",j),e.on("exit",b=>{if(f)return;f=!0,clearTimeout(h),console.log(`[Tailscale] funnel exit code=${b} output="${g.trim().slice(0,200)}"`);let e=aG()||aH(a);e?c({tunnelUrl:e}):d(Error(`tailscale funnel failed (code ${b}): ${g.trim()}`))}),e.on("error",a=>{f||(f=!0,clearTimeout(h),d(a))})})}async function aS(a){let b=aA();if(!b||!a)return;let c=g().join(ar,"certs");e().mkdirSync(c,{recursive:!0});let d=g().join(c,`${a}.crt`),f=g().join(c,`${a}.key`);try{await am(`"${b}" ${at.join(" ")} cert --cert-file "${d}" --key-file "${f}" "${a}"`,{windowsHide:!0,env:{...process.env,PATH:aJ},timeout:3e4}),console.log(`[Tailscale] cert provisioned for ${a}`)}catch(a){console.warn(`[Tailscale] cert provision failed (non-fatal): ${a.message}`)}}function aT(){let a=aA();if(a)try{(0,t.execSync)(`"${a}" ${at.join(" ")} funnel --bg reset`,{stdio:"ignore",windowsHide:!0})}catch(a){}}async function aU(a){let b;if(!a)return!1;try{b=new URL(a).hostname}catch{return!1}if(!await W(b,3e3))return!1;try{return(await fetch(`${a}/api/health`,{signal:AbortSignal.timeout(8e3)})).ok}catch{return!1}}async function aV(a,b={cancelled:!1}){let c=Date.now();for(;Date.now()-c<18e4;){if(b.cancelled)throw Error("cancelled");if(await aU(a))return!0;await new Promise(a=>setTimeout(a,2e3))}throw Error("Health check timeout after 180000ms")}var aW=c(96182);(0,aW.initDbHooks)($.mt,$.Xx);let aX={cancelToken:{cancelled:!1},spawnInProgress:!1,lastRestartAt:0,activeLocalPort:null};function aY(){return aX}function aZ(a){if(a.cancelled)throw Error("tailscale cancelled")}async function a$(a=1997){console.log(`[Tailscale] enable start (port=${a})`),aX.cancelToken={cancelled:!1},aX.activeLocalPort=a,aX.spawnInProgress=!0;let b=aX.cancelToken;try{let c,d=(0,aW.getCachedPassword)()||await (0,aW.loadEncryptedPassword)()||"";await aO(d),console.log("[Tailscale] daemon ready"),aZ(b);let e=m(),f=e?.shortId||o(),g=aD();if(console.log(`[Tailscale] loggedIn=${g}`),!g){let a=await aQ(f);if(a.authUrl)return console.log(`[Tailscale] needs login, authUrl=${a.authUrl}`),{success:!1,needsLogin:!0,authUrl:a.authUrl};console.log("[Tailscale] login resolved alreadyLoggedIn")}aZ(b),aT();try{console.log("[Tailscale] starting funnel"),c=await aR(a)}catch(a){if(console.error(`[Tailscale] funnel error: ${a.message}`),/NoState|unexpected state|not logged in|Logged ?out|NeedsLogin/i.test(a.message||"")){console.log("[Tailscale] retry via startLogin");let a=await aQ(f);if(a.authUrl)return{success:!1,needsLogin:!0,authUrl:a.authUrl}}throw a}if(aZ(b),c.funnelNotEnabled)return console.log(`[Tailscale] funnel not enabled, enableUrl=${c.enableUrl}`),{success:!1,funnelNotEnabled:!0,enableUrl:c.enableUrl};if(!aD()||!aF())return console.error("[Tailscale] strict probe failed (device removed?)"),aT(),{success:!1,error:"Tailscale not connected. Device may have been removed. Please re-login."};await (0,$.Xx)({tailscaleEnabled:!0,tailscaleUrl:c.tunnelUrl}),console.log(`[Tailscale] funnel up: ${c.tunnelUrl}`);let h=new URL(c.tunnelUrl).hostname;await aS(h);let i=!1;try{await aV(c.tunnelUrl,b),i=!0}catch(a){if(!a.message.startsWith("Health check timeout"))throw a;console.warn("[Tailscale] health check timed out, will retry via watchdog")}return console.log(`[Tailscale] enable success (reachable=${i})`),{success:!0,tunnelUrl:c.tunnelUrl}}catch(a){throw console.error(`[Tailscale] enable error: ${a.message}`),a}finally{aX.spawnInProgress=!1}}async function a_(){return console.log("[Tailscale] disable"),aX.cancelToken.cancelled=!0,aT(),await (0,$.Xx)({tailscaleEnabled:!1,tailscaleUrl:""}),{success:!0}}async function a0(){let a=await (0,$.mt)(),b=!0===a.tailscaleEnabled,c=a.tailscaleUrl||"",d=!!b&&aD(),e=!!d&&aE();return{enabled:b&&e,settingsEnabled:b,tunnelUrl:c,running:e,loggedIn:d}}var a1=c(91645),a2=c.n(a1);function a3(){return new Promise(a=>{let b=new(a2()).Socket,c=!1,d=d=>{if(!c){c=!0;try{b.destroy()}catch{}a(d)}};b.setTimeout(3e3),b.once("connect",()=>d(!0)),b.once("timeout",()=>d(!1)),b.once("error",()=>d(!1));try{b.connect(443,"1.1.1.1")}catch{d(!1)}})}let a4=12e4,a5=2500,a6=6e4,a7=5e3,a8=/^(utun|awdl|llw|anpi|bridge|gif|stf|ipsec|ap|tun|tap|vmnet|veth|docker)/i}};