@rsalmn/extremerouter 0.7.7 → 0.7.9

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 (964) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +10 -7
  3. package/app/.next-cli-build/build-manifest.json +3 -3
  4. package/app/.next-cli-build/required-server-files.json +1 -1
  5. package/app/.next-cli-build/routes-manifest.json +20 -0
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page.js +2 -2
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/alerts/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +3 -3
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page.js +2 -2
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page.js.nft.json +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +2 -2
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +3 -3
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page.js +2 -2
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page.js.nft.json +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/overview/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +2 -2
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js +2 -2
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +3 -3
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +2 -2
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page.js +2 -2
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page_client-reference-manifest.js +1 -1
  78. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +2 -2
  79. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  81. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  82. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  84. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  85. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  87. package/app/.next-cli-build/server/app/_global-error/page.js +3 -3
  88. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  90. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  91. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  92. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  93. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  94. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  95. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  96. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  97. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  98. package/app/.next-cli-build/server/app/_not-found/page.js +2 -2
  99. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  101. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  102. package/app/.next-cli-build/server/app/_not-found.rsc +5 -5
  103. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
  104. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  105. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +5 -5
  106. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  107. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  108. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  109. package/app/.next-cli-build/server/app/api/alerts/test/route.js +2 -2
  110. package/app/.next-cli-build/server/app/api/alerts/test/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  112. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  114. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  116. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  118. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  120. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  122. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  124. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/cache/route.js +1 -1
  126. package/app/.next-cli-build/server/app/api/cache/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +2 -2
  128. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  130. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  132. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  134. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
  136. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  144. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +3 -3
  148. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
  150. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
  152. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  154. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +1 -1
  156. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
  158. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  160. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  162. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  164. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/combos/validate-roles/route.js +1 -1
  166. package/app/.next-cli-build/server/app/api/combos/validate-roles/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/dashboard/stream/route.js +2 -2
  168. package/app/.next-cli-build/server/app/api/dashboard/stream/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  170. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  172. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +2 -2
  174. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/health/providers/route.js +1 -1
  176. package/app/.next-cli-build/server/app/api/health/providers/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/health/route.js +1 -1
  178. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/health/stream/route.js +2 -2
  180. package/app/.next-cli-build/server/app/api/health/stream/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/init/route.js +1 -1
  182. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  184. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  186. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  188. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +2 -2
  190. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +2 -2
  192. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  194. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  196. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  198. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  200. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  202. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  204. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  206. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  208. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  210. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  212. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  214. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/oauth/1min/import/route.js +1 -0
  216. package/app/.next-cli-build/server/app/api/oauth/1min/import/route.js.nft.json +1 -0
  217. package/app/.next-cli-build/server/app/api/oauth/1min/import/route_client-reference-manifest.js +1 -0
  218. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  219. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  221. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  225. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  229. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  231. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  233. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  235. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  237. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  241. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  243. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/oauth/wp-studio/import/route.js +1 -0
  245. package/app/.next-cli-build/server/app/api/oauth/wp-studio/import/route.js.nft.json +1 -0
  246. package/app/.next-cli-build/server/app/api/oauth/wp-studio/import/route_client-reference-manifest.js +1 -0
  247. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js +2 -2
  248. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
  250. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  252. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  254. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  256. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  257. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  258. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/providers/[id]/agnes-profile/route.js +1 -0
  260. package/app/.next-cli-build/server/app/api/providers/[id]/agnes-profile/route.js.nft.json +1 -0
  261. package/app/.next-cli-build/server/app/api/providers/[id]/agnes-profile/route_client-reference-manifest.js +1 -0
  262. package/app/.next-cli-build/server/app/api/providers/[id]/freebuff-profile/route.js +1 -1
  263. package/app/.next-cli-build/server/app/api/providers/[id]/freebuff-profile/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/providers/[id]/health-timeline/route.js +1 -1
  265. package/app/.next-cli-build/server/app/api/providers/[id]/health-timeline/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/providers/[id]/inxora-profile/route.js +1 -1
  267. package/app/.next-cli-build/server/app/api/providers/[id]/inxora-profile/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/providers/[id]/onemin-api-profile/route.js +1 -1
  271. package/app/.next-cli-build/server/app/api/providers/[id]/onemin-api-profile/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/providers/[id]/onemin-profile/route.js +1 -1
  273. package/app/.next-cli-build/server/app/api/providers/[id]/onemin-profile/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/providers/[id]/qwencloud-profile/route.js +1 -1
  275. package/app/.next-cli-build/server/app/api/providers/[id]/qwencloud-profile/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  277. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  279. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  281. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/providers/[id]/v0-profile/route.js +1 -1
  283. package/app/.next-cli-build/server/app/api/providers/[id]/v0-profile/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/providers/[id]/vault-pool/route.js +1 -1
  285. package/app/.next-cli-build/server/app/api/providers/[id]/vault-pool/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/providers/[id]/zenmux-plans/route.js +1 -1
  287. package/app/.next-cli-build/server/app/api/providers/[id]/zenmux-plans/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  289. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  290. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  291. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  292. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  293. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  294. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  295. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  297. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  298. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  299. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  300. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  301. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  303. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  304. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  305. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  306. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
  307. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  308. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  309. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  310. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  311. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  312. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
  313. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  314. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -2
  315. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  316. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  317. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  318. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  319. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  320. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  321. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  322. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  323. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  324. package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  325. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  326. package/app/.next-cli-build/server/app/api/swarm/active/route.js +1 -1
  327. package/app/.next-cli-build/server/app/api/swarm/active/route.js.nft.json +1 -1
  328. package/app/.next-cli-build/server/app/api/swarm/stream/route.js +3 -3
  329. package/app/.next-cli-build/server/app/api/swarm/stream/route.js.nft.json +1 -1
  330. package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  331. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  332. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  333. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  334. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  335. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  336. package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  337. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  338. package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  339. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  340. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  341. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  342. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  343. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  344. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  345. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  346. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  347. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  348. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  349. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  350. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  351. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  352. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  353. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  354. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  355. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  356. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +1 -1
  357. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  358. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  359. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  360. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  361. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  362. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  363. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  364. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  365. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  366. package/app/.next-cli-build/server/app/api/usage/leaderboard/route.js +1 -1
  367. package/app/.next-cli-build/server/app/api/usage/leaderboard/route.js.nft.json +1 -1
  368. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  369. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  370. package/app/.next-cli-build/server/app/api/usage/meta/route.js +1 -1
  371. package/app/.next-cli-build/server/app/api/usage/meta/route.js.nft.json +1 -1
  372. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  373. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  374. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  375. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  376. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  377. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  378. package/app/.next-cli-build/server/app/api/usage/retry-stats/route.js +1 -1
  379. package/app/.next-cli-build/server/app/api/usage/retry-stats/route.js.nft.json +1 -1
  380. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  381. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  382. package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
  383. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  384. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  385. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  386. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  387. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  388. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  389. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  390. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  391. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  392. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  393. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  394. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  395. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  396. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +2 -2
  397. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  398. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  399. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  400. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  401. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  402. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  403. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  404. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  405. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  406. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  407. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  408. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  409. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  410. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  411. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  412. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  413. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  414. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  415. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  416. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  417. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  418. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  419. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  420. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  421. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  422. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  423. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  424. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  425. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  426. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  427. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  428. package/app/.next-cli-build/server/app/callback/page.js +2 -2
  429. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  430. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  431. package/app/.next-cli-build/server/app/callback.html +1 -1
  432. package/app/.next-cli-build/server/app/callback.rsc +5 -5
  433. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +5 -5
  434. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  435. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +5 -5
  436. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  437. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  438. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  439. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +2 -2
  440. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  441. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  442. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  443. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +5 -5
  444. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
  445. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  446. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +5 -5
  447. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  448. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  449. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  450. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  451. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  452. package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
  453. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  454. package/app/.next-cli-build/server/app/index.html +1 -1
  455. package/app/.next-cli-build/server/app/index.rsc +5 -5
  456. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  457. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +5 -5
  458. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  459. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +5 -5
  460. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  461. package/app/.next-cli-build/server/app/landing/page.js +2 -2
  462. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  463. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  464. package/app/.next-cli-build/server/app/landing.html +1 -1
  465. package/app/.next-cli-build/server/app/landing.rsc +5 -5
  466. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
  467. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  468. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +5 -5
  469. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  470. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  471. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  472. package/app/.next-cli-build/server/app/login/page.js +2 -2
  473. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  474. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  475. package/app/.next-cli-build/server/app/login.html +1 -1
  476. package/app/.next-cli-build/server/app/login.rsc +6 -6
  477. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +6 -6
  478. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  479. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +5 -5
  480. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  481. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  482. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  483. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  484. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  485. package/app/.next-cli-build/server/app/page.js +2 -2
  486. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  487. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  488. package/app/.next-cli-build/server/app-paths-manifest.json +10 -7
  489. package/app/.next-cli-build/server/chunks/1239.js +1 -0
  490. package/app/.next-cli-build/server/chunks/1350.js +1 -1
  491. package/app/.next-cli-build/server/chunks/1719.js +1 -1
  492. package/app/.next-cli-build/server/chunks/212.js +1 -1
  493. package/app/.next-cli-build/server/chunks/2231.js +1 -1
  494. package/app/.next-cli-build/server/chunks/{2722.js → 2342.js} +24 -24
  495. package/app/.next-cli-build/server/chunks/2701.js +1 -1
  496. package/app/.next-cli-build/server/chunks/2926.js +1 -1
  497. package/app/.next-cli-build/server/chunks/318.js +37 -35
  498. package/app/.next-cli-build/server/chunks/319.js +1 -1
  499. package/app/.next-cli-build/server/chunks/3593.js +1 -1
  500. package/app/.next-cli-build/server/chunks/3992.js +1 -0
  501. package/app/.next-cli-build/server/chunks/4040.js +5 -3
  502. package/app/.next-cli-build/server/chunks/412.js +2 -2
  503. package/app/.next-cli-build/server/chunks/4356.js +9 -0
  504. package/app/.next-cli-build/server/chunks/4632.js +1 -1
  505. package/app/.next-cli-build/server/chunks/4741.js +4 -2
  506. package/app/.next-cli-build/server/chunks/4780.js +1 -1
  507. package/app/.next-cli-build/server/chunks/5612.js +1 -1
  508. package/app/.next-cli-build/server/chunks/5628.js +1 -0
  509. package/app/.next-cli-build/server/chunks/5699.js +1 -1
  510. package/app/.next-cli-build/server/chunks/5961.js +1 -1
  511. package/app/.next-cli-build/server/chunks/5983.js +9 -0
  512. package/app/.next-cli-build/server/chunks/6070.js +1 -1
  513. package/app/.next-cli-build/server/chunks/615.js +1 -1
  514. package/app/.next-cli-build/server/chunks/6316.js +2 -2
  515. package/app/.next-cli-build/server/chunks/6630.js +1 -1
  516. package/app/.next-cli-build/server/chunks/7152.js +1 -1
  517. package/app/.next-cli-build/server/chunks/8238.js +1 -1
  518. package/app/.next-cli-build/server/chunks/8271.js +1 -1
  519. package/app/.next-cli-build/server/chunks/8895.js +2 -2
  520. package/app/.next-cli-build/server/chunks/9630.js +1 -1
  521. package/app/.next-cli-build/server/chunks/9703.js +2 -2
  522. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  523. package/app/.next-cli-build/server/middleware.js +3 -3
  524. package/app/.next-cli-build/server/pages/404.html +1 -1
  525. package/app/.next-cli-build/server/pages/500.html +1 -1
  526. package/app/.next-cli-build/static/LTz0FqDsVsVSFbsHZibmc/_buildManifest.js +1 -0
  527. package/app/.next-cli-build/static/chunks/1321-7d2ce22078e1dffb.js +1 -0
  528. package/app/.next-cli-build/static/chunks/{1636-25599a8426fd97ed.js → 1636-47ea773ffa2d3a4b.js} +1 -1
  529. package/app/.next-cli-build/static/chunks/3794-1b03b52e3112452e.js +32 -0
  530. package/app/.next-cli-build/static/chunks/5497-c5ee857b78a8cf8a.js +7 -0
  531. package/app/.next-cli-build/static/chunks/{6069-bd1f2f41043f8c30.js → 682-03720d6613bcbd0f.js} +3 -3
  532. package/app/.next-cli-build/{server/chunks/8084.js → static/chunks/8105-705e80a4c161374b.js} +1 -1
  533. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/alerts/{page-4a622e705e5c4efc.js → page-920869c698a8b3cf.js} +1 -1
  534. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-76e413764f752c03.js → page-75247ad22e97f7cc.js} +1 -1
  535. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/page-d722ccf5e0fec340.js +1 -0
  536. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/page-afc62a0533448ca0.js +1 -0
  537. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/{page-262aee689cd6eb34.js → page-a91bcaf7425e68a3.js} +1 -1
  538. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/{page-18b262b802c95472.js → page-a8c4d8c681e19868.js} +1 -1
  539. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-408845bd809806a6.js +1 -0
  540. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/health/page-d077213deca8c217.js +1 -0
  541. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-e8d14560b2019a5f.js → page-b635b8b051acb5a5.js} +1 -1
  542. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/{page-a27c538ea71ebf8a.js → page-d9958dfec1d2e28e.js} +1 -1
  543. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-5e3375dcb5344f35.js → page-a36b3b632d16f4cb.js} +1 -1
  544. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/{page-e1875ca8be7183eb.js → page-92a0799a23d869b3.js} +1 -1
  545. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/page-99540bfed3193080.js +1 -0
  546. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/overview/{page-640703af38ea9eed.js → page-262fa6911888d4f1.js} +1 -1
  547. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-f644da989b8878c3.js +1 -0
  548. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/playground/page-0a50de81e7b688fc.js +1 -0
  549. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/{page-1b18b64a9ced4e9f.js → page-aa26b25a26b5dac8.js} +1 -1
  550. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-53ab489f01e3da19.js +10 -0
  551. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/{page-f2075be55913fe76.js → page-8965749fb7d0fac3.js} +1 -1
  552. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/{page-e71aac08cb013b28.js → page-96d3eb0dfde0711b.js} +1 -1
  553. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/{page-964ac16d6816983d.js → page-843c810c0818ce1b.js} +1 -1
  554. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/{page-da7dccb599243439.js → page-bc16a0312f0a7915.js} +1 -1
  555. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/{page-6c82876d3dc71dfb.js → page-97c920b552343488.js} +1 -1
  556. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/{page-73e504f021474182.js → page-2592739cbb862828.js} +1 -1
  557. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/{page-422974480d3bd378.js → page-a8af04fbd6293d2f.js} +1 -1
  558. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/{page-6235a5ba123759b2.js → page-5433f8ac60dd59f0.js} +1 -1
  559. package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-fbd9ba3da73c1af0.js → layout-df0ed16971ba7386.js} +1 -1
  560. package/app/.next-cli-build/static/chunks/app/_global-error/page-abffaa46b4637bee.js +1 -0
  561. package/app/.next-cli-build/static/chunks/app/api/alerts/test/route-abffaa46b4637bee.js +1 -0
  562. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-abffaa46b4637bee.js +1 -0
  563. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-abffaa46b4637bee.js +1 -0
  564. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-abffaa46b4637bee.js +1 -0
  565. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-abffaa46b4637bee.js +1 -0
  566. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-abffaa46b4637bee.js +1 -0
  567. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-abffaa46b4637bee.js +1 -0
  568. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-abffaa46b4637bee.js +1 -0
  569. package/app/.next-cli-build/static/chunks/app/api/cache/route-abffaa46b4637bee.js +1 -0
  570. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-abffaa46b4637bee.js +1 -0
  571. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-abffaa46b4637bee.js +1 -0
  572. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-abffaa46b4637bee.js +1 -0
  573. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-abffaa46b4637bee.js +1 -0
  574. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-abffaa46b4637bee.js +1 -0
  575. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-abffaa46b4637bee.js +1 -0
  576. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-abffaa46b4637bee.js +1 -0
  577. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-abffaa46b4637bee.js +1 -0
  578. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-abffaa46b4637bee.js +1 -0
  579. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-abffaa46b4637bee.js +1 -0
  580. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-abffaa46b4637bee.js +1 -0
  581. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-abffaa46b4637bee.js +1 -0
  582. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-abffaa46b4637bee.js +1 -0
  583. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-abffaa46b4637bee.js +1 -0
  584. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-abffaa46b4637bee.js +1 -0
  585. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-abffaa46b4637bee.js +1 -0
  586. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-abffaa46b4637bee.js +1 -0
  587. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-abffaa46b4637bee.js +1 -0
  588. package/app/.next-cli-build/static/chunks/app/api/combos/route-abffaa46b4637bee.js +1 -0
  589. package/app/.next-cli-build/static/chunks/app/api/combos/validate-roles/route-abffaa46b4637bee.js +1 -0
  590. package/app/.next-cli-build/static/chunks/app/api/dashboard/stream/route-abffaa46b4637bee.js +1 -0
  591. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-abffaa46b4637bee.js +1 -0
  592. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-abffaa46b4637bee.js +1 -0
  593. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-abffaa46b4637bee.js +1 -0
  594. package/app/.next-cli-build/static/chunks/app/api/health/providers/route-abffaa46b4637bee.js +1 -0
  595. package/app/.next-cli-build/static/chunks/app/api/health/route-abffaa46b4637bee.js +1 -0
  596. package/app/.next-cli-build/static/chunks/app/api/health/stream/route-abffaa46b4637bee.js +1 -0
  597. package/app/.next-cli-build/static/chunks/app/api/init/route-abffaa46b4637bee.js +1 -0
  598. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-abffaa46b4637bee.js +1 -0
  599. package/app/.next-cli-build/static/chunks/app/api/keys/route-abffaa46b4637bee.js +1 -0
  600. package/app/.next-cli-build/static/chunks/app/api/locale/route-abffaa46b4637bee.js +1 -0
  601. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-abffaa46b4637bee.js +1 -0
  602. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-abffaa46b4637bee.js +1 -0
  603. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-abffaa46b4637bee.js +1 -0
  604. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-abffaa46b4637bee.js +1 -0
  605. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-abffaa46b4637bee.js +1 -0
  606. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-abffaa46b4637bee.js +1 -0
  607. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-abffaa46b4637bee.js +1 -0
  608. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-abffaa46b4637bee.js +1 -0
  609. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-abffaa46b4637bee.js +1 -0
  610. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-abffaa46b4637bee.js +1 -0
  611. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-abffaa46b4637bee.js +1 -0
  612. package/app/.next-cli-build/static/chunks/app/api/models/route-abffaa46b4637bee.js +1 -0
  613. package/app/.next-cli-build/static/chunks/app/api/models/test/route-abffaa46b4637bee.js +1 -0
  614. package/app/.next-cli-build/static/chunks/app/api/oauth/1min/import/route-abffaa46b4637bee.js +1 -0
  615. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-abffaa46b4637bee.js +1 -0
  616. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-abffaa46b4637bee.js +1 -0
  617. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-abffaa46b4637bee.js +1 -0
  618. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-abffaa46b4637bee.js +1 -0
  619. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-abffaa46b4637bee.js +1 -0
  620. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-abffaa46b4637bee.js +1 -0
  621. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-abffaa46b4637bee.js +1 -0
  622. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-abffaa46b4637bee.js +1 -0
  623. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-abffaa46b4637bee.js +1 -0
  624. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-abffaa46b4637bee.js +1 -0
  625. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-abffaa46b4637bee.js +1 -0
  626. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-abffaa46b4637bee.js +1 -0
  627. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-abffaa46b4637bee.js +1 -0
  628. package/app/.next-cli-build/static/chunks/app/api/oauth/wp-studio/import/route-abffaa46b4637bee.js +1 -0
  629. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/auto-import/route-abffaa46b4637bee.js +1 -0
  630. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/import/route-abffaa46b4637bee.js +1 -0
  631. package/app/.next-cli-build/static/chunks/app/api/pricing/route-abffaa46b4637bee.js +1 -0
  632. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-abffaa46b4637bee.js +1 -0
  633. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-abffaa46b4637bee.js +1 -0
  634. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-abffaa46b4637bee.js +1 -0
  635. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/agnes-profile/route-abffaa46b4637bee.js +1 -0
  636. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/freebuff-profile/route-abffaa46b4637bee.js +1 -0
  637. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/health-timeline/route-abffaa46b4637bee.js +1 -0
  638. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/inxora-profile/route-abffaa46b4637bee.js +1 -0
  639. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-abffaa46b4637bee.js +1 -0
  640. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/onemin-api-profile/route-abffaa46b4637bee.js +1 -0
  641. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/onemin-profile/route-abffaa46b4637bee.js +1 -0
  642. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/qwencloud-profile/route-abffaa46b4637bee.js +1 -0
  643. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-abffaa46b4637bee.js +1 -0
  644. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-abffaa46b4637bee.js +1 -0
  645. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-abffaa46b4637bee.js +1 -0
  646. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/v0-profile/route-abffaa46b4637bee.js +1 -0
  647. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/vault-pool/route-abffaa46b4637bee.js +1 -0
  648. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/zenmux-plans/route-abffaa46b4637bee.js +1 -0
  649. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-abffaa46b4637bee.js +1 -0
  650. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-abffaa46b4637bee.js +1 -0
  651. package/app/.next-cli-build/static/chunks/app/api/providers/route-abffaa46b4637bee.js +1 -0
  652. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-abffaa46b4637bee.js +1 -0
  653. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-abffaa46b4637bee.js +1 -0
  654. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-abffaa46b4637bee.js +1 -0
  655. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-abffaa46b4637bee.js +1 -0
  656. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-abffaa46b4637bee.js +1 -0
  657. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-abffaa46b4637bee.js +1 -0
  658. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-abffaa46b4637bee.js +1 -0
  659. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-abffaa46b4637bee.js +1 -0
  660. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-abffaa46b4637bee.js +1 -0
  661. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-abffaa46b4637bee.js +1 -0
  662. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-abffaa46b4637bee.js +1 -0
  663. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-abffaa46b4637bee.js +1 -0
  664. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-abffaa46b4637bee.js +1 -0
  665. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-abffaa46b4637bee.js +1 -0
  666. package/app/.next-cli-build/static/chunks/app/api/settings/route-abffaa46b4637bee.js +1 -0
  667. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-abffaa46b4637bee.js +1 -0
  668. package/app/.next-cli-build/static/chunks/app/api/swarm/active/route-abffaa46b4637bee.js +1 -0
  669. package/app/.next-cli-build/static/chunks/app/api/swarm/stream/route-abffaa46b4637bee.js +1 -0
  670. package/app/.next-cli-build/static/chunks/app/api/tags/route-abffaa46b4637bee.js +1 -0
  671. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-abffaa46b4637bee.js +1 -0
  672. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-abffaa46b4637bee.js +1 -0
  673. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-abffaa46b4637bee.js +1 -0
  674. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-abffaa46b4637bee.js +1 -0
  675. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-abffaa46b4637bee.js +1 -0
  676. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-abffaa46b4637bee.js +1 -0
  677. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-abffaa46b4637bee.js +1 -0
  678. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-abffaa46b4637bee.js +1 -0
  679. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-abffaa46b4637bee.js +1 -0
  680. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-abffaa46b4637bee.js +1 -0
  681. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-abffaa46b4637bee.js +1 -0
  682. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-abffaa46b4637bee.js +1 -0
  683. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-abffaa46b4637bee.js +1 -0
  684. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-abffaa46b4637bee.js +1 -0
  685. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-abffaa46b4637bee.js +1 -0
  686. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-abffaa46b4637bee.js +1 -0
  687. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-abffaa46b4637bee.js +1 -0
  688. package/app/.next-cli-build/static/chunks/app/api/usage/leaderboard/route-abffaa46b4637bee.js +1 -0
  689. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-abffaa46b4637bee.js +1 -0
  690. package/app/.next-cli-build/static/chunks/app/api/usage/meta/route-abffaa46b4637bee.js +1 -0
  691. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-abffaa46b4637bee.js +1 -0
  692. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-abffaa46b4637bee.js +1 -0
  693. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-abffaa46b4637bee.js +1 -0
  694. package/app/.next-cli-build/static/chunks/app/api/usage/retry-stats/route-abffaa46b4637bee.js +1 -0
  695. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-abffaa46b4637bee.js +1 -0
  696. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-abffaa46b4637bee.js +1 -0
  697. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-abffaa46b4637bee.js +1 -0
  698. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-abffaa46b4637bee.js +1 -0
  699. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-abffaa46b4637bee.js +1 -0
  700. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-abffaa46b4637bee.js +1 -0
  701. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-abffaa46b4637bee.js +1 -0
  702. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-abffaa46b4637bee.js +1 -0
  703. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-abffaa46b4637bee.js +1 -0
  704. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-abffaa46b4637bee.js +1 -0
  705. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-abffaa46b4637bee.js +1 -0
  706. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-abffaa46b4637bee.js +1 -0
  707. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-abffaa46b4637bee.js +1 -0
  708. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-abffaa46b4637bee.js +1 -0
  709. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-abffaa46b4637bee.js +1 -0
  710. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-abffaa46b4637bee.js +1 -0
  711. package/app/.next-cli-build/static/chunks/app/api/v1/route-abffaa46b4637bee.js +1 -0
  712. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-abffaa46b4637bee.js +1 -0
  713. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-abffaa46b4637bee.js +1 -0
  714. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-abffaa46b4637bee.js +1 -0
  715. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-abffaa46b4637bee.js +1 -0
  716. package/app/.next-cli-build/static/chunks/app/api/version/route-abffaa46b4637bee.js +1 -0
  717. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-abffaa46b4637bee.js +1 -0
  718. package/app/.next-cli-build/static/chunks/app/api/version/update/route-abffaa46b4637bee.js +1 -0
  719. package/app/.next-cli-build/static/chunks/app/{layout-402f477579b8a063.js → layout-16b611f4f5717ccd.js} +1 -1
  720. package/app/.next-cli-build/static/chunks/app/login/{page-f9cc5c6db5a0cf57.js → page-0831b035aa4c0f17.js} +1 -1
  721. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-abffaa46b4637bee.js +1 -0
  722. package/app/.next-cli-build/static/chunks/app/page-abffaa46b4637bee.js +1 -0
  723. package/app/.next-cli-build/static/chunks/{main-52cce31a84751ecc.js → main-28015457a328b97c.js} +1 -1
  724. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-abffaa46b4637bee.js +1 -0
  725. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-abffaa46b4637bee.js +1 -0
  726. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-abffaa46b4637bee.js +1 -0
  727. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-abffaa46b4637bee.js +1 -0
  728. package/app/.next-cli-build/static/css/d7d86034708483b4.css +1 -0
  729. package/app/cli/.build-home/AppData/Roaming/extremerouter/db/data.sqlite +0 -0
  730. package/app/cli/.build-home/AppData/Roaming/extremerouter/db/data.sqlite-shm +0 -0
  731. package/app/cli/.build-home/AppData/Roaming/extremerouter/db/data.sqlite-wal +0 -0
  732. package/app/node_modules/@next/env/package.json +1 -1
  733. package/app/node_modules/nanoid/non-secure/index.cjs +2 -2
  734. package/app/node_modules/nanoid/package.json +1 -1
  735. package/app/node_modules/next/dist/build/load-jsconfig.js +40 -20
  736. package/app/node_modules/next/dist/build/next-config-ts/transpile-config.js +3 -114
  737. package/app/node_modules/next/dist/build/swc/index.js +1 -1
  738. package/app/node_modules/next/dist/build/webpack-config.js +3 -3
  739. package/app/node_modules/next/dist/cli/next-test.js +2 -1
  740. package/app/node_modules/next/dist/compiled/http-proxy/index.js +5 -5
  741. package/app/node_modules/next/dist/compiled/next-server/app-page-experimental.runtime.prod.js +11 -10
  742. package/app/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +11 -10
  743. package/app/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +11 -10
  744. package/app/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js +11 -10
  745. package/app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js +2 -2
  746. package/app/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +9 -9
  747. package/app/node_modules/next/dist/compiled/next-server/pages.runtime.prod.js +9 -9
  748. package/app/node_modules/next/dist/lib/install-dependencies.js +1 -1
  749. package/app/node_modules/next/dist/lib/patch-incorrect-lockfile.js +3 -3
  750. package/app/node_modules/next/dist/lib/typescript/loadTsConfig.js +181 -0
  751. package/app/node_modules/next/dist/lib/typescript/missingDependencyError.js +1 -1
  752. package/app/node_modules/next/dist/lib/typescript/runTypeCheckCli.js +53 -0
  753. package/app/node_modules/next/dist/lib/typescript/runTypeScriptCli.js +256 -0
  754. package/app/node_modules/next/dist/lib/verify-typescript-setup.js +97 -56
  755. package/app/node_modules/next/dist/server/app-render/action-handler.js +129 -34
  756. package/app/node_modules/next/dist/server/app-render/manifests-singleton.js +52 -4
  757. package/app/node_modules/next/dist/server/config-schema.js +1 -1
  758. package/app/node_modules/next/dist/server/config-shared.js +1 -2
  759. package/app/node_modules/next/dist/server/config.js +1 -1
  760. package/app/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +2 -2
  761. package/app/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
  762. package/app/node_modules/next/dist/server/image-optimizer.js +8 -27
  763. package/app/node_modules/next/dist/server/lib/app-info-log.js +1 -1
  764. package/app/node_modules/next/dist/server/lib/incremental-cache/index.js +90 -53
  765. package/app/node_modules/next/dist/server/lib/patch-fetch.js +15 -2
  766. package/app/node_modules/next/dist/server/lib/router-utils/proxy-request.js +4 -0
  767. package/app/node_modules/next/dist/server/lib/router-utils/setup-dev-bundler.js +2 -1
  768. package/app/node_modules/next/dist/server/lib/start-server.js +1 -1
  769. package/app/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js +1 -1
  770. package/app/node_modules/next/dist/shared/lib/router/utils/prepare-destination.js +2 -1
  771. package/app/node_modules/next/dist/shared/lib/server-reference-info.js +12 -0
  772. package/app/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
  773. package/app/node_modules/next/dist/telemetry/events/swc-load-failure.js +1 -1
  774. package/app/node_modules/next/dist/telemetry/events/version.js +2 -2
  775. package/app/node_modules/next/package.json +10 -10
  776. package/app/package.json +9 -3
  777. package/app/public/providers/agnes-api.svg +6 -0
  778. package/app/public/providers/agnes-web.svg +6 -0
  779. package/app/public/providers/stepfun.svg +54 -0
  780. package/app/public/providers/wp-studio.svg +11 -0
  781. package/app/server.js +1 -1
  782. package/app/src/lib/db/adapters/sqljsAdapter.js +4 -4
  783. package/package.json +1 -1
  784. package/app/.next-cli-build/server/chunks/1914.js +0 -1
  785. package/app/.next-cli-build/server/chunks/7674.js +0 -9
  786. package/app/.next-cli-build/server/chunks/9846.js +0 -9
  787. package/app/.next-cli-build/static/chunks/1321-6a34c5faf11383f6.js +0 -1
  788. package/app/.next-cli-build/static/chunks/3794-c66b3d8325973459.js +0 -32
  789. package/app/.next-cli-build/static/chunks/5497-ffa6b6463e401ac2.js +0 -7
  790. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/page-4efb04e1eca7f27c.js +0 -1
  791. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/page-f6cb00bfa1358617.js +0 -1
  792. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-cb5d0aca5faba3b4.js +0 -1
  793. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/health/page-406bf4ebc93eda61.js +0 -1
  794. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/page-325de46b5cec5533.js +0 -1
  795. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-3538bc80a52010ff.js +0 -1
  796. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/playground/page-8a44865bda8d1138.js +0 -1
  797. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-cd819afe3da4581e.js +0 -10
  798. package/app/.next-cli-build/static/chunks/app/_global-error/page-200d63272da34918.js +0 -1
  799. package/app/.next-cli-build/static/chunks/app/api/alerts/test/route-200d63272da34918.js +0 -1
  800. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-200d63272da34918.js +0 -1
  801. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-200d63272da34918.js +0 -1
  802. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-200d63272da34918.js +0 -1
  803. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-200d63272da34918.js +0 -1
  804. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-200d63272da34918.js +0 -1
  805. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-200d63272da34918.js +0 -1
  806. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-200d63272da34918.js +0 -1
  807. package/app/.next-cli-build/static/chunks/app/api/cache/route-200d63272da34918.js +0 -1
  808. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-200d63272da34918.js +0 -1
  809. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-200d63272da34918.js +0 -1
  810. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-200d63272da34918.js +0 -1
  811. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-200d63272da34918.js +0 -1
  812. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-200d63272da34918.js +0 -1
  813. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-200d63272da34918.js +0 -1
  814. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-200d63272da34918.js +0 -1
  815. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-200d63272da34918.js +0 -1
  816. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-200d63272da34918.js +0 -1
  817. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-200d63272da34918.js +0 -1
  818. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-200d63272da34918.js +0 -1
  819. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-200d63272da34918.js +0 -1
  820. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-200d63272da34918.js +0 -1
  821. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-200d63272da34918.js +0 -1
  822. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-200d63272da34918.js +0 -1
  823. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-200d63272da34918.js +0 -1
  824. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-200d63272da34918.js +0 -1
  825. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-200d63272da34918.js +0 -1
  826. package/app/.next-cli-build/static/chunks/app/api/combos/route-200d63272da34918.js +0 -1
  827. package/app/.next-cli-build/static/chunks/app/api/combos/validate-roles/route-200d63272da34918.js +0 -1
  828. package/app/.next-cli-build/static/chunks/app/api/dashboard/stream/route-200d63272da34918.js +0 -1
  829. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-200d63272da34918.js +0 -1
  830. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-200d63272da34918.js +0 -1
  831. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-200d63272da34918.js +0 -1
  832. package/app/.next-cli-build/static/chunks/app/api/health/providers/route-200d63272da34918.js +0 -1
  833. package/app/.next-cli-build/static/chunks/app/api/health/route-200d63272da34918.js +0 -1
  834. package/app/.next-cli-build/static/chunks/app/api/health/stream/route-200d63272da34918.js +0 -1
  835. package/app/.next-cli-build/static/chunks/app/api/init/route-200d63272da34918.js +0 -1
  836. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-200d63272da34918.js +0 -1
  837. package/app/.next-cli-build/static/chunks/app/api/keys/route-200d63272da34918.js +0 -1
  838. package/app/.next-cli-build/static/chunks/app/api/locale/route-200d63272da34918.js +0 -1
  839. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-200d63272da34918.js +0 -1
  840. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-200d63272da34918.js +0 -1
  841. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-200d63272da34918.js +0 -1
  842. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-200d63272da34918.js +0 -1
  843. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-200d63272da34918.js +0 -1
  844. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-200d63272da34918.js +0 -1
  845. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-200d63272da34918.js +0 -1
  846. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-200d63272da34918.js +0 -1
  847. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-200d63272da34918.js +0 -1
  848. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-200d63272da34918.js +0 -1
  849. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-200d63272da34918.js +0 -1
  850. package/app/.next-cli-build/static/chunks/app/api/models/route-200d63272da34918.js +0 -1
  851. package/app/.next-cli-build/static/chunks/app/api/models/test/route-200d63272da34918.js +0 -1
  852. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-200d63272da34918.js +0 -1
  853. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-200d63272da34918.js +0 -1
  854. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-200d63272da34918.js +0 -1
  855. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-200d63272da34918.js +0 -1
  856. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-200d63272da34918.js +0 -1
  857. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-200d63272da34918.js +0 -1
  858. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-200d63272da34918.js +0 -1
  859. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-200d63272da34918.js +0 -1
  860. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-200d63272da34918.js +0 -1
  861. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-200d63272da34918.js +0 -1
  862. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-200d63272da34918.js +0 -1
  863. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-200d63272da34918.js +0 -1
  864. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-200d63272da34918.js +0 -1
  865. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/auto-import/route-200d63272da34918.js +0 -1
  866. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/import/route-200d63272da34918.js +0 -1
  867. package/app/.next-cli-build/static/chunks/app/api/pricing/route-200d63272da34918.js +0 -1
  868. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-200d63272da34918.js +0 -1
  869. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-200d63272da34918.js +0 -1
  870. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-200d63272da34918.js +0 -1
  871. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/freebuff-profile/route-200d63272da34918.js +0 -1
  872. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/health-timeline/route-200d63272da34918.js +0 -1
  873. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/inxora-profile/route-200d63272da34918.js +0 -1
  874. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-200d63272da34918.js +0 -1
  875. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/onemin-api-profile/route-200d63272da34918.js +0 -1
  876. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/onemin-profile/route-200d63272da34918.js +0 -1
  877. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/qwencloud-profile/route-200d63272da34918.js +0 -1
  878. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-200d63272da34918.js +0 -1
  879. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-200d63272da34918.js +0 -1
  880. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-200d63272da34918.js +0 -1
  881. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/v0-profile/route-200d63272da34918.js +0 -1
  882. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/vault-pool/route-200d63272da34918.js +0 -1
  883. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/zenmux-plans/route-200d63272da34918.js +0 -1
  884. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-200d63272da34918.js +0 -1
  885. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-200d63272da34918.js +0 -1
  886. package/app/.next-cli-build/static/chunks/app/api/providers/route-200d63272da34918.js +0 -1
  887. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-200d63272da34918.js +0 -1
  888. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-200d63272da34918.js +0 -1
  889. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-200d63272da34918.js +0 -1
  890. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-200d63272da34918.js +0 -1
  891. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-200d63272da34918.js +0 -1
  892. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-200d63272da34918.js +0 -1
  893. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-200d63272da34918.js +0 -1
  894. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-200d63272da34918.js +0 -1
  895. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-200d63272da34918.js +0 -1
  896. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-200d63272da34918.js +0 -1
  897. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-200d63272da34918.js +0 -1
  898. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-200d63272da34918.js +0 -1
  899. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-200d63272da34918.js +0 -1
  900. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-200d63272da34918.js +0 -1
  901. package/app/.next-cli-build/static/chunks/app/api/settings/route-200d63272da34918.js +0 -1
  902. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-200d63272da34918.js +0 -1
  903. package/app/.next-cli-build/static/chunks/app/api/swarm/active/route-200d63272da34918.js +0 -1
  904. package/app/.next-cli-build/static/chunks/app/api/swarm/stream/route-200d63272da34918.js +0 -1
  905. package/app/.next-cli-build/static/chunks/app/api/tags/route-200d63272da34918.js +0 -1
  906. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-200d63272da34918.js +0 -1
  907. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-200d63272da34918.js +0 -1
  908. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-200d63272da34918.js +0 -1
  909. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-200d63272da34918.js +0 -1
  910. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-200d63272da34918.js +0 -1
  911. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-200d63272da34918.js +0 -1
  912. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-200d63272da34918.js +0 -1
  913. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-200d63272da34918.js +0 -1
  914. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-200d63272da34918.js +0 -1
  915. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-200d63272da34918.js +0 -1
  916. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-200d63272da34918.js +0 -1
  917. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-200d63272da34918.js +0 -1
  918. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-200d63272da34918.js +0 -1
  919. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-200d63272da34918.js +0 -1
  920. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-200d63272da34918.js +0 -1
  921. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-200d63272da34918.js +0 -1
  922. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-200d63272da34918.js +0 -1
  923. package/app/.next-cli-build/static/chunks/app/api/usage/leaderboard/route-200d63272da34918.js +0 -1
  924. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-200d63272da34918.js +0 -1
  925. package/app/.next-cli-build/static/chunks/app/api/usage/meta/route-200d63272da34918.js +0 -1
  926. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-200d63272da34918.js +0 -1
  927. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-200d63272da34918.js +0 -1
  928. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-200d63272da34918.js +0 -1
  929. package/app/.next-cli-build/static/chunks/app/api/usage/retry-stats/route-200d63272da34918.js +0 -1
  930. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-200d63272da34918.js +0 -1
  931. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-200d63272da34918.js +0 -1
  932. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-200d63272da34918.js +0 -1
  933. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-200d63272da34918.js +0 -1
  934. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-200d63272da34918.js +0 -1
  935. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-200d63272da34918.js +0 -1
  936. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-200d63272da34918.js +0 -1
  937. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-200d63272da34918.js +0 -1
  938. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-200d63272da34918.js +0 -1
  939. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-200d63272da34918.js +0 -1
  940. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-200d63272da34918.js +0 -1
  941. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-200d63272da34918.js +0 -1
  942. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-200d63272da34918.js +0 -1
  943. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-200d63272da34918.js +0 -1
  944. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-200d63272da34918.js +0 -1
  945. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-200d63272da34918.js +0 -1
  946. package/app/.next-cli-build/static/chunks/app/api/v1/route-200d63272da34918.js +0 -1
  947. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-200d63272da34918.js +0 -1
  948. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-200d63272da34918.js +0 -1
  949. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-200d63272da34918.js +0 -1
  950. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-200d63272da34918.js +0 -1
  951. package/app/.next-cli-build/static/chunks/app/api/version/route-200d63272da34918.js +0 -1
  952. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-200d63272da34918.js +0 -1
  953. package/app/.next-cli-build/static/chunks/app/api/version/update/route-200d63272da34918.js +0 -1
  954. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-200d63272da34918.js +0 -1
  955. package/app/.next-cli-build/static/chunks/app/page-200d63272da34918.js +0 -1
  956. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-200d63272da34918.js +0 -1
  957. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-200d63272da34918.js +0 -1
  958. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-200d63272da34918.js +0 -1
  959. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-200d63272da34918.js +0 -1
  960. package/app/.next-cli-build/static/css/78539cadb589145c.css +0 -1
  961. package/app/.next-cli-build/static/jvjk_lCzF7LBW1SV_GCaU/_buildManifest.js +0 -1
  962. package/app/cli/.build-home/AppData/Roaming/extremerouter/db/backups/upgrade-0.7.4-to-0.7.5-0.7.5-20260722-212802/data.sqlite +0 -0
  963. /package/app/.next-cli-build/static/{jvjk_lCzF7LBW1SV_GCaU → LTz0FqDsVsVSFbsHZibmc}/_ssgManifest.js +0 -0
  964. /package/app/cli/.build-home/AppData/Roaming/extremerouter/db/backups/{upgrade-0.7.3-to-0.7.4-0.7.4-20260722-105125 → upgrade-0.7.7-to-0.7.8-0.7.8-20260727-004850}/data.sqlite +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3721],{2531:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>n});var a=t(95155),l=t(12115),r=t(35497);let i=[{key:"providerDown",label:"Provider Down",desc:"Circuit breaker opens (provider repeatedly failing)",icon:"error"},{key:"rateLimited",label:"Rate Limited",desc:"Account hits 429/403 from upstream",icon:"block"},{key:"healthDegraded",label:"Health Degraded",desc:"Success rate drops below 70%",icon:"monitor_heart"},{key:"budgetExceeded",label:"Budget Exceeded",desc:"Usage quota reached",icon:"data_usage"}];function n(){let[e,s]=(0,l.useState)(null),[t,n]=(0,l.useState)(!0),[c,o]=(0,l.useState)(!1),[d,h]=(0,l.useState)(null),[x,m]=(0,l.useState)(null),u=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/settings",{cache:"no-store"});if(e.ok){let t=await e.json();s(t)}}catch{}n(!1)},[]);(0,l.useEffect)(()=>{u()},[u]),(0,l.useEffect)(()=>()=>{b.current&&clearTimeout(b.current)},[]);let b=(0,l.useRef)(null),p=(0,l.useCallback)(async(e,t,a)=>{s(s=>{let l=a?{...s,[e]:{...s?.[e]||{},[a]:t}}:{...s,[e]:t};return b.current&&clearTimeout(b.current),b.current=setTimeout(async()=>{try{let s=a?{[e]:{...l[e]||{},[a]:t}}:{[e]:t};(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})).ok&&(m(a||e),setTimeout(()=>m(null),1500))}catch{}},500),l})},[]),g=async()=>{o(!0),h(null);try{let e=await fetch("/api/alerts/test",{method:"POST"}),s=await e.json();h(s.success?"sent":"failed")}catch{h("failed")}o(!1),setTimeout(()=>h(null),5e3)};if(t)return(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,a.jsx)(r.Zp,{children:(0,a.jsx)("div",{className:"h-6 w-48 animate-pulse rounded bg-sidebar"})}),(0,a.jsx)(r.Zp,{children:(0,a.jsx)("div",{className:"h-32 animate-pulse rounded bg-sidebar"})})]});let j=e?.webhookEnabled===!0,f=!!(e?.webhookDiscordUrl||e?.webhookTelegramToken||e?.webhookGenericUrl);return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-5",children:[(0,a.jsx)(r.zY,{title:"Webhook Alerts",description:"Get notified via Discord, Telegram, or generic webhook when providers fail",icon:"notifications_active",actions:(0,a.jsx)(r.$n,{size:"sm",variant:"secondary",icon:c?"progress_activity":"send",onClick:g,disabled:c||!j||!f,children:c?"Sending...":"Send Test"})}),(0,a.jsx)(r.Zp,{children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(r.lM,{checked:j,onChange:e=>p("webhookEnabled",e),label:"Enable Webhook Alerts"}),j&&(0,a.jsx)(r.Ex,{variant:"success",size:"sm",dot:!0,children:"Active"})]}),j&&!f&&(0,a.jsx)(r.Ex,{variant:"warning",size:"sm",icon:"warning",children:"No channel configured"})]})}),j&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(r.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Delivery Channels"}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:"Configure where alerts are sent. Fill one or more."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-[#5865F2]/10",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[#5865F2] text-lg",children:"chat"})}),(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(r.pd,{label:"Discord Webhook URL",type:"text",value:e?.webhookDiscordUrl||"",onChange:e=>p("webhookDiscordUrl",e.target.value),placeholder:"https://discord.com/api/webhooks/...",hint:"webhookDiscordUrl"===x?"✓ Saved":void 0})})]}),(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-[#0088cc]/10",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[#0088cc] text-lg",children:"send"})}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col gap-3",children:[(0,a.jsx)(r.pd,{label:"Telegram Bot Token",type:"password",value:e?.webhookTelegramToken||"",onChange:e=>p("webhookTelegramToken",e.target.value),placeholder:"123456:ABC-DEF...",hint:"webhookTelegramToken"===x?"✓ Saved":void 0}),(0,a.jsx)(r.pd,{label:"Telegram Chat ID",type:"text",value:e?.webhookTelegramChatId||"",onChange:e=>p("webhookTelegramChatId",e.target.value),placeholder:"Example -1001234567890",hint:"webhookTelegramChatId"===x?"✓ Saved":void 0})]})]}),(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/10",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-lg",children:"webhook"})}),(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(r.pd,{label:"Generic Webhook URL",type:"text",value:e?.webhookGenericUrl||"",onChange:e=>p("webhookGenericUrl",e.target.value),placeholder:"https://your-server.com/webhook",hint:"webhookGenericUrl"===x?"✓ Saved":void 0})})]})]})]}),(0,a.jsxs)(r.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Alert Events"}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:"Choose which events trigger an alert."})]}),(0,a.jsx)("div",{className:"flex flex-col gap-3",children:i.map(s=>{let t=e?.webhookAlertEvents?.[s.key]===!0;return(0,a.jsxs)("div",{className:`flex items-center justify-between rounded-lg border px-3 py-2.5 transition-colors ${t?"border-primary/30 bg-primary/[0.03]":"border-border-subtle"}`,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${t?"text-primary":"text-text-muted"}`,children:s.icon}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-main",children:s.label}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:s.desc})]})]}),(0,a.jsx)(r.lM,{size:"sm",checked:t,onChange:e=>p("webhookAlertEvents",e,s.key)})]},s.key)})})]}),"sent"===d&&(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-success/20 bg-success/[0.05] px-4 py-2.5 text-sm text-success",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Test alert sent! Check your configured channels."]}),"failed"===d&&(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-danger/20 bg-danger/[0.05] px-4 py-2.5 text-sm text-danger",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",children:"error"}),"Failed to send test alert. Check your channel URLs."]})]})]})}},53013:(e,s,t)=>{Promise.resolve().then(t.bind(t,2531))}},e=>{e.O(0,[27,1321,705,5497,8441,3794,7358],()=>e(e.s=53013)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3721],{2531:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>n});var a=t(95155),l=t(12115),r=t(35497);let i=[{key:"providerDown",label:"Provider Down",desc:"Circuit breaker opens (provider repeatedly failing)",icon:"error"},{key:"rateLimited",label:"Rate Limited",desc:"Account hits 429/403 from upstream",icon:"block"},{key:"healthDegraded",label:"Health Degraded",desc:"Success rate drops below 70%",icon:"monitor_heart"},{key:"budgetExceeded",label:"Budget Exceeded",desc:"Usage quota reached",icon:"data_usage"}];function n(){let[e,s]=(0,l.useState)(null),[t,n]=(0,l.useState)(!0),[c,o]=(0,l.useState)(!1),[d,h]=(0,l.useState)(null),[x,m]=(0,l.useState)(null),u=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/settings",{cache:"no-store"});if(e.ok){let t=await e.json();s(t)}}catch{}n(!1)},[]);(0,l.useEffect)(()=>{u()},[u]),(0,l.useEffect)(()=>()=>{b.current&&clearTimeout(b.current)},[]);let b=(0,l.useRef)(null),p=(0,l.useCallback)(async(e,t,a)=>{s(s=>{let l=a?{...s,[e]:{...s?.[e]||{},[a]:t}}:{...s,[e]:t};return b.current&&clearTimeout(b.current),b.current=setTimeout(async()=>{try{let s=a?{[e]:{...l[e]||{},[a]:t}}:{[e]:t};(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})).ok&&(m(a||e),setTimeout(()=>m(null),1500))}catch{}},500),l})},[]),g=async()=>{o(!0),h(null);try{let e=await fetch("/api/alerts/test",{method:"POST"}),s=await e.json();h(s.success?"sent":"failed")}catch{h("failed")}o(!1),setTimeout(()=>h(null),5e3)};if(t)return(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,a.jsx)(r.Zp,{children:(0,a.jsx)("div",{className:"h-6 w-48 animate-pulse rounded bg-sidebar"})}),(0,a.jsx)(r.Zp,{children:(0,a.jsx)("div",{className:"h-32 animate-pulse rounded bg-sidebar"})})]});let j=e?.webhookEnabled===!0,f=!!(e?.webhookDiscordUrl||e?.webhookTelegramToken||e?.webhookGenericUrl);return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-5",children:[(0,a.jsx)(r.zY,{title:"Webhook Alerts",description:"Get notified via Discord, Telegram, or generic webhook when providers fail",icon:"notifications_active",actions:(0,a.jsx)(r.$n,{size:"sm",variant:"secondary",icon:c?"progress_activity":"send",onClick:g,disabled:c||!j||!f,children:c?"Sending...":"Send Test"})}),(0,a.jsx)(r.Zp,{children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(r.lM,{checked:j,onChange:e=>p("webhookEnabled",e),label:"Enable Webhook Alerts"}),j&&(0,a.jsx)(r.Ex,{variant:"success",size:"sm",dot:!0,children:"Active"})]}),j&&!f&&(0,a.jsx)(r.Ex,{variant:"warning",size:"sm",icon:"warning",children:"No channel configured"})]})}),j&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(r.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Delivery Channels"}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:"Configure where alerts are sent. Fill one or more."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-[#5865F2]/10",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[#5865F2] text-lg",children:"chat"})}),(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(r.pd,{label:"Discord Webhook URL",type:"text",value:e?.webhookDiscordUrl||"",onChange:e=>p("webhookDiscordUrl",e.target.value),placeholder:"https://discord.com/api/webhooks/...",hint:"webhookDiscordUrl"===x?"✓ Saved":void 0})})]}),(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-[#0088cc]/10",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[#0088cc] text-lg",children:"send"})}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col gap-3",children:[(0,a.jsx)(r.pd,{label:"Telegram Bot Token",type:"password",value:e?.webhookTelegramToken||"",onChange:e=>p("webhookTelegramToken",e.target.value),placeholder:"123456:ABC-DEF...",hint:"webhookTelegramToken"===x?"✓ Saved":void 0}),(0,a.jsx)(r.pd,{label:"Telegram Chat ID",type:"text",value:e?.webhookTelegramChatId||"",onChange:e=>p("webhookTelegramChatId",e.target.value),placeholder:"Example -1001234567890",hint:"webhookTelegramChatId"===x?"✓ Saved":void 0})]})]}),(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/10",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-lg",children:"webhook"})}),(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(r.pd,{label:"Generic Webhook URL",type:"text",value:e?.webhookGenericUrl||"",onChange:e=>p("webhookGenericUrl",e.target.value),placeholder:"https://your-server.com/webhook",hint:"webhookGenericUrl"===x?"✓ Saved":void 0})})]})]})]}),(0,a.jsxs)(r.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Alert Events"}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:"Choose which events trigger an alert."})]}),(0,a.jsx)("div",{className:"flex flex-col gap-3",children:i.map(s=>{let t=e?.webhookAlertEvents?.[s.key]===!0;return(0,a.jsxs)("div",{className:`flex items-center justify-between rounded-lg border px-3 py-2.5 transition-colors ${t?"border-primary/30 bg-primary/[0.03]":"border-border-subtle"}`,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${t?"text-primary":"text-text-muted"}`,children:s.icon}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-main",children:s.label}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:s.desc})]})]}),(0,a.jsx)(r.lM,{size:"sm",checked:t,onChange:e=>p("webhookAlertEvents",e,s.key)})]},s.key)})})]}),"sent"===d&&(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-success/20 bg-success/[0.05] px-4 py-2.5 text-sm text-success",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Test alert sent! Check your configured channels."]}),"failed"===d&&(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-danger/20 bg-danger/[0.05] px-4 py-2.5 text-sm text-danger",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",children:"error"}),"Failed to send test alert. Check your channel URLs."]})]})]})}},53013:(e,s,t)=>{Promise.resolve().then(t.bind(t,2531))}},e=>{e.O(0,[27,8105,1321,705,5497,8441,3794,7358],()=>e(e.s=53013)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4465],{78487:(e,t,r)=>{Promise.resolve().then(r.bind(r,88512))},88512:(e,t,r)=>{"use strict";r.d(t,{default:()=>g});var a=r(95155),s=r(12115),l=r(35497),i=r(28777),n=r(88105);let d="basic-chat.sessions",o="basic-chat.activeSessionId",c="basic-chat.activeProviderId",m="basic-chat.draft";function u(){return globalThis.crypto?.randomUUID?globalThis.crypto.randomUUID():`chat_${Date.now()}_${Math.random().toString(16).slice(2)}`}function x(e){if("string"==typeof e)return e;if(null==e)return"";if(Array.isArray(e))return e.map(x).filter(Boolean).join(" ");if("object"==typeof e){if("string"==typeof e.message)return e.message;if("string"==typeof e.error)return e.error;try{return JSON.stringify(e)}catch{}}return String(e)}function p(e=""){let t=x(e).replace(/\s+/g," ").trim();return t?t.length>52?`${t.slice(0,52).trimEnd()}…`:t:"New chat"}async function f(e){return await new Promise((t,r)=>{let a=new FileReader;a.onload=()=>t(String(a.result||"")),a.onerror=()=>r(a.error||Error("Failed to read file")),a.readAsDataURL(e)})}function h(e){return e?.name||function(e=""){return String(e).replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()||"Unknown"}(e?.provider||e?.id||"provider")}function g(){let[e,t]=(0,s.useState)([]),[r,g]=(0,s.useState)(!0),[b,v]=(0,s.useState)(""),[y,N]=(0,s.useState)(()=>{try{let e=function(e,t){try{return JSON.parse(e)}catch{return t}}(globalThis.localStorage.getItem(d),[]);return Array.isArray(e)?e.map(e=>({...e,messages:Array.isArray(e.messages)?e.messages:[]})):[]}catch{return[]}}),[w,j]=(0,s.useState)(()=>globalThis.localStorage.getItem(o)||""),[S,I]=(0,s.useState)(()=>globalThis.localStorage.getItem(c)||""),[A,k]=(0,s.useState)(""),[D,O]=(0,s.useState)(()=>globalThis.localStorage.getItem(m)||""),[$,C]=(0,s.useState)([]),[_,M]=(0,s.useState)(!1),[E,T]=(0,s.useState)(""),[U,R]=(0,s.useState)(""),[z,q]=(0,s.useState)(!1),[P,J]=(0,s.useState)(!1),[B,F]=(0,s.useState)(!1),K=(0,s.useRef)(null),L=(0,s.useRef)(null),W=(0,s.useRef)(!1),H=(0,s.useRef)(null),Y=(0,s.useRef)(null);(0,s.useEffect)(()=>{q(!0)},[]),(0,s.useEffect)(()=>{let e=!1;return async function(){g(!0),v("");try{let r=await fetch("/api/providers",{cache:"no-store"}),a=await r.json().catch(()=>({})),s=Array.isArray(a.connections)?a.connections.filter(e=>e?.isActive!==!1):[];if(0===s.length){e||(t([]),v("No providers connected yet."));return}let l=new Map;for(let e of s){let t=e.provider||e.id,r=h(e),a=(0,n.mq)(t)?"openai-compatible":(0,n.gb)(t)?"anthropic-compatible":t;l.has(t)||l.set(t,{providerId:t,providerName:r,providerType:a,connections:[],models:[]});let s=l.get(t);s.providerName=s.providerName||r,s.providerType=s.providerType||a,s.connections.push(e);let d=(0,i.KC)(t).map(t=>t?.id?{id:`${e.provider}/${t.id}`,requestModel:`${e.provider}/${t.id}`,name:t.name||t.id,providerId:e.provider,providerName:h(e),source:"static"}:null).filter(Boolean);s.models.push(...d)}for(let e of(await Promise.all(s.map(async e=>{try{let t=await fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)return{connection:e,models:[]};let a=(Array.isArray(r?.models)?r.models:Array.isArray(r?.data)?r.data:Array.isArray(r?.results)?r.results:Array.isArray(r)?r:[]).map(t=>(function(e,t){let r="string"==typeof e?e:e?.id||e?.name||e?.model||"";if(!r)return null;let a="string"==typeof e?e:e?.name||e?.displayName||r,s=r;return((0,n.mq)(t.provider)||(0,n.gb)(t.provider))&&!r.includes("/")&&(s=`${t.provider}/${r}`),{id:s,requestModel:s,name:a,providerId:t.provider,providerName:h(t),source:"live"}})(t,e)).filter(Boolean);return{connection:e,models:a}}catch{return{connection:e,models:[]}}})))){let t=e.connection.provider||e.connection.id,r=l.get(t);r&&r.models.push(...e.models)}let d=Array.from(l.values()).map(e=>({...e,models:(function(e){let t=new Map;for(let r of e)r?.id&&(t.has(r.id)||t.set(r.id,r));return Array.from(t.values())})(e.models).sort((e,t)=>e.name.localeCompare(t.name))})).filter(e=>e.models.length>0).sort((e,t)=>e.providerName.localeCompare(t.providerName));e||(t(d),0===d.length&&v("Providers connected but no models available."))}catch(r){e||(v(x(r?.message)||"Failed to load providers/models."),t([]))}finally{e||g(!1)}}(),()=>{e=!0}},[]),(0,s.useEffect)(()=>{let e=e=>{H.current&&!H.current.contains(e.target)&&J(!1),Y.current&&!Y.current.contains(e.target)&&F(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let G=(0,s.useMemo)(()=>{let t=new Map;for(let r of e)for(let e of r.models)t.set(e.id,{...e,providerId:r.providerId,providerName:r.providerName});return t},[e]),Q=(0,s.useMemo)(()=>e.find(e=>e.providerId===S)||e[0]||null,[e,S]),V=(0,s.useMemo)(()=>{if(A&&G.has(A))return G.get(A);if(w){let e=y.find(e=>e.id===w);if(e?.modelId&&G.has(e.modelId))return G.get(e.modelId)}return Q?.models?.[0]||null},[A,G,Q,y,w]),X=(0,s.useMemo)(()=>y.find(e=>e.id===w)||null,[y,w]),Z=X?.messages||[],ee=(0,s.useMemo)(()=>[...y].sort((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()),[y]),et=!_&&!!V&&(D.trim().length>0||$.length>0);(0,s.useEffect)(()=>{if(z)try{globalThis.localStorage.setItem(d,JSON.stringify(y)),globalThis.localStorage.setItem(o,w),globalThis.localStorage.setItem(c,S),globalThis.localStorage.setItem(m,D)}catch{}},[z,y,w,S,D]),(0,s.useEffect)(()=>{if(!z||r||W.current||0===e.length)return;let t=e.find(e=>e.providerId===S)||e[0],a=A&&G.has(A)?G.get(A):t.models[0];if(y.length>0){let e=y.find(e=>e.id===w)||y[0],r=e?.modelId&&G.has(e.modelId)?G.get(e.modelId):a;W.current=!0,j(e.id),I(r?.providerId||t.providerId),k(r?.id||a.id);return}let s={id:u(),title:"New chat",providerId:t.providerId,providerName:t.providerName,modelId:a.id,modelName:a.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]};W.current=!0,N([s]),j(s.id),I(t.providerId),k(a.id)},[z,r,e,G,y,w,S,A]);let er=(e,t)=>{N(r=>r.map(r=>r.id===e?t({...r,messages:Array.isArray(r.messages)?r.messages.map(e=>({...e})):[]}):r))},ea=e=>e?{id:u(),title:"New chat",providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]}:null,es=async e=>{let t=Array.from(e.target.files||[]);if(0===t.length)return;let r=t.filter(e=>e.type.startsWith("image/"));if(0===r.length){e.target.value="";return}let a=await Promise.all(r.map(async e=>({id:u(),name:e.name,type:e.type,size:e.size,dataUrl:await f(e)})));C(e=>[...e,...a]),e.target.value=""},el=async()=>{let e=V||Q?.models?.[0]||null;if(!e)return;let t=D.trim();if(!t&&0===$.length)return;let r=w,a=y.find(e=>e.id===r);if(!a){if(!(a=ea(e)))return;r=a.id,N(e=>[a,...e]),j(r)}let s={id:u(),role:"user",content:t,attachments:$.map(e=>({id:e.id,name:e.name,type:e.type,dataUrl:e.dataUrl})),createdAt:new Date().toISOString()},l=u(),i={id:l,role:"assistant",content:"",createdAt:new Date().toISOString(),status:"streaming"},n=[...a.messages||[],s,i];N(a=>a.map(a=>a.id===r?{...a,providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,messages:n,updatedAt:new Date().toISOString(),title:"New chat"===a.title?p(t):a.title}:a)),O(""),C([]),M(!0),T(l),R(""),L.current?.abort(),L.current=new AbortController;let d=n.filter(e=>"assistant"!==e.role||e.id!==l).map(e=>({role:e.role,content:"user"===e.role?function(e){let t=x(e.content).trim(),r=Array.isArray(e.attachments)?e.attachments:[];if(0===r.length)return t;let a=[];for(let e of(t&&a.push({type:"text",text:t}),r))e?.dataUrl&&a.push({type:"image_url",image_url:{url:e.dataUrl}});return a.length>0?a:t}(e):e.content}));try{var o;let a,s=await fetch("/api/dashboard/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({model:e.requestModel||e.id,messages:d,stream:!0}),signal:L.current.signal});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(x(e.error||e.message||`Request failed (${s.status})`))}let i=s.body?.getReader();if(!i){let e=await s.json().catch(()=>({})),t=x(e?.choices?.[0]?.message?.content||e?.output_text||e?.error||e?.message||"");er(r,e=>({...e,messages:e.messages.map(e=>e.id===l?{...e,content:t,status:"done"}:e),updatedAt:new Date().toISOString()}));return}let n=new TextDecoder,c="",m="";for(;;){let{value:e,done:t}=await i.read();if(t)break;let a=(c+=n.decode(e,{stream:!0})).split(/\r?\n/);for(let e of(c=a.pop()||"",a)){let t=e.trim();if(!t.startsWith("data:"))continue;let a=t.slice(5).trim();if(a&&"[DONE]"!==a)try{let e=JSON.parse(a),t=function(e){if(!e||"object"!=typeof e)return"";let t=e.choices?.[0];return[(t?.delta||{}).content,t?.message?.content,e.output_text,e.text].map(x).filter(Boolean)[0]||""}(e);if(!t)continue;m+=t,R(m),er(r,e=>({...e,messages:e.messages.map(e=>e.id===l?{...e,content:m,status:"streaming"}:e),updatedAt:new Date().toISOString()}))}catch{}}}er(r,e=>({...e,messages:e.messages.map(e=>e.id===l?{...e,content:m||e.content,status:"done"}:e),updatedAt:new Date().toISOString()})),o=r,a=p(t),er(o,e=>({...e,title:"New chat"===e.title?a:e.title,updatedAt:new Date().toISOString()}))}catch(e){if("AbortError"!==e.name){let t=x(e?.message||e);er(r,e=>({...e,messages:e.messages.map(e=>e.id===l?{...e,content:e.content||`Error: ${t}`,status:"error"}:e),updatedAt:new Date().toISOString()})),v(t||"Failed to send message.")}}finally{M(!1),T(""),R(""),L.current=null}},ei=V?`${V.name}`:"Select model",en=V?V.requestModel:"Choose from connected providers";return(0,a.jsx)("div",{className:"relative flex-1 flex flex-col h-full min-h-0 min-w-0 bg-bg text-text-main overflow-hidden",children:(0,a.jsxs)("div",{className:"relative mx-auto flex flex-1 h-full min-h-0 w-full max-w-4xl flex-col",children:[(0,a.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-3 px-4 py-3 lg:px-6",children:[(0,a.jsxs)("div",{ref:H,className:"relative",children:[(0,a.jsx)("button",{type:"button",onClick:()=>J(e=>!e),className:"flex items-center gap-3 rounded-2xl border border-border-subtle bg-surface-2 px-4 py-3 text-left transition hover:bg-surface-3",children:(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-semibold text-text-main",children:ei}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"expand_more"})]}),(0,a.jsx)("p",{className:"truncate text-xs text-text-muted",children:en})]})}),P?(0,a.jsxs)("div",{className:"absolute left-0 top-[calc(100%+10px)] z-30 w-[min(520px,calc(100vw-2rem))] overflow-hidden rounded-[20px] border border-border-subtle bg-surface shadow-2xl shadow-black/40",children:[(0,a.jsxs)("div",{className:"border-b border-border-subtle px-4 py-3",children:[(0,a.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-text-subtle",children:"Models"}),(0,a.jsx)("p",{className:"text-sm text-text-main",children:"Only from connected providers"})]}),(0,a.jsx)("div",{className:"max-h-[60vh] overflow-y-auto p-2 custom-scrollbar",children:e.map(e=>(0,a.jsxs)("div",{className:"mb-2 rounded-[16px] border border-border-subtle bg-surface-3 p-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-2 py-2",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-text-main",children:e.providerName}),(0,a.jsx)(l.Ex,{size:"sm",variant:"default",children:e.models.length})]}),(0,a.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:e.models.map(e=>{let t=e.id===A;return(0,a.jsx)("button",{type:"button",onClick:()=>(e=>{let t=G.get(e);if(!t)return;let r=y.find(e=>e.id===w);if(r&&r.messages.length>0){let e=ea(t);if(!e)return;N(t=>[e,...t]),j(e.id)}else if(r)N(e=>e.map(e=>e.id===r.id?{...e,providerId:t.providerId,providerName:t.providerName,modelId:t.id,modelName:t.name}:e)),j(r.id);else{let e=ea(t);if(!e)return;N(t=>[e,...t]),j(e.id)}I(t.providerId),k(t.id),J(!1)})(e.id),className:`rounded-[14px] border px-3 py-3 text-left transition ${t?"border-primary/40 bg-primary/15":"border-border-subtle bg-surface-2 hover:bg-surface-3"}`,children:(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:e.name}),(0,a.jsx)("p",{className:"truncate text-[11px] text-text-subtle",children:e.requestModel})]}),t?(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"check_circle"}):null]})},e.id)})})]},e.providerId))})]}):null]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>F(e=>!e),className:"rounded-2xl border border-border-subtle bg-surface-2 px-4 py-3 text-sm text-text-main transition hover:bg-surface-3",children:"History"}),(0,a.jsx)(l.$n,{variant:"ghost",size:"sm",icon:"delete",onClick:()=>{if(!w)return;let e=y.filter(e=>e.id!==w),t=e[0]||null;N(e),t?(j(t.id),I(t.providerId),k(t.modelId)):(j(""),I(""),k(""))},disabled:!w||0===y.length,children:"Clear"})]})]}),B?(0,a.jsxs)("div",{ref:Y,className:"absolute right-4 top-[72px] z-20 w-[min(360px,calc(100vw-2rem))] rounded-[20px] border border-border-subtle bg-surface p-2 shadow-2xl shadow-black/40 lg:right-6",children:[(0,a.jsx)("div",{className:"px-3 py-2",children:(0,a.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-text-subtle",children:"Recent chats"})}),(0,a.jsx)("div",{className:"max-h-[48vh] space-y-2 overflow-y-auto p-1 custom-scrollbar",children:0===ee.length?(0,a.jsx)("div",{className:"rounded-[16px] border border-dashed border-border-subtle bg-surface-2 p-4 text-sm text-text-muted",children:"No conversations yet."}):ee.map(e=>{let t=e.id===w,r=[...e.messages||[]].reverse().find(e=>"user"===e.role)||e.messages?.[0];return(0,a.jsx)("button",{type:"button",onClick:()=>{var t;let r;return t=e.id,void((r=y.find(e=>e.id===t))&&(j(t),I(r.providerId||S),k(r.modelId||A),F(!1)))},className:`w-full rounded-[16px] border px-3 py-3 text-left transition ${t?"border-primary/40 bg-primary/15":"border-border-subtle bg-surface-2 hover:bg-surface-3"}`,children:(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:e.title}),(0,a.jsx)("p",{className:"mt-1 truncate text-xs text-text-muted",children:x(r?.content)||"Empty chat"})]}),(0,a.jsx)("span",{className:"text-[10px] text-text-subtle shrink-0",children:function(e){if(!e)return"Now";let t=new Date(e).getTime();if(Number.isNaN(t))return"Now";let r=Math.max(1,Math.round((Date.now()-t)/6e4));if(r<60)return`${r}m`;let a=Math.round(r/60);return a<24?`${a}h`:`${Math.round(a/24)}d`}(e.updatedAt)})]})},e.id)})})]}):null,b?(0,a.jsx)("div",{className:"mt-4 rounded-[18px] border border-danger/20 bg-danger/10 px-4 py-3 text-danger",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"error"}),(0,a.jsx)("p",{className:"text-sm leading-6",children:b})]})}):null,(0,a.jsxs)("div",{className:"flex flex-1 flex-col min-h-0",children:[(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto py-4 custom-scrollbar",children:[0===Z.length?(0,a.jsx)("div",{className:"flex min-h-[50vh] items-center justify-center px-4 text-center",children:(0,a.jsxs)("div",{className:"max-w-xl space-y-4",children:[(0,a.jsx)("div",{className:"mx-auto flex size-16 items-center justify-center rounded-[20px] border border-border-subtle bg-surface-2 text-text-main",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[30px]",children:"chat"})}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("h2",{className:"text-2xl font-semibold text-text-main",children:"Start a conversation"}),(0,a.jsx)("p",{className:"text-sm leading-6 text-text-muted",children:"Simple chat interface to interact with any AI model from connected providers. Select a model and start chatting!"})]})]})}):null,(0,a.jsx)("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-4 px-4",children:Z.map(e=>{let t="user"===e.role,r="assistant"===e.role,s=r&&e.id===E&&"streaming"===e.status,l=x(e.content)||(r?U:"");return(0,a.jsx)("div",{className:`flex w-full ${t?"justify-end":"justify-start"} mb-6`,children:(0,a.jsxs)("div",{className:`max-w-[min(88%,42rem)] ${t?"rounded-3xl bg-surface-2 px-5 py-3.5 text-text-main":"text-text-main"}`,children:[(0,a.jsx)("div",{className:"mb-1 flex items-center justify-between gap-3",children:(0,a.jsx)("span",{className:"text-xs font-semibold",children:t?"You":V?.name||"Assistant"})}),e.attachments?.length?(0,a.jsx)("div",{className:"mb-3 grid grid-cols-2 gap-2 sm:grid-cols-3 mt-2",children:e.attachments.map(e=>(0,a.jsx)("a",{href:e.dataUrl,target:"_blank",rel:"noreferrer",className:"overflow-hidden rounded-[18px] border border-border-subtle bg-surface-3",children:(0,a.jsx)("img",{src:e.dataUrl,alt:e.name,className:"h-28 w-full object-cover"})},e.id))}):null,(0,a.jsxs)("div",{className:"whitespace-pre-wrap break-words text-[15px] leading-7",children:[l,r&&s&&!U?(0,a.jsx)("span",{className:"inline-block animate-pulse",children:"▋"}):null]})]})},e.id)})})]}),(0,a.jsxs)("div",{className:"shrink-0 pt-2",children:[$.length>0?(0,a.jsx)("div",{className:"mx-auto mb-3 flex w-full max-w-3xl flex-wrap gap-2 px-4",children:$.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-full border border-border-subtle bg-surface-2 px-3 py-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-main max-w-[12rem] truncate",children:e.name}),(0,a.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void C(e=>e.filter(e=>e.id!==t))},className:"text-text-muted hover:text-text-main","aria-label":"Remove attachment",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]},e.id))}):null,(0,a.jsx)("div",{className:"mx-auto w-full max-w-3xl px-4 pb-2",children:(0,a.jsxs)("div",{className:"rounded-[26px] bg-surface-2 px-3 pt-3 pb-2 shadow-[0_0_15px_rgba(0,0,0,0.10)] ring-1 ring-border-subtle",children:[(0,a.jsx)("textarea",{value:D,onChange:e=>O(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),et&&el())},placeholder:"Message AI",rows:1,className:"w-full resize-none bg-transparent px-2 text-[15px] leading-6 text-text-main outline-none placeholder:text-text-subtle custom-scrollbar max-h-[25vh] overflow-y-auto"}),(0,a.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>K.current?.click(),disabled:!V||r,className:"p-2 text-text-muted hover:text-text-main transition rounded-full hover:bg-surface-2",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"attach_file"})}),(0,a.jsx)("input",{ref:K,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:es}),(0,a.jsx)("span",{className:"text-xs font-medium text-text-subtle truncate max-w-[120px]",children:V?V.name:"No model"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[_?(0,a.jsx)("button",{type:"button",onClick:()=>{L.current?.abort()},className:"p-2 text-text-main bg-surface-3 hover:bg-surface-3 transition rounded-full h-8 w-8 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop"})}):null,(0,a.jsx)("button",{onClick:el,disabled:!et,className:`h-8 w-8 rounded-full flex items-center justify-center transition ${et?"bg-primary text-white hover:opacity-90":"bg-surface-3 text-text-subtle cursor-not-allowed"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_upward"})})]})]})]})})]}),(0,a.jsx)("p",{className:"mx-auto mt-2 max-w-3xl px-4 pb-4 text-center text-[11px] text-text-subtle",children:"Model list is filtered from connected providers."})]})]})})}}},e=>{e.O(0,[27,1321,705,5497,8441,3794,7358],()=>e(e.s=78487)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4465],{78487:(e,t,r)=>{Promise.resolve().then(r.bind(r,88512))},88512:(e,t,r)=>{"use strict";r.d(t,{default:()=>g});var a=r(95155),s=r(12115),l=r(35497),i=r(28777),n=r(88105);let d="basic-chat.sessions",o="basic-chat.activeSessionId",c="basic-chat.activeProviderId",m="basic-chat.draft";function u(){return globalThis.crypto?.randomUUID?globalThis.crypto.randomUUID():`chat_${Date.now()}_${Math.random().toString(16).slice(2)}`}function x(e){if("string"==typeof e)return e;if(null==e)return"";if(Array.isArray(e))return e.map(x).filter(Boolean).join(" ");if("object"==typeof e){if("string"==typeof e.message)return e.message;if("string"==typeof e.error)return e.error;try{return JSON.stringify(e)}catch{}}return String(e)}function p(e=""){let t=x(e).replace(/\s+/g," ").trim();return t?t.length>52?`${t.slice(0,52).trimEnd()}…`:t:"New chat"}async function f(e){return await new Promise((t,r)=>{let a=new FileReader;a.onload=()=>t(String(a.result||"")),a.onerror=()=>r(a.error||Error("Failed to read file")),a.readAsDataURL(e)})}function h(e){return e?.name||function(e=""){return String(e).replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()||"Unknown"}(e?.provider||e?.id||"provider")}function g(){let[e,t]=(0,s.useState)([]),[r,g]=(0,s.useState)(!0),[b,v]=(0,s.useState)(""),[y,N]=(0,s.useState)(()=>{try{let e=function(e,t){try{return JSON.parse(e)}catch{return t}}(globalThis.localStorage.getItem(d),[]);return Array.isArray(e)?e.map(e=>({...e,messages:Array.isArray(e.messages)?e.messages:[]})):[]}catch{return[]}}),[w,j]=(0,s.useState)(()=>globalThis.localStorage.getItem(o)||""),[S,I]=(0,s.useState)(()=>globalThis.localStorage.getItem(c)||""),[A,k]=(0,s.useState)(""),[D,O]=(0,s.useState)(()=>globalThis.localStorage.getItem(m)||""),[$,C]=(0,s.useState)([]),[_,M]=(0,s.useState)(!1),[E,T]=(0,s.useState)(""),[U,R]=(0,s.useState)(""),[z,q]=(0,s.useState)(!1),[P,J]=(0,s.useState)(!1),[B,F]=(0,s.useState)(!1),K=(0,s.useRef)(null),L=(0,s.useRef)(null),W=(0,s.useRef)(!1),H=(0,s.useRef)(null),Y=(0,s.useRef)(null);(0,s.useEffect)(()=>{q(!0)},[]),(0,s.useEffect)(()=>{let e=!1;return async function(){g(!0),v("");try{let r=await fetch("/api/providers",{cache:"no-store"}),a=await r.json().catch(()=>({})),s=Array.isArray(a.connections)?a.connections.filter(e=>e?.isActive!==!1):[];if(0===s.length){e||(t([]),v("No providers connected yet."));return}let l=new Map;for(let e of s){let t=e.provider||e.id,r=h(e),a=(0,n.mq)(t)?"openai-compatible":(0,n.gb)(t)?"anthropic-compatible":t;l.has(t)||l.set(t,{providerId:t,providerName:r,providerType:a,connections:[],models:[]});let s=l.get(t);s.providerName=s.providerName||r,s.providerType=s.providerType||a,s.connections.push(e);let d=(0,i.KC)(t).map(t=>t?.id?{id:`${e.provider}/${t.id}`,requestModel:`${e.provider}/${t.id}`,name:t.name||t.id,providerId:e.provider,providerName:h(e),source:"static"}:null).filter(Boolean);s.models.push(...d)}for(let e of(await Promise.all(s.map(async e=>{try{let t=await fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)return{connection:e,models:[]};let a=(Array.isArray(r?.models)?r.models:Array.isArray(r?.data)?r.data:Array.isArray(r?.results)?r.results:Array.isArray(r)?r:[]).map(t=>(function(e,t){let r="string"==typeof e?e:e?.id||e?.name||e?.model||"";if(!r)return null;let a="string"==typeof e?e:e?.name||e?.displayName||r,s=r;return((0,n.mq)(t.provider)||(0,n.gb)(t.provider))&&!r.includes("/")&&(s=`${t.provider}/${r}`),{id:s,requestModel:s,name:a,providerId:t.provider,providerName:h(t),source:"live"}})(t,e)).filter(Boolean);return{connection:e,models:a}}catch{return{connection:e,models:[]}}})))){let t=e.connection.provider||e.connection.id,r=l.get(t);r&&r.models.push(...e.models)}let d=Array.from(l.values()).map(e=>({...e,models:(function(e){let t=new Map;for(let r of e)r?.id&&(t.has(r.id)||t.set(r.id,r));return Array.from(t.values())})(e.models).sort((e,t)=>e.name.localeCompare(t.name))})).filter(e=>e.models.length>0).sort((e,t)=>e.providerName.localeCompare(t.providerName));e||(t(d),0===d.length&&v("Providers connected but no models available."))}catch(r){e||(v(x(r?.message)||"Failed to load providers/models."),t([]))}finally{e||g(!1)}}(),()=>{e=!0}},[]),(0,s.useEffect)(()=>{let e=e=>{H.current&&!H.current.contains(e.target)&&J(!1),Y.current&&!Y.current.contains(e.target)&&F(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let G=(0,s.useMemo)(()=>{let t=new Map;for(let r of e)for(let e of r.models)t.set(e.id,{...e,providerId:r.providerId,providerName:r.providerName});return t},[e]),Q=(0,s.useMemo)(()=>e.find(e=>e.providerId===S)||e[0]||null,[e,S]),V=(0,s.useMemo)(()=>{if(A&&G.has(A))return G.get(A);if(w){let e=y.find(e=>e.id===w);if(e?.modelId&&G.has(e.modelId))return G.get(e.modelId)}return Q?.models?.[0]||null},[A,G,Q,y,w]),X=(0,s.useMemo)(()=>y.find(e=>e.id===w)||null,[y,w]),Z=X?.messages||[],ee=(0,s.useMemo)(()=>[...y].sort((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()),[y]),et=!_&&!!V&&(D.trim().length>0||$.length>0);(0,s.useEffect)(()=>{if(z)try{globalThis.localStorage.setItem(d,JSON.stringify(y)),globalThis.localStorage.setItem(o,w),globalThis.localStorage.setItem(c,S),globalThis.localStorage.setItem(m,D)}catch{}},[z,y,w,S,D]),(0,s.useEffect)(()=>{if(!z||r||W.current||0===e.length)return;let t=e.find(e=>e.providerId===S)||e[0],a=A&&G.has(A)?G.get(A):t.models[0];if(y.length>0){let e=y.find(e=>e.id===w)||y[0],r=e?.modelId&&G.has(e.modelId)?G.get(e.modelId):a;W.current=!0,j(e.id),I(r?.providerId||t.providerId),k(r?.id||a.id);return}let s={id:u(),title:"New chat",providerId:t.providerId,providerName:t.providerName,modelId:a.id,modelName:a.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]};W.current=!0,N([s]),j(s.id),I(t.providerId),k(a.id)},[z,r,e,G,y,w,S,A]);let er=(e,t)=>{N(r=>r.map(r=>r.id===e?t({...r,messages:Array.isArray(r.messages)?r.messages.map(e=>({...e})):[]}):r))},ea=e=>e?{id:u(),title:"New chat",providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]}:null,es=async e=>{let t=Array.from(e.target.files||[]);if(0===t.length)return;let r=t.filter(e=>e.type.startsWith("image/"));if(0===r.length){e.target.value="";return}let a=await Promise.all(r.map(async e=>({id:u(),name:e.name,type:e.type,size:e.size,dataUrl:await f(e)})));C(e=>[...e,...a]),e.target.value=""},el=async()=>{let e=V||Q?.models?.[0]||null;if(!e)return;let t=D.trim();if(!t&&0===$.length)return;let r=w,a=y.find(e=>e.id===r);if(!a){if(!(a=ea(e)))return;r=a.id,N(e=>[a,...e]),j(r)}let s={id:u(),role:"user",content:t,attachments:$.map(e=>({id:e.id,name:e.name,type:e.type,dataUrl:e.dataUrl})),createdAt:new Date().toISOString()},l=u(),i={id:l,role:"assistant",content:"",createdAt:new Date().toISOString(),status:"streaming"},n=[...a.messages||[],s,i];N(a=>a.map(a=>a.id===r?{...a,providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,messages:n,updatedAt:new Date().toISOString(),title:"New chat"===a.title?p(t):a.title}:a)),O(""),C([]),M(!0),T(l),R(""),L.current?.abort(),L.current=new AbortController;let d=n.filter(e=>"assistant"!==e.role||e.id!==l).map(e=>({role:e.role,content:"user"===e.role?function(e){let t=x(e.content).trim(),r=Array.isArray(e.attachments)?e.attachments:[];if(0===r.length)return t;let a=[];for(let e of(t&&a.push({type:"text",text:t}),r))e?.dataUrl&&a.push({type:"image_url",image_url:{url:e.dataUrl}});return a.length>0?a:t}(e):e.content}));try{var o;let a,s=await fetch("/api/dashboard/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({model:e.requestModel||e.id,messages:d,stream:!0}),signal:L.current.signal});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(x(e.error||e.message||`Request failed (${s.status})`))}let i=s.body?.getReader();if(!i){let e=await s.json().catch(()=>({})),t=x(e?.choices?.[0]?.message?.content||e?.output_text||e?.error||e?.message||"");er(r,e=>({...e,messages:e.messages.map(e=>e.id===l?{...e,content:t,status:"done"}:e),updatedAt:new Date().toISOString()}));return}let n=new TextDecoder,c="",m="";for(;;){let{value:e,done:t}=await i.read();if(t)break;let a=(c+=n.decode(e,{stream:!0})).split(/\r?\n/);for(let e of(c=a.pop()||"",a)){let t=e.trim();if(!t.startsWith("data:"))continue;let a=t.slice(5).trim();if(a&&"[DONE]"!==a)try{let e=JSON.parse(a),t=function(e){if(!e||"object"!=typeof e)return"";let t=e.choices?.[0];return[(t?.delta||{}).content,t?.message?.content,e.output_text,e.text].map(x).filter(Boolean)[0]||""}(e);if(!t)continue;m+=t,R(m),er(r,e=>({...e,messages:e.messages.map(e=>e.id===l?{...e,content:m,status:"streaming"}:e),updatedAt:new Date().toISOString()}))}catch{}}}er(r,e=>({...e,messages:e.messages.map(e=>e.id===l?{...e,content:m||e.content,status:"done"}:e),updatedAt:new Date().toISOString()})),o=r,a=p(t),er(o,e=>({...e,title:"New chat"===e.title?a:e.title,updatedAt:new Date().toISOString()}))}catch(e){if("AbortError"!==e.name){let t=x(e?.message||e);er(r,e=>({...e,messages:e.messages.map(e=>e.id===l?{...e,content:e.content||`Error: ${t}`,status:"error"}:e),updatedAt:new Date().toISOString()})),v(t||"Failed to send message.")}}finally{M(!1),T(""),R(""),L.current=null}},ei=V?`${V.name}`:"Select model",en=V?V.requestModel:"Choose from connected providers";return(0,a.jsx)("div",{className:"relative flex-1 flex flex-col h-full min-h-0 min-w-0 bg-bg text-text-main overflow-hidden",children:(0,a.jsxs)("div",{className:"relative mx-auto flex flex-1 h-full min-h-0 w-full max-w-4xl flex-col",children:[(0,a.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-3 px-4 py-3 lg:px-6",children:[(0,a.jsxs)("div",{ref:H,className:"relative",children:[(0,a.jsx)("button",{type:"button",onClick:()=>J(e=>!e),className:"flex items-center gap-3 rounded-2xl border border-border-subtle bg-surface-2 px-4 py-3 text-left transition hover:bg-surface-3",children:(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-semibold text-text-main",children:ei}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"expand_more"})]}),(0,a.jsx)("p",{className:"truncate text-xs text-text-muted",children:en})]})}),P?(0,a.jsxs)("div",{className:"absolute left-0 top-[calc(100%+10px)] z-30 w-[min(520px,calc(100vw-2rem))] overflow-hidden rounded-[20px] border border-border-subtle bg-surface shadow-2xl shadow-black/40",children:[(0,a.jsxs)("div",{className:"border-b border-border-subtle px-4 py-3",children:[(0,a.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-text-subtle",children:"Models"}),(0,a.jsx)("p",{className:"text-sm text-text-main",children:"Only from connected providers"})]}),(0,a.jsx)("div",{className:"max-h-[60vh] overflow-y-auto p-2 custom-scrollbar",children:e.map(e=>(0,a.jsxs)("div",{className:"mb-2 rounded-[16px] border border-border-subtle bg-surface-3 p-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-2 py-2",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-text-main",children:e.providerName}),(0,a.jsx)(l.Ex,{size:"sm",variant:"default",children:e.models.length})]}),(0,a.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:e.models.map(e=>{let t=e.id===A;return(0,a.jsx)("button",{type:"button",onClick:()=>(e=>{let t=G.get(e);if(!t)return;let r=y.find(e=>e.id===w);if(r&&r.messages.length>0){let e=ea(t);if(!e)return;N(t=>[e,...t]),j(e.id)}else if(r)N(e=>e.map(e=>e.id===r.id?{...e,providerId:t.providerId,providerName:t.providerName,modelId:t.id,modelName:t.name}:e)),j(r.id);else{let e=ea(t);if(!e)return;N(t=>[e,...t]),j(e.id)}I(t.providerId),k(t.id),J(!1)})(e.id),className:`rounded-[14px] border px-3 py-3 text-left transition ${t?"border-primary/40 bg-primary/15":"border-border-subtle bg-surface-2 hover:bg-surface-3"}`,children:(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:e.name}),(0,a.jsx)("p",{className:"truncate text-[11px] text-text-subtle",children:e.requestModel})]}),t?(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"check_circle"}):null]})},e.id)})})]},e.providerId))})]}):null]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>F(e=>!e),className:"rounded-2xl border border-border-subtle bg-surface-2 px-4 py-3 text-sm text-text-main transition hover:bg-surface-3",children:"History"}),(0,a.jsx)(l.$n,{variant:"ghost",size:"sm",icon:"delete",onClick:()=>{if(!w)return;let e=y.filter(e=>e.id!==w),t=e[0]||null;N(e),t?(j(t.id),I(t.providerId),k(t.modelId)):(j(""),I(""),k(""))},disabled:!w||0===y.length,children:"Clear"})]})]}),B?(0,a.jsxs)("div",{ref:Y,className:"absolute right-4 top-[72px] z-20 w-[min(360px,calc(100vw-2rem))] rounded-[20px] border border-border-subtle bg-surface p-2 shadow-2xl shadow-black/40 lg:right-6",children:[(0,a.jsx)("div",{className:"px-3 py-2",children:(0,a.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-text-subtle",children:"Recent chats"})}),(0,a.jsx)("div",{className:"max-h-[48vh] space-y-2 overflow-y-auto p-1 custom-scrollbar",children:0===ee.length?(0,a.jsx)("div",{className:"rounded-[16px] border border-dashed border-border-subtle bg-surface-2 p-4 text-sm text-text-muted",children:"No conversations yet."}):ee.map(e=>{let t=e.id===w,r=[...e.messages||[]].reverse().find(e=>"user"===e.role)||e.messages?.[0];return(0,a.jsx)("button",{type:"button",onClick:()=>{var t;let r;return t=e.id,void((r=y.find(e=>e.id===t))&&(j(t),I(r.providerId||S),k(r.modelId||A),F(!1)))},className:`w-full rounded-[16px] border px-3 py-3 text-left transition ${t?"border-primary/40 bg-primary/15":"border-border-subtle bg-surface-2 hover:bg-surface-3"}`,children:(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-text-main",children:e.title}),(0,a.jsx)("p",{className:"mt-1 truncate text-xs text-text-muted",children:x(r?.content)||"Empty chat"})]}),(0,a.jsx)("span",{className:"text-[10px] text-text-subtle shrink-0",children:function(e){if(!e)return"Now";let t=new Date(e).getTime();if(Number.isNaN(t))return"Now";let r=Math.max(1,Math.round((Date.now()-t)/6e4));if(r<60)return`${r}m`;let a=Math.round(r/60);return a<24?`${a}h`:`${Math.round(a/24)}d`}(e.updatedAt)})]})},e.id)})})]}):null,b?(0,a.jsx)("div",{className:"mt-4 rounded-[18px] border border-danger/20 bg-danger/10 px-4 py-3 text-danger",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"error"}),(0,a.jsx)("p",{className:"text-sm leading-6",children:b})]})}):null,(0,a.jsxs)("div",{className:"flex flex-1 flex-col min-h-0",children:[(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto py-4 custom-scrollbar",children:[0===Z.length?(0,a.jsx)("div",{className:"flex min-h-[50vh] items-center justify-center px-4 text-center",children:(0,a.jsxs)("div",{className:"max-w-xl space-y-4",children:[(0,a.jsx)("div",{className:"mx-auto flex size-16 items-center justify-center rounded-[20px] border border-border-subtle bg-surface-2 text-text-main",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[30px]",children:"chat"})}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("h2",{className:"text-2xl font-semibold text-text-main",children:"Start a conversation"}),(0,a.jsx)("p",{className:"text-sm leading-6 text-text-muted",children:"Simple chat interface to interact with any AI model from connected providers. Select a model and start chatting!"})]})]})}):null,(0,a.jsx)("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-4 px-4",children:Z.map(e=>{let t="user"===e.role,r="assistant"===e.role,s=r&&e.id===E&&"streaming"===e.status,l=x(e.content)||(r?U:"");return(0,a.jsx)("div",{className:`flex w-full ${t?"justify-end":"justify-start"} mb-6`,children:(0,a.jsxs)("div",{className:`max-w-[min(88%,42rem)] ${t?"rounded-3xl bg-surface-2 px-5 py-3.5 text-text-main":"text-text-main"}`,children:[(0,a.jsx)("div",{className:"mb-1 flex items-center justify-between gap-3",children:(0,a.jsx)("span",{className:"text-xs font-semibold",children:t?"You":V?.name||"Assistant"})}),e.attachments?.length?(0,a.jsx)("div",{className:"mb-3 grid grid-cols-2 gap-2 sm:grid-cols-3 mt-2",children:e.attachments.map(e=>(0,a.jsx)("a",{href:e.dataUrl,target:"_blank",rel:"noreferrer",className:"overflow-hidden rounded-[18px] border border-border-subtle bg-surface-3",children:(0,a.jsx)("img",{src:e.dataUrl,alt:e.name,className:"h-28 w-full object-cover"})},e.id))}):null,(0,a.jsxs)("div",{className:"whitespace-pre-wrap break-words text-[15px] leading-7",children:[l,r&&s&&!U?(0,a.jsx)("span",{className:"inline-block animate-pulse",children:"▋"}):null]})]})},e.id)})})]}),(0,a.jsxs)("div",{className:"shrink-0 pt-2",children:[$.length>0?(0,a.jsx)("div",{className:"mx-auto mb-3 flex w-full max-w-3xl flex-wrap gap-2 px-4",children:$.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-full border border-border-subtle bg-surface-2 px-3 py-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-main max-w-[12rem] truncate",children:e.name}),(0,a.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void C(e=>e.filter(e=>e.id!==t))},className:"text-text-muted hover:text-text-main","aria-label":"Remove attachment",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]},e.id))}):null,(0,a.jsx)("div",{className:"mx-auto w-full max-w-3xl px-4 pb-2",children:(0,a.jsxs)("div",{className:"rounded-[26px] bg-surface-2 px-3 pt-3 pb-2 shadow-[0_0_15px_rgba(0,0,0,0.10)] ring-1 ring-border-subtle",children:[(0,a.jsx)("textarea",{value:D,onChange:e=>O(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),et&&el())},placeholder:"Message AI",rows:1,className:"w-full resize-none bg-transparent px-2 text-[15px] leading-6 text-text-main outline-none placeholder:text-text-subtle custom-scrollbar max-h-[25vh] overflow-y-auto"}),(0,a.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>K.current?.click(),disabled:!V||r,className:"p-2 text-text-muted hover:text-text-main transition rounded-full hover:bg-surface-2",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"attach_file"})}),(0,a.jsx)("input",{ref:K,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:es}),(0,a.jsx)("span",{className:"text-xs font-medium text-text-subtle truncate max-w-[120px]",children:V?V.name:"No model"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[_?(0,a.jsx)("button",{type:"button",onClick:()=>{L.current?.abort()},className:"p-2 text-text-main bg-surface-3 hover:bg-surface-3 transition rounded-full h-8 w-8 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop"})}):null,(0,a.jsx)("button",{onClick:el,disabled:!et,className:`h-8 w-8 rounded-full flex items-center justify-center transition ${et?"bg-primary text-white hover:opacity-90":"bg-surface-3 text-text-subtle cursor-not-allowed"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_upward"})})]})]})]})})]}),(0,a.jsx)("p",{className:"mx-auto mt-2 max-w-3xl px-4 pb-4 text-center text-[11px] text-text-subtle",children:"Model list is filtered from connected providers."})]})]})})}}},e=>{e.O(0,[27,8105,1321,705,5497,8441,3794,7358],()=>e(e.s=78487)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3554],{79595:(e,t,a)=>{Promise.resolve().then(a.bind(a,85309))},85309:(e,t,a)=>{"use strict";a.d(t,{default:()=>x});var s=a(95155),l=a(12115),r=a(98500),i=a.n(r),o=a(35497),n=a(3534),c=a(28777),d=a(8773);let u=a(41463).env.NEXT_PUBLIC_CLOUD_URL;function x({toolId:e,machineId:t}){let a=n.dM[e],[r,v]=(0,l.useState)([]),[m,h]=(0,l.useState)(!0),[p,b]=(0,l.useState)({}),[f,j]=(0,l.useState)(!1),[E,P]=(0,l.useState)(!1),[w,k]=(0,l.useState)(""),[g,N]=(0,l.useState)(!1),[_,y]=(0,l.useState)(""),[S,A]=(0,l.useState)([]);(0,l.useEffect)(()=>{let e=!0;return(async()=>{try{let[t,a,s,l]=await Promise.all([fetch("/api/providers"),fetch("/api/settings"),fetch("/api/tunnel/status"),fetch("/api/keys")]);if(!e)return;if(t.ok){let e=await t.json();v(e.connections||[])}if(a.ok){let e=await a.json();j(e.cloudEnabled||!1)}if(s.ok){let e=await s.json();P(!!(e.tunnel?.enabled||e.tunnel?.settingsEnabled)),k(e.tunnel?.publicUrl||""),N(!!(e.tailscale?.enabled||e.tailscale?.settingsEnabled)),y(e.tailscale?.tunnelUrl||"")}if(l.ok){let e=await l.json();A(e.keys||[])}}catch(e){console.log("Error loading tool data:",e)}finally{e&&h(!1)}})(),()=>{e=!1}},[]);let C=()=>r.filter(e=>!1!==e.isActive),U=(0,l.useCallback)((e,t,a)=>{b(s=>s[e]?.[t]===a?s:{...s,[e]:{...s[e],[t]:a}})},[]);return a?(0,s.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:[(0,s.jsxs)(i(),{href:"/dashboard/cli-tools",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary w-fit",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),"Back to CLI Tools"]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold text-text-main sm:text-2xl",children:a.name}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:a.description})]}),m?(0,s.jsx)(o.Qv,{}):(()=>{let t,l,r,i=(t=C(),l=[],r=new Set,t.forEach(e=>{let t=c.Xg[e.provider]||e.provider;(0,c.KC)(e.provider).forEach(a=>{let s=`${t}/${a.id}`;r.has(s)||(r.add(s),l.push({value:s,label:`${t}/${a.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:a.id}))})}),l).length>0,o={tool:a,isExpanded:!0,onToggle:()=>{},baseUrl:E&&w?w:f&&u?u:window.location.origin,apiKeys:S,tunnelEnabled:E,tunnelPublicUrl:w,tailscaleEnabled:g,tailscaleUrl:_};switch(e){case"claude":return(0,s.jsx)(d.Tk,{...o,activeProviders:C(),modelMappings:p[e]||{},onModelMappingChange:(t,a)=>U(e,t,a),hasActiveProviders:i,cloudEnabled:f});case"codex":return(0,s.jsx)(d.Ah,{...o,activeProviders:C(),cloudEnabled:f});case"opencode":return(0,s.jsx)(d.qO,{...o,activeProviders:C(),cloudEnabled:f});case"cowork":return(0,s.jsx)(d.Q6,{...o,activeProviders:C(),hasActiveProviders:i,cloudEnabled:f,cloudUrl:u,tunnelEnabled:E,tunnelPublicUrl:w,tailscaleEnabled:g,tailscaleUrl:_});case"droid":return(0,s.jsx)(d.ZM,{...o,activeProviders:C(),hasActiveProviders:i,cloudEnabled:f});case"openclaw":return(0,s.jsx)(d.yZ,{...o,activeProviders:C(),hasActiveProviders:i,cloudEnabled:f});case"hermes":return(0,s.jsx)(d.RF,{...o,activeProviders:C(),hasActiveProviders:i,cloudEnabled:f});case"copilot":return(0,s.jsx)(d.h1,{...o,activeProviders:C(),cloudEnabled:f});case"cline":return(0,s.jsx)(d.aG,{...o,activeProviders:C(),cloudEnabled:f});case"kilo":return(0,s.jsx)(d.c9,{...o,activeProviders:C(),cloudEnabled:f});case"deepseek-tui":return(0,s.jsx)(d.lF,{...o,activeProviders:C(),hasActiveProviders:i,cloudEnabled:f});case"jcode":return(0,s.jsx)(d.mW,{...o,activeProviders:C(),hasActiveProviders:i,cloudEnabled:f});default:return(0,s.jsx)(d.a7,{toolId:e,...o,activeProviders:C(),cloudEnabled:f,tunnelEnabled:E})}})()]}):(0,s.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:[(0,s.jsxs)(i(),{href:"/dashboard/cli-tools",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary w-fit",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),"Back to CLI Tools"]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Tool not found or disabled."})]})}}},e=>{e.O(0,[27,5772,8105,1321,705,5497,682,8441,3794,7358],()=>e(e.s=79595)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{33899:(e,s,l)=>{Promise.resolve().then(l.bind(l,53501))},53501:(e,s,l)=>{"use strict";l.d(s,{default:()=>m});var t=l(95155),a=l(12115),r=l(35497),i=l(3534),n=l(8773),c=l(98500),o=l.n(c),d=l(5772);function x({toolId:e,tool:s,status:l}){let a=l?l.installed?l.hasExtremeRouter?{label:"Connected",cls:"bg-green-500/10 text-green-600 dark:text-green-400"}:{label:"Not configured",cls:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400"}:{label:"Not installed",cls:"bg-gray-500/10 text-gray-500"}:{label:"Unknown",cls:"bg-gray-500/10 text-gray-500"};return(0,t.jsx)(o(),{href:`/dashboard/cli-tools/${e}`,className:"block",children:(0,t.jsx)(r.Zp,{padding:"sm",className:"h-full overflow-hidden hover:border-primary/50 transition-colors cursor-pointer",children:(0,t.jsx)("div",{className:"flex h-full flex-col gap-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:s.image?(0,t.jsx)(d.default,{src:s.image,alt:s.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}}):s.icon?(0,t.jsx)("span",{className:"material-symbols-outlined text-[28px]",style:{color:s.color},children:s.icon}):null}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"font-medium text-sm truncate",children:s.name}),(0,t.jsx)("span",{className:`inline-block mt-1 px-1.5 py-0.5 text-[10px] font-medium rounded-full ${a.cls}`,children:a.label})]}),(0,t.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px] shrink-0",children:"chevron_right"})]})})})})}function m({machineId:e}){let[s,l]=(0,a.useState)(!0),[c,o]=(0,a.useState)({});if((0,a.useEffect)(()=>{let e=!0;return(async()=>{try{let s=await fetch("/api/cli-tools/all-statuses");s.ok&&e&&o(await s.json())}catch(e){console.log("Error fetching tool statuses:",e)}finally{e&&l(!1)}})(),()=>{e=!1}},[]),s)return(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:[(0,t.jsx)(r.Qv,{}),(0,t.jsx)(r.Qv,{}),(0,t.jsx)(r.Qv,{}),(0,t.jsx)(r.Qv,{}),(0,t.jsx)(r.Qv,{}),(0,t.jsx)(r.Qv,{})]});let d=Object.entries(i.dM),g=Object.entries(i.wn);return(0,t.jsxs)("div",{className:"flex w-full flex-col gap-6",children:[(0,t.jsx)(r.zY,{title:"CLI Tools",description:"Configure developer tools to use ExtremeRouter",icon:"terminal"}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3",children:d.map(([e,s])=>(0,t.jsx)(x,{toolId:e,tool:s,status:c[e]},e))}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 sm:gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"security"}),(0,t.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"MITM Tools"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3",children:g.map(([e,s])=>(0,t.jsx)(n.gY,{tool:s},e))})]})]})}}},e=>{e.O(0,[27,5772,8105,1321,705,5497,682,8441,3794,7358],()=>e(e.s=33899)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{49293:(e,t,s)=>{Promise.resolve().then(s.bind(s,85330))},85330:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>z});var l=s(95155),a=s(12115),r=s(73321),o=s(35497),i=s(11059);let n=/^[a-zA-Z0-9_.\-]+$/,c=[{value:"fallback",label:"Fallback",desc:"Try models in order, next on failure",icon:"layers"},{value:"round-robin",label:"Round Robin",desc:"Rotate models across requests",icon:"cached"},{value:"fusion",label:"Fusion",desc:"Parallel panel + judge synthesis",icon:"hub"},{value:"swarm",label:"Swarm",desc:"Hierarchical Manager→Staff→Workers",icon:"account_tree"}],d={fallback:{icon:"layers",color:"#3B82F6",badge:"info"},"round-robin":{icon:"cached",color:"#10B981",badge:"success"},fusion:{icon:"hub",color:"#8B5CF6",badge:"primary"},swarm:{icon:"account_tree",color:"#F59E0B",badge:"warning"}};function m(e){return d[e]||d.fallback}function x(e){let t=c.find(t=>t.value===e);return t?.label||"Fallback"}let u=[{value:"all",label:"All"},{value:"fallback",label:"Fallback"},{value:"round-robin",label:"Round Robin"},{value:"fusion",label:"Fusion"},{value:"swarm",label:"Swarm"}],p=[{value:"name",label:"Name"},{value:"models-desc",label:"Most Models"},{value:"models-asc",label:"Fewest Models"}];function h({combos:e,comboStrategies:t,activeProviders:s,onViewCombos:a,onCreate:r}){let i=e.length,n=function(e){let t=new Set;for(let s of e)for(let e of s.models||[])t.add(e);return t.size}(e),c=function(e,t){let s={fallback:0,"round-robin":0,fusion:0,swarm:0},l=new Set(["fallback","round-robin","fusion","swarm"]);for(let a of e){let e=t[a.name]?.fallbackStrategy||"fallback",r=l.has(e)?e:"fallback";s[r]=(s[r]||0)+1}return s}(e,t),d=Object.values(c).filter(e=>e>0).length,u=i>0?Math.round(e.reduce((e,t)=>e+(t.models?.length||0),0)/i*10)/10:0,p=Math.max(...Object.values(c),1);return(0,l.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,l.jsx)("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:[{label:"Total Combos",value:i,icon:"layers",color:"#3B82F6"},{label:"Unique Models",value:n,icon:"model_training",color:"#10B981"},{label:"Strategies Used",value:d,icon:"account_tree",color:"#8B5CF6"},{label:"Avg Models/Combo",value:u,icon:"analytics",color:"#F59E0B"}].map(e=>(0,l.jsx)(o.Zp,{padding:"sm",children:(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${e.color}15`},children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",style:{color:e.color},children:e.icon})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-mono text-lg font-bold text-text-main",children:e.value}),(0,l.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:e.label})]})]})},e.label))}),(0,l.jsxs)(o.Zp,{children:[(0,l.jsxs)("div",{className:"mb-3",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Strategy Distribution"}),(0,l.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:"How combos are distributed across routing strategies"})]}),(0,l.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(c).map(([e,t])=>{let s=m(e),a=i>0?Math.round(t/i*100):0;return(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsxs)("div",{className:"flex w-28 items-center gap-1.5",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:{color:s.color},children:s.icon}),(0,l.jsx)("span",{className:"text-xs font-medium text-text-main",children:x(e)})]}),(0,l.jsx)("div",{className:"flex-1 overflow-hidden rounded-full bg-surface-2",children:(0,l.jsx)("div",{className:"h-2.5 rounded-full transition-all",style:{width:`${t/p*100}%`,backgroundColor:s.color}})}),(0,l.jsxs)("span",{className:"w-16 text-right font-mono text-xs text-text-muted",children:[t," (",a,"%)"]})]},e)})})]}),(0,l.jsxs)(o.Zp,{children:[(0,l.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Combo Health"}),(0,l.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:"Overview of each combo's status"})]}),(0,l.jsx)(o.$n,{size:"sm",variant:"ghost",icon:"list_alt",onClick:a,children:"View All"})]}),0===e.length?(0,l.jsxs)("div",{className:"py-6 text-center text-sm text-text-muted",children:["No combos yet. ",(0,l.jsx)("button",{onClick:r,className:"text-primary hover:underline",children:"Create one →"})]}):(0,l.jsx)("div",{className:"flex flex-col gap-2",children:e.map(e=>{let a=t[e.name]?.fallbackStrategy||"fallback",r=m(a),i=(e.models||[]).filter(e=>{let t=e.split("/")[0];return s.some(e=>e.provider===t&&!1!==e.isActive)}).length,n=(e.models||[]).length,c=n>0?Math.round(i/n*100):0;return(0,l.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle px-3 py-2 hover:bg-sidebar/30",children:[(0,l.jsx)("div",{className:"flex size-7 shrink-0 items-center justify-center rounded",style:{backgroundColor:`${r.color}15`},children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[15px]",style:{color:r.color},children:r.icon})}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("code",{className:"truncate font-mono text-xs font-medium",children:e.name}),(0,l.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,l.jsx)(o.Ex,{variant:r.badge,size:"sm",children:x(a)}),(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:[n," models"]})]})]}),(0,l.jsxs)("div",{className:"hidden sm:flex items-center gap-2 shrink-0",children:[(0,l.jsx)("div",{className:"w-20 overflow-hidden rounded-full bg-surface-2",children:(0,l.jsx)("div",{className:`h-1.5 rounded-full ${c>=80?"bg-success":c>=50?"bg-warning":"bg-danger"}`,style:{width:`${c}%`}})}),(0,l.jsxs)("span",{className:"w-8 text-right font-mono text-[10px] text-text-muted",children:[i,"/",n]})]})]},e.id)})})]})]})}var b=s(88105);function f(e){let t=b.Q2[e]?.capabilities;return!t||!1!==t.toolUse&&!1!==t.fileAccess}function g(e){if(!e||"string"!=typeof e)return null;let t=e.indexOf("/");return t>=0?e.slice(0,t):e}function j(e,t){if(e){let t=g(e);return{blocked:!!t&&!f(t),provider:t}}let s=g(t&&t.length>0?t[0]:null);return{blocked:!!s&&!f(s),provider:s}}function v(e){return e.filter(e=>f(e.provider))}function y({combo:e,modelCaps:t={},activeProviders:s=[],copied:r,onCopy:i,onEdit:n,onDelete:d,strategy:u={},onSetStrategy:p}){let[h,b]=(0,a.useState)(!1),[f,g]=(0,a.useState)(!1),[N,w]=(0,a.useState)(null),k=Array.isArray(e?.models)?e.models:[],C=u.fallbackStrategy||"fallback",S=u.judgeModel||"",M="fusion"===C,$="swarm"===C,A=u.managerModel||"",E=u.staffModel||"",F=u.auditModel||"",O=m(C);return(0,l.jsxs)(o.Zp,{padding:"sm",className:"group transition-all hover:border-primary/20",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsxs)("button",{className:"flex min-w-0 flex-1 items-start gap-3 text-left sm:items-center",onClick:()=>b(!h),children:[(0,l.jsx)("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${O.color}15`},children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",style:{color:O.color},children:O.icon})}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("code",{className:"truncate font-mono text-sm font-medium",children:e.name}),(0,l.jsx)(o.Ex,{variant:O.badge,size:"sm",children:x(C)}),(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:[k.length," models"]})]}),(0,l.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1",children:[0===k.length?(0,l.jsx)("span",{className:"text-xs text-text-muted italic",children:"No models"}):k.slice(0,3).map((e,s)=>(0,l.jsxs)("code",{className:"inline-flex items-center gap-1 rounded bg-black/5 px-1.5 py-0.5 font-mono text-xs text-text-muted dark:bg-white/5",children:[(0,l.jsx)("span",{className:"truncate max-w-[120px]",children:e}),t[e]&&(0,l.jsx)(o.nh,{caps:t[e],size:11})]},s)),k.length>3&&(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",k.length-3," more"]})]})]}),(0,l.jsx)("span",{className:`shrink-0 text-text-muted transition-transform ${h?"rotate-180":""}`,children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"expand_more"})})]}),(0,l.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3 sm:shrink-0",children:[(0,l.jsx)("div",{className:"w-full sm:w-[180px]",children:(0,l.jsx)(o.l6,{options:c,value:C,onChange:e=>p({fallbackStrategy:e.target.value}),selectClassName:"py-1.5 text-xs"})}),(0,l.jsxs)("div",{className:"grid grid-cols-3 gap-1 sm:flex",children:[(0,l.jsxs)("button",{onClick:t=>{t.stopPropagation(),i(e.name,`combo-${e.id}`)},className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Copy combo name",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:r===`combo-${e.id}`?"check":"content_copy"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Copy"})]}),(0,l.jsxs)("button",{onClick:n,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Edit",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,l.jsxs)("button",{onClick:d,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 transition-colors hover:bg-red-500/10",title:"Delete",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]})]})]}),h&&(0,l.jsxs)("div",{className:"mt-3 border-t border-border-subtle pt-3",children:[(0,l.jsxs)("div",{className:"mb-3",children:[(0,l.jsxs)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted mb-1.5",children:["Models (",k.length,")"]}),(0,l.jsx)("div",{className:"flex flex-col gap-1",children:k.map((e,s)=>(0,l.jsxs)("div",{className:"flex items-center gap-2 rounded px-2 py-1 bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,l.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-4 text-center",children:s+1}),(0,l.jsx)("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-text-main",children:e}),t[e]&&(0,l.jsx)(o.nh,{caps:t[e],size:11})]},s))})]}),M&&(0,l.jsxs)("div",{className:"mb-3",children:[(0,l.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted mb-1.5",children:"Fusion Judge"}),(()=>{let{blocked:e,provider:t}=j(S,k);return(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)("button",{onClick:()=>g(!0),className:`inline-flex max-w-full items-center gap-1 rounded border border-dashed px-2 py-1 font-mono text-xs hover:bg-primary/5 ${e?"border-red-400 text-red-500 hover:border-red-500":"border-primary/40 text-primary hover:border-primary"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"gavel"}),(0,l.jsx)("span",{className:"truncate",children:S||`Auto — ${k[0]||"first model"}`})]}),S&&(0,l.jsx)("button",{onClick:()=>p({judgeModel:""}),className:"p-1 rounded text-text-muted hover:text-red-500 hover:bg-red-500/10",title:"Reset to Auto",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),e&&(0,l.jsx)("p",{className:"text-[10px] text-red-500",children:S?"⚠ Web cookie providers cannot serve as Judge (no tool use / file access)":`⚠ Auto-fallback to "${t}" (first combo model) — web cookie cannot serve as Judge`})]})})()]}),$&&(0,l.jsxs)("div",{className:"mb-3",children:[(0,l.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted mb-1.5",children:"Swarm Roles"}),(0,l.jsxs)("div",{className:"flex flex-col gap-1.5",children:[[{key:"manager",label:"Manager",icon:"psychology",value:A,placeholder:`Auto — ${k[0]||"first"}`},{key:"staff",label:"Staff",icon:"badge",value:E,placeholder:"Same as Manager"},{key:"audit",label:"Audit",icon:"fact_check",value:F,placeholder:"Same as Staff"}].map(e=>{let{blocked:t,provider:s}=j(e.value,k);return(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-medium text-text-muted w-16",children:e.label}),(0,l.jsxs)("button",{onClick:()=>w(e.key),className:`inline-flex max-w-full items-center gap-1 rounded border border-dashed px-2 py-0.5 font-mono text-[11px] hover:bg-primary/5 ${t?"border-red-400 text-red-500 hover:border-red-500":"border-primary/40 text-primary hover:border-primary"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:e.icon}),(0,l.jsx)("span",{className:"truncate",children:e.value||e.placeholder})]}),e.value&&(0,l.jsx)("button",{onClick:()=>p({[`${e.key}Model`]:""}),className:"p-0.5 rounded text-text-muted hover:text-red-500 hover:bg-red-500/10",title:`Reset ${e.label}`,children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"close"})})]}),t&&(0,l.jsx)("p",{className:"text-[10px] text-red-500 pl-[76px]",children:e.value?`⚠ Web cookie providers cannot serve as ${e.label} (no tool use / file access)`:`⚠ Auto-fallback to "${s}" (first combo model) — web cookie cannot serve as ${e.label}`})]},e.key)}),(0,l.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-text-muted",children:[(0,l.jsx)("span",{className:"font-medium",children:"Workers"}),(0,l.jsxs)("span",{children:["= combo models (",k.length,")"]}),(0,l.jsx)("span",{className:"text-text-subtle",children:"\xb7"}),(0,l.jsx)("a",{href:"/dashboard/swarm",className:"text-primary hover:underline",children:"Telemetry →"})]})]})]}),(0,l.jsxs)("div",{className:"text-xs text-text-muted bg-black/[0.02] dark:bg-white/[0.02] rounded px-2 py-1.5",children:[(0,l.jsxs)("span",{className:"font-medium",children:[x(C),":"]})," ",c.find(e=>e.value===C)?.desc]})]}),(0,l.jsx)(o.rq,{isOpen:f,onClose:()=>g(!1),onSelect:e=>{p({judgeModel:e?.value||""}),g(!1)},activeProviders:v(s),title:"Select Judge Model",addedModelValues:S?[S]:[],closeOnSelect:!0}),N&&(0,l.jsx)(o.rq,{isOpen:!0,onClose:()=>w(null),onSelect:e=>{p({[`${N}Model`]:e?.value||""}),w(null)},activeProviders:v(s),title:`Select ${"manager"===N?"Manager":"staff"===N?"Staff":"Audit"} Model`,addedModelValues:"manager"===N?A?[A]:[]:"staff"===N?E?[E]:[]:F?[F]:[],closeOnSelect:!0})]})}function N({combos:e,modelCaps:t,activeProviders:s,comboStrategies:r,copied:i,copy:n,onEdit:c,onDelete:d,onSetStrategy:m,onCreate:x}){let[h,b]=(0,a.useState)(""),[f,g]=(0,a.useState)("all"),[j,v]=(0,a.useState)("name"),w=(0,a.useMemo)(()=>{var t;let s;return t=function(e,t,s,l){let a=e;if("all"!==s&&(a=a.filter(e=>(l[e.name]?.fallbackStrategy||"fallback")===s)),t.trim()){let e=t.trim().toLowerCase();a=a.filter(t=>t.name.toLowerCase().includes(e)||(t.models||[]).some(t=>t.toLowerCase().includes(e)))}return a}(e,h,f,r),s=[...t],"models-desc"===j?s.sort((e,t)=>(t.models?.length||0)-(e.models?.length||0)):"models-asc"===j?s.sort((e,t)=>(e.models?.length||0)-(t.models?.length||0)):s.sort((e,t)=>e.name.localeCompare(t.name)),s},[e,h,f,j,r]);return 0===e.length?(0,l.jsx)(o.pp,{icon:"layers",title:"No combos yet",description:"Create model combos with fallback, round-robin, fusion, or swarm strategies",actionText:"Create Combo",onAction:x}):(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsx)(o.pd,{placeholder:"Search combos or models...",value:h,onChange:e=>b(e.target.value),className:"sm:max-w-xs"}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"flex flex-wrap gap-1",children:u.map(e=>(0,l.jsx)("button",{onClick:()=>g(e.value),className:`rounded-full px-2.5 py-1 text-xs font-medium transition-colors ${f===e.value?"bg-primary/15 text-primary ring-1 ring-primary/20":"bg-surface-2 text-text-muted hover:text-text-main"}`,children:e.label},e.value))}),(0,l.jsx)("select",{value:j,onChange:e=>v(e.target.value),className:"appearance-none rounded-lg border border-border bg-surface-2 py-1.5 pl-3 pr-8 text-xs text-text-main [-webkit-appearance:none] [-moz-appearance:none] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30",children:p.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))})]})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:w.length===e.length?`${e.length} combo${1!==e.length?"s":""}`:`${w.length} of ${e.length} combos`}),0===w.length?(0,l.jsx)(o.Zp,{children:(0,l.jsxs)("div",{className:"py-8 text-center text-sm text-text-muted",children:['No combos match "',h,'" ',"all"!==f&&`with ${f} strategy`]})}):(0,l.jsx)("div",{className:"flex flex-col gap-3",children:w.map(e=>(0,l.jsx)(y,{combo:e,modelCaps:t,activeProviders:s,copied:i,onCopy:n,onEdit:()=>c(e),onDelete:()=>d(e.id),strategy:r[e.name]||{},onSetStrategy:t=>m(e.name,t)},e.id))})]})}let w=[{id:"always-on",name:"Always-On (5-Layer Fallback)",description:"Zero-downtime coding with 5 layers of fallback. Mix of subscription, cheap, and free tiers — if any model fails, the next picks up automatically.",icon:"shield",category:"reliability",strategy:"fallback",models:["cc/claude-opus-4-7","cx/gpt-5.4","glm/glm-5.1","minimax/MiniMax-M2.7","kr/claude-sonnet-4.5"],requiredProviders:["claude","codex","glm","minimax","kiro"]}];function k({combos:e,connections:t,onApply:s}){let[r,i]=(0,a.useState)(null),n=new Set(t?.filter(e=>!1!==e.isActive).map(e=>e.provider)||[]),c=new Set((e||[]).map(e=>e.name)),d=async e=>{i(e.id);try{let t=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,models:e.models,kind:null})});if(!t.ok){let e=await t.json();alert(e.error||"Failed to create combo from template");return}let l=await fetch("/api/settings").then(e=>e.json()).catch(()=>({})),a={...l?.comboStrategies||{},[e.name]:{fallbackStrategy:e.strategy}};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:a})}),s&&s()}catch(e){alert("Failed to apply template: "+(e?.message||String(e)))}finally{i(null)}};return 0===w.length?(0,l.jsx)(o.pp,{icon:"dashboard_customize",title:"No templates available",description:"Combo templates will appear here when added."}):(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"mb-1",children:[(0,l.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"Combo Templates"}),(0,l.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:"One-click prebuilt combos. Provider availability is checked automatically."})]}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:w.map(e=>{let t=(e.requiredProviders||[]).filter(e=>n.has(e)).length,s=(e.requiredProviders||[]).length,a=c.has(e.name),i=m(e.strategy);return(0,l.jsxs)(o.Zp,{padding:"sm",className:"flex flex-col gap-3 hover:border-primary/20 transition-all",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,l.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${i.color}15`},children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",style:{color:i.color},children:e.icon||i.icon})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-sm font-semibold text-text-main",children:e.name}),(0,l.jsx)(o.Ex,{variant:i.badge,size:"sm",children:x(e.strategy)})]})]}),a&&(0,l.jsx)(o.Ex,{variant:"success",size:"sm",dot:!0,children:"Created"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted leading-relaxed",children:e.description}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(e.models||[]).slice(0,4).map((e,t)=>(0,l.jsx)("code",{className:"inline-flex items-center rounded bg-black/5 px-1.5 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5",children:e},t)),(e.models||[]).length>4&&(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",(e.models||[]).length-4," more"]})]}),(0,l.jsx)("div",{className:"flex flex-wrap gap-1",children:(e.requiredProviders||[]).map(e=>{let t=n.has(e);return(0,l.jsxs)("span",{className:`inline-flex items-center gap-0.5 rounded-full px-1.5 py-0.5 text-[10px] font-medium ${t?"bg-success/10 text-success":"bg-surface-2 text-text-muted"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[10px]",children:t?"check_circle":"radio_button_unchecked"}),e]},e)})}),(0,l.jsx)("div",{className:"mt-auto pt-1",children:(0,l.jsx)(o.$n,{size:"sm",fullWidth:!0,variant:a?"secondary":"primary",icon:r===e.id?"progress_activity":"add",disabled:a||r===e.id,onClick:()=>d(e),children:r===e.id?"Creating...":a?"Already Created":t===s?"Apply Template":`Apply (${t}/${s} ready)`})})]},e.id)})})]})}var C=s(44923),S=s(87256),M=s(5020),$=s(39768);function A({id:e,index:t,model:s,isFirst:r,isLast:i,modelCaps:n,onEdit:c,onMoveUp:d,onMoveDown:m,onRemove:x}){let{attributes:u,listeners:p,setNodeRef:h,transform:b,isDragging:f}=(0,S.gl)({id:e}),g={transform:$.Ks.Transform.toString(b),opacity:f?.5:1,zIndex:f?999:void 0},[j,v]=(0,a.useState)(!1),[y,N]=(0,a.useState)(s),w=()=>{let e=y.trim();e&&e!==s?c(e):N(s),v(!1)};return(0,l.jsxs)("div",{ref:h,style:g,className:`group flex min-w-0 items-center gap-2 rounded-lg border px-2.5 py-1.5 transition-all ${f?"border-primary/40 bg-panel shadow-md ring-1 ring-primary/20":"border-transparent bg-panel hover:border-border-subtle"}`,children:[(0,l.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center rounded bg-primary/10 text-[10px] font-bold text-primary",children:t+1}),(0,l.jsx)("button",{...u,...p,type:"button",className:"cursor-grab touch-none shrink-0 p-0.5 rounded text-text-muted/50 hover:text-text-main active:cursor-grabbing",title:"Drag to reorder",children:(0,l.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,l.jsx)("circle",{cx:"9",cy:"4",r:"1.5"}),(0,l.jsx)("circle",{cx:"15",cy:"4",r:"1.5"}),(0,l.jsx)("circle",{cx:"9",cy:"12",r:"1.5"}),(0,l.jsx)("circle",{cx:"15",cy:"12",r:"1.5"}),(0,l.jsx)("circle",{cx:"9",cy:"20",r:"1.5"}),(0,l.jsx)("circle",{cx:"15",cy:"20",r:"1.5"})]})}),j?(0,l.jsx)("input",{autoFocus:!0,value:y,onChange:e=>N(e.target.value),onBlur:w,onKeyDown:e=>{"Enter"===e.key&&w(),"Escape"===e.key&&(N(s),v(!1))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-panel px-1.5 py-0.5 font-mono text-xs text-text-main outline-none"}):(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 cursor-text rounded px-1 py-0.5 hover:bg-black/[0.03] dark:hover:bg-white/[0.03]",onClick:()=>v(!0),title:"Click to edit",children:[(0,l.jsx)("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-text-main",children:s}),n?.[s]&&(0,l.jsx)(o.nh,{caps:n[s],size:11})]}),(0,l.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,l.jsx)("button",{onClick:d,disabled:r,className:`rounded p-1 transition-colors ${r?"cursor-not-allowed text-text-muted/20":"text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5"}`,title:"Move up",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"arrow_upward"})}),(0,l.jsx)("button",{onClick:m,disabled:i,className:`rounded p-1 transition-colors ${i?"cursor-not-allowed text-text-muted/20":"text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5"}`,title:"Move down",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"arrow_downward"})})]}),(0,l.jsx)("button",{onClick:x,className:"shrink-0 rounded p-1 text-text-muted opacity-0 transition-all hover:bg-danger/10 hover:text-danger group-hover:opacity-100",title:"Remove model",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}function E({isOpen:e,combo:t,onClose:s,onSave:r,activeProviders:i,modelCaps:d={},kindFilter:m=null}){let[x,u]=(0,a.useState)(t?.name||""),[p,h]=(0,a.useState)(t?.models||[]),[b,f]=(0,a.useState)(!1),[g,j]=(0,a.useState)(!1),[v,y]=(0,a.useState)(""),[N,w]=(0,a.useState)({}),[k,$]=(0,a.useState)(e);(0,a.useEffect)(()=>{e&&!k&&(u(t?.name||""),h(Array.isArray(t?.models)?[...t.models]:[]),y(""),f(!1)),$(e)},[e,k,t]);let F=(0,C.FR)((0,C.MS)(C.AN,{activationConstraint:{distance:5}}),(0,C.MS)(C.uN,{coordinateGetter:S.JR})),O=p.map((e,t)=>({uid:`item-${t}`,model:e}));(0,a.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let e=await fetch("/api/models/alias");if(!t&&e.ok){let t=await e.json();w(t.aliases||{})}}catch{}})(),()=>{t=!0}},[e]);let z=e=>e.trim()?n.test(e)?(y(""),!0):(y("Only letters, numbers, -, _ and . allowed"),!1):(y("Name is required"),!1),_=async()=>{z(x)&&(j(!0),await r({name:x.trim(),models:p}),j(!1))},P=!!t;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.aF,{isOpen:e,onClose:s,title:P?"Edit Combo":"Create Combo",size:"lg",children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(o.pd,{label:"Combo Name",value:x,onChange:e=>{let t=e.target.value;u(t),t?z(t):y("")},placeholder:"my-combo",error:v}),(0,l.jsxs)("div",{className:"mt-1.5 flex items-center gap-2",children:[(0,l.jsx)("p",{className:"text-[10px] text-text-muted",children:"Use this name as the model in your client:"}),x.trim()&&(0,l.jsx)("code",{className:"rounded bg-primary/10 px-1.5 py-0.5 font-mono text-[10px] text-primary",children:x.trim()})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-text-main",children:"Models"}),p.length>0&&(0,l.jsxs)(o.Ex,{variant:"info",size:"sm",children:[p.length," model",1!==p.length?"s":""]})]}),(0,l.jsx)("span",{className:"text-[10px] text-text-muted",children:"Drag to reorder priority"})]}),0===p.length?(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 border border-dashed border-border rounded-lg bg-surface-2/50",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-2xl mb-2",children:"layers"}),(0,l.jsx)("p",{className:"text-xs text-text-muted mb-3",children:"Add models to build your combo"}),(0,l.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>f(!0),children:"Add First Model"})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(C.Mp,{sensors:F,collisionDetection:C.fp,onDragEnd:e=>{let{active:t,over:s}=e;if(s&&t.id!==s.id){let e=O.findIndex(e=>e.uid===t.id),l=O.findIndex(e=>e.uid===s.id);-1!==e&&-1!==l&&h(t=>(0,S.be)(t,e,l))}},modifiers:[M.FN,M.gj],children:(0,l.jsx)(S.gB,{items:O.map(e=>e.uid),strategy:S._G,children:(0,l.jsx)("div",{className:"flex max-h-[45vh] min-w-0 flex-col gap-1 overflow-y-auto rounded-lg bg-surface-2/30 p-1.5",children:O.map(({uid:e,model:t},s)=>(0,l.jsx)(A,{id:e,index:s,model:t,modelCaps:d,isFirst:0===s,isLast:s===O.length-1,onEdit:e=>{let t=[...p];t[s]=e,h(t)},onMoveUp:()=>(e=>{if(0===e)return;let t=[...p];[t[e-1],t[e]]=[t[e],t[e-1]],h(t)})(s),onMoveDown:()=>(e=>{if(e===p.length-1)return;let t=[...p];[t[e],t[e+1]]=[t[e+1],t[e]],h(t)})(s),onRemove:()=>{h(e=>e.filter((e,t)=>t!==s))}},e))})})}),(0,l.jsxs)("button",{onClick:()=>f(!0),className:"w-full mt-2 py-2 border border-dashed border-primary/30 rounded-lg text-xs text-primary font-medium hover:border-primary hover:bg-primary/5 transition-colors flex items-center justify-center gap-1.5",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]})]}),p.length>=2&&(0,l.jsxs)("div",{className:"rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"lightbulb"}),(0,l.jsx)("span",{className:"text-xs font-medium text-text-main",children:"Strategy Tips"})]}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-2",children:c.map(e=>(0,l.jsxs)("div",{className:"flex items-start gap-1.5 text-[11px] text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px] mt-0.5 text-primary/60",children:e.icon}),(0,l.jsxs)("span",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:e.label})," — ",e.desc]})]},e.value))}),(0,l.jsx)("p",{className:"mt-1.5 text-[10px] text-text-muted",children:"Set strategy after creating the combo from the Combos tab."})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-2 pt-1 sm:flex-row",children:[(0,l.jsx)(o.$n,{onClick:s,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,l.jsx)(o.$n,{onClick:_,fullWidth:!0,size:"sm",icon:P?"save":"add",disabled:!x.trim()||!!v||g,children:g?"Saving...":P?"Save Changes":"Create Combo"})]})]})}),(0,l.jsx)(o.rq,{isOpen:b,onClose:()=>f(!1),onSelect:e=>{h(t=>t.includes(e.value)?t:[...t,e.value])},onDeselect:e=>{h(t=>t.filter(t=>t!==e.value))},activeProviders:i,modelAliases:N,title:"Add Model to Combo",kindFilter:m,addedModelValues:p,closeOnSelect:!1})]})}let F=[{value:"overview",label:"Overview"},{value:"combos",label:"Combos"},{value:"templates",label:"Templates"}];function O(){let e=(0,r.useRouter)(),t=(0,r.useSearchParams)().get("tab")||"overview",[s,n]=(0,a.useState)([]),[c,d]=(0,a.useState)(!0),[m,x]=(0,a.useState)(!1),[u,p]=(0,a.useState)(null),[b,f]=(0,a.useState)([]),[g,j]=(0,a.useState)({}),[v,y]=(0,a.useState)({}),[w,C]=(0,a.useState)(null),{copied:S,copy:M}=(0,i.C)(),$=(0,a.useCallback)(async()=>{try{let[e,t,s,l]=await Promise.all([fetch("/api/combos"),fetch("/api/providers"),fetch("/api/settings"),fetch("/api/models")]),a=await e.json(),r=await t.json(),o=s.ok?await s.json():{};if(e.ok&&n((a.combos||[]).filter(e=>!e.kind||"llm"===e.kind)),t.ok&&f(r.connections||[]),l.ok){let e=await l.json(),t={};for(let s of e.models||[])s.caps&&(t[s.fullModel]=s.caps);y(t)}j(o.comboStrategies||{})}catch(e){console.log("Error fetching data:",e)}finally{d(!1)}},[]);(0,a.useEffect)(()=>{$()},[$]);let A=t=>e.push(`/dashboard/combos?tab=${t}`),O=async e=>{try{let t=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)await $(),x(!1);else{let e=await t.json();alert(e.error||"Failed to create combo")}}catch(e){console.log("Error creating combo:",e)}},z=async(e,t)=>{try{let s=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(s.ok)await $(),p(null);else{let e=await s.json();alert(e.error||"Failed to update combo")}}catch(e){console.log("Error updating combo:",e)}},_=async(e,t)=>{try{let s={...g[e]||{},...t},l=s.fallbackStrategy,a=new Set(["fallbackStrategy",...{fusion:["judgeModel","fusionTuning"],swarm:["managerModel","staffModel","auditModel","workerCount","swarmTuning","enableTelemetry"],fallback:[],"round-robin":[]}[l]||[]]),r={};for(let[e,t]of Object.entries(s))a.has(e)&&(r[e]=t);let o=!r.fallbackStrategy||"fallback"===r.fallbackStrategy;await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:{[e]:o?null:r}})}),j(t=>{let s={...t};return o?delete s[e]:s[e]=r,s})}catch(e){console.log("Error updating combo strategy:",e)}};return c?(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)(o.Qv,{}),(0,l.jsx)(o.Qv,{})]}):(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-5",children:[(0,l.jsx)(o.zY,{title:"Combos",description:"Group models under one name, then pick a strategy per combo",icon:"layers",actions:(0,l.jsx)(o.$n,{size:"sm",icon:"add",onClick:()=>x(!0),className:"whitespace-nowrap",children:"Create Combo"})}),(0,l.jsx)(o.Iz,{options:F,value:t,onChange:A}),"overview"===t&&(0,l.jsx)(h,{combos:s,comboStrategies:g,activeProviders:b,onViewCombos:()=>A("combos"),onCreate:()=>x(!0)}),"combos"===t&&(0,l.jsx)(N,{combos:s,modelCaps:v,activeProviders:b,comboStrategies:g,copied:S,copy:M,onEdit:p,onDelete:e=>{C({title:"Delete Combo",message:"Delete this combo?",onConfirm:async()=>{C(null);try{let t=await fetch(`/api/combos/${e}`,{method:"DELETE"});if(t.ok)n(t=>t.filter(t=>t.id!==e));else{let e=await t.json().catch(()=>({}));alert(e.error||`Failed to delete combo (${t.status})`)}}catch(e){console.log("Error deleting combo:",e),alert("Failed to delete combo — network error")}}})},onSetStrategy:_,onCreate:()=>x(!0)}),"templates"===t&&(0,l.jsx)(k,{combos:s,connections:b,onApply:$}),(0,l.jsx)(E,{isOpen:m,onClose:()=>x(!1),onSave:O,activeProviders:b,modelCaps:v},"create"),(0,l.jsx)(E,{isOpen:!!u,combo:u,onClose:()=>p(null),onSave:e=>z(u.id,e),activeProviders:b,modelCaps:v},u?.id||"new"),(0,l.jsx)(o.uo,{isOpen:!!w,onClose:()=>C(null),onConfirm:w?.onConfirm,title:w?.title||"Confirm",message:w?.message,variant:"danger"})]})}function z(){return(0,l.jsx)(a.Suspense,{fallback:(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)("div",{className:"h-32 animate-pulse rounded-lg bg-sidebar"}),(0,l.jsx)("div",{className:"h-32 animate-pulse rounded-lg bg-sidebar"})]}),children:(0,l.jsx)(O,{})})}}},e=>{e.O(0,[27,7055,1321,705,5497,8441,3794,7358],()=>e(e.s=49293)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{49293:(e,t,s)=>{Promise.resolve().then(s.bind(s,85330))},85330:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>z});var l=s(95155),a=s(12115),r=s(73321),o=s(35497),i=s(11059);let n=/^[a-zA-Z0-9_.\-]+$/,c=[{value:"fallback",label:"Fallback",desc:"Try models in order, next on failure",icon:"layers"},{value:"round-robin",label:"Round Robin",desc:"Rotate models across requests",icon:"cached"},{value:"fusion",label:"Fusion",desc:"Parallel panel + judge synthesis",icon:"hub"},{value:"swarm",label:"Swarm",desc:"Hierarchical Manager→Staff→Workers",icon:"account_tree"}],d={fallback:{icon:"layers",color:"#3B82F6",badge:"info"},"round-robin":{icon:"cached",color:"#10B981",badge:"success"},fusion:{icon:"hub",color:"#8B5CF6",badge:"primary"},swarm:{icon:"account_tree",color:"#F59E0B",badge:"warning"}};function m(e){return d[e]||d.fallback}function x(e){let t=c.find(t=>t.value===e);return t?.label||"Fallback"}let u=[{value:"all",label:"All"},{value:"fallback",label:"Fallback"},{value:"round-robin",label:"Round Robin"},{value:"fusion",label:"Fusion"},{value:"swarm",label:"Swarm"}],p=[{value:"name",label:"Name"},{value:"models-desc",label:"Most Models"},{value:"models-asc",label:"Fewest Models"}];function h({combos:e,comboStrategies:t,activeProviders:s,onViewCombos:a,onCreate:r}){let i=e.length,n=function(e){let t=new Set;for(let s of e)for(let e of s.models||[])t.add(e);return t.size}(e),c=function(e,t){let s={fallback:0,"round-robin":0,fusion:0,swarm:0},l=new Set(["fallback","round-robin","fusion","swarm"]);for(let a of e){let e=t[a.name]?.fallbackStrategy||"fallback",r=l.has(e)?e:"fallback";s[r]=(s[r]||0)+1}return s}(e,t),d=Object.values(c).filter(e=>e>0).length,u=i>0?Math.round(e.reduce((e,t)=>e+(t.models?.length||0),0)/i*10)/10:0,p=Math.max(...Object.values(c),1);return(0,l.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,l.jsx)("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:[{label:"Total Combos",value:i,icon:"layers",color:"#3B82F6"},{label:"Unique Models",value:n,icon:"model_training",color:"#10B981"},{label:"Strategies Used",value:d,icon:"account_tree",color:"#8B5CF6"},{label:"Avg Models/Combo",value:u,icon:"analytics",color:"#F59E0B"}].map(e=>(0,l.jsx)(o.Zp,{padding:"sm",children:(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${e.color}15`},children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",style:{color:e.color},children:e.icon})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-mono text-lg font-bold text-text-main",children:e.value}),(0,l.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:e.label})]})]})},e.label))}),(0,l.jsxs)(o.Zp,{children:[(0,l.jsxs)("div",{className:"mb-3",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Strategy Distribution"}),(0,l.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:"How combos are distributed across routing strategies"})]}),(0,l.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(c).map(([e,t])=>{let s=m(e),a=i>0?Math.round(t/i*100):0;return(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsxs)("div",{className:"flex w-28 items-center gap-1.5",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:{color:s.color},children:s.icon}),(0,l.jsx)("span",{className:"text-xs font-medium text-text-main",children:x(e)})]}),(0,l.jsx)("div",{className:"flex-1 overflow-hidden rounded-full bg-surface-2",children:(0,l.jsx)("div",{className:"h-2.5 rounded-full transition-all",style:{width:`${t/p*100}%`,backgroundColor:s.color}})}),(0,l.jsxs)("span",{className:"w-16 text-right font-mono text-xs text-text-muted",children:[t," (",a,"%)"]})]},e)})})]}),(0,l.jsxs)(o.Zp,{children:[(0,l.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Combo Health"}),(0,l.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:"Overview of each combo's status"})]}),(0,l.jsx)(o.$n,{size:"sm",variant:"ghost",icon:"list_alt",onClick:a,children:"View All"})]}),0===e.length?(0,l.jsxs)("div",{className:"py-6 text-center text-sm text-text-muted",children:["No combos yet. ",(0,l.jsx)("button",{onClick:r,className:"text-primary hover:underline",children:"Create one →"})]}):(0,l.jsx)("div",{className:"flex flex-col gap-2",children:e.map(e=>{let a=t[e.name]?.fallbackStrategy||"fallback",r=m(a),i=(e.models||[]).filter(e=>{let t=e.split("/")[0];return s.some(e=>e.provider===t&&!1!==e.isActive)}).length,n=(e.models||[]).length,c=n>0?Math.round(i/n*100):0;return(0,l.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border-subtle px-3 py-2 hover:bg-sidebar/30",children:[(0,l.jsx)("div",{className:"flex size-7 shrink-0 items-center justify-center rounded",style:{backgroundColor:`${r.color}15`},children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[15px]",style:{color:r.color},children:r.icon})}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("code",{className:"truncate font-mono text-xs font-medium",children:e.name}),(0,l.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,l.jsx)(o.Ex,{variant:r.badge,size:"sm",children:x(a)}),(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:[n," models"]})]})]}),(0,l.jsxs)("div",{className:"hidden sm:flex items-center gap-2 shrink-0",children:[(0,l.jsx)("div",{className:"w-20 overflow-hidden rounded-full bg-surface-2",children:(0,l.jsx)("div",{className:`h-1.5 rounded-full ${c>=80?"bg-success":c>=50?"bg-warning":"bg-danger"}`,style:{width:`${c}%`}})}),(0,l.jsxs)("span",{className:"w-8 text-right font-mono text-[10px] text-text-muted",children:[i,"/",n]})]})]},e.id)})})]})]})}var b=s(88105);function f(e){let t=b.Q2[e]?.capabilities;return!t||!1!==t.toolUse&&!1!==t.fileAccess}function g(e){if(!e||"string"!=typeof e)return null;let t=e.indexOf("/");return t>=0?e.slice(0,t):e}function j(e,t){if(e){let t=g(e);return{blocked:!!t&&!f(t),provider:t}}let s=g(t&&t.length>0?t[0]:null);return{blocked:!!s&&!f(s),provider:s}}function v(e){return e.filter(e=>f(e.provider))}function y({combo:e,modelCaps:t={},activeProviders:s=[],copied:r,onCopy:i,onEdit:n,onDelete:d,strategy:u={},onSetStrategy:p}){let[h,b]=(0,a.useState)(!1),[f,g]=(0,a.useState)(!1),[N,w]=(0,a.useState)(null),k=Array.isArray(e?.models)?e.models:[],C=u.fallbackStrategy||"fallback",S=u.judgeModel||"",M="fusion"===C,$="swarm"===C,A=u.managerModel||"",E=u.staffModel||"",F=u.auditModel||"",O=m(C);return(0,l.jsxs)(o.Zp,{padding:"sm",className:"group transition-all hover:border-primary/20",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsxs)("button",{className:"flex min-w-0 flex-1 items-start gap-3 text-left sm:items-center",onClick:()=>b(!h),children:[(0,l.jsx)("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${O.color}15`},children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",style:{color:O.color},children:O.icon})}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("code",{className:"truncate font-mono text-sm font-medium",children:e.name}),(0,l.jsx)(o.Ex,{variant:O.badge,size:"sm",children:x(C)}),(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:[k.length," models"]})]}),(0,l.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1",children:[0===k.length?(0,l.jsx)("span",{className:"text-xs text-text-muted italic",children:"No models"}):k.slice(0,3).map((e,s)=>(0,l.jsxs)("code",{className:"inline-flex items-center gap-1 rounded bg-black/5 px-1.5 py-0.5 font-mono text-xs text-text-muted dark:bg-white/5",children:[(0,l.jsx)("span",{className:"truncate max-w-[120px]",children:e}),t[e]&&(0,l.jsx)(o.nh,{caps:t[e],size:11})]},s)),k.length>3&&(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",k.length-3," more"]})]})]}),(0,l.jsx)("span",{className:`shrink-0 text-text-muted transition-transform ${h?"rotate-180":""}`,children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"expand_more"})})]}),(0,l.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3 sm:shrink-0",children:[(0,l.jsx)("div",{className:"w-full sm:w-[180px]",children:(0,l.jsx)(o.l6,{options:c,value:C,onChange:e=>p({fallbackStrategy:e.target.value}),selectClassName:"py-1.5 text-xs"})}),(0,l.jsxs)("div",{className:"grid grid-cols-3 gap-1 sm:flex",children:[(0,l.jsxs)("button",{onClick:t=>{t.stopPropagation(),i(e.name,`combo-${e.id}`)},className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Copy combo name",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:r===`combo-${e.id}`?"check":"content_copy"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Copy"})]}),(0,l.jsxs)("button",{onClick:n,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Edit",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,l.jsxs)("button",{onClick:d,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 transition-colors hover:bg-red-500/10",title:"Delete",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]})]})]}),h&&(0,l.jsxs)("div",{className:"mt-3 border-t border-border-subtle pt-3",children:[(0,l.jsxs)("div",{className:"mb-3",children:[(0,l.jsxs)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted mb-1.5",children:["Models (",k.length,")"]}),(0,l.jsx)("div",{className:"flex flex-col gap-1",children:k.map((e,s)=>(0,l.jsxs)("div",{className:"flex items-center gap-2 rounded px-2 py-1 bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,l.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-4 text-center",children:s+1}),(0,l.jsx)("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-text-main",children:e}),t[e]&&(0,l.jsx)(o.nh,{caps:t[e],size:11})]},s))})]}),M&&(0,l.jsxs)("div",{className:"mb-3",children:[(0,l.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted mb-1.5",children:"Fusion Judge"}),(()=>{let{blocked:e,provider:t}=j(S,k);return(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)("button",{onClick:()=>g(!0),className:`inline-flex max-w-full items-center gap-1 rounded border border-dashed px-2 py-1 font-mono text-xs hover:bg-primary/5 ${e?"border-red-400 text-red-500 hover:border-red-500":"border-primary/40 text-primary hover:border-primary"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"gavel"}),(0,l.jsx)("span",{className:"truncate",children:S||`Auto — ${k[0]||"first model"}`})]}),S&&(0,l.jsx)("button",{onClick:()=>p({judgeModel:""}),className:"p-1 rounded text-text-muted hover:text-red-500 hover:bg-red-500/10",title:"Reset to Auto",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),e&&(0,l.jsx)("p",{className:"text-[10px] text-red-500",children:S?"⚠ Web cookie providers cannot serve as Judge (no tool use / file access)":`⚠ Auto-fallback to "${t}" (first combo model) — web cookie cannot serve as Judge`})]})})()]}),$&&(0,l.jsxs)("div",{className:"mb-3",children:[(0,l.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted mb-1.5",children:"Swarm Roles"}),(0,l.jsxs)("div",{className:"flex flex-col gap-1.5",children:[[{key:"manager",label:"Manager",icon:"psychology",value:A,placeholder:`Auto — ${k[0]||"first"}`},{key:"staff",label:"Staff",icon:"badge",value:E,placeholder:"Same as Manager"},{key:"audit",label:"Audit",icon:"fact_check",value:F,placeholder:"Same as Staff"}].map(e=>{let{blocked:t,provider:s}=j(e.value,k);return(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-medium text-text-muted w-16",children:e.label}),(0,l.jsxs)("button",{onClick:()=>w(e.key),className:`inline-flex max-w-full items-center gap-1 rounded border border-dashed px-2 py-0.5 font-mono text-[11px] hover:bg-primary/5 ${t?"border-red-400 text-red-500 hover:border-red-500":"border-primary/40 text-primary hover:border-primary"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:e.icon}),(0,l.jsx)("span",{className:"truncate",children:e.value||e.placeholder})]}),e.value&&(0,l.jsx)("button",{onClick:()=>p({[`${e.key}Model`]:""}),className:"p-0.5 rounded text-text-muted hover:text-red-500 hover:bg-red-500/10",title:`Reset ${e.label}`,children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"close"})})]}),t&&(0,l.jsx)("p",{className:"text-[10px] text-red-500 pl-[76px]",children:e.value?`⚠ Web cookie providers cannot serve as ${e.label} (no tool use / file access)`:`⚠ Auto-fallback to "${s}" (first combo model) — web cookie cannot serve as ${e.label}`})]},e.key)}),(0,l.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-text-muted",children:[(0,l.jsx)("span",{className:"font-medium",children:"Workers"}),(0,l.jsxs)("span",{children:["= combo models (",k.length,")"]}),(0,l.jsx)("span",{className:"text-text-subtle",children:"\xb7"}),(0,l.jsx)("a",{href:"/dashboard/swarm",className:"text-primary hover:underline",children:"Telemetry →"})]})]})]}),(0,l.jsxs)("div",{className:"text-xs text-text-muted bg-black/[0.02] dark:bg-white/[0.02] rounded px-2 py-1.5",children:[(0,l.jsxs)("span",{className:"font-medium",children:[x(C),":"]})," ",c.find(e=>e.value===C)?.desc]})]}),(0,l.jsx)(o.rq,{isOpen:f,onClose:()=>g(!1),onSelect:e=>{p({judgeModel:e?.value||""}),g(!1)},activeProviders:v(s),title:"Select Judge Model",addedModelValues:S?[S]:[],closeOnSelect:!0}),N&&(0,l.jsx)(o.rq,{isOpen:!0,onClose:()=>w(null),onSelect:e=>{p({[`${N}Model`]:e?.value||""}),w(null)},activeProviders:v(s),title:`Select ${"manager"===N?"Manager":"staff"===N?"Staff":"Audit"} Model`,addedModelValues:"manager"===N?A?[A]:[]:"staff"===N?E?[E]:[]:F?[F]:[],closeOnSelect:!0})]})}function N({combos:e,modelCaps:t,activeProviders:s,comboStrategies:r,copied:i,copy:n,onEdit:c,onDelete:d,onSetStrategy:m,onCreate:x}){let[h,b]=(0,a.useState)(""),[f,g]=(0,a.useState)("all"),[j,v]=(0,a.useState)("name"),w=(0,a.useMemo)(()=>{var t;let s;return t=function(e,t,s,l){let a=e;if("all"!==s&&(a=a.filter(e=>(l[e.name]?.fallbackStrategy||"fallback")===s)),t.trim()){let e=t.trim().toLowerCase();a=a.filter(t=>t.name.toLowerCase().includes(e)||(t.models||[]).some(t=>t.toLowerCase().includes(e)))}return a}(e,h,f,r),s=[...t],"models-desc"===j?s.sort((e,t)=>(t.models?.length||0)-(e.models?.length||0)):"models-asc"===j?s.sort((e,t)=>(e.models?.length||0)-(t.models?.length||0)):s.sort((e,t)=>e.name.localeCompare(t.name)),s},[e,h,f,j,r]);return 0===e.length?(0,l.jsx)(o.pp,{icon:"layers",title:"No combos yet",description:"Create model combos with fallback, round-robin, fusion, or swarm strategies",actionText:"Create Combo",onAction:x}):(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsx)(o.pd,{placeholder:"Search combos or models...",value:h,onChange:e=>b(e.target.value),className:"sm:max-w-xs"}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"flex flex-wrap gap-1",children:u.map(e=>(0,l.jsx)("button",{onClick:()=>g(e.value),className:`rounded-full px-2.5 py-1 text-xs font-medium transition-colors ${f===e.value?"bg-primary/15 text-primary ring-1 ring-primary/20":"bg-surface-2 text-text-muted hover:text-text-main"}`,children:e.label},e.value))}),(0,l.jsx)("select",{value:j,onChange:e=>v(e.target.value),className:"appearance-none rounded-lg border border-border bg-surface-2 py-1.5 pl-3 pr-8 text-xs text-text-main [-webkit-appearance:none] [-moz-appearance:none] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30",children:p.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))})]})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:w.length===e.length?`${e.length} combo${1!==e.length?"s":""}`:`${w.length} of ${e.length} combos`}),0===w.length?(0,l.jsx)(o.Zp,{children:(0,l.jsxs)("div",{className:"py-8 text-center text-sm text-text-muted",children:['No combos match "',h,'" ',"all"!==f&&`with ${f} strategy`]})}):(0,l.jsx)("div",{className:"flex flex-col gap-3",children:w.map(e=>(0,l.jsx)(y,{combo:e,modelCaps:t,activeProviders:s,copied:i,onCopy:n,onEdit:()=>c(e),onDelete:()=>d(e.id),strategy:r[e.name]||{},onSetStrategy:t=>m(e.name,t)},e.id))})]})}let w=[{id:"always-on",name:"Always-On (5-Layer Fallback)",description:"Zero-downtime coding with 5 layers of fallback. Mix of subscription, cheap, and free tiers — if any model fails, the next picks up automatically.",icon:"shield",category:"reliability",strategy:"fallback",models:["cc/claude-opus-4-7","cx/gpt-5.4","glm/glm-5.1","minimax/MiniMax-M2.7","kr/claude-sonnet-4.5"],requiredProviders:["claude","codex","glm","minimax","kiro"]}];function k({combos:e,connections:t,onApply:s}){let[r,i]=(0,a.useState)(null),n=new Set(t?.filter(e=>!1!==e.isActive).map(e=>e.provider)||[]),c=new Set((e||[]).map(e=>e.name)),d=async e=>{i(e.id);try{let t=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,models:e.models,kind:null})});if(!t.ok){let e=await t.json();alert(e.error||"Failed to create combo from template");return}let l=await fetch("/api/settings").then(e=>e.json()).catch(()=>({})),a={...l?.comboStrategies||{},[e.name]:{fallbackStrategy:e.strategy}};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:a})}),s&&s()}catch(e){alert("Failed to apply template: "+(e?.message||String(e)))}finally{i(null)}};return 0===w.length?(0,l.jsx)(o.pp,{icon:"dashboard_customize",title:"No templates available",description:"Combo templates will appear here when added."}):(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"mb-1",children:[(0,l.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"Combo Templates"}),(0,l.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:"One-click prebuilt combos. Provider availability is checked automatically."})]}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:w.map(e=>{let t=(e.requiredProviders||[]).filter(e=>n.has(e)).length,s=(e.requiredProviders||[]).length,a=c.has(e.name),i=m(e.strategy);return(0,l.jsxs)(o.Zp,{padding:"sm",className:"flex flex-col gap-3 hover:border-primary/20 transition-all",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,l.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${i.color}15`},children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",style:{color:i.color},children:e.icon||i.icon})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-sm font-semibold text-text-main",children:e.name}),(0,l.jsx)(o.Ex,{variant:i.badge,size:"sm",children:x(e.strategy)})]})]}),a&&(0,l.jsx)(o.Ex,{variant:"success",size:"sm",dot:!0,children:"Created"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted leading-relaxed",children:e.description}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(e.models||[]).slice(0,4).map((e,t)=>(0,l.jsx)("code",{className:"inline-flex items-center rounded bg-black/5 px-1.5 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5",children:e},t)),(e.models||[]).length>4&&(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",(e.models||[]).length-4," more"]})]}),(0,l.jsx)("div",{className:"flex flex-wrap gap-1",children:(e.requiredProviders||[]).map(e=>{let t=n.has(e);return(0,l.jsxs)("span",{className:`inline-flex items-center gap-0.5 rounded-full px-1.5 py-0.5 text-[10px] font-medium ${t?"bg-success/10 text-success":"bg-surface-2 text-text-muted"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[10px]",children:t?"check_circle":"radio_button_unchecked"}),e]},e)})}),(0,l.jsx)("div",{className:"mt-auto pt-1",children:(0,l.jsx)(o.$n,{size:"sm",fullWidth:!0,variant:a?"secondary":"primary",icon:r===e.id?"progress_activity":"add",disabled:a||r===e.id,onClick:()=>d(e),children:r===e.id?"Creating...":a?"Already Created":t===s?"Apply Template":`Apply (${t}/${s} ready)`})})]},e.id)})})]})}var C=s(44923),S=s(87256),M=s(5020),$=s(39768);function A({id:e,index:t,model:s,isFirst:r,isLast:i,modelCaps:n,onEdit:c,onMoveUp:d,onMoveDown:m,onRemove:x}){let{attributes:u,listeners:p,setNodeRef:h,transform:b,isDragging:f}=(0,S.gl)({id:e}),g={transform:$.Ks.Transform.toString(b),opacity:f?.5:1,zIndex:f?999:void 0},[j,v]=(0,a.useState)(!1),[y,N]=(0,a.useState)(s),w=()=>{let e=y.trim();e&&e!==s?c(e):N(s),v(!1)};return(0,l.jsxs)("div",{ref:h,style:g,className:`group flex min-w-0 items-center gap-2 rounded-lg border px-2.5 py-1.5 transition-all ${f?"border-primary/40 bg-panel shadow-md ring-1 ring-primary/20":"border-transparent bg-panel hover:border-border-subtle"}`,children:[(0,l.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center rounded bg-primary/10 text-[10px] font-bold text-primary",children:t+1}),(0,l.jsx)("button",{...u,...p,type:"button",className:"cursor-grab touch-none shrink-0 p-0.5 rounded text-text-muted/50 hover:text-text-main active:cursor-grabbing",title:"Drag to reorder",children:(0,l.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,l.jsx)("circle",{cx:"9",cy:"4",r:"1.5"}),(0,l.jsx)("circle",{cx:"15",cy:"4",r:"1.5"}),(0,l.jsx)("circle",{cx:"9",cy:"12",r:"1.5"}),(0,l.jsx)("circle",{cx:"15",cy:"12",r:"1.5"}),(0,l.jsx)("circle",{cx:"9",cy:"20",r:"1.5"}),(0,l.jsx)("circle",{cx:"15",cy:"20",r:"1.5"})]})}),j?(0,l.jsx)("input",{autoFocus:!0,value:y,onChange:e=>N(e.target.value),onBlur:w,onKeyDown:e=>{"Enter"===e.key&&w(),"Escape"===e.key&&(N(s),v(!1))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-panel px-1.5 py-0.5 font-mono text-xs text-text-main outline-none"}):(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 cursor-text rounded px-1 py-0.5 hover:bg-black/[0.03] dark:hover:bg-white/[0.03]",onClick:()=>v(!0),title:"Click to edit",children:[(0,l.jsx)("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-text-main",children:s}),n?.[s]&&(0,l.jsx)(o.nh,{caps:n[s],size:11})]}),(0,l.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,l.jsx)("button",{onClick:d,disabled:r,className:`rounded p-1 transition-colors ${r?"cursor-not-allowed text-text-muted/20":"text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5"}`,title:"Move up",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"arrow_upward"})}),(0,l.jsx)("button",{onClick:m,disabled:i,className:`rounded p-1 transition-colors ${i?"cursor-not-allowed text-text-muted/20":"text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5"}`,title:"Move down",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"arrow_downward"})})]}),(0,l.jsx)("button",{onClick:x,className:"shrink-0 rounded p-1 text-text-muted opacity-0 transition-all hover:bg-danger/10 hover:text-danger group-hover:opacity-100",title:"Remove model",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}function E({isOpen:e,combo:t,onClose:s,onSave:r,activeProviders:i,modelCaps:d={},kindFilter:m=null}){let[x,u]=(0,a.useState)(t?.name||""),[p,h]=(0,a.useState)(t?.models||[]),[b,f]=(0,a.useState)(!1),[g,j]=(0,a.useState)(!1),[v,y]=(0,a.useState)(""),[N,w]=(0,a.useState)({}),[k,$]=(0,a.useState)(e);(0,a.useEffect)(()=>{e&&!k&&(u(t?.name||""),h(Array.isArray(t?.models)?[...t.models]:[]),y(""),f(!1)),$(e)},[e,k,t]);let F=(0,C.FR)((0,C.MS)(C.AN,{activationConstraint:{distance:5}}),(0,C.MS)(C.uN,{coordinateGetter:S.JR})),O=p.map((e,t)=>({uid:`item-${t}`,model:e}));(0,a.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let e=await fetch("/api/models/alias");if(!t&&e.ok){let t=await e.json();w(t.aliases||{})}}catch{}})(),()=>{t=!0}},[e]);let z=e=>e.trim()?n.test(e)?(y(""),!0):(y("Only letters, numbers, -, _ and . allowed"),!1):(y("Name is required"),!1),_=async()=>{z(x)&&(j(!0),await r({name:x.trim(),models:p}),j(!1))},P=!!t;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.aF,{isOpen:e,onClose:s,title:P?"Edit Combo":"Create Combo",size:"lg",children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(o.pd,{label:"Combo Name",value:x,onChange:e=>{let t=e.target.value;u(t),t?z(t):y("")},placeholder:"my-combo",error:v}),(0,l.jsxs)("div",{className:"mt-1.5 flex items-center gap-2",children:[(0,l.jsx)("p",{className:"text-[10px] text-text-muted",children:"Use this name as the model in your client:"}),x.trim()&&(0,l.jsx)("code",{className:"rounded bg-primary/10 px-1.5 py-0.5 font-mono text-[10px] text-primary",children:x.trim()})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-text-main",children:"Models"}),p.length>0&&(0,l.jsxs)(o.Ex,{variant:"info",size:"sm",children:[p.length," model",1!==p.length?"s":""]})]}),(0,l.jsx)("span",{className:"text-[10px] text-text-muted",children:"Drag to reorder priority"})]}),0===p.length?(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 border border-dashed border-border rounded-lg bg-surface-2/50",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-2xl mb-2",children:"layers"}),(0,l.jsx)("p",{className:"text-xs text-text-muted mb-3",children:"Add models to build your combo"}),(0,l.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>f(!0),children:"Add First Model"})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(C.Mp,{sensors:F,collisionDetection:C.fp,onDragEnd:e=>{let{active:t,over:s}=e;if(s&&t.id!==s.id){let e=O.findIndex(e=>e.uid===t.id),l=O.findIndex(e=>e.uid===s.id);-1!==e&&-1!==l&&h(t=>(0,S.be)(t,e,l))}},modifiers:[M.FN,M.gj],children:(0,l.jsx)(S.gB,{items:O.map(e=>e.uid),strategy:S._G,children:(0,l.jsx)("div",{className:"flex max-h-[45vh] min-w-0 flex-col gap-1 overflow-y-auto rounded-lg bg-surface-2/30 p-1.5",children:O.map(({uid:e,model:t},s)=>(0,l.jsx)(A,{id:e,index:s,model:t,modelCaps:d,isFirst:0===s,isLast:s===O.length-1,onEdit:e=>{let t=[...p];t[s]=e,h(t)},onMoveUp:()=>(e=>{if(0===e)return;let t=[...p];[t[e-1],t[e]]=[t[e],t[e-1]],h(t)})(s),onMoveDown:()=>(e=>{if(e===p.length-1)return;let t=[...p];[t[e],t[e+1]]=[t[e+1],t[e]],h(t)})(s),onRemove:()=>{h(e=>e.filter((e,t)=>t!==s))}},e))})})}),(0,l.jsxs)("button",{onClick:()=>f(!0),className:"w-full mt-2 py-2 border border-dashed border-primary/30 rounded-lg text-xs text-primary font-medium hover:border-primary hover:bg-primary/5 transition-colors flex items-center justify-center gap-1.5",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]})]}),p.length>=2&&(0,l.jsxs)("div",{className:"rounded-lg border border-border-subtle bg-surface-2/50 px-3 py-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"lightbulb"}),(0,l.jsx)("span",{className:"text-xs font-medium text-text-main",children:"Strategy Tips"})]}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-2",children:c.map(e=>(0,l.jsxs)("div",{className:"flex items-start gap-1.5 text-[11px] text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px] mt-0.5 text-primary/60",children:e.icon}),(0,l.jsxs)("span",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:e.label})," — ",e.desc]})]},e.value))}),(0,l.jsx)("p",{className:"mt-1.5 text-[10px] text-text-muted",children:"Set strategy after creating the combo from the Combos tab."})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-2 pt-1 sm:flex-row",children:[(0,l.jsx)(o.$n,{onClick:s,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,l.jsx)(o.$n,{onClick:_,fullWidth:!0,size:"sm",icon:P?"save":"add",disabled:!x.trim()||!!v||g,children:g?"Saving...":P?"Save Changes":"Create Combo"})]})]})}),(0,l.jsx)(o.rq,{isOpen:b,onClose:()=>f(!1),onSelect:e=>{h(t=>t.includes(e.value)?t:[...t,e.value])},onDeselect:e=>{h(t=>t.filter(t=>t!==e.value))},activeProviders:i,modelAliases:N,title:"Add Model to Combo",kindFilter:m,addedModelValues:p,closeOnSelect:!1})]})}let F=[{value:"overview",label:"Overview"},{value:"combos",label:"Combos"},{value:"templates",label:"Templates"}];function O(){let e=(0,r.useRouter)(),t=(0,r.useSearchParams)().get("tab")||"overview",[s,n]=(0,a.useState)([]),[c,d]=(0,a.useState)(!0),[m,x]=(0,a.useState)(!1),[u,p]=(0,a.useState)(null),[b,f]=(0,a.useState)([]),[g,j]=(0,a.useState)({}),[v,y]=(0,a.useState)({}),[w,C]=(0,a.useState)(null),{copied:S,copy:M}=(0,i.C)(),$=(0,a.useCallback)(async()=>{try{let[e,t,s,l]=await Promise.all([fetch("/api/combos"),fetch("/api/providers"),fetch("/api/settings"),fetch("/api/models")]),a=await e.json(),r=await t.json(),o=s.ok?await s.json():{};if(e.ok&&n((a.combos||[]).filter(e=>!e.kind||"llm"===e.kind)),t.ok&&f(r.connections||[]),l.ok){let e=await l.json(),t={};for(let s of e.models||[])s.caps&&(t[s.fullModel]=s.caps);y(t)}j(o.comboStrategies||{})}catch(e){console.log("Error fetching data:",e)}finally{d(!1)}},[]);(0,a.useEffect)(()=>{$()},[$]);let A=t=>e.push(`/dashboard/combos?tab=${t}`),O=async e=>{try{let t=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)await $(),x(!1);else{let e=await t.json();alert(e.error||"Failed to create combo")}}catch(e){console.log("Error creating combo:",e)}},z=async(e,t)=>{try{let s=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(s.ok)await $(),p(null);else{let e=await s.json();alert(e.error||"Failed to update combo")}}catch(e){console.log("Error updating combo:",e)}},_=async(e,t)=>{try{let s={...g[e]||{},...t},l=s.fallbackStrategy,a=new Set(["fallbackStrategy",...{fusion:["judgeModel","fusionTuning"],swarm:["managerModel","staffModel","auditModel","workerCount","swarmTuning","enableTelemetry"],fallback:[],"round-robin":[]}[l]||[]]),r={};for(let[e,t]of Object.entries(s))a.has(e)&&(r[e]=t);let o=!r.fallbackStrategy||"fallback"===r.fallbackStrategy;await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:{[e]:o?null:r}})}),j(t=>{let s={...t};return o?delete s[e]:s[e]=r,s})}catch(e){console.log("Error updating combo strategy:",e)}};return c?(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)(o.Qv,{}),(0,l.jsx)(o.Qv,{})]}):(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-5",children:[(0,l.jsx)(o.zY,{title:"Combos",description:"Group models under one name, then pick a strategy per combo",icon:"layers",actions:(0,l.jsx)(o.$n,{size:"sm",icon:"add",onClick:()=>x(!0),className:"whitespace-nowrap",children:"Create Combo"})}),(0,l.jsx)(o.Iz,{options:F,value:t,onChange:A}),"overview"===t&&(0,l.jsx)(h,{combos:s,comboStrategies:g,activeProviders:b,onViewCombos:()=>A("combos"),onCreate:()=>x(!0)}),"combos"===t&&(0,l.jsx)(N,{combos:s,modelCaps:v,activeProviders:b,comboStrategies:g,copied:S,copy:M,onEdit:p,onDelete:e=>{C({title:"Delete Combo",message:"Delete this combo?",onConfirm:async()=>{C(null);try{let t=await fetch(`/api/combos/${e}`,{method:"DELETE"});if(t.ok)n(t=>t.filter(t=>t.id!==e));else{let e=await t.json().catch(()=>({}));alert(e.error||`Failed to delete combo (${t.status})`)}}catch(e){console.log("Error deleting combo:",e),alert("Failed to delete combo — network error")}}})},onSetStrategy:_,onCreate:()=>x(!0)}),"templates"===t&&(0,l.jsx)(k,{combos:s,connections:b,onApply:$}),(0,l.jsx)(E,{isOpen:m,onClose:()=>x(!1),onSave:O,activeProviders:b,modelCaps:v},"create"),(0,l.jsx)(E,{isOpen:!!u,combo:u,onClose:()=>p(null),onSave:e=>z(u.id,e),activeProviders:b,modelCaps:v},u?.id||"new"),(0,l.jsx)(o.uo,{isOpen:!!w,onClose:()=>C(null),onConfirm:w?.onConfirm,title:w?.title||"Confirm",message:w?.message,variant:"danger"})]})}function z(){return(0,l.jsx)(a.Suspense,{fallback:(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)("div",{className:"h-32 animate-pulse rounded-lg bg-sidebar"}),(0,l.jsx)("div",{className:"h-32 animate-pulse rounded-lg bg-sidebar"})]}),children:(0,l.jsx)(O,{})})}}},e=>{e.O(0,[27,7055,8105,1321,705,5497,8441,3794,7358],()=>e(e.s=49293)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[712],{44493:(e,s,t)=>{"use strict";t.d(s,{default:()=>o});var l=t(95155),n=t(12115),r=t(35497),a=t(90620);let c={LOG:"text-green-400",INFO:"text-blue-400",WARN:"text-yellow-400",ERROR:"text-red-400",DEBUG:"text-purple-400"};function o(){let[e,s]=(0,n.useState)([]),[t,o]=(0,n.useState)(!1),i=(0,n.useRef)(null),d=async()=>{try{await fetch("/api/translator/console-logs",{method:"DELETE"})}catch(e){console.error("Failed to clear console logs:",e)}};return(0,n.useEffect)(()=>{let e=new EventSource("/api/translator/console-logs/stream");return e.onopen=()=>o(!0),e.onmessage=e=>{let t=JSON.parse(e.data);"init"===t.type?s(t.logs.slice(-a.UY.maxLines)):"line"===t.type?s(e=>{let s=[...e,t.line];return s.length>a.UY.maxLines?s.slice(-a.UY.maxLines):s}):"lines"===t.type?s(e=>{let s=[...e,...t.lines];return s.length>a.UY.maxLines?s.slice(-a.UY.maxLines):s}):"clear"===t.type&&s([])},e.onerror=()=>o(!1),()=>e.close()},[]),(0,n.useEffect)(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e]),(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)(r.zY,{title:"Console",description:"Live server logs",icon:"monitor",actions:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)("span",{className:`flex items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium ${t?"bg-success/12 text-success":"bg-danger/12 text-danger"}`,children:[(0,l.jsx)("span",{className:`size-1.5 rounded-full ${t?"bg-success":"bg-danger"}`}),t?"Live":"Disconnected"]}),(0,l.jsx)(r.$n,{size:"sm",variant:"outline",icon:"delete",onClick:d,children:"Clear"})]})}),(0,l.jsx)(r.Zp,{padding:"none",children:(0,l.jsx)("div",{ref:i,className:"bg-black rounded-b-lg p-4 text-xs font-mono h-[calc(100vh-220px)] overflow-y-auto",children:0===e.length?(0,l.jsx)("span",{className:"text-text-muted",children:"No console logs yet."}):(0,l.jsx)("div",{className:"space-y-0.5",children:e.map((e,s)=>{let t,n;return(0,l.jsx)("div",{children:(n=c[(t=e.match(/\[(\w+)\]/g))?t[1]?.replace(/\[|\]/g,""):null]||"text-green-400",(0,l.jsx)("span",{className:n,children:e}))},s)})})})})]})}},47926:(e,s,t)=>{Promise.resolve().then(t.bind(t,44493))}},e=>{e.O(0,[27,1321,705,5497,8441,3794,7358],()=>e(e.s=47926)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[712],{44493:(e,s,t)=>{"use strict";t.d(s,{default:()=>o});var l=t(95155),n=t(12115),r=t(35497),a=t(90620);let c={LOG:"text-green-400",INFO:"text-blue-400",WARN:"text-yellow-400",ERROR:"text-red-400",DEBUG:"text-purple-400"};function o(){let[e,s]=(0,n.useState)([]),[t,o]=(0,n.useState)(!1),i=(0,n.useRef)(null),d=async()=>{try{await fetch("/api/translator/console-logs",{method:"DELETE"})}catch(e){console.error("Failed to clear console logs:",e)}};return(0,n.useEffect)(()=>{let e=new EventSource("/api/translator/console-logs/stream");return e.onopen=()=>o(!0),e.onmessage=e=>{let t=JSON.parse(e.data);"init"===t.type?s(t.logs.slice(-a.UY.maxLines)):"line"===t.type?s(e=>{let s=[...e,t.line];return s.length>a.UY.maxLines?s.slice(-a.UY.maxLines):s}):"lines"===t.type?s(e=>{let s=[...e,...t.lines];return s.length>a.UY.maxLines?s.slice(-a.UY.maxLines):s}):"clear"===t.type&&s([])},e.onerror=()=>o(!1),()=>e.close()},[]),(0,n.useEffect)(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e]),(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)(r.zY,{title:"Console",description:"Live server logs",icon:"monitor",actions:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)("span",{className:`flex items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium ${t?"bg-success/12 text-success":"bg-danger/12 text-danger"}`,children:[(0,l.jsx)("span",{className:`size-1.5 rounded-full ${t?"bg-success":"bg-danger"}`}),t?"Live":"Disconnected"]}),(0,l.jsx)(r.$n,{size:"sm",variant:"outline",icon:"delete",onClick:d,children:"Clear"})]})}),(0,l.jsx)(r.Zp,{padding:"none",children:(0,l.jsx)("div",{ref:i,className:"bg-black rounded-b-lg p-4 text-xs font-mono h-[calc(100vh-220px)] overflow-y-auto",children:0===e.length?(0,l.jsx)("span",{className:"text-text-muted",children:"No console logs yet."}):(0,l.jsx)("div",{className:"space-y-0.5",children:e.map((e,s)=>{let t,n;return(0,l.jsx)("div",{children:(n=c[(t=e.match(/\[(\w+)\]/g))?t[1]?.replace(/\[|\]/g,""):null]||"text-green-400",(0,l.jsx)("span",{className:n,children:e}))},s)})})})})]})}},47926:(e,s,t)=>{Promise.resolve().then(t.bind(t,44493))}},e=>{e.O(0,[27,8105,1321,705,5497,8441,3794,7358],()=>e(e.s=47926)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6099],{},_=>{_.O(0,[27,8105,1321,705,5497,1696,8441,3794,7358],()=>_(_.s=81696)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8192],{31474:(e,t,s)=>{"use strict";function r(...e){return e.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}s.d(t,{cn:()=>r})},37466:(e,t,s)=>{"use strict";s.d(t,{default:()=>o});var r=s(95155),n=s(12115),a=s(56061),i=s(99312),l=s(31474),c=s(88105);function d(e){return null==e?"—":e<1e3?`${e}ms`:`${(e/1e3).toFixed(2)}s`}function o(){let[e,t]=(0,n.useState)([]),[s,o]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let e=new EventSource("/api/health/stream");return e.onopen=()=>o(!0),e.onerror=()=>o(!1),e.onmessage=e=>{try{let s=JSON.parse(e.data);"snapshot"===s.type&&Array.isArray(s.providers)?t(s.providers):s.provider&&t(e=>{let t=e.findIndex(e=>e.provider===s.provider);if(t>=0){let r=[...e];return r[t]=s,r}return[...e,s]})}catch{}},()=>e.close()},[]),(0,r.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,r.jsx)("span",{className:(0,l.cn)("size-2 rounded-full",s?"bg-success animate-pulse":"bg-danger")}),s?"Live":"Reconnecting…"]}),e.length>0&&(0,r.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"size-2 rounded-full bg-success"})," Healthy"]}),(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"size-2 rounded-full bg-warning"})," Degraded"]}),(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"size-2 rounded-full bg-danger"})," Unhealthy"]})]})]}),0===e.length?(0,r.jsx)(i.default,{icon:"monitor_heart",title:"No health data yet",description:"Provider health metrics will appear here once requests flow through the gateway. Send a request to any provider to start collecting samples."}):(0,r.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:e.map(e=>{var t;let s,n=function(e,t){if(0===t)return{label:"Unknown",variant:"default",color:"text-text-subtle",bar:"bg-text-subtle"};let s=e??0;return s>=.95?{label:"Healthy",variant:"success",color:"text-success",bar:"bg-success"}:s>=.8?{label:"Degraded",variant:"warning",color:"text-warning",bar:"bg-warning"}:{label:"Unhealthy",variant:"error",color:"text-danger",bar:"bg-danger"}}(e.successRate,e.total),i=null!=e.successRate?Math.round(100*e.successRate):null;return(0,r.jsxs)("div",{className:"rounded-panel border border-border-subtle bg-panel p-4 shadow-[var(--shadow-soft)]",children:[(0,r.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,r.jsx)("h3",{className:"truncate font-mono text-sm font-semibold text-text-main",children:(t=e.provider,s=c.Q2[t],s?.name?s.name:t.replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase()))}),(0,r.jsx)(a.default,{variant:n.variant,dot:!0,size:"sm",children:n.label})]}),null!=i&&(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsxs)("div",{className:"mb-1 flex items-center justify-between text-xs text-text-muted",children:[(0,r.jsx)("span",{children:"Success rate"}),(0,r.jsxs)("span",{className:(0,l.cn)("font-mono font-semibold",n.color),children:[i,"%"]})]}),(0,r.jsx)("div",{className:"h-1.5 overflow-hidden rounded-full bg-surface-2",children:(0,r.jsx)("div",{className:(0,l.cn)("h-full rounded-full transition-all",n.bar),style:{width:`${i}%`}})})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[(0,r.jsxs)("div",{className:"rounded-md bg-surface-2 p-2",children:[(0,r.jsx)("div",{className:"text-text-subtle",children:"Requests"}),(0,r.jsx)("div",{className:"font-mono font-semibold text-text-main",children:e.total})]}),(0,r.jsxs)("div",{className:"rounded-md bg-surface-2 p-2",children:[(0,r.jsx)("div",{className:"text-text-subtle",children:"Failures"}),(0,r.jsx)("div",{className:(0,l.cn)("font-mono font-semibold",e.failures>0?"text-danger":"text-text-main"),children:e.failures})]}),(0,r.jsxs)("div",{className:"rounded-md bg-surface-2 p-2",children:[(0,r.jsx)("div",{className:"text-text-subtle",children:"Avg latency"}),(0,r.jsx)("div",{className:"font-mono font-semibold text-text-main",children:d(e.avgLatencyMs)})]}),(0,r.jsxs)("div",{className:"rounded-md bg-surface-2 p-2",children:[(0,r.jsx)("div",{className:"text-text-subtle",children:"p95 latency"}),(0,r.jsx)("div",{className:"font-mono font-semibold text-text-main",children:d(e.p95LatencyMs)})]})]}),e.lastError&&(0,r.jsxs)("div",{className:"mt-3 flex items-center gap-1.5 text-xs text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[13px] text-danger",children:"error"}),"Last error: ",(0,r.jsx)("span",{className:"font-mono",children:e.lastError})," \xb7 ",function(e){if(!e)return"—";let t=Date.now()-e;return t<5e3?"just now":t<6e4?`${Math.floor(t/1e3)}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:new Date(e).toLocaleTimeString()}(e.lastErrorAt)]})]},e.provider)})})]})}},54642:e=>{var t;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="//"),(t={}).endianness=function(){return"LE"},t.hostname=function(){return"u">typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"u">typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"},e.exports=t},54960:(e,t,s)=>{"use strict";s.d(t,{default:()=>a});var r=s(95155),n=s(31474);function a({title:e,description:t,icon:s,iconNode:i,actions:l,breadcrumbs:c,className:d}){return(0,r.jsxs)("div",{className:(0,n.cn)("mb-6",d),children:[c?.length>0&&(0,r.jsx)("nav",{className:"mb-2 flex items-center gap-1.5 text-xs text-text-muted",children:c.map((e,t)=>(0,r.jsxs)("span",{className:"flex items-center gap-1.5",children:[t>0&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px] opacity-60",children:"chevron_right"}),e.href?(0,r.jsx)("a",{href:e.href,className:"transition-colors hover:text-primary",children:e.label}):(0,r.jsx)("span",{className:"font-medium text-text-main",children:e.label})]},t))}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[i?(0,r.jsx)("div",{className:"mt-0.5 shrink-0",children:i}):s&&(0,r.jsx)("div",{className:"mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-brand bg-primary/10 text-primary ring-1 ring-primary/15",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:s})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h1",{className:"truncate text-xl font-semibold tracking-tight text-text-main",children:e}),t&&(0,r.jsx)("p",{className:"mt-0.5 text-sm text-text-muted",children:t})]})]}),l&&(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:l})]})]})}},56061:(e,t,s)=>{"use strict";s.d(t,{default:()=>c});var r=s(95155),n=s(31474);let a={default:"bg-surface-2 text-text-muted ring-1 ring-border-subtle",primary:"bg-primary/12 text-primary ring-1 ring-primary/20",success:"bg-success/12 text-success ring-1 ring-success/20",warning:"bg-warning/12 text-warning ring-1 ring-warning/20",error:"bg-danger/12 text-danger ring-1 ring-danger/20",info:"bg-info/12 text-info ring-1 ring-info/20",cyan:"bg-cyan/12 text-cyan ring-1 ring-cyan/20"},i={default:"bg-text-subtle",primary:"bg-primary",success:"bg-success",warning:"bg-warning",error:"bg-danger",info:"bg-info",cyan:"bg-cyan"},l={sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-xs",lg:"px-3 py-1.5 text-sm"};function c({children:e,variant:t="default",size:s="md",dot:d=!1,icon:o,className:m}){return(0,r.jsxs)("span",{className:(0,n.cn)("inline-flex items-center gap-1.5 rounded-full font-semibold leading-none",a[t],l[s],m),children:[d&&(0,r.jsx)("span",{className:(0,n.cn)("size-1.5 rounded-full",i[t])}),o&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:o}),e]})}},67579:(e,t,s)=>{Promise.resolve().then(s.bind(s,37466)),Promise.resolve().then(s.bind(s,54960))},92542:(e,t,s)=>{"use strict";s.d(t,{default:()=>l});var r=s(95155),n=s(31474);let a={primary:"bg-primary hover:bg-primary-hover text-white shadow-[0_0_0_1px_rgba(255,255,255,0.08)_inset,0_10px_30px_-18px_rgba(139,92,246,0.75)] disabled:bg-surface-3 disabled:text-text-muted",secondary:"bg-surface-2 hover:bg-surface-3 text-text-main border border-border disabled:opacity-50",outline:"border border-border text-text-main hover:bg-surface-2 hover:border-primary/45",ghost:"text-text-muted hover:bg-surface-2 hover:text-text-main",danger:"bg-danger hover:brightness-110 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",success:"bg-success hover:brightness-110 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted"},i={sm:"h-7 px-3 text-xs rounded-brand",md:"h-9 px-4 text-sm rounded-brand",lg:"h-10 px-5 text-sm rounded-brand"};function l({children:e,variant:t="primary",size:s="md",icon:c,iconRight:d,disabled:o=!1,loading:m=!1,fullWidth:x=!1,className:u,...f}){return(0,r.jsxs)("button",{className:(0,n.cn)("inline-flex items-center justify-center gap-2 font-semibold transition-all duration-150 ease-out cursor-pointer","active:scale-[0.98] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg",a[t],i[s],x&&"w-full",u),disabled:o||m,...f,children:[m?(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin text-[16px]",children:"progress_activity"}):c?(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:c}):null,e,d&&!m&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:d})]})}},99312:(e,t,s)=>{"use strict";s.d(t,{default:()=>i});var r=s(95155),n=s(31474),a=s(92542);function i({icon:e="inbox",title:t="No items found",description:s="There's nothing here yet.",action:l,actionText:c,onAction:d,className:o}){return(0,r.jsxs)("div",{className:(0,n.cn)("flex flex-col items-center justify-center rounded-panel border border-dashed border-border p-12 text-center",o),children:[(0,r.jsx)("div",{className:"mb-4 flex size-12 items-center justify-center rounded-full bg-surface-2 text-text-muted ring-1 ring-border-subtle",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[24px]",children:e})}),(0,r.jsx)("h3",{className:"mb-1.5 text-sm font-semibold text-text-main",children:t}),(0,r.jsx)("p",{className:"mb-6 max-w-sm text-xs text-text-muted",children:s}),l||c&&d&&(0,r.jsx)(a.default,{variant:"outline",size:"sm",onClick:d,children:c})]})}}},e=>{e.O(0,[8105,8441,3794,7358],()=>e(e.s=67579)),_N_E=e.O()}]);
@@ -56,4 +56,4 @@
56
56
  -F "temperature=${C}"`:""}${p.includes("prompt")&&v?` \\
57
57
  -F "prompt=${v}"`:""}`,Z=async()=>{if(!x||!Y)return;D(!0),q(""),K(null);let e=Date.now();try{let t=new FormData;t.append("file",x),t.append("model",Y),p.includes("language")&&b&&t.append("language",b),p.includes("response_format")&&t.append("response_format",N),p.includes("temperature")&&C&&t.append("temperature",C),p.includes("prompt")&&v&&t.append("prompt",v);let s={};$&&(s.Authorization=`Bearer ${$}`);let a=await fetch("/api/v1/audio/transcriptions",{method:"POST",headers:s,body:t});B(Date.now()-e);let r=(a.headers.get("content-type")||"").includes("application/json")?await a.json():await a.text();if(!a.ok)return void q(r?.error?.message||r?.error||r||`HTTP ${a.status}`);K(r)}catch(e){q(e.message||"Network error")}finally{D(!1)}},Q="string"==typeof M?M:M?JSON.stringify(M,null,2):`{
58
58
  "text": "Hello world..."
59
- }`;return(0,a.jsxs)(l.Zp,{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,a.jsxs)("div",{className:"flex flex-col gap-2.5",children:[d.length>0?(0,a.jsx)(w,{label:"Model",children:(0,a.jsx)("select",{value:c,onChange:e=>m(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:d.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}):(0,a.jsx)(w,{label:"Model",children:(0,a.jsx)("input",{value:c,onChange:e=>m(e.target.value),placeholder:"Enter model id",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),(0,a.jsx)(w,{label:"Endpoint",children:(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[W,"/v1/audio/transcriptions"]}),E&&(0,a.jsxs)("button",{onClick:()=>A(e=>!e),title:_?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${_?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,a.jsx)(w,{label:"API Key",children:(0,a.jsx)("span",{className:"px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate block",children:$?`${$.slice(0,8)}${"•".repeat(Math.min(20,$.length-8))}`:(0,a.jsx)("span",{className:"text-text-muted italic",children:"No key configured"})})}),(0,a.jsx)(w,{label:"Audio File",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("input",{type:"file",accept:"audio/*,video/mp4,.m4a,.mp3,.wav,.ogg,.flac,.webm,.opus",onChange:e=>h(e.target.files?.[0]||null),className:"w-full text-xs text-text-muted file:mr-2 file:py-1 file:px-2.5 file:rounded-lg file:border file:border-border file:bg-background file:text-text-main hover:file:bg-sidebar file:cursor-pointer"}),x&&(0,a.jsxs)("span",{className:"text-xs text-text-muted font-mono",children:[x.name," \xb7 ",(x.size/1024).toFixed(1)," KB"]})]})}),p.includes("language")&&(0,a.jsx)(w,{label:"Language",children:(0,a.jsx)("input",{value:b,onChange:e=>y(e.target.value),placeholder:"e.g. en, vi, ja (auto-detect if empty)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),p.includes("prompt")&&(0,a.jsx)(w,{label:"Prompt",children:(0,a.jsx)("input",{value:v,onChange:e=>j(e.target.value),placeholder:"optional context to improve accuracy",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),p.includes("temperature")&&(0,a.jsx)(w,{label:"Temperature",children:(0,a.jsx)("input",{type:"number",step:"0.1",min:"0",max:"1",value:C,onChange:e=>S(e.target.value),placeholder:"0 - 1 (default 0)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),p.includes("response_format")&&(0,a.jsx)(w,{label:"Response Format",children:(0,a.jsxs)("select",{value:N,onChange:e=>k(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,a.jsx)("option",{value:"json",children:"json"}),(0,a.jsx)("option",{value:"text",children:"text"}),(0,a.jsx)("option",{value:"srt",children:"srt"}),(0,a.jsx)("option",{value:"verbose_json",children:"verbose_json"}),(0,a.jsx)("option",{value:"vtt",children:"vtt"})]})}),(0,a.jsxs)("div",{className:"mt-1",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsxs)("button",{onClick:()=>z(G),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:J?"check":"content_copy"}),J?"Copied":"Copy"]}),(0,a.jsxs)("button",{onClick:Z,disabled:U||!x||!Y,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:U?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),U?"Transcribing...":"Run"]})]})]}),(0,a.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:G})]}),F&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:F}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,a.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",M&&L&&(0,a.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",L,"ms"]})]}),M&&(0,a.jsxs)("button",{onClick:()=>H(Q),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:V?"check":"content_copy"}),V?"Copied":"Copy"]})]}),(0,a.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:Q})]})]})]})}function O(){let{kind:e,id:t}=(0,r.useParams)(),s=(0,r.useRouter)(),c=i.rj.find(t=>t.id===e),m=(0,i.gC)(t)&&"embedding"===e,u=async()=>{if(confirm("Delete this Custom Embedding node?"))try{(await fetch(`/api/provider-nodes/${t}`,{method:"DELETE"})).ok&&s.push(`/dashboard/media-providers/${e}`)}catch(e){console.log("Error deleting custom embedding node:",e)}},[p,x]=(0,o.useState)(null),[h,f]=(0,o.useState)(m),[g,y]=(0,o.useState)(!1);if((0,o.useEffect)(()=>{if(!m)return;let e=!1;return fetch("/api/provider-nodes",{cache:"no-store"}).then(e=>e.json()).then(s=>{e||(x((s.nodes||[]).find(e=>e.id===t)||null),f(!1))}).catch(()=>{e||f(!1)}),()=>{e=!0}},[t,m]),!c)return(0,r.notFound)();let v=i.Q2[t],w=m?p?{id:t,name:p.name||"Custom Embedding",color:"#6366F1",textIcon:"CE"}:null:v;if(!m&&!v||m&&!h&&!p)return(0,r.notFound)();if(m&&h)return(0,a.jsx)("div",{className:"text-text-muted text-sm py-12 text-center",children:"Loading..."});let k=m?["embedding"]:w.serviceKinds??["llm"];return m||k.includes(e)?(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(l.zY,{title:w.name,description:c.label,iconNode:(0,a.jsx)("div",{className:"flex size-12 items-center justify-center rounded-brand ring-1 ring-border-subtle",style:{backgroundColor:`${w.color}15`},children:(0,a.jsx)(n.A,{src:(0,d.k)(w.id),alt:w.name,size:36,className:"object-contain rounded max-w-[36px] max-h-[36px]",fallbackText:w.textIcon||w.id.slice(0,2).toUpperCase(),fallbackColor:w.color})}),breadcrumbs:[{label:"Media Providers",href:`/dashboard/media-providers/${e}`},{label:c.label,href:`/dashboard/media-providers/${e}`},{label:w.name}],actions:(0,a.jsxs)(a.Fragment,{children:[!m&&w.notice?.apiKeyUrl&&(0,a.jsxs)("a",{href:w.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),"Get API Key"]}),m&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>y(!0),children:"Edit"}),(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:u,children:"Delete"})]})]})}),(0,a.jsxs)("div",{className:"-mt-2 flex flex-wrap items-center gap-1.5",children:[m&&(0,a.jsxs)(l.Ex,{variant:"default",size:"sm",children:["Custom \xb7 ",p?.prefix]}),k.map(t=>(0,a.jsx)(l.Ex,{variant:t===e?"primary":"default",size:"sm",children:t.toUpperCase()},t))]}),!m&&w.kindNotice?.[e]&&(0,a.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-amber-500/10 border border-amber-500/30 text-amber-700 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px] mt-0.5",children:"warning"}),(0,a.jsx)("p",{className:"text-sm",children:w.kindNotice[e]})]}),!m&&w.notice?.text&&!w.deprecated&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:w.notice.text}),w.notice.apiKeyUrl&&(0,a.jsx)("a",{href:w.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),!m&&w.noAuth?(0,a.jsx)(l.gw,{providerId:t}):(0,a.jsx)(b,{providerId:t,isOAuth:!1}),"tts"!==e&&"webSearch"!==e&&"webFetch"!==e&&(0,a.jsx)(j,{providerId:t,kindFilter:e,providerAliasOverride:m?p?.prefix:void 0}),!m&&(w.searchConfig||w.fetchConfig||w.ttsConfig||w.sttConfig||w.embeddingConfig||w.searchViaChat)&&(0,a.jsx)(l.Wx,{config:"webFetch"===e?w.fetchConfig:"tts"===e?w.ttsConfig:"stt"===e?w.sttConfig:"embedding"===e?w.embeddingConfig:w.searchConfig||{mode:"chat-completions",defaultModel:w.searchViaChat?.defaultModel,pricingUrl:w.searchViaChat?.pricingUrl,freeTier:w.searchViaChat?.freeTier},provider:w,title:`${c.label} Config`}),"embedding"===e&&(0,a.jsx)(C,{providerId:t,customAlias:p?.prefix}),"tts"===e&&(0,a.jsx)(A,{providerId:t}),"stt"===e&&!m&&(0,a.jsx)(R,{providerId:t}),!m&&N[e]&&(0,a.jsx)(E,{providerId:t,kind:e}),m&&(0,a.jsx)(l.x0,{isOpen:g,node:p,onClose:()=>y(!1),onSaved:e=>{x(e),y(!1)}})]}):(0,r.notFound)()}},70217:(e,t,s)=>{"use strict";function a(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}s.d(t,{g:()=>a})},85460:(e,t,s)=>{Promise.resolve().then(s.bind(s,41095))}},e=>{e.O(0,[27,1321,705,5497,8441,3794,7358],()=>e(e.s=85460)),_N_E=e.O()}]);
59
+ }`;return(0,a.jsxs)(l.Zp,{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,a.jsxs)("div",{className:"flex flex-col gap-2.5",children:[d.length>0?(0,a.jsx)(w,{label:"Model",children:(0,a.jsx)("select",{value:c,onChange:e=>m(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:d.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}):(0,a.jsx)(w,{label:"Model",children:(0,a.jsx)("input",{value:c,onChange:e=>m(e.target.value),placeholder:"Enter model id",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),(0,a.jsx)(w,{label:"Endpoint",children:(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[W,"/v1/audio/transcriptions"]}),E&&(0,a.jsxs)("button",{onClick:()=>A(e=>!e),title:_?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${_?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,a.jsx)(w,{label:"API Key",children:(0,a.jsx)("span",{className:"px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate block",children:$?`${$.slice(0,8)}${"•".repeat(Math.min(20,$.length-8))}`:(0,a.jsx)("span",{className:"text-text-muted italic",children:"No key configured"})})}),(0,a.jsx)(w,{label:"Audio File",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("input",{type:"file",accept:"audio/*,video/mp4,.m4a,.mp3,.wav,.ogg,.flac,.webm,.opus",onChange:e=>h(e.target.files?.[0]||null),className:"w-full text-xs text-text-muted file:mr-2 file:py-1 file:px-2.5 file:rounded-lg file:border file:border-border file:bg-background file:text-text-main hover:file:bg-sidebar file:cursor-pointer"}),x&&(0,a.jsxs)("span",{className:"text-xs text-text-muted font-mono",children:[x.name," \xb7 ",(x.size/1024).toFixed(1)," KB"]})]})}),p.includes("language")&&(0,a.jsx)(w,{label:"Language",children:(0,a.jsx)("input",{value:b,onChange:e=>y(e.target.value),placeholder:"e.g. en, vi, ja (auto-detect if empty)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),p.includes("prompt")&&(0,a.jsx)(w,{label:"Prompt",children:(0,a.jsx)("input",{value:v,onChange:e=>j(e.target.value),placeholder:"optional context to improve accuracy",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),p.includes("temperature")&&(0,a.jsx)(w,{label:"Temperature",children:(0,a.jsx)("input",{type:"number",step:"0.1",min:"0",max:"1",value:C,onChange:e=>S(e.target.value),placeholder:"0 - 1 (default 0)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),p.includes("response_format")&&(0,a.jsx)(w,{label:"Response Format",children:(0,a.jsxs)("select",{value:N,onChange:e=>k(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,a.jsx)("option",{value:"json",children:"json"}),(0,a.jsx)("option",{value:"text",children:"text"}),(0,a.jsx)("option",{value:"srt",children:"srt"}),(0,a.jsx)("option",{value:"verbose_json",children:"verbose_json"}),(0,a.jsx)("option",{value:"vtt",children:"vtt"})]})}),(0,a.jsxs)("div",{className:"mt-1",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsxs)("button",{onClick:()=>z(G),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:J?"check":"content_copy"}),J?"Copied":"Copy"]}),(0,a.jsxs)("button",{onClick:Z,disabled:U||!x||!Y,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:U?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),U?"Transcribing...":"Run"]})]})]}),(0,a.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:G})]}),F&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:F}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,a.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",M&&L&&(0,a.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",L,"ms"]})]}),M&&(0,a.jsxs)("button",{onClick:()=>H(Q),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:V?"check":"content_copy"}),V?"Copied":"Copy"]})]}),(0,a.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:Q})]})]})]})}function O(){let{kind:e,id:t}=(0,r.useParams)(),s=(0,r.useRouter)(),c=i.rj.find(t=>t.id===e),m=(0,i.gC)(t)&&"embedding"===e,u=async()=>{if(confirm("Delete this Custom Embedding node?"))try{(await fetch(`/api/provider-nodes/${t}`,{method:"DELETE"})).ok&&s.push(`/dashboard/media-providers/${e}`)}catch(e){console.log("Error deleting custom embedding node:",e)}},[p,x]=(0,o.useState)(null),[h,f]=(0,o.useState)(m),[g,y]=(0,o.useState)(!1);if((0,o.useEffect)(()=>{if(!m)return;let e=!1;return fetch("/api/provider-nodes",{cache:"no-store"}).then(e=>e.json()).then(s=>{e||(x((s.nodes||[]).find(e=>e.id===t)||null),f(!1))}).catch(()=>{e||f(!1)}),()=>{e=!0}},[t,m]),!c)return(0,r.notFound)();let v=i.Q2[t],w=m?p?{id:t,name:p.name||"Custom Embedding",color:"#6366F1",textIcon:"CE"}:null:v;if(!m&&!v||m&&!h&&!p)return(0,r.notFound)();if(m&&h)return(0,a.jsx)("div",{className:"text-text-muted text-sm py-12 text-center",children:"Loading..."});let k=m?["embedding"]:w.serviceKinds??["llm"];return m||k.includes(e)?(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(l.zY,{title:w.name,description:c.label,iconNode:(0,a.jsx)("div",{className:"flex size-12 items-center justify-center rounded-brand ring-1 ring-border-subtle",style:{backgroundColor:`${w.color}15`},children:(0,a.jsx)(n.A,{src:(0,d.k)(w.id),alt:w.name,size:36,className:"object-contain rounded max-w-[36px] max-h-[36px]",fallbackText:w.textIcon||w.id.slice(0,2).toUpperCase(),fallbackColor:w.color})}),breadcrumbs:[{label:"Media Providers",href:`/dashboard/media-providers/${e}`},{label:c.label,href:`/dashboard/media-providers/${e}`},{label:w.name}],actions:(0,a.jsxs)(a.Fragment,{children:[!m&&w.notice?.apiKeyUrl&&(0,a.jsxs)("a",{href:w.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),"Get API Key"]}),m&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>y(!0),children:"Edit"}),(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:u,children:"Delete"})]})]})}),(0,a.jsxs)("div",{className:"-mt-2 flex flex-wrap items-center gap-1.5",children:[m&&(0,a.jsxs)(l.Ex,{variant:"default",size:"sm",children:["Custom \xb7 ",p?.prefix]}),k.map(t=>(0,a.jsx)(l.Ex,{variant:t===e?"primary":"default",size:"sm",children:t.toUpperCase()},t))]}),!m&&w.kindNotice?.[e]&&(0,a.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-amber-500/10 border border-amber-500/30 text-amber-700 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px] mt-0.5",children:"warning"}),(0,a.jsx)("p",{className:"text-sm",children:w.kindNotice[e]})]}),!m&&w.notice?.text&&!w.deprecated&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:w.notice.text}),w.notice.apiKeyUrl&&(0,a.jsx)("a",{href:w.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),!m&&w.noAuth?(0,a.jsx)(l.gw,{providerId:t}):(0,a.jsx)(b,{providerId:t,isOAuth:!1}),"tts"!==e&&"webSearch"!==e&&"webFetch"!==e&&(0,a.jsx)(j,{providerId:t,kindFilter:e,providerAliasOverride:m?p?.prefix:void 0}),!m&&(w.searchConfig||w.fetchConfig||w.ttsConfig||w.sttConfig||w.embeddingConfig||w.searchViaChat)&&(0,a.jsx)(l.Wx,{config:"webFetch"===e?w.fetchConfig:"tts"===e?w.ttsConfig:"stt"===e?w.sttConfig:"embedding"===e?w.embeddingConfig:w.searchConfig||{mode:"chat-completions",defaultModel:w.searchViaChat?.defaultModel,pricingUrl:w.searchViaChat?.pricingUrl,freeTier:w.searchViaChat?.freeTier},provider:w,title:`${c.label} Config`}),"embedding"===e&&(0,a.jsx)(C,{providerId:t,customAlias:p?.prefix}),"tts"===e&&(0,a.jsx)(A,{providerId:t}),"stt"===e&&!m&&(0,a.jsx)(R,{providerId:t}),!m&&N[e]&&(0,a.jsx)(E,{providerId:t,kind:e}),m&&(0,a.jsx)(l.x0,{isOpen:g,node:p,onClose:()=>y(!1),onSaved:e=>{x(e),y(!1)}})]}):(0,r.notFound)()}},70217:(e,t,s)=>{"use strict";function a(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}s.d(t,{g:()=>a})},85460:(e,t,s)=>{Promise.resolve().then(s.bind(s,41095))}},e=>{e.O(0,[27,8105,1321,705,5497,8441,3794,7358],()=>e(e.s=85460)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6620],{16144:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>b});var i=t(95155),a=t(73321),r=t(98500),n=t.n(r),o=t(12115),l=t(35497),c=t(57250),d=t(88105),m=t(8247);let x=new Set([]),h={image:"image-combo",tts:"tts-combo"};function p(e){let s=Object.entries(e).some(([e,s])=>e.startsWith("modelLock_")&&s&&new Date(s).getTime()>Date.now());return"unavailable"!==e.testStatus||s?e.testStatus:"active"}function u({provider:e,kind:s,connections:t,isCustom:a,onToggle:r}){let o=d.Q2[e.id],x=!!o?.noAuth,h=t.filter(s=>s.provider===e.id),f=h.filter(e=>{let s=p(e);return"active"===s||"success"===s}).length,b=h.filter(e=>{let s=p(e);return"error"===s||"expired"===s||"unavailable"===s}).length,g=h.length,j=g>0&&h.every(e=>!1===e.isActive);return(0,i.jsx)(n(),{href:`/dashboard/media-providers/${s}/${e.id}`,className:"group",children:(0,i.jsx)(l.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${j?"opacity-50":""}`,children:(0,i.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,i.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${e.color?.length>7?e.color:(e.color??"#888")+"15"}`},children:(0,i.jsx)(c.A,{src:(0,m.k)(e.id),alt:e.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:e.textIcon||e.id.slice(0,2).toUpperCase(),fallbackColor:e.color})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h3",{className:"font-semibold text-sm",children:e.name}),(0,i.jsxs)("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:[a&&(0,i.jsx)(l.Ex,{variant:"default",size:"sm",children:"Custom"}),x?(0,i.jsx)(l.Ex,{variant:"success",size:"sm",children:"Ready"}):j?(0,i.jsx)(l.Ex,{variant:"default",size:"sm",children:"Disabled"}):0===g?(0,i.jsx)("span",{className:"text-xs text-text-muted",children:"No connections"}):(0,i.jsxs)(i.Fragment,{children:[f>0&&(0,i.jsxs)(l.Ex,{variant:"success",size:"sm",dot:!0,children:[f," Connected"]}),b>0&&(0,i.jsxs)(l.Ex,{variant:"error",size:"sm",dot:!0,children:[b," Error"]}),0===f&&0===b&&(0,i.jsxs)(l.Ex,{variant:"default",size:"sm",children:[g," Added"]})]})]})]})]}),g>0&&(0,i.jsx)("div",{className:"shrink-0 opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:s=>{s.preventDefault(),s.stopPropagation(),r&&r(e.id,j)},children:(0,i.jsx)(l.lM,{size:"sm",checked:!j,onChange:()=>{},title:j?"Enable provider":"Disable provider"})})]})})})}function f({combos:e}){return 0===e.length?null:(0,i.jsx)("div",{className:"flex flex-col gap-2",children:e.map(e=>(0,i.jsx)(n(),{href:`/dashboard/media-providers/combo/${e.id}`,children:(0,i.jsx)(l.Zp,{padding:"xs",className:"hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors cursor-pointer",children:(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"}),(0,i.jsx)("code",{className:"text-sm font-mono font-medium flex-1 truncate",children:e.name}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-1 sm:shrink-0",children:[e.models.slice(0,6).map((e,s)=>{let t="string"==typeof e?e.split("/")[0]:"",a=d.Q2[t];return(0,i.jsx)("div",{title:a?.name||e,className:"size-5 rounded flex items-center justify-center",style:{backgroundColor:`${a?.color??"#888"}15`},children:(0,i.jsx)(c.A,{src:(0,m.k)(t),alt:a?.name||t,size:18,className:"object-contain rounded max-w-[18px] max-h-[18px]",fallbackText:a?.textIcon||t.slice(0,2).toUpperCase(),fallbackColor:a?.color})},`${e}-${s}`)}),e.models.length>6&&(0,i.jsxs)("span",{className:"text-[10px] text-text-muted ml-1",children:["+",e.models.length-6]})]}),(0,i.jsx)("span",{className:"text-[11px] text-text-muted shrink-0",children:e.models.length}),(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[16px]",children:"chevron_right"})]})})},e.id))})}function b(){let{kind:e}=(0,a.useParams)(),s=(0,a.useRouter)(),[t,r]=(0,o.useState)([]),[n,c]=(0,o.useState)([]),[m,p]=(0,o.useState)([]),[b,g]=(0,o.useState)(!1);(0,o.useEffect)(()=>{("webSearch"===e||"webFetch"===e)&&s.replace("/dashboard/media-providers/web")},[e,s]);let j=d.rj.find(s=>s.id===e),v="embedding"===e,N=x.has(e);if((0,o.useEffect)(()=>{j&&(fetch("/api/providers",{cache:"no-store"}).then(e=>e.json()).then(e=>r(e.connections||[])).catch(()=>{}),v&&fetch("/api/provider-nodes",{cache:"no-store"}).then(e=>e.json()).then(e=>c((e.nodes||[]).filter(e=>"custom-embedding"===e.type))).catch(()=>{}),N&&fetch("/api/combos",{cache:"no-store"}).then(e=>e.json()).then(e=>p(e.combos||[])).catch(()=>{}))},[v,N,j]),!j)return(0,a.notFound)();let k=(0,d.o5)(e),y=m.filter(s=>s.kind===e),w=n.map(e=>({id:e.id,name:e.name||"Custom Embedding",color:"#6366F1",textIcon:"CE"})),C=[...k,...w],E=async(e,s)=>{let i=t.filter(s=>s.provider===e);r(t=>t.map(t=>t.provider===e?{...t,isActive:s}:t)),await Promise.allSettled(i.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:s})})))},$=async()=>{let t=h[e]||`${e}-combo`,i=t,a=1,r=new Set(m.map(e=>e.name));for(;r.has(i);)i=`${t}-${a++}`;let n=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,models:[],kind:e})});if(n.ok){let e=await n.json();s.push(`/dashboard/media-providers/combo/${e.id}`)}else alert((await n.json()).error||"Failed to create combo")};return(0,i.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,i.jsx)(l.zY,{title:j?.label||e,description:`Manage your ${j?.label||e} providers`,icon:j?.icon||"perm_media",actions:(v||N)&&(0,i.jsxs)(i.Fragment,{children:[N&&(0,i.jsx)(l.$n,{size:"sm",icon:"add",onClick:$,children:"Create Combo"}),v&&(0,i.jsx)(l.$n,{size:"sm",icon:"add",onClick:()=>g(!0),children:"Add Custom Embedding"})]})}),N&&y.length>0&&(0,i.jsx)(f,{combos:y}),0===C.length?(0,i.jsxs)("div",{className:"text-center py-12 border border-dashed border-border rounded-xl text-text-muted text-sm",children:["No providers support ",(0,i.jsx)("strong",{children:j.label})," yet."]}):(0,i.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[k.map(s=>(0,i.jsx)(u,{provider:s,kind:e,connections:t,onToggle:E},s.id)),w.map(s=>(0,i.jsx)(u,{provider:s,kind:e,connections:t,isCustom:!0,onToggle:E},s.id))]}),v&&(0,i.jsx)(l.x0,{isOpen:b,onClose:()=>g(!1),onCreated:e=>{c(s=>[...s,e]),g(!1)}})]})}},42349:(e,s,t)=>{Promise.resolve().then(t.bind(t,16144))}},e=>{e.O(0,[27,1321,705,5497,8441,3794,7358],()=>e(e.s=42349)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6620],{16144:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>b});var i=t(95155),a=t(73321),r=t(98500),n=t.n(r),o=t(12115),l=t(35497),c=t(57250),d=t(88105),m=t(8247);let x=new Set([]),h={image:"image-combo",tts:"tts-combo"};function p(e){let s=Object.entries(e).some(([e,s])=>e.startsWith("modelLock_")&&s&&new Date(s).getTime()>Date.now());return"unavailable"!==e.testStatus||s?e.testStatus:"active"}function u({provider:e,kind:s,connections:t,isCustom:a,onToggle:r}){let o=d.Q2[e.id],x=!!o?.noAuth,h=t.filter(s=>s.provider===e.id),f=h.filter(e=>{let s=p(e);return"active"===s||"success"===s}).length,b=h.filter(e=>{let s=p(e);return"error"===s||"expired"===s||"unavailable"===s}).length,g=h.length,j=g>0&&h.every(e=>!1===e.isActive);return(0,i.jsx)(n(),{href:`/dashboard/media-providers/${s}/${e.id}`,className:"group",children:(0,i.jsx)(l.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${j?"opacity-50":""}`,children:(0,i.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,i.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${e.color?.length>7?e.color:(e.color??"#888")+"15"}`},children:(0,i.jsx)(c.A,{src:(0,m.k)(e.id),alt:e.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:e.textIcon||e.id.slice(0,2).toUpperCase(),fallbackColor:e.color})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h3",{className:"font-semibold text-sm",children:e.name}),(0,i.jsxs)("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:[a&&(0,i.jsx)(l.Ex,{variant:"default",size:"sm",children:"Custom"}),x?(0,i.jsx)(l.Ex,{variant:"success",size:"sm",children:"Ready"}):j?(0,i.jsx)(l.Ex,{variant:"default",size:"sm",children:"Disabled"}):0===g?(0,i.jsx)("span",{className:"text-xs text-text-muted",children:"No connections"}):(0,i.jsxs)(i.Fragment,{children:[f>0&&(0,i.jsxs)(l.Ex,{variant:"success",size:"sm",dot:!0,children:[f," Connected"]}),b>0&&(0,i.jsxs)(l.Ex,{variant:"error",size:"sm",dot:!0,children:[b," Error"]}),0===f&&0===b&&(0,i.jsxs)(l.Ex,{variant:"default",size:"sm",children:[g," Added"]})]})]})]})]}),g>0&&(0,i.jsx)("div",{className:"shrink-0 opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:s=>{s.preventDefault(),s.stopPropagation(),r&&r(e.id,j)},children:(0,i.jsx)(l.lM,{size:"sm",checked:!j,onChange:()=>{},title:j?"Enable provider":"Disable provider"})})]})})})}function f({combos:e}){return 0===e.length?null:(0,i.jsx)("div",{className:"flex flex-col gap-2",children:e.map(e=>(0,i.jsx)(n(),{href:`/dashboard/media-providers/combo/${e.id}`,children:(0,i.jsx)(l.Zp,{padding:"xs",className:"hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors cursor-pointer",children:(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"}),(0,i.jsx)("code",{className:"text-sm font-mono font-medium flex-1 truncate",children:e.name}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-1 sm:shrink-0",children:[e.models.slice(0,6).map((e,s)=>{let t="string"==typeof e?e.split("/")[0]:"",a=d.Q2[t];return(0,i.jsx)("div",{title:a?.name||e,className:"size-5 rounded flex items-center justify-center",style:{backgroundColor:`${a?.color??"#888"}15`},children:(0,i.jsx)(c.A,{src:(0,m.k)(t),alt:a?.name||t,size:18,className:"object-contain rounded max-w-[18px] max-h-[18px]",fallbackText:a?.textIcon||t.slice(0,2).toUpperCase(),fallbackColor:a?.color})},`${e}-${s}`)}),e.models.length>6&&(0,i.jsxs)("span",{className:"text-[10px] text-text-muted ml-1",children:["+",e.models.length-6]})]}),(0,i.jsx)("span",{className:"text-[11px] text-text-muted shrink-0",children:e.models.length}),(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[16px]",children:"chevron_right"})]})})},e.id))})}function b(){let{kind:e}=(0,a.useParams)(),s=(0,a.useRouter)(),[t,r]=(0,o.useState)([]),[n,c]=(0,o.useState)([]),[m,p]=(0,o.useState)([]),[b,g]=(0,o.useState)(!1);(0,o.useEffect)(()=>{("webSearch"===e||"webFetch"===e)&&s.replace("/dashboard/media-providers/web")},[e,s]);let j=d.rj.find(s=>s.id===e),v="embedding"===e,N=x.has(e);if((0,o.useEffect)(()=>{j&&(fetch("/api/providers",{cache:"no-store"}).then(e=>e.json()).then(e=>r(e.connections||[])).catch(()=>{}),v&&fetch("/api/provider-nodes",{cache:"no-store"}).then(e=>e.json()).then(e=>c((e.nodes||[]).filter(e=>"custom-embedding"===e.type))).catch(()=>{}),N&&fetch("/api/combos",{cache:"no-store"}).then(e=>e.json()).then(e=>p(e.combos||[])).catch(()=>{}))},[v,N,j]),!j)return(0,a.notFound)();let k=(0,d.o5)(e),y=m.filter(s=>s.kind===e),w=n.map(e=>({id:e.id,name:e.name||"Custom Embedding",color:"#6366F1",textIcon:"CE"})),C=[...k,...w],E=async(e,s)=>{let i=t.filter(s=>s.provider===e);r(t=>t.map(t=>t.provider===e?{...t,isActive:s}:t)),await Promise.allSettled(i.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:s})})))},$=async()=>{let t=h[e]||`${e}-combo`,i=t,a=1,r=new Set(m.map(e=>e.name));for(;r.has(i);)i=`${t}-${a++}`;let n=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,models:[],kind:e})});if(n.ok){let e=await n.json();s.push(`/dashboard/media-providers/combo/${e.id}`)}else alert((await n.json()).error||"Failed to create combo")};return(0,i.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,i.jsx)(l.zY,{title:j?.label||e,description:`Manage your ${j?.label||e} providers`,icon:j?.icon||"perm_media",actions:(v||N)&&(0,i.jsxs)(i.Fragment,{children:[N&&(0,i.jsx)(l.$n,{size:"sm",icon:"add",onClick:$,children:"Create Combo"}),v&&(0,i.jsx)(l.$n,{size:"sm",icon:"add",onClick:()=>g(!0),children:"Add Custom Embedding"})]})}),N&&y.length>0&&(0,i.jsx)(f,{combos:y}),0===C.length?(0,i.jsxs)("div",{className:"text-center py-12 border border-dashed border-border rounded-xl text-text-muted text-sm",children:["No providers support ",(0,i.jsx)("strong",{children:j.label})," yet."]}):(0,i.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[k.map(s=>(0,i.jsx)(u,{provider:s,kind:e,connections:t,onToggle:E},s.id)),w.map(s=>(0,i.jsx)(u,{provider:s,kind:e,connections:t,isCustom:!0,onToggle:E},s.id))]}),v&&(0,i.jsx)(l.x0,{isOpen:b,onClose:()=>g(!1),onCreated:e=>{c(s=>[...s,e]),g(!1)}})]})}},42349:(e,s,t)=>{Promise.resolve().then(t.bind(t,16144))}},e=>{e.O(0,[27,8105,1321,705,5497,8441,3794,7358],()=>e(e.s=42349)),_N_E=e.O()}]);