refactor(agent): reorganize runtime modules