@decartai/sdk 0.0.17 → 0.0.18
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/dist/realtime/client.d.ts +1 -4
- package/dist/realtime/client.js +0 -2
- package/dist/realtime/methods.js +1 -12
- package/dist/shared/model.d.ts +3 -10
- package/dist/shared/model.js +0 -16
- package/dist/shared/types.d.ts +0 -1
- package/dist/shared/types.js +4 -7
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -8,13 +8,12 @@ declare const realTimeClientInitialStateSchema: z.ZodObject<{
|
|
|
8
8
|
text: z.ZodString;
|
|
9
9
|
enhance: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
10
10
|
}, z.core.$strip>>;
|
|
11
|
-
mirror: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
12
11
|
}, z.core.$strip>;
|
|
13
12
|
type OnRemoteStreamFn = (stream: MediaStream) => void;
|
|
14
13
|
type RealTimeClientInitialState = z.infer<typeof realTimeClientInitialStateSchema>;
|
|
15
14
|
declare const realTimeClientConnectOptionsSchema: z.ZodObject<{
|
|
16
15
|
model: z.ZodObject<{
|
|
17
|
-
name: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"mirage">, z.ZodLiteral<"mirage_v2">, z.ZodLiteral<"lucy_v2v_720p_rt">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-dev-i2v">, z.ZodLiteral<"lucy-
|
|
16
|
+
name: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"mirage">, z.ZodLiteral<"mirage_v2">, z.ZodLiteral<"lucy_v2v_720p_rt">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-dev-i2v">, z.ZodLiteral<"lucy-fast-v2v">, z.ZodLiteral<"lucy-pro-t2v">, z.ZodLiteral<"lucy-pro-i2v">, z.ZodLiteral<"lucy-pro-v2v">, z.ZodLiteral<"lucy-pro-flf2v">, z.ZodLiteral<"lucy-motion">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-pro-t2i">, z.ZodLiteral<"lucy-pro-i2i">]>]>;
|
|
18
17
|
urlPath: z.ZodString;
|
|
19
18
|
fps: z.ZodNumber;
|
|
20
19
|
width: z.ZodNumber;
|
|
@@ -27,7 +26,6 @@ declare const realTimeClientConnectOptionsSchema: z.ZodObject<{
|
|
|
27
26
|
text: z.ZodString;
|
|
28
27
|
enhance: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
29
28
|
}, z.core.$strip>>;
|
|
30
|
-
mirror: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
31
29
|
}, z.core.$strip>>;
|
|
32
30
|
customizeOffer: z.ZodOptional<z.ZodCustom<z.core.$InferInnerFunctionTypeAsync<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>, z.core.$InferInnerFunctionTypeAsync<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>>;
|
|
33
31
|
}, z.core.$strip>;
|
|
@@ -42,7 +40,6 @@ type RealTimeClient = {
|
|
|
42
40
|
}?: {
|
|
43
41
|
enhance?: boolean;
|
|
44
42
|
}) => void;
|
|
45
|
-
setMirror: (enabled: boolean) => void;
|
|
46
43
|
isConnected: () => boolean;
|
|
47
44
|
getConnectionState: () => "connected" | "connecting" | "disconnected";
|
|
48
45
|
disconnect: () => void;
|
package/dist/realtime/client.js
CHANGED
|
@@ -51,11 +51,9 @@ const createRealTimeClient = (opts) => {
|
|
|
51
51
|
const { text, enhance } = options.initialState.prompt;
|
|
52
52
|
methods.setPrompt(text, { enhance });
|
|
53
53
|
}
|
|
54
|
-
if (options.initialState.mirror) methods.setMirror(options.initialState.mirror);
|
|
55
54
|
}
|
|
56
55
|
return {
|
|
57
56
|
setPrompt: methods.setPrompt,
|
|
58
|
-
setMirror: methods.setMirror,
|
|
59
57
|
isConnected: () => webrtcManager.isConnected(),
|
|
60
58
|
getConnectionState: () => webrtcManager.getConnectionState(),
|
|
61
59
|
disconnect: () => webrtcManager.cleanup(),
|
package/dist/realtime/methods.js
CHANGED
|
@@ -17,18 +17,7 @@ const realtimeMethods = (webrtcManager) => {
|
|
|
17
17
|
enhance_prompt: parsedInput.data.enhance
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
const parsedInput = z.object({ enabled: z.boolean() }).safeParse({ enabled });
|
|
22
|
-
if (!parsedInput.success) throw parsedInput.error;
|
|
23
|
-
webrtcManager.sendMessage({
|
|
24
|
-
type: "switch_camera",
|
|
25
|
-
rotateY: parsedInput.data.enabled ? 2 : 0
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
return {
|
|
29
|
-
setPrompt,
|
|
30
|
-
setMirror
|
|
31
|
-
};
|
|
20
|
+
return { setPrompt };
|
|
32
21
|
};
|
|
33
22
|
|
|
34
23
|
//#endregion
|
package/dist/shared/model.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { z } from "zod";
|
|
|
2
2
|
|
|
3
3
|
//#region src/shared/model.d.ts
|
|
4
4
|
declare const realtimeModels: z.ZodUnion<readonly [z.ZodLiteral<"mirage">, z.ZodLiteral<"mirage_v2">, z.ZodLiteral<"lucy_v2v_720p_rt">]>;
|
|
5
|
-
declare const videoModels: z.ZodUnion<readonly [z.ZodLiteral<"lucy-dev-i2v">, z.ZodLiteral<"lucy-
|
|
5
|
+
declare const videoModels: z.ZodUnion<readonly [z.ZodLiteral<"lucy-dev-i2v">, z.ZodLiteral<"lucy-fast-v2v">, z.ZodLiteral<"lucy-pro-t2v">, z.ZodLiteral<"lucy-pro-i2v">, z.ZodLiteral<"lucy-pro-v2v">, z.ZodLiteral<"lucy-pro-flf2v">, z.ZodLiteral<"lucy-motion">]>;
|
|
6
6
|
declare const imageModels: z.ZodUnion<readonly [z.ZodLiteral<"lucy-pro-t2i">, z.ZodLiteral<"lucy-pro-i2i">]>;
|
|
7
|
-
declare const modelSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"mirage">, z.ZodLiteral<"mirage_v2">, z.ZodLiteral<"lucy_v2v_720p_rt">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-dev-i2v">, z.ZodLiteral<"lucy-
|
|
7
|
+
declare const modelSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"mirage">, z.ZodLiteral<"mirage_v2">, z.ZodLiteral<"lucy_v2v_720p_rt">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-dev-i2v">, z.ZodLiteral<"lucy-fast-v2v">, z.ZodLiteral<"lucy-pro-t2v">, z.ZodLiteral<"lucy-pro-i2v">, z.ZodLiteral<"lucy-pro-v2v">, z.ZodLiteral<"lucy-pro-flf2v">, z.ZodLiteral<"lucy-motion">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-pro-t2i">, z.ZodLiteral<"lucy-pro-i2i">]>]>;
|
|
8
8
|
type Model = z.infer<typeof modelSchema>;
|
|
9
9
|
type RealTimeModels = z.infer<typeof realtimeModels>;
|
|
10
10
|
type VideoModels = z.infer<typeof videoModels>;
|
|
@@ -51,13 +51,6 @@ declare const modelInputSchemas: {
|
|
|
51
51
|
enhance_prompt: z.ZodOptional<z.ZodBoolean>;
|
|
52
52
|
num_inference_steps: z.ZodOptional<z.ZodNumber>;
|
|
53
53
|
}, z.core.$strip>;
|
|
54
|
-
readonly "lucy-dev-v2v": z.ZodObject<{
|
|
55
|
-
prompt: z.ZodString;
|
|
56
|
-
data: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>, z.ZodCustom<URL, URL>, z.ZodURL]>;
|
|
57
|
-
seed: z.ZodOptional<z.ZodNumber>;
|
|
58
|
-
resolution: z.ZodOptional<z.ZodDefault<z.ZodLiteral<"720p">>>;
|
|
59
|
-
enhance_prompt: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
-
}, z.core.$strip>;
|
|
61
54
|
readonly "lucy-fast-v2v": z.ZodObject<{
|
|
62
55
|
prompt: z.ZodString;
|
|
63
56
|
data: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>, z.ZodCustom<URL, URL>, z.ZodURL]>;
|
|
@@ -116,7 +109,7 @@ declare const models: {
|
|
|
116
109
|
* - `"lucy-pro-v2v"` - Video-to-video
|
|
117
110
|
* - `"lucy-pro-flf2v"` - First-last-frame-to-video
|
|
118
111
|
* - `"lucy-dev-i2v"` - Image-to-video (Dev quality)
|
|
119
|
-
* - `"lucy-
|
|
112
|
+
* - `"lucy-fast-v2v"` - Video-to-video (Fast quality)
|
|
120
113
|
*/
|
|
121
114
|
video: <T extends VideoModels>(model: T) => ModelDefinition<T>;
|
|
122
115
|
/**
|
package/dist/shared/model.js
CHANGED
|
@@ -9,7 +9,6 @@ const realtimeModels = z.union([
|
|
|
9
9
|
]);
|
|
10
10
|
const videoModels = z.union([
|
|
11
11
|
z.literal("lucy-dev-i2v"),
|
|
12
|
-
z.literal("lucy-dev-v2v"),
|
|
13
12
|
z.literal("lucy-fast-v2v"),
|
|
14
13
|
z.literal("lucy-pro-t2v"),
|
|
15
14
|
z.literal("lucy-pro-i2v"),
|
|
@@ -82,13 +81,6 @@ const modelInputSchemas = {
|
|
|
82
81
|
enhance_prompt: z.boolean().optional().describe("Whether to enhance the prompt"),
|
|
83
82
|
num_inference_steps: z.number().optional().describe("The number of inference steps")
|
|
84
83
|
}),
|
|
85
|
-
"lucy-dev-v2v": z.object({
|
|
86
|
-
prompt: z.string().min(1).max(1e3).describe("The prompt to use for the generation"),
|
|
87
|
-
data: fileInputSchema.describe("The video data to use for generation (File, Blob, ReadableStream, URL, or string URL)"),
|
|
88
|
-
seed: z.number().optional().describe("The seed to use for the generation"),
|
|
89
|
-
resolution: devResolutionSchema,
|
|
90
|
-
enhance_prompt: z.boolean().optional().describe("Whether to enhance the prompt")
|
|
91
|
-
}),
|
|
92
84
|
"lucy-fast-v2v": z.object({
|
|
93
85
|
prompt: z.string().min(1).max(1e3).describe("The prompt to use for the generation"),
|
|
94
86
|
data: fileInputSchema.describe("The video data to use for generation (File, Blob, ReadableStream, URL, or string URL)"),
|
|
@@ -183,14 +175,6 @@ const _models = {
|
|
|
183
175
|
height: 704,
|
|
184
176
|
inputSchema: modelInputSchemas["lucy-dev-i2v"]
|
|
185
177
|
},
|
|
186
|
-
"lucy-dev-v2v": {
|
|
187
|
-
urlPath: "/v1/generate/lucy-dev-v2v",
|
|
188
|
-
name: "lucy-dev-v2v",
|
|
189
|
-
fps: 25,
|
|
190
|
-
width: 1280,
|
|
191
|
-
height: 704,
|
|
192
|
-
inputSchema: modelInputSchemas["lucy-dev-v2v"]
|
|
193
|
-
},
|
|
194
178
|
"lucy-fast-v2v": {
|
|
195
179
|
urlPath: "/v1/generate/lucy-fast-v2v",
|
|
196
180
|
name: "lucy-fast-v2v",
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ declare const modelStateSchema: z.ZodObject<{
|
|
|
6
6
|
text: z.ZodString;
|
|
7
7
|
enhance: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
8
8
|
}, z.core.$strip>>;
|
|
9
|
-
mirror: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
10
9
|
}, z.core.$strip>;
|
|
11
10
|
type ModelState = z.infer<typeof modelStateSchema>;
|
|
12
11
|
//#endregion
|
package/dist/shared/types.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/shared/types.ts
|
|
4
|
-
const modelStateSchema = z.object({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}).optional(),
|
|
9
|
-
mirror: z.boolean().optional().default(false)
|
|
10
|
-
});
|
|
4
|
+
const modelStateSchema = z.object({ prompt: z.object({
|
|
5
|
+
text: z.string().min(1),
|
|
6
|
+
enhance: z.boolean().optional().default(true)
|
|
7
|
+
}).optional() });
|
|
11
8
|
|
|
12
9
|
//#endregion
|
|
13
10
|
export { modelStateSchema };
|
package/dist/version.js
CHANGED