switchboard-router 0.5.20 → 0.5.21

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 (882) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +10 -10
  3. package/app/.next-cli-build/build-manifest.json +3 -3
  4. package/app/.next-cli-build/prerender-manifest.json +3 -3
  5. package/app/.next-cli-build/required-server-files.json +5 -5
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page.js +2 -2
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/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/combos/routing/page.js +2 -2
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/routing/page.js.nft.json +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/routing/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +3 -3
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/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/page.js +2 -2
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page.js.nft.json +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/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/profile/page.js +2 -2
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +3 -3
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/[id]/page.js +2 -2
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/[id]/page.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/[id]/page_client-reference-manifest.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +2 -2
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +2 -2
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  78. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  79. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  81. package/app/.next-cli-build/server/app/_global-error/page.js +3 -3
  82. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  84. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  85. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  86. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  87. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  88. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  89. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  90. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  91. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  92. package/app/.next-cli-build/server/app/_not-found/page.js +2 -2
  93. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  95. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  96. package/app/.next-cli-build/server/app/_not-found.rsc +5 -5
  97. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
  98. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  99. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +5 -5
  100. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  101. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  102. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +3 -3
  103. package/app/.next-cli-build/server/app/api/agent-library/catalog/route.js +1 -1
  104. package/app/.next-cli-build/server/app/api/agent-library/catalog/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/agent-library/catalog/route_client-reference-manifest.js +1 -1
  106. package/app/.next-cli-build/server/app/api/agent-library/doctor/route.js +1 -1
  107. package/app/.next-cli-build/server/app/api/agent-library/doctor/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/agent-library/doctor/route_client-reference-manifest.js +1 -1
  109. package/app/.next-cli-build/server/app/api/agent-library/export/route.js +1 -1
  110. package/app/.next-cli-build/server/app/api/agent-library/export/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/agent-library/export/route_client-reference-manifest.js +1 -1
  112. package/app/.next-cli-build/server/app/api/agent-library/mcp/route.js +1 -1
  113. package/app/.next-cli-build/server/app/api/agent-library/mcp/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/agent-library/mcp/route_client-reference-manifest.js +1 -1
  115. package/app/.next-cli-build/server/app/api/agent-library/route.js +1 -1
  116. package/app/.next-cli-build/server/app/api/agent-library/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/agent-library/route_client-reference-manifest.js +1 -1
  118. package/app/.next-cli-build/server/app/api/agent-library/skills/route.js +1 -1
  119. package/app/.next-cli-build/server/app/api/agent-library/skills/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/agent-library/skills/route_client-reference-manifest.js +1 -1
  121. package/app/.next-cli-build/server/app/api/agent-library/sync/route.js +1 -1
  122. package/app/.next-cli-build/server/app/api/agent-library/sync/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/agent-library/sync/route_client-reference-manifest.js +1 -1
  124. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  125. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/aider-settings/route.js +2 -2
  128. package/app/.next-cli-build/server/app/api/cli-tools/aider-settings/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/cli-tools/aider-settings/route_client-reference-manifest.js +1 -1
  130. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +7 -7
  131. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route_client-reference-manifest.js +1 -1
  133. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  134. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
  136. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
  139. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  140. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  143. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route_client-reference-manifest.js +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
  148. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  149. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route_client-reference-manifest.js +1 -1
  151. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  152. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route_client-reference-manifest.js +1 -1
  154. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  155. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route_client-reference-manifest.js +1 -1
  157. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +2 -2
  158. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route_client-reference-manifest.js +1 -1
  160. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  161. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route_client-reference-manifest.js +1 -1
  163. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
  164. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
  166. package/app/.next-cli-build/server/app/api/cli-tools/gemini-cli-settings/route.js +3 -3
  167. package/app/.next-cli-build/server/app/api/cli-tools/gemini-cli-settings/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/cli-tools/gemini-cli-settings/route_client-reference-manifest.js +1 -1
  169. package/app/.next-cli-build/server/app/api/cli-tools/grok-settings/route.js +2 -2
  170. package/app/.next-cli-build/server/app/api/cli-tools/grok-settings/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/cli-tools/grok-settings/route_client-reference-manifest.js +1 -1
  172. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +3 -3
  173. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route_client-reference-manifest.js +1 -1
  175. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  176. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route_client-reference-manifest.js +1 -1
  178. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  179. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route_client-reference-manifest.js +1 -1
  181. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  182. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
  184. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  185. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route_client-reference-manifest.js +1 -1
  187. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +2 -2
  188. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route_client-reference-manifest.js +1 -1
  190. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  191. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
  193. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  194. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/combos/route_client-reference-manifest.js +1 -1
  196. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  197. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route_client-reference-manifest.js +1 -1
  199. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  200. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/headroom/start/route_client-reference-manifest.js +1 -1
  202. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  203. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/headroom/status/route_client-reference-manifest.js +1 -1
  205. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
  206. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/headroom/stop/route_client-reference-manifest.js +1 -1
  208. package/app/.next-cli-build/server/app/api/health/route.js +1 -1
  209. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/health/route_client-reference-manifest.js +1 -1
  211. package/app/.next-cli-build/server/app/api/init/route.js +1 -1
  212. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/init/route_client-reference-manifest.js +1 -1
  214. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  215. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
  217. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  218. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/keys/route_client-reference-manifest.js +1 -1
  220. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  221. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/locale/route_client-reference-manifest.js +1 -1
  223. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +2 -2
  224. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route_client-reference-manifest.js +1 -1
  226. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +2 -2
  227. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route_client-reference-manifest.js +1 -1
  229. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  230. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route_client-reference-manifest.js +1 -1
  232. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  233. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route_client-reference-manifest.js +1 -1
  235. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  236. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route_client-reference-manifest.js +1 -1
  238. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route_client-reference-manifest.js +1 -1
  241. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  242. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route_client-reference-manifest.js +1 -1
  244. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  245. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
  247. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  248. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/models/availability/route_client-reference-manifest.js +1 -1
  250. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  251. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/models/custom/route_client-reference-manifest.js +1 -1
  253. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  254. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/models/disabled/route_client-reference-manifest.js +1 -1
  256. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/models/route_client-reference-manifest.js +1 -1
  259. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  260. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/api/models/test/route_client-reference-manifest.js +1 -1
  262. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  263. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
  265. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  266. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route_client-reference-manifest.js +1 -1
  268. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route_client-reference-manifest.js +1 -1
  271. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  272. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
  274. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  275. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
  277. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  278. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  279. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route_client-reference-manifest.js +1 -1
  280. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  281. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route_client-reference-manifest.js +1 -1
  283. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  284. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  285. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route_client-reference-manifest.js +1 -1
  286. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  287. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
  289. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  290. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  291. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
  292. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  293. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  294. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route_client-reference-manifest.js +1 -1
  295. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  296. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  297. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
  298. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  299. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  300. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
  301. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  302. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  303. package/app/.next-cli-build/server/app/api/pricing/route_client-reference-manifest.js +1 -1
  304. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  305. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  306. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
  307. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  308. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  309. package/app/.next-cli-build/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
  310. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  311. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  312. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
  313. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/batch/route.js +1 -1
  314. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/batch/route.js.nft.json +1 -1
  315. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/batch/route_client-reference-manifest.js +1 -1
  316. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/cache/route.js +1 -1
  317. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/cache/route.js.nft.json +1 -1
  318. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/cache/route_client-reference-manifest.js +1 -1
  319. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/prepare/route.js +1 -1
  320. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/prepare/route.js.nft.json +1 -1
  321. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/prepare/route_client-reference-manifest.js +1 -1
  322. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/remove-unavailable/route.js +1 -1
  323. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/remove-unavailable/route.js.nft.json +1 -1
  324. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/remove-unavailable/route_client-reference-manifest.js +1 -1
  325. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  326. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  327. package/app/.next-cli-build/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
  328. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  329. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  330. package/app/.next-cli-build/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
  331. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  332. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  333. package/app/.next-cli-build/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
  334. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  335. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  336. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route_client-reference-manifest.js +1 -1
  337. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  338. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  339. package/app/.next-cli-build/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
  340. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  341. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  342. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route_client-reference-manifest.js +1 -1
  343. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  344. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  345. package/app/.next-cli-build/server/app/api/providers/route_client-reference-manifest.js +1 -1
  346. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  347. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  348. package/app/.next-cli-build/server/app/api/providers/suggested-models/route_client-reference-manifest.js +1 -1
  349. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  350. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  351. package/app/.next-cli-build/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
  352. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  353. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  354. package/app/.next-cli-build/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
  355. package/app/.next-cli-build/server/app/api/routing/insights/route.js +1 -1
  356. package/app/.next-cli-build/server/app/api/routing/insights/route.js.nft.json +1 -1
  357. package/app/.next-cli-build/server/app/api/routing/insights/route_client-reference-manifest.js +1 -1
  358. package/app/.next-cli-build/server/app/api/routing/learn/route.js +1 -1
  359. package/app/.next-cli-build/server/app/api/routing/learn/route.js.nft.json +1 -1
  360. package/app/.next-cli-build/server/app/api/routing/learn/route_client-reference-manifest.js +1 -1
  361. package/app/.next-cli-build/server/app/api/routing/versions/promote/route.js +1 -1
  362. package/app/.next-cli-build/server/app/api/routing/versions/promote/route.js.nft.json +1 -1
  363. package/app/.next-cli-build/server/app/api/routing/versions/promote/route_client-reference-manifest.js +1 -1
  364. package/app/.next-cli-build/server/app/api/routing/versions/rollback/route.js +1 -1
  365. package/app/.next-cli-build/server/app/api/routing/versions/rollback/route.js.nft.json +1 -1
  366. package/app/.next-cli-build/server/app/api/routing/versions/rollback/route_client-reference-manifest.js +1 -1
  367. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  368. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  369. package/app/.next-cli-build/server/app/api/settings/database/route_client-reference-manifest.js +1 -1
  370. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  371. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  372. package/app/.next-cli-build/server/app/api/settings/proxy-test/route_client-reference-manifest.js +1 -1
  373. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  374. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  375. package/app/.next-cli-build/server/app/api/settings/route_client-reference-manifest.js +1 -1
  376. package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  377. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  378. package/app/.next-cli-build/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  379. package/app/.next-cli-build/server/app/api/skills/[id]/route.js +1 -1
  380. package/app/.next-cli-build/server/app/api/skills/[id]/route.js.nft.json +1 -1
  381. package/app/.next-cli-build/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  382. package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  383. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  384. package/app/.next-cli-build/server/app/api/tags/route_client-reference-manifest.js +1 -1
  385. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  386. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  387. package/app/.next-cli-build/server/app/api/translator/console-logs/route_client-reference-manifest.js +1 -1
  388. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  389. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  390. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route_client-reference-manifest.js +1 -1
  391. package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  392. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  393. package/app/.next-cli-build/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
  394. package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  395. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  396. package/app/.next-cli-build/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
  397. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  398. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  399. package/app/.next-cli-build/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
  400. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  401. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  402. package/app/.next-cli-build/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
  403. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  404. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  405. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route_client-reference-manifest.js +1 -1
  406. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  407. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  408. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
  409. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  410. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  411. package/app/.next-cli-build/server/app/api/usage/chart/route_client-reference-manifest.js +1 -1
  412. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  413. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  414. package/app/.next-cli-build/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
  415. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  416. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  417. package/app/.next-cli-build/server/app/api/usage/logs/route_client-reference-manifest.js +1 -1
  418. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  419. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  420. package/app/.next-cli-build/server/app/api/usage/providers/route_client-reference-manifest.js +1 -1
  421. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  422. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  423. package/app/.next-cli-build/server/app/api/usage/request-details/route_client-reference-manifest.js +1 -1
  424. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  425. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  426. package/app/.next-cli-build/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
  427. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  428. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  429. package/app/.next-cli-build/server/app/api/usage/stats/route_client-reference-manifest.js +1 -1
  430. package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
  431. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  432. package/app/.next-cli-build/server/app/api/usage/stream/route_client-reference-manifest.js +1 -1
  433. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  434. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  435. package/app/.next-cli-build/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
  436. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  437. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  438. package/app/.next-cli-build/server/app/api/v1/audio/speech/route_client-reference-manifest.js +1 -1
  439. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  440. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  441. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route_client-reference-manifest.js +1 -1
  442. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  443. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  444. package/app/.next-cli-build/server/app/api/v1/audio/voices/route_client-reference-manifest.js +1 -1
  445. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  446. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  447. package/app/.next-cli-build/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
  448. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  449. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  450. package/app/.next-cli-build/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
  451. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  452. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  453. package/app/.next-cli-build/server/app/api/v1/images/generations/route_client-reference-manifest.js +1 -1
  454. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  455. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  456. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
  457. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  458. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  459. package/app/.next-cli-build/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
  460. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  461. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  462. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route_client-reference-manifest.js +1 -1
  463. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  464. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  465. package/app/.next-cli-build/server/app/api/v1/models/info/route_client-reference-manifest.js +1 -1
  466. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  467. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  468. package/app/.next-cli-build/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
  469. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  470. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  471. package/app/.next-cli-build/server/app/api/v1/responses/compact/route_client-reference-manifest.js +1 -1
  472. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  473. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  474. package/app/.next-cli-build/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
  475. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  476. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  477. package/app/.next-cli-build/server/app/api/v1/route_client-reference-manifest.js +1 -1
  478. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  479. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  480. package/app/.next-cli-build/server/app/api/v1/search/route_client-reference-manifest.js +1 -1
  481. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  482. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  483. package/app/.next-cli-build/server/app/api/v1/web/fetch/route_client-reference-manifest.js +1 -1
  484. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  485. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  486. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
  487. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  488. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  489. package/app/.next-cli-build/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
  490. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  491. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  492. package/app/.next-cli-build/server/app/api/version/route_client-reference-manifest.js +1 -1
  493. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  494. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  495. package/app/.next-cli-build/server/app/api/version/shutdown/route_client-reference-manifest.js +1 -1
  496. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  497. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  498. package/app/.next-cli-build/server/app/api/version/update/route_client-reference-manifest.js +1 -1
  499. package/app/.next-cli-build/server/app/callback/page.js +2 -2
  500. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  501. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  502. package/app/.next-cli-build/server/app/callback.html +1 -1
  503. package/app/.next-cli-build/server/app/callback.rsc +6 -6
  504. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +6 -6
  505. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  506. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +5 -5
  507. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +3 -3
  508. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +2 -2
  509. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  510. package/app/.next-cli-build/server/app/dashboard/agent-library.html +1 -1
  511. package/app/.next-cli-build/server/app/dashboard/agent-library.rsc +8 -8
  512. package/app/.next-cli-build/server/app/dashboard/agent-library.segments/!KGRhc2hib2FyZCk/dashboard/agent-library/__PAGE__.segment.rsc +2 -2
  513. package/app/.next-cli-build/server/app/dashboard/agent-library.segments/!KGRhc2hib2FyZCk/dashboard/agent-library.segment.rsc +1 -1
  514. package/app/.next-cli-build/server/app/dashboard/agent-library.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  515. package/app/.next-cli-build/server/app/dashboard/agent-library.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
  516. package/app/.next-cli-build/server/app/dashboard/agent-library.segments/_full.segment.rsc +8 -8
  517. package/app/.next-cli-build/server/app/dashboard/agent-library.segments/_head.segment.rsc +1 -1
  518. package/app/.next-cli-build/server/app/dashboard/agent-library.segments/_index.segment.rsc +5 -5
  519. package/app/.next-cli-build/server/app/dashboard/agent-library.segments/_tree.segment.rsc +3 -3
  520. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  521. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +8 -8
  522. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  523. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  524. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  525. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
  526. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +8 -8
  527. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  528. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +5 -5
  529. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +3 -3
  530. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  531. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +9 -9
  532. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  533. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  534. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  535. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
  536. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +9 -9
  537. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  538. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +5 -5
  539. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +3 -3
  540. package/app/.next-cli-build/server/app/dashboard/combos/routing.html +1 -1
  541. package/app/.next-cli-build/server/app/dashboard/combos/routing.rsc +8 -8
  542. package/app/.next-cli-build/server/app/dashboard/combos/routing.segments/!KGRhc2hib2FyZCk/dashboard/combos/routing/__PAGE__.segment.rsc +2 -2
  543. package/app/.next-cli-build/server/app/dashboard/combos/routing.segments/!KGRhc2hib2FyZCk/dashboard/combos/routing.segment.rsc +1 -1
  544. package/app/.next-cli-build/server/app/dashboard/combos/routing.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  545. package/app/.next-cli-build/server/app/dashboard/combos/routing.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  546. package/app/.next-cli-build/server/app/dashboard/combos/routing.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
  547. package/app/.next-cli-build/server/app/dashboard/combos/routing.segments/_full.segment.rsc +8 -8
  548. package/app/.next-cli-build/server/app/dashboard/combos/routing.segments/_head.segment.rsc +1 -1
  549. package/app/.next-cli-build/server/app/dashboard/combos/routing.segments/_index.segment.rsc +5 -5
  550. package/app/.next-cli-build/server/app/dashboard/combos/routing.segments/_tree.segment.rsc +3 -3
  551. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  552. package/app/.next-cli-build/server/app/dashboard/combos.rsc +8 -8
  553. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  554. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  555. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  556. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
  557. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +8 -8
  558. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  559. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +5 -5
  560. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +3 -3
  561. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  562. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +9 -9
  563. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  564. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  565. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  566. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
  567. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +9 -9
  568. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  569. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +5 -5
  570. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +3 -3
  571. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  572. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +8 -8
  573. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  574. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  575. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  576. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  577. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
  578. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +8 -8
  579. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  580. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +5 -5
  581. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +3 -3
  582. package/app/.next-cli-build/server/app/dashboard/media-providers.html +1 -1
  583. package/app/.next-cli-build/server/app/dashboard/media-providers.rsc +8 -8
  584. package/app/.next-cli-build/server/app/dashboard/media-providers.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/__PAGE__.segment.rsc +2 -2
  585. package/app/.next-cli-build/server/app/dashboard/media-providers.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  586. package/app/.next-cli-build/server/app/dashboard/media-providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  587. package/app/.next-cli-build/server/app/dashboard/media-providers.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
  588. package/app/.next-cli-build/server/app/dashboard/media-providers.segments/_full.segment.rsc +8 -8
  589. package/app/.next-cli-build/server/app/dashboard/media-providers.segments/_head.segment.rsc +1 -1
  590. package/app/.next-cli-build/server/app/dashboard/media-providers.segments/_index.segment.rsc +5 -5
  591. package/app/.next-cli-build/server/app/dashboard/media-providers.segments/_tree.segment.rsc +3 -3
  592. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  593. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +8 -8
  594. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  595. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  596. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  597. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
  598. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +8 -8
  599. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  600. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +5 -5
  601. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +3 -3
  602. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  603. package/app/.next-cli-build/server/app/dashboard/profile.rsc +9 -9
  604. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  605. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  606. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  607. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
  608. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +9 -9
  609. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  610. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +5 -5
  611. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +3 -3
  612. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  613. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +8 -8
  614. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  615. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  616. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  617. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  618. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
  619. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +8 -8
  620. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  621. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +5 -5
  622. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +3 -3
  623. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  624. package/app/.next-cli-build/server/app/dashboard/providers.rsc +8 -8
  625. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  626. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  627. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  628. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
  629. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +8 -8
  630. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  631. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +5 -5
  632. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +3 -3
  633. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  634. package/app/.next-cli-build/server/app/dashboard/quota.rsc +9 -9
  635. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  636. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  637. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  638. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
  639. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +9 -9
  640. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  641. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +5 -5
  642. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +3 -3
  643. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +2 -2
  644. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  645. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  646. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  647. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +6 -6
  648. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +6 -6
  649. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  650. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +5 -5
  651. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +3 -3
  652. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
  653. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  654. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  655. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  656. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  657. package/app/.next-cli-build/server/app/dashboard/skills.rsc +8 -8
  658. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  659. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  660. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  661. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
  662. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +8 -8
  663. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  664. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +5 -5
  665. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +3 -3
  666. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  667. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +8 -8
  668. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  669. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  670. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  671. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
  672. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +8 -8
  673. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  674. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +5 -5
  675. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +3 -3
  676. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  677. package/app/.next-cli-build/server/app/dashboard/translator.rsc +8 -8
  678. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  679. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  680. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  681. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
  682. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +8 -8
  683. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  684. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +5 -5
  685. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +3 -3
  686. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  687. package/app/.next-cli-build/server/app/dashboard/usage.rsc +8 -8
  688. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  689. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  690. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  691. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
  692. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +8 -8
  693. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  694. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +5 -5
  695. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +3 -3
  696. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  697. package/app/.next-cli-build/server/app/dashboard.rsc +8 -8
  698. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  699. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  700. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +3 -3
  701. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +8 -8
  702. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  703. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +5 -5
  704. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +3 -3
  705. package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
  706. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  707. package/app/.next-cli-build/server/app/index.html +1 -1
  708. package/app/.next-cli-build/server/app/index.rsc +5 -5
  709. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  710. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +5 -5
  711. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  712. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +5 -5
  713. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +3 -3
  714. package/app/.next-cli-build/server/app/landing/page.js +2 -2
  715. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  716. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  717. package/app/.next-cli-build/server/app/landing.html +1 -1
  718. package/app/.next-cli-build/server/app/landing.rsc +6 -6
  719. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +6 -6
  720. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  721. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +5 -5
  722. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +3 -3
  723. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  724. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  725. package/app/.next-cli-build/server/app/login/page.js +2 -2
  726. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  727. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  728. package/app/.next-cli-build/server/app/login.html +1 -1
  729. package/app/.next-cli-build/server/app/login.rsc +5 -5
  730. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  731. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  732. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +5 -5
  733. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +3 -3
  734. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
  735. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  736. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  737. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  738. package/app/.next-cli-build/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  739. package/app/.next-cli-build/server/app/page.js +2 -2
  740. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  741. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  742. package/app/.next-cli-build/server/app-paths-manifest.json +10 -10
  743. package/app/.next-cli-build/server/chunks/1241.js +1 -1
  744. package/app/.next-cli-build/server/chunks/2701.js +1 -1
  745. package/app/.next-cli-build/server/chunks/2768.js +1 -1
  746. package/app/.next-cli-build/server/chunks/319.js +3 -3
  747. package/app/.next-cli-build/server/chunks/3546.js +1 -1
  748. package/app/.next-cli-build/server/chunks/4194.js +1 -0
  749. package/app/.next-cli-build/server/chunks/4206.js +1 -1
  750. package/app/.next-cli-build/server/chunks/4746.js +1 -1
  751. package/app/.next-cli-build/server/chunks/4827.js +1 -1
  752. package/app/.next-cli-build/server/chunks/5330.js +3 -3
  753. package/app/.next-cli-build/server/chunks/5612.js +1 -1
  754. package/app/.next-cli-build/server/chunks/5655.js +1 -1
  755. package/app/.next-cli-build/server/chunks/5961.js +1 -1
  756. package/app/.next-cli-build/server/chunks/6040.js +1 -0
  757. package/app/.next-cli-build/server/chunks/{9541.js → 6059.js} +1 -1
  758. package/app/.next-cli-build/server/chunks/6150.js +2 -2
  759. package/app/.next-cli-build/server/chunks/{5852.js → 7557.js} +3 -3
  760. package/app/.next-cli-build/server/chunks/7774.js +20 -19
  761. package/app/.next-cli-build/server/chunks/8238.js +1 -1
  762. package/app/.next-cli-build/server/chunks/{1260.js → 8666.js} +1 -1
  763. package/app/.next-cli-build/server/chunks/8860.js +3 -3
  764. package/app/.next-cli-build/server/chunks/9613.js +1 -0
  765. package/app/.next-cli-build/server/chunks/9696.js +7 -0
  766. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  767. package/app/.next-cli-build/server/middleware.js +9 -9
  768. package/app/.next-cli-build/server/next-font-manifest.js +1 -1
  769. package/app/.next-cli-build/server/next-font-manifest.json +1 -1
  770. package/app/.next-cli-build/server/pages/404.html +1 -1
  771. package/app/.next-cli-build/server/pages/500.html +1 -1
  772. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  773. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  774. package/app/.next-cli-build/static/chunks/{1321-3fb88ae56e7b3791.js → 1321-39ad919b1616c75c.js} +1 -1
  775. package/app/.next-cli-build/static/chunks/2562-ceb69ca00b47af6e.js +64 -0
  776. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/agent-library/page-b6f9c90a614bfb03.js +1 -0
  777. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-c688f04d8c6a748d.js → page-af2d913820faedae.js} +1 -1
  778. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/page-a777baf9c2aa43b4.js +1 -0
  779. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/page-88244cb193592f8f.js +1 -0
  780. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/{page-3cf4f51a70049a03.js → page-3f5fa0d8e152056f.js} +1 -1
  781. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/routing/page-ff92eef8e57d1447.js +1 -0
  782. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/{page-588506e8d6588ef0.js → page-73628e93426ae624.js} +1 -1
  783. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-a8d8d0f4bfbcfbae.js +3 -0
  784. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-65cfcbb2a087ac60.js → page-a915efd975f6af81.js} +2 -2
  785. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/{page-61ca3a6a1dd1eb4a.js → page-9cad271042843781.js} +1 -1
  786. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-dad3750b5c02900c.js → page-8bff15a89ffc3746.js} +1 -1
  787. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/{page-46a3db73d45024e9.js → page-36448aa4e37c7802.js} +1 -1
  788. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/{page-ed209fb43f1d6130.js → page-4d2b06f4c8d1b384.js} +1 -1
  789. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/{page-49e38f6f8e4e2f3c.js → page-755ed32651028f99.js} +1 -1
  790. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/{page-2ee7071258ed9bd4.js → page-afeae41f2e9445ec.js} +1 -1
  791. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/{page-224240854e1b6a8a.js → page-ff7973275ee57a96.js} +1 -1
  792. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-ea29e184be241899.js → page-5e44267c26a7e42d.js} +2 -2
  793. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/page-3afd6ee04180298c.js +1 -0
  794. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-4957f02eb9879798.js +1 -0
  795. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/{page-84e16188362cb0af.js → page-14da9269a25bd090.js} +1 -1
  796. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/[id]/{page-0746d1a330d89fed.js → page-95e55b6593bcf3f7.js} +1 -1
  797. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/{page-901c28377166f266.js → page-77bb7400c2be9752.js} +1 -1
  798. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/{page-5887c8fd842b722e.js → page-54d1bd253432bc6f.js} +1 -1
  799. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/{page-2b3ebdba6e257e3a.js → page-ef0b203963c2c25e.js} +1 -1
  800. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-59db0b586ad5ab45.js +1 -0
  801. package/app/.next-cli-build/static/chunks/app/(dashboard)/layout-58013e7e99d17d70.js +1 -0
  802. package/app/.next-cli-build/static/chunks/app/_not-found/{page-b8562ec224316153.js → page-ee581ced4614e639.js} +1 -1
  803. package/app/.next-cli-build/static/chunks/app/callback/page-64f2a90493720740.js +1 -0
  804. package/app/.next-cli-build/static/chunks/app/dashboard/settings/pricing/{page-ed2255d69c2760ec.js → page-2c2051aa3be879d6.js} +1 -1
  805. package/app/.next-cli-build/static/chunks/app/landing/page-8c76c0ea58e06a53.js +1 -0
  806. package/app/.next-cli-build/static/chunks/app/{layout-09827daf4ebdd3eb.js → layout-214ea0ad8a3d8323.js} +1 -1
  807. package/app/.next-cli-build/static/chunks/{framework-711ef29bc66f648c.js → framework-594babcea68f40f6.js} +1 -1
  808. package/app/.next-cli-build/static/chunks/{main-app-11f959986c6ea8f3.js → main-app-e5d01a79c4922432.js} +1 -1
  809. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/global-error-f9c47afa2e4175d7.js +1 -0
  810. package/app/.next-cli-build/static/css/20c5585d3269ee43.css +1 -0
  811. package/app/.next-cli-build/static/css/{34c541b5726dadd8.css → a26e7bdf55d5cb27.css} +1 -1
  812. package/app/.next-cli-build/static/media/material-symbols-outlined.f656244e.woff2 +0 -0
  813. package/app/cli/.build-home/.switchboard/auth/machine-id-salt +1 -0
  814. package/app/cli/.build-home/.switchboard/db/data.sqlite +0 -0
  815. package/app/cli/.build-home/.switchboard/machine-id +1 -1
  816. package/app/node_modules/react/cjs/react.development.js +1 -1
  817. package/app/node_modules/react/cjs/react.production.js +1 -1
  818. package/app/node_modules/react/package.json +1 -1
  819. package/app/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +1 -1
  820. package/app/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.js +1 -1
  821. package/app/node_modules/react-dom/cjs/react-dom-server.browser.production.js +3 -3
  822. package/app/node_modules/react-dom/cjs/react-dom-server.edge.production.js +3 -3
  823. package/app/node_modules/react-dom/cjs/react-dom-server.node.production.js +3 -3
  824. package/app/node_modules/react-dom/cjs/react-dom.production.js +1 -1
  825. package/app/node_modules/react-dom/package.json +2 -2
  826. package/app/package.json +15 -16
  827. package/app/server.js +1 -1
  828. package/app/src/mitm/server.js +2 -2
  829. package/package.json +4 -4
  830. package/app/.next/standalone/.next-cli-build/standalone/switchboard/.next/standalone/skills/switchboard/SKILL.md +0 -79
  831. package/app/.next/standalone/.next-cli-build/standalone/switchboard/.next/standalone/skills/switchboard-chat/SKILL.md +0 -116
  832. package/app/.next/standalone/.next-cli-build/standalone/switchboard/cli/app/.next/standalone/skills/switchboard/SKILL.md +0 -79
  833. package/app/.next/standalone/.next-cli-build/standalone/switchboard/cli/app/.next/standalone/skills/switchboard-chat/SKILL.md +0 -116
  834. package/app/.next/standalone/.next-cli-build/standalone/switchboard/cli/app/skills/switchboard/SKILL.md +0 -79
  835. package/app/.next/standalone/.next-cli-build/standalone/switchboard/cli/app/skills/switchboard-chat/SKILL.md +0 -116
  836. package/app/.next/standalone/.next-cli-build/standalone/switchboard/skills/switchboard/SKILL.md +0 -79
  837. package/app/.next/standalone/.next-cli-build/standalone/switchboard/skills/switchboard-chat/SKILL.md +0 -116
  838. package/app/.next/standalone/cli/app/.next/standalone/skills/switchboard/SKILL.md +0 -79
  839. package/app/.next/standalone/cli/app/.next/standalone/skills/switchboard-chat/SKILL.md +0 -116
  840. package/app/.next/standalone/cli/app/cli/app/.next/standalone/skills/switchboard/SKILL.md +0 -79
  841. package/app/.next/standalone/cli/app/cli/app/.next/standalone/skills/switchboard-chat/SKILL.md +0 -116
  842. package/app/.next/standalone/cli/app/cli/app/skills/switchboard/SKILL.md +0 -79
  843. package/app/.next/standalone/cli/app/cli/app/skills/switchboard-chat/SKILL.md +0 -116
  844. package/app/.next/standalone/cli/app/skills/switchboard/SKILL.md +0 -79
  845. package/app/.next/standalone/cli/app/skills/switchboard-chat/SKILL.md +0 -116
  846. package/app/.next/standalone/skills/switchboard/SKILL.md +0 -79
  847. package/app/.next/standalone/skills/switchboard-chat/SKILL.md +0 -116
  848. package/app/.next-cli-build/server/chunks/2231.js +0 -1
  849. package/app/.next-cli-build/server/chunks/3512.js +0 -7
  850. package/app/.next-cli-build/server/chunks/4414.js +0 -1
  851. package/app/.next-cli-build/server/chunks/595.js +0 -1
  852. package/app/.next-cli-build/static/chunks/2562-2500ff34b51fb718.js +0 -64
  853. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/agent-library/page-300dd0d4a14c86ab.js +0 -1
  854. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/page-5722c35724f2cc4f.js +0 -1
  855. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/page-d75b80dab94a2849.js +0 -1
  856. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/routing/page-c9dcb59231f22b88.js +0 -1
  857. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-08175767f4233a14.js +0 -3
  858. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/page-36c5cb9892efd5c3.js +0 -1
  859. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-5dcde8afd9ea38e7.js +0 -1
  860. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-5fb06025c80a090f.js +0 -1
  861. package/app/.next-cli-build/static/chunks/app/(dashboard)/layout-2cf7f9f80870dd6c.js +0 -1
  862. package/app/.next-cli-build/static/chunks/app/callback/page-f1f270e67555b182.js +0 -1
  863. package/app/.next-cli-build/static/chunks/app/landing/page-6892ba5b21239050.js +0 -1
  864. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/global-error-cc98e46801de50e2.js +0 -1
  865. package/app/.next-cli-build/static/css/0f3ab8c15caad6fe.css +0 -1
  866. package/app/.next-cli-build/static/media/material-symbols-outlined.ec1fa111.woff2 +0 -0
  867. package/app/cli/.build-home/Library/Preferences/nextjs-nodejs/config.json +0 -7
  868. package/app/cli/app/.next/standalone/skills/switchboard/SKILL.md +0 -79
  869. package/app/cli/app/.next/standalone/skills/switchboard-chat/SKILL.md +0 -116
  870. package/app/cli/app/cli/app/.next/standalone/skills/switchboard/SKILL.md +0 -79
  871. package/app/cli/app/cli/app/.next/standalone/skills/switchboard-chat/SKILL.md +0 -116
  872. package/app/cli/app/cli/app/skills/switchboard/SKILL.md +0 -79
  873. package/app/cli/app/cli/app/skills/switchboard-chat/SKILL.md +0 -116
  874. package/app/cli/app/skills/switchboard/SKILL.md +0 -79
  875. package/app/cli/app/skills/switchboard-chat/SKILL.md +0 -116
  876. package/app/skills/README.md +0 -37
  877. package/app/skills/switchboard/SKILL.md +0 -79
  878. package/app/skills/switchboard-chat/SKILL.md +0 -116
  879. package/app/tests/.tmp-data/agent-library/skills/switchboard/SKILL.md +0 -79
  880. package/app/tests/.tmp-data/agent-library/skills/switchboard-chat/SKILL.md +0 -116
  881. /package/app/.next-cli-build/static/{XN2UMzJk6TOOrjyMPr-m8 → HFerqnfiKkxdqoMVxOfPW}/_buildManifest.js +0 -0
  882. /package/app/.next-cli-build/static/{XN2UMzJk6TOOrjyMPr-m8 → HFerqnfiKkxdqoMVxOfPW}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{500:(e,t,s)=>{Promise.resolve().then(s.bind(s,3953))},3953:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>B});var a=s(95155),i=s(12115),l=s(73321),n=s(98500),r=s.n(n),o=s(5772),d=s(35497),c=s(88105),m=s(28777),p=s(990),u=s(62630);let x=["none","low","medium","high"],h=["none","thinking"],f=["none","low","medium","high","max"],g={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":f,"claude-budget":["none","low","medium","high","xhigh","max"],"gemini-level":["minimal","low","medium","high"],"gemini-budget":x,zai:h,qwen:x,kimi:f,deepseek:["none","high","max"],minimax:h,hunyuan:x,step:x},y=[{pattern:"*codex*",levels:["low","medium","high","xhigh"]}];function b(e,t){let s=(0,p.nl)(e,t);if(!s.reasoning)return null;let a=y.find(e=>(0,u.gH)(e.pattern,t)),i=a?.levels||g[s.thinkingFormat]||x;return!1===s.thinkingCanDisable&&(i=i.filter(e=>"none"!==e)),i}var v=s(11059),j=s(929),w=s(73006);let k=new Map;async function N(e){if(!e?.url||!e?.type)return[];let t=k.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let a=(await s.json()).data??[];return k.set(e.url,{data:a,expiresAt:Date.now()+6e5}),a}catch{return[]}}function C({customModels:e=[],modelAliases:t={},providerAlias:s,builtInModels:a=[],type:i="llm",includeLegacyAliases:l=!0}){let n=new Set(a.map(e=>e.id)),r=new Set,o=[];for(let t of e){if(!t?.id||t.providerAlias!==s)continue;let e=t?.kind||t?.type||"llm";if(i&&e!==i||n.has(t.id))continue;let a=`${s}/${t.id}`;r.has(a)||(r.add(a),o.push({id:t.id,name:t.name||t.id,fullModel:a,source:"custom",type:e}))}if(!l)return o;let d=`${s}/`;for(let[e,s]of Object.entries(t||{})){if("string"!=typeof s||!s.startsWith(d))continue;let t=s.slice(d.length);!t||n.has(t)||r.has(s)||(r.add(s),o.push({id:t,alias:e,fullModel:s,source:"legacyAlias",type:i||"llm"}))}return o}function S(e,t={}){let s=t.kind||t.type;if(s&&"string"==typeof s){let e=s.toLowerCase();return"chat"===e||"text"===e||"language"===e?"llm":e}let a=String(e||"").toLowerCase();return/embed/.test(a)?"embedding":/(^|[-_/])(tts|speech)([-_/]|$)/.test(a)?"tts":/(whisper|transcri|speech-to-text|(^|[-_/])stt([-_/]|$))/.test(a)?"stt":/(imagine-video|video-gen|(^|[-_/])video([-_/]|$))/.test(a)&&!/revision/.test(a)?"video":/(imagine-image|dall-e|stable-diffusion|sdxl|flux|midjourney|image-gen)/.test(a)||/(^|[-_/])image([-_/]|$)/.test(a)&&!/(vision|vl|multimodal)/.test(a)?"image":"llm"}function $(e,t){let s=String(e||"").trim();if(!s)return"";if(s=s.replace(/^models\//,""),t){let e=`${t}/`;s.startsWith(e)&&(s=s.slice(e.length))}return(s=s.replace(/^(openai|anthropic|google|x-ai|xai|meta-llama|mistralai)\//i,"")).trim()}var A=s(14051),T=s.n(A);function O({model:e,fullModel:t,alias:s,copied:i,onCopy:l,testStatus:n,isCustom:r,isFree:o,onDeleteAlias:c,onTest:m,isTesting:p,onDisable:u,caps:x,thinkingSuffix:h,latencyMs:f}){let g=h?`${t}(${h})`:t,y="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,a.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:y?{color:y}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,a.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:g}),(0,a.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,a.jsx)("span",{className:"truncate text-[9px] italic text-text-muted/70",children:e.name}),Number.isFinite(f)&&(0,a.jsxs)("span",{className:"shrink-0 text-[9px] text-text-muted/70 tabular-nums",children:[Math.round(f),"ms"]}),(0,a.jsx)(d.nh,{caps:x,colorOverride:"text-text-muted/70",size:12})]})]}),m&&(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:m,disabled:p,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${p?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:p?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:()=>l(g,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:i===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:i===`model-${e.id}`?"Copied!":"Copy"})]}),r?(0,a.jsx)("button",{onClick:c,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):u?(0,a.jsx)("button",{onClick:u,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function E({modelId:e,fullModel:t,copied:s,onCopy:i,onDeleteAlias:l,onTest:n,testStatus:r,isTesting:o}){let d="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0;return(0,a.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===r?"border-green-500/40":"error"===r?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===r?"check_circle":"error"===r?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>i(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),n&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:n,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]})]})]}),(0,a.jsx)("button",{onClick:l,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function I({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,customModels:l,copied:n,onCopy:r,onDeleteAlias:o,onAddCustomModel:c,onDeleteCustomModel:m,onRefreshModels:p,connections:u,isAnthropic:x}){let[h,f]=(0,i.useState)(""),[g,y]=(0,i.useState)(!1),[b,v]=(0,i.useState)(!1),[j,w]=(0,i.useState)(""),[k,N]=(0,i.useState)(null),[S,$]=(0,i.useState)({}),A=async t=>{if(!k){N(t);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),a=await s.json();$(e=>({...e,[t]:a.ok?"ok":"error"}))}catch{$(e=>({...e,[t]:"error"}))}finally{N(null)}}},T=C({customModels:l,modelAliases:s,providerAlias:e,type:"llm"}),O=async()=>{if(!h.trim()||g)return;let e=h.trim();if(T.some(t=>t.id===e))return void alert("Model already exists for this provider.");y(!0);try{await c(e),f("")}catch(e){console.log("Error adding model:",e)}finally{y(!1)}},P=async()=>{if(b)return;let t=u.find(e=>!1!==e.isActive);if(t){v(!0),w("");try{let s=await fetch(`/api/providers/${t.id}/models`),a=await s.json().catch(()=>({}));if(!s.ok)return void alert(a.error||"Failed to import models");let i=a.models||[];if(0===i.length)return void alert("No models returned from /models.");let l=new Set(T.map(e=>e.id)),n=[],r=new Set;for(let t of i){let s=String(t.id||t.name||t.model||"").trim();!s||l.has(s)||r.has(s)||(r.add(s),n.push({providerAlias:e,id:s,type:"llm",name:t.display_name||t.displayName||t.name||s}))}if(0===n.length)return void w("All models already in list");let o=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:n})}),d=await o.json().catch(()=>({}));if(!o.ok){let e=0;for(let t of n)await c(t.id),e+=1;w(e?`Imported ${e} model(s)`:"No new models were added");return}w(`Imported ${d.added??n.length} model(s)`),"function"==typeof p?await p():window.dispatchEvent(new CustomEvent("customModelChanged"))}catch(e){console.log("Error importing models:",e),alert(e?.message||"Import failed")}finally{v(!1)}}},R=u.some(e=>!1!==e.isActive);return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",x?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,a.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,a.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{id:"new-compatible-model-input",type:"text",value:h,onChange:e=>f(e.target.value),onKeyDown:e=>"Enter"===e.key&&O(),placeholder:x?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:O,disabled:!h.trim()||g,children:g?"Adding...":"Add"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"cloud_download",onClick:P,disabled:!R||b,children:b?"Importing...":"Import models"})]}),!R&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),j&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:j}),T.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-3",children:T.map(({id:s,alias:i,source:l})=>(0,a.jsx)(E,{modelId:s,fullModel:`${t}/${s}`,copied:n,onCopy:r,onDeleteAlias:()=>"custom"===l?m(s):o(i),onTest:u.length>0?()=>A(s):void 0,testStatus:S[s],isTesting:k===s},`${l}-${e}/${s}`))})]})}O.propTypes={model:T().shape({id:T().string.isRequired}).isRequired,fullModel:T().string.isRequired,alias:T().string,copied:T().string,onCopy:T().func.isRequired,testStatus:T().oneOf(["ok","error"]),isCustom:T().bool,isFree:T().bool,onDeleteAlias:T().func,onTest:T().func,isTesting:T().bool,onDisable:T().func,caps:T().object,thinkingSuffix:T().string,latencyMs:T().number},T().string.isRequired,T().string.isRequired,T().string,T().func.isRequired,T().func.isRequired,T().func,T().oneOf(["ok","error"]),T().bool,T().string.isRequired,T().object.isRequired,T().arrayOf(T().object),T().string,T().func.isRequired,T().func.isRequired,T().func.isRequired,T().func.isRequired,I.propTypes={providerStorageAlias:T().string.isRequired,providerDisplayAlias:T().string.isRequired,modelAliases:T().object.isRequired,customModels:T().arrayOf(T().object),copied:T().string,onCopy:T().func.isRequired,onDeleteAlias:T().func.isRequired,onAddCustomModel:T().func.isRequired,onDeleteCustomModel:T().func.isRequired,onRefreshModels:T().func,connections:T().arrayOf(T().shape({id:T().string,isActive:T().bool})).isRequired,isAnthropic:T().bool};var P=s(70217);function R({until:e}){let[t,s]=(0,i.useState)("");return((0,i.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let a=Math.floor(t/1e3);if(a<60)s(`${a}s`);else if(a<3600)s(`${Math.floor(a/60)}m ${a%60}s`);else{let e=Math.floor(a/3600),t=Math.floor(a%3600/60);s(`${e}h ${t}m`)}};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function D({connection:e,isOAuth:t,isFirst:s,isLast:l,onMoveUp:n,onMoveDown:r,onToggleActive:o,onEdit:c,onDelete:m,oneByOneStatus:p=null,autoPing:u=null}){let x=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,h=x?`Proxy: ${e.providerSpecificData?.connectionProxyUrl}`:"",f=u?.provider==="codex"?"Auto-starts the next 5h Codex window after reset by sending a tiny gpt-5.5 request. Consumes a small amount of quota.":"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",g="";if(e.providerSpecificData?.connectionProxyUrl){let t=e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);g=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{g=t}}let y=e.providerSpecificData?.connectionNoProxy||"",b=x?"success":"default",v=e.authType||(t?"oauth":"apikey"),j="oauth"===v,w="cookie"===v,k=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(j?"OAuth Account":w?"Cookie Account":"API Key"),N=e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null,[C,S]=(0,i.useState)(!1),$=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,i.useEffect)(()=>{let t=()=>{S(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=$?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[$]);let A="unavailable"!==e.testStatus||C?e.testStatus:"active",T=()=>p?"queued"===p.state?"queued":"testing"===p.state?"testing":"success"===p.state?"success":"failed"===p.state?p.error?`failed: ${p.error}`:"failed":null:null;return(0,a.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,a.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,a.jsx)("button",{onClick:n,disabled:s,className:`p-0.5 rounded ${s?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:r,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:w?"cookie":j?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:k}),N&&(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:N}),(0,a.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,a.jsx)(d.Ex,{variant:(0,P.g)(e.isActive,A),size:"sm",dot:!0,children:!1===e.isActive?"disabled":A||"Unknown"}),(0,a.jsx)(d.Ex,{variant:"default",size:"sm",children:j?"OAuth":w?"Cookie":"API Key"}),x&&(0,a.jsx)(d.Ex,{variant:b,size:"sm",children:"Proxy"}),C&&!1!==e.isActive&&(0,a.jsx)(R,{until:$}),e.lastError&&!1!==e.isActive&&(0,a.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),T()&&(0,a.jsx)(d.Ex,{variant:p?"success"===p.state?"success":"failed"===p.state?"error":"testing"===p.state?"primary":"default":"default",size:"sm",children:T()})]}),x&&(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:h,children:h}),g&&(0,a.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:g}),y&&(0,a.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:y,children:["no_proxy: ",y]})]})]})]}),(0,a.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[u&&(0,a.jsx)(d.m_,{text:f,children:(0,a.jsxs)("button",{onClick:()=>u.onToggle(!u.on),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${u.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,a.jsxs)("button",{onClick:c,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:m,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(d.lM,{size:"sm",checked:e.isActive??!0,onChange:o,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}R.propTypes={until:T().string.isRequired},D.propTypes={connection:T().shape({id:T().string,name:T().string,email:T().string,displayName:T().string,modelLockUntil:T().string,testStatus:T().string,isActive:T().bool,lastError:T().string,priority:T().number,globalPriority:T().number}).isRequired,isOAuth:T().bool.isRequired,isFirst:T().bool.isRequired,isLast:T().bool.isRequired,onMoveUp:T().func.isRequired,onMoveDown:T().func.isRequired,onToggleActive:T().func.isRequired,onEdit:T().func.isRequired,onDelete:T().func.isRequired,oneByOneStatus:T().shape({state:T().string,error:T().string}),autoPing:T().shape({on:T().bool,onToggle:T().func,provider:T().string})};let M=`name1|sk-key1
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{3953:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>B});var a=s(95155),i=s(12115),l=s(73321),n=s(98500),r=s.n(n),o=s(5772),d=s(35497),c=s(88105),m=s(28777),p=s(990),u=s(62630);let x=["none","low","medium","high"],h=["none","thinking"],f=["none","low","medium","high","max"],g={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":f,"claude-budget":["none","low","medium","high","xhigh","max"],"gemini-level":["minimal","low","medium","high"],"gemini-budget":x,zai:h,qwen:x,kimi:f,deepseek:["none","high","max"],minimax:h,hunyuan:x,step:x},y=[{pattern:"*codex*",levels:["low","medium","high","xhigh"]}];function b(e,t){let s=(0,p.nl)(e,t);if(!s.reasoning)return null;let a=y.find(e=>(0,u.gH)(e.pattern,t)),i=a?.levels||g[s.thinkingFormat]||x;return!1===s.thinkingCanDisable&&(i=i.filter(e=>"none"!==e)),i}var v=s(11059),j=s(929),w=s(73006);let k=new Map;async function N(e){if(!e?.url||!e?.type)return[];let t=k.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let a=(await s.json()).data??[];return k.set(e.url,{data:a,expiresAt:Date.now()+6e5}),a}catch{return[]}}function C({customModels:e=[],modelAliases:t={},providerAlias:s,builtInModels:a=[],type:i="llm",includeLegacyAliases:l=!0}){let n=new Set(a.map(e=>e.id)),r=new Set,o=[];for(let t of e){if(!t?.id||t.providerAlias!==s)continue;let e=t?.kind||t?.type||"llm";if(i&&e!==i||n.has(t.id))continue;let a=`${s}/${t.id}`;r.has(a)||(r.add(a),o.push({id:t.id,name:t.name||t.id,fullModel:a,source:"custom",type:e}))}if(!l)return o;let d=`${s}/`;for(let[e,s]of Object.entries(t||{})){if("string"!=typeof s||!s.startsWith(d))continue;let t=s.slice(d.length);!t||n.has(t)||r.has(s)||(r.add(s),o.push({id:t,alias:e,fullModel:s,source:"legacyAlias",type:i||"llm"}))}return o}function S(e,t={}){let s=t.kind||t.type;if(s&&"string"==typeof s){let e=s.toLowerCase();return"chat"===e||"text"===e||"language"===e?"llm":e}let a=String(e||"").toLowerCase();return/embed/.test(a)?"embedding":/(^|[-_/])(tts|speech)([-_/]|$)/.test(a)?"tts":/(whisper|transcri|speech-to-text|(^|[-_/])stt([-_/]|$))/.test(a)?"stt":/(imagine-video|video-gen|(^|[-_/])video([-_/]|$))/.test(a)&&!/revision/.test(a)?"video":/(imagine-image|dall-e|stable-diffusion|sdxl|flux|midjourney|image-gen)/.test(a)||/(^|[-_/])image([-_/]|$)/.test(a)&&!/(vision|vl|multimodal)/.test(a)?"image":"llm"}function $(e,t){let s=String(e||"").trim();if(!s)return"";if(s=s.replace(/^models\//,""),t){let e=`${t}/`;s.startsWith(e)&&(s=s.slice(e.length))}return(s=s.replace(/^(openai|anthropic|google|x-ai|xai|meta-llama|mistralai)\//i,"")).trim()}var A=s(14051),T=s.n(A);function O({model:e,fullModel:t,alias:s,copied:i,onCopy:l,testStatus:n,isCustom:r,isFree:o,onDeleteAlias:c,onTest:m,isTesting:p,onDisable:u,caps:x,thinkingSuffix:h,latencyMs:f}){let g=h?`${t}(${h})`:t,y="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,a.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:y?{color:y}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,a.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:g}),(0,a.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,a.jsx)("span",{className:"truncate text-[9px] italic text-text-muted/70",children:e.name}),Number.isFinite(f)&&(0,a.jsxs)("span",{className:"shrink-0 text-[9px] text-text-muted/70 tabular-nums",children:[Math.round(f),"ms"]}),(0,a.jsx)(d.nh,{caps:x,colorOverride:"text-text-muted/70",size:12})]})]}),m&&(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:m,disabled:p,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${p?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:p?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:()=>l(g,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:i===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:i===`model-${e.id}`?"Copied!":"Copy"})]}),r?(0,a.jsx)("button",{onClick:c,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):u?(0,a.jsx)("button",{onClick:u,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function E({modelId:e,fullModel:t,copied:s,onCopy:i,onDeleteAlias:l,onTest:n,testStatus:r,isTesting:o}){let d="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0;return(0,a.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===r?"border-green-500/40":"error"===r?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===r?"check_circle":"error"===r?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>i(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),n&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:n,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]})]})]}),(0,a.jsx)("button",{onClick:l,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function I({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,customModels:l,copied:n,onCopy:r,onDeleteAlias:o,onAddCustomModel:c,onDeleteCustomModel:m,onRefreshModels:p,connections:u,isAnthropic:x}){let[h,f]=(0,i.useState)(""),[g,y]=(0,i.useState)(!1),[b,v]=(0,i.useState)(!1),[j,w]=(0,i.useState)(""),[k,N]=(0,i.useState)(null),[S,$]=(0,i.useState)({}),A=async t=>{if(!k){N(t);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),a=await s.json();$(e=>({...e,[t]:a.ok?"ok":"error"}))}catch{$(e=>({...e,[t]:"error"}))}finally{N(null)}}},T=C({customModels:l,modelAliases:s,providerAlias:e,type:"llm"}),O=async()=>{if(!h.trim()||g)return;let e=h.trim();if(T.some(t=>t.id===e))return void alert("Model already exists for this provider.");y(!0);try{await c(e),f("")}catch(e){console.log("Error adding model:",e)}finally{y(!1)}},P=async()=>{if(b)return;let t=u.find(e=>!1!==e.isActive);if(t){v(!0),w("");try{let s=await fetch(`/api/providers/${t.id}/models`),a=await s.json().catch(()=>({}));if(!s.ok)return void alert(a.error||"Failed to import models");let i=a.models||[];if(0===i.length)return void alert("No models returned from /models.");let l=new Set(T.map(e=>e.id)),n=[],r=new Set;for(let t of i){let s=String(t.id||t.name||t.model||"").trim();!s||l.has(s)||r.has(s)||(r.add(s),n.push({providerAlias:e,id:s,type:"llm",name:t.display_name||t.displayName||t.name||s}))}if(0===n.length)return void w("All models already in list");let o=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:n})}),d=await o.json().catch(()=>({}));if(!o.ok){let e=0;for(let t of n)await c(t.id),e+=1;w(e?`Imported ${e} model(s)`:"No new models were added");return}w(`Imported ${d.added??n.length} model(s)`),"function"==typeof p?await p():window.dispatchEvent(new CustomEvent("customModelChanged"))}catch(e){console.log("Error importing models:",e),alert(e?.message||"Import failed")}finally{v(!1)}}},R=u.some(e=>!1!==e.isActive);return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",x?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,a.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,a.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{id:"new-compatible-model-input",type:"text",value:h,onChange:e=>f(e.target.value),onKeyDown:e=>"Enter"===e.key&&O(),placeholder:x?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:O,disabled:!h.trim()||g,children:g?"Adding...":"Add"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"cloud_download",onClick:P,disabled:!R||b,children:b?"Importing...":"Import models"})]}),!R&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),j&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:j}),T.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-3",children:T.map(({id:s,alias:i,source:l})=>(0,a.jsx)(E,{modelId:s,fullModel:`${t}/${s}`,copied:n,onCopy:r,onDeleteAlias:()=>"custom"===l?m(s):o(i),onTest:u.length>0?()=>A(s):void 0,testStatus:S[s],isTesting:k===s},`${l}-${e}/${s}`))})]})}O.propTypes={model:T().shape({id:T().string.isRequired}).isRequired,fullModel:T().string.isRequired,alias:T().string,copied:T().string,onCopy:T().func.isRequired,testStatus:T().oneOf(["ok","error"]),isCustom:T().bool,isFree:T().bool,onDeleteAlias:T().func,onTest:T().func,isTesting:T().bool,onDisable:T().func,caps:T().object,thinkingSuffix:T().string,latencyMs:T().number},T().string.isRequired,T().string.isRequired,T().string,T().func.isRequired,T().func.isRequired,T().func,T().oneOf(["ok","error"]),T().bool,T().string.isRequired,T().object.isRequired,T().arrayOf(T().object),T().string,T().func.isRequired,T().func.isRequired,T().func.isRequired,T().func.isRequired,I.propTypes={providerStorageAlias:T().string.isRequired,providerDisplayAlias:T().string.isRequired,modelAliases:T().object.isRequired,customModels:T().arrayOf(T().object),copied:T().string,onCopy:T().func.isRequired,onDeleteAlias:T().func.isRequired,onAddCustomModel:T().func.isRequired,onDeleteCustomModel:T().func.isRequired,onRefreshModels:T().func,connections:T().arrayOf(T().shape({id:T().string,isActive:T().bool})).isRequired,isAnthropic:T().bool};var P=s(70217);function R({until:e}){let[t,s]=(0,i.useState)("");return((0,i.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let a=Math.floor(t/1e3);if(a<60)s(`${a}s`);else if(a<3600)s(`${Math.floor(a/60)}m ${a%60}s`);else{let e=Math.floor(a/3600),t=Math.floor(a%3600/60);s(`${e}h ${t}m`)}};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function D({connection:e,isOAuth:t,isFirst:s,isLast:l,onMoveUp:n,onMoveDown:r,onToggleActive:o,onEdit:c,onDelete:m,oneByOneStatus:p=null,autoPing:u=null}){let x=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,h=x?`Proxy: ${e.providerSpecificData?.connectionProxyUrl}`:"",f=u?.provider==="codex"?"Auto-starts the next 5h Codex window after reset by sending a tiny gpt-5.5 request. Consumes a small amount of quota.":"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",g="";if(e.providerSpecificData?.connectionProxyUrl){let t=e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);g=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{g=t}}let y=e.providerSpecificData?.connectionNoProxy||"",b=x?"success":"default",v=e.authType||(t?"oauth":"apikey"),j="oauth"===v,w="cookie"===v,k=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(j?"OAuth Account":w?"Cookie Account":"API Key"),N=e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null,[C,S]=(0,i.useState)(!1),$=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,i.useEffect)(()=>{let t=()=>{S(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=$?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[$]);let A="unavailable"!==e.testStatus||C?e.testStatus:"active",T=()=>p?"queued"===p.state?"queued":"testing"===p.state?"testing":"success"===p.state?"success":"failed"===p.state?p.error?`failed: ${p.error}`:"failed":null:null;return(0,a.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,a.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,a.jsx)("button",{onClick:n,disabled:s,className:`p-0.5 rounded ${s?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:r,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:w?"cookie":j?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:k}),N&&(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:N}),(0,a.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,a.jsx)(d.Ex,{variant:(0,P.g)(e.isActive,A),size:"sm",dot:!0,children:!1===e.isActive?"disabled":A||"Unknown"}),(0,a.jsx)(d.Ex,{variant:"default",size:"sm",children:j?"OAuth":w?"Cookie":"API Key"}),x&&(0,a.jsx)(d.Ex,{variant:b,size:"sm",children:"Proxy"}),C&&!1!==e.isActive&&(0,a.jsx)(R,{until:$}),e.lastError&&!1!==e.isActive&&(0,a.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),T()&&(0,a.jsx)(d.Ex,{variant:p?"success"===p.state?"success":"failed"===p.state?"error":"testing"===p.state?"primary":"default":"default",size:"sm",children:T()})]}),x&&(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:h,children:h}),g&&(0,a.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:g}),y&&(0,a.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:y,children:["no_proxy: ",y]})]})]})]}),(0,a.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[u&&(0,a.jsx)(d.m_,{text:f,children:(0,a.jsxs)("button",{onClick:()=>u.onToggle(!u.on),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${u.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,a.jsxs)("button",{onClick:c,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:m,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(d.lM,{size:"sm",checked:e.isActive??!0,onChange:o,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}R.propTypes={until:T().string.isRequired},D.propTypes={connection:T().shape({id:T().string,name:T().string,email:T().string,displayName:T().string,modelLockUntil:T().string,testStatus:T().string,isActive:T().bool,lastError:T().string,priority:T().number,globalPriority:T().number}).isRequired,isOAuth:T().bool.isRequired,isFirst:T().bool.isRequired,isLast:T().bool.isRequired,onMoveUp:T().func.isRequired,onMoveDown:T().func.isRequired,onToggleActive:T().func.isRequired,onEdit:T().func.isRequired,onDelete:T().func.isRequired,oneByOneStatus:T().shape({state:T().string,error:T().string}),autoPing:T().shape({on:T().bool,onToggle:T().func,provider:T().string})};let M=`name1|sk-key1
2
2
  name2|sk-key2
3
3
  sk-key-only-auto-named`;function z({isOpen:e,provider:t,providerName:s,isCompatible:l,isAnthropic:n,authType:r,authHint:o,website:m,proxyPools:p,error:u,onSave:x,onBulkDone:h,onClose:f}){let g="__none__",y="ollama-local"===t,b="cookie"===r,v="xai"===t&&!b,j=b?"Cookie Value":"API Key",w="azure"===t,k="cloudflare-ai"===t,N=c.Q2?.[t]?.regions||null,C=c.Q2?.[t]?.defaultRegion||N?.[0]?.id||"",[S,$]=(0,i.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:g,ollamaHostUrl:""}),[A,T]=(0,i.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[O,E]=(0,i.useState)({accountId:""}),[I,P]=(0,i.useState)(C),[R,D]=(0,i.useState)(!1),[U,q]=(0,i.useState)(null),[_,F]=(0,i.useState)(!1),[L,K]=(0,i.useState)("single"),[J,B]=(0,i.useState)(""),[W,H]=(0,i.useState)(null),V=()=>y&&S.ollamaHostUrl.trim()?{baseUrl:S.ollamaHostUrl.trim()}:w?{azureEndpoint:A.azureEndpoint,apiVersion:A.apiVersion,deployment:A.deployment,organization:A.organization}:k?{accountId:O.accountId}:N&&I?{region:I}:void 0,G=async()=>{D(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:S.apiKey,providerSpecificData:V()})}),s=await e.json();q(s.valid?"success":"failed")}catch{q("failed")}finally{D(!1)}},Q=async()=>{if(t&&(y||S.apiKey)&&(y||S.name)&&(!l||S.defaultModel.trim())){F(!0);try{let e=!1;try{D(!0),q(null);let s=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:S.apiKey,providerSpecificData:V()})});e=!!(await s.json()).valid,q(e?"success":"failed")}catch{q("failed")}finally{D(!1)}await x({name:S.name||(y?"Ollama Local":""),apiKey:S.apiKey,defaultModel:l?S.defaultModel.trim():void 0,priority:S.priority,proxyPoolId:S.proxyPoolId===g?null:S.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:V()})}finally{F(!1)}}},Z=async()=>{let e=J.split("\n").map(e=>e.trim()).filter(Boolean);if(!e.length)return;F(!0),H(null);let s=0,a=0;for(let i=0;i<e.length;i++){let l=e[i].split("|"),n=l.length>=2?l.slice(1).join("|").trim():l[0].trim(),r=l.length>=2?l[0].trim():"Key",o=`${r} ${i+1}`;try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:n,name:o,priority:1,testStatus:"unknown"})})).ok?s++:a++}catch{a++}}F(!1),H({success:s,failed:a}),s>0&&h&&h()};return t?(0,a.jsx)(d.aF,{isOpen:e,title:`Add ${s||t} ${j}`,onClose:f,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",variant:"single"===L?"primary":"ghost",onClick:()=>{K("single"),H(null)},children:"Single"}),(0,a.jsx)(d.$n,{size:"sm",variant:"bulk"===L?"primary":"ghost",onClick:()=>{K("bulk"),H(null)},children:"Bulk Add"})]}),"bulk"===L&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["One key per line. Format: ",(0,a.jsx)("code",{children:"name|apiKey"})," or just ",(0,a.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:M,value:J,onChange:e=>B(e.target.value)}),W&&(0,a.jsxs)("div",{className:`text-sm font-medium ${W.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",W.success," added",W.failed>0?`, ✗ ${W.failed} failed`:""]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:Z,fullWidth:!0,disabled:_||!J.trim(),children:_?"Adding...":"Add All Keys"}),(0,a.jsx)(d.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===L&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.pd,{label:"Name",value:S.name,onChange:e=>$({...S,name:e.target.value}),placeholder:y?"Ollama Local":"Production Key"}),y&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.pd,{label:"Ollama Host URL",value:S.ollamaHostUrl,onChange:e=>$({...S,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(d.$n,{onClick:G,disabled:R||_,variant:"secondary",children:R?"Checking...":"Check"})})]}),!y&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.pd,{label:j,type:b?"text":"password",value:S.apiKey,onChange:e=>$({...S,apiKey:e.target.value}),placeholder:b?"grok-web"===t?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":v?"xai-...":"",className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(d.$n,{onClick:G,disabled:!S.apiKey||R||_,variant:"secondary",children:R?"Checking...":"Check"})})]}),v&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),b&&o&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[o,m&&(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsxs)("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",m.replace(/^https?:\/\//,"")]})]})]}),N&&(0,a.jsx)(d.l6,{label:"Region",value:I,onChange:e=>P(e.target.value),options:N.map(e=>({value:e.id,label:e.label}))}),l&&(0,a.jsx)(d.pd,{label:"Default Model",value:S.defaultModel,onChange:e=>$({...S,defaultModel:e.target.value}),placeholder:n?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),y&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,a.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,a.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),U&&(0,a.jsx)(d.Ex,{variant:"success"===U?"success":"error",children:"success"===U?"Valid":"Invalid"}),u&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:u}),l&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Enter the model ID exactly as your compatible endpoint expects it. This model will be saved as the connection default."}),k&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,a.jsx)(d.pd,{label:"Account ID",value:O.accountId,onChange:e=>E({...O,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,a.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),w&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(d.pd,{label:"Azure Endpoint",value:A.azureEndpoint,onChange:e=>T({...A,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,a.jsx)(d.pd,{label:"Deployment Name",value:A.deployment,onChange:e=>T({...A,deployment:e.target.value}),placeholder:"gpt-4"}),(0,a.jsx)(d.pd,{label:"API Version",value:A.apiVersion,onChange:e=>T({...A,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,a.jsx)(d.pd,{label:"Organization",value:A.organization,onChange:e=>T({...A,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,a.jsx)(d.pd,{label:"Priority",type:"number",value:S.priority,onChange:e=>$({...S,priority:Number.parseInt(e.target.value)||1})}),(0,a.jsx)(d.l6,{label:"Proxy Pool",value:S.proxyPoolId,onChange:e=>$({...S,proxyPoolId:e.target.value}),options:[{value:g,label:"None"},...(p||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(p||[]).length&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:Q,fullWidth:!0,disabled:_||!y&&(!S.name||!S.apiKey)||l&&!S.defaultModel.trim()||w&&(!A.azureEndpoint||!A.deployment||!A.organization)||k&&!O.accountId,children:_?"Saving...":"Save"}),(0,a.jsx)(d.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function U({isOpen:e,node:t,onSave:s,onClose:l,isAnthropic:n}){let[r,o]=(0,i.useState)({name:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[c,m]=(0,i.useState)(!1),[p,u]=(0,i.useState)(""),[x,h]=(0,i.useState)(""),[f,g]=(0,i.useState)(!1),[y,b]=(0,i.useState)(null);(0,i.useEffect)(()=>{t&&(o({name:t.name||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(n?"https://api.anthropic.com/v1":"https://api.openai.com/v1")}),b(null),u(""),h(""))},[t,n]);let v=async()=>{if(r.name.trim()&&r.baseUrl.trim()){m(!0);try{let e={name:r.name.trim(),baseUrl:r.baseUrl.trim()};n||(e.apiType=r.apiType),await s(e)}finally{m(!1)}}},j=async()=>{g(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:r.baseUrl,apiKey:p,type:n?"anthropic-compatible":"openai-compatible",modelId:x.trim()||void 0})}),t=await e.json();b(t.valid?"success":"failed")}catch{b("failed")}finally{g(!1)}};return t?(0,a.jsx)(d.aF,{isOpen:e,title:`Edit ${n?"Anthropic":"OpenAI"} Compatible`,onClose:l,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(d.pd,{label:"Name",value:r.name,onChange:e=>o({...r,name:e.target.value}),placeholder:`${n?"Anthropic":"OpenAI"} Compatible`,hint:"Friendly label for this provider."}),!n&&(0,a.jsx)(d.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:r.apiType,onChange:e=>o({...r,apiType:e.target.value})}),(0,a.jsx)(d.pd,{label:"Base URL",value:r.baseUrl,onChange:e=>o({...r,baseUrl:e.target.value}),placeholder:n?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Base URL ending in /v1 for your ${n?"Anthropic":"OpenAI"}-compatible API.`}),t.prefix?(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Model IDs use prefix ",(0,a.jsx)("code",{className:"bg-sidebar px-1 rounded font-mono",children:t.prefix})," ","(auto-assigned; stable so combos keep working)."]}):null,(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.pd,{label:"API Key (for Check)",type:"password",value:p,onChange:e=>u(e.target.value),className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(d.$n,{onClick:j,disabled:!p||f||!r.baseUrl.trim(),variant:"secondary",children:f?"Checking...":"Check"})})]}),(0,a.jsx)(d.pd,{label:"Model ID (optional)",value:x,onChange:e=>h(e.target.value),placeholder:"e.g. my-model-id",hint:"If the provider has no /models endpoint, test with a model ID."}),y&&(0,a.jsx)(d.Ex,{variant:"success"===y?"success":"error",children:"success"===y?"Valid":"Invalid"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:v,fullWidth:!0,disabled:!r.name.trim()||!r.baseUrl.trim()||c,children:c?"Saving...":"Save"}),(0,a.jsx)(d.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function q({isOpen:e,providerAlias:t,providerDisplayAlias:s,onSave:l,onClose:n}){let[r,o]=(0,i.useState)(""),[c,m]=(0,i.useState)(null),[p,u]=(0,i.useState)(""),[x,h]=(0,i.useState)(!1);(0,i.useEffect)(()=>{e&&(o(""),m(null),u(""))},[e]);let f=e=>{let s=`${t}/`;return e.startsWith(s)?e.slice(s.length):e},g=async()=>{let e=f(r.trim());if(e){m("testing"),u("");try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${e}`})}),a=await s.json();m(a.ok?"ok":"error"),u(a.error||"")}catch(e){m("error"),u(e.message)}}},y=async()=>{let e=f(r.trim());if(e&&!x){h(!0);try{await l(e)}finally{h(!1)}}};return(0,a.jsx)(d.aF,{isOpen:e,onClose:n,title:"Add Custom Model",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:r,onChange:e=>{o(e.target.value),m(null),u("")},onKeyDown:e=>{"Enter"===e.key&&g()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,a.jsx)(d.$n,{variant:"secondary",icon:"science",loading:"testing"===c,onClick:g,disabled:!r.trim()||"testing"===c,children:"testing"===c?"Testing...":"Test"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,a.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:f(r.trim())||"model-id"})]})]}),"ok"===c&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===c&&(0,a.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,a.jsx)("span",{children:p||"Model not reachable"})]}),(0,a.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,a.jsx)(d.$n,{onClick:n,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,a.jsx)(d.$n,{onClick:y,fullWidth:!0,size:"sm",disabled:!r.trim()||x,children:x?"Adding...":"Add Model"})]})]})})}z.propTypes={isOpen:T().bool.isRequired,provider:T().string,providerName:T().string,isCompatible:T().bool,isAnthropic:T().bool,authType:T().string,authHint:T().string,website:T().string,proxyPools:T().arrayOf(T().shape({id:T().string,name:T().string})),error:T().string,onSave:T().func.isRequired,onBulkDone:T().func,onClose:T().func.isRequired},U.propTypes={isOpen:T().bool.isRequired,node:T().shape({id:T().string,name:T().string,prefix:T().string,apiType:T().string,baseUrl:T().string}),onSave:T().func.isRequired,onClose:T().func.isRequired,isAnthropic:T().bool},q.propTypes={isOpen:T().bool.isRequired,providerAlias:T().string.isRequired,providerDisplayAlias:T().string.isRequired,onSave:T().func.isRequired,onClose:T().func.isRequired};let _=`[
4
4
  {
@@ -7,4 +7,4 @@ sk-key-only-auto-named`;function z({isOpen:e,provider:t,providerName:s,isCompati
7
7
  "idToken": "eyJhbGc...",
8
8
  "email": "user@example.com"
9
9
  }
10
- ]`;function F({isOpen:e,onClose:t,onSuccess:s}){let[l,n]=(0,i.useState)(""),[r,o]=(0,i.useState)(!1),[c,m]=(0,i.useState)(""),[p,u]=(0,i.useState)(null),x=()=>{r||(n(""),m(""),u(null),t())},h=async()=>{var e;let t;m(""),u(null);let a=l.trim();if(!a)return;try{t=JSON.parse(a)}catch(e){m(`${(0,w.Tl)("Invalid JSON")}: ${e.message}`);return}let i=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!i||0===i.length)return void m((0,w.Tl)("No accounts found in input"));o(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:i})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);u(t),t.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,w.Tl)("Request failed"))}finally{o(!1)}},f=p?.results?.filter(e=>!e.ok)||[];return(0,a.jsx)(d.aF,{isOpen:e,title:(0,w.Tl)("Bulk Add Codex Accounts"),onClose:x,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:(0,w.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:_,value:l,onChange:e=>n(e.target.value),disabled:r}),c&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:c}),p&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,w.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,w.Tl)("failed")}`:""]}),f.length>0&&(0,a.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:f.map(e=>(0,a.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:h,fullWidth:!0,disabled:r||!l.trim(),children:r?(0,w.Tl)("Importing..."):(0,w.Tl)("Import All")}),(0,a.jsx)(d.$n,{onClick:x,variant:"ghost",fullWidth:!0,disabled:r,children:(0,w.Tl)("Close")})]})]})})}F.propTypes={isOpen:T().bool.isRequired,onClose:T().func.isRequired,onSuccess:T().func};function L({connectionId:e,providerAlias:t,models:s,onComplete:l,onLatencyMap:n,onClose:r}){let[o,c]=(0,i.useState)(4),[m,p]=(0,i.useState)(50),[u,x]=(0,i.useState)(Math.round(20)),[h,f]=(0,i.useState)(!1),[g,y]=(0,i.useState)(null),[b,v]=(0,i.useState)(null),[j,w]=(0,i.useState)(""),[k,N]=(0,i.useState)(""),C=(0,i.useRef)(!1),S=(0,i.useRef)(null),$=s?.length||0,A=(0,i.useMemo)(()=>`max concurrency 16 \xb7 batch 200 \xb7 timeout ${60}s`,[]);async function T(){if(h||!e||0===$)return;C.current=!1,f(!0),w(""),v(null),N("Preparing…");let a={concurrency:Math.max(1,Math.min(16,Number(o)||4)),batchSize:Math.max(1,Math.min(200,Number(m)||50)),timeoutMs:Math.max(1e3,Math.min(6e4,1e3*(Number(u)||20)))},i={};try{let r=await fetch(`/api/providers/${e}/model-probes/prepare`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:s,providerAlias:t,concurrency:a.concurrency,batchSize:a.batchSize,timeoutMs:a.timeoutMs})}),o=await r.json().catch(()=>({}));if(!r.ok)return void w(o.error||"Prepare failed");let d=o.eligible||[],c=o.stats?.skippedDead||0,m=o.stats?.duplicates||0;if(y({done:0,total:d.length,ok:0,dead:0,retryable:0,skippedDead:c,skippedDup:m}),0===d.length){let e={ok:0,dead:0,retryable:0,tested:0,skippedDead:c,skippedDup:m,removed:0};v(e),N("Nothing to test (all skipped as known-unavailable or empty)."),l?.(e);return}let p=0,u=0,x=0,h=0;for(let s=0;s<d.length&&!C.current;s+=a.batchSize){let l=d.slice(s,s+a.batchSize);N(`Probing ${h+1}–${Math.min(h+l.length,d.length)} of ${d.length}…`),S.current=new AbortController;let n=await fetch(`/api/providers/${e}/model-probes/batch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:S.current.signal,body:JSON.stringify({models:l,providerAlias:t,concurrency:a.concurrency,batchSize:a.batchSize,timeoutMs:a.timeoutMs,warmup:0===s})}),r=await n.json().catch(()=>({}));if(r.providerError){w(r.error||"Provider authentication failed");break}if(!n.ok){w(r.error||"Batch failed");break}for(let e of r.results||[])"ok"===e.probeStatus?(p+=1,e.modelId&&Number.isFinite(e.latencyMs)&&(i[e.modelId]=e.latencyMs),e.canonicalId&&Number.isFinite(e.latencyMs)&&(i[e.canonicalId]=e.latencyMs)):"dead"===e.probeStatus?u+=1:x+=1;h+=(r.results||[]).length,y({done:h,total:d.length,ok:p,dead:u,retryable:x,skippedDead:c,skippedDup:m})}n?.(i);let f={ok:p,dead:u,retryable:x,tested:h,skippedDead:c,skippedDup:m,cancelled:C.current};v(f),N(C.current?"Cancelled (partial results saved).":"Done."),l?.(f)}catch(e){e?.name==="AbortError"?N("Cancelled."):w(e?.message||"Verify failed")}finally{f(!1),S.current=null}}async function O(){if(!e)return;N("Removing unavailable custom models…");let s=await fetch(`/api/providers/${e}/model-probes/remove-unavailable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:t,kind:"llm"})}),a=await s.json().catch(()=>({}));s.ok?(N(`Removed ${a.removed||0} unavailable custom model(s).`),l?.({...b||{},removed:a.removed||0})):w(a.error||"Remove failed")}async function E(){if(!e)return;let t=await fetch(`/api/providers/${e}/model-probes/cache`,{method:"DELETE"}),s=await t.json().catch(()=>({}));t.ok?(N(`Cleared probe cache (${s.cleared||0} rows). Next verify will re-test everything.`),v(null),y(null)):w(s.error||"Clear cache failed")}let I=g?.total?Math.min(100,Math.round(g.done/g.total*100)):0;return(0,a.jsxs)("div",{className:"mb-4 rounded-lg border border-border bg-sidebar/40 p-3 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Verify models"}),(0,a.jsxs)("p",{className:"text-[11px] text-text-muted mt-0.5",children:["Batch-ping availability and latency. Known-dead models are skipped until you clear the cache. Caps: ",A,"."]})]}),r&&(0,a.jsx)("button",{type:"button",onClick:r,className:"p-1 text-text-muted hover:text-text-main rounded",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-3 items-end",children:[(0,a.jsxs)("label",{className:"text-xs text-text-muted",children:["Concurrency",(0,a.jsx)("input",{type:"number",min:1,max:16,value:o,disabled:h,onChange:e=>c(e.target.value),className:"mt-1 block w-20 rounded-md border border-border bg-background px-2 py-1 text-xs"})]}),(0,a.jsxs)("label",{className:"text-xs text-text-muted",children:["Batch size",(0,a.jsx)("input",{type:"number",min:1,max:200,value:m,disabled:h,onChange:e=>p(e.target.value),className:"mt-1 block w-20 rounded-md border border-border bg-background px-2 py-1 text-xs"})]}),(0,a.jsxs)("label",{className:"text-xs text-text-muted",children:["Timeout (s)",(0,a.jsx)("input",{type:"number",min:1,max:60,value:u,disabled:h,onChange:e=>x(e.target.value),className:"mt-1 block w-20 rounded-md border border-border bg-background px-2 py-1 text-xs"})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[h?(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"stop",onClick:function(){C.current=!0,S.current?.abort()},children:"Cancel"}):(0,a.jsx)(d.$n,{size:"sm",icon:"science",onClick:T,disabled:!e||0===$,children:"Start"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete_sweep",onClick:E,disabled:h,children:"Clear cache"})]})]}),g&&(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("div",{className:"h-1.5 w-full rounded-full bg-border overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-primary transition-all",style:{width:`${I}%`}})}),(0,a.jsxs)("p",{className:"text-[11px] text-text-muted",children:[g.done,"/",g.total," tested \xb7 ok ",g.ok," \xb7 dead ",g.dead," \xb7 retry ",g.retryable,g.skippedDead?` \xb7 skipped dead ${g.skippedDead}`:"",g.skippedDup?` \xb7 dupes ${g.skippedDup}`:""]})]}),k&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:k}),j&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:j}),b&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:[(0,a.jsxs)("span",{className:"text-xs text-text-main",children:["Summary: ",b.ok," ok \xb7 ",b.dead," unavailable \xb7 ",b.retryable," retry later",b.skippedDead?` \xb7 ${b.skippedDead} skipped (known dead)`:"",b.cancelled?" \xb7 cancelled":""]}),b.dead>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:O,disabled:h,children:"Remove unavailable custom"})]})]})}function K(e,t=""){let s=String(e||"").trim();if(!s)return"";s=(s=s.replace(/\s+/g,"")).replace(/^models\//i,"");let a=String(t||"").trim();return a&&s.toLowerCase().startsWith(`${a.toLowerCase()}/`)&&(s=s.slice(a.length+1)),(s=s.replace(/\/{2,}/g,"/").replace(/^\/+|\/+$/g,"")).toLowerCase()}L.propTypes={connectionId:T().string,providerAlias:T().string,models:T().arrayOf(T().object),onComplete:T().func,onLatencyMap:T().func,onClose:T().func};let J={claude:"claudeAutoPing",codex:"codexAutoPing"};function B(){let e,t,s,n,p=(0,l.useParams)(),u=(0,l.useRouter)(),x=p.id,{getCaps:h}=(0,j.y)(),[f,g]=(0,i.useState)([]),[y,k]=(0,i.useState)([]),[A,T]=(0,i.useState)(!0),[E,P]=(0,i.useState)(null),[R,M]=(0,i.useState)(!1),[_,B]=(0,i.useState)(!1),[W,H]=(0,i.useState)(!1),[V,G]=(0,i.useState)(""),[Q,Z]=(0,i.useState)(!1),[X,Y]=(0,i.useState)(!1),[ee,et]=(0,i.useState)(!1),[es,ea]=(0,i.useState)(null),[ei,el]=(0,i.useState)({}),[en,er]=(0,i.useState)([]),[eo,ed]=(0,i.useState)(!1),[ec,em]=(0,i.useState)({}),[ep,eu]=(0,i.useState)(""),[ex,eh]=(0,i.useState)(()=>new Set),[ef,eg]=(0,i.useState)(!1),[ey,eb]=(0,i.useState)(null),[ev,ej]=(0,i.useState)(""),[ew,ek]=(0,i.useState)("auto"),[eN,eC]=(0,i.useState)({enabled:!1,connections:{}}),[eS,e$]=(0,i.useState)([]),[eA,eT]=(0,i.useState)([]),[eO,eE]=(0,i.useState)([]),[eI,eP]=(0,i.useState)(null),[eR,eD]=(0,i.useState)(!1),[eM,ez]=(0,i.useState)(!1),[eU,eq]=(0,i.useState)(!1),[e_,eF]=(0,i.useState)(null),[eL,eK]=(0,i.useState)({}),[eJ,eB]=(0,i.useState)(null),eW=(0,i.useRef)(!1),[eH,eV]=(0,i.useState)(!1),[eG,eQ]=(0,i.useState)(""),[eZ,eX]=(0,i.useState)(!1),[eY,e0]=(0,i.useState)({}),{copied:e1,copy:e2}=(0,v.C)(),e5="ag_risk_confirmed",e3=()=>{M(!0)},e4=()=>{"antigravity"===x&&"true"!==window.localStorage.getItem(e5)?eD(!0):te?e3():(G(""),H(!0))},e6=()=>{G(""),H(!0)},e7=()=>{te?e4():e6()},e9=E?{id:E.id,name:E.name||("anthropic-compatible"===E.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===E.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===E.type?"AC":"OC",apiType:E.apiType,baseUrl:E.baseUrl,type:E.type}:c.zN[x]||c.fg[x]||c.IS[x]||c.nJ[x]||c.br[x],e8=e9?.authModes||[],te=!!c.zN[x]||!!c.IS[x]||e8.includes("oauth"),tt=!!c.fg[x]||e8.includes("apikey"),ts=!!c.IS[x]?.noAuth,ta=(0,m.KC)(x),ti=(0,c.wG)(x),tl=(0,c.mq)(x),tn=(0,c.gb)(x),tr=tl||tn,to=!tr&&te&&tt,td="xai"===x?"Grok Build OAuth":"OAuth",tc="xai"===x?"xAI API Key":"API Key",tm=e=>{if(!ew||"auto"===ew)return null;let t=b(x,e);return t&&t.includes(ew)?ew:null},tp=(()=>{let e=new Set;for(let t of ta){let s=b(x,t.id);s&&s.forEach(t=>{"none"!==t&&e.add(t)})}return e.size?["auto",...e]:null})(),tu=tr?x:ti,tx=tr?E?.prefix||x:ti,th=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tu)}`,{cache:"no-store"}),t=await e.json();e.ok&&eE(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tu]),tf=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tu,ids:[e]})})).ok&&await th()}catch(e){console.log("Error disabling model:",e)}},tg=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tu)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await th()}catch(e){console.log("Error enabling model:",e)}},ty=async e=>{e.length&&eP({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eP(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tu,ids:e})})).ok&&await th()}catch(e){console.log("Error disabling all models:",e)}}})},tb=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tu)}`,{method:"DELETE"})).ok&&await th()}catch(e){console.log("Error enabling all models:",e)}},tv=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&el(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tj=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&er(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,i.useEffect)(()=>{"kilocode"===x&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eT(e.models)}).catch(()=>{})},[x]);let tw=(0,i.useCallback)(async()=>{try{let[e,t,s]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),a=await e.json(),i=await t.json(),l=s.ok?await s.json():{};if(e.ok){let e=(a.connections||[]).filter(e=>e.provider===x);g(e)}let n=(l.providerStrategies||{})[x]||{};eb(n.fallbackStrategy||null),ej(null!=n.stickyRoundRobinLimit?String(n.stickyRoundRobinLimit):"1");let r=(l.providerThinking||{})[x]||{};ek(r.mode||"auto");let o=J[x],d=o&&l[o]||{};if(eC({enabled:!0===d.enabled,connections:d.connections||{}}),t.ok){let e=(i.nodes||[]).find(e=>e.id===x)||null;if(!e&&tr)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===x)||null))break}P(e)}}catch(e){console.log("Error fetching connections:",e)}finally{T(!1)}},[x,tr]),tk=async e=>{try{let t=await fetch(`/api/provider-nodes/${x}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(P(s.node),await tw(),et(!1))}catch(e){console.log("Error updating provider node:",e)}},tN=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a=(s.ok?await s.json():{}).providerStrategies||{},i={};e&&(i.fallbackStrategy=e),"round-robin"===e&&""!==t&&(i.stickyRoundRobinLimit=Number(t)||3);let l={...a};0===Object.keys(i).length?delete l[x]:l[x]=i,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}},tC=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?s[x]={mode:e}:delete s[x],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:s})})}catch(e){console.log("Error saving thinking config:",e)}},tS=async e=>{let t=J[x];if(t){eC(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})})}catch(e){console.log("Error saving auto-ping config:",e)}}};(0,i.useEffect)(()=>{tw(),tv(),tj(),th()},[tw,tv,tj,th]),(0,i.useEffect)(()=>{let e=(c.zN[x]||c.fg[x]||c.IS[x]||c.nJ[x])?.modelsFetcher;e&&N(e).then(e$)},[x]);let t$=async(e,t,s=ti)=>{let a=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})});if(e.ok)await tv();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tA=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tv()}catch(e){console.log("Error deleting alias:",e)}},tT=async(e,t="llm",s=tu)=>{try{let a=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t})});if(a.ok)await tj(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await a.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tO=async(e,t="llm",s=tu)=>{try{let a=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${a}`,{method:"DELETE"})).ok&&(await tj(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tE=async()=>{if(eH)return;let e=f.find(e=>y.includes(e.id)&&!1!==e.isActive)||f.find(e=>!1!==e.isActive);if(!e)return void alert((0,w.Tl)("Add an active connection first"));eV(!0),eQ("");try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json().catch(()=>({}));if(!t.ok)return void alert(s.error||(0,w.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void alert(s.warning||(0,w.Tl)("No models returned"));let i=new Set;try{let t=await fetch(`/api/providers/${e.id}/model-probes/prepare`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:a.map(e=>"string"==typeof e?{id:e}:{id:e.id||e.name||e.model,kind:e.kind||e.type||"llm"}),providerAlias:tu})});if(t.ok){let e=await t.json();i=new Set((e.skippedDead||[]).map(e=>e.canonicalId||e.id))}}catch{}let l=new Set(ta.map(e=>e.id)),n=[],r=[],o=new Set,d=0;for(let e of a){let t=function(e,t){if(null==e)return null;if("string"==typeof e){let s=$(e,t);return s?{id:s,name:s,type:S(s)}:null}let s=e.id||e.name||e.model||e.slug;if(!s)return null;let a=$(s,t);if(!a)return null;let i=e.display_name||e.displayName||e.name||e.title||a;return{id:a,name:String(i),type:S(a,e)}}(e,tu);if(!t)continue;let{id:s,name:a,type:c}=t,m=`${c}|${s}`;if(o.has(m))continue;o.add(m);let p=K(s,tu);if(i.has(p)||i.has(s)){d+=1;continue}if(l.has(s)){eO.includes(s)&&r.push(s);continue}if(en.some(e=>e.providerAlias===tu&&e.id===s&&(e.kind||e.type||"llm")===c))continue;let u=`${tu}/${s}`;Object.values(ei).includes(u)||n.push({providerAlias:tu,id:s,type:c,name:a})}let c=0;if(r.length>0)try{for(let e of r)(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tu)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&(c+=1);await th()}catch{}let m=0;if(n.length>0){let e=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:n})}),t=await e.json().catch(()=>({}));if(!e.ok)return void alert(t.error||(0,w.Tl)("Failed to save models"));m=t.added??n.length,await tj(),window.dispatchEvent(new CustomEvent("customModelChanged"))}let p=n.filter(e=>"llm"!==e.type).length,u=[];if(m>0&&u.push(`${m} new`),c>0&&u.push(`${c} re-enabled`),d>0&&u.push(`${d} skipped (known-unavailable)`),0===u.length)eQ((0,w.Tl)("All models already in list"));else{let e=`Imported ${u.join(" \xb7 ")} (${a.length} from provider)`;p>0&&(e+=" \xb7 non-chat types stored for media pages"),s.warning&&(e+=` \xb7 ${s.warning}`),eQ(e)}}catch(e){console.log("Error importing models:",e),alert((0,w.Tl)("Error fetching models")+": "+(e?.message||e))}finally{eV(!1)}},tI=async()=>{if(eM||0===f.length)return;let e=Object.fromEntries(f.map(e=>[e.id,{state:"queued",error:null}]));eW.current=!1,ez(!0),eq(!1),eF(null),eK(e),eB({total:f.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<f.length;e+=1){if(eW.current){eB({total:f.length,completed:e,passed:t,failed:s,stopped:!0});break}let a=f[e];eF(a.id),eK(e=>({...e,[a.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${a.id}/test`,{method:"POST"}),i=await e.json(),l=!!i.valid;l?t+=1:s+=1,eK(e=>({...e,[a.id]:{state:l?"success":"failed",error:l?null:i.error||null}}))}catch(e){s+=1,eK(t=>({...t,[a.id]:{state:"failed",error:e.message||"Test failed"}}))}eB({total:f.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<f.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{eF(null),ez(!1),eq(!1),eW.current=!1}},tP=async e=>{eP({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eP(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&g(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tR=()=>{tw(),M(!1)},tD=async e=>{G("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:x,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await tw(),H(!1);return}G(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),G("Failed to save connection")}},tM=async e=>{try{(await fetch(`/api/providers/${es.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tw(),Y(!1))}catch(e){console.log("Error updating connection:",e)}},tz=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&g(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},tU=async(e,t)=>{let s=[...f];[s[e],s[t]]=[s[t],s[e]],g(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tw()}},tq=f.length>0&&y.length===f.length,t_=(0,a.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:f.map((e,t)=>(0,a.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,a.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,a.jsx)("input",{type:"checkbox",checked:y.includes(e.id),onChange:()=>{var t;return t=e.id,void k(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(D,{connection:e,isOAuth:te,isFirst:0===t,isLast:t===f.length-1,onMoveUp:()=>tU(t,t-1),onMoveDown:()=>tU(t,t+1),onToggleActive:t=>tz(e.id,t),autoPing:J[x]&&"oauth"===e.authType?{on:!0===eN.connections[e.id],onToggle:t=>{var s;return s=e.id,void tS({...eN,connections:{...eN.connections,[s]:t}})},provider:x}:null,onEdit:()=>{ea(e),Y(!0)},onDelete:()=>tP(e.id),oneByOneStatus:eL[e.id]||null})})]},e.id))}),tF=async e=>{if(!ex.has(e)){eh(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${tu}/${e}`})}),s=await t.json();em(t=>({...t,[e]:s.ok?"ok":"error"})),eu(s.ok?"":s.error||"Model not reachable")}catch{em(t=>({...t,[e]:"error"})),eu("Network error")}finally{eh(t=>{let s=new Set(t);return s.delete(e),s})}}};return A?(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(d.Qv,{}),(0,a.jsx)(d.Qv,{})]}):e9?(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)(r(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${e9.color}15`},children:eo?(0,a.jsx)("span",{className:"text-sm font-bold",style:{color:e9.color},children:e9.textIcon||e9.id.slice(0,2).toUpperCase()}):(0,a.jsx)(o.default,{src:tl&&e9.apiType?"responses"===e9.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tn?"/providers/anthropic-m.png":`/providers/${e9.id}.png`,alt:e9.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>ed(!0)})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,a.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:e9.name}),(e9.notice?.apiKeyUrl||e9.notice?.signupUrl||e9.website)&&(0,a.jsxs)("a",{href:e9.notice?.apiKeyUrl||e9.notice?.signupUrl||e9.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),e9.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:[f.length," connection",1===f.length?"":"s"]})]})]})]}),e9.deprecated&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:e9.deprecationNotice})]}),e9.notice?.text&&!e9.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:e9.notice.text}),e9.notice.apiKeyUrl&&(0,a.jsx)("a",{href:e9.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 →"})]}),tr&&E&&(0,a.jsx)(d.Zp,{children:(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:tn?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,a.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tn?"Messages API":"responses"===E.apiType?"Responses API":"Chat Completions"," \xb7 ",(E.baseUrl||"").replace(/\/$/,""),"/",tn?"messages":"responses"===E.apiType?"responses":"chat/completions"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>{G(""),H(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>et(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eP({title:"Delete Compatible Node",message:`Delete this ${tn?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eP(null);try{(await fetch(`/api/provider-nodes/${x}`,{method:"DELETE"})).ok&&u.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),ts?(0,a.jsx)(d.gw,{providerId:x}):(0,a.jsxs)(d.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[f.length>0&&(0,a.jsxs)(a.Fragment,{children:[y.length>0&&(0,a.jsxs)(d.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=y.length;0!==e&&eP({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{eP(null);let e=0,t=[...y];for(let s of t)try{(await fetch(`/api/providers/${s}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}g(e=>e.filter(e=>!t.includes(e.id))),k([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",y.length,")"]}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:tI,disabled:eM,children:eM?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eM&&(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eM&&(eW.current=!0,eq(!0))},disabled:eU,children:eU?"Stopping...":"Stop"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,a.jsx)(d.lM,{checked:"round-robin"===ey,onChange:e=>{let t=e?"round-robin":null,s=e?ev||"1":ev;e&&!ev&&ej("1"),eb(t),tN(t,s)}}),"round-robin"===ey&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,a.jsx)("input",{type:"number",min:1,value:ev,onChange:e=>{var t;ej(t=e.target.value),tN("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===f.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:te?"lock":"key"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),to&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",td," or ",tc,"."]})]})]}),(0,a.jsx)("div",{className:"flex gap-2",children:to?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e4,children:td}),(0,a.jsx)(d.$n,{size:"sm",icon:"key",onClick:e6,children:tc})]}):(0,a.jsxs)(a.Fragment,{children:[!tr&&"iflow"===x&&(0,a.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>B(!0),children:"Cookie"}),"codex"===x&&(0,a.jsx)(d.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Z(!0),children:(0,w.Tl)("Bulk Add")}),(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:e7,children:tr?"Add API Key":"iflow"===x?"OAuth":"Add Connection"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[eJ&&(0,a.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("span",{children:["Total: ",eJ.total]}),(0,a.jsxs)("span",{children:["Completed: ",eJ.completed]}),(0,a.jsxs)("span",{children:["Passed: ",eJ.passed]}),(0,a.jsxs)("span",{children:["Failed: ",eJ.failed]}),eJ.stopped&&(0,a.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),eM&&e_&&(0,a.jsxs)("span",{children:["Running: ",f.find(e=>e.id===e_)?.name||e_]})]})}),f.length>0&&(0,a.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,a.jsx)("input",{type:"checkbox",checked:tq,onChange:()=>{tq?k([]):k(f.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),t_,!tr&&(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===x&&(0,a.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>B(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===x&&(0,a.jsx)(d.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Z(!0),title:(0,w.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,w.Tl)("Bulk Add")}),to?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e4,className:"w-full sm:w-auto",children:td}),(0,a.jsx)(d.$n,{size:"sm",icon:"key",onClick:e6,className:"w-full sm:w-auto",children:tc})]}):(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:e7,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,a.jsxs)(d.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),tp&&(0,a.jsx)("select",{value:ew,onChange:e=>{var t;ek(t=e.target.value),tC(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:tp.map(e=>(0,a.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!tr&&(e=[...ta,...eA.filter(e=>!ta.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!eO.includes(e)),t=f.some(e=>!1!==e.isActive),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[t&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:eH?"progress_activity":"cloud_download",onClick:tE,disabled:eH,children:eH?"Importing...":"Import models"}),t&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"science",onClick:()=>eX(e=>!e),children:eZ?"Hide verify":"Verify models"}),eO.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tb,children:"Active All"}),e.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>ty(e),children:"Disable All"})]}))]}),!!ep&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:ep}),eG&&(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:eG}),eZ&&(s=f.find(e=>y.includes(e.id)&&!1!==e.isActive)||f.find(e=>!1!==e.isActive),n=[...C({customModels:en,modelAliases:ei,providerAlias:tu,builtInModels:ta,type:"llm"}).map(e=>({id:e.id,name:e.name||e.id,kind:"llm"})),...ta.filter(e=>{let t=(0,m.CP)(e);return(!t||"llm"===t)&&!eO.includes(e.id)}).map(e=>({id:e.id,name:e.name||e.id,kind:"llm"}))],(0,a.jsx)(L,{connectionId:s?.id,providerAlias:tu,models:n,onClose:()=>eX(!1),onLatencyMap:e=>e0(t=>({...t,...e})),onComplete:async e=>{e?.removed>0&&await tj()}})),(()=>{let e,t,s;if(tr)return(0,a.jsx)(I,{providerStorageAlias:tu,providerDisplayAlias:tx,modelAliases:ei,customModels:en,copied:e1,onCopy:e2,onSetAlias:t$,onDeleteAlias:tA,onAddCustomModel:e=>tT(e,"llm",tu),onDeleteCustomModel:e=>tO(e,"llm",tu),onRefreshModels:tj,connections:f,isAnthropic:tn});let i=[...ta,...eA.filter(e=>!ta.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}),l=new Set(eO),n=i.filter(e=>!l.has(e.id)),r=i.filter(e=>l.has(e.id)),o=C({customModels:en,modelAliases:ei,providerAlias:tu,builtInModels:ta,type:"llm"});return(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o.map(e=>(0,a.jsx)(O,{model:{id:e.id,name:e.name},fullModel:`${tx}/${e.id}`,alias:e.alias,copied:e1,onCopy:e2,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tO(e.id,"llm",tu):tA(e.alias)},testStatus:ec[e.id],onTest:f.length>0||ts?()=>tF(e.id):void 0,isTesting:ex.has(e.id),isCustom:!0,isFree:!1,caps:h(`${x}/${e.id}`),thinkingSuffix:tm(e.id),latencyMs:eY[e.id]??eY[K(e.id,tu)]},`${e.source}-${e.fullModel}`)),n.map(e=>{let t=`${tu}/${e.id}`,s=`${x}/${e.id}`,i=Object.entries(ei).find(([,e])=>e===t||e===s)?.[0];return(0,a.jsx)(O,{model:e,fullModel:`${tx}/${e.id}`,alias:i,copied:e1,onSetAlias:t=>t$(e.id,t,tu),onCopy:e2,onDeleteAlias:()=>tA(i),testStatus:ec[e.id],onTest:f.length>0||ts?()=>tF(e.id):void 0,isTesting:ex.has(e.id),isFree:e.isFree,onDisable:()=>tf(e.id),caps:h(`${x}/${e.id}`),thinkingSuffix:tm(e.id),latencyMs:eY[e.id]??eY[K(e.id,tu)]},e.id)}),(0,a.jsxs)("button",{onClick:()=>eg(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),eS.length>0&&(e=new Set([...Object.values(ei),...o.map(e=>e.fullModel)]),t=new Set(ta.map(e=>e.id)),0===(s=eS.filter(s=>!e.has(`${tu}/${s.id}`)&&!t.has(s.id))).length?null:(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,a.jsxs)("button",{onClick:async()=>{await tT(e.id,"llm",tu)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),r.length>0&&(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",r.length,"):"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:r.map(e=>(0,a.jsxs)("button",{onClick:()=>tg(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),"kiro"===x?(0,a.jsx)(d.Mh,{isOpen:R,providerInfo:e9,onSuccess:tR,onClose:()=>M(!1)}):"cursor"===x?(0,a.jsx)(d.G9,{isOpen:R,onSuccess:tR,onClose:()=>M(!1)}):"gitlab"===x?(0,a.jsx)(d.vj,{isOpen:R,providerInfo:e9,onSuccess:tR,onClose:()=>M(!1)}):(0,a.jsx)(d.LF,{isOpen:R,provider:x,providerInfo:e9,onSuccess:tR,onClose:()=>M(!1)}),"iflow"===x&&(0,a.jsx)(d.vE,{isOpen:_,onSuccess:()=>{tw(),B(!1)},onClose:()=>B(!1)}),(0,a.jsx)(z,{isOpen:W,provider:x,providerName:e9.name,isCompatible:tr,isAnthropic:tn,authType:e9?.authType,authHint:e9?.authHint,website:e9?.website,error:V,onSave:tD,onBulkDone:tw,onClose:()=>{G(""),H(!1)}}),(0,a.jsx)(d.wI,{isOpen:X,connection:es,onSave:tM,onClose:()=>Y(!1)}),tr&&(0,a.jsx)(U,{isOpen:ee,node:E,onSave:tk,onClose:()=>et(!1),isAnthropic:tn}),!tr&&(0,a.jsx)(q,{isOpen:ef,providerAlias:tu,providerDisplayAlias:tx,onSave:async e=>{await tT(e,"llm",tu),eg(!1)},onClose:()=>eg(!1)}),"codex"===x&&(0,a.jsx)(F,{isOpen:Q,onClose:()=>Z(!1),onSuccess:tw}),(0,a.jsx)(d.uo,{isOpen:eR,onClose:()=>eD(!1),onConfirm:()=>{(window.localStorage.setItem(e5,"true"),eD(!1),te)?e3():e6()},title:"Risk Notice",message:e9?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,a.jsx)(d.uo,{isOpen:!!eI,onClose:()=>eP(null),onConfirm:eI?.onConfirm,title:eI?.title||"Confirm",message:eI?.message,variant:"danger"})]}):(0,a.jsxs)("div",{className:"text-center py-20",children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,a.jsx)(r(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}},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})}},e=>{e.O(0,[2574,3862,1610,2562,5772,1321,705,5497,8441,3794,7358],()=>e(e.s=500)),_N_E=e.O()}]);
10
+ ]`;function F({isOpen:e,onClose:t,onSuccess:s}){let[l,n]=(0,i.useState)(""),[r,o]=(0,i.useState)(!1),[c,m]=(0,i.useState)(""),[p,u]=(0,i.useState)(null),x=()=>{r||(n(""),m(""),u(null),t())},h=async()=>{var e;let t;m(""),u(null);let a=l.trim();if(!a)return;try{t=JSON.parse(a)}catch(e){m(`${(0,w.Tl)("Invalid JSON")}: ${e.message}`);return}let i=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!i||0===i.length)return void m((0,w.Tl)("No accounts found in input"));o(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:i})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);u(t),t.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,w.Tl)("Request failed"))}finally{o(!1)}},f=p?.results?.filter(e=>!e.ok)||[];return(0,a.jsx)(d.aF,{isOpen:e,title:(0,w.Tl)("Bulk Add Codex Accounts"),onClose:x,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:(0,w.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:_,value:l,onChange:e=>n(e.target.value),disabled:r}),c&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:c}),p&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,w.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,w.Tl)("failed")}`:""]}),f.length>0&&(0,a.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:f.map(e=>(0,a.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:h,fullWidth:!0,disabled:r||!l.trim(),children:r?(0,w.Tl)("Importing..."):(0,w.Tl)("Import All")}),(0,a.jsx)(d.$n,{onClick:x,variant:"ghost",fullWidth:!0,disabled:r,children:(0,w.Tl)("Close")})]})]})})}F.propTypes={isOpen:T().bool.isRequired,onClose:T().func.isRequired,onSuccess:T().func};function L({connectionId:e,providerAlias:t,models:s,onComplete:l,onLatencyMap:n,onClose:r}){let[o,c]=(0,i.useState)(4),[m,p]=(0,i.useState)(50),[u,x]=(0,i.useState)(Math.round(20)),[h,f]=(0,i.useState)(!1),[g,y]=(0,i.useState)(null),[b,v]=(0,i.useState)(null),[j,w]=(0,i.useState)(""),[k,N]=(0,i.useState)(""),C=(0,i.useRef)(!1),S=(0,i.useRef)(null),$=s?.length||0,A=(0,i.useMemo)(()=>`max concurrency 16 \xb7 batch 200 \xb7 timeout ${60}s`,[]);async function T(){if(h||!e||0===$)return;C.current=!1,f(!0),w(""),v(null),N("Preparing…");let a={concurrency:Math.max(1,Math.min(16,Number(o)||4)),batchSize:Math.max(1,Math.min(200,Number(m)||50)),timeoutMs:Math.max(1e3,Math.min(6e4,1e3*(Number(u)||20)))},i={};try{let r=await fetch(`/api/providers/${e}/model-probes/prepare`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:s,providerAlias:t,concurrency:a.concurrency,batchSize:a.batchSize,timeoutMs:a.timeoutMs})}),o=await r.json().catch(()=>({}));if(!r.ok)return void w(o.error||"Prepare failed");let d=o.eligible||[],c=o.stats?.skippedDead||0,m=o.stats?.duplicates||0;if(y({done:0,total:d.length,ok:0,dead:0,retryable:0,skippedDead:c,skippedDup:m}),0===d.length){let e={ok:0,dead:0,retryable:0,tested:0,skippedDead:c,skippedDup:m,removed:0};v(e),N("Nothing to test (all skipped as known-unavailable or empty)."),l?.(e);return}let p=0,u=0,x=0,h=0;for(let s=0;s<d.length&&!C.current;s+=a.batchSize){let l=d.slice(s,s+a.batchSize);N(`Probing ${h+1}–${Math.min(h+l.length,d.length)} of ${d.length}…`),S.current=new AbortController;let n=await fetch(`/api/providers/${e}/model-probes/batch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:S.current.signal,body:JSON.stringify({models:l,providerAlias:t,concurrency:a.concurrency,batchSize:a.batchSize,timeoutMs:a.timeoutMs,warmup:0===s})}),r=await n.json().catch(()=>({}));if(r.providerError){w(r.error||"Provider authentication failed");break}if(!n.ok){w(r.error||"Batch failed");break}for(let e of r.results||[])"ok"===e.probeStatus?(p+=1,e.modelId&&Number.isFinite(e.latencyMs)&&(i[e.modelId]=e.latencyMs),e.canonicalId&&Number.isFinite(e.latencyMs)&&(i[e.canonicalId]=e.latencyMs)):"dead"===e.probeStatus?u+=1:x+=1;h+=(r.results||[]).length,y({done:h,total:d.length,ok:p,dead:u,retryable:x,skippedDead:c,skippedDup:m})}n?.(i);let f={ok:p,dead:u,retryable:x,tested:h,skippedDead:c,skippedDup:m,cancelled:C.current};v(f),N(C.current?"Cancelled (partial results saved).":"Done."),l?.(f)}catch(e){e?.name==="AbortError"?N("Cancelled."):w(e?.message||"Verify failed")}finally{f(!1),S.current=null}}async function O(){if(!e)return;N("Removing unavailable custom models…");let s=await fetch(`/api/providers/${e}/model-probes/remove-unavailable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:t,kind:"llm"})}),a=await s.json().catch(()=>({}));s.ok?(N(`Removed ${a.removed||0} unavailable custom model(s).`),l?.({...b||{},removed:a.removed||0})):w(a.error||"Remove failed")}async function E(){if(!e)return;let t=await fetch(`/api/providers/${e}/model-probes/cache`,{method:"DELETE"}),s=await t.json().catch(()=>({}));t.ok?(N(`Cleared probe cache (${s.cleared||0} rows). Next verify will re-test everything.`),v(null),y(null)):w(s.error||"Clear cache failed")}let I=g?.total?Math.min(100,Math.round(g.done/g.total*100)):0;return(0,a.jsxs)("div",{className:"mb-4 rounded-lg border border-border bg-sidebar/40 p-3 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Verify models"}),(0,a.jsxs)("p",{className:"text-[11px] text-text-muted mt-0.5",children:["Batch-ping availability and latency. Known-dead models are skipped until you clear the cache. Caps: ",A,"."]})]}),r&&(0,a.jsx)("button",{type:"button",onClick:r,className:"p-1 text-text-muted hover:text-text-main rounded",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-3 items-end",children:[(0,a.jsxs)("label",{className:"text-xs text-text-muted",children:["Concurrency",(0,a.jsx)("input",{type:"number",min:1,max:16,value:o,disabled:h,onChange:e=>c(e.target.value),className:"mt-1 block w-20 rounded-md border border-border bg-background px-2 py-1 text-xs"})]}),(0,a.jsxs)("label",{className:"text-xs text-text-muted",children:["Batch size",(0,a.jsx)("input",{type:"number",min:1,max:200,value:m,disabled:h,onChange:e=>p(e.target.value),className:"mt-1 block w-20 rounded-md border border-border bg-background px-2 py-1 text-xs"})]}),(0,a.jsxs)("label",{className:"text-xs text-text-muted",children:["Timeout (s)",(0,a.jsx)("input",{type:"number",min:1,max:60,value:u,disabled:h,onChange:e=>x(e.target.value),className:"mt-1 block w-20 rounded-md border border-border bg-background px-2 py-1 text-xs"})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[h?(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"stop",onClick:function(){C.current=!0,S.current?.abort()},children:"Cancel"}):(0,a.jsx)(d.$n,{size:"sm",icon:"science",onClick:T,disabled:!e||0===$,children:"Start"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete_sweep",onClick:E,disabled:h,children:"Clear cache"})]})]}),g&&(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("div",{className:"h-1.5 w-full rounded-full bg-border overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-primary transition-all",style:{width:`${I}%`}})}),(0,a.jsxs)("p",{className:"text-[11px] text-text-muted",children:[g.done,"/",g.total," tested \xb7 ok ",g.ok," \xb7 dead ",g.dead," \xb7 retry ",g.retryable,g.skippedDead?` \xb7 skipped dead ${g.skippedDead}`:"",g.skippedDup?` \xb7 dupes ${g.skippedDup}`:""]})]}),k&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:k}),j&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:j}),b&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:[(0,a.jsxs)("span",{className:"text-xs text-text-main",children:["Summary: ",b.ok," ok \xb7 ",b.dead," unavailable \xb7 ",b.retryable," retry later",b.skippedDead?` \xb7 ${b.skippedDead} skipped (known dead)`:"",b.cancelled?" \xb7 cancelled":""]}),b.dead>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:O,disabled:h,children:"Remove unavailable custom"})]})]})}function K(e,t=""){let s=String(e||"").trim();if(!s)return"";s=(s=s.replace(/\s+/g,"")).replace(/^models\//i,"");let a=String(t||"").trim();return a&&s.toLowerCase().startsWith(`${a.toLowerCase()}/`)&&(s=s.slice(a.length+1)),(s=s.replace(/\/{2,}/g,"/").replace(/^\/+|\/+$/g,"")).toLowerCase()}L.propTypes={connectionId:T().string,providerAlias:T().string,models:T().arrayOf(T().object),onComplete:T().func,onLatencyMap:T().func,onClose:T().func};let J={claude:"claudeAutoPing",codex:"codexAutoPing"};function B(){let e,t,s,n,p=(0,l.useParams)(),u=(0,l.useRouter)(),x=p.id,{getCaps:h}=(0,j.y)(),[f,g]=(0,i.useState)([]),[y,k]=(0,i.useState)([]),[A,T]=(0,i.useState)(!0),[E,P]=(0,i.useState)(null),[R,M]=(0,i.useState)(!1),[_,B]=(0,i.useState)(!1),[W,H]=(0,i.useState)(!1),[V,G]=(0,i.useState)(""),[Q,Z]=(0,i.useState)(!1),[X,Y]=(0,i.useState)(!1),[ee,et]=(0,i.useState)(!1),[es,ea]=(0,i.useState)(null),[ei,el]=(0,i.useState)({}),[en,er]=(0,i.useState)([]),[eo,ed]=(0,i.useState)(!1),[ec,em]=(0,i.useState)({}),[ep,eu]=(0,i.useState)(""),[ex,eh]=(0,i.useState)(()=>new Set),[ef,eg]=(0,i.useState)(!1),[ey,eb]=(0,i.useState)(null),[ev,ej]=(0,i.useState)(""),[ew,ek]=(0,i.useState)("auto"),[eN,eC]=(0,i.useState)({enabled:!1,connections:{}}),[eS,e$]=(0,i.useState)([]),[eA,eT]=(0,i.useState)([]),[eO,eE]=(0,i.useState)([]),[eI,eP]=(0,i.useState)(null),[eR,eD]=(0,i.useState)(!1),[eM,ez]=(0,i.useState)(!1),[eU,eq]=(0,i.useState)(!1),[e_,eF]=(0,i.useState)(null),[eL,eK]=(0,i.useState)({}),[eJ,eB]=(0,i.useState)(null),eW=(0,i.useRef)(!1),[eH,eV]=(0,i.useState)(!1),[eG,eQ]=(0,i.useState)(""),[eZ,eX]=(0,i.useState)(!1),[eY,e0]=(0,i.useState)({}),{copied:e1,copy:e2}=(0,v.C)(),e5="ag_risk_confirmed",e3=()=>{M(!0)},e4=()=>{"antigravity"===x&&"true"!==window.localStorage.getItem(e5)?eD(!0):te?e3():(G(""),H(!0))},e6=()=>{G(""),H(!0)},e7=()=>{te?e4():e6()},e9=E?{id:E.id,name:E.name||("anthropic-compatible"===E.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===E.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===E.type?"AC":"OC",apiType:E.apiType,baseUrl:E.baseUrl,type:E.type}:c.zN[x]||c.fg[x]||c.IS[x]||c.nJ[x]||c.br[x],e8=e9?.authModes||[],te=!!c.zN[x]||!!c.IS[x]||e8.includes("oauth"),tt=!!c.fg[x]||e8.includes("apikey"),ts=!!c.IS[x]?.noAuth,ta=(0,m.KC)(x),ti=(0,c.wG)(x),tl=(0,c.mq)(x),tn=(0,c.gb)(x),tr=tl||tn,to=!tr&&te&&tt,td="xai"===x?"Grok Build OAuth":"OAuth",tc="xai"===x?"xAI API Key":"API Key",tm=e=>{if(!ew||"auto"===ew)return null;let t=b(x,e);return t&&t.includes(ew)?ew:null},tp=(()=>{let e=new Set;for(let t of ta){let s=b(x,t.id);s&&s.forEach(t=>{"none"!==t&&e.add(t)})}return e.size?["auto",...e]:null})(),tu=tr?x:ti,tx=tr?E?.prefix||x:ti,th=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tu)}`,{cache:"no-store"}),t=await e.json();e.ok&&eE(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tu]),tf=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tu,ids:[e]})})).ok&&await th()}catch(e){console.log("Error disabling model:",e)}},tg=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tu)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await th()}catch(e){console.log("Error enabling model:",e)}},ty=async e=>{e.length&&eP({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eP(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tu,ids:e})})).ok&&await th()}catch(e){console.log("Error disabling all models:",e)}}})},tb=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tu)}`,{method:"DELETE"})).ok&&await th()}catch(e){console.log("Error enabling all models:",e)}},tv=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&el(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tj=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&er(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,i.useEffect)(()=>{"kilocode"===x&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eT(e.models)}).catch(()=>{})},[x]);let tw=(0,i.useCallback)(async()=>{try{let[e,t,s]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),a=await e.json(),i=await t.json(),l=s.ok?await s.json():{};if(e.ok){let e=(a.connections||[]).filter(e=>e.provider===x);g(e)}let n=(l.providerStrategies||{})[x]||{};eb(n.fallbackStrategy||null),ej(null!=n.stickyRoundRobinLimit?String(n.stickyRoundRobinLimit):"1");let r=(l.providerThinking||{})[x]||{};ek(r.mode||"auto");let o=J[x],d=o&&l[o]||{};if(eC({enabled:!0===d.enabled,connections:d.connections||{}}),t.ok){let e=(i.nodes||[]).find(e=>e.id===x)||null;if(!e&&tr)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===x)||null))break}P(e)}}catch(e){console.log("Error fetching connections:",e)}finally{T(!1)}},[x,tr]),tk=async e=>{try{let t=await fetch(`/api/provider-nodes/${x}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(P(s.node),await tw(),et(!1))}catch(e){console.log("Error updating provider node:",e)}},tN=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a=(s.ok?await s.json():{}).providerStrategies||{},i={};e&&(i.fallbackStrategy=e),"round-robin"===e&&""!==t&&(i.stickyRoundRobinLimit=Number(t)||3);let l={...a};0===Object.keys(i).length?delete l[x]:l[x]=i,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}},tC=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?s[x]={mode:e}:delete s[x],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:s})})}catch(e){console.log("Error saving thinking config:",e)}},tS=async e=>{let t=J[x];if(t){eC(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})})}catch(e){console.log("Error saving auto-ping config:",e)}}};(0,i.useEffect)(()=>{tw(),tv(),tj(),th()},[tw,tv,tj,th]),(0,i.useEffect)(()=>{let e=(c.zN[x]||c.fg[x]||c.IS[x]||c.nJ[x])?.modelsFetcher;e&&N(e).then(e$)},[x]);let t$=async(e,t,s=ti)=>{let a=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})});if(e.ok)await tv();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tA=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tv()}catch(e){console.log("Error deleting alias:",e)}},tT=async(e,t="llm",s=tu)=>{try{let a=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t})});if(a.ok)await tj(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await a.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tO=async(e,t="llm",s=tu)=>{try{let a=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${a}`,{method:"DELETE"})).ok&&(await tj(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tE=async()=>{if(eH)return;let e=f.find(e=>y.includes(e.id)&&!1!==e.isActive)||f.find(e=>!1!==e.isActive);if(!e)return void alert((0,w.Tl)("Add an active connection first"));eV(!0),eQ("");try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json().catch(()=>({}));if(!t.ok)return void alert(s.error||(0,w.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void alert(s.warning||(0,w.Tl)("No models returned"));let i=new Set;try{let t=await fetch(`/api/providers/${e.id}/model-probes/prepare`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:a.map(e=>"string"==typeof e?{id:e}:{id:e.id||e.name||e.model,kind:e.kind||e.type||"llm"}),providerAlias:tu})});if(t.ok){let e=await t.json();i=new Set((e.skippedDead||[]).map(e=>e.canonicalId||e.id))}}catch{}let l=new Set(ta.map(e=>e.id)),n=[],r=[],o=new Set,d=0;for(let e of a){let t=function(e,t){if(null==e)return null;if("string"==typeof e){let s=$(e,t);return s?{id:s,name:s,type:S(s)}:null}let s=e.id||e.name||e.model||e.slug;if(!s)return null;let a=$(s,t);if(!a)return null;let i=e.display_name||e.displayName||e.name||e.title||a;return{id:a,name:String(i),type:S(a,e)}}(e,tu);if(!t)continue;let{id:s,name:a,type:c}=t,m=`${c}|${s}`;if(o.has(m))continue;o.add(m);let p=K(s,tu);if(i.has(p)||i.has(s)){d+=1;continue}if(l.has(s)){eO.includes(s)&&r.push(s);continue}if(en.some(e=>e.providerAlias===tu&&e.id===s&&(e.kind||e.type||"llm")===c))continue;let u=`${tu}/${s}`;Object.values(ei).includes(u)||n.push({providerAlias:tu,id:s,type:c,name:a})}let c=0;if(r.length>0)try{for(let e of r)(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tu)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&(c+=1);await th()}catch{}let m=0;if(n.length>0){let e=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({models:n})}),t=await e.json().catch(()=>({}));if(!e.ok)return void alert(t.error||(0,w.Tl)("Failed to save models"));m=t.added??n.length,await tj(),window.dispatchEvent(new CustomEvent("customModelChanged"))}let p=n.filter(e=>"llm"!==e.type).length,u=[];if(m>0&&u.push(`${m} new`),c>0&&u.push(`${c} re-enabled`),d>0&&u.push(`${d} skipped (known-unavailable)`),0===u.length)eQ((0,w.Tl)("All models already in list"));else{let e=`Imported ${u.join(" \xb7 ")} (${a.length} from provider)`;p>0&&(e+=" \xb7 non-chat types stored for media pages"),s.warning&&(e+=` \xb7 ${s.warning}`),eQ(e)}}catch(e){console.log("Error importing models:",e),alert((0,w.Tl)("Error fetching models")+": "+(e?.message||e))}finally{eV(!1)}},tI=async()=>{if(eM||0===f.length)return;let e=Object.fromEntries(f.map(e=>[e.id,{state:"queued",error:null}]));eW.current=!1,ez(!0),eq(!1),eF(null),eK(e),eB({total:f.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<f.length;e+=1){if(eW.current){eB({total:f.length,completed:e,passed:t,failed:s,stopped:!0});break}let a=f[e];eF(a.id),eK(e=>({...e,[a.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${a.id}/test`,{method:"POST"}),i=await e.json(),l=!!i.valid;l?t+=1:s+=1,eK(e=>({...e,[a.id]:{state:l?"success":"failed",error:l?null:i.error||null}}))}catch(e){s+=1,eK(t=>({...t,[a.id]:{state:"failed",error:e.message||"Test failed"}}))}eB({total:f.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<f.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{eF(null),ez(!1),eq(!1),eW.current=!1}},tP=async e=>{eP({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eP(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&g(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tR=()=>{tw(),M(!1)},tD=async e=>{G("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:x,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await tw(),H(!1);return}G(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),G("Failed to save connection")}},tM=async e=>{try{(await fetch(`/api/providers/${es.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tw(),Y(!1))}catch(e){console.log("Error updating connection:",e)}},tz=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&g(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},tU=async(e,t)=>{let s=[...f];[s[e],s[t]]=[s[t],s[e]],g(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tw()}},tq=f.length>0&&y.length===f.length,t_=(0,a.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:f.map((e,t)=>(0,a.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,a.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,a.jsx)("input",{type:"checkbox",checked:y.includes(e.id),onChange:()=>{var t;return t=e.id,void k(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(D,{connection:e,isOAuth:te,isFirst:0===t,isLast:t===f.length-1,onMoveUp:()=>tU(t,t-1),onMoveDown:()=>tU(t,t+1),onToggleActive:t=>tz(e.id,t),autoPing:J[x]&&"oauth"===e.authType?{on:!0===eN.connections[e.id],onToggle:t=>{var s;return s=e.id,void tS({...eN,connections:{...eN.connections,[s]:t}})},provider:x}:null,onEdit:()=>{ea(e),Y(!0)},onDelete:()=>tP(e.id),oneByOneStatus:eL[e.id]||null})})]},e.id))}),tF=async e=>{if(!ex.has(e)){eh(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${tu}/${e}`})}),s=await t.json();em(t=>({...t,[e]:s.ok?"ok":"error"})),eu(s.ok?"":s.error||"Model not reachable")}catch{em(t=>({...t,[e]:"error"})),eu("Network error")}finally{eh(t=>{let s=new Set(t);return s.delete(e),s})}}};return A?(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(d.Qv,{}),(0,a.jsx)(d.Qv,{})]}):e9?(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)(r(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${e9.color}15`},children:eo?(0,a.jsx)("span",{className:"text-sm font-bold",style:{color:e9.color},children:e9.textIcon||e9.id.slice(0,2).toUpperCase()}):(0,a.jsx)(o.default,{src:tl&&e9.apiType?"responses"===e9.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tn?"/providers/anthropic-m.png":`/providers/${e9.id}.png`,alt:e9.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>ed(!0)})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,a.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:e9.name}),(e9.notice?.apiKeyUrl||e9.notice?.signupUrl||e9.website)&&(0,a.jsxs)("a",{href:e9.notice?.apiKeyUrl||e9.notice?.signupUrl||e9.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),e9.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:[f.length," connection",1===f.length?"":"s"]})]})]})]}),e9.deprecated&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:e9.deprecationNotice})]}),e9.notice?.text&&!e9.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:e9.notice.text}),e9.notice.apiKeyUrl&&(0,a.jsx)("a",{href:e9.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 →"})]}),tr&&E&&(0,a.jsx)(d.Zp,{children:(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:tn?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,a.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tn?"Messages API":"responses"===E.apiType?"Responses API":"Chat Completions"," \xb7 ",(E.baseUrl||"").replace(/\/$/,""),"/",tn?"messages":"responses"===E.apiType?"responses":"chat/completions"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>{G(""),H(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>et(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eP({title:"Delete Compatible Node",message:`Delete this ${tn?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eP(null);try{(await fetch(`/api/provider-nodes/${x}`,{method:"DELETE"})).ok&&u.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),ts?(0,a.jsx)(d.gw,{providerId:x}):(0,a.jsxs)(d.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[f.length>0&&(0,a.jsxs)(a.Fragment,{children:[y.length>0&&(0,a.jsxs)(d.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=y.length;0!==e&&eP({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{eP(null);let e=0,t=[...y];for(let s of t)try{(await fetch(`/api/providers/${s}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}g(e=>e.filter(e=>!t.includes(e.id))),k([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",y.length,")"]}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:tI,disabled:eM,children:eM?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eM&&(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eM&&(eW.current=!0,eq(!0))},disabled:eU,children:eU?"Stopping...":"Stop"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,a.jsx)(d.lM,{checked:"round-robin"===ey,onChange:e=>{let t=e?"round-robin":null,s=e?ev||"1":ev;e&&!ev&&ej("1"),eb(t),tN(t,s)}}),"round-robin"===ey&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,a.jsx)("input",{type:"number",min:1,value:ev,onChange:e=>{var t;ej(t=e.target.value),tN("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===f.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:te?"lock":"key"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),to&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",td," or ",tc,"."]})]})]}),(0,a.jsx)("div",{className:"flex gap-2",children:to?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e4,children:td}),(0,a.jsx)(d.$n,{size:"sm",icon:"key",onClick:e6,children:tc})]}):(0,a.jsxs)(a.Fragment,{children:[!tr&&"iflow"===x&&(0,a.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>B(!0),children:"Cookie"}),"codex"===x&&(0,a.jsx)(d.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Z(!0),children:(0,w.Tl)("Bulk Add")}),(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:e7,children:tr?"Add API Key":"iflow"===x?"OAuth":"Add Connection"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[eJ&&(0,a.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("span",{children:["Total: ",eJ.total]}),(0,a.jsxs)("span",{children:["Completed: ",eJ.completed]}),(0,a.jsxs)("span",{children:["Passed: ",eJ.passed]}),(0,a.jsxs)("span",{children:["Failed: ",eJ.failed]}),eJ.stopped&&(0,a.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),eM&&e_&&(0,a.jsxs)("span",{children:["Running: ",f.find(e=>e.id===e_)?.name||e_]})]})}),f.length>0&&(0,a.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,a.jsx)("input",{type:"checkbox",checked:tq,onChange:()=>{tq?k([]):k(f.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),t_,!tr&&(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===x&&(0,a.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>B(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===x&&(0,a.jsx)(d.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Z(!0),title:(0,w.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,w.Tl)("Bulk Add")}),to?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e4,className:"w-full sm:w-auto",children:td}),(0,a.jsx)(d.$n,{size:"sm",icon:"key",onClick:e6,className:"w-full sm:w-auto",children:tc})]}):(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:e7,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,a.jsxs)(d.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),tp&&(0,a.jsx)("select",{value:ew,onChange:e=>{var t;ek(t=e.target.value),tC(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:tp.map(e=>(0,a.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!tr&&(e=[...ta,...eA.filter(e=>!ta.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!eO.includes(e)),t=f.some(e=>!1!==e.isActive),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[t&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:eH?"progress_activity":"cloud_download",onClick:tE,disabled:eH,children:eH?"Importing...":"Import models"}),t&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"science",onClick:()=>eX(e=>!e),children:eZ?"Hide verify":"Verify models"}),eO.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tb,children:"Active All"}),e.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>ty(e),children:"Disable All"})]}))]}),!!ep&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:ep}),eG&&(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:eG}),eZ&&(s=f.find(e=>y.includes(e.id)&&!1!==e.isActive)||f.find(e=>!1!==e.isActive),n=[...C({customModels:en,modelAliases:ei,providerAlias:tu,builtInModels:ta,type:"llm"}).map(e=>({id:e.id,name:e.name||e.id,kind:"llm"})),...ta.filter(e=>{let t=(0,m.CP)(e);return(!t||"llm"===t)&&!eO.includes(e.id)}).map(e=>({id:e.id,name:e.name||e.id,kind:"llm"}))],(0,a.jsx)(L,{connectionId:s?.id,providerAlias:tu,models:n,onClose:()=>eX(!1),onLatencyMap:e=>e0(t=>({...t,...e})),onComplete:async e=>{e?.removed>0&&await tj()}})),(()=>{let e,t,s;if(tr)return(0,a.jsx)(I,{providerStorageAlias:tu,providerDisplayAlias:tx,modelAliases:ei,customModels:en,copied:e1,onCopy:e2,onSetAlias:t$,onDeleteAlias:tA,onAddCustomModel:e=>tT(e,"llm",tu),onDeleteCustomModel:e=>tO(e,"llm",tu),onRefreshModels:tj,connections:f,isAnthropic:tn});let i=[...ta,...eA.filter(e=>!ta.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}),l=new Set(eO),n=i.filter(e=>!l.has(e.id)),r=i.filter(e=>l.has(e.id)),o=C({customModels:en,modelAliases:ei,providerAlias:tu,builtInModels:ta,type:"llm"});return(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o.map(e=>(0,a.jsx)(O,{model:{id:e.id,name:e.name},fullModel:`${tx}/${e.id}`,alias:e.alias,copied:e1,onCopy:e2,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tO(e.id,"llm",tu):tA(e.alias)},testStatus:ec[e.id],onTest:f.length>0||ts?()=>tF(e.id):void 0,isTesting:ex.has(e.id),isCustom:!0,isFree:!1,caps:h(`${x}/${e.id}`),thinkingSuffix:tm(e.id),latencyMs:eY[e.id]??eY[K(e.id,tu)]},`${e.source}-${e.fullModel}`)),n.map(e=>{let t=`${tu}/${e.id}`,s=`${x}/${e.id}`,i=Object.entries(ei).find(([,e])=>e===t||e===s)?.[0];return(0,a.jsx)(O,{model:e,fullModel:`${tx}/${e.id}`,alias:i,copied:e1,onSetAlias:t=>t$(e.id,t,tu),onCopy:e2,onDeleteAlias:()=>tA(i),testStatus:ec[e.id],onTest:f.length>0||ts?()=>tF(e.id):void 0,isTesting:ex.has(e.id),isFree:e.isFree,onDisable:()=>tf(e.id),caps:h(`${x}/${e.id}`),thinkingSuffix:tm(e.id),latencyMs:eY[e.id]??eY[K(e.id,tu)]},e.id)}),(0,a.jsxs)("button",{onClick:()=>eg(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),eS.length>0&&(e=new Set([...Object.values(ei),...o.map(e=>e.fullModel)]),t=new Set(ta.map(e=>e.id)),0===(s=eS.filter(s=>!e.has(`${tu}/${s.id}`)&&!t.has(s.id))).length?null:(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,a.jsxs)("button",{onClick:async()=>{await tT(e.id,"llm",tu)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),r.length>0&&(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",r.length,"):"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:r.map(e=>(0,a.jsxs)("button",{onClick:()=>tg(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),"kiro"===x?(0,a.jsx)(d.Mh,{isOpen:R,providerInfo:e9,onSuccess:tR,onClose:()=>M(!1)}):"cursor"===x?(0,a.jsx)(d.G9,{isOpen:R,onSuccess:tR,onClose:()=>M(!1)}):"gitlab"===x?(0,a.jsx)(d.vj,{isOpen:R,providerInfo:e9,onSuccess:tR,onClose:()=>M(!1)}):(0,a.jsx)(d.LF,{isOpen:R,provider:x,providerInfo:e9,onSuccess:tR,onClose:()=>M(!1)}),"iflow"===x&&(0,a.jsx)(d.vE,{isOpen:_,onSuccess:()=>{tw(),B(!1)},onClose:()=>B(!1)}),(0,a.jsx)(z,{isOpen:W,provider:x,providerName:e9.name,isCompatible:tr,isAnthropic:tn,authType:e9?.authType,authHint:e9?.authHint,website:e9?.website,error:V,onSave:tD,onBulkDone:tw,onClose:()=>{G(""),H(!1)}}),(0,a.jsx)(d.wI,{isOpen:X,connection:es,onSave:tM,onClose:()=>Y(!1)}),tr&&(0,a.jsx)(U,{isOpen:ee,node:E,onSave:tk,onClose:()=>et(!1),isAnthropic:tn}),!tr&&(0,a.jsx)(q,{isOpen:ef,providerAlias:tu,providerDisplayAlias:tx,onSave:async e=>{await tT(e,"llm",tu),eg(!1)},onClose:()=>eg(!1)}),"codex"===x&&(0,a.jsx)(F,{isOpen:Q,onClose:()=>Z(!1),onSuccess:tw}),(0,a.jsx)(d.uo,{isOpen:eR,onClose:()=>eD(!1),onConfirm:()=>{(window.localStorage.setItem(e5,"true"),eD(!1),te)?e3():e6()},title:"Risk Notice",message:e9?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,a.jsx)(d.uo,{isOpen:!!eI,onClose:()=>eP(null),onConfirm:eI?.onConfirm,title:eI?.title||"Confirm",message:eI?.message,variant:"danger"})]}):(0,a.jsxs)("div",{className:"text-center py-20",children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,a.jsx)(r(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}},7687:(e,t,s)=>{Promise.resolve().then(s.bind(s,3953))},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})}},e=>{e.O(0,[2574,3862,1610,2562,5772,1321,705,5497,8441,3794,7358],()=>e(e.s=7687)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9089],{15615:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>u});var a=t(95155),s=t(12115),i=t(73321),l=t(98500),d=t.n(l),o=t(35497),n=t(90620);let c=Object.values(n.Q2).map(e=>({value:e.id,label:e.name})),p=Object.values(n.MA).map(e=>({value:e.id,label:e.name}));function u(){let e=(0,i.useRouter)(),[r,t]=(0,s.useState)(!1),[l,u]=(0,s.useState)({provider:"",authMethod:"api_key",apiKey:"",displayName:"",isActive:!0}),[h,m]=(0,s.useState)({}),x=(e,r)=>{u(t=>({...t,[e]:r})),h[e]&&m(r=>({...r,[e]:null}))},b=async r=>{let a;if(r.preventDefault(),a={},l.provider||(a.provider="Please select a provider"),"api_key"!==l.authMethod||l.apiKey||(a.apiKey="API Key is required"),m(a),0===Object.keys(a).length){t(!0);try{let r=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(r.ok)e.push("/dashboard/providers");else{let e=await r.json();m({submit:e.error||"Failed to create provider"})}}catch(e){m({submit:"An error occurred. Please try again."})}finally{t(!1)}}},v=n.Q2[l.provider];return(0,a.jsxs)("div",{className:"max-w-2xl mx-auto",children:[(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsxs)(d(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:"Add New Provider"}),(0,a.jsx)("p",{className:"text-text-muted mt-2",children:"Configure a new AI provider to use with your applications."})]}),(0,a.jsx)(o.Zp,{children:(0,a.jsxs)("form",{onSubmit:b,className:"flex flex-col gap-6",children:[(0,a.jsx)(o.l6,{label:"Provider",options:c,value:l.provider,onChange:e=>x("provider",e.target.value),placeholder:"Select a provider",error:h.provider,required:!0}),v&&(0,a.jsxs)(o.Zp.Section,{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-10 rounded-lg flex items-center justify-center bg-bg border border-border",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:v.color},children:v.icon})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:v.name}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Selected provider"})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("label",{className:"text-sm font-medium",children:["Authentication Method ",(0,a.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,a.jsx)("div",{className:"flex gap-3",children:p.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>x("authMethod",e.value),className:`flex-1 flex items-center justify-center gap-2 p-4 rounded-lg border transition-all ${l.authMethod===e.value?"border-primary bg-primary/5 text-primary":"border-border hover:border-primary/50"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined",children:"api_key"===e.value?"key":"lock"}),(0,a.jsx)("span",{className:"font-medium",children:e.label})]},e.value))})]}),"api_key"===l.authMethod&&(0,a.jsx)(o.pd,{label:"API Key",type:"password",placeholder:"Enter your API key",value:l.apiKey,onChange:e=>x("apiKey",e.target.value),error:h.apiKey,hint:"Your API key will be encrypted and stored securely.",required:!0}),"oauth2"===l.authMethod&&(0,a.jsxs)(o.Zp.Section,{children:[(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Connect your account using OAuth2 authentication."}),(0,a.jsx)(o.$n,{type:"button",variant:"secondary",icon:"link",children:"Connect with OAuth2"})]}),(0,a.jsx)(o.pd,{label:"Display Name",placeholder:"e.g., Production API, Dev Environment",value:l.displayName,onChange:e=>x("displayName",e.target.value),hint:"Optional. A friendly name to identify this configuration."}),(0,a.jsx)(o.lM,{checked:l.isActive,onChange:e=>x("isActive",e),label:"Active",description:"Enable this provider for use in your applications"}),h.submit&&(0,a.jsx)("div",{className:"p-4 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 text-red-600 dark:text-red-400 text-sm",children:h.submit}),(0,a.jsxs)("div",{className:"flex gap-3 pt-4 border-t border-border",children:[(0,a.jsx)(d(),{href:"/dashboard/providers",className:"flex-1",children:(0,a.jsx)(o.$n,{type:"button",variant:"ghost",fullWidth:!0,children:"Cancel"})}),(0,a.jsx)(o.$n,{type:"submit",loading:r,fullWidth:!0,className:"flex-1",children:"Create Provider"})]})]})})]})}},80800:(e,r,t)=>{Promise.resolve().then(t.bind(t,15615))}},e=>{e.O(0,[2574,3862,1610,2562,1321,705,5497,8441,3794,7358],()=>e(e.s=80800)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{18964:(e,t,s)=>{"use strict";s.d(t,{default:()=>j});var r=s(95155),a=s(12115),l=s(14051),i=s.n(l),n=s(35497),o=s(57250),d=s(90620),c=s(88105),m=s(98500),p=s.n(m),x=s(65921),u=s(38003);let h={available:{icon:"check_circle",color:"#22c55e",label:"Available"},cooldown:{icon:"schedule",color:"#f59e0b",label:"Cooldown"},unavailable:{icon:"error",color:"#ef4444",label:"Unavailable"},unknown:{icon:"help",color:"#6b7280",label:"Unknown"}};function f(){let[e,t]=(0,a.useState)(null),[s,l]=(0,a.useState)(!0),[i,o]=(0,a.useState)(!1),[d,c]=(0,a.useState)(null),m=(0,a.useRef)(null),p=(0,x.i)(),u=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/availability");if(e.ok){let s=await e.json();t(s)}}catch{}finally{l(!1)}},[]);(0,a.useEffect)(()=>{u();let e=setInterval(u,3e4);return()=>clearInterval(e)},[u]),(0,a.useEffect)(()=>{let e=e=>{m.current&&!m.current.contains(e.target)&&o(!1)};return i&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]);let f=async(e,t)=>{c(`${e}:${t}`);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:e,model:t})})).ok?(p.success(`Cooldown cleared for ${t}`),await u()):p.error("Failed to clear cooldown")}catch{p.error("Failed to clear cooldown")}finally{c(null)}};if(s)return null;let g=e?.models||[],b=0===(e?.unavailableCount||g.filter(e=>"available"!==e.status).length),y={};return g.forEach(e=>{if("available"===e.status)return;let t=e.provider||"unknown";y[t]||(y[t]=[]),y[t].push(e)}),(0,r.jsx)("div",{className:"relative",ref:m,children:i&&(0,r.jsxs)("div",{className:"absolute top-full right-0 mt-2 w-80 bg-surface border border-border rounded-xl shadow-2xl z-50 overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-bg",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:b?"#22c55e":"#f59e0b"},children:b?"verified":"warning"}),(0,r.jsx)("span",{className:"text-sm font-semibold text-text-main",children:"Model Status"})]}),(0,r.jsx)("button",{onClick:u,className:"p-1 rounded-lg hover:bg-surface text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"})})]}),(0,r.jsx)("div",{className:"px-4 py-3 max-h-60 overflow-y-auto",children:b?(0,r.jsx)("p",{className:"text-sm text-text-muted text-center py-2",children:"All models are responding normally."}):(0,r.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(y).map(([e,t])=>(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-xs font-semibold text-text-main mb-1.5 capitalize",children:e}),(0,r.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let t=h[e.status]||h.unknown,s=d===`${e.provider}:${e.model}`;return(0,r.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5 rounded-lg bg-surface/30",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] shrink-0",style:{color:t.color},children:t.icon}),(0,r.jsx)("span",{className:"font-mono text-xs text-text-main truncate",children:e.model})]}),"cooldown"===e.status&&(0,r.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:()=>f(e.provider,e.model),disabled:s,className:"text-[10px] px-1.5! py-0.5! ml-2",children:s?"...":"Clear"})]},`${e.provider}-${e.model}`)})})]},e))})})]})})}let g={openai:{title:"Add OpenAI Compatible",type:"openai-compatible",defaultBaseUrl:"https://api.openai.com/v1",namePlaceholder:"My LiteLLM / OpenRouter / vLLM",baseUrlHint:"Base URL ending in /v1 for your OpenAI-compatible API.",modelIdPlaceholder:"e.g. gpt-4, claude-3-opus",errorLabel:"OpenAI Compatible",hasApiType:!0},anthropic:{title:"Add Anthropic Compatible",type:"anthropic-compatible",defaultBaseUrl:"https://api.anthropic.com/v1",namePlaceholder:"My Claude proxy",baseUrlHint:"Base URL ending in /v1. /messages is appended automatically.",modelIdPlaceholder:"e.g. claude-3-opus",errorLabel:"Anthropic Compatible",hasApiType:!1}},b=[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}];function y({variant:e,isOpen:t,onClose:s,onCreated:l}){let i=g[e],o=()=>({name:"",...i.hasApiType?{apiType:"chat"}:{},baseUrl:i.defaultBaseUrl}),[d,c]=(0,a.useState)(o),[m,p]=(0,a.useState)(!1),[x,u]=(0,a.useState)(""),[h,f]=(0,a.useState)(""),[v,j]=(0,a.useState)(""),[N,w]=(0,a.useState)(!1),[k,C]=(0,a.useState)(null);(0,a.useEffect)(()=>{t&&(c(o()),u(""),f(""),j(""),C(null))},[t,e]),(0,a.useEffect)(()=>{i.hasApiType&&t&&c(e=>({...e,baseUrl:i.defaultBaseUrl}))},[d.apiType]);let T=async()=>{if(d.name.trim()&&d.baseUrl.trim()){p(!0),u("");try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:d.name.trim(),...i.hasApiType?{apiType:d.apiType}:{},baseUrl:d.baseUrl.trim(),type:i.type})}),t=await e.json();e.ok?(l(t.node),c(o()),f(""),C(null)):u(t.error||"Failed to create provider")}catch(e){console.log(`Error creating ${i.errorLabel} node:`,e),u("Network error")}finally{p(!1)}}},A=async()=>{w(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:d.baseUrl,apiKey:h,type:i.type,modelId:v.trim()||void 0})}),t=await e.json();C(t)}catch{C({valid:!1,error:"Network error"})}finally{w(!1)}};return(0,r.jsx)(n.aF,{isOpen:t,title:i.title,onClose:s,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(n.pd,{label:"Name",value:d.name,onChange:e=>c({...d,name:e.target.value}),placeholder:i.namePlaceholder,hint:"Friendly label (e.g. Work LiteLLM)."}),i.hasApiType&&(0,r.jsx)(n.l6,{label:"API Type",options:b,value:d.apiType,onChange:e=>c({...d,apiType:e.target.value})}),(0,r.jsx)(n.pd,{label:"Base URL",value:d.baseUrl,onChange:e=>c({...d,baseUrl:e.target.value}),placeholder:i.defaultBaseUrl,hint:i.baseUrlHint}),(0,r.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:h,onChange:e=>f(e.target.value)}),(0,r.jsx)(n.pd,{label:"Model ID (optional)",value:v,onChange:e=>j(e.target.value),placeholder:i.modelIdPlaceholder,hint:"If the provider has no /models endpoint, enter a model ID to test chat/completions."}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,r.jsx)(n.$n,{onClick:A,disabled:!h||N||!d.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:N?"Checking...":"Check"}),(()=>{if(!k)return null;let{valid:e,error:t,method:s}=k;return e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===s&&(0,r.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,r.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),x?(0,r.jsx)("p",{className:"text-sm text-red-500",children:x}):null,(0,r.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,r.jsx)(n.$n,{onClick:T,fullWidth:!0,disabled:!d.name.trim()||!d.baseUrl.trim()||m,children:m?"Creating...":"Create"}),(0,r.jsx)(n.$n,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function v(e,t,s){let a=[];if(e>0&&a.push((0,r.jsxs)(n.Ex,{variant:"success",size:"sm",dot:!0,children:[e," Connected"]},"connected")),t>0){let e=s?`${t} Error (${s})`:`${t} Error`;a.push((0,r.jsx)(n.Ex,{variant:"error",size:"sm",dot:!0,children:e},"error"))}return 0===a.length?(0,r.jsx)("span",{className:"text-text-muted",children:"No connections"}):a}function j({initialData:e}){let[t,s]=(0,a.useState)(e?.connections||[]),[l,i]=(0,a.useState)(e?.nodes||[]),[o,m]=(0,a.useState)(!e),[p,h]=(0,a.useState)(!1),[g,b]=(0,a.useState)(!1),[v,C]=(0,a.useState)(!1),[T,A]=(0,a.useState)(!1),[I,E]=(0,a.useState)(null),[$,R]=(0,a.useState)(null),O=(0,x.i)(),S=(0,u.C)(e=>e.query),P=(0,u.C)(e=>e.register),U=(0,u.C)(e=>e.unregister);(0,a.useEffect)(()=>(P("Search providers..."),()=>U()),[P,U]);let _=e=>!S.trim()||e.toLowerCase().includes(S.trim().toLowerCase()),z=(e,t)=>[...e].sort(([e,s],[r,a])=>{let l=s.priority??999,i=a.priority??999;if(l!==i)return l-i;let n=M(e,t),o=M(r,t),d=+(n.connected>0),c=+(o.connected>0);return d!==c?c-d:(s.name||"").localeCompare(a.name||"")}),L=async()=>{try{let[e,t]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),r=await e.json(),a=await t.json();e.ok&&s(r.connections||[]),t.ok&&i(a.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{m(!1)}};(0,a.useEffect)(()=>{e?.connections?m(!1):L()},[e]);let M=(e,s)=>{let r=Array.isArray(s)?s:[s],a=t.filter(t=>t.provider===e&&r.includes(t.authType)),l=e=>{let t=Object.entries(e).some(([e,t])=>e.startsWith("modelLock_")&&t&&new Date(t).getTime()>Date.now());return"unavailable"!==e.testStatus||t?e.testStatus:"active"},i=a.filter(e=>{let t=l(e);return"active"===t||"success"===t}).length,n=a.filter(e=>{let t=l(e);return"error"===t||"expired"===t||"unavailable"===t}),o=n.length,d=a.length,c=d>0&&a.every(e=>!1===e.isActive),m=n.sort((e,t)=>new Date(t.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:i,error:o,total:d,errorCode:m?function(e){if(!e)return null;let t=e.lastErrorType;if("runtime_error"===t)return"RUNTIME";if("upstream_auth_error"===t||"auth_missing"===t||"token_refresh_failed"===t||"token_expired"===t)return"AUTH";if("upstream_rate_limited"===t)return"429";if("upstream_unavailable"===t)return"5XX";if("network_error"===t)return"NET";let s=Number(e.errorCode);if(Number.isFinite(s)&&s>=400)return String(s);let r=function(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}(e.lastError);if("401"===r||"403"===r)return"AUTH";if(r&&"ERR"!==r)return r;let a=(e.lastError||"").toLowerCase();return a.includes("runtime")||a.includes("not runnable")||a.includes("not installed")?"RUNTIME":a.includes("invalid api key")||a.includes("token invalid")||a.includes("revoked")||a.includes("unauthorized")?"AUTH":"ERR"}(m):null,errorTime:m?.lastErrorAt?function(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let r=Math.floor(s/24);return`${r}d ago`}(m.lastErrorAt):null,allDisabled:c}},q=async(e,r,a)=>{let l=Array.isArray(r)?r:[r],i=t=>t.provider===e&&l.includes(t.authType),n=t.filter(i);s(e=>e.map(e=>i(e)?{...e,isActive:a}:e)),await Promise.allSettled(n.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:a})})))},D=async(e,t=null)=>{if(!I){E("provider"===e?t:e),R(null);try{let s=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),r=await s.json();if(R(r),r.summary){let{passed:e,failed:t,total:s}=r.summary;0===t?O.success(`All ${s} tests passed`):O.warning(`${e}/${s} passed, ${t} failed`)}}catch(e){R({error:"Test request failed"}),O.error("Provider test failed")}finally{E(null)}}},F=l.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||"OpenAI Compatible",color:"#10A37F",textIcon:"OC",apiType:e.apiType})).filter(e=>_(e.name)),B=l.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||"Anthropic Compatible",color:"#D97757",textIcon:"AC"})).filter(e=>_(e.name)),K=z(Object.entries(d.zN).filter(([,e])=>!e.hidden&&_(e.name)),"oauth"),H=Object.entries(c.IS).filter(([,e])=>!e.hidden&&_(e.name)).sort(([,e],[,t])=>!!t.noAuth-!!e.noAuth),J=z(Object.entries(c.nJ).filter(([,e])=>!e.hidden&&_(e.name)&&(e.serviceKinds??["llm"]).includes("llm")),"freeTier").sort(([,e],[,t])=>!!t.noAuth-!!e.noAuth),W=Object.entries(d.fg).filter(([,e])=>!e.hidden&&(e.serviceKinds??["llm"]).includes("llm")&&_(e.name)).sort(([e,t],[s,r])=>{let a=M(e,"apikey").total>0?0:1,l=M(s,"apikey").total>0?0:1;return a!==l?a-l:(t.name||"").localeCompare(r.name||"")}),Q=!!S.trim(),X=Q||p?W:W.slice(0,20),Z=W.length-20;if(o)return(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(n.Qv,{}),(0,r.jsx)(n.Qv,{})]});let V=!S.trim()||K.length>0||H.length>0||J.length>0||W.length>0||F.length>0||B.length>0;return(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[!V&&(0,r.jsxs)("div",{className:"text-center py-8 border border-dashed border-border rounded-xl",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"search_off"}),(0,r.jsx)("p",{className:"text-text-muted text-sm",children:"No providers match your search"})]}),K.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"OAuth Providers"}),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,r.jsx)(f,{}),(0,r.jsxs)("button",{onClick:()=>D("oauth"),disabled:!!I,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"oauth"===I?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all OAuth connections","aria-label":"Test all OAuth connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"oauth"===I?" animate-spin":""}`,children:"play_arrow"}),"oauth"===I?"Testing...":"Test All"]})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:K.map(([e,t])=>(0,r.jsx)(N,{providerId:e,provider:t,stats:M(e,"oauth"),authType:"oauth",onToggle:t=>q(e,"oauth",t)},e))})]}),(H.length>0||J.length>0)&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"Free Tier Providers"}),(0,r.jsxs)("button",{onClick:()=>D("free"),disabled:!!I,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"free"===I?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all Free connections","aria-label":"Test all Free provider connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"free"===I?" animate-spin":""}`,children:"play_arrow"}),"free"===I?"Testing...":"Test All"]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[H.map(([e,t])=>{let s="kiro"===e?["oauth","apikey","api_key"]:"oauth";return(0,r.jsx)(N,{providerId:e,provider:t,stats:M(e,s),authType:"free",onToggle:t=>q(e,s,t)},e)}),J.map(([e,t])=>(0,r.jsx)(w,{providerId:e,provider:t,stats:M(e,"apikey"),authType:"apikey",onToggle:t=>q(e,"apikey",t)},e))]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"API Key Providers"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Built-in providers plus your own OpenAI- or Anthropic-compatible endpoints."})]}),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>A(e=>!e),className:"w-full sm:w-auto",children:"Add custom provider"}),T&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"fixed inset-0 z-40 cursor-default","aria-label":"Close menu",onClick:()=>A(!1)}),(0,r.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 w-64 rounded-xl border border-border bg-surface p-1 shadow-xl",children:[(0,r.jsxs)("button",{type:"button",className:"flex w-full items-start gap-2 rounded-lg px-3 py-2.5 text-left text-sm transition-colors hover:bg-bg",onClick:()=>{A(!1),b(!0)},children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary mt-0.5",children:"api"}),(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"block font-medium",children:"OpenAI compatible"}),(0,r.jsx)("span",{className:"block text-xs text-text-muted",children:"Any OpenAI-style base URL + API key"})]})]}),(0,r.jsxs)("button",{type:"button",className:"flex w-full items-start gap-2 rounded-lg px-3 py-2.5 text-left text-sm transition-colors hover:bg-bg",onClick:()=>{A(!1),C(!0)},children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary mt-0.5",children:"psychology"}),(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"block font-medium",children:"Anthropic compatible"}),(0,r.jsx)("span",{className:"block text-xs text-text-muted",children:"Messages API base URL + API key"})]})]})]})]})]}),W.length>0&&(0,r.jsxs)("button",{onClick:()=>D("apikey"),disabled:!!I,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"apikey"===I?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all API Key connections","aria-label":"Test all API Key connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"apikey"===I?" animate-spin":""}`,children:"play_arrow"}),"apikey"===I?"Testing...":"Test All"]})]})]}),(F.length>0||B.length>0)&&(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider text-text-muted",children:"Your custom providers"}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[...F,...B].map(e=>(0,r.jsx)(w,{providerId:e.id,provider:e,stats:M(e.id,"apikey"),authType:"compatible",onToggle:t=>q(e.id,"apikey",t)},e.id))})]}),0===F.length&&0===B.length&&0===W.length&&(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-8 border border-dashed border-border rounded-xl text-text-muted text-sm",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[28px]",children:"extension"}),(0,r.jsx)("p",{children:"No API key providers yet."}),(0,r.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>b(!0),children:"Add custom provider"})]}),X.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(F.length>0||B.length>0)&&(0,r.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider text-text-muted",children:"Built-in providers"}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:X.map(([e,t])=>(0,r.jsx)(w,{providerId:e,provider:t,stats:M(e,"apikey"),authType:"apikey",onToggle:t=>q(e,"apikey",t)},e))})]}),!Q&&!p&&Z>0&&(0,r.jsxs)("button",{onClick:()=>h(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2.5 text-sm font-medium text-primary transition-colors hover:border-primary hover:bg-primary/5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"expand_more"}),"Show all ",W.length," providers"]})]}),(0,r.jsx)(y,{variant:"openai",isOpen:g,onClose:()=>b(!1),onCreated:e=>{i(t=>[...t,e]),b(!1)}}),(0,r.jsx)(y,{variant:"anthropic",isOpen:v,onClose:()=>C(!1),onCreated:e=>{i(t=>[...t,e]),C(!1)}}),$&&(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center px-3 pt-[6vh] sm:pt-[10vh]",onClick:()=>R(null),children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,r.jsxs)("div",{className:"relative bg-surface border border-border rounded-xl w-full max-w-[600px] max-h-[86vh] sm:max-h-[80vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-5 py-3 border-b border-border bg-surface/95 backdrop-blur-sm rounded-t-xl",children:[(0,r.jsx)("h3",{className:"font-semibold",children:"Test Results"}),(0,r.jsx)("button",{onClick:()=>R(null),className:"p-1 rounded-lg hover:bg-bg text-text-muted hover:text-text-main transition-colors","aria-label":"Close test results",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]}),(0,r.jsx)("div",{className:"p-5",children:(0,r.jsx)(k,{results:$})})]})]})]})}function N({providerId:e,provider:t,stats:s,authType:a,onToggle:l}){let{connected:i,error:d,errorCode:c,errorTime:m,allDisabled:x}=s,u=!!t.noAuth;return(0,r.jsx)(p(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,r.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${x?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,r.jsx)(o.A,{src:`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[32px] max-h-[32px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,r.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:x?(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):u?(0,r.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:"Ready"}):(0,r.jsxs)(r.Fragment,{children:[v(i,d,c),m&&(0,r.jsx)("span",{className:"text-text-muted",children:m})]})})]})]}),(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s.total>0&&(0,r.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!x)},children:(0,r.jsx)(n.lM,{size:"sm",checked:!x,onChange:()=>{},title:x?"Enable provider":"Disable provider"})})})]})})})}function w({providerId:e,provider:t,stats:s,authType:a,onToggle:l}){let{connected:i,error:d,errorCode:m,errorTime:x,allDisabled:u}=s,h=e.startsWith(c.JH),f=e.startsWith(c.DI);return(0,r.jsx)(p(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,r.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${u?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,r.jsx)(o.A,{src:h?"responses"===t.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":f?"/providers/anthropic-m.png":`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,r.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:u?(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):(0,r.jsxs)(r.Fragment,{children:[v(i,d,m),h&&(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:"responses"===t.apiType?"Responses":"Chat"}),f&&(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:"Messages"}),x&&(0,r.jsx)("span",{className:"text-text-muted",children:x})]})})]})]}),(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s.total>0&&(0,r.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!u)},children:(0,r.jsx)(n.lM,{size:"sm",checked:!u,onChange:()=>{},title:u?"Enable provider":"Disable provider"})})})]})})})}function k({results:e}){if(e.error&&!e.results)return(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2 block",children:"error"}),(0,r.jsx)("p",{className:"text-sm text-red-400",children:e.error})]});let{summary:t,mode:s}=e,a=e.results||[];return(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[t&&(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs mb-1 sm:gap-3",children:[(0,r.jsxs)("span",{className:"text-text-muted",children:[{oauth:"OAuth",free:"Free",apikey:"API Key",provider:"Provider",all:"All"}[s]||s," Test"]}),(0,r.jsxs)("span",{className:"px-2 py-0.5 rounded bg-emerald-500/15 text-emerald-400 font-medium",children:[t.passed," passed"]}),t.failed>0&&(0,r.jsxs)("span",{className:"px-2 py-0.5 rounded bg-red-500/15 text-red-400 font-medium",children:[t.failed," failed"]}),(0,r.jsxs)("span",{className:"text-text-muted sm:ml-auto",children:[t.total," tested"]})]}),a.map((e,t)=>(0,r.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2 rounded-lg bg-black/[0.03] px-3 py-2 text-xs dark:bg-white/[0.03] sm:flex-nowrap",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[16px] ${e.valid?"text-emerald-500":"text-red-500"}`,children:e.valid?"check_circle":"error"}),(0,r.jsxs)("div",{className:"min-w-0 flex-[1_1_160px]",children:[(0,r.jsx)("span",{className:"block truncate font-medium sm:inline",children:e.connectionName}),(0,r.jsxs)("span",{className:"block truncate text-text-muted sm:ml-1.5 sm:inline",children:["(",e.provider,")"]})]}),void 0!==e.latencyMs&&(0,r.jsxs)("span",{className:"shrink-0 text-text-muted font-mono tabular-nums",children:[e.latencyMs,"ms"]}),(0,r.jsx)("span",{className:`shrink-0 text-[10px] uppercase font-bold px-1.5 py-0.5 rounded ${e.valid?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:e.valid?"OK":e.diagnosis?.type||"ERROR"})]},e.connectionId||t)),0===a.length&&(0,r.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:"No active connections found for this group."})]})}y.propTypes={variant:i().oneOf(["openai","anthropic"]).isRequired,isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired},N.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},w.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string,apiType:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},k.propTypes={results:i().shape({mode:i().string,results:i().array,summary:i().shape({total:i().number,passed:i().number,failed:i().number}),error:i().string}).isRequired}},93979:(e,t,s)=>{Promise.resolve().then(s.bind(s,18964))}},e=>{e.O(0,[2574,3862,1610,2562,1321,705,5497,8441,3794,7358],()=>e(e.s=93979)),_N_E=e.O()}]);