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 updateComponents envelope, lossless both directions. The serialize direction is emission of an authored surface;
  • the receive-side surface (DialogueSurface) — deserializes a message through an injected genesis_taxonomy registry into a genesis_tree Seed tree, mounts it, and reconciles re-emissions by key (component id → Seed key), so whole-tree re-emission becomes an identity-preserving patch;
  • the action half (parseActionEventActionEvent) — parses the client→server action message. Parse only: routing/hit-testing/consent belong to genesis_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 action message: 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 updateComponents messages.
UpdateComponents
A parsed updateComponents message: the surface id plus the flat list of component instances (the registry-facing shape, ComponentInstance, owned by genesis_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 rootId field).

Functions

parseActionEvent(Object json) ActionEvent
Parses an A2UI v0.9 action message into an ActionEvent.
parseUpdateComponents(Object json) UpdateComponents
Parses an A2UI v0.9 updateComponents envelope into UpdateComponents.

Exceptions / Errors

ActionMessageException
The client→server action message is structurally malformed.
DialogueException
Root of the genesis_dialogue error union.
DuplicateEnvelopeIdException
Two component objects in one envelope share an id.
EnvelopeException
The updateComponents envelope 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 id or component discriminator, or carries them with the wrong type.
MissingUpdateComponentsException
The envelope is missing its updateComponents body, or the body is not an object (e.g. a v0.8 surfaceUpdate-keyed message).
UnsupportedVersionException
The envelope carries a version other than the one this codec speaks.