genesis_dialogue library
The A2UI v0.9 wire format: the bidirectional grammar of the agent↔surface exchange.
Three pieces:
- the codec (parseUpdateComponents / UpdateComponents.toJson) — the
pure A2UI v0.9
updateComponentsenvelope, lossless both directions. The serialize direction is emission of an authored surface; - the receive-side surface (DialogueSurface) — deserializes a message
through an injected
genesis_taxonomyregistry into agenesis_treeSeedtree, mounts it, and reconciles re-emissions by key (component id →Seedkey), so whole-tree re-emission becomes an identity-preserving patch; - the action half (parseActionEvent → ActionEvent) — parses the
client→server
actionmessage. Parse only: routing/hit-testing/consent belong togenesis_consent.
dialogue is registry-agnostic (the registry is injected) and does not
re-implement deserialization (buildSeedTree lives in genesis_taxonomy).
Reverse-emission — walking a live mounted tree back into components — is
out of scope; it needs a taxonomy reverse-describer that does not exist as
built (see README).
Classes
- ActionEvent
-
A parsed A2UI v0.9
actionmessage: a user action fired by the client against a component, addressed back to the agent. - DialogueSurface
-
A live, mountable surface driven by A2UI v0.9
updateComponentsmessages. - UpdateComponents
-
A parsed
updateComponentsmessage: the surface id plus the flat list of component instances (the registry-facing shape,ComponentInstance, owned bygenesis_taxonomy).
Constants
- a2uiVersion → const String
- The A2UI v0.9 wire version this codec speaks.
- rootComponentId → const String
-
The id of the root component, by A2UI v0.9 convention (no
rootIdfield).
Functions
-
parseActionEvent(
Object json) → ActionEvent -
Parses an A2UI v0.9
actionmessage into an ActionEvent. -
parseUpdateComponents(
Object json) → UpdateComponents -
Parses an A2UI v0.9
updateComponentsenvelope into UpdateComponents.
Exceptions / Errors
- ActionMessageException
-
The client→server
actionmessage is structurally malformed. - DialogueException
- Root of the genesis_dialogue error union.
- DuplicateEnvelopeIdException
-
Two component objects in one envelope share an
id. - EnvelopeException
-
The
updateComponentsenvelope is structurally malformed. - EnvelopeFieldException
- A required field of the envelope body has the wrong shape.
- MalformedComponentException
-
A component object in the flat list is missing its
idorcomponentdiscriminator, or carries them with the wrong type. - MissingUpdateComponentsException
-
The envelope is missing its
updateComponentsbody, or the body is not an object (e.g. a v0.8surfaceUpdate-keyed message). - UnsupportedVersionException
-
The envelope carries a
versionother than the one this codec speaks.