import"./chunk-DXB73IDG.js";var n="/.ag-bash/plan.json",u={name:"ag-plan",execute:async(o,e)=>{let a=e.bash;if(!a)return{stdout:"",stderr:`Bash instance not found
`,exitCode:1};let d=o[0];if(!d)return{stdout:"",stderr:`Usage: ag-plan <enter|exit|status|add|list> [args]
`,exitCode:1};switch(d){case"enter":return a.setMode("plan"),{stdout:`Entered plan mode. You are now in read-only mode.
`,stderr:"",exitCode:0};case"exit":return a.setMode("execute"),{stdout:`Exited plan mode. You can now make changes to the codebase.
`,stderr:"",exitCode:0};case"status":return{stdout:`Current mode: ${a.getMode()}
`,stderr:"",exitCode:0};case"add":{let s=o.slice(1).join(" ");if(!s)return{stdout:"",stderr:`Usage: ag-plan add <step_description>
`,exitCode:1};let t=[];await e.fs.exists(n)&&(t=JSON.parse(await e.fs.readFile(n,"utf8"))),t.push(s);let r="/.ag-bash";return await e.fs.exists(r)||await e.fs.mkdir(r,{recursive:!0}),await e.fs.writeFile(n,JSON.stringify(t,null,2)),{stdout:`Added step ${t.length}: ${s}
`,stderr:"",exitCode:0}}case"list":{if(!await e.fs.exists(n))return{stdout:`No active plan found.
`,stderr:"",exitCode:0};let s=JSON.parse(await e.fs.readFile(n,"utf8")),t=`Current Plan:
`;return s.forEach((r,i)=>{t+=`${i+1}. ${r}
`}),{stdout:t,stderr:"",exitCode:0}}default:return{stdout:"",stderr:`Unknown subcommand: ${d}
`,exitCode:1}}}};export{u as agPlanCommand};
