import type { FeedbackRatingType } from '@/widget/queries/sendMessageQuery'; import type { FileUpload } from './file'; import type { IAction, IAgentReasoning } from './action'; import type { ActivityStep, Block, RenderBlock } from '@/dynamic-ui'; import type { ParsedGeneratedArtifact } from '@/artifacts/artifact-generation'; import type { TtsAudioPayload } from '@/streaming/sse-events'; export type messageType = 'apiMessage' | 'userMessage' | 'usermessagewaiting' | 'leadCaptureMessage'; export type ExecutionState = 'INPROGRESS' | 'FINISHED' | 'ERROR' | 'TERMINATED' | 'TIMEOUT' | 'STOPPED'; export type AgentFlowExecutedData = { nodeLabel: string; nodeId: string; data: any; previousNodeIds: string[]; status?: ExecutionState; }; export type MessageType = { messageId?: string; message: string; type: messageType; isStreaming?: boolean; isFailed?: boolean; streamError?: string; sourceDocuments?: any; fileAnnotations?: any; fileUploads?: Partial[]; artifacts?: Partial[]; agentReasoning?: IAgentReasoning[]; execution?: any; agentFlowEventStatus?: string; agentFlowExecutedData?: any; usedTools?: any[]; action?: IAction | null; rating?: FeedbackRatingType; id?: string; followUpPrompts?: string; dateTime?: string; ttsAudio?: TtsAudioPayload; chatType?: string; memoryType?: string; /** * Dynamic UI. `blocks` is the live ordered content built during an AG-UI stream (prose, * components, and placeholders for components still arriving); `dynamicUiBlocks` is the * persisted equivalent replayed from history; `activity` is the tool/flow timeline. * All three are absent on a plain legacy-wire message, which then renders exactly as before. */ blocks?: RenderBlock[]; dynamicUiBlocks?: Block[]; activity?: { steps: ActivityStep[]; }; artifactGenerations?: ParsedGeneratedArtifact[]; };