teodor-new-chat-ui 4.3.577 → 4.3.579
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/streaming/contexts/types.d.ts +3 -37
- package/dist/features/streaming/utils/types.d.ts +2 -1
- package/dist/features/thread/hooks/useThreadHistoryState.d.ts +1 -0
- package/dist/index.esm.js +5161 -5115
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +36 -36
- package/dist/index.umd.js.map +1 -1
- package/dist/shared/core/types/context.d.ts +24 -0
- package/dist/shared/core/types/models.d.ts +8 -0
- package/dist/shared/core/utils/messageFactory.d.ts +14 -0
- package/package.json +1 -1
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type { MutableRefObject } from "react";
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type { TimelineCheckpoint } from "@/features/checkpoint/types";
|
|
5
|
-
import type { ThreadStateMetadata } from "@/shared/core/types";
|
|
6
|
-
import type { StateHistoryEvent, StreamEvent, ThreadInfoEvent } from "@/features/streaming";
|
|
2
|
+
import type { SharedThreadSummary, ThreadSummary } from "@/types";
|
|
3
|
+
import type { ThreadInfoEvent } from "@/features/streaming";
|
|
7
4
|
export interface ThreadsContextValue {
|
|
8
5
|
threads: ThreadSummary[];
|
|
9
6
|
currentThreadId: string | null;
|
|
@@ -27,35 +24,4 @@ export interface ThreadsContextValue {
|
|
|
27
24
|
shareStatus: string | null;
|
|
28
25
|
clearShareStatus: () => void;
|
|
29
26
|
}
|
|
30
|
-
export
|
|
31
|
-
threadId: string | null;
|
|
32
|
-
messages: ChatMessage[];
|
|
33
|
-
interrupt: PendingInterrupt;
|
|
34
|
-
checkpoint: {
|
|
35
|
-
id: string | null;
|
|
36
|
-
namespace: string | null;
|
|
37
|
-
};
|
|
38
|
-
checkpoints: HydratedCheckpointSnapshot[];
|
|
39
|
-
checkpointIndex: CheckpointIndex;
|
|
40
|
-
timelineCheckpoints: TimelineCheckpoint[];
|
|
41
|
-
metadata: ThreadStateMetadata;
|
|
42
|
-
isLoading: boolean;
|
|
43
|
-
isLoadingCheckpoint: boolean;
|
|
44
|
-
error: string | null;
|
|
45
|
-
clearState: () => void;
|
|
46
|
-
navigateToCheckpoint: (checkpointId: string, checkpointNs?: string | null) => Promise<void>;
|
|
47
|
-
setCurrentCheckpointId: (checkpointId: string | null, checkpointNs?: string | null) => void;
|
|
48
|
-
returnToLatest: () => Promise<void>;
|
|
49
|
-
loadThread: (threadId: string, checkpointId?: string, options?: {
|
|
50
|
-
clearProgress?: boolean;
|
|
51
|
-
}) => Promise<void>;
|
|
52
|
-
clearThread: () => Promise<void>;
|
|
53
|
-
respondToInterrupt: (approved: boolean, value?: unknown, options?: RespondToInterruptOptions) => Promise<void>;
|
|
54
|
-
messagePreviews: Map<string, string>;
|
|
55
|
-
/** @internal */ handleStateHistoryEvent: (event: StateHistoryEvent) => void;
|
|
56
|
-
/** @internal */ markSkipNextLoad: (threadId: string | null) => void;
|
|
57
|
-
/** @internal */ markStreamPendingThread: (threadId: string | null) => void;
|
|
58
|
-
/** @internal */ resetHistoryState: () => void;
|
|
59
|
-
/** @internal */ pushUser: (message: ChatMessage, editingMessageId?: string | null) => void;
|
|
60
|
-
/** @internal */ onEvent: (event: StreamEvent) => void;
|
|
61
|
-
}
|
|
27
|
+
export type { ThreadStateContextValue, PushUserOptions } from "@/shared/core/types";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChatMessage, HistoryPayload, ProjectInfo } from "@/types";
|
|
1
|
+
import type { ChatMessage, HistoryPayload, ProjectInfo, ThreadStateValues } from "@/types";
|
|
2
2
|
import { ChatRequest } from "@/types";
|
|
3
3
|
export type UseChatStreamOptions = {
|
|
4
4
|
baseUrl?: string;
|
|
@@ -49,6 +49,7 @@ export type UseStreamApi = {
|
|
|
49
49
|
stop: () => void;
|
|
50
50
|
clear: () => void;
|
|
51
51
|
setToken: (t: string | null) => void;
|
|
52
|
+
values: Record<string, unknown> | ThreadStateValues;
|
|
52
53
|
};
|
|
53
54
|
export type ActiveRunContext = {
|
|
54
55
|
threadId: string | null;
|
|
@@ -37,6 +37,7 @@ interface ThreadHistoryResult {
|
|
|
37
37
|
markSkipNextLoad: (threadId: string | null) => void;
|
|
38
38
|
markStreamPendingThread: (threadId: string | null) => void;
|
|
39
39
|
resetHistoryState: () => void;
|
|
40
|
+
clearState: () => void;
|
|
40
41
|
}
|
|
41
42
|
export declare function useThreadHistoryState({ api, seed, onError, currentThreadId, initialThreadId, initialCheckpointId, initialCheckpointNs, autoLoadInitial, isStreaming, getMessages, }: UseThreadHistoryStateOptions): ThreadHistoryResult;
|
|
42
43
|
export {};
|