#!/bin/sh
# Holocomm hook for Claude Code. Passes the hook JSON to `holocomm reply`.
# Never blocks or fails Claude: if Holocomm isn't installed or running, it exits quietly.
# Optional: HOLOCOMM_AGENT=<slug> picks which face speaks for this terminal.
for c in "$HOLOCOMM_BIN" "$(command -v holocomm 2>/dev/null)" "${HOLOCOMM_HOME:-$HOME/.holocomm}/bin/holocomm"; do
  if [ -n "$c" ] && [ -x "$c" ]; then
    if [ -n "$HOLOCOMM_AGENT" ]; then
      "$c" reply --adapter claude-code --agent "$HOLOCOMM_AGENT" >/dev/null 2>&1
    else
      "$c" reply --adapter claude-code >/dev/null 2>&1
    fi
    exit 0
  fi
done
cat >/dev/null
exit 0
