#!/usr/bin/env bash
# Runs the local HyperFrames CLI on the Node 20.9 that is installed here.
# bin/hyperframes.mjs refuses Node < 22, so this calls dist/cli.js directly and
# preloads a load hook (see hooks.mjs) that fixes the one import Node 20.9 cannot parse.
set -euo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT="$(cd "$HERE/.." && pwd)"
export NODE_OPTIONS="--no-warnings --import $HERE/register.mjs ${NODE_OPTIONS:-}"
export HYPERFRAMES_NO_TELEMETRY=1
export DO_NOT_TRACK=1
export HYPERFRAMES_SKIP_SKILLS=1
exec node "$ROOT/node_modules/hyperframes/dist/cli.js" "$@"
