"""
Unified Pipeline Architecture.

This module provides a clean, dependency-managed pipeline system:
- Stage: Base class for all pipeline components
- Pipeline: DAG-based execution orchestrator
- PipelineParams: Runtime configuration for animation
- PipelinePreset: Pre-configured pipeline configurations
- StageRegistry: Unified registration for all stage types
- Plugin system: Support for external stage plugins

The pipeline architecture supports:
- Sources: Data providers (headlines, poetry, pipeline viz)
- Effects: Post-processors (noise, fade, glitch, hud)
- Displays: Output backends (terminal, pygame, websocket)
- Cameras: Viewport controllers (vertical, horizontal, omni)

Plugin System:
    Plugins can be registered explicitly or discovered automatically via entry points.
    Applications can register their own stages using StageRegistry.register() or
    StageRegistry.register_plugin().

Example:
    from sideline.pipeline import Pipeline, PipelineConfig, StageRegistry

    # Register application-specific stages
    StageRegistry.register("source", MyDataSource)

    # Or discover plugins automatically
    StageRegistry.discover_plugins()

    pipeline = Pipeline(PipelineConfig(source="my_source", display="terminal"))
    pipeline.add_stage("source", StageRegistry.create("source", "my_source"))
    pipeline.add_stage("display", StageRegistry.create("display", "terminal"))
    pipeline.build().initialize()

    result = pipeline.execute(initial_data)
"""

from sideline.pipeline.controller import (
    Pipeline,
    PipelineConfig,
    PipelineRunner,
    create_default_pipeline,
    create_pipeline_from_params,
)
from sideline.pipeline.core import (
    PipelineContext,
    Stage,
    StageConfig,
    StageError,
    StageResult,
)
from sideline.pipeline.params import (
    DEFAULT_HEADLINE_PARAMS,
    DEFAULT_PIPELINE_PARAMS,
    DEFAULT_PYGAME_PARAMS,
    PipelineParams,
)
from sideline.pipeline.registry import (
    StageRegistry,
    discover_stages,
    register_camera,
    register_display,
    register_effect,
    register_source,
)

__all__ = [
    # Core
    "Stage",
    "StageConfig",
    "StageError",
    "StageResult",
    "PipelineContext",
    # Controller
    "Pipeline",
    "PipelineConfig",
    "PipelineRunner",
    "create_default_pipeline",
    "create_pipeline_from_params",
    # Params
    "PipelineParams",
    "DEFAULT_HEADLINE_PARAMS",
    "DEFAULT_PIPELINE_PARAMS",
    "DEFAULT_PYGAME_PARAMS",
    # Registry
    "StageRegistry",
    "discover_stages",
    "register_source",
    "register_effect",
    "register_display",
    "register_camera",
]
