Interface INavigateToAgentParams

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

// Static message configuration
const params: INavigateToAgentParams = {
flushMessage: "Session reset.",
toolOutput: "Navigation completed.",
};
// Dynamic message configuration with last message
const params: INavigateToAgentParams = {
executeMessage: (clientId, lastMessage, agent) => `Processing ${lastMessage} for ${clientId} on ${agent}`,
emitMessage: (clientId, lastMessage, agent) => `Emitted ${lastMessage} for ${clientId} on ${agent}`,
};
interface INavigateToAgentParams {
    emitMessage?:
        | string
        | (
            clientId: string,
            lastMessage: string,
            lastAgent: string,
            agentName: string,
        ) => string | Promise<string>;
    executeMessage?:
        | string
        | (
            clientId: string,
            lastMessage: string,
            lastAgent: string,
            agentName: string,
        ) => string | Promise<string>;
    flushMessage?:
        | string
        | (clientId: string, defaultAgent: string) => string | Promise<string>;
    toolOutput?:
        | string
        | (clientId: string, agentName: string) => string | Promise<string>;
}

Properties

emitMessage?:
    | string
    | (
        clientId: string,
        lastMessage: string,
        lastAgent: string,
        agentName: string,
    ) => string | Promise<string>

Optional 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.

executeMessage?:
    | string
    | (
        clientId: string,
        lastMessage: string,
        lastAgent: string,
        agentName: string,
    ) => string | Promise<string>

Optional 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.

flushMessage?:
    | string
    | (clientId: string, defaultAgent: string) => string | Promise<string>

Optional 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.

toolOutput?:
    | string
    | (clientId: string, agentName: string) => string | Promise<string>

Optional 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.