bazilion 0.52.0 → 0.53.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 (191) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/cli.js.map +1 -1
  3. package/dist/web/client/assets/AddProviderDialog-CO_uijWF.js +1 -0
  4. package/dist/web/client/assets/AgentTemplateParts-Dl35c-Ux.js +1 -0
  5. package/dist/web/client/assets/ConfigPage-DiQiJXP6.js +1 -0
  6. package/dist/web/client/assets/ConfirmDialog-BVytx3kN.js +1 -0
  7. package/dist/web/client/assets/ConnectionsView-DDrBaiLg.js +1 -0
  8. package/dist/web/client/assets/Dialog-BTDzv3J5.js +1 -0
  9. package/dist/web/client/assets/ManagePage-xlePXXx5.js +1 -0
  10. package/dist/web/client/assets/SectionTabs-BMiRKFfb.js +1 -0
  11. package/dist/web/client/assets/Segmented-Co4n2C5X.js +1 -0
  12. package/dist/web/client/assets/SpawnDialog-ejwXnyxy.js +1 -0
  13. package/dist/web/client/assets/SpawnTeamModal-Cp-nAvIC.js +1 -0
  14. package/dist/web/client/assets/TeamForm-Cz9uDVvb.js +1 -0
  15. package/dist/web/client/assets/TeamThread-D8xqE_gb.js +1 -0
  16. package/dist/web/client/assets/UnsavedChangesGuard-DmT4nBQU.js +1 -0
  17. package/dist/web/client/assets/_id-DEQxwq2v.js +1 -0
  18. package/dist/web/client/assets/_id-DSRgpxEc.js +1 -0
  19. package/dist/web/client/assets/access-34_ShgHU.js +1 -0
  20. package/dist/web/client/assets/agent-actions--EO4yJ4Q.js +1 -0
  21. package/dist/web/client/assets/agents-C87yBHaR.js +1 -0
  22. package/dist/web/client/assets/agents-DvCSl1Ro.js +1 -0
  23. package/dist/web/client/assets/api-CoLs57oO.js +1 -0
  24. package/dist/web/client/assets/arrow-right-BhTWtC9z.js +1 -0
  25. package/dist/web/client/assets/attention-CteEeRvX.js +1 -0
  26. package/dist/web/client/assets/chevron-right-BqOIX9UM.js +1 -0
  27. package/dist/web/client/assets/config-XJuQeEP4.js +1 -0
  28. package/dist/web/client/assets/createLucideIcon-dN8ooBD1.js +1 -0
  29. package/dist/web/client/assets/download-Dj-1ltZb.js +1 -0
  30. package/dist/web/client/assets/file-text-DiP-LaEg.js +1 -0
  31. package/dist/web/client/assets/form-Bvr_f9lR.js +1 -0
  32. package/dist/web/client/assets/images-BKjyhYUc.js +1 -0
  33. package/dist/web/client/assets/index-J_Uqj4md.js +54 -0
  34. package/dist/web/client/assets/key-round-QpqZklz6.js +1 -0
  35. package/dist/web/client/assets/list-checks-BeyG5SVQ.js +1 -0
  36. package/dist/web/client/assets/login-076Bc601.js +1 -0
  37. package/dist/web/client/assets/manage-CsrV2hhK.js +1 -0
  38. package/dist/web/client/assets/mcp-8N0BqZ0G.js +1 -0
  39. package/dist/web/client/assets/message-square-DnpSOYv4.js +1 -0
  40. package/dist/web/client/assets/network-BC7rNaOC.js +1 -0
  41. package/dist/web/client/assets/parts-B0JBolvG.js +1 -0
  42. package/dist/web/client/assets/plus-DZ3KVo7E.js +1 -0
  43. package/dist/web/client/assets/routes-3HkZZOOe.js +76 -0
  44. package/dist/web/client/assets/skills-DiaqZRXT.js +1 -0
  45. package/dist/web/client/assets/square-terminal-hQZ6pexU.js +1 -0
  46. package/dist/web/client/assets/style-BtcFIkOS.js +7 -0
  47. package/dist/web/client/assets/styles-C7Ztw15K.css +2 -0
  48. package/dist/web/client/assets/system-YWlJ8ogO.js +1 -0
  49. package/dist/web/client/assets/teams-DQwceMvk.js +1 -0
  50. package/dist/web/client/assets/teams-DTC3plIH.js +1 -0
  51. package/dist/web/client/assets/telegram-D4wINntt.js +1 -0
  52. package/dist/web/client/assets/tools-CZeQ9pDx.js +1 -0
  53. package/dist/web/client/assets/use-resource-BaTkTGvG.js +1 -0
  54. package/dist/web/client/assets/welcome-CnxP_RCk.js +1 -0
  55. package/dist/web/client/assets/wrench-BrwBswfo.js +1 -0
  56. package/dist/web/server/assets/{AddProviderDialog-Tn4AskPm.js → AddProviderDialog-Di5crZUB.js} +105 -4
  57. package/dist/web/server/assets/AgentTemplateParts-Cqy7kSzx.js +269 -0
  58. package/dist/web/server/assets/{ConfigPage-DqDUujmt.js → ConfigPage-oXM3wyOU.js} +2 -2
  59. package/dist/web/server/assets/{ConnectionsView-DAG-zNBz.js → ConnectionsView-DZrLoNoW.js} +3 -3
  60. package/dist/web/server/assets/ManagePage-0LKHEcT_.js +29 -0
  61. package/dist/web/server/assets/{ModelMenu-DUY9aHkE.js → ModelMenu-BAZeARx6.js} +3 -3
  62. package/dist/web/server/assets/{Rail-BIC_4ptO.js → Rail-7JU6ly2O.js} +14 -104
  63. package/dist/web/server/assets/{SectionTabs-BGsrf-UQ.js → SectionTabs-CWQ5orUW.js} +9 -2
  64. package/dist/web/server/assets/{SpawnDialog-D_SMPCG_.js → SpawnDialog-CYkwzETs.js} +49 -57
  65. package/dist/web/server/assets/SpawnTeamModal-CCe6P82H.js +127 -0
  66. package/dist/web/server/assets/TeamForm-BzQmdhVi.js +141 -0
  67. package/dist/web/server/assets/{TeamThread-DuLlGDcw.js → TeamThread-SyQpUvz5.js} +1 -1
  68. package/dist/web/server/assets/_id-AcyGvFrE.js +400 -0
  69. package/dist/web/server/assets/{_id-DJnYgisy.js → _id-BGTgqsWm.js} +8 -4
  70. package/dist/web/server/assets/{_id-TVruGcOd.js → _id-BKzOw78O.js} +11 -3
  71. package/dist/web/server/assets/{_id-yN0z7VqE.js → _id-DPGzfmjG.js} +255 -203
  72. package/dist/web/server/assets/_id-DXm9W55C.js +16 -0
  73. package/dist/web/server/assets/_id-DojvxRZn.js +39 -0
  74. package/dist/web/server/assets/_tanstack-start-manifest_v-D7RvKGRH.js +285 -0
  75. package/dist/web/server/assets/{access-GMGed5O8.js → access-BJe-NduL.js} +2 -2
  76. package/dist/web/server/assets/access-CKSW7MFH.js +297 -0
  77. package/dist/web/server/assets/{access-C_pupPks.js → access-WWspT0v4.js} +2 -1
  78. package/dist/web/server/assets/agent-actions-CUDMCG0F.js +20 -0
  79. package/dist/web/server/assets/agents-1sjSvp5p.js +12 -0
  80. package/dist/web/server/assets/{agents-BnWgFo6o.js → agents-6d9WxbYF.js} +9 -6
  81. package/dist/web/server/assets/agents-DKVGUwD1.js +31 -0
  82. package/dist/web/server/assets/agents-DUI4Yjtg.js +13 -0
  83. package/dist/web/server/assets/agents-DsHeRaLq.js +327 -0
  84. package/dist/web/server/assets/agents-DtLDoZ_u.js +136 -0
  85. package/dist/web/server/assets/{attention-Cr7puThv.js → attention-B6sSDR_4.js} +2 -1
  86. package/dist/web/server/assets/{attention-DS3O9UmJ.js → attention-DefKwvgm.js} +2 -2
  87. package/dist/web/server/assets/attention-johfkM0_.js +203 -0
  88. package/dist/web/server/assets/{config-Q7livfa3.js → config-Clz57LuN.js} +33 -82
  89. package/dist/web/server/assets/{config-DjTGA4iZ.js → config-DYAaaE9Z.js} +2 -2
  90. package/dist/web/server/assets/{createSsrRpc-GCCF14VW.js → createSsrRpc-BijMHgqE.js} +1 -45
  91. package/dist/web/server/assets/form-BRQAsKKq.js +319 -0
  92. package/dist/web/server/assets/manage-Ppyi3Y5y.js +230 -0
  93. package/dist/web/server/assets/mcp-Ce6O8Qs2.js +378 -0
  94. package/dist/web/server/assets/{mcp-ZARSOxZW.js → mcp-DB38leWS.js} +2 -2
  95. package/dist/web/server/assets/parts-mabERIJZ.js +380 -0
  96. package/dist/web/server/assets/{router-Dh2-IvLL.js → router-C97bwlXi.js} +35 -30
  97. package/dist/web/server/assets/{routes-C9NawqcV.js → routes-C4aGqXfr.js} +52 -8
  98. package/dist/web/server/assets/{routes-CDskMy5C.js → routes-DuOShl4q.js} +1 -1
  99. package/dist/web/server/assets/{routes-BJIJWCIE.js → routes-IHMVKpDK.js} +2 -2
  100. package/dist/web/server/assets/{skills-StN15QhC.js → skills-B7sg0QKS.js} +2 -2
  101. package/dist/web/server/assets/{skills-h5aHa7Q8.js → skills-DWzlT_hC.js} +9 -1
  102. package/dist/web/server/assets/skills-hfTSwqsG.js +353 -0
  103. package/dist/web/server/assets/{style-GYDODk2F.js → style-BR7ufS6Z.js} +1 -1
  104. package/dist/web/server/assets/system-CNQpt3JB.js +145 -0
  105. package/dist/web/server/assets/{system-DtswhLW6.js → system-D3th6n2E.js} +4 -2
  106. package/dist/web/server/assets/{system-Dl-1RhoP.js → system-DaP0ol67.js} +2 -2
  107. package/dist/web/server/assets/{teams-CbIPKf99.js → teams-4cEZ4_rw.js} +4 -2
  108. package/dist/web/server/assets/{teams-BxnvFTyn.js → teams-70u1XQTr.js} +1 -3
  109. package/dist/web/server/assets/teams-BKHe67f3.js +176 -0
  110. package/dist/web/server/assets/{teams-YrmyutM4.js → teams-BopOP4x7.js} +8 -1
  111. package/dist/web/server/assets/teams-C3xwTz8-.js +219 -0
  112. package/dist/web/server/assets/{teams-5PMGvHuM.js → teams-CuKE5iAK.js} +2 -2
  113. package/dist/web/server/assets/{telegram-Cv0D4gyz.js → telegram-BnQADwnj.js} +2 -2
  114. package/dist/web/server/assets/telegram-BpmK-HHV.js +1059 -0
  115. package/dist/web/server/assets/{tools-ioJcPzMW.js → tools-BQeWn7Tj.js} +2 -2
  116. package/dist/web/server/assets/{tools-OfD22R-C.js → tools-CURTfG2q.js} +56 -217
  117. package/dist/web/server/assets/{welcome-FFEbrNT1.js → welcome-OiZCAIHZ.js} +3 -4
  118. package/dist/web/server/assets/{welcome-jxmpE_Jb.js → welcome-SNsE49JO.js} +2 -2
  119. package/dist/web/server/server.js +20 -20
  120. package/package.json +1 -1
  121. package/dist/web/client/assets/AddProviderDialog-BiGLKnu2.js +0 -1
  122. package/dist/web/client/assets/ConfigPage-DvBzy2MN.js +0 -1
  123. package/dist/web/client/assets/ConfirmDialog-CiZ5tk9R.js +0 -1
  124. package/dist/web/client/assets/ConnectionsView-Czkpm2JY.js +0 -1
  125. package/dist/web/client/assets/Dialog-s_kPtI-W.js +0 -1
  126. package/dist/web/client/assets/ModelMenu-BfUPoRjV.js +0 -1
  127. package/dist/web/client/assets/SectionTabs-DENNb6Nw.js +0 -1
  128. package/dist/web/client/assets/Segmented-Dh77vmpp.js +0 -1
  129. package/dist/web/client/assets/SkillFindings-Xng11qqx.js +0 -1
  130. package/dist/web/client/assets/SkillsPicker-hI3YXvib.js +0 -1
  131. package/dist/web/client/assets/SpawnDialog-CKWFQ6jk.js +0 -1
  132. package/dist/web/client/assets/Tabs-f6bHvCGn.js +0 -1
  133. package/dist/web/client/assets/TeamForm-kda1HYZG.js +0 -1
  134. package/dist/web/client/assets/TeamThread-2rm1JGSk.js +0 -1
  135. package/dist/web/client/assets/UnsavedChangesGuard-nx6dv2Yw.js +0 -1
  136. package/dist/web/client/assets/_id-B72mIpcE.js +0 -1
  137. package/dist/web/client/assets/_id-Bzavnza1.js +0 -1
  138. package/dist/web/client/assets/access-Yw9jODuk.js +0 -1
  139. package/dist/web/client/assets/agents-C9xoyL7o.js +0 -1
  140. package/dist/web/client/assets/agents-TviG16wx.js +0 -1
  141. package/dist/web/client/assets/api-HC_YzjBy.js +0 -1
  142. package/dist/web/client/assets/arrow-right-Gm_FDWJ_.js +0 -1
  143. package/dist/web/client/assets/attention-DmURtlJm.js +0 -1
  144. package/dist/web/client/assets/check-BjgKoGvU.js +0 -1
  145. package/dist/web/client/assets/chevron-right-CUZiA2aG.js +0 -1
  146. package/dist/web/client/assets/config-UZz_mjO5.js +0 -1
  147. package/dist/web/client/assets/createLucideIcon-C6gOo8sD.js +0 -1
  148. package/dist/web/client/assets/dist-BWppw70N.js +0 -41
  149. package/dist/web/client/assets/dist-D2dwY7MR.js +0 -1
  150. package/dist/web/client/assets/index-Df1oUtAP.js +0 -14
  151. package/dist/web/client/assets/link-Cbztlp_R.js +0 -1
  152. package/dist/web/client/assets/login-CPfdaqsV.js +0 -1
  153. package/dist/web/client/assets/mcp-FlYnNon0.js +0 -1
  154. package/dist/web/client/assets/parts-tIDBNsYA.js +0 -1
  155. package/dist/web/client/assets/plus-CWrKMtvA.js +0 -1
  156. package/dist/web/client/assets/routes-BZaWCoQj.js +0 -76
  157. package/dist/web/client/assets/save-f9O-CQia.js +0 -1
  158. package/dist/web/client/assets/skills-C7yDPC8s.js +0 -1
  159. package/dist/web/client/assets/style-DDuTFJUu.js +0 -7
  160. package/dist/web/client/assets/styles-BviXU81u.css +0 -2
  161. package/dist/web/client/assets/system-CL3Kz36L.js +0 -1
  162. package/dist/web/client/assets/teams-CQTEF5gV.js +0 -1
  163. package/dist/web/client/assets/teams-DQ7SqVyF.js +0 -1
  164. package/dist/web/client/assets/telegram-BLgxtGhZ.js +0 -1
  165. package/dist/web/client/assets/tools-pOQyGVYo.js +0 -1
  166. package/dist/web/client/assets/use-resource-C3MBZJop.js +0 -1
  167. package/dist/web/client/assets/welcome-Hr6JpMef.js +0 -1
  168. package/dist/web/client/assets/wrench-6BEIqKDn.js +0 -1
  169. package/dist/web/server/assets/SkillFindings-BdATze1A.js +0 -46
  170. package/dist/web/server/assets/SkillsPicker-DlqEfRWh.js +0 -67
  171. package/dist/web/server/assets/Tabs-BhF41MfQ.js +0 -20
  172. package/dist/web/server/assets/TeamForm-ilBaeLI4.js +0 -96
  173. package/dist/web/server/assets/_id-BsZcsabI.js +0 -383
  174. package/dist/web/server/assets/_id-D8Kj0F30.js +0 -18
  175. package/dist/web/server/assets/_id-QYifTM9w.js +0 -28
  176. package/dist/web/server/assets/_tanstack-start-manifest_v-D6zrzUC7.js +0 -223
  177. package/dist/web/server/assets/access-DKOpcHIJ.js +0 -232
  178. package/dist/web/server/assets/agents-B6OR3x99.js +0 -327
  179. package/dist/web/server/assets/agents-B7642eRO.js +0 -130
  180. package/dist/web/server/assets/agents-BJ-_oC2e.js +0 -14
  181. package/dist/web/server/assets/agents-CjV0w-Zy.js +0 -12
  182. package/dist/web/server/assets/agents-Dy_Q-9lG.js +0 -27
  183. package/dist/web/server/assets/attention-CLP4HYBz.js +0 -216
  184. package/dist/web/server/assets/mcp-BI-FD-JI.js +0 -250
  185. package/dist/web/server/assets/parts-B31PJkhi.js +0 -190
  186. package/dist/web/server/assets/skills-BqLq3ZXq.js +0 -275
  187. package/dist/web/server/assets/system-BtRA2HUs.js +0 -138
  188. package/dist/web/server/assets/teams-COaU0wN9.js +0 -108
  189. package/dist/web/server/assets/teams-Ca8W4mvl.js +0 -88
  190. package/dist/web/server/assets/telegram-Yx8nm6Ei.js +0 -984
  191. /package/dist/web/server/assets/{telegram-CGol0CKX2.js → telegram-CGol0CKX.js} +0 -0
@@ -1,28 +1,12 @@
1
1
  import { C as api, T as errorMessage, u as Button } from "./workspace-DaitCM0t.js";
2
2
  import "./entities-Dn2xzKIw.js";
3
3
  import { n as DialogActions, t as Dialog } from "./Dialog-aup_yJv5.js";
4
- import { n as ModelMenu, t as MODELS_PATH } from "./ModelMenu-DUY9aHkE.js";
4
+ import { n as ModelMenu, t as MODELS_PATH } from "./ModelMenu-BAZeARx6.js";
5
+ import { g as Notice } from "./parts-mabERIJZ.js";
6
+ import { l as TextField, s as SelectField } from "./form-BRQAsKKq.js";
5
7
  import { useEffect, useState } from "react";
6
8
  import { useNavigate } from "@tanstack/react-router";
7
9
  import { jsx, jsxs } from "react/jsx-runtime";
8
- //#region src/lib/agent-actions.ts
9
- var agentPath = (id) => `/api/agents/${encodeURIComponent(id)}`;
10
- function archiveAgent(id) {
11
- return api(`${agentPath(id)}/archive`, { method: "POST" });
12
- }
13
- function unarchiveAgent(id) {
14
- return api(`${agentPath(id)}/unarchive`, { method: "POST" });
15
- }
16
- function deleteAgent(id) {
17
- return api(agentPath(id), { method: "DELETE" });
18
- }
19
- function renameAgent(id, name) {
20
- return api(agentPath(id), {
21
- method: "PATCH",
22
- body: { name }
23
- });
24
- }
25
- //#endregion
26
10
  //#region src/components/SpawnDialog.tsx
27
11
  /** The one way to spawn an Agent; opens its chat afterwards. */
28
12
  function SpawnDialog({ profiles, teams, profileId: initialProfileId, teamId: initialTeamId, onClose }) {
@@ -62,71 +46,79 @@ function SpawnDialog({ profiles, teams, profileId: initialProfileId, teamId: ini
62
46
  setBusy(false);
63
47
  }
64
48
  }
49
+ const template = profiles.find((profile) => profile.id === profileId);
65
50
  return /* @__PURE__ */ jsx(Dialog, {
66
51
  title: "Spawn an agent",
52
+ description: "It starts with its template's files, model and skills, in the Team you choose.",
67
53
  busy,
68
54
  onClose,
69
55
  children: /* @__PURE__ */ jsxs("form", {
70
56
  onSubmit: (event) => void submit(event),
57
+ className: "grid gap-4",
71
58
  children: [
72
- /* @__PURE__ */ jsxs("label", { children: ["Agent template", /* @__PURE__ */ jsx("select", {
59
+ /* @__PURE__ */ jsx(SelectField, {
60
+ label: "Agent template",
73
61
  value: profileId,
74
- onChange: (event) => setProfileId(event.target.value),
75
- required: true,
76
- children: profiles.map((profile) => /* @__PURE__ */ jsx("option", {
62
+ options: profiles.map((profile) => ({
77
63
  value: profile.id,
78
- children: profile.name || profile.id
79
- }, profile.id))
80
- })] }),
81
- /* @__PURE__ */ jsxs("label", { children: ["Name (optional; defaults to the template's)", /* @__PURE__ */ jsx("input", {
64
+ label: profile.name || profile.id
65
+ })),
66
+ disabled: busy,
67
+ className: "max-w-none",
68
+ onChange: setProfileId
69
+ }),
70
+ /* @__PURE__ */ jsx(TextField, {
71
+ label: "Name",
82
72
  value: name,
83
- onChange: (event) => setName(event.target.value),
84
- autoComplete: "off"
85
- })] }),
73
+ disabled: busy,
74
+ placeholder: template?.name || template?.id || "The template’s name",
75
+ hint: "Leave it empty to use the template’s name.",
76
+ className: "max-w-none",
77
+ onChange: setName
78
+ }),
86
79
  /* @__PURE__ */ jsx(ModelMenu, {
80
+ kit: true,
87
81
  label: "Model",
88
82
  value: model,
89
83
  onChange: setModel,
90
84
  models: chatModels,
91
85
  inherited: {
92
86
  label: "The template’s model",
93
- model: profiles.find((profile) => profile.id === profileId)?.defaultModel
87
+ model: template?.defaultModel
94
88
  }
95
89
  }),
96
- /* @__PURE__ */ jsxs("label", { children: ["Team", /* @__PURE__ */ jsx("select", {
90
+ /* @__PURE__ */ jsx(SelectField, {
91
+ label: "Team",
97
92
  value: teamId,
98
- onChange: (event) => setTeamId(event.target.value),
99
- children: teams.map((team) => /* @__PURE__ */ jsxs("option", {
93
+ options: teams.map((team) => ({
100
94
  value: team.id,
101
- children: [team.name, team.id === "default" ? " (default)" : ""]
102
- }, team.id))
103
- })] }),
104
- restricted && /* @__PURE__ */ jsx("p", {
105
- className: "text-xs text-muted-foreground",
106
- children: "This Team is restricted: the new Agent starts with no connections. Add them under Connections."
95
+ label: team.id === "default" ? `${team.name} (default)` : team.name
96
+ })),
97
+ disabled: busy,
98
+ className: "max-w-none",
99
+ hint: restricted ? "This Team is restricted: the new Agent starts with no connections. Add them under Connections." : void 0,
100
+ onChange: setTeamId
107
101
  }),
108
- error && /* @__PURE__ */ jsx("p", {
102
+ error && /* @__PURE__ */ jsx(Notice, {
103
+ tone: "warning",
109
104
  role: "alert",
110
- className: "err mt-2",
105
+ title: "It was not spawned.",
111
106
  children: error
112
107
  }),
113
- /* @__PURE__ */ jsx("div", {
114
- className: "mt-4",
115
- children: /* @__PURE__ */ jsxs(DialogActions, { children: [/* @__PURE__ */ jsx(Button, {
116
- variant: "ghost",
117
- disabled: busy,
118
- onClick: onClose,
119
- children: "Cancel"
120
- }), /* @__PURE__ */ jsx(Button, {
121
- variant: "primary",
122
- type: "submit",
123
- disabled: busy || !profileId,
124
- children: busy ? "Spawning…" : "Spawn agent"
125
- })] })
126
- })
108
+ /* @__PURE__ */ jsxs(DialogActions, { children: [/* @__PURE__ */ jsx(Button, {
109
+ variant: "ghost",
110
+ disabled: busy,
111
+ onClick: onClose,
112
+ children: "Cancel"
113
+ }), /* @__PURE__ */ jsx(Button, {
114
+ variant: "primary",
115
+ type: "submit",
116
+ disabled: busy || !profileId || !teamId,
117
+ children: busy ? "Spawning…" : "Spawn agent"
118
+ })] })
127
119
  ]
128
120
  })
129
121
  });
130
122
  }
131
123
  //#endregion
132
- export { unarchiveAgent as a, renameAgent as i, archiveAgent as n, deleteAgent as r, SpawnDialog as t };
124
+ export { SpawnDialog as t };
@@ -0,0 +1,127 @@
1
+ import { C as api, T as errorMessage, u as Button } from "./workspace-DaitCM0t.js";
2
+ import { n as DialogActions, t as Dialog } from "./Dialog-aup_yJv5.js";
3
+ import { g as Notice } from "./parts-mabERIJZ.js";
4
+ import { l as TextField, n as ChoiceCards, s as SelectField } from "./form-BRQAsKKq.js";
5
+ import { S as slugify, s as count, x as slugProblem } from "./manage-Ppyi3Y5y.js";
6
+ import { useState } from "react";
7
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
+ //#region src/components/SpawnTeamModal.tsx
9
+ /** Spawn a Team template's Agents and connections into a new Team or one that exists. */
10
+ function SpawnTeamModal({ template, teams, initialTeamId = "", onClose, onSpawned }) {
11
+ const known = teams.some((team) => team.id === initialTeamId);
12
+ const [target, setTarget] = useState(known ? "existing" : "new");
13
+ const [existing, setExisting] = useState(known ? initialTeamId : teams[0]?.id ?? "");
14
+ const [newId, setNewId] = useState(known ? "" : initialTeamId || slugify(template.name));
15
+ const [userMd, setUserMd] = useState(template.userMd ?? "");
16
+ const [error, setError] = useState(null);
17
+ const [busy, setBusy] = useState(false);
18
+ const teamId = target === "existing" ? existing : newId.trim();
19
+ const idProblem = target === "new" ? slugProblem(teamId) ?? (teams.some((team) => team.id === teamId) ? "A Team with this ID exists: choose it under “A Team that exists”." : void 0) : void 0;
20
+ const ready = teamId !== "" && !idProblem && template.slots.length > 0;
21
+ async function spawn(event) {
22
+ event.preventDefault();
23
+ if (!ready || busy) return;
24
+ setBusy(true);
25
+ setError(null);
26
+ try {
27
+ await api(`/api/team-templates/${encodeURIComponent(template.id)}/spawn`, { body: {
28
+ teamId,
29
+ ...target === "new" && userMd !== (template.userMd ?? "") ? { userMd } : {}
30
+ } });
31
+ onSpawned(teamId);
32
+ } catch (cause) {
33
+ setError(errorMessage(cause));
34
+ setBusy(false);
35
+ }
36
+ }
37
+ return /* @__PURE__ */ jsx(Dialog, {
38
+ title: `Spawn ${template.name}`,
39
+ description: `Creates ${count(template.slots.length, "Agent")} and ${count(template.edges.length, "connection")} between them.`,
40
+ busy,
41
+ onClose,
42
+ className: "max-w-xl",
43
+ children: /* @__PURE__ */ jsxs("form", {
44
+ onSubmit: (event) => void spawn(event),
45
+ className: "grid gap-4",
46
+ children: [
47
+ /* @__PURE__ */ jsx(ChoiceCards, {
48
+ legend: "Into",
49
+ name: "spawn-team-target",
50
+ value: target,
51
+ disabled: busy,
52
+ options: [{
53
+ value: "new",
54
+ label: "A new Team",
55
+ hint: `It is ${template.policyMode === "restricted" ? "restricted: members message each other along connections" : "open: members message each other freely"}, as the template is.`
56
+ }, {
57
+ value: "existing",
58
+ label: "A Team that exists",
59
+ hint: "The Agents join it; it keeps its own messaging rules."
60
+ }],
61
+ onChange: setTarget
62
+ }),
63
+ target === "new" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(TextField, {
64
+ label: "ID of the new Team",
65
+ value: newId,
66
+ disabled: busy,
67
+ placeholder: "launch",
68
+ mono: true,
69
+ className: "max-w-none",
70
+ problem: idProblem,
71
+ onChange: setNewId
72
+ }), /* @__PURE__ */ jsxs("div", { children: [
73
+ /* @__PURE__ */ jsx("label", {
74
+ htmlFor: "spawn-team-user-md",
75
+ className: "m-0 text-sm font-semibold text-foreground",
76
+ children: "USER.md"
77
+ }),
78
+ /* @__PURE__ */ jsx("textarea", {
79
+ id: "spawn-team-user-md",
80
+ rows: 4,
81
+ value: userMd,
82
+ disabled: busy,
83
+ onChange: (event) => setUserMd(event.target.value),
84
+ className: "mt-1.5 font-mono text-[0.85rem] leading-[1.55]"
85
+ }),
86
+ /* @__PURE__ */ jsx("span", {
87
+ className: "mt-1 block text-xs text-muted-foreground",
88
+ children: "What every Agent of the new Team knows about you. It starts from the template’s."
89
+ })
90
+ ] })] }) : /* @__PURE__ */ jsx(SelectField, {
91
+ label: "Team",
92
+ value: existing,
93
+ options: teams.map((team) => ({
94
+ value: team.id,
95
+ label: team.name
96
+ })),
97
+ disabled: busy,
98
+ className: "max-w-none",
99
+ onChange: setExisting
100
+ }),
101
+ template.slots.length === 0 && /* @__PURE__ */ jsx(Notice, {
102
+ tone: "warning",
103
+ children: "This template has no Agents yet: add some to it first."
104
+ }),
105
+ error && /* @__PURE__ */ jsx(Notice, {
106
+ tone: "warning",
107
+ role: "alert",
108
+ title: "The Team was not spawned.",
109
+ children: error
110
+ }),
111
+ /* @__PURE__ */ jsxs(DialogActions, { children: [/* @__PURE__ */ jsx(Button, {
112
+ variant: "ghost",
113
+ disabled: busy,
114
+ onClick: onClose,
115
+ children: "Cancel"
116
+ }), /* @__PURE__ */ jsx(Button, {
117
+ variant: "primary",
118
+ type: "submit",
119
+ disabled: busy || !ready,
120
+ children: busy ? "Spawning…" : `Spawn ${count(template.slots.length, "Agent")}`
121
+ })] })
122
+ ]
123
+ })
124
+ });
125
+ }
126
+ //#endregion
127
+ export { SpawnTeamModal as t };
@@ -0,0 +1,141 @@
1
+ import { C as api, T as errorMessage, u as Button } from "./workspace-DaitCM0t.js";
2
+ import { n as DialogActions } from "./Dialog-aup_yJv5.js";
3
+ import { g as Notice } from "./parts-mabERIJZ.js";
4
+ import { l as TextField, n as ChoiceCards } from "./form-BRQAsKKq.js";
5
+ import { S as slugify, x as slugProblem } from "./manage-Ppyi3Y5y.js";
6
+ import { useState } from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ //#region src/components/TeamForm.tsx
9
+ /** What creating a Team sends, or what is still wrong with the form. */
10
+ function teamRequest(draft) {
11
+ const id = draft.id.trim();
12
+ const folder = draft.folder.trim();
13
+ const problems = {};
14
+ const idProblem = slugProblem(id);
15
+ if (idProblem) problems.id = idProblem;
16
+ if (draft.place === "link" && folder && !folder.startsWith("/")) problems.folder = "The full path of the folder, starting with /.";
17
+ if (!(id !== "" && (draft.place === "new" || folder !== "")) || problems.id || problems.folder) return {
18
+ body: null,
19
+ problems
20
+ };
21
+ return {
22
+ body: {
23
+ id,
24
+ ...draft.name.trim() ? { name: draft.name.trim() } : {},
25
+ ...draft.place === "link" ? { link: folder } : {}
26
+ },
27
+ problems
28
+ };
29
+ }
30
+ /**
31
+ * Create a Team: its name, the id made from it, and where its files are: a new folder in the
32
+ * Bazilion home, or an existing project folder it links to.
33
+ */
34
+ function TeamForm({ onCreated, onBusyChange, extraActions }) {
35
+ const [name, setName] = useState("");
36
+ const [id, setId] = useState("");
37
+ const [idTouched, setIdTouched] = useState(false);
38
+ const [place, setPlace] = useState("new");
39
+ const [folder, setFolder] = useState("");
40
+ const [busy, setBusy] = useState(false);
41
+ const [error, setError] = useState(null);
42
+ const shownId = idTouched ? id : slugify(name);
43
+ const request = teamRequest({
44
+ name,
45
+ id: shownId,
46
+ place,
47
+ folder
48
+ });
49
+ function changeBusy(next) {
50
+ setBusy(next);
51
+ onBusyChange?.(next);
52
+ }
53
+ async function submit(event) {
54
+ event.preventDefault();
55
+ if (!request.body || busy) return;
56
+ setError(null);
57
+ changeBusy(true);
58
+ try {
59
+ await onCreated(await api("/api/teams", { body: request.body }));
60
+ } catch (cause) {
61
+ setError(errorMessage(cause));
62
+ } finally {
63
+ changeBusy(false);
64
+ }
65
+ }
66
+ return /* @__PURE__ */ jsxs("form", {
67
+ onSubmit: (event) => void submit(event),
68
+ className: "grid gap-4",
69
+ children: [
70
+ /* @__PURE__ */ jsxs("div", {
71
+ className: "grid items-start gap-x-3 gap-y-4 sm:grid-cols-2",
72
+ children: [/* @__PURE__ */ jsx(TextField, {
73
+ label: "Name",
74
+ value: name,
75
+ disabled: busy,
76
+ placeholder: "My project",
77
+ className: "max-w-none",
78
+ onChange: (value) => {
79
+ setName(value);
80
+ setError(null);
81
+ }
82
+ }), /* @__PURE__ */ jsx(TextField, {
83
+ label: "ID",
84
+ value: shownId,
85
+ disabled: busy,
86
+ placeholder: "my-project",
87
+ mono: true,
88
+ className: "max-w-none",
89
+ hint: "Used in commands and addresses; it cannot change later.",
90
+ problem: request.problems.id,
91
+ onChange: (value) => {
92
+ setIdTouched(true);
93
+ setId(value);
94
+ setError(null);
95
+ }
96
+ })]
97
+ }),
98
+ /* @__PURE__ */ jsx(ChoiceCards, {
99
+ legend: "Where its files are",
100
+ name: "team-place",
101
+ value: place,
102
+ disabled: busy,
103
+ options: [{
104
+ value: "new",
105
+ label: "A new folder",
106
+ hint: "Bazilion makes one for it in its home."
107
+ }, {
108
+ value: "link",
109
+ label: "A project folder",
110
+ hint: "Its Agents work in a folder that already exists, such as a code repository."
111
+ }],
112
+ onChange: setPlace
113
+ }),
114
+ place === "link" && /* @__PURE__ */ jsx(TextField, {
115
+ label: "Folder",
116
+ value: folder,
117
+ disabled: busy,
118
+ placeholder: "/home/you/projects/my-project",
119
+ mono: true,
120
+ className: "max-w-none",
121
+ hint: "The Team links to it; removing the Team later removes only the link, never the folder.",
122
+ problem: request.problems.folder,
123
+ onChange: setFolder
124
+ }),
125
+ error && /* @__PURE__ */ jsx(Notice, {
126
+ tone: "warning",
127
+ role: "alert",
128
+ title: "The Team was not created.",
129
+ children: error
130
+ }),
131
+ /* @__PURE__ */ jsxs(DialogActions, { children: [extraActions?.(busy), /* @__PURE__ */ jsx(Button, {
132
+ variant: "primary",
133
+ type: "submit",
134
+ disabled: busy || !request.body,
135
+ children: busy ? "Creating…" : "Create Team"
136
+ })] })
137
+ ]
138
+ });
139
+ }
140
+ //#endregion
141
+ export { TeamForm as t };
@@ -1,6 +1,6 @@
1
1
  import { C as api, d as AgentAvatar, g as useActivity, m as shortTime, t as FOCUS_VIEWS } from "./workspace-DaitCM0t.js";
2
2
  import { r as useResource, t as useHydrated } from "./use-resource-DVzK0toP.js";
3
- import { c as useWorkspace } from "./Rail-BIC_4ptO.js";
3
+ import { s as useWorkspace } from "./Rail-7JU6ly2O.js";
4
4
  import { Link } from "@tanstack/react-router";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { ArrowLeft, ArrowRight, Code2, Images, Network } from "lucide-react";