Interface: IServerProvider
Makaio Framework / contracts / IServerProvider
Interface: IServerProvider
Section titled “Interface: IServerProvider”Defined in: ../../../packages/contracts/src/capabilities/server/types.ts:95
Capability provider that exposes a raw HTTP server for WebSocket upgrades.
The composition root (host shell) registers an IServerProvider after
creating a Node-compatible HTTP server. Extensions that need to handle
WebSocket upgrade events query this capability from the bus and call
getServer to obtain the server handle.
If no provider is registered (e.g. in a test kernel), consumers must degrade gracefully.
Example
Section titled “Example”class NodeServerProvider implements IServerProvider { readonly id = 'node-server'; readonly displayName = 'Node HTTP Server'; readonly capabilityId = SERVER_CAPABILITY_ID;
constructor(private readonly server: HttpServerLike) {}
getServer(): HttpServerLike { return this.server; }}Extends
Section titled “Extends”Properties
Section titled “Properties”capabilityId
Section titled “capabilityId”
readonlycapabilityId:"server"
Defined in: ../../../packages/contracts/src/capabilities/server/types.ts:97
Capability identifier — must be 'server'.
displayName
Section titled “displayName”
readonlydisplayName:string
Defined in: ../../../packages/contracts/src/capability/types.ts:11
Human-readable name for display in UI
Inherited from
Section titled “Inherited from”ICapabilityProvider.displayName
readonlyid:string
Defined in: ../../../packages/contracts/src/capability/types.ts:9
Unique identifier for this provider instance
Inherited from
Section titled “Inherited from”providerKey?
Section titled “providerKey?”
readonlyoptionalproviderKey?:string
Defined in: ../../../packages/contracts/src/capability/types.ts:17
Stable provider identity used for joins across registries.
Unlike id, this should remain stable across runtime re-registration.
Inherited from
Section titled “Inherited from”ICapabilityProvider.providerKey
Methods
Section titled “Methods”getServer()
Section titled “getServer()”getServer():
HttpServerLike
Defined in: ../../../packages/contracts/src/capabilities/server/types.ts:103
Return the underlying HTTP server for upgrade handling.
Returns
Section titled “Returns”The HTTP server instance.
validate()?
Section titled “validate()?”
optionalvalidate():Promise<{error?:string;valid:boolean; }>
Defined in: ../../../packages/contracts/src/capability/types.ts:22
Optional validation method to check provider configuration/credentials.
Returns
Section titled “Returns”Promise<{ error?: string; valid: boolean; }>
Validation result with optional error message