"""
{{ display_name }} - Process node.

This module contains the main processing logic for the automation.
"""

from torivers_sdk.automation.output import TextBlock, build_output_data

from state import {{ class_name }}State


async def process(state: {{ class_name }}State) -> dict:
    """Process the input data.

    Args:
        state: Current automation state.

    Returns:
        Dictionary with state updates.
    """
    context = state["context"]
    input_data = state["input_data"]

    context.log_progress("Processing", "Starting data processing...")

    # Get input data
    data = input_data.get("data", "")

    # Process the data (replace with your logic)
    result = f"Processed: {data}"

    context.log_success("Processing complete", f"Result length: {len(result)}")

    return {
        "current_step": "completed",
        "result": result,
        "success": True,
        "output_data": build_output_data(
            TextBlock(label="Result", content=result, format="plain"),
        ),
    }
