{"record":{"id":"0f805c586d7edb3f","repo":"moeru-ai/airi","slug":"websocket-transport-is-not-implemented-for-node-ru","errorCode":null,"errorMessage":"WebSocket transport is not implemented for node runtime yet.","messagePattern":"WebSocket transport is not implemented for node runtime yet\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/plugin-sdk/src/plugin-host/runtimes/node/index.ts","lineNumber":29,"sourceCode":"\n/**\n * Creates the Eventa context used by node-side extension host sessions.\n *\n * 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":11,"sourceCodeEnd":40,"githubUrl":"https://github.com/moeru-ai/airi/blob/677329427f32468c74b17f3ec47eeca4e05bec65/packages/plugin-sdk/src/plugin-host/runtimes/node/index.ts#L11-L40","documentation":"Thrown by createPluginContext in the node runtime when transport.kind === 'websocket'. The node runtime's transport switch currently implements only 'in-memory'; a WebSocket-based Eventa context is planned but not implemented, so requesting it is an explicit hard stop rather than silent degradation.","triggerScenarios":"Bootstrapping a node extension session with createPluginContext({ kind: 'websocket', url: 'ws://...' }); a shared config object that picks websocket for all environments being reused in a Node host; migrating an extension host from in-memory to remote WebSocket transport before the node implementation landed.","commonSituations":"Trying to host extensions out-of-process over a WebSocket from a Node server; copying transport config from a browser prototype into Node tooling; version skew where docs mention websocket support that the installed plugin-sdk version does not ship.","solutions":["Use the implemented transport for node: createPluginContext({ kind: 'in-memory' }).","Keep the remote-transport plan but gate it: select 'websocket' only when the runtime that supports it is available, falling back to 'in-memory' in Node.","Upgrade plugin-sdk and re-check runtimes/node/index.ts — the switch is the source of truth for what is implemented.","For true process isolation today, run a separate host process and bridge at the application layer instead of the plugin transport."],"exampleFix":"// before\nconst ctx = createPluginContext({ kind: 'websocket', url: 'ws://localhost:8081' }) // node runtime: throws\n\n// after\nconst ctx = createPluginContext({ kind: 'in-memory' })","handlingStrategy":"type-guard","validationCode":"// Node runtime: only 'in-memory' is implemented.\nif (transport.kind !== 'in-memory') {\n  throw new Error(`Node plugin host supports only 'in-memory' transport, got '${transport.kind}'`)\n}","typeGuard":"type NodeSupportedTransport = Extract<PluginTransport, { kind: 'in-memory' }>\nconst isNodeSupportedTransport = (t: PluginTransport): t is NodeSupportedTransport => t.kind === 'in-memory'","tryCatchPattern":"try {\n  ctx = createPluginContext(transport)\n} catch (error) {\n  if (error instanceof Error && error.message.includes('not implemented for node runtime')) {\n    ctx = createPluginContext({ kind: 'in-memory' }) // deliberate fallback only if acceptable\n  } else {\n    throw error\n  }\n}","preventionTips":["Centralize transport selection per runtime in one module with an explicit allowlist.","Add a startup assertion on the transport kind before bootstrapping the host.","Track plugin-sdk releases; the runtime switch files are the source of truth for implemented kinds."],"tags":["plugin-sdk","transport","websocket","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"}