NEW YORK — A federal narcotics agent was sentenced Wednesday to four years in prison for his role in a decade-long drug conspiracy that involved the smuggling of thousands of kilograms of cocaine from Puerto Rico to New York.