Bring a large pot of salted water to a boil. Add the spaghetti and cook as the label directs. Reserve 1/2 cup cooking water, then drain.
Meanwhile, heat the olive oil in a large skillet over medium-high heat. Add the shallot and rosemary and cook, stirring occasionally, until the shallot is slightly softened, about 2 minutes. Add the artichoke hearts, 1 teaspoon salt and a few grinds of pepper; cook, stirring occasionally, until softened, about 2 minutes.
Reduce the heat to medium and add the wine; cook, stirring occasionally, until evaporated slightly, about 1 minute. Add the heavy cream and bring to a boil, stirring occasionally. Continue to cook until the sauce thickens slightly, about 1 minute. Stir in the fontina and cook until the sauce is thick and creamy, about 1 minute. Add the prosciutto.
Reduce the heat to low and add the spaghetti to the skillet along with the peas and Parmesan. Stir until well coated, adding the reserved cooking water as needed to loosen. Season with salt and pepper.