Plugin Selection Toys !!install!! | CONFIRMED × CHEAT SHEET |

// 2. apply to context in order (order matters!) this.activePlugins.set(plugin.id, plugin); this.reorder(); // sort by category/priority

getPipeline() return Array.from(this.activePlugins.values()); plugin selection toys

const echoPlugin = id: "echo-delay", name: "Echo Tunnel", category: "audio", exclusiveGroup: "delay", apply: (ctx) => , ui: knob: ["delayTime (0–1)"] ; Part 3: Selection Manager Logic The core engine that enables/disables plugins and resolves conflicts. 3.1. Basic Manager class PluginSelectionManager constructor() this.activePlugins = new Map(); // id -> plugin instance this.groups = new Map(); // exclusiveGroup -> active id enable(plugin) // 1. check exclusive group if (plugin.exclusiveGroup) const existing = this.groups.get(plugin.exclusiveGroup); if (existing) this.disable(existing); this.groups.set(plugin.exclusiveGroup, plugin.id); // id -&gt

disable(pluginId) /* remove from maps */ plugin instance this.groups = new Map()

interface ToyPlugin "physics"; icon: string; // emoji or asset URL cost?: number; // for resource-limited toys exclusiveGroup?: string; // e.g., "reverb-group" – only one per group apply: (context: ToyContext) => ToyContext; // core transformation ui?: knob?: string[]; toggle?: boolean ; // user configurable params

interface ToyContext // shared state across plugins audioBuffer?: AudioBuffer; canvas?: HTMLCanvasElement; physicsWorld?: Matter.World; userParams: Record<string, any>;