@reactor-models/fast-h3 1.8.0 → 1.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/react.tsx"],"sourcesContent":["// Copyright (c) 2026 Reactor Technologies, Inc. All rights reserved.\n\n// Auto-generated by @reactor-team/codegen — DO NOT EDIT\n// Model: fast-h3 v1.9.2\n\n\"use client\";\n\nimport { type ReactElement } from \"react\";\nimport {\n ReactorProvider,\n useReactor,\n useReactorMessage,\n ReactorView,\n type ReactorViewProps,\n} from \"@reactor-team/js-sdk\";\nimport {\n MODEL_NAME,\n FastH3Tracks,\n type FastH3Options,\n type FastH3PopParams,\n type FastH3MoveParams,\n type FastH3PlayParams,\n type FastH3EnqueueParams,\n type FastH3SetSeedParams,\n type FastH3SetCanvasParams,\n type FastH3SetAutoplayParams,\n type FastH3SetClipSecondsParams,\n type FastH3SetFlushOnClipEndParams,\n type FastH3Message,\n type FastH3ClipMovedMessage,\n type FastH3ClipFailedMessage,\n type FastH3ClipPoppedMessage,\n type FastH3ClipQueuedMessage,\n type FastH3ClipStartedMessage,\n type FastH3ClipStoppedMessage,\n type FastH3QueueUpdateMessage,\n type FastH3StateUpdateMessage,\n type FastH3ClipFinishedMessage,\n type FastH3CommandErrorMessage,\n type FastH3SeedAcceptedMessage,\n type FastH3SessionResetMessage,\n type FastH3ClipGeneratedMessage,\n type FastH3FlushAcceptedMessage,\n type FastH3CanvasAcceptedMessage,\n type FastH3AutoplayAcceptedMessage,\n type FastH3ClipLengthAcceptedMessage,\n type FastH3RecvTrackName,\n} from \"./core.js\";\n\n/**\n * @internal Flatten the `{ type, data, uploads? }` envelope the SDK\n * hands to `reactor.on(\"message\", …)` so a field the model schema\n * declares on a message is reachable at `msg.<field>` — matching the\n * shape the exported message interfaces promise.\n */\nfunction _unwrapMessage<T>(raw: unknown): T {\n const env = raw as { type?: string; data?: Record<string, unknown> };\n if (\n env &&\n typeof env === \"object\" &&\n env.data &&\n typeof env.data === \"object\"\n ) {\n return { ...env.data, type: env.type } as T;\n }\n return raw as T;\n}\n\n/**\n * Props for the {@link FastH3Provider} component.\n *\n * Derived from `ReactorProvider`'s own props, with `modelName` and\n * `modelTracks` stripped — those are supplied by this provider.\n */\nexport type FastH3ProviderProps = Omit<\n Parameters<typeof ReactorProvider>[0],\n \"modelName\" | \"modelTracks\"\n>;\n\n/**\n * Provider for the FastH3 model.\n *\n * Wraps {@link ReactorProvider} with `modelName` and `modelTracks` pre-configured from the\n * generated constants. Drop this near the top of your tree, then use\n * {@link useFastH3} and the `useFastH3<Message>` hooks below it.\n */\nexport function FastH3Provider({\n children,\n ...rest\n}: FastH3ProviderProps): ReactElement {\n return (\n <ReactorProvider\n {...rest}\n modelName={MODEL_NAME}\n modelTracks={[...FastH3Tracks]}\n >\n {children}\n </ReactorProvider>\n );\n}\n\n/**\n * Access the FastH3 model as typed commands bound to the nearest\n * {@link FastH3Provider}.\n *\n * Returns the full action surface — every public field on the SDK's\n * `ReactorStore` (`status`, `sessionId`, `connect`, `disconnect`,\n * `sendCommand`, `uploadFile`, `publish`, `unpublish`, `reconnect`,\n * …) is exposed automatically, alongside one typed method per\n * model event.\n *\n * Fields are pulled off the store one at a time so Zustand's\n * shallow-equality selector keeps each subscription scoped — a\n * component reading only `status` doesn't re-render when\n * `lastError` changes. Future SDK releases that add new\n * store fields flow into this hook on the next codegen run with no\n * hand-edit (the field list is derived from `js-sdk`'s d.ts via\n * `loadReactorStoreFieldsFromDts` in `sdk-surface.ts`).\n *\n * Each typed event method resolves with the command's correlated\n * reply: the declared reply message for commands that return one,\n * `undefined` once the handler completes for commands that don't.\n * A failed or refused command resolves `undefined` and never rejects;\n * its error lands in `lastError` with `operation: \"sendCommand\"` and,\n * for a refusal, the model's `code`. The store keeps the latest error until\n * the next one, so do not render a command failure as a connection\n * error.\n */\nexport function useFastH3() {\n const connect = useReactor((s) => s.connect);\n const connectOptions = useReactor((s) => s.connectOptions);\n const disconnect = useReactor((s) => s.disconnect);\n const downloadClipAsFile = useReactor((s) => s.downloadClipAsFile);\n const jwtToken = useReactor((s) => s.jwtToken);\n const lastError = useReactor((s) => s.lastError);\n const lastMessage = useReactor((s) => s.lastMessage);\n const pauseTrack = useReactor((s) => s.pauseTrack);\n const publish = useReactor((s) => s.publish);\n const reconnect = useReactor((s) => s.reconnect);\n const requestClip = useReactor((s) => s.requestClip);\n const requestRecording = useReactor((s) => s.requestRecording);\n const resumeTrack = useReactor((s) => s.resumeTrack);\n const sendCommand = useReactor((s) => s.sendCommand);\n const sessionId = useReactor((s) => s.sessionId);\n const status = useReactor((s) => s.status);\n const tracks = useReactor((s) => s.tracks);\n const unpublish = useReactor((s) => s.unpublish);\n const uploadFile = useReactor((s) => s.uploadFile);\n\n return {\n connect,\n connectOptions,\n disconnect,\n downloadClipAsFile,\n jwtToken,\n lastError,\n lastMessage,\n pauseTrack,\n publish,\n reconnect,\n requestClip,\n requestRecording,\n resumeTrack,\n sendCommand,\n sessionId,\n status,\n tracks,\n unpublish,\n uploadFile,\n pop: async (params: FastH3PopParams): Promise<FastH3ClipPoppedMessage | undefined> => {\n const reply = await sendCommand(\"pop\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3ClipPoppedMessage>(reply);\n },\n move: async (params: FastH3MoveParams): Promise<FastH3ClipMovedMessage | undefined> => {\n const reply = await sendCommand(\"move\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3ClipMovedMessage>(reply);\n },\n play: async (params: FastH3PlayParams): Promise<undefined> => {\n await sendCommand(\"play\", params);\n return undefined;\n },\n stop: async (): Promise<undefined> => {\n await sendCommand(\"stop\", {});\n return undefined;\n },\n reset: async (): Promise<FastH3SessionResetMessage | undefined> => {\n const reply = await sendCommand(\"reset\", {});\n return reply === undefined ? undefined : _unwrapMessage<FastH3SessionResetMessage>(reply);\n },\n enqueue: async (params: FastH3EnqueueParams): Promise<FastH3ClipQueuedMessage | undefined> => {\n const reply = await sendCommand(\"enqueue\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3ClipQueuedMessage>(reply);\n },\n setSeed: async (params: FastH3SetSeedParams): Promise<FastH3SeedAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_seed\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3SeedAcceptedMessage>(reply);\n },\n getQueue: async (): Promise<FastH3QueueUpdateMessage | undefined> => {\n const reply = await sendCommand(\"get_queue\", {});\n return reply === undefined ? undefined : _unwrapMessage<FastH3QueueUpdateMessage>(reply);\n },\n getState: async (): Promise<FastH3StateUpdateMessage | undefined> => {\n const reply = await sendCommand(\"get_state\", {});\n return reply === undefined ? undefined : _unwrapMessage<FastH3StateUpdateMessage>(reply);\n },\n setCanvas: async (params: FastH3SetCanvasParams): Promise<FastH3CanvasAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_canvas\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3CanvasAcceptedMessage>(reply);\n },\n setAutoplay: async (params: FastH3SetAutoplayParams): Promise<FastH3AutoplayAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_autoplay\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3AutoplayAcceptedMessage>(reply);\n },\n setClipSeconds: async (params: FastH3SetClipSecondsParams): Promise<FastH3ClipLengthAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_clip_seconds\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3ClipLengthAcceptedMessage>(reply);\n },\n setFlushOnClipEnd: async (params: FastH3SetFlushOnClipEndParams): Promise<FastH3FlushAcceptedMessage | undefined> => {\n const reply = await sendCommand(\"set_flush_on_clip_end\", params);\n return reply === undefined ? undefined : _unwrapMessage<FastH3FlushAcceptedMessage>(reply);\n },\n };\n}\n\n/**\n * Subscribe to any FastH3 message with a fully-typed handler.\n * The handler receives a discriminated FastH3Message.\n */\nexport function useFastH3Message(\n handler: (message: FastH3Message) => void,\n): void {\n useReactorMessage((msg: unknown) =>\n handler(_unwrapMessage<FastH3Message>(msg)),\n );\n}\n\n/**\n * Subscribe to \"clip_moved\" messages only.\n * Handler receives a fully-typed FastH3ClipMovedMessage.\n */\nexport function useFastH3ClipMoved(\n handler: (message: FastH3ClipMovedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_moved\") {\n handler(m as FastH3ClipMovedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_failed\" messages only.\n * Handler receives a fully-typed FastH3ClipFailedMessage.\n */\nexport function useFastH3ClipFailed(\n handler: (message: FastH3ClipFailedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_failed\") {\n handler(m as FastH3ClipFailedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_popped\" messages only.\n * Handler receives a fully-typed FastH3ClipPoppedMessage.\n */\nexport function useFastH3ClipPopped(\n handler: (message: FastH3ClipPoppedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_popped\") {\n handler(m as FastH3ClipPoppedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_queued\" messages only.\n * Handler receives a fully-typed FastH3ClipQueuedMessage.\n */\nexport function useFastH3ClipQueued(\n handler: (message: FastH3ClipQueuedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_queued\") {\n handler(m as FastH3ClipQueuedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_started\" messages only.\n * Handler receives a fully-typed FastH3ClipStartedMessage.\n */\nexport function useFastH3ClipStarted(\n handler: (message: FastH3ClipStartedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_started\") {\n handler(m as FastH3ClipStartedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_stopped\" messages only.\n * Handler receives a fully-typed FastH3ClipStoppedMessage.\n */\nexport function useFastH3ClipStopped(\n handler: (message: FastH3ClipStoppedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_stopped\") {\n handler(m as FastH3ClipStoppedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"queue_update\" messages only.\n * Handler receives a fully-typed FastH3QueueUpdateMessage.\n */\nexport function useFastH3QueueUpdate(\n handler: (message: FastH3QueueUpdateMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"queue_update\") {\n handler(m as FastH3QueueUpdateMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"state_update\" messages only.\n * Handler receives a fully-typed FastH3StateUpdateMessage.\n */\nexport function useFastH3StateUpdate(\n handler: (message: FastH3StateUpdateMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"state_update\") {\n handler(m as FastH3StateUpdateMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_finished\" messages only.\n * Handler receives a fully-typed FastH3ClipFinishedMessage.\n */\nexport function useFastH3ClipFinished(\n handler: (message: FastH3ClipFinishedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_finished\") {\n handler(m as FastH3ClipFinishedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"command_error\" messages only.\n * Handler receives a fully-typed FastH3CommandErrorMessage.\n */\nexport function useFastH3CommandError(\n handler: (message: FastH3CommandErrorMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"command_error\") {\n handler(m as FastH3CommandErrorMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"seed_accepted\" messages only.\n * Handler receives a fully-typed FastH3SeedAcceptedMessage.\n */\nexport function useFastH3SeedAccepted(\n handler: (message: FastH3SeedAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"seed_accepted\") {\n handler(m as FastH3SeedAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"session_reset\" messages only.\n * Handler receives a fully-typed FastH3SessionResetMessage.\n */\nexport function useFastH3SessionReset(\n handler: (message: FastH3SessionResetMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"session_reset\") {\n handler(m as FastH3SessionResetMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_generated\" messages only.\n * Handler receives a fully-typed FastH3ClipGeneratedMessage.\n */\nexport function useFastH3ClipGenerated(\n handler: (message: FastH3ClipGeneratedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_generated\") {\n handler(m as FastH3ClipGeneratedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"flush_accepted\" messages only.\n * Handler receives a fully-typed FastH3FlushAcceptedMessage.\n */\nexport function useFastH3FlushAccepted(\n handler: (message: FastH3FlushAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"flush_accepted\") {\n handler(m as FastH3FlushAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"canvas_accepted\" messages only.\n * Handler receives a fully-typed FastH3CanvasAcceptedMessage.\n */\nexport function useFastH3CanvasAccepted(\n handler: (message: FastH3CanvasAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"canvas_accepted\") {\n handler(m as FastH3CanvasAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"autoplay_accepted\" messages only.\n * Handler receives a fully-typed FastH3AutoplayAcceptedMessage.\n */\nexport function useFastH3AutoplayAccepted(\n handler: (message: FastH3AutoplayAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"autoplay_accepted\") {\n handler(m as FastH3AutoplayAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"clip_length_accepted\" messages only.\n * Handler receives a fully-typed FastH3ClipLengthAcceptedMessage.\n */\nexport function useFastH3ClipLengthAccepted(\n handler: (message: FastH3ClipLengthAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<FastH3Message>(msg);\n if (m.type === \"clip_length_accepted\") {\n handler(m as FastH3ClipLengthAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to a recvonly MediaStreamTrack the model publishes, by name.\n *\n * Returns `undefined` until the model emits the track, then the live track for the lifetime of the connection. `name` is constrained to the model's declared recvonly channels — use one of `FastH3RecvTrackName`.\n * @param name - A recvonly track name declared by the model\n * @returns The live MediaStreamTrack, or `undefined` until received\n */\nexport function useFastH3Track(\n name: FastH3RecvTrackName,\n): MediaStreamTrack | undefined {\n return useReactor((s) => s.tracks[name]);\n}\n\nexport type FastH3MainVideoViewProps = Omit<ReactorViewProps, \"track\">;\n\n/**\n * Render the model's \"main_video\" recvonly video track in a `<video>` element.\n *\n * Thin wrapper around `<ReactorView>` with `track` pre-bound. Accepts every other `ReactorViewProps` (`audioTrack`, `className`, `style`, `videoObjectFit`, `muted`, …). Must be rendered inside `<FastH3Provider>`.\n */\nexport function FastH3MainVideoView(\n props: FastH3MainVideoViewProps,\n): ReactElement {\n return <ReactorView {...props} track=\"main_video\" />;\n}\n"],"mappings":";;;;;;AAQA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AA6EH;AApCJ,SAAS,eAAkB,KAAiB;AAC1C,QAAM,MAAM;AACZ,MACE,OACA,OAAO,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M,EAAE,OAAO,IAAI,CAAC;AACzC;AASO,SAAS,oBACd,OACc;AACd,SAAO,oBAAC,eAAa,GAAG,OAAO,OAAM,cAAa;AACpD;","names":[]}
package/dist/core.d.mts CHANGED
@@ -2,7 +2,7 @@ import { FileRef, Reactor } from '@reactor-team/js-sdk';
2
2
  export { FileRef } from '@reactor-team/js-sdk';
3
3
 
4
4
  declare const MODEL_NAME: "reactor/fast-h3";
5
- declare const MODEL_VERSION: "v1.8.0";
5
+ declare const MODEL_VERSION: "v1.9.2";
6
6
  /**
7
7
  * Preset media tracks for the FastH3 model.
8
8
  *
@@ -21,7 +21,7 @@ declare const FastH3Tracks: readonly [{
21
21
  }];
22
22
  /** Track names the client can subscribe to (recvonly, from the client's perspective). */
23
23
  type FastH3RecvTrackName = "main_video" | "main_audio";
24
- /** Remove one clip by its UUID from whichever queue holds it, freeing its slot. Works on generating and built clips alike; a build already running for it is discarded when it completes. The clip that is playing is in neither queue — `stop` is the command that cuts it. A built clip stays in `queue_update.history` after popping, so clips referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update`, or `command_error` when no queued clip has that id or queued clips still reference its last frame. */
24
+ /** Remove one clip by its UUID from whichever queue holds it, freeing its slot. Works on generating and built clips alike; a build already running for it is discarded when it completes. The clip that is playing is in neither queue — `stop` is the command that cuts it. A built clip stays in `queue_update.history` after popping, so clips referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `unknown_clip` when no queued clip has that id, `clip_referenced` when queued clips still reference its last frame. */
25
25
  interface FastH3PopParams {
26
26
  /**
27
27
  * UUID of the queued clip to remove, from `clip_queued` or `queue_update`.
@@ -29,7 +29,7 @@ interface FastH3PopParams {
29
29
  */
30
30
  clip_id?: string;
31
31
  }
32
- /** Reposition one clip within the queue that holds it — the generation queue for a clip still to build, the playout queue for a built one; clips never move between queues except by building. `position` 0 is the front: the next build, or what bare `play` and autoplay take next. Values past the end mean the back. Replies `clip_moved` with the queue and the resulting position, and emits `queue_update`; `command_error` when no queued clip has that id. */
32
+ /** Reposition one clip within the queue that holds it — the generation queue for a clip still to build, the playout queue for a built one; clips never move between queues except by building. `position` 0 is the front: the next build, or what bare `play` and autoplay take next. Values past the end mean the back. Replies `clip_moved` with the queue and the resulting position, and emits `queue_update`. Fails the call with `unknown_clip`, also broadcast as `command_error`, when no queued clip has that id. */
33
33
  interface FastH3MoveParams {
34
34
  /**
35
35
  * UUID of the queued clip to move, from any clip-referencing message.
@@ -43,7 +43,7 @@ interface FastH3MoveParams {
43
43
  */
44
44
  position?: number;
45
45
  }
46
- /** Play one clip from the playout queue. Blank `clip_id` plays the front clip; a UUID plays that specific one. Playing consumes the entry: it leaves the queue, `clip_started` marks its first frames, and when it ends the stream holds on black until the next `play`. Emits `queue_update` and `state_update`, or `command_error` when a clip is already playing, the id is unknown, or the clip is still generating. */
46
+ /** Play one clip from the playout queue. Blank `clip_id` plays the front clip; a UUID plays that specific one. Playing consumes the entry: it leaves the queue, `clip_started` marks its first frames, and when it ends the stream holds on black until the next `play`. Emits `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `already_playing`, `unknown_clip` for an unknown id, `clip_not_ready` while the clip is still generating, and `no_ready_clip` when the playout queue is empty. */
47
47
  interface FastH3PlayParams {
48
48
  /**
49
49
  * UUID of the clip to play, from `clip_generated` or `queue_update`. Blank plays the playout queue's front clip.
@@ -51,7 +51,7 @@ interface FastH3PlayParams {
51
51
  */
52
52
  clip_id?: string;
53
53
  }
54
- /** Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. An uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`, 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. */
54
+ /** Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. An uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `queue_full` when the queue is full, `empty_prompt` or `prompt_too_long` when the prompt is empty or over the model's token budget, `invalid_request` when both a starting frame and a source clip, or both ending conditions, are given, `unknown_clip` when a source clip is unknown or no longer retained, and `invalid_image` when an upload is not a decodable image. */
55
55
  interface FastH3EnqueueParams {
56
56
  /**
57
57
  * Seed for this clip. Omitted or null, the session's default is used and advances by one; passing a seed leaves the default untouched, so explicit and automatic seeding do not interfere.
@@ -113,7 +113,7 @@ interface FastH3SetSeedParams {
113
113
  */
114
114
  seed?: number;
115
115
  }
116
- /** Choose the aspect ratio of `main_video`. The video track keeps one size and queued clips are built at it, so this is only valid while the queue is empty and nothing is playing. Emits `canvas_accepted`, carrying the exact pixel size, and `state_update`, or `command_error` while clips are queued or playing, or when the ratio is not one this model offers. */
116
+ /** Choose the aspect ratio of `main_video`. The video track keeps one size and queued clips are built at it, so this is only valid while the queue is empty and nothing is playing. Emits `canvas_accepted`, carrying the exact pixel size, and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `session_not_empty` while clips are queued or playing, `invalid_aspect` when the ratio is not one this model offers. */
117
117
  interface FastH3SetCanvasParams {
118
118
  /**
119
119
  * Aspect ratio of `main_video`. `canvas_accepted` and `state_update` report the width and height in pixels it resolves to.
@@ -393,7 +393,11 @@ interface FastH3ClipFinishedMessage {
393
393
  /** Seconds of video and audio sent since the session began, this clip included. */
394
394
  seconds_sent: number;
395
395
  }
396
- /** Emitted when a command is rejected. The command had no effect. */
396
+ /**
397
+ * Emitted to every client when a command is rejected. The command had no effect.
398
+ *
399
+ * The rejected call itself also fails, with the same reason and a stable error code. Read the failure on the call; this broadcast stays until the next major release.
400
+ */
397
401
  interface FastH3CommandErrorMessage {
398
402
  type: "command_error";
399
403
  /** Why it was rejected. */
@@ -499,77 +503,77 @@ declare class FastH3Model extends Reactor {
499
503
  /** @deprecated The model client now extends `Reactor` directly — call methods on `this` instead. This accessor returns `this` for backwards compatibility and will be removed in a future major release. */
500
504
  get reactor(): this;
501
505
  /**
502
- * Remove one clip by its UUID from whichever queue holds it, freeing its slot. Works on generating and built clips alike; a build already running for it is discarded when it completes. The clip that is playing is in neither queue — `stop` is the command that cuts it. A built clip stays in `queue_update.history` after popping, so clips referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update`, or `command_error` when no queued clip has that id or queued clips still reference its last frame.
503
- * @param params - Remove one clip by its UUID from whichever queue holds it, freeing its slot. Works on generating and built clips alike; a build already running for it is discarded when it completes. The clip that is playing is in neither queue — `stop` is the command that cuts it. A built clip stays in `queue_update.history` after popping, so clips referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update`, or `command_error` when no queued clip has that id or queued clips still reference its last frame.
504
- * @returns The correlated {@link FastH3ClipPoppedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
506
+ * Remove one clip by its UUID from whichever queue holds it, freeing its slot. Works on generating and built clips alike; a build already running for it is discarded when it completes. The clip that is playing is in neither queue — `stop` is the command that cuts it. A built clip stays in `queue_update.history` after popping, so clips referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `unknown_clip` when no queued clip has that id, `clip_referenced` when queued clips still reference its last frame.
507
+ * @param params - Remove one clip by its UUID from whichever queue holds it, freeing its slot. Works on generating and built clips alike; a build already running for it is discarded when it completes. The clip that is playing is in neither queue — `stop` is the command that cuts it. A built clip stays in `queue_update.history` after popping, so clips referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `unknown_clip` when no queued clip has that id, `clip_referenced` when queued clips still reference its last frame.
508
+ * @returns The correlated {@link FastH3ClipPoppedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
505
509
  */
506
510
  pop(params: FastH3PopParams): Promise<FastH3ClipPoppedMessage | undefined>;
507
511
  /**
508
- * Reposition one clip within the queue that holds it — the generation queue for a clip still to build, the playout queue for a built one; clips never move between queues except by building. `position` 0 is the front: the next build, or what bare `play` and autoplay take next. Values past the end mean the back. Replies `clip_moved` with the queue and the resulting position, and emits `queue_update`; `command_error` when no queued clip has that id.
509
- * @param params - Reposition one clip within the queue that holds it — the generation queue for a clip still to build, the playout queue for a built one; clips never move between queues except by building. `position` 0 is the front: the next build, or what bare `play` and autoplay take next. Values past the end mean the back. Replies `clip_moved` with the queue and the resulting position, and emits `queue_update`; `command_error` when no queued clip has that id.
510
- * @returns The correlated {@link FastH3ClipMovedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
512
+ * Reposition one clip within the queue that holds it — the generation queue for a clip still to build, the playout queue for a built one; clips never move between queues except by building. `position` 0 is the front: the next build, or what bare `play` and autoplay take next. Values past the end mean the back. Replies `clip_moved` with the queue and the resulting position, and emits `queue_update`. Fails the call with `unknown_clip`, also broadcast as `command_error`, when no queued clip has that id.
513
+ * @param params - Reposition one clip within the queue that holds it — the generation queue for a clip still to build, the playout queue for a built one; clips never move between queues except by building. `position` 0 is the front: the next build, or what bare `play` and autoplay take next. Values past the end mean the back. Replies `clip_moved` with the queue and the resulting position, and emits `queue_update`. Fails the call with `unknown_clip`, also broadcast as `command_error`, when no queued clip has that id.
514
+ * @returns The correlated {@link FastH3ClipMovedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
511
515
  */
512
516
  move(params: FastH3MoveParams): Promise<FastH3ClipMovedMessage | undefined>;
513
517
  /**
514
- * Play one clip from the playout queue. Blank `clip_id` plays the front clip; a UUID plays that specific one. Playing consumes the entry: it leaves the queue, `clip_started` marks its first frames, and when it ends the stream holds on black until the next `play`. Emits `queue_update` and `state_update`, or `command_error` when a clip is already playing, the id is unknown, or the clip is still generating.
515
- * @param params - Play one clip from the playout queue. Blank `clip_id` plays the front clip; a UUID plays that specific one. Playing consumes the entry: it leaves the queue, `clip_started` marks its first frames, and when it ends the stream holds on black until the next `play`. Emits `queue_update` and `state_update`, or `command_error` when a clip is already playing, the id is unknown, or the clip is still generating.
516
- * @returns Resolves once the model's handler has completed; this command declares no reply payload.
518
+ * Play one clip from the playout queue. Blank `clip_id` plays the front clip; a UUID plays that specific one. Playing consumes the entry: it leaves the queue, `clip_started` marks its first frames, and when it ends the stream holds on black until the next `play`. Emits `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `already_playing`, `unknown_clip` for an unknown id, `clip_not_ready` while the clip is still generating, and `no_ready_clip` when the playout queue is empty.
519
+ * @param params - Play one clip from the playout queue. Blank `clip_id` plays the front clip; a UUID plays that specific one. Playing consumes the entry: it leaves the queue, `clip_started` marks its first frames, and when it ends the stream holds on black until the next `play`. Emits `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `already_playing`, `unknown_clip` for an unknown id, `clip_not_ready` while the clip is still generating, and `no_ready_clip` when the playout queue is empty.
520
+ * @returns `undefined` once the model's handler has completed. This command declares no reply, so a refusal also resolves `undefined`: only the `error` event (with `operation: "sendCommand"` and the model's `code`) tells the two apart.
517
521
  */
518
522
  play(params: FastH3PlayParams): Promise<undefined>;
519
523
  /**
520
- * Cut the clip that is playing. Whatever is queued on the output tracks is dropped and the picture goes to black within a fraction of a second (with `set_flush_on_clip_end` off, the transport drains what it holds and freezes on the last frame instead), and the session is back where a finished clip leaves it — the queue is untouched and the next `play` starts clean. With autoplay on this acts as a skip: the next ready clip starts on its own, so send `set_autoplay` off first to hold the stream. Emits `clip_stopped` and `state_update`, or `command_error` when no clip is playing.
521
- * @returns Resolves once the model's handler has completed; this command declares no reply payload.
524
+ * Cut the clip that is playing. Whatever is queued on the output tracks is dropped and the picture goes to black within a fraction of a second (with `set_flush_on_clip_end` off, the transport drains what it holds and freezes on the last frame instead), and the session is back where a finished clip leaves it — the queue is untouched and the next `play` starts clean. With autoplay on this acts as a skip: the next ready clip starts on its own, so send `set_autoplay` off first to hold the stream. Emits `clip_stopped` and `state_update`. Fails the call with `not_playing`, also broadcast as `command_error`, when no clip is playing.
525
+ * @returns `undefined` once the model's handler has completed. This command declares no reply, so a refusal also resolves `undefined`: only the `error` event (with `operation: "sendCommand"` and the model's `code`) tells the two apart.
522
526
  */
523
527
  stop(): Promise<undefined>;
524
528
  /**
525
529
  * Return every condition to its default, drop both queues' clips and the retained history, and clear the output tracks. A clip that is playing is cut, with a `clip_stopped` to mark it. Valid at any time. Replies `session_reset` and emits `queue_update` and `state_update`.
526
- * @returns The correlated {@link FastH3SessionResetMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
530
+ * @returns The correlated {@link FastH3SessionResetMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
527
531
  */
528
532
  reset(): Promise<FastH3SessionResetMessage | undefined>;
529
533
  /**
530
- * Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. An uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`, 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.
531
- * @param params - Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. An uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`, 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.
532
- * @returns The correlated {@link FastH3ClipQueuedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
534
+ * Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. An uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `queue_full` when the queue is full, `empty_prompt` or `prompt_too_long` when the prompt is empty or over the model's token budget, `invalid_request` when both a starting frame and a source clip, or both ending conditions, are given, `unknown_clip` when a source clip is unknown or no longer retained, and `invalid_image` when an upload is not a decodable image.
535
+ * @param params - Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. An uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `queue_full` when the queue is full, `empty_prompt` or `prompt_too_long` when the prompt is empty or over the model's token budget, `invalid_request` when both a starting frame and a source clip, or both ending conditions, are given, `unknown_clip` when a source clip is unknown or no longer retained, and `invalid_image` when an upload is not a decodable image.
536
+ * @returns The correlated {@link FastH3ClipQueuedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
533
537
  */
534
538
  enqueue(params: FastH3EnqueueParams): Promise<FastH3ClipQueuedMessage | undefined>;
535
539
  /**
536
540
  * Set the default seed — the one an `enqueue` without a seed of its own uses, advancing it by one, so re-enqueuing the same prompts in the same order reproduces the same clips. Clips already in the queue keep the seed they were enqueued with. Valid at any time. Emits `seed_accepted` and `state_update`.
537
541
  * @param params - Set the default seed — the one an `enqueue` without a seed of its own uses, advancing it by one, so re-enqueuing the same prompts in the same order reproduces the same clips. Clips already in the queue keep the seed they were enqueued with. Valid at any time. Emits `seed_accepted` and `state_update`.
538
- * @returns The correlated {@link FastH3SeedAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
542
+ * @returns The correlated {@link FastH3SeedAcceptedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
539
543
  */
540
544
  setSeed(params: FastH3SetSeedParams): Promise<FastH3SeedAcceptedMessage | undefined>;
541
545
  /**
542
546
  * Return both queues' contents — `generation` (waiting to build) and `playout` (built, playable) — plus `history`, the built clips no longer queued that `continue_from_clip_id` or `ending_from_clip_id` can still name, every clip as its full structure. The same payload the model broadcasts as `queue_update`. Valid at any time.
543
- * @returns The correlated {@link FastH3QueueUpdateMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
547
+ * @returns The correlated {@link FastH3QueueUpdateMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
544
548
  */
545
549
  getQueue(): Promise<FastH3QueueUpdateMessage | undefined>;
546
550
  /**
547
551
  * Return a snapshot of everything the session exposes except the queue's contents (`get_queue` carries those): the conditions in force, what is playing, progress counters, and the commands that are valid right now. The same payload the model broadcasts as `state_update`. Valid at any time.
548
- * @returns The correlated {@link FastH3StateUpdateMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
552
+ * @returns The correlated {@link FastH3StateUpdateMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
549
553
  */
550
554
  getState(): Promise<FastH3StateUpdateMessage | undefined>;
551
555
  /**
552
- * Choose the aspect ratio of `main_video`. The video track keeps one size and queued clips are built at it, so this is only valid while the queue is empty and nothing is playing. Emits `canvas_accepted`, carrying the exact pixel size, and `state_update`, or `command_error` while clips are queued or playing, or when the ratio is not one this model offers.
553
- * @param params - Choose the aspect ratio of `main_video`. The video track keeps one size and queued clips are built at it, so this is only valid while the queue is empty and nothing is playing. Emits `canvas_accepted`, carrying the exact pixel size, and `state_update`, or `command_error` while clips are queued or playing, or when the ratio is not one this model offers.
554
- * @returns The correlated {@link FastH3CanvasAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
556
+ * Choose the aspect ratio of `main_video`. The video track keeps one size and queued clips are built at it, so this is only valid while the queue is empty and nothing is playing. Emits `canvas_accepted`, carrying the exact pixel size, and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `session_not_empty` while clips are queued or playing, `invalid_aspect` when the ratio is not one this model offers.
557
+ * @param params - Choose the aspect ratio of `main_video`. The video track keeps one size and queued clips are built at it, so this is only valid while the queue is empty and nothing is playing. Emits `canvas_accepted`, carrying the exact pixel size, and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `session_not_empty` while clips are queued or playing, `invalid_aspect` when the ratio is not one this model offers.
558
+ * @returns The correlated {@link FastH3CanvasAcceptedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
555
559
  */
556
560
  setCanvas(params: FastH3SetCanvasParams): Promise<FastH3CanvasAcceptedMessage | undefined>;
557
561
  /**
558
562
  * Turn autoplay on or off. On, the playout queue's front clip starts on its own whenever nothing is playing — right after a clip finishes, or the moment a build completes while the stream is idle — so a steadily fed queue plays through without a `play` per clip. Off (the default), the stream holds on black until an explicit `play`. Takes effect immediately and lasts for the session. Emits `autoplay_accepted` and `state_update`.
559
563
  * @param params - Turn autoplay on or off. On, the playout queue's front clip starts on its own whenever nothing is playing — right after a clip finishes, or the moment a build completes while the stream is idle — so a steadily fed queue plays through without a `play` per clip. Off (the default), the stream holds on black until an explicit `play`. Takes effect immediately and lasts for the session. Emits `autoplay_accepted` and `state_update`.
560
- * @returns The correlated {@link FastH3AutoplayAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
564
+ * @returns The correlated {@link FastH3AutoplayAcceptedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
561
565
  */
562
566
  setAutoplay(params: FastH3SetAutoplayParams): Promise<FastH3AutoplayAcceptedMessage | undefined>;
563
567
  /**
564
568
  * Set the default length for enqueues that carry no `seconds` of their own. The value is snapped to the nearest length the model can produce, so read the effective one back from `clip_length_accepted`. Clips already in the queue keep the length they were enqueued with. Longer clips carry a scene further; shorter ones build faster. Valid at any time. Emits `clip_length_accepted` and `state_update`.
565
569
  * @param params - Set the default length for enqueues that carry no `seconds` of their own. The value is snapped to the nearest length the model can produce, so read the effective one back from `clip_length_accepted`. Clips already in the queue keep the length they were enqueued with. Longer clips carry a scene further; shorter ones build faster. Valid at any time. Emits `clip_length_accepted` and `state_update`.
566
- * @returns The correlated {@link FastH3ClipLengthAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
570
+ * @returns The correlated {@link FastH3ClipLengthAcceptedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
567
571
  */
568
572
  setClipSeconds(params: FastH3SetClipSecondsParams): Promise<FastH3ClipLengthAcceptedMessage | undefined>;
569
573
  /**
570
574
  * Set whether the stream cuts to black when a clip ends, is stopped, or a non-continuing clip follows it. On (the default) those boundaries flush to black at once. Off, the stream holds the last frame instead — `stop` then drains what the transport already holds (up to a couple of seconds) before the picture freezes, rather than snapping to black. Either way, autoplay chains a clip whose `continue_from_clip_id` names the clip just finished with no cut at all, and `reset` always clears the tracks. Takes effect at the next boundary and lasts for the session. Emits `flush_accepted` and `state_update`.
571
575
  * @param params - Set whether the stream cuts to black when a clip ends, is stopped, or a non-continuing clip follows it. On (the default) those boundaries flush to black at once. Off, the stream holds the last frame instead — `stop` then drains what the transport already holds (up to a couple of seconds) before the picture freezes, rather than snapping to black. Either way, autoplay chains a clip whose `continue_from_clip_id` names the clip just finished with no cut at all, and `reset` always clears the tracks. Takes effect at the next boundary and lasts for the session. Emits `flush_accepted` and `state_update`.
572
- * @returns The correlated {@link FastH3FlushAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
576
+ * @returns The correlated {@link FastH3FlushAcceptedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
573
577
  */
574
578
  setFlushOnClipEnd(params: FastH3SetFlushOnClipEndParams): Promise<FastH3FlushAcceptedMessage | undefined>;
575
579
  /**
package/dist/core.d.ts CHANGED
@@ -2,7 +2,7 @@ import { FileRef, Reactor } from '@reactor-team/js-sdk';
2
2
  export { FileRef } from '@reactor-team/js-sdk';
3
3
 
4
4
  declare const MODEL_NAME: "reactor/fast-h3";
5
- declare const MODEL_VERSION: "v1.8.0";
5
+ declare const MODEL_VERSION: "v1.9.2";
6
6
  /**
7
7
  * Preset media tracks for the FastH3 model.
8
8
  *
@@ -21,7 +21,7 @@ declare const FastH3Tracks: readonly [{
21
21
  }];
22
22
  /** Track names the client can subscribe to (recvonly, from the client's perspective). */
23
23
  type FastH3RecvTrackName = "main_video" | "main_audio";
24
- /** Remove one clip by its UUID from whichever queue holds it, freeing its slot. Works on generating and built clips alike; a build already running for it is discarded when it completes. The clip that is playing is in neither queue — `stop` is the command that cuts it. A built clip stays in `queue_update.history` after popping, so clips referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update`, or `command_error` when no queued clip has that id or queued clips still reference its last frame. */
24
+ /** Remove one clip by its UUID from whichever queue holds it, freeing its slot. Works on generating and built clips alike; a build already running for it is discarded when it completes. The clip that is playing is in neither queue — `stop` is the command that cuts it. A built clip stays in `queue_update.history` after popping, so clips referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `unknown_clip` when no queued clip has that id, `clip_referenced` when queued clips still reference its last frame. */
25
25
  interface FastH3PopParams {
26
26
  /**
27
27
  * UUID of the queued clip to remove, from `clip_queued` or `queue_update`.
@@ -29,7 +29,7 @@ interface FastH3PopParams {
29
29
  */
30
30
  clip_id?: string;
31
31
  }
32
- /** Reposition one clip within the queue that holds it — the generation queue for a clip still to build, the playout queue for a built one; clips never move between queues except by building. `position` 0 is the front: the next build, or what bare `play` and autoplay take next. Values past the end mean the back. Replies `clip_moved` with the queue and the resulting position, and emits `queue_update`; `command_error` when no queued clip has that id. */
32
+ /** Reposition one clip within the queue that holds it — the generation queue for a clip still to build, the playout queue for a built one; clips never move between queues except by building. `position` 0 is the front: the next build, or what bare `play` and autoplay take next. Values past the end mean the back. Replies `clip_moved` with the queue and the resulting position, and emits `queue_update`. Fails the call with `unknown_clip`, also broadcast as `command_error`, when no queued clip has that id. */
33
33
  interface FastH3MoveParams {
34
34
  /**
35
35
  * UUID of the queued clip to move, from any clip-referencing message.
@@ -43,7 +43,7 @@ interface FastH3MoveParams {
43
43
  */
44
44
  position?: number;
45
45
  }
46
- /** Play one clip from the playout queue. Blank `clip_id` plays the front clip; a UUID plays that specific one. Playing consumes the entry: it leaves the queue, `clip_started` marks its first frames, and when it ends the stream holds on black until the next `play`. Emits `queue_update` and `state_update`, or `command_error` when a clip is already playing, the id is unknown, or the clip is still generating. */
46
+ /** Play one clip from the playout queue. Blank `clip_id` plays the front clip; a UUID plays that specific one. Playing consumes the entry: it leaves the queue, `clip_started` marks its first frames, and when it ends the stream holds on black until the next `play`. Emits `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `already_playing`, `unknown_clip` for an unknown id, `clip_not_ready` while the clip is still generating, and `no_ready_clip` when the playout queue is empty. */
47
47
  interface FastH3PlayParams {
48
48
  /**
49
49
  * UUID of the clip to play, from `clip_generated` or `queue_update`. Blank plays the playout queue's front clip.
@@ -51,7 +51,7 @@ interface FastH3PlayParams {
51
51
  */
52
52
  clip_id?: string;
53
53
  }
54
- /** Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. An uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`, 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. */
54
+ /** Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. An uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `queue_full` when the queue is full, `empty_prompt` or `prompt_too_long` when the prompt is empty or over the model's token budget, `invalid_request` when both a starting frame and a source clip, or both ending conditions, are given, `unknown_clip` when a source clip is unknown or no longer retained, and `invalid_image` when an upload is not a decodable image. */
55
55
  interface FastH3EnqueueParams {
56
56
  /**
57
57
  * Seed for this clip. Omitted or null, the session's default is used and advances by one; passing a seed leaves the default untouched, so explicit and automatic seeding do not interfere.
@@ -113,7 +113,7 @@ interface FastH3SetSeedParams {
113
113
  */
114
114
  seed?: number;
115
115
  }
116
- /** Choose the aspect ratio of `main_video`. The video track keeps one size and queued clips are built at it, so this is only valid while the queue is empty and nothing is playing. Emits `canvas_accepted`, carrying the exact pixel size, and `state_update`, or `command_error` while clips are queued or playing, or when the ratio is not one this model offers. */
116
+ /** Choose the aspect ratio of `main_video`. The video track keeps one size and queued clips are built at it, so this is only valid while the queue is empty and nothing is playing. Emits `canvas_accepted`, carrying the exact pixel size, and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `session_not_empty` while clips are queued or playing, `invalid_aspect` when the ratio is not one this model offers. */
117
117
  interface FastH3SetCanvasParams {
118
118
  /**
119
119
  * Aspect ratio of `main_video`. `canvas_accepted` and `state_update` report the width and height in pixels it resolves to.
@@ -393,7 +393,11 @@ interface FastH3ClipFinishedMessage {
393
393
  /** Seconds of video and audio sent since the session began, this clip included. */
394
394
  seconds_sent: number;
395
395
  }
396
- /** Emitted when a command is rejected. The command had no effect. */
396
+ /**
397
+ * Emitted to every client when a command is rejected. The command had no effect.
398
+ *
399
+ * The rejected call itself also fails, with the same reason and a stable error code. Read the failure on the call; this broadcast stays until the next major release.
400
+ */
397
401
  interface FastH3CommandErrorMessage {
398
402
  type: "command_error";
399
403
  /** Why it was rejected. */
@@ -499,77 +503,77 @@ declare class FastH3Model extends Reactor {
499
503
  /** @deprecated The model client now extends `Reactor` directly — call methods on `this` instead. This accessor returns `this` for backwards compatibility and will be removed in a future major release. */
500
504
  get reactor(): this;
501
505
  /**
502
- * Remove one clip by its UUID from whichever queue holds it, freeing its slot. Works on generating and built clips alike; a build already running for it is discarded when it completes. The clip that is playing is in neither queue — `stop` is the command that cuts it. A built clip stays in `queue_update.history` after popping, so clips referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update`, or `command_error` when no queued clip has that id or queued clips still reference its last frame.
503
- * @param params - Remove one clip by its UUID from whichever queue holds it, freeing its slot. Works on generating and built clips alike; a build already running for it is discarded when it completes. The clip that is playing is in neither queue — `stop` is the command that cuts it. A built clip stays in `queue_update.history` after popping, so clips referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update`, or `command_error` when no queued clip has that id or queued clips still reference its last frame.
504
- * @returns The correlated {@link FastH3ClipPoppedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
506
+ * Remove one clip by its UUID from whichever queue holds it, freeing its slot. Works on generating and built clips alike; a build already running for it is discarded when it completes. The clip that is playing is in neither queue — `stop` is the command that cuts it. A built clip stays in `queue_update.history` after popping, so clips referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `unknown_clip` when no queued clip has that id, `clip_referenced` when queued clips still reference its last frame.
507
+ * @param params - Remove one clip by its UUID from whichever queue holds it, freeing its slot. Works on generating and built clips alike; a build already running for it is discarded when it completes. The clip that is playing is in neither queue — `stop` is the command that cuts it. A built clip stays in `queue_update.history` after popping, so clips referencing its frame are unaffected; an unbuilt clip that queued clips reference is refused, since popping it would leave them without an endpoint — pop those first. Emits `clip_popped`, `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `unknown_clip` when no queued clip has that id, `clip_referenced` when queued clips still reference its last frame.
508
+ * @returns The correlated {@link FastH3ClipPoppedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
505
509
  */
506
510
  pop(params: FastH3PopParams): Promise<FastH3ClipPoppedMessage | undefined>;
507
511
  /**
508
- * Reposition one clip within the queue that holds it — the generation queue for a clip still to build, the playout queue for a built one; clips never move between queues except by building. `position` 0 is the front: the next build, or what bare `play` and autoplay take next. Values past the end mean the back. Replies `clip_moved` with the queue and the resulting position, and emits `queue_update`; `command_error` when no queued clip has that id.
509
- * @param params - Reposition one clip within the queue that holds it — the generation queue for a clip still to build, the playout queue for a built one; clips never move between queues except by building. `position` 0 is the front: the next build, or what bare `play` and autoplay take next. Values past the end mean the back. Replies `clip_moved` with the queue and the resulting position, and emits `queue_update`; `command_error` when no queued clip has that id.
510
- * @returns The correlated {@link FastH3ClipMovedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
512
+ * Reposition one clip within the queue that holds it — the generation queue for a clip still to build, the playout queue for a built one; clips never move between queues except by building. `position` 0 is the front: the next build, or what bare `play` and autoplay take next. Values past the end mean the back. Replies `clip_moved` with the queue and the resulting position, and emits `queue_update`. Fails the call with `unknown_clip`, also broadcast as `command_error`, when no queued clip has that id.
513
+ * @param params - Reposition one clip within the queue that holds it — the generation queue for a clip still to build, the playout queue for a built one; clips never move between queues except by building. `position` 0 is the front: the next build, or what bare `play` and autoplay take next. Values past the end mean the back. Replies `clip_moved` with the queue and the resulting position, and emits `queue_update`. Fails the call with `unknown_clip`, also broadcast as `command_error`, when no queued clip has that id.
514
+ * @returns The correlated {@link FastH3ClipMovedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
511
515
  */
512
516
  move(params: FastH3MoveParams): Promise<FastH3ClipMovedMessage | undefined>;
513
517
  /**
514
- * Play one clip from the playout queue. Blank `clip_id` plays the front clip; a UUID plays that specific one. Playing consumes the entry: it leaves the queue, `clip_started` marks its first frames, and when it ends the stream holds on black until the next `play`. Emits `queue_update` and `state_update`, or `command_error` when a clip is already playing, the id is unknown, or the clip is still generating.
515
- * @param params - Play one clip from the playout queue. Blank `clip_id` plays the front clip; a UUID plays that specific one. Playing consumes the entry: it leaves the queue, `clip_started` marks its first frames, and when it ends the stream holds on black until the next `play`. Emits `queue_update` and `state_update`, or `command_error` when a clip is already playing, the id is unknown, or the clip is still generating.
516
- * @returns Resolves once the model's handler has completed; this command declares no reply payload.
518
+ * Play one clip from the playout queue. Blank `clip_id` plays the front clip; a UUID plays that specific one. Playing consumes the entry: it leaves the queue, `clip_started` marks its first frames, and when it ends the stream holds on black until the next `play`. Emits `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `already_playing`, `unknown_clip` for an unknown id, `clip_not_ready` while the clip is still generating, and `no_ready_clip` when the playout queue is empty.
519
+ * @param params - Play one clip from the playout queue. Blank `clip_id` plays the front clip; a UUID plays that specific one. Playing consumes the entry: it leaves the queue, `clip_started` marks its first frames, and when it ends the stream holds on black until the next `play`. Emits `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `already_playing`, `unknown_clip` for an unknown id, `clip_not_ready` while the clip is still generating, and `no_ready_clip` when the playout queue is empty.
520
+ * @returns `undefined` once the model's handler has completed. This command declares no reply, so a refusal also resolves `undefined`: only the `error` event (with `operation: "sendCommand"` and the model's `code`) tells the two apart.
517
521
  */
518
522
  play(params: FastH3PlayParams): Promise<undefined>;
519
523
  /**
520
- * Cut the clip that is playing. Whatever is queued on the output tracks is dropped and the picture goes to black within a fraction of a second (with `set_flush_on_clip_end` off, the transport drains what it holds and freezes on the last frame instead), and the session is back where a finished clip leaves it — the queue is untouched and the next `play` starts clean. With autoplay on this acts as a skip: the next ready clip starts on its own, so send `set_autoplay` off first to hold the stream. Emits `clip_stopped` and `state_update`, or `command_error` when no clip is playing.
521
- * @returns Resolves once the model's handler has completed; this command declares no reply payload.
524
+ * Cut the clip that is playing. Whatever is queued on the output tracks is dropped and the picture goes to black within a fraction of a second (with `set_flush_on_clip_end` off, the transport drains what it holds and freezes on the last frame instead), and the session is back where a finished clip leaves it — the queue is untouched and the next `play` starts clean. With autoplay on this acts as a skip: the next ready clip starts on its own, so send `set_autoplay` off first to hold the stream. Emits `clip_stopped` and `state_update`. Fails the call with `not_playing`, also broadcast as `command_error`, when no clip is playing.
525
+ * @returns `undefined` once the model's handler has completed. This command declares no reply, so a refusal also resolves `undefined`: only the `error` event (with `operation: "sendCommand"` and the model's `code`) tells the two apart.
522
526
  */
523
527
  stop(): Promise<undefined>;
524
528
  /**
525
529
  * Return every condition to its default, drop both queues' clips and the retained history, and clear the output tracks. A clip that is playing is cut, with a `clip_stopped` to mark it. Valid at any time. Replies `session_reset` and emits `queue_update` and `state_update`.
526
- * @returns The correlated {@link FastH3SessionResetMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
530
+ * @returns The correlated {@link FastH3SessionResetMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
527
531
  */
528
532
  reset(): Promise<FastH3SessionResetMessage | undefined>;
529
533
  /**
530
- * Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. An uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`, 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.
531
- * @param params - Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. An uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`, 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.
532
- * @returns The correlated {@link FastH3ClipQueuedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
534
+ * Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. An uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `queue_full` when the queue is full, `empty_prompt` or `prompt_too_long` when the prompt is empty or over the model's token budget, `invalid_request` when both a starting frame and a source clip, or both ending conditions, are given, `unknown_clip` when a source clip is unknown or no longer retained, and `invalid_image` when an upload is not a decodable image.
535
+ * @param params - Queue one clip generation. The clip enters the generation queue (at `position`, or the back), builds when its turn comes, and then joins the back of the playout queue, announced by `clip_generated`. The prompt is what the clip will show; the metadata is an opaque string echoed back on every message that references the clip, for frontends to carry their own tracking data. The clip opens from text alone, from an uploaded still (`starting_frame` — the image animates forward), or from an existing clip's last frame (`continue_from_clip_id` — any clip in the queues or in `queue_update.history`); a continued clip simply waits its turn until its source is built, wherever the two sit in the queue. An uploaded `ending_frame` or a generated clip's clean last frame (`ending_from_clip_id`) can accompany any opener — or stand alone — to make the clip animate *into* and close on that image. Set both clip-id fields to the same UUID to leave and return to one generated frame. The clip's canvas is the session's; its length is the `seconds` passed here (snapped to what the model can produce) or the session default, and its seed is the one passed here or the session's advancing default. Builds run through the queue in order; watch `queue_update` for the clip turning ready. Replies `clip_queued` with the clip's UUID and emits `queue_update` and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `queue_full` when the queue is full, `empty_prompt` or `prompt_too_long` when the prompt is empty or over the model's token budget, `invalid_request` when both a starting frame and a source clip, or both ending conditions, are given, `unknown_clip` when a source clip is unknown or no longer retained, and `invalid_image` when an upload is not a decodable image.
536
+ * @returns The correlated {@link FastH3ClipQueuedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
533
537
  */
534
538
  enqueue(params: FastH3EnqueueParams): Promise<FastH3ClipQueuedMessage | undefined>;
535
539
  /**
536
540
  * Set the default seed — the one an `enqueue` without a seed of its own uses, advancing it by one, so re-enqueuing the same prompts in the same order reproduces the same clips. Clips already in the queue keep the seed they were enqueued with. Valid at any time. Emits `seed_accepted` and `state_update`.
537
541
  * @param params - Set the default seed — the one an `enqueue` without a seed of its own uses, advancing it by one, so re-enqueuing the same prompts in the same order reproduces the same clips. Clips already in the queue keep the seed they were enqueued with. Valid at any time. Emits `seed_accepted` and `state_update`.
538
- * @returns The correlated {@link FastH3SeedAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
542
+ * @returns The correlated {@link FastH3SeedAcceptedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
539
543
  */
540
544
  setSeed(params: FastH3SetSeedParams): Promise<FastH3SeedAcceptedMessage | undefined>;
541
545
  /**
542
546
  * Return both queues' contents — `generation` (waiting to build) and `playout` (built, playable) — plus `history`, the built clips no longer queued that `continue_from_clip_id` or `ending_from_clip_id` can still name, every clip as its full structure. The same payload the model broadcasts as `queue_update`. Valid at any time.
543
- * @returns The correlated {@link FastH3QueueUpdateMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
547
+ * @returns The correlated {@link FastH3QueueUpdateMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
544
548
  */
545
549
  getQueue(): Promise<FastH3QueueUpdateMessage | undefined>;
546
550
  /**
547
551
  * Return a snapshot of everything the session exposes except the queue's contents (`get_queue` carries those): the conditions in force, what is playing, progress counters, and the commands that are valid right now. The same payload the model broadcasts as `state_update`. Valid at any time.
548
- * @returns The correlated {@link FastH3StateUpdateMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
552
+ * @returns The correlated {@link FastH3StateUpdateMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
549
553
  */
550
554
  getState(): Promise<FastH3StateUpdateMessage | undefined>;
551
555
  /**
552
- * Choose the aspect ratio of `main_video`. The video track keeps one size and queued clips are built at it, so this is only valid while the queue is empty and nothing is playing. Emits `canvas_accepted`, carrying the exact pixel size, and `state_update`, or `command_error` while clips are queued or playing, or when the ratio is not one this model offers.
553
- * @param params - Choose the aspect ratio of `main_video`. The video track keeps one size and queued clips are built at it, so this is only valid while the queue is empty and nothing is playing. Emits `canvas_accepted`, carrying the exact pixel size, and `state_update`, or `command_error` while clips are queued or playing, or when the ratio is not one this model offers.
554
- * @returns The correlated {@link FastH3CanvasAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
556
+ * Choose the aspect ratio of `main_video`. The video track keeps one size and queued clips are built at it, so this is only valid while the queue is empty and nothing is playing. Emits `canvas_accepted`, carrying the exact pixel size, and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `session_not_empty` while clips are queued or playing, `invalid_aspect` when the ratio is not one this model offers.
557
+ * @param params - Choose the aspect ratio of `main_video`. The video track keeps one size and queued clips are built at it, so this is only valid while the queue is empty and nothing is playing. Emits `canvas_accepted`, carrying the exact pixel size, and `state_update`. A refusal fails the call with a code and is also broadcast as `command_error`: `session_not_empty` while clips are queued or playing, `invalid_aspect` when the ratio is not one this model offers.
558
+ * @returns The correlated {@link FastH3CanvasAcceptedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
555
559
  */
556
560
  setCanvas(params: FastH3SetCanvasParams): Promise<FastH3CanvasAcceptedMessage | undefined>;
557
561
  /**
558
562
  * Turn autoplay on or off. On, the playout queue's front clip starts on its own whenever nothing is playing — right after a clip finishes, or the moment a build completes while the stream is idle — so a steadily fed queue plays through without a `play` per clip. Off (the default), the stream holds on black until an explicit `play`. Takes effect immediately and lasts for the session. Emits `autoplay_accepted` and `state_update`.
559
563
  * @param params - Turn autoplay on or off. On, the playout queue's front clip starts on its own whenever nothing is playing — right after a clip finishes, or the moment a build completes while the stream is idle — so a steadily fed queue plays through without a `play` per clip. Off (the default), the stream holds on black until an explicit `play`. Takes effect immediately and lasts for the session. Emits `autoplay_accepted` and `state_update`.
560
- * @returns The correlated {@link FastH3AutoplayAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
564
+ * @returns The correlated {@link FastH3AutoplayAcceptedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
561
565
  */
562
566
  setAutoplay(params: FastH3SetAutoplayParams): Promise<FastH3AutoplayAcceptedMessage | undefined>;
563
567
  /**
564
568
  * Set the default length for enqueues that carry no `seconds` of their own. The value is snapped to the nearest length the model can produce, so read the effective one back from `clip_length_accepted`. Clips already in the queue keep the length they were enqueued with. Longer clips carry a scene further; shorter ones build faster. Valid at any time. Emits `clip_length_accepted` and `state_update`.
565
569
  * @param params - Set the default length for enqueues that carry no `seconds` of their own. The value is snapped to the nearest length the model can produce, so read the effective one back from `clip_length_accepted`. Clips already in the queue keep the length they were enqueued with. Longer clips carry a scene further; shorter ones build faster. Valid at any time. Emits `clip_length_accepted` and `state_update`.
566
- * @returns The correlated {@link FastH3ClipLengthAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
570
+ * @returns The correlated {@link FastH3ClipLengthAcceptedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
567
571
  */
568
572
  setClipSeconds(params: FastH3SetClipSecondsParams): Promise<FastH3ClipLengthAcceptedMessage | undefined>;
569
573
  /**
570
574
  * Set whether the stream cuts to black when a clip ends, is stopped, or a non-continuing clip follows it. On (the default) those boundaries flush to black at once. Off, the stream holds the last frame instead — `stop` then drains what the transport already holds (up to a couple of seconds) before the picture freezes, rather than snapping to black. Either way, autoplay chains a clip whose `continue_from_clip_id` names the clip just finished with no cut at all, and `reset` always clears the tracks. Takes effect at the next boundary and lasts for the session. Emits `flush_accepted` and `state_update`.
571
575
  * @param params - Set whether the stream cuts to black when a clip ends, is stopped, or a non-continuing clip follows it. On (the default) those boundaries flush to black at once. Off, the stream holds the last frame instead — `stop` then drains what the transport already holds (up to a couple of seconds) before the picture freezes, rather than snapping to black. Either way, autoplay chains a clip whose `continue_from_clip_id` names the clip just finished with no cut at all, and `reset` always clears the tracks. Takes effect at the next boundary and lasts for the session. Emits `flush_accepted` and `state_update`.
572
- * @returns The correlated {@link FastH3FlushAcceptedMessage} reply, or `undefined` when the send fails (the SDK never rejects — see `getLastError()`).
576
+ * @returns The correlated {@link FastH3FlushAcceptedMessage} reply, or `undefined` when the command failed or the model refused it. The call never rejects: the failure arrives on the `error` event (and `getLastError()`) with `operation: "sendCommand"` and, for a refusal, the model's `code`.
573
577
  */
574
578
  setFlushOnClipEnd(params: FastH3SetFlushOnClipEndParams): Promise<FastH3FlushAcceptedMessage | undefined>;
575
579
  /**