import type { ToolDefinition } from '../types/messages.js'; import type { ToolExecutionResult } from '../types/agent.js'; /** Defines a tool the model can call, typing its arguments. */ export declare function tool = Record>(definition: { name: string; description: string; parameters: Record; execute: (args: TArgs) => Promise | unknown; }): ToolDefinition; /** Runs tool calls by name, reporting failures as results rather than throwing. */ export declare class ToolExecutor { private tools; constructor(tools?: ToolDefinition[]); /** Adds a tool, replacing one with the same name. Returns the executor, for chaining. */ register(toolDefinition: ToolDefinition): this; /** Whether a tool is registered. */ has(name: string): boolean; /** Every registered tool. */ list(): ToolDefinition[]; /** Runs a tool. An unknown name or a thrown error comes back as a failed result. */ execute(name: string, args: Record): Promise; }