"""
AIPTX v3 - AI-Powered Penetration Testing Framework (Beast Mode)
================================================================

A fully autonomous hacking agent with advanced exploitation capabilities.

Beast Mode v3.0 Features:
- Multi-step exploit chain building and execution
- Adaptive payload mutation with WAF bypass
- Feedback learning from exploitation attempts
- Autonomous credential harvesting
- Privilege escalation automation (Windows/Linux)
- Network pivoting and lateral movement
- Credential spraying (SMB, SSH, RDP, WinRM, LDAP)
- Stealth engine with timing jitter and LOLBins
- LLM-powered attack planning and novel chain discovery
- Business logic vulnerability analysis

Core Features:
- Universal LLM support via litellm (100+ models)
- Docker sandbox execution
- Browser automation via Playwright
- Proxy interception via mitmproxy
- CVE prioritization (CVSS + EPSS + trending + POC)
- RAG tool selection with semantic search
- Hierarchical task tracking
- SQLAlchemy persistence
- FastAPI REST API
"""

__version__ = "3.0.3"
__author__ = "AIPT Team"

# Available submodules (direct import)
__all__ = [
    # Core - LangGraph agent, LLM providers, memory
    "core",
    # Docker - Container management and sandboxing
    "docker",
    # Execution - Terminal, parser, sandbox integration
    "execution",
    # Orchestration - Pipeline, scheduler, progress tracking
    "orchestration",
    # Intelligence - Vulnerability analysis, triage, scope
    "intelligence",
    # Tools - Scanner integrations (Acunetix, Burp, etc.)
    "tools",
    # Payloads - XSS, SQLi, SSRF, SSTI, etc.
    "payloads",
    # Scanners - Nuclei, Nmap, Nikto wrappers
    "scanners",
    # Recon - Subdomain, DNS, tech detection
    "recon",
    # Browser - Playwright automation
    "browser",
    # Terminal - Command execution
    "terminal",
    # Proxy - mitmproxy interception
    "proxy",
]

# Lazy imports to avoid failures when optional dependencies are missing


def __getattr__(name):
    """Lazy import handler for optional dependencies"""
    if name == "LLM":
        from aipt_v2.llm.llm import LLM
        return LLM
    elif name == "LLMConfig":
        from aipt_v2.llm.config import LLMConfig
        return LLMConfig
    elif name == "PTT":
        from aipt_v2.agents.ptt import PTT
        return PTT
    elif name == "BaseAgent":
        from aipt_v2.agents.base import BaseAgent
        return BaseAgent
    elif name == "CVEIntelligence":
        from aipt_v2.intelligence.cve_aipt import CVEIntelligence
        return CVEIntelligence
    elif name == "ToolRAG":
        from aipt_v2.intelligence.rag import ToolRAG
        return ToolRAG
    elif name == "OutputParser":
        from aipt_v2.tools.parser import OutputParser
        return OutputParser
    elif name == "Repository":
        from aipt_v2.database.repository import Repository
        return Repository
    # New models module
    elif name == "Finding":
        from aipt_v2.models.findings import Finding
        return Finding
    elif name == "Severity":
        from aipt_v2.models.findings import Severity
        return Severity
    elif name == "ScanConfig":
        from aipt_v2.models.scan_config import ScanConfig
        return ScanConfig
    elif name == "ScanMode":
        from aipt_v2.models.scan_config import ScanMode
        return ScanMode
    elif name == "PhaseResult":
        from aipt_v2.models.phase_result import PhaseResult
        return PhaseResult
    # Reports module
    elif name == "ReportGenerator":
        from aipt_v2.reports.generator import ReportGenerator
        return ReportGenerator
    elif name == "ReportConfig":
        from aipt_v2.reports.generator import ReportConfig
        return ReportConfig
    raise AttributeError(f"module 'aipt_v2' has no attribute '{name}'")
