#!/usr/bin/env bash
# Run from each isolated checkout after vp i.
# Start its real web app with a fresh database:
# T3CODE_DEV_SEED=0 GOOGLE_GEMINI_BASE_URL=<provided hub URL> vp run dev
# In Settings > Providers, add Antigravity, Gemini API key, key proof-key.
# Create an empty git repository and pass its absolute path as $1.
node apps/server/src/bin.ts project add "$1" --title 'Port discovery proof' --base-dir .t3
node apps/server/src/bin.ts thread start "$1" 'Start a simple HTTP dev server on a free localhost port in its own process group. Keep it running. Tell me the port.' --title 'Agent listener proof' --provider antigravity --model gemini-3.8-flash --base-dir .t3 --json
# Pair the browser and open the returned thread at /<environment-id>/<encoded-thread-id>.
# Inspect Thread details. Hover an agy listener and click its Stop button if present.
# Compare /proc/<agent-pid>/stat, its T3CODE_THREAD_ID, and ss -H -ltnp before/after.
