"""
Type Aliases for Core Shared Modules

This module defines common type aliases used throughout the core package to replace
excessive 'object' usage with more specific, documented types.

Usage Guidelines:
    - Use JSONDict for general JSON-like dictionaries with string keys
    - Use JSONValue for any valid JSON value type
    - Use ContextData for agent/workflow context data
    - Use specific Protocol types when you need structural typing

When to use 'object' (sparingly):
    - Truly dynamic data where structure is completely unknown
    - Third-party library return types that aren't typed
    - Generic wrapper functions (prefer TypeVar when possible)

Always prefer Union types, Protocols, or TypedDict over 'object' when possible.

Constitutional Hash: 608508a9bd224290
"""

# Constitutional hash for module verification
from src.core.shared.constants import CONSTITUTIONAL_HASH

from .agent_types import (
    AgentContext,
    AgentID,
    AgentIdentity,
    AgentInfo,
    AgentMetadata,
    AgentState,
    ContextData,
    EventContext,
    EventData,
    EventID,
    EventMetadata,
    KafkaMessage,
    MemoryData,
    MessageHeaders,
    MessageID,
    MessageMetadata,
    MessagePayload,
    SessionData,
    StepParameters,
    StepResult,
    TopicName,
    WorkflowContext,
    WorkflowID,
    WorkflowState,
)
from .governance_types import (
    AttributeMap,
    AuditEntry,
    AuditTrail,
    AuthContext,
    AuthCredentials,
    AuthToken,
    CacheKey,
    CacheTTL,
    CacheValue,
    ConfigDict,
    ConfigValue,
    ConstitutionalContext,
    CorrelationID,
    DatabaseRow,
    DecisionData,
    DocumentData,
    EnvVars,
    ErrorCode,
    ErrorContext,
    ErrorDetails,
    FeatureVector,
    FilterCriteria,
    LogContext,
    LogRecord,
    MetricData,
    ModelID,
    ModelMetadata,
    ModelParameters,
    PerformanceMetrics,
    PermissionSet,
    PolicyContext,
    PolicyData,
    PolicyDecision,
    PolicyID,
    PredictionResult,
    QueryParams,
    RedisValue,
    RoleData,
    ScheduleData,
    SecretData,
    SecurityContext,
    SpanContext,
    TelemetryData,
    TemplateContext,
    TemplateData,
    TenantID,
    TimelineData,
    Timestamp,
    TraceID,
    TrainingData,
    UserAttributes,
    ValidationContext,
    ValidationErrors,
    VerificationResult,
)
from .json_types import (
    AttributeDict,
    JSONDict,
    JSONList,
    JSONPrimitive,
    JSONType,
    JSONValue,
    MetadataDict,
    NestedDict,
    RecursiveDict,
    RecursiveList,
    StringDict,
)
from .protocol_types import (
    AgentBus,
    ArgsType,
    AsyncFunc,
    ConfigT,
    ContextT,
    DecoratorFunc,
    EventT,
    GovernanceService,
    KwargsType,
    ModelContext,
    ModelT,
    ResponseT,
    StateT,
    SupportsAudit,
    SupportsAuthentication,
    SupportsCache,
    SupportsCircuitBreaker,
    SupportsCompensation,
    SupportsExecution,
    SupportsHealthCheck,
    SupportsLogging,
    SupportsMiddleware,
    SupportsRegistry,
    SupportsSerialization,
    SupportsValidation,
    T,
    T_co,
    T_contra,
    TransformFunc,
    ValidatorContext,
    ValidatorFunc,
    ValidatorValue,
)

__all__ = [
    # Module-level constant
    "CONSTITUTIONAL_HASH",
    "AgentBus",
    "AgentContext",
    # --- Agent and Workflow Types ---
    "AgentID",
    "AgentIdentity",
    "AgentInfo",
    "AgentMetadata",
    "AgentState",
    # --- Decorator and Wrapper Types ---
    "ArgsType",
    "AsyncFunc",
    "AttributeDict",
    "AttributeMap",
    # --- Audit and Logging Types ---
    "AuditEntry",
    "AuditTrail",
    "AuthContext",
    "AuthCredentials",
    # --- Authentication and Security Types ---
    "AuthToken",
    # --- Cache and Storage Types ---
    "CacheKey",
    "CacheTTL",
    "CacheValue",
    # --- Configuration and Settings Types ---
    "ConfigDict",
    "ConfigT",
    "ConfigValue",
    "ConstitutionalContext",
    "ContextData",
    "ContextT",
    "CorrelationID",
    # --- Database and ORM Types ---
    "DatabaseRow",
    "DecisionData",
    "DecoratorFunc",
    "DocumentData",
    "EnvVars",
    "ErrorCode",
    "ErrorContext",
    # --- Error and Exception Types ---
    "ErrorDetails",
    "EventContext",
    "EventData",
    "EventID",
    "EventMetadata",
    "EventT",
    "FeatureVector",
    "FilterCriteria",
    "GovernanceService",
    "JSONDict",
    "JSONList",
    # --- JSON and Data Structure Types ---
    "JSONPrimitive",
    "JSONType",
    "JSONValue",
    "KafkaMessage",
    "KwargsType",
    "LogContext",
    "LogRecord",
    "MemoryData",
    "MessageHeaders",
    # --- Message and Event Types ---
    "MessageID",
    "MessageMetadata",
    "MessagePayload",
    "MetadataDict",
    "MetricData",
    "ModelContext",
    # --- ML and AI Types ---
    "ModelID",
    "ModelMetadata",
    "ModelParameters",
    "ModelT",
    "NestedDict",
    "PerformanceMetrics",
    "PermissionSet",
    "PolicyContext",
    "PolicyData",
    "PolicyDecision",
    # --- Policy and Governance Types ---
    "PolicyID",
    "PredictionResult",
    "QueryParams",
    "RecursiveDict",
    "RecursiveList",
    "RedisValue",
    "ResponseT",
    "RoleData",
    "ScheduleData",
    "SecretData",
    "SecurityContext",
    "SessionData",
    # --- Observability and Telemetry Types ---
    "SpanContext",
    "StateT",
    "StepParameters",
    "StepResult",
    "StringDict",
    "SupportsAudit",
    "SupportsAuthentication",
    # --- Protocol Types (Structural Typing) ---
    "SupportsCache",
    "SupportsCircuitBreaker",
    "SupportsCompensation",
    "SupportsExecution",
    "SupportsHealthCheck",
    "SupportsLogging",
    "SupportsMiddleware",
    "SupportsRegistry",
    "SupportsSerialization",
    "SupportsValidation",
    # --- Generic Type Variables ---
    "T",
    "T_co",
    "T_contra",
    "TelemetryData",
    "TemplateContext",
    # --- Document and Template Types ---
    "TemplateData",
    "TenantID",
    "TimelineData",
    # --- Temporal and Time-Series Types ---
    "Timestamp",
    "TopicName",
    "TraceID",
    "TrainingData",
    "TransformFunc",
    "UserAttributes",
    # --- Validation and Transformation Types ---
    "ValidationContext",
    "ValidationErrors",
    "ValidatorContext",
    "ValidatorFunc",
    # --- Pydantic-specific Types ---
    "ValidatorValue",
    "VerificationResult",
    "WorkflowContext",
    "WorkflowID",
    "WorkflowState",
]
