@umituz/react-native-ai-generation-content 1.37.4 → 1.37.5

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.37.4",
3
+ "version": "1.37.5",
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",
@@ -5,6 +5,8 @@
5
5
  */
6
6
 
7
7
  import type { WizardFeatureConfig } from "../../generation/wizard/domain/entities/wizard-config.types";
8
+ import type { ScenarioInputType } from "../domain/Scenario";
9
+ import { getConfiguredScenario } from "../infrastructure/scenario-registry";
8
10
 
9
11
  declare const __DEV__: boolean;
10
12
 
@@ -27,6 +29,16 @@ export enum WizardInputType {
27
29
  /** @deprecated Use WizardInputType instead */
28
30
  export const FeatureType = WizardInputType;
29
31
 
32
+ /**
33
+ * Map ScenarioInputType to WizardInputType
34
+ * Enables scenarios to define input requirements via inputType field
35
+ */
36
+ const SCENARIO_INPUT_TO_WIZARD_MAP: Record<ScenarioInputType, WizardInputType> = {
37
+ single: WizardInputType.SINGLE_IMAGE,
38
+ dual: WizardInputType.DUAL_IMAGE,
39
+ text: WizardInputType.TEXT_INPUT,
40
+ };
41
+
30
42
  /**
31
43
  * Generic Input Detection Patterns
32
44
  * Only patterns that describe input/output, NOT app-specific scenarios
@@ -234,7 +246,8 @@ export interface WizardConfigOptions {
234
246
  * Priority:
235
247
  * 1. Explicit inputType in options (highest)
236
248
  * 2. Explicit config in SCENARIO_WIZARD_CONFIGS
237
- * 3. Auto-detect from scenario ID patterns
249
+ * 3. Scenario inputType from registry (if configured)
250
+ * 4. Auto-detect from scenario ID patterns
238
251
  *
239
252
  * @example
240
253
  * // Auto-detect from ID
@@ -279,11 +292,35 @@ export const getScenarioWizardConfig = (
279
292
  return config;
280
293
  }
281
294
 
282
- // 3. Auto-detect from scenario ID
295
+ // 3. Check scenario's inputType from registry
296
+ const scenario = getConfiguredScenario(scenarioId);
297
+ if (scenario?.inputType) {
298
+ const wizardInputType = SCENARIO_INPUT_TO_WIZARD_MAP[scenario.inputType];
299
+
300
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
301
+ console.log("[WizardConfig] Using scenario.inputType from registry", {
302
+ scenarioId,
303
+ scenarioInputType: scenario.inputType,
304
+ wizardInputType,
305
+ });
306
+ }
307
+
308
+ const factory = CONFIG_FACTORIES[wizardInputType];
309
+ let config = factory(scenarioId);
310
+ config = mergeConfigOverrides(config, options?.overrides);
311
+
312
+ if (options?.additionalSteps) {
313
+ config = { ...config, steps: [...config.steps, ...options.additionalSteps] };
314
+ }
315
+
316
+ return config;
317
+ }
318
+
319
+ // 4. Auto-detect from scenario ID patterns
283
320
  const inputType = detectWizardInputType(scenarioId);
284
321
 
285
322
  if (typeof __DEV__ !== "undefined" && __DEV__) {
286
- console.log("[WizardConfig] Auto-detected inputType", {
323
+ console.log("[WizardConfig] Auto-detected inputType from patterns", {
287
324
  scenarioId,
288
325
  inputType,
289
326
  });