#!/usr/bin/env bash
set -euo pipefail
# Run from the commit's checkout, after starting T3CODE_DEV_SEED=0 vp run dev --host 0.0.0.0.
# Use that checkout's private data directory, never the installed application's data.
: "${T3_PROOF_HOME:?Set to this checkout's isolated T3 home}"
project_output=$(node apps/server/src/bin.ts project add "$PWD" --title 'Snooze evidence' --base-dir "$T3_PROOF_HOME")
project_id=$(printf '%s\n' "$project_output" | sed -n 's/^Added project \([^ ]*\) .*/\1/p')
node apps/server/src/bin.ts thread start "$project_id" 'Show a brief sample response.' --title 'Snooze language example' --provider devReplay --model multi-turn --wait --json --base-dir "$T3_PROOF_HOME"
