import{a as s}from"./chunk-3THT3N7L.js";import"./chunk-DXB73IDG.js";var i={name:"ag-spawn",execute:async(a,e)=>{let n=a[0],t=a.slice(1).join(" ");if(!n||!t)return{stdout:"",stderr:`Usage: ag-spawn <id> <command>
`,exitCode:1};if(!e.bash)return{stdout:"",stderr:`Error: Bash reference missing in context
`,exitCode:1};try{return await e.bash.services.agentManager.spawn(n,t,e.bash),{stdout:`Spawned sub-agent ${n} in background.
`,stderr:"",exitCode:0}}catch(r){return{stdout:"",stderr:`Spawn failed: ${s(r.message)}
`,exitCode:1}}}};export{i as agSpawn};
