Module topics

Module topics 

Source
Expand description

Well-known MQTT topic constants and builder helpers.

All AgentFlow topics follow one of two patterns:

  • agents/{agent_id}/{event} — per-actor events
  • system/{event} — system-wide broadcasts

Use the builder functions to avoid string formatting errors in call sites.

Constants§

AGENTS_ALL
Subscribe to all agent events (wildcard).
IO_CHAT
io/chat — inbound messages from the UI gateway.
SYSTEM_HEALTH
System-wide health topic.
SYSTEM_LLM_ERROR
LLM provider error broadcast (published by LlmAgent / MainActor on API failure). Payload: { provider, model, error, consecutiveErrors, timestampMs }
SYSTEM_LLM_SWITCH
LLM provider switch command (published by WIK agent to trigger hot-swap). Payload: { provider, model, apiKey?, baseUrl?, reason }
SYSTEM_SHUTDOWN
System-wide shutdown topic.

Functions§

alert
agents/{id}/alert
chat
agents/{id}/chat — direct chat messages to/from an agent.
commands
agents/{id}/commands — topic on which the agent listens for commands.
detections
agents/{id}/detections — ML/monitoring agents publish detections here.
heartbeat
agents/{id}/heartbeat
logs
agents/{id}/logs
parse_agent_topic
Extract (agent_id, event) from an agents/{id}/{event} topic.
result
agents/{id}/result — agent publishes task results here.
spawn
agents/{id}/spawn — agent announces its presence on startup.
status
agents/{id}/status