package arcs.api;

public interface Arcs {
  String MESSAGE_FIELD = "message";
  String RUN_ARC_MESSAGE = "runArc";
  String STOP_ARC_MESSAGE = "stopArc";
  String ARC_ID_FIELD = "arcId";
  String PEC_ID_FIELD = "pecId";
  String RECIPE_FIELD = "recipe";
  String PARTICLES_FIELD = "particles";
  String PARTICLE_ID_FIELD = "id";
  String PARTICLE_NAME_FIELD = "name";
  String PROVIDED_SLOT_ID_FIELD = "providedSlotId";

  default ArcData runArc(String recipe) {
    ArcData arcData = new ArcData.Builder().setRecipe(recipe).build();
    runArc(arcData);
    return arcData;
  }

  default ArcData runArc(String recipe, Particle particle) {
    ArcData arcData =
        new ArcData.Builder()
            .setRecipe(recipe)
            .addParticleData(new ArcData.ParticleData().setParticle(particle))
            .build();
    runArc(arcData);
    return arcData;
  }

  default ArcData runArc(String recipe, String arcId, String pecId) {
    ArcData arcData =
        new ArcData.Builder().setRecipe(recipe).setArcId(arcId).setPecId(pecId).build();
    runArc(arcData);
    return arcData;
  }

  default ArcData runArc(String recipe, String arcId, String pecId, Particle particle) {
    ArcData arcData =
        new ArcData.Builder()
            .setRecipe(recipe)
            .setArcId(arcId)
            .setPecId(pecId)
            .addParticleData(new ArcData.ParticleData().setParticle(particle))
            .build();
    runArc(arcData);
    return arcData;
  }

  void runArc(ArcData arcData);

  void stopArc(ArcData arcData);

  void sendMessageToArcs(String message);

  UiBroker getUiBroker();

  default void registerRenderer(String modality, UiRenderer renderer) {
    getUiBroker().registerRenderer(modality, renderer);
  }
}

@@ -12,16 +12,40 @@
 s.api;%0A%0A
+import java.util.List;%0A%0A
 public i
@@ -881,32 +881,390 @@
 n arcData;%0A  %7D%0A%0A
+  default ArcData runArc(String recipe, List%3C? extends Particle%3E particles) %7B%0A    ArcData.Builder builder = new ArcData.Builder().setRecipe(recipe);%0A    particles.forEach(particle -%3E builder.addParticleData(%0A        new ArcData.ParticleData().setParticle(particle)%0A    ));%0A    ArcData arcData = builder.build();%0A    runArc(arcData);%0A    return arcData;%0A  %7D%0A%0A
   default ArcDat
@@ -1775,32 +1775,32 @@
 icle(particle))%0A
-
             .bui
@@ -1851,16 +1851,506 @@
 a;%0A  %7D%0A%0A
+  default ArcData runArc(String recipe, String arcId, String pecId,%0A                         List%3C? extends Particle%3E particles) %7B%0A    ArcData.Builder builder =%0A        new ArcData.Builder()%0A            .setRecipe(recipe)%0A            .setArcId(arcId)%0A            .setPecId(pecId);%0A    particles.forEach(particle -%3E builder.addParticleData(%0A        new ArcData.ParticleData().setParticle(particle)%0A    ));%0A    ArcData arcData = builder.build();%0A    runArc(arcData);%0A    return arcData;%0A  %7D%0A%0A
   void r

Support multiple particles at the Arcs APIs (#3803)