moeru-ai/airi · error · Error

Web worker transport is not implemented yet.

Error message

Web worker transport is not implemented yet.

What it means

Thrown by createPluginContext in the web runtime when transport.kind === 'web-worker'. Worker-based isolation for browser extension sessions is declared in the PluginTransport union but not yet implemented in the web runtime switch, so only in-memory works today and web-worker throws 'not implemented yet'.

Solutions

  1. Use { kind: 'in-memory' } until web-worker ships.
  2. If sandboxing is required now, spawn a Worker yourself and bridge events through an in-memory context per worker.
  3. Re-check runtimes/web/index.ts after upgrading plugin-sdk before enabling the kind.

Example fix

// before
const ctx = createPluginContext({ kind: 'web-worker' }) // web runtime: throws

// after
const ctx = createPluginContext({ kind: 'in-memory' })
Defensive patterns

Strategy: type-guard

Validate before calling

if (transport.kind === 'web-worker') {
  throw new Error('web-worker transport not yet implemented; use in-memory')
}

Type guard

type WebSupportedTransport = Extract<PluginTransport, { kind: 'in-memory' }>
const isWebSupportedTransport = (t: PluginTransport): t is WebSupportedTransport => t.kind === 'in-memory'

Prevention

When it happens

Trigger: Passing { kind: 'web-worker' } to createPluginContext to isolate an untrusted plugin in a browser Worker; selecting worker transport from a quality/feature matrix before the SDK ships it; porting a custom worker harness to the typed PluginTransport API.

Common situations: Security-driven designs wanting plugin sandboxing via Workers; early adoption from type definitions; demos configured ahead of implementation.

Related errors


AI-assisted analysis of moeru-ai/airi@677329427f (2026-08-18). Data as JSON: /api/errors/39733964dddfe999. Report an issue: GitHub.

Appendix: source

Thrown at packages/plugin-sdk/src/plugin-host/runtimes/web/index.ts:30

 * Creates the Eventa context used by web-side extension host sessions.
 *
 * Use when:
 * - Bootstrapping a web runtime extension session
 *
 * Expects:
 * - `transport` describes a transport supported by the web runtime
 *
 * Returns:
 * - A web-compatible Eventa context, or throws if the transport is not implemented
 */
export function createPluginContext(transport: PluginTransport): EventContext<any, any> {
  switch (transport.kind) {
    case 'in-memory':
      return createContext()
    case 'websocket':
      throw new Error('WebSocket transport is not implemented for web runtime yet.')
    case 'web-worker':
      throw new Error('Web worker transport is not implemented yet.')
    case 'node-worker':
      throw new Error('Node worker transport is not available in web runtime.')
    case 'electron':
      throw new Error('Electron transport is not available in web runtime.')
    default:
      throw new Error('Unknown plugin transport kind.')
  }
}

View on GitHub (pinned to 677329427f)