feat: citations + sync all @ngaf to 0.0.21#194
Merged
Conversation
Citations as Message.citations[] populated by adapters, rendered inline by markdown citation-reference view component and as a sources panel via <chat-citations>. CitationsResolverService merges Message.citations and markdown-doc sidecar with message-first precedence. Synchronizes all 16 @Ngaf libraries to 0.0.21 per project policy. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Implements MarkdownCitationReferenceComponent (selector chat-md-citation-reference) that renders inline citation markers resolved via CitationsResolverService. Registers the component under the 'citation-reference' key in cacheplaneMarkdownViews. Updates the view registry spec to cover 19 node types (v0.2 adds citation-reference). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Creates ChatCitationsComponent (chat-citations selector) with a ChatCitationCardTemplateDirective ContentChild slot for custom card rendering, and ChatCitationsCardComponent (chat-citations-card) for default citation display. Exports all three from the chat public surface. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds optional [message] input to ChatMessageComponent and renders <chat-citations [message]="msg" /> after the body slot for assistant role. Provides CitationsResolverService at the chat-message component level and uses an effect to sync message() into the resolver's signal. Updates the component spec to provide CitationsResolverService in the test injector. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-streaming-md Injects CitationsResolverService optionally in ChatStreamingMdComponent and feeds markdownDefs from doc.citations via an effect on the root() signal. This chains the markdown AST citation sidecar into the resolver so inline citation-reference markers can resolve to Citation objects at render time. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…face Adds MarkdownCitationReferenceComponent to the @ngaf/chat public API so consumers can override or inspect the inline citation marker renderer alongside the other per-node markdown view components. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Create extractCitations() normalizer in internals/ and wire it into the toMessage() BaseMessage → Message conversion so that additional_kwargs.citations (or .sources fallback) flows through as Message.citations on every assistant turn. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Create bridgeCitationsState() normalizer and wire it into reduceEvent() after STATE_SNAPSHOT and STATE_DELTA apply their patches, so that state.citations[messageId] arrays flow through as Message.citations on every affected assistant message. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Per project policy: all @Ngaf packages share a single version. This bumps all 16 libraries (a2ui, ag-ui, chat, cockpit-{docs,registry,shell,testing,ui}, db, design-tokens, example-layouts, langgraph, licensing, partial-json, render, ui-react) to 0.0.21 alongside the citations release.
Add minimal documentation for the @Ngaf 0.0.21 citations release across all adapter libraries and changelog. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds citations to
@ngaf/chatand the LangGraph + ag-ui adapter bridges; synchronizes all 16 @Ngaf libraries to0.0.21per project policy.Citations
Citationinterface +Message.citations?: Citation[]field in@ngaf/chat<chat-citations>primitive — sources panel rendered under assistant messages, with<ng-template chatCitationCard>slotMarkdownCitationReferenceComponentregistered in the markdown view registry under'citation-reference'(selectorchat-md-citation-reference)CitationsResolverService— signal-backed, mergesMessage.citations(precedence) + markdown sidecarAdapter bridges
@ngaf/langgraph—extractCitations()readsadditional_kwargs.citations(or.sourcesfallback). Coerces key spellings (href/source→url,name→title,content/excerpt→snippet).@ngaf/ag-ui—bridgeCitationsState()reads thread state atstate.citations[messageId]from STATE_DELTA / STATE_SNAPSHOT.Synchronized version bump
All 16
@ngaf/*libraries →0.0.21. Single tagngaf-v0.0.21at squash-merge commit.@cacheplane/partial-markdownpeer in chat bumped to^0.2.0.Test plan
chat: 395 tests green (+7 new for citations)langgraph: 7 new tests forextractCitationsag-ui: 5 new tests forbridgeCitationsStatechat-/chat-md-lint prefix ruleSpec:
docs/superpowers/specs/2026-05-04-chat-citations-design.mdPlan:
docs/superpowers/plans/2026-05-04-chat-citations.md