/** * Code-action meta-tool * * Instead of the LLM calling tools one-by-one through the tool loop, * `toolEval` lets the LLM write a short JS function body that orchestrates * multiple tools in a single turn. The runtime executes it via AsyncFunction. */ import { type ToolFunction } from './types.js'; /** * Options for toolEval */ export interface ToolEvalOptions { /** Execution timeout in milliseconds (default: 30000) */ timeout?: number; } /** * Create a code-action meta-tool. * * Accepts raw functions or `tool()`-wrapped functions, with an optional * options object as the last argument. Only a `tool_eval` meta-tool is * sent to the LLM. When the LLM calls it with a JavaScript function body, * the code is executed with the registered functions available in scope. * * @example * ```ts * const exec = toolEval(add, multiply, readFile, sendEmail); * * const result = await prompt` * Read example.txt, multiply 123 by 456, and email the result. * ${exec} * `(); * ``` */ export declare function toolEval(...args: [...((...args: any[]) => any)[], ToolEvalOptions] | ((...args: any[]) => any)[]): ToolFunction; //# sourceMappingURL=tool-eval.d.ts.map