@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 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 a look's style template and the
101
- * user's subject — the single definition of what "applying a look" means,
102
- * shared by the admin test window and the web app's concept step so the two
103
- * can never drift.
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
- * Rules:
106
- * - Template contains `{subject}` substitute (every occurrence) with the
107
- * trimmed subject. With an empty subject the marker is simply removed and
108
- * the template stands alone.
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, subject: string): 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>;
@@ -1 +1 @@
1
- {"version":3,"file":"looks.d.ts","sourceRoot":"","sources":["../src/looks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAWvB,eAAO,MAA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AAG,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 TEMPLATE, not necessarily a complete prompt: the
8
- // user supplies the subject and the platform composes the final generation
9
- // prompt (see applyLookPrompt). Mark where the subject lands with `{subject}`;
10
- // templates without the marker get the style appended after the subject.
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 a look's style template and the
65
- * user's subject — the single definition of what "applying a look" means,
66
- * shared by the admin test window and the web app's concept step so the two
67
- * can never drift.
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
- * Rules:
70
- * - Template contains `{subject}` substitute (every occurrence) with the
71
- * trimmed subject. With an empty subject the marker is simply removed and
72
- * the template stands alone.
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, subject) {
80
- const template = lookPrompt.trim();
81
- const trimmedSubject = subject.trim();
82
- if (template.includes(LOOK_SUBJECT_PLACEHOLDER)) {
83
- return template
84
- .split(LOOK_SUBJECT_PLACEHOLDER)
85
- .join(trimmedSubject)
86
- .replace(/ {2,}/g, ' ')
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anuragpal02/zcl-contracts",
3
- "version": "0.36.0",
3
+ "version": "0.37.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",