This commit implements the Sideline/Mainline split with a clean plugin architecture: ## Core Changes ### Sideline Framework (New Directory) - Created directory containing the reusable pipeline framework - Moved pipeline core, controllers, adapters, and registry to - Moved display system to - Moved effects system to - Created plugin system with security and compatibility management in - Created preset pack system with ASCII art encoding in - Added default font (Corptic) to - Added terminal ANSI constants to ### Mainline Application (Updated) - Created for Mainline stage component registration - Updated to register Mainline stages at startup - Updated as a compatibility shim re-exporting from sideline ### Terminology Consistency - : Base class for all pipeline components (sources, effects, displays, cameras) - : Base class for distributable plugin packages (was ) - : Base class for visual effects (was ) - Backward compatibility aliases maintained for existing code ## Key Features - Plugin discovery via entry points and explicit registration - Security permissions system for plugins - Compatibility management with semantic version constraints - Preset pack system for distributable configurations - Default font bundled with Sideline (Corptic.otf) ## Testing - Updated tests to register Mainline stages before discovery - All StageRegistry tests passing Note: This is a major refactoring that separates the framework (Sideline) from the application (Mainline), enabling Sideline to be used by other applications.
95 lines
2.6 KiB
Python
95 lines
2.6 KiB
Python
"""
|
|
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",
|
|
]
|