From Intentions to Social Commitments: Adaptation in Multiagent Systems