feat(cli): resolve the agent connection as a sum type and route hosted requests