Skip to main content

Interface: IExtensionRuntime

Defined in: Extensions/IExtensionRuntime.ts:97

Worker-side runtime contract.

Implementations live in packages/desktop/extension-runtime/index.ts. Tests can substitute a mock implementation backed by an in-memory transport.

Methods

dispatch()

dispatch(envelope): Promise<void>

Defined in: Extensions/IExtensionRuntime.ts:111

Dispatch an incoming RPC envelope. The host calls this for reverse-RPC (host → worker) requests, e.g. invoking command handlers or commentary provider endpoints registered by the extension.

Parameters

envelope

RpcEnvelope

Returns

Promise<void>


dispose()

dispose(): Promise<void>

Defined in: Extensions/IExtensionRuntime.ts:123

Run the extension's deactivate() (if any) and tear down the runtime. After dispose() resolves, the worker process exits naturally.

Returns

Promise<void>


getApi()

getApi(): BibleExtensionAPI

Defined in: Extensions/IExtensionRuntime.ts:117

Get the API proxy injected into the extension. Mostly useful for tests; production extensions hold their own reference from activate(api).

Returns

BibleExtensionAPI


init()

init(payload): Promise<void>

Defined in: Extensions/IExtensionRuntime.ts:104

Receive the init payload from the host. Builds the BibleExtensionAPI proxy from the granted permissions, dynamically imports the manifest's main, and calls activate(api). Resolves once activate() has resolved (or rejects on timeout / load error).

Parameters

payload

ExtensionInitPayload

Returns

Promise<void>