These exist. I am on the fence about buying the $600 one for experimentation and repurposing it to heat/cool garage. Many have heat/cool functionality. You can put the air side either inside or outside.
https://www.amazon.com/s?k=pool+heat+pump&crid=1LWMIT8JDL7S8...
My idea is to do some ground source heat pump supplemented by solar thermal water heating to get lots of free BTUs. The issue (for the $600 one) is it can only cool the water down to 46F. Recall that cooling water means heating air (inside). But heating water goes down to I think 23F. Decisions will have to be made.