Creates an instance of ToolRegistry.
OptionalstateManager: StateManagerOptional StateManager instance for advanced filtering.
Removes all registered tool executors from the registry. Primarily useful for resetting state during testing or specific application scenarios.
A promise that resolves when all tools have been cleared.
Retrieves the schemas of all currently registered tools.
Retrieves the schemas of available tools, optionally filtering by those enabled for a specific thread.
If filter.enabledForThreadId is provided and a StateManager was injected, it attempts to load the thread's configuration
and return only the schemas for tools listed in enabledTools. Otherwise, it returns all registered tool schemas.
Optionalfilter: { enabledForThreadId?: string }Optional filter criteria. enabledForThreadId triggers filtering based on thread config.
A promise resolving to an array containing the ToolSchema of the available tools based on the filter.
Retrieves a registered tool executor instance by its unique name.
The name property defined in the tool's schema.
A promise resolving to the IToolExecutor instance, or undefined if no tool with that name is registered.
Registers a tool executor instance, making it available for lookup via getToolExecutor.
If a tool with the same name (from executor.schema.name) already exists, it will be overwritten, and a warning will be logged.
The instance of the class implementing IToolExecutor. Must have a valid schema with a name.
A promise that resolves when the tool is registered.
Unregister a single tool by name.
Unregister tools matching a predicate; returns count removed.
A simple in-memory implementation of the
ToolRegistryinterface. Stores tool executors in a Map, keyed by the tool's unique name.