/** * 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; /** * Get the global registry instance (alias for getToolsRegistry) * For Python SDK parity: get_registry() */ export declare function get_registry(): ToolsRegistry; /** camelCase alias for get_registry — idiomatic TypeScript */ export declare const getRegistry: typeof get_registry; /** * Get a single tool by name from the global registry * For Python SDK parity: get_tool() */ export declare function get_tool(id: string, config?: TConfig): PraisonTool | null; /** camelCase alias for get_tool — idiomatic TypeScript */ export declare const getTool: typeof get_tool; /** * Register a tool with the global registry * For Python SDK parity: register_tool() */ export declare function register_tool(metadata: ToolMetadata, factory: ToolFactory): void; /** camelCase alias for register_tool — idiomatic TypeScript */ export declare const registerTool: typeof register_tool; /** * Validate a tool's configuration and dependencies * For Python SDK parity: validate_tool() */ export declare function validate_tool(id: string): Promise<{ valid: boolean; installed: boolean; missingEnvVars: string[]; errors: string[]; }>; /** camelCase alias for validate_tool — idiomatic TypeScript */ export declare const validateTool: typeof validate_tool;