Expand description
Gleam type and JSON codec generation from project schemas.
Types-first codec generation (aion generate).
The authored source of truth is the project’s Gleam types module
src/<package>_io.gleam (ADR-014, resolved types-first on 2026-07-02).
boundary_types_from_interface maps the gleam export package-interface
JSON — the CLI drives the toolchain; this library never spawns a process —
into the boundary-type model, from which every artifact is generated:
the codecs module (generate_codecs), the emitted schemas/*.json
(emit_schemas), and the declaration-driven activity plumbing
(generate_activities, generate_test_scaffold).
CodegenMode::Check verifies the on-disk artifacts instead of writing,
for CI drift gates. Everything observable is in the returned reports or
CodegenError.
Structs§
- Activity
Artifact - One generated file: its path and fully-rendered contents.
- Activity
Declaration - A validated activity declaration: the per-activity facts the generator needs.
- Activity
Report - The result of generating (or checking) a package’s activity plumbing.
- Boundary
Type - One public type of the authored types module, with everything the emitters need: its emitted schema path, its own definition, and the definitions of every sibling type it references transitively.
- Codec
Report - The result of generating (or checking) a package’s codecs module.
- Schema
Emit Report - The result of emitting (or checking) the schema artifacts.
- Test
Scaffold Report - The result of generating (or checking) a workflow’s
aion/testingskeleton.
Enums§
- Codegen
Error - Errors produced while generating codecs, schemas, and activity plumbing from a workflow project’s authored types module.
- Codegen
Mode - What to do with generated output.
- Tier
- Where an activity’s side-effecting body executes.
Functions§
- boundary_
types_ from_ interface - Maps the
gleam export package-interfaceJSON to the boundary-type model for the package’s types modulesrc/<package_name>_io.gleam. - build_
input_ skeleton - Builds a structurally-valid input skeleton from a workflow
input_schemaJSON-Schema document. - emit_
schemas - Emits (or, in
CodegenMode::Check, verifies)schemas/<stem>.jsonfor every boundary type. - generate_
activities - Generates (or, in
CodegenMode::Check, verifies) the activity plumbing for the package atrootfrom itsdeclarationsand boundarytypes. - generate_
codecs - Generates (or, in
CodegenMode::Check, verifies) the package’s codecs modulesrc/<package>_codecs.gleamfrom its boundary types. - generate_
test_ scaffold - Generates the
aion/testingskeletontest/<entry_module>_scaffold_test.gleamfor the workflow whose typed entry lives insrc/<entry_module>.gleam. - parse_
declarations - Parses and validates the canonical activity-manifest JSON.