Maimonides prefers the second view (Moreh N’vuchim 2:42). Perhaps the event was a struggle within Jacob’s own soul, a man wrestling with himself.
Though this view is certainly plausible, the text does not completely support it.
First there is the evidence that Jacob limped after the struggle, though a person who tosses and turns all night can twist their body and be unable to walk normally in the morning.
But a more telling aspect of the story is the sudden change in Esau’s attitude to his brother. After coming angrily with a force of strong men, why is he now so friendly and relaxed about meeting Jacob?
The Torah itself does not identify the night-time assailant: it simply says that it was “a man”. Considering the Midrash that it was saro shel Esav, “the prince of Esau”, could it not have been Esau himself? If this is the case it explains Esau’s change of attitude.
Having lost Isaac’s blessing to Jacob so many years earlier, Esau may have wanted to check for himself whether Jacob really did have Divine protection, but this required a night-time encounter in which his own identity was not evident. The result was that Jacob clearly did have God on his side.
When the two met in the morning, Jacob was disarmed by his brother’s cordiality and said: “I have seen your face (is this a hint that Jacob had a suspicion that the assailant actually was Esau?) as one sees the face of God, and you were pleased with me” (Gen. 33:10).