For AI agents: the complete documentation index is available at /zh/llms.txt, the full documentation bundle is available at /zh/llms-full.txt, and this page is available as Markdown at /zh/api/genui/a2ui/classes/MessageProcessor.md.
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.

    构造函数

    new MessageProcessor()

    new MessageProcessor(): MessageProcessor

    返回

    MessageProcessor

    定义于

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

    属性

    surfaces

    surfaces: Map<string, Surface>;

    定义于

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

    方法

    clearSurfaces()

    clearSurfaces(): void

    返回

    void

    定义于

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


    dispatch()

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

    参数

    范围类型
    messageRecord<string, unknown>

    返回

    Promise<unknown>

    定义于

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


    getOrCreateSurface()

    getOrCreateSurface(surfaceId: string): Surface

    参数

    范围类型
    surfaceIdstring

    返回

    Surface

    定义于

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


    getSurfaces()

    getSurfaces(): ReadonlyMap<string, Surface>

    返回

    ReadonlyMap<string, Surface>

    定义于

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


    onEvent()

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

    参数

    范围类型
    callback(event: A2UIEvent) => void

    返回

    Function

    返回

    void

    定义于

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


    onUpdate()

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

    参数

    范围类型
    callback(data: Record<string, unknown>) => void

    返回

    Function

    返回

    void

    定义于

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


    processMessages()

    processMessages(messages: any[]): void

    参数

    范围类型
    messagesany[]

    返回

    void

    定义于

    @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.

    参数

    范围类型
    pathstring
    dataContextPath?string

    返回

    string

    定义于

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

    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。