A2uiTranslation
Turns what upstream puts on the wire into the v1.0 messages a2ui-core parses.
Upstream's toolkit and middleware emit A2UI v0.9 envelopes; a2ui-core implements v1.0 and refuses any other version outright. Between the two, for the four messages upstream emits, the wire difference is mechanical -- read off the specification's own evolution guide, and checked here against recorded traffic:
versionis"v0.9"and must read"v1.0";createSurface.themeis gone, andcreateSurface.attachDataModelbecamesendDataModel;updateDataModel.valuebecame required, withnullmeaning delete -- so an omitted value is sent asnull, which is the nearest v1.0 has to what v0.9 let an agent leave out;the flat component format,
{"path": ...}bindings andchildren: {componentId, path}templates are the same shape in both.
What is not mechanical is the catalog id. Upstream names v0_9/basic_catalog.json -- a string that is not even the v0.9 specification's id for that catalog -- and a2ui-compose registers the v1.0 one, so a surface that named the upstream id would resolve to no catalog and draw its root alone. catalogIds is where that mapping lives, and upstreamCatalogIds is the default: the three upstream spellings of "basic" become the v1.0 basic catalog and everything else passes through, because a custom catalog's id is the host's own and this module has no business renaming it.
The rewrite is JSON to JSON and happens before parsing, on purpose: a2ui-core's parser is the one place the v1.0 rules are enforced, and a translation that built its messages by hand would be a second, weaker parser.
Parameters
what a catalogId on the wire becomes. Applied to createSurface only; a v0.9 component carries no catalog of its own.
the catalog a rendered surface is bound to. A render_a2ui call names no catalog -- the host chooses -- so this is that choice.