Class: AdapterRegistry
Makaio Framework / services-core / AdapterRegistry
Class: AdapterRegistry
Section titled “Class: 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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”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.
Parameters
Section titled “Parameters”The event bus to listen on
Returns
Section titled “Returns”AdapterRegistry
Methods
Section titled “Methods”destroy()
Section titled “destroy()”destroy():
void
Defined in: ../../../packages/services/core/src/session/adapter-registry.ts:87
Stop listening to adapter.initialized events and clear the registry.
Returns
Section titled “Returns”void
resolve()
Section titled “resolve()”resolve(
adapterName):string
Defined in: ../../../packages/services/core/src/session/adapter-registry.ts:52
Resolve an adapterId from the event cache.
Parameters
Section titled “Parameters”adapterName
Section titled “adapterName”string
Adapter type name (e.g., 'openai-node', 'claude-agent-sdk')
Returns
Section titled “Returns”string
The cached adapterId registered for this adapterName.
Throws
Section titled “Throws”Error when no adapter with this name is present in the event cache
resolveAvailable()
Section titled “resolveAvailable()”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.
Parameters
Section titled “Parameters”adapterName
Section titled “adapterName”string
Adapter type name (e.g., 'openai-node')
Returns
Section titled “Returns”Promise<string>
Adapter runtime identifier for bus routing.