#!/usr/bin/env bash
set -euo pipefail
# Run from the tested checkout with its fresh server already running (T3CODE_DEV_SEED=0).
# Arguments: isolated T3 home; synthetic workspace directory.
proof_home="$1"
proof_workspace="$2"
mkdir -p "$proof_workspace"
git init -q --initial-branch=main "$proof_workspace"
node apps/server/src/bin.ts project add "$proof_workspace" --title "Palette replay" --base-dir "$proof_home"
node apps/server/src/bin.ts thread start "$proof_workspace" "Terminal palette replay demonstration" --title "Palette replay" --provider devReplay --model multi-turn --base-dir "$proof_home" --wait --json
