teodor-new-chat-ui 4.3.381 → 4.3.383
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/chat/message-components/ArtifactRenderer.d.ts +16 -0
- package/dist/components/chat/message-components/ResearchTaskArtifact.d.ts +20 -0
- package/dist/components/chat/message-components/{ArtifactPreviewItem.d.ts → artifacts/PlotArtifact.d.ts} +1 -1
- package/dist/components/chat/message-components/artifacts/ResearchTaskArtifact.d.ts +20 -0
- package/dist/components/chat/message-components/index.d.ts +3 -1
- package/dist/context/reducers/MessageReducer.d.ts +2 -1
- package/dist/index.esm.js +5062 -4989
- package/dist/index.umd.js +30 -30
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified Artifact Renderer
|
|
3
|
+
*
|
|
4
|
+
* Dispatches to specific artifact renderers based on type.
|
|
5
|
+
* Supports: plots, research_task_info, and extensible for other types.
|
|
6
|
+
*/
|
|
7
|
+
import type { MessageArtifact } from "@/types/api";
|
|
8
|
+
export interface ArtifactRendererProps {
|
|
9
|
+
artifact: MessageArtifact | any;
|
|
10
|
+
idx?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Determines artifact type and renders appropriate component
|
|
14
|
+
*/
|
|
15
|
+
export declare function ArtifactRenderer({ artifact, idx }: ArtifactRendererProps): import("react/jsx-runtime").JSX.Element | null;
|
|
16
|
+
export default ArtifactRenderer;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom artifact renderer for research_task_info type
|
|
3
|
+
* Displays research task status with links and metadata
|
|
4
|
+
*/
|
|
5
|
+
export interface ResearchTaskInfo {
|
|
6
|
+
type: "research_task_info";
|
|
7
|
+
task_id: string;
|
|
8
|
+
progress_url: string;
|
|
9
|
+
query?: string;
|
|
10
|
+
status?: "pending" | "processing" | "completed" | "failed";
|
|
11
|
+
createdAt?: string;
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
}
|
|
14
|
+
export interface ResearchTaskArtifactProps {
|
|
15
|
+
artifact: ResearchTaskInfo;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Renders a research task artifact with status badge and action buttons
|
|
19
|
+
*/
|
|
20
|
+
export declare function ResearchTaskArtifact({ artifact }: ResearchTaskArtifactProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom artifact renderer for research_task_info type
|
|
3
|
+
* Displays research task status with links and metadata
|
|
4
|
+
*/
|
|
5
|
+
export interface ResearchTaskInfo {
|
|
6
|
+
type: "research_task_info";
|
|
7
|
+
task_id: string;
|
|
8
|
+
progress_url: string;
|
|
9
|
+
query?: string;
|
|
10
|
+
status?: "pending" | "processing" | "completed" | "failed";
|
|
11
|
+
createdAt?: string;
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
}
|
|
14
|
+
export interface ResearchTaskArtifactProps {
|
|
15
|
+
artifact: ResearchTaskInfo;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Renders a research task artifact with status badge and action buttons
|
|
19
|
+
*/
|
|
20
|
+
export declare function ResearchTaskArtifact({ artifact }: ResearchTaskArtifactProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ArtifactRenderer } from "./ArtifactRenderer";
|
|
2
|
+
export { PlotArtifact } from "./artifacts/PlotArtifact";
|
|
3
|
+
export { ResearchTaskArtifact } from "./artifacts/ResearchTaskArtifact";
|
|
2
4
|
export { InterruptPartRenderer } from "./InterruptPartRenderer";
|
|
3
5
|
export { SimpleJsonView } from "./SimpleJsonView";
|
|
4
6
|
export { StreamProgress } from "./StreamProgress";
|
|
@@ -37,6 +37,7 @@ export type MessagesAction = {
|
|
|
37
37
|
type: "user_message";
|
|
38
38
|
payload: {
|
|
39
39
|
message: ChatMessage;
|
|
40
|
+
editingMessageId?: string | null;
|
|
40
41
|
};
|
|
41
42
|
} | {
|
|
42
43
|
type: "event";
|
|
@@ -67,7 +68,7 @@ export declare function useMessagesReducer(initial?: ChatMessage[]): {
|
|
|
67
68
|
} | null;
|
|
68
69
|
}) => void;
|
|
69
70
|
readonly prepend: (messages: ChatMessage[]) => void;
|
|
70
|
-
readonly pushUser: (message: ChatMessage) => void;
|
|
71
|
+
readonly pushUser: (message: ChatMessage, editingMessageId?: string | null) => void;
|
|
71
72
|
readonly onEvent: (ev: StreamEvent) => void;
|
|
72
73
|
readonly state: MessagesState;
|
|
73
74
|
readonly dispatch: import("react").Dispatch<MessagesAction>;
|