#!/bin/bash MSG="$1" # E2E if echo "$MSG" | grep -qiE "e2e|end.to.end|bout.*bout"; then /opt/wevia-brain/e2e-test.sh 2>/dev/null; exit 0 fi # TOOLHUB if echo "$MSG" | grep -qiE "toolhub|outil.*dispo|tools.*status"; then /opt/wevia-brain/toolhub-status.sh 2>/dev/null; exit 0 fi # CASCADE if echo "$MSG" | grep -qiE "cascade.*config|config.*cascade|quelle.*cascade"; then /opt/wevia-brain/cascade-config.sh 2>/dev/null; exit 0 fi # PROVIDERS TEST if echo "$MSG" | grep -qiE "test.*provider|provider.*test|teste.*cascade"; then /opt/wevia-brain/providers-test.sh 2>/dev/null; exit 0 fi # SCREENSHOTS if echo "$MSG" | grep -qiE "screenshot|capture|video|webm"; then echo "SCREENSHOTS & VIDEOS:" ls -lt /var/www/html/screenshots/*.png 2>/dev/null | head -10 | awk '{print $6,$7,$8,$9}' echo "" echo "Videos:" ls -lt /var/www/html/screenshots/pw-archi/*.webm 2>/dev/null | head -5 | awk '{print $5,$9}' exit 0 fi # PW COUNT if echo "$MSG" | grep -qiE "combien.*page.*playwright|playwright.*combien"; then SHOTS=$(ls /var/www/html/screenshots/*.png 2>/dev/null | wc -l) VIDS=$(ls /var/www/html/screenshots/pw-archi/*.webm 2>/dev/null | wc -l) echo "PLAYWRIGHT: $SHOTS screenshots, $VIDS videos" exit 0 fi # No match exit 1