Creates a new StateMachine starting in TutorStateType.IDLE.
Returns true if a transition to to is valid from the current state.
The target state to check reachability for.
true if the transition is allowed.
Returns the ordered history of all transitions since instantiation.
Array of past StateTransitions, oldest first.
Registers a listener that fires after every successful transition.
Called with the StateTransition that just occurred.
Attempts to transition to a new state. Throws if the transition is not valid from the current state.
The target TutorStateType.
Optionalreason: stringOptional human-readable reason for logging.
Optionalmetadata: Record<string, unknown>Optional metadata to attach to the new state.
Governs the tutor's high-level behavior through explicit state transitions.