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
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6897],{5194:(e,t,s)=>{Promise.resolve().then(s.bind(s,94091))},94091:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>n});var a=s(95155),r=s(12115),l=s(35497);function n(){let[e,t]=(0,r.useState)(null),[s,n]=(0,r.useState)(!0),[d,o]=(0,r.useState)(""),[c,m]=(0,r.useState)(null),[x,p]=(0,r.useState)(null),[h,u]=(0,r.useState)(null),[b,y]=(0,r.useState)("overview"),[g,f]=(0,r.useState)({id:"",name:"",transport:"stdio",command:"npx",args:"-y @modelcontextprotocol/server-filesystem .",url:"",notes:""}),[j,v]=(0,r.useState)([]),[N,k]=(0,r.useState)(""),[w,C]=(0,r.useState)(""),[S,P]=(0,r.useState)(""),[$,O]=(0,r.useState)(!1),[E,T]=(0,r.useState)(""),[M,A]=(0,r.useState)(""),[I,L]=(0,r.useState)(""),Z=(0,r.useCallback)(async()=>{n(!0);try{let e=await fetch("/api/agent-library",{cache:"no-store"}),s=await e.json();if(!e.ok)throw Error(s.error||"Load failed");t(s)}catch(e){m({type:"error",text:e.message})}finally{n(!1)}},[]);(0,r.useEffect)(()=>{Z(),fetch("/api/agent-library/catalog").then(e=>e.json()).then(e=>v(e.presets||[])).catch(()=>{})},[Z]);let z=e?.settings||{},D=e?.agents||{};async function R(e){o("settings"),m(null);try{let t=await fetch("/api/agent-library",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();if(!t.ok)throw Error(s.error||"Save failed");m({type:"success",text:"Settings saved"}),await Z()}catch(e){m({type:"error",text:e.message})}finally{o("")}}async function U(e){o(e),m(null),u(null);try{let t=await fetch("/api/agent-library/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,confirm:"clean"===e||void 0})}),s=await t.json();if(!t.ok)throw Error(s.error||s.message||"Sync failed");u(s),m({type:s.conflictCount?"warn":"success",text:"dry-run"===e?`Dry-run: ${s.summary?.skillsSynced??0} skill ops, ${s.summary?.mcpOk??0} MCP ok, ${s.conflictCount||0} conflicts`:"clean"===e?"Removed Switchboard-managed projections only":`Applied: ${s.summary?.skillsSynced??0} skills synced, ${s.conflictCount||0} conflicts protected`}),await Z()}catch(e){m({type:"error",text:e.message})}finally{o("")}}async function J(){o("doctor");try{let e=await fetch("/api/agent-library/doctor",{cache:"no-store"}),t=await e.json();if(!e.ok)throw Error(t.error||"Doctor failed");p(t),m({type:t.ok?"success":"warn",text:t.ok?"Doctor: no blocking errors":`Doctor: ${t.issues?.filter(e=>"error"===e.severity).length||0} errors`})}catch(e){m({type:"error",text:e.message})}finally{o("")}}async function _(e){e?.preventDefault?.(),o("mcp");try{let e=g.args?g.args.split(/\s+/).filter(Boolean):[],t=await fetch("/api/agent-library/mcp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:g.id,name:g.name||g.id,transport:g.transport,command:"stdio"===g.transport?g.command:void 0,args:"stdio"===g.transport?e:void 0,url:"stdio"!==g.transport?g.url:void 0,notes:g.notes})}),s=await t.json();if(!t.ok)throw Error(s.error||"MCP save failed");s.warnings?.length?m({type:"warn",text:s.warnings.join(" \xb7 ")}):m({type:"success",text:`MCP ${s.server?.id} saved (Apply to project)`}),f({id:"",name:"",transport:"stdio",command:"npx",args:"",url:"",notes:""}),await Z()}catch(e){m({type:"error",text:e.message})}finally{o("")}}async function K(e){if(confirm(`Remove MCP ${e} from library? (targets updated on next Apply)`)){o("mcp-del");try{let t=await fetch(`/api/agent-library/mcp?id=${encodeURIComponent(e)}`,{method:"DELETE"}),s=await t.json();if(!t.ok)throw Error(s.error);m({type:"success",text:"MCP removed from library"}),await Z()}catch(e){m({type:"error",text:e.message})}finally{o("")}}}async function H(e){if(confirm(`Remove skill ${e} from library?`)){o("skill-del");try{let t=await fetch(`/api/agent-library/skills?id=${encodeURIComponent(e)}`,{method:"DELETE"}),s=await t.json();if(!t.ok)throw Error(s.error);m({type:"success",text:"Skill removed from library"}),await Z()}catch(e){m({type:"error",text:e.message})}finally{o("")}}}async function G(){o("skill-add");try{let e=await fetch("/api/agent-library/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:E,markdown:M,source:"manual"})}),t=await e.json();if(!e.ok)throw Error(t.error);m({type:"success",text:`Skill ${t.id} installed in library`}),T(""),A(""),await Z()}catch(e){m({type:"error",text:e.message})}finally{o("")}}async function W(e){o("preview");try{let t=await fetch("/api/agent-library/catalog",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"preview",url:e})}),s=await t.json();if(!t.ok||!s.ok)throw Error(s.error||"Preview failed");P(s.preview||""),m({type:"success",text:`Preview loaded (${s.bytes} bytes)`})}catch(e){m({type:"error",text:e.message})}finally{o("")}}async function B(){o("catalog");try{let e=await fetch("/api/agent-library/catalog",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"install",skillId:w,url:N,confirmed:$})}),t=await e.json();if(!e.ok)throw Error(t.message||t.error||"Install failed");m({type:"success",text:t.warning||`Installed ${t.id}`}),O(!1),await Z()}catch(e){m({type:"error",text:e.message})}finally{o("")}}async function F(){o("export");try{let e=await fetch("/api/agent-library/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({destPath:I||void 0})}),t=await e.json();if(!e.ok)throw Error(t.message||t.error||"Export failed");m({type:"success",text:`Exported AgentSync layout to ${t.path}`})}catch(e){m({type:"error",text:e.message})}finally{o("")}}return(0,a.jsxs)("div",{className:"max-w-5xl mx-auto space-y-5 pb-12",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("h1",{className:"text-[17px] font-semibold text-text-main",children:"Agent library"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted leading-relaxed max-w-2xl",children:["One Switchboard-owned library of ",(0,a.jsx)("strong",{className:"text-text-main",children:"skills"})," and"," ",(0,a.jsx)("strong",{className:"text-text-main",children:"MCP servers"}),", projected into Claude Code, Codex, OpenCode, Gemini CLI, and Cursor. Managed entries use the"," ",(0,a.jsx)("code",{className:"text-[11px] font-mono",children:"sb-"})," namespace so we never overwrite your existing skills or MCP keys."]})]}),c&&(0,a.jsx)("div",{className:`text-xs px-3 py-2 rounded-lg border ${"success"===c.type?"bg-green-500/10 border-green-500/30 text-green-600 dark:text-green-400":"warn"===c.type?"bg-amber-500/10 border-amber-500/30 text-amber-700 dark:text-amber-400":"bg-red-500/10 border-red-500/30 text-red-500"}`,children:c.text}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,a.jsxs)("label",{className:"flex items-center gap-2 text-sm text-text-main cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",className:"accent-[var(--color-primary)]",checked:!1!==z.enabled,disabled:!!d,onChange:e=>R({enabled:e.target.checked})}),"Sync enabled"]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",disabled:!!d||!1===z.enabled,loading:"dry-run"===d,onClick:()=>U("dry-run"),children:"Dry-run"}),(0,a.jsx)(l.$n,{size:"sm",disabled:!!d||!1===z.enabled,loading:"apply"===d,onClick:()=>U("apply"),children:"Apply sync"}),(0,a.jsx)(l.$n,{size:"sm",variant:"outline",disabled:!!d,loading:"doctor"===d,onClick:J,children:"Doctor"})]})]}),(0,a.jsxs)("p",{className:"text-[11px] text-text-subtle mt-2 font-mono break-all",children:["Library: ",e?.libraryRoot||"…",z.linkMode?` \xb7 mode=${z.linkMode}`:"",z.scope?` \xb7 scope=${z.scope}`:""]})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 border-b border-border pb-0",children:[{id:"overview",label:"Overview"},{id:"skills",label:"Skills"},{id:"mcp",label:"MCP"},{id:"catalog",label:"Catalog"},{id:"advanced",label:"Advanced"}].map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>y(e.id),className:`px-3 py-2 text-xs font-medium rounded-t-md transition-colors ${b===e.id?"bg-surface border border-border border-b-surface text-primary -mb-px":"text-text-muted hover:text-text-main"}`,children:e.label},e.id))}),s&&(0,a.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}),"Loading…"]}),!s&&"overview"===b&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"How it works"}),(0,a.jsxs)("ol",{className:"text-xs text-text-muted space-y-1.5 list-decimal pl-4 leading-relaxed",children:[(0,a.jsxs)("li",{children:["Skills and MCP servers live only in Switchboard's library (",(0,a.jsx)("code",{className:"font-mono",children:"~/.switchboard/agent-library"}),")."]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{className:"text-text-main",children:"Apply sync"})," projects them into each enabled agent under namespaced paths/keys (",(0,a.jsx)("code",{className:"font-mono",children:"sb-*"}),")."]}),(0,a.jsxs)("li",{children:["If a path already exists and is ",(0,a.jsx)("em",{children:"not"})," marked managed, we"," ",(0,a.jsx)("strong",{className:"text-text-main",children:"skip"})," it (never overwrite)."]}),(0,a.jsx)("li",{children:"Turn individual agents or skills/MCP off with the toggles below."})]})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-3",children:"Targets"}),(0,a.jsx)("div",{className:"space-y-2",children:Object.values(D).map(e=>{let t=z.targets?.[e.id]||{skills:!0,mcp:!0};return(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 py-2 border-b border-border-subtle last:border-0",children:[(0,a.jsx)("span",{className:"text-sm text-text-main",children:e.label}),(0,a.jsxs)("div",{className:"flex gap-4 text-xs text-text-muted",children:[(0,a.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",checked:!1!==t.skills,disabled:!e.supportsSkills||!!d,onChange:s=>R({targets:{...z.targets,[e.id]:{...t,skills:s.target.checked}}})}),"Skills"]}),(0,a.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",checked:!1!==t.mcp,disabled:!e.supportsMcp||!!d,onChange:s=>R({targets:{...z.targets,[e.id]:{...t,mcp:s.target.checked}}})}),"MCP"]})]})]},e.id)})})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-3",children:"Safety & link mode"}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 text-xs",children:[(0,a.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Link mode"}),(0,a.jsxs)("select",{className:"bg-surface border border-border rounded-md px-2 py-1.5 text-text-main",value:z.linkMode||"copy",disabled:!!d,onChange:e=>R({linkMode:e.target.value}),children:[(0,a.jsx)("option",{value:"copy",children:"Copy (safe default on Windows)"}),(0,a.jsx)("option",{value:"symlink",children:"Symlink (instant updates; may need privileges on Windows)"})]})]}),(0,a.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Scope"}),(0,a.jsxs)("select",{className:"bg-surface border border-border rounded-md px-2 py-1.5 text-text-main",value:z.scope||"global",disabled:!!d,onChange:e=>R({scope:e.target.value,projectPath:"project"===e.target.value?z.projectPath||"":null}),children:[(0,a.jsx)("option",{value:"global",children:"Global (user home agents)"}),(0,a.jsx)("option",{value:"project",children:"Project (paths under project folder)"})]})]}),"project"===z.scope&&(0,a.jsxs)("label",{className:"flex flex-col gap-1 sm:col-span-2",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Project path (absolute)"}),(0,a.jsx)("input",{className:"bg-surface border border-border rounded-md px-2 py-1.5 font-mono text-text-main",value:z.projectPath||"",placeholder:"/Users/you/my-app",disabled:!!d,onChange:e=>R({projectPath:e.target.value})})]}),(0,a.jsxs)("label",{className:"flex items-start gap-2 sm:col-span-2 cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",className:"mt-0.5",checked:!1!==z.neverOverwriteUser,disabled:!!d,onChange:e=>{e.target.checked?R({neverOverwriteUser:!0}):confirm("Allow overwriting paths that are NOT Switchboard-managed? This can replace your personal skills/MCP. Continue?")&&R({neverOverwriteUser:!1,confirmAllowOverwrite:!0})}}),(0,a.jsxs)("span",{className:"text-text-muted leading-relaxed",children:[(0,a.jsx)("strong",{className:"text-text-main",children:"Never overwrite user-owned files"})," ","(recommended). Only touch ",(0,a.jsx)("code",{className:"font-mono",children:"sb-*"})," managed entries."]})]}),(0,a.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",checked:!1!==z.includeProductSkills,disabled:!!d,onChange:e=>R({includeProductSkills:e.target.checked})}),(0,a.jsx)("span",{className:"text-text-muted",children:"Auto-include Switchboard product skills (entry + chat)"})]})]})]}),(0,a.jsxs)("div",{className:"grid sm:grid-cols-3 gap-3",children:[(0,a.jsx)(i,{label:"Skills in library",value:String(e?.skills?.length??0)}),(0,a.jsx)(i,{label:"MCP servers",value:String(e?.mcpServers?.length??0)}),(0,a.jsx)(i,{label:"Last sync",value:e?.state?.lastSync?.at?new Date(e.state.lastSync.at).toLocaleString():"—"})]}),h&&(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"Last sync detail"}),(0,a.jsx)("pre",{className:"text-[11px] font-mono text-text-muted overflow-x-auto max-h-48 bg-surface-2 p-2 rounded",children:JSON.stringify(h.summary||h,null,2)}),h.skills?.filter(e=>"conflict"===e.action).length>0&&(0,a.jsxs)("div",{className:"mt-2 text-xs text-amber-600 dark:text-amber-400",children:["Conflicts (protected):",(0,a.jsx)("ul",{className:"list-disc pl-4 mt-1",children:h.skills.filter(e=>"conflict"===e.action).map((e,t)=>(0,a.jsxs)("li",{children:[e.agent,"/",e.skillId,": ",e.message||e.reason]},t))})]})]}),x&&(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"Doctor"}),x.issues?.length===0?(0,a.jsx)("p",{className:"text-xs text-green-600",children:"No issues"}):(0,a.jsx)("ul",{className:"text-xs space-y-1",children:x.issues?.map((e,t)=>(0,a.jsxs)("li",{className:"error"===e.severity?"text-red-500":"text-amber-600 dark:text-amber-400",children:["[",e.severity,"] ",e.message]},t))})]})]}),!s&&"skills"===b&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"Library skills"}),(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",disabled:!!d,onClick:async()=>{o("ensure");try{await fetch("/api/agent-library/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"ensure_product"})}),await Z(),m({type:"success",text:"Product skills ensured"})}finally{o("")}},children:"Refresh product skills"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(e?.skills||[]).map(e=>(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2 p-3 rounded-lg border border-border-subtle bg-surface-2/50",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-text-main",children:e.title||e.id}),(0,a.jsx)(l.Ex,{size:"sm",variant:"default",children:(0,a.jsxs)("code",{className:"text-[10px]",children:["sb-",e.id]})})]}),(0,a.jsx)("p",{className:"text-[11px] text-text-muted mt-0.5 line-clamp-2",children:e.description||"—"})]}),(0,a.jsx)(l.$n,{size:"sm",variant:"ghost",disabled:!!d,onClick:()=>H(e.id),children:"Remove"})]},e.id)),!e?.skills?.length&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No skills yet. Enable product skills or add manually."})]})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"Add skill (paste SKILL.md)"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("input",{className:"w-full bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono",placeholder:"skill-id (e.g. my-review)",value:E,onChange:e=>T(e.target.value)}),(0,a.jsx)("textarea",{className:"w-full h-40 bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono",placeholder:"---\nname: my-skill\ndescription: ...\n---\n\n# ...",value:M,onChange:e=>A(e.target.value)}),(0,a.jsx)(l.$n,{size:"sm",disabled:!E||!M||!!d,loading:"skill-add"===d,onClick:G,children:"Add to library"})]})]})]}),!s&&"mcp"===b&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-1",children:"MCP servers in library"}),(0,a.jsxs)("p",{className:"text-[11px] text-text-subtle mb-3",children:["Prefer ",(0,a.jsxs)("code",{className:"font-mono",children:["$","{GITHUB_TOKEN}"]})," style env values — do not paste raw API keys if you can avoid it. Keys are projected as"," ",(0,a.jsx)("code",{className:"font-mono",children:"sb-*"})," only."]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(e?.mcpServers||[]).map(e=>(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2 p-3 rounded-lg border border-border-subtle",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm text-text-main font-medium",children:e.name}),(0,a.jsx)("code",{className:"text-[10px] text-text-subtle",children:e.id}),(0,a.jsxs)("div",{className:"text-[11px] text-text-muted mt-1",children:[e.transport||"stdio"," \xb7"," ",e.command?`${e.command} ${(e.args||[]).join(" ")}`:e.url]})]}),(0,a.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:()=>K(e.id),children:"Remove"})]},e.id)),!e?.mcpServers?.length&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No MCP servers in library yet."})]})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-3",children:"Add MCP server"}),(0,a.jsxs)("form",{className:"grid gap-2 sm:grid-cols-2",onSubmit:_,children:[(0,a.jsx)("input",{required:!0,className:"bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono",placeholder:"id (e.g. filesystem)",value:g.id,onChange:e=>f({...g,id:e.target.value})}),(0,a.jsx)("input",{className:"bg-surface border border-border rounded-md px-2 py-1.5 text-xs",placeholder:"Display name",value:g.name,onChange:e=>f({...g,name:e.target.value})}),(0,a.jsxs)("select",{className:"bg-surface border border-border rounded-md px-2 py-1.5 text-xs",value:g.transport,onChange:e=>f({...g,transport:e.target.value}),children:[(0,a.jsx)("option",{value:"stdio",children:"stdio (command)"}),(0,a.jsx)("option",{value:"http",children:"http (url)"}),(0,a.jsx)("option",{value:"sse",children:"sse (url)"})]}),"stdio"===g.transport?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("input",{className:"bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono",placeholder:"command",value:g.command,onChange:e=>f({...g,command:e.target.value})}),(0,a.jsx)("input",{className:"sm:col-span-2 bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono",placeholder:"args (space-separated)",value:g.args,onChange:e=>f({...g,args:e.target.value})})]}):(0,a.jsx)("input",{className:"sm:col-span-1 bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono",placeholder:"https://...",value:g.url,onChange:e=>f({...g,url:e.target.value})}),(0,a.jsx)("div",{className:"sm:col-span-2",children:(0,a.jsx)(l.$n,{size:"sm",type:"submit",loading:"mcp"===d,disabled:!!d,children:"Save to library"})})]})]})]}),!s&&"catalog"===b&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-1",children:"Trusted presets"}),(0,a.jsx)("p",{className:"text-[11px] text-text-subtle mb-3",children:"Fetches SKILL.md only — never runs install scripts. You must confirm and then Apply sync."}),(0,a.jsx)("div",{className:"space-y-2",children:j.map(e=>(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 p-2 rounded border border-border-subtle",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm text-text-main",children:e.name}),(0,a.jsx)("div",{className:"text-[11px] text-text-muted",children:e.description})]}),(0,a.jsxs)("div",{className:"flex gap-1",children:[(0,a.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:()=>{k(e.rawUrl),C(e.skillId),W(e.rawUrl)},children:"Preview"}),(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",onClick:()=>{k(e.rawUrl),C(e.skillId),O(!1)},children:"Select"})]})]},e.id))})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"Install from URL"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("input",{className:"w-full bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono",placeholder:"skill-id",value:w,onChange:e=>C(e.target.value)}),(0,a.jsx)("input",{className:"w-full bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono",placeholder:"https://.../SKILL.md",value:N,onChange:e=>k(e.target.value)}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",disabled:!N||!!d,onClick:()=>W(N),children:"Preview"})}),S&&(0,a.jsx)("pre",{className:"text-[10px] font-mono max-h-48 overflow-auto bg-surface-2 p-2 rounded border border-border-subtle whitespace-pre-wrap",children:S}),(0,a.jsxs)("label",{className:"flex items-start gap-2 text-xs text-text-muted cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",checked:$,onChange:e=>O(e.target.checked)}),"I reviewed this skill and understand it may instruct agents to run tools/shell commands."]}),(0,a.jsx)(l.$n,{size:"sm",disabled:!N||!w||!$||!!d,loading:"catalog"===d,onClick:B,children:"Install into library"})]})]})]}),!s&&"advanced"===b&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"Clean managed projections"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-3",children:["Removes only ",(0,a.jsx)("code",{className:"font-mono",children:"sb-*"})," skills and MCP keys written by Switchboard. Your other skills/MCP stay untouched."]}),(0,a.jsx)(l.$n,{size:"sm",variant:"outline",disabled:!!d,loading:"clean"===d,onClick:()=>{confirm("Remove all Switchboard-managed skill/MCP projections from targets?")&&U("clean")},children:"Clean managed only"})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"Export AgentSync layout"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Writes a coexistence-friendly ",(0,a.jsx)("code",{className:"font-mono",children:".agents/"})," tree (skills + agentsync.toml). Does not run agentsync. Paths must be under your home or project directory."]}),(0,a.jsx)("input",{className:"w-full bg-surface border border-border rounded-md px-2 py-1.5 text-xs font-mono mb-2",placeholder:"Optional dest (default ~/switchboard-agents-export/.agents)",value:I,onChange:e=>L(e.target.value)}),(0,a.jsx)(l.$n,{size:"sm",variant:"secondary",disabled:!!d,loading:"export"===d,onClick:F,children:"Export"})]}),(0,a.jsxs)(l.Zp,{padding:"md",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main mb-2",children:"Coexistence"}),(0,a.jsxs)("ul",{className:"text-xs text-text-muted space-y-1 list-disc pl-4",children:[(0,a.jsxs)("li",{children:["Switchboard only owns ",(0,a.jsx)("code",{className:"font-mono",children:"sb-*"})," skill directories and MCP keys."]}),(0,a.jsx)("li",{children:"AgentSync / skillbook may manage other paths — avoid pointing both at the same un-namespaced skill."}),(0,a.jsx)("li",{children:"Product skills for HTTP agents remain under Dashboard → Skills (separate)."})]})]})]})]})}function i({label:e,value:t}){return(0,a.jsxs)(l.Zp,{padding:"sm",children:[(0,a.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-text-subtle font-semibold",children:e}),(0,a.jsx)("div",{className:"text-sm text-text-main mt-1 font-medium truncate",title:t,children:t})]})}}},e=>{e.O(0,[2574,3862,1610,2562,1321,705,5497,8441,3794,7358],()=>e(e.s=5194)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4465],{70065:(e,t,r)=>{Promise.resolve().then(r.bind(r,88512))},88512:(e,t,r)=>{"use strict";r.d(t,{default:()=>g});var s=r(95155),a=r(12115),i=r(35497),l=r(28777),n=r(88105);let o="basic-chat.sessions",d="basic-chat.activeSessionId",c="basic-chat.activeProviderId",m="basic-chat.draft";function u(){return globalThis.crypto?.randomUUID?globalThis.crypto.randomUUID():`chat_${Date.now()}_${Math.random().toString(16).slice(2)}`}function p(e){if("string"==typeof e)return e;if(null==e)return"";if(Array.isArray(e))return e.map(p).filter(Boolean).join(" ");if("object"==typeof e){if("string"==typeof e.message)return e.message;if("string"==typeof e.error)return e.error;try{return JSON.stringify(e)}catch{}}return String(e)}function h(e=""){let t=p(e).replace(/\s+/g," ").trim();return t?t.length>52?`${t.slice(0,52).trimEnd()}…`:t:"New chat"}async function x(e){return await new Promise((t,r)=>{let s=new FileReader;s.onload=()=>t(String(s.result||"")),s.onerror=()=>r(s.error||Error("Failed to read file")),s.readAsDataURL(e)})}function f(e){return e?.name||function(e=""){return String(e).replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()||"Unknown"}(e?.provider||e?.id||"provider")}function g(){let[e,t]=(0,a.useState)([]),[r,g]=(0,a.useState)(!0),[w,v]=(0,a.useState)(""),[b,N]=(0,a.useState)(()=>{try{let e=function(e,t){try{return JSON.parse(e)}catch{return t}}(globalThis.localStorage.getItem(o),[]);return Array.isArray(e)?e.map(e=>({...e,messages:Array.isArray(e.messages)?e.messages:[]})):[]}catch{return[]}}),[y,j]=(0,a.useState)(()=>globalThis.localStorage.getItem(d)||""),[S,I]=(0,a.useState)(()=>globalThis.localStorage.getItem(c)||""),[A,k]=(0,a.useState)(""),[D,O]=(0,a.useState)(()=>globalThis.localStorage.getItem(m)||""),[$,C]=(0,a.useState)([]),[_,M]=(0,a.useState)(!1),[E,T]=(0,a.useState)(""),[U,R]=(0,a.useState)(""),[z,q]=(0,a.useState)(!1),[P,J]=(0,a.useState)(!1),[B,F]=(0,a.useState)(!1),K=(0,a.useRef)(null),L=(0,a.useRef)(null),W=(0,a.useRef)(!1),H=(0,a.useRef)(null),Y=(0,a.useRef)(null);(0,a.useEffect)(()=>{q(!0)},[]),(0,a.useEffect)(()=>{let e=!1;return async function(){g(!0),v("");try{let r=await fetch("/api/providers",{cache:"no-store"}),s=await r.json().catch(()=>({})),a=Array.isArray(s.connections)?s.connections.filter(e=>e?.isActive!==!1):[];if(0===a.length){e||(t([]),v("No providers connected yet."));return}let i=new Map;for(let e of a){let t=e.provider||e.id,r=f(e),s=(0,n.mq)(t)?"openai-compatible":(0,n.gb)(t)?"anthropic-compatible":t;i.has(t)||i.set(t,{providerId:t,providerName:r,providerType:s,connections:[],models:[]});let a=i.get(t);a.providerName=a.providerName||r,a.providerType=a.providerType||s,a.connections.push(e);let o=(0,l.KC)(t).map(t=>t?.id?{id:`${e.provider}/${t.id}`,requestModel:`${e.provider}/${t.id}`,name:t.name||t.id,providerId:e.provider,providerName:f(e),source:"static"}:null).filter(Boolean);a.models.push(...o)}for(let e of(await Promise.all(a.map(async e=>{try{let t=await fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)return{connection:e,models:[]};let s=(Array.isArray(r?.models)?r.models:Array.isArray(r?.data)?r.data:Array.isArray(r?.results)?r.results:Array.isArray(r)?r:[]).map(t=>(function(e,t){let r="string"==typeof e?e:e?.id||e?.name||e?.model||"";if(!r)return null;let s="string"==typeof e?e:e?.name||e?.displayName||r,a=r;return((0,n.mq)(t.provider)||(0,n.gb)(t.provider))&&!r.includes("/")&&(a=`${t.provider}/${r}`),{id:a,requestModel:a,name:s,providerId:t.provider,providerName:f(t),source:"live"}})(t,e)).filter(Boolean);return{connection:e,models:s}}catch{return{connection:e,models:[]}}})))){let t=e.connection.provider||e.connection.id,r=i.get(t);r&&r.models.push(...e.models)}let o=Array.from(i.values()).map(e=>({...e,models:(function(e){let t=new Map;for(let r of e)r?.id&&(t.has(r.id)||t.set(r.id,r));return Array.from(t.values())})(e.models).sort((e,t)=>e.name.localeCompare(t.name))})).filter(e=>e.models.length>0).sort((e,t)=>e.providerName.localeCompare(t.providerName));e||(t(o),0===o.length&&v("Providers connected but no models available."))}catch(r){e||(v(p(r?.message)||"Failed to load providers/models."),t([]))}finally{e||g(!1)}}(),()=>{e=!0}},[]),(0,a.useEffect)(()=>{let e=e=>{H.current&&!H.current.contains(e.target)&&J(!1),Y.current&&!Y.current.contains(e.target)&&F(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let G=(0,a.useMemo)(()=>{let t=new Map;for(let r of e)for(let e of r.models)t.set(e.id,{...e,providerId:r.providerId,providerName:r.providerName});return t},[e]),Q=(0,a.useMemo)(()=>e.find(e=>e.providerId===S)||e[0]||null,[e,S]),V=(0,a.useMemo)(()=>{if(A&&G.has(A))return G.get(A);if(y){let e=b.find(e=>e.id===y);if(e?.modelId&&G.has(e.modelId))return G.get(e.modelId)}return Q?.models?.[0]||null},[A,G,Q,b,y]),X=(0,a.useMemo)(()=>b.find(e=>e.id===y)||null,[b,y]),Z=X?.messages||[],ee=(0,a.useMemo)(()=>[...b].sort((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()),[b]),et=!_&&!!V&&(D.trim().length>0||$.length>0);(0,a.useEffect)(()=>{if(z)try{globalThis.localStorage.setItem(o,JSON.stringify(b)),globalThis.localStorage.setItem(d,y),globalThis.localStorage.setItem(c,S),globalThis.localStorage.setItem(m,D)}catch{}},[z,b,y,S,D]),(0,a.useEffect)(()=>{if(!z||r||W.current||0===e.length)return;let t=e.find(e=>e.providerId===S)||e[0],s=A&&G.has(A)?G.get(A):t.models[0];if(b.length>0){let e=b.find(e=>e.id===y)||b[0],r=e?.modelId&&G.has(e.modelId)?G.get(e.modelId):s;W.current=!0,j(e.id),I(r?.providerId||t.providerId),k(r?.id||s.id);return}let a={id:u(),title:"New chat",providerId:t.providerId,providerName:t.providerName,modelId:s.id,modelName:s.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]};W.current=!0,N([a]),j(a.id),I(t.providerId),k(s.id)},[z,r,e,G,b,y,S,A]);let er=(e,t)=>{N(r=>r.map(r=>r.id===e?t({...r,messages:Array.isArray(r.messages)?r.messages.map(e=>({...e})):[]}):r))},es=e=>e?{id:u(),title:"New chat",providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]}:null,ea=async e=>{let t=Array.from(e.target.files||[]);if(0===t.length)return;let r=t.filter(e=>e.type.startsWith("image/"));if(0===r.length){e.target.value="";return}let s=await Promise.all(r.map(async e=>({id:u(),name:e.name,type:e.type,size:e.size,dataUrl:await x(e)})));C(e=>[...e,...s]),e.target.value=""},ei=async()=>{let e=V||Q?.models?.[0]||null;if(!e)return;let t=D.trim();if(!t&&0===$.length)return;let r=y,s=b.find(e=>e.id===r);if(!s){if(!(s=es(e)))return;r=s.id,N(e=>[s,...e]),j(r)}let a={id:u(),role:"user",content:t,attachments:$.map(e=>({id:e.id,name:e.name,type:e.type,dataUrl:e.dataUrl})),createdAt:new Date().toISOString()},i=u(),l={id:i,role:"assistant",content:"",createdAt:new Date().toISOString(),status:"streaming"},n=[...s.messages||[],a,l];N(s=>s.map(s=>s.id===r?{...s,providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,messages:n,updatedAt:new Date().toISOString(),title:"New chat"===s.title?h(t):s.title}:s)),O(""),C([]),M(!0),T(i),R(""),L.current?.abort(),L.current=new AbortController;let o=n.filter(e=>"assistant"!==e.role||e.id!==i).map(e=>({role:e.role,content:"user"===e.role?function(e){let t=p(e.content).trim(),r=Array.isArray(e.attachments)?e.attachments:[];if(0===r.length)return t;let s=[];for(let e of(t&&s.push({type:"text",text:t}),r))e?.dataUrl&&s.push({type:"image_url",image_url:{url:e.dataUrl}});return s.length>0?s:t}(e):e.content}));try{var d;let s,a=await fetch("/api/dashboard/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({model:e.requestModel||e.id,messages:o,stream:!0}),signal:L.current.signal});if(!a.ok){let e=await a.json().catch(()=>({}));throw Error(p(e.error||e.message||`Request failed (${a.status})`))}let l=a.body?.getReader();if(!l){let e=await a.json().catch(()=>({})),t=p(e?.choices?.[0]?.message?.content||e?.output_text||e?.error||e?.message||"");er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:t,status:"done"}:e),updatedAt:new Date().toISOString()}));return}let n=new TextDecoder,c="",m="";for(;;){let{value:e,done:t}=await l.read();if(t)break;let s=(c+=n.decode(e,{stream:!0})).split(/\r?\n/);for(let e of(c=s.pop()||"",s)){let t=e.trim();if(!t.startsWith("data:"))continue;let s=t.slice(5).trim();if(s&&"[DONE]"!==s)try{let e=JSON.parse(s),t=function(e){if(!e||"object"!=typeof e)return"";let t=e.choices?.[0];return[(t?.delta||{}).content,t?.message?.content,e.output_text,e.text].map(p).filter(Boolean)[0]||""}(e);if(!t)continue;m+=t,R(m),er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:m,status:"streaming"}:e),updatedAt:new Date().toISOString()}))}catch{}}}er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:m||e.content,status:"done"}:e),updatedAt:new Date().toISOString()})),d=r,s=h(t),er(d,e=>({...e,title:"New chat"===e.title?s:e.title,updatedAt:new Date().toISOString()}))}catch(e){if("AbortError"!==e.name){let t=p(e?.message||e);er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:e.content||`Error: ${t}`,status:"error"}:e),updatedAt:new Date().toISOString()})),v(t||"Failed to send message.")}}finally{M(!1),T(""),R(""),L.current=null}},el=V?`${V.name}`:"Select model",en=V?V.requestModel:"Choose from connected providers";return(0,s.jsx)("div",{className:"relative flex-1 flex flex-col h-full min-h-0 min-w-0 bg-[#212121] text-white overflow-hidden",children:(0,s.jsxs)("div",{className:"relative mx-auto flex flex-1 h-full min-h-0 w-full max-w-4xl flex-col",children:[(0,s.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-3 px-4 py-3 lg:px-6",children:[(0,s.jsxs)("div",{ref:H,className:"relative",children:[(0,s.jsx)("button",{type:"button",onClick:()=>J(e=>!e),className:"flex items-center gap-3 rounded-2xl border border-white/10 bg-white/5 px-4 py-3 text-left transition hover:bg-white/8",children:(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-semibold text-white",children:el}),(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px] text-white/70",children:"expand_more"})]}),(0,s.jsx)("p",{className:"truncate text-xs text-white/55",children:en})]})}),P?(0,s.jsxs)("div",{className:"absolute left-0 top-[calc(100%+10px)] z-30 w-[min(520px,calc(100vw-2rem))] overflow-hidden rounded-[20px] border border-white/10 bg-[#262626] shadow-2xl shadow-black/50",children:[(0,s.jsxs)("div",{className:"border-b border-white/10 px-4 py-3",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-white/45",children:"Models"}),(0,s.jsx)("p",{className:"text-sm text-white/75",children:"Only from connected providers"})]}),(0,s.jsx)("div",{className:"max-h-[60vh] overflow-y-auto p-2 custom-scrollbar",children:e.map(e=>(0,s.jsxs)("div",{className:"mb-2 rounded-[16px] border border-white/10 bg-black/20 p-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-2 py-2",children:[(0,s.jsx)("p",{className:"text-sm font-semibold text-white",children:e.providerName}),(0,s.jsx)(i.Ex,{size:"sm",variant:"default",children:e.models.length})]}),(0,s.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:e.models.map(e=>{let t=e.id===A;return(0,s.jsx)("button",{type:"button",onClick:()=>(e=>{let t=G.get(e);if(!t)return;let r=b.find(e=>e.id===y);if(r&&r.messages.length>0){let e=es(t);if(!e)return;N(t=>[e,...t]),j(e.id)}else if(r)N(e=>e.map(e=>e.id===r.id?{...e,providerId:t.providerId,providerName:t.providerName,modelId:t.id,modelName:t.name}:e)),j(r.id);else{let e=es(t);if(!e)return;N(t=>[e,...t]),j(e.id)}I(t.providerId),k(t.id),J(!1)})(e.id),className:`rounded-[14px] border px-3 py-3 text-left transition ${t?"border-blue-400/40 bg-blue-500/15":"border-white/10 bg-white/5 hover:bg-white/8"}`,children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"truncate text-sm font-medium text-white",children:e.name}),(0,s.jsx)("p",{className:"truncate text-[11px] text-white/45",children:e.requestModel})]}),t?(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px] text-blue-300",children:"check_circle"}):null]})},e.id)})})]},e.providerId))})]}):null]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>F(e=>!e),className:"rounded-2xl border border-white/10 bg-white/5 px-4 py-3 text-sm text-white/80 transition hover:bg-white/8",children:"History"}),(0,s.jsx)(i.$n,{variant:"ghost",size:"sm",icon:"delete",onClick:()=>{if(!y)return;let e=b.filter(e=>e.id!==y),t=e[0]||null;N(e),t?(j(t.id),I(t.providerId),k(t.modelId)):(j(""),I(""),k(""))},disabled:!y||0===b.length,children:"Clear"})]})]}),B?(0,s.jsxs)("div",{ref:Y,className:"absolute right-4 top-[72px] z-20 w-[min(360px,calc(100vw-2rem))] rounded-[20px] border border-white/10 bg-[#262626] p-2 shadow-2xl shadow-black/50 lg:right-6",children:[(0,s.jsx)("div",{className:"px-3 py-2",children:(0,s.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-white/45",children:"Recent chats"})}),(0,s.jsx)("div",{className:"max-h-[48vh] space-y-2 overflow-y-auto p-1 custom-scrollbar",children:0===ee.length?(0,s.jsx)("div",{className:"rounded-[16px] border border-dashed border-white/10 bg-white/5 p-4 text-sm text-white/55",children:"No conversations yet."}):ee.map(e=>{let t=e.id===y,r=[...e.messages||[]].reverse().find(e=>"user"===e.role)||e.messages?.[0];return(0,s.jsx)("button",{type:"button",onClick:()=>{var t;let r;return t=e.id,void((r=b.find(e=>e.id===t))&&(j(t),I(r.providerId||S),k(r.modelId||A),F(!1)))},className:`w-full rounded-[16px] border px-3 py-3 text-left transition ${t?"border-blue-400/40 bg-blue-500/15":"border-white/10 bg-white/5 hover:bg-white/8"}`,children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"truncate text-sm font-medium text-white",children:e.title}),(0,s.jsx)("p",{className:"mt-1 truncate text-xs text-white/50",children:p(r?.content)||"Empty chat"})]}),(0,s.jsx)("span",{className:"text-[10px] text-white/40 shrink-0",children:function(e){if(!e)return"Now";let t=new Date(e).getTime();if(Number.isNaN(t))return"Now";let r=Math.max(1,Math.round((Date.now()-t)/6e4));if(r<60)return`${r}m`;let s=Math.round(r/60);return s<24?`${s}h`:`${Math.round(s/24)}d`}(e.updatedAt)})]})},e.id)})})]}):null,w?(0,s.jsx)("div",{className:"mt-4 rounded-[18px] border border-rose-500/20 bg-rose-500/10 px-4 py-3 text-rose-100",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"error"}),(0,s.jsx)("p",{className:"text-sm leading-6",children:w})]})}):null,(0,s.jsxs)("div",{className:"flex flex-1 flex-col min-h-0",children:[(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto py-4 custom-scrollbar",children:[0===Z.length?(0,s.jsx)("div",{className:"flex min-h-[50vh] items-center justify-center px-4 text-center",children:(0,s.jsxs)("div",{className:"max-w-xl space-y-4",children:[(0,s.jsx)("div",{className:"mx-auto flex size-16 items-center justify-center rounded-[20px] border border-white/10 bg-white/5 text-white/80",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[30px]",children:"chat"})}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h2",{className:"text-2xl font-semibold text-white",children:"Start a conversation"}),(0,s.jsx)("p",{className:"text-sm leading-6 text-white/60",children:"Simple chat interface to interact with any AI model from connected providers. Select a model and start chatting!"})]})]})}):null,(0,s.jsx)("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-4 px-4",children:Z.map(e=>{let t="user"===e.role,r="assistant"===e.role,a=r&&e.id===E&&"streaming"===e.status,i=p(e.content)||(r?U:"");return(0,s.jsx)("div",{className:`flex w-full ${t?"justify-end":"justify-start"} mb-6`,children:(0,s.jsxs)("div",{className:`max-w-[min(88%,42rem)] ${t?"rounded-3xl bg-[#2f2f2f] px-5 py-3.5 text-white":"text-white/90"}`,children:[(0,s.jsx)("div",{className:"mb-1 flex items-center justify-between gap-3",children:(0,s.jsx)("span",{className:"text-xs font-semibold",children:t?"You":V?.name||"Assistant"})}),e.attachments?.length?(0,s.jsx)("div",{className:"mb-3 grid grid-cols-2 gap-2 sm:grid-cols-3 mt-2",children:e.attachments.map(e=>(0,s.jsx)("a",{href:e.dataUrl,target:"_blank",rel:"noreferrer",className:"overflow-hidden rounded-[18px] border border-white/10 bg-black/20",children:(0,s.jsx)("img",{src:e.dataUrl,alt:e.name,className:"h-28 w-full object-cover"})},e.id))}):null,(0,s.jsxs)("div",{className:"whitespace-pre-wrap break-words text-[15px] leading-7",children:[i,r&&a&&!U?(0,s.jsx)("span",{className:"inline-block animate-pulse",children:"▋"}):null]})]})},e.id)})})]}),(0,s.jsxs)("div",{className:"shrink-0 pt-2",children:[$.length>0?(0,s.jsx)("div",{className:"mx-auto mb-3 flex w-full max-w-3xl flex-wrap gap-2 px-4",children:$.map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-2 rounded-full border border-white/10 bg-white/5 px-3 py-2",children:[(0,s.jsx)("span",{className:"text-xs text-white/80 max-w-[12rem] truncate",children:e.name}),(0,s.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void C(e=>e.filter(e=>e.id!==t))},className:"text-white/55 hover:text-white","aria-label":"Remove attachment",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]},e.id))}):null,(0,s.jsx)("div",{className:"mx-auto w-full max-w-3xl px-4 pb-2",children:(0,s.jsxs)("div",{className:"rounded-[26px] bg-[#2f2f2f] px-3 pt-3 pb-2 shadow-[0_0_15px_rgba(0,0,0,0.10)] ring-1 ring-white/5",children:[(0,s.jsx)("textarea",{value:D,onChange:e=>O(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),et&&ei())},placeholder:"Message AI",rows:1,className:"w-full resize-none bg-transparent px-2 text-[15px] leading-6 text-white outline-none placeholder:text-white/40 custom-scrollbar max-h-[25vh] overflow-y-auto"}),(0,s.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>K.current?.click(),disabled:!V||r,className:"p-2 text-white/50 hover:text-white transition rounded-full hover:bg-white/5",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"attach_file"})}),(0,s.jsx)("input",{ref:K,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:ea}),(0,s.jsx)("span",{className:"text-xs font-medium text-white/30 truncate max-w-[120px]",children:V?V.name:"No model"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[_?(0,s.jsx)("button",{type:"button",onClick:()=>{L.current?.abort()},className:"p-2 text-white bg-white/10 hover:bg-white/20 transition rounded-full h-8 w-8 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop"})}):null,(0,s.jsx)("button",{onClick:ei,disabled:!et,className:`h-8 w-8 rounded-full flex items-center justify-center transition ${et?"bg-white text-black hover:opacity-90":"bg-white/10 text-white/30 cursor-not-allowed"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_upward"})})]})]})]})})]}),(0,s.jsx)("p",{className:"mx-auto mt-2 max-w-3xl px-4 pb-4 text-center text-[11px] text-white/30",children:"Model list is filtered from connected providers."})]})]})})}}},e=>{e.O(0,[2574,3862,1610,2562,1321,705,5497,8441,3794,7358],()=>e(e.s=70065)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4465],{55774:(e,t,r)=>{Promise.resolve().then(r.bind(r,88512))},88512:(e,t,r)=>{"use strict";r.d(t,{default:()=>g});var s=r(95155),a=r(12115),i=r(35497),l=r(28777),n=r(88105);let o="basic-chat.sessions",d="basic-chat.activeSessionId",c="basic-chat.activeProviderId",m="basic-chat.draft";function u(){return globalThis.crypto?.randomUUID?globalThis.crypto.randomUUID():`chat_${Date.now()}_${Math.random().toString(16).slice(2)}`}function p(e){if("string"==typeof e)return e;if(null==e)return"";if(Array.isArray(e))return e.map(p).filter(Boolean).join(" ");if("object"==typeof e){if("string"==typeof e.message)return e.message;if("string"==typeof e.error)return e.error;try{return JSON.stringify(e)}catch{}}return String(e)}function h(e=""){let t=p(e).replace(/\s+/g," ").trim();return t?t.length>52?`${t.slice(0,52).trimEnd()}…`:t:"New chat"}async function x(e){return await new Promise((t,r)=>{let s=new FileReader;s.onload=()=>t(String(s.result||"")),s.onerror=()=>r(s.error||Error("Failed to read file")),s.readAsDataURL(e)})}function f(e){return e?.name||function(e=""){return String(e).replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()||"Unknown"}(e?.provider||e?.id||"provider")}function g(){let[e,t]=(0,a.useState)([]),[r,g]=(0,a.useState)(!0),[w,v]=(0,a.useState)(""),[b,N]=(0,a.useState)(()=>{try{let e=function(e,t){try{return JSON.parse(e)}catch{return t}}(globalThis.localStorage.getItem(o),[]);return Array.isArray(e)?e.map(e=>({...e,messages:Array.isArray(e.messages)?e.messages:[]})):[]}catch{return[]}}),[y,j]=(0,a.useState)(()=>globalThis.localStorage.getItem(d)||""),[S,I]=(0,a.useState)(()=>globalThis.localStorage.getItem(c)||""),[A,k]=(0,a.useState)(""),[D,O]=(0,a.useState)(()=>globalThis.localStorage.getItem(m)||""),[$,C]=(0,a.useState)([]),[_,M]=(0,a.useState)(!1),[E,T]=(0,a.useState)(""),[U,R]=(0,a.useState)(""),[z,q]=(0,a.useState)(!1),[P,J]=(0,a.useState)(!1),[B,F]=(0,a.useState)(!1),K=(0,a.useRef)(null),L=(0,a.useRef)(null),W=(0,a.useRef)(!1),H=(0,a.useRef)(null),Y=(0,a.useRef)(null);(0,a.useEffect)(()=>{q(!0)},[]),(0,a.useEffect)(()=>{let e=!1;return async function(){g(!0),v("");try{let r=await fetch("/api/providers",{cache:"no-store"}),s=await r.json().catch(()=>({})),a=Array.isArray(s.connections)?s.connections.filter(e=>e?.isActive!==!1):[];if(0===a.length){e||(t([]),v("No providers connected yet."));return}let i=new Map;for(let e of a){let t=e.provider||e.id,r=f(e),s=(0,n.mq)(t)?"openai-compatible":(0,n.gb)(t)?"anthropic-compatible":t;i.has(t)||i.set(t,{providerId:t,providerName:r,providerType:s,connections:[],models:[]});let a=i.get(t);a.providerName=a.providerName||r,a.providerType=a.providerType||s,a.connections.push(e);let o=(0,l.KC)(t).map(t=>t?.id?{id:`${e.provider}/${t.id}`,requestModel:`${e.provider}/${t.id}`,name:t.name||t.id,providerId:e.provider,providerName:f(e),source:"static"}:null).filter(Boolean);a.models.push(...o)}for(let e of(await Promise.all(a.map(async e=>{try{let t=await fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)return{connection:e,models:[]};let s=(Array.isArray(r?.models)?r.models:Array.isArray(r?.data)?r.data:Array.isArray(r?.results)?r.results:Array.isArray(r)?r:[]).map(t=>(function(e,t){let r="string"==typeof e?e:e?.id||e?.name||e?.model||"";if(!r)return null;let s="string"==typeof e?e:e?.name||e?.displayName||r,a=r;return((0,n.mq)(t.provider)||(0,n.gb)(t.provider))&&!r.includes("/")&&(a=`${t.provider}/${r}`),{id:a,requestModel:a,name:s,providerId:t.provider,providerName:f(t),source:"live"}})(t,e)).filter(Boolean);return{connection:e,models:s}}catch{return{connection:e,models:[]}}})))){let t=e.connection.provider||e.connection.id,r=i.get(t);r&&r.models.push(...e.models)}let o=Array.from(i.values()).map(e=>({...e,models:(function(e){let t=new Map;for(let r of e)r?.id&&(t.has(r.id)||t.set(r.id,r));return Array.from(t.values())})(e.models).sort((e,t)=>e.name.localeCompare(t.name))})).filter(e=>e.models.length>0).sort((e,t)=>e.providerName.localeCompare(t.providerName));e||(t(o),0===o.length&&v("Providers connected but no models available."))}catch(r){e||(v(p(r?.message)||"Failed to load providers/models."),t([]))}finally{e||g(!1)}}(),()=>{e=!0}},[]),(0,a.useEffect)(()=>{let e=e=>{H.current&&!H.current.contains(e.target)&&J(!1),Y.current&&!Y.current.contains(e.target)&&F(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let G=(0,a.useMemo)(()=>{let t=new Map;for(let r of e)for(let e of r.models)t.set(e.id,{...e,providerId:r.providerId,providerName:r.providerName});return t},[e]),Q=(0,a.useMemo)(()=>e.find(e=>e.providerId===S)||e[0]||null,[e,S]),V=(0,a.useMemo)(()=>{if(A&&G.has(A))return G.get(A);if(y){let e=b.find(e=>e.id===y);if(e?.modelId&&G.has(e.modelId))return G.get(e.modelId)}return Q?.models?.[0]||null},[A,G,Q,b,y]),X=(0,a.useMemo)(()=>b.find(e=>e.id===y)||null,[b,y]),Z=X?.messages||[],ee=(0,a.useMemo)(()=>[...b].sort((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()),[b]),et=!_&&!!V&&(D.trim().length>0||$.length>0);(0,a.useEffect)(()=>{if(z)try{globalThis.localStorage.setItem(o,JSON.stringify(b)),globalThis.localStorage.setItem(d,y),globalThis.localStorage.setItem(c,S),globalThis.localStorage.setItem(m,D)}catch{}},[z,b,y,S,D]),(0,a.useEffect)(()=>{if(!z||r||W.current||0===e.length)return;let t=e.find(e=>e.providerId===S)||e[0],s=A&&G.has(A)?G.get(A):t.models[0];if(b.length>0){let e=b.find(e=>e.id===y)||b[0],r=e?.modelId&&G.has(e.modelId)?G.get(e.modelId):s;W.current=!0,j(e.id),I(r?.providerId||t.providerId),k(r?.id||s.id);return}let a={id:u(),title:"New chat",providerId:t.providerId,providerName:t.providerName,modelId:s.id,modelName:s.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]};W.current=!0,N([a]),j(a.id),I(t.providerId),k(s.id)},[z,r,e,G,b,y,S,A]);let er=(e,t)=>{N(r=>r.map(r=>r.id===e?t({...r,messages:Array.isArray(r.messages)?r.messages.map(e=>({...e})):[]}):r))},es=e=>e?{id:u(),title:"New chat",providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]}:null,ea=async e=>{let t=Array.from(e.target.files||[]);if(0===t.length)return;let r=t.filter(e=>e.type.startsWith("image/"));if(0===r.length){e.target.value="";return}let s=await Promise.all(r.map(async e=>({id:u(),name:e.name,type:e.type,size:e.size,dataUrl:await x(e)})));C(e=>[...e,...s]),e.target.value=""},ei=async()=>{let e=V||Q?.models?.[0]||null;if(!e)return;let t=D.trim();if(!t&&0===$.length)return;let r=y,s=b.find(e=>e.id===r);if(!s){if(!(s=es(e)))return;r=s.id,N(e=>[s,...e]),j(r)}let a={id:u(),role:"user",content:t,attachments:$.map(e=>({id:e.id,name:e.name,type:e.type,dataUrl:e.dataUrl})),createdAt:new Date().toISOString()},i=u(),l={id:i,role:"assistant",content:"",createdAt:new Date().toISOString(),status:"streaming"},n=[...s.messages||[],a,l];N(s=>s.map(s=>s.id===r?{...s,providerId:e.providerId,providerName:e.providerName,modelId:e.id,modelName:e.name,messages:n,updatedAt:new Date().toISOString(),title:"New chat"===s.title?h(t):s.title}:s)),O(""),C([]),M(!0),T(i),R(""),L.current?.abort(),L.current=new AbortController;let o=n.filter(e=>"assistant"!==e.role||e.id!==i).map(e=>({role:e.role,content:"user"===e.role?function(e){let t=p(e.content).trim(),r=Array.isArray(e.attachments)?e.attachments:[];if(0===r.length)return t;let s=[];for(let e of(t&&s.push({type:"text",text:t}),r))e?.dataUrl&&s.push({type:"image_url",image_url:{url:e.dataUrl}});return s.length>0?s:t}(e):e.content}));try{var d;let s,a=await fetch("/api/dashboard/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({model:e.requestModel||e.id,messages:o,stream:!0}),signal:L.current.signal});if(!a.ok){let e=await a.json().catch(()=>({}));throw Error(p(e.error||e.message||`Request failed (${a.status})`))}let l=a.body?.getReader();if(!l){let e=await a.json().catch(()=>({})),t=p(e?.choices?.[0]?.message?.content||e?.output_text||e?.error||e?.message||"");er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:t,status:"done"}:e),updatedAt:new Date().toISOString()}));return}let n=new TextDecoder,c="",m="";for(;;){let{value:e,done:t}=await l.read();if(t)break;let s=(c+=n.decode(e,{stream:!0})).split(/\r?\n/);for(let e of(c=s.pop()||"",s)){let t=e.trim();if(!t.startsWith("data:"))continue;let s=t.slice(5).trim();if(s&&"[DONE]"!==s)try{let e=JSON.parse(s),t=function(e){if(!e||"object"!=typeof e)return"";let t=e.choices?.[0];return[(t?.delta||{}).content,t?.message?.content,e.output_text,e.text].map(p).filter(Boolean)[0]||""}(e);if(!t)continue;m+=t,R(m),er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:m,status:"streaming"}:e),updatedAt:new Date().toISOString()}))}catch{}}}er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:m||e.content,status:"done"}:e),updatedAt:new Date().toISOString()})),d=r,s=h(t),er(d,e=>({...e,title:"New chat"===e.title?s:e.title,updatedAt:new Date().toISOString()}))}catch(e){if("AbortError"!==e.name){let t=p(e?.message||e);er(r,e=>({...e,messages:e.messages.map(e=>e.id===i?{...e,content:e.content||`Error: ${t}`,status:"error"}:e),updatedAt:new Date().toISOString()})),v(t||"Failed to send message.")}}finally{M(!1),T(""),R(""),L.current=null}},el=V?`${V.name}`:"Select model",en=V?V.requestModel:"Choose from connected providers";return(0,s.jsx)("div",{className:"relative flex-1 flex flex-col h-full min-h-0 min-w-0 bg-[#212121] text-white overflow-hidden",children:(0,s.jsxs)("div",{className:"relative mx-auto flex flex-1 h-full min-h-0 w-full max-w-4xl flex-col",children:[(0,s.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-3 px-4 py-3 lg:px-6",children:[(0,s.jsxs)("div",{ref:H,className:"relative",children:[(0,s.jsx)("button",{type:"button",onClick:()=>J(e=>!e),className:"flex items-center gap-3 rounded-2xl border border-white/10 bg-white/5 px-4 py-3 text-left transition hover:bg-white/8",children:(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-semibold text-white",children:el}),(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px] text-white/70",children:"expand_more"})]}),(0,s.jsx)("p",{className:"truncate text-xs text-white/55",children:en})]})}),P?(0,s.jsxs)("div",{className:"absolute left-0 top-[calc(100%+10px)] z-30 w-[min(520px,calc(100vw-2rem))] overflow-hidden rounded-[20px] border border-white/10 bg-[#262626] shadow-2xl shadow-black/50",children:[(0,s.jsxs)("div",{className:"border-b border-white/10 px-4 py-3",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-white/45",children:"Models"}),(0,s.jsx)("p",{className:"text-sm text-white/75",children:"Only from connected providers"})]}),(0,s.jsx)("div",{className:"max-h-[60vh] overflow-y-auto p-2 custom-scrollbar",children:e.map(e=>(0,s.jsxs)("div",{className:"mb-2 rounded-[16px] border border-white/10 bg-black/20 p-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-2 py-2",children:[(0,s.jsx)("p",{className:"text-sm font-semibold text-white",children:e.providerName}),(0,s.jsx)(i.Ex,{size:"sm",variant:"default",children:e.models.length})]}),(0,s.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:e.models.map(e=>{let t=e.id===A;return(0,s.jsx)("button",{type:"button",onClick:()=>(e=>{let t=G.get(e);if(!t)return;let r=b.find(e=>e.id===y);if(r&&r.messages.length>0){let e=es(t);if(!e)return;N(t=>[e,...t]),j(e.id)}else if(r)N(e=>e.map(e=>e.id===r.id?{...e,providerId:t.providerId,providerName:t.providerName,modelId:t.id,modelName:t.name}:e)),j(r.id);else{let e=es(t);if(!e)return;N(t=>[e,...t]),j(e.id)}I(t.providerId),k(t.id),J(!1)})(e.id),className:`rounded-[14px] border px-3 py-3 text-left transition ${t?"border-blue-400/40 bg-blue-500/15":"border-white/10 bg-white/5 hover:bg-white/8"}`,children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"truncate text-sm font-medium text-white",children:e.name}),(0,s.jsx)("p",{className:"truncate text-[11px] text-white/45",children:e.requestModel})]}),t?(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px] text-blue-300",children:"check_circle"}):null]})},e.id)})})]},e.providerId))})]}):null]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>F(e=>!e),className:"rounded-2xl border border-white/10 bg-white/5 px-4 py-3 text-sm text-white/80 transition hover:bg-white/8",children:"History"}),(0,s.jsx)(i.$n,{variant:"ghost",size:"sm",icon:"delete",onClick:()=>{if(!y)return;let e=b.filter(e=>e.id!==y),t=e[0]||null;N(e),t?(j(t.id),I(t.providerId),k(t.modelId)):(j(""),I(""),k(""))},disabled:!y||0===b.length,children:"Clear"})]})]}),B?(0,s.jsxs)("div",{ref:Y,className:"absolute right-4 top-[72px] z-20 w-[min(360px,calc(100vw-2rem))] rounded-[20px] border border-white/10 bg-[#262626] p-2 shadow-2xl shadow-black/50 lg:right-6",children:[(0,s.jsx)("div",{className:"px-3 py-2",children:(0,s.jsx)("p",{className:"text-xs uppercase tracking-[0.22em] text-white/45",children:"Recent chats"})}),(0,s.jsx)("div",{className:"max-h-[48vh] space-y-2 overflow-y-auto p-1 custom-scrollbar",children:0===ee.length?(0,s.jsx)("div",{className:"rounded-[16px] border border-dashed border-white/10 bg-white/5 p-4 text-sm text-white/55",children:"No conversations yet."}):ee.map(e=>{let t=e.id===y,r=[...e.messages||[]].reverse().find(e=>"user"===e.role)||e.messages?.[0];return(0,s.jsx)("button",{type:"button",onClick:()=>{var t;let r;return t=e.id,void((r=b.find(e=>e.id===t))&&(j(t),I(r.providerId||S),k(r.modelId||A),F(!1)))},className:`w-full rounded-[16px] border px-3 py-3 text-left transition ${t?"border-blue-400/40 bg-blue-500/15":"border-white/10 bg-white/5 hover:bg-white/8"}`,children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"truncate text-sm font-medium text-white",children:e.title}),(0,s.jsx)("p",{className:"mt-1 truncate text-xs text-white/50",children:p(r?.content)||"Empty chat"})]}),(0,s.jsx)("span",{className:"text-[10px] text-white/40 shrink-0",children:function(e){if(!e)return"Now";let t=new Date(e).getTime();if(Number.isNaN(t))return"Now";let r=Math.max(1,Math.round((Date.now()-t)/6e4));if(r<60)return`${r}m`;let s=Math.round(r/60);return s<24?`${s}h`:`${Math.round(s/24)}d`}(e.updatedAt)})]})},e.id)})})]}):null,w?(0,s.jsx)("div",{className:"mt-4 rounded-[18px] border border-rose-500/20 bg-rose-500/10 px-4 py-3 text-rose-100",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"error"}),(0,s.jsx)("p",{className:"text-sm leading-6",children:w})]})}):null,(0,s.jsxs)("div",{className:"flex flex-1 flex-col min-h-0",children:[(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto py-4 custom-scrollbar",children:[0===Z.length?(0,s.jsx)("div",{className:"flex min-h-[50vh] items-center justify-center px-4 text-center",children:(0,s.jsxs)("div",{className:"max-w-xl space-y-4",children:[(0,s.jsx)("div",{className:"mx-auto flex size-16 items-center justify-center rounded-[20px] border border-white/10 bg-white/5 text-white/80",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[30px]",children:"chat"})}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h2",{className:"text-2xl font-semibold text-white",children:"Start a conversation"}),(0,s.jsx)("p",{className:"text-sm leading-6 text-white/60",children:"Simple chat interface to interact with any AI model from connected providers. Select a model and start chatting!"})]})]})}):null,(0,s.jsx)("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-4 px-4",children:Z.map(e=>{let t="user"===e.role,r="assistant"===e.role,a=r&&e.id===E&&"streaming"===e.status,i=p(e.content)||(r?U:"");return(0,s.jsx)("div",{className:`flex w-full ${t?"justify-end":"justify-start"} mb-6`,children:(0,s.jsxs)("div",{className:`max-w-[min(88%,42rem)] ${t?"rounded-3xl bg-[#2f2f2f] px-5 py-3.5 text-white":"text-white/90"}`,children:[(0,s.jsx)("div",{className:"mb-1 flex items-center justify-between gap-3",children:(0,s.jsx)("span",{className:"text-xs font-semibold",children:t?"You":V?.name||"Assistant"})}),e.attachments?.length?(0,s.jsx)("div",{className:"mb-3 grid grid-cols-2 gap-2 sm:grid-cols-3 mt-2",children:e.attachments.map(e=>(0,s.jsx)("a",{href:e.dataUrl,target:"_blank",rel:"noreferrer",className:"overflow-hidden rounded-[18px] border border-white/10 bg-black/20",children:(0,s.jsx)("img",{src:e.dataUrl,alt:e.name,className:"h-28 w-full object-cover"})},e.id))}):null,(0,s.jsxs)("div",{className:"whitespace-pre-wrap break-words text-[15px] leading-7",children:[i,r&&a&&!U?(0,s.jsx)("span",{className:"inline-block animate-pulse",children:"▋"}):null]})]})},e.id)})})]}),(0,s.jsxs)("div",{className:"shrink-0 pt-2",children:[$.length>0?(0,s.jsx)("div",{className:"mx-auto mb-3 flex w-full max-w-3xl flex-wrap gap-2 px-4",children:$.map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-2 rounded-full border border-white/10 bg-white/5 px-3 py-2",children:[(0,s.jsx)("span",{className:"text-xs text-white/80 max-w-[12rem] truncate",children:e.name}),(0,s.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void C(e=>e.filter(e=>e.id!==t))},className:"text-white/55 hover:text-white","aria-label":"Remove attachment",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]},e.id))}):null,(0,s.jsx)("div",{className:"mx-auto w-full max-w-3xl px-4 pb-2",children:(0,s.jsxs)("div",{className:"rounded-[26px] bg-[#2f2f2f] px-3 pt-3 pb-2 shadow-[0_0_15px_rgba(0,0,0,0.10)] ring-1 ring-white/5",children:[(0,s.jsx)("textarea",{value:D,onChange:e=>O(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),et&&ei())},placeholder:"Message AI",rows:1,className:"w-full resize-none bg-transparent px-2 text-[15px] leading-6 text-white outline-none placeholder:text-white/40 custom-scrollbar max-h-[25vh] overflow-y-auto"}),(0,s.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>K.current?.click(),disabled:!V||r,className:"p-2 text-white/50 hover:text-white transition rounded-full hover:bg-white/5",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"attach_file"})}),(0,s.jsx)("input",{ref:K,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:ea}),(0,s.jsx)("span",{className:"text-xs font-medium text-white/30 truncate max-w-[120px]",children:V?V.name:"No model"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[_?(0,s.jsx)("button",{type:"button",onClick:()=>{L.current?.abort()},className:"p-2 text-white bg-white/10 hover:bg-white/20 transition rounded-full h-8 w-8 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop"})}):null,(0,s.jsx)("button",{onClick:ei,disabled:!et,className:`h-8 w-8 rounded-full flex items-center justify-center transition ${et?"bg-white text-black hover:opacity-90":"bg-white/10 text-white/30 cursor-not-allowed"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_upward"})})]})]})]})})]}),(0,s.jsx)("p",{className:"mx-auto mt-2 max-w-3xl px-4 pb-4 text-center text-[11px] text-white/30",children:"Model list is filtered from connected providers."})]})]})})}}},e=>{e.O(0,[2574,3862,1610,2562,1321,705,5497,8441,3794,7358],()=>e(e.s=55774)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3554],{7769:(e,r,s)=>{Promise.resolve().then(s.bind(s,85309))},85309:(e,r,s)=>{"use strict";s.d(r,{default:()=>v});var t=s(95155),a=s(12115),i=s(98500),o=s.n(i),l=s(35497),c=s(3534),d=s(28777),n=s(37700);function v({toolId:e,machineId:r}){let s=c.dM[e],[i,x]=(0,a.useState)([]),[u,h]=(0,a.useState)(!0),[m,p]=(0,a.useState)({}),[f,P]=(0,a.useState)([]);(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{let[r,s]=await Promise.all([fetch("/api/providers"),fetch("/api/keys")]);if(!e)return;if(r.ok){let e=await r.json();x(e.connections||[])}if(s.ok){let e=await s.json();P(e.keys||[])}}catch(e){console.log("Error loading tool data:",e)}finally{e&&h(!1)}})(),()=>{e=!1}},[]);let j=()=>i.filter(e=>!1!==e.isActive),w=(0,a.useCallback)((e,r,s)=>{p(t=>t[e]?.[r]===s?t:{...t,[e]:{...t[e],[r]:s}})},[]);return s?u?(0,t.jsx)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:(0,t.jsx)(l.Qv,{})}):(0,t.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:[(0,t.jsxs)(o(),{href:"/dashboard/cli-tools",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary w-fit",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),"Back to CLI Tools"]}),r?(0,t.jsxs)("p",{className:"text-xs text-text-muted font-mono",children:["Machine: ",r]}):null,(()=>{let r,a,i,o=(r=j(),a=[],i=new Set,r.forEach(e=>{let r=d.Xg[e.provider]||e.provider;(0,d.KC)(e.provider).forEach(s=>{let t=`${r}/${s.id}`;i.has(t)||(i.add(t),a.push({value:t,label:`${r}/${s.id}`,provider:e.provider,alias:r,connectionName:e.name,modelId:s.id}))})}),a).length>0,l={tool:s,isExpanded:!0,onToggle:()=>{},baseUrl:window.location.origin,apiKeys:f,tunnelEnabled:!1,tunnelPublicUrl:"",tailscaleEnabled:!1,tailscaleUrl:"",cloudEnabled:!1};switch(e){case"claude":return(0,t.jsx)(n.Tk,{...l,activeProviders:j(),modelMappings:m[e]||{},onModelMappingChange:(r,s)=>w(e,r,s),hasActiveProviders:o});case"codex":return(0,t.jsx)(n.Ah,{...l,activeProviders:j()});case"opencode":return(0,t.jsx)(n.qO,{...l,activeProviders:j()});case"cowork":return(0,t.jsx)(n.Q6,{...l,activeProviders:j(),hasActiveProviders:o,cloudUrl:""});case"droid":return(0,t.jsx)(n.ZM,{...l,activeProviders:j(),hasActiveProviders:o});case"openclaw":return(0,t.jsx)(n.yZ,{...l,activeProviders:j(),hasActiveProviders:o});case"hermes":return(0,t.jsx)(n.RF,{...l,activeProviders:j(),hasActiveProviders:o});case"copilot":return(0,t.jsx)(n.h1,{...l,activeProviders:j()});case"cline":return(0,t.jsx)(n.aG,{...l,activeProviders:j()});case"kilo":return(0,t.jsx)(n.c9,{...l,activeProviders:j()});case"deepseek-tui":return(0,t.jsx)(n.lF,{...l,activeProviders:j(),hasActiveProviders:o});case"jcode":return(0,t.jsx)(n.mW,{...l,activeProviders:j(),hasActiveProviders:o});case"grok":return(0,t.jsx)(n.wg,{...l,activeProviders:j(),hasActiveProviders:o});case"pi":return(0,t.jsx)(n.S3,{...l,activeProviders:j(),hasActiveProviders:o});case"aider":return(0,t.jsx)(n.qn,{...l,activeProviders:j(),hasActiveProviders:o});case"gemini-cli":return(0,t.jsx)(n.Ib,{...l,activeProviders:j(),hasActiveProviders:o});default:return(0,t.jsx)(n.a7,{toolId:e,...l,activeProviders:j()})}})()]}):(0,t.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:[(0,t.jsxs)(o(),{href:"/dashboard/cli-tools",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary w-fit",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),"Back to CLI Tools"]}),(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"Tool not found or disabled."})]})}}},e=>{e.O(0,[2574,3862,1610,2562,5772,1321,705,5497,1655,8441,3794,7358],()=>e(e.s=7769)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{12750:(e,s,l)=>{Promise.resolve().then(l.bind(l,53501))},53501:(e,s,l)=>{"use strict";l.d(s,{default:()=>m});var a=l(95155),t=l(12115),r=l(35497),i=l(3534),n=l(37700),c=l(98500),o=l.n(c),d=l(5772);function x({toolId:e,tool:s,status:l}){let t=l?l.installed?l.hasSwitchboard?{label:"Connected",cls:"bg-green-500/10 text-green-600 dark:text-green-400 border border-green-500/20"}:{label:"Installed \xb7 not configured",cls:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border border-amber-500/25"}:{label:"Not installed",cls:"bg-orange-500/15 text-orange-600 dark:text-orange-400 border border-orange-500/25"}:{label:"Unknown",cls:"bg-gray-500/10 text-gray-500"};return(0,a.jsx)(o(),{href:`/dashboard/cli-tools/${e}`,className:"block",children:(0,a.jsx)(r.Zp,{padding:"sm",className:"h-full overflow-hidden hover:border-primary/50 transition-colors cursor-pointer",children:(0,a.jsx)("div",{className:"flex h-full flex-col gap-2",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:s.image?(0,a.jsx)(d.default,{src:s.image,alt:s.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}}):s.icon?(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px]",style:{color:s.color},children:s.icon}):null}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("h3",{className:"font-medium text-sm truncate",children:s.name}),(0,a.jsx)("span",{className:`inline-block mt-1 px-1.5 py-0.5 text-[10px] font-medium rounded-full ${t.cls}`,children:t.label})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px] shrink-0",children:"chevron_right"})]})})})})}function m({machineId:e}){let[s,l]=(0,t.useState)(!0),[c,o]=(0,t.useState)({});if((0,t.useEffect)(()=>{let e=!0;return(async()=>{try{let s=await fetch("/api/cli-tools/all-statuses");s.ok&&e&&o(await s.json())}catch(e){console.log("Error fetching tool statuses:",e)}finally{e&&l(!1)}})(),()=>{e=!1}},[]),s)return(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:[(0,a.jsx)(r.Qv,{}),(0,a.jsx)(r.Qv,{}),(0,a.jsx)(r.Qv,{}),(0,a.jsx)(r.Qv,{}),(0,a.jsx)(r.Qv,{}),(0,a.jsx)(r.Qv,{})]});let d=Object.entries(i.dM),g=Object.entries(i.wn);return(0,a.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-6 px-1 sm:px-0",children:[(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:d.map(([e,s])=>(0,a.jsx)(x,{toolId:e,tool:s,status:c[e]},e))}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"security"}),(0,a.jsx)("h2",{className:"text-sm font-semibold text-text-main",children:"MITM Tools"})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:g.map(([e,s])=>(0,a.jsx)(n.gY,{tool:s},e))})]})]})}}},e=>{e.O(0,[2574,3862,1610,2562,5772,1321,705,5497,1655,8441,3794,7358],()=>e(e.s=12750)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{48451:(e,t,a)=>{"use strict";a.d(t,{default:()=>x});var l=a(95155),s=a(12115),r=a(44923),o=a(87256),n=a(39768),i=a(5020),c=a(35497),d=a(11059);a(88105);let m=/^[a-zA-Z0-9_.\-]+$/;function x({initialData:e}){let[t,a]=(0,s.useState)(()=>(e?.combos||[]).filter(e=>!e.kind||"llm"===e.kind)),[r,o]=(0,s.useState)(!e),[n,i]=(0,s.useState)(!1),[m,p]=(0,s.useState)(null),[h,b]=(0,s.useState)(e?.connections||[]),[g,y]=(0,s.useState)(e?.settings?.comboStrategies||{}),[v,N]=(0,s.useState)(e?.modelCaps||{}),[k,w]=(0,s.useState)(null),{copied:C,copy:S}=(0,d.C)(),R=async()=>{try{let[e,t,l,s]=await Promise.all([fetch("/api/combos"),fetch("/api/providers"),fetch("/api/settings"),fetch("/api/models")]),r=await e.json(),o=await t.json(),n=l.ok?await l.json():{};if(e.ok&&a((r.combos||[]).filter(e=>!e.kind||"llm"===e.kind)),t.ok&&b(o.connections||[]),s.ok){let e=await s.json(),t={};for(let a of e.models||[])a.caps&&(t[a.fullModel]=a.caps);N(t)}y(n.comboStrategies||{})}catch(e){console.log("Error fetching data:",e)}finally{o(!1)}};(0,s.useEffect)(()=>{e?.combos?o(!1):R()},[e]);let E=async e=>{try{let{strategy:t,capacityAutoSwitch:a,routerModel:l,objective:s,...r}=e,o=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(o.ok){let e=await o.json().catch(()=>({})),n=r.name?.trim()||e?.name;n&&(t||void 0!==a||l||s)&&await F(n,u(t,a,l,s)),await R(),i(!1)}else{let e=await o.json();alert(e.error||"Failed to create combo")}}catch(e){console.log("Error creating combo:",e)}},M=async(e,t)=>{try{let{strategy:a,capacityAutoSwitch:l,routerModel:s,objective:r,...o}=t,n=m?.name,i=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(i.ok){let e=o.name?.trim()||n;if(n&&e&&n!==e&&y(t=>{let a={...t};return n in a&&(e in a||(a[e]=a[n]),delete a[n]),a}),e&&(a||void 0!==l)){let t,o=n&&n!==e?(t={...g},n in t&&(e in t||(t[e]=t[n]),delete t[n]),t):g;await F(e,u(a,l,s,r),o)}await R(),p(null)}else{let e=await i.json();alert(e.error||"Failed to update combo")}}catch(e){console.log("Error updating combo:",e)}},A=async e=>{let l=t.find(t=>t.id===e);w({title:"Delete Combo",message:"Delete this combo?",onConfirm:async()=>{w(null);try{(await fetch(`/api/combos/${e}`,{method:"DELETE"})).ok&&(a(t=>t.filter(t=>t.id!==e)),l?.name&&y(e=>{if(!(l.name in e))return e;let t={...e};return delete t[l.name],t}))}catch(e){console.log("Error deleting combo:",e)}}})},F=async(e,t,a=null)=>{try{let l={...a||g},s={...l[e]||{},...t};for(let e of Object.keys(s))(""===s[e]||null===s[e]||void 0===s[e])&&delete s[e];let r=s.fallbackStrategy||"fallback";"fallback"!==r||s.judgeModel||s.routerModel||s.objective||void 0!==s.learningEnabled||void 0!==s.freezeLearning||void 0!==s.explorationRate||!1===s.capacityAutoSwitch?(!s.fallbackStrategy&&void 0===t.fallbackStrategy&&l[e]?.fallbackStrategy&&(s.fallbackStrategy=l[e].fallbackStrategy),l[e]=s):delete l[e],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:l})}),y(l)}catch(e){console.log("Error updating combo strategy:",e)}};return r?(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)(c.Qv,{}),(0,l.jsx)(c.Qv,{})]}):(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,l.jsxs)("div",{className:"min-w-0 max-w-3xl",children:[(0,l.jsx)("h1",{className:"text-[17px] font-semibold text-text-main",children:"Combos"}),(0,l.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Group models under one name, then pick a strategy per combo:"}),(0,l.jsxs)("ul",{className:"text-sm text-text-muted mt-2 flex flex-col gap-1.5",children:[(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Fallback"})," ","— tries models in order (next on failure)"]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Round Robin"})," ","— rotates models across requests to spread load"]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Fusion"})," ","— queries all models in parallel, then a judge synthesizes one answer. Best quality, but costs the most: every request bills all panel models + the judge (N+1 calls)"]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Auto"})," ","— a router model picks one worker from the pool each request (2 calls: router + worker); optional learning from outcomes"]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Capacity auto-switch"})," ","— when enabled on a combo, sends image/PDF requests to a model that supports them first (works with Fallback, Round Robin, and Fusion)"]})]})]}),(0,l.jsx)(c.$n,{icon:"add",onClick:()=>i(!0),className:"w-full sm:w-auto whitespace-nowrap shrink-0",children:"Create Combo"})]}),0===t.length?(0,l.jsx)(c.Zp,{children:(0,l.jsxs)("div",{className:"text-center py-12",children:[(0,l.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"layers"})}),(0,l.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No combos yet"}),(0,l.jsx)("p",{className:"text-sm text-text-muted mb-4 max-w-md mx-auto",children:"Create a named model group, choose Fallback / Round Robin / Fusion / Auto, and point clients at the combo name."}),(0,l.jsx)(c.$n,{icon:"add",onClick:()=>i(!0),className:"w-full sm:w-auto",children:"Create Combo"})]})}):(0,l.jsx)("div",{className:"flex flex-col gap-4",children:t.map(e=>(0,l.jsx)(f,{combo:e,modelCaps:v,activeProviders:h,copied:C,onCopy:S,onEdit:()=>p(e),onDelete:()=>A(e.id),strategy:g[e.name]||{},onSetStrategy:t=>F(e.name,t)},e.id))}),(0,l.jsx)(j,{isOpen:n,onClose:()=>i(!1),onSave:E,activeProviders:h,initialStrategy:{fallbackStrategy:"fallback",capacityAutoSwitch:!0}},"create"),(0,l.jsx)(j,{isOpen:!!m,combo:m,onClose:()=>p(null),onSave:e=>M(m.id,e),activeProviders:h,initialStrategy:m?g[m.name]||{fallbackStrategy:"fallback"}:{}},m?.id||"new"),(0,l.jsx)(c.uo,{isOpen:!!k,onClose:()=>w(null),onConfirm:k?.onConfirm,title:k?.title||"Confirm",message:k?.message,variant:"danger"})]})}function u(e,t,a,l){let s=e||"fallback",r={fallbackStrategy:s,...void 0!==t?{capacityAutoSwitch:t}:{}};return"auto"===s?(a&&(r.routerModel=a),l&&(r.objective=l),r.judgeModel=""):("fusion"===s?r.routerModel="":(r.routerModel="",r.judgeModel=""),r.objective="",r.learningEnabled="",r.freezeLearning="",r.explorationRate=""),r}let p=[{value:"fallback",label:"Fallback — try in order"},{value:"round-robin",label:"Round Robin — rotate load"},{value:"fusion",label:"Fusion — panel + judge (N+1)"},{value:"auto",label:"Auto — router picks 1 worker"}],h={fallback:"Tries models top-to-bottom; on failure uses the next.","round-robin":"Rotates models across requests to spread load.",fusion:"Calls every model, then a judge merges answers (bills N+1).",auto:"Router model chooses one worker each request (bills 2 calls)."},b=[{value:"quality",label:"Quality"},{value:"balanced",label:"Balanced"},{value:"economy",label:"Economy"},{value:"latency",label:"Latency"}];function f({combo:e,modelCaps:t={},activeProviders:a=[],copied:r,onCopy:o,onEdit:n,onDelete:i,strategy:d={},onSetStrategy:m}){let[x,u]=(0,s.useState)(!1),[g,j]=(0,s.useState)(!1),[y,v]=(0,s.useState)(!1),[N,k]=(0,s.useState)(""),w=d.fallbackStrategy||"fallback",C=d.judgeModel||"",S="auto"===w,R=d.routerModel||"",E=d.objective||"balanced",M=!1!==d.capacityAutoSwitch;return(0,l.jsxs)(c.Zp,{padding:"sm",className:"group",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,l.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"})}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("code",{className:"block truncate font-mono text-sm font-medium",children:e.name}),(0,l.jsx)("p",{className:"text-[10px] text-text-subtle mt-0.5",children:h[w]||""}),(0,l.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1",children:[0===e.models.length?(0,l.jsx)("span",{className:"text-xs text-text-muted italic",children:"No models"}):e.models.slice(0,3).map((e,a)=>(0,l.jsxs)("code",{className:"inline-flex items-center gap-1 rounded bg-black/5 px-1.5 py-0.5 font-mono text-xs text-text-muted dark:bg-white/5",children:[(0,l.jsx)("span",{children:e}),(0,l.jsx)(c.nh,{caps:t[e]})]},a)),e.models.length>3&&(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",e.models.length-3," more"]})]}),"fusion"===w&&(0,l.jsxs)("div",{className:"mt-2 flex min-w-0 flex-wrap items-center gap-1.5",children:[(0,l.jsx)("span",{className:"text-[11px] font-medium text-text-muted",children:"Judge"}),(0,l.jsxs)("button",{onClick:()=>u(!0),className:"inline-flex max-w-full items-center gap-1 rounded border border-dashed border-primary/40 px-1.5 py-0.5 font-mono text-[11px] text-primary hover:border-primary hover:bg-primary/5 transition-colors",title:"Pick the model that fuses panel answers",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"gavel"}),(0,l.jsx)("span",{className:"truncate",children:C||`Auto — ${e.models[0]||"first model"}`})]}),C&&(0,l.jsx)("button",{onClick:()=>m({judgeModel:""}),className:"p-0.5 rounded text-text-muted hover:text-red-500 hover:bg-red-500/10 transition-colors",title:"Reset judge to Auto",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"close"})})]}),S&&(0,l.jsxs)("div",{className:"mt-2 flex min-w-0 flex-col gap-2",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[(0,l.jsx)("span",{className:"text-[11px] font-medium text-text-muted",children:"Router"}),(0,l.jsxs)("button",{type:"button",onClick:()=>j(!0),className:"inline-flex max-w-full items-center gap-1 rounded border border-dashed border-primary/40 px-1.5 py-0.5 font-mono text-[11px] text-primary hover:border-primary hover:bg-primary/5 transition-colors",title:"Model that picks the worker each request",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"alt_route"}),(0,l.jsx)("span",{className:"truncate",children:R||"claude/claude-opus-4-8 (default)"})]}),R&&(0,l.jsx)("button",{type:"button",onClick:()=>m({routerModel:""}),className:"p-0.5 rounded text-text-muted hover:text-red-500 hover:bg-red-500/10 transition-colors",title:"Reset router to default",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"close"})})]}),R&&e.models?.includes(R)&&(0,l.jsxs)("p",{className:"text-[10px] text-amber-600 dark:text-amber-400 flex items-center gap-1",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"warning"}),"Router is also in the worker list — it is auto-excluded from the pool."]}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[(0,l.jsx)("span",{className:"text-[11px] font-medium text-text-muted",children:"Objective"}),(0,l.jsx)("select",{value:E,onChange:e=>m({objective:e.target.value}),className:"rounded border border-border bg-surface-2 px-1.5 py-0.5 text-[11px] text-text-main",children:b.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,l.jsxs)("label",{className:"inline-flex items-center gap-1 text-[11px] text-text-muted cursor-pointer",children:[(0,l.jsx)("input",{type:"checkbox",className:"rounded border-border",checked:!1!==d.learningEnabled,onChange:e=>m({learningEnabled:e.target.checked})}),"Learn"]}),(0,l.jsxs)("label",{className:"inline-flex items-center gap-1 text-[11px] text-text-muted cursor-pointer",title:"Keep routing on current learning version; block relearn",children:[(0,l.jsx)("input",{type:"checkbox",className:"rounded border-border",checked:!!d.freezeLearning,onChange:e=>m({freezeLearning:e.target.checked})}),"Freeze"]}),(0,l.jsxs)("button",{type:"button",disabled:y||!!d.freezeLearning,onClick:async()=>{v(!0),k("");try{let t=await fetch("/api/routing/learn",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboName:e.name})}),a=await t.json();k(a.message||(a.ok?"Done":a.error||"Failed"))}catch(e){k(e.message||"Failed")}finally{v(!1)}},className:"inline-flex items-center gap-1 rounded border border-primary/40 bg-primary/10 px-2 py-0.5 text-[11px] font-medium text-primary hover:bg-primary/15 disabled:opacity-50",title:"Run learning optimizer on recent routing events",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"psychology"}),y?"Learning…":"Relearn now"]}),(0,l.jsx)("a",{href:`/dashboard/combos/routing?combo=${encodeURIComponent(e.name)}`,className:"inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[11px] text-text-muted hover:text-primary hover:border-primary/40",children:"Insights"})]}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2 text-[11px] text-text-muted",children:[(0,l.jsxs)("label",{className:"inline-flex items-center gap-1",children:["Window",(0,l.jsxs)("select",{value:d.learningWindowDays??14,onChange:e=>m({learningWindowDays:Number(e.target.value)||14}),className:"rounded border border-border bg-surface-2 px-1 py-0.5 text-[11px] text-text-main",children:[(0,l.jsx)("option",{value:7,children:"7d"}),(0,l.jsx)("option",{value:14,children:"14d"}),(0,l.jsx)("option",{value:30,children:"30d"})]})]}),(0,l.jsxs)("label",{className:"inline-flex items-center gap-1",title:"Epsilon-greedy exploration (capped at 20%)",children:["Explore",(0,l.jsx)("select",{value:Math.round((d.explorationRate??.05)*100),onChange:e=>m({explorationRate:Number(e.target.value)/100}),className:"rounded border border-border bg-surface-2 px-1 py-0.5 text-[11px] text-text-main",children:[0,5,10,15,20].map(e=>(0,l.jsxs)("option",{value:e,children:[e,"%"]},e))})]}),(0,l.jsxs)("label",{className:"inline-flex items-center gap-1",title:"0 = manual relearn only",children:["Auto-relearn",(0,l.jsxs)("select",{value:d.autoLearnIntervalHours??0,onChange:e=>m({autoLearnIntervalHours:Number(e.target.value)||0}),className:"rounded border border-border bg-surface-2 px-1 py-0.5 text-[11px] text-text-main",children:[(0,l.jsx)("option",{value:0,children:"off"}),(0,l.jsx)("option",{value:6,children:"6h"}),(0,l.jsx)("option",{value:12,children:"12h"}),(0,l.jsx)("option",{value:24,children:"24h"}),(0,l.jsx)("option",{value:72,children:"72h"})]})]}),(0,l.jsxs)("label",{className:"inline-flex items-center gap-1",title:"Capacity pre-filter before router (vision/PDF)",children:[(0,l.jsx)("input",{type:"checkbox",className:"rounded border-border",checked:!1!==d.capacityAutoSwitch,onChange:e=>m({capacityAutoSwitch:e.target.checked})}),"Heuristic first"]}),(0,l.jsxs)("label",{className:"inline-flex items-center gap-1",title:"Emit X-Auto-Router-* response headers (worker, cluster, score, skipped)",children:[(0,l.jsx)("input",{type:"checkbox",className:"rounded border-border",checked:!1!==d.emitAutoRouterHeaders,onChange:e=>m({emitAutoRouterHeaders:e.target.checked})}),"Route headers"]})]}),N?(0,l.jsx)("p",{className:"text-[11px] font-mono text-text-subtle",children:N}):(0,l.jsx)("p",{className:"text-[10px] text-text-subtle",children:"Worker pool = models list (router model excluded if listed). Every request re-routes. Router must be a connected account (default claude/claude-opus-4-8)."})]})]})]}),(0,l.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3 sm:shrink-0",children:[(0,l.jsxs)("div",{className:"w-full sm:w-[220px] flex flex-col gap-1.5",children:[(0,l.jsx)(c.l6,{options:p,value:w,onChange:e=>m({fallbackStrategy:e.target.value}),selectClassName:"py-1.5 text-xs"}),!S&&(0,l.jsxs)("label",{className:"inline-flex items-center gap-1.5 text-[10px] text-text-muted cursor-pointer",children:[(0,l.jsx)("input",{type:"checkbox",className:"rounded border-border",checked:M,onChange:e=>m({capacityAutoSwitch:e.target.checked})}),"Capacity auto-switch (vision/PDF first)"]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-3 gap-1 sm:flex",children:[(0,l.jsxs)("button",{onClick:t=>{t.stopPropagation(),o(e.name,`combo-${e.id}`)},className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Copy combo name",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:r===`combo-${e.id}`?"check":"content_copy"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Copy"})]}),(0,l.jsxs)("button",{onClick:n,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Edit",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,l.jsxs)("button",{onClick:i,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 transition-colors hover:bg-red-500/10",title:"Delete",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]})]})]}),(0,l.jsx)(c.rq,{isOpen:x,onClose:()=>u(!1),onSelect:e=>{m({judgeModel:e?.value||""}),u(!1)},activeProviders:a,title:"Select Judge Model",addedModelValues:C?[C]:[],closeOnSelect:!0}),(0,l.jsx)(c.rq,{isOpen:g,onClose:()=>j(!1),onSelect:e=>{m({routerModel:e?.value||""}),j(!1)},activeProviders:a,title:"Select Router Model",addedModelValues:R?[R]:[],closeOnSelect:!0})]})}function g({id:e,index:t,model:a,isFirst:r,isLast:i,onEdit:c,onMoveUp:d,onMoveDown:m,onRemove:x}){let{attributes:u,listeners:p,setNodeRef:h,transform:b,isDragging:f}=(0,o.gl)({id:e}),j={transform:n.Ks.Transform.toString(b),opacity:f?.4:1,zIndex:f?999:void 0},[y,v]=(0,s.useState)(!1),[N,k]=(0,s.useState)(a),w=()=>{let e=N.trim();e&&e!==a?c(e):k(a),v(!1)};return(0,l.jsxs)("div",{ref:h,style:j,className:`group flex min-w-0 items-center gap-1.5 rounded-md px-2 py-1 bg-black/[0.02] hover:bg-black/[0.04] dark:bg-white/[0.02] dark:hover:bg-white/[0.04] transition-colors ${f?"shadow-md ring-1 ring-primary/30":""}`,children:[(0,l.jsx)("button",{...u,...p,type:"button",className:"cursor-grab touch-none p-0.5 rounded text-text-muted hover:text-primary active:cursor-grabbing shrink-0",title:"Drag to reorder",children:(0,l.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,l.jsx)("circle",{cx:"9",cy:"4",r:"2"}),(0,l.jsx)("circle",{cx:"15",cy:"4",r:"2"}),(0,l.jsx)("circle",{cx:"9",cy:"12",r:"2"}),(0,l.jsx)("circle",{cx:"15",cy:"12",r:"2"}),(0,l.jsx)("circle",{cx:"9",cy:"20",r:"2"}),(0,l.jsx)("circle",{cx:"15",cy:"20",r:"2"})]})}),(0,l.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:t+1}),y?(0,l.jsx)("input",{autoFocus:!0,value:N,onChange:e=>k(e.target.value),onBlur:w,onKeyDown:e=>{"Enter"===e.key&&w(),"Escape"===e.key&&(k(a),v(!1))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-white px-1.5 py-0.5 font-mono text-xs text-text-main outline-none dark:bg-black/20"}):(0,l.jsx)("div",{className:"min-w-0 flex-1 cursor-text truncate rounded px-1.5 py-0.5 font-mono text-xs text-text-main hover:bg-black/5 dark:hover:bg-white/5",onClick:()=>v(!0),title:"Click to edit",children:a}),(0,l.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,l.jsx)("button",{onClick:d,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move up",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,l.jsx)("button",{onClick:m,disabled:i,className:`p-0.5 rounded ${i?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move down",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,l.jsx)("button",{onClick:x,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:"Remove",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]})}function j({isOpen:e,combo:t,onClose:a,onSave:n,activeProviders:d,kindFilter:x=null,initialStrategy:u={}}){let[b,f]=(0,s.useState)(t?.name||""),[y,v]=(0,s.useState)(t?.models||[]),[N,k]=(0,s.useState)(u.fallbackStrategy||"fallback"),[w,C]=(0,s.useState)(!1!==u.capacityAutoSwitch),[S,R]=(0,s.useState)(!1),[E,M]=(0,s.useState)(!1),[A,F]=(0,s.useState)(""),[O,D]=(0,s.useState)({}),P=(0,r.FR)((0,r.MS)(r.AN,{activationConstraint:{distance:5}}),(0,r.MS)(r.uN,{coordinateGetter:o.JR})),q=y.map((e,t)=>({uid:`item-${t}`,model:e})),$=async()=>{try{let e=await fetch("/api/models/alias");if(!e.ok)return;let t=await e.json();D(t.aliases||{})}catch(e){console.error("Error fetching modal data:",e)}};(0,s.useEffect)(()=>{e&&(f(t?.name||""),v(t?.models||[]),k(u.fallbackStrategy||"fallback"),C(!1!==u.capacityAutoSwitch),R(!1),M(!1),F(""),$())},[e,t?.id,t?.name]);let _=e=>e.trim()?m.test(e)?(F(""),!0):(F("Only letters, numbers, -, _ and . allowed"),!1):(F("Name is required"),!1),z=async()=>{if(_(b)){if(0===y.length)return void alert("Add at least one model to the combo");if("auto"===N&&y.length<2)return void alert("Auto strategy needs at least 2 models in the worker pool (plus a connected router account)");M(!0),await n({name:b.trim(),models:y,strategy:N,capacityAutoSwitch:"auto"===N||w}),M(!1)}},L=!!t;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.aF,{isOpen:e,onClose:a,title:L?"Edit Combo":"Create Combo",children:(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsxs)("p",{className:"text-xs text-text-muted leading-relaxed",children:["Clients call this combo by name as the ",(0,l.jsx)("code",{className:"text-primary",children:"model"})," field. Strategy controls how models in the list are used."]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(c.pd,{label:"Combo Name",value:b,onChange:e=>{let t=e.target.value;f(t),t?_(t):F("")},placeholder:"my-combo",error:A}),(0,l.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:"Only letters, numbers, -, _ and . allowed \xb7 use as model id in /v1"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Strategy"}),(0,l.jsx)(c.l6,{options:p,value:N,onChange:e=>k(e.target.value),selectClassName:"py-2 text-sm"}),(0,l.jsx)("p",{className:"text-[11px] text-text-muted mt-1.5",children:h[N]}),"auto"!==N&&(0,l.jsxs)("label",{className:"mt-2 inline-flex items-center gap-2 text-xs text-text-muted cursor-pointer",children:[(0,l.jsx)("input",{type:"checkbox",className:"rounded border-border",checked:w,onChange:e=>C(e.target.checked)}),"Capacity auto-switch — prefer vision/PDF-capable models when the request needs them"]}),"auto"===N&&(0,l.jsx)("p",{className:"text-[11px] text-text-subtle mt-1.5 font-mono",children:"After create: set Router model on the combo card (must be a connected account). Workers = this model list (router excluded if listed)."}),"fusion"===N&&(0,l.jsx)("p",{className:"text-[11px] text-text-subtle mt-1.5 font-mono",children:"After create: optionally set Judge on the combo card (default = first model)."})]}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("label",{className:"text-sm font-medium mb-1.5 block",children:["Models ","fallback"===N?"(order = priority)":"(pool)"]}),0===y.length?(0,l.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"No models added yet"})]}):(0,l.jsx)(r.Mp,{sensors:P,collisionDetection:r.fp,onDragEnd:e=>{let{active:t,over:a}=e;if(a&&t.id!==a.id){let e=q.findIndex(e=>e.uid===t.id),l=q.findIndex(e=>e.uid===a.id);-1!==e&&-1!==l&&v(t=>(0,o.be)(t,e,l))}},modifiers:[i.FN,i.gj],children:(0,l.jsx)(o.gB,{items:q.map(e=>e.uid),strategy:o._G,children:(0,l.jsx)("div",{className:"flex max-h-[55vh] min-w-0 flex-col gap-1 overflow-y-auto sm:max-h-[350px]",children:q.map(({uid:e,model:t},a)=>(0,l.jsx)(g,{id:e,index:a,model:t,isFirst:0===a,isLast:a===q.length-1,onEdit:e=>{let t=[...y];t[a]=e,v(t)},onMoveUp:()=>(e=>{if(0===e)return;let t=[...y];[t[e-1],t[e]]=[t[e],t[e-1]],v(t)})(a),onMoveDown:()=>(e=>{if(e===y.length-1)return;let t=[...y];[t[e],t[e+1]]=[t[e+1],t[e]],v(t)})(a),onRemove:()=>{v(y.filter((e,t)=>t!==a))}},e))})})}),(0,l.jsxs)("button",{onClick:()=>R(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-primary font-medium hover:text-primary hover:border-primary/50 transition-colors flex items-center justify-center gap-1",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-2 pt-1 sm:flex-row",children:[(0,l.jsx)(c.$n,{onClick:a,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,l.jsx)(c.$n,{onClick:z,fullWidth:!0,size:"sm",disabled:!b.trim()||!!A||E,children:E?"Saving...":L?"Save":"Create"})]})]})}),(0,l.jsx)(c.rq,{isOpen:S,onClose:()=>R(!1),onSelect:e=>{y.includes(e.value)||v([...y,e.value])},onDeselect:e=>{v(y.filter(t=>t!==e.value))},activeProviders:d,modelAliases:O,title:"Add Model to Combo",kindFilter:x,addedModelValues:y,closeOnSelect:!1})]})}},73670:(e,t,a)=>{Promise.resolve().then(a.bind(a,48451))}},e=>{e.O(0,[2574,3862,1610,2562,7055,1321,705,5497,8441,3794,7358],()=>e(e.s=73670)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{48451:(e,t,a)=>{"use strict";a.d(t,{default:()=>x});var l=a(95155),s=a(12115),r=a(44923),o=a(87256),n=a(39768),i=a(5020),c=a(35497),d=a(11059);a(88105);let m=/^[a-zA-Z0-9_.\-]+$/;function x({initialData:e}){let[t,a]=(0,s.useState)(()=>(e?.combos||[]).filter(e=>!e.kind||"llm"===e.kind)),[r,o]=(0,s.useState)(!e),[n,i]=(0,s.useState)(!1),[m,p]=(0,s.useState)(null),[h,b]=(0,s.useState)(e?.connections||[]),[g,y]=(0,s.useState)(e?.settings?.comboStrategies||{}),[v,N]=(0,s.useState)(e?.modelCaps||{}),[k,w]=(0,s.useState)(null),{copied:C,copy:S}=(0,d.C)(),R=async()=>{try{let[e,t,l,s]=await Promise.all([fetch("/api/combos"),fetch("/api/providers"),fetch("/api/settings"),fetch("/api/models")]),r=await e.json(),o=await t.json(),n=l.ok?await l.json():{};if(e.ok&&a((r.combos||[]).filter(e=>!e.kind||"llm"===e.kind)),t.ok&&b(o.connections||[]),s.ok){let e=await s.json(),t={};for(let a of e.models||[])a.caps&&(t[a.fullModel]=a.caps);N(t)}y(n.comboStrategies||{})}catch(e){console.log("Error fetching data:",e)}finally{o(!1)}};(0,s.useEffect)(()=>{e?.combos?o(!1):R()},[e]);let E=async e=>{try{let{strategy:t,capacityAutoSwitch:a,routerModel:l,objective:s,...r}=e,o=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(o.ok){let e=await o.json().catch(()=>({})),n=r.name?.trim()||e?.name;n&&(t||void 0!==a||l||s)&&await F(n,u(t,a,l,s)),await R(),i(!1)}else{let e=await o.json();alert(e.error||"Failed to create combo")}}catch(e){console.log("Error creating combo:",e)}},M=async(e,t)=>{try{let{strategy:a,capacityAutoSwitch:l,routerModel:s,objective:r,...o}=t,n=m?.name,i=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(i.ok){let e=o.name?.trim()||n;if(n&&e&&n!==e&&y(t=>{let a={...t};return n in a&&(e in a||(a[e]=a[n]),delete a[n]),a}),e&&(a||void 0!==l)){let t,o=n&&n!==e?(t={...g},n in t&&(e in t||(t[e]=t[n]),delete t[n]),t):g;await F(e,u(a,l,s,r),o)}await R(),p(null)}else{let e=await i.json();alert(e.error||"Failed to update combo")}}catch(e){console.log("Error updating combo:",e)}},A=async e=>{let l=t.find(t=>t.id===e);w({title:"Delete Combo",message:"Delete this combo?",onConfirm:async()=>{w(null);try{(await fetch(`/api/combos/${e}`,{method:"DELETE"})).ok&&(a(t=>t.filter(t=>t.id!==e)),l?.name&&y(e=>{if(!(l.name in e))return e;let t={...e};return delete t[l.name],t}))}catch(e){console.log("Error deleting combo:",e)}}})},F=async(e,t,a=null)=>{try{let l={...a||g},s={...l[e]||{},...t};for(let e of Object.keys(s))(""===s[e]||null===s[e]||void 0===s[e])&&delete s[e];let r=s.fallbackStrategy||"fallback";"fallback"!==r||s.judgeModel||s.routerModel||s.objective||void 0!==s.learningEnabled||void 0!==s.freezeLearning||void 0!==s.explorationRate||!1===s.capacityAutoSwitch?(!s.fallbackStrategy&&void 0===t.fallbackStrategy&&l[e]?.fallbackStrategy&&(s.fallbackStrategy=l[e].fallbackStrategy),l[e]=s):delete l[e],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:l})}),y(l)}catch(e){console.log("Error updating combo strategy:",e)}};return r?(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)(c.Qv,{}),(0,l.jsx)(c.Qv,{})]}):(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,l.jsxs)("div",{className:"min-w-0 max-w-3xl",children:[(0,l.jsx)("h1",{className:"text-[17px] font-semibold text-text-main",children:"Combos"}),(0,l.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Group models under one name, then pick a strategy per combo:"}),(0,l.jsxs)("ul",{className:"text-sm text-text-muted mt-2 flex flex-col gap-1.5",children:[(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Fallback"})," ","— tries models in order (next on failure)"]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Round Robin"})," ","— rotates models across requests to spread load"]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Fusion"})," ","— queries all models in parallel, then a judge synthesizes one answer. Best quality, but costs the most: every request bills all panel models + the judge (N+1 calls)"]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Auto"})," ","— a router model picks one worker from the pool each request (2 calls: router + worker); optional learning from outcomes"]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"Capacity auto-switch"})," ","— when enabled on a combo, sends image/PDF requests to a model that supports them first (works with Fallback, Round Robin, and Fusion)"]})]})]}),(0,l.jsx)(c.$n,{icon:"add",onClick:()=>i(!0),className:"w-full sm:w-auto whitespace-nowrap shrink-0",children:"Create Combo"})]}),0===t.length?(0,l.jsx)(c.Zp,{children:(0,l.jsxs)("div",{className:"text-center py-12",children:[(0,l.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"layers"})}),(0,l.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No combos yet"}),(0,l.jsx)("p",{className:"text-sm text-text-muted mb-4 max-w-md mx-auto",children:"Create a named model group, choose Fallback / Round Robin / Fusion / Auto, and point clients at the combo name."}),(0,l.jsx)(c.$n,{icon:"add",onClick:()=>i(!0),className:"w-full sm:w-auto",children:"Create Combo"})]})}):(0,l.jsx)("div",{className:"flex flex-col gap-4",children:t.map(e=>(0,l.jsx)(f,{combo:e,modelCaps:v,activeProviders:h,copied:C,onCopy:S,onEdit:()=>p(e),onDelete:()=>A(e.id),strategy:g[e.name]||{},onSetStrategy:t=>F(e.name,t)},e.id))}),(0,l.jsx)(j,{isOpen:n,onClose:()=>i(!1),onSave:E,activeProviders:h,initialStrategy:{fallbackStrategy:"fallback",capacityAutoSwitch:!0}},"create"),(0,l.jsx)(j,{isOpen:!!m,combo:m,onClose:()=>p(null),onSave:e=>M(m.id,e),activeProviders:h,initialStrategy:m?g[m.name]||{fallbackStrategy:"fallback"}:{}},m?.id||"new"),(0,l.jsx)(c.uo,{isOpen:!!k,onClose:()=>w(null),onConfirm:k?.onConfirm,title:k?.title||"Confirm",message:k?.message,variant:"danger"})]})}function u(e,t,a,l){let s=e||"fallback",r={fallbackStrategy:s,...void 0!==t?{capacityAutoSwitch:t}:{}};return"auto"===s?(a&&(r.routerModel=a),l&&(r.objective=l),r.judgeModel=""):("fusion"===s?r.routerModel="":(r.routerModel="",r.judgeModel=""),r.objective="",r.learningEnabled="",r.freezeLearning="",r.explorationRate=""),r}let p=[{value:"fallback",label:"Fallback — try in order"},{value:"round-robin",label:"Round Robin — rotate load"},{value:"fusion",label:"Fusion — panel + judge (N+1)"},{value:"auto",label:"Auto — router picks 1 worker"}],h={fallback:"Tries models top-to-bottom; on failure uses the next.","round-robin":"Rotates models across requests to spread load.",fusion:"Calls every model, then a judge merges answers (bills N+1).",auto:"Router model chooses one worker each request (bills 2 calls)."},b=[{value:"quality",label:"Quality"},{value:"balanced",label:"Balanced"},{value:"economy",label:"Economy"},{value:"latency",label:"Latency"}];function f({combo:e,modelCaps:t={},activeProviders:a=[],copied:r,onCopy:o,onEdit:n,onDelete:i,strategy:d={},onSetStrategy:m}){let[x,u]=(0,s.useState)(!1),[g,j]=(0,s.useState)(!1),[y,v]=(0,s.useState)(!1),[N,k]=(0,s.useState)(""),w=d.fallbackStrategy||"fallback",C=d.judgeModel||"",S="auto"===w,R=d.routerModel||"",E=d.objective||"balanced",M=!1!==d.capacityAutoSwitch;return(0,l.jsxs)(c.Zp,{padding:"sm",className:"group",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,l.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"})}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("code",{className:"block truncate font-mono text-sm font-medium",children:e.name}),(0,l.jsx)("p",{className:"text-[10px] text-text-subtle mt-0.5",children:h[w]||""}),(0,l.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1",children:[0===e.models.length?(0,l.jsx)("span",{className:"text-xs text-text-muted italic",children:"No models"}):e.models.slice(0,3).map((e,a)=>(0,l.jsxs)("code",{className:"inline-flex items-center gap-1 rounded bg-black/5 px-1.5 py-0.5 font-mono text-xs text-text-muted dark:bg-white/5",children:[(0,l.jsx)("span",{children:e}),(0,l.jsx)(c.nh,{caps:t[e]})]},a)),e.models.length>3&&(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",e.models.length-3," more"]})]}),"fusion"===w&&(0,l.jsxs)("div",{className:"mt-2 flex min-w-0 flex-wrap items-center gap-1.5",children:[(0,l.jsx)("span",{className:"text-[11px] font-medium text-text-muted",children:"Judge"}),(0,l.jsxs)("button",{onClick:()=>u(!0),className:"inline-flex max-w-full items-center gap-1 rounded border border-dashed border-primary/40 px-1.5 py-0.5 font-mono text-[11px] text-primary hover:border-primary hover:bg-primary/5 transition-colors",title:"Pick the model that fuses panel answers",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"gavel"}),(0,l.jsx)("span",{className:"truncate",children:C||`Auto — ${e.models[0]||"first model"}`})]}),C&&(0,l.jsx)("button",{onClick:()=>m({judgeModel:""}),className:"p-0.5 rounded text-text-muted hover:text-red-500 hover:bg-red-500/10 transition-colors",title:"Reset judge to Auto",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"close"})})]}),S&&(0,l.jsxs)("div",{className:"mt-2 flex min-w-0 flex-col gap-2",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[(0,l.jsx)("span",{className:"text-[11px] font-medium text-text-muted",children:"Router"}),(0,l.jsxs)("button",{type:"button",onClick:()=>j(!0),className:"inline-flex max-w-full items-center gap-1 rounded border border-dashed border-primary/40 px-1.5 py-0.5 font-mono text-[11px] text-primary hover:border-primary hover:bg-primary/5 transition-colors",title:"Model that picks the worker each request",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"alt_route"}),(0,l.jsx)("span",{className:"truncate",children:R||"claude/claude-opus-4-8 (default)"})]}),R&&(0,l.jsx)("button",{type:"button",onClick:()=>m({routerModel:""}),className:"p-0.5 rounded text-text-muted hover:text-red-500 hover:bg-red-500/10 transition-colors",title:"Reset router to default",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"close"})})]}),R&&e.models?.includes(R)&&(0,l.jsxs)("p",{className:"text-[10px] text-amber-600 dark:text-amber-400 flex items-center gap-1",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"warning"}),"Router is also in the worker list — it is auto-excluded from the pool."]}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[(0,l.jsx)("span",{className:"text-[11px] font-medium text-text-muted",children:"Objective"}),(0,l.jsx)("select",{value:E,onChange:e=>m({objective:e.target.value}),className:"rounded border border-border bg-surface-2 px-1.5 py-0.5 text-[11px] text-text-main",children:b.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,l.jsxs)("label",{className:"inline-flex items-center gap-1 text-[11px] text-text-muted cursor-pointer",children:[(0,l.jsx)("input",{type:"checkbox",className:"rounded border-border",checked:!1!==d.learningEnabled,onChange:e=>m({learningEnabled:e.target.checked})}),"Learn"]}),(0,l.jsxs)("label",{className:"inline-flex items-center gap-1 text-[11px] text-text-muted cursor-pointer",title:"Keep routing on current learning version; block relearn",children:[(0,l.jsx)("input",{type:"checkbox",className:"rounded border-border",checked:!!d.freezeLearning,onChange:e=>m({freezeLearning:e.target.checked})}),"Freeze"]}),(0,l.jsxs)("button",{type:"button",disabled:y||!!d.freezeLearning,onClick:async()=>{v(!0),k("");try{let t=await fetch("/api/routing/learn",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboName:e.name})}),a=await t.json();k(a.message||(a.ok?"Done":a.error||"Failed"))}catch(e){k(e.message||"Failed")}finally{v(!1)}},className:"inline-flex items-center gap-1 rounded border border-primary/40 bg-primary/10 px-2 py-0.5 text-[11px] font-medium text-primary hover:bg-primary/15 disabled:opacity-50",title:"Run learning optimizer on recent routing events",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"psychology"}),y?"Learning…":"Relearn now"]}),(0,l.jsx)("a",{href:`/dashboard/combos/routing?combo=${encodeURIComponent(e.name)}`,className:"inline-flex items-center gap-1 rounded border border-border px-2 py-0.5 text-[11px] text-text-muted hover:text-primary hover:border-primary/40",children:"Insights"})]}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2 text-[11px] text-text-muted",children:[(0,l.jsxs)("label",{className:"inline-flex items-center gap-1",children:["Window",(0,l.jsxs)("select",{value:d.learningWindowDays??14,onChange:e=>m({learningWindowDays:Number(e.target.value)||14}),className:"rounded border border-border bg-surface-2 px-1 py-0.5 text-[11px] text-text-main",children:[(0,l.jsx)("option",{value:7,children:"7d"}),(0,l.jsx)("option",{value:14,children:"14d"}),(0,l.jsx)("option",{value:30,children:"30d"})]})]}),(0,l.jsxs)("label",{className:"inline-flex items-center gap-1",title:"Epsilon-greedy exploration (capped at 20%)",children:["Explore",(0,l.jsx)("select",{value:Math.round((d.explorationRate??.05)*100),onChange:e=>m({explorationRate:Number(e.target.value)/100}),className:"rounded border border-border bg-surface-2 px-1 py-0.5 text-[11px] text-text-main",children:[0,5,10,15,20].map(e=>(0,l.jsxs)("option",{value:e,children:[e,"%"]},e))})]}),(0,l.jsxs)("label",{className:"inline-flex items-center gap-1",title:"0 = manual relearn only",children:["Auto-relearn",(0,l.jsxs)("select",{value:d.autoLearnIntervalHours??0,onChange:e=>m({autoLearnIntervalHours:Number(e.target.value)||0}),className:"rounded border border-border bg-surface-2 px-1 py-0.5 text-[11px] text-text-main",children:[(0,l.jsx)("option",{value:0,children:"off"}),(0,l.jsx)("option",{value:6,children:"6h"}),(0,l.jsx)("option",{value:12,children:"12h"}),(0,l.jsx)("option",{value:24,children:"24h"}),(0,l.jsx)("option",{value:72,children:"72h"})]})]}),(0,l.jsxs)("label",{className:"inline-flex items-center gap-1",title:"Capacity pre-filter before router (vision/PDF)",children:[(0,l.jsx)("input",{type:"checkbox",className:"rounded border-border",checked:!1!==d.capacityAutoSwitch,onChange:e=>m({capacityAutoSwitch:e.target.checked})}),"Heuristic first"]}),(0,l.jsxs)("label",{className:"inline-flex items-center gap-1",title:"Emit X-Auto-Router-* response headers (worker, cluster, score, skipped)",children:[(0,l.jsx)("input",{type:"checkbox",className:"rounded border-border",checked:!1!==d.emitAutoRouterHeaders,onChange:e=>m({emitAutoRouterHeaders:e.target.checked})}),"Route headers"]})]}),N?(0,l.jsx)("p",{className:"text-[11px] font-mono text-text-subtle",children:N}):(0,l.jsx)("p",{className:"text-[10px] text-text-subtle",children:"Worker pool = models list (router model excluded if listed). Every request re-routes. Router must be a connected account (default claude/claude-opus-4-8)."})]})]})]}),(0,l.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3 sm:shrink-0",children:[(0,l.jsxs)("div",{className:"w-full sm:w-[220px] flex flex-col gap-1.5",children:[(0,l.jsx)(c.l6,{options:p,value:w,onChange:e=>m({fallbackStrategy:e.target.value}),selectClassName:"py-1.5 text-xs"}),!S&&(0,l.jsxs)("label",{className:"inline-flex items-center gap-1.5 text-[10px] text-text-muted cursor-pointer",children:[(0,l.jsx)("input",{type:"checkbox",className:"rounded border-border",checked:M,onChange:e=>m({capacityAutoSwitch:e.target.checked})}),"Capacity auto-switch (vision/PDF first)"]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-3 gap-1 sm:flex",children:[(0,l.jsxs)("button",{onClick:t=>{t.stopPropagation(),o(e.name,`combo-${e.id}`)},className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Copy combo name",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:r===`combo-${e.id}`?"check":"content_copy"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Copy"})]}),(0,l.jsxs)("button",{onClick:n,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Edit",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,l.jsxs)("button",{onClick:i,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 transition-colors hover:bg-red-500/10",title:"Delete",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,l.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]})]})]}),(0,l.jsx)(c.rq,{isOpen:x,onClose:()=>u(!1),onSelect:e=>{m({judgeModel:e?.value||""}),u(!1)},activeProviders:a,title:"Select Judge Model",addedModelValues:C?[C]:[],closeOnSelect:!0}),(0,l.jsx)(c.rq,{isOpen:g,onClose:()=>j(!1),onSelect:e=>{m({routerModel:e?.value||""}),j(!1)},activeProviders:a,title:"Select Router Model",addedModelValues:R?[R]:[],closeOnSelect:!0})]})}function g({id:e,index:t,model:a,isFirst:r,isLast:i,onEdit:c,onMoveUp:d,onMoveDown:m,onRemove:x}){let{attributes:u,listeners:p,setNodeRef:h,transform:b,isDragging:f}=(0,o.gl)({id:e}),j={transform:n.Ks.Transform.toString(b),opacity:f?.4:1,zIndex:f?999:void 0},[y,v]=(0,s.useState)(!1),[N,k]=(0,s.useState)(a),w=()=>{let e=N.trim();e&&e!==a?c(e):k(a),v(!1)};return(0,l.jsxs)("div",{ref:h,style:j,className:`group flex min-w-0 items-center gap-1.5 rounded-md px-2 py-1 bg-black/[0.02] hover:bg-black/[0.04] dark:bg-white/[0.02] dark:hover:bg-white/[0.04] transition-colors ${f?"shadow-md ring-1 ring-primary/30":""}`,children:[(0,l.jsx)("button",{...u,...p,type:"button",className:"cursor-grab touch-none p-0.5 rounded text-text-muted hover:text-primary active:cursor-grabbing shrink-0",title:"Drag to reorder",children:(0,l.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,l.jsx)("circle",{cx:"9",cy:"4",r:"2"}),(0,l.jsx)("circle",{cx:"15",cy:"4",r:"2"}),(0,l.jsx)("circle",{cx:"9",cy:"12",r:"2"}),(0,l.jsx)("circle",{cx:"15",cy:"12",r:"2"}),(0,l.jsx)("circle",{cx:"9",cy:"20",r:"2"}),(0,l.jsx)("circle",{cx:"15",cy:"20",r:"2"})]})}),(0,l.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:t+1}),y?(0,l.jsx)("input",{autoFocus:!0,value:N,onChange:e=>k(e.target.value),onBlur:w,onKeyDown:e=>{"Enter"===e.key&&w(),"Escape"===e.key&&(k(a),v(!1))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-white px-1.5 py-0.5 font-mono text-xs text-text-main outline-none dark:bg-black/20"}):(0,l.jsx)("div",{className:"min-w-0 flex-1 cursor-text truncate rounded px-1.5 py-0.5 font-mono text-xs text-text-main hover:bg-black/5 dark:hover:bg-white/5",onClick:()=>v(!0),title:"Click to edit",children:a}),(0,l.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,l.jsx)("button",{onClick:d,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move up",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,l.jsx)("button",{onClick:m,disabled:i,className:`p-0.5 rounded ${i?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move down",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,l.jsx)("button",{onClick:x,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:"Remove",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]})}function j({isOpen:e,combo:t,onClose:a,onSave:n,activeProviders:d,kindFilter:x=null,initialStrategy:u={}}){let[b,f]=(0,s.useState)(t?.name||""),[y,v]=(0,s.useState)(t?.models||[]),[N,k]=(0,s.useState)(u.fallbackStrategy||"fallback"),[w,C]=(0,s.useState)(!1!==u.capacityAutoSwitch),[S,R]=(0,s.useState)(!1),[E,M]=(0,s.useState)(!1),[A,F]=(0,s.useState)(""),[O,D]=(0,s.useState)({}),P=(0,r.FR)((0,r.MS)(r.AN,{activationConstraint:{distance:5}}),(0,r.MS)(r.uN,{coordinateGetter:o.JR})),q=y.map((e,t)=>({uid:`item-${t}`,model:e})),$=async()=>{try{let e=await fetch("/api/models/alias");if(!e.ok)return;let t=await e.json();D(t.aliases||{})}catch(e){console.error("Error fetching modal data:",e)}};(0,s.useEffect)(()=>{e&&(f(t?.name||""),v(t?.models||[]),k(u.fallbackStrategy||"fallback"),C(!1!==u.capacityAutoSwitch),R(!1),M(!1),F(""),$())},[e,t?.id,t?.name]);let _=e=>e.trim()?m.test(e)?(F(""),!0):(F("Only letters, numbers, -, _ and . allowed"),!1):(F("Name is required"),!1),z=async()=>{if(_(b)){if(0===y.length)return void alert("Add at least one model to the combo");if("auto"===N&&y.length<2)return void alert("Auto strategy needs at least 2 models in the worker pool (plus a connected router account)");M(!0),await n({name:b.trim(),models:y,strategy:N,capacityAutoSwitch:"auto"===N||w}),M(!1)}},L=!!t;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.aF,{isOpen:e,onClose:a,title:L?"Edit Combo":"Create Combo",children:(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsxs)("p",{className:"text-xs text-text-muted leading-relaxed",children:["Clients call this combo by name as the ",(0,l.jsx)("code",{className:"text-primary",children:"model"})," field. Strategy controls how models in the list are used."]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(c.pd,{label:"Combo Name",value:b,onChange:e=>{let t=e.target.value;f(t),t?_(t):F("")},placeholder:"my-combo",error:A}),(0,l.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:"Only letters, numbers, -, _ and . allowed \xb7 use as model id in /v1"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Strategy"}),(0,l.jsx)(c.l6,{options:p,value:N,onChange:e=>k(e.target.value),selectClassName:"py-2 text-sm"}),(0,l.jsx)("p",{className:"text-[11px] text-text-muted mt-1.5",children:h[N]}),"auto"!==N&&(0,l.jsxs)("label",{className:"mt-2 inline-flex items-center gap-2 text-xs text-text-muted cursor-pointer",children:[(0,l.jsx)("input",{type:"checkbox",className:"rounded border-border",checked:w,onChange:e=>C(e.target.checked)}),"Capacity auto-switch — prefer vision/PDF-capable models when the request needs them"]}),"auto"===N&&(0,l.jsx)("p",{className:"text-[11px] text-text-subtle mt-1.5 font-mono",children:"After create: set Router model on the combo card (must be a connected account). Workers = this model list (router excluded if listed)."}),"fusion"===N&&(0,l.jsx)("p",{className:"text-[11px] text-text-subtle mt-1.5 font-mono",children:"After create: optionally set Judge on the combo card (default = first model)."})]}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("label",{className:"text-sm font-medium mb-1.5 block",children:["Models ","fallback"===N?"(order = priority)":"(pool)"]}),0===y.length?(0,l.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"No models added yet"})]}):(0,l.jsx)(r.Mp,{sensors:P,collisionDetection:r.fp,onDragEnd:e=>{let{active:t,over:a}=e;if(a&&t.id!==a.id){let e=q.findIndex(e=>e.uid===t.id),l=q.findIndex(e=>e.uid===a.id);-1!==e&&-1!==l&&v(t=>(0,o.be)(t,e,l))}},modifiers:[i.FN,i.gj],children:(0,l.jsx)(o.gB,{items:q.map(e=>e.uid),strategy:o._G,children:(0,l.jsx)("div",{className:"flex max-h-[55vh] min-w-0 flex-col gap-1 overflow-y-auto sm:max-h-[350px]",children:q.map(({uid:e,model:t},a)=>(0,l.jsx)(g,{id:e,index:a,model:t,isFirst:0===a,isLast:a===q.length-1,onEdit:e=>{let t=[...y];t[a]=e,v(t)},onMoveUp:()=>(e=>{if(0===e)return;let t=[...y];[t[e-1],t[e]]=[t[e],t[e-1]],v(t)})(a),onMoveDown:()=>(e=>{if(e===y.length-1)return;let t=[...y];[t[e],t[e+1]]=[t[e+1],t[e]],v(t)})(a),onRemove:()=>{v(y.filter((e,t)=>t!==a))}},e))})})}),(0,l.jsxs)("button",{onClick:()=>R(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-primary font-medium hover:text-primary hover:border-primary/50 transition-colors flex items-center justify-center gap-1",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-2 pt-1 sm:flex-row",children:[(0,l.jsx)(c.$n,{onClick:a,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,l.jsx)(c.$n,{onClick:z,fullWidth:!0,size:"sm",disabled:!b.trim()||!!A||E,children:E?"Saving...":L?"Save":"Create"})]})]})}),(0,l.jsx)(c.rq,{isOpen:S,onClose:()=>R(!1),onSelect:e=>{y.includes(e.value)||v([...y,e.value])},onDeselect:e=>{v(y.filter(t=>t!==e.value))},activeProviders:d,modelAliases:O,title:"Add Model to Combo",kindFilter:x,addedModelValues:y,closeOnSelect:!1})]})}},80063:(e,t,a)=>{Promise.resolve().then(a.bind(a,48451))}},e=>{e.O(0,[2574,3862,1610,2562,7055,1321,705,5497,8441,3794,7358],()=>e(e.s=80063)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[624],{61872:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>x});var a=s(95155),r=s(12115),l=s(73321),n=s(98500),o=s.n(n),i=s(35497);function x(){return(0,a.jsx)(r.Suspense,{fallback:(0,a.jsx)("p",{className:"text-sm text-text-muted p-4",children:"Loading insights…"}),children:(0,a.jsx)(c,{})})}function c(){let e,t,s=(0,l.useSearchParams)().get("combo")||"",[n,x]=(0,r.useState)(null),[c,m]=(0,r.useState)(!1),[p,h]=(0,r.useState)(""),[u,g]=(0,r.useState)(""),[j,b]=(0,r.useState)(14),[N,f]=(0,r.useState)(""),[v,y]=(0,r.useState)(""),[w,k]=(0,r.useState)(!1),S=(0,r.useCallback)(async()=>{if(s){m(!0),h("");try{let e=new URLSearchParams({combo:s,days:String(j)});N&&e.set("cluster",N),v&&e.set("worker",v),w&&e.set("exploration","1");let t=await fetch(`/api/routing/insights?${e}`,{cache:"no-store"}),a=await t.json();if(!t.ok)throw Error(a.error||"Failed to load insights");x(a)}catch(e){h(e.message||"Failed"),x(null)}finally{m(!1)}}},[s,j,N,v,w]);(0,r.useEffect)(()=>{S()},[S]);let C=(0,r.useMemo)(()=>{if(!n?.heatmap)return 100;let e=1;for(let t of n.heatmap)for(let s of t.cells||[])null!=s.avg&&s.avg>e&&(e=s.avg);return e},[n]);return s?(0,a.jsxs)("div",{className:"flex flex-col gap-5 max-w-[1180px]",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("h1",{className:"text-[17px] font-semibold tracking-tight",children:"Routing insights"}),(0,a.jsxs)("p",{className:"text-xs font-mono text-text-subtle",children:["combo: ",s,n?.strategy?.routerModel?` \xb7 router ${n.strategy.routerModel}`:"",n?.strategy?.objective?` \xb7 ${n.strategy.objective}`:"",n?.strategy?.explorationRate!=null?` \xb7 ε=${Math.round((n.strategy.explorationRate??.05)*100)}% (cap ${Math.round((n.strategy.explorationRateCap??.2)*100)}%)`:""]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 items-center",children:[(0,a.jsxs)("select",{value:j,onChange:e=>b(Number(e.target.value)||14),className:"text-[11.5px] font-mono text-text-subtle px-2 py-1.5 rounded-[7px] bg-surface-2 border border-border",title:"Date range",children:[(0,a.jsx)("option",{value:7,children:"last 7 days"}),(0,a.jsx)("option",{value:14,children:"last 14 days"}),(0,a.jsx)("option",{value:30,children:"last 30 days"}),(0,a.jsx)("option",{value:90,children:"last 90 days"})]}),(0,a.jsxs)("select",{value:N,onChange:e=>f(e.target.value),className:"text-[11.5px] font-mono text-text-subtle px-2 py-1.5 rounded-[7px] bg-surface-2 border border-border max-w-[140px]",title:"Filter cluster",children:[(0,a.jsx)("option",{value:"",children:"all clusters"}),(n?.clusters||[]).map(e=>(0,a.jsx)("option",{value:e,children:e},e))]}),(0,a.jsxs)("select",{value:v,onChange:e=>y(e.target.value),className:"text-[11.5px] font-mono text-text-subtle px-2 py-1.5 rounded-[7px] bg-surface-2 border border-border max-w-[160px]",title:"Filter worker",children:[(0,a.jsx)("option",{value:"",children:"all workers"}),(n?.workers||[]).map(e=>(0,a.jsx)("option",{value:e,children:e.split("/").pop()},e))]}),(0,a.jsxs)("label",{className:"inline-flex items-center gap-1 text-[11px] text-text-muted cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",className:"rounded border-border",checked:w,onChange:e=>k(e.target.checked)}),"exploration only"]}),(0,a.jsx)(i.$n,{size:"sm",variant:"secondary",onClick:S,disabled:c,children:"Refresh"}),(0,a.jsx)(i.$n,{size:"sm",disabled:c,onClick:async()=>{g("");try{let e=await fetch("/api/routing/learn",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboName:s})}),t=await e.json();g(t.message||JSON.stringify(t)),await S()}catch(e){g(e.message)}},children:"Relearn now"}),(0,a.jsx)(o(),{href:"/dashboard/combos",className:"text-xs text-text-muted hover:text-primary px-2 py-1.5",children:"← Combos"})]})]}),u&&(0,a.jsx)("p",{className:"text-xs font-mono text-text-subtle",children:u}),p&&(0,a.jsx)("p",{className:"text-sm text-red-400",children:p}),c&&!n&&(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Loading…"}),n&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[(0,a.jsx)(d,{label:"Requests",value:String(n.eventCount??0)}),(0,a.jsx)(d,{label:"Need for learn",value:n.needMore>0?`${n.needMore} more`:"ready"}),(0,a.jsx)(d,{label:"Active version",value:n.promoted?`v${n.promoted.version}`:"—"}),(0,a.jsx)(d,{label:"Eval score",value:n.promoted?.evalScore!=null?Number(n.promoted.evalScore).toFixed(1):"—"})]}),(0,a.jsxs)("p",{className:"text-[11px] text-text-subtle font-mono -mt-2",children:["Request-level counts (one per chat). Intermediate fallback attempts",null!=n.attemptCount&&n.attemptCount!==n.eventCount?` (${n.attemptCount} attempt rows)`:""," ","feed the bandit but not the min-events gate. Single-worker and heuristic shortcuts are not logged here."]}),(0,a.jsxs)(i.Zp,{padding:"md",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1 flex-wrap gap-2",children:[(0,a.jsx)("span",{className:"text-[13px] font-semibold",children:"Win-rate heatmap"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-[10.5px] font-mono text-text-subtle",children:[(0,a.jsx)("span",{children:"low"}),(0,a.jsx)("span",{className:"w-[120px] h-2 rounded",style:{background:"linear-gradient(90deg,rgba(229,180,84,.1),rgba(229,180,84,.72))"}}),(0,a.jsx)("span",{children:"high \xb7 number always shown"})]})]}),(0,a.jsx)("p",{className:"text-[11.5px] font-mono text-text-subtle mb-3",children:"cluster \xd7 worker \xb7 average outcome score (0–100)"}),n.clusters?.length&&n.workers?.length?(0,a.jsxs)("div",{className:"grid gap-1 overflow-x-auto",style:{gridTemplateColumns:`112px repeat(${n.workers.length}, minmax(56px, 1fr))`},children:[(0,a.jsx)("div",{}),n.workers.map(e=>(0,a.jsx)("div",{className:"font-mono text-[10.5px] text-text-muted text-center pb-1 truncate",title:e,children:e.split("/").pop()},e)),n.heatmap.map(e=>(0,a.jsxs)("div",{className:"contents",children:[(0,a.jsx)("div",{className:"text-[11px] uppercase tracking-wide text-text-muted flex items-center font-medium",children:e.cluster}),e.cells.map(t=>{let s=t.avg,r=null==s||C<=0?0:Math.min(1,s/C);return(0,a.jsx)("div",{className:"rounded text-center font-mono text-[11px] py-2 border border-border",style:{background:`rgba(229,180,84,${.08+.55*r})`,color:null==s?"#6F6653":"#ECE4D2"},title:`${t.worker}: n=${t.n}`,children:null==s?"—":Math.round(s)},`${e.cluster}-${t.worker}`)})]},e.cluster))]}):(0,a.jsx)("p",{className:"text-sm text-text-muted py-6 text-center",children:"No routing events yet. Point a client at this combo with strategy Auto."})]}),(0,a.jsxs)(i.Zp,{padding:"md",children:[(0,a.jsx)("span",{className:"text-[13px] font-semibold",children:"Score trend"}),(0,a.jsx)("p",{className:"text-[11px] text-text-subtle font-mono mb-2",children:"mean outcomeScore per day over the selected window (request-level)"}),0===(n.scoreTrend||[]).length?(0,a.jsx)("p",{className:"text-xs text-text-muted py-3 text-center",children:"No scored days yet"}):(0,a.jsx)("div",{className:"flex items-end gap-1 h-24 overflow-x-auto pt-2",children:(t=Math.max(1,...(e=n.scoreTrend||[]).map(e=>Number(e.avgScore)||0)),e.map(e=>{let s=Number(e.avgScore)||0,r=Math.max(4,Math.round(s/t*80));return(0,a.jsxs)("div",{className:"flex flex-col items-center gap-0.5 min-w-[28px]",title:`${e.day}: ${s.toFixed(1)} (n=${e.n})`,children:[(0,a.jsx)("span",{className:"text-[9px] font-mono text-text-subtle",children:Math.round(s)}),(0,a.jsx)("div",{className:"w-5 rounded-t bg-primary/70",style:{height:r}}),(0,a.jsx)("span",{className:"text-[8px] font-mono text-text-subtle",children:String(e.day).slice(5)})]},e.day)}))})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,a.jsxs)(i.Zp,{padding:"md",children:[(0,a.jsx)("span",{className:"text-[13px] font-semibold",children:"Model performance"}),(0,a.jsxs)("div",{className:"mt-3 space-y-2",children:[0===(n.modelStats||[]).length&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No data"}),(n.modelStats||[]).map(e=>(0,a.jsxs)("div",{className:"grid grid-cols-[1fr_52px_60px_40px] gap-2 items-center text-xs",children:[(0,a.jsx)("span",{className:"font-mono truncate text-text-main",title:e.worker,children:e.worker}),(0,a.jsx)("span",{className:"text-right font-mono text-text-muted",children:null!=e.avgScore?Math.round(e.avgScore):"—"}),(0,a.jsx)("span",{className:"text-right font-mono text-text-muted",children:null!=e.avgLatencyMs?`${Math.round(e.avgLatencyMs)}ms`:"—"}),(0,a.jsx)("span",{className:"text-right font-mono text-text-subtle",children:e.errors||0})]},e.worker))]})]}),(0,a.jsxs)(i.Zp,{padding:"md",children:[(0,a.jsx)("span",{className:"text-[13px] font-semibold",children:"Learning versions"}),(0,a.jsx)("p",{className:"text-[11px] text-text-subtle font-mono mb-2",children:"immutable \xb7 rollback-safe"}),(0,a.jsxs)("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[0===(n.versions||[]).length&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No versions yet"}),(n.versions||[]).map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs border-b border-border py-1.5",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("span",{className:"font-mono text-text-main",children:["v",e.version,e.promoted?" \xb7 active":""]}),(0,a.jsxs)("div",{className:"text-[10px] text-text-subtle font-mono",children:["eval ",null!=e.evalScore?Number(e.evalScore).toFixed(1):"—"," \xb7"," ",e.source]})]}),!e.promoted&&(0,a.jsx)("button",{type:"button",className:"text-primary text-[11px] hover:underline",onClick:async()=>{await fetch("/api/routing/versions/promote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e.id})}),S()},children:"Promote"})]},e.id))]}),n.promoted?.prevVersionId&&(0,a.jsx)(i.$n,{size:"sm",variant:"outline",className:"mt-3",onClick:async()=>{await fetch("/api/routing/versions/rollback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboName:s})}),S()},children:"Rollback"})]})]}),(0,a.jsxs)(i.Zp,{padding:"md",children:[(0,a.jsx)("span",{className:"text-[13px] font-semibold",children:"Recent decisions"}),(0,a.jsxs)("div",{className:"mt-3 overflow-x-auto",children:[(0,a.jsxs)("table",{className:"w-full text-left text-xs",children:[(0,a.jsx)("thead",{className:"text-text-subtle font-mono uppercase tracking-wide",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"py-1 pr-2",children:"Time"}),(0,a.jsx)("th",{className:"py-1 pr-2",children:"Cluster"}),(0,a.jsx)("th",{className:"py-1 pr-2",children:"Worker"}),(0,a.jsx)("th",{className:"py-1 pr-2",children:"Score"}),(0,a.jsx)("th",{className:"py-1",children:"Reason"})]})}),(0,a.jsx)("tbody",{children:(n.recent||[]).map(e=>(0,a.jsxs)("tr",{className:"border-t border-border",children:[(0,a.jsxs)("td",{className:"py-1.5 pr-2 font-mono text-text-muted whitespace-nowrap",children:[e.timestamp?.slice(0,19)?.replace("T"," "),e.meta?.exploration?(0,a.jsx)("span",{className:"ml-1 text-[9px] text-primary",children:"ε"}):null]}),(0,a.jsx)("td",{className:"py-1.5 pr-2",children:e.cluster||"—"}),(0,a.jsx)("td",{className:"py-1.5 pr-2 font-mono truncate max-w-[160px]",title:e.pickedWorker,children:e.pickedWorker?.split("/").pop()||"—"}),(0,a.jsx)("td",{className:"py-1.5 pr-2 font-mono",children:null!=e.outcomeScore?Math.round(e.outcomeScore):"—"}),(0,a.jsx)("td",{className:"py-1.5 text-text-muted truncate max-w-[240px]",title:e.routerReason,children:e.routerReason||"—"})]},e.id))})]}),!(n.recent||[]).length&&(0,a.jsx)("p",{className:"text-xs text-text-muted py-4 text-center",children:"No decisions logged"})]})]}),(0,a.jsxs)(i.Zp,{padding:"md",children:[(0,a.jsx)("span",{className:"text-[13px] font-semibold",children:"Exploration log"}),(0,a.jsx)("p",{className:"text-[11px] text-text-subtle font-mono mb-2",children:"epsilon-greedy random picks (meta.exploration)"}),(0,a.jsxs)("div",{className:"space-y-1.5 max-h-48 overflow-y-auto",children:[0===(n.explorationLog||[]).length&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No exploration events in this window"}),(n.explorationLog||[]).map(e=>(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] font-mono border-b border-border py-1",children:[(0,a.jsx)("span",{className:"text-text-muted",children:e.timestamp?.slice(0,19)?.replace("T"," ")}),(0,a.jsx)("span",{children:e.cluster||"—"}),(0,a.jsx)("span",{className:"text-primary",children:e.pickedWorker?.split("/").pop()}),(0,a.jsxs)("span",{className:"text-text-subtle",children:["score ",null!=e.outcomeScore?Math.round(e.outcomeScore):"—"]})]},`ex-${e.id}`))]})]})]})]}):(0,a.jsxs)("div",{className:"max-w-lg space-y-3",children:[(0,a.jsx)("h1",{className:"text-[17px] font-semibold",children:"Routing insights"}),(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Open from a combo card with strategy ",(0,a.jsx)("strong",{children:"Auto"}),", or append"," ",(0,a.jsx)("code",{className:"text-xs",children:"?combo=your-combo"}),"."]}),(0,a.jsx)(o(),{href:"/dashboard/combos",className:"text-sm text-primary hover:underline",children:"← Combos"})]})}function d({label:e,value:t}){return(0,a.jsxs)("div",{className:"rounded-[11px] border border-border bg-surface p-3.5",children:[(0,a.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-text-subtle mb-1.5",children:e}),(0,a.jsx)("div",{className:"font-mono text-[18px] font-semibold text-text-main",children:t})]})}},63759:(e,t,s)=>{Promise.resolve().then(s.bind(s,61872))}},e=>{e.O(0,[2574,3862,1610,2562,1321,705,5497,8441,3794,7358],()=>e(e.s=63759)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[712],{44493:(e,t,l)=>{"use strict";l.d(t,{default:()=>o});var s=l(95155),n=l(12115),r=l(35497),a=l(90620);let c={LOG:"text-green-400",INFO:"text-blue-400",WARN:"text-yellow-400",ERROR:"text-red-400",DEBUG:"text-purple-400"};function o(){let[e,t]=(0,n.useState)([]),[l,o]=(0,n.useState)(!1),i=(0,n.useRef)(null),u=async()=>{try{await fetch("/api/translator/console-logs",{method:"DELETE"})}catch(e){console.error("Failed to clear console logs:",e)}};return(0,n.useEffect)(()=>{let e=new EventSource("/api/translator/console-logs/stream");return e.onopen=()=>o(!0),e.onmessage=e=>{let l=JSON.parse(e.data);"init"===l.type?t(l.logs.slice(-a.UY.maxLines)):"line"===l.type?t(e=>{let t=[...e,l.line];return t.length>a.UY.maxLines?t.slice(-a.UY.maxLines):t}):"lines"===l.type?t(e=>{let t=[...e,...l.lines];return t.length>a.UY.maxLines?t.slice(-a.UY.maxLines):t}):"clear"===l.type&&t([])},e.onerror=()=>o(!1),()=>e.close()},[]),(0,n.useEffect)(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e]),(0,s.jsx)("div",{className:"",children:(0,s.jsxs)(r.Zp,{children:[(0,s.jsx)("div",{className:"flex items-center justify-end px-4 pt-3 pb-2",children:(0,s.jsx)(r.$n,{size:"sm",variant:"outline",icon:"delete",onClick:u,children:"Clear"})}),(0,s.jsx)("div",{ref:i,className:"bg-black rounded-b-lg p-4 text-xs font-mono h-[calc(100vh-220px)] overflow-y-auto",children:0===e.length?(0,s.jsx)("span",{className:"text-text-muted",children:"No console logs yet."}):(0,s.jsx)("div",{className:"space-y-0.5",children:e.map((e,t)=>{let l,n;return(0,s.jsx)("div",{children:(n=c[(l=e.match(/\[(\w+)\]/g))?l[1]?.replace(/\[|\]/g,""):null]||"text-green-400",(0,s.jsx)("span",{className:n,children:e}))},t)})})})]})})}},94512:(e,t,l)=>{Promise.resolve().then(l.bind(l,44493))}},e=>{e.O(0,[2574,3862,1610,2562,1321,705,5497,8441,3794,7358],()=>e(e.s=94512)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[712],{44493:(e,t,l)=>{"use strict";l.d(t,{default:()=>o});var s=l(95155),n=l(12115),r=l(35497),a=l(90620);let c={LOG:"text-green-400",INFO:"text-blue-400",WARN:"text-yellow-400",ERROR:"text-red-400",DEBUG:"text-purple-400"};function o(){let[e,t]=(0,n.useState)([]),[l,o]=(0,n.useState)(!1),i=(0,n.useRef)(null),u=async()=>{try{await fetch("/api/translator/console-logs",{method:"DELETE"})}catch(e){console.error("Failed to clear console logs:",e)}};return(0,n.useEffect)(()=>{let e=new EventSource("/api/translator/console-logs/stream");return e.onopen=()=>o(!0),e.onmessage=e=>{let l=JSON.parse(e.data);"init"===l.type?t(l.logs.slice(-a.UY.maxLines)):"line"===l.type?t(e=>{let t=[...e,l.line];return t.length>a.UY.maxLines?t.slice(-a.UY.maxLines):t}):"lines"===l.type?t(e=>{let t=[...e,...l.lines];return t.length>a.UY.maxLines?t.slice(-a.UY.maxLines):t}):"clear"===l.type&&t([])},e.onerror=()=>o(!1),()=>e.close()},[]),(0,n.useEffect)(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e]),(0,s.jsx)("div",{className:"",children:(0,s.jsxs)(r.Zp,{children:[(0,s.jsx)("div",{className:"flex items-center justify-end px-4 pt-3 pb-2",children:(0,s.jsx)(r.$n,{size:"sm",variant:"outline",icon:"delete",onClick:u,children:"Clear"})}),(0,s.jsx)("div",{ref:i,className:"bg-black rounded-b-lg p-4 text-xs font-mono h-[calc(100vh-220px)] overflow-y-auto",children:0===e.length?(0,s.jsx)("span",{className:"text-text-muted",children:"No console logs yet."}):(0,s.jsx)("div",{className:"space-y-0.5",children:e.map((e,t)=>{let l,n;return(0,s.jsx)("div",{children:(n=c[(l=e.match(/\[(\w+)\]/g))?l[1]?.replace(/\[|\]/g,""):null]||"text-green-400",(0,s.jsx)("span",{className:n,children:e}))},t)})})})]})})}},63131:(e,t,l)=>{Promise.resolve().then(l.bind(l,44493))}},e=>{e.O(0,[2574,3862,1610,2562,1321,705,5497,8441,3794,7358],()=>e(e.s=63131)),_N_E=e.O()}]);
@@ -0,0 +1,3 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6099],{53427:(e,t,s)=>{Promise.resolve().then(s.bind(s,66187))},66187:(e,t,s)=>{"use strict";s.d(t,{default:()=>b});var i=s(95155),a=s(12115),n=s(14051),l=s.n(n),r=s(35625),o=s(4109),d=s(48934),c=s(35497),m=s(11059);function x({label:e,url:t,copyId:s,copied:a,onCopy:n,badge:l,actions:r}){return(0,i.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,i.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center border ${"CF"===l||"TS"===l?"bg-primary/10 text-primary border-primary/25":"bg-surface-2 text-text-muted border-border"}`,children:e}),(0,i.jsx)(c.pd,{value:t,readOnly:!0,className:"flex-1 min-w-0",inputClassName:"font-mono text-sm"}),(0,i.jsx)("button",{type:"button",onClick:()=>n(t,s),className:"p-2 hover:bg-surface-2 rounded text-text-muted hover:text-primary transition-colors shrink-0 border border-transparent hover:border-border",title:"Copy","aria-label":"Copy endpoint URL",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px] leading-none",children:a===s?"check":"content_copy"})}),r]})}function u({message:e,action:t}){return(0,i.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-brand-500/10 border border-brand-500/30 text-brand-400",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 leading-none",children:"warning"}),(0,i.jsx)("p",{className:"text-xs flex-1 text-brand-300",children:e}),t&&(0,i.jsx)("a",{href:t.href,className:"text-xs font-medium underline shrink-0 hover:opacity-80",onClick:t.href.startsWith("#")?e=>{e.preventDefault(),document.getElementById(t.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:t.label})]})}let y=()=>["endpoint","keys"],h=()=>["endpoint","settings"];async function p(e,t){let s=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t?.headers||{}},credentials:"same-origin"}),i=null;try{i=await s.json()}catch{i=null}if(!s.ok){let e=i&&(i.error||i.message)||`Request failed (${s.status})`,t=Error("string"==typeof e?e:"Request failed");throw t.status=s.status,t.data=i,t}return i}function b({initialData:e}){let t=(0,r.jE)(),s=e?.machineId||"",n=(0,o.I)({queryKey:y(),queryFn:async()=>(await p("/api/keys")).keys||[],initialData:e?.keys||[]}),l=(0,o.I)({queryKey:h(),queryFn:()=>p("/api/settings"),initialData:e?.settings||{}}),f=n.data||[],j=l.data?.requireApiKey===!0,[g,k]=(0,a.useState)(!1),[v,N]=(0,a.useState)(""),[C,w]=(0,a.useState)(null),[A,P]=(0,a.useState)(null),[S,I]=(0,a.useState)(()=>new Set),[K,q]=(0,a.useState)("/v1");(0,a.useEffect)(()=>{q(`${window.location.origin}/v1`)},[]);let{copied:_,copy:$}=(0,m.C)(),O=(0,d.n)({mutationFn:e=>p("/api/settings",{method:"PATCH",body:JSON.stringify({requireApiKey:e})}),onSuccess:()=>{t.invalidateQueries({queryKey:h()})}}),D=(0,d.n)({mutationFn:e=>p("/api/keys",{method:"POST",body:JSON.stringify({name:e})}),onSuccess:e=>{w(e.key||null),N(""),k(!1),t.invalidateQueries({queryKey:y()})}}),E=(0,d.n)({mutationFn:e=>p(`/api/keys/${e}`,{method:"DELETE"}),onSuccess:()=>{t.invalidateQueries({queryKey:y()})}}),F=(0,d.n)({mutationFn:({id:e,isActive:t})=>p(`/api/keys/${e}`,{method:"PUT",body:JSON.stringify({isActive:t})}),onSuccess:()=>{t.invalidateQueries({queryKey:y()})}});return(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,i.jsxs)(c.Zp,{children:[(0,i.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-primary",children:"api"}),"API Endpoint"]}),(0,i.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Local OpenAI-compatible base URL for coding agents and SDKs. Switchboard is local-only — no tunnels or remote exposure."}),(0,i.jsx)(x,{label:"Local",url:K,copyId:"local_url",copied:_,onCopy:$}),s?(0,i.jsxs)("p",{className:"mt-3 text-xs text-text-muted font-mono",children:["Machine: ",s]}):null]}),(0,i.jsxs)(c.Zp,{id:"require-api-key",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,i.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-primary",children:"vpn_key"}),"API Keys"]}),(0,i.jsx)(c.$n,{icon:"add",onClick:()=>k(!0),children:"Create Key"})]}),(0,i.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,i.jsx)("p",{className:"text-sm text-text-muted",children:"Requests without a valid key will be rejected"})]}),(0,i.jsx)(c.lM,{checked:j,onChange:()=>O.mutate(!j)})]}),!j&&(0,i.jsx)("div",{className:"mb-4 -mt-2",children:(0,i.jsx)(u,{message:"API key is not required — any local client can call /v1."})}),0===f.length?(0,i.jsxs)("div",{className:"text-center py-12",children:[(0,i.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,i.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,i.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,i.jsx)(c.$n,{icon:"add",onClick:()=>k(!0),children:"Create Key"})]}):(0,i.jsx)("div",{className:"flex flex-col",children:f.map(e=>{var t;return(0,i.jsxs)("div",{className:`group flex items-center justify-between py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 ${!1===e.isActive?"opacity-60":""}`,children:[(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium",children:e.name}),(0,i.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,i.jsx)("code",{className:"text-xs text-text-muted font-mono",children:S.has(e.id)?e.key:(t=e.key)&&!(t.length<=10)?t.slice(0,6)+"•".repeat(t.length-10)+t.slice(-4):t||""}),(0,i.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void I(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",title:S.has(e.id)?"Hide key":"Show key",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:S.has(e.id)?"visibility_off":"visibility"})}),(0,i.jsx)("button",{type:"button",onClick:()=>$(e.key,e.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:_===e.id?"check":"content_copy"})})]}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(e.createdAt).toLocaleDateString()]}),!1===e.isActive&&(0,i.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"})]}),(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)(c.lM,{size:"sm",checked:e.isActive??!0,onChange:t=>{e.isActive&&!t?P({title:"Pause API Key",message:`Pause API key "${e.name}"?
2
+
3
+ This key will stop working immediately but can be resumed later.`,onConfirm:async()=>{P(null),F.mutate({id:e.id,isActive:t})}}):F.mutate({id:e.id,isActive:t})},title:e.isActive?"Pause key":"Resume key"}),(0,i.jsx)("button",{type:"button",onClick:()=>P({title:"Delete API Key",message:"Delete this API key?",onConfirm:async()=>{P(null),E.mutate(e.id)}}),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},e.id)})})]}),(0,i.jsx)(c.aF,{isOpen:g,title:"Create API Key",onClose:()=>{k(!1),N("")},children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)(c.pd,{label:"Key Name",value:v,onChange:e=>N(e.target.value),placeholder:"Production Key"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:()=>D.mutate(v.trim()),fullWidth:!0,disabled:!v.trim()||D.isPending,loading:D.isPending,children:"Create"}),(0,i.jsx)(c.$n,{onClick:()=>{k(!1),N("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,i.jsx)(c.aF,{isOpen:!!C,title:"API Key Created",onClose:()=>w(null),children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,i.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,i.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.pd,{value:C||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,i.jsx)(c.$n,{variant:"secondary",icon:"created_key"===_?"check":"content_copy",onClick:()=>$(C,"created_key"),children:"created_key"===_?"Copied!":"Copy"})]}),(0,i.jsx)(c.$n,{onClick:()=>w(null),fullWidth:!0,children:"Done"})]})}),(0,i.jsx)(c.uo,{isOpen:!!A,onClose:()=>P(null),onConfirm:A?.onConfirm,title:A?.title||"Confirm",message:A?.message,variant:"danger"})]})}b.propTypes={initialData:l().shape({machineId:l().string,keys:l().array,settings:l().object}).isRequired}}},e=>{e.O(0,[2574,3862,1610,2562,1631,2176,1321,705,5497,8441,3794,7358],()=>e(e.s=53427)),_N_E=e.O()}]);