bazilion 0.55.0 → 0.57.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 (193) hide show
  1. package/dist/cli.js +193 -37
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +1821 -788
  4. package/dist/daemon.js.map +1 -1
  5. package/dist/web/client/assets/AddProviderDialog-DwUu2FGE.js +1 -0
  6. package/dist/web/client/assets/AgentTemplateParts-C3BasVck.js +1 -0
  7. package/dist/web/client/assets/{Button-bTJUy9Qf.js → Button-CoKQRO-s.js} +1 -1
  8. package/dist/web/client/assets/ConfigPage-DFmHgEaL.js +1 -0
  9. package/dist/web/client/assets/ConfirmDialog-BCOfW63x.js +1 -0
  10. package/dist/web/client/assets/ConnectionsView-BbpY5YbI.js +1 -0
  11. package/dist/web/client/assets/ManagePage-BzyMHGqs.js +1 -0
  12. package/dist/web/client/assets/SectionTabs-C8H_LunZ.js +1 -0
  13. package/dist/web/client/assets/{Segmented-oPkAHPO1.js → Segmented-iylzLwE6.js} +1 -1
  14. package/dist/web/client/assets/SkillsParts-DoygBgF2.js +1 -0
  15. package/dist/web/client/assets/SpawnTeamModal-BVf4yN9X.js +1 -0
  16. package/dist/web/client/assets/TeamForm-Bfb5hVUX.js +1 -0
  17. package/dist/web/client/assets/TeamThread-BFmaBj82.js +1 -0
  18. package/dist/web/client/assets/UnsavedChangesGuard-BUsIHSxO.js +1 -0
  19. package/dist/web/client/assets/_id-BRD3kxrX.js +1 -0
  20. package/dist/web/client/assets/_id-BapVoTMJ.js +1 -0
  21. package/dist/web/client/assets/access-CqcKius1.js +1 -0
  22. package/dist/web/client/assets/{agent-actions-CUee6aJq.js → agent-actions-B-9KIwn6.js} +1 -1
  23. package/dist/web/client/assets/agents-BC_ITk28.js +1 -0
  24. package/dist/web/client/assets/agents-DQ8nQnD6.js +1 -0
  25. package/dist/web/client/assets/arrow-right-BqqfPqVi.js +1 -0
  26. package/dist/web/client/assets/attention-BnCihfi0.js +1 -0
  27. package/dist/web/client/assets/{bot-BCone8es.js → bot-BHky7KAX.js} +1 -1
  28. package/dist/web/client/assets/chart-column-DTsDbzL0.js +1 -0
  29. package/dist/web/client/assets/chevron-right-D1shxvdo.js +1 -0
  30. package/dist/web/client/assets/config-DYS8bkQl.js +1 -0
  31. package/dist/web/client/assets/{createLucideIcon-jxSFpY0Q.js → createLucideIcon-CZHSSDYA.js} +1 -1
  32. package/dist/web/client/assets/{download-Dy88XavQ.js → download-Dr0PgyMr.js} +1 -1
  33. package/dist/web/client/assets/es2015-DZDOQ3kj.js +41 -0
  34. package/dist/web/client/assets/{file-text-DPsZ8-h9.js → file-text-D6OTHixJ.js} +1 -1
  35. package/dist/web/client/assets/{images-QBh_rL8b.js → images-BULrW-FC.js} +1 -1
  36. package/dist/web/client/assets/index-CxXsZzDC.js +14 -0
  37. package/dist/web/client/assets/{key-round-C-I8fAG0.js → key-round-DmSZN0Kq.js} +1 -1
  38. package/dist/web/client/assets/{list-checks-C9Q-bjEi.js → list-checks-DdTdAQXS.js} +1 -1
  39. package/dist/web/client/assets/login-DFVsVP0s.js +1 -0
  40. package/dist/web/client/assets/{manage-BaIU5zKy.js → manage-CpXaObuS.js} +1 -1
  41. package/dist/web/client/assets/mcp-DslGDHmN.js +1 -0
  42. package/dist/web/client/assets/{message-square-Bwf9cHOx.js → message-square-B_pULba_.js} +1 -1
  43. package/dist/web/client/assets/{network-B3FA93gC.js → network-BqmVqC4_.js} +1 -1
  44. package/dist/web/client/assets/parts-C104qEuC.js +1 -0
  45. package/dist/web/client/assets/plus-CEKaHPBw.js +1 -0
  46. package/dist/web/client/assets/preload-helper-CZOd_z6l.js +1 -0
  47. package/dist/web/client/assets/routes-D1wFPm0n.js +85 -0
  48. package/dist/web/client/assets/skills-DmIo3vN3.js +1 -0
  49. package/dist/web/client/assets/{square-terminal-DaNLwvEs.js → square-terminal-CYfGBHPC.js} +1 -1
  50. package/dist/web/client/assets/style-CqkCFvvz.js +7 -0
  51. package/dist/web/client/assets/styles-C7NsCHeU.css +2 -0
  52. package/dist/web/client/assets/{system-CrTSr5_t.js → system-CUW9JZ9c.js} +1 -1
  53. package/dist/web/client/assets/teams-DJzYsuh9.js +1 -0
  54. package/dist/web/client/assets/teams-DrhG8KiS.js +1 -0
  55. package/dist/web/client/assets/telegram-Bk_kg8hb.js +1 -0
  56. package/dist/web/client/assets/tools-z9Ixmuu2.js +1 -0
  57. package/dist/web/client/assets/usage-DGe3x1m7.js +1 -0
  58. package/dist/web/client/assets/use-resource-qjIkNQDY.js +1 -0
  59. package/dist/web/client/assets/{users-round-BElBVSnw.js → users-round-cxQ5HF-C.js} +1 -1
  60. package/dist/web/client/assets/welcome-DDKqxHkF.js +1 -0
  61. package/dist/web/client/assets/{wrench-DotqSqSm.js → wrench-BLEJjETg.js} +1 -1
  62. package/dist/web/server/assets/{AddProviderDialog-BbpuvC2a.js → AddProviderDialog-CpLDHOcA.js} +6 -3
  63. package/dist/web/server/assets/AgentAvatar-8gTAy_tP.js +37 -0
  64. package/dist/web/server/assets/{AgentTemplateParts-Ce7snK3m.js → AgentTemplateParts-Dh9F_-T_.js} +7 -3
  65. package/dist/web/server/assets/Button-Dsnw22OF.js +17 -0
  66. package/dist/web/server/assets/{ConfigPage-qP9ejjuw.js → ConfigPage-CrxctbtN.js} +2 -2
  67. package/dist/web/server/assets/{ConfirmDialog-Z-uYbE9B.js → ConfirmDialog-C89B8qKM.js} +3 -1
  68. package/dist/web/server/assets/{ConnectionsView-CLIV7V5D.js → ConnectionsView-DslcKQmA.js} +9 -7
  69. package/dist/web/server/assets/Dialog-_Gt_Nt86.js +85 -0
  70. package/dist/web/server/assets/{ManagePage-BR9FwVZM.js → ManagePage-DGYNJ6XG.js} +2 -2
  71. package/dist/web/server/assets/{ModelMenu-D-hTgYOO.js → ModelMenu-DEJoYASj.js} +13 -1
  72. package/dist/web/server/assets/{SectionTabs-CWQ5orUW.js → SectionTabs--vMBvaUz.js} +9 -2
  73. package/dist/web/server/assets/{SkillsParts-DWpdydCJ.js → SkillsParts-CqS2B45v.js} +7 -3
  74. package/dist/web/server/assets/SpawnDialog-BNKj2Lup.js +127 -0
  75. package/dist/web/server/assets/{SpawnTeamModal-C-YMvoaB.js → SpawnTeamModal-zcLxtFOO.js} +6 -2
  76. package/dist/web/server/assets/{TeamForm-CL45gBdt.js → TeamForm-XFP0l2TB.js} +11 -5
  77. package/dist/web/server/assets/{TeamThread-CVVH6kKj.js → TeamThread-gYV_ToRM.js} +59 -12
  78. package/dist/web/server/assets/{UnsavedChangesGuard-CXK75QQp.js → UnsavedChangesGuard-CB_TugFF.js} +1 -1
  79. package/dist/web/server/assets/{_id-d2OwovYV.js → _id-517adSuB.js} +2 -2
  80. package/dist/web/server/assets/{_id-BKzOw78O.js → _id-BTyd2i5U.js} +1 -1
  81. package/dist/web/server/assets/{_id-8zsImuGa.js → _id-BsQnL9LV.js} +14 -9
  82. package/dist/web/server/assets/{_id-2I4CSMQj.js → _id-CyinHJam.js} +17 -11
  83. package/dist/web/server/assets/{_id-De3Bm0SG.js → _id-D4RFNqaJ.js} +2 -2
  84. package/dist/web/server/assets/{_id-BpfoPuTv.js → _id-josYXBx3.js} +2 -2
  85. package/dist/web/server/assets/_tanstack-start-manifest_v-w2xn07aY.js +275 -0
  86. package/dist/web/server/assets/{access-WWspT0v4.js → access-B97-94Wt.js} +1 -1
  87. package/dist/web/server/assets/{access-CyUoElTP.js → access-BdQmjMJV.js} +2 -2
  88. package/dist/web/server/assets/{access-CwZ27Wsl.js → access-Cc7fMMod.js} +7 -4
  89. package/dist/web/server/assets/activity-Czfq-5_F.js +471 -0
  90. package/dist/web/server/assets/{agent-actions-C07Cp5Ue.js → agent-actions-ChH7Mne4.js} +1 -1
  91. package/dist/web/server/assets/{agents-DCWEoaxY.js → agents-BL918wVc.js} +2 -2
  92. package/dist/web/server/assets/{agents-vuXrAv1j.js → agents-BlUZqqJn.js} +14 -8
  93. package/dist/web/server/assets/{agents-CRtMfKqX.js → agents-BzJFjA2i.js} +2 -2
  94. package/dist/web/server/assets/{agents-CwzhpDPm.js → agents-CjrkaEz8.js} +11 -8
  95. package/dist/web/server/assets/{agents-DQowl6Ly.js → agents-Tg3zkmQv.js} +2 -2
  96. package/dist/web/server/assets/{agents-DTub-rJk.js → agents-uw32jPWx.js} +2 -2
  97. package/dist/web/server/assets/{attention-Dki8rmGZ.js → attention-2unmuO-q.js} +1 -1
  98. package/dist/web/server/assets/{attention-BqCnJ1hg.js → attention-C94WWwQe.js} +2 -2
  99. package/dist/web/server/assets/{attention-DwGaur_w.js → attention-a_OmC6L3.js} +9 -7
  100. package/dist/web/server/assets/{auth-dJnrFW6y.js → auth-DuIqEAed.js} +1 -1
  101. package/dist/web/server/assets/{config-B9dJiji_.js → config-BG1KOtwA.js} +2 -2
  102. package/dist/web/server/assets/{config-D3MR2VjE.js → config-Bhem9XER.js} +10 -7
  103. package/dist/web/server/assets/{config-X7qWbbpH.js → config-D1Li_7Yt2.js} +1 -1
  104. package/dist/web/server/assets/createSsrRpc-6LHNEsSK.js +16 -0
  105. package/dist/web/server/assets/{daemon-client-B_ZRIIrT.js → daemon-client-D-NWKQto.js} +1 -1
  106. package/dist/web/server/assets/form-Bwsyt9OY.js +416 -0
  107. package/dist/web/server/assets/live-DbJeq6KP.js +263 -0
  108. package/dist/web/server/assets/{login-CRd1yTH5.js → login-BJdJ219n.js} +1 -1
  109. package/dist/web/server/assets/{login-ZN6KV8n-.js → login-C4lL4AxI.js} +2 -2
  110. package/dist/web/server/assets/{manage-Ce6cI4eW.js → manage-C7ReF2ZZ.js} +3 -2
  111. package/dist/web/server/assets/{mcp-CYQuYWGX.js → mcp-BFixpBQk.js} +2 -2
  112. package/dist/web/server/assets/{mcp-BQ15a9dG.js → mcp-BTZkDvdc.js} +7 -4
  113. package/dist/web/server/assets/{mcp-C97uAZe1.js → mcp-Ceg9gzKE.js} +1 -1
  114. package/dist/web/server/assets/open-groups-C89TEK85.js +12 -0
  115. package/dist/web/server/assets/{page-title-CVY-c2Pd.js → page-title-PTpFHXWo.js} +1 -1
  116. package/dist/web/server/assets/parts-B0wbj_yK.js +436 -0
  117. package/dist/web/server/assets/{router-CPdWGKQ5.js → router-Ci_9VxDk.js} +244 -104
  118. package/dist/web/server/assets/{routes-BPloBDc8.js → routes-CVrH9qgo.js} +3 -3
  119. package/dist/web/server/assets/{routes-Dw1K3TQw.js → routes-D9Mw1_VV.js} +1453 -403
  120. package/dist/web/server/assets/{routes-xDPesCQu.js → routes-DsuaDPTO.js} +3 -3
  121. package/dist/web/server/assets/{skills-DWzlT_hC.js → skills-BNbZ75am.js} +1 -1
  122. package/dist/web/server/assets/{skills-6VSpEORe.js → skills-BWwEFc4a.js} +2 -2
  123. package/dist/web/server/assets/{skills-D0xrNc2_.js → skills-D5rnOmKJ.js} +9 -7
  124. package/dist/web/server/assets/src-BeMh8Fze.js +113 -0
  125. package/dist/web/server/assets/{start-DhW7sy23.js → start-2MvkBRdC.js} +1 -1
  126. package/dist/web/server/assets/{style-aMybyKzc.js → style-B3l0Wtlf.js} +1 -1
  127. package/dist/web/server/assets/{system-B5sPgdQW.js → system-Cr4C-YRw.js} +2 -2
  128. package/dist/web/server/assets/{system-CXmiWyDG.js → system-DT7AU0e6.js} +3 -3
  129. package/dist/web/server/assets/{system-D3th6n2E.js → system-DsmXkgqn.js} +1 -1
  130. package/dist/web/server/assets/{teams-ClRBVSYU.js → teams-BeStcDvQ.js} +2 -2
  131. package/dist/web/server/assets/{teams-yF3I_Zjq.js → teams-CsEBLW8-.js} +14 -8
  132. package/dist/web/server/assets/{teams-Dq4RCxis.js → teams-Dix5XVIx.js} +2 -2
  133. package/dist/web/server/assets/{teams-iXiCnN2i.js → teams-DjE0swAZ.js} +10 -6
  134. package/dist/web/server/assets/{teams-70u1XQTr.js → teams-Rk_RED7X.js} +1 -1
  135. package/dist/web/server/assets/{teams-BopOP4x7.js → teams-u6m6JzuU.js} +1 -1
  136. package/dist/web/server/assets/{telegram-DwEgyR1x.js → telegram-BjqABrl-.js} +287 -273
  137. package/dist/web/server/assets/{telegram-CGol0CKX2.js → telegram-CQpF3EHA.js} +1 -1
  138. package/dist/web/server/assets/{telegram-D9U9c1MN.js → telegram-DhzHgDfg.js} +2 -2
  139. package/dist/web/server/assets/{tools-C-wwWjLI.js → tools-DC69leH7.js} +1 -1
  140. package/dist/web/server/assets/{tools-DflVIdDd.js → tools-Dn6RnOFu.js} +2 -2
  141. package/dist/web/server/assets/{tools-VPIKjr3y.js → tools-x_DQTQtE.js} +6 -4
  142. package/dist/web/server/assets/usage-4zMG0sab.js +465 -0
  143. package/dist/web/server/assets/usage-mvQegG4l.js +46 -0
  144. package/dist/web/server/assets/{use-resource-CbHGYti0.js → use-resource-BjN1uJoL.js} +10 -2
  145. package/dist/web/server/assets/{welcome-7DrYZVs6.js → welcome-BuE9FRf4.js} +2 -2
  146. package/dist/web/server/assets/{welcome-CxXMI4HI.js → welcome-DYw35wl5.js} +1 -1
  147. package/dist/web/server/assets/{welcome-966nOyyK.js → welcome-DrYbWGd_.js} +8 -6
  148. package/dist/web/server/assets/workspace-0XPILV1W.js +82 -0
  149. package/dist/web/server/server.js +20 -20
  150. package/dist/worker.js +143 -18
  151. package/dist/worker.js.map +1 -1
  152. package/package.json +1 -1
  153. package/dist/web/client/assets/AddProviderDialog-DfFOaCjC.js +0 -1
  154. package/dist/web/client/assets/AgentTemplateParts-IMJmAQjN.js +0 -1
  155. package/dist/web/client/assets/ConfigPage-CzLHZa5o.js +0 -1
  156. package/dist/web/client/assets/ConfirmDialog-Cu_evkgc.js +0 -1
  157. package/dist/web/client/assets/ConnectionsView-D7Fmutl2.js +0 -1
  158. package/dist/web/client/assets/ManagePage-BfvlCrmz.js +0 -1
  159. package/dist/web/client/assets/SectionTabs-D7kPQGoh.js +0 -1
  160. package/dist/web/client/assets/SkillsParts-BuTxcCam.js +0 -1
  161. package/dist/web/client/assets/SpawnTeamModal-B1UnOvtp.js +0 -1
  162. package/dist/web/client/assets/TeamForm-DbzxtRjj.js +0 -1
  163. package/dist/web/client/assets/TeamThread-jpsWq6vI.js +0 -1
  164. package/dist/web/client/assets/UnsavedChangesGuard-BfyU9v9i.js +0 -1
  165. package/dist/web/client/assets/_id-BCNBLF-2.js +0 -1
  166. package/dist/web/client/assets/_id-D8_H79U2.js +0 -1
  167. package/dist/web/client/assets/access-CDWe1Kwy.js +0 -1
  168. package/dist/web/client/assets/agents-sE686DTf.js +0 -1
  169. package/dist/web/client/assets/agents-yrur1NDa.js +0 -1
  170. package/dist/web/client/assets/arrow-right-U66krZnr.js +0 -1
  171. package/dist/web/client/assets/attention-DYEHDfmx.js +0 -1
  172. package/dist/web/client/assets/chevron-right-CuqJFXTe.js +0 -1
  173. package/dist/web/client/assets/config-BHv886pr.js +0 -1
  174. package/dist/web/client/assets/index-GOthyyE-.js +0 -14
  175. package/dist/web/client/assets/login-Dhe15Uuc.js +0 -1
  176. package/dist/web/client/assets/mcp-A_Eo7x3q.js +0 -1
  177. package/dist/web/client/assets/parts-CpIfn_BH.js +0 -41
  178. package/dist/web/client/assets/plus-CQPjc8uR.js +0 -1
  179. package/dist/web/client/assets/routes-CTg_yjbY.js +0 -85
  180. package/dist/web/client/assets/skills-CLjtYtkA.js +0 -1
  181. package/dist/web/client/assets/style-mjEbxhf5.js +0 -7
  182. package/dist/web/client/assets/styles-DzcEC3Rd.css +0 -2
  183. package/dist/web/client/assets/teams-Bhje5n2h.js +0 -1
  184. package/dist/web/client/assets/teams-Cbgw0Qhv.js +0 -1
  185. package/dist/web/client/assets/telegram-HtUczmaA.js +0 -1
  186. package/dist/web/client/assets/tools-BpjFvmoX.js +0 -1
  187. package/dist/web/client/assets/use-resource-BnvgCpBi.js +0 -1
  188. package/dist/web/client/assets/welcome-D47LKWYO.js +0 -1
  189. package/dist/web/server/assets/Rail-b6EbjBB-.js +0 -605
  190. package/dist/web/server/assets/SpawnDialog-3wNx0W1R.js +0 -1851
  191. package/dist/web/server/assets/_tanstack-start-manifest_v-kkY_s_uR.js +0 -256
  192. package/dist/web/server/assets/createSsrRpc-qesavJv-.js +0 -72
  193. package/dist/web/server/assets/public-origin-BpDkdS5Q.js +0 -34
@@ -1,11 +1,14 @@
1
- import { K as Button, M as SetupCard, N as Switch, P as Waiting, W as Dialog, dt as api, h as CARD_ROW, j as SearchField, m as Banner, pt as errorMessage, w as Chip } from "./SpawnDialog-3wNx0W1R.js";
2
- import { r as useResource } from "./use-resource-CbHGYti0.js";
3
- import { a as credentialLine, c as matchesModel, d as providerStatus, f as usedByLine, l as modelName, o as factsLine, r as ago, u as priceLine } from "./ModelMenu-D-hTgYOO.js";
4
- import { t as ConfirmDialog } from "./ConfirmDialog-Z-uYbE9B.js";
1
+ import { i as api, o as errorMessage } from "./live-DbJeq6KP.js";
2
+ import { r as useResource } from "./use-resource-BjN1uJoL.js";
3
+ import { t as Button } from "./Button-Dsnw22OF.js";
4
+ import { a as credentialLine, c as matchesModel, d as providerStatus, f as usedByLine, l as modelName, o as factsLine, r as ago, u as priceLine } from "./ModelMenu-DEJoYASj.js";
5
+ import { t as Dialog } from "./Dialog-_Gt_Nt86.js";
6
+ import { t as ConfirmDialog } from "./ConfirmDialog-C89B8qKM.js";
5
7
  import { t as Segmented } from "./Segmented-3ZLdqa5U.js";
6
- import { t as Route } from "./config-B9dJiji_.js";
7
- import { t as ConfigPage } from "./ConfigPage-qP9ejjuw.js";
8
- import { c as ProviderAvatar, l as StateChip, o as FailureBox, s as ModelRow, t as AddProviderDialog } from "./AddProviderDialog-BbpuvC2a.js";
8
+ import { b as Switch, d as Chip, n as CARD_ROW, t as Banner, v as SearchField, x as Waiting, y as SetupCard } from "./parts-B0wbj_yK.js";
9
+ import { t as Route } from "./config-BG1KOtwA.js";
10
+ import { t as ConfigPage } from "./ConfigPage-CrxctbtN.js";
11
+ import { c as ProviderAvatar, l as StateChip, o as FailureBox, s as ModelRow, t as AddProviderDialog } from "./AddProviderDialog-CpLDHOcA.js";
9
12
  import { useId, useMemo, useState } from "react";
10
13
  import { useRouter } from "@tanstack/react-router";
11
14
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
1
  import { n as createServerFn } from "../server.js";
2
2
  import { t as createServerRpc } from "./createServerRpc-B7Yr1K8i.js";
3
- import { n as daemonClient } from "./daemon-client-B_ZRIIrT.js";
3
+ import { n as daemonClient } from "./daemon-client-D-NWKQto.js";
4
4
  //#region src/routes/config/index.tsx?tss-serverfn-split
5
5
  var fetchModelsPage_createServerFn_handler = createServerRpc({
6
6
  id: "71b6b12251ac92cf4ee888c1d2b6eba3beaac079f9c39eaed95fafcd15908731",
@@ -0,0 +1,16 @@
1
+ import { i as getServerFnById, r as TSS_SERVER_FUNCTION } from "../server.js";
2
+ //#region ../../node_modules/.pnpm/@tanstack+start-server-core@1.169.17/node_modules/@tanstack/start-server-core/dist/esm/createSsrRpc.js
3
+ var createSsrRpc = (functionId) => {
4
+ const url = "/_serverFn/" + functionId;
5
+ const serverFnMeta = { id: functionId };
6
+ const fn = async (...args) => {
7
+ return (await getServerFnById(functionId, { origin: "server" }))(...args);
8
+ };
9
+ return Object.assign(fn, {
10
+ url,
11
+ serverFnMeta,
12
+ [TSS_SERVER_FUNCTION]: true
13
+ });
14
+ };
15
+ //#endregion
16
+ export { createSsrRpc as t };
@@ -1,5 +1,5 @@
1
1
  import { a as getCookie } from "../server.js";
2
- import { n as publicOriginConfig } from "./public-origin-BpDkdS5Q.js";
2
+ import { o as publicOriginConfig } from "./src-BeMh8Fze.js";
3
3
  //#region ../../packages/client/src/index.ts
4
4
  var ApiClientError = class extends Error {
5
5
  status;
@@ -0,0 +1,416 @@
1
+ import { t as Button } from "./Button-Dsnw22OF.js";
2
+ import { p as cn } from "./ModelMenu-DEJoYASj.js";
3
+ import { b as Switch } from "./parts-B0wbj_yK.js";
4
+ import { useId, useState } from "react";
5
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
6
+ import { Check, ChevronDown } from "lucide-react";
7
+ import { Select } from "radix-ui";
8
+ //#region src/components/ui/form.tsx
9
+ var LABEL = "m-0 text-sm font-semibold text-foreground";
10
+ var HINT = "mt-1 block text-xs text-muted-foreground";
11
+ /** What is wrong with a value, said under its field. */
12
+ function Problem({ children }) {
13
+ return /* @__PURE__ */ jsx("span", {
14
+ role: "alert",
15
+ className: "mt-1 block text-xs font-semibold text-warning",
16
+ children
17
+ });
18
+ }
19
+ /** A line of text to type: an address, an id, a name. Or a time of day. */
20
+ function TextField({ label, value, onChange, type = "text", placeholder, hint, problem, notes, invalid, disabled, required, mono = false, inputMode, className }) {
21
+ const id = useId();
22
+ return /* @__PURE__ */ jsxs("div", { children: [
23
+ /* @__PURE__ */ jsx("label", {
24
+ htmlFor: id,
25
+ className: LABEL,
26
+ children: label
27
+ }),
28
+ /* @__PURE__ */ jsx("input", {
29
+ id,
30
+ type,
31
+ value,
32
+ disabled,
33
+ required,
34
+ inputMode,
35
+ autoComplete: "off",
36
+ spellCheck: false,
37
+ placeholder: placeholder ?? "",
38
+ "aria-invalid": problem || invalid ? true : void 0,
39
+ onChange: (event) => onChange(event.target.value),
40
+ className: cn("mt-1.5 max-w-xl", mono && "font-mono", className)
41
+ }),
42
+ hint && /* @__PURE__ */ jsx("span", {
43
+ className: HINT,
44
+ children: hint
45
+ }),
46
+ notes,
47
+ problem && /* @__PURE__ */ jsx(Problem, { children: problem })
48
+ ] });
49
+ }
50
+ /** Several lines of text: a message, a note. */
51
+ function TextAreaField({ label, value, onChange, placeholder, hint, problem, rows = 4, mono = false, disabled, required }) {
52
+ const id = useId();
53
+ return /* @__PURE__ */ jsxs("div", { children: [
54
+ /* @__PURE__ */ jsx("label", {
55
+ htmlFor: id,
56
+ className: LABEL,
57
+ children: label
58
+ }),
59
+ /* @__PURE__ */ jsx("textarea", {
60
+ id,
61
+ value,
62
+ rows,
63
+ disabled,
64
+ required,
65
+ spellCheck: !mono,
66
+ placeholder: placeholder ?? "",
67
+ "aria-invalid": problem ? true : void 0,
68
+ onChange: (event) => onChange(event.target.value),
69
+ className: cn("mt-1.5 w-full", mono && "font-mono text-[0.9em]")
70
+ }),
71
+ hint && /* @__PURE__ */ jsx("span", {
72
+ className: HINT,
73
+ children: hint
74
+ }),
75
+ problem && /* @__PURE__ */ jsx(Problem, { children: problem })
76
+ ] });
77
+ }
78
+ /** A choice between a few options that each need a sentence: radio cards, two abreast. */
79
+ function ChoiceCards({ legend, name, value, options, onChange, disabled = false, notes, columns = 2 }) {
80
+ const id = useId();
81
+ return /* @__PURE__ */ jsxs("fieldset", {
82
+ className: "m-0 min-w-0 border-0 p-0",
83
+ disabled,
84
+ children: [
85
+ /* @__PURE__ */ jsx("legend", {
86
+ className: "mb-2 p-0 text-sm font-semibold text-foreground",
87
+ children: legend
88
+ }),
89
+ /* @__PURE__ */ jsx("div", {
90
+ className: cn("grid gap-2", columns === 3 ? "md:grid-cols-3" : "md:grid-cols-2"),
91
+ children: options.map((option, index) => {
92
+ const selected = option.value === value;
93
+ const titleId = `${id}-${index}`;
94
+ return /* @__PURE__ */ jsxs("label", {
95
+ className: cn("m-0 flex items-start gap-3 rounded-xl border px-3.5 py-3 transition-colors", disabled ? "cursor-default opacity-70" : "cursor-pointer", selected ? "border-primary/50 bg-accent/40" : "border-border bg-card hover:bg-muted/40"),
96
+ children: [/* @__PURE__ */ jsx("input", {
97
+ type: "radio",
98
+ name,
99
+ value: option.value,
100
+ checked: selected,
101
+ onChange: () => onChange(option.value),
102
+ "aria-labelledby": titleId,
103
+ "aria-describedby": `${titleId}-about`,
104
+ className: "mt-[3px] size-[18px] shrink-0 accent-[var(--color-sapphire)]"
105
+ }), /* @__PURE__ */ jsxs("span", {
106
+ className: "min-w-0",
107
+ children: [/* @__PURE__ */ jsx("span", {
108
+ id: titleId,
109
+ className: "block text-sm font-semibold text-foreground",
110
+ children: option.label
111
+ }), /* @__PURE__ */ jsxs("span", {
112
+ id: `${titleId}-about`,
113
+ className: "block",
114
+ children: [option.hint && /* @__PURE__ */ jsx("span", {
115
+ className: "block break-words text-sm text-muted-foreground",
116
+ children: option.hint
117
+ }), selected && option.note && /* @__PURE__ */ jsx("span", {
118
+ className: cn("mt-1 block break-words text-sm font-medium", option.note.tone === "ok" ? "text-success" : "text-warning"),
119
+ children: option.note.text
120
+ })]
121
+ })]
122
+ })]
123
+ }, option.value);
124
+ })
125
+ }),
126
+ notes
127
+ ]
128
+ });
129
+ }
130
+ var EMPTY = ":none";
131
+ var FIELD_TRIGGER = "flex min-h-[2.65rem] w-full items-center justify-between gap-2 rounded-[var(--radius-md)] border border-frost bg-[color-mix(in_srgb,var(--color-snow)_82%,var(--color-ivory))] px-[0.8rem] py-[0.5rem] text-left text-[0.95em] text-chocolate transition-all focus-visible:border-sapphire focus-visible:bg-snow focus-visible:shadow-[0_0_0_3px_var(--color-sapphire-glow)] disabled:cursor-not-allowed disabled:opacity-60 data-[state=open]:border-sapphire";
132
+ var FILTER_TRIGGER = "inline-flex min-h-9 w-auto max-w-full items-center gap-2 rounded-[12px] border border-border bg-card py-1 pl-2.5 pr-2 text-left text-xs font-semibold text-foreground transition-all hover:border-sapphire-light focus-visible:border-sapphire focus-visible:shadow-[0_0_0_3px_var(--color-sapphire-glow)] disabled:opacity-60 data-[state=open]:border-sapphire";
133
+ var ITEM = "relative flex cursor-pointer select-none items-baseline gap-x-3 rounded-lg py-2 pl-8 pr-3 text-sm outline-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground";
134
+ /**
135
+ * The app's one dropdown, drawn like the model menu: the choice in a field, the options in a list
136
+ * with a tick by the chosen one. The keyboard works as in any list (arrows, letters, Enter).
137
+ */
138
+ function SelectMenu({ value, options, onChange, disabled, id, labelledBy, ariaLabel, placeholder, compact = false, className }) {
139
+ const valueId = useId();
140
+ const chosen = options.find((option) => option.value === value);
141
+ return /* @__PURE__ */ jsxs(Select.Root, {
142
+ value: value === "" ? chosen ? EMPTY : "" : value,
143
+ onValueChange: (next) => onChange(next === EMPTY ? "" : next),
144
+ disabled,
145
+ children: [/* @__PURE__ */ jsxs(Select.Trigger, {
146
+ id,
147
+ "aria-label": ariaLabel,
148
+ "aria-labelledby": labelledBy ? `${labelledBy} ${valueId}` : void 0,
149
+ className: cn(compact ? FILTER_TRIGGER : FIELD_TRIGGER, className),
150
+ style: { outline: "none" },
151
+ children: [/* @__PURE__ */ jsx("span", {
152
+ id: valueId,
153
+ className: "min-w-0 flex-1 truncate",
154
+ children: chosen ? chosen.label : /* @__PURE__ */ jsx("span", {
155
+ className: "text-mocha-light",
156
+ children: placeholder ?? "Choose…"
157
+ })
158
+ }), /* @__PURE__ */ jsx(Select.Icon, {
159
+ asChild: true,
160
+ children: /* @__PURE__ */ jsx(ChevronDown, {
161
+ className: cn("shrink-0 text-mocha-light", compact ? "size-3.5" : "size-4"),
162
+ "aria-hidden": "true"
163
+ })
164
+ })]
165
+ }), /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsx(Select.Content, {
166
+ position: "popper",
167
+ sideOffset: 6,
168
+ className: "z-50 max-h-[min(24rem,var(--radix-select-content-available-height))] min-w-[max(var(--radix-select-trigger-width),12rem)] max-w-[calc(100vw-1.5rem)] overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-baziu-lg",
169
+ children: /* @__PURE__ */ jsx(Select.Viewport, {
170
+ className: "p-1.5",
171
+ children: options.map((option) => /* @__PURE__ */ jsxs(Select.Item, {
172
+ value: option.value === "" ? EMPTY : option.value,
173
+ className: ITEM,
174
+ style: { outline: "none" },
175
+ children: [
176
+ /* @__PURE__ */ jsx(Select.ItemIndicator, {
177
+ className: "absolute left-2.5 top-1/2 -translate-y-1/2",
178
+ children: /* @__PURE__ */ jsx(Check, {
179
+ className: "size-4 text-primary",
180
+ "aria-hidden": "true"
181
+ })
182
+ }),
183
+ /* @__PURE__ */ jsx(Select.ItemText, {
184
+ asChild: true,
185
+ children: /* @__PURE__ */ jsx("span", {
186
+ className: "min-w-0 flex-1 break-words font-semibold",
187
+ children: option.label
188
+ })
189
+ }),
190
+ option.hint && /* @__PURE__ */ jsx("span", {
191
+ className: "shrink-0 text-xs text-muted-foreground",
192
+ children: option.hint
193
+ })
194
+ ]
195
+ }, option.value))
196
+ })
197
+ }) })]
198
+ });
199
+ }
200
+ /** One of a few fixed choices, where a line of radio cards would be too much. */
201
+ function SelectField({ label, value, options, onChange, hint, disabled, placeholder, className }) {
202
+ const id = useId();
203
+ return /* @__PURE__ */ jsxs("div", { children: [
204
+ /* @__PURE__ */ jsx("label", {
205
+ id: `${id}-label`,
206
+ htmlFor: id,
207
+ className: LABEL,
208
+ children: label
209
+ }),
210
+ /* @__PURE__ */ jsx(SelectMenu, {
211
+ id,
212
+ labelledBy: `${id}-label`,
213
+ value,
214
+ options,
215
+ onChange,
216
+ disabled,
217
+ placeholder,
218
+ className: cn("mt-1.5 max-w-xl", className)
219
+ }),
220
+ hint && /* @__PURE__ */ jsx("span", {
221
+ className: HINT,
222
+ children: hint
223
+ })
224
+ ] });
225
+ }
226
+ /** A filter in a card's toolbar: a small dropdown named by its label, which is read, not shown. */
227
+ function FilterSelect({ label, value, options, onChange }) {
228
+ return /* @__PURE__ */ jsx(SelectMenu, {
229
+ compact: true,
230
+ ariaLabel: label,
231
+ value,
232
+ options,
233
+ onChange
234
+ });
235
+ }
236
+ /**
237
+ * A key or token. A saved one is never shown or put back into a field: the row says that it is
238
+ * saved, and it is replaced or removed from there. Both wait for the form's Save.
239
+ */
240
+ function SecretField({ label, saved, preview, value, onChange, removed = false, onRemove, open = false, placeholder, hint, notes, disabled }) {
241
+ const id = useId();
242
+ const [replacing, setReplacing] = useState(false);
243
+ const [kept, setKept] = useState(false);
244
+ const [moved, setMoved] = useState(null);
245
+ const typing = !saved || replacing || open;
246
+ return /* @__PURE__ */ jsxs("div", { children: [
247
+ /* @__PURE__ */ jsx("label", {
248
+ id: `${id}-label`,
249
+ htmlFor: typing ? id : void 0,
250
+ className: LABEL,
251
+ children: label
252
+ }),
253
+ typing ? /* @__PURE__ */ jsxs("div", {
254
+ className: "mt-1.5 flex max-w-xl flex-wrap items-center gap-2",
255
+ children: [/* @__PURE__ */ jsx("input", {
256
+ id,
257
+ type: "password",
258
+ value,
259
+ disabled,
260
+ autoComplete: "off",
261
+ spellCheck: false,
262
+ placeholder: placeholder ?? "",
263
+ autoFocus: replacing,
264
+ onChange: (event) => onChange(event.target.value),
265
+ className: "min-w-0 flex-1 basis-56 font-mono"
266
+ }), saved && !open && /* @__PURE__ */ jsx(Button, {
267
+ variant: "ghost",
268
+ disabled,
269
+ onClick: () => {
270
+ onChange("");
271
+ setReplacing(false);
272
+ setKept(true);
273
+ },
274
+ children: "Keep the saved one"
275
+ })]
276
+ }) : /* @__PURE__ */ jsxs("div", {
277
+ role: "group",
278
+ "aria-labelledby": `${id}-label`,
279
+ className: "mt-1.5 flex min-h-[2.65rem] max-w-xl flex-wrap items-center gap-x-3 gap-y-2 rounded-xl border border-border bg-muted/40 px-3.5 py-1.5 text-sm",
280
+ children: [/* @__PURE__ */ jsx("span", {
281
+ className: "min-w-0 flex-1 basis-40 text-foreground",
282
+ children: removed ? "Will be removed when you save." : /* @__PURE__ */ jsxs(Fragment$1, { children: [
283
+ "Saved: ",
284
+ /* @__PURE__ */ jsx("span", {
285
+ className: "font-mono",
286
+ children: preview || "•••"
287
+ }),
288
+ ", stored encrypted"
289
+ ] })
290
+ }), removed ? /* @__PURE__ */ jsx(Button, {
291
+ variant: "ghost",
292
+ disabled,
293
+ autoFocus: moved === "keep",
294
+ onClick: () => {
295
+ setMoved("remove");
296
+ onRemove?.(false);
297
+ },
298
+ children: "Keep it"
299
+ }) : /* @__PURE__ */ jsxs("span", {
300
+ className: "flex gap-2",
301
+ children: [/* @__PURE__ */ jsx(Button, {
302
+ variant: "ghost",
303
+ disabled,
304
+ autoFocus: kept,
305
+ onClick: () => setReplacing(true),
306
+ children: "Replace"
307
+ }), onRemove && /* @__PURE__ */ jsx(Button, {
308
+ variant: "ghost",
309
+ disabled,
310
+ autoFocus: moved === "remove",
311
+ onClick: () => {
312
+ setMoved("keep");
313
+ onRemove(true);
314
+ },
315
+ children: "Remove"
316
+ })]
317
+ })]
318
+ }),
319
+ hint && /* @__PURE__ */ jsx("span", {
320
+ className: HINT,
321
+ children: hint
322
+ }),
323
+ notes
324
+ ] });
325
+ }
326
+ /** A yes/no setting: what it is on the left, the switch on the right. */
327
+ function SwitchRow({ label, description, notes, checked, disabled, onChange }) {
328
+ return /* @__PURE__ */ jsxs("div", {
329
+ className: "flex items-start justify-between gap-4",
330
+ children: [/* @__PURE__ */ jsxs("div", {
331
+ className: "min-w-0",
332
+ children: [
333
+ /* @__PURE__ */ jsx("div", {
334
+ className: "text-sm font-semibold text-foreground",
335
+ children: label
336
+ }),
337
+ description && /* @__PURE__ */ jsx("div", {
338
+ className: "text-sm text-muted-foreground",
339
+ children: description
340
+ }),
341
+ notes
342
+ ]
343
+ }), /* @__PURE__ */ jsx(Switch, {
344
+ label,
345
+ checked,
346
+ disabled,
347
+ onChange
348
+ })]
349
+ });
350
+ }
351
+ /** One of several things to tick. */
352
+ function CheckboxRow({ label, checked, disabled, onChange }) {
353
+ return /* @__PURE__ */ jsxs("label", {
354
+ className: "m-0 flex items-center gap-2.5 text-sm text-foreground",
355
+ children: [/* @__PURE__ */ jsx("input", {
356
+ type: "checkbox",
357
+ checked,
358
+ disabled,
359
+ onChange: (event) => onChange(event.target.checked),
360
+ className: "m-0 size-[18px] shrink-0"
361
+ }), label]
362
+ });
363
+ }
364
+ /**
365
+ * Where a form stands, in the words every Setup form uses: what was refused, what is not saved
366
+ * yet, what was just saved, or else what to know about saving it.
367
+ */
368
+ function saveStatus({ refused = false, error, dirty, saved, savedText = "Saved.", footnote = "" }) {
369
+ if (refused) return {
370
+ text: "Nothing was saved: see above.",
371
+ tone: "warning"
372
+ };
373
+ if (error) return {
374
+ text: `Nothing was saved: ${error}`,
375
+ tone: "warning"
376
+ };
377
+ if (dirty) return {
378
+ text: "Not saved yet.",
379
+ tone: "warning"
380
+ };
381
+ if (saved) return {
382
+ text: savedText,
383
+ tone: "success"
384
+ };
385
+ return {
386
+ text: footnote,
387
+ tone: "neutral"
388
+ };
389
+ }
390
+ var STATUS = {
391
+ success: "text-success",
392
+ warning: "text-warning",
393
+ neutral: "text-muted-foreground"
394
+ };
395
+ /** A form's last line: Save, and where things stand. */
396
+ function SaveBar({ busy, disabled, status, label = "Save", busyLabel = "Saving…", extra }) {
397
+ return /* @__PURE__ */ jsxs("div", {
398
+ className: "flex flex-wrap items-center gap-x-4 gap-y-2",
399
+ children: [
400
+ /* @__PURE__ */ jsx(Button, {
401
+ variant: "primary",
402
+ type: "submit",
403
+ disabled: disabled || busy,
404
+ children: busy ? busyLabel : label
405
+ }),
406
+ extra,
407
+ /* @__PURE__ */ jsx("p", {
408
+ role: "status",
409
+ className: cn("m-0 min-w-0 flex-1 basis-56 text-sm font-medium", STATUS[status.tone]),
410
+ children: status.text
411
+ })
412
+ ]
413
+ });
414
+ }
415
+ //#endregion
416
+ export { SaveBar as a, SelectMenu as c, TextField as d, saveStatus as f, Problem as i, SwitchRow as l, ChoiceCards as n, SecretField as o, FilterSelect as r, SelectField as s, CheckboxRow as t, TextAreaField as u };