Skip to content

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

ts
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

ts
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
ParameterType
strategyCollisionStrategy
ctxCollisionContext
Returns

readonly CollisionResolution[]


clear()

ts
clear(): void;

Defined in: packages/tools/src/registry/registry.ts:118

Tear down the registry — clears every entry.

Returns

void


get()

ts
get<TInput, TOutput, TDeps>(name): 
  | RegistryEntry<TInput, TOutput, TDeps>
  | undefined;

Defined in: packages/tools/src/registry/registry.ts:78

Type Parameters

Type ParameterDefault type
TInputunknown
TOutputunknown
TDepsunknown

Parameters

ParameterType
namestring

Returns

| RegistryEntry&lt;TInput, TOutput, TDeps&gt; | undefined


list()

ts
list(): readonly RegistryEntry[];

Defined in: packages/tools/src/registry/registry.ts:81

Returns

readonly RegistryEntry[]


listByTag()

ts
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

ParameterType
tagstring

Returns

readonly RegistryEntry[]


listDeferred()

ts
listDeferred(): readonly RegistryEntry[];

Defined in: packages/tools/src/registry/registry.ts:83

Returns

readonly RegistryEntry[]


listEager()

ts
listEager(): readonly RegistryEntry[];

Defined in: packages/tools/src/registry/registry.ts:82

Returns

readonly RegistryEntry[]


register()

ts
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

ParameterType
toolTool&lt;TInput, TOutput, TDeps&gt;
source?ToolSource

Returns

RegistryEntry&lt;TInput, TOutput, TDeps&gt;


searchDeferred()

ts
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

ParameterType
querystring
k?number

Returns

Promise&lt;readonly ToolSearchMatch[]&gt;


size()

ts
size(): number;

Defined in: packages/tools/src/registry/registry.ts:116

Snapshot for tests.

Returns

number


unregister()

ts
unregister(name): boolean;

Defined in: packages/tools/src/registry/registry.ts:77

Parameters

ParameterType
namestring

Returns

boolean