@reactor-models/fast-h3 1.0.2 → 1.1.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 +16 -15
- package/dist/{chunk-NMQA7NIH.mjs → chunk-BE5NWNKY.mjs} +4 -4
- package/dist/chunk-BE5NWNKY.mjs.map +1 -0
- package/dist/{chunk-4DZUZYZH.mjs → chunk-CKECQBJK.mjs} +2 -2
- package/dist/{chunk-4DZUZYZH.mjs.map → chunk-CKECQBJK.mjs.map} +1 -1
- package/dist/core.d.mts +20 -4
- package/dist/core.d.ts +20 -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-NMQA7NIH.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @reactor-models/fast-h3
|
|
2
2
|
|
|
3
|
-
> Typed JavaScript + React SDK for the **FastH3** model on [Reactor](https://reactor.inc). Version **v1.0
|
|
3
|
+
> Typed JavaScript + React SDK for the **FastH3** model on [Reactor](https://reactor.inc). Version **v1.1.0**.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -331,7 +331,7 @@ function Example() {
|
|
|
331
331
|
|
|
332
332
|
### `enqueue`
|
|
333
333
|
|
|
334
|
-
Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by [`clip_generated`](#clip_generated). The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch [`queue_update`](#queue_update) for the clip turning ready. Replies [`clip_queued`](#clip_queued) with the clip's UUID and emits [`queue_update`](#queue_update) and [`state_update`](#state_update), or [`command_error`](#command_error) when the queue is full, the prompt is empty, both a starting frame and a source clip are given, the source clip is unknown or no longer retained, or the upload is not a decodable image.
|
|
334
|
+
Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by [`clip_generated`](#clip_generated). The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. An `ending_frame` can accompany any of these — or stand alone — to make the clip animate *into* and close on that image; with a starting frame or a continued opener it is first-and-last, with neither it is last-frame only. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch [`queue_update`](#queue_update) for the clip turning ready. Replies [`clip_queued`](#clip_queued) with the clip's UUID and emits [`queue_update`](#queue_update) and [`state_update`](#state_update), or [`command_error`](#command_error) when the queue is full, the prompt is empty, both a starting frame and a source clip are given, the source clip is unknown or no longer retained, or the upload is not a decodable image.
|
|
335
335
|
|
|
336
336
|
Returns: [`clip_queued`](#clip_queued) — `{ type: "clip_queued", clip: null }` (or `undefined` when the send fails).
|
|
337
337
|
|
|
@@ -342,6 +342,7 @@ Returns: [`clip_queued`](#clip_queued) — `{ type: "clip_queued", clip: null }`
|
|
|
342
342
|
| `seconds` | `number \| null` | Length of this clip in seconds, between 5.167 and 14.375, snapped to the nearest length the model can produce; the clip's structure reports the effective value. Omitted or null, the session default applies. A length the deployment has not built before pays a one-off compile cost on its first build. _(min 5.167, max 14.375, default `null`)_ |
|
|
343
343
|
| `metadata` | `string` | Free-form string stored with the clip and echoed back on every message that references it. The model never reads it; use it to correlate clips with your own records — who asked for it, which group it belongs to, display text. _(maxLength 2000, default `""`)_ |
|
|
344
344
|
| `position` | `number \| null` | Where the clip enters the generation queue: 0 is the front (the next build), larger values count back from there, and anything past the end — or omitted — appends. The clip already building is unaffected either way. [`queue_update`](#queue_update) reports the resulting order. _(min 0, default `null`)_ |
|
|
345
|
+
| `ending_frame` | `FileRef \| null` | A still image the clip animates into and closes on — its last frame. Common formats decode; the frame is fitted to the session canvas. Combine it with a `starting_frame` (or a `continue_from_clip_id` opener) for first-and-last generation, or send it alone to fix only the ending. Omit for a clip with no fixed end. Independent of how the clip opens, so it pairs with either opener. _(default `null`)_ |
|
|
345
346
|
| `starting_frame` | `FileRef \| null` | A still image the clip opens from and animates forward — image-to-video. Common formats decode; the frame is fitted to the session canvas. To continue from a video, extract the frame you want and send it here. Omit for a clip opening from text or from another clip; at most one of this and `continue_from_clip_id`. _(default `null`)_ |
|
|
346
347
|
| `continue_from_clip_id` | `string` | UUID of the clip whose last frame this one opens from and animates forward — how clips chain into a continuing scene. Any clip in either queue or in `queue_update.history` qualifies, including one that has not built yet: this clip then waits for it. Blank for a clip opening from text or from an uploaded frame; at most one of this and `starting_frame`. _(default `""`)_ |
|
|
347
348
|
|
|
@@ -354,7 +355,7 @@ const fastH3 = new FastH3Model();
|
|
|
354
355
|
await fastH3.connect(jwt);
|
|
355
356
|
|
|
356
357
|
const fileRef = await fastH3.uploadFile(blob);
|
|
357
|
-
const reply = await fastH3.enqueue({
|
|
358
|
+
const reply = await fastH3.enqueue({ ending_frame: fileRef, seed: null, prompt: "A sunset over the ocean", seconds: null, metadata: "", position: null, starting_frame: null, continue_from_clip_id: "" });
|
|
358
359
|
|
|
359
360
|
if (reply) {
|
|
360
361
|
console.log("clip_queued", reply.clip);
|
|
@@ -372,7 +373,7 @@ function Example() {
|
|
|
372
373
|
|
|
373
374
|
async function handlePick(file: File) {
|
|
374
375
|
const ref = await uploadFile(file);
|
|
375
|
-
await enqueue({
|
|
376
|
+
await enqueue({ ending_frame: ref, seed: null, prompt: "A sunset over the ocean", seconds: null, metadata: "", position: null, starting_frame: null, continue_from_clip_id: "" });
|
|
376
377
|
}
|
|
377
378
|
|
|
378
379
|
return <input type="file" onChange={(e) => handlePick(e.target.files![0])} />;
|
|
@@ -683,7 +684,7 @@ Listener: `onClipMoved` · React hook: `useFastH3ClipMoved`
|
|
|
683
684
|
|
|
684
685
|
| Field | Type | Description |
|
|
685
686
|
|---|---|---|
|
|
686
|
-
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }` | The clip that moved. |
|
|
687
|
+
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_ending_frame"?: boolean; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }` | The clip that moved. |
|
|
687
688
|
| `queue` | `string` | Which queue it moved within: `generation` or `playout`. |
|
|
688
689
|
| `position` | `number` | The clip's resulting position in that queue, 0 = front. |
|
|
689
690
|
|
|
@@ -731,7 +732,7 @@ Listener: `onClipFailed` · React hook: `useFastH3ClipFailed`
|
|
|
731
732
|
|
|
732
733
|
| Field | Type | Description |
|
|
733
734
|
|---|---|---|
|
|
734
|
-
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }` | The clip whose build failed. |
|
|
735
|
+
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_ending_frame"?: boolean; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }` | The clip whose build failed. |
|
|
735
736
|
| `reason` | `string` | What went wrong. |
|
|
736
737
|
|
|
737
738
|
#### JavaScript
|
|
@@ -768,7 +769,7 @@ Listener: `onClipPopped` · React hook: `useFastH3ClipPopped`
|
|
|
768
769
|
|
|
769
770
|
| Field | Type | Description |
|
|
770
771
|
|---|---|---|
|
|
771
|
-
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }` | The clip that left its queue. |
|
|
772
|
+
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_ending_frame"?: boolean; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }` | The clip that left its queue. |
|
|
772
773
|
|
|
773
774
|
#### JavaScript
|
|
774
775
|
|
|
@@ -801,7 +802,7 @@ Listener: `onClipQueued` · React hook: `useFastH3ClipQueued`
|
|
|
801
802
|
|
|
802
803
|
| Field | Type | Description |
|
|
803
804
|
|---|---|---|
|
|
804
|
-
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }` | The queued clip, UUID included. `ready` is false here; [`clip_generated`](#clip_generated) announces it crossing into the playout queue. |
|
|
805
|
+
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_ending_frame"?: boolean; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }` | The queued clip, UUID included. `ready` is false here; [`clip_generated`](#clip_generated) announces it crossing into the playout queue. |
|
|
805
806
|
|
|
806
807
|
#### JavaScript
|
|
807
808
|
|
|
@@ -834,7 +835,7 @@ Listener: `onClipStarted` · React hook: `useFastH3ClipStarted`
|
|
|
834
835
|
|
|
835
836
|
| Field | Type | Description |
|
|
836
837
|
|---|---|---|
|
|
837
|
-
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }` | The clip now playing. |
|
|
838
|
+
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_ending_frame"?: boolean; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }` | The clip now playing. |
|
|
838
839
|
|
|
839
840
|
#### JavaScript
|
|
840
841
|
|
|
@@ -871,7 +872,7 @@ Listener: `onClipStopped` · React hook: `useFastH3ClipStopped`
|
|
|
871
872
|
|
|
872
873
|
| Field | Type | Description |
|
|
873
874
|
|---|---|---|
|
|
874
|
-
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }` | The clip that was cut. |
|
|
875
|
+
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_ending_frame"?: boolean; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }` | The clip that was cut. |
|
|
875
876
|
| `seconds_sent` | `number` | Seconds of video and audio sent since the session began. |
|
|
876
877
|
|
|
877
878
|
#### JavaScript
|
|
@@ -911,9 +912,9 @@ Listener: `onQueueUpdate` · React hook: `useFastH3QueueUpdate`
|
|
|
911
912
|
|
|
912
913
|
| Field | Type | Description |
|
|
913
914
|
|---|---|---|
|
|
914
|
-
| `history` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }[]` | Built clips no longer queued — played, stopped, or popped — whose last frame is still retained, oldest first. No longer playable ([`play`](#play) refuses them), but any can be named in [`enqueue`](#enqueue)'s `continue_from_clip_id`; the oldest are evicted as new builds finish, so the front of this list is what expires next. |
|
|
915
|
-
| `playout` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }[]` | Built clips waiting to play, front first. A finished build joins at the back; bare [`play`](#play) (and autoplay) takes the front; [`move`](#move) reorders; playing or [`pop`](#pop) consumes. |
|
|
916
|
-
| `generation` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }[]` | Clips waiting to build, front first. Builds consume this queue from the front, one at a time, pausing only while `playout` is at capacity; a clip whose `continue_from_clip_id` source is not built yet is skipped until it is, without blocking the rest. [`enqueue`](#enqueue)'s `position` and [`move`](#move) control the order. |
|
|
915
|
+
| `history` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_ending_frame"?: boolean; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }[]` | Built clips no longer queued — played, stopped, or popped — whose last frame is still retained, oldest first. No longer playable ([`play`](#play) refuses them), but any can be named in [`enqueue`](#enqueue)'s `continue_from_clip_id`; the oldest are evicted as new builds finish, so the front of this list is what expires next. |
|
|
916
|
+
| `playout` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_ending_frame"?: boolean; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }[]` | Built clips waiting to play, front first. A finished build joins at the back; bare [`play`](#play) (and autoplay) takes the front; [`move`](#move) reorders; playing or [`pop`](#pop) consumes. |
|
|
917
|
+
| `generation` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_ending_frame"?: boolean; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }[]` | Clips waiting to build, front first. Builds consume this queue from the front, one at a time, pausing only while `playout` is at capacity; a clip whose `continue_from_clip_id` source is not built yet is skipped until it is, without blocking the rest. [`enqueue`](#enqueue)'s `position` and [`move`](#move) control the order. |
|
|
917
918
|
|
|
918
919
|
#### JavaScript
|
|
919
920
|
|
|
@@ -1053,7 +1054,7 @@ Listener: `onClipFinished` · React hook: `useFastH3ClipFinished`
|
|
|
1053
1054
|
|
|
1054
1055
|
| Field | Type | Description |
|
|
1055
1056
|
|---|---|---|
|
|
1056
|
-
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }` | The clip that just finished. |
|
|
1057
|
+
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_ending_frame"?: boolean; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }` | The clip that just finished. |
|
|
1057
1058
|
| `seconds_sent` | `number` | Seconds of video and audio sent since the session began, this clip included. |
|
|
1058
1059
|
|
|
1059
1060
|
#### JavaScript
|
|
@@ -1195,7 +1196,7 @@ Listener: `onClipGenerated` · React hook: `useFastH3ClipGenerated`
|
|
|
1195
1196
|
|
|
1196
1197
|
| Field | Type | Description |
|
|
1197
1198
|
|---|---|---|
|
|
1198
|
-
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }` | The freshly built clip, now at the back of the playout queue. |
|
|
1199
|
+
| `clip` | `{ "seed": number; "ready": boolean; "frames": number; "prompt": string; "clip_id": string; "seconds": number; "metadata": string; "has_ending_frame"?: boolean; "has_starting_frame": boolean; "continue_from_clip_id": string \| null }` | The freshly built clip, now at the back of the playout queue. |
|
|
1199
1200
|
|
|
1200
1201
|
#### JavaScript
|
|
1201
1202
|
|
|
@@ -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/fast-h3";
|
|
4
|
-
var MODEL_VERSION = "v1.0
|
|
4
|
+
var MODEL_VERSION = "v1.1.0";
|
|
5
5
|
var FastH3Tracks = [
|
|
6
6
|
{ name: "main_video", kind: "video", direction: "recvonly" },
|
|
7
7
|
{ name: "main_audio", kind: "audio", direction: "recvonly" }
|
|
@@ -69,8 +69,8 @@ var FastH3Model = class extends Reactor {
|
|
|
69
69
|
return reply === void 0 ? void 0 : _unwrapMessage(reply);
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
|
-
* Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`, or `command_error` when the queue is full, the prompt is empty, both a starting frame and a source clip are given, the source clip is unknown or no longer retained, or the upload is not a decodable image.
|
|
73
|
-
* @param params - Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`, or `command_error` when the queue is full, the prompt is empty, both a starting frame and a source clip are given, the source clip is unknown or no longer retained, or the upload is not a decodable image.
|
|
72
|
+
* Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. An `ending_frame` can accompany any of these — or stand alone — to make the clip animate *into* and close on that image; with a starting frame or a continued opener it is first-and-last, with neither it is last-frame only. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`, or `command_error` when the queue is full, the prompt is empty, both a starting frame and a source clip are given, the source clip is unknown or no longer retained, or the upload is not a decodable image.
|
|
73
|
+
* @param params - Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. An `ending_frame` can accompany any of these — or stand alone — to make the clip animate *into* and close on that image; with a starting frame or a continued opener it is first-and-last, with neither it is last-frame only. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`, or `command_error` when the queue is full, the prompt is empty, both a starting frame and a source clip are given, the source clip is unknown or no longer retained, or the upload is not a decodable image.
|
|
74
74
|
* @returns The correlated {@link FastH3ClipQueuedMessage} 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
|
FastH3Tracks,
|
|
341
341
|
FastH3Model
|
|
342
342
|
};
|
|
343
|
-
//# sourceMappingURL=chunk-
|
|
343
|
+
//# sourceMappingURL=chunk-BE5NWNKY.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: fast-h3 v1.1.0\n\nimport { Reactor, FileRef } from \"@reactor-team/js-sdk\";\nexport { FileRef };\n\nexport const MODEL_NAME = \"reactor/fast-h3\" as const;\nexport const MODEL_VERSION = \"v1.1.0\" as const;\n\n/**\n * Preset media tracks for the FastH3 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 FastH3Tracks = [\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 FastH3RecvTrackName =\n \"main_video\"\n | \"main_audio\";\n\n/** Remove one clip by its UUID from whichever queue holds it, freeing its slot. Works on generating and built clips alike; a build already running for it is discarded when it completes. The clip that is playing is in neither queue — `stop` is the command that cuts it. A built clip stays in `queue_update.history` after popping, so clips continued from it are unaffected; an unbuilt clip that queued clips continue from is refused, since popping it would leave them nothing to open from — pop those first. Emits `clip_popped`, `queue_update` and `state_update`, or `command_error` when no queued clip has that id or queued clips still continue from it. */\nexport interface FastH3PopParams {\n /**\n * UUID of the queued clip to remove, from `clip_queued` or `queue_update`.\n * @default \"\"\n */\n\n clip_id?: string;\n}\n\n/** Reposition one clip within the queue that holds it — the generation queue for a clip still to build, the playout queue for a built one; clips never move between queues except by building. `position` 0 is the front: the next build, or what bare `play` and autoplay take next. Values past the end mean the back. Replies `clip_moved` with the queue and the resulting position, and emits `queue_update`; `command_error` when no queued clip has that id. */\nexport interface FastH3MoveParams {\n /**\n * UUID of the queued clip to move, from any clip-referencing message.\n * @default \"\"\n */\n\n clip_id?: string;\n /**\n * Target position in the clip's queue, 0 = front; clamped to the end.\n * @minimum 0\n * @default 0\n */\n\n position?: number;\n}\n\n/** Play one clip from the playout queue. Blank `clip_id` plays the front clip; a UUID plays that specific one. Playing consumes the entry: it leaves the queue, `clip_started` marks its first frames, and when it ends the stream holds on black until the next `play`. Emits `queue_update` and `state_update`, or `command_error` when a clip is already playing, the id is unknown, or the clip is still generating. */\nexport interface FastH3PlayParams {\n /**\n * UUID of the clip to play, from `clip_generated` or `queue_update`. Blank plays the playout queue's front clip.\n * @default \"\"\n */\n\n clip_id?: string;\n}\n\n/** Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. An `ending_frame` can accompany any of these — or stand alone — to make the clip animate *into* and close on that image; with a starting frame or a continued opener it is first-and-last, with neither it is last-frame only. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`, or `command_error` when the queue is full, the prompt is empty, both a starting frame and a source clip are given, the source clip is unknown or no longer retained, or the upload is not a decodable image. */\nexport interface FastH3EnqueueParams {\n /**\n * Seed for this clip. Omitted or null, the session's default is used and advances by one; passing a seed leaves the default untouched, so explicit and automatic seeding do not interfere.\n * @minimum 0\n * @default null\n */\n\n seed?: number | null;\n /**\n * What the clip should show, up to 800 characters. Fixed once enqueued; a different scene is a new `enqueue`.\n * @maxLength 800\n * @default \"\"\n */\n\n prompt?: string;\n /**\n * Length of this clip in seconds, between 5.167 and 14.375, snapped to the nearest length the model can produce; the clip's structure reports the effective value. Omitted or null, the session default applies. A length the deployment has not built before pays a one-off compile cost on its first build.\n * @minimum 5.167\n * @maximum 14.375\n * @default null\n */\n\n seconds?: number | null;\n /**\n * Free-form string stored with the clip and echoed back on every message that references it. The model never reads it; use it to correlate clips with your own records — who asked for it, which group it belongs to, display text.\n * @maxLength 2000\n * @default \"\"\n */\n\n metadata?: string;\n /**\n * Where the clip enters the generation queue: 0 is the front (the next build), larger values count back from there, and anything past the end — or omitted — appends. The clip already building is unaffected either way. `queue_update` reports the resulting order.\n * @minimum 0\n * @default null\n */\n\n position?: number | null;\n /**\n * A still image the clip animates into and closes on — its last frame. Common formats decode; the frame is fitted to the session canvas. Combine it with a `starting_frame` (or a `continue_from_clip_id` opener) for first-and-last generation, or send it alone to fix only the ending. Omit for a clip with no fixed end. Independent of how the clip opens, so it pairs with either opener.\n * @default null\n */\n\n ending_frame?: FileRef | null;\n /**\n * A still image the clip opens from and animates forward — image-to-video. Common formats decode; the frame is fitted to the session canvas. To continue from a video, extract the frame you want and send it here. Omit for a clip opening from text or from another clip; at most one of this and `continue_from_clip_id`.\n * @default null\n */\n\n starting_frame?: FileRef | null;\n /**\n * UUID of the clip whose last frame this one opens from and animates forward — how clips chain into a continuing scene. Any clip in either queue or in `queue_update.history` qualifies, including one that has not built yet: this clip then waits for it. Blank for a clip opening from text or from an uploaded frame; at most one of this and `starting_frame`.\n * @default \"\"\n */\n\n continue_from_clip_id?: string;\n}\n\n/** Set the default seed — the one an `enqueue` without a seed of its own uses, advancing it by one, so re-enqueuing the same prompts in the same order reproduces the same clips. Clips already in the queue keep the seed they were enqueued with. Valid at any time. Emits `seed_accepted` and `state_update`. */\nexport interface FastH3SetSeedParams {\n /**\n * Default seed for enqueues that carry none. Reproduction is close rather than exact: the deployment runs fused kernels that can reorder arithmetic.\n * @minimum 0\n * @default 1000\n */\n\n seed?: number;\n}\n\n/** Choose the aspect ratio of `main_video`. The video track keeps one size and queued clips are built at it, so this is only valid while the queue is empty and nothing is playing. Emits `canvas_accepted`, carrying the exact pixel size, and `state_update`, or `command_error` while clips are queued or playing, or when the ratio is not one this model offers. */\nexport interface FastH3SetCanvasParams {\n /**\n * Aspect ratio of `main_video`. `canvas_accepted` and `state_update` report the width and height in pixels it resolves to.\n * @default \"16:9\"\n */\n\n aspect?: \"16:9\" | \"1:1\" | \"9:16\" | \"4:3\";\n}\n\n/** Turn autoplay on or off. On, the playout queue's front clip starts on its own whenever nothing is playing — right after a clip finishes, or the moment a build completes while the stream is idle — so a steadily fed queue plays through without a `play` per clip. Off (the default), the stream holds on black until an explicit `play`. Takes effect immediately and lasts for the session. Emits `autoplay_accepted` and `state_update`. */\nexport interface FastH3SetAutoplayParams {\n /**\n * True plays the playout queue front-first on its own; false holds the stream after each clip until `play`.\n * @default false\n */\n\n enabled?: boolean;\n}\n\n/** Set the default length for enqueues that carry no `seconds` of their own. The value is snapped to the nearest length the model can produce, so read the effective one back from `clip_length_accepted`. Clips already in the queue keep the length they were enqueued with. Longer clips carry a scene further; shorter ones build faster. Valid at any time. Emits `clip_length_accepted` and `state_update`. */\nexport interface FastH3SetClipSecondsParams {\n /**\n * Clip length in seconds, between 5.167 and 14.375. Snapped to the nearest length the model can produce, so the value that takes effect can differ slightly; `state_update.clip_seconds` always carries the one in force.\n * @minimum 5.167\n * @maximum 14.375\n * @default 14.375\n */\n\n seconds?: number;\n}\n\n/** Set whether the stream cuts to black when a clip ends, is stopped, or a non-continuing clip follows it. On (the default) those boundaries flush to black at once. Off, the stream holds the last frame instead — `stop` then drains what the transport already holds (up to a couple of seconds) before the picture freezes, rather than snapping to black. Either way, autoplay chains a clip whose `continue_from_clip_id` names the clip just finished with no cut at all, and `reset` always clears the tracks. Takes effect at the next boundary and lasts for the session. Emits `flush_accepted` and `state_update`. */\nexport interface FastH3SetFlushOnClipEndParams {\n /**\n * True cuts to black at every non-continuing clip boundary; false holds the last frame there instead.\n * @default true\n */\n\n enabled?: boolean;\n}\n\n/** Emitted when `move` repositions a clip within its queue. */\nexport interface FastH3ClipMovedMessage {\n type: \"clip_moved\";\n /** The clip that moved. */\n\n clip: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_ending_frame\"?: boolean; \"has_starting_frame\": boolean; \"continue_from_clip_id\": string | null };\n /** Which queue it moved within: `generation` or `playout`. */\n\n queue: string;\n /** The clip's resulting position in that queue, 0 = front. */\n\n position: number;\n}\n\n/**\n * Emitted when a clip's generation fails.\n *\n * The clip leaves the queue and the queue moves on; nothing else is affected.\n */\nexport interface FastH3ClipFailedMessage {\n type: \"clip_failed\";\n /** The clip whose build failed. */\n\n clip: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_ending_frame\"?: boolean; \"has_starting_frame\": boolean; \"continue_from_clip_id\": string | null };\n /** What went wrong. */\n\n reason: string;\n}\n\n/**\n * Emitted when `pop` removes a clip from either queue.\n *\n * The clip's slot is free again immediately. A build already running for it is discarded when it completes; the GPUs cannot abandon it mid-build.\n */\nexport interface FastH3ClipPoppedMessage {\n type: \"clip_popped\";\n /** The clip that left its queue. */\n\n clip: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_ending_frame\"?: boolean; \"has_starting_frame\": boolean; \"continue_from_clip_id\": string | null };\n}\n\n/** Emitted when `enqueue` accepts a generation request. */\nexport interface FastH3ClipQueuedMessage {\n type: \"clip_queued\";\n /** The queued clip, UUID included. `ready` is false here; `clip_generated` announces it crossing into the playout queue. */\n\n clip: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_ending_frame\"?: boolean; \"has_starting_frame\": boolean; \"continue_from_clip_id\": string | null };\n}\n\n/** Emitted as a clip begins streaming on the output tracks. */\nexport interface FastH3ClipStartedMessage {\n type: \"clip_started\";\n /** The clip now playing. */\n\n clip: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_ending_frame\"?: boolean; \"has_starting_frame\": boolean; \"continue_from_clip_id\": string | null };\n}\n\n/**\n * Emitted when `stop` cuts a playing clip.\n *\n * The rest of the clip is discarded — a stopped clip cannot be resumed — and the stream holds on black until the next `play`, exactly as after `clip_finished`.\n */\nexport interface FastH3ClipStoppedMessage {\n type: \"clip_stopped\";\n /** The clip that was cut. */\n\n clip: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_ending_frame\"?: boolean; \"has_starting_frame\": boolean; \"continue_from_clip_id\": string | null };\n /** Seconds of video and audio sent since the session began. */\n\n seconds_sent: number;\n}\n\n/**\n * Emitted on connect and whenever either queue changes, and answers `get_queue`.\n *\n * Both queues in full, front first, each entry a complete `ClipInfo`, plus the retained history of built clips that can still seed a new one. A change is any of: a clip enqueued or `move`d, a build finishing (the clip crosses from `generation` to `playout`), a clip leaving to play or by `pop`, or the queues being cleared by `reset`.\n */\nexport interface FastH3QueueUpdateMessage {\n type: \"queue_update\";\n /** Built clips no longer queued — played, stopped, or popped — whose last frame is still retained, oldest first. No longer playable (`play` refuses them), but any can be named in `enqueue`'s `continue_from_clip_id`; the oldest are evicted as new builds finish, so the front of this list is what expires next. */\n\n history: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_ending_frame\"?: boolean; \"has_starting_frame\": boolean; \"continue_from_clip_id\": string | null }[];\n /** Built clips waiting to play, front first. A finished build joins at the back; bare `play` (and autoplay) takes the front; `move` reorders; playing or `pop` consumes. */\n\n playout: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_ending_frame\"?: boolean; \"has_starting_frame\": boolean; \"continue_from_clip_id\": string | null }[];\n /** Clips waiting to build, front first. Builds consume this queue from the front, one at a time, pausing only while `playout` is at capacity; a clip whose `continue_from_clip_id` source is not built yet is skipped until it is, without blocking the rest. `enqueue`'s `position` and `move` control the order. */\n\n generation: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_ending_frame\"?: boolean; \"has_starting_frame\": boolean; \"continue_from_clip_id\": string | null }[];\n}\n\n/**\n * Emitted on connect and after every change to the session's state.\n *\n * One snapshot of everything observable except the queue's contents (those travel as `queue_update`), so a client can render its whole UI from this alone instead of accumulating the individual messages below.\n */\nexport interface FastH3StateUpdateMessage {\n type: \"state_update\";\n /** Seed the next enqueued clip will use when `enqueue` carries none; each such enqueue advances it by one. */\n\n seed: number;\n /** Width of every frame on `main_video`. */\n\n width: number;\n /** Aspect ratio in effect, e.g. `16:9`. */\n\n aspect: string;\n /** Height of every frame on `main_video`. */\n\n height: number;\n /** A clip is streaming on the output tracks. */\n\n playing: boolean;\n /** The playout queue's front clip starts on its own whenever nothing is playing. Off by default: playback waits for an explicit `play`. */\n\n autoplay: boolean;\n /** Length a newly enqueued clip gets when `enqueue` carries no `seconds` of its own. */\n\n clip_seconds: number;\n /** Clips that finished playing or were stopped since the session began. */\n\n clips_played: number;\n /** Seconds of video and audio sent since the session began. */\n\n seconds_sent: number;\n /** Built clips in the playout queue, each playable right now. */\n\n playout_queued: number;\n /** Names of the commands the session would accept right now. Use this to enable or grey out controls instead of re-deriving the state machine client-side; any command not listed would be rejected. */\n\n valid_commands: string[];\n /** UUID of the clip now playing, or null when the stream is idle. */\n\n playing_clip_id: string | null;\n /** Longest clip length `set_clip_seconds` accepts. */\n\n clip_seconds_max: number;\n /** Shortest clip length `set_clip_seconds` accepts. */\n\n clip_seconds_min: number;\n /** Most built clips the playout queue holds. Generation pauses while it is full and resumes as playing or `pop` frees a slot. */\n\n playout_capacity: number;\n /** The stream cuts to black when a clip ends, is stopped, or a non-continuing clip follows it (the default). Off, those transitions hold the last frame instead. Either way, autoplay chains a clip that continues the one just finished with no cut at all. */\n\n flush_on_clip_end: boolean;\n /** Clips in the generation queue: enqueued, not yet built. */\n\n generation_queued: number;\n /** Most clips the generation queue holds; `enqueue` is refused beyond it. */\n\n generation_capacity: number;\n}\n\n/**\n * Emitted when a clip has been fully sent on the output tracks.\n *\n * The stream then holds on black until the next `play`; nothing plays on its own.\n */\nexport interface FastH3ClipFinishedMessage {\n type: \"clip_finished\";\n /** The clip that just finished. */\n\n clip: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_ending_frame\"?: boolean; \"has_starting_frame\": boolean; \"continue_from_clip_id\": string | null };\n /** Seconds of video and audio sent since the session began, this clip included. */\n\n seconds_sent: number;\n}\n\n/** Emitted when a command is rejected. The command had no effect. */\nexport interface FastH3CommandErrorMessage {\n type: \"command_error\";\n /** Why it was rejected. */\n\n reason: string;\n /** Name of the command that was rejected. */\n\n command: string;\n}\n\n/** Emitted when `set_seed` is accepted. */\nexport interface FastH3SeedAcceptedMessage {\n type: \"seed_accepted\";\n /** Seed the next enqueued clip will use when `enqueue` carries none. */\n\n seed: number;\n}\n\n/**\n * Emitted when `reset` is accepted.\n *\n * Every condition is back to its default, the queue is empty, and the output stream is cleared.\n */\nexport interface FastH3SessionResetMessage {\n type: \"session_reset\";\n /** A clip was playing and has been cut; a `clip_stopped` accompanies it. */\n\n was_playing: boolean;\n /** Clips dropped from both queues, built and pending alike. */\n\n cleared_clips: number;\n}\n\n/**\n * Emitted when a clip's build completes.\n *\n * The clip has left the generation queue and joined the back of the playout queue, playable immediately. `queue_update` accompanies it with both queues' new contents.\n */\nexport interface FastH3ClipGeneratedMessage {\n type: \"clip_generated\";\n /** The freshly built clip, now at the back of the playout queue. */\n\n clip: { \"seed\": number; \"ready\": boolean; \"frames\": number; \"prompt\": string; \"clip_id\": string; \"seconds\": number; \"metadata\": string; \"has_ending_frame\"?: boolean; \"has_starting_frame\": boolean; \"continue_from_clip_id\": string | null };\n}\n\n/** Emitted when `set_flush_on_clip_end` is accepted. */\nexport interface FastH3FlushAcceptedMessage {\n type: \"flush_accepted\";\n /** Whether the stream now cuts to black when a clip ends, is stopped, or a non-continuing clip follows it. Off, those transitions hold the last frame instead. */\n\n enabled: boolean;\n}\n\n/** Emitted when `set_canvas` is accepted. */\nexport interface FastH3CanvasAcceptedMessage {\n type: \"canvas_accepted\";\n /** Width of every frame on `main_video`. */\n\n width: number;\n /** Aspect ratio now in effect. */\n\n aspect: string;\n /** Height of every frame on `main_video`. */\n\n height: number;\n}\n\n/** Emitted when `set_autoplay` is accepted. */\nexport interface FastH3AutoplayAcceptedMessage {\n type: \"autoplay_accepted\";\n /** Whether ready clips now start on their own when nothing is playing. */\n\n enabled: boolean;\n}\n\n/**\n * Emitted when `set_clip_seconds` is accepted.\n *\n * The requested length is snapped to the nearest length the model can produce, so the value here may differ slightly from the one sent.\n */\nexport interface FastH3ClipLengthAcceptedMessage {\n type: \"clip_length_accepted\";\n /** Frames each newly enqueued clip will carry. */\n\n frames: number;\n /** Clip length now in effect, in seconds. */\n\n clip_seconds: number;\n}\n\nexport type FastH3Message =\n | FastH3ClipMovedMessage\n | FastH3ClipFailedMessage\n | FastH3ClipPoppedMessage\n | FastH3ClipQueuedMessage\n | FastH3ClipStartedMessage\n | FastH3ClipStoppedMessage\n | FastH3QueueUpdateMessage\n | FastH3StateUpdateMessage\n | FastH3ClipFinishedMessage\n | FastH3CommandErrorMessage\n | FastH3SeedAcceptedMessage\n | FastH3SessionResetMessage\n | FastH3ClipGeneratedMessage\n | FastH3FlushAcceptedMessage\n | FastH3CanvasAcceptedMessage\n | FastH3AutoplayAcceptedMessage\n | FastH3ClipLengthAcceptedMessage;\n\n/**\n * Options for creating a FastH3Model (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 FastH3Options = 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 FastH3 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 FastH3Model extends Reactor {\n constructor(options?: FastH3Options) {\n super({\n ...options,\n modelName: MODEL_NAME,\n modelTracks: [...FastH3Tracks],\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 one clip by its UUID from whichever queue holds it, freeing its slot. Works on generating and built clips alike; a build already running for it is discarded when it completes. The clip that is playing is in neither queue — `stop` is the command that cuts it. A built clip stays in `queue_update.history` after popping, so clips continued from it are unaffected; an unbuilt clip that queued clips continue from is refused, since popping it would leave them nothing to open from — pop those first. Emits `clip_popped`, `queue_update` and `state_update`, or `command_error` when no queued clip has that id or queued clips still continue from it.\n * @param params - Remove one clip by its UUID from whichever queue holds it, freeing its slot. Works on generating and built clips alike; a build already running for it is discarded when it completes. The clip that is playing is in neither queue — `stop` is the command that cuts it. A built clip stays in `queue_update.history` after popping, so clips continued from it are unaffected; an unbuilt clip that queued clips continue from is refused, since popping it would leave them nothing to open from — pop those first. Emits `clip_popped`, `queue_update` and `state_update`, or `command_error` when no queued clip has that id or queued clips still continue from it.\n * @returns The correlated {@link FastH3ClipPoppedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async pop(params: FastH3PopParams): Promise<FastH3ClipPoppedMessage | undefined> {\n const reply = await this.sendCommand(\"pop\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3ClipPoppedMessage>(reply);\n }\n\n /**\n * Reposition one clip within the queue that holds it — the generation queue for a clip still to build, the playout queue for a built one; clips never move between queues except by building. `position` 0 is the front: the next build, or what bare `play` and autoplay take next. Values past the end mean the back. Replies `clip_moved` with the queue and the resulting position, and emits `queue_update`; `command_error` when no queued clip has that id.\n * @param params - Reposition one clip within the queue that holds it — the generation queue for a clip still to build, the playout queue for a built one; clips never move between queues except by building. `position` 0 is the front: the next build, or what bare `play` and autoplay take next. Values past the end mean the back. Replies `clip_moved` with the queue and the resulting position, and emits `queue_update`; `command_error` when no queued clip has that id.\n * @returns The correlated {@link FastH3ClipMovedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async move(params: FastH3MoveParams): Promise<FastH3ClipMovedMessage | undefined> {\n const reply = await this.sendCommand(\"move\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3ClipMovedMessage>(reply);\n }\n\n /**\n * Play one clip from the playout queue. Blank `clip_id` plays the front clip; a UUID plays that specific one. Playing consumes the entry: it leaves the queue, `clip_started` marks its first frames, and when it ends the stream holds on black until the next `play`. Emits `queue_update` and `state_update`, or `command_error` when a clip is already playing, the id is unknown, or the clip is still generating.\n * @param params - Play one clip from the playout queue. Blank `clip_id` plays the front clip; a UUID plays that specific one. Playing consumes the entry: it leaves the queue, `clip_started` marks its first frames, and when it ends the stream holds on black until the next `play`. Emits `queue_update` and `state_update`, or `command_error` when a clip is already playing, the id is unknown, or the clip is still generating.\n * @returns Resolves once the model's handler has completed; this command declares no reply payload.\n */\n\n async play(params: FastH3PlayParams): Promise<undefined> {\n await this.sendCommand(\"play\", params);\n return undefined;\n }\n\n /**\n * Cut the clip that is playing. Whatever is queued on the output tracks is dropped and the picture goes to black within a fraction of a second (with `set_flush_on_clip_end` off, the transport drains what it holds and freezes on the last frame instead), and the session is back where a finished clip leaves it — the queue is untouched and the next `play` starts clean. With autoplay on this acts as a skip: the next ready clip starts on its own, so send `set_autoplay` off first to hold the stream. Emits `clip_stopped` and `state_update`, or `command_error` when no clip 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 * Return every condition to its default, drop both queues' clips and the retained history, and clear the output tracks. A clip that is playing is cut, with a `clip_stopped` to mark it. Valid at any time. Replies `session_reset` and emits `queue_update` and `state_update`.\n * @returns The correlated {@link FastH3SessionResetMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async reset(): Promise<FastH3SessionResetMessage | undefined> {\n const reply = await this.sendCommand(\"reset\", {});\n return reply === undefined ? undefined : _unwrapMessage<FastH3SessionResetMessage>(reply);\n }\n\n /**\n * Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. An `ending_frame` can accompany any of these — or stand alone — to make the clip animate *into* and close on that image; with a starting frame or a continued opener it is first-and-last, with neither it is last-frame only. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`, or `command_error` when the queue is full, the prompt is empty, both a starting frame and a source clip are given, the source clip is unknown or no longer retained, or the upload is not a decodable image.\n * @param params - Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. An `ending_frame` can accompany any of these — or stand alone — to make the clip animate *into* and close on that image; with a starting frame or a continued opener it is first-and-last, with neither it is last-frame only. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`, or `command_error` when the queue is full, the prompt is empty, both a starting frame and a source clip are given, the source clip is unknown or no longer retained, or the upload is not a decodable image.\n * @returns The correlated {@link FastH3ClipQueuedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async enqueue(params: FastH3EnqueueParams): Promise<FastH3ClipQueuedMessage | undefined> {\n const reply = await this.sendCommand(\"enqueue\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3ClipQueuedMessage>(reply);\n }\n\n /**\n * Set the default seed — the one an `enqueue` without a seed of its own uses, advancing it by one, so re-enqueuing the same prompts in the same order reproduces the same clips. Clips already in the queue keep the seed they were enqueued with. Valid at any time. Emits `seed_accepted` and `state_update`.\n * @param params - Set the default seed — the one an `enqueue` without a seed of its own uses, advancing it by one, so re-enqueuing the same prompts in the same order reproduces the same clips. Clips already in the queue keep the seed they were enqueued with. Valid at any time. Emits `seed_accepted` and `state_update`.\n * @returns The correlated {@link FastH3SeedAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async setSeed(params: FastH3SetSeedParams): Promise<FastH3SeedAcceptedMessage | undefined> {\n const reply = await this.sendCommand(\"set_seed\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3SeedAcceptedMessage>(reply);\n }\n\n /**\n * Return both queues' contents — `generation` (waiting to build) and `playout` (built, playable) — plus `history`, the built clips no longer queued that `continue_from_clip_id` can still name, every clip as its full structure. The same payload the model broadcasts as `queue_update`. Valid at any time.\n * @returns The correlated {@link FastH3QueueUpdateMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async getQueue(): Promise<FastH3QueueUpdateMessage | undefined> {\n const reply = await this.sendCommand(\"get_queue\", {});\n return reply === undefined ? undefined : _unwrapMessage<FastH3QueueUpdateMessage>(reply);\n }\n\n /**\n * Return a snapshot of everything the session exposes except the queue's contents (`get_queue` carries those): the conditions in force, what is playing, progress counters, and the commands that are valid right now. The same payload the model broadcasts as `state_update`. Valid at any time.\n * @returns The correlated {@link FastH3StateUpdateMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async getState(): Promise<FastH3StateUpdateMessage | undefined> {\n const reply = await this.sendCommand(\"get_state\", {});\n return reply === undefined ? undefined : _unwrapMessage<FastH3StateUpdateMessage>(reply);\n }\n\n /**\n * Choose the aspect ratio of `main_video`. The video track keeps one size and queued clips are built at it, so this is only valid while the queue is empty and nothing is playing. Emits `canvas_accepted`, carrying the exact pixel size, and `state_update`, or `command_error` while clips are queued or playing, or when the ratio is not one this model offers.\n * @param params - Choose the aspect ratio of `main_video`. The video track keeps one size and queued clips are built at it, so this is only valid while the queue is empty and nothing is playing. Emits `canvas_accepted`, carrying the exact pixel size, and `state_update`, or `command_error` while clips are queued or playing, or when the ratio is not one this model offers.\n * @returns The correlated {@link FastH3CanvasAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async setCanvas(params: FastH3SetCanvasParams): Promise<FastH3CanvasAcceptedMessage | undefined> {\n const reply = await this.sendCommand(\"set_canvas\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3CanvasAcceptedMessage>(reply);\n }\n\n /**\n * Turn autoplay on or off. On, the playout queue's front clip starts on its own whenever nothing is playing — right after a clip finishes, or the moment a build completes while the stream is idle — so a steadily fed queue plays through without a `play` per clip. Off (the default), the stream holds on black until an explicit `play`. Takes effect immediately and lasts for the session. Emits `autoplay_accepted` and `state_update`.\n * @param params - Turn autoplay on or off. On, the playout queue's front clip starts on its own whenever nothing is playing — right after a clip finishes, or the moment a build completes while the stream is idle — so a steadily fed queue plays through without a `play` per clip. Off (the default), the stream holds on black until an explicit `play`. Takes effect immediately and lasts for the session. Emits `autoplay_accepted` and `state_update`.\n * @returns The correlated {@link FastH3AutoplayAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async setAutoplay(params: FastH3SetAutoplayParams): Promise<FastH3AutoplayAcceptedMessage | undefined> {\n const reply = await this.sendCommand(\"set_autoplay\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3AutoplayAcceptedMessage>(reply);\n }\n\n /**\n * Set the default length for enqueues that carry no `seconds` of their own. The value is snapped to the nearest length the model can produce, so read the effective one back from `clip_length_accepted`. Clips already in the queue keep the length they were enqueued with. Longer clips carry a scene further; shorter ones build faster. Valid at any time. Emits `clip_length_accepted` and `state_update`.\n * @param params - Set the default length for enqueues that carry no `seconds` of their own. The value is snapped to the nearest length the model can produce, so read the effective one back from `clip_length_accepted`. Clips already in the queue keep the length they were enqueued with. Longer clips carry a scene further; shorter ones build faster. Valid at any time. Emits `clip_length_accepted` and `state_update`.\n * @returns The correlated {@link FastH3ClipLengthAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async setClipSeconds(params: FastH3SetClipSecondsParams): Promise<FastH3ClipLengthAcceptedMessage | undefined> {\n const reply = await this.sendCommand(\"set_clip_seconds\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3ClipLengthAcceptedMessage>(reply);\n }\n\n /**\n * Set whether the stream cuts to black when a clip ends, is stopped, or a non-continuing clip follows it. On (the default) those boundaries flush to black at once. Off, the stream holds the last frame instead — `stop` then drains what the transport already holds (up to a couple of seconds) before the picture freezes, rather than snapping to black. Either way, autoplay chains a clip whose `continue_from_clip_id` names the clip just finished with no cut at all, and `reset` always clears the tracks. Takes effect at the next boundary and lasts for the session. Emits `flush_accepted` and `state_update`.\n * @param params - Set whether the stream cuts to black when a clip ends, is stopped, or a non-continuing clip follows it. On (the default) those boundaries flush to black at once. Off, the stream holds the last frame instead — `stop` then drains what the transport already holds (up to a couple of seconds) before the picture freezes, rather than snapping to black. Either way, autoplay chains a clip whose `continue_from_clip_id` names the clip just finished with no cut at all, and `reset` always clears the tracks. Takes effect at the next boundary and lasts for the session. Emits `flush_accepted` and `state_update`.\n * @returns The correlated {@link FastH3FlushAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).\n */\n\n async setFlushOnClipEnd(params: FastH3SetFlushOnClipEndParams): Promise<FastH3FlushAcceptedMessage | undefined> {\n const reply = await this.sendCommand(\"set_flush_on_clip_end\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3FlushAcceptedMessage>(reply);\n }\n\n /**\n * Subscribe to typed model messages.\n * @param handler - Called with a discriminated FastH3Message\n * @returns Unsubscribe function\n */\n\n onMessage(handler: (message: FastH3Message) => void): () => void {\n const wrappedHandler = (raw: unknown) => {\n handler(_unwrapMessage<FastH3Message>(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: FastH3ClipMovedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"clip_moved\") handler(msg as FastH3ClipMovedMessage);\n });\n }\n\n /**\n * Subscribe to \"clip_failed\" messages only.\n * @returns Unsubscribe function\n */\n\n onClipFailed(handler: (message: FastH3ClipFailedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"clip_failed\") handler(msg as FastH3ClipFailedMessage);\n });\n }\n\n /**\n * Subscribe to \"clip_popped\" messages only.\n * @returns Unsubscribe function\n */\n\n onClipPopped(handler: (message: FastH3ClipPoppedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"clip_popped\") handler(msg as FastH3ClipPoppedMessage);\n });\n }\n\n /**\n * Subscribe to \"clip_queued\" messages only.\n * @returns Unsubscribe function\n */\n\n onClipQueued(handler: (message: FastH3ClipQueuedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"clip_queued\") handler(msg as FastH3ClipQueuedMessage);\n });\n }\n\n /**\n * Subscribe to \"clip_started\" messages only.\n * @returns Unsubscribe function\n */\n\n onClipStarted(handler: (message: FastH3ClipStartedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"clip_started\") handler(msg as FastH3ClipStartedMessage);\n });\n }\n\n /**\n * Subscribe to \"clip_stopped\" messages only.\n * @returns Unsubscribe function\n */\n\n onClipStopped(handler: (message: FastH3ClipStoppedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"clip_stopped\") handler(msg as FastH3ClipStoppedMessage);\n });\n }\n\n /**\n * Subscribe to \"queue_update\" messages only.\n * @returns Unsubscribe function\n */\n\n onQueueUpdate(handler: (message: FastH3QueueUpdateMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"queue_update\") handler(msg as FastH3QueueUpdateMessage);\n });\n }\n\n /**\n * Subscribe to \"state_update\" messages only.\n * @returns Unsubscribe function\n */\n\n onStateUpdate(handler: (message: FastH3StateUpdateMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"state_update\") handler(msg as FastH3StateUpdateMessage);\n });\n }\n\n /**\n * Subscribe to \"clip_finished\" messages only.\n * @returns Unsubscribe function\n */\n\n onClipFinished(handler: (message: FastH3ClipFinishedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"clip_finished\") handler(msg as FastH3ClipFinishedMessage);\n });\n }\n\n /**\n * Subscribe to \"command_error\" messages only.\n * @returns Unsubscribe function\n */\n\n onCommandError(handler: (message: FastH3CommandErrorMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"command_error\") handler(msg as FastH3CommandErrorMessage);\n });\n }\n\n /**\n * Subscribe to \"seed_accepted\" messages only.\n * @returns Unsubscribe function\n */\n\n onSeedAccepted(handler: (message: FastH3SeedAcceptedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"seed_accepted\") handler(msg as FastH3SeedAcceptedMessage);\n });\n }\n\n /**\n * Subscribe to \"session_reset\" messages only.\n * @returns Unsubscribe function\n */\n\n onSessionReset(handler: (message: FastH3SessionResetMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"session_reset\") handler(msg as FastH3SessionResetMessage);\n });\n }\n\n /**\n * Subscribe to \"clip_generated\" messages only.\n * @returns Unsubscribe function\n */\n\n onClipGenerated(handler: (message: FastH3ClipGeneratedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"clip_generated\") handler(msg as FastH3ClipGeneratedMessage);\n });\n }\n\n /**\n * Subscribe to \"flush_accepted\" messages only.\n * @returns Unsubscribe function\n */\n\n onFlushAccepted(handler: (message: FastH3FlushAcceptedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"flush_accepted\") handler(msg as FastH3FlushAcceptedMessage);\n });\n }\n\n /**\n * Subscribe to \"canvas_accepted\" messages only.\n * @returns Unsubscribe function\n */\n\n onCanvasAccepted(handler: (message: FastH3CanvasAcceptedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"canvas_accepted\") handler(msg as FastH3CanvasAcceptedMessage);\n });\n }\n\n /**\n * Subscribe to \"autoplay_accepted\" messages only.\n * @returns Unsubscribe function\n */\n\n onAutoplayAccepted(handler: (message: FastH3AutoplayAcceptedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"autoplay_accepted\") handler(msg as FastH3AutoplayAcceptedMessage);\n });\n }\n\n /**\n * Subscribe to \"clip_length_accepted\" messages only.\n * @returns Unsubscribe function\n */\n\n onClipLengthAccepted(handler: (message: FastH3ClipLengthAcceptedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"clip_length_accepted\") handler(msg as FastH3ClipLengthAcceptedMessage);\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,eAAe;AAAA,EAC1B,EAAE,MAAM,cAAc,MAAM,SAAS,WAAW,WAAW;AAAA,EAC3D,EAAE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L_NAME
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BE5NWNKY.mjs";
|
|
5
5
|
|
|
6
6
|
// src/react.tsx
|
|
7
7
|
import {
|
|
@@ -298,4 +298,4 @@ export {
|
|
|
298
298
|
useFastH3Track,
|
|
299
299
|
FastH3MainVideoView
|
|
300
300
|
};
|
|
301
|
-
//# sourceMappingURL=chunk-
|
|
301
|
+
//# sourceMappingURL=chunk-CKECQBJK.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: fast-h3 v1.0.2\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 FastH3Tracks,\n type FastH3Options,\n type FastH3PopParams,\n type FastH3MoveParams,\n type FastH3PlayParams,\n type FastH3EnqueueParams,\n type FastH3SetSeedParams,\n type FastH3SetCanvasParams,\n type FastH3SetAutoplayParams,\n type FastH3SetClipSecondsParams,\n type FastH3SetFlushOnClipEndParams,\n type FastH3Message,\n type FastH3ClipMovedMessage,\n type FastH3ClipFailedMessage,\n type FastH3ClipPoppedMessage,\n type FastH3ClipQueuedMessage,\n type FastH3ClipStartedMessage,\n type FastH3ClipStoppedMessage,\n type FastH3QueueUpdateMessage,\n type FastH3StateUpdateMessage,\n type FastH3ClipFinishedMessage,\n type FastH3CommandErrorMessage,\n type FastH3SeedAcceptedMessage,\n type FastH3SessionResetMessage,\n type FastH3ClipGeneratedMessage,\n type FastH3FlushAcceptedMessage,\n type FastH3CanvasAcceptedMessage,\n type FastH3AutoplayAcceptedMessage,\n type FastH3ClipLengthAcceptedMessage,\n type FastH3RecvTrackName,\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 FastH3Provider} component.\n *\n * Derived from `ReactorProvider`'s own props, with `modelName` and\n * `modelTracks` stripped — those are supplied by this provider.\n */\nexport type FastH3ProviderProps = Omit<\n Parameters<typeof ReactorProvider>[0],\n \"modelName\" | \"modelTracks\"\n>;\n\n/**\n * Provider for the FastH3 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 useFastH3} and the `useFastH3<Message>` hooks below it.\n */\nexport function FastH3Provider({\n children,\n ...rest\n}: FastH3ProviderProps): ReactElement {\n return (\n <ReactorProvider\n {...rest}\n modelName={MODEL_NAME}\n modelTracks={[...FastH3Tracks]}\n >\n {children}\n </ReactorProvider>\n );\n}\n\n/**\n * Access the FastH3 model as typed commands bound to the nearest\n * {@link FastH3Provider}.\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 useFastH3() {\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: FastH3PopParams): Promise<FastH3ClipPoppedMessage | undefined> => {\n const reply = await sendCommand(\"pop\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3ClipPoppedMessage>(reply);\n },\n move: async (params: FastH3MoveParams): Promise<FastH3ClipMovedMessage | undefined> => {\n const reply = await sendCommand(\"move\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3ClipMovedMessage>(reply);\n },\n play: async (params: FastH3PlayParams): 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<FastH3SessionResetMessage | undefined> => {\n const reply = await sendCommand(\"reset\", {});\n return reply === undefined ? undefined : _unwrapMessage<FastH3SessionResetMessage>(reply);\n },\n enqueue: async (params: FastH3EnqueueParams): Promise<FastH3ClipQueuedMessage | undefined> => {\n const reply = await sendCommand(\"enqueue\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3ClipQueuedMessage>(reply);\n },\n setSeed: async (params: FastH3SetSeedParams): Promise<FastH3SeedAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_seed\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3SeedAcceptedMessage>(reply);\n },\n getQueue: async (): Promise<FastH3QueueUpdateMessage | undefined> => {\n const reply = await sendCommand(\"get_queue\", {});\n return reply === undefined ? undefined : _unwrapMessage<FastH3QueueUpdateMessage>(reply);\n },\n getState: async (): Promise<FastH3StateUpdateMessage | undefined> => {\n const reply = await sendCommand(\"get_state\", {});\n return reply === undefined ? undefined : _unwrapMessage<FastH3StateUpdateMessage>(reply);\n },\n setCanvas: async (params: FastH3SetCanvasParams): Promise<FastH3CanvasAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_canvas\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3CanvasAcceptedMessage>(reply);\n },\n setAutoplay: async (params: FastH3SetAutoplayParams): Promise<FastH3AutoplayAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_autoplay\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3AutoplayAcceptedMessage>(reply);\n },\n setClipSeconds: async (params: FastH3SetClipSecondsParams): Promise<FastH3ClipLengthAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_clip_seconds\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3ClipLengthAcceptedMessage>(reply);\n },\n setFlushOnClipEnd: async (params: FastH3SetFlushOnClipEndParams): Promise<FastH3FlushAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_flush_on_clip_end\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3FlushAcceptedMessage>(reply);\n },\n };\n}\n\n/**\n * Subscribe to any FastH3 message with a fully-typed handler.\n * The handler receives a discriminated FastH3Message.\n */\nexport function useFastH3Message(\n handler: (message: FastH3Message) => void,\n): void {\n useReactorMessage((msg: unknown) =>\n handler(_unwrapMessage<FastH3Message>(msg)),\n );\n}\n\n/**\n * Subscribe to \"clip_moved\" messages only.\n * Handler receives a fully-typed FastH3ClipMovedMessage.\n */\nexport function useFastH3ClipMoved(\n handler: (message: FastH3ClipMovedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_moved\") {\n handler(m as FastH3ClipMovedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_failed\" messages only.\n * Handler receives a fully-typed FastH3ClipFailedMessage.\n */\nexport function useFastH3ClipFailed(\n handler: (message: FastH3ClipFailedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_failed\") {\n handler(m as FastH3ClipFailedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_popped\" messages only.\n * Handler receives a fully-typed FastH3ClipPoppedMessage.\n */\nexport function useFastH3ClipPopped(\n handler: (message: FastH3ClipPoppedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_popped\") {\n handler(m as FastH3ClipPoppedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_queued\" messages only.\n * Handler receives a fully-typed FastH3ClipQueuedMessage.\n */\nexport function useFastH3ClipQueued(\n handler: (message: FastH3ClipQueuedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_queued\") {\n handler(m as FastH3ClipQueuedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_started\" messages only.\n * Handler receives a fully-typed FastH3ClipStartedMessage.\n */\nexport function useFastH3ClipStarted(\n handler: (message: FastH3ClipStartedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_started\") {\n handler(m as FastH3ClipStartedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_stopped\" messages only.\n * Handler receives a fully-typed FastH3ClipStoppedMessage.\n */\nexport function useFastH3ClipStopped(\n handler: (message: FastH3ClipStoppedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_stopped\") {\n handler(m as FastH3ClipStoppedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"queue_update\" messages only.\n * Handler receives a fully-typed FastH3QueueUpdateMessage.\n */\nexport function useFastH3QueueUpdate(\n handler: (message: FastH3QueueUpdateMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"queue_update\") {\n handler(m as FastH3QueueUpdateMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"state_update\" messages only.\n * Handler receives a fully-typed FastH3StateUpdateMessage.\n */\nexport function useFastH3StateUpdate(\n handler: (message: FastH3StateUpdateMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"state_update\") {\n handler(m as FastH3StateUpdateMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_finished\" messages only.\n * Handler receives a fully-typed FastH3ClipFinishedMessage.\n */\nexport function useFastH3ClipFinished(\n handler: (message: FastH3ClipFinishedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_finished\") {\n handler(m as FastH3ClipFinishedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"command_error\" messages only.\n * Handler receives a fully-typed FastH3CommandErrorMessage.\n */\nexport function useFastH3CommandError(\n handler: (message: FastH3CommandErrorMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"command_error\") {\n handler(m as FastH3CommandErrorMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"seed_accepted\" messages only.\n * Handler receives a fully-typed FastH3SeedAcceptedMessage.\n */\nexport function useFastH3SeedAccepted(\n handler: (message: FastH3SeedAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"seed_accepted\") {\n handler(m as FastH3SeedAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"session_reset\" messages only.\n * Handler receives a fully-typed FastH3SessionResetMessage.\n */\nexport function useFastH3SessionReset(\n handler: (message: FastH3SessionResetMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"session_reset\") {\n handler(m as FastH3SessionResetMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_generated\" messages only.\n * Handler receives a fully-typed FastH3ClipGeneratedMessage.\n */\nexport function useFastH3ClipGenerated(\n handler: (message: FastH3ClipGeneratedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_generated\") {\n handler(m as FastH3ClipGeneratedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"flush_accepted\" messages only.\n * Handler receives a fully-typed FastH3FlushAcceptedMessage.\n */\nexport function useFastH3FlushAccepted(\n handler: (message: FastH3FlushAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"flush_accepted\") {\n handler(m as FastH3FlushAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"canvas_accepted\" messages only.\n * Handler receives a fully-typed FastH3CanvasAcceptedMessage.\n */\nexport function useFastH3CanvasAccepted(\n handler: (message: FastH3CanvasAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"canvas_accepted\") {\n handler(m as FastH3CanvasAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"autoplay_accepted\" messages only.\n * Handler receives a fully-typed FastH3AutoplayAcceptedMessage.\n */\nexport function useFastH3AutoplayAccepted(\n handler: (message: FastH3AutoplayAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"autoplay_accepted\") {\n handler(m as FastH3AutoplayAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_length_accepted\" messages only.\n * Handler receives a fully-typed FastH3ClipLengthAcceptedMessage.\n */\nexport function useFastH3ClipLengthAccepted(\n handler: (message: FastH3ClipLengthAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_length_accepted\") {\n handler(m as FastH3ClipLengthAcceptedMessage);\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 `FastH3RecvTrackName`.\n * @param name - A recvonly track name declared by the model\n * @returns The live MediaStreamTrack, or `undefined` until received\n */\nexport function useFastH3Track(\n name: FastH3RecvTrackName,\n): MediaStreamTrack | undefined {\n return useReactor((s) => s.tracks[name]);\n}\n\nexport type FastH3MainVideoViewProps = 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 `<FastH3Provider>`.\n */\nexport function FastH3MainVideoView(\n props: FastH3MainVideoViewProps,\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,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AAC;AACH;AASO,SAAS,eACd,MAC8B;AAC9B,SAAO,WAAW,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC;AACzC;AASO,SAAS,oBACd,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: fast-h3 v1.1.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 FastH3Tracks,\n type FastH3Options,\n type FastH3PopParams,\n type FastH3MoveParams,\n type FastH3PlayParams,\n type FastH3EnqueueParams,\n type FastH3SetSeedParams,\n type FastH3SetCanvasParams,\n type FastH3SetAutoplayParams,\n type FastH3SetClipSecondsParams,\n type FastH3SetFlushOnClipEndParams,\n type FastH3Message,\n type FastH3ClipMovedMessage,\n type FastH3ClipFailedMessage,\n type FastH3ClipPoppedMessage,\n type FastH3ClipQueuedMessage,\n type FastH3ClipStartedMessage,\n type FastH3ClipStoppedMessage,\n type FastH3QueueUpdateMessage,\n type FastH3StateUpdateMessage,\n type FastH3ClipFinishedMessage,\n type FastH3CommandErrorMessage,\n type FastH3SeedAcceptedMessage,\n type FastH3SessionResetMessage,\n type FastH3ClipGeneratedMessage,\n type FastH3FlushAcceptedMessage,\n type FastH3CanvasAcceptedMessage,\n type FastH3AutoplayAcceptedMessage,\n type FastH3ClipLengthAcceptedMessage,\n type FastH3RecvTrackName,\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 FastH3Provider} component.\n *\n * Derived from `ReactorProvider`'s own props, with `modelName` and\n * `modelTracks` stripped — those are supplied by this provider.\n */\nexport type FastH3ProviderProps = Omit<\n Parameters<typeof ReactorProvider>[0],\n \"modelName\" | \"modelTracks\"\n>;\n\n/**\n * Provider for the FastH3 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 useFastH3} and the `useFastH3<Message>` hooks below it.\n */\nexport function FastH3Provider({\n children,\n ...rest\n}: FastH3ProviderProps): ReactElement {\n return (\n <ReactorProvider\n {...rest}\n modelName={MODEL_NAME}\n modelTracks={[...FastH3Tracks]}\n >\n {children}\n </ReactorProvider>\n );\n}\n\n/**\n * Access the FastH3 model as typed commands bound to the nearest\n * {@link FastH3Provider}.\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 useFastH3() {\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: FastH3PopParams): Promise<FastH3ClipPoppedMessage | undefined> => {\n const reply = await sendCommand(\"pop\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3ClipPoppedMessage>(reply);\n },\n move: async (params: FastH3MoveParams): Promise<FastH3ClipMovedMessage | undefined> => {\n const reply = await sendCommand(\"move\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3ClipMovedMessage>(reply);\n },\n play: async (params: FastH3PlayParams): 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<FastH3SessionResetMessage | undefined> => {\n const reply = await sendCommand(\"reset\", {});\n return reply === undefined ? undefined : _unwrapMessage<FastH3SessionResetMessage>(reply);\n },\n enqueue: async (params: FastH3EnqueueParams): Promise<FastH3ClipQueuedMessage | undefined> => {\n const reply = await sendCommand(\"enqueue\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3ClipQueuedMessage>(reply);\n },\n setSeed: async (params: FastH3SetSeedParams): Promise<FastH3SeedAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_seed\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3SeedAcceptedMessage>(reply);\n },\n getQueue: async (): Promise<FastH3QueueUpdateMessage | undefined> => {\n const reply = await sendCommand(\"get_queue\", {});\n return reply === undefined ? undefined : _unwrapMessage<FastH3QueueUpdateMessage>(reply);\n },\n getState: async (): Promise<FastH3StateUpdateMessage | undefined> => {\n const reply = await sendCommand(\"get_state\", {});\n return reply === undefined ? undefined : _unwrapMessage<FastH3StateUpdateMessage>(reply);\n },\n setCanvas: async (params: FastH3SetCanvasParams): Promise<FastH3CanvasAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_canvas\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3CanvasAcceptedMessage>(reply);\n },\n setAutoplay: async (params: FastH3SetAutoplayParams): Promise<FastH3AutoplayAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_autoplay\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3AutoplayAcceptedMessage>(reply);\n },\n setClipSeconds: async (params: FastH3SetClipSecondsParams): Promise<FastH3ClipLengthAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_clip_seconds\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3ClipLengthAcceptedMessage>(reply);\n },\n setFlushOnClipEnd: async (params: FastH3SetFlushOnClipEndParams): Promise<FastH3FlushAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_flush_on_clip_end\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3FlushAcceptedMessage>(reply);\n },\n };\n}\n\n/**\n * Subscribe to any FastH3 message with a fully-typed handler.\n * The handler receives a discriminated FastH3Message.\n */\nexport function useFastH3Message(\n handler: (message: FastH3Message) => void,\n): void {\n useReactorMessage((msg: unknown) =>\n handler(_unwrapMessage<FastH3Message>(msg)),\n );\n}\n\n/**\n * Subscribe to \"clip_moved\" messages only.\n * Handler receives a fully-typed FastH3ClipMovedMessage.\n */\nexport function useFastH3ClipMoved(\n handler: (message: FastH3ClipMovedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_moved\") {\n handler(m as FastH3ClipMovedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_failed\" messages only.\n * Handler receives a fully-typed FastH3ClipFailedMessage.\n */\nexport function useFastH3ClipFailed(\n handler: (message: FastH3ClipFailedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_failed\") {\n handler(m as FastH3ClipFailedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_popped\" messages only.\n * Handler receives a fully-typed FastH3ClipPoppedMessage.\n */\nexport function useFastH3ClipPopped(\n handler: (message: FastH3ClipPoppedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_popped\") {\n handler(m as FastH3ClipPoppedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_queued\" messages only.\n * Handler receives a fully-typed FastH3ClipQueuedMessage.\n */\nexport function useFastH3ClipQueued(\n handler: (message: FastH3ClipQueuedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_queued\") {\n handler(m as FastH3ClipQueuedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_started\" messages only.\n * Handler receives a fully-typed FastH3ClipStartedMessage.\n */\nexport function useFastH3ClipStarted(\n handler: (message: FastH3ClipStartedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_started\") {\n handler(m as FastH3ClipStartedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_stopped\" messages only.\n * Handler receives a fully-typed FastH3ClipStoppedMessage.\n */\nexport function useFastH3ClipStopped(\n handler: (message: FastH3ClipStoppedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_stopped\") {\n handler(m as FastH3ClipStoppedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"queue_update\" messages only.\n * Handler receives a fully-typed FastH3QueueUpdateMessage.\n */\nexport function useFastH3QueueUpdate(\n handler: (message: FastH3QueueUpdateMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"queue_update\") {\n handler(m as FastH3QueueUpdateMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"state_update\" messages only.\n * Handler receives a fully-typed FastH3StateUpdateMessage.\n */\nexport function useFastH3StateUpdate(\n handler: (message: FastH3StateUpdateMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"state_update\") {\n handler(m as FastH3StateUpdateMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_finished\" messages only.\n * Handler receives a fully-typed FastH3ClipFinishedMessage.\n */\nexport function useFastH3ClipFinished(\n handler: (message: FastH3ClipFinishedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_finished\") {\n handler(m as FastH3ClipFinishedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"command_error\" messages only.\n * Handler receives a fully-typed FastH3CommandErrorMessage.\n */\nexport function useFastH3CommandError(\n handler: (message: FastH3CommandErrorMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"command_error\") {\n handler(m as FastH3CommandErrorMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"seed_accepted\" messages only.\n * Handler receives a fully-typed FastH3SeedAcceptedMessage.\n */\nexport function useFastH3SeedAccepted(\n handler: (message: FastH3SeedAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"seed_accepted\") {\n handler(m as FastH3SeedAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"session_reset\" messages only.\n * Handler receives a fully-typed FastH3SessionResetMessage.\n */\nexport function useFastH3SessionReset(\n handler: (message: FastH3SessionResetMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"session_reset\") {\n handler(m as FastH3SessionResetMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_generated\" messages only.\n * Handler receives a fully-typed FastH3ClipGeneratedMessage.\n */\nexport function useFastH3ClipGenerated(\n handler: (message: FastH3ClipGeneratedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_generated\") {\n handler(m as FastH3ClipGeneratedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"flush_accepted\" messages only.\n * Handler receives a fully-typed FastH3FlushAcceptedMessage.\n */\nexport function useFastH3FlushAccepted(\n handler: (message: FastH3FlushAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"flush_accepted\") {\n handler(m as FastH3FlushAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"canvas_accepted\" messages only.\n * Handler receives a fully-typed FastH3CanvasAcceptedMessage.\n */\nexport function useFastH3CanvasAccepted(\n handler: (message: FastH3CanvasAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"canvas_accepted\") {\n handler(m as FastH3CanvasAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"autoplay_accepted\" messages only.\n * Handler receives a fully-typed FastH3AutoplayAcceptedMessage.\n */\nexport function useFastH3AutoplayAccepted(\n handler: (message: FastH3AutoplayAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"autoplay_accepted\") {\n handler(m as FastH3AutoplayAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_length_accepted\" messages only.\n * Handler receives a fully-typed FastH3ClipLengthAcceptedMessage.\n */\nexport function useFastH3ClipLengthAccepted(\n handler: (message: FastH3ClipLengthAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_length_accepted\") {\n handler(m as FastH3ClipLengthAcceptedMessage);\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 `FastH3RecvTrackName`.\n * @param name - A recvonly track name declared by the model\n * @returns The live MediaStreamTrack, or `undefined` until received\n */\nexport function useFastH3Track(\n name: FastH3RecvTrackName,\n): MediaStreamTrack | undefined {\n return useReactor((s) => s.tracks[name]);\n}\n\nexport type FastH3MainVideoViewProps = 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 `<FastH3Provider>`.\n */\nexport function FastH3MainVideoView(\n props: FastH3MainVideoViewProps,\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,I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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/fast-h3";
|
|
5
|
-
declare const MODEL_VERSION: "v1.0
|
|
5
|
+
declare const MODEL_VERSION: "v1.1.0";
|
|
6
6
|
/**
|
|
7
7
|
* Preset media tracks for the FastH3 model.
|
|
8
8
|
*
|
|
@@ -51,7 +51,7 @@ interface FastH3PlayParams {
|
|
|
51
51
|
*/
|
|
52
52
|
clip_id?: string;
|
|
53
53
|
}
|
|
54
|
-
/** Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`, or `command_error` when the queue is full, the prompt is empty, both a starting frame and a source clip are given, the source clip is unknown or no longer retained, or the upload is not a decodable image. */
|
|
54
|
+
/** Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. An `ending_frame` can accompany any of these — or stand alone — to make the clip animate *into* and close on that image; with a starting frame or a continued opener it is first-and-last, with neither it is last-frame only. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`, or `command_error` when the queue is full, the prompt is empty, both a starting frame and a source clip are given, the source clip is unknown or no longer retained, or the upload is not a decodable image. */
|
|
55
55
|
interface FastH3EnqueueParams {
|
|
56
56
|
/**
|
|
57
57
|
* Seed for this clip. Omitted or null, the session's default is used and advances by one; passing a seed leaves the default untouched, so explicit and automatic seeding do not interfere.
|
|
@@ -84,6 +84,11 @@ interface FastH3EnqueueParams {
|
|
|
84
84
|
* @default null
|
|
85
85
|
*/
|
|
86
86
|
position?: number | null;
|
|
87
|
+
/**
|
|
88
|
+
* A still image the clip animates into and closes on — its last frame. Common formats decode; the frame is fitted to the session canvas. Combine it with a `starting_frame` (or a `continue_from_clip_id` opener) for first-and-last generation, or send it alone to fix only the ending. Omit for a clip with no fixed end. Independent of how the clip opens, so it pairs with either opener.
|
|
89
|
+
* @default null
|
|
90
|
+
*/
|
|
91
|
+
ending_frame?: FileRef | null;
|
|
87
92
|
/**
|
|
88
93
|
* A still image the clip opens from and animates forward — image-to-video. Common formats decode; the frame is fitted to the session canvas. To continue from a video, extract the frame you want and send it here. Omit for a clip opening from text or from another clip; at most one of this and `continue_from_clip_id`.
|
|
89
94
|
* @default null
|
|
@@ -150,6 +155,7 @@ interface FastH3ClipMovedMessage {
|
|
|
150
155
|
"clip_id": string;
|
|
151
156
|
"seconds": number;
|
|
152
157
|
"metadata": string;
|
|
158
|
+
"has_ending_frame"?: boolean;
|
|
153
159
|
"has_starting_frame": boolean;
|
|
154
160
|
"continue_from_clip_id": string | null;
|
|
155
161
|
};
|
|
@@ -174,6 +180,7 @@ interface FastH3ClipFailedMessage {
|
|
|
174
180
|
"clip_id": string;
|
|
175
181
|
"seconds": number;
|
|
176
182
|
"metadata": string;
|
|
183
|
+
"has_ending_frame"?: boolean;
|
|
177
184
|
"has_starting_frame": boolean;
|
|
178
185
|
"continue_from_clip_id": string | null;
|
|
179
186
|
};
|
|
@@ -196,6 +203,7 @@ interface FastH3ClipPoppedMessage {
|
|
|
196
203
|
"clip_id": string;
|
|
197
204
|
"seconds": number;
|
|
198
205
|
"metadata": string;
|
|
206
|
+
"has_ending_frame"?: boolean;
|
|
199
207
|
"has_starting_frame": boolean;
|
|
200
208
|
"continue_from_clip_id": string | null;
|
|
201
209
|
};
|
|
@@ -212,6 +220,7 @@ interface FastH3ClipQueuedMessage {
|
|
|
212
220
|
"clip_id": string;
|
|
213
221
|
"seconds": number;
|
|
214
222
|
"metadata": string;
|
|
223
|
+
"has_ending_frame"?: boolean;
|
|
215
224
|
"has_starting_frame": boolean;
|
|
216
225
|
"continue_from_clip_id": string | null;
|
|
217
226
|
};
|
|
@@ -228,6 +237,7 @@ interface FastH3ClipStartedMessage {
|
|
|
228
237
|
"clip_id": string;
|
|
229
238
|
"seconds": number;
|
|
230
239
|
"metadata": string;
|
|
240
|
+
"has_ending_frame"?: boolean;
|
|
231
241
|
"has_starting_frame": boolean;
|
|
232
242
|
"continue_from_clip_id": string | null;
|
|
233
243
|
};
|
|
@@ -248,6 +258,7 @@ interface FastH3ClipStoppedMessage {
|
|
|
248
258
|
"clip_id": string;
|
|
249
259
|
"seconds": number;
|
|
250
260
|
"metadata": string;
|
|
261
|
+
"has_ending_frame"?: boolean;
|
|
251
262
|
"has_starting_frame": boolean;
|
|
252
263
|
"continue_from_clip_id": string | null;
|
|
253
264
|
};
|
|
@@ -270,6 +281,7 @@ interface FastH3QueueUpdateMessage {
|
|
|
270
281
|
"clip_id": string;
|
|
271
282
|
"seconds": number;
|
|
272
283
|
"metadata": string;
|
|
284
|
+
"has_ending_frame"?: boolean;
|
|
273
285
|
"has_starting_frame": boolean;
|
|
274
286
|
"continue_from_clip_id": string | null;
|
|
275
287
|
}[];
|
|
@@ -282,6 +294,7 @@ interface FastH3QueueUpdateMessage {
|
|
|
282
294
|
"clip_id": string;
|
|
283
295
|
"seconds": number;
|
|
284
296
|
"metadata": string;
|
|
297
|
+
"has_ending_frame"?: boolean;
|
|
285
298
|
"has_starting_frame": boolean;
|
|
286
299
|
"continue_from_clip_id": string | null;
|
|
287
300
|
}[];
|
|
@@ -294,6 +307,7 @@ interface FastH3QueueUpdateMessage {
|
|
|
294
307
|
"clip_id": string;
|
|
295
308
|
"seconds": number;
|
|
296
309
|
"metadata": string;
|
|
310
|
+
"has_ending_frame"?: boolean;
|
|
297
311
|
"has_starting_frame": boolean;
|
|
298
312
|
"continue_from_clip_id": string | null;
|
|
299
313
|
}[];
|
|
@@ -358,6 +372,7 @@ interface FastH3ClipFinishedMessage {
|
|
|
358
372
|
"clip_id": string;
|
|
359
373
|
"seconds": number;
|
|
360
374
|
"metadata": string;
|
|
375
|
+
"has_ending_frame"?: boolean;
|
|
361
376
|
"has_starting_frame": boolean;
|
|
362
377
|
"continue_from_clip_id": string | null;
|
|
363
378
|
};
|
|
@@ -406,6 +421,7 @@ interface FastH3ClipGeneratedMessage {
|
|
|
406
421
|
"clip_id": string;
|
|
407
422
|
"seconds": number;
|
|
408
423
|
"metadata": string;
|
|
424
|
+
"has_ending_frame"?: boolean;
|
|
409
425
|
"has_starting_frame": boolean;
|
|
410
426
|
"continue_from_clip_id": string | null;
|
|
411
427
|
};
|
|
@@ -496,8 +512,8 @@ declare class FastH3Model extends Reactor {
|
|
|
496
512
|
*/
|
|
497
513
|
reset(): Promise<FastH3SessionResetMessage | undefined>;
|
|
498
514
|
/**
|
|
499
|
-
* Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`, or `command_error` when the queue is full, the prompt is empty, both a starting frame and a source clip are given, the source clip is unknown or no longer retained, or the upload is not a decodable image.
|
|
500
|
-
* @param params - Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`, or `command_error` when the queue is full, the prompt is empty, both a starting frame and a source clip are given, the source clip is unknown or no longer retained, or the upload is not a decodable image.
|
|
515
|
+
* Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. An `ending_frame` can accompany any of these — or stand alone — to make the clip animate *into* and close on that image; with a starting frame or a continued opener it is first-and-last, with neither it is last-frame only. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`, or `command_error` when the queue is full, the prompt is empty, both a starting frame and a source clip are given, the source clip is unknown or no longer retained, or the upload is not a decodable image.
|
|
516
|
+
* @param params - Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. An `ending_frame` can accompany any of these — or stand alone — to make the clip animate *into* and close on that image; with a starting frame or a continued opener it is first-and-last, with neither it is last-frame only. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`, or `command_error` when the queue is full, the prompt is empty, both a starting frame and a source clip are given, the source clip is unknown or no longer retained, or the upload is not a decodable image.
|
|
501
517
|
* @returns The correlated {@link FastH3ClipQueuedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
|
|
502
518
|
*/
|
|
503
519
|
enqueue(params: FastH3EnqueueParams): Promise<FastH3ClipQueuedMessage | undefined>;
|