moeru-ai/airi · error · Error

Electron transport is not implemented yet.

Error message

Electron transport is not implemented yet.

What it means

Thrown by createPluginContext in the node runtime when transport.kind === 'electron'. Electron IPC transport belongs to the Electron host, not the plain Node host: the node runtime entry only creates an in-memory Eventa context and explicitly rejects electron transport because the Electron IPC bridges are not available here.

Solutions

  1. Use { kind: 'in-memory' } for the Node host and reserve { kind: 'electron' } for the Electron runtime host that implements it.
  2. Branch transport selection by environment: process.versions.electron ? electronTransport : { kind: 'in-memory' }.
  3. Move the shared bootstrap behind a runtime parameter so each entry passes its own supported transport.

Example fix

// before
const ctx = createPluginContext({ kind: 'electron' }) // under plain node: throws

// after
const ctx = createPluginContext({ kind: 'in-memory' }) // node host
// electron host keeps: createPluginContext({ kind: 'electron' })
Defensive patterns

Strategy: type-guard

Validate before calling

// Only pick 'electron' when actually running inside Electron:
const inElectron = Boolean(process.versions?.electron)
const transport = inElectron ? { kind: 'electron' } : { kind: 'in-memory' }

Type guard

const isPlainNode = (): boolean => typeof process !== 'undefined' && !process.versions?.electron
// then: if (isPlainNode()) require transport.kind === 'in-memory'

Prevention

When it happens

Trigger: Running extension-host bootstrap code under plain Node (main script, test, server) with a transport config of { kind: 'electron' } inherited from the desktop app; sharing one transport-selection helper between the Electron main process and Node tooling; unit tests importing the node runtime but keeping the app's electron transport default.

Common situations: Extracting plugin bootstrap into shared code used by both Electron main and Node scripts; running Electron app logic in CI under plain node; defaults leaking across environments via a shared config module.

Related errors


AI-assisted analysis of moeru-ai/airi@677329427f (2026-08-18). Data as JSON: /api/errors/9a93da2f6ba9b55b. Report an issue: GitHub.

Appendix: source

Thrown at packages/plugin-sdk/src/plugin-host/runtimes/node/index.ts:33

 * Use when:
 * - Bootstrapping a node runtime extension session
 *
 * Expects:
 * - `transport` describes a transport supported by the node runtime
 *
 * Returns:
 * - A node-compatible Eventa context, or throws if the transport is not implemented
 */
export function createPluginContext(transport: PluginTransport): EventContext<any, any> {
  switch (transport.kind) {
    case 'in-memory':
      return createContext()
    case 'websocket':
      throw new Error('WebSocket transport is not implemented for node runtime yet.')
    case 'node-worker':
      throw new Error('Node worker transport is not implemented yet.')
    case 'electron':
      throw new Error('Electron transport is not implemented yet.')
    case 'web-worker':
      throw new Error('Web worker transport is not available in node runtime.')
    default:
      throw new Error('Unknown plugin transport kind.')
  }
}

View on GitHub (pinned to 677329427f)