@anuragpal02/zcl-contracts 0.36.0 → 0.37.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/looks.d.ts +9 -15
- package/dist/looks.d.ts.map +1 -1
- package/dist/looks.js +21 -31
- package/package.json +1 -1
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;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;iBAA+B,CAAA;AAEjE,eAAO,MAAM,4BAA4B;;;;;;iBAMvC,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;;;iBAIrC,CAAA;AAGJ,eAAO,MAAM,2BAA2B;;;;;;;;;;;;iBAEtC,CAAA;AAIF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;iBAA+B,CAAA;AAEnE,eAAO,MAAM,qCAAqC;;;;;;;iBAGhD,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;iBAGrC,CAAA;AAIF,eAAO,MAAM,2BAA2B;;;iBAGtC,CAAA;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAM9E;AAED,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAA;AAC7C,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AACvE,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;AACjF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AACjF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAC/E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AACvE,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAA;AACnG,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,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
|
}
|