9router 0.4.63 → 0.4.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (462) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +10 -10
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +2 -2
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  49. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  50. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  52. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  53. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  54. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  55. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  56. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  57. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  58. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  59. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  60. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  61. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  62. package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  63. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  64. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  65. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
  66. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  67. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  68. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  69. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  70. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  72. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  75. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  78. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  81. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  82. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  88. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  90. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  91. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  96. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +1 -1
  100. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +1 -4
  102. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  113. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  115. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  117. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  119. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  122. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  134. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  138. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  140. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  143. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  145. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  161. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  163. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  176. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  186. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  188. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  196. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  198. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  200. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  204. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  209. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  211. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  216. package/app/.next-cli-build/server/app/callback.html +1 -1
  217. package/app/.next-cli-build/server/app/callback.rsc +3 -3
  218. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  219. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  220. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
  221. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  222. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  223. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  224. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  225. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
  226. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  227. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  228. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  229. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  230. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
  231. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  232. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
  233. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  234. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  235. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
  236. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  237. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  238. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  239. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  240. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  241. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  242. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
  243. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  244. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  245. package/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  246. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  247. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  248. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  249. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  250. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  251. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  252. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
  253. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  254. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  255. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
  256. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  257. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  258. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  259. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  260. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
  261. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  262. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
  263. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  264. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  265. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  266. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  267. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  268. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  269. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  270. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  271. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  272. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  273. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
  274. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  275. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  276. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  277. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  278. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  279. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  280. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  281. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  282. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  283. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
  284. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  285. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  286. package/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  287. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  288. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  289. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  290. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  291. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  292. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  293. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
  294. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  295. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  296. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  297. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  298. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  299. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  300. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  301. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  302. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  303. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  304. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
  305. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  306. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  307. package/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  308. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  309. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  310. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  311. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  312. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  313. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  314. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
  315. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  316. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  317. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
  318. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  319. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  320. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  321. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  322. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
  323. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  324. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
  325. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  326. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  327. package/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
  328. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  329. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  330. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  331. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  332. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  333. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  334. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
  335. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  336. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  337. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  338. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  339. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  340. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  341. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  342. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
  343. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  344. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  345. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  346. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  347. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  348. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  349. package/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
  350. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  351. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  352. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  353. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  354. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
  355. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  356. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +3 -3
  357. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  358. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  359. package/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  360. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  361. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  362. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  363. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  364. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  365. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  366. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
  367. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  368. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  369. package/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  370. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  371. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  372. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  373. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  374. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  375. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  376. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
  377. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  378. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  379. package/app/.next-cli-build/server/app/dashboard.rsc +5 -5
  380. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  381. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  382. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  383. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
  384. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  385. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
  386. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  387. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  388. package/app/.next-cli-build/server/app/index.html +1 -1
  389. package/app/.next-cli-build/server/app/index.rsc +3 -3
  390. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  391. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  392. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  393. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
  394. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  395. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  396. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  397. package/app/.next-cli-build/server/app/landing.html +1 -1
  398. package/app/.next-cli-build/server/app/landing.rsc +3 -3
  399. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  400. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  401. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
  402. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  403. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  404. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  405. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  406. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  407. package/app/.next-cli-build/server/app/login.html +1 -1
  408. package/app/.next-cli-build/server/app/login.rsc +4 -4
  409. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  410. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  411. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
  412. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  413. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  414. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  415. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  416. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  417. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  418. package/app/.next-cli-build/server/app-paths-manifest.json +10 -10
  419. package/app/.next-cli-build/server/chunks/1869.js +1 -1
  420. package/app/.next-cli-build/server/chunks/1909.js +1 -1
  421. package/app/.next-cli-build/server/chunks/21.js +1 -1
  422. package/app/.next-cli-build/server/chunks/287.js +10 -0
  423. package/app/.next-cli-build/server/chunks/4185.js +1 -1
  424. package/app/.next-cli-build/server/chunks/4343.js +1 -1
  425. package/app/.next-cli-build/server/chunks/4447.js +1 -1
  426. package/app/.next-cli-build/server/chunks/450.js +1 -1
  427. package/app/.next-cli-build/server/chunks/504.js +1 -1
  428. package/app/.next-cli-build/server/chunks/5079.js +1 -1
  429. package/app/.next-cli-build/server/chunks/5412.js +1 -1
  430. package/app/.next-cli-build/server/chunks/5445.js +1 -1
  431. package/app/.next-cli-build/server/chunks/6263.js +1 -1
  432. package/app/.next-cli-build/server/chunks/6283.js +1 -1
  433. package/app/.next-cli-build/server/chunks/666.js +4 -4
  434. package/app/.next-cli-build/server/chunks/7973.js +1 -1
  435. package/app/.next-cli-build/server/chunks/800.js +1 -1
  436. package/app/.next-cli-build/server/chunks/8202.js +19 -5
  437. package/app/.next-cli-build/server/chunks/8395.js +1 -1
  438. package/app/.next-cli-build/server/chunks/8515.js +1 -1
  439. package/app/.next-cli-build/server/chunks/9455.js +1 -0
  440. package/app/.next-cli-build/server/chunks/9737.js +1 -1
  441. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  442. package/app/.next-cli-build/server/pages/404.html +1 -1
  443. package/app/.next-cli-build/server/pages/500.html +1 -1
  444. package/app/.next-cli-build/static/chunks/{3771-9c0300235faf81ff.js → 3771-f14f44504f9fb206.js} +6 -6
  445. package/app/.next-cli-build/static/chunks/{4156-c9429fb1c6c597c1.js → 4156-9b6943413c7c045e.js} +2 -2
  446. package/app/.next-cli-build/static/chunks/505-5350111018361e1c.js +1 -0
  447. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/page-cc517a5fd7a180a7.js +1 -0
  448. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/page-1fb39d8d504a37bd.js +1 -0
  449. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-25fb00750362bc8d.js +1 -0
  450. package/app/cli/.build-home/.9router/db/backups/upgrade-0.4.63-to-0.4.65-0.4.65-20260529-160138/data.sqlite +0 -0
  451. package/app/cli/.build-home/.9router/db/backups/upgrade-0.4.65-to-0.4.66-0.4.66-20260529-174857/data.sqlite +0 -0
  452. package/app/cli/.build-home/.9router/db/data.sqlite +0 -0
  453. package/app/package.json +1 -1
  454. package/app/public/providers/qoder.png +0 -0
  455. package/app/src/lib/oauth/services/qoder.js +216 -0
  456. package/package.json +1 -1
  457. package/app/.next-cli-build/static/chunks/505-e9e4c888178f0420.js +0 -1
  458. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/page-cd0fd0414de9421f.js +0 -1
  459. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/page-cf6325b0b4557845.js +0 -1
  460. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-a35fe0f44eb4f35d.js +0 -1
  461. /package/app/.next-cli-build/static/{vZzGp60X33yZYtn51xF65 → eh7HQ86Uqoh52QTQNg4ff}/_buildManifest.js +0 -0
  462. /package/app/.next-cli-build/static/{vZzGp60X33yZYtn51xF65 → eh7HQ86Uqoh52QTQNg4ff}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";exports.id=4343,exports.ids=[4343],exports.modules={4343:(a,b,c)=>{c.d(b,{Op:()=>N,Nq:()=>E,PE:()=>P});var d=c(4573),e=c(29807),f=c(23016);let g="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36";async function h(a,b="mp3"){let c=await a.arrayBuffer();if(c.byteLength<100)throw Error("Upstream returned empty audio");let e=a.headers.get("content-type")||"",f=b;return e.includes("wav")?f="wav":e.includes("mpeg")||e.includes("mp3")?f="mp3":e.includes("ogg")&&(f="ogg"),{base64:d.Buffer.from(c).toString("base64"),format:f}}async function i(a){let b=await a.text().catch(()=>""),c=`Upstream error (${a.status})`;try{let a=JSON.parse(b);c=a?.error?.message||a?.message||a?.detail?.message||("string"==typeof a?.detail?a.detail:null)||b||c}catch{c=b||c}throw Error(c)}let j={token:null,tokenTime:0},k=0;async function l(){let a=Date.now();if(j.token&&a-j.tokenTime<66e4)return j.token;let b=await fetch("https://translate.google.com/",{headers:{"User-Agent":g}});if(!b.ok)throw Error(`Google translate fetch failed: ${b.status}`);let c=await b.text(),d=c.match(/"FdrFJe":"(.*?)"/)?.[1],e=c.match(/"cfb2h":"(.*?)"/)?.[1];if(!d||!e)throw Error("Failed to parse Google token");return j.token={"f.sid":d,bl:e},j.tokenTime=a,j.token}let m={token:null,tokenTime:0},n=null,o=0;async function p(){let a=Date.now();if(m.token&&a-m.tokenTime<3e5)return m.token;let b=await fetch("https://www.bing.com/translator",{headers:{"User-Agent":g,"Accept-Language":"vi,en-US;q=0.9,en;q=0.8"}});if(!b.ok)throw Error(`Bing translator fetch failed: ${b.status}`);let c=(b.headers.getSetCookie?.()||[]).map(a=>a.split(";")[0]).join("; "),d=(await b.text()).match(/params_AbusePreventionHelper\s*=\s*\[([^,]+),([^,]+),/);if(!d)throw Error("Failed to parse Bing token");return m.token={key:d[1],token:d[2].replace(/"/g,""),cookie:c},m.tokenTime=a,m.token}async function q(a,b,c){let d=b.split("-").slice(0,2).join("-"),e=b.toLowerCase().includes("male")?"Male":"Female",f=`<speak version='1.0' xml:lang='${d}'><voice xml:lang='${d}' xml:gender='${e}' name='${b}'><prosody rate='0.00%'>${a}</prosody></voice></speak>`,h=new URLSearchParams;return h.append("ssml",f),h.append("token",c.token),h.append("key",c.key),fetch("https://www.bing.com/tfettts?isVertical=1&&IG=1&IID=translator.5023&SFX=1",{method:"POST",body:h.toString(),headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"*/*",Origin:"https://www.bing.com",Referer:"https://www.bing.com/translator","User-Agent":g,...c.cookie?{Cookie:c.cookie}:{}}})}async function r(){let a=Date.now();if(n&&a-o<864e5)return n;let b=await fetch("https://speech.platform.bing.com/consumer/speech/synthesize/readaloud/voices/list?trustedclienttoken=6A5AA1D4EAFF4E9FB37E23D68491D6F4",{headers:{"User-Agent":g}});if(!b.ok)throw Error(`Edge TTS voices fetch failed: ${b.status}`);let c=await b.json();return n=c,o=a,c}var s=c(31421),t=c(57975),u=c(51455),v=c(48161),w=c(76760);let x=(0,t.promisify)(s.execFile),y=null;async function z(){let{stdout:a}=await x("say",["-v","?"]),b=[];for(let c of a.split("\n")){let a=c.match(/^([^\s].*?)\s{2,}([a-z]{2}_[A-Z]{2})/);if(!a)continue;let d=a[1].trim(),e=a[2].trim(),f=e.split("_")[0],g=e.split("_")[1];b.push({id:d,name:d,locale:e,lang:f,country:g,gender:""})}return b}async function A(){let{stdout:a}=await x("powershell.exe",["-NoProfile","-NonInteractive","-WindowStyle","Hidden","-Command","Add-Type -AssemblyName System.Speech; $s = New-Object System.Speech.Synthesis.SpeechSynthesizer; $s.GetInstalledVoices() | ForEach-Object { $v = $_.VoiceInfo; [PSCustomObject]@{ Name=$v.Name; Culture=$v.Culture.Name; Gender=$v.Gender } } | ConvertTo-Json -Compress"],{windowsHide:!0}),b=JSON.parse(a.trim()||"[]");return(Array.isArray(b)?b:[b]).map(a=>{let b=a.Culture||"en-US",[c,d=""]=b.split("-");return{id:a.Name,name:a.Name,locale:b.replace("-","_"),lang:c,country:d,gender:({1:"Male",2:"Female",Male:"Male",Female:"Female"})[a.Gender]||""}})}async function B(){if(y)return y;try{let a="win32"===process.platform?await A():await z();return y=a,a}catch{return[]}}async function C(a,b){let c=await (0,u.mkdtemp)((0,w.join)((0,v.tmpdir)(),"tts-")),d=(0,w.join)(c,"out.aiff"),e=(0,w.join)(c,"out.mp3");try{let c=b?["-v",b,"-o",d,a]:["-o",d,a];return await x("say",c),await x("ffmpeg",["-y","-i",d,"-codec:a","libmp3lame","-qscale:a","4",e]),(await (0,u.readFile)(e)).toString("base64")}finally{await (0,u.rm)(c,{recursive:!0,force:!0})}}let D=new Map;async function E(a){if(!a)throw Error("ElevenLabs API key required");let b=Date.now(),c=D.get(a);if(c&&b-c.time<864e5)return c.voices;let d=await fetch("https://api.elevenlabs.io/v1/voices",{headers:{"xi-api-key":a,"Content-Type":"application/json"}});if(!d.ok)throw Error(`ElevenLabs voices fetch failed: ${d.status}`);let e=((await d.json()).voices||[]).map(a=>({...a,lang:a.labels?.language||"en"}));return D.set(a,{voices:e,time:b}),e}let F="gemini-2.5-flash-preview-tts",G="Kore",H=["gemini-2.5-flash-preview-tts","gemini-2.5-pro-preview-tts"],I=[{id:"Zephyr",lang:"en",gender:"Female"},{id:"Puck",lang:"en",gender:"Male"},{id:"Charon",lang:"en",gender:"Male"},{id:"Kore",lang:"en",gender:"Female"},{id:"Fenrir",lang:"en",gender:"Male"},{id:"Leda",lang:"en",gender:"Female"},{id:"Orus",lang:"en",gender:"Male"},{id:"Aoede",lang:"en",gender:"Female"},{id:"Callirrhoe",lang:"en",gender:"Female"},{id:"Autonoe",lang:"en",gender:"Female"},{id:"Enceladus",lang:"en",gender:"Male"},{id:"Iapetus",lang:"en",gender:"Male"},{id:"Umbriel",lang:"en",gender:"Male"},{id:"Algieba",lang:"en",gender:"Male"},{id:"Despina",lang:"en",gender:"Female"},{id:"Erinome",lang:"en",gender:"Female"},{id:"Algenib",lang:"en",gender:"Male"},{id:"Rasalgethi",lang:"en",gender:"Male"},{id:"Laomedeia",lang:"en",gender:"Female"},{id:"Achernar",lang:"en",gender:"Female"},{id:"Alnilam",lang:"en",gender:"Male"},{id:"Schedar",lang:"en",gender:"Male"},{id:"Gacrux",lang:"en",gender:"Female"},{id:"Pulcherrima",lang:"en",gender:"Female"},{id:"Achird",lang:"en",gender:"Male"},{id:"Zubenelgenubi",lang:"en",gender:"Male"},{id:"Vindemiatrix",lang:"en",gender:"Female"},{id:"Sadachbia",lang:"en",gender:"Male"},{id:"Sadaltager",lang:"en",gender:"Male"},{id:"Sulafat",lang:"en",gender:"Female"}];async function J(){return I.map(a=>({voice_id:a.id,name:a.id,labels:{language:a.lang,gender:a.gender}}))}let K={hyperbolic:async function({baseUrl:a,apiKey:b,text:c}){let d=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b}`},body:JSON.stringify({text:c})});return d.ok||await i(d),{base64:(await d.json()).audio,format:"mp3"}},deepgram:async function({baseUrl:a,apiKey:b,text:c,modelId:d}){let e=new URL(a);e.searchParams.set("model",d||"aura-asteria-en");let f=await fetch(e.toString(),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Token ${b}`},body:JSON.stringify({text:c})});return f.ok||await i(f),h(f,"mp3")},"nvidia-tts":async function({baseUrl:a,apiKey:b,text:c,modelId:d,voiceId:e}){let f=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b}`},body:JSON.stringify({input:{text:c},voice:e||"default",model:d})});return f.ok||await i(f),h(f,"wav")},"huggingface-tts":async function({baseUrl:a,apiKey:b,text:c,modelId:d}){if(!d||d.includes(".."))throw Error("Invalid HuggingFace model ID");let e=await fetch(`${a}/${d}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b}`},body:JSON.stringify({inputs:c})});return e.ok||await i(e),h(e,"wav")},inworld:async function({baseUrl:a,apiKey:b,text:c,modelId:d,voiceId:e}){let f=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Basic ${b}`},body:JSON.stringify({text:c,voiceId:e||"Alex",modelId:d||"inworld-tts-1.5-mini",audioConfig:{audioEncoding:"MP3"}})});f.ok||await i(f);let g=await f.json();if(!g.audioContent)throw Error("Inworld TTS returned no audio");return{base64:g.audioContent,format:"mp3"}},cartesia:async function({baseUrl:a,apiKey:b,text:c,modelId:d,voiceId:e}){let f=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":b,"Cartesia-Version":"2024-06-10"},body:JSON.stringify({model_id:d||"sonic-2",transcript:c,...e?{voice:{mode:"id",id:e}}:{},output_format:{container:"mp3",bit_rate:128e3,sample_rate:44100}})});return f.ok||await i(f),h(f,"mp3")},playht:async function({baseUrl:a,apiKey:b,text:c,modelId:d,voiceId:e}){let[f,g]=(b||":").split(":"),j=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Accept:"audio/mpeg","X-USER-ID":f||"",Authorization:`Bearer ${g||b}`},body:JSON.stringify({text:c,voice:e||"s3://voice-cloning-zero-shot/d9ff78ba-d016-47f6-b0ef-dd630f59414e/female-cs/manifest.json",voice_engine:d||"PlayDialog",output_format:"mp3",speed:1})});return j.ok||await i(j),h(j,"mp3")},coqui:async function({baseUrl:a,text:b,voiceId:c}){let d=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:b,...c?{speaker_id:c}:{}})});return d.ok||await i(d),h(d,"wav")},tortoise:async function({baseUrl:a,text:b,voiceId:c}){let d=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:b,voice:c||"random"})});return d.ok||await i(d),h(d,"wav")},openai:async function({baseUrl:a,apiKey:b,text:c,modelId:d,voiceId:e}){let f={"Content-Type":"application/json"};b&&(f.Authorization=`Bearer ${b}`);let g=await fetch(a,{method:"POST",headers:f,body:JSON.stringify({model:d,input:c,voice:e||"alloy",response_format:"mp3",speed:1})});return g.ok||await i(g),h(g,"mp3")},"minimax-tts":async function({baseUrl:a,apiKey:b,text:c,modelId:e,voiceId:f}){let g=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b}`},body:JSON.stringify({model:e||"speech-2.8-hd",text:c,stream:!1,language_boost:"auto",output_format:"hex",voice_setting:{voice_id:f||"English_expressive_narrator",speed:1,vol:1,pitch:0},audio_setting:{sample_rate:32e3,bitrate:128e3,format:"mp3",channel:1}})}),h=await g.text(),i={};if(h)try{i=JSON.parse(h)}catch{i={}}let j=i.base_resp||i.baseResp||{},k=Number(j.status_code??j.statusCode??0),l=j.status_msg||j.statusMsg||i.message||"";if(!g.ok)throw Error(l||h||`MiniMax TTS error (${g.status})`);if(0!==k)throw Error(l||"MiniMax TTS upstream error");return{base64:function(a){let b="string"==typeof a?a.trim():"";if(!b)throw Error("MiniMax TTS returned no audio");if(b.length%2!=0||!/^[0-9a-f]+$/i.test(b))throw Error("MiniMax TTS returned invalid audio");return d.Buffer.from(b,"hex").toString("base64")}(i.data?.audio),format:i.extra_info?.audio_format||i.extraInfo?.audioFormat||"mp3"}}},L={"google-tts":{noAuth:!0,async synthesize(a,b){let c=b||"en",d=await l(),e=a.replace(/[@^*()\\/\-_+=><"'\u201c\u201d\u3010\u3011]/g," ").replaceAll(", ",". "),f="jQ1olc",g=1e5*++k+Math.floor(1e3+9e3*Math.random()),h=new URLSearchParams({rpcids:f,"f.sid":d["f.sid"],bl:d.bl,hl:c,"soc-app":1,"soc-platform":1,"soc-device":1,_reqid:g,rt:"c"}),i=[e,c,null,"undefined",[0]],j=new URLSearchParams;j.append("f.req",JSON.stringify([[[f,JSON.stringify(i),null,"generic"]]]));let m=await fetch(`https://translate.google.com/_/TranslateWebserverUi/data/batchexecute?${h}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Referer:"https://translate.google.com/"},body:j.toString()});if(!m.ok)throw Error(`Google TTS failed: ${m.status}`);let n=JSON.parse(JSON.parse((await m.text()).split("\n")[3])[0][2])[0];if(!n||n.length<100)throw Error("Google TTS returned empty audio");return{base64:n,format:"mp3"}}},"edge-tts":{noAuth:!0,async synthesize(a,b){let c=b||"vi-VN-HoaiMyNeural",e=await p(),f=await q(a,c,e);if((429===f.status||403===f.status)&&(m.token=null,m.tokenTime=0,e=await p(),f=await q(a,c,e)),!f.ok){let a=await f.text().catch(()=>"");throw Error(`Bing TTS failed: ${f.status}${a?" - "+a:""}`)}let g=await f.arrayBuffer();if(g.byteLength<1024)throw Error("Bing TTS returned empty audio");return{base64:d.Buffer.from(g).toString("base64"),format:"mp3"}}},"local-device":{noAuth:!0,synthesize:async(a,b)=>({base64:await C(a,b),format:"mp3"})},elevenlabs:{async synthesize(a,b,c){if(!c?.apiKey)throw Error("ElevenLabs API key required");let e="eleven_flash_v2_5",f=b;b&&b.includes("/")&&([e,f]=b.split("/"));let g=await fetch(`https://api.elevenlabs.io/v1/text-to-speech/${f}`,{method:"POST",headers:{"xi-api-key":c.apiKey,"Content-Type":"application/json"},body:JSON.stringify({text:a,model_id:e,voice_settings:{stability:.5,similarity_boost:.75}})});if(!g.ok){let a=await g.json().catch(()=>({}));throw Error(a?.detail?.message||`ElevenLabs TTS failed: ${g.status}`)}let h=await g.arrayBuffer();if(h.byteLength<1024)throw Error("ElevenLabs TTS returned empty audio");return{base64:d.Buffer.from(h).toString("base64"),format:"mp3"}}},openai:{async synthesize(a,b,c){if(!c?.apiKey)throw Error("No OpenAI API key configured");let e="gpt-4o-mini-tts",f="alloy";if(b&&b.includes("/")){let a=b.split("/");2===a.length&&([e,f]=a)}else b&&(f=b);let g=(c.baseUrl||"https://api.openai.com").replace(/\/+$/,""),h=await fetch(`${g}/v1/audio/speech`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${c.apiKey}`},body:JSON.stringify({model:e,voice:f,input:a})});if(!h.ok){let a=await h.json().catch(()=>({}));throw Error(a?.error?.message||`OpenAI TTS failed: ${h.status}`)}let i=await h.arrayBuffer();return{base64:d.Buffer.from(i).toString("base64"),format:"mp3"}}},openrouter:{async synthesize(a,b,c){if(!c?.apiKey)throw Error("No OpenRouter API key configured");let d="openai/gpt-4o-mini-tts",e="alloy";if(b&&b.includes("/")){let a=b.lastIndexOf("/"),c=b.slice(a+1),f=b.slice(0,a);f.includes("/")?(d=f,e=c):e=b}else b&&(e=b);let f=await fetch("https://openrouter.ai/api/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${c.apiKey}`,"HTTP-Referer":"https://endpoint-proxy.local","X-Title":"Endpoint Proxy"},body:JSON.stringify({model:d,modalities:["text","audio"],audio:{voice:e,format:"wav"},stream:!0,messages:[{role:"user",content:a}]})});if(!f.ok){let a=await f.json().catch(()=>({}));throw Error(a?.error?.message||`OpenRouter TTS failed: ${f.status}`)}let g=[],h=f.body.getReader(),i=new TextDecoder,j="";for(;;){let{done:a,value:b}=await h.read();if(a)break;let c=(j+=i.decode(b,{stream:!0})).split("\n");for(let a of(j=c.pop(),c))if(a.startsWith("data: ")&&"data: [DONE]"!==a)try{let b=JSON.parse(a.slice(6)),c=b.choices?.[0]?.delta?.audio?.data;c&&g.push(c)}catch{}}if(0===g.length)throw Error("OpenRouter TTS returned no audio data");return{base64:g.join(""),format:"wav"}}},gemini:{async synthesize(a,b,c,e,f={}){var g,h;let i,j;if(!c?.apiKey)throw Error("No Gemini API key configured");let{modelId:k,voiceId:l}=function(a){if(!a)return{modelId:F,voiceId:G};for(let b of H){if(a===b)return{modelId:b,voiceId:G};if(a.startsWith(`${b}/`))return{modelId:b,voiceId:a.slice(b.length+1)}}return{modelId:F,voiceId:a}}(b),m=`https://generativelanguage.googleapis.com/v1beta/models/${k}:generateContent?key=${c.apiKey}`,n=await fetch(m,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contents:[{parts:[{text:(g=f.language,/:\s/.test(a)?a:g?`Say in ${g}: ${a}`:`Say: ${a}`)}]}],generationConfig:{responseModalities:["AUDIO"],speechConfig:{voiceConfig:{prebuiltVoiceConfig:{voiceName:l}}}}})});if(!n.ok){let a=await n.json().catch(()=>({}));throw Error(a?.error?.message||`Gemini TTS failed: ${n.status}`)}let o=await n.json(),p=o?.candidates?.[0]?.content?.parts?.find(a=>a.inlineData?.data)?.inlineData?.data;if(!p){let a=o?.candidates?.[0]?.finishReason||o?.promptFeedback?.blockReason||"unknown";throw Error(`Gemini TTS returned no audio (finishReason: ${a}, voice: ${l}, model: ${k})`)}return{base64:(i=(h=d.Buffer.from(p,"base64")).length,(j=d.Buffer.alloc(44)).write("RIFF",0),j.writeUInt32LE(36+i,4),j.write("WAVE",8),j.write("fmt ",12),j.writeUInt32LE(16,16),j.writeUInt16LE(1,20),j.writeUInt16LE(1,22),j.writeUInt32LE(24e3,24),j.writeUInt32LE(48e3,28),j.writeUInt16LE(2,32),j.writeUInt16LE(16,34),j.write("data",36),j.writeUInt32LE(i,40),d.Buffer.concat([j,h])).toString("base64"),format:"wav"}}}};async function M(a,b,d,e){let{AI_PROVIDERS:f}=await c.e(21).then(c.bind(c,50021)),g=f[a]?.ttsConfig;if(!g)return null;let h=K[g.format];if(!h)return null;let i=e?.apiKey;if("none"!==g.authType&&!i)throw Error(`${a} API key required`);let{modelId:j,voiceId:k}=function(a,b="",c="",d=[]){if(!a)return{modelId:b,voiceId:c};for(let b of d.map(a=>a.id||a).filter(Boolean).sort((a,b)=>b.length-a.length)){if(a===b)return{modelId:b,voiceId:c};if(a.startsWith(`${b}/`))return{modelId:b,voiceId:a.slice(b.length+1)}}let e=a.lastIndexOf("/");return e>0?{modelId:a.slice(0,e),voiceId:a.slice(e+1)}:{modelId:b||a,voiceId:c||a}}(d,g.models?.[0]?.id||"","",g.models||[]);return h({baseUrl:g.baseUrl,apiKey:i,text:b,modelId:j,voiceId:k})}let N={"edge-tts":r,"local-device":B,elevenlabs:E,gemini:J};function O(a,b,c){let e=d.Buffer.from(a,"base64");return"json"===c?{success:!0,response:new Response(JSON.stringify({audio:a,format:b}),{headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})}:{success:!0,response:new Response(e,{headers:{"Content-Type":`audio/${b}`,"Content-Length":String(e.length),"Access-Control-Allow-Origin":"*"}})}}async function P({provider:a,model:b,input:c,credentials:d,responseFormat:g="mp3",language:h}){if(!c?.trim())return(0,e.A1)(f.gx.BAD_REQUEST,"Missing required field: input");try{let i=L[a]||null;if(i){let a=await i.synthesize(c.trim(),b,d,g,{language:h});if(void 0!==a.success)return a;return O(a.base64,a.format,g)}let j=await M(a,c.trim(),b,d);if(j)return O(j.base64,j.format,g);return(0,e.A1)(f.gx.BAD_REQUEST,`Provider '${a}' does not support TTS via this route.`)}catch(a){return(0,e.A1)(f.gx.BAD_GATEWAY,a.message||"TTS synthesis failed")}}},23016:(a,b,c)=>{c.d(b,{C8:()=>l,DR:()=>k,Uc:()=>h,cI:()=>j,eo:()=>i,gx:()=>d,pH:()=>g,v1:()=>e,xM:()=>f}),c(73714);let d={BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,NOT_ACCEPTABLE:406,REQUEST_TIMEOUT:408,RATE_LIMITED:429,SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504},e={sessionTtlMs:72e5,sessionCleanupIntervalMs:18e5,dnsCacheTtlMs:3e5,proxyDispatchersMaxSize:20},f=35e3,g=2e4,h=64e3,i=32e3,j={429:{attempts:0,delayMs:0},502:{attempts:3,delayMs:3e3},503:{attempts:3,delayMs:2e3},504:{attempts:2,delayMs:3e3}};function k(a){return null==a?{attempts:0,delayMs:2e3}:"number"==typeof a?{attempts:a,delayMs:2e3}:{attempts:a.attempts||0,delayMs:null!=a.delayMs?a.delayMs:2e3}}let l=["Please write a 5-10 word title for the following conversation:"]},29807:(a,b,c)=>{c.d(b,{A1:()=>g,lR:()=>i,wO:()=>h,yj:()=>e,zL:()=>f});var d=c(73714);function e(a,b){let c;return new Response(JSON.stringify((c=d.LY[a]||(a>=500?{type:"server_error",code:"internal_server_error"}:{type:"invalid_request_error",code:""}),{error:{message:b||d.O[a]||"An error occurred",type:c.type,code:c.code}})),{status:a,headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})}async function f(a,b=null){let c="";try{c=await a.text()}catch{c=""}if(b&&"function"==typeof b.parseError)try{let e=b.parseError(a,c);if(e&&"object"==typeof e){let b=e.message||d.O[a.status]||`Upstream error: ${a.status}`;return{statusCode:e.status||a.status,message:b,resetsAtMs:e.resetsAtMs}}}catch{}let e="";try{let a=JSON.parse(c);e=a.error?.message||a.message||a.error||c}catch{e=c}let g=("string"==typeof e?e:JSON.stringify(e))||d.O[a.status]||`Upstream error: ${a.status}`;return{statusCode:a.status,message:g}}function g(a,b,c){return{success:!1,status:a,error:b,resetsAtMs:c,response:e(a,b)}}function h(a,b,c,d){let e=Math.max(Math.ceil((new Date(c).getTime()-Date.now())/1e3),1);return new Response(JSON.stringify({error:{message:`${b} (${d})`}}),{status:a,headers:{"Content-Type":"application/json","Retry-After":String(e)}})}function i(a,b,c,d){let e=d||a.code||"FETCH_FAILED",f=a.message||"Unknown error",g=a.cause?.code,h=a.cause?.message,i=g||h?` (cause: ${[g,h].filter(Boolean).join(": ")})`:"";return`[${e}]: ${f}${i}`}},73714:(a,b,c)=>{c.d(b,{EQ:()=>f,LY:()=>d,O:()=>e,fh:()=>h,t2:()=>i,wf:()=>g});let d={400:{type:"invalid_request_error",code:"bad_request"},401:{type:"authentication_error",code:"invalid_api_key"},402:{type:"billing_error",code:"payment_required"},403:{type:"permission_error",code:"insufficient_quota"},404:{type:"invalid_request_error",code:"model_not_found"},406:{type:"invalid_request_error",code:"model_not_supported"},429:{type:"rate_limit_error",code:"rate_limit_exceeded"},500:{type:"server_error",code:"internal_server_error"},502:{type:"server_error",code:"bad_gateway"},503:{type:"server_error",code:"service_unavailable"},504:{type:"server_error",code:"gateway_timeout"}},e={400:"Bad request",401:"Invalid API key provided",402:"Payment required",403:"You exceeded your current quota",404:"Model not found",406:"Model not supported",429:"Rate limit exceeded",500:"Internal server error",502:"Bad gateway - upstream provider error",503:"Service temporarily unavailable",504:"Gateway timeout"},f={base:2e3,max:3e5,maxLevel:15},g=3e4,h=18e5,i=[{text:"no credentials",cooldownMs:12e4},{text:"request not allowed",cooldownMs:5e3},{text:"improperly formed request",cooldownMs:12e4},{text:"rate limit",backoff:!0},{text:"too many requests",backoff:!0},{text:"quota exceeded",backoff:!0},{text:"capacity",backoff:!0},{text:"overloaded",backoff:!0},{status:401,cooldownMs:12e4},{status:402,cooldownMs:12e4},{status:403,cooldownMs:12e4},{status:404,cooldownMs:12e4},{status:429,backoff:!0}]}};
1
+ "use strict";exports.id=4343,exports.ids=[4343],exports.modules={4343:(a,b,c)=>{c.d(b,{Op:()=>N,Nq:()=>E,PE:()=>P});var d=c(4573),e=c(29807),f=c(23016);let g="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36";async function h(a,b="mp3"){let c=await a.arrayBuffer();if(c.byteLength<100)throw Error("Upstream returned empty audio");let e=a.headers.get("content-type")||"",f=b;return e.includes("wav")?f="wav":e.includes("mpeg")||e.includes("mp3")?f="mp3":e.includes("ogg")&&(f="ogg"),{base64:d.Buffer.from(c).toString("base64"),format:f}}async function i(a){let b=await a.text().catch(()=>""),c=`Upstream error (${a.status})`;try{let a=JSON.parse(b);c=a?.error?.message||a?.message||a?.detail?.message||("string"==typeof a?.detail?a.detail:null)||b||c}catch{c=b||c}throw Error(c)}let j={token:null,tokenTime:0},k=0;async function l(){let a=Date.now();if(j.token&&a-j.tokenTime<66e4)return j.token;let b=await fetch("https://translate.google.com/",{headers:{"User-Agent":g}});if(!b.ok)throw Error(`Google translate fetch failed: ${b.status}`);let c=await b.text(),d=c.match(/"FdrFJe":"(.*?)"/)?.[1],e=c.match(/"cfb2h":"(.*?)"/)?.[1];if(!d||!e)throw Error("Failed to parse Google token");return j.token={"f.sid":d,bl:e},j.tokenTime=a,j.token}let m={token:null,tokenTime:0},n=null,o=0;async function p(){let a=Date.now();if(m.token&&a-m.tokenTime<3e5)return m.token;let b=await fetch("https://www.bing.com/translator",{headers:{"User-Agent":g,"Accept-Language":"vi,en-US;q=0.9,en;q=0.8"}});if(!b.ok)throw Error(`Bing translator fetch failed: ${b.status}`);let c=(b.headers.getSetCookie?.()||[]).map(a=>a.split(";")[0]).join("; "),d=(await b.text()).match(/params_AbusePreventionHelper\s*=\s*\[([^,]+),([^,]+),/);if(!d)throw Error("Failed to parse Bing token");return m.token={key:d[1],token:d[2].replace(/"/g,""),cookie:c},m.tokenTime=a,m.token}async function q(a,b,c){let d=b.split("-").slice(0,2).join("-"),e=b.toLowerCase().includes("male")?"Male":"Female",f=`<speak version='1.0' xml:lang='${d}'><voice xml:lang='${d}' xml:gender='${e}' name='${b}'><prosody rate='0.00%'>${a}</prosody></voice></speak>`,h=new URLSearchParams;return h.append("ssml",f),h.append("token",c.token),h.append("key",c.key),fetch("https://www.bing.com/tfettts?isVertical=1&&IG=1&IID=translator.5023&SFX=1",{method:"POST",body:h.toString(),headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"*/*",Origin:"https://www.bing.com",Referer:"https://www.bing.com/translator","User-Agent":g,...c.cookie?{Cookie:c.cookie}:{}}})}async function r(){let a=Date.now();if(n&&a-o<864e5)return n;let b=await fetch("https://speech.platform.bing.com/consumer/speech/synthesize/readaloud/voices/list?trustedclienttoken=6A5AA1D4EAFF4E9FB37E23D68491D6F4",{headers:{"User-Agent":g}});if(!b.ok)throw Error(`Edge TTS voices fetch failed: ${b.status}`);let c=await b.json();return n=c,o=a,c}var s=c(31421),t=c(57975),u=c(51455),v=c(48161),w=c(76760);let x=(0,t.promisify)(s.execFile),y=null;async function z(){let{stdout:a}=await x("say",["-v","?"]),b=[];for(let c of a.split("\n")){let a=c.match(/^([^\s].*?)\s{2,}([a-z]{2}_[A-Z]{2})/);if(!a)continue;let d=a[1].trim(),e=a[2].trim(),f=e.split("_")[0],g=e.split("_")[1];b.push({id:d,name:d,locale:e,lang:f,country:g,gender:""})}return b}async function A(){let{stdout:a}=await x("powershell.exe",["-NoProfile","-NonInteractive","-WindowStyle","Hidden","-Command","Add-Type -AssemblyName System.Speech; $s = New-Object System.Speech.Synthesis.SpeechSynthesizer; $s.GetInstalledVoices() | ForEach-Object { $v = $_.VoiceInfo; [PSCustomObject]@{ Name=$v.Name; Culture=$v.Culture.Name; Gender=$v.Gender } } | ConvertTo-Json -Compress"],{windowsHide:!0}),b=JSON.parse(a.trim()||"[]");return(Array.isArray(b)?b:[b]).map(a=>{let b=a.Culture||"en-US",[c,d=""]=b.split("-");return{id:a.Name,name:a.Name,locale:b.replace("-","_"),lang:c,country:d,gender:({1:"Male",2:"Female",Male:"Male",Female:"Female"})[a.Gender]||""}})}async function B(){if(y)return y;try{let a="win32"===process.platform?await A():await z();return y=a,a}catch{return[]}}async function C(a,b){let c=await (0,u.mkdtemp)((0,w.join)((0,v.tmpdir)(),"tts-")),d=(0,w.join)(c,"out.aiff"),e=(0,w.join)(c,"out.mp3");try{let c=b?["-v",b,"-o",d,a]:["-o",d,a];return await x("say",c),await x("ffmpeg",["-y","-i",d,"-codec:a","libmp3lame","-qscale:a","4",e]),(await (0,u.readFile)(e)).toString("base64")}finally{await (0,u.rm)(c,{recursive:!0,force:!0})}}let D=new Map;async function E(a){if(!a)throw Error("ElevenLabs API key required");let b=Date.now(),c=D.get(a);if(c&&b-c.time<864e5)return c.voices;let d=await fetch("https://api.elevenlabs.io/v1/voices",{headers:{"xi-api-key":a,"Content-Type":"application/json"}});if(!d.ok)throw Error(`ElevenLabs voices fetch failed: ${d.status}`);let e=((await d.json()).voices||[]).map(a=>({...a,lang:a.labels?.language||"en"}));return D.set(a,{voices:e,time:b}),e}let F="gemini-2.5-flash-preview-tts",G="Kore",H=["gemini-2.5-flash-preview-tts","gemini-2.5-pro-preview-tts"],I=[{id:"Zephyr",lang:"en",gender:"Female"},{id:"Puck",lang:"en",gender:"Male"},{id:"Charon",lang:"en",gender:"Male"},{id:"Kore",lang:"en",gender:"Female"},{id:"Fenrir",lang:"en",gender:"Male"},{id:"Leda",lang:"en",gender:"Female"},{id:"Orus",lang:"en",gender:"Male"},{id:"Aoede",lang:"en",gender:"Female"},{id:"Callirrhoe",lang:"en",gender:"Female"},{id:"Autonoe",lang:"en",gender:"Female"},{id:"Enceladus",lang:"en",gender:"Male"},{id:"Iapetus",lang:"en",gender:"Male"},{id:"Umbriel",lang:"en",gender:"Male"},{id:"Algieba",lang:"en",gender:"Male"},{id:"Despina",lang:"en",gender:"Female"},{id:"Erinome",lang:"en",gender:"Female"},{id:"Algenib",lang:"en",gender:"Male"},{id:"Rasalgethi",lang:"en",gender:"Male"},{id:"Laomedeia",lang:"en",gender:"Female"},{id:"Achernar",lang:"en",gender:"Female"},{id:"Alnilam",lang:"en",gender:"Male"},{id:"Schedar",lang:"en",gender:"Male"},{id:"Gacrux",lang:"en",gender:"Female"},{id:"Pulcherrima",lang:"en",gender:"Female"},{id:"Achird",lang:"en",gender:"Male"},{id:"Zubenelgenubi",lang:"en",gender:"Male"},{id:"Vindemiatrix",lang:"en",gender:"Female"},{id:"Sadachbia",lang:"en",gender:"Male"},{id:"Sadaltager",lang:"en",gender:"Male"},{id:"Sulafat",lang:"en",gender:"Female"}];async function J(){return I.map(a=>({voice_id:a.id,name:a.id,labels:{language:a.lang,gender:a.gender}}))}let K={hyperbolic:async function({baseUrl:a,apiKey:b,text:c}){let d=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b}`},body:JSON.stringify({text:c})});return d.ok||await i(d),{base64:(await d.json()).audio,format:"mp3"}},deepgram:async function({baseUrl:a,apiKey:b,text:c,modelId:d}){let e=new URL(a);e.searchParams.set("model",d||"aura-asteria-en");let f=await fetch(e.toString(),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Token ${b}`},body:JSON.stringify({text:c})});return f.ok||await i(f),h(f,"mp3")},"nvidia-tts":async function({baseUrl:a,apiKey:b,text:c,modelId:d,voiceId:e}){let f=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b}`},body:JSON.stringify({input:{text:c},voice:e||"default",model:d})});return f.ok||await i(f),h(f,"wav")},"huggingface-tts":async function({baseUrl:a,apiKey:b,text:c,modelId:d}){if(!d||d.includes(".."))throw Error("Invalid HuggingFace model ID");let e=await fetch(`${a}/${d}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b}`},body:JSON.stringify({inputs:c})});return e.ok||await i(e),h(e,"wav")},inworld:async function({baseUrl:a,apiKey:b,text:c,modelId:d,voiceId:e}){let f=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Basic ${b}`},body:JSON.stringify({text:c,voiceId:e||"Alex",modelId:d||"inworld-tts-1.5-mini",audioConfig:{audioEncoding:"MP3"}})});f.ok||await i(f);let g=await f.json();if(!g.audioContent)throw Error("Inworld TTS returned no audio");return{base64:g.audioContent,format:"mp3"}},cartesia:async function({baseUrl:a,apiKey:b,text:c,modelId:d,voiceId:e}){let f=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":b,"Cartesia-Version":"2024-06-10"},body:JSON.stringify({model_id:d||"sonic-2",transcript:c,...e?{voice:{mode:"id",id:e}}:{},output_format:{container:"mp3",bit_rate:128e3,sample_rate:44100}})});return f.ok||await i(f),h(f,"mp3")},playht:async function({baseUrl:a,apiKey:b,text:c,modelId:d,voiceId:e}){let[f,g]=(b||":").split(":"),j=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Accept:"audio/mpeg","X-USER-ID":f||"",Authorization:`Bearer ${g||b}`},body:JSON.stringify({text:c,voice:e||"s3://voice-cloning-zero-shot/d9ff78ba-d016-47f6-b0ef-dd630f59414e/female-cs/manifest.json",voice_engine:d||"PlayDialog",output_format:"mp3",speed:1})});return j.ok||await i(j),h(j,"mp3")},coqui:async function({baseUrl:a,text:b,voiceId:c}){let d=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:b,...c?{speaker_id:c}:{}})});return d.ok||await i(d),h(d,"wav")},tortoise:async function({baseUrl:a,text:b,voiceId:c}){let d=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:b,voice:c||"random"})});return d.ok||await i(d),h(d,"wav")},openai:async function({baseUrl:a,apiKey:b,text:c,modelId:d,voiceId:e}){let f={"Content-Type":"application/json"};b&&(f.Authorization=`Bearer ${b}`);let g=await fetch(a,{method:"POST",headers:f,body:JSON.stringify({model:d,input:c,voice:e||"alloy",response_format:"mp3",speed:1})});return g.ok||await i(g),h(g,"mp3")},"minimax-tts":async function({baseUrl:a,apiKey:b,text:c,modelId:e,voiceId:f}){let g=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b}`},body:JSON.stringify({model:e||"speech-2.8-hd",text:c,stream:!1,language_boost:"auto",output_format:"hex",voice_setting:{voice_id:f||"English_expressive_narrator",speed:1,vol:1,pitch:0},audio_setting:{sample_rate:32e3,bitrate:128e3,format:"mp3",channel:1}})}),h=await g.text(),i={};if(h)try{i=JSON.parse(h)}catch{i={}}let j=i.base_resp||i.baseResp||{},k=Number(j.status_code??j.statusCode??0),l=j.status_msg||j.statusMsg||i.message||"";if(!g.ok)throw Error(l||h||`MiniMax TTS error (${g.status})`);if(0!==k)throw Error(l||"MiniMax TTS upstream error");return{base64:function(a){let b="string"==typeof a?a.trim():"";if(!b)throw Error("MiniMax TTS returned no audio");if(b.length%2!=0||!/^[0-9a-f]+$/i.test(b))throw Error("MiniMax TTS returned invalid audio");return d.Buffer.from(b,"hex").toString("base64")}(i.data?.audio),format:i.extra_info?.audio_format||i.extraInfo?.audioFormat||"mp3"}}},L={"google-tts":{noAuth:!0,async synthesize(a,b){let c=b||"en",d=await l(),e=a.replace(/[@^*()\\/\-_+=><"'\u201c\u201d\u3010\u3011]/g," ").replaceAll(", ",". "),f="jQ1olc",g=1e5*++k+Math.floor(1e3+9e3*Math.random()),h=new URLSearchParams({rpcids:f,"f.sid":d["f.sid"],bl:d.bl,hl:c,"soc-app":1,"soc-platform":1,"soc-device":1,_reqid:g,rt:"c"}),i=[e,c,null,"undefined",[0]],j=new URLSearchParams;j.append("f.req",JSON.stringify([[[f,JSON.stringify(i),null,"generic"]]]));let m=await fetch(`https://translate.google.com/_/TranslateWebserverUi/data/batchexecute?${h}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Referer:"https://translate.google.com/"},body:j.toString()});if(!m.ok)throw Error(`Google TTS failed: ${m.status}`);let n=JSON.parse(JSON.parse((await m.text()).split("\n")[3])[0][2])[0];if(!n||n.length<100)throw Error("Google TTS returned empty audio");return{base64:n,format:"mp3"}}},"edge-tts":{noAuth:!0,async synthesize(a,b){let c=b||"vi-VN-HoaiMyNeural",e=await p(),f=await q(a,c,e);if((429===f.status||403===f.status)&&(m.token=null,m.tokenTime=0,e=await p(),f=await q(a,c,e)),!f.ok){let a=await f.text().catch(()=>"");throw Error(`Bing TTS failed: ${f.status}${a?" - "+a:""}`)}let g=await f.arrayBuffer();if(g.byteLength<1024)throw Error("Bing TTS returned empty audio");return{base64:d.Buffer.from(g).toString("base64"),format:"mp3"}}},"local-device":{noAuth:!0,synthesize:async(a,b)=>({base64:await C(a,b),format:"mp3"})},elevenlabs:{async synthesize(a,b,c){if(!c?.apiKey)throw Error("ElevenLabs API key required");let e="eleven_flash_v2_5",f=b;b&&b.includes("/")&&([e,f]=b.split("/"));let g=await fetch(`https://api.elevenlabs.io/v1/text-to-speech/${f}`,{method:"POST",headers:{"xi-api-key":c.apiKey,"Content-Type":"application/json"},body:JSON.stringify({text:a,model_id:e,voice_settings:{stability:.5,similarity_boost:.75}})});if(!g.ok){let a=await g.json().catch(()=>({}));throw Error(a?.detail?.message||`ElevenLabs TTS failed: ${g.status}`)}let h=await g.arrayBuffer();if(h.byteLength<1024)throw Error("ElevenLabs TTS returned empty audio");return{base64:d.Buffer.from(h).toString("base64"),format:"mp3"}}},openai:{async synthesize(a,b,c){if(!c?.apiKey)throw Error("No OpenAI API key configured");let e="gpt-4o-mini-tts",f="alloy";if(b&&b.includes("/")){let a=b.split("/");2===a.length&&([e,f]=a)}else b&&(f=b);let g=(c.baseUrl||"https://api.openai.com").replace(/\/+$/,""),h=await fetch(`${g}/v1/audio/speech`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${c.apiKey}`},body:JSON.stringify({model:e,voice:f,input:a})});if(!h.ok){let a=await h.json().catch(()=>({}));throw Error(a?.error?.message||`OpenAI TTS failed: ${h.status}`)}let i=await h.arrayBuffer();return{base64:d.Buffer.from(i).toString("base64"),format:"mp3"}}},openrouter:{async synthesize(a,b,c){if(!c?.apiKey)throw Error("No OpenRouter API key configured");let d="openai/gpt-4o-mini-tts",e="alloy";if(b&&b.includes("/")){let a=b.lastIndexOf("/"),c=b.slice(a+1),f=b.slice(0,a);f.includes("/")?(d=f,e=c):e=b}else b&&(e=b);let f=await fetch("https://openrouter.ai/api/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${c.apiKey}`,"HTTP-Referer":"https://endpoint-proxy.local","X-Title":"Endpoint Proxy"},body:JSON.stringify({model:d,modalities:["text","audio"],audio:{voice:e,format:"wav"},stream:!0,messages:[{role:"user",content:a}]})});if(!f.ok){let a=await f.json().catch(()=>({}));throw Error(a?.error?.message||`OpenRouter TTS failed: ${f.status}`)}let g=[],h=f.body.getReader(),i=new TextDecoder,j="";for(;;){let{done:a,value:b}=await h.read();if(a)break;let c=(j+=i.decode(b,{stream:!0})).split("\n");for(let a of(j=c.pop(),c))if(a.startsWith("data: ")&&"data: [DONE]"!==a)try{let b=JSON.parse(a.slice(6)),c=b.choices?.[0]?.delta?.audio?.data;c&&g.push(c)}catch{}}if(0===g.length)throw Error("OpenRouter TTS returned no audio data");return{base64:g.join(""),format:"wav"}}},gemini:{async synthesize(a,b,c,e,f={}){var g,h;let i,j;if(!c?.apiKey)throw Error("No Gemini API key configured");let{modelId:k,voiceId:l}=function(a){if(!a)return{modelId:F,voiceId:G};for(let b of H){if(a===b)return{modelId:b,voiceId:G};if(a.startsWith(`${b}/`))return{modelId:b,voiceId:a.slice(b.length+1)}}return{modelId:F,voiceId:a}}(b),m=`https://generativelanguage.googleapis.com/v1beta/models/${k}:generateContent?key=${c.apiKey}`,n=await fetch(m,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contents:[{parts:[{text:(g=f.language,/:\s/.test(a)?a:g?`Say in ${g}: ${a}`:`Say: ${a}`)}]}],generationConfig:{responseModalities:["AUDIO"],speechConfig:{voiceConfig:{prebuiltVoiceConfig:{voiceName:l}}}}})});if(!n.ok){let a=await n.json().catch(()=>({}));throw Error(a?.error?.message||`Gemini TTS failed: ${n.status}`)}let o=await n.json(),p=o?.candidates?.[0]?.content?.parts?.find(a=>a.inlineData?.data)?.inlineData?.data;if(!p){let a=o?.candidates?.[0]?.finishReason||o?.promptFeedback?.blockReason||"unknown";throw Error(`Gemini TTS returned no audio (finishReason: ${a}, voice: ${l}, model: ${k})`)}return{base64:(i=(h=d.Buffer.from(p,"base64")).length,(j=d.Buffer.alloc(44)).write("RIFF",0),j.writeUInt32LE(36+i,4),j.write("WAVE",8),j.write("fmt ",12),j.writeUInt32LE(16,16),j.writeUInt16LE(1,20),j.writeUInt16LE(1,22),j.writeUInt32LE(24e3,24),j.writeUInt32LE(48e3,28),j.writeUInt16LE(2,32),j.writeUInt16LE(16,34),j.write("data",36),j.writeUInt32LE(i,40),d.Buffer.concat([j,h])).toString("base64"),format:"wav"}}}};async function M(a,b,d,e){let{AI_PROVIDERS:f}=await c.e(21).then(c.bind(c,50021)),g=f[a]?.ttsConfig;if(!g)return null;let h=K[g.format];if(!h)return null;let i=e?.apiKey;if("none"!==g.authType&&!i)throw Error(`${a} API key required`);let{modelId:j,voiceId:k}=function(a,b="",c="",d=[]){if(!a)return{modelId:b,voiceId:c};for(let b of d.map(a=>a.id||a).filter(Boolean).sort((a,b)=>b.length-a.length)){if(a===b)return{modelId:b,voiceId:c};if(a.startsWith(`${b}/`))return{modelId:b,voiceId:a.slice(b.length+1)}}let e=a.lastIndexOf("/");return e>0?{modelId:a.slice(0,e),voiceId:a.slice(e+1)}:{modelId:b||a,voiceId:c||a}}(d,g.models?.[0]?.id||"","",g.models||[]);return h({baseUrl:g.baseUrl,apiKey:i,text:b,modelId:j,voiceId:k})}let N={"edge-tts":r,"local-device":B,elevenlabs:E,gemini:J};function O(a,b,c){let e=d.Buffer.from(a,"base64");return"json"===c?{success:!0,response:new Response(JSON.stringify({audio:a,format:b}),{headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})}:{success:!0,response:new Response(e,{headers:{"Content-Type":`audio/${b}`,"Content-Length":String(e.length),"Access-Control-Allow-Origin":"*"}})}}async function P({provider:a,model:b,input:c,credentials:d,responseFormat:g="mp3",language:h}){if(!c?.trim())return(0,e.A1)(f.gx.BAD_REQUEST,"Missing required field: input");try{let i=L[a]||null;if(i){let a=await i.synthesize(c.trim(),b,d,g,{language:h});if(void 0!==a.success)return a;return O(a.base64,a.format,g)}let j=await M(a,c.trim(),b,d);if(j)return O(j.base64,j.format,g);return(0,e.A1)(f.gx.BAD_REQUEST,`Provider '${a}' does not support TTS via this route.`)}catch(a){return(0,e.A1)(f.gx.BAD_GATEWAY,a.message||"TTS synthesis failed")}}},23016:(a,b,c)=>{c.d(b,{C8:()=>l,DR:()=>k,Uc:()=>h,cI:()=>j,eo:()=>i,gx:()=>d,pH:()=>g,v1:()=>e,xM:()=>f}),c(73714);let d={BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,NOT_ACCEPTABLE:406,REQUEST_TIMEOUT:408,RATE_LIMITED:429,SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504},e={sessionTtlMs:72e5,sessionCleanupIntervalMs:18e5,dnsCacheTtlMs:3e5,proxyDispatchersMaxSize:20},f=3e4,g=2e4,h=64e3,i=32e3,j={429:{attempts:0,delayMs:0},502:{attempts:3,delayMs:3e3},503:{attempts:3,delayMs:2e3},504:{attempts:2,delayMs:3e3}};function k(a){return null==a?{attempts:0,delayMs:2e3}:"number"==typeof a?{attempts:a,delayMs:2e3}:{attempts:a.attempts||0,delayMs:null!=a.delayMs?a.delayMs:2e3}}let l=["Please write a 5-10 word title for the following conversation:"]},29807:(a,b,c)=>{c.d(b,{A1:()=>g,lR:()=>i,wO:()=>h,yj:()=>e,zL:()=>f});var d=c(73714);function e(a,b){let c;return new Response(JSON.stringify((c=d.LY[a]||(a>=500?{type:"server_error",code:"internal_server_error"}:{type:"invalid_request_error",code:""}),{error:{message:b||d.O[a]||"An error occurred",type:c.type,code:c.code}})),{status:a,headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})}async function f(a,b=null){let c="";try{c=await a.text()}catch{c=""}if(b&&"function"==typeof b.parseError)try{let e=b.parseError(a,c);if(e&&"object"==typeof e){let b=e.message||d.O[a.status]||`Upstream error: ${a.status}`;return{statusCode:e.status||a.status,message:b,resetsAtMs:e.resetsAtMs}}}catch{}let e="";try{let a=JSON.parse(c);e=a.error?.message||a.message||a.error||c}catch{e=c}let g=("string"==typeof e?e:JSON.stringify(e))||d.O[a.status]||`Upstream error: ${a.status}`;return{statusCode:a.status,message:g}}function g(a,b,c){return{success:!1,status:a,error:b,resetsAtMs:c,response:e(a,b)}}function h(a,b,c,d){let e=Math.max(Math.ceil((new Date(c).getTime()-Date.now())/1e3),1);return new Response(JSON.stringify({error:{message:`${b} (${d})`}}),{status:a,headers:{"Content-Type":"application/json","Retry-After":String(e)}})}function i(a,b,c,d){let e=d||a.code||"FETCH_FAILED",f=a.message||"Unknown error",g=a.cause?.code,h=a.cause?.message,i=g||h?` (cause: ${[g,h].filter(Boolean).join(": ")})`:"";return`[${e}]: ${f}${i}`}},73714:(a,b,c)=>{c.d(b,{EQ:()=>f,LY:()=>d,O:()=>e,fh:()=>h,t2:()=>i,wf:()=>g});let d={400:{type:"invalid_request_error",code:"bad_request"},401:{type:"authentication_error",code:"invalid_api_key"},402:{type:"billing_error",code:"payment_required"},403:{type:"permission_error",code:"insufficient_quota"},404:{type:"invalid_request_error",code:"model_not_found"},406:{type:"invalid_request_error",code:"model_not_supported"},429:{type:"rate_limit_error",code:"rate_limit_exceeded"},500:{type:"server_error",code:"internal_server_error"},502:{type:"server_error",code:"bad_gateway"},503:{type:"server_error",code:"service_unavailable"},504:{type:"server_error",code:"gateway_timeout"}},e={400:"Bad request",401:"Invalid API key provided",402:"Payment required",403:"You exceeded your current quota",404:"Model not found",406:"Model not supported",429:"Rate limit exceeded",500:"Internal server error",502:"Bad gateway - upstream provider error",503:"Service temporarily unavailable",504:"Gateway timeout"},f={base:2e3,max:3e5,maxLevel:15},g=3e4,h=18e5,i=[{text:"no credentials",cooldownMs:12e4},{text:"request not allowed",cooldownMs:5e3},{text:"improperly formed request",cooldownMs:12e4},{text:"rate limit",backoff:!0},{text:"too many requests",backoff:!0},{text:"quota exceeded",backoff:!0},{text:"capacity",backoff:!0},{text:"overloaded",backoff:!0},{status:401,cooldownMs:12e4},{status:402,cooldownMs:12e4},{status:403,cooldownMs:12e4},{status:404,cooldownMs:12e4},{status:429,backoff:!0}]}};
@@ -4,4 +4,4 @@ exports.id=4447,exports.ids=[4447],exports.modules={20243:function(a,b,c){a.expo
4
4
  data: ${d}
5
5
 
6
6
  `)}catch{}}}),f.stderr.on("data",b=>console.log(`[mcp:${a}]`,b.toString().trim())),f.on("exit",c=>{console.log(`[mcp:${a}] exited`,c),b.delete(a)}),c}a.exports={getOrSpawn:q,registerSession:function(a,b){let c=q(a),d=g.randomUUID();return c.sessions.set(d,b),d},unregisterSession:function(a,b){let c=m().get(a);c&&c.sessions.delete(b)},sendToChild:function(a,b){let c=m().get(a);if(!c?.proc?.stdin?.writable)throw Error(`Bridge not running: ${a}`);c.proc.stdin.write(`${JSON.stringify(b)}
7
- `)},isRunning:function(a){let b=m().get(a);return!!(b?.proc&&!b.proc.killed&&null===b.proc.exitCode)},findPlugin:p,registerCustomPlugin:function(a){if(!o(a?.command))throw Error(`Blocked: command '${a?.command}' not in MCP allowlist`);n().set(a.name,a)}}},39006:a=>{"use strict";a.exports={rE:"0.4.63"}},62276:(a,b,c)=>{"use strict";c.d(b,{Ak:()=>i,Yg:()=>k,xq:()=>h});var d=c(21820);let e={"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"},f={"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advanced-tool-use-2025-11-20,effort-2025-11-24,structured-outputs-2025-12-15,fast-mode-2026-02-01,redact-thinking-2026-02-12,token-efficient-tools-2026-03-28","Anthropic-Dangerous-Direct-Browser-Access":"true","User-Agent":"claude-cli/2.1.92 (external, sdk-cli)","X-App":"cli","X-Stainless-Helper-Method":"stream","X-Stainless-Retry-Count":"0","X-Stainless-Runtime-Version":"v24.14.0","X-Stainless-Package-Version":"0.80.0","X-Stainless-Runtime":"node","X-Stainless-Lang":"js","X-Stainless-Arch":function(){switch((0,d.arch)()){case"x64":return"x64";case"arm64":return"arm64";case"ia32":return"x86";default:return`other::${(0,d.arch)()}`}}(),"X-Stainless-Os":function(){switch((0,d.platform)()){case"darwin":return"MacOS";case"win32":return"Windows";case"linux":return"Linux";case"freebsd":return"FreeBSD";default:return`Other::${(0,d.platform)()}`}}(),"X-Stainless-Timeout":"600"},g="https://api.kimi.com/coding/v1/messages",h={claude:{baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",headers:{...f},clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",tokenUrl:"https://api.anthropic.com/v1/oauth/token"},gemini:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",format:"gemini",clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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"},"gemini-cli":{baseUrl:"https://cloudcode-pa.googleapis.com/v1internal",format:"gemini-cli",clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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"},codex:{baseUrl:"https://chatgpt.com/backend-api/codex/responses",format:"openai-responses",headers:{originator:"codex-cli","User-Agent":"codex-cli/1.0.18 (macOS; arm64)"},clientId:"app_EMoamEEZ73f0CkXaXp7hrann",tokenUrl:"https://auth.openai.com/oauth/token"},qwen:{baseUrl:"https://portal.qwen.ai/v1/chat/completions",format:"openai",clientId:"f0304373b74a44d2b584a3fb70ca9e56",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",authUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code"},iflow:{baseUrl:"https://apis.iflow.cn/v1/chat/completions",format:"openai",headers:{"User-Agent":"iFlow-Cli"},clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",tokenUrl:"https://iflow.cn/oauth/token",authUrl:"https://iflow.cn/oauth"},qoder:{baseUrl:"https://api.qoder.com/v1/chat/completions",format:"openai",headers:{"User-Agent":"Qoder-Cli"},clientId:process.env.QODER_OAUTH_CLIENT_ID||"10009311001",clientSecret:process.env.QODER_OAUTH_CLIENT_SECRET||"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",tokenUrl:"https://api.qoder.com/oauth/token",authUrl:"https://qoder.com/oauth/authorize"},antigravity:{baseUrls:["https://daily-cloudcode-pa.googleapis.com","https://daily-cloudcode-pa.sandbox.googleapis.com"],format:"antigravity",headers:{"User-Agent":`antigravity/1.107.0 ${(0,d.platform)()}/${(0,d.arch)()}`},clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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"},openrouter:{baseUrl:"https://openrouter.ai/api/v1/chat/completions",format:"openai",headers:{"HTTP-Referer":"https://endpoint-proxy.local","X-Title":"Endpoint Proxy"}},openai:{baseUrl:"https://api.openai.com/v1/chat/completions",format:"openai"},"vercel-ai-gateway":{baseUrl:"https://ai-gateway.vercel.sh/v1/chat/completions",format:"openai"},glm:{baseUrl:"https://api.z.ai/api/anthropic/v1/messages",format:"claude",headers:{...e}},"glm-cn":{baseUrl:"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",format:"openai",headers:{}},kimi:{baseUrl:g,format:"claude",headers:{...e}},minimax:{baseUrl:"https://api.minimax.io/anthropic/v1/messages",format:"claude",headers:{...e}},"minimax-cn":{baseUrl:"https://api.minimaxi.com/anthropic/v1/messages",format:"claude",headers:{...e}},alicode:{baseUrl:"https://coding.dashscope.aliyuncs.com/v1/chat/completions",format:"openai",headers:{}},"alicode-intl":{baseUrl:"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions",format:"openai",headers:{}},"volcengine-ark":{baseUrl:"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",format:"openai",headers:{}},byteplus:{baseUrl:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",format:"openai",headers:{}},github:{baseUrl:"https://api.githubcopilot.com/chat/completions",responsesUrl:"https://api.githubcopilot.com/responses",format:"openai",headers:{"copilot-integration-id":"vscode-chat","editor-version":"vscode/1.110.0","editor-plugin-version":"copilot-chat/0.38.0","user-agent":"GitHubCopilotChat/0.38.0","openai-intent":"conversation-panel","x-github-api-version":"2025-04-01","x-vscode-user-agent-library-version":"electron-fetch","X-Initiator":"user",Accept:"application/json","Content-Type":"application/json"},clientId:"Iv1.b507a08c87ecfe98"},kiro:{baseUrl:"https://codewhisperer.us-east-1.amazonaws.com/generateAssistantResponse",format:"kiro",retry:{429:2},headers:{"Content-Type":"application/json",Accept:"application/vnd.amazon.eventstream","X-Amz-Target":"AmazonCodeWhispererStreamingService.GenerateAssistantResponse","User-Agent":"AWS-SDK-JS/3.0.0 kiro-ide/1.0.0","X-Amz-User-Agent":"aws-sdk-js/3.0.0 kiro-ide/1.0.0"},tokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authUrl:"https://prod.us-east-1.auth.desktop.kiro.dev"},cursor:{baseUrl:"https://api2.cursor.sh",chatPath:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",format:"cursor",headers:{"connect-accept-encoding":"gzip","connect-protocol-version":"1","Content-Type":"application/connect+proto","User-Agent":"connect-es/1.6.1"},clientVersion:"3.1.0"},"kimi-coding":{baseUrl:g,format:"claude",headers:{...e},clientId:"17e5f671-d194-4dfb-9706-5516cb48c098",tokenUrl:"https://auth.kimi.com/api/oauth/token",refreshUrl:"https://auth.kimi.com/api/oauth/token"},kilocode:{baseUrl:"https://api.kilo.ai/api/openrouter/chat/completions",format:"openai",headers:{}},opencode:{baseUrl:"http://localhost:4096/v1/chat/completions",format:"openai",headers:{}},cline:{baseUrl:"https://api.cline.bot/api/v1/chat/completions",format:"openai",headers:{"HTTP-Referer":"https://cline.bot","X-Title":"Cline"},tokenUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},nvidia:{baseUrl:"https://integrate.api.nvidia.com/v1/chat/completions",format:"openai"},anthropic:{baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",headers:{...e}},deepseek:{baseUrl:"https://api.deepseek.com/chat/completions",format:"openai"},commandcode:{baseUrl:"https://api.commandcode.ai/alpha/generate",format:"commandcode",headers:{"x-command-code-version":"0.25.7","x-cli-environment":"cli"}},groq:{baseUrl:"https://api.groq.com/openai/v1/chat/completions",format:"openai"},xai:{baseUrl:"https://api.x.ai/v1/chat/completions",responsesUrl:"https://api.x.ai/v1/responses",format:"openai",clientId:"b1a00492-073a-47ea-816f-4c329264a828",tokenUrl:"https://auth.x.ai/oauth2/token",refreshUrl:"https://auth.x.ai/oauth2/token"},mistral:{baseUrl:"https://api.mistral.ai/v1/chat/completions",format:"openai"},perplexity:{baseUrl:"https://api.perplexity.ai/chat/completions",format:"openai"},together:{baseUrl:"https://api.together.xyz/v1/chat/completions",format:"openai"},fireworks:{baseUrl:"https://api.fireworks.ai/inference/v1/chat/completions",format:"openai"},cerebras:{baseUrl:"https://api.cerebras.ai/v1/chat/completions",format:"openai"},cohere:{baseUrl:"https://api.cohere.ai/v1/chat/completions",format:"openai"},nebius:{baseUrl:"https://api.studio.nebius.ai/v1/chat/completions",format:"openai"},siliconflow:{baseUrl:"https://api.siliconflow.cn/v1/chat/completions",format:"openai"},hyperbolic:{baseUrl:"https://api.hyperbolic.xyz/v1/chat/completions",format:"openai"},deepgram:{baseUrl:"https://api.deepgram.com/v1/listen",format:"openai"},assemblyai:{baseUrl:"https://api.assemblyai.com/v1/audio/transcriptions",format:"openai"},nanobanana:{baseUrl:"https://api.nanobananaapi.ai/v1/chat/completions",format:"openai"},chutes:{baseUrl:"https://llm.chutes.ai/v1/chat/completions",format:"openai"},ollama:{baseUrl:"https://ollama.com/api/chat",format:"ollama"},"ollama-local":{baseUrl:"http://localhost:11434/api/chat",format:"ollama"},vertex:{baseUrl:"https://aiplatform.googleapis.com",format:"vertex"},"vertex-partner":{baseUrl:"https://aiplatform.googleapis.com",format:"openai"},gitlab:{baseUrl:"https://gitlab.com/api/v4/chat/completions",format:"openai"},codebuddy:{baseUrl:"https://copilot.tencent.com/v1/chat/completions",format:"openai"},opencode:{baseUrl:"https://opencode.ai",format:"openai",headers:{"x-opencode-client":"desktop"},noAuth:!0},"opencode-go":{baseUrl:"https://opencode.ai/zen/go/v1/chat/completions",format:"openai",headers:{}},"grok-web":{baseUrl:"https://grok.com/rest/app-chat/conversations/new",format:"grok-web",authType:"cookie"},"perplexity-web":{baseUrl:"https://www.perplexity.ai/rest/sse/perplexity_ask",format:"perplexity-web",authType:"cookie"},azure:{baseUrl:"",format:"openai",headers:{}},"cloudflare-ai":{baseUrl:"https://api.cloudflare.com/client/v4/accounts/{accountId}/ai/v1/chat/completions",format:"openai"},"xiaomi-mimo":{baseUrl:"https://api.xiaomimimo.com/v1/chat/completions",format:"openai"},"xiaomi-tokenplan":{baseUrl:"https://token-plan-sgp.xiaomimimo.com/v1/chat/completions",format:"openai"},agentrouter:{baseUrl:"https://agentrouter.org/v1/messages",format:"claude",headers:{...f}},aimlapi:{baseUrl:"https://api.aimlapi.com/v1/chat/completions",format:"openai"},novita:{baseUrl:"https://api.novita.ai/v3/openai/chat/completions",format:"openai"},modal:{baseUrl:"https://api.modal.com/v1/chat/completions",format:"openai"},reka:{baseUrl:"https://api.reka.ai/v1/chat/completions",format:"openai"},nlpcloud:{baseUrl:"https://api.nlpcloud.io/v1/gpu/chatbot",format:"openai"},bazaarlink:{baseUrl:"https://bazaarlink.ai/api/v1/chat/completions",format:"openai"},completions:{baseUrl:"https://completions.me/api/v1/chat/completions",format:"openai"},enally:{baseUrl:"https://ai.enally.in/v1/chat/completions",format:"openai",authHeader:"x-api-key"},freetheai:{baseUrl:"https://api.freetheai.xyz/v1/chat/completions",format:"openai"},llm7:{baseUrl:"https://api.llm7.io/v1/chat/completions",format:"openai"},lepton:{baseUrl:"https://api.lepton.ai/api/v1/chat/completions",format:"openai"},kluster:{baseUrl:"https://api.kluster.ai/v1/chat/completions",format:"openai"},ai21:{baseUrl:"https://api.ai21.com/studio/v1/chat/completions",format:"openai"},"inference-net":{baseUrl:"https://api.inference.net/v1/chat/completions",format:"openai"},predibase:{baseUrl:"https://serving.app.predibase.com/v1/chat/completions",format:"openai"},bytez:{baseUrl:"https://api.bytez.com/models/v2",format:"openai"},morph:{baseUrl:"https://api.morphllm.com/v1/chat/completions",format:"openai"},longcat:{baseUrl:"https://api.longcat.chat/openai/v1/chat/completions",format:"openai"},puter:{baseUrl:"https://api.puter.com/puterai/openai/v1/chat/completions",format:"openai"},uncloseai:{baseUrl:"https://hermes.ai.unturf.com/v1/chat/completions",format:"openai",noAuth:!0},scaleway:{baseUrl:"https://api.scaleway.ai/v1/chat/completions",format:"openai"},deepinfra:{baseUrl:"https://api.deepinfra.com/v1/openai/chat/completions",format:"openai"},sambanova:{baseUrl:"https://api.sambanova.ai/v1/chat/completions",format:"openai"},nscale:{baseUrl:"https://inference.api.nscale.com/v1/chat/completions",format:"openai"},baseten:{baseUrl:"https://inference.baseten.co/v1/chat/completions",format:"openai"},publicai:{baseUrl:"https://api.publicai.co/v1/chat/completions",format:"openai"},"nous-research":{baseUrl:"https://inference-api.nousresearch.com/v1/chat/completions",format:"openai"},glhf:{baseUrl:"https://glhf.chat/api/openai/v1/chat/completions",format:"openai"},blackbox:{baseUrl:"https://api.blackbox.ai/chat/completions",format:"openai"}};function i(a){return(a?.providerSpecificData?.baseUrl?.trim()||"http://localhost:11434").replace(/\/$/,"")}let j={sgp:"https://token-plan-sgp.xiaomimimo.com/v1",cn:"https://token-plan-cn.xiaomimimo.com/v1",ams:"https://token-plan-ams.xiaomimimo.com/v1"};function k(a){return j[a?.providerSpecificData?.region]||j.sgp}},64749:()=>{},70802:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DELETE:()=>R,GET:()=>P,POST:()=>Q});var d=c(71266),e=c(86606),f=c(79748),g=c.n(f),h=c(33873),i=c.n(h),j=c(21820),k=c.n(j),l=c(55511),m=c.n(l),n=c(97418),o=c(89489),p=c(81372),q=c(99119),r=c(39990);let s=o.h0.appPort,t=`http://localhost:${s}/api/mcp/`,u=null,v=async()=>(u||(u=await (0,q.Xj)("9r-cli-auth")),u),w=async a=>{let b=await v();for(let c of a)"string"==typeof c?.url&&c.url.startsWith(t)&&(c.headers={...c.headers||{},"x-9r-cli-token":b});return a},x="gateway",y={coworkEgressAllowedHosts:["*"],disabledBuiltinTools:[],isLocalDevMcpEnabled:!0,isDesktopExtensionEnabled:!0,isDesktopExtensionDirectoryEnabled:!0,isDesktopExtensionSignatureRequired:!1,isClaudeCodeForDesktopEnabled:!0,disableEssentialTelemetry:!0,disableNonessentialTelemetry:!0,disableNonessentialServices:!0},z=()=>{if("darwin"===k().platform()){let a=i().join(k().homedir(),"Library","Application Support");return[i().join(a,"Claude-3p"),i().join(a,"Claude")]}if("win32"===k().platform()){let a=process.env.LOCALAPPDATA||i().join(k().homedir(),"AppData","Local"),b=process.env.APPDATA||i().join(k().homedir(),"AppData","Roaming");return[i().join(a,"Claude-3p"),i().join(b,"Claude-3p"),i().join(a,"Claude"),i().join(b,"Claude")]}return[i().join(k().homedir(),".config","Claude-3p"),i().join(k().homedir(),".config","Claude")]},A=async()=>{let a=z();for(let b of a)try{return await g().access(i().join(b,"configLibrary")),b}catch{}return a[0]},B=()=>z()[0],C=async()=>i().join(await A(),"configLibrary"),D=()=>i().join(B(),"configLibrary"),E=async()=>i().join(await C(),"_meta.json"),F=()=>{if("darwin"===k().platform())return i().join(k().homedir(),"Library","Application Support","Claude");if("win32"===k().platform()){let a=process.env.APPDATA||i().join(k().homedir(),"AppData","Roaming");return i().join(a,"Claude")}return i().join(k().homedir(),".config","Claude")},G=()=>i().join(F(),"claude_desktop_config.json"),H=async()=>{try{return JSON.parse(await g().readFile(G(),"utf-8"))||{}}catch(a){if("ENOENT"===a.code)return{};throw a}},I=async a=>{await g().mkdir(F(),{recursive:!0}),await g().writeFile(G(),JSON.stringify(a,null,2))},J=async()=>{let a=await H();return"3p"!==a.deploymentMode&&(a.deploymentMode="3p",await I(a),!0)},K=async()=>{let a=await H();if(!a.mcpServers||"object"!=typeof a.mcpServers)return;let b=new Set(n.LOCAL_STDIO_PLUGINS.map(a=>a.name));for(let c of Object.keys(a.mcpServers))b.has(c)&&delete a.mcpServers[c];0===Object.keys(a.mcpServers).length&&delete a.mcpServers,await I(a)},L=async()=>{for(let a of[...z(),...(()=>{if("darwin"===k().platform())return["/Applications/Claude.app",i().join(k().homedir(),"Applications","Claude.app")];if("win32"===k().platform()){let a=process.env.LOCALAPPDATA||i().join(k().homedir(),"AppData","Local"),b=process.env.ProgramFiles||"C:\\Program Files";return[i().join(a,"AnthropicClaude"),i().join(b,"Claude"),i().join(b,"AnthropicClaude")]}return[]})()])try{return await g().access(a),!0}catch{}return!1},M=async a=>{try{return JSON.parse(await g().readFile(a,"utf-8"))}catch(a){if("ENOENT"===a.code)return null;throw a}},N=async()=>{let a=i().join(D(),"_meta.json"),b=await M(a);if(!b||!b.appliedId){let c=await M(await E());if(c?.appliedId)b=c;else{let a=m().randomUUID();b={appliedId:a,entries:[{id:a,name:"Default"}]}}await g().mkdir(D(),{recursive:!0}),await g().writeFile(a,JSON.stringify(b,null,2))}return b};async function O(a){let b=i().join(B(),"config.json"),c={};try{c=JSON.parse(await g().readFile(b,"utf-8"))||{}}catch(a){if("ENOENT"!==a.code)return{error:a.code}}let d={};for(let b of a)b?.name&&(d[b.name]=!0);return c.operonSkipMcpApprovals=d,await g().mkdir(B(),{recursive:!0}),await g().writeFile(b,JSON.stringify(c,null,2)),{written:Object.keys(d).length}}async function P(){try{if(!await L())return e.NextResponse.json({installed:!1,config:null,message:"Claude Desktop (Cowork mode) not detected"});let a=await M(await E()),b=a?.appliedId||null,c=await C(),d=b?i().join(c,`${b}.json`):null,f=d?await M(d):null,g=f?.inferenceGatewayBaseUrl||null,h=Array.isArray(f?.inferenceModels)?f.inferenceModels.map(a=>"string"==typeof a?a:a?.name).filter(Boolean):[],j=Array.isArray(f?.managedMcpServers)?f.managedMcpServers:[],k=!!(f?.inferenceProvider===x&&g),l=new Set(n.LOCAL_STDIO_PLUGINS.map(a=>a.name)),m=j.filter(a=>l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/")).map(a=>a.name),o=j.filter(a=>a.custom||!l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/")).map(a=>({name:a.name,url:a.url,transport:a.transport,custom:!0}));return e.NextResponse.json({installed:!0,config:f,has9Router:k,configPath:d,cowork:{appliedId:b,baseUrl:g,models:h,provider:f?.inferenceProvider||null,plugins:j.filter(a=>!a.custom&&!(l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/"))).map(a=>{let b=a.toolPolicy?Object.keys(a.toolPolicy):[],c=`${a.name}-`,d=new Set;for(let a of b){let b=a;for(;b.startsWith(c);)b=b.slice(c.length);d.add(b)}let e=n.DEFAULT_PLUGINS.find(b=>b.name===a.name),f=e&&Array.isArray(e.toolNames)?e.toolNames:Array.from(d);return{name:a.name,url:a.url,transport:a.transport,oauth:!!a.oauth,toolNames:f}}),localPlugins:m,customPlugins:o},defaultPlugins:n.DEFAULT_PLUGINS,localStdioPlugins:n.LOCAL_STDIO_PLUGINS})}catch(a){return console.log("Error reading cowork settings:",a),e.NextResponse.json({error:"Failed to read cowork settings"},{status:500})}}async function Q(a){try{let{baseUrl:b,apiKey:d,models:f,plugins:h,localPlugins:j,customPlugins:k}=await a.json();if(!b||!d)return e.NextResponse.json({error:"baseUrl and apiKey are required"},{status:400});let l=Array.isArray(f)?f.filter(a=>"string"==typeof a&&a.trim()):[];if(0===l.length)return e.NextResponse.json({error:"At least one model is required"},{status:400});let m=Array.isArray(h)?h:n.DEFAULT_PLUGINS,o=Array.isArray(j)?j:[],q=Array.isArray(k)?k:[];if(q.length>0){let{registerCustomPlugin:a}=c(25789),b=q.filter(a=>a&&"string"==typeof a.command&&a.command.trim()).filter(a=>n.ALLOWED_MCP_COMMANDS.has(i().basename(a.command))).map(a=>({name:String(a.name||"").replace(/[^a-zA-Z0-9_-]/g,"").slice(0,64),command:a.command,args:Array.isArray(a.args)?a.args.map(String):[]})).filter(a=>a.name);for(let c of b)try{a(c)}catch{}try{let a=i().join(p.DATA_DIR,"mcp");await g().mkdir(a,{recursive:!0}),await g().writeFile(i().join(a,"customPlugins.json"),JSON.stringify(b,null,2))}catch{}}let r=await w((a=>{let b=Array.isArray(a)?a:[],c=[];for(let a of b){let b=n.LOCAL_STDIO_PLUGINS.find(b=>b.name===a);if(!b)continue;let d={name:b.name,url:`http://localhost:${s}/api/mcp/${b.name}/sse`,transport:"sse"};if(Array.isArray(b.toolNames)&&b.toolNames.length>0){let a=`${b.name}-`,c={};for(let d of b.toolNames)c[d]="allow",c[`${a}${d}`]="allow";d.toolPolicy=c}c.push(d)}return c})(o)),t=await w((a=>{if(!Array.isArray(a))return[];let b=[];for(let c of a)c?.name&&(c.url?b.push({name:c.name,url:c.url,transport:c.transport||"sse",custom:!0}):c.command&&b.push({name:c.name,url:`http://localhost:${s}/api/mcp/${encodeURIComponent(c.name)}/sse`,transport:"sse",custom:!0}));return b})(q)),u=[...(0,n.buildManagedMcpServers)(m),...r,...t],v=await J(),z=await N(),A=i().join(D(),`${z.appliedId}.json`),B={...y,inferenceProvider:x,inferenceGatewayBaseUrl:b,inferenceGatewayApiKey:d,inferenceModels:l.map(a=>({name:a}))};u.length>0&&(B.managedMcpServers=u),await g().writeFile(A,JSON.stringify(B,null,2));let C=null;try{C=await O(u)}catch(a){C={error:a.message}}try{await K()}catch{}return e.NextResponse.json({success:!0,bootstrapped:v,message:v?"Cowork enabled (3p mode set). Quit & reopen Claude Desktop.":"Cowork settings applied. Quit & reopen Claude Desktop.",configPath:A,skipApprovals:C,localMcp:{applied:o,via:"3p-sse-bridge"}})}catch(a){return console.log("Error applying cowork settings:",a),e.NextResponse.json({error:"Failed to apply cowork settings"},{status:500})}}async function R(){try{let a=await M(await E());if(!a?.appliedId)return e.NextResponse.json({success:!0,message:"No active config to reset"});let b=i().join(await C(),`${a.appliedId}.json`);try{await g().writeFile(b,JSON.stringify({},null,2))}catch(a){if("ENOENT"!==a.code)throw a}try{await O([])}catch{}try{await K()}catch{}return e.NextResponse.json({success:!0,message:"Cowork config reset"})}catch(a){return console.log("Error resetting cowork settings:",a),e.NextResponse.json({error:"Failed to reset cowork settings"},{status:500})}}(0,r.D)([P,Q,R]),(0,d.A)(P,"00f0261a16f968bf752d0c143c1b8b4e3cafe139c0",null),(0,d.A)(Q,"40aedb46ab31b3a93f3bc3c7d914a8519bbd397fa1",null),(0,d.A)(R,"00f614b4418f9f2371da7c4eea209f6d1cea68f764",null)},81372:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DATA_DIR:()=>m,getDataDir:()=>l});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j="9router";function k(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),j):g().join(i().homedir(),`.${j}`)}function l(){let a=process.env.DATA_DIR;if(!a)return k();try{return e().mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${j}`),k();throw b}}let m=l()},89489:(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(50021),f=c(24709);d.rE;let g={npmPackageName:"9router",installCmd:"npm i -g 9router",installCmdLatest:"npm i -g 9router@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:20128},h={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"}},97418:a=>{"use strict";a.exports={DEFAULT_PLUGINS:[{name:"exa",title:"Exa",description:"Real-time web search and code documentation",url:"https://mcp.exa.ai/mcp",transport:"http",oauth:!1,toolNames:["web_search_exa","web_fetch_exa"]},{name:"tavily",title:"Tavily",description:"Real-time web search optimized for LLM agents",url:"https://mcp.tavily.com/mcp",transport:"http",oauth:!0,toolNames:["tavily_search","tavily_extract","tavily_crawl","tavily_map"]}],LOCAL_STDIO_PLUGINS:[{name:"browsermcp",title:"Browser MCP",description:"Control your running Chrome (requires Chrome extension)",extensionUrl:"https://chromewebstore.google.com/detail/browser-mcp-automate-your/bjfgambnhccakkhmkepdoekmckoijdlc",command:"npx",args:["-y","@browsermcp/mcp@latest"],toolNames:["browser_navigate","browser_snapshot","browser_click","browser_type","browser_screenshot","browser_get_console_logs","browser_wait","browser_press_key","browser_go_back","browser_go_forward"]}],ALLOWED_MCP_COMMANDS:new Set(["npx","node","uvx","python","python3","bunx","bun"]),buildManagedMcpServers:function(a){let b=Array.isArray(a)?a:[],c=[],d=new Set;for(let a of b){if(!a?.name||!a?.url||d.has(a.name))continue;d.add(a.name);let b={name:a.name,url:a.url,transport:a.transport||(/\/sse(\b|\/)/i.test(a.url)?"sse":"http")};if(a.oauth&&(b.oauth=!0),Array.isArray(a.toolNames)&&a.toolNames.length>0){let c=`${a.name}-`,d=new Set;for(let b of a.toolNames){if("string"!=typeof b||!b)continue;let a=b;for(;a.startsWith(c);)a=a.slice(c.length);d.add(a)}let e={};for(let a of d)e[a]="allow",e[`${c}${a}`]="allow";b.toolPolicy=e}c.push(b)}return c}}},99119:(a,b,c)=>{"use strict";c.d(b,{Xj:()=>q});var d=c(20243),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(81372);let l=h().join(k.DATA_DIR,"machine-id"),m=h().join(k.DATA_DIR,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.DATA_DIR,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="9r-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}}};
7
+ `)},isRunning:function(a){let b=m().get(a);return!!(b?.proc&&!b.proc.killed&&null===b.proc.exitCode)},findPlugin:p,registerCustomPlugin:function(a){if(!o(a?.command))throw Error(`Blocked: command '${a?.command}' not in MCP allowlist`);n().set(a.name,a)}}},39006:a=>{"use strict";a.exports={rE:"0.4.66"}},62276:(a,b,c)=>{"use strict";c.d(b,{Ak:()=>i,Yg:()=>k,xq:()=>h});var d=c(21820);let e={"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"},f={"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advanced-tool-use-2025-11-20,effort-2025-11-24,structured-outputs-2025-12-15,fast-mode-2026-02-01,redact-thinking-2026-02-12,token-efficient-tools-2026-03-28","Anthropic-Dangerous-Direct-Browser-Access":"true","User-Agent":"claude-cli/2.1.92 (external, sdk-cli)","X-App":"cli","X-Stainless-Helper-Method":"stream","X-Stainless-Retry-Count":"0","X-Stainless-Runtime-Version":"v24.14.0","X-Stainless-Package-Version":"0.80.0","X-Stainless-Runtime":"node","X-Stainless-Lang":"js","X-Stainless-Arch":function(){switch((0,d.arch)()){case"x64":return"x64";case"arm64":return"arm64";case"ia32":return"x86";default:return`other::${(0,d.arch)()}`}}(),"X-Stainless-Os":function(){switch((0,d.platform)()){case"darwin":return"MacOS";case"win32":return"Windows";case"linux":return"Linux";case"freebsd":return"FreeBSD";default:return`Other::${(0,d.platform)()}`}}(),"X-Stainless-Timeout":"600"},g="https://api.kimi.com/coding/v1/messages",h={claude:{baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",headers:{...f},clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",tokenUrl:"https://api.anthropic.com/v1/oauth/token"},gemini:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",format:"gemini",clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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"},"gemini-cli":{baseUrl:"https://cloudcode-pa.googleapis.com/v1internal",format:"gemini-cli",clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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"},codex:{baseUrl:"https://chatgpt.com/backend-api/codex/responses",format:"openai-responses",headers:{originator:"codex-cli","User-Agent":"codex-cli/1.0.18 (macOS; arm64)"},clientId:"app_EMoamEEZ73f0CkXaXp7hrann",tokenUrl:"https://auth.openai.com/oauth/token"},qwen:{baseUrl:"https://portal.qwen.ai/v1/chat/completions",format:"openai",clientId:"f0304373b74a44d2b584a3fb70ca9e56",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",authUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code"},iflow:{baseUrl:"https://apis.iflow.cn/v1/chat/completions",format:"openai",headers:{"User-Agent":"iFlow-Cli"},clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",tokenUrl:"https://iflow.cn/oauth/token",authUrl:"https://iflow.cn/oauth"},qoder:{baseUrl:"https://api3.qoder.sh/algo/api/v2/service/pro/sse/agent_chat_generation",format:"openai",headers:{}},antigravity:{baseUrls:["https://daily-cloudcode-pa.googleapis.com","https://daily-cloudcode-pa.sandbox.googleapis.com"],format:"antigravity",headers:{"User-Agent":`antigravity/1.107.0 ${(0,d.platform)()}/${(0,d.arch)()}`},clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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"},openrouter:{baseUrl:"https://openrouter.ai/api/v1/chat/completions",format:"openai",headers:{"HTTP-Referer":"https://endpoint-proxy.local","X-Title":"Endpoint Proxy"}},openai:{baseUrl:"https://api.openai.com/v1/chat/completions",format:"openai"},"vercel-ai-gateway":{baseUrl:"https://ai-gateway.vercel.sh/v1/chat/completions",format:"openai"},glm:{baseUrl:"https://api.z.ai/api/anthropic/v1/messages",format:"claude",headers:{...e}},"glm-cn":{baseUrl:"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",format:"openai",headers:{}},kimi:{baseUrl:g,format:"claude",headers:{...e}},minimax:{baseUrl:"https://api.minimax.io/anthropic/v1/messages",format:"claude",headers:{...e}},"minimax-cn":{baseUrl:"https://api.minimaxi.com/anthropic/v1/messages",format:"claude",headers:{...e}},alicode:{baseUrl:"https://coding.dashscope.aliyuncs.com/v1/chat/completions",format:"openai",headers:{}},"alicode-intl":{baseUrl:"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions",format:"openai",headers:{}},"volcengine-ark":{baseUrl:"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",format:"openai",headers:{}},byteplus:{baseUrl:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",format:"openai",headers:{}},github:{baseUrl:"https://api.githubcopilot.com/chat/completions",responsesUrl:"https://api.githubcopilot.com/responses",format:"openai",headers:{"copilot-integration-id":"vscode-chat","editor-version":"vscode/1.110.0","editor-plugin-version":"copilot-chat/0.38.0","user-agent":"GitHubCopilotChat/0.38.0","openai-intent":"conversation-panel","x-github-api-version":"2025-04-01","x-vscode-user-agent-library-version":"electron-fetch","X-Initiator":"user",Accept:"application/json","Content-Type":"application/json"},clientId:"Iv1.b507a08c87ecfe98"},kiro:{baseUrl:"https://codewhisperer.us-east-1.amazonaws.com/generateAssistantResponse",format:"kiro",retry:{429:2},headers:{"Content-Type":"application/json",Accept:"application/vnd.amazon.eventstream","X-Amz-Target":"AmazonCodeWhispererStreamingService.GenerateAssistantResponse","User-Agent":"AWS-SDK-JS/3.0.0 kiro-ide/1.0.0","X-Amz-User-Agent":"aws-sdk-js/3.0.0 kiro-ide/1.0.0"},tokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authUrl:"https://prod.us-east-1.auth.desktop.kiro.dev"},cursor:{baseUrl:"https://api2.cursor.sh",chatPath:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",format:"cursor",headers:{"connect-accept-encoding":"gzip","connect-protocol-version":"1","Content-Type":"application/connect+proto","User-Agent":"connect-es/1.6.1"},clientVersion:"3.1.0"},"kimi-coding":{baseUrl:g,format:"claude",headers:{...e},clientId:"17e5f671-d194-4dfb-9706-5516cb48c098",tokenUrl:"https://auth.kimi.com/api/oauth/token",refreshUrl:"https://auth.kimi.com/api/oauth/token"},kilocode:{baseUrl:"https://api.kilo.ai/api/openrouter/chat/completions",format:"openai",headers:{}},opencode:{baseUrl:"http://localhost:4096/v1/chat/completions",format:"openai",headers:{}},cline:{baseUrl:"https://api.cline.bot/api/v1/chat/completions",format:"openai",headers:{"HTTP-Referer":"https://cline.bot","X-Title":"Cline"},tokenUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},nvidia:{baseUrl:"https://integrate.api.nvidia.com/v1/chat/completions",format:"openai"},anthropic:{baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",headers:{...e}},deepseek:{baseUrl:"https://api.deepseek.com/chat/completions",format:"openai"},commandcode:{baseUrl:"https://api.commandcode.ai/alpha/generate",format:"commandcode",headers:{"x-command-code-version":"0.25.7","x-cli-environment":"cli"}},groq:{baseUrl:"https://api.groq.com/openai/v1/chat/completions",format:"openai"},xai:{baseUrl:"https://api.x.ai/v1/chat/completions",responsesUrl:"https://api.x.ai/v1/responses",format:"openai",clientId:"b1a00492-073a-47ea-816f-4c329264a828",tokenUrl:"https://auth.x.ai/oauth2/token",refreshUrl:"https://auth.x.ai/oauth2/token"},mistral:{baseUrl:"https://api.mistral.ai/v1/chat/completions",format:"openai"},perplexity:{baseUrl:"https://api.perplexity.ai/chat/completions",format:"openai"},together:{baseUrl:"https://api.together.xyz/v1/chat/completions",format:"openai"},fireworks:{baseUrl:"https://api.fireworks.ai/inference/v1/chat/completions",format:"openai"},cerebras:{baseUrl:"https://api.cerebras.ai/v1/chat/completions",format:"openai"},cohere:{baseUrl:"https://api.cohere.ai/v1/chat/completions",format:"openai"},nebius:{baseUrl:"https://api.studio.nebius.ai/v1/chat/completions",format:"openai"},siliconflow:{baseUrl:"https://api.siliconflow.cn/v1/chat/completions",format:"openai"},hyperbolic:{baseUrl:"https://api.hyperbolic.xyz/v1/chat/completions",format:"openai"},deepgram:{baseUrl:"https://api.deepgram.com/v1/listen",format:"openai"},assemblyai:{baseUrl:"https://api.assemblyai.com/v1/audio/transcriptions",format:"openai"},nanobanana:{baseUrl:"https://api.nanobananaapi.ai/v1/chat/completions",format:"openai"},chutes:{baseUrl:"https://llm.chutes.ai/v1/chat/completions",format:"openai"},ollama:{baseUrl:"https://ollama.com/api/chat",format:"ollama"},"ollama-local":{baseUrl:"http://localhost:11434/api/chat",format:"ollama"},vertex:{baseUrl:"https://aiplatform.googleapis.com",format:"vertex"},"vertex-partner":{baseUrl:"https://aiplatform.googleapis.com",format:"openai"},gitlab:{baseUrl:"https://gitlab.com/api/v4/chat/completions",format:"openai"},codebuddy:{baseUrl:"https://copilot.tencent.com/v1/chat/completions",format:"openai"},opencode:{baseUrl:"https://opencode.ai",format:"openai",headers:{"x-opencode-client":"desktop"},noAuth:!0},"opencode-go":{baseUrl:"https://opencode.ai/zen/go/v1/chat/completions",format:"openai",headers:{}},"grok-web":{baseUrl:"https://grok.com/rest/app-chat/conversations/new",format:"grok-web",authType:"cookie"},"perplexity-web":{baseUrl:"https://www.perplexity.ai/rest/sse/perplexity_ask",format:"perplexity-web",authType:"cookie"},azure:{baseUrl:"",format:"openai",headers:{}},"cloudflare-ai":{baseUrl:"https://api.cloudflare.com/client/v4/accounts/{accountId}/ai/v1/chat/completions",format:"openai"},"xiaomi-mimo":{baseUrl:"https://api.xiaomimimo.com/v1/chat/completions",format:"openai"},"xiaomi-tokenplan":{baseUrl:"https://token-plan-sgp.xiaomimimo.com/v1/chat/completions",format:"openai"},agentrouter:{baseUrl:"https://agentrouter.org/v1/messages",format:"claude",headers:{...f}},aimlapi:{baseUrl:"https://api.aimlapi.com/v1/chat/completions",format:"openai"},novita:{baseUrl:"https://api.novita.ai/v3/openai/chat/completions",format:"openai"},modal:{baseUrl:"https://api.modal.com/v1/chat/completions",format:"openai"},reka:{baseUrl:"https://api.reka.ai/v1/chat/completions",format:"openai"},nlpcloud:{baseUrl:"https://api.nlpcloud.io/v1/gpu/chatbot",format:"openai"},bazaarlink:{baseUrl:"https://bazaarlink.ai/api/v1/chat/completions",format:"openai"},completions:{baseUrl:"https://completions.me/api/v1/chat/completions",format:"openai"},enally:{baseUrl:"https://ai.enally.in/v1/chat/completions",format:"openai",authHeader:"x-api-key"},freetheai:{baseUrl:"https://api.freetheai.xyz/v1/chat/completions",format:"openai"},llm7:{baseUrl:"https://api.llm7.io/v1/chat/completions",format:"openai"},lepton:{baseUrl:"https://api.lepton.ai/api/v1/chat/completions",format:"openai"},kluster:{baseUrl:"https://api.kluster.ai/v1/chat/completions",format:"openai"},ai21:{baseUrl:"https://api.ai21.com/studio/v1/chat/completions",format:"openai"},"inference-net":{baseUrl:"https://api.inference.net/v1/chat/completions",format:"openai"},predibase:{baseUrl:"https://serving.app.predibase.com/v1/chat/completions",format:"openai"},bytez:{baseUrl:"https://api.bytez.com/models/v2",format:"openai"},morph:{baseUrl:"https://api.morphllm.com/v1/chat/completions",format:"openai"},longcat:{baseUrl:"https://api.longcat.chat/openai/v1/chat/completions",format:"openai"},puter:{baseUrl:"https://api.puter.com/puterai/openai/v1/chat/completions",format:"openai"},uncloseai:{baseUrl:"https://hermes.ai.unturf.com/v1/chat/completions",format:"openai",noAuth:!0},scaleway:{baseUrl:"https://api.scaleway.ai/v1/chat/completions",format:"openai"},deepinfra:{baseUrl:"https://api.deepinfra.com/v1/openai/chat/completions",format:"openai"},sambanova:{baseUrl:"https://api.sambanova.ai/v1/chat/completions",format:"openai"},nscale:{baseUrl:"https://inference.api.nscale.com/v1/chat/completions",format:"openai"},baseten:{baseUrl:"https://inference.baseten.co/v1/chat/completions",format:"openai"},publicai:{baseUrl:"https://api.publicai.co/v1/chat/completions",format:"openai"},"nous-research":{baseUrl:"https://inference-api.nousresearch.com/v1/chat/completions",format:"openai"},glhf:{baseUrl:"https://glhf.chat/api/openai/v1/chat/completions",format:"openai"},blackbox:{baseUrl:"https://api.blackbox.ai/chat/completions",format:"openai"}};function i(a){return(a?.providerSpecificData?.baseUrl?.trim()||"http://localhost:11434").replace(/\/$/,"")}let j={sgp:"https://token-plan-sgp.xiaomimimo.com/v1",cn:"https://token-plan-cn.xiaomimimo.com/v1",ams:"https://token-plan-ams.xiaomimimo.com/v1"};function k(a){return j[a?.providerSpecificData?.region]||j.sgp}},64749:()=>{},70802:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DELETE:()=>H,GET:()=>F,POST:()=>G});var d=c(71266),e=c(86606),f=c(79748),g=c.n(f),h=c(33873),i=c.n(h),j=c(21820),k=c.n(j),l=c(55511),m=c(97418),n=c(89489);c(81372);var o=c(99119),p=c(39990);let q=n.h0.appPort,r=null,s=()=>{if("darwin"===k().platform()){let a=i().join(k().homedir(),"Library","Application Support");return[i().join(a,"Claude-3p"),i().join(a,"Claude")]}if("win32"===k().platform()){let a=process.env.LOCALAPPDATA||i().join(k().homedir(),"AppData","Local"),b=process.env.APPDATA||i().join(k().homedir(),"AppData","Roaming");return[i().join(a,"Claude-3p"),i().join(b,"Claude-3p"),i().join(a,"Claude"),i().join(b,"Claude")]}return[i().join(k().homedir(),".config","Claude-3p"),i().join(k().homedir(),".config","Claude")]},t=async()=>{let a=s();for(let b of a)try{return await g().access(i().join(b,"configLibrary")),b}catch{}return a[0]},u=()=>s()[0],v=async()=>i().join(await t(),"configLibrary"),w=async()=>i().join(await v(),"_meta.json"),x=()=>{if("darwin"===k().platform())return i().join(k().homedir(),"Library","Application Support","Claude");if("win32"===k().platform()){let a=process.env.APPDATA||i().join(k().homedir(),"AppData","Roaming");return i().join(a,"Claude")}return i().join(k().homedir(),".config","Claude")},y=()=>i().join(x(),"claude_desktop_config.json"),z=async()=>{try{return JSON.parse(await g().readFile(y(),"utf-8"))||{}}catch(a){if("ENOENT"===a.code)return{};throw a}},A=async a=>{await g().mkdir(x(),{recursive:!0}),await g().writeFile(y(),JSON.stringify(a,null,2))},B=async()=>{let a=await z();if(!a.mcpServers||"object"!=typeof a.mcpServers)return;let b=new Set(m.LOCAL_STDIO_PLUGINS.map(a=>a.name));for(let c of Object.keys(a.mcpServers))b.has(c)&&delete a.mcpServers[c];0===Object.keys(a.mcpServers).length&&delete a.mcpServers,await A(a)},C=async()=>{for(let a of[...s(),...(()=>{if("darwin"===k().platform())return["/Applications/Claude.app",i().join(k().homedir(),"Applications","Claude.app")];if("win32"===k().platform()){let a=process.env.LOCALAPPDATA||i().join(k().homedir(),"AppData","Local"),b=process.env.ProgramFiles||"C:\\Program Files";return[i().join(a,"AnthropicClaude"),i().join(b,"Claude"),i().join(b,"AnthropicClaude")]}return[]})()])try{return await g().access(a),!0}catch{}return!1},D=async a=>{try{return JSON.parse(await g().readFile(a,"utf-8"))}catch(a){if("ENOENT"===a.code)return null;throw a}};async function E(a){let b=i().join(u(),"config.json"),c={};try{c=JSON.parse(await g().readFile(b,"utf-8"))||{}}catch(a){if("ENOENT"!==a.code)return{error:a.code}}let d={};for(let b of a)b?.name&&(d[b.name]=!0);return c.operonSkipMcpApprovals=d,await g().mkdir(u(),{recursive:!0}),await g().writeFile(b,JSON.stringify(c,null,2)),{written:Object.keys(d).length}}async function F(){try{if(!await C())return e.NextResponse.json({installed:!1,config:null,message:"Claude Desktop (Cowork mode) not detected"});let a=await D(await w()),b=a?.appliedId||null,c=await v(),d=b?i().join(c,`${b}.json`):null,f=d?await D(d):null,g=f?.inferenceGatewayBaseUrl||null,h=Array.isArray(f?.inferenceModels)?f.inferenceModels.map(a=>"string"==typeof a?a:a?.name).filter(Boolean):[],j=Array.isArray(f?.managedMcpServers)?f.managedMcpServers:[],k=!!(f?.inferenceProvider==="gateway"&&g),l=new Set(m.LOCAL_STDIO_PLUGINS.map(a=>a.name)),n=j.filter(a=>l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/")).map(a=>a.name),o=j.filter(a=>a.custom||!l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/")).map(a=>({name:a.name,url:a.url,transport:a.transport,custom:!0}));return e.NextResponse.json({installed:!0,config:f,has9Router:k,configPath:d,cowork:{appliedId:b,baseUrl:g,models:h,provider:f?.inferenceProvider||null,plugins:j.filter(a=>!a.custom&&!(l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/"))).map(a=>{let b=a.toolPolicy?Object.keys(a.toolPolicy):[],c=`${a.name}-`,d=new Set;for(let a of b){let b=a;for(;b.startsWith(c);)b=b.slice(c.length);d.add(b)}let e=m.DEFAULT_PLUGINS.find(b=>b.name===a.name),f=e&&Array.isArray(e.toolNames)?e.toolNames:Array.from(d);return{name:a.name,url:a.url,transport:a.transport,oauth:!!a.oauth,toolNames:f}}),localPlugins:n,customPlugins:o},defaultPlugins:m.DEFAULT_PLUGINS,localStdioPlugins:m.LOCAL_STDIO_PLUGINS})}catch(a){return console.log("Error reading cowork settings:",a),e.NextResponse.json({error:"Failed to read cowork settings"},{status:500})}}async function G(a){return e.NextResponse.json({error:"Cowork is disabled"},{status:403})}async function H(){try{let a=await D(await w());if(!a?.appliedId)return e.NextResponse.json({success:!0,message:"No active config to reset"});let b=i().join(await v(),`${a.appliedId}.json`);try{await g().writeFile(b,JSON.stringify({},null,2))}catch(a){if("ENOENT"!==a.code)throw a}try{await E([])}catch{}try{await B()}catch{}return e.NextResponse.json({success:!0,message:"Cowork config reset"})}catch(a){return console.log("Error resetting cowork settings:",a),e.NextResponse.json({error:"Failed to reset cowork settings"},{status:500})}}(0,p.D)([F,G,H]),(0,d.A)(F,"00f0261a16f968bf752d0c143c1b8b4e3cafe139c0",null),(0,d.A)(G,"40aedb46ab31b3a93f3bc3c7d914a8519bbd397fa1",null),(0,d.A)(H,"00f614b4418f9f2371da7c4eea209f6d1cea68f764",null)},81372:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DATA_DIR:()=>m,getDataDir:()=>l});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j="9router";function k(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),j):g().join(i().homedir(),`.${j}`)}function l(){let a=process.env.DATA_DIR;if(!a)return k();try{return e().mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${j}`),k();throw b}}let m=l()},89489:(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(50021),f=c(24709);d.rE;let g={npmPackageName:"9router",installCmd:"npm i -g 9router",installCmdLatest:"npm i -g 9router@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:20128},h={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"}},97418:a=>{"use strict";a.exports={DEFAULT_PLUGINS:[{name:"exa",title:"Exa",description:"Real-time web search and code documentation",url:"https://mcp.exa.ai/mcp",transport:"http",oauth:!1,toolNames:["web_search_exa","web_fetch_exa"]},{name:"tavily",title:"Tavily",description:"Real-time web search optimized for LLM agents",url:"https://mcp.tavily.com/mcp",transport:"http",oauth:!0,toolNames:["tavily_search","tavily_extract","tavily_crawl","tavily_map"]}],LOCAL_STDIO_PLUGINS:[{name:"browsermcp",title:"Browser MCP",description:"Control your running Chrome (requires Chrome extension)",extensionUrl:"https://chromewebstore.google.com/detail/browser-mcp-automate-your/bjfgambnhccakkhmkepdoekmckoijdlc",command:"npx",args:["-y","@browsermcp/mcp@latest"],toolNames:["browser_navigate","browser_snapshot","browser_click","browser_type","browser_screenshot","browser_get_console_logs","browser_wait","browser_press_key","browser_go_back","browser_go_forward"]}],ALLOWED_MCP_COMMANDS:new Set(["npx","node","uvx","python","python3","bunx","bun"]),buildManagedMcpServers:function(a){let b=Array.isArray(a)?a:[],c=[],d=new Set;for(let a of b){if(!a?.name||!a?.url||d.has(a.name))continue;d.add(a.name);let b={name:a.name,url:a.url,transport:a.transport||(/\/sse(\b|\/)/i.test(a.url)?"sse":"http")};if(a.oauth&&(b.oauth=!0),Array.isArray(a.toolNames)&&a.toolNames.length>0){let c=`${a.name}-`,d=new Set;for(let b of a.toolNames){if("string"!=typeof b||!b)continue;let a=b;for(;a.startsWith(c);)a=a.slice(c.length);d.add(a)}let e={};for(let a of d)e[a]="allow",e[`${c}${a}`]="allow";b.toolPolicy=e}c.push(b)}return c}}},99119:(a,b,c)=>{"use strict";c.d(b,{Xj:()=>q});var d=c(20243),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(81372);let l=h().join(k.DATA_DIR,"machine-id"),m=h().join(k.DATA_DIR,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.DATA_DIR,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="9r-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}}};
@@ -1,4 +1,4 @@
1
- "use strict";exports.id=450,exports.ids=[450],exports.modules={2932:(a,b,c)=>{c.d(b,{A:()=>h});var d=c(26835);c(53830);var e=c(73755);let f=[{icon:"terminal",label:"Terminal",desc:"Full shell access"},{icon:"cast",label:"Desktop",desc:"Screen sharing"},{icon:"folder_open",label:"Files",desc:"Browse & edit files"}],g=[{icon:"qr_code_scanner",text:"Scan QR to connect instantly"},{icon:"wifi_off",text:"No port forwarding needed"},{icon:"devices",text:"Works on any device"}];function h({isOpen:a,onClose:b}){return a?(0,e.createPortal)((0,d.jsxs)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in",onClick:b}),(0,d.jsxs)("div",{className:"relative w-full max-w-sm rounded-[14px] overflow-hidden shadow-[var(--shadow-elev)] fade-in flex flex-col bg-surface border border-border-subtle",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border-subtle",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"w-7 h-7 rounded-[8px] flex items-center justify-center bg-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-white text-base",children:"terminal"})}),(0,d.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-primary font-mono",children:"9Remote"})]}),(0,d.jsx)("button",{onClick:b,className:"p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-base",children:"close"})})]}),(0,d.jsxs)("div",{className:"px-7 py-7 pb-9 flex flex-col gap-6",children:[(0,d.jsxs)("div",{className:"flex flex-col items-center gap-2 text-center mt-2",children:[(0,d.jsx)("div",{className:"w-14 h-14 rounded-[14px] flex items-center justify-center mb-1 bg-primary shadow-[var(--shadow-warm)]",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-white text-[30px]",children:"terminal"})}),(0,d.jsx)("h1",{className:"text-lg font-bold text-text-main tracking-tight",children:"9Remote"}),(0,d.jsx)("p",{className:"text-xs text-text-muted leading-5 max-w-[220px]",children:"Access your terminal, desktop & files from anywhere"})]}),(0,d.jsx)("div",{className:"flex gap-2 w-full",children:f.map(({icon:a,label:b,desc:c})=>(0,d.jsxs)("div",{className:"flex-1 flex flex-col items-center gap-1.5 py-4 px-1 rounded-[10px] border border-border-subtle bg-surface-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[22px]",children:a}),(0,d.jsx)("p",{className:"text-xs font-semibold text-text-main",children:b}),(0,d.jsx)("p",{className:"text-[10px] text-text-muted text-center leading-4",children:c})]},b))}),(0,d.jsx)("div",{className:"flex flex-col gap-3 w-full",children:g.map(({icon:a,text:b})=>(0,d.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined flex-shrink-0 text-primary text-[16px]",children:a}),(0,d.jsx)("span",{className:"text-xs text-text-muted",children:b})]},a))}),(0,d.jsxs)("button",{onClick:()=>window.open("https://9remote.cc","_blank"),className:"w-full py-3 flex items-center justify-center gap-2 text-sm font-semibold text-white rounded-[10px] bg-primary hover:bg-primary-hover shadow-[var(--shadow-warm)] active:scale-[0.98] transition-all",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base",children:"open_in_new"}),"Get 9Remote"]})]})]})]}),document.body):null}},4565:(a,b,c)=>{c.d(b,{default:()=>k});var d=c(26835),e=c(30978),f=c.n(e),g=c(10074);let h=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],i=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],j=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function k(){return(0,d.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,d.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,d.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,d.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,d.jsx)("div",{className:"size-6 text-primary",children:(0,d.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,d.jsx)("path",{clipRule:"evenodd",d:"M12.0799 24L4 19.2479L9.95537 8.75216L18.04 13.4961L18.0446 4H29.9554L29.96 13.4961L38.0446 8.75216L44 19.2479L35.92 24L44 28.7521L38.0446 39.2479L29.96 34.5039L29.9554 44H18.0446L18.04 34.5039L9.95537 39.2479L4 28.7521L12.0799 24Z",fillRule:"evenodd"})})}),(0,d.jsx)("span",{className:"text-xl font-bold text-text-main",children:g.vQ.name})]}),(0,d.jsx)("p",{className:"text-text-muted mb-6 max-w-sm font-light",children:"The unified interface for modern AI infrastructure. Secure, observable, and scalable."}),(0,d.jsxs)("div",{className:"flex gap-4",children:[(0,d.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"})})}),(0,d.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"})})})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:h.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:i.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:j.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]})]}),(0,d.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",g.vQ.name," Inc. All rights reserved."]}),(0,d.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,d.jsx)(f(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,d.jsx)(f(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},5948:(a,b,c)=>{c.d(b,{default:()=>g});var d=c(26835),e=c(53830),f=c(33809);function g({isOpen:a,onClose:b,onAdd:c,addedNames:h=[]}){let[i,j]=(0,e.useState)([]),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)("all"),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)({}),[w,x]=(0,e.useState)({}),[y,z]=(0,e.useState)({}),A=(0,e.useMemo)(()=>new Set(h),[h]),B=(0,e.useMemo)(()=>{let a=m.trim().toLowerCase();return i.filter(b=>("authless"!==o||!b.oauth)&&("oauth"!==o||!!b.oauth)&&(!a||(b.title||"").toLowerCase().includes(a)||(b.description||"").toLowerCase().includes(a)||(b.name||"").toLowerCase().includes(a)))},[i,m,o]),C=async a=>{if(!u[a.url]){x(b=>({...b,[a.url]:!0}));try{let b=await fetch("/api/cli-tools/cowork-mcp-tools",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:a.url})}),c=await b.json(),d=c.tools||[],e=Array.isArray(a.toolNames)?a.toolNames:[],f=d.length>0?d.map(a=>a.name):e;v(b=>({...b,[a.url]:{tools:d,requiresAuth:!!c.requiresAuth,error:c.error}})),z(b=>({...b,[a.url]:Object.fromEntries(f.map(a=>[a,!0]))}))}catch(b){v(c=>({...c,[a.url]:{tools:[],error:b.message}}))}finally{x(b=>({...b,[a.url]:!1}))}}},D=(a,b)=>{let c=y[a]||{};z(d=>({...d,[a]:Object.fromEntries(Object.keys(c).map(a=>[a,b]))}))};return(0,d.jsx)(f.default,{isOpen:a,onClose:b,title:"Browse MCP Marketplace",size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{type:"text",value:m,onChange:a=>n(a.target.value),placeholder:"Search by name or description...",className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsxs)("select",{value:o,onChange:a=>p(a.target.value),className:"px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:[(0,d.jsx)("option",{value:"all",children:"All"}),(0,d.jsx)("option",{value:"authless",children:"Authless"}),(0,d.jsx)("option",{value:"oauth",children:"OAuth"})]})]}),q&&(0,d.jsx)("div",{className:"px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:q}),k&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-xs py-4 justify-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}),(0,d.jsx)("span",{children:"Loading registry..."})]}),!k&&(0,d.jsxs)("div",{className:"flex flex-col gap-1 max-h-[60vh] overflow-y-auto",children:[0===B.length&&(0,d.jsx)("div",{className:"text-center text-xs text-text-muted py-6",children:"No servers match filter"}),B.map(a=>{let b=A.has(a.slug||a.name),e=s===a.url,f=u[a.url],g=w[a.url],h=y[a.url]||{},i=Object.keys(h),j=Object.values(h).filter(Boolean).length;return(0,d.jsxs)("div",{className:"rounded border border-transparent hover:border-border",children:[(0,d.jsxs)("div",{className:"flex items-start gap-2 px-2 py-2 hover:bg-black/5 dark:hover:bg-white/5",children:[a.iconUrl?(0,d.jsx)("img",{src:a.iconUrl,alt:"",className:"size-7 rounded shrink-0 object-contain",onError:a=>{a.target.style.display="none"}}):(0,d.jsx)("div",{className:"size-7 rounded bg-surface shrink-0"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[(0,d.jsx)("span",{className:"font-medium text-xs",children:a.title}),a.oauth?(0,d.jsx)("span",{className:"px-1 py-0.5 text-[9px] rounded bg-amber-500/10 text-amber-600",children:"OAuth"}):(0,d.jsx)("span",{className:"px-1 py-0.5 text-[9px] rounded bg-green-500/10 text-green-600",children:"Authless"}),a.toolCount>0&&(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:[a.toolCount," tools"]})]}),a.description&&(0,d.jsx)("p",{className:"text-[10px] text-text-muted line-clamp-2 mt-0.5",children:a.description})]}),(0,d.jsx)("button",{onClick:()=>b?null:void(s===a.url?t(null):(t(a.url),C(a))),disabled:b,className:`shrink-0 px-2 py-1 rounded text-[10px] font-medium transition-colors ${b?"bg-green-500/10 text-green-600 cursor-default":e?"bg-surface border border-border text-text-muted hover:bg-black/5":"bg-primary/10 border border-primary/40 text-primary hover:bg-primary/20"}`,children:b?"Added":e?"Cancel":"+ Add"})]}),e&&(0,d.jsxs)("div",{className:"px-3 py-2 bg-surface/40 border-t border-border flex flex-col gap-2",children:[g&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-[10px] py-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-[14px]",children:"progress_activity"}),(0,d.jsx)("span",{children:"Probing server for tools..."})]}),!g&&f?.requiresAuth&&(0,d.jsx)("p",{className:"text-[10px] text-amber-600 bg-amber-500/10 px-2 py-1 rounded",children:"\uD83D\uDD10 OAuth required. Add now and authenticate after Apply; tool list will be discovered after first connect."}),!g&&f?.error&&!f?.requiresAuth&&(0,d.jsxs)("p",{className:"text-[10px] text-red-600 bg-red-500/10 px-2 py-1 rounded",children:["Probe failed: ",f.error]}),!g&&0===i.length&&!f?.requiresAuth&&!f?.error&&(0,d.jsx)("p",{className:"text-[10px] text-text-muted",children:"No tools advertised by server."}),!g&&i.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:[j,"/",i.length," tools enabled"]}),(0,d.jsxs)("div",{className:"flex gap-1",children:[(0,d.jsx)("button",{onClick:()=>D(a.url,!0),className:"text-[10px] text-primary hover:underline",children:"All"}),(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"\xb7"}),(0,d.jsx)("button",{onClick:()=>D(a.url,!1),className:"text-[10px] text-primary hover:underline",children:"None"})]})]}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-1 max-h-40 overflow-y-auto",children:i.map(b=>(0,d.jsxs)("label",{className:"flex items-center gap-1.5 text-[10px] cursor-pointer hover:bg-black/5 dark:hover:bg-white/5 px-1 rounded",children:[(0,d.jsx)("input",{type:"checkbox",checked:!!h[b],onChange:()=>{var c;return c=a.url,void z(a=>({...a,[c]:{...a[c],[b]:!a[c]?.[b]}}))},className:"size-3"}),(0,d.jsx)("span",{className:"truncate",children:b})]},b))})]}),(0,d.jsx)("button",{onClick:()=>{let b,d;return d=Object.keys(b=y[a.url]||{}).filter(a=>b[a]),void(c?.({name:a.slug||a.name,title:a.title,description:a.description,url:a.url,transport:a.transport,oauth:a.oauth,toolNames:d}),t(null))},className:"self-end px-2 py-1 rounded text-[10px] font-medium bg-primary text-white hover:bg-primary/90",children:"✓ Confirm Add"})]})]},a.url)})]}),(0,d.jsxs)("div",{className:"text-[10px] text-text-muted text-right",children:[B.length," of ",i.length," servers"]})]})})}},7274:(a,b,c)=>{c.d(b,{default:()=>j});var d=c(26835),e=c(53830),f=c(41183),g=c.n(f),h=c(50450),i=c(93617);function j({isOpen:a,provider:b,providerInfo:c,onSuccess:f,onClose:g,oauthMeta:k,idcConfig:l}){let[m,n]=(0,e.useState)("waiting"),[o,p]=(0,e.useState)(null),[q,r]=(0,e.useState)(""),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(!1),A=(0,e.useRef)(null),B=(0,e.useRef)(!1),{copied:C,copy:D}=(0,i.C)(),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)("/callback?code=...");(0,e.useRef)(!1);let I=(0,e.useCallback)(async(a,c)=>{if(o)try{let d=await fetch(`/api/oauth/${b}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:a,redirectUri:o.redirectUri,codeVerifier:o.codeVerifier,state:c,...k?{meta:k}:{}})}),e=await d.json();if(!d.ok)throw Error(e.error);n("success"),f?.()}catch(a){t(a.message),n("error")}},[o,b,f]),J=(0,e.useCallback)(async a=>{if(o?.state)try{let b=await fetch("/api/oauth/xai/manual-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:a,state:o.state})}),c=await b.json();if(!b.ok)throw Error(c.error);n("success"),f?.()}catch(a){t(a.message),n("error")}},[o,f]),K=(0,e.useCallback)(async(a,c,d,e)=>{B.current=!1,z(!0);for(let g=0;g<60;g++){if(B.current){console.log("[OAuthModal] Polling aborted"),z(!1);return}if(await new Promise(a=>setTimeout(a,1e3*d)),B.current){console.log("[OAuthModal] Polling aborted after sleep"),z(!1);return}try{let g=await fetch(`/api/oauth/${b}/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:a,codeVerifier:c,extraData:e})}),h=await g.json();if(h.success){B.current=!0,n("success"),z(!1),f?.();return}if("expired_token"===h.error||"access_denied"===h.error)throw Error(h.errorDescription||h.error);"slow_down"===h.error&&(d=Math.min(d+5,30))}catch(a){t(a.message),n("error"),z(!1);return}}t("Authorization timeout"),n("error"),z(!1)},[b,f]),L=(0,e.useCallback)(async()=>{if(b)try{let a;if(t(null),["github","qwen","kiro","kimi-coding","kilocode","codebuddy"].includes(b)){v(!0),n("waiting");let a=new URL(`/api/oauth/${b}/device-code`,window.location.origin);"kiro"===b&&l?.startUrl&&(a.searchParams.set("start_url",l.startUrl),l.region&&a.searchParams.set("region",l.region),a.searchParams.set("auth_method","idc"));let c=await fetch(a.toString()),d=await c.json();if(!c.ok)throw Error(d.error);x(d);let e=d.verification_uri_complete||d.verification_uri;e&&window.open(e,"_blank","noopener,noreferrer");let f="kiro"===b?{_clientId:d._clientId,_clientSecret:d._clientSecret,_region:d._region,_authMethod:d._authMethod,_startUrl:d._startUrl}:null;K(d.device_code,d.codeVerifier,d.interval||5,f);return}let c=window.location.port||("https:"===window.location.protocol?"443":"80");a="codex"===b?"http://localhost:1455/auth/callback":"xai"===b?"http://127.0.0.1:56121/callback":`http://localhost:${c}/callback`;let d=new URL(`/api/oauth/${b}/authorize`,window.location.origin);d.searchParams.set("redirect_uri",a),k&&Object.entries(k).forEach(([a,b])=>{b&&d.searchParams.set(a,b)});let e=await fetch(d.toString()),f=await e.json();if(!e.ok)throw Error(f.error);let g=!1,h=!1;if("codex"===b)try{let b=new URL("/api/oauth/codex/start-proxy",window.location.origin);b.searchParams.set("app_port",c),b.searchParams.set("state",f.state),b.searchParams.set("code_verifier",f.codeVerifier),b.searchParams.set("redirect_uri",a);let d=await fetch(b.toString()),e=await d.json();g=e.success,h=!!e.serverSide}catch{g=!1}let i=!1,j=!1;if("xai"===b)try{let b=new URL("/api/oauth/xai/start-proxy",window.location.origin);b.searchParams.set("app_port",c),b.searchParams.set("state",f.state),b.searchParams.set("code_verifier",f.codeVerifier),b.searchParams.set("redirect_uri",a);let d=await fetch(b.toString()),e=await d.json();if(i=e.success,j=!!e.serverSide,!i&&"port_busy"===e.reason)throw Error("Port 56121 in use; close the conflicting process and retry")}catch(a){if(a?.message)throw a;i=!1}p({...f,redirectUri:a,codexServerSide:h,xaiServerSide:j}),"codex"===b&&g||"xai"===b&&i||E&&"codex"!==b&&"xai"!==b?(n("waiting"),A.current=window.open(f.authUrl,"oauth_popup","width=600,height=700"),A.current||n("input")):(n("input"),window.open(f.authUrl,"_blank"))}catch(a){t(a.message),n("error")}},[b,E,K,k,l]),M=async()=>{try{t(null);let a=q.trim();if(a.startsWith("eyJ")&&a.includes("."))return void await I(a,null);if("xai"===b&&a&&!a.includes("://")&&!a.includes("?")&&!a.includes("code="))return void await J(a);let c=new URL(a),d=c.searchParams.get("code"),e=c.searchParams.get("state"),f=c.searchParams.get("error");if(f)throw Error(c.searchParams.get("error_description")||f);if(!d)throw Error("xai"===b?"Paste the callback URL or copied xAI code":"No authorization code found in URL");await I(d,e)}catch(a){t(a.message),n("error")}},N=(0,e.useCallback)(()=>{"codex"===b?fetch("/api/oauth/codex/stop-proxy").catch(()=>{}):"xai"===b&&fetch("/api/oauth/xai/stop-proxy").catch(()=>{}),g()},[g,b]);if(!b||!c)return null;let O="xai"===b,P=w?.verification_uri_complete||w?.verification_uri||"",Q=O?"Connect Grok Build OAuth":`Connect ${c.name}`;return(0,d.jsx)(h.aF,{isOpen:a,title:Q,onClose:N,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[("waiting"===m||"input"===m)&&!u&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border border-border rounded-lg bg-sidebar/50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base text-primary animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{className:"text-sm",children:O?"Waiting for Grok Build OAuth…":"Waiting for popup authorization…"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3 my-1",children:[(0,d.jsx)("div",{className:"flex-1 h-px bg-border"}),(0,d.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wider",children:"Or paste callback URL manually"}),(0,d.jsx)("div",{className:"flex-1 h-px bg-border"})]}),(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 1: Open this ",O?"Grok Build OAuth URL":"URL"," in your browser"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.pd,{value:o?.authUrl||"",readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,d.jsx)(h.$n,{variant:"secondary",icon:"auth_url"===C?"check":"content_copy",onClick:()=>D(o?.authUrl,"auth_url"),disabled:!o?.authUrl,children:"Copy"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 2: Paste the ","xai"===b?"callback URL or copied code":"callback URL"," here"]}),(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"xai"===b?"If xAI shows a code instead of redirecting, paste that code here.":"After authorization, copy the full URL from your browser."}),(0,d.jsx)(h.pd,{value:q,onChange:a=>r(a.target.value),placeholder:O?"http://127.0.0.1:56121/callback?code=... or copied code":G,className:"font-mono text-xs"})]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:M,fullWidth:!0,disabled:!q,children:"Connect"}),(0,d.jsx)(h.$n,{onClick:N,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"waiting"===m&&u&&w&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"text-center py-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Visit the login URL below and authorize:"}),(0,d.jsxs)("div",{className:"bg-sidebar p-4 rounded-lg mb-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Login URL"}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("code",{className:"flex-1 text-sm break-all",children:P}),(0,d.jsx)(h.$n,{size:"sm",variant:"ghost",icon:"login_url"===C?"check":"content_copy",onClick:()=>D(P,"login_url"),disabled:!P}),(0,d.jsx)(h.$n,{size:"sm",variant:"ghost",icon:"open_in_new",onClick:()=>window.open(P,"_blank","noopener,noreferrer"),disabled:!P,children:"Open"})]})]}),(0,d.jsxs)("div",{className:"bg-primary/10 p-4 rounded-lg",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Your Code"}),(0,d.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,d.jsx)("p",{className:"text-2xl font-mono font-bold text-primary",children:w.user_code}),(0,d.jsx)(h.$n,{size:"sm",variant:"ghost",icon:"user_code"===C?"check":"content_copy",onClick:()=>D(w.user_code,"user_code")})]})]})]}),y&&(0,d.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),"Waiting for authorization..."]})]}),"success"===m&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,d.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your ",c.name," account has been connected."]}),(0,d.jsx)(h.$n,{onClick:N,fullWidth:!0,children:"Done"})]}),"error"===m&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,d.jsx)("p",{className:"text-sm text-red-600 mb-4",children:s}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:L,variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,d.jsx)(h.$n,{onClick:N,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}j.propTypes={isOpen:g().bool.isRequired,provider:g().string,providerInfo:g().shape({name:g().string}),onSuccess:g().func,onClose:g().func.isRequired,oauthMeta:g().object,idcConfig:g().shape({startUrl:g().string,region:g().string})}},9904:(a,b,c)=>{c.d(b,{default:()=>n});var d=c(26835),e=c(53830),f=c(41183),g=c.n(f),h=c(33809),i=c(66298),j=c(65839),k=c(30207);let l=[...Object.keys(k.zN),...Object.keys(k.IS),...Object.keys(k.nJ),...Object.keys(k.fg)],m=Object.keys(k.IS).filter(a=>k.IS[a].noAuth);function n({isOpen:a,onClose:b,onSelect:c,onDeselect:f,selectedModel:g,activeProviders:o=[],title:p="Select Model",modelAliases:q={},kindFilter:r=null,addedModelValues:s=[],closeOnSelect:t=!0}){let u=(0,e.useMemo)(()=>r?o.filter(a=>{let b=k.Q2[a.provider];return(b?.serviceKinds||["llm"]).includes(r)}):o,[o,r]),[v,w]=(0,e.useState)(""),[x,y]=(0,e.useState)([]),[z,A]=(0,e.useState)([]),[B,C]=(0,e.useState)([]),[D,E]=(0,e.useState)({}),F=(0,e.useMemo)(()=>({...k.zN,...k.IS,...k.nJ,...k.fg}),[]),G=(0,e.useMemo)(()=>{let a={},b=new Set(["webSearch","webFetch"]),c=new Set(["image","tts","stt","embedding","imageToText"]),d=new Set(["tts","image","webFetch"]);return[...new Set([...u.map(a=>a.provider),...r?m.filter(a=>(k.Q2[a]?.serviceKinds||["llm"]).includes(r)):m])].sort((a,b)=>{let c=l.indexOf(a),d=l.indexOf(b);return(-1===c?999:c)-(-1===d?999:d)}).forEach(e=>{let f=(0,k.wG)(e),g=F[e]||{name:e,color:"#666"},h=(0,k.mq)(e)||(0,k.gb)(e);if(r&&b.has(r)){a[e]={name:g.name,alias:f,color:g.color,models:[{id:e,name:g.name,value:e}]};return}if(g.passthroughModels){let b=Object.entries(q).filter(([,a])=>a.startsWith(`${f}/`)).map(([a,b])=>({id:b.replace(`${f}/`,""),name:a,value:b}));if(r&&c.has(r)&&0===(b=(0,j.KC)(e).filter(a=>a.type===r).map(a=>({id:a.id,name:a.name,value:`${f}/${a.id}`,type:a.type}))).length&&d.has(r)&&(g.serviceKinds||["llm"]).includes(r)&&(b=[{id:e,name:g.name,value:f}]),b.length>0){let c=z.find(a=>a.id===e),d=c?.name||g.name;a[e]={name:d,alias:f,color:g.color,models:b}}}else if(h){if(r&&c.has(r))return;let b=o.find(a=>a.provider===e),d=z.find(a=>a.id===e),f=b?.name||d?.name||g.name,h=b?.providerSpecificData?.prefix||d?.prefix||e,i=Object.entries(q).filter(([,a])=>a.startsWith(`${e}/`)).map(([a,b])=>({id:b.replace(`${e}/`,""),name:a,value:`${h}/${b.replace(`${e}/`,"")}`})),j=i.length>0?i:[{id:`__placeholder__${e}`,name:`${h}/model-id`,value:`${h}/model-id`,isPlaceholder:!0}];a[e]={name:f,alias:h,color:g.color,models:j,isCustom:!0,hasModels:i.length>0}}else{var i;let b=(0,j.KC)(e),h=new Set(b.map(a=>a.id)),k=b.length>0,l=Object.entries(q).filter(([a,b])=>b.startsWith(`${f}/`)&&(!k||a===b.replace(`${f}/`,""))&&!h.has(b.replace(`${f}/`,""))).map(([a,b])=>({id:b.replace(`${f}/`,""),name:a,value:b,isCustom:!0})),m=new Set(l.map(a=>a.id)),n=B.filter(a=>a.providerAlias===f&&!h.has(a.id)&&!m.has(a.id)).map(a=>({id:a.id,name:a.name||a.id,value:`${f}/${a.id}`,isCustom:!0})),o=[...b.map(a=>({id:a.id,name:a.name,value:`${f}/${a.id}`,type:a.type})),...l,...n],p=new Set,s=(i=o.filter(a=>!p.has(a.value)&&(p.add(a.value),!0)),r?c.has(r)?i.filter(a=>a.isPlaceholder||a.type===r):i:i.filter(a=>a.isPlaceholder||!a.type||"llm"===a.type));0===s.length&&r&&d.has(r)&&(g.serviceKinds||["llm"]).includes(r)&&(s=[{id:e,name:g.name,value:f}]),s.length>0&&(a[e]={name:g.name,alias:f,color:g.color,models:s})}}),Object.entries(a).forEach(([b,c])=>{let d=new Set([...D[(0,k.wG)(b)]||[],...D[b]||[]]);0!==d.size&&(c.models=c.models.filter(a=>!d.has(a.id)),0===c.models.length&&delete a[b])}),a},[u,q,F,z,B,D,r,o]),H=(0,e.useMemo)(()=>{if(r)return[];if(!v.trim())return x;let a=v.toLowerCase();return x.filter(b=>b.name.toLowerCase().includes(a))},[x,v,r]),I=(0,e.useMemo)(()=>{let a=v.trim().toLowerCase(),b={};return Object.entries(G).forEach(([c,d])=>{var e;let f=d.models;if(a){let b=d.name.toLowerCase().includes(a);if(0===(f=f.filter(b=>b.name.toLowerCase().includes(a)||b.id.toLowerCase().includes(a))).length&&!b)return}b[c]={...d,models:[...(e=f).filter(a=>s.includes(a.value)).sort((a,b)=>a.name.localeCompare(b.name)),...e.filter(a=>!s.includes(a.value)).sort((a,b)=>a.name.localeCompare(b.name))]}}),b},[G,v,s]),J=a=>{let d=a?.value||a?.name||a;s.includes(d)&&f?f(a):c(a),t&&(b(),w(""))};return(0,d.jsxs)(h.default,{isOpen:a,onClose:()=>{b(),w("")},title:p,size:"md",className:"p-4!",footer:null,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3 px-2.5 py-2 bg-primary/8 border border-primary/20 rounded-lg text-xs text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary shrink-0",style:{fontSize:"14px"},children:"info"}),(0,d.jsx)("span",{children:"Click to add, click again to remove. Changes are saved automatically."})]}),(0,d.jsx)("div",{className:"mb-3",children:(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,d.jsx)("input",{type:"text",placeholder:"Search...",value:v,onChange:a=>w(a.target.value),className:"w-full pl-8 pr-3 py-1.5 bg-surface border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"})]})}),(0,d.jsxs)("div",{className:"max-h-[400px] overflow-y-auto space-y-3",children:[H.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[14px]",children:"layers"}),(0,d.jsx)("span",{className:"text-xs font-medium text-primary",children:"Combos"}),(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",H.length,")"]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:H.map(a=>{let b=g===a.name;return(0,d.jsxs)("button",{onClick:()=>J({id:a.name,name:a.name,value:a.name}),className:`
1
+ "use strict";exports.id=450,exports.ids=[450],exports.modules={2932:(a,b,c)=>{c.d(b,{A:()=>h});var d=c(26835);c(53830);var e=c(73755);let f=[{icon:"terminal",label:"Terminal",desc:"Full shell access"},{icon:"cast",label:"Desktop",desc:"Screen sharing"},{icon:"folder_open",label:"Files",desc:"Browse & edit files"}],g=[{icon:"qr_code_scanner",text:"Scan QR to connect instantly"},{icon:"wifi_off",text:"No port forwarding needed"},{icon:"devices",text:"Works on any device"}];function h({isOpen:a,onClose:b}){return a?(0,e.createPortal)((0,d.jsxs)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in",onClick:b}),(0,d.jsxs)("div",{className:"relative w-full max-w-sm rounded-[14px] overflow-hidden shadow-[var(--shadow-elev)] fade-in flex flex-col bg-surface border border-border-subtle",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border-subtle",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"w-7 h-7 rounded-[8px] flex items-center justify-center bg-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-white text-base",children:"terminal"})}),(0,d.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-primary font-mono",children:"9Remote"})]}),(0,d.jsx)("button",{onClick:b,className:"p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-base",children:"close"})})]}),(0,d.jsxs)("div",{className:"px-7 py-7 pb-9 flex flex-col gap-6",children:[(0,d.jsxs)("div",{className:"flex flex-col items-center gap-2 text-center mt-2",children:[(0,d.jsx)("div",{className:"w-14 h-14 rounded-[14px] flex items-center justify-center mb-1 bg-primary shadow-[var(--shadow-warm)]",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-white text-[30px]",children:"terminal"})}),(0,d.jsx)("h1",{className:"text-lg font-bold text-text-main tracking-tight",children:"9Remote"}),(0,d.jsx)("p",{className:"text-xs text-text-muted leading-5 max-w-[220px]",children:"Access your terminal, desktop & files from anywhere"})]}),(0,d.jsx)("div",{className:"flex gap-2 w-full",children:f.map(({icon:a,label:b,desc:c})=>(0,d.jsxs)("div",{className:"flex-1 flex flex-col items-center gap-1.5 py-4 px-1 rounded-[10px] border border-border-subtle bg-surface-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[22px]",children:a}),(0,d.jsx)("p",{className:"text-xs font-semibold text-text-main",children:b}),(0,d.jsx)("p",{className:"text-[10px] text-text-muted text-center leading-4",children:c})]},b))}),(0,d.jsx)("div",{className:"flex flex-col gap-3 w-full",children:g.map(({icon:a,text:b})=>(0,d.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined flex-shrink-0 text-primary text-[16px]",children:a}),(0,d.jsx)("span",{className:"text-xs text-text-muted",children:b})]},a))}),(0,d.jsxs)("button",{onClick:()=>window.open("https://9remote.cc","_blank"),className:"w-full py-3 flex items-center justify-center gap-2 text-sm font-semibold text-white rounded-[10px] bg-primary hover:bg-primary-hover shadow-[var(--shadow-warm)] active:scale-[0.98] transition-all",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base",children:"open_in_new"}),"Get 9Remote"]})]})]})]}),document.body):null}},4565:(a,b,c)=>{c.d(b,{default:()=>k});var d=c(26835),e=c(30978),f=c.n(e),g=c(10074);let h=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],i=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],j=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function k(){return(0,d.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,d.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,d.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,d.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,d.jsx)("div",{className:"size-6 text-primary",children:(0,d.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,d.jsx)("path",{clipRule:"evenodd",d:"M12.0799 24L4 19.2479L9.95537 8.75216L18.04 13.4961L18.0446 4H29.9554L29.96 13.4961L38.0446 8.75216L44 19.2479L35.92 24L44 28.7521L38.0446 39.2479L29.96 34.5039L29.9554 44H18.0446L18.04 34.5039L9.95537 39.2479L4 28.7521L12.0799 24Z",fillRule:"evenodd"})})}),(0,d.jsx)("span",{className:"text-xl font-bold text-text-main",children:g.vQ.name})]}),(0,d.jsx)("p",{className:"text-text-muted mb-6 max-w-sm font-light",children:"The unified interface for modern AI infrastructure. Secure, observable, and scalable."}),(0,d.jsxs)("div",{className:"flex gap-4",children:[(0,d.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"})})}),(0,d.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"})})})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:h.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:i.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,d.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:j.map(a=>(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:a.href,className:"hover:text-primary transition-colors",children:a.label})},a.label))})]})]}),(0,d.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",g.vQ.name," Inc. All rights reserved."]}),(0,d.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,d.jsx)(f(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,d.jsx)(f(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},5948:(a,b,c)=>{c.d(b,{default:()=>g});var d=c(26835),e=c(53830),f=c(33809);function g({isOpen:a,onClose:b,onAdd:c,addedNames:h=[]}){let[i,j]=(0,e.useState)([]),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)("all"),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)({}),[w,x]=(0,e.useState)({}),[y,z]=(0,e.useState)({}),A=(0,e.useMemo)(()=>new Set(h),[h]),B=(0,e.useMemo)(()=>{let a=m.trim().toLowerCase();return i.filter(b=>("authless"!==o||!b.oauth)&&("oauth"!==o||!!b.oauth)&&(!a||(b.title||"").toLowerCase().includes(a)||(b.description||"").toLowerCase().includes(a)||(b.name||"").toLowerCase().includes(a)))},[i,m,o]),C=async a=>{if(!u[a.url]){x(b=>({...b,[a.url]:!0}));try{let b=await fetch("/api/cli-tools/cowork-mcp-tools",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:a.url})}),c=await b.json(),d=c.tools||[],e=Array.isArray(a.toolNames)?a.toolNames:[],f=d.length>0?d.map(a=>a.name):e;v(b=>({...b,[a.url]:{tools:d,requiresAuth:!!c.requiresAuth,error:c.error}})),z(b=>({...b,[a.url]:Object.fromEntries(f.map(a=>[a,!0]))}))}catch(b){v(c=>({...c,[a.url]:{tools:[],error:b.message}}))}finally{x(b=>({...b,[a.url]:!1}))}}},D=(a,b)=>{let c=y[a]||{};z(d=>({...d,[a]:Object.fromEntries(Object.keys(c).map(a=>[a,b]))}))};return(0,d.jsx)(f.default,{isOpen:a,onClose:b,title:"Browse MCP Marketplace",size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{type:"text",value:m,onChange:a=>n(a.target.value),placeholder:"Search by name or description...",className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsxs)("select",{value:o,onChange:a=>p(a.target.value),className:"px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:[(0,d.jsx)("option",{value:"all",children:"All"}),(0,d.jsx)("option",{value:"authless",children:"Authless"}),(0,d.jsx)("option",{value:"oauth",children:"OAuth"})]})]}),q&&(0,d.jsx)("div",{className:"px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:q}),k&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-xs py-4 justify-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}),(0,d.jsx)("span",{children:"Loading registry..."})]}),!k&&(0,d.jsxs)("div",{className:"flex flex-col gap-1 max-h-[60vh] overflow-y-auto",children:[0===B.length&&(0,d.jsx)("div",{className:"text-center text-xs text-text-muted py-6",children:"No servers match filter"}),B.map(a=>{let b=A.has(a.slug||a.name),e=s===a.url,f=u[a.url],g=w[a.url],h=y[a.url]||{},i=Object.keys(h),j=Object.values(h).filter(Boolean).length;return(0,d.jsxs)("div",{className:"rounded border border-transparent hover:border-border",children:[(0,d.jsxs)("div",{className:"flex items-start gap-2 px-2 py-2 hover:bg-black/5 dark:hover:bg-white/5",children:[a.iconUrl?(0,d.jsx)("img",{src:a.iconUrl,alt:"",className:"size-7 rounded shrink-0 object-contain",onError:a=>{a.target.style.display="none"}}):(0,d.jsx)("div",{className:"size-7 rounded bg-surface shrink-0"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[(0,d.jsx)("span",{className:"font-medium text-xs",children:a.title}),a.oauth?(0,d.jsx)("span",{className:"px-1 py-0.5 text-[9px] rounded bg-amber-500/10 text-amber-600",children:"OAuth"}):(0,d.jsx)("span",{className:"px-1 py-0.5 text-[9px] rounded bg-green-500/10 text-green-600",children:"Authless"}),a.toolCount>0&&(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:[a.toolCount," tools"]})]}),a.description&&(0,d.jsx)("p",{className:"text-[10px] text-text-muted line-clamp-2 mt-0.5",children:a.description})]}),(0,d.jsx)("button",{onClick:()=>b?null:void(s===a.url?t(null):(t(a.url),C(a))),disabled:b,className:`shrink-0 px-2 py-1 rounded text-[10px] font-medium transition-colors ${b?"bg-green-500/10 text-green-600 cursor-default":e?"bg-surface border border-border text-text-muted hover:bg-black/5":"bg-primary/10 border border-primary/40 text-primary hover:bg-primary/20"}`,children:b?"Added":e?"Cancel":"+ Add"})]}),e&&(0,d.jsxs)("div",{className:"px-3 py-2 bg-surface/40 border-t border-border flex flex-col gap-2",children:[g&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-[10px] py-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-[14px]",children:"progress_activity"}),(0,d.jsx)("span",{children:"Probing server for tools..."})]}),!g&&f?.requiresAuth&&(0,d.jsx)("p",{className:"text-[10px] text-amber-600 bg-amber-500/10 px-2 py-1 rounded",children:"\uD83D\uDD10 OAuth required. Add now and authenticate after Apply; tool list will be discovered after first connect."}),!g&&f?.error&&!f?.requiresAuth&&(0,d.jsxs)("p",{className:"text-[10px] text-red-600 bg-red-500/10 px-2 py-1 rounded",children:["Probe failed: ",f.error]}),!g&&0===i.length&&!f?.requiresAuth&&!f?.error&&(0,d.jsx)("p",{className:"text-[10px] text-text-muted",children:"No tools advertised by server."}),!g&&i.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:[j,"/",i.length," tools enabled"]}),(0,d.jsxs)("div",{className:"flex gap-1",children:[(0,d.jsx)("button",{onClick:()=>D(a.url,!0),className:"text-[10px] text-primary hover:underline",children:"All"}),(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"\xb7"}),(0,d.jsx)("button",{onClick:()=>D(a.url,!1),className:"text-[10px] text-primary hover:underline",children:"None"})]})]}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-1 max-h-40 overflow-y-auto",children:i.map(b=>(0,d.jsxs)("label",{className:"flex items-center gap-1.5 text-[10px] cursor-pointer hover:bg-black/5 dark:hover:bg-white/5 px-1 rounded",children:[(0,d.jsx)("input",{type:"checkbox",checked:!!h[b],onChange:()=>{var c;return c=a.url,void z(a=>({...a,[c]:{...a[c],[b]:!a[c]?.[b]}}))},className:"size-3"}),(0,d.jsx)("span",{className:"truncate",children:b})]},b))})]}),(0,d.jsx)("button",{onClick:()=>{let b,d;return d=Object.keys(b=y[a.url]||{}).filter(a=>b[a]),void(c?.({name:a.slug||a.name,title:a.title,description:a.description,url:a.url,transport:a.transport,oauth:a.oauth,toolNames:d}),t(null))},className:"self-end px-2 py-1 rounded text-[10px] font-medium bg-primary text-white hover:bg-primary/90",children:"✓ Confirm Add"})]})]},a.url)})]}),(0,d.jsxs)("div",{className:"text-[10px] text-text-muted text-right",children:[B.length," of ",i.length," servers"]})]})})}},7274:(a,b,c)=>{c.d(b,{default:()=>j});var d=c(26835),e=c(53830),f=c(41183),g=c.n(f),h=c(50450),i=c(93617);function j({isOpen:a,provider:b,providerInfo:c,onSuccess:f,onClose:g,oauthMeta:k,idcConfig:l}){let[m,n]=(0,e.useState)("waiting"),[o,p]=(0,e.useState)(null),[q,r]=(0,e.useState)(""),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(!1),A=(0,e.useRef)(null),B=(0,e.useRef)(!1),{copied:C,copy:D}=(0,i.C)(),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)("/callback?code=...");(0,e.useRef)(!1);let I=(0,e.useCallback)(async(a,c)=>{if(o)try{let d=await fetch(`/api/oauth/${b}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:a,redirectUri:o.redirectUri,codeVerifier:o.codeVerifier,state:c,...k?{meta:k}:{}})}),e=await d.json();if(!d.ok)throw Error(e.error);n("success"),f?.()}catch(a){t(a.message),n("error")}},[o,b,f]),J=(0,e.useCallback)(async a=>{if(o?.state)try{let b=await fetch("/api/oauth/xai/manual-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:a,state:o.state})}),c=await b.json();if(!b.ok)throw Error(c.error);n("success"),f?.()}catch(a){t(a.message),n("error")}},[o,f]),K=(0,e.useCallback)(async(a,c,d,e,g)=>{B.current=!1,z(!0);let h=Date.now()+(Number.isFinite(g)&&g>0?g:12e4);for(;Date.now()<h;){if(B.current){console.log("[OAuthModal] Polling aborted"),z(!1);return}if(await new Promise(a=>setTimeout(a,1e3*d)),B.current){console.log("[OAuthModal] Polling aborted after sleep"),z(!1);return}try{let g=await fetch(`/api/oauth/${b}/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:a,codeVerifier:c,extraData:e})}),h=await g.json();if(h.success){B.current=!0,n("success"),z(!1),f?.();return}if("expired_token"===h.error||"access_denied"===h.error)throw Error(h.errorDescription||h.error);"slow_down"===h.error&&(d=Math.min(d+5,30))}catch(a){t(a.message),n("error"),z(!1);return}}t("Authorization timeout"),n("error"),z(!1)},[b,f]),L=(0,e.useCallback)(async()=>{if(b)try{let a;if(t(null),["github","qwen","kiro","kimi-coding","kilocode","codebuddy","qoder"].includes(b)){v(!0),n("waiting");let a=new URL(`/api/oauth/${b}/device-code`,window.location.origin);"kiro"===b&&l?.startUrl&&(a.searchParams.set("start_url",l.startUrl),l.region&&a.searchParams.set("region",l.region),a.searchParams.set("auth_method","idc"));let c=await fetch(a.toString()),d=await c.json();if(!c.ok)throw Error(d.error);x(d);let e=d.verification_uri_complete||d.verification_uri;e&&window.open(e,"_blank","noopener,noreferrer");let f="kiro"===b?{_clientId:d._clientId,_clientSecret:d._clientSecret,_region:d._region,_authMethod:d._authMethod,_startUrl:d._startUrl}:"qoder"===b?{_qoderNonce:d._qoderNonce,_qoderMachineId:d._qoderMachineId,_qoderVerifier:d.codeVerifier}:null;K(d.device_code,d.codeVerifier,d.interval||5,f,Number.isFinite(d.expires_in)&&d.expires_in>0?1e3*d.expires_in:void 0);return}let c=window.location.port||("https:"===window.location.protocol?"443":"80");a="codex"===b?"http://localhost:1455/auth/callback":"xai"===b?"http://127.0.0.1:56121/callback":`http://localhost:${c}/callback`;let d=new URL(`/api/oauth/${b}/authorize`,window.location.origin);d.searchParams.set("redirect_uri",a),k&&Object.entries(k).forEach(([a,b])=>{b&&d.searchParams.set(a,b)});let e=await fetch(d.toString()),f=await e.json();if(!e.ok)throw Error(f.error);let g=!1,h=!1;if("codex"===b)try{let b=new URL("/api/oauth/codex/start-proxy",window.location.origin);b.searchParams.set("app_port",c),b.searchParams.set("state",f.state),b.searchParams.set("code_verifier",f.codeVerifier),b.searchParams.set("redirect_uri",a);let d=await fetch(b.toString()),e=await d.json();g=e.success,h=!!e.serverSide}catch{g=!1}let i=!1,j=!1;if("xai"===b)try{let b=new URL("/api/oauth/xai/start-proxy",window.location.origin);b.searchParams.set("app_port",c),b.searchParams.set("state",f.state),b.searchParams.set("code_verifier",f.codeVerifier),b.searchParams.set("redirect_uri",a);let d=await fetch(b.toString()),e=await d.json();if(i=e.success,j=!!e.serverSide,!i&&"port_busy"===e.reason)throw Error("Port 56121 in use; close the conflicting process and retry")}catch(a){if(a?.message)throw a;i=!1}p({...f,redirectUri:a,codexServerSide:h,xaiServerSide:j}),"codex"===b&&g||"xai"===b&&i||E&&"codex"!==b&&"xai"!==b?(n("waiting"),A.current=window.open(f.authUrl,"oauth_popup","width=600,height=700"),A.current||n("input")):(n("input"),window.open(f.authUrl,"_blank"))}catch(a){t(a.message),n("error")}},[b,E,K,k,l]),M=async()=>{try{t(null);let a=q.trim();if(a.startsWith("eyJ")&&a.includes("."))return void await I(a,null);if("xai"===b&&a&&!a.includes("://")&&!a.includes("?")&&!a.includes("code="))return void await J(a);let c=new URL(a),d=c.searchParams.get("code"),e=c.searchParams.get("state"),f=c.searchParams.get("error");if(f)throw Error(c.searchParams.get("error_description")||f);if(!d)throw Error("xai"===b?"Paste the callback URL or copied xAI code":"No authorization code found in URL");await I(d,e)}catch(a){t(a.message),n("error")}},N=(0,e.useCallback)(()=>{"codex"===b?fetch("/api/oauth/codex/stop-proxy").catch(()=>{}):"xai"===b&&fetch("/api/oauth/xai/stop-proxy").catch(()=>{}),g()},[g,b]);if(!b||!c)return null;let O="xai"===b,P=w?.verification_uri_complete||w?.verification_uri||"",Q=O?"Connect Grok Build OAuth":`Connect ${c.name}`;return(0,d.jsx)(h.aF,{isOpen:a,title:Q,onClose:N,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[("waiting"===m||"input"===m)&&!u&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border border-border rounded-lg bg-sidebar/50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base text-primary animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{className:"text-sm",children:O?"Waiting for Grok Build OAuth…":"Waiting for popup authorization…"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3 my-1",children:[(0,d.jsx)("div",{className:"flex-1 h-px bg-border"}),(0,d.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wider",children:"Or paste callback URL manually"}),(0,d.jsx)("div",{className:"flex-1 h-px bg-border"})]}),(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 1: Open this ",O?"Grok Build OAuth URL":"URL"," in your browser"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.pd,{value:o?.authUrl||"",readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,d.jsx)(h.$n,{variant:"secondary",icon:"auth_url"===C?"check":"content_copy",onClick:()=>D(o?.authUrl,"auth_url"),disabled:!o?.authUrl,children:"Copy"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 2: Paste the ","xai"===b?"callback URL or copied code":"callback URL"," here"]}),(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"xai"===b?"If xAI shows a code instead of redirecting, paste that code here.":"After authorization, copy the full URL from your browser."}),(0,d.jsx)(h.pd,{value:q,onChange:a=>r(a.target.value),placeholder:O?"http://127.0.0.1:56121/callback?code=... or copied code":G,className:"font-mono text-xs"})]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:M,fullWidth:!0,disabled:!q,children:"Connect"}),(0,d.jsx)(h.$n,{onClick:N,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"waiting"===m&&u&&w&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"text-center py-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Visit the login URL below and authorize:"}),(0,d.jsxs)("div",{className:"bg-sidebar p-4 rounded-lg mb-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Login URL"}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("code",{className:"flex-1 text-sm break-all",children:P}),(0,d.jsx)(h.$n,{size:"sm",variant:"ghost",icon:"login_url"===C?"check":"content_copy",onClick:()=>D(P,"login_url"),disabled:!P}),(0,d.jsx)(h.$n,{size:"sm",variant:"ghost",icon:"open_in_new",onClick:()=>window.open(P,"_blank","noopener,noreferrer"),disabled:!P,children:"Open"})]})]}),(0,d.jsxs)("div",{className:"bg-primary/10 p-4 rounded-lg",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Your Code"}),(0,d.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,d.jsx)("p",{className:"text-2xl font-mono font-bold text-primary",children:w.user_code}),(0,d.jsx)(h.$n,{size:"sm",variant:"ghost",icon:"user_code"===C?"check":"content_copy",onClick:()=>D(w.user_code,"user_code")})]})]})]}),y&&(0,d.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),"Waiting for authorization..."]})]}),"success"===m&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,d.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your ",c.name," account has been connected."]}),(0,d.jsx)(h.$n,{onClick:N,fullWidth:!0,children:"Done"})]}),"error"===m&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,d.jsx)("p",{className:"text-sm text-red-600 mb-4",children:s}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:L,variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,d.jsx)(h.$n,{onClick:N,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}j.propTypes={isOpen:g().bool.isRequired,provider:g().string,providerInfo:g().shape({name:g().string}),onSuccess:g().func,onClose:g().func.isRequired,oauthMeta:g().object,idcConfig:g().shape({startUrl:g().string,region:g().string})}},9904:(a,b,c)=>{c.d(b,{default:()=>n});var d=c(26835),e=c(53830),f=c(41183),g=c.n(f),h=c(33809),i=c(66298),j=c(65839),k=c(30207);let l=[...Object.keys(k.zN),...Object.keys(k.IS),...Object.keys(k.nJ),...Object.keys(k.fg)],m=Object.keys(k.IS).filter(a=>k.IS[a].noAuth);function n({isOpen:a,onClose:b,onSelect:c,onDeselect:f,selectedModel:g,activeProviders:o=[],title:p="Select Model",modelAliases:q={},kindFilter:r=null,addedModelValues:s=[],closeOnSelect:t=!0}){let u=(0,e.useMemo)(()=>r?o.filter(a=>{let b=k.Q2[a.provider];return(b?.serviceKinds||["llm"]).includes(r)}):o,[o,r]),[v,w]=(0,e.useState)(""),[x,y]=(0,e.useState)([]),[z,A]=(0,e.useState)([]),[B,C]=(0,e.useState)([]),[D,E]=(0,e.useState)({}),F=(0,e.useMemo)(()=>({...k.zN,...k.IS,...k.nJ,...k.fg}),[]),G=(0,e.useMemo)(()=>{let a={},b=new Set(["webSearch","webFetch"]),c=new Set(["image","tts","stt","embedding","imageToText"]),d=new Set(["tts","image","webFetch"]);return[...new Set([...u.map(a=>a.provider),...r?m.filter(a=>(k.Q2[a]?.serviceKinds||["llm"]).includes(r)):m])].sort((a,b)=>{let c=l.indexOf(a),d=l.indexOf(b);return(-1===c?999:c)-(-1===d?999:d)}).forEach(e=>{let f=(0,k.wG)(e),g=F[e]||{name:e,color:"#666"},h=(0,k.mq)(e)||(0,k.gb)(e);if(r&&b.has(r)){a[e]={name:g.name,alias:f,color:g.color,models:[{id:e,name:g.name,value:e}]};return}if(g.passthroughModels){let b=Object.entries(q).filter(([,a])=>a.startsWith(`${f}/`)).map(([a,b])=>({id:b.replace(`${f}/`,""),name:a,value:b}));if(r&&c.has(r)&&0===(b=(0,j.KC)(e).filter(a=>a.type===r).map(a=>({id:a.id,name:a.name,value:`${f}/${a.id}`,type:a.type}))).length&&d.has(r)&&(g.serviceKinds||["llm"]).includes(r)&&(b=[{id:e,name:g.name,value:f}]),b.length>0){let c=z.find(a=>a.id===e),d=c?.name||g.name;a[e]={name:d,alias:f,color:g.color,models:b}}}else if(h){if(r&&c.has(r))return;let b=o.find(a=>a.provider===e),d=z.find(a=>a.id===e),f=b?.name||d?.name||g.name,h=b?.providerSpecificData?.prefix||d?.prefix||e,i=Object.entries(q).filter(([,a])=>a.startsWith(`${e}/`)).map(([a,b])=>({id:b.replace(`${e}/`,""),name:a,value:`${h}/${b.replace(`${e}/`,"")}`})),j=i.length>0?i:[{id:`__placeholder__${e}`,name:`${h}/model-id`,value:`${h}/model-id`,isPlaceholder:!0}];a[e]={name:f,alias:h,color:g.color,models:j,isCustom:!0,hasModels:i.length>0}}else{var i;let b=(0,j.KC)(e),h=new Set(b.map(a=>a.id)),k=b.length>0,l=Object.entries(q).filter(([a,b])=>b.startsWith(`${f}/`)&&(!k||a===b.replace(`${f}/`,""))&&!h.has(b.replace(`${f}/`,""))).map(([a,b])=>({id:b.replace(`${f}/`,""),name:a,value:b,isCustom:!0})),m=new Set(l.map(a=>a.id)),n=B.filter(a=>a.providerAlias===f&&!h.has(a.id)&&!m.has(a.id)).map(a=>({id:a.id,name:a.name||a.id,value:`${f}/${a.id}`,isCustom:!0})),o=[...b.map(a=>({id:a.id,name:a.name,value:`${f}/${a.id}`,type:a.type})),...l,...n],p=new Set,s=(i=o.filter(a=>!p.has(a.value)&&(p.add(a.value),!0)),r?c.has(r)?i.filter(a=>a.isPlaceholder||a.type===r):i:i.filter(a=>a.isPlaceholder||!a.type||"llm"===a.type));0===s.length&&r&&d.has(r)&&(g.serviceKinds||["llm"]).includes(r)&&(s=[{id:e,name:g.name,value:f}]),s.length>0&&(a[e]={name:g.name,alias:f,color:g.color,models:s})}}),Object.entries(a).forEach(([b,c])=>{let d=new Set([...D[(0,k.wG)(b)]||[],...D[b]||[]]);0!==d.size&&(c.models=c.models.filter(a=>!d.has(a.id)),0===c.models.length&&delete a[b])}),a},[u,q,F,z,B,D,r,o]),H=(0,e.useMemo)(()=>{if(r)return[];if(!v.trim())return x;let a=v.toLowerCase();return x.filter(b=>b.name.toLowerCase().includes(a))},[x,v,r]),I=(0,e.useMemo)(()=>{let a=v.trim().toLowerCase(),b={};return Object.entries(G).forEach(([c,d])=>{var e;let f=d.models;if(a){let b=d.name.toLowerCase().includes(a);if(0===(f=f.filter(b=>b.name.toLowerCase().includes(a)||b.id.toLowerCase().includes(a))).length&&!b)return}b[c]={...d,models:[...(e=f).filter(a=>s.includes(a.value)).sort((a,b)=>a.name.localeCompare(b.name)),...e.filter(a=>!s.includes(a.value)).sort((a,b)=>a.name.localeCompare(b.name))]}}),b},[G,v,s]),J=a=>{let d=a?.value||a?.name||a;s.includes(d)&&f?f(a):c(a),t&&(b(),w(""))};return(0,d.jsxs)(h.default,{isOpen:a,onClose:()=>{b(),w("")},title:p,size:"md",className:"p-4!",footer:null,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3 px-2.5 py-2 bg-primary/8 border border-primary/20 rounded-lg text-xs text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary shrink-0",style:{fontSize:"14px"},children:"info"}),(0,d.jsx)("span",{children:"Click to add, click again to remove. Changes are saved automatically."})]}),(0,d.jsx)("div",{className:"mb-3",children:(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,d.jsx)("input",{type:"text",placeholder:"Search...",value:v,onChange:a=>w(a.target.value),className:"w-full pl-8 pr-3 py-1.5 bg-surface border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"})]})}),(0,d.jsxs)("div",{className:"max-h-[400px] overflow-y-auto space-y-3",children:[H.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[14px]",children:"layers"}),(0,d.jsx)("span",{className:"text-xs font-medium text-primary",children:"Combos"}),(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",H.length,")"]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:H.map(a=>{let b=g===a.name;return(0,d.jsxs)("button",{onClick:()=>J({id:a.name,name:a.name,value:a.name}),className:`
2
2
  px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer flex items-center gap-1
3
3
  ${b?"bg-primary text-white border-primary":s.includes(a.name)?"bg-primary border-primary text-white hover:bg-primary-hover":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
4
4
  `,children:[s.includes(a.name)&&(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),a.name]},a.id)})})]}),Object.entries(I).map(([a,b])=>(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,d.jsx)(i.A,{src:`/providers/${a}.png`,alt:b.name,size:14,fallbackText:(b.name||a).slice(0,2).toUpperCase(),fallbackColor:b.color}),(0,d.jsx)("span",{className:"text-xs font-medium text-primary",children:b.name}),(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",b.models.length,")"]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:b.models.map(a=>{let b=g===a.value,c=a.isPlaceholder;return(0,d.jsx)("button",{onClick:()=>J(a),title:c?"Select to pre-fill, then edit model ID in the input":void 0,className:`
@@ -1 +1 @@
1
- "use strict";exports.id=504,exports.ids=[504,7973],exports.modules={7468:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},23016:(a,b,c)=>{c.d(b,{C8:()=>l,DR:()=>k,Uc:()=>h,cI:()=>j,eo:()=>i,gx:()=>d,pH:()=>g,v1:()=>e,xM:()=>f}),c(73714);let d={BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,NOT_ACCEPTABLE:406,REQUEST_TIMEOUT:408,RATE_LIMITED:429,SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504},e={sessionTtlMs:72e5,sessionCleanupIntervalMs:18e5,dnsCacheTtlMs:3e5,proxyDispatchersMaxSize:20},f=35e3,g=2e4,h=64e3,i=32e3,j={429:{attempts:0,delayMs:0},502:{attempts:3,delayMs:3e3},503:{attempts:3,delayMs:2e3},504:{attempts:2,delayMs:3e3}};function k(a){return null==a?{attempts:0,delayMs:2e3}:"number"==typeof a?{attempts:a,delayMs:2e3}:{attempts:a.attempts||0,delayMs:null!=a.delayMs?a.delayMs:2e3}}let l=["Please write a 5-10 word title for the following conversation:"]},37873:(a,b,c)=>{c.d(b,{A:()=>i});var d=c(77598);let e={randomUUID:d.randomUUID},f=new Uint8Array(256),g=f.length;var h=c(7468);let i=function(a,b,c){if(e.randomUUID&&!b&&!a)return e.randomUUID();var i=a,j=c;let k=(i=i||{}).random??i.rng?.()??(g>f.length-16&&((0,d.randomFillSync)(f),g=0),f.slice(g,g+=16));if(k.length<16)throw Error("Random bytes length must be >= 16");if(k[6]=15&k[6]|64,k[8]=63&k[8]|128,b){if((j=j||0)<0||j+16>b.length)throw RangeError(`UUID byte range ${j}:${j+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[j+a]=k[a];return b}return(0,h.k)(k)}},37973:(a,b,c)=>{c.d(b,{proxyAwareFetch:()=>q});var d=c(27910),e=c(23016);let f=globalThis.fetch,g=new Map,h=new Map,i=["cloudcode-pa.googleapis.com","daily-cloudcode-pa.googleapis.com","api.individual.githubcopilot.com","q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com","api2.cursor.sh"],j=["8.8.8.8","8.8.4.4"];function k(a){return null==a?"":String(a).trim()}async function l(a){let b=h.get(a);if(b&&Date.now()<b.expiry)return b.ip;try{let b=await Promise.resolve().then(c.t.bind(c,14985,23)),{promisify:d}=await Promise.resolve().then(c.t.bind(c,28354,23)),f=new b.Resolver;f.setServers(j);let g=d(f.resolve4.bind(f)),i=await g(a);return h.set(a,{ip:i[0],expiry:Date.now()+e.v1.dnsCacheTtlMs}),i[0]}catch(b){return console.warn(`[ProxyFetch] DNS resolve failed for ${a}:`,b.message),null}}function m(a,b){let c,d=k(b);if(!d)return!1;try{c=new URL(a).hostname.toLowerCase()}catch{return!1}return d.split(",").map(a=>a.trim().toLowerCase()).filter(Boolean).some(a=>"*"===a||(a.startsWith(".")?c.endsWith(a)||c===a.slice(1):c===a||c.endsWith(`.${a}`)))}function n(a){let b=k(a);if(!b)return null;try{return new URL(b),b}catch{return`http://${b}`}}async function o(a){let b=n(a);if(!b)return null;if(!g.has(b)){g.size>=e.v1.proxyDispatchersMaxSize&&g.delete(g.keys().next().value);let{ProxyAgent:a}=await c.e(6288).then(c.t.bind(c,16288,19));g.set(b,new a({uri:b}))}return g.get(b)}async function p(a,b,e){let f=await Promise.resolve().then(c.t.bind(c,55591,23)),g=await Promise.resolve().then(c.t.bind(c,91645,23)),h=f.default??f,i=g.default??g;return new Promise((c,f)=>{let g=new i.Socket;g.connect(443,b,()=>{let b={socket:g,servername:a.hostname,path:a.pathname+a.search,method:e.method||"POST",headers:{...e.headers,Host:a.hostname}},i=h.request(b,a=>{let b={ok:a.statusCode>=200&&a.statusCode<300,status:a.statusCode,statusText:a.statusMessage,headers:new Map(Object.entries(a.headers)),body:d.Readable.toWeb(a),text:async()=>{let b=[];for await(let c of a)b.push(c);return Buffer.concat(b).toString()},json:async()=>JSON.parse(await b.text())};c(b)});i.on("error",f),e.body&&i.write("string"==typeof e.body?e.body:JSON.stringify(e.body)),i.end()}),g.on("error",f)})}async function q(a,b={},c=null){let d="string"==typeof a?a:a.toString(),e=k(c?.vercelRelayUrl);if(e){let a=new URL(d),c={...b.headers,"x-relay-target":`${a.protocol}//${a.host}`,"x-relay-path":`${a.pathname}${a.search}`};return f(e,{...b,headers:c})}let g=function(a,b){if(b?.enabled!==!0&&b?.connectionProxyEnabled!==!0)return null;let c=k(b?.url??b?.connectionProxyUrl);if(!c)return null;let d=k(b?.noProxy??b?.connectionNoProxy);return d&&m(a,d)?null:n(c)}(d,c),h=g?null:n(function(a){let b;if(m(a,process.env.NO_PROXY||process.env.no_proxy))return null;try{b=new URL(a).protocol}catch{return null}return"https:"===b?process.env.HTTPS_PROXY||process.env.https_proxy||process.env.ALL_PROXY||process.env.all_proxy:process.env.HTTP_PROXY||process.env.http_proxy||process.env.ALL_PROXY||process.env.all_proxy}(d)),j=g||h;if(function(a){try{let b=new URL(a).hostname;return i.some(a=>b.includes(a))}catch{return!1}}(d)){if(j)try{let c=await o(j);return await f(a,{...b,dispatcher:c})}catch(a){if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${a.message}`);console.warn(`[ProxyFetch] Proxy failed, falling back to direct bypass: ${a.message}`)}try{let a=new URL(d),c=await l(a.hostname);if(c)return await p(a,c,b)}catch(a){console.warn(`[ProxyFetch] MITM bypass failed: ${a.message}`)}}if(j)try{let c=await o(j);return await f(a,{...b,dispatcher:c})}catch(a){if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${a.message}`);console.warn(`[ProxyFetch] Proxy failed, falling back to direct: ${a.message}`)}return f(a,b)}async function r(a,b={}){return q(a,b,null)}globalThis.fetch!==r&&(globalThis.fetch=r)},43528:(a,b,c)=>{c.d(b,{$V:()=>t,A9:()=>i,Cn:()=>j,Co:()=>s,Ic:()=>q,J5:()=>n,K:()=>o,NA:()=>v,Ox:()=>k,QH:()=>l,VK:()=>w,Wu:()=>u,go:()=>e,nZ:()=>p,sX:()=>f,uR:()=>m,x0:()=>g,zv:()=>r});var d=c(21820);let e="google-genai-sdk/1.41.0 gl-node/v22.19.0";function f(a="unknown"){let b;return`GeminiCLI/0.34.0/${a||"unknown"} (${(0,d.platform)()}; ${"ia32"===(b=(0,d.arch)())?"x86":b}; terminal)`}let g={VSCODE_VERSION:"1.110.0",COPILOT_CHAT_VERSION:"0.38.0",USER_AGENT:"GitHubCopilotChat/0.38.0",API_VERSION:"2025-04-01"};function h(){let a=(0,d.platform)(),b=(0,d.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}function i(){return`antigravity/1.104.0 ${(0,d.platform)()}/${(0,d.arch)()}`}let j={ideType:9,platform:h(),pluginType:2},k={name:"x-request-source",value:"local"},l="_ide",m="_ide",n=new Set(["browser_subagent","command_status","find_by_name","generate_image","grep_search","list_dir","list_resources","multi_replace_file_content","notify_user","read_resource","read_terminal","read_url_content","replace_file_content","run_command","search_web","send_command_input","task_boundary","view_content_chunk","view_file","write_to_file"]),o={"User-Agent":`antigravity/1.107.0 ${(0,d.platform)()}/${(0,d.arch)()}`},p={loadCodeAssist:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUser:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser"},q={"Content-Type":"application/json","User-Agent":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"google-cloud-sdk vscode_cloudshelleditor/0.1","Client-Metadata":JSON.stringify({ideType:9,platform:h(),pluginType:2})},r={ideType:9,platform:h(),pluginType:2},s="You are Claude Code, Anthropic's official CLI for Claude.",t="You are Antigravity, a powerful agentic AI coding assistant designed by the Google Deepmind team working on Advanced Agentic Coding.You are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.**Absolute paths only****Proactiveness**",u={codex:432e6,claude:144e5,iflow:864e5,qwen:12e5,"kimi-coding":3e5,antigravity:3e5},v={google:{token:"https://oauth2.googleapis.com/token",auth:"https://accounts.google.com/o/oauth2/auth"},openai:{token:"https://auth.openai.com/oauth/token",auth:"https://auth.openai.com/oauth/authorize"},anthropic:{token:"https://api.anthropic.com/v1/oauth/token",auth:"https://api.anthropic.com/v1/oauth/authorize"},qwen:{token:"https://qwen.ai/api/v1/oauth2/token",auth:"https://qwen.ai/api/v1/oauth2/device/code"},iflow:{token:"https://iflow.cn/oauth/token",auth:"https://iflow.cn/oauth"},github:{token:"https://github.com/login/oauth/access_token",auth:"https://github.com/login/oauth/authorize",deviceCode:"https://github.com/login/device/code"}};function w(){return{"X-Msh-Platform":"9router","X-Msh-Version":"2.1.2","X-Msh-Device-Model":"u">typeof process?`${process.platform} ${process.arch}`:"unknown","X-Msh-Device-Id":`kimi-${Date.now()}`}}},73714:(a,b,c)=>{c.d(b,{EQ:()=>f,LY:()=>d,O:()=>e,fh:()=>h,t2:()=>i,wf:()=>g});let d={400:{type:"invalid_request_error",code:"bad_request"},401:{type:"authentication_error",code:"invalid_api_key"},402:{type:"billing_error",code:"payment_required"},403:{type:"permission_error",code:"insufficient_quota"},404:{type:"invalid_request_error",code:"model_not_found"},406:{type:"invalid_request_error",code:"model_not_supported"},429:{type:"rate_limit_error",code:"rate_limit_exceeded"},500:{type:"server_error",code:"internal_server_error"},502:{type:"server_error",code:"bad_gateway"},503:{type:"server_error",code:"service_unavailable"},504:{type:"server_error",code:"gateway_timeout"}},e={400:"Bad request",401:"Invalid API key provided",402:"Payment required",403:"You exceeded your current quota",404:"Model not found",406:"Model not supported",429:"Rate limit exceeded",500:"Internal server error",502:"Bad gateway - upstream provider error",503:"Service temporarily unavailable",504:"Gateway timeout"},f={base:2e3,max:3e5,maxLevel:15},g=3e4,h=18e5,i=[{text:"no credentials",cooldownMs:12e4},{text:"request not allowed",cooldownMs:5e3},{text:"improperly formed request",cooldownMs:12e4},{text:"rate limit",backoff:!0},{text:"too many requests",backoff:!0},{text:"quota exceeded",backoff:!0},{text:"capacity",backoff:!0},{text:"overloaded",backoff:!0},{status:401,cooldownMs:12e4},{status:402,cooldownMs:12e4},{status:403,cooldownMs:12e4},{status:404,cooldownMs:12e4},{status:429,backoff:!0}]}};
1
+ "use strict";exports.id=504,exports.ids=[504,7973],exports.modules={7468:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},23016:(a,b,c)=>{c.d(b,{C8:()=>l,DR:()=>k,Uc:()=>h,cI:()=>j,eo:()=>i,gx:()=>d,pH:()=>g,v1:()=>e,xM:()=>f}),c(73714);let d={BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,NOT_ACCEPTABLE:406,REQUEST_TIMEOUT:408,RATE_LIMITED:429,SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504},e={sessionTtlMs:72e5,sessionCleanupIntervalMs:18e5,dnsCacheTtlMs:3e5,proxyDispatchersMaxSize:20},f=3e4,g=2e4,h=64e3,i=32e3,j={429:{attempts:0,delayMs:0},502:{attempts:3,delayMs:3e3},503:{attempts:3,delayMs:2e3},504:{attempts:2,delayMs:3e3}};function k(a){return null==a?{attempts:0,delayMs:2e3}:"number"==typeof a?{attempts:a,delayMs:2e3}:{attempts:a.attempts||0,delayMs:null!=a.delayMs?a.delayMs:2e3}}let l=["Please write a 5-10 word title for the following conversation:"]},37873:(a,b,c)=>{c.d(b,{A:()=>i});var d=c(77598);let e={randomUUID:d.randomUUID},f=new Uint8Array(256),g=f.length;var h=c(7468);let i=function(a,b,c){if(e.randomUUID&&!b&&!a)return e.randomUUID();var i=a,j=c;let k=(i=i||{}).random??i.rng?.()??(g>f.length-16&&((0,d.randomFillSync)(f),g=0),f.slice(g,g+=16));if(k.length<16)throw Error("Random bytes length must be >= 16");if(k[6]=15&k[6]|64,k[8]=63&k[8]|128,b){if((j=j||0)<0||j+16>b.length)throw RangeError(`UUID byte range ${j}:${j+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[j+a]=k[a];return b}return(0,h.k)(k)}},37973:(a,b,c)=>{c.d(b,{proxyAwareFetch:()=>q});var d=c(27910),e=c(23016);let f=globalThis.fetch,g=new Map,h=new Map,i=["cloudcode-pa.googleapis.com","daily-cloudcode-pa.googleapis.com","api.individual.githubcopilot.com","q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com","api2.cursor.sh"],j=["8.8.8.8","8.8.4.4"];function k(a){return null==a?"":String(a).trim()}async function l(a){let b=h.get(a);if(b&&Date.now()<b.expiry)return b.ip;try{let b=await Promise.resolve().then(c.t.bind(c,14985,23)),{promisify:d}=await Promise.resolve().then(c.t.bind(c,28354,23)),f=new b.Resolver;f.setServers(j);let g=d(f.resolve4.bind(f)),i=await g(a);return h.set(a,{ip:i[0],expiry:Date.now()+e.v1.dnsCacheTtlMs}),i[0]}catch(b){return console.warn(`[ProxyFetch] DNS resolve failed for ${a}:`,b.message),null}}function m(a,b){let c,d=k(b);if(!d)return!1;try{c=new URL(a).hostname.toLowerCase()}catch{return!1}return d.split(",").map(a=>a.trim().toLowerCase()).filter(Boolean).some(a=>"*"===a||(a.startsWith(".")?c.endsWith(a)||c===a.slice(1):c===a||c.endsWith(`.${a}`)))}function n(a){let b=k(a);if(!b)return null;try{return new URL(b),b}catch{return`http://${b}`}}async function o(a){let b=n(a);if(!b)return null;if(!g.has(b)){g.size>=e.v1.proxyDispatchersMaxSize&&g.delete(g.keys().next().value);let{ProxyAgent:a}=await c.e(6288).then(c.t.bind(c,16288,19));g.set(b,new a({uri:b}))}return g.get(b)}async function p(a,b,e){let f=await Promise.resolve().then(c.t.bind(c,55591,23)),g=await Promise.resolve().then(c.t.bind(c,91645,23)),h=f.default??f,i=g.default??g;return new Promise((c,f)=>{let g=new i.Socket;g.connect(443,b,()=>{let b={socket:g,servername:a.hostname,path:a.pathname+a.search,method:e.method||"POST",headers:{...e.headers,Host:a.hostname}},i=h.request(b,a=>{let b={ok:a.statusCode>=200&&a.statusCode<300,status:a.statusCode,statusText:a.statusMessage,headers:new Map(Object.entries(a.headers)),body:d.Readable.toWeb(a),text:async()=>{let b=[];for await(let c of a)b.push(c);return Buffer.concat(b).toString()},json:async()=>JSON.parse(await b.text())};c(b)});i.on("error",f),e.body&&i.write("string"==typeof e.body?e.body:JSON.stringify(e.body)),i.end()}),g.on("error",f)})}async function q(a,b={},c=null){let d="string"==typeof a?a:a.toString(),e=k(c?.vercelRelayUrl);if(e){let a=new URL(d),c={...b.headers,"x-relay-target":`${a.protocol}//${a.host}`,"x-relay-path":`${a.pathname}${a.search}`};return f(e,{...b,headers:c})}let g=function(a,b){if(b?.enabled!==!0&&b?.connectionProxyEnabled!==!0)return null;let c=k(b?.url??b?.connectionProxyUrl);if(!c)return null;let d=k(b?.noProxy??b?.connectionNoProxy);return d&&m(a,d)?null:n(c)}(d,c),h=g?null:n(function(a){let b;if(m(a,process.env.NO_PROXY||process.env.no_proxy))return null;try{b=new URL(a).protocol}catch{return null}return"https:"===b?process.env.HTTPS_PROXY||process.env.https_proxy||process.env.ALL_PROXY||process.env.all_proxy:process.env.HTTP_PROXY||process.env.http_proxy||process.env.ALL_PROXY||process.env.all_proxy}(d)),j=g||h;if(function(a){try{let b=new URL(a).hostname;return i.some(a=>b.includes(a))}catch{return!1}}(d)){if(j)try{let c=await o(j);return await f(a,{...b,dispatcher:c})}catch(a){if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${a.message}`);console.warn(`[ProxyFetch] Proxy failed, falling back to direct bypass: ${a.message}`)}try{let a=new URL(d),c=await l(a.hostname);if(c)return await p(a,c,b)}catch(a){console.warn(`[ProxyFetch] MITM bypass failed: ${a.message}`)}}if(j)try{let c=await o(j);return await f(a,{...b,dispatcher:c})}catch(a){if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${a.message}`);console.warn(`[ProxyFetch] Proxy failed, falling back to direct: ${a.message}`)}return f(a,b)}async function r(a,b={}){return q(a,b,null)}globalThis.fetch!==r&&(globalThis.fetch=r)},43528:(a,b,c)=>{c.d(b,{$V:()=>t,A9:()=>i,Cn:()=>j,Co:()=>s,Ic:()=>q,J5:()=>n,K:()=>o,NA:()=>v,Ox:()=>k,QH:()=>l,VK:()=>w,Wu:()=>u,go:()=>e,nZ:()=>p,sX:()=>f,uR:()=>m,x0:()=>g,zv:()=>r});var d=c(21820);let e="google-genai-sdk/1.41.0 gl-node/v22.19.0";function f(a="unknown"){let b;return`GeminiCLI/0.34.0/${a||"unknown"} (${(0,d.platform)()}; ${"ia32"===(b=(0,d.arch)())?"x86":b}; terminal)`}let g={VSCODE_VERSION:"1.110.0",COPILOT_CHAT_VERSION:"0.38.0",USER_AGENT:"GitHubCopilotChat/0.38.0",API_VERSION:"2025-04-01"};function h(){let a=(0,d.platform)(),b=(0,d.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}function i(){return`antigravity/1.104.0 ${(0,d.platform)()}/${(0,d.arch)()}`}let j={ideType:9,platform:h(),pluginType:2},k={name:"x-request-source",value:"local"},l="_ide",m="_ide",n=new Set(["browser_subagent","command_status","find_by_name","generate_image","grep_search","list_dir","list_resources","multi_replace_file_content","notify_user","read_resource","read_terminal","read_url_content","replace_file_content","run_command","search_web","send_command_input","task_boundary","view_content_chunk","view_file","write_to_file"]),o={"User-Agent":`antigravity/1.107.0 ${(0,d.platform)()}/${(0,d.arch)()}`},p={loadCodeAssist:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUser:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser"},q={"Content-Type":"application/json","User-Agent":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"google-cloud-sdk vscode_cloudshelleditor/0.1","Client-Metadata":JSON.stringify({ideType:9,platform:h(),pluginType:2})},r={ideType:9,platform:h(),pluginType:2},s="You are Claude Code, Anthropic's official CLI for Claude.",t="You are Antigravity, a powerful agentic AI coding assistant designed by the Google Deepmind team working on Advanced Agentic Coding.You are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.**Absolute paths only****Proactiveness**",u={codex:432e6,claude:144e5,iflow:864e5,qwen:12e5,"kimi-coding":3e5,antigravity:3e5},v={google:{token:"https://oauth2.googleapis.com/token",auth:"https://accounts.google.com/o/oauth2/auth"},openai:{token:"https://auth.openai.com/oauth/token",auth:"https://auth.openai.com/oauth/authorize"},anthropic:{token:"https://api.anthropic.com/v1/oauth/token",auth:"https://api.anthropic.com/v1/oauth/authorize"},qwen:{token:"https://qwen.ai/api/v1/oauth2/token",auth:"https://qwen.ai/api/v1/oauth2/device/code"},iflow:{token:"https://iflow.cn/oauth/token",auth:"https://iflow.cn/oauth"},github:{token:"https://github.com/login/oauth/access_token",auth:"https://github.com/login/oauth/authorize",deviceCode:"https://github.com/login/device/code"}};function w(){return{"X-Msh-Platform":"9router","X-Msh-Version":"2.1.2","X-Msh-Device-Model":"u">typeof process?`${process.platform} ${process.arch}`:"unknown","X-Msh-Device-Id":`kimi-${Date.now()}`}}},73714:(a,b,c)=>{c.d(b,{EQ:()=>f,LY:()=>d,O:()=>e,fh:()=>h,t2:()=>i,wf:()=>g});let d={400:{type:"invalid_request_error",code:"bad_request"},401:{type:"authentication_error",code:"invalid_api_key"},402:{type:"billing_error",code:"payment_required"},403:{type:"permission_error",code:"insufficient_quota"},404:{type:"invalid_request_error",code:"model_not_found"},406:{type:"invalid_request_error",code:"model_not_supported"},429:{type:"rate_limit_error",code:"rate_limit_exceeded"},500:{type:"server_error",code:"internal_server_error"},502:{type:"server_error",code:"bad_gateway"},503:{type:"server_error",code:"service_unavailable"},504:{type:"server_error",code:"gateway_timeout"}},e={400:"Bad request",401:"Invalid API key provided",402:"Payment required",403:"You exceeded your current quota",404:"Model not found",406:"Model not supported",429:"Rate limit exceeded",500:"Internal server error",502:"Bad gateway - upstream provider error",503:"Service temporarily unavailable",504:"Gateway timeout"},f={base:2e3,max:3e5,maxLevel:15},g=3e4,h=18e5,i=[{text:"no credentials",cooldownMs:12e4},{text:"request not allowed",cooldownMs:5e3},{text:"improperly formed request",cooldownMs:12e4},{text:"rate limit",backoff:!0},{text:"too many requests",backoff:!0},{text:"quota exceeded",backoff:!0},{text:"capacity",backoff:!0},{text:"overloaded",backoff:!0},{status:401,cooldownMs:12e4},{status:402,cooldownMs:12e4},{status:403,cooldownMs:12e4},{status:404,cooldownMs:12e4},{status:429,backoff:!0}]}};