/** * Tool Registry - Dynamic tool registration and prompt generation * Tools can be added at runtime and their descriptions are automatically included in agent prompts */ import { ToolCall, ToolResult } from './types'; /** * Tool parameter definition */ export interface ToolParameter { name: string; type: 'string' | 'number' | 'boolean' | 'object'; description: string; required: boolean; default?: any; } /** * Tool definition */ export interface Tool { name: string; description: string; parameters: ToolParameter[]; /** * Execute the tool * @param params Tool parameters * @param context Execution context (page, memory, etc.) */ execute(params: Record, context: ToolExecutionContext): Promise; } /** * Context provided to tool execution */ export interface ToolExecutionContext { page: any; memory: any; stepNumber: number; logger?: (message: string, level?: 'log' | 'error' | 'warn') => void; previousSomScreenshot?: string; somHandler?: any; } /** * Tool Registry - manages available tools and generates prompts */ export declare class ToolRegistry { private tools; /** * Register a tool */ register(tool: Tool): void; /** * Unregister a tool */ unregister(toolName: string): void; /** * Get a tool by name */ get(toolName: string): Tool | undefined; /** * Get all registered tools */ getAll(): Tool[]; /** * Execute a tool */ execute(toolCall: ToolCall, context: ToolExecutionContext): Promise; /** * Generate tool descriptions for agent prompt * Returns formatted text describing all available tools */ generateToolDescriptions(): string; /** * Generate JSON schema for tool calls (for structured output) */ generateToolCallSchema(): any; } //# sourceMappingURL=tool-registry.d.ts.map