A new agreement between the U.S. government and ByteDance, TikTok’s Chinese parent, is set to shift control of the app’s American operations.