import subprocess,sys,pathlib,json
root=pathlib.Path(sys.argv[1]); port=sys.argv[2]
workspace=root/'.t3/proof-project'
workspace.mkdir(parents=True,exist_ok=True)
(workspace/'README.md').write_text('Image paste verification\n')
def run(args,cwd=root):
 return subprocess.run(args,cwd=cwd,check=True,text=True,capture_output=True).stdout
run(['git','init','--quiet','--initial-branch=main',str(workspace)])
run(['git','add','.'],workspace)
run(['git','-c','user.name=Scenario','-c','user.email=scenario@example.invalid','commit','-qm','Initial'],workspace)
def cli(args):
 return run(['node','apps/server/src/bin.ts',*args,'--base-dir',str(root/'.t3')])
print(cli(['project','add',str(workspace),'--title','Image paste proof']))
print(cli(['thread','start',str(workspace),'Ready','--title','Image paste','--provider','devReplay','--model','multi-turn','--wait','--json']))
(workspace/'README.md').write_text('Image paste verification\nReview this added line.\n')
