{"record":{"id":"9a93da2f6ba9b55b","repo":"moeru-ai/airi","slug":"electron-transport-is-not-implemented-yet","errorCode":null,"errorMessage":"Electron transport is not implemented yet.","messagePattern":"Electron transport is not implemented yet\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/plugin-sdk/src/plugin-host/runtimes/node/index.ts","lineNumber":33,"sourceCode":" * Use when:\n * - Bootstrapping a node runtime extension session\n *\n * Expects:\n * - `transport` describes a transport supported by the node runtime\n *\n * Returns:\n * - A node-compatible Eventa context, or throws if the transport is not implemented\n */\nexport function createPluginContext(transport: PluginTransport): EventContext<any, any> {\n  switch (transport.kind) {\n    case 'in-memory':\n      return createContext()\n    case 'websocket':\n      throw new Error('WebSocket transport is not implemented for node runtime yet.')\n    case 'node-worker':\n      throw new Error('Node worker transport is not implemented yet.')\n    case 'electron':\n      throw new Error('Electron transport is not implemented yet.')\n    case 'web-worker':\n      throw new Error('Web worker transport is not available in node runtime.')\n    default:\n      throw new Error('Unknown plugin transport kind.')\n  }\n}\n","sourceCodeStart":15,"sourceCodeEnd":40,"githubUrl":"https://github.com/moeru-ai/airi/blob/27111382b4a79a7e983289d6e983a06af185ed0f/packages/plugin-sdk/src/plugin-host/runtimes/node/index.ts#L15-L40","documentation":"Thrown by createPluginContext() in the node runtime adapter when transport.kind is 'electron'. The node adapter does not implement Electron IPC bridging; Electron transport belongs to the Electron runtime adapter, not node.","triggerScenarios":"Calling createPluginContext({ kind: 'electron', target, webContentsId }) from a node (non-Electron) host process. The PluginTransport union allows electron, but only the Electron runtime adapter is meant to handle it.","commonSituations":"Running the plugin host in a plain node process (e.g. a server or CLI) but passing an electron transport because the config was copied from an Electron app. Or the wrong runtime adapter was imported.","solutions":["Use the Electron runtime adapter (not the node one) when the host runs inside Electron's main process.","In a pure node process, use { kind: 'in-memory' } or implement the appropriate node transport.","Verify the imported createPluginContext comes from the runtime-matching entrypoint."],"exampleFix":"// before — node adapter, electron transport\nimport { createPluginContext } from '@proj-airi/plugin-sdk/plugin-host/runtimes/node'\nconst ctx = createPluginContext({ kind: 'electron', target: 'main' })\n\n// after — in-memory for node\nconst ctx = createPluginContext({ kind: 'in-memory' })","handlingStrategy":"validation","validationCode":"if (transport.kind === 'electron') {\n  throw new Error('Electron transport belongs to the Electron runtime adapter, not node.')\n}\nconst ctx = createPluginContext(transport)","typeGuard":"function isImplementedNodeTransport(transport: PluginTransport): boolean {\n  return transport.kind === 'in-memory'\n}","tryCatchPattern":"try {\n  ctx = createPluginContext(transport)\n} catch (error) {\n  if (error instanceof Error && /Electron transport is not implemented/.test(error.message)) {\n    ctx = createPluginContext({ kind: 'in-memory' })\n  } else {\n    throw error\n  }\n}","preventionTips":["Import createPluginContext from the runtime-matching entrypoint (Electron adapter for Electron hosts).","In pure node, never pass an electron transport.","Assert the transport kind is supported by the imported adapter before calling."],"tags":["transport","node","electron","not-implemented","runtime-mismatch"],"backgroundTag":null,"analyzedSha":"27111382b4a79a7e983289d6e983a06af185ed0f","analyzedAt":"2026-08-12T18:33:34.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}