"""Condensa Code contract validation library.

Parse, validate, and check Condensa Code contracts:

    from cdn.contracts import parse_contract, check, ContractSet

    # Parse contracts from Condensa Code
    contracts = parse_contract('''
        !:fn DashboardPage /props:(programs:Program[] onSelect:fn(id:n)->void)
        !:type Program { id:n name:s* weeks:n }
        !:wire dashboard.onSelect -> programs.highlight
    ''')

    # Validate a component against its contract
    result = check("DashboardPage", props=["programs", "onSelect"], contracts=contracts)
    print(result)  # =:check pass props:(programs,onSelect) missing:() extra:() !

    # Check wire compatibility
    issues = contracts.validate_wires()
"""

from .parser import parse_contract, parse_line
from .types import (
    FnContract,
    TypeContract,
    WireContract,
    DefContract,
    ApiContract,
    SchemaContract,
    ContractSet,
    CheckResult,
)
from .validator import check, validate_wires, validate_all

__all__ = [
    "parse_contract",
    "parse_line",
    "check",
    "validate_wires",
    "validate_all",
    "FnContract",
    "TypeContract",
    "WireContract",
    "DefContract",
    "ApiContract",
    "SchemaContract",
    "ContractSet",
    "CheckResult",
]
