#!/usr/bin/env bash
set -uo pipefail
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
LIB="$DIR/../lib/provision-account-dir.sh"
PASS=0; FAIL=0; FAILED=()
c(){ if grep -qF "$1" "$LIB"; then PASS=$((PASS+1)); else FAIL=$((FAIL+1)); FAILED+=("$2"); fi; }
c 'preference-consult-gate.sh' "gate registered"
c 'preference-consult-directive.sh' "directive registered"
c 'mcp__plugin_email_email__email-send' "email matcher present"
c 'mcp__plugin_outlook_outlook__outlook-mail-send' "outlook matcher present"
echo "----- $PASS passed, $FAIL failed -----"
for f in "${FAILED[@]:-}"; do [ -n "$f" ] && echo "  $f"; done
[ "$FAIL" -eq 0 ]
