teodor-new-chat-ui 4.3.94 → 4.3.96

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.
@@ -16,9 +16,10 @@ export interface ChatProvidersProps {
16
16
  enableFileAgentRouting?: boolean;
17
17
  fileAgentId?: string;
18
18
  onError?: (error: string) => void;
19
+ onAuthError?: (error: string) => void;
19
20
  onThreadChange?: (threadId: string | null) => void;
20
21
  }
21
- export declare function ChatProviders({ children, apiConfig, initialThreadId, autoLoadInitial, disableAutoRestore, enableFileAgentRouting, fileAgentId, onError, onThreadChange, }: ChatProvidersProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function ChatProviders({ children, apiConfig, initialThreadId, autoLoadInitial, disableAutoRestore, enableFileAgentRouting, fileAgentId, onError, onAuthError, onThreadChange, }: ChatProvidersProps): import("react/jsx-runtime").JSX.Element;
22
23
  export { useApi } from './providers/ApiProvider';
23
24
  export { useStream, useThreads, useThreadState } from './providers/ChatSessionProvider';
24
25
  export type { ApiContextValue, StreamContextValue, ThreadsContextValue, ThreadStateContextValue, SendOptions, } from './types';
@@ -8,10 +8,11 @@ interface ChatSessionProviderPropsBase {
8
8
  enableFileAgentRouting?: boolean;
9
9
  fileAgentId?: string;
10
10
  onError?: (error: string) => void;
11
+ onAuthError?: (error: string) => void;
11
12
  onThreadChange?: (threadId: string | null) => void;
12
13
  }
13
14
  export type ChatSessionProviderProps = ChatSessionProviderPropsBase;
14
- export declare function ChatSessionProvider({ children, initialThreadId, autoLoadInitial, disableAutoRestore, enableFileAgentRouting, fileAgentId, onError, onThreadChange, }: ChatSessionProviderProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function ChatSessionProvider({ children, initialThreadId, autoLoadInitial, disableAutoRestore, enableFileAgentRouting, fileAgentId, onError, onAuthError, onThreadChange, }: ChatSessionProviderProps): import("react/jsx-runtime").JSX.Element;
15
16
  export declare function useThreads(): ThreadsContextValue;
16
17
  export declare function useThreadState(): ThreadStateContextValue;
17
18
  export declare function useStream(): StreamContextValue;
@@ -27,6 +27,7 @@ interface UseChatStreamingServiceOptions {
27
27
  }) => void;
28
28
  onStreamClosed?: (info: StreamClosedInfo) => void;
29
29
  onConnectionError?: (error: string) => void;
30
+ onAuthError?: (error: string) => void;
30
31
  onHeartbeat?: (event: HeartbeatEvent) => void;
31
32
  }
32
33
  interface StartStreamCallbacks {
@@ -41,6 +42,7 @@ interface StartStreamCallbacks {
41
42
  }) => void;
42
43
  onClosed?: (info: StreamClosedInfo) => void;
43
44
  onConnectionError?: (error: string) => void;
45
+ onAuthError?: (error: string) => void;
44
46
  onHeartbeat?: (event: HeartbeatEvent) => void;
45
47
  }
46
48
  /**
@@ -49,7 +51,7 @@ interface StartStreamCallbacks {
49
51
  * here means we continue to rely on the well-tested streaming hook for all SSE
50
52
  * behaviour while the provider focuses purely on state updates.
51
53
  */
52
- export declare function useChatStreamingService({ baseUrl, onThreadInfo, onMessageEvent, onUnhandledEvent, onSequenceGap, onStreamClosed, onConnectionError, onHeartbeat, }: UseChatStreamingServiceOptions): {
54
+ export declare function useChatStreamingService({ baseUrl, onThreadInfo, onMessageEvent, onUnhandledEvent, onSequenceGap, onStreamClosed, onConnectionError, onAuthError, onHeartbeat, }: UseChatStreamingServiceOptions): {
53
55
  startStream: (request: ChatRequest, callbacks?: StartStreamCallbacks) => void;
54
56
  stop: () => void;
55
57
  isStreaming: boolean;
@@ -33,6 +33,7 @@ export type UseChatStream = {
33
33
  error?: string | null;
34
34
  }) => void;
35
35
  onConnectionError?: (message: string) => void;
36
+ onAuthError?: (message: string) => void;
36
37
  onHeartbeat?: (event: Extract<StreamEvent, {
37
38
  type: "heartbeat";
38
39
  }>) => void;