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

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.5",
3
+ "version": "1.37.6",
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",
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Wizard Configs Public API
3
+ */
4
+
5
+ export { WizardInputType } from "./wizard-input.types";
6
+ export type { WizardConfigOptions, WizardConfigFactory } from "./wizard-input.types";
7
+
8
+ export { detectWizardInputType, SCENARIO_TO_WIZARD_INPUT_MAP } from "./wizard-input-detector";
9
+
10
+ export { CONFIG_FACTORIES, getConfigFactory } from "./wizard-step-factories";
11
+
12
+ export {
13
+ getScenarioWizardConfig,
14
+ registerWizardConfig,
15
+ hasExplicitConfig,
16
+ getScenarioWizardInputType,
17
+ } from "./wizard-config-resolver";
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Wizard Config Resolver
3
+ * Main resolver for getting wizard configurations
4
+ */
5
+
6
+ import type { WizardFeatureConfig } from "../../generation/wizard/domain/entities/wizard-config.types";
7
+ import { getConfiguredScenario } from "../infrastructure/scenario-registry";
8
+ import { WizardInputType, type WizardConfigOptions } from "./wizard-input.types";
9
+ import { detectWizardInputType, SCENARIO_TO_WIZARD_INPUT_MAP } from "./wizard-input-detector";
10
+ import { getConfigFactory } from "./wizard-step-factories";
11
+
12
+ declare const __DEV__: boolean;
13
+
14
+ const scenarioWizardConfigs: Record<string, WizardFeatureConfig> = {};
15
+
16
+ function mergeConfigOverrides(
17
+ config: WizardFeatureConfig,
18
+ overrides?: Partial<WizardFeatureConfig>,
19
+ ): WizardFeatureConfig {
20
+ if (!overrides) return config;
21
+ return {
22
+ ...config,
23
+ ...overrides,
24
+ steps: overrides.steps ?? config.steps,
25
+ };
26
+ }
27
+
28
+ function applyAdditionalSteps(
29
+ config: WizardFeatureConfig,
30
+ additionalSteps?: WizardFeatureConfig["steps"],
31
+ ): WizardFeatureConfig {
32
+ if (!additionalSteps) return config;
33
+ return { ...config, steps: [...config.steps, ...additionalSteps] };
34
+ }
35
+
36
+ function buildConfig(
37
+ scenarioId: string,
38
+ inputType: WizardInputType,
39
+ options?: WizardConfigOptions,
40
+ ): WizardFeatureConfig {
41
+ const factory = getConfigFactory(inputType);
42
+ let config = factory(scenarioId);
43
+ config = mergeConfigOverrides(config, options?.overrides);
44
+ return applyAdditionalSteps(config, options?.additionalSteps);
45
+ }
46
+
47
+ /**
48
+ * Get wizard config for a scenario
49
+ * Priority: 1. Explicit inputType 2. Registry config 3. Scenario inputType 4. Pattern detection
50
+ */
51
+ export function getScenarioWizardConfig(
52
+ scenarioId: string,
53
+ options?: WizardConfigOptions,
54
+ ): WizardFeatureConfig {
55
+ if (options?.inputType) {
56
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
57
+ console.log("[WizardConfig] Using explicit inputType", { scenarioId, inputType: options.inputType });
58
+ }
59
+ return buildConfig(scenarioId, options.inputType, options);
60
+ }
61
+
62
+ if (scenarioWizardConfigs[scenarioId]) {
63
+ let config = scenarioWizardConfigs[scenarioId];
64
+ config = mergeConfigOverrides(config, options?.overrides);
65
+ return applyAdditionalSteps(config, options?.additionalSteps);
66
+ }
67
+
68
+ const scenario = getConfiguredScenario(scenarioId);
69
+ if (scenario?.inputType) {
70
+ const wizardInputType = SCENARIO_TO_WIZARD_INPUT_MAP[scenario.inputType];
71
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
72
+ console.log("[WizardConfig] Using scenario.inputType", {
73
+ scenarioId,
74
+ scenarioInputType: scenario.inputType,
75
+ wizardInputType,
76
+ });
77
+ }
78
+ return buildConfig(scenarioId, wizardInputType, options);
79
+ }
80
+
81
+ const inputType = detectWizardInputType(scenarioId);
82
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
83
+ console.log("[WizardConfig] Auto-detected inputType", { scenarioId, inputType });
84
+ }
85
+ return buildConfig(scenarioId, inputType, options);
86
+ }
87
+
88
+ /**
89
+ * Register a custom wizard config
90
+ */
91
+ export function registerWizardConfig(scenarioId: string, config: WizardFeatureConfig): void {
92
+ scenarioWizardConfigs[scenarioId] = config;
93
+ }
94
+
95
+ /**
96
+ * Check if scenario has explicit wizard config
97
+ */
98
+ export function hasExplicitConfig(scenarioId: string): boolean {
99
+ return scenarioId in scenarioWizardConfigs;
100
+ }
101
+
102
+ /**
103
+ * Get input type for a scenario
104
+ */
105
+ export function getScenarioWizardInputType(scenarioId: string): WizardInputType {
106
+ return detectWizardInputType(scenarioId);
107
+ }
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Wizard Input Detector
3
+ * Detects wizard input type from scenario ID patterns
4
+ */
5
+
6
+ import type { ScenarioInputType } from "../domain/Scenario";
7
+ import { WizardInputType } from "./wizard-input.types";
8
+
9
+ /**
10
+ * Map ScenarioInputType to WizardInputType
11
+ */
12
+ export const SCENARIO_TO_WIZARD_INPUT_MAP: Record<ScenarioInputType, WizardInputType> = {
13
+ single: WizardInputType.SINGLE_IMAGE,
14
+ dual: WizardInputType.DUAL_IMAGE,
15
+ text: WizardInputType.TEXT_INPUT,
16
+ };
17
+
18
+ /**
19
+ * Pattern-based input detection
20
+ * Only matches generic I/O patterns
21
+ */
22
+ const INPUT_PATTERNS: Record<WizardInputType, readonly RegExp[]> = {
23
+ [WizardInputType.DUAL_IMAGE]: [/ai-kiss/i, /ai-hug/i, /couple/i, /dual/i],
24
+ [WizardInputType.SINGLE_IMAGE]: [
25
+ /^image-to-video$/i,
26
+ /upscale/i,
27
+ /restore/i,
28
+ /enhance/i,
29
+ /remove-background/i,
30
+ /background-remove/i,
31
+ /remove-object/i,
32
+ /hd-touch/i,
33
+ /anime-selfie/i,
34
+ ],
35
+ [WizardInputType.TEXT_INPUT]: [/^text-to-video$/i, /^text-to-image$/i, /prompt-to/i],
36
+ [WizardInputType.DUAL_IMAGE_FACE]: [/face-swap/i, /swap-face/i],
37
+ };
38
+
39
+ const DETECTION_ORDER: readonly WizardInputType[] = [
40
+ WizardInputType.TEXT_INPUT,
41
+ WizardInputType.DUAL_IMAGE,
42
+ WizardInputType.DUAL_IMAGE_FACE,
43
+ WizardInputType.SINGLE_IMAGE,
44
+ ];
45
+
46
+ /**
47
+ * Detect input type from scenario ID using pattern matching
48
+ */
49
+ export function detectWizardInputType(scenarioId: string): WizardInputType {
50
+ for (const type of DETECTION_ORDER) {
51
+ const patterns = INPUT_PATTERNS[type];
52
+ if (patterns.some((pattern) => pattern.test(scenarioId))) {
53
+ return type;
54
+ }
55
+ }
56
+ return WizardInputType.SINGLE_IMAGE;
57
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Wizard Input Types
3
+ * Type definitions for wizard input classification
4
+ */
5
+
6
+ import type { WizardFeatureConfig } from "../../generation/wizard/domain/entities/wizard-config.types";
7
+
8
+ /**
9
+ * Input Type Classification
10
+ * Based on what inputs the wizard needs (photos, text)
11
+ */
12
+ export enum WizardInputType {
13
+ DUAL_IMAGE = "dual_image",
14
+ SINGLE_IMAGE = "single_image",
15
+ TEXT_INPUT = "text_input",
16
+ DUAL_IMAGE_FACE = "dual_image_face",
17
+ }
18
+
19
+ /**
20
+ * Configuration Options for wizard config resolver
21
+ */
22
+ export interface WizardConfigOptions {
23
+ readonly inputType?: WizardInputType;
24
+ readonly additionalSteps?: WizardFeatureConfig["steps"];
25
+ readonly overrides?: Partial<WizardFeatureConfig>;
26
+ }
27
+
28
+ /**
29
+ * Factory function type for creating wizard configs
30
+ */
31
+ export type WizardConfigFactory = (scenarioId: string) => WizardFeatureConfig;
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Wizard Step Factories
3
+ * Factory functions for creating wizard step configurations
4
+ */
5
+
6
+ import type { WizardFeatureConfig } from "../../generation/wizard/domain/entities/wizard-config.types";
7
+ import { WizardInputType, type WizardConfigFactory } from "./wizard-input.types";
8
+
9
+ function createDualImageConfig(scenarioId: string): WizardFeatureConfig {
10
+ return {
11
+ id: scenarioId,
12
+ name: scenarioId,
13
+ steps: [
14
+ {
15
+ id: "photo_1",
16
+ type: "photo_upload",
17
+ titleKey: "photoUpload.first.title",
18
+ subtitleKey: "photoUpload.first.subtitle",
19
+ showFaceDetection: true,
20
+ showPhotoTips: true,
21
+ required: true,
22
+ },
23
+ {
24
+ id: "photo_2",
25
+ type: "photo_upload",
26
+ titleKey: "photoUpload.second.title",
27
+ subtitleKey: "photoUpload.second.subtitle",
28
+ showFaceDetection: true,
29
+ showPhotoTips: true,
30
+ required: true,
31
+ },
32
+ ],
33
+ };
34
+ }
35
+
36
+ function createSingleImageConfig(scenarioId: string): WizardFeatureConfig {
37
+ return {
38
+ id: scenarioId,
39
+ name: scenarioId,
40
+ steps: [
41
+ {
42
+ id: "photo_1",
43
+ type: "photo_upload",
44
+ titleKey: "photoUpload.single.title",
45
+ subtitleKey: "photoUpload.single.subtitle",
46
+ showFaceDetection: false,
47
+ showPhotoTips: true,
48
+ required: true,
49
+ },
50
+ ],
51
+ };
52
+ }
53
+
54
+ function createTextInputConfig(scenarioId: string): WizardFeatureConfig {
55
+ return {
56
+ id: scenarioId,
57
+ name: scenarioId,
58
+ steps: [
59
+ {
60
+ id: "text_input",
61
+ type: "text_input",
62
+ titleKey: "textInput.title",
63
+ subtitleKey: "textInput.subtitle",
64
+ placeholderKey: "textInput.placeholder",
65
+ minLength: 10,
66
+ maxLength: 500,
67
+ multiline: true,
68
+ required: true,
69
+ },
70
+ ],
71
+ };
72
+ }
73
+
74
+ function createDualImageFaceConfig(scenarioId: string): WizardFeatureConfig {
75
+ return {
76
+ id: scenarioId,
77
+ name: scenarioId,
78
+ steps: [
79
+ {
80
+ id: "photo_1",
81
+ type: "photo_upload",
82
+ titleKey: "photoUpload.source.title",
83
+ subtitleKey: "photoUpload.source.subtitle",
84
+ showFaceDetection: true,
85
+ showPhotoTips: true,
86
+ required: true,
87
+ },
88
+ {
89
+ id: "photo_2",
90
+ type: "photo_upload",
91
+ titleKey: "photoUpload.target.title",
92
+ subtitleKey: "photoUpload.target.subtitle",
93
+ showFaceDetection: false,
94
+ showPhotoTips: true,
95
+ required: true,
96
+ },
97
+ ],
98
+ };
99
+ }
100
+
101
+ /**
102
+ * Registry of config factories by input type
103
+ */
104
+ export const CONFIG_FACTORIES: Record<WizardInputType, WizardConfigFactory> = {
105
+ [WizardInputType.DUAL_IMAGE]: createDualImageConfig,
106
+ [WizardInputType.SINGLE_IMAGE]: createSingleImageConfig,
107
+ [WizardInputType.TEXT_INPUT]: createTextInputConfig,
108
+ [WizardInputType.DUAL_IMAGE_FACE]: createDualImageFaceConfig,
109
+ };
110
+
111
+ /**
112
+ * Get factory for a specific input type
113
+ */
114
+ export function getConfigFactory(inputType: WizardInputType): WizardConfigFactory {
115
+ return CONFIG_FACTORIES[inputType];
116
+ }
@@ -37,19 +37,14 @@ export { createStoryTemplate } from "./infrastructure/utils/scenario-utils";
37
37
  // Wizard Configurations - App-agnostic, classifies by INPUT REQUIREMENTS
38
38
  export {
39
39
  WizardInputType,
40
- SCENARIO_WIZARD_CONFIGS,
41
40
  detectWizardInputType,
42
41
  getScenarioWizardConfig,
43
42
  hasExplicitConfig,
44
43
  getScenarioWizardInputType,
45
44
  registerWizardConfig,
46
- // Deprecated (backward compatibility)
47
- FeatureType,
48
- detectFeatureType,
49
- getScenarioFeatureType,
50
- } from "./configs/wizard-configs";
45
+ } from "./configs";
51
46
 
52
- export type { WizardConfigOptions } from "./configs/wizard-configs";
47
+ export type { WizardConfigOptions } from "./configs";
53
48
 
54
49
  // Presentation - Containers
55
50
  export { CategoryNavigationContainer } from "./presentation/containers";
@@ -1,368 +0,0 @@
1
- /**
2
- * Wizard Configurations - App-Agnostic
3
- * Classifies features by INPUT REQUIREMENTS, not app-specific scenarios
4
- * Apps can override inputType or provide custom step configurations
5
- */
6
-
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";
10
-
11
- declare const __DEV__: boolean;
12
-
13
- /**
14
- * Input Type Classification
15
- * Based on what inputs the wizard needs (photos, text)
16
- * NOT based on app-specific scenario names
17
- */
18
- export enum WizardInputType {
19
- /** Two images required (any two-person/two-image scenario) */
20
- DUAL_IMAGE = "dual_image",
21
- /** Single image required */
22
- SINGLE_IMAGE = "single_image",
23
- /** Text input only, no images */
24
- TEXT_INPUT = "text_input",
25
- /** Two images with face detection (face swap scenarios) */
26
- DUAL_IMAGE_FACE = "dual_image_face",
27
- }
28
-
29
- /** @deprecated Use WizardInputType instead */
30
- export const FeatureType = WizardInputType;
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
-
42
- /**
43
- * Generic Input Detection Patterns
44
- * Only patterns that describe input/output, NOT app-specific scenarios
45
- */
46
- const INPUT_PATTERNS: Record<WizardInputType, RegExp[]> = {
47
- [WizardInputType.DUAL_IMAGE]: [
48
- /ai-kiss/i,
49
- /ai-hug/i,
50
- /couple/i,
51
- /dual/i,
52
- ],
53
-
54
- [WizardInputType.SINGLE_IMAGE]: [
55
- /^image-to-video$/i,
56
- /upscale/i,
57
- /restore/i,
58
- /enhance/i,
59
- /remove-background/i,
60
- /background-remove/i,
61
- /remove-object/i,
62
- /hd-touch/i,
63
- /anime-selfie/i,
64
- ],
65
-
66
- [WizardInputType.TEXT_INPUT]: [
67
- /^text-to-video$/i,
68
- /^text-to-image$/i,
69
- /prompt-to/i,
70
- ],
71
-
72
- [WizardInputType.DUAL_IMAGE_FACE]: [
73
- /face-swap/i,
74
- /swap-face/i,
75
- ],
76
- };
77
-
78
- /**
79
- * Detect input type from scenario ID
80
- * Only matches generic I/O patterns
81
- * Returns SINGLE_IMAGE as safe default
82
- */
83
- export const detectWizardInputType = (scenarioId: string): WizardInputType => {
84
- // Check patterns in priority order: TEXT_INPUT, DUAL_IMAGE, DUAL_IMAGE_FACE, SINGLE_IMAGE
85
- const checkOrder: WizardInputType[] = [
86
- WizardInputType.TEXT_INPUT,
87
- WizardInputType.DUAL_IMAGE,
88
- WizardInputType.DUAL_IMAGE_FACE,
89
- WizardInputType.SINGLE_IMAGE,
90
- ];
91
-
92
- for (const type of checkOrder) {
93
- const patterns = INPUT_PATTERNS[type];
94
- if (patterns.some((pattern) => pattern.test(scenarioId))) {
95
- return type;
96
- }
97
- }
98
-
99
- // Safe default: SINGLE_IMAGE (most common use case)
100
- return WizardInputType.SINGLE_IMAGE;
101
- };
102
-
103
- /**
104
- * Config Factory: DUAL_IMAGE (2 photos required)
105
- * Generic labels - apps provide translations
106
- */
107
- const createDualImageConfig = (scenarioId: string): WizardFeatureConfig => ({
108
- id: scenarioId,
109
- name: scenarioId,
110
- steps: [
111
- {
112
- id: "photo_1",
113
- type: "photo_upload",
114
- titleKey: "photoUpload.first.title",
115
- subtitleKey: "photoUpload.first.subtitle",
116
- showFaceDetection: true,
117
- showPhotoTips: true,
118
- required: true,
119
- },
120
- {
121
- id: "photo_2",
122
- type: "photo_upload",
123
- titleKey: "photoUpload.second.title",
124
- subtitleKey: "photoUpload.second.subtitle",
125
- showFaceDetection: true,
126
- showPhotoTips: true,
127
- required: true,
128
- },
129
- ],
130
- });
131
-
132
- /**
133
- * Config Factory: SINGLE_IMAGE (1 photo required)
134
- */
135
- const createSingleImageConfig = (scenarioId: string): WizardFeatureConfig => ({
136
- id: scenarioId,
137
- name: scenarioId,
138
- steps: [
139
- {
140
- id: "photo_1",
141
- type: "photo_upload",
142
- titleKey: "photoUpload.single.title",
143
- subtitleKey: "photoUpload.single.subtitle",
144
- showFaceDetection: false,
145
- showPhotoTips: true,
146
- required: true,
147
- },
148
- ],
149
- });
150
-
151
- /**
152
- * Config Factory: TEXT_INPUT (text only, no photos)
153
- */
154
- const createTextInputConfig = (scenarioId: string): WizardFeatureConfig => ({
155
- id: scenarioId,
156
- name: scenarioId,
157
- steps: [
158
- {
159
- id: "text_input",
160
- type: "text_input",
161
- titleKey: "textInput.title",
162
- subtitleKey: "textInput.subtitle",
163
- placeholderKey: "textInput.placeholder",
164
- minLength: 10,
165
- maxLength: 500,
166
- multiline: true,
167
- required: true,
168
- },
169
- ],
170
- });
171
-
172
- /**
173
- * Config Factory: DUAL_IMAGE_FACE (2 photos with face detection)
174
- */
175
- const createDualImageFaceConfig = (scenarioId: string): WizardFeatureConfig => ({
176
- id: scenarioId,
177
- name: scenarioId,
178
- steps: [
179
- {
180
- id: "photo_1",
181
- type: "photo_upload",
182
- titleKey: "photoUpload.source.title",
183
- subtitleKey: "photoUpload.source.subtitle",
184
- showFaceDetection: true,
185
- showPhotoTips: true,
186
- required: true,
187
- },
188
- {
189
- id: "photo_2",
190
- type: "photo_upload",
191
- titleKey: "photoUpload.target.title",
192
- subtitleKey: "photoUpload.target.subtitle",
193
- showFaceDetection: false,
194
- showPhotoTips: true,
195
- required: true,
196
- },
197
- ],
198
- });
199
-
200
- /**
201
- * Config Factories Registry
202
- */
203
- const CONFIG_FACTORIES: Record<WizardInputType, (id: string) => WizardFeatureConfig> = {
204
- [WizardInputType.DUAL_IMAGE]: createDualImageConfig,
205
- [WizardInputType.SINGLE_IMAGE]: createSingleImageConfig,
206
- [WizardInputType.TEXT_INPUT]: createTextInputConfig,
207
- [WizardInputType.DUAL_IMAGE_FACE]: createDualImageFaceConfig,
208
- };
209
-
210
- /**
211
- * Explicit Wizard Configs (Optional)
212
- * Apps can register custom configs for specific scenario IDs
213
- */
214
- export const SCENARIO_WIZARD_CONFIGS: Record<string, WizardFeatureConfig> = {};
215
-
216
- /**
217
- * Merge config with overrides
218
- */
219
- const mergeConfigOverrides = (
220
- config: WizardFeatureConfig,
221
- overrides?: Partial<WizardFeatureConfig>,
222
- ): WizardFeatureConfig => {
223
- if (!overrides) return config;
224
- return {
225
- ...config,
226
- ...overrides,
227
- steps: overrides.steps || config.steps,
228
- };
229
- };
230
-
231
- /**
232
- * Configuration Options
233
- */
234
- export interface WizardConfigOptions {
235
- /** Explicit input type - highest priority */
236
- readonly inputType?: WizardInputType;
237
- /** Additional steps to append */
238
- readonly additionalSteps?: WizardFeatureConfig["steps"];
239
- /** Custom overrides */
240
- readonly overrides?: Partial<WizardFeatureConfig>;
241
- }
242
-
243
- /**
244
- * Get wizard config for a scenario
245
- *
246
- * Priority:
247
- * 1. Explicit inputType in options (highest)
248
- * 2. Explicit config in SCENARIO_WIZARD_CONFIGS
249
- * 3. Scenario inputType from registry (if configured)
250
- * 4. Auto-detect from scenario ID patterns
251
- *
252
- * @example
253
- * // Auto-detect from ID
254
- * getScenarioWizardConfig("text-to-video")
255
- *
256
- * // Explicit input type for app-specific scenarios
257
- * getScenarioWizardConfig("ai-kiss", { inputType: WizardInputType.DUAL_IMAGE })
258
- */
259
- export const getScenarioWizardConfig = (
260
- scenarioId: string,
261
- options?: WizardConfigOptions,
262
- ): WizardFeatureConfig => {
263
- // 1. Explicit inputType (highest priority)
264
- if (options?.inputType) {
265
- const factory = CONFIG_FACTORIES[options.inputType];
266
- let config = factory(scenarioId);
267
- config = mergeConfigOverrides(config, options.overrides);
268
-
269
- if (options.additionalSteps) {
270
- config = { ...config, steps: [...config.steps, ...options.additionalSteps] };
271
- }
272
-
273
- if (typeof __DEV__ !== "undefined" && __DEV__) {
274
- console.log("[WizardConfig] Using explicit inputType", {
275
- scenarioId,
276
- inputType: options.inputType,
277
- });
278
- }
279
-
280
- return config;
281
- }
282
-
283
- // 2. Explicit config in registry
284
- if (SCENARIO_WIZARD_CONFIGS[scenarioId]) {
285
- let config = SCENARIO_WIZARD_CONFIGS[scenarioId];
286
- config = mergeConfigOverrides(config, options?.overrides);
287
-
288
- if (options?.additionalSteps) {
289
- config = { ...config, steps: [...config.steps, ...options.additionalSteps] };
290
- }
291
-
292
- return config;
293
- }
294
-
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
320
- const inputType = detectWizardInputType(scenarioId);
321
-
322
- if (typeof __DEV__ !== "undefined" && __DEV__) {
323
- console.log("[WizardConfig] Auto-detected inputType from patterns", {
324
- scenarioId,
325
- inputType,
326
- });
327
- }
328
-
329
- const factory = CONFIG_FACTORIES[inputType];
330
- let config = factory(scenarioId);
331
- config = mergeConfigOverrides(config, options?.overrides);
332
-
333
- if (options?.additionalSteps) {
334
- config = { ...config, steps: [...config.steps, ...options.additionalSteps] };
335
- }
336
-
337
- return config;
338
- };
339
-
340
- /**
341
- * Register a custom wizard config for a scenario
342
- */
343
- export const registerWizardConfig = (
344
- scenarioId: string,
345
- config: WizardFeatureConfig,
346
- ): void => {
347
- SCENARIO_WIZARD_CONFIGS[scenarioId] = config;
348
- };
349
-
350
- /**
351
- * Check if scenario has explicit wizard config
352
- */
353
- export const hasExplicitConfig = (scenarioId: string): boolean => {
354
- return scenarioId in SCENARIO_WIZARD_CONFIGS;
355
- };
356
-
357
- /**
358
- * Get input type for a scenario
359
- */
360
- export const getScenarioWizardInputType = (scenarioId: string): WizardInputType => {
361
- return detectWizardInputType(scenarioId);
362
- };
363
-
364
- /** @deprecated Use getScenarioWizardInputType instead */
365
- export const getScenarioFeatureType = getScenarioWizardInputType;
366
-
367
- /** @deprecated Use detectWizardInputType instead */
368
- export const detectFeatureType = detectWizardInputType;