n9router 0.4.63 → 0.4.65

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 (545) hide show
  1. package/app/.next/BUILD_ID +1 -1
  2. package/app/.next/app-path-routes-manifest.json +20 -20
  3. package/app/.next/build-manifest.json +2 -2
  4. package/app/.next/prerender-manifest.json +27 -27
  5. package/app/.next/required-server-files.json +5 -1
  6. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  7. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  8. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  9. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  10. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  11. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  12. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  13. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  14. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  15. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  16. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  17. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  18. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  19. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  20. package/app/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  21. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  22. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  23. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  24. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  26. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  27. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  28. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  29. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  30. package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  31. package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  32. package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  33. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  34. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  35. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  36. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  37. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  38. package/app/.next/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  39. package/app/.next/server/app/(dashboard)/dashboard/page.js +1 -1
  40. package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  41. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  42. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  43. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  44. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  45. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  46. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  47. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  48. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  49. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  50. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  51. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  52. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  53. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  54. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  55. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  56. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  57. package/app/.next/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  58. package/app/.next/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  59. package/app/.next/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  60. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  61. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  62. package/app/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  63. package/app/.next/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  64. package/app/.next/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  65. package/app/.next/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  66. package/app/.next/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  67. package/app/.next/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  68. package/app/.next/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  69. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  70. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  71. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  72. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  73. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  74. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  75. package/app/.next/server/app/_global-error/page.js.nft.json +1 -1
  76. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  77. package/app/.next/server/app/_global-error.html +1 -1
  78. package/app/.next/server/app/_global-error.rsc +1 -1
  79. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  80. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  81. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  82. package/app/.next/server/app/_not-found/page.js +1 -1
  83. package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
  84. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  85. package/app/.next/server/app/_not-found.html +1 -1
  86. package/app/.next/server/app/_not-found.rsc +2 -2
  87. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  88. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  89. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  90. package/app/.next/server/app/api/antigravity-app/route.js.nft.json +1 -1
  91. package/app/.next/server/app/api/antigravity-app-v2/route.js.nft.json +1 -1
  92. package/app/.next/server/app/api/antigravity-ide/route.js.nft.json +1 -1
  93. package/app/.next/server/app/api/antigravity-targets/route.js.nft.json +1 -1
  94. package/app/.next/server/app/api/antigravity-tools/import/route.js +1 -1
  95. package/app/.next/server/app/api/antigravity-tools/import/route.js.nft.json +1 -1
  96. package/app/.next/server/app/api/antigravity-tools/import-refresh-tokens/route.js +1 -1
  97. package/app/.next/server/app/api/antigravity-tools/import-refresh-tokens/route.js.nft.json +1 -1
  98. package/app/.next/server/app/api/auth/login/route.js.nft.json +1 -1
  99. package/app/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
  100. package/app/.next/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  101. package/app/.next/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  102. package/app/.next/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  103. package/app/.next/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  104. package/app/.next/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  105. package/app/.next/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  106. package/app/.next/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  107. package/app/.next/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  108. package/app/.next/server/app/api/auth/status/route.js.nft.json +1 -1
  109. package/app/.next/server/app/api/cli-tools/all-statuses/route.js +5 -5
  110. package/app/.next/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  111. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
  112. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  113. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  114. package/app/.next/server/app/api/cli-tools/claude-settings/route.js +2 -2
  115. package/app/.next/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  116. package/app/.next/server/app/api/cli-tools/cline-settings/route.js +1 -1
  117. package/app/.next/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  118. package/app/.next/server/app/api/cli-tools/codewhale-settings/route.js +1 -1
  119. package/app/.next/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
  120. package/app/.next/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
  121. package/app/.next/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  122. package/app/.next/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  123. package/app/.next/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  124. package/app/.next/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  125. package/app/.next/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  126. package/app/.next/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  127. package/app/.next/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  128. package/app/.next/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  129. package/app/.next/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  130. package/app/.next/server/app/api/cli-tools/crush-settings/route.js +2 -2
  131. package/app/.next/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
  132. package/app/.next/server/app/api/cli-tools/cursor-byok/jobs/[jobId]/events/route.js.nft.json +1 -1
  133. package/app/.next/server/app/api/cli-tools/cursor-byok/jobs/[jobId]/sudo/route.js.nft.json +1 -1
  134. package/app/.next/server/app/api/cli-tools/cursor-byok/jobs/route.js.nft.json +1 -1
  135. package/app/.next/server/app/api/cli-tools/cursor-byok/route.js.nft.json +1 -1
  136. package/app/.next/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  137. package/app/.next/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  138. package/app/.next/server/app/api/cli-tools/devin-settings/route.js +1 -1
  139. package/app/.next/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  140. package/app/.next/server/app/api/cli-tools/droid-settings/route.js +1 -1
  141. package/app/.next/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  142. package/app/.next/server/app/api/cli-tools/forge-settings/route.js +1 -1
  143. package/app/.next/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
  144. package/app/.next/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
  145. package/app/.next/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  146. package/app/.next/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +1 -1
  147. package/app/.next/server/app/api/cli-tools/hermes-settings/route.js +1 -1
  148. package/app/.next/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  149. package/app/.next/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  150. package/app/.next/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  151. package/app/.next/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  152. package/app/.next/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  153. package/app/.next/server/app/api/cli-tools/omp-settings/route.js +2 -2
  154. package/app/.next/server/app/api/cli-tools/omp-settings/route.js.nft.json +1 -1
  155. package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  156. package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  157. package/app/.next/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  158. package/app/.next/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  159. package/app/.next/server/app/api/cli-tools/pi-settings/route.js +2 -2
  160. package/app/.next/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
  161. package/app/.next/server/app/api/cli-tools/smelt-settings/route.js +1 -1
  162. package/app/.next/server/app/api/cli-tools/smelt-settings/route.js.nft.json +1 -1
  163. package/app/.next/server/app/api/combos/[id]/route.js.nft.json +1 -1
  164. package/app/.next/server/app/api/combos/presets/route.js.nft.json +1 -1
  165. package/app/.next/server/app/api/combos/route.js.nft.json +1 -1
  166. package/app/.next/server/app/api/donate/route.js.nft.json +1 -1
  167. package/app/.next/server/app/api/headroom/extras/route.js.nft.json +1 -1
  168. package/app/.next/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  169. package/app/.next/server/app/api/headroom/restart/route.js.nft.json +1 -1
  170. package/app/.next/server/app/api/headroom/start/route.js.nft.json +1 -1
  171. package/app/.next/server/app/api/headroom/status/route.js.nft.json +1 -1
  172. package/app/.next/server/app/api/headroom/stop/route.js.nft.json +1 -1
  173. package/app/.next/server/app/api/health/route.js.nft.json +1 -1
  174. package/app/.next/server/app/api/init/route.js.nft.json +1 -1
  175. package/app/.next/server/app/api/internal/account-health/route.js.nft.json +1 -1
  176. package/app/.next/server/app/api/internal/request-detail/route.js +1 -1
  177. package/app/.next/server/app/api/internal/request-detail/route.js.nft.json +1 -1
  178. package/app/.next/server/app/api/internal/usage/route.js +1 -1
  179. package/app/.next/server/app/api/internal/usage/route.js.nft.json +1 -1
  180. package/app/.next/server/app/api/keys/[id]/reset-usage/route.js +1 -1
  181. package/app/.next/server/app/api/keys/[id]/reset-usage/route.js.nft.json +1 -1
  182. package/app/.next/server/app/api/keys/[id]/route.js +1 -1
  183. package/app/.next/server/app/api/keys/[id]/route.js.nft.json +1 -1
  184. package/app/.next/server/app/api/keys/[id]/usage/route.js +1 -1
  185. package/app/.next/server/app/api/keys/[id]/usage/route.js.nft.json +1 -1
  186. package/app/.next/server/app/api/keys/route.js.nft.json +1 -1
  187. package/app/.next/server/app/api/locale/route.js.nft.json +1 -1
  188. package/app/.next/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  189. package/app/.next/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  190. package/app/.next/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  191. package/app/.next/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  192. package/app/.next/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  193. package/app/.next/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  194. package/app/.next/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  195. package/app/.next/server/app/api/models/alias/route.js.nft.json +1 -1
  196. package/app/.next/server/app/api/models/availability/route.js.nft.json +1 -1
  197. package/app/.next/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
  198. package/app/.next/server/app/api/models/custom/route.js.nft.json +1 -1
  199. package/app/.next/server/app/api/models/disabled/route.js.nft.json +1 -1
  200. package/app/.next/server/app/api/models/route.js.nft.json +1 -1
  201. package/app/.next/server/app/api/models/test/route.js.nft.json +1 -1
  202. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  203. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  204. package/app/.next/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  205. package/app/.next/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  206. package/app/.next/server/app/api/oauth/codex/import-token/route.js +1 -1
  207. package/app/.next/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  208. package/app/.next/server/app/api/oauth/commandcode/auto-import/route.js.nft.json +1 -1
  209. package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  210. package/app/.next/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  211. package/app/.next/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  212. package/app/.next/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  213. package/app/.next/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  214. package/app/.next/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  215. package/app/.next/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  216. package/app/.next/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  217. package/app/.next/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  218. package/app/.next/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  219. package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  220. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  221. package/app/.next/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  222. package/app/.next/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +2 -2
  223. package/app/.next/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  224. package/app/.next/server/app/api/oauth/xiaomi-mimo/login/start/route.js +1 -1
  225. package/app/.next/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
  226. package/app/.next/server/app/api/oauth/xiaomi-mimo/login/status/route.js +1 -1
  227. package/app/.next/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
  228. package/app/.next/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  229. package/app/.next/server/app/api/oauth/zed/import/route.js +1 -1
  230. package/app/.next/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  231. package/app/.next/server/app/api/pricing/route.js.nft.json +1 -1
  232. package/app/.next/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  233. package/app/.next/server/app/api/provider-nodes/route.js.nft.json +1 -1
  234. package/app/.next/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  235. package/app/.next/server/app/api/providers/[id]/models/route.js +1 -1
  236. package/app/.next/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  237. package/app/.next/server/app/api/providers/[id]/overrides/route.js.nft.json +1 -1
  238. package/app/.next/server/app/api/providers/[id]/route.js.nft.json +1 -1
  239. package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
  240. package/app/.next/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  241. package/app/.next/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  242. package/app/.next/server/app/api/providers/client/route.js +1 -1
  243. package/app/.next/server/app/api/providers/client/route.js.nft.json +1 -1
  244. package/app/.next/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  245. package/app/.next/server/app/api/providers/route.js.nft.json +1 -1
  246. package/app/.next/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  247. package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
  248. package/app/.next/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  249. package/app/.next/server/app/api/providers/validate/route.js +1 -1
  250. package/app/.next/server/app/api/providers/validate/route.js.nft.json +1 -1
  251. package/app/.next/server/app/api/providers/web-login/route.js +1 -1
  252. package/app/.next/server/app/api/providers/web-login/route.js.nft.json +1 -1
  253. package/app/.next/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  254. package/app/.next/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  255. package/app/.next/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  256. package/app/.next/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  257. package/app/.next/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  258. package/app/.next/server/app/api/proxy-pools/netlify-deploy/route.js.nft.json +1 -1
  259. package/app/.next/server/app/api/proxy-pools/route.js.nft.json +1 -1
  260. package/app/.next/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  261. package/app/.next/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  262. package/app/.next/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  263. package/app/.next/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  264. package/app/.next/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  265. package/app/.next/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  266. package/app/.next/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  267. package/app/.next/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  268. package/app/.next/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  269. package/app/.next/server/app/api/settings/database/route.js.nft.json +1 -1
  270. package/app/.next/server/app/api/settings/database/selective/route.js.nft.json +1 -1
  271. package/app/.next/server/app/api/settings/proxy-test/route.js +1 -1
  272. package/app/.next/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  273. package/app/.next/server/app/api/settings/require-login/route.js.nft.json +1 -1
  274. package/app/.next/server/app/api/settings/route.js +1 -1
  275. package/app/.next/server/app/api/settings/route.js.nft.json +1 -1
  276. package/app/.next/server/app/api/shutdown/route.js.nft.json +1 -1
  277. package/app/.next/server/app/api/tags/route.js.nft.json +1 -1
  278. package/app/.next/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  279. package/app/.next/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  280. package/app/.next/server/app/api/translator/load/route.js.nft.json +1 -1
  281. package/app/.next/server/app/api/translator/save/route.js.nft.json +1 -1
  282. package/app/.next/server/app/api/translator/send/route.js +1 -1
  283. package/app/.next/server/app/api/translator/send/route.js.nft.json +1 -1
  284. package/app/.next/server/app/api/translator/translate/route.js +1 -1
  285. package/app/.next/server/app/api/translator/translate/route.js.nft.json +1 -1
  286. package/app/.next/server/app/api/tunnel/disable/route.js +1 -1
  287. package/app/.next/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  288. package/app/.next/server/app/api/tunnel/enable/route.js +1 -1
  289. package/app/.next/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  290. package/app/.next/server/app/api/tunnel/status/route.js.nft.json +1 -1
  291. package/app/.next/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  292. package/app/.next/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  293. package/app/.next/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  294. package/app/.next/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  295. package/app/.next/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  296. package/app/.next/server/app/api/tunnel/tailscale-install/route.js +2 -2
  297. package/app/.next/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  298. package/app/.next/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
  299. package/app/.next/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
  300. package/app/.next/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  301. package/app/.next/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  302. package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  303. package/app/.next/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  304. package/app/.next/server/app/api/usage/chart/route.js +1 -1
  305. package/app/.next/server/app/api/usage/chart/route.js.nft.json +1 -1
  306. package/app/.next/server/app/api/usage/history/route.js +1 -1
  307. package/app/.next/server/app/api/usage/history/route.js.nft.json +1 -1
  308. package/app/.next/server/app/api/usage/logs/route.js +1 -1
  309. package/app/.next/server/app/api/usage/logs/route.js.nft.json +1 -1
  310. package/app/.next/server/app/api/usage/providers/route.js.nft.json +1 -1
  311. package/app/.next/server/app/api/usage/report/route.js +1 -1
  312. package/app/.next/server/app/api/usage/report/route.js.nft.json +1 -1
  313. package/app/.next/server/app/api/usage/request-details/route.js +1 -1
  314. package/app/.next/server/app/api/usage/request-details/route.js.nft.json +1 -1
  315. package/app/.next/server/app/api/usage/request-logs/route.js +1 -1
  316. package/app/.next/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  317. package/app/.next/server/app/api/usage/stats/route.js +1 -1
  318. package/app/.next/server/app/api/usage/stats/route.js.nft.json +1 -1
  319. package/app/.next/server/app/api/usage/stream/route.js +1 -1
  320. package/app/.next/server/app/api/usage/stream/route.js.nft.json +1 -1
  321. package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
  322. package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  323. package/app/.next/server/app/api/v1/audio/speech/route.js +1 -1
  324. package/app/.next/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  325. package/app/.next/server/app/api/v1/audio/transcriptions/route.js +1 -1
  326. package/app/.next/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  327. package/app/.next/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  328. package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
  329. package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  330. package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
  331. package/app/.next/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  332. package/app/.next/server/app/api/v1/images/generations/route.js +1 -1
  333. package/app/.next/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  334. package/app/.next/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  335. package/app/.next/server/app/api/v1/messages/route.js +1 -1
  336. package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
  337. package/app/.next/server/app/api/v1/models/[...model]/route.js +1 -1
  338. package/app/.next/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
  339. package/app/.next/server/app/api/v1/models/info/route.js.nft.json +1 -1
  340. package/app/.next/server/app/api/v1/models/route.js +1 -1
  341. package/app/.next/server/app/api/v1/models/route.js.nft.json +1 -1
  342. package/app/.next/server/app/api/v1/responses/compact/route.js +1 -1
  343. package/app/.next/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  344. package/app/.next/server/app/api/v1/responses/route.js +1 -1
  345. package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
  346. package/app/.next/server/app/api/v1/route.js +1 -1
  347. package/app/.next/server/app/api/v1/route.js.nft.json +1 -1
  348. package/app/.next/server/app/api/v1/search/route.js +1 -1
  349. package/app/.next/server/app/api/v1/search/route.js.nft.json +1 -1
  350. package/app/.next/server/app/api/v1/systemone/route.js +1 -1
  351. package/app/.next/server/app/api/v1/systemone/route.js.nft.json +1 -1
  352. package/app/.next/server/app/api/v1/videos/[id]/route.js +1 -1
  353. package/app/.next/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  354. package/app/.next/server/app/api/v1/videos/edits/route.js +1 -1
  355. package/app/.next/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  356. package/app/.next/server/app/api/v1/videos/extensions/route.js +1 -1
  357. package/app/.next/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  358. package/app/.next/server/app/api/v1/videos/generations/route.js +1 -1
  359. package/app/.next/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  360. package/app/.next/server/app/api/v1/web/fetch/route.js +1 -1
  361. package/app/.next/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  362. package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
  363. package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  364. package/app/.next/server/app/api/v1beta/models/route.js.nft.json +1 -1
  365. package/app/.next/server/app/api/version/route.js +1 -1
  366. package/app/.next/server/app/api/version/route.js.nft.json +1 -1
  367. package/app/.next/server/app/api/version/shutdown/route.js.nft.json +1 -1
  368. package/app/.next/server/app/api/version/update/route.js.nft.json +1 -1
  369. package/app/.next/server/app/callback/page.js +1 -1
  370. package/app/.next/server/app/callback/page.js.nft.json +1 -1
  371. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  372. package/app/.next/server/app/callback.html +1 -1
  373. package/app/.next/server/app/callback.rsc +2 -2
  374. package/app/.next/server/app/callback.segments/_full.segment.rsc +2 -2
  375. package/app/.next/server/app/callback.segments/_tree.segment.rsc +1 -1
  376. package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +2 -2
  377. package/app/.next/server/app/dashboard/basic-chat.html +1 -1
  378. package/app/.next/server/app/dashboard/basic-chat.rsc +2 -2
  379. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  380. package/app/.next/server/app/dashboard/basic-chat.segments/_full.segment.rsc +2 -2
  381. package/app/.next/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  382. package/app/.next/server/app/dashboard/cli-tools.html +1 -1
  383. package/app/.next/server/app/dashboard/cli-tools.rsc +2 -2
  384. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  385. package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +2 -2
  386. package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  387. package/app/.next/server/app/dashboard/combos.html +1 -1
  388. package/app/.next/server/app/dashboard/combos.rsc +2 -2
  389. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  390. package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +2 -2
  391. package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  392. package/app/.next/server/app/dashboard/endpoint.html +1 -1
  393. package/app/.next/server/app/dashboard/endpoint.rsc +2 -2
  394. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  395. package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +2 -2
  396. package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  397. package/app/.next/server/app/dashboard/media-providers/web.html +1 -1
  398. package/app/.next/server/app/dashboard/media-providers/web.rsc +2 -2
  399. package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  400. package/app/.next/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +2 -2
  401. package/app/.next/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  402. package/app/.next/server/app/dashboard/mitm.html +1 -1
  403. package/app/.next/server/app/dashboard/mitm.rsc +2 -2
  404. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  405. package/app/.next/server/app/dashboard/mitm.segments/_full.segment.rsc +2 -2
  406. package/app/.next/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  407. package/app/.next/server/app/dashboard/profile.html +1 -1
  408. package/app/.next/server/app/dashboard/profile.rsc +2 -2
  409. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  410. package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +2 -2
  411. package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  412. package/app/.next/server/app/dashboard/providers/new.html +1 -1
  413. package/app/.next/server/app/dashboard/providers/new.rsc +2 -2
  414. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  415. package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +2 -2
  416. package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  417. package/app/.next/server/app/dashboard/providers.html +1 -1
  418. package/app/.next/server/app/dashboard/providers.rsc +2 -2
  419. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  420. package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +2 -2
  421. package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  422. package/app/.next/server/app/dashboard/proxy-pools.html +1 -1
  423. package/app/.next/server/app/dashboard/proxy-pools.rsc +2 -2
  424. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  425. package/app/.next/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +2 -2
  426. package/app/.next/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  427. package/app/.next/server/app/dashboard/pxpipe.html +1 -1
  428. package/app/.next/server/app/dashboard/pxpipe.rsc +2 -2
  429. package/app/.next/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  430. package/app/.next/server/app/dashboard/pxpipe.segments/_full.segment.rsc +2 -2
  431. package/app/.next/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  432. package/app/.next/server/app/dashboard/quota.html +1 -1
  433. package/app/.next/server/app/dashboard/quota.rsc +2 -2
  434. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +2 -2
  435. package/app/.next/server/app/dashboard/quota.segments/_full.segment.rsc +2 -2
  436. package/app/.next/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  437. package/app/.next/server/app/dashboard/settings/pricing/page.js +1 -1
  438. package/app/.next/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  439. package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  440. package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
  441. package/app/.next/server/app/dashboard/settings/pricing.rsc +2 -2
  442. package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +2 -2
  443. package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  444. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
  445. package/app/.next/server/app/dashboard/skills.html +1 -1
  446. package/app/.next/server/app/dashboard/skills.rsc +2 -2
  447. package/app/.next/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  448. package/app/.next/server/app/dashboard/skills.segments/_full.segment.rsc +2 -2
  449. package/app/.next/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  450. package/app/.next/server/app/dashboard/token-saver.html +1 -1
  451. package/app/.next/server/app/dashboard/token-saver.rsc +2 -2
  452. package/app/.next/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  453. package/app/.next/server/app/dashboard/token-saver.segments/_full.segment.rsc +2 -2
  454. package/app/.next/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  455. package/app/.next/server/app/dashboard/translator.html +1 -1
  456. package/app/.next/server/app/dashboard/translator.rsc +2 -2
  457. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  458. package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +2 -2
  459. package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  460. package/app/.next/server/app/dashboard/usage.html +1 -1
  461. package/app/.next/server/app/dashboard/usage.rsc +2 -2
  462. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  463. package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +2 -2
  464. package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  465. package/app/.next/server/app/dashboard.html +1 -1
  466. package/app/.next/server/app/dashboard.rsc +2 -2
  467. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  468. package/app/.next/server/app/dashboard.segments/_full.segment.rsc +2 -2
  469. package/app/.next/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  470. package/app/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  471. package/app/.next/server/app/index.html +1 -1
  472. package/app/.next/server/app/index.rsc +2 -2
  473. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  474. package/app/.next/server/app/index.segments/_full.segment.rsc +2 -2
  475. package/app/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  476. package/app/.next/server/app/landing/page.js +1 -1
  477. package/app/.next/server/app/landing/page.js.nft.json +1 -1
  478. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  479. package/app/.next/server/app/landing.html +1 -1
  480. package/app/.next/server/app/landing.rsc +2 -2
  481. package/app/.next/server/app/landing.segments/_full.segment.rsc +2 -2
  482. package/app/.next/server/app/landing.segments/_tree.segment.rsc +1 -1
  483. package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  484. package/app/.next/server/app/login/page.js +1 -1
  485. package/app/.next/server/app/login/page.js.nft.json +1 -1
  486. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  487. package/app/.next/server/app/login.html +1 -1
  488. package/app/.next/server/app/login.rsc +2 -2
  489. package/app/.next/server/app/login.segments/_full.segment.rsc +2 -2
  490. package/app/.next/server/app/login.segments/_tree.segment.rsc +1 -1
  491. package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  492. package/app/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  493. package/app/.next/server/app/page.js +1 -1
  494. package/app/.next/server/app/page.js.nft.json +1 -1
  495. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  496. package/app/.next/server/app-paths-manifest.json +20 -20
  497. package/app/.next/server/chunks/1051.js +1 -1
  498. package/app/.next/server/chunks/1297.js +1 -1
  499. package/app/.next/server/chunks/1350.js +1 -1
  500. package/app/.next/server/chunks/1505.js +1 -1
  501. package/app/.next/server/chunks/4334.js +1 -1
  502. package/app/.next/server/chunks/5330.js +1 -1
  503. package/app/.next/server/chunks/5520.js +1 -1
  504. package/app/.next/server/chunks/574.js +1 -1
  505. package/app/.next/server/chunks/6297.js +1 -1
  506. package/app/.next/server/chunks/7373.js +2 -2
  507. package/app/.next/server/chunks/7525.js +1 -1
  508. package/app/.next/server/chunks/7774.js +2 -2
  509. package/app/.next/server/chunks/7995.js +2 -2
  510. package/app/.next/server/chunks/8467.js +1 -1
  511. package/app/.next/server/chunks/869.js +1 -1
  512. package/app/.next/server/chunks/9819.js +2 -2
  513. package/app/.next/server/chunks/9889.js +1 -1
  514. package/app/.next/server/middleware-build-manifest.js +1 -1
  515. package/app/.next/server/middleware.js +3 -3
  516. package/app/.next/server/pages/404.html +1 -1
  517. package/app/.next/server/pages/500.html +1 -1
  518. package/app/.next/server/preview-props.json +3 -3
  519. package/app/.next/server/server-reference-manifest.js +1 -1
  520. package/app/.next/server/server-reference-manifest.json +1 -1
  521. package/app/.next/static/chunks/{1321-59ad1a50ce10d9fa.js → 1321-d27fdabccc7c8db1.js} +1 -1
  522. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-50da140812e2c8ab.js → page-118c90b3a74f35e8.js} +1 -1
  523. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-7f4cf15089a43031.js → page-310c475a29336f25.js} +1 -1
  524. package/app/open-sse/handlers/systemoneCore.js +4 -3
  525. package/app/open-sse/translator/formats/openai.js +3 -2
  526. package/app/package.json +1 -1
  527. package/app/server.js +1 -1
  528. package/app/src/shared/constants/cliTools.js +637 -0
  529. package/app/src/shared/constants/colors.js +77 -0
  530. package/app/src/shared/constants/config.js +109 -0
  531. package/app/src/shared/constants/coworkPlugins.js +72 -0
  532. package/app/src/shared/constants/index.js +4 -0
  533. package/app/src/shared/constants/keyAccess.js +24 -0
  534. package/app/src/shared/constants/locales.js +38 -0
  535. package/app/src/shared/constants/mitmToolHosts.js +12 -0
  536. package/app/src/shared/constants/models.js +67 -0
  537. package/app/src/shared/constants/monaco.js +7 -0
  538. package/app/src/shared/constants/providers.js +168 -0
  539. package/app/src/shared/constants/providersDisplay.js +12 -0
  540. package/app/src/shared/constants/skills.js +85 -0
  541. package/app/src/shared/constants/ttsProviders.js +172 -0
  542. package/package.json +1 -1
  543. /package/app/.next/static/{csQnh_24N6xB5-kHxlTYo → S3oFaxLaFfMwLvf7CPdyV}/_buildManifest.js +0 -0
  544. /package/app/.next/static/{csQnh_24N6xB5-kHxlTYo → S3oFaxLaFfMwLvf7CPdyV}/_ssgManifest.js +0 -0
  545. /package/app/{lib → src/lib}/dbFileSafety.js +0 -0
@@ -1,4 +1,4 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[182],{1943:(e,t,s)=>{Promise.resolve().then(s.bind(s,41095))},5539:(e,t,s)=>{"use strict";s.d(t,{A:()=>m,w:()=>d});var a=s(95155),r=s(12115),l=s(14051),o=s.n(l),n=s(35497),i=s(73006);let d=new Set(["grok-web","chatgpt-web","gemini-web","muse-web","deepseek-web","uc-web"]),c={default:"person",grok:"bolt",work:"work",personal:"home"},u=[{key:"opening",label:"Opening browser window",icon:"open_in_new"},{key:"waiting",label:"Waiting for you to log in",icon:"hourglass_top"},{key:"saving",label:"Saving connection",icon:"save"}];function m({providerId:e,onConnected:t,size:s="sm"}){let[l,o]=(0,r.useState)(!1),[d,p]=(0,r.useState)("idle"),[x,h]=(0,r.useState)(""),[b,g]=(0,r.useState)(["default"]),[f,y]=(0,r.useState)("default"),v=(0,r.useRef)(null),j=(0,r.useRef)(null),w=(0,r.useCallback)(()=>{v.current&&(clearInterval(v.current),v.current=null)},[]);(0,r.useEffect)(()=>()=>{w(),j.current&&clearTimeout(j.current)},[w]),(0,r.useEffect)(()=>{if(!l)return;let t=!1;return fetch("/api/providers/web-login",{cache:"no-store"}).then(e=>e.json()).then(s=>{if(t||!Array.isArray(s.profiles))return;let a=window.localStorage.getItem(`weblogin:profile:${e}`),r=s.profiles.includes("default")?s.profiles:["default",...s.profiles];g(r),y(a&&r.includes(a)?a:"default")}).catch(()=>{}),()=>{t=!0}},[l,e]);let N=(0,r.useCallback)(t=>{y(t),window.localStorage.setItem(`weblogin:profile:${e}`,t)},[e]),k="opening"===d||"waiting"===d,C=(0,r.useCallback)(()=>{k||(w(),o(!1),"error"===d&&(p("idle"),h("")))},[k,d,w]),S=(0,r.useCallback)(()=>{w(),v.current=setInterval(async()=>{try{let s=await fetch(`/api/providers/web-login?provider=${encodeURIComponent(e)}`,{cache:"no-store"}),a=await s.json();"success"===a.status?(w(),p("success"),h(a.email?`${(0,i.Tl)("Signed in as")} ${a.email}`:"Connection saved"),"function"==typeof t&&t(),j.current=setTimeout(()=>{o(!1),h("")},1500)):"error"===a.status||"timeout"===a.status||"cancelled"===a.status?(w(),p("error"),h(a.error||(0,i.Tl)("Login failed"))):p(e=>"opening"===e?"waiting":e)}catch{}},2e3)},[e,t,w]),$=(0,r.useCallback)(async()=>{p("opening"),h("");try{let t=await fetch("/api/providers/web-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,profile:f})}),s=await t.json();if(!t.ok){p("error"),h(s.error||(0,i.Tl)("Failed to start login"));return}p("waiting"),h((0,i.Tl)("A browser window has opened — log in there, this page updates itself.")),S()}catch(e){p("error"),h(e?.message||(0,i.Tl)("Failed to start login"))}},[e,f,S]),_=(0,r.useCallback)(()=>{fetch(`/api/providers/web-login?provider=${encodeURIComponent(e)}`,{method:"DELETE"}).catch(()=>{}),w(),p("idle"),h("")},[e,w]),T=(0,r.useCallback)(()=>{let e=window.prompt((0,i.Tl)("New browser profile name (e.g. work, personal):"),"");if(!e)return;let t=e.trim().replace(/[^a-zA-Z0-9_-]/g,"-").slice(0,40);t&&(g(e=>e.includes(t)?e:[...e,t]),N(t))},[N]),I="opening"===d?0:"waiting"===d?1:"success"===d?2:-1;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.$n,{size:s,icon:"success"===d?"check_circle":"language",variant:"secondary",onClick:()=>{p("idle"),h(""),o(!0)},title:(0,i.Tl)("Open a browser window, log in by hand — the cookie is captured automatically"),children:"success"===d?(0,i.Tl)("Connected"):(0,i.Tl)("Login via Browser")}),(0,a.jsx)(n.aF,{isOpen:l,onClose:C,title:(0,i.Tl)("Login via Browser"),size:"sm",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:(0,i.Tl)("A Chrome window opens on a shared browser profile. Log in there — the session is captured automatically. One Google login in a profile makes every other provider a single “Continue with Google” click.")}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:(0,i.Tl)("Browser profile")}),(0,a.jsxs)("button",{type:"button",onClick:T,disabled:k,className:"flex items-center gap-1 text-xs text-primary hover:underline disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"add"}),(0,i.Tl)("New profile")]})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2",children:b.map(e=>{let t=e===f;return(0,a.jsxs)("button",{type:"button",disabled:k,onClick:()=>N(e),className:`flex items-center gap-2 rounded border border-accent/30 bg-sidebar p-2 text-left text-sm transition-colors focus:outline-none focus:ring-1 focus:ring-primary disabled:opacity-50 ${t?"border-primary ring-1 ring-primary":"hover:border-accent/60"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:function(e){let t=String(e).toLowerCase();for(let[e,s]of Object.entries(c))if(t.includes(e))return s;return"folder_shared"}(e)}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e}),t&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"check_circle"})]},e)})})]}),"idle"!==d&&(0,a.jsx)("div",{className:"rounded border border-accent/20 bg-sidebar/50 p-3",children:"success"===d?(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-green-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"check_circle"}),"✓ ",x||(0,i.Tl)("Connection saved")]}):"error"===d?(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-yellow-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"error"}),(0,i.Tl)("Login failed")]}),x&&(0,a.jsx)("p",{className:"pl-6 text-xs text-red-500 break-words",children:x})]}):(0,a.jsxs)("ol",{className:"flex flex-col gap-2",children:[u.map((e,t)=>{let s=t<I,r=t===I;return(0,a.jsxs)("li",{className:`flex items-center gap-2 text-sm ${s?"text-green-400":r?"text-primary":"text-text-muted opacity-50"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${r?"animate-pulse":""}`,children:s?"check_circle":e.icon}),(0,i.Tl)(e.label)]},e.key)}),x&&(0,a.jsx)("li",{className:"pl-6 text-xs text-text-muted",children:x})]})}),(0,a.jsx)("div",{className:"flex gap-2",children:"success"===d?(0,a.jsx)(n.$n,{onClick:C,fullWidth:!0,children:(0,i.Tl)("Done")}):k?(0,a.jsx)(n.$n,{onClick:_,variant:"ghost",fullWidth:!0,children:(0,i.Tl)("Cancel")}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.$n,{onClick:$,fullWidth:!0,disabled:"error"===d&&!x,children:(0,i.Tl)("Open Browser & Login")}),(0,a.jsx)(n.$n,{onClick:C,variant:"ghost",fullWidth:!0,disabled:k,children:(0,i.Tl)("Close")})]})})]})})]})}m.propTypes={providerId:o().string.isRequired,onConnected:o().func,size:o().oneOf(["sm","md","lg"])}},41095:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>B});var a=s(95155),r=s(73321),l=s(98500),o=s.n(l),n=s(12115),i=s(35497),d=s(57250),c=s(88105),u=s(70217),m=s(14051),p=s.n(m),x=s(5539);function h({until:e}){let[t,s]=(0,n.useState)("");return((0,n.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let a=Math.floor(t/1e3);a<60?s(`${a}s`):a<3600?s(`${Math.floor(a/60)}m ${a%60}s`):s(`${Math.floor(a/3600)}h ${Math.floor(a%3600/60)}m`)};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function b({connection:e,proxyPools:t,isOAuth:s,isFirst:r,isLast:l,onMoveUp:o,onMoveDown:d,onToggleActive:c,onUpdateProxy:m,onEdit:p,onDelete:x}){let[g,f]=(0,n.useState)(!1),[y,v]=(0,n.useState)(!1),[j,w]=(0,n.useState)(!1),N=(0,n.useRef)(null),k=new Map((t||[]).map(e=>[e.id,e])),C=e.providerSpecificData?.proxyPoolId||null,S=C?k.get(C):null,$=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,_=!!C||$,T=S?`Pool: ${S.name}`:C?`Pool: ${C} (inactive/missing)`:$?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",I="",P=S?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;if(P)try{let e=new URL(P);I=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{I=P}let A=S?.noProxy||e.providerSpecificData?.connectionNoProxy||"",R=S?.isActive===!0?"success":C||$?"error":"default",E=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(Boolean).sort()[0]||null;(0,n.useEffect)(()=>{let t=()=>{w(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=E?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[E]),(0,n.useEffect)(()=>{if(!g)return;let e=e=>{N.current&&!N.current.contains(e.target)&&f(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[g]);let O="unavailable"!==e.testStatus||j?e.testStatus:"active",L=s?e.name||e.email||e.displayName||"OAuth Account":e.name,M=async e=>{v(!0);try{await m("__none__"===e?null:e)}finally{v(!1),f(!1)}};return(0,a.jsxs)("div",{className:`group flex flex-col gap-3 p-2 rounded-lg sm:flex-row sm:items-center sm:justify-between hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex w-full min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("button",{onClick:o,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:d,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:s?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:L}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-1",children:[(0,a.jsx)(i.Ex,{variant:(0,u.g)(e.isActive,O),size:"sm",dot:!0,children:!1===e.isActive?"disabled":O||"Unknown"}),_&&(0,a.jsx)(i.Ex,{variant:R,size:"sm",children:"Proxy"}),j&&!1!==e.isActive&&(0,a.jsx)(h,{until:E}),e.lastError&&!1!==e.isActive&&(0,a.jsx)("span",{className:"text-xs text-red-500 truncate max-w-[300px]",title:e.lastError,children:e.lastError}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]})]}),_&&(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-[11px] text-text-muted truncate max-w-[420px]",title:T,children:T}),I&&(0,a.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1 py-0.5 rounded text-text-muted",children:I}),A&&(0,a.jsxs)("span",{className:"text-[11px] text-text-muted truncate max-w-[320px]",title:A,children:["no_proxy: ",A]})]})]})]}),(0,a.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(t||[]).length>0&&(0,a.jsxs)("div",{className:"relative",ref:N,children:[(0,a.jsxs)("button",{onClick:()=>f(e=>!e),className:`flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 transition-colors ${_?"text-primary":"text-text-muted hover:text-primary"}`,disabled:y,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),g&&(0,a.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-50 bg-bg border border-border rounded-lg shadow-lg py-1 min-w-[160px]",children:[(0,a.jsx)("button",{onClick:()=>M("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!C?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,a.jsx)("button",{onClick:()=>M(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${C===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),(0,a.jsxs)("button",{onClick:p,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:x,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-red-500/10 text-red-500",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(i.lM,{size:"sm",checked:e.isActive??!0,onChange:c,title:e.isActive??!0?"Disable":"Enable"})]})]})}function g({isOpen:e,provider:t,providerName:s,proxyPools:r,onSave:l,onClose:o}){let d="__none__",[c,u]=(0,n.useState)({name:"",apiKey:"",priority:1,proxyPoolId:d}),[m,p]=(0,n.useState)(!1),[x,h]=(0,n.useState)(null),[b,f]=(0,n.useState)(!1),y=async()=>{p(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})}),s=await e.json();h(s.valid?"success":"failed")}catch{h("failed")}finally{p(!1)}},v=async()=>{if(t&&c.apiKey){f(!0);try{let e=!1;try{p(!0),h(null);let s=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})});e=!!(await s.json()).valid,h(e?"success":"failed")}catch{h("failed")}finally{p(!1)}await l({name:c.name,apiKey:c.apiKey,priority:c.priority,proxyPoolId:c.proxyPoolId===d?null:c.proxyPoolId,testStatus:e?"active":"unknown"})}finally{f(!1)}}};return t?(0,a.jsx)(i.aF,{isOpen:e,title:`Add ${s||t} API Key`,onClose:o,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Name"}),(0,a.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.name,onChange:e=>u({...c,name:e.target.value}),placeholder:"Production Key"})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"API Key"}),(0,a.jsx)("input",{type:"password",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.apiKey,onChange:e=>u({...c,apiKey:e.target.value})})]}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(i.$n,{onClick:y,disabled:!c.apiKey||m||b,variant:"secondary",children:m?"Checking...":"Check"})})]}),x&&(0,a.jsx)(i.Ex,{variant:"success"===x?"success":"error",children:"success"===x?"Valid":"Invalid"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Priority"}),(0,a.jsx)("input",{type:"number",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.priority,onChange:e=>u({...c,priority:Number.parseInt(e.target.value)||1})})]}),(0,a.jsx)(i.l6,{label:"Proxy Pool",value:c.proxyPoolId,onChange:e=>u({...c,proxyPoolId:e.target.value}),options:[{value:d,label:"None"},...(r||[]).map(e=>({value:e.id,label:e.name}))]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:v,fullWidth:!0,disabled:!c.name||!c.apiKey||b,children:b?"Saving...":"Save"}),(0,a.jsx)(i.$n,{onClick:o,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function f({providerId:e,isOAuth:t,loginProviderId:s=null}){let[r,l]=(0,n.useState)([]),[o,d]=(0,n.useState)([]),[c,u]=(0,n.useState)(!0),[m,p]=(0,n.useState)(!1),[h,y]=(0,n.useState)(!1),[v,j]=(0,n.useState)(null),[w,N]=(0,n.useState)(null),[k,C]=(0,n.useState)("1"),[S,$]=(0,n.useState)(null),_=(0,n.useCallback)(async()=>{try{let[t,s,a]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),r=await t.json(),o=await s.json(),n=a.ok?await a.json():{};t.ok&&l((r.connections||[]).filter(t=>t.provider===e)),s.ok&&d(o.proxyPools||[]);let i=(n.providerStrategies||{})[e]||{};N(i.fallbackStrategy||null),C(null!=i.stickyRoundRobinLimit?String(i.stickyRoundRobinLimit):"1")}catch(e){console.log("ConnectionsCard fetch error:",e)}finally{u(!1)}},[e]);(0,n.useEffect)(()=>{_()},[_]);let T=async(t,s)=>{try{let a=await fetch("/api/settings",{cache:"no-store"}),r=(a.ok?await a.json():{}).providerStrategies||{},l={};t&&(l.fallbackStrategy=t),"round-robin"===t&&""!==s&&(l.stickyRoundRobinLimit=Number(s)||3);let o={...r};0===Object.keys(l).length?delete o[e]:o[e]=l,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:o})})}catch(e){console.log("saveStrategy error:",e)}},I=async(e,t)=>{let s=[...r];[s[e],s[t]]=[s[t],s[e]],l(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch{await _()}},P=async e=>{$({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{$(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&l(t=>t.filter(t=>t.id!==e))}catch(e){console.log("delete error:",e)}}})},A=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&l(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("toggle error:",e)}},R=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&l(s=>s.map(s=>s.id===e?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("proxy error:",e)}},E=async t=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,...t})})).ok&&(await _(),p(!1))}catch(e){console.log("save apikey error:",e)}},O=async e=>{try{(await fetch(`/api/providers/${v.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await _(),y(!1))}catch(e){console.log("update connection error:",e)}};return c?(0,a.jsx)(i.Zp,{children:(0,a.jsx)("div",{className:"h-20 animate-pulse bg-black/5 rounded-lg"})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,a.jsx)(i.lM,{checked:"round-robin"===w,onChange:e=>{let t=e?"round-robin":null;N(t),e&&!k&&C("1"),T(t,e?k||"1":k)}}),"round-robin"===w&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,a.jsx)("input",{type:"number",min:1,value:k,onChange:e=>{C(e.target.value),T("round-robin",e.target.value)},className:"w-16 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]}),0===r.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[s&&(0,a.jsx)(x.A,{providerId:s,onConnected:_}),(0,a.jsx)(i.$n,{size:"sm",icon:"add",onClick:()=>p(!0),children:"Add Connection"})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03] max-h-[500px] overflow-y-auto pr-1",children:r.map((e,s)=>(0,a.jsx)(b,{connection:e,proxyPools:o,isOAuth:t,isFirst:0===s,isLast:s===r.length-1,onMoveUp:()=>I(s,s-1),onMoveDown:()=>I(s,s+1),onToggleActive:t=>A(e.id,t),onUpdateProxy:t=>R(e.id,t),onEdit:()=>{j(e),y(!0)},onDelete:()=>P(e.id)},e.id))}),(0,a.jsxs)("div",{className:"mt-4 flex justify-stretch gap-2 sm:justify-start",children:[(0,a.jsx)(i.$n,{size:"sm",icon:"add",onClick:()=>p(!0),children:"Add"}),s&&(0,a.jsx)(x.A,{providerId:s,onConnected:_})]})]})]}),(0,a.jsx)(g,{isOpen:m,provider:e,proxyPools:o,onSave:E,onClose:()=>p(!1)}),(0,a.jsx)(i.wI,{isOpen:h,connection:v,proxyPools:o,onSave:O,onClose:()=>y(!1)}),(0,a.jsx)(i.uo,{isOpen:!!S,onClose:()=>$(null),onConfirm:S?.onConfirm,title:S?.title||"Confirm",message:S?.message,variant:"danger"})]})}h.propTypes={until:p().string.isRequired},b.propTypes={connection:p().shape({id:p().string,name:p().string,email:p().string,displayName:p().string,testStatus:p().string,isActive:p().bool,lastError:p().string,priority:p().number}).isRequired,proxyPools:p().array,isOAuth:p().bool.isRequired,isFirst:p().bool.isRequired,isLast:p().bool.isRequired,onMoveUp:p().func.isRequired,onMoveDown:p().func.isRequired,onToggleActive:p().func.isRequired,onUpdateProxy:p().func,onEdit:p().func.isRequired,onDelete:p().func.isRequired},g.propTypes={isOpen:p().bool.isRequired,provider:p().string,providerName:p().string,proxyPools:p().array,onSave:p().func.isRequired,onClose:p().func.isRequired},f.propTypes={providerId:p().string.isRequired,isOAuth:p().bool,loginProviderId:p().string};var y=s(81231),v=s(28777),j=s(11059);function w({model:e,fullModel:t,copied:s,onCopy:r,testStatus:l,isCustom:o,isFree:n,onDeleteAlias:i,onTest:d,isTesting:c}){let u="ok"===l?"#22c55e":"error"===l?"#ef4444":void 0;return(0,a.jsx)("div",{className:`group px-3 py-2 rounded-lg border ${"ok"===l?"border-green-500/40":"error"===l?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",style:u?{color:u}:void 0,children:"ok"===l?"check_circle":"error"===l?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),e.name&&(0,a.jsx)("span",{className:"text-[9px] text-text-muted/70 italic pl-1",children:e.name})]}),d&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:d,disabled:c,className:`p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-opacity ${c?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:c?{animation:"spin 1s linear infinite"}:void 0,children:c?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:c?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>r(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e.id}`?"Copied!":"Copy"})]}),n&&(0,a.jsx)("span",{className:"text-[10px] font-bold text-green-500 bg-green-500/10 px-1.5 py-0.5 rounded",children:"FREE"}),o&&(0,a.jsx)("button",{onClick:i,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity ml-auto",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})})]})})}function N({isOpen:e,onSave:t,onClose:s}){let[r,l]=(0,n.useState)(""),o=()=>{r.trim()&&(t(r.trim()),l(""))};return(0,a.jsx)(i.aF,{isOpen:e,title:"Add Custom Model",onClose:s,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:r,onChange:e=>l(e.target.value),onKeyDown:e=>"Enter"===e.key&&o(),placeholder:"e.g. tts-1-hd",autoFocus:!0})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:o,fullWidth:!0,disabled:!r.trim(),children:"Add"}),(0,a.jsx)(i.$n,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function k({providerId:e,kindFilter:t,providerAliasOverride:s}){let{copied:r,copy:l}=(0,j.C)(),[o,d]=(0,n.useState)({}),[u,m]=(0,n.useState)([]),[p,x]=(0,n.useState)({}),[h,b]=(0,n.useState)(null),[g,f]=(0,n.useState)(""),[C,S]=(0,n.useState)(!1),$=s||(0,c.wG)(e),_=t||"llm",T=(0,n.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch("/api/models/alias"),fetch("/api/models/custom",{cache:"no-store"})]),s=await e.json(),a=await t.json();e.ok&&d(s.aliases||{}),t.ok&&m(a.models||[])}catch(e){console.log("ModelsCard fetch error:",e)}},[]);(0,n.useEffect)(()=>{T()},[T]);let I=async(e,t)=>{let s=`${$}/${e}`;try{(await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s,alias:t})})).ok&&await T()}catch(e){console.log("set alias error:",e)}},P=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await T()}catch(e){console.log("delete alias error:",e)}},A=async e=>{try{(await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:$,id:e,type:_})})).ok&&(await T(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("add custom model error:",e)}},R=async e=>{try{let t=new URLSearchParams({providerAlias:$,id:e,type:_});(await fetch(`/api/models/custom?${t}`,{method:"DELETE"})).ok&&(await T(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("delete custom model error:",e)}},E=async e=>{if(!h){b(e);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${$}/${e}`,kind:t})}),a=await s.json();x(t=>({...t,[e]:a.ok?"ok":"error"})),f(a.ok?"":a.error||"Model not reachable")}catch{x(t=>({...t,[e]:"error"})),f("Network error")}finally{b(null)}}},O=(0,v.KC)(e),L=t?O.filter(e=>e.kinds?e.kinds.includes(t):(0,v.CP)(e,"llm")===t):O,M=u.filter(e=>e.providerAlias===$&&(0,v.CP)(e,"llm")===_&&!L.some(t=>t.id===e.id)),U=(0,y.N)(L,u,$);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(i.Zp,{children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,a.jsxs)("h2",{className:"text-lg font-semibold",children:["Models",t?` — ${t.toUpperCase()}`:""]})}),g&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:g}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[U.map(e=>{let t=`${$}/${e.id}`,s=Object.entries(o).find(([,e])=>e===t)?.[0];return(0,a.jsx)(w,{model:e,fullModel:`${$}/${e.id}`,alias:s,copied:r,onCopy:l,onSetAlias:t=>I(e.id,t),onDeleteAlias:()=>P(s),testStatus:p[e.id],onTest:()=>E(e.id),isTesting:h===e.id,isFree:e.isFree},e.id)}),M.map(e=>(0,a.jsx)(w,{model:{id:e.id,name:e.name},fullModel:`${$}/${e.id}`,copied:r,onCopy:l,onSetAlias:()=>{},onDeleteAlias:()=>R(e.id),testStatus:p[e.id],onTest:()=>E(e.id),isTesting:h===e.id,isCustom:!0},`${e.id}-${e.type}`)),(0,a.jsxs)("button",{onClick:()=>S(!0),className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-dashed border-black/15 dark:border-white/15 text-xs text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]})]})]}),(0,a.jsx)(N,{isOpen:C,onSave:async e=>{await A(e),S(!1)},onClose:()=>S(!1)})]})}function C({label:e,children:t}){return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3",children:[(0,a.jsx)("span",{className:"w-full text-xs font-medium text-text-muted sm:w-20 sm:shrink-0",children:e}),(0,a.jsx)("div",{className:"w-full min-w-0 flex-1",children:t})]})}w.propTypes={model:p().shape({id:p().string.isRequired}).isRequired,fullModel:p().string.isRequired,copied:p().string,onCopy:p().func.isRequired,testStatus:p().oneOf(["ok","error"]),isCustom:p().bool,isFree:p().bool,onDeleteAlias:p().func,onTest:p().func,isTesting:p().bool},N.propTypes={isOpen:p().bool.isRequired,onSave:p().func.isRequired,onClose:p().func.isRequired},k.propTypes={providerId:p().string.isRequired,kindFilter:p().string,providerAliasOverride:p().string};let S={webSearch:{inputLabel:"Query",inputPlaceholder:"What is the latest news about AI?",defaultInput:"What is the latest news about AI?",bodyKey:"query",defaultResponse:`{
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[182],{1943:(e,t,s)=>{Promise.resolve().then(s.bind(s,41095))},5539:(e,t,s)=>{"use strict";s.d(t,{A:()=>m,w:()=>d});var a=s(95155),r=s(12115),l=s(14051),o=s.n(l),n=s(35497),i=s(73006);let d=new Set(["grok-web","chatgpt-web","gemini-web","muse-web","deepseek-web","uc-web"]),c={default:"person",grok:"bolt",work:"work",personal:"home"},u=[{key:"opening",label:"Opening browser window",icon:"open_in_new"},{key:"waiting",label:"Waiting for you to log in",icon:"hourglass_top"},{key:"saving",label:"Saving connection",icon:"save"}];function m({providerId:e,onConnected:t,size:s="sm"}){let[l,o]=(0,r.useState)(!1),[d,p]=(0,r.useState)("idle"),[x,h]=(0,r.useState)(""),[b,g]=(0,r.useState)(["default"]),[f,y]=(0,r.useState)("default"),v=(0,r.useRef)(null),j=(0,r.useRef)(null),w=(0,r.useCallback)(()=>{v.current&&(clearInterval(v.current),v.current=null)},[]);(0,r.useEffect)(()=>()=>{w(),j.current&&clearTimeout(j.current)},[w]),(0,r.useEffect)(()=>{if(!l)return;let t=!1;return fetch("/api/providers/web-login",{cache:"no-store"}).then(e=>e.json()).then(s=>{if(t||!Array.isArray(s.profiles))return;let a=window.localStorage.getItem(`weblogin:profile:${e}`),r=s.profiles.includes("default")?s.profiles:["default",...s.profiles];g(r),y(a&&r.includes(a)?a:"default")}).catch(()=>{}),()=>{t=!0}},[l,e]);let N=(0,r.useCallback)(t=>{y(t),window.localStorage.setItem(`weblogin:profile:${e}`,t)},[e]),k="opening"===d||"waiting"===d,C=(0,r.useCallback)(()=>{k||(w(),o(!1),"error"===d&&(p("idle"),h("")))},[k,d,w]),S=(0,r.useCallback)(()=>{w();let s=!1;v.current=setInterval(async()=>{if(!s){s=!0;try{let s=await fetch(`/api/providers/web-login?provider=${encodeURIComponent(e)}`,{cache:"no-store"}),a=await s.json();"success"===a.status?(w(),p("success"),h(a.email?`${(0,i.Tl)("Signed in as")} ${a.email}`:"Connection saved"),"function"==typeof t&&t(),j.current=setTimeout(()=>{o(!1),h("")},1500)):"error"===a.status||"timeout"===a.status||"cancelled"===a.status?(w(),p("error"),h(a.error||(0,i.Tl)("Login failed"))):p(e=>"opening"===e?"waiting":e)}catch{}finally{s=!1}}},2e3)},[e,t,w]),$=(0,r.useCallback)(async()=>{p("opening"),h("");try{let t=await fetch("/api/providers/web-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,profile:f})}),s=await t.json();if(!t.ok){p("error"),h(s.error||(0,i.Tl)("Failed to start login"));return}p("waiting"),h((0,i.Tl)("A browser window has opened — log in there, this page updates itself.")),S()}catch(e){p("error"),h(e?.message||(0,i.Tl)("Failed to start login"))}},[e,f,S]),_=(0,r.useCallback)(()=>{fetch(`/api/providers/web-login?provider=${encodeURIComponent(e)}`,{method:"DELETE"}).catch(()=>{}),w(),p("idle"),h("")},[e,w]),T=(0,r.useCallback)(()=>{let e=window.prompt((0,i.Tl)("New browser profile name (e.g. work, personal):"),"");if(!e)return;let t=e.trim().replace(/[^a-zA-Z0-9_-]/g,"-").slice(0,40);t&&(g(e=>e.includes(t)?e:[...e,t]),N(t))},[N]),I="opening"===d?0:"waiting"===d?1:"success"===d?2:-1;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.$n,{size:s,icon:"success"===d?"check_circle":"language",variant:"secondary",onClick:()=>{p("idle"),h(""),o(!0)},title:(0,i.Tl)("Open a browser window, log in by hand — the cookie is captured automatically"),children:"success"===d?(0,i.Tl)("Connected"):(0,i.Tl)("Login via Browser")}),(0,a.jsx)(n.aF,{isOpen:l,onClose:C,title:(0,i.Tl)("Login via Browser"),size:"sm",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:(0,i.Tl)("A Chrome window opens on a shared browser profile. Log in there — the session is captured automatically. One Google login in a profile makes every other provider a single “Continue with Google” click.")}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:(0,i.Tl)("Browser profile")}),(0,a.jsxs)("button",{type:"button",onClick:T,disabled:k,className:"flex items-center gap-1 text-xs text-primary hover:underline disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"add"}),(0,i.Tl)("New profile")]})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2",children:b.map(e=>{let t=e===f;return(0,a.jsxs)("button",{type:"button",disabled:k,onClick:()=>N(e),className:`flex items-center gap-2 rounded border border-accent/30 bg-sidebar p-2 text-left text-sm transition-colors focus:outline-none focus:ring-1 focus:ring-primary disabled:opacity-50 ${t?"border-primary ring-1 ring-primary":"hover:border-accent/60"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:function(e){let t=String(e).toLowerCase();for(let[e,s]of Object.entries(c))if(t.includes(e))return s;return"folder_shared"}(e)}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e}),t&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"check_circle"})]},e)})})]}),"idle"!==d&&(0,a.jsx)("div",{className:"rounded border border-accent/20 bg-sidebar/50 p-3",children:"success"===d?(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-green-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"check_circle"}),"✓ ",x||(0,i.Tl)("Connection saved")]}):"error"===d?(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-yellow-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"error"}),(0,i.Tl)("Login failed")]}),x&&(0,a.jsx)("p",{className:"pl-6 text-xs text-red-500 break-words",children:x})]}):(0,a.jsxs)("ol",{className:"flex flex-col gap-2",children:[u.map((e,t)=>{let s=t<I,r=t===I;return(0,a.jsxs)("li",{className:`flex items-center gap-2 text-sm ${s?"text-green-400":r?"text-primary":"text-text-muted opacity-50"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${r?"animate-pulse":""}`,children:s?"check_circle":e.icon}),(0,i.Tl)(e.label)]},e.key)}),x&&(0,a.jsx)("li",{className:"pl-6 text-xs text-text-muted",children:x})]})}),(0,a.jsx)("div",{className:"flex gap-2",children:"success"===d?(0,a.jsx)(n.$n,{onClick:C,fullWidth:!0,children:(0,i.Tl)("Done")}):k?(0,a.jsx)(n.$n,{onClick:_,variant:"ghost",fullWidth:!0,children:(0,i.Tl)("Cancel")}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.$n,{onClick:$,fullWidth:!0,disabled:"error"===d&&!x,children:(0,i.Tl)("Open Browser & Login")}),(0,a.jsx)(n.$n,{onClick:C,variant:"ghost",fullWidth:!0,disabled:k,children:(0,i.Tl)("Close")})]})})]})})]})}m.propTypes={providerId:o().string.isRequired,onConnected:o().func,size:o().oneOf(["sm","md","lg"])}},41095:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>B});var a=s(95155),r=s(73321),l=s(98500),o=s.n(l),n=s(12115),i=s(35497),d=s(57250),c=s(88105),u=s(70217),m=s(14051),p=s.n(m),x=s(5539);function h({until:e}){let[t,s]=(0,n.useState)("");return((0,n.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let a=Math.floor(t/1e3);a<60?s(`${a}s`):a<3600?s(`${Math.floor(a/60)}m ${a%60}s`):s(`${Math.floor(a/3600)}h ${Math.floor(a%3600/60)}m`)};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function b({connection:e,proxyPools:t,isOAuth:s,isFirst:r,isLast:l,onMoveUp:o,onMoveDown:d,onToggleActive:c,onUpdateProxy:m,onEdit:p,onDelete:x}){let[g,f]=(0,n.useState)(!1),[y,v]=(0,n.useState)(!1),[j,w]=(0,n.useState)(!1),N=(0,n.useRef)(null),k=new Map((t||[]).map(e=>[e.id,e])),C=e.providerSpecificData?.proxyPoolId||null,S=C?k.get(C):null,$=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,_=!!C||$,T=S?`Pool: ${S.name}`:C?`Pool: ${C} (inactive/missing)`:$?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",I="",P=S?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;if(P)try{let e=new URL(P);I=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{I=P}let A=S?.noProxy||e.providerSpecificData?.connectionNoProxy||"",R=S?.isActive===!0?"success":C||$?"error":"default",E=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(Boolean).sort()[0]||null;(0,n.useEffect)(()=>{let t=()=>{w(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=E?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[E]),(0,n.useEffect)(()=>{if(!g)return;let e=e=>{N.current&&!N.current.contains(e.target)&&f(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[g]);let O="unavailable"!==e.testStatus||j?e.testStatus:"active",L=s?e.name||e.email||e.displayName||"OAuth Account":e.name,M=async e=>{v(!0);try{await m("__none__"===e?null:e)}finally{v(!1),f(!1)}};return(0,a.jsxs)("div",{className:`group flex flex-col gap-3 p-2 rounded-lg sm:flex-row sm:items-center sm:justify-between hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex w-full min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("button",{onClick:o,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:d,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:s?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:L}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-1",children:[(0,a.jsx)(i.Ex,{variant:(0,u.g)(e.isActive,O),size:"sm",dot:!0,children:!1===e.isActive?"disabled":O||"Unknown"}),_&&(0,a.jsx)(i.Ex,{variant:R,size:"sm",children:"Proxy"}),j&&!1!==e.isActive&&(0,a.jsx)(h,{until:E}),e.lastError&&!1!==e.isActive&&(0,a.jsx)("span",{className:"text-xs text-red-500 truncate max-w-[300px]",title:e.lastError,children:e.lastError}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]})]}),_&&(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-[11px] text-text-muted truncate max-w-[420px]",title:T,children:T}),I&&(0,a.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1 py-0.5 rounded text-text-muted",children:I}),A&&(0,a.jsxs)("span",{className:"text-[11px] text-text-muted truncate max-w-[320px]",title:A,children:["no_proxy: ",A]})]})]})]}),(0,a.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(t||[]).length>0&&(0,a.jsxs)("div",{className:"relative",ref:N,children:[(0,a.jsxs)("button",{onClick:()=>f(e=>!e),className:`flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 transition-colors ${_?"text-primary":"text-text-muted hover:text-primary"}`,disabled:y,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),g&&(0,a.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-50 bg-bg border border-border rounded-lg shadow-lg py-1 min-w-[160px]",children:[(0,a.jsx)("button",{onClick:()=>M("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!C?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,a.jsx)("button",{onClick:()=>M(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${C===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),(0,a.jsxs)("button",{onClick:p,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:x,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-red-500/10 text-red-500",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(i.lM,{size:"sm",checked:e.isActive??!0,onChange:c,title:e.isActive??!0?"Disable":"Enable"})]})]})}function g({isOpen:e,provider:t,providerName:s,proxyPools:r,onSave:l,onClose:o}){let d="__none__",[c,u]=(0,n.useState)({name:"",apiKey:"",priority:1,proxyPoolId:d}),[m,p]=(0,n.useState)(!1),[x,h]=(0,n.useState)(null),[b,f]=(0,n.useState)(!1),y=async()=>{p(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})}),s=await e.json();h(s.valid?"success":"failed")}catch{h("failed")}finally{p(!1)}},v=async()=>{if(t&&c.apiKey){f(!0);try{let e=!1;try{p(!0),h(null);let s=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})});e=!!(await s.json()).valid,h(e?"success":"failed")}catch{h("failed")}finally{p(!1)}await l({name:c.name,apiKey:c.apiKey,priority:c.priority,proxyPoolId:c.proxyPoolId===d?null:c.proxyPoolId,testStatus:e?"active":"unknown"})}finally{f(!1)}}};return t?(0,a.jsx)(i.aF,{isOpen:e,title:`Add ${s||t} API Key`,onClose:o,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Name"}),(0,a.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.name,onChange:e=>u({...c,name:e.target.value}),placeholder:"Production Key"})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"API Key"}),(0,a.jsx)("input",{type:"password",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.apiKey,onChange:e=>u({...c,apiKey:e.target.value})})]}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(i.$n,{onClick:y,disabled:!c.apiKey||m||b,variant:"secondary",children:m?"Checking...":"Check"})})]}),x&&(0,a.jsx)(i.Ex,{variant:"success"===x?"success":"error",children:"success"===x?"Valid":"Invalid"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Priority"}),(0,a.jsx)("input",{type:"number",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.priority,onChange:e=>u({...c,priority:Number.parseInt(e.target.value)||1})})]}),(0,a.jsx)(i.l6,{label:"Proxy Pool",value:c.proxyPoolId,onChange:e=>u({...c,proxyPoolId:e.target.value}),options:[{value:d,label:"None"},...(r||[]).map(e=>({value:e.id,label:e.name}))]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:v,fullWidth:!0,disabled:!c.name||!c.apiKey||b,children:b?"Saving...":"Save"}),(0,a.jsx)(i.$n,{onClick:o,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function f({providerId:e,isOAuth:t,loginProviderId:s=null}){let[r,l]=(0,n.useState)([]),[o,d]=(0,n.useState)([]),[c,u]=(0,n.useState)(!0),[m,p]=(0,n.useState)(!1),[h,y]=(0,n.useState)(!1),[v,j]=(0,n.useState)(null),[w,N]=(0,n.useState)(null),[k,C]=(0,n.useState)("1"),[S,$]=(0,n.useState)(null),_=(0,n.useCallback)(async()=>{try{let[t,s,a]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),r=await t.json(),o=await s.json(),n=a.ok?await a.json():{};t.ok&&l((r.connections||[]).filter(t=>t.provider===e)),s.ok&&d(o.proxyPools||[]);let i=(n.providerStrategies||{})[e]||{};N(i.fallbackStrategy||null),C(null!=i.stickyRoundRobinLimit?String(i.stickyRoundRobinLimit):"1")}catch(e){console.log("ConnectionsCard fetch error:",e)}finally{u(!1)}},[e]);(0,n.useEffect)(()=>{_()},[_]);let T=async(t,s)=>{try{let a=await fetch("/api/settings",{cache:"no-store"}),r=(a.ok?await a.json():{}).providerStrategies||{},l={};t&&(l.fallbackStrategy=t),"round-robin"===t&&""!==s&&(l.stickyRoundRobinLimit=Number(s)||3);let o={...r};0===Object.keys(l).length?delete o[e]:o[e]=l,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:o})})}catch(e){console.log("saveStrategy error:",e)}},I=async(e,t)=>{let s=[...r];[s[e],s[t]]=[s[t],s[e]],l(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch{await _()}},P=async e=>{$({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{$(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&l(t=>t.filter(t=>t.id!==e))}catch(e){console.log("delete error:",e)}}})},A=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&l(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("toggle error:",e)}},R=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&l(s=>s.map(s=>s.id===e?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("proxy error:",e)}},E=async t=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,...t})})).ok&&(await _(),p(!1))}catch(e){console.log("save apikey error:",e)}},O=async e=>{try{(await fetch(`/api/providers/${v.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await _(),y(!1))}catch(e){console.log("update connection error:",e)}};return c?(0,a.jsx)(i.Zp,{children:(0,a.jsx)("div",{className:"h-20 animate-pulse bg-black/5 rounded-lg"})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,a.jsx)(i.lM,{checked:"round-robin"===w,onChange:e=>{let t=e?"round-robin":null;N(t),e&&!k&&C("1"),T(t,e?k||"1":k)}}),"round-robin"===w&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,a.jsx)("input",{type:"number",min:1,value:k,onChange:e=>{C(e.target.value),T("round-robin",e.target.value)},className:"w-16 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]}),0===r.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[s&&(0,a.jsx)(x.A,{providerId:s,onConnected:_}),(0,a.jsx)(i.$n,{size:"sm",icon:"add",onClick:()=>p(!0),children:"Add Connection"})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03] max-h-[500px] overflow-y-auto pr-1",children:r.map((e,s)=>(0,a.jsx)(b,{connection:e,proxyPools:o,isOAuth:t,isFirst:0===s,isLast:s===r.length-1,onMoveUp:()=>I(s,s-1),onMoveDown:()=>I(s,s+1),onToggleActive:t=>A(e.id,t),onUpdateProxy:t=>R(e.id,t),onEdit:()=>{j(e),y(!0)},onDelete:()=>P(e.id)},e.id))}),(0,a.jsxs)("div",{className:"mt-4 flex justify-stretch gap-2 sm:justify-start",children:[(0,a.jsx)(i.$n,{size:"sm",icon:"add",onClick:()=>p(!0),children:"Add"}),s&&(0,a.jsx)(x.A,{providerId:s,onConnected:_})]})]})]}),(0,a.jsx)(g,{isOpen:m,provider:e,proxyPools:o,onSave:E,onClose:()=>p(!1)}),(0,a.jsx)(i.wI,{isOpen:h,connection:v,proxyPools:o,onSave:O,onClose:()=>y(!1)}),(0,a.jsx)(i.uo,{isOpen:!!S,onClose:()=>$(null),onConfirm:S?.onConfirm,title:S?.title||"Confirm",message:S?.message,variant:"danger"})]})}h.propTypes={until:p().string.isRequired},b.propTypes={connection:p().shape({id:p().string,name:p().string,email:p().string,displayName:p().string,testStatus:p().string,isActive:p().bool,lastError:p().string,priority:p().number}).isRequired,proxyPools:p().array,isOAuth:p().bool.isRequired,isFirst:p().bool.isRequired,isLast:p().bool.isRequired,onMoveUp:p().func.isRequired,onMoveDown:p().func.isRequired,onToggleActive:p().func.isRequired,onUpdateProxy:p().func,onEdit:p().func.isRequired,onDelete:p().func.isRequired},g.propTypes={isOpen:p().bool.isRequired,provider:p().string,providerName:p().string,proxyPools:p().array,onSave:p().func.isRequired,onClose:p().func.isRequired},f.propTypes={providerId:p().string.isRequired,isOAuth:p().bool,loginProviderId:p().string};var y=s(81231),v=s(28777),j=s(11059);function w({model:e,fullModel:t,copied:s,onCopy:r,testStatus:l,isCustom:o,isFree:n,onDeleteAlias:i,onTest:d,isTesting:c}){let u="ok"===l?"#22c55e":"error"===l?"#ef4444":void 0;return(0,a.jsx)("div",{className:`group px-3 py-2 rounded-lg border ${"ok"===l?"border-green-500/40":"error"===l?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",style:u?{color:u}:void 0,children:"ok"===l?"check_circle":"error"===l?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),e.name&&(0,a.jsx)("span",{className:"text-[9px] text-text-muted/70 italic pl-1",children:e.name})]}),d&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:d,disabled:c,className:`p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-opacity ${c?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:c?{animation:"spin 1s linear infinite"}:void 0,children:c?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:c?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>r(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e.id}`?"Copied!":"Copy"})]}),n&&(0,a.jsx)("span",{className:"text-[10px] font-bold text-green-500 bg-green-500/10 px-1.5 py-0.5 rounded",children:"FREE"}),o&&(0,a.jsx)("button",{onClick:i,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity ml-auto",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})})]})})}function N({isOpen:e,onSave:t,onClose:s}){let[r,l]=(0,n.useState)(""),o=()=>{r.trim()&&(t(r.trim()),l(""))};return(0,a.jsx)(i.aF,{isOpen:e,title:"Add Custom Model",onClose:s,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:r,onChange:e=>l(e.target.value),onKeyDown:e=>"Enter"===e.key&&o(),placeholder:"e.g. tts-1-hd",autoFocus:!0})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:o,fullWidth:!0,disabled:!r.trim(),children:"Add"}),(0,a.jsx)(i.$n,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function k({providerId:e,kindFilter:t,providerAliasOverride:s}){let{copied:r,copy:l}=(0,j.C)(),[o,d]=(0,n.useState)({}),[u,m]=(0,n.useState)([]),[p,x]=(0,n.useState)({}),[h,b]=(0,n.useState)(null),[g,f]=(0,n.useState)(""),[C,S]=(0,n.useState)(!1),$=s||(0,c.wG)(e),_=t||"llm",T=(0,n.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch("/api/models/alias"),fetch("/api/models/custom",{cache:"no-store"})]),s=await e.json(),a=await t.json();e.ok&&d(s.aliases||{}),t.ok&&m(a.models||[])}catch(e){console.log("ModelsCard fetch error:",e)}},[]);(0,n.useEffect)(()=>{T()},[T]);let I=async(e,t)=>{let s=`${$}/${e}`;try{(await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s,alias:t})})).ok&&await T()}catch(e){console.log("set alias error:",e)}},P=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await T()}catch(e){console.log("delete alias error:",e)}},A=async e=>{try{(await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:$,id:e,type:_})})).ok&&(await T(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("add custom model error:",e)}},R=async e=>{try{let t=new URLSearchParams({providerAlias:$,id:e,type:_});(await fetch(`/api/models/custom?${t}`,{method:"DELETE"})).ok&&(await T(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("delete custom model error:",e)}},E=async e=>{if(!h){b(e);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${$}/${e}`,kind:t})}),a=await s.json();x(t=>({...t,[e]:a.ok?"ok":"error"})),f(a.ok?"":a.error||"Model not reachable")}catch{x(t=>({...t,[e]:"error"})),f("Network error")}finally{b(null)}}},O=(0,v.KC)(e),L=t?O.filter(e=>e.kinds?e.kinds.includes(t):(0,v.CP)(e,"llm")===t):O,M=u.filter(e=>e.providerAlias===$&&(0,v.CP)(e,"llm")===_&&!L.some(t=>t.id===e.id)),U=(0,y.N)(L,u,$);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(i.Zp,{children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,a.jsxs)("h2",{className:"text-lg font-semibold",children:["Models",t?` — ${t.toUpperCase()}`:""]})}),g&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:g}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[U.map(e=>{let t=`${$}/${e.id}`,s=Object.entries(o).find(([,e])=>e===t)?.[0];return(0,a.jsx)(w,{model:e,fullModel:`${$}/${e.id}`,alias:s,copied:r,onCopy:l,onSetAlias:t=>I(e.id,t),onDeleteAlias:()=>P(s),testStatus:p[e.id],onTest:()=>E(e.id),isTesting:h===e.id,isFree:e.isFree},e.id)}),M.map(e=>(0,a.jsx)(w,{model:{id:e.id,name:e.name},fullModel:`${$}/${e.id}`,copied:r,onCopy:l,onSetAlias:()=>{},onDeleteAlias:()=>R(e.id),testStatus:p[e.id],onTest:()=>E(e.id),isTesting:h===e.id,isCustom:!0},`${e.id}-${e.type}`)),(0,a.jsxs)("button",{onClick:()=>S(!0),className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-dashed border-black/15 dark:border-white/15 text-xs text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]})]})]}),(0,a.jsx)(N,{isOpen:C,onSave:async e=>{await A(e),S(!1)},onClose:()=>S(!1)})]})}function C({label:e,children:t}){return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3",children:[(0,a.jsx)("span",{className:"w-full text-xs font-medium text-text-muted sm:w-20 sm:shrink-0",children:e}),(0,a.jsx)("div",{className:"w-full min-w-0 flex-1",children:t})]})}w.propTypes={model:p().shape({id:p().string.isRequired}).isRequired,fullModel:p().string.isRequired,copied:p().string,onCopy:p().func.isRequired,testStatus:p().oneOf(["ok","error"]),isCustom:p().bool,isFree:p().bool,onDeleteAlias:p().func,onTest:p().func,isTesting:p().bool},N.propTypes={isOpen:p().bool.isRequired,onSave:p().func.isRequired,onClose:p().func.isRequired},k.propTypes={providerId:p().string.isRequired,kindFilter:p().string,providerAliasOverride:p().string};let S={webSearch:{inputLabel:"Query",inputPlaceholder:"What is the latest news about AI?",defaultInput:"What is the latest news about AI?",bodyKey:"query",defaultResponse:`{
2
2
  "results": [
3
3
  { "title": "...", "url": "...", "snippet": "..." }
4
4
  ]
@@ -1,4 +1,4 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{5539:(e,t,s)=>{"use strict";s.d(t,{A:()=>p,w:()=>d});var i=s(95155),a=s(12115),l=s(14051),r=s.n(l),n=s(35497),o=s(73006);let d=new Set(["grok-web","chatgpt-web","gemini-web","muse-web","deepseek-web","uc-web"]),c={default:"person",grok:"bolt",work:"work",personal:"home"},m=[{key:"opening",label:"Opening browser window",icon:"open_in_new"},{key:"waiting",label:"Waiting for you to log in",icon:"hourglass_top"},{key:"saving",label:"Saving connection",icon:"save"}];function p({providerId:e,onConnected:t,size:s="sm"}){let[l,r]=(0,a.useState)(!1),[d,u]=(0,a.useState)("idle"),[x,h]=(0,a.useState)(""),[f,g]=(0,a.useState)(["default"]),[y,b]=(0,a.useState)("default"),v=(0,a.useRef)(null),j=(0,a.useRef)(null),w=(0,a.useCallback)(()=>{v.current&&(clearInterval(v.current),v.current=null)},[]);(0,a.useEffect)(()=>()=>{w(),j.current&&clearTimeout(j.current)},[w]),(0,a.useEffect)(()=>{if(!l)return;let t=!1;return fetch("/api/providers/web-login",{cache:"no-store"}).then(e=>e.json()).then(s=>{if(t||!Array.isArray(s.profiles))return;let i=window.localStorage.getItem(`weblogin:profile:${e}`),a=s.profiles.includes("default")?s.profiles:["default",...s.profiles];g(a),b(i&&a.includes(i)?i:"default")}).catch(()=>{}),()=>{t=!0}},[l,e]);let k=(0,a.useCallback)(t=>{b(t),window.localStorage.setItem(`weblogin:profile:${e}`,t)},[e]),N="opening"===d||"waiting"===d,C=(0,a.useCallback)(()=>{N||(w(),r(!1),"error"===d&&(u("idle"),h("")))},[N,d,w]),S=(0,a.useCallback)(()=>{w(),v.current=setInterval(async()=>{try{let s=await fetch(`/api/providers/web-login?provider=${encodeURIComponent(e)}`,{cache:"no-store"}),i=await s.json();"success"===i.status?(w(),u("success"),h(i.email?`${(0,o.Tl)("Signed in as")} ${i.email}`:"Connection saved"),"function"==typeof t&&t(),j.current=setTimeout(()=>{r(!1),h("")},1500)):"error"===i.status||"timeout"===i.status||"cancelled"===i.status?(w(),u("error"),h(i.error||(0,o.Tl)("Login failed"))):u(e=>"opening"===e?"waiting":e)}catch{}},2e3)},[e,t,w]),T=(0,a.useCallback)(async()=>{u("opening"),h("");try{let t=await fetch("/api/providers/web-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,profile:y})}),s=await t.json();if(!t.ok){u("error"),h(s.error||(0,o.Tl)("Failed to start login"));return}u("waiting"),h((0,o.Tl)("A browser window has opened — log in there, this page updates itself.")),S()}catch(e){u("error"),h(e?.message||(0,o.Tl)("Failed to start login"))}},[e,y,S]),A=(0,a.useCallback)(()=>{fetch(`/api/providers/web-login?provider=${encodeURIComponent(e)}`,{method:"DELETE"}).catch(()=>{}),w(),u("idle"),h("")},[e,w]),$=(0,a.useCallback)(()=>{let e=window.prompt((0,o.Tl)("New browser profile name (e.g. work, personal):"),"");if(!e)return;let t=e.trim().replace(/[^a-zA-Z0-9_-]/g,"-").slice(0,40);t&&(g(e=>e.includes(t)?e:[...e,t]),k(t))},[k]),O="opening"===d?0:"waiting"===d?1:"success"===d?2:-1;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.$n,{size:s,icon:"success"===d?"check_circle":"language",variant:"secondary",onClick:()=>{u("idle"),h(""),r(!0)},title:(0,o.Tl)("Open a browser window, log in by hand — the cookie is captured automatically"),children:"success"===d?(0,o.Tl)("Connected"):(0,o.Tl)("Login via Browser")}),(0,i.jsx)(n.aF,{isOpen:l,onClose:C,title:(0,o.Tl)("Login via Browser"),size:"sm",children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:(0,o.Tl)("A Chrome window opens on a shared browser profile. Log in there — the session is captured automatically. One Google login in a profile makes every other provider a single “Continue with Google” click.")}),(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,i.jsx)("span",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:(0,o.Tl)("Browser profile")}),(0,i.jsxs)("button",{type:"button",onClick:$,disabled:N,className:"flex items-center gap-1 text-xs text-primary hover:underline disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"add"}),(0,o.Tl)("New profile")]})]}),(0,i.jsx)("div",{className:"grid grid-cols-2 gap-2",children:f.map(e=>{let t=e===y;return(0,i.jsxs)("button",{type:"button",disabled:N,onClick:()=>k(e),className:`flex items-center gap-2 rounded border border-accent/30 bg-sidebar p-2 text-left text-sm transition-colors focus:outline-none focus:ring-1 focus:ring-primary disabled:opacity-50 ${t?"border-primary ring-1 ring-primary":"hover:border-accent/60"}`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:function(e){let t=String(e).toLowerCase();for(let[e,s]of Object.entries(c))if(t.includes(e))return s;return"folder_shared"}(e)}),(0,i.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e}),t&&(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"check_circle"})]},e)})})]}),"idle"!==d&&(0,i.jsx)("div",{className:"rounded border border-accent/20 bg-sidebar/50 p-3",children:"success"===d?(0,i.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-green-400",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"check_circle"}),"✓ ",x||(0,o.Tl)("Connection saved")]}):"error"===d?(0,i.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-yellow-400",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"error"}),(0,o.Tl)("Login failed")]}),x&&(0,i.jsx)("p",{className:"pl-6 text-xs text-red-500 break-words",children:x})]}):(0,i.jsxs)("ol",{className:"flex flex-col gap-2",children:[m.map((e,t)=>{let s=t<O,a=t===O;return(0,i.jsxs)("li",{className:`flex items-center gap-2 text-sm ${s?"text-green-400":a?"text-primary":"text-text-muted opacity-50"}`,children:[(0,i.jsx)("span",{className:`material-symbols-outlined text-[18px] ${a?"animate-pulse":""}`,children:s?"check_circle":e.icon}),(0,o.Tl)(e.label)]},e.key)}),x&&(0,i.jsx)("li",{className:"pl-6 text-xs text-text-muted",children:x})]})}),(0,i.jsx)("div",{className:"flex gap-2",children:"success"===d?(0,i.jsx)(n.$n,{onClick:C,fullWidth:!0,children:(0,o.Tl)("Done")}):N?(0,i.jsx)(n.$n,{onClick:A,variant:"ghost",fullWidth:!0,children:(0,o.Tl)("Cancel")}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.$n,{onClick:T,fullWidth:!0,disabled:"error"===d&&!x,children:(0,o.Tl)("Open Browser & Login")}),(0,i.jsx)(n.$n,{onClick:C,variant:"ghost",fullWidth:!0,disabled:N,children:(0,o.Tl)("Close")})]})})]})})]})}p.propTypes={providerId:r().string.isRequired,onConnected:r().func,size:r().oneOf(["sm","md","lg"])}},44983:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>en});var i=s(95155),a=s(12115),l=s(73321),r=s(98500),n=s.n(r),o=s(5772),d=s(8247),c=s(35497),m=s(88105),p=s(28777),u=s(67899),x=s(62630);s(67468);var h=s(13097);let f=["none","low","medium","high"],g=["none","thinking"],y=["none","low","medium","high","xhigh","max"],b={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":y,"claude-budget":y,"gemini-level":["minimal","low","medium","high"],"gemini-budget":f,zai:g,qwen:f,kimi:["none","low","medium","high","max"],deepseek:["none","high","max"],commandcode:["none","low","medium","high","xhigh","max"],minimax:g,hunyuan:f,step:f,nous:f},v=["none","minimal","low","medium","high","xhigh","max"],j=["none","low","medium","high","max"],w=[{pattern:"*gemini-4*",levels:["low","medium","high"]},{pattern:"*claude*4.6*",levels:j},{pattern:"*claude*4-6*",levels:j},{provider:"codex",pattern:"*gpt-6*",levels:v},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...v,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...v,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:v},{pattern:"*codex*",levels:["low","medium","high","xhigh"]},{provider:"opencode",pattern:"*mimo*v2.6*",levels:["none","minimal","low","medium","high","xhigh","max"]},{pattern:"*mimo*v2.6*",levels:["none","low","medium","high","xhigh"]},{pattern:"*mimo*v2.5-pro*",levels:["none","low","medium","high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4-pro",levels:["low","high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4.1-flash",levels:["low","high","max"]},{pattern:"*deepseek-v4.1-flash-free*",levels:["low","high","max"]},{pattern:"*deepseek-v4.*",levels:["none","low","medium","high","xhigh","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3-flash",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.2",levels:["high","xhigh"]},{provider:"codebuddy-cn",pattern:"kimi-k2.8-preview",levels:["low","medium","high"]},{provider:"codebuddy-cn",pattern:"hy3",levels:["low","high"]},{provider:"codebuddy-cn",pattern:"hy4-preview",levels:["high"]},{provider:"codebuddy-intl",pattern:"deepseek-v4*",levels:["low","high","xhigh"]},{provider:"minimax-code",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code",pattern:"MiniMax-M3",levels:["none","high"]},{provider:"minimax-code-global",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code-global",pattern:"MiniMax-M3",levels:["none","high"]}],k=/(?:^|\/)gpt-(?:5\.6|6)(?:[.-]|$)/i;function N(e,t){if("kiro"===e&&null===function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(t))return"reasoning";if(!t.includes("claude"))return null;let s=function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".").match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);return t?{major:Number(t[1]),minor:void 0===t[2]?null:Number(t[2])}:null}(e);if(!s)return null;let{major:i,minor:a}=s;return i<4||4===i&&(null===a||a<=5||null!==a&&a>=1e3)?null:"output_config"}(t))return null;let s=(0,u.nl)(e,t);if(!s.reasoning)return null;let i=String(t||"").replace(/\([^()]+\)\s*$/,""),a="codex"===e?(0,h.SM)("cx").find(e=>e.id===i)?.thinkingLevels:null,l=w.find(s=>(!s.provider||s.provider===e)&&(0,x.gH)(s.pattern,t)),r=a||l?.levels||(String(e||"").startsWith("openai-compatible-")&&k.test(i)?v:null)||b[s.thinkingFormat]||f;return!1===s.thinkingCanDisable&&(r=r.filter(e=>"none"!==e)),r}var C=s(11059),S=s(929),T=s(73006);let A=new Map;async function $(e){if(!e?.url||!e?.type)return[];let t=A.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let i=(await s.json()).data??[];return A.set(e.url,{data:i,expiresAt:Date.now()+6e5}),i}catch{return[]}}var O=s(81231),I=s(14051),P=s.n(I);function E({model:e,fullModel:t,alias:s,copied:a,onCopy:l,testStatus:r,isCustom:n,isFree:o,onDeleteAlias:d,onTest:m,isTesting:p,onDisable:u,caps:x,thinkingSuffix:h}){let f=h?`${t}(${h})`:t,g="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0;return(0,i.jsx)("div",{className:`group w-full sm:w-auto min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===r?"border-green-500/40":"error"===r?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,i.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base mt-0.5 sm:mt-0",style:g?{color:g}:void 0,children:"ok"===r?"check_circle":"error"===r?"cancel":"smart_toy"}),(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,i.jsx)("code",{className:"w-fit max-w-full break-all rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px] sm:truncate",children:f}),(0,i.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,i.jsx)("span",{className:"break-all sm:truncate text-[9px] italic text-text-muted/70",children:e.name}),(0,i.jsx)(c.nh,{caps:x,colorOverride:"text-text-muted/70",size:12})]})]}),(0,i.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5 sm:gap-1",children:[m&&(0,i.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,i.jsx)("button",{onClick:m,disabled:p,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${p?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:p?"Testing...":"Test"})]}),(0,i.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,i.jsx)("button",{onClick:()=>l(f,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:a===`model-${e.id}`?"Copied!":"Copy"})]}),n?(0,i.jsx)("button",{onClick:d,className:"rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):u?(0,i.jsx)("button",{onClick:u,className:"rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})]})})}function D({modelId:e,fullModel:t,copied:s,onCopy:a,onDeleteAlias:l,onTest:r,testStatus:n,isTesting:o}){let d="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,i.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,i.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,i.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:()=>a(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),r&&(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:r,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]})]})]}),(0,i.jsx)("button",{onClick:l,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function R({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,customModels:l,copied:r,onCopy:n,onDeleteAlias:o,onAddCustomModel:d,onDeleteCustomModel:m,connections:p,isAnthropic:u}){let[x,h]=(0,a.useState)(""),[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),[v,j]=(0,a.useState)(null),[w,k]=(0,a.useState)({}),N=async t=>{if(!v){j(t);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),i=await s.json();k(e=>({...e,[t]:i.ok?"ok":"error"}))}catch{k(e=>({...e,[t]:"error"}))}finally{j(null)}}},C=(0,O.R)({customModels:l,modelAliases:s,providerAlias:e,type:"llm"}),S=async()=>{if(!x.trim()||f)return;let e=x.trim();if(C.some(t=>t.id===e))return void alert("Model already exists for this provider.");g(!0);try{await d(e),h("")}catch(e){console.log("Error adding model:",e)}finally{g(!1)}},T=async()=>{if(y)return;let e=p.find(e=>!1!==e.isActive);if(e){b(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||"Failed to import models");let i=s.models||[];if(0===i.length)return void alert("No models returned from /models.");let a=0;for(let e of i){let t=e.id||e.name||e.model;t&&(C.some(e=>e.id===t)||(await d(t),a+=1))}0===a&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{b(!1)}}},A=p.some(e=>!1!==e.isActive);return(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",u?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,i.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,i.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,i.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,i.jsx)("input",{id:"new-compatible-model-input",type:"text",value:x,onChange:e=>h(e.target.value),onKeyDown:e=>"Enter"===e.key&&S(),placeholder:u?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:S,disabled:!x.trim()||f,children:f?"Adding...":"Add"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"download",onClick:T,disabled:!A||y,children:y?"Importing...":"Import from /models"})]}),!A&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),C.length>0&&(0,i.jsx)("div",{className:"flex flex-col gap-3",children:C.map(({id:s,alias:a,source:l})=>(0,i.jsx)(D,{modelId:s,fullModel:`${t}/${s}`,copied:r,onCopy:n,onDeleteAlias:()=>"custom"===l?m(s):o(a),onTest:p.length>0?()=>N(s):void 0,testStatus:w[s],isTesting:v===s},`${l}-${e}/${s}`))})]})}E.propTypes={model:P().shape({id:P().string.isRequired}).isRequired,fullModel:P().string.isRequired,alias:P().string,copied:P().string,onCopy:P().func.isRequired,testStatus:P().oneOf(["ok","error"]),isCustom:P().bool,isFree:P().bool,onDeleteAlias:P().func,onTest:P().func,isTesting:P().bool,onDisable:P().func,caps:P().object,thinkingSuffix:P().string},P().string.isRequired,P().string.isRequired,P().string,P().func.isRequired,P().func.isRequired,P().func,P().oneOf(["ok","error"]),P().bool,P().string.isRequired,P().object.isRequired,P().arrayOf(P().object),P().string,P().func.isRequired,P().func.isRequired,P().func.isRequired,P().func.isRequired,R.propTypes={providerStorageAlias:P().string.isRequired,providerDisplayAlias:P().string.isRequired,modelAliases:P().object.isRequired,customModels:P().arrayOf(P().object),copied:P().string,onCopy:P().func.isRequired,onDeleteAlias:P().func.isRequired,onAddCustomModel:P().func.isRequired,onDeleteCustomModel:P().func.isRequired,connections:P().arrayOf(P().shape({id:P().string,isActive:P().bool})).isRequired,isAnthropic:P().bool};var z=s(47650),_=s(70217);function M({until:e}){let[t,s]=(0,a.useState)("");return((0,a.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let i=Math.floor(t/1e3);if(i<60)s(`${i}s`);else if(i<3600)s(`${Math.floor(i/60)}m ${i%60}s`);else{let e=Math.floor(i/3600),t=Math.floor(i%3600/60);s(`${e}h ${t}m`)}};t();let i=setInterval(t,1e3);return()=>clearInterval(i)},[e]),t)?(0,i.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function q({connection:e,proxyPools:t,isOAuth:s,isFirst:l,isLast:r,onMoveUp:n,onMoveDown:o,onToggleActive:d,onUpdateProxy:m,onEdit:p,onDelete:u,oneByOneStatus:x=null,autoPing:h=null}){let[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),v=(0,a.useRef)(null),j=(0,a.useRef)(null),[w,k]=(0,a.useState)(null),N=new Map((t||[]).map(e=>[e.id,e])),C=e.providerSpecificData?.proxyPoolId||null,S=C?N.get(C):null,T=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,A=!!C||T,$=S?`Pool: ${S.name}`:C?`Pool: ${C} (inactive/missing)`:T?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",O=(()=>{if(!h)return"";let e=[];return(h.reactiveOn&&e.push("On reset"),h.scheduleOn&&e.push(`Scheduled (${h.scheduleSummary||"active"})`),e.length>0)?`Auto-ping active: ${e.join(" + ")}. Click to configure.`:"codex"===h.provider?"Auto-starts the next 5h Codex window after reset or on schedule. Click to configure.":"Auto-starts a new window on quota reset or fixed schedule. Click to configure."})(),I="";if(S?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=S?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);I=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{I=t}}let P=S?.noProxy||e.providerSpecificData?.connectionNoProxy||"",E="default";S?.isActive===!0?E="success":(C||T)&&(E="error"),(0,a.useEffect)(()=>{if(!f)return;let e=e=>{v.current?.contains(e.target)||j.current?.contains(e.target)||g(!1)},t=()=>g(!1);return document.addEventListener("mousedown",e),window.addEventListener("resize",t),document.addEventListener("scroll",t,!0),()=>{document.removeEventListener("mousedown",e),window.removeEventListener("resize",t),document.removeEventListener("scroll",t,!0)}},[f]);let D=async e=>{b(!0);try{await m("__none__"===e?null:e)}finally{b(!1),g(!1)}},R=e.authType||(s?"oauth":"apikey"),U="oauth"===R,L="cookie"===R,K="mcode-lease"===R,F=e=>"string"==typeof e&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),J=U?F(e.email)?e.email:F(e.name)?e.name:e.name||e.email||e.displayName||"OAuth Account":e.name||e.email||e.displayName||(K?"Desktop Lease":L?"Cookie Account":"API Key"),W=e.email||e.providerSpecificData?.email||e.providerSpecificData?.githubEmail||null,H=function(e){let t=e.providerSpecificData?.accountId||e.providerSpecificData?.ownerAccountId||e.providerSpecificData?.ssoInstanceAccountId||null;if(t)return{label:`Acct ${t}`,tooltip:`Account ID: ${t}`};if(!e.id)return null;let s=e.id.replace(/-/g,"").slice(0,8).toUpperCase();return{label:`ID#${s}`,tooltip:`Connection ID: ${e.id}`}}(e),[B,G]=(0,a.useState)(!1),Z=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,a.useEffect)(()=>{let t=()=>{G(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=Z?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[Z,e]);let V="unavailable"!==e.testStatus||B?e.testStatus:"active",Q=()=>x?"queued"===x.state?"queued":"testing"===x.state?"testing":"success"===x.state?"success":"failed"===x.state?x.error?`failed: ${x.error}`:"failed":null:null;return(0,i.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,i.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,i.jsx)("button",{onClick:n,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,i.jsx)("button",{onClick:o,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:K?"desktop_windows":L?"cookie":U?"lock":"key"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:J}),H&&(0,i.jsx)("span",{className:"shrink-0 rounded-full border border-black/10 bg-black/[0.03] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.14em] text-text-muted dark:border-white/10 dark:bg-white/[0.04]",title:H.tooltip,children:H.label})]}),W&&W!==J&&(0,i.jsx)("p",{className:"mt-0.5 truncate text-[11px] text-text-muted",title:W,children:W}),(0,i.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,i.jsx)(c.Ex,{variant:(0,_.g)(e.isActive,V),size:"sm",dot:!0,children:!1===e.isActive?"disabled":V||"Unknown"}),(0,i.jsx)(c.Ex,{variant:"default",size:"sm",children:K?"Desktop Lease":U?"OAuth":L?"Cookie":"API Key"}),A&&(0,i.jsx)(c.Ex,{variant:E,size:"sm",children:"Proxy"}),B&&!1!==e.isActive&&(0,i.jsx)(M,{until:Z}),e.lastError&&!1!==e.isActive&&(0,i.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),Q()&&(0,i.jsx)(c.Ex,{variant:x?"success"===x.state?"success":"failed"===x.state?"error":"testing"===x.state?"primary":"default":"default",size:"sm",children:Q()})]}),A&&(0,i.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,i.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:$,children:$}),I&&(0,i.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:I}),P&&(0,i.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:P,children:["no_proxy: ",P]})]})]})]}),(0,i.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,i.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(t||[]).length>0&&(0,i.jsxs)("div",{children:[(0,i.jsxs)("button",{ref:j,onClick:()=>{if(f)return void g(!1);let e=j.current?.getBoundingClientRect();if(!e)return void g(!0);let s=((t?.length||0)+1)*34+8,i=window.innerHeight-e.bottom,a=i<s&&e.top>i;k({position:"fixed",right:window.innerWidth-e.right,...a?{bottom:window.innerHeight-e.top+4,maxHeight:Math.max(e.top-8,120)}:{top:e.bottom+4,maxHeight:Math.max(i-8,120)}}),g(!0)},className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${A?"text-primary":"text-text-muted hover:text-primary"}`,disabled:y,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),f&&(0,z.createPortal)((0,i.jsxs)("div",{ref:v,style:w,className:"z-50 max-w-[78vw] min-w-[160px] overflow-y-auto rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,i.jsx)("button",{onClick:()=>D("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!C?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,i.jsx)("button",{onClick:()=>D(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${C===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]}),document.body)]}),h&&(0,i.jsx)(c.m_,{text:O,children:(0,i.jsxs)("button",{onClick:h.onConfigure,className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${h.isActive?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,i.jsxs)("button",{onClick:p,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,i.jsxs)("button",{onClick:u,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,i.jsx)(c.lM,{size:"sm",checked:e.isActive??!0,onChange:d,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}M.propTypes={until:P().string.isRequired},q.propTypes={connection:P().shape({id:P().string,name:P().string,email:P().string,displayName:P().string,modelLockUntil:P().string,testStatus:P().string,isActive:P().bool,lastError:P().string,priority:P().number,globalPriority:P().number,providerSpecificData:P().object}).isRequired,proxyPools:P().arrayOf(P().shape({id:P().string,name:P().string,proxyUrl:P().string,noProxy:P().string,isActive:P().bool})),isOAuth:P().bool.isRequired,isFirst:P().bool.isRequired,isLast:P().bool.isRequired,onMoveUp:P().func.isRequired,onMoveDown:P().func.isRequired,onToggleActive:P().func.isRequired,onUpdateProxy:P().func,onEdit:P().func.isRequired,onDelete:P().func.isRequired,oneByOneStatus:P().shape({state:P().string,error:P().string}),autoPing:P().shape({isActive:P().bool,provider:P().string,reactiveOn:P().bool,scheduleOn:P().bool,scheduleSummary:P().string,onConfigure:P().func})};let U=`name1|sk-key1
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{5539:(e,t,s)=>{"use strict";s.d(t,{A:()=>p,w:()=>d});var i=s(95155),a=s(12115),l=s(14051),r=s.n(l),n=s(35497),o=s(73006);let d=new Set(["grok-web","chatgpt-web","gemini-web","muse-web","deepseek-web","uc-web"]),c={default:"person",grok:"bolt",work:"work",personal:"home"},m=[{key:"opening",label:"Opening browser window",icon:"open_in_new"},{key:"waiting",label:"Waiting for you to log in",icon:"hourglass_top"},{key:"saving",label:"Saving connection",icon:"save"}];function p({providerId:e,onConnected:t,size:s="sm"}){let[l,r]=(0,a.useState)(!1),[d,u]=(0,a.useState)("idle"),[x,h]=(0,a.useState)(""),[f,g]=(0,a.useState)(["default"]),[y,b]=(0,a.useState)("default"),v=(0,a.useRef)(null),j=(0,a.useRef)(null),w=(0,a.useCallback)(()=>{v.current&&(clearInterval(v.current),v.current=null)},[]);(0,a.useEffect)(()=>()=>{w(),j.current&&clearTimeout(j.current)},[w]),(0,a.useEffect)(()=>{if(!l)return;let t=!1;return fetch("/api/providers/web-login",{cache:"no-store"}).then(e=>e.json()).then(s=>{if(t||!Array.isArray(s.profiles))return;let i=window.localStorage.getItem(`weblogin:profile:${e}`),a=s.profiles.includes("default")?s.profiles:["default",...s.profiles];g(a),b(i&&a.includes(i)?i:"default")}).catch(()=>{}),()=>{t=!0}},[l,e]);let k=(0,a.useCallback)(t=>{b(t),window.localStorage.setItem(`weblogin:profile:${e}`,t)},[e]),N="opening"===d||"waiting"===d,C=(0,a.useCallback)(()=>{N||(w(),r(!1),"error"===d&&(u("idle"),h("")))},[N,d,w]),S=(0,a.useCallback)(()=>{w();let s=!1;v.current=setInterval(async()=>{if(!s){s=!0;try{let s=await fetch(`/api/providers/web-login?provider=${encodeURIComponent(e)}`,{cache:"no-store"}),i=await s.json();"success"===i.status?(w(),u("success"),h(i.email?`${(0,o.Tl)("Signed in as")} ${i.email}`:"Connection saved"),"function"==typeof t&&t(),j.current=setTimeout(()=>{r(!1),h("")},1500)):"error"===i.status||"timeout"===i.status||"cancelled"===i.status?(w(),u("error"),h(i.error||(0,o.Tl)("Login failed"))):u(e=>"opening"===e?"waiting":e)}catch{}finally{s=!1}}},2e3)},[e,t,w]),T=(0,a.useCallback)(async()=>{u("opening"),h("");try{let t=await fetch("/api/providers/web-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,profile:y})}),s=await t.json();if(!t.ok){u("error"),h(s.error||(0,o.Tl)("Failed to start login"));return}u("waiting"),h((0,o.Tl)("A browser window has opened — log in there, this page updates itself.")),S()}catch(e){u("error"),h(e?.message||(0,o.Tl)("Failed to start login"))}},[e,y,S]),A=(0,a.useCallback)(()=>{fetch(`/api/providers/web-login?provider=${encodeURIComponent(e)}`,{method:"DELETE"}).catch(()=>{}),w(),u("idle"),h("")},[e,w]),$=(0,a.useCallback)(()=>{let e=window.prompt((0,o.Tl)("New browser profile name (e.g. work, personal):"),"");if(!e)return;let t=e.trim().replace(/[^a-zA-Z0-9_-]/g,"-").slice(0,40);t&&(g(e=>e.includes(t)?e:[...e,t]),k(t))},[k]),O="opening"===d?0:"waiting"===d?1:"success"===d?2:-1;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.$n,{size:s,icon:"success"===d?"check_circle":"language",variant:"secondary",onClick:()=>{u("idle"),h(""),r(!0)},title:(0,o.Tl)("Open a browser window, log in by hand — the cookie is captured automatically"),children:"success"===d?(0,o.Tl)("Connected"):(0,o.Tl)("Login via Browser")}),(0,i.jsx)(n.aF,{isOpen:l,onClose:C,title:(0,o.Tl)("Login via Browser"),size:"sm",children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:(0,o.Tl)("A Chrome window opens on a shared browser profile. Log in there — the session is captured automatically. One Google login in a profile makes every other provider a single “Continue with Google” click.")}),(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,i.jsx)("span",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:(0,o.Tl)("Browser profile")}),(0,i.jsxs)("button",{type:"button",onClick:$,disabled:N,className:"flex items-center gap-1 text-xs text-primary hover:underline disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"add"}),(0,o.Tl)("New profile")]})]}),(0,i.jsx)("div",{className:"grid grid-cols-2 gap-2",children:f.map(e=>{let t=e===y;return(0,i.jsxs)("button",{type:"button",disabled:N,onClick:()=>k(e),className:`flex items-center gap-2 rounded border border-accent/30 bg-sidebar p-2 text-left text-sm transition-colors focus:outline-none focus:ring-1 focus:ring-primary disabled:opacity-50 ${t?"border-primary ring-1 ring-primary":"hover:border-accent/60"}`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:function(e){let t=String(e).toLowerCase();for(let[e,s]of Object.entries(c))if(t.includes(e))return s;return"folder_shared"}(e)}),(0,i.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e}),t&&(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"check_circle"})]},e)})})]}),"idle"!==d&&(0,i.jsx)("div",{className:"rounded border border-accent/20 bg-sidebar/50 p-3",children:"success"===d?(0,i.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-green-400",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"check_circle"}),"✓ ",x||(0,o.Tl)("Connection saved")]}):"error"===d?(0,i.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-yellow-400",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"error"}),(0,o.Tl)("Login failed")]}),x&&(0,i.jsx)("p",{className:"pl-6 text-xs text-red-500 break-words",children:x})]}):(0,i.jsxs)("ol",{className:"flex flex-col gap-2",children:[m.map((e,t)=>{let s=t<O,a=t===O;return(0,i.jsxs)("li",{className:`flex items-center gap-2 text-sm ${s?"text-green-400":a?"text-primary":"text-text-muted opacity-50"}`,children:[(0,i.jsx)("span",{className:`material-symbols-outlined text-[18px] ${a?"animate-pulse":""}`,children:s?"check_circle":e.icon}),(0,o.Tl)(e.label)]},e.key)}),x&&(0,i.jsx)("li",{className:"pl-6 text-xs text-text-muted",children:x})]})}),(0,i.jsx)("div",{className:"flex gap-2",children:"success"===d?(0,i.jsx)(n.$n,{onClick:C,fullWidth:!0,children:(0,o.Tl)("Done")}):N?(0,i.jsx)(n.$n,{onClick:A,variant:"ghost",fullWidth:!0,children:(0,o.Tl)("Cancel")}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.$n,{onClick:T,fullWidth:!0,disabled:"error"===d&&!x,children:(0,o.Tl)("Open Browser & Login")}),(0,i.jsx)(n.$n,{onClick:C,variant:"ghost",fullWidth:!0,disabled:N,children:(0,o.Tl)("Close")})]})})]})})]})}p.propTypes={providerId:r().string.isRequired,onConnected:r().func,size:r().oneOf(["sm","md","lg"])}},44983:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>en});var i=s(95155),a=s(12115),l=s(73321),r=s(98500),n=s.n(r),o=s(5772),d=s(8247),c=s(35497),m=s(88105),p=s(28777),u=s(67899),x=s(62630);s(67468);var h=s(13097);let f=["none","low","medium","high"],g=["none","thinking"],y=["none","low","medium","high","xhigh","max"],b={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":y,"claude-budget":y,"gemini-level":["minimal","low","medium","high"],"gemini-budget":f,zai:g,qwen:f,kimi:["none","low","medium","high","max"],deepseek:["none","high","max"],commandcode:["none","low","medium","high","xhigh","max"],minimax:g,hunyuan:f,step:f,nous:f},v=["none","minimal","low","medium","high","xhigh","max"],j=["none","low","medium","high","max"],w=[{pattern:"*gemini-4*",levels:["low","medium","high"]},{pattern:"*claude*4.6*",levels:j},{pattern:"*claude*4-6*",levels:j},{provider:"codex",pattern:"*gpt-6*",levels:v},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...v,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...v,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:v},{pattern:"*codex*",levels:["low","medium","high","xhigh"]},{provider:"opencode",pattern:"*mimo*v2.6*",levels:["none","minimal","low","medium","high","xhigh","max"]},{pattern:"*mimo*v2.6*",levels:["none","low","medium","high","xhigh"]},{pattern:"*mimo*v2.5-pro*",levels:["none","low","medium","high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4-pro",levels:["low","high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4.1-flash",levels:["low","high","max"]},{pattern:"*deepseek-v4.1-flash-free*",levels:["low","high","max"]},{pattern:"*deepseek-v4.*",levels:["none","low","medium","high","xhigh","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3-flash",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.2",levels:["high","xhigh"]},{provider:"codebuddy-cn",pattern:"kimi-k2.8-preview",levels:["low","medium","high"]},{provider:"codebuddy-cn",pattern:"hy3",levels:["low","high"]},{provider:"codebuddy-cn",pattern:"hy4-preview",levels:["high"]},{provider:"codebuddy-intl",pattern:"deepseek-v4*",levels:["low","high","xhigh"]},{provider:"minimax-code",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code",pattern:"MiniMax-M3",levels:["none","high"]},{provider:"minimax-code-global",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code-global",pattern:"MiniMax-M3",levels:["none","high"]}],k=/(?:^|\/)gpt-(?:5\.6|6)(?:[.-]|$)/i;function N(e,t){if("kiro"===e&&null===function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(t))return"reasoning";if(!t.includes("claude"))return null;let s=function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".").match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);return t?{major:Number(t[1]),minor:void 0===t[2]?null:Number(t[2])}:null}(e);if(!s)return null;let{major:i,minor:a}=s;return i<4||4===i&&(null===a||a<=5||null!==a&&a>=1e3)?null:"output_config"}(t))return null;let s=(0,u.nl)(e,t);if(!s.reasoning)return null;let i=String(t||"").replace(/\([^()]+\)\s*$/,""),a="codex"===e?(0,h.SM)("cx").find(e=>e.id===i)?.thinkingLevels:null,l=w.find(s=>(!s.provider||s.provider===e)&&(0,x.gH)(s.pattern,t)),r=a||l?.levels||(String(e||"").startsWith("openai-compatible-")&&k.test(i)?v:null)||b[s.thinkingFormat]||f;return!1===s.thinkingCanDisable&&(r=r.filter(e=>"none"!==e)),r}var C=s(11059),S=s(929),T=s(73006);let A=new Map;async function $(e){if(!e?.url||!e?.type)return[];let t=A.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let i=(await s.json()).data??[];return A.set(e.url,{data:i,expiresAt:Date.now()+6e5}),i}catch{return[]}}var O=s(81231),I=s(14051),P=s.n(I);function E({model:e,fullModel:t,alias:s,copied:a,onCopy:l,testStatus:r,isCustom:n,isFree:o,onDeleteAlias:d,onTest:m,isTesting:p,onDisable:u,caps:x,thinkingSuffix:h}){let f=h?`${t}(${h})`:t,g="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0;return(0,i.jsx)("div",{className:`group w-full sm:w-auto min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===r?"border-green-500/40":"error"===r?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,i.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base mt-0.5 sm:mt-0",style:g?{color:g}:void 0,children:"ok"===r?"check_circle":"error"===r?"cancel":"smart_toy"}),(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,i.jsx)("code",{className:"w-fit max-w-full break-all rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px] sm:truncate",children:f}),(0,i.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,i.jsx)("span",{className:"break-all sm:truncate text-[9px] italic text-text-muted/70",children:e.name}),(0,i.jsx)(c.nh,{caps:x,colorOverride:"text-text-muted/70",size:12})]})]}),(0,i.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5 sm:gap-1",children:[m&&(0,i.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,i.jsx)("button",{onClick:m,disabled:p,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${p?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:p?"Testing...":"Test"})]}),(0,i.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,i.jsx)("button",{onClick:()=>l(f,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:a===`model-${e.id}`?"Copied!":"Copy"})]}),n?(0,i.jsx)("button",{onClick:d,className:"rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):u?(0,i.jsx)("button",{onClick:u,className:"rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})]})})}function D({modelId:e,fullModel:t,copied:s,onCopy:a,onDeleteAlias:l,onTest:r,testStatus:n,isTesting:o}){let d="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,i.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,i.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,i.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:()=>a(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),r&&(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:r,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]})]})]}),(0,i.jsx)("button",{onClick:l,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function R({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,customModels:l,copied:r,onCopy:n,onDeleteAlias:o,onAddCustomModel:d,onDeleteCustomModel:m,connections:p,isAnthropic:u}){let[x,h]=(0,a.useState)(""),[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),[v,j]=(0,a.useState)(null),[w,k]=(0,a.useState)({}),N=async t=>{if(!v){j(t);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),i=await s.json();k(e=>({...e,[t]:i.ok?"ok":"error"}))}catch{k(e=>({...e,[t]:"error"}))}finally{j(null)}}},C=(0,O.R)({customModels:l,modelAliases:s,providerAlias:e,type:"llm"}),S=async()=>{if(!x.trim()||f)return;let e=x.trim();if(C.some(t=>t.id===e))return void alert("Model already exists for this provider.");g(!0);try{await d(e),h("")}catch(e){console.log("Error adding model:",e)}finally{g(!1)}},T=async()=>{if(y)return;let e=p.find(e=>!1!==e.isActive);if(e){b(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||"Failed to import models");let i=s.models||[];if(0===i.length)return void alert("No models returned from /models.");let a=0;for(let e of i){let t=e.id||e.name||e.model;t&&(C.some(e=>e.id===t)||(await d(t),a+=1))}0===a&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{b(!1)}}},A=p.some(e=>!1!==e.isActive);return(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",u?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,i.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,i.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,i.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,i.jsx)("input",{id:"new-compatible-model-input",type:"text",value:x,onChange:e=>h(e.target.value),onKeyDown:e=>"Enter"===e.key&&S(),placeholder:u?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:S,disabled:!x.trim()||f,children:f?"Adding...":"Add"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"download",onClick:T,disabled:!A||y,children:y?"Importing...":"Import from /models"})]}),!A&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),C.length>0&&(0,i.jsx)("div",{className:"flex flex-col gap-3",children:C.map(({id:s,alias:a,source:l})=>(0,i.jsx)(D,{modelId:s,fullModel:`${t}/${s}`,copied:r,onCopy:n,onDeleteAlias:()=>"custom"===l?m(s):o(a),onTest:p.length>0?()=>N(s):void 0,testStatus:w[s],isTesting:v===s},`${l}-${e}/${s}`))})]})}E.propTypes={model:P().shape({id:P().string.isRequired}).isRequired,fullModel:P().string.isRequired,alias:P().string,copied:P().string,onCopy:P().func.isRequired,testStatus:P().oneOf(["ok","error"]),isCustom:P().bool,isFree:P().bool,onDeleteAlias:P().func,onTest:P().func,isTesting:P().bool,onDisable:P().func,caps:P().object,thinkingSuffix:P().string},P().string.isRequired,P().string.isRequired,P().string,P().func.isRequired,P().func.isRequired,P().func,P().oneOf(["ok","error"]),P().bool,P().string.isRequired,P().object.isRequired,P().arrayOf(P().object),P().string,P().func.isRequired,P().func.isRequired,P().func.isRequired,P().func.isRequired,R.propTypes={providerStorageAlias:P().string.isRequired,providerDisplayAlias:P().string.isRequired,modelAliases:P().object.isRequired,customModels:P().arrayOf(P().object),copied:P().string,onCopy:P().func.isRequired,onDeleteAlias:P().func.isRequired,onAddCustomModel:P().func.isRequired,onDeleteCustomModel:P().func.isRequired,connections:P().arrayOf(P().shape({id:P().string,isActive:P().bool})).isRequired,isAnthropic:P().bool};var z=s(47650),_=s(70217);function M({until:e}){let[t,s]=(0,a.useState)("");return((0,a.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let i=Math.floor(t/1e3);if(i<60)s(`${i}s`);else if(i<3600)s(`${Math.floor(i/60)}m ${i%60}s`);else{let e=Math.floor(i/3600),t=Math.floor(i%3600/60);s(`${e}h ${t}m`)}};t();let i=setInterval(t,1e3);return()=>clearInterval(i)},[e]),t)?(0,i.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function q({connection:e,proxyPools:t,isOAuth:s,isFirst:l,isLast:r,onMoveUp:n,onMoveDown:o,onToggleActive:d,onUpdateProxy:m,onEdit:p,onDelete:u,oneByOneStatus:x=null,autoPing:h=null}){let[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),v=(0,a.useRef)(null),j=(0,a.useRef)(null),[w,k]=(0,a.useState)(null),N=new Map((t||[]).map(e=>[e.id,e])),C=e.providerSpecificData?.proxyPoolId||null,S=C?N.get(C):null,T=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,A=!!C||T,$=S?`Pool: ${S.name}`:C?`Pool: ${C} (inactive/missing)`:T?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",O=(()=>{if(!h)return"";let e=[];return(h.reactiveOn&&e.push("On reset"),h.scheduleOn&&e.push(`Scheduled (${h.scheduleSummary||"active"})`),e.length>0)?`Auto-ping active: ${e.join(" + ")}. Click to configure.`:"codex"===h.provider?"Auto-starts the next 5h Codex window after reset or on schedule. Click to configure.":"Auto-starts a new window on quota reset or fixed schedule. Click to configure."})(),I="";if(S?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=S?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);I=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{I=t}}let P=S?.noProxy||e.providerSpecificData?.connectionNoProxy||"",E="default";S?.isActive===!0?E="success":(C||T)&&(E="error"),(0,a.useEffect)(()=>{if(!f)return;let e=e=>{v.current?.contains(e.target)||j.current?.contains(e.target)||g(!1)},t=()=>g(!1);return document.addEventListener("mousedown",e),window.addEventListener("resize",t),document.addEventListener("scroll",t,!0),()=>{document.removeEventListener("mousedown",e),window.removeEventListener("resize",t),document.removeEventListener("scroll",t,!0)}},[f]);let D=async e=>{b(!0);try{await m("__none__"===e?null:e)}finally{b(!1),g(!1)}},R=e.authType||(s?"oauth":"apikey"),U="oauth"===R,L="cookie"===R,K="mcode-lease"===R,F=e=>"string"==typeof e&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),J=U?F(e.email)?e.email:F(e.name)?e.name:e.name||e.email||e.displayName||"OAuth Account":e.name||e.email||e.displayName||(K?"Desktop Lease":L?"Cookie Account":"API Key"),W=e.email||e.providerSpecificData?.email||e.providerSpecificData?.githubEmail||null,H=function(e){let t=e.providerSpecificData?.accountId||e.providerSpecificData?.ownerAccountId||e.providerSpecificData?.ssoInstanceAccountId||null;if(t)return{label:`Acct ${t}`,tooltip:`Account ID: ${t}`};if(!e.id)return null;let s=e.id.replace(/-/g,"").slice(0,8).toUpperCase();return{label:`ID#${s}`,tooltip:`Connection ID: ${e.id}`}}(e),[B,G]=(0,a.useState)(!1),Z=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,a.useEffect)(()=>{let t=()=>{G(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=Z?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[Z,e]);let V="unavailable"!==e.testStatus||B?e.testStatus:"active",Q=()=>x?"queued"===x.state?"queued":"testing"===x.state?"testing":"success"===x.state?"success":"failed"===x.state?x.error?`failed: ${x.error}`:"failed":null:null;return(0,i.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,i.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,i.jsx)("button",{onClick:n,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,i.jsx)("button",{onClick:o,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:K?"desktop_windows":L?"cookie":U?"lock":"key"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:J}),H&&(0,i.jsx)("span",{className:"shrink-0 rounded-full border border-black/10 bg-black/[0.03] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.14em] text-text-muted dark:border-white/10 dark:bg-white/[0.04]",title:H.tooltip,children:H.label})]}),W&&W!==J&&(0,i.jsx)("p",{className:"mt-0.5 truncate text-[11px] text-text-muted",title:W,children:W}),(0,i.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,i.jsx)(c.Ex,{variant:(0,_.g)(e.isActive,V),size:"sm",dot:!0,children:!1===e.isActive?"disabled":V||"Unknown"}),(0,i.jsx)(c.Ex,{variant:"default",size:"sm",children:K?"Desktop Lease":U?"OAuth":L?"Cookie":"API Key"}),A&&(0,i.jsx)(c.Ex,{variant:E,size:"sm",children:"Proxy"}),B&&!1!==e.isActive&&(0,i.jsx)(M,{until:Z}),e.lastError&&!1!==e.isActive&&(0,i.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),Q()&&(0,i.jsx)(c.Ex,{variant:x?"success"===x.state?"success":"failed"===x.state?"error":"testing"===x.state?"primary":"default":"default",size:"sm",children:Q()})]}),A&&(0,i.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,i.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:$,children:$}),I&&(0,i.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:I}),P&&(0,i.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:P,children:["no_proxy: ",P]})]})]})]}),(0,i.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,i.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(t||[]).length>0&&(0,i.jsxs)("div",{children:[(0,i.jsxs)("button",{ref:j,onClick:()=>{if(f)return void g(!1);let e=j.current?.getBoundingClientRect();if(!e)return void g(!0);let s=((t?.length||0)+1)*34+8,i=window.innerHeight-e.bottom,a=i<s&&e.top>i;k({position:"fixed",right:window.innerWidth-e.right,...a?{bottom:window.innerHeight-e.top+4,maxHeight:Math.max(e.top-8,120)}:{top:e.bottom+4,maxHeight:Math.max(i-8,120)}}),g(!0)},className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${A?"text-primary":"text-text-muted hover:text-primary"}`,disabled:y,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),f&&(0,z.createPortal)((0,i.jsxs)("div",{ref:v,style:w,className:"z-50 max-w-[78vw] min-w-[160px] overflow-y-auto rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,i.jsx)("button",{onClick:()=>D("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!C?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,i.jsx)("button",{onClick:()=>D(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${C===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]}),document.body)]}),h&&(0,i.jsx)(c.m_,{text:O,children:(0,i.jsxs)("button",{onClick:h.onConfigure,className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${h.isActive?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,i.jsxs)("button",{onClick:p,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,i.jsxs)("button",{onClick:u,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,i.jsx)(c.lM,{size:"sm",checked:e.isActive??!0,onChange:d,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}M.propTypes={until:P().string.isRequired},q.propTypes={connection:P().shape({id:P().string,name:P().string,email:P().string,displayName:P().string,modelLockUntil:P().string,testStatus:P().string,isActive:P().bool,lastError:P().string,priority:P().number,globalPriority:P().number,providerSpecificData:P().object}).isRequired,proxyPools:P().arrayOf(P().shape({id:P().string,name:P().string,proxyUrl:P().string,noProxy:P().string,isActive:P().bool})),isOAuth:P().bool.isRequired,isFirst:P().bool.isRequired,isLast:P().bool.isRequired,onMoveUp:P().func.isRequired,onMoveDown:P().func.isRequired,onToggleActive:P().func.isRequired,onUpdateProxy:P().func,onEdit:P().func.isRequired,onDelete:P().func.isRequired,oneByOneStatus:P().shape({state:P().string,error:P().string}),autoPing:P().shape({isActive:P().bool,provider:P().string,reactiveOn:P().bool,scheduleOn:P().bool,scheduleSummary:P().string,onConfigure:P().func})};let U=`name1|sk-key1
2
2
  name2|sk-key2
3
3
  sk-key-only-auto-named`;function L({isOpen:e,provider:t,providerName:s,isCompatible:l,isAnthropic:r,authType:n,authHint:o,website:d,proxyPools:p,error:u,existingNames:x,onSave:h,onBulkDone:f,onClose:g}){let y="__none__",b="ollama-local"===t,v="cookie"===n,j="xai"===t&&!v,w=v?"Cookie Value":"qoder"===t||"qoder-cn"===t?"Personal Access Token (PAT)":"API Key",k="azure"===t,N="cloudflare-ai"===t,C=m.Q2?.[t]?.credentialForm==="aws",S=m.Q2?.[t]?.apiKeyOptionalWith||null,T=m.Q2?.[t]?.regions||null,A=m.Q2?.[t]?.defaultRegion||T?.[0]?.id||"",[$,O]=(0,a.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:y,ollamaHostUrl:""}),[I,P]=(0,a.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[E,D]=(0,a.useState)({accountId:""}),[R,z]=(0,a.useState)({profile:"",region:"",accessKeyId:"",sessionToken:""}),[_,M]=(0,a.useState)(A),[q,K]=(0,a.useState)(!1),[F,J]=(0,a.useState)(null),[W,H]=(0,a.useState)(!1),[B,G]=(0,a.useState)(!1),[Z,V]=(0,a.useState)(null),Q=async()=>{G(!0),V(null);try{let e=await fetch("/api/oauth/commandcode/auto-import"),t=await e.json();t.found&&t.apiKey?O(e=>({...e,name:e.name||t.userName||t.keyName||"CommandCode CLI",apiKey:t.apiKey})):V(t.error||"Could not find Command Code credentials")}catch{V("Failed to auto-import from Command Code CLI")}finally{G(!1)}},X=N?`name1|sk-key1|acc123456
4
4
  name2|sk-key2|def789012
@@ -36,6 +36,7 @@ export async function handleSystemoneCore({
36
36
  credentials,
37
37
  log,
38
38
  onRequestSuccess,
39
+ signal,
39
40
  }) {
40
41
  const { provider, model } = modelInfo;
41
42
  const cfg = PROVIDER_MEDIA[provider]?.systemoneConfig;
@@ -85,13 +86,13 @@ export async function handleSystemoneCore({
85
86
 
86
87
  let providerResponse;
87
88
  try {
89
+ signal?.throwIfAborted();
90
+ const connectSignal = AbortSignal.timeout(FETCH_CONNECT_TIMEOUT_MS);
88
91
  providerResponse = await fetch(targetUrl, {
89
92
  method: "POST",
90
93
  headers,
91
94
  body: JSON.stringify(requestBody),
92
- ...(typeof AbortSignal?.timeout === "function"
93
- ? { signal: AbortSignal.timeout(FETCH_CONNECT_TIMEOUT_MS) }
94
- : {}),
95
+ signal: signal ? AbortSignal.any([signal, connectSignal]) : connectSignal,
95
96
  });
96
97
  } catch (error) {
97
98
  const errMsg = formatProviderError(error, provider, model, HTTP_STATUS.BAD_GATEWAY);
@@ -4,8 +4,9 @@ import { ROLE, OPENAI_BLOCK, CLAUDE_BLOCK, VALID_OPENAI_CONTENT_TYPES, VALID_OPE
4
4
  // Re-export valid-type lists (moved to schema/blocks.js) to keep existing importers working.
5
5
  export { VALID_OPENAI_CONTENT_TYPES, VALID_OPENAI_MESSAGE_TYPES };
6
6
 
7
- function normalizeOpenAIContent(content) {
7
+ function normalizeOpenAIContent(content, preserveCacheControl = false) {
8
8
  if (content.length === 0) return "";
9
+ if (preserveCacheControl && content.some(block => block.cache_control)) return content;
9
10
  if (content.every((block) => block.type === "text")) {
10
11
  return content.map((block) => block.text || "").join("\n");
11
12
  }
@@ -62,7 +63,7 @@ export function filterToOpenAIFormat(body, opts = {}) {
62
63
  filteredContent.push({ type: OPENAI_BLOCK.TEXT, text: "" });
63
64
  }
64
65
 
65
- return { ...msg, content: normalizeOpenAIContent(filteredContent) };
66
+ return { ...msg, content: normalizeOpenAIContent(filteredContent, keepCache) };
66
67
  }
67
68
 
68
69
  return msg;
package/app/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n9router",
3
- "version": "0.4.63",
3
+ "version": "0.4.65",
4
4
  "description": "Self-hosted AI routing gateway — local proxy for Claude, Gemini, OpenAI and 40+ providers",
5
5
  "keywords": [
6
6
  "ai",
package/app/server.js CHANGED
@@ -9,7 +9,7 @@ const currentPort = parseInt(process.env.PORT, 10) || 3000
9
9
  const hostname = process.env.HOSTNAME || '0.0.0.0'
10
10
 
11
11
  let keepAliveTimeout = parseInt(process.env.KEEP_ALIVE_TIMEOUT, 10)
12
- const nextConfig = {"env":{},"typescript":{"ignoreBuildErrors":false},"typedRoutes":false,"distDir":"./.next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.mjs","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"instrumentationClientInject":[],"poweredByHeader":true,"compress":true,"images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":14400,"formats":["image/webp"],"maximumRedirects":3,"maximumResponseBody":50000000,"dangerouslyAllowLocalIP":false,"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"attachment","localPatterns":[{"pathname":"**","search":""}],"remotePatterns":[],"qualities":[75],"unoptimized":true,"customCacheHandler":false},"devIndicators":{"position":"bottom-left"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"excludeDefaultMomentLocales":true,"reactProductionProfiling":false,"reactStrictMode":null,"reactMaxHeadersLength":6000,"httpAgentOptions":{"keepAlive":true},"logging":{"serverFunctions":true,"browserToTerminal":"warn"},"compiler":{},"expireTime":31536000,"staticPageGenerationTimeout":60,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"outputFileTracingRoot":"/Users/cuongquach/projects/vibe/n9router","enablePrerenderSourceMaps":true,"cacheComponents":false,"cacheLife":{"default":{"stale":300,"revalidate":900,"expire":4294967294},"seconds":{"stale":30,"revalidate":1,"expire":60},"minutes":{"stale":300,"revalidate":60,"expire":3600},"hours":{"stale":300,"revalidate":3600,"expire":86400},"days":{"stale":300,"revalidate":86400,"expire":604800},"weeks":{"stale":300,"revalidate":604800,"expire":2592000},"max":{"stale":300,"revalidate":2592000,"expire":31536000}},"cacheHandlers":{},"deprecated":{},"experimental":{"agentUpgrade":"security","agentFeedback":false,"coldCacheBadge":false,"collapseAdapterRoutes":true,"devValidationWorker":true,"useSkewCookie":false,"cssChunking":true,"multiZoneDraftMode":false,"appNavFailHandling":false,"parallelRouteMetadata":false,"prerenderEarlyExit":true,"serverMinification":true,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"cachedNavigations":false,"dynamicOnHover":false,"reactBrowserBailout":true,"useOffline":false,"varyParams":true,"optimisticRouting":true,"concurrentRouterQueue":false,"instrumentationClientRouterTransitionEvents":false,"prefetchInlining":{"maxSize":2048,"maxBundleSize":10240},"preloadEntriesOnStart":true,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","proxyPrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":9,"memoryBasedWorkersCount":false,"imgOptConcurrency":null,"imgOptOperationCache":null,"imgOptTimeoutInSeconds":7,"imgOptMaxInputPixels":268402689,"imgOptSequentialRead":null,"imgOptMozjpeg":true,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"devMemoryThresholdRestart":true,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"swcTraceProfiling":false,"forceSwcTransforms":false,"requestInsights":false,"largePageDataBytes":128000,"typedEnv":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"authInterrupts":false,"webpackMemoryOptimizations":false,"optimizeServerReact":true,"strictRouteTypes":false,"useTypeScriptCli":true,"removeUncaughtErrorAndRejectionListeners":false,"validateRSCRequestHeaders":true,"staleTimes":{"dynamic":0,"static":300},"reactDebugChannel":true,"serverComponentsHmrCache":true,"serverComponentsHmrCancellation":false,"staticGenerationMaxConcurrency":8,"staticGenerationMinPagesPerWorker":25,"transitionIndicator":false,"gestureTransition":false,"inlineCss":false,"useCache":false,"useCacheStaticRootParamTracking":false,"globalNotFound":false,"explicitParallelRouteChildren":true,"strictRouteMatching":true,"browserDebugInfoInTerminal":"warn","lockDistDir":true,"disableResumeDataCacheCompression":false,"proxyClientMaxBodySize":134217728,"hideLogsAfterAbort":false,"mcpServer":true,"exposeRuntimeErrorsToHMR":false,"turbopackFileSystemCacheForDev":true,"turbopackFileSystemCacheForBuild":true,"turbopackStaleOutputMaxAge":604800000,"turbopackInferModuleSideEffects":true,"turbopackPluginRuntimeStrategy":"childProcesses","turbopackSharedRuntime":true,"optimizePackageImports":["@xyflow/react","@dnd-kit/core","@dnd-kit/sortable","material-symbols","marked","lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","effect","@effect/schema","@effect/platform","@effect/platform-node","@effect/platform-browser","@effect/platform-bun","@effect/sql","@effect/sql-mssql","@effect/sql-mysql2","@effect/sql-pg","@effect/sql-sqlite-node","@effect/sql-sqlite-bun","@effect/sql-sqlite-wasm","@effect/sql-sqlite-react-native","@effect/rpc","@effect/rpc-http","@effect/typeclass","@effect/experimental","@effect/opentelemetry","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"turbopackMemoryEvictionMode":"auto","useCacheTimeout":54,"instantInsights":{"validationLevel":"warning"},"trustHostHeader":false,"isExperimentalCompile":false},"htmlLimitedBots":"[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight","bundlePagesRouterDependencies":false,"configFileName":"next.config.mjs","outputFileTracingIncludes":{"*":["./node_modules/undici/**/*"]},"serverExternalPackages":["open","@aws-sdk/credential-providers"],"turbopack":{"root":"/Users/cuongquach/projects/vibe/n9router"},"outputFileTracingExcludes":{"*":["./gitbook/**/*"]},"repoRoot":"/Users/cuongquach/projects/vibe/n9router","distDirRoot":".next","supportsImmutableAssets":false,"_originalRewrites":{"beforeFiles":[],"afterFiles":[{"source":"/v1/v1/:path*","destination":"/api/v1/:path*"},{"source":"/v1/v1","destination":"/api/v1"},{"source":"/codex/:path*","destination":"/api/v1/responses"},{"source":"/responses","destination":"/api/v1/responses"},{"source":"/systemone","destination":"/api/v1/systemone"},{"source":"/v1beta/:path*","destination":"/api/v1beta/:path*"},{"source":"/v1beta","destination":"/api/v1beta"},{"source":"/v1/:path*","destination":"/api/v1/:path*"},{"source":"/v1","destination":"/api/v1"}],"fallback":[]}}
12
+ const nextConfig = {"env":{},"typescript":{"ignoreBuildErrors":false},"typedRoutes":false,"distDir":"./.next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.mjs","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"instrumentationClientInject":[],"poweredByHeader":true,"compress":true,"images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":14400,"formats":["image/webp"],"maximumRedirects":3,"maximumResponseBody":50000000,"dangerouslyAllowLocalIP":false,"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"attachment","localPatterns":[{"pathname":"**","search":""}],"remotePatterns":[],"qualities":[75],"unoptimized":true,"customCacheHandler":false},"devIndicators":{"position":"bottom-left"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"excludeDefaultMomentLocales":true,"reactProductionProfiling":false,"reactStrictMode":null,"reactMaxHeadersLength":6000,"httpAgentOptions":{"keepAlive":true},"logging":{"serverFunctions":true,"browserToTerminal":"warn"},"compiler":{},"expireTime":31536000,"staticPageGenerationTimeout":60,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"outputFileTracingRoot":"/Users/cuongquach/projects/vibe/n9router","enablePrerenderSourceMaps":true,"cacheComponents":false,"cacheLife":{"default":{"stale":300,"revalidate":900,"expire":4294967294},"seconds":{"stale":30,"revalidate":1,"expire":60},"minutes":{"stale":300,"revalidate":60,"expire":3600},"hours":{"stale":300,"revalidate":3600,"expire":86400},"days":{"stale":300,"revalidate":86400,"expire":604800},"weeks":{"stale":300,"revalidate":604800,"expire":2592000},"max":{"stale":300,"revalidate":2592000,"expire":31536000}},"cacheHandlers":{},"deprecated":{},"experimental":{"agentUpgrade":"security","agentFeedback":false,"coldCacheBadge":false,"collapseAdapterRoutes":true,"devValidationWorker":true,"useSkewCookie":false,"cssChunking":true,"multiZoneDraftMode":false,"appNavFailHandling":false,"parallelRouteMetadata":false,"prerenderEarlyExit":true,"serverMinification":true,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"cachedNavigations":false,"dynamicOnHover":false,"reactBrowserBailout":true,"useOffline":false,"varyParams":true,"optimisticRouting":true,"concurrentRouterQueue":false,"instrumentationClientRouterTransitionEvents":false,"prefetchInlining":{"maxSize":2048,"maxBundleSize":10240},"preloadEntriesOnStart":true,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","proxyPrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":9,"memoryBasedWorkersCount":false,"imgOptConcurrency":null,"imgOptOperationCache":null,"imgOptTimeoutInSeconds":7,"imgOptMaxInputPixels":268402689,"imgOptSequentialRead":null,"imgOptMozjpeg":true,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"devMemoryThresholdRestart":true,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"swcTraceProfiling":false,"forceSwcTransforms":false,"requestInsights":false,"largePageDataBytes":128000,"typedEnv":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"authInterrupts":false,"webpackMemoryOptimizations":false,"optimizeServerReact":true,"strictRouteTypes":false,"useTypeScriptCli":true,"removeUncaughtErrorAndRejectionListeners":false,"validateRSCRequestHeaders":true,"staleTimes":{"dynamic":0,"static":300},"reactDebugChannel":true,"serverComponentsHmrCache":true,"serverComponentsHmrCancellation":false,"staticGenerationMaxConcurrency":8,"staticGenerationMinPagesPerWorker":25,"transitionIndicator":false,"gestureTransition":false,"inlineCss":false,"useCache":false,"useCacheStaticRootParamTracking":false,"globalNotFound":false,"explicitParallelRouteChildren":true,"strictRouteMatching":true,"browserDebugInfoInTerminal":"warn","lockDistDir":true,"disableResumeDataCacheCompression":false,"proxyClientMaxBodySize":134217728,"hideLogsAfterAbort":false,"mcpServer":true,"exposeRuntimeErrorsToHMR":false,"turbopackFileSystemCacheForDev":true,"turbopackFileSystemCacheForBuild":true,"turbopackStaleOutputMaxAge":604800000,"turbopackInferModuleSideEffects":true,"turbopackPluginRuntimeStrategy":"childProcesses","turbopackSharedRuntime":true,"optimizePackageImports":["@xyflow/react","@dnd-kit/core","@dnd-kit/sortable","material-symbols","marked","lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","effect","@effect/schema","@effect/platform","@effect/platform-node","@effect/platform-browser","@effect/platform-bun","@effect/sql","@effect/sql-mssql","@effect/sql-mysql2","@effect/sql-pg","@effect/sql-sqlite-node","@effect/sql-sqlite-bun","@effect/sql-sqlite-wasm","@effect/sql-sqlite-react-native","@effect/rpc","@effect/rpc-http","@effect/typeclass","@effect/experimental","@effect/opentelemetry","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"turbopackMemoryEvictionMode":"auto","useCacheTimeout":54,"instantInsights":{"validationLevel":"warning"},"trustHostHeader":false,"isExperimentalCompile":false},"htmlLimitedBots":"[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight","bundlePagesRouterDependencies":false,"configFileName":"next.config.mjs","outputFileTracingIncludes":{"/*":["src/mitm/**/*","src/shared/constants/**/*","src/lib/dbFileSafety.js","open-sse/rtk/**/*","./node_modules/undici/**/*"]},"serverExternalPackages":["open","@aws-sdk/credential-providers"],"turbopack":{"root":"/Users/cuongquach/projects/vibe/n9router"},"outputFileTracingExcludes":{"*":["./gitbook/**/*"]},"repoRoot":"/Users/cuongquach/projects/vibe/n9router","distDirRoot":".next","supportsImmutableAssets":false,"_originalRewrites":{"beforeFiles":[],"afterFiles":[{"source":"/v1/v1/:path*","destination":"/api/v1/:path*"},{"source":"/v1/v1","destination":"/api/v1"},{"source":"/codex/:path*","destination":"/api/v1/responses"},{"source":"/responses","destination":"/api/v1/responses"},{"source":"/systemone","destination":"/api/v1/systemone"},{"source":"/v1beta/:path*","destination":"/api/v1beta/:path*"},{"source":"/v1beta","destination":"/api/v1beta"},{"source":"/v1/:path*","destination":"/api/v1/:path*"},{"source":"/v1","destination":"/api/v1"}],"fallback":[]}}
13
13
 
14
14
  process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(nextConfig)
15
15