{"record":{"id":"3fc41130162f4a00","repo":"moeru-ai/airi","slug":"node-worker-transport-is-not-implemented-yet","errorCode":null,"errorMessage":"Node worker transport is not implemented yet.","messagePattern":"Node worker 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":31,"sourceCode":" * 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":13,"sourceCodeEnd":40,"githubUrl":"https://github.com/moeru-ai/airi/blob/27111382b4a79a7e983289d6e983a06af185ed0f/packages/plugin-sdk/src/plugin-host/runtimes/node/index.ts#L13-L40","documentation":"Thrown by createPluginContext() in the node runtime adapter when transport.kind is 'node-worker'. Despite node worker_threads being a natural node transport, the adapter has not wired it up and fails fast rather than silently degrading.","triggerScenarios":"Calling createPluginContext({ kind: 'node-worker', worker }) where worker is a node:worker_threads.Worker instance. The union type permits it, but the node adapter throws.","commonSituations":"Attempting to isolate plugin execution in a node worker thread for performance/safety, expecting the SDK to provide the bridge. Common during sandboxing or multi-tenant plugin host design on node.","solutions":["Use { kind: 'in-memory' } until the node-worker transport is implemented.","If worker isolation is mandatory, build a custom Eventa context bridging the worker and pass it directly, bypassing createPluginContext.","Track/contribute the node-worker implementation in the SDK rather than working around the guard."],"exampleFix":"// before\nconst ctx = createPluginContext({ kind: 'node-worker', worker: new Worker('./plugin.js') })\n\n// after\nconst ctx = createPluginContext({ kind: 'in-memory' })","handlingStrategy":"validation","validationCode":"if (transport.kind === 'node-worker') {\n  throw new Error('node-worker transport is not implemented yet. 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 && /Node worker transport is not implemented/.test(error.message)) {\n    ctx = createPluginContext({ kind: 'in-memory' })\n  } else {\n    throw error\n  }\n}","preventionTips":["Do not pass { kind: 'node-worker' } to the node adapter until it ships support.","If worker isolation is required, build a custom Eventa context bridging worker_threads.","Gate transport choice on an isImplementedNodeTransport check."],"tags":["transport","node","not-implemented","worker-threads"],"backgroundTag":null,"analyzedSha":"27111382b4a79a7e983289d6e983a06af185ed0f","analyzedAt":"2026-08-12T18:33:34.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}