@reactor-models/lingbot-world-2 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1084 -0
- package/dist/chunk-GS3BM4VC.mjs +247 -0
- package/dist/chunk-GS3BM4VC.mjs.map +1 -0
- package/dist/chunk-NTXVRMPF.mjs +205 -0
- package/dist/chunk-NTXVRMPF.mjs.map +1 -0
- package/dist/core.d.mts +370 -0
- package/dist/core.d.ts +370 -0
- package/dist/core.js +275 -0
- package/dist/core.js.map +1 -0
- package/dist/core.mjs +15 -0
- package/dist/core.mjs.map +1 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +485 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +49 -0
- package/dist/index.mjs.map +1 -0
- package/dist/react.d.mts +150 -0
- package/dist/react.d.ts +150 -0
- package/dist/react.js +244 -0
- package/dist/react.js.map +1 -0
- package/dist/react.mjs +39 -0
- package/dist/react.mjs.map +1 -0
- package/package.json +54 -0
package/dist/react.js
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/react.tsx
|
|
22
|
+
var react_exports = {};
|
|
23
|
+
__export(react_exports, {
|
|
24
|
+
LingbotWorld2MainVideoView: () => LingbotWorld2MainVideoView,
|
|
25
|
+
LingbotWorld2Provider: () => LingbotWorld2Provider,
|
|
26
|
+
useLingbotWorld2: () => useLingbotWorld2,
|
|
27
|
+
useLingbotWorld2ChunkComplete: () => useLingbotWorld2ChunkComplete,
|
|
28
|
+
useLingbotWorld2CommandError: () => useLingbotWorld2CommandError,
|
|
29
|
+
useLingbotWorld2ConditionsReady: () => useLingbotWorld2ConditionsReady,
|
|
30
|
+
useLingbotWorld2GenerationComplete: () => useLingbotWorld2GenerationComplete,
|
|
31
|
+
useLingbotWorld2GenerationPaused: () => useLingbotWorld2GenerationPaused,
|
|
32
|
+
useLingbotWorld2GenerationReset: () => useLingbotWorld2GenerationReset,
|
|
33
|
+
useLingbotWorld2GenerationResumed: () => useLingbotWorld2GenerationResumed,
|
|
34
|
+
useLingbotWorld2GenerationStarted: () => useLingbotWorld2GenerationStarted,
|
|
35
|
+
useLingbotWorld2ImageAccepted: () => useLingbotWorld2ImageAccepted,
|
|
36
|
+
useLingbotWorld2Message: () => useLingbotWorld2Message,
|
|
37
|
+
useLingbotWorld2PromptAccepted: () => useLingbotWorld2PromptAccepted,
|
|
38
|
+
useLingbotWorld2State: () => useLingbotWorld2State,
|
|
39
|
+
useLingbotWorld2Track: () => useLingbotWorld2Track
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(react_exports);
|
|
42
|
+
var import_js_sdk2 = require("@reactor-team/js-sdk");
|
|
43
|
+
|
|
44
|
+
// src/core.ts
|
|
45
|
+
var import_js_sdk = require("@reactor-team/js-sdk");
|
|
46
|
+
var MODEL_NAME = "reactor/lingbot-world-2";
|
|
47
|
+
var LingbotWorld2Tracks = [
|
|
48
|
+
{ name: "main_video", kind: "video", direction: "recvonly" }
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
// src/react.tsx
|
|
52
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
53
|
+
function _unwrapMessage(raw) {
|
|
54
|
+
const env = raw;
|
|
55
|
+
if (env && typeof env === "object" && env.data && typeof env.data === "object") {
|
|
56
|
+
return { ...env.data, type: env.type };
|
|
57
|
+
}
|
|
58
|
+
return raw;
|
|
59
|
+
}
|
|
60
|
+
function LingbotWorld2Provider({
|
|
61
|
+
children,
|
|
62
|
+
...rest
|
|
63
|
+
}) {
|
|
64
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
65
|
+
import_js_sdk2.ReactorProvider,
|
|
66
|
+
{
|
|
67
|
+
...rest,
|
|
68
|
+
modelName: MODEL_NAME,
|
|
69
|
+
modelTracks: [...LingbotWorld2Tracks],
|
|
70
|
+
children
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
function useLingbotWorld2() {
|
|
75
|
+
const connect = (0, import_js_sdk2.useReactor)((s) => s.connect);
|
|
76
|
+
const connectOptions = (0, import_js_sdk2.useReactor)((s) => s.connectOptions);
|
|
77
|
+
const disconnect = (0, import_js_sdk2.useReactor)((s) => s.disconnect);
|
|
78
|
+
const downloadClipAsFile = (0, import_js_sdk2.useReactor)((s) => s.downloadClipAsFile);
|
|
79
|
+
const jwtToken = (0, import_js_sdk2.useReactor)((s) => s.jwtToken);
|
|
80
|
+
const lastError = (0, import_js_sdk2.useReactor)((s) => s.lastError);
|
|
81
|
+
const publish = (0, import_js_sdk2.useReactor)((s) => s.publish);
|
|
82
|
+
const reconnect = (0, import_js_sdk2.useReactor)((s) => s.reconnect);
|
|
83
|
+
const requestClip = (0, import_js_sdk2.useReactor)((s) => s.requestClip);
|
|
84
|
+
const requestRecording = (0, import_js_sdk2.useReactor)((s) => s.requestRecording);
|
|
85
|
+
const sendCommand = (0, import_js_sdk2.useReactor)((s) => s.sendCommand);
|
|
86
|
+
const sessionExpiration = (0, import_js_sdk2.useReactor)((s) => s.sessionExpiration);
|
|
87
|
+
const sessionId = (0, import_js_sdk2.useReactor)((s) => s.sessionId);
|
|
88
|
+
const status = (0, import_js_sdk2.useReactor)((s) => s.status);
|
|
89
|
+
const tracks = (0, import_js_sdk2.useReactor)((s) => s.tracks);
|
|
90
|
+
const unpublish = (0, import_js_sdk2.useReactor)((s) => s.unpublish);
|
|
91
|
+
const uploadFile = (0, import_js_sdk2.useReactor)((s) => s.uploadFile);
|
|
92
|
+
return {
|
|
93
|
+
connect,
|
|
94
|
+
connectOptions,
|
|
95
|
+
disconnect,
|
|
96
|
+
downloadClipAsFile,
|
|
97
|
+
jwtToken,
|
|
98
|
+
lastError,
|
|
99
|
+
publish,
|
|
100
|
+
reconnect,
|
|
101
|
+
requestClip,
|
|
102
|
+
requestRecording,
|
|
103
|
+
sendCommand,
|
|
104
|
+
sessionExpiration,
|
|
105
|
+
sessionId,
|
|
106
|
+
status,
|
|
107
|
+
tracks,
|
|
108
|
+
unpublish,
|
|
109
|
+
uploadFile,
|
|
110
|
+
pause: () => sendCommand("pause", {}),
|
|
111
|
+
reset: () => sendCommand("reset", {}),
|
|
112
|
+
start: () => sendCommand("start", {}),
|
|
113
|
+
resume: () => sendCommand("resume", {}),
|
|
114
|
+
setSeed: (params) => sendCommand("set_seed", params),
|
|
115
|
+
setImage: (params) => sendCommand("set_image", params),
|
|
116
|
+
setPrompt: (params) => sendCommand("set_prompt", params),
|
|
117
|
+
setAttnWindow: (params) => sendCommand("set_attn_window", params),
|
|
118
|
+
setCameraPose: (params) => sendCommand("set_camera_pose", params),
|
|
119
|
+
setMoveLateral: (params) => sendCommand("set_move_lateral", params),
|
|
120
|
+
setLookVertical: (params) => sendCommand("set_look_vertical", params),
|
|
121
|
+
setLookHorizontal: (params) => sendCommand("set_look_horizontal", params),
|
|
122
|
+
setMoveLongitudinal: (params) => sendCommand("set_move_longitudinal", params),
|
|
123
|
+
setRotationSpeedDeg: (params) => sendCommand("set_rotation_speed_deg", params)
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function useLingbotWorld2Message(handler) {
|
|
127
|
+
(0, import_js_sdk2.useReactorMessage)(
|
|
128
|
+
(msg) => handler(_unwrapMessage(msg))
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
function useLingbotWorld2State(handler) {
|
|
132
|
+
(0, import_js_sdk2.useReactorMessage)((msg) => {
|
|
133
|
+
const m = _unwrapMessage(msg);
|
|
134
|
+
if (m.type === "state") {
|
|
135
|
+
handler(m);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function useLingbotWorld2CommandError(handler) {
|
|
140
|
+
(0, import_js_sdk2.useReactorMessage)((msg) => {
|
|
141
|
+
const m = _unwrapMessage(msg);
|
|
142
|
+
if (m.type === "command_error") {
|
|
143
|
+
handler(m);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
function useLingbotWorld2ChunkComplete(handler) {
|
|
148
|
+
(0, import_js_sdk2.useReactorMessage)((msg) => {
|
|
149
|
+
const m = _unwrapMessage(msg);
|
|
150
|
+
if (m.type === "chunk_complete") {
|
|
151
|
+
handler(m);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
function useLingbotWorld2ImageAccepted(handler) {
|
|
156
|
+
(0, import_js_sdk2.useReactorMessage)((msg) => {
|
|
157
|
+
const m = _unwrapMessage(msg);
|
|
158
|
+
if (m.type === "image_accepted") {
|
|
159
|
+
handler(m);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
function useLingbotWorld2PromptAccepted(handler) {
|
|
164
|
+
(0, import_js_sdk2.useReactorMessage)((msg) => {
|
|
165
|
+
const m = _unwrapMessage(msg);
|
|
166
|
+
if (m.type === "prompt_accepted") {
|
|
167
|
+
handler(m);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
function useLingbotWorld2ConditionsReady(handler) {
|
|
172
|
+
(0, import_js_sdk2.useReactorMessage)((msg) => {
|
|
173
|
+
const m = _unwrapMessage(msg);
|
|
174
|
+
if (m.type === "conditions_ready") {
|
|
175
|
+
handler(m);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
function useLingbotWorld2GenerationReset(handler) {
|
|
180
|
+
(0, import_js_sdk2.useReactorMessage)((msg) => {
|
|
181
|
+
const m = _unwrapMessage(msg);
|
|
182
|
+
if (m.type === "generation_reset") {
|
|
183
|
+
handler(m);
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
function useLingbotWorld2GenerationPaused(handler) {
|
|
188
|
+
(0, import_js_sdk2.useReactorMessage)((msg) => {
|
|
189
|
+
const m = _unwrapMessage(msg);
|
|
190
|
+
if (m.type === "generation_paused") {
|
|
191
|
+
handler(m);
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
function useLingbotWorld2GenerationResumed(handler) {
|
|
196
|
+
(0, import_js_sdk2.useReactorMessage)((msg) => {
|
|
197
|
+
const m = _unwrapMessage(msg);
|
|
198
|
+
if (m.type === "generation_resumed") {
|
|
199
|
+
handler(m);
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
function useLingbotWorld2GenerationStarted(handler) {
|
|
204
|
+
(0, import_js_sdk2.useReactorMessage)((msg) => {
|
|
205
|
+
const m = _unwrapMessage(msg);
|
|
206
|
+
if (m.type === "generation_started") {
|
|
207
|
+
handler(m);
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
function useLingbotWorld2GenerationComplete(handler) {
|
|
212
|
+
(0, import_js_sdk2.useReactorMessage)((msg) => {
|
|
213
|
+
const m = _unwrapMessage(msg);
|
|
214
|
+
if (m.type === "generation_complete") {
|
|
215
|
+
handler(m);
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
function useLingbotWorld2Track(name) {
|
|
220
|
+
return (0, import_js_sdk2.useReactor)((s) => s.tracks[name]);
|
|
221
|
+
}
|
|
222
|
+
function LingbotWorld2MainVideoView(props) {
|
|
223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_js_sdk2.ReactorView, { ...props, track: "main_video" });
|
|
224
|
+
}
|
|
225
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
226
|
+
0 && (module.exports = {
|
|
227
|
+
LingbotWorld2MainVideoView,
|
|
228
|
+
LingbotWorld2Provider,
|
|
229
|
+
useLingbotWorld2,
|
|
230
|
+
useLingbotWorld2ChunkComplete,
|
|
231
|
+
useLingbotWorld2CommandError,
|
|
232
|
+
useLingbotWorld2ConditionsReady,
|
|
233
|
+
useLingbotWorld2GenerationComplete,
|
|
234
|
+
useLingbotWorld2GenerationPaused,
|
|
235
|
+
useLingbotWorld2GenerationReset,
|
|
236
|
+
useLingbotWorld2GenerationResumed,
|
|
237
|
+
useLingbotWorld2GenerationStarted,
|
|
238
|
+
useLingbotWorld2ImageAccepted,
|
|
239
|
+
useLingbotWorld2Message,
|
|
240
|
+
useLingbotWorld2PromptAccepted,
|
|
241
|
+
useLingbotWorld2State,
|
|
242
|
+
useLingbotWorld2Track
|
|
243
|
+
});
|
|
244
|
+
//# sourceMappingURL=react.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/react.tsx","../src/core.ts"],"sourcesContent":["// Copyright (c) 2026 Reactor Technologies, Inc. All rights reserved.\n\n// Auto-generated by @reactor-team/codegen — DO NOT EDIT\n// Model: lingbot-world-2 v0.2.5\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 LingbotWorld2Tracks,\n type LingbotWorld2Options,\n type LingbotWorld2SetSeedParams,\n type LingbotWorld2SetImageParams,\n type LingbotWorld2SetPromptParams,\n type LingbotWorld2SetAttnWindowParams,\n type LingbotWorld2SetCameraPoseParams,\n type LingbotWorld2SetMoveLateralParams,\n type LingbotWorld2SetLookVerticalParams,\n type LingbotWorld2SetLookHorizontalParams,\n type LingbotWorld2SetMoveLongitudinalParams,\n type LingbotWorld2SetRotationSpeedDegParams,\n type LingbotWorld2Message,\n type LingbotWorld2StateMessage,\n type LingbotWorld2CommandErrorMessage,\n type LingbotWorld2ChunkCompleteMessage,\n type LingbotWorld2ImageAcceptedMessage,\n type LingbotWorld2PromptAcceptedMessage,\n type LingbotWorld2ConditionsReadyMessage,\n type LingbotWorld2GenerationResetMessage,\n type LingbotWorld2GenerationPausedMessage,\n type LingbotWorld2GenerationResumedMessage,\n type LingbotWorld2GenerationStartedMessage,\n type LingbotWorld2GenerationCompleteMessage,\n type LingbotWorld2RecvTrackName,\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 LingbotWorld2Provider} component.\n *\n * Derived from `ReactorProvider`'s own props, with `modelName` and\n * `modelTracks` stripped — those are supplied by this provider.\n */\nexport type LingbotWorld2ProviderProps = Omit<\n Parameters<typeof ReactorProvider>[0],\n \"modelName\" | \"modelTracks\"\n>;\n\n/**\n * Provider for the LingbotWorld2 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 useLingbotWorld2} and the `useLingbotWorld2<Message>` hooks below it.\n */\nexport function LingbotWorld2Provider({\n children,\n ...rest\n}: LingbotWorld2ProviderProps): ReactElement {\n return (\n <ReactorProvider\n {...rest}\n modelName={MODEL_NAME}\n modelTracks={[...LingbotWorld2Tracks]}\n >\n {children}\n </ReactorProvider>\n );\n}\n\n/**\n * Access the LingbotWorld2 model as typed commands bound to the nearest\n * {@link LingbotWorld2Provider}.\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 * `sessionExpiration` 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 */\nexport function useLingbotWorld2() {\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 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 sendCommand = useReactor((s) => s.sendCommand);\n const sessionExpiration = useReactor((s) => s.sessionExpiration);\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 publish,\n reconnect,\n requestClip,\n requestRecording,\n sendCommand,\n sessionExpiration,\n sessionId,\n status,\n tracks,\n unpublish,\n uploadFile,\n pause: (): Promise<void> =>\n sendCommand(\"pause\", {}),\n reset: (): Promise<void> =>\n sendCommand(\"reset\", {}),\n start: (): Promise<void> =>\n sendCommand(\"start\", {}),\n resume: (): Promise<void> =>\n sendCommand(\"resume\", {}),\n setSeed: (params: LingbotWorld2SetSeedParams): Promise<void> =>\n sendCommand(\"set_seed\", params),\n setImage: (params: LingbotWorld2SetImageParams): Promise<void> =>\n sendCommand(\"set_image\", params),\n setPrompt: (params: LingbotWorld2SetPromptParams): Promise<void> =>\n sendCommand(\"set_prompt\", params),\n setAttnWindow: (params: LingbotWorld2SetAttnWindowParams): Promise<void> =>\n sendCommand(\"set_attn_window\", params),\n setCameraPose: (params: LingbotWorld2SetCameraPoseParams): Promise<void> =>\n sendCommand(\"set_camera_pose\", params),\n setMoveLateral: (params: LingbotWorld2SetMoveLateralParams): Promise<void> =>\n sendCommand(\"set_move_lateral\", params),\n setLookVertical: (params: LingbotWorld2SetLookVerticalParams): Promise<void> =>\n sendCommand(\"set_look_vertical\", params),\n setLookHorizontal: (params: LingbotWorld2SetLookHorizontalParams): Promise<void> =>\n sendCommand(\"set_look_horizontal\", params),\n setMoveLongitudinal: (params: LingbotWorld2SetMoveLongitudinalParams): Promise<void> =>\n sendCommand(\"set_move_longitudinal\", params),\n setRotationSpeedDeg: (params: LingbotWorld2SetRotationSpeedDegParams): Promise<void> =>\n sendCommand(\"set_rotation_speed_deg\", params),\n };\n}\n\n/**\n * Subscribe to any LingbotWorld2 message with a fully-typed handler.\n * The handler receives a discriminated LingbotWorld2Message.\n */\nexport function useLingbotWorld2Message(\n handler: (message: LingbotWorld2Message) => void,\n): void {\n useReactorMessage((msg: unknown) =>\n handler(_unwrapMessage<LingbotWorld2Message>(msg)),\n );\n}\n\n/**\n * Subscribe to \"state\" messages only.\n * Handler receives a fully-typed LingbotWorld2StateMessage.\n */\nexport function useLingbotWorld2State(\n handler: (message: LingbotWorld2StateMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotWorld2Message>(msg);\n if (m.type === \"state\") {\n handler(m as LingbotWorld2StateMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"command_error\" messages only.\n * Handler receives a fully-typed LingbotWorld2CommandErrorMessage.\n */\nexport function useLingbotWorld2CommandError(\n handler: (message: LingbotWorld2CommandErrorMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotWorld2Message>(msg);\n if (m.type === \"command_error\") {\n handler(m as LingbotWorld2CommandErrorMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"chunk_complete\" messages only.\n * Handler receives a fully-typed LingbotWorld2ChunkCompleteMessage.\n */\nexport function useLingbotWorld2ChunkComplete(\n handler: (message: LingbotWorld2ChunkCompleteMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotWorld2Message>(msg);\n if (m.type === \"chunk_complete\") {\n handler(m as LingbotWorld2ChunkCompleteMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"image_accepted\" messages only.\n * Handler receives a fully-typed LingbotWorld2ImageAcceptedMessage.\n */\nexport function useLingbotWorld2ImageAccepted(\n handler: (message: LingbotWorld2ImageAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotWorld2Message>(msg);\n if (m.type === \"image_accepted\") {\n handler(m as LingbotWorld2ImageAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"prompt_accepted\" messages only.\n * Handler receives a fully-typed LingbotWorld2PromptAcceptedMessage.\n */\nexport function useLingbotWorld2PromptAccepted(\n handler: (message: LingbotWorld2PromptAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotWorld2Message>(msg);\n if (m.type === \"prompt_accepted\") {\n handler(m as LingbotWorld2PromptAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"conditions_ready\" messages only.\n * Handler receives a fully-typed LingbotWorld2ConditionsReadyMessage.\n */\nexport function useLingbotWorld2ConditionsReady(\n handler: (message: LingbotWorld2ConditionsReadyMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotWorld2Message>(msg);\n if (m.type === \"conditions_ready\") {\n handler(m as LingbotWorld2ConditionsReadyMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"generation_reset\" messages only.\n * Handler receives a fully-typed LingbotWorld2GenerationResetMessage.\n */\nexport function useLingbotWorld2GenerationReset(\n handler: (message: LingbotWorld2GenerationResetMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotWorld2Message>(msg);\n if (m.type === \"generation_reset\") {\n handler(m as LingbotWorld2GenerationResetMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"generation_paused\" messages only.\n * Handler receives a fully-typed LingbotWorld2GenerationPausedMessage.\n */\nexport function useLingbotWorld2GenerationPaused(\n handler: (message: LingbotWorld2GenerationPausedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotWorld2Message>(msg);\n if (m.type === \"generation_paused\") {\n handler(m as LingbotWorld2GenerationPausedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"generation_resumed\" messages only.\n * Handler receives a fully-typed LingbotWorld2GenerationResumedMessage.\n */\nexport function useLingbotWorld2GenerationResumed(\n handler: (message: LingbotWorld2GenerationResumedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotWorld2Message>(msg);\n if (m.type === \"generation_resumed\") {\n handler(m as LingbotWorld2GenerationResumedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"generation_started\" messages only.\n * Handler receives a fully-typed LingbotWorld2GenerationStartedMessage.\n */\nexport function useLingbotWorld2GenerationStarted(\n handler: (message: LingbotWorld2GenerationStartedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotWorld2Message>(msg);\n if (m.type === \"generation_started\") {\n handler(m as LingbotWorld2GenerationStartedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"generation_complete\" messages only.\n * Handler receives a fully-typed LingbotWorld2GenerationCompleteMessage.\n */\nexport function useLingbotWorld2GenerationComplete(\n handler: (message: LingbotWorld2GenerationCompleteMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotWorld2Message>(msg);\n if (m.type === \"generation_complete\") {\n handler(m as LingbotWorld2GenerationCompleteMessage);\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 `LingbotWorld2RecvTrackName`.\n * @param name - A recvonly track name declared by the model\n * @returns The live MediaStreamTrack, or `undefined` until received\n */\nexport function useLingbotWorld2Track(\n name: LingbotWorld2RecvTrackName,\n): MediaStreamTrack | undefined {\n return useReactor((s) => s.tracks[name]);\n}\n\nexport type LingbotWorld2MainVideoViewProps = 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 `<LingbotWorld2Provider>`.\n */\nexport function LingbotWorld2MainVideoView(\n props: LingbotWorld2MainVideoViewProps,\n): ReactElement {\n return <ReactorView {...props} track=\"main_video\" />;\n}\n","// Copyright (c) 2026 Reactor Technologies, Inc. All rights reserved.\n\n// Auto-generated by @reactor-team/codegen — DO NOT EDIT\n// Model: lingbot-world-2 v0.2.5\n\nimport { Reactor, FileRef } from \"@reactor-team/js-sdk\";\nexport { FileRef };\n\nexport const MODEL_NAME = \"reactor/lingbot-world-2\" as const;\nexport const MODEL_VERSION = \"v0.2.5\" as const;\n\n/**\n * Preset media tracks for the LingbotWorld2 model.\n *\n * Declared in the model's OpenAPI schema and passed to the SDK as\n * `modelTracks` so the transport can prepare the SDP offer in\n * parallel with session polling (faster first-frame latency).\n */\nexport const LingbotWorld2Tracks = [\n { name: \"main_video\", kind: \"video\", direction: \"recvonly\" },\n] as const;\n\n/** Track names the client can subscribe to (recvonly, from the client's perspective). */\nexport type LingbotWorld2RecvTrackName =\n \"main_video\";\n\n/** Set seed */\nexport interface LingbotWorld2SetSeedParams {\n /**\n * Seed for the random generator used to sample the initial noise. Must be a non-negative integer; the model never draws its own random seed — pick one explicitly (or keep the default) for reproducible runs. Read once when `start` fires; later changes take effect only after `reset` followed by a new `start`.\n * @minimum 0\n * @default 42\n */\n\n seed?: number;\n}\n\n/** Provide a reference image that anchors generation (image-to-video). Call before `start`; the image is required for generation to begin. Changes during generation have no effect until `reset` is issued and `start` is called again. Emits `image_accepted`, `conditions_ready`, and `state` on success, or `command_error` if the file is missing, not an image, or cannot be decoded. */\nexport interface LingbotWorld2SetImageParams {\n /**\n * Reference to a file uploaded via the Reactor presigned-URL protocol.\n * @default null\n */\n\n image?: FileRef;\n}\n\n/** Set the scene prompt. Valid at any time — call before `start` to arm generation, or hot-swap during generation to steer the next chunk. Emits `prompt_accepted`, `conditions_ready`, and `state` on success. */\nexport interface LingbotWorld2SetPromptParams {\n /**\n * Natural-language description of the scene to generate. Replaces the previously active prompt. Applied on the next chunk when generating; otherwise takes effect when `start` fires.\n * @default \"\"\n */\n\n prompt?: string;\n}\n\n/** Set attn_window */\nexport interface LingbotWorld2SetAttnWindowParams {\n /**\n * Manual override for the DiT self-attention window. `auto` uses the motion-based still-window trigger (unchanged default behavior); `small` forces the still (small) window; `large` forces the moving (large) window. Can be changed at any time; the new value applies to the next chunk.\n * @default \"auto\"\n */\n\n attn_window?: \"auto\" | \"small\" | \"large\";\n}\n\n/** Set camera_pose */\nexport interface LingbotWorld2SetCameraPoseParams {\n /**\n * Native camera-pose layer: a flat list of per-frame motion deltas, length a multiple of 6 — `[rx, ry, rz, tx, ty, tz]` per frame (small Euler-radian rotation + translation, in the camera-local frame). 6 floats = one delta applied to the whole chunk; 6*chunk_size = one delta per latent frame; any other 6*k is resampled to chunk_size. When active, rotation OVERRIDES look_horizontal / look_vertical and translation ADDS to WASD movement. Inputs are sanitized (NaN/Inf→0, rotations clamped to ±pi, translation to ±100), so any payload is safe. Pass an empty list (or omit) to deactivate.\n * @maxLength 1536\n * @default null\n */\n\n camera_pose?: unknown[];\n}\n\n/** Set move_lateral */\nexport interface LingbotWorld2SetMoveLateralParams {\n /**\n * Lateral (strafe left/right) camera translation. `idle` holds position; `strafe_left` / `strafe_right` translate sideways. Independent of `move_longitudinal` — both can be active together for diagonal movement. Can be changed at any time; the new value applies to the next chunk.\n * @default \"idle\"\n */\n\n move_lateral?: \"idle\" | \"strafe_left\" | \"strafe_right\";\n}\n\n/** Set look_vertical */\nexport interface LingbotWorld2SetLookVerticalParams {\n /**\n * Vertical (pitch) camera rotation. `idle` holds pitch steady; `up` / `down` rotate the camera at the rate given by `rotation_speed_deg`. Can be changed at any time; the new value applies to the next chunk.\n * @default \"idle\"\n */\n\n look_vertical?: \"idle\" | \"up\" | \"down\";\n}\n\n/** Set look_horizontal */\nexport interface LingbotWorld2SetLookHorizontalParams {\n /**\n * Horizontal (yaw) camera rotation. `idle` holds yaw steady; `left` / `right` rotate the camera at the rate given by `rotation_speed_deg`. Can be changed at any time; the new value applies to the next chunk.\n * @default \"idle\"\n */\n\n look_horizontal?: \"idle\" | \"left\" | \"right\";\n}\n\n/** Set move_longitudinal */\nexport interface LingbotWorld2SetMoveLongitudinalParams {\n /**\n * Longitudinal (forward/back) camera translation. `idle` holds position; `forward` / `back` translate along the look axis. Independent of `move_lateral` — both can be active together for diagonal movement. Can be changed at any time; the new value applies to the next chunk.\n * @default \"idle\"\n */\n\n move_longitudinal?: \"idle\" | \"forward\" | \"back\";\n}\n\n/** Set rotation_speed_deg */\nexport interface LingbotWorld2SetRotationSpeedDegParams {\n /**\n * Camera rotation speed in degrees per latent frame, applied when `look_horizontal` or `look_vertical` is not `idle`. Range 0.0 – 30.0. Ignored when both look axes are `idle`. Can be changed at any time; the new value applies to the next chunk.\n * @minimum 0\n * @maximum 30\n * @default 5\n */\n\n rotation_speed_deg?: number;\n}\n\n/**\n * Snapshot of the session's observable state.\n *\n * Emitted on connect, after every command that mutates session state (`set_prompt`, `set_image`, `start`, `pause`, `resume`, `reset`, and the auto-generated `set_<field>` setters), and after each `chunk_complete`. Clients can treat this as the single source of truth for driving UI, without having to track every individual command and message themselves.\n */\nexport interface LingbotWorld2StateMessage {\n type: \"state\";\n /** Current value of the `seed` input field. The seed that was actually used by the running generation was captured when `start` fired — later changes to `seed` only take effect after `reset` and a new `start`. */\n\n seed: number;\n /** True while generation is paused via `pause`. */\n\n paused: boolean;\n /** True while the chunk loop is actively producing frames — equivalent to `started and not paused`. `False` both before `start` and while paused; read `started` to disambiguate. */\n\n running: boolean;\n /** True once `start` has been accepted. Remains true while paused; reset to false by `reset` or after `generation_complete` when the session is not auto-restarting. */\n\n started: boolean;\n /** True once a reference image has been set for the session. */\n\n has_image: boolean;\n /** True once a prompt has been set for the session. */\n\n has_prompt: boolean;\n /** Current value of the `move_lateral` input field. */\n\n move_lateral: string;\n /** Zero-based index of the last completed chunk. `0` before the first chunk has completed, and resets to `0` on `reset`. */\n\n current_chunk: number;\n /** Current value of the `look_vertical` input field. */\n\n look_vertical: string;\n /** Composite action string derived from `move_longitudinal`, `move_lateral`, `look_horizontal`, and `look_vertical` — a `+`-joined combination of `w`/`s`/`a`/`d` and `left`/`right`/`up`/`down`, or `still` when idle. */\n\n current_action: string;\n /** The prompt currently driving generation, or `null` if no prompt has been set for the session. */\n\n current_prompt: unknown;\n /** Current value of the `look_horizontal` input field. */\n\n look_horizontal: string;\n /** Current value of the `move_longitudinal` input field. */\n\n move_longitudinal: string;\n /** True when a non-empty `camera_pose` has been set. */\n\n camera_pose_active: boolean;\n /** Current value of the `rotation_speed_deg` input field (0.0 – 30.0). */\n\n rotation_speed_deg: number;\n}\n\n/** Emitted when a command is rejected because preconditions are not met or its arguments could not be processed. */\nexport interface LingbotWorld2CommandErrorMessage {\n type: \"command_error\";\n /** Human-readable explanation of why the command was rejected. */\n\n reason: string;\n /** Name of the command that was rejected. */\n\n command: string;\n}\n\n/** Emitted once per completed chunk of `main_video`. */\nexport interface LingbotWorld2ChunkCompleteMessage {\n type: \"chunk_complete\";\n /** Zero-based index of the chunk that just completed. */\n\n chunk_index: number;\n /** The composite action string used to drive this chunk — a `+`-joined combination of translation (`w`/`s`/`a`/`d`) and look directions (`left`/`right`/`up`/`down`), or `still` when the camera is stationary. */\n\n active_action: string;\n /** The prompt that was active while this chunk was generated. */\n\n active_prompt: string;\n /** Number of pixel frames emitted by this chunk. */\n\n frames_emitted: number;\n}\n\n/** Emitted after `set_image` successfully decodes the uploaded file. */\nexport interface LingbotWorld2ImageAcceptedMessage {\n type: \"image_accepted\";\n /** Width in pixels of the decoded reference image. */\n\n width: number;\n /** Height in pixels of the decoded reference image. */\n\n height: number;\n}\n\n/** Emitted after `set_prompt` is accepted. */\nexport interface LingbotWorld2PromptAcceptedMessage {\n type: \"prompt_accepted\";\n /** The prompt text that was accepted. */\n\n prompt: string;\n}\n\n/** Emitted after `set_prompt` or `set_image` so the client can tell at a glance whether `start` will succeed. */\nexport interface LingbotWorld2ConditionsReadyMessage {\n type: \"conditions_ready\";\n /** True once a reference image has been set for the session. */\n\n has_image: boolean;\n /** True once a prompt has been set for the session. */\n\n has_prompt: boolean;\n}\n\n/** Emitted after `reset` clears session state and returns to the waiting state. */\nexport interface LingbotWorld2GenerationResetMessage {\n type: \"generation_reset\";\n /** Short human-readable reason the reset was issued. */\n\n reason: string;\n}\n\n/** Emitted in response to `pause`, once the current chunk finishes. */\nexport interface LingbotWorld2GenerationPausedMessage {\n type: \"generation_paused\";\n /** Index of the last completed chunk before pausing. */\n\n chunk_index: number;\n}\n\n/** Emitted in response to `resume` when leaving the paused state. */\nexport interface LingbotWorld2GenerationResumedMessage {\n type: \"generation_resumed\";\n /** Index of the last completed chunk before resuming. */\n\n chunk_index: number;\n}\n\n/** Emitted once when `start` succeeds and frames begin streaming. */\nexport interface LingbotWorld2GenerationStartedMessage {\n type: \"generation_started\";\n /** The prompt active at the start of generation. */\n\n prompt: string;\n /** Total number of chunks the run will produce before `generation_complete` fires. */\n\n chunk_num: number;\n /** Total number of pixel frames the run will emit on `main_video` before `generation_complete`. */\n\n frame_num: number;\n}\n\n/** Emitted when all `chunk_num` chunks of a run have streamed. If the session is still `started`, a new run kicks off immediately with the same prompt and image; call `reset` to stop. */\nexport interface LingbotWorld2GenerationCompleteMessage {\n type: \"generation_complete\";\n /** Total number of chunks produced by the run. */\n\n total_chunks: number;\n}\n\nexport type LingbotWorld2Message =\n | LingbotWorld2StateMessage\n | LingbotWorld2CommandErrorMessage\n | LingbotWorld2ChunkCompleteMessage\n | LingbotWorld2ImageAcceptedMessage\n | LingbotWorld2PromptAcceptedMessage\n | LingbotWorld2ConditionsReadyMessage\n | LingbotWorld2GenerationResetMessage\n | LingbotWorld2GenerationPausedMessage\n | LingbotWorld2GenerationResumedMessage\n | LingbotWorld2GenerationStartedMessage\n | LingbotWorld2GenerationCompleteMessage;\n\n/**\n * Options for creating a LingbotWorld2Model (model name is set automatically).\n *\n * Derived from `Reactor`'s own constructor options with `modelName`\n * and `modelTracks` removed — those are supplied by this class.\n * Any new option the SDK adds appears here automatically on the\n * next `defaultSdkVersion` bump.\n */\nexport type LingbotWorld2Options = Omit<\n ConstructorParameters<typeof Reactor>[0],\n \"modelName\" | \"modelTracks\"\n>;\n\n/**\n * @internal Flatten the `{ type, data, uploads? }` envelope the SDK\n * hands to `reactor.on(\"message\", …)` so a field the model schema\n * declares on a message is reachable at `msg.<field>` — matching the\n * shape the exported message interfaces promise.\n */\nfunction _unwrapMessage<T>(raw: unknown): T {\n const env = raw as { type?: string; data?: Record<string, unknown> };\n if (\n env &&\n typeof env === \"object\" &&\n env.data &&\n typeof env.data === \"object\"\n ) {\n return { ...env.data, type: env.type } as T;\n }\n return raw as T;\n}\n\n/**\n * Strongly-typed client for the LingbotWorld2 model.\n *\n * Extends {@link Reactor} with the model name (and modelTracks) baked into the\n * constructor, so every public method on Reactor — `connect`, `disconnect`,\n * `sendCommand`, `on`/`off`, `getStats`, `publishTrack`/`unpublishTrack`,\n * etc. — is reachable directly on the instance. The schema-derived sugar\n * below adds typed wrappers for every declared event, message, and track.\n */\n\nexport class LingbotWorld2Model extends Reactor {\n constructor(options?: LingbotWorld2Options) {\n super({\n ...options,\n modelName: MODEL_NAME,\n modelTracks: [...LingbotWorld2Tracks],\n });\n }\n\n /** @deprecated The model client now extends `Reactor` directly — call methods on `this` instead. This accessor returns `this` for backwards compatibility and will be removed in a future major release. */\n\n get reactor(): this {\n return this;\n }\n\n /** Pause generation after the current chunk finishes. Frames stop streaming on `main_video` until `resume` is called. Requires generation to be active. Emits `generation_paused` and `state` on success, or `command_error` if not generating or already paused. */\n\n async pause(): Promise<void> {\n await this.sendCommand(\"pause\", {});\n }\n\n /** Abort the current run, clear the active prompt and reference image, and return to the waiting state. Valid at any time. After `reset`, call `set_prompt` and `set_image` again before `start` to begin a new session. Emits `generation_reset` and `state`. */\n\n async reset(): Promise<void> {\n await this.sendCommand(\"reset\", {});\n }\n\n /** Begin generating video on `main_video`. Requires both a prompt (via `set_prompt`) and a reference image (via `set_image`). Emits `generation_started` and `state` on success, or `command_error` if a precondition is missing. Has no effect while already generating. */\n\n async start(): Promise<void> {\n await this.sendCommand(\"start\", {});\n }\n\n /** Resume generation from a previous `pause`. Requires the session to be paused. Emits `generation_resumed` and `state` on success, or `command_error` if not paused. */\n\n async resume(): Promise<void> {\n await this.sendCommand(\"resume\", {});\n }\n\n /**\n * Set seed\n * @param params - Set seed\n */\n\n async setSeed(params: LingbotWorld2SetSeedParams): Promise<void> {\n await this.sendCommand(\"set_seed\", params);\n }\n\n /**\n * Provide a reference image that anchors generation (image-to-video). Call before `start`; the image is required for generation to begin. Changes during generation have no effect until `reset` is issued and `start` is called again. Emits `image_accepted`, `conditions_ready`, and `state` on success, or `command_error` if the file is missing, not an image, or cannot be decoded.\n * @param params - Provide a reference image that anchors generation (image-to-video). Call before `start`; the image is required for generation to begin. Changes during generation have no effect until `reset` is issued and `start` is called again. Emits `image_accepted`, `conditions_ready`, and `state` on success, or `command_error` if the file is missing, not an image, or cannot be decoded.\n */\n\n async setImage(params: LingbotWorld2SetImageParams): Promise<void> {\n await this.sendCommand(\"set_image\", params);\n }\n\n /**\n * Set the scene prompt. Valid at any time — call before `start` to arm generation, or hot-swap during generation to steer the next chunk. Emits `prompt_accepted`, `conditions_ready`, and `state` on success.\n * @param params - Set the scene prompt. Valid at any time — call before `start` to arm generation, or hot-swap during generation to steer the next chunk. Emits `prompt_accepted`, `conditions_ready`, and `state` on success.\n */\n\n async setPrompt(params: LingbotWorld2SetPromptParams): Promise<void> {\n await this.sendCommand(\"set_prompt\", params);\n }\n\n /**\n * Set attn_window\n * @param params - Set attn_window\n */\n\n async setAttnWindow(params: LingbotWorld2SetAttnWindowParams): Promise<void> {\n await this.sendCommand(\"set_attn_window\", params);\n }\n\n /**\n * Set camera_pose\n * @param params - Set camera_pose\n */\n\n async setCameraPose(params: LingbotWorld2SetCameraPoseParams): Promise<void> {\n await this.sendCommand(\"set_camera_pose\", params);\n }\n\n /**\n * Set move_lateral\n * @param params - Set move_lateral\n */\n\n async setMoveLateral(params: LingbotWorld2SetMoveLateralParams): Promise<void> {\n await this.sendCommand(\"set_move_lateral\", params);\n }\n\n /**\n * Set look_vertical\n * @param params - Set look_vertical\n */\n\n async setLookVertical(params: LingbotWorld2SetLookVerticalParams): Promise<void> {\n await this.sendCommand(\"set_look_vertical\", params);\n }\n\n /**\n * Set look_horizontal\n * @param params - Set look_horizontal\n */\n\n async setLookHorizontal(params: LingbotWorld2SetLookHorizontalParams): Promise<void> {\n await this.sendCommand(\"set_look_horizontal\", params);\n }\n\n /**\n * Set move_longitudinal\n * @param params - Set move_longitudinal\n */\n\n async setMoveLongitudinal(params: LingbotWorld2SetMoveLongitudinalParams): Promise<void> {\n await this.sendCommand(\"set_move_longitudinal\", params);\n }\n\n /**\n * Set rotation_speed_deg\n * @param params - Set rotation_speed_deg\n */\n\n async setRotationSpeedDeg(params: LingbotWorld2SetRotationSpeedDegParams): Promise<void> {\n await this.sendCommand(\"set_rotation_speed_deg\", params);\n }\n\n /**\n * Subscribe to typed model messages.\n * @param handler - Called with a discriminated LingbotWorld2Message\n * @returns Unsubscribe function\n */\n\n onMessage(handler: (message: LingbotWorld2Message) => void): () => void {\n const wrappedHandler = (raw: unknown) => {\n handler(_unwrapMessage<LingbotWorld2Message>(raw));\n };\n this.on(\"message\", wrappedHandler);\n return () => this.off(\"message\", wrappedHandler);\n }\n\n /**\n * Subscribe to \"state\" messages only.\n * @returns Unsubscribe function\n */\n\n onState(handler: (message: LingbotWorld2StateMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"state\") handler(msg as LingbotWorld2StateMessage);\n });\n }\n\n /**\n * Subscribe to \"command_error\" messages only.\n * @returns Unsubscribe function\n */\n\n onCommandError(handler: (message: LingbotWorld2CommandErrorMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"command_error\") handler(msg as LingbotWorld2CommandErrorMessage);\n });\n }\n\n /**\n * Subscribe to \"chunk_complete\" messages only.\n * @returns Unsubscribe function\n */\n\n onChunkComplete(handler: (message: LingbotWorld2ChunkCompleteMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"chunk_complete\") handler(msg as LingbotWorld2ChunkCompleteMessage);\n });\n }\n\n /**\n * Subscribe to \"image_accepted\" messages only.\n * @returns Unsubscribe function\n */\n\n onImageAccepted(handler: (message: LingbotWorld2ImageAcceptedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"image_accepted\") handler(msg as LingbotWorld2ImageAcceptedMessage);\n });\n }\n\n /**\n * Subscribe to \"prompt_accepted\" messages only.\n * @returns Unsubscribe function\n */\n\n onPromptAccepted(handler: (message: LingbotWorld2PromptAcceptedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"prompt_accepted\") handler(msg as LingbotWorld2PromptAcceptedMessage);\n });\n }\n\n /**\n * Subscribe to \"conditions_ready\" messages only.\n * @returns Unsubscribe function\n */\n\n onConditionsReady(handler: (message: LingbotWorld2ConditionsReadyMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"conditions_ready\") handler(msg as LingbotWorld2ConditionsReadyMessage);\n });\n }\n\n /**\n * Subscribe to \"generation_reset\" messages only.\n * @returns Unsubscribe function\n */\n\n onGenerationReset(handler: (message: LingbotWorld2GenerationResetMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"generation_reset\") handler(msg as LingbotWorld2GenerationResetMessage);\n });\n }\n\n /**\n * Subscribe to \"generation_paused\" messages only.\n * @returns Unsubscribe function\n */\n\n onGenerationPaused(handler: (message: LingbotWorld2GenerationPausedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"generation_paused\") handler(msg as LingbotWorld2GenerationPausedMessage);\n });\n }\n\n /**\n * Subscribe to \"generation_resumed\" messages only.\n * @returns Unsubscribe function\n */\n\n onGenerationResumed(handler: (message: LingbotWorld2GenerationResumedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"generation_resumed\") handler(msg as LingbotWorld2GenerationResumedMessage);\n });\n }\n\n /**\n * Subscribe to \"generation_started\" messages only.\n * @returns Unsubscribe function\n */\n\n onGenerationStarted(handler: (message: LingbotWorld2GenerationStartedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"generation_started\") handler(msg as LingbotWorld2GenerationStartedMessage);\n });\n }\n\n /**\n * Subscribe to \"generation_complete\" messages only.\n * @returns Unsubscribe function\n */\n\n onGenerationComplete(handler: (message: LingbotWorld2GenerationCompleteMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"generation_complete\") handler(msg as LingbotWorld2GenerationCompleteMessage);\n });\n }\n\n /**\n * Subscribe to the \"main_video\" recvonly video track the model publishes.\n *\n * The handler fires once the model starts publishing this track; it receives the live MediaStreamTrack and the parent MediaStream (useful for attaching to a `<video>` / `<audio>` element via `srcObject`).\n * @param handler - Called with the received track and its stream\n * @returns Unsubscribe function\n */\n\n onMainVideo(\n handler: (track: MediaStreamTrack, stream: MediaStream) => void,\n ): () => void {\n const wrapped = (name: string, t: MediaStreamTrack, s: MediaStream) => {\n if (name === \"main_video\") handler(t, s);\n };\n this.on(\"trackReceived\", wrapped);\n return () => this.off(\"trackReceived\", wrapped);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,IAAAA,iBAMO;;;ACTP,oBAAiC;AAG1B,IAAM,aAAa;AAUnB,IAAM,sBAAsB;AAAA,EACjC,EAAE,MAAM,cAAc,MAAM,SAAS,WAAW,WAAW;AAC7D;;;ADkEI;AApCJ,SAAS,eAAkB,KAAiB;AAC1C,QAAM,MAAM;AACZ,MACE,OACA,OAAO,QAAQ,YACf,IAAI,QACJ,OAAO,IAAI,SAAS,UACpB;AACA,WAAO,EAAE,GAAG,IAAI,MAAM,MAAM,IAAI,KAAK;AAAA,EACvC;AACA,SAAO;AACT;AAoBO,SAAS,sBAAsB;AAAA,EACpC;AAAA,EACA,GAAG;AACL,GAA6C;AAC3C,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,MACX,aAAa,CAAC,GAAG,mBAAmB;AAAA,MAEnC;AAAA;AAAA,EACH;AAEJ;AAoBO,SAAS,mBAAmB;AACjC,QAAM,cAAU,2BAAW,CAAC,MAAM,EAAE,OAAO;AAC3C,QAAM,qBAAiB,2BAAW,CAAC,MAAM,EAAE,cAAc;AACzD,QAAM,i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ASO,SAAS,2BACd,OACc;AACd,SAAO,4CAAC,8BAAa,GAAG,OAAO,OAAM,cAAa;AACpD;","names":["import_js_sdk"]}
|
package/dist/react.mjs
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
LingbotWorld2MainVideoView,
|
|
4
|
+
LingbotWorld2Provider,
|
|
5
|
+
useLingbotWorld2,
|
|
6
|
+
useLingbotWorld2ChunkComplete,
|
|
7
|
+
useLingbotWorld2CommandError,
|
|
8
|
+
useLingbotWorld2ConditionsReady,
|
|
9
|
+
useLingbotWorld2GenerationComplete,
|
|
10
|
+
useLingbotWorld2GenerationPaused,
|
|
11
|
+
useLingbotWorld2GenerationReset,
|
|
12
|
+
useLingbotWorld2GenerationResumed,
|
|
13
|
+
useLingbotWorld2GenerationStarted,
|
|
14
|
+
useLingbotWorld2ImageAccepted,
|
|
15
|
+
useLingbotWorld2Message,
|
|
16
|
+
useLingbotWorld2PromptAccepted,
|
|
17
|
+
useLingbotWorld2State,
|
|
18
|
+
useLingbotWorld2Track
|
|
19
|
+
} from "./chunk-NTXVRMPF.mjs";
|
|
20
|
+
import "./chunk-GS3BM4VC.mjs";
|
|
21
|
+
export {
|
|
22
|
+
LingbotWorld2MainVideoView,
|
|
23
|
+
LingbotWorld2Provider,
|
|
24
|
+
useLingbotWorld2,
|
|
25
|
+
useLingbotWorld2ChunkComplete,
|
|
26
|
+
useLingbotWorld2CommandError,
|
|
27
|
+
useLingbotWorld2ConditionsReady,
|
|
28
|
+
useLingbotWorld2GenerationComplete,
|
|
29
|
+
useLingbotWorld2GenerationPaused,
|
|
30
|
+
useLingbotWorld2GenerationReset,
|
|
31
|
+
useLingbotWorld2GenerationResumed,
|
|
32
|
+
useLingbotWorld2GenerationStarted,
|
|
33
|
+
useLingbotWorld2ImageAccepted,
|
|
34
|
+
useLingbotWorld2Message,
|
|
35
|
+
useLingbotWorld2PromptAccepted,
|
|
36
|
+
useLingbotWorld2State,
|
|
37
|
+
useLingbotWorld2Track
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=react.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@reactor-models/lingbot-world-2",
|
|
3
|
+
"version": "0.2.5",
|
|
4
|
+
"description": "Strongly-typed SDK for the LingbotWorld2 model on Reactor",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./core": {
|
|
15
|
+
"types": "./dist/core.d.ts",
|
|
16
|
+
"import": "./dist/core.mjs",
|
|
17
|
+
"require": "./dist/core.js"
|
|
18
|
+
},
|
|
19
|
+
"./react": {
|
|
20
|
+
"types": "./dist/react.d.ts",
|
|
21
|
+
"import": "./dist/react.mjs",
|
|
22
|
+
"require": "./dist/react.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"README.md"
|
|
28
|
+
],
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsup"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@reactor-team/js-sdk": "^2.12.0"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"react": ">=18"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"tsup": "^8.5.0",
|
|
40
|
+
"typescript": "^5.8.3",
|
|
41
|
+
"@types/react": "^18.0.0",
|
|
42
|
+
"react": "^18.0.0"
|
|
43
|
+
},
|
|
44
|
+
"keywords": [
|
|
45
|
+
"reactor",
|
|
46
|
+
"lingbot-world-2",
|
|
47
|
+
"sdk",
|
|
48
|
+
"typed",
|
|
49
|
+
"react",
|
|
50
|
+
"hooks"
|
|
51
|
+
],
|
|
52
|
+
"author": "Reactor Technologies, Inc.",
|
|
53
|
+
"license": "MIT"
|
|
54
|
+
}
|