"""
Worker process for {{ agent_name }} agent.

Starts a WorkerRunner for the agent instance.
"""
from __future__ import annotations

import asyncio
import os
from evenage import WorkerRunner
from agents.{{ agent_name }} import {{ agent_name }}


async def main():
    runner = WorkerRunner(
        agent={{ agent_name }},
        database_url=os.getenv("DATABASE_URL"),
        redis_url=os.getenv("REDIS_URL"),
        minio_endpoint=os.getenv("MINIO_ENDPOINT"),
        minio_access_key=os.getenv("MINIO_ACCESS_KEY"),
        minio_secret_key=os.getenv("MINIO_SECRET_KEY"),
        minio_secure=os.getenv("MINIO_SECURE", "false").lower() == "true",
    )
    print(f"Starting {{ agent_name }} worker...")
    await runner.start()


if __name__ == "__main__":
    asyncio.run(main())
