#!/usr/bin/env bash
# Run from each checkout after starting its fresh isolated app with start-app.ts.
# Arguments: the app's data directory, then a synthetic workspace to create.
set -euo pipefail
scenario_home=$1
scenario_workspace=$2
mkdir -p "$scenario_workspace"
git -C "$scenario_workspace" init -q
ffmpeg -v error -f lavfi -i testsrc2=size=640x360:rate=15 -t 45 -c:v libvpx -b:v 180k -an "$scenario_workspace/clip.webm"
node apps/server/src/bin.ts project add "$scenario_workspace" --title scratch --base-dir "$scenario_home"
node apps/server/src/bin.ts thread start "$scenario_workspace" Start --title 'Video keyboard proof' --provider devReplay --model multi-turn --wait --json --base-dir "$scenario_home"
# Pair the browser, navigate directly to /<environmentId>/<threadId>, close thread
# details, open the right panel > Files, and select clip.webm. Use a 1440x1080
# light-theme viewport. Call reproduce(previewTools, tabId) from manual-driver.mjs.
