#!/usr/bin/env bash
set -eu
app="$1"
workspace="$2/Queue demo"
mkdir -p "$workspace"
printf '# Reference notes\nSynthetic data for a queued-message demonstration.\n' > "$workspace/README.md"
git -C "$workspace" init -q -b main
git -C "$workspace" add README.md
git -C "$workspace" -c user.name=Scenario -c user.email=scenario@example.invalid commit -qm 'Initial commit'
cd "$app"
node apps/server/src/bin.ts project add "$workspace" --title 'Queue demo' --base-dir .t3/capture-final
node apps/server/src/bin.ts thread start "$workspace" 'Summarize the notes' --title 'Reference notes' --provider devReplay --model multi-turn --wait --json --base-dir .t3/capture-final
