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/// In-process AWL checking, formatting, semantics, and workspace documents.
30pub(crate) mod awl;
31/// SS-5b automatic multi-node failover detection (cluster supervisor). Only
32/// meaningful for a distributed haematite boot, so gated behind the backend.
33#[cfg(feature = "haematite-backend")]
34pub mod cluster;
35/// WS3 cluster topology/ownership broadcast publisher (not backend-gated: the
36/// ops console's cluster channel is served on every boot, showing calm state with
37/// no peers on a single-node server).
38pub mod cluster_publisher;
39/// Runtime configuration loading and validation.
40pub mod config;
41/// Operator deploy surface authorization.
42pub mod deploy;
43/// Local dev-server surface: trigger a run, stream it over the existing
44/// firehose, mock a named activity per-run, and replay a failed run — all over
45/// the real engine, store, and event stream.
46pub mod dev_ui;
47/// Server error and stream-failure types.
48pub mod error;
49/// Descriptor-relative filesystem confinement for sensitive server roots.
50pub(crate) mod filesystem;
51/// Engine-internal workflow filtering for enumeration surfaces.
52mod internal_workflow;
53/// Namespace resolution and authorization guard types.
54pub mod namespace;
55/// Health, metrics, and tracing support.
56pub mod observability;
57/// Ops-console asset serving helpers.
58pub mod ops_console;
59/// Distributed request routing: the gRPC-edge availability layer over the fence.
60pub mod routing;
61/// Server run loop: configuration load, transports, and graceful shutdown.
62pub mod run;
63/// Cooperative shutdown and drain handling.
64pub mod shutdown;
65/// Shared server state construction and access.
66pub mod state;
67/// WebSocket event-streaming support.
68pub mod stream;
69/// Umask-independent temporary directories for tests that exercise
70/// private-root validation.
71#[cfg(test)]
72pub(crate) mod test_support;
73/// Remote-worker registry, heartbeat, and dispatch support.
74pub mod worker;
75
76pub use config::ServerConfig;
77pub use deploy::DeployGuard;
78pub use dev_ui::{ActivityMockRegistry, DevMockingDispatcher, MockedActivity};
79pub use error::{ServerError, StreamFailure};
80pub use namespace::{
81 CallerIdentity, NAMESPACE_ATTRIBUTE, NamespaceGuard, NamespaceMinter, NamespaceOperation,
82 NamespaceResolver, ScheduleNamespaceSource, ScheduleTarget, ScopedEngine,
83 StaticScheduleNamespaces, StaticWorkflowNamespaces, SubscriptionScope, TASK_QUEUE_ATTRIBUTE,
84 WorkflowAttribution, WorkflowNamespaceSource, WorkflowTarget,
85};
86pub use run::run;
87pub use state::ServerState;
88pub use worker::{
89 HeartbeatSweeper, HeartbeatTracker, HeartbeatUpdate, InFlightActivity, LostWorkerReport,
90 TaskLiveness,
91};