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, dashboard 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.
17pub mod api;
18#[cfg(feature = "auth")]
19/// Authentication middleware and token validation.
20pub mod auth;
21/// Server-side Gleam authoring surface (compile, type-check, package, hot-load).
22pub mod authoring;
23/// SS-5b automatic multi-node failover detection (cluster supervisor). Only
24/// meaningful for a distributed haematite boot, so gated behind the backend.
25#[cfg(feature = "haematite-backend")]
26pub mod cluster;
27/// Runtime configuration loading and validation.
28pub mod config;
29/// Dashboard asset serving helpers.
30pub mod dashboard;
31/// Operator deploy surface authorization.
32pub mod deploy;
33/// Local dev-server surface: trigger a run, stream it over the existing
34/// firehose, mock a named activity per-run, and replay a failed run — all over
35/// the real engine, store, and event stream.
36pub mod dev_ui;
37/// Server error and stream-failure types.
38pub mod error;
39/// Engine-internal workflow filtering for enumeration surfaces.
40mod internal_workflow;
41/// Namespace resolution and authorization guard types.
42pub mod namespace;
43/// Health, metrics, and tracing support.
44pub mod observability;
45/// Distributed request routing: the gRPC-edge availability layer over the fence.
46pub mod routing;
47/// Server run loop: configuration load, transports, and graceful shutdown.
48pub mod run;
49/// Cooperative shutdown and drain handling.
50pub mod shutdown;
51/// Shared server state construction and access.
52pub mod state;
53/// WebSocket event-streaming support.
54pub mod stream;
55/// Remote-worker registry, heartbeat, and dispatch support.
56pub mod worker;
57
58pub use config::ServerConfig;
59pub use deploy::DeployGuard;
60pub use dev_ui::{ActivityMockRegistry, DevMockingDispatcher, MockedActivity};
61pub use error::{ServerError, StreamFailure};
62pub use namespace::{
63 CallerIdentity, NAMESPACE_ATTRIBUTE, NamespaceGuard, NamespaceOperation, NamespaceResolver,
64 ScheduleNamespaceSource, ScheduleTarget, ScopedEngine, StaticScheduleNamespaces,
65 StaticWorkflowNamespaces, SubscriptionScope, WorkflowAttribution, WorkflowNamespaceSource,
66 WorkflowTarget,
67};
68pub use run::run;
69pub use state::ServerState;
70pub use worker::{
71 HeartbeatTracker, HeartbeatUpdate, InFlightActivity, LostWorkerReport, TaskLiveness,
72};