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 `functionCall` part from a Gemini response (structural - no SDK import). */ interface FunctionCallLike { name?: string; args?: unknown; /** Present when the model supplies an id (parallel function calling). */ id?: string; } /** A `functionResponse` part to send back in the next turn. */ interface FunctionResponsePart { functionResponse: { name: string; response: Record; id?: string; }; } /** Executes the named tool with its parsed args, returning the tool's output. */ type ToolExecutor = (name: string, args: Record) => unknown | Promise; /** * Guard ONE Gemini function call: score `name(args)` through AxioRank, then run * `executor` (allow) or refuse (deny). Returns the `functionResponse` part to * send back. Defaults to `onDeny: "return"` so the model reads the refusal and * can re-plan; pass `onDeny: "throw"` to raise {@link AxioRankDeniedError}. */ declare function guardFunctionCall(call: FunctionCallLike, caller: ToolCaller, executor: ToolExecutor, opts?: GuardOptions): Promise; /** * Build a dispatcher over a map of tool handlers: pass any `functionCall` part * and it scores + runs the matching handler, returning the `functionResponse`. * A call naming an unknown tool yields an error response (and is NOT scored, * since nothing runs), so the agent loop keeps going. */ declare function guardFunctionHandlers(handlers: Record) => unknown | Promise>, caller: ToolCaller, opts?: GuardOptions): (call: FunctionCallLike) => Promise; export { type FunctionCallLike, type FunctionResponsePart, GuardOptions, ToolCaller, type ToolExecutor, guardFunctionCall, guardFunctionHandlers };