Skip to content

Commit 4206b72

Browse files
bloveclaude
andcommitted
refactor(chat)!: prune internal-only exports + document public factories (audit F5)
Surface hygiene — tighten the public API to what's intentional: - Remove from @threadplane/chat public surface (0 external consumers, internal relative-imported): CHAT_MARKDOWN_STYLES, ICON_* (7 inline-SVG consts), surfaceToSpec, createClientToolsCoordinator. (toClientToolSpecs kept.) - Document genuinely-public factories that lacked summaries: a2uiBasicCatalog, createA2uiSurfaceStore, createContentClassifier, createParseTreeStore (chat), and the advanced citation APIs bridgeCitationsState (ag-ui) + extractCitations (langgraph) — kept per their "advanced consumers" intent. chat api-docs 227→217 entries. chat/ag-ui/langgraph/render build, chat type-tests, examples/chat, and website all green. Pre-1.0 breaking-OK removal. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent ed760f7 commit 4206b72

11 files changed

Lines changed: 117 additions & 119 deletions

File tree

apps/website/content/docs/ag-ui/api/api-docs.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,27 +537,29 @@
537537
{
538538
"name": "bridgeCitationsState",
539539
"kind": "function",
540-
"description": "",
540+
"description": "Attach per-message Citations carried in an AG-UI thread's `state`\n(`state.citations`, keyed by message id) onto the corresponding assistant\nMessages — for advanced consumers wiring citations from STATE events\ninto the neutral chat contract.",
541541
"signature": "bridgeCitationsState(thread: ThreadStateLike, messages: Message[]): Message[]",
542542
"params": [
543543
{
544544
"name": "thread",
545545
"type": "ThreadStateLike",
546-
"description": "",
546+
"description": "The thread-state container holding `state.citations`.",
547547
"optional": false
548548
},
549549
{
550550
"name": "messages",
551551
"type": "Message[]",
552-
"description": "",
552+
"description": "The messages to enrich.",
553553
"optional": false
554554
}
555555
],
556556
"returns": {
557557
"type": "Message[]",
558558
"description": ""
559559
},
560-
"examples": []
560+
"examples": [
561+
"```ts\nconst enriched = bridgeCitationsState(threadState, agent.messages());\n```"
562+
]
561563
},
562564
{
563565
"name": "injectAgent",

apps/website/content/docs/chat/api/api-docs.json

Lines changed: 17 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -7390,62 +7390,6 @@
73907390
"signature": "InjectionToken<ChatLifecycle>",
73917391
"examples": []
73927392
},
7393-
{
7394-
"name": "CHAT_MARKDOWN_STYLES",
7395-
"kind": "const",
7396-
"description": "",
7397-
"signature": "\"\\n chat-streaming-md { display: block; color: var(--ngaf-chat-text); line-height: var(--ngaf-chat-line-height); }\\n\\n /* Headings */\\n chat-streaming-md h1, chat-streaming-md h2, chat-streaming-md h3, chat-streaming-md h4, chat-streaming-md h5, chat-streaming-md h6 {\\n font-weight: 600;\\n line-height: 1.25;\\n margin: 1.25rem 0 0.75rem;\\n }\\n chat-streaming-md h1:first-child, chat-streaming-md h2:first-child, chat-streaming-md h3:first-child,\\n chat-streaming-md h4:first-child, chat-streaming-md h5:first-child, chat-streaming-md h6:first-child { margin-top: 0; }\\n chat-streaming-md h1 { font-size: 1.5em; font-weight: 700; }\\n chat-streaming-md h2 { font-size: 1.25em; }\\n chat-streaming-md h3 { font-size: 1.1em; }\\n chat-streaming-md h4 { font-size: 1em; }\\n chat-streaming-md h5, chat-streaming-md h6 { font-size: 0.95em; color: var(--ngaf-chat-text-muted); }\\n\\n /* Paragraphs and inline emphasis */\\n chat-streaming-md p { margin: 0 0 0.75rem; line-height: 1.6; font-size: var(--ngaf-chat-font-size); }\\n chat-streaming-md p:last-child { margin-bottom: 0; }\\n chat-streaming-md strong, chat-streaming-md b { font-weight: 700; }\\n chat-streaming-md em, chat-streaming-md i { font-style: italic; }\\n chat-streaming-md del, chat-streaming-md s { text-decoration: line-through; color: var(--ngaf-chat-text-muted); }\\n chat-streaming-md mark { background: var(--ngaf-chat-surface-alt); padding: 0 2px; border-radius: 2px; }\\n chat-streaming-md sub { font-size: 0.75em; vertical-align: sub; }\\n chat-streaming-md sup { font-size: 0.75em; vertical-align: super; }\\n\\n /* Links */\\n chat-streaming-md a { color: var(--ngaf-chat-primary); text-decoration: underline; text-underline-offset: 2px; }\\n chat-streaming-md a:hover { text-decoration-thickness: 2px; }\\n\\n /* Lists (CommonMark + GFM task lists) */\\n chat-streaming-md ul, chat-streaming-md ol { margin: 0 0 0.75rem; padding-left: 1.5rem; }\\n chat-streaming-md ul { list-style: disc outside; }\\n chat-streaming-md ol { list-style: decimal outside; }\\n chat-streaming-md ul ul { list-style: circle outside; }\\n chat-streaming-md ul ul ul { list-style: square outside; }\\n chat-streaming-md li { margin: 0.2rem 0; }\\n chat-streaming-md li::marker { color: var(--ngaf-chat-text-muted); }\\n chat-streaming-md li > p { margin: 0 0 0.25rem; }\\n chat-streaming-md li > ul, chat-streaming-md li > ol { margin: 0.25rem 0 0; }\\n /* GFM task lists: marked emits <li><input type=\\\"checkbox\\\" disabled> ... */\\n chat-streaming-md li:has(> input[type=\\\"checkbox\\\"]) { list-style: none; margin-left: -1.25rem; }\\n chat-streaming-md li > input[type=\\\"checkbox\\\"] { margin-right: 0.5rem; vertical-align: middle; }\\n\\n /* Code (inline + fenced) */\\n chat-streaming-md code {\\n background: var(--ngaf-chat-surface-alt);\\n color: var(--ngaf-chat-text);\\n padding: 1px 5px;\\n border-radius: 4px;\\n font-family: var(--ngaf-chat-font-mono);\\n font-size: 0.9em;\\n }\\n chat-streaming-md pre {\\n background: var(--ngaf-chat-surface-alt);\\n color: var(--ngaf-chat-text);\\n padding: 12px 14px;\\n border-radius: var(--ngaf-chat-radius-card);\\n overflow-x: auto;\\n font-family: var(--ngaf-chat-font-mono);\\n font-size: var(--ngaf-chat-font-size-sm);\\n line-height: 1.5;\\n margin: 0 0 0.75rem;\\n }\\n chat-streaming-md pre code { background: transparent; padding: 0; border-radius: 0; font-size: inherit; }\\n\\n /* Blockquote */\\n chat-streaming-md blockquote {\\n border-left: 3px solid var(--ngaf-chat-separator);\\n padding: 0.25rem 0 0.25rem 12px;\\n margin: 0 0 0.75rem;\\n color: var(--ngaf-chat-text-muted);\\n }\\n chat-streaming-md blockquote > :last-child { margin-bottom: 0; }\\n\\n /* Horizontal rule */\\n chat-streaming-md hr {\\n border: none;\\n border-top: 1px solid var(--ngaf-chat-separator);\\n margin: 1rem 0;\\n }\\n\\n /* Tables (GFM) */\\n chat-streaming-md table {\\n border-collapse: collapse;\\n margin: 0 0 0.75rem;\\n width: 100%;\\n font-size: 0.95em;\\n }\\n chat-streaming-md thead { background: var(--ngaf-chat-surface-alt); }\\n chat-streaming-md th, chat-streaming-md td {\\n border: 1px solid var(--ngaf-chat-separator);\\n padding: 6px 10px;\\n text-align: left;\\n vertical-align: top;\\n }\\n chat-streaming-md th { font-weight: 600; }\\n /* Component-rendered table: chat-md-table becomes a horizontally-scrollable\\n wrapper for the inner <table>; row/cell elements stay layout-transparent\\n so the browser's table layout takes over. Without this overflow wrapper,\\n wide tables push their parent container past the viewport horizontally. */\\n chat-streaming-md chat-md-table {\\n display: block;\\n overflow-x: auto;\\n max-width: 100%;\\n margin: 0 0 0.75rem;\\n }\\n chat-streaming-md chat-md-table-row { display: contents; }\\n chat-streaming-md chat-md-table-cell { display: contents; }\\n chat-streaming-md chat-md-table > table { margin: 0; }\\n /* Task-list items: checkbox + first paragraph render inline; subsequent\\n blocks (sub-lists, multi-paragraph items) flow normally below. */\\n chat-streaming-md li.chat-md-list-item--task {\\n list-style: none;\\n margin-left: -1.25rem;\\n display: flex;\\n flex-wrap: wrap;\\n align-items: baseline;\\n gap: 0.5rem;\\n }\\n chat-streaming-md li.chat-md-list-item--task > input[type=\\\"checkbox\\\"] {\\n margin: 0;\\n flex: 0 0 auto;\\n transform: translateY(2px);\\n }\\n /* The chat-md-children wrapper around list-item content takes remaining width */\\n chat-streaming-md li.chat-md-list-item--task > chat-md-children {\\n flex: 1 1 auto;\\n min-width: 0;\\n }\\n /* Tight task items: only the FIRST paragraph aligns inline with the\\n checkbox (margin collapsed). Subsequent paragraphs/blocks keep their\\n normal vertical spacing so multi-block items render readably. */\\n chat-streaming-md li.chat-md-list-item--task > chat-md-children > chat-md-paragraph:first-child > p {\\n margin: 0;\\n }\\n\\n /* Media */\\n chat-streaming-md img { max-width: 100%; height: auto; border-radius: 6px; }\\n /* Broken-image fallback: muted pill showing alt text + icon. Triggered\\n when <img> fires (error). Caught by live browser smoke — prior impl\\n showed only the browser's broken-image icon with no readable alt. */\\n chat-streaming-md .chat-md-image--broken {\\n display: inline-flex;\\n align-items: center;\\n gap: 0.4rem;\\n padding: 0.25rem 0.5rem;\\n background: var(--ngaf-chat-surface-alt);\\n border: 1px dashed var(--ngaf-chat-separator);\\n border-radius: 6px;\\n font-size: 0.9em;\\n color: var(--ngaf-chat-text-muted, currentColor);\\n opacity: 0.85;\\n }\\n chat-streaming-md .chat-md-image__icon { font-size: 1em; line-height: 1; }\\n chat-streaming-md .chat-md-image__alt { font-style: italic; }\\n\"",
7398-
"examples": []
7399-
},
7400-
{
7401-
"name": "ICON_AGENT",
7402-
"kind": "const",
7403-
"description": "Robot/agent icon (replacement). 14x14.",
7404-
"signature": "\"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"14\\\" height=\\\"14\\\" viewBox=\\\"0 0 24 24\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-width=\\\"2\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"><rect x=\\\"3\\\" y=\\\"11\\\" width=\\\"18\\\" height=\\\"10\\\" rx=\\\"2\\\"/><circle cx=\\\"12\\\" cy=\\\"5\\\" r=\\\"2\\\"/><path d=\\\"M12 7v4\\\"/><line x1=\\\"8\\\" y1=\\\"16\\\" x2=\\\"8\\\" y2=\\\"16\\\"/><line x1=\\\"16\\\" y1=\\\"16\\\" x2=\\\"16\\\" y2=\\\"16\\\"/></svg>\"",
7405-
"examples": []
7406-
},
7407-
{
7408-
"name": "ICON_CHECK",
7409-
"kind": "const",
7410-
"description": "Check mark replacement. 12x12.",
7411-
"signature": "\"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"12\\\" height=\\\"12\\\" viewBox=\\\"0 0 12 12\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-width=\\\"2\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"><path d=\\\"M2.5 6L5 8.5L9.5 3.5\\\"/></svg>\"",
7412-
"examples": []
7413-
},
7414-
{
7415-
"name": "ICON_CHEVRON_DOWN",
7416-
"kind": "const",
7417-
"description": "Chevron down (▼ replacement). 12x12, stroke-based.",
7418-
"signature": "\"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"12\\\" height=\\\"12\\\" viewBox=\\\"0 0 12 12\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-width=\\\"2\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"><path d=\\\"M3 4.5L6 7.5L9 4.5\\\"/></svg>\"",
7419-
"examples": []
7420-
},
7421-
{
7422-
"name": "ICON_CHEVRON_UP",
7423-
"kind": "const",
7424-
"description": "Chevron up (▲ replacement). 12x12, stroke-based.",
7425-
"signature": "\"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"12\\\" height=\\\"12\\\" viewBox=\\\"0 0 12 12\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-width=\\\"2\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"><path d=\\\"M3 7.5L6 4.5L9 7.5\\\"/></svg>\"",
7426-
"examples": []
7427-
},
7428-
{
7429-
"name": "ICON_SEND",
7430-
"kind": "const",
7431-
"description": "Send arrow (for chat input). 16x16.",
7432-
"signature": "\"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"16\\\" height=\\\"16\\\" viewBox=\\\"0 0 16 16\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-width=\\\"2\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"><path d=\\\"M8 12V4M8 4L4 8M8 4L12 8\\\"/></svg>\"",
7433-
"examples": []
7434-
},
7435-
{
7436-
"name": "ICON_TOOL",
7437-
"kind": "const",
7438-
"description": "Gear icon (⚙ replacement). 14x14.",
7439-
"signature": "\"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"14\\\" height=\\\"14\\\" viewBox=\\\"0 0 24 24\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-width=\\\"2\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"><circle cx=\\\"12\\\" cy=\\\"12\\\" r=\\\"3\\\"/><path d=\\\"M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42\\\"/></svg>\"",
7440-
"examples": []
7441-
},
7442-
{
7443-
"name": "ICON_WARNING",
7444-
"kind": "const",
7445-
"description": "Warning triangle (⚠ replacement). 18x18.",
7446-
"signature": "\"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"18\\\" height=\\\"18\\\" viewBox=\\\"0 0 24 24\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-width=\\\"2\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"><path d=\\\"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z\\\"/><line x1=\\\"12\\\" y1=\\\"9\\\" x2=\\\"12\\\" y2=\\\"13\\\"/><line x1=\\\"12\\\" y1=\\\"17\\\" x2=\\\"12.01\\\" y2=\\\"17\\\"/></svg>\"",
7447-
"examples": []
7448-
},
74497393
{
74507394
"name": "IS_HEADER_ROW",
74517395
"kind": "const",
@@ -7463,14 +7407,16 @@
74637407
{
74647408
"name": "a2uiBasicCatalog",
74657409
"kind": "function",
7466-
"description": "",
7410+
"description": "Build the built-in A2UI component catalog — a ViewRegistry mapping\nthe standard A2UI element types (Card, Button, TextField, Image, AudioPlayer,\nVideo, …) to their Angular renderers. Spread it into `provideViews` (with any\nof your own views) so an agent's A2UI surface specs render.",
74677411
"signature": "a2uiBasicCatalog(): ViewRegistry",
74687412
"params": [],
74697413
"returns": {
74707414
"type": "ViewRegistry",
74717415
"description": ""
74727416
},
7473-
"examples": []
7417+
"examples": [
7418+
"```ts\nproviders: [provideViews({ ...a2uiBasicCatalog(), MyWidget: MyWidgetComponent })]\n```"
7419+
]
74747420
},
74757421
{
74767422
"name": "action",
@@ -7566,14 +7512,16 @@
75667512
{
75677513
"name": "createA2uiSurfaceStore",
75687514
"kind": "function",
7569-
"description": "",
7515+
"description": "Create an A2uiSurfaceStore — the per-conversation store that buffers\nstreamed A2UI surface updates, tracks each surface's data model + lifecycle\nstate, and exposes them as signals for rendering. One store backs a chat\nthread's A2UI surfaces.",
75707516
"signature": "createA2uiSurfaceStore(): A2uiSurfaceStore",
75717517
"params": [],
75727518
"returns": {
75737519
"type": "A2uiSurfaceStore",
75747520
"description": ""
75757521
},
7576-
"examples": []
7522+
"examples": [
7523+
"```ts\nconst store = createA2uiSurfaceStore();\nconst surfaces = store.surfaces; // Signal<Map<string, A2uiSurface>>\n```"
7524+
]
75777525
},
75787526
{
75797527
"name": "createAgentRef",
@@ -7596,55 +7544,40 @@
75967544
"```ts\ninterface TripState { day: number; places: string[]; }\nexport const TRIP = createAgentRef<TripState>('trip');\n// app.config.ts: provideAgent(TRIP, { assistantId: 'trip' })\n// component: const agent = injectAgent(TRIP); // LangGraphAgent<TripState>\n```"
75977545
]
75987546
},
7599-
{
7600-
"name": "createClientToolsCoordinator",
7601-
"kind": "function",
7602-
"description": "",
7603-
"signature": "createClientToolsCoordinator(registry: ClientToolRegistry): ClientToolsCoordinator",
7604-
"params": [
7605-
{
7606-
"name": "registry",
7607-
"type": "ClientToolRegistry",
7608-
"description": "",
7609-
"optional": false
7610-
}
7611-
],
7612-
"returns": {
7613-
"type": "ClientToolsCoordinator",
7614-
"description": ""
7615-
},
7616-
"examples": []
7617-
},
76187547
{
76197548
"name": "createContentClassifier",
76207549
"kind": "function",
7621-
"description": "",
7550+
"description": "Create a ContentClassifier — the streaming accumulator that inspects\nan assistant message's content as it arrives and classifies it (markdown vs a\ngenerative-UI/A2UI spec), exposing the parsed result and per-element state as\nsignals so the renderer can switch modes mid-stream.",
76227551
"signature": "createContentClassifier(): ContentClassifier",
76237552
"params": [],
76247553
"returns": {
76257554
"type": "ContentClassifier",
76267555
"description": ""
76277556
},
7628-
"examples": []
7557+
"examples": [
7558+
"```ts\nconst cc = createContentClassifier();\neffect(() => console.log(cc.type())); // 'pending' | 'markdown' | 'spec'\n```"
7559+
]
76297560
},
76307561
{
76317562
"name": "createParseTreeStore",
76327563
"kind": "function",
7633-
"description": "",
7564+
"description": "Create a ParseTreeStore — feeds streamed JSON chunks through a\npartial-JSON parser and exposes the progressively-materialized spec and\nper-element accumulation state as signals, so a generative-UI surface can\nrender while the spec is still arriving.",
76347565
"signature": "createParseTreeStore(parser: PartialJsonParser): ParseTreeStore",
76357566
"params": [
76367567
{
76377568
"name": "parser",
76387569
"type": "PartialJsonParser",
7639-
"description": "",
7570+
"description": "The partial-JSON parser used to incrementally materialize chunks.",
76407571
"optional": false
76417572
}
76427573
],
76437574
"returns": {
76447575
"type": "ParseTreeStore",
76457576
"description": ""
76467577
},
7647-
"examples": []
7578+
"examples": [
7579+
"```ts\nconst store = createParseTreeStore(parser);\nstore.push('{\"type\":\"Car');\nstore.spec(); // best-effort Spec | null\n```"
7580+
]
76487581
},
76497582
{
76507583
"name": "createPartialArgsBridge",
@@ -8168,25 +8101,6 @@
81688101
},
81698102
"examples": []
81708103
},
8171-
{
8172-
"name": "surfaceToSpec",
8173-
"kind": "function",
8174-
"description": "",
8175-
"signature": "surfaceToSpec(surface: A2uiSurface): Spec | null",
8176-
"params": [
8177-
{
8178-
"name": "surface",
8179-
"type": "A2uiSurface",
8180-
"description": "",
8181-
"optional": false
8182-
}
8183-
],
8184-
"returns": {
8185-
"type": "Spec | null",
8186-
"description": ""
8187-
},
8188-
"examples": []
8189-
},
81908104
{
81918105
"name": "toAgentError",
81928106
"kind": "function",

apps/website/content/docs/langgraph/api/api-docs.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2425,21 +2425,23 @@
24252425
{
24262426
"name": "extractCitations",
24272427
"kind": "function",
2428-
"description": "",
2428+
"description": "Normalize Citations out of a message's `additional_kwargs` (reading\n`citations` or `sources`). Exposed for advanced consumers building custom\nadapters or bridging non-LangGraph message shapes into the neutral\n`Citation[]` form.",
24292429
"signature": "extractCitations(msg: KwargsLike): Citation[] | undefined",
24302430
"params": [
24312431
{
24322432
"name": "msg",
24332433
"type": "KwargsLike",
2434-
"description": "",
2434+
"description": "Any object with an `additional_kwargs` bag (e.g. a LangChain message).",
24352435
"optional": false
24362436
}
24372437
],
24382438
"returns": {
24392439
"type": "Citation[] | undefined",
24402440
"description": ""
24412441
},
2442-
"examples": []
2442+
"examples": [
2443+
"```ts\nconst citations = extractCitations(lcMessage);\n```"
2444+
]
24432445
},
24442446
{
24452447
"name": "injectAgent",

apps/website/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import "./.next/types/routes.d.ts";
3+
import "./../../dist/apps/website/.next/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

libs/ag-ui/src/lib/bridge-citations-state.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ interface ThreadStateLike {
66
state?: Record<string, unknown>;
77
}
88

9+
/**
10+
* Attach per-message {@link Citation}s carried in an AG-UI thread's `state`
11+
* (`state.citations`, keyed by message id) onto the corresponding assistant
12+
* {@link Message}s — for advanced consumers wiring citations from STATE events
13+
* into the neutral chat contract.
14+
*
15+
* @param thread The thread-state container holding `state.citations`.
16+
* @param messages The messages to enrich.
17+
* @returns A new array where matching messages gain their `citations`; messages
18+
* without citations are returned unchanged.
19+
* @example
20+
* ```ts
21+
* const enriched = bridgeCitationsState(threadState, agent.messages());
22+
* ```
23+
*/
924
export function bridgeCitationsState(thread: ThreadStateLike, messages: Message[]): Message[] {
1025
const citationsByMsg = (thread.state as { citations?: unknown })?.citations;
1126
if (!citationsByMsg || typeof citationsByMsg !== 'object') return messages;

libs/chat/src/lib/a2ui/catalog/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ import { A2uiTextComponent } from './text.component';
1919
import { A2uiTextFieldComponent } from './text-field.component';
2020
import { A2uiVideoComponent } from './video.component';
2121

22+
/**
23+
* Build the built-in A2UI component catalog — a {@link ViewRegistry} mapping
24+
* the standard A2UI element types (Card, Button, TextField, Image, AudioPlayer,
25+
* Video, …) to their Angular renderers. Spread it into `provideViews` (with any
26+
* of your own views) so an agent's A2UI surface specs render.
27+
*
28+
* @returns A {@link ViewRegistry} of the standard A2UI components.
29+
* @example
30+
* ```ts
31+
* providers: [provideViews({ ...a2uiBasicCatalog(), MyWidget: MyWidgetComponent })]
32+
* ```
33+
*/
2234
export function a2uiBasicCatalog(): ViewRegistry {
2335
return views({
2436
AudioPlayer: A2uiAudioPlayerComponent,

0 commit comments

Comments
 (0)