#!/usr/bin/env bash
# Run from the checkout being captured with a fresh isolated backend and Metro.
# Arguments: base-dir, reachable-backend, reachable-metro, output-directory, session.
set -euo pipefail
proof_home=$1
backend=$2
metro=$3
out=$4
session=$5
mkdir -p "$out/demo"
git init -q "$out/demo"
node apps/server/src/bin.ts project add "$out/demo" --title 'Prompt link proof' --base-dir "$proof_home"
node apps/server/src/bin.ts thread start "$out/demo" $'Hello\u200b world' --title 'Visible and hidden' --provider devReplay --model multi-turn --wait --json --base-dir "$proof_home"
node apps/server/src/bin.ts thread start "$out/demo" $'\u200b' --title 'Hidden only' --provider devReplay --model multi-turn --wait --json --base-dir "$proof_home"
# Install via mobile:install, open the Metro development URL, and pair using a
# fresh auth pairing create link. Accept the iOS Open confirmation when shown.
# Record, open Visible and hidden, expand Agent, long-press the USER message's
# Copy message control (the upper control), and capture the menu BEFORE copying.
# Tap Copy prompt link, go Back, open Hidden only, expand Agent, and long-press
# the same upper Copy message control. Capture BEFORE copying or pasting.
# Use stable-mobile.py for identical screenshots 500 ms apart; stop recording.
# These UI steps were driven with agent-device snapshot -i, click, longpress,
# screenshot, back, and record start/stop, all with --session "$session".
