teodor-new-chat-ui 4.3.204 → 4.3.206

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.
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import type { ApiConfig } from '@/types/api';
9
9
  import { type ReactNode } from 'react';
10
+ import type { CheckpointMetadataCache } from './hooks/useCheckpointMetadataCache';
10
11
  export interface ChatProvidersProps {
11
12
  children: ReactNode;
12
13
  apiConfig?: ApiConfig;
@@ -17,8 +18,9 @@ export interface ChatProvidersProps {
17
18
  onError?: (error: string) => void;
18
19
  onAuthError?: (error: string) => void;
19
20
  onThreadChange?: (threadId: string | null) => void;
21
+ checkpointMetadataCache?: CheckpointMetadataCache;
20
22
  }
21
- export declare function ChatProviders({ children, apiConfig, initialThreadId, initialCheckpointId, initialCheckpointNs, autoLoadInitial, onError, onAuthError, onThreadChange, }: ChatProvidersProps): import("react/jsx-runtime").JSX.Element;
23
+ export declare function ChatProviders({ children, apiConfig, initialThreadId, initialCheckpointId, initialCheckpointNs, autoLoadInitial, onError, onAuthError, onThreadChange, checkpointMetadataCache, }: ChatProvidersProps): import("react/jsx-runtime").JSX.Element;
22
24
  export { useApi } from './providers/ApiProvider';
23
25
  export { useStream, useThreads, useThreadState } from './providers/ChatSessionProvider';
24
26
  export type { ApiContextValue, SendOptions, StreamContextValue, ThreadsContextValue, ThreadStateContextValue } from './types';
@@ -12,7 +12,7 @@ export interface CachedCheckpointMetadata {
12
12
  checkpointNs?: string;
13
13
  createdAt: string;
14
14
  }
15
- export declare function useCheckpointMetadataCache(): {
15
+ export interface CheckpointMetadataCache {
16
16
  cache: Map<string, CachedCheckpointMetadata[]>;
17
17
  setCacheForThread: (threadId: string, newMetadata: CachedCheckpointMetadata[]) => void;
18
18
  getCachedMetadata: (threadId: string, checkpointId: string) => CachedCheckpointMetadata | undefined;
@@ -20,4 +20,5 @@ export declare function useCheckpointMetadataCache(): {
20
20
  getThreadMetadata: (threadId: string) => CachedCheckpointMetadata[] | undefined;
21
21
  clearThreadCache: (threadId: string) => void;
22
22
  clearAllCache: () => void;
23
- };
23
+ }
24
+ export declare function useCheckpointMetadataCache(): CheckpointMetadataCache;
@@ -22,6 +22,7 @@
22
22
  */
23
23
  import type { ChatMessage, HydratedCheckpointSnapshot, PendingInterrupt, StreamContextValue, ThreadSummary } from '@/types/api';
24
24
  import { type ReactNode } from 'react';
25
+ import { CheckpointMetadataCache } from '../hooks/useCheckpointMetadataCache';
25
26
  interface ThreadsContextValue {
26
27
  threads: ThreadSummary[];
27
28
  currentThreadId: string | null;
@@ -71,8 +72,9 @@ interface ChatSessionProviderProps {
71
72
  onError?: (error: string) => void;
72
73
  onAuthError?: (error: string) => void;
73
74
  onThreadChange?: (threadId: string | null) => void;
75
+ checkpointMetadataCache?: CheckpointMetadataCache;
74
76
  }
75
- export declare function ChatSessionProvider({ children, initialThreadId, initialCheckpointId, initialCheckpointNs, autoLoadInitial, disableAutoRestore, enableFileAgentRouting, fileAgentId, onError, onAuthError, onThreadChange, }: ChatSessionProviderProps): import("react/jsx-runtime").JSX.Element;
77
+ export declare function ChatSessionProvider({ children, initialThreadId, initialCheckpointId, initialCheckpointNs, autoLoadInitial, disableAutoRestore, enableFileAgentRouting, fileAgentId, onError, onAuthError, onThreadChange, checkpointMetadataCache, }: ChatSessionProviderProps): import("react/jsx-runtime").JSX.Element;
76
78
  /**
77
79
  * Hook to check if the current component is within a ChatSessionProvider
78
80
  */