"""Tukuy - A flexible data transformation library with a plugin system."""

from .transformers import TukuyTransformer, AsyncTukuyTransformer
from .base import BaseTransformer, ChainableTransformer
from .async_base import AsyncBaseTransformer, AsyncChainableTransformer
from .plugins.base import TransformerPlugin, PluginRegistry, PluginSource
from .exceptions import ValidationError, TransformationError
from .types import TransformContext, TransformResult
from .skill import (
    RiskLevel, ConfigScope, ConfigParam,
    SkillDescriptor, SkillExample, SkillResult, Skill, skill,
)
from .instruction import (
    LLMBackend, InstructionChunk, InstructionDescriptor, Instruction, instruction,
)
from .context import SkillContext
from .manifest import PluginManifest, PluginRequirements
from .availability import (
    AvailabilityReason, SkillAvailability, PluginDiscoveryResult,
    get_available_skills, discover_plugins,
)
from .bridges import (
    to_openai_tool, to_anthropic_tool,
    to_openai_tools, to_anthropic_tools,
    format_result_openai, format_result_anthropic,
    dispatch_openai, dispatch_anthropic,
    async_dispatch_openai, async_dispatch_anthropic,
)
from .chain import Chain, Branch, Parallel, branch, parallel
from .safety import (
    SafetyViolation, SafetyError, SafetyManifest, SafetyPolicy,
    set_policy, get_policy, reset_policy,
    SecurityError, SecurityContext,
    set_security_context, get_security_context, reset_security_context,
)
from .analysis import (
    CodeAnalysis, CodeFeatures, FeatureExtractor,
    RiskAssessment, analyze_python, calculate_risk,
)
from .analysis import RiskLevel as AnalysisRiskLevel  # avoid collision with skill.RiskLevel
from .sandbox import (
    ALWAYS_BLOCKED_IMPORTS, ImportRestrictions, ImportViolationError,
    PathRestrictions, PathViolationError, PythonSandbox,
    ResourceContext, ResourceLimitError, ResourceLimits,
    SandboxError, SandboxResult, SandboxTimeoutError,
)

# Platform matrix
from .platforms import (
    get_platforms, get_platform_matrix, get_platform_summary,
    get_js_transformer_names, get_js_categories,
    get_js_transformer_metadata, get_python_transformer_names,
)

# Two-phase discovery
from .core.unified import browse_tools, get_tool_details, search_tools

__version__ = '0.0.32'

__all__ = [
    # Core
    'TukuyTransformer',
    'AsyncTukuyTransformer',
    'BaseTransformer',
    'ChainableTransformer',
    'AsyncBaseTransformer',
    'AsyncChainableTransformer',
    # Plugin system
    'TransformerPlugin',
    'PluginRegistry',
    'PluginSource',
    # Errors & types
    'ValidationError',
    'TransformationError',
    'TransformContext',
    'TransformResult',
    # Skill system
    'RiskLevel',
    'ConfigScope',
    'ConfigParam',
    'SkillDescriptor',
    'SkillExample',
    'SkillResult',
    'Skill',
    'skill',
    # Instruction system
    'LLMBackend',
    'InstructionChunk',
    'InstructionDescriptor',
    'Instruction',
    'instruction',
    'SkillContext',
    # Plugin manifest
    'PluginManifest',
    'PluginRequirements',
    # Availability engine
    'AvailabilityReason',
    'SkillAvailability',
    'PluginDiscoveryResult',
    'get_available_skills',
    'discover_plugins',
    # Agent bridges
    'to_openai_tool',
    'to_anthropic_tool',
    'to_openai_tools',
    'to_anthropic_tools',
    'format_result_openai',
    'format_result_anthropic',
    'dispatch_openai',
    'dispatch_anthropic',
    'async_dispatch_openai',
    'async_dispatch_anthropic',
    # Composition
    'Chain',
    'Branch',
    'Parallel',
    'branch',
    'parallel',
    # Safety
    'SafetyViolation',
    'SafetyError',
    'SafetyManifest',
    'SafetyPolicy',
    'set_policy',
    'get_policy',
    'reset_policy',
    # Security
    'SecurityError',
    'SecurityContext',
    'set_security_context',
    'get_security_context',
    'reset_security_context',
    # Two-phase discovery
    'browse_tools',
    'get_tool_details',
    'search_tools',
    # Analysis
    'CodeAnalysis',
    'CodeFeatures',
    'FeatureExtractor',
    'RiskAssessment',
    'AnalysisRiskLevel',
    'analyze_python',
    'calculate_risk',
    # Sandbox
    'ALWAYS_BLOCKED_IMPORTS',
    'ImportRestrictions',
    'ImportViolationError',
    'PathRestrictions',
    'PathViolationError',
    'PythonSandbox',
    'ResourceContext',
    'ResourceLimitError',
    'ResourceLimits',
    'SandboxError',
    'SandboxResult',
    'SandboxTimeoutError',
    # Platform matrix
    'get_platforms',
    'get_platform_matrix',
    'get_platform_summary',
    'get_js_transformer_names',
    'get_js_categories',
    'get_js_transformer_metadata',
    'get_python_transformer_names',
]
