#!/usr/bin/env bash
# answer-check.sh  -  PostToolUse hook (AskUserQuestion) for the pipeline.
#
# Tells the model which questions came back with no choice, so an empty answer
# is asked again instead of resolved to the Recommended option. The logic is in
# answer-check.mjs; this wrapper exists because every hook the pipeline
# registers is a `bash "$HOME/.<host>/scripts/<name>"` command.
#
# Exits 0 on every path: a missing node or any internal error means no
# context, never a blocked tool call.

set -u

HERE="$(cd "$(dirname "$0")" 2>/dev/null && pwd || true)"
CORE="$HERE/answer-check.mjs"
[ -f "$CORE" ] || exit 0
command -v node >/dev/null 2>&1 || exit 0

node "$CORE" 2>/dev/null || true
exit 0
