teodor-new-chat-ui 4.3.603 → 4.3.605

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,7 @@
6
6
  import type { ChatMessage } from "@/types";
7
7
  import type { MessageComponentProps } from "./MessageComponent";
8
8
  import type { ToolConfig, ToolRendererMap, ToolArtifactRendererMap } from "./ToolContent";
9
+ import React from "react";
9
10
  export interface ChatInterfaceProps {
10
11
  className?: string;
11
12
  placeholder?: string;
@@ -39,6 +40,10 @@ export interface ChatInterfaceProps {
39
40
  file: File;
40
41
  }) => void;
41
42
  onError?: (error: string) => void;
43
+ /** Whether to render artifacts (plots, images) inline in the message. Defaults to true. */
44
+ renderArtifactsInline?: boolean;
45
+ /** Custom content to display when there are no messages */
46
+ emptyMessage?: React.ReactNode;
42
47
  }
43
- export declare function ChatInterface({ className, placeholder, maxHeight, streamingDebounceMs, followNewMessages, enableFileUpload, enableExcelUpload, enableMessageEditing, showToolMessages, toolConfig, toolRenderers, toolArtifactRenderers, payloadExtras, customStyles, messageCustomStyles, onMessageSent, onExcelUploadSuccess, onError, }: ChatInterfaceProps): import("react/jsx-runtime").JSX.Element;
48
+ export declare function ChatInterface({ className, placeholder, maxHeight, streamingDebounceMs, followNewMessages, enableFileUpload, enableExcelUpload, enableMessageEditing, showToolMessages, toolConfig, toolRenderers, toolArtifactRenderers, payloadExtras, customStyles, messageCustomStyles, onMessageSent, onExcelUploadSuccess, onError, renderArtifactsInline, emptyMessage, }: ChatInterfaceProps): import("react/jsx-runtime").JSX.Element;
44
49
  export type { ToolRendererMap, ToolArtifactRendererMap, ToolArtifactRendererContext, } from "./ToolContent";
@@ -37,6 +37,7 @@ export interface MessageComponentProps {
37
37
  attemptIndex?: number;
38
38
  onSelectCheckpoint?: (checkpointId: string | null, parentCheckpointId?: string | null, isLatest?: boolean) => Promise<void> | void;
39
39
  attemptMetas?: CheckpointMeta[];
40
+ renderArtifactsInline?: boolean;
40
41
  }
41
42
  export declare const MessageComponent: import("react").NamedExoticComponent<MessageComponentProps>;
42
43
  export default MessageComponent;
@@ -33,14 +33,14 @@ export interface MessageListProps {
33
33
  activeCheckpointId?: string | null;
34
34
  onSelectCheckpoint?: (checkpointId: string | null, parentCheckpointId?: string | null, isLatest?: boolean) => Promise<void> | void;
35
35
  timelineCheckpoints?: TimelineCheckpoint[];
36
- /** If true, creates a synthetic thinking message when isStreaming=true and no assistant message exists */
37
- createSyntheticThinkingMessage?: boolean;
38
- /** Force showing the synthetic thinking message even before the assistant message appears */
39
- forceSyntheticThinking?: boolean;
36
+ /** Whether to show the thinking indicator/message while streaming. Defaults to true. */
37
+ showThinkingIndicator?: boolean;
40
38
  getMessageCustomStyles?: (message: ChatMessage) => MessageComponentProps["customStyles"] | undefined;
41
39
  getInterruptOptions?: (message: ChatMessage) => RespondToInterruptOptions | undefined;
42
40
  /** Pending interrupt state to automatically generate "user_choice" messages */
43
41
  pendingInterrupt?: PendingInterrupt | null;
42
+ /** Whether to render artifacts (plots, images) inline in the message. Defaults to true. */
43
+ renderArtifactsInline?: boolean;
44
44
  }
45
45
  export interface MessageListHandle {
46
46
  scrollToLatest: () => void;
@@ -24,5 +24,6 @@ export interface MessageRowProps {
24
24
  getMessageCustomStyles?: (message: ChatMessage) => MessageComponentProps["customStyles"] | undefined;
25
25
  toolConfig?: ToolConfig;
26
26
  getInterruptOptions?: (message: ChatMessage) => RespondToInterruptOptions | undefined;
27
+ renderArtifactsInline?: boolean;
27
28
  }
28
29
  export declare const MessageRow: React.NamedExoticComponent<MessageRowProps>;
@@ -0,0 +1,20 @@
1
+ import type { ChatMessage } from "@/types";
2
+ export interface ToolStep {
3
+ toolCallId: string;
4
+ toolName: string;
5
+ status: "running" | "completed" | "failed";
6
+ content?: string;
7
+ output?: unknown;
8
+ artifact?: unknown;
9
+ timestamp?: string;
10
+ }
11
+ export interface ToolTimelineResult {
12
+ steps: ToolStep[];
13
+ artifacts: any[];
14
+ hasToolExecution: boolean;
15
+ }
16
+ /**
17
+ * Hook to share data between ToolProgress (steps) and MessageContent (aggregated artifacts).
18
+ * It scans the message history to reconstruct what happened in hidden tool messages.
19
+ */
20
+ export declare function useToolTimeline(message: ChatMessage, allMessages?: ChatMessage[]): ToolTimelineResult;
@@ -6,8 +6,6 @@ export interface MessageContentProps {
6
6
  allMessages?: ChatMessage[];
7
7
  isToolMessage: boolean;
8
8
  showToolMessages: boolean;
9
- toolViewMode: "preview" | "expanded";
10
- toolExpandable?: boolean;
11
9
  isToolStreaming: boolean;
12
10
  isStreamingMessage: boolean;
13
11
  contentParts: MessagePart[];
@@ -32,6 +30,7 @@ export interface MessageContentProps {
32
30
  handleInterruptReject?: () => void;
33
31
  handleInterruptAlternative?: (part: unknown, alternative?: InterruptAlternative) => void;
34
32
  disableInterruptActions?: boolean;
33
+ renderArtifactsInline?: boolean;
35
34
  }
36
- export declare function MessageContent({ message, allMessages, isToolMessage, showToolMessages, toolViewMode, toolExpandable, isToolStreaming, contentParts, textContent, imageParts, fileParts, interruptPart, isStreamingMessage, streamingDebounceMs, enableStreamingMarkdownBuffer, renderStreamingMarkdown, handleFileClick, uploadingFiles, messageRole, truncateUserMessages, userMessagePreviewLength, isUserExpanded, setIsUserExpanded, isCompactLayout, iconForeground, toolConfig, handleInterruptApprove, handleInterruptReject, handleInterruptAlternative, disableInterruptActions, }: MessageContentProps): import("react/jsx-runtime").JSX.Element | null;
35
+ export declare function MessageContent({ message, allMessages, isToolMessage, showToolMessages, isToolStreaming, contentParts, textContent, imageParts, fileParts, interruptPart, isStreamingMessage, streamingDebounceMs, enableStreamingMarkdownBuffer, renderStreamingMarkdown, handleFileClick, uploadingFiles, messageRole, truncateUserMessages, userMessagePreviewLength, isUserExpanded, setIsUserExpanded, isCompactLayout, iconForeground, toolConfig, handleInterruptApprove, handleInterruptReject, handleInterruptAlternative, disableInterruptActions, renderArtifactsInline, }: MessageContentProps): import("react/jsx-runtime").JSX.Element | null;
37
36
  export default MessageContent;
@@ -1,4 +1,3 @@
1
- import type { ToolMeta } from "../utils/messageHelpers";
2
1
  export interface MessageHeaderProps {
3
2
  showTimestamp: boolean;
4
3
  showAgentName: boolean;
@@ -13,10 +12,6 @@ export interface MessageHeaderProps {
13
12
  showActions: boolean;
14
13
  isEditing: boolean;
15
14
  messageRole: string;
16
- toolViewMode: "preview" | "expanded";
17
- toolExpandable?: boolean;
18
- toolMeta: ToolMeta;
19
- onToggleToolView: () => void;
20
15
  onCopy: () => void;
21
16
  onEdit?: () => void;
22
17
  onRegenerate?: () => void;
@@ -28,4 +23,4 @@ export interface MessageHeaderProps {
28
23
  messageCreatedAt?: string;
29
24
  copied: boolean;
30
25
  }
31
- export declare function MessageHeader({ showTimestamp, showAgentName, isToolMessage, isInterruptMessage, iconForeground, agentName, messageIcon, customHeaderClass, customActionsClass, isCompactLayout, showActions, isEditing, messageRole, toolViewMode, toolExpandable, toolMeta, onToggleToolView, onCopy, onEdit, onRegenerate, showCheckpointControls, attemptCount, attemptIndex, handleOlderAttemptSelect, handleNewerAttemptSelect, messageCreatedAt, copied, }: MessageHeaderProps): import("react/jsx-runtime").JSX.Element | null;
26
+ export declare function MessageHeader({ showTimestamp, showAgentName, isToolMessage, isInterruptMessage, iconForeground, agentName, messageIcon, customHeaderClass, customActionsClass, isCompactLayout, showActions, isEditing, messageRole, onCopy, onEdit, onRegenerate, showCheckpointControls, attemptCount, attemptIndex, handleOlderAttemptSelect, handleNewerAttemptSelect, messageCreatedAt, copied, }: MessageHeaderProps): import("react/jsx-runtime").JSX.Element | null;
@@ -4,8 +4,7 @@ interface ToolProgressProps {
4
4
  message: ChatMessage;
5
5
  allMessages?: ChatMessage[];
6
6
  isStreaming?: boolean;
7
- viewMode?: "preview" | "expanded";
8
7
  toolConfig?: ToolConfig;
9
8
  }
10
- export declare function ToolProgress({ message, allMessages, isStreaming, toolConfig, }: ToolProgressProps): import("react/jsx-runtime").JSX.Element | null;
9
+ export declare function ToolProgress({ message, allMessages, }: ToolProgressProps): import("react/jsx-runtime").JSX.Element | null;
11
10
  export {};
@@ -49,5 +49,6 @@ export interface ThreadManagerProps {
49
49
  isLoadingShareTargets?: boolean;
50
50
  shareTargetFilter?: (target: ThreadShareTarget, query: string) => boolean;
51
51
  groupBy?: keyof ThreadSummary;
52
+ menuItem?: string;
52
53
  }
53
- export declare function ThreadManager({ className, showCreateButton, showDeleteButton, showEditTitle, maxHeight, customStyles, currentThreadId, navigateToThread, onThreadSelect, onThreadCreate, onThreadDelete, view, defaultView, onViewChange, viewOptions, viewState, showHeader, shareTargets, isLoadingShareTargets, shareTargetFilter, groupBy, }: ThreadManagerProps): import("react/jsx-runtime").JSX.Element;
54
+ export declare function ThreadManager({ className, showCreateButton, showDeleteButton, showEditTitle, maxHeight, customStyles, currentThreadId, navigateToThread, onThreadSelect, onThreadCreate, onThreadDelete, view, defaultView, onViewChange, viewOptions, viewState, showHeader, shareTargets, isLoadingShareTargets, shareTargetFilter, groupBy, menuItem, }: ThreadManagerProps): import("react/jsx-runtime").JSX.Element;