smooth-operator-server
The reference WebSocket service for smooth-operator. It speaks the
schema-driven protocol in smooth-operator/spec/ over a smooth-operator-backed
knowledge-chat runtime, so the generated TypeScript / Go / .NET / Python
clients can connect and drive real LLM turns unmodified.
Pieces
- [
config] — env-drivenServerConfig(gateway URL / key / model / limits). The gateway key is optional at startup; without itsend_messagereturns a cleanerrorso protocol conformance is testable with zero credentials. - [
protocol] — builders for the server→client event envelopes, matched field-for-field tospec/events/*.json. - [
state] — sharedAppState: storage adapter + session registry. - [
handler] — action dispatch (ping,create_conversation_session,get_session,send_message). - [
runner] — the streaming, memory-carrying turn runner over a smooth-operatorAgent. - [
server] — the axum app + per-connection socket loop. [server::bind] and [server::router] let tests boot the service in-process. - [
admin] — the auth-gated admin HTTP API (Phase 12) mounted under/admin: whoami, chat history, indexing status, document sets. Consumed by the Next.js management console (increment 2). Seedocs/ADMIN-API.md.
Env contract (reused by every language's E2E harness)
See [config] for the full table. The load-bearing ones:
SMOOTH_AGENT_PORT, SMOOAI_GATEWAY_URL, SMOOAI_GATEWAY_KEY,
SMOOTH_AGENT_MODEL, SMOOTH_AGENT_SEED_KB.