"""Keiro gateway: routes, handlers, middleware, SSE streaming.

Public API:
    create_app  -- build the aiohttp Application
    run_server  -- start the server with sensible defaults

These are imported lazily to avoid circular dependencies when
subpackages (http, pipeline, etc.) are imported before the
top-level package is fully initialized.
"""


def __getattr__(name: str):
    if name in ("create_app", "run_server"):
        from keiro.gateway.server import create_app, run_server

        globals()["create_app"] = create_app
        globals()["run_server"] = run_server
        return globals()[name]
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")


__all__ = ["create_app", "run_server"]
