bazilion 0.9.0 → 0.11.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 (189) hide show
  1. package/dist/cli.js +1257 -150
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +3049 -471
  4. package/dist/daemon.js.map +1 -1
  5. package/dist/migrations/0001_init.sql +20 -0
  6. package/dist/web/client/assets/AgentTabs-B3hq5a3e.js +1 -0
  7. package/dist/web/client/assets/ConfigPage-BCwfgyjD.js +1 -0
  8. package/dist/web/client/assets/FieldRow-avAFLgYW.js +1 -0
  9. package/dist/web/client/assets/Page-CwNuDhWz.js +1 -0
  10. package/dist/web/client/assets/ProductionTeamPolicyEditor-B6dbpuYy.js +7 -0
  11. package/dist/web/client/assets/{ProfileCommunicationEditor-D1OZ8WE5.js → ProfileCommunicationEditor-Bf8UvmZT.js} +1 -1
  12. package/dist/web/client/assets/SectionTabs-DZzy01az.js +1 -0
  13. package/dist/web/client/assets/TeamTabs-sQBHChtd.js +1 -0
  14. package/dist/web/client/assets/TemplatesTabs-DPsuwsWB.js +1 -0
  15. package/dist/web/client/assets/_id-C9rkCclz.js +1 -0
  16. package/dist/web/client/assets/_id-D65IzC8H.js +1 -0
  17. package/dist/web/client/assets/_id-DE4IY5bL.js +1 -0
  18. package/dist/web/client/assets/_id-DYASsGQ8.js +1 -0
  19. package/dist/web/client/assets/activity-C7o6-xHg.js +1 -0
  20. package/dist/web/client/assets/agents-UroO4d25.js +1 -0
  21. package/dist/web/client/assets/agents-h8yWXQ2H.js +1 -0
  22. package/dist/web/client/assets/approvals-DKhF0YLC.js +1 -0
  23. package/dist/web/client/assets/chevron-down-BK6NPMMP.js +1 -0
  24. package/dist/web/client/assets/config-q8JDresK.js +3 -0
  25. package/dist/web/client/assets/context-CBucAoi6.js +1 -0
  26. package/dist/web/client/assets/inbox-BwoRikj1.js +1 -0
  27. package/dist/web/client/assets/index-DUXAevpZ.js +12 -0
  28. package/dist/web/client/assets/login-CNAV9Wer.js +1 -0
  29. package/dist/web/client/assets/mcp-BKdEFwHO.js +1 -0
  30. package/dist/web/client/assets/members-BDqZQh26.js +1 -0
  31. package/dist/web/client/assets/memory-DVdEVr6L.js +1 -0
  32. package/dist/web/client/assets/plus-b4yFXP0O.js +1 -0
  33. package/dist/web/client/assets/policy-DdDctqvg.js +1 -0
  34. package/dist/web/client/assets/preload-helper-mNuBjNXU.js +1 -0
  35. package/dist/web/client/assets/react-3W8R1pOO.js +1 -0
  36. package/dist/web/client/assets/routes-BEfALSZv.js +1 -0
  37. package/dist/web/client/assets/services-DZP2ybzb.js +1 -0
  38. package/dist/web/client/assets/skills-DoeIjITs.js +1 -0
  39. package/dist/web/client/assets/styles-BYM0UGdF.css +2 -0
  40. package/dist/web/client/assets/team-policy-D0jpnn2b.js +1 -0
  41. package/dist/web/client/assets/teams-DlHRnrQw.js +1 -0
  42. package/dist/web/client/assets/teams-W3j-UoJ9.js +1 -0
  43. package/dist/web/client/assets/telegram-2OdeGv4E.js +1 -0
  44. package/dist/web/client/assets/tokens-MuBfmgue.js +1 -0
  45. package/dist/web/client/assets/triggers-CX7RMQFQ.js +1 -0
  46. package/dist/web/client/assets/welcome-CvNr5IMi.js +1 -0
  47. package/dist/web/client/assets/wire-constants-BhVKOCQa.js +74 -0
  48. package/dist/web/server/assets/{AgentTabs-BOjTN7QF.js → AgentTabs-DoMDJBXH.js} +10 -7
  49. package/dist/web/server/assets/{ChatPane-Dh3qxzdb.js → ChatPane-Ba5wTsVk.js} +340 -44
  50. package/dist/web/server/assets/ConfigPage-BKlh5vOU.js +68 -0
  51. package/dist/web/server/assets/{FieldRow-DwyqycWI.js → FieldRow-B4eTegH9.js} +5 -5
  52. package/dist/web/server/assets/Page-LENulSXY.js +111 -0
  53. package/dist/web/server/assets/{ProductionTeamPolicyEditor-Bke5doyl.js → ProductionTeamPolicyEditor-Y4mzFFvR.js} +4 -4
  54. package/dist/web/server/assets/SectionTabs-BJTPr5nU.js +8 -0
  55. package/dist/web/server/assets/{Sidebar-CGmtCnYU.js → Sidebar-DsRVCszF.js} +229 -118
  56. package/dist/web/server/assets/{TeamTabs-BPxDBfqy.js → TeamTabs-zZzbP1t_.js} +9 -8
  57. package/dist/web/server/assets/{TemplatesTabs-zf4YhStd.js → TemplatesTabs-CcRxZhJe.js} +5 -4
  58. package/dist/web/server/assets/{_id-fpFQ9_Ya.js → _id-BhOB8Umi.js} +1 -1
  59. package/dist/web/server/assets/{_id-CCHA0gdR.js → _id-C3HY4lWg.js} +7 -10
  60. package/dist/web/server/assets/{_id-B6g9wmPR.js → _id-Cg7x6q3g.js} +22 -28
  61. package/dist/web/server/assets/{_id-B04VaQlh.js → _id-CwyGjJeP.js} +2 -2
  62. package/dist/web/server/assets/{_id-_nFwi9gD.js → _id-D27T85mU.js} +1 -1
  63. package/dist/web/server/assets/{_id-5lLzLwcv.js → _id-D3Ap7zZA.js} +142 -144
  64. package/dist/web/server/assets/{_id-ButXHnRH.js → _id-DinTp_7X.js} +2 -2
  65. package/dist/web/server/assets/{_id-DdC9wpNN.js → _id-Dj1yZ3zJ.js} +2 -2
  66. package/dist/web/server/assets/{_id-DkFgCIb-.js → _id-DqON-59C.js} +2 -2
  67. package/dist/web/server/assets/{_id-CUWgTqMS.js → _id-IzadFZV9.js} +1 -1
  68. package/dist/web/server/assets/{_id-C4AOhstq.js → _id-LrvXU4Nr.js} +6 -5
  69. package/dist/web/server/assets/{_id-DJkzwHjM.js → _id-tB47Vsfp.js} +1 -1
  70. package/dist/web/server/assets/{_tanstack-start-manifest_v-Div-TukY.js → _tanstack-start-manifest_v-BXauUXg6.js} +96 -51
  71. package/dist/web/server/assets/{activity-C2ZKg1Q9.js → activity-BCI4mfNS.js} +28 -30
  72. package/dist/web/server/assets/{activity-DedraoFj.js → activity-D9SMqBhy.js} +2 -2
  73. package/dist/web/server/assets/{activity-GPx8NCeB.js → activity-DohitgwW.js} +1 -1
  74. package/dist/web/server/assets/{agents-BR2qXlXF.js → agents-BPKOshR5.js} +1 -1
  75. package/dist/web/server/assets/{agents-LHowEI6S.js → agents-BY74v7fM.js} +1 -1
  76. package/dist/web/server/assets/{agents-B8kinIPW.js → agents-BvttypqB.js} +2 -2
  77. package/dist/web/server/assets/{agents-Bp1nsVs2.js → agents-C9xlWK0Z.js} +2 -2
  78. package/dist/web/server/assets/agents-CgZMHj80.js +265 -0
  79. package/dist/web/server/assets/{agents-CUQmWhTp.js → agents-DZuFEj0D.js} +59 -77
  80. package/dist/web/server/assets/{approvals-VPc0YpLN.js → approvals-BGU-XGIO.js} +1 -1
  81. package/dist/web/server/assets/{approvals-Dw2LJoSA.js → approvals-CWcFHlor.js} +2 -2
  82. package/dist/web/server/assets/{approvals-DHgARzd8.js → approvals-DCaVw1Mz.js} +116 -78
  83. package/dist/web/server/assets/{auth-l-Vf8wlu.js → auth-byfSx6Ja.js} +1 -1
  84. package/dist/web/server/assets/{config-CHaCv89D.js → config-BDCJdtj2.js} +1 -1
  85. package/dist/web/server/assets/{config-BvKctDOX.js → config-D2LAsud2.js} +28 -49
  86. package/dist/web/server/assets/{config-QvHaxGlP.js → config-TeIoyYYc.js} +2 -2
  87. package/dist/web/server/assets/{context-5lrf2ame.js → context-B-XDf6Ym.js} +1 -1
  88. package/dist/web/server/assets/{context-D3Egm-vY.js → context-BXGo5Vfi.js} +2 -2
  89. package/dist/web/server/assets/context-DrkrIWun.js +47 -0
  90. package/dist/web/server/assets/{createServerRpc-CeKECg65.js → createServerRpc-pU-IQV2Y.js} +1 -1
  91. package/dist/web/server/assets/{createSsrRpc-ZBGxhl8t.js → createSsrRpc-DFsIAfFd.js} +1 -1
  92. package/dist/web/server/assets/{empty-plugin-adapters-DKUlnwwl.js → empty-plugin-adapters-Cq4--YW-.js} +1 -1
  93. package/dist/web/server/assets/{inbox-CkiSvD14.js → inbox-B3-TRsNI.js} +1 -1
  94. package/dist/web/server/assets/{inbox-Bxb3W04M.js → inbox-BardsGyy.js} +2 -2
  95. package/dist/web/server/assets/inbox-CUIyf9MT.js +131 -0
  96. package/dist/web/server/assets/login-Bx5LEyGP.js +118 -0
  97. package/dist/web/server/assets/login-CmWvxfTK.js +136 -0
  98. package/dist/web/server/assets/{mcp-BsFKEoXt.js → mcp-2pwT9HU8.js} +1 -1
  99. package/dist/web/server/assets/{mcp-BU_kKENi.js → mcp-BJjLIdP0.js} +105 -112
  100. package/dist/web/server/assets/{mcp-CKqwG4mt.js → mcp-DIWTogHM.js} +2 -2
  101. package/dist/web/server/assets/members-CCv17cjQ.js +46 -0
  102. package/dist/web/server/assets/{members-DlGBKZNl.js → members-CW5aBe81.js} +1 -1
  103. package/dist/web/server/assets/{members-ksELRsyk.js → members-VdPwD6CE.js} +2 -2
  104. package/dist/web/server/assets/{memory-CO0jKGzJ.js → memory-Dngc13Nw.js} +1 -1
  105. package/dist/web/server/assets/memory-a8Kz57Kh.js +287 -0
  106. package/dist/web/server/assets/{memory-B5moRnnp.js → memory-pZ4pZT7p.js} +2 -2
  107. package/dist/web/server/assets/{policy-Dxs78_GO.js → policy-Bb-vEgqg.js} +1 -1
  108. package/dist/web/server/assets/{policy-Dr55y-Mh.js → policy-BcGELcc9.js} +16 -22
  109. package/dist/web/server/assets/{policy-DNcGZLOB.js → policy-C30AeFIb.js} +2 -2
  110. package/dist/web/server/assets/{router-_izWQUeG.js → router-C5_NjTsP.js} +100 -111
  111. package/dist/web/server/assets/{routes-BSSKp3Rv.js → routes-B6cMLIPk.js} +16 -13
  112. package/dist/web/server/assets/{routes-BrTOoeth.js → routes-BrA-U_Hm.js} +2 -2
  113. package/dist/web/server/assets/{routes-DOj6ljcm.js → routes-C19CMLZt.js} +2 -2
  114. package/dist/web/server/assets/services-B9yBWDX0.js +79 -0
  115. package/dist/web/server/assets/{services-Pv_V88VA.js → services-C4szdhPx.js} +2 -2
  116. package/dist/web/server/assets/{services-DhRiNeq0.js → services-wG8I06oS.js} +1 -1
  117. package/dist/web/server/assets/skills-BZdqiDig.js +358 -0
  118. package/dist/web/server/assets/{skills-l2cyQ3zS.js → skills-C-UgkuCW.js} +2 -2
  119. package/dist/web/server/assets/{skills-CFIWVg32.js → skills-a9VSWHWq.js} +1 -1
  120. package/dist/web/server/assets/{start-DlHq0RaQ.js → start-WH8WzTL_.js} +1 -1
  121. package/dist/web/server/assets/{team-policy-Csvc5EDd.js → team-policy-vPG01onj.js} +3 -3
  122. package/dist/web/server/assets/{teams-B9O-WDH5.js → teams-CpQ0YgWf.js} +38 -34
  123. package/dist/web/server/assets/{teams-35Oprf6e.js → teams-DEpQR2QA.js} +2 -2
  124. package/dist/web/server/assets/{teams-DFkN7ic7.js → teams-DqfrEoH6.js} +1 -1
  125. package/dist/web/server/assets/{teams-B5IF65p2.js → teams-MjqgsmC3.js} +1 -1
  126. package/dist/web/server/assets/{teams-DH1CvWmT.js → teams-OIkHuxy1.js} +2 -2
  127. package/dist/web/server/assets/teams-jBtvnk59.js +193 -0
  128. package/dist/web/server/assets/{telegram-C9sQFwWj.js → telegram-CBF8SJzB.js} +36 -71
  129. package/dist/web/server/assets/{telegram-BdaUIjvs.js → telegram-DNgCWebD.js} +1 -1
  130. package/dist/web/server/assets/{telegram-mTnJCOmn.js → telegram-XwyKSEtj.js} +2 -2
  131. package/dist/web/server/assets/{tokens-DdpnfV_Y.js → tokens-BnwFbV7T.js} +2 -2
  132. package/dist/web/server/assets/{tokens-BCz3PSoT.js → tokens-DPDMSN5O.js} +1 -1
  133. package/dist/web/server/assets/tokens-yyTSfBSN.js +186 -0
  134. package/dist/web/server/assets/{triggers-BcTTwMfy.js → triggers-CBl4yMyw.js} +2 -2
  135. package/dist/web/server/assets/{triggers-BcH_6PW1.js → triggers-D79NoSXk.js} +4 -3
  136. package/dist/web/server/assets/{triggers-BzJG1nN5.js → triggers-_3rdhwSN.js} +31 -6
  137. package/dist/web/server/assets/{welcome-CDGE2Sdk.js → welcome-IYHGurWx.js} +21 -13
  138. package/dist/web/server/server.js +82 -73
  139. package/dist/worker.js +1614 -153
  140. package/dist/worker.js.map +1 -1
  141. package/package.json +5 -3
  142. package/dist/web/client/assets/AgentTabs-DioGqUVR.js +0 -1
  143. package/dist/web/client/assets/ConfigTabs-pY-V0Rie.js +0 -1
  144. package/dist/web/client/assets/FieldRow-DmwAFfbF.js +0 -1
  145. package/dist/web/client/assets/ProductionTeamPolicyEditor-1a5jQqUB.js +0 -7
  146. package/dist/web/client/assets/TeamTabs-BViZ4sti.js +0 -1
  147. package/dist/web/client/assets/TemplatesTabs-DVcY9pMD.js +0 -1
  148. package/dist/web/client/assets/_id-8P7brhGy.js +0 -1
  149. package/dist/web/client/assets/_id-C3o3MHq8.js +0 -1
  150. package/dist/web/client/assets/_id-DGRrSF1e.js +0 -1
  151. package/dist/web/client/assets/_id-KnJe-aW9.js +0 -1
  152. package/dist/web/client/assets/activity-WWvJSo4t.js +0 -1
  153. package/dist/web/client/assets/agents-C32T1voV.js +0 -1
  154. package/dist/web/client/assets/agents-nH4m4gZ1.js +0 -1
  155. package/dist/web/client/assets/approvals-l8jIZjqz.js +0 -1
  156. package/dist/web/client/assets/config-C7wvi1nR.js +0 -3
  157. package/dist/web/client/assets/context-BEGWE3RC.js +0 -1
  158. package/dist/web/client/assets/inbox--4aBaAgG.js +0 -1
  159. package/dist/web/client/assets/index-BCXoh1c8.js +0 -12
  160. package/dist/web/client/assets/login-Bk2wwIHQ.js +0 -1
  161. package/dist/web/client/assets/mcp-vM7xgh9e.js +0 -1
  162. package/dist/web/client/assets/members-cPKfnrSL.js +0 -1
  163. package/dist/web/client/assets/memory-BOcsaemD.js +0 -1
  164. package/dist/web/client/assets/policy-BGLCJYvS.js +0 -1
  165. package/dist/web/client/assets/preload-helper-eOOCz1Fu.js +0 -1
  166. package/dist/web/client/assets/routes-DnrP3dwv.js +0 -1
  167. package/dist/web/client/assets/services-C2_O3ifw.js +0 -1
  168. package/dist/web/client/assets/skills-B__fLZjx.js +0 -1
  169. package/dist/web/client/assets/styles-Dn24-ZvP.css +0 -2
  170. package/dist/web/client/assets/team-policy-BdX340m4.js +0 -1
  171. package/dist/web/client/assets/teams-DZMB4_iw.js +0 -1
  172. package/dist/web/client/assets/teams-rpaYKNIb.js +0 -1
  173. package/dist/web/client/assets/telegram-B1O4Ko0V.js +0 -1
  174. package/dist/web/client/assets/tokens-D7FH9VgA.js +0 -1
  175. package/dist/web/client/assets/triggers-3PLy2_Fo.js +0 -1
  176. package/dist/web/client/assets/welcome-B-QQobzq.js +0 -1
  177. package/dist/web/client/assets/wire-constants-BY9Q9Z7d.js +0 -74
  178. package/dist/web/server/assets/ConfigTabs-CyuxzesF.js +0 -41
  179. package/dist/web/server/assets/agents-DU9Hqs58.js +0 -249
  180. package/dist/web/server/assets/context-CEr4-xiA.js +0 -49
  181. package/dist/web/server/assets/inbox-DU27iHv_.js +0 -133
  182. package/dist/web/server/assets/login-CNznncgA.js +0 -58
  183. package/dist/web/server/assets/login-CQybKk7Y.js +0 -74
  184. package/dist/web/server/assets/members-40DxRdVj.js +0 -48
  185. package/dist/web/server/assets/memory-CiTl4cN9.js +0 -289
  186. package/dist/web/server/assets/services-CHe4ihJk.js +0 -94
  187. package/dist/web/server/assets/skills-D89ND2kR.js +0 -321
  188. package/dist/web/server/assets/teams-zcm9XaQU.js +0 -174
  189. package/dist/web/server/assets/tokens-CkKqrtk-.js +0 -193
@@ -0,0 +1,193 @@
1
+ import { t as Route } from "./teams-DEpQR2QA.js";
2
+ import { a as StatusBadge, i as SectionCard, n as PageHeader, r as PageShell, t as EmptyState } from "./Page-LENulSXY.js";
3
+ import { t as Button } from "./Button-Dsnw22OF.js";
4
+ import { useState } from "react";
5
+ import { useRouter } from "@tanstack/react-router";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/routes/teams/index.tsx?tsr-split=component
8
+ function TeamsPage() {
9
+ const { teams, memberCounts, policies, readiness } = Route.useLoaderData();
10
+ const router = useRouter();
11
+ async function remove(id) {
12
+ if (!confirm("remove this team registration?")) return;
13
+ const revision = policies[id]?.revision;
14
+ if (!revision) return;
15
+ const res = await fetch(`/api/teams/${encodeURIComponent(id)}?expectedTeamPolicyRevision=${revision}`, { method: "DELETE" });
16
+ if (!res.ok && res.status !== 204) {
17
+ alert(res.statusText);
18
+ return;
19
+ }
20
+ await router.invalidate();
21
+ }
22
+ return /* @__PURE__ */ jsxs(PageShell, {
23
+ size: "wide",
24
+ children: [
25
+ /* @__PURE__ */ jsx(PageHeader, {
26
+ eyebrow: "Workspace",
27
+ title: "Teams",
28
+ description: "Each Team owns one workspace, one live membership roster, and one effective communication policy. Every agent belongs to exactly one Team."
29
+ }),
30
+ /* @__PURE__ */ jsx(SectionCard, {
31
+ title: "Policy enforcement",
32
+ description: `Management contract v${readiness.contractVersion} is ready for this daemon.`,
33
+ actions: /* @__PURE__ */ jsx(StatusBadge, {
34
+ variant: readiness.enforcementActive ? "success" : "warning",
35
+ children: readiness.enforcementActive ? "Enforcement on" : "Enforcement off"
36
+ }),
37
+ "aria-label": "Team Policy enforcement readiness",
38
+ children: /* @__PURE__ */ jsx("p", {
39
+ className: "text-sm text-muted-foreground",
40
+ children: readiness.enforcementActive ? "Communication boundaries are currently enforcing each Team policy." : /* @__PURE__ */ jsxs(Fragment, { children: [
41
+ "Set ",
42
+ /* @__PURE__ */ jsx("code", { children: "BAZILION_TEAM_POLICY_ENFORCEMENT=on" }),
43
+ " and restart the daemon to enforce Team policies."
44
+ ] })
45
+ })
46
+ }),
47
+ /* @__PURE__ */ jsx(RegisterTeamForm, { onRegistered: () => router.invalidate() }),
48
+ /* @__PURE__ */ jsx(SectionCard, {
49
+ title: "Registered teams",
50
+ description: "Open a Team to manage its context, members, shared memory, and policy.",
51
+ children: teams.length === 0 ? /* @__PURE__ */ jsx(EmptyState, {
52
+ title: "No teams registered",
53
+ description: "Register a Team above to create a workspace for your agents."
54
+ }) : /* @__PURE__ */ jsx("div", {
55
+ className: "overflow-x-auto",
56
+ children: /* @__PURE__ */ jsxs("table", {
57
+ className: "min-w-[820px]",
58
+ children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
59
+ /* @__PURE__ */ jsx("th", { children: "ID" }),
60
+ /* @__PURE__ */ jsx("th", { children: "Name" }),
61
+ /* @__PURE__ */ jsx("th", { children: "Members" }),
62
+ /* @__PURE__ */ jsx("th", { children: "Policy" }),
63
+ /* @__PURE__ */ jsx("th", { children: "Baseline" }),
64
+ /* @__PURE__ */ jsx("th", { children: /* @__PURE__ */ jsx("span", {
65
+ className: "sr-only",
66
+ children: "Actions"
67
+ }) })
68
+ ] }) }), /* @__PURE__ */ jsx("tbody", { children: teams.map((g) => {
69
+ const count = memberCounts[g.id] ?? 0;
70
+ const policy = policies[g.id];
71
+ return /* @__PURE__ */ jsxs("tr", { children: [
72
+ /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("code", { children: g.id }) }),
73
+ /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("a", {
74
+ href: `/teams/${g.id}`,
75
+ children: g.name
76
+ }) }),
77
+ /* @__PURE__ */ jsx("td", { children: count }),
78
+ /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("a", {
79
+ href: `/teams/${g.id}/policy`,
80
+ children: policy ? `r${policy.revision} · ${policy.edges} edges` : "Unavailable"
81
+ }) }),
82
+ /* @__PURE__ */ jsx("td", { children: policy?.baseline ?? "None" }),
83
+ /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("div", {
84
+ className: "flex justify-end",
85
+ children: count === 0 ? /* @__PURE__ */ jsx(Button, {
86
+ variant: "danger",
87
+ onClick: () => remove(g.id),
88
+ children: "Remove"
89
+ }) : /* @__PURE__ */ jsx(StatusBadge, {
90
+ variant: "neutral",
91
+ title: `${count} agent(s) belong to this Team`,
92
+ children: "In use"
93
+ })
94
+ }) })
95
+ ] }, g.id);
96
+ }) })]
97
+ })
98
+ })
99
+ })
100
+ ]
101
+ });
102
+ }
103
+ function RegisterTeamForm({ onRegistered }) {
104
+ const [id, setId] = useState("");
105
+ const [name, setName] = useState("");
106
+ const [link, setLink] = useState("");
107
+ const [err, setErr] = useState(null);
108
+ const [submitting, setSubmitting] = useState(false);
109
+ async function submit(e) {
110
+ e.preventDefault();
111
+ setErr(null);
112
+ if (!id.trim()) {
113
+ setErr("id is required");
114
+ return;
115
+ }
116
+ setSubmitting(true);
117
+ try {
118
+ const res = await fetch("/api/teams", {
119
+ method: "POST",
120
+ headers: { "content-type": "application/json" },
121
+ body: JSON.stringify({
122
+ id: id.trim(),
123
+ name: name.trim() || void 0,
124
+ link: link.trim() || void 0
125
+ })
126
+ });
127
+ if (!res.ok) {
128
+ const e2 = await res.json().catch(() => null);
129
+ throw new Error(e2?.error ?? res.statusText);
130
+ }
131
+ setId("");
132
+ setName("");
133
+ setLink("");
134
+ onRegistered();
135
+ } catch (e2) {
136
+ setErr(e2.message);
137
+ } finally {
138
+ setSubmitting(false);
139
+ }
140
+ }
141
+ return /* @__PURE__ */ jsx(SectionCard, {
142
+ title: "Register a team",
143
+ description: /* @__PURE__ */ jsxs(Fragment, { children: [
144
+ "Teams live under ",
145
+ /* @__PURE__ */ jsx("code", { children: "~/.bazilion/teams/<slug>/" }),
146
+ ". Link an existing project directory or leave the target blank to create a fresh workspace."
147
+ ] }),
148
+ children: /* @__PURE__ */ jsxs("form", {
149
+ onSubmit: submit,
150
+ children: [
151
+ err && /* @__PURE__ */ jsx("div", {
152
+ className: "err",
153
+ children: err
154
+ }),
155
+ /* @__PURE__ */ jsxs("div", {
156
+ className: "grid gap-4 sm:grid-cols-2",
157
+ children: [
158
+ /* @__PURE__ */ jsxs("label", { children: ["ID (slug)", /* @__PURE__ */ jsx("input", {
159
+ value: id,
160
+ onChange: (e) => setId(e.target.value),
161
+ required: true,
162
+ placeholder: "my-project"
163
+ })] }),
164
+ /* @__PURE__ */ jsxs("label", { children: ["Name", /* @__PURE__ */ jsx("input", {
165
+ value: name,
166
+ onChange: (e) => setName(e.target.value),
167
+ placeholder: "My project"
168
+ })] }),
169
+ /* @__PURE__ */ jsxs("label", {
170
+ className: "sm:col-span-2",
171
+ children: ["Link target (optional, absolute path)", /* @__PURE__ */ jsx("input", {
172
+ value: link,
173
+ onChange: (e) => setLink(e.target.value),
174
+ placeholder: "/home/user/projects/my-project"
175
+ })]
176
+ })
177
+ ]
178
+ }),
179
+ /* @__PURE__ */ jsx("div", {
180
+ className: "mt-4",
181
+ children: /* @__PURE__ */ jsx(Button, {
182
+ variant: "primary",
183
+ type: "submit",
184
+ disabled: submitting,
185
+ children: submitting ? "Registering…" : "Register team"
186
+ })
187
+ })
188
+ ]
189
+ })
190
+ });
191
+ }
192
+ //#endregion
193
+ export { TeamsPage as component };
@@ -1,6 +1,6 @@
1
- import { t as Route } from "./telegram-mTnJCOmn.js";
1
+ import { t as Route } from "./telegram-XwyKSEtj.js";
2
2
  import { t as Button } from "./Button-Dsnw22OF.js";
3
- import { t as ConfigTabs } from "./ConfigTabs-CyuxzesF.js";
3
+ import { t as ConfigPage } from "./ConfigPage-BKlh5vOU.js";
4
4
  import { useEffect, useState } from "react";
5
5
  import { useRouter } from "@tanstack/react-router";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -75,35 +75,22 @@ function TelegramIntegrationPage() {
75
75
  setChecking(false);
76
76
  }
77
77
  }
78
- return /* @__PURE__ */ jsxs("main", {
79
- className: "mx-auto max-w-3xl px-6 py-8",
78
+ return /* @__PURE__ */ jsxs(ConfigPage, {
79
+ active: "integrations",
80
+ title: "Telegram",
81
+ description: "Connect one forum-supergroup bot with one topic per agent, so conversations stay reachable from your phone.",
82
+ size: "narrow",
80
83
  children: [
81
- /* @__PURE__ */ jsx("h1", {
82
- className: "font-serif text-3xl text-foreground mb-2",
83
- children: "config"
84
- }),
85
- /* @__PURE__ */ jsx(ConfigTabs, { active: "integrations" }),
86
- /* @__PURE__ */ jsxs("header", {
87
- className: "mb-6",
88
- children: [/* @__PURE__ */ jsx("h2", {
89
- className: "text-xl font-semibold",
90
- children: "Telegram"
91
- }), /* @__PURE__ */ jsx("p", {
92
- className: "text-muted-foreground text-sm",
93
- children: "One forum-supergroup bot, one topic per agent. Talk to any of your agents from a phone."
94
- })]
95
- }),
96
- /* @__PURE__ */ jsx(Step2Banner, {}),
97
84
  initial.migratedChatId && /* @__PURE__ */ jsx(MigrationBanner, { toChatId: initial.migratedChatId }),
98
85
  /* @__PURE__ */ jsxs("section", {
99
- className: "rounded-lg border bg-card p-5 mb-6",
86
+ className: "rounded-lg border bg-card p-5",
100
87
  children: [
101
88
  /* @__PURE__ */ jsx("h3", {
102
89
  className: "text-sm font-semibold uppercase tracking-wide text-muted-foreground mb-3",
103
90
  children: "Credentials"
104
91
  }),
105
92
  initial.configured && /* @__PURE__ */ jsxs("p", {
106
- className: "text-xs text-emerald-700 mb-3",
93
+ className: "text-xs text-success mb-3",
107
94
  children: [
108
95
  "✓ Stored: ",
109
96
  /* @__PURE__ */ jsx("code", {
@@ -177,7 +164,7 @@ function TelegramIntegrationPage() {
177
164
  ]
178
165
  }),
179
166
  /* @__PURE__ */ jsxs("div", {
180
- className: "flex items-center gap-3 pt-1",
167
+ className: "flex flex-wrap items-center gap-3 pt-1",
181
168
  children: [
182
169
  /* @__PURE__ */ jsx(Button, {
183
170
  variant: "primary",
@@ -191,11 +178,11 @@ function TelegramIntegrationPage() {
191
178
  children: "clear credentials"
192
179
  }),
193
180
  saveOk && /* @__PURE__ */ jsx("span", {
194
- className: "text-xs text-emerald-700",
181
+ className: "text-xs text-success",
195
182
  children: "saved ✓"
196
183
  }),
197
184
  saveError && /* @__PURE__ */ jsxs("span", {
198
- className: "text-xs text-rose-700",
185
+ className: "text-xs text-danger",
199
186
  children: ["error: ", saveError]
200
187
  })
201
188
  ]
@@ -208,7 +195,7 @@ function TelegramIntegrationPage() {
208
195
  className: "rounded-lg border bg-card p-5",
209
196
  children: [
210
197
  /* @__PURE__ */ jsxs("div", {
211
- className: "flex items-center justify-between mb-3",
198
+ className: "mb-3 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
212
199
  children: [/* @__PURE__ */ jsx("h3", {
213
200
  className: "text-sm font-semibold uppercase tracking-wide text-muted-foreground",
214
201
  children: "Preflight checks"
@@ -302,7 +289,7 @@ function AccessControlCard() {
302
289
  }
303
290
  }
304
291
  return /* @__PURE__ */ jsxs("section", {
305
- className: "rounded-lg border bg-card p-5 mt-6",
292
+ className: "rounded-lg border bg-card p-5",
306
293
  children: [
307
294
  /* @__PURE__ */ jsx("h3", {
308
295
  className: "text-sm font-semibold uppercase tracking-wide text-muted-foreground mb-1",
@@ -324,12 +311,12 @@ function AccessControlCard() {
324
311
  className: "text-xs text-muted-foreground italic",
325
312
  children: "loading…"
326
313
  }) : users.length === 0 ? /* @__PURE__ */ jsx("p", {
327
- className: "text-xs text-amber-700 mb-3",
314
+ className: "text-xs text-warning mb-3",
328
315
  children: "Open — no allowlist yet. The first user to message the bot claims owner."
329
316
  }) : /* @__PURE__ */ jsx("ul", {
330
317
  className: "mb-3 space-y-1 text-sm",
331
318
  children: users.map((u) => /* @__PURE__ */ jsxs("li", {
332
- className: "flex items-center gap-2",
319
+ className: "flex flex-wrap items-center gap-2",
333
320
  children: [
334
321
  /* @__PURE__ */ jsx("code", {
335
322
  className: "font-mono",
@@ -346,7 +333,7 @@ function AccessControlCard() {
346
333
  u.role !== "owner" && /* @__PURE__ */ jsx("button", {
347
334
  type: "button",
348
335
  onClick: () => void remove(u.userId),
349
- className: "ghost-btn text-xs text-[#9B3D3D]",
336
+ className: "ghost-btn text-xs text-rose-baziu",
350
337
  children: "remove"
351
338
  })
352
339
  ]
@@ -354,19 +341,19 @@ function AccessControlCard() {
354
341
  }),
355
342
  /* @__PURE__ */ jsxs("form", {
356
343
  onSubmit: add,
357
- className: "flex items-center gap-2",
344
+ className: "flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center",
358
345
  children: [
359
346
  /* @__PURE__ */ jsx("input", {
360
347
  value: userId,
361
348
  onChange: (e) => setUserId(e.target.value),
362
349
  placeholder: "user id",
363
- className: "w-28 rounded-md border bg-background px-2 py-1 font-mono text-sm"
350
+ className: "w-full rounded-md border bg-background px-2 py-1 font-mono text-sm sm:w-28"
364
351
  }),
365
352
  /* @__PURE__ */ jsx("input", {
366
353
  value: label,
367
354
  onChange: (e) => setLabel(e.target.value),
368
355
  placeholder: "label (optional)",
369
- className: "w-40 rounded-md border bg-background px-2 py-1 text-sm"
356
+ className: "w-full rounded-md border bg-background px-2 py-1 text-sm sm:w-40"
370
357
  }),
371
358
  /* @__PURE__ */ jsx(Button, {
372
359
  variant: "ghost",
@@ -375,7 +362,7 @@ function AccessControlCard() {
375
362
  children: "add"
376
363
  }),
377
364
  err && /* @__PURE__ */ jsx("span", {
378
- className: "text-xs text-rose-700",
365
+ className: "text-xs text-danger",
379
366
  children: err
380
367
  })
381
368
  ]
@@ -402,14 +389,14 @@ function MigrationBanner({ toChatId }) {
402
389
  }
403
390
  }
404
391
  return /* @__PURE__ */ jsxs("div", {
405
- className: "rounded-md border-2 border-rose-400 bg-rose-50 px-4 py-3 mb-6 text-sm",
392
+ className: "rounded-md border-2 border-danger/25 bg-danger/10 px-4 py-3 text-sm",
406
393
  children: [
407
394
  /* @__PURE__ */ jsx("div", {
408
- className: "font-semibold text-rose-900 mb-1",
395
+ className: "font-semibold text-danger mb-1",
409
396
  children: "Supergroup chat id changed"
410
397
  }),
411
398
  /* @__PURE__ */ jsxs("p", {
412
- className: "text-rose-900 mb-2",
399
+ className: "text-danger mb-2",
413
400
  children: [
414
401
  "Telegram migrated this supergroup to a new chat id (",
415
402
  /* @__PURE__ */ jsx("code", {
@@ -432,34 +419,12 @@ function MigrationBanner({ toChatId }) {
432
419
  children: busy ? "reconnecting…" : `Reconnect to ${toChatId}`
433
420
  }),
434
421
  err && /* @__PURE__ */ jsx("span", {
435
- className: "ml-3 text-xs text-rose-700",
422
+ className: "ml-3 text-xs text-danger",
436
423
  children: err
437
424
  })
438
425
  ]
439
426
  });
440
427
  }
441
- function Step2Banner() {
442
- return /* @__PURE__ */ jsxs("div", {
443
- className: "rounded-md border-2 border-amber-400 bg-amber-50 px-4 py-3 mb-6 text-sm",
444
- children: [/* @__PURE__ */ jsx("div", {
445
- className: "font-semibold text-amber-900 mb-1",
446
- children: "Step 2 of the rollout"
447
- }), /* @__PURE__ */ jsxs("p", {
448
- className: "text-amber-900",
449
- children: [
450
- "The bot polls Telegram and creates the ",
451
- /* @__PURE__ */ jsx("code", {
452
- className: "font-mono",
453
- children: "⚙ bazilion"
454
- }),
455
- " ",
456
- "service chat on first start. Inbound messages are logged but not yet routed to agents —",
457
- " ",
458
- "slash commands and per-agent topics ship in the next release. Outbound from agents ships after that."
459
- ]
460
- })]
461
- });
462
- }
463
428
  function PollingState({ polling }) {
464
429
  const startedAt = polling.startedAt ? new Date(polling.startedAt).toISOString() : null;
465
430
  const lastPoll = polling.lastSuccessfulPollAt ? new Date(polling.lastSuccessfulPollAt).toISOString() : null;
@@ -474,11 +439,11 @@ function PollingState({ polling }) {
474
439
  className: "flex flex-wrap gap-x-4 gap-y-1 font-mono",
475
440
  children: [
476
441
  /* @__PURE__ */ jsx("span", {
477
- className: polling.running ? "text-emerald-700" : "text-rose-700",
442
+ className: polling.running ? "text-success" : "text-danger",
478
443
  children: polling.running ? "running" : "stopped"
479
444
  }),
480
445
  /* @__PURE__ */ jsx("span", {
481
- className: polling.activated ? "text-emerald-700" : "text-amber-700",
446
+ className: polling.activated ? "text-success" : "text-warning",
482
447
  children: polling.activated ? "activated" : "awaiting activation"
483
448
  }),
484
449
  polling.lastUpdateId !== null && /* @__PURE__ */ jsxs("span", { children: ["last update ", polling.lastUpdateId] }),
@@ -487,7 +452,7 @@ function PollingState({ polling }) {
487
452
  ]
488
453
  }),
489
454
  polling.error && /* @__PURE__ */ jsxs("p", {
490
- className: "text-rose-700",
455
+ className: "text-danger",
491
456
  children: ["error: ", polling.error]
492
457
  })
493
458
  ]
@@ -495,17 +460,17 @@ function PollingState({ polling }) {
495
460
  }
496
461
  function PreflightResult({ health }) {
497
462
  if (health.error) return /* @__PURE__ */ jsxs("div", {
498
- className: "rounded-md border border-rose-300 bg-rose-50 px-3 py-2 text-sm",
463
+ className: "rounded-md border border-danger/25 bg-danger/10 px-3 py-2 text-sm",
499
464
  children: [
500
465
  /* @__PURE__ */ jsxs("p", {
501
- className: "font-semibold text-rose-900",
466
+ className: "font-semibold text-danger",
502
467
  children: ["Failed at ", /* @__PURE__ */ jsx("code", {
503
468
  className: "font-mono",
504
469
  children: health.error.step
505
470
  })]
506
471
  }),
507
472
  /* @__PURE__ */ jsx("p", {
508
- className: "text-rose-900 mt-1",
473
+ className: "text-danger mt-1",
509
474
  children: health.error.message
510
475
  }),
511
476
  hintFor(health.error.step)
@@ -551,14 +516,14 @@ function Check({ ok, label, children }) {
551
516
  return /* @__PURE__ */ jsxs("li", {
552
517
  className: "flex items-start gap-2 text-sm",
553
518
  children: [/* @__PURE__ */ jsx("span", {
554
- className: `mt-0.5 inline-flex h-4 w-4 items-center justify-center rounded-full text-[10px] font-bold leading-none ${ok ? "bg-emerald-100 text-emerald-800" : "bg-rose-100 text-rose-800"}`,
519
+ className: `mt-0.5 inline-flex h-4 w-4 items-center justify-center rounded-full text-[10px] font-bold leading-none ${ok ? "bg-success/10 text-success" : "bg-danger/10 text-danger"}`,
555
520
  "aria-hidden": true,
556
521
  children: ok ? "✓" : "✕"
557
522
  }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("span", {
558
523
  className: "font-medium",
559
524
  children: label
560
525
  }), /* @__PURE__ */ jsx("span", {
561
- className: `ml-2 text-xs ${ok ? "text-muted-foreground" : "text-rose-800"}`,
526
+ className: `ml-2 text-xs ${ok ? "text-muted-foreground" : "text-danger"}`,
562
527
  children
563
528
  })] })]
564
529
  });
@@ -566,15 +531,15 @@ function Check({ ok, label, children }) {
566
531
  function hintFor(step) {
567
532
  switch (step) {
568
533
  case "getMe": return /* @__PURE__ */ jsx("p", {
569
- className: "text-xs text-rose-900 mt-1",
534
+ className: "text-xs text-danger mt-1",
570
535
  children: "The token is invalid or revoked. Re-issue with @BotFather → /token, or paste a fresh one above."
571
536
  });
572
537
  case "getChat": return /* @__PURE__ */ jsx("p", {
573
- className: "text-xs text-rose-900 mt-1",
538
+ className: "text-xs text-danger mt-1",
574
539
  children: "The chat id either doesn't exist, points at a basic team (not a supergroup), or the bot isn't a member. Forward any message from the supergroup to the bot to double-check the id, then add the bot to the team."
575
540
  });
576
541
  case "getChatMember": return /* @__PURE__ */ jsx("p", {
577
- className: "text-xs text-rose-900 mt-1",
542
+ className: "text-xs text-danger mt-1",
578
543
  children: "The bot is in the chat but the membership lookup failed. Usually means the bot was kicked or the chat id was migrated — confirm the bot is still in the supergroup."
579
544
  });
580
545
  }
@@ -1,5 +1,5 @@
1
1
  import { t as createServerFn } from "../server.js";
2
- import { t as createServerRpc } from "./createServerRpc-CeKECg65.js";
2
+ import { t as createServerRpc } from "./createServerRpc-pU-IQV2Y.js";
3
3
  import { n as daemonClient } from "./daemon-client-2NRMzlTr.js";
4
4
  //#region src/routes/config/integrations/telegram.tsx?tss-serverfn-split
5
5
  var fetchTelegramConfig_createServerFn_handler = createServerRpc({
@@ -1,8 +1,8 @@
1
1
  import { t as createServerFn } from "../server.js";
2
- import { t as createSsrRpc } from "./createSsrRpc-ZBGxhl8t.js";
2
+ import { t as createSsrRpc } from "./createSsrRpc-DFsIAfFd.js";
3
3
  import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
4
4
  //#region src/routes/config/integrations/telegram.tsx
5
- var $$splitComponentImporter = () => import("./telegram-C9sQFwWj.js");
5
+ var $$splitComponentImporter = () => import("./telegram-CBF8SJzB.js");
6
6
  var fetchTelegramConfig = createServerFn({ method: "GET" }).handler(createSsrRpc("00a157dd07824e1f126f06646effd1d876f280f6fc64c144d2f6429414a4e58a"));
7
7
  var Route = createFileRoute("/config/integrations/telegram")({
8
8
  loader: () => fetchTelegramConfig(),
@@ -1,8 +1,8 @@
1
1
  import { t as createServerFn } from "../server.js";
2
- import { t as createSsrRpc } from "./createSsrRpc-ZBGxhl8t.js";
2
+ import { t as createSsrRpc } from "./createSsrRpc-DFsIAfFd.js";
3
3
  import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
4
4
  //#region src/routes/config/tokens.tsx
5
- var $$splitComponentImporter = () => import("./tokens-CkKqrtk-.js");
5
+ var $$splitComponentImporter = () => import("./tokens-yyTSfBSN.js");
6
6
  var fetchTokens = createServerFn({ method: "POST" }).inputValidator((d) => d).handler(createSsrRpc("46e35c9f1afc79423cb49703b454ef684344db08ec19775efd70a8768c7837f1"));
7
7
  var Route = createFileRoute("/config/tokens")({
8
8
  validateSearch: (s) => ({ all: s.all === "1" ? "1" : void 0 }),
@@ -1,5 +1,5 @@
1
1
  import { t as createServerFn } from "../server.js";
2
- import { t as createServerRpc } from "./createServerRpc-CeKECg65.js";
2
+ import { t as createServerRpc } from "./createServerRpc-pU-IQV2Y.js";
3
3
  import { n as daemonClient } from "./daemon-client-2NRMzlTr.js";
4
4
  //#region src/routes/config/tokens.tsx?tss-serverfn-split
5
5
  var fetchTokens_createServerFn_handler = createServerRpc({