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