#!/usr/bin/env bash
set -euo pipefail
# Run from the checkout being verified; the server must have T3CODE_DEV_SEED=0.
base_dir="$1"
origin="$2"
synthetic_project="$3"
token_file="$4"
mkdir -p "$synthetic_project"
node apps/server/src/bin.ts project add "$synthetic_project" --title 'Keyboard demo' --base-dir "$base_dir"
node apps/server/src/bin.ts auth session issue --base-dir "$base_dir" --ttl 1h --token-only > "$token_file"
node "$(dirname "$0")/seed.mjs" "$origin" "$token_file"
# Pair using the repository's pair-client.sh, rename the connection Demo in Settings,
# then choose Keyboard demo before invoking the platform interaction driver.
