Negotiators appear to have reached an agreement after 15 months of conflict that has killed tens of thousands of Palestinians.