The invention provides compounds of formula (I):where the variables are defined in the specification, or a pharmaceutically-acceptable salt thereof, that are useful as JAK kinase inhibitors. The invention also provides pharmaceutical compositions comprising such compounds and methods of using such compounds to treat respiratory diseases.