Othe other part is also becoming reality. I’ve seen at least one company selling liquid crystal glasses.
Glasses actually do exist that allow you to adjust with little screw knob on the side
(https://www.theguardian.com/society/2008/dec/22/diy-adjustab...)
Not sure about the "any prescription thing", but it's pretty trivial to make glasses that are "also sunglasses sometimes".
Both photochromatic lenses who darken in response to more light and glasses with variable ND filters exist (the former very common and trivial to find, the latter way more niche, but still commercially available, and cheap enough)