The US and Taliban agree in principle on a framework for a peace deal after 17 years of war.