{"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/677329427f32468c74b17f3ec47eeca4e05bec65/packages/plugin-sdk/src/plugin-host/runtimes/node/index.ts#L15-L40","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use { kind: 'in-memory' } for the Node host and reserve { kind: 'electron' } for the Electron runtime host that implements it.","Branch transport selection by environment: process.versions.electron ? electronTransport : { kind: 'in-memory' }.","Move the shared bootstrap behind a runtime parameter so each entry passes its own supported transport."],"exampleFix":"// before\nconst ctx = createPluginContext({ kind: 'electron' }) // under plain node: throws\n\n// after\nconst ctx = createPluginContext({ kind: 'in-memory' }) // node host\n// electron host keeps: createPluginContext({ kind: 'electron' })","handlingStrategy":"type-guard","validationCode":"// Only pick 'electron' when actually running inside Electron:\nconst inElectron = Boolean(process.versions?.electron)\nconst transport = inElectron ? { kind: 'electron' } : { kind: 'in-memory' }","typeGuard":"const isPlainNode = (): boolean => typeof process !== 'undefined' && !process.versions?.electron\n// then: if (isPlainNode()) require transport.kind === 'in-memory'","tryCatchPattern":null,"preventionTips":["Never share one transport constant between Electron main and plain Node scripts.","Branch on process.versions.electron when the same bootstrap runs in both hosts."],"tags":["plugin-sdk","transport","electron","node-runtime","not-implemented"],"backgroundTag":"unsupported-transport-kind","analyzedSha":"677329427f32468c74b17f3ec47eeca4e05bec65","analyzedAt":"2026-08-18T17:29:58.153Z","contentChangedAt":"2026-08-18T17:29:58.153Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}