"""Centralized imports for FEID-MAS framework.

This module consolidates all standard library and internal package imports
used by the agent system, reducing boilerplate in main modules.
"""

# ============================================================================
# STANDARD LIBRARY IMPORTS
# ============================================================================

import threading
import time
import uuid
import logging
import sys
import random
import json
import hashlib
import heapq
from abc import ABC, abstractmethod
from queue import PriorityQueue, Empty
from collections import deque
from concurrent.futures import ThreadPoolExecutor
from enum import Enum
from typing import Optional, Dict, Any, Callable


# ============================================================================
# FEID INTERNAL IMPORTS - Enterprise Features
# ============================================================================

from ..enterprise import (
    CorrelationTracker,
    CircuitBreaker,
    RetryStrategy,
    ExponentialBackoffStrategy,
    LinearBackoffStrategy,
    FixedDelayStrategy,
    RateLimiter,
)


# ============================================================================
# FEID INTERNAL IMPORTS - Security
# ============================================================================

from ..security import ValidadorPayload, SandboxSeguridad


# ============================================================================
# FEID INTERNAL IMPORTS - Audit
# ============================================================================

from ..audit import AuditorEstructurado, GestorPoliticasError, SondeoSalud, PoliticaError


# ============================================================================
# FEID INTERNAL IMPORTS - Core Utilities
# ============================================================================

from ..core import (
    Config,
    ConfigAgente,
    EventoSchema,
    LifecycleHooks,
    GestorAntiInanicion,
    ColectorMetricas,
    PoliticaCola,
    GestorColaPolitica,
    MiddlewarePlugin,
    MiddlewareStack,
)

# ============================================================================
# FEID INTERNAL IMPORTS - Agent Components
# ============================================================================

from .protocol_adapter import ProtocolAdapter
from .event_sink import EventSink
from .queue_manager import QueueManager
from .task_processor import TaskProcessor
from .agent_runtime import AgentRuntime
from .facades import MetricsFacade, SecurityFacade, HealthFacade
from .factory import AgenteFactory


# ============================================================================
# EXPORTS
# ============================================================================

__all__ = [
    # Standard library
    'threading', 'time', 'uuid', 'logging', 'sys', 'random', 'json', 'heapq', 'hashlib',
    'ABC', 'abstractmethod', 'PriorityQueue', 'Empty', 'deque',
    'ThreadPoolExecutor', 'Enum', 'Optional', 'Dict', 'Any', 'Callable',
    
    # Enterprise
    'CorrelationTracker', 'CircuitBreaker', 'RetryStrategy',
    'ExponentialBackoffStrategy', 'LinearBackoffStrategy', 'FixedDelayStrategy',
    'RateLimiter',
    
    # Security
    'ValidadorPayload', 'SandboxSeguridad',
    
    # Audit
    'AuditorEstructurado', 'GestorPoliticasError', 'SondeoSalud', 'PoliticaError',
    
    # Core
    'Config', 'ConfigAgente', 'EventoSchema', 'LifecycleHooks', 'GestorAntiInanicion',
    'ColectorMetricas', 'PoliticaCola', 'GestorColaPolitica',
    'MiddlewarePlugin', 'MiddlewareStack',

    # Agent Components
    'ProtocolAdapter', 'EventSink', 'QueueManager', 'TaskProcessor', 'AgentRuntime',
    'MetricsFacade', 'SecurityFacade', 'HealthFacade', 'AgenteFactory',
]
