@decartai/sdk 0.0.55 → 0.0.56
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/shared/model.d.ts +2 -21
- package/dist/shared/model.js +0 -17
- package/dist/tokens/client.d.ts +29 -0
- package/dist/tokens/client.js +1 -1
- package/package.json +1 -1
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">, z.ZodLiteral<"lucy_2_rt">, z.ZodLiteral<"live_avatar">]>;
|
|
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-
|
|
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-motion">, z.ZodLiteral<"lucy-restyle-v2v">, z.ZodLiteral<"lucy-2-v2v">]>;
|
|
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.ZodLiteral<"lucy_2_rt">, z.ZodLiteral<"live_avatar">]>, 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-
|
|
7
|
+
declare const modelSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"mirage">, z.ZodLiteral<"mirage_v2">, z.ZodLiteral<"lucy_v2v_720p_rt">, z.ZodLiteral<"lucy_2_rt">, z.ZodLiteral<"live_avatar">]>, 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-motion">, z.ZodLiteral<"lucy-restyle-v2v">, z.ZodLiteral<"lucy-2-v2v">]>, 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>;
|
|
@@ -81,24 +81,6 @@ declare const modelInputSchemas: {
|
|
|
81
81
|
resolution: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"720p">>>;
|
|
82
82
|
enhance_prompt: z.ZodOptional<z.ZodBoolean>;
|
|
83
83
|
}, z.core.$strip>;
|
|
84
|
-
readonly "lucy-pro-flf2v": z.ZodObject<{
|
|
85
|
-
prompt: z.ZodString;
|
|
86
|
-
start: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>, z.ZodCustom<URL, URL>, z.ZodURL, z.ZodObject<{
|
|
87
|
-
uri: z.ZodString;
|
|
88
|
-
type: z.ZodString;
|
|
89
|
-
name: z.ZodString;
|
|
90
|
-
}, z.core.$strip>]>;
|
|
91
|
-
end: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>, z.ZodCustom<URL, URL>, z.ZodURL, z.ZodObject<{
|
|
92
|
-
uri: z.ZodString;
|
|
93
|
-
type: z.ZodString;
|
|
94
|
-
name: z.ZodString;
|
|
95
|
-
}, z.core.$strip>]>;
|
|
96
|
-
seed: z.ZodOptional<z.ZodNumber>;
|
|
97
|
-
resolution: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
98
|
-
"720p": "720p";
|
|
99
|
-
"480p": "480p";
|
|
100
|
-
}>>>;
|
|
101
|
-
}, z.core.$strip>;
|
|
102
84
|
readonly "lucy-pro-i2i": z.ZodObject<{
|
|
103
85
|
prompt: z.ZodString;
|
|
104
86
|
data: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>, z.ZodCustom<URL, URL>, z.ZodURL, z.ZodObject<{
|
|
@@ -197,7 +179,6 @@ declare const models: {
|
|
|
197
179
|
* - `"lucy-pro-t2v"` - Text-to-video
|
|
198
180
|
* - `"lucy-pro-i2v"` - Image-to-video
|
|
199
181
|
* - `"lucy-pro-v2v"` - Video-to-video
|
|
200
|
-
* - `"lucy-pro-flf2v"` - First-last-frame-to-video
|
|
201
182
|
* - `"lucy-dev-i2v"` - Image-to-video (Dev quality)
|
|
202
183
|
* - `"lucy-fast-v2v"` - Video-to-video (Fast quality)
|
|
203
184
|
* - `"lucy-restyle-v2v"` - Video-to-video (Restyling)
|
package/dist/shared/model.js
CHANGED
|
@@ -15,7 +15,6 @@ const videoModels = z.union([
|
|
|
15
15
|
z.literal("lucy-pro-t2v"),
|
|
16
16
|
z.literal("lucy-pro-i2v"),
|
|
17
17
|
z.literal("lucy-pro-v2v"),
|
|
18
|
-
z.literal("lucy-pro-flf2v"),
|
|
19
18
|
z.literal("lucy-motion"),
|
|
20
19
|
z.literal("lucy-restyle-v2v"),
|
|
21
20
|
z.literal("lucy-2-v2v")
|
|
@@ -106,13 +105,6 @@ const modelInputSchemas = {
|
|
|
106
105
|
resolution: proV2vResolutionSchema,
|
|
107
106
|
enhance_prompt: z.boolean().optional().describe("Whether to enhance the prompt")
|
|
108
107
|
}),
|
|
109
|
-
"lucy-pro-flf2v": z.object({
|
|
110
|
-
prompt: z.string().min(1).max(1e3).describe("The prompt to use for the generation"),
|
|
111
|
-
start: fileInputSchema.describe("The start frame image (File, Blob, ReadableStream, URL, or string URL)"),
|
|
112
|
-
end: fileInputSchema.describe("The end frame image (File, Blob, ReadableStream, URL, or string URL)"),
|
|
113
|
-
seed: z.number().optional().describe("The seed to use for the generation"),
|
|
114
|
-
resolution: proResolutionSchema()
|
|
115
|
-
}),
|
|
116
108
|
"lucy-pro-i2i": z.object({
|
|
117
109
|
prompt: z.string().min(1).max(1e3).describe("The prompt to use for the generation"),
|
|
118
110
|
data: fileInputSchema.describe("The image data to use for generation (File, Blob, ReadableStream, URL, or string URL)"),
|
|
@@ -265,15 +257,6 @@ const _models = {
|
|
|
265
257
|
height: 704,
|
|
266
258
|
inputSchema: modelInputSchemas["lucy-pro-v2v"]
|
|
267
259
|
},
|
|
268
|
-
"lucy-pro-flf2v": {
|
|
269
|
-
urlPath: "/v1/generate/lucy-pro-flf2v",
|
|
270
|
-
queueUrlPath: "/v1/jobs/lucy-pro-flf2v",
|
|
271
|
-
name: "lucy-pro-flf2v",
|
|
272
|
-
fps: 25,
|
|
273
|
-
width: 1280,
|
|
274
|
-
height: 704,
|
|
275
|
-
inputSchema: modelInputSchemas["lucy-pro-flf2v"]
|
|
276
|
-
},
|
|
277
260
|
"lucy-motion": {
|
|
278
261
|
urlPath: "/v1/generate/lucy-motion",
|
|
279
262
|
queueUrlPath: "/v1/jobs/lucy-motion",
|
package/dist/tokens/client.d.ts
CHANGED
|
@@ -1,12 +1,34 @@
|
|
|
1
|
+
import { Model } from "../shared/model.js";
|
|
2
|
+
|
|
1
3
|
//#region src/tokens/client.d.ts
|
|
2
4
|
|
|
3
5
|
type CreateTokenOptions = {
|
|
4
6
|
/** Custom key-value pairs to attach to the client token. */
|
|
5
7
|
metadata?: Record<string, unknown>;
|
|
8
|
+
/** Seconds until the token expires (1-3600, default 60). */
|
|
9
|
+
expiresIn?: number;
|
|
10
|
+
/** Restrict which models this token can access (max 20 items). */
|
|
11
|
+
allowedModels?: (Model | (string & {}))[];
|
|
12
|
+
/** Operational limits for the token. */
|
|
13
|
+
constraints?: {
|
|
14
|
+
realtime?: {
|
|
15
|
+
maxSessionDuration?: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
6
18
|
};
|
|
7
19
|
type CreateTokenResponse = {
|
|
8
20
|
apiKey: string;
|
|
9
21
|
expiresAt: string;
|
|
22
|
+
/** Present when `allowedModels` was set on the request. */
|
|
23
|
+
permissions?: {
|
|
24
|
+
models: (Model | (string & {}))[];
|
|
25
|
+
} | null;
|
|
26
|
+
/** Present when `constraints` was set on the request. */
|
|
27
|
+
constraints?: {
|
|
28
|
+
realtime?: {
|
|
29
|
+
maxSessionDuration?: number;
|
|
30
|
+
};
|
|
31
|
+
} | null;
|
|
10
32
|
};
|
|
11
33
|
type TokensClient = {
|
|
12
34
|
/**
|
|
@@ -22,6 +44,13 @@ type TokensClient = {
|
|
|
22
44
|
*
|
|
23
45
|
* // With metadata:
|
|
24
46
|
* const token = await client.tokens.create({ metadata: { role: "viewer" } });
|
|
47
|
+
*
|
|
48
|
+
* // With expiry, model restrictions, and constraints:
|
|
49
|
+
* const token = await client.tokens.create({
|
|
50
|
+
* expiresIn: 300,
|
|
51
|
+
* allowedModels: ["lucy-pro-t2v", "lucy-pro-i2v"],
|
|
52
|
+
* constraints: { realtime: { maxSessionDuration: 120 } },
|
|
53
|
+
* });
|
|
25
54
|
* ```
|
|
26
55
|
*/
|
|
27
56
|
create: (options?: CreateTokenOptions) => Promise<CreateTokenResponse>;
|
package/dist/tokens/client.js
CHANGED
|
@@ -15,7 +15,7 @@ const createTokensClient = (opts) => {
|
|
|
15
15
|
const response = await fetch(`${baseUrl}/v1/client/tokens`, {
|
|
16
16
|
method: "POST",
|
|
17
17
|
headers,
|
|
18
|
-
body: JSON.stringify(options
|
|
18
|
+
body: JSON.stringify(options ?? {})
|
|
19
19
|
});
|
|
20
20
|
if (!response.ok) {
|
|
21
21
|
const errorText = await response.text().catch(() => "Unknown error");
|