Democratic and Republican negotiators reach a tentative deal to avoid shutdown, but Trump must sign off.