Al-Qaeda-linked terrorists planned a chemical attack on Jordan’s spy headquarters that could have killed 20,000 people, officials have said.