teodor-new-chat-ui 4.1.42 → 4.1.45
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/context/reducers/MessageReducer.d.ts +6 -12
- package/dist/index.esm.js +2854 -2764
- package/dist/index.umd.js +36 -35
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChatMessage,
|
|
1
|
+
import type { ChatMessage, StreamEvent } from "@/types/api";
|
|
2
2
|
export type ReducerStreamEvent = Exclude<StreamEvent, {
|
|
3
3
|
type: "thread_info";
|
|
4
4
|
} | {
|
|
@@ -18,6 +18,10 @@ export interface MessagesState {
|
|
|
18
18
|
id: string;
|
|
19
19
|
value: any;
|
|
20
20
|
} | null;
|
|
21
|
+
messagesStreamMeta?: Record<string, {
|
|
22
|
+
lastSeq?: number | null;
|
|
23
|
+
lastText?: string;
|
|
24
|
+
}>;
|
|
21
25
|
}
|
|
22
26
|
export type MessagesAction = {
|
|
23
27
|
type: "reset";
|
|
@@ -71,14 +75,4 @@ export declare function useMessagesReducer(initial?: ChatMessage[]): {
|
|
|
71
75
|
readonly state: MessagesState;
|
|
72
76
|
readonly dispatch: import("react").Dispatch<MessagesAction>;
|
|
73
77
|
};
|
|
74
|
-
export declare function
|
|
75
|
-
/**
|
|
76
|
-
* Compute the minimal new suffix to append for streaming text updates.
|
|
77
|
-
* Guards against providers that resend prior context, preventing visible duplication.
|
|
78
|
-
*
|
|
79
|
-
* Returns:
|
|
80
|
-
* - string (suffix to append) if overlap is found
|
|
81
|
-
* - "" (empty string) if texts are identical
|
|
82
|
-
* - null if no overlap is found (caller should decide how to handle)
|
|
83
|
-
*/
|
|
84
|
-
export declare function computeSuffix(existing: string, incoming: string): string | null;
|
|
78
|
+
export declare function computeSuffix(existing: string, incoming: string): string;
|