#!/usr/bin/env bash
# Run against each checkout's Metro bundle and its independently seeded server.
# Pair with the repository pair-client.sh helper before starting.
# Open Main thread; fill Ask anything with /side Side question for repro; Send;
# Navigate up to the parent. CHIP is the generated side-chat accessibility label.
set -euo pipefail
session="$1"
chip="$2"
side="$3"
out="$4"
agent-device record start "$out/$side-flow.mp4" --scope app --hide-touches --session "$session"
agent-device press "label=\"$chip\"" --settle --session "$session"
agent-device press 'label="Navigate up"' --settle --session "$session"
agent-device longpress "label=\"$chip\"" --settle --session "$session"
if [ "$side" = head ]; then
  agent-device press 'label="Delete side chat"' --settle --session "$session"
  agent-device press 'text="Delete"' --settle --session "$session"
else
  agent-device press 'label="Navigate up"' --settle --session "$session"
fi
agent-device record stop --session "$session"
# Before stills, take two screenshots at least 500 ms apart and compare pixels.
# Public exports mask only the environment subtitle (x145,y148,w556,h50).
