Negotiators in Qatar are close to a ceasefire deal that sees an exchange of Israeli hostages for Palestinian detainees, a six-week pause in fighting and eventual troop withdrawal from Gaza.