@reactor-models/h3-reference-to-video-turbo-realtime 0.3.0 → 0.4.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.
- package/README.md +17 -15
- package/dist/{chunk-G3JJXOQR.mjs → chunk-NVOWSXDG.mjs} +4 -4
- package/dist/chunk-NVOWSXDG.mjs.map +1 -0
- package/dist/{chunk-NXDKLVKO.mjs → chunk-UJUORFH2.mjs} +2 -2
- package/dist/{chunk-NXDKLVKO.mjs.map → chunk-UJUORFH2.mjs.map} +1 -1
- package/dist/core.d.mts +36 -4
- package/dist/core.d.ts +36 -4
- package/dist/core.js +3 -3
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-G3JJXOQR.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @reactor-models/h3-reference-to-video-turbo-realtime
|
|
2
2
|
|
|
3
|
-
> Typed JavaScript + React SDK for the **H3ReferenceToVideoTurboRealtime** model on [Reactor](https://reactor.inc). Version **v0.
|
|
3
|
+
> Typed JavaScript + React SDK for the **H3ReferenceToVideoTurboRealtime** model on [Reactor](https://reactor.inc). Version **v0.4.0**.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -331,7 +331,7 @@ function Example() {
|
|
|
331
331
|
|
|
332
332
|
### `enqueue`
|
|
333
333
|
|
|
334
|
-
Queue a clip with 1–9 reference images at position
|
|
334
|
+
Queue a clip with 1–9 reference images, and optionally up to 3 reference audio clips, at position or at the back. Each clip keeps its own prompt and ordered references: new references do not alter earlier requests. Images guide appearance, audio conditions the generated soundtrack; neither is 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, audio without an image, too many references, invalid parameters or a full generation queue.
|
|
335
335
|
|
|
336
336
|
Returns: [`clip_queued`](#clip_queued) — `{ type: "clip_queued", clip: null }` (or `undefined` when the send fails).
|
|
337
337
|
|
|
@@ -342,7 +342,9 @@ Returns: [`clip_queued`](#clip_queued) — `{ type: "clip_queued", clip: null }`
|
|
|
342
342
|
| `seconds` | `number \| null` | 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. _(min 5, max 15.084, default `null`)_ |
|
|
343
343
|
| `metadata` | `string` | Opaque client string, up to 2000 characters, echoed unchanged with the clip. _(maxLength 2000, default `""`)_ |
|
|
344
344
|
| `position` | `number \| null` | Generation queue position: 0 is the next build; omitted or past the end appends. The running build is unaffected. _(min 0, default `null`)_ |
|
|
345
|
+
| `reference_audio` | `FileRef \| null` | One optional WAV, MP3, AAC/M4A, OGG/Opus, FLAC or WebM clip whose voice, music or soundscape the generated soundtrack is conditioned to resemble. Pairs with the image references; it is not a first or last frame. Supply this or reference_audios, not both. _(default `null`)_ |
|
|
345
346
|
| `reference_image` | `FileRef \| null` | One JPEG, PNG or WebP reference for this clip. Guides subjects and appearance, not a keyframe. Supply this or reference_images, not both. _(default `null`)_ |
|
|
347
|
+
| `reference_audios` | `FileRef[] \| null` | Ordered list of up to 3 uploaded audio clips (WAV, MP3, AAC/M4A, OGG/Opus, FLAC or WebM). In the prompt, Audio 1 names the first, Audio 2 the second, and so on; each conditions the generated soundtrack's timbre/soundscape. Audio must accompany at least one reference image and is never sent on its own. Supply this or reference_audio, not both. _(default `null`)_ |
|
|
346
348
|
| `reference_images` | `FileRef[] \| null` | 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. _(default `null`)_ |
|
|
347
349
|
| `continue_from_clip_id` | `string` | 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. _(default `""`)_ |
|
|
348
350
|
|
|
@@ -355,7 +357,7 @@ const h3ReferenceToVideoTurboRealtime = new H3ReferenceToVideoTurboRealtimeModel
|
|
|
355
357
|
await h3ReferenceToVideoTurboRealtime.connect(jwt);
|
|
356
358
|
|
|
357
359
|
const fileRef = await h3ReferenceToVideoTurboRealtime.uploadFile(blob);
|
|
358
|
-
const reply = await h3ReferenceToVideoTurboRealtime.enqueue({
|
|
360
|
+
const reply = await h3ReferenceToVideoTurboRealtime.enqueue({ reference_audio: fileRef, seed: null, prompt: "A sunset over the ocean", seconds: null, metadata: "", position: null, reference_image: null, reference_audios: null, reference_images: null, continue_from_clip_id: "" });
|
|
359
361
|
|
|
360
362
|
if (reply) {
|
|
361
363
|
console.log("clip_queued", reply.clip);
|
|
@@ -373,7 +375,7 @@ function Example() {
|
|
|
373
375
|
|
|
374
376
|
async function handlePick(file: File) {
|
|
375
377
|
const ref = await uploadFile(file);
|
|
376
|
-
await enqueue({
|
|
378
|
+
await enqueue({ reference_audio: ref, seed: null, prompt: "A sunset over the ocean", seconds: null, metadata: "", position: null, reference_image: null, reference_audios: null, reference_images: null, continue_from_clip_id: "" });
|
|
377
379
|
}
|
|
378
380
|
|
|
379
381
|
return <input type="file" onChange={(e) => handlePick(e.target.files![0])} />;
|
|
@@ -684,7 +686,7 @@ Listener: `onClipMoved` · React hook: `useH3ReferenceToVideoTurboRealtimeClipMo
|
|
|
684
686
|
|
|
685
687
|
| Field | Type | Description |
|
|
686
688
|
|---|---|---|
|
|
687
|
-
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_image"?: boolean; "reference_image_count"?: number }` | Repositioned clip. |
|
|
689
|
+
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_audio"?: boolean; "has_reference_image"?: boolean; "reference_audio_count"?: number; "reference_image_count"?: number }` | Repositioned clip. |
|
|
688
690
|
| `queue` | `string` | Queue containing the clip: generation or playout. |
|
|
689
691
|
| `position` | `number` | Resulting position, 0 = front. |
|
|
690
692
|
|
|
@@ -729,7 +731,7 @@ Listener: `onClipFailed` · React hook: `useH3ReferenceToVideoTurboRealtimeClipF
|
|
|
729
731
|
|
|
730
732
|
| Field | Type | Description |
|
|
731
733
|
|---|---|---|
|
|
732
|
-
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_image"?: boolean; "reference_image_count"?: number }` | Failed clip. |
|
|
734
|
+
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_audio"?: boolean; "has_reference_image"?: boolean; "reference_audio_count"?: number; "reference_image_count"?: number }` | Failed clip. |
|
|
733
735
|
| `reason` | `string` | Why generation failed. |
|
|
734
736
|
|
|
735
737
|
#### JavaScript
|
|
@@ -763,7 +765,7 @@ Listener: `onClipPopped` · React hook: `useH3ReferenceToVideoTurboRealtimeClipP
|
|
|
763
765
|
|
|
764
766
|
| Field | Type | Description |
|
|
765
767
|
|---|---|---|
|
|
766
|
-
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_image"?: boolean; "reference_image_count"?: number }` | Removed clip; an in-flight result will be discarded. |
|
|
768
|
+
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_audio"?: boolean; "has_reference_image"?: boolean; "reference_audio_count"?: number; "reference_image_count"?: number }` | Removed clip; an in-flight result will be discarded. |
|
|
767
769
|
|
|
768
770
|
#### JavaScript
|
|
769
771
|
|
|
@@ -796,7 +798,7 @@ Listener: `onClipQueued` · React hook: `useH3ReferenceToVideoTurboRealtimeClipQ
|
|
|
796
798
|
|
|
797
799
|
| Field | Type | Description |
|
|
798
800
|
|---|---|---|
|
|
799
|
-
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_image"?: boolean; "reference_image_count"?: number }` | Accepted clip, including its UUID; ready is false. |
|
|
801
|
+
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_audio"?: boolean; "has_reference_image"?: boolean; "reference_audio_count"?: number; "reference_image_count"?: number }` | Accepted clip, including its UUID; ready is false. |
|
|
800
802
|
|
|
801
803
|
#### JavaScript
|
|
802
804
|
|
|
@@ -829,7 +831,7 @@ Listener: `onClipStarted` · React hook: `useH3ReferenceToVideoTurboRealtimeClip
|
|
|
829
831
|
|
|
830
832
|
| Field | Type | Description |
|
|
831
833
|
|---|---|---|
|
|
832
|
-
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_image"?: boolean; "reference_image_count"?: number }` | Clip now playing. |
|
|
834
|
+
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_audio"?: boolean; "has_reference_image"?: boolean; "reference_audio_count"?: number; "reference_image_count"?: number }` | Clip now playing. |
|
|
833
835
|
|
|
834
836
|
#### JavaScript
|
|
835
837
|
|
|
@@ -862,7 +864,7 @@ Listener: `onClipStopped` · React hook: `useH3ReferenceToVideoTurboRealtimeClip
|
|
|
862
864
|
|
|
863
865
|
| Field | Type | Description |
|
|
864
866
|
|---|---|---|
|
|
865
|
-
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_image"?: boolean; "reference_image_count"?: number }` | Interrupted clip. |
|
|
867
|
+
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_audio"?: boolean; "has_reference_image"?: boolean; "reference_audio_count"?: number; "reference_image_count"?: number }` | Interrupted clip. |
|
|
866
868
|
| `seconds_sent` | `number` | Total seconds sent in the session. |
|
|
867
869
|
|
|
868
870
|
#### JavaScript
|
|
@@ -896,9 +898,9 @@ Listener: `onQueueUpdate` · React hook: `useH3ReferenceToVideoTurboRealtimeQueu
|
|
|
896
898
|
|
|
897
899
|
| Field | Type | Description |
|
|
898
900
|
|---|---|---|
|
|
899
|
-
| `history` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_image"?: boolean; "reference_image_count"?: number }[]` | 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`. |
|
|
900
|
-
| `playout` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_image"?: boolean; "reference_image_count"?: number }[]` | Built clips ready to play, front first. |
|
|
901
|
-
| `generation` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_image"?: boolean; "reference_image_count"?: number }[]` | Waiting/in-flight builds, front first. |
|
|
901
|
+
| `history` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_audio"?: boolean; "has_reference_image"?: boolean; "reference_audio_count"?: number; "reference_image_count"?: number }[]` | 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`. |
|
|
902
|
+
| `playout` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_audio"?: boolean; "has_reference_image"?: boolean; "reference_audio_count"?: number; "reference_image_count"?: number }[]` | Built clips ready to play, front first. |
|
|
903
|
+
| `generation` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_audio"?: boolean; "has_reference_image"?: boolean; "reference_audio_count"?: number; "reference_image_count"?: number }[]` | Waiting/in-flight builds, front first. |
|
|
902
904
|
|
|
903
905
|
#### JavaScript
|
|
904
906
|
|
|
@@ -1031,7 +1033,7 @@ Listener: `onClipFinished` · React hook: `useH3ReferenceToVideoTurboRealtimeCli
|
|
|
1031
1033
|
|
|
1032
1034
|
| Field | Type | Description |
|
|
1033
1035
|
|---|---|---|
|
|
1034
|
-
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_image"?: boolean; "reference_image_count"?: number }` | Completed clip. |
|
|
1036
|
+
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_audio"?: boolean; "has_reference_image"?: boolean; "reference_audio_count"?: number; "reference_image_count"?: number }` | Completed clip. |
|
|
1035
1037
|
| `seconds_sent` | `number` | Total seconds sent in the session, including this clip. |
|
|
1036
1038
|
|
|
1037
1039
|
#### JavaScript
|
|
@@ -1166,7 +1168,7 @@ Listener: `onClipGenerated` · React hook: `useH3ReferenceToVideoTurboRealtimeCl
|
|
|
1166
1168
|
|
|
1167
1169
|
| Field | Type | Description |
|
|
1168
1170
|
|---|---|---|
|
|
1169
|
-
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_image"?: boolean; "reference_image_count"?: number }` | Built clip, ready to play. |
|
|
1171
|
+
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_reference_audio"?: boolean; "has_reference_image"?: boolean; "reference_audio_count"?: number; "reference_image_count"?: number }` | Built clip, ready to play. |
|
|
1170
1172
|
|
|
1171
1173
|
#### JavaScript
|
|
1172
1174
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/core.ts
|
|
2
2
|
import { Reactor, FileRef } from "@reactor-team/js-sdk";
|
|
3
3
|
var MODEL_NAME = "reactor/h3-reference-to-video-turbo-realtime";
|
|
4
|
-
var MODEL_VERSION = "v0.
|
|
4
|
+
var MODEL_VERSION = "v0.4.0";
|
|
5
5
|
var H3ReferenceToVideoTurboRealtimeTracks = [
|
|
6
6
|
{ name: "main_video", kind: "video", direction: "recvonly" },
|
|
7
7
|
{ name: "main_audio", kind: "audio", direction: "recvonly" }
|
|
@@ -69,8 +69,8 @@ var H3ReferenceToVideoTurboRealtimeModel = class extends Reactor {
|
|
|
69
69
|
return reply === void 0 ? void 0 : _unwrapMessage(reply);
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
|
-
* Queue a clip with 1–9 reference images at position
|
|
73
|
-
* @param params - Queue a clip with 1–9 reference images at position
|
|
72
|
+
* Queue a clip with 1–9 reference images, and optionally up to 3 reference audio clips, at position or at the back. Each clip keeps its own prompt and ordered references: new references do not alter earlier requests. Images guide appearance, audio conditions the generated soundtrack; neither is 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, audio without an image, too many references, invalid parameters or a full generation queue.
|
|
73
|
+
* @param params - Queue a clip with 1–9 reference images, and optionally up to 3 reference audio clips, at position or at the back. Each clip keeps its own prompt and ordered references: new references do not alter earlier requests. Images guide appearance, audio conditions the generated soundtrack; neither is 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, audio without an image, too many references, invalid parameters or a full generation queue.
|
|
74
74
|
* @returns The correlated {@link H3ReferenceToVideoTurboRealtimeClipQueuedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
|
|
75
75
|
*/
|
|
76
76
|
async enqueue(params) {
|
|
@@ -340,4 +340,4 @@ export {
|
|
|
340
340
|
H3ReferenceToVideoTurboRealtimeTracks,
|
|
341
341
|
H3ReferenceToVideoTurboRealtimeModel
|
|
342
342
|
};
|
|
343
|
-
//# sourceMappingURL=chunk-
|
|
343
|
+
//# sourceMappingURL=chunk-NVOWSXDG.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core.ts"],"sourcesContent":["// Copyright (c) 2026 Reactor Technologies, Inc. All rights reserved.\n\n// Auto-generated by @reactor-team/codegen — DO NOT EDIT\n// Model: h3-reference-to-video-turbo-realtime v0.4.0\n\nimport { Reactor, FileRef } from \"@reactor-team/js-sdk\";\nexport { FileRef };\n\nexport const MODEL_NAME = \"reactor/h3-reference-to-video-turbo-realtime\" as const;\nexport const MODEL_VERSION = \"v0.4.0\" as const;\n\n/**\n * Preset media tracks for the H3ReferenceToVideoTurboRealtime model.\n *\n * Declared in the model's OpenAPI schema and passed to the SDK as\n * `modelTracks` so the transport can prepare the SDP offer in\n * parallel with session polling (faster first-frame latency).\n */\nexport const H3ReferenceToVideoTurboRealtimeTracks = [\n { name: \"main_video\", kind: \"video\", direction: \"recvonly\" },\n { name: \"main_audio\", kind: \"audio\", direction: \"recvonly\" },\n] as const;\n\n/** Track names the client can subscribe to (recvonly, from the client's perspective). */\nexport type H3ReferenceToVideoTurboRealtimeRecvTrackName =\n \"main_video\"\n | \"main_audio\";\n\n/** 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. */\nexport interface H3ReferenceToVideoTurboRealtimePopParams {\n /**\n * UUID of the clip to remove from either queue.\n * @default \"\"\n */\n\n clip_id?: string;\n}\n\n/** 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. */\nexport interface H3ReferenceToVideoTurboRealtimeMoveParams {\n /**\n * UUID of a queued clip.\n * @default \"\"\n */\n\n clip_id?: string;\n /**\n * Position in its current queue; past the end appends.\n * @minimum 0\n * @default 0\n */\n\n position?: number;\n}\n\n/** 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. */\nexport interface H3ReferenceToVideoTurboRealtimePlayParams {\n /**\n * UUID of a ready clip; blank takes the playout front.\n * @default \"\"\n */\n\n clip_id?: string;\n}\n\n/** Queue a clip with 1–9 reference images, and optionally up to 3 reference audio clips, at position or at the back. Each clip keeps its own prompt and ordered references: new references do not alter earlier requests. Images guide appearance, audio conditions the generated soundtrack; neither is 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, audio without an image, too many references, invalid parameters or a full generation queue. */\nexport interface H3ReferenceToVideoTurboRealtimeEnqueueParams {\n /**\n * Omitted or null uses and advances the default seed. An explicit seed leaves the default unchanged.\n * @minimum 0\n * @default null\n */\n\n seed?: number | null;\n /**\n * 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.\n * @default \"\"\n */\n\n prompt?: string;\n /**\n * 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.\n * @minimum 5\n * @maximum 15.084\n * @default null\n */\n\n seconds?: number | null;\n /**\n * Opaque client string, up to 2000 characters, echoed unchanged with the clip.\n * @maxLength 2000\n * @default \"\"\n */\n\n metadata?: string;\n /**\n * Generation queue position: 0 is the next build; omitted or past the end appends. The running build is unaffected.\n * @minimum 0\n * @default null\n */\n\n position?: number | null;\n /**\n * One optional WAV, MP3, AAC/M4A, OGG/Opus, FLAC or WebM clip whose voice, music or soundscape the generated soundtrack is conditioned to resemble. Pairs with the image references; it is not a first or last frame. Supply this or reference_audios, not both.\n * @default null\n */\n\n reference_audio?: FileRef | null;\n /**\n * One JPEG, PNG or WebP reference for this clip. Guides subjects and appearance, not a keyframe. Supply this or reference_images, not both.\n * @default null\n */\n\n reference_image?: FileRef | null;\n /**\n * Ordered list of up to 3 uploaded audio clips (WAV, MP3, AAC/M4A, OGG/Opus, FLAC or WebM). In the prompt, Audio 1 names the first, Audio 2 the second, and so on; each conditions the generated soundtrack's timbre/soundscape. Audio must accompany at least one reference image and is never sent on its own. Supply this or reference_audio, not both.\n * @default null\n */\n\n reference_audios?: FileRef[] | null;\n /**\n * 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.\n * @default null\n */\n\n reference_images?: FileRef[] | null;\n /**\n * 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.\n * @default \"\"\n */\n\n continue_from_clip_id?: string;\n}\n\n/** 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. */\nexport interface H3ReferenceToVideoTurboRealtimeSetSeedParams {\n /**\n * Nonnegative default seed; queued clips keep their seeds.\n * @minimum 0\n * @default 1000\n */\n\n seed?: number;\n}\n\n/** 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. */\nexport interface H3ReferenceToVideoTurboRealtimeSetCanvasParams {\n /**\n * Choose 16:9 (1344x768), 1:1 (768x768), 9:16 (768x1344), or 4:3 (1024x768).\n * @default \"16:9\"\n */\n\n aspect?: \"16:9\" | \"1:1\" | \"9:16\" | \"4:3\";\n}\n\n/** Automatically play ready clips whenever idle. Empty queues wait; no prompts are generated automatically. Replies autoplay_accepted and emits state_update. */\nexport interface H3ReferenceToVideoTurboRealtimeSetAutoplayParams {\n /**\n * True plays the ready queue; false waits for play after each clip.\n * @default false\n */\n\n enabled?: boolean;\n}\n\n/** 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. */\nexport interface H3ReferenceToVideoTurboRealtimeSetClipSecondsParams {\n /**\n * 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.\n * @minimum 5\n * @maximum 15.084\n * @default 15\n */\n\n seconds?: number;\n}\n\n/** 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. */\nexport interface H3ReferenceToVideoTurboRealtimeSetFlushOnClipEndParams {\n /**\n * True flushes to black; false holds the last frame and avoids flushing between autoplay clips.\n * @default true\n */\n\n enabled?: boolean;\n}\n\n/** Emitted as the correlated reply when move changes queue order. */\nexport interface H3ReferenceToVideoTurboRealtimeClipMovedMessage {\n type: \"clip_moved\";\n /** Repositioned clip. */\n\n clip: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_reference_audio\"?: boolean; \"has_reference_image\"?: boolean; \"reference_audio_count\"?: number; \"reference_image_count\"?: number };\n /** Queue containing the clip: generation or playout. */\n\n queue: string;\n /** Resulting position, 0 = front. */\n\n position: number;\n}\n\n/** Emitted when generation fails; the clip is removed and the queue moves on. */\nexport interface H3ReferenceToVideoTurboRealtimeClipFailedMessage {\n type: \"clip_failed\";\n /** Failed clip. */\n\n clip: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_reference_audio\"?: boolean; \"has_reference_image\"?: boolean; \"reference_audio_count\"?: number; \"reference_image_count\"?: number };\n /** Why generation failed. */\n\n reason: string;\n}\n\n/** Emitted as the correlated reply when pop removes a queued clip. */\nexport interface H3ReferenceToVideoTurboRealtimeClipPoppedMessage {\n type: \"clip_popped\";\n /** Removed clip; an in-flight result will be discarded. */\n\n clip: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_reference_audio\"?: boolean; \"has_reference_image\"?: boolean; \"reference_audio_count\"?: number; \"reference_image_count\"?: number };\n}\n\n/** Emitted as the correlated reply when enqueue accepts a clip. */\nexport interface H3ReferenceToVideoTurboRealtimeClipQueuedMessage {\n type: \"clip_queued\";\n /** Accepted clip, including its UUID; ready is false. */\n\n clip: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_reference_audio\"?: boolean; \"has_reference_image\"?: boolean; \"reference_audio_count\"?: number; \"reference_image_count\"?: number };\n}\n\n/** Emitted when a clip starts sending to the output tracks. */\nexport interface H3ReferenceToVideoTurboRealtimeClipStartedMessage {\n type: \"clip_started\";\n /** Clip now playing. */\n\n clip: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_reference_audio\"?: boolean; \"has_reference_image\"?: boolean; \"reference_audio_count\"?: number; \"reference_image_count\"?: number };\n}\n\n/** Emitted when stop or reset cuts a clip; it cannot be resumed. */\nexport interface H3ReferenceToVideoTurboRealtimeClipStoppedMessage {\n type: \"clip_stopped\";\n /** Interrupted clip. */\n\n clip: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_reference_audio\"?: boolean; \"has_reference_image\"?: boolean; \"reference_audio_count\"?: number; \"reference_image_count\"?: number };\n /** Total seconds sent in the session. */\n\n seconds_sent: number;\n}\n\n/** Emitted on connect and queue changes; also answers get_queue. */\nexport interface H3ReferenceToVideoTurboRealtimeQueueUpdateMessage {\n type: \"queue_update\";\n /** 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`. */\n\n history: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_reference_audio\"?: boolean; \"has_reference_image\"?: boolean; \"reference_audio_count\"?: number; \"reference_image_count\"?: number }[];\n /** Built clips ready to play, front first. */\n\n playout: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_reference_audio\"?: boolean; \"has_reference_image\"?: boolean; \"reference_audio_count\"?: number; \"reference_image_count\"?: number }[];\n /** Waiting/in-flight builds, front first. */\n\n generation: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_reference_audio\"?: boolean; \"has_reference_image\"?: boolean; \"reference_audio_count\"?: number; \"reference_image_count\"?: number }[];\n}\n\n/** Emitted on connect and after session state changes; also answers get_state. */\nexport interface H3ReferenceToVideoTurboRealtimeStateUpdateMessage {\n type: \"state_update\";\n /** Next automatically assigned seed. */\n\n seed: number;\n /** Output video width in pixels. */\n\n width: number;\n /** Session aspect ratio. */\n\n aspect: string;\n /** Output video height in pixels. */\n\n height: number;\n /** A clip is armed or playing on the output tracks. */\n\n playing: boolean;\n /** Ready clips start automatically when idle. */\n\n autoplay: boolean;\n /** Actual duration used by enqueues without their own seconds. */\n\n clip_seconds: number;\n /** Clips finished or stopped during this session. */\n\n clips_played: number;\n /** Seconds sent on the tracks during this session. */\n\n seconds_sent: number;\n /** Ready clips waiting to play. */\n\n playout_queued: number;\n /** Commands permitted by current queue/playback state; their arguments still need validation. */\n\n valid_commands: string[];\n /** Playing clip UUID, or null when idle. */\n\n playing_clip_id: string | null;\n /** Maximum accepted requested duration. */\n\n clip_seconds_max: number;\n /** Minimum accepted requested duration. */\n\n clip_seconds_min: number;\n /** Maximum ready queue size; building pauses while full. */\n\n playout_capacity: number;\n /** True flushes to black at boundaries; false holds the last frame and avoids flushing between ready autoplay clips. */\n\n flush_on_clip_end: boolean;\n /** Clips in the generation queue, including the running build. */\n\n generation_queued: number;\n /** Maximum generation queue size. */\n\n generation_capacity: number;\n}\n\n/** Emitted when all frames and synchronized audio have been sent. */\nexport interface H3ReferenceToVideoTurboRealtimeClipFinishedMessage {\n type: \"clip_finished\";\n /** Completed clip. */\n\n clip: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_reference_audio\"?: boolean; \"has_reference_image\"?: boolean; \"reference_audio_count\"?: number; \"reference_image_count\"?: number };\n /** Total seconds sent in the session, including this clip. */\n\n seconds_sent: number;\n}\n\n/** Emitted when a command is refused without changing the queue/defaults. */\nexport interface H3ReferenceToVideoTurboRealtimeCommandErrorMessage {\n type: \"command_error\";\n /** Why the command was refused. */\n\n reason: string;\n /** Refused command name. */\n\n command: string;\n}\n\n/** Emitted as the correlated reply when set_seed is accepted. */\nexport interface H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage {\n type: \"seed_accepted\";\n /** Next automatically assigned seed. */\n\n seed: number;\n}\n\n/** Emitted as the correlated reply when reset clears the playlist and defaults. */\nexport interface H3ReferenceToVideoTurboRealtimeSessionResetMessage {\n type: \"session_reset\";\n /** Whether reset cut an armed or playing clip. */\n\n was_playing: boolean;\n /** Clips removed from both queues, excluding the playing clip. */\n\n cleared_clips: number;\n}\n\n/** Emitted when a build enters the playout queue. */\nexport interface H3ReferenceToVideoTurboRealtimeClipGeneratedMessage {\n type: \"clip_generated\";\n /** Built clip, ready to play. */\n\n clip: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_reference_audio\"?: boolean; \"has_reference_image\"?: boolean; \"reference_audio_count\"?: number; \"reference_image_count\"?: number };\n}\n\n/** Emitted as the correlated reply when set_flush_on_clip_end is accepted. */\nexport interface H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage {\n type: \"flush_accepted\";\n /** Whether clip boundaries flush the output to black. */\n\n enabled: boolean;\n}\n\n/** Emitted as the correlated reply when set_canvas is accepted. */\nexport interface H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage {\n type: \"canvas_accepted\";\n /** Video width in pixels. */\n\n width: number;\n /** Accepted aspect ratio. */\n\n aspect: string;\n /** Video height in pixels. */\n\n height: number;\n}\n\n/** Emitted as the correlated reply when set_autoplay is accepted. */\nexport interface H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage {\n type: \"autoplay_accepted\";\n /** Whether ready clips start automatically. */\n\n enabled: boolean;\n}\n\n/** Emitted as the correlated reply when set_clip_seconds is accepted. */\nexport interface H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage {\n type: \"clip_length_accepted\";\n /** Effective default frame count. */\n\n frames: number;\n /** Effective default duration, in seconds. */\n\n clip_seconds: number;\n}\n\nexport type H3ReferenceToVideoTurboRealtimeMessage =\n | H3ReferenceToVideoTurboRealtimeClipMovedMessage\n | H3ReferenceToVideoTurboRealtimeClipFailedMessage\n | H3ReferenceToVideoTurboRealtimeClipPoppedMessage\n | H3ReferenceToVideoTurboRealtimeClipQueuedMessage\n | H3ReferenceToVideoTurboRealtimeClipStartedMessage\n | H3ReferenceToVideoTurboRealtimeClipStoppedMessage\n | H3ReferenceToVideoTurboRealtimeQueueUpdateMessage\n | H3ReferenceToVideoTurboRealtimeStateUpdateMessage\n | H3ReferenceToVideoTurboRealtimeClipFinishedMessage\n | H3ReferenceToVideoTurboRealtimeCommandErrorMessage\n | H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage\n | H3ReferenceToVideoTurboRealtimeSessionResetMessage\n | H3ReferenceToVideoTurboRealtimeClipGeneratedMessage\n | H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage\n | H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage\n | H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage\n | H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage;\n\n/**\n * Options for creating a H3ReferenceToVideoTurboRealtimeModel (model name is set automatically).\n *\n * Derived from `Reactor`'s own constructor options with `modelName`\n * and `modelTracks` removed — those are supplied by this class.\n * Any new option the SDK adds appears here automatically on the\n * next `defaultSdkVersion` bump.\n */\nexport type H3ReferenceToVideoTurboRealtimeOptions = Omit<\n ConstructorParameters<typeof Reactor>[0],\n \"modelName\" | \"modelTracks\"\n>;\n\n/**\n * @internal Flatten the `{ type, data, uploads? }` envelope the SDK\n * hands to `reactor.on(\"message\", …)` so a field the model schema\n * declares on a message is reachable at `msg.<field>` — matching the\n * shape the exported message interfaces promise.\n */\nfunction _unwrapMessage<T>(raw: unknown): T {\n const env = raw as { type?: string; data?: Record<string, unknown> };\n if (\n env &&\n typeof env === \"object\" &&\n env.data &&\n typeof env.data === \"object\"\n ) {\n return { ...env.data, type: env.type } as T;\n }\n return raw as T;\n}\n\n/**\n * Strongly-typed client for the H3ReferenceToVideoTurboRealtime model.\n *\n * Extends {@link Reactor} with the model name (and modelTracks) baked into the\n * constructor, so every public method on Reactor — `connect`, `disconnect`,\n * `sendCommand`, `on`/`off`, `getStats`, `publishTrack`/`unpublishTrack`,\n * etc. — is reachable directly on the instance. The schema-derived sugar\n * below adds typed wrappers for every declared event, message, and track.\n */\n\nexport class H3ReferenceToVideoTurboRealtimeModel extends Reactor {\n constructor(options?: H3ReferenceToVideoTurboRealtimeOptions) {\n super({\n ...options,\n modelName: MODEL_NAME,\n modelTracks: [...H3ReferenceToVideoTurboRealtimeTracks],\n });\n }\n\n /** @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. */\n\n get reactor(): this {\n return this;\n }\n\n /**\n * 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.\n * @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.\n * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeClipPoppedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async pop(params: H3ReferenceToVideoTurboRealtimePopParams): Promise<H3ReferenceToVideoTurboRealtimeClipPoppedMessage | undefined> {\n const reply = await this.sendCommand(\"pop\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeClipPoppedMessage>(reply);\n }\n\n /**\n * 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.\n * @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.\n * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeClipMovedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async move(params: H3ReferenceToVideoTurboRealtimeMoveParams): Promise<H3ReferenceToVideoTurboRealtimeClipMovedMessage | undefined> {\n const reply = await this.sendCommand(\"move\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeClipMovedMessage>(reply);\n }\n\n /**\n * 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.\n * @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.\n * @returns Resolves once the model's handler has completed; this command declares no reply payload.\n */\n\n async play(params: H3ReferenceToVideoTurboRealtimePlayParams): Promise<undefined> {\n await this.sendCommand(\"play\", params);\n return undefined;\n }\n\n /**\n * 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.\n * @returns Resolves once the model's handler has completed; this command declares no reply payload.\n */\n\n async stop(): Promise<undefined> {\n await this.sendCommand(\"stop\", {});\n return undefined;\n }\n\n /**\n * 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.\n * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeSessionResetMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async reset(): Promise<H3ReferenceToVideoTurboRealtimeSessionResetMessage | undefined> {\n const reply = await this.sendCommand(\"reset\", {});\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeSessionResetMessage>(reply);\n }\n\n /**\n * Queue a clip with 1–9 reference images, and optionally up to 3 reference audio clips, at position or at the back. Each clip keeps its own prompt and ordered references: new references do not alter earlier requests. Images guide appearance, audio conditions the generated soundtrack; neither is 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, audio without an image, too many references, invalid parameters or a full generation queue.\n * @param params - Queue a clip with 1–9 reference images, and optionally up to 3 reference audio clips, at position or at the back. Each clip keeps its own prompt and ordered references: new references do not alter earlier requests. Images guide appearance, audio conditions the generated soundtrack; neither is 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, audio without an image, too many references, invalid parameters or a full generation queue.\n * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeClipQueuedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async enqueue(params: H3ReferenceToVideoTurboRealtimeEnqueueParams): Promise<H3ReferenceToVideoTurboRealtimeClipQueuedMessage | undefined> {\n const reply = await this.sendCommand(\"enqueue\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeClipQueuedMessage>(reply);\n }\n\n /**\n * 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.\n * @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.\n * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async setSeed(params: H3ReferenceToVideoTurboRealtimeSetSeedParams): Promise<H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage | undefined> {\n const reply = await this.sendCommand(\"set_seed\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage>(reply);\n }\n\n /**\n * 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.\n * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeQueueUpdateMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async getQueue(): Promise<H3ReferenceToVideoTurboRealtimeQueueUpdateMessage | undefined> {\n const reply = await this.sendCommand(\"get_queue\", {});\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeQueueUpdateMessage>(reply);\n }\n\n /**\n * Reply state_update with defaults, capacities, playback progress and valid_commands. Valid at any time.\n * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeStateUpdateMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async getState(): Promise<H3ReferenceToVideoTurboRealtimeStateUpdateMessage | undefined> {\n const reply = await this.sendCommand(\"get_state\", {});\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeStateUpdateMessage>(reply);\n }\n\n /**\n * 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.\n * @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.\n * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async setCanvas(params: H3ReferenceToVideoTurboRealtimeSetCanvasParams): Promise<H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage | undefined> {\n const reply = await this.sendCommand(\"set_canvas\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage>(reply);\n }\n\n /**\n * Automatically play ready clips whenever idle. Empty queues wait; no prompts are generated automatically. Replies autoplay_accepted and emits state_update.\n * @param params - Automatically play ready clips whenever idle. Empty queues wait; no prompts are generated automatically. Replies autoplay_accepted and emits state_update.\n * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async setAutoplay(params: H3ReferenceToVideoTurboRealtimeSetAutoplayParams): Promise<H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage | undefined> {\n const reply = await this.sendCommand(\"set_autoplay\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage>(reply);\n }\n\n /**\n * 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.\n * @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.\n * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async setClipSeconds(params: H3ReferenceToVideoTurboRealtimeSetClipSecondsParams): Promise<H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage | undefined> {\n const reply = await this.sendCommand(\"set_clip_seconds\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage>(reply);\n }\n\n /**\n * 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.\n * @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.\n * @returns The correlated {@link H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async setFlushOnClipEnd(params: H3ReferenceToVideoTurboRealtimeSetFlushOnClipEndParams): Promise<H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage | undefined> {\n const reply = await this.sendCommand(\"set_flush_on_clip_end\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage>(reply);\n }\n\n /**\n * Subscribe to typed model messages.\n * @param handler - Called with a discriminated H3ReferenceToVideoTurboRealtimeMessage\n * @returns Unsubscribe function\n */\n\n onMessage(handler: (message: H3ReferenceToVideoTurboRealtimeMessage) => void): () => void {\n const wrappedHandler = (raw: unknown) => {\n handler(_unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(raw));\n };\n this.on(\"message\", wrappedHandler);\n return () => this.off(\"message\", wrappedHandler);\n }\n\n /**\n * Subscribe to \"clip_moved\" messages only.\n * @returns Unsubscribe function\n */\n\n onClipMoved(handler: (message: H3ReferenceToVideoTurboRealtimeClipMovedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"clip_moved\") handler(msg as H3ReferenceToVideoTurboRealtimeClipMovedMessage);\n });\n }\n\n /**\n * Subscribe to \"clip_failed\" messages only.\n * @returns Unsubscribe function\n */\n\n onClipFailed(handler: (message: H3ReferenceToVideoTurboRealtimeClipFailedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"clip_failed\") handler(msg as H3ReferenceToVideoTurboRealtimeClipFailedMessage);\n });\n }\n\n /**\n * Subscribe to \"clip_popped\" messages only.\n * @returns Unsubscribe function\n */\n\n onClipPopped(handler: (message: H3ReferenceToVideoTurboRealtimeClipPoppedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"clip_popped\") handler(msg as H3ReferenceToVideoTurboRealtimeClipPoppedMessage);\n });\n }\n\n /**\n * Subscribe to \"clip_queued\" messages only.\n * @returns Unsubscribe function\n */\n\n onClipQueued(handler: (message: H3ReferenceToVideoTurboRealtimeClipQueuedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"clip_queued\") handler(msg as H3ReferenceToVideoTurboRealtimeClipQueuedMessage);\n });\n }\n\n /**\n * Subscribe to \"clip_started\" messages only.\n * @returns Unsubscribe function\n */\n\n onClipStarted(handler: (message: H3ReferenceToVideoTurboRealtimeClipStartedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"clip_started\") handler(msg as H3ReferenceToVideoTurboRealtimeClipStartedMessage);\n });\n }\n\n /**\n * Subscribe to \"clip_stopped\" messages only.\n * @returns Unsubscribe function\n */\n\n onClipStopped(handler: (message: H3ReferenceToVideoTurboRealtimeClipStoppedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"clip_stopped\") handler(msg as H3ReferenceToVideoTurboRealtimeClipStoppedMessage);\n });\n }\n\n /**\n * Subscribe to \"queue_update\" messages only.\n * @returns Unsubscribe function\n */\n\n onQueueUpdate(handler: (message: H3ReferenceToVideoTurboRealtimeQueueUpdateMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"queue_update\") handler(msg as H3ReferenceToVideoTurboRealtimeQueueUpdateMessage);\n });\n }\n\n /**\n * Subscribe to \"state_update\" messages only.\n * @returns Unsubscribe function\n */\n\n onStateUpdate(handler: (message: H3ReferenceToVideoTurboRealtimeStateUpdateMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"state_update\") handler(msg as H3ReferenceToVideoTurboRealtimeStateUpdateMessage);\n });\n }\n\n /**\n * Subscribe to \"clip_finished\" messages only.\n * @returns Unsubscribe function\n */\n\n onClipFinished(handler: (message: H3ReferenceToVideoTurboRealtimeClipFinishedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"clip_finished\") handler(msg as H3ReferenceToVideoTurboRealtimeClipFinishedMessage);\n });\n }\n\n /**\n * Subscribe to \"command_error\" messages only.\n * @returns Unsubscribe function\n */\n\n onCommandError(handler: (message: H3ReferenceToVideoTurboRealtimeCommandErrorMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"command_error\") handler(msg as H3ReferenceToVideoTurboRealtimeCommandErrorMessage);\n });\n }\n\n /**\n * Subscribe to \"seed_accepted\" messages only.\n * @returns Unsubscribe function\n */\n\n onSeedAccepted(handler: (message: H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"seed_accepted\") handler(msg as H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage);\n });\n }\n\n /**\n * Subscribe to \"session_reset\" messages only.\n * @returns Unsubscribe function\n */\n\n onSessionReset(handler: (message: H3ReferenceToVideoTurboRealtimeSessionResetMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"session_reset\") handler(msg as H3ReferenceToVideoTurboRealtimeSessionResetMessage);\n });\n }\n\n /**\n * Subscribe to \"clip_generated\" messages only.\n * @returns Unsubscribe function\n */\n\n onClipGenerated(handler: (message: H3ReferenceToVideoTurboRealtimeClipGeneratedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"clip_generated\") handler(msg as H3ReferenceToVideoTurboRealtimeClipGeneratedMessage);\n });\n }\n\n /**\n * Subscribe to \"flush_accepted\" messages only.\n * @returns Unsubscribe function\n */\n\n onFlushAccepted(handler: (message: H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"flush_accepted\") handler(msg as H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage);\n });\n }\n\n /**\n * Subscribe to \"canvas_accepted\" messages only.\n * @returns Unsubscribe function\n */\n\n onCanvasAccepted(handler: (message: H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"canvas_accepted\") handler(msg as H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage);\n });\n }\n\n /**\n * Subscribe to \"autoplay_accepted\" messages only.\n * @returns Unsubscribe function\n */\n\n onAutoplayAccepted(handler: (message: H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"autoplay_accepted\") handler(msg as H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage);\n });\n }\n\n /**\n * Subscribe to \"clip_length_accepted\" messages only.\n * @returns Unsubscribe function\n */\n\n onClipLengthAccepted(handler: (message: H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"clip_length_accepted\") handler(msg as H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage);\n });\n }\n\n /**\n * Subscribe to the \"main_video\" recvonly video track the model publishes.\n *\n * 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`).\n * @param handler - Called with the received track and its stream\n * @returns Unsubscribe function\n */\n\n onMainVideo(\n handler: (track: MediaStreamTrack, stream: MediaStream) => void,\n ): () => void {\n const wrapped = (name: string, t: MediaStreamTrack, s: MediaStream) => {\n if (name === \"main_video\") handler(t, s);\n };\n this.on(\"trackReceived\", wrapped);\n return () => this.off(\"trackReceived\", wrapped);\n }\n\n /**\n * Subscribe to the \"main_audio\" recvonly audio track the model publishes.\n *\n * 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`).\n * @param handler - Called with the received track and its stream\n * @returns Unsubscribe function\n */\n\n onMainAudio(\n handler: (track: MediaStreamTrack, stream: MediaStream) => void,\n ): () => void {\n const wrapped = (name: string, t: MediaStreamTrack, s: MediaStream) => {\n if (name === \"main_audio\") handler(t, s);\n };\n this.on(\"trackReceived\", wrapped);\n return () => this.off(\"trackReceived\", wrapped);\n }\n}\n"],"mappings":";AAKA,SAAS,SAAS,eAAe;AAG1B,IAAM,aAAa;AACnB,IAAM,gBAAgB;AAStB,IAAM,wCAAwC;AAAA,EACnD,EAAE,MAAM,cAAc,MAAM,SAAS,WAAW,WAAW;AAAA,EAC3D,EAAE,MAAM,cAAc,MAAM,SAAS,WAAW,WAAW;AAC7D;AA2a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SXDG.mjs";
|
|
5
5
|
|
|
6
6
|
// src/react.tsx
|
|
7
7
|
import {
|
|
@@ -298,4 +298,4 @@ export {
|
|
|
298
298
|
useH3ReferenceToVideoTurboRealtimeTrack,
|
|
299
299
|
H3ReferenceToVideoTurboRealtimeMainVideoView
|
|
300
300
|
};
|
|
301
|
-
//# sourceMappingURL=chunk-
|
|
301
|
+
//# sourceMappingURL=chunk-UJUORFH2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react.tsx"],"sourcesContent":["// Copyright (c) 2026 Reactor Technologies, Inc. All rights reserved.\n\n// Auto-generated by @reactor-team/codegen — DO NOT EDIT\n// Model: h3-reference-to-video-turbo-realtime v0.3.0\n\n\"use client\";\n\nimport { type ReactElement } from \"react\";\nimport {\n ReactorProvider,\n useReactor,\n useReactorMessage,\n ReactorView,\n type ReactorViewProps,\n} from \"@reactor-team/js-sdk\";\nimport {\n MODEL_NAME,\n H3ReferenceToVideoTurboRealtimeTracks,\n type H3ReferenceToVideoTurboRealtimeOptions,\n type H3ReferenceToVideoTurboRealtimePopParams,\n type H3ReferenceToVideoTurboRealtimeMoveParams,\n type H3ReferenceToVideoTurboRealtimePlayParams,\n type H3ReferenceToVideoTurboRealtimeEnqueueParams,\n type H3ReferenceToVideoTurboRealtimeSetSeedParams,\n type H3ReferenceToVideoTurboRealtimeSetCanvasParams,\n type H3ReferenceToVideoTurboRealtimeSetAutoplayParams,\n type H3ReferenceToVideoTurboRealtimeSetClipSecondsParams,\n type H3ReferenceToVideoTurboRealtimeSetFlushOnClipEndParams,\n type H3ReferenceToVideoTurboRealtimeMessage,\n type H3ReferenceToVideoTurboRealtimeClipMovedMessage,\n type H3ReferenceToVideoTurboRealtimeClipFailedMessage,\n type H3ReferenceToVideoTurboRealtimeClipPoppedMessage,\n type H3ReferenceToVideoTurboRealtimeClipQueuedMessage,\n type H3ReferenceToVideoTurboRealtimeClipStartedMessage,\n type H3ReferenceToVideoTurboRealtimeClipStoppedMessage,\n type H3ReferenceToVideoTurboRealtimeQueueUpdateMessage,\n type H3ReferenceToVideoTurboRealtimeStateUpdateMessage,\n type H3ReferenceToVideoTurboRealtimeClipFinishedMessage,\n type H3ReferenceToVideoTurboRealtimeCommandErrorMessage,\n type H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage,\n type H3ReferenceToVideoTurboRealtimeSessionResetMessage,\n type H3ReferenceToVideoTurboRealtimeClipGeneratedMessage,\n type H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage,\n type H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage,\n type H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage,\n type H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage,\n type H3ReferenceToVideoTurboRealtimeRecvTrackName,\n} from \"./core.js\";\n\n/**\n * @internal Flatten the `{ type, data, uploads? }` envelope the SDK\n * hands to `reactor.on(\"message\", …)` so a field the model schema\n * declares on a message is reachable at `msg.<field>` — matching the\n * shape the exported message interfaces promise.\n */\nfunction _unwrapMessage<T>(raw: unknown): T {\n const env = raw as { type?: string; data?: Record<string, unknown> };\n if (\n env &&\n typeof env === \"object\" &&\n env.data &&\n typeof env.data === \"object\"\n ) {\n return { ...env.data, type: env.type } as T;\n }\n return raw as T;\n}\n\n/**\n * Props for the {@link H3ReferenceToVideoTurboRealtimeProvider} component.\n *\n * Derived from `ReactorProvider`'s own props, with `modelName` and\n * `modelTracks` stripped — those are supplied by this provider.\n */\nexport type H3ReferenceToVideoTurboRealtimeProviderProps = Omit<\n Parameters<typeof ReactorProvider>[0],\n \"modelName\" | \"modelTracks\"\n>;\n\n/**\n * Provider for the H3ReferenceToVideoTurboRealtime model.\n *\n * Wraps {@link ReactorProvider} with `modelName` and `modelTracks` pre-configured from the\n * generated constants. Drop this near the top of your tree, then use\n * {@link useH3ReferenceToVideoTurboRealtime} and the `useH3ReferenceToVideoTurboRealtime<Message>` hooks below it.\n */\nexport function H3ReferenceToVideoTurboRealtimeProvider({\n children,\n ...rest\n}: H3ReferenceToVideoTurboRealtimeProviderProps): ReactElement {\n return (\n <ReactorProvider\n {...rest}\n modelName={MODEL_NAME}\n modelTracks={[...H3ReferenceToVideoTurboRealtimeTracks]}\n >\n {children}\n </ReactorProvider>\n );\n}\n\n/**\n * Access the H3ReferenceToVideoTurboRealtime model as typed commands bound to the nearest\n * {@link H3ReferenceToVideoTurboRealtimeProvider}.\n *\n * Returns the full action surface — every public field on the SDK's\n * `ReactorStore` (`status`, `sessionId`, `connect`, `disconnect`,\n * `sendCommand`, `uploadFile`, `publish`, `unpublish`, `reconnect`,\n * …) is exposed automatically, alongside one typed method per\n * model event.\n *\n * Fields are pulled off the store one at a time so Zustand's\n * shallow-equality selector keeps each subscription scoped — a\n * component reading only `status` doesn't re-render when\n * `lastError` changes. Future SDK releases that add new\n * store fields flow into this hook on the next codegen run with no\n * hand-edit (the field list is derived from `js-sdk`'s d.ts via\n * `loadReactorStoreFieldsFromDts` in `sdk-surface.ts`).\n *\n * Each typed event method resolves with the command's correlated\n * reply: the declared reply message for commands that return one,\n * `undefined` once the handler completes for commands that don't.\n */\nexport function useH3ReferenceToVideoTurboRealtime() {\n const connect = useReactor((s) => s.connect);\n const connectOptions = useReactor((s) => s.connectOptions);\n const disconnect = useReactor((s) => s.disconnect);\n const downloadClipAsFile = useReactor((s) => s.downloadClipAsFile);\n const jwtToken = useReactor((s) => s.jwtToken);\n const lastError = useReactor((s) => s.lastError);\n const lastMessage = useReactor((s) => s.lastMessage);\n const pauseTrack = useReactor((s) => s.pauseTrack);\n const publish = useReactor((s) => s.publish);\n const reconnect = useReactor((s) => s.reconnect);\n const requestClip = useReactor((s) => s.requestClip);\n const requestRecording = useReactor((s) => s.requestRecording);\n const resumeTrack = useReactor((s) => s.resumeTrack);\n const sendCommand = useReactor((s) => s.sendCommand);\n const sessionId = useReactor((s) => s.sessionId);\n const status = useReactor((s) => s.status);\n const tracks = useReactor((s) => s.tracks);\n const unpublish = useReactor((s) => s.unpublish);\n const uploadFile = useReactor((s) => s.uploadFile);\n\n return {\n connect,\n connectOptions,\n disconnect,\n downloadClipAsFile,\n jwtToken,\n lastError,\n lastMessage,\n pauseTrack,\n publish,\n reconnect,\n requestClip,\n requestRecording,\n resumeTrack,\n sendCommand,\n sessionId,\n status,\n tracks,\n unpublish,\n uploadFile,\n pop: async (params: H3ReferenceToVideoTurboRealtimePopParams): Promise<H3ReferenceToVideoTurboRealtimeClipPoppedMessage | undefined> => {\n const reply = await sendCommand(\"pop\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeClipPoppedMessage>(reply);\n },\n move: async (params: H3ReferenceToVideoTurboRealtimeMoveParams): Promise<H3ReferenceToVideoTurboRealtimeClipMovedMessage | undefined> => {\n const reply = await sendCommand(\"move\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeClipMovedMessage>(reply);\n },\n play: async (params: H3ReferenceToVideoTurboRealtimePlayParams): Promise<undefined> => {\n await sendCommand(\"play\", params);\n return undefined;\n },\n stop: async (): Promise<undefined> => {\n await sendCommand(\"stop\", {});\n return undefined;\n },\n reset: async (): Promise<H3ReferenceToVideoTurboRealtimeSessionResetMessage | undefined> => {\n const reply = await sendCommand(\"reset\", {});\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeSessionResetMessage>(reply);\n },\n enqueue: async (params: H3ReferenceToVideoTurboRealtimeEnqueueParams): Promise<H3ReferenceToVideoTurboRealtimeClipQueuedMessage | undefined> => {\n const reply = await sendCommand(\"enqueue\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeClipQueuedMessage>(reply);\n },\n setSeed: async (params: H3ReferenceToVideoTurboRealtimeSetSeedParams): Promise<H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_seed\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage>(reply);\n },\n getQueue: async (): Promise<H3ReferenceToVideoTurboRealtimeQueueUpdateMessage | undefined> => {\n const reply = await sendCommand(\"get_queue\", {});\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeQueueUpdateMessage>(reply);\n },\n getState: async (): Promise<H3ReferenceToVideoTurboRealtimeStateUpdateMessage | undefined> => {\n const reply = await sendCommand(\"get_state\", {});\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeStateUpdateMessage>(reply);\n },\n setCanvas: async (params: H3ReferenceToVideoTurboRealtimeSetCanvasParams): Promise<H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_canvas\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage>(reply);\n },\n setAutoplay: async (params: H3ReferenceToVideoTurboRealtimeSetAutoplayParams): Promise<H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_autoplay\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage>(reply);\n },\n setClipSeconds: async (params: H3ReferenceToVideoTurboRealtimeSetClipSecondsParams): Promise<H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_clip_seconds\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage>(reply);\n },\n setFlushOnClipEnd: async (params: H3ReferenceToVideoTurboRealtimeSetFlushOnClipEndParams): Promise<H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_flush_on_clip_end\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage>(reply);\n },\n };\n}\n\n/**\n * Subscribe to any H3ReferenceToVideoTurboRealtime message with a fully-typed handler.\n * The handler receives a discriminated H3ReferenceToVideoTurboRealtimeMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeMessage(\n handler: (message: H3ReferenceToVideoTurboRealtimeMessage) => void,\n): void {\n useReactorMessage((msg: unknown) =>\n handler(_unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg)),\n );\n}\n\n/**\n * Subscribe to \"clip_moved\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeClipMovedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeClipMoved(\n handler: (message: H3ReferenceToVideoTurboRealtimeClipMovedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"clip_moved\") {\n handler(m as H3ReferenceToVideoTurboRealtimeClipMovedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_failed\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeClipFailedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeClipFailed(\n handler: (message: H3ReferenceToVideoTurboRealtimeClipFailedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"clip_failed\") {\n handler(m as H3ReferenceToVideoTurboRealtimeClipFailedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_popped\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeClipPoppedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeClipPopped(\n handler: (message: H3ReferenceToVideoTurboRealtimeClipPoppedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"clip_popped\") {\n handler(m as H3ReferenceToVideoTurboRealtimeClipPoppedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_queued\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeClipQueuedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeClipQueued(\n handler: (message: H3ReferenceToVideoTurboRealtimeClipQueuedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"clip_queued\") {\n handler(m as H3ReferenceToVideoTurboRealtimeClipQueuedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_started\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeClipStartedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeClipStarted(\n handler: (message: H3ReferenceToVideoTurboRealtimeClipStartedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"clip_started\") {\n handler(m as H3ReferenceToVideoTurboRealtimeClipStartedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_stopped\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeClipStoppedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeClipStopped(\n handler: (message: H3ReferenceToVideoTurboRealtimeClipStoppedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"clip_stopped\") {\n handler(m as H3ReferenceToVideoTurboRealtimeClipStoppedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"queue_update\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeQueueUpdateMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeQueueUpdate(\n handler: (message: H3ReferenceToVideoTurboRealtimeQueueUpdateMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"queue_update\") {\n handler(m as H3ReferenceToVideoTurboRealtimeQueueUpdateMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"state_update\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeStateUpdateMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeStateUpdate(\n handler: (message: H3ReferenceToVideoTurboRealtimeStateUpdateMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"state_update\") {\n handler(m as H3ReferenceToVideoTurboRealtimeStateUpdateMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_finished\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeClipFinishedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeClipFinished(\n handler: (message: H3ReferenceToVideoTurboRealtimeClipFinishedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"clip_finished\") {\n handler(m as H3ReferenceToVideoTurboRealtimeClipFinishedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"command_error\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeCommandErrorMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeCommandError(\n handler: (message: H3ReferenceToVideoTurboRealtimeCommandErrorMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"command_error\") {\n handler(m as H3ReferenceToVideoTurboRealtimeCommandErrorMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"seed_accepted\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeSeedAccepted(\n handler: (message: H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"seed_accepted\") {\n handler(m as H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"session_reset\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeSessionResetMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeSessionReset(\n handler: (message: H3ReferenceToVideoTurboRealtimeSessionResetMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"session_reset\") {\n handler(m as H3ReferenceToVideoTurboRealtimeSessionResetMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_generated\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeClipGeneratedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeClipGenerated(\n handler: (message: H3ReferenceToVideoTurboRealtimeClipGeneratedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"clip_generated\") {\n handler(m as H3ReferenceToVideoTurboRealtimeClipGeneratedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"flush_accepted\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeFlushAccepted(\n handler: (message: H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"flush_accepted\") {\n handler(m as H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"canvas_accepted\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeCanvasAccepted(\n handler: (message: H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"canvas_accepted\") {\n handler(m as H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"autoplay_accepted\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeAutoplayAccepted(\n handler: (message: H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"autoplay_accepted\") {\n handler(m as H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_length_accepted\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeClipLengthAccepted(\n handler: (message: H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"clip_length_accepted\") {\n handler(m as H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to a recvonly MediaStreamTrack the model publishes, by name.\n *\n * Returns `undefined` until the model emits the track, then the live track for the lifetime of the connection. `name` is constrained to the model's declared recvonly channels — use one of `H3ReferenceToVideoTurboRealtimeRecvTrackName`.\n * @param name - A recvonly track name declared by the model\n * @returns The live MediaStreamTrack, or `undefined` until received\n */\nexport function useH3ReferenceToVideoTurboRealtimeTrack(\n name: H3ReferenceToVideoTurboRealtimeRecvTrackName,\n): MediaStreamTrack | undefined {\n return useReactor((s) => s.tracks[name]);\n}\n\nexport type H3ReferenceToVideoTurboRealtimeMainVideoViewProps = Omit<ReactorViewProps, \"track\">;\n\n/**\n * Render the model's \"main_video\" recvonly video track in a `<video>` element.\n *\n * Thin wrapper around `<ReactorView>` with `track` pre-bound. Accepts every other `ReactorViewProps` (`audioTrack`, `className`, `style`, `videoObjectFit`, `muted`, …). Must be rendered inside `<H3ReferenceToVideoTurboRealtimeProvider>`.\n */\nexport function H3ReferenceToVideoTurboRealtimeMainVideoView(\n props: H3ReferenceToVideoTurboRealtimeMainVideoViewProps,\n): ReactElement {\n return <ReactorView {...props} track=\"main_video\" />;\n}\n"],"mappings":";;;;;;AAQA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AA6EH;AApCJ,SAAS,eAAkB,KAAiB;AAC1C,QAAM,MAAM;AACZ,MACE,OACA,OAAO,QAAQ,YACf,IAAI,QACJ,OAAO,IAAI,SAAS,UACpB;AACA,WAAO,EAAE,GAAG,IAAI,MAAM,MAAM,IAAI,KAAK;AAAA,EACvC;AACA,SAAO;AACT;AAoBO,SAAS,wCAAwC;AAAA,EACtD;AAAA,EACA,GAAG;AACL,GAA+D;AAC7D,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,MACX,aAAa,CAAC,GAAG,qCAAqC;AAAA,MAErD;AAAA;AAAA,EACH;AAEJ;AAwBO,SAAS,qCAAqC;AACnD,QAAM,UAAU,WAAW,CAAC,MAAM,EAAE,OAAO;AAC3C,QAAM,iBAAiB,WAAW,CAAC,MAAM,EAAE,cAAc;AACzD,QAAM,aAAa,WAAW,CAAC,MAAM,EAAE,UAAU;AACjD,QAAM,qBAAqB,WAAW,CAAC,MAAM,EAAE,kBAAkB;AACjE,QAAM,WAAW,WAAW,CAAC,MAAM,EAAE,QAAQ;AAC7C,QAAM,YAAY,WAAW,CAAC,MAAM,EAAE,S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ACF,CAAC;AACH;AAMO,SAAS,iDACd,SACM;AACN,oBAAkB,CAAC,QAAiB;AAClC,UAAM,IAAI,eAAuD,GAAG;AACpE,QAAI,EAAE,SAAS,mBAAmB;AAChC,cAAQ,CAAyD;AAAA,IACnE;AAAA,EACF,CAAC;AACH;AAMO,SAAS,mDACd,SACM;AACN,oBAAkB,CAAC,QAAiB;AAClC,UAAM,IAAI,eAAuD,GAAG;AACpE,QAAI,EAAE,SAAS,qBAAqB;AAClC,cAAQ,CAA2D;AAAA,IACrE;AAAA,EACF,CAAC;AACH;AAMO,SAAS,qDACd,SACM;AACN,oBAAkB,CAAC,QAAiB;AAClC,UAAM,IAAI,eAAuD,GAAG;AACpE,QAAI,EAAE,SAAS,wBAAwB;AACrC,cAAQ,CAA6D;AAAA,IACvE;AAAA,EACF,CAAC;AACH;AASO,SAAS,wCACd,MAC8B;AAC9B,SAAO,WAAW,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC;AACzC;AASO,SAAS,6CACd,OACc;AACd,SAAO,oBAAC,eAAa,GAAG,OAAO,OAAM,cAAa;AACpD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/react.tsx"],"sourcesContent":["// Copyright (c) 2026 Reactor Technologies, Inc. All rights reserved.\n\n// Auto-generated by @reactor-team/codegen — DO NOT EDIT\n// Model: h3-reference-to-video-turbo-realtime v0.4.0\n\n\"use client\";\n\nimport { type ReactElement } from \"react\";\nimport {\n ReactorProvider,\n useReactor,\n useReactorMessage,\n ReactorView,\n type ReactorViewProps,\n} from \"@reactor-team/js-sdk\";\nimport {\n MODEL_NAME,\n H3ReferenceToVideoTurboRealtimeTracks,\n type H3ReferenceToVideoTurboRealtimeOptions,\n type H3ReferenceToVideoTurboRealtimePopParams,\n type H3ReferenceToVideoTurboRealtimeMoveParams,\n type H3ReferenceToVideoTurboRealtimePlayParams,\n type H3ReferenceToVideoTurboRealtimeEnqueueParams,\n type H3ReferenceToVideoTurboRealtimeSetSeedParams,\n type H3ReferenceToVideoTurboRealtimeSetCanvasParams,\n type H3ReferenceToVideoTurboRealtimeSetAutoplayParams,\n type H3ReferenceToVideoTurboRealtimeSetClipSecondsParams,\n type H3ReferenceToVideoTurboRealtimeSetFlushOnClipEndParams,\n type H3ReferenceToVideoTurboRealtimeMessage,\n type H3ReferenceToVideoTurboRealtimeClipMovedMessage,\n type H3ReferenceToVideoTurboRealtimeClipFailedMessage,\n type H3ReferenceToVideoTurboRealtimeClipPoppedMessage,\n type H3ReferenceToVideoTurboRealtimeClipQueuedMessage,\n type H3ReferenceToVideoTurboRealtimeClipStartedMessage,\n type H3ReferenceToVideoTurboRealtimeClipStoppedMessage,\n type H3ReferenceToVideoTurboRealtimeQueueUpdateMessage,\n type H3ReferenceToVideoTurboRealtimeStateUpdateMessage,\n type H3ReferenceToVideoTurboRealtimeClipFinishedMessage,\n type H3ReferenceToVideoTurboRealtimeCommandErrorMessage,\n type H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage,\n type H3ReferenceToVideoTurboRealtimeSessionResetMessage,\n type H3ReferenceToVideoTurboRealtimeClipGeneratedMessage,\n type H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage,\n type H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage,\n type H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage,\n type H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage,\n type H3ReferenceToVideoTurboRealtimeRecvTrackName,\n} from \"./core.js\";\n\n/**\n * @internal Flatten the `{ type, data, uploads? }` envelope the SDK\n * hands to `reactor.on(\"message\", …)` so a field the model schema\n * declares on a message is reachable at `msg.<field>` — matching the\n * shape the exported message interfaces promise.\n */\nfunction _unwrapMessage<T>(raw: unknown): T {\n const env = raw as { type?: string; data?: Record<string, unknown> };\n if (\n env &&\n typeof env === \"object\" &&\n env.data &&\n typeof env.data === \"object\"\n ) {\n return { ...env.data, type: env.type } as T;\n }\n return raw as T;\n}\n\n/**\n * Props for the {@link H3ReferenceToVideoTurboRealtimeProvider} component.\n *\n * Derived from `ReactorProvider`'s own props, with `modelName` and\n * `modelTracks` stripped — those are supplied by this provider.\n */\nexport type H3ReferenceToVideoTurboRealtimeProviderProps = Omit<\n Parameters<typeof ReactorProvider>[0],\n \"modelName\" | \"modelTracks\"\n>;\n\n/**\n * Provider for the H3ReferenceToVideoTurboRealtime model.\n *\n * Wraps {@link ReactorProvider} with `modelName` and `modelTracks` pre-configured from the\n * generated constants. Drop this near the top of your tree, then use\n * {@link useH3ReferenceToVideoTurboRealtime} and the `useH3ReferenceToVideoTurboRealtime<Message>` hooks below it.\n */\nexport function H3ReferenceToVideoTurboRealtimeProvider({\n children,\n ...rest\n}: H3ReferenceToVideoTurboRealtimeProviderProps): ReactElement {\n return (\n <ReactorProvider\n {...rest}\n modelName={MODEL_NAME}\n modelTracks={[...H3ReferenceToVideoTurboRealtimeTracks]}\n >\n {children}\n </ReactorProvider>\n );\n}\n\n/**\n * Access the H3ReferenceToVideoTurboRealtime model as typed commands bound to the nearest\n * {@link H3ReferenceToVideoTurboRealtimeProvider}.\n *\n * Returns the full action surface — every public field on the SDK's\n * `ReactorStore` (`status`, `sessionId`, `connect`, `disconnect`,\n * `sendCommand`, `uploadFile`, `publish`, `unpublish`, `reconnect`,\n * …) is exposed automatically, alongside one typed method per\n * model event.\n *\n * Fields are pulled off the store one at a time so Zustand's\n * shallow-equality selector keeps each subscription scoped — a\n * component reading only `status` doesn't re-render when\n * `lastError` changes. Future SDK releases that add new\n * store fields flow into this hook on the next codegen run with no\n * hand-edit (the field list is derived from `js-sdk`'s d.ts via\n * `loadReactorStoreFieldsFromDts` in `sdk-surface.ts`).\n *\n * Each typed event method resolves with the command's correlated\n * reply: the declared reply message for commands that return one,\n * `undefined` once the handler completes for commands that don't.\n */\nexport function useH3ReferenceToVideoTurboRealtime() {\n const connect = useReactor((s) => s.connect);\n const connectOptions = useReactor((s) => s.connectOptions);\n const disconnect = useReactor((s) => s.disconnect);\n const downloadClipAsFile = useReactor((s) => s.downloadClipAsFile);\n const jwtToken = useReactor((s) => s.jwtToken);\n const lastError = useReactor((s) => s.lastError);\n const lastMessage = useReactor((s) => s.lastMessage);\n const pauseTrack = useReactor((s) => s.pauseTrack);\n const publish = useReactor((s) => s.publish);\n const reconnect = useReactor((s) => s.reconnect);\n const requestClip = useReactor((s) => s.requestClip);\n const requestRecording = useReactor((s) => s.requestRecording);\n const resumeTrack = useReactor((s) => s.resumeTrack);\n const sendCommand = useReactor((s) => s.sendCommand);\n const sessionId = useReactor((s) => s.sessionId);\n const status = useReactor((s) => s.status);\n const tracks = useReactor((s) => s.tracks);\n const unpublish = useReactor((s) => s.unpublish);\n const uploadFile = useReactor((s) => s.uploadFile);\n\n return {\n connect,\n connectOptions,\n disconnect,\n downloadClipAsFile,\n jwtToken,\n lastError,\n lastMessage,\n pauseTrack,\n publish,\n reconnect,\n requestClip,\n requestRecording,\n resumeTrack,\n sendCommand,\n sessionId,\n status,\n tracks,\n unpublish,\n uploadFile,\n pop: async (params: H3ReferenceToVideoTurboRealtimePopParams): Promise<H3ReferenceToVideoTurboRealtimeClipPoppedMessage | undefined> => {\n const reply = await sendCommand(\"pop\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeClipPoppedMessage>(reply);\n },\n move: async (params: H3ReferenceToVideoTurboRealtimeMoveParams): Promise<H3ReferenceToVideoTurboRealtimeClipMovedMessage | undefined> => {\n const reply = await sendCommand(\"move\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeClipMovedMessage>(reply);\n },\n play: async (params: H3ReferenceToVideoTurboRealtimePlayParams): Promise<undefined> => {\n await sendCommand(\"play\", params);\n return undefined;\n },\n stop: async (): Promise<undefined> => {\n await sendCommand(\"stop\", {});\n return undefined;\n },\n reset: async (): Promise<H3ReferenceToVideoTurboRealtimeSessionResetMessage | undefined> => {\n const reply = await sendCommand(\"reset\", {});\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeSessionResetMessage>(reply);\n },\n enqueue: async (params: H3ReferenceToVideoTurboRealtimeEnqueueParams): Promise<H3ReferenceToVideoTurboRealtimeClipQueuedMessage | undefined> => {\n const reply = await sendCommand(\"enqueue\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeClipQueuedMessage>(reply);\n },\n setSeed: async (params: H3ReferenceToVideoTurboRealtimeSetSeedParams): Promise<H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_seed\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage>(reply);\n },\n getQueue: async (): Promise<H3ReferenceToVideoTurboRealtimeQueueUpdateMessage | undefined> => {\n const reply = await sendCommand(\"get_queue\", {});\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeQueueUpdateMessage>(reply);\n },\n getState: async (): Promise<H3ReferenceToVideoTurboRealtimeStateUpdateMessage | undefined> => {\n const reply = await sendCommand(\"get_state\", {});\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeStateUpdateMessage>(reply);\n },\n setCanvas: async (params: H3ReferenceToVideoTurboRealtimeSetCanvasParams): Promise<H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_canvas\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage>(reply);\n },\n setAutoplay: async (params: H3ReferenceToVideoTurboRealtimeSetAutoplayParams): Promise<H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_autoplay\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage>(reply);\n },\n setClipSeconds: async (params: H3ReferenceToVideoTurboRealtimeSetClipSecondsParams): Promise<H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_clip_seconds\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage>(reply);\n },\n setFlushOnClipEnd: async (params: H3ReferenceToVideoTurboRealtimeSetFlushOnClipEndParams): Promise<H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_flush_on_clip_end\", params);\n return reply === undefined ? undefined : _unwrapMessage<H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage>(reply);\n },\n };\n}\n\n/**\n * Subscribe to any H3ReferenceToVideoTurboRealtime message with a fully-typed handler.\n * The handler receives a discriminated H3ReferenceToVideoTurboRealtimeMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeMessage(\n handler: (message: H3ReferenceToVideoTurboRealtimeMessage) => void,\n): void {\n useReactorMessage((msg: unknown) =>\n handler(_unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg)),\n );\n}\n\n/**\n * Subscribe to \"clip_moved\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeClipMovedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeClipMoved(\n handler: (message: H3ReferenceToVideoTurboRealtimeClipMovedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"clip_moved\") {\n handler(m as H3ReferenceToVideoTurboRealtimeClipMovedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_failed\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeClipFailedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeClipFailed(\n handler: (message: H3ReferenceToVideoTurboRealtimeClipFailedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"clip_failed\") {\n handler(m as H3ReferenceToVideoTurboRealtimeClipFailedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_popped\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeClipPoppedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeClipPopped(\n handler: (message: H3ReferenceToVideoTurboRealtimeClipPoppedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"clip_popped\") {\n handler(m as H3ReferenceToVideoTurboRealtimeClipPoppedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_queued\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeClipQueuedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeClipQueued(\n handler: (message: H3ReferenceToVideoTurboRealtimeClipQueuedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"clip_queued\") {\n handler(m as H3ReferenceToVideoTurboRealtimeClipQueuedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_started\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeClipStartedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeClipStarted(\n handler: (message: H3ReferenceToVideoTurboRealtimeClipStartedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"clip_started\") {\n handler(m as H3ReferenceToVideoTurboRealtimeClipStartedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_stopped\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeClipStoppedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeClipStopped(\n handler: (message: H3ReferenceToVideoTurboRealtimeClipStoppedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"clip_stopped\") {\n handler(m as H3ReferenceToVideoTurboRealtimeClipStoppedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"queue_update\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeQueueUpdateMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeQueueUpdate(\n handler: (message: H3ReferenceToVideoTurboRealtimeQueueUpdateMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"queue_update\") {\n handler(m as H3ReferenceToVideoTurboRealtimeQueueUpdateMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"state_update\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeStateUpdateMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeStateUpdate(\n handler: (message: H3ReferenceToVideoTurboRealtimeStateUpdateMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"state_update\") {\n handler(m as H3ReferenceToVideoTurboRealtimeStateUpdateMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_finished\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeClipFinishedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeClipFinished(\n handler: (message: H3ReferenceToVideoTurboRealtimeClipFinishedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"clip_finished\") {\n handler(m as H3ReferenceToVideoTurboRealtimeClipFinishedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"command_error\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeCommandErrorMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeCommandError(\n handler: (message: H3ReferenceToVideoTurboRealtimeCommandErrorMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"command_error\") {\n handler(m as H3ReferenceToVideoTurboRealtimeCommandErrorMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"seed_accepted\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeSeedAccepted(\n handler: (message: H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"seed_accepted\") {\n handler(m as H3ReferenceToVideoTurboRealtimeSeedAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"session_reset\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeSessionResetMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeSessionReset(\n handler: (message: H3ReferenceToVideoTurboRealtimeSessionResetMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"session_reset\") {\n handler(m as H3ReferenceToVideoTurboRealtimeSessionResetMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_generated\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeClipGeneratedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeClipGenerated(\n handler: (message: H3ReferenceToVideoTurboRealtimeClipGeneratedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"clip_generated\") {\n handler(m as H3ReferenceToVideoTurboRealtimeClipGeneratedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"flush_accepted\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeFlushAccepted(\n handler: (message: H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"flush_accepted\") {\n handler(m as H3ReferenceToVideoTurboRealtimeFlushAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"canvas_accepted\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeCanvasAccepted(\n handler: (message: H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"canvas_accepted\") {\n handler(m as H3ReferenceToVideoTurboRealtimeCanvasAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"autoplay_accepted\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeAutoplayAccepted(\n handler: (message: H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"autoplay_accepted\") {\n handler(m as H3ReferenceToVideoTurboRealtimeAutoplayAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_length_accepted\" messages only.\n * Handler receives a fully-typed H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage.\n */\nexport function useH3ReferenceToVideoTurboRealtimeClipLengthAccepted(\n handler: (message: H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<H3ReferenceToVideoTurboRealtimeMessage>(msg);\n if (m.type === \"clip_length_accepted\") {\n handler(m as H3ReferenceToVideoTurboRealtimeClipLengthAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to a recvonly MediaStreamTrack the model publishes, by name.\n *\n * Returns `undefined` until the model emits the track, then the live track for the lifetime of the connection. `name` is constrained to the model's declared recvonly channels — use one of `H3ReferenceToVideoTurboRealtimeRecvTrackName`.\n * @param name - A recvonly track name declared by the model\n * @returns The live MediaStreamTrack, or `undefined` until received\n */\nexport function useH3ReferenceToVideoTurboRealtimeTrack(\n name: H3ReferenceToVideoTurboRealtimeRecvTrackName,\n): MediaStreamTrack | undefined {\n return useReactor((s) => s.tracks[name]);\n}\n\nexport type H3ReferenceToVideoTurboRealtimeMainVideoViewProps = Omit<ReactorViewProps, \"track\">;\n\n/**\n * Render the model's \"main_video\" recvonly video track in a `<video>` element.\n *\n * Thin wrapper around `<ReactorView>` with `track` pre-bound. Accepts every other `ReactorViewProps` (`audioTrack`, `className`, `style`, `videoObjectFit`, `muted`, …). Must be rendered inside `<H3ReferenceToVideoTurboRealtimeProvider>`.\n */\nexport function H3ReferenceToVideoTurboRealtimeMainVideoView(\n props: H3ReferenceToVideoTurboRealtimeMainVideoViewProps,\n): ReactElement {\n return <ReactorView {...props} track=\"main_video\" />;\n}\n"],"mappings":";;;;;;AAQA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AA6EH;AApCJ,SAAS,eAAkB,KAAiB;AAC1C,QAAM,MAAM;AACZ,MACE,OACA,OAAO,QAAQ,YACf,IAAI,QACJ,OAAO,IAAI,SAAS,UACpB;AACA,WAAO,EAAE,GAAG,IAAI,MAAM,MAAM,IAAI,KAAK;AAAA,EACvC;AACA,SAAO;AACT;AAoBO,SAAS,wCAAwC;AAAA,EACtD;AAAA,EACA,GAAG;AACL,GAA+D;AAC7D,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WA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,SAAS,iBAAiB;AAC9B,cAAQ,CAAuD;AAAA,IACjE;AAAA,EACF,CAAC;AACH;AAMO,SAAS,gDACd,SACM;AACN,oBAAkB,CAAC,QAAiB;AAClC,UAAM,IAAI,eAAuD,GAAG;AACpE,QAAI,EAAE,SAAS,kBAAkB;AAC/B,cAAQ,CAAwD;AAAA,IAClE;AAAA,EACF,CAAC;AACH;AAMO,SAAS,gDACd,SACM;AACN,oBAAkB,CAAC,QAAiB;AAClC,UAAM,IAAI,eAAuD,GAAG;AACpE,QAAI,EAAE,SAAS,kBAAkB;AAC/B,cAAQ,CAAwD;AAAA,IAClE;AAAA,EACF,CAAC;AACH;AAMO,SAAS,iDACd,SACM;AACN,oBAAkB,CAAC,QAAiB;AAClC,UAAM,IAAI,eAAuD,GAAG;AACpE,QAAI,EAAE,SAAS,mBAAmB;AAChC,cAAQ,CAAyD;AAAA,IACnE;AAAA,EACF,CAAC;AACH;AAMO,SAAS,mDACd,SACM;AACN,oBAAkB,CAAC,QAAiB;AAClC,UAAM,IAAI,eAAuD,GAAG;AACpE,QAAI,EAAE,SAAS,qBAAqB;AAClC,cAAQ,CAA2D;AAAA,IACrE;AAAA,EACF,CAAC;AACH;AAMO,SAAS,qDACd,SACM;AACN,oBAAkB,CAAC,QAAiB;AAClC,UAAM,IAAI,eAAuD,GAAG;AACpE,QAAI,EAAE,SAAS,wBAAwB;AACrC,cAAQ,CAA6D;AAAA,IACvE;AAAA,EACF,CAAC;AACH;AASO,SAAS,wCACd,MAC8B;AAC9B,SAAO,WAAW,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC;AACzC;AASO,SAAS,6CACd,OACc;AACd,SAAO,oBAAC,eAAa,GAAG,OAAO,OAAM,cAAa;AACpD;","names":[]}
|
package/dist/core.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { FileRef, Reactor } from '@reactor-team/js-sdk';
|
|
|
2
2
|
export { FileRef } from '@reactor-team/js-sdk';
|
|
3
3
|
|
|
4
4
|
declare const MODEL_NAME: "reactor/h3-reference-to-video-turbo-realtime";
|
|
5
|
-
declare const MODEL_VERSION: "v0.
|
|
5
|
+
declare const MODEL_VERSION: "v0.4.0";
|
|
6
6
|
/**
|
|
7
7
|
* Preset media tracks for the H3ReferenceToVideoTurboRealtime model.
|
|
8
8
|
*
|
|
@@ -51,7 +51,7 @@ interface H3ReferenceToVideoTurboRealtimePlayParams {
|
|
|
51
51
|
*/
|
|
52
52
|
clip_id?: string;
|
|
53
53
|
}
|
|
54
|
-
/** Queue a clip with 1–9 reference images at position
|
|
54
|
+
/** Queue a clip with 1–9 reference images, and optionally up to 3 reference audio clips, at position or at the back. Each clip keeps its own prompt and ordered references: new references do not alter earlier requests. Images guide appearance, audio conditions the generated soundtrack; neither is 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, audio without an image, too many references, invalid parameters or a full generation queue. */
|
|
55
55
|
interface H3ReferenceToVideoTurboRealtimeEnqueueParams {
|
|
56
56
|
/**
|
|
57
57
|
* Omitted or null uses and advances the default seed. An explicit seed leaves the default unchanged.
|
|
@@ -83,11 +83,21 @@ interface H3ReferenceToVideoTurboRealtimeEnqueueParams {
|
|
|
83
83
|
* @default null
|
|
84
84
|
*/
|
|
85
85
|
position?: number | null;
|
|
86
|
+
/**
|
|
87
|
+
* One optional WAV, MP3, AAC/M4A, OGG/Opus, FLAC or WebM clip whose voice, music or soundscape the generated soundtrack is conditioned to resemble. Pairs with the image references; it is not a first or last frame. Supply this or reference_audios, not both.
|
|
88
|
+
* @default null
|
|
89
|
+
*/
|
|
90
|
+
reference_audio?: FileRef | null;
|
|
86
91
|
/**
|
|
87
92
|
* One JPEG, PNG or WebP reference for this clip. Guides subjects and appearance, not a keyframe. Supply this or reference_images, not both.
|
|
88
93
|
* @default null
|
|
89
94
|
*/
|
|
90
95
|
reference_image?: FileRef | null;
|
|
96
|
+
/**
|
|
97
|
+
* Ordered list of up to 3 uploaded audio clips (WAV, MP3, AAC/M4A, OGG/Opus, FLAC or WebM). In the prompt, Audio 1 names the first, Audio 2 the second, and so on; each conditions the generated soundtrack's timbre/soundscape. Audio must accompany at least one reference image and is never sent on its own. Supply this or reference_audio, not both.
|
|
98
|
+
* @default null
|
|
99
|
+
*/
|
|
100
|
+
reference_audios?: FileRef[] | null;
|
|
91
101
|
/**
|
|
92
102
|
* 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
103
|
* @default null
|
|
@@ -154,7 +164,9 @@ interface H3ReferenceToVideoTurboRealtimeClipMovedMessage {
|
|
|
154
164
|
"clip_id": string;
|
|
155
165
|
"seconds": number;
|
|
156
166
|
"metadata": string;
|
|
167
|
+
"has_reference_audio"?: boolean;
|
|
157
168
|
"has_reference_image"?: boolean;
|
|
169
|
+
"reference_audio_count"?: number;
|
|
158
170
|
"reference_image_count"?: number;
|
|
159
171
|
};
|
|
160
172
|
/** Queue containing the clip: generation or playout. */
|
|
@@ -174,7 +186,9 @@ interface H3ReferenceToVideoTurboRealtimeClipFailedMessage {
|
|
|
174
186
|
"clip_id": string;
|
|
175
187
|
"seconds": number;
|
|
176
188
|
"metadata": string;
|
|
189
|
+
"has_reference_audio"?: boolean;
|
|
177
190
|
"has_reference_image"?: boolean;
|
|
191
|
+
"reference_audio_count"?: number;
|
|
178
192
|
"reference_image_count"?: number;
|
|
179
193
|
};
|
|
180
194
|
/** Why generation failed. */
|
|
@@ -192,7 +206,9 @@ interface H3ReferenceToVideoTurboRealtimeClipPoppedMessage {
|
|
|
192
206
|
"clip_id": string;
|
|
193
207
|
"seconds": number;
|
|
194
208
|
"metadata": string;
|
|
209
|
+
"has_reference_audio"?: boolean;
|
|
195
210
|
"has_reference_image"?: boolean;
|
|
211
|
+
"reference_audio_count"?: number;
|
|
196
212
|
"reference_image_count"?: number;
|
|
197
213
|
};
|
|
198
214
|
}
|
|
@@ -208,7 +224,9 @@ interface H3ReferenceToVideoTurboRealtimeClipQueuedMessage {
|
|
|
208
224
|
"clip_id": string;
|
|
209
225
|
"seconds": number;
|
|
210
226
|
"metadata": string;
|
|
227
|
+
"has_reference_audio"?: boolean;
|
|
211
228
|
"has_reference_image"?: boolean;
|
|
229
|
+
"reference_audio_count"?: number;
|
|
212
230
|
"reference_image_count"?: number;
|
|
213
231
|
};
|
|
214
232
|
}
|
|
@@ -224,7 +242,9 @@ interface H3ReferenceToVideoTurboRealtimeClipStartedMessage {
|
|
|
224
242
|
"clip_id": string;
|
|
225
243
|
"seconds": number;
|
|
226
244
|
"metadata": string;
|
|
245
|
+
"has_reference_audio"?: boolean;
|
|
227
246
|
"has_reference_image"?: boolean;
|
|
247
|
+
"reference_audio_count"?: number;
|
|
228
248
|
"reference_image_count"?: number;
|
|
229
249
|
};
|
|
230
250
|
}
|
|
@@ -240,7 +260,9 @@ interface H3ReferenceToVideoTurboRealtimeClipStoppedMessage {
|
|
|
240
260
|
"clip_id": string;
|
|
241
261
|
"seconds": number;
|
|
242
262
|
"metadata": string;
|
|
263
|
+
"has_reference_audio"?: boolean;
|
|
243
264
|
"has_reference_image"?: boolean;
|
|
265
|
+
"reference_audio_count"?: number;
|
|
244
266
|
"reference_image_count"?: number;
|
|
245
267
|
};
|
|
246
268
|
/** Total seconds sent in the session. */
|
|
@@ -258,7 +280,9 @@ interface H3ReferenceToVideoTurboRealtimeQueueUpdateMessage {
|
|
|
258
280
|
"clip_id": string;
|
|
259
281
|
"seconds": number;
|
|
260
282
|
"metadata": string;
|
|
283
|
+
"has_reference_audio"?: boolean;
|
|
261
284
|
"has_reference_image"?: boolean;
|
|
285
|
+
"reference_audio_count"?: number;
|
|
262
286
|
"reference_image_count"?: number;
|
|
263
287
|
}[];
|
|
264
288
|
/** Built clips ready to play, front first. */
|
|
@@ -270,7 +294,9 @@ interface H3ReferenceToVideoTurboRealtimeQueueUpdateMessage {
|
|
|
270
294
|
"clip_id": string;
|
|
271
295
|
"seconds": number;
|
|
272
296
|
"metadata": string;
|
|
297
|
+
"has_reference_audio"?: boolean;
|
|
273
298
|
"has_reference_image"?: boolean;
|
|
299
|
+
"reference_audio_count"?: number;
|
|
274
300
|
"reference_image_count"?: number;
|
|
275
301
|
}[];
|
|
276
302
|
/** Waiting/in-flight builds, front first. */
|
|
@@ -282,7 +308,9 @@ interface H3ReferenceToVideoTurboRealtimeQueueUpdateMessage {
|
|
|
282
308
|
"clip_id": string;
|
|
283
309
|
"seconds": number;
|
|
284
310
|
"metadata": string;
|
|
311
|
+
"has_reference_audio"?: boolean;
|
|
285
312
|
"has_reference_image"?: boolean;
|
|
313
|
+
"reference_audio_count"?: number;
|
|
286
314
|
"reference_image_count"?: number;
|
|
287
315
|
}[];
|
|
288
316
|
}
|
|
@@ -338,7 +366,9 @@ interface H3ReferenceToVideoTurboRealtimeClipFinishedMessage {
|
|
|
338
366
|
"clip_id": string;
|
|
339
367
|
"seconds": number;
|
|
340
368
|
"metadata": string;
|
|
369
|
+
"has_reference_audio"?: boolean;
|
|
341
370
|
"has_reference_image"?: boolean;
|
|
371
|
+
"reference_audio_count"?: number;
|
|
342
372
|
"reference_image_count"?: number;
|
|
343
373
|
};
|
|
344
374
|
/** Total seconds sent in the session, including this clip. */
|
|
@@ -378,7 +408,9 @@ interface H3ReferenceToVideoTurboRealtimeClipGeneratedMessage {
|
|
|
378
408
|
"clip_id": string;
|
|
379
409
|
"seconds": number;
|
|
380
410
|
"metadata": string;
|
|
411
|
+
"has_reference_audio"?: boolean;
|
|
381
412
|
"has_reference_image"?: boolean;
|
|
413
|
+
"reference_audio_count"?: number;
|
|
382
414
|
"reference_image_count"?: number;
|
|
383
415
|
};
|
|
384
416
|
}
|
|
@@ -464,8 +496,8 @@ declare class H3ReferenceToVideoTurboRealtimeModel extends Reactor {
|
|
|
464
496
|
*/
|
|
465
497
|
reset(): Promise<H3ReferenceToVideoTurboRealtimeSessionResetMessage | undefined>;
|
|
466
498
|
/**
|
|
467
|
-
* Queue a clip with 1–9 reference images at position
|
|
468
|
-
* @param params - Queue a clip with 1–9 reference images at position
|
|
499
|
+
* Queue a clip with 1–9 reference images, and optionally up to 3 reference audio clips, at position or at the back. Each clip keeps its own prompt and ordered references: new references do not alter earlier requests. Images guide appearance, audio conditions the generated soundtrack; neither is 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, audio without an image, too many references, invalid parameters or a full generation queue.
|
|
500
|
+
* @param params - Queue a clip with 1–9 reference images, and optionally up to 3 reference audio clips, at position or at the back. Each clip keeps its own prompt and ordered references: new references do not alter earlier requests. Images guide appearance, audio conditions the generated soundtrack; neither is 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, audio without an image, too many references, invalid parameters or a full generation queue.
|
|
469
501
|
* @returns The correlated {@link H3ReferenceToVideoTurboRealtimeClipQueuedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
|
|
470
502
|
*/
|
|
471
503
|
enqueue(params: H3ReferenceToVideoTurboRealtimeEnqueueParams): Promise<H3ReferenceToVideoTurboRealtimeClipQueuedMessage | undefined>;
|