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.
- AwlWorker
Scaffold - What to generate: one queue’s compiled contract, plus how the emitted crate reaches the document and the SDK.
- 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.
- Connection
- One connection the generated worker opens: the node it registers on and every action it serves there, in the document’s declaration order.
- Connection
Plan - The whole plan for one queue: its connections and the servable actions behind them.
- Scaffolded
File - One file of the scaffold: where it goes, what is in it, and who owns it.
- Schema
Emit Report - The result of emitting (or checking) the schema artifacts.
- Servable
Action - One action the generated worker must serve: its name, its node pin, and the wire schemas the document declares for it.
- Test
Scaffold Report - The result of generating (or checking) a workflow’s
aion/testingskeleton. - Worker
Scaffold - A rendered scaffold: the connection plan it was derived from, and the files that realise it.
Enums§
- Aion
Dependency - Where the generated crate takes the aion SDK crates from.
- AwlScaffold
Error - Why a worker scaffold could not be generated.
- 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.
- Document
Root - The directory the generated worker resolves the document’s
schema("…")imports against. - File
Ownership - Who owns a generated file once it exists.
- 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. - emit_
shell_ manifest - Renders the strict shell-worker manifest and its operating instructions for one compiled queue contract.
- 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.
- scaffold_
awl_ worker - Renders the worker scaffold for one compiled queue contract.