Skip to content

Commit bf5c64b

Browse files
committed
feat(sdk): add onChatSuspend/onChatResume hooks, exitAfterPreloadIdle, chat.withClientData, and ChatBuilder
1 parent 67d563f commit bf5c64b

File tree

4 files changed

+560
-32
lines changed

4 files changed

+560
-32
lines changed

packages/core/src/v3/realtimeStreams/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,12 @@ export type InputStreamWaitWithIdleTimeoutOptions = {
264264
timeout?: string;
265265
/** Override the default span name for the outer operation. */
266266
spanName?: string;
267+
/** Called right before suspending (after idle phase times out). Not called if data arrives during idle. */
268+
onSuspend?: () => void | Promise<void>;
269+
/** Called right after resuming from suspension with data. Not called if data arrived during idle or on timeout. */
270+
onResume?: () => void | Promise<void>;
271+
/** When true, skip the suspend phase entirely. If idle times out, return `{ ok: false }` immediately. */
272+
skipSuspend?: boolean;
267273
};
268274

269275
export type InferInputStreamType<T> = T extends RealtimeDefinedInputStream<infer TData>

0 commit comments

Comments
 (0)