research-agent-ui 0.1.90 → 0.1.92
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/components/ChatConversation/ChatWindow.d.ts +13 -0
- package/dist/components/ChatConversation/MessageBubble/MessageAttachments.d.ts +10 -0
- package/dist/hooks/useChat/ChatContext.d.ts +6 -0
- package/dist/hooks/useChat/sendMessage.d.ts +3 -1
- package/dist/index.cjs +14 -14
- package/dist/index.mjs +1708 -1585
- package/package.json +5 -5
|
@@ -20,6 +20,17 @@ export interface AssistantMessage extends BaseMessage {
|
|
|
20
20
|
/** Optional follow-up suggestions */
|
|
21
21
|
suggestions?: string[];
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* A file attached to a chat message, shown inline in the conversation flow.
|
|
25
|
+
*/
|
|
26
|
+
export interface MessageFile {
|
|
27
|
+
/** Original file name (e.g. "report.pdf"). */
|
|
28
|
+
fileName: string;
|
|
29
|
+
/** File extension without the dot (e.g. "pdf", "png"). */
|
|
30
|
+
fileExtension: string;
|
|
31
|
+
/** Unique identifier of the uploaded file. */
|
|
32
|
+
fileId: string;
|
|
33
|
+
}
|
|
23
34
|
/**
|
|
24
35
|
* Represents a message sent by the user.
|
|
25
36
|
*/
|
|
@@ -27,6 +38,8 @@ export interface UserMessage extends BaseMessage {
|
|
|
27
38
|
role: 'user';
|
|
28
39
|
/** The text content of the user message */
|
|
29
40
|
content: string;
|
|
41
|
+
/** Files the user attached to this message, if any. */
|
|
42
|
+
files?: MessageFile[];
|
|
30
43
|
}
|
|
31
44
|
/**
|
|
32
45
|
* Represents a message containing search sources or citations.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MessageFile } from '../ChatWindow';
|
|
3
|
+
/**
|
|
4
|
+
* Displays the list of files attached to a user message. Renders nothing when
|
|
5
|
+
* there are no attachments.
|
|
6
|
+
*/
|
|
7
|
+
declare const MessageAttachments: ({ files }: {
|
|
8
|
+
files?: MessageFile[];
|
|
9
|
+
}) => React.JSX.Element;
|
|
10
|
+
export default MessageAttachments;
|
|
@@ -70,6 +70,12 @@ export interface ChatContextValue {
|
|
|
70
70
|
* @param fileIds - Array of file ID strings
|
|
71
71
|
*/
|
|
72
72
|
setFileIds: (fileIds: string[]) => void;
|
|
73
|
+
/**
|
|
74
|
+
* Permanently deletes an uploaded file: removes it from the server, from the
|
|
75
|
+
* chat-level attachment lists, and from any message it was attached to.
|
|
76
|
+
* @param fileId - The ID of the uploaded file to delete
|
|
77
|
+
*/
|
|
78
|
+
deleteAttachedFile: (fileId: string) => Promise<void>;
|
|
73
79
|
/**
|
|
74
80
|
* Sends a message to the chat.
|
|
75
81
|
* @param message - The message content to send
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @module components/ResearchAgent/state/chat/sendMessage
|
|
6
6
|
*/
|
|
7
7
|
import { Message } from "../../components/ChatConversation/ChatWindow";
|
|
8
|
-
import { ChatModelProvider } from "../../types/chat";
|
|
8
|
+
import { ChatModelProvider, ChatFile } from "../../types/chat";
|
|
9
9
|
/**
|
|
10
10
|
* Parameters for sending a chat message.
|
|
11
11
|
*/
|
|
@@ -31,6 +31,8 @@ export interface SendMessageDeps {
|
|
|
31
31
|
messages: Message[];
|
|
32
32
|
/** IDs of files attached to the chat */
|
|
33
33
|
fileIds: string[];
|
|
34
|
+
/** Full metadata of files attached to the chat (for inline display). */
|
|
35
|
+
files: ChatFile[];
|
|
34
36
|
/** Current search/focus mode */
|
|
35
37
|
focusMode: string;
|
|
36
38
|
/** Current category for search filtering */
|