@reactor-models/fast-h3 1.8.0 → 1.9.1
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 +47 -21
- package/dist/{chunk-KSGHAZAK.mjs → chunk-CQBNH4KP.mjs} +2 -2
- package/dist/chunk-CQBNH4KP.mjs.map +1 -0
- package/dist/{chunk-CDHP3VW7.mjs → chunk-XXLA5OAS.mjs} +26 -26
- package/dist/chunk-XXLA5OAS.mjs.map +1 -0
- package/dist/core.d.mts +35 -31
- package/dist/core.d.ts +35 -31
- package/dist/core.js +25 -25
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +1 -1
- package/dist/index.js +25 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/react.d.mts +5 -0
- package/dist/react.d.ts +5 -0
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-CDHP3VW7.mjs.map +0 -1
- package/dist/chunk-KSGHAZAK.mjs.map +0 -1
package/dist/core.d.ts
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.
|
|
5
|
+
declare const MODEL_VERSION: "v1.9.1";
|
|
6
6
|
/**
|
|
7
7
|
* Preset media tracks for the FastH3 model.
|
|
8
8
|
*
|
|
@@ -21,7 +21,7 @@ declare const FastH3Tracks: readonly [{
|
|
|
21
21
|
}];
|
|
22
22
|
/** Track names the client can subscribe to (recvonly, from the client's perspective). */
|
|
23
23
|
type FastH3RecvTrackName = "main_video" | "main_audio";
|
|
24
|
-
/** 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 referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update
|
|
24
|
+
/** 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 referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `unknown_clip` when no queued clip has that id, `clip_referenced` when queued clips still reference its last frame. */
|
|
25
25
|
interface FastH3PopParams {
|
|
26
26
|
/**
|
|
27
27
|
* UUID of the queued clip to remove, from `clip_queued` or `queue_update`.
|
|
@@ -29,7 +29,7 @@ interface FastH3PopParams {
|
|
|
29
29
|
*/
|
|
30
30
|
clip_id?: string;
|
|
31
31
|
}
|
|
32
|
-
/** 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
|
|
32
|
+
/** 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`. Fails the call with `unknown_clip`, also broadcast as `command_error`, when no queued clip has that id. */
|
|
33
33
|
interface FastH3MoveParams {
|
|
34
34
|
/**
|
|
35
35
|
* UUID of the queued clip to move, from any clip-referencing message.
|
|
@@ -43,7 +43,7 @@ interface FastH3MoveParams {
|
|
|
43
43
|
*/
|
|
44
44
|
position?: number;
|
|
45
45
|
}
|
|
46
|
-
/** 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
|
|
46
|
+
/** 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`. A refusal fails the call with a code and is also broadcast as `command_error`: `already_playing`, `unknown_clip` for an unknown id, `clip_not_ready` while the clip is still generating, and `no_ready_clip` when the playout queue is empty. */
|
|
47
47
|
interface FastH3PlayParams {
|
|
48
48
|
/**
|
|
49
49
|
* UUID of the clip to play, from `clip_generated` or `queue_update`. Blank plays the playout queue's front clip.
|
|
@@ -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. An uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. 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
|
|
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 uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. 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`. A refusal fails the call with a code and is also broadcast as `command_error`: `queue_full` when the queue is full, `empty_prompt` or `prompt_too_long` when the prompt is empty or over the model's token budget, `invalid_request` when both a starting frame and a source clip, or both ending conditions, are given, `unknown_clip` when a source clip is unknown or no longer retained, and `invalid_image` when an 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.
|
|
@@ -113,7 +113,7 @@ interface FastH3SetSeedParams {
|
|
|
113
113
|
*/
|
|
114
114
|
seed?: number;
|
|
115
115
|
}
|
|
116
|
-
/** 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
|
|
116
|
+
/** 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`. A refusal fails the call with a code and is also broadcast as `command_error`: `session_not_empty` while clips are queued or playing, `invalid_aspect` when the ratio is not one this model offers. */
|
|
117
117
|
interface FastH3SetCanvasParams {
|
|
118
118
|
/**
|
|
119
119
|
* Aspect ratio of `main_video`. `canvas_accepted` and `state_update` report the width and height in pixels it resolves to.
|
|
@@ -393,7 +393,11 @@ interface FastH3ClipFinishedMessage {
|
|
|
393
393
|
/** Seconds of video and audio sent since the session began, this clip included. */
|
|
394
394
|
seconds_sent: number;
|
|
395
395
|
}
|
|
396
|
-
/**
|
|
396
|
+
/**
|
|
397
|
+
* Emitted to every client when a command is rejected. The command had no effect.
|
|
398
|
+
*
|
|
399
|
+
* The rejected call itself also fails, with the same reason and a stable error code. Read the failure on the call; this broadcast stays until the next major release.
|
|
400
|
+
*/
|
|
397
401
|
interface FastH3CommandErrorMessage {
|
|
398
402
|
type: "command_error";
|
|
399
403
|
/** Why it was rejected. */
|
|
@@ -499,77 +503,77 @@ declare class FastH3Model extends Reactor {
|
|
|
499
503
|
/** @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. */
|
|
500
504
|
get reactor(): this;
|
|
501
505
|
/**
|
|
502
|
-
* 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 referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update
|
|
503
|
-
* @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 referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update
|
|
504
|
-
* @returns The correlated {@link FastH3ClipPoppedMessage} reply, or `undefined` when the
|
|
506
|
+
* 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 referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `unknown_clip` when no queued clip has that id, `clip_referenced` when queued clips still reference its last frame.
|
|
507
|
+
* @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 referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `unknown_clip` when no queued clip has that id, `clip_referenced` when queued clips still reference its last frame.
|
|
508
|
+
* @returns The correlated {@link FastH3ClipPoppedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
505
509
|
*/
|
|
506
510
|
pop(params: FastH3PopParams): Promise<FastH3ClipPoppedMessage | undefined>;
|
|
507
511
|
/**
|
|
508
|
-
* 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
|
|
509
|
-
* @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
|
|
510
|
-
* @returns The correlated {@link FastH3ClipMovedMessage} reply, or `undefined` when the
|
|
512
|
+
* 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`. Fails the call with `unknown_clip`, also broadcast as `command_error`, when no queued clip has that id.
|
|
513
|
+
* @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`. Fails the call with `unknown_clip`, also broadcast as `command_error`, when no queued clip has that id.
|
|
514
|
+
* @returns The correlated {@link FastH3ClipMovedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
511
515
|
*/
|
|
512
516
|
move(params: FastH3MoveParams): Promise<FastH3ClipMovedMessage | undefined>;
|
|
513
517
|
/**
|
|
514
|
-
* 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
|
|
515
|
-
* @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
|
|
516
|
-
* @returns
|
|
518
|
+
* 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`. A refusal fails the call with a code and is also broadcast as `command_error`: `already_playing`, `unknown_clip` for an unknown id, `clip_not_ready` while the clip is still generating, and `no_ready_clip` when the playout queue is empty.
|
|
519
|
+
* @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`. A refusal fails the call with a code and is also broadcast as `command_error`: `already_playing`, `unknown_clip` for an unknown id, `clip_not_ready` while the clip is still generating, and `no_ready_clip` when the playout queue is empty.
|
|
520
|
+
* @returns `undefined` once the model's handler has completed. This command declares no reply, so a refusal also resolves `undefined`: only the `error` event (with `operation: "sendCommand"` and the model's `code`) tells the two apart.
|
|
517
521
|
*/
|
|
518
522
|
play(params: FastH3PlayParams): Promise<undefined>;
|
|
519
523
|
/**
|
|
520
|
-
* 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`,
|
|
521
|
-
* @returns
|
|
524
|
+
* 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`. Fails the call with `not_playing`, also broadcast as `command_error`, when no clip is playing.
|
|
525
|
+
* @returns `undefined` once the model's handler has completed. This command declares no reply, so a refusal also resolves `undefined`: only the `error` event (with `operation: "sendCommand"` and the model's `code`) tells the two apart.
|
|
522
526
|
*/
|
|
523
527
|
stop(): Promise<undefined>;
|
|
524
528
|
/**
|
|
525
529
|
* 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`.
|
|
526
|
-
* @returns The correlated {@link FastH3SessionResetMessage} reply, or `undefined` when the
|
|
530
|
+
* @returns The correlated {@link FastH3SessionResetMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
527
531
|
*/
|
|
528
532
|
reset(): Promise<FastH3SessionResetMessage | undefined>;
|
|
529
533
|
/**
|
|
530
|
-
* 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 uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. 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
|
|
531
|
-
* @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 uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. 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
|
|
532
|
-
* @returns The correlated {@link FastH3ClipQueuedMessage} reply, or `undefined` when the
|
|
534
|
+
* 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 uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. 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`. A refusal fails the call with a code and is also broadcast as `command_error`: `queue_full` when the queue is full, `empty_prompt` or `prompt_too_long` when the prompt is empty or over the model's token budget, `invalid_request` when both a starting frame and a source clip, or both ending conditions, are given, `unknown_clip` when a source clip is unknown or no longer retained, and `invalid_image` when an upload is not a decodable image.
|
|
535
|
+
* @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 uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. 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`. A refusal fails the call with a code and is also broadcast as `command_error`: `queue_full` when the queue is full, `empty_prompt` or `prompt_too_long` when the prompt is empty or over the model's token budget, `invalid_request` when both a starting frame and a source clip, or both ending conditions, are given, `unknown_clip` when a source clip is unknown or no longer retained, and `invalid_image` when an upload is not a decodable image.
|
|
536
|
+
* @returns The correlated {@link FastH3ClipQueuedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
533
537
|
*/
|
|
534
538
|
enqueue(params: FastH3EnqueueParams): Promise<FastH3ClipQueuedMessage | undefined>;
|
|
535
539
|
/**
|
|
536
540
|
* 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`.
|
|
537
541
|
* @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`.
|
|
538
|
-
* @returns The correlated {@link FastH3SeedAcceptedMessage} reply, or `undefined` when the
|
|
542
|
+
* @returns The correlated {@link FastH3SeedAcceptedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
539
543
|
*/
|
|
540
544
|
setSeed(params: FastH3SetSeedParams): Promise<FastH3SeedAcceptedMessage | undefined>;
|
|
541
545
|
/**
|
|
542
546
|
* 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` or `ending_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.
|
|
543
|
-
* @returns The correlated {@link FastH3QueueUpdateMessage} reply, or `undefined` when the
|
|
547
|
+
* @returns The correlated {@link FastH3QueueUpdateMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
544
548
|
*/
|
|
545
549
|
getQueue(): Promise<FastH3QueueUpdateMessage | undefined>;
|
|
546
550
|
/**
|
|
547
551
|
* 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.
|
|
548
|
-
* @returns The correlated {@link FastH3StateUpdateMessage} reply, or `undefined` when the
|
|
552
|
+
* @returns The correlated {@link FastH3StateUpdateMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
549
553
|
*/
|
|
550
554
|
getState(): Promise<FastH3StateUpdateMessage | undefined>;
|
|
551
555
|
/**
|
|
552
|
-
* 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
|
|
553
|
-
* @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
|
|
554
|
-
* @returns The correlated {@link FastH3CanvasAcceptedMessage} reply, or `undefined` when the
|
|
556
|
+
* 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`. A refusal fails the call with a code and is also broadcast as `command_error`: `session_not_empty` while clips are queued or playing, `invalid_aspect` when the ratio is not one this model offers.
|
|
557
|
+
* @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`. A refusal fails the call with a code and is also broadcast as `command_error`: `session_not_empty` while clips are queued or playing, `invalid_aspect` when the ratio is not one this model offers.
|
|
558
|
+
* @returns The correlated {@link FastH3CanvasAcceptedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
555
559
|
*/
|
|
556
560
|
setCanvas(params: FastH3SetCanvasParams): Promise<FastH3CanvasAcceptedMessage | undefined>;
|
|
557
561
|
/**
|
|
558
562
|
* 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`.
|
|
559
563
|
* @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`.
|
|
560
|
-
* @returns The correlated {@link FastH3AutoplayAcceptedMessage} reply, or `undefined` when the
|
|
564
|
+
* @returns The correlated {@link FastH3AutoplayAcceptedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
561
565
|
*/
|
|
562
566
|
setAutoplay(params: FastH3SetAutoplayParams): Promise<FastH3AutoplayAcceptedMessage | undefined>;
|
|
563
567
|
/**
|
|
564
568
|
* 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`.
|
|
565
569
|
* @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`.
|
|
566
|
-
* @returns The correlated {@link FastH3ClipLengthAcceptedMessage} reply, or `undefined` when the
|
|
570
|
+
* @returns The correlated {@link FastH3ClipLengthAcceptedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
567
571
|
*/
|
|
568
572
|
setClipSeconds(params: FastH3SetClipSecondsParams): Promise<FastH3ClipLengthAcceptedMessage | undefined>;
|
|
569
573
|
/**
|
|
570
574
|
* 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`.
|
|
571
575
|
* @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`.
|
|
572
|
-
* @returns The correlated {@link FastH3FlushAcceptedMessage} reply, or `undefined` when the
|
|
576
|
+
* @returns The correlated {@link FastH3FlushAcceptedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
573
577
|
*/
|
|
574
578
|
setFlushOnClipEnd(params: FastH3SetFlushOnClipEndParams): Promise<FastH3FlushAcceptedMessage | undefined>;
|
|
575
579
|
/**
|
package/dist/core.js
CHANGED
|
@@ -29,7 +29,7 @@ __export(core_exports, {
|
|
|
29
29
|
module.exports = __toCommonJS(core_exports);
|
|
30
30
|
var import_js_sdk = require("@reactor-team/js-sdk");
|
|
31
31
|
var MODEL_NAME = "reactor/fast-h3";
|
|
32
|
-
var MODEL_VERSION = "v1.
|
|
32
|
+
var MODEL_VERSION = "v1.9.1";
|
|
33
33
|
var FastH3Tracks = [
|
|
34
34
|
{ name: "main_video", kind: "video", direction: "recvonly" },
|
|
35
35
|
{ name: "main_audio", kind: "audio", direction: "recvonly" }
|
|
@@ -54,35 +54,35 @@ var FastH3Model = class extends import_js_sdk.Reactor {
|
|
|
54
54
|
return this;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
|
-
* 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 referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update
|
|
58
|
-
* @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 referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update
|
|
59
|
-
* @returns The correlated {@link FastH3ClipPoppedMessage} reply, or `undefined` when the
|
|
57
|
+
* 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 referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `unknown_clip` when no queued clip has that id, `clip_referenced` when queued clips still reference its last frame.
|
|
58
|
+
* @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 referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `unknown_clip` when no queued clip has that id, `clip_referenced` when queued clips still reference its last frame.
|
|
59
|
+
* @returns The correlated {@link FastH3ClipPoppedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
60
60
|
*/
|
|
61
61
|
async pop(params) {
|
|
62
62
|
const reply = await this.sendCommand("pop", params);
|
|
63
63
|
return reply === void 0 ? void 0 : _unwrapMessage(reply);
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
|
-
* 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
|
|
67
|
-
* @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
|
|
68
|
-
* @returns The correlated {@link FastH3ClipMovedMessage} reply, or `undefined` when the
|
|
66
|
+
* 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`. Fails the call with `unknown_clip`, also broadcast as `command_error`, when no queued clip has that id.
|
|
67
|
+
* @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`. Fails the call with `unknown_clip`, also broadcast as `command_error`, when no queued clip has that id.
|
|
68
|
+
* @returns The correlated {@link FastH3ClipMovedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
69
69
|
*/
|
|
70
70
|
async move(params) {
|
|
71
71
|
const reply = await this.sendCommand("move", params);
|
|
72
72
|
return reply === void 0 ? void 0 : _unwrapMessage(reply);
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
|
-
* 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
|
|
76
|
-
* @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
|
|
77
|
-
* @returns
|
|
75
|
+
* 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`. A refusal fails the call with a code and is also broadcast as `command_error`: `already_playing`, `unknown_clip` for an unknown id, `clip_not_ready` while the clip is still generating, and `no_ready_clip` when the playout queue is empty.
|
|
76
|
+
* @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`. A refusal fails the call with a code and is also broadcast as `command_error`: `already_playing`, `unknown_clip` for an unknown id, `clip_not_ready` while the clip is still generating, and `no_ready_clip` when the playout queue is empty.
|
|
77
|
+
* @returns `undefined` once the model's handler has completed. This command declares no reply, so a refusal also resolves `undefined`: only the `error` event (with `operation: "sendCommand"` and the model's `code`) tells the two apart.
|
|
78
78
|
*/
|
|
79
79
|
async play(params) {
|
|
80
80
|
await this.sendCommand("play", params);
|
|
81
81
|
return void 0;
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
|
-
* 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`,
|
|
85
|
-
* @returns
|
|
84
|
+
* 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`. Fails the call with `not_playing`, also broadcast as `command_error`, when no clip is playing.
|
|
85
|
+
* @returns `undefined` once the model's handler has completed. This command declares no reply, so a refusal also resolves `undefined`: only the `error` event (with `operation: "sendCommand"` and the model's `code`) tells the two apart.
|
|
86
86
|
*/
|
|
87
87
|
async stop() {
|
|
88
88
|
await this.sendCommand("stop", {});
|
|
@@ -90,16 +90,16 @@ var FastH3Model = class extends import_js_sdk.Reactor {
|
|
|
90
90
|
}
|
|
91
91
|
/**
|
|
92
92
|
* 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`.
|
|
93
|
-
* @returns The correlated {@link FastH3SessionResetMessage} reply, or `undefined` when the
|
|
93
|
+
* @returns The correlated {@link FastH3SessionResetMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
94
94
|
*/
|
|
95
95
|
async reset() {
|
|
96
96
|
const reply = await this.sendCommand("reset", {});
|
|
97
97
|
return reply === void 0 ? void 0 : _unwrapMessage(reply);
|
|
98
98
|
}
|
|
99
99
|
/**
|
|
100
|
-
* 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 uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. 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
|
|
101
|
-
* @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 uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. 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
|
|
102
|
-
* @returns The correlated {@link FastH3ClipQueuedMessage} reply, or `undefined` when the
|
|
100
|
+
* 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 uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. 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`. A refusal fails the call with a code and is also broadcast as `command_error`: `queue_full` when the queue is full, `empty_prompt` or `prompt_too_long` when the prompt is empty or over the model's token budget, `invalid_request` when both a starting frame and a source clip, or both ending conditions, are given, `unknown_clip` when a source clip is unknown or no longer retained, and `invalid_image` when an upload is not a decodable image.
|
|
101
|
+
* @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 uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. 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`. A refusal fails the call with a code and is also broadcast as `command_error`: `queue_full` when the queue is full, `empty_prompt` or `prompt_too_long` when the prompt is empty or over the model's token budget, `invalid_request` when both a starting frame and a source clip, or both ending conditions, are given, `unknown_clip` when a source clip is unknown or no longer retained, and `invalid_image` when an upload is not a decodable image.
|
|
102
|
+
* @returns The correlated {@link FastH3ClipQueuedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
103
103
|
*/
|
|
104
104
|
async enqueue(params) {
|
|
105
105
|
const reply = await this.sendCommand("enqueue", params);
|
|
@@ -108,7 +108,7 @@ var FastH3Model = class extends import_js_sdk.Reactor {
|
|
|
108
108
|
/**
|
|
109
109
|
* 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`.
|
|
110
110
|
* @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`.
|
|
111
|
-
* @returns The correlated {@link FastH3SeedAcceptedMessage} reply, or `undefined` when the
|
|
111
|
+
* @returns The correlated {@link FastH3SeedAcceptedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
112
112
|
*/
|
|
113
113
|
async setSeed(params) {
|
|
114
114
|
const reply = await this.sendCommand("set_seed", params);
|
|
@@ -116,7 +116,7 @@ var FastH3Model = class extends import_js_sdk.Reactor {
|
|
|
116
116
|
}
|
|
117
117
|
/**
|
|
118
118
|
* 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` or `ending_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.
|
|
119
|
-
* @returns The correlated {@link FastH3QueueUpdateMessage} reply, or `undefined` when the
|
|
119
|
+
* @returns The correlated {@link FastH3QueueUpdateMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
120
120
|
*/
|
|
121
121
|
async getQueue() {
|
|
122
122
|
const reply = await this.sendCommand("get_queue", {});
|
|
@@ -124,16 +124,16 @@ var FastH3Model = class extends import_js_sdk.Reactor {
|
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
126
126
|
* 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.
|
|
127
|
-
* @returns The correlated {@link FastH3StateUpdateMessage} reply, or `undefined` when the
|
|
127
|
+
* @returns The correlated {@link FastH3StateUpdateMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
128
128
|
*/
|
|
129
129
|
async getState() {
|
|
130
130
|
const reply = await this.sendCommand("get_state", {});
|
|
131
131
|
return reply === void 0 ? void 0 : _unwrapMessage(reply);
|
|
132
132
|
}
|
|
133
133
|
/**
|
|
134
|
-
* 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
|
|
135
|
-
* @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
|
|
136
|
-
* @returns The correlated {@link FastH3CanvasAcceptedMessage} reply, or `undefined` when the
|
|
134
|
+
* 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`. A refusal fails the call with a code and is also broadcast as `command_error`: `session_not_empty` while clips are queued or playing, `invalid_aspect` when the ratio is not one this model offers.
|
|
135
|
+
* @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`. A refusal fails the call with a code and is also broadcast as `command_error`: `session_not_empty` while clips are queued or playing, `invalid_aspect` when the ratio is not one this model offers.
|
|
136
|
+
* @returns The correlated {@link FastH3CanvasAcceptedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
137
137
|
*/
|
|
138
138
|
async setCanvas(params) {
|
|
139
139
|
const reply = await this.sendCommand("set_canvas", params);
|
|
@@ -142,7 +142,7 @@ var FastH3Model = class extends import_js_sdk.Reactor {
|
|
|
142
142
|
/**
|
|
143
143
|
* 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`.
|
|
144
144
|
* @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`.
|
|
145
|
-
* @returns The correlated {@link FastH3AutoplayAcceptedMessage} reply, or `undefined` when the
|
|
145
|
+
* @returns The correlated {@link FastH3AutoplayAcceptedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
146
146
|
*/
|
|
147
147
|
async setAutoplay(params) {
|
|
148
148
|
const reply = await this.sendCommand("set_autoplay", params);
|
|
@@ -151,7 +151,7 @@ var FastH3Model = class extends import_js_sdk.Reactor {
|
|
|
151
151
|
/**
|
|
152
152
|
* 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`.
|
|
153
153
|
* @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`.
|
|
154
|
-
* @returns The correlated {@link FastH3ClipLengthAcceptedMessage} reply, or `undefined` when the
|
|
154
|
+
* @returns The correlated {@link FastH3ClipLengthAcceptedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
155
155
|
*/
|
|
156
156
|
async setClipSeconds(params) {
|
|
157
157
|
const reply = await this.sendCommand("set_clip_seconds", params);
|
|
@@ -160,7 +160,7 @@ var FastH3Model = class extends import_js_sdk.Reactor {
|
|
|
160
160
|
/**
|
|
161
161
|
* 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`.
|
|
162
162
|
* @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`.
|
|
163
|
-
* @returns The correlated {@link FastH3FlushAcceptedMessage} reply, or `undefined` when the
|
|
163
|
+
* @returns The correlated {@link FastH3FlushAcceptedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
|
|
164
164
|
*/
|
|
165
165
|
async setFlushOnClipEnd(params) {
|
|
166
166
|
const reply = await this.sendCommand("set_flush_on_clip_end", params);
|