Nothing good has an open software stack. There are some brands (eg: Axis, Bosch, Hanwha), that support 3rd party apps that can run on the camera and perform various tasks, including AI applications.
Any product that would fall under the good quality segment is primarily targeted at the commercial market, and nobody there is looking for open software.
There's https://openipc.org/ , if open source camera firmware is of interest to you. I actually ordered a few supported IP camera modules (basically complete IP cameras but without the case) from Aliexpress and tested that I'm able to compile a firmware, I shall see if I get it working once they arrive.
It's not quite clear to me what the firmware is actually able to do, though. Apparently its motion detection is very basic, though, so you'd need to use e.g. Frigate for that.