aion_package/lib.rs
1//! Archive validation, content hashing, and namespacing for Aion packages.
2//!
3//! This crate loads `.aion` archives, validates manifests and BEAM entries,
4//! computes stable content hashes, and derives deployed module names for engine
5//! registration.
6//!
7//! # Example
8//!
9//! ```no_run
10//! use aion_package::{ExtractionLimits, Package};
11//!
12//! // Operator-local file: extraction may run unbounded. Network input must
13//! // use `ExtractionLimits::bounded` instead.
14//! let package = Package::load_from_path("workflow.aion", ExtractionLimits::unbounded())?;
15//! println!("entry module: {}", package.manifest().entry_module);
16//! # Ok::<(), Box<dyn std::error::Error>>(())
17//! ```
18
19/// Compiled BEAM module records extracted from packages.
20pub mod beam;
21/// Archive builder utilities for tests and packaging tools.
22pub mod builder;
23/// Gleam type and JSON codec generation from project schemas.
24pub mod codegen;
25/// Package validation and archive-loading errors.
26pub mod error;
27/// Explicit inflate budgets for archive extraction.
28pub mod extraction;
29/// Stable content-hash calculation for package contents.
30pub mod hash;
31/// Manifest structures and format-version constants.
32pub mod manifest;
33/// Deployment namespace helpers for compiled module names.
34pub mod namespace;
35/// Validated in-memory package loading and accessors.
36pub mod package;
37/// Project-level packaging driven by `workflow.toml` descriptors.
38pub mod project;
39/// Workflow version identifiers derived from package content.
40pub mod version;
41
42pub use beam::{BeamModule, BeamSet, RESERVED_MODULE_NAMES};
43pub use builder::PackageBuilder;
44pub use codegen::{CodegenError, CodegenMode, CodegenReport, codegen_project};
45pub use error::PackageError;
46pub use extraction::ExtractionLimits;
47pub use hash::{ContentHash, content_hash};
48pub use manifest::{
49 CURRENT_FORMAT_VERSION, DeclaredActivity, Manifest, ManifestDigest, ManifestVersion,
50};
51pub use namespace::{
52 DEPLOYED_NAME_SEPARATOR, NamespaceError, ParsedDeployedName, deployed_name, deployed_names,
53 parse_deployed_name,
54};
55pub use package::Package;
56pub use project::{
57 ExcludedModule, ExcludedReason, PackageOptions, PackagedWorkflow, PackagingError,
58 ProjectReport, package_project,
59};
60pub use version::WorkflowVersion;