bazilion 0.17.0 → 0.18.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.
- package/dist/cli.js +336 -67
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +1770 -151
- package/dist/daemon.js.map +1 -1
- package/dist/migrations/0001_init.sql +107 -0
- package/dist/web/client/assets/{ChatPane-BI3QVX2A.js → ChatPane-CAYS_fIQ.js} +1 -1
- package/dist/web/client/assets/ConfirmDialog-BzIiABOP.js +1 -0
- package/dist/web/client/assets/{FieldRow-swJ5qn2h.js → FieldRow-W_54rw5c.js} +1 -1
- package/dist/web/client/assets/{ProductionTeamPolicyEditor-LGw1UuF-.js → ProductionTeamPolicyEditor-DNXVX8Lz.js} +2 -2
- package/dist/web/client/assets/{ProfileCommunicationEditor-raoau_YB.js → ProfileCommunicationEditor-DN0fOzqn.js} +1 -1
- package/dist/web/client/assets/{ResultSourceConversation-BEwkhFog.js → ResultSourceConversation-DoU4tOWc.js} +1 -1
- package/dist/web/client/assets/TeamTabs-BmTZRI4T.js +1 -0
- package/dist/web/client/assets/{TemplatesTabs-BX5hhEJ7.js → TemplatesTabs-Bs_OXKwx.js} +1 -1
- package/dist/web/client/assets/{UnsavedChangesGuard-CVJtmR1D.js → UnsavedChangesGuard-CPRtFReU.js} +1 -1
- package/dist/web/client/assets/{_id-DmEVZIlx.js → _id-CxAB4TDr.js} +1 -1
- package/dist/web/client/assets/{_id-DHqq2W34.js → _id-DL4tJFQB.js} +1 -1
- package/dist/web/client/assets/{_id-BQPOE3gj.js → _id-DR9eFC17.js} +1 -1
- package/dist/web/client/assets/{_id-BkYrUP0R.js → _id-Dbmei5tg.js} +1 -1
- package/dist/web/client/assets/{_id-CriixlZD.js → _id-ybF-pqmr.js} +1 -1
- package/dist/web/client/assets/{activity-Bzr8R18n.js → activity-oUyy77jD.js} +1 -1
- package/dist/web/client/assets/{agents-13oafeOA.js → agents-D_TrEqAg.js} +1 -1
- package/dist/web/client/assets/{agents-DF4NALmJ.js → agents-DkjJp7JP.js} +1 -1
- package/dist/web/client/assets/{approvals-DsG0Ijls.js → approvals-DhOerWdt.js} +1 -1
- package/dist/web/client/assets/{attention-DG7K25mz.js → attention-DGwiF-Jy.js} +1 -1
- package/dist/web/client/assets/chevron-right-DSa4xPTs.js +1 -0
- package/dist/web/client/assets/{config-DAaDbFhS.js → config-BJ2ZzHPR.js} +1 -1
- package/dist/web/client/assets/{inbox-C9e7QjsX.js → inbox-BUElnGep.js} +1 -1
- package/dist/web/client/assets/{index-Dsstm2hf.js → index-Bi-HxcPG.js} +2 -2
- package/dist/web/client/assets/{learning-23arTd21.js → learning-BiTHNwB3.js} +1 -1
- package/dist/web/client/assets/login-BmcZvAH2.js +1 -0
- package/dist/web/client/assets/{mcp-Cdx9qAl8.js → mcp-Cwk9V82W.js} +1 -1
- package/dist/web/client/assets/{members-fotOz4rR.js → members-CHDNabFh.js} +1 -1
- package/dist/web/client/assets/{memory-C7UznVot.js → memory-Cx_Fpd4e.js} +1 -1
- package/dist/web/client/assets/{policy-CactLW1X.js → policy-C0nMdwcG.js} +1 -1
- package/dist/web/client/assets/{results-DqEuYnQH.js → results-Bz3jASs-.js} +1 -1
- package/dist/web/client/assets/{review-CnBSYclb.js → review-AK9WGmpv.js} +1 -1
- package/dist/web/client/assets/routes-DsMY_6oy.js +1 -0
- package/dist/web/client/assets/{services-xEANwZAu.js → services-DItA6fJ7.js} +1 -1
- package/dist/web/client/assets/{skills-CamV6wYM.js → skills-DbNV2vgL.js} +1 -1
- package/dist/web/client/assets/{teams-B12dMSjW.js → teams-D83scDxw.js} +1 -1
- package/dist/web/client/assets/{teams-CbH43zSG.js → teams-DAny1ypN.js} +1 -1
- package/dist/web/client/assets/{telegram-muIql4u-.js → telegram-BOmf9vUh.js} +1 -1
- package/dist/web/client/assets/{tokens-DGFmApdF.js → tokens-DBGH6Bw5.js} +1 -1
- package/dist/web/client/assets/{triggers-D8n3sCBW.js → triggers-D1_pseI3.js} +1 -1
- package/dist/web/client/assets/verifications-CBTo-FyV.js +2 -0
- package/dist/web/client/assets/{welcome-CMHWRZhs.js → welcome-DAfPOm15.js} +1 -1
- package/dist/web/client/assets/{x-BGCHwZOH.js → x-CWY-gUaM.js} +1 -1
- package/dist/web/server/assets/{TeamTabs-DQXh-3ij.js → TeamTabs-Dg4v6x0-.js} +4 -0
- package/dist/web/server/assets/{_id-DDyA9CGX.js → _id--onriuvj.js} +1 -1
- package/dist/web/server/assets/{_id-XkxlX036.js → _id--zoh1vv7.js} +1 -1
- package/dist/web/server/assets/{_id-Dw3gKOGv.js → _id-6p-mDmI8.js} +1 -1
- package/dist/web/server/assets/{_id-CPfILjMa.js → _id-DptBl3X8.js} +1 -1
- package/dist/web/server/assets/{_id-DtJn-yzu.js → _id-EAjRXNbD.js} +2 -2
- package/dist/web/server/assets/{_id-DSPFJMzf.js → _id-dUnXL-My2.js} +1 -1
- package/dist/web/server/assets/{_tanstack-start-manifest_v-vOXRfKJD.js → _tanstack-start-manifest_v-B3M-dfRO.js} +90 -79
- package/dist/web/server/assets/{activity-pYQPT3QT.js → activity-C5jpoEQI.js} +1 -1
- package/dist/web/server/assets/{activity-BX1jZBPQ.js → activity-Cu7zKPGD.js} +1 -1
- package/dist/web/server/assets/{activity-bozPMU2v.js → activity-Dn50vkQP.js} +2 -2
- package/dist/web/server/assets/{agents-BKBfW700.js → agents-RE6aYOb-.js} +1 -1
- package/dist/web/server/assets/{agents-CVCfxnE2.js → agents-nAOx_H7s.js} +1 -1
- package/dist/web/server/assets/{approvals-C3ya6B6U.js → approvals-DhHxIDrL.js} +1 -1
- package/dist/web/server/assets/{attention-l28hGCHS.js → attention-CBWzWRni.js} +1 -1
- package/dist/web/server/assets/{auth-AvDFNeOv.js → auth-tB3i6cFd.js} +1 -1
- package/dist/web/server/assets/{config-BWKn4XII.js → config-D1k_tTAw.js} +1 -1
- package/dist/web/server/assets/{daemon-client-Cgx-YW4l.js → daemon-client-C7qjQ2iO.js} +15 -0
- package/dist/web/server/assets/{git-review-f_uta4Mx.js → git-review-Bf5ABFJg.js} +1 -1
- package/dist/web/server/assets/{inbox-BBZiOOQs.js → inbox-Dw4pTevh.js} +1 -1
- package/dist/web/server/assets/{learning-CheVay1i.js → learning-CF8ZzFVD.js} +1 -1
- package/dist/web/server/assets/{mcp-DCBDmNtQ.js → mcp-D5dmBT82.js} +1 -1
- package/dist/web/server/assets/{members-C5FQruRZ.js → members-Bd0OtiTr.js} +1 -1
- package/dist/web/server/assets/{members-C2He8mrU.js → members-CvwEN9pm.js} +1 -1
- package/dist/web/server/assets/{members-C_2xB9pr.js → members-xSXoYUOd.js} +2 -2
- package/dist/web/server/assets/{memory-rmiFNj7T.js → memory-CcPK7um7.js} +1 -1
- package/dist/web/server/assets/{memory-BTcmf0sD.js → memory-UP6AsRkO.js} +2 -2
- package/dist/web/server/assets/{memory-4tI-UbOf.js → memory-lo2vHRNw.js} +1 -1
- package/dist/web/server/assets/{policy-C3D2Q1EA.js → policy-B62WXIFo.js} +1 -1
- package/dist/web/server/assets/{policy-BGILKGHz.js → policy-Bze9Krhg.js} +2 -2
- package/dist/web/server/assets/{policy-DS7LGe--.js → policy-Dh6wd2wN.js} +1 -1
- package/dist/web/server/assets/{results-_6K_zXQS.js → results-BFqs2iOu.js} +1 -1
- package/dist/web/server/assets/{results-C6H42tjq.js → results-BWnu3gXP.js} +1 -1
- package/dist/web/server/assets/{results-Cgx7SrFt.js → results-CzZk50Fu.js} +2 -2
- package/dist/web/server/assets/{review-DHhiL-JQ.js → review-DUe3vHPU.js} +2 -2
- package/dist/web/server/assets/{review-DSTMCwP4.js → review-c_-cFi7H.js} +1 -1
- package/dist/web/server/assets/{router-ElARvZzI.js → router-Deq94UJQ.js} +33 -26
- package/dist/web/server/assets/{routes-BgMvLvS-.js → routes-CVKkvFVv.js} +1 -1
- package/dist/web/server/assets/{services-yHZroxsi.js → services-CEr61xb5.js} +1 -1
- package/dist/web/server/assets/{skills--bIKID1Q.js → skills-BImC3LTO.js} +1 -1
- package/dist/web/server/assets/{teams-BbRfuVXY.js → teams-8zEIo08E.js} +1 -1
- package/dist/web/server/assets/{teams--a956vWL.js → teams-D-yaAWLV.js} +1 -1
- package/dist/web/server/assets/{telegram-4kMxRtVZ.js → telegram-CGl_LFtJ.js} +1 -1
- package/dist/web/server/assets/{tokens-BYwTN9JZ.js → tokens-cB-uf7qm.js} +1 -1
- package/dist/web/server/assets/{triggers-BM6mzLuH.js → triggers-CtSj79L0.js} +1 -1
- package/dist/web/server/assets/verification-B5QjcpIo.js +97 -0
- package/dist/web/server/assets/verifications-BfQsfwSE.js +268 -0
- package/dist/web/server/assets/verifications-CUq_6ZqL.js +26 -0
- package/dist/web/server/server.js +51 -35
- package/dist/worker.js +178 -4
- package/dist/worker.js.map +1 -1
- package/package.json +3 -3
- package/dist/web/client/assets/ConfirmDialog-Qam6Ut08.js +0 -1
- package/dist/web/client/assets/TeamTabs-BDdTLGIf.js +0 -1
- package/dist/web/client/assets/chevron-right-DFqFHtLy.js +0 -1
- package/dist/web/client/assets/login-BIXnBsuj.js +0 -1
- package/dist/web/client/assets/routes-COxMuwVz.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bazilion",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Multi-agent runtime CLI — spawn LLM agents, manage profiles/teams/skills, and run the local daemon.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@types/adm-zip": "^0.5.8",
|
|
70
70
|
"@types/qrcode-terminal": "^0.12.2",
|
|
71
|
-
"@bazilion/api-types": "0.
|
|
72
|
-
"@bazilion/client": "0.
|
|
71
|
+
"@bazilion/api-types": "0.18.0",
|
|
72
|
+
"@bazilion/client": "0.18.0"
|
|
73
73
|
},
|
|
74
74
|
"scripts": {
|
|
75
75
|
"build": "pnpm --filter @bazilion/web build && tsup"
|
|
@@ -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,G as i,H as a,J as o,K as s,L as c,Q as l,R as u,U as d,V as f,W as p,Y as m,Z as h,q as g,z as _}from"./index-Dsstm2hf.js";import{t as v}from"./Button-ByiV6fpd.js";var y=e(n(),1),b=t(),x=`Dialog`,[S,C]=o(x),[w,T]=S(x),E=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,c=y.useRef(null),l=y.useRef(null),[u,d]=s({prop:r,defaultProp:i??!1,onChange:a,caller:x});return(0,b.jsx)(w,{scope:t,triggerRef:c,contentRef:l,contentId:p(),titleId:p(),descriptionId:p(),open:u,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(e=>!e),[d]),modal:o,children:n})};E.displayName=x;var D=`DialogTrigger`,O=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=T(D,n),a=l(t,i.triggerRef);return(0,b.jsx)(m.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":J(i.open),...r,ref:a,onClick:g(e.onClick,i.onOpenToggle)})});O.displayName=D;var k=`DialogPortal`,[A,j]=S(k,{forceMount:void 0}),M=e=>{let{__scopeDialog:t,forceMount:n,children:a,container:o}=e,s=T(k,t);return(0,b.jsx)(A,{scope:t,forceMount:n,children:y.Children.map(a,e=>(0,b.jsx)(i,{present:n||s.open,children:(0,b.jsx)(r,{asChild:!0,container:o,children:e})}))})};M.displayName=k;var N=`DialogOverlay`,P=y.forwardRef((e,t)=>{let n=j(N,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=T(N,e.__scopeDialog);return o.modal?(0,b.jsx)(i,{present:r||o.open,children:(0,b.jsx)(I,{...a,ref:t})}):null});P.displayName=N;var F=h(`DialogOverlay.RemoveScroll`),I=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=T(N,n),a=l(t,d());return(0,b.jsx)(u,{as:F,allowPinchZoom:!0,shards:[i.contentRef],children:(0,b.jsx)(m.div,{"data-state":J(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})}),L=`DialogContent`,R=y.forwardRef((e,t)=>{let n=j(L,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=T(L,e.__scopeDialog);return(0,b.jsx)(i,{present:r||o.open,children:o.modal?(0,b.jsx)(z,{...a,ref:t}):(0,b.jsx)(B,{...a,ref:t})})});R.displayName=L;var z=y.forwardRef((e,t)=>{let n=T(L,e.__scopeDialog),r=y.useRef(null),i=l(t,n.contentRef,r);return y.useEffect(()=>{let e=r.current;if(e)return c(e)},[]),(0,b.jsx)(V,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:g(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:g(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:g(e.onFocusOutside,e=>e.preventDefault())})}),B=y.forwardRef((e,t)=>{let n=T(L,e.__scopeDialog),r=y.useRef(!1),i=y.useRef(!1);return(0,b.jsx)(V,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),V=y.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,c=T(L,n);return _(),(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(f,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:(0,b.jsx)(a,{role:`dialog`,id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":J(c.open),...s,ref:t,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})}),H=`DialogTitle`,U=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=T(H,n);return(0,b.jsx)(m.h2,{id:i.titleId,...r,ref:t})});U.displayName=H;var W=`DialogDescription`,G=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=T(W,n);return(0,b.jsx)(m.p,{id:i.descriptionId,...r,ref:t})});G.displayName=W;var K=`DialogClose`,q=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=T(K,n);return(0,b.jsx)(m.button,{type:`button`,...r,ref:t,onClick:g(e.onClick,()=>i.onOpenChange(!1))})});q.displayName=K;function J(e){return e?`open`:`closed`}var Y=typeof document>`u`?y.useEffect:y.useLayoutEffect;function X(e){let t=e.activeElement;return!t||t===e.body||t===e.documentElement||!(`focus`in t)||typeof t.focus!=`function`?null:t}function Z(e,t){!e||!e.isConnected||e.ownerDocument!==t||e.focus({preventScroll:!0})}function Q({open:e,title:t,description:n,confirmLabel:r,confirmVariant:i=`danger`,onConfirm:a,onOpenChange:o}){let[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(null),d=(0,y.useRef)(null),f=(0,y.useRef)(!1);Y(()=>{e&&!f.current&&(d.current=X(document)),f.current=e},[e]),(0,y.useEffect)(()=>{e||(c(!1),u(null))},[e]);async function p(){c(!0),u(null);try{await a(),o(!1)}catch(e){u(e instanceof Error?e.message:String(e)),c(!1)}}return(0,b.jsx)(E,{open:e,onOpenChange:e=>{!e&&!s&&o(!1)},children:(0,b.jsxs)(M,{children:[(0,b.jsx)(P,{className:`fixed inset-0 z-50 bg-chocolate/35 backdrop-blur-[2px] data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),(0,b.jsxs)(R,{className:`fixed left-1/2 top-1/2 z-50 grid w-[calc(100%-2rem)] max-w-md -translate-x-1/2 -translate-y-1/2 gap-4 rounded-[16px] border border-frost bg-snow p-5 text-chocolate shadow-baziu-lg outline-none data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,onCloseAutoFocus:e=>{e.preventDefault();let t=d.current;d.current=null,Z(t,document)},onEscapeKeyDown:e=>{s&&e.preventDefault()},onPointerDownOutside:e=>{s&&e.preventDefault()},children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,b.jsx)(U,{className:`font-serif text-xl text-chocolate`,children:t}),(0,b.jsx)(G,{asChild:!0,children:(0,b.jsx)(`div`,{className:`text-sm leading-6 text-mocha`,children:n})})]}),l&&(0,b.jsx)(`p`,{role:`alert`,className:`rounded-md bg-danger/10 px-3 py-2 text-sm text-danger`,children:l}),(0,b.jsxs)(`div`,{className:`flex flex-col-reverse gap-2 border-t border-frost pt-4 sm:flex-row sm:justify-end`,children:[(0,b.jsx)(v,{variant:`ghost`,disabled:s,onClick:()=>o(!1),children:`cancel`}),(0,b.jsx)(v,{variant:i,disabled:s,onClick:()=>void p(),children:s?`working…`:r})]})]})]})})}export{G as a,U as c,R as i,E as n,P as o,q as r,M as s,Q as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-DGeXAQPT.js";import{a as t}from"./preload-helper-bztXdkDj.js";import{ot as n}from"./index-Dsstm2hf.js";import{n as r,t as i}from"./SectionTabs-4kCQXuFY.js";var a=e(),o=[{suffix:``,label:`Context`,exact:!0},{suffix:`/members`,label:`Members`},{suffix:`/policy`,label:`Policy`},{suffix:`/memory`,label:`Memory`},{suffix:`/review`,label:`Review`},{suffix:`/results`,label:`Results`},{suffix:`/activity`,label:`Activity`}];function s({teamId:e}){let s=n({select:e=>e.location.pathname}),c=`/teams/${encodeURIComponent(e)}`;return(0,a.jsx)(`nav`,{"aria-label":`Team sections`,className:i,children:o.map(e=>{let n=`${c}${e.suffix}`,i=`exact`in e&&e.exact?s===c||s===`${c}/`:s.startsWith(n);return(0,a.jsx)(t,{to:n,"aria-current":i?`page`:void 0,className:r(i),children:e.label},e.label)})})}export{s as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{rt as e}from"./index-Dsstm2hf.js";var t=e(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-DGeXAQPT.js";import{$ as t,F as n,I as r,at as i,it as a,rt as o}from"./index-Dsstm2hf.js";var s=o(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),c=o(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),l=e();function u(){let{error:e,resultId:o}=n.useSearch();return(0,l.jsxs)(`main`,{className:`relative flex min-h-dvh items-center overflow-hidden bg-cream px-5 py-16 sm:px-8`,children:[(0,l.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0`,style:{background:`radial-gradient(circle at 16% 12%, rgba(61,120,153,0.18), transparent 36rem), radial-gradient(circle at 88% 84%, rgba(196,135,138,0.13), transparent 32rem)`}}),(0,l.jsx)(`div`,{className:`absolute right-4 top-4 z-10 sm:right-6 sm:top-6`,children:(0,l.jsx)(r,{})}),(0,l.jsxs)(`div`,{className:`relative mx-auto grid w-full max-w-5xl items-center gap-10 lg:grid-cols-[minmax(0,1fr)_25rem] lg:gap-20`,children:[(0,l.jsxs)(`section`,{className:`hidden lg:block`,children:[(0,l.jsxs)(`div`,{className:`mb-8 flex items-center gap-3`,children:[(0,l.jsx)(i,{className:`h-12 w-12`}),(0,l.jsx)(`span`,{className:`font-display text-3xl tracking-[-0.03em] text-charcoal`,children:`bazilion`})]}),(0,l.jsx)(`h1`,{className:`max-w-xl text-[3.4rem] leading-[0.98] tracking-[-0.035em]`,children:`Your agents, working as one thoughtful team.`}),(0,l.jsx)(`p`,{className:`mt-6 max-w-lg text-base leading-7 text-mocha`,children:`A private workspace for long-lived agents, shared context, and communication policies you can actually see and control.`}),(0,l.jsxs)(`div`,{className:`mt-8 grid max-w-lg gap-3 sm:grid-cols-2`,children:[(0,l.jsx)(d,{icon:(0,l.jsx)(c,{className:`h-4 w-4`}),label:`Persistent conversations`}),(0,l.jsx)(d,{icon:(0,l.jsx)(t,{className:`h-4 w-4`}),label:`Team-owned context`})]})]}),(0,l.jsxs)(`section`,{className:`w-full rounded-[24px] border border-frost bg-snow/95 p-7 shadow-baziu-lg backdrop-blur sm:p-9`,children:[(0,l.jsxs)(`div`,{className:`mb-6 flex items-center gap-3 lg:hidden`,children:[(0,l.jsx)(i,{className:`h-10 w-10`}),(0,l.jsx)(`span`,{className:`font-display text-2xl text-charcoal`,children:`bazilion`})]}),(0,l.jsx)(`div`,{className:`mb-6 flex h-10 w-10 items-center justify-center rounded-xl bg-sapphire-glow text-sapphire`,children:(0,l.jsx)(s,{className:`h-5 w-5`,"aria-hidden":`true`})}),(0,l.jsx)(`h2`,{className:`font-display text-3xl text-charcoal`,children:`Open Bazilion`}),(0,l.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-mocha-light`,children:`Use the fresh-install credential once, then a named device token for future sign-ins.`}),e===`token`&&(0,l.jsxs)(`div`,{className:`err mt-5`,role:`alert`,children:[`That credential was not accepted. On first run, use the bootstrap token from`,` `,(0,l.jsx)(`code`,{children:`auth.json`}),`; afterward, use a named device token.`]}),e===`origin`&&(0,l.jsx)(`div`,{className:`err mt-5`,role:`alert`,children:`Bazilion blocked the sign-in request because its browser origin was hidden. Reload this page and try again from the configured Bazilion address.`}),(0,l.jsxs)(`form`,{method:`POST`,action:`/api/login`,className:`mt-6 text-left`,children:[o&&(0,l.jsx)(`input`,{type:`hidden`,name:`resultId`,value:o}),(0,l.jsx)(`label`,{htmlFor:`token`,className:`block text-[0.85em] font-semibold text-mocha`,children:`Access token`}),(0,l.jsx)(`input`,{type:`password`,id:`token`,name:`token`,autoFocus:!0,required:!0,placeholder:`Paste your token`,className:`mb-4`}),(0,l.jsx)(`button`,{type:`submit`,className:`w-full`,children:`Open Bazilion`})]}),(0,l.jsxs)(`p`,{className:`mt-5 rounded-xl bg-ivory px-3 py-2.5 text-[0.78em] leading-relaxed text-mocha-light`,children:[`Fresh install? Paste the bootstrap token from `,(0,l.jsx)(`code`,{children:`auth.json`}),`; it is accepted only until provider setup is complete and is exchanged for a bounded session. For later sign-ins, run `,(0,l.jsx)(`code`,{children:`bazilion token create browser`}),` on the server.`]})]})]}),(0,l.jsxs)(`footer`,{className:`absolute bottom-4 left-0 right-0 text-center text-xs text-mocha-light`,children:[`dedicated to Baziu`,(0,l.jsx)(a,{className:`ml-1 inline-block h-3 w-3 align-[-1px] opacity-40`})]})]})}function d({icon:e,label:t}){return(0,l.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl border border-frost bg-snow/70 px-3 py-2.5 text-sm font-semibold text-mocha shadow-baziu-sm`,children:[(0,l.jsx)(`span`,{className:`text-sapphire`,children:e}),t]})}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{a as r,d as i,o as a}from"./preload-helper-bztXdkDj.js";import{t as o}from"./chevron-right-DFqFHtLy.js";import{n as s,t as c}from"./x-BGCHwZOH.js";import{a as l,c as u,i as d,n as f,o as p,r as m,s as h,t as g}from"./ConfirmDialog-Qam6Ut08.js";import{$ as _,P as v,X as y,nt as b,rt as x,tt as S}from"./index-Dsstm2hf.js";import{n as C,t as w}from"./utils-B6KiDbIe.js";import{t as T}from"./Button-ByiV6fpd.js";import{t as E}from"./ChatPane-BI3QVX2A.js";import"./wire-constants-CBD-lTaa.js";var D=x(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),O=x(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),k=x(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),A=e(n(),1),j=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,M=C,N=(e,t)=>n=>{if(t?.variants==null)return M(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=j(t)||j(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return M(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},P=t(),F=N(`team/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-team]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-team]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-team]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-team]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function I({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,P.jsx)(r?y:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:w(F({variant:t,size:n,className:e})),...i})}function L({...e}){return(0,P.jsx)(f,{"data-slot":`dialog`,...e})}function R({...e}){return(0,P.jsx)(h,{"data-slot":`dialog-portal`,...e})}function z({className:e,...t}){return(0,P.jsx)(p,{"data-slot":`dialog-overlay`,className:w(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function B({className:e,children:t,showCloseButton:n=!0,...r}){return(0,P.jsxs)(R,{children:[(0,P.jsx)(z,{}),(0,P.jsxs)(d,{"data-slot":`dialog-content`,className:w(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,P.jsx)(m,{"data-slot":`dialog-close`,asChild:!0,children:(0,P.jsxs)(I,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`,children:[(0,P.jsx)(c,{}),(0,P.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function V({className:e,...t}){return(0,P.jsx)(`div`,{"data-slot":`dialog-header`,className:w(`flex flex-col gap-2`,e),...t})}function H({className:e,showCloseButton:t=!1,children:n,...r}){return(0,P.jsxs)(`div`,{"data-slot":`dialog-footer`,className:w(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,P.jsx)(m,{asChild:!0,children:(0,P.jsx)(I,{variant:`outline`,children:`Close`})})]})}function U({className:e,...t}){return(0,P.jsx)(u,{"data-slot":`dialog-title`,className:w(`font-heading text-base leading-none font-medium`,e),...t})}function W({className:e,...t}){return(0,P.jsx)(l,{"data-slot":`dialog-description`,className:w(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function G({onClose:e}){let t=i(),[n,r]=(0,A.useState)(``),[a,o]=(0,A.useState)(``),[s,c]=(0,A.useState)(``),[l,u]=(0,A.useState)(!1),[d,f]=(0,A.useState)(null);async function p(r){if(r.preventDefault(),f(null),!n.trim()){f(`id is required`);return}u(!0);try{let r={id:n.trim()};a.trim()&&(r.name=a.trim()),s.trim()&&(r.link=s.trim());let i=await fetch(`/api/teams`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(r)});if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e.error??`${i.status} ${i.statusText}`)}e(),await t.invalidate()}catch(e){f(e.message),u(!1)}}return(0,P.jsx)(L,{open:!0,onOpenChange:t=>{!t&&!l&&e()},children:(0,P.jsx)(B,{showCloseButton:!l,className:`max-h-[calc(100dvh-2rem)] w-full max-w-lg overflow-y-auto rounded-3xl border border-frost bg-card p-6 shadow-baziu-lg sm:p-7`,onEscapeKeyDown:e=>{l&&e.preventDefault()},onPointerDownOutside:e=>{l&&e.preventDefault()},children:(0,P.jsxs)(`form`,{onSubmit:p,children:[(0,P.jsxs)(V,{children:[(0,P.jsx)(U,{className:`font-serif text-2xl text-foreground`,children:`Create a team`}),(0,P.jsxs)(W,{children:[`A team is a collaboration context — one filesystem root, one USER.md, one roster. The slot lives at `,(0,P.jsx)(`code`,{className:`font-mono`,children:`~/.bazilion/teams/<slug>/`}),`.`]})]}),(0,P.jsxs)(`div`,{className:`mb-3 mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,P.jsxs)(`label`,{className:`block text-sm`,children:[`ID (slug)`,(0,P.jsx)(`input`,{type:`text`,value:n,onChange:e=>r(e.target.value),required:!0,pattern:`[a-z0-9][a-z0-9_-]*`,placeholder:`myproject`,className:`mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30`})]}),(0,P.jsxs)(`label`,{className:`block text-sm`,children:[`Name `,(0,P.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`}),(0,P.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),className:`mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30`})]})]}),(0,P.jsxs)(`label`,{className:`mb-3 block text-sm`,children:[`Link target`,` `,(0,P.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional, absolute path)`}),(0,P.jsx)(`input`,{type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`/home/you/projects/myrepo`,className:`mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30`}),(0,P.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:`Leave blank to create a fresh directory. Supply an absolute path to materialize the slot as a symlink to your existing project tree.`})]}),d&&(0,P.jsx)(`p`,{role:`alert`,className:`err mt-2`,children:d}),(0,P.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,P.jsx)(T,{variant:`ghost`,disabled:l,onClick:e,children:`Cancel`}),(0,P.jsx)(T,{variant:`primary`,type:`submit`,disabled:l,children:l?`Creating…`:`Create team`})]})]})})})}function K({profileId:e,teamHint:t,teams:n,onClose:r}){let i=a(),[o,s]=(0,A.useState)(``),[c,l]=(0,A.useState)(t??n.find(e=>e.id==="default")?.id??n[0]?.id??``),[u,d]=(0,A.useState)(`profile_defaults`),[f,p]=(0,A.useState)(!1),[m,h]=(0,A.useState)(null),[g,_]=(0,A.useState)(null);async function v(){let t=await fetch(`/api/teams/${encodeURIComponent(c)}/policy`);if(!t.ok)throw Error(`The selected Team policy is unavailable. Reload and try again.`);let n=await t.json();return{current:n,body:{profileId:e,teamId:c,teamExpectedRevision:n.teamPolicy.revision,placement:u}}}async function y(){h(null),p(!0);try{let{body:e}=await v(),t=await fetch(`/api/agents/placement-preview`,{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??`Preview failed (${t.status})`)}_(await t.json())}catch(e){h(e.message)}finally{p(!1)}}async function b(t){t.preventDefault(),h(null),p(!0);try{if(!g){await y();return}let t={profile:e,teamExpectedRevision:g.currentRevision,placement:u};o.trim()&&(t.name=o.trim()),c&&(t.teamId=c);let n=await fetch(`/api/agents`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`${n.status} ${n.statusText}`)}let a=(await n.json()).agent;r(),await i({to:`/`,search:{agent:a.id}})}catch(e){h(e.message),p(!1)}}return(0,P.jsx)(L,{open:!0,onOpenChange:e=>{!e&&!f&&r()},children:(0,P.jsx)(B,{showCloseButton:!f,className:`max-h-[calc(100dvh-2rem)] w-full max-w-lg overflow-y-auto rounded-3xl border border-frost bg-card p-6 shadow-baziu-lg sm:p-7`,onEscapeKeyDown:e=>{f&&e.preventDefault()},onPointerDownOutside:e=>{f&&e.preventDefault()},children:(0,P.jsxs)(`form`,{onSubmit:b,children:[(0,P.jsxs)(V,{children:[(0,P.jsx)(U,{className:`font-serif text-xl text-foreground`,children:`Spawn a new agent`}),(0,P.jsxs)(W,{children:[`Create an agent from profile `,(0,P.jsx)(`code`,{className:`font-mono`,children:e}),`, then review its exact Team policy placement before committing.`]})]}),(0,P.jsxs)(`label`,{className:`mb-3 mt-4 block text-sm text-foreground`,children:[`Agent name`,` `,(0,P.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional — defaults to the profile's name)`}),(0,P.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),autoComplete:`off`,className:`mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30`})]}),(0,P.jsxs)(`label`,{className:`mb-3 block text-sm text-foreground`,children:[`Initial policy placement`,(0,P.jsxs)(`select`,{value:u,onChange:e=>{d(e.target.value),_(null)},className:`mt-1 block w-full rounded-md border bg-background px-3 py-2`,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:`mt-1 block text-xs text-muted-foreground`,children:`The current Team revision is checked again when you submit.`})]}),(0,P.jsxs)(`label`,{className:`mb-3 block text-sm text-foreground`,children:[`Team`,(0,P.jsx)(`select`,{value:c,onChange:e=>{l(e.target.value),_(null)},className:`mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30`,children:n.map(e=>(0,P.jsxs)(`option`,{value:e.id,children:[e.name,e.id==="default"?` (default)`:``]},e.id))})]}),m&&(0,P.jsx)(`p`,{role:`alert`,className:`err mt-2`,children:m}),g&&(0,P.jsxs)(`div`,{role:`status`,className:`mt-3 rounded-md border border-sapphire-light bg-sapphire-glow p-3 text-sm`,children:[(0,P.jsxs)(`p`,{children:[`Creating this Agent advances Team revision `,g.currentRevision,` →`,` `,(0,P.jsx)(`strong`,{children:g.resultingRevision}),` and adds`,` `,(0,P.jsx)(`strong`,{children:g.addedEdges.length}),` directed edges to the existing`,` `,g.existingEdges.length,`.`]}),(0,P.jsx)(`ul`,{className:`mt-2 max-h-36 overflow-auto`,children:g.addedEdges.map((e,t)=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`code`,{children:[e.sourceKind,e.sourceId?`:${e.sourceId}`:``,` → `,e.targetKind,e.targetId?`:${e.targetId}`:``]})},`${e.sourceKind}:${e.sourceId??``}>${e.targetKind}:${e.targetId??``}:${t}`))}),g.addedEdges.length===0&&(0,P.jsx)(`p`,{className:`mt-2`,children:`The new Agent starts isolated.`})]}),(0,P.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,P.jsx)(T,{variant:`ghost`,disabled:f,onClick:r,children:`Cancel`}),(0,P.jsx)(T,{variant:`primary`,type:`submit`,disabled:f,children:f?`Working…`:g?`Commit reviewed creation`:`Review exact policy`})]})]})})})}function q({profileGroup:e,teams:t,onClose:n,onSpawned:r}){let[i,a]=(0,A.useState)(``),[o,s]=(0,A.useState)(``),[c,l]=(0,A.useState)(null),[u,d]=(0,A.useState)(!1),[f,p]=(0,A.useState)(null);async function m(){let n=i.trim();if(!n)throw Error(`Target Team slug is required`);let r=t.find(e=>e.id===n),a;if(r){let e=await fetch(`/api/teams/${encodeURIComponent(n)}/policy`);if(!e.ok)throw Error(`The target Team policy is unavailable.`);a=(await e.json()).teamPolicy.revision}return{target:n,body:{templateExpectedRevision:e.currentRevision,teamId:n,...a?{teamExpectedRevision:a}:{},mode:r?`append`:`initialize`,...o?{userMd:o}:{}}}}async function h(){d(!0),l(null),p(null);try{let{body:t}=await m(),n=await fetch(`/api/team-templates/${encodeURIComponent(e.id)}/spawn/preview`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});if(!n.ok)throw Error((await n.json().catch(()=>null))?.error??n.statusText);p(await n.json())}catch(e){l(e.message)}finally{d(!1)}}async function g(){let t=i.trim();if(!t){l(`Target Team slug is required`);return}d(!0),l(null);try{let{body:n}=await m(),i=await fetch(`/api/team-templates/${encodeURIComponent(e.id)}/spawn`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(n)});if(!i.ok)throw Error((await i.json().catch(()=>null))?.error??i.statusText);r(t)}catch(e){l(e.message)}finally{d(!1)}}return(0,P.jsx)(L,{open:!0,onOpenChange:e=>{!e&&!u&&n()},children:(0,P.jsxs)(B,{showCloseButton:!u,className:`max-h-[calc(100dvh-2rem)] w-full max-w-lg overflow-y-auto rounded-3xl border border-frost bg-card p-6 shadow-baziu-lg sm:p-7`,onEscapeKeyDown:e=>{u&&e.preventDefault()},onPointerDownOutside:e=>{u&&e.preventDefault()},children:[(0,P.jsxs)(V,{children:[(0,P.jsxs)(U,{className:`font-serif text-xl text-foreground`,children:[`Spawn team — `,e.name]}),(0,P.jsxs)(W,{children:[`Uses immutable Team revision `,e.currentRevision,`. Existing Teams append at their current reviewed revision; a new Team initializes at revision 1. Conflicts never overwrite newer state.`]})]}),c&&(0,P.jsx)(`div`,{role:`alert`,className:`err`,children:c}),(0,P.jsxs)(`label`,{children:[`Target Team slug`,(0,P.jsx)(`input`,{value:i,onChange:e=>{a(e.target.value),p(null)},list:`canonical-teams`,required:!0}),(0,P.jsx)(`datalist`,{id:`canonical-teams`,children:t.map(e=>(0,P.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),(0,P.jsxs)(`label`,{children:[`Starter USER.md (new Team only)`,(0,P.jsx)(`textarea`,{rows:3,value:o,onChange:e=>{s(e.target.value),p(null)},className:`font-mono text-[0.88em] leading-[1.55]`})]}),f&&(0,P.jsxs)(`div`,{role:`status`,className:`mt-4 rounded-md border border-sapphire-light bg-sapphire-glow p-3 text-sm`,children:[(0,P.jsxs)(`p`,{children:[(0,P.jsx)(`strong`,{children:f.mode===`initialize`?`Initialize`:`Append`}),` produces Team revision `,f.resultingRevision,`, adds `,f.newMembers.length,` Agents, and results in `,f.edges.length,` directed allow edges.`]}),(0,P.jsx)(`ul`,{className:`mt-2 max-h-40 overflow-auto`,children:f.newMembers.map(e=>(0,P.jsxs)(`li`,{children:[e.agentName,` · stable source slot `,(0,P.jsx)(`code`,{children:e.slotId})]},e.slotId))}),(0,P.jsxs)(`details`,{className:`mt-2`,children:[(0,P.jsx)(`summary`,{className:`cursor-pointer`,children:`Review exact edge topology`}),(0,P.jsx)(`ul`,{className:`mt-2 max-h-40 overflow-auto`,children:f.edges.map((e,t)=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`code`,{children:[e.sourceKind,e.sourceId?`:${e.sourceId}`:``,` → `,e.targetKind,e.targetId?`:${e.targetId}`:``]})},`${e.sourceKind}:${e.sourceId??``}>${e.targetKind}:${e.targetId??``}:${t}`))})]})]}),(0,P.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,P.jsx)(T,{variant:`ghost`,disabled:u,onClick:n,children:`Cancel`}),f?(0,P.jsx)(T,{variant:`primary`,onClick:g,disabled:u,children:u?`Spawning…`:`Commit ${f.mode}`}):(0,P.jsx)(T,{variant:`primary`,onClick:h,disabled:u||e.slotCount===0,children:u?`Reviewing…`:`Review exact result`})]})]})})}var J=`bz_sidebar_open_groups`;function Y(e){if(typeof document>`u`)return;let t=encodeURIComponent(JSON.stringify(e));document.cookie=`${J}=${t}; Path=/; Max-Age=31536000; SameSite=Lax`}function X({agents:e,teams:t,profiles:n,profileGroups:a,selectedAgentId:c,initialOpenGroups:l}){let u=i(),[d,f]=(0,A.useState)(null),[p,m]=(0,A.useState)(null),[h,v]=(0,A.useState)(!1),[y,x]=(0,A.useState)(!1),[C,w]=(0,A.useState)(null),[T,E]=(0,A.useState)(null),[j,M]=(0,A.useState)(null),N=(0,A.useRef)(null),F=(0,A.useRef)(null),I=()=>window.requestAnimationFrame(()=>N.current?.focus()),[L,R]=(0,A.useState)(()=>l??{});(0,A.useEffect)(()=>{if(!y)return;let e=F.current;window.requestAnimationFrame(()=>{e?.querySelector(`[role="menuitem"]:not([disabled])`)?.focus()});let t=t=>{e?.contains(t.target)||N.current?.contains(t.target)||(x(!1),I())},n=e=>{e.key===`Escape`&&(e.preventDefault(),x(!1),I())};return document.addEventListener(`pointerdown`,t),document.addEventListener(`keydown`,n),()=>{document.removeEventListener(`pointerdown`,t),document.removeEventListener(`keydown`,n)}},[y]);function z(e){if(![`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key))return;let t=Array.from(e.currentTarget.querySelectorAll(`[role="menuitem"]:not([disabled])`));if(t.length===0)return;e.preventDefault();let n=t.indexOf(document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:e.key===`ArrowDown`?(n+1+t.length)%t.length:(n-1+t.length)%t.length]?.focus()}async function B(e,t){let n=t.trim();if(!n||n===e.name)return;let r=await fetch(`/api/agents/${e.id}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({name:n})});if(!r.ok){let e=await r.json().catch(()=>null);throw Error(e?.error??`Could not rename agent (${r.status})`)}await u.invalidate()}async function V(e){let t=await fetch(`/api/agents/${e.id}/archive`,{method:`POST`});if(!t.ok&&t.status!==204){let e=await t.json().catch(()=>null);throw Error(e?.error??`Could not archive agent (${t.status})`)}await u.invalidate()}let H=[...n].sort((e,t)=>e.id==="default"?-1:+(t.id==="default")),U=[...t].sort((e,t)=>e.id==="default"?-1:+(t.id==="default")),W=new Map;for(let t of e){let e=W.get(t.teamId)??[];e.push(t),W.set(t.teamId,e)}let J=e.find(e=>e.id===c)?.teamId??null;return(0,P.jsxs)(`aside`,{className:`flex h-full flex-col overflow-hidden rounded-2xl border border-border bg-card shadow-baziu-sm`,children:[(0,P.jsxs)(`header`,{className:`flex items-center justify-between gap-3 border-b border-border bg-muted/30 px-3 py-2.5`,children:[(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,P.jsx)(`span`,{className:`flex size-7 items-center justify-center rounded-lg bg-accent text-accent-foreground`,children:(0,P.jsx)(b,{className:`size-4`,"aria-hidden":`true`})}),(0,P.jsx)(`span`,{children:`Agents`})]}),(0,P.jsxs)(`p`,{className:`mt-0.5 truncate pl-9 text-xs text-muted-foreground`,children:[e.length,` agent`,e.length===1?``:`s`,` across `,t.length,` team`,t.length===1?``:`s`]})]}),(0,P.jsxs)(`div`,{className:`relative`,children:[(0,P.jsxs)(`button`,{ref:N,id:`sidebar-new-menu-button`,type:`button`,onClick:()=>x(e=>!e),"aria-label":`Create a new Agent or Team`,"aria-controls":y?`sidebar-new-menu`:void 0,"aria-expanded":y,"aria-haspopup":`menu`,className:`unstyled inline-flex h-8 items-center gap-1 rounded-lg border border-border bg-card px-2.5 text-xs font-semibold text-foreground shadow-baziu-sm transition-colors hover:border-primary/30 hover:bg-accent hover:text-accent-foreground`,children:[(0,P.jsx)(s,{className:`size-3.5`,"aria-hidden":`true`}),`New`,(0,P.jsx)(S,{className:`size-3.5 text-muted-foreground transition-transform ${y?`rotate-180`:``}`,"aria-hidden":`true`})]}),y&&(0,P.jsxs)(`div`,{ref:F,id:`sidebar-new-menu`,role:`menu`,"aria-labelledby":`sidebar-new-menu-button`,className:`absolute right-0 top-[calc(100%+0.4rem)] z-20 w-60 overflow-hidden rounded-xl border border-border bg-popover p-1.5 text-popover-foreground shadow-baziu-lg`,onKeyDown:z,children:[n.length===0?(0,P.jsxs)(`div`,{className:`rounded-lg bg-muted/40 px-3 py-2.5 text-xs leading-5 text-muted-foreground`,children:[`No Agent templates yet.`,` `,(0,P.jsx)(`a`,{href:`/templates/agents`,role:`menuitem`,className:`text-primary underline`,children:`Create one to spawn agents.`})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:[(0,P.jsx)(b,{className:`size-3`,"aria-hidden":`true`}),`Agent templates`]}),H.map(e=>(0,P.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{x(!1),f({profileId:e.id})},className:`unstyled flex min-h-8 w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm text-foreground transition-colors hover:bg-accent hover:text-accent-foreground`,children:[(0,P.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground`,children:(0,P.jsx)(b,{className:`size-3.5`,"aria-hidden":`true`})}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name||e.id}),e.id==="default"&&(0,P.jsx)(`span`,{className:`rounded-full border border-border bg-muted px-1.5 py-0.5 text-xs font-semibold text-muted-foreground`,children:`Default`})]},e.id))]}),(0,P.jsx)(`div`,{className:`my-1.5 h-px bg-border`}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:[(0,P.jsx)(_,{className:`size-3`,"aria-hidden":`true`}),`Team templates`]}),a.length===0?(0,P.jsxs)(`div`,{className:`rounded-lg bg-muted/40 px-3 py-2 text-xs leading-5 text-muted-foreground`,children:[`No team templates yet.`,` `,(0,P.jsx)(`a`,{href:`/templates/teams`,role:`menuitem`,className:`text-primary underline`,children:`Create one`}),`.`]}):a.map(e=>(0,P.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:e.slotCount===0,title:e.slotCount===0?`Add at least one member before spawning`:void 0,onClick:()=>{x(!1),m(e)},className:`unstyled flex min-h-8 w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm text-foreground transition-colors hover:bg-accent hover:text-accent-foreground disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent`,children:[(0,P.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground`,children:(0,P.jsx)(_,{className:`size-3.5`,"aria-hidden":`true`})}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name||e.id}),(0,P.jsx)(`span`,{className:`inline-flex min-w-6 items-center justify-center rounded-full bg-muted px-1.5 font-mono text-xs text-muted-foreground`,children:e.slotCount})]},e.id)),(0,P.jsx)(`div`,{className:`my-1.5 h-px bg-border`}),(0,P.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{x(!1),v(!0)},className:`unstyled flex min-h-8 w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground`,children:[(0,P.jsx)(s,{className:`size-3.5`,"aria-hidden":`true`}),`Create a team`]})]})]})]}),j&&(0,P.jsx)(`p`,{role:`alert`,className:`m-2 rounded-lg bg-danger/10 px-3 py-2 text-xs text-danger`,children:j}),(0,P.jsx)(`nav`,{className:`flex-1 overflow-y-auto p-1.5`,"aria-label":`Teams and agents`,children:e.length===0?(0,P.jsxs)(`div`,{className:`m-1 flex flex-col items-center rounded-xl border border-dashed border-border bg-muted/30 px-4 py-6 text-center`,children:[(0,P.jsx)(`span`,{className:`mb-2 flex size-9 items-center justify-center rounded-full bg-accent text-accent-foreground`,children:(0,P.jsx)(b,{className:`size-4`,"aria-hidden":`true`})}),(0,P.jsx)(`p`,{className:`text-sm font-semibold text-foreground`,children:`No agents yet`}),(0,P.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:`Your default Team is ready. Spawn the first agent to start a conversation.`}),H[0]?(0,P.jsxs)(`button`,{type:`button`,onClick:()=>f({profileId:H[0]?.id??`default`}),className:`unstyled mt-3 inline-flex min-h-9 items-center gap-1 rounded-lg bg-primary px-3 text-xs font-semibold text-primary-foreground hover:bg-primary/90`,children:[`Spawn first agent`,(0,P.jsx)(o,{className:`size-3.5`,"aria-hidden":`true`})]}):(0,P.jsxs)(`a`,{href:`/templates/agents`,className:`mt-3 inline-flex items-center gap-1 text-xs font-semibold text-primary hover:text-primary/80`,children:[`Create an Agent template`,(0,P.jsx)(o,{className:`size-3.5`,"aria-hidden":`true`})]})]}):U.map(e=>{let t=W.get(e.id)??[],n=J===e.id,i=L[e.id];return(0,P.jsxs)(`details`,{open:i===void 0?n||e.id==="default":i,onToggle:t=>{let n=t.currentTarget.open;if(L[e.id]===n)return;let r={...L,[e.id]:n};Y(r),R(r),u.invalidate()},className:`team/details mb-1 last:mb-0`,children:[(0,P.jsxs)(`summary`,{className:`flex min-h-8 cursor-pointer list-none items-center gap-1.5 rounded-lg px-2 py-1.5 text-sm transition-colors hover:bg-accent hover:text-accent-foreground ${n?`bg-muted/60 text-foreground`:`text-muted-foreground`}`,children:[(0,P.jsx)(o,{className:`size-3.5 shrink-0 transition-transform team-open/details:rotate-90`,"aria-hidden":`true`}),(0,P.jsx)(`span`,{className:`flex size-5 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground`,children:(0,P.jsx)(_,{className:`size-3`,"aria-hidden":`true`})}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:e.name}),e.id==="default"&&(0,P.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Default`}),(0,P.jsx)(`span`,{className:`inline-flex min-w-6 items-center justify-center rounded-full border border-border bg-card px-1.5 font-mono text-xs text-muted-foreground`,children:t.length})]}),t.length===0?(0,P.jsx)(`div`,{className:`py-2 pl-12 pr-2 text-xs text-muted-foreground`,children:`No agents in this team`}):(0,P.jsx)(`div`,{className:`space-y-0.5 py-0.5 pl-2`,children:t.map(e=>(0,P.jsxs)(`div`,{className:`team/row relative rounded-lg`,children:[(0,P.jsxs)(r,{to:`/`,search:{agent:e.id},"aria-current":e.id===c?`page`:void 0,className:`block min-h-11 rounded-lg border border-transparent py-1.5 pl-2.5 pr-[4.6rem] transition-colors hover:bg-accent/70 ${e.id===c?`border-primary/20 bg-accent text-accent-foreground shadow-baziu-sm`:`text-foreground`}`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm font-medium`,children:[(0,P.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full ${e.id===c?`bg-primary`:`bg-border`}`,"aria-hidden":`true`}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),e.telegramTopicId!==null&&(0,P.jsx)(`span`,{className:`shrink-0 text-primary`,title:`Telegram topic #${e.telegramTopicId}`,"aria-label":`Bound to Telegram topic ${e.telegramTopicId}`,children:(0,P.jsx)(k,{className:`size-3`,"aria-hidden":`true`})})]}),(0,P.jsxs)(`div`,{className:`mt-0.5 flex gap-2 pl-3 font-mono text-xs text-muted-foreground`,children:[(0,P.jsx)(`span`,{className:`uppercase tracking-wide`,children:e.status}),(0,P.jsx)(`span`,{children:e.id.slice(0,8)})]})]}),(0,P.jsxs)(`div`,{className:`absolute right-1 top-1/2 z-10 flex -translate-y-1/2 gap-0.5`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>w(e),title:`Rename`,"aria-label":`Rename ${e.name}`,className:`unstyled flex size-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-card hover:text-primary focus-visible:bg-card`,children:(0,P.jsx)(O,{className:`size-3.5`,"aria-hidden":`true`})}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>E(e),title:`Archive`,"aria-label":`Archive ${e.name}`,className:`unstyled flex size-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive focus-visible:bg-destructive/10 focus-visible:text-destructive`,children:(0,P.jsx)(D,{className:`size-3.5`,"aria-hidden":`true`})})]})]},e.id))})]},e.id)})}),d&&(0,P.jsx)(K,{profileId:d.profileId,teamHint:d.teamHint,teams:U,onClose:()=>{f(null),I()}}),p&&(0,P.jsx)(q,{profileGroup:p,teams:U,onClose:()=>{m(null),I()},onSpawned:e=>{m(null),u.navigate({to:`/teams/$id`,params:{id:e}})}}),h&&(0,P.jsx)(G,{onClose:()=>{v(!1),I()}}),(0,P.jsx)(Z,{agent:C,onOpenChange:e=>{e||w(null)},onRename:async(e,t)=>{M(null);try{await B(e,t)}catch(e){throw M(e instanceof Error?e.message:String(e)),e}}}),(0,P.jsx)(g,{open:T!==null,onOpenChange:e=>{e||E(null)},title:`Archive ${T?.name??`agent`}?`,description:(0,P.jsx)(`p`,{children:`The Agent will stop appearing in this sidebar and cannot receive normal work. You can restore it later from the Agents page with “Show archived”.`}),confirmLabel:`Archive agent`,confirmVariant:`primary`,onConfirm:async()=>{if(T){M(null);try{await V(T)}catch(e){throw M(e instanceof Error?e.message:String(e)),e}}}})]})}function Z({agent:e,onOpenChange:t,onRename:n}){let[r,i]=(0,A.useState)(``),[a,o]=(0,A.useState)(!1),[s,c]=(0,A.useState)(null);function l(n){!n&&a||(n&&e&&i(e.name),n||(i(``),c(null),o(!1)),t(n))}async function u(t){if(t.preventDefault(),!(!e||!r.trim()||r.trim()===e.name)){o(!0),c(null);try{await n(e,r),l(!1)}catch(e){c(e instanceof Error?e.message:String(e)),o(!1)}}}return(0,P.jsx)(L,{open:e!==null,onOpenChange:l,children:(0,P.jsx)(B,{showCloseButton:!a,children:(0,P.jsxs)(`form`,{onSubmit:e=>void u(e),children:[(0,P.jsxs)(V,{children:[(0,P.jsxs)(U,{children:[`Rename `,e?.name??`agent`]}),(0,P.jsx)(W,{children:`This changes the display name only; the Agent ID and history stay the same.`})]}),(0,P.jsxs)(`label`,{className:`mt-4 block text-sm font-semibold text-foreground`,children:[`Agent name`,(0,P.jsx)(`input`,{autoFocus:!0,className:`mt-1`,value:r||e?.name||``,onChange:e=>i(e.target.value),maxLength:120})]}),s&&(0,P.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:s}),(0,P.jsxs)(H,{className:`mt-4`,children:[(0,P.jsx)(T,{variant:`ghost`,disabled:a,onClick:()=>l(!1),children:`Cancel`}),(0,P.jsx)(T,{variant:`primary`,type:`submit`,disabled:a||!r.trim()||r.trim()===e?.name,children:a?`Renaming…`:`Rename agent`})]})]})})})}function Q(){let e=v.useLoaderData(),t=e.selected?.resolved.agent.id??null;return(0,P.jsxs)(`div`,{className:`grid h-full min-h-0 grid-cols-1 gap-3 py-3 lg:grid-cols-[18rem_minmax(0,1fr)]`,children:[(0,P.jsx)(`div`,{className:`min-h-0 ${e.selected?`hidden lg:block`:``}`,children:(0,P.jsx)(X,{agents:e.agents,teams:e.teams,profiles:e.profiles,profileGroups:e.profileGroups,selectedAgentId:t,initialOpenGroups:e.initialOpenGroups})}),(0,P.jsx)(`section`,{className:`min-h-0 overflow-hidden ${e.selected?``:`hidden lg:block`}`,children:e.selected?(0,P.jsx)(E,{agentId:e.selected.resolved.agent.id,agentName:e.selected.resolved.agent.name,initialMessages:e.selected.initialMessages,initialSessionHead:e.selected.sessionHead}):(0,P.jsx)(`div`,{className:`flex h-full items-center justify-center rounded-2xl border border-dashed bg-card px-6 text-center text-muted-foreground`,children:(0,P.jsxs)(`div`,{className:`max-w-sm`,children:[(0,P.jsx)(`h1`,{className:`m-0 font-body text-lg font-semibold text-foreground`,children:e.agents.length===0?`Start your first conversation`:`Choose an agent`}),(0,P.jsx)(`p`,{className:`mt-2 text-sm leading-6`,children:e.agents.length===0?`Your default Team and Agent template are ready. Use “Spawn first agent” on the left to create a working member.`:`Pick an agent in the Team list to open its persistent conversation.`}),e.agents.length===0&&(0,P.jsx)(`a`,{href:`/agents`,className:`btn-primary mt-4 no-underline`,children:`Open agent setup`})]})})})]})}export{Q as component};
|