1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! # 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-driven [`ServerConfig`](config::ServerConfig) (gateway URL
//! / key / model / limits). The gateway key is optional at startup; without it
//! `send_message` returns a clean `error` so protocol conformance is testable
//! with zero credentials.
//! - [`protocol`] — builders for the server→client event envelopes, matched
//! field-for-field to `spec/events/*.json`.
//! - [`state`] — shared [`AppState`](state::AppState): 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-operator [`Agent`](smooth_operator_core::Agent).
//! - [`server`] — the axum app + per-connection socket loop. [`server::bind`]
//! and [`server::router`] let tests boot the service in-process.
//! - [`local`] — the **local deployment flavor** (the third target alongside
//! `deploy/k8s` and `deploy/sst`): an embeddable, fully in-memory, auth-off
//! server. [`local::serve_local`] runs it to completion;
//! [`local::LocalServer::builder`] boots it in-process with a shutdown handle.
//! - [`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). See `docs/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`.
pub use ServerConfig;
pub use ;
pub use ;
pub use ;
pub use ;
pub use AppState;