bazilion 0.52.0 → 0.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/dist/cli.js +3 -3
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +296 -232
  4. package/dist/daemon.js.map +1 -1
  5. package/dist/web/client/assets/AddProviderDialog-CkwSq3C7.js +1 -0
  6. package/dist/web/client/assets/AgentTemplateParts-CEn_4qVs.js +1 -0
  7. package/dist/web/client/assets/Button-UiegBKOK.js +1 -0
  8. package/dist/web/client/assets/ConfigPage-CUbHBhzx.js +1 -0
  9. package/dist/web/client/assets/ConfirmDialog-VqBOFZEp.js +1 -0
  10. package/dist/web/client/assets/ConnectionsView-ByARMcWP.js +1 -0
  11. package/dist/web/client/assets/ManagePage-BJWZd1ts.js +1 -0
  12. package/dist/web/client/assets/SectionTabs-ViZKm3-B.js +1 -0
  13. package/dist/web/client/assets/Segmented-MYKKTuZO.js +1 -0
  14. package/dist/web/client/assets/SkillsParts-UvNK5SYP.js +1 -0
  15. package/dist/web/client/assets/SpawnTeamModal-DG5UbJNK.js +1 -0
  16. package/dist/web/client/assets/TeamForm-DGlxWv4e.js +1 -0
  17. package/dist/web/client/assets/TeamThread-mkwODO0S.js +1 -0
  18. package/dist/web/client/assets/UnsavedChangesGuard-BmdwLH99.js +1 -0
  19. package/dist/web/client/assets/_id-CvcxNmBH.js +1 -0
  20. package/dist/web/client/assets/_id-UyBk7gRl.js +1 -0
  21. package/dist/web/client/assets/access-C8d8vaQ6.js +1 -0
  22. package/dist/web/client/assets/agent-actions-BgE9fKHH.js +1 -0
  23. package/dist/web/client/assets/agents-CgtzqBpD.js +1 -0
  24. package/dist/web/client/assets/agents-D7W4BT8r.js +1 -0
  25. package/dist/web/client/assets/arrow-right-D0HKRb7U.js +1 -0
  26. package/dist/web/client/assets/attention-D9mQWoKt.js +1 -0
  27. package/dist/web/client/assets/bot-Bb--PFVU.js +1 -0
  28. package/dist/web/client/assets/chevron-right-bs0TUSl2.js +1 -0
  29. package/dist/web/client/assets/config-Dw6GWf38.js +1 -0
  30. package/dist/web/client/assets/createLucideIcon-DkniuEtD.js +1 -0
  31. package/dist/web/client/assets/download-C4t9l5wR.js +1 -0
  32. package/dist/web/client/assets/file-text-DzbjpYrV.js +1 -0
  33. package/dist/web/client/assets/images-DSYgPKM7.js +1 -0
  34. package/dist/web/client/assets/index-YW0gXPfk.js +14 -0
  35. package/dist/web/client/assets/key-round-BpK4-E3T.js +1 -0
  36. package/dist/web/client/assets/list-checks-JNXcmws9.js +1 -0
  37. package/dist/web/client/assets/login-DcQJk5-U.js +1 -0
  38. package/dist/web/client/assets/manage-SRGSx8n2.js +1 -0
  39. package/dist/web/client/assets/mcp-BUWu4TvS.js +1 -0
  40. package/dist/web/client/assets/message-square-DM2MP9vF.js +1 -0
  41. package/dist/web/client/assets/network-BJ4iPjQO.js +1 -0
  42. package/dist/web/client/assets/parts-LZxl9Gvc.js +41 -0
  43. package/dist/web/client/assets/plus-CLGNN5QX.js +1 -0
  44. package/dist/web/client/assets/routes-BxIIyGho.js +85 -0
  45. package/dist/web/client/assets/skills-C7DzIwFJ.js +1 -0
  46. package/dist/web/client/assets/square-terminal-Dmm6cV-G.js +1 -0
  47. package/dist/web/client/assets/style-CA2GAk9b.js +7 -0
  48. package/dist/web/client/assets/styles-C3CDSGAr.css +2 -0
  49. package/dist/web/client/assets/system-zQ0NnQML.js +1 -0
  50. package/dist/web/client/assets/teams-BEIJHObN.js +1 -0
  51. package/dist/web/client/assets/teams-DlOc7Ods.js +1 -0
  52. package/dist/web/client/assets/telegram-DKHq5DpE.js +1 -0
  53. package/dist/web/client/assets/tools-BKIpLaiC.js +1 -0
  54. package/dist/web/client/assets/use-resource-CQaIZbpy.js +1 -0
  55. package/dist/web/client/assets/users-round-BJrym3FG.js +1 -0
  56. package/dist/web/client/assets/welcome-CyS4Hrd-.js +1 -0
  57. package/dist/web/client/assets/wrench-GbE1M1RJ.js +1 -0
  58. package/dist/web/server/assets/{AddProviderDialog-Tn4AskPm.js → AddProviderDialog-Nc5mc_P6.js} +106 -8
  59. package/dist/web/server/assets/AgentTemplateParts-DZK_r3nQ.js +266 -0
  60. package/dist/web/server/assets/{ConfigPage-DqDUujmt.js → ConfigPage-CxzL-gTm.js} +2 -2
  61. package/dist/web/server/assets/{ConfirmDialog-DfaJ--A6.js → ConfirmDialog-4xeCXKHe.js} +1 -2
  62. package/dist/web/server/assets/{ConnectionsView-DAG-zNBz.js → ConnectionsView-B02FjNsM.js} +9 -9
  63. package/dist/web/server/assets/ManagePage-BfCWE8Lj.js +29 -0
  64. package/dist/web/server/assets/ModelMenu-D-hTgYOO.js +278 -0
  65. package/dist/web/server/assets/{Rail-BIC_4ptO.js → Rail-3gbidhyv.js} +17 -110
  66. package/dist/web/server/assets/{SectionTabs-BGsrf-UQ.js → SectionTabs-CWQ5orUW.js} +9 -2
  67. package/dist/web/server/assets/SkillsParts-D58l8voo.js +199 -0
  68. package/dist/web/server/assets/SpawnDialog-MJWwppgC.js +1648 -0
  69. package/dist/web/server/assets/SpawnTeamModal-RjzAeX_Q.js +124 -0
  70. package/dist/web/server/assets/TeamForm-DdOgIMiV.js +138 -0
  71. package/dist/web/server/assets/{TeamThread-DuLlGDcw.js → TeamThread-D-PvO3fu.js} +9 -9
  72. package/dist/web/server/assets/{UnsavedChangesGuard-DrOvPV14.js → UnsavedChangesGuard-Bb5frygQ.js} +1 -1
  73. package/dist/web/server/assets/{_id-TVruGcOd.js → _id-BKzOw78O.js} +11 -3
  74. package/dist/web/server/assets/_id-BPjVkcNb.js +396 -0
  75. package/dist/web/server/assets/_id-BUfy-GwH.js +16 -0
  76. package/dist/web/server/assets/{_id-yN0z7VqE.js → _id-C1_l6oSR.js} +257 -207
  77. package/dist/web/server/assets/{_id-DJnYgisy.js → _id-CHvYQhWt.js} +8 -4
  78. package/dist/web/server/assets/_id-De3Bm0SG.js +39 -0
  79. package/dist/web/server/assets/_tanstack-start-manifest_v-CR3jm1nY.js +256 -0
  80. package/dist/web/server/assets/access-CNfvQ3NB.js +295 -0
  81. package/dist/web/server/assets/{access-GMGed5O8.js → access-Cm_izIIC.js} +2 -2
  82. package/dist/web/server/assets/{access-C_pupPks.js → access-WWspT0v4.js} +2 -1
  83. package/dist/web/server/assets/agent-actions-COnfW5AU.js +20 -0
  84. package/dist/web/server/assets/agents-C7UmTjfO.js +13 -0
  85. package/dist/web/server/assets/{agents-BnWgFo6o.js → agents-CRtMfKqX.js} +9 -6
  86. package/dist/web/server/assets/agents-D0hfGIMK.js +134 -0
  87. package/dist/web/server/assets/agents-DQowl6Ly.js +31 -0
  88. package/dist/web/server/assets/agents-DzpqlIuJ.js +12 -0
  89. package/dist/web/server/assets/agents-NOkh61dV.js +323 -0
  90. package/dist/web/server/assets/attention-CRvxt22X.js +232 -0
  91. package/dist/web/server/assets/{attention-Cr7puThv.js → attention-CgWhXjX7.js} +4 -1
  92. package/dist/web/server/assets/{attention-DS3O9UmJ.js → attention-Cx9ZWPOO.js} +4 -2
  93. package/dist/web/server/assets/{config-DjTGA4iZ.js → config-B5CS8juO.js} +2 -2
  94. package/dist/web/server/assets/{config-Q7livfa3.js → config-D117117T.js} +51 -102
  95. package/dist/web/server/assets/createSsrRpc-CwTd0zrB.js +72 -0
  96. package/dist/web/server/assets/{login-VV10kZBl.js → login-IF0Gbsuq.js} +36 -2
  97. package/dist/web/server/assets/{login-JoIjlcmu.js → login-va4EtvA8.js} +34 -45
  98. package/dist/web/server/assets/manage-Ce6cI4eW.js +240 -0
  99. package/dist/web/server/assets/{mcp-ZARSOxZW.js → mcp-Bm9U6x7N.js} +2 -2
  100. package/dist/web/server/assets/mcp-C96PBxpb.js +376 -0
  101. package/dist/web/server/assets/page-title-CwcbXMhx.js +95 -0
  102. package/dist/web/server/assets/{router-Dh2-IvLL.js → router-8Iq19GOz.js} +366 -203
  103. package/dist/web/server/assets/{routes-C9NawqcV.js → routes-BLo-fWbQ.js} +2681 -1667
  104. package/dist/web/server/assets/{routes-CDskMy5C.js → routes-BXvYYFrN.js} +2 -2
  105. package/dist/web/server/assets/routes-Kwam6JmS.js +89 -0
  106. package/dist/web/server/assets/{skills-StN15QhC.js → skills-BqCnA-74.js} +2 -2
  107. package/dist/web/server/assets/skills-DSezIdDc.js +157 -0
  108. package/dist/web/server/assets/{skills-h5aHa7Q8.js → skills-DWzlT_hC.js} +9 -1
  109. package/dist/web/server/assets/{style-GYDODk2F.js → style-C2hIPY_Y.js} +2 -2
  110. package/dist/web/server/assets/{system-Dl-1RhoP.js → system-CcLCmkIC.js} +2 -2
  111. package/dist/web/server/assets/{system-DtswhLW6.js → system-D3th6n2E.js} +4 -2
  112. package/dist/web/server/assets/system-E0VePdzO.js +145 -0
  113. package/dist/web/server/assets/{teams-BxnvFTyn.js → teams-70u1XQTr.js} +1 -3
  114. package/dist/web/server/assets/{teams-YrmyutM4.js → teams-BopOP4x7.js} +8 -1
  115. package/dist/web/server/assets/teams-CQVV18D3.js +216 -0
  116. package/dist/web/server/assets/teams-CdCmBJIj.js +174 -0
  117. package/dist/web/server/assets/{teams-5PMGvHuM.js → teams-DScFp8mK.js} +2 -2
  118. package/dist/web/server/assets/{teams-CbIPKf99.js → teams-DxA-vnzY.js} +4 -2
  119. package/dist/web/server/assets/telegram-DJ8s_91Y.js +1057 -0
  120. package/dist/web/server/assets/{telegram-Cv0D4gyz.js → telegram-DR7xijeS.js} +2 -2
  121. package/dist/web/server/assets/{tools-ioJcPzMW.js → tools-CsH9DI-4.js} +2 -2
  122. package/dist/web/server/assets/{tools-OfD22R-C.js → tools-V6kezUpL.js} +55 -218
  123. package/dist/web/server/assets/{use-resource-DVzK0toP.js → use-resource-CjcJwn7F.js} +1 -1
  124. package/dist/web/server/assets/{welcome-jxmpE_Jb.js → welcome-BpmcD-ia.js} +2 -2
  125. package/dist/web/server/assets/{welcome-FFEbrNT1.js → welcome-Ya8TkL4v.js} +10 -10
  126. package/dist/web/server/server.js +19 -19
  127. package/dist/worker.js +17 -0
  128. package/dist/worker.js.map +1 -1
  129. package/package.json +1 -1
  130. package/dist/web/client/assets/AddProviderDialog-BiGLKnu2.js +0 -1
  131. package/dist/web/client/assets/ConfigPage-DvBzy2MN.js +0 -1
  132. package/dist/web/client/assets/ConfirmDialog-CiZ5tk9R.js +0 -1
  133. package/dist/web/client/assets/ConnectionsView-Czkpm2JY.js +0 -1
  134. package/dist/web/client/assets/Dialog-s_kPtI-W.js +0 -1
  135. package/dist/web/client/assets/ModelMenu-BfUPoRjV.js +0 -1
  136. package/dist/web/client/assets/SectionTabs-DENNb6Nw.js +0 -1
  137. package/dist/web/client/assets/Segmented-Dh77vmpp.js +0 -1
  138. package/dist/web/client/assets/SkillFindings-Xng11qqx.js +0 -1
  139. package/dist/web/client/assets/SkillsPicker-hI3YXvib.js +0 -1
  140. package/dist/web/client/assets/SpawnDialog-CKWFQ6jk.js +0 -1
  141. package/dist/web/client/assets/Tabs-f6bHvCGn.js +0 -1
  142. package/dist/web/client/assets/TeamForm-kda1HYZG.js +0 -1
  143. package/dist/web/client/assets/TeamThread-2rm1JGSk.js +0 -1
  144. package/dist/web/client/assets/UnsavedChangesGuard-nx6dv2Yw.js +0 -1
  145. package/dist/web/client/assets/_id-B72mIpcE.js +0 -1
  146. package/dist/web/client/assets/_id-Bzavnza1.js +0 -1
  147. package/dist/web/client/assets/access-Yw9jODuk.js +0 -1
  148. package/dist/web/client/assets/agents-C9xoyL7o.js +0 -1
  149. package/dist/web/client/assets/agents-TviG16wx.js +0 -1
  150. package/dist/web/client/assets/api-HC_YzjBy.js +0 -1
  151. package/dist/web/client/assets/arrow-right-Gm_FDWJ_.js +0 -1
  152. package/dist/web/client/assets/attention-DmURtlJm.js +0 -1
  153. package/dist/web/client/assets/check-BjgKoGvU.js +0 -1
  154. package/dist/web/client/assets/chevron-right-CUZiA2aG.js +0 -1
  155. package/dist/web/client/assets/config-UZz_mjO5.js +0 -1
  156. package/dist/web/client/assets/createLucideIcon-C6gOo8sD.js +0 -1
  157. package/dist/web/client/assets/dist-BWppw70N.js +0 -41
  158. package/dist/web/client/assets/dist-D2dwY7MR.js +0 -1
  159. package/dist/web/client/assets/entities-xVoB-p2j.js +0 -1
  160. package/dist/web/client/assets/index-Df1oUtAP.js +0 -14
  161. package/dist/web/client/assets/link-Cbztlp_R.js +0 -1
  162. package/dist/web/client/assets/login-CPfdaqsV.js +0 -1
  163. package/dist/web/client/assets/mcp-FlYnNon0.js +0 -1
  164. package/dist/web/client/assets/model-facts-DoB6QD5y.js +0 -1
  165. package/dist/web/client/assets/parts-tIDBNsYA.js +0 -1
  166. package/dist/web/client/assets/plus-CWrKMtvA.js +0 -1
  167. package/dist/web/client/assets/routes-BZaWCoQj.js +0 -76
  168. package/dist/web/client/assets/save-f9O-CQia.js +0 -1
  169. package/dist/web/client/assets/skills-C7yDPC8s.js +0 -1
  170. package/dist/web/client/assets/style-DDuTFJUu.js +0 -7
  171. package/dist/web/client/assets/styles-BviXU81u.css +0 -2
  172. package/dist/web/client/assets/system-CL3Kz36L.js +0 -1
  173. package/dist/web/client/assets/teams-CQTEF5gV.js +0 -1
  174. package/dist/web/client/assets/teams-DQ7SqVyF.js +0 -1
  175. package/dist/web/client/assets/telegram-BLgxtGhZ.js +0 -1
  176. package/dist/web/client/assets/tools-pOQyGVYo.js +0 -1
  177. package/dist/web/client/assets/use-resource-C3MBZJop.js +0 -1
  178. package/dist/web/client/assets/welcome-Hr6JpMef.js +0 -1
  179. package/dist/web/client/assets/wrench-6BEIqKDn.js +0 -1
  180. package/dist/web/server/assets/Dialog-aup_yJv5.js +0 -85
  181. package/dist/web/server/assets/ModelMenu-DUY9aHkE.js +0 -138
  182. package/dist/web/server/assets/SkillFindings-BdATze1A.js +0 -46
  183. package/dist/web/server/assets/SkillsPicker-DlqEfRWh.js +0 -67
  184. package/dist/web/server/assets/SpawnDialog-D_SMPCG_.js +0 -132
  185. package/dist/web/server/assets/Tabs-BhF41MfQ.js +0 -20
  186. package/dist/web/server/assets/TeamForm-ilBaeLI4.js +0 -96
  187. package/dist/web/server/assets/_id-BsZcsabI.js +0 -383
  188. package/dist/web/server/assets/_id-D8Kj0F30.js +0 -18
  189. package/dist/web/server/assets/_id-QYifTM9w.js +0 -28
  190. package/dist/web/server/assets/_tanstack-start-manifest_v-D6zrzUC7.js +0 -223
  191. package/dist/web/server/assets/access-DKOpcHIJ.js +0 -232
  192. package/dist/web/server/assets/agents-B6OR3x99.js +0 -327
  193. package/dist/web/server/assets/agents-B7642eRO.js +0 -130
  194. package/dist/web/server/assets/agents-BJ-_oC2e.js +0 -14
  195. package/dist/web/server/assets/agents-CjV0w-Zy.js +0 -12
  196. package/dist/web/server/assets/agents-Dy_Q-9lG.js +0 -27
  197. package/dist/web/server/assets/attention-CLP4HYBz.js +0 -216
  198. package/dist/web/server/assets/createSsrRpc-GCCF14VW.js +0 -169
  199. package/dist/web/server/assets/entities-Dn2xzKIw.js +0 -16
  200. package/dist/web/server/assets/mcp-BI-FD-JI.js +0 -250
  201. package/dist/web/server/assets/model-facts-mrfrWQne.js +0 -136
  202. package/dist/web/server/assets/parts-B31PJkhi.js +0 -190
  203. package/dist/web/server/assets/routes-BJIJWCIE.js +0 -16
  204. package/dist/web/server/assets/skills-BqLq3ZXq.js +0 -275
  205. package/dist/web/server/assets/system-BtRA2HUs.js +0 -138
  206. package/dist/web/server/assets/teams-COaU0wN9.js +0 -108
  207. package/dist/web/server/assets/teams-Ca8W4mvl.js +0 -88
  208. package/dist/web/server/assets/telegram-Yx8nm6Ei.js +0 -984
  209. package/dist/web/server/assets/utils-C_uf36nf.js +0 -8
  210. package/dist/web/server/assets/workspace-DaitCM0t.js +0 -651
@@ -1,13 +1,16 @@
1
- import { C as api, T as errorMessage, u as Button } from "./workspace-DaitCM0t.js";
2
- import { a as endpointLabel, d as templateDocument, f as templateInput, i as edgeKey, l as sameDocument, n as OUTSIDE, o as hasEdge, r as defaultPosition, t as TeamPolicyMatrix, u as setEdge } from "./style-GYDODk2F.js";
3
- import { t as ConfirmDialog } from "./ConfirmDialog-DfaJ--A6.js";
4
- import { t as UnsavedChangesGuard } from "./UnsavedChangesGuard-DrOvPV14.js";
5
- import { o as PageShell } from "./createSsrRpc-GCCF14VW.js";
6
- import { t as Route } from "./_id-DJnYgisy.js";
7
- import { n as SectionTabs, r as TEMPLATE_TABS } from "./SectionTabs-BGsrf-UQ.js";
1
+ import { A as RowMenu, K as Button, c as SelectField, dt as errorMessage, f as TextField, k as Notice, lt as api, u as SwitchRow } from "./SpawnDialog-MJWwppgC.js";
2
+ import { a as endpointLabel, d as templateDocument, f as templateInput, i as edgeKey, l as sameDocument, n as OUTSIDE, o as hasEdge, r as defaultPosition, t as TeamPolicyMatrix, u as setEdge } from "./style-C2hIPY_Y.js";
3
+ import { t as ConfirmDialog } from "./ConfirmDialog-4xeCXKHe.js";
4
+ import { t as Segmented } from "./Segmented-3ZLdqa5U.js";
5
+ import { t as UnsavedChangesGuard } from "./UnsavedChangesGuard-Bb5frygQ.js";
6
+ import { s as count } from "./manage-Ce6cI4eW.js";
7
+ import { t as SpawnTeamModal } from "./SpawnTeamModal-RjzAeX_Q.js";
8
+ import { t as Route } from "./_id-CHvYQhWt.js";
9
+ import { t as ManagePage } from "./ManagePage-BfCWE8Lj.js";
8
10
  import { useEffect, useMemo, useState } from "react";
11
+ import { useNavigate, useRouter } from "@tanstack/react-router";
9
12
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
- import { Bot, CircleAlert, Globe2, ListTree, Plus, Save, ShieldAlert, TableProperties, X } from "lucide-react";
13
+ import { Bot, CircleAlert, Globe2, Plus, ShieldAlert } from "lucide-react";
11
14
  import { Background, BackgroundVariant, Controls, Handle, MarkerType, MiniMap, Position, ReactFlow, useNodesState } from "@xyflow/react";
12
15
  //#region src/components/team-policy/TeamPolicyFlow.tsx
13
16
  function AgentNode({ data, selected }) {
@@ -35,17 +38,17 @@ function AgentNode({ data, selected }) {
35
38
  className: "block truncate text-sm font-semibold text-chocolate",
36
39
  children: data.member.name
37
40
  }), /* @__PURE__ */ jsx("span", {
38
- className: "mt-0.5 flex items-center gap-1.5 truncate text-[0.68rem] text-mocha-light",
39
- children: "slot"
41
+ className: "mt-0.5 flex items-center gap-1.5 truncate text-xs text-mocha-light",
42
+ children: data.subtitle
40
43
  })]
41
44
  }),
42
45
  data.isolated && /* @__PURE__ */ jsx(ShieldAlert, {
43
46
  className: "h-4 w-4 flex-none text-[#a56568]",
44
- "aria-label": "No allow edges"
47
+ "aria-label": "No connections"
45
48
  }),
46
49
  data.incomplete && /* @__PURE__ */ jsx(CircleAlert, {
47
50
  className: "h-4 w-4 flex-none text-warning",
48
- "aria-label": "Incomplete slot"
51
+ "aria-label": "No template"
49
52
  })
50
53
  ]
51
54
  }),
@@ -88,7 +91,8 @@ var NODE_TYPES = {
88
91
  agent: AgentNode,
89
92
  outside: OutsideNode
90
93
  };
91
- function TeamPolicyFlow({ document, selectedId, incompleteKeys, onSelect, onConnect, onRemoveEdge, onMoveMember, onOpenMember }) {
94
+ var NO_NAMES = {};
95
+ function TeamPolicyFlow({ document, selectedId, incompleteKeys, templateNames = NO_NAMES, onSelect, onConnect, onRemoveEdge, onMoveMember, onOpenMember }) {
92
96
  const computedNodes = useMemo(() => {
93
97
  return [{
94
98
  id: OUTSIDE,
@@ -111,10 +115,11 @@ function TeamPolicyFlow({ document, selectedId, incompleteKeys, onSelect, onConn
111
115
  position: member.position,
112
116
  data: {
113
117
  member,
118
+ subtitle: templateNames[member.profileId] ?? "No template",
114
119
  isolated,
115
120
  incomplete
116
121
  },
117
- ariaLabel: `${member.name}${isolated ? ", no allow edges" : ""}${incomplete ? ", incomplete" : ""}`,
122
+ ariaLabel: `${member.name}${isolated ? ", no connections" : ""}${incomplete ? ", no template" : ""}`,
118
123
  selected: selectedId === member.key,
119
124
  deletable: false
120
125
  };
@@ -122,7 +127,8 @@ function TeamPolicyFlow({ document, selectedId, incompleteKeys, onSelect, onConn
122
127
  }, [
123
128
  document,
124
129
  incompleteKeys,
125
- selectedId
130
+ selectedId,
131
+ templateNames
126
132
  ]);
127
133
  const [nodes, setNodes, onNodesChange] = useNodesState(computedNodes);
128
134
  useEffect(() => {
@@ -214,11 +220,11 @@ function TeamPolicyFlow({ document, selectedId, incompleteKeys, onSelect, onConn
214
220
  //#endregion
215
221
  //#region src/components/team-policy/TeamPolicyEditor.tsx
216
222
  var MODE_HELP = {
217
- open: "Members message each other freely; edges only matter for messages to and from other teams.",
218
- restricted: "Members message each other only along allow edges."
223
+ open: "Members message each other freely; connections only matter for messages to and from other Teams.",
224
+ restricted: "Members message each other only along connections."
219
225
  };
220
- /** A Team template's roster and allow edges, as a flow or a matrix. */
221
- function TeamPolicyEditor({ template, profiles }) {
226
+ /** A Team template's roster and connections, as a flow or a matrix. */
227
+ function TeamPolicyEditor({ template, profiles, onSaved, onDirtyChange }) {
222
228
  const [server, setServer] = useState(() => templateDocument(template));
223
229
  const [draft, setDraft] = useState(server);
224
230
  const [view, setView] = useState("flow");
@@ -227,7 +233,9 @@ function TeamPolicyEditor({ template, profiles }) {
227
233
  const [notice, setNotice] = useState(null);
228
234
  const [confirmDiscard, setConfirmDiscard] = useState(false);
229
235
  const dirty = !sameDocument(server, draft);
236
+ useEffect(() => onDirtyChange?.(dirty), [dirty, onDirtyChange]);
230
237
  const incomplete = useMemo(() => new Set(draft.members.filter((member) => !profiles.some((profile) => profile.id === member.profileId)).map((member) => member.key)), [draft.members, profiles]);
238
+ const templateNames = useMemo(() => Object.fromEntries(profiles.map((profile) => [profile.id, `${profile.name || profile.id} template`])), [profiles]);
231
239
  const toggle = (from, to, allowed) => setDraft((current) => setEdge(current, from, to, allowed));
232
240
  const save = async () => {
233
241
  setSaving(true);
@@ -240,9 +248,16 @@ function TeamPolicyEditor({ template, profiles }) {
240
248
  setServer(saved);
241
249
  setDraft(saved);
242
250
  setSelectedId(null);
243
- setNotice("Saved.");
251
+ setNotice({
252
+ text: "Saved.",
253
+ ok: true
254
+ });
255
+ await onSaved?.();
244
256
  } catch (error) {
245
- setNotice(errorMessage(error));
257
+ setNotice({
258
+ text: errorMessage(error),
259
+ ok: false
260
+ });
246
261
  } finally {
247
262
  setSaving(false);
248
263
  }
@@ -253,87 +268,77 @@ function TeamPolicyEditor({ template, profiles }) {
253
268
  subject: "Team template draft"
254
269
  }),
255
270
  /* @__PURE__ */ jsxs("section", {
256
- className: "overflow-hidden rounded-lg border border-frost bg-snow",
257
- "aria-label": "Team policy editor",
271
+ className: "min-w-0 overflow-hidden rounded-2xl border border-border bg-card shadow-baziu-sm",
272
+ "aria-label": "Roster and connections",
258
273
  children: [
259
274
  /* @__PURE__ */ jsxs("header", {
260
- className: "flex flex-wrap items-center gap-2 border-b border-frost bg-cream p-3",
275
+ className: "flex flex-wrap items-end gap-x-3 gap-y-3 border-b border-border px-4 py-4 sm:px-5",
261
276
  children: [
262
- /* @__PURE__ */ jsxs("div", {
263
- className: "mr-auto min-w-0",
264
- children: [/* @__PURE__ */ jsxs("label", {
265
- className: "m-0 text-xs",
266
- children: ["Template name", /* @__PURE__ */ jsx("input", {
267
- value: draft.name,
268
- onChange: (event) => {
269
- const name = event.target.value;
270
- setDraft((current) => ({
271
- ...current,
272
- name
273
- }));
274
- }
275
- })]
276
- }), /* @__PURE__ */ jsx("p", {
277
- className: "muted m-0 text-xs",
278
- children: MODE_HELP[draft.mode]
279
- })]
280
- }),
281
- /* @__PURE__ */ jsx("fieldset", {
282
- className: "m-0 flex min-w-0 rounded-md border border-frost bg-ivory p-0.5",
283
- "aria-label": "Policy mode",
284
- children: ["open", "restricted"].map((mode) => /* @__PURE__ */ jsx(Toggle, {
285
- active: draft.mode === mode,
286
- label: mode === "open" ? "Open" : "Restricted",
287
- onClick: () => setDraft((current) => ({
277
+ /* @__PURE__ */ jsx("div", {
278
+ className: "min-w-0 flex-1 basis-60",
279
+ children: /* @__PURE__ */ jsx(TextField, {
280
+ label: "Name",
281
+ value: draft.name,
282
+ disabled: saving,
283
+ className: "max-w-none",
284
+ onChange: (name) => setDraft((current) => ({
288
285
  ...current,
289
- mode
286
+ name
290
287
  }))
291
- }, mode))
288
+ })
292
289
  }),
293
- /* @__PURE__ */ jsxs("fieldset", {
294
- className: "m-0 flex min-w-0 rounded-md border border-frost bg-ivory p-0.5",
295
- "aria-label": "Editor view",
296
- children: [/* @__PURE__ */ jsx(Toggle, {
297
- active: view === "flow",
298
- label: "Flow",
299
- icon: /* @__PURE__ */ jsx(ListTree, { className: "h-4 w-4" }),
300
- onClick: () => setView("flow")
301
- }), /* @__PURE__ */ jsx(Toggle, {
302
- active: view === "matrix",
303
- label: "Matrix",
304
- icon: /* @__PURE__ */ jsx(TableProperties, { className: "h-4 w-4" }),
305
- onClick: () => setView("matrix")
290
+ /* @__PURE__ */ jsxs("div", {
291
+ className: "grid gap-1.5",
292
+ children: [/* @__PURE__ */ jsx("span", {
293
+ className: "text-sm font-semibold text-foreground",
294
+ children: "Messaging"
295
+ }), /* @__PURE__ */ jsx(Segmented, {
296
+ label: "Messaging",
297
+ value: draft.mode,
298
+ onChange: (mode) => setDraft((current) => ({
299
+ ...current,
300
+ mode
301
+ })),
302
+ options: [{
303
+ id: "open",
304
+ label: "Open"
305
+ }, {
306
+ id: "restricted",
307
+ label: "Restricted"
308
+ }]
306
309
  })]
307
310
  }),
308
- /* @__PURE__ */ jsx(Button, {
309
- variant: "ghost",
310
- disabled: !dirty || saving,
311
- onClick: () => setConfirmDiscard(true),
312
- children: "Discard"
311
+ /* @__PURE__ */ jsxs("div", {
312
+ className: "grid gap-1.5",
313
+ children: [/* @__PURE__ */ jsx("span", {
314
+ className: "text-sm font-semibold text-foreground",
315
+ children: "View"
316
+ }), /* @__PURE__ */ jsx(Segmented, {
317
+ label: "View",
318
+ value: view,
319
+ onChange: setView,
320
+ options: [{
321
+ id: "flow",
322
+ label: "Flow"
323
+ }, {
324
+ id: "matrix",
325
+ label: "Matrix"
326
+ }]
327
+ })]
313
328
  }),
314
- /* @__PURE__ */ jsxs(Button, {
315
- variant: "primary",
316
- disabled: !dirty || saving,
317
- onClick: save,
318
- children: [
319
- /* @__PURE__ */ jsx(Save, { className: "h-4 w-4" }),
320
- " ",
321
- saving ? "Saving…" : "Save"
322
- ]
329
+ /* @__PURE__ */ jsx("p", {
330
+ className: "m-0 basis-full text-sm text-muted-foreground",
331
+ children: MODE_HELP[draft.mode]
323
332
  })
324
333
  ]
325
334
  }),
326
- notice && /* @__PURE__ */ jsx("div", {
327
- role: "status",
328
- className: "border-b border-frost bg-ivory px-4 py-2 text-sm",
329
- children: notice
330
- }),
331
335
  /* @__PURE__ */ jsxs("div", {
332
336
  className: "grid min-h-[620px] grid-cols-1 lg:grid-cols-[minmax(0,1fr)_280px]",
333
337
  children: [/* @__PURE__ */ jsx("div", {
334
338
  className: "min-h-[480px] overflow-hidden",
335
339
  children: view === "flow" ? /* @__PURE__ */ jsx(TeamPolicyFlow, {
336
340
  document: draft,
341
+ templateNames,
337
342
  selectedId,
338
343
  incompleteKeys: incomplete,
339
344
  onSelect: setSelectedId,
@@ -354,7 +359,7 @@ function TeamPolicyEditor({ template, profiles }) {
354
359
  onToggle: toggle
355
360
  })
356
361
  }), /* @__PURE__ */ jsx("aside", {
357
- className: "border-t border-frost p-4 lg:border-l lg:border-t-0",
362
+ className: "border-t border-border p-4 lg:border-l lg:border-t-0",
358
363
  children: /* @__PURE__ */ jsx(Inspector, {
359
364
  document: draft,
360
365
  selectedId,
@@ -364,14 +369,36 @@ function TeamPolicyEditor({ template, profiles }) {
364
369
  onToggle: toggle
365
370
  })
366
371
  })]
372
+ }),
373
+ /* @__PURE__ */ jsxs("footer", {
374
+ className: "flex flex-wrap items-center gap-x-4 gap-y-2 border-t border-border px-4 py-4 sm:px-5",
375
+ children: [
376
+ /* @__PURE__ */ jsx(Button, {
377
+ variant: "primary",
378
+ disabled: !dirty || saving,
379
+ onClick: () => void save(),
380
+ children: saving ? "Saving…" : "Save"
381
+ }),
382
+ dirty && /* @__PURE__ */ jsx(Button, {
383
+ variant: "ghost",
384
+ disabled: saving,
385
+ onClick: () => setConfirmDiscard(true),
386
+ children: "Discard changes"
387
+ }),
388
+ /* @__PURE__ */ jsx("p", {
389
+ role: "status",
390
+ className: `m-0 min-w-0 flex-1 basis-56 text-sm font-medium ${notice && !notice.ok ? "text-warning" : dirty ? "text-warning" : notice ? "text-success" : "text-muted-foreground"}`,
391
+ children: notice && !notice.ok ? `Nothing was saved: ${notice.text}` : dirty ? "Not saved yet." : notice ? "Saved. Teams spawned from now on get this roster." : "Teams already spawned keep their own Agents and connections."
392
+ })
393
+ ]
367
394
  })
368
395
  ]
369
396
  }),
370
397
  /* @__PURE__ */ jsx(ConfirmDialog, {
371
398
  open: confirmDiscard,
372
- title: "Discard this Team template draft?",
373
- description: /* @__PURE__ */ jsx("p", { children: "This discards every unsaved change. The saved template stays as it is." }),
374
- confirmLabel: "discard draft",
399
+ title: "Discard your changes to this template?",
400
+ description: /* @__PURE__ */ jsx("p", { children: "The saved roster and connections stay as they are." }),
401
+ confirmLabel: "Discard changes",
375
402
  onConfirm: () => {
376
403
  setDraft(server);
377
404
  setSelectedId(null);
@@ -381,15 +408,6 @@ function TeamPolicyEditor({ template, profiles }) {
381
408
  })
382
409
  ] });
383
410
  }
384
- function Toggle({ active, label, icon, onClick }) {
385
- return /* @__PURE__ */ jsxs("button", {
386
- type: "button",
387
- "aria-pressed": active,
388
- onClick,
389
- className: `flex items-center gap-1 rounded px-2 py-1 text-xs ${active ? "bg-snow text-sapphire shadow-sm" : "text-mocha"}`,
390
- children: [icon, label]
391
- });
392
- }
393
411
  function Inspector({ document, selectedId, profiles, onDraft, onSelect, onToggle }) {
394
412
  const actors = [...document.members.map((member) => member.key), OUTSIDE];
395
413
  const edge = document.edges.find((item) => edgeKey(item.from, item.to) === selectedId);
@@ -403,55 +421,57 @@ function Inspector({ document, selectedId, profiles, onDraft, onSelect, onToggle
403
421
  } : item)
404
422
  }));
405
423
  if (edge) return /* @__PURE__ */ jsxs("div", {
406
- className: "space-y-3",
424
+ className: "grid gap-3",
407
425
  children: [
408
- /* @__PURE__ */ jsx("p", {
409
- className: "text-xs font-semibold uppercase text-mocha-light",
410
- children: "Allow edge"
426
+ /* @__PURE__ */ jsx("h3", {
427
+ className: "m-0 font-body text-sm font-semibold text-foreground",
428
+ children: "Connection"
411
429
  }),
412
430
  /* @__PURE__ */ jsxs("p", {
413
- className: "text-sm",
431
+ className: "m-0 text-sm",
414
432
  children: [
415
433
  endpointLabel(document, edge.from),
416
- " → ",
417
- endpointLabel(document, edge.to)
434
+ " may message ",
435
+ endpointLabel(document, edge.to),
436
+ "."
418
437
  ]
419
438
  }),
420
- /* @__PURE__ */ jsxs(Button, {
439
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, {
421
440
  variant: "danger",
422
441
  onClick: () => {
423
442
  onToggle(edge.from, edge.to, false);
424
443
  onSelect(null);
425
444
  },
426
- children: [/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }), " Remove edge"]
427
- })
445
+ children: "Remove connection"
446
+ }) })
428
447
  ]
429
448
  });
430
449
  if (!selected) return /* @__PURE__ */ jsxs("div", {
431
- className: "space-y-4",
450
+ className: "grid gap-4",
432
451
  children: [
433
- /* @__PURE__ */ jsxs("div", { children: [
434
- /* @__PURE__ */ jsx("p", {
435
- className: "text-xs font-semibold uppercase text-mocha-light",
436
- children: "Summary"
437
- }),
438
- /* @__PURE__ */ jsxs("p", {
439
- className: "muted text-xs",
452
+ /* @__PURE__ */ jsxs("div", {
453
+ className: "grid gap-1",
454
+ children: [/* @__PURE__ */ jsxs("h3", {
455
+ className: "m-0 font-body text-sm font-semibold text-foreground",
440
456
  children: [
441
- document.members.length,
442
- " slots · ",
443
- document.edges.length,
444
- " allow edges"
457
+ document.members.length === 1 ? "1 Agent" : `${document.members.length} Agents`,
458
+ " ·",
459
+ " ",
460
+ document.edges.length === 1 ? "1 connection" : `${document.edges.length} connections`
445
461
  ]
462
+ }), /* @__PURE__ */ jsx("p", {
463
+ className: "m-0 text-sm text-muted-foreground",
464
+ children: "Select an Agent to choose who it may message, or drag from one Agent's dot to another. A message to another Team needs a connection to Other teams here, and one from Other teams in that Team."
465
+ })]
466
+ }),
467
+ /* @__PURE__ */ jsxs("div", { children: [
468
+ /* @__PURE__ */ jsx("label", {
469
+ htmlFor: "team-template-user-md",
470
+ className: "m-0 text-sm font-semibold text-foreground",
471
+ children: "USER.md"
446
472
  }),
447
- /* @__PURE__ */ jsx("p", {
448
- className: "muted mt-2 text-xs",
449
- children: "Select a node to edit who it may message. Drag from one node's handle to another to add an edge. Other teams need an edge to Other teams in the sender's Team and one from Other teams in the recipient's Team."
450
- })
451
- ] }),
452
- /* @__PURE__ */ jsxs("label", {
453
- className: "text-xs",
454
- children: ["USER.md for spawned Teams", /* @__PURE__ */ jsx("textarea", {
473
+ /* @__PURE__ */ jsx("textarea", {
474
+ id: "team-template-user-md",
455
475
  rows: 6,
456
476
  value: document.userMd ?? "",
457
477
  onChange: (event) => {
@@ -461,10 +481,14 @@ function Inspector({ document, selectedId, profiles, onDraft, onSelect, onToggle
461
481
  userMd: userMd || null
462
482
  }));
463
483
  },
464
- className: "font-mono text-[0.85em]"
465
- })]
466
- }),
467
- /* @__PURE__ */ jsxs(Button, {
484
+ className: "mt-1.5 font-mono text-[0.85em]"
485
+ }),
486
+ /* @__PURE__ */ jsx("span", {
487
+ className: "mt-1 block text-xs text-muted-foreground",
488
+ children: "What every Agent of a Team spawned from it knows about you."
489
+ })
490
+ ] }),
491
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(Button, {
468
492
  variant: "ghost",
469
493
  onClick: () => onDraft((current) => ({
470
494
  ...current,
@@ -475,60 +499,58 @@ function Inspector({ document, selectedId, profiles, onDraft, onSelect, onToggle
475
499
  position: defaultPosition(current.members.length)
476
500
  }]
477
501
  })),
478
- children: [/* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" }), " Add slot"]
479
- })
502
+ children: [/* @__PURE__ */ jsx(Plus, {
503
+ className: "size-4",
504
+ "aria-hidden": "true"
505
+ }), " Add an Agent"]
506
+ }) })
480
507
  ]
481
508
  });
509
+ const known = member && profiles.some((profile) => profile.id === member.profileId);
482
510
  return /* @__PURE__ */ jsxs("div", {
483
- className: "space-y-4",
511
+ className: "grid gap-4",
484
512
  children: [
485
- /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
486
- className: "text-xs font-semibold uppercase text-mocha-light",
487
- children: member ? "Slot" : "Boundary"
488
- }), /* @__PURE__ */ jsx("h3", {
489
- className: "mt-1 text-base",
490
- children: endpointLabel(document, selected)
491
- })] }),
492
- member && /* @__PURE__ */ jsxs("div", {
493
- className: "space-y-2",
494
- children: [/* @__PURE__ */ jsxs("label", {
495
- className: "text-xs",
496
- children: ["Agent name", /* @__PURE__ */ jsx("input", {
497
- value: member.name,
498
- onChange: (event) => updateMember({ name: event.target.value })
499
- })]
500
- }), /* @__PURE__ */ jsxs("label", {
501
- className: "text-xs",
502
- children: ["Agent template", /* @__PURE__ */ jsxs("select", {
503
- value: member.profileId,
504
- onChange: (event) => updateMember({ profileId: event.target.value }),
505
- children: [!profiles.some((profile) => profile.id === member.profileId) && /* @__PURE__ */ jsx("option", {
506
- value: member.profileId,
507
- children: member.profileId || "Select a template"
508
- }), profiles.map((profile) => /* @__PURE__ */ jsx("option", {
509
- value: profile.id,
510
- children: profile.name
511
- }, profile.id))]
512
- })]
513
- })]
513
+ /* @__PURE__ */ jsx("h3", {
514
+ className: "m-0 font-body text-sm font-semibold text-foreground",
515
+ children: member ? member.name || "Agent" : "Other teams"
514
516
  }),
515
- /* @__PURE__ */ jsxs("div", {
516
- className: "space-y-2",
517
- children: [/* @__PURE__ */ jsx("p", {
518
- className: "text-xs font-semibold",
519
- children: "May send to"
520
- }), actors.filter((target) => target !== selected).map((target) => {
521
- const allowed = hasEdge(document, selected, target);
522
- return /* @__PURE__ */ jsxs("button", {
523
- type: "button",
524
- "aria-pressed": allowed,
525
- onClick: () => onToggle(selected, target, !allowed),
526
- className: "flex w-full items-center justify-between rounded border border-frost p-2 text-xs",
527
- children: [/* @__PURE__ */ jsx("span", { children: endpointLabel(document, target) }), allowed ? "Allowed" : "Not allowed"]
528
- }, target);
529
- })]
517
+ member && /* @__PURE__ */ jsxs(Fragment$1, { children: [
518
+ /* @__PURE__ */ jsx(TextField, {
519
+ label: "Name",
520
+ value: member.name,
521
+ className: "max-w-none",
522
+ onChange: (name) => updateMember({ name })
523
+ }),
524
+ /* @__PURE__ */ jsx(SelectField, {
525
+ label: "Template",
526
+ value: member.profileId,
527
+ className: "max-w-none",
528
+ options: [...known ? [] : [{
529
+ value: member.profileId,
530
+ label: member.profileId || "Choose a template"
531
+ }], ...profiles.map((profile) => ({
532
+ value: profile.id,
533
+ label: profile.name || profile.id
534
+ }))],
535
+ onChange: (profileId) => updateMember({ profileId })
536
+ }),
537
+ !known && /* @__PURE__ */ jsx(Notice, {
538
+ tone: "warning",
539
+ children: "Choose a template: an Agent cannot be spawned without one."
540
+ })
541
+ ] }),
542
+ /* @__PURE__ */ jsxs("fieldset", {
543
+ className: "m-0 grid min-w-0 gap-3 border-0 p-0",
544
+ children: [/* @__PURE__ */ jsx("legend", {
545
+ className: "mb-2 p-0 text-sm font-semibold text-foreground",
546
+ children: "May message"
547
+ }), actors.filter((target) => target !== selected).map((target) => /* @__PURE__ */ jsx(SwitchRow, {
548
+ label: endpointLabel(document, target),
549
+ checked: hasEdge(document, selected, target),
550
+ onChange: (allowed) => onToggle(selected, target, allowed)
551
+ }, target))]
530
552
  }),
531
- member && /* @__PURE__ */ jsxs(Button, {
553
+ member && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, {
532
554
  variant: "danger",
533
555
  onClick: () => {
534
556
  onDraft((current) => ({
@@ -538,49 +560,77 @@ function Inspector({ document, selectedId, profiles, onDraft, onSelect, onToggle
538
560
  }));
539
561
  onSelect(null);
540
562
  },
541
- children: [/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }), " Remove slot and its edges"]
542
- })
563
+ children: "Remove this Agent"
564
+ }) })
543
565
  ]
544
566
  });
545
567
  }
546
568
  //#endregion
547
569
  //#region src/routes/templates/teams/$id/index.tsx?tsr-split=component
548
570
  function TeamTemplatePage() {
549
- const { template, profiles } = Route.useLoaderData();
550
- const [confirmDelete, setConfirmDelete] = useState(false);
551
- return /* @__PURE__ */ jsxs(PageShell, {
552
- size: "wide",
571
+ const { template, profiles, teams } = Route.useLoaderData();
572
+ const navigate = useNavigate();
573
+ const router = useRouter();
574
+ const [spawning, setSpawning] = useState(false);
575
+ const [deleting, setDeleting] = useState(false);
576
+ const [unsaved, setUnsaved] = useState(false);
577
+ return /* @__PURE__ */ jsxs(ManagePage, {
578
+ title: template.name,
579
+ description: `A roster of ${count(template.slots.length, "Agent")} and ${count(template.edges.length, "connection")}. Spawning it creates them in a new Team or one that exists; Teams already spawned keep their own.`,
580
+ actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
581
+ variant: "primary",
582
+ disabled: template.slots.length === 0 || unsaved,
583
+ "aria-describedby": unsaved ? "spawn-needs-save" : void 0,
584
+ onClick: () => setSpawning(true),
585
+ children: "Spawn this Team"
586
+ }), /* @__PURE__ */ jsx(RowMenu, {
587
+ label: `More for ${template.name}`,
588
+ items: [{
589
+ label: "Delete template…",
590
+ danger: true,
591
+ onSelect: () => setDeleting(true)
592
+ }]
593
+ })] }),
553
594
  children: [
554
- /* @__PURE__ */ jsx(SectionTabs, {
555
- label: "Template kinds",
556
- base: "/templates",
557
- tabs: TEMPLATE_TABS
558
- }),
559
- /* @__PURE__ */ jsxs("div", {
560
- className: "flex flex-wrap items-center justify-between gap-2",
561
- children: [/* @__PURE__ */ jsx("a", {
562
- href: "/templates/teams",
563
- children: "← Team templates"
564
- }), /* @__PURE__ */ jsx(Button, {
565
- variant: "danger",
566
- onClick: () => setConfirmDelete(true),
567
- children: "Delete template"
568
- })]
595
+ unsaved && /* @__PURE__ */ jsx("p", {
596
+ id: "spawn-needs-save",
597
+ className: "m-0 text-sm font-medium text-warning",
598
+ children: "Save the roster to spawn it as it is on screen."
569
599
  }),
570
600
  /* @__PURE__ */ jsx(TeamPolicyEditor, {
571
601
  template,
572
- profiles
602
+ profiles,
603
+ onSaved: () => router.invalidate({ sync: true }),
604
+ onDirtyChange: setUnsaved
605
+ }),
606
+ spawning && /* @__PURE__ */ jsx(SpawnTeamModal, {
607
+ template,
608
+ teams,
609
+ onClose: () => setSpawning(false),
610
+ onSpawned: (slug) => {
611
+ setSpawning(false);
612
+ navigate({
613
+ to: "/",
614
+ search: {
615
+ team: slug,
616
+ panel: "team"
617
+ }
618
+ });
619
+ }
573
620
  }),
574
621
  /* @__PURE__ */ jsx(ConfirmDialog, {
575
- open: confirmDelete,
576
- title: `Delete Team template ${template.name}?`,
577
- description: /* @__PURE__ */ jsx("p", { children: "Teams already spawned from it keep their Agents and edges." }),
622
+ open: deleting,
623
+ onOpenChange: setDeleting,
624
+ title: `Delete the ${template.name} Team template?`,
625
+ description: /* @__PURE__ */ jsx("p", {
626
+ className: "m-0",
627
+ children: "Teams already spawned from it keep their Agents and connections."
628
+ }),
578
629
  confirmLabel: "Delete template",
579
630
  onConfirm: async () => {
580
631
  await api(`/api/team-templates/${encodeURIComponent(template.id)}`, { method: "DELETE" });
581
- window.location.assign("/templates/teams");
582
- },
583
- onOpenChange: setConfirmDelete
632
+ await navigate({ to: "/templates/teams" });
633
+ }
584
634
  })
585
635
  ]
586
636
  });