bazilion 0.27.0 → 0.51.0

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 (234) hide show
  1. package/dist/cli.js +651 -309
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +2105 -997
  4. package/dist/daemon.js.map +1 -1
  5. package/dist/web/client/assets/AddProviderDialog-Diic36c_.js +1 -0
  6. package/dist/web/client/assets/ConfigPage-pupvtSCX.js +1 -0
  7. package/dist/web/client/assets/ConfirmDialog-GFDcHI1L.js +1 -0
  8. package/dist/web/client/assets/ConnectionsView-y1CeY-6U.js +1 -0
  9. package/dist/web/client/assets/Dialog-bg86_x4v.js +1 -0
  10. package/dist/web/client/assets/FieldRow-B8eIni5r.js +1 -0
  11. package/dist/web/client/assets/ModelSelect-DvCLUmkW.js +1 -0
  12. package/dist/web/client/assets/SectionTabs-D4ezA6U4.js +1 -0
  13. package/dist/web/client/assets/Segmented-Dh77vmpp.js +1 -0
  14. package/dist/web/client/assets/SkillFindings-BzLO1lNA.js +1 -0
  15. package/dist/web/client/assets/SkillsPicker-hI3YXvib.js +1 -0
  16. package/dist/web/client/assets/SpawnDialog-YJX6UMBC.js +1 -0
  17. package/dist/web/client/assets/Tabs-f6bHvCGn.js +1 -0
  18. package/dist/web/client/assets/TeamForm-kda1HYZG.js +1 -0
  19. package/dist/web/client/assets/TeamThread-DFvbakHo.js +1 -0
  20. package/dist/web/client/assets/UnsavedChangesGuard-DBJikVgc.js +1 -0
  21. package/dist/web/client/assets/_id-BjNtLwak.js +1 -0
  22. package/dist/web/client/assets/_id-BklaQf3z.js +1 -0
  23. package/dist/web/client/assets/agents-D9cUF2d9.js +1 -0
  24. package/dist/web/client/assets/agents-wuBlzx4e.js +1 -0
  25. package/dist/web/client/assets/api-HC_YzjBy.js +1 -0
  26. package/dist/web/client/assets/arrow-right-Gm_FDWJ_.js +1 -0
  27. package/dist/web/client/assets/attention-8ZkSLl2e.js +1 -0
  28. package/dist/web/client/assets/check-BjgKoGvU.js +1 -0
  29. package/dist/web/client/assets/config-Con_BbSh.js +1 -0
  30. package/dist/web/client/assets/createLucideIcon-C6gOo8sD.js +1 -0
  31. package/dist/web/client/assets/index-Br9qkGM-.js +54 -0
  32. package/dist/web/client/assets/link-Cbztlp_R.js +1 -0
  33. package/dist/web/client/assets/login-llnOKSJc.js +1 -0
  34. package/dist/web/client/assets/mcp-zIUguMSI.js +1 -0
  35. package/dist/web/client/assets/plus-CWrKMtvA.js +1 -0
  36. package/dist/web/client/assets/routes-BY5uqJ2n.js +76 -0
  37. package/dist/web/client/assets/save-f9O-CQia.js +1 -0
  38. package/dist/web/client/assets/services-esLrcTwe.js +1 -0
  39. package/dist/web/client/assets/skills-DzYXksM0.js +1 -0
  40. package/dist/web/client/assets/style-Cdzqt_TJ.js +7 -0
  41. package/dist/web/client/assets/styles-BRSS6yrm.css +2 -0
  42. package/dist/web/client/assets/system-CsI66nyZ.js +1 -0
  43. package/dist/web/client/assets/teams-CHE_zpxS.js +1 -0
  44. package/dist/web/client/assets/teams-dxG9OESG.js +1 -0
  45. package/dist/web/client/assets/telegram-C3dGndJV.js +1 -0
  46. package/dist/web/client/assets/tokens-CNNH-Wr9.js +1 -0
  47. package/dist/web/client/assets/use-resource-BjnxgGvh.js +1 -0
  48. package/dist/web/client/assets/welcome-C8EOtc8P.js +1 -0
  49. package/dist/web/server/assets/AddProviderDialog-CR6TRYdZ.js +910 -0
  50. package/dist/web/server/assets/{ConfigPage-CGld_wCK.js → ConfigPage-CIh3ohea.js} +4 -4
  51. package/dist/web/server/assets/ConfirmDialog-B79K2KEW.js +52 -0
  52. package/dist/web/server/assets/ConnectionsView-BIMYdp9C.js +710 -0
  53. package/dist/web/server/assets/{ConfirmDialog-LdVlEanK.js → Dialog-CVqpXxuN.js} +3 -50
  54. package/dist/web/server/assets/{FieldRow-Dah2KKqo.js → FieldRow-CHVhX2rS.js} +4 -4
  55. package/dist/web/server/assets/{ModelSelect-Vwro6OkL.js → ModelSelect-DrZrdndo.js} +7 -7
  56. package/dist/web/server/assets/Rail-Cg-efcpA.js +698 -0
  57. package/dist/web/server/assets/{SectionTabs-CqFg9Vwx.js → SectionTabs-DrcgVeZd.js} +4 -18
  58. package/dist/web/server/assets/Segmented-3ZLdqa5U.js +18 -0
  59. package/dist/web/server/assets/{SkillFindings-Bd6e81Wu.js → SkillFindings-DSDiL6hn.js} +1 -1
  60. package/dist/web/server/assets/{SpawnDialog-BGNaMfFb.js → SpawnDialog-BUUlLxE9.js} +25 -7
  61. package/dist/web/server/assets/{TeamForm-C93tpn9r.js → TeamForm-CvQAs2FA.js} +1 -1
  62. package/dist/web/server/assets/TeamThread-5CjVPcDr.js +190 -0
  63. package/dist/web/server/assets/{UnsavedChangesGuard-Dm4a27_5.js → UnsavedChangesGuard-CyF2Z9p1.js} +8 -4
  64. package/dist/web/server/assets/{TeamPolicyEditor-BHS3J0R9.js → _id-0fEWiVZX.js} +114 -263
  65. package/dist/web/server/assets/{_id-B0x1ffz3.js → _id-8bsYEcGg.js} +2 -2
  66. package/dist/web/server/assets/{_id-sW6zXrTP.js → _id-BvAaRSUW.js} +2 -2
  67. package/dist/web/server/assets/{_id-lOVnT5sS.js → _id-Dg6M_qfr.js} +6 -6
  68. package/dist/web/server/assets/{_id-ByiXeIPS.js → _id-Dji7xr9C.js} +2 -2
  69. package/dist/web/server/assets/{_id-Bdf_Rg62.js → _id-TVruGcOd.js} +1 -1
  70. package/dist/web/server/assets/_tanstack-start-manifest_v-sxiIH4M7.js +214 -0
  71. package/dist/web/server/assets/{agents-D4tqK1kH.js → agents-BDA5yYZ2.js} +14 -15
  72. package/dist/web/server/assets/{agents-Cn9GkXFX.js → agents-BTDxmp-F.js} +2 -2
  73. package/dist/web/server/assets/{agents-BNPkidbH.js → agents-BnWgFo6o.js} +1 -1
  74. package/dist/web/server/assets/{agents-lOqc6VGd.js → agents-DM7guWF2.js} +2 -2
  75. package/dist/web/server/assets/{agents-DycxHDt8.js → agents-DktqUffG.js} +10 -10
  76. package/dist/web/server/assets/{agents-BK8OmB8g.js → agents-xgZ9rsac.js} +2 -2
  77. package/dist/web/server/assets/{attention-DULVjdmF.js → attention-CHQEQiZl.js} +2 -2
  78. package/dist/web/server/assets/{attention-YWnLKA2E.js → attention-Cr7puThv.js} +1 -1
  79. package/dist/web/server/assets/{attention-BIm455bC.js → attention-De3-ehuf.js} +6 -6
  80. package/dist/web/server/assets/{auth-DiN92ydD.js → auth-dJnrFW6y.js} +1 -1
  81. package/dist/web/server/assets/config-DOp28gcy.js +1067 -0
  82. package/dist/web/server/assets/config-DzgkbBoD.js +17 -0
  83. package/dist/web/server/assets/config-X7qWbbpH.js +20 -0
  84. package/dist/web/server/assets/{Page-CMSYKXWJ.js → createSsrRpc-CcLbajrF.js} +17 -2
  85. package/dist/web/server/assets/{daemon-client-DL2ik2Em.js → daemon-client-B_ZRIIrT.js} +2 -1
  86. package/dist/web/server/assets/{mcp-BwmpNQPN.js → mcp-C97uAZe1.js} +1 -1
  87. package/dist/web/server/assets/{mcp-B09_O05r.js → mcp-CO_tycXU.js} +9 -9
  88. package/dist/web/server/assets/{mcp-CqdTfXcn.js → mcp-D3OCoHtO.js} +2 -2
  89. package/dist/web/server/assets/router-Cs2Ak4II.js +892 -0
  90. package/dist/web/server/assets/routes-BSNOKE-C.js +7647 -0
  91. package/dist/web/server/assets/routes-BVwqgZGI.js +16 -0
  92. package/dist/web/server/assets/routes-CO4l-GJ0.js +57 -0
  93. package/dist/web/server/assets/{services-Q9HYQXXB.js → services-DZLxUSG8.js} +2 -2
  94. package/dist/web/server/assets/{services-BLvAvb8g.js → services-DsHRLL8q.js} +1 -1
  95. package/dist/web/server/assets/{services-tCfB1B83.js → services-DsvpaF3L.js} +4 -4
  96. package/dist/web/server/assets/{skills-BZg_txbf.js → skills-CggQJk6a.js} +2 -2
  97. package/dist/web/server/assets/{skills-C7fqRPna.js → skills-DKYV7PTk.js} +11 -11
  98. package/dist/web/server/assets/{skills-C_g8IKag.js → skills-h5aHa7Q8.js} +1 -1
  99. package/dist/web/server/assets/style-GYDODk2F.js +178 -0
  100. package/dist/web/server/assets/system-CZ2qzBz3.js +138 -0
  101. package/dist/web/server/assets/system-DsJfpBPl.js +12 -0
  102. package/dist/web/server/assets/system-DtswhLW62.js +18 -0
  103. package/dist/web/server/assets/{teams-BS-oweRl.js → teams-B6PzNcoy.js} +23 -15
  104. package/dist/web/server/assets/{teams-D4CaU76n.js → teams-B6lBhvdL.js} +2 -2
  105. package/dist/web/server/assets/{teams-BHkhnt6b.js → teams-Bp2tERZe.js} +2 -2
  106. package/dist/web/server/assets/{teams-DX2HmKqi.js → teams-BxnvFTyn.js} +1 -1
  107. package/dist/web/server/assets/{teams-BSflKBP8.js → teams-C-8iz-uV.js} +6 -6
  108. package/dist/web/server/assets/{teams-CNyB5nM9.js → teams-YrmyutM4.js} +1 -1
  109. package/dist/web/server/assets/{telegram-CrJiygCX.js → telegram-CXrP3hMp.js} +6 -6
  110. package/dist/web/server/assets/{telegram-BUdnc8oF.js → telegram-D2RZriz_.js} +2 -2
  111. package/dist/web/server/assets/{telegram-C4v1HhyJ.js → telegram-Gy7_9yih.js} +1 -1
  112. package/dist/web/server/assets/{tokens-DqldzPUq.js → tokens-C-oDTqnp.js} +2 -2
  113. package/dist/web/server/assets/{tokens-B1twAJdd.js → tokens-CEdl8puR.js} +1 -1
  114. package/dist/web/server/assets/{tokens-DdjEyALj.js → tokens-DSLwQ1Pw.js} +10 -10
  115. package/dist/web/server/assets/use-resource-ChQozXVI.js +63 -0
  116. package/dist/web/server/assets/welcome-BLw1G6SS.js +318 -0
  117. package/dist/web/server/assets/welcome-ByAkvHSP.js +26 -0
  118. package/dist/web/server/assets/welcome-CxXMI4HI.js +15 -0
  119. package/dist/web/server/assets/workspace-DeEYMPDX.js +658 -0
  120. package/dist/web/server/server.js +30 -74
  121. package/dist/worker.js +78 -36
  122. package/dist/worker.js.map +1 -1
  123. package/package.json +1 -1
  124. package/dist/web/client/assets/AgentAvatar-DWx-bM6n.js +0 -1
  125. package/dist/web/client/assets/ChatPane-DOV_HJg-.js +0 -72
  126. package/dist/web/client/assets/ConfigPage-Dfu9DzFX.js +0 -1
  127. package/dist/web/client/assets/ConfirmDialog-536ziJ5P.js +0 -1
  128. package/dist/web/client/assets/FieldRow-z1JqCdqn.js +0 -1
  129. package/dist/web/client/assets/ModelSelect-CvOHjUyB.js +0 -1
  130. package/dist/web/client/assets/ResultCard-X4nTbjYY.js +0 -1
  131. package/dist/web/client/assets/SectionTabs-DXHzXmmb.js +0 -1
  132. package/dist/web/client/assets/SkillFindings-8LX6bYf_.js +0 -1
  133. package/dist/web/client/assets/SkillsPicker-Cr87y_W-.js +0 -1
  134. package/dist/web/client/assets/SpawnDialog-DoZl-yes.js +0 -1
  135. package/dist/web/client/assets/SpawnTeamModal-C638hEoN.js +0 -1
  136. package/dist/web/client/assets/Tabs-D0LgBNIk.js +0 -1
  137. package/dist/web/client/assets/TeamForm-C-WzvOl4.js +0 -1
  138. package/dist/web/client/assets/TeamPolicyEditor-CSKBx0oK.js +0 -7
  139. package/dist/web/client/assets/UnsavedChangesGuard-GC-vzw7h.js +0 -1
  140. package/dist/web/client/assets/_id-BKLynswT.js +0 -1
  141. package/dist/web/client/assets/_id-BYM_NORr.js +0 -1
  142. package/dist/web/client/assets/_id-Cxa98a9m.js +0 -1
  143. package/dist/web/client/assets/_id-D4hV1U1t.js +0 -1
  144. package/dist/web/client/assets/agent-actions-CXQCoxKO.js +0 -1
  145. package/dist/web/client/assets/agents-BxPS1_Bp.js +0 -1
  146. package/dist/web/client/assets/agents-GozAWW-l.js +0 -1
  147. package/dist/web/client/assets/attention-Cz9rZcrr.js +0 -1
  148. package/dist/web/client/assets/chevron-right-CPAb1zac.js +0 -1
  149. package/dist/web/client/assets/config-9vv9Lipb.js +0 -3
  150. package/dist/web/client/assets/inbox-DHLArXxl.js +0 -1
  151. package/dist/web/client/assets/index-1YXquAq8.js +0 -52
  152. package/dist/web/client/assets/jsx-runtime-bzQ4Vb5N.js +0 -1
  153. package/dist/web/client/assets/learning-PvtXm8Ne.js +0 -1
  154. package/dist/web/client/assets/login-DIJpNQFo.js +0 -1
  155. package/dist/web/client/assets/mcp-pKBL0xIf.js +0 -1
  156. package/dist/web/client/assets/members-DHWsgsEs.js +0 -1
  157. package/dist/web/client/assets/memory-CEVppPyU.js +0 -1
  158. package/dist/web/client/assets/plus-BaIRdB10.js +0 -1
  159. package/dist/web/client/assets/policy-DEh4BLSw.js +0 -1
  160. package/dist/web/client/assets/preload-helper-eUUcpe2S.js +0 -1
  161. package/dist/web/client/assets/results-DgJPjEZF.js +0 -1
  162. package/dist/web/client/assets/review-BbshafTQ.js +0 -1
  163. package/dist/web/client/assets/route-Ccb8v41z.js +0 -1
  164. package/dist/web/client/assets/route-D1d6kCEV.js +0 -1
  165. package/dist/web/client/assets/routes-g7V4ru7T.js +0 -1
  166. package/dist/web/client/assets/services-B2f7e5jV.js +0 -1
  167. package/dist/web/client/assets/settings-B6elpcYm.js +0 -1
  168. package/dist/web/client/assets/skills-CngE7TF8.js +0 -1
  169. package/dist/web/client/assets/styles-xUnZ-ep_.css +0 -2
  170. package/dist/web/client/assets/teams-BdJZXOan.js +0 -1
  171. package/dist/web/client/assets/teams-c496ISsT.js +0 -1
  172. package/dist/web/client/assets/telegram-B_-hK6EC.js +0 -1
  173. package/dist/web/client/assets/tokens-CKz8gx4-.js +0 -1
  174. package/dist/web/client/assets/triggers-DCEPciGW.js +0 -1
  175. package/dist/web/client/assets/welcome-D-zVOLGA.js +0 -1
  176. package/dist/web/server/assets/AgentAvatar-8gTAy_tP.js +0 -37
  177. package/dist/web/server/assets/ChatPane-De_FPEoD.js +0 -1887
  178. package/dist/web/server/assets/ResultCard-CZn1w4KA.js +0 -97
  179. package/dist/web/server/assets/Sidebar-puq47KyR.js +0 -430
  180. package/dist/web/server/assets/SpawnTeamModal-C6GbfScI.js +0 -97
  181. package/dist/web/server/assets/_id-BR6tnR6I.js +0 -23
  182. package/dist/web/server/assets/_id-Bm611NQz.js +0 -13
  183. package/dist/web/server/assets/_id-D5UCoyES.js +0 -359
  184. package/dist/web/server/assets/_id-DHx5UmmL.js +0 -12
  185. package/dist/web/server/assets/_id-DLpGmOVm.js +0 -19
  186. package/dist/web/server/assets/_id-Y5ctILG2.js +0 -13
  187. package/dist/web/server/assets/_id-dDA0pdVo.js +0 -54
  188. package/dist/web/server/assets/_tanstack-start-manifest_v-B8u80HjK.js +0 -292
  189. package/dist/web/server/assets/agent-actions-BBdFVdoa.js +0 -20
  190. package/dist/web/server/assets/api-WWxPqx67.js +0 -85
  191. package/dist/web/server/assets/config-BNEgu7WG.js +0 -798
  192. package/dist/web/server/assets/config-C1VB28se.js +0 -12
  193. package/dist/web/server/assets/config-TdVqnqNL.js +0 -25
  194. package/dist/web/server/assets/createSsrRpc-6LHNEsSK.js +0 -16
  195. package/dist/web/server/assets/inbox-4Vj5jTT8.js +0 -245
  196. package/dist/web/server/assets/inbox-D4IqUv3l.js +0 -38
  197. package/dist/web/server/assets/inbox-Dle24AfV.js +0 -23
  198. package/dist/web/server/assets/learning-BScq7VbO.js +0 -12
  199. package/dist/web/server/assets/learning-CBWFEnhg.js +0 -263
  200. package/dist/web/server/assets/learning-DWAKevhF.js +0 -25
  201. package/dist/web/server/assets/members-B8QBF6TF.js +0 -12
  202. package/dist/web/server/assets/members-DsF02Wp7.js +0 -12
  203. package/dist/web/server/assets/members-tWZA9b15.js +0 -36
  204. package/dist/web/server/assets/memory-BNN0b-0x.js +0 -12
  205. package/dist/web/server/assets/memory-CTl1E1Rm.js +0 -267
  206. package/dist/web/server/assets/memory-CV5uCBb2.js +0 -12
  207. package/dist/web/server/assets/policy-C9M6zV6w.js +0 -79
  208. package/dist/web/server/assets/policy-h-6NpU3m.js +0 -19
  209. package/dist/web/server/assets/policy-xEw9X0DK.js +0 -12
  210. package/dist/web/server/assets/results-D3A3UA4d.js +0 -182
  211. package/dist/web/server/assets/results-D6Ui5S8D.js +0 -12
  212. package/dist/web/server/assets/results-DWmxvfyn.js +0 -15
  213. package/dist/web/server/assets/review-CyQky-WQ.js +0 -40
  214. package/dist/web/server/assets/review-Sq0GGcPV.js +0 -322
  215. package/dist/web/server/assets/review-XWbSF8cF.js +0 -12
  216. package/dist/web/server/assets/route-BErtkz6t.js +0 -19
  217. package/dist/web/server/assets/route-CLoV-An_.js +0 -48
  218. package/dist/web/server/assets/route-WQ19JkBa.js +0 -19
  219. package/dist/web/server/assets/route-dEK_2GLj.js +0 -203
  220. package/dist/web/server/assets/route-iHTkhO81.js +0 -16
  221. package/dist/web/server/assets/route-zs8uUQtB.js +0 -16
  222. package/dist/web/server/assets/router-BI9gmY3S.js +0 -751
  223. package/dist/web/server/assets/routes-081s4n24.js +0 -45
  224. package/dist/web/server/assets/routes-CWo5WPsr.js +0 -15
  225. package/dist/web/server/assets/routes-Cqp1ufHm.js +0 -56
  226. package/dist/web/server/assets/settings-CVaGv-xF.js +0 -12
  227. package/dist/web/server/assets/settings-D9viV-86.js +0 -561
  228. package/dist/web/server/assets/settings-DaZNZ_CC.js +0 -27
  229. package/dist/web/server/assets/triggers-B7LW784F.js +0 -214
  230. package/dist/web/server/assets/triggers-C5sMCZXv2.js +0 -12
  231. package/dist/web/server/assets/triggers-DMfVdImD.js +0 -12
  232. package/dist/web/server/assets/welcome-D0d38Pzx.js +0 -93
  233. package/dist/web/client/assets/{TeamPolicyEditor-DLioOiRN.css → style-DLioOiRN.css} +0 -0
  234. package/dist/web/server/assets/{start-DTX6aKCi.js → start-DhW7sy23.js} +1 -1
@@ -0,0 +1,1067 @@
1
+ import { E as errorMessage, d as Button, w as api } from "./workspace-DeEYMPDX.js";
2
+ import { r as useResource } from "./use-resource-ChQozXVI.js";
3
+ import { t as Dialog } from "./Dialog-CVqpXxuN.js";
4
+ import { t as ConfirmDialog } from "./ConfirmDialog-B79K2KEW.js";
5
+ import { t as Segmented } from "./Segmented-3ZLdqa5U.js";
6
+ import { t as Route } from "./config-DzgkbBoD.js";
7
+ import { t as ConfigPage } from "./ConfigPage-CIh3ohea.js";
8
+ import { S as usedByLine, _ as factsLine, b as priceLine, c as ModelRow, d as SetupCard, f as StateChip, g as credentialLine, h as ago, l as ProviderAvatar, m as Waiting, o as Chip, p as Switch, s as FailureBox, t as AddProviderDialog, u as SearchField, v as matchesModel, x as providerStatus, y as modelName } from "./AddProviderDialog-CR6TRYdZ.js";
9
+ import { t as FieldRow } from "./FieldRow-CHVhX2rS.js";
10
+ import { useMemo, useState } from "react";
11
+ import { useRouter } from "@tanstack/react-router";
12
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
13
+ import { AlertTriangle, Check, ChevronRight, Images, MessageSquare, Plug, Plus, X } from "lucide-react";
14
+ //#region src/components/setup/ModelPicker.tsx
15
+ var FILTERS = [
16
+ {
17
+ id: "all",
18
+ label: "All"
19
+ },
20
+ {
21
+ id: "images",
22
+ label: "Sees images"
23
+ },
24
+ {
25
+ id: "reasoning",
26
+ label: "Reasoning"
27
+ }
28
+ ];
29
+ /** Rows of one provider shown at once; a search narrows the rest down. */
30
+ var MAX_ROWS = 80;
31
+ /**
32
+ * Choose the chat models Agents may use, across every connected provider: names, sizes and prices
33
+ * from the bundled catalog, plus what each provider reports itself. Saving replaces each changed
34
+ * provider's list.
35
+ */
36
+ function ModelPicker({ providers, chat, onClose, onSaved, onAddProvider }) {
37
+ const [query, setQuery] = useState("");
38
+ const [filter, setFilter] = useState("all");
39
+ const [dated, setDated] = useState(false);
40
+ const [picked, setPicked] = useState(null);
41
+ const [saving, setSaving] = useState(false);
42
+ const [error, setError] = useState(null);
43
+ const catalogs = useResource(async (signal) => {
44
+ const loaded = await Promise.all(providers.map(async (provider) => {
45
+ return {
46
+ provider,
47
+ catalog: await api(`/api/config/providers/${encodeURIComponent(provider.id)}/catalog`, { signal })
48
+ };
49
+ }));
50
+ setPicked(Object.fromEntries(loaded.map(({ provider, catalog }) => [provider.id, catalog.models.filter((model) => model.selected).map((model) => model.id)])));
51
+ return loaded;
52
+ }, [providers.map((provider) => provider.id).join(",")]);
53
+ const picks = picked ?? {};
54
+ const isPicked = (provider, model) => picks[provider]?.includes(model) ?? false;
55
+ const toggle = (provider, model) => setPicked((current) => {
56
+ const list = current?.[provider] ?? [];
57
+ return {
58
+ ...current,
59
+ [provider]: list.includes(model) ? list.filter((id) => id !== model) : [...list, model]
60
+ };
61
+ });
62
+ const shown = (model, provider) => {
63
+ if (query) return matchesModel(model, query);
64
+ if (model.dated && !dated && !isPicked(provider.id, model.id)) return false;
65
+ if (filter === "images") return model.images === true;
66
+ if (filter === "reasoning") return model.reasoning === true;
67
+ return true;
68
+ };
69
+ const changed = useMemo(() => (catalogs.data ?? []).filter(({ provider, catalog }) => {
70
+ const before = catalog.models.filter((model) => model.selected).map((model) => model.id);
71
+ const after = picks[provider.id] ?? [];
72
+ return before.length !== after.length || before.some((id) => !after.includes(id));
73
+ }), [catalogs.data, picks]);
74
+ const stranded = chat.filter((model) => model.usedBy.agents > 0 && changed.some(({ provider }) => provider.id === model.provider) && !isPicked(model.provider, model.id));
75
+ const total = Object.values(picks).reduce((sum, list) => sum + list.length, 0);
76
+ async function save() {
77
+ setSaving(true);
78
+ setError(null);
79
+ try {
80
+ for (const { provider } of changed) await api(`/api/config/providers/${encodeURIComponent(provider.id)}/models`, {
81
+ method: "PUT",
82
+ body: { models: picks[provider.id] ?? [] }
83
+ });
84
+ await onSaved();
85
+ onClose();
86
+ } catch (cause) {
87
+ setError(errorMessage(cause));
88
+ setSaving(false);
89
+ }
90
+ }
91
+ return /* @__PURE__ */ jsxs(Dialog, {
92
+ title: "Chat models",
93
+ description: "Tick the models your Agents may use. Each Agent and each template picks one of them.",
94
+ onClose,
95
+ busy: saving,
96
+ className: "top-[4dvh] max-h-[92dvh] max-w-3xl translate-y-0 content-start",
97
+ children: [
98
+ /* @__PURE__ */ jsxs("div", {
99
+ className: "flex flex-wrap items-center gap-2",
100
+ children: [/* @__PURE__ */ jsx(SearchField, {
101
+ label: "Search models",
102
+ placeholder: "Search by name, for example haiku",
103
+ value: query,
104
+ onChange: setQuery,
105
+ className: "flex-1 basis-60"
106
+ }), /* @__PURE__ */ jsx(Segmented, {
107
+ label: "Show",
108
+ value: filter,
109
+ options: FILTERS,
110
+ onChange: setFilter
111
+ })]
112
+ }),
113
+ /* @__PURE__ */ jsxs("div", {
114
+ className: "max-h-[min(58dvh,36rem)] min-h-40 overflow-y-auto rounded-xl border border-border",
115
+ children: [
116
+ catalogs.loading && !catalogs.data && /* @__PURE__ */ jsx("div", {
117
+ className: "p-4 text-sm text-muted-foreground",
118
+ children: "Reading the model lists…"
119
+ }),
120
+ catalogs.error && /* @__PURE__ */ jsx("div", {
121
+ role: "alert",
122
+ className: "p-4 text-sm text-danger",
123
+ children: catalogs.error
124
+ }),
125
+ catalogs.data?.length === 0 && /* @__PURE__ */ jsx("div", {
126
+ className: "p-4 text-sm text-muted-foreground",
127
+ children: "No provider is connected yet. Add one to see its models here."
128
+ }),
129
+ (catalogs.data ?? []).map(({ provider, catalog }) => {
130
+ const matching = catalog.models.filter((model) => shown(model, provider));
131
+ const rows = matching.slice(0, MAX_ROWS);
132
+ const hiddenDated = catalog.models.filter((model) => model.dated && !isPicked(provider.id, model.id)).length;
133
+ if (query && matching.length === 0) return null;
134
+ return /* @__PURE__ */ jsxs("section", {
135
+ "aria-label": provider.displayName,
136
+ children: [
137
+ /* @__PURE__ */ jsxs("div", {
138
+ className: "flex flex-wrap items-baseline gap-x-2 border-b border-border bg-muted/50 px-4 py-2",
139
+ children: [
140
+ /* @__PURE__ */ jsx("h3", {
141
+ className: "m-0 font-body text-[0.72rem] font-bold uppercase tracking-[0.08em] text-muted-foreground",
142
+ children: provider.displayName
143
+ }),
144
+ /* @__PURE__ */ jsxs("span", {
145
+ className: "text-xs text-muted-foreground",
146
+ children: [
147
+ (picks[provider.id] ?? []).length,
148
+ " of ",
149
+ catalog.models.length,
150
+ " in use"
151
+ ]
152
+ }),
153
+ catalog.listError && /* @__PURE__ */ jsxs("span", {
154
+ className: "text-xs text-warning",
155
+ children: ["Its own list could not be read: ", catalog.listError]
156
+ })
157
+ ]
158
+ }),
159
+ rows.length === 0 && /* @__PURE__ */ jsx("div", {
160
+ className: "border-b border-border px-4 py-3 text-sm text-muted-foreground",
161
+ children: catalog.models.length === 0 ? "It lists no model." : "Nothing matches."
162
+ }),
163
+ rows.map((model) => /* @__PURE__ */ jsx(ModelRow, {
164
+ model: {
165
+ ...model,
166
+ suggested: false
167
+ },
168
+ connect: provider.connect,
169
+ checked: isPicked(provider.id, model.id),
170
+ disabled: saving,
171
+ onToggle: () => toggle(provider.id, model.id),
172
+ className: "px-4 hover:bg-accent/30"
173
+ }, model.id)),
174
+ matching.length > rows.length && /* @__PURE__ */ jsxs("div", {
175
+ className: "border-b border-border px-4 py-2 text-xs text-muted-foreground",
176
+ children: [matching.length - rows.length, " more: search to narrow them down."]
177
+ }),
178
+ !query && hiddenDated > 0 && /* @__PURE__ */ jsx("div", {
179
+ className: "border-b border-border px-4 py-1.5",
180
+ children: /* @__PURE__ */ jsx("button", {
181
+ type: "button",
182
+ onClick: () => setDated((open) => !open),
183
+ className: "text-xs font-semibold text-primary",
184
+ children: dated ? "Hide dated versions" : `Show ${hiddenDated} dated ${hiddenDated === 1 ? "version" : "versions"} of the same models`
185
+ })
186
+ })
187
+ ]
188
+ }, provider.id);
189
+ })
190
+ ]
191
+ }),
192
+ stranded.length > 0 && /* @__PURE__ */ jsxs("p", {
193
+ role: "status",
194
+ className: "m-0 rounded-xl bg-warning/10 px-3 py-2 text-sm text-warning",
195
+ children: [
196
+ stranded.map((model) => modelName(model)).join(", "),
197
+ " ",
198
+ stranded.length === 1 ? "is" : "are",
199
+ " in use by Agents. They are refused until you give them another model in their Agent tab."
200
+ ]
201
+ }),
202
+ error && /* @__PURE__ */ jsx("p", {
203
+ role: "alert",
204
+ className: "m-0 rounded-xl bg-danger/10 px-3 py-2 text-sm text-danger",
205
+ children: error
206
+ }),
207
+ /* @__PURE__ */ jsxs("div", {
208
+ className: "flex flex-wrap items-center gap-x-4 gap-y-2 border-t border-frost pt-4",
209
+ children: [
210
+ /* @__PURE__ */ jsx("span", {
211
+ className: "min-w-0 flex-1 basis-40 text-sm text-muted-foreground",
212
+ children: total === 1 ? "1 model in Chat" : `${total} models in Chat`
213
+ }),
214
+ /* @__PURE__ */ jsx("button", {
215
+ type: "button",
216
+ onClick: onAddProvider,
217
+ className: "text-sm font-semibold text-primary",
218
+ children: "A model from another provider?"
219
+ }),
220
+ /* @__PURE__ */ jsx(Button, {
221
+ variant: "ghost",
222
+ disabled: saving,
223
+ onClick: onClose,
224
+ children: "Cancel"
225
+ }),
226
+ /* @__PURE__ */ jsx(Button, {
227
+ variant: "primary",
228
+ disabled: saving || changed.length === 0,
229
+ onClick: () => void save(),
230
+ children: saving ? "Saving…" : "Save"
231
+ })
232
+ ]
233
+ })
234
+ ]
235
+ });
236
+ }
237
+ //#endregion
238
+ //#region src/components/setup/ModelsCards.tsx
239
+ var ROW = "flex flex-wrap items-center gap-x-4 gap-y-1 border-t border-border px-4 sm:px-5";
240
+ /** The line above the cards: whether everything Agents rely on answers, and what does not. */
241
+ function StatusLine({ providers, chat, now, onOpen, onTestAll, testing }) {
242
+ const on = providers.filter((provider) => provider.enabled);
243
+ if (on.length === 0) return null;
244
+ const broken = on.filter((provider) => provider.state === "failing" || provider.state === "incomplete");
245
+ const untested = on.filter((provider) => provider.state === "untested" && provider.models.length > 0);
246
+ if (broken.length > 0) return /* @__PURE__ */ jsx("div", {
247
+ className: "grid gap-2",
248
+ children: broken.map((provider) => {
249
+ const models = chat.filter((model) => model.provider === provider.id);
250
+ const agents = models.reduce((sum, model) => sum + model.usedBy.agents, 0);
251
+ return /* @__PURE__ */ jsxs("div", {
252
+ role: "status",
253
+ className: "flex flex-wrap items-center gap-3 rounded-2xl border border-warning/35 bg-warning/10 px-4 py-3 text-sm",
254
+ children: [/* @__PURE__ */ jsxs("div", {
255
+ className: "flex min-w-0 flex-1 basis-64 items-start gap-3",
256
+ children: [/* @__PURE__ */ jsx(AlertTriangle, {
257
+ className: "mt-0.5 size-5 shrink-0 text-warning",
258
+ "aria-hidden": "true"
259
+ }), /* @__PURE__ */ jsxs("div", {
260
+ className: "min-w-0",
261
+ children: [
262
+ /* @__PURE__ */ jsxs("span", {
263
+ className: "font-semibold text-foreground",
264
+ children: [provider.check?.failure?.title ?? `${provider.displayName}: ${providerStatus(provider, now).label.toLowerCase()}`, "."]
265
+ }),
266
+ " ",
267
+ /* @__PURE__ */ jsx("span", {
268
+ className: "text-muted-foreground",
269
+ children: models.length === 0 ? "No chat model runs on it." : `${models.length === 1 ? "1 chat model runs" : `${models.length} chat models run`} on it${agents === 0 ? "" : `, used by ${agents === 1 ? "1 Agent" : `${agents} Agents`}`}.`
270
+ })
271
+ ]
272
+ })]
273
+ }), /* @__PURE__ */ jsxs(Button, {
274
+ variant: "ghost",
275
+ onClick: () => onOpen(provider.id),
276
+ children: ["Open ", provider.displayName]
277
+ })]
278
+ }, provider.id);
279
+ })
280
+ });
281
+ if (untested.length > 0) return /* @__PURE__ */ jsxs("div", {
282
+ role: "status",
283
+ className: "flex flex-wrap items-center gap-3 rounded-2xl border border-border bg-card px-4 py-3 text-sm shadow-baziu-sm",
284
+ children: [/* @__PURE__ */ jsxs("div", {
285
+ className: "min-w-0 flex-1 basis-72",
286
+ children: [
287
+ /* @__PURE__ */ jsx("span", {
288
+ className: "font-semibold text-foreground",
289
+ children: untested.length === 1 ? `${untested[0]?.displayName} has not been tested.` : `${untested.length} providers have not been tested.`
290
+ }),
291
+ " ",
292
+ /* @__PURE__ */ jsx("span", {
293
+ className: "text-muted-foreground",
294
+ children: "A test sends one short message to the cheapest model of each."
295
+ })
296
+ ]
297
+ }), /* @__PURE__ */ jsx(Button, {
298
+ variant: "ghost",
299
+ disabled: testing,
300
+ onClick: onTestAll,
301
+ children: testing ? "Testing…" : untested.length === 1 ? "Test it" : "Test them"
302
+ })]
303
+ });
304
+ const working = on.filter((provider) => provider.state === "working");
305
+ if (working.length === 0) return null;
306
+ return /* @__PURE__ */ jsxs("div", {
307
+ role: "status",
308
+ className: "flex flex-wrap items-center gap-3 rounded-2xl border border-success/30 bg-success/10 px-4 py-3 text-sm",
309
+ children: [/* @__PURE__ */ jsxs("div", {
310
+ className: "flex min-w-0 flex-1 basis-64 items-start gap-3",
311
+ children: [/* @__PURE__ */ jsx(Check, {
312
+ className: "mt-0.5 size-5 shrink-0 text-success",
313
+ "aria-hidden": "true"
314
+ }), /* @__PURE__ */ jsxs("div", {
315
+ className: "min-w-0",
316
+ children: [
317
+ /* @__PURE__ */ jsx("span", {
318
+ className: "font-semibold text-foreground",
319
+ children: working.length === 1 ? "Your provider answers." : "Every provider answers."
320
+ }),
321
+ " ",
322
+ /* @__PURE__ */ jsxs("span", {
323
+ className: "text-muted-foreground",
324
+ children: [chat.length === 1 ? "1 chat model" : `${chat.length} chat models`, " for your Agents."]
325
+ })
326
+ ]
327
+ })]
328
+ }), /* @__PURE__ */ jsx(Button, {
329
+ variant: "ghost",
330
+ disabled: testing,
331
+ onClick: onTestAll,
332
+ children: testing ? "Testing…" : "Test again"
333
+ })]
334
+ });
335
+ }
336
+ /** Chat: the models Agents think with, each with what it can do, its price and who uses it. */
337
+ function ChatModelsCard({ chat, hasProviders, onPick, onChanged }) {
338
+ const [removing, setRemoving] = useState(null);
339
+ const [error, setError] = useState(null);
340
+ async function remove(model) {
341
+ const models = chat.filter((entry) => entry.provider === model.provider && entry.id !== model.id).map((entry) => entry.id);
342
+ await api(`/api/config/providers/${encodeURIComponent(model.provider)}/models`, {
343
+ method: "PUT",
344
+ body: { models }
345
+ });
346
+ await onChanged();
347
+ }
348
+ function askToRemove(model) {
349
+ setError(null);
350
+ if (model.usedBy.agents > 0 || model.usedBy.templates.length > 0) setRemoving(model);
351
+ else remove(model).catch((cause) => setError(errorMessage(cause)));
352
+ }
353
+ return /* @__PURE__ */ jsxs(SetupCard, {
354
+ labelledBy: "setup-chat",
355
+ icon: /* @__PURE__ */ jsx(MessageSquare, { className: "size-5" }),
356
+ title: "Chat",
357
+ description: "The models Agents think with. Each Agent and each template uses one of them.",
358
+ action: /* @__PURE__ */ jsxs(Button, {
359
+ variant: "primary",
360
+ disabled: !hasProviders,
361
+ onClick: onPick,
362
+ children: [/* @__PURE__ */ jsx(Plus, {
363
+ className: "size-4",
364
+ "aria-hidden": "true"
365
+ }), "Add models"]
366
+ }),
367
+ children: [
368
+ chat.length > 0 && /* @__PURE__ */ jsxs("div", {
369
+ "aria-hidden": "true",
370
+ className: `${ROW} hidden bg-muted/50 py-2 text-[0.7rem] font-bold uppercase tracking-[0.08em] text-muted-foreground lg:flex`,
371
+ children: [
372
+ /* @__PURE__ */ jsx("span", {
373
+ className: "min-w-0 flex-[2.2] basis-52",
374
+ children: "Model"
375
+ }),
376
+ /* @__PURE__ */ jsx("span", {
377
+ className: "w-28 shrink-0",
378
+ children: "Provider"
379
+ }),
380
+ /* @__PURE__ */ jsx("span", {
381
+ className: "min-w-0 flex-[2] basis-48",
382
+ children: "Can do"
383
+ }),
384
+ /* @__PURE__ */ jsx("span", {
385
+ className: "w-40 shrink-0",
386
+ children: "Price per 1M tokens"
387
+ }),
388
+ /* @__PURE__ */ jsx("span", {
389
+ className: "min-w-0 flex-[1.4] basis-36",
390
+ children: "Used by"
391
+ }),
392
+ /* @__PURE__ */ jsx("span", { className: "w-8 shrink-0" })
393
+ ]
394
+ }),
395
+ chat.map((model) => {
396
+ const down = model.providerState === "failing" || model.providerState === "incomplete";
397
+ return /* @__PURE__ */ jsxs("div", {
398
+ className: `${ROW} min-h-16 py-2.5`,
399
+ children: [
400
+ /* @__PURE__ */ jsxs("div", {
401
+ className: "min-w-0 flex-[2.2] basis-52",
402
+ children: [/* @__PURE__ */ jsx("div", {
403
+ className: "text-[0.95rem] font-semibold text-foreground",
404
+ children: modelName(model)
405
+ }), model.name && /* @__PURE__ */ jsx("div", {
406
+ className: "break-all font-mono text-[0.72rem] text-muted-foreground",
407
+ children: model.id
408
+ })]
409
+ }),
410
+ /* @__PURE__ */ jsx("div", {
411
+ className: "w-28 shrink-0 text-sm",
412
+ children: model.providerName
413
+ }),
414
+ /* @__PURE__ */ jsx("div", {
415
+ className: `min-w-0 flex-[2] basis-48 text-[0.82rem] ${down ? "font-semibold text-warning" : "text-muted-foreground"}`,
416
+ children: down ? `${model.providerName} is not working` : factsLine(model, model.providerConnect)
417
+ }),
418
+ /* @__PURE__ */ jsx("div", {
419
+ className: "w-40 shrink-0 text-[0.82rem]",
420
+ children: priceLine(model, model.providerConnect)
421
+ }),
422
+ /* @__PURE__ */ jsx("div", {
423
+ className: "min-w-0 flex-[1.4] basis-36 text-[0.82rem] text-muted-foreground",
424
+ children: usedByLine(model.usedBy)
425
+ }),
426
+ /* @__PURE__ */ jsx("button", {
427
+ type: "button",
428
+ "aria-label": `Remove ${modelName(model)} from Chat`,
429
+ onClick: () => askToRemove(model),
430
+ className: "flex size-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground hover:bg-muted hover:text-danger",
431
+ children: /* @__PURE__ */ jsx(X, {
432
+ className: "size-4",
433
+ "aria-hidden": "true"
434
+ })
435
+ })
436
+ ]
437
+ }, model.value);
438
+ }),
439
+ chat.length === 0 && /* @__PURE__ */ jsx("div", {
440
+ className: `${ROW} py-5 text-sm text-muted-foreground`,
441
+ children: hasProviders ? "No chat model yet. Agents cannot answer until one is added." : "No chat model yet. Add a provider below, and its models appear here."
442
+ }),
443
+ error && /* @__PURE__ */ jsx("div", {
444
+ role: "alert",
445
+ className: `${ROW} py-3 text-sm text-danger`,
446
+ children: error
447
+ }),
448
+ /* @__PURE__ */ jsx(ConfirmDialog, {
449
+ open: removing !== null,
450
+ onOpenChange: (open) => {
451
+ if (!open) setRemoving(null);
452
+ },
453
+ title: `Remove ${removing ? modelName(removing) : ""} from Chat?`,
454
+ description: removing && /* @__PURE__ */ jsxs("p", {
455
+ className: "m-0",
456
+ children: [
457
+ "It is used by ",
458
+ usedByLine(removing.usedBy),
459
+ ".",
460
+ " ",
461
+ removing.usedBy.agents > 0 && "Those Agents are refused until you give them another model in their Agent tab. ",
462
+ removing.usedBy.templates.length > 0 && "An Agent template on it moves to another model by itself."
463
+ ]
464
+ }),
465
+ confirmLabel: "Remove from Chat",
466
+ onConfirm: async () => {
467
+ if (removing) await remove(removing);
468
+ }
469
+ })
470
+ ]
471
+ });
472
+ }
473
+ /** Images: one model draws for every Agent, through one provider's account, or nothing does. */
474
+ function ImagesCard({ images, onConnect, onChanged }) {
475
+ const [saving, setSaving] = useState(null);
476
+ const [error, setError] = useState(null);
477
+ const selected = images.routes.find((route) => route.id === images.selected);
478
+ const on = selected?.ready === true;
479
+ const shown = saving ?? images.selected;
480
+ async function choose(id) {
481
+ setSaving(id);
482
+ setError(null);
483
+ try {
484
+ await api("/api/config/fields/BAZILION_IMAGE_MODEL", {
485
+ method: "PUT",
486
+ body: { value: id }
487
+ });
488
+ await onChanged();
489
+ } catch (cause) {
490
+ setError(errorMessage(cause));
491
+ } finally {
492
+ setSaving(null);
493
+ }
494
+ }
495
+ const row = (id, body, ready, tail) => /* @__PURE__ */ jsxs("label", {
496
+ className: `${ROW} m-0 min-h-[3.25rem] py-2 ${ready ? "cursor-pointer" : ""} ${shown === id ? "bg-accent/40" : ""}`,
497
+ children: [
498
+ /* @__PURE__ */ jsx("input", {
499
+ type: "radio",
500
+ name: "image-model",
501
+ checked: shown === id,
502
+ disabled: !ready || saving !== null,
503
+ onChange: () => void choose(id),
504
+ className: "m-0 size-[18px] shrink-0 accent-[var(--color-sapphire)]"
505
+ }),
506
+ body,
507
+ /* @__PURE__ */ jsx("span", {
508
+ className: "ml-auto flex shrink-0 justify-end sm:w-44",
509
+ children: tail
510
+ })
511
+ ]
512
+ }, id);
513
+ return /* @__PURE__ */ jsxs(SetupCard, {
514
+ labelledBy: "setup-images",
515
+ icon: /* @__PURE__ */ jsx(Images, { className: "size-5" }),
516
+ title: "Images",
517
+ description: "What Agents draw with. One model for every Agent, up to four images a turn.",
518
+ action: /* @__PURE__ */ jsx(Chip, {
519
+ tone: on ? "success" : selected ? "warning" : "neutral",
520
+ children: on ? `On: ${selected.model}` : selected ? `Needs ${selected.needs}` : "Off"
521
+ }),
522
+ children: [
523
+ images.routes.map((route) => row(route.id, /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("span", {
524
+ className: "min-w-0 flex-[1.6] basis-60 text-[0.95rem]",
525
+ children: [
526
+ /* @__PURE__ */ jsx("span", {
527
+ className: `font-semibold ${route.ready ? "text-foreground" : "text-muted-foreground"}`,
528
+ children: route.model
529
+ }),
530
+ " ",
531
+ /* @__PURE__ */ jsxs("span", {
532
+ className: "text-muted-foreground",
533
+ children: ["through ", route.providerName]
534
+ })
535
+ ]
536
+ }), /* @__PURE__ */ jsx("span", {
537
+ className: "min-w-0 flex-1 basis-44 text-[0.82rem] text-muted-foreground",
538
+ children: route.billing
539
+ })] }), route.ready, route.ready ? /* @__PURE__ */ jsx("span", {
540
+ className: "text-[0.82rem] font-semibold text-success",
541
+ children: "Ready"
542
+ }) : /* @__PURE__ */ jsx(Button, {
543
+ variant: "ghost",
544
+ onClick: () => onConnect(route.provider),
545
+ children: route.provider === "openai-codex" ? "Sign in" : `Connect ${route.providerName}`
546
+ }))),
547
+ row("off", /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
548
+ className: "min-w-0 flex-[1.6] basis-60 text-[0.95rem] font-semibold text-foreground",
549
+ children: "Off"
550
+ }), /* @__PURE__ */ jsx("span", {
551
+ className: "min-w-0 flex-1 basis-44 text-[0.82rem] text-muted-foreground",
552
+ children: "Agents have no image tool"
553
+ })] }), true, null),
554
+ images.selected !== "off" && !selected && /* @__PURE__ */ jsxs("div", {
555
+ role: "alert",
556
+ className: `${ROW} py-3 text-sm text-warning`,
557
+ children: [
558
+ "BAZILION_IMAGE_MODEL is set to “",
559
+ images.selected,
560
+ "”, which is not an image route. Choose one above."
561
+ ]
562
+ }),
563
+ error && /* @__PURE__ */ jsx("div", {
564
+ role: "alert",
565
+ className: `${ROW} py-3 text-sm text-danger`,
566
+ children: error
567
+ })
568
+ ]
569
+ });
570
+ }
571
+ /** Providers: the accounts and local servers in use, each with what it serves and its state. */
572
+ function ProvidersCard({ providers, total, images, now, onOpen, onAdd }) {
573
+ const drawing = images.routes.find((route) => route.id === images.selected && route.ready);
574
+ return /* @__PURE__ */ jsxs(SetupCard, {
575
+ labelledBy: "setup-providers",
576
+ icon: /* @__PURE__ */ jsx(Plug, { className: "size-5" }),
577
+ title: "Providers",
578
+ description: "The accounts and local servers your models run on.",
579
+ action: /* @__PURE__ */ jsxs(Button, {
580
+ variant: "primary",
581
+ onClick: onAdd,
582
+ children: [/* @__PURE__ */ jsx(Plus, {
583
+ className: "size-4",
584
+ "aria-hidden": "true"
585
+ }), "Add a provider"]
586
+ }),
587
+ children: [
588
+ providers.map((provider) => {
589
+ const count = provider.enabled ? provider.models.length : 0;
590
+ const uses = [count > 0 ? `Chat: ${count === 1 ? "1 model" : `${count} models`}` : null, drawing?.provider === provider.id ? "Images" : null].filter(Boolean);
591
+ const status = providerStatus(provider, now);
592
+ return /* @__PURE__ */ jsxs("button", {
593
+ type: "button",
594
+ onClick: () => onOpen(provider.id),
595
+ className: `${ROW} min-h-[4.25rem] w-full py-3 text-left transition-colors hover:bg-accent/30`,
596
+ children: [
597
+ /* @__PURE__ */ jsx(ProviderAvatar, {
598
+ name: provider.displayName,
599
+ tone: status.tone
600
+ }),
601
+ /* @__PURE__ */ jsxs("span", {
602
+ className: "min-w-0 flex-[1.6] basis-56",
603
+ children: [/* @__PURE__ */ jsx("span", {
604
+ className: "block text-[0.95rem] font-semibold text-foreground",
605
+ children: provider.displayName
606
+ }), /* @__PURE__ */ jsx("span", {
607
+ className: "block truncate text-[0.82rem] text-muted-foreground",
608
+ children: credentialLine(provider)
609
+ })]
610
+ }),
611
+ /* @__PURE__ */ jsx("span", {
612
+ className: "min-w-0 flex-1 basis-40 text-[0.82rem] text-muted-foreground",
613
+ children: uses.length > 0 ? uses.join(" · ") : "Not used yet"
614
+ }),
615
+ /* @__PURE__ */ jsx(StateChip, {
616
+ provider,
617
+ now
618
+ }),
619
+ /* @__PURE__ */ jsx(ChevronRight, {
620
+ className: "size-4 shrink-0 text-muted-foreground",
621
+ "aria-hidden": "true"
622
+ })
623
+ ]
624
+ }, provider.id);
625
+ }),
626
+ providers.length === 0 && /* @__PURE__ */ jsx("div", {
627
+ className: `${ROW} py-5 text-sm text-muted-foreground`,
628
+ children: "No provider yet. Add one to give your Agents a model."
629
+ }),
630
+ /* @__PURE__ */ jsxs("div", {
631
+ className: `${ROW} bg-muted/50 py-3 text-[0.82rem] text-muted-foreground`,
632
+ children: [total - providers.length, " more can be added: a ChatGPT plan, API keys from OpenAI, Anthropic, Google and many others, or a model server on this computer."]
633
+ })
634
+ ]
635
+ });
636
+ }
637
+ //#endregion
638
+ //#region src/components/setup/ProviderSheet.tsx
639
+ var HEADING = "m-0 font-body text-[0.72rem] font-bold uppercase tracking-[0.08em] text-muted-foreground";
640
+ /**
641
+ * One provider: whether it answers, its credentials, its models in Chat, and the rarer settings.
642
+ * Every change here reloads the page behind it.
643
+ */
644
+ function ProviderSheet({ provider, chat, imageRoutes, imageSelected, onClose, onChanged, onPickModels, onReconnect }) {
645
+ const now = useMemo(() => Date.now(), []);
646
+ const [busy, setBusy] = useState(null);
647
+ const [error, setError] = useState(null);
648
+ const [showMore, setShowMore] = useState(false);
649
+ const [confirmDisconnect, setConfirmDisconnect] = useState(false);
650
+ const path = `/api/config/providers/${encodeURIComponent(provider.id)}`;
651
+ const { state, check } = provider;
652
+ const signin = provider.connect === "signin";
653
+ const mainFields = provider.fields.filter((field) => !field.advanced);
654
+ const advancedFields = provider.fields.filter((field) => field.advanced);
655
+ const agents = chat.reduce((sum, model) => sum + model.usedBy.agents, 0);
656
+ const drawing = imageRoutes.find((route) => route.id === imageSelected);
657
+ async function run(kind, work) {
658
+ setBusy(kind);
659
+ setError(null);
660
+ try {
661
+ await work();
662
+ await onChanged();
663
+ } catch (cause) {
664
+ setError(errorMessage(cause));
665
+ } finally {
666
+ setBusy(null);
667
+ }
668
+ }
669
+ const test = () => run("test", () => api(`${path}/test`, { method: "POST" }));
670
+ const setEnabled = (enabled) => run("switch", () => api(`${path}/enabled`, {
671
+ method: "PUT",
672
+ body: { enabled }
673
+ }));
674
+ const signIn = () => run("signin", () => api("/api/auth/openai/login", { method: "POST" }));
675
+ async function disconnect() {
676
+ await api(path, { method: "DELETE" });
677
+ await onChanged();
678
+ onClose();
679
+ }
680
+ const canTest = provider.models.length > 0;
681
+ const testButton = (label, primary = false) => /* @__PURE__ */ jsx(Button, {
682
+ variant: primary ? "primary" : "ghost",
683
+ disabled: busy !== null,
684
+ onClick: () => void test(),
685
+ children: label
686
+ });
687
+ return /* @__PURE__ */ jsxs(Dialog, {
688
+ title: provider.displayName,
689
+ description: provider.hint,
690
+ onClose,
691
+ busy: busy === "signin",
692
+ className: "top-[4dvh] max-h-[92dvh] max-w-2xl translate-y-0 content-start gap-5",
693
+ children: [
694
+ busy === "test" ? /* @__PURE__ */ jsx("div", {
695
+ className: "rounded-2xl border border-border bg-muted/40 p-4",
696
+ children: /* @__PURE__ */ jsx(Waiting, { children: "Asking for a short reply…" })
697
+ }) : busy === "signin" ? /* @__PURE__ */ jsx("div", {
698
+ className: "rounded-2xl border border-border bg-muted/40 p-4",
699
+ children: /* @__PURE__ */ jsx(Waiting, { children: "Waiting for the ChatGPT sign-in in the browser…" })
700
+ }) : state === "working" && check ? /* @__PURE__ */ jsxs("div", {
701
+ role: "status",
702
+ className: "flex flex-wrap items-center gap-3 rounded-2xl border border-success/30 bg-success/10 p-4 text-sm",
703
+ children: [
704
+ /* @__PURE__ */ jsx(Check, {
705
+ className: "size-5 shrink-0 text-success",
706
+ "aria-hidden": "true"
707
+ }),
708
+ /* @__PURE__ */ jsxs("div", {
709
+ className: "min-w-0 flex-1 basis-48",
710
+ children: [/* @__PURE__ */ jsxs("div", {
711
+ className: "font-semibold text-foreground",
712
+ children: [
713
+ check.modelName ?? check.model,
714
+ " answered in ",
715
+ ((check.ms ?? 0) / 1e3).toFixed(1),
716
+ " s"
717
+ ]
718
+ }), /* @__PURE__ */ jsxs("div", {
719
+ className: "text-muted-foreground",
720
+ children: ["Tested ", ago(check.at, now)]
721
+ })]
722
+ }),
723
+ testButton("Test again")
724
+ ]
725
+ }) : state === "failing" && check?.failure ? /* @__PURE__ */ jsxs(FailureBox, {
726
+ failure: check.failure,
727
+ children: [
728
+ /* @__PURE__ */ jsxs("span", {
729
+ className: "mr-auto self-center text-xs text-muted-foreground",
730
+ children: ["Tried ", ago(check.at, now)]
731
+ }),
732
+ check.failure.kind === "credentials" && /* @__PURE__ */ jsx(Button, {
733
+ variant: "ghost",
734
+ onClick: signin ? () => void signIn() : onReconnect,
735
+ children: signin ? "Sign in again" : "Replace the key"
736
+ }),
737
+ testButton("Try again", true)
738
+ ]
739
+ }) : state === "incomplete" ? /* @__PURE__ */ jsxs("div", {
740
+ role: "status",
741
+ className: "flex flex-wrap items-center gap-3 rounded-2xl border border-warning/35 bg-warning/10 p-4 text-sm",
742
+ children: [/* @__PURE__ */ jsxs("div", {
743
+ className: "min-w-0 flex-1 basis-48",
744
+ children: [/* @__PURE__ */ jsx("div", {
745
+ className: "font-semibold text-foreground",
746
+ children: signin ? "Not signed in" : "Switched on, but its credentials are missing"
747
+ }), /* @__PURE__ */ jsx("div", {
748
+ className: "text-muted-foreground",
749
+ children: "Agents on its models are refused until it is connected again."
750
+ })]
751
+ }), /* @__PURE__ */ jsx(Button, {
752
+ variant: "primary",
753
+ onClick: signin ? () => void signIn() : onReconnect,
754
+ children: signin ? "Sign in with ChatGPT" : "Connect"
755
+ })]
756
+ }) : state === "off" ? /* @__PURE__ */ jsxs("div", {
757
+ role: "status",
758
+ className: "flex flex-wrap items-center gap-3 rounded-2xl border border-border bg-muted/40 p-4 text-sm",
759
+ children: [/* @__PURE__ */ jsxs("div", {
760
+ className: "min-w-0 flex-1 basis-48",
761
+ children: [/* @__PURE__ */ jsx("div", {
762
+ className: "font-semibold text-foreground",
763
+ children: provider.models.length === 0 ? "Saved, not in use" : "Turned off"
764
+ }), /* @__PURE__ */ jsx("div", {
765
+ className: "text-muted-foreground",
766
+ children: provider.models.length === 0 ? "Connect it to choose its models and test it." : "Its models are out of Chat until you turn it on again. What is saved stays saved."
767
+ })]
768
+ }), provider.models.length === 0 ? /* @__PURE__ */ jsx(Button, {
769
+ variant: "primary",
770
+ disabled: busy !== null,
771
+ onClick: onReconnect,
772
+ children: "Connect"
773
+ }) : /* @__PURE__ */ jsx(Button, {
774
+ variant: "primary",
775
+ disabled: busy !== null || !provider.configured,
776
+ onClick: () => void setEnabled(true),
777
+ children: "Turn on"
778
+ })]
779
+ }) : /* @__PURE__ */ jsxs("div", {
780
+ role: "status",
781
+ className: "flex flex-wrap items-center gap-3 rounded-2xl border border-border bg-muted/40 p-4 text-sm",
782
+ children: [/* @__PURE__ */ jsxs("div", {
783
+ className: "min-w-0 flex-1 basis-48",
784
+ children: [/* @__PURE__ */ jsx("div", {
785
+ className: "font-semibold text-foreground",
786
+ children: "Not tested yet"
787
+ }), /* @__PURE__ */ jsx("div", {
788
+ className: "text-muted-foreground",
789
+ children: canTest ? "A test sends one short message to its cheapest model in Chat." : "It has no model in Chat, so there is nothing to ask."
790
+ })]
791
+ }), canTest && testButton("Test now", true)]
792
+ }),
793
+ error && /* @__PURE__ */ jsx("p", {
794
+ role: "alert",
795
+ className: "m-0 rounded-xl bg-danger/10 px-3 py-2 text-sm text-danger",
796
+ children: error
797
+ }),
798
+ /* @__PURE__ */ jsxs("section", {
799
+ "aria-label": "Credentials",
800
+ children: [/* @__PURE__ */ jsx("h3", {
801
+ className: HEADING,
802
+ children: signin ? "Sign-in" : provider.connect === "local" ? "Address" : "Credentials"
803
+ }), /* @__PURE__ */ jsxs("div", {
804
+ className: "mt-2 flex flex-wrap items-center gap-3",
805
+ children: [/* @__PURE__ */ jsx("div", {
806
+ className: "min-w-0 flex-1 basis-56 text-sm",
807
+ children: signin ? provider.configured ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
808
+ "Signed in with your ChatGPT account",
809
+ provider.account && /* @__PURE__ */ jsxs("span", {
810
+ className: "text-muted-foreground",
811
+ children: [
812
+ " (",
813
+ provider.account,
814
+ ")"
815
+ ]
816
+ }),
817
+ ". Bazilion renews the sign-in by itself."
818
+ ] }) : "Not signed in." : mainFields.length === 0 ? /* @__PURE__ */ jsx("span", {
819
+ className: "text-muted-foreground",
820
+ children: provider.configured ? "Read from the environment of the machine Bazilion runs on." : "Not found in the environment of the machine Bazilion runs on."
821
+ }) : /* @__PURE__ */ jsx("dl", {
822
+ className: "m-0 grid gap-1",
823
+ children: mainFields.map((field) => /* @__PURE__ */ jsxs("div", {
824
+ className: "flex flex-wrap gap-x-2",
825
+ children: [/* @__PURE__ */ jsx("dt", {
826
+ className: "text-muted-foreground",
827
+ children: field.label
828
+ }), /* @__PURE__ */ jsx("dd", {
829
+ className: "m-0 min-w-0 break-all font-mono text-[0.85em]",
830
+ children: field.kind === "secret" ? field.set ? `${field.preview ?? "saved"}, stored encrypted` : "not saved" : field.value || (provider.address ?? "not set")
831
+ })]
832
+ }, field.envVar))
833
+ })
834
+ }), signin ? /* @__PURE__ */ jsx(Button, {
835
+ variant: "ghost",
836
+ disabled: busy !== null,
837
+ onClick: () => void signIn(),
838
+ children: provider.configured ? "Sign in again" : "Sign in with ChatGPT"
839
+ }) : mainFields.length > 0 && /* @__PURE__ */ jsx(Button, {
840
+ variant: "ghost",
841
+ disabled: busy !== null,
842
+ onClick: onReconnect,
843
+ children: provider.connect === "local" ? "Change the address" : mainFields.some((field) => field.kind === "secret" && !field.set) ? "Add the key" : "Replace the key"
844
+ })]
845
+ })]
846
+ }),
847
+ /* @__PURE__ */ jsxs("section", {
848
+ "aria-label": "Its models in Chat",
849
+ children: [
850
+ /* @__PURE__ */ jsxs("div", {
851
+ className: "flex items-center gap-3",
852
+ children: [/* @__PURE__ */ jsx("h3", {
853
+ className: `${HEADING} flex-1`,
854
+ children: "Its models in Chat"
855
+ }), /* @__PURE__ */ jsx("button", {
856
+ type: "button",
857
+ onClick: onPickModels,
858
+ className: "text-sm font-semibold text-primary",
859
+ children: "Choose models"
860
+ })]
861
+ }),
862
+ /* @__PURE__ */ jsxs("ul", {
863
+ className: "m-0 mt-2 list-none divide-y divide-border overflow-hidden rounded-xl border border-border p-0",
864
+ children: [provider.models.length === 0 && /* @__PURE__ */ jsx("li", {
865
+ className: "px-3 py-2.5 text-sm text-muted-foreground",
866
+ children: "None of its models is in Chat."
867
+ }), provider.models.map((id) => {
868
+ const model = chat.find((entry) => entry.id === id);
869
+ return /* @__PURE__ */ jsxs("li", {
870
+ className: "flex flex-wrap items-center gap-x-3 px-3 py-2.5 text-sm",
871
+ children: [/* @__PURE__ */ jsx("span", {
872
+ className: "min-w-0 flex-1 basis-40 font-semibold text-foreground",
873
+ children: model ? modelName(model) : id
874
+ }), /* @__PURE__ */ jsx("span", {
875
+ className: "text-muted-foreground",
876
+ children: model ? usedByLine(model.usedBy) : "Out of Chat while this is turned off"
877
+ })]
878
+ }, id);
879
+ })]
880
+ }),
881
+ imageRoutes.length > 0 && /* @__PURE__ */ jsx("p", {
882
+ className: "m-0 mt-2 text-sm text-muted-foreground",
883
+ children: drawing ? `Images are drawn by ${drawing.model} through this provider.` : `Can also draw images: ${[...new Set(imageRoutes.map((route) => route.model))].join(", ")}.`
884
+ })
885
+ ]
886
+ }),
887
+ /* @__PURE__ */ jsxs("section", {
888
+ "aria-label": "More settings",
889
+ children: [/* @__PURE__ */ jsxs("button", {
890
+ type: "button",
891
+ "aria-expanded": showMore,
892
+ onClick: () => setShowMore((open) => !open),
893
+ className: "flex items-center gap-1.5 text-sm font-semibold text-foreground",
894
+ children: [/* @__PURE__ */ jsx(ChevronRight, {
895
+ className: `size-4 text-muted-foreground transition-transform ${showMore ? "rotate-90" : ""}`,
896
+ "aria-hidden": "true"
897
+ }), "More settings"]
898
+ }), showMore && /* @__PURE__ */ jsxs("div", {
899
+ className: "mt-2 grid gap-3 rounded-xl border border-border bg-muted/40 p-4",
900
+ children: [
901
+ /* @__PURE__ */ jsxs("div", {
902
+ className: "flex items-center gap-3",
903
+ children: [/* @__PURE__ */ jsxs("div", {
904
+ className: "min-w-0 flex-1 text-sm",
905
+ children: [/* @__PURE__ */ jsx("div", {
906
+ className: "font-semibold text-foreground",
907
+ children: "Agents may use this provider"
908
+ }), /* @__PURE__ */ jsx("div", {
909
+ className: "text-muted-foreground",
910
+ children: "Turn off to pause it without removing what is saved."
911
+ })]
912
+ }), /* @__PURE__ */ jsx(Switch, {
913
+ checked: provider.enabled,
914
+ label: "Agents may use this provider",
915
+ disabled: busy !== null || !provider.enabled && !provider.configured,
916
+ onChange: (enabled) => void setEnabled(enabled)
917
+ })]
918
+ }),
919
+ advancedFields.map((field) => /* @__PURE__ */ jsx(FieldRow, { field }, field.envVar)),
920
+ provider.fields.length > 0 && /* @__PURE__ */ jsxs("p", {
921
+ className: "m-0 text-xs text-muted-foreground",
922
+ children: [
923
+ "Setting names, for ",
924
+ /* @__PURE__ */ jsx("code", { children: "bazilion config set" }),
925
+ " and the daemon’s environment:",
926
+ " ",
927
+ provider.fields.map((field) => field.envVar).join(", "),
928
+ ". A value set in the environment wins over the one saved here."
929
+ ]
930
+ })
931
+ ]
932
+ })]
933
+ }),
934
+ /* @__PURE__ */ jsxs("section", {
935
+ "aria-label": "Disconnect",
936
+ className: "border-t border-frost pt-4",
937
+ children: [/* @__PURE__ */ jsxs(Button, {
938
+ variant: "danger",
939
+ disabled: busy !== null,
940
+ onClick: () => setConfirmDisconnect(true),
941
+ children: ["Disconnect ", provider.displayName]
942
+ }), /* @__PURE__ */ jsxs("p", {
943
+ className: "m-0 mt-2 text-sm text-muted-foreground",
944
+ children: [
945
+ "Removes",
946
+ " ",
947
+ signin ? "the sign-in" : provider.connect === "local" ? "the address" : "the key",
948
+ ", its models from Chat and its test."
949
+ ]
950
+ })]
951
+ }),
952
+ /* @__PURE__ */ jsx(ConfirmDialog, {
953
+ open: confirmDisconnect,
954
+ onOpenChange: setConfirmDisconnect,
955
+ title: `Disconnect ${provider.displayName}?`,
956
+ description: /* @__PURE__ */ jsxs(Fragment$1, { children: [
957
+ /* @__PURE__ */ jsxs("p", {
958
+ className: "m-0",
959
+ children: [
960
+ "This removes",
961
+ " ",
962
+ signin ? "the saved ChatGPT sign-in" : provider.connect === "local" ? "the saved address" : "the saved credentials",
963
+ " ",
964
+ "and takes its ",
965
+ provider.models.length === 1 ? "model" : "models",
966
+ " out of Chat."
967
+ ]
968
+ }),
969
+ agents > 0 && /* @__PURE__ */ jsxs("p", {
970
+ className: "m-0 mt-2",
971
+ children: [agents === 1 ? "1 Agent runs" : `${agents} Agents run`, " on its models and will be refused until given another model. Agent templates move to another model by themselves."]
972
+ }),
973
+ drawing && /* @__PURE__ */ jsx("p", {
974
+ className: "m-0 mt-2",
975
+ children: "Image generation stops until another route is chosen."
976
+ })
977
+ ] }),
978
+ confirmLabel: `Disconnect ${provider.displayName}`,
979
+ onConfirm: disconnect
980
+ })
981
+ ]
982
+ });
983
+ }
984
+ //#endregion
985
+ //#region src/routes/config/index.tsx?tsr-split=component
986
+ function ModelsPage() {
987
+ const { providers, models, now } = Route.useLoaderData();
988
+ const search = Route.useSearch();
989
+ const navigate = Route.useNavigate();
990
+ const router = useRouter();
991
+ const [testing, setTesting] = useState(false);
992
+ const listed = providers.filter((provider) => provider.listed);
993
+ const usable = listed.filter((provider) => provider.enabled);
994
+ const open = (next) => void navigate({ search: next });
995
+ const close = () => open({});
996
+ const reload = () => router.invalidate({ sync: true });
997
+ const sheet = providers.find((provider) => provider.id === search.provider && provider.listed);
998
+ async function testAll() {
999
+ setTesting(true);
1000
+ try {
1001
+ await Promise.all(usable.filter((provider) => provider.models.length > 0).map((provider) => api(`/api/config/providers/${encodeURIComponent(provider.id)}/test`, { method: "POST" }).catch(() => void 0)));
1002
+ await reload();
1003
+ } finally {
1004
+ setTesting(false);
1005
+ }
1006
+ }
1007
+ return /* @__PURE__ */ jsxs(ConfigPage, {
1008
+ title: "Models",
1009
+ description: "What your Agents think and draw with, and the accounts behind it.",
1010
+ children: [
1011
+ /* @__PURE__ */ jsx(StatusLine, {
1012
+ providers: listed,
1013
+ chat: models.chat,
1014
+ now,
1015
+ testing,
1016
+ onOpen: (id) => open({ provider: id }),
1017
+ onTestAll: () => void testAll()
1018
+ }),
1019
+ /* @__PURE__ */ jsx(ChatModelsCard, {
1020
+ chat: models.chat,
1021
+ hasProviders: usable.length > 0,
1022
+ onPick: () => open({ pick: true }),
1023
+ onChanged: reload
1024
+ }),
1025
+ /* @__PURE__ */ jsx(ImagesCard, {
1026
+ images: models.images,
1027
+ onConnect: (id) => open({ add: id }),
1028
+ onChanged: reload
1029
+ }),
1030
+ /* @__PURE__ */ jsx(ProvidersCard, {
1031
+ providers: listed,
1032
+ total: providers.length,
1033
+ images: models.images,
1034
+ now,
1035
+ onOpen: (id) => open({ provider: id }),
1036
+ onAdd: () => open({ add: "new" })
1037
+ }),
1038
+ search.add && /* @__PURE__ */ jsx(AddProviderDialog, {
1039
+ providers,
1040
+ imageRoutes: models.images.routes,
1041
+ start: search.add === "new" ? void 0 : search.add,
1042
+ onClose: close,
1043
+ onConnected: reload,
1044
+ onOpenProvider: (id) => open({ provider: id })
1045
+ }, search.add),
1046
+ search.pick && /* @__PURE__ */ jsx(ModelPicker, {
1047
+ providers: usable,
1048
+ chat: models.chat,
1049
+ onClose: close,
1050
+ onSaved: reload,
1051
+ onAddProvider: () => open({ add: "new" })
1052
+ }),
1053
+ sheet && /* @__PURE__ */ jsx(ProviderSheet, {
1054
+ provider: sheet,
1055
+ chat: models.chat.filter((model) => model.provider === sheet.id),
1056
+ imageRoutes: models.images.routes.filter((route) => route.provider === sheet.id),
1057
+ imageSelected: models.images.selected,
1058
+ onClose: close,
1059
+ onChanged: reload,
1060
+ onPickModels: () => open({ pick: true }),
1061
+ onReconnect: () => open({ add: sheet.id })
1062
+ }, sheet.id)
1063
+ ]
1064
+ });
1065
+ }
1066
+ //#endregion
1067
+ export { ModelsPage as component };