bazilion 0.52.0 → 0.54.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 (210) hide show
  1. package/dist/cli.js +3 -3
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +296 -232
  4. package/dist/daemon.js.map +1 -1
  5. package/dist/web/client/assets/AddProviderDialog-CkwSq3C7.js +1 -0
  6. package/dist/web/client/assets/AgentTemplateParts-CEn_4qVs.js +1 -0
  7. package/dist/web/client/assets/Button-UiegBKOK.js +1 -0
  8. package/dist/web/client/assets/ConfigPage-CUbHBhzx.js +1 -0
  9. package/dist/web/client/assets/ConfirmDialog-VqBOFZEp.js +1 -0
  10. package/dist/web/client/assets/ConnectionsView-ByARMcWP.js +1 -0
  11. package/dist/web/client/assets/ManagePage-BJWZd1ts.js +1 -0
  12. package/dist/web/client/assets/SectionTabs-ViZKm3-B.js +1 -0
  13. package/dist/web/client/assets/Segmented-MYKKTuZO.js +1 -0
  14. package/dist/web/client/assets/SkillsParts-UvNK5SYP.js +1 -0
  15. package/dist/web/client/assets/SpawnTeamModal-DG5UbJNK.js +1 -0
  16. package/dist/web/client/assets/TeamForm-DGlxWv4e.js +1 -0
  17. package/dist/web/client/assets/TeamThread-mkwODO0S.js +1 -0
  18. package/dist/web/client/assets/UnsavedChangesGuard-BmdwLH99.js +1 -0
  19. package/dist/web/client/assets/_id-CvcxNmBH.js +1 -0
  20. package/dist/web/client/assets/_id-UyBk7gRl.js +1 -0
  21. package/dist/web/client/assets/access-C8d8vaQ6.js +1 -0
  22. package/dist/web/client/assets/agent-actions-BgE9fKHH.js +1 -0
  23. package/dist/web/client/assets/agents-CgtzqBpD.js +1 -0
  24. package/dist/web/client/assets/agents-D7W4BT8r.js +1 -0
  25. package/dist/web/client/assets/arrow-right-D0HKRb7U.js +1 -0
  26. package/dist/web/client/assets/attention-D9mQWoKt.js +1 -0
  27. package/dist/web/client/assets/bot-Bb--PFVU.js +1 -0
  28. package/dist/web/client/assets/chevron-right-bs0TUSl2.js +1 -0
  29. package/dist/web/client/assets/config-Dw6GWf38.js +1 -0
  30. package/dist/web/client/assets/createLucideIcon-DkniuEtD.js +1 -0
  31. package/dist/web/client/assets/download-C4t9l5wR.js +1 -0
  32. package/dist/web/client/assets/file-text-DzbjpYrV.js +1 -0
  33. package/dist/web/client/assets/images-DSYgPKM7.js +1 -0
  34. package/dist/web/client/assets/index-YW0gXPfk.js +14 -0
  35. package/dist/web/client/assets/key-round-BpK4-E3T.js +1 -0
  36. package/dist/web/client/assets/list-checks-JNXcmws9.js +1 -0
  37. package/dist/web/client/assets/login-DcQJk5-U.js +1 -0
  38. package/dist/web/client/assets/manage-SRGSx8n2.js +1 -0
  39. package/dist/web/client/assets/mcp-BUWu4TvS.js +1 -0
  40. package/dist/web/client/assets/message-square-DM2MP9vF.js +1 -0
  41. package/dist/web/client/assets/network-BJ4iPjQO.js +1 -0
  42. package/dist/web/client/assets/parts-LZxl9Gvc.js +41 -0
  43. package/dist/web/client/assets/plus-CLGNN5QX.js +1 -0
  44. package/dist/web/client/assets/routes-BxIIyGho.js +85 -0
  45. package/dist/web/client/assets/skills-C7DzIwFJ.js +1 -0
  46. package/dist/web/client/assets/square-terminal-Dmm6cV-G.js +1 -0
  47. package/dist/web/client/assets/style-CA2GAk9b.js +7 -0
  48. package/dist/web/client/assets/styles-C3CDSGAr.css +2 -0
  49. package/dist/web/client/assets/system-zQ0NnQML.js +1 -0
  50. package/dist/web/client/assets/teams-BEIJHObN.js +1 -0
  51. package/dist/web/client/assets/teams-DlOc7Ods.js +1 -0
  52. package/dist/web/client/assets/telegram-DKHq5DpE.js +1 -0
  53. package/dist/web/client/assets/tools-BKIpLaiC.js +1 -0
  54. package/dist/web/client/assets/use-resource-CQaIZbpy.js +1 -0
  55. package/dist/web/client/assets/users-round-BJrym3FG.js +1 -0
  56. package/dist/web/client/assets/welcome-CyS4Hrd-.js +1 -0
  57. package/dist/web/client/assets/wrench-GbE1M1RJ.js +1 -0
  58. package/dist/web/server/assets/{AddProviderDialog-Tn4AskPm.js → AddProviderDialog-Nc5mc_P6.js} +106 -8
  59. package/dist/web/server/assets/AgentTemplateParts-DZK_r3nQ.js +266 -0
  60. package/dist/web/server/assets/{ConfigPage-DqDUujmt.js → ConfigPage-CxzL-gTm.js} +2 -2
  61. package/dist/web/server/assets/{ConfirmDialog-DfaJ--A6.js → ConfirmDialog-4xeCXKHe.js} +1 -2
  62. package/dist/web/server/assets/{ConnectionsView-DAG-zNBz.js → ConnectionsView-B02FjNsM.js} +9 -9
  63. package/dist/web/server/assets/ManagePage-BfCWE8Lj.js +29 -0
  64. package/dist/web/server/assets/ModelMenu-D-hTgYOO.js +278 -0
  65. package/dist/web/server/assets/{Rail-BIC_4ptO.js → Rail-3gbidhyv.js} +17 -110
  66. package/dist/web/server/assets/{SectionTabs-BGsrf-UQ.js → SectionTabs-CWQ5orUW.js} +9 -2
  67. package/dist/web/server/assets/SkillsParts-D58l8voo.js +199 -0
  68. package/dist/web/server/assets/SpawnDialog-MJWwppgC.js +1648 -0
  69. package/dist/web/server/assets/SpawnTeamModal-RjzAeX_Q.js +124 -0
  70. package/dist/web/server/assets/TeamForm-DdOgIMiV.js +138 -0
  71. package/dist/web/server/assets/{TeamThread-DuLlGDcw.js → TeamThread-D-PvO3fu.js} +9 -9
  72. package/dist/web/server/assets/{UnsavedChangesGuard-DrOvPV14.js → UnsavedChangesGuard-Bb5frygQ.js} +1 -1
  73. package/dist/web/server/assets/{_id-TVruGcOd.js → _id-BKzOw78O.js} +11 -3
  74. package/dist/web/server/assets/_id-BPjVkcNb.js +396 -0
  75. package/dist/web/server/assets/_id-BUfy-GwH.js +16 -0
  76. package/dist/web/server/assets/{_id-yN0z7VqE.js → _id-C1_l6oSR.js} +257 -207
  77. package/dist/web/server/assets/{_id-DJnYgisy.js → _id-CHvYQhWt.js} +8 -4
  78. package/dist/web/server/assets/_id-De3Bm0SG.js +39 -0
  79. package/dist/web/server/assets/_tanstack-start-manifest_v-CR3jm1nY.js +256 -0
  80. package/dist/web/server/assets/access-CNfvQ3NB.js +295 -0
  81. package/dist/web/server/assets/{access-GMGed5O8.js → access-Cm_izIIC.js} +2 -2
  82. package/dist/web/server/assets/{access-C_pupPks.js → access-WWspT0v4.js} +2 -1
  83. package/dist/web/server/assets/agent-actions-COnfW5AU.js +20 -0
  84. package/dist/web/server/assets/agents-C7UmTjfO.js +13 -0
  85. package/dist/web/server/assets/{agents-BnWgFo6o.js → agents-CRtMfKqX.js} +9 -6
  86. package/dist/web/server/assets/agents-D0hfGIMK.js +134 -0
  87. package/dist/web/server/assets/agents-DQowl6Ly.js +31 -0
  88. package/dist/web/server/assets/agents-DzpqlIuJ.js +12 -0
  89. package/dist/web/server/assets/agents-NOkh61dV.js +323 -0
  90. package/dist/web/server/assets/attention-CRvxt22X.js +232 -0
  91. package/dist/web/server/assets/{attention-Cr7puThv.js → attention-CgWhXjX7.js} +4 -1
  92. package/dist/web/server/assets/{attention-DS3O9UmJ.js → attention-Cx9ZWPOO.js} +4 -2
  93. package/dist/web/server/assets/{config-DjTGA4iZ.js → config-B5CS8juO.js} +2 -2
  94. package/dist/web/server/assets/{config-Q7livfa3.js → config-D117117T.js} +51 -102
  95. package/dist/web/server/assets/createSsrRpc-CwTd0zrB.js +72 -0
  96. package/dist/web/server/assets/{login-VV10kZBl.js → login-IF0Gbsuq.js} +36 -2
  97. package/dist/web/server/assets/{login-JoIjlcmu.js → login-va4EtvA8.js} +34 -45
  98. package/dist/web/server/assets/manage-Ce6cI4eW.js +240 -0
  99. package/dist/web/server/assets/{mcp-ZARSOxZW.js → mcp-Bm9U6x7N.js} +2 -2
  100. package/dist/web/server/assets/mcp-C96PBxpb.js +376 -0
  101. package/dist/web/server/assets/page-title-CwcbXMhx.js +95 -0
  102. package/dist/web/server/assets/{router-Dh2-IvLL.js → router-8Iq19GOz.js} +366 -203
  103. package/dist/web/server/assets/{routes-C9NawqcV.js → routes-BLo-fWbQ.js} +2681 -1667
  104. package/dist/web/server/assets/{routes-CDskMy5C.js → routes-BXvYYFrN.js} +2 -2
  105. package/dist/web/server/assets/routes-Kwam6JmS.js +89 -0
  106. package/dist/web/server/assets/{skills-StN15QhC.js → skills-BqCnA-74.js} +2 -2
  107. package/dist/web/server/assets/skills-DSezIdDc.js +157 -0
  108. package/dist/web/server/assets/{skills-h5aHa7Q8.js → skills-DWzlT_hC.js} +9 -1
  109. package/dist/web/server/assets/{style-GYDODk2F.js → style-C2hIPY_Y.js} +2 -2
  110. package/dist/web/server/assets/{system-Dl-1RhoP.js → system-CcLCmkIC.js} +2 -2
  111. package/dist/web/server/assets/{system-DtswhLW6.js → system-D3th6n2E.js} +4 -2
  112. package/dist/web/server/assets/system-E0VePdzO.js +145 -0
  113. package/dist/web/server/assets/{teams-BxnvFTyn.js → teams-70u1XQTr.js} +1 -3
  114. package/dist/web/server/assets/{teams-YrmyutM4.js → teams-BopOP4x7.js} +8 -1
  115. package/dist/web/server/assets/teams-CQVV18D3.js +216 -0
  116. package/dist/web/server/assets/teams-CdCmBJIj.js +174 -0
  117. package/dist/web/server/assets/{teams-5PMGvHuM.js → teams-DScFp8mK.js} +2 -2
  118. package/dist/web/server/assets/{teams-CbIPKf99.js → teams-DxA-vnzY.js} +4 -2
  119. package/dist/web/server/assets/telegram-DJ8s_91Y.js +1057 -0
  120. package/dist/web/server/assets/{telegram-Cv0D4gyz.js → telegram-DR7xijeS.js} +2 -2
  121. package/dist/web/server/assets/{tools-ioJcPzMW.js → tools-CsH9DI-4.js} +2 -2
  122. package/dist/web/server/assets/{tools-OfD22R-C.js → tools-V6kezUpL.js} +55 -218
  123. package/dist/web/server/assets/{use-resource-DVzK0toP.js → use-resource-CjcJwn7F.js} +1 -1
  124. package/dist/web/server/assets/{welcome-jxmpE_Jb.js → welcome-BpmcD-ia.js} +2 -2
  125. package/dist/web/server/assets/{welcome-FFEbrNT1.js → welcome-Ya8TkL4v.js} +10 -10
  126. package/dist/web/server/server.js +19 -19
  127. package/dist/worker.js +17 -0
  128. package/dist/worker.js.map +1 -1
  129. package/package.json +1 -1
  130. package/dist/web/client/assets/AddProviderDialog-BiGLKnu2.js +0 -1
  131. package/dist/web/client/assets/ConfigPage-DvBzy2MN.js +0 -1
  132. package/dist/web/client/assets/ConfirmDialog-CiZ5tk9R.js +0 -1
  133. package/dist/web/client/assets/ConnectionsView-Czkpm2JY.js +0 -1
  134. package/dist/web/client/assets/Dialog-s_kPtI-W.js +0 -1
  135. package/dist/web/client/assets/ModelMenu-BfUPoRjV.js +0 -1
  136. package/dist/web/client/assets/SectionTabs-DENNb6Nw.js +0 -1
  137. package/dist/web/client/assets/Segmented-Dh77vmpp.js +0 -1
  138. package/dist/web/client/assets/SkillFindings-Xng11qqx.js +0 -1
  139. package/dist/web/client/assets/SkillsPicker-hI3YXvib.js +0 -1
  140. package/dist/web/client/assets/SpawnDialog-CKWFQ6jk.js +0 -1
  141. package/dist/web/client/assets/Tabs-f6bHvCGn.js +0 -1
  142. package/dist/web/client/assets/TeamForm-kda1HYZG.js +0 -1
  143. package/dist/web/client/assets/TeamThread-2rm1JGSk.js +0 -1
  144. package/dist/web/client/assets/UnsavedChangesGuard-nx6dv2Yw.js +0 -1
  145. package/dist/web/client/assets/_id-B72mIpcE.js +0 -1
  146. package/dist/web/client/assets/_id-Bzavnza1.js +0 -1
  147. package/dist/web/client/assets/access-Yw9jODuk.js +0 -1
  148. package/dist/web/client/assets/agents-C9xoyL7o.js +0 -1
  149. package/dist/web/client/assets/agents-TviG16wx.js +0 -1
  150. package/dist/web/client/assets/api-HC_YzjBy.js +0 -1
  151. package/dist/web/client/assets/arrow-right-Gm_FDWJ_.js +0 -1
  152. package/dist/web/client/assets/attention-DmURtlJm.js +0 -1
  153. package/dist/web/client/assets/check-BjgKoGvU.js +0 -1
  154. package/dist/web/client/assets/chevron-right-CUZiA2aG.js +0 -1
  155. package/dist/web/client/assets/config-UZz_mjO5.js +0 -1
  156. package/dist/web/client/assets/createLucideIcon-C6gOo8sD.js +0 -1
  157. package/dist/web/client/assets/dist-BWppw70N.js +0 -41
  158. package/dist/web/client/assets/dist-D2dwY7MR.js +0 -1
  159. package/dist/web/client/assets/entities-xVoB-p2j.js +0 -1
  160. package/dist/web/client/assets/index-Df1oUtAP.js +0 -14
  161. package/dist/web/client/assets/link-Cbztlp_R.js +0 -1
  162. package/dist/web/client/assets/login-CPfdaqsV.js +0 -1
  163. package/dist/web/client/assets/mcp-FlYnNon0.js +0 -1
  164. package/dist/web/client/assets/model-facts-DoB6QD5y.js +0 -1
  165. package/dist/web/client/assets/parts-tIDBNsYA.js +0 -1
  166. package/dist/web/client/assets/plus-CWrKMtvA.js +0 -1
  167. package/dist/web/client/assets/routes-BZaWCoQj.js +0 -76
  168. package/dist/web/client/assets/save-f9O-CQia.js +0 -1
  169. package/dist/web/client/assets/skills-C7yDPC8s.js +0 -1
  170. package/dist/web/client/assets/style-DDuTFJUu.js +0 -7
  171. package/dist/web/client/assets/styles-BviXU81u.css +0 -2
  172. package/dist/web/client/assets/system-CL3Kz36L.js +0 -1
  173. package/dist/web/client/assets/teams-CQTEF5gV.js +0 -1
  174. package/dist/web/client/assets/teams-DQ7SqVyF.js +0 -1
  175. package/dist/web/client/assets/telegram-BLgxtGhZ.js +0 -1
  176. package/dist/web/client/assets/tools-pOQyGVYo.js +0 -1
  177. package/dist/web/client/assets/use-resource-C3MBZJop.js +0 -1
  178. package/dist/web/client/assets/welcome-Hr6JpMef.js +0 -1
  179. package/dist/web/client/assets/wrench-6BEIqKDn.js +0 -1
  180. package/dist/web/server/assets/Dialog-aup_yJv5.js +0 -85
  181. package/dist/web/server/assets/ModelMenu-DUY9aHkE.js +0 -138
  182. package/dist/web/server/assets/SkillFindings-BdATze1A.js +0 -46
  183. package/dist/web/server/assets/SkillsPicker-DlqEfRWh.js +0 -67
  184. package/dist/web/server/assets/SpawnDialog-D_SMPCG_.js +0 -132
  185. package/dist/web/server/assets/Tabs-BhF41MfQ.js +0 -20
  186. package/dist/web/server/assets/TeamForm-ilBaeLI4.js +0 -96
  187. package/dist/web/server/assets/_id-BsZcsabI.js +0 -383
  188. package/dist/web/server/assets/_id-D8Kj0F30.js +0 -18
  189. package/dist/web/server/assets/_id-QYifTM9w.js +0 -28
  190. package/dist/web/server/assets/_tanstack-start-manifest_v-D6zrzUC7.js +0 -223
  191. package/dist/web/server/assets/access-DKOpcHIJ.js +0 -232
  192. package/dist/web/server/assets/agents-B6OR3x99.js +0 -327
  193. package/dist/web/server/assets/agents-B7642eRO.js +0 -130
  194. package/dist/web/server/assets/agents-BJ-_oC2e.js +0 -14
  195. package/dist/web/server/assets/agents-CjV0w-Zy.js +0 -12
  196. package/dist/web/server/assets/agents-Dy_Q-9lG.js +0 -27
  197. package/dist/web/server/assets/attention-CLP4HYBz.js +0 -216
  198. package/dist/web/server/assets/createSsrRpc-GCCF14VW.js +0 -169
  199. package/dist/web/server/assets/entities-Dn2xzKIw.js +0 -16
  200. package/dist/web/server/assets/mcp-BI-FD-JI.js +0 -250
  201. package/dist/web/server/assets/model-facts-mrfrWQne.js +0 -136
  202. package/dist/web/server/assets/parts-B31PJkhi.js +0 -190
  203. package/dist/web/server/assets/routes-BJIJWCIE.js +0 -16
  204. package/dist/web/server/assets/skills-BqLq3ZXq.js +0 -275
  205. package/dist/web/server/assets/system-BtRA2HUs.js +0 -138
  206. package/dist/web/server/assets/teams-COaU0wN9.js +0 -108
  207. package/dist/web/server/assets/teams-Ca8W4mvl.js +0 -88
  208. package/dist/web/server/assets/telegram-Yx8nm6Ei.js +0 -984
  209. package/dist/web/server/assets/utils-C_uf36nf.js +0 -8
  210. package/dist/web/server/assets/workspace-DaitCM0t.js +0 -651
@@ -1,67 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- //#region src/components/SkillsPicker.tsx
3
- /** Which skills an Agent template attaches at spawn: every installed skill, or the ticked ones. */
4
- function SkillsPicker({ mode, onModeChange, picked, onPickedChange, skills }) {
5
- function toggle(name) {
6
- const next = new Set(picked);
7
- if (next.has(name)) next.delete(name);
8
- else next.add(name);
9
- onPickedChange(next);
10
- }
11
- return /* @__PURE__ */ jsxs("fieldset", {
12
- className: "m-0 border-0 p-0",
13
- children: [
14
- /* @__PURE__ */ jsx("legend", {
15
- className: "sr-only",
16
- children: "Skills at spawn"
17
- }),
18
- /* @__PURE__ */ jsxs("label", {
19
- className: "my-2 flex cursor-pointer items-start gap-2",
20
- children: [/* @__PURE__ */ jsx("input", {
21
- type: "radio",
22
- checked: mode === "all",
23
- onChange: () => onModeChange("all")
24
- }), /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx("strong", { children: "All skills" }), ": every installed skill is attached at spawn."] })]
25
- }),
26
- /* @__PURE__ */ jsxs("label", {
27
- className: "my-2 flex cursor-pointer items-start gap-2",
28
- children: [/* @__PURE__ */ jsx("input", {
29
- type: "radio",
30
- checked: mode === "selected",
31
- onChange: () => onModeChange("selected")
32
- }), /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx("strong", { children: "Selected skills" }), ": only the ones ticked below."] })]
33
- }),
34
- /* @__PURE__ */ jsx("div", {
35
- className: `mt-3 max-h-[22rem] overflow-y-auto rounded-md border border-frost p-3 ${mode === "all" ? "pointer-events-none opacity-50" : ""}`,
36
- children: skills.length === 0 ? /* @__PURE__ */ jsxs("p", {
37
- className: "muted",
38
- children: [
39
- "No skills installed yet. Import some on ",
40
- /* @__PURE__ */ jsx("a", {
41
- href: "/skills",
42
- children: "Skills"
43
- }),
44
- "."
45
- ]
46
- }) : skills.map((skill) => /* @__PURE__ */ jsxs("label", {
47
- className: "my-1.5 flex cursor-pointer items-start gap-2",
48
- children: [/* @__PURE__ */ jsx("input", {
49
- type: "checkbox",
50
- checked: picked.has(skill.name),
51
- disabled: mode === "all",
52
- onChange: () => toggle(skill.name)
53
- }), /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx("code", { children: skill.name }), skill.description && /* @__PURE__ */ jsxs("span", {
54
- className: "text-[0.9em] text-mocha-light",
55
- children: [" — ", skill.description]
56
- })] })]
57
- }, skill.name))
58
- }),
59
- /* @__PURE__ */ jsx("p", {
60
- className: "muted mt-2 text-[0.85em]",
61
- children: "Each Agent can still attach or detach skills after it is spawned."
62
- })
63
- ]
64
- });
65
- }
66
- //#endregion
67
- export { SkillsPicker as t };
@@ -1,132 +0,0 @@
1
- import { C as api, T as errorMessage, u as Button } from "./workspace-DaitCM0t.js";
2
- import "./entities-Dn2xzKIw.js";
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";
5
- import { useEffect, useState } from "react";
6
- import { useNavigate } from "@tanstack/react-router";
7
- 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
- //#region src/components/SpawnDialog.tsx
27
- /** The one way to spawn an Agent; opens its chat afterwards. */
28
- function SpawnDialog({ profiles, teams, profileId: initialProfileId, teamId: initialTeamId, onClose }) {
29
- const navigate = useNavigate();
30
- const [profileId, setProfileId] = useState(initialProfileId ?? profiles.find((profile) => profile.id === "default")?.id ?? profiles[0]?.id ?? "");
31
- const [name, setName] = useState("");
32
- const [model, setModel] = useState("");
33
- const [chatModels, setChatModels] = useState([]);
34
- const [teamId, setTeamId] = useState(teams.find((team) => team.id === initialTeamId)?.id ?? teams.find((team) => team.id === "default")?.id ?? teams[0]?.id ?? "");
35
- const [busy, setBusy] = useState(false);
36
- const [error, setError] = useState(null);
37
- const restricted = teams.find((team) => team.id === teamId)?.policyMode === "restricted";
38
- useEffect(() => {
39
- const controller = new AbortController();
40
- api(MODELS_PATH, { signal: controller.signal }).then((response) => setChatModels(response.chat)).catch(() => {});
41
- return () => controller.abort();
42
- }, []);
43
- async function submit(event) {
44
- event.preventDefault();
45
- setError(null);
46
- setBusy(true);
47
- try {
48
- const request = {
49
- profileId,
50
- teamId
51
- };
52
- if (name.trim()) request.name = name.trim();
53
- if (model) request.model = model;
54
- const { agent } = await api("/api/agents", { body: request });
55
- onClose();
56
- await navigate({
57
- to: "/",
58
- search: { agent: agent.id }
59
- });
60
- } catch (cause) {
61
- setError(errorMessage(cause));
62
- setBusy(false);
63
- }
64
- }
65
- return /* @__PURE__ */ jsx(Dialog, {
66
- title: "Spawn an agent",
67
- busy,
68
- onClose,
69
- children: /* @__PURE__ */ jsxs("form", {
70
- onSubmit: (event) => void submit(event),
71
- children: [
72
- /* @__PURE__ */ jsxs("label", { children: ["Agent template", /* @__PURE__ */ jsx("select", {
73
- value: profileId,
74
- onChange: (event) => setProfileId(event.target.value),
75
- required: true,
76
- children: profiles.map((profile) => /* @__PURE__ */ jsx("option", {
77
- 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", {
82
- value: name,
83
- onChange: (event) => setName(event.target.value),
84
- autoComplete: "off"
85
- })] }),
86
- /* @__PURE__ */ jsx(ModelMenu, {
87
- label: "Model",
88
- value: model,
89
- onChange: setModel,
90
- models: chatModels,
91
- inherited: {
92
- label: "The template’s model",
93
- model: profiles.find((profile) => profile.id === profileId)?.defaultModel
94
- }
95
- }),
96
- /* @__PURE__ */ jsxs("label", { children: ["Team", /* @__PURE__ */ jsx("select", {
97
- value: teamId,
98
- onChange: (event) => setTeamId(event.target.value),
99
- children: teams.map((team) => /* @__PURE__ */ jsxs("option", {
100
- 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."
107
- }),
108
- error && /* @__PURE__ */ jsx("p", {
109
- role: "alert",
110
- className: "err mt-2",
111
- children: error
112
- }),
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
- })
127
- ]
128
- })
129
- });
130
- }
131
- //#endregion
132
- export { unarchiveAgent as a, renameAgent as i, archiveAgent as n, deleteAgent as r, SpawnDialog as t };
@@ -1,20 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- //#region src/components/Tabs.tsx
3
- /** In-page tabs that switch between panels of one form or page. */
4
- function Tabs({ items, active, onChange }) {
5
- return /* @__PURE__ */ jsx("div", {
6
- role: "tablist",
7
- className: "mb-5 flex flex-wrap gap-1 border-b border-frost",
8
- children: items.map((item) => /* @__PURE__ */ jsx("button", {
9
- type: "button",
10
- role: "tab",
11
- "aria-selected": active === item.id,
12
- disabled: item.disabled,
13
- onClick: () => onChange(item.id),
14
- className: `unstyled -mb-px border-b-2 bg-transparent px-4 py-2 text-[0.9em] font-medium transition-colors ${item.disabled ? "cursor-not-allowed border-transparent text-mocha-light/40" : active === item.id ? "cursor-pointer border-sapphire text-sapphire" : "cursor-pointer border-transparent text-mocha hover:text-sapphire"}`,
15
- children: item.label
16
- }, item.id))
17
- });
18
- }
19
- //#endregion
20
- export { Tabs as t };
@@ -1,96 +0,0 @@
1
- import { C as api, T as errorMessage, u as Button } from "./workspace-DaitCM0t.js";
2
- import { useState } from "react";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
- //#region src/components/TeamForm.tsx
5
- /**
6
- * Register a Team: a slug, an optional name and an optional absolute path the slot links to
7
- * (empty creates a fresh directory under ~/.bazilion/teams/<slug>/).
8
- */
9
- function TeamForm({ onCreated, onBusyChange, extraActions }) {
10
- const [id, setId] = useState("");
11
- const [name, setName] = useState("");
12
- const [link, setLink] = useState("");
13
- const [busy, setBusy] = useState(false);
14
- const [error, setError] = useState(null);
15
- function changeBusy(next) {
16
- setBusy(next);
17
- onBusyChange?.(next);
18
- }
19
- async function submit(event) {
20
- event.preventDefault();
21
- setError(null);
22
- changeBusy(true);
23
- try {
24
- const team = await api("/api/teams", { body: {
25
- id: id.trim(),
26
- name: name.trim() || void 0,
27
- link: link.trim() || void 0
28
- } });
29
- setId("");
30
- setName("");
31
- setLink("");
32
- await onCreated(team);
33
- } catch (cause) {
34
- setError(errorMessage(cause));
35
- } finally {
36
- changeBusy(false);
37
- }
38
- }
39
- return /* @__PURE__ */ jsxs("form", {
40
- onSubmit: (event) => void submit(event),
41
- children: [
42
- /* @__PURE__ */ jsxs("div", {
43
- className: "grid gap-x-4 sm:grid-cols-2",
44
- children: [
45
- /* @__PURE__ */ jsxs("label", { children: ["ID (slug)", /* @__PURE__ */ jsx("input", {
46
- value: id,
47
- onChange: (event) => setId(event.target.value),
48
- required: true,
49
- pattern: "[a-z0-9][a-z0-9\\-]*",
50
- placeholder: "my-project"
51
- })] }),
52
- /* @__PURE__ */ jsxs("label", { children: ["Name (optional)", /* @__PURE__ */ jsx("input", {
53
- value: name,
54
- onChange: (event) => setName(event.target.value),
55
- placeholder: "My project"
56
- })] }),
57
- /* @__PURE__ */ jsxs("label", {
58
- className: "sm:col-span-2",
59
- children: [
60
- "Link target (optional, absolute path)",
61
- /* @__PURE__ */ jsx("input", {
62
- value: link,
63
- onChange: (event) => setLink(event.target.value),
64
- placeholder: "/home/you/projects/my-project"
65
- }),
66
- /* @__PURE__ */ jsxs("span", {
67
- className: "mt-1 block text-xs text-muted-foreground",
68
- children: [
69
- "Leave blank for a fresh directory under ",
70
- /* @__PURE__ */ jsx("code", { children: "~/.bazilion/teams/<slug>/" }),
71
- ". Give a path to link the Team to an existing project tree."
72
- ]
73
- })
74
- ]
75
- })
76
- ]
77
- }),
78
- error && /* @__PURE__ */ jsx("p", {
79
- role: "alert",
80
- className: "err mt-2",
81
- children: error
82
- }),
83
- /* @__PURE__ */ jsxs("div", {
84
- className: "mt-4 flex flex-wrap justify-end gap-2",
85
- children: [extraActions?.(busy), /* @__PURE__ */ jsx(Button, {
86
- variant: "primary",
87
- type: "submit",
88
- disabled: busy || !id.trim(),
89
- children: busy ? "Creating…" : "Create team"
90
- })]
91
- })
92
- ]
93
- });
94
- }
95
- //#endregion
96
- export { TeamForm as t };
@@ -1,383 +0,0 @@
1
- import { C as api, T as errorMessage, u as Button } from "./workspace-DaitCM0t.js";
2
- import { t as UnsavedChangesGuard } from "./UnsavedChangesGuard-DrOvPV14.js";
3
- import { n as ModelMenu } from "./ModelMenu-DUY9aHkE.js";
4
- import { o as PageShell } from "./createSsrRpc-GCCF14VW.js";
5
- import { t as Route } from "./_id-D8Kj0F30.js";
6
- import { n as SectionTabs, r as TEMPLATE_TABS } from "./SectionTabs-BGsrf-UQ.js";
7
- import { t as Tabs } from "./Tabs-BhF41MfQ.js";
8
- import { t as SkillsPicker } from "./SkillsPicker-DlqEfRWh.js";
9
- import { useCallback, useEffect, useState } from "react";
10
- import { useRouter } from "@tanstack/react-router";
11
- import { jsx, jsxs } from "react/jsx-runtime";
12
- //#region src/routes/templates/agents/$id/index.tsx?tsr-split=component
13
- function ProfileDetailPage() {
14
- const { loaded, chatModels, skills } = Route.useLoaderData();
15
- const { profile, files } = loaded;
16
- const [tab, setTab] = useState("basics");
17
- const [dirtySections, setDirtySections] = useState({});
18
- const reportDirty = useCallback((section, dirty) => {
19
- setDirtySections((current) => current[section] === dirty ? current : {
20
- ...current,
21
- [section]: dirty
22
- });
23
- }, []);
24
- const dirtyCount = Object.values(dirtySections).filter(Boolean).length;
25
- return /* @__PURE__ */ jsxs(PageShell, { children: [
26
- /* @__PURE__ */ jsx(UnsavedChangesGuard, {
27
- when: dirtyCount > 0,
28
- subject: "Agent template changes"
29
- }),
30
- /* @__PURE__ */ jsx(SectionTabs, {
31
- label: "Template kinds",
32
- base: "/templates",
33
- tabs: TEMPLATE_TABS
34
- }),
35
- /* @__PURE__ */ jsxs("header", { children: [
36
- /* @__PURE__ */ jsx("a", {
37
- href: "/templates/agents",
38
- className: "mb-1 inline-block text-[0.85em] text-mocha-light hover:text-sapphire",
39
- children: "← Agent templates"
40
- }),
41
- /* @__PURE__ */ jsx("h1", { children: profile.name }),
42
- /* @__PURE__ */ jsxs("div", {
43
- className: "mt-1 flex flex-wrap items-center gap-2 text-[0.9em] text-mocha-light",
44
- children: [
45
- /* @__PURE__ */ jsx("code", { children: profile.id }),
46
- /* @__PURE__ */ jsx("span", { children: "·" }),
47
- /* @__PURE__ */ jsxs("span", { children: ["model: ", /* @__PURE__ */ jsx("code", { children: profile.defaultModel })] })
48
- ]
49
- }),
50
- /* @__PURE__ */ jsx("p", {
51
- className: "muted mt-4",
52
- children: "These settings and files seed every agent spawned from this template from now on. Existing agents keep their own copies."
53
- })
54
- ] }),
55
- /* @__PURE__ */ jsx(Tabs, {
56
- items: [{
57
- id: "basics",
58
- label: "Basics"
59
- }, {
60
- id: "skills",
61
- label: "Skills"
62
- }],
63
- active: tab,
64
- onChange: setTab
65
- }),
66
- dirtyCount > 0 && /* @__PURE__ */ jsxs("p", {
67
- role: "status",
68
- className: "text-sm text-warning",
69
- children: [
70
- dirtyCount,
71
- " unsaved ",
72
- dirtyCount === 1 ? "section" : "sections",
73
- ": switching tabs keeps them; leaving the page asks first."
74
- ]
75
- }),
76
- /* @__PURE__ */ jsxs("div", {
77
- hidden: tab !== "basics",
78
- className: "space-y-5",
79
- children: [
80
- /* @__PURE__ */ jsx(SettingsCard, {
81
- profileId: profile.id,
82
- initialName: profile.name,
83
- currentModel: profile.defaultModel,
84
- chatModels,
85
- onDirtyChange: reportDirty
86
- }),
87
- /* @__PURE__ */ jsx(FileCard, {
88
- profileId: profile.id,
89
- file: "SOUL.md",
90
- initial: files.soul,
91
- rows: 14,
92
- onDirtyChange: reportDirty
93
- }),
94
- /* @__PURE__ */ jsx(FileCard, {
95
- profileId: profile.id,
96
- file: "IDENTITY.md",
97
- initial: files.identity,
98
- rows: 10,
99
- onDirtyChange: reportDirty
100
- }),
101
- files.bootstrap === null ? /* @__PURE__ */ jsx(Card, {
102
- title: "BOOTSTRAP.md",
103
- children: /* @__PURE__ */ jsx("p", {
104
- className: "muted",
105
- children: "This template has no first-run ritual, so spawned agents get no intro message."
106
- })
107
- }) : /* @__PURE__ */ jsx(FileCard, {
108
- profileId: profile.id,
109
- file: "BOOTSTRAP.md",
110
- initial: files.bootstrap,
111
- rows: 10,
112
- onDirtyChange: reportDirty
113
- }),
114
- /* @__PURE__ */ jsx(OptionalFileCard, {
115
- profileId: profile.id,
116
- file: "AGENTS.md",
117
- initial: files.agents,
118
- hint: "Peers and routing notes: who this agent can hand off to.",
119
- onDirtyChange: reportDirty
120
- }),
121
- /* @__PURE__ */ jsx(OptionalFileCard, {
122
- profileId: profile.id,
123
- file: "TOOLS.md",
124
- initial: files.tools,
125
- hint: "Agent-specific tool notes beyond the generic tool descriptions.",
126
- onDirtyChange: reportDirty
127
- })
128
- ]
129
- }),
130
- /* @__PURE__ */ jsx("div", {
131
- hidden: tab !== "skills",
132
- children: /* @__PURE__ */ jsx(SkillsCard, {
133
- profileId: profile.id,
134
- initialMode: profile.skillsMode,
135
- initialPicked: loaded.defaultSkills,
136
- skills,
137
- onDirtyChange: reportDirty
138
- })
139
- })
140
- ] });
141
- }
142
- var IDLE = {
143
- kind: "idle",
144
- message: ""
145
- };
146
- /** Saving and failure win over "unsaved changes". */
147
- function shownStatus(dirty, status) {
148
- return dirty && status.kind !== "saving" && status.kind !== "error" ? {
149
- kind: "idle",
150
- message: "unsaved changes",
151
- dirty: true
152
- } : status;
153
- }
154
- function useDirty(section, dirty, onDirtyChange) {
155
- useEffect(() => onDirtyChange(section, dirty), [
156
- dirty,
157
- onDirtyChange,
158
- section
159
- ]);
160
- }
161
- function Card({ title, status, children }) {
162
- const tone = status?.kind === "saved" ? "text-sapphire" : status?.kind === "error" ? "text-danger" : status?.dirty ? "text-mocha" : "text-mocha-light";
163
- return /* @__PURE__ */ jsxs("section", {
164
- className: "rounded-[16px] border border-frost bg-snow p-5 shadow-baziu-sm",
165
- children: [/* @__PURE__ */ jsxs("div", {
166
- className: "mb-2 flex items-baseline justify-between",
167
- children: [/* @__PURE__ */ jsx("h3", {
168
- className: "m-0 font-mono text-[0.95em] font-semibold normal-case tracking-normal text-chocolate",
169
- children: title
170
- }), status?.message && /* @__PURE__ */ jsx("span", {
171
- role: status.kind === "error" ? "alert" : "status",
172
- className: `text-[0.82em] ${tone}`,
173
- children: status.message
174
- })]
175
- }), children]
176
- });
177
- }
178
- /** Run a save, reporting progress in the card's status line. */
179
- async function saving(setStatus, save) {
180
- setStatus({
181
- kind: "saving",
182
- message: "saving…"
183
- });
184
- try {
185
- await save();
186
- setStatus({
187
- kind: "saved",
188
- message: "saved"
189
- });
190
- } catch (cause) {
191
- setStatus({
192
- kind: "error",
193
- message: `error: ${errorMessage(cause)}`
194
- });
195
- }
196
- }
197
- function filePath(profileId, file) {
198
- return `/api/profiles/${encodeURIComponent(profileId)}/files/${encodeURIComponent(file)}`;
199
- }
200
- function FileCard({ profileId, file, initial, rows, onDirtyChange }) {
201
- const [original, setOriginal] = useState(initial);
202
- const [content, setContent] = useState(initial);
203
- const [status, setStatus] = useState(IDLE);
204
- const dirty = content !== original;
205
- useDirty(`file:${file}`, dirty, onDirtyChange);
206
- return /* @__PURE__ */ jsxs(Card, {
207
- title: file,
208
- status: shownStatus(dirty, status),
209
- children: [/* @__PURE__ */ jsx("textarea", {
210
- "aria-label": `${file} contents`,
211
- rows,
212
- value: content,
213
- onChange: (event) => setContent(event.target.value),
214
- className: "font-mono text-[0.88em] leading-[1.55]"
215
- }), /* @__PURE__ */ jsxs("div", {
216
- className: "mt-3 flex gap-2",
217
- children: [/* @__PURE__ */ jsx(Button, {
218
- variant: "primary",
219
- disabled: status.kind === "saving",
220
- onClick: () => void saving(setStatus, async () => {
221
- await api(filePath(profileId, file), {
222
- method: "PUT",
223
- body: { content }
224
- });
225
- setOriginal(content);
226
- }),
227
- children: "Save"
228
- }), /* @__PURE__ */ jsx(Button, {
229
- variant: "ghost",
230
- onClick: () => {
231
- setContent(original);
232
- setStatus(IDLE);
233
- },
234
- children: "Revert"
235
- })]
236
- })]
237
- });
238
- }
239
- function OptionalFileCard({ profileId, file, initial, hint, onDirtyChange }) {
240
- const router = useRouter();
241
- const [status, setStatus] = useState(IDLE);
242
- if (initial === null) return /* @__PURE__ */ jsxs(Card, {
243
- title: file,
244
- status,
245
- children: [/* @__PURE__ */ jsx("p", {
246
- className: "muted my-1",
247
- children: hint
248
- }), /* @__PURE__ */ jsx(Button, {
249
- variant: "primary",
250
- className: "mt-3",
251
- disabled: status.kind === "saving",
252
- onClick: () => void saving(setStatus, async () => {
253
- await api(filePath(profileId, file), {
254
- method: "PUT",
255
- body: { content: "" }
256
- });
257
- await router.invalidate();
258
- }),
259
- children: status.kind === "saving" ? "Creating…" : "Create empty"
260
- })]
261
- });
262
- return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
263
- className: "muted mb-2 ml-1 text-[0.85em]",
264
- children: hint
265
- }), /* @__PURE__ */ jsx(FileCard, {
266
- profileId,
267
- file,
268
- initial,
269
- rows: 10,
270
- onDirtyChange
271
- })] });
272
- }
273
- function SettingsCard({ profileId, initialName, currentModel, chatModels, onDirtyChange }) {
274
- const router = useRouter();
275
- const [original, setOriginal] = useState({
276
- name: initialName,
277
- model: currentModel
278
- });
279
- const [name, setName] = useState(initialName);
280
- const [model, setModel] = useState(currentModel);
281
- const [status, setStatus] = useState(IDLE);
282
- const dirty = name !== original.name || model !== original.model;
283
- useDirty("settings", dirty, onDirtyChange);
284
- return /* @__PURE__ */ jsx(Card, {
285
- title: "settings",
286
- status: shownStatus(dirty, status),
287
- children: /* @__PURE__ */ jsxs("form", {
288
- onSubmit: (event) => {
289
- event.preventDefault();
290
- saving(setStatus, async () => {
291
- const next = {
292
- name: name.trim(),
293
- model
294
- };
295
- await api(`/api/profiles/${encodeURIComponent(profileId)}`, {
296
- method: "PATCH",
297
- body: {
298
- name: next.name,
299
- defaultModel: next.model
300
- }
301
- });
302
- await router.invalidate();
303
- setName(next.name);
304
- setOriginal(next);
305
- });
306
- },
307
- children: [/* @__PURE__ */ jsxs("div", {
308
- className: "grid gap-x-4 sm:grid-cols-2",
309
- children: [/* @__PURE__ */ jsxs("label", { children: ["Name", /* @__PURE__ */ jsx("input", {
310
- value: name,
311
- onChange: (event) => setName(event.target.value)
312
- })] }), /* @__PURE__ */ jsx(ModelMenu, {
313
- label: "Default model",
314
- value: model,
315
- onChange: setModel,
316
- models: chatModels,
317
- required: true
318
- })]
319
- }), /* @__PURE__ */ jsx(Button, {
320
- variant: "primary",
321
- type: "submit",
322
- className: "mt-3",
323
- disabled: !dirty || status.kind === "saving",
324
- children: "Save settings"
325
- })]
326
- })
327
- });
328
- }
329
- function SkillsCard({ profileId, initialMode, initialPicked, skills, onDirtyChange }) {
330
- const router = useRouter();
331
- const [original, setOriginal] = useState({
332
- mode: initialMode,
333
- picked: new Set(initialPicked)
334
- });
335
- const [mode, setMode] = useState(initialMode);
336
- const [picked, setPicked] = useState(() => new Set(initialPicked));
337
- const [status, setStatus] = useState(IDLE);
338
- const dirty = mode !== original.mode || picked.size !== original.picked.size || [...picked].some((name) => !original.picked.has(name));
339
- useDirty("skills", dirty, onDirtyChange);
340
- return /* @__PURE__ */ jsxs(Card, {
341
- title: "skills",
342
- status: shownStatus(dirty, status),
343
- children: [/* @__PURE__ */ jsx("p", {
344
- className: "muted my-2",
345
- children: "What agents spawned from this template start with. Existing agents keep their skills."
346
- }), /* @__PURE__ */ jsxs("form", {
347
- onSubmit: (event) => {
348
- event.preventDefault();
349
- saving(setStatus, async () => {
350
- const saved = mode === "selected" ? new Set(picked) : /* @__PURE__ */ new Set();
351
- await api(`/api/profiles/${encodeURIComponent(profileId)}`, {
352
- method: "PATCH",
353
- body: {
354
- skillsMode: mode,
355
- defaultSkills: [...saved]
356
- }
357
- });
358
- await router.invalidate();
359
- setPicked(saved);
360
- setOriginal({
361
- mode,
362
- picked: saved
363
- });
364
- });
365
- },
366
- children: [/* @__PURE__ */ jsx(SkillsPicker, {
367
- mode,
368
- onModeChange: setMode,
369
- picked,
370
- onPickedChange: setPicked,
371
- skills
372
- }), /* @__PURE__ */ jsx(Button, {
373
- variant: "primary",
374
- type: "submit",
375
- className: "mt-3",
376
- disabled: !dirty || status.kind === "saving",
377
- children: "Save skills"
378
- })]
379
- })]
380
- });
381
- }
382
- //#endregion
383
- export { ProfileDetailPage as component };