Catalyzes the cyclization of D-sedoheptulose 7-phosphate to 2-epi-5-epi-valiolone. Does not use ido-heptulose 7-phosphate and 3-deoxy-arabino-heptulosonate 7-phosphate. Involved in the biosynthesis of the acarviose moiety of the alpha-glucosidase inhibitor acarbose. D-sedoheptulose 7-phosphate = 2-epi-5-epi-valiolone + phosphate Divalent metal cation such as Co(2+). Belongs to the sugar phosphate cyclases superfamily. EEVS family.