Skip to main content

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