"""
CMDC Python SDK — 连接 cmdc_gateway 的客户端库。

支持 HTTP + SSE 流式接收 + WebSocket 双向 HITL。

快速开始::

    from cmdc import CMDC

    client = CMDC(base_url="http://localhost:4000", api_key="sk-abc123")

    with client.session(model="deepseek:deepseek-chat") as session:
        for event in session.prompt("帮我写一个快速排序"):
            if event.type == "message_delta":
                print(event.data["delta"], end="", flush=True)
"""

__version__ = "0.1.0"

from cmdc.client import CMDC
from cmdc.session import Session
from cmdc.types import (
    Event,
    SessionOptions,
    SessionInfo,
    Stats,
    Message,
    PromptResponse,
    HealthInfo,
)
from cmdc.approval import ApprovalPolicy, AutoApprove, AutoReject, PromptApproval
from cmdc.tools import LocalTool
from cmdc.exceptions import (
    CMDCError,
    AuthError,
    SessionNotFoundError,
    RateLimitError,
    SessionCreateError,
    BadRequestError,
)

__all__ = [
    "__version__",
    "CMDC",
    "Session",
    "Event",
    "SessionOptions",
    "SessionInfo",
    "Stats",
    "Message",
    "PromptResponse",
    "HealthInfo",
    "ApprovalPolicy",
    "AutoApprove",
    "AutoReject",
    "PromptApproval",
    "LocalTool",
    "CMDCError",
    "AuthError",
    "SessionNotFoundError",
    "RateLimitError",
    "SessionCreateError",
    "BadRequestError",
]
