There was this very cool handmade bike trailer wagon thing: https://slrpnk.net/post/1833883
For the artist's experiences living out of it: https://theaimlesslywanderingartist.blogspot.com/2013/12/winter-comes-to-southern-california.html
But that's a trailer. It sounds like you're describing something closer to a Bicycle Rickshaw, possibly on a tricycle frame.
You could even do a recumbent bike:
It seems like either could be enclosed using techniques learned from popup campers for a fairly comfortable living space.
(I think a lot about all the crazy contraptions people would make if the roads weren't exclusively the domain of giant trucks and SUVs, and if cargo bikes didn't have to fit themselves into narrow bike lanes and roadsides. I think people would come up with some really cool and weird stuff. Add solar panels and ebike parts, and they'd get really interesting.)