teodor-new-chat-ui 4.3.595 → 4.3.596
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/chat/components/ChatInterface/ChatInterface.d.ts +3 -9
- package/dist/features/chat/components/Message/MessageComponent.d.ts +2 -2
- package/dist/features/chat/components/Message/MessageList.d.ts +4 -4
- package/dist/features/chat/components/Message/MessageRow.d.ts +5 -5
- package/dist/features/chat/components/Message/hooks/useParsedMessageContent.d.ts +2 -2
- package/dist/features/chat/components/Message/renderers/MessageContent.d.ts +3 -4
- package/dist/features/chat/components/Message/utils/messageHelpers.d.ts +3 -3
- package/dist/features/chat/types/models.d.ts +1 -8
- package/dist/index.esm.js +5084 -5171
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +35 -35
- package/dist/index.umd.js.map +1 -1
- package/dist/shared/core/types/models.d.ts +0 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Designed for use across multiple applications with customizable styling.
|
|
4
4
|
* Relies on the split context hooks (useThreads/useMessages/useStream/useApi).
|
|
5
5
|
*/
|
|
6
|
-
import type { ChatMessage
|
|
6
|
+
import type { ChatMessage } from "@/types";
|
|
7
7
|
import { type MessageComponentProps, type ToolConfig, type ToolRendererMap, type ToolArtifactRendererMap } from "../Message";
|
|
8
8
|
export interface ChatInterfaceProps {
|
|
9
9
|
className?: string;
|
|
@@ -33,18 +33,12 @@ export interface ChatInterfaceProps {
|
|
|
33
33
|
textarea?: string;
|
|
34
34
|
moreButton?: string;
|
|
35
35
|
};
|
|
36
|
-
messageCustomStyles?: (message: ChatMessage
|
|
36
|
+
messageCustomStyles?: (message: ChatMessage) => MessageComponentProps["customStyles"] | undefined;
|
|
37
37
|
onMessageSent?: (message: string) => void;
|
|
38
38
|
onExcelUploadSuccess?: (payload: {
|
|
39
39
|
file: File;
|
|
40
40
|
}) => void;
|
|
41
41
|
onError?: (error: string) => void;
|
|
42
|
-
/**
|
|
43
|
-
* Explicit message to show when the thread is empty instead of fetching the
|
|
44
|
-
* default agent prompt from the backend. Pass `undefined` to fall back to the
|
|
45
|
-
* agent's `uiDefaultMessage`.
|
|
46
|
-
*/
|
|
47
|
-
defaultMessage?: string | null;
|
|
48
42
|
}
|
|
49
|
-
export declare function ChatInterface({ className, placeholder, autoFocus, maxHeight, streamingDebounceMs, followNewMessages, enableFileUpload, enableExcelUpload, enableMessageEditing, showToolMessages, toolConfig, toolRenderers, toolArtifactRenderers, payloadExtras, customStyles, messageCustomStyles, onMessageSent, onExcelUploadSuccess, onError,
|
|
43
|
+
export declare function ChatInterface({ className, placeholder, autoFocus, maxHeight, streamingDebounceMs, followNewMessages, enableFileUpload, enableExcelUpload, enableMessageEditing, showToolMessages, toolConfig, toolRenderers, toolArtifactRenderers, payloadExtras, customStyles, messageCustomStyles, onMessageSent, onExcelUploadSuccess, onError, }: ChatInterfaceProps): import("react/jsx-runtime").JSX.Element;
|
|
50
44
|
export type { ToolRendererMap, ToolArtifactRendererMap, ToolArtifactRendererContext, } from "../Message/ToolContent";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Message Component - With truncatable tool messages and responsive design
|
|
3
3
|
*/
|
|
4
|
-
import type { ChatMessage,
|
|
4
|
+
import type { ChatMessage, RespondToInterruptOptions } from "@/types";
|
|
5
5
|
import type { CheckpointMeta, EditMeta } from "@/features/checkpoint/types";
|
|
6
6
|
import type { ToolConfig } from "./ToolContent";
|
|
7
7
|
export interface MessageComponentProps {
|
|
8
|
-
message: ChatMessage
|
|
8
|
+
message: ChatMessage;
|
|
9
9
|
messageIndex: number;
|
|
10
10
|
isStreamingMessage?: boolean;
|
|
11
11
|
/** ms to wait for quiet before rendering streaming markdown updates */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { ChatMessage,
|
|
1
|
+
import type { ChatMessage, RespondToInterruptOptions, PendingInterrupt } from "@/types";
|
|
2
2
|
import type { EditMeta, TimelineCheckpoint } from "@/features/checkpoint/types";
|
|
3
3
|
import type { CheckpointIndex } from "@/features/checkpoint/utils/checkpointIndex";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import type { MessageComponentProps } from "./MessageComponent";
|
|
6
6
|
import type { ToolConfig } from "./ToolContent";
|
|
7
7
|
export interface MessageListProps {
|
|
8
|
-
messages:
|
|
8
|
+
messages: ChatMessage[];
|
|
9
9
|
isStreaming: boolean;
|
|
10
10
|
streamingAssistantId: string | null;
|
|
11
11
|
streamingDebounceMs?: number;
|
|
@@ -37,8 +37,8 @@ export interface MessageListProps {
|
|
|
37
37
|
createSyntheticThinkingMessage?: boolean;
|
|
38
38
|
/** Force showing the synthetic thinking message even before the assistant message appears */
|
|
39
39
|
forceSyntheticThinking?: boolean;
|
|
40
|
-
getMessageCustomStyles?: (message: ChatMessage
|
|
41
|
-
getInterruptOptions?: (message: ChatMessage
|
|
40
|
+
getMessageCustomStyles?: (message: ChatMessage) => MessageComponentProps["customStyles"] | undefined;
|
|
41
|
+
getInterruptOptions?: (message: ChatMessage) => RespondToInterruptOptions | undefined;
|
|
42
42
|
/** Pending interrupt state to automatically generate "user_choice" messages */
|
|
43
43
|
pendingInterrupt?: PendingInterrupt | null;
|
|
44
44
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { ChatMessage,
|
|
1
|
+
import type { ChatMessage, RespondToInterruptOptions } from "@/types";
|
|
2
2
|
import type { EditMeta } from "@/features/checkpoint/types";
|
|
3
3
|
import { type CheckpointIndex } from "@/features/checkpoint/utils/checkpointIndex";
|
|
4
4
|
import type { MessageComponentProps } from "./MessageComponent";
|
|
5
5
|
import React from "react";
|
|
6
6
|
import type { ToolConfig } from "./ToolContent";
|
|
7
|
-
export declare const getMessageDomKey: (message: ChatMessage |
|
|
7
|
+
export declare const getMessageDomKey: (message: ChatMessage | undefined, index: number) => string;
|
|
8
8
|
export interface MessageRowProps {
|
|
9
|
-
message: ChatMessage
|
|
9
|
+
message: ChatMessage;
|
|
10
10
|
index: number;
|
|
11
11
|
isStreaming: boolean;
|
|
12
12
|
streamingAssistantId: string | null;
|
|
@@ -21,8 +21,8 @@ export interface MessageRowProps {
|
|
|
21
21
|
checkpointIndex?: CheckpointIndex;
|
|
22
22
|
activeCheckpointId?: string | null;
|
|
23
23
|
onSelectCheckpoint?: (checkpointId: string | null, parentCheckpointId?: string | null, isLatest?: boolean) => Promise<void> | void;
|
|
24
|
-
getMessageCustomStyles?: (message: ChatMessage
|
|
24
|
+
getMessageCustomStyles?: (message: ChatMessage) => MessageComponentProps["customStyles"] | undefined;
|
|
25
25
|
toolConfig?: ToolConfig;
|
|
26
|
-
getInterruptOptions?: (message: ChatMessage
|
|
26
|
+
getInterruptOptions?: (message: ChatMessage) => RespondToInterruptOptions | undefined;
|
|
27
27
|
}
|
|
28
28
|
export declare const MessageRow: React.NamedExoticComponent<MessageRowProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChatMessage,
|
|
1
|
+
import type { ChatMessage, MessagePart } from "@/types";
|
|
2
2
|
import { ToolMeta } from "@/features/chat/components/Message/utils";
|
|
3
3
|
export interface ParsedMessageContent {
|
|
4
4
|
contentParts: MessagePart[];
|
|
@@ -10,4 +10,4 @@ export interface ParsedMessageContent {
|
|
|
10
10
|
isToolStreaming: boolean;
|
|
11
11
|
interruptParts: MessagePart[];
|
|
12
12
|
}
|
|
13
|
-
export declare function useParsedMessageContent(message: ChatMessage
|
|
13
|
+
export declare function useParsedMessageContent(message: ChatMessage): ParsedMessageContent;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { MouseEvent as ReactMouseEvent } from "react";
|
|
2
|
-
import type { ChatMessage,
|
|
2
|
+
import type { ChatMessage, MessagePart } from "@/types";
|
|
3
3
|
import type { InterruptPart, InterruptAlternative } from "@/features/chat/types/models";
|
|
4
4
|
import type { ToolConfig } from "../ToolContent";
|
|
5
5
|
export interface MessageContentProps {
|
|
6
|
-
message: ChatMessage
|
|
6
|
+
message: ChatMessage;
|
|
7
7
|
isToolMessage: boolean;
|
|
8
8
|
showToolMessages: boolean;
|
|
9
9
|
toolViewMode: "preview" | "expanded";
|
|
@@ -14,7 +14,6 @@ export interface MessageContentProps {
|
|
|
14
14
|
textContent: string;
|
|
15
15
|
imageParts: MessagePart[];
|
|
16
16
|
fileParts: MessagePart[];
|
|
17
|
-
defaultMessage: DefaultMessage | null;
|
|
18
17
|
renderStreamingMarkdown?: boolean;
|
|
19
18
|
enableStreamingMarkdownBuffer?: boolean;
|
|
20
19
|
handleFileClick: (event: ReactMouseEvent<HTMLAnchorElement>, fp: any, index: number) => Promise<void> | void;
|
|
@@ -35,5 +34,5 @@ export interface MessageContentProps {
|
|
|
35
34
|
disableInterruptActions?: boolean;
|
|
36
35
|
isInterruptMessage: boolean;
|
|
37
36
|
}
|
|
38
|
-
export declare function MessageContent({ message, isToolMessage, showToolMessages, toolViewMode, toolExpandable, isToolStreaming, contentParts, textContent, imageParts, fileParts, interruptPart, isStreamingMessage, streamingDebounceMs, enableStreamingMarkdownBuffer, renderStreamingMarkdown,
|
|
37
|
+
export declare function MessageContent({ message, 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, isInterruptMessage, }: MessageContentProps): import("react/jsx-runtime").JSX.Element | null;
|
|
39
38
|
export default MessageContent;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared helper utilities for chat message rendering and metadata parsing.
|
|
3
3
|
*/
|
|
4
|
-
import type { ArtifactPreview, ChatMessage,
|
|
4
|
+
import type { ArtifactPreview, ChatMessage, MessagePart, PlotData } from "@/types";
|
|
5
5
|
export type ToolMeta = {
|
|
6
6
|
name?: string;
|
|
7
7
|
toolCallId?: string;
|
|
@@ -11,7 +11,7 @@ export declare function extractToolMeta(message: ChatMessage): ToolMeta;
|
|
|
11
11
|
export declare function normalizeInterruptId(id: unknown): string | null;
|
|
12
12
|
export declare function stringifyTool(parts: MessagePart[]): string;
|
|
13
13
|
export declare function getAgentNameFromMessage(m: ChatMessage): string | null;
|
|
14
|
-
export declare function messageSignature(message: ChatMessage
|
|
14
|
+
export declare function messageSignature(message: ChatMessage): string;
|
|
15
15
|
export declare function normalizeMimeType(formatHint?: string): string;
|
|
16
16
|
export declare function buildLabelParts(extras?: {
|
|
17
17
|
plotId?: string;
|
|
@@ -27,4 +27,4 @@ export declare function createArtifactPreviewFromSource({ base64, url, formatHin
|
|
|
27
27
|
};
|
|
28
28
|
}): ArtifactPreview | null;
|
|
29
29
|
export declare function createArtifactPreviewFromPlot(plot: PlotData): ArtifactPreview | null;
|
|
30
|
-
export declare function getToolProgress(message: ChatMessage
|
|
30
|
+
export declare function getToolProgress(message: ChatMessage): unknown[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Messaging domain models for conversation rendering and artifacts.
|
|
3
3
|
*/
|
|
4
|
-
export type Role = "system" | "user" | "assistant" | "tool" | "
|
|
4
|
+
export type Role = "system" | "user" | "assistant" | "tool" | "interrupt";
|
|
5
5
|
export type TextPart = {
|
|
6
6
|
type: "text";
|
|
7
7
|
text: string;
|
|
@@ -95,10 +95,3 @@ export interface InterruptMessage extends ChatMessage {
|
|
|
95
95
|
role: "interrupt";
|
|
96
96
|
content: InterruptPart[];
|
|
97
97
|
}
|
|
98
|
-
export interface DefaultMessage {
|
|
99
|
-
id?: string;
|
|
100
|
-
threadId?: string;
|
|
101
|
-
role: "default_message";
|
|
102
|
-
content: string;
|
|
103
|
-
createdAt?: string;
|
|
104
|
-
}
|