
"""
Agent Governance SDK

A production-grade, low-intrusion SDK for instrumenting AI Agents with
governance and observability.

This SDK provides:
- Trace lifecycle management
- Step capture for LLM calls and tool invocations
- Policy enforcement (ALLOW/HALT decisions)
- Fail-safe operation (agent continues on SDK errors)

Usage:
    from vgovern_sdk import create_guard, StepType, GovernanceHaltError
    
    guard = create_guard(
        backend_url="https://governance.example.com",
        api_key="your-api-key",
        agent_id="my-agent",
    )
    
    with guard.govern() as trace_id:
        @guard.with_governance(step_type=StepType.LLM_CALL, model="gpt-4")
        def my_agent_action(prompt):
            return openai.ChatCompletion.create(...)
        
        result = my_agent_action("Hello, world!", trace_id=trace_id)
"""

from .sdk_types import (
    # Core types
    SDKConfig,
    StepData,
    StepNode,
    TraceInfo,
    TraceMetadata,
    Trace,
    
    # Enums
    StepType,
    TraceStatus,
    GovernanceDecision,
    
    # Data structures
    TokenUsage,
    GovernanceResponse,
    
    # Exceptions
    GovernanceHaltError,
)

from .client import (
    GovernanceClient,
)

from .tracer import (
    Tracer,
)

from .guard import (
    GovernanceGuard,
    create_guard,
    withGovernance,
)

from .utils import (
    TraceLogger,
    get_logger,
    redact_sensitive_data,
    generate_step_id,
    calculate_cost_usd,
)

__version__ = "0.1.0"
__all__ = [
    # Core types
    "SDKConfig",
    "StepData",
    "StepNode",
    "TraceInfo",
    "TraceMetadata",
    "Trace",
    
    # Enums
    "StepType",
    "TraceStatus",
    "GovernanceDecision",
    
    # Data structures
    "TokenUsage",
    "GovernanceResponse",
    
    # Exceptions
    "GovernanceHaltError",
    
    # Clients
    "GovernanceClient",

    # Tracer
    "Tracer",
    
    # High-level API
    "GovernanceGuard",
    "create_guard",
    "withGovernance",
    
    # Utilities
    "TraceLogger",
    "get_logger",
    "redact_sensitive_data",
    "generate_step_id",
    "calculate_cost_usd",
]
