#!/usr/bin/env bash
set -eu
checkout="$1"
home_dir="$2"
workspace="$checkout/.t3/file-freshness"
mkdir -p "$workspace"
printf '# Revision A\n\nOriginal host contents.\n' > "$workspace/revision.md"
git -C "$workspace" init -q
git -C "$workspace" add revision.md
git -C "$workspace" -c user.name=Scenario -c user.email=scenario@example.invalid commit -qm 'Initial file'
cd "$checkout"
node apps/server/src/bin.ts project add "$workspace" --title 'File freshness' --base-dir "$home_dir"
node apps/server/src/bin.ts thread start "$workspace" 'Review the workspace file.' --title 'Host file review' --provider devReplay --model multi-turn --wait --json --base-dir "$home_dir"
