import { T as ToolCaller, G as GuardOptions } from '../_shared-Dc0ifJAY.js'; export { O as OnDeny, d as denialMessage, g as guardExecute } from '../_shared-Dc0ifJAY.js'; import '../types-C6RfE7pX.js'; /** * AxioRank adapter for LlamaIndex.TS. * * Wrap a LlamaIndex tool so each call's arguments are scored by AxioRank * before the tool runs. The wrapper is structural (any object with `call` + * `metadata` qualifies), so it works with `FunctionTool`, `tool()`, and * custom `BaseTool` implementations without importing llamaindex here. * * @example * ```ts * import { AxioRank } from "@axiorank/sdk"; * import { guardTools } from "@axiorank/sdk/llamaindex"; * import { agent } from "@llamaindex/workflow"; * * const axio = new AxioRank({ apiKey: process.env.AXIORANK_KEY! }); * const myAgent = agent({ * llm, * tools: guardTools(myTools, axio, { onDeny: "return" }), * }); * ``` * * On a `deny`, the default is to throw {@link AxioRankDeniedError}; pass * `onDeny: "return"` to hand the model a short refusal string instead so the * agent can re-plan. */ /** * The parts of a LlamaIndex tool the adapter needs (matches `BaseTool`). * Typed structurally so FunctionTool / tool() instances satisfy it without a * peer dependency. */ interface LlamaIndexToolLike { metadata: { name: string; description: string; }; call: (input: any, ...rest: any[]) => any; } /** * Wrap a LlamaIndex tool so AxioRank scores its arguments before it runs. The * returned tool keeps the original `metadata` (name, description, parameter * schema), so agents and workflows accept it as a drop-in replacement. */ declare function guardTool(t: T, caller: ToolCaller, opts?: GuardOptions): LlamaIndexToolLike; /** Wrap every tool in an array (LlamaIndex agents take a tools array). */ declare function guardTools(tools: LlamaIndexToolLike[], caller: ToolCaller, opts?: GuardOptions): LlamaIndexToolLike[]; export { GuardOptions, type LlamaIndexToolLike, ToolCaller, guardTool, guardTools };