import { T as ToolCaller, G as GuardOptions } from '../_shared-Dc0ifJAY.js'; export { O as OnDeny, d as denialMessage, r as runGuarded } from '../_shared-Dc0ifJAY.js'; import '../types-C6RfE7pX.js'; /** A `tool_use` content block from an Anthropic assistant message (structural). */ interface ToolUseBlockLike { id: string; name: string; input: unknown; } /** A `tool_result` content block to send back in the next user message. */ interface ToolResultBlock { type: "tool_result"; tool_use_id: string; content: string; is_error?: boolean; } /** Executes the named tool with its parsed input, returning the tool's output. */ type ToolExecutor = (name: string, input: Record) => unknown | Promise; /** * Guard ONE Anthropic `tool_use` block: score `name(input)` through AxioRank, * then run `executor` (allow) or refuse (deny). Returns the `tool_result` block to * send back. Defaults to `onDeny: "return"` so the model reads the refusal and can * re-plan; pass `onDeny: "throw"` to raise {@link AxioRankDeniedError} instead. */ declare function guardToolUse(block: ToolUseBlockLike, caller: ToolCaller, executor: ToolExecutor, opts?: GuardOptions): Promise; /** * Build a dispatcher over a map of tool handlers: pass any `tool_use` block and it * scores + runs the matching handler, returning the `tool_result`. A block naming * an unknown tool yields an `is_error` result (and is NOT scored, since nothing * runs), so the agent loop keeps going. */ declare function guardToolHandlers(handlers: Record) => unknown | Promise>, caller: ToolCaller, opts?: GuardOptions): (block: ToolUseBlockLike) => Promise; export { GuardOptions, ToolCaller, type ToolExecutor, type ToolResultBlock, type ToolUseBlockLike, guardToolHandlers, guardToolUse };