Are there any programmatic interfaces to this?
I was just thinking about how TinkerCad has block coding.
this isn't really answering your question,
however with opencascade working in webassembly here, perhaps also cadquery and/or build123d can do something like that