@reactor-models/fast-h3 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/{chunk-O4Q6CVNF.mjs → chunk-47SRKSQQ.mjs} +4 -4
- package/dist/chunk-47SRKSQQ.mjs.map +1 -0
- package/dist/{chunk-K4CGGYQP.mjs → chunk-OR7RQLXO.mjs} +2 -2
- package/dist/{chunk-K4CGGYQP.mjs.map → chunk-OR7RQLXO.mjs.map} +1 -1
- package/dist/core.d.mts +5 -5
- package/dist/core.d.ts +5 -5
- 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-O4Q6CVNF.mjs.map +0 -1
package/dist/core.js.map
CHANGED
|
@@ -1 +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.3.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.3.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 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`, or `command_error` when no queued clip has that id or queued clips still reference its last frame. */\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 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`, or `command_error` when the queue is full, the prompt is empty, both a starting frame and a source clip are given, both ending conditions are given, a source clip is unknown or no longer retained, or an 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 4000 characters. Fixed once enqueued; a different scene is a new `enqueue`.\n * @maxLength 4000\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 or one ending on a retained generated frame. At most one of this and `ending_from_clip_id`; 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 clean retained last frame this clip animates into and closes on. 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 no generated ending target; at most one of this and `ending_frame`. This is independent of the opener, so it may equal `continue_from_clip_id` to create a hold that starts and ends on the same generated frame.\n * @default \"\"\n */\n\n ending_from_clip_id?: string;\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; \"ending_from_clip_id\"?: string | null; \"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; \"ending_from_clip_id\"?: string | null; \"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; \"ending_from_clip_id\"?: string | null; \"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; \"ending_from_clip_id\"?: string | null; \"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; \"ending_from_clip_id\"?: string | null; \"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; \"ending_from_clip_id\"?: string | null; \"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` or `ending_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; \"ending_from_clip_id\"?: string | null; \"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; \"ending_from_clip_id\"?: string | null; \"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 referenced starting or ending 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; \"ending_from_clip_id\"?: string | null; \"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; \"ending_from_clip_id\"?: string | null; \"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; \"ending_from_clip_id\"?: string | null; \"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 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`, or `command_error` when no queued clip has that id or queued clips still reference its last frame.\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 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`, or `command_error` when no queued clip has that id or queued clips still reference its last frame.\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 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`, or `command_error` when the queue is full, the prompt is empty, both a starting frame and a source clip are given, both ending conditions are given, a source clip is unknown or no longer retained, or an 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 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`, or `command_error` when the queue is full, the prompt is empty, both a starting frame and a source clip are given, both ending conditions are given, a source clip is unknown or no longer retained, or an 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` 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.\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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,oBAAiC;AAG1B,IAAM,aAAa;AACnB,IAAM,gBAAgB;AAStB,IAAM,eAAe;AAAA,EAC1B,EAAE,MAAM,cAAc,MAAM,SAAS,WAAW,WAAW;AAAA,EAC3D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inc. All rights reserved.\n\n// Auto-generated by @reactor-team/codegen — DO NOT EDIT\n// Model: fast-h3 v1.4.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.4.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 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`, or `command_error` when no queued clip has that id or queued clips still reference its last frame. */\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 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`, or `command_error` when the queue is full, the prompt is empty or over the model's token budget, both a starting frame and a source clip are given, both ending conditions are given, a source clip is unknown or no longer retained, or an 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 4000 characters and 1024 tokens — whichever is reached first, which for Latin script is the character count and for a denser script the token count. Past either, the `enqueue` is refused and says which bound and by how much; nothing is silently trimmed. Fixed once enqueued; a different scene is a new `enqueue`.\n * @maxLength 4000\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 or one ending on a retained generated frame. At most one of this and `ending_from_clip_id`; 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 clean retained last frame this clip animates into and closes on. 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 no generated ending target; at most one of this and `ending_frame`. This is independent of the opener, so it may equal `continue_from_clip_id` to create a hold that starts and ends on the same generated frame.\n * @default \"\"\n */\n\n ending_from_clip_id?: string;\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; \"ending_from_clip_id\"?: string | null; \"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; \"ending_from_clip_id\"?: string | null; \"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; \"ending_from_clip_id\"?: string | null; \"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; \"ending_from_clip_id\"?: string | null; \"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; \"ending_from_clip_id\"?: string | null; \"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; \"ending_from_clip_id\"?: string | null; \"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` or `ending_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; \"ending_from_clip_id\"?: string | null; \"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; \"ending_from_clip_id\"?: string | null; \"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 referenced starting or ending 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; \"ending_from_clip_id\"?: string | null; \"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; \"ending_from_clip_id\"?: string | null; \"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; \"ending_from_clip_id\"?: string | null; \"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 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`, or `command_error` when no queued clip has that id or queued clips still reference its last frame.\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 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`, or `command_error` when no queued clip has that id or queued clips still reference its last frame.\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 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`, or `command_error` when the queue is full, the prompt is empty or over the model's token budget, both a starting frame and a source clip are given, both ending conditions are given, a source clip is unknown or no longer retained, or an 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 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`, or `command_error` when the queue is full, the prompt is empty or over the model's token budget, both a starting frame and a source clip are given, both ending conditions are given, a source clip is unknown or no longer retained, or an 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` 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.\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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,oBAAiC;AAG1B,IAAM,aAAa;AACnB,IAAM,gBAAgB;AAStB,IAAM,eAAe;AAAA,EAC1B,EAAE,MAAM,cAAc,MAAM,SAAS,WAAW,WAAW;AAAA,EAC3D,EAAE,MAAM,cAAc,MAAM,SAAS,WAAW,WAAW;AAC7D;AA0cA,SAAS,eAAkB,KAAiB;AAC1C,QAAM,MAAM;AACZ,MACE,OACA,OAAO,QAAQ,YACf,IAAI,QACJ,OAAO,IAAI,SAAS,UACpB;AACA,WAAO,EAAE,GAAG,IAAI,MAAM,MAAM,IAAI,KAAK;AAAA,EACvC;AACA,SAAO;AACT;AAYO,IAAM,cAAN,cAA0B,sBAAQ;AAAA,EACvC,YAAY,SAAyB;AACnC,UAAM;AAAA,MACJ,GAAG;AAAA,MACH,WAAW;AAAA,MACX,aAAa,CAAC,GAAG,YAAY;AAAA,IAC/B,CAAC;AAAA,EACH;AAAA;AAAA,EAIA,IAAI,UAAgB;AAClB,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,IAAI,QAAuE;AAC/E,UAAM,QAAQ,MAAM,KAAK,YAAY,OAAO,MAAM;AAClD,WAA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AwB,SAAQ,GAAsC;AAAA,IACzF,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,YACE,SACY;AACZ,UAAM,UAAU,CAAC,MAAc,GAAqB,MAAmB;AACrE,UAAI,SAAS,aAAc,SAAQ,GAAG,CAAC;AAAA,IACzC;AACA,SAAK,GAAG,iBAAiB,OAAO;AAChC,WAAO,MAAM,KAAK,IAAI,iBAAiB,OAAO;AAAA,EAChD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,YACE,SACY;AACZ,UAAM,UAAU,CAAC,MAAc,GAAqB,MAAmB;AACrE,UAAI,SAAS,aAAc,SAAQ,GAAG,CAAC;AAAA,IACzC;AACA,SAAK,GAAG,iBAAiB,OAAO;AAChC,WAAO,MAAM,KAAK,IAAI,iBAAiB,OAAO;AAAA,EAChD;AACF;","names":[]}
|
package/dist/core.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -53,7 +53,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
53
53
|
// src/core.ts
|
|
54
54
|
var import_js_sdk = require("@reactor-team/js-sdk");
|
|
55
55
|
var MODEL_NAME = "reactor/fast-h3";
|
|
56
|
-
var MODEL_VERSION = "v1.
|
|
56
|
+
var MODEL_VERSION = "v1.4.0";
|
|
57
57
|
var FastH3Tracks = [
|
|
58
58
|
{ name: "main_video", kind: "video", direction: "recvonly" },
|
|
59
59
|
{ name: "main_audio", kind: "audio", direction: "recvonly" }
|
|
@@ -121,8 +121,8 @@ var FastH3Model = class extends import_js_sdk.Reactor {
|
|
|
121
121
|
return reply === void 0 ? void 0 : _unwrapMessage(reply);
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
|
-
* 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`, or `command_error` when the queue is full, the prompt is empty, both a starting frame and a source clip are given, both ending conditions are given, a source clip is unknown or no longer retained, or an upload is not a decodable image.
|
|
125
|
-
* @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`, or `command_error` when the queue is full, the prompt is empty, both a starting frame and a source clip are given, both ending conditions are given, a source clip is unknown or no longer retained, or an upload is not a decodable image.
|
|
124
|
+
* 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`, or `command_error` when the queue is full, the prompt is empty or over the model's token budget, both a starting frame and a source clip are given, both ending conditions are given, a source clip is unknown or no longer retained, or an upload is not a decodable image.
|
|
125
|
+
* @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`, or `command_error` when the queue is full, the prompt is empty or over the model's token budget, both a starting frame and a source clip are given, both ending conditions are given, a source clip is unknown or no longer retained, or an upload is not a decodable image.
|
|
126
126
|
* @returns The correlated {@link FastH3ClipQueuedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
|
|
127
127
|
*/
|
|
128
128
|
async enqueue(params) {
|