/** * AI SDK Tools Registry - Core Registry Implementation * * Singleton-safe registry for managing built-in and custom tools. * Supports lazy loading, middleware, and multi-agent safety. */ import type { ToolMetadata, ToolFactory, PraisonTool, ToolHooks, ToolMiddleware, ToolInstallStatus } from './types'; /** * Tools Registry - Manages tool registration, lookup, and instantiation */ export declare class ToolsRegistry { private tools; private middleware; private hooks; private installCache; /** * Register a tool with the registry */ register(metadata: ToolMetadata, factory: ToolFactory): this; /** * Unregister a tool */ unregister(id: string): boolean; /** * Check if a tool is registered */ has(id: string): boolean; /** * Get tool metadata */ getMetadata(id: string): ToolMetadata | undefined; /** * List all registered tools */ list(): ToolMetadata[]; /** * List tools by tag */ listByTag(tag: string): ToolMetadata[]; /** * List tools by capability */ listByCapability(capability: keyof ToolMetadata['capabilities']): ToolMetadata[]; /** * Create a tool instance (lazy loads the dependency) */ create(id: string, config?: TConfig): PraisonTool; /** * Add middleware to the pipeline */ use(middleware: ToolMiddleware): this; /** * Set hooks */ setHooks(hooks: ToolHooks): this; /** * Check if a tool's optional dependency is installed */ checkInstalled(id: string): Promise; /** * Check environment variables for a tool */ checkEnvVars(id: string): string[]; /** * Get installation status for a tool */ getInstallStatus(id: string): Promise; /** * Get installation status for all tools */ getAllInstallStatus(): Promise; /** * Clear the registry */ clear(): void; /** * Get the number of registered tools */ get size(): number; } /** * Get the global tools registry (singleton) */ export declare function getToolsRegistry(): ToolsRegistry; /** * Create a new isolated registry (for testing or multi-agent scenarios) */ export declare function createToolsRegistry(): ToolsRegistry; /** * Reset the global registry (mainly for testing) */ export declare function resetToolsRegistry(): void;