teodor-new-chat-ui 4.3.293 → 4.3.295
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/ChatProviders.d.ts +1 -3
- package/dist/context/providers/ChatSessionProvider.d.ts +7 -5
- package/dist/index.esm.js +4342 -4381
- package/dist/index.umd.js +34 -34
- package/package.json +1 -1
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { ApiConfig } from '@/types/api';
|
|
9
9
|
import { type ReactNode } from 'react';
|
|
10
|
-
import type { CheckpointMetadataCache } from './hooks/useCheckpointMetadataCache';
|
|
11
10
|
export interface ChatProvidersProps {
|
|
12
11
|
children: ReactNode;
|
|
13
12
|
apiConfig?: ApiConfig;
|
|
@@ -18,9 +17,8 @@ export interface ChatProvidersProps {
|
|
|
18
17
|
onError?: (error: string) => void;
|
|
19
18
|
onAuthError?: (error: string) => void;
|
|
20
19
|
onThreadChange?: (threadId: string | null) => void;
|
|
21
|
-
checkpointMetadataCache?: CheckpointMetadataCache;
|
|
22
20
|
}
|
|
23
|
-
export declare function ChatProviders({ children, apiConfig, initialThreadId, initialCheckpointId, initialCheckpointNs, autoLoadInitial, onError, onAuthError, onThreadChange,
|
|
21
|
+
export declare function ChatProviders({ children, apiConfig, initialThreadId, initialCheckpointId, initialCheckpointNs, autoLoadInitial, onError, onAuthError, onThreadChange, }: ChatProvidersProps): import("react/jsx-runtime").JSX.Element;
|
|
24
22
|
export { useApi } from './providers/ApiProvider';
|
|
25
23
|
export { useStream, useThreads, useThreadState } from './providers/ChatSessionProvider';
|
|
26
24
|
export type { ApiContextValue, SendOptions, StreamContextValue, ThreadsContextValue, ThreadStateContextValue } from './types';
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* KEPT (Essential):
|
|
16
16
|
* - Thread management (load, create, delete, list)
|
|
17
|
-
* - Message streaming
|
|
17
|
+
* - Message streaming with automatic URL sync (blocks during stream)
|
|
18
18
|
* - Checkpoint navigation
|
|
19
19
|
* - Auth token handling
|
|
20
20
|
* - Event handling (stream, interrupts)
|
|
@@ -23,13 +23,16 @@
|
|
|
23
23
|
* - Reading lastCheckpointId/Ns from localStorage on mount
|
|
24
24
|
* - Passing it to ChatProviders as initialCheckpointId/Ns
|
|
25
25
|
* - Syncing checkpoint changes back to localStorage
|
|
26
|
-
*
|
|
26
|
+
*
|
|
27
|
+
* Package handles:
|
|
28
|
+
* - Never fetching history while streaming (blocks auto-load)
|
|
29
|
+
* - Never updating URL/re-rendering while streaming
|
|
30
|
+
* - Clean stream → URL sync transition
|
|
27
31
|
*
|
|
28
32
|
* RESULT: Much easier to debug, faster development, no stale cache issues
|
|
29
33
|
*/
|
|
30
34
|
import type { ChatMessage, HydratedCheckpointSnapshot, PendingInterrupt, StreamContextValue, ThreadSummary, TimelineCheckpoint } from '@/types/api';
|
|
31
35
|
import { type ReactNode } from 'react';
|
|
32
|
-
import { CheckpointMetadataCache } from '../hooks/useCheckpointMetadataCache';
|
|
33
36
|
interface ThreadsContextValue {
|
|
34
37
|
threads: ThreadSummary[];
|
|
35
38
|
currentThreadId: string | null;
|
|
@@ -78,9 +81,8 @@ interface ChatSessionProviderProps {
|
|
|
78
81
|
onError?: (error: string) => void;
|
|
79
82
|
onAuthError?: (error: string) => void;
|
|
80
83
|
onThreadChange?: (threadId: string | null) => void;
|
|
81
|
-
checkpointMetadataCache?: CheckpointMetadataCache;
|
|
82
84
|
}
|
|
83
|
-
export declare function ChatSessionProvider({ children, initialThreadId, initialCheckpointId, initialCheckpointNs, autoLoadInitial, onError, onAuthError, onThreadChange,
|
|
85
|
+
export declare function ChatSessionProvider({ children, initialThreadId, initialCheckpointId, initialCheckpointNs, autoLoadInitial, onError, onAuthError, onThreadChange, }: ChatSessionProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
84
86
|
/**
|
|
85
87
|
* Hook to check if the current component is within a ChatSessionProvider
|
|
86
88
|
*/
|