startingIn

abstract fun startingIn(state: S): Tool

Create a version of this tool that starts in the specified state. Useful when the starting state depends on runtime context.

Example:

// Statically configured
val tool = StateMachineTool("order", "Process order", OrderState::class.java)
.withInitialState(OrderState.DRAFT)
...

// Dynamically start in a different state
val resumedTool = tool.startingIn(OrderState.CONFIRMED)