diff --git a/catalog/app/components/Assistant/Model/Context.tsx b/catalog/app/components/Assistant/Model/Context.tsx index 17234731879..2717ffa06c7 100644 --- a/catalog/app/components/Assistant/Model/Context.tsx +++ b/catalog/app/components/Assistant/Model/Context.tsx @@ -11,6 +11,7 @@ import * as Tool from './Tool' export interface ContextShape { messages: string[] tools: Tool.Collection + markers: Record } interface ContextAggregator { @@ -56,6 +57,7 @@ export function ContextAggregatorProvider({ children }: React.PropsWithChildren< const ROOT_CONTEXT: ContextShape = { tools: {}, messages: [], + markers: {}, } function aggregateContext(contexts: Partial[]) { @@ -66,6 +68,7 @@ function aggregateContext(contexts: Partial[]) { // XXX: check for conflicts? tools: { ...acc.tools, ...next.tools }, messages: acc.messages.concat(next.messages || []), + markers: { ...acc.markers, ...next.markers }, }), ROOT_CONTEXT, ) @@ -97,7 +100,7 @@ export function usePushContext(context: Partial) { React.useEffect(() => push(contextMemo), [push, contextMemo]) } -export function Push(context: ContextShape) { +export function Push(context: Partial) { usePushContext(context) return null }