Graphorin API reference v0.1.0
Graphorin API reference / @graphorin/tools / / ToolRegistry
Interface: ToolRegistry
Defined in: packages/tools/src/registry/registry.ts:72
Strategy-aware tool registry.
Stable
Methods
assertNoDuplicates()
Call Signature
assertNoDuplicates(): void;Defined in: packages/tools/src/registry/registry.ts:98
Pure-detection collision check. Throws DuplicateToolNameError on first-party / inline collisions (programming errors). Bytes-equal back-compat for callers that never wired a strategy.
Returns
void
Call Signature
assertNoDuplicates(strategy, ctx): readonly CollisionResolution[];Defined in: packages/tools/src/registry/registry.ts:105
Strategy-aware collision overload. Returns the CollisionResolution records for the audit emitter + counter increments. Throws ToolCollisionError on the 'manual' strategy with no automatic resolution.
Parameters
| Parameter | Type |
|---|---|
strategy | CollisionStrategy |
ctx | CollisionContext |
Returns
readonly CollisionResolution[]
clear()
clear(): void;Defined in: packages/tools/src/registry/registry.ts:118
Tear down the registry — clears every entry.
Returns
void
get()
get<TInput, TOutput, TDeps>(name):
| RegistryEntry<TInput, TOutput, TDeps>
| undefined;Defined in: packages/tools/src/registry/registry.ts:78
Type Parameters
| Type Parameter | Default type |
|---|---|
TInput | unknown |
TOutput | unknown |
TDeps | unknown |
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
| RegistryEntry<TInput, TOutput, TDeps> | undefined
list()
list(): readonly RegistryEntry[];Defined in: packages/tools/src/registry/registry.ts:81
Returns
readonly RegistryEntry[]
listByTag()
listByTag(tag): readonly RegistryEntry[];Defined in: packages/tools/src/registry/registry.ts:91
Filter the registry by tag. Each registered tool's tags array is inspected; tools that include tag are returned in registration order. Empty array when no tool matches. Used by the deferred-tool lookup path AND by operator queries (e.g. tool({ tags: ['experimental'] }) for opt-out from per-tool lint rules).
Parameters
| Parameter | Type |
|---|---|
tag | string |
Returns
readonly RegistryEntry[]
listDeferred()
listDeferred(): readonly RegistryEntry[];Defined in: packages/tools/src/registry/registry.ts:83
Returns
readonly RegistryEntry[]
listEager()
listEager(): readonly RegistryEntry[];Defined in: packages/tools/src/registry/registry.ts:82
Returns
readonly RegistryEntry[]
register()
register<TInput, TOutput, TDeps>(tool, source?): RegistryEntry<TInput, TOutput, TDeps>;Defined in: packages/tools/src/registry/registry.ts:73
Type Parameters
| Type Parameter |
|---|
TInput |
TOutput |
TDeps |
Parameters
| Parameter | Type |
|---|---|
tool | Tool<TInput, TOutput, TDeps> |
source? | ToolSource |
Returns
RegistryEntry<TInput, TOutput, TDeps>
searchDeferred()
searchDeferred(query, k?): Promise<readonly ToolSearchMatch[]>;Defined in: packages/tools/src/registry/registry.ts:114
Search the deferred pool for tools matching query. Three-tier composable chain: semantic (embedder-backed) ⟶ BM25 fallback ⟶ regex name-match final fallback.
Parameters
| Parameter | Type |
|---|---|
query | string |
k? | number |
Returns
Promise<readonly ToolSearchMatch[]>
size()
size(): number;Defined in: packages/tools/src/registry/registry.ts:116
Snapshot for tests.
Returns
number
unregister()
unregister(name): boolean;Defined in: packages/tools/src/registry/registry.ts:77
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
boolean