@marketrix.ai/widget 3.8.463 → 3.8.465
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.
|
@@ -34,5 +34,7 @@ declare const TASK_STATUS: {
|
|
|
34
34
|
export declare const isTerminalTaskStatus: (status: string) => status is keyof typeof TASK_STATUS;
|
|
35
35
|
/** Settles a pending message into a plain error bubble — the one shape for both a failed POST and a chat/error. */
|
|
36
36
|
export declare function reduceError(state: SseState, messageId: string, text: string): SseState;
|
|
37
|
+
/** The transport gave up, so no id-bearing event is coming for whatever is still pending. */
|
|
38
|
+
export declare function reduceTransportFailure(state: SseState, text: string): SseState;
|
|
37
39
|
export declare function reduceSse(state: SseState, event: WidgetEvent, currentMode: InstructionType): ReduceResult;
|
|
38
40
|
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type WidgetCommand, type WidgetEvent } from '../sdk';
|
|
2
|
-
|
|
2
|
+
/** The stream has stopped retrying, so nothing further will arrive for anything still in flight. */
|
|
3
|
+
export declare class StreamGaveUpError extends Error {
|
|
4
|
+
}
|
|
3
5
|
export interface StreamClientCallbacks {
|
|
4
6
|
onMessage?: (event: WidgetEvent) => void;
|
|
5
7
|
onError?: (error: Error) => void;
|
|
@@ -10,7 +12,7 @@ export declare class StreamClient {
|
|
|
10
12
|
private chatId;
|
|
11
13
|
private status;
|
|
12
14
|
private callbacks;
|
|
13
|
-
private
|
|
15
|
+
private reconnectSuppressed;
|
|
14
16
|
private reconnectAttempts;
|
|
15
17
|
private readonly maxReconnectAttempts;
|
|
16
18
|
private reconnectDelay;
|
|
@@ -24,8 +26,8 @@ export declare class StreamClient {
|
|
|
24
26
|
addCallbacks(callbacks: StreamClientCallbacks): void;
|
|
25
27
|
removeCallbacks(callbacks: StreamClientCallbacks): void;
|
|
26
28
|
isConnected(): boolean;
|
|
27
|
-
/** Whether a user-driven retry can achieve anything: there is a chat to rejoin and
|
|
28
|
-
*
|
|
29
|
+
/** Whether a user-driven retry can achieve anything: there is a chat to rejoin and nothing has
|
|
30
|
+
* suppressed reconnection. */
|
|
29
31
|
canReconnect(): boolean;
|
|
30
32
|
/** The user asked to retry. `scheduleReconnect` gives up permanently at `maxReconnectAttempts` and only
|
|
31
33
|
* `registered` resets the counters, so without this reset the widget's Retry button had nothing it
|