@reactor-models/lingbot 0.2.18 → 0.2.21
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 +26 -26
- package/dist/chunk-EKR35MYC.mjs +194 -0
- package/dist/chunk-EKR35MYC.mjs.map +1 -0
- package/dist/chunk-NPVC6SYP.mjs +226 -0
- package/dist/chunk-NPVC6SYP.mjs.map +1 -0
- package/dist/core.d.mts +326 -0
- package/dist/core.d.ts +326 -0
- package/dist/core.js +254 -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 +3 -450
- package/dist/index.d.ts +3 -450
- package/dist/index.js +190 -194
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -393
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +143 -0
- package/dist/react.d.ts +143 -0
- package/dist/react.js +233 -0
- package/dist/react.js.map +1 -0
- package/dist/react.mjs +39 -0
- package/dist/react.mjs.map +1 -0
- package/package.json +11 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @reactor-models/lingbot
|
|
2
2
|
|
|
3
|
-
> Typed JavaScript + React SDK for the **Lingbot** model on [Reactor](https://reactor.inc). Version **v0.2.
|
|
3
|
+
> Typed JavaScript + React SDK for the **Lingbot** model on [Reactor](https://reactor.inc). Version **v0.2.21**.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -24,7 +24,7 @@ import { LingbotModel } from "@reactor-models/lingbot";
|
|
|
24
24
|
import { LingbotProvider, useLingbot } from "@reactor-models/lingbot";
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
React 18 or later is required when using the provider and hooks.
|
|
27
|
+
React 18 or later is required when using the provider and hooks. The token-loading examples below use [React 19's `use()`](https://react.dev/reference/react/use); on React 18, fetch the JWT in a `useEffect` and pass it to the provider once it resolves.
|
|
28
28
|
|
|
29
29
|
---
|
|
30
30
|
|
|
@@ -56,23 +56,23 @@ Call the `/api/reactor/token` route above from a client component and pass the r
|
|
|
56
56
|
|
|
57
57
|
```tsx
|
|
58
58
|
"use client";
|
|
59
|
-
|
|
59
|
+
|
|
60
|
+
import { use } from "react";
|
|
60
61
|
import { LingbotProvider } from "@reactor-models/lingbot";
|
|
61
62
|
import { ReactorView } from "@reactor-team/js-sdk";
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
.then((r) => r.json())
|
|
69
|
-
.then((d) => setJwt(d.jwt));
|
|
70
|
-
}, []);
|
|
64
|
+
async function getToken() {
|
|
65
|
+
const r = await fetch("/api/reactor/token", { method: "POST" });
|
|
66
|
+
const { jwt } = await r.json();
|
|
67
|
+
return jwt;
|
|
68
|
+
}
|
|
71
69
|
|
|
72
|
-
|
|
70
|
+
const tokenPromise = getToken();
|
|
73
71
|
|
|
72
|
+
export default function App() {
|
|
73
|
+
const token = use(tokenPromise);
|
|
74
74
|
return (
|
|
75
|
-
<LingbotProvider jwtToken={
|
|
75
|
+
<LingbotProvider jwtToken={token} connectOptions={{ autoConnect: true }}>
|
|
76
76
|
<ReactorView className="w-full aspect-video" />
|
|
77
77
|
</LingbotProvider>
|
|
78
78
|
);
|
|
@@ -94,31 +94,31 @@ await lingbot.connect(jwt);
|
|
|
94
94
|
|
|
95
95
|
### React
|
|
96
96
|
|
|
97
|
-
The provider takes the JWT as a prop; fetch it from the same `/api/reactor/token` route the Authenticate example mints
|
|
97
|
+
The provider takes the JWT as a prop; fetch it from the same `/api/reactor/token` route the Authenticate example mints:
|
|
98
98
|
|
|
99
99
|
```tsx
|
|
100
100
|
"use client";
|
|
101
|
-
|
|
101
|
+
|
|
102
|
+
import { use } from "react";
|
|
102
103
|
import { LingbotProvider, useLingbot } from "@reactor-models/lingbot";
|
|
103
104
|
|
|
105
|
+
async function getToken() {
|
|
106
|
+
const r = await fetch("/api/reactor/token", { method: "POST" });
|
|
107
|
+
const { jwt } = await r.json();
|
|
108
|
+
return jwt;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const tokenPromise = getToken();
|
|
112
|
+
|
|
104
113
|
function Controller() {
|
|
105
114
|
const { status } = useLingbot();
|
|
106
115
|
return <span>Status: {status}</span>;
|
|
107
116
|
}
|
|
108
117
|
|
|
109
118
|
export default function App() {
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
useEffect(() => {
|
|
113
|
-
fetch("/api/reactor/token", { method: "POST" })
|
|
114
|
-
.then((r) => r.json())
|
|
115
|
-
.then((d) => setJwt(d.jwt));
|
|
116
|
-
}, []);
|
|
117
|
-
|
|
118
|
-
if (!jwt) return null;
|
|
119
|
-
|
|
119
|
+
const token = use(tokenPromise);
|
|
120
120
|
return (
|
|
121
|
-
<LingbotProvider jwtToken={
|
|
121
|
+
<LingbotProvider jwtToken={token}>
|
|
122
122
|
<Controller />
|
|
123
123
|
</LingbotProvider>
|
|
124
124
|
);
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LingbotTracks,
|
|
3
|
+
MODEL_NAME
|
|
4
|
+
} from "./chunk-NPVC6SYP.mjs";
|
|
5
|
+
|
|
6
|
+
// src/react.tsx
|
|
7
|
+
import {
|
|
8
|
+
ReactorProvider,
|
|
9
|
+
useReactor,
|
|
10
|
+
useReactorMessage,
|
|
11
|
+
ReactorView
|
|
12
|
+
} from "@reactor-team/js-sdk";
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
function _unwrapMessage(raw) {
|
|
15
|
+
const env = raw;
|
|
16
|
+
if (env && typeof env === "object" && env.data && typeof env.data === "object") {
|
|
17
|
+
return { ...env.data, type: env.type };
|
|
18
|
+
}
|
|
19
|
+
return raw;
|
|
20
|
+
}
|
|
21
|
+
function LingbotProvider({
|
|
22
|
+
children,
|
|
23
|
+
...rest
|
|
24
|
+
}) {
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
ReactorProvider,
|
|
27
|
+
{
|
|
28
|
+
...rest,
|
|
29
|
+
modelName: MODEL_NAME,
|
|
30
|
+
modelTracks: [...LingbotTracks],
|
|
31
|
+
children
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
function useLingbot() {
|
|
36
|
+
const connect = useReactor((s) => s.connect);
|
|
37
|
+
const disconnect = useReactor((s) => s.disconnect);
|
|
38
|
+
const jwtToken = useReactor((s) => s.jwtToken);
|
|
39
|
+
const lastError = useReactor((s) => s.lastError);
|
|
40
|
+
const publish = useReactor((s) => s.publish);
|
|
41
|
+
const reconnect = useReactor((s) => s.reconnect);
|
|
42
|
+
const sendCommand = useReactor((s) => s.sendCommand);
|
|
43
|
+
const sessionExpiration = useReactor((s) => s.sessionExpiration);
|
|
44
|
+
const sessionId = useReactor((s) => s.sessionId);
|
|
45
|
+
const status = useReactor((s) => s.status);
|
|
46
|
+
const tracks = useReactor((s) => s.tracks);
|
|
47
|
+
const unpublish = useReactor((s) => s.unpublish);
|
|
48
|
+
const uploadFile = useReactor((s) => s.uploadFile);
|
|
49
|
+
return {
|
|
50
|
+
connect,
|
|
51
|
+
disconnect,
|
|
52
|
+
jwtToken,
|
|
53
|
+
lastError,
|
|
54
|
+
publish,
|
|
55
|
+
reconnect,
|
|
56
|
+
sendCommand,
|
|
57
|
+
sessionExpiration,
|
|
58
|
+
sessionId,
|
|
59
|
+
status,
|
|
60
|
+
tracks,
|
|
61
|
+
unpublish,
|
|
62
|
+
uploadFile,
|
|
63
|
+
pause: () => sendCommand("pause", {}),
|
|
64
|
+
reset: () => sendCommand("reset", {}),
|
|
65
|
+
start: () => sendCommand("start", {}),
|
|
66
|
+
resume: () => sendCommand("resume", {}),
|
|
67
|
+
setSeed: (params) => sendCommand("set_seed", params),
|
|
68
|
+
setImage: (params) => sendCommand("set_image", params),
|
|
69
|
+
setPrompt: (params) => sendCommand("set_prompt", params),
|
|
70
|
+
setMovement: (params) => sendCommand("set_movement", params),
|
|
71
|
+
setLookVertical: (params) => sendCommand("set_look_vertical", params),
|
|
72
|
+
setLookHorizontal: (params) => sendCommand("set_look_horizontal", params),
|
|
73
|
+
setRotationSpeedDeg: (params) => sendCommand("set_rotation_speed_deg", params)
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function useLingbotMessage(handler) {
|
|
77
|
+
useReactorMessage(
|
|
78
|
+
(msg) => handler(_unwrapMessage(msg))
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
function useLingbotState(handler) {
|
|
82
|
+
useReactorMessage((msg) => {
|
|
83
|
+
const m = _unwrapMessage(msg);
|
|
84
|
+
if (m.type === "state") {
|
|
85
|
+
handler(m);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function useLingbotCommandError(handler) {
|
|
90
|
+
useReactorMessage((msg) => {
|
|
91
|
+
const m = _unwrapMessage(msg);
|
|
92
|
+
if (m.type === "command_error") {
|
|
93
|
+
handler(m);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function useLingbotChunkComplete(handler) {
|
|
98
|
+
useReactorMessage((msg) => {
|
|
99
|
+
const m = _unwrapMessage(msg);
|
|
100
|
+
if (m.type === "chunk_complete") {
|
|
101
|
+
handler(m);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function useLingbotImageAccepted(handler) {
|
|
106
|
+
useReactorMessage((msg) => {
|
|
107
|
+
const m = _unwrapMessage(msg);
|
|
108
|
+
if (m.type === "image_accepted") {
|
|
109
|
+
handler(m);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function useLingbotPromptAccepted(handler) {
|
|
114
|
+
useReactorMessage((msg) => {
|
|
115
|
+
const m = _unwrapMessage(msg);
|
|
116
|
+
if (m.type === "prompt_accepted") {
|
|
117
|
+
handler(m);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function useLingbotConditionsReady(handler) {
|
|
122
|
+
useReactorMessage((msg) => {
|
|
123
|
+
const m = _unwrapMessage(msg);
|
|
124
|
+
if (m.type === "conditions_ready") {
|
|
125
|
+
handler(m);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function useLingbotGenerationReset(handler) {
|
|
130
|
+
useReactorMessage((msg) => {
|
|
131
|
+
const m = _unwrapMessage(msg);
|
|
132
|
+
if (m.type === "generation_reset") {
|
|
133
|
+
handler(m);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
function useLingbotGenerationPaused(handler) {
|
|
138
|
+
useReactorMessage((msg) => {
|
|
139
|
+
const m = _unwrapMessage(msg);
|
|
140
|
+
if (m.type === "generation_paused") {
|
|
141
|
+
handler(m);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
function useLingbotGenerationResumed(handler) {
|
|
146
|
+
useReactorMessage((msg) => {
|
|
147
|
+
const m = _unwrapMessage(msg);
|
|
148
|
+
if (m.type === "generation_resumed") {
|
|
149
|
+
handler(m);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function useLingbotGenerationStarted(handler) {
|
|
154
|
+
useReactorMessage((msg) => {
|
|
155
|
+
const m = _unwrapMessage(msg);
|
|
156
|
+
if (m.type === "generation_started") {
|
|
157
|
+
handler(m);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
function useLingbotGenerationComplete(handler) {
|
|
162
|
+
useReactorMessage((msg) => {
|
|
163
|
+
const m = _unwrapMessage(msg);
|
|
164
|
+
if (m.type === "generation_complete") {
|
|
165
|
+
handler(m);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
function useLingbotTrack(name) {
|
|
170
|
+
return useReactor((s) => s.tracks[name]);
|
|
171
|
+
}
|
|
172
|
+
function LingbotMainVideoView(props) {
|
|
173
|
+
return /* @__PURE__ */ jsx(ReactorView, { ...props, track: "main_video" });
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export {
|
|
177
|
+
LingbotProvider,
|
|
178
|
+
useLingbot,
|
|
179
|
+
useLingbotMessage,
|
|
180
|
+
useLingbotState,
|
|
181
|
+
useLingbotCommandError,
|
|
182
|
+
useLingbotChunkComplete,
|
|
183
|
+
useLingbotImageAccepted,
|
|
184
|
+
useLingbotPromptAccepted,
|
|
185
|
+
useLingbotConditionsReady,
|
|
186
|
+
useLingbotGenerationReset,
|
|
187
|
+
useLingbotGenerationPaused,
|
|
188
|
+
useLingbotGenerationResumed,
|
|
189
|
+
useLingbotGenerationStarted,
|
|
190
|
+
useLingbotGenerationComplete,
|
|
191
|
+
useLingbotTrack,
|
|
192
|
+
LingbotMainVideoView
|
|
193
|
+
};
|
|
194
|
+
//# sourceMappingURL=chunk-EKR35MYC.mjs.map
|
|
@@ -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: lingbot v0.2.21\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 LingbotTracks,\n type LingbotOptions,\n type LingbotSetSeedParams,\n type LingbotSetImageParams,\n type LingbotSetPromptParams,\n type LingbotSetMovementParams,\n type LingbotSetLookVerticalParams,\n type LingbotSetLookHorizontalParams,\n type LingbotSetRotationSpeedDegParams,\n type LingbotMessage,\n type LingbotStateMessage,\n type LingbotCommandErrorMessage,\n type LingbotChunkCompleteMessage,\n type LingbotImageAcceptedMessage,\n type LingbotPromptAcceptedMessage,\n type LingbotConditionsReadyMessage,\n type LingbotGenerationResetMessage,\n type LingbotGenerationPausedMessage,\n type LingbotGenerationResumedMessage,\n type LingbotGenerationStartedMessage,\n type LingbotGenerationCompleteMessage,\n type LingbotRecvTrackName,\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 LingbotProvider} component.\n *\n * Derived from `ReactorProvider`'s own props, with `modelName` and\n * `modelTracks` stripped — those are supplied by this provider.\n */\nexport type LingbotProviderProps = Omit<\n Parameters<typeof ReactorProvider>[0],\n \"modelName\" | \"modelTracks\"\n>;\n\n/**\n * Provider for the Lingbot 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 useLingbot} and the `useLingbot<Message>` hooks below it.\n */\nexport function LingbotProvider({\n children,\n ...rest\n}: LingbotProviderProps): ReactElement {\n return (\n <ReactorProvider\n {...rest}\n modelName={MODEL_NAME}\n modelTracks={[...LingbotTracks]}\n >\n {children}\n </ReactorProvider>\n );\n}\n\n/**\n * Access the Lingbot model as typed commands bound to the nearest\n * {@link LingbotProvider}.\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 useLingbot() {\n const connect = useReactor((s) => s.connect);\n const disconnect = useReactor((s) => s.disconnect);\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 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 disconnect,\n jwtToken,\n lastError,\n publish,\n reconnect,\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: LingbotSetSeedParams): Promise<void> =>\n sendCommand(\"set_seed\", params),\n setImage: (params: LingbotSetImageParams): Promise<void> =>\n sendCommand(\"set_image\", params),\n setPrompt: (params: LingbotSetPromptParams): Promise<void> =>\n sendCommand(\"set_prompt\", params),\n setMovement: (params: LingbotSetMovementParams): Promise<void> =>\n sendCommand(\"set_movement\", params),\n setLookVertical: (params: LingbotSetLookVerticalParams): Promise<void> =>\n sendCommand(\"set_look_vertical\", params),\n setLookHorizontal: (params: LingbotSetLookHorizontalParams): Promise<void> =>\n sendCommand(\"set_look_horizontal\", params),\n setRotationSpeedDeg: (params: LingbotSetRotationSpeedDegParams): Promise<void> =>\n sendCommand(\"set_rotation_speed_deg\", params),\n };\n}\n\n/**\n * Subscribe to any Lingbot message with a fully-typed handler.\n * The handler receives a discriminated LingbotMessage.\n */\nexport function useLingbotMessage(\n handler: (message: LingbotMessage) => void,\n): void {\n useReactorMessage((msg: unknown) =>\n handler(_unwrapMessage<LingbotMessage>(msg)),\n );\n}\n\n/**\n * Subscribe to \"state\" messages only.\n * Handler receives a fully-typed LingbotStateMessage.\n */\nexport function useLingbotState(\n handler: (message: LingbotStateMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotMessage>(msg);\n if (m.type === \"state\") {\n handler(m as LingbotStateMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"command_error\" messages only.\n * Handler receives a fully-typed LingbotCommandErrorMessage.\n */\nexport function useLingbotCommandError(\n handler: (message: LingbotCommandErrorMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotMessage>(msg);\n if (m.type === \"command_error\") {\n handler(m as LingbotCommandErrorMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"chunk_complete\" messages only.\n * Handler receives a fully-typed LingbotChunkCompleteMessage.\n */\nexport function useLingbotChunkComplete(\n handler: (message: LingbotChunkCompleteMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotMessage>(msg);\n if (m.type === \"chunk_complete\") {\n handler(m as LingbotChunkCompleteMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"image_accepted\" messages only.\n * Handler receives a fully-typed LingbotImageAcceptedMessage.\n */\nexport function useLingbotImageAccepted(\n handler: (message: LingbotImageAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotMessage>(msg);\n if (m.type === \"image_accepted\") {\n handler(m as LingbotImageAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"prompt_accepted\" messages only.\n * Handler receives a fully-typed LingbotPromptAcceptedMessage.\n */\nexport function useLingbotPromptAccepted(\n handler: (message: LingbotPromptAcceptedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotMessage>(msg);\n if (m.type === \"prompt_accepted\") {\n handler(m as LingbotPromptAcceptedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"conditions_ready\" messages only.\n * Handler receives a fully-typed LingbotConditionsReadyMessage.\n */\nexport function useLingbotConditionsReady(\n handler: (message: LingbotConditionsReadyMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotMessage>(msg);\n if (m.type === \"conditions_ready\") {\n handler(m as LingbotConditionsReadyMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"generation_reset\" messages only.\n * Handler receives a fully-typed LingbotGenerationResetMessage.\n */\nexport function useLingbotGenerationReset(\n handler: (message: LingbotGenerationResetMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotMessage>(msg);\n if (m.type === \"generation_reset\") {\n handler(m as LingbotGenerationResetMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"generation_paused\" messages only.\n * Handler receives a fully-typed LingbotGenerationPausedMessage.\n */\nexport function useLingbotGenerationPaused(\n handler: (message: LingbotGenerationPausedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotMessage>(msg);\n if (m.type === \"generation_paused\") {\n handler(m as LingbotGenerationPausedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"generation_resumed\" messages only.\n * Handler receives a fully-typed LingbotGenerationResumedMessage.\n */\nexport function useLingbotGenerationResumed(\n handler: (message: LingbotGenerationResumedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotMessage>(msg);\n if (m.type === \"generation_resumed\") {\n handler(m as LingbotGenerationResumedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"generation_started\" messages only.\n * Handler receives a fully-typed LingbotGenerationStartedMessage.\n */\nexport function useLingbotGenerationStarted(\n handler: (message: LingbotGenerationStartedMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotMessage>(msg);\n if (m.type === \"generation_started\") {\n handler(m as LingbotGenerationStartedMessage);\n }\n });\n}\n\n/**\n * Subscribe to \"generation_complete\" messages only.\n * Handler receives a fully-typed LingbotGenerationCompleteMessage.\n */\nexport function useLingbotGenerationComplete(\n handler: (message: LingbotGenerationCompleteMessage) => void,\n): void {\n useReactorMessage((msg: unknown) => {\n const m = _unwrapMessage<LingbotMessage>(msg);\n if (m.type === \"generation_complete\") {\n handler(m as LingbotGenerationCompleteMessage);\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 `LingbotRecvTrackName`.\n * @param name - A recvonly track name declared by the model\n * @returns The live MediaStreamTrack, or `undefined` until received\n */\nexport function useLingbotTrack(\n name: LingbotRecvTrackName,\n): MediaStreamTrack | undefined {\n return useReactor((s) => s.tracks[name]);\n}\n\nexport type LingbotMainVideoViewProps = 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 `<LingbotProvider>`.\n */\nexport function LingbotMainVideoView(\n props: LingbotMainVideoViewProps,\n): ReactElement {\n return <ReactorView {...props} track=\"main_video\" />;\n}\n"],"mappings":";;;;;;AAQA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAqEH;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,gBAAgB;AAAA,EAC9B;AAAA,EACA,GAAG;AACL,GAAuC;AACrC,SACE;AAAA,IAAC;AAAA;AAAA,MACE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|
|
3
|
+
var MODEL_NAME = "lingbot";
|
|
4
|
+
var MODEL_VERSION = "v0.2.21";
|
|
5
|
+
var LingbotTracks = [
|
|
6
|
+
{ name: "main_video", kind: "video", direction: "recvonly" }
|
|
7
|
+
];
|
|
8
|
+
function _unwrapMessage(raw) {
|
|
9
|
+
const env = raw;
|
|
10
|
+
if (env && typeof env === "object" && env.data && typeof env.data === "object") {
|
|
11
|
+
return { ...env.data, type: env.type };
|
|
12
|
+
}
|
|
13
|
+
return raw;
|
|
14
|
+
}
|
|
15
|
+
var LingbotModel = class extends Reactor {
|
|
16
|
+
constructor(options) {
|
|
17
|
+
super({
|
|
18
|
+
...options,
|
|
19
|
+
modelName: MODEL_NAME,
|
|
20
|
+
modelTracks: [...LingbotTracks]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/** @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. */
|
|
24
|
+
get reactor() {
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
/** 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. */
|
|
28
|
+
async pause() {
|
|
29
|
+
await this.sendCommand("pause", {});
|
|
30
|
+
}
|
|
31
|
+
/** 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`. */
|
|
32
|
+
async reset() {
|
|
33
|
+
await this.sendCommand("reset", {});
|
|
34
|
+
}
|
|
35
|
+
/** 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. */
|
|
36
|
+
async start() {
|
|
37
|
+
await this.sendCommand("start", {});
|
|
38
|
+
}
|
|
39
|
+
/** 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. */
|
|
40
|
+
async resume() {
|
|
41
|
+
await this.sendCommand("resume", {});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Set seed
|
|
45
|
+
* @param params - Set seed
|
|
46
|
+
*/
|
|
47
|
+
async setSeed(params) {
|
|
48
|
+
await this.sendCommand("set_seed", params);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* 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.
|
|
52
|
+
* @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.
|
|
53
|
+
*/
|
|
54
|
+
async setImage(params) {
|
|
55
|
+
await this.sendCommand("set_image", params);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* 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.
|
|
59
|
+
* @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.
|
|
60
|
+
*/
|
|
61
|
+
async setPrompt(params) {
|
|
62
|
+
await this.sendCommand("set_prompt", params);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Set movement
|
|
66
|
+
* @param params - Set movement
|
|
67
|
+
*/
|
|
68
|
+
async setMovement(params) {
|
|
69
|
+
await this.sendCommand("set_movement", params);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Set look_vertical
|
|
73
|
+
* @param params - Set look_vertical
|
|
74
|
+
*/
|
|
75
|
+
async setLookVertical(params) {
|
|
76
|
+
await this.sendCommand("set_look_vertical", params);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Set look_horizontal
|
|
80
|
+
* @param params - Set look_horizontal
|
|
81
|
+
*/
|
|
82
|
+
async setLookHorizontal(params) {
|
|
83
|
+
await this.sendCommand("set_look_horizontal", params);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Set rotation_speed_deg
|
|
87
|
+
* @param params - Set rotation_speed_deg
|
|
88
|
+
*/
|
|
89
|
+
async setRotationSpeedDeg(params) {
|
|
90
|
+
await this.sendCommand("set_rotation_speed_deg", params);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Subscribe to typed model messages.
|
|
94
|
+
* @param handler - Called with a discriminated LingbotMessage
|
|
95
|
+
* @returns Unsubscribe function
|
|
96
|
+
*/
|
|
97
|
+
onMessage(handler) {
|
|
98
|
+
const wrappedHandler = (raw) => {
|
|
99
|
+
handler(_unwrapMessage(raw));
|
|
100
|
+
};
|
|
101
|
+
this.on("message", wrappedHandler);
|
|
102
|
+
return () => this.off("message", wrappedHandler);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Subscribe to "state" messages only.
|
|
106
|
+
* @returns Unsubscribe function
|
|
107
|
+
*/
|
|
108
|
+
onState(handler) {
|
|
109
|
+
return this.onMessage((msg) => {
|
|
110
|
+
if (msg.type === "state") handler(msg);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Subscribe to "command_error" messages only.
|
|
115
|
+
* @returns Unsubscribe function
|
|
116
|
+
*/
|
|
117
|
+
onCommandError(handler) {
|
|
118
|
+
return this.onMessage((msg) => {
|
|
119
|
+
if (msg.type === "command_error") handler(msg);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Subscribe to "chunk_complete" messages only.
|
|
124
|
+
* @returns Unsubscribe function
|
|
125
|
+
*/
|
|
126
|
+
onChunkComplete(handler) {
|
|
127
|
+
return this.onMessage((msg) => {
|
|
128
|
+
if (msg.type === "chunk_complete") handler(msg);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Subscribe to "image_accepted" messages only.
|
|
133
|
+
* @returns Unsubscribe function
|
|
134
|
+
*/
|
|
135
|
+
onImageAccepted(handler) {
|
|
136
|
+
return this.onMessage((msg) => {
|
|
137
|
+
if (msg.type === "image_accepted") handler(msg);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Subscribe to "prompt_accepted" messages only.
|
|
142
|
+
* @returns Unsubscribe function
|
|
143
|
+
*/
|
|
144
|
+
onPromptAccepted(handler) {
|
|
145
|
+
return this.onMessage((msg) => {
|
|
146
|
+
if (msg.type === "prompt_accepted") handler(msg);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Subscribe to "conditions_ready" messages only.
|
|
151
|
+
* @returns Unsubscribe function
|
|
152
|
+
*/
|
|
153
|
+
onConditionsReady(handler) {
|
|
154
|
+
return this.onMessage((msg) => {
|
|
155
|
+
if (msg.type === "conditions_ready") handler(msg);
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Subscribe to "generation_reset" messages only.
|
|
160
|
+
* @returns Unsubscribe function
|
|
161
|
+
*/
|
|
162
|
+
onGenerationReset(handler) {
|
|
163
|
+
return this.onMessage((msg) => {
|
|
164
|
+
if (msg.type === "generation_reset") handler(msg);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Subscribe to "generation_paused" messages only.
|
|
169
|
+
* @returns Unsubscribe function
|
|
170
|
+
*/
|
|
171
|
+
onGenerationPaused(handler) {
|
|
172
|
+
return this.onMessage((msg) => {
|
|
173
|
+
if (msg.type === "generation_paused") handler(msg);
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Subscribe to "generation_resumed" messages only.
|
|
178
|
+
* @returns Unsubscribe function
|
|
179
|
+
*/
|
|
180
|
+
onGenerationResumed(handler) {
|
|
181
|
+
return this.onMessage((msg) => {
|
|
182
|
+
if (msg.type === "generation_resumed") handler(msg);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Subscribe to "generation_started" messages only.
|
|
187
|
+
* @returns Unsubscribe function
|
|
188
|
+
*/
|
|
189
|
+
onGenerationStarted(handler) {
|
|
190
|
+
return this.onMessage((msg) => {
|
|
191
|
+
if (msg.type === "generation_started") handler(msg);
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Subscribe to "generation_complete" messages only.
|
|
196
|
+
* @returns Unsubscribe function
|
|
197
|
+
*/
|
|
198
|
+
onGenerationComplete(handler) {
|
|
199
|
+
return this.onMessage((msg) => {
|
|
200
|
+
if (msg.type === "generation_complete") handler(msg);
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Subscribe to the "main_video" recvonly video track the model publishes.
|
|
205
|
+
*
|
|
206
|
+
* 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`).
|
|
207
|
+
* @param handler - Called with the received track and its stream
|
|
208
|
+
* @returns Unsubscribe function
|
|
209
|
+
*/
|
|
210
|
+
onMainVideo(handler) {
|
|
211
|
+
const wrapped = (name, t, s) => {
|
|
212
|
+
if (name === "main_video") handler(t, s);
|
|
213
|
+
};
|
|
214
|
+
this.on("trackReceived", wrapped);
|
|
215
|
+
return () => this.off("trackReceived", wrapped);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
export {
|
|
220
|
+
FileRef,
|
|
221
|
+
MODEL_NAME,
|
|
222
|
+
MODEL_VERSION,
|
|
223
|
+
LingbotTracks,
|
|
224
|
+
LingbotModel
|
|
225
|
+
};
|
|
226
|
+
//# sourceMappingURL=chunk-NPVC6SYP.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core.ts"],"sourcesContent":["// Copyright (c) 2026 Reactor Technologies, Inc. All rights reserved.\n\n// Auto-generated by @reactor-team/codegen — DO NOT EDIT\n// Model: lingbot v0.2.21\n\nimport { Reactor, FileRef } from \"@reactor-team/js-sdk\";\nexport { FileRef };\n\nexport const MODEL_NAME = \"lingbot\" as const;\nexport const MODEL_VERSION = \"v0.2.21\" as const;\n\n/**\n * Preset media tracks for the Lingbot 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 LingbotTracks = [\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 LingbotRecvTrackName =\n \"main_video\";\n\n/** Set seed */\nexport interface LingbotSetSeedParams {\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 LingbotSetImageParams {\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 LingbotSetPromptParams {\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 movement */\nexport interface LingbotSetMovementParams {\n /**\n * Character movement in the generated scene. `idle` holds the character stationary; `forward` / `back` translate along the look axis; `strafe_left` / `strafe_right` translate sideways. Can be changed at any time; the new value applies to the next chunk.\n * @default \"idle\"\n */\n\n movement?: \"idle\" | \"forward\" | \"back\" | \"strafe_left\" | \"strafe_right\";\n}\n\n/** Set look_vertical */\nexport interface LingbotSetLookVerticalParams {\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 LingbotSetLookHorizontalParams {\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 rotation_speed_deg */\nexport interface LingbotSetRotationSpeedDegParams {\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 LingbotStateMessage {\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 /** Current value of the `movement` input field. */\n\n movement: string;\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 /** 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 `movement`, `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 `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 LingbotCommandErrorMessage {\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 LingbotChunkCompleteMessage {\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 movement (`w`/`s`/`a`/`d`) and look directions (`left`/`right`/`up`/`down`), or `still` when the character is idle with no camera rotation. */\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 LingbotImageAcceptedMessage {\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 LingbotPromptAcceptedMessage {\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 LingbotConditionsReadyMessage {\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 LingbotGenerationResetMessage {\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 LingbotGenerationPausedMessage {\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 LingbotGenerationResumedMessage {\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 LingbotGenerationStartedMessage {\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 LingbotGenerationCompleteMessage {\n type: \"generation_complete\";\n /** Total number of chunks produced by the run. */\n\n total_chunks: number;\n}\n\nexport type LingbotMessage =\n | LingbotStateMessage\n | LingbotCommandErrorMessage\n | LingbotChunkCompleteMessage\n | LingbotImageAcceptedMessage\n | LingbotPromptAcceptedMessage\n | LingbotConditionsReadyMessage\n | LingbotGenerationResetMessage\n | LingbotGenerationPausedMessage\n | LingbotGenerationResumedMessage\n | LingbotGenerationStartedMessage\n | LingbotGenerationCompleteMessage;\n\n/**\n * Options for creating a LingbotModel (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 LingbotOptions = 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 Lingbot 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 LingbotModel extends Reactor {\n constructor(options?: LingbotOptions) {\n super({\n ...options,\n modelName: MODEL_NAME,\n modelTracks: [...LingbotTracks],\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: LingbotSetSeedParams): 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: LingbotSetImageParams): 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: LingbotSetPromptParams): Promise<void> {\n await this.sendCommand(\"set_prompt\", params);\n }\n\n /**\n * Set movement\n * @param params - Set movement\n */\n\n async setMovement(params: LingbotSetMovementParams): Promise<void> {\n await this.sendCommand(\"set_movement\", params);\n }\n\n /**\n * Set look_vertical\n * @param params - Set look_vertical\n */\n\n async setLookVertical(params: LingbotSetLookVerticalParams): 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: LingbotSetLookHorizontalParams): Promise<void> {\n await this.sendCommand(\"set_look_horizontal\", params);\n }\n\n /**\n * Set rotation_speed_deg\n * @param params - Set rotation_speed_deg\n */\n\n async setRotationSpeedDeg(params: LingbotSetRotationSpeedDegParams): 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 LingbotMessage\n * @returns Unsubscribe function\n */\n\n onMessage(handler: (message: LingbotMessage) => void): () => void {\n const wrappedHandler = (raw: unknown) => {\n handler(_unwrapMessage<LingbotMessage>(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: LingbotStateMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"state\") handler(msg as LingbotStateMessage);\n });\n }\n\n /**\n * Subscribe to \"command_error\" messages only.\n * @returns Unsubscribe function\n */\n\n onCommandError(handler: (message: LingbotCommandErrorMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"command_error\") handler(msg as LingbotCommandErrorMessage);\n });\n }\n\n /**\n * Subscribe to \"chunk_complete\" messages only.\n * @returns Unsubscribe function\n */\n\n onChunkComplete(handler: (message: LingbotChunkCompleteMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"chunk_complete\") handler(msg as LingbotChunkCompleteMessage);\n });\n }\n\n /**\n * Subscribe to \"image_accepted\" messages only.\n * @returns Unsubscribe function\n */\n\n onImageAccepted(handler: (message: LingbotImageAcceptedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"image_accepted\") handler(msg as LingbotImageAcceptedMessage);\n });\n }\n\n /**\n * Subscribe to \"prompt_accepted\" messages only.\n * @returns Unsubscribe function\n */\n\n onPromptAccepted(handler: (message: LingbotPromptAcceptedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"prompt_accepted\") handler(msg as LingbotPromptAcceptedMessage);\n });\n }\n\n /**\n * Subscribe to \"conditions_ready\" messages only.\n * @returns Unsubscribe function\n */\n\n onConditionsReady(handler: (message: LingbotConditionsReadyMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"conditions_ready\") handler(msg as LingbotConditionsReadyMessage);\n });\n }\n\n /**\n * Subscribe to \"generation_reset\" messages only.\n * @returns Unsubscribe function\n */\n\n onGenerationReset(handler: (message: LingbotGenerationResetMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"generation_reset\") handler(msg as LingbotGenerationResetMessage);\n });\n }\n\n /**\n * Subscribe to \"generation_paused\" messages only.\n * @returns Unsubscribe function\n */\n\n onGenerationPaused(handler: (message: LingbotGenerationPausedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"generation_paused\") handler(msg as LingbotGenerationPausedMessage);\n });\n }\n\n /**\n * Subscribe to \"generation_resumed\" messages only.\n * @returns Unsubscribe function\n */\n\n onGenerationResumed(handler: (message: LingbotGenerationResumedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"generation_resumed\") handler(msg as LingbotGenerationResumedMessage);\n });\n }\n\n /**\n * Subscribe to \"generation_started\" messages only.\n * @returns Unsubscribe function\n */\n\n onGenerationStarted(handler: (message: LingbotGenerationStartedMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"generation_started\") handler(msg as LingbotGenerationStartedMessage);\n });\n }\n\n /**\n * Subscribe to \"generation_complete\" messages only.\n * @returns Unsubscribe function\n */\n\n onGenerationComplete(handler: (message: LingbotGenerationCompleteMessage) => void): () => void {\n return this.onMessage((msg) => {\n if (msg.type === \"generation_complete\") handler(msg as LingbotGenerationCompleteMessage);\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":";AAKA,SAAS,SAAS,eAAe;AAG1B,IAAM,aAAa;AACnB,IAAM,gBAAgB;AAStB,IAAM,gBAAgB;AAAA,EAC3B,EAAE,MAAM,cAAc,MAAM,SAAS,WAAW,WAAW;AAC7D;AAuQA,SAAS,eAAkB,KAAiB;AAC1C,QAAM,MAAM;AACZ,MACE,OACA,OAAO,QAAQ,YACf,IAAI,QACJ,OAAO,IAAI,SAAS,UACpB;AACA,WAAO,EAAE,GAAG,IAAI,MAAM,MAAM,IAAI,KAAK;AAAA,EACvC;AACA,SAAO;AACT;AAYO,IAAM,eAAN,cAA2B,QAAQ;AAAA,EACxC,YAAY,SAA0B;AACpC,UAAM;AAAA,MACJ,GAAG;AAAA,MACH,WAAW;AAAA,MACX,aAAa,CAAC,GAAG,aAAa;AAAA,IAChC,CAAC;AAAA,EACH;AAAA;AAAA,EAIA,IAAI,UAAgB;AAClB,WAAO;AAAA,EACT;AAAA;AAAA,EAIA,MAAM,QAAuB;AAC3B,UAAM,KAAK,YAAY,SAAS,CAAC,CAAC;AAAA,EACpC;AAAA;AAAA,EAIA,MAAM,QAAuB;AAC3B,UAAM,KAAK,YAAY,SAAS,CAAC,CAAC;AAAA,EACpC;AAAA;AAAA,EAIA,MAAM,QAAuB;AAC3B,UAAM,KAAK,YAAY,SAAS,CAAC,CAAC;AAAA,EACpC;AAAA;AAAA,EAIA,MAAM,SAAwB;AAC5B,UAAM,KAAK,YAAY,UAAU,CAAC,CAAC;AAAA,EACrC;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,QAAQ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