Afghanistan is literally waging a war against Pakistan with likely Indian support. This happened just few months ago. It is Pakistan that bet on the wrong horse by supporting the Taliban all these years, hoping they can end the Indian influence in Afghanistan. But that didn't happen.India's doesn't even recognize the current Taliban government officially. They're just trying to suck up to them after betting on the wrong horse when the previous government failed.
There has to be a way around this. Its not like they're sworn blood brothers or anything.
I think the Taliban needs to go, either replaced a by pro-Pakistn govt or Afghanistan needs to be broken into pieces that are fighting each other and thus not putting pressure on Pakistan. Only when the western border is secure that Pakistan can put focus on its eastern border and put pressure on India. Only when India is under pressure from Pakistan, is China safe from Indian designs on Tibet.