Interface ExitPlanModeHandler

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ExitPlanModeHandler
Handler for exit-plan-mode requests from the agent.

Register an exit-plan-mode handler via SessionConfig.setOnExitPlanMode(ExitPlanModeHandler) or ResumeSessionConfig.setOnExitPlanMode(ExitPlanModeHandler). When provided, the server routes exitPlanMode.request callbacks to this handler.

Example Usage


 ExitPlanModeHandler handler = (request, invocation) -> {
 	// Review the plan and decide whether to approve
 	return CompletableFuture
 			.completedFuture(new ExitPlanModeResult().setApproved(true).setSelectedAction("interactive"));
 };

 var session = client.createSession(new SessionConfig().setOnExitPlanMode(handler)).get();
 
Since:
1.0.8
See Also:
  • Method Details

    • handle

      Handles an exit-plan-mode request from the agent.
      Parameters:
      request - the exit-plan-mode request containing the summary, plan content, and available actions
      invocation - context information about the invocation
      Returns:
      a future that resolves with the user's decision