#!/bin/bash
# bash run.sh <hf|plain> <rep>  fresh folder; hf gets the 4 HyperFrames skills, both get the same deny list.
set -u
arm=$1; rep=$2; H=$(cd "$(dirname "$0")" && pwd); W=${RUNS:-$H/runs}/$arm-$rep
[ -f "$W/out.json" ] && exit 0
rm -rf "$W"; mkdir -p "$W/.claude" && cp "$H/proj/.claude/settings.json" "$W/.claude/"
[ "$arm" = hf ] && cp -R "$H/proj/.claude/skills" "$W/.claude/"
BASE="make a 15-second 1920x1080 product intro video for AgentCraft (agentcraft.dev), a site with AI image and video prompts shown with their real outputs, plus a directory of 5,087 reviewed Claude Code skills. Three beats: the name with a fade-in title, a line about prompts with real outputs, a line about the skills directory with the number counting up, then the URL."
if [ "$arm" = hf ]; then P="Using /hyperframes, $BASE Render it locally to renders/agentcraft-intro.mp4 with the npx hyperframes CLI. Work locally only: no HeyGen sign-in, cloud render, publish or share."
else P="Please $BASE Render it locally to renders/agentcraft-intro.mp4. Work locally only."; fi
cd "$W" && s=$(date +%s) && claude -p "$P" --model haiku --setting-sources project --output-format json --allowedTools Bash Read Write Edit Glob Grep Skill < /dev/null > out.json 2> err.txt; echo $(( $(date +%s) - s )) > wall.txt
