bridgeCitationsState
Attach per-message Citations carried in an AG-UI thread's state
(state.citations, keyed by message id) onto the corresponding assistant
Messages — for advanced consumers wiring citations from STATE events
into the neutral chat contract.
import { bridgeCitationsState } from '@threadplane/ag-ui';Declaration · overload 1
export declare function bridgeCitationsState(thread: ThreadStateLike, messages: Message[]): Message[];Parameters
thread· requiredThreadStateLikeThe thread-state container holding
state.citations.messages· requiredMessage[]The messages to enrich.
Returns
Message[]A new array where matching messages gain their citations; messages
without citations are returned unchanged.
Examples
const enriched = bridgeCitationsState(threadState, agent.messages());