Class: MessageProcessor
Stateful A2UI protocol processor that turns raw v0.9 messages into renderable surfaces, resources, data-model signals, and user-action events.
Constructors
Constructor
new MessageProcessor():
MessageProcessor
Returns
MessageProcessor
Properties
surfaces
surfaces:
Map<string,Surface>
Methods
clearSurfaces()
clearSurfaces():
void
Returns
void
dispatch()
dispatch(
message:Record<string,unknown>):Promise<unknown>
Parameters
Returns
Promise<unknown>
getOrCreateSurface()
getOrCreateSurface(
surfaceId:string):Surface
Parameters
Returns
getSurfaces()
getSurfaces():
ReadonlyMap<string,Surface>
Returns
ReadonlyMap<string, Surface>
onEvent()
onEvent(
callback: (event:A2UIEvent) =>void): () =>void
Parameters
Returns
() => void
onUpdate()
onUpdate(
callback: (data:Record<string,unknown>) =>void): () =>void
Parameters
Returns
() => void
processMessages()
processMessages(
messages:ServerToClientMessage[]):void
Parameters
Returns
void
resolvePath()
resolvePath(
path:string,dataContextPath?:string):string
Resolve a JSON Pointer taking into account the current data context.
- Absolute paths (starting with '/') are returned as-is.
- Relative paths are resolved against the provided dataContextPath.
Parameters
Returns
string