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 haematite boot, so gated behind the backend.
44#[cfg(feature = "haematite-backend")]
45pub mod cluster;
46/// WS3 cluster topology/ownership broadcast publisher (not backend-gated: the
47/// ops console's cluster channel is served on every boot, showing calm state with
48/// no peers on a single-node server).
49pub mod cluster_publisher;
50/// Runtime configuration loading and validation.
51pub mod config;
52/// Operator deploy surface authorization.
53pub mod deploy;
54/// Local dev-server surface: trigger a run, stream it over the existing
55/// firehose, mock a named activity per-run, and replay a failed run — all over
56/// the real engine, store, and event stream.
57pub mod dev_ui;
58/// Server error and stream-failure types.
59pub mod error;
60/// Descriptor-relative filesystem confinement for sensitive server roots.
61pub(crate) mod filesystem;
62/// Engine-internal workflow filtering for enumeration surfaces.
63mod internal_workflow;
64/// The Model Context Protocol surface (2026-07-28 stateless revision): the
65/// tool catalog, the tool implementations, and the `/mcp` mount.
66pub mod mcp;
67/// Namespace resolution and authorization guard types.
68pub mod namespace;
69/// Health, metrics, and tracing support.
70pub mod observability;
71/// Ops-console asset serving helpers.
72pub mod ops_console;
73/// Distributed request routing: the gRPC-edge availability layer over the fence.
74pub mod routing;
75/// Server run loop: configuration load, transports, and graceful shutdown.
76pub mod run;
77/// Cooperative shutdown and drain handling.
78pub mod shutdown;
79/// Shared server state construction and access.
80pub mod state;
81/// WebSocket event-streaming support.
82pub mod stream;
83/// Umask-independent temporary directories for tests that exercise
84/// private-root validation.
85#[cfg(test)]
86pub(crate) mod test_support;
87/// Remote-worker registry, heartbeat, and dispatch support.
88pub mod worker;
89
90pub use build_identity::BuildIdentity;
91pub use config::ServerConfig;
92pub use deploy::DeployGuard;
93pub use dev_ui::{ActivityMockRegistry, DevMockingDispatcher, MockedActivity};
94pub use error::{ServerError, StreamFailure};
95pub use mcp::{AionToolService, McpRuntime};
96pub use namespace::{
97 CallerIdentity, NAMESPACE_ATTRIBUTE, NamespaceGuard, NamespaceMinter, NamespaceOperation,
98 NamespaceResolver, ScheduleNamespaceSource, ScheduleTarget, ScopedEngine,
99 StaticScheduleNamespaces, StaticWorkflowNamespaces, SubscriptionScope, TASK_QUEUE_ATTRIBUTE,
100 WorkflowAttribution, WorkflowNamespaceSource, WorkflowTarget,
101};
102pub use run::run;
103pub use state::ServerState;
104pub use worker::{
105 HeartbeatSweeper, HeartbeatTracker, HeartbeatUpdate, InFlightActivity, LostWorkerReport,
106 TaskLiveness,
107};