It is enough for you to figure it out from this article and this post #224 alone, which is an extraordinary article written by a great leader."Why Imran said it", because he is the front face of the government ... he has to make such statement to assure and pacify radicals/Mullah/religious fanatics, Taliban.... who can otherwise take the country to ransom. Also, China would not have liked it.
May be it's all done and dusted......For Pakistan, such agreements are done with Army/establishment ( one could have referred history of Pakistan to think through)
'US couldn’t win the war from inside Afghanistan after 20 years — how would it do it from bases in Pakistan?'
In opinion piece for The Washington Post, PM Imran says Pakistan is ready to be a partner for peace in Afghanistan with the US.