forked from genewildish/Mainline
feat: Implement Sideline plugin system with consistent terminology
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.
This commit is contained in:
@@ -9,20 +9,24 @@ from engine import config
|
||||
from engine.display import BorderMode, DisplayRegistry
|
||||
from engine.effects import get_registry
|
||||
from engine.fetch import fetch_all, fetch_all_fast, fetch_poetry, load_cache, save_cache
|
||||
from engine.pipeline import (
|
||||
|
||||
# Import from sideline (the framework)
|
||||
from sideline.pipeline import (
|
||||
Pipeline,
|
||||
PipelineConfig,
|
||||
PipelineContext,
|
||||
list_presets,
|
||||
StageRegistry,
|
||||
)
|
||||
from engine.pipeline.adapters import (
|
||||
from sideline.pipeline.adapters import (
|
||||
CameraStage,
|
||||
DataSourceStage,
|
||||
EffectPluginStage,
|
||||
create_stage_from_display,
|
||||
create_stage_from_effect,
|
||||
)
|
||||
from engine.pipeline.params import PipelineParams
|
||||
from sideline.pipeline.params import PipelineParams
|
||||
|
||||
# Import from engine (Mainline-specific)
|
||||
from engine.pipeline.ui import UIConfig, UIPanel
|
||||
from engine.pipeline.validation import validate_pipeline_config
|
||||
|
||||
@@ -34,11 +38,39 @@ except ImportError:
|
||||
from .pipeline_runner import run_pipeline_mode
|
||||
|
||||
|
||||
def _register_mainline_stages():
|
||||
"""Register Mainline-specific stage components with Sideline.
|
||||
|
||||
This should be called early in application startup to ensure
|
||||
all Mainline stages are available for pipeline construction.
|
||||
"""
|
||||
try:
|
||||
from sideline.pipeline import StageRegistry
|
||||
|
||||
# Method 1: Explicit registration via engine.plugins
|
||||
try:
|
||||
from engine.plugins import register_stages
|
||||
|
||||
register_stages(StageRegistry)
|
||||
except ImportError as e:
|
||||
print(f"Warning: Failed to register Mainline stages: {e}")
|
||||
|
||||
# Method 2: Register via plugin module (for entry point discovery)
|
||||
StageRegistry.register_plugin_module("engine.plugins")
|
||||
|
||||
print("Mainline stage components registered successfully")
|
||||
except Exception as e:
|
||||
print(f"Warning: Stage registration failed: {e}")
|
||||
|
||||
|
||||
def main():
|
||||
"""Main entry point - all modes now use presets or CLI construction."""
|
||||
# Register Mainline stages with Sideline
|
||||
_register_mainline_stages()
|
||||
|
||||
if config.PIPELINE_DIAGRAM:
|
||||
try:
|
||||
from engine.pipeline import generate_pipeline_diagram
|
||||
from sideline.pipeline import generate_pipeline_diagram
|
||||
except ImportError:
|
||||
print("Error: pipeline diagram not available")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user