OptionalbeforeOptional callback function executed before navigation begins. Allows for custom pre-navigation logic and validation.
OptionalemitOptional message or function to emit when navigation occurs without execution. If a function, it receives the client ID, last user message, and agent name, returning a string or promise of a string.
OptionalexecuteOptional message or function to execute when navigation occurs with execution. If a function, it receives the client ID, last user message, and agent name, returning a string or promise of a string.
OptionalflushOptional message or function to emit after flushing the session. If a function, it receives the client ID and agent name, returning a string or promise of a string. Defaults to a generic retry message.
OptionallastOptional function to transform the last user message for navigation context. Allows customization of how the previous message is processed.
OptionaltoolOptional message or function for tool output when navigation occurs. If a function, it receives the client ID and agent name, returning a string or promise of a string. Defaults to a message indicating successful navigation.
Configuration parameters for creating a navigation handler to a specific agent. Defines optional messages or functions to handle flush, emission, execution, and tool output scenarios during navigation, incorporating the last user message where applicable.
INavigateToAgentParams
Example
Example