Way to post/pre process gcode through moonraker?

I’d be interested to see what you’ve done here. While I was posting some of my macros/python/hacks above, it occurred to me that my whole approach really is little more than a patchwork of workarounds where a dedicated solution would be preferable. Spoolman already has a couple of Moonraker remote methods, maybe it would be better to build it out further to allow for this kind of functionality? Maybe projects like ERCF and SMuFF and Prusa’s MMU could benefit too. A while back @garethky posted a thread about a system to allow Klipper to have more information about filament properties, and I wonder if those objectives could also be accomplished by extending Spoolman, even on single-material printers.