"""
Constants used throughout the OpenZIM MCP server.

NOTE: This module re-exports values from defaults.py for backward compatibility.
New code should import from defaults.py directly for access to the structured
defaults classes.
"""

# Import from centralized defaults for backward compatibility
# These are re-exported for external consumers
from .defaults import (  # noqa: F401
    BATCH,
    CACHE,
    CACHE_PERFORMANCE,
    CONTENT,
    INPUT_LIMITS,
    NAMESPACE_SAMPLING,
    RATE_LIMIT,
    SERVER,
    TIMEOUTS,
    TOOL_MODE_ADVANCED,
    TOOL_MODE_SIMPLE,
    UNWANTED_HTML_SELECTORS,
    VALID_TOOL_MODES,
    VALID_TRANSPORT_TYPES,
    ZIM_FILE_EXTENSION,
)

# Re-export legacy constant names for backward compatibility
# Content processing constants
DEFAULT_SNIPPET_LENGTH = CONTENT.SNIPPET_LENGTH
DEFAULT_MAX_CONTENT_LENGTH = CONTENT.MAX_CONTENT_LENGTH
DEFAULT_SEARCH_LIMIT = CONTENT.SEARCH_LIMIT

# Cache configuration
DEFAULT_CACHE_SIZE = CACHE.MAX_SIZE
DEFAULT_CACHE_TTL = CACHE.TTL_SECONDS

# Binary content retrieval constants
DEFAULT_MAX_BINARY_SIZE = CONTENT.MAX_BINARY_SIZE

# Batch operation limits
MAX_BATCH_SIZE = BATCH.MAX_SIZE

# Input validation limits
INPUT_LIMIT_FILE_PATH = INPUT_LIMITS.FILE_PATH
INPUT_LIMIT_QUERY = INPUT_LIMITS.QUERY
INPUT_LIMIT_ENTRY_PATH = INPUT_LIMITS.ENTRY_PATH
INPUT_LIMIT_NAMESPACE = INPUT_LIMITS.NAMESPACE
INPUT_LIMIT_CONTENT_TYPE = INPUT_LIMITS.CONTENT_TYPE
INPUT_LIMIT_PARTIAL_QUERY = INPUT_LIMITS.PARTIAL_QUERY

# Regex timeout for intent parsing (seconds)
REGEX_TIMEOUT_SECONDS = TIMEOUTS.REGEX_SECONDS

# Main page display
DEFAULT_MAIN_PAGE_TRUNCATION = CONTENT.MAIN_PAGE_TRUNCATION

# Cache performance thresholds
CACHE_LOW_HIT_RATE_THRESHOLD = CACHE_PERFORMANCE.LOW_HIT_RATE
CACHE_HIGH_HIT_RATE_THRESHOLD = CACHE_PERFORMANCE.HIGH_HIT_RATE

# Namespace sampling
NAMESPACE_MAX_SAMPLE_SIZE = NAMESPACE_SAMPLING.MAX_SAMPLE_SIZE
NAMESPACE_MAX_ENTRIES = NAMESPACE_SAMPLING.MAX_NAMESPACE_ENTRIES
NAMESPACE_SAMPLE_ATTEMPTS_MULTIPLIER = NAMESPACE_SAMPLING.MAX_SAMPLE_ATTEMPTS_MULTIPLIER
