prozygent 0.7.10 → 0.7.13

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 (540) 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 +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +3 -3
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  67. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  69. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  70. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  71. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  72. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  73. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  74. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  75. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  76. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  77. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  78. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  80. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  81. package/app/.next-cli-build/server/app/_not-found.rsc +5 -5
  82. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
  83. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  84. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +5 -5
  85. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  86. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  87. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  88. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  90. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  91. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +2 -2
  96. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  103. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  107. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/cli-tools/kimchi-settings/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +2 -2
  127. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +2 -2
  129. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  132. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  136. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  142. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  144. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  146. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  148. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  150. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  153. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  157. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  160. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  162. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  164. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  168. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  171. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  174. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  176. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  178. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  181. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  184. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  186. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/settings/migrate-9router/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  201. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  203. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  207. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  209. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  218. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  220. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  231. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  233. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  235. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  237. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  241. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  243. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  245. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  246. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  248. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  250. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  252. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  254. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  256. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  257. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  258. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  260. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  262. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  263. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  264. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  265. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  266. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/version/hot-update/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  271. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  273. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  275. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  277. package/app/.next-cli-build/server/app/callback.html +1 -1
  278. package/app/.next-cli-build/server/app/callback.rsc +6 -6
  279. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +6 -6
  280. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  281. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +5 -5
  282. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  283. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +2 -2
  284. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  285. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  286. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +7 -7
  287. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  288. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  289. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  290. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  291. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +7 -7
  292. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  293. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +5 -5
  294. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  295. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  296. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +7 -7
  297. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  298. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  299. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  300. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  301. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
  302. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  303. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +5 -5
  304. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  305. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  306. package/app/.next-cli-build/server/app/dashboard/combos.rsc +7 -7
  307. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  308. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  309. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  310. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  311. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
  312. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  313. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +5 -5
  314. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  315. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  316. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +7 -7
  317. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  318. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  319. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  320. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  321. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
  322. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  323. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +5 -5
  324. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  325. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  326. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +7 -7
  327. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  328. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  329. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  330. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  331. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  332. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +7 -7
  333. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  334. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +5 -5
  335. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  336. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  337. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +7 -7
  338. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  339. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  340. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  341. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  342. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +7 -7
  343. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  344. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +5 -5
  345. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  346. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  347. package/app/.next-cli-build/server/app/dashboard/profile.rsc +7 -7
  348. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  349. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  350. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  351. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  352. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
  353. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  354. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +5 -5
  355. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  356. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  357. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +7 -7
  358. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  359. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  360. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  361. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  362. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  363. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
  364. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  365. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +5 -5
  366. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  367. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  368. package/app/.next-cli-build/server/app/dashboard/providers.rsc +7 -7
  369. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  370. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  371. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  372. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  373. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
  374. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  375. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +5 -5
  376. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  377. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  378. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +7 -7
  379. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  380. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  381. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  382. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  383. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -7
  384. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  385. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +5 -5
  386. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  387. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  388. package/app/.next-cli-build/server/app/dashboard/quota.rsc +8 -8
  389. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  390. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  391. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  392. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  393. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +8 -8
  394. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  395. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +5 -5
  396. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  397. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  398. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  399. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  400. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  401. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +5 -5
  402. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
  403. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  404. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +5 -5
  405. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  406. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  407. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  408. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  409. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  410. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  411. package/app/.next-cli-build/server/app/dashboard/skills.rsc +7 -7
  412. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  413. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  414. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  415. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  416. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +7 -7
  417. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  418. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +5 -5
  419. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  420. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  421. package/app/.next-cli-build/server/app/dashboard/translator.rsc +7 -7
  422. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  423. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  424. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  425. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  426. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +7 -7
  427. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  428. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +5 -5
  429. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  430. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  431. package/app/.next-cli-build/server/app/dashboard/usage.rsc +7 -7
  432. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  433. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  434. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  435. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  436. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
  437. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  438. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +5 -5
  439. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  440. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  441. package/app/.next-cli-build/server/app/dashboard.rsc +7 -7
  442. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  443. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  444. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  445. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +7 -7
  446. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  447. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +5 -5
  448. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  449. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  450. package/app/.next-cli-build/server/app/index.html +1 -1
  451. package/app/.next-cli-build/server/app/index.rsc +5 -5
  452. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  453. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +5 -5
  454. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  455. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +5 -5
  456. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  457. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  458. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  459. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  460. package/app/.next-cli-build/server/app/landing.html +1 -1
  461. package/app/.next-cli-build/server/app/landing.rsc +5 -5
  462. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
  463. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  464. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +5 -5
  465. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  466. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  467. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  468. package/app/.next-cli-build/server/app/login/page.js +1 -1
  469. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  470. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  471. package/app/.next-cli-build/server/app/login.html +1 -1
  472. package/app/.next-cli-build/server/app/login.rsc +6 -6
  473. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +6 -6
  474. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  475. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +5 -5
  476. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  477. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  478. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  479. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  480. package/app/.next-cli-build/server/app/page.js +1 -1
  481. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  482. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  483. package/app/.next-cli-build/server/app-paths-manifest.json +10 -10
  484. package/app/.next-cli-build/server/chunks/1241.js +1 -1
  485. package/app/.next-cli-build/server/chunks/1275.js +4 -4
  486. package/app/.next-cli-build/server/chunks/2231.js +1 -1
  487. package/app/.next-cli-build/server/chunks/318.js +2 -2
  488. package/app/.next-cli-build/server/chunks/3535.js +1 -1
  489. package/app/.next-cli-build/server/chunks/4055.js +1 -1
  490. package/app/.next-cli-build/server/chunks/412.js +2 -2
  491. package/app/.next-cli-build/server/chunks/4130.js +2 -2
  492. package/app/.next-cli-build/server/chunks/4161.js +1 -1
  493. package/app/.next-cli-build/server/chunks/4425.js +1 -0
  494. package/app/.next-cli-build/server/chunks/4741.js +2 -2
  495. package/app/.next-cli-build/server/chunks/4746.js +1 -1
  496. package/app/.next-cli-build/server/chunks/4827.js +1 -1
  497. package/app/.next-cli-build/server/chunks/4914.js +7 -1
  498. package/app/.next-cli-build/server/chunks/5217.js +1 -1
  499. package/app/.next-cli-build/server/chunks/5615.js +1 -1
  500. package/app/.next-cli-build/server/chunks/5699.js +1 -1
  501. package/app/.next-cli-build/server/chunks/5961.js +1 -1
  502. package/app/.next-cli-build/server/chunks/6070.js +1 -1
  503. package/app/.next-cli-build/server/chunks/615.js +1 -1
  504. package/app/.next-cli-build/server/chunks/6182.js +4 -4
  505. package/app/.next-cli-build/server/chunks/6306.js +1 -1
  506. package/app/.next-cli-build/server/chunks/6445.js +1 -1
  507. package/app/.next-cli-build/server/chunks/8238.js +1 -1
  508. package/app/.next-cli-build/server/chunks/8255.js +1 -1
  509. package/app/.next-cli-build/server/chunks/8271.js +1 -1
  510. package/app/.next-cli-build/server/chunks/8895.js +6 -6
  511. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  512. package/app/.next-cli-build/server/middleware.js +2 -2
  513. package/app/.next-cli-build/server/pages/404.html +1 -1
  514. package/app/.next-cli-build/server/pages/500.html +1 -1
  515. package/app/.next-cli-build/static/chunks/1321-3d0168ec6fc64a44.js +1 -0
  516. package/app/.next-cli-build/static/chunks/5497-2d117cecb2567489.js +7 -0
  517. package/app/.next-cli-build/static/chunks/{5678-823056f7cce78f49.js → 5678-ad114b1d9bb083ef.js} +2 -2
  518. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-99d9c1b5011d6b5d.js +10 -0
  519. package/app/.next-cli-build/static/chunks/app/callback/page-24c36c4e4c10328b.js +1 -0
  520. package/app/.next-cli-build/static/css/0d4218ac4b7158b8.css +1 -0
  521. package/app/cli/.build-home/{.prozygent/db/backups/upgrade-0.7.6-to-0.7.7-0.7.7-20260705-203906 → .9router/db}/data.sqlite +0 -0
  522. package/app/cli/.build-home/.9router/jwt-secret +1 -0
  523. package/app/cli/.build-home/.9router/machine-id +1 -0
  524. package/app/cli/.build-home/.prozygent/db/backups/{upgrade-0.7.8-to-0.7.9-0.7.9-20260705-214220 → upgrade-0.7.11-to-0.7.12-0.7.12-20260711-203728}/data.sqlite +0 -0
  525. package/app/cli/.build-home/.prozygent/db/backups/{upgrade-0.7.7-to-0.7.8-0.7.8-20260705-212632 → upgrade-0.7.12-to-0.7.11-0.7.11-20260711-203346}/data.sqlite +0 -0
  526. package/app/cli/.build-home/.prozygent/db/backups/{upgrade-0.7.9-to-0.7.10-0.7.10-20260706-152353 → upgrade-0.7.12-to-0.7.13-0.7.13-20260711-215054}/data.sqlite +0 -0
  527. package/app/cli/.build-home/.prozygent/db/data.sqlite +0 -0
  528. package/app/package.json +1 -1
  529. package/app/src/mitm/server.js +28 -30
  530. package/cli.js +2 -2
  531. package/package.json +1 -1
  532. package/app/.next-cli-build/server/chunks/9473.js +0 -1
  533. package/app/.next-cli-build/static/chunks/1321-bc55d7dfd768814c.js +0 -1
  534. package/app/.next-cli-build/static/chunks/5497-e3d78fb4b3edd6bb.js +0 -7
  535. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-d866638fd9eb3ae9.js +0 -10
  536. package/app/.next-cli-build/static/chunks/app/callback/page-db8c83a6a377e51e.js +0 -1
  537. package/app/.next-cli-build/static/css/969d66d5b67dc433.css +0 -1
  538. package/app/public/providers/conduit.svg +0 -6
  539. /package/app/.next-cli-build/static/{bBLkj4lqlxtaevZNzHOMS → oWRnXLeJgZkFX-ZaiUn9h}/_buildManifest.js +0 -0
  540. /package/app/.next-cli-build/static/{bBLkj4lqlxtaevZNzHOMS → oWRnXLeJgZkFX-ZaiUn9h}/_ssgManifest.js +0 -0
@@ -14,7 +14,7 @@ model = "${x}"
14
14
  provider: "custom"
15
15
  base_url: "${V()}"
16
16
  `},{filename:"~/.hermes/.env",content:`OPENAI_API_KEY=${u}
17
- `}])})]})}var y=c(50377);function z({toolId:a,tool:b,isExpanded:c,onToggle:h,baseUrl:i,apiKeys:j,activeProviders:k=[],cloudEnabled:l=!1,tunnelEnabled:m=!1}){let[o,p]=(0,e.useState)(null),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(""),[u,v]=(0,e.useState)(()=>j?.length>0?j[0].key:""),w=a=>{let b=u&&u.trim()?u:l?"your-api-key":"sk_9router",c=i||"http://localhost:20128",d=c.endsWith("/v1")?c:`${c}/v1`;return a.replace(/\{\{baseUrl\}\}/g,d).replace(/\{\{apiKey\}\}/g,b).replace(/\{\{model\}\}/g,s||"provider/model-id")},{copy:x}=(0,y.C)(),A=async(a,b)=>{await x(w(a),`toolcard-${b}`),p(b),setTimeout(()=>p(null),2e3)},B=k.length>0,C=()=>(!b.requiresExternalUrl||!!l||!!m)&&(!b.requiresCloud||!!l);return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden overflow-x-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:h,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:b.image?(0,d.jsx)(g.default,{src:b.image,alt:b.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}}):b.icon?(0,d.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:b.color},children:b.icon}):(0,d.jsx)(g.default,{src:`/providers/${a}.png`,alt:b.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:b.name}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:b.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${c?"rotate-180":""}`,children:"expand_more"})]}),c&&(0,d.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:b.guideSteps?(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[b.notes&&0!==b.notes.length?(0,d.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:b.notes.map((a,b)=>{if("cloudCheck"===a.type&&(l||m))return null;let c="warning"===a.type,e="cloudCheck"===a.type&&!l&&!m,f="bg-blue-500/10 border-blue-500/30",g="text-blue-600 dark:text-blue-400",h="text-blue-500",i="info";return c?(f="bg-yellow-500/10 border-yellow-500/30",g="text-yellow-600 dark:text-yellow-400",h="text-yellow-500",i="warning"):e&&(f="bg-red-500/10 border-red-500/30",g="text-red-600 dark:text-red-400",h="text-red-500",i="error"),(0,d.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${f}`,children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-lg ${h}`,children:i}),(0,d.jsx)("p",{className:`text-sm ${g}`,children:a.text})]},b)})}):null,C()&&b.guideSteps.map(a=>(0,d.jsxs)("div",{className:"flex items-start gap-4",children:[(0,d.jsx)("div",{className:"size-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold text-white",style:{backgroundColor:b.color},children:a.step}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"font-medium text-text",children:a.title}),a.desc&&(0,d.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:a.desc}),"apiKeySelector"===a.type&&(0,d.jsx)("div",{className:"mt-2 flex flex-col sm:flex-row sm:items-center gap-2",children:(0,d.jsx)(n,{value:u,onChange:v,apiKeys:j,cloudEnabled:l,className:"flex-1"})}),"modelSelector"===a.type&&(0,d.jsxs)("div",{className:"mt-2 flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,d.jsx)("input",{type:"text",value:s,onChange:a=>t(a.target.value),placeholder:"provider/model-id",className:"w-full sm:w-auto flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>r(!0),disabled:!B,className:`shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors ${B?"bg-bg-secondary border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),s&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{onClick:()=>A(s,"model"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"model"===o?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>t(""),className:"p-2 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]})]}),a.value&&(0,d.jsxs)("div",{className:"mt-2 flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,d.jsx)("code",{className:"w-full sm:w-auto flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm font-mono border border-border truncate",children:w(a.value)}),a.copyable&&(0,d.jsx)("button",{onClick:()=>A(a.value,`${a.step}-${a.title}`),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:o===`${a.step}-${a.title}`?"check":"content_copy"})})]})]})]},a.step)),C()&&b.codeBlock&&(0,d.jsxs)("div",{className:"mt-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wide",children:b.codeBlock.language}),(0,d.jsxs)("button",{onClick:()=>A(b.codeBlock.code,"codeblock"),className:"flex items-center gap-1 px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"codeblock"===o?"check":"content_copy"}),"codeblock"===o?"Copied!":"Copy"]})]}),(0,d.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto",children:(0,d.jsx)("code",{className:"text-sm font-mono whitespace-pre",children:w(b.codeBlock.code)})})]})]}):(0,d.jsx)("p",{className:"text-text-muted text-sm",children:"Coming soon..."})}),(0,d.jsx)(f.rq,{isOpen:q,onClose:()=>r(!1),onSelect:a=>{t(a.value)},selectedModel:s,activeProviders:k,title:"Select Model"})]})}function A({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i,activeProviders:j,cloudEnabled:k,initialStatus:m,tunnelEnabled:o,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:s}){let t,u,v,w,x,[y,z]=(0,e.useState)(m||null),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(null),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)(""),[N,O]=(0,e.useState)(""),[P,Q]=(0,e.useState)(""),[R,S]=(0,e.useState)(!1),[T,U]=(0,e.useState)(!1),[V,W]=(0,e.useState)({}),[X,Y]=(0,e.useState)(!1),[Z,$]=(0,e.useState)(""),[_,aa]=(0,e.useState)([]),[ab,ac]=(0,e.useState)(""),ad=(0,e.useRef)([]),ae=async a=>{try{let b=L&&L.trim()||k?L:"sk_9router",c=a.includes(ab)?ab:a[0]||"";await fetch("/api/cli-tools/opencode-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ag(),apiKey:b,models:a,activeModel:c,subagentModel:P})})}catch(a){console.log("Error saving models:",a)}},af=y?.installed?y.config&&y.has9Router?p(y.config?.provider?.prozygent?.options?.baseURL||"",{tunnelPublicUrl:q,tailscaleUrl:s})?"configured":"other":"not_configured":null,ag=()=>{let a=Z||h;return a.endsWith("/v1")?a:`${a}/v1`},ah=async()=>{C(!0);try{let a=await fetch("/api/cli-tools/opencode-settings"),b=await a.json();z(b)}catch(a){z({installed:!1,error:a.message})}finally{C(!1)}},ai=async()=>{E(!0),I(null);try{let a=L&&L.trim()||k?L:"sk_9router",b=await fetch("/api/cli-tools/opencode-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ag(),apiKey:a,models:_,activeModel:""===ab?"":ab||_[0],subagentModel:P})}),c=await b.json();b.ok?(I({type:"success",text:"Settings applied successfully!"}),ah()):I({type:"error",text:c.error||"Failed to apply settings"})}catch(a){I({type:"error",text:a.message})}finally{E(!1)}},aj=async()=>{G(!0),I(null);try{let a=await fetch("/api/cli-tools/opencode-settings",{method:"DELETE"}),b=await a.json();a.ok?(I({type:"success",text:"Settings reset successfully!"}),O(""),Q(""),aa([]),ac(""),ah()):I({type:"error",text:b.error||"Failed to reset settings"})}catch(a){I({type:"error",text:a.message})}finally{G(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/opencode.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===af&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===af&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===af&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[B&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking OpenCode CLI..."})]}),!B&&y&&!y.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"OpenCode CLI not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if 9router is deployed on a remote server."})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>Y(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:()=>K(!J),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:J?"expand_less":"help"}),J?"Hide":"How to Install"]})]})]}),J&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux:"}),(0,d.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g opencode-ai"})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"opencode"})," to verify."]})]})]})]}),!B&&y?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:Z||Z||`${h}/v1`,onChange:$,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:o,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:s})]}),y?.config?.provider?.prozygent?.options?.baseURL&&(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:y.config.provider.prozygent.options.baseURL})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(n,{value:L,onChange:M,apiKeys:i,cloudEnabled:k})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-1",children:"Models"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-1.5",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"flex-1 flex flex-col gap-2",children:[(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5 min-h-[28px] px-2 py-1.5 bg-surface rounded border border-border",children:0===_.length?(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"No models selected"}):_.map(a=>(0,d.jsxs)("span",{onClick:async()=>{if(a===ab)try{(await fetch("/api/cli-tools/opencode-settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({clearActiveModel:!0})})).ok&&(ac(""),ah())}catch(a){console.log("Error clearing active model:",a)}else ac(a)},className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs cursor-pointer transition-colors ${a===ab?"bg-primary/10 text-primary border border-primary":"bg-black/5 dark:bg-white/5 text-text-muted border border-transparent hover:border-border"}`,title:a===ab?"Click to clear active model":"Click to set as active",children:[a===ab&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[10px]",children:"star"}),a,(0,d.jsx)("button",{onClick:async b=>{b.stopPropagation();try{if((await fetch(`/api/cli-tools/opencode-settings?model=${encodeURIComponent(a)}`,{method:"DELETE"})).ok){let b=_.filter(b=>b!==a);aa(b),ab===a&&ac(""),ah()}}catch(a){console.log("Error removing model:",a)}},className:"ml-0.5 hover:text-red-500",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},a))}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("button",{onClick:()=>S(!0),disabled:!j?.length,className:`px-2 py-1 rounded border text-xs transition-colors ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Add Model"}),(0,d.jsx)("span",{className:"text-xs text-text-muted",children:_.length>0&&ab?(0,d.jsxs)(d.Fragment,{children:["Active: ",(0,d.jsx)("span",{className:"text-primary",children:ab})]}):_.length>0?(0,d.jsx)("span",{className:"text-yellow-500",children:"Click a model to set/clear active"}):"Select models to add"})]})]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Subagent Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:P,onChange:a=>Q(a.target.value),placeholder:N||"provider/model-id (defaults to main model)",className:"w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),(0,d.jsx)("button",{onClick:()=>U(!0),disabled:!j?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),P&&(0,d.jsx)("button",{onClick:()=>Q(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear (will use main model)",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),H&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===H.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===H.type?"check_circle":"error"}),(0,d.jsx)("span",{children:H.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:ai,disabled:0===_.length,loading:D,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:aj,disabled:!y.has9Router,loading:F,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>Y(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:R,onClose:()=>{S(!1),ae(ad.current)},onSelect:a=>{!_.includes(a.value)&&(aa([..._,a.value]),ab||ac(a.value))},onDeselect:a=>{let b=_.filter(b=>b!==a.value);aa(b),ab===a.value&&ac(b[0]||"")},selectedModel:null,activeProviders:j,modelAliases:V,addedModelValues:_,closeOnSelect:!1,title:"Add Model for OpenCode"}),(0,d.jsx)(f.rq,{isOpen:T,onClose:()=>U(!1),onSelect:a=>{Q(a.value),U(!1)},selectedModel:P,activeProviders:j,modelAliases:V,title:"Select Subagent Model for OpenCode"}),(0,d.jsx)(f.uR,{isOpen:X,onClose:()=>Y(!1),title:"OpenCode - Manual Configuration",configs:(t=L&&L.trim()?L:k?"<API_KEY_FROM_DASHBOARD>":"sk_9router",u=_.length>0?_:["provider/model-id"],v=ab||_[0]||u[0],w=P||v,x={},u.forEach(a=>{x[a]={name:a,modalities:{input:["text","image"],output:["text"]}}}),[{filename:"~/.config/opencode/opencode.json",content:JSON.stringify({provider:{prozygent:{npm:"@ai-sdk/openai-compatible",options:{baseURL:ag(),apiKey:t},models:x}},model:`9router/${v}`,agent:{explorer:{description:"Fast explorer subagent for codebase exploration",mode:"subagent",model:`9router/${w}`}}},null,2)}])})]})}let B="/api/cli-tools/cowork-settings";function C({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i,activeProviders:j,hasActiveProviders:k,cloudEnabled:m,cloudUrl:o,tunnelEnabled:p,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:s,initialStatus:t}){let u,v,w,x,[y,z]=(0,e.useState)(t||null),[A,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(null),[K,L]=(0,e.useState)(""),[M,N]=(0,e.useState)([]),[O,P]=(0,e.useState)(!1),[Q,R]=(0,e.useState)(""),[S,T]=(0,e.useState)([]),[U,V]=(0,e.useState)([]),[W,X]=(0,e.useState)([]),[Y,Z]=(0,e.useState)({}),[$,_]=(0,e.useState)(!1),[aa,ab]=(0,e.useState)(!1),[ac,ad]=(0,e.useState)(!1),[ae,af]=(0,e.useState)(!1),[ag,ah]=(0,e.useState)({name:"",url:""}),ai=async()=>{D(!0);try{let a=await fetch(B),b=await a.json();z(b)}catch(a){z({installed:!1,error:a.message})}finally{D(!1)}},aj=()=>{let a;return(a=(Q||"").replace(/\/+$/,""))?/\/v1$/.test(a)?a:`${a}/v1`:""},ak=y?.installed?y?.cowork?.baseUrl?y.has9Router?"configured":"other":"not_configured":null,al=async()=>{J(null);let a=aj();if(0===M.length)return void J({type:"error",text:"Please select at least one model"});F(!0);try{let b=K?.trim()||(i?.length>0?i[0].key:null)||(m?null:"sk_9router"),c=await fetch(B,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:a,apiKey:b,models:M,plugins:S,localPlugins:U,customPlugins:W})}),d=await c.json();c.ok?(J({type:"success",text:"Settings applied. Quit & reopen Claude Desktop to load."}),ai()):J({type:"error",text:d.error||"Failed to apply settings"})}catch(a){J({type:"error",text:a.message})}finally{F(!1)}},am=async({name:a,models:b})=>{try{let c=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a,models:b})});if(!c.ok){let a=await c.json();J({type:"error",text:a.error||"Failed to create combo"});return}M.includes(a)||N([...M,a]),_(!1),J({type:"success",text:`Combo "${a}" created and added.`})}catch(a){J({type:"error",text:a.message})}},an=a=>{let b=a?.value||a?.name||a;N(a=>a.filter(a=>a!==b))},ao=async()=>{H(!0),J(null);try{let a=await fetch(B,{method:"DELETE"}),b=await a.json();a.ok?(J({type:"success",text:"Settings reset successfully"}),N([]),T(y?.defaultPlugins||[]),V([]),X([]),ai()):J({type:"error",text:b.error||"Failed to reset"})}catch(a){J({type:"error",text:a.message})}finally{H(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===ak&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===ak&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===ak&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[A&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Claude Cowork..."})]}),!A&&y&&!y.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Claude Desktop (Cowork mode) not detected"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Open Claude Desktop → Help → Troubleshooting → Enable Developer mode → Configure third-party inference, then return here."})]})]}),(0,d.jsx)("div",{className:"pl-9",children:(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>P(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]})})]}),!A&&y?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:aj(),onChange:a=>R((a||"").replace(/\/v1\/?$/,"")),tunnelEnabled:p,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:s,cloudEnabled:m,cloudUrl:o})]}),y?.cowork?.baseUrl&&(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:y.cowork.baseUrl})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(n,{value:K,onChange:L,apiKeys:i,cloudEnabled:m})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Models"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2",children:[(0,d.jsx)("div",{className:"flex-1 flex flex-wrap gap-1.5 min-h-[28px] px-2 py-1.5 bg-surface rounded border border-border",children:0===M.length?(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"No models selected"}):M.map(a=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs bg-black/5 dark:bg-white/5 text-text-muted border border-transparent hover:border-border",children:[a,(0,d.jsx)("button",{onClick:()=>an(a),className:"ml-0.5 hover:text-red-500",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},a))}),(0,d.jsx)("button",{onClick:()=>_(!0),disabled:!k,className:`shrink-0 px-2 py-1.5 rounded border text-xs whitespace-nowrap transition-colors ${k?"bg-primary/10 border-primary/40 text-primary hover:bg-primary/20 cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"+ Combo"})]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-2",children:"MCP"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-2",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"flex-1 flex flex-col gap-1",children:[S.filter(a=>"exa"!==a.name).map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-surface rounded border border-border",children:[(0,d.jsx)("span",{className:"text-xs font-medium min-w-0 truncate flex-shrink-0",children:a.title||a.name}),a.oauth&&(0,d.jsx)("span",{className:"text-[8px] text-amber-600 shrink-0",children:"OAuth"}),(0,d.jsxs)("div",{className:"flex-1 flex flex-wrap gap-1 overflow-hidden",style:{maxHeight:"1.5rem"},children:[Array.isArray(a.toolNames)&&a.toolNames.slice(0,6).map(a=>(0,d.jsx)("span",{className:"text-[9px] px-1 py-0.5 rounded bg-black/5 dark:bg-white/5 text-text-muted whitespace-nowrap",children:a},a)),Array.isArray(a.toolNames)&&a.toolNames.length>6&&(0,d.jsxs)("span",{className:"text-[9px] px-1 py-0.5 rounded bg-black/5 dark:bg-white/5 text-text-muted whitespace-nowrap",children:["+",a.toolNames.length-6]})]}),(0,d.jsx)("button",{onClick:()=>{var b;return b=a.name,void T(S.filter(a=>a.name!==b))},className:"shrink-0 hover:text-red-500 ml-auto",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},a.name)),W.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-surface rounded border border-border",children:[(0,d.jsx)("span",{className:"text-xs font-medium min-w-0 truncate flex-shrink-0",children:a.name}),(0,d.jsx)("span",{className:"text-[8px] px-1 py-0.5 rounded bg-blue-500/10 text-blue-500 shrink-0",children:"custom"}),(0,d.jsx)("span",{className:"flex-1 text-[9px] text-text-muted truncate",children:a.url}),(0,d.jsx)("button",{onClick:()=>X(W.filter(b=>b.name!==a.name)),className:"shrink-0 hover:text-red-500 ml-auto",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},a.name)),0===S.filter(a=>"exa"!==a.name).length&&0===W.length&&(0,d.jsx)("div",{className:"px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-muted",children:"No MCPs added"}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,d.jsx)("button",{onClick:()=>ad(!0),className:"px-2 py-1 rounded border text-xs bg-primary/10 border-primary/40 text-primary hover:bg-primary/20 cursor-pointer whitespace-nowrap",children:"+ Browse"}),(0,d.jsx)("button",{onClick:()=>{ah({name:"",url:""}),af(!0)},className:"px-2 py-1 rounded border text-xs bg-surface border-border text-text-muted hover:border-primary hover:text-primary cursor-pointer whitespace-nowrap",children:"+ Custom"}),(0,d.jsx)("a",{href:"https://mcp.so",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-text-muted hover:text-primary underline ml-auto",children:"Find MCPs →"})]})]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-1",children:"Tools"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-1.5",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"flex-1 flex flex-col gap-1.5",children:[(u=S.some(a=>"exa"===a.name),v=(y?.defaultPlugins||[]).find(a=>"exa"===a.name),(0,d.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer px-2 py-1.5 bg-surface rounded border border-border",children:[(0,d.jsx)("input",{type:"checkbox",checked:u,onChange:a=>{a.target.checked&&v?T([...S.filter(a=>"exa"!==a.name),v]):T(S.filter(a=>"exa"!==a.name))},className:"mt-0.5"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("div",{className:"text-xs font-medium",children:"Web Search & Fetch (Exa)"}),(0,d.jsx)("p",{className:"text-[10px] text-text-muted leading-snug",children:"Replaces built-in WebSearch/WebFetch. Auto-strips duplicates from tool list."})]})]})),(()=>{let a=(y?.localStdioPlugins||[]).find(a=>"browsermcp"===a.name);if(!a)return null;let b=U.includes("browsermcp");return(0,d.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer px-2 py-1.5 bg-surface rounded border border-border",children:[(0,d.jsx)("input",{type:"checkbox",checked:b,onChange:a=>V(a.target.checked?[...U,"browsermcp"]:U.filter(a=>"browsermcp"!==a)),className:"mt-0.5"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("div",{className:"text-xs font-medium",children:"Browser Control (Browser MCP)"}),(0,d.jsxs)("p",{className:"text-[10px] text-text-muted leading-snug",children:["Controls your running Chrome. Auto-strips Cowork's built-in browser tools."," ",(0,d.jsx)("a",{href:a.extensionUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"Install Chrome extension"})]})]})]})})()]})]}),Array.isArray(y?.localStdioPlugins)&&y.localStdioPlugins.filter(a=>"browsermcp"!==a.name).length>0&&(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-1",children:"Local Plugins"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-1.5",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"flex-1 flex flex-col gap-2",children:[(0,d.jsx)("div",{className:"flex flex-col gap-1.5 px-2 py-1.5 bg-surface rounded border border-border",children:y.localStdioPlugins.filter(a=>"browsermcp"!==a.name).map(a=>{let b=U.includes(a.name);return(0,d.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,d.jsx)("input",{type:"checkbox",checked:b,onChange:b=>V(b.target.checked?[...U,a.name]:U.filter(b=>b!==a.name)),className:"mt-0.5"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-xs font-medium",children:a.title}),(0,d.jsx)("span",{className:"text-[8px] text-amber-600",children:"stdio"})]}),(0,d.jsx)("p",{className:"text-[10px] text-text-muted leading-snug",children:a.description}),a.extensionUrl&&(0,d.jsx)("a",{href:a.extensionUrl,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-primary underline",children:"Install Chrome extension"})]})]},a.name)})}),(0,d.jsxs)("p",{className:"text-[10px] text-text-muted leading-snug",children:["⚠️ Local plugins run as subprocess via ",(0,d.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/5",children:"npx"}),". Requires Node.js installed."]})]})]})]}),I&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===I.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===I.type?"check_circle":"error"}),(0,d.jsx)("span",{children:I.text})]}),(0,d.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:al,disabled:0===M.length,loading:E,className:"w-full sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:ao,disabled:!y.has9Router,loading:G,className:"w-full sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>P(!0),className:"w-full sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.uR,{isOpen:O,onClose:()=>P(!1),title:"Claude Cowork - Manual Configuration",configs:(w=K&&K.trim()?K:m?"<API_KEY_FROM_DASHBOARD>":"sk_9router",x=M.length>0?M:["provider/model-id"],[{filename:"~/Library/Application Support/Claude-3p/configLibrary/<appliedId>.json",content:JSON.stringify({inferenceProvider:"gateway",inferenceGatewayBaseUrl:aj()||"https://your-public-host/v1",inferenceGatewayApiKey:w,inferenceModels:x.map(a=>({name:a}))},null,2)}])}),(0,d.jsx)(f.CK,{isOpen:$,combo:null,onClose:()=>_(!1),onSave:am,activeProviders:j,forcePrefix:"claude-",title:"Create Cowork Combo"}),(0,d.jsx)(f.rq,{isOpen:aa,onClose:()=>ab(!1),onSelect:a=>{let b=a?.value||a?.name||a;!b||M.includes(b)||N(a=>[...a,b])},onDeselect:an,activeProviders:j,modelAliases:Y,title:"Select Cowork Model",addedModelValues:M,closeOnSelect:!1}),(0,d.jsx)(f.Nf,{isOpen:ac,onClose:()=>ad(!1),onAdd:a=>{S.some(b=>b.name===a.name)||T([...S,a])},addedNames:S.map(a=>a.name)}),ae&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:()=>af(!1),children:(0,d.jsxs)("div",{className:"bg-surface border border-border rounded-xl shadow-xl w-full max-w-sm mx-4 p-5 flex flex-col gap-4",onClick:a=>a.stopPropagation(),children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("h3",{className:"font-semibold text-sm",children:"Add Custom MCP"}),(0,d.jsx)("button",{onClick:()=>af(!1),className:"text-text-muted hover:text-text-main",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("label",{className:"text-[11px] text-text-muted font-medium",children:"Name"}),(0,d.jsx)("input",{type:"text",placeholder:"my-mcp",value:ag.name,onChange:a=>ah(b=>({...b,name:a.target.value.replace(/\s+/g,"-").toLowerCase()})),className:"px-2 py-1.5 rounded border border-border bg-surface text-xs outline-none focus:border-primary"})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("label",{className:"text-[11px] text-text-muted font-medium",children:"SSE URL"}),(0,d.jsx)("input",{type:"text",placeholder:"https://your-mcp-server.com/sse",value:ag.url,onChange:a=>ah(b=>({...b,url:a.target.value})),className:"px-2 py-1.5 rounded border border-border bg-surface text-xs outline-none focus:border-primary"})]})]}),(0,d.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,d.jsx)("button",{onClick:()=>af(!1),className:"px-3 py-1.5 rounded border border-border text-xs text-text-muted hover:bg-surface cursor-pointer",children:"Cancel"}),(0,d.jsx)("button",{onClick:()=>{let a=ag.name.trim();a&&ag.url.trim()&&(X(b=>[...b.filter(b=>b.name!==a),{name:a,url:ag.url.trim(),transport:"sse",custom:!0}]),af(!1))},className:"px-3 py-1.5 rounded bg-primary text-white text-xs font-medium hover:opacity-90 cursor-pointer",children:"Add"})]})]})})]})}function D({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i,activeProviders:j,cloudEnabled:k,initialStatus:m,tunnelEnabled:o,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:s}){let t,u,[v,w]=(0,e.useState)(m||null),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(!1),[E,F]=(0,e.useState)(null),[G,H]=(0,e.useState)(""),[I,J]=(0,e.useState)(""),[K,L]=(0,e.useState)({}),[M,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)([]),[Q,R]=(0,e.useState)(!1),S=(0,e.useRef)([]),T=async a=>{try{let b=G&&G.trim()||k?G:"sk_9router";await fetch("/api/cli-tools/copilot-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:V(),apiKey:b,models:a})})}catch(a){console.log("Error saving models:",a)}},U=v?v.has9Router?p(v.currentUrl||"",{tunnelPublicUrl:q,tailscaleUrl:s})?"configured":"other":"not_configured":null,V=()=>{let a=I||h;return a.endsWith("/v1")?a:`${a}/v1`},W=async()=>{y(!0);try{let a=await fetch("/api/cli-tools/copilot-settings"),b=await a.json();w(b)}catch(a){w({error:a.message})}finally{y(!1)}},X=async()=>{A(!0),F(null);try{let a=G&&G.trim()||k?G:"sk_9router",b=await fetch("/api/cli-tools/copilot-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:V(),apiKey:a,models:O})}),c=await b.json();b.ok?(F({type:"success",text:c.message||"Settings applied! Reload VS Code."}),W()):F({type:"error",text:c.error||"Failed to apply settings"})}catch(a){F({type:"error",text:a.message})}finally{A(!1)}},Y=async()=>{C(!0),F(null);try{let a=await fetch("/api/cli-tools/copilot-settings",{method:"DELETE"}),b=await a.json();a.ok?(F({type:"success",text:"Settings reset successfully!"}),P([]),W()):F({type:"error",text:b.error||"Failed to reset settings"})}catch(a){F({type:"error",text:a.message})}finally{C(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/copilot.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===U&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===U&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===U&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[x&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Copilot config..."})]}),!x&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-500 text-lg",children:"info"}),(0,d.jsxs)("div",{className:"text-xs text-blue-700 dark:text-blue-300",children:[(0,d.jsxs)("p",{className:"font-medium",children:["Writes to ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/10 rounded",children:"chatLanguageModels.json"})]}),(0,d.jsx)("p",{className:"mt-0.5 opacity-80",children:"Reload VS Code after applying for changes to take effect."})]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:I||I||`${h}/v1`,onChange:J,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:o,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:s})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(n,{value:G,onChange:H,apiKeys:i,cloudEnabled:k})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-1",children:"Models"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-1.5",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"flex-1 flex flex-col gap-2",children:[(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5 min-h-[28px] px-2 py-1.5 bg-surface rounded border border-border",children:0===O.length?(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"No models selected"}):O.map(a=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs bg-black/5 dark:bg-white/5 text-text-muted border border-transparent hover:border-border",children:[a,(0,d.jsx)("button",{onClick:b=>{b.stopPropagation(),P(b=>b.filter(b=>b!==a))},className:"ml-0.5 hover:text-red-500",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},a))}),(0,d.jsx)("div",{children:(0,d.jsx)("button",{onClick:()=>R(!0),disabled:!j?.length,className:`px-2 py-1 rounded border text-xs transition-colors ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Add Model"})})]})]})]}),E&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===E.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===E.type?"check_circle":"error"}),(0,d.jsx)("span",{children:E.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:X,disabled:0===O.length,loading:z,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:Y,disabled:!v?.has9Router,loading:B,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>N(!0),disabled:0===O.length,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:Q,onClose:()=>{R(!1),T(S.current)},onSelect:a=>{O.includes(a.value)||P([...O,a.value])},onDeselect:a=>{P(O.filter(b=>b!==a.value))},selectedModel:null,activeProviders:j,modelAliases:K,addedModelValues:O,closeOnSelect:!1,title:"Add Model for GitHub Copilot"}),(0,d.jsx)(f.uR,{isOpen:M,onClose:()=>N(!1),title:"GitHub Copilot - Manual Configuration",configs:(t=G&&G.trim()?G:k?"<API_KEY_FROM_DASHBOARD>":"sk_9router",u=V(),[{filename:"~/Library/Application Support/Code/User/chatLanguageModels.json",content:JSON.stringify([{name:"prozygent",vendor:"customendpoint",apiType:"chat-completions",apiKey:t,models:(O.length>0?O:["provider/model-id"]).map(a=>({id:a,name:a,url:`${u}/chat/completions#models.ai.azure.com`,toolCalling:!0,vision:!1,maxInputTokens:128e3,maxOutputTokens:16e3}))}],null,2)}])})]})}function E({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i,activeProviders:j,cloudEnabled:k,initialStatus:m,tunnelEnabled:o,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:s}){let t,u,[v,w]=(0,e.useState)(m||null),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(!1),[D,F]=(0,e.useState)(null),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(""),[K,L]=(0,e.useState)(""),[M,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)({}),[Q,R]=(0,e.useState)(!1),[S,T]=(0,e.useState)(""),U=v?.installed?v.has9Router?p(v.settings?.openAiBaseUrl||"",{tunnelPublicUrl:q,tailscaleUrl:s})?"configured":"other":"not_configured":null,V=()=>{let a=S||`${h}/v1`;return a.endsWith("/v1")?a:`${a}/v1`},W=async()=>{y(!0);try{let a=await fetch("/api/cli-tools/cline-settings"),b=await a.json();w(b)}catch(a){w({installed:!1,error:a.message})}finally{y(!1)}},X=async()=>{A(!0),F(null);try{let a=I&&I.trim()||k?I:"sk_9router",b=await fetch("/api/cli-tools/cline-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:V(),apiKey:a,model:K})}),c=await b.json();b.ok?(F({type:"success",text:"Settings applied successfully!"}),W()):F({type:"error",text:c.error||"Failed to apply settings"})}catch(a){F({type:"error",text:a.message})}finally{A(!1)}},Y=async()=>{C(!0),F(null);try{let a=await fetch("/api/cli-tools/cline-settings",{method:"DELETE"}),b=await a.json();a.ok?(F({type:"success",text:"Settings reset successfully!"}),L(""),W()):F({type:"error",text:b.error||"Failed to reset settings"})}catch(a){F({type:"error",text:a.message})}finally{C(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/cline.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===U&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===U&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===U&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[x&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Cline..."})]}),!x&&v&&!v.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Cline not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if 9router is deployed on a remote server."})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>R(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:()=>H(!G),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:G?"expand_less":"help"}),G?"Hide":"How to Install"]})]})]}),G&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsx)("div",{className:"space-y-3 text-sm",children:(0,d.jsxs)("p",{className:"text-text-muted",children:["Install Cline VS Code extension or CLI from ",(0,d.jsx)("a",{className:"text-primary underline",href:"https://docs.cline.bot/",target:"_blank",rel:"noreferrer",children:"docs.cline.bot"}),"."]})})]})]}),!x&&v?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:S||S||`${h}/v1`,onChange:T,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:o,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:s})]}),v?.settings?.openAiBaseUrl&&(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:v.settings.openAiBaseUrl})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(n,{value:I,onChange:J,apiKeys:i,cloudEnabled:k})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:K,onChange:a=>L(a.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),K&&(0,d.jsx)("button",{onClick:()=>L(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>N(!0),disabled:!j?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]})]}),D&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===D.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===D.type?"check_circle":"error"}),(0,d.jsx)("span",{children:D.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:X,disabled:!I&&k&&i.length>0||!K,loading:z,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:Y,disabled:B,loading:B,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>R(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:M,onClose:()=>N(!1),onSelect:a=>{L(a.value),N(!1)},selectedModel:K,activeProviders:j,modelAliases:O,title:"Select Model for Cline"}),(0,d.jsx)(f.uR,{isOpen:Q,onClose:()=>R(!1),title:"Cline - Manual Configuration",configs:(t=I&&I.trim()?I:k?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.cline/data/globalState.json",content:JSON.stringify({actModeApiProvider:"openai",planModeApiProvider:"openai",openAiBaseUrl:(u=V()).endsWith("/v1")?u.slice(0,-3):u,openAiModelId:K||"provider/model-id",planModeOpenAiModelId:K||"provider/model-id"},null,2)},{filename:"~/.cline/data/secrets.json",content:JSON.stringify({openAiApiKey:t},null,2)}])})]})}function F({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i,activeProviders:j,cloudEnabled:k,initialStatus:m,tunnelEnabled:o,tunnelPublicUrl:p,tailscaleEnabled:q,tailscaleUrl:r}){let[s,t]=(0,e.useState)(m||null),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(!1),[E,G]=(0,e.useState)(""),[H,I]=(0,e.useState)(""),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)({}),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)(""),R=s?.installed?s.has9Router?"configured":"not_configured":null,S=()=>{let a=P||`${h}/v1`;return a.endsWith("/v1")?a:`${a}/v1`},T=async()=>{v(!0);try{let a=await fetch("/api/cli-tools/kilo-settings"),b=await a.json();t(b)}catch(a){t({installed:!1,error:a.message})}finally{v(!1)}},U=async()=>{x(!0),B(null);try{let a=E&&E.trim()||k?E:"sk_9router",b=await fetch("/api/cli-tools/kilo-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:S(),apiKey:a,model:H})}),c=await b.json();b.ok?(B({type:"success",text:"Settings applied successfully!"}),T()):B({type:"error",text:c.error||"Failed to apply settings"})}catch(a){B({type:"error",text:a.message})}finally{x(!1)}},V=async()=>{z(!0),B(null);try{let a=await fetch("/api/cli-tools/kilo-settings",{method:"DELETE"}),b=await a.json();a.ok?(B({type:"success",text:"Settings reset successfully!"}),I(""),T()):B({type:"error",text:b.error||"Failed to reset settings"})}catch(a){B({type:"error",text:a.message})}finally{z(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/kilocode.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===R&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===R&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[u&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Kilo Code..."})]}),!u&&s&&!s.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Kilo Code not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if 9router is deployed on a remote server."})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>O(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:()=>D(!C),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:C?"expand_less":"help"}),C?"Hide":"How to Install"]})]})]}),C&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Install Kilo Code from ",(0,d.jsx)("a",{className:"text-primary underline",href:"https://kilocode.ai",target:"_blank",rel:"noreferrer",children:"kilocode.ai"})," or VS Code extension marketplace."]})]})]}),!u&&s?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:P||P||`${h}/v1`,onChange:Q,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:o,tunnelPublicUrl:p,tailscaleEnabled:q,tailscaleUrl:r})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(n,{value:E,onChange:G,apiKeys:i,cloudEnabled:k})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:H,onChange:a=>I(a.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),H&&(0,d.jsx)("button",{onClick:()=>I(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>K(!0),disabled:!j?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]})]}),A&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===A.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===A.type?"check_circle":"error"}),(0,d.jsx)("span",{children:A.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:U,disabled:!E&&k&&i.length>0||!H,loading:w,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:V,disabled:y,loading:y,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>O(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:J,onClose:()=>K(!1),onSelect:a=>{I(a.value),K(!1)},selectedModel:H,activeProviders:j,modelAliases:L,title:"Select Model for Kilo Code"}),(0,d.jsx)(f.uR,{isOpen:N,onClose:()=>O(!1),title:"Kilo Code - Manual Configuration",configs:[{filename:"~/.local/share/kilo/auth.json",content:JSON.stringify({"openai-compatible":{type:"api-key",apiKey:E&&E.trim()?E:k?"<API_KEY_FROM_DASHBOARD>":"sk_9router",baseUrl:S(),model:H||"provider/model-id"}},null,2)}]})]})}let G="/api/cli-tools/deepseek-tui-settings";function H({tool:a,isExpanded:b,onToggle:c,baseUrl:h,hasActiveProviders:i,apiKeys:j,activeProviders:k,cloudEnabled:m,initialStatus:o,tunnelEnabled:q,tunnelPublicUrl:r,tailscaleEnabled:s,tailscaleUrl:t}){let u,[v,w]=(0,e.useState)(o||null),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(null),[F,I]=(0,e.useState)(""),[J,K]=(0,e.useState)(""),[L,M]=(0,e.useState)(!1),[N,O]=(0,e.useState)({}),[P,Q]=(0,e.useState)(!1),[R,S]=(0,e.useState)("");(0,e.useRef)(!1);let T=(()=>{if(!v?.installed)return null;let a=v.settings?.["providers.openai"];return a?.base_url?p(a.base_url,{tunnelPublicUrl:r,tailscaleUrl:t})?"configured":"other":"not_configured"})(),U=async()=>{y(!0);try{let a=await fetch(G),b=await a.json();w(b)}catch(a){w({installed:!1,error:a.message})}finally{y(!1)}},V=()=>{let a=R||"http://127.0.0.1:20128";return a.endsWith("/v1")?a:`${a}/v1`},W=async()=>{A(!0),E(null);try{let a=F?.trim()||(j?.length>0?j[0].key:null)||(m?null:"sk_9router"),b=await fetch(G,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:V(),apiKey:a,model:J})}),c=await b.json();b.ok?(E({type:"success",text:"Settings applied successfully!"}),U()):E({type:"error",text:c.error||"Failed to apply settings"})}catch(a){E({type:"error",text:a.message})}finally{A(!1)}},X=async()=>{C(!0),E(null);try{let a=await fetch(G,{method:"DELETE"}),b=await a.json();a.ok?(E({type:"success",text:"Settings reset successfully!"}),K(""),U()):E({type:"error",text:b.error||"Failed to reset settings"})}catch(a){E({type:"error",text:a.message})}finally{C(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:a.image||"/providers/deepseek-tui.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===T&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===T&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===T&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[x&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking DeepSeek TUI..."})]}),!x&&v&&!v.installed&&(0,d.jsx)("div",{className:"flex flex-col gap-4",children:(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"DeepSeek TUI not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Install via npm:"}),(0,d.jsx)("code",{className:"block mt-2 p-2 bg-black/20 rounded text-xs font-mono",children:"npm install -g deepseek-tui"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mt-2",children:"Manual configuration is still available if 9router is deployed on a remote server."})]})]}),(0,d.jsx)("div",{className:"flex items-center gap-2 pl-9",children:(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>Q(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]})})]})}),!x&&v?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[a.notes&&a.notes.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-2 mb-2",children:a.notes.map((a,b)=>(0,d.jsxs)("div",{className:`flex items-start gap-2 p-2 rounded text-xs ${"warning"===a.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"error"===a.type?"bg-red-500/10 text-red-600 dark:text-red-400":"bg-blue-500/10 text-blue-600 dark:text-blue-400"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5",children:"warning"===a.type?"warning":"error"===a.type?"error":"info"}),(0,d.jsx)("span",{children:a.text})]},b))}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:R||V(),onChange:S,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:q,tunnelPublicUrl:r,tailscaleEnabled:s,tailscaleUrl:t})]}),v?.settings?.["providers.openai"]?.base_url&&(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:v.settings["providers.openai"].base_url})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(n,{value:F,onChange:I,apiKeys:j,cloudEnabled:m})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Default Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:J,onChange:a=>K(a.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),J&&(0,d.jsx)("button",{onClick:()=>K(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>M(!0),disabled:!i,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${i?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]})]}),D&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===D.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===D.type?"check_circle":"error"}),(0,d.jsx)("span",{children:D.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:W,disabled:!J,loading:z,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:X,disabled:!v?.has9Router,loading:B,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>Q(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:L,onClose:()=>M(!1),onSelect:a=>{K(a.value),M(!1)},selectedModel:J,activeProviders:k,modelAliases:N,title:"Select Model for DeepSeek TUI"}),(0,d.jsx)(f.uR,{isOpen:P,onClose:()=>Q(!1),title:"DeepSeek TUI - Manual Configuration",configs:(u=F&&F.trim()?F:m?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.deepseek/config.toml",content:`[providers.openai]
17
+ `}])})]})}var y=c(50377);function z({toolId:a,tool:b,isExpanded:c,onToggle:h,baseUrl:i,apiKeys:j,activeProviders:k=[],cloudEnabled:l=!1,tunnelEnabled:m=!1}){let[o,p]=(0,e.useState)(null),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(""),[u,v]=(0,e.useState)(()=>j?.length>0?j[0].key:""),w=a=>{let b=u&&u.trim()?u:l?"your-api-key":"sk_9router",c=i||"http://localhost:20128",d=c.endsWith("/v1")?c:`${c}/v1`;return a.replace(/\{\{baseUrl\}\}/g,d).replace(/\{\{apiKey\}\}/g,b).replace(/\{\{model\}\}/g,s||"provider/model-id")},{copy:x}=(0,y.C)(),A=async(a,b)=>{await x(w(a),`toolcard-${b}`),p(b),setTimeout(()=>p(null),2e3)},B=k.length>0,C=()=>(!b.requiresExternalUrl||!!l||!!m)&&(!b.requiresCloud||!!l);return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden overflow-x-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:h,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:b.image?(0,d.jsx)(g.default,{src:b.image,alt:b.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}}):b.icon?(0,d.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:b.color},children:b.icon}):(0,d.jsx)(g.default,{src:`/providers/${a}.png`,alt:b.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:b.name}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:b.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${c?"rotate-180":""}`,children:"expand_more"})]}),c&&(0,d.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:b.guideSteps?(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[b.notes&&0!==b.notes.length?(0,d.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:b.notes.map((a,b)=>{if("cloudCheck"===a.type&&(l||m))return null;let c="warning"===a.type,e="cloudCheck"===a.type&&!l&&!m,f="bg-blue-500/10 border-blue-500/30",g="text-blue-600 dark:text-blue-400",h="text-blue-500",i="info";return c?(f="bg-yellow-500/10 border-yellow-500/30",g="text-yellow-600 dark:text-yellow-400",h="text-yellow-500",i="warning"):e&&(f="bg-red-500/10 border-red-500/30",g="text-red-600 dark:text-red-400",h="text-red-500",i="error"),(0,d.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${f}`,children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-lg ${h}`,children:i}),(0,d.jsx)("p",{className:`text-sm ${g}`,children:a.text})]},b)})}):null,C()&&b.guideSteps.map(a=>(0,d.jsxs)("div",{className:"flex items-start gap-4",children:[(0,d.jsx)("div",{className:"size-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold text-white",style:{backgroundColor:b.color},children:a.step}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"font-medium text-text",children:a.title}),a.desc&&(0,d.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:a.desc}),"apiKeySelector"===a.type&&(0,d.jsx)("div",{className:"mt-2 flex flex-col sm:flex-row sm:items-center gap-2",children:(0,d.jsx)(n,{value:u,onChange:v,apiKeys:j,cloudEnabled:l,className:"flex-1"})}),"modelSelector"===a.type&&(0,d.jsxs)("div",{className:"mt-2 flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,d.jsx)("input",{type:"text",value:s,onChange:a=>t(a.target.value),placeholder:"provider/model-id",className:"w-full sm:w-auto flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>r(!0),disabled:!B,className:`shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors ${B?"bg-bg-secondary border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),s&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{onClick:()=>A(s,"model"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"model"===o?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>t(""),className:"p-2 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]})]}),a.value&&(0,d.jsxs)("div",{className:"mt-2 flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,d.jsx)("code",{className:"w-full sm:w-auto flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm font-mono border border-border truncate",children:w(a.value)}),a.copyable&&(0,d.jsx)("button",{onClick:()=>A(a.value,`${a.step}-${a.title}`),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:o===`${a.step}-${a.title}`?"check":"content_copy"})})]})]})]},a.step)),C()&&b.codeBlock&&(0,d.jsxs)("div",{className:"mt-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wide",children:b.codeBlock.language}),(0,d.jsxs)("button",{onClick:()=>A(b.codeBlock.code,"codeblock"),className:"flex items-center gap-1 px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"codeblock"===o?"check":"content_copy"}),"codeblock"===o?"Copied!":"Copy"]})]}),(0,d.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto",children:(0,d.jsx)("code",{className:"text-sm font-mono whitespace-pre",children:w(b.codeBlock.code)})})]})]}):(0,d.jsx)("p",{className:"text-text-muted text-sm",children:"Coming soon..."})}),(0,d.jsx)(f.rq,{isOpen:q,onClose:()=>r(!1),onSelect:a=>{t(a.value)},selectedModel:s,activeProviders:k,title:"Select Model"})]})}function A({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i,activeProviders:j,cloudEnabled:k,initialStatus:m,tunnelEnabled:o,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:s}){let t,u,v,w,x,[y,z]=(0,e.useState)(m||null),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(null),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)(""),[N,O]=(0,e.useState)(""),[P,Q]=(0,e.useState)(""),[R,S]=(0,e.useState)(!1),[T,U]=(0,e.useState)(!1),[V,W]=(0,e.useState)({}),[X,Y]=(0,e.useState)(!1),[Z,$]=(0,e.useState)(""),[_,aa]=(0,e.useState)([]),[ab,ac]=(0,e.useState)(""),ad=(0,e.useRef)([]),ae=async a=>{try{let b=L&&L.trim()||k?L:"sk_9router",c=a.includes(ab)?ab:a[0]||"";await fetch("/api/cli-tools/opencode-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ag(),apiKey:b,models:a,activeModel:c,subagentModel:P})})}catch(a){console.log("Error saving models:",a)}},af=y?.installed?y.config&&y.has9Router?p(y.config?.provider?.prozygent?.options?.baseURL||"",{tunnelPublicUrl:q,tailscaleUrl:s})?"configured":"other":"not_configured":null,ag=()=>{let a=Z||h;return a.endsWith("/v1")?a:`${a}/v1`},ah=async()=>{C(!0);try{let a=await fetch("/api/cli-tools/opencode-settings"),b=await a.json();z(b)}catch(a){z({installed:!1,error:a.message})}finally{C(!1)}},ai=async()=>{E(!0),I(null);try{let a=L&&L.trim()||k?L:"sk_9router",b=await fetch("/api/cli-tools/opencode-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ag(),apiKey:a,models:_,activeModel:""===ab?"":ab||_[0],subagentModel:P})}),c=await b.json();b.ok?(I({type:"success",text:"Settings applied successfully!"}),ah()):I({type:"error",text:c.error||"Failed to apply settings"})}catch(a){I({type:"error",text:a.message})}finally{E(!1)}},aj=async()=>{G(!0),I(null);try{let a=await fetch("/api/cli-tools/opencode-settings",{method:"DELETE"}),b=await a.json();a.ok?(I({type:"success",text:"Settings reset successfully!"}),O(""),Q(""),aa([]),ac(""),ah()):I({type:"error",text:b.error||"Failed to reset settings"})}catch(a){I({type:"error",text:a.message})}finally{G(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/opencode.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===af&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===af&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===af&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[B&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking OpenCode CLI..."})]}),!B&&y&&!y.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"OpenCode CLI not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if 9router is deployed on a remote server."})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>Y(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:()=>K(!J),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:J?"expand_less":"help"}),J?"Hide":"How to Install"]})]})]}),J&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux:"}),(0,d.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g opencode-ai"})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"opencode"})," to verify."]})]})]})]}),!B&&y?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:Z||Z||`${h}/v1`,onChange:$,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:o,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:s})]}),y?.config?.provider?.prozygent?.options?.baseURL&&(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:y.config.provider.prozygent.options.baseURL})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(n,{value:L,onChange:M,apiKeys:i,cloudEnabled:k})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-1",children:"Models"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-1.5",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"flex-1 flex flex-col gap-2",children:[(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5 min-h-[28px] px-2 py-1.5 bg-surface rounded border border-border",children:0===_.length?(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"No models selected"}):_.map(a=>(0,d.jsxs)("span",{onClick:async()=>{if(a===ab)try{(await fetch("/api/cli-tools/opencode-settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({clearActiveModel:!0})})).ok&&(ac(""),ah())}catch(a){console.log("Error clearing active model:",a)}else ac(a)},className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs cursor-pointer transition-colors ${a===ab?"bg-primary/10 text-primary border border-primary":"bg-black/5 dark:bg-white/5 text-text-muted border border-transparent hover:border-border"}`,title:a===ab?"Click to clear active model":"Click to set as active",children:[a===ab&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[10px]",children:"star"}),a,(0,d.jsx)("button",{onClick:async b=>{b.stopPropagation();try{if((await fetch(`/api/cli-tools/opencode-settings?model=${encodeURIComponent(a)}`,{method:"DELETE"})).ok){let b=_.filter(b=>b!==a);aa(b),ab===a&&ac(""),ah()}}catch(a){console.log("Error removing model:",a)}},className:"ml-0.5 hover:text-red-500",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},a))}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("button",{onClick:()=>S(!0),disabled:!j?.length,className:`px-2 py-1 rounded border text-xs transition-colors ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Add Model"}),(0,d.jsx)("span",{className:"text-xs text-text-muted",children:_.length>0&&ab?(0,d.jsxs)(d.Fragment,{children:["Active: ",(0,d.jsx)("span",{className:"text-primary",children:ab})]}):_.length>0?(0,d.jsx)("span",{className:"text-yellow-500",children:"Click a model to set/clear active"}):"Select models to add"})]})]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Subagent Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:P,onChange:a=>Q(a.target.value),placeholder:N||"provider/model-id (defaults to main model)",className:"w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),(0,d.jsx)("button",{onClick:()=>U(!0),disabled:!j?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),P&&(0,d.jsx)("button",{onClick:()=>Q(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear (will use main model)",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),H&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===H.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===H.type?"check_circle":"error"}),(0,d.jsx)("span",{children:H.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:ai,disabled:0===_.length,loading:D,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:aj,disabled:!y.has9Router,loading:F,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>Y(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:R,onClose:()=>{S(!1),ae(ad.current)},onSelect:a=>{!_.includes(a.value)&&(aa([..._,a.value]),ab||ac(a.value))},onDeselect:a=>{let b=_.filter(b=>b!==a.value);aa(b),ab===a.value&&ac(b[0]||"")},selectedModel:null,activeProviders:j,modelAliases:V,addedModelValues:_,closeOnSelect:!1,title:"Add Model for OpenCode"}),(0,d.jsx)(f.rq,{isOpen:T,onClose:()=>U(!1),onSelect:a=>{Q(a.value),U(!1)},selectedModel:P,activeProviders:j,modelAliases:V,title:"Select Subagent Model for OpenCode"}),(0,d.jsx)(f.uR,{isOpen:X,onClose:()=>Y(!1),title:"OpenCode - Manual Configuration",configs:(t=L&&L.trim()?L:k?"<API_KEY_FROM_DASHBOARD>":"sk_9router",u=_.length>0?_:["provider/model-id"],v=ab||_[0]||u[0],w=P||v,x={},u.forEach(a=>{x[a]={name:a,modalities:{input:["text","image"],output:["text"]}}}),[{filename:"~/.config/opencode/opencode.json",content:JSON.stringify({provider:{prozygent:{npm:"@ai-sdk/openai-compatible",options:{baseURL:ag(),apiKey:t},models:x}},model:`9router/${v}`,agent:{explorer:{description:"Fast explorer subagent for codebase exploration",mode:"subagent",model:`9router/${w}`}}},null,2)}])})]})}let B="/api/cli-tools/cowork-settings";function C({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i,activeProviders:j,hasActiveProviders:k,cloudEnabled:m,cloudUrl:o,tunnelEnabled:p,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:s,initialStatus:t}){let u,v,w,x,[y,z]=(0,e.useState)(t||null),[A,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(null),[K,L]=(0,e.useState)(""),[M,N]=(0,e.useState)([]),[O,P]=(0,e.useState)(!1),[Q,R]=(0,e.useState)(""),[S,T]=(0,e.useState)([]),[U,V]=(0,e.useState)([]),[W,X]=(0,e.useState)([]),[Y,Z]=(0,e.useState)({}),[$,_]=(0,e.useState)(!1),[aa,ab]=(0,e.useState)(!1),[ac,ad]=(0,e.useState)(!1),[ae,af]=(0,e.useState)(!1),[ag,ah]=(0,e.useState)({name:"",url:""}),ai=async()=>{D(!0);try{let a=await fetch(B),b=await a.json();z(b)}catch(a){z({installed:!1,error:a.message})}finally{D(!1)}},aj=()=>{let a;return(a=(Q||"").replace(/\/+$/,""))?/\/v1$/.test(a)?a:`${a}/v1`:""},ak=y?.installed?y?.cowork?.baseUrl?y.has9Router?"configured":"other":"not_configured":null,al=async()=>{J(null);let a=aj();if(0===M.length)return void J({type:"error",text:"Please select at least one model"});F(!0);try{let b=K?.trim()||(i?.length>0?i[0].key:null)||(m?null:"sk_9router"),c=await fetch(B,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:a,apiKey:b,models:M,plugins:S,localPlugins:U,customPlugins:W})}),d=await c.json();c.ok?(J({type:"success",text:"Settings applied. Quit & reopen Claude Desktop to load."}),ai()):J({type:"error",text:d.error||"Failed to apply settings"})}catch(a){J({type:"error",text:a.message})}finally{F(!1)}},am=async({name:a,models:b})=>{try{let c=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a,models:b})});if(!c.ok){let a=await c.json();J({type:"error",text:a.error||"Failed to create combo"});return}M.includes(a)||N([...M,a]),_(!1),J({type:"success",text:`Combo "${a}" created and added.`})}catch(a){J({type:"error",text:a.message})}},an=a=>{let b=a?.value||a?.name||a;N(a=>a.filter(a=>a!==b))},ao=async()=>{H(!0),J(null);try{let a=await fetch(B,{method:"DELETE"}),b=await a.json();a.ok?(J({type:"success",text:"Settings reset successfully"}),N([]),T(y?.defaultPlugins||[]),V([]),X([]),ai()):J({type:"error",text:b.error||"Failed to reset"})}catch(a){J({type:"error",text:a.message})}finally{H(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===ak&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===ak&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===ak&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[A&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Claude Cowork..."})]}),!A&&y&&!y.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Claude Desktop (Cowork mode) not detected"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Open Claude Desktop → Help → Troubleshooting → Enable Developer mode → Configure third-party inference, then return here."})]})]}),(0,d.jsx)("div",{className:"pl-9",children:(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>P(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]})})]}),!A&&y?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:aj(),onChange:a=>R((a||"").replace(/\/v1\/?$/,"")),tunnelEnabled:p,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:s,cloudEnabled:m,cloudUrl:o})]}),y?.cowork?.baseUrl&&(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:y.cowork.baseUrl})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(n,{value:K,onChange:L,apiKeys:i,cloudEnabled:m})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Models"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2",children:[(0,d.jsx)("div",{className:"flex-1 flex flex-wrap gap-1.5 min-h-[28px] px-2 py-1.5 bg-surface rounded border border-border",children:0===M.length?(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"No models selected"}):M.map(a=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs bg-black/5 dark:bg-white/5 text-text-muted border border-transparent hover:border-border",children:[a,(0,d.jsx)("button",{onClick:()=>an(a),className:"ml-0.5 hover:text-red-500",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},a))}),(0,d.jsx)("button",{onClick:()=>_(!0),disabled:!k,className:`shrink-0 px-2 py-1.5 rounded border text-xs whitespace-nowrap transition-colors ${k?"bg-primary/10 border-primary/40 text-primary hover:bg-primary/20 cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"+ Combo"})]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-2",children:"MCP"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-2",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"flex-1 flex flex-col gap-1",children:[S.filter(a=>"exa"!==a.name).map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-surface rounded border border-border",children:[(0,d.jsx)("span",{className:"text-xs font-medium min-w-0 truncate flex-shrink-0",children:a.title||a.name}),a.oauth&&(0,d.jsx)("span",{className:"text-[8px] text-amber-600 shrink-0",children:"OAuth"}),(0,d.jsxs)("div",{className:"flex-1 flex flex-wrap gap-1 overflow-hidden",style:{maxHeight:"1.5rem"},children:[Array.isArray(a.toolNames)&&a.toolNames.slice(0,6).map(a=>(0,d.jsx)("span",{className:"text-[9px] px-1 py-0.5 rounded bg-black/5 dark:bg-white/5 text-text-muted whitespace-nowrap",children:a},a)),Array.isArray(a.toolNames)&&a.toolNames.length>6&&(0,d.jsxs)("span",{className:"text-[9px] px-1 py-0.5 rounded bg-black/5 dark:bg-white/5 text-text-muted whitespace-nowrap",children:["+",a.toolNames.length-6]})]}),(0,d.jsx)("button",{onClick:()=>{var b;return b=a.name,void T(S.filter(a=>a.name!==b))},className:"shrink-0 hover:text-red-500 ml-auto",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},a.name)),W.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-surface rounded border border-border",children:[(0,d.jsx)("span",{className:"text-xs font-medium min-w-0 truncate flex-shrink-0",children:a.name}),(0,d.jsx)("span",{className:"text-[8px] px-1 py-0.5 rounded bg-blue-500/10 text-blue-500 shrink-0",children:"custom"}),(0,d.jsx)("span",{className:"flex-1 text-[9px] text-text-muted truncate",children:a.url}),(0,d.jsx)("button",{onClick:()=>X(W.filter(b=>b.name!==a.name)),className:"shrink-0 hover:text-red-500 ml-auto",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},a.name)),0===S.filter(a=>"exa"!==a.name).length&&0===W.length&&(0,d.jsx)("div",{className:"px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-muted",children:"No MCPs added"}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,d.jsx)("button",{onClick:()=>ad(!0),className:"px-2 py-1 rounded border text-xs bg-primary/10 border-primary/40 text-primary hover:bg-primary/20 cursor-pointer whitespace-nowrap",children:"+ Browse"}),(0,d.jsx)("button",{onClick:()=>{ah({name:"",url:""}),af(!0)},className:"px-2 py-1 rounded border text-xs bg-surface border-border text-text-muted hover:border-primary hover:text-primary cursor-pointer whitespace-nowrap",children:"+ Custom"}),(0,d.jsx)("a",{href:"https://mcp.so",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-text-muted hover:text-primary underline ml-auto",children:"Find MCPs →"})]})]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-1",children:"Tools"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-1.5",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"flex-1 flex flex-col gap-1.5",children:[(u=S.some(a=>"exa"===a.name),v=(y?.defaultPlugins||[]).find(a=>"exa"===a.name),(0,d.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer px-2 py-1.5 bg-surface rounded border border-border",children:[(0,d.jsx)("input",{type:"checkbox",checked:u,onChange:a=>{a.target.checked&&v?T([...S.filter(a=>"exa"!==a.name),v]):T(S.filter(a=>"exa"!==a.name))},className:"mt-0.5"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("div",{className:"text-xs font-medium",children:"Web Search & Fetch (Exa)"}),(0,d.jsx)("p",{className:"text-[10px] text-text-muted leading-snug",children:"Replaces built-in WebSearch/WebFetch. Auto-strips duplicates from tool list."})]})]})),(()=>{let a=(y?.localStdioPlugins||[]).find(a=>"browsermcp"===a.name);if(!a)return null;let b=U.includes("browsermcp");return(0,d.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer px-2 py-1.5 bg-surface rounded border border-border",children:[(0,d.jsx)("input",{type:"checkbox",checked:b,onChange:a=>V(a.target.checked?[...U,"browsermcp"]:U.filter(a=>"browsermcp"!==a)),className:"mt-0.5"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("div",{className:"text-xs font-medium",children:"Browser Control (Browser MCP)"}),(0,d.jsxs)("p",{className:"text-[10px] text-text-muted leading-snug",children:["Controls your running Chrome. Auto-strips Cowork's built-in browser tools."," ",(0,d.jsx)("a",{href:a.extensionUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"Install Chrome extension"})]})]})]})})()]})]}),Array.isArray(y?.localStdioPlugins)&&y.localStdioPlugins.filter(a=>"browsermcp"!==a.name).length>0&&(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-1",children:"Local Plugins"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-1.5",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"flex-1 flex flex-col gap-2",children:[(0,d.jsx)("div",{className:"flex flex-col gap-1.5 px-2 py-1.5 bg-surface rounded border border-border",children:y.localStdioPlugins.filter(a=>"browsermcp"!==a.name).map(a=>{let b=U.includes(a.name);return(0,d.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,d.jsx)("input",{type:"checkbox",checked:b,onChange:b=>V(b.target.checked?[...U,a.name]:U.filter(b=>b!==a.name)),className:"mt-0.5"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-xs font-medium",children:a.title}),(0,d.jsx)("span",{className:"text-[8px] text-amber-600",children:"stdio"})]}),(0,d.jsx)("p",{className:"text-[10px] text-text-muted leading-snug",children:a.description}),a.extensionUrl&&(0,d.jsx)("a",{href:a.extensionUrl,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-primary underline",children:"Install Chrome extension"})]})]},a.name)})}),(0,d.jsxs)("p",{className:"text-[10px] text-text-muted leading-snug",children:["⚠️ Local plugins run as subprocess via ",(0,d.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/5",children:"npx"}),". Requires Node.js installed."]})]})]})]}),I&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===I.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===I.type?"check_circle":"error"}),(0,d.jsx)("span",{children:I.text})]}),(0,d.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:al,disabled:0===M.length,loading:E,className:"w-full sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:ao,disabled:!y.has9Router,loading:G,className:"w-full sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>P(!0),className:"w-full sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.uR,{isOpen:O,onClose:()=>P(!1),title:"Claude Cowork - Manual Configuration",configs:(w=K&&K.trim()?K:m?"<API_KEY_FROM_DASHBOARD>":"sk_9router",x=M.length>0?M:["provider/model-id"],[{filename:"~/Library/Application Support/Claude-3p/configLibrary/<appliedId>.json",content:JSON.stringify({inferenceProvider:"gateway",inferenceGatewayBaseUrl:aj()||"https://your-public-host/v1",inferenceGatewayApiKey:w,inferenceModels:x.map(a=>({name:a}))},null,2)}])}),(0,d.jsx)(f.CK,{isOpen:$,combo:null,onClose:()=>_(!1),onSave:am,activeProviders:j,forcePrefix:"claude-",title:"Create Cowork Combo"}),(0,d.jsx)(f.rq,{isOpen:aa,onClose:()=>ab(!1),onSelect:a=>{let b=a?.value||a?.name||a;!b||M.includes(b)||N(a=>[...a,b])},onDeselect:an,activeProviders:j,modelAliases:Y,title:"Select Cowork Model",addedModelValues:M,closeOnSelect:!1}),(0,d.jsx)(f.Nf,{isOpen:ac,onClose:()=>ad(!1),onAdd:a=>{S.some(b=>b.name===a.name)||T([...S,a])},addedNames:S.map(a=>a.name)}),ae&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:()=>af(!1),children:(0,d.jsxs)("div",{className:"bg-surface border border-border rounded-xl shadow-xl w-full max-w-sm mx-4 p-5 flex flex-col gap-4",onClick:a=>a.stopPropagation(),children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("h3",{className:"font-semibold text-sm",children:"Add Custom MCP"}),(0,d.jsx)("button",{onClick:()=>af(!1),className:"text-text-muted hover:text-text-main",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("label",{className:"text-[11px] text-text-muted font-medium",children:"Name"}),(0,d.jsx)("input",{type:"text",placeholder:"my-mcp",value:ag.name,onChange:a=>ah(b=>({...b,name:a.target.value.replace(/\s+/g,"-").toLowerCase()})),className:"px-2 py-1.5 rounded border border-border bg-surface text-xs outline-none focus:border-primary"})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("label",{className:"text-[11px] text-text-muted font-medium",children:"SSE URL"}),(0,d.jsx)("input",{type:"text",placeholder:"https://your-mcp-server.com/sse",value:ag.url,onChange:a=>ah(b=>({...b,url:a.target.value})),className:"px-2 py-1.5 rounded border border-border bg-surface text-xs outline-none focus:border-primary"})]})]}),(0,d.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,d.jsx)("button",{onClick:()=>af(!1),className:"px-3 py-1.5 rounded border border-border text-xs text-text-muted hover:bg-surface cursor-pointer",children:"Cancel"}),(0,d.jsx)("button",{onClick:()=>{let a=ag.name.trim();a&&ag.url.trim()&&(X(b=>[...b.filter(b=>b.name!==a),{name:a,url:ag.url.trim(),transport:"sse",custom:!0}]),af(!1))},className:"px-3 py-1.5 rounded bg-primary text-white text-xs font-medium hover:opacity-90 cursor-pointer",children:"Add"})]})]})})]})}function D({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i,activeProviders:j,cloudEnabled:k,initialStatus:m,tunnelEnabled:o,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:s}){let t,u,[v,w]=(0,e.useState)(m||null),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(!1),[E,F]=(0,e.useState)(null),[G,H]=(0,e.useState)(""),[I,J]=(0,e.useState)(""),[K,L]=(0,e.useState)({}),[M,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)([]),[Q,R]=(0,e.useState)(!1),S=(0,e.useRef)([]),T=async a=>{try{let b=G&&G.trim()||k?G:"sk_9router";await fetch("/api/cli-tools/copilot-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:V(),apiKey:b,models:a})})}catch(a){console.log("Error saving models:",a)}},U=v?v.has9Router?p(v.currentUrl||"",{tunnelPublicUrl:q,tailscaleUrl:s})?"configured":"other":"not_configured":null,V=()=>{let a=I||h;return a.endsWith("/v1")?a:`${a}/v1`},W=async()=>{y(!0);try{let a=await fetch("/api/cli-tools/copilot-settings"),b=await a.json();w(b)}catch(a){w({error:a.message})}finally{y(!1)}},X=async()=>{A(!0),F(null);try{let a=G&&G.trim()||k?G:"sk_9router",b=await fetch("/api/cli-tools/copilot-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:V(),apiKey:a,models:O})}),c=await b.json();b.ok?(F({type:"success",text:c.message||"Settings applied! Reload VS Code."}),W()):F({type:"error",text:c.error||"Failed to apply settings"})}catch(a){F({type:"error",text:a.message})}finally{A(!1)}},Y=async()=>{C(!0),F(null);try{let a=await fetch("/api/cli-tools/copilot-settings",{method:"DELETE"}),b=await a.json();a.ok?(F({type:"success",text:"Settings reset successfully!"}),P([]),W()):F({type:"error",text:b.error||"Failed to reset settings"})}catch(a){F({type:"error",text:a.message})}finally{C(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/copilot.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===U&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===U&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===U&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[x&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Copilot config..."})]}),!x&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-500 text-lg",children:"info"}),(0,d.jsxs)("div",{className:"text-xs text-blue-700 dark:text-blue-300",children:[(0,d.jsxs)("p",{className:"font-medium",children:["Writes to ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/10 rounded",children:"chatLanguageModels.json"})]}),(0,d.jsx)("p",{className:"mt-0.5 opacity-80",children:"Reload VS Code after applying for changes to take effect."})]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:I||I||`${h}/v1`,onChange:J,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:o,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:s})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(n,{value:G,onChange:H,apiKeys:i,cloudEnabled:k})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-1",children:"Models"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-1.5",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"flex-1 flex flex-col gap-2",children:[(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5 min-h-[28px] px-2 py-1.5 bg-surface rounded border border-border",children:0===O.length?(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"No models selected"}):O.map(a=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs bg-black/5 dark:bg-white/5 text-text-muted border border-transparent hover:border-border",children:[a,(0,d.jsx)("button",{onClick:b=>{b.stopPropagation(),P(b=>b.filter(b=>b!==a))},className:"ml-0.5 hover:text-red-500",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},a))}),(0,d.jsx)("div",{children:(0,d.jsx)("button",{onClick:()=>R(!0),disabled:!j?.length,className:`px-2 py-1 rounded border text-xs transition-colors ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Add Model"})})]})]})]}),E&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===E.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===E.type?"check_circle":"error"}),(0,d.jsx)("span",{children:E.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:X,disabled:0===O.length,loading:z,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:Y,disabled:!v?.has9Router,loading:B,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>N(!0),disabled:0===O.length,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:Q,onClose:()=>{R(!1),T(S.current)},onSelect:a=>{O.includes(a.value)||P([...O,a.value])},onDeselect:a=>{P(O.filter(b=>b!==a.value))},selectedModel:null,activeProviders:j,modelAliases:K,addedModelValues:O,closeOnSelect:!1,title:"Add Model for GitHub Copilot"}),(0,d.jsx)(f.uR,{isOpen:M,onClose:()=>N(!1),title:"GitHub Copilot - Manual Configuration",configs:(t=G&&G.trim()?G:k?"<API_KEY_FROM_DASHBOARD>":"sk_9router",u=V(),[{filename:"~/Library/Application Support/Code/User/chatLanguageModels.json",content:JSON.stringify([{name:"prozygent",vendor:"customendpoint",apiType:"chat-completions",apiKey:t,models:(O.length>0?O:["provider/model-id"]).map(a=>({id:a,name:a,url:`${u}/chat/completions`,toolCalling:!0,vision:!0,maxInputTokens:128e3,maxOutputTokens:16e3}))}],null,2)}])})]})}function E({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i,activeProviders:j,cloudEnabled:k,initialStatus:m,tunnelEnabled:o,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:s}){let t,u,[v,w]=(0,e.useState)(m||null),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(!1),[D,F]=(0,e.useState)(null),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(""),[K,L]=(0,e.useState)(""),[M,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)({}),[Q,R]=(0,e.useState)(!1),[S,T]=(0,e.useState)(""),U=v?.installed?v.has9Router?p(v.settings?.openAiBaseUrl||"",{tunnelPublicUrl:q,tailscaleUrl:s})?"configured":"other":"not_configured":null,V=()=>{let a=S||`${h}/v1`;return a.endsWith("/v1")?a:`${a}/v1`},W=async()=>{y(!0);try{let a=await fetch("/api/cli-tools/cline-settings"),b=await a.json();w(b)}catch(a){w({installed:!1,error:a.message})}finally{y(!1)}},X=async()=>{A(!0),F(null);try{let a=I&&I.trim()||k?I:"sk_9router",b=await fetch("/api/cli-tools/cline-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:V(),apiKey:a,model:K})}),c=await b.json();b.ok?(F({type:"success",text:"Settings applied successfully!"}),W()):F({type:"error",text:c.error||"Failed to apply settings"})}catch(a){F({type:"error",text:a.message})}finally{A(!1)}},Y=async()=>{C(!0),F(null);try{let a=await fetch("/api/cli-tools/cline-settings",{method:"DELETE"}),b=await a.json();a.ok?(F({type:"success",text:"Settings reset successfully!"}),L(""),W()):F({type:"error",text:b.error||"Failed to reset settings"})}catch(a){F({type:"error",text:a.message})}finally{C(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/cline.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===U&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===U&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===U&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[x&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Cline..."})]}),!x&&v&&!v.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Cline not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if 9router is deployed on a remote server."})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>R(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:()=>H(!G),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:G?"expand_less":"help"}),G?"Hide":"How to Install"]})]})]}),G&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsx)("div",{className:"space-y-3 text-sm",children:(0,d.jsxs)("p",{className:"text-text-muted",children:["Install Cline VS Code extension or CLI from ",(0,d.jsx)("a",{className:"text-primary underline",href:"https://docs.cline.bot/",target:"_blank",rel:"noreferrer",children:"docs.cline.bot"}),"."]})})]})]}),!x&&v?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:S||S||`${h}/v1`,onChange:T,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:o,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:s})]}),v?.settings?.openAiBaseUrl&&(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:v.settings.openAiBaseUrl})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(n,{value:I,onChange:J,apiKeys:i,cloudEnabled:k})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:K,onChange:a=>L(a.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),K&&(0,d.jsx)("button",{onClick:()=>L(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>N(!0),disabled:!j?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]})]}),D&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===D.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===D.type?"check_circle":"error"}),(0,d.jsx)("span",{children:D.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:X,disabled:!I&&k&&i.length>0||!K,loading:z,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:Y,disabled:B,loading:B,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>R(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:M,onClose:()=>N(!1),onSelect:a=>{L(a.value),N(!1)},selectedModel:K,activeProviders:j,modelAliases:O,title:"Select Model for Cline"}),(0,d.jsx)(f.uR,{isOpen:Q,onClose:()=>R(!1),title:"Cline - Manual Configuration",configs:(t=I&&I.trim()?I:k?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.cline/data/globalState.json",content:JSON.stringify({actModeApiProvider:"openai",planModeApiProvider:"openai",openAiBaseUrl:(u=V()).endsWith("/v1")?u.slice(0,-3):u,openAiModelId:K||"provider/model-id",planModeOpenAiModelId:K||"provider/model-id"},null,2)},{filename:"~/.cline/data/secrets.json",content:JSON.stringify({openAiApiKey:t},null,2)}])})]})}function F({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i,activeProviders:j,cloudEnabled:k,initialStatus:m,tunnelEnabled:o,tunnelPublicUrl:p,tailscaleEnabled:q,tailscaleUrl:r}){let[s,t]=(0,e.useState)(m||null),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(!1),[E,G]=(0,e.useState)(""),[H,I]=(0,e.useState)(""),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)({}),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)(""),R=s?.installed?s.has9Router?"configured":"not_configured":null,S=()=>{let a=P||`${h}/v1`;return a.endsWith("/v1")?a:`${a}/v1`},T=async()=>{v(!0);try{let a=await fetch("/api/cli-tools/kilo-settings"),b=await a.json();t(b)}catch(a){t({installed:!1,error:a.message})}finally{v(!1)}},U=async()=>{x(!0),B(null);try{let a=E&&E.trim()||k?E:"sk_9router",b=await fetch("/api/cli-tools/kilo-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:S(),apiKey:a,model:H})}),c=await b.json();b.ok?(B({type:"success",text:"Settings applied successfully!"}),T()):B({type:"error",text:c.error||"Failed to apply settings"})}catch(a){B({type:"error",text:a.message})}finally{x(!1)}},V=async()=>{z(!0),B(null);try{let a=await fetch("/api/cli-tools/kilo-settings",{method:"DELETE"}),b=await a.json();a.ok?(B({type:"success",text:"Settings reset successfully!"}),I(""),T()):B({type:"error",text:b.error||"Failed to reset settings"})}catch(a){B({type:"error",text:a.message})}finally{z(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/kilocode.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===R&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===R&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[u&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Kilo Code..."})]}),!u&&s&&!s.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Kilo Code not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if 9router is deployed on a remote server."})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>O(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:()=>D(!C),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:C?"expand_less":"help"}),C?"Hide":"How to Install"]})]})]}),C&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Install Kilo Code from ",(0,d.jsx)("a",{className:"text-primary underline",href:"https://kilocode.ai",target:"_blank",rel:"noreferrer",children:"kilocode.ai"})," or VS Code extension marketplace."]})]})]}),!u&&s?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:P||P||`${h}/v1`,onChange:Q,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:o,tunnelPublicUrl:p,tailscaleEnabled:q,tailscaleUrl:r})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(n,{value:E,onChange:G,apiKeys:i,cloudEnabled:k})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:H,onChange:a=>I(a.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),H&&(0,d.jsx)("button",{onClick:()=>I(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>K(!0),disabled:!j?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]})]}),A&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===A.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===A.type?"check_circle":"error"}),(0,d.jsx)("span",{children:A.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:U,disabled:!E&&k&&i.length>0||!H,loading:w,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:V,disabled:y,loading:y,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>O(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:J,onClose:()=>K(!1),onSelect:a=>{I(a.value),K(!1)},selectedModel:H,activeProviders:j,modelAliases:L,title:"Select Model for Kilo Code"}),(0,d.jsx)(f.uR,{isOpen:N,onClose:()=>O(!1),title:"Kilo Code - Manual Configuration",configs:[{filename:"~/.local/share/kilo/auth.json",content:JSON.stringify({"openai-compatible":{type:"api-key",apiKey:E&&E.trim()?E:k?"<API_KEY_FROM_DASHBOARD>":"sk_9router",baseUrl:S(),model:H||"provider/model-id"}},null,2)}]})]})}let G="/api/cli-tools/deepseek-tui-settings";function H({tool:a,isExpanded:b,onToggle:c,baseUrl:h,hasActiveProviders:i,apiKeys:j,activeProviders:k,cloudEnabled:m,initialStatus:o,tunnelEnabled:q,tunnelPublicUrl:r,tailscaleEnabled:s,tailscaleUrl:t}){let u,[v,w]=(0,e.useState)(o||null),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(null),[F,I]=(0,e.useState)(""),[J,K]=(0,e.useState)(""),[L,M]=(0,e.useState)(!1),[N,O]=(0,e.useState)({}),[P,Q]=(0,e.useState)(!1),[R,S]=(0,e.useState)("");(0,e.useRef)(!1);let T=(()=>{if(!v?.installed)return null;let a=v.settings?.["providers.openai"];return a?.base_url?p(a.base_url,{tunnelPublicUrl:r,tailscaleUrl:t})?"configured":"other":"not_configured"})(),U=async()=>{y(!0);try{let a=await fetch(G),b=await a.json();w(b)}catch(a){w({installed:!1,error:a.message})}finally{y(!1)}},V=()=>{let a=R||"http://127.0.0.1:20128";return a.endsWith("/v1")?a:`${a}/v1`},W=async()=>{A(!0),E(null);try{let a=F?.trim()||(j?.length>0?j[0].key:null)||(m?null:"sk_9router"),b=await fetch(G,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:V(),apiKey:a,model:J})}),c=await b.json();b.ok?(E({type:"success",text:"Settings applied successfully!"}),U()):E({type:"error",text:c.error||"Failed to apply settings"})}catch(a){E({type:"error",text:a.message})}finally{A(!1)}},X=async()=>{C(!0),E(null);try{let a=await fetch(G,{method:"DELETE"}),b=await a.json();a.ok?(E({type:"success",text:"Settings reset successfully!"}),K(""),U()):E({type:"error",text:b.error||"Failed to reset settings"})}catch(a){E({type:"error",text:a.message})}finally{C(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:a.image||"/providers/deepseek-tui.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===T&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===T&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===T&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[x&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking DeepSeek TUI..."})]}),!x&&v&&!v.installed&&(0,d.jsx)("div",{className:"flex flex-col gap-4",children:(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"DeepSeek TUI not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Install via npm:"}),(0,d.jsx)("code",{className:"block mt-2 p-2 bg-black/20 rounded text-xs font-mono",children:"npm install -g deepseek-tui"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mt-2",children:"Manual configuration is still available if 9router is deployed on a remote server."})]})]}),(0,d.jsx)("div",{className:"flex items-center gap-2 pl-9",children:(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>Q(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]})})]})}),!x&&v?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[a.notes&&a.notes.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-2 mb-2",children:a.notes.map((a,b)=>(0,d.jsxs)("div",{className:`flex items-start gap-2 p-2 rounded text-xs ${"warning"===a.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"error"===a.type?"bg-red-500/10 text-red-600 dark:text-red-400":"bg-blue-500/10 text-blue-600 dark:text-blue-400"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5",children:"warning"===a.type?"warning":"error"===a.type?"error":"info"}),(0,d.jsx)("span",{children:a.text})]},b))}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:R||V(),onChange:S,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:q,tunnelPublicUrl:r,tailscaleEnabled:s,tailscaleUrl:t})]}),v?.settings?.["providers.openai"]?.base_url&&(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:v.settings["providers.openai"].base_url})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(n,{value:F,onChange:I,apiKeys:j,cloudEnabled:m})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Default Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:J,onChange:a=>K(a.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),J&&(0,d.jsx)("button",{onClick:()=>K(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>M(!0),disabled:!i,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${i?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]})]}),D&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===D.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===D.type?"check_circle":"error"}),(0,d.jsx)("span",{children:D.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:W,disabled:!J,loading:z,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:X,disabled:!v?.has9Router,loading:B,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>Q(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:L,onClose:()=>M(!1),onSelect:a=>{K(a.value),M(!1)},selectedModel:J,activeProviders:k,modelAliases:N,title:"Select Model for DeepSeek TUI"}),(0,d.jsx)(f.uR,{isOpen:P,onClose:()=>Q(!1),title:"DeepSeek TUI - Manual Configuration",configs:(u=F&&F.trim()?F:m?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.deepseek/config.toml",content:`[providers.openai]
18
18
  base_url = "${V()}"
19
19
  api_key = "${u}"
20
20
  model = "${J||"provider/model-id"}"
@@ -50,4 +50,4 @@ amp --model "{{model}}"
50
50
  "model": {
51
51
  "name": "{{model}}"
52
52
  }
53
- }`}},"deepseek-tui":{id:"deepseek-tui",name:"DeepSeek TUI",image:"/providers/deepseek-tui.png",color:"#4D6BFE",description:"DeepSeek Terminal Coding Agent (Rust TUI)",docsUrl:"https://github.com/DeepSeek-TUI/DeepSeek-TUI",configType:"custom",defaultCommand:"deepseek",modelAliases:["deepseek-v4-pro","deepseek-v4-flash","deepseek-chat","deepseek-reasoner"],defaultModels:[{id:"deepseek-v4-pro",name:"DeepSeek V4 Pro",alias:"deepseek-v4-pro"},{id:"deepseek-v4-flash",name:"DeepSeek V4 Flash",alias:"deepseek-v4-flash"},{id:"deepseek-chat",name:"DeepSeek V3 Chat",alias:"deepseek-chat"}],notes:[{type:"info",text:"DeepSeek TUI uses ~/.deepseek/config.toml for configuration. 9Router will update the provider to 'openai' mode with your base_url, api_key, and model."},{type:"warning",text:"Config path: Linux/macOS ~/.deepseek/config.toml • Windows %USERPROFILE%\\.deepseek\\config.toml"}]},jcode:{id:"jcode",name:"jcode",image:"/providers/jcode.png",color:"#FF6B35",description:"High-performance Rust-based coding agent harness",configType:"custom",docsUrl:"https://github.com/1jehuang/jcode",notes:[{type:"info",text:"jcode is a Rust-based coding agent with semantic memory, multi-agent swarms, and extreme performance (27.8 MB RAM, 14ms boot)."},{type:"info",text:"Configure prozygent as an OpenAI-compatible provider to route all jcode requests through prozygent's optimization layer."},{type:"warning",text:"Requires jcode installed. Install via: curl -fsSL https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/install.sh | bash"}],defaultModels:[{id:"claude-opus-4-7",name:"Claude Opus 4.7",alias:"opus",defaultValue:"cc/claude-opus-4-7"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",alias:"sonnet",defaultValue:"cc/claude-sonnet-4-6"},{id:"gpt-5.5",name:"GPT 5.5",alias:"gpt5",defaultValue:"cx/gpt-5.5"},{id:"gemini-3.1-pro",name:"Gemini 3.1 Pro",alias:"gemini",defaultValue:"gemini/gemini-3.1-pro"}]},kimchi:{id:"kimchi",name:"Kimchi",image:"/providers/kimchi.png",color:"#F97316",description:"Kimchi Coding Agent by Cast AI",configType:"custom",settingsFile:"~/.config/kimchi/config.json",notes:[{type:"info",text:"Kimchi is an autonomous coding agent with multi-model orchestration. Configure prozygent as its inference backend."},{type:"info",text:"Kimchi uses OpenAI-compatible endpoints. After setup, prozygent routes all Kimchi requests through your configured providers."},{type:"warning",text:"Requires Kimchi CLI installed. Install via: curl -fsSL https://kimchi.dev/install.sh | bash"}],defaultModels:[{id:"kimi-k2.6",name:"Kimi K2.6",alias:"orchestrator",defaultValue:"kimi-k2.6"},{id:"minimax-m2.7",name:"MiniMax M2.7",alias:"builder",defaultValue:"minimax-m2.7"},{id:"minimax-m3",name:"MiniMax M3",alias:"builder-m3",defaultValue:"minimax-m3"},{id:"nemotron-3-ultra-fp4",name:"Nemotron 3 Ultra FP4",alias:"explorer",defaultValue:"nemotron-3-ultra-fp4"}]},copilot:{id:"copilot",name:"GitHub Copilot",image:"/providers/copilot.png",color:"#1F6FEB",description:"GitHub Copilot BYOK — custom models via chatLanguageModels.json",configType:"custom"}}}};
53
+ }`}},"deepseek-tui":{id:"deepseek-tui",name:"DeepSeek TUI",image:"/providers/deepseek-tui.png",color:"#4D6BFE",description:"DeepSeek Terminal Coding Agent (Rust TUI)",docsUrl:"https://github.com/DeepSeek-TUI/DeepSeek-TUI",configType:"custom",defaultCommand:"deepseek",modelAliases:["deepseek-v4-pro","deepseek-v4-flash","deepseek-chat","deepseek-reasoner"],defaultModels:[{id:"deepseek-v4-pro",name:"DeepSeek V4 Pro",alias:"deepseek-v4-pro"},{id:"deepseek-v4-flash",name:"DeepSeek V4 Flash",alias:"deepseek-v4-flash"},{id:"deepseek-chat",name:"DeepSeek V3 Chat",alias:"deepseek-chat"}],notes:[{type:"info",text:"DeepSeek TUI uses ~/.deepseek/config.toml for configuration. 9Router will update the provider to 'openai' mode with your base_url, api_key, and model."},{type:"warning",text:"Config path: Linux/macOS ~/.deepseek/config.toml • Windows %USERPROFILE%\\.deepseek\\config.toml"}]},jcode:{id:"jcode",name:"jcode",image:"/providers/jcode.png",color:"#FF6B35",description:"High-performance Rust-based coding agent harness",configType:"custom",docsUrl:"https://github.com/1jehuang/jcode",notes:[{type:"info",text:"jcode is a Rust-based coding agent with semantic memory, multi-agent swarms, and extreme performance (27.8 MB RAM, 14ms boot)."},{type:"info",text:"Configure prozygent as an OpenAI-compatible provider to route all jcode requests through prozygent's optimization layer."},{type:"warning",text:"Requires jcode installed. Install via: curl -fsSL https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/install.sh | bash"}],defaultModels:[{id:"claude-opus-4-7",name:"Claude Opus 4.7",alias:"opus",defaultValue:"cc/claude-opus-4-7"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",alias:"sonnet",defaultValue:"cc/claude-sonnet-4-6"},{id:"gpt-5.5",name:"GPT 5.5",alias:"gpt5",defaultValue:"cx/gpt-5.5"},{id:"gemini-3.1-pro",name:"Gemini 3.1 Pro",alias:"gemini",defaultValue:"gemini/gemini-3.1-pro"}]},copilot:{id:"copilot",name:"GitHub Copilot",image:"/providers/copilot.png",color:"#1F6FEB",description:"GitHub Copilot — route VS Code chat models through prozygent",configType:"custom"},kimchi:{id:"kimchi",name:"Kimchi",image:"/providers/kimchi.png",color:"#F97316",description:"Kimchi Coding Agent by Cast AI",configType:"custom",settingsFile:"~/.config/kimchi/config.json",notes:[{type:"info",text:"Kimchi is an autonomous coding agent with multi-model orchestration. Configure prozygent as its inference backend."},{type:"info",text:"Kimchi uses OpenAI-compatible endpoints. After setup, prozygent routes all Kimchi requests through your configured providers."},{type:"warning",text:"Requires Kimchi CLI installed. Install via: curl -fsSL https://kimchi.dev/install.sh | bash"}],defaultModels:[{id:"kimi-k2.6",name:"Kimi K2.6",alias:"orchestrator",defaultValue:"kimi-k2.6"},{id:"minimax-m2.7",name:"MiniMax M2.7",alias:"builder",defaultValue:"minimax-m2.7"},{id:"minimax-m3",name:"MiniMax M3",alias:"builder-m3",defaultValue:"minimax-m3"},{id:"nemotron-3-ultra-fp4",name:"Nemotron 3 Ultra FP4",alias:"explorer",defaultValue:"nemotron-3-ultra-fp4"}]}}}};
@@ -1 +1 @@
1
- "use strict";exports.id=4161,exports.ids=[615,1998,4161],exports.modules={7803:(a,b,c)=>{c.r(b),c.d(b,{debug:()=>f,error:()=>i,info:()=>g,maskKey:()=>m,request:()=>j,response:()=>k,stream:()=>l,warn:()=>h});function d(){return new Date().toLocaleTimeString("en-US",{hour12:!1})}function e(a){if(!a)return"";if("string"==typeof a)return a;try{return JSON.stringify(a)}catch{return String(a)}}function f(a,b,c){!0;{let f=c?` ${e(c)}`:"";console.log(`[${d()}] 🔍 [${a}] ${b}${f}`)}}function g(a,b,c){!0;{let f=c?` ${e(c)}`:"";console.log(`[${d()}] ℹ️ [${a}] ${b}${f}`)}}function h(a,b,c){c&&e(c)}function i(a,b,c){!0;{let f=c?` ${e(c)}`:"";console.log(`[${d()}] ❌ [${a}] ${b}${f}`)}}function j(a,b,c){let f=c?` ${e(c)}`:"";console.log(`\x1b[36m[${d()}] 📥 ${a} ${b}${f}\x1b[0m`)}function k(a,b,c){let f=c?` ${e(c)}`:"";console.log(`[${d()}] ${a<400?"\uD83D\uDCE4":"\uD83D\uDCA5"} ${a} (${b}ms)${f}`)}function l(a,b){let c=b?` ${e(b)}`:"";console.log(`[${d()}] 🌊 [STREAM] ${a}${c}`)}function m(a){return!a||a.length<8?"***":`${a.slice(0,4)}...${a.slice(-4)}`}},19225:(a,b,c)=>{a.exports=c(44870)},39326:(a,b,c)=>{c.d(b,{B:()=>f});var d=c(71998);function e(a){return null==a?"":String(a).trim()}async function f(a={}){try{let b=e(a?.proxyPoolId),c="__none__"===b?"":b,f=function(a={}){let b=a?.connectionProxyEnabled===!0,c=e(a?.connectionProxyUrl);return{connectionProxyEnabled:b,connectionProxyUrl:c,connectionNoProxy:e(a?.connectionNoProxy)}}(a);if(c){let a=await (0,d.hr)(c),b=e(a?.proxyUrl),f=e(a?.noProxy);if(a&&!0===a.isActive&&b){if("vercel"===a.type||"cloudflare"===a.type||"deno"===a.type)return{source:a.type,proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:f,strictProxy:!0===a.strictProxy,vercelRelayUrl:b};return{source:"pool",proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!0,connectionProxyUrl:b,connectionNoProxy:f,strictProxy:!0===a.strictProxy}}}if(f.connectionProxyEnabled&&f.connectionProxyUrl)return{source:"legacy",proxyPoolId:c||null,proxyPool:null,...f};return{source:"none",proxyPoolId:c||null,proxyPool:null,...f}}catch(a){return console.error("[resolveConnectionProxyConfig] Failed to resolve proxy config:",a),{source:"error",proxyPoolId:null,proxyPool:null,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:"",strictProxy:!1}}}},40615:(a,b,c)=>{c.d(b,{AI_PROVIDERS:()=>s,js:()=>w,DI:()=>n,fg:()=>k,Pd:()=>o,IS:()=>h,nJ:()=>i,zN:()=>j,JH:()=>m,jO:()=>y,wb:()=>x,br:()=>l,wG:()=>v,zt:()=>t,gb:()=>q,gC:()=>r,mq:()=>p,rs:()=>u});var d=c(59473);let e="⚠️ Risk Notice: This provider uses a subscription/OAuth session not officially licensed for proxy/router use. Account may be restricted or banned. Use at your own risk.";Object.fromEntries(d.A.filter(a=>a.display).map(a=>{let b;return[a.id,"RISK_NOTICE"===(b=a.display).deprecationNotice?{...b,deprecationNotice:e}:b]}));let f=["serviceKinds","ttsConfig","sttConfig","embeddingConfig","imageConfig","imageToTextConfig","videoConfig","musicConfig","searchViaChat","searchConfig","fetchConfig","modelsFetcher","mediaPriority","hiddenKinds"],g=a=>Object.fromEntries(d.A.filter(b=>b.category===a).map(a=>[a.id,function(a){let b={};for(let c of(a.media&&Object.assign(b,a.media),f))void 0!==a[c]&&(b[c]=a[c]);let c={...a.display||{}};return"RISK_NOTICE"===c.deprecationNotice&&(c.deprecationNotice=e),{...c,id:a.id,alias:a.uiAlias||a.alias,...a.hidden?{hidden:!0}:{},...b,...void 0!==a.priority?{priority:a.priority}:{},...a.hasFree?{hasFree:!0}:{},...a.thinkingConfig?{thinkingConfig:a.thinkingConfig}:{},...a.regions?{regions:a.regions,defaultRegion:a.defaultRegion}:{},...a.hasProviderSpecificData?{hasProviderSpecificData:!0}:{},...a.noAuth?{noAuth:!0}:{},...a.passthroughModels?{passthroughModels:!0}:{},...a.hasOAuth?{hasOAuth:!0}:{},...a.authModes?{authModes:a.authModes}:{},...a.authType?{authType:a.authType}:{},...a.authHint?{authHint:a.authHint}:{}}}(a)])),h=g("free"),i=g("freeTier"),j=g("oauth"),k=g("apikey"),l=g("webCookie"),m="openai-compatible-",n="anthropic-compatible-",o="custom-embedding-";function p(a){return"string"==typeof a&&a.startsWith(m)}function q(a){return"string"==typeof a&&a.startsWith(n)}function r(a){return"string"==typeof a&&a.startsWith(o)}let s={...h,...i,...j,...k,...l};function t(a){for(let b of Object.values(s))if(b.alias===a||b.id===a)return b;return null}function u(a){let b=t(a);return b?.id||a}function v(a){let b=s[a];return b?.alias||a}let w=Object.values(s).reduce((a,b)=>(a[b.alias]=b.id,a),{});Object.values(s).reduce((a,b)=>(a[b.id]=b.alias,a),{});let x=d.A.filter(a=>a.features?.usage).map(a=>a.id),y=d.A.filter(a=>a.features?.usageApikey).map(a=>a.id)},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(89718)},80238:(a,b,c)=>{c.d(b,{Pt:()=>m,Tr:()=>n,c1:()=>k,kI:()=>o,vk:()=>l});var d=c(89718),e=c(39326),f=c(12557),g=c(3662),h=c(40615),i=c(7803);let j=Promise.resolve();async function k(a,b=null,c=null,g={}){let l,m=b instanceof Set?b:b?new Set([b]):new Set,n=g?.preferredConnectionId||null,o=j;j=new Promise(a=>{l=a});try{let b;await o;let g=(0,h.rs)(a);if(h.IS[g]?.noAuth){let a=((await (0,d.mt)()).providerStrategies||{})[g]||{},b=await (0,e.B)({proxyPoolId:a.proxyPoolId||""});return{id:"noauth",connectionName:"Public",isActive:!0,accessToken:"public",providerSpecificData:{connectionProxyEnabled:b.connectionProxyEnabled,connectionProxyUrl:b.connectionProxyUrl,connectionNoProxy:b.connectionNoProxy,connectionProxyPoolId:b.proxyPoolId||null,vercelRelayUrl:b.vercelRelayUrl||""}}}let j=await (0,d.getProviderConnections)({provider:g,isActive:!0});if(i.debug("AUTH",`${a} | total connections: ${j.length}, excludeIds: ${m.size>0?[...m].join(","):"none"}, model: ${c||"any"}`),0===j.length)return i.warn("AUTH",`No credentials for ${a}`),null;let k=j.filter(a=>!(m.has(a.id)||(0,f.Bl)(a,c)));if(i.debug("AUTH",`${a} | available: ${k.length}/${j.length}`),j.forEach(a=>{let b=m.has(a.id),d=(0,f.Bl)(a,c);if(b||d){let e=(0,f.kJ)(a);i.debug("AUTH",` → ${a.id?.slice(0,8)} | ${b?"excluded":""} ${d?`modelLocked(${c}) until ${e}`:""}`)}}),0===k.length){let b=j.filter(a=>(0,f.Bl)(a,c)),d=b.map(a=>(0,f.kJ)(a)).filter(Boolean).sort()[0]||null;if(d){let e=b[0];return i.warn("AUTH",`${a} | all ${j.length} accounts locked for ${c||"all"} (${(0,f.Qo)(d)}) | lastError=${e?.lastError?.slice(0,50)}`),{allRateLimited:!0,retryAfter:d,retryAfterHuman:(0,f.Qo)(d),lastError:e?.lastError||null,lastErrorCode:e?.errorCode||null}}return i.warn("AUTH",`${a} | all ${j.length} accounts unavailable`),null}let l=await (0,d.mt)(),p=(l.providerStrategies||{})[g]||{},q=p.fallbackStrategy||l.fallbackStrategy||"fill-first";if(n&&(b=k.find(a=>a.id===n))&&i.info("AUTH",`${a} | pinned to ${b.id?.slice(0,8)} (${b.name||b.email||"unnamed"})`),b);else if("round-robin"===q){let a=p.stickyRoundRobinLimit||l.stickyRoundRobinLimit||3,c=[...k].sort((a,b)=>a.lastUsedAt||b.lastUsedAt?a.lastUsedAt?b.lastUsedAt?new Date(b.lastUsedAt)-new Date(a.lastUsedAt):-1:1:(a.priority||999)-(b.priority||999))[0],e=c?.consecutiveUseCount||0;c&&c.lastUsedAt&&e<a?(b=c,await (0,d.updateProviderConnection)(b.id,{lastUsedAt:new Date().toISOString(),consecutiveUseCount:(b.consecutiveUseCount||0)+1})):(b=[...k].sort((a,b)=>a.lastUsedAt||b.lastUsedAt?a.lastUsedAt?b.lastUsedAt?new Date(a.lastUsedAt)-new Date(b.lastUsedAt):1:-1:(a.priority||999)-(b.priority||999))[0],await (0,d.updateProviderConnection)(b.id,{lastUsedAt:new Date().toISOString(),consecutiveUseCount:1}))}else b=k[0];let r=await (0,e.B)(b.providerSpecificData||{});return{authType:b.authType,apiKey:b.apiKey,accessToken:b.accessToken,refreshToken:b.refreshToken,idToken:b.idToken,expiresAt:b.expiresAt,expiresIn:b.expiresIn,lastRefreshAt:b.lastRefreshAt,projectId:b.projectId,connectionName:b.displayName||b.name||b.email||b.id,copilotToken:b.providerSpecificData?.copilotToken,providerSpecificData:{...b.providerSpecificData||{},connectionProxyEnabled:r.connectionProxyEnabled,connectionProxyUrl:r.connectionProxyUrl,connectionNoProxy:r.connectionNoProxy,connectionProxyPoolId:r.proxyPoolId||null,vercelRelayUrl:r.vercelRelayUrl||""},connectionId:b.id,testStatus:b.testStatus,lastError:b.lastError,_connection:b}}finally{l&&l()}}async function l(a,b,c,e=null,h=null,j=null){let k,m,n;if(!a||"noauth"===a)return{shouldFallback:!1,cooldownMs:0};let o=(await (0,d.getProviderConnections)({provider:e})).find(b=>b.id===a),p=o?.backoffLevel||0;if(j&&j>Date.now()?(k=!0,m=Math.min(j-Date.now(),g.fh),n=0):{shouldFallback:k,cooldownMs:m,newBackoffLevel:n}=(0,f.hk)(b,c,p),!k)return{shouldFallback:!1,cooldownMs:0};let q="string"==typeof c?c.slice(0,100):"Provider error",r=(0,f.S5)(h,m);await (0,d.updateProviderConnection)(a,{...r,testStatus:"unavailable",lastError:q,errorCode:b,lastErrorAt:new Date().toISOString(),backoffLevel:n??p});let s=Object.keys(r)[0],t=o?.displayName||o?.name||o?.email||a.slice(0,8);return i.warn("AUTH",`${t} locked ${s} for ${Math.round(m/1e3)}s [${b}]`),e&&b&&q&&console.error(`❌ ${e} [${b}]: ${q}`),{shouldFallback:!0,cooldownMs:m}}async function m(a,b,c=null){if(!a||"noauth"===a)return;let e=b._connection||b,f=Date.now(),g=Object.keys(e).filter(a=>a.startsWith("modelLock_"));if(!e.testStatus&&!e.lastError&&0===g.length)return;let h=g.filter(a=>{if(c&&a===`modelLock_${c}`||c&&"modelLock___all"===a)return!0;let b=e[a];return b&&new Date(b).getTime()<=f});if(0===h.length&&"unavailable"!==e.testStatus&&!e.lastError)return;let i=g.filter(a=>{if(h.includes(a))return!1;let b=e[a];return b&&new Date(b).getTime()>f}),j=Object.fromEntries(h.map(a=>[a,null]));0===i.length&&Object.assign(j,{testStatus:"active",lastError:null,lastErrorAt:null,backoffLevel:0}),await (0,d.updateProviderConnection)(a,j)}function n(a){let b=a.headers.get("Authorization");if(b?.startsWith("Bearer "))return b.slice(7);let c=a.headers.get("x-api-key");return c||null}async function o(a){return!!a&&await (0,d.ek)(a)}},92280:(a,b,c)=>{Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},94755:(a,b,c)=>{c.d(b,{A:()=>i});var d=c(77598);let e={randomUUID:d.randomUUID},f=new Uint8Array(256),g=f.length;var h=c(50122);let i=function(a,b,c){if(e.randomUUID&&!b&&!a)return e.randomUUID();var i=a,j=c;let k=(i=i||{}).random??i.rng?.()??(g>f.length-16&&((0,d.randomFillSync)(f),g=0),f.slice(g,g+=16));if(k.length<16)throw Error("Random bytes length must be >= 16");if(k[6]=15&k[6]|64,k[8]=63&k[8]|128,b){if((j=j||0)<0||j+16>b.length)throw RangeError(`UUID byte range ${j}:${j+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[j+a]=k[a];return b}return(0,h.k)(k)}}};
1
+ "use strict";exports.id=4161,exports.ids=[615,1998,4161],exports.modules={7803:(a,b,c)=>{c.r(b),c.d(b,{debug:()=>f,error:()=>i,info:()=>g,maskKey:()=>m,request:()=>j,response:()=>k,stream:()=>l,warn:()=>h});function d(){return new Date().toLocaleTimeString("en-US",{hour12:!1})}function e(a){if(!a)return"";if("string"==typeof a)return a;try{return JSON.stringify(a)}catch{return String(a)}}function f(a,b,c){!0;{let f=c?` ${e(c)}`:"";console.log(`[${d()}] 🔍 [${a}] ${b}${f}`)}}function g(a,b,c){!0;{let f=c?` ${e(c)}`:"";console.log(`[${d()}] ℹ️ [${a}] ${b}${f}`)}}function h(a,b,c){c&&e(c)}function i(a,b,c){!0;{let f=c?` ${e(c)}`:"";console.log(`[${d()}] ❌ [${a}] ${b}${f}`)}}function j(a,b,c){let f=c?` ${e(c)}`:"";console.log(`\x1b[36m[${d()}] 📥 ${a} ${b}${f}\x1b[0m`)}function k(a,b,c){let f=c?` ${e(c)}`:"";console.log(`[${d()}] ${a<400?"\uD83D\uDCE4":"\uD83D\uDCA5"} ${a} (${b}ms)${f}`)}function l(a,b){let c=b?` ${e(b)}`:"";console.log(`[${d()}] 🌊 [STREAM] ${a}${c}`)}function m(a){return!a||a.length<8?"***":`${a.slice(0,4)}...${a.slice(-4)}`}},19225:(a,b,c)=>{a.exports=c(44870)},39326:(a,b,c)=>{c.d(b,{B:()=>f});var d=c(71998);function e(a){return null==a?"":String(a).trim()}async function f(a={}){try{let b=e(a?.proxyPoolId),c="__none__"===b?"":b,f=function(a={}){let b=a?.connectionProxyEnabled===!0,c=e(a?.connectionProxyUrl);return{connectionProxyEnabled:b,connectionProxyUrl:c,connectionNoProxy:e(a?.connectionNoProxy)}}(a);if(c){let a=await (0,d.hr)(c),b=e(a?.proxyUrl),f=e(a?.noProxy);if(a&&!0===a.isActive&&b){if("vercel"===a.type||"cloudflare"===a.type||"deno"===a.type)return{source:a.type,proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:f,strictProxy:!0===a.strictProxy,vercelRelayUrl:b};return{source:"pool",proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!0,connectionProxyUrl:b,connectionNoProxy:f,strictProxy:!0===a.strictProxy}}}if(f.connectionProxyEnabled&&f.connectionProxyUrl)return{source:"legacy",proxyPoolId:c||null,proxyPool:null,...f};return{source:"none",proxyPoolId:c||null,proxyPool:null,...f}}catch(a){return console.error("[resolveConnectionProxyConfig] Failed to resolve proxy config:",a),{source:"error",proxyPoolId:null,proxyPool:null,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:"",strictProxy:!1}}}},40615:(a,b,c)=>{c.d(b,{AI_PROVIDERS:()=>s,js:()=>w,DI:()=>n,fg:()=>k,Pd:()=>o,IS:()=>h,nJ:()=>i,zN:()=>j,JH:()=>m,jO:()=>y,wb:()=>x,br:()=>l,wG:()=>v,zt:()=>t,gb:()=>q,gC:()=>r,mq:()=>p,rs:()=>u});var d=c(94425);let e="⚠️ Risk Notice: This provider uses a subscription/OAuth session not officially licensed for proxy/router use. Account may be restricted or banned. Use at your own risk.";Object.fromEntries(d.A.filter(a=>a.display).map(a=>{let b;return[a.id,"RISK_NOTICE"===(b=a.display).deprecationNotice?{...b,deprecationNotice:e}:b]}));let f=["serviceKinds","ttsConfig","sttConfig","embeddingConfig","imageConfig","imageToTextConfig","videoConfig","musicConfig","searchViaChat","searchConfig","fetchConfig","modelsFetcher","mediaPriority","hiddenKinds"],g=a=>Object.fromEntries(d.A.filter(b=>b.category===a).map(a=>[a.id,function(a){let b={};for(let c of(a.media&&Object.assign(b,a.media),f))void 0!==a[c]&&(b[c]=a[c]);let c={...a.display||{}};return"RISK_NOTICE"===c.deprecationNotice&&(c.deprecationNotice=e),{...c,id:a.id,alias:a.uiAlias||a.alias,...a.hidden?{hidden:!0}:{},...b,...void 0!==a.priority?{priority:a.priority}:{},...a.hasFree?{hasFree:!0}:{},...a.thinkingConfig?{thinkingConfig:a.thinkingConfig}:{},...a.regions?{regions:a.regions,defaultRegion:a.defaultRegion}:{},...a.hasProviderSpecificData?{hasProviderSpecificData:!0}:{},...a.noAuth?{noAuth:!0}:{},...a.passthroughModels?{passthroughModels:!0}:{},...a.hasOAuth?{hasOAuth:!0}:{},...a.authModes?{authModes:a.authModes}:{},...a.authType?{authType:a.authType}:{},...a.authHint?{authHint:a.authHint}:{}}}(a)])),h=g("free"),i=g("freeTier"),j=g("oauth"),k=g("apikey"),l=g("webCookie"),m="openai-compatible-",n="anthropic-compatible-",o="custom-embedding-";function p(a){return"string"==typeof a&&a.startsWith(m)}function q(a){return"string"==typeof a&&a.startsWith(n)}function r(a){return"string"==typeof a&&a.startsWith(o)}let s={...h,...i,...j,...k,...l};function t(a){for(let b of Object.values(s))if(b.alias===a||b.id===a)return b;return null}function u(a){let b=t(a);return b?.id||a}function v(a){let b=s[a];return b?.alias||a}let w=Object.values(s).reduce((a,b)=>(a[b.alias]=b.id,a),{});Object.values(s).reduce((a,b)=>(a[b.id]=b.alias,a),{});let x=d.A.filter(a=>a.features?.usage).map(a=>a.id),y=d.A.filter(a=>a.features?.usageApikey).map(a=>a.id)},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(89718)},80238:(a,b,c)=>{c.d(b,{Pt:()=>m,Tr:()=>n,c1:()=>k,kI:()=>o,vk:()=>l});var d=c(89718),e=c(39326),f=c(12557),g=c(3662),h=c(40615),i=c(7803);let j=Promise.resolve();async function k(a,b=null,c=null,g={}){let l,m=b instanceof Set?b:b?new Set([b]):new Set,n=g?.preferredConnectionId||null,o=j;j=new Promise(a=>{l=a});try{let b;await o;let g=(0,h.rs)(a);if(h.IS[g]?.noAuth){let a=((await (0,d.mt)()).providerStrategies||{})[g]||{},b=await (0,e.B)({proxyPoolId:a.proxyPoolId||""});return{id:"noauth",connectionName:"Public",isActive:!0,accessToken:"public",providerSpecificData:{connectionProxyEnabled:b.connectionProxyEnabled,connectionProxyUrl:b.connectionProxyUrl,connectionNoProxy:b.connectionNoProxy,connectionProxyPoolId:b.proxyPoolId||null,vercelRelayUrl:b.vercelRelayUrl||""}}}let j=await (0,d.getProviderConnections)({provider:g,isActive:!0});if(i.debug("AUTH",`${a} | total connections: ${j.length}, excludeIds: ${m.size>0?[...m].join(","):"none"}, model: ${c||"any"}`),0===j.length)return i.warn("AUTH",`No credentials for ${a}`),null;let k=j.filter(a=>!(m.has(a.id)||(0,f.Bl)(a,c)));if(i.debug("AUTH",`${a} | available: ${k.length}/${j.length}`),j.forEach(a=>{let b=m.has(a.id),d=(0,f.Bl)(a,c);if(b||d){let e=(0,f.kJ)(a);i.debug("AUTH",` → ${a.id?.slice(0,8)} | ${b?"excluded":""} ${d?`modelLocked(${c}) until ${e}`:""}`)}}),0===k.length){let b=j.filter(a=>(0,f.Bl)(a,c)),d=b.map(a=>(0,f.kJ)(a)).filter(Boolean).sort()[0]||null;if(d){let e=b[0];return i.warn("AUTH",`${a} | all ${j.length} accounts locked for ${c||"all"} (${(0,f.Qo)(d)}) | lastError=${e?.lastError?.slice(0,50)}`),{allRateLimited:!0,retryAfter:d,retryAfterHuman:(0,f.Qo)(d),lastError:e?.lastError||null,lastErrorCode:e?.errorCode||null}}return i.warn("AUTH",`${a} | all ${j.length} accounts unavailable`),null}let l=await (0,d.mt)(),p=(l.providerStrategies||{})[g]||{},q=p.fallbackStrategy||l.fallbackStrategy||"fill-first";if(n&&(b=k.find(a=>a.id===n))&&i.info("AUTH",`${a} | pinned to ${b.id?.slice(0,8)} (${b.name||b.email||"unnamed"})`),b);else if("round-robin"===q){let a=p.stickyRoundRobinLimit||l.stickyRoundRobinLimit||3,c=[...k].sort((a,b)=>a.lastUsedAt||b.lastUsedAt?a.lastUsedAt?b.lastUsedAt?new Date(b.lastUsedAt)-new Date(a.lastUsedAt):-1:1:(a.priority||999)-(b.priority||999))[0],e=c?.consecutiveUseCount||0;c&&c.lastUsedAt&&e<a?(b=c,await (0,d.updateProviderConnection)(b.id,{lastUsedAt:new Date().toISOString(),consecutiveUseCount:(b.consecutiveUseCount||0)+1})):(b=[...k].sort((a,b)=>a.lastUsedAt||b.lastUsedAt?a.lastUsedAt?b.lastUsedAt?new Date(a.lastUsedAt)-new Date(b.lastUsedAt):1:-1:(a.priority||999)-(b.priority||999))[0],await (0,d.updateProviderConnection)(b.id,{lastUsedAt:new Date().toISOString(),consecutiveUseCount:1}))}else b=k[0];let r=await (0,e.B)(b.providerSpecificData||{});return{authType:b.authType,apiKey:b.apiKey,accessToken:b.accessToken,refreshToken:b.refreshToken,idToken:b.idToken,expiresAt:b.expiresAt,expiresIn:b.expiresIn,lastRefreshAt:b.lastRefreshAt,projectId:b.projectId,connectionName:b.displayName||b.name||b.email||b.id,copilotToken:b.providerSpecificData?.copilotToken,providerSpecificData:{...b.providerSpecificData||{},connectionProxyEnabled:r.connectionProxyEnabled,connectionProxyUrl:r.connectionProxyUrl,connectionNoProxy:r.connectionNoProxy,connectionProxyPoolId:r.proxyPoolId||null,vercelRelayUrl:r.vercelRelayUrl||""},connectionId:b.id,testStatus:b.testStatus,lastError:b.lastError,_connection:b}}finally{l&&l()}}async function l(a,b,c,e=null,h=null,j=null){let k,m,n;if(!a||"noauth"===a)return{shouldFallback:!1,cooldownMs:0};let o=(await (0,d.getProviderConnections)({provider:e})).find(b=>b.id===a),p=o?.backoffLevel||0;if(j&&j>Date.now()?(k=!0,m=Math.min(j-Date.now(),g.fh),n=0):{shouldFallback:k,cooldownMs:m,newBackoffLevel:n}=(0,f.hk)(b,c,p),!k)return{shouldFallback:!1,cooldownMs:0};let q="string"==typeof c?c.slice(0,100):"Provider error",r=(0,f.S5)(h,m);await (0,d.updateProviderConnection)(a,{...r,testStatus:"unavailable",lastError:q,errorCode:b,lastErrorAt:new Date().toISOString(),backoffLevel:n??p});let s=Object.keys(r)[0],t=o?.displayName||o?.name||o?.email||a.slice(0,8);return i.warn("AUTH",`${t} locked ${s} for ${Math.round(m/1e3)}s [${b}]`),e&&b&&q&&console.error(`❌ ${e} [${b}]: ${q}`),{shouldFallback:!0,cooldownMs:m}}async function m(a,b,c=null){if(!a||"noauth"===a)return;let e=b._connection||b,f=Date.now(),g=Object.keys(e).filter(a=>a.startsWith("modelLock_"));if(!e.testStatus&&!e.lastError&&0===g.length)return;let h=g.filter(a=>{if(c&&a===`modelLock_${c}`||c&&"modelLock___all"===a)return!0;let b=e[a];return b&&new Date(b).getTime()<=f});if(0===h.length&&"unavailable"!==e.testStatus&&!e.lastError)return;let i=g.filter(a=>{if(h.includes(a))return!1;let b=e[a];return b&&new Date(b).getTime()>f}),j=Object.fromEntries(h.map(a=>[a,null]));0===i.length&&Object.assign(j,{testStatus:"active",lastError:null,lastErrorAt:null,backoffLevel:0}),await (0,d.updateProviderConnection)(a,j)}function n(a){let b=a.headers.get("Authorization");if(b?.startsWith("Bearer "))return b.slice(7);let c=a.headers.get("x-api-key");return c||null}async function o(a){return!!a&&await (0,d.ek)(a)}},92280:(a,b,c)=>{Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},94755:(a,b,c)=>{c.d(b,{A:()=>i});var d=c(77598);let e={randomUUID:d.randomUUID},f=new Uint8Array(256),g=f.length;var h=c(50122);let i=function(a,b,c){if(e.randomUUID&&!b&&!a)return e.randomUUID();var i=a,j=c;let k=(i=i||{}).random??i.rng?.()??(g>f.length-16&&((0,d.randomFillSync)(f),g=0),f.slice(g,g+=16));if(k.length<16)throw Error("Random bytes length must be >= 16");if(k[6]=15&k[6]|64,k[8]=63&k[8]|128,b){if((j=j||0)<0||j+16>b.length)throw RangeError(`UUID byte range ${j}:${j+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[j+a]=k[a];return b}return(0,h.k)(k)}}};