{
  "title": "WebChat (Gateway WebSocket UI)",
  "content": "Status: the macOS/iOS SwiftUI chat UI talks directly to the Gateway WebSocket.\n\n* A native chat UI for the gateway (no embedded browser and no local static server).\n* Uses the same sessions and routing rules as other channels.\n* Deterministic routing: replies always go back to WebChat.\n\n1. Start the gateway.\n2. Open the WebChat UI (macOS/iOS app) or the Control UI chat tab.\n3. Ensure gateway auth is configured (required by default, even on loopback).\n\n## How it works (behavior)\n\n* The UI connects to the Gateway WebSocket and uses `chat.history`, `chat.send`, and `chat.inject`.\n* `chat.inject` appends an assistant note directly to the transcript and broadcasts it to the UI (no agent run).\n* History is always fetched from the gateway (no local file watching).\n* If the gateway is unreachable, WebChat is read-only.\n\n* Remote mode tunnels the gateway WebSocket over SSH/Tailscale.\n* You do not need to run a separate WebChat server.\n\n## Configuration reference (WebChat)\n\nFull configuration: [Configuration](/gateway/configuration)\n\n* No dedicated `webchat.*` block. WebChat uses the gateway endpoint + auth settings below.\n\nRelated global options:\n\n* `gateway.port`, `gateway.bind`: WebSocket host/port.\n* `gateway.auth.mode`, `gateway.auth.token`, `gateway.auth.password`: WebSocket auth.\n* `gateway.remote.url`, `gateway.remote.token`, `gateway.remote.password`: remote gateway target.\n* `session.*`: session storage and main key defaults.",
  "code_samples": [],
  "headings": [
    {
      "level": "h2",
      "text": "What it is",
      "id": "what-it-is"
    },
    {
      "level": "h2",
      "text": "Quick start",
      "id": "quick-start"
    },
    {
      "level": "h2",
      "text": "How it works (behavior)",
      "id": "how-it-works-(behavior)"
    },
    {
      "level": "h2",
      "text": "Remote use",
      "id": "remote-use"
    },
    {
      "level": "h2",
      "text": "Configuration reference (WebChat)",
      "id": "configuration-reference-(webchat)"
    }
  ],
  "url": "llms-txt#webchat-(gateway-websocket-ui)",
  "links": []
}