#!/bin/sh
"""":
# Vibecrafted launcher. This sh prelude hands the file to an interpreter the
# product owns: the generation's bin/python3, then VIBECRAFTED_PYTHON, then a
# source checkout's own venv. A host python3 (macOS ships 3.9.6) cannot import
# vibecrafted_core, so PATH is never consulted and there is no host fallback.
entry=$0
while [ -L "$entry" ]; do
  link=$(readlink "$entry") || break
  case $link in
    /*) entry=$link ;;
    *) entry=$(dirname -- "$entry")/$link ;;
  esac
done
here=$(CDPATH='' cd -- "$(dirname -- "$entry")" && pwd -P) || exit 127
for py in "$here/python3" "${VIBECRAFTED_PYTHON:-}" "$here/../.venv/bin/python3"; do
  if [ -n "$py" ] && [ -x "$py" ]; then
    exec "$py" "$0" "$@"
  fi
done
printf '%s: no Vibecrafted interpreter (expected %s/python3 or VIBECRAFTED_PYTHON); refusing host python3\n' "${0##*/}" "$here" >&2
exit 127
":"""
from __future__ import annotations

import sys
from pathlib import Path

ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / "vibecrafted-core"))

from vibecrafted_core.wrappers import intents_main

raise SystemExit(intents_main())
