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
ParameterTypeDescription
toolToolDefinition<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
ParameterTypeDescription
idstring

admits

admits(toolIds: readonly string[], args: readonly unknown[], world: W): boolean

Whether every tool an intent names still admits its arguments.

ParameterTypeDescription
toolIdsreadonly string[]
argsreadonly unknown[]
worldW
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.