pub async fn evaluate(
binding: &OnceLock<WeakAgentHarness>,
tool: &str,
args: &Value,
signal: &CancellationToken,
) -> Option<BeforeToolCallResult>Expand description
Evaluate one tool call against the current mode + host handler.
Owned inputs only: the before_tool_call future must be 'static, so the
hook copies the tool name/args before awaiting.
Cancellation is propagated (reviewer blocker #4): once the handler door is
open, a stale UI prompt must not hold the tool turn forever — if signal
fires first the call fails closed (blocked), never open.