The UN says some of Libya's warring factions have agreed on the framework for a peace deal after months of negotiations in Morocco.The agreement will pave the way for a transitional period and the establishment of a democratic state.