"""CrashSense — AI Agent for DeFi Transaction Failure Diagnosis.

Quick start
-----------
::

    from crashsense import CrashSense

    cs = CrashSense(provider="gemini", chain="ethereum")
    result = cs.diagnose("0xabc…")
    print(result["analysis"]["explanation"])
"""

__version__ = "1.0.0"
__app_name__ = "CrashSense"

# Lazy public API — import only when accessed to keep startup fast
def __getattr__(name: str):
    if name == "CrashSense":
        from .sdk import CrashSense as _CS
        return _CS
    if name == "MemoryStore":
        from .core.memory import MemoryStore as _MS
        return _MS
    if name == "TxAnalyzer":
        from .core.tx_analyzer import TxAnalyzer as _TA
        return _TA
    if name == "RemediationEngine":
        from .core.remediation import RemediationEngine as _RE
        return _RE
    if name == "ChainFetcher":
        from .core.chain_fetcher import ChainFetcher as _CF
        return _CF
    if name == "LLMAdapter":
        from .core.llm_adapter import LLMAdapter as _LA
        return _LA
    raise AttributeError(f"module 'crashsense' has no attribute {name!r}")

__all__ = [
    "__version__",
    "__app_name__",
    "CrashSense",        # High-level SDK facade
    "MemoryStore",       # SQLite history store
    "TxAnalyzer",        # Diagnostic engine
    "RemediationEngine", # Fix suggestions
    "ChainFetcher",      # Blockchain data fetcher
    "LLMAdapter",        # Multi-provider LLM adapter
]
