ToolRegistry Class

The ToolRegistry holds a mapping between toolIds and their corresponding Tool class. This provides the mechanism to find Tools by their toolId, and also a way to iterate over the set of Tools available.

Methods

Name Description
constructor(): ToolRegistry    
create(toolId: string, ...args: any[]): undefined | Tool Look up a tool by toolId and, if found, create an instance with the supplied arguments.  
find(toolId: string): undefined | Look up a tool by toolId  
findExactMatch(keyin: string): undefined | Find a tool by its localized keyin.  
findPartialMatches(keyin: string): FuzzySearchResults<> Find a tool by its localized keyin using a FuzzySearch  
getToolList(): ToolList Get a list of Tools currently registered, excluding hidden tools  
parseAndRun(keyin: string): Promise<ParseAndRunResult> Given a string consisting of a toolId followed by any number of arguments, parse the keyin string and invoke the corresponding tool's parseAndRun method.  
parseKeyin(keyin: string): ParseKeyinResult Given a string consisting of a toolId followed by any number of arguments, locate the corresponding Tool and parse the arguments.  
register(toolClass: undefined, namespace?: string): void Register a Tool class.  
registerModule(moduleObj: any, namespace?: string): void Register all the Tool classes found in a module.  
run(toolId: string, ...args: any[]): Promise<boolean> Look up a tool by toolId and, if found, create an instance with the supplied arguments and run it.  
shutdown(): void    
unRegister(toolId: string): void Un-register a previously registered Tool class.  

Properties

Name Type Description
tools Readonly Map<string, >    

Defined in

Last Updated: 30 November, 2023