a11621b21f
Mirror mo/atc-GPU layout with config/, docs/, scripts/ for Gitea deploy.
35 lines
1.0 KiB
Python
35 lines
1.0 KiB
Python
"""Fan-out lab events to supervisor agents Mo & Bart."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from agent_terminal import terminal_log
|
|
from node_registry import NODE_IDS
|
|
|
|
SUPERVISOR_IDS = ["mo-commander", "bart-commander"]
|
|
OPERATOR_IDS = {
|
|
"etl-guardian", "lakehouse-ops", "data-custodian", "hadoop-ranger", "infra-sentinel",
|
|
"network-watcher", "mcp-coordinator",
|
|
}
|
|
|
|
|
|
async def mirror_to_supervisors(
|
|
source: str,
|
|
message: str,
|
|
*,
|
|
level: str = "info",
|
|
phase: str = "intel",
|
|
) -> None:
|
|
icon = {"warn": "⚠", "err": "✗", "ok": "✓"}.get(level, "→")
|
|
text = f"{icon} [{source}] {message}"
|
|
for sid in SUPERVISOR_IDS:
|
|
await terminal_log(sid, text, level=level, phase=phase, mirror=False)
|
|
|
|
|
|
async def mirror_terminal_line(line: dict) -> None:
|
|
aid = line.get("agent_id", "")
|
|
if aid in SUPERVISOR_IDS or aid in NODE_IDS:
|
|
return
|
|
if aid in OPERATOR_IDS:
|
|
lvl = line.get("level", "info")
|
|
await mirror_to_supervisors(aid, line.get("text", "")[:240], level=lvl, phase="trace")
|