#!/bin/sh
# Run inside each isolated checkout after starting its dev server.
# Usage: sh seed.sh WORKSPACE THREAD_TITLE
set -eu
workspace=$1
title=$2
if [ ! -d "$workspace/.git" ]; then
  git init --initial-branch=main "$workspace"
  git -C "$workspace" -c user.name=Proof -c user.email=proof@example.invalid commit --allow-empty -m 'Initial synthetic workspace'
fi
node apps/server/src/bin.ts project add "$workspace" --title 'Transport fault proof' --base-dir .t3
node apps/server/src/bin.ts thread start "$workspace" 'Reply with just ready. Do not run tools.' --provider codex --model gpt-6-luna --title "$title" --json --base-dir .t3
