Intelligence · class
ToolRegistry
Explained in Agents and behaviour.
class ToolRegistry<W>import { ToolRegistry } from '@driftengine/ai';Methods
register
register<A, R>(tool: ToolDefinition<A, R, W>): void| Parameter | Type | Description |
|---|---|---|
tool | ToolDefinition<A, R, W> |
ids
ids(): readonly string[]Registration order, so a prompt's tool list is stable and a trace stays comparable.
get
get(id: string): ToolDefinition<never, never, W> | undefined| Parameter | Type | Description |
|---|---|---|
id | string |
admits
admits(toolIds: readonly string[], args: readonly unknown[], world: W): booleanWhether every tool an intent names still admits its arguments.
| Parameter | Type | Description |
|---|---|---|
toolIds | readonly string[] | |
args | readonly unknown[] | |
world | W |
More
A plain loop rather than a map and an every: this runs at the moment a
buffered intent drains, which is inside a fixed step.