forked from genewildish/Mainline
- Fix TerminalDisplay: add screen clear each frame (cursor home + erase down) - Fix CameraStage: use set_canvas_size instead of read-only viewport properties - Fix Glitch effect: preserve visible line lengths, remove cursor positioning - Fix Fade effect: return original line when fade=0 instead of empty string - Fix Noise effect: use input line length instead of terminal_width - Remove HUD effect from all presets (redundant with border FPS display) - Add regression tests for effect dimension stability - Add docs/ARCHITECTURE.md with Mermaid diagrams - Add mise tasks: diagram-ascii, diagram-validate, diagram-check - Move markdown docs to docs/ (ARCHITECTURE, Refactor, hardware specs) - Remove redundant requirements files (use pyproject.toml) - Add *.dot and *.png to .gitignore Closes #25
2.2 KiB
2.2 KiB
name, description, compatibility, metadata
| name | description | compatibility | metadata | ||||
|---|---|---|---|---|---|---|---|
| mainline-presets | Creating pipeline presets in TOML format for Mainline | opencode |
|
What This Skill Covers
This skill covers how to create pipeline presets in TOML format for Mainline's rendering pipeline.
Key Concepts
Preset Loading Order
Presets are loaded from multiple locations (later overrides earlier):
- Built-in:
engine/presets.toml - User config:
~/.config/mainline/presets.toml - Local override:
./presets.toml
PipelinePreset Dataclass
@dataclass
class PipelinePreset:
name: str
description: str = ""
source: str = "headlines" # Data source
display: str = "terminal" # Display backend
camera: str = "scroll" # Camera mode
effects: list[str] = field(default_factory=list)
border: bool = False
TOML Format
[presets.my-preset]
description = "My custom pipeline"
source = "headlines"
display = "terminal"
camera = "scroll"
effects = ["noise", "fade"]
border = true
Creating a Preset
Option 1: User Config
Create/edit ~/.config/mainline/presets.toml:
[presets.my-cool-preset]
description = "Noise and glitch effects"
source = "headlines"
display = "terminal"
effects = ["noise", "glitch"]
Option 2: Local Override
Create ./presets.toml in project root:
[presets.dev-inspect]
description = "Pipeline introspection for development"
source = "headlines"
display = "terminal"
effects = ["hud"]
Option 3: Built-in
Edit engine/presets.toml (requires PR to repository).
Available Sources
headlines- RSS news feedspoetry- Literature modepipeline-inspect- Live DAG visualization
Available Displays
terminal- ANSI terminalwebsocket- Web browsersixel- Sixel graphicsnull- Headless
Available Effects
See effects_plugins/:
- noise, fade, glitch, firehose
- border, crop, tint, hud
Validation Functions
Use these from engine/pipeline/presets.py:
validate_preset()- Validate preset structurevalidate_signal_path()- Detect circular dependenciesgenerate_preset_toml()- Generate skeleton preset