{"record":{"id":"43e833241d71253f","repo":"moeru-ai/airi","slug":"websocket-transport-is-not-implemented-for-web-run","errorCode":null,"errorMessage":"WebSocket transport is not implemented for web runtime yet.","messagePattern":"WebSocket transport is not implemented for web runtime yet\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"info","filePath":"packages/plugin-sdk/src/plugin-host/runtimes/web/index.ts","lineNumber":28,"sourceCode":"\n/**\n * Creates the Eventa context used by web-side extension host sessions.\n *\n * Use when:\n * - Bootstrapping a web runtime extension session\n *\n * Expects:\n * - `transport` describes a transport supported by the web runtime\n *\n * Returns:\n * - A web-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 web runtime yet.')\n    case 'web-worker':\n      throw new Error('Web worker transport is not implemented yet.')\n    case 'node-worker':\n      throw new Error('Node worker transport is not available in web runtime.')\n    case 'electron':\n      throw new Error('Electron transport is not available in web runtime.')\n    default:\n      throw new Error('Unknown plugin transport kind.')\n  }\n}\n","sourceCodeStart":10,"sourceCodeEnd":39,"githubUrl":"https://github.com/moeru-ai/airi/blob/27111382b4a79a7e983289d6e983a06af185ed0f/packages/plugin-sdk/src/plugin-host/runtimes/web/index.ts#L10-L39","documentation":"Thrown by `createPluginContext()` in the web runtime when `transport.kind === 'websocket'`. The web runtime currently only implements the `in-memory` transport; WebSocket support for browser plugins is planned but not yet built. This is a deliberate unimplemented-feature guard, not a runtime failure of an existing capability.","triggerScenarios":"Constructing a web plugin context with `createPluginContext({ kind: 'websocket', ... })`. Any browser/host code that selects a WebSocket transport for plugin IPC on the web runtime hits this immediately at context creation.","commonSituations":"Porting an Electron or Node plugin host configuration to the web runtime without changing the transport kind; config defaults that assume WebSocket is universally available; exploring web plugin support before the transport is implemented.","solutions":["Use `createPluginContext({ kind: 'in-memory' })` for web-runtime plugin contexts until WebSocket support ships.","If you need cross-tab/window plugin IPC on web, layer a custom transport on top of in-memory contexts (e.g. BroadcastChannel) rather than selecting 'websocket'.","Track and await the web WebSocket transport implementation; do not attempt to work around it by patching the switch.","Confirm the runtime you are actually targeting — Node and Electron hosts may support transports that web does not."],"exampleFix":"// before\nconst ctx = createPluginContext({ kind: 'websocket', url })\n\n// after\nconst ctx = createPluginContext({ kind: 'in-memory' })","handlingStrategy":"validation","validationCode":"const supportedWebKinds = new Set(['in-memory'])\nif (!supportedWebKinds.has(transport.kind)) {\n  throw new Error(`Transport '${transport.kind}' is not supported in the web runtime.`)\n}\nconst ctx = createPluginContext(transport)","typeGuard":"function isSupportedWebTransport(t: PluginTransport): boolean {\n  return t.kind === 'in-memory'\n}","tryCatchPattern":"try {\n  ctx = createPluginContext(transport)\n} catch (e) {\n  if (e instanceof Error && /not implemented.*web runtime|not available in web runtime/i.test(e.message)) {\n    ctx = createPluginContext({ kind: 'in-memory' })\n  } else throw e\n}","preventionTips":["Default web plugin contexts to in-memory until the WebSocket transport ships.","Condition transport selection on runtime detection rather than hardcoding a kind.","Keep transport config out of shared Node/Electron presets that the web bundle may load.","Track the web WebSocket implementation status before selecting it."],"tags":["plugin-sdk","web-runtime","transport","not-implemented"],"backgroundTag":null,"analyzedSha":"27111382b4a79a7e983289d6e983a06af185ed0f","analyzedAt":"2026-08-12T18:33:34.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}