You spent 30 years placing the Taliban in power in Kabul, twice. What is your problem with them now ? It's the same Taliban. They want recognition and for Afghanistan to be an independent neighbor. You will have to accept this, even if it spoils Army's image in the West as clean shaven suit wearing great English speaking modern Muslims.
Once the Taliban or Afghans in general find assurance that the proxy wars of the past are over, they will pull their support for TTP/BLA. That will make your job easier in tackling and eliminating those groups. Of course you will also have to get out of the jehad business and behave like a normal country.
The present scenario with Taliban in control of a whole country providing strategic depth to TTP/BLA is beyond Pakistan's capabilities. These airstrikes, trade blockades, expelling innocent Afghan refugees were dumb tantrums of jernails which predictably failed.
Another hope that the duffers in GHQ now have is that they can sell "Taliban bad" to the international community and get some $$$ that way as Pakistan is supposedly now fighting the Taliban. Won't work.