/** * A2UI v0.9 Result Mapper * * Converts a Photon method's return value into a valid A2UI JSONL message * sequence (createSurface → updateComponents → updateDataModel). Mirrors * the auto-mapping heuristics used by @format table/list/card so photon * authors can add `@format a2ui` without writing any UI code. * * Escape hatch: returning `{ __a2ui: true, components, data }` bypasses * heuristics and emits the components verbatim. * * @see https://a2ui.org/specification/v0.9-a2ui/ */ import { type A2UIMessage } from './types.js'; export interface MapperOptions { surfaceId?: string; theme?: { primaryColor?: string; iconUrl?: string; agentDisplayName?: string; }; } /** * Does the given array look like a pre-serialized A2UI JSONL stream that * should be forwarded verbatim instead of re-mapped? Every element must be * a well-formed A2UI message (has `version` AND one of the message wrapper * keys). Empty arrays are not streams — they're empty lists, and should go * through the mapper so the lifecycle messages are emitted. * * Extracted into the mapper module so CLI, AG-UI adapter, and future * transports share one classifier instead of drifting apart. */ export declare function looksLikeA2UIStream(arr: unknown[]): boolean; /** * Translate a method result into the A2UI JSONL sequence. * Always returns at least three messages: createSurface, updateComponents, * updateDataModel. The component list always contains exactly one `root`. */ export declare function resultToA2UIMessages(result: unknown, options?: MapperOptions): A2UIMessage[]; //# sourceMappingURL=mapper.d.ts.map