Skip to content

AgentRegistry

Defined in: scoring/agents.ts:132

Registry for managing available agents

const registry = new AgentRegistry();
// Register your agents (implementations from @jbcom/agentic or custom)
registry.register(myOllamaAgent);
registry.register(myJulesAgent);
registry.register(myCustomAgent);
// Get best agent for a complexity tier
const agent = registry.optimalFor('moderate');

new AgentRegistry(): AgentRegistry

AgentRegistry

get size(): number

Defined in: scoring/agents.ts:243

Get count of registered agents

number

all(): AgentDefinition<unknown>[]

Defined in: scoring/agents.ts:193

Get all registered agents

AgentDefinition<unknown>[]


clear(): void

Defined in: scoring/agents.ts:250

Clear all agents

void


enabled(): AgentDefinition<unknown>[]

Defined in: scoring/agents.ts:200

Get all enabled agents

AgentDefinition<unknown>[]


export(): Omit<AgentDefinition<unknown>, "execute">[]

Defined in: scoring/agents.ts:257

Export registry configuration (for serialization)

Omit<AgentDefinition<unknown>, "execute">[]


forTier(tier, includeDisabled?): AgentDefinition<unknown>[]

Defined in: scoring/agents.ts:208

Get agents that can handle a specific complexity tier Sorted by priority (lowest first), then by cost

ComplexityTier

boolean = false

AgentDefinition<unknown>[]


get(id): AgentDefinition<unknown> | undefined

Defined in: scoring/agents.ts:229

Get agent by ID

string

AgentDefinition<unknown> | undefined


has(id): boolean

Defined in: scoring/agents.ts:236

Check if an agent is registered

string

boolean


optimalFor(tier): AgentDefinition<unknown> | undefined

Defined in: scoring/agents.ts:222

Get the optimal (first choice) agent for a complexity tier

ComplexityTier

AgentDefinition<unknown> | undefined


register<T>(agent): this

Defined in: scoring/agents.ts:138

Register an agent

T

AgentDefinition<T>

this


registerAll(agents): this

Defined in: scoring/agents.ts:146

Register multiple agents at once

AgentDefinition<unknown>[]

this


setCost(id, cost): void

Defined in: scoring/agents.ts:183

Update an agent’s cost (for dynamic pricing)

string

number

void


setEnabled(id, enabled): void

Defined in: scoring/agents.ts:163

Enable/disable an agent at runtime

string

boolean

void


setPriority(id, priority): void

Defined in: scoring/agents.ts:173

Update an agent’s priority (for dynamic rebalancing)

string

number

void


unregister(id): boolean

Defined in: scoring/agents.ts:156

Unregister an agent

string

boolean