I've seen the following solution in Stack Exchange to add referenceable enumeration labels to a framed enumeration environment:
It uses \wrappedcurrentconstruction. However, it only prints the counter label and the counter name. What if I need the text enclosed by braces in the frame header too? E. g. \starttheorem[thm1]{Residue theorem} so the framed title includes "Residue theorem" also. Thank you in advance.