teodor-new-chat-ui 4.3.604 → 4.3.606
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.
- package/dist/features/conversation/components/ChatInterface.d.ts +4 -1
- package/dist/features/conversation/components/hooks/useToolTimeline.d.ts +20 -0
- package/dist/features/conversation/components/renderers/MessageContent.d.ts +1 -3
- package/dist/features/conversation/components/renderers/MessageHeader.d.ts +1 -6
- package/dist/features/conversation/components/renderers/tool/content/ToolProgress.d.ts +1 -1
- package/dist/features/conversation/components/utils/messageHelpers.d.ts +2 -6
- package/dist/index.esm.js +5133 -5134
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +34 -34
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -41,6 +42,8 @@ export interface ChatInterfaceProps {
|
|
|
41
42
|
onError?: (error: string) => void;
|
|
42
43
|
/** Whether to render artifacts (plots, images) inline in the message. Defaults to true. */
|
|
43
44
|
renderArtifactsInline?: boolean;
|
|
45
|
+
/** Custom content to display when there are no messages */
|
|
46
|
+
emptyMessage?: React.ReactNode;
|
|
44
47
|
}
|
|
45
|
-
export declare function ChatInterface({ className, placeholder, maxHeight, streamingDebounceMs, followNewMessages, enableFileUpload, enableExcelUpload, enableMessageEditing, showToolMessages, toolConfig, toolRenderers, toolArtifactRenderers, payloadExtras, customStyles, messageCustomStyles, onMessageSent, onExcelUploadSuccess, onError, renderArtifactsInline, }: 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;
|
|
46
49
|
export type { ToolRendererMap, ToolArtifactRendererMap, ToolArtifactRendererContext, } from "./ToolContent";
|
|
@@ -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[];
|
|
@@ -34,5 +32,5 @@ export interface MessageContentProps {
|
|
|
34
32
|
disableInterruptActions?: boolean;
|
|
35
33
|
renderArtifactsInline?: boolean;
|
|
36
34
|
}
|
|
37
|
-
export declare function MessageContent({ message, allMessages, isToolMessage, showToolMessages,
|
|
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;
|
|
38
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,
|
|
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;
|
|
@@ -6,5 +6,5 @@ interface ToolProgressProps {
|
|
|
6
6
|
isStreaming?: boolean;
|
|
7
7
|
toolConfig?: ToolConfig;
|
|
8
8
|
}
|
|
9
|
-
export declare function ToolProgress({ message, allMessages,
|
|
9
|
+
export declare function ToolProgress({ message, allMessages, }: ToolProgressProps): import("react/jsx-runtime").JSX.Element | null;
|
|
10
10
|
export {};
|
|
@@ -29,16 +29,12 @@ export declare function createArtifactPreviewFromSource({ base64, url, formatHin
|
|
|
29
29
|
export declare function createArtifactPreviewFromPlot(plot: PlotData): ArtifactPreview | null;
|
|
30
30
|
export declare function getToolProgress(message: ChatMessage): unknown[];
|
|
31
31
|
/**
|
|
32
|
-
* Check if an assistant message contains ONLY
|
|
33
|
-
* These messages should be hidden
|
|
34
|
-
* should be shown nested within the next assistant message with text.
|
|
32
|
+
* Check if an assistant message contains ONLY tool_calls (no meaningful text/media).
|
|
33
|
+
* These messages should be hidden and their logic hoisted into the next message.
|
|
35
34
|
*/
|
|
36
35
|
export declare function isAssistantMessageWithOnlyToolCalls(message: ChatMessage): boolean;
|
|
37
36
|
/**
|
|
38
37
|
* Check if a message should be hidden from the main message list.
|
|
39
|
-
* This includes:
|
|
40
|
-
* - Tool messages (role: "tool")
|
|
41
|
-
* - Assistant messages with only tool_call parts (no text)
|
|
42
38
|
*/
|
|
43
39
|
export declare function shouldHideMessageFromList(message: ChatMessage): boolean;
|
|
44
40
|
export type ToolExecutionEntry = {
|