"""A2UI (Agent-to-User Interface) module for langchain-ucp.

This module provides A2UI support for building rich, declarative UIs
that can be generated by LLM agents in shopping and commerce flows.

A2UI is NOT a tool - it's a standardization for output formats. The LLM
generates A2UI JSON directly in its response using a delimiter pattern.

The module provides:
1. System prompt helpers to instruct LLMs how to generate A2UI
2. Templates for common commerce UIs (product cards, lists, checkout)
3. Validation utilities for A2UI JSON
4. Schema definitions

Example:
    >>> from langchain_ucp.a2ui import get_a2ui_system_prompt, parse_a2ui_response
    >>> 
    >>> # Build system prompt with A2UI instructions
    >>> system_prompt = base_prompt + get_a2ui_system_prompt()
    >>> 
    >>> # After getting LLM response, parse out A2UI
    >>> text, a2ui_messages = parse_a2ui_response(llm_response)
"""

from langchain_ucp.a2ui.constants import (
    A2UI_EXTENSION_URI,
    A2UI_MIME_TYPE,
    A2UI_VERSION,
    STANDARD_CATALOG_ID,
)
from langchain_ucp.a2ui.schema import (
    A2UI_MESSAGE_SCHEMA,
    A2UI_STANDARD_CATALOG,
    wrap_as_json_array,
)
from langchain_ucp.a2ui.types import (
    A2UIMessage,
    BeginRendering,
    DataModelUpdate,
    DeleteSurface,
    SurfaceUpdate,
    Component,
    DataEntry,
)
from langchain_ucp.a2ui.prompt import (
    A2UI_DELIMITER,
    get_a2ui_system_prompt,
    get_a2ui_schema,
    parse_a2ui_response,
    validate_a2ui_json,
)
from langchain_ucp.a2ui.templates import (
    ProductCardTemplate,
    ProductListTemplate,
    CheckoutTemplate,
    OrderConfirmationTemplate,
    create_product_card,
    create_product_list,
    create_checkout_ui,
    create_order_confirmation,
)

__all__ = [
    # Constants
    "A2UI_EXTENSION_URI",
    "A2UI_MIME_TYPE",
    "A2UI_VERSION",
    "STANDARD_CATALOG_ID",
    "A2UI_DELIMITER",
    # Schema
    "A2UI_MESSAGE_SCHEMA",
    "A2UI_STANDARD_CATALOG",
    "wrap_as_json_array",
    # Types
    "A2UIMessage",
    "BeginRendering",
    "DataModelUpdate",
    "DeleteSurface",
    "SurfaceUpdate",
    "Component",
    "DataEntry",
    # Prompt helpers
    "get_a2ui_system_prompt",
    "get_a2ui_schema",
    "parse_a2ui_response",
    "validate_a2ui_json",
    # Templates
    "ProductCardTemplate",
    "ProductListTemplate",
    "CheckoutTemplate",
    "OrderConfirmationTemplate",
    "create_product_card",
    "create_product_list",
    "create_checkout_ui",
    "create_order_confirmation",
]
