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 primitive-structure projection: the graph model and bounded
40/// Gleam regeneration (a projection of the typed source, never authoritative).
41pub mod structure;
42/// Workflow version identifiers derived from package content.
43pub mod version;
44
45pub use beam::{BeamModule, BeamSet, RESERVED_MODULE_NAMES};
46pub use builder::PackageBuilder;
47pub use codegen::{
48 ActivityArtifact, ActivityDeclaration, ActivityReport, CodecReport, CodegenError, CodegenMode,
49 CodegenReport, TestScaffoldReport, Tier, build_input_skeleton, codegen_project,
50 generate_activities, generate_codecs, generate_test_scaffold, parse_declarations,
51};
52pub use error::PackageError;
53pub use extraction::ExtractionLimits;
54pub use hash::{ContentHash, content_hash};
55pub use manifest::{
56 CURRENT_FORMAT_VERSION, DeclaredActivity, Manifest, ManifestDigest, ManifestVersion,
57};
58pub use namespace::{
59 DEPLOYED_NAME_SEPARATOR, NamespaceError, ParsedDeployedName, deployed_name, deployed_names,
60 parse_deployed_name,
61};
62pub use package::Package;
63pub use project::{
64 ExcludedModule, ExcludedReason, PackageOptions, PackagedWorkflow, PackagingError,
65 ProjectReport, package_project,
66};
67pub use structure::{
68 ArmLabel, CorrelationKey, DeterminismError, EdgeKind, FactsError, GraphEdge, GraphNode, NodeId,
69 NodePrimitive, StructuralDelta, StructureError, Violation, ViolationKind, WorkflowFacts,
70 WorkflowGraph, analyze_determinism, extract_structure, extract_workflow_facts,
71 regenerate_gleam,
72};
73pub use version::WorkflowVersion;