feat: Dynamic MeshMonitor trigger sync — auto-ignore MeshMonitor commands

Add MeshMonitorSync class that reads trigger patterns from a JSON file
and compiles them to regex. The router checks incoming messages against
these patterns and ignores messages that MeshMonitor will handle.

- New meshai/meshmonitor.py: Pattern compilation and file watching
- MeshMonitorConfig dataclass with enabled, triggers_file, inject_into_prompt
- Router integration: ignore matching messages, inject commands into prompt
- Main loop refresh: watch triggers file for changes without restart

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
root 2026-05-03 03:20:23 +00:00
commit f6540e893d
7 changed files with 251 additions and 0 deletions

View file

@ -61,10 +61,20 @@ llm:
Keep responses VERY brief - under 250 characters total.
Be concise but friendly. No markdown formatting.
google_grounding: false
meshmonitor:
enabled: false
triggers_file: /data/triggers.json
inject_into_prompt: true
EOF
echo "Default config created. Configure via http://localhost:7682"
fi
# Create triggers.json if missing
if [ ! -f "/data/triggers.json" ]; then
echo '{"triggers": []}' > /data/triggers.json
fi
# Start ttyd for web-based config access
echo "Starting web config interface on port 7682..."
ttyd -W -p 7682 \