Introduction
autopilot-client is a TypeScript library for connecting to LLMOR autopilot servers over WebSockets. It is the browser-side counterpart that lets a page or app participate in a conversation that the server orchestrates: streaming completions, calling client-side functions, syncing UI context, and rendering a chat surface for the user.
What you get
The package exposes three layers, each building on the one below it.
1. AutopilotClient — headless and framework-agnostic
A single class that:
- Fetches conversation metadata over HTTP and opens a Socket.IO connection to the relay.
- Lets you register functions the autopilot can call (with JSON-Schema parameters and async handlers).
- Lets you sync arbitrary context state to the server (debounced JSON Patch diffs).
- Emits typed events for status changes, streaming chunks, function calls, and conversation updates.
- Has no dependency on Vue or any UI framework — works in Node, in a vanilla page, or inside any framework.
2. Vue + Pinia store — reactive bridge
useAutopilotStore wires every relevant event from AutopilotClient into a Pinia store, so your Vue components get reactive connectionStatus, messages, streamingMessage, context, and a curated visibleMessages computed.
A companion composable useAutopilotConversation exposes filtered message lists (user, assistant, system) for building custom chat UIs.
3. AutopilotBar — drop-in chat UI
Call enableAutopilotBar(client) once and you get a floating toggle button plus an overlay chat surface, mounted inside a Shadow DOM so its Tailwind styles do not leak into your host page.
When to use which
| You want to… | Use |
|---|---|
| Build a custom chat UI in React, Svelte, plain JS, or Node | Headless AutopilotClient |
| Build a custom chat UI in Vue 3 | Headless client + Pinia store |
| Add an autopilot to an existing page without designing UI | AutopilotBar |
| Embed an autopilot inside an existing Vue 3 + Pinia app, with no custom UI | AutopilotBar inside a Vue app |
What this library is not
- It is not an LLM client. All inference happens on the LLMOR server; this package only relays.
- It is not a UI framework. The bundled
AutopilotBaris a single drop-in widget — it is not a library of design-system components. - It does not implement authentication. You obtain a conversation URL (with token) from your backend and hand it to
connect().
Next steps
- Install the package
- Quick start — three minimal snippets, one per layer
- Architecture — how the wire protocol fits together