Files
foodlinkk-command-center/cockpit/app/services/agent_names.py
T
Aissa 22a17ed048 Activate agent mesh with honest live status and working animations.
Souls now aggregate aliased events (e.g. halal_engine), KPIs reflect 6h activity, active agents animate, and morning scheduler/scripts target cockpit :8610.
2026-08-01 17:59:32 +00:00

41 lines
1.1 KiB
Python

"""Normalize legacy agent_name values to agent_souls keys."""
from __future__ import annotations
AGENT_NAME_MAP: dict[str, str] = {
"retail_360": "retail",
"retail_scraper": "retail",
"retail_crm": "retail",
"retail_intel": "retail",
"rss_feeds": "marketing",
"wholesale_scraper": "sourcing",
"halal_registry": "halal",
"halal_engine": "halal",
"halal_reco": "halal",
"branch_scraper": "sourcing",
"hermes": "herman",
"herman_delegate": "herman",
"ops": "sysops",
"sysop": "sysops",
"web_builder": "webbuilder",
"packaging_agent": "packaging",
}
def normalize_agent_key(name: str | None) -> str:
key = (name or "").strip().lower()
if not key:
return ""
return AGENT_NAME_MAP.get(key, key)
def aliases_for_key(canonical: str) -> list[str]:
"""All raw agent_name values that map to this soul key (including the key itself)."""
key = (canonical or "").strip().lower()
if not key:
return []
names = {key}
for raw, canon in AGENT_NAME_MAP.items():
if canon == key:
names.add(raw)
return sorted(names)