Lynx

genui / a2ui / MessageProcessor

MessageProcessor

Stateful A2UI protocol processor that turns raw v0.9 messages into renderable surfaces, resources, data-model signals, and user-action events.

Constructors

new MessageProcessor()

new MessageProcessor(): MessageProcessor

Returns

MessageProcessor

Defined in

@lynx-js/genui/a2ui/src/store/MessageProcessor.ts:48

Properties

surfaces

surfaces: Map<string, Surface>;

Defined in

@lynx-js/genui/a2ui/src/store/MessageProcessor.ts:43

Methods

clearSurfaces()

clearSurfaces(): void

Returns

void

Defined in

@lynx-js/genui/a2ui/src/store/MessageProcessor.ts:118


dispatch()

dispatch(message: Record<string, unknown>): Promise<unknown>

Parameters

ParameterType
messageRecord<string, unknown>

Returns

Promise<unknown>

Defined in

@lynx-js/genui/a2ui/src/store/MessageProcessor.ts:63


getOrCreateSurface()

getOrCreateSurface(surfaceId: string): Surface

Parameters

ParameterType
surfaceIdstring

Returns

Surface

Defined in

@lynx-js/genui/a2ui/src/store/MessageProcessor.ts:122


getSurfaces()

getSurfaces(): ReadonlyMap<string, Surface>

Returns

ReadonlyMap<string, Surface>

Defined in

@lynx-js/genui/a2ui/src/store/MessageProcessor.ts:114


onEvent()

onEvent(callback: (event: A2UIEvent) => void): () => void

Parameters

ParameterType
callback(event: A2UIEvent) => void

Returns

Function

Returns

void

Defined in

@lynx-js/genui/a2ui/src/store/MessageProcessor.ts:107


onUpdate()

onUpdate(callback: (data: Record<string, unknown>) => void): () => void

Parameters

ParameterType
callback(data: Record<string, unknown>) => void

Returns

Function

Returns

void

Defined in

@lynx-js/genui/a2ui/src/store/MessageProcessor.ts:52


processMessages()

processMessages(messages: any[]): void

Parameters

ParameterType
messagesany[]

Returns

void

Defined in

@lynx-js/genui/a2ui/src/store/MessageProcessor.ts:280


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

ParameterType
pathstring
dataContextPath?string

Returns

string

Defined in

@lynx-js/genui/a2ui/src/store/MessageProcessor.ts:145

Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.