#!/usr/bin/env bash
# Run from either isolated checkout after vp i and T3CODE_DEV_SEED=0 vp run dev.
# In Settings > Providers, add an OpenCode instance with the default binary.
# Requires real OpenCode 2.4.3 authenticated for anthropic/claude-haiku-5-5.
set -euo pipefail
sample_root="${1:?Pass an absolute synthetic-data output directory}"
run_dir="$sample_root/$(date -u +%Y%m%dT%H%M%SZ)"
project_dir="$run_dir/demo-project"
mkdir -p "$project_dir"
for filename in index.ts util.ts App.tsx Button.tsx; do
  printf 'export {};\n' > "$project_dir/$filename"
done
node apps/server/src/bin.ts project add --base-dir .t3 --title demo-project "$project_dir"
node apps/server/src/bin.ts thread start --base-dir .t3 --provider opencode --model anthropic/claude-haiku-5-5 --title 'Filename glob searches' "$project_dir" 'Use your glob tool twice, as two consecutive tool calls with no text in between: first list files matching the pattern "**/*.ts", then list files matching "**/*.tsx". Do not use any other tool. After both calls finish, reply with just "done".' --wait --json > "$run_dir/turn.json"
cat "$run_dir/turn.json"
# Open the returned thread in the paired web client (1280x800, light theme).
# Hide the sidebar and thread-details panel. Expand the original prompt.
# Click Worked for, inspect the collapsed search group, expand it to see both
# glob entries, then collapse the group again. Record the same steps per side.
