Files
firefrost-operations-manual/automation/automation-daemon.sh
Michael Krause d664f5ce5b Add Firefrost Automation System
Initial automation framework:
- executor.sh: Runs queued tasks and commits results
- automation-daemon.sh: Watches Git for new tasks every 10s
- queue/: Tasks from Claude (*.sh files)
- results/: Execution results committed back
- logs/: Execution logs and completed tasks

System enables Claude to commit operations to Git,
TX1 pulls and executes automatically, then commits results back.

Reduces manual copy/paste from Michael to ONE command at session start.
Built for marathon sessions and medical accessibility needs.

Phase 1 complete - ready for testing
2026-02-09 10:05:09 -06:00

37 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# Firefrost Automation Daemon
# Watches for new tasks in Git and executes them
REPO_DIR="/root/firefrost-work/firefrost-operations-manual"
LOG_DIR="$REPO_DIR/automation/logs"
EXECUTOR="$REPO_DIR/automation/executor.sh"
CHECK_INTERVAL=10 # Check every 10 seconds
# Function to log with timestamp
log() {
echo "[$(date '+%Y-%m-%d %H:%M:%S')] DAEMON: $1" | tee -a "$LOG_DIR/daemon.log"
}
log "=========================================="
log "Firefrost Automation Daemon Starting"
log "Check Interval: ${CHECK_INTERVAL}s"
log "=========================================="
cd "$REPO_DIR"
while true; do
# Pull latest from Git (quietly)
git pull origin master &>/dev/null
# Check if there are tasks in queue
TASK_COUNT=$(find automation/queue -name "*.sh" -type f 2>/dev/null | wc -l)
if [ "$TASK_COUNT" -gt 0 ]; then
log "Found $TASK_COUNT task(s) in queue - executing..."
bash "$EXECUTOR"
fi
# Wait before next check
sleep "$CHECK_INTERVAL"
done