@anuragpal02/zcl-contracts 0.35.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 CHANGED
@@ -95,6 +95,18 @@ export declare const adminLookTestResponseSchema: z.ZodObject<{
95
95
  imageBase64: z.ZodString;
96
96
  contentType: z.ZodString;
97
97
  }, z.core.$strip>;
98
+ /**
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.
103
+ *
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.
108
+ */
109
+ export declare function applyLookPrompt(lookPrompt: string, userPrompt: string): string;
98
110
  export type Look = z.infer<typeof lookSchema>;
99
111
  export type ListLooksResponse = z.infer<typeof listLooksResponseSchema>;
100
112
  export type GetLookResponse = z.infer<typeof getLookResponseSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"looks.d.ts","sourceRoot":"","sources":["../src/looks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,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,0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js CHANGED
@@ -3,6 +3,12 @@ import { apiSuccessSchema, idSchema, isoDateSchema } from './common.js';
3
3
  // An admin-managed look prompt template for the looks page: a named, categorized
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
+ //
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.
6
12
  export const lookSchema = z.object({
7
13
  id: idSchema,
8
14
  name: z.string(),
@@ -53,3 +59,23 @@ export const adminLookTestResponseSchema = z.object({
53
59
  imageBase64: z.string(),
54
60
  contentType: z.string()
55
61
  });
62
+ /**
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.
67
+ *
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.
72
+ */
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}`;
81
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anuragpal02/zcl-contracts",
3
- "version": "0.35.0",
3
+ "version": "0.37.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",