#!/bin/bash
# Inbox monitor for Coder agent
while true; do
  for f in /opt/aicouncil/council/coder/inbox/task_*.md; do
    if [ -f "$f" ]; then
      fname=$(basename "$f")
      if [[ ! "$fname" =~ (DONE|APPROVED|completed) ]]; then
        echo "NEW_TASK:$f"
        exit 0
      fi
    fi
  done
  sleep 10
done
