The legislation is a direct response to the Supreme Court’s ruling last month that former President Donald Trump has some immunity for official presidential acts.