"""
Module System - Core Registration and Execution

Organized by architecture:
- Atomic: Core building blocks, no external dependencies (Level 1)
- Third-party: External service integrations (Level 2)
- AI Tools: AI-powered analysis tools (Level 3)
- External: MCP and remote agents (Level 4)
- Composite: High-level workflow templates (v1.1)
"""

from .registry import ModuleRegistry
from .base import BaseModule
from .types import (
    ModuleLevel,
    UIVisibility,
    ContextType,
    ExecutionEnvironment,
    LEVEL_PRIORITY,
    LOCAL_ONLY_CATEGORIES,
    get_default_visibility,
    get_module_environment,
    is_module_allowed_in_environment,
)
from .connection_rules import (
    can_connect,
    validate_workflow_connections,
    get_connection_rules,
    get_suggested_connections,
    get_acceptable_sources,
    CONNECTION_RULES,
)

# Import atomic modules
from .atomic import browser
from .atomic import data
from .atomic import utility

# Import legacy atomic modules (to be migrated)
from . import atomic

# Import third-party integration modules
from .third_party import ai
from .third_party import communication
from .third_party import database
from .third_party import cloud
from .third_party import productivity
from .third_party import developer

# Composite modules (coming in v1.1)
from . import composite

__all__ = [
    # Core
    'ModuleRegistry',
    'BaseModule',
    # Types
    'ModuleLevel',
    'UIVisibility',
    'ContextType',
    'ExecutionEnvironment',
    'LEVEL_PRIORITY',
    'LOCAL_ONLY_CATEGORIES',
    # Functions
    'get_default_visibility',
    'get_module_environment',
    'is_module_allowed_in_environment',
    # Connection rules
    'can_connect',
    'validate_workflow_connections',
    'get_connection_rules',
    'get_suggested_connections',
    'get_acceptable_sources',
    'CONNECTION_RULES',
    # Atomic
    'browser',
    'data',
    'utility',
    # Third-party
    'ai',
    'communication',
    'database',
    'cloud',
    'productivity',
    'developer',
    # Composite
    'composite',
]
