@umituz/react-native-ai-generation-content 1.89.34 → 1.89.35

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-ai-generation-content",
3
- "version": "1.89.34",
3
+ "version": "1.89.35",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -7,9 +7,10 @@ import type { WizardScenarioData } from "../../presentation/hooks/useWizardGener
7
7
  import type { WizardStrategy } from "./wizard-strategy.types";
8
8
  import { DEFAULT_STYLE_VALUE, IMAGE_PROCESSING_PROMPTS } from "./wizard-strategy.constants";
9
9
  import { extractPrompt, extractSelection } from "../utils";
10
- import { extractPhotosAsBase64 } from "./shared/photo-extraction.utils";
10
+ import { extractPhotosAsBase64, extractPhotoUris } from "./shared/photo-extraction.utils";
11
11
  import { executeImageGeneration } from "./image-generation.executor";
12
12
  import type { WizardImageInput, CreateImageStrategyOptions } from "./image-generation.types";
13
+ import { enhancePromptWithAnalysis } from "../../../infrastructure/appearance-analysis";
13
14
 
14
15
 
15
16
  // ============================================================================
@@ -20,6 +21,8 @@ export async function buildImageInput(
20
21
  wizardData: Record<string, unknown>,
21
22
  scenario: WizardScenarioData,
22
23
  ): Promise<WizardImageInput | null> {
24
+ // Extract photo URIs first (for couple refinement)
25
+ const photoUris = extractPhotoUris(wizardData);
23
26
  const photos = await extractPhotosAsBase64(wizardData);
24
27
 
25
28
  // Extract prompt with fallback to default
@@ -38,6 +41,20 @@ export async function buildImageInput(
38
41
  let finalPrompt = prompt;
39
42
  if (photos.length > 0) {
40
43
  finalPrompt = applyStyleEnhancements(prompt, wizardData);
44
+
45
+ // ✅ Apply couple refinement (same logic as Wardrobe)
46
+ // This ensures consistency across all couple generation scenarios
47
+ const isCoupleMode = photos.length >= 2;
48
+ finalPrompt = await enhancePromptWithAnalysis(finalPrompt, photoUris, isCoupleMode);
49
+
50
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
51
+ console.log("[ImageStrategy] Prompt enhanced with couple refinement", {
52
+ photoCount: photos.length,
53
+ isCoupleMode,
54
+ originalPromptLength: prompt.length,
55
+ finalPromptLength: finalPrompt.length,
56
+ });
57
+ }
41
58
  }
42
59
 
43
60
  // Extract style for text-to-image
@@ -115,8 +115,9 @@ async function ensureOptimalSize(uri: string): Promise<string> {
115
115
 
116
116
  /**
117
117
  * Extracts photo URIs from wizard data
118
+ * Exported for use in other strategies (e.g., couple refinement)
118
119
  */
119
- function extractPhotoUris(wizardData: Record<string, unknown>): string[] {
120
+ export function extractPhotoUris(wizardData: Record<string, unknown>): string[] {
120
121
  const photoKeys = Object.keys(wizardData)
121
122
  .filter((k) => k.includes(PHOTO_KEY_PREFIX))
122
123
  .sort();