@amir83nasr/10router 0.1.16 → 0.1.18

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 (240) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +5 -5
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  6. package/.next/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  7. package/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  8. package/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  10. package/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  11. package/.next/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  12. package/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  13. package/.next/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  14. package/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/[id]/page.js +1 -1
  16. package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/[id]/page_client-reference-manifest.js +1 -1
  17. package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/page.js +1 -1
  18. package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/page_client-reference-manifest.js +1 -1
  19. package/.next/server/app/(dashboard)/dashboard/page.js +1 -1
  20. package/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  21. package/.next/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  22. package/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  23. package/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  24. package/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  25. package/.next/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  26. package/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  27. package/.next/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  28. package/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  29. package/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  30. package/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  31. package/.next/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  32. package/.next/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  33. package/.next/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  34. package/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  35. package/.next/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  36. package/.next/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  37. package/.next/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  38. package/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  39. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  40. package/.next/server/app/_global-error.html +1 -1
  41. package/.next/server/app/_global-error.rsc +1 -1
  42. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  43. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  44. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  45. package/.next/server/app/_not-found/page.js +1 -1
  46. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  47. package/.next/server/app/_not-found.html +1 -1
  48. package/.next/server/app/_not-found.rsc +5 -5
  49. package/.next/server/app/_not-found.segments/_full.segment.rsc +5 -5
  50. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -5
  51. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  52. package/.next/server/app/api/cli-tools/all-statuses/route.js +1 -1
  53. package/.next/server/app/api/cli-tools/claude-settings/route.js +1 -1
  54. package/.next/server/app/api/cli-tools/codex-settings/route.js +1 -1
  55. package/.next/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  56. package/.next/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  57. package/.next/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  58. package/.next/server/app/api/cli-tools/dsh-settings/route.js +1 -1
  59. package/.next/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  60. package/.next/server/app/api/models/route.js +1 -1
  61. package/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  62. package/.next/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  63. package/.next/server/app/api/oauth/codex/import-token/route.js +1 -1
  64. package/.next/server/app/api/providers/[id]/models/route.js +1 -1
  65. package/.next/server/app/api/providers/[id]/test/route.js +1 -1
  66. package/.next/server/app/api/providers/client/route.js +1 -1
  67. package/.next/server/app/api/providers/route.js +1 -1
  68. package/.next/server/app/api/providers/test-batch/route.js +1 -1
  69. package/.next/server/app/api/providers/validate/route.js +1 -1
  70. package/.next/server/app/api/settings/route.js +1 -1
  71. package/.next/server/app/api/translator/console-logs/route.js +1 -1
  72. package/.next/server/app/api/translator/console-logs/stream/route.js +1 -1
  73. package/.next/server/app/api/translator/send/route.js +1 -1
  74. package/.next/server/app/api/translator/translate/route.js +1 -1
  75. package/.next/server/app/api/tunnel/disable/route.js +1 -1
  76. package/.next/server/app/api/tunnel/enable/route.js +1 -1
  77. package/.next/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  78. package/.next/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  79. package/.next/server/app/api/tunnel/tailscale-install/route.js +2 -2
  80. package/.next/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  81. package/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  82. package/.next/server/app/api/v1/api/chat/route.js +1 -1
  83. package/.next/server/app/api/v1/audio/speech/route.js +1 -1
  84. package/.next/server/app/api/v1/audio/transcriptions/route.js +1 -1
  85. package/.next/server/app/api/v1/chat/completions/route.js +1 -1
  86. package/.next/server/app/api/v1/embeddings/route.js +1 -1
  87. package/.next/server/app/api/v1/images/generations/route.js +1 -1
  88. package/.next/server/app/api/v1/messages/route.js +1 -1
  89. package/.next/server/app/api/v1/models/[...model]/route.js +1 -1
  90. package/.next/server/app/api/v1/models/route.js +1 -1
  91. package/.next/server/app/api/v1/responses/compact/route.js +1 -1
  92. package/.next/server/app/api/v1/responses/route.js +1 -1
  93. package/.next/server/app/api/v1/route.js +1 -1
  94. package/.next/server/app/api/v1/search/route.js +1 -1
  95. package/.next/server/app/api/v1/systemone/route.js +1 -1
  96. package/.next/server/app/api/v1/videos/[id]/route.js +1 -1
  97. package/.next/server/app/api/v1/videos/edits/route.js +1 -1
  98. package/.next/server/app/api/v1/videos/extensions/route.js +1 -1
  99. package/.next/server/app/api/v1/videos/generations/route.js +1 -1
  100. package/.next/server/app/api/v1/web/fetch/route.js +1 -1
  101. package/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
  102. package/.next/server/app/api/version/route.js +1 -1
  103. package/.next/server/app/callback/page.js +1 -1
  104. package/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  105. package/.next/server/app/callback.html +1 -1
  106. package/.next/server/app/callback.rsc +5 -5
  107. package/.next/server/app/callback.segments/_full.segment.rsc +5 -5
  108. package/.next/server/app/callback.segments/_tree.segment.rsc +1 -1
  109. package/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +5 -5
  110. package/.next/server/app/dashboard/cli-tools.html +1 -1
  111. package/.next/server/app/dashboard/cli-tools.rsc +8 -8
  112. package/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +7 -7
  113. package/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +8 -8
  114. package/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  115. package/.next/server/app/dashboard/combos.html +1 -1
  116. package/.next/server/app/dashboard/combos.rsc +7 -7
  117. package/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +7 -7
  118. package/.next/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
  119. package/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  120. package/.next/server/app/dashboard/endpoint.html +1 -1
  121. package/.next/server/app/dashboard/endpoint.rsc +8 -8
  122. package/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +7 -7
  123. package/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +8 -8
  124. package/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  125. package/.next/server/app/dashboard/media-providers/systemone.html +1 -1
  126. package/.next/server/app/dashboard/media-providers/systemone.rsc +7 -7
  127. package/.next/server/app/dashboard/media-providers/systemone.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/systemone/__PAGE__.segment.rsc +7 -7
  128. package/.next/server/app/dashboard/media-providers/systemone.segments/_full.segment.rsc +7 -7
  129. package/.next/server/app/dashboard/media-providers/systemone.segments/_tree.segment.rsc +1 -1
  130. package/.next/server/app/dashboard/profile.html +1 -1
  131. package/.next/server/app/dashboard/profile.rsc +7 -7
  132. package/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +7 -7
  133. package/.next/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
  134. package/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  135. package/.next/server/app/dashboard/providers/new.html +1 -1
  136. package/.next/server/app/dashboard/providers/new.rsc +7 -7
  137. package/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +7 -7
  138. package/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
  139. package/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  140. package/.next/server/app/dashboard/providers.html +1 -1
  141. package/.next/server/app/dashboard/providers.rsc +7 -7
  142. package/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +7 -7
  143. package/.next/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
  144. package/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  145. package/.next/server/app/dashboard/proxy-pools.html +1 -1
  146. package/.next/server/app/dashboard/proxy-pools.rsc +7 -7
  147. package/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +7 -7
  148. package/.next/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -7
  149. package/.next/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  150. package/.next/server/app/dashboard/pxpipe.html +1 -1
  151. package/.next/server/app/dashboard/pxpipe.rsc +6 -6
  152. package/.next/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +6 -6
  153. package/.next/server/app/dashboard/pxpipe.segments/_full.segment.rsc +6 -6
  154. package/.next/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  155. package/.next/server/app/dashboard/quota.html +2 -2
  156. package/.next/server/app/dashboard/quota.rsc +8 -8
  157. package/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +8 -8
  158. package/.next/server/app/dashboard/quota.segments/_full.segment.rsc +8 -8
  159. package/.next/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  160. package/.next/server/app/dashboard/settings/pricing/page.js +1 -1
  161. package/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  162. package/.next/server/app/dashboard/settings/pricing.html +1 -1
  163. package/.next/server/app/dashboard/settings/pricing.rsc +5 -5
  164. package/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
  165. package/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  166. package/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +5 -5
  167. package/.next/server/app/dashboard/token-saver.html +1 -1
  168. package/.next/server/app/dashboard/token-saver.rsc +6 -6
  169. package/.next/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +6 -6
  170. package/.next/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  171. package/.next/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  172. package/.next/server/app/dashboard/usage.html +2 -2
  173. package/.next/server/app/dashboard/usage.rsc +7 -7
  174. package/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +7 -7
  175. package/.next/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
  176. package/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  177. package/.next/server/app/dashboard.html +1 -1
  178. package/.next/server/app/dashboard.rsc +8 -8
  179. package/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +7 -7
  180. package/.next/server/app/dashboard.segments/_full.segment.rsc +8 -8
  181. package/.next/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  182. package/.next/server/app/index.html +1 -1
  183. package/.next/server/app/index.rsc +5 -5
  184. package/.next/server/app/index.segments/__PAGE__.segment.rsc +5 -5
  185. package/.next/server/app/index.segments/_full.segment.rsc +5 -5
  186. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  187. package/.next/server/app/landing/page.js +1 -1
  188. package/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  189. package/.next/server/app/landing.html +1 -1
  190. package/.next/server/app/landing.rsc +5 -5
  191. package/.next/server/app/landing.segments/_full.segment.rsc +5 -5
  192. package/.next/server/app/landing.segments/_tree.segment.rsc +1 -1
  193. package/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +5 -5
  194. package/.next/server/app/login/page.js +1 -1
  195. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  196. package/.next/server/app/login.html +1 -1
  197. package/.next/server/app/login.rsc +5 -5
  198. package/.next/server/app/login.segments/_full.segment.rsc +5 -5
  199. package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
  200. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +5 -5
  201. package/.next/server/app/page.js +1 -1
  202. package/.next/server/app/page_client-reference-manifest.js +1 -1
  203. package/.next/server/app-paths-manifest.json +5 -5
  204. package/.next/server/chunks/1003.js +1 -1
  205. package/.next/server/chunks/1649.js +1 -1
  206. package/.next/server/chunks/1751.js +1 -1
  207. package/.next/server/chunks/2143.js +1 -1
  208. package/.next/server/chunks/2151.js +1 -1
  209. package/.next/server/chunks/2282.js +3 -3
  210. package/.next/server/chunks/2531.js +1 -1
  211. package/.next/server/chunks/2801.js +1 -1
  212. package/.next/server/chunks/3671.js +1 -1
  213. package/.next/server/chunks/6343.js +3 -3
  214. package/.next/server/chunks/6617.js +1 -1
  215. package/.next/server/chunks/7591.js +1 -1
  216. package/.next/server/chunks/7904.js +1 -1
  217. package/.next/server/chunks/9429.js +1 -1
  218. package/.next/server/middleware-build-manifest.js +1 -1
  219. package/.next/server/pages/404.html +1 -1
  220. package/.next/server/pages/500.html +1 -1
  221. package/.next/server/server-reference-manifest.js +1 -1
  222. package/.next/server/server-reference-manifest.json +1 -1
  223. package/.next/static/chunks/1660-084df607ff4f889d.js +1 -0
  224. package/.next/static/chunks/{6770-e2921b2ce695ed57.js → 6770-9e948c92e87956c4.js} +1 -1
  225. package/CHANGELOG.md +11 -0
  226. package/open-sse/config/opencodeGo.js +3 -2
  227. package/open-sse/executors/opencode-go.js +7 -0
  228. package/open-sse/executors/opencode.js +20 -0
  229. package/open-sse/handlers/chatCore.js +7 -14
  230. package/open-sse/providers/capabilities.js +30 -0
  231. package/open-sse/providers/models/helpers.js +14 -0
  232. package/open-sse/providers/registry/opencode-go.js +116 -31
  233. package/open-sse/services/lazyRuntime.js +110 -0
  234. package/open-sse/services/opencodeTlsClient.js +91 -0
  235. package/open-sse/services/provider.js +27 -0
  236. package/open-sse/utils/writableDataDir.js +32 -0
  237. package/package.json +1 -1
  238. package/.next/static/chunks/1660-c4c1cfa3cb7c9b2e.js +0 -1
  239. /package/.next/static/{EsP8l_VAPRRfBiiJPJqQe → PyHCF87rmgiD0pV5fDUOP}/_buildManifest.js +0 -0
  240. /package/.next/static/{EsP8l_VAPRRfBiiJPJqQe → PyHCF87rmgiD0pV5fDUOP}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (()=>{var a={};a.id=2134,a.ids=[2134],a.modules={643:a=>{"use strict";a.exports=require("node:perf_hooks")},1708:a=>{"use strict";a.exports=require("node:process")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{"use strict";a.exports=require("node:buffer")},7066:a=>{"use strict";a.exports=require("node:tty")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14985:a=>{"use strict";a.exports=require("dns")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},28740:(a,b,c)=>{Promise.resolve().then(c.bind(c,94221))},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},32467:a=>{"use strict";a.exports=require("node:http2")},33873:a=>{"use strict";a.exports=require("path")},34589:a=>{"use strict";a.exports=require("node:assert")},37067:a=>{"use strict";a.exports=require("node:http")},37540:a=>{"use strict";a.exports=require("node:console")},38522:a=>{"use strict";a.exports=require("node:zlib")},40610:a=>{"use strict";a.exports=require("node:dns")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},41692:a=>{"use strict";a.exports=require("node:tls")},41792:a=>{"use strict";a.exports=require("node:querystring")},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},46293:a=>{"use strict";a.exports=require("sql.js")},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},53053:a=>{"use strict";a.exports=require("node:diagnostics_channel")},53207:(a,b,c)=>{Promise.resolve().then(c.bind(c,83772))},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},57075:a=>{"use strict";a.exports=require("node:stream")},57975:a=>{"use strict";a.exports=require("node:util")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},67197:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>x,handler:()=>z,routeModule:()=>y});var d=c(26720),e=c(29966),f=c(36243),g=c(70310),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,79452))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,2808,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,8329,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,41580,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,11089))),o=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),p=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,2808,23))),q=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,8329,23))),r=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,41580,23))),s=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),t=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),u=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),v={children:["",{children:["(dashboard)",{children:["dashboard",{children:["providers",{children:["[id]",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,83772))),"/home/runner/work/10Router/10Router/src/app/(dashboard)/dashboard/providers/[id]/page.tsx"]}]},{"global-error":[u,"next/dist/client/components/builtin/global-error.js"]},["new"]]},{"global-error":[t,"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[s,"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[n,"/home/runner/work/10Router/10Router/src/app/(dashboard)/layout.tsx"],"global-error":[o,"next/dist/client/components/builtin/global-error.js"],"not-found":[p,"next/dist/client/components/builtin/not-found.js"],forbidden:[q,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[r,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[i,"/home/runner/work/10Router/10Router/src/app/layout.tsx"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,w=(0,e.H)({tree:v,page:"/(dashboard)/dashboard/providers/[id]/page",pathname:"/dashboard/providers/[id]",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),x=w.__next_app__,y=w.routeModule,z=w.handler},71553:a=>{"use strict";a.exports=require("node:dns/promises")},71622:a=>{"use strict";a.exports=import("open")},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73429:a=>{"use strict";a.exports=require("node:util/types")},73496:a=>{"use strict";a.exports=require("http2")},74075:a=>{"use strict";a.exports=require("zlib")},75919:a=>{"use strict";a.exports=require("node:worker_threads")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},77598:a=>{"use strict";a.exports=require("node:crypto")},78474:a=>{"use strict";a.exports=require("node:events")},79551:a=>{"use strict";a.exports=require("url")},79646:a=>{"use strict";a.exports=require("child_process")},79868:a=>{"use strict";a.exports=require("node:sqlite")},81630:a=>{"use strict";a.exports=require("http")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},83772:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(35062).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/10Router/10Router/src/app/(dashboard)/dashboard/providers/[id]/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/10Router/10Router/src/app/(dashboard)/dashboard/providers/[id]/page.tsx","default")},87997:a=>{"use strict";a.exports=require("node:timers")},91645:a=>{"use strict";a.exports=require("net")},94221:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>$});var d=c(86240),e=c(28907),f=c(70433),g=c(70126),h=c(4459),i=c.n(h),j=c(62871),k=c(82975),l=c(20482),m=c(4271),n=c(63265),o=c(86177),p=c(95137),q=c(57145),r=c(38889),s=c(27720);function t({customModels:a=[],modelAliases:b={},providerAlias:c,builtInModels:d=[],type:e="llm",includeLegacyAliases:f=!0}){let g=new Set(d.map(a=>a.id)),h=new Set,i=[];for(let b of a){if(!b?.id||b.providerAlias!==c)continue;let a=b?.kind||b?.type||"llm";if(e&&a!==e||g.has(b.id))continue;let d=`${c}/${b.id}`;h.has(d)||(h.add(d),i.push({id:b.id,name:b.name||b.id,fullModel:d,source:"custom",type:a}))}if(!f)return i;let j=`${c}/`;for(let[a,c]of Object.entries(b||{})){if("string"!=typeof c||!c.startsWith(j))continue;let b=c.slice(j.length);!b||g.has(b)||h.has(c)||(h.add(c),i.push({id:b,alias:a,fullModel:c,source:"legacyAlias",type:e||"llm"}))}return i}var u=c(29184),v=c(31952);function w({model:a,fullModel:b,alias:c,copied:f,onCopy:g,testStatus:h,isCustom:i,isFree:j,onDeleteAlias:k,onTest:m,isTesting:n,onDisable:o,caps:p}){let q="ok"===h?"#22c55e":"error"===h?"#ef4444":void 0;return(0,d.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===h?"border-green-500/40":"error"===h?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,d.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,d.jsx)(e.default,{name:"ok"===h?"check_circle":"error"===h?"cancel":"smart_toy",className:"shrink-0 text-base",style:q?{color:q}:void 0}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,d.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-muted-foreground sm:max-w-[360px]",children:b}),(0,d.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[a.name&&(0,d.jsx)("span",{className:"truncate text-[9px] italic text-muted-foreground/70",children:a.name}),(0,d.jsx)(l.nh,{caps:p,colorOverride:"text-muted-foreground/70",size:12})]})]}),j&&(0,d.jsxs)(v.m_,{children:[(0,d.jsx)(v.k$,{asChild:!0,children:(0,d.jsx)(u.E,{className:"shrink-0 bg-green-500/10 font-bold text-green-600 dark:text-green-500",children:"FREE"})}),(0,d.jsx)(v.ZI,{children:"Free model: works through the free OpenCode lane. An OpenCode Zen/Go API key cannot unlock it."})]}),m&&(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:m,disabled:n,className:`rounded p-0.5 text-muted-foreground transition-opacity hover:bg-sidebar hover:text-primary ${n?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,d.jsx)(e.default,{name:n?"progress_activity":"science",className:"text-sm",style:n?{animation:"spin 1s linear infinite"}:void 0})}),(0,d.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-muted-foreground whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:n?"Testing...":"Test"})]}),(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:()=>g(b,`model-${a.id}`),className:"rounded p-0.5 text-muted-foreground hover:bg-sidebar hover:text-primary",children:(0,d.jsx)(e.default,{name:f===`model-${a.id}`?"check":"content_copy",className:"text-sm"})}),(0,d.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-muted-foreground whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:f===`model-${a.id}`?"Copied!":"Copy"})]}),i?(0,d.jsxs)(v.m_,{children:[(0,d.jsx)(v.k$,{asChild:!0,children:(0,d.jsx)("button",{onClick:k,className:"ml-auto rounded p-0.5 text-muted-foreground opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",children:(0,d.jsx)(e.default,{name:"close",className:"text-sm"})})}),(0,d.jsx)(v.ZI,{children:"Remove custom model"})]}):o?(0,d.jsxs)(v.m_,{children:[(0,d.jsx)(v.k$,{asChild:!0,children:(0,d.jsx)("button",{onClick:o,className:"ml-auto rounded p-0.5 text-muted-foreground opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",children:(0,d.jsx)(e.default,{name:"close",className:"text-sm"})})}),(0,d.jsx)(v.ZI,{children:"Disable this model"})]}):null]})})}var x=c(70369),y=c(63998),z=c(67209),A=c(7485),B=c(83226),C=c(43938);function D({modelId:a,fullModel:b,copied:c,onCopy:f,onDeleteAlias:g,onTest:h,testStatus:i,isTesting:j}){let k="ok"===i?"#22c55e":"error"===i?"#ef4444":void 0;return(0,d.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===i?"border-green-500/40":"error"===i?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,d.jsx)(e.default,{name:"ok"===i?"check_circle":"error"===i?"cancel":"smart_toy",className:"text-base text-muted-foreground",style:k?{color:k}:void 0}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:a}),(0,d.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,d.jsx)("code",{className:"text-xs text-muted-foreground font-mono bg-sidebar px-1.5 py-0.5 rounded",children:b}),(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:()=>f(b,`model-${a}`),className:"p-0.5 hover:bg-sidebar rounded text-muted-foreground hover:text-primary",children:(0,d.jsx)(e.default,{name:c===`model-${a}`?"check":"content_copy",className:"text-sm"})}),(0,d.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-muted-foreground whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:c===`model-${a}`?"Copied!":"Copy"})]}),h&&(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:h,disabled:j,className:"p-0.5 hover:bg-sidebar rounded text-muted-foreground hover:text-primary transition-colors",children:(0,d.jsx)(e.default,{name:j?"progress_activity":"science",className:"text-sm",style:j?{animation:"spin 1s linear infinite"}:void 0})}),(0,d.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-muted-foreground whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:j?"Testing...":"Test"})]})]})]}),(0,d.jsxs)(v.m_,{children:[(0,d.jsx)(v.k$,{asChild:!0,children:(0,d.jsx)("button",{onClick:g,className:"p-1 hover:bg-red-50 rounded text-red-500",children:(0,d.jsx)(e.default,{name:"delete",className:"text-sm"})})}),(0,d.jsx)(v.ZI,{children:"Remove model"})]})]})}function E({providerStorageAlias:a,providerDisplayAlias:b,modelAliases:c,customModels:g,copied:h,onCopy:i,onDeleteAlias:j,onAddCustomModel:k,onDeleteCustomModel:l,connections:m,isAnthropic:o}){let[p,q]=(0,f.useState)(""),[r,s]=(0,f.useState)(!1),[u,v]=(0,f.useState)(!1),[w,x]=(0,f.useState)(null),[y,z]=(0,f.useState)({}),A=async b=>{if(!w){x(b);try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${a}/${b}`})}),d=await c.json();z(a=>({...a,[b]:d.ok?"ok":"error"}))}catch{z(a=>({...a,[b]:"error"}))}finally{x(null)}}},B=t({customModels:g,modelAliases:c,providerAlias:a,type:"llm"}),C=async()=>{if(!p.trim()||r)return;let a=p.trim();if(B.some(b=>b.id===a))return void alert("Model already exists for this provider.");s(!0);try{await k(a),q("")}catch(a){console.log("Error adding model:",a)}finally{s(!1)}},F=async()=>{if(u)return;let a=m.find(a=>!1!==a.isActive);if(a){v(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||"Failed to import models");let d=c.models||[];if(0===d.length)return void alert("No models returned from /models.");let e=0;for(let a of d){let b=a.id||a.name||a.model;b&&(B.some(a=>a.id===b)||(await k(b),e+=1))}0===e&&alert("No new models were added.")}catch(a){console.log("Error importing models:",a)}finally{v(!1)}}},G=m.some(a=>!1!==a.isActive);return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Add ",o?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,d.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,d.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-muted-foreground mb-1 block",children:"Model ID"}),(0,d.jsx)("input",{id:"new-compatible-model-input",type:"text",value:p,onChange:a=>q(a.target.value),onKeyDown:a=>"Enter"===a.key&&C(),placeholder:o?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,d.jsxs)(n.$,{size:"sm",onClick:C,disabled:!p.trim()||r,children:[(0,d.jsx)(e.default,{name:"add"}),r?"Adding...":"Add"]}),(0,d.jsxs)(n.$,{size:"sm",variant:"secondary",onClick:F,disabled:!G||u,children:[(0,d.jsx)(e.default,{name:"download"}),u?"Importing...":"Import from /models"]})]}),!G&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Add a connection to enable importing models."}),B.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-3",children:B.map(({id:c,alias:e,source:f})=>(0,d.jsx)(D,{modelId:c,fullModel:`${b}/${c}`,copied:h,onCopy:i,onDeleteAlias:()=>"custom"===f?l(c):j(e),onTest:m.length>0?()=>A(c):void 0,testStatus:y[c],isTesting:w===c},`${f}-${a}/${c}`))})]})}var F=c(65342);let G=[{format:"openai",label:"OpenAI-compatible",url:"https://opencode.ai/inference/go/openai/v1/chat/completions",note:"Chat Completions. GPT and Muse Spark models use /openai/v1/responses instead."},{format:"claude",label:"Anthropic-compatible",url:"https://opencode.ai/inference/go/anthropic/v1/messages",note:"Messages API. max_tokens is required on every request."}],H=[{id:"go",name:"Go",price:"$10/mo"},{id:"go-plus",name:"Go Plus",price:"$40/mo"}],I=["Go and Go Plus need a single-member workspace (the default Personal workspace). Workspaces with a Go subscription cannot invite members.","DeepSeek V4.1 Flash and V4 Pro need Global under Settings › Privacy › Regions (owner or admin).",'Muse Spark 1.2 and 1.3 Contributor need "Allow paid endpoints that train on request data" turned on (owner or admin).',"Free models (for example Beam Free) are not available in every region."],J=["Subscribe to a Go plan in the OpenCode Console.","Copy your OpenCode API key from the same account.","Add it as a connection below. The x-opencode-session header is set automatically."];function K({connectionCount:a,activeCount:b,onAddConnection:c}){let f=0===a?"No connections yet":`${b} of ${a} active`;return(0,d.jsx)(m.Zp,{children:(0,d.jsxs)(m.Wu,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"OpenCode Go Connection"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:f})]}),(0,d.jsxs)(n.$,{size:"sm",onClick:c,className:"w-full sm:w-auto",children:[(0,d.jsx)(e.default,{name:"add"}),"Add Connection"]})]}),(0,d.jsx)("div",{className:"mb-4 grid grid-cols-1 gap-2 sm:grid-cols-2",children:H.map(a=>(0,d.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-border px-3 py-2",children:[(0,d.jsx)("span",{className:"text-sm font-medium",children:a.name}),(0,d.jsx)("span",{className:"text-sm text-muted-foreground",children:a.price})]},a.id))}),(0,d.jsxs)("div",{className:"mb-4",children:[(0,d.jsx)("h3",{className:"mb-2 text-sm font-medium",children:"Endpoints"}),(0,d.jsx)("ul",{className:"flex flex-col gap-2",children:G.map(a=>(0,d.jsxs)("li",{className:"flex flex-col gap-0.5 rounded-lg border border-border px-3 py-2",children:[(0,d.jsx)("span",{className:"text-sm font-medium",children:a.label}),(0,d.jsx)("code",{className:"break-all text-xs text-muted-foreground",children:a.url}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:a.note})]},a.format))})]}),(0,d.jsx)("ol",{className:"mb-4 flex list-decimal flex-col gap-1.5 pl-5 text-sm text-muted-foreground",children:J.map(a=>(0,d.jsx)("li",{children:a},a))}),(0,d.jsx)("ul",{className:"mb-4 flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:I.map(a=>(0,d.jsxs)("li",{className:"flex gap-2",children:[(0,d.jsx)(e.default,{name:"info",className:"mt-0.5 text-[16px] shrink-0"}),(0,d.jsx)("span",{className:"min-w-0",children:a})]},a))}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-4",children:[(0,d.jsxs)("a",{href:"https://opencode.ai/go",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:["Subscribe to Go",(0,d.jsx)(e.default,{name:"open_in_new",className:"text-sm"})]}),(0,d.jsxs)("a",{href:"https://opencode.ai/v2/docs/console/go",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:["OpenCode Go docs",(0,d.jsx)(e.default,{name:"open_in_new",className:"text-sm"})]})]})]})})}var L=c(81501),M=c(83777);function N({label:a,required:b,error:c,hint:e,className:f,children:g}){return(0,d.jsxs)("div",{className:`flex min-w-0 flex-col gap-1.5 ${f||""}`,children:[a&&(0,d.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[a,b&&(0,d.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),g,c&&(0,d.jsx)("p",{className:"text-xs text-red-500",children:c}),e&&!c&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:e})]})}function O({isOpen:a,provider:b,providerName:c,authType:e,authHint:g,website:h,proxyPools:i,error:j,onSave:k,onClose:l}){let m="__none__",p="ollama-local"===b,q="cookie"===e,r="xai"===b&&!q,s=q?"Cookie Value":"qoder"===b?"Personal Access Token (PAT)":"API Key",t="azure"===b,u=o.Q2?.[b]?.regions||null,v=o.Q2?.[b]?.defaultRegion||u?.[0]?.id||"",[w,x]=(0,f.useState)({name:"",apiKey:"",priority:1,proxyPoolId:m,ollamaHostUrl:""}),[y,A]=(0,f.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[B,C]=(0,f.useState)(v),[D,E]=(0,f.useState)(!1),[F,G]=(0,f.useState)(null),[H,I]=(0,f.useState)(!1),J=()=>p&&w.ollamaHostUrl.trim()?{baseUrl:w.ollamaHostUrl.trim()}:t?{azureEndpoint:y.azureEndpoint,apiVersion:y.apiVersion,deployment:y.deployment,organization:y.organization}:u&&B?{region:B}:void 0,K=async()=>{E(!0);try{let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:w.apiKey,providerSpecificData:J()})}),c=await a.json();G(c.valid?"success":"failed")}catch{G("failed")}finally{E(!1)}},P=async()=>{if(b&&(p||w.apiKey)&&(p||w.name)){I(!0);try{let a=!1;try{E(!0),G(null);let c=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:w.apiKey,providerSpecificData:J()})});a=!!(await c.json()).valid,G(a?"success":"failed")}catch{G("failed")}finally{E(!1)}await k({name:w.name||(p?"Ollama Local":""),apiKey:w.apiKey,priority:w.priority,proxyPoolId:w.proxyPoolId===m?null:w.proxyPoolId,testStatus:a?"active":"unknown",providerSpecificData:J()})}finally{I(!1)}}};return b?(0,d.jsx)(z.lG,{open:a,onOpenChange:a=>!a&&l(),children:(0,d.jsxs)(z.Cf,{className:"max-w-md",children:[(0,d.jsx)(z.c7,{children:(0,d.jsx)(z.L3,{children:`Add ${c||b} ${s}`})}),(0,d.jsxs)("div",{className:"flex max-h-[calc(85vh-120px)] flex-col gap-4 overflow-y-auto p-4",children:[(0,d.jsx)(N,{label:"Name",children:(0,d.jsx)(L.p,{value:w.name,onChange:a=>x({...w,name:a.target.value}),placeholder:p?"Ollama Local":"Production Key"})}),p&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(N,{label:"Ollama Host URL",className:"flex-1",children:(0,d.jsx)(L.p,{value:w.ollamaHostUrl,onChange:a=>x({...w,ollamaHostUrl:a.target.value}),placeholder:"http://localhost:11434"})}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(n.$,{onClick:K,disabled:D||H,variant:"secondary",children:D?"Checking...":"Check"})})]}),!p&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(N,{label:s,className:"flex-1",children:(0,d.jsx)(L.p,{type:q?"text":"password",value:w.apiKey,onChange:a=>x({...w,apiKey:a.target.value}),placeholder:q?"grok-web"===b?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":r?"xai-...":"qoder"===b?"pt-...":""})}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(n.$,{onClick:K,disabled:!w.apiKey||D||H,variant:"secondary",children:D?"Checking...":"Check"})})]}),r&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),q&&g&&(0,d.jsxs)("p",{className:"text-xs text-muted-foreground",children:[g,h&&(0,d.jsxs)(d.Fragment,{children:[" ",(0,d.jsxs)("a",{href:h,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",h.replace(/^https?:\/\//,"")]})]})]}),u&&(0,d.jsx)(N,{label:"Region",children:(0,d.jsxs)(M.l6,{value:B,onValueChange:a=>C(a),children:[(0,d.jsx)(M.bq,{className:"w-full",children:(0,d.jsx)(M.yv,{placeholder:"Select a region"})}),(0,d.jsx)(M.gC,{children:u.map(a=>(0,d.jsx)(M.eb,{value:String(a.id),children:a.label},a.id))})]})}),j&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:j}),t&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(N,{label:"Azure Endpoint",children:(0,d.jsx)(L.p,{value:y.azureEndpoint,onChange:a=>A({...y,azureEndpoint:a.target.value}),placeholder:"https://your-resource.openai.azure.com"})}),(0,d.jsx)(N,{label:"Deployment Name",children:(0,d.jsx)(L.p,{value:y.deployment,onChange:a=>A({...y,deployment:a.target.value}),placeholder:"gpt-4"})}),(0,d.jsx)(N,{label:"API Version",children:(0,d.jsx)(L.p,{value:y.apiVersion,onChange:a=>A({...y,apiVersion:a.target.value}),placeholder:"2024-10-01-preview"})}),(0,d.jsx)(N,{label:"Organization",children:(0,d.jsx)(L.p,{value:y.organization,onChange:a=>A({...y,organization:a.target.value}),placeholder:"Organization ID"})})]})]}),(0,d.jsx)(N,{label:"Priority",children:(0,d.jsx)(L.p,{type:"number",value:w.priority,onChange:a=>x({...w,priority:Number.parseInt(a.target.value)||1})})}),(0,d.jsx)(N,{label:"Proxy Pool",children:(0,d.jsxs)(M.l6,{value:w.proxyPoolId,onValueChange:a=>x({...w,proxyPoolId:a}),children:[(0,d.jsx)(M.bq,{className:"w-full",children:(0,d.jsx)(M.yv,{placeholder:"None"})}),(0,d.jsxs)(M.gC,{children:[(0,d.jsx)(M.eb,{value:m,children:"None"}),(i||[]).map(a=>(0,d.jsx)(M.eb,{value:String(a.id),children:a.name},a.id))]})]})}),0===(i||[]).length&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,d.jsx)(n.$,{onClick:P,className:"w-full",disabled:H||!p&&(!w.name||!w.apiKey)||t&&(!y.azureEndpoint||!y.deployment||!y.organization),children:H?"Saving...":"Save"})]})]})}):null}function P({label:a,required:b,error:c,hint:e,className:f,children:g}){return(0,d.jsxs)("div",{className:`flex min-w-0 flex-col gap-1.5 ${f||""}`,children:[a&&(0,d.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[a,b&&(0,d.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),g,c&&(0,d.jsx)("p",{className:"text-xs text-red-500",children:c}),e&&!c&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:e})]})}function Q({isOpen:a,node:b,onSave:c,onClose:e,isAnthropic:g}){let[h,i]=(0,f.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[j,k]=(0,f.useState)(!1),l=async()=>{if(h.name.trim()&&h.prefix.trim()&&h.baseUrl.trim()){k(!0);try{let a={name:h.name,prefix:h.prefix,baseUrl:h.baseUrl};g||(a.apiType=h.apiType),await c(a)}finally{k(!1)}}};return b?(0,d.jsx)(z.lG,{open:a,onOpenChange:a=>!a&&e(),children:(0,d.jsxs)(z.Cf,{className:"max-w-md",children:[(0,d.jsx)(z.c7,{children:(0,d.jsx)(z.L3,{children:`Edit ${g?"Anthropic":"OpenAI"} Compatible`})}),(0,d.jsxs)("div",{className:"flex max-h-[calc(85vh-120px)] flex-col gap-4 overflow-y-auto p-4",children:[(0,d.jsx)(P,{label:"Name",hint:"Required. A friendly label for this node.",children:(0,d.jsx)(L.p,{value:h.name,onChange:a=>i({...h,name:a.target.value}),placeholder:`${g?"Anthropic":"OpenAI"} Compatible (Prod)`})}),(0,d.jsx)(P,{label:"Prefix",hint:"Required. Used as the provider prefix for model IDs.",children:(0,d.jsx)(L.p,{value:h.prefix,onChange:a=>i({...h,prefix:a.target.value}),placeholder:g?"ac-prod":"oc-prod"})}),!g&&(0,d.jsx)(P,{label:"API Type",children:(0,d.jsxs)(M.l6,{value:h.apiType,onValueChange:a=>i({...h,apiType:a}),children:[(0,d.jsx)(M.bq,{className:"w-full",children:(0,d.jsx)(M.yv,{})}),(0,d.jsx)(M.gC,{children:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}].map(a=>(0,d.jsx)(M.eb,{value:String(a.value),children:a.label},a.value))})]})}),(0,d.jsx)(P,{label:"Base URL",hint:`Use the base URL (ending in /v1) for your ${g?"Anthropic":"OpenAI"}-compatible API.`,children:(0,d.jsx)(L.p,{value:h.baseUrl,onChange:a=>i({...h,baseUrl:a.target.value}),placeholder:g?"https://api.anthropic.com/v1":"https://api.openai.com/v1"})}),(0,d.jsx)(n.$,{onClick:l,className:"w-full",disabled:!h.name.trim()||!h.prefix.trim()||!h.baseUrl.trim()||j,children:j?"Saving...":"Save"})]})]})}):null}var R=c(36447);let S=()=>Object.fromEntries(Object.keys(p.bs).map(a=>[a,!1]));function T({isOpen:a,providerAlias:b,providerDisplayAlias:c,onSave:g,onClose:h}){let[i,j]=(0,f.useState)(""),[k,l]=(0,f.useState)(S),[m,o]=(0,f.useState)(null),[q,r]=(0,f.useState)(""),[s,t]=(0,f.useState)(!1),u=a=>{let c=`${b}/`;return a.startsWith(c)?a.slice(c.length):a},v=async()=>{let a=u(i.trim());if(a){o("testing"),r("");try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${b}/${a}`})}),d=await c.json();o(d.ok?"ok":"error"),r(d.error||"")}catch(a){o("error"),r(a.message)}}},w=async()=>{let a=u(i.trim());if(a&&!s){t(!0);try{await g(a,k)}finally{t(!1)}}};return(0,d.jsx)(z.lG,{open:a,onOpenChange:a=>!a&&h(),children:(0,d.jsxs)(z.Cf,{className:"max-w-md",children:[(0,d.jsx)(z.c7,{children:(0,d.jsx)(z.L3,{children:"Add Custom Model"})}),(0,d.jsxs)("div",{className:"flex max-h-[calc(85vh-120px)] flex-col gap-4 overflow-y-auto p-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("input",{type:"text",value:i,onChange:a=>{j(a.target.value),o(null),r("")},onKeyDown:a=>{"Enter"===a.key&&v()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 min-w-0 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,d.jsxs)(n.$,{variant:"secondary",disabled:!i.trim()||"testing"===m,onClick:v,children:["testing"===m&&(0,d.jsx)(R.A,{className:"size-4 animate-spin"}),"testing"!==m&&(0,d.jsx)(e.default,{name:"science"}),"testing"===m?"Testing...":"Test"]})]}),(0,d.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:["Sent to provider as:"," ",(0,d.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:u(i.trim())||"model-id"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Capabilities"}),(0,d.jsx)("div",{className:"flex flex-wrap gap-4",children:Object.entries(p.bs).map(([a,b])=>(0,d.jsxs)("label",{className:"flex cursor-pointer items-center gap-2.5",onClick:b=>{b.preventDefault(),l(b=>({...b,[a]:!b[a]}))},children:[(0,d.jsx)(x.d,{checked:!!k[a],onCheckedChange:b=>l(c=>({...c,[a]:b})),size:"sm","aria-label":b.label}),(0,d.jsxs)("span",{children:[(0,d.jsx)("span",{className:"block text-sm font-medium",children:b.label}),(0,d.jsx)("span",{className:"block text-xs text-muted-foreground",children:b.desc})]})]},a))})]}),"ok"===m&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,d.jsx)(e.default,{name:"check_circle",className:"text-base"}),"Model is reachable"]}),"error"===m&&(0,d.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,d.jsx)(e.default,{name:"cancel",className:"text-base shrink-0"}),(0,d.jsx)("span",{children:q||"Model not reachable"})]}),(0,d.jsx)(n.$,{onClick:w,className:"w-full",size:"sm",disabled:!i.trim()||s,children:s?"Adding...":"Add Model"})]})]})})}let U=`[
1
+ (()=>{var a={};a.id=2134,a.ids=[2134],a.modules={643:a=>{"use strict";a.exports=require("node:perf_hooks")},1708:a=>{"use strict";a.exports=require("node:process")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{"use strict";a.exports=require("node:buffer")},7066:a=>{"use strict";a.exports=require("node:tty")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14985:a=>{"use strict";a.exports=require("dns")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},28740:(a,b,c)=>{Promise.resolve().then(c.bind(c,94221))},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{"use strict";a.exports=require("node:child_process")},32467:a=>{"use strict";a.exports=require("node:http2")},33873:a=>{"use strict";a.exports=require("path")},34589:a=>{"use strict";a.exports=require("node:assert")},37067:a=>{"use strict";a.exports=require("node:http")},37540:a=>{"use strict";a.exports=require("node:console")},38522:a=>{"use strict";a.exports=require("node:zlib")},40610:a=>{"use strict";a.exports=require("node:dns")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},41692:a=>{"use strict";a.exports=require("node:tls")},41792:a=>{"use strict";a.exports=require("node:querystring")},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},46293:a=>{"use strict";a.exports=require("sql.js")},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},53053:a=>{"use strict";a.exports=require("node:diagnostics_channel")},53207:(a,b,c)=>{Promise.resolve().then(c.bind(c,83772))},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},57075:a=>{"use strict";a.exports=require("node:stream")},57975:a=>{"use strict";a.exports=require("node:util")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},67197:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>x,handler:()=>z,routeModule:()=>y});var d=c(26720),e=c(29966),f=c(36243),g=c(70310),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,79452))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,2808,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,8329,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,41580,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,11089))),o=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),p=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,2808,23))),q=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,8329,23))),r=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,41580,23))),s=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),t=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),u=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),v={children:["",{children:["(dashboard)",{children:["dashboard",{children:["providers",{children:["[id]",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,83772))),"/home/runner/work/10Router/10Router/src/app/(dashboard)/dashboard/providers/[id]/page.tsx"]}]},{"global-error":[u,"next/dist/client/components/builtin/global-error.js"]},["new"]]},{"global-error":[t,"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[s,"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[n,"/home/runner/work/10Router/10Router/src/app/(dashboard)/layout.tsx"],"global-error":[o,"next/dist/client/components/builtin/global-error.js"],"not-found":[p,"next/dist/client/components/builtin/not-found.js"],forbidden:[q,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[r,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[i,"/home/runner/work/10Router/10Router/src/app/layout.tsx"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,w=(0,e.H)({tree:v,page:"/(dashboard)/dashboard/providers/[id]/page",pathname:"/dashboard/providers/[id]",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),x=w.__next_app__,y=w.routeModule,z=w.handler},71553:a=>{"use strict";a.exports=require("node:dns/promises")},71622:a=>{"use strict";a.exports=import("open")},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73429:a=>{"use strict";a.exports=require("node:util/types")},73496:a=>{"use strict";a.exports=require("http2")},74075:a=>{"use strict";a.exports=require("zlib")},75919:a=>{"use strict";a.exports=require("node:worker_threads")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},77598:a=>{"use strict";a.exports=require("node:crypto")},78474:a=>{"use strict";a.exports=require("node:events")},79551:a=>{"use strict";a.exports=require("url")},79646:a=>{"use strict";a.exports=require("child_process")},79868:a=>{"use strict";a.exports=require("node:sqlite")},81630:a=>{"use strict";a.exports=require("http")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},83772:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(35062).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/10Router/10Router/src/app/(dashboard)/dashboard/providers/[id]/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/10Router/10Router/src/app/(dashboard)/dashboard/providers/[id]/page.tsx","default")},87997:a=>{"use strict";a.exports=require("node:timers")},91645:a=>{"use strict";a.exports=require("net")},94221:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>$});var d=c(86240),e=c(28907),f=c(70433),g=c(70126),h=c(4459),i=c.n(h),j=c(62871),k=c(82975),l=c(20482),m=c(4271),n=c(63265),o=c(86177),p=c(95137),q=c(57145),r=c(38889),s=c(27720);function t({customModels:a=[],modelAliases:b={},providerAlias:c,builtInModels:d=[],type:e="llm",includeLegacyAliases:f=!0}){let g=new Set(d.map(a=>a.id)),h=new Set,i=[];for(let b of a){if(!b?.id||b.providerAlias!==c)continue;let a=b?.kind||b?.type||"llm";if(e&&a!==e||g.has(b.id))continue;let d=`${c}/${b.id}`;h.has(d)||(h.add(d),i.push({id:b.id,name:b.name||b.id,fullModel:d,source:"custom",type:a}))}if(!f)return i;let j=`${c}/`;for(let[a,c]of Object.entries(b||{})){if("string"!=typeof c||!c.startsWith(j))continue;let b=c.slice(j.length);!b||g.has(b)||h.has(c)||(h.add(c),i.push({id:b,alias:a,fullModel:c,source:"legacyAlias",type:e||"llm"}))}return i}var u=c(29184),v=c(31952);function w({model:a,fullModel:b,alias:c,copied:f,onCopy:g,testStatus:h,isCustom:i,isFree:j,onDeleteAlias:k,onTest:m,isTesting:n,onDisable:o,caps:p}){let q="ok"===h?"#22c55e":"error"===h?"#ef4444":void 0;return(0,d.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===h?"border-green-500/40":"error"===h?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,d.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,d.jsx)(e.default,{name:"ok"===h?"check_circle":"error"===h?"cancel":"smart_toy",className:"shrink-0 text-base",style:q?{color:q}:void 0}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,d.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-muted-foreground sm:max-w-[360px]",children:b}),(0,d.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[a.name&&(0,d.jsx)("span",{className:"truncate text-[9px] italic text-muted-foreground/70",children:a.name}),(0,d.jsx)(l.nh,{caps:p,colorOverride:"text-muted-foreground/70",size:12})]})]}),j&&(0,d.jsxs)(v.m_,{children:[(0,d.jsx)(v.k$,{asChild:!0,children:(0,d.jsx)(u.E,{className:"shrink-0 bg-green-500/10 font-bold text-green-600 dark:text-green-500",children:"FREE"})}),(0,d.jsx)(v.ZI,{children:"Free model: works through the free OpenCode lane. An OpenCode Zen/Go API key cannot unlock it."})]}),m&&(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:m,disabled:n,className:`rounded p-0.5 text-muted-foreground transition-opacity hover:bg-sidebar hover:text-primary ${n?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,d.jsx)(e.default,{name:n?"progress_activity":"science",className:"text-sm",style:n?{animation:"spin 1s linear infinite"}:void 0})}),(0,d.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-muted-foreground whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:n?"Testing...":"Test"})]}),(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:()=>g(b,`model-${a.id}`),className:"rounded p-0.5 text-muted-foreground hover:bg-sidebar hover:text-primary",children:(0,d.jsx)(e.default,{name:f===`model-${a.id}`?"check":"content_copy",className:"text-sm"})}),(0,d.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-muted-foreground whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:f===`model-${a.id}`?"Copied!":"Copy"})]}),i?(0,d.jsxs)(v.m_,{children:[(0,d.jsx)(v.k$,{asChild:!0,children:(0,d.jsx)("button",{onClick:k,className:"ml-auto rounded p-0.5 text-muted-foreground opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",children:(0,d.jsx)(e.default,{name:"close",className:"text-sm"})})}),(0,d.jsx)(v.ZI,{children:"Remove custom model"})]}):o?(0,d.jsxs)(v.m_,{children:[(0,d.jsx)(v.k$,{asChild:!0,children:(0,d.jsx)("button",{onClick:o,className:"ml-auto rounded p-0.5 text-muted-foreground opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",children:(0,d.jsx)(e.default,{name:"close",className:"text-sm"})})}),(0,d.jsx)(v.ZI,{children:"Disable this model"})]}):null]})})}var x=c(70369),y=c(63998),z=c(67209),A=c(7485),B=c(83226),C=c(43938);function D({modelId:a,fullModel:b,copied:c,onCopy:f,onDeleteAlias:g,onTest:h,testStatus:i,isTesting:j}){let k="ok"===i?"#22c55e":"error"===i?"#ef4444":void 0;return(0,d.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===i?"border-green-500/40":"error"===i?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,d.jsx)(e.default,{name:"ok"===i?"check_circle":"error"===i?"cancel":"smart_toy",className:"text-base text-muted-foreground",style:k?{color:k}:void 0}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:a}),(0,d.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,d.jsx)("code",{className:"text-xs text-muted-foreground font-mono bg-sidebar px-1.5 py-0.5 rounded",children:b}),(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:()=>f(b,`model-${a}`),className:"p-0.5 hover:bg-sidebar rounded text-muted-foreground hover:text-primary",children:(0,d.jsx)(e.default,{name:c===`model-${a}`?"check":"content_copy",className:"text-sm"})}),(0,d.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-muted-foreground whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:c===`model-${a}`?"Copied!":"Copy"})]}),h&&(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:h,disabled:j,className:"p-0.5 hover:bg-sidebar rounded text-muted-foreground hover:text-primary transition-colors",children:(0,d.jsx)(e.default,{name:j?"progress_activity":"science",className:"text-sm",style:j?{animation:"spin 1s linear infinite"}:void 0})}),(0,d.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-muted-foreground whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:j?"Testing...":"Test"})]})]})]}),(0,d.jsxs)(v.m_,{children:[(0,d.jsx)(v.k$,{asChild:!0,children:(0,d.jsx)("button",{onClick:g,className:"p-1 hover:bg-red-50 rounded text-red-500",children:(0,d.jsx)(e.default,{name:"delete",className:"text-sm"})})}),(0,d.jsx)(v.ZI,{children:"Remove model"})]})]})}function E({providerStorageAlias:a,providerDisplayAlias:b,modelAliases:c,customModels:g,copied:h,onCopy:i,onDeleteAlias:j,onAddCustomModel:k,onDeleteCustomModel:l,connections:m,isAnthropic:o}){let[p,q]=(0,f.useState)(""),[r,s]=(0,f.useState)(!1),[u,v]=(0,f.useState)(!1),[w,x]=(0,f.useState)(null),[y,z]=(0,f.useState)({}),A=async b=>{if(!w){x(b);try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${a}/${b}`})}),d=await c.json();z(a=>({...a,[b]:d.ok?"ok":"error"}))}catch{z(a=>({...a,[b]:"error"}))}finally{x(null)}}},B=t({customModels:g,modelAliases:c,providerAlias:a,type:"llm"}),C=async()=>{if(!p.trim()||r)return;let a=p.trim();if(B.some(b=>b.id===a))return void alert("Model already exists for this provider.");s(!0);try{await k(a),q("")}catch(a){console.log("Error adding model:",a)}finally{s(!1)}},F=async()=>{if(u)return;let a=m.find(a=>!1!==a.isActive);if(a){v(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||"Failed to import models");let d=c.models||[];if(0===d.length)return void alert("No models returned from /models.");let e=0;for(let a of d){let b=a.id||a.name||a.model;b&&(B.some(a=>a.id===b)||(await k(b),e+=1))}0===e&&alert("No new models were added.")}catch(a){console.log("Error importing models:",a)}finally{v(!1)}}},G=m.some(a=>!1!==a.isActive);return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Add ",o?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,d.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,d.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-muted-foreground mb-1 block",children:"Model ID"}),(0,d.jsx)("input",{id:"new-compatible-model-input",type:"text",value:p,onChange:a=>q(a.target.value),onKeyDown:a=>"Enter"===a.key&&C(),placeholder:o?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,d.jsxs)(n.$,{size:"sm",onClick:C,disabled:!p.trim()||r,children:[(0,d.jsx)(e.default,{name:"add"}),r?"Adding...":"Add"]}),(0,d.jsxs)(n.$,{size:"sm",variant:"secondary",onClick:F,disabled:!G||u,children:[(0,d.jsx)(e.default,{name:"download"}),u?"Importing...":"Import from /models"]})]}),!G&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Add a connection to enable importing models."}),B.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-3",children:B.map(({id:c,alias:e,source:f})=>(0,d.jsx)(D,{modelId:c,fullModel:`${b}/${c}`,copied:h,onCopy:i,onDeleteAlias:()=>"custom"===f?l(c):j(e),onTest:m.length>0?()=>A(c):void 0,testStatus:y[c],isTesting:w===c},`${f}-${a}/${c}`))})]})}var F=c(65342);let G=[{format:"openai",label:"OpenAI-compatible",url:"https://opencode.ai/inference/go/openai/v1/chat/completions",note:"Chat Completions. GPT and Muse Spark models use /openai/v1/responses instead."},{format:"claude",label:"Anthropic-compatible",url:"https://opencode.ai/inference/go/anthropic/v1/messages",note:"Messages API. max_tokens is required on every request."}],H=[{id:"go",name:"Go",price:"$10/mo"},{id:"go-plus",name:"Go Plus",price:"$40/mo"}],I=["Go and Go Plus need a single-member workspace (the default Personal workspace). Workspaces with a Go subscription cannot invite members.","DeepSeek V4.1 Flash and V4 Pro need Global under Settings › Privacy › Regions (owner or admin).",'Muse Spark 1.2 and 1.3 Contributor need "Allow paid endpoints that train on request data" turned on (owner or admin).',"Free models (for example Beam Free) are not available in every region."],J=["Subscribe to a Go plan in the OpenCode Console.","Copy your OpenCode API key from the same account.","Add it as a connection below. The x-opencode-session header is set automatically."];function K({connectionCount:a,activeCount:b,onAddConnection:c}){let f=0===a?"No connections yet":`${b} of ${a} active`;return(0,d.jsx)(m.Zp,{children:(0,d.jsxs)(m.Wu,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"OpenCode Go Connection"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:f})]}),(0,d.jsxs)(n.$,{size:"sm",onClick:c,className:"w-full sm:w-auto",children:[(0,d.jsx)(e.default,{name:"add"}),"Add Connection"]})]}),(0,d.jsx)("div",{className:"mb-4 grid grid-cols-1 gap-2 sm:grid-cols-2",children:H.map(a=>(0,d.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-border px-3 py-2",children:[(0,d.jsx)("span",{className:"text-sm font-medium",children:a.name}),(0,d.jsx)("span",{className:"text-sm text-muted-foreground",children:a.price})]},a.id))}),(0,d.jsxs)("div",{className:"mb-4",children:[(0,d.jsx)("h3",{className:"mb-2 text-sm font-medium",children:"Endpoints"}),(0,d.jsx)("ul",{className:"flex flex-col gap-2",children:G.map(a=>(0,d.jsxs)("li",{className:"flex flex-col gap-0.5 rounded-lg border border-border px-3 py-2",children:[(0,d.jsx)("span",{className:"text-sm font-medium",children:a.label}),(0,d.jsx)("code",{className:"break-all text-xs text-muted-foreground",children:a.url}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:a.note})]},a.format))})]}),(0,d.jsx)("ol",{className:"mb-4 flex list-decimal flex-col gap-1.5 pl-5 text-sm text-muted-foreground",children:J.map(a=>(0,d.jsx)("li",{children:a},a))}),(0,d.jsx)("ul",{className:"mb-4 flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:I.map(a=>(0,d.jsxs)("li",{className:"flex gap-2",children:[(0,d.jsx)(e.default,{name:"info",className:"mt-0.5 text-[16px] shrink-0"}),(0,d.jsx)("span",{className:"min-w-0",children:a})]},a))}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-4",children:[(0,d.jsxs)("a",{href:"https://opencode.ai/go",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:["Subscribe to Go",(0,d.jsx)(e.default,{name:"open_in_new",className:"text-sm"})]}),(0,d.jsxs)("a",{href:"https://opencode.ai/v2/docs/console/go",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:["OpenCode Go docs",(0,d.jsx)(e.default,{name:"open_in_new",className:"text-sm"})]})]})]})})}var L=c(81501),M=c(83777);function N({label:a,required:b,error:c,hint:e,className:f,children:g}){return(0,d.jsxs)("div",{className:`flex min-w-0 flex-col gap-1.5 ${f||""}`,children:[a&&(0,d.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[a,b&&(0,d.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),g,c&&(0,d.jsx)("p",{className:"text-xs text-red-500",children:c}),e&&!c&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:e})]})}function O({isOpen:a,provider:b,providerName:c,authType:e,authHint:g,website:h,proxyPools:i,error:j,onSave:k,onClose:l}){let m="__none__",p="ollama-local"===b,q="cookie"===e,r="xai"===b&&!q,s=q?"Cookie Value":"qoder"===b?"Personal Access Token (PAT)":"API Key",t="azure"===b,u=o.Q2?.[b]?.regions||null,v=o.Q2?.[b]?.defaultRegion||u?.[0]?.id||"",[w,x]=(0,f.useState)({name:"",apiKey:"",priority:1,proxyPoolId:m,ollamaHostUrl:""}),[y,A]=(0,f.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[B,C]=(0,f.useState)(v),[D,E]=(0,f.useState)(!1),[F,G]=(0,f.useState)(null),[H,I]=(0,f.useState)(!1),J=()=>p&&w.ollamaHostUrl.trim()?{baseUrl:w.ollamaHostUrl.trim()}:t?{azureEndpoint:y.azureEndpoint,apiVersion:y.apiVersion,deployment:y.deployment,organization:y.organization}:u&&B?{region:B}:void 0,K=async()=>{E(!0);try{let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:w.apiKey,providerSpecificData:J()})}),c=await a.json();G(c.valid?"success":"failed")}catch{G("failed")}finally{E(!1)}},P=async()=>{if(b&&(p||w.apiKey)&&(p||w.name)){I(!0);try{let a=!1;try{E(!0),G(null);let c=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:w.apiKey,providerSpecificData:J()})});a=!!(await c.json()).valid,G(a?"success":"failed")}catch{G("failed")}finally{E(!1)}await k({name:w.name||(p?"Ollama Local":""),apiKey:w.apiKey,priority:w.priority,proxyPoolId:w.proxyPoolId===m?null:w.proxyPoolId,testStatus:a?"active":"unknown",providerSpecificData:J()})}finally{I(!1)}}};return b?(0,d.jsx)(z.lG,{open:a,onOpenChange:a=>!a&&l(),children:(0,d.jsxs)(z.Cf,{className:"max-w-md",children:[(0,d.jsx)(z.c7,{children:(0,d.jsx)(z.L3,{children:`Add ${c||b} ${s}`})}),(0,d.jsxs)("div",{className:"flex max-h-[calc(85vh-120px)] flex-col gap-4 overflow-y-auto p-4",children:[(0,d.jsx)(N,{label:"Name",children:(0,d.jsx)(L.p,{value:w.name,onChange:a=>x({...w,name:a.target.value}),placeholder:p?"Ollama Local":"Production Key"})}),p&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(N,{label:"Ollama Host URL",className:"flex-1",children:(0,d.jsx)(L.p,{value:w.ollamaHostUrl,onChange:a=>x({...w,ollamaHostUrl:a.target.value}),placeholder:"http://localhost:11434"})}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(n.$,{onClick:K,disabled:D||H,variant:"secondary",children:D?"Checking...":"Check"})})]}),!p&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(N,{label:s,className:"flex-1",children:(0,d.jsx)(L.p,{type:q?"text":"password",value:w.apiKey,onChange:a=>x({...w,apiKey:a.target.value}),placeholder:q?"grok-web"===b?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":r?"xai-...":"qoder"===b?"pt-...":""})}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(n.$,{onClick:K,disabled:!w.apiKey||D||H,variant:"secondary",children:D?"Checking...":"Check"})})]}),r&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),q&&g&&(0,d.jsxs)("p",{className:"text-xs text-muted-foreground",children:[g,h&&(0,d.jsxs)(d.Fragment,{children:[" ",(0,d.jsxs)("a",{href:h,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",h.replace(/^https?:\/\//,"")]})]})]}),u&&(0,d.jsx)(N,{label:"Region",children:(0,d.jsxs)(M.l6,{value:B,onValueChange:a=>C(a),children:[(0,d.jsx)(M.bq,{className:"w-full",children:(0,d.jsx)(M.yv,{placeholder:"Select a region"})}),(0,d.jsx)(M.gC,{children:u.map(a=>(0,d.jsx)(M.eb,{value:String(a.id),children:a.label},a.id))})]})}),j&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:j}),t&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(N,{label:"Azure Endpoint",children:(0,d.jsx)(L.p,{value:y.azureEndpoint,onChange:a=>A({...y,azureEndpoint:a.target.value}),placeholder:"https://your-resource.openai.azure.com"})}),(0,d.jsx)(N,{label:"Deployment Name",children:(0,d.jsx)(L.p,{value:y.deployment,onChange:a=>A({...y,deployment:a.target.value}),placeholder:"gpt-4"})}),(0,d.jsx)(N,{label:"API Version",children:(0,d.jsx)(L.p,{value:y.apiVersion,onChange:a=>A({...y,apiVersion:a.target.value}),placeholder:"2024-10-01-preview"})}),(0,d.jsx)(N,{label:"Organization",children:(0,d.jsx)(L.p,{value:y.organization,onChange:a=>A({...y,organization:a.target.value}),placeholder:"Organization ID"})})]})]}),(0,d.jsx)(N,{label:"Priority",children:(0,d.jsx)(L.p,{type:"number",value:w.priority,onChange:a=>x({...w,priority:Number.parseInt(a.target.value)||1})})}),(0,d.jsx)(N,{label:"Proxy Pool",children:(0,d.jsxs)(M.l6,{value:w.proxyPoolId,onValueChange:a=>x({...w,proxyPoolId:a}),children:[(0,d.jsx)(M.bq,{className:"w-full",children:(0,d.jsx)(M.yv,{placeholder:"None"})}),(0,d.jsxs)(M.gC,{children:[(0,d.jsx)(M.eb,{value:m,children:"None"}),(i||[]).map(a=>(0,d.jsx)(M.eb,{value:String(a.id),children:a.name},a.id))]})]})}),0===(i||[]).length&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,d.jsx)(n.$,{onClick:P,className:"w-full",disabled:H||!p&&(!w.name||!w.apiKey)||t&&(!y.azureEndpoint||!y.deployment||!y.organization),children:H?"Saving...":"Save"})]})]})}):null}function P({label:a,required:b,error:c,hint:e,className:f,children:g}){return(0,d.jsxs)("div",{className:`flex min-w-0 flex-col gap-1.5 ${f||""}`,children:[a&&(0,d.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[a,b&&(0,d.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),g,c&&(0,d.jsx)("p",{className:"text-xs text-red-500",children:c}),e&&!c&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:e})]})}function Q({isOpen:a,node:b,onSave:c,onClose:e,isAnthropic:g}){let[h,i]=(0,f.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[j,k]=(0,f.useState)(!1),l=async()=>{if(h.name.trim()&&h.prefix.trim()&&h.baseUrl.trim()){k(!0);try{let a={name:h.name,prefix:h.prefix,baseUrl:h.baseUrl};g||(a.apiType=h.apiType),await c(a)}finally{k(!1)}}};return b?(0,d.jsx)(z.lG,{open:a,onOpenChange:a=>!a&&e(),children:(0,d.jsxs)(z.Cf,{className:"max-w-md",children:[(0,d.jsx)(z.c7,{children:(0,d.jsx)(z.L3,{children:`Edit ${g?"Anthropic":"OpenAI"} Compatible`})}),(0,d.jsxs)("div",{className:"flex max-h-[calc(85vh-120px)] flex-col gap-4 overflow-y-auto p-4",children:[(0,d.jsx)(P,{label:"Name",hint:"Required. A friendly label for this node.",children:(0,d.jsx)(L.p,{value:h.name,onChange:a=>i({...h,name:a.target.value}),placeholder:`${g?"Anthropic":"OpenAI"} Compatible (Prod)`})}),(0,d.jsx)(P,{label:"Prefix",hint:"Required. Used as the provider prefix for model IDs.",children:(0,d.jsx)(L.p,{value:h.prefix,onChange:a=>i({...h,prefix:a.target.value}),placeholder:g?"ac-prod":"oc-prod"})}),!g&&(0,d.jsx)(P,{label:"API Type",children:(0,d.jsxs)(M.l6,{value:h.apiType,onValueChange:a=>i({...h,apiType:a}),children:[(0,d.jsx)(M.bq,{className:"w-full",children:(0,d.jsx)(M.yv,{})}),(0,d.jsx)(M.gC,{children:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}].map(a=>(0,d.jsx)(M.eb,{value:String(a.value),children:a.label},a.value))})]})}),(0,d.jsx)(P,{label:"Base URL",hint:`Use the base URL (ending in /v1) for your ${g?"Anthropic":"OpenAI"}-compatible API.`,children:(0,d.jsx)(L.p,{value:h.baseUrl,onChange:a=>i({...h,baseUrl:a.target.value}),placeholder:g?"https://api.anthropic.com/v1":"https://api.openai.com/v1"})}),(0,d.jsx)(n.$,{onClick:l,className:"w-full",disabled:!h.name.trim()||!h.prefix.trim()||!h.baseUrl.trim()||j,children:j?"Saving...":"Save"})]})]})}):null}var R=c(36447);let S=()=>Object.fromEntries(Object.keys(p.bs).map(a=>[a,!1]));function T({isOpen:a,providerAlias:b,providerDisplayAlias:c,onSave:g,onClose:h}){let[i,j]=(0,f.useState)(""),[k,l]=(0,f.useState)(S),[m,o]=(0,f.useState)(null),[q,r]=(0,f.useState)(""),[s,t]=(0,f.useState)(!1),u=a=>{let c=`${b}/`;return a.startsWith(c)?a.slice(c.length):a},v=async()=>{let a=u(i.trim());if(a){o("testing"),r("");try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${b}/${a}`})}),d=await c.json();o(d.ok?"ok":"error"),r(d.error||"")}catch(a){o("error"),r(a.message)}}},w=async()=>{let a=u(i.trim());if(a&&!s){t(!0);try{await g(a,k)}finally{t(!1)}}};return(0,d.jsx)(z.lG,{open:a,onOpenChange:a=>!a&&h(),children:(0,d.jsxs)(z.Cf,{className:"max-w-md",children:[(0,d.jsx)(z.c7,{children:(0,d.jsx)(z.L3,{children:"Add Custom Model"})}),(0,d.jsxs)("div",{className:"flex max-h-[calc(85vh-120px)] flex-col gap-4 overflow-y-auto p-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("input",{type:"text",value:i,onChange:a=>{j(a.target.value),o(null),r("")},onKeyDown:a=>{"Enter"===a.key&&v()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 min-w-0 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,d.jsxs)(n.$,{variant:"secondary",disabled:!i.trim()||"testing"===m,onClick:v,children:["testing"===m&&(0,d.jsx)(R.A,{className:"size-4 animate-spin"}),"testing"!==m&&(0,d.jsx)(e.default,{name:"science"}),"testing"===m?"Testing...":"Test"]})]}),(0,d.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:["Sent to provider as:"," ",(0,d.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:u(i.trim())||"model-id"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Capabilities"}),(0,d.jsx)("div",{className:"flex flex-wrap gap-4",children:Object.entries(p.bs).map(([a,b])=>(0,d.jsxs)("label",{className:"flex cursor-pointer items-center gap-2.5",onClick:b=>{b.preventDefault(),l(b=>({...b,[a]:!b[a]}))},children:[(0,d.jsx)(x.d,{checked:!!k[a],onCheckedChange:b=>l(c=>({...c,[a]:b})),size:"sm","aria-label":b.label}),(0,d.jsxs)("span",{children:[(0,d.jsx)("span",{className:"block text-sm font-medium",children:b.label}),(0,d.jsx)("span",{className:"block text-xs text-muted-foreground",children:b.desc})]})]},a))})]}),"ok"===m&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,d.jsx)(e.default,{name:"check_circle",className:"text-base"}),"Model is reachable"]}),"error"===m&&(0,d.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,d.jsx)(e.default,{name:"cancel",className:"text-base shrink-0"}),(0,d.jsx)("span",{children:q||"Model not reachable"})]}),(0,d.jsx)(n.$,{onClick:w,className:"w-full",size:"sm",disabled:!i.trim()||s,children:s?"Adding...":"Add Model"})]})]})})}let U=`[
2
2
  {
3
3
  "accessToken": "eyJhbGc...",
4
4
  "refreshToken": "rt_...",