Skip to main content

alien_commands/
lib.rs

1//! # alien-commands
2//!
3//! Commands protocol implementation for Alien.
4//!
5//! This crate provides a transport-agnostic protocol for sending commands
6//! to customer-side agents without requiring inbound connections.
7//!
8//! ## Features
9//!
10//! - **Core types**: Always available protocol types and serialization
11//! - **server**: Command server implementation for managers
12//! - **runtime**: Command envelope processing for alien-runtime
13//! - **openapi**: OpenAPI schema generation support
14
15pub mod error;
16pub mod types;
17
18pub use error::{Error, ErrorData, Result};
19pub use types::*;
20
21#[cfg(any(feature = "server", feature = "dispatchers"))]
22pub mod dispatchers;
23
24#[cfg(feature = "server")]
25pub mod server;
26
27#[cfg(feature = "runtime")]
28pub mod runtime;
29
30#[cfg(feature = "test-utils")]
31pub mod test_utils;
32
33// Re-export commonly used types
34pub use types::{
35    BodySpec, CommandResponse, CommandState, CommandStatusResponse, CreateCommandRequest,
36    CreateCommandResponse, Envelope, LeaseInfo, LeaseRequest, LeaseResponse, ResponseHandling,
37    StorageUpload, SubmitResponseRequest, UploadCompleteRequest, UploadCompleteResponse,
38};
39
40#[cfg(feature = "server")]
41pub use server::{create_axum_router, CommandRegistry, CommandServer, InMemoryCommandRegistry};
42
43#[cfg(feature = "runtime")]
44pub use runtime::{decode_params, parse_envelope, submit_response};
45
46/// Default inline size limit in bytes (150 KB)
47/// This is the most conservative platform limit (Azure Service Bus Standard at 256KB)
48/// with headroom for base64 encoding (~4/3 inflation) and envelope metadata.
49pub const INLINE_MAX_BYTES: usize = 150_000;
50
51/// Protocol version identifier
52pub const PROTOCOL_VERSION: &str = "arc.v1";