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/// 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/// Engine-internal workflow filtering for enumeration surfaces.
50mod internal_workflow;
51/// Namespace resolution and authorization guard types.
52pub mod namespace;
53/// Health, metrics, and tracing support.
54pub mod observability;
55/// Ops-console asset serving helpers.
56pub mod ops_console;
57/// Distributed request routing: the gRPC-edge availability layer over the fence.
58pub mod routing;
59/// Server run loop: configuration load, transports, and graceful shutdown.
60pub mod run;
61/// Cooperative shutdown and drain handling.
62pub mod shutdown;
63/// Shared server state construction and access.
64pub mod state;
65/// WebSocket event-streaming support.
66pub mod stream;
67/// Remote-worker registry, heartbeat, and dispatch support.
68pub mod worker;
69
70pub use config::ServerConfig;
71pub use deploy::DeployGuard;
72pub use dev_ui::{ActivityMockRegistry, DevMockingDispatcher, MockedActivity};
73pub use error::{ServerError, StreamFailure};
74pub use namespace::{
75    CallerIdentity, NAMESPACE_ATTRIBUTE, NamespaceGuard, NamespaceMinter, NamespaceOperation,
76    NamespaceResolver, ScheduleNamespaceSource, ScheduleTarget, ScopedEngine,
77    StaticScheduleNamespaces, StaticWorkflowNamespaces, SubscriptionScope, TASK_QUEUE_ATTRIBUTE,
78    WorkflowAttribution, WorkflowNamespaceSource, WorkflowTarget,
79};
80pub use run::run;
81pub use state::ServerState;
82pub use worker::{
83    HeartbeatSweeper, HeartbeatTracker, HeartbeatUpdate, InFlightActivity, LostWorkerReport,
84    TaskLiveness,
85};