toolApproval function
Interrupts any tool call whose name is not in the allow-list, so a human
can approve it (by restarting with {'tool-approved': true}).
approved replaces the plugin's approvedTools for this call (the two are
not merged). When omitted, the plugin's list applies.
Implementation
GenerateMiddlewareRef<ToolApprovalOptions> toolApproval({
List<String>? approved,
}) {
return middlewareRef(
name: 'toolApproval',
// A null config lets the plugin fall back to its `approvedTools`.
config: approved == null ? null : ToolApprovalOptions(approved: approved),
);
}