"""
BGX — Background Execution Engine

A standalone Python library for intelligent asynchronous task execution.
Provides developers with a production-grade, zero-dependency alternative
to the common threading.Thread(target=fn).start() antipattern.
"""

__version__ = "0.1.0"
__author__ = "BRAHMAI / BRAHX LABS"
__maintainer__ = "BRAHMAI / BRAHX LABS"

# Core engine
from .engine import BackgroundEngine, create_engine, io_engine, cpu_engine

# Task classes and enums
from .task import Task, TaskState, Priority, RetryPolicy

# Retry utilities
from .retry import (
    RetryManager,
    BackoffCalculator,
    fixed_retry_policy,
    exponential_retry_policy,
    linear_retry_policy,
    fibonacci_retry_policy
)

# Vault utilities
from .vault import ResultVault, create_vault, short_lived_vault, long_lived_vault

# Scheduler utilities
from .scheduler import TaskScheduler, ScheduledHandle, CronParser

# Group utilities
from .group import TaskGroup, GroupPattern

# Public API
Engine = BackgroundEngine

# Re-export commonly used items
__all__ = [
    # Version info
    "__version__",
    "__author__",
    "__maintainer__",
    
    # Core engine
    "Engine",
    "BackgroundEngine",
    "create_engine",
    "io_engine",
    "cpu_engine",
    
    # Task classes
    "Task",
    "TaskState",
    "Priority",
    "RetryPolicy",
    
    # Retry utilities
    "RetryManager",
    "BackoffCalculator",
    "fixed_retry_policy",
    "exponential_retry_policy",
    "linear_retry_policy",
    "fibonacci_retry_policy",
    
    # Vault utilities
    "ResultVault",
    "create_vault",
    "short_lived_vault",
    "long_lived_vault",
    
    # Scheduler utilities
    "TaskScheduler",
    "ScheduledHandle",
    "CronParser",
    
    # Group utilities
    "TaskGroup",
    "GroupPattern",
]


def get_version() -> str:
    """Get the current BGX version."""
    return __version__


def get_info() -> dict:
    """Get BGX library information."""
    return {
        "name": "BGX",
        "version": __version__,
        "description": "Background Execution Engine",
        "author": __author__,
        "maintainer": __maintainer__,
        "python_min_version": "3.9"
    }
