bazilion 0.53.0 → 0.55.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 (178) hide show
  1. package/dist/cli.js +12 -7
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +705 -354
  4. package/dist/daemon.js.map +1 -1
  5. package/dist/web/client/assets/AddProviderDialog-DfFOaCjC.js +1 -0
  6. package/dist/web/client/assets/AgentTemplateParts-IMJmAQjN.js +1 -0
  7. package/dist/web/client/assets/Button-bTJUy9Qf.js +1 -0
  8. package/dist/web/client/assets/{ConfigPage-DiQiJXP6.js → ConfigPage-CzLHZa5o.js} +1 -1
  9. package/dist/web/client/assets/ConfirmDialog-Cu_evkgc.js +1 -0
  10. package/dist/web/client/assets/ConnectionsView-D7Fmutl2.js +1 -0
  11. package/dist/web/client/assets/{ManagePage-xlePXXx5.js → ManagePage-BfvlCrmz.js} +1 -1
  12. package/dist/web/client/assets/{SectionTabs-BMiRKFfb.js → SectionTabs-D7kPQGoh.js} +1 -1
  13. package/dist/web/client/assets/{Segmented-Co4n2C5X.js → Segmented-oPkAHPO1.js} +1 -1
  14. package/dist/web/client/assets/SkillsParts-BuTxcCam.js +1 -0
  15. package/dist/web/client/assets/SpawnTeamModal-B1UnOvtp.js +1 -0
  16. package/dist/web/client/assets/TeamForm-DbzxtRjj.js +1 -0
  17. package/dist/web/client/assets/TeamThread-jpsWq6vI.js +1 -0
  18. package/dist/web/client/assets/UnsavedChangesGuard-BfyU9v9i.js +1 -0
  19. package/dist/web/client/assets/_id-BCNBLF-2.js +1 -0
  20. package/dist/web/client/assets/{_id-DSRgpxEc.js → _id-D8_H79U2.js} +1 -1
  21. package/dist/web/client/assets/access-CDWe1Kwy.js +1 -0
  22. package/dist/web/client/assets/agent-actions-CUee6aJq.js +1 -0
  23. package/dist/web/client/assets/agents-sE686DTf.js +1 -0
  24. package/dist/web/client/assets/agents-yrur1NDa.js +1 -0
  25. package/dist/web/client/assets/arrow-right-U66krZnr.js +1 -0
  26. package/dist/web/client/assets/attention-DYEHDfmx.js +1 -0
  27. package/dist/web/client/assets/bot-BCone8es.js +1 -0
  28. package/dist/web/client/assets/chevron-right-CuqJFXTe.js +1 -0
  29. package/dist/web/client/assets/config-BHv886pr.js +1 -0
  30. package/dist/web/client/assets/createLucideIcon-jxSFpY0Q.js +1 -0
  31. package/dist/web/client/assets/{download-Dj-1ltZb.js → download-Dy88XavQ.js} +1 -1
  32. package/dist/web/client/assets/{file-text-DiP-LaEg.js → file-text-DPsZ8-h9.js} +1 -1
  33. package/dist/web/client/assets/{images-BKjyhYUc.js → images-QBh_rL8b.js} +1 -1
  34. package/dist/web/client/assets/index-GOthyyE-.js +14 -0
  35. package/dist/web/client/assets/{key-round-QpqZklz6.js → key-round-C-I8fAG0.js} +1 -1
  36. package/dist/web/client/assets/{list-checks-BeyG5SVQ.js → list-checks-C9Q-bjEi.js} +1 -1
  37. package/dist/web/client/assets/login-Dhe15Uuc.js +1 -0
  38. package/dist/web/client/assets/manage-BaIU5zKy.js +1 -0
  39. package/dist/web/client/assets/mcp-A_Eo7x3q.js +1 -0
  40. package/dist/web/client/assets/{message-square-DnpSOYv4.js → message-square-Bwf9cHOx.js} +1 -1
  41. package/dist/web/client/assets/{network-BC7rNaOC.js → network-B3FA93gC.js} +1 -1
  42. package/dist/web/client/assets/parts-CpIfn_BH.js +41 -0
  43. package/dist/web/client/assets/plus-CQPjc8uR.js +1 -0
  44. package/dist/web/client/assets/routes-CTg_yjbY.js +85 -0
  45. package/dist/web/client/assets/skills-CLjtYtkA.js +1 -0
  46. package/dist/web/client/assets/{square-terminal-hQZ6pexU.js → square-terminal-DaNLwvEs.js} +1 -1
  47. package/dist/web/client/assets/{style-BtcFIkOS.js → style-mjEbxhf5.js} +1 -1
  48. package/dist/web/client/assets/styles-DzcEC3Rd.css +2 -0
  49. package/dist/web/client/assets/system-CrTSr5_t.js +1 -0
  50. package/dist/web/client/assets/teams-Bhje5n2h.js +1 -0
  51. package/dist/web/client/assets/teams-Cbgw0Qhv.js +1 -0
  52. package/dist/web/client/assets/telegram-HtUczmaA.js +1 -0
  53. package/dist/web/client/assets/tools-BpjFvmoX.js +1 -0
  54. package/dist/web/client/assets/use-resource-BnvgCpBi.js +1 -0
  55. package/dist/web/client/assets/users-round-BElBVSnw.js +1 -0
  56. package/dist/web/client/assets/welcome-D47LKWYO.js +1 -0
  57. package/dist/web/client/assets/wrench-DotqSqSm.js +1 -0
  58. package/dist/web/server/assets/{AddProviderDialog-Di5crZUB.js → AddProviderDialog-BbpuvC2a.js} +7 -10
  59. package/dist/web/server/assets/{AgentTemplateParts-Cqy7kSzx.js → AgentTemplateParts-Ce7snK3m.js} +3 -6
  60. package/dist/web/server/assets/{ConfigPage-oXM3wyOU.js → ConfigPage-qP9ejjuw.js} +1 -1
  61. package/dist/web/server/assets/{ConfirmDialog-DfaJ--A6.js → ConfirmDialog-Z-uYbE9B.js} +1 -2
  62. package/dist/web/server/assets/{ConnectionsView-DZrLoNoW.js → ConnectionsView-CLIV7V5D.js} +9 -9
  63. package/dist/web/server/assets/{ManagePage-0LKHEcT_.js → ManagePage-BR9FwVZM.js} +1 -1
  64. package/dist/web/server/assets/ModelMenu-D-hTgYOO.js +278 -0
  65. package/dist/web/server/assets/{Rail-7JU6ly2O.js → Rail-b6EbjBB-.js} +9 -12
  66. package/dist/web/server/assets/SkillsParts-DWpdydCJ.js +199 -0
  67. package/dist/web/server/assets/SpawnDialog-3wNx0W1R.js +1851 -0
  68. package/dist/web/server/assets/{SpawnTeamModal-CCe6P82H.js → SpawnTeamModal-C-YMvoaB.js} +3 -6
  69. package/dist/web/server/assets/{TeamForm-BzQmdhVi.js → TeamForm-CL45gBdt.js} +2 -5
  70. package/dist/web/server/assets/{TeamThread-SyQpUvz5.js → TeamThread-CVVH6kKj.js} +9 -9
  71. package/dist/web/server/assets/{UnsavedChangesGuard-DrOvPV14.js → UnsavedChangesGuard-CXK75QQp.js} +1 -1
  72. package/dist/web/server/assets/{_id-AcyGvFrE.js → _id-2I4CSMQj.js} +10 -14
  73. package/dist/web/server/assets/{_id-DPGzfmjG.js → _id-8zsImuGa.js} +9 -11
  74. package/dist/web/server/assets/{_id-DXm9W55C.js → _id-BpfoPuTv.js} +2 -2
  75. package/dist/web/server/assets/{_id-DojvxRZn.js → _id-De3Bm0SG.js} +1 -1
  76. package/dist/web/server/assets/{_id-BGTgqsWm.js → _id-d2OwovYV.js} +2 -2
  77. package/dist/web/server/assets/_tanstack-start-manifest_v-kkY_s_uR.js +256 -0
  78. package/dist/web/server/assets/{access-CKSW7MFH.js → access-CwZ27Wsl.js} +4 -6
  79. package/dist/web/server/assets/{access-BJe-NduL.js → access-CyUoElTP.js} +2 -2
  80. package/dist/web/server/assets/{agent-actions-CUDMCG0F.js → agent-actions-C07Cp5Ue.js} +1 -1
  81. package/dist/web/server/assets/{agents-6d9WxbYF.js → agents-CRtMfKqX.js} +1 -1
  82. package/dist/web/server/assets/{agents-DtLDoZ_u.js → agents-CwzhpDPm.js} +6 -8
  83. package/dist/web/server/assets/{agents-1sjSvp5p.js → agents-DCWEoaxY.js} +2 -2
  84. package/dist/web/server/assets/{agents-DKVGUwD1.js → agents-DQowl6Ly.js} +1 -1
  85. package/dist/web/server/assets/{agents-DUI4Yjtg.js → agents-DTub-rJk.js} +2 -2
  86. package/dist/web/server/assets/{agents-DsHeRaLq.js → agents-vuXrAv1j.js} +6 -10
  87. package/dist/web/server/assets/{attention-DefKwvgm.js → attention-BqCnJ1hg.js} +5 -2
  88. package/dist/web/server/assets/{attention-B6sSDR_4.js → attention-Dki8rmGZ.js} +3 -0
  89. package/dist/web/server/assets/{attention-johfkM0_.js → attention-DwGaur_w.js} +53 -11
  90. package/dist/web/server/assets/{config-DYAaaE9Z.js → config-B9dJiji_.js} +2 -2
  91. package/dist/web/server/assets/{config-Clz57LuN.js → config-D3MR2VjE.js} +24 -26
  92. package/dist/web/server/assets/{createSsrRpc-BijMHgqE.js → createSsrRpc-qesavJv-.js} +4 -57
  93. package/dist/web/server/assets/{login-JoIjlcmu.js → login-CRd1yTH5.js} +34 -45
  94. package/dist/web/server/assets/{login-VV10kZBl.js → login-ZN6KV8n-.js} +36 -2
  95. package/dist/web/server/assets/{manage-Ppyi3Y5y.js → manage-Ce6cI4eW.js} +14 -4
  96. package/dist/web/server/assets/{mcp-Ce6O8Qs2.js → mcp-BQ15a9dG.js} +4 -6
  97. package/dist/web/server/assets/{mcp-DB38leWS.js → mcp-CYQuYWGX.js} +2 -2
  98. package/dist/web/server/assets/page-title-CVY-c2Pd.js +98 -0
  99. package/dist/web/server/assets/{router-C97bwlXi.js → router-CPdWGKQ5.js} +500 -210
  100. package/dist/web/server/assets/routes-BPloBDc8.js +92 -0
  101. package/dist/web/server/assets/{routes-C4aGqXfr.js → routes-Dw1K3TQw.js} +2815 -1744
  102. package/dist/web/server/assets/{routes-DuOShl4q.js → routes-xDPesCQu.js} +2 -2
  103. package/dist/web/server/assets/{skills-B7sg0QKS.js → skills-6VSpEORe.js} +2 -2
  104. package/dist/web/server/assets/skills-D0xrNc2_.js +157 -0
  105. package/dist/web/server/assets/{style-BR7ufS6Z.js → style-aMybyKzc.js} +1 -1
  106. package/dist/web/server/assets/{system-DaP0ol67.js → system-B5sPgdQW.js} +2 -2
  107. package/dist/web/server/assets/{system-CNQpt3JB.js → system-CXmiWyDG.js} +4 -4
  108. package/dist/web/server/assets/{teams-CuKE5iAK.js → teams-ClRBVSYU.js} +2 -2
  109. package/dist/web/server/assets/{teams-4cEZ4_rw.js → teams-Dq4RCxis.js} +2 -2
  110. package/dist/web/server/assets/{teams-C3xwTz8-.js → teams-iXiCnN2i.js} +6 -9
  111. package/dist/web/server/assets/{teams-BKHe67f3.js → teams-yF3I_Zjq.js} +7 -9
  112. package/dist/web/server/assets/{telegram-BnQADwnj.js → telegram-D9U9c1MN.js} +2 -2
  113. package/dist/web/server/assets/{telegram-BpmK-HHV.js → telegram-DwEgyR1x.js} +7 -9
  114. package/dist/web/server/assets/{tools-BQeWn7Tj.js → tools-DflVIdDd.js} +2 -2
  115. package/dist/web/server/assets/{tools-CURTfG2q.js → tools-VPIKjr3y.js} +4 -6
  116. package/dist/web/server/assets/{use-resource-DVzK0toP.js → use-resource-CbHGYti0.js} +1 -1
  117. package/dist/web/server/assets/{welcome-SNsE49JO.js → welcome-7DrYZVs6.js} +2 -2
  118. package/dist/web/server/assets/{welcome-OiZCAIHZ.js → welcome-966nOyyK.js} +10 -9
  119. package/dist/web/server/server.js +8 -8
  120. package/dist/web-server.js +4 -0
  121. package/dist/web-server.js.map +1 -1
  122. package/dist/worker.js +34 -13
  123. package/dist/worker.js.map +1 -1
  124. package/package.json +4 -4
  125. package/dist/web/client/assets/AddProviderDialog-CO_uijWF.js +0 -1
  126. package/dist/web/client/assets/AgentTemplateParts-Dl35c-Ux.js +0 -1
  127. package/dist/web/client/assets/ConfirmDialog-BVytx3kN.js +0 -1
  128. package/dist/web/client/assets/ConnectionsView-DDrBaiLg.js +0 -1
  129. package/dist/web/client/assets/Dialog-BTDzv3J5.js +0 -1
  130. package/dist/web/client/assets/SpawnDialog-ejwXnyxy.js +0 -1
  131. package/dist/web/client/assets/SpawnTeamModal-Cp-nAvIC.js +0 -1
  132. package/dist/web/client/assets/TeamForm-Cz9uDVvb.js +0 -1
  133. package/dist/web/client/assets/TeamThread-D8xqE_gb.js +0 -1
  134. package/dist/web/client/assets/UnsavedChangesGuard-DmT4nBQU.js +0 -1
  135. package/dist/web/client/assets/_id-DEQxwq2v.js +0 -1
  136. package/dist/web/client/assets/access-34_ShgHU.js +0 -1
  137. package/dist/web/client/assets/agent-actions--EO4yJ4Q.js +0 -1
  138. package/dist/web/client/assets/agents-C87yBHaR.js +0 -1
  139. package/dist/web/client/assets/agents-DvCSl1Ro.js +0 -1
  140. package/dist/web/client/assets/api-CoLs57oO.js +0 -1
  141. package/dist/web/client/assets/arrow-right-BhTWtC9z.js +0 -1
  142. package/dist/web/client/assets/attention-CteEeRvX.js +0 -1
  143. package/dist/web/client/assets/chevron-right-BqOIX9UM.js +0 -1
  144. package/dist/web/client/assets/config-XJuQeEP4.js +0 -1
  145. package/dist/web/client/assets/createLucideIcon-dN8ooBD1.js +0 -1
  146. package/dist/web/client/assets/entities-xVoB-p2j.js +0 -1
  147. package/dist/web/client/assets/form-Bvr_f9lR.js +0 -1
  148. package/dist/web/client/assets/index-J_Uqj4md.js +0 -54
  149. package/dist/web/client/assets/login-076Bc601.js +0 -1
  150. package/dist/web/client/assets/manage-CsrV2hhK.js +0 -1
  151. package/dist/web/client/assets/mcp-8N0BqZ0G.js +0 -1
  152. package/dist/web/client/assets/model-facts-DoB6QD5y.js +0 -1
  153. package/dist/web/client/assets/parts-B0JBolvG.js +0 -1
  154. package/dist/web/client/assets/plus-DZ3KVo7E.js +0 -1
  155. package/dist/web/client/assets/routes-3HkZZOOe.js +0 -76
  156. package/dist/web/client/assets/skills-DiaqZRXT.js +0 -1
  157. package/dist/web/client/assets/styles-C7Ztw15K.css +0 -2
  158. package/dist/web/client/assets/system-YWlJ8ogO.js +0 -1
  159. package/dist/web/client/assets/teams-DQwceMvk.js +0 -1
  160. package/dist/web/client/assets/teams-DTC3plIH.js +0 -1
  161. package/dist/web/client/assets/telegram-D4wINntt.js +0 -1
  162. package/dist/web/client/assets/tools-CZeQ9pDx.js +0 -1
  163. package/dist/web/client/assets/use-resource-BaTkTGvG.js +0 -1
  164. package/dist/web/client/assets/welcome-CnxP_RCk.js +0 -1
  165. package/dist/web/client/assets/wrench-BrwBswfo.js +0 -1
  166. package/dist/web/server/assets/Dialog-aup_yJv5.js +0 -85
  167. package/dist/web/server/assets/ModelMenu-BAZeARx6.js +0 -138
  168. package/dist/web/server/assets/SpawnDialog-CYkwzETs.js +0 -124
  169. package/dist/web/server/assets/_tanstack-start-manifest_v-D7RvKGRH.js +0 -285
  170. package/dist/web/server/assets/entities-Dn2xzKIw.js +0 -16
  171. package/dist/web/server/assets/form-BRQAsKKq.js +0 -319
  172. package/dist/web/server/assets/model-facts-mrfrWQne.js +0 -136
  173. package/dist/web/server/assets/parts-mabERIJZ.js +0 -380
  174. package/dist/web/server/assets/routes-IHMVKpDK.js +0 -16
  175. package/dist/web/server/assets/skills-hfTSwqsG.js +0 -353
  176. package/dist/web/server/assets/utils-C_uf36nf.js +0 -8
  177. package/dist/web/server/assets/workspace-DaitCM0t.js +0 -651
  178. /package/dist/web/server/assets/{telegram-CGol0CKX.js → telegram-CGol0CKX2.js} +0 -0
@@ -1,29 +1,30 @@
1
1
  import { r as readCookie } from "./cookies-HnTYjKRp.js";
2
- import { C as api, T as errorMessage, c as parseWorkspaceSearch, d as AgentAvatar, p as agentState, u as Button } from "./workspace-DaitCM0t.js";
2
+ import { $ as agentState, H as parseWorkspaceSearch, K as Button, W as Dialog$1, ct as LiveProvider, dt as api, et as shortTime, lt as useLive, pt as errorMessage, q as AgentAvatar, t as SpawnDialog } from "./SpawnDialog-3wNx0W1R.js";
3
3
  import { n as publicOriginConfig } from "./public-origin-BpDkdS5Q.js";
4
4
  import { t as DAEMON_BASE_URL } from "./daemon-client-B_ZRIIrT.js";
5
- import { a as PageShell } from "./createSsrRpc-BijMHgqE.js";
6
- import { i as BaziuLogo, n as ThemeToggle, r as PawIcon, t as Route$3 } from "./login-JoIjlcmu.js";
7
- import { i as isSetupOpen, n as PUBLIC_PATHS, r as fetchAuthState, t as Route$4 } from "./welcome-SNsE49JO.js";
8
- import { t as Route$5 } from "./routes-IHMVKpDK.js";
9
- import { t as Route$6 } from "./teams-CuKE5iAK.js";
10
- import { t as Route$7 } from "./skills-B7sg0QKS.js";
11
- import { t as Route$8 } from "./config-DYAaaE9Z.js";
12
- import { t as Route$9 } from "./attention-DefKwvgm.js";
13
- import { t as Route$10 } from "./agents-1sjSvp5p.js";
14
- import { t as Route$11 } from "./tools-BQeWn7Tj.js";
15
- import { t as Route$12 } from "./telegram-BnQADwnj.js";
16
- import { t as Route$13 } from "./system-DaP0ol67.js";
17
- import { t as Route$14 } from "./mcp-DB38leWS.js";
18
- import { t as Route$15 } from "./access-BJe-NduL.js";
19
- import { t as Route$16 } from "./teams-4cEZ4_rw.js";
20
- import { t as Route$17 } from "./agents-DUI4Yjtg.js";
21
- import { t as Route$18 } from "./_id-BGTgqsWm.js";
22
- import { t as Route$19 } from "./_id-DXm9W55C.js";
23
- import { useEffect, useMemo, useState } from "react";
5
+ import { i as useAttentionCount, r as AttentionCountProvider, t as PageTitleProvider } from "./page-title-CVY-c2Pd.js";
6
+ import { r as PageShell } from "./createSsrRpc-qesavJv-.js";
7
+ import { a as PawIcon, i as useThemeMode, n as THEME_MODES, o as BaziuLogo, r as setThemeMode, t as Route$3 } from "./login-CRd1yTH5.js";
8
+ import { i as isTyping, n as NEW_CONVERSATION_EVENT, r as SHORTCUTS, t as Route$4 } from "./routes-BPloBDc8.js";
9
+ import { i as isSetupOpen, n as PUBLIC_PATHS, r as fetchAuthState, t as Route$5 } from "./welcome-7DrYZVs6.js";
10
+ import { t as Route$6 } from "./teams-ClRBVSYU.js";
11
+ import { t as Route$7 } from "./skills-6VSpEORe.js";
12
+ import { t as Route$8 } from "./config-B9dJiji_.js";
13
+ import { t as Route$9 } from "./attention-BqCnJ1hg.js";
14
+ import { t as Route$10 } from "./agents-DCWEoaxY.js";
15
+ import { t as Route$11 } from "./tools-DflVIdDd.js";
16
+ import { t as Route$12 } from "./telegram-D9U9c1MN.js";
17
+ import { t as Route$13 } from "./system-B5sPgdQW.js";
18
+ import { t as Route$14 } from "./mcp-CYQuYWGX.js";
19
+ import { t as Route$15 } from "./access-CyUoElTP.js";
20
+ import { t as Route$16 } from "./teams-Dq4RCxis.js";
21
+ import { t as Route$17 } from "./agents-DTub-rJk.js";
22
+ import { t as Route$18 } from "./_id-d2OwovYV.js";
23
+ import { t as Route$19 } from "./_id-BpfoPuTv.js";
24
+ import { useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
24
25
  import { HeadContent, Link, Outlet, Scripts, createFileRoute, createRootRoute, createRouter, redirect, useNavigate, useRouter, useRouterState } from "@tanstack/react-router";
25
26
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
26
- import { BellRing, Bot, ChevronDown, LayoutTemplate, LogOut, Search, Settings2, SlidersHorizontal, Sparkles, UsersRound } from "lucide-react";
27
+ import { Bell, BellOff, BellRing, Check, Keyboard, LayoutGrid, LogOut, MessageSquarePlus, Monitor, Moon, Search, Settings2, Sun, UserPlus, UserRound } from "lucide-react";
27
28
  import { Dialog, DropdownMenu } from "radix-ui";
28
29
  //#region src/components/RouteStates.tsx
29
30
  /** The router's error view for every route: a loader failed. The top nav stays usable. */
@@ -92,6 +93,89 @@ function Footer() {
92
93
  });
93
94
  }
94
95
  //#endregion
96
+ //#region src/lib/desktop-notifications.tsx
97
+ var KEY = "bz_notify";
98
+ var CHANGED = "bz-notify-change";
99
+ /** A burst (several Agents at once) shows at most this many notifications. */
100
+ var MAX_AT_ONCE = 3;
101
+ function read() {
102
+ if (typeof window === "undefined" || !("Notification" in window) || !window.isSecureContext) return "unsupported";
103
+ if (Notification.permission === "denied") return "blocked";
104
+ let chosen = false;
105
+ try {
106
+ chosen = window.localStorage.getItem(KEY) === "on";
107
+ } catch {
108
+ chosen = false;
109
+ }
110
+ return chosen && Notification.permission === "granted" ? "on" : "off";
111
+ }
112
+ function subscribe(onChange) {
113
+ window.addEventListener(CHANGED, onChange);
114
+ window.addEventListener("storage", onChange);
115
+ return () => {
116
+ window.removeEventListener(CHANGED, onChange);
117
+ window.removeEventListener("storage", onChange);
118
+ };
119
+ }
120
+ function store(value) {
121
+ try {
122
+ window.localStorage.setItem(KEY, value);
123
+ } catch {}
124
+ window.dispatchEvent(new Event(CHANGED));
125
+ }
126
+ /** Whether desktop notifications are on in this browser; the server renders "off". */
127
+ function useNotificationsState() {
128
+ return useSyncExternalStore(subscribe, read, () => "off");
129
+ }
130
+ /** Ask the browser's permission (it must follow a click) and turn notifications on if granted. */
131
+ async function turnNotificationsOn() {
132
+ if (read() === "unsupported") return "unsupported";
133
+ store((Notification.permission === "granted" ? "granted" : await Notification.requestPermission()) === "granted" ? "on" : "off");
134
+ return read();
135
+ }
136
+ function turnNotificationsOff() {
137
+ store("off");
138
+ }
139
+ /** The items that started waiting since `known`, oldest first, at most a few. */
140
+ function newlyWaiting(known, waiting) {
141
+ return waiting.filter((item) => !known.has(item.key)).toSorted((a, b) => a.occurredAt - b.occurredAt).slice(0, MAX_AT_ONCE);
142
+ }
143
+ /** Shows the notifications; rendered once, inside the live feed's provider. */
144
+ function DesktopNotifier() {
145
+ const live = useLive();
146
+ const router = useRouter();
147
+ const known = useRef(null);
148
+ useEffect(() => live.subscribe("attention", (event) => {
149
+ const fresh = known.current === null ? [] : newlyWaiting(known.current ?? /* @__PURE__ */ new Set(), event.waiting);
150
+ known.current = new Set(event.waiting.map((item) => item.key));
151
+ if (fresh.length === 0 || read() !== "on") return;
152
+ if (!live.isLeader() || live.anyTabFocused()) return;
153
+ for (const item of fresh) {
154
+ let notification;
155
+ try {
156
+ notification = new Notification(item.title, {
157
+ body: item.diagnostic,
158
+ tag: item.key,
159
+ icon: "/baziu.svg"
160
+ });
161
+ } catch {
162
+ return;
163
+ }
164
+ notification.onclick = () => {
165
+ window.focus();
166
+ notification.close();
167
+ router.navigate({ href: item.href });
168
+ };
169
+ }
170
+ }), [
171
+ live.subscribe,
172
+ live.isLeader,
173
+ live.anyTabFocused,
174
+ router
175
+ ]);
176
+ return null;
177
+ }
178
+ //#endregion
95
179
  //#region src/components/JumpPalette.tsx
96
180
  var PAGES = [
97
181
  [
@@ -130,6 +214,9 @@ var PAGES = [
130
214
  "/config"
131
215
  ]
132
216
  ];
217
+ /** How many Agents' conversations are looked at for "Recent conversations", and how many shown. */
218
+ var RECENT_AGENTS = 3;
219
+ var RECENT_CONVERSATIONS = 5;
133
220
  /** Destinations whose label or hint holds every word of the query. */
134
221
  function filterDestinations(all, query) {
135
222
  const words = query.toLowerCase().split(/\s+/).filter(Boolean);
@@ -139,44 +226,143 @@ function filterDestinations(all, query) {
139
226
  return words.every((word) => text.includes(word));
140
227
  });
141
228
  }
142
- function JumpPalette({ open, onClose }) {
229
+ /**
230
+ * Agents in the palette's order: those waiting for you, then those working, then the rest by when
231
+ * they were last active, most recent first.
232
+ */
233
+ function orderAgents(agents, activity) {
234
+ const kind = (agent) => agentState(activity.get(agent.id), void 0).kind;
235
+ const last = (agent) => activity.get(agent.id)?.lastActivityAt ?? 0;
236
+ return {
237
+ waiting: agents.filter((agent) => kind(agent) === "needs"),
238
+ working: agents.filter((agent) => kind(agent) === "working"),
239
+ rest: agents.filter((agent) => kind(agent) !== "needs" && kind(agent) !== "working").toSorted((a, b) => last(b) - last(a))
240
+ };
241
+ }
242
+ function JumpPalette({ open, onClose, onShowShortcuts }) {
143
243
  const navigate = useNavigate();
144
244
  const location = useRouterState({ select: (state) => state.location });
145
245
  const [query, setQuery] = useState("");
146
246
  const [active, setActive] = useState(0);
147
247
  const [agents, setAgents] = useState([]);
148
248
  const [teams, setTeams] = useState([]);
249
+ const [profiles, setProfiles] = useState([]);
149
250
  const [activity, setActivity] = useState([]);
251
+ const [recent, setRecent] = useState([]);
252
+ const [dark, setDark] = useState(false);
253
+ const [spawning, setSpawning] = useState(false);
254
+ const [loaded, setLoaded] = useState(false);
255
+ const [enterPending, setEnterPending] = useState(false);
150
256
  useEffect(() => {
151
257
  if (!open) return;
152
258
  setQuery("");
153
259
  setActive(0);
260
+ setEnterPending(false);
261
+ setDark(document.documentElement.classList.contains("dark"));
154
262
  const controller = new AbortController();
155
263
  const signal = controller.signal;
156
264
  Promise.all([
157
265
  api("/api/agents", { signal }),
158
266
  api("/api/teams", { signal }),
159
- api("/api/activity", { signal })
160
- ]).then(([nextAgents, nextTeams, nextActivity]) => {
267
+ api("/api/activity", { signal }),
268
+ api("/api/profiles", { signal })
269
+ ]).then(async ([nextAgents, nextTeams, nextActivity, nextProfiles]) => {
161
270
  setAgents(nextAgents);
162
271
  setTeams(nextTeams);
163
272
  setActivity(nextActivity.agents);
164
- }).catch(() => {});
273
+ setProfiles(nextProfiles);
274
+ setLoaded(true);
275
+ const latest = nextActivity.agents.filter((entry) => entry.lastActivityAt !== null).toSorted((a, b) => (b.lastActivityAt ?? 0) - (a.lastActivityAt ?? 0)).slice(0, RECENT_AGENTS);
276
+ setRecent((await Promise.all(latest.map((entry) => api(`/api/agents/${encodeURIComponent(entry.agentId)}/conversations?limit=3`, { signal }).then((list) => list.conversations.map((conversation) => ({
277
+ id: conversation.id,
278
+ agentId: entry.agentId,
279
+ title: conversation.title,
280
+ updatedAt: conversation.updatedAt,
281
+ selected: conversation.id === list.selectedId
282
+ })))))).flat().toSorted((a, b) => b.updatedAt - a.updatedAt).slice(0, RECENT_CONVERSATIONS));
283
+ }).catch(() => {
284
+ if (!signal.aborted) setLoaded(true);
285
+ });
165
286
  return () => controller.abort();
166
287
  }, [open]);
167
288
  const shown = filterDestinations(useMemo(() => {
168
289
  const teamName = new Map(teams.map((team) => [team.id, team.name]));
169
- const states = new Map(activity.map((entry) => [entry.agentId, entry]));
290
+ const byAgent = new Map(activity.map((entry) => [entry.agentId, entry]));
291
+ const agentById = new Map(agents.map((agent) => [agent.id, agent]));
170
292
  const here = location.pathname === "/" ? parseWorkspaceSearch(location.search) : void 0;
171
- const hereTeam = here?.team ?? agents.find((agent) => agent.id === here?.agent)?.teamId ?? void 0;
172
- const list = agents.map((agent) => ({
293
+ const hereAgent = here?.agent ? agentById.get(here.agent) : void 0;
294
+ const hereTeam = here?.team ?? hereAgent?.teamId ?? void 0;
295
+ const agentDestination = (agent, group) => ({
173
296
  key: `agent:${agent.id}`,
174
- group: "Agents",
297
+ group,
175
298
  label: agent.name,
176
- hint: `${teamName.get(agent.teamId) ?? agent.teamId} · ${agentState(states.get(agent.id), void 0).text}`,
299
+ hint: `${teamName.get(agent.teamId) ?? agent.teamId} · ${agentState(byAgent.get(agent.id), void 0).text}`,
177
300
  agent,
178
301
  search: { agent: agent.id }
179
- }));
302
+ });
303
+ const ordered = orderAgents(agents, byAgent);
304
+ const list = [...ordered.waiting.map((agent) => agentDestination(agent, "Waiting for you")), ...ordered.working.map((agent) => agentDestination(agent, "Working now"))];
305
+ if (hereAgent && !here?.view) list.push({
306
+ key: "action:new-conversation",
307
+ group: "Actions",
308
+ label: `New conversation with ${hereAgent.name}`,
309
+ hint: "The current one stays in its list",
310
+ icon: /* @__PURE__ */ jsx(MessageSquarePlus, {
311
+ className: "size-4",
312
+ "aria-hidden": "true"
313
+ }),
314
+ run: () => window.dispatchEvent(new CustomEvent(NEW_CONVERSATION_EVENT, { detail: { agentId: hereAgent.id } }))
315
+ });
316
+ list.push({
317
+ key: "action:spawn",
318
+ group: "Actions",
319
+ label: "Add an Agent",
320
+ hint: hereTeam ? `To ${teamName.get(hereTeam) ?? hereTeam}, or another Team` : "To a Team",
321
+ icon: /* @__PURE__ */ jsx(UserPlus, {
322
+ className: "size-4",
323
+ "aria-hidden": "true"
324
+ }),
325
+ run: () => setSpawning(true)
326
+ }, {
327
+ key: "action:theme",
328
+ group: "Actions",
329
+ label: dark ? "Switch to the light theme" : "Switch to the dark theme",
330
+ hint: "For this browser",
331
+ icon: dark ? /* @__PURE__ */ jsx(Sun, {
332
+ className: "size-4",
333
+ "aria-hidden": "true"
334
+ }) : /* @__PURE__ */ jsx(Moon, {
335
+ className: "size-4",
336
+ "aria-hidden": "true"
337
+ }),
338
+ run: () => setThemeMode(dark ? "light" : "dark")
339
+ }, {
340
+ key: "action:shortcuts",
341
+ group: "Actions",
342
+ label: "Keyboard shortcuts",
343
+ hint: "Press ? anywhere",
344
+ icon: /* @__PURE__ */ jsx(Keyboard, {
345
+ className: "size-4",
346
+ "aria-hidden": "true"
347
+ }),
348
+ run: onShowShortcuts
349
+ });
350
+ list.push(...ordered.rest.map((agent) => agentDestination(agent, "Agents")));
351
+ for (const conversation of recent) {
352
+ const agent = agentById.get(conversation.agentId);
353
+ if (!agent) continue;
354
+ list.push({
355
+ key: `conversation:${conversation.id}`,
356
+ group: "Recent conversations",
357
+ label: conversation.title,
358
+ hint: `${agent.name} · ${shortTime(conversation.updatedAt)}`,
359
+ agent,
360
+ search: conversation.selected ? { agent: agent.id } : {
361
+ agent: agent.id,
362
+ conversation: conversation.id
363
+ }
364
+ });
365
+ }
180
366
  for (const team of teams) list.push({
181
367
  key: `team:${team.id}`,
182
368
  group: "Teams",
@@ -234,19 +420,33 @@ function JumpPalette({ open, onClose }) {
234
420
  agents,
235
421
  teams,
236
422
  activity,
237
- location
423
+ recent,
424
+ location,
425
+ dark,
426
+ onShowShortcuts
238
427
  ]), query);
239
428
  const current = Math.min(active, Math.max(shown.length - 1, 0));
429
+ const hereTeam = location.pathname === "/" ? parseWorkspaceSearch(location.search).team ?? agents.find((agent) => agent.id === parseWorkspaceSearch(location.search).agent)?.teamId : void 0;
430
+ useEffect(() => {
431
+ if (!open || !enterPending || !loaded) return;
432
+ setEnterPending(false);
433
+ go(shown[current]);
434
+ }, [
435
+ open,
436
+ enterPending,
437
+ loaded
438
+ ]);
240
439
  function go(destination) {
241
440
  if (!destination) return;
242
441
  onClose();
243
- if (destination.path) navigate({ to: destination.path });
442
+ if (destination.run) destination.run();
443
+ else if (destination.path) navigate({ to: destination.path });
244
444
  else navigate({
245
445
  to: "/",
246
446
  search: destination.search ?? {}
247
447
  });
248
448
  }
249
- return /* @__PURE__ */ jsx(Dialog.Root, {
449
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Dialog.Root, {
250
450
  open,
251
451
  onOpenChange: (next) => !next && onClose(),
252
452
  children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Overlay, { className: "fixed inset-0 z-50 bg-chocolate/30 data-[state=open]:animate-in data-[state=open]:fade-in-0" }), /* @__PURE__ */ jsxs(Dialog.Content, {
@@ -255,7 +455,7 @@ function JumpPalette({ open, onClose }) {
255
455
  children: [
256
456
  /* @__PURE__ */ jsx(Dialog.Title, {
257
457
  className: "sr-only",
258
- children: "Jump to"
458
+ children: "Jump to or do anything"
259
459
  }),
260
460
  /* @__PURE__ */ jsxs("div", {
261
461
  className: "flex items-center gap-2.5 border-b border-border px-4 py-3",
@@ -266,13 +466,13 @@ function JumpPalette({ open, onClose }) {
266
466
  }),
267
467
  /* @__PURE__ */ jsx("input", {
268
468
  autoFocus: true,
269
- "aria-label": "Jump to",
469
+ "aria-label": "Jump to or do anything",
270
470
  role: "combobox",
271
471
  "aria-expanded": "true",
272
472
  "aria-controls": "jump-results",
273
473
  "aria-activedescendant": shown[current] ? `jump-${shown[current].key}` : void 0,
274
474
  value: query,
275
- placeholder: "Jump to an agent, team or page",
475
+ placeholder: "An Agent, a Team, a page, or something to do",
276
476
  onChange: (event) => {
277
477
  setQuery(event.target.value);
278
478
  setActive(0);
@@ -286,13 +486,15 @@ function JumpPalette({ open, onClose }) {
286
486
  setActive(Math.max(current - 1, 0));
287
487
  } else if (event.key === "Enter") {
288
488
  event.preventDefault();
289
- go(shown[current]);
489
+ if (loaded) go(shown[current]);
490
+ else setEnterPending(true);
290
491
  }
291
492
  },
292
- className: "min-h-0 min-w-0 flex-1 border-0 bg-transparent p-0 text-[0.95rem] shadow-none outline-none focus:bg-transparent focus:shadow-none"
493
+ style: { outline: "none" },
494
+ className: "min-h-0 min-w-0 flex-1 border-0 bg-transparent p-0 text-base shadow-none focus:bg-transparent focus:shadow-none"
293
495
  }),
294
496
  /* @__PURE__ */ jsx("kbd", {
295
- className: "rounded-md border border-border bg-muted px-1.5 py-0.5 font-mono text-[0.7rem] text-muted-foreground",
497
+ className: "rounded-md border border-border bg-muted px-1.5 py-0.5 font-mono text-xs text-muted-foreground",
296
498
  children: "Esc"
297
499
  })
298
500
  ]
@@ -300,17 +502,13 @@ function JumpPalette({ open, onClose }) {
300
502
  /* @__PURE__ */ jsxs("div", {
301
503
  id: "jump-results",
302
504
  role: "listbox",
303
- "aria-label": "Destinations",
505
+ "aria-label": "Destinations and actions",
304
506
  className: "overflow-y-auto p-1.5",
305
- children: [shown.length === 0 && /* @__PURE__ */ jsxs("p", {
507
+ children: [shown.length === 0 && /* @__PURE__ */ jsx("p", {
306
508
  className: "px-3 py-6 text-center text-sm text-muted-foreground",
307
- children: [
308
- "Nothing matches “",
309
- query,
310
- "”."
311
- ]
509
+ children: loaded ? `Nothing matches “${query}”.` : "Loading…"
312
510
  }), shown.map((destination, index) => /* @__PURE__ */ jsxs("div", { children: [destination.group !== shown[index - 1]?.group && /* @__PURE__ */ jsx("div", {
313
- className: "px-2.5 pb-1 pt-2 text-[0.7rem] font-bold uppercase tracking-[0.08em] text-muted-foreground",
511
+ className: `px-2.5 pb-1 pt-2 text-xs font-bold uppercase tracking-[0.08em] ${destination.group === "Waiting for you" ? "text-warning" : "text-muted-foreground"}`,
314
512
  children: destination.group
315
513
  }), /* @__PURE__ */ jsxs("button", {
316
514
  type: "button",
@@ -321,16 +519,19 @@ function JumpPalette({ open, onClose }) {
321
519
  onClick: () => go(destination),
322
520
  className: `unstyled flex min-h-10 w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-left text-sm ${index === current ? "bg-accent text-accent-foreground" : "text-foreground"}`,
323
521
  children: [
324
- destination.agent && /* @__PURE__ */ jsx(AgentAvatar, {
522
+ destination.agent ? /* @__PURE__ */ jsx(AgentAvatar, {
325
523
  identity: destination.agent.identity,
326
524
  size: 24
327
- }),
525
+ }) : destination.icon ? /* @__PURE__ */ jsx("span", {
526
+ className: "flex size-6 shrink-0 items-center justify-center text-mocha",
527
+ children: destination.icon
528
+ }) : null,
328
529
  /* @__PURE__ */ jsx("span", {
329
- className: "font-semibold",
530
+ className: "min-w-0 truncate font-semibold",
330
531
  children: destination.label
331
532
  }),
332
533
  /* @__PURE__ */ jsx("span", {
333
- className: "ml-auto min-w-0 truncate text-xs text-muted-foreground",
534
+ className: "ml-auto min-w-0 shrink truncate pl-3 text-xs text-muted-foreground",
334
535
  children: destination.hint
335
536
  })
336
537
  ]
@@ -338,79 +539,90 @@ function JumpPalette({ open, onClose }) {
338
539
  })
339
540
  ]
340
541
  })] })
542
+ }), spawning && /* @__PURE__ */ jsx(SpawnDialog, {
543
+ profiles,
544
+ teams,
545
+ teamId: hereTeam,
546
+ onClose: () => setSpawning(false)
547
+ })] });
548
+ }
549
+ //#endregion
550
+ //#region src/components/ShortcutsDialog.tsx
551
+ function ShortcutsDialog({ mac, onClose }) {
552
+ return /* @__PURE__ */ jsx(Dialog$1, {
553
+ title: "Keyboard shortcuts",
554
+ description: "The ones without ⌘ or Ctrl wait while you are typing in a field.",
555
+ onClose,
556
+ className: "max-w-lg",
557
+ children: /* @__PURE__ */ jsx("dl", {
558
+ className: "m-0 divide-y divide-border rounded-xl border border-border text-sm",
559
+ children: SHORTCUTS.map((shortcut) => /* @__PURE__ */ jsxs("div", {
560
+ className: "flex items-center gap-4 px-3.5 py-2.5",
561
+ children: [/* @__PURE__ */ jsx("dt", {
562
+ className: "flex shrink-0 gap-1",
563
+ children: shortcut.keys(mac).map((key) => /* @__PURE__ */ jsx("kbd", {
564
+ className: "min-w-7 rounded-md border border-border bg-muted px-1.5 py-0.5 text-center font-mono text-xs text-foreground",
565
+ children: key
566
+ }, key))
567
+ }), /* @__PURE__ */ jsxs("dd", {
568
+ className: "m-0 min-w-0 flex-1 text-foreground",
569
+ children: [shortcut.does, shortcut.where === "workspace" && /* @__PURE__ */ jsx("span", {
570
+ className: "text-muted-foreground",
571
+ children: " (in the workspace)"
572
+ })]
573
+ })]
574
+ }, shortcut.does))
575
+ })
341
576
  });
342
577
  }
343
578
  //#endregion
344
579
  //#region src/components/TopBar.tsx
345
- var MANAGE_LINKS = [
346
- {
347
- href: "/agents",
348
- label: "Agents",
349
- description: "Every Agent by Team: archive, move, delete.",
350
- icon: Bot
351
- },
352
- {
353
- href: "/teams",
354
- label: "Teams",
355
- description: "Create a Team, or remove an empty one.",
356
- icon: UsersRound
357
- },
358
- {
359
- href: "/templates",
360
- label: "Templates",
361
- description: "What new Agents start with, and Team rosters.",
362
- icon: LayoutTemplate
580
+ /** The pages each place covers, for marking it as the current one. */
581
+ var MANAGE_PATHS = [
582
+ "/agents",
583
+ "/teams",
584
+ "/templates",
585
+ "/skills"
586
+ ];
587
+ var SETUP_PATHS = ["/config"];
588
+ var under = (pathname, roots) => roots.some((root) => pathname === root || pathname.startsWith(`${root}/`));
589
+ var THEME_LABELS = {
590
+ system: {
591
+ label: "Same as this computer",
592
+ icon: Monitor
363
593
  },
364
- {
365
- href: "/skills",
366
- label: "Skills",
367
- description: "Import, review and remove prompt skills.",
368
- icon: Sparkles
594
+ light: {
595
+ label: "Light",
596
+ icon: Sun
369
597
  },
370
- {
371
- href: "/config",
372
- label: "Setup",
373
- description: "Models, tools, MCP, Telegram, access, system.",
374
- icon: Settings2
598
+ dark: {
599
+ label: "Dark",
600
+ icon: Moon
375
601
  }
376
- ];
602
+ };
377
603
  function TopBar() {
378
604
  const pathname = useRouterState({ select: (state) => state.location.pathname });
379
- const [attention, setAttention] = useState(null);
380
- const [logoutError, setLogoutError] = useState(null);
381
605
  const [paletteOpen, setPaletteOpen] = useState(false);
606
+ const [shortcutsOpen, setShortcutsOpen] = useState(false);
382
607
  const [mac, setMac] = useState(false);
383
608
  useEffect(() => setMac(/Mac|iPhone|iPad/.test(navigator.userAgent)), []);
384
609
  const setupOnly = pathname === "/welcome";
385
- useEffect(() => {
386
- if (pathname === "/login" || pathname === "/welcome") return;
387
- const controller = new AbortController();
388
- api("/api/attention/summary", { signal: controller.signal }).then(setAttention).catch(() => {});
389
- return () => controller.abort();
390
- }, [pathname]);
610
+ const { open: openAttention } = useAttentionCount();
391
611
  useEffect(() => {
392
612
  if (setupOnly) return;
393
613
  const onKey = (event) => {
394
614
  if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
395
615
  event.preventDefault();
396
616
  setPaletteOpen((open) => !open);
617
+ } else if (!event.defaultPrevented && event.key === "?" && !event.metaKey && !event.ctrlKey && !event.altKey && !isTyping(event.target) && !document.querySelector("[role=\"dialog\"]")) {
618
+ event.preventDefault();
619
+ setShortcutsOpen(true);
397
620
  }
398
621
  };
399
622
  window.addEventListener("keydown", onKey);
400
623
  return () => window.removeEventListener("keydown", onKey);
401
624
  }, [setupOnly]);
402
- const attentionActive = pathname === "/attention" || pathname.startsWith("/attention/");
403
- const openAttention = attention?.openTotal ?? 0;
404
- const manageActive = MANAGE_LINKS.some((link) => pathname === link.href || pathname.startsWith(`${link.href}/`));
405
- async function logout() {
406
- setLogoutError(null);
407
- try {
408
- await api("/api/logout", { method: "POST" });
409
- window.location.assign("/login");
410
- } catch (error) {
411
- setLogoutError(errorMessage(error));
412
- }
413
- }
625
+ const attentionActive = under(pathname, ["/attention"]);
414
626
  return /* @__PURE__ */ jsxs("nav", {
415
627
  "aria-label": "Primary navigation",
416
628
  className: "relative mx-auto flex w-full max-w-[1800px] shrink-0 flex-wrap items-center gap-x-3 gap-y-2 border-b border-frost py-2.5",
@@ -427,7 +639,8 @@ function TopBar() {
427
639
  !setupOnly && /* @__PURE__ */ jsxs("button", {
428
640
  type: "button",
429
641
  onClick: () => setPaletteOpen(true),
430
- "aria-label": "Jump to an agent, team or page",
642
+ "aria-label": "Jump to an agent, team or page, or run an action",
643
+ "aria-keyshortcuts": mac ? "Meta+K" : "Control+K",
431
644
  className: "unstyled order-last flex h-9 min-w-0 basis-full items-center gap-2 rounded-[10px] border border-border bg-muted px-2.5 text-left text-sm text-mocha transition-colors hover:border-sapphire-light sm:order-none sm:ml-3 sm:max-w-sm sm:flex-1 sm:basis-60",
432
645
  children: [
433
646
  /* @__PURE__ */ jsx(Search, {
@@ -436,10 +649,10 @@ function TopBar() {
436
649
  }),
437
650
  /* @__PURE__ */ jsx("span", {
438
651
  className: "min-w-0 flex-1 truncate",
439
- children: "Jump to an agent, team or page"
652
+ children: "Jump to or do anything"
440
653
  }),
441
654
  /* @__PURE__ */ jsx("kbd", {
442
- className: "hidden rounded-md border border-border bg-card px-1.5 py-px font-mono text-[0.7rem] sm:inline",
655
+ className: "hidden rounded-md border border-border bg-card px-1.5 py-px font-mono text-xs sm:inline",
443
656
  children: mac ? "⌘K" : "Ctrl K"
444
657
  })
445
658
  ]
@@ -447,7 +660,7 @@ function TopBar() {
447
660
  /* @__PURE__ */ jsxs("div", {
448
661
  className: "ml-auto flex items-center gap-1",
449
662
  children: [
450
- /* @__PURE__ */ jsxs(Link, {
663
+ !setupOnly && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Link, {
451
664
  to: "/attention",
452
665
  "aria-current": attentionActive ? "page" : void 0,
453
666
  className: navButtonClass(attentionActive),
@@ -473,94 +686,165 @@ function TopBar() {
473
686
  ]
474
687
  })] })
475
688
  ]
689
+ }), /* @__PURE__ */ jsx(PlaceLink, {
690
+ to: "/agents",
691
+ label: "Manage",
692
+ icon: LayoutGrid,
693
+ roots: MANAGE_PATHS
694
+ })] }),
695
+ /* @__PURE__ */ jsx(PlaceLink, {
696
+ to: "/config",
697
+ label: "Setup",
698
+ icon: Settings2,
699
+ roots: SETUP_PATHS
476
700
  }),
477
- /* @__PURE__ */ jsxs(DropdownMenu.Root, { children: [/* @__PURE__ */ jsx(DropdownMenu.Trigger, {
478
- asChild: true,
479
- children: /* @__PURE__ */ jsxs("button", {
480
- type: "button",
481
- className: navButtonClass(manageActive),
482
- "aria-label": "Manage menu",
483
- children: [
484
- /* @__PURE__ */ jsx(SlidersHorizontal, {
485
- className: "size-4 shrink-0",
486
- "aria-hidden": "true"
487
- }),
488
- /* @__PURE__ */ jsx("span", {
489
- className: "hidden sm:inline",
490
- children: "Manage"
491
- }),
492
- /* @__PURE__ */ jsx(ChevronDown, {
493
- className: "size-3 shrink-0 text-muted-foreground",
494
- "aria-hidden": "true"
495
- })
496
- ]
497
- })
498
- }), /* @__PURE__ */ jsx(DropdownMenu.Portal, { children: /* @__PURE__ */ jsx(DropdownMenu.Content, {
499
- align: "end",
500
- sideOffset: 8,
501
- collisionPadding: 12,
502
- className: "z-50 w-[min(21rem,calc(100vw-1.5rem))] rounded-xl border border-border bg-popover p-1.5 text-popover-foreground shadow-baziu-lg outline-none data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
503
- children: MANAGE_LINKS.map((link) => {
504
- const ItemIcon = link.icon;
505
- const itemActive = pathname === link.href || pathname.startsWith(`${link.href}/`);
506
- return /* @__PURE__ */ jsx(DropdownMenu.Item, {
507
- asChild: true,
508
- children: /* @__PURE__ */ jsxs("a", {
509
- href: link.href,
510
- "aria-current": itemActive ? "page" : void 0,
511
- className: `flex cursor-pointer items-start gap-3 rounded-lg px-2.5 py-2.5 outline-none transition-colors focus:bg-accent focus:text-accent-foreground ${itemActive ? "bg-accent/70 text-accent-foreground" : "text-foreground"}`,
512
- children: [/* @__PURE__ */ jsx("span", {
513
- className: "mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground",
514
- children: /* @__PURE__ */ jsx(ItemIcon, {
515
- className: "size-3.5",
516
- "aria-hidden": "true"
517
- })
518
- }), /* @__PURE__ */ jsxs("span", {
519
- className: "min-w-0 flex-1",
520
- children: [/* @__PURE__ */ jsx("span", {
521
- className: "block text-sm font-semibold",
522
- children: link.label
523
- }), /* @__PURE__ */ jsx("span", {
524
- className: "mt-0.5 block text-xs leading-5 text-muted-foreground",
525
- children: link.description
526
- })]
527
- })]
528
- })
529
- }, link.href);
530
- })
531
- }) })] }),
532
- /* @__PURE__ */ jsx(ThemeToggle, {}),
533
- /* @__PURE__ */ jsx("button", {
534
- type: "button",
535
- onClick: () => void logout(),
536
- "aria-label": "Log out",
537
- title: "Log out",
538
- className: "unstyled inline-flex h-9 w-9 items-center justify-center rounded-lg text-mocha hover:bg-ivory hover:text-sapphire",
539
- children: /* @__PURE__ */ jsx(LogOut, {
540
- className: "h-4 w-4",
541
- "aria-hidden": "true"
542
- })
543
- })
701
+ /* @__PURE__ */ jsx(SessionMenu, {})
544
702
  ]
545
703
  }),
546
- logoutError && /* @__PURE__ */ jsx("p", {
547
- role: "alert",
548
- className: "m-0 basis-full rounded-lg bg-danger/10 px-3 py-2 text-sm text-danger",
549
- children: logoutError
550
- }),
551
704
  /* @__PURE__ */ jsx(JumpPalette, {
552
705
  open: paletteOpen,
553
- onClose: () => setPaletteOpen(false)
706
+ onClose: () => setPaletteOpen(false),
707
+ onShowShortcuts: () => setShortcutsOpen(true)
708
+ }),
709
+ shortcutsOpen && /* @__PURE__ */ jsx(ShortcutsDialog, {
710
+ mac,
711
+ onClose: () => setShortcutsOpen(false)
554
712
  })
555
713
  ]
556
714
  });
557
715
  }
716
+ function PlaceLink({ to, label, icon: Icon, roots }) {
717
+ const active = under(useRouterState({ select: (state) => state.location.pathname }), roots);
718
+ return /* @__PURE__ */ jsxs(Link, {
719
+ to,
720
+ "aria-current": active ? "page" : void 0,
721
+ "aria-label": label,
722
+ className: navButtonClass(active),
723
+ children: [/* @__PURE__ */ jsx(Icon, {
724
+ className: "size-4 shrink-0",
725
+ "aria-hidden": "true"
726
+ }), /* @__PURE__ */ jsx("span", {
727
+ className: "hidden sm:inline",
728
+ children: label
729
+ })]
730
+ });
731
+ }
732
+ /** Theme, notifications and Log out: things about this browser rather than places to go. */
733
+ function SessionMenu() {
734
+ const mode = useThemeMode();
735
+ const notifications = useNotificationsState();
736
+ const [error, setError] = useState(null);
737
+ async function logout() {
738
+ setError(null);
739
+ try {
740
+ await api("/api/logout", { method: "POST" });
741
+ window.location.assign("/login");
742
+ } catch (cause) {
743
+ setError(errorMessage(cause));
744
+ }
745
+ }
746
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(DropdownMenu.Root, { children: [/* @__PURE__ */ jsx(DropdownMenu.Trigger, {
747
+ asChild: true,
748
+ children: /* @__PURE__ */ jsx("button", {
749
+ type: "button",
750
+ "aria-label": "Theme, notifications and log out",
751
+ title: "Theme, notifications and log out",
752
+ className: "unstyled inline-flex h-9 w-9 items-center justify-center rounded-lg border border-transparent text-mocha transition-colors hover:border-frost hover:bg-ivory hover:text-sapphire data-[state=open]:border-sapphire-light data-[state=open]:bg-sapphire-glow data-[state=open]:text-sapphire",
753
+ children: /* @__PURE__ */ jsx(UserRound, {
754
+ className: "size-4",
755
+ "aria-hidden": "true"
756
+ })
757
+ })
758
+ }), /* @__PURE__ */ jsx(DropdownMenu.Portal, { children: /* @__PURE__ */ jsxs(DropdownMenu.Content, {
759
+ align: "end",
760
+ sideOffset: 8,
761
+ collisionPadding: 12,
762
+ className: "z-50 w-64 rounded-xl border border-border bg-popover p-1.5 text-popover-foreground shadow-baziu-lg outline-none data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
763
+ children: [
764
+ /* @__PURE__ */ jsx(DropdownMenu.Label, {
765
+ className: "px-2.5 pt-1.5 pb-1 text-xs font-semibold text-muted-foreground",
766
+ children: "Theme"
767
+ }),
768
+ /* @__PURE__ */ jsx(DropdownMenu.RadioGroup, {
769
+ value: mode,
770
+ onValueChange: (value) => setThemeMode(value),
771
+ children: THEME_MODES.map((option) => {
772
+ const { label, icon: Icon } = THEME_LABELS[option];
773
+ return /* @__PURE__ */ jsxs(DropdownMenu.RadioItem, {
774
+ value: option,
775
+ className: "flex cursor-pointer items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground",
776
+ children: [
777
+ /* @__PURE__ */ jsx(Icon, {
778
+ className: "size-4 text-muted-foreground",
779
+ "aria-hidden": "true"
780
+ }),
781
+ /* @__PURE__ */ jsx("span", {
782
+ className: "flex-1",
783
+ children: label
784
+ }),
785
+ /* @__PURE__ */ jsx(DropdownMenu.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, {
786
+ className: "size-4 text-sapphire",
787
+ "aria-hidden": "true"
788
+ }) })
789
+ ]
790
+ }, option);
791
+ })
792
+ }),
793
+ /* @__PURE__ */ jsx(DropdownMenu.Separator, { className: "my-1.5 h-px bg-border" }),
794
+ /* @__PURE__ */ jsx(NotificationsItem, { state: notifications }),
795
+ /* @__PURE__ */ jsx(DropdownMenu.Separator, { className: "my-1.5 h-px bg-border" }),
796
+ /* @__PURE__ */ jsxs(DropdownMenu.Item, {
797
+ onSelect: () => void logout(),
798
+ className: "flex cursor-pointer items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground",
799
+ children: [/* @__PURE__ */ jsx(LogOut, {
800
+ className: "size-4 text-muted-foreground",
801
+ "aria-hidden": "true"
802
+ }), "Log out"]
803
+ })
804
+ ]
805
+ }) })] }), error && /* @__PURE__ */ jsxs("p", {
806
+ role: "alert",
807
+ className: "absolute top-full right-0 z-40 m-0 mt-1 rounded-lg bg-danger/10 px-3 py-2 text-sm text-danger",
808
+ children: ["Could not log out: ", error]
809
+ })] });
810
+ }
811
+ /**
812
+ * Desktop notifications for this browser. Turning them on asks the browser's permission; a browser
813
+ * that blocks them, or an address where it offers none, is said so instead.
814
+ */
815
+ function NotificationsItem({ state }) {
816
+ const itemClass = "flex cursor-pointer items-start gap-2.5 rounded-lg px-2.5 py-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:cursor-default data-[disabled]:opacity-70";
817
+ const Icon = state === "on" ? BellOff : Bell;
818
+ const label = state === "on" ? "Turn off desktop notifications" : state === "off" ? "Notify me on this computer" : "Desktop notifications unavailable";
819
+ const detail = state === "on" || state === "off" ? "When an Agent waits for you and Bazilion is in the background." : state === "blocked" ? "This browser blocks them for this site; allow them in its site settings." : "Browsers offer them on https:// addresses and on this computer only.";
820
+ return /* @__PURE__ */ jsxs(DropdownMenu.Item, {
821
+ disabled: state === "unsupported" || state === "blocked",
822
+ onSelect: (event) => {
823
+ if (state === "on") turnNotificationsOff();
824
+ else {
825
+ event.preventDefault();
826
+ turnNotificationsOn();
827
+ }
828
+ },
829
+ className: itemClass,
830
+ children: [/* @__PURE__ */ jsx(Icon, {
831
+ className: "mt-0.5 size-4 shrink-0 text-muted-foreground",
832
+ "aria-hidden": "true"
833
+ }), /* @__PURE__ */ jsxs("span", {
834
+ className: "flex min-w-0 flex-col gap-0.5",
835
+ children: [/* @__PURE__ */ jsx("span", { children: label }), /* @__PURE__ */ jsx("span", {
836
+ className: "text-xs text-muted-foreground",
837
+ children: detail
838
+ })]
839
+ })]
840
+ });
841
+ }
558
842
  function navButtonClass(active) {
559
843
  return `unstyled inline-flex h-9 shrink-0 items-center justify-center gap-1.5 rounded-lg border px-2 text-sm font-semibold transition-colors sm:px-2.5 ${active ? "border-sapphire-light bg-sapphire-glow text-sapphire shadow-baziu-sm" : "border-transparent text-mocha hover:border-frost hover:bg-ivory hover:text-sapphire"}`;
560
844
  }
561
845
  //#endregion
562
846
  //#region src/styles.css?url
563
- var styles_default = "/assets/styles-C7Ztw15K.css";
847
+ var styles_default = "/assets/styles-DzcEC3Rd.css";
564
848
  //#endregion
565
849
  //#region src/routes/__root.tsx
566
850
  var THEME_INIT_SCRIPT = `(function(){try{var t=localStorage.getItem('baziu-theme');var sd=window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches;var d=t==='dark'||((t===null||t==='system')&&sd);document.documentElement.classList.toggle('dark',d);}catch(e){}})();`;
@@ -634,35 +918,41 @@ function RootComponent() {
634
918
  className: "sr-only z-[100] rounded-lg bg-primary px-4 py-2 font-semibold text-primary-foreground focus:not-sr-only focus:fixed focus:left-3 focus:top-3",
635
919
  children: "Skip to main content"
636
920
  }),
637
- isLogin ? /* @__PURE__ */ jsx(Outlet, {}) : isWorkspace ? /* @__PURE__ */ jsxs("div", {
638
- className: "flex h-dvh flex-col",
639
- children: [/* @__PURE__ */ jsx("div", {
640
- className: "px-3 sm:px-5",
641
- children: /* @__PURE__ */ jsx(TopBar, {})
642
- }), /* @__PURE__ */ jsx("main", {
643
- id: "main-content",
644
- tabIndex: -1,
645
- className: "mx-auto min-h-0 w-full max-w-[1600px] flex-1 overflow-clip px-3 pb-3 sm:px-5 sm:pb-5",
646
- children: /* @__PURE__ */ jsx(Outlet, {})
647
- })]
648
- }) : /* @__PURE__ */ jsxs("div", {
649
- className: "flex min-h-dvh flex-col",
650
- children: [
651
- /* @__PURE__ */ jsx("div", {
652
- className: "px-3 sm:px-5",
653
- children: /* @__PURE__ */ jsx(TopBar, {})
654
- }),
655
- /* @__PURE__ */ jsx("main", {
656
- id: "main-content",
657
- tabIndex: -1,
658
- className: "mx-auto w-full max-w-[1500px] flex-1 px-4 py-9 sm:px-6 sm:py-12",
659
- children: /* @__PURE__ */ jsx(Outlet, {})
660
- }),
661
- /* @__PURE__ */ jsx("div", {
662
- className: "px-4 sm:px-6",
663
- children: /* @__PURE__ */ jsx(Footer, {})
664
- })
665
- ]
921
+ /* @__PURE__ */ jsx(LiveProvider, {
922
+ enabled: !isLogin && pathname !== "/welcome",
923
+ children: /* @__PURE__ */ jsxs(AttentionCountProvider, {
924
+ enabled: !isLogin && pathname !== "/welcome",
925
+ children: [/* @__PURE__ */ jsx(DesktopNotifier, {}), /* @__PURE__ */ jsx(PageTitleProvider, { children: isLogin ? /* @__PURE__ */ jsx(Outlet, {}) : isWorkspace ? /* @__PURE__ */ jsxs("div", {
926
+ className: "flex h-dvh flex-col",
927
+ children: [/* @__PURE__ */ jsx("div", {
928
+ className: "px-3 sm:px-5",
929
+ children: /* @__PURE__ */ jsx(TopBar, {})
930
+ }), /* @__PURE__ */ jsx("main", {
931
+ id: "main-content",
932
+ tabIndex: -1,
933
+ className: "mx-auto min-h-0 w-full max-w-[1600px] flex-1 overflow-clip px-3 pb-3 sm:px-5 sm:pb-5",
934
+ children: /* @__PURE__ */ jsx(Outlet, {})
935
+ })]
936
+ }) : /* @__PURE__ */ jsxs("div", {
937
+ className: "flex min-h-dvh flex-col",
938
+ children: [
939
+ /* @__PURE__ */ jsx("div", {
940
+ className: "px-3 sm:px-5",
941
+ children: /* @__PURE__ */ jsx(TopBar, {})
942
+ }),
943
+ /* @__PURE__ */ jsx("main", {
944
+ id: "main-content",
945
+ tabIndex: -1,
946
+ className: "mx-auto w-full max-w-[1500px] flex-1 px-4 py-9 sm:px-6 sm:py-12",
947
+ children: /* @__PURE__ */ jsx(Outlet, {})
948
+ }),
949
+ /* @__PURE__ */ jsx("div", {
950
+ className: "px-4 sm:px-6",
951
+ children: /* @__PURE__ */ jsx(Footer, {})
952
+ })
953
+ ]
954
+ }) })]
955
+ })
666
956
  }),
667
957
  /* @__PURE__ */ jsx(Scripts, {})
668
958
  ]
@@ -766,7 +1056,7 @@ var Route = createFileRoute("/api/$")({ server: { handlers: {
766
1056
  } } });
767
1057
  //#endregion
768
1058
  //#region src/routeTree.gen.ts
769
- var WelcomeRoute = Route$4.update({
1059
+ var WelcomeRoute = Route$5.update({
770
1060
  id: "/welcome",
771
1061
  path: "/welcome",
772
1062
  getParentRoute: () => Route$2
@@ -776,7 +1066,7 @@ var LoginRoute = Route$3.update({
776
1066
  path: "/login",
777
1067
  getParentRoute: () => Route$2
778
1068
  });
779
- var IndexRoute = Route$5.update({
1069
+ var IndexRoute = Route$4.update({
780
1070
  id: "/",
781
1071
  path: "/",
782
1072
  getParentRoute: () => Route$2