#!/usr/bin/env bash
set -euo pipefail
# Run from the checkout under test after starting its isolated dev server.
proof_home="$PWD/.t3"
workspace="$proof_home/demo"
mkdir -p "$workspace"
printf '# Menu positioning demo\n\nSynthetic sample files.\n' > "$workspace/README.md"
printf 'export const greeting = "Hello";\n' > "$workspace/hello.ts"
git -C "$workspace" init -q -b main
git -C "$workspace" add .
git -C "$workspace" -c user.name=Demo -c user.email=demo@example.invalid commit -q -m 'Initial sample'
node apps/server/src/bin.ts project add "$workspace" --title 'Menu positioning demo' --base-dir "$proof_home"
node apps/server/src/bin.ts thread start "$workspace" 'Show the sample files.' --title 'Sheet menu demo' --provider devReplay --model multi-turn --wait --json --base-dir "$proof_home"
