bazilion 0.8.0 → 0.10.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 (217) hide show
  1. package/README.md +47 -5
  2. package/dist/cli.js +1190 -640
  3. package/dist/cli.js.map +1 -1
  4. package/dist/daemon.js +5165 -1598
  5. package/dist/daemon.js.map +1 -1
  6. package/dist/migrations/0001_init.sql +318 -88
  7. package/dist/web/client/assets/AgentTabs-B3hq5a3e.js +1 -0
  8. package/dist/web/client/assets/ConfigPage-BCwfgyjD.js +1 -0
  9. package/dist/web/client/assets/FieldRow-avAFLgYW.js +1 -0
  10. package/dist/web/client/assets/Page-CwNuDhWz.js +1 -0
  11. package/dist/web/client/assets/ProductionTeamPolicyEditor-CiQ-VVDo.js +7 -0
  12. package/dist/web/client/assets/ProductionTeamPolicyEditor-DLioOiRN.css +1 -0
  13. package/dist/web/client/assets/ProfileCommunicationEditor-D84F5yfr.js +1 -0
  14. package/dist/web/client/assets/RecoveryState-QfMSuwy3.js +1 -0
  15. package/dist/web/client/assets/SectionTabs-DZzy01az.js +1 -0
  16. package/dist/web/client/assets/TeamTabs-Btoe_FAE.js +1 -0
  17. package/dist/web/client/assets/TemplatesTabs-CAYY03F5.js +1 -0
  18. package/dist/web/client/assets/_id-BeauECmk.js +1 -0
  19. package/dist/web/client/assets/_id-BqU2BodK.js +1 -0
  20. package/dist/web/client/assets/_id-CKtoio3t.js +1 -0
  21. package/dist/web/client/assets/_id-DGyKURCp.js +1 -0
  22. package/dist/web/client/assets/_id-Q98Of6k9.js +1 -0
  23. package/dist/web/client/assets/activity-DJuhhQCb.js +1 -0
  24. package/dist/web/client/assets/activity-DXN_N85w.js +1 -0
  25. package/dist/web/client/assets/agents-C5Xsdge1.js +1 -0
  26. package/dist/web/client/assets/agents-Cgxo4H5G.js +1 -0
  27. package/dist/web/client/assets/approvals-BnG7fbw-.js +1 -0
  28. package/dist/web/client/assets/approvals-DGi0PSx8.js +1 -0
  29. package/dist/web/client/assets/chevron-down-BhcBspw3.js +1 -0
  30. package/dist/web/client/assets/config-xw4NyrXF.js +3 -0
  31. package/dist/web/client/assets/context-D2V1Oi4z.js +1 -0
  32. package/dist/web/client/assets/inbox-DK6hWCMp.js +1 -0
  33. package/dist/web/client/assets/index-VdURSoM4.js +12 -0
  34. package/dist/web/client/assets/login-CvptUoMR.js +1 -0
  35. package/dist/web/client/assets/mcp-BDFM_sW-.js +1 -0
  36. package/dist/web/client/assets/members-BJvph_TR.js +1 -0
  37. package/dist/web/client/assets/memory-DRytqZCD.js +1 -0
  38. package/dist/web/client/assets/plus-C9ee3SIO.js +1 -0
  39. package/dist/web/client/assets/policy-CGP50OtQ.js +1 -0
  40. package/dist/web/client/assets/policy-K4hIbbIN.js +1 -0
  41. package/dist/web/client/assets/preload-helper-mNuBjNXU.js +1 -0
  42. package/dist/web/client/assets/react-3W8R1pOO.js +1 -0
  43. package/dist/web/client/assets/routes-DJnWYvC9.js +1 -0
  44. package/dist/web/client/assets/services-DHheiv7L.js +1 -0
  45. package/dist/web/client/assets/skills-DmsitluU.js +1 -0
  46. package/dist/web/client/assets/styles-B5eQAwLP.css +2 -0
  47. package/dist/web/client/assets/team-policy-D0jpnn2b.js +1 -0
  48. package/dist/web/client/assets/teams-BdC4gthq.js +1 -0
  49. package/dist/web/client/assets/teams-CSNyLz3l.js +1 -0
  50. package/dist/web/client/assets/teams-CbxSaorm.js +1 -0
  51. package/dist/web/client/assets/telegram-D61G_alO.js +1 -0
  52. package/dist/web/client/assets/tokens-CjRplDrJ.js +1 -0
  53. package/dist/web/client/assets/triggers-MLzTm_DM.js +1 -0
  54. package/dist/web/client/assets/welcome-wBfX9dAd.js +1 -0
  55. package/dist/web/client/assets/{ChatPane-DzEgOEqS.js → wire-constants-BxfyUMXB.js} +4 -4
  56. package/dist/web/server/assets/{AgentTabs-BOjTN7QF.js → AgentTabs-DoMDJBXH.js} +10 -7
  57. package/dist/web/server/assets/{ChatPane-BvpswYvF.js → ChatPane-eUY_dga3.js} +38 -20
  58. package/dist/web/server/assets/ConfigPage-BKlh5vOU.js +68 -0
  59. package/dist/web/server/assets/{FieldRow-DwyqycWI.js → FieldRow-B4eTegH9.js} +5 -5
  60. package/dist/web/server/assets/Page-LENulSXY.js +111 -0
  61. package/dist/web/server/assets/ProductionTeamPolicyEditor-Y4mzFFvR.js +1009 -0
  62. package/dist/web/server/assets/ProfileCommunicationEditor-C2RU-2QB.js +107 -0
  63. package/dist/web/server/assets/RecoveryState-B2SG-mrY.js +37 -0
  64. package/dist/web/server/assets/SectionTabs-BJTPr5nU.js +8 -0
  65. package/dist/web/server/assets/Sidebar-O_CH1-JD.js +964 -0
  66. package/dist/web/server/assets/TeamTabs-zZzbP1t_.js +51 -0
  67. package/dist/web/server/assets/{TemplatesTabs---7h5GYa.js → TemplatesTabs-CcRxZhJe.js} +9 -8
  68. package/dist/web/server/assets/_id-A8Xiv6Lc.js +11 -0
  69. package/dist/web/server/assets/{_id-Sjw0zhA6.js → _id-BhOB8Umi.js} +5 -5
  70. package/dist/web/server/assets/{_id-DDixKEud.js → _id-C3HY4lWg.js} +77 -20
  71. package/dist/web/server/assets/{_id-BdRiQb2H.js → _id-ClN9hY2x.js} +132 -39
  72. package/dist/web/server/assets/{_id-BqnDy_Ca.js → _id-CwyGjJeP.js} +7 -6
  73. package/dist/web/server/assets/{_id-D8duqgd5.js → _id-D27T85mU.js} +6 -5
  74. package/dist/web/server/assets/_id-D3Ap7zZA.js +377 -0
  75. package/dist/web/server/assets/_id-DinTp_7X.js +14 -0
  76. package/dist/web/server/assets/{_id-CnQflrRv.js → _id-Dj1yZ3zJ.js} +6 -6
  77. package/dist/web/server/assets/{_id-DUIrFV3G.js → _id-DkYodSkG.js} +10 -2
  78. package/dist/web/server/assets/{_id-D_Ew11ED.js → _id-IzadFZV9.js} +9 -9
  79. package/dist/web/server/assets/_id-LrvXU4Nr.js +45 -0
  80. package/dist/web/server/assets/_id-tB47Vsfp.js +42 -0
  81. package/dist/web/server/assets/_tanstack-start-manifest_v-D09Xu_6u.js +286 -0
  82. package/dist/web/server/assets/activity-BCI4mfNS.js +168 -0
  83. package/dist/web/server/assets/activity-CGCf8BQf.js +11 -0
  84. package/dist/web/server/assets/activity-D9SMqBhy.js +14 -0
  85. package/dist/web/server/assets/activity-DohitgwW.js +12 -0
  86. package/dist/web/server/assets/{agents-k5QURC4I.js → agents-BPKOshR5.js} +5 -5
  87. package/dist/web/server/assets/{profiles-C6a3RKgu.js → agents-BY74v7fM.js} +5 -5
  88. package/dist/web/server/assets/{profiles-CZ5NkmVw.js → agents-BvttypqB.js} +5 -5
  89. package/dist/web/server/assets/{agents-ChcAJUI5.js → agents-C9xlWK0Z.js} +2 -2
  90. package/dist/web/server/assets/agents-CgZMHj80.js +265 -0
  91. package/dist/web/server/assets/{profiles-LxcC_L6n.js → agents-DZuFEj0D.js} +87 -79
  92. package/dist/web/server/assets/approvals-BGU-XGIO.js +12 -0
  93. package/dist/web/server/assets/approvals-CWcFHlor.js +14 -0
  94. package/dist/web/server/assets/approvals-CbFXFvG8.js +11 -0
  95. package/dist/web/server/assets/approvals-DCaVw1Mz.js +280 -0
  96. package/dist/web/server/assets/{auth-DzRAMwVt.js → auth-byfSx6Ja.js} +6 -2
  97. package/dist/web/server/assets/{config-CHaCv89D.js → config-BDCJdtj2.js} +1 -1
  98. package/dist/web/server/assets/{config-CdVjqjin.js → config-D2LAsud2.js} +31 -52
  99. package/dist/web/server/assets/{config-Bq3o924J.js → config-TeIoyYYc.js} +2 -2
  100. package/dist/web/server/assets/context-B-XDf6Ym.js +12 -0
  101. package/dist/web/server/assets/context-BXGo5Vfi.js +12 -0
  102. package/dist/web/server/assets/context-DrkrIWun.js +47 -0
  103. package/dist/web/server/assets/{createServerRpc-CeKECg65.js → createServerRpc-pU-IQV2Y.js} +1 -1
  104. package/dist/web/server/assets/{createSsrRpc-ZBGxhl8t.js → createSsrRpc-DFsIAfFd.js} +1 -1
  105. package/dist/web/server/assets/{empty-plugin-adapters-DKUlnwwl.js → empty-plugin-adapters-Cq4--YW-.js} +1 -1
  106. package/dist/web/server/assets/{inbox-CkiSvD14.js → inbox-B3-TRsNI.js} +1 -1
  107. package/dist/web/server/assets/{inbox-Bxb3W04M.js → inbox-BardsGyy.js} +2 -2
  108. package/dist/web/server/assets/inbox-CUIyf9MT.js +131 -0
  109. package/dist/web/server/assets/login-Bx5LEyGP.js +118 -0
  110. package/dist/web/server/assets/login-CmWvxfTK.js +136 -0
  111. package/dist/web/server/assets/{mcp-BsFKEoXt.js → mcp-2pwT9HU8.js} +1 -1
  112. package/dist/web/server/assets/{mcp-BU_kKENi.js → mcp-BJjLIdP0.js} +105 -112
  113. package/dist/web/server/assets/{mcp-CKqwG4mt.js → mcp-DIWTogHM.js} +2 -2
  114. package/dist/web/server/assets/members-CCv17cjQ.js +46 -0
  115. package/dist/web/server/assets/members-CW5aBe81.js +12 -0
  116. package/dist/web/server/assets/members-VdPwD6CE.js +12 -0
  117. package/dist/web/server/assets/{memory-BaYnfm7K.js → memory-Dngc13Nw.js} +9 -9
  118. package/dist/web/server/assets/{memory-CQaqWnyM.js → memory-a8Kz57Kh.js} +22 -19
  119. package/dist/web/server/assets/{memory-Ns2-Z31p.js → memory-pZ4pZT7p.js} +6 -6
  120. package/dist/web/server/assets/policy-BYVXqsan.js +11 -0
  121. package/dist/web/server/assets/policy-Bb-vEgqg.js +40 -0
  122. package/dist/web/server/assets/policy-BcGELcc9.js +490 -0
  123. package/dist/web/server/assets/policy-C30AeFIb.js +21 -0
  124. package/dist/web/server/assets/router-DIdp8ZNt.js +504 -0
  125. package/dist/web/server/assets/{routes-C61gBiXa.js → routes-CXz4hTAr.js} +6 -6
  126. package/dist/web/server/assets/{routes-Ce2VWrU9.js → routes-Jb0zjKav.js} +16 -13
  127. package/dist/web/server/assets/{routes-V9URcp1v.js → routes-lIclH9Br.js} +2 -2
  128. package/dist/web/server/assets/services-B9yBWDX0.js +79 -0
  129. package/dist/web/server/assets/{services-Ccc5s2bS.js → services-C4szdhPx.js} +4 -4
  130. package/dist/web/server/assets/{services-DhRiNeq0.js → services-wG8I06oS.js} +1 -1
  131. package/dist/web/server/assets/skills-BZdqiDig.js +358 -0
  132. package/dist/web/server/assets/{skills-l2cyQ3zS.js → skills-C-UgkuCW.js} +2 -2
  133. package/dist/web/server/assets/{skills-CFIWVg32.js → skills-a9VSWHWq.js} +1 -1
  134. package/dist/web/server/assets/{start-CYDpZ6cb.js → start-WH8WzTL_.js} +1 -1
  135. package/dist/web/server/assets/team-policy-vPG01onj.js +180 -0
  136. package/dist/web/server/assets/teams-3im0oQnS.js +11 -0
  137. package/dist/web/server/assets/teams-CpQ0YgWf.js +112 -0
  138. package/dist/web/server/assets/teams-DEpQR2QA.js +14 -0
  139. package/dist/web/server/assets/teams-DqfrEoH6.js +36 -0
  140. package/dist/web/server/assets/teams-MjqgsmC3.js +12 -0
  141. package/dist/web/server/assets/teams-OIkHuxy1.js +12 -0
  142. package/dist/web/server/assets/teams-jBtvnk59.js +193 -0
  143. package/dist/web/server/assets/{telegram-DfAddLdv.js → telegram-7ub--6xz.js} +44 -56
  144. package/dist/web/server/assets/{telegram-T3l9KtiE.js → telegram-Bazhmpr4.js} +2 -2
  145. package/dist/web/server/assets/{telegram-BdaUIjvs.js → telegram-DNgCWebD.js} +1 -1
  146. package/dist/web/server/assets/{tokens-DdpnfV_Y.js → tokens-BnwFbV7T.js} +2 -2
  147. package/dist/web/server/assets/{tokens-BCz3PSoT.js → tokens-DPDMSN5O.js} +1 -1
  148. package/dist/web/server/assets/tokens-yyTSfBSN.js +186 -0
  149. package/dist/web/server/assets/{triggers-BzJG1nN5.js → triggers-BMpHsGIr.js} +5 -4
  150. package/dist/web/server/assets/{triggers-BcH_6PW1.js → triggers-C_0y6QV9.js} +1 -1
  151. package/dist/web/server/assets/{triggers-BcTTwMfy.js → triggers-Ca57_qym.js} +2 -2
  152. package/dist/web/server/assets/{welcome-CP4CZ9B6.js → welcome-IYHGurWx.js} +23 -15
  153. package/dist/web/server/assets/{wire-constants-Deb4NxBb.js → wire-constants-C8nBJcU3.js} +3 -3
  154. package/dist/web/server/server.js +126 -95
  155. package/dist/worker.js +185 -146
  156. package/dist/worker.js.map +1 -1
  157. package/package.json +8 -7
  158. package/dist/migrations/0002_profile_groups.sql +0 -38
  159. package/dist/migrations/0003_agent_telegram.sql +0 -40
  160. package/dist/migrations/0004_agent_mirror_mode.sql +0 -17
  161. package/dist/migrations/0005_group_topic_name_format.sql +0 -15
  162. package/dist/migrations/0006_telegram_acl.sql +0 -18
  163. package/dist/migrations/0007_mcp_servers.sql +0 -30
  164. package/dist/migrations/0008_seed_user_md.sql +0 -39
  165. package/dist/web/client/assets/AgentTabs-DioGqUVR.js +0 -1
  166. package/dist/web/client/assets/ConfigTabs-pY-V0Rie.js +0 -1
  167. package/dist/web/client/assets/FieldRow-CNKma5LE.js +0 -1
  168. package/dist/web/client/assets/MembersEditor-C6UpqDdV.js +0 -1
  169. package/dist/web/client/assets/SpawnTeamModal-BEkNCKXm.js +0 -1
  170. package/dist/web/client/assets/TemplatesTabs-UM04RMO9.js +0 -1
  171. package/dist/web/client/assets/_id-BNJapCT4.js +0 -1
  172. package/dist/web/client/assets/_id-CjGoV8Mr.js +0 -1
  173. package/dist/web/client/assets/_id-DehuCHUw.js +0 -1
  174. package/dist/web/client/assets/_id-Dz9fjcCM.js +0 -1
  175. package/dist/web/client/assets/agents-M6omAXcZ.js +0 -1
  176. package/dist/web/client/assets/config-DIuEc5bm.js +0 -3
  177. package/dist/web/client/assets/groups-DpE2d2zZ.js +0 -1
  178. package/dist/web/client/assets/inbox-BPnLsRNf.js +0 -1
  179. package/dist/web/client/assets/index-MAJuXnie.js +0 -12
  180. package/dist/web/client/assets/login-CawJX16E.js +0 -1
  181. package/dist/web/client/assets/mcp-DIrh9-v_.js +0 -1
  182. package/dist/web/client/assets/memory-BpHbdKsd.js +0 -1
  183. package/dist/web/client/assets/preload-helper-CvnapA2_.js +0 -1
  184. package/dist/web/client/assets/profile-groups-ByoKak0c.js +0 -1
  185. package/dist/web/client/assets/profiles-BEjv8LGo.js +0 -1
  186. package/dist/web/client/assets/routes-D2COHy7v.js +0 -1
  187. package/dist/web/client/assets/services-D212jSK_.js +0 -1
  188. package/dist/web/client/assets/skills-Da0MURjY.js +0 -1
  189. package/dist/web/client/assets/styles-BgE5bCHA.css +0 -2
  190. package/dist/web/client/assets/telegram-Czh2MdVm.js +0 -1
  191. package/dist/web/client/assets/tokens-E_JvO5JN.js +0 -1
  192. package/dist/web/client/assets/triggers-BBRZQOm7.js +0 -1
  193. package/dist/web/client/assets/welcome-Dn-zvmBE.js +0 -1
  194. package/dist/web/client/assets/wire-constants-BkT5-597.js +0 -1
  195. package/dist/web/server/assets/ConfigTabs-CyuxzesF.js +0 -41
  196. package/dist/web/server/assets/MembersEditor-BWQztvrX.js +0 -131
  197. package/dist/web/server/assets/Sidebar-DmEiewRN.js +0 -529
  198. package/dist/web/server/assets/SpawnTeamModal-dSN421k_.js +0 -107
  199. package/dist/web/server/assets/_id-BKev9H1p.js +0 -12
  200. package/dist/web/server/assets/_id-BNwlbWHP.js +0 -24
  201. package/dist/web/server/assets/_id-CRqqi8IE.js +0 -161
  202. package/dist/web/server/assets/_id-CXg-Blec.js +0 -367
  203. package/dist/web/server/assets/_tanstack-start-manifest_v-D9FLKShQ.js +0 -178
  204. package/dist/web/server/assets/agents-C7SBPN0M.js +0 -210
  205. package/dist/web/server/assets/groups-CbSwND2r.js +0 -12
  206. package/dist/web/server/assets/groups-CeRRlZaZ.js +0 -150
  207. package/dist/web/server/assets/groups-pk4CYSuf.js +0 -21
  208. package/dist/web/server/assets/inbox-DU27iHv_.js +0 -133
  209. package/dist/web/server/assets/login-CNznncgA.js +0 -58
  210. package/dist/web/server/assets/login-CQybKk7Y.js +0 -74
  211. package/dist/web/server/assets/profile-groups-CiU06yN1.js +0 -28
  212. package/dist/web/server/assets/profile-groups-D21MYoLM.js +0 -208
  213. package/dist/web/server/assets/profile-groups-aoJleXHP.js +0 -12
  214. package/dist/web/server/assets/router-BrDascdO.js +0 -460
  215. package/dist/web/server/assets/services-B91w2f-X.js +0 -94
  216. package/dist/web/server/assets/skills-D89ND2kR.js +0 -321
  217. package/dist/web/server/assets/tokens-CkKqrtk-.js +0 -193
@@ -1,131 +0,0 @@
1
- import { r as REASONING_LEVELS } from "./wire-constants-Deb4NxBb.js";
2
- import { t as Button } from "./Button-Dsnw22OF.js";
3
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
- //#region src/components/MembersEditor.tsx
5
- function MembersEditor({ members, onChange, profiles, modelGroups, emptyHint = "No members yet. Add one to define your first team member." }) {
6
- function update(i, patch) {
7
- onChange(members.map((m, idx) => idx === i ? {
8
- ...m,
9
- ...patch
10
- } : m));
11
- }
12
- function move(i, delta) {
13
- const j = i + delta;
14
- if (j < 0 || j >= members.length) return;
15
- const next = [...members];
16
- const tmp = next[i];
17
- const swap = next[j];
18
- if (!tmp || !swap) return;
19
- next[i] = swap;
20
- next[j] = tmp;
21
- onChange(next);
22
- }
23
- function removeMember(i) {
24
- onChange(members.filter((_, idx) => idx !== i));
25
- }
26
- function addMember() {
27
- const firstProfile = profiles[0];
28
- if (!firstProfile) return;
29
- onChange([...members, {
30
- profileId: firstProfile.id,
31
- agentName: "agent",
32
- modelOverride: null,
33
- reasoningLevel: null
34
- }]);
35
- }
36
- if (profiles.length === 0) return /* @__PURE__ */ jsxs("p", {
37
- className: "muted",
38
- children: [
39
- "Create a profile first under ",
40
- /* @__PURE__ */ jsx("a", {
41
- href: "/profiles",
42
- children: "/profiles"
43
- }),
44
- " — members reference existing profiles."
45
- ]
46
- });
47
- return /* @__PURE__ */ jsxs(Fragment, { children: [members.length === 0 ? /* @__PURE__ */ jsx("p", {
48
- className: "muted",
49
- children: emptyHint
50
- }) : /* @__PURE__ */ jsxs("table", { children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
51
- /* @__PURE__ */ jsx("th", { children: "#" }),
52
- /* @__PURE__ */ jsx("th", { children: "profile" }),
53
- /* @__PURE__ */ jsx("th", { children: "agent name" }),
54
- /* @__PURE__ */ jsx("th", { children: "model override" }),
55
- /* @__PURE__ */ jsx("th", { children: "reasoning" }),
56
- /* @__PURE__ */ jsx("th", {})
57
- ] }) }), /* @__PURE__ */ jsx("tbody", { children: members.map((m, i) => /* @__PURE__ */ jsxs("tr", { children: [
58
- /* @__PURE__ */ jsx("td", { children: i }),
59
- /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("select", {
60
- value: m.profileId,
61
- onChange: (e) => update(i, { profileId: e.target.value }),
62
- children: profiles.map((p) => /* @__PURE__ */ jsx("option", {
63
- value: p.id,
64
- children: p.id
65
- }, p.id))
66
- }) }),
67
- /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("input", {
68
- value: m.agentName,
69
- onChange: (e) => update(i, { agentName: e.target.value })
70
- }) }),
71
- /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsxs("select", {
72
- value: m.modelOverride ?? "",
73
- onChange: (e) => update(i, { modelOverride: e.target.value === "" ? null : e.target.value }),
74
- children: [/* @__PURE__ */ jsx("option", {
75
- value: "",
76
- children: "(use profile default)"
77
- }), modelGroups.map((g) => /* @__PURE__ */ jsx("optgroup", {
78
- label: g.provider,
79
- children: g.models.map((mm) => /* @__PURE__ */ jsx("option", {
80
- value: `${g.provider}:${mm}`,
81
- children: `${g.provider}:${mm}`
82
- }, mm))
83
- }, g.provider))]
84
- }) }),
85
- /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsxs("select", {
86
- value: m.reasoningLevel ?? "",
87
- onChange: (e) => update(i, { reasoningLevel: e.target.value === "" ? null : e.target.value }),
88
- children: [/* @__PURE__ */ jsx("option", {
89
- value: "",
90
- children: "(default: medium)"
91
- }), REASONING_LEVELS.map((lvl) => /* @__PURE__ */ jsx("option", {
92
- value: lvl,
93
- children: lvl
94
- }, lvl))]
95
- }) }),
96
- /* @__PURE__ */ jsxs("td", {
97
- className: "flex gap-1",
98
- children: [
99
- /* @__PURE__ */ jsx(Button, {
100
- variant: "ghost",
101
- onClick: () => move(i, -1),
102
- disabled: i === 0,
103
- title: "move up",
104
- children: "↑"
105
- }),
106
- /* @__PURE__ */ jsx(Button, {
107
- variant: "ghost",
108
- onClick: () => move(i, 1),
109
- disabled: i === members.length - 1,
110
- title: "move down",
111
- children: "↓"
112
- }),
113
- /* @__PURE__ */ jsx(Button, {
114
- variant: "danger",
115
- onClick: () => removeMember(i),
116
- title: "remove member",
117
- children: "✕"
118
- })
119
- ]
120
- })
121
- ] }, i)) })] }), /* @__PURE__ */ jsx("div", {
122
- className: "mt-3",
123
- children: /* @__PURE__ */ jsx(Button, {
124
- variant: "ghost",
125
- onClick: addMember,
126
- children: "+ add member"
127
- })
128
- })] });
129
- }
130
- //#endregion
131
- export { MembersEditor as t };
@@ -1,529 +0,0 @@
1
- import "./wire-constants-Deb4NxBb.js";
2
- import { t as SpawnTeamModal } from "./SpawnTeamModal-dSN421k_.js";
3
- import { useState } from "react";
4
- import { Link, useNavigate, useRouter } from "@tanstack/react-router";
5
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
- //#region src/components/CreateGroupDialog.tsx
7
- function CreateGroupDialog({ onClose }) {
8
- const router = useRouter();
9
- const [id, setId] = useState("");
10
- const [name, setName] = useState("");
11
- const [link, setLink] = useState("");
12
- const [busy, setBusy] = useState(false);
13
- const [err, setErr] = useState(null);
14
- async function submit(e) {
15
- e.preventDefault();
16
- setErr(null);
17
- if (!id.trim()) {
18
- setErr("id is required");
19
- return;
20
- }
21
- setBusy(true);
22
- try {
23
- const body = { id: id.trim() };
24
- if (name.trim()) body.name = name.trim();
25
- if (link.trim()) body.link = link.trim();
26
- const res = await fetch("/api/groups", {
27
- method: "POST",
28
- headers: { "content-type": "application/json" },
29
- body: JSON.stringify(body)
30
- });
31
- if (!res.ok) {
32
- const e = await res.json().catch(() => ({}));
33
- throw new Error(e.error ?? `${res.status} ${res.statusText}`);
34
- }
35
- onClose();
36
- await router.invalidate();
37
- } catch (e) {
38
- setErr(e.message);
39
- setBusy(false);
40
- }
41
- }
42
- return /* @__PURE__ */ jsx("div", {
43
- onClick: onClose,
44
- className: "fixed inset-0 z-50 flex items-center justify-center bg-black/30 backdrop-blur-[1px]",
45
- children: /* @__PURE__ */ jsxs("form", {
46
- onSubmit: submit,
47
- onClick: (e) => e.stopPropagation(),
48
- className: "w-full max-w-md rounded-2xl border bg-card p-6 shadow-lg",
49
- children: [
50
- /* @__PURE__ */ jsx("h3", {
51
- className: "font-serif text-xl text-foreground mb-1",
52
- children: "Create a new group"
53
- }),
54
- /* @__PURE__ */ jsxs("p", {
55
- className: "text-sm text-muted-foreground mb-4",
56
- children: [
57
- "A group is a collaboration context — one filesystem root, one USER.md, one roster. The slot lives at ",
58
- /* @__PURE__ */ jsx("code", {
59
- className: "font-mono",
60
- children: "~/.bazilion/groups/<slug>/"
61
- }),
62
- "."
63
- ]
64
- }),
65
- /* @__PURE__ */ jsxs("div", {
66
- className: "grid grid-cols-2 gap-3 mb-3",
67
- children: [/* @__PURE__ */ jsxs("label", {
68
- className: "block text-sm",
69
- children: ["ID (slug)", /* @__PURE__ */ jsx("input", {
70
- type: "text",
71
- value: id,
72
- onChange: (e) => setId(e.target.value),
73
- required: true,
74
- pattern: "[a-z0-9][a-z0-9_-]*",
75
- placeholder: "myproject",
76
- autoFocus: true,
77
- className: "mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30"
78
- })]
79
- }), /* @__PURE__ */ jsxs("label", {
80
- className: "block text-sm",
81
- children: [
82
- "Name ",
83
- /* @__PURE__ */ jsx("span", {
84
- className: "text-muted-foreground font-normal",
85
- children: "(optional)"
86
- }),
87
- /* @__PURE__ */ jsx("input", {
88
- type: "text",
89
- value: name,
90
- onChange: (e) => setName(e.target.value),
91
- className: "mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30"
92
- })
93
- ]
94
- })]
95
- }),
96
- /* @__PURE__ */ jsxs("label", {
97
- className: "block text-sm mb-3",
98
- children: [
99
- "Link target",
100
- " ",
101
- /* @__PURE__ */ jsx("span", {
102
- className: "text-muted-foreground font-normal",
103
- children: "(optional, absolute path)"
104
- }),
105
- /* @__PURE__ */ jsx("input", {
106
- type: "text",
107
- value: link,
108
- onChange: (e) => setLink(e.target.value),
109
- placeholder: "/home/you/projects/myrepo",
110
- className: "mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30"
111
- }),
112
- /* @__PURE__ */ jsx("span", {
113
- className: "mt-1 block text-xs text-muted-foreground",
114
- children: "Leave blank to create a fresh directory. Supply an absolute path to materialize the slot as a symlink to your existing project tree."
115
- })
116
- ]
117
- }),
118
- err && /* @__PURE__ */ jsx("p", {
119
- className: "mt-2 text-sm text-rose-700",
120
- children: err
121
- }),
122
- /* @__PURE__ */ jsxs("div", {
123
- className: "mt-5 flex justify-end gap-2",
124
- children: [/* @__PURE__ */ jsx("button", {
125
- type: "button",
126
- onClick: onClose,
127
- className: "rounded-md border px-3 py-2 text-sm text-foreground hover:bg-accent",
128
- children: "Cancel"
129
- }), /* @__PURE__ */ jsx("button", {
130
- type: "submit",
131
- disabled: busy,
132
- className: "rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50",
133
- children: busy ? "Creating…" : "Create"
134
- })]
135
- })
136
- ]
137
- })
138
- });
139
- }
140
- //#endregion
141
- //#region src/components/SpawnDialog.tsx
142
- function SpawnDialog({ profileId, groupHint, groups, onClose }) {
143
- const navigate = useNavigate();
144
- const [name, setName] = useState("");
145
- const [groupId, setGroupId] = useState(groupHint ?? "default");
146
- const [busy, setBusy] = useState(false);
147
- const [err, setErr] = useState(null);
148
- async function submit(e) {
149
- e.preventDefault();
150
- setErr(null);
151
- setBusy(true);
152
- try {
153
- const body = { profile: profileId };
154
- if (name.trim()) body.name = name.trim();
155
- if (groupId) body.groupId = groupId;
156
- const res = await fetch("/api/agents", {
157
- method: "POST",
158
- headers: { "content-type": "application/json" },
159
- body: JSON.stringify(body)
160
- });
161
- if (!res.ok) {
162
- const e = await res.json().catch(() => ({}));
163
- throw new Error(e.error ?? `${res.status} ${res.statusText}`);
164
- }
165
- const created = await res.json();
166
- onClose();
167
- await navigate({
168
- to: "/",
169
- search: { agent: created.id }
170
- });
171
- } catch (e) {
172
- setErr(e.message);
173
- setBusy(false);
174
- }
175
- }
176
- return /* @__PURE__ */ jsx(Backdrop, {
177
- onClose,
178
- children: /* @__PURE__ */ jsxs("form", {
179
- onSubmit: submit,
180
- className: "w-full max-w-md rounded-2xl border bg-card p-6 shadow-lg",
181
- onClick: (e) => e.stopPropagation(),
182
- children: [
183
- /* @__PURE__ */ jsx("h3", {
184
- className: "font-serif text-xl text-foreground mb-1",
185
- children: "Spawn a new agent"
186
- }),
187
- /* @__PURE__ */ jsxs("p", {
188
- className: "text-sm text-muted-foreground mb-4",
189
- children: ["Profile: ", /* @__PURE__ */ jsx("code", {
190
- className: "font-mono",
191
- children: profileId
192
- })]
193
- }),
194
- /* @__PURE__ */ jsxs("label", {
195
- className: "block text-sm text-foreground mb-3",
196
- children: [
197
- "Agent name",
198
- " ",
199
- /* @__PURE__ */ jsx("span", {
200
- className: "text-muted-foreground font-normal",
201
- children: "(optional — defaults to the profile's name)"
202
- }),
203
- /* @__PURE__ */ jsx("input", {
204
- type: "text",
205
- value: name,
206
- onChange: (e) => setName(e.target.value),
207
- autoFocus: true,
208
- autoComplete: "off",
209
- className: "mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30"
210
- })
211
- ]
212
- }),
213
- /* @__PURE__ */ jsxs("label", {
214
- className: "block text-sm text-foreground mb-3",
215
- children: ["Group", /* @__PURE__ */ jsx("select", {
216
- value: groupId,
217
- onChange: (e) => setGroupId(e.target.value),
218
- className: "mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30",
219
- children: groups.map((g) => /* @__PURE__ */ jsxs("option", {
220
- value: g.id,
221
- children: [g.name, g.id === "default" ? " (default)" : ""]
222
- }, g.id))
223
- })]
224
- }),
225
- err && /* @__PURE__ */ jsx("p", {
226
- className: "mt-2 text-sm text-rose-700",
227
- children: err
228
- }),
229
- /* @__PURE__ */ jsxs("div", {
230
- className: "mt-5 flex justify-end gap-2",
231
- children: [/* @__PURE__ */ jsx("button", {
232
- type: "button",
233
- onClick: onClose,
234
- className: "rounded-md border px-3 py-2 text-sm text-foreground hover:bg-accent",
235
- children: "Cancel"
236
- }), /* @__PURE__ */ jsx("button", {
237
- type: "submit",
238
- disabled: busy,
239
- className: "rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50",
240
- children: busy ? "Creating…" : "Create"
241
- })]
242
- })
243
- ]
244
- })
245
- });
246
- }
247
- function Backdrop({ children, onClose }) {
248
- return /* @__PURE__ */ jsx("div", {
249
- onClick: onClose,
250
- className: "fixed inset-0 z-50 flex items-center justify-center bg-black/30 backdrop-blur-[1px]",
251
- children
252
- });
253
- }
254
- //#endregion
255
- //#region src/components/Sidebar.tsx
256
- var SIDEBAR_OPEN_GROUPS_COOKIE = "bz_sidebar_open_groups";
257
- function writeOpenGroupsCookie(map) {
258
- if (typeof document === "undefined") return;
259
- const value = encodeURIComponent(JSON.stringify(map));
260
- document.cookie = `${SIDEBAR_OPEN_GROUPS_COOKIE}=${value}; Path=/; Max-Age=31536000; SameSite=Lax`;
261
- }
262
- function Sidebar({ agents, groups, profiles, profileGroups, selectedAgentId, initialOpenGroups }) {
263
- const router = useRouter();
264
- const [spawnFor, setSpawnFor] = useState(null);
265
- const [spawnTeamFor, setSpawnTeamFor] = useState(null);
266
- const [createGroupOpen, setCreateGroupOpen] = useState(false);
267
- const [menuOpen, setMenuOpen] = useState(false);
268
- const [openGroups, setOpenGroups] = useState(() => initialOpenGroups ?? {});
269
- async function rename(a) {
270
- const next = window.prompt(`rename "${a.name}" to:`, a.name)?.trim();
271
- if (!next || next === a.name) return;
272
- const res = await fetch(`/api/agents/${a.id}`, {
273
- method: "PATCH",
274
- headers: { "content-type": "application/json" },
275
- body: JSON.stringify({ name: next })
276
- });
277
- if (!res.ok) {
278
- const body = await res.json().catch(() => null);
279
- alert(body?.error ?? res.statusText);
280
- return;
281
- }
282
- await router.invalidate();
283
- }
284
- async function archive(a) {
285
- if (!confirm(`archive "${a.name}"? (reversible — find under "show archived")`)) return;
286
- const res = await fetch(`/api/agents/${a.id}/archive`, { method: "POST" });
287
- if (!res.ok && res.status !== 204) {
288
- alert(res.statusText);
289
- return;
290
- }
291
- await router.invalidate();
292
- }
293
- const sortedProfiles = [...profiles].sort((a, b) => {
294
- if (a.id === "default") return -1;
295
- if (b.id === "default") return 1;
296
- return 0;
297
- });
298
- const sortedGroups = [...groups].sort((a, b) => {
299
- if (a.id === "default") return -1;
300
- if (b.id === "default") return 1;
301
- return 0;
302
- });
303
- const agentsByGroup = /* @__PURE__ */ new Map();
304
- for (const a of agents) {
305
- const list = agentsByGroup.get(a.groupId) ?? [];
306
- list.push(a);
307
- agentsByGroup.set(a.groupId, list);
308
- }
309
- const selectedGroupId = agents.find((a) => a.id === selectedAgentId)?.groupId ?? null;
310
- return /* @__PURE__ */ jsxs("aside", {
311
- className: "flex h-full flex-col rounded-lg border bg-card overflow-hidden",
312
- children: [
313
- /* @__PURE__ */ jsxs("header", {
314
- className: "flex items-center justify-between border-b px-3 py-2.5 bg-muted/30",
315
- children: [/* @__PURE__ */ jsx("span", {
316
- className: "font-serif text-base text-foreground",
317
- children: "agents"
318
- }), /* @__PURE__ */ jsxs("div", {
319
- className: "relative",
320
- children: [/* @__PURE__ */ jsx("button", {
321
- type: "button",
322
- onClick: () => setMenuOpen((v) => !v),
323
- className: "rounded-md border px-2 py-1 text-xs text-muted-foreground hover:text-foreground hover:border-foreground/30",
324
- children: "+ new ▾"
325
- }), menuOpen && /* @__PURE__ */ jsxs("div", {
326
- role: "menu",
327
- className: "absolute right-0 top-[calc(100%+0.3rem)] z-20 min-w-[14rem] rounded-md border bg-popover p-1 shadow-md",
328
- onMouseLeave: () => setMenuOpen(false),
329
- children: [
330
- profiles.length === 0 ? /* @__PURE__ */ jsxs("div", {
331
- className: "px-3 py-2 text-sm text-muted-foreground",
332
- children: [
333
- "No profiles yet.",
334
- /* @__PURE__ */ jsx("br", {}),
335
- /* @__PURE__ */ jsx("a", {
336
- href: "/profiles",
337
- className: "text-primary underline",
338
- children: "Create one"
339
- }),
340
- " ",
341
- "to spawn agents."
342
- ]
343
- }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
344
- className: "px-3 pt-1 pb-0.5 text-[0.7em] uppercase tracking-wide text-muted-foreground",
345
- children: "spawn agent from template"
346
- }), sortedProfiles.map((p) => /* @__PURE__ */ jsxs("button", {
347
- type: "button",
348
- role: "menuitem",
349
- onClick: () => {
350
- setMenuOpen(false);
351
- setSpawnFor({ profileId: p.id });
352
- },
353
- className: "flex w-full items-center justify-between rounded-sm px-3 py-1.5 text-sm hover:bg-accent",
354
- children: [/* @__PURE__ */ jsx("span", { children: p.name || p.id }), p.id === "default" && /* @__PURE__ */ jsx("span", {
355
- className: "rounded bg-muted px-1 text-[0.7em] text-muted-foreground",
356
- children: "default"
357
- })]
358
- }, p.id))] }),
359
- /* @__PURE__ */ jsx("div", { className: "my-1 h-px bg-border" }),
360
- /* @__PURE__ */ jsx("div", {
361
- className: "px-3 pt-1 pb-0.5 text-[0.7em] uppercase tracking-wide text-muted-foreground",
362
- children: "spawn group from template"
363
- }),
364
- profileGroups.length === 0 ? /* @__PURE__ */ jsxs("div", {
365
- className: "px-3 py-1.5 text-xs text-muted-foreground",
366
- children: [
367
- "No team templates yet.",
368
- " ",
369
- /* @__PURE__ */ jsx("a", {
370
- href: "/profile-groups",
371
- className: "text-primary underline",
372
- children: "Create one"
373
- }),
374
- "."
375
- ]
376
- }) : profileGroups.map((pg) => /* @__PURE__ */ jsxs("button", {
377
- type: "button",
378
- role: "menuitem",
379
- disabled: pg.memberCount === 0,
380
- title: pg.memberCount === 0 ? "add at least one member before spawning" : void 0,
381
- onClick: () => {
382
- setMenuOpen(false);
383
- setSpawnTeamFor(pg);
384
- },
385
- className: "flex w-full items-center justify-between rounded-sm px-3 py-1.5 text-sm hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent",
386
- children: [/* @__PURE__ */ jsx("span", { children: pg.name || pg.id }), /* @__PURE__ */ jsx("span", {
387
- className: "font-mono text-[0.7em] text-muted-foreground",
388
- children: pg.memberCount
389
- })]
390
- }, pg.id)),
391
- /* @__PURE__ */ jsx("div", { className: "my-1 h-px bg-border" }),
392
- /* @__PURE__ */ jsx("button", {
393
- type: "button",
394
- onClick: () => {
395
- setMenuOpen(false);
396
- setCreateGroupOpen(true);
397
- },
398
- className: "block w-full text-left rounded-sm px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent",
399
- children: "+ create group"
400
- })
401
- ]
402
- })]
403
- })]
404
- }),
405
- /* @__PURE__ */ jsx("nav", {
406
- className: "flex-1 overflow-y-auto p-1",
407
- children: agents.length === 0 && groups.length === 0 ? /* @__PURE__ */ jsxs("div", {
408
- className: "p-4 text-sm text-muted-foreground",
409
- children: [
410
- "No agents yet.",
411
- " ",
412
- /* @__PURE__ */ jsx("a", {
413
- href: "/agents",
414
- className: "text-primary underline",
415
- children: "Spawn one"
416
- }),
417
- " ",
418
- "to start chatting."
419
- ]
420
- }) : sortedGroups.map((g) => {
421
- const groupAgents = agentsByGroup.get(g.id) ?? [];
422
- const containsSelected = selectedGroupId === g.id;
423
- const stored = openGroups[g.id];
424
- return /* @__PURE__ */ jsxs("details", {
425
- open: stored !== void 0 ? stored : containsSelected || g.id === "default",
426
- onToggle: (e) => {
427
- const next = e.currentTarget.open;
428
- if (openGroups[g.id] === next) return;
429
- const merged = {
430
- ...openGroups,
431
- [g.id]: next
432
- };
433
- writeOpenGroupsCookie(merged);
434
- setOpenGroups(merged);
435
- router.invalidate();
436
- },
437
- className: "group/details mb-1 last:mb-0",
438
- children: [/* @__PURE__ */ jsxs("summary", {
439
- className: "flex cursor-pointer list-none items-center gap-1.5 rounded-sm px-2 py-1.5 text-xs uppercase tracking-wide text-muted-foreground hover:bg-accent",
440
- children: [
441
- /* @__PURE__ */ jsx("span", {
442
- className: "w-3 text-xs transition-transform group-open/details:rotate-90 inline-block",
443
- children: "▸"
444
- }),
445
- /* @__PURE__ */ jsx("span", {
446
- className: "flex-1 truncate font-semibold",
447
- children: g.name
448
- }),
449
- /* @__PURE__ */ jsx("span", {
450
- className: "font-mono text-xs rounded bg-muted px-1 min-w-[1.4em] text-center",
451
- children: groupAgents.length
452
- })
453
- ]
454
- }), groupAgents.length === 0 ? /* @__PURE__ */ jsx("div", {
455
- className: "pl-6 py-1 text-xs italic text-muted-foreground",
456
- children: "no agents"
457
- }) : /* @__PURE__ */ jsx("div", {
458
- className: "pl-2",
459
- children: groupAgents.map((a) => /* @__PURE__ */ jsxs("div", {
460
- className: "group/row relative",
461
- children: [/* @__PURE__ */ jsxs(Link, {
462
- to: "/",
463
- search: { agent: a.id },
464
- className: `block rounded-sm border-l-2 px-3 py-1.5 pr-14 hover:bg-accent ${a.id === selectedAgentId ? "border-primary bg-accent" : "border-transparent"}`,
465
- children: [/* @__PURE__ */ jsxs("div", {
466
- className: "flex items-center gap-1.5 truncate text-sm font-medium",
467
- children: [/* @__PURE__ */ jsx("span", {
468
- className: "truncate",
469
- children: a.name
470
- }), a.telegramTopicId !== null && /* @__PURE__ */ jsx("span", {
471
- className: "text-xs",
472
- title: `Telegram topic #${a.telegramTopicId}`,
473
- "aria-label": `Bound to Telegram topic ${a.telegramTopicId}`,
474
- children: "✈"
475
- })]
476
- }), /* @__PURE__ */ jsxs("div", {
477
- className: "flex gap-2 font-mono text-[0.7em] text-muted-foreground",
478
- children: [/* @__PURE__ */ jsx("span", {
479
- className: "uppercase tracking-wide",
480
- children: a.status
481
- }), /* @__PURE__ */ jsx("code", { children: a.id.slice(0, 8) })]
482
- })]
483
- }), /* @__PURE__ */ jsxs("div", {
484
- className: "absolute right-1 top-1 flex gap-0.5 opacity-0 transition-opacity group-hover/row:opacity-100 focus-within:opacity-100",
485
- children: [/* @__PURE__ */ jsx("button", {
486
- type: "button",
487
- onClick: () => rename(a),
488
- title: "rename",
489
- "aria-label": `rename ${a.name}`,
490
- className: "unstyled flex h-6 w-6 items-center justify-center rounded-sm text-mocha-light hover:bg-snow hover:text-sapphire",
491
- children: "✎"
492
- }), /* @__PURE__ */ jsx("button", {
493
- type: "button",
494
- onClick: () => archive(a),
495
- title: "archive",
496
- "aria-label": `archive ${a.name}`,
497
- className: "unstyled flex h-6 w-6 items-center justify-center rounded-sm text-mocha-light hover:bg-snow hover:text-[#9B3D3D]",
498
- children: "×"
499
- })]
500
- })]
501
- }, a.id))
502
- })]
503
- }, g.id);
504
- })
505
- }),
506
- spawnFor && /* @__PURE__ */ jsx(SpawnDialog, {
507
- profileId: spawnFor.profileId,
508
- groupHint: spawnFor.groupHint,
509
- groups: sortedGroups,
510
- onClose: () => setSpawnFor(null)
511
- }),
512
- spawnTeamFor && /* @__PURE__ */ jsx(SpawnTeamModal, {
513
- profileGroup: spawnTeamFor,
514
- groups: sortedGroups,
515
- onClose: () => setSpawnTeamFor(null),
516
- onSpawned: (slug) => {
517
- setSpawnTeamFor(null);
518
- router.navigate({
519
- to: "/groups/$id",
520
- params: { id: slug }
521
- });
522
- }
523
- }),
524
- createGroupOpen && /* @__PURE__ */ jsx(CreateGroupDialog, { onClose: () => setCreateGroupOpen(false) })
525
- ]
526
- });
527
- }
528
- //#endregion
529
- export { Sidebar as n, SIDEBAR_OPEN_GROUPS_COOKIE as t };