bazilion 0.12.2 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/README.md +2 -2
  2. package/dist/cli.js +795 -240
  3. package/dist/cli.js.map +1 -1
  4. package/dist/daemon.js +4555 -1280
  5. package/dist/daemon.js.map +1 -1
  6. package/dist/migrations/0001_init.sql +21 -0
  7. package/dist/web/client/assets/AgentTabs-BcmmwYJc.js +1 -0
  8. package/dist/web/client/assets/ConfigPage-BCLp-FUC.js +1 -0
  9. package/dist/web/client/assets/ConfirmDialog-CyL9A20V.js +1 -0
  10. package/dist/web/client/assets/FieldRow-D6REbYUa.js +1 -0
  11. package/dist/web/client/assets/Page-NV96O47A.js +1 -0
  12. package/dist/web/client/assets/ProductionTeamPolicyEditor-DBKnOezm.js +7 -0
  13. package/dist/web/client/assets/{ProfileCommunicationEditor-C43HvUe-.js → ProfileCommunicationEditor-4RK2laqO.js} +1 -1
  14. package/dist/web/client/assets/SectionTabs-4kCQXuFY.js +1 -0
  15. package/dist/web/client/assets/TeamTabs-CdtNEqt4.js +1 -0
  16. package/dist/web/client/assets/{TemplatesTabs-6Jd_xQj7.js → TemplatesTabs-CZyss2Y0.js} +1 -1
  17. package/dist/web/client/assets/UnsavedChangesGuard-CEoK-ZcN.js +1 -0
  18. package/dist/web/client/assets/_id-4ZS-w_Aj.js +1 -0
  19. package/dist/web/client/assets/{_id-AOAT0H_5.js → _id-DIqtdQij.js} +1 -1
  20. package/dist/web/client/assets/_id-DbcC2E7F.js +1 -0
  21. package/dist/web/client/assets/_id-f_r5M0p3.js +1 -0
  22. package/dist/web/client/assets/activity-CB9Ufth-.js +1 -0
  23. package/dist/web/client/assets/agents-D-JGXVg9.js +1 -0
  24. package/dist/web/client/assets/agents-DS2XafoA.js +1 -0
  25. package/dist/web/client/assets/approvals-Cke_mrJv.js +1 -0
  26. package/dist/web/client/assets/attention-PYwRM2wC.js +1 -0
  27. package/dist/web/client/assets/chevron-right-BG4OeFRQ.js +1 -0
  28. package/dist/web/client/assets/config-DF9Gqmfa.js +3 -0
  29. package/dist/web/client/assets/dm-sans-latin-400-normal-BwCSEQnW.woff +0 -0
  30. package/dist/web/client/assets/dm-sans-latin-400-normal-CW0RaeGs.woff2 +0 -0
  31. package/dist/web/client/assets/dm-sans-latin-500-normal-B9HHJjqV.woff2 +0 -0
  32. package/dist/web/client/assets/dm-sans-latin-500-normal-Dr3UlScf.woff +0 -0
  33. package/dist/web/client/assets/dm-sans-latin-600-normal-Aqo67rzb.woff2 +0 -0
  34. package/dist/web/client/assets/dm-sans-latin-600-normal-BmdmIIQ2.woff +0 -0
  35. package/dist/web/client/assets/dm-sans-latin-700-normal-CUSSCpQX.woff +0 -0
  36. package/dist/web/client/assets/dm-sans-latin-700-normal-DvUfVpUG.woff2 +0 -0
  37. package/dist/web/client/assets/dm-serif-display-latin-400-normal-C5_t9oOD.woff2 +0 -0
  38. package/dist/web/client/assets/dm-serif-display-latin-400-normal-_kVFYEpx.woff +0 -0
  39. package/dist/web/client/assets/{inbox-Bn1GbUsJ.js → inbox-DC_HdOfI.js} +1 -1
  40. package/dist/web/client/assets/index-Cofc7zhl.css +1 -0
  41. package/dist/web/client/assets/index-Cp6UHWr2.js +52 -0
  42. package/dist/web/client/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
  43. package/dist/web/client/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
  44. package/dist/web/client/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
  45. package/dist/web/client/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
  46. package/dist/web/client/assets/learning-BfrQ4YZY.js +1 -0
  47. package/dist/web/client/assets/login-D4n3AcBR.js +1 -0
  48. package/dist/web/client/assets/mcp-CnjQc_JJ.js +1 -0
  49. package/dist/web/client/assets/members-wxsVTJdW.js +1 -0
  50. package/dist/web/client/assets/memory-Du60O3pE.js +1 -0
  51. package/dist/web/client/assets/{policy-DaijITy7.js → policy-BOfnkJsL.js} +1 -1
  52. package/dist/web/client/assets/{preload-helper-mNuBjNXU.js → preload-helper-bztXdkDj.js} +1 -1
  53. package/dist/web/client/assets/routes-B9CuhzUW.js +1 -0
  54. package/dist/web/client/assets/services-DyvqJqM2.js +1 -0
  55. package/dist/web/client/assets/skills-DQo7ioW7.js +1 -0
  56. package/dist/web/client/assets/styles-B5vcgXln.css +2 -0
  57. package/dist/web/client/assets/{teams-D92R9Pb7.js → teams-DPggy97H.js} +1 -1
  58. package/dist/web/client/assets/teams-DdawcfNR.js +1 -0
  59. package/dist/web/client/assets/telegram-DcTeDpP5.js +1 -0
  60. package/dist/web/client/assets/tokens-CIEKwZXc.js +1 -0
  61. package/dist/web/client/assets/triggers-Bc2RrUPm.js +1 -0
  62. package/dist/web/client/assets/utils-B6KiDbIe.js +1 -0
  63. package/dist/web/client/assets/welcome-DlhNXUIa.js +1 -0
  64. package/dist/web/client/assets/wire-constants-BzdHSc6A.js +74 -0
  65. package/dist/web/client/assets/x-DAXGIe_Q.js +1 -0
  66. package/dist/web/server/assets/{AgentTabs-aXdsiiMp.js → AgentTabs-Dq8hDM2Q.js} +9 -2
  67. package/dist/web/server/assets/{ChatPane-Ba5wTsVk.js → ChatPane-CgSe7tsy.js} +81 -43
  68. package/dist/web/server/assets/{ConfigPage-BKlh5vOU.js → ConfigPage-CiQ-gxmJ.js} +3 -2
  69. package/dist/web/server/assets/ConfirmDialog-C-MPYYSU.js +99 -0
  70. package/dist/web/server/assets/FieldRow-DCOF07kl.js +160 -0
  71. package/dist/web/server/assets/{Page-LENulSXY.js → Page-Bz-ydB8j.js} +4 -10
  72. package/dist/web/server/assets/{ProductionTeamPolicyEditor-Y4mzFFvR.js → ProductionTeamPolicyEditor-DQSdP7Yx.js} +140 -123
  73. package/dist/web/server/assets/{SectionTabs-BJTPr5nU.js → SectionTabs-B2Yw81XN.js} +2 -2
  74. package/dist/web/server/assets/{Sidebar-DsRVCszF.js → Sidebar-DKyk7oIo.js} +563 -283
  75. package/dist/web/server/assets/{TeamTabs-zZzbP1t_.js → TeamTabs-Co3n2exj.js} +2 -6
  76. package/dist/web/server/assets/{TemplatesTabs-CcRxZhJe.js → TemplatesTabs-B0fA361R.js} +1 -1
  77. package/dist/web/server/assets/UnsavedChangesGuard-CiStXyBI.js +40 -0
  78. package/dist/web/server/assets/{_id-Dj1yZ3zJ.js → _id-BAA9KJBU.js} +4 -4
  79. package/dist/web/server/assets/{_id-LrvXU4Nr.js → _id-BM5m2FLT.js} +4 -4
  80. package/dist/web/server/assets/{_id-CwyGjJeP.js → _id-BYKpT2Tu.js} +4 -5
  81. package/dist/web/server/assets/{_id-BHYLL8M-.js → _id-BeKhPKw3.js} +350 -185
  82. package/dist/web/server/assets/{_id-C3HY4lWg.js → _id-BqWTB8Wl.js} +188 -86
  83. package/dist/web/server/assets/{_id-DinTp_7X.js → _id-BwvCtzlD.js} +3 -3
  84. package/dist/web/server/assets/{_id-D27T85mU.js → _id-DYU6uIBx.js} +4 -5
  85. package/dist/web/server/assets/{_id-IzadFZV9.js → _id-DvlDkk04.js} +4 -4
  86. package/dist/web/server/assets/{_id-BhOB8Umi.js → _id-DxCnEFpm.js} +4 -4
  87. package/dist/web/server/assets/{_id-tB47Vsfp.js → _id-HMy7jM3P.js} +3 -3
  88. package/dist/web/server/assets/{_id-D3Ap7zZA.js → _id-ndxFHx0t.js} +75 -71
  89. package/dist/web/server/assets/{_id-FcHdSocl.js → _id-sNu5aXZt.js} +5 -4
  90. package/dist/web/server/assets/{_tanstack-start-manifest_v-BGDBdnUs.js → _tanstack-start-manifest_v-C-OiOZeM.js} +118 -94
  91. package/dist/web/server/assets/{activity-DohitgwW.js → activity-9VP6QDTH.js} +3 -3
  92. package/dist/web/server/assets/{activity-BCI4mfNS.js → activity-BWv1goK6.js} +3 -3
  93. package/dist/web/server/assets/{activity-D9SMqBhy.js → activity-LjpblbDL.js} +3 -3
  94. package/dist/web/server/assets/{agents-C9xlWK0Z.js → agents-BDFGrU3o.js} +4 -4
  95. package/dist/web/server/assets/{agents-BY74v7fM.js → agents-BJAv919x.js} +3 -3
  96. package/dist/web/server/assets/{agents-BvttypqB.js → agents-CJk4pxKu.js} +3 -3
  97. package/dist/web/server/assets/{agents-CgZMHj80.js → agents-CYw1xHoY.js} +138 -16
  98. package/dist/web/server/assets/{agents-DZuFEj0D.js → agents-DfNKc_Q7.js} +52 -8
  99. package/dist/web/server/assets/{agents-BPKOshR5.js → agents-DjyQk94u.js} +4 -4
  100. package/dist/web/server/assets/{approvals-CWcFHlor.js → approvals-7JOoBchn.js} +3 -3
  101. package/dist/web/server/assets/{approvals-BGU-XGIO.js → approvals-BYi84gwl.js} +3 -3
  102. package/dist/web/server/assets/{approvals-DCaVw1Mz.js → approvals-Bz123liE.js} +59 -21
  103. package/dist/web/server/assets/{attention-BxkTf337.js → attention-B35JvhOL.js} +3 -3
  104. package/dist/web/server/assets/{attention-w21GQIGH.js → attention-C1pPWSXw.js} +3 -3
  105. package/dist/web/server/assets/{attention-CM-Ks1N9.js → attention-UhqPK_Ro.js} +3 -3
  106. package/dist/web/server/assets/{auth-byfSx6Ja.js → auth-7BHTH-KS.js} +5 -5
  107. package/dist/web/server/assets/{config-BDCJdtj2.js → config-BMiajTZP.js} +10 -5
  108. package/dist/web/server/assets/{config-1w2GiJUn.js → config-BlMkHStx.js} +3 -3
  109. package/dist/web/server/assets/config-ExacOzHX.js +958 -0
  110. package/dist/web/server/assets/{createServerRpc-pU-IQV2Y.js → createServerRpc-B7Yr1K8i.js} +1 -1
  111. package/dist/web/server/assets/{createSsrRpc-DFsIAfFd.js → createSsrRpc-6LHNEsSK.js} +1 -1
  112. package/dist/web/server/assets/{daemon-client-2NRMzlTr.js → daemon-client-CI5NHwNC.js} +16 -4
  113. package/dist/web/server/assets/{inbox-CzlKT9Wg.js → inbox-Dv55rGYq.js} +4 -4
  114. package/dist/web/server/assets/{inbox-BLUzA5sQ.js → inbox-RweGCV3D.js} +3 -3
  115. package/dist/web/server/assets/{inbox-ZvDNAjaM.js → inbox-cu3jLzNP.js} +4 -4
  116. package/dist/web/server/assets/{learning-B7PBkvER.js → learning-BaKM6qaw.js} +4 -4
  117. package/dist/web/server/assets/{learning-8zav4pIT.js → learning-C2upa1CE.js} +4 -4
  118. package/dist/web/server/assets/{learning-Cq7K2heb.js → learning-CbtNlqYo.js} +76 -23
  119. package/dist/web/server/assets/{login-CmWvxfTK.js → login-BNj3U6ok.js} +22 -12
  120. package/dist/web/server/assets/{login-Bx5LEyGP.js → login-Be8eP4Jp.js} +2 -2
  121. package/dist/web/server/assets/{mcp-DIWTogHM.js → mcp-B0goWO8Q.js} +3 -3
  122. package/dist/web/server/assets/{mcp-2pwT9HU8.js → mcp-BvnvlVFd.js} +3 -3
  123. package/dist/web/server/assets/mcp-CiBs8unU.js +332 -0
  124. package/dist/web/server/assets/members-BP3UTqu1.js +12 -0
  125. package/dist/web/server/assets/members-DHYTVgwb.js +100 -0
  126. package/dist/web/server/assets/members-DiYtr-zm.js +12 -0
  127. package/dist/web/server/assets/{memory-Dngc13Nw.js → memory-BqV-Afy1.js} +4 -4
  128. package/dist/web/server/assets/{memory-a8Kz57Kh.js → memory-CkXUgf5s.js} +150 -48
  129. package/dist/web/server/assets/{memory-pZ4pZT7p.js → memory-DTFEmfF3.js} +4 -4
  130. package/dist/web/server/assets/{policy-Bb-vEgqg.js → policy-18fdTFO4.js} +3 -3
  131. package/dist/web/server/assets/{policy-C30AeFIb.js → policy-BddK4xom.js} +3 -3
  132. package/dist/web/server/assets/{policy-BcGELcc9.js → policy-Bvvav8fh.js} +4 -4
  133. package/dist/web/server/assets/public-origin-xV0lm0Ty.js +25 -0
  134. package/dist/web/server/assets/router-pjH2t8Rl.js +813 -0
  135. package/dist/web/server/assets/{routes-B6cMLIPk.js → routes-BgHisAxH.js} +22 -5
  136. package/dist/web/server/assets/{routes-BrA-U_Hm.js → routes-COtkyZG1.js} +5 -5
  137. package/dist/web/server/assets/{routes-C19CMLZt.js → routes-DAU2g7Uz.js} +4 -4
  138. package/dist/web/server/assets/services-ClyGBU7W.js +83 -0
  139. package/dist/web/server/assets/{services-C4szdhPx.js → services-DgoU1udp.js} +3 -3
  140. package/dist/web/server/assets/{services-wG8I06oS.js → services-DozuJtzX.js} +3 -3
  141. package/dist/web/server/assets/{skills-BZdqiDig.js → skills-CYih9TJw.js} +47 -6
  142. package/dist/web/server/assets/{skills-a9VSWHWq.js → skills-DfGSJTCB.js} +3 -3
  143. package/dist/web/server/assets/{skills-C-UgkuCW.js → skills-Dw3cI3si.js} +3 -3
  144. package/dist/web/server/assets/start-D4Wq9iTa.js +70 -0
  145. package/dist/web/server/assets/{teams-OIkHuxy1.js → teams-BJuoNOTB.js} +3 -3
  146. package/dist/web/server/assets/{teams-CpQ0YgWf.js → teams-DF3RViAg.js} +3 -3
  147. package/dist/web/server/assets/{teams-DEpQR2QA.js → teams-DFnuc660.js} +3 -3
  148. package/dist/web/server/assets/{teams-DqfrEoH6.js → teams-DPnAX4wD.js} +4 -4
  149. package/dist/web/server/assets/{teams-jBtvnk59.js → teams-TV6nbEN_.js} +101 -10
  150. package/dist/web/server/assets/{teams-MjqgsmC3.js → teams-be05ci17.js} +3 -3
  151. package/dist/web/server/assets/{telegram-DNgCWebD.js → telegram-1AWL6lFw.js} +3 -3
  152. package/dist/web/server/assets/{telegram-XwyKSEtj.js → telegram-DbOFpTFm.js} +3 -3
  153. package/dist/web/server/assets/{telegram-CBF8SJzB.js → telegram-Dj4Wwhd6.js} +262 -43
  154. package/dist/web/server/assets/tokens-DDwtO15P.js +359 -0
  155. package/dist/web/server/assets/tokens-DjM8GsgS.js +19 -0
  156. package/dist/web/server/assets/{tokens-BnwFbV7T.js → tokens-_2hptHP6.js} +4 -4
  157. package/dist/web/server/assets/{triggers-BZPl5CHs.js → triggers-BvjYNmmY.js} +4 -4
  158. package/dist/web/server/assets/triggers-CHk9O3rU.js +367 -0
  159. package/dist/web/server/assets/{triggers-D79NoSXk.js → triggers-Nezfw-Bd.js} +4 -4
  160. package/dist/web/server/assets/utils-C_uf36nf.js +8 -0
  161. package/dist/web/server/assets/{welcome-DDB11L5j.js → welcome-B8nchXdF.js} +9 -8
  162. package/dist/web/server/server.js +29 -33
  163. package/dist/web-server.js +4 -0
  164. package/dist/web-server.js.map +1 -1
  165. package/dist/worker.js +1744 -362
  166. package/dist/worker.js.map +1 -1
  167. package/package.json +7 -6
  168. package/dist/web/client/assets/AgentTabs-R6gSjIj3.js +0 -1
  169. package/dist/web/client/assets/ConfigPage-BCwfgyjD.js +0 -1
  170. package/dist/web/client/assets/FieldRow-avAFLgYW.js +0 -1
  171. package/dist/web/client/assets/Page-CwNuDhWz.js +0 -1
  172. package/dist/web/client/assets/ProductionTeamPolicyEditor-CsWpTsy6.js +0 -7
  173. package/dist/web/client/assets/SectionTabs-DZzy01az.js +0 -1
  174. package/dist/web/client/assets/TeamTabs-DvqWieCq.js +0 -1
  175. package/dist/web/client/assets/_id-BUuz7Drv.js +0 -1
  176. package/dist/web/client/assets/_id-BegmVRmT.js +0 -1
  177. package/dist/web/client/assets/_id-BrA4Crh_.js +0 -1
  178. package/dist/web/client/assets/activity-n0Fw9_w3.js +0 -1
  179. package/dist/web/client/assets/agents-B33VQtbl.js +0 -1
  180. package/dist/web/client/assets/agents-C50pdxp7.js +0 -1
  181. package/dist/web/client/assets/approvals-DVW0hX8h.js +0 -1
  182. package/dist/web/client/assets/attention-B2490jcN.js +0 -1
  183. package/dist/web/client/assets/chevron-down-B0aNNOyn.js +0 -1
  184. package/dist/web/client/assets/config-CMMxxeX2.js +0 -3
  185. package/dist/web/client/assets/context-DcFzsfZ3.js +0 -1
  186. package/dist/web/client/assets/index-3nrK5iFr.js +0 -12
  187. package/dist/web/client/assets/learning-BUX1MFu2.js +0 -1
  188. package/dist/web/client/assets/login-CMWpGDKv.js +0 -1
  189. package/dist/web/client/assets/mcp-lZV08dqc.js +0 -1
  190. package/dist/web/client/assets/members-DAeaY2Cy.js +0 -1
  191. package/dist/web/client/assets/memory-HmMWxxdF.js +0 -1
  192. package/dist/web/client/assets/plus-CPzRJg1V.js +0 -1
  193. package/dist/web/client/assets/routes-BNk270AM.js +0 -1
  194. package/dist/web/client/assets/services-DtrpJrdo.js +0 -1
  195. package/dist/web/client/assets/skills-Cv93A3P3.js +0 -1
  196. package/dist/web/client/assets/styles-DMltY3su.css +0 -2
  197. package/dist/web/client/assets/teams-CCFnSNKi.js +0 -1
  198. package/dist/web/client/assets/telegram-BF1vdgDB.js +0 -1
  199. package/dist/web/client/assets/tokens-BXj6hWW-.js +0 -1
  200. package/dist/web/client/assets/triggers-NT24i4hZ.js +0 -1
  201. package/dist/web/client/assets/welcome-D0cy68eZ.js +0 -1
  202. package/dist/web/client/assets/wire-constants-BhVKOCQa.js +0 -74
  203. package/dist/web/server/assets/FieldRow-B4eTegH9.js +0 -94
  204. package/dist/web/server/assets/config-BmixCpz-.js +0 -372
  205. package/dist/web/server/assets/context-B-XDf6Ym.js +0 -12
  206. package/dist/web/server/assets/context-BXGo5Vfi.js +0 -12
  207. package/dist/web/server/assets/context-DrkrIWun.js +0 -47
  208. package/dist/web/server/assets/mcp-BJjLIdP0.js +0 -261
  209. package/dist/web/server/assets/members-CCv17cjQ.js +0 -46
  210. package/dist/web/server/assets/members-CW5aBe81.js +0 -12
  211. package/dist/web/server/assets/members-VdPwD6CE.js +0 -12
  212. package/dist/web/server/assets/router-CIVjTgNp.js +0 -537
  213. package/dist/web/server/assets/services-B9yBWDX0.js +0 -79
  214. package/dist/web/server/assets/start-WH8WzTL_.js +0 -4
  215. package/dist/web/server/assets/tokens-DPDMSN5O.js +0 -12
  216. package/dist/web/server/assets/tokens-yyTSfBSN.js +0 -186
  217. package/dist/web/server/assets/triggers-CSNNzRIi.js +0 -216
@@ -1 +0,0 @@
1
- import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-mNuBjNXU.js";import{t as i}from"./ProfileCommunicationEditor-C43HvUe-.js";import{t as a}from"./index-3nrK5iFr.js";import{r as o}from"./Page-CwNuDhWz.js";import{t as s}from"./team-policy-D0jpnn2b.js";import{t as c}from"./TemplatesTabs-6Jd_xQj7.js";var l=e(n()),u=t();function d(){let{loaded:e,modelGroups:t,skills:n}=a.useLoaderData(),[r,i]=(0,l.useState)(`basics`);return(0,u.jsxs)(o,{children:[(0,u.jsx)(c,{}),(0,u.jsxs)(`header`,{className:`mb-1`,children:[(0,u.jsx)(`a`,{href:`/templates/agents`,className:`mb-1 inline-block text-[0.85em] text-mocha-light hover:text-sapphire`,children:`← agent templates`}),(0,u.jsx)(`h1`,{children:e.profile.name}),(0,u.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2 text-[0.9em] text-mocha-light`,children:[(0,u.jsx)(`code`,{children:e.profile.id}),(0,u.jsx)(`span`,{children:`·`}),(0,u.jsxs)(`span`,{children:[`model: `,(0,u.jsx)(`code`,{children:e.profile.defaultModel})]})]})]}),(0,u.jsxs)(`p`,{className:`muted my-6`,children:[`These settings and files seed every agent spawned from this Agent template going forward.`,` `,(0,u.jsx)(`strong`,{children:`Existing agents keep their own copies`}),` — edits here don't propagate to already-spawned agents.`]}),(0,u.jsx)(p,{items:[{id:`basics`,label:`1. basics`},{id:`skills`,label:`2. skills`},{id:`communication`,label:`3. communication`}],active:r,onChange:e=>i(e)}),r===`basics`&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(v,{profileId:e.profile.id,initialName:e.profile.name,currentModel:e.profile.defaultModel,modelGroups:t}),(0,u.jsx)(g,{profileId:e.profile.id,file:`SOUL.md`,initialContent:e.files.soul,rows:14}),(0,u.jsx)(g,{profileId:e.profile.id,file:`IDENTITY.md`,initialContent:e.files.identity,rows:10}),e.files.bootstrap===null?(0,u.jsxs)(`section`,{className:`file-card`,children:[(0,u.jsx)(`div`,{className:`file-head`,children:(0,u.jsx)(`h3`,{children:`BOOTSTRAP.md`})}),(0,u.jsx)(`p`,{className:`muted`,children:`This profile was created without a bootstrap prompt. Spawned agents won't see a first-run intro message.`})]}):(0,u.jsx)(g,{profileId:e.profile.id,file:`BOOTSTRAP.md`,initialContent:e.files.bootstrap,rows:10}),(0,u.jsx)(_,{profileId:e.profile.id,file:`AGENTS.md`,initialContent:e.files.agents,hint:`Peers and routing notes — who this agent can hand off to.`}),(0,u.jsx)(_,{profileId:e.profile.id,file:`TOOLS.md`,initialContent:e.files.tools,hint:`Tool playbook. Agent-specific usage notes that go beyond the generic tool descriptions.`})]}),r===`skills`&&(0,u.jsx)(y,{profileId:e.profile.id,initialMode:e.profile.skillsMode,initialPicked:new Set(e.defaultSkills),skills:n}),r===`communication`&&(0,u.jsx)(f,{profileId:e.profile.id,initial:e.profile.communicationDefaults??s})]})}function f({profileId:e,initial:t}){let[n,r]=(0,l.useState)(t),[a,o]=(0,l.useState)(null),s=JSON.stringify(n)!==JSON.stringify(t);return(0,u.jsxs)(`section`,{className:`rounded-md border border-frost bg-snow p-5 shadow-baziu-sm`,children:[(0,u.jsx)(`div`,{className:`mb-2 flex flex-wrap items-center gap-2`,children:(0,u.jsx)(`h3`,{className:`m-0 font-body text-[0.95rem] font-semibold normal-case text-chocolate`,children:`Communication defaults`})}),(0,u.jsx)(`p`,{className:`muted mb-4`,children:`Materialized into new Team and Team policy snapshots after preset resolution. Existing snapshots never inherit later changes. Stored by the daemon.`}),(0,u.jsx)(i,{value:n,onChange:r}),(0,u.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,u.jsx)(`button`,{type:`button`,className:`btn-primary`,disabled:!s,onClick:async()=>{let t=await fetch(`/api/profiles/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({communicationDefaults:n})});if(!t.ok)throw Error((await t.json().catch(()=>null))?.error??t.statusText);o(Date.now())},children:`save communication defaults`}),a&&(0,u.jsx)(`span`,{className:`text-xs text-sapphire`,children:`saved to daemon`})]})]})}function p({items:e,active:t,onChange:n}){return(0,u.jsx)(`nav`,{role:`tablist`,className:`-mb-px mb-5 flex gap-1 border-b border-frost`,children:e.map(e=>(0,u.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t===e.id,onClick:()=>n(e.id),className:`unstyled cursor-pointer border-b-2 bg-transparent px-4 py-2 text-[0.9em] font-medium transition-colors ${t===e.id?`border-sapphire text-sapphire`:`border-transparent text-mocha hover:text-sapphire`}`,children:e.label},e.id))})}function m(e){return e===`saved`?`text-sapphire`:e===`error`?`text-danger`:e===`dirty`?`text-mocha`:`text-mocha-light`}function h({title:e,status:t,children:n}){return(0,u.jsxs)(`section`,{className:`file-card mb-5 rounded-[16px] border border-frost bg-snow p-5 shadow-baziu-sm`,children:[(0,u.jsxs)(`div`,{className:`mb-2 flex items-baseline justify-between`,children:[(0,u.jsx)(`h3`,{className:`m-0 font-mono text-[0.95em] font-semibold normal-case tracking-normal text-chocolate`,children:e}),t&&(0,u.jsx)(`span`,{className:`text-[0.82em] ${m(t.kind)}`,children:t.message})]}),n]})}function g({profileId:e,file:t,initialContent:n,rows:r=10}){let[i,a]=(0,l.useState)(n),[o,s]=(0,l.useState)(n),[c,d]=(0,l.useState)({kind:`idle`,message:``}),f=o!==i&&c.kind!==`saving`&&c.kind!==`error`?{kind:`dirty`,message:`unsaved changes`}:c;async function p(){d({kind:`saving`,message:`saving…`});try{let n=await fetch(`/api/profiles/${encodeURIComponent(e)}/files/${encodeURIComponent(t)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({content:o})});if(!n.ok&&n.status!==204){let e=await n.json().catch(()=>null);throw Error(e?.error??n.statusText)}a(o),d({kind:`saved`,message:`saved`})}catch(e){d({kind:`error`,message:`error: ${e.message}`})}}function m(){s(i),d({kind:`idle`,message:``})}return(0,u.jsxs)(h,{title:t,status:f,children:[(0,u.jsx)(`textarea`,{rows:r,value:o,onChange:e=>s(e.target.value),className:`font-mono text-[0.88em] leading-[1.55]`}),(0,u.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,u.jsx)(`button`,{type:`button`,className:`btn-primary`,onClick:p,disabled:c.kind===`saving`,children:`save`}),(0,u.jsx)(`button`,{type:`button`,className:`ghost-btn`,onClick:m,children:`revert`})]})]})}function _({profileId:e,file:t,initialContent:n,hint:i}){let a=r(),[o,s]=(0,l.useState)(!1),[c,d]=(0,l.useState)({kind:`idle`,message:``});async function f(){s(!0),d({kind:`saving`,message:`creating…`});try{let n=await fetch(`/api/profiles/${encodeURIComponent(e)}/files/${encodeURIComponent(t)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({content:``})});if(!n.ok&&n.status!==204){let e=await n.json().catch(()=>null);throw Error(e?.error??n.statusText)}await a.invalidate()}catch(e){d({kind:`error`,message:`error: ${e.message}`}),s(!1)}}return n===null?(0,u.jsxs)(h,{title:t,status:c,children:[(0,u.jsx)(`p`,{className:`muted my-1`,children:i}),(0,u.jsx)(`div`,{className:`mt-3 flex gap-2`,children:(0,u.jsx)(`button`,{type:`button`,className:`btn-primary`,onClick:f,disabled:o,children:o?`creating…`:`create empty`})})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`p`,{className:`muted -mb-3 ml-1 mt-2 text-[0.85em]`,children:i}),(0,u.jsx)(g,{profileId:e,file:t,initialContent:n,rows:10})]})}function v({profileId:e,initialName:t,currentModel:n,modelGroups:i}){let a=r(),[o,s]=(0,l.useState)(t),[c,d]=(0,l.useState)(n),[f,p]=(0,l.useState)({kind:`idle`,message:``}),m=!i.flatMap(e=>e.models.map(t=>`${e.provider}:${t}`)).includes(n);async function g(t){t.preventDefault(),p({kind:`saving`,message:`saving…`});try{let t=await fetch(`/api/profiles/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({name:o.trim(),defaultModel:c.trim()})});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error??t.statusText)}await a.invalidate(),p({kind:`saved`,message:`saved`})}catch(e){p({kind:`error`,message:`error: ${e.message}`})}}return(0,u.jsx)(h,{title:`settings`,status:f,children:(0,u.jsxs)(`form`,{onSubmit:g,children:[(0,u.jsxs)(`div`,{className:`flex gap-4`,children:[(0,u.jsxs)(`label`,{className:`flex-1`,children:[`name`,(0,u.jsx)(`input`,{value:o,onChange:e=>s(e.target.value)})]}),(0,u.jsxs)(`label`,{className:`flex-1`,children:[`default model`,i.length===0?(0,u.jsx)(`select`,{disabled:!0,children:(0,u.jsx)(`option`,{children:`(no models available — enable on /config)`})}):(0,u.jsxs)(`select`,{value:c,onChange:e=>d(e.target.value),children:[m&&(0,u.jsxs)(`option`,{value:n,children:[n,` (not in enabled list)`]}),i.map(e=>(0,u.jsx)(`optgroup`,{label:e.provider,children:e.models.map(t=>(0,u.jsx)(`option`,{value:`${e.provider}:${t}`,children:`${e.provider}:${t}`},t))},e.provider))]})]})]}),(0,u.jsx)(`div`,{className:`mt-3 flex gap-2`,children:(0,u.jsx)(`button`,{type:`submit`,disabled:f.kind===`saving`,children:`save settings`})})]})})}function y({profileId:e,initialMode:t,initialPicked:n,skills:i}){let a=r(),[o,s]=(0,l.useState)(t),[c,d]=(0,l.useState)(n),[f,p]=(0,l.useState)({kind:`idle`,message:``});function m(e){d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function g(t){t.preventDefault(),p({kind:`saving`,message:`saving…`});try{let t=await fetch(`/api/profiles/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({skillsMode:o,defaultSkills:o===`selected`?Array.from(c):[]})});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error??t.statusText)}await a.invalidate(),p({kind:`saved`,message:`saved`})}catch(e){p({kind:`error`,message:`error: ${e.message}`})}}return(0,u.jsxs)(h,{title:`skills`,status:f,children:[(0,u.jsx)(`p`,{className:`muted my-2`,children:`Choose what agents spawned from this profile inherit. Existing agents aren't affected — they keep whatever skills they were spawned with.`}),(0,u.jsxs)(`form`,{onSubmit:g,children:[(0,u.jsxs)(`label`,{className:`my-2 flex cursor-pointer items-start gap-2`,children:[(0,u.jsx)(`input`,{type:`radio`,checked:o===`all`,onChange:()=>s(`all`)}),(0,u.jsxs)(`span`,{children:[(0,u.jsx)(`strong`,{children:`allow all skills`}),` — every skill on disk is attached at spawn.`]})]}),(0,u.jsxs)(`label`,{className:`my-2 flex cursor-pointer items-start gap-2`,children:[(0,u.jsx)(`input`,{type:`radio`,checked:o===`selected`,onChange:()=>s(`selected`)}),(0,u.jsxs)(`span`,{children:[(0,u.jsx)(`strong`,{children:`select skills`}),` — attach only the ones ticked below.`]})]}),(0,u.jsx)(`div`,{className:`mt-3 max-h-[22rem] overflow-y-auto rounded-md border border-frost p-3 ${o===`all`?`pointer-events-none opacity-50`:``}`,children:i.length===0?(0,u.jsxs)(`p`,{className:`muted`,children:[`No skills installed yet. Import some on `,(0,u.jsx)(`a`,{href:`/skills`,children:`/skills`}),`.`]}):i.map(e=>(0,u.jsxs)(`label`,{className:`my-1.5 flex cursor-pointer items-start gap-2`,children:[(0,u.jsx)(`input`,{type:`checkbox`,checked:c.has(e.name),onChange:()=>m(e.name)}),(0,u.jsxs)(`span`,{children:[(0,u.jsx)(`code`,{children:e.name}),e.description&&(0,u.jsxs)(`span`,{className:`text-[0.9em] text-mocha-light`,children:[` — `,e.description]})]})]},e.name))}),(0,u.jsx)(`div`,{className:`mt-3 flex gap-2`,children:(0,u.jsx)(`button`,{type:`submit`,disabled:f.kind===`saving`,children:`save skills`})})]})]})}export{d as component};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{t as r}from"./chevron-down-B0aNNOyn.js";import{s as i}from"./index-3nrK5iFr.js";import{r as a}from"./Page-CwNuDhWz.js";import{t as o}from"./Button-ByiV6fpd.js";import{t as s}from"./TeamTabs-DvqWieCq.js";var c=e(n()),l=t();function u(){let e=i.useLoaderData(),{id:t}=i.useParams(),[n,r]=(0,c.useState)(e),[u,f]=(0,c.useState)(!1),[p,m]=(0,c.useState)(null);return(0,l.jsxs)(a,{children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`h1`,{children:`Blocked communication`}),(0,l.jsx)(`p`,{className:`muted`,children:`Durable denial evidence. Diagnostic simulations never create these records.`})]}),(0,l.jsx)(s,{teamId:t}),(0,l.jsxs)(`div`,{className:`space-y-3`,children:[n.blocks.map(e=>(0,l.jsx)(d,{block:e},e.id)),n.blocks.length===0&&(0,l.jsx)(`p`,{className:`card muted`,children:`No blocked communication has been recorded for this team.`})]}),p&&(0,l.jsx)(`p`,{role:`alert`,className:`err`,children:p}),n.nextCursor&&(0,l.jsx)(o,{variant:`ghost`,disabled:u,onClick:async()=>{if(n.nextCursor){f(!0),m(null);try{let e=await fetch(`/api/teams/${encodeURIComponent(t)}/policy/blocks?limit=25&cursor=${encodeURIComponent(n.nextCursor)}`);if(!e.ok)throw Error(`Could not load activity (${e.status})`);let i=await e.json();r({blocks:[...n.blocks,...i.blocks],nextCursor:i.nextCursor})}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(!1)}}},children:u?`Loading…`:`Load older evidence`})]})}function d({block:e}){return(0,l.jsxs)(`details`,{className:`card team`,children:[(0,l.jsxs)(`summary`,{className:`flex cursor-pointer list-none flex-wrap items-center gap-2`,children:[(0,l.jsx)(`strong`,{className:`mr-auto break-all`,children:e.reason_code}),(0,l.jsx)(`time`,{className:`text-xs text-mocha-light`,children:new Date(e.created_at).toLocaleString()}),(0,l.jsx)(r,{className:`h-4 w-4 transition-transform team-open:rotate-180`})]}),(0,l.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-sm sm:grid-cols-2`,children:[(0,l.jsx)(f,{label:`Path`,value:`${p(e.source_kind,e.source_id)} → ${p(e.target_kind,e.target_id)}`}),(0,l.jsx)(f,{label:`Channel / origin`,value:`${e.channel} · ${e.origin}`}),(0,l.jsx)(f,{label:`Operation`,value:e.operation}),(0,l.jsx)(f,{label:`Attempt identity`,value:`${e.attempt_kind}:${e.attempt_id}`,code:!0}),(0,l.jsx)(f,{label:`Reason`,value:e.reason,wide:!0})]}),(0,l.jsx)(`h3`,{className:`mt-5 text-sm`,children:`Policy revisions`}),(0,l.jsx)(`ul`,{className:`mt-2 text-sm`,children:e.policyRefs.map(e=>(0,l.jsxs)(`li`,{children:[(0,l.jsx)(`code`,{children:e.teamId}),` revision `,e.revision]},`${e.teamId}:${e.revision}`))}),e.componentOutcomes.length>1&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`h3`,{className:`mt-5 text-sm`,children:`Cross-Team consent components`}),(0,l.jsx)(`div`,{className:`mt-2 overflow-x-auto`,children:(0,l.jsxs)(`table`,{children:[(0,l.jsx)(`thead`,{children:(0,l.jsxs)(`tr`,{children:[(0,l.jsx)(`th`,{children:`Team`}),(0,l.jsx)(`th`,{children:`Required edge`}),(0,l.jsx)(`th`,{children:`Matched`})]})}),(0,l.jsx)(`tbody`,{children:e.componentOutcomes.map(e=>(0,l.jsxs)(`tr`,{children:[(0,l.jsx)(`td`,{children:(0,l.jsx)(`code`,{children:e.teamId})}),(0,l.jsx)(`td`,{className:`break-all`,children:(0,l.jsx)(`code`,{children:e.edge})}),(0,l.jsx)(`td`,{children:e.matched?`yes`:`no`})]},`${e.teamId}:${e.edge}`))})]})})]}),(0,l.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,l.jsx)(f,{label:`Required edges`,value:e.requiredEdgeIds.join(`, `)||`none`,code:!0}),(0,l.jsx)(f,{label:`Matched edges`,value:e.matchedEdgeIds.join(`, `)||`none`,code:!0})]})]})}function f({label:e,value:t,code:n=!1,wide:r=!1}){return(0,l.jsxs)(`div`,{className:r?`sm:col-span-2`:``,children:[(0,l.jsx)(`dt`,{className:`text-xs font-semibold uppercase text-mocha-light`,children:e}),(0,l.jsx)(`dd`,{className:`mt-1 break-words`,children:n?(0,l.jsx)(`code`,{className:`break-all`,children:t}):t})]})}function p(e,t){return t?`${e}:${t}`:e}export{u as component};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-mNuBjNXU.js";import{t as i}from"./ProfileCommunicationEditor-C43HvUe-.js";import{m as a}from"./index-3nrK5iFr.js";import{n as o,r as s}from"./Page-CwNuDhWz.js";import{t as c}from"./Button-ByiV6fpd.js";import{t as l}from"./team-policy-D0jpnn2b.js";import{t as u}from"./TemplatesTabs-6Jd_xQj7.js";var d=e(n()),f=t();function p(){let{profiles:e,modelGroups:t,skills:n,templates:i}=a.useLoaderData(),l=r();async function d(e){if(!confirm(`delete profile and all its files?`))return;let t=await fetch(`/api/profiles/${e}`,{method:`DELETE`});if(!t.ok&&t.status!==204){let e=await t.json().catch(()=>null);alert(e?.error??t.statusText);return}await l.invalidate()}return(0,f.jsxs)(s,{size:`wide`,children:[(0,f.jsx)(o,{eyebrow:`Templates`,title:`Agent templates`,description:`Define reusable identity, model, skills, and communication defaults for newly spawned agents.`}),(0,f.jsx)(u,{}),(0,f.jsx)(m,{modelGroups:t,skills:n,templates:i,onCreated:()=>l.invalidate()}),(0,f.jsx)(`div`,{className:`overflow-x-auto`,children:(0,f.jsxs)(`table`,{children:[(0,f.jsx)(`thead`,{children:(0,f.jsxs)(`tr`,{children:[(0,f.jsx)(`th`,{children:`id`}),(0,f.jsx)(`th`,{children:`name`}),(0,f.jsx)(`th`,{children:`model`}),(0,f.jsx)(`th`,{children:`agents`}),(0,f.jsx)(`th`,{children:`skills`}),(0,f.jsx)(`th`,{})]})}),(0,f.jsxs)(`tbody`,{children:[e.length===0&&(0,f.jsx)(`tr`,{children:(0,f.jsx)(`td`,{colSpan:6,className:`muted`,children:`no agent templates yet`})}),e.map(e=>{let t=e.skillsMode===`all`?`all`:e.defaultSkills.length===0?`—`:e.defaultSkills.join(`, `);return(0,f.jsxs)(`tr`,{children:[(0,f.jsx)(`td`,{children:(0,f.jsx)(`a`,{href:`/templates/agents/${e.id}`,children:(0,f.jsx)(`code`,{children:e.id})})}),(0,f.jsx)(`td`,{children:e.name}),(0,f.jsx)(`td`,{children:(0,f.jsx)(`code`,{children:e.defaultModel})}),(0,f.jsx)(`td`,{children:e.agentCount}),(0,f.jsx)(`td`,{className:`text-xs text-mocha-light`,children:t}),(0,f.jsx)(`td`,{children:e.agentCount===0?(0,f.jsx)(c,{variant:`danger`,onClick:()=>d(e.id),children:`delete`}):(0,f.jsx)(`span`,{className:`muted`,title:`${e.agentCount} agent(s) use this profile`,children:`in use`})})]},e.id)})]})]})})]})}function m({modelGroups:e,skills:t,templates:n,onCreated:r}){let[a,o]=(0,d.useState)(`basics`),[s,u]=(0,d.useState)(``),[p,m]=(0,d.useState)(``),[_,v]=(0,d.useState)(``),[y,b]=(0,d.useState)(n.soul),[x,S]=(0,d.useState)(n.identity),[C,w]=(0,d.useState)(n.bootstrap),[T,E]=(0,d.useState)(!0),[D,O]=(0,d.useState)(n.agents),[k,A]=(0,d.useState)(!0),[j,M]=(0,d.useState)(n.tools),[N,P]=(0,d.useState)(!0);function F(e,t,n){t(n),!n&&a===e&&o(`basics`)}let[I,L]=(0,d.useState)(`all`),[R,z]=(0,d.useState)(l),[B,V]=(0,d.useState)(new Set),[H,U]=(0,d.useState)(null),[W,G]=(0,d.useState)(!1);function K(e){V(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function q(e){if(e.preventDefault(),U(null),!s.trim()){U(`id is required`);return}if(!_.trim()){U(`default model is required`);return}G(!0);try{let e={id:s.trim(),name:p.trim()||void 0,model:_.trim(),skillsMode:I,defaultSkills:I===`selected`?Array.from(B):[],soul:y,identity:x,bootstrap:T?C:null,agents:k?D:null,tools:N?j:null,communicationDefaults:R},t=await fetch(`/api/profiles`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error??t.statusText)}u(``),m(``),v(``),E(!0),O(n.agents),A(!0),M(n.tools),P(!0),V(new Set),L(`all`),z(l),o(`basics`),r()}catch(e){U(e.message)}finally{G(!1)}}return(0,f.jsxs)(`form`,{className:`card`,onSubmit:q,children:[(0,f.jsx)(`h3`,{children:`create agent template`}),H&&(0,f.jsx)(`div`,{className:`err`,children:H}),(0,f.jsx)(h,{items:[{id:`basics`,label:`basics`},{id:`soul`,label:`SOUL`},{id:`identity`,label:`IDENTITY`},{id:`bootstrap`,label:`BOOTSTRAP`,disabled:!T},{id:`agents`,label:`AGENTS`,disabled:!k},{id:`tools`,label:`TOOLS`,disabled:!N},{id:`skills`,label:`skills`},{id:`communication`,label:`communication`}],active:a,onChange:e=>o(e)}),(0,f.jsxs)(`fieldset`,{className:`mb-5 rounded-md border border-frost p-3`,children:[(0,f.jsx)(`legend`,{className:`px-1 text-[0.85em] font-medium text-mocha`,children:`templates to include`}),(0,f.jsxs)(`div`,{className:`flex flex-wrap gap-x-5 gap-y-2 text-[0.9em]`,children:[(0,f.jsxs)(`label`,{className:`inline-flex items-center gap-1.5 opacity-60`,title:`always included`,children:[(0,f.jsx)(`input`,{type:`checkbox`,defaultChecked:!0,disabled:!0}),` SOUL.md`]}),(0,f.jsxs)(`label`,{className:`inline-flex items-center gap-1.5 opacity-60`,title:`always included`,children:[(0,f.jsx)(`input`,{type:`checkbox`,defaultChecked:!0,disabled:!0}),` IDENTITY.md`]}),(0,f.jsxs)(`label`,{className:`inline-flex cursor-pointer items-center gap-1.5`,children:[(0,f.jsx)(`input`,{type:`checkbox`,checked:T,onChange:e=>F(`bootstrap`,E,e.target.checked)}),`BOOTSTRAP.md`]}),(0,f.jsxs)(`label`,{className:`inline-flex cursor-pointer items-center gap-1.5`,children:[(0,f.jsx)(`input`,{type:`checkbox`,checked:k,onChange:e=>F(`agents`,A,e.target.checked)}),`AGENTS.md`]}),(0,f.jsxs)(`label`,{className:`inline-flex cursor-pointer items-center gap-1.5`,children:[(0,f.jsx)(`input`,{type:`checkbox`,checked:N,onChange:e=>F(`tools`,P,e.target.checked)}),`TOOLS.md`]})]}),(0,f.jsx)(`p`,{className:`muted mt-2 text-[0.8em]`,children:`Disabled files aren't created for this Agent template. Each spawned agent gets its own copy of the enabled files at spawn time.`})]}),a===`basics`&&(0,f.jsxs)(`div`,{children:[(0,f.jsxs)(`div`,{className:`flex gap-4`,children:[(0,f.jsxs)(`label`,{className:`flex-1`,children:[`id (slug)`,(0,f.jsx)(`input`,{value:s,onChange:e=>u(e.target.value),required:!0})]}),(0,f.jsxs)(`label`,{className:`flex-1`,children:[`name`,(0,f.jsx)(`input`,{value:p,onChange:e=>m(e.target.value)})]})]}),(0,f.jsxs)(`label`,{children:[`default model`,e.length===0?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`select`,{disabled:!0,children:(0,f.jsx)(`option`,{children:`(no models available)`})}),(0,f.jsxs)(`span`,{className:`muted text-[0.85em]`,children:[`Enable a provider and curate models on `,(0,f.jsx)(`a`,{href:`/config`,children:`/config`}),` first.`]})]}):(0,f.jsxs)(`select`,{value:_,onChange:e=>v(e.target.value),required:!0,children:[(0,f.jsx)(`option`,{value:``,children:`-- pick a model --`}),e.map(e=>(0,f.jsx)(`optgroup`,{label:e.provider,children:e.models.map(t=>(0,f.jsx)(`option`,{value:`${e.provider}:${t}`,children:`${e.provider}:${t}`},t))},e.provider))]})]})]}),a===`soul`&&(0,f.jsx)(g,{label:`SOUL.md`,hint:`Persona, values, and operating principles. Injected into every session.`,value:y,onChange:b,rows:16}),a===`identity`&&(0,f.jsx)(g,{label:`IDENTITY.md`,hint:`Name, creature, vibe, emoji, avatar — filled in during the bootstrap ritual.`,value:x,onChange:S,rows:12}),a===`bootstrap`&&(0,f.jsx)(g,{label:`BOOTSTRAP.md`,hint:`One-time first-run ritual. The agent retires it once introductions are done.`,value:C,onChange:w,rows:16}),a===`agents`&&(0,f.jsx)(g,{label:`AGENTS.md`,hint:`The workspace operating manual — memory discipline, red lines, channel etiquette.`,value:D,onChange:O,rows:16}),a===`tools`&&(0,f.jsx)(g,{label:`TOOLS.md`,hint:`Agent-specific tool notes and environment facts beyond the generic tool descriptions.`,value:j,onChange:M,rows:14}),a===`skills`&&(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`p`,{className:`muted my-2`,children:`Choose which skills agents inherit at spawn time. In both modes each agent can still attach or detach skills individually after it's spawned.`}),(0,f.jsxs)(`label`,{className:`flex items-start gap-2 my-2 cursor-pointer`,children:[(0,f.jsx)(`input`,{type:`radio`,name:`skillsMode`,value:`all`,checked:I===`all`,onChange:()=>L(`all`)}),(0,f.jsxs)(`span`,{children:[(0,f.jsx)(`strong`,{children:`allow all skills`}),` — every skill on disk is attached when an agent is spawned.`]})]}),(0,f.jsxs)(`label`,{className:`flex items-start gap-2 my-2 cursor-pointer`,children:[(0,f.jsx)(`input`,{type:`radio`,name:`skillsMode`,value:`selected`,checked:I===`selected`,onChange:()=>L(`selected`)}),(0,f.jsxs)(`span`,{children:[(0,f.jsx)(`strong`,{children:`select skills`}),` — attach only the ones you pick below.`]})]}),(0,f.jsx)(`div`,{className:`mt-3 max-h-[22rem] overflow-y-auto rounded-md border border-frost p-3 ${I===`all`?`opacity-50 pointer-events-none`:``}`,children:t.length===0?(0,f.jsxs)(`p`,{className:`muted`,children:[`No skills installed yet. Import some on `,(0,f.jsx)(`a`,{href:`/skills`,children:`/skills`}),`.`]}):t.map(e=>(0,f.jsxs)(`label`,{className:`my-1.5 flex cursor-pointer items-start gap-2`,children:[(0,f.jsx)(`input`,{type:`checkbox`,checked:B.has(e.name),onChange:()=>K(e.name)}),(0,f.jsxs)(`span`,{children:[(0,f.jsx)(`code`,{children:e.name}),e.description&&(0,f.jsxs)(`span`,{className:`text-[0.9em] text-mocha-light`,children:[` — `,e.description]})]})]},e.name))})]}),a===`communication`&&(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`div`,{className:`mb-3 flex items-center gap-2`,children:(0,f.jsx)(`h4`,{className:`text-sm font-semibold text-chocolate`,children:`Communication defaults`})}),(0,f.jsx)(`p`,{className:`muted mb-4`,children:`Materialized when a Team or live policy snapshot is created. Existing snapshots never inherit later changes.`}),(0,f.jsx)(i,{value:R,onChange:z})]}),(0,f.jsx)(`div`,{className:`mt-5 flex gap-2`,children:(0,f.jsx)(c,{variant:`primary`,type:`submit`,disabled:W,children:W?`creating…`:`create`})})]})}function h({items:e,active:t,onChange:n}){return(0,f.jsx)(`nav`,{role:`tablist`,className:`-mb-px mb-5 flex flex-wrap gap-1 border-b border-frost`,children:e.map(e=>(0,f.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t===e.id,disabled:e.disabled,title:e.disabled?`disabled — enable it in “templates to include”`:void 0,onClick:()=>n(e.id),className:`unstyled border-b-2 bg-transparent px-4 py-2 text-[0.9em] font-medium transition-colors ${e.disabled?`cursor-not-allowed border-transparent text-mocha-light/40`:t===e.id?`cursor-pointer border-sapphire text-sapphire`:`cursor-pointer border-transparent text-mocha hover:text-sapphire`}`,children:e.label},e.id))})}function g({label:e,hint:t,value:n,onChange:r,rows:i}){return(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`p`,{className:`muted my-2 text-[0.85em]`,children:t}),(0,f.jsxs)(`label`,{children:[e,(0,f.jsx)(`textarea`,{rows:i,value:n,onChange:e=>r(e.target.value),className:`font-mono text-[0.88em] leading-[1.55]`})]})]})}export{p as component};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-mNuBjNXU.js";import{y as i}from"./index-3nrK5iFr.js";import{a,i as o,n as s,r as c,t as l}from"./Page-CwNuDhWz.js";import{t as u}from"./AgentAvatar-JYijLvZ2.js";import{t as d}from"./Button-ByiV6fpd.js";var f=e(n()),p=t();function m(){let{agents:e,profiles:t,teams:n,modelGroups:f}=i.useLoaderData(),{all:m}=i.useSearch(),g=m===`1`,_=r();async function v(e){confirm(`archive this agent? (reversible)`)&&(await fetch(`/api/agents/${e}/archive`,{method:`POST`}),await _.invalidate())}async function y(e){await fetch(`/api/agents/${e}/unarchive`,{method:`POST`}),await _.invalidate()}async function b(t){if(!confirm(`permanently delete this agent and all its data?`))return;let n=e.find(e=>e.id===t);if(!n)return;let r=await fetch(`/api/teams/${encodeURIComponent(n.teamId)}/policy`);if(!r.ok)return;let i=await r.json();await fetch(`/api/agents/${encodeURIComponent(t)}?expectedTeamRevision=${i.teamPolicy.revision}`,{method:`DELETE`}),await _.invalidate()}return(0,p.jsxs)(c,{size:`wide`,children:[(0,p.jsx)(s,{eyebrow:`Workspace`,title:`Agents`,description:`Spawn, inspect, archive, and restore the agents that work across your teams.`,actions:(0,p.jsx)(d,{variant:`ghost`,onClick:()=>window.location.assign(g?`/agents`:`/agents?all=1`),children:g?`Hide archived`:`Show archived`})}),(0,p.jsx)(h,{profiles:t,teams:n,modelGroups:f,onSpawned:_.invalidate}),(0,p.jsx)(o,{title:g?`All agents`:`Current agents`,description:g?`Active and archived agents are shown together.`:`Archived agents stay hidden until you choose to show them.`,children:e.length===0?(0,p.jsx)(l,{title:g?`No agents yet`:`No current agents`,description:`Spawn an agent above to give a team its first working member.`}):(0,p.jsx)(`div`,{className:`overflow-x-auto`,children:(0,p.jsxs)(`table`,{className:`min-w-[760px]`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsxs)(`tr`,{children:[(0,p.jsx)(`th`,{children:`ID`}),(0,p.jsx)(`th`,{children:`Name`}),(0,p.jsx)(`th`,{children:`Agent template`}),(0,p.jsx)(`th`,{children:`Status`}),(0,p.jsx)(`th`,{children:(0,p.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,p.jsx)(`tbody`,{children:e.map(e=>(0,p.jsxs)(`tr`,{children:[(0,p.jsx)(`td`,{children:(0,p.jsx)(`a`,{href:`/agents/${e.id}`,title:e.id,children:(0,p.jsxs)(`code`,{children:[e.id.slice(0,8),`…`]})})}),(0,p.jsx)(`td`,{children:(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(u,{identity:e.identity,size:26}),(0,p.jsxs)(`div`,{className:`leading-tight`,children:[(0,p.jsx)(`div`,{children:e.name}),(e.identity?.creature||e.identity?.vibe)&&(0,p.jsx)(`div`,{className:`muted text-[0.8em]`,children:[e.identity?.creature,e.identity?.vibe].filter(Boolean).join(` · `)})]})]})}),(0,p.jsx)(`td`,{children:(0,p.jsx)(`code`,{children:e.profileId})}),(0,p.jsx)(`td`,{children:(0,p.jsx)(a,{variant:e.status===`archived`?`warning`:`success`,children:e.status})}),(0,p.jsx)(`td`,{children:(0,p.jsxs)(`div`,{className:`flex justify-end gap-1.5`,children:[e.status===`archived`?(0,p.jsx)(d,{variant:`ghost`,onClick:()=>y(e.id),children:`Restore`}):(0,p.jsx)(d,{variant:`ghost`,onClick:()=>v(e.id),children:`Archive`}),(0,p.jsx)(d,{variant:`danger`,onClick:()=>b(e.id),children:`Delete`})]})})]},e.id))})]})})})]})}function h({profiles:e,teams:t,modelGroups:n,onSpawned:r}){let[i,a]=(0,f.useState)(``),[s,c]=(0,f.useState)(``),[l,u]=(0,f.useState)(``),[m,h]=(0,f.useState)(t.find(e=>e.id==="default")?.id??``),[g,_]=(0,f.useState)(`profile_defaults`),[v,y]=(0,f.useState)(!1),[b,x]=(0,f.useState)(null);async function S(e){if(e.preventDefault(),!i){x(`profile is required`);return}y(!0),x(null);try{let e={profile:i};if(s&&(e.name=s),l&&(e.model=l),m){let t=await fetch(`/api/teams/${encodeURIComponent(m)}/policy`);if(!t.ok)throw Error(`The selected Team policy is unavailable.`);let n=await t.json();e.teamId=m,e.teamExpectedRevision=n.teamPolicy.revision,e.placement=g}let t=await fetch(`/api/agents`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error??t.statusText)}await t.json(),c(``),u(``),r()}catch(e){x(e.message)}finally{y(!1)}}return(0,p.jsx)(o,{title:`Spawn an agent`,description:`Skills come from the Agent template at spawn time. You can adjust an agent's skills later from its detail page.`,children:(0,p.jsxs)(`form`,{onSubmit:S,children:[b&&(0,p.jsx)(`div`,{className:`err`,children:b}),(0,p.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,p.jsxs)(`label`,{children:[`Agent template`,(0,p.jsxs)(`select`,{value:i,onChange:e=>a(e.target.value),required:!0,children:[(0,p.jsx)(`option`,{value:``,children:`Select a template`}),e.map(e=>(0,p.jsx)(`option`,{value:e.id,children:e.id},e.id))]})]}),(0,p.jsxs)(`label`,{children:[`Name`,(0,p.jsx)(`input`,{value:s,onChange:e=>c(e.target.value)})]}),(0,p.jsxs)(`label`,{children:[`Model override`,n.length===0?(0,p.jsx)(`input`,{value:``,disabled:!0,placeholder:`Uses the template default — enable models in Config`}):(0,p.jsxs)(`select`,{value:l,onChange:e=>u(e.target.value),children:[(0,p.jsx)(`option`,{value:``,children:`Use the template default`}),n.map(e=>(0,p.jsx)(`optgroup`,{label:e.provider,children:e.models.map(t=>(0,p.jsx)(`option`,{value:`${e.provider}:${t}`,children:`${e.provider}:${t}`},t))},e.provider))]})]}),(0,p.jsxs)(`label`,{children:[`Team`,t.length===0?(0,p.jsx)(`select`,{disabled:!0,children:(0,p.jsx)(`option`,{children:`No teams — register one in Teams`})}):(0,p.jsx)(`select`,{value:m,onChange:e=>h(e.target.value),children:t.map(e=>(0,p.jsxs)(`option`,{value:e.id,children:[e.id,` (`,e.name,`)`]},e.id))})]}),(0,p.jsxs)(`label`,{className:`sm:col-span-2`,children:[`Initial policy placement`,(0,p.jsxs)(`select`,{value:g,onChange:e=>_(e.target.value),children:[(0,p.jsx)(`option`,{value:`profile_defaults`,children:`Agent-template defaults`}),(0,p.jsx)(`option`,{value:`isolated`,children:`Isolated`})]}),(0,p.jsx)(`span`,{className:`muted mt-1 block text-xs`,children:`Submission uses the latest displayed Team revision. A concurrent policy change is shown as a conflict and is never overwritten.`})]})]}),(0,p.jsx)(`div`,{className:`mt-4`,children:(0,p.jsx)(d,{variant:`primary`,type:`submit`,disabled:v,children:v?`Spawning…`:`Spawn agent`})})]})})}export{m as component};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{b as r}from"./index-3nrK5iFr.js";import{a as i,i as a,n as o,r as s,t as c}from"./Page-CwNuDhWz.js";import{t as l}from"./Button-ByiV6fpd.js";var u=e(n()),d=t();function f(){let[e,t]=(0,u.useState)(r.useLoaderData().approvals),[n,i]=(0,u.useState)(`pending`),[f,m]=(0,u.useState)(null),[h,v]=(0,u.useState)(!1),[b,x]=(0,u.useState)(null),S=e.filter(e=>n===`all`||e.status===n),C=async()=>{let e=await fetch(`/api/approvals?limit=100`);if(!e.ok)throw Error(`Could not refresh approvals (${e.status})`);t((await e.json()).approvals)},w=async e=>{let t=await fetch(`/api/approvals/${encodeURIComponent(e)}`);if(!t.ok)throw Error(`Could not load approval (${t.status})`);m(await t.json())},T=async e=>{if(f){v(!0),x(null);try{let t=await fetch(`/api/approvals/${encodeURIComponent(f.id)}/${e}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({reason:e===`deny`?`Denied by operator`:void 0})}),n=await t.json();if(!t.ok)throw Error(n.error??`Decision failed (${t.status})`);await C(),await w(f.id),x(e===`approve`?`Approved and delivered once.`:`Denied.`)}catch(e){x(e instanceof Error?e.message:String(e)),await C(),await w(f.id)}finally{v(!1)}}};return(0,d.jsxs)(s,{size:`wide`,children:[(0,d.jsx)(o,{eyebrow:`Policy operations`,title:`Communication approvals`,description:`One durable queue for policy-protected attempts. Approval authorizes only the captured attempt.`,actions:(0,d.jsxs)(`label`,{className:`m-0 block w-full text-sm sm:w-52`,children:[`Status`,(0,d.jsxs)(`select`,{value:n,onChange:e=>i(e.target.value),className:`mt-1`,children:[(0,d.jsx)(`option`,{value:`pending`,children:`Pending`}),(0,d.jsx)(`option`,{value:`all`,children:`All history`}),(0,d.jsx)(`option`,{value:`delivered`,children:`Delivered`}),(0,d.jsx)(`option`,{value:`denied`,children:`Denied`}),(0,d.jsx)(`option`,{value:`expired`,children:`Expired`}),(0,d.jsx)(`option`,{value:`cancelled`,children:`Cancelled`}),(0,d.jsx)(`option`,{value:`delivery_failed`,children:`Delivery failed`})]})]})}),(0,d.jsxs)(`div`,{className:`grid min-w-0 gap-5 lg:grid-cols-[minmax(0,1.15fr)_minmax(320px,0.85fr)]`,children:[(0,d.jsx)(a,{title:`Approval queue`,description:`${S.length} matching attempt${S.length===1?``:`s`}`,className:`min-w-0`,children:S.length===0?(0,d.jsx)(c,{title:`No matching approvals`,description:`Try another status filter or return when a protected attempt needs review.`}):(0,d.jsx)(`div`,{className:`overflow-x-auto`,children:(0,d.jsxs)(`table`,{className:`m-0 min-w-[680px]`,children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{children:[(0,d.jsx)(`th`,{children:`Status`}),(0,d.jsx)(`th`,{children:`Path`}),(0,d.jsx)(`th`,{children:`Origin`}),(0,d.jsx)(`th`,{children:`Expires`})]})}),(0,d.jsx)(`tbody`,{children:S.map(e=>(0,d.jsxs)(`tr`,{tabIndex:0,role:`button`,"aria-label":`Inspect ${e.attemptKind} approval`,"aria-current":f?.id===e.id?`true`:void 0,onClick:()=>void w(e.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),w(e.id))},className:`cursor-pointer ${f?.id===e.id?`bg-accent/60`:``}`,children:[(0,d.jsx)(`td`,{children:(0,d.jsx)(p,{value:e.status})}),(0,d.jsxs)(`td`,{className:`min-w-56`,children:[g(e.source),` → `,g(e.target)]}),(0,d.jsx)(`td`,{children:e.origin}),(0,d.jsx)(`td`,{className:`whitespace-nowrap`,children:(0,d.jsx)(`time`,{dateTime:new Date(e.expiresAt).toISOString(),children:y(e.expiresAt)})})]},e.id))})]})})}),(0,d.jsx)(`aside`,{className:`min-w-0`,"aria-label":`Approval details`,children:(0,d.jsx)(a,{title:`Attempt details`,actions:f?(0,d.jsx)(p,{value:f.status}):void 0,children:f?(0,d.jsxs)(`div`,{className:`space-y-5`,children:[(0,d.jsxs)(`dl`,{className:`grid gap-3 text-sm sm:grid-cols-2 lg:grid-cols-1 xl:grid-cols-2`,children:[(0,d.jsx)(_,{label:`Attempt`,value:`${f.attemptKind}:${f.attemptId}`}),(0,d.jsx)(_,{label:`Operation`,value:f.operation}),(0,d.jsx)(_,{label:`Path`,value:`${g(f.source)} → ${g(f.target)}`}),(0,d.jsx)(_,{label:`Policy`,value:f.policyRefs.map(e=>`${e.teamId}@${e.revision}`).join(`, `)}),(0,d.jsx)(_,{label:`Expires`,value:y(f.expiresAt)})]}),(0,d.jsxs)(`details`,{className:`rounded-lg border border-border bg-muted/30 p-3`,children:[(0,d.jsx)(`summary`,{className:`cursor-pointer text-sm font-semibold`,children:`Sensitive payload`}),(0,d.jsx)(`pre`,{className:`mt-3 max-h-48 overflow-auto rounded-lg bg-background p-3 text-xs`,children:JSON.stringify(f.payload,null,2)})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h3`,{className:`m-0 font-body text-sm font-semibold text-foreground`,children:`Audit history`}),(0,d.jsx)(`ol`,{className:`mt-2 divide-y divide-border rounded-lg border border-border text-xs`,children:f.events.map(e=>(0,d.jsxs)(`li`,{className:`px-3 py-2 leading-5`,children:[y(e.createdAt),` · `,e.event,` · `,e.actor]},e.id))})]}),b&&(0,d.jsx)(`p`,{role:`status`,className:`rounded-lg bg-muted px-3 py-2 text-sm`,children:b}),f.status===`pending`&&(0,d.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,d.jsx)(l,{variant:`primary`,disabled:h,onClick:()=>void T(`approve`),children:`Approve once`}),(0,d.jsx)(l,{variant:`danger`,disabled:h,onClick:()=>void T(`deny`),children:`Deny`})]})]}):(0,d.jsx)(c,{title:`No attempt selected`,description:`Select an attempt from the queue to inspect its policy and audit history.`,className:`min-h-56`})})})]})]})}function p({value:e}){return(0,d.jsx)(i,{variant:m(e),children:h(e)})}function m(e){switch(e){case`pending`:return`warning`;case`approved`:case`delivering`:return`info`;case`delivered`:return`success`;case`denied`:case`delivery_failed`:return`danger`;case`expired`:case`cancelled`:return`neutral`}}function h(e){let t=e.replaceAll(`_`,` `);return`${t.charAt(0).toUpperCase()}${t.slice(1)}`}function g(e){return e.kind===`agent`?`Agent ${e.id}`:e.kind===`user`?`User`:`Outside ${e.teamId}`}function _({label:e,value:t}){return(0,d.jsxs)(`div`,{className:`rounded-lg bg-muted/40 p-3`,children:[(0,d.jsx)(`dt`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:e}),(0,d.jsx)(`dd`,{className:`mt-1 break-all text-foreground`,children:t})]})}var v=new Intl.DateTimeFormat(`en-GB`,{dateStyle:`medium`,timeStyle:`medium`,timeZone:`UTC`});function y(e){return`${v.format(new Date(e))} UTC`}export{f as component};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{a as r}from"./preload-helper-mNuBjNXU.js";import{x as i}from"./index-3nrK5iFr.js";import{a,i as o,n as s,r as c,t as l}from"./Page-CwNuDhWz.js";import{t as u}from"./Button-ByiV6fpd.js";var d=e(n()),f=t();function p(){let e=i.useLoaderData(),[t,n]=(0,d.useState)(e.list.items),[p,h]=(0,d.useState)(e.list.degraded),[g,_]=(0,d.useState)(e.summary),[v,y]=(0,d.useState)(`open`),[b,x]=(0,d.useState)(`all`),[S,C]=(0,d.useState)(`all`),[w,T]=(0,d.useState)(null),[E,D]=(0,d.useState)(null),O=(0,d.useMemo)(()=>t.filter(e=>(v===`all`||(v===`open`?e.acknowledgedAt===null:e.acknowledgedAt!==null))&&(b===`all`||e.kind===b)&&(S===`all`||e.severity===S)),[t,b,S,v]);async function k(){let[e,t]=await Promise.all([fetch(`/api/attention?state=all&limit=200`),fetch(`/api/attention/summary`)]);if(!e.ok||!t.ok)throw Error(`Could not refresh the Attention Center`);let r=await e.json();n(r.items),h(r.degraded),_(await t.json())}async function A(e,t){T(e.key),D(null);try{let n=await fetch(`/api/attention/${encodeURIComponent(e.key)}/${t?`acknowledge`:`acknowledgement`}`,{method:t?`POST`:`DELETE`}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.error??`Update failed (${n.status})`);await k()}catch(e){D(e instanceof Error?e.message:String(e)),await k().catch(()=>{})}finally{T(null)}}async function j(){T(`all`),D(null);try{let e=await fetch(`/api/attention/acknowledge-all`,{method:`POST`}),t=await e.json();if(!e.ok)throw Error(t.error??`Acknowledgement failed`);D(`Acknowledged ${t.acknowledged} informational item(s). Approvals and lessons were left open.`),await k()}catch(e){D(e instanceof Error?e.message:String(e))}finally{T(null)}}return(0,f.jsxs)(c,{size:`wide`,children:[(0,f.jsx)(s,{eyebrow:`Operations`,title:`Attention Center`,description:`One queue for decisions and terminal signals. Resolve action-required work at its canonical source; acknowledge informational failures here.`,actions:(0,f.jsx)(u,{variant:`ghost`,disabled:w!==null,onClick:()=>void j(),children:`Acknowledge all informational items`})}),(0,f.jsxs)(`div`,{className:`mb-5 grid gap-3 sm:grid-cols-3`,children:[(0,f.jsx)(m,{label:`Open`,value:g.openTotal}),(0,f.jsx)(m,{label:`Action required`,value:g.bySeverity.action_required}),(0,f.jsx)(m,{label:`Errors and warnings`,value:g.bySeverity.error+g.bySeverity.warning})]}),(p.length>0||g.degraded.length>0)&&(0,f.jsxs)(`div`,{role:`alert`,className:`mb-5 rounded-lg border border-coral/40 bg-coral/10 p-4 text-sm`,children:[(0,f.jsx)(`strong`,{children:`Partial results.`}),` `,[...new Set([...p,...g.degraded].map(e=>e.kind))].join(`, `),` could not be loaded.`]}),E&&(0,f.jsx)(`p`,{role:`status`,className:`mb-5 rounded-lg bg-muted px-4 py-3 text-sm`,children:E}),(0,f.jsx)(o,{title:`Queue`,description:`${O.length} matching item${O.length===1?``:`s`}`,actions:(0,f.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,f.jsxs)(`select`,{"aria-label":`Queue state`,value:v,onChange:e=>y(e.target.value),children:[(0,f.jsx)(`option`,{value:`open`,children:`Open`}),(0,f.jsx)(`option`,{value:`acknowledged`,children:`History`}),(0,f.jsx)(`option`,{value:`all`,children:`All`})]}),(0,f.jsxs)(`select`,{"aria-label":`Severity`,value:S,onChange:e=>C(e.target.value),children:[(0,f.jsx)(`option`,{value:`all`,children:`All severities`}),(0,f.jsx)(`option`,{value:`action_required`,children:`Action required`}),(0,f.jsx)(`option`,{value:`error`,children:`Errors`}),(0,f.jsx)(`option`,{value:`warning`,children:`Warnings`})]}),(0,f.jsxs)(`select`,{"aria-label":`Kind`,value:b,onChange:e=>x(e.target.value),children:[(0,f.jsx)(`option`,{value:`all`,children:`All kinds`}),(0,f.jsx)(`option`,{value:`communication_approval`,children:`Approvals`}),(0,f.jsx)(`option`,{value:`lesson_proposal`,children:`Lessons`}),(0,f.jsx)(`option`,{value:`review_failure`,children:`Review failures`}),(0,f.jsx)(`option`,{value:`trigger_failure`,children:`Trigger failures`}),(0,f.jsx)(`option`,{value:`agent_loop_break`,children:`Loop breaks`})]})]}),children:O.length===0?(0,f.jsx)(l,{title:v===`open`?`Nothing needs attention`:`No matching history`,description:`The queue updates from Bazilion's canonical approvals, learning, triggers, and loop diagnostics.`}):(0,f.jsx)(`div`,{className:`grid gap-3`,children:O.map(e=>(0,f.jsx)(`article`,{className:`rounded-lg border border-border p-4`,children:(0,f.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,f.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,f.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,f.jsx)(a,{variant:e.severity===`action_required`?`warning`:e.severity===`error`?`danger`:`info`,children:e.severity.replace(`_`,` `)}),(0,f.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.kind.replaceAll(`_`,` `)})]}),(0,f.jsx)(`h3`,{className:`mt-2 text-base`,children:e.title}),(0,f.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:e.diagnostic}),(0,f.jsxs)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:[[e.agentName,e.teamName].filter(Boolean).join(` · `)||`System`,` · `,(0,f.jsx)(`time`,{dateTime:new Date(e.occurredAt).toISOString(),children:new Date(e.occurredAt).toLocaleString()})]})]}),(0,f.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[(0,f.jsx)(r,{to:e.href,className:`btn-primary`,children:e.kind===`communication_approval`?`Review approval`:e.kind===`lesson_proposal`?`Review lesson`:`Inspect source`}),e.acknowledgeable&&(0,f.jsx)(u,{variant:`ghost`,disabled:w===e.key,onClick:()=>void A(e,e.acknowledgedAt===null),children:e.acknowledgedAt===null?`Acknowledge`:`Restore to open`})]})]})},e.key))})})]})}function m({label:e,value:t}){return(0,f.jsxs)(`div`,{className:`card p-4`,children:[(0,f.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground`,children:e}),(0,f.jsx)(`div`,{className:`mt-1 text-2xl font-semibold`,children:t})]})}export{p as component};
@@ -1 +0,0 @@
1
- import{A as e}from"./index-3nrK5iFr.js";var t=e(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]);export{t};
@@ -1,3 +0,0 @@
1
- import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-mNuBjNXU.js";import{S as i}from"./index-3nrK5iFr.js";import{t as a}from"./ConfigPage-BCwfgyjD.js";import{t as o}from"./FieldRow-avAFLgYW.js";var s=e(n()),c=t();function l(){let{providers:e,openaiCodex:t}=i.useLoaderData(),n=e.some(e=>e.enabled&&e.curated.length>0);return(0,c.jsxs)(a,{active:`providers`,title:`Providers`,description:(0,c.jsx)(c.Fragment,{children:`Configure credentials, endpoints, and the curated model lists used by agent templates and running agents. Secrets are encrypted; URLs and IDs remain inspectable configuration.`}),children:[!n&&(0,c.jsx)(u,{providers:e,openaiCodex:t}),(0,c.jsx)(`div`,{className:`space-y-3`,children:e.map(e=>(0,c.jsx)(d,{p:e,openaiCodexStatus:e.id===`openai-codex`?t:void 0},e.id))})]})}function u({providers:e,openaiCodex:t}){let n=[];for(let r of e)r.enabled&&(r.id===`openai-codex`&&!t.connected&&n.push(`${r.id}: enabled but ChatGPT is not connected — click "Connect ChatGPT" below`),r.curated.length===0&&n.push(`${r.id}: enabled but no curated models — add at least one name in the "curated models" box below and save`));let r=e.filter(e=>e.enabled).length;return(0,c.jsxs)(`div`,{className:`rounded-md border-2 border-warning/25 bg-warning/10 px-4 py-3 text-sm`,children:[(0,c.jsx)(`div`,{className:`font-semibold text-warning mb-1`,children:`First-run setup is not complete`}),(0,c.jsxs)(`p`,{className:`text-warning mb-2`,children:[`The rest of the app stays on the Welcome screen until at least one provider is`,` `,(0,c.jsx)(`strong`,{children:`enabled`}),` and has `,(0,c.jsx)(`strong`,{children:`at least one curated model`}),`. Use a catalog chip when one is available, or paste the exact model id from your local/server provider.`]}),n.length>0?(0,c.jsx)(`ul`,{className:`list-disc pl-5 text-warning space-y-0.5`,children:n.map(e=>(0,c.jsx)(`li`,{children:e},e))}):r===0?(0,c.jsx)(`p`,{className:`text-warning`,children:`No providers are enabled yet — pick one below, flip the toggle on, set credentials, and save at least one model name.`}):null]})}function d({p:e,openaiCodexStatus:t}){let n=r(),[i,a]=(0,s.useState)(e.enabled),[l,u]=(0,s.useState)(e.curated.join(`
2
- `)),[d,h]=(0,s.useState)(!1),[g,_]=(0,s.useState)(null);async function v(t){a(t);try{await fetch(`/api/config/providers/${encodeURIComponent(e.id)}/enabled`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({enabled:t})}),await n.invalidate()}catch{a(!t)}}async function y(t){t.preventDefault(),h(!0),_(null);try{let t=l.split(/\r?\n/).map(e=>e.trim()).filter(Boolean),r=await fetch(`/api/config/providers/${encodeURIComponent(e.id)}/models`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({models:t})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error??`${r.status} ${r.statusText}`)}_(`saved ✓`),await n.invalidate()}catch(e){_(`error: ${e.message}`)}finally{h(!1)}}return(0,c.jsxs)(`section`,{className:`overflow-hidden rounded-lg border bg-card`,children:[(0,c.jsxs)(`header`,{className:`flex flex-wrap items-center gap-3 px-4 py-3`,children:[(0,c.jsx)(`span`,{className:`font-mono font-semibold`,children:e.id}),(0,c.jsxs)(`span`,{className:`text-muted-foreground text-sm`,children:[`· `,e.displayName]}),(0,c.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs uppercase tracking-wide font-semibold cursor-pointer`,children:[(0,c.jsx)(`input`,{type:`checkbox`,checked:i,onChange:e=>v(e.target.checked),className:`size-4`}),(0,c.jsx)(`span`,{className:i?`text-success`:`text-muted-foreground`,children:i?`enabled`:`disabled`})]}),(0,c.jsxs)(`span`,{className:`w-full text-xs text-muted-foreground sm:ml-auto sm:w-auto`,children:[e.curated.length>0&&(0,c.jsxs)(`span`,{children:[e.curated.length,` curated`]}),e.catalog.length>0&&(0,c.jsxs)(`span`,{children:[` · `,e.catalog.length,` catalog`]}),e.live&&!e.live.error&&(0,c.jsxs)(`span`,{children:[` · `,e.live.models.length,` live`]})]})]}),i&&(0,c.jsxs)(`div`,{className:`border-t border-dashed px-4 py-3`,children:[e.hint&&(0,c.jsx)(`p`,{className:`text-xs text-muted-foreground mb-2`,children:e.hint}),e.id===`openai-codex`&&t&&(0,c.jsx)(m,{status:t}),e.fields.length===0&&e.envHint&&e.id!==`openai-codex`&&(0,c.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Credentials come from the process env: `,(0,c.jsx)(`code`,{className:`font-mono`,children:e.envHint})]}),e.fields.map(e=>(0,c.jsx)(o,{field:e},e.envVar)),(0,c.jsx)(`h4`,{className:`mt-4 mb-1 text-xs uppercase tracking-wide text-muted-foreground`,children:`curated models (one per line)`}),e.curated.length===0&&(0,c.jsxs)(`p`,{className:`mb-2 text-xs font-medium text-warning`,children:[`First-run setup needs at least one model name here — type one (e.g.`,` `,(0,c.jsx)(`code`,{className:`font-mono`,children:f(e.id)}),`) and click`,` `,(0,c.jsx)(`em`,{children:`save models`}),`. Catalog chips below are the safest source when available.`]}),(0,c.jsxs)(`form`,{onSubmit:y,children:[(0,c.jsx)(`textarea`,{value:l,onChange:e=>u(e.target.value),rows:Math.max(3,Math.min(8,l.split(`
3
- `).length)),className:`w-full rounded-md border bg-background px-2 py-1.5 font-mono text-sm outline-none focus:ring-2 focus:ring-ring/30`,placeholder:e.catalog.length===0&&!e.live?`Type model names one per line, e.g. qwen3-coder-30b`:`Click catalog chips below, or type names one per line`}),(0,c.jsxs)(`div`,{className:`flex items-center gap-3 mt-2`,children:[(0,c.jsx)(`button`,{type:`submit`,disabled:d,className:`rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground disabled:opacity-50`,children:`save models`}),g&&(0,c.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:g})]})]}),e.catalog.length>0&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`h4`,{className:`mt-4 mb-1 text-xs uppercase tracking-wide text-muted-foreground`,children:`catalog`}),(0,c.jsx)(p,{items:e.catalog,onPick:e=>u(t=>t.includes(e)?t:`${t}\n${e}`.trim())})]}),e.live&&!e.live.error&&e.live.models.length>0&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`h4`,{className:`mt-4 mb-1 text-xs uppercase tracking-wide text-muted-foreground`,children:`live`}),(0,c.jsx)(p,{items:e.live.models,onPick:e=>u(t=>t.includes(e)?t:`${t}\n${e}`.trim())})]}),e.live?.error&&(0,c.jsxs)(`p`,{className:`text-xs text-danger mt-2`,children:[`could not fetch: `,e.live.error]})]})]})}function f(e){switch(e){case`openai-codex`:return`gpt-5.6-luna`;case`openai`:return`gpt-5.6-luna`;case`anthropic`:return`claude-opus-5`;case`google`:return`gemini-3.6-flash`;case`google-vertex`:return`gemini-3.6-flash`;case`xai`:return`grok-4.5`;case`groq`:return`llama-3.3-70b-versatile`;case`cerebras`:return`zai-glm-4.7`;case`mistral`:return`mistral-large-latest`;case`zai`:return`glm-5.2`;case`huggingface`:return`Qwen/Qwen3.5-397B-A17B`;case`openrouter`:return`anthropic/claude-opus-5`;case`vercel-ai-gateway`:return`anthropic/claude-opus-5`;case`deepseek`:return`deepseek-v4-pro`;case`fireworks`:return`accounts/fireworks/models/kimi-k3`;case`together`:return`moonshotai/Kimi-K3`;case`moonshotai`:return`kimi-k3`;case`moonshotai-cn`:return`kimi-k3`;case`kimi-coding`:return`kimi-for-coding`;case`minimax`:return`MiniMax-M2.7`;case`minimax-cn`:return`MiniMax-M3`;case`qwen-token-plan`:case`qwen-token-plan-cn`:return`qwen3.8-max-preview`;case`ant-ling`:return`Ling-2.6-1T`;case`nvidia`:return`nvidia/nemotron-3-super-120b-a12b`;case`cloudflare-workers-ai`:return`@cf/moonshotai/kimi-k2.6`;case`cloudflare-ai-gateway`:return`claude-opus-5`;case`github-copilot`:return`claude-opus-5`;case`xiaomi`:return`mimo-v2.5`;case`xiaomi-token-plan-ams`:case`xiaomi-token-plan-cn`:case`xiaomi-token-plan-sgp`:return`mimo-v2.5-pro`;case`opencode`:return`claude-opus-5`;case`opencode-go`:return`kimi-k2.7-code`;case`zai-coding-cn`:return`glm-5.2`;case`azure-openai`:return`gpt-5.6-luna`;case`bedrock`:return`global.anthropic.claude-opus-5`;case`ollama`:return`llama3.3`;case`lmstudio`:return`qwen3-coder-30b`;case`llamacpp`:return`unsloth/Qwen3.6-35B-A3B-MTP-GGUF:MXFP4_MOE`;default:return`model-name`}}function p({items:e,onPick:t}){return(0,c.jsx)(`div`,{className:`flex flex-wrap gap-1.5 max-h-40 overflow-y-auto rounded-md border bg-background p-1.5`,children:e.map(e=>(0,c.jsx)(`button`,{type:`button`,onClick:()=>t(e),className:`rounded border bg-card px-2 py-0.5 font-mono text-xs hover:border-primary hover:bg-accent`,children:e},e))})}function m({status:e}){let t=r(),[n,i]=(0,s.useState)(!1),[a,o]=(0,s.useState)(null);async function l(){i(!0),o(null);try{let e=await fetch(`/api/auth/openai/login`,{method:`POST`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error??`${e.status} ${e.statusText}`)}await t.invalidate()}catch(e){o(e.message)}finally{i(!1)}}async function u(){i(!0),o(null);try{await fetch(`/api/auth/openai`,{method:`DELETE`}),await t.invalidate()}catch(e){o(e.message)}finally{i(!1)}}return(0,c.jsxs)(`div`,{className:`rounded-md border bg-muted/30 p-3 mb-3`,children:[e.connected?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(`div`,{className:`flex flex-wrap gap-2 items-center mb-2`,children:[(0,c.jsx)(`span`,{className:`rounded-full bg-success/10 text-success px-2 py-0.5 text-xs font-semibold uppercase`,children:`connected`}),e.accountId&&(0,c.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`account `,(0,c.jsx)(`code`,{className:`font-mono`,children:e.accountId})]}),e.expiresAt&&(0,c.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`token expires`,` `,new Date(e.expiresAt).toISOString().replace(/\.\d+Z$/,`Z`)]})]}),(0,c.jsx)(`button`,{type:`button`,onClick:u,disabled:n,className:`rounded-md border px-3 py-1.5 text-sm text-danger hover:bg-danger/10 disabled:opacity-50`,children:`disconnect`})]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(`p`,{className:`text-xs text-muted-foreground mb-2`,children:[`Sign in with your ChatGPT account — the OAuth flow opens a new browser tab. The loopback callback at `,(0,c.jsx)(`code`,{className:`font-mono`,children:`localhost:1455`}),` only works when you're using the web UI on the same machine as the daemon. For remote setups, run `,(0,c.jsx)(`code`,{className:`font-mono`,children:`bazilion auth openai login`}),` on the client.`]}),(0,c.jsx)(`button`,{type:`button`,onClick:l,disabled:n,className:`rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground disabled:opacity-50`,children:n?`opening browser…`:`Connect ChatGPT →`})]}),a&&(0,c.jsx)(`p`,{className:`text-sm text-danger mt-2`,children:a})]})}export{l as component};
@@ -1 +0,0 @@
1
- import{t as e}from"./jsx-runtime-DGeXAQPT.js";import{c as t}from"./index-3nrK5iFr.js";import{r as n}from"./Page-CwNuDhWz.js";import{t as r}from"./TeamTabs-DvqWieCq.js";var i=e();function a(){let e=t.useLoaderData();return(0,i.jsxs)(n,{children:[(0,i.jsx)(`h1`,{children:`Team context`}),(0,i.jsx)(`p`,{className:`muted`,children:`Workspace, operator context, and integrations owned by this Team.`}),(0,i.jsx)(r,{teamId:e.id}),(0,i.jsxs)(`section`,{className:`card`,children:[(0,i.jsxs)(`dl`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`dt`,{className:`muted`,children:`workspace path`}),(0,i.jsx)(`dd`,{children:(0,i.jsx)(`code`,{children:e.path})})]}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`dt`,{className:`muted`,children:`Telegram topic format`}),(0,i.jsx)(`dd`,{children:(0,i.jsx)(`code`,{children:e.telegramTopicNameFormat??`built-in naming`})})]}),(0,i.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,i.jsx)(`dt`,{className:`muted`,children:`USER.md`}),(0,i.jsx)(`dd`,{className:`mt-2 whitespace-pre-wrap rounded-md border border-frost bg-ivory p-3 text-sm`,children:e.userMd||`No operator context configured.`})]})]}),(0,i.jsx)(`p`,{className:`mt-4 text-sm text-mocha`,children:`Edit USER.md and Telegram naming from Overview during this transition. This route is the canonical context projection.`})]})]})}export{a as component};