bazilion 0.54.0 → 0.56.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 (188) hide show
  1. package/dist/cli.js +201 -41
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +1561 -522
  4. package/dist/daemon.js.map +1 -1
  5. package/dist/web/client/assets/AddProviderDialog-DZ9mXFdq.js +1 -0
  6. package/dist/web/client/assets/AgentTemplateParts-BfG3a-ri.js +1 -0
  7. package/dist/web/client/assets/{Button-UiegBKOK.js → Button-CoKQRO-s.js} +1 -1
  8. package/dist/web/client/assets/ConfigPage-Ch-DSJUO.js +1 -0
  9. package/dist/web/client/assets/ConfirmDialog-B_jXAPmh.js +1 -0
  10. package/dist/web/client/assets/ConnectionsView-D1Liebtf.js +1 -0
  11. package/dist/web/client/assets/ManagePage-kd7iWYEL.js +1 -0
  12. package/dist/web/client/assets/SectionTabs-Dc0bNn-J.js +1 -0
  13. package/dist/web/client/assets/{Segmented-MYKKTuZO.js → Segmented-iylzLwE6.js} +1 -1
  14. package/dist/web/client/assets/SkillsParts-C5T7sYDA.js +1 -0
  15. package/dist/web/client/assets/{SpawnTeamModal-DG5UbJNK.js → SpawnTeamModal-DatFF4f_.js} +1 -1
  16. package/dist/web/client/assets/{TeamForm-DGlxWv4e.js → TeamForm-l-N_PYeE.js} +1 -1
  17. package/dist/web/client/assets/TeamThread-BWmIQiAh.js +1 -0
  18. package/dist/web/client/assets/{UnsavedChangesGuard-BmdwLH99.js → UnsavedChangesGuard-vQBdMl8h.js} +1 -1
  19. package/dist/web/client/assets/_id-C6SADaiD.js +1 -0
  20. package/dist/web/client/assets/_id-CC9r0qsr.js +1 -0
  21. package/dist/web/client/assets/{access-C8d8vaQ6.js → access-BbQFbTPh.js} +1 -1
  22. package/dist/web/client/assets/{agent-actions-BgE9fKHH.js → agent-actions-B-9KIwn6.js} +1 -1
  23. package/dist/web/client/assets/agents-BXwzmHu8.js +1 -0
  24. package/dist/web/client/assets/agents-BtETzVIY.js +1 -0
  25. package/dist/web/client/assets/arrow-right-BqqfPqVi.js +1 -0
  26. package/dist/web/client/assets/attention-BMrZJ9ui.js +1 -0
  27. package/dist/web/client/assets/{bot-Bb--PFVU.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-B2ZDYo52.js +1 -0
  31. package/dist/web/client/assets/createLucideIcon-CZHSSDYA.js +1 -0
  32. package/dist/web/client/assets/{download-C4t9l5wR.js → download-Dr0PgyMr.js} +1 -1
  33. package/dist/web/client/assets/es2015-D1pnOGPG.js +41 -0
  34. package/dist/web/client/assets/{file-text-DzbjpYrV.js → file-text-D6OTHixJ.js} +1 -1
  35. package/dist/web/client/assets/{images-DSYgPKM7.js → images-BULrW-FC.js} +1 -1
  36. package/dist/web/client/assets/index-B-N6NIX4.js +14 -0
  37. package/dist/web/client/assets/{key-round-BpK4-E3T.js → key-round-DmSZN0Kq.js} +1 -1
  38. package/dist/web/client/assets/{list-checks-JNXcmws9.js → list-checks-DdTdAQXS.js} +1 -1
  39. package/dist/web/client/assets/login-DM3q-V4R.js +1 -0
  40. package/dist/web/client/assets/{manage-SRGSx8n2.js → manage-R57MUzsY.js} +1 -1
  41. package/dist/web/client/assets/{mcp-BUWu4TvS.js → mcp-CSHrVH1t.js} +1 -1
  42. package/dist/web/client/assets/{message-square-DM2MP9vF.js → message-square-B_pULba_.js} +1 -1
  43. package/dist/web/client/assets/{network-BJ4iPjQO.js → network-BqmVqC4_.js} +1 -1
  44. package/dist/web/client/assets/parts-68zf8Fgw.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-DOoeKVwr.js +85 -0
  48. package/dist/web/client/assets/skills-CPZftp9O.js +1 -0
  49. package/dist/web/client/assets/{square-terminal-Dmm6cV-G.js → square-terminal-CYfGBHPC.js} +1 -1
  50. package/dist/web/client/assets/{style-CA2GAk9b.js → style-Bm9QsFpy.js} +1 -1
  51. package/dist/web/client/assets/styles-B-kTTvCo.css +2 -0
  52. package/dist/web/client/assets/{system-zQ0NnQML.js → system-Dd2P9eqE.js} +1 -1
  53. package/dist/web/client/assets/teams-7FEpSZg1.js +1 -0
  54. package/dist/web/client/assets/teams-ClirFbDV.js +1 -0
  55. package/dist/web/client/assets/telegram-BJnT5THs.js +1 -0
  56. package/dist/web/client/assets/tools-DqNXLMpc.js +1 -0
  57. package/dist/web/client/assets/usage-BC_TStVj.js +1 -0
  58. package/dist/web/client/assets/{use-resource-CQaIZbpy.js → use-resource-Bn0Sx7r6.js} +1 -1
  59. package/dist/web/client/assets/{users-round-BJrym3FG.js → users-round-cxQ5HF-C.js} +1 -1
  60. package/dist/web/client/assets/welcome-g8wtn_or.js +1 -0
  61. package/dist/web/client/assets/{wrench-GbE1M1RJ.js → wrench-BLEJjETg.js} +1 -1
  62. package/dist/web/server/assets/{AddProviderDialog-Nc5mc_P6.js → AddProviderDialog-DtkjBMv4.js} +5 -2
  63. package/dist/web/server/assets/AgentAvatar-8gTAy_tP.js +37 -0
  64. package/dist/web/server/assets/{AgentTemplateParts-DZK_r3nQ.js → AgentTemplateParts-CxWyovvM.js} +6 -2
  65. package/dist/web/server/assets/Button-Dsnw22OF.js +17 -0
  66. package/dist/web/server/assets/{ConfigPage-CxzL-gTm.js → ConfigPage-usZi48Zr.js} +2 -2
  67. package/dist/web/server/assets/{ConfirmDialog-4xeCXKHe.js → ConfirmDialog-DAcSBHkT.js} +3 -1
  68. package/dist/web/server/assets/{ConnectionsView-B02FjNsM.js → ConnectionsView-Dy6uYSRI.js} +9 -7
  69. package/dist/web/server/assets/Dialog-DTeF-nOZ.js +85 -0
  70. package/dist/web/server/assets/{ManagePage-BfCWE8Lj.js → ManagePage-Dy1EdovO.js} +2 -2
  71. package/dist/web/server/assets/{SectionTabs-CWQ5orUW.js → SectionTabs-BVrMn76H.js} +2 -1
  72. package/dist/web/server/assets/{SkillsParts-D58l8voo.js → SkillsParts-Cw05b3al.js} +6 -2
  73. package/dist/web/server/assets/SpawnDialog-BAE8W91z.js +125 -0
  74. package/dist/web/server/assets/{SpawnTeamModal-RjzAeX_Q.js → SpawnTeamModal-CgBY0HuN.js} +6 -2
  75. package/dist/web/server/assets/{TeamForm-DdOgIMiV.js → TeamForm-JyO5xJXX.js} +6 -2
  76. package/dist/web/server/assets/{TeamThread-D-PvO3fu.js → TeamThread-5o48EbXL.js} +52 -4
  77. package/dist/web/server/assets/{UnsavedChangesGuard-Bb5frygQ.js → UnsavedChangesGuard-CJQGu45L.js} +1 -1
  78. package/dist/web/server/assets/{_id-C1_l6oSR.js → _id-BE_RSvuN.js} +14 -9
  79. package/dist/web/server/assets/{_id-CHvYQhWt.js → _id-BNvm89oJ.js} +2 -2
  80. package/dist/web/server/assets/{_id-De3Bm0SG.js → _id-BW6sVrvw.js} +1 -1
  81. package/dist/web/server/assets/{_id-BPjVkcNb.js → _id-BfjTS4JO.js} +15 -9
  82. package/dist/web/server/assets/{_id-BKzOw78O.js → _id-BpumuCYL.js} +1 -1
  83. package/dist/web/server/assets/{_id-BUfy-GwH.js → _id-C54t_nX6.js} +2 -2
  84. package/dist/web/server/assets/_tanstack-start-manifest_v-BPwQX_5b.js +275 -0
  85. package/dist/web/server/assets/{access-CNfvQ3NB.js → access-6FWih7nC.js} +7 -4
  86. package/dist/web/server/assets/{access-WWspT0v4.js → access-BhAMfi7U.js} +1 -1
  87. package/dist/web/server/assets/{access-Cm_izIIC.js → access-DEyq3uP_.js} +2 -2
  88. package/dist/web/server/assets/activity-Czfq-5_F.js +471 -0
  89. package/dist/web/server/assets/{agent-actions-COnfW5AU.js → agent-actions-ChH7Mne4.js} +1 -1
  90. package/dist/web/server/assets/{agents-CRtMfKqX.js → agents-3hBjrd8B.js} +1 -1
  91. package/dist/web/server/assets/{agents-NOkh61dV.js → agents-BXuglv4G.js} +12 -6
  92. package/dist/web/server/assets/{agents-C7UmTjfO.js → agents-DhenbitX.js} +2 -2
  93. package/dist/web/server/assets/{agents-D0hfGIMK.js → agents-KJcDMj0Y.js} +9 -6
  94. package/dist/web/server/assets/{agents-DzpqlIuJ.js → agents-ncyhVx-T.js} +2 -2
  95. package/dist/web/server/assets/{agents-DQowl6Ly.js → agents-rTDlRZa5.js} +1 -1
  96. package/dist/web/server/assets/{attention-Cx9ZWPOO.js → attention-CDdOCOio.js} +3 -2
  97. package/dist/web/server/assets/{attention-CRvxt22X.js → attention-DM__BzWY.js} +24 -9
  98. package/dist/web/server/assets/{attention-CgWhXjX7.js → attention-X0U6ZmiA.js} +2 -1
  99. package/dist/web/server/assets/{auth-dJnrFW6y.js → auth-BexhV8Yq.js} +1 -1
  100. package/dist/web/server/assets/{config-B5CS8juO.js → config-Cld8Q8N7.js} +2 -2
  101. package/dist/web/server/assets/{config-X7qWbbpH.js → config-Cx5ri2DL2.js} +1 -1
  102. package/dist/web/server/assets/{config-D117117T.js → config-DpgYAXQ3.js} +9 -6
  103. package/dist/web/server/assets/createSsrRpc-6LHNEsSK.js +16 -0
  104. package/dist/web/server/assets/{daemon-client-B_ZRIIrT.js → daemon-client-RxAllljf.js} +1 -1
  105. package/dist/web/server/assets/form-BEjeiSy3.js +416 -0
  106. package/dist/web/server/assets/live-DbJeq6KP.js +263 -0
  107. package/dist/web/server/assets/{login-va4EtvA8.js → login-BJdJ219n.js} +1 -1
  108. package/dist/web/server/assets/{login-IF0Gbsuq.js → login-C4lL4AxI.js} +2 -2
  109. package/dist/web/server/assets/{manage-Ce6cI4eW.js → manage-C6ucNYZW.js} +2 -1
  110. package/dist/web/server/assets/{mcp-C96PBxpb.js → mcp-BXnWQOwM.js} +7 -4
  111. package/dist/web/server/assets/{mcp-C97uAZe1.js → mcp-C8VLspco.js} +1 -1
  112. package/dist/web/server/assets/{mcp-Bm9U6x7N.js → mcp-DwCzj7eO.js} +2 -2
  113. package/dist/web/server/assets/open-groups-BMGYUTtY.js +12 -0
  114. package/dist/web/server/assets/{page-title-CwcbXMhx.js → page-title-PTpFHXWo.js} +6 -3
  115. package/dist/web/server/assets/parts-k9M-atPa.js +436 -0
  116. package/dist/web/server/assets/{router-8Iq19GOz.js → router-BttfLktO.js} +354 -114
  117. package/dist/web/server/assets/{routes-Kwam6JmS.js → routes-A7UcreVX.js} +9 -6
  118. package/dist/web/server/assets/{routes-BLo-fWbQ.js → routes-B9jw-MJ8.js} +1286 -331
  119. package/dist/web/server/assets/{routes-BXvYYFrN.js → routes-BX2FV8rS.js} +3 -3
  120. package/dist/web/server/assets/{skills-DSezIdDc.js → skills-BVAH93cd.js} +8 -6
  121. package/dist/web/server/assets/{skills-DWzlT_hC.js → skills-Cd5Cfdaz.js} +1 -1
  122. package/dist/web/server/assets/{skills-BqCnA-74.js → skills-y3GsyKce.js} +2 -2
  123. package/dist/web/server/assets/src-vrZVrV9u.js +103 -0
  124. package/dist/web/server/assets/{start-DhW7sy23.js → start-Dl8gQ-95.js} +1 -1
  125. package/dist/web/server/assets/{style-C2hIPY_Y.js → style-BQ3H9I7Y.js} +1 -1
  126. package/dist/web/server/assets/{system-CcLCmkIC.js → system-BJPKqM6b.js} +2 -2
  127. package/dist/web/server/assets/{system-E0VePdzO.js → system-C7mejQSc.js} +3 -3
  128. package/dist/web/server/assets/{system-D3th6n2E.js → system-LsLcuVzY.js} +1 -1
  129. package/dist/web/server/assets/{teams-CdCmBJIj.js → teams-B6gbflsZ.js} +10 -6
  130. package/dist/web/server/assets/{teams-CQVV18D3.js → teams-C7kXMNgc.js} +10 -6
  131. package/dist/web/server/assets/{teams-BopOP4x7.js → teams-CPXoTggb.js} +1 -1
  132. package/dist/web/server/assets/{teams-70u1XQTr.js → teams-CeLLd2Mf.js} +1 -1
  133. package/dist/web/server/assets/{teams-DScFp8mK.js → teams-CiX8LUQo.js} +2 -2
  134. package/dist/web/server/assets/{teams-DxA-vnzY.js → teams-D-XdIkCr.js} +2 -2
  135. package/dist/web/server/assets/{telegram-CGol0CKX2.js → telegram-D7TW3LNZ.js} +1 -1
  136. package/dist/web/server/assets/{telegram-DJ8s_91Y.js → telegram-D8_V7_sW.js} +286 -272
  137. package/dist/web/server/assets/{telegram-DR7xijeS.js → telegram-DA2dwLID.js} +2 -2
  138. package/dist/web/server/assets/{tools-V6kezUpL.js → tools-CckcG9Jl.js} +5 -3
  139. package/dist/web/server/assets/{tools-CsH9DI-4.js → tools-CluiJywK.js} +2 -2
  140. package/dist/web/server/assets/{tools-C-wwWjLI.js → tools-D1BBVkRh.js} +1 -1
  141. package/dist/web/server/assets/usage-CrYyvPgf.js +46 -0
  142. package/dist/web/server/assets/usage-PNNb3pPj.js +465 -0
  143. package/dist/web/server/assets/{use-resource-CjcJwn7F.js → use-resource-BUA9qGGY.js} +1 -1
  144. package/dist/web/server/assets/{welcome-CxXMI4HI.js → welcome-CUTYf8UG.js} +1 -1
  145. package/dist/web/server/assets/{welcome-Ya8TkL4v.js → welcome-CYhh3iUU.js} +8 -6
  146. package/dist/web/server/assets/{welcome-BpmcD-ia.js → welcome-CwzLt6Rp.js} +2 -2
  147. package/dist/web/server/assets/workspace-0XPILV1W.js +82 -0
  148. package/dist/web/server/server.js +20 -20
  149. package/dist/web-server.js +4 -0
  150. package/dist/web-server.js.map +1 -1
  151. package/dist/worker.js +40 -15
  152. package/dist/worker.js.map +1 -1
  153. package/package.json +4 -4
  154. package/dist/web/client/assets/AddProviderDialog-CkwSq3C7.js +0 -1
  155. package/dist/web/client/assets/AgentTemplateParts-CEn_4qVs.js +0 -1
  156. package/dist/web/client/assets/ConfigPage-CUbHBhzx.js +0 -1
  157. package/dist/web/client/assets/ConfirmDialog-VqBOFZEp.js +0 -1
  158. package/dist/web/client/assets/ConnectionsView-ByARMcWP.js +0 -1
  159. package/dist/web/client/assets/ManagePage-BJWZd1ts.js +0 -1
  160. package/dist/web/client/assets/SectionTabs-ViZKm3-B.js +0 -1
  161. package/dist/web/client/assets/SkillsParts-UvNK5SYP.js +0 -1
  162. package/dist/web/client/assets/TeamThread-mkwODO0S.js +0 -1
  163. package/dist/web/client/assets/_id-CvcxNmBH.js +0 -1
  164. package/dist/web/client/assets/_id-UyBk7gRl.js +0 -1
  165. package/dist/web/client/assets/agents-CgtzqBpD.js +0 -1
  166. package/dist/web/client/assets/agents-D7W4BT8r.js +0 -1
  167. package/dist/web/client/assets/arrow-right-D0HKRb7U.js +0 -1
  168. package/dist/web/client/assets/attention-D9mQWoKt.js +0 -1
  169. package/dist/web/client/assets/chevron-right-bs0TUSl2.js +0 -1
  170. package/dist/web/client/assets/config-Dw6GWf38.js +0 -1
  171. package/dist/web/client/assets/createLucideIcon-DkniuEtD.js +0 -1
  172. package/dist/web/client/assets/index-YW0gXPfk.js +0 -14
  173. package/dist/web/client/assets/login-DcQJk5-U.js +0 -1
  174. package/dist/web/client/assets/parts-LZxl9Gvc.js +0 -41
  175. package/dist/web/client/assets/plus-CLGNN5QX.js +0 -1
  176. package/dist/web/client/assets/routes-BxIIyGho.js +0 -85
  177. package/dist/web/client/assets/skills-C7DzIwFJ.js +0 -1
  178. package/dist/web/client/assets/styles-C3CDSGAr.css +0 -2
  179. package/dist/web/client/assets/teams-BEIJHObN.js +0 -1
  180. package/dist/web/client/assets/teams-DlOc7Ods.js +0 -1
  181. package/dist/web/client/assets/telegram-DKHq5DpE.js +0 -1
  182. package/dist/web/client/assets/tools-BKIpLaiC.js +0 -1
  183. package/dist/web/client/assets/welcome-CyS4Hrd-.js +0 -1
  184. package/dist/web/server/assets/Rail-3gbidhyv.js +0 -605
  185. package/dist/web/server/assets/SpawnDialog-MJWwppgC.js +0 -1648
  186. package/dist/web/server/assets/_tanstack-start-manifest_v-CR3jm1nY.js +0 -256
  187. package/dist/web/server/assets/createSsrRpc-CwTd0zrB.js +0 -72
  188. package/dist/web/server/assets/public-origin-BpDkdS5Q.js +0 -34
@@ -1,8 +1,8 @@
1
1
  import { n as createServerFn } from "../server.js";
2
- import { t as createSsrRpc } from "./createSsrRpc-CwTd0zrB.js";
2
+ import { t as createSsrRpc } from "./createSsrRpc-6LHNEsSK.js";
3
3
  import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
4
4
  //#region src/routes/config/index.tsx
5
- var $$splitComponentImporter = () => import("./config-D117117T.js");
5
+ var $$splitComponentImporter = () => import("./config-DpgYAXQ3.js");
6
6
  var fetchModelsPage = createServerFn({ method: "GET" }).handler(createSsrRpc("71b6b12251ac92cf4ee888c1d2b6eba3beaac079f9c39eaed95fafcd15908731"));
7
7
  var Route = createFileRoute("/config/")({
8
8
  validateSearch: (search) => ({
@@ -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-RxAllljf.js";
4
4
  //#region src/routes/config/index.tsx?tss-serverfn-split
5
5
  var fetchModelsPage_createServerFn_handler = createServerRpc({
6
6
  id: "71b6b12251ac92cf4ee888c1d2b6eba3beaac079f9c39eaed95fafcd15908731",
@@ -1,11 +1,14 @@
1
- import { K as Button, M as SetupCard, N as Switch, P as Waiting, W as Dialog, dt as errorMessage, h as CARD_ROW, j as SearchField, lt as api, m as Banner, w as Chip } from "./SpawnDialog-MJWwppgC.js";
2
- import { r as useResource } from "./use-resource-CjcJwn7F.js";
1
+ import { i as api, o as errorMessage } from "./live-DbJeq6KP.js";
2
+ import { r as useResource } from "./use-resource-BUA9qGGY.js";
3
+ import { t as Button } from "./Button-Dsnw22OF.js";
3
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-D-hTgYOO.js";
4
- import { t as ConfirmDialog } from "./ConfirmDialog-4xeCXKHe.js";
5
+ import { t as Dialog } from "./Dialog-DTeF-nOZ.js";
6
+ import { t as ConfirmDialog } from "./ConfirmDialog-DAcSBHkT.js";
5
7
  import { t as Segmented } from "./Segmented-3ZLdqa5U.js";
6
- import { t as Route } from "./config-B5CS8juO.js";
7
- import { t as ConfigPage } from "./ConfigPage-CxzL-gTm.js";
8
- import { c as ProviderAvatar, l as StateChip, o as FailureBox, s as ModelRow, t as AddProviderDialog } from "./AddProviderDialog-Nc5mc_P6.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-k9M-atPa.js";
9
+ import { t as Route } from "./config-Cld8Q8N7.js";
10
+ import { t as ConfigPage } from "./ConfigPage-usZi48Zr.js";
11
+ import { c as ProviderAvatar, l as StateChip, o as FailureBox, s as ModelRow, t as AddProviderDialog } from "./AddProviderDialog-DtkjBMv4.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";
@@ -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-vrZVrV9u.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-D-hTgYOO.js";
3
+ import { b as Switch } from "./parts-k9M-atPa.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 };