/** * Tool Decorator and Registry - Type-safe tool creation and management */ export interface ToolParameters { type: 'object'; properties: Record; required?: string[]; } export interface ToolConfig { name: string; description?: string; parameters?: ToolParameters | any; category?: string; execute: (params: TParams, context?: ToolContext) => Promise | TResult; } export interface ToolContext { agentName?: string; sessionId?: string; runId?: string; signal?: AbortSignal; } export interface ToolDefinition { name: string; description: string; parameters: ToolParameters; category?: string; } /** * Tool class - Represents an executable tool */ export declare class FunctionTool { readonly name: string; readonly description: string; readonly parameters: ToolParameters; readonly category?: string; private readonly executeFn; constructor(config: ToolConfig); private normalizeParameters; private zodToJsonSchema; private zodFieldToJsonSchema; execute(params: TParams, context?: ToolContext): Promise; /** * Get the tool definition for LLM */ getDefinition(): ToolDefinition; /** * Get OpenAI-compatible tool format */ toOpenAITool(): { type: 'function'; function: { name: string; description: string; parameters: any; }; }; } /** * Create a tool from a configuration object */ export declare function tool(config: ToolConfig): FunctionTool; /** * Tool Registry - Manages tool registration and lookup */ export declare class ToolRegistry { private tools; register(tool: FunctionTool, options?: { overwrite?: boolean; }): this; get(name: string): FunctionTool | undefined; has(name: string): boolean; list(): FunctionTool[]; getByCategory(category: string): FunctionTool[]; getDefinitions(): ToolDefinition[]; toOpenAITools(): Array<{ type: 'function'; function: any; }>; delete(name: string): boolean; clear(): void; } export declare function getRegistry(): ToolRegistry; export declare function registerTool(tool: FunctionTool, options?: { overwrite?: boolean; }): void; export declare function getTool(name: string): FunctionTool | undefined;