"""
{{ display_name }} - Main automation module.

This module defines the main automation class that orchestrates
the workflow using LangGraph state machine.
"""

from torivers_sdk import Automation, AutomationMetadata
from torivers_sdk.automation import END, START, StateGraph

from nodes import process
from state import {{ class_name }}State


class {{ class_name }}(Automation[{{ class_name }}State]):
    """{{ display_name }} automation."""

    def metadata(self) -> AutomationMetadata:
        """Load automation metadata from YAML manifest."""
        return AutomationMetadata.from_yaml("automation.yaml")

    def get_state_class(self) -> type[{{ class_name }}State]:
        """Return the state class for this automation."""
        return {{ class_name }}State

    def build_graph(self) -> StateGraph:
        """Build the LangGraph workflow."""
        graph = StateGraph({{ class_name }}State)

        # Add nodes
        graph.add_node("process", process)

        # Define edges
        graph.add_edge(START, "process")
        graph.add_edge("process", END)

        return graph


# Export the automation class for discovery
automation = {{ class_name }}
