Legislators in the Massachusetts House passed a bill, among hundreds attached in amendments to the budget, aimed at disclosing the use of artificial intelligence in political messages.