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 agent 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(feature = "server")]
22pub mod server;
23
24#[cfg(feature = "runtime")]
25pub mod runtime;
26
27#[cfg(feature = "test-utils")]
28pub mod test_utils;
29
30// Re-export commonly used types
31pub use types::{
32    BodySpec, CommandResponse, CommandState, CommandStatusResponse, CreateCommandRequest,
33    CreateCommandResponse, Envelope, LeaseInfo, LeaseRequest, LeaseResponse, ResponseHandling,
34    StorageUpload, SubmitResponseRequest, UploadCompleteRequest, UploadCompleteResponse,
35};
36
37#[cfg(feature = "server")]
38pub use server::{create_axum_router, CommandRegistry, CommandServer, InMemoryCommandRegistry};
39
40#[cfg(feature = "runtime")]
41pub use runtime::{decode_params, parse_envelope, submit_response};
42
43/// Default inline size limit in bytes (150 KB)
44/// This is the most conservative platform limit (Azure Service Bus Standard at 256KB)
45/// with headroom for base64 encoding (~4/3 inflation) and envelope metadata.
46pub const INLINE_MAX_BYTES: usize = 150_000;
47
48/// Protocol version identifier
49pub const PROTOCOL_VERSION: &str = "arc.v1";