aion_server/lib.rs
1//! Deployable HTTP, gRPC, WebSocket, and worker endpoint for Aion workflows.
2//!
3//! This crate wraps the transport-agnostic engine with API handlers, namespace
4//! isolation, observability, shutdown handling, ops-console assets, and
5//! remote-worker task dispatch.
6//!
7//! # Example
8//!
9//! ```
10//! use aion_server::ServerConfig;
11//!
12//! let config = ServerConfig::default();
13//! println!("serving gRPC on {}", config.server.grpc_address);
14//! ```
15
16/// HTTP, gRPC, and worker API handlers.
17/// Transcript retention bounds: per-event size truncation for the durable `O`
18/// keyspace (`[observability]` config).
19pub(crate) mod activity_bounds;
20/// NOI-5 transcript sequencer + live fan-out — commit-allocated `store_seq` over
21/// the durable `O` keyspace, plus the resumable transcript broadcast.
22pub mod activity_publisher;
23pub mod api;
24#[cfg(feature = "auth")]
25/// Authentication middleware and token validation.
26pub mod auth;
27/// Server-side Gleam authoring surface (compile, type-check, package, hot-load).
28pub mod authoring;
29
30/// The built-in assistant: the embedded AWL document, its boot install, and
31/// the description the server serves of it.
32pub mod assistant;
33/// In-process AWL checking, formatting, semantics, and workspace documents.
34pub(crate) mod awl;
35/// What code this server is: the revision stamped into the binary at build
36/// time, so a running server can be asked rather than guessed about (#123).
37pub mod build_identity;
38/// The release changelog embedded in the binary, serving the console's
39/// "What's new" panel: what changed in the version this server RUNS, never a
40/// file read from disk.
41pub mod changelog;
42/// SS-5b automatic multi-node failover detection (cluster supervisor). Only
43/// meaningful for a distributed (`[store.cluster]`) boot; dormant otherwise.
44pub mod cluster;
45/// WS3 cluster topology/ownership broadcast publisher. The ops console's cluster
46/// channel is served on every boot, showing calm state with no peers on a
47/// single-node server.
48pub mod cluster_publisher;
49/// Runtime configuration loading and validation.
50pub mod config;
51/// Durable record of what killed the server process on paths that never
52/// reach the graceful-shutdown log.
53pub mod death_note;
54/// Operator deploy surface authorization.
55pub mod deploy;
56/// Local dev-server surface: trigger a run, stream it over the existing
57/// firehose, mock a named activity per-run, and replay a failed run — all over
58/// the real engine, store, and event stream.
59pub mod dev_ui;
60/// Server error and stream-failure types.
61pub mod error;
62/// Descriptor-relative filesystem confinement for sensitive server roots.
63pub(crate) mod filesystem;
64/// Engine-internal workflow filtering for enumeration surfaces.
65mod internal_workflow;
66/// The Model Context Protocol surface (2026-07-28 stateless revision): the
67/// tool catalog, the tool implementations, and the `/mcp` mount.
68pub mod mcp;
69/// Namespace resolution and authorization guard types.
70pub mod namespace;
71/// Health, metrics, and tracing support.
72pub mod observability;
73/// Ops-console asset serving helpers.
74pub mod ops_console;
75/// Distributed request routing: the gRPC-edge availability layer over the fence.
76pub mod routing;
77/// Server run loop: configuration load, transports, and graceful shutdown.
78pub mod run;
79/// Cooperative shutdown and drain handling.
80pub mod shutdown;
81/// Shared server state construction and access.
82pub mod state;
83/// WebSocket event-streaming support.
84pub mod stream;
85/// Umask-independent temporary directories for tests that exercise
86/// private-root validation.
87#[cfg(test)]
88pub(crate) mod test_support;
89/// The transcript serving boundary's reconstruction of compacted provider
90/// envelopes, shared by every surface that serves a transcript.
91pub(crate) mod transcript_resolve;
92/// The built-in manual-only update check: embedded document, boot install,
93/// completed-check recording, and the served last-check state.
94pub mod update_check;
95/// Remote-worker registry, heartbeat, and dispatch support.
96pub mod worker;
97
98pub use build_identity::BuildIdentity;
99pub use config::ServerConfig;
100pub use deploy::DeployGuard;
101pub use dev_ui::{ActivityMockRegistry, DevMockingDispatcher, MockedActivity};
102pub use error::{ServerError, StreamFailure};
103pub use mcp::{AionToolService, McpRuntime};
104pub use namespace::{
105 CallerIdentity, DISPLAY_NAME_ATTRIBUTE, NAMESPACE_ATTRIBUTE, NamespaceGuard, NamespaceMinter,
106 NamespaceOperation, NamespaceResolver, ScheduleNamespaceSource, ScheduleTarget, ScopedEngine,
107 StaticScheduleNamespaces, StaticWorkflowNamespaces, SubscriptionScope, TASK_QUEUE_ATTRIBUTE,
108 WorkflowAttribution, WorkflowNamespaceSource, WorkflowTarget,
109};
110pub use run::run;
111pub use state::ServerState;
112pub use worker::{
113 HeartbeatSweeper, HeartbeatTracker, HeartbeatUpdate, InFlightActivity, LostWorkerReport,
114 TaskLiveness,
115};