@reactor-models/h3-reference-to-video-turbo-realtime 0.3.0

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.
@@ -0,0 +1,621 @@
1
+ import { FileRef, Reactor } from '@reactor-team/js-sdk';
2
+ export { FileRef } from '@reactor-team/js-sdk';
3
+
4
+ declare const MODEL_NAME: "reactor/h3-reference-to-video-turbo-realtime";
5
+ declare const MODEL_VERSION: "v0.3.0";
6
+ /**
7
+ * Preset media tracks for the H3ReferenceToVideoTurboRealtime model.
8
+ *
9
+ * Declared in the model's OpenAPI schema and passed to the SDK as
10
+ * `modelTracks` so the transport can prepare the SDP offer in
11
+ * parallel with session polling (faster first-frame latency).
12
+ */
13
+ declare const H3ReferenceToVideoTurboRealtimeTracks: readonly [{
14
+ readonly name: "main_video";
15
+ readonly kind: "video";
16
+ readonly direction: "recvonly";
17
+ }, {
18
+ readonly name: "main_audio";
19
+ readonly kind: "audio";
20
+ readonly direction: "recvonly";
21
+ }];
22
+ /** Track names the client can subscribe to (recvonly, from the client's perspective). */
23
+ type H3ReferenceToVideoTurboRealtimeRecvTrackName = "main_video" | "main_audio";
24
+ /** Remove a clip from its queue; reply clip_popped and emit queue_update and state_update. A running build finishes but is discarded. Refuses with command_error for a missing/unknown id. Use stop for the playing clip. */
25
+ interface H3ReferenceToVideoTurboRealtimePopParams {
26
+ /**
27
+ * UUID of the clip to remove from either queue.
28
+ * @default ""
29
+ */
30
+ clip_id?: string;
31
+ }
32
+ /** Reposition within the current queue, 0 = front. A running build is unaffected. Replies clip_moved and emits queue_update; refuses with command_error for a missing/unknown id or invalid position. */
33
+ interface H3ReferenceToVideoTurboRealtimeMoveParams {
34
+ /**
35
+ * UUID of a queued clip.
36
+ * @default ""
37
+ */
38
+ clip_id?: string;
39
+ /**
40
+ * Position in its current queue; past the end appends.
41
+ * @minimum 0
42
+ * @default 0
43
+ */
44
+ position?: number;
45
+ }
46
+ /** Play the front ready clip, or a named ready clip. Consumes it and emits clip_started, queue_update and state_update. Refuses with command_error if already playing or no matching ready clip exists. */
47
+ interface H3ReferenceToVideoTurboRealtimePlayParams {
48
+ /**
49
+ * UUID of a ready clip; blank takes the playout front.
50
+ * @default ""
51
+ */
52
+ clip_id?: string;
53
+ }
54
+ /** Queue a clip with 1–9 reference images at position, or at the back. Each clip keeps its own prompt and ordered references: new images do not alter earlier requests. The images guide appearance, not a fixed first or last frame. Replies clip_queued and broadcasts queue_update and state_update; completion emits clip_generated. Refuses with command_error for empty text, missing/invalid reference, invalid parameters or a full generation queue. */
55
+ interface H3ReferenceToVideoTurboRealtimeEnqueueParams {
56
+ /**
57
+ * Omitted or null uses and advances the default seed. An explicit seed leaves the default unchanged.
58
+ * @minimum 0
59
+ * @default null
60
+ */
61
+ seed?: number | null;
62
+ /**
63
+ * What the clip should show and sound like; stored unchanged and never truncated. A prompt past the model's text budget fails the clip with clip_failed instead.
64
+ * @default ""
65
+ */
66
+ prompt?: string;
67
+ /**
68
+ * Requested duration between 5 and 15.084 seconds, rounded to frames then aligned upward to a supported length. Actual output ranges from 5.167 to 15.083 seconds. Null uses the session default.
69
+ * @minimum 5
70
+ * @maximum 15.084
71
+ * @default null
72
+ */
73
+ seconds?: number | null;
74
+ /**
75
+ * Opaque client string, up to 2000 characters, echoed unchanged with the clip.
76
+ * @maxLength 2000
77
+ * @default ""
78
+ */
79
+ metadata?: string;
80
+ /**
81
+ * Generation queue position: 0 is the next build; omitted or past the end appends. The running build is unaffected.
82
+ * @minimum 0
83
+ * @default null
84
+ */
85
+ position?: number | null;
86
+ /**
87
+ * One JPEG, PNG or WebP reference for this clip. Guides subjects and appearance, not a keyframe. Supply this or reference_images, not both.
88
+ * @default null
89
+ */
90
+ reference_image?: FileRef | null;
91
+ /**
92
+ * Ordered list of 1–9 uploaded JPEG, PNG or WebP references. In the prompt, Picture 1 names the first image, Picture 2 the second, and so on. Supply this or reference_image, not both. Each clip retains its own list, including while other clips build or play.
93
+ * @default null
94
+ */
95
+ reference_images?: FileRef[] | null;
96
+ /**
97
+ * UUID of a generated clip to continue temporally from: this clip's motion, camera and audio carry across the boundary while its own references still drive appearance. Blank for an independent clip. The source must have finished generating; unknown or dropped ids fall back to an independent clip.
98
+ * @default ""
99
+ */
100
+ continue_from_clip_id?: string;
101
+ }
102
+ /** Set the advancing default seed for future enqueues. Replies seed_accepted and emits state_update; an invalid seed emits command_error. Explicit per-clip seeds do not advance it. */
103
+ interface H3ReferenceToVideoTurboRealtimeSetSeedParams {
104
+ /**
105
+ * Nonnegative default seed; queued clips keep their seeds.
106
+ * @minimum 0
107
+ * @default 1000
108
+ */
109
+ seed?: number;
110
+ }
111
+ /** Set the canvas while both queues and playback are empty. Replies canvas_accepted and emits state_update; refuses with command_error for an unsupported aspect or nonempty session. */
112
+ interface H3ReferenceToVideoTurboRealtimeSetCanvasParams {
113
+ /**
114
+ * Choose 16:9 (1344x768), 1:1 (768x768), 9:16 (768x1344), or 4:3 (1024x768).
115
+ * @default "16:9"
116
+ */
117
+ aspect?: "16:9" | "1:1" | "9:16" | "4:3";
118
+ }
119
+ /** Automatically play ready clips whenever idle. Empty queues wait; no prompts are generated automatically. Replies autoplay_accepted and emits state_update. */
120
+ interface H3ReferenceToVideoTurboRealtimeSetAutoplayParams {
121
+ /**
122
+ * True plays the ready queue; false waits for play after each clip.
123
+ * @default false
124
+ */
125
+ enabled?: boolean;
126
+ }
127
+ /** Set the duration for future enqueues, aligned to a supported frame count. Replies clip_length_accepted and emits state_update; invalid lengths emit command_error. Queued clips keep their lengths. */
128
+ interface H3ReferenceToVideoTurboRealtimeSetClipSecondsParams {
129
+ /**
130
+ * Requested duration between 5 and 15.084 seconds, rounded to frames then aligned upward to a supported length. The reply reports actual duration and frame count.
131
+ * @minimum 5
132
+ * @maximum 15.084
133
+ * @default 15
134
+ */
135
+ seconds?: number;
136
+ }
137
+ /** Choose black or a held last frame at boundaries. Off carries the playback clock across ready autoplay clips without flushing. Does not guarantee visual continuity; reset always clears tracks. Replies flush_accepted and emits state_update. */
138
+ interface H3ReferenceToVideoTurboRealtimeSetFlushOnClipEndParams {
139
+ /**
140
+ * True flushes to black; false holds the last frame and avoids flushing between autoplay clips.
141
+ * @default true
142
+ */
143
+ enabled?: boolean;
144
+ }
145
+ /** Emitted as the correlated reply when move changes queue order. */
146
+ interface H3ReferenceToVideoTurboRealtimeClipMovedMessage {
147
+ type: "clip_moved";
148
+ /** Repositioned clip. */
149
+ clip: {
150
+ "seed": number;
151
+ "ready": boolean;
152
+ "frames": number;
153
+ "prompt": string;
154
+ "clip_id": string;
155
+ "seconds": number;
156
+ "metadata": string;
157
+ "has_reference_image"?: boolean;
158
+ "reference_image_count"?: number;
159
+ };
160
+ /** Queue containing the clip: generation or playout. */
161
+ queue: string;
162
+ /** Resulting position, 0 = front. */
163
+ position: number;
164
+ }
165
+ /** Emitted when generation fails; the clip is removed and the queue moves on. */
166
+ interface H3ReferenceToVideoTurboRealtimeClipFailedMessage {
167
+ type: "clip_failed";
168
+ /** Failed clip. */
169
+ clip: {
170
+ "seed": number;
171
+ "ready": boolean;
172
+ "frames": number;
173
+ "prompt": string;
174
+ "clip_id": string;
175
+ "seconds": number;
176
+ "metadata": string;
177
+ "has_reference_image"?: boolean;
178
+ "reference_image_count"?: number;
179
+ };
180
+ /** Why generation failed. */
181
+ reason: string;
182
+ }
183
+ /** Emitted as the correlated reply when pop removes a queued clip. */
184
+ interface H3ReferenceToVideoTurboRealtimeClipPoppedMessage {
185
+ type: "clip_popped";
186
+ /** Removed clip; an in-flight result will be discarded. */
187
+ clip: {
188
+ "seed": number;
189
+ "ready": boolean;
190
+ "frames": number;
191
+ "prompt": string;
192
+ "clip_id": string;
193
+ "seconds": number;
194
+ "metadata": string;
195
+ "has_reference_image"?: boolean;
196
+ "reference_image_count"?: number;
197
+ };
198
+ }
199
+ /** Emitted as the correlated reply when enqueue accepts a clip. */
200
+ interface H3ReferenceToVideoTurboRealtimeClipQueuedMessage {
201
+ type: "clip_queued";
202
+ /** Accepted clip, including its UUID; ready is false. */
203
+ clip: {
204
+ "seed": number;
205
+ "ready": boolean;
206
+ "frames": number;
207
+ "prompt": string;
208
+ "clip_id": string;
209
+ "seconds": number;
210
+ "metadata": string;
211
+ "has_reference_image"?: boolean;
212
+ "reference_image_count"?: number;
213
+ };
214
+ }
215
+ /** Emitted when a clip starts sending to the output tracks. */
216
+ interface H3ReferenceToVideoTurboRealtimeClipStartedMessage {
217
+ type: "clip_started";
218
+ /** Clip now playing. */
219
+ clip: {
220
+ "seed": number;
221
+ "ready": boolean;
222
+ "frames": number;
223
+ "prompt": string;
224
+ "clip_id": string;
225
+ "seconds": number;
226
+ "metadata": string;
227
+ "has_reference_image"?: boolean;
228
+ "reference_image_count"?: number;
229
+ };
230
+ }
231
+ /** Emitted when stop or reset cuts a clip; it cannot be resumed. */
232
+ interface H3ReferenceToVideoTurboRealtimeClipStoppedMessage {
233
+ type: "clip_stopped";
234
+ /** Interrupted clip. */
235
+ clip: {
236
+ "seed": number;
237
+ "ready": boolean;
238
+ "frames": number;
239
+ "prompt": string;
240
+ "clip_id": string;
241
+ "seconds": number;
242
+ "metadata": string;
243
+ "has_reference_image"?: boolean;
244
+ "reference_image_count"?: number;
245
+ };
246
+ /** Total seconds sent in the session. */
247
+ seconds_sent: number;
248
+ }
249
+ /** Emitted on connect and queue changes; also answers get_queue. */
250
+ interface H3ReferenceToVideoTurboRealtimeQueueUpdateMessage {
251
+ type: "queue_update";
252
+ /** Always empty: a played clip is not listed here and cannot be replayed. To continue from a generated clip, pass its clip_id as `enqueue.continue_from_clip_id`. */
253
+ history: {
254
+ "seed": number;
255
+ "ready": boolean;
256
+ "frames": number;
257
+ "prompt": string;
258
+ "clip_id": string;
259
+ "seconds": number;
260
+ "metadata": string;
261
+ "has_reference_image"?: boolean;
262
+ "reference_image_count"?: number;
263
+ }[];
264
+ /** Built clips ready to play, front first. */
265
+ playout: {
266
+ "seed": number;
267
+ "ready": boolean;
268
+ "frames": number;
269
+ "prompt": string;
270
+ "clip_id": string;
271
+ "seconds": number;
272
+ "metadata": string;
273
+ "has_reference_image"?: boolean;
274
+ "reference_image_count"?: number;
275
+ }[];
276
+ /** Waiting/in-flight builds, front first. */
277
+ generation: {
278
+ "seed": number;
279
+ "ready": boolean;
280
+ "frames": number;
281
+ "prompt": string;
282
+ "clip_id": string;
283
+ "seconds": number;
284
+ "metadata": string;
285
+ "has_reference_image"?: boolean;
286
+ "reference_image_count"?: number;
287
+ }[];
288
+ }
289
+ /** Emitted on connect and after session state changes; also answers get_state. */
290
+ interface H3ReferenceToVideoTurboRealtimeStateUpdateMessage {
291
+ type: "state_update";
292
+ /** Next automatically assigned seed. */
293
+ seed: number;
294
+ /** Output video width in pixels. */
295
+ width: number;
296
+ /** Session aspect ratio. */
297
+ aspect: string;
298
+ /** Output video height in pixels. */
299
+ height: number;
300
+ /** A clip is armed or playing on the output tracks. */
301
+ playing: boolean;
302
+ /** Ready clips start automatically when idle. */
303
+ autoplay: boolean;
304
+ /** Actual duration used by enqueues without their own seconds. */
305
+ clip_seconds: number;
306
+ /** Clips finished or stopped during this session. */
307
+ clips_played: number;
308
+ /** Seconds sent on the tracks during this session. */
309
+ seconds_sent: number;
310
+ /** Ready clips waiting to play. */
311
+ playout_queued: number;
312
+ /** Commands permitted by current queue/playback state; their arguments still need validation. */
313
+ valid_commands: string[];
314
+ /** Playing clip UUID, or null when idle. */
315
+ playing_clip_id: string | null;
316
+ /** Maximum accepted requested duration. */
317
+ clip_seconds_max: number;
318
+ /** Minimum accepted requested duration. */
319
+ clip_seconds_min: number;
320
+ /** Maximum ready queue size; building pauses while full. */
321
+ playout_capacity: number;
322
+ /** True flushes to black at boundaries; false holds the last frame and avoids flushing between ready autoplay clips. */
323
+ flush_on_clip_end: boolean;
324
+ /** Clips in the generation queue, including the running build. */
325
+ generation_queued: number;
326
+ /** Maximum generation queue size. */
327
+ generation_capacity: number;
328
+ }
329
+ /** Emitted when all frames and synchronized audio have been sent. */
330
+ interface H3ReferenceToVideoTurboRealtimeClipFinishedMessage {
331
+ type: "clip_finished";
332
+ /** Completed clip. */
333
+ clip: {
334
+ "seed": number;
335
+ "ready": boolean;
336
+ "frames": number;
337
+ "prompt": string;
338
+ "clip_id": string;
339
+ "seconds": number;
340
+ "metadata": string;
341
+ "has_reference_image"?: boolean;
342
+ "reference_image_count"?: number;
343
+ };
344
+ /** Total seconds sent in the session, including this clip. */
345
+ seconds_sent: number;
346
+ }
347
+ /** Emitted when a command is refused without changing the queue/defaults. */
348
+ interface H3ReferenceToVideoTurboRealtimeCommandErrorMessage {
349
+ type: "command_error";
350
+ /** Why the command was refused. */
351
+ reason: string;
352
+ /** Refused command name. */
353
+ command: string;
354
+ }
355
+ /** Emitted as the correlated reply when set_seed is accepted. */
356
+ interface H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage {
357
+ type: "seed_accepted";
358
+ /** Next automatically assigned seed. */
359
+ seed: number;
360
+ }
361
+ /** Emitted as the correlated reply when reset clears the playlist and defaults. */
362
+ interface H3ReferenceToVideoTurboRealtimeSessionResetMessage {
363
+ type: "session_reset";
364
+ /** Whether reset cut an armed or playing clip. */
365
+ was_playing: boolean;
366
+ /** Clips removed from both queues, excluding the playing clip. */
367
+ cleared_clips: number;
368
+ }
369
+ /** Emitted when a build enters the playout queue. */
370
+ interface H3ReferenceToVideoTurboRealtimeClipGeneratedMessage {
371
+ type: "clip_generated";
372
+ /** Built clip, ready to play. */
373
+ clip: {
374
+ "seed": number;
375
+ "ready": boolean;
376
+ "frames": number;
377
+ "prompt": string;
378
+ "clip_id": string;
379
+ "seconds": number;
380
+ "metadata": string;
381
+ "has_reference_image"?: boolean;
382
+ "reference_image_count"?: number;
383
+ };
384
+ }
385
+ /** Emitted as the correlated reply when set_flush_on_clip_end is accepted. */
386
+ interface H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage {
387
+ type: "flush_accepted";
388
+ /** Whether clip boundaries flush the output to black. */
389
+ enabled: boolean;
390
+ }
391
+ /** Emitted as the correlated reply when set_canvas is accepted. */
392
+ interface H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage {
393
+ type: "canvas_accepted";
394
+ /** Video width in pixels. */
395
+ width: number;
396
+ /** Accepted aspect ratio. */
397
+ aspect: string;
398
+ /** Video height in pixels. */
399
+ height: number;
400
+ }
401
+ /** Emitted as the correlated reply when set_autoplay is accepted. */
402
+ interface H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage {
403
+ type: "autoplay_accepted";
404
+ /** Whether ready clips start automatically. */
405
+ enabled: boolean;
406
+ }
407
+ /** Emitted as the correlated reply when set_clip_seconds is accepted. */
408
+ interface H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage {
409
+ type: "clip_length_accepted";
410
+ /** Effective default frame count. */
411
+ frames: number;
412
+ /** Effective default duration, in seconds. */
413
+ clip_seconds: number;
414
+ }
415
+ type H3ReferenceToVideoTurboRealtimeMessage = H3ReferenceToVideoTurboRealtimeClipMovedMessage | H3ReferenceToVideoTurboRealtimeClipFailedMessage | H3ReferenceToVideoTurboRealtimeClipPoppedMessage | H3ReferenceToVideoTurboRealtimeClipQueuedMessage | H3ReferenceToVideoTurboRealtimeClipStartedMessage | H3ReferenceToVideoTurboRealtimeClipStoppedMessage | H3ReferenceToVideoTurboRealtimeQueueUpdateMessage | H3ReferenceToVideoTurboRealtimeStateUpdateMessage | H3ReferenceToVideoTurboRealtimeClipFinishedMessage | H3ReferenceToVideoTurboRealtimeCommandErrorMessage | H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage | H3ReferenceToVideoTurboRealtimeSessionResetMessage | H3ReferenceToVideoTurboRealtimeClipGeneratedMessage | H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage | H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage | H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage | H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage;
416
+ /**
417
+ * Options for creating a H3ReferenceToVideoTurboRealtimeModel (model name is set automatically).
418
+ *
419
+ * Derived from `Reactor`'s own constructor options with `modelName`
420
+ * and `modelTracks` removed — those are supplied by this class.
421
+ * Any new option the SDK adds appears here automatically on the
422
+ * next `defaultSdkVersion` bump.
423
+ */
424
+ type H3ReferenceToVideoTurboRealtimeOptions = Omit<ConstructorParameters<typeof Reactor>[0], "modelName" | "modelTracks">;
425
+ /**
426
+ * Strongly-typed client for the H3ReferenceToVideoTurboRealtime model.
427
+ *
428
+ * Extends {@link Reactor} with the model name (and modelTracks) baked into the
429
+ * constructor, so every public method on Reactor — `connect`, `disconnect`,
430
+ * `sendCommand`, `on`/`off`, `getStats`, `publishTrack`/`unpublishTrack`,
431
+ * etc. — is reachable directly on the instance. The schema-derived sugar
432
+ * below adds typed wrappers for every declared event, message, and track.
433
+ */
434
+ declare class H3ReferenceToVideoTurboRealtimeModel extends Reactor {
435
+ constructor(options?: H3ReferenceToVideoTurboRealtimeOptions);
436
+ /** @deprecated The model client now extends `Reactor` directly — call methods on `this` instead. This accessor returns `this` for backwards compatibility and will be removed in a future major release. */
437
+ get reactor(): this;
438
+ /**
439
+ * Remove a clip from its queue; reply clip_popped and emit queue_update and state_update. A running build finishes but is discarded. Refuses with command_error for a missing/unknown id. Use stop for the playing clip.
440
+ * @param params - Remove a clip from its queue; reply clip_popped and emit queue_update and state_update. A running build finishes but is discarded. Refuses with command_error for a missing/unknown id. Use stop for the playing clip.
441
+ * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeClipPoppedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
442
+ */
443
+ pop(params: H3ReferenceToVideoTurboRealtimePopParams): Promise<H3ReferenceToVideoTurboRealtimeClipPoppedMessage | undefined>;
444
+ /**
445
+ * Reposition within the current queue, 0 = front. A running build is unaffected. Replies clip_moved and emits queue_update; refuses with command_error for a missing/unknown id or invalid position.
446
+ * @param params - Reposition within the current queue, 0 = front. A running build is unaffected. Replies clip_moved and emits queue_update; refuses with command_error for a missing/unknown id or invalid position.
447
+ * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeClipMovedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
448
+ */
449
+ move(params: H3ReferenceToVideoTurboRealtimeMoveParams): Promise<H3ReferenceToVideoTurboRealtimeClipMovedMessage | undefined>;
450
+ /**
451
+ * Play the front ready clip, or a named ready clip. Consumes it and emits clip_started, queue_update and state_update. Refuses with command_error if already playing or no matching ready clip exists.
452
+ * @param params - Play the front ready clip, or a named ready clip. Consumes it and emits clip_started, queue_update and state_update. Refuses with command_error if already playing or no matching ready clip exists.
453
+ * @returns Resolves once the model's handler has completed; this command declares no reply payload.
454
+ */
455
+ play(params: H3ReferenceToVideoTurboRealtimePlayParams): Promise<undefined>;
456
+ /**
457
+ * Cut playback and emit clip_stopped and state_update; queues are untouched. Under autoplay this skips to the next clip. Refuses with command_error when nothing is playing.
458
+ * @returns Resolves once the model's handler has completed; this command declares no reply payload.
459
+ */
460
+ stop(): Promise<undefined>;
461
+ /**
462
+ * Drop both queues, cut playback, restore defaults and clear tracks. Replies session_reset; emits queue_update, state_update and clip_stopped if playing. In-flight results are discarded.
463
+ * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeSessionResetMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
464
+ */
465
+ reset(): Promise<H3ReferenceToVideoTurboRealtimeSessionResetMessage | undefined>;
466
+ /**
467
+ * Queue a clip with 1–9 reference images at position, or at the back. Each clip keeps its own prompt and ordered references: new images do not alter earlier requests. The images guide appearance, not a fixed first or last frame. Replies clip_queued and broadcasts queue_update and state_update; completion emits clip_generated. Refuses with command_error for empty text, missing/invalid reference, invalid parameters or a full generation queue.
468
+ * @param params - Queue a clip with 1–9 reference images at position, or at the back. Each clip keeps its own prompt and ordered references: new images do not alter earlier requests. The images guide appearance, not a fixed first or last frame. Replies clip_queued and broadcasts queue_update and state_update; completion emits clip_generated. Refuses with command_error for empty text, missing/invalid reference, invalid parameters or a full generation queue.
469
+ * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeClipQueuedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
470
+ */
471
+ enqueue(params: H3ReferenceToVideoTurboRealtimeEnqueueParams): Promise<H3ReferenceToVideoTurboRealtimeClipQueuedMessage | undefined>;
472
+ /**
473
+ * Set the advancing default seed for future enqueues. Replies seed_accepted and emits state_update; an invalid seed emits command_error. Explicit per-clip seeds do not advance it.
474
+ * @param params - Set the advancing default seed for future enqueues. Replies seed_accepted and emits state_update; an invalid seed emits command_error. Explicit per-clip seeds do not advance it.
475
+ * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
476
+ */
477
+ setSeed(params: H3ReferenceToVideoTurboRealtimeSetSeedParams): Promise<H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage | undefined>;
478
+ /**
479
+ * Reply queue_update with both queues in full. The history field is always empty: a played clip is not listed and cannot be replayed, though a generated clip can still seed a new one through `enqueue.continue_from_clip_id`. Valid at any time.
480
+ * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeQueueUpdateMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
481
+ */
482
+ getQueue(): Promise<H3ReferenceToVideoTurboRealtimeQueueUpdateMessage | undefined>;
483
+ /**
484
+ * Reply state_update with defaults, capacities, playback progress and valid_commands. Valid at any time.
485
+ * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeStateUpdateMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
486
+ */
487
+ getState(): Promise<H3ReferenceToVideoTurboRealtimeStateUpdateMessage | undefined>;
488
+ /**
489
+ * Set the canvas while both queues and playback are empty. Replies canvas_accepted and emits state_update; refuses with command_error for an unsupported aspect or nonempty session.
490
+ * @param params - Set the canvas while both queues and playback are empty. Replies canvas_accepted and emits state_update; refuses with command_error for an unsupported aspect or nonempty session.
491
+ * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
492
+ */
493
+ setCanvas(params: H3ReferenceToVideoTurboRealtimeSetCanvasParams): Promise<H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage | undefined>;
494
+ /**
495
+ * Automatically play ready clips whenever idle. Empty queues wait; no prompts are generated automatically. Replies autoplay_accepted and emits state_update.
496
+ * @param params - Automatically play ready clips whenever idle. Empty queues wait; no prompts are generated automatically. Replies autoplay_accepted and emits state_update.
497
+ * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
498
+ */
499
+ setAutoplay(params: H3ReferenceToVideoTurboRealtimeSetAutoplayParams): Promise<H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage | undefined>;
500
+ /**
501
+ * Set the duration for future enqueues, aligned to a supported frame count. Replies clip_length_accepted and emits state_update; invalid lengths emit command_error. Queued clips keep their lengths.
502
+ * @param params - Set the duration for future enqueues, aligned to a supported frame count. Replies clip_length_accepted and emits state_update; invalid lengths emit command_error. Queued clips keep their lengths.
503
+ * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
504
+ */
505
+ setClipSeconds(params: H3ReferenceToVideoTurboRealtimeSetClipSecondsParams): Promise<H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage | undefined>;
506
+ /**
507
+ * Choose black or a held last frame at boundaries. Off carries the playback clock across ready autoplay clips without flushing. Does not guarantee visual continuity; reset always clears tracks. Replies flush_accepted and emits state_update.
508
+ * @param params - Choose black or a held last frame at boundaries. Off carries the playback clock across ready autoplay clips without flushing. Does not guarantee visual continuity; reset always clears tracks. Replies flush_accepted and emits state_update.
509
+ * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
510
+ */
511
+ setFlushOnClipEnd(params: H3ReferenceToVideoTurboRealtimeSetFlushOnClipEndParams): Promise<H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage | undefined>;
512
+ /**
513
+ * Subscribe to typed model messages.
514
+ * @param handler - Called with a discriminated H3ReferenceToVideoTurboRealtimeMessage
515
+ * @returns Unsubscribe function
516
+ */
517
+ onMessage(handler: (message: H3ReferenceToVideoTurboRealtimeMessage) => void): () => void;
518
+ /**
519
+ * Subscribe to "clip_moved" messages only.
520
+ * @returns Unsubscribe function
521
+ */
522
+ onClipMoved(handler: (message: H3ReferenceToVideoTurboRealtimeClipMovedMessage) => void): () => void;
523
+ /**
524
+ * Subscribe to "clip_failed" messages only.
525
+ * @returns Unsubscribe function
526
+ */
527
+ onClipFailed(handler: (message: H3ReferenceToVideoTurboRealtimeClipFailedMessage) => void): () => void;
528
+ /**
529
+ * Subscribe to "clip_popped" messages only.
530
+ * @returns Unsubscribe function
531
+ */
532
+ onClipPopped(handler: (message: H3ReferenceToVideoTurboRealtimeClipPoppedMessage) => void): () => void;
533
+ /**
534
+ * Subscribe to "clip_queued" messages only.
535
+ * @returns Unsubscribe function
536
+ */
537
+ onClipQueued(handler: (message: H3ReferenceToVideoTurboRealtimeClipQueuedMessage) => void): () => void;
538
+ /**
539
+ * Subscribe to "clip_started" messages only.
540
+ * @returns Unsubscribe function
541
+ */
542
+ onClipStarted(handler: (message: H3ReferenceToVideoTurboRealtimeClipStartedMessage) => void): () => void;
543
+ /**
544
+ * Subscribe to "clip_stopped" messages only.
545
+ * @returns Unsubscribe function
546
+ */
547
+ onClipStopped(handler: (message: H3ReferenceToVideoTurboRealtimeClipStoppedMessage) => void): () => void;
548
+ /**
549
+ * Subscribe to "queue_update" messages only.
550
+ * @returns Unsubscribe function
551
+ */
552
+ onQueueUpdate(handler: (message: H3ReferenceToVideoTurboRealtimeQueueUpdateMessage) => void): () => void;
553
+ /**
554
+ * Subscribe to "state_update" messages only.
555
+ * @returns Unsubscribe function
556
+ */
557
+ onStateUpdate(handler: (message: H3ReferenceToVideoTurboRealtimeStateUpdateMessage) => void): () => void;
558
+ /**
559
+ * Subscribe to "clip_finished" messages only.
560
+ * @returns Unsubscribe function
561
+ */
562
+ onClipFinished(handler: (message: H3ReferenceToVideoTurboRealtimeClipFinishedMessage) => void): () => void;
563
+ /**
564
+ * Subscribe to "command_error" messages only.
565
+ * @returns Unsubscribe function
566
+ */
567
+ onCommandError(handler: (message: H3ReferenceToVideoTurboRealtimeCommandErrorMessage) => void): () => void;
568
+ /**
569
+ * Subscribe to "seed_accepted" messages only.
570
+ * @returns Unsubscribe function
571
+ */
572
+ onSeedAccepted(handler: (message: H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage) => void): () => void;
573
+ /**
574
+ * Subscribe to "session_reset" messages only.
575
+ * @returns Unsubscribe function
576
+ */
577
+ onSessionReset(handler: (message: H3ReferenceToVideoTurboRealtimeSessionResetMessage) => void): () => void;
578
+ /**
579
+ * Subscribe to "clip_generated" messages only.
580
+ * @returns Unsubscribe function
581
+ */
582
+ onClipGenerated(handler: (message: H3ReferenceToVideoTurboRealtimeClipGeneratedMessage) => void): () => void;
583
+ /**
584
+ * Subscribe to "flush_accepted" messages only.
585
+ * @returns Unsubscribe function
586
+ */
587
+ onFlushAccepted(handler: (message: H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage) => void): () => void;
588
+ /**
589
+ * Subscribe to "canvas_accepted" messages only.
590
+ * @returns Unsubscribe function
591
+ */
592
+ onCanvasAccepted(handler: (message: H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage) => void): () => void;
593
+ /**
594
+ * Subscribe to "autoplay_accepted" messages only.
595
+ * @returns Unsubscribe function
596
+ */
597
+ onAutoplayAccepted(handler: (message: H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage) => void): () => void;
598
+ /**
599
+ * Subscribe to "clip_length_accepted" messages only.
600
+ * @returns Unsubscribe function
601
+ */
602
+ onClipLengthAccepted(handler: (message: H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage) => void): () => void;
603
+ /**
604
+ * Subscribe to the "main_video" recvonly video track the model publishes.
605
+ *
606
+ * The handler fires once the model starts publishing this track; it receives the live MediaStreamTrack and the parent MediaStream (useful for attaching to a `<video>` / `<audio>` element via `srcObject`).
607
+ * @param handler - Called with the received track and its stream
608
+ * @returns Unsubscribe function
609
+ */
610
+ onMainVideo(handler: (track: MediaStreamTrack, stream: MediaStream) => void): () => void;
611
+ /**
612
+ * Subscribe to the "main_audio" recvonly audio track the model publishes.
613
+ *
614
+ * The handler fires once the model starts publishing this track; it receives the live MediaStreamTrack and the parent MediaStream (useful for attaching to a `<video>` / `<audio>` element via `srcObject`).
615
+ * @param handler - Called with the received track and its stream
616
+ * @returns Unsubscribe function
617
+ */
618
+ onMainAudio(handler: (track: MediaStreamTrack, stream: MediaStream) => void): () => void;
619
+ }
620
+
621
+ export { type H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage, type H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage, type H3ReferenceToVideoTurboRealtimeClipFailedMessage, type H3ReferenceToVideoTurboRealtimeClipFinishedMessage, type H3ReferenceToVideoTurboRealtimeClipGeneratedMessage, type H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage, type H3ReferenceToVideoTurboRealtimeClipMovedMessage, type H3ReferenceToVideoTurboRealtimeClipPoppedMessage, type H3ReferenceToVideoTurboRealtimeClipQueuedMessage, type H3ReferenceToVideoTurboRealtimeClipStartedMessage, type H3ReferenceToVideoTurboRealtimeClipStoppedMessage, type H3ReferenceToVideoTurboRealtimeCommandErrorMessage, type H3ReferenceToVideoTurboRealtimeEnqueueParams, type H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage, type H3ReferenceToVideoTurboRealtimeMessage, H3ReferenceToVideoTurboRealtimeModel, type H3ReferenceToVideoTurboRealtimeMoveParams, type H3ReferenceToVideoTurboRealtimeOptions, type H3ReferenceToVideoTurboRealtimePlayParams, type H3ReferenceToVideoTurboRealtimePopParams, type H3ReferenceToVideoTurboRealtimeQueueUpdateMessage, type H3ReferenceToVideoTurboRealtimeRecvTrackName, type H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage, type H3ReferenceToVideoTurboRealtimeSessionResetMessage, type H3ReferenceToVideoTurboRealtimeSetAutoplayParams, type H3ReferenceToVideoTurboRealtimeSetCanvasParams, type H3ReferenceToVideoTurboRealtimeSetClipSecondsParams, type H3ReferenceToVideoTurboRealtimeSetFlushOnClipEndParams, type H3ReferenceToVideoTurboRealtimeSetSeedParams, type H3ReferenceToVideoTurboRealtimeStateUpdateMessage, H3ReferenceToVideoTurboRealtimeTracks, MODEL_NAME, MODEL_VERSION };