#!/usr/bin/env bash
set -u

# Read-only checks only: this script does not install, change, delete, log in, or spend credits.
check() {
  local label="$1"
  shift
  if command -v "$1" >/dev/null 2>&1; then
    printf '\n[found] %s\n' "$label"
    "$@" 2>&1 | head -n 3 || true
  else
    printf '\n[missing] %s (command: %s)\n' "$label" "$1"
  fi
}

check "Claude Code" claude --version
check "Git" git --version
check "Node.js" node --version
check "npm" npm --version
check "Python 3" python3 --version
check "FFmpeg" ffmpeg -version
check "FFprobe" ffprobe -version
check "Treg CLI" treg --version
check "HyperFrames CLI" npx --no-install hyperframes --version

printf '\n[notes]\n'
printf '%s\n' '- This is a read-only preflight. It does not authenticate to Treg or show balance.'
printf '%s\n' '- If the HyperFrames CLI is not locally installed, follow the current official setup instructions.'
printf '%s\n' '- Review current official docs before invoking paid generation or package-install commands.'
