Skip to main content

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, BoundaryType, CodecReport, CodegenError,
49    CodegenMode, SchemaEmitReport, TestScaffoldReport, Tier, boundary_types_from_interface,
50    build_input_skeleton, emit_schemas, generate_activities, generate_codecs,
51    generate_test_scaffold, parse_declarations,
52};
53pub use error::PackageError;
54pub use extraction::ExtractionLimits;
55pub use hash::{ContentHash, content_hash, content_hash_with_timeout};
56pub use manifest::{
57    CURRENT_FORMAT_VERSION, DeclaredActivity, Manifest, ManifestDigest, ManifestVersion,
58    WorkflowEntry,
59};
60pub use namespace::{
61    DEPLOYED_NAME_SEPARATOR, NamespaceError, ParsedDeployedName, deployed_name, deployed_names,
62    parse_deployed_name,
63};
64pub use package::Package;
65pub use project::{
66    ExcludedModule, ExcludedReason, PackageOptions, PackagedWorkflow, PackagingError,
67    ProjectReport, package_project,
68};
69pub use structure::{
70    ArmLabel, CorrelationKey, DeterminismError, EdgeKind, FactsError, GraphEdge, GraphNode, NodeId,
71    NodePrimitive, StructuralDelta, StructureError, Violation, ViolationKind, WorkflowFacts,
72    WorkflowGraph, analyze_determinism, extract_structure, extract_workflow_facts,
73    regenerate_gleam,
74};
75pub use version::WorkflowVersion;