@anuragpal02/zcl-contracts 0.36.0 → 0.38.0
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/generation.d.ts +49 -2
- package/dist/generation.d.ts.map +1 -1
- package/dist/generation.js +23 -2
- package/dist/looks.d.ts +9 -15
- package/dist/looks.d.ts.map +1 -1
- package/dist/looks.js +21 -31
- package/dist/loop-tools.d.ts +2 -2
- package/package.json +1 -1
package/dist/generation.d.ts
CHANGED
|
@@ -22,9 +22,43 @@ export declare const imageAspectSchema: z.ZodEnum<{
|
|
|
22
22
|
"16:9": "16:9";
|
|
23
23
|
"9:16": "9:16";
|
|
24
24
|
}>;
|
|
25
|
+
/**
|
|
26
|
+
* How strongly an attached visual reference governs a new master generation.
|
|
27
|
+
*
|
|
28
|
+
* `min` is text-guided only; `medium` uses the reference as creative direction;
|
|
29
|
+
* `max` treats it as the target composition. The API owns the resulting prompt
|
|
30
|
+
* and multimodal policy, rather than trusting a client-side interpretation.
|
|
31
|
+
*/
|
|
32
|
+
export declare const referenceFidelitySchema: z.ZodEnum<{
|
|
33
|
+
min: "min";
|
|
34
|
+
medium: "medium";
|
|
35
|
+
max: "max";
|
|
36
|
+
}>;
|
|
37
|
+
/**
|
|
38
|
+
* The rendering depth requested for a generation. `match` is meaningful only
|
|
39
|
+
* when a visual source is available; the API safely resolves an orphaned match
|
|
40
|
+
* selection to its production default.
|
|
41
|
+
*/
|
|
42
|
+
export declare const dimensionalitySchema: z.ZodEnum<{
|
|
43
|
+
match: "match";
|
|
44
|
+
"2d": "2d";
|
|
45
|
+
"2.5d": "2.5d";
|
|
46
|
+
"3d": "3d";
|
|
47
|
+
}>;
|
|
25
48
|
export declare const imageGenerateParamsSchema: z.ZodObject<{
|
|
26
49
|
prompt: z.ZodString;
|
|
27
50
|
sourceAssetIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
51
|
+
referenceFidelity: z.ZodOptional<z.ZodEnum<{
|
|
52
|
+
min: "min";
|
|
53
|
+
medium: "medium";
|
|
54
|
+
max: "max";
|
|
55
|
+
}>>;
|
|
56
|
+
dimensionality: z.ZodOptional<z.ZodEnum<{
|
|
57
|
+
match: "match";
|
|
58
|
+
"2d": "2d";
|
|
59
|
+
"2.5d": "2.5d";
|
|
60
|
+
"3d": "3d";
|
|
61
|
+
}>>;
|
|
28
62
|
ledMapVersion: z.ZodOptional<z.ZodNumber>;
|
|
29
63
|
size: z.ZodOptional<z.ZodString>;
|
|
30
64
|
aspect: z.ZodOptional<z.ZodEnum<{
|
|
@@ -62,8 +96,8 @@ export declare const createVideoLoopRequestSchema: z.ZodObject<{
|
|
|
62
96
|
h: z.ZodNumber;
|
|
63
97
|
}, z.core.$strip>>;
|
|
64
98
|
intensity: z.ZodDefault<z.ZodEnum<{
|
|
65
|
-
subtle: "subtle";
|
|
66
99
|
medium: "medium";
|
|
100
|
+
subtle: "subtle";
|
|
67
101
|
dynamic: "dynamic";
|
|
68
102
|
}>>;
|
|
69
103
|
resolution: z.ZodDefault<z.ZodEnum<{
|
|
@@ -84,8 +118,8 @@ export declare const createSmartVideoRequestSchema: z.ZodObject<{
|
|
|
84
118
|
masterJobId: z.ZodOptional<z.ZodString>;
|
|
85
119
|
sourceAssetId: z.ZodOptional<z.ZodString>;
|
|
86
120
|
intensity: z.ZodEnum<{
|
|
87
|
-
subtle: "subtle";
|
|
88
121
|
medium: "medium";
|
|
122
|
+
subtle: "subtle";
|
|
89
123
|
dynamic: "dynamic";
|
|
90
124
|
}>;
|
|
91
125
|
recomposeWall: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -341,6 +375,17 @@ export declare const generationJobSchema: z.ZodObject<{
|
|
|
341
375
|
export declare const createGenerationJobRequestSchema: z.ZodObject<{
|
|
342
376
|
prompt: z.ZodString;
|
|
343
377
|
sourceAssetIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
378
|
+
referenceFidelity: z.ZodOptional<z.ZodEnum<{
|
|
379
|
+
min: "min";
|
|
380
|
+
medium: "medium";
|
|
381
|
+
max: "max";
|
|
382
|
+
}>>;
|
|
383
|
+
dimensionality: z.ZodOptional<z.ZodEnum<{
|
|
384
|
+
match: "match";
|
|
385
|
+
"2d": "2d";
|
|
386
|
+
"2.5d": "2.5d";
|
|
387
|
+
"3d": "3d";
|
|
388
|
+
}>>;
|
|
344
389
|
ledMapVersion: z.ZodOptional<z.ZodNumber>;
|
|
345
390
|
size: z.ZodOptional<z.ZodString>;
|
|
346
391
|
aspect: z.ZodOptional<z.ZodEnum<{
|
|
@@ -681,6 +726,8 @@ export declare const listGenerationJobsResponseSchema: z.ZodObject<{
|
|
|
681
726
|
export type GenerationJobStatus = z.infer<typeof generationJobStatusSchema>;
|
|
682
727
|
export type GenerationJobType = z.infer<typeof generationJobTypeSchema>;
|
|
683
728
|
export type ImageAspect = z.infer<typeof imageAspectSchema>;
|
|
729
|
+
export type ReferenceFidelity = z.infer<typeof referenceFidelitySchema>;
|
|
730
|
+
export type Dimensionality = z.infer<typeof dimensionalitySchema>;
|
|
684
731
|
export type ImageGenerateParams = z.infer<typeof imageGenerateParamsSchema>;
|
|
685
732
|
export type EditGenerationJobRequest = z.input<typeof editGenerationJobRequestSchema>;
|
|
686
733
|
export type CreatePanelSetRequest = z.input<typeof createPanelSetRequestSchema>;
|
package/dist/generation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generation.d.ts","sourceRoot":"","sources":["../src/generation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,yBAAyB;;;;;;EAAmE,CAAA;AAEzG,eAAO,MAAM,uBAAuB;;;;;;;;;;;EAWlC,CAAA;AAKF,eAAO,MAAM,iBAAiB;;;EAA2B,CAAA;AAEzD,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"generation.d.ts","sourceRoot":"","sources":["../src/generation.ts"],"names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,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA;AACnF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAC/D,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAA;AACzF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA;AACnF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAC/E,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAA;AACzF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AACnE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA"}
|
package/dist/generation.js
CHANGED
|
@@ -18,9 +18,30 @@ export const generationJobTypeSchema = z.enum([
|
|
|
18
18
|
// image model supports for a free concept; the LED MAP step later fits the chosen master
|
|
19
19
|
// onto panels (per-panel companion generation), so a master is generated map-independently.
|
|
20
20
|
export const imageAspectSchema = z.enum(['16:9', '9:16']);
|
|
21
|
+
/**
|
|
22
|
+
* How strongly an attached visual reference governs a new master generation.
|
|
23
|
+
*
|
|
24
|
+
* `min` is text-guided only; `medium` uses the reference as creative direction;
|
|
25
|
+
* `max` treats it as the target composition. The API owns the resulting prompt
|
|
26
|
+
* and multimodal policy, rather than trusting a client-side interpretation.
|
|
27
|
+
*/
|
|
28
|
+
export const referenceFidelitySchema = z.enum(['min', 'medium', 'max']);
|
|
29
|
+
/**
|
|
30
|
+
* The rendering depth requested for a generation. `match` is meaningful only
|
|
31
|
+
* when a visual source is available; the API safely resolves an orphaned match
|
|
32
|
+
* selection to its production default.
|
|
33
|
+
*/
|
|
34
|
+
export const dimensionalitySchema = z.enum(['2d', '2.5d', '3d', 'match']);
|
|
21
35
|
export const imageGenerateParamsSchema = z.object({
|
|
22
|
-
|
|
36
|
+
// A visual reference can be a complete generation brief, so an empty prompt
|
|
37
|
+
// is valid only when at least one source asset is attached. The refinement
|
|
38
|
+
// below keeps text-only requests from becoming accidental blank generations.
|
|
39
|
+
prompt: z.string().trim().max(4000),
|
|
23
40
|
sourceAssetIds: z.array(idSchema).max(16).optional(),
|
|
41
|
+
// Production-native controls for visual references. Both remain optional for
|
|
42
|
+
// backward compatibility with existing jobs and callers.
|
|
43
|
+
referenceFidelity: referenceFidelitySchema.optional(),
|
|
44
|
+
dimensionality: dimensionalitySchema.optional(),
|
|
24
45
|
ledMapVersion: z.number().int().nonnegative().optional(),
|
|
25
46
|
size: z.string().trim().min(1).max(32).optional(), // server may override from the LED map
|
|
26
47
|
// Concept-first master aspect. When set, the server uses THIS instead of deriving the
|
|
@@ -38,7 +59,7 @@ export const imageGenerateParamsSchema = z.object({
|
|
|
38
59
|
// The creation this generation belongs to. Omitted = the server resolves the project's
|
|
39
60
|
// sole creation (pre-Project-Folders behavior); pinned older clients never send this.
|
|
40
61
|
runId: idSchema.optional()
|
|
41
|
-
});
|
|
62
|
+
}).refine((input) => input.prompt.length > 0 || (input.sourceAssetIds?.length ?? 0) > 0, { message: 'Provide a prompt or at least one source image', path: ['prompt'] });
|
|
42
63
|
export const editGenerationJobRequestSchema = z.object({
|
|
43
64
|
parentJobId: idSchema,
|
|
44
65
|
instruction: z.string().trim().min(1).max(4000),
|
package/dist/looks.d.ts
CHANGED
|
@@ -95,24 +95,18 @@ export declare const adminLookTestResponseSchema: z.ZodObject<{
|
|
|
95
95
|
imageBase64: z.ZodString;
|
|
96
96
|
contentType: z.ZodString;
|
|
97
97
|
}, z.core.$strip>;
|
|
98
|
-
export declare const LOOK_SUBJECT_PLACEHOLDER = "{subject}";
|
|
99
98
|
/**
|
|
100
|
-
* Compose the FINAL generation prompt from
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
99
|
+
* Compose the FINAL generation prompt from the user's prompt and a look's
|
|
100
|
+
* style — the single definition of what "applying a look" means, shared by
|
|
101
|
+
* the admin test window and the web app's concept step so the two can never
|
|
102
|
+
* drift.
|
|
104
103
|
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
* - No marker → the subject leads and the style follows: `<subject>. <template>`
|
|
110
|
-
* (subject-first scenes read best with image models). Empty subject → the
|
|
111
|
-
* template unchanged.
|
|
112
|
-
* Whitespace is collapsed at the join so templates/subjects with stray spaces
|
|
113
|
-
* don't produce double gaps.
|
|
104
|
+
* One fixed rule: `<user prompt>, <look style>`. The user's words always
|
|
105
|
+
* lead — they are the payload; the look is a style modifier appended after
|
|
106
|
+
* them. No placeholder, no ordering decisions for template authors. If either
|
|
107
|
+
* side is blank, the other stands alone.
|
|
114
108
|
*/
|
|
115
|
-
export declare function applyLookPrompt(lookPrompt: string,
|
|
109
|
+
export declare function applyLookPrompt(lookPrompt: string, userPrompt: string): string;
|
|
116
110
|
export type Look = z.infer<typeof lookSchema>;
|
|
117
111
|
export type ListLooksResponse = z.infer<typeof listLooksResponseSchema>;
|
|
118
112
|
export type GetLookResponse = z.infer<typeof getLookResponseSchema>;
|
package/dist/looks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"looks.d.ts","sourceRoot":"","sources":["../src/looks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"looks.d.ts","sourceRoot":"","sources":["../src/looks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAYvB,eAAO,MAAM,UAAU;;;;;;;;;;iBAUrB,CAAA;AAIF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;iBAElC,CAAA;A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0B,CAAC,CAAA;AAC7E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA"}
|
package/dist/looks.js
CHANGED
|
@@ -4,10 +4,11 @@ import { apiSuccessSchema, idSchema, isoDateSchema } from './common.js';
|
|
|
4
4
|
// prompt (plus optional thumbnail) users pick as a starting point for generation.
|
|
5
5
|
// `isActive` gates visibility on the public list; `sortOrder` orders it.
|
|
6
6
|
//
|
|
7
|
-
// A look's prompt is a STYLE
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
7
|
+
// A look's prompt is a STYLE MODIFIER, not a complete prompt: the user always
|
|
8
|
+
// supplies the payload (a subject, scenery, anything) and the platform appends
|
|
9
|
+
// the look's style to it (see applyLookPrompt). Author prompts as style
|
|
10
|
+
// descriptors ("aurora palette, volumetric glow, cinematic CGI"), not full
|
|
11
|
+
// scenes — a full scene competes with the user's prompt instead of styling it.
|
|
11
12
|
export const lookSchema = z.object({
|
|
12
13
|
id: idSchema,
|
|
13
14
|
name: z.string(),
|
|
@@ -58,34 +59,23 @@ export const adminLookTestResponseSchema = z.object({
|
|
|
58
59
|
imageBase64: z.string(),
|
|
59
60
|
contentType: z.string()
|
|
60
61
|
});
|
|
61
|
-
// The marker a look prompt uses to pin where the user's subject lands.
|
|
62
|
-
export const LOOK_SUBJECT_PLACEHOLDER = '{subject}';
|
|
63
62
|
/**
|
|
64
|
-
* Compose the FINAL generation prompt from
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
63
|
+
* Compose the FINAL generation prompt from the user's prompt and a look's
|
|
64
|
+
* style — the single definition of what "applying a look" means, shared by
|
|
65
|
+
* the admin test window and the web app's concept step so the two can never
|
|
66
|
+
* drift.
|
|
68
67
|
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* - No marker → the subject leads and the style follows: `<subject>. <template>`
|
|
74
|
-
* (subject-first scenes read best with image models). Empty subject → the
|
|
75
|
-
* template unchanged.
|
|
76
|
-
* Whitespace is collapsed at the join so templates/subjects with stray spaces
|
|
77
|
-
* don't produce double gaps.
|
|
68
|
+
* One fixed rule: `<user prompt>, <look style>`. The user's words always
|
|
69
|
+
* lead — they are the payload; the look is a style modifier appended after
|
|
70
|
+
* them. No placeholder, no ordering decisions for template authors. If either
|
|
71
|
+
* side is blank, the other stands alone.
|
|
78
72
|
*/
|
|
79
|
-
export function applyLookPrompt(lookPrompt,
|
|
80
|
-
const
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
83
|
-
return
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
.replace(/ ,/g, ',')
|
|
88
|
-
.trim();
|
|
89
|
-
}
|
|
90
|
-
return trimmedSubject ? `${trimmedSubject}. ${template}` : template;
|
|
73
|
+
export function applyLookPrompt(lookPrompt, userPrompt) {
|
|
74
|
+
const style = lookPrompt.trim();
|
|
75
|
+
const prompt = userPrompt.trim();
|
|
76
|
+
if (!style)
|
|
77
|
+
return prompt;
|
|
78
|
+
if (!prompt)
|
|
79
|
+
return style;
|
|
80
|
+
return `${prompt}, ${style}`;
|
|
91
81
|
}
|
package/dist/loop-tools.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const loopToolIntensitySchema: z.ZodEnum<{
|
|
3
|
-
subtle: "subtle";
|
|
4
3
|
medium: "medium";
|
|
4
|
+
subtle: "subtle";
|
|
5
5
|
dynamic: "dynamic";
|
|
6
6
|
}>;
|
|
7
7
|
export declare const loopToolResolutionSchema: z.ZodEnum<{
|
|
@@ -43,8 +43,8 @@ export declare const finalizeLoopToolSourceUploadResponseSchema: z.ZodObject<{
|
|
|
43
43
|
export declare const createLoopToolJobRequestSchema: z.ZodObject<{
|
|
44
44
|
sourceAssetId: z.ZodString;
|
|
45
45
|
intensity: z.ZodDefault<z.ZodEnum<{
|
|
46
|
-
subtle: "subtle";
|
|
47
46
|
medium: "medium";
|
|
47
|
+
subtle: "subtle";
|
|
48
48
|
dynamic: "dynamic";
|
|
49
49
|
}>>;
|
|
50
50
|
resolution: z.ZodDefault<z.ZodEnum<{
|