LensStudio:ChatTool.IChatToolRegistry
ClassInterface for registering and discovering ChatTool instances within the plugin system.
Index
Example
const ChatTool = await import('LensStudio:ChatTool');
const registry = this.pluginSystem.findInterface(
ChatTool.IChatToolRegistry
) as import('LensStudio:ChatTool').IChatToolRegistry;
const tools = registry.tools;
console.log(`Registered ChatTools: ${tools.length}`);
for (const tool of tools) {
console.log(` tool: ${tool.name} (${tool.id})`);
}
this.connections.push(
registry.toolRegistered.connect((descriptor) => {
console.log(`ChatTool registered: ${descriptor.name}`);
})
);
Extends
Properties
interfaceId
staticinterfaceId:InterfaceId
Unique identifier used to look up this interface via the plugin system.
toolDeregistered
readonlytoolDeregistered:signal1<IPluginDescriptor,void>
Signal emitted when a chat tool plugin is unregistered from the registry.
toolRegistered
readonlytoolRegistered:signal1<IPluginDescriptor,void>
Signal emitted when a new chat tool plugin is registered.
tools
readonlytools:IPluginDescriptor[]
Array of all currently registered chat tool plugin descriptors.
Methods
execute()
execute(
descriptor,parameters):Promise<Result>
Execute a registered chat tool by its plugin descriptor with the given parameters.
Parameters
| Parameter | Type |
|---|---|
descriptor | IPluginDescriptor |
parameters | Parameters |
Returns
Promise<Result>
getTypeName()
staticgetTypeName():string
Returns the type name of this class.
Returns
string
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object is of the specified type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object refers to the same instance as the given object.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean