Warning message may be a little chaotic as I have gone through everything and I’m replying to things as I remember.
I have mixed fellings with your (@koconnor) proposal, while I agree that some macros (klicky comes to mind) add good functionality they are harder to debug, such macros could benefit of a better system.
I’m not very fond of the idea of using a unix socket to communicate with the plugins, while it’s a way to isolate the code feels cumbersome and without a well thought and simple SDK won’t get much traction in my opinion, while this allows any language, it creates fragmentation if some functionality is deemed good to simply merge into Klipper itself (if the plugin author approves of course) if done in other languages then everything needs to be “translated” this can bring new bugs in.
Regarding hosting I don’t think this should be Klipper and it’s maintainers responsibility, for multiple reasons, may create the illusion to users that who has to support the plugin is the Klipper team itself, and cuts out control from such plugin developers, I personally would not like that. Currently a lot of “plugins” (extras modules) exist and the risk of compromised quality and documentation exists as well, I don’t see the need for a central management or listing of plugins, I think it falls outside Klipper scope, Moonraker already has an update manager, and it seems to me good enough for this, let’s not reinvent the wheel, something exists, why fragment?
Whether we like it or not (I do actually) “extras” modules are the only way to add some functionality to klipper, on this territory Happy Hare, Tradrack, Led Effects, Auto Z Calibration are some that come to mind, and who wants to use them will keep using them and linking them into extras directory, this adds complexity on updates, if something breaks it does indeed not make easy to know the root cause. That being said I think we need a way to load such modules preferably each from it’s own directory whithin a parent directory and adhering to a basic file naming convention, this separation would allow for a “safe mode” in Klipper where it does not load any code from such “extras”, technically I don’t know if it is possible to know if something broke from that “extra” code or not, at least initialization should be, they can still mess up with klipper but that already happens as well, a warning can be given to users on startup as well and make it explicit that module X or Y is external to Klipper. As for changes in Klipper breaking one of these “extras” plugins this also happens already, not common but does, the only solution I see for this is clearly define what methods on a class are public and what methods are private (I believe this already happens) so surface becomes reduced, public ones can be marked as deprecated and after 1 or 2 releases removed, this gives plugin developers time to catch up.
To wrap up, I think allowing for a new “extras” directory would solve the issues of more complex macros becoming high level code, maybe provide a base class to extend from and only provide to these classes a more limited object to interact with. Current extras give them full access as it already happens today, at least a more clear boundary can be made by splitting them into a different directory.