"""Protocol-specific boundary connectors and their plugin registrations."""

from cmvr_edge_ai.plugins import PluginKind, PluginRegistry, PluginSpec

from .cmvr_es import CmvrAgvCommandSink, CmvrCameraRgbStreamSource
from .platform import PlatformHttpJsonSink


def register_connector_plugins(registry: PluginRegistry) -> None:
    registry.register(
        PluginSpec(
            plugin_id="cmvr.grpc.camera_rgb_stream@1",
            kind=PluginKind.SOURCE,
            factory=CmvrCameraRgbStreamSource,
            outputs={"frames": "ImageFrame/v1"},
            description="Start and subscribe to a cmvr-es encoded RGB camera stream",
            tags=frozenset({"sensor", "transport:grpc"}),
        )
    )
    registry.register(
        PluginSpec(
            plugin_id="cmvr.grpc.agv_command_sink@1",
            kind=PluginKind.SINK,
            factory=CmvrAgvCommandSink,
            inputs={"commands": "ApprovedRobotCommand/v1"},
            description="Typed, non-retrying cmvr-es AGV command sink",
            tags=frozenset({"actuator", "transport:grpc"}),
        )
    )
    registry.register(
        PluginSpec(
            plugin_id="platform.http_json_sink@1",
            kind=PluginKind.SINK,
            factory=PlatformHttpJsonSink,
            inputs={"input": "*"},
            description="POST protocol-neutral envelopes as JSON",
            tags=frozenset({"telemetry", "transport:http"}),
        )
    )


__all__ = ["register_connector_plugins"]
