"""Obol SDK - Trust infrastructure for AI agents.

Safe passage for your agents between realms.

Quick start:
    import obol
    session = obol.start("my-agent")
    # ... your agent code ...
    session.end()

Full control:
    from obol import Obol

    obol = Obol(api_key="ob_live_xxx")
    agent = obol.register("my-agent", model="claude-opus-4-5")

    with obol.session(agent) as session:
        my_agent.run(task)

        if session.can("read", "credentials.database"):
            load_creds()

    score = obol.score(agent)
    print(f"Trust: {score['overall']}/100 ({score['tier']})")
"""
from obol.client import Obol
from obol.session import ObolSession

__version__ = "0.1.0"
__all__ = ["Obol", "ObolSession", "start"]

# Module-level singleton for convenience API
_default_client = None


def start(name: str, **kwargs) -> ObolSession:
    """Quick start: create client from env vars, register agent, begin session.

    Usage:
        import obol
        session = obol.start("my-agent")
        # ... your agent code ...
        session.end()

    Reads OBOL_API_KEY and OBOL_API_URL from environment.
    """
    global _default_client
    if _default_client is None:
        _default_client = Obol()
    return _default_client.start(name, **kwargs)
