Operator Components

The operator module exposes framework-neutral controllers and a workspace orchestrator under @honua/sdk-js/operator. Hosts can render the surfaces in React, Web Components, plain DOM, or native shells while reusing the same state and transport contract.

import { OperatorWorkspace } from "@honua/sdk-js/operator";
import { HonuaClient } from "@honua/sdk-js";

const workspace = new OperatorWorkspace({
  client: operatorClient,
  mapFactory: () => ({ map }),
  mapLoadOptions: {
    client: new HonuaClient({ baseUrl: "https://api.example.test" }),
    skipCompatibilityCheck: false,
  },
});

workspace.on((event) => {
  switch (event.kind) {
    case "clarification-needed":
      renderClarificationForm(event.intent);
      break;
    case "plan-loaded":
      renderPlanReview(event.plan);
      break;
    case "map-loaded":
      showMapPreview(event.pkg);
      break;
    case "approval-required":
      renderApprovalGate(event.decision);
      break;
  }
});

The workspace composes six controller surfaces:

The public extension points are controller subscriptions, workspace events, theme tokens, and message catalogs. The module intentionally does not expose feature editing or client-side policy override affordances.