#!/usr/bin/env node
import{a as s}from"./chunk-RLNOQILG.js";import"./chunk-KGOUQS5A.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};
