There's no chance in hell that Afghanistan will even think of an all out war with Pakistan. The Afghan Army is mostly a rag tag circus. For war, an army needs artillery, missiles, Air defence and most importantly an air force for close air support and interdiction.
Afghanistan has none of these. Then, they aren't in the same league as the PA which has the experience of fighting conventional wars. The only thing the Afghanistan army can do is to get the TTP on its side to wage a guerrilla war against Pakistan, restricted to the areas near the AfPAK border. Whether the TTP would align with the Afghan Army is a moot question.
Would the US and the Afghan Army form an alliance to wage a war against Pakistan? Most unlikely. At least not at the present juncture. But considering that the US of A has its eyes on Balochistan, this cannot be ruled out in the future.