Foundations of Distributed Agentic Systems