import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{n,s as r}from"./envUtils-BWeoiL4Y.js";import{Ct as i,K as a,cn as o}from"./state-sIHsFpDu.js";import{n as s,t as c}from"./cwd--iizewsn.js";import{Hd as l,Ud as u,cb as d,sb as f}from"./loadAgentsDir-C_wFhytF.js";import{A as p,B as m,P as h,R as g,a as _,c as v,i as y,p as b,y as x}from"./teamHelpers-D8R_gGLb.js";import{a as S,c as C}from"./constants-BljlAJOX.js";import{join as w}from"path";import{readFileSync as T}from"fs";var E=t({getAssistantActivationPath:()=>M,getAssistantSystemPromptAddendum:()=>j,initializeAssistantTeam:()=>A,isAssistantForced:()=>k,isAssistantMode:()=>D,markAssistantForced:()=>O});function D(){return a()}function O(){N=!0}function k(){return N}async function A(){let e=i(),t=b(`assistant-${e.slice(0,8)}`),n=f(S,t),r=y(t),a=Date.now(),o=c(),s=l(n);return await x(t,{name:t,description:`Assistant mode in-process team`,createdAt:a,leadAgentId:n,leadSessionId:e,members:[{agentId:n,name:S,agentType:`assistant`,color:s,joinedAt:a,tmuxPaneId:``,cwd:o,subscriptions:[],backendType:`in-process`}]}),v(t),await g(t),await p(t),m(t),{teamName:t,teamFilePath:r,leadAgentId:n,selfAgentId:n,selfAgentName:S,isLeader:!0,selfAgentColor:s,teammates:{[n]:{name:S,agentType:`assistant`,color:s,tmuxSessionName:`in-process`,tmuxPaneId:`leader`,cwd:o,spawnedAt:a}}}}function j(){try{return T(w(n(),`agents`,`assistant.md`),`utf-8`)}catch{return``}}function M(){if(D())return N?`daemon`:`gate`}var N,P=e((()=>{o(),d(),s(),r(),C(),_(),u(),h(),N=!1}));export{A as a,O as c,P as i,M as n,k as o,j as r,D as s,E as t};