Skip to content

The open alternative to Salesforce, designed for AI.

1.1 KB
Raw Blame
import { type ReactNode, Suspense } from 'react';

import { AgentChatChannelsEffect } from '@/ai/components/AgentChatChannelsEffect';
import { AgentChatRuntimeEffects } from '@/ai/components/AgentChatRuntimeEffects';
import { AgentChatThreadInitializationEffect } from '@/ai/components/AgentChatThreadInitializationEffect';
import { AgentChatThreadParticipantOperationsEffect } from '@/ai/components/AgentChatThreadParticipantOperationsEffect';
import { AgentChatThreadRecordOperationsEffect } from '@/ai/components/AgentChatThreadRecordOperationsEffect';
import { AgentChatToolIndexInvalidationEffect } from '@/ai/components/AgentChatToolIndexInvalidationEffect';

type AgentChatProviderProps = {
  children: ReactNode;
};

export const AgentChatProvider = ({ children }: AgentChatProviderProps) => (
  <Suspense fallback={null}>
    <AgentChatThreadInitializationEffect />
    <AgentChatThreadRecordOperationsEffect />
    <AgentChatThreadParticipantOperationsEffect />
    <AgentChatChannelsEffect />
    <AgentChatRuntimeEffects />
    <AgentChatToolIndexInvalidationEffect />
    {children}
  </Suspense>
);