Class CommandApplier

java.lang.Object
com.agentforge4j.runtime.command.CommandApplier

public final class CommandApplier extends Object
Dispatches each LlmCommand to its registered CommandHandler and returns the first non-CommandApplicationResult.CONTINUE result, or CommandApplicationResult.CONTINUE when every command continues.
  • Constructor Details

  • Method Details

    • apply

      public CommandApplicationResult apply(List<LlmCommand> commands, WorkflowState state, ContextMapping contextMapping, String agentId, int currentStepUid)
      Applies commands in list order until one yields a non-continue outcome or the list ends.
      Parameters:
      commands - parsed commands in application order
      state - workflow state updated by handlers
      contextMapping - allowed output keys for agentId
      agentId - agent id recorded on events and permission checks
      currentStepUid - step instance id used when recording context writes
      Returns:
      aggregated control-flow result for the batch
      Throws:
      IllegalArgumentException - if any argument is null or no handler is registered for a command's concrete class