1.7 KiB
1.7 KiB
MACP Phase 2A
MACP Phase 2A adds the repo-local event bridge that makes orchestrator lifecycle events consumable by external systems.
What Changed
tools/orchestrator-matrix/events/event_watcher.pypolls.mosaic/orchestrator/events.ndjson, parses appended NDJSON events, dispatches callbacks, and persists a byte-offset cursor in.mosaic/orchestrator/event_cursor.json.tools/orchestrator-matrix/events/webhook_adapter.pyforwards selected MACP events to a configured webhook endpoint with bounded retries and optional bearer auth.tools/orchestrator-matrix/events/discord_formatter.pyrenders task lifecycle events into concise Discord-friendly status lines.bin/mosaic-macpaddswatchmode for one-shot or continuous event processing.
Watcher Behavior
- File watching is polling-based and stdlib-only for portability.
- The watcher resets its cursor if the events file is truncated.
- Corrupt JSON lines are logged to stderr and skipped.
- A trailing partial line is left unread until the newline arrives, preventing half-written events from being consumed.
Webhook Configuration
Configure .mosaic/orchestrator/config.json under macp.webhook:
{
"macp": {
"webhook": {
"enabled": false,
"url": "http://localhost:8080/macp/events",
"auth_token": "",
"timeout_seconds": 10,
"retry_count": 2,
"event_filter": ["task.completed", "task.failed", "task.escalated"]
}
}
}
CLI
mosaic macp watch --once
mosaic macp watch --webhook
--once performs a single poll and exits. --webhook enables delivery via the configured macp.webhook block while still printing Discord-formatted event lines to stdout.