"""
mizan-fastapi — FastAPI backend adapter for the Mizan protocol.

HTTP RPC dispatch, context bundling, and a WebSocket carrying channel
subscriptions and RPC on mizan-django's envelope. Forms, Shapes and SSR are
out of scope — FastAPI projects use native equivalents.

Usage:
    from fastapi import FastAPI
    from mizan_fastapi import router, mizan_exception_handler, MizanError

    app = FastAPI()
    app.include_router(router, prefix="/api/mizan")
    app.include_router(ws_router, prefix="/api/mizan")
    app.add_exception_handler(MizanError, mizan_exception_handler)

    # Register your @client-decorated functions
    from mizan_core.client.function import client
    from mizan_core.registry import register
    from .my_functions import echo
    register(echo, "echo")
"""

from .executor import (
    ErrorCode,
    MizanError,
    NotFound,
    BadRequest,
    ValidationFailed,
    Unauthorized,
    Forbidden,
    NotImplementedYet,
    InternalError,
    compute_invalidation,
    execute_function,
)
from .router import router, mizan_exception_handler, mizan_validation_handler
from .websocket import ws_router
from .channels import ReactChannel, broadcast, get_channel, register as register_channel

__all__ = [
    "router",
    "ws_router",
    "ReactChannel",
    "register_channel",
    "get_channel",
    "broadcast",
    "mizan_exception_handler",
    "mizan_validation_handler",
    "execute_function",
    "compute_invalidation",
    "ErrorCode",
    "MizanError",
    "NotFound",
    "BadRequest",
    "ValidationFailed",
    "Unauthorized",
    "Forbidden",
    "NotImplementedYet",
    "InternalError",
]
