#!/usr/bin/env bash
set -eu
# Run inside either installed checkout, with its isolated dev server already running.
# Pass a new synthetic workspace directory and that checkout's isolated T3 home.
workspace=$1
t3_home=$2
mkdir -p "$workspace"
git init --quiet --initial-branch=main "$workspace"
git -C "$workspace" -c user.name=Scenario -c user.email=scenario@example.invalid commit --quiet --allow-empty -m Initial
node apps/server/src/bin.ts project add "$workspace" --title 'Slash command demo' --base-dir "$t3_home"
node apps/server/src/bin.ts thread start "$workspace" 'Reply exactly READY with no other text.' --title 'Compact during active work' --provider claudeAgent --model claude-haiku-5-5 --base-dir "$t3_home" --json

