import pathlib, subprocess,sys
checkout, home = map(pathlib.Path,sys.argv[1:])
workspace=home/'workspaces'/'Snooze demo'
workspace.mkdir(parents=True,exist_ok=True)
(workspace/'README.md').write_text('Synthetic release notes project.\n')
def run(args):
 return subprocess.check_output(args,cwd=checkout,text=True)
subprocess.check_call(['git','init','-q','--initial-branch=main',str(workspace)])
subprocess.check_call(['git','-C',str(workspace),'add','.'])
subprocess.check_call(['git','-C',str(workspace),'-c','user.name=Scenario','-c','user.email=scenario@example.invalid','commit','-qm','Initial commit'])
run(['node','apps/server/src/bin.ts','project','add',str(workspace),'--title','Snooze demo','--base-dir',str(home)])
print(run(['node','apps/server/src/bin.ts','thread','start',str(workspace),'Prepare release notes','--title','Review release notes','--provider','devReplay','--model','multi-turn','--wait','--json','--base-dir',str(home)]))
