{"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":"error","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/677329427f32468c74b17f3ec47eeca4e05bec65/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 browser host currently implements only the in-memory Eventa context; connecting a web extension session to a remote host over WebSocket is planned but unimplemented, so the request fails fast with an explicit message instead of half-working.","triggerScenarios":"Bootstrapping a web plugin host with createPluginContext({ kind: 'websocket', url: 'ws://...' }) to reach a backend host; sharing transport config with a design that assumed remote browser plugins; enabling a 'remote plugins' feature flag before the implementation exists.","commonSituations":"Prototyping browser-side extension loading from a server; copying transport settings from architecture docs into code; feature flags turned on in a build whose plugin-sdk predates websocket support.","solutions":["Use { kind: 'in-memory' } for the web runtime.","Gate remote/websocket transport behind a capability check on the installed plugin-sdk version before selecting it.","Upgrade plugin-sdk and confirm runtimes/web/index.ts implements the 'websocket' case before enabling."],"exampleFix":"// before\nconst ctx = createPluginContext({ kind: 'websocket', url: 'wss://plugins.example.com' }) // web runtime: throws\n\n// after\nconst ctx = createPluginContext({ kind: 'in-memory' })","handlingStrategy":"type-guard","validationCode":"// Web runtime: only 'in-memory' is implemented.\nif (transport.kind !== 'in-memory') {\n  throw new Error(`Web plugin host supports only 'in-memory' transport, got '${transport.kind}'`)\n}","typeGuard":"type WebSupportedTransport = Extract<PluginTransport, { kind: 'in-memory' }>\nconst isWebSupportedTransport = (t: PluginTransport): t is WebSupportedTransport => t.kind === 'in-memory'","tryCatchPattern":null,"preventionTips":["Keep remote/websocket transport behind a capability flag validated against the installed plugin-sdk.","Assert the transport kind at bootstrap; the browser host cannot fall back gracefully."],"tags":["plugin-sdk","transport","websocket","web-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"}