A Calculus of Agents and Artifacts