Configuration parameters for creating a commit action handler (WRITE pattern). Defines validation, action execution, and response messages for state-modifying operations.
fallback: (error: Error, clientId: string, agentName: string) => void
Optional function to handle errors during action execution. Receives the error object, client ID, and agent name.
validateParams: (dto: { clientId: string; agentName: string; toolCalls: IToolCall[]; params: T; }) => string | Promise<string>
Optional function to validate action parameters. Returns error message string if validation fails, null if valid.
executeAction: (params: T, clientId: string, agentName: string) => string | Promise<string>
Function to execute the actual action (e.g., commitAppAction). Called only when parameters are valid and isLast is true. Returns result string to commit as tool output.
emptyContent: (params: T, clientId: string, agentName: string) => string | Promise<string>
Optional function to handle when executeAction returns empty result. Returns message to commit as tool output.
successMessage: string | ((params: T, clientId: string, agentName: string) => string | Promise<string>)
Message to execute using executeForce after successful action execution.
failureMessage: string | ((params: T, clientId: string, agentName: string) => string | Promise<string>)
Optional message to execute using executeForce when validation fails.