Skip to main content

Crate lenso_contract_codegen

Crate lenso_contract_codegen 

Source
Expand description

Portable Capability Descriptor validation and binding generation.

The Descriptor and its package-local JSON Schemas are the only portable contract source. This crate deliberately lives above the Kernel: it reads authoring files, checks evolution rules, and emits deterministic Rust and TypeScript artifacts before an App is booted.

Structs§

Descriptor
A validated, self-contained portable Capability Descriptor.
GeneratedArtifacts
Deterministic artifacts generated from one Descriptor and Schema source.
GeneratedMetadata
Metadata embedded in every generated language artifact.

Enums§

CodegenError
Errors produced while parsing, validating, or generating a contract.
CompatibilityError
Reasons why a Descriptor evolution is not safe for an existing Capability series.

Functions§

check_generated
Fails when either checked-in artifact is not exactly reproducible.
generate
Generates both language artifacts from one Descriptor source.
generate_browser_request_client
Generates an executable browser request client from the same validated Descriptor IR used by the checked-in Rust and TypeScript bindings.
lint_compatibility
Checks whether new_path is an additive, compatible evolution of old_path. true means the same Capability series remains compatible.
load_descriptor
Reads and validates one Descriptor, resolving package-local $ref files.
round_trip_portable_json
Round-trips one JSON value through the portable wire representation.
validate_wire_value
Validates a wire value against a package-local JSON Schema.
write_generated
Writes generated artifacts to checked-in paths.