Just to be realistic here, the Taliban was always going to have the upper hand because they have nothing but time. Insurgencies are cheap to wage and expensive to fight. There is not a scenario that sees the bulk of US and European troops leaving Afghanistan where the Taliban doesn’t take back over (with the help of Pakistan).
The current deal is real shitty in that it says once the US leaves, we can’t come back. The Taliban is still currently hosting al-Qaeda but there is no mechanism that lets the US return even if they start openly inviting more of them back in.
We have two options in Afghanistan. We leave or we deploy 100,000+ military members and at least as many contractors. We use the contractors to build probably billions of dollars worth of infrastructure and use the military to protect them. Even then though, it doesn’t take much fertilizer to build a bomb big enough to destroy a million dollars worth of newly built road or pipeline so it’s going to be a very costly and bloody process.
Overall our only option here is to peace the fuck out and tell the Afghan people good luck.