From ae7c54419b20a412bc8f18b23f004ced2f3c3a5a Mon Sep 17 00:00:00 2001 From: Santiago Date: Mon, 8 Jun 2026 14:11:21 -0300 Subject: [PATCH] feat(codegen): render named types for protocol custom types Declare a named type per components.schemas entry in the generated client: a full struct/interface/dataclass for records and a permissive named alias for variants (pending the variant arg encoder). Driven by the new componentTypes helper in tx3c codegen. Co-Authored-By: Claude Opus 4.8 (1M context) --- .trix/client-lib/__init__.py.hbs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.trix/client-lib/__init__.py.hbs b/.trix/client-lib/__init__.py.hbs index a124423..f25934c 100644 --- a/.trix/client-lib/__init__.py.hbs +++ b/.trix/client-lib/__init__.py.hbs @@ -28,6 +28,11 @@ ENVIRONMENT_SCHEMA: dict[str, Any] = json.loads( """{{{json tii.environment}}}""" ) +{{/if}} +{{#if tii.components.schemas}} +# Named types for the protocol's custom (record / variant) types. +{{{componentTypes tii.components.schemas "python"}}} + {{/if}} {{#each tii.transactions}} {{constantCase @key}}_TIR = TirEnvelope(