@threadplane/chatFunctionv0.3.4

createPartialArgsBridge

Subscribes to LangGraph custom events of name 'a2ui-partial' and feeds the surface store envelope-by-envelope as the parent LLM streams its tool_call.arguments JSON. Uses @cacheplane/partial-json to extract structurally-complete envelope objects from the growing args string.

Synthesis safety net: v0.9 requires a createSurface envelope before any updateComponents. If a complete updateComponents arrives for a surface with no createSurface seen yet this turn, the bridge synthesises one (basic catalog) so the surface can mount as soon as its root component is defined — the store gates rendering on createSurface + root, and fills the tree in progressively after that.

The store treats a later "real" createSurface for the same surface as an idempotent refresh, so LLMs that emit one out of order are harmless.

import { createPartialArgsBridge } from '@threadplane/chat';

Declaration · overload 1

export declare function createPartialArgsBridge(store: A2uiSurfaceStore): PartialArgsBridge;

Parameters

store · required
A2uiSurfaceStore

Returns

PartialArgsBridge