bazilion 0.55.0 → 0.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/dist/cli.js +193 -37
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +1821 -788
  4. package/dist/daemon.js.map +1 -1
  5. package/dist/web/client/assets/AddProviderDialog-DwUu2FGE.js +1 -0
  6. package/dist/web/client/assets/AgentTemplateParts-C3BasVck.js +1 -0
  7. package/dist/web/client/assets/{Button-bTJUy9Qf.js → Button-CoKQRO-s.js} +1 -1
  8. package/dist/web/client/assets/ConfigPage-DFmHgEaL.js +1 -0
  9. package/dist/web/client/assets/ConfirmDialog-BCOfW63x.js +1 -0
  10. package/dist/web/client/assets/ConnectionsView-BbpY5YbI.js +1 -0
  11. package/dist/web/client/assets/ManagePage-BzyMHGqs.js +1 -0
  12. package/dist/web/client/assets/SectionTabs-C8H_LunZ.js +1 -0
  13. package/dist/web/client/assets/{Segmented-oPkAHPO1.js → Segmented-iylzLwE6.js} +1 -1
  14. package/dist/web/client/assets/SkillsParts-DoygBgF2.js +1 -0
  15. package/dist/web/client/assets/SpawnTeamModal-BVf4yN9X.js +1 -0
  16. package/dist/web/client/assets/TeamForm-Bfb5hVUX.js +1 -0
  17. package/dist/web/client/assets/TeamThread-BFmaBj82.js +1 -0
  18. package/dist/web/client/assets/UnsavedChangesGuard-BUsIHSxO.js +1 -0
  19. package/dist/web/client/assets/_id-BRD3kxrX.js +1 -0
  20. package/dist/web/client/assets/_id-BapVoTMJ.js +1 -0
  21. package/dist/web/client/assets/access-CqcKius1.js +1 -0
  22. package/dist/web/client/assets/{agent-actions-CUee6aJq.js → agent-actions-B-9KIwn6.js} +1 -1
  23. package/dist/web/client/assets/agents-BC_ITk28.js +1 -0
  24. package/dist/web/client/assets/agents-DQ8nQnD6.js +1 -0
  25. package/dist/web/client/assets/arrow-right-BqqfPqVi.js +1 -0
  26. package/dist/web/client/assets/attention-BnCihfi0.js +1 -0
  27. package/dist/web/client/assets/{bot-BCone8es.js → bot-BHky7KAX.js} +1 -1
  28. package/dist/web/client/assets/chart-column-DTsDbzL0.js +1 -0
  29. package/dist/web/client/assets/chevron-right-D1shxvdo.js +1 -0
  30. package/dist/web/client/assets/config-DYS8bkQl.js +1 -0
  31. package/dist/web/client/assets/{createLucideIcon-jxSFpY0Q.js → createLucideIcon-CZHSSDYA.js} +1 -1
  32. package/dist/web/client/assets/{download-Dy88XavQ.js → download-Dr0PgyMr.js} +1 -1
  33. package/dist/web/client/assets/es2015-DZDOQ3kj.js +41 -0
  34. package/dist/web/client/assets/{file-text-DPsZ8-h9.js → file-text-D6OTHixJ.js} +1 -1
  35. package/dist/web/client/assets/{images-QBh_rL8b.js → images-BULrW-FC.js} +1 -1
  36. package/dist/web/client/assets/index-CxXsZzDC.js +14 -0
  37. package/dist/web/client/assets/{key-round-C-I8fAG0.js → key-round-DmSZN0Kq.js} +1 -1
  38. package/dist/web/client/assets/{list-checks-C9Q-bjEi.js → list-checks-DdTdAQXS.js} +1 -1
  39. package/dist/web/client/assets/login-DFVsVP0s.js +1 -0
  40. package/dist/web/client/assets/{manage-BaIU5zKy.js → manage-CpXaObuS.js} +1 -1
  41. package/dist/web/client/assets/mcp-DslGDHmN.js +1 -0
  42. package/dist/web/client/assets/{message-square-Bwf9cHOx.js → message-square-B_pULba_.js} +1 -1
  43. package/dist/web/client/assets/{network-B3FA93gC.js → network-BqmVqC4_.js} +1 -1
  44. package/dist/web/client/assets/parts-C104qEuC.js +1 -0
  45. package/dist/web/client/assets/plus-CEKaHPBw.js +1 -0
  46. package/dist/web/client/assets/preload-helper-CZOd_z6l.js +1 -0
  47. package/dist/web/client/assets/routes-D1wFPm0n.js +85 -0
  48. package/dist/web/client/assets/skills-DmIo3vN3.js +1 -0
  49. package/dist/web/client/assets/{square-terminal-DaNLwvEs.js → square-terminal-CYfGBHPC.js} +1 -1
  50. package/dist/web/client/assets/style-CqkCFvvz.js +7 -0
  51. package/dist/web/client/assets/styles-C7NsCHeU.css +2 -0
  52. package/dist/web/client/assets/{system-CrTSr5_t.js → system-CUW9JZ9c.js} +1 -1
  53. package/dist/web/client/assets/teams-DJzYsuh9.js +1 -0
  54. package/dist/web/client/assets/teams-DrhG8KiS.js +1 -0
  55. package/dist/web/client/assets/telegram-Bk_kg8hb.js +1 -0
  56. package/dist/web/client/assets/tools-z9Ixmuu2.js +1 -0
  57. package/dist/web/client/assets/usage-DGe3x1m7.js +1 -0
  58. package/dist/web/client/assets/use-resource-qjIkNQDY.js +1 -0
  59. package/dist/web/client/assets/{users-round-BElBVSnw.js → users-round-cxQ5HF-C.js} +1 -1
  60. package/dist/web/client/assets/welcome-DDKqxHkF.js +1 -0
  61. package/dist/web/client/assets/{wrench-DotqSqSm.js → wrench-BLEJjETg.js} +1 -1
  62. package/dist/web/server/assets/{AddProviderDialog-BbpuvC2a.js → AddProviderDialog-CpLDHOcA.js} +6 -3
  63. package/dist/web/server/assets/AgentAvatar-8gTAy_tP.js +37 -0
  64. package/dist/web/server/assets/{AgentTemplateParts-Ce7snK3m.js → AgentTemplateParts-Dh9F_-T_.js} +7 -3
  65. package/dist/web/server/assets/Button-Dsnw22OF.js +17 -0
  66. package/dist/web/server/assets/{ConfigPage-qP9ejjuw.js → ConfigPage-CrxctbtN.js} +2 -2
  67. package/dist/web/server/assets/{ConfirmDialog-Z-uYbE9B.js → ConfirmDialog-C89B8qKM.js} +3 -1
  68. package/dist/web/server/assets/{ConnectionsView-CLIV7V5D.js → ConnectionsView-DslcKQmA.js} +9 -7
  69. package/dist/web/server/assets/Dialog-_Gt_Nt86.js +85 -0
  70. package/dist/web/server/assets/{ManagePage-BR9FwVZM.js → ManagePage-DGYNJ6XG.js} +2 -2
  71. package/dist/web/server/assets/{ModelMenu-D-hTgYOO.js → ModelMenu-DEJoYASj.js} +13 -1
  72. package/dist/web/server/assets/{SectionTabs-CWQ5orUW.js → SectionTabs--vMBvaUz.js} +9 -2
  73. package/dist/web/server/assets/{SkillsParts-DWpdydCJ.js → SkillsParts-CqS2B45v.js} +7 -3
  74. package/dist/web/server/assets/SpawnDialog-BNKj2Lup.js +127 -0
  75. package/dist/web/server/assets/{SpawnTeamModal-C-YMvoaB.js → SpawnTeamModal-zcLxtFOO.js} +6 -2
  76. package/dist/web/server/assets/{TeamForm-CL45gBdt.js → TeamForm-XFP0l2TB.js} +11 -5
  77. package/dist/web/server/assets/{TeamThread-CVVH6kKj.js → TeamThread-gYV_ToRM.js} +59 -12
  78. package/dist/web/server/assets/{UnsavedChangesGuard-CXK75QQp.js → UnsavedChangesGuard-CB_TugFF.js} +1 -1
  79. package/dist/web/server/assets/{_id-d2OwovYV.js → _id-517adSuB.js} +2 -2
  80. package/dist/web/server/assets/{_id-BKzOw78O.js → _id-BTyd2i5U.js} +1 -1
  81. package/dist/web/server/assets/{_id-8zsImuGa.js → _id-BsQnL9LV.js} +14 -9
  82. package/dist/web/server/assets/{_id-2I4CSMQj.js → _id-CyinHJam.js} +17 -11
  83. package/dist/web/server/assets/{_id-De3Bm0SG.js → _id-D4RFNqaJ.js} +2 -2
  84. package/dist/web/server/assets/{_id-BpfoPuTv.js → _id-josYXBx3.js} +2 -2
  85. package/dist/web/server/assets/_tanstack-start-manifest_v-w2xn07aY.js +275 -0
  86. package/dist/web/server/assets/{access-WWspT0v4.js → access-B97-94Wt.js} +1 -1
  87. package/dist/web/server/assets/{access-CyUoElTP.js → access-BdQmjMJV.js} +2 -2
  88. package/dist/web/server/assets/{access-CwZ27Wsl.js → access-Cc7fMMod.js} +7 -4
  89. package/dist/web/server/assets/activity-Czfq-5_F.js +471 -0
  90. package/dist/web/server/assets/{agent-actions-C07Cp5Ue.js → agent-actions-ChH7Mne4.js} +1 -1
  91. package/dist/web/server/assets/{agents-DCWEoaxY.js → agents-BL918wVc.js} +2 -2
  92. package/dist/web/server/assets/{agents-vuXrAv1j.js → agents-BlUZqqJn.js} +14 -8
  93. package/dist/web/server/assets/{agents-CRtMfKqX.js → agents-BzJFjA2i.js} +2 -2
  94. package/dist/web/server/assets/{agents-CwzhpDPm.js → agents-CjrkaEz8.js} +11 -8
  95. package/dist/web/server/assets/{agents-DQowl6Ly.js → agents-Tg3zkmQv.js} +2 -2
  96. package/dist/web/server/assets/{agents-DTub-rJk.js → agents-uw32jPWx.js} +2 -2
  97. package/dist/web/server/assets/{attention-Dki8rmGZ.js → attention-2unmuO-q.js} +1 -1
  98. package/dist/web/server/assets/{attention-BqCnJ1hg.js → attention-C94WWwQe.js} +2 -2
  99. package/dist/web/server/assets/{attention-DwGaur_w.js → attention-a_OmC6L3.js} +9 -7
  100. package/dist/web/server/assets/{auth-dJnrFW6y.js → auth-DuIqEAed.js} +1 -1
  101. package/dist/web/server/assets/{config-B9dJiji_.js → config-BG1KOtwA.js} +2 -2
  102. package/dist/web/server/assets/{config-D3MR2VjE.js → config-Bhem9XER.js} +10 -7
  103. package/dist/web/server/assets/{config-X7qWbbpH.js → config-D1Li_7Yt2.js} +1 -1
  104. package/dist/web/server/assets/createSsrRpc-6LHNEsSK.js +16 -0
  105. package/dist/web/server/assets/{daemon-client-B_ZRIIrT.js → daemon-client-D-NWKQto.js} +1 -1
  106. package/dist/web/server/assets/form-Bwsyt9OY.js +416 -0
  107. package/dist/web/server/assets/live-DbJeq6KP.js +263 -0
  108. package/dist/web/server/assets/{login-CRd1yTH5.js → login-BJdJ219n.js} +1 -1
  109. package/dist/web/server/assets/{login-ZN6KV8n-.js → login-C4lL4AxI.js} +2 -2
  110. package/dist/web/server/assets/{manage-Ce6cI4eW.js → manage-C7ReF2ZZ.js} +3 -2
  111. package/dist/web/server/assets/{mcp-CYQuYWGX.js → mcp-BFixpBQk.js} +2 -2
  112. package/dist/web/server/assets/{mcp-BQ15a9dG.js → mcp-BTZkDvdc.js} +7 -4
  113. package/dist/web/server/assets/{mcp-C97uAZe1.js → mcp-Ceg9gzKE.js} +1 -1
  114. package/dist/web/server/assets/open-groups-C89TEK85.js +12 -0
  115. package/dist/web/server/assets/{page-title-CVY-c2Pd.js → page-title-PTpFHXWo.js} +1 -1
  116. package/dist/web/server/assets/parts-B0wbj_yK.js +436 -0
  117. package/dist/web/server/assets/{router-CPdWGKQ5.js → router-Ci_9VxDk.js} +244 -104
  118. package/dist/web/server/assets/{routes-BPloBDc8.js → routes-CVrH9qgo.js} +3 -3
  119. package/dist/web/server/assets/{routes-Dw1K3TQw.js → routes-D9Mw1_VV.js} +1453 -403
  120. package/dist/web/server/assets/{routes-xDPesCQu.js → routes-DsuaDPTO.js} +3 -3
  121. package/dist/web/server/assets/{skills-DWzlT_hC.js → skills-BNbZ75am.js} +1 -1
  122. package/dist/web/server/assets/{skills-6VSpEORe.js → skills-BWwEFc4a.js} +2 -2
  123. package/dist/web/server/assets/{skills-D0xrNc2_.js → skills-D5rnOmKJ.js} +9 -7
  124. package/dist/web/server/assets/src-BeMh8Fze.js +113 -0
  125. package/dist/web/server/assets/{start-DhW7sy23.js → start-2MvkBRdC.js} +1 -1
  126. package/dist/web/server/assets/{style-aMybyKzc.js → style-B3l0Wtlf.js} +1 -1
  127. package/dist/web/server/assets/{system-B5sPgdQW.js → system-Cr4C-YRw.js} +2 -2
  128. package/dist/web/server/assets/{system-CXmiWyDG.js → system-DT7AU0e6.js} +3 -3
  129. package/dist/web/server/assets/{system-D3th6n2E.js → system-DsmXkgqn.js} +1 -1
  130. package/dist/web/server/assets/{teams-ClRBVSYU.js → teams-BeStcDvQ.js} +2 -2
  131. package/dist/web/server/assets/{teams-yF3I_Zjq.js → teams-CsEBLW8-.js} +14 -8
  132. package/dist/web/server/assets/{teams-Dq4RCxis.js → teams-Dix5XVIx.js} +2 -2
  133. package/dist/web/server/assets/{teams-iXiCnN2i.js → teams-DjE0swAZ.js} +10 -6
  134. package/dist/web/server/assets/{teams-70u1XQTr.js → teams-Rk_RED7X.js} +1 -1
  135. package/dist/web/server/assets/{teams-BopOP4x7.js → teams-u6m6JzuU.js} +1 -1
  136. package/dist/web/server/assets/{telegram-DwEgyR1x.js → telegram-BjqABrl-.js} +287 -273
  137. package/dist/web/server/assets/{telegram-CGol0CKX2.js → telegram-CQpF3EHA.js} +1 -1
  138. package/dist/web/server/assets/{telegram-D9U9c1MN.js → telegram-DhzHgDfg.js} +2 -2
  139. package/dist/web/server/assets/{tools-C-wwWjLI.js → tools-DC69leH7.js} +1 -1
  140. package/dist/web/server/assets/{tools-DflVIdDd.js → tools-Dn6RnOFu.js} +2 -2
  141. package/dist/web/server/assets/{tools-VPIKjr3y.js → tools-x_DQTQtE.js} +6 -4
  142. package/dist/web/server/assets/usage-4zMG0sab.js +465 -0
  143. package/dist/web/server/assets/usage-mvQegG4l.js +46 -0
  144. package/dist/web/server/assets/{use-resource-CbHGYti0.js → use-resource-BjN1uJoL.js} +10 -2
  145. package/dist/web/server/assets/{welcome-7DrYZVs6.js → welcome-BuE9FRf4.js} +2 -2
  146. package/dist/web/server/assets/{welcome-CxXMI4HI.js → welcome-DYw35wl5.js} +1 -1
  147. package/dist/web/server/assets/{welcome-966nOyyK.js → welcome-DrYbWGd_.js} +8 -6
  148. package/dist/web/server/assets/workspace-0XPILV1W.js +82 -0
  149. package/dist/web/server/server.js +20 -20
  150. package/dist/worker.js +143 -18
  151. package/dist/worker.js.map +1 -1
  152. package/package.json +1 -1
  153. package/dist/web/client/assets/AddProviderDialog-DfFOaCjC.js +0 -1
  154. package/dist/web/client/assets/AgentTemplateParts-IMJmAQjN.js +0 -1
  155. package/dist/web/client/assets/ConfigPage-CzLHZa5o.js +0 -1
  156. package/dist/web/client/assets/ConfirmDialog-Cu_evkgc.js +0 -1
  157. package/dist/web/client/assets/ConnectionsView-D7Fmutl2.js +0 -1
  158. package/dist/web/client/assets/ManagePage-BfvlCrmz.js +0 -1
  159. package/dist/web/client/assets/SectionTabs-D7kPQGoh.js +0 -1
  160. package/dist/web/client/assets/SkillsParts-BuTxcCam.js +0 -1
  161. package/dist/web/client/assets/SpawnTeamModal-B1UnOvtp.js +0 -1
  162. package/dist/web/client/assets/TeamForm-DbzxtRjj.js +0 -1
  163. package/dist/web/client/assets/TeamThread-jpsWq6vI.js +0 -1
  164. package/dist/web/client/assets/UnsavedChangesGuard-BfyU9v9i.js +0 -1
  165. package/dist/web/client/assets/_id-BCNBLF-2.js +0 -1
  166. package/dist/web/client/assets/_id-D8_H79U2.js +0 -1
  167. package/dist/web/client/assets/access-CDWe1Kwy.js +0 -1
  168. package/dist/web/client/assets/agents-sE686DTf.js +0 -1
  169. package/dist/web/client/assets/agents-yrur1NDa.js +0 -1
  170. package/dist/web/client/assets/arrow-right-U66krZnr.js +0 -1
  171. package/dist/web/client/assets/attention-DYEHDfmx.js +0 -1
  172. package/dist/web/client/assets/chevron-right-CuqJFXTe.js +0 -1
  173. package/dist/web/client/assets/config-BHv886pr.js +0 -1
  174. package/dist/web/client/assets/index-GOthyyE-.js +0 -14
  175. package/dist/web/client/assets/login-Dhe15Uuc.js +0 -1
  176. package/dist/web/client/assets/mcp-A_Eo7x3q.js +0 -1
  177. package/dist/web/client/assets/parts-CpIfn_BH.js +0 -41
  178. package/dist/web/client/assets/plus-CQPjc8uR.js +0 -1
  179. package/dist/web/client/assets/routes-CTg_yjbY.js +0 -85
  180. package/dist/web/client/assets/skills-CLjtYtkA.js +0 -1
  181. package/dist/web/client/assets/style-mjEbxhf5.js +0 -7
  182. package/dist/web/client/assets/styles-DzcEC3Rd.css +0 -2
  183. package/dist/web/client/assets/teams-Bhje5n2h.js +0 -1
  184. package/dist/web/client/assets/teams-Cbgw0Qhv.js +0 -1
  185. package/dist/web/client/assets/telegram-HtUczmaA.js +0 -1
  186. package/dist/web/client/assets/tools-BpjFvmoX.js +0 -1
  187. package/dist/web/client/assets/use-resource-BnvgCpBi.js +0 -1
  188. package/dist/web/client/assets/welcome-D47LKWYO.js +0 -1
  189. package/dist/web/server/assets/Rail-b6EbjBB-.js +0 -605
  190. package/dist/web/server/assets/SpawnDialog-3wNx0W1R.js +0 -1851
  191. package/dist/web/server/assets/_tanstack-start-manifest_v-kkY_s_uR.js +0 -256
  192. package/dist/web/server/assets/createSsrRpc-qesavJv-.js +0 -72
  193. package/dist/web/server/assets/public-origin-BpDkdS5Q.js +0 -34
@@ -1,605 +0,0 @@
1
- import { G as DialogActions, J as DEFAULT_PROFILE_ID, K as Button, W as Dialog$1, Y as DEFAULT_TEAM_ID, et as shortTime, nt as useActivity, pt as errorMessage, q as AgentAvatar, t as SpawnDialog, tt as teamSummary } from "./SpawnDialog-3wNx0W1R.js";
2
- import { t as useHydrated } from "./use-resource-CbHGYti0.js";
3
- import { t as ConfirmDialog } from "./ConfirmDialog-Z-uYbE9B.js";
4
- import { r as renameAgent, t as archiveAgent } from "./agent-actions-C07Cp5Ue.js";
5
- import { t as SpawnTeamModal } from "./SpawnTeamModal-C-YMvoaB.js";
6
- import { t as TeamForm } from "./TeamForm-CL45gBdt.js";
7
- import { createContext, useContext, useMemo, useRef, useState } from "react";
8
- import { Link, useRouter } from "@tanstack/react-router";
9
- import { jsx, jsxs } from "react/jsx-runtime";
10
- import { Archive, Bot, ChevronDown, ChevronRight, Ellipsis, PanelLeft, PanelRight, Pencil, Plus, Send, Settings2, UsersRound } from "lucide-react";
11
- import { DropdownMenu } from "radix-ui";
12
- //#region src/components/workspace/context.tsx
13
- var WorkspaceContext = createContext(null);
14
- function WorkspaceProvider({ value, children }) {
15
- const full = useMemo(() => {
16
- const byId = new Map(value.agents.map((agent) => [agent.id, agent]));
17
- return {
18
- ...value,
19
- agentById: (id) => byId.get(id),
20
- to: (patch) => ({
21
- ...value.search,
22
- ...patch
23
- })
24
- };
25
- }, [value]);
26
- return /* @__PURE__ */ jsx(WorkspaceContext.Provider, {
27
- value: full,
28
- children
29
- });
30
- }
31
- function useWorkspace() {
32
- const value = useContext(WorkspaceContext);
33
- if (!value) throw new Error("useWorkspace needs a WorkspaceProvider");
34
- return value;
35
- }
36
- /** The workspace when there is one: a conversation can also render on its own. */
37
- function useWorkspaceOptional() {
38
- return useContext(WorkspaceContext);
39
- }
40
- //#endregion
41
- //#region src/components/workspace/Rail.tsx
42
- var SIDEBAR_OPEN_GROUPS_COOKIE = "bz_sidebar_open_groups";
43
- function writeOpenGroupsCookie(map) {
44
- document.cookie = `${SIDEBAR_OPEN_GROUPS_COOKIE}=${encodeURIComponent(JSON.stringify(map))}; Path=/; Max-Age=31536000; SameSite=Lax`;
45
- }
46
- var MENU_ITEM = "flex min-h-8 w-full cursor-pointer items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm text-foreground outline-none transition-colors data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50";
47
- var MENU_LABEL = "flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground";
48
- var STATE_TEXT = {
49
- needs: "text-warning",
50
- working: "text-success",
51
- paused: "text-warning",
52
- fresh: "text-accent-foreground",
53
- idle: "text-muted-foreground"
54
- };
55
- var STATE_DOT = {
56
- needs: "bg-warning",
57
- working: "bg-success animate-pulse",
58
- paused: "bg-fawn",
59
- fresh: "bg-primary",
60
- idle: "bg-fawn"
61
- };
62
- /** The Default Team first, then the rest as the daemon lists them. */
63
- function sortTeams(teams) {
64
- return [...teams].sort((a, b) => Number(b.id === DEFAULT_TEAM_ID) - Number(a.id === DEFAULT_TEAM_ID));
65
- }
66
- function Rail({ initialOpenGroups }) {
67
- const { agents, teams, profiles, teamTemplates, agent: open, team: inView, search } = useWorkspace();
68
- const activity = useActivity();
69
- const router = useRouter();
70
- const [spawnProfile, setSpawnProfile] = useState(null);
71
- const [spawnTeam, setSpawnTeam] = useState(void 0);
72
- const [spawnTemplate, setSpawnTemplate] = useState(null);
73
- const [createTeamOpen, setCreateTeamOpen] = useState(false);
74
- const [createTeamBusy, setCreateTeamBusy] = useState(false);
75
- const [renameTarget, setRenameTarget] = useState(null);
76
- const [archiveTarget, setArchiveTarget] = useState(null);
77
- const [openGroups, setOpenGroups] = useState(initialOpenGroups);
78
- const newButton = useRef(null);
79
- const refocusNewButton = () => window.requestAnimationFrame(() => newButton.current?.focus());
80
- const sortedProfiles = [...profiles].sort((a, b) => Number(b.id === DEFAULT_PROFILE_ID) - Number(a.id === DEFAULT_PROFILE_ID));
81
- const sortedTeams = sortTeams(teams);
82
- const template = teamTemplates.find((entry) => entry.id === spawnTemplate);
83
- const selectedId = open?.agent.id ?? null;
84
- return /* @__PURE__ */ jsxs("aside", {
85
- className: "flex h-full flex-col overflow-hidden rounded-2xl border border-border bg-card shadow-baziu-sm",
86
- children: [
87
- /* @__PURE__ */ jsxs("header", {
88
- className: "flex items-center justify-between gap-3 border-b border-border bg-muted/60 px-3 py-2.5",
89
- children: [/* @__PURE__ */ jsxs("div", {
90
- className: "flex min-w-0 items-center gap-2",
91
- children: [/* @__PURE__ */ jsx("span", {
92
- className: "flex size-7 shrink-0 items-center justify-center rounded-[10px] bg-accent text-accent-foreground",
93
- children: /* @__PURE__ */ jsx(UsersRound, {
94
- className: "size-4",
95
- "aria-hidden": "true"
96
- })
97
- }), /* @__PURE__ */ jsxs("div", {
98
- className: "min-w-0",
99
- children: [/* @__PURE__ */ jsx("div", {
100
- className: "text-sm font-semibold leading-tight text-foreground",
101
- children: "Teams"
102
- }), /* @__PURE__ */ jsxs("p", {
103
- className: "m-0 truncate text-xs leading-snug text-muted-foreground",
104
- children: [
105
- agents.length,
106
- " agent",
107
- agents.length === 1 ? "" : "s",
108
- " in ",
109
- teams.length,
110
- " team",
111
- teams.length === 1 ? "" : "s"
112
- ]
113
- })]
114
- })]
115
- }), /* @__PURE__ */ jsxs(DropdownMenu.Root, {
116
- modal: false,
117
- children: [/* @__PURE__ */ jsx(DropdownMenu.Trigger, {
118
- asChild: true,
119
- children: /* @__PURE__ */ jsxs("button", {
120
- ref: newButton,
121
- type: "button",
122
- "aria-label": "Create a new Agent or Team",
123
- className: "unstyled group inline-flex h-8 items-center gap-1 rounded-lg border border-border bg-card px-2.5 text-xs font-semibold text-foreground shadow-baziu-sm transition-colors hover:border-primary/30 hover:bg-accent hover:text-accent-foreground",
124
- children: [
125
- /* @__PURE__ */ jsx(Plus, {
126
- className: "size-3.5",
127
- "aria-hidden": "true"
128
- }),
129
- "New",
130
- /* @__PURE__ */ jsx(ChevronDown, {
131
- className: "size-3.5 text-muted-foreground transition-transform group-data-[state=open]:rotate-180",
132
- "aria-hidden": "true"
133
- })
134
- ]
135
- })
136
- }), /* @__PURE__ */ jsx(DropdownMenu.Portal, { children: /* @__PURE__ */ jsxs(DropdownMenu.Content, {
137
- align: "end",
138
- sideOffset: 6,
139
- className: "z-50 w-60 rounded-xl border border-border bg-popover p-1.5 text-popover-foreground shadow-baziu-lg outline-none",
140
- children: [
141
- /* @__PURE__ */ jsxs(DropdownMenu.Label, {
142
- className: MENU_LABEL,
143
- children: [/* @__PURE__ */ jsx(Bot, {
144
- className: "size-3",
145
- "aria-hidden": "true"
146
- }), "Agent templates"]
147
- }),
148
- sortedProfiles.length === 0 ? /* @__PURE__ */ jsx(DropdownMenu.Item, {
149
- asChild: true,
150
- className: MENU_ITEM,
151
- children: /* @__PURE__ */ jsx("a", {
152
- href: "/templates/agents?new=1",
153
- children: "Create an Agent template"
154
- })
155
- }) : sortedProfiles.map((profile) => /* @__PURE__ */ jsxs(DropdownMenu.Item, {
156
- className: MENU_ITEM,
157
- onSelect: () => {
158
- setSpawnTeam(inView?.id);
159
- setSpawnProfile(profile.id);
160
- },
161
- children: [/* @__PURE__ */ jsx("span", {
162
- className: "min-w-0 flex-1 truncate",
163
- children: profile.name || profile.id
164
- }), profile.id === "default" && /* @__PURE__ */ jsx("span", {
165
- className: "rounded-full border border-border bg-muted px-1.5 py-0.5 text-xs font-semibold text-muted-foreground",
166
- children: "Default"
167
- })]
168
- }, profile.id)),
169
- /* @__PURE__ */ jsx(DropdownMenu.Separator, { className: "my-1.5 h-px bg-border" }),
170
- /* @__PURE__ */ jsxs(DropdownMenu.Label, {
171
- className: MENU_LABEL,
172
- children: [/* @__PURE__ */ jsx(UsersRound, {
173
- className: "size-3",
174
- "aria-hidden": "true"
175
- }), "Team templates"]
176
- }),
177
- teamTemplates.length === 0 ? /* @__PURE__ */ jsx(DropdownMenu.Item, {
178
- asChild: true,
179
- className: MENU_ITEM,
180
- children: /* @__PURE__ */ jsx("a", {
181
- href: "/templates/teams?new=1",
182
- children: "Create a Team template"
183
- })
184
- }) : teamTemplates.map((entry) => /* @__PURE__ */ jsxs(DropdownMenu.Item, {
185
- className: MENU_ITEM,
186
- disabled: entry.slots.length === 0,
187
- title: entry.slots.length === 0 ? "Add at least one member before spawning" : void 0,
188
- onSelect: () => setSpawnTemplate(entry.id),
189
- children: [/* @__PURE__ */ jsx("span", {
190
- className: "min-w-0 flex-1 truncate",
191
- children: entry.name || entry.id
192
- }), /* @__PURE__ */ jsx("span", {
193
- className: "inline-flex min-w-6 items-center justify-center rounded-full bg-muted px-1.5 font-mono text-xs text-muted-foreground",
194
- children: entry.slots.length
195
- })]
196
- }, entry.id)),
197
- /* @__PURE__ */ jsx(DropdownMenu.Separator, { className: "my-1.5 h-px bg-border" }),
198
- /* @__PURE__ */ jsxs(DropdownMenu.Item, {
199
- className: MENU_ITEM,
200
- onSelect: () => setCreateTeamOpen(true),
201
- children: [/* @__PURE__ */ jsx(Plus, {
202
- className: "size-3.5",
203
- "aria-hidden": "true"
204
- }), "Create a Team"]
205
- })
206
- ]
207
- }) })]
208
- })]
209
- }),
210
- /* @__PURE__ */ jsxs("nav", {
211
- className: "flex-1 overflow-y-auto p-1.5",
212
- "aria-label": "Teams and agents",
213
- children: [agents.length === 0 && /* @__PURE__ */ jsxs("div", {
214
- className: "m-1 mb-2 flex flex-col items-center rounded-xl border border-dashed border-border bg-muted/30 px-4 py-6 text-center",
215
- children: [
216
- /* @__PURE__ */ jsx("p", {
217
- className: "m-0 text-sm font-semibold text-foreground",
218
- children: "No agents yet"
219
- }),
220
- /* @__PURE__ */ jsx("p", {
221
- className: "mt-1 text-xs leading-5 text-muted-foreground",
222
- children: "Your default Team is ready. Spawn the first agent to start a conversation."
223
- }),
224
- sortedProfiles[0] ? /* @__PURE__ */ jsx(Button, {
225
- variant: "primary",
226
- className: "mt-3",
227
- onClick: () => setSpawnProfile(sortedProfiles[0]?.id ?? "default"),
228
- children: "Spawn first agent"
229
- }) : /* @__PURE__ */ jsx("a", {
230
- href: "/templates/agents?new=1",
231
- className: "mt-3 text-xs font-semibold",
232
- children: "Create an Agent template"
233
- })
234
- ]
235
- }), sortedTeams.map((team) => {
236
- const members = agents.filter((agent) => agent.teamId === team.id);
237
- const current = inView?.id === team.id;
238
- const isOpen = openGroups[team.id] ?? (current || team.id === "default");
239
- const summary = teamSummary(members.map((agent) => activity.stateOf(agent.id)));
240
- return /* @__PURE__ */ jsxs("details", {
241
- open: isOpen,
242
- onToggle: (event) => {
243
- const next = event.currentTarget.open;
244
- if (next === isOpen) return;
245
- const merged = {
246
- ...openGroups,
247
- [team.id]: next
248
- };
249
- writeOpenGroupsCookie(merged);
250
- setOpenGroups(merged);
251
- },
252
- className: "group/details mb-1 last:mb-0",
253
- children: [/* @__PURE__ */ jsxs("summary", {
254
- className: `flex min-h-9 cursor-pointer list-none items-center gap-1.5 rounded-lg py-1 pl-2 pr-1 text-sm transition-colors hover:bg-accent/60 [&::-webkit-details-marker]:hidden ${current ? "bg-muted text-foreground" : "text-mocha"}`,
255
- children: [
256
- /* @__PURE__ */ jsx(ChevronRight, {
257
- className: "size-3.5 shrink-0 text-muted-foreground transition-transform group-open/details:rotate-90",
258
- "aria-hidden": "true"
259
- }),
260
- /* @__PURE__ */ jsx("span", {
261
- className: "min-w-0 flex-1 truncate font-semibold",
262
- children: team.name
263
- }),
264
- /* @__PURE__ */ jsx("span", {
265
- className: "shrink-0 text-xs text-muted-foreground",
266
- children: summary || members.length
267
- }),
268
- /* @__PURE__ */ jsx(Link, {
269
- to: "/",
270
- search: {
271
- ...open?.team.id === team.id ? { agent: open.agent.id } : {},
272
- team: team.id,
273
- panel: "team"
274
- },
275
- "aria-label": `Open ${team.name}: members, USER.md, memory`,
276
- title: "Open the Team",
277
- className: "flex size-7 shrink-0 items-center justify-center rounded-lg text-muted-foreground hover:bg-card hover:text-primary",
278
- children: /* @__PURE__ */ jsx(PanelRight, {
279
- className: "size-3.5",
280
- "aria-hidden": "true"
281
- })
282
- })
283
- ]
284
- }), members.length === 0 ? /* @__PURE__ */ jsx("div", {
285
- className: "py-2 pl-7 pr-2 text-xs text-muted-foreground",
286
- children: "No agents in this team"
287
- }) : /* @__PURE__ */ jsx("div", {
288
- className: "space-y-0.5 py-1 pl-1.5",
289
- children: members.map((agent) => /* @__PURE__ */ jsx(AgentRow, {
290
- agent,
291
- selected: agent.id === selectedId,
292
- state: activity.stateOf(agent.id),
293
- lastActivityAt: activity.byAgent.get(agent.id)?.lastActivityAt ?? null,
294
- panel: search.panel,
295
- onRename: () => setRenameTarget(agent),
296
- onArchive: () => setArchiveTarget(agent)
297
- }, agent.id))
298
- })]
299
- }, team.id);
300
- })]
301
- }),
302
- spawnProfile && /* @__PURE__ */ jsx(SpawnDialog, {
303
- profiles: sortedProfiles,
304
- teams: sortedTeams,
305
- profileId: spawnProfile,
306
- teamId: spawnTeam,
307
- onClose: () => {
308
- setSpawnProfile(null);
309
- refocusNewButton();
310
- }
311
- }),
312
- template && /* @__PURE__ */ jsx(SpawnTeamModal, {
313
- template,
314
- teams: sortedTeams,
315
- onClose: () => {
316
- setSpawnTemplate(null);
317
- refocusNewButton();
318
- },
319
- onSpawned: (slug) => {
320
- setSpawnTemplate(null);
321
- router.navigate({
322
- to: "/",
323
- search: {
324
- team: slug,
325
- panel: "team"
326
- }
327
- });
328
- }
329
- }),
330
- createTeamOpen && /* @__PURE__ */ jsx(Dialog$1, {
331
- title: "Create a Team",
332
- description: "A Team is one workspace: its folder, its Agents, its USER.md and shared memory, and who may message whom.",
333
- busy: createTeamBusy,
334
- onClose: () => {
335
- setCreateTeamOpen(false);
336
- refocusNewButton();
337
- },
338
- children: /* @__PURE__ */ jsx(TeamForm, {
339
- onBusyChange: setCreateTeamBusy,
340
- onCreated: async (team) => {
341
- setCreateTeamOpen(false);
342
- await router.navigate({
343
- to: "/",
344
- search: {
345
- team: team.id,
346
- panel: "team"
347
- }
348
- });
349
- },
350
- extraActions: (busy) => /* @__PURE__ */ jsx(Button, {
351
- variant: "ghost",
352
- disabled: busy,
353
- onClick: () => setCreateTeamOpen(false),
354
- children: "Cancel"
355
- })
356
- })
357
- }),
358
- renameTarget && /* @__PURE__ */ jsx(RenameAgentDialog, {
359
- agent: renameTarget,
360
- onClose: () => setRenameTarget(null),
361
- onRenamed: () => router.invalidate()
362
- }),
363
- /* @__PURE__ */ jsx(ConfirmDialog, {
364
- open: archiveTarget !== null,
365
- onOpenChange: (next) => {
366
- if (!next) setArchiveTarget(null);
367
- },
368
- title: `Archive ${archiveTarget?.name ?? "agent"}?`,
369
- description: /* @__PURE__ */ jsx("p", { children: "The Agent leaves this list and receives no work. Restore it later under Manage → Agents, in Archived." }),
370
- confirmLabel: "Archive agent",
371
- confirmVariant: "primary",
372
- onConfirm: async () => {
373
- if (!archiveTarget) return;
374
- await archiveAgent(archiveTarget.id);
375
- if (archiveTarget.id === selectedId) await router.navigate({
376
- to: "/",
377
- search: {}
378
- });
379
- else await router.invalidate();
380
- }
381
- })
382
- ]
383
- });
384
- }
385
- function AgentRow({ agent, selected, state, lastActivityAt, panel, onRename, onArchive }) {
386
- const hydrated = useHydrated();
387
- return /* @__PURE__ */ jsxs("div", {
388
- className: "group/row relative rounded-2xl",
389
- children: [/* @__PURE__ */ jsxs(Link, {
390
- to: "/",
391
- search: {
392
- agent: agent.id,
393
- ...panel ? { panel } : {}
394
- },
395
- "aria-current": selected ? "page" : void 0,
396
- className: `flex min-h-[3.1rem] items-center gap-2.5 rounded-2xl border py-1.5 pl-2 pr-9 transition-colors hover:bg-accent/60 ${selected ? "border-primary/20 bg-accent shadow-baziu-sm" : "border-transparent"}`,
397
- children: [/* @__PURE__ */ jsx(AgentAvatar, {
398
- identity: agent.identity,
399
- size: 30
400
- }), /* @__PURE__ */ jsxs("span", {
401
- className: "block min-w-0 flex-1",
402
- children: [/* @__PURE__ */ jsxs("span", {
403
- className: "flex items-center gap-1.5",
404
- children: [
405
- /* @__PURE__ */ jsx("span", {
406
- className: `min-w-0 truncate text-sm font-semibold leading-tight ${selected ? "text-accent-foreground" : "text-foreground"}`,
407
- children: agent.name
408
- }),
409
- agent.telegramTopicId !== null && /* @__PURE__ */ jsx("span", {
410
- className: "shrink-0 text-primary",
411
- title: `Telegram topic #${agent.telegramTopicId}`,
412
- role: "img",
413
- "aria-label": `Bound to Telegram topic ${agent.telegramTopicId}`,
414
- children: /* @__PURE__ */ jsx(Send, {
415
- className: "size-3",
416
- "aria-hidden": "true"
417
- })
418
- }),
419
- hydrated && lastActivityAt !== null && /* @__PURE__ */ jsx("time", {
420
- dateTime: new Date(lastActivityAt).toISOString(),
421
- className: "ml-auto shrink-0 text-xs font-normal text-muted-foreground",
422
- children: shortTime(lastActivityAt)
423
- })
424
- ]
425
- }), /* @__PURE__ */ jsxs("span", {
426
- className: `mt-0.5 flex items-center gap-1.5 text-xs leading-snug ${STATE_TEXT[state.kind]}`,
427
- children: [/* @__PURE__ */ jsx("span", {
428
- className: `size-[7px] shrink-0 rounded-full ${STATE_DOT[state.kind]}`,
429
- "aria-hidden": "true"
430
- }), /* @__PURE__ */ jsx("span", {
431
- className: "min-w-0 truncate",
432
- children: state.text
433
- })]
434
- })]
435
- })]
436
- }), /* @__PURE__ */ jsxs(DropdownMenu.Root, {
437
- modal: false,
438
- children: [/* @__PURE__ */ jsx(DropdownMenu.Trigger, {
439
- asChild: true,
440
- children: /* @__PURE__ */ jsx("button", {
441
- type: "button",
442
- "aria-label": `More for ${agent.name}`,
443
- className: "unstyled absolute right-1 top-1/2 flex size-7 -translate-y-1/2 items-center justify-center rounded-lg text-muted-foreground opacity-0 transition-opacity hover:bg-card hover:text-primary focus-visible:opacity-100 group-hover/row:opacity-100 data-[state=open]:opacity-100 [@media(hover:none)]:opacity-100",
444
- children: /* @__PURE__ */ jsx(Ellipsis, {
445
- className: "size-4",
446
- "aria-hidden": "true"
447
- })
448
- })
449
- }), /* @__PURE__ */ jsx(DropdownMenu.Portal, { children: /* @__PURE__ */ jsxs(DropdownMenu.Content, {
450
- align: "start",
451
- sideOffset: 4,
452
- className: "z-50 w-48 rounded-xl border border-border bg-popover p-1.5 text-popover-foreground shadow-baziu-lg outline-none",
453
- children: [
454
- /* @__PURE__ */ jsx(DropdownMenu.Item, {
455
- asChild: true,
456
- className: MENU_ITEM,
457
- children: /* @__PURE__ */ jsxs(Link, {
458
- to: "/",
459
- search: {
460
- agent: agent.id,
461
- panel: "agent"
462
- },
463
- children: [/* @__PURE__ */ jsx(Settings2, {
464
- className: "size-3.5",
465
- "aria-hidden": "true"
466
- }), "Agent settings"]
467
- })
468
- }),
469
- /* @__PURE__ */ jsxs(DropdownMenu.Item, {
470
- className: MENU_ITEM,
471
- onSelect: onRename,
472
- children: [/* @__PURE__ */ jsx(Pencil, {
473
- className: "size-3.5",
474
- "aria-hidden": "true"
475
- }), "Rename"]
476
- }),
477
- /* @__PURE__ */ jsxs(DropdownMenu.Item, {
478
- className: MENU_ITEM,
479
- onSelect: onArchive,
480
- children: [/* @__PURE__ */ jsx(Archive, {
481
- className: "size-3.5",
482
- "aria-hidden": "true"
483
- }), "Archive"]
484
- })
485
- ]
486
- }) })]
487
- })]
488
- });
489
- }
490
- /** The rail folded to avatars, beside a full-width view. */
491
- function SlimRail() {
492
- const { agents, teams, agent: open, team: inView, search } = useWorkspace();
493
- const activity = useActivity();
494
- const sortedTeams = sortTeams(teams).filter((team) => agents.some((agent) => agent.teamId === team.id));
495
- sortedTeams.sort((a, b) => Number(b.id === inView?.id) - Number(a.id === inView?.id));
496
- return /* @__PURE__ */ jsxs("nav", {
497
- "aria-label": "Agents",
498
- className: "flex h-full w-16 flex-col items-center gap-2 overflow-y-auto rounded-xl border border-border bg-card py-2.5 shadow-baziu-sm",
499
- children: [/* @__PURE__ */ jsx(Link, {
500
- to: "/",
501
- search: {
502
- ...search,
503
- view: void 0,
504
- file: void 0,
505
- result: void 0
506
- },
507
- "aria-label": "Back to the conversation and the full list",
508
- title: "Back to the conversation",
509
- className: "flex size-10 shrink-0 items-center justify-center rounded-xl text-mocha hover:bg-accent hover:text-accent-foreground",
510
- children: /* @__PURE__ */ jsx(PanelLeft, {
511
- className: "size-[18px]",
512
- "aria-hidden": "true"
513
- })
514
- }), sortedTeams.map((team) => /* @__PURE__ */ jsxs("div", {
515
- className: "flex w-full flex-col items-center gap-2",
516
- children: [
517
- /* @__PURE__ */ jsx("div", { className: "h-px w-8 bg-border" }),
518
- /* @__PURE__ */ jsx("span", {
519
- className: `max-w-14 truncate text-xs font-bold uppercase tracking-[0.06em] ${team.id === inView?.id ? "text-accent-foreground" : "text-muted-foreground"}`,
520
- title: team.name,
521
- children: team.name
522
- }),
523
- agents.filter((agent) => agent.teamId === team.id).map((agent) => {
524
- const state = activity.stateOf(agent.id);
525
- return /* @__PURE__ */ jsxs(Link, {
526
- to: "/",
527
- search: {
528
- agent: agent.id,
529
- ...search.panel ? { panel: search.panel } : {}
530
- },
531
- "aria-label": `${agent.name}: ${state.text}`,
532
- title: `${agent.name}: ${state.text}`,
533
- className: `relative flex size-10 shrink-0 items-center justify-center rounded-full ${agent.id === open?.agent.id ? "ring-2 ring-primary ring-offset-2 ring-offset-card" : ""}`,
534
- children: [/* @__PURE__ */ jsx(AgentAvatar, {
535
- identity: agent.identity,
536
- size: 40
537
- }), /* @__PURE__ */ jsx("span", {
538
- className: `absolute -bottom-px -right-px size-3 rounded-full border-2 border-card ${STATE_DOT[state.kind]}`,
539
- "aria-hidden": "true"
540
- })]
541
- }, agent.id);
542
- })
543
- ]
544
- }, team.id))]
545
- });
546
- }
547
- function RenameAgentDialog({ agent, onClose, onRenamed }) {
548
- const [name, setName] = useState(agent.name);
549
- const [busy, setBusy] = useState(false);
550
- const [error, setError] = useState(null);
551
- const unchanged = !name.trim() || name.trim() === agent.name;
552
- async function submit(event) {
553
- event.preventDefault();
554
- if (unchanged) return;
555
- setBusy(true);
556
- setError(null);
557
- try {
558
- await renameAgent(agent.id, name.trim());
559
- await onRenamed();
560
- onClose();
561
- } catch (cause) {
562
- setError(errorMessage(cause));
563
- setBusy(false);
564
- }
565
- }
566
- return /* @__PURE__ */ jsx(Dialog$1, {
567
- title: `Rename ${agent.name}`,
568
- description: "This changes the display name only; the Agent ID and history stay the same.",
569
- busy,
570
- onClose,
571
- className: "max-w-md",
572
- children: /* @__PURE__ */ jsxs("form", {
573
- onSubmit: (event) => void submit(event),
574
- children: [
575
- /* @__PURE__ */ jsxs("label", { children: ["Agent name", /* @__PURE__ */ jsx("input", {
576
- autoFocus: true,
577
- value: name,
578
- onChange: (event) => setName(event.target.value),
579
- maxLength: 120
580
- })] }),
581
- error && /* @__PURE__ */ jsx("p", {
582
- role: "alert",
583
- className: "mt-3 text-sm text-danger",
584
- children: error
585
- }),
586
- /* @__PURE__ */ jsx("div", {
587
- className: "mt-4",
588
- children: /* @__PURE__ */ jsxs(DialogActions, { children: [/* @__PURE__ */ jsx(Button, {
589
- variant: "ghost",
590
- disabled: busy,
591
- onClick: onClose,
592
- children: "Cancel"
593
- }), /* @__PURE__ */ jsx(Button, {
594
- variant: "primary",
595
- type: "submit",
596
- disabled: busy || unchanged,
597
- children: busy ? "Renaming…" : "Rename agent"
598
- })] })
599
- })
600
- ]
601
- })
602
- });
603
- }
604
- //#endregion
605
- export { STATE_TEXT as a, useWorkspace as c, STATE_DOT as i, useWorkspaceOptional as l, RenameAgentDialog as n, SlimRail as o, SIDEBAR_OPEN_GROUPS_COOKIE as r, WorkspaceProvider as s, Rail as t };