reworked to build the agent as the artifact