{"record":{"id":"e8067aeee375f1a7","repo":"moeru-ai/airi","slug":"unknown-plugin-transport-kind","errorCode":null,"errorMessage":"Unknown plugin transport kind.","messagePattern":"Unknown plugin transport kind\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/plugin-sdk/src/plugin-host/runtimes/node/index.ts","lineNumber":37,"sourceCode":" * - `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":19,"sourceCodeEnd":40,"githubUrl":"https://github.com/moeru-ai/airi/blob/27111382b4a79a7e983289d6e983a06af185ed0f/packages/plugin-sdk/src/plugin-host/runtimes/node/index.ts#L19-L40","documentation":"Thrown by createPluginContext() in the node runtime adapter's default switch branch when transport.kind does not match any known case (in-memory, websocket, node-worker, electron, web-worker). This catches malformed, typo'd, or future transport kinds the adapter does not recognize.","triggerScenarios":"Calling createPluginContext() with a transport object whose `kind` is undefined, a typo (e.g. 'in_memory', 'WebSocket'), or a newly added union member the node adapter has not been updated to handle.","commonSituations":"Constructing the transport object dynamically and producing an invalid kind string. Version skew where a newer PluginTransport union adds a kind but the node adapter in the imported SDK version predates it. Forgetting to set `kind` entirely (undefined).","solutions":["Ensure transport.kind is exactly one of the supported literals for the node adapter: currently only 'in-memory' is implemented.","If extending the union, update the node adapter switch before using the new kind.","Validate transport.kind against the supported set before calling createPluginContext."],"exampleFix":"// before\nconst ctx = createPluginContext({ kind: 'in_memory' }) // typo: underscore\n\n// after\nconst ctx = createPluginContext({ kind: 'in-memory' })","handlingStrategy":"type-guard","validationCode":"const supported = ['in-memory'] // node adapter implemented kinds\nif (!supported.includes(transport.kind)) {\n  throw new Error(`Unsupported transport kind '${transport.kind}' for node runtime`)\n}\nconst ctx = createPluginContext(transport)","typeGuard":"function isKnownNodeTransportKind(transport: PluginTransport): boolean {\n  return ['in-memory', 'websocket', 'node-worker', 'electron', 'web-worker'].includes(transport.kind)\n}\n\nfunction 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 && /Unknown plugin transport kind/.test(error.message)) {\n    // transport.kind was undefined/typo/unrecognized; fall back to in-memory\n    ctx = createPluginContext({ kind: 'in-memory' })\n  } else {\n    throw error\n  }\n}","preventionTips":["Always set transport.kind to a literal supported by the node adapter (currently 'in-memory').","When extending the PluginTransport union, update the node adapter switch in the same change.","Validate transport.kind against the implemented set before calling createPluginContext."],"tags":["transport","node","invalid-input","default-branch"],"backgroundTag":null,"analyzedSha":"27111382b4a79a7e983289d6e983a06af185ed0f","analyzedAt":"2026-08-12T18:33:34.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}