#!/usr/bin/env bash
set -euo pipefail

# Read changed repo paths from stdin. Markdown skills are loaded from the synced
# profile per turn; runtime code changes still require a gateway restart.
restart_required=1
while IFS= read -r path || [ -n "$path" ]; do
  case "$path" in
    hermes-agent/leoclean-bin/*)
      restart_required=0
      ;;
    hermes-agent/leoclean-skills/vps/*.md|hermes-agent/leoclean-skills/vps/*/*.md)
      ;;
    hermes-agent/leoclean-skills/vps/*)
      restart_required=0
      ;;
    hermes-agent/leoclean-plugins/vps/*)
      restart_required=0
      ;;
    hermes-agent/patches/*)
      restart_required=0
      ;;
  esac
done

exit "$restart_required"
