eLabSDK2.Bootloader.HandlerInvoker

Wraps an add-on-registered callback id (returned by sdkFacade when an
add-on passes a function as an SDK arg) into a host-callable
(...args) => Promise<unknown>. The wrapper posts an invoke-handler
message over the add-on's channel, awaits the matching result /
error reply, and re-throws errors as plain Errors.

Auto-unwraps SDK arguments: if the host passes a wrapped handler stub
({ __addonHandler }) back into a callback's args (e.g. echoing an
onClick handler reference), isHandlerStub recognises it and the
iframe re-invokes that handler locally instead of round-tripping.

One invoker per AddonChannel; the RpcBroker holds them in a WeakMap
keyed by channel.


© 2026 eLabNext