#!/usr/bin/env bash
# Parameterized version of the CLI seed and turn commands used for both captures.
# Run from either checkout after starting its dev server with T3CODE_DEV_SEED=0
# and COPILOT_GITHUB_TOKEN set from the existing authenticated GitHub CLI.
set -euo pipefail
project_dir="$1"
mkdir -p "$project_dir"
printf 'export const needleValue = 1;\n' > "$project_dir/a.ts"
printf 'export const other = "needleValue";\n' > "$project_dir/b.ts"
git init "$project_dir"
node apps/server/src/bin.ts project add "$project_dir" --title 'Search demo' --base-dir .t3
node apps/server/src/bin.ts thread start "$project_dir" \
 'Use your built-in rg search tool (not a shell command) to find every file containing the text needleValue. Reply with just the file names.' \
 --title 'rg search repro' --provider copilot --model gpt-6-luna --wait --json --base-dir .t3
# Provider instance: driver acpRegistry, id copilot, source local;
# commandPath points to the unmodified Copilot CLI 1.0.114 executable named copilot;
# commandArgs ["--acp", "--allow-all-tools"]. All other real providers disabled.
# Browser: pair, navigate directly to the returned thread id, expand the prompt
# and Worked for activity; close thread details to keep the environment name private.
# Capture at 1280x800 CSS pixels, light theme, device scale 2.
