{"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/27111382b4a79a7e983289d6e983a06af185ed0f/packages/plugin-sdk/src/plugin-host/runtimes/node/index.ts#L11-L40","documentation":"Thrown by createPluginContext() in the node runtime adapter when transport.kind is 'websocket'. The node runtime only implements the 'in-memory' transport; the websocket branch is an explicit not-yet-implemented guard rather than silent acceptance.","triggerScenarios":"Calling createPluginContext({ kind: 'websocket', url, protocols }) on the node runtime. The PluginTransport union allows this kind, but the node adapter has no implementation for it.","commonSituations":"A plugin host configured for node attempts to use a websocket transport expecting cross-process plugin communication. Typically arises when porting an Electron/web-based plugin setup to node without switching the transport.","solutions":["Use { kind: 'in-memory' } for node-runtime plugin contexts until websocket support ships.","If websocket is required, run the host in an environment whose runtime adapter implements it, or contribute an implementation for the node adapter.","Gate transport selection on the runtime so node never receives a websocket transport."],"exampleFix":"// before\nconst ctx = createPluginContext({ kind: 'websocket', url: 'ws://localhost:8080' })\n\n// after\nconst ctx = createPluginContext({ kind: 'in-memory' })","handlingStrategy":"validation","validationCode":"if (transport.kind === 'websocket') {\n  throw new Error('WebSocket transport is not implemented for the node runtime. Use in-memory.')\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 && /WebSocket transport is not implemented for node/.test(error.message)) {\n    ctx = createPluginContext({ kind: 'in-memory' })\n  } else {\n    throw error\n  }\n}","preventionTips":["Default to { kind: 'in-memory' } for node-runtime plugin contexts.","Branch transport selection on the runtime so node never receives websocket.","Track the SDK changelog for when websocket support lands in the node adapter."],"tags":["transport","node","not-implemented","websocket"],"backgroundTag":null,"analyzedSha":"27111382b4a79a7e983289d6e983a06af185ed0f","analyzedAt":"2026-08-12T18:33:34.132Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}