The source for the version of Mage that can do this is posted here.