import{a as i}from"./chunk-3THT3N7L.js";import"./chunk-DXB73IDG.js";var d={name:"ag-wait",execute:async(n,r)=>{let e=n[0];if(!e)return{stdout:"",stderr:`Usage: ag-wait <id>
`,exitCode:1};if(!r.bash)return{stdout:"",stderr:`ag-wait: no bash host available
`,exitCode:1};try{let t=await r.bash.services.agentManager.wait(e),a=`Sub-agent ${e} completed with exit code ${t.exitCode}.
`;return t.stdout&&(a+=`Stdout:
${t.stdout}
`),t.stderr&&(a+=`Stderr:
${t.stderr}
`),{stdout:a,stderr:"",exitCode:0}}catch(s){return{stdout:"",stderr:`Wait failed: ${i(s.message)}
`,exitCode:1}}}};export{d as agWait};
