@stigmer/react 3.0.8-dev.20260612100207 → 3.0.8-dev.20260613041848

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.
Files changed (59) hide show
  1. package/execution/useExecutionStream.d.ts +49 -5
  2. package/execution/useExecutionStream.d.ts.map +1 -1
  3. package/execution/useExecutionStream.js +118 -18
  4. package/execution/useExecutionStream.js.map +1 -1
  5. package/internal/backoff.d.ts +61 -0
  6. package/internal/backoff.d.ts.map +1 -0
  7. package/internal/backoff.js +79 -0
  8. package/internal/backoff.js.map +1 -0
  9. package/internal/store/conversation-store.d.ts +12 -0
  10. package/internal/store/conversation-store.d.ts.map +1 -1
  11. package/internal/store/conversation-store.js +7 -0
  12. package/internal/store/conversation-store.js.map +1 -1
  13. package/internal/store/workflow-execution-event-store.d.ts +12 -0
  14. package/internal/store/workflow-execution-event-store.d.ts.map +1 -1
  15. package/internal/store/workflow-execution-event-store.js +7 -0
  16. package/internal/store/workflow-execution-event-store.js.map +1 -1
  17. package/internal/stream-controller.d.ts +11 -19
  18. package/internal/stream-controller.d.ts.map +1 -1
  19. package/internal/stream-controller.js +24 -1
  20. package/internal/stream-controller.js.map +1 -1
  21. package/package.json +4 -4
  22. package/session/SessionViewer.js +4 -1
  23. package/session/SessionViewer.js.map +1 -1
  24. package/session/useSessionConversation.d.ts +7 -1
  25. package/session/useSessionConversation.d.ts.map +1 -1
  26. package/session/useSessionConversation.js +1 -0
  27. package/session/useSessionConversation.js.map +1 -1
  28. package/src/execution/__tests__/useExecutionStream.test.tsx +184 -0
  29. package/src/execution/useExecutionStream.ts +174 -30
  30. package/src/internal/__tests__/backoff.test.ts +99 -0
  31. package/src/internal/backoff.ts +100 -0
  32. package/src/internal/store/conversation-store.ts +22 -0
  33. package/src/internal/store/workflow-execution-event-store.ts +22 -0
  34. package/src/internal/stream-controller.ts +30 -25
  35. package/src/session/SessionViewer.tsx +27 -0
  36. package/src/session/useSessionConversation.ts +8 -1
  37. package/src/workflow/WorkflowExecutionHeader.tsx +4 -1
  38. package/src/workflow/WorkflowExecutionTimeline.tsx +2 -1
  39. package/src/workflow/__tests__/useWorkflowExecutionEventStream.test.tsx +117 -1
  40. package/src/workflow/execution/useWaterfallEntries.ts +2 -1
  41. package/src/workflow/useWorkflowExecutionEventStream.ts +122 -41
  42. package/src/workflow/waterfall/WaterfallTimeline.tsx +2 -1
  43. package/styles.css +1 -1
  44. package/workflow/WorkflowExecutionHeader.d.ts.map +1 -1
  45. package/workflow/WorkflowExecutionHeader.js +3 -1
  46. package/workflow/WorkflowExecutionHeader.js.map +1 -1
  47. package/workflow/WorkflowExecutionTimeline.d.ts.map +1 -1
  48. package/workflow/WorkflowExecutionTimeline.js +1 -1
  49. package/workflow/WorkflowExecutionTimeline.js.map +1 -1
  50. package/workflow/execution/useWaterfallEntries.d.ts.map +1 -1
  51. package/workflow/execution/useWaterfallEntries.js +1 -1
  52. package/workflow/execution/useWaterfallEntries.js.map +1 -1
  53. package/workflow/useWorkflowExecutionEventStream.d.ts +32 -4
  54. package/workflow/useWorkflowExecutionEventStream.d.ts.map +1 -1
  55. package/workflow/useWorkflowExecutionEventStream.js +75 -32
  56. package/workflow/useWorkflowExecutionEventStream.js.map +1 -1
  57. package/workflow/waterfall/WaterfallTimeline.d.ts.map +1 -1
  58. package/workflow/waterfall/WaterfallTimeline.js +1 -1
  59. package/workflow/waterfall/WaterfallTimeline.js.map +1 -1
@@ -1,5 +1,6 @@
1
1
  import type { AgentExecution } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
2
2
  import { ExecutionPhase } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
3
+ import { type BackoffOptions } from "../internal/backoff";
3
4
  import { ConversationStore } from "../internal/store";
4
5
  /** Return value of {@link useExecutionStream}. */
5
6
  export interface UseExecutionStreamReturn {
@@ -17,14 +18,31 @@ export interface UseExecutionStreamReturn {
17
18
  readonly isStreaming: boolean;
18
19
  /** `true` after subscription starts but before the first snapshot arrives. */
19
20
  readonly isConnecting: boolean;
20
- /** Error from the last failed stream attempt, or `null` when healthy. */
21
+ /**
22
+ * `true` while a transient drop is being retried automatically in the
23
+ * background. The last snapshot stays visible and `error` remains `null` —
24
+ * surface a subtle "Reconnecting…" affordance, not an error. Becomes
25
+ * `false` once a snapshot is received (back to `isStreaming`) or retries
26
+ * are exhausted (then `error` is set).
27
+ */
28
+ readonly isReconnecting: boolean;
29
+ /** 1-based count of the in-flight reconnect attempt; `0` when not reconnecting. */
30
+ readonly reconnectAttempt: number;
31
+ /**
32
+ * Error from the last failed stream attempt, or `null` when healthy.
33
+ *
34
+ * Only set once auto-reconnect has exhausted its attempts (or for a
35
+ * non-transient failure that is not retried). It stays `null` throughout
36
+ * background reconnection so a recoverable hiccup never shows as an error.
37
+ */
21
38
  readonly error: Error | null;
22
39
  /**
23
40
  * Reset error state and re-establish the stream subscription.
24
41
  *
25
- * Works in any lifecycle state error, complete, or mid-stream.
26
- * Uses the `connectKey` counter pattern consistent with `refetch()`
27
- * in other SDK hooks.
42
+ * The fallback after auto-reconnect exhausts, and a manual escape hatch in
43
+ * any lifecycle state error, complete, or mid-stream. Resets the retry
44
+ * counter and preserves the last snapshot (no flash to empty). Uses the
45
+ * `connectKey` counter pattern consistent with `refetch()` in other SDK hooks.
28
46
  */
29
47
  readonly reconnect: () => void;
30
48
  }
@@ -44,6 +62,21 @@ export interface UseExecutionStreamOptions {
44
62
  * preserving backward compatibility for standalone usage.
45
63
  */
46
64
  readonly store?: ConversationStore;
65
+ /**
66
+ * Automatically re-establish the subscription with exponential backoff
67
+ * when a non-terminal stream drops (transport error, idle timeout, laptop
68
+ * sleep). Defaults to `true`. Set `false` to opt out and surface every
69
+ * drop as an immediate `error` for manual `reconnect()`.
70
+ */
71
+ readonly autoReconnect?: boolean;
72
+ /**
73
+ * Tune the auto-reconnect backoff schedule and attempt cap. Omitted fields
74
+ * fall back to SDK defaults (base 1s, ×2, max 30s, 10 attempts).
75
+ */
76
+ readonly reconnectOptions?: BackoffOptions & {
77
+ /** Max attempts before surfacing a terminal `error`. */
78
+ readonly maxAttempts?: number;
79
+ };
47
80
  }
48
81
  /**
49
82
  * Behavior hook that subscribes to real-time {@link AgentExecution}
@@ -51,7 +84,18 @@ export interface UseExecutionStreamOptions {
51
84
  *
52
85
  * Manages the full subscription lifecycle through a finite state
53
86
  * machine: connection establishment, rAF-coalesced snapshot streaming,
54
- * terminal-phase detection, error handling, and manual reconnection.
87
+ * terminal-phase detection, automatic reconnection with exponential
88
+ * backoff on transient drops, and manual reconnection as the fallback.
89
+ *
90
+ * **Resilience:** a non-terminal stream drop — whether a thrown transport
91
+ * error (WebKit "Load failed", `fetch failed`, `Unavailable`) or a graceful
92
+ * server close mid-run (idle timeout, load-balancer recycle) — is retried
93
+ * automatically with backoff. The last snapshot stays visible
94
+ * (`isReconnecting`), the access token is re-read on each attempt via the
95
+ * per-request interceptor, and `error` is surfaced only once attempts are
96
+ * exhausted. Completion is decided by the terminal phase, never by the
97
+ * stream merely ending (a graceful close of a running execution reconnects
98
+ * rather than falsely reporting "complete"). Opt out via `autoReconnect: false`.
55
99
  *
56
100
  * **Performance characteristics:**
57
101
  * - Non-terminal snapshots are coalesced via `requestAnimationFrame`
@@ -1 +1 @@
1
- {"version":3,"file":"useExecutionStream.d.ts","sourceRoot":"","sources":["../../src/execution/useExecutionStream.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6DAA6D,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAQ9F,OAAO,EAAE,iBAAiB,EAAoB,MAAM,mBAAmB,CAAC;AAGxE,kDAAkD;AAClD,MAAM,WAAW,wBAAwB;IACvC,iGAAiG;IACjG,QAAQ,CAAC,SAAS,EAAE,cAAc,GAAG,IAAI,CAAC;IAC1C;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,0EAA0E;I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AAgB,EAAE,MAAM,CAAC;IAClC;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,IAAI,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,cAAc,GAAG;QAC3C,wDAAwD;QACxD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;KAC/B,CAAC;CACH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,OAAO,CAAC,EAAE,yBAAyB,GAClC,wBAAwB,CA+M1B"}
@@ -1,10 +1,12 @@
1
1
  "use client";
2
2
  import { startTransition, useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore, } from "react";
3
3
  import { ExecutionPhase } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
4
+ import { isTransientStreamError } from "@stigmer/sdk";
4
5
  import { useStigmer } from "../hooks";
5
6
  import { toError } from "../internal/toError";
6
7
  import { useStreamRate } from "../internal/dev";
7
8
  import { StreamController, } from "../internal/stream-controller";
9
+ import { computeBackoffDelay, sleep, DEFAULT_RECONNECT_MAX_ATTEMPTS, } from "../internal/backoff";
8
10
  import { ConversationStore } from "../internal/store";
9
11
  import { isTerminalPhase } from "./execution-phases";
10
12
  /**
@@ -13,7 +15,18 @@ import { isTerminalPhase } from "./execution-phases";
13
15
  *
14
16
  * Manages the full subscription lifecycle through a finite state
15
17
  * machine: connection establishment, rAF-coalesced snapshot streaming,
16
- * terminal-phase detection, error handling, and manual reconnection.
18
+ * terminal-phase detection, automatic reconnection with exponential
19
+ * backoff on transient drops, and manual reconnection as the fallback.
20
+ *
21
+ * **Resilience:** a non-terminal stream drop — whether a thrown transport
22
+ * error (WebKit "Load failed", `fetch failed`, `Unavailable`) or a graceful
23
+ * server close mid-run (idle timeout, load-balancer recycle) — is retried
24
+ * automatically with backoff. The last snapshot stays visible
25
+ * (`isReconnecting`), the access token is re-read on each attempt via the
26
+ * per-request interceptor, and `error` is surfaced only once attempts are
27
+ * exhausted. Completion is decided by the terminal phase, never by the
28
+ * stream merely ending (a graceful close of a running execution reconnects
29
+ * rather than falsely reporting "complete"). Opt out via `autoReconnect: false`.
17
30
  *
18
31
  * **Performance characteristics:**
19
32
  * - Non-terminal snapshots are coalesced via `requestAnimationFrame`
@@ -84,6 +97,15 @@ export function useExecutionStream(executionId, options) {
84
97
  const streamRate = useStreamRate();
85
98
  const streamRateRef = useRef(streamRate);
86
99
  streamRateRef.current = streamRate;
100
+ // -- Reconnect config (ref-backed so option identity churn never resubscribes)
101
+ const autoReconnect = options?.autoReconnect ?? true;
102
+ const reconnectOptions = options?.reconnectOptions;
103
+ const configRef = useRef({ autoReconnect, reconnectOptions });
104
+ configRef.current = { autoReconnect, reconnectOptions };
105
+ // Tracks the execution the store currently holds, so we reset the store on
106
+ // a genuine identity change (A → B) but preserve it across reconnects of the
107
+ // SAME execution. Mirrors useWorkflowExecutionEventStream / useFetch.
108
+ const prevExecutionIdRef = useRef(null);
87
109
  // -- Subscription effect --------------------------------------------------
88
110
  // Note: controller, store, and streamRate are ref-backed stable objects —
89
111
  // they MUST NOT appear in the deps array. Including them would cause
@@ -92,37 +114,104 @@ export function useExecutionStream(executionId, options) {
92
114
  if (!executionId) {
93
115
  controller.reset();
94
116
  store.reset();
117
+ prevExecutionIdRef.current = null;
95
118
  return;
96
119
  }
120
+ // Reset only when switching to a different execution. Crucially we do NOT
121
+ // reset the store on reconnect (connectKey bump) or on cleanup — that
122
+ // would wipe the conversation to an empty "Connecting…" on every retry.
123
+ // The full-snapshot subscribe re-delivers the entire state on reconnect,
124
+ // so keeping the last-known-good snapshot is both correct and seamless.
125
+ if (prevExecutionIdRef.current !== null &&
126
+ prevExecutionIdRef.current !== executionId) {
127
+ store.reset();
128
+ }
129
+ prevExecutionIdRef.current = executionId;
97
130
  const abortController = new AbortController();
131
+ const signal = abortController.signal;
98
132
  controller.start(executionId);
99
133
  (async () => {
100
- try {
101
- for await (const snapshot of stigmer.agentExecution.subscribe(executionId, abortController.signal)) {
102
- if (abortController.signal.aborted)
134
+ const { autoReconnect: auto, reconnectOptions: backoff } = configRef.current;
135
+ const maxAttempts = backoff?.maxAttempts ?? DEFAULT_RECONNECT_MAX_ATTEMPTS;
136
+ // 1-based count of consecutive failed attempts. Reset to 0 by any
137
+ // successful snapshot, so each healthy stretch gets a fresh backoff
138
+ // budget rather than inheriting the previous outage's attempt count.
139
+ let attempt = 0;
140
+ // Schedule the next retry after `error`, or stop. Returns `true` when
141
+ // the loop should continue (a retry was scheduled), `false` when it
142
+ // should exit (opted out, exhausted, or aborted). Shared by the
143
+ // thrown-error and premature-end paths so both converge on one policy.
144
+ const scheduleRetry = async (error) => {
145
+ if (!auto || attempt >= maxAttempts) {
146
+ controller.handleError(error);
147
+ return false;
148
+ }
149
+ attempt += 1;
150
+ controller.handleReconnecting(attempt, error);
151
+ try {
152
+ await sleep(computeBackoffDelay(attempt, backoff), signal);
153
+ }
154
+ catch {
155
+ return false; // aborted mid-backoff
156
+ }
157
+ return !signal.aborted;
158
+ };
159
+ while (!signal.aborted) {
160
+ let sawTerminal = false;
161
+ try {
162
+ for await (const snapshot of stigmer.agentExecution.subscribe(executionId, signal)) {
163
+ if (signal.aborted)
164
+ return;
165
+ attempt = 0; // a snapshot proves the connection is healthy
166
+ controller.handleSnapshot(snapshot);
167
+ streamRateRef.current.tick(snapshot.status?.messages?.length ?? 0);
168
+ const phase = snapshot.status?.phase ??
169
+ ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED;
170
+ if (isTerminalPhase(phase)) {
171
+ sawTerminal = true;
172
+ break;
173
+ }
174
+ }
175
+ }
176
+ catch (err) {
177
+ if (signal.aborted)
178
+ return;
179
+ const error = toError(err);
180
+ // Only known-transient transport noise is retried. A non-transient
181
+ // error (not-found, invalid-argument, …) is deterministic — the
182
+ // same request would fail identically, so surface it immediately.
183
+ if (!auto || !isTransientStreamError(error)) {
184
+ controller.handleError(error);
103
185
  return;
104
- controller.handleSnapshot(snapshot);
105
- streamRateRef.current.tick(snapshot.status?.messages?.length ?? 0);
106
- const phase = snapshot.status?.phase ??
107
- ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED;
108
- if (isTerminalPhase(phase))
109
- break;
186
+ }
187
+ if (await scheduleRetry(error))
188
+ continue;
189
+ return;
110
190
  }
111
- if (!abortController.signal.aborted) {
191
+ if (signal.aborted)
192
+ return;
193
+ if (sawTerminal) {
194
+ // handleSnapshot already transitioned to `complete`; flush any
195
+ // buffered frame and finish. Completion is decided by the terminal
196
+ // phase, never by the stream merely ending.
112
197
  controller.handleStreamEnd();
113
198
  streamRateRef.current.summary();
114
- }
115
- }
116
- catch (err) {
117
- if (abortController.signal.aborted)
118
199
  return;
119
- controller.handleError(toError(err));
200
+ }
201
+ // The iterator finished without a terminal phase: the server closed a
202
+ // still-running stream (idle timeout, load-balancer recycle, pod
203
+ // restart). This is transient by definition — reconnect and the next
204
+ // full snapshot reconciles whatever changed (including, if it ended
205
+ // meanwhile, the terminal state we missed).
206
+ if (await scheduleRetry(new Error("The connection was interrupted."))) {
207
+ continue;
208
+ }
209
+ return;
120
210
  }
121
211
  })();
122
212
  return () => {
123
213
  abortController.abort();
124
214
  controller.reset();
125
- store.reset();
126
215
  };
127
216
  }, [executionId, stigmer, connectKey]);
128
217
  // -- Read from store via useSyncExternalStore ------------------------------
@@ -132,7 +221,18 @@ export function useExecutionStream(executionId, options) {
132
221
  const phase = useMemo(() => execution?.status?.phase ?? ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED, [execution]);
133
222
  const isStreaming = streamState.stage === "streaming";
134
223
  const isConnecting = streamState.stage === "connecting";
224
+ const isReconnecting = streamState.stage === "reconnecting";
225
+ const reconnectAttempt = streamState.stage === "reconnecting" ? streamState.attempt : 0;
135
226
  const error = streamState.stage === "error" ? streamState.error : null;
136
- return { execution, phase, isStreaming, isConnecting, error, reconnect };
227
+ return {
228
+ execution,
229
+ phase,
230
+ isStreaming,
231
+ isConnecting,
232
+ isReconnecting,
233
+ reconnectAttempt,
234
+ error,
235
+ reconnect,
236
+ };
137
237
  }
138
238
  //# sourceMappingURL=useExecutionStream.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useExecutionStream.js","sourceRoot":"","sources":["../../src/execution/useExecutionStream.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EACL,eAAe,EACf,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,EACR,oBAAoB,GACrB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAC9F,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,gBAAgB,GAEjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAoB,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAgDrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,UAAU,kBAAkB,CAChC,WAA0B,EAC1B,OAAmC;IAEnC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAE7B,4EAA4E;IAC5E,iEAAiE;IACjE,iEAAiE;IACjE,qBAAqB;IACrB,MA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K,KAAK,cAAc,CAAC;IAC5D,MAAM,gBAAgB,GACpB,WAAW,CAAC,KAAK,KAAK,cAAc,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IACjE,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IAEvE,OAAO;QACL,SAAS;QACT,KAAK;QACL,WAAW;QACX,YAAY;QACZ,cAAc;QACd,gBAAgB;QAChB,KAAK;QACL,SAAS;KACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Exponential-backoff scheduling for resilient stream reconnection.
3
+ *
4
+ * Pure and framework-agnostic — the timing math is a plain function and the
5
+ * wait is a cancelable promise, so both are exhaustively unit-testable
6
+ * without React or fake DOM (mirrors the codebase's extract-the-pure-core
7
+ * convention, e.g. `computeFollowCenter` / `isRecoveryTransition`).
8
+ *
9
+ * @internal Not part of the public `@stigmer/react` API.
10
+ */
11
+ /** Tunable backoff schedule. All fields optional — sensible defaults apply. */
12
+ export interface BackoffOptions {
13
+ /** Delay before the first retry, in milliseconds. */
14
+ readonly baseDelayMs?: number;
15
+ /** Upper bound on any single delay, in milliseconds. */
16
+ readonly maxDelayMs?: number;
17
+ /** Multiplier applied per attempt (`base * factor^(attempt-1)`). */
18
+ readonly factor?: number;
19
+ }
20
+ /** Delay before the first reconnect attempt. */
21
+ export declare const DEFAULT_RECONNECT_BASE_DELAY_MS = 1000;
22
+ /** Ceiling for any single reconnect delay. */
23
+ export declare const DEFAULT_RECONNECT_MAX_DELAY_MS = 30000;
24
+ /** Per-attempt growth multiplier. */
25
+ export declare const DEFAULT_RECONNECT_FACTOR = 2;
26
+ /**
27
+ * Attempts before giving up and surfacing a terminal error. With the
28
+ * defaults above this is ≈ several minutes of outage before the user sees
29
+ * an error banner — long enough to ride out sleep/wake and network blips,
30
+ * bounded enough to avoid an unbounded background loop against a stream
31
+ * that will never recover (e.g. a deleted execution).
32
+ */
33
+ export declare const DEFAULT_RECONNECT_MAX_ATTEMPTS = 10;
34
+ /**
35
+ * Compute the backoff delay (ms) for a 1-based reconnect attempt.
36
+ *
37
+ * Exponential growth (`base * factor^(attempt-1)`) capped at `maxDelayMs`,
38
+ * then **full jitter** — a uniform random point in `[0, capped]`. Full
39
+ * jitter (AWS, "Exponential Backoff And Jitter") de-synchronizes a fleet of
40
+ * clients that all dropped at the same instant, preventing a reconnect
41
+ * thundering herd against a recovering server.
42
+ *
43
+ * `random` is injectable purely so tests can assert exact values; callers
44
+ * should omit it.
45
+ */
46
+ export declare function computeBackoffDelay(attempt: number, opts?: BackoffOptions, random?: () => number): number;
47
+ /** Rejection reason for an aborted {@link sleep}, distinguishable by name. */
48
+ export declare class AbortError extends Error {
49
+ constructor();
50
+ }
51
+ /**
52
+ * Promise-based delay that settles after `ms`, or rejects immediately with
53
+ * {@link AbortError} if `signal` is (or becomes) aborted.
54
+ *
55
+ * The timer is cleared and the abort listener removed on every exit path, so
56
+ * a reconnect wait leaves nothing pending when a component unmounts or the
57
+ * subscription is torn down mid-backoff — no leaked timer, no resubscribe
58
+ * after teardown.
59
+ */
60
+ export declare function sleep(ms: number, signal?: AbortSignal): Promise<void>;
61
+ //# sourceMappingURL=backoff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backoff.d.ts","sourceRoot":"","sources":["../../src/internal/backoff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,+EAA+E;AAC/E,MAAM,WAAW,cAAc;IAC7B,qDAAqD;IACrD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,wDAAwD;IACxD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,oEAAoE;IACpE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,gDAAgD;AAChD,eAAO,MAAM,+BAA+B,OAAQ,CAAC;AACrD,8CAA8C;AAC9C,eAAO,MAAM,8BAA8B,QAAS,CAAC;AACrD,qCAAqC;AACrC,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,KAAK,CAAC;AAEjD;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,cAAc,EACrB,MAAM,GAAE,MAAM,MAAoB,GACjC,MAAM,CASR;AAED,8EAA8E;AAC9E,qBAAa,UAAW,SAAQ,KAAK;;CAKpC;AAED;;;;;;;;GAQG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBrE"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Exponential-backoff scheduling for resilient stream reconnection.
3
+ *
4
+ * Pure and framework-agnostic — the timing math is a plain function and the
5
+ * wait is a cancelable promise, so both are exhaustively unit-testable
6
+ * without React or fake DOM (mirrors the codebase's extract-the-pure-core
7
+ * convention, e.g. `computeFollowCenter` / `isRecoveryTransition`).
8
+ *
9
+ * @internal Not part of the public `@stigmer/react` API.
10
+ */
11
+ /** Delay before the first reconnect attempt. */
12
+ export const DEFAULT_RECONNECT_BASE_DELAY_MS = 1_000;
13
+ /** Ceiling for any single reconnect delay. */
14
+ export const DEFAULT_RECONNECT_MAX_DELAY_MS = 30_000;
15
+ /** Per-attempt growth multiplier. */
16
+ export const DEFAULT_RECONNECT_FACTOR = 2;
17
+ /**
18
+ * Attempts before giving up and surfacing a terminal error. With the
19
+ * defaults above this is ≈ several minutes of outage before the user sees
20
+ * an error banner — long enough to ride out sleep/wake and network blips,
21
+ * bounded enough to avoid an unbounded background loop against a stream
22
+ * that will never recover (e.g. a deleted execution).
23
+ */
24
+ export const DEFAULT_RECONNECT_MAX_ATTEMPTS = 10;
25
+ /**
26
+ * Compute the backoff delay (ms) for a 1-based reconnect attempt.
27
+ *
28
+ * Exponential growth (`base * factor^(attempt-1)`) capped at `maxDelayMs`,
29
+ * then **full jitter** — a uniform random point in `[0, capped]`. Full
30
+ * jitter (AWS, "Exponential Backoff And Jitter") de-synchronizes a fleet of
31
+ * clients that all dropped at the same instant, preventing a reconnect
32
+ * thundering herd against a recovering server.
33
+ *
34
+ * `random` is injectable purely so tests can assert exact values; callers
35
+ * should omit it.
36
+ */
37
+ export function computeBackoffDelay(attempt, opts, random = Math.random) {
38
+ const base = opts?.baseDelayMs ?? DEFAULT_RECONNECT_BASE_DELAY_MS;
39
+ const max = opts?.maxDelayMs ?? DEFAULT_RECONNECT_MAX_DELAY_MS;
40
+ const factor = opts?.factor ?? DEFAULT_RECONNECT_FACTOR;
41
+ const safeAttempt = Math.max(1, Math.floor(attempt));
42
+ const exponential = base * factor ** (safeAttempt - 1);
43
+ const capped = Math.min(exponential, max);
44
+ return Math.round(random() * capped);
45
+ }
46
+ /** Rejection reason for an aborted {@link sleep}, distinguishable by name. */
47
+ export class AbortError extends Error {
48
+ constructor() {
49
+ super("The operation was aborted.");
50
+ this.name = "AbortError";
51
+ }
52
+ }
53
+ /**
54
+ * Promise-based delay that settles after `ms`, or rejects immediately with
55
+ * {@link AbortError} if `signal` is (or becomes) aborted.
56
+ *
57
+ * The timer is cleared and the abort listener removed on every exit path, so
58
+ * a reconnect wait leaves nothing pending when a component unmounts or the
59
+ * subscription is torn down mid-backoff — no leaked timer, no resubscribe
60
+ * after teardown.
61
+ */
62
+ export function sleep(ms, signal) {
63
+ return new Promise((resolve, reject) => {
64
+ if (signal?.aborted) {
65
+ reject(new AbortError());
66
+ return;
67
+ }
68
+ const onAbort = () => {
69
+ clearTimeout(timer);
70
+ reject(new AbortError());
71
+ };
72
+ const timer = setTimeout(() => {
73
+ signal?.removeEventListener("abort", onAbort);
74
+ resolve();
75
+ }, ms);
76
+ signal?.addEventListener("abort", onAbort, { once: true });
77
+ });
78
+ }
79
+ //#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AU,KAAK,CAAC,EAAU,EAAE,MAAoB;IACpD,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;YACpB,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC;YACzB,OAAO;QACT,CAAC;QAED,MAAM,OAAO,GAAG,GAAG,EAAE;YACnB,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC;QAC3B,CAAC,CAAC;QAEF,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YAC5B,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC9C,OAAO,EAAE,CAAC;QACZ,CAAC,EAAE,EAAE,CAAC,CAAC;QAEP,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -7,6 +7,18 @@ export type StreamState = {
7
7
  } | {
8
8
  readonly stage: "streaming";
9
9
  readonly executionId: string;
10
+ } | {
11
+ /**
12
+ * A non-terminal stream drop is being retried in the background. The
13
+ * last-known-good snapshot stays visible and no error is surfaced —
14
+ * the public `error` only appears once retries are exhausted. `attempt`
15
+ * is the 1-based retry count; `error` is the transient cause, retained
16
+ * for diagnostics (it is not shown to the user while reconnecting).
17
+ */
18
+ readonly stage: "reconnecting";
19
+ readonly executionId: string;
20
+ readonly attempt: number;
21
+ readonly error: Error;
10
22
  } | {
11
23
  readonly stage: "complete";
12
24
  readonly executionId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-store.d.ts","sourceRoot":"","sources":["../../../src/internal/store/conversation-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6DAA6D,CAAC;AAOlG,MAAM,MAAM,WAAW,G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QAAO,WAAW,CAE9B;IAIF,OAAO,CAAC,OAAO;CAKhB"}
@@ -88,6 +88,13 @@ function streamStateEqual(a, b) {
88
88
  a.executionId === b.executionId &&
89
89
  a.error === b.error)
90
90
  return true;
91
+ // Each retry bumps `attempt`, so two reconnecting states are only equal
92
+ // when the attempt matches — every attempt must re-notify subscribers.
93
+ if (a.stage === "reconnecting" &&
94
+ b.stage === "reconnecting" &&
95
+ a.executionId === b.executionId &&
96
+ a.attempt === b.attempt)
97
+ return true;
91
98
  if ("executionId" in a && "executionId" in b)
92
99
  return a.executionId === b.executionId;
93
100
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-store.js","sourceRoot":"","sources":["../../../src/internal/store/conversation-store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAiBrD,MAAM,UAAU,GAAgB,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAQlD;;;;;;;;;;GAUG;AACH,MAAM,OAAO,iBAAiB;IACpB,UAAU,GAA0B,IAAI,CAAC;IACzC,YAAY,GAAgB,UAAU,CAAC;IACvC,UAAU,GAAG,IAAI,GAAG,EAAY,CAAC;IAEzC,2EAA2E;IAE3E;;;;OAIG;IACH,cAAc,CAAC,QAAwB;QACrC,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC1D,IAAI,MAAM,KAAK,IAAI,CAAC,UAAU;YAAE,OAAO;QACvC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;QACzB,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;IAED;;;OAGG;IACH,cAAc,CAAC,KAAkB;QAC/B,IAAI,gBAAgB,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC;YAAE,OAAO;QACvD,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;IAED;;;OAGG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AC/B,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;QAEnB,OAAO,IAAI,CAAC;IACd,IAAI,aAAa,IAAI,CAAC,IAAI,aAAa,IAAI,CAAC;QAC1C,OAAO,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW,CAAC;IACzC,OAAO,KAAK,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"conversation-store.js","sourceRoot":"","sources":["../../../src/internal/store/conversation-store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AA8BrD,MAAM,UAAU,GAAgB,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAQlD;;;;;;;;;;GAUG;AACH,MAAM,OAAO,iBAAiB;IACpB,UAAU,GAA0B,IAAI,CAAC;IACzC,YAAY,GAAgB,UAAU,CAAC;IACvC,UAAU,GAAG,IAAI,GAAG,EAAY,CAAC;IAEzC,2EAA2E;IAE3E;;;;OAIG;IACH,cAAc,CAAC,QAAwB;QACrC,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC1D,IAAI,MAAM,KAAK,IAAI,CAAC,UAAU;YAAE,OAAO;QACvC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;QACzB,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;IAED;;;OAGG;IACH,cAAc,CAAC,KAAkB;QAC/B,IAAI,gBAAgB,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC;YAAE,OAAO;QACvD,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;IAED;;;OAGG;IACH,KAAK;QACH,MAAM,OAAO,GACX,IAAI,CAAC,UAAU,KAAK,IAAI,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,KAAK,MAAM,CAAC;QACjE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QAC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AAK,KAAK,cAAc;QAC1B,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW;QAC/B,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO;QAEvB,OAAO,IAAI,CAAC;IACd,IAAI,aAAa,IAAI,CAAC,IAAI,aAAa,IAAI,CAAC;QAC1C,OAAO,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW,CAAC;IACzC,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -8,6 +8,18 @@ export type WorkflowEventStreamState = {
8
8
  } | {
9
9
  readonly stage: "streaming";
10
10
  readonly executionId: string;
11
+ } | {
12
+ /**
13
+ * A non-terminal event stream drop is being retried in the background.
14
+ * Accumulated events stay visible and no error is surfaced until retries
15
+ * are exhausted. On reconnect the subscription resumes from the last
16
+ * received `sequence_number`, so no events are lost. `attempt` is the
17
+ * 1-based retry count; `error` is the transient cause (diagnostic only).
18
+ */
19
+ readonly stage: "reconnecting";
20
+ readonly executionId: string;
21
+ readonly attempt: number;
22
+ readonly error: Error;
11
23
  } | {
12
24
  readonly stage: "complete";
13
25
  readonly executionId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-execution-event-store.d.ts","sourceRoot":"","sources":["../../../src/internal/store/workflow-execution-event-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kEAAkE,CAAC;AAE/G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAM/F,MAAM,MAAM,wBAAwB,GAChC;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC1B;IAAE,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAC9D;IAAE,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAC7D;IAAE,QAAQ,CAAC,KAA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AAiB,EAAE,OAAO,CAAC;CACrC;AAiBD,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC;AAE3B;;;;;;;;;;GAUG;AACH,qBAAa,2BAA2B;IACtC,OAAO,CAAC,OAAO,CAAyC;IACxD,OAAO,CAAC,YAAY,CAAwC;IAC5D,OAAO,CAAC,UAAU,CAAuB;IAEzC,OAAO,CAAC,gBAAgB,CAAsD;IAC9E,OAAO,CAAC,iBAAiB,CAAmC;IAC5D,OAAO,CAAC,WAAW,CAAK;IAIxB;;;;OAIG;IACH,YAAY,CAAC,MAAM,EAAE,SAAS,sBAAsB,EAAE,GAAG,IAAI;IAgC7D;;OAEG;IACH,cAAc,CAAC,KAAK,EAAE,wBAAwB,GAAG,IAAI;IAMrD;;OAEG;IACH,KAAK,IAAI,IAAI;IAab,SAAS,GAAI,UAAU,QAAQ,KAAG,CAAC,MAAM,IAAI,CAAC,CAK5C;IAEF,SAAS,QAAO,SAAS,sBAAsB,EAAE,CAE/C;IAEF,cAAc,QAAO,wBAAwB,CAE3C;IAEF,iBAAiB,QAAO,MAAM,CAG5B;IAEF,aAAa,QAAO,MAAM,CAExB;IAEF;;;;OAIG;IACH,aAAa,QAAO,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAIvD;IAEF;;;OAGG;IACH,cAAc,QAAO,kBAAkB,CAIrC;IAIF,OAAO,CAAC,OAAO;CAKhB"}
1
+ {"version":3,"file":"workflow-execution-event-store.d.ts","sourceRoot":"","sources":["../../../src/internal/store/workflow-execution-event-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kEAAkE,CAAC;AAE/G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAM/F,MAAM,MAAM,wBAAwB,GAChC;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC1B;IAAE,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,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323,6 +323,13 @@ function streamStateEqual(a, b) {
323
323
  a.executionId === b.executionId &&
324
324
  a.error === b.error)
325
325
  return true;
326
+ // Each retry bumps `attempt`, so two reconnecting states are only equal
327
+ // when the attempt matches — every attempt must re-notify subscribers.
328
+ if (a.stage === "reconnecting" &&
329
+ b.stage === "reconnecting" &&
330
+ a.executionId === b.executionId &&
331
+ a.attempt === b.attempt)
332
+ return true;
326
333
  if ("executionId" in a && "executionId" in b)
327
334
  return a.executionId === b.executionId;
328
335
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-execution-event-store.js","sourceRoot":"","sources":["../../../src/internal/store/workflow-execution-event-store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kEAAkE,CAAC;AAmBrG,MAAM,UAAU,GAA6B,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AA8B/D,MAAM,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAC9B,MAAM,cAAc,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAElC,MAAM,kBAAkB,GAAuB;IAC7C,kBAAkB,EAAE,WAAW;IAC/B,mBAAmB,EAAE,cAAc;IACnC,cAAc,EAAE,WAAW;IAC3B,eAAe,EAAE,cAAc;IAC/B,iBAAiB,EAAE,KAAK;CACzB,CAAC;AAQF;;;;;;;;;;GAUG;AACH,MAAM,OAAO,2BAA2B;IAC9B,OAAO,GAAsC,EAAE,CAAC;IAChD,YAAY,GAA6B,UAAU,CAAC;IACpD,UAAU,GAAG,IAAI,GAAG,EAAY,CAAC;IAEjC,gBAAgB,GAAiD,IAAI,CAAC;IACtE,iBAAiB,GAA8B,IAAI,CAAC;IACpD,WAAW,GAAG,CAAC,CAAC;IAExB,2EAA2E;IAE3E;;;;OAIG;IACH,YAAY,CAAC,MAAyC;QACpD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QAEhC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,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,IACE,CAAC,CAAC,KAAK,KAAK,OAAO;QACnB,CAAC,CAAC,KAAK,KAAK,OAAO;QACnB,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW;QAC/B,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;QAEnB,OAAO,IAAI,CAAC;IACd,IAAI,aAAa,IAAI,CAAC,IAAI,aAAa,IAAI,CAAC;QAC1C,OAAO,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW,CAAC;IACzC,OAAO,KAAK,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"workflow-execution-event-store.js","sourceRoot":"","sources":["../../../src/internal/store/workflow-execution-event-store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kEAAkE,CAAC;AAgCrG,MAAM,UAAU,GAA6B,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AA8B/D,MAAM,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAC9B,MAAM,cAAc,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAElC,MAAM,kBAAkB,GAAuB;IAC7C,kBAAkB,EAAE,WAAW;IAC/B,mBAAmB,EAAE,cAAc;IACnC,cAAc,EAAE,WAAW;IAC3B,eAAe,EAAE,cAAc;IAC/B,iBAAiB,EAAE,KAAK;CACzB,CAAC;AAQF;;;;;;;;;;GAUG;AACH,MAAM,OAAO,2BAA2B;IAC9B,OAAO,GAAsC,EAAE,CAAC;IAChD,YAAY,GAA6B,UAAU,CAAC;IACpD,UAAU,GAAG,IAAI,GAAG,EAAY,CAAC;IAEjC,gBAAgB,GAAiD,IAAI,CAAC;IACtE,iBAAiB,GAA8B,IAAI,CAAC;IACpD,WAAW,GAAG,CAAC,CAAC;IAExB,2EAA2E;IAE3E;;;;OAIG;IACH,YAAY,CAAC,MAAyC;QACpD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QAEhC,MAAM,UAAU,GAAG,I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