"""Template step — format and post a message to the target room.""" import logging logger = logging.getLogger(__name__) async def execute_template(config: dict, send_text=None, target_room: str = "", **_kwargs) -> str: """Render a template message and post it to the target room.""" template = config.get("template", config.get("message", "")) if not template: raise ValueError("template step requires 'template' or 'message' field") # Template is already rendered by the engine before reaching here if send_text and target_room: await send_text(target_room, template) return template