@threadplane/chatInterfacev0.3.4

A2uiSurfaceStore

Applies A2UI envelopes and exposes reactive wire surfaces and component readiness projections.

import type { A2uiSurfaceStore } from '@threadplane/chat';

Declaration

export interface A2uiSurfaceStore  {
  apply(message: A2uiMessage): void;
  applyPartialArgs(toolCallId: string, envelopes: readonly A2uiMessage[]): void;
  isPartialLive(toolCallId: string): boolean;
  surface(surfaceId: string): Signal<A2uiSurface | undefined>;
  readonly surfaces: Signal<Map<string, A2uiSurface>>;
  surfaceState(surfaceId: string): Signal<A2uiSurfaceState | undefined>;
  readonly surfaceStates: Signal<Map<string, A2uiSurfaceState>>;
}

Members

apply · overload 1

apply(message: A2uiMessage): void;

Parameters

message · required
A2uiMessage

Returns

void

applyPartialArgs · overload 1

Live-stream entry point. Iterates envelopes and feeds each through apply(). Records the tool_call_id so the wrapped-content classifier can short-circuit duplicate dispatch when the final AIMessage arrives.

applyPartialArgs(toolCallId: string, envelopes: readonly A2uiMessage[]): void;

Parameters

toolCallId · required
string
envelopes · required
readonly A2uiMessage[]

Returns

void

isPartialLive · overload 1

True if a tool_call_id has produced live envelopes via applyPartialArgs.

isPartialLive(toolCallId: string): boolean;

Parameters

toolCallId · required
string

Returns

boolean

surface · overload 1

surface(surfaceId: string): Signal<A2uiSurface | undefined>;

Parameters

surfaceId · required
string

Returns

Signal<A2uiSurface | undefined>

surfaces

Wire-format surfaces, for downstream consumers (e.g. surfaceToSpec).

readonly surfaces: Signal<Map<string, A2uiSurface>>;

surfaceState · overload 1

surfaceState(surfaceId: string): Signal<A2uiSurfaceState | undefined>;

Parameters

surfaceId · required
string

Returns

Signal<A2uiSurfaceState | undefined>

surfaceStates

Chat-side projections with per-component readiness.

readonly surfaceStates: Signal<Map<string, A2uiSurfaceState>>;