Skip to content

Class: AdapterRegistry

Makaio Framework


Makaio Framework / services-core / AdapterRegistry

Defined in: ../../../packages/services/core/src/session/adapter-registry.ts:27

Resolves adapterName → adapterId mappings for the framework session orchestrator.

The runtime resolveId request is the authoritative seam. The adapter.initialized listener maintains a local cache for observers and for tests that intentionally exercise the event path.

Lifecycle: construct to start listening, call destroy() when done.

new AdapterRegistry(bus): AdapterRegistry

Defined in: ../../../packages/services/core/src/session/adapter-registry.ts:40

Create an AdapterRegistry and start listening for adapter.initialized events.

If the same adapterName is seen in a subsequent adapter.initialized event, the new adapterId silently overwrites the previous mapping. This is intentional: adapters that restart emit a fresh initialized event and the registry should reflect the latest instance.

IMakaioBus

The event bus to listen on

AdapterRegistry

destroy(): void

Defined in: ../../../packages/services/core/src/session/adapter-registry.ts:87

Stop listening to adapter.initialized events and clear the registry.

void


resolve(adapterName): string

Defined in: ../../../packages/services/core/src/session/adapter-registry.ts:52

Resolve an adapterId from the event cache.

string

Adapter type name (e.g., 'openai-node', 'claude-agent-sdk')

string

The cached adapterId registered for this adapterName.

Error when no adapter with this name is present in the event cache


resolveAvailable(adapterName): Promise<string>

Defined in: ../../../packages/services/core/src/session/adapter-registry.ts:71

Resolve an adapterId from an adapterName through the runtime identity resolver.

The adapter.initialized listener is a non-authoritative cache only. It keeps legacy event-driven tests and observers useful, but session routing must prefer the replayable request seam so a session created after adapter initialization does not miss a one-time event.

string

Adapter type name (e.g., 'openai-node')

Promise<string>

Adapter runtime identifier for bus routing.