@decartai/sdk 0.0.16 → 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 +5 -5
- package/dist/shared/model.js +8 -8
- 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,11 +51,11 @@ 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-
|
|
54
|
+
readonly "lucy-fast-v2v": z.ZodObject<{
|
|
55
55
|
prompt: z.ZodString;
|
|
56
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
57
|
seed: z.ZodOptional<z.ZodNumber>;
|
|
58
|
-
resolution: z.
|
|
58
|
+
resolution: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"720p">>>;
|
|
59
59
|
enhance_prompt: z.ZodOptional<z.ZodBoolean>;
|
|
60
60
|
}, z.core.$strip>;
|
|
61
61
|
readonly "lucy-pro-flf2v": z.ZodObject<{
|
|
@@ -109,7 +109,7 @@ declare const models: {
|
|
|
109
109
|
* - `"lucy-pro-v2v"` - Video-to-video
|
|
110
110
|
* - `"lucy-pro-flf2v"` - First-last-frame-to-video
|
|
111
111
|
* - `"lucy-dev-i2v"` - Image-to-video (Dev quality)
|
|
112
|
-
* - `"lucy-
|
|
112
|
+
* - `"lucy-fast-v2v"` - Video-to-video (Fast quality)
|
|
113
113
|
*/
|
|
114
114
|
video: <T extends VideoModels>(model: T) => ModelDefinition<T>;
|
|
115
115
|
/**
|
package/dist/shared/model.js
CHANGED
|
@@ -9,7 +9,7 @@ const realtimeModels = z.union([
|
|
|
9
9
|
]);
|
|
10
10
|
const videoModels = z.union([
|
|
11
11
|
z.literal("lucy-dev-i2v"),
|
|
12
|
-
z.literal("lucy-
|
|
12
|
+
z.literal("lucy-fast-v2v"),
|
|
13
13
|
z.literal("lucy-pro-t2v"),
|
|
14
14
|
z.literal("lucy-pro-i2v"),
|
|
15
15
|
z.literal("lucy-pro-v2v"),
|
|
@@ -81,11 +81,11 @@ const modelInputSchemas = {
|
|
|
81
81
|
enhance_prompt: z.boolean().optional().describe("Whether to enhance the prompt"),
|
|
82
82
|
num_inference_steps: z.number().optional().describe("The number of inference steps")
|
|
83
83
|
}),
|
|
84
|
-
"lucy-
|
|
84
|
+
"lucy-fast-v2v": z.object({
|
|
85
85
|
prompt: z.string().min(1).max(1e3).describe("The prompt to use for the generation"),
|
|
86
86
|
data: fileInputSchema.describe("The video data to use for generation (File, Blob, ReadableStream, URL, or string URL)"),
|
|
87
87
|
seed: z.number().optional().describe("The seed to use for the generation"),
|
|
88
|
-
resolution:
|
|
88
|
+
resolution: proV2vResolutionSchema,
|
|
89
89
|
enhance_prompt: z.boolean().optional().describe("Whether to enhance the prompt")
|
|
90
90
|
}),
|
|
91
91
|
"lucy-pro-flf2v": z.object({
|
|
@@ -175,13 +175,13 @@ const _models = {
|
|
|
175
175
|
height: 704,
|
|
176
176
|
inputSchema: modelInputSchemas["lucy-dev-i2v"]
|
|
177
177
|
},
|
|
178
|
-
"lucy-
|
|
179
|
-
urlPath: "/v1/generate/lucy-
|
|
180
|
-
name: "lucy-
|
|
178
|
+
"lucy-fast-v2v": {
|
|
179
|
+
urlPath: "/v1/generate/lucy-fast-v2v",
|
|
180
|
+
name: "lucy-fast-v2v",
|
|
181
181
|
fps: 25,
|
|
182
182
|
width: 1280,
|
|
183
|
-
height:
|
|
184
|
-
inputSchema: modelInputSchemas["lucy-
|
|
183
|
+
height: 720,
|
|
184
|
+
inputSchema: modelInputSchemas["lucy-fast-v2v"]
|
|
185
185
|
},
|
|
186
186
|
"lucy-pro-t2v": {
|
|
187
187
|
urlPath: "/v1/generate/lucy-pro-t2v",
|
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