@umituz/react-native-ai-generation-content 1.65.0 → 1.65.2
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 +1 -1
- package/src/domain/constants/processing-modes-catalog.constants.ts +97 -0
- package/src/domain/constants/processing-modes-filters.ts +34 -0
- package/src/domain/constants/processing-modes-getters.ts +20 -0
- package/src/domain/constants/processing-modes.constants.ts +8 -134
- package/src/domain/entities/feature-flow-config.types.ts +17 -0
- package/src/domain/entities/flow-actions.types.ts +26 -0
- package/src/domain/entities/flow-config-data.types.ts +41 -0
- package/src/domain/entities/flow-config.types.ts +17 -169
- package/src/domain/entities/flow-configuration.types.ts +44 -0
- package/src/domain/entities/flow-state.types.ts +30 -0
- package/src/domain/entities/flow-step.types.ts +56 -0
- package/src/domain/entities/scenario-step-config.types.ts +32 -0
- package/src/domain/entities/step-config.types.ts +14 -129
- package/src/domain/entities/step-definition.types.ts +50 -0
- package/src/domain/entities/step-input-config.types.ts +36 -0
- package/src/domain/entities/step-upload-config.types.ts +17 -0
- package/src/domain/interfaces/ai-provider-capabilities.types.ts +27 -0
- package/src/domain/interfaces/ai-provider-config.types.ts +30 -0
- package/src/domain/interfaces/ai-provider-feature-types.ts +22 -0
- package/src/domain/interfaces/ai-provider-input.types.ts +28 -0
- package/src/domain/interfaces/ai-provider-progress.types.ts +37 -0
- package/src/domain/interfaces/ai-provider-status.types.ts +41 -0
- package/src/domain/interfaces/ai-provider.interface.ts +32 -142
- package/src/domain/types/result-constructors.ts +20 -0
- package/src/domain/types/result-guards.ts +20 -0
- package/src/domain/types/result-transformers.ts +36 -0
- package/src/domain/types/result-type-definitions.ts +27 -0
- package/src/domain/types/result-unwrappers.ts +28 -0
- package/src/domain/types/result.types.ts +11 -100
- package/src/domains/background/infrastructure/utils/polling-interval.util.ts +3 -8
- package/src/domains/background/infrastructure/utils/result-validation-logic.ts +88 -0
- package/src/domains/background/infrastructure/utils/result-validator-constants.ts +18 -0
- package/src/domains/background/infrastructure/utils/result-validator.types.ts +16 -0
- package/src/domains/background/infrastructure/utils/result-validator.util.ts +8 -109
- package/src/domains/background/infrastructure/utils/status-checker.types.ts +11 -0
- package/src/domains/background/infrastructure/utils/status-checker.util.ts +9 -119
- package/src/domains/background/infrastructure/utils/status-error-detector.ts +61 -0
- package/src/domains/background/infrastructure/utils/status-extraction-helpers.ts +25 -0
- package/src/domains/background/infrastructure/utils/status-predicates.ts +37 -0
- package/src/domains/creations/domain-exports.ts +79 -0
- package/src/domains/creations/index.ts +9 -169
- package/src/domains/creations/infrastructure/repositories/creation-create.operations.ts +40 -0
- package/src/domains/creations/infrastructure/repositories/creation-delete.operations.ts +63 -0
- package/src/domains/creations/infrastructure/repositories/creation-update.operations.ts +77 -0
- package/src/domains/creations/infrastructure/repositories/creations-operations.ts +9 -210
- package/src/domains/creations/infrastructure-exports.ts +9 -0
- package/src/domains/creations/presentation-exports.ts +59 -0
- package/src/domains/generation/infrastructure/executors/text-to-image-executor.helpers.ts +81 -0
- package/src/domains/generation/infrastructure/executors/text-to-image-executor.ts +4 -100
- package/src/domains/generation/infrastructure/executors/text-to-image-executor.types.ts +19 -0
- package/src/domains/generation/infrastructure/flow/use-flow-store.types.ts +19 -0
- package/src/domains/generation/infrastructure/flow/useFlowStore.ts +33 -65
- package/src/domains/generation/wizard/domain/entities/wizard-config-builder.ts +75 -0
- package/src/domains/generation/wizard/domain/entities/wizard-feature-config.types.ts +29 -0
- package/src/domains/generation/wizard/domain/entities/wizard-feature.types.ts +9 -114
- package/src/domains/generation/wizard/domain/entities/wizard-presets.constants.ts +23 -0
- package/src/domains/generation/wizard/infrastructure/strategies/shared/unified-prompt-builder.ts +1 -1
- package/src/domains/generation/wizard/infrastructure/utils/creation-persistence-factory.ts +33 -0
- package/src/domains/generation/wizard/infrastructure/utils/creation-persistence.types.ts +22 -0
- package/src/domains/generation/wizard/infrastructure/utils/creation-persistence.util.ts +11 -135
- package/src/domains/generation/wizard/infrastructure/utils/creation-save-operations.ts +48 -0
- package/src/domains/generation/wizard/infrastructure/utils/creation-update-operations.ts +72 -0
- package/src/domains/generation/wizard/presentation/hooks/use-video-queue-generation.types.ts +21 -0
- package/src/domains/generation/wizard/presentation/hooks/useVideoQueueGeneration.ts +14 -35
- package/src/domains/image-to-video/domain/types/image-to-video-callbacks.types.ts +33 -0
- package/src/domains/image-to-video/domain/types/image-to-video-config.types.ts +29 -0
- package/src/domains/image-to-video/domain/types/image-to-video-request.types.ts +31 -0
- package/src/domains/image-to-video/domain/types/image-to-video-result.types.ts +17 -0
- package/src/domains/image-to-video/domain/types/image-to-video-state.types.ts +24 -0
- package/src/domains/image-to-video/domain/types/image-to-video.types.ts +24 -114
- package/src/domains/image-to-video/infrastructure/services/image-to-video-executor.ts +26 -99
- package/src/domains/image-to-video/infrastructure/services/image-to-video-executor.types.ts +15 -0
- package/src/domains/prompts/domain/base/constants.ts +47 -0
- package/src/domains/prompts/domain/base/creators.ts +76 -0
- package/src/domains/prompts/domain/base/types.ts +10 -0
- package/src/domains/prompts/domain/entities/MultiPersonPromptStructure.ts +1 -1
- package/src/domains/prompts/index.ts +4 -2
- package/src/domains/prompts/infrastructure/services/ImagePromptBuilder.ts +2 -72
- package/src/domains/prompts/infrastructure/services/image-prompt-builder.types.ts +17 -0
- package/src/domains/result-preview/presentation/types/result-components.types.ts +47 -0
- package/src/domains/result-preview/presentation/types/result-creation.types.ts +14 -0
- package/src/domains/result-preview/presentation/types/result-data.types.ts +35 -0
- package/src/domains/result-preview/presentation/types/result-hooks.types.ts +35 -0
- package/src/domains/result-preview/presentation/types/result-preview.types.ts +19 -182
- package/src/domains/result-preview/presentation/types/result-screen.types.ts +69 -0
- package/src/domains/text-to-image/domain-exports.ts +50 -0
- package/src/domains/text-to-image/index.ts +11 -102
- package/src/domains/text-to-image/infrastructure-exports.ts +6 -0
- package/src/domains/text-to-image/presentation/hooks/useFormState.ts +39 -24
- package/src/domains/text-to-image/presentation/hooks/useGeneration.ts +5 -3
- package/src/domains/text-to-image/presentation-exports.ts +41 -0
- package/src/domains/text-to-video/domain/types/action-component.types.ts +15 -0
- package/src/domains/text-to-video/domain/types/component.types.ts +16 -103
- package/src/domains/text-to-video/domain/types/content-component.types.ts +30 -0
- package/src/domains/text-to-video/domain/types/panel-component.types.ts +24 -0
- package/src/domains/text-to-video/domain/types/selector-component.types.ts +31 -0
- package/src/domains/text-to-video/domain/types/tab-component.types.ts +26 -0
- package/src/index.ts +0 -10
- package/src/infrastructure/executors/base-executor.ts +40 -112
- package/src/infrastructure/executors/base-executor.types.ts +10 -0
- package/src/infrastructure/http/http-client-methods.ts +73 -0
- package/src/infrastructure/http/http-client.util.ts +8 -163
- package/src/infrastructure/http/http-fetch-handler.ts +53 -0
- package/src/infrastructure/http/http-methods.constants.ts +23 -0
- package/src/infrastructure/http/http-request-executor.ts +49 -0
- package/src/infrastructure/http/http-response-parser.ts +53 -0
- package/src/infrastructure/orchestration/GenerationOrchestrator.ts +8 -43
- package/src/infrastructure/utils/classifier-helpers.ts +36 -0
- package/src/infrastructure/utils/content-validators.ts +92 -0
- package/src/infrastructure/utils/domain-guards.ts +22 -0
- package/src/infrastructure/utils/error-classification.ts +122 -0
- package/src/infrastructure/utils/error-classifier.util.ts +8 -181
- package/src/infrastructure/utils/error-classifiers.ts +49 -0
- package/src/infrastructure/utils/error-extractors.ts +42 -0
- package/src/infrastructure/utils/error-factory.ts +25 -0
- package/src/infrastructure/utils/error-handlers.ts +51 -0
- package/src/infrastructure/utils/error-handling.util.ts +7 -186
- package/src/infrastructure/utils/error-message-extractor.util.ts +10 -172
- package/src/infrastructure/utils/error-retry.ts +44 -0
- package/src/infrastructure/utils/error-types.ts +23 -0
- package/src/infrastructure/utils/extraction-types.ts +37 -0
- package/src/infrastructure/utils/fal-error-checker.ts +44 -0
- package/src/infrastructure/utils/general-validators.ts +64 -0
- package/src/infrastructure/utils/id-validators.ts +39 -0
- package/src/infrastructure/utils/message-extractor.ts +89 -0
- package/src/infrastructure/utils/primitive-guards.ts +66 -0
- package/src/infrastructure/utils/result-polling.ts +39 -0
- package/src/infrastructure/utils/structure-guards.ts +75 -0
- package/src/infrastructure/utils/type-guards.util.ts +22 -149
- package/src/infrastructure/utils/validation-types.ts +8 -0
- package/src/infrastructure/utils/validation.util.ts +14 -184
- package/src/presentation/hooks/ai-feature-callbacks-auth.hooks.ts +43 -0
- package/src/presentation/hooks/ai-feature-callbacks-cost.hooks.ts +56 -0
- package/src/presentation/hooks/ai-feature-callbacks-execution.hooks.ts +66 -0
- package/src/presentation/hooks/ai-feature-callbacks.types.ts +69 -0
- package/src/presentation/hooks/generation/use-image-generation.types.ts +39 -0
- package/src/presentation/hooks/generation/useImageGeneration.ts +33 -99
- package/src/presentation/hooks/generation-flow-navigation.ts +58 -0
- package/src/presentation/hooks/generation-flow-updates.ts +67 -0
- package/src/presentation/hooks/generation-flow.types.ts +32 -0
- package/src/presentation/hooks/useAIFeatureCallbacks.ts +48 -138
- package/src/presentation/hooks/useGenerationFlow.ts +40 -136
- package/src/presentation/types/flow-config.types.ts +9 -140
- package/src/presentation/types/flow-generation-config.types.ts +25 -0
- package/src/presentation/types/flow-state.types.ts +16 -0
- package/src/presentation/types/flow-step-configs.types.ts +48 -0
- package/src/presentation/types/flow-step-data.types.ts +24 -0
- package/src/presentation/types/result-actions.types.ts +50 -0
- package/src/presentation/types/result-config.types.ts +22 -171
- package/src/presentation/types/result-header.types.ts +44 -0
- package/src/presentation/types/result-image.types.ts +29 -0
- package/src/presentation/types/result-layout.types.ts +26 -0
- package/src/presentation/types/result-story.types.ts +42 -0
- package/src/domains/prompts/domain/entities/BasePromptStructure.ts +0 -168
- package/src/exports/domains.ts +0 -149
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flow Step Types
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type { FlowState } from "./flow-state.types";
|
|
6
|
+
import type { FlowActions } from "./flow-actions.types";
|
|
7
|
+
|
|
8
|
+
/** Step Types */
|
|
9
|
+
export enum StepType {
|
|
10
|
+
// Gate steps - auth and credits check
|
|
11
|
+
AUTH_GATE = "auth_gate",
|
|
12
|
+
CREDIT_GATE = "credit_gate",
|
|
13
|
+
// Content steps
|
|
14
|
+
CATEGORY_SELECTION = "category_selection",
|
|
15
|
+
SCENARIO_SELECTION = "scenario_selection",
|
|
16
|
+
SCENARIO_PREVIEW = "scenario_preview",
|
|
17
|
+
PARTNER_UPLOAD = "partner_upload",
|
|
18
|
+
TEXT_INPUT = "text_input",
|
|
19
|
+
FEATURE_SELECTION = "feature_selection",
|
|
20
|
+
// Generation steps
|
|
21
|
+
GENERATING = "generating",
|
|
22
|
+
RESULT_PREVIEW = "result_preview",
|
|
23
|
+
CUSTOM = "custom",
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Gate Step Result */
|
|
27
|
+
export type GateResult = "passed" | "blocked" | "pending";
|
|
28
|
+
|
|
29
|
+
/** Step Transition */
|
|
30
|
+
export interface StepTransition {
|
|
31
|
+
readonly next?: string | ((state: FlowState) => string | null);
|
|
32
|
+
readonly back?: string;
|
|
33
|
+
readonly skipIf?: (state: FlowState) => boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Step Definition */
|
|
37
|
+
export interface StepDefinition<TConfig = unknown> {
|
|
38
|
+
readonly id: string;
|
|
39
|
+
readonly type: StepType;
|
|
40
|
+
readonly required?: boolean;
|
|
41
|
+
readonly config?: TConfig;
|
|
42
|
+
readonly transitions?: StepTransition;
|
|
43
|
+
readonly component?: React.ComponentType<StepComponentProps>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Step Component Props */
|
|
47
|
+
export interface StepComponentProps {
|
|
48
|
+
readonly step: StepDefinition;
|
|
49
|
+
readonly state: FlowState;
|
|
50
|
+
readonly actions: FlowActions;
|
|
51
|
+
readonly onNext: () => void;
|
|
52
|
+
readonly onBack: () => void;
|
|
53
|
+
readonly isProcessing: boolean;
|
|
54
|
+
readonly progress: number;
|
|
55
|
+
readonly error: string | null;
|
|
56
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scenario Step Configuration Types
|
|
3
|
+
* Simplified config for scenario-based flows
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Scenario Step Configuration
|
|
8
|
+
*/
|
|
9
|
+
export interface ScenarioStepConfig {
|
|
10
|
+
readonly photoUploads?: {
|
|
11
|
+
readonly count: number;
|
|
12
|
+
readonly labels?: readonly string[];
|
|
13
|
+
readonly showFaceDetection?: boolean;
|
|
14
|
+
readonly showNameInput?: boolean;
|
|
15
|
+
};
|
|
16
|
+
readonly textInput?: {
|
|
17
|
+
readonly enabled: boolean;
|
|
18
|
+
readonly required?: boolean;
|
|
19
|
+
readonly minLength?: number;
|
|
20
|
+
readonly maxLength?: number;
|
|
21
|
+
};
|
|
22
|
+
readonly styleSelection?: {
|
|
23
|
+
readonly enabled: boolean;
|
|
24
|
+
readonly required?: boolean;
|
|
25
|
+
readonly styles?: readonly string[];
|
|
26
|
+
};
|
|
27
|
+
readonly durationSelection?: {
|
|
28
|
+
readonly enabled: boolean;
|
|
29
|
+
readonly required?: boolean;
|
|
30
|
+
readonly durations?: readonly number[];
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -1,133 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Dynamic Step Configuration Types
|
|
2
|
+
* Dynamic Step Configuration Types - Barrel Export
|
|
3
3
|
* Configuration-driven wizard flow system
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
readonly required?: boolean;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Text Input Step Config
|
|
24
|
-
*/
|
|
25
|
-
export interface TextInputStepConfig {
|
|
26
|
-
readonly id: string;
|
|
27
|
-
readonly titleKey?: string;
|
|
28
|
-
readonly placeholderKey?: string;
|
|
29
|
-
readonly minLength?: number;
|
|
30
|
-
readonly maxLength?: number;
|
|
31
|
-
readonly required?: boolean;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Style Selection Step Config
|
|
36
|
-
*/
|
|
37
|
-
export interface StyleSelectionStepConfig {
|
|
38
|
-
readonly id: string;
|
|
39
|
-
readonly titleKey?: string;
|
|
40
|
-
readonly styles: readonly string[]; // style IDs
|
|
41
|
-
readonly required?: boolean;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Duration Selection Step Config
|
|
46
|
-
*/
|
|
47
|
-
export interface DurationSelectionStepConfig {
|
|
48
|
-
readonly id: string;
|
|
49
|
-
readonly titleKey?: string;
|
|
50
|
-
readonly durations: readonly number[]; // seconds
|
|
51
|
-
readonly defaultDuration?: number;
|
|
52
|
-
readonly required?: boolean;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Next Step Decision Function
|
|
57
|
-
* Evaluates current state and determines next step
|
|
58
|
-
*/
|
|
59
|
-
export type NextStepDecision = (context: {
|
|
60
|
-
readonly values: Record<string, unknown>;
|
|
61
|
-
readonly currentStepId: string;
|
|
62
|
-
readonly completedSteps: readonly string[];
|
|
63
|
-
}) => string | null;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Step Definition with Configuration
|
|
67
|
-
*/
|
|
68
|
-
export interface DynamicStepDefinition {
|
|
69
|
-
readonly id: string;
|
|
70
|
-
readonly type: StepType;
|
|
71
|
-
readonly enabled?: boolean;
|
|
72
|
-
readonly required?: boolean;
|
|
73
|
-
readonly config?:
|
|
74
|
-
| PhotoUploadStepConfig
|
|
75
|
-
| TextInputStepConfig
|
|
76
|
-
| StyleSelectionStepConfig
|
|
77
|
-
| DurationSelectionStepConfig
|
|
78
|
-
| Record<string, unknown>;
|
|
79
|
-
readonly nextStep?: string | NextStepDecision;
|
|
80
|
-
readonly skipIf?: (context: { readonly values: Record<string, unknown> }) => boolean;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Feature Flow Configuration
|
|
85
|
-
* Defines complete flow for a feature/scenario
|
|
86
|
-
*/
|
|
87
|
-
export interface FeatureFlowConfig {
|
|
88
|
-
readonly id: string;
|
|
89
|
-
readonly name: string;
|
|
90
|
-
readonly steps: readonly DynamicStepDefinition[];
|
|
91
|
-
readonly initialStepId?: string;
|
|
92
|
-
readonly onComplete?: (data: Record<string, unknown>) => void | Promise<void>;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Scenario Step Configuration
|
|
97
|
-
* Simplified config for scenario-based flows
|
|
98
|
-
*/
|
|
99
|
-
export interface ScenarioStepConfig {
|
|
100
|
-
readonly photoUploads?: {
|
|
101
|
-
readonly count: number;
|
|
102
|
-
readonly labels?: readonly string[];
|
|
103
|
-
readonly showFaceDetection?: boolean;
|
|
104
|
-
readonly showNameInput?: boolean;
|
|
105
|
-
};
|
|
106
|
-
readonly textInput?: {
|
|
107
|
-
readonly enabled: boolean;
|
|
108
|
-
readonly required?: boolean;
|
|
109
|
-
readonly minLength?: number;
|
|
110
|
-
readonly maxLength?: number;
|
|
111
|
-
};
|
|
112
|
-
readonly styleSelection?: {
|
|
113
|
-
readonly enabled: boolean;
|
|
114
|
-
readonly required?: boolean;
|
|
115
|
-
readonly styles?: readonly string[];
|
|
116
|
-
};
|
|
117
|
-
readonly durationSelection?: {
|
|
118
|
-
readonly enabled: boolean;
|
|
119
|
-
readonly required?: boolean;
|
|
120
|
-
readonly durations?: readonly number[];
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Step Builder Result
|
|
126
|
-
*/
|
|
127
|
-
export interface BuiltStep {
|
|
128
|
-
readonly id: string;
|
|
129
|
-
readonly type: StepType;
|
|
130
|
-
readonly config: Record<string, unknown>;
|
|
131
|
-
readonly required: boolean;
|
|
132
|
-
readonly nextStep?: string | NextStepDecision;
|
|
133
|
-
}
|
|
6
|
+
export type { PhotoUploadStepConfig } from "./step-upload-config.types";
|
|
7
|
+
export type {
|
|
8
|
+
TextInputStepConfig,
|
|
9
|
+
StyleSelectionStepConfig,
|
|
10
|
+
DurationSelectionStepConfig,
|
|
11
|
+
} from "./step-input-config.types";
|
|
12
|
+
export type {
|
|
13
|
+
NextStepDecision,
|
|
14
|
+
DynamicStepDefinition,
|
|
15
|
+
BuiltStep,
|
|
16
|
+
} from "./step-definition.types";
|
|
17
|
+
export type { FeatureFlowConfig } from "./feature-flow-config.types";
|
|
18
|
+
export type { ScenarioStepConfig } from "./scenario-step-config.types";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Step Definition Types
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type { StepType } from "./flow-config.types";
|
|
6
|
+
import type { PhotoUploadStepConfig } from "./step-upload-config.types";
|
|
7
|
+
import type {
|
|
8
|
+
TextInputStepConfig,
|
|
9
|
+
StyleSelectionStepConfig,
|
|
10
|
+
DurationSelectionStepConfig,
|
|
11
|
+
} from "./step-input-config.types";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Next Step Decision Function
|
|
15
|
+
* Evaluates current state and determines next step
|
|
16
|
+
*/
|
|
17
|
+
export type NextStepDecision = (context: {
|
|
18
|
+
readonly values: Record<string, unknown>;
|
|
19
|
+
readonly currentStepId: string;
|
|
20
|
+
readonly completedSteps: readonly string[];
|
|
21
|
+
}) => string | null;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Step Definition with Configuration
|
|
25
|
+
*/
|
|
26
|
+
export interface DynamicStepDefinition {
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly type: StepType;
|
|
29
|
+
readonly enabled?: boolean;
|
|
30
|
+
readonly required?: boolean;
|
|
31
|
+
readonly config?:
|
|
32
|
+
| PhotoUploadStepConfig
|
|
33
|
+
| TextInputStepConfig
|
|
34
|
+
| StyleSelectionStepConfig
|
|
35
|
+
| DurationSelectionStepConfig
|
|
36
|
+
| Record<string, unknown>;
|
|
37
|
+
readonly nextStep?: string | NextStepDecision;
|
|
38
|
+
readonly skipIf?: (context: { readonly values: Record<string, unknown> }) => boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Step Builder Result
|
|
43
|
+
*/
|
|
44
|
+
export interface BuiltStep {
|
|
45
|
+
readonly id: string;
|
|
46
|
+
readonly type: StepType;
|
|
47
|
+
readonly config: Record<string, unknown>;
|
|
48
|
+
readonly required: boolean;
|
|
49
|
+
readonly nextStep?: string | NextStepDecision;
|
|
50
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input Step Configuration Types
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Text Input Step Config
|
|
7
|
+
*/
|
|
8
|
+
export interface TextInputStepConfig {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly titleKey?: string;
|
|
11
|
+
readonly placeholderKey?: string;
|
|
12
|
+
readonly minLength?: number;
|
|
13
|
+
readonly maxLength?: number;
|
|
14
|
+
readonly required?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Style Selection Step Config
|
|
19
|
+
*/
|
|
20
|
+
export interface StyleSelectionStepConfig {
|
|
21
|
+
readonly id: string;
|
|
22
|
+
readonly titleKey?: string;
|
|
23
|
+
readonly styles: readonly string[];
|
|
24
|
+
readonly required?: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Duration Selection Step Config
|
|
29
|
+
*/
|
|
30
|
+
export interface DurationSelectionStepConfig {
|
|
31
|
+
readonly id: string;
|
|
32
|
+
readonly titleKey?: string;
|
|
33
|
+
readonly durations: readonly number[];
|
|
34
|
+
readonly defaultDuration?: number;
|
|
35
|
+
readonly required?: boolean;
|
|
36
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Photo Upload Step Configuration Types
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Photo Upload Step Config
|
|
7
|
+
*/
|
|
8
|
+
export interface PhotoUploadStepConfig {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly label?: string;
|
|
11
|
+
readonly titleKey?: string;
|
|
12
|
+
readonly subtitleKey?: string;
|
|
13
|
+
readonly showFaceDetection?: boolean;
|
|
14
|
+
readonly showNameInput?: boolean;
|
|
15
|
+
readonly showPhotoTips?: boolean;
|
|
16
|
+
readonly required?: boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Provider Capabilities Types
|
|
3
|
+
* Defines supported features and capabilities
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { ImageFeatureType, VideoFeatureType } from "./ai-provider-feature-types";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Provider capabilities definition
|
|
10
|
+
* Describes what features and operations the provider supports
|
|
11
|
+
*/
|
|
12
|
+
export interface ProviderCapabilities {
|
|
13
|
+
/** Supported image features */
|
|
14
|
+
imageFeatures: readonly ImageFeatureType[];
|
|
15
|
+
/** Supported video features */
|
|
16
|
+
videoFeatures: readonly VideoFeatureType[];
|
|
17
|
+
/** Supports text-to-image generation */
|
|
18
|
+
textToImage: boolean;
|
|
19
|
+
/** Supports text-to-video generation */
|
|
20
|
+
textToVideo: boolean;
|
|
21
|
+
/** Supports image-to-video generation */
|
|
22
|
+
imageToVideo: boolean;
|
|
23
|
+
/** Supports text-to-voice generation */
|
|
24
|
+
textToVoice: boolean;
|
|
25
|
+
/** Supports text-to-text (LLM) generation */
|
|
26
|
+
textToText: boolean;
|
|
27
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Provider Configuration Types
|
|
3
|
+
* Configuration interface for AI provider initialization
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { ImageFeatureType, VideoFeatureType } from "./ai-provider-feature-types";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* AI Provider Configuration
|
|
10
|
+
* Contains API keys, retry settings, timeouts, and model mappings
|
|
11
|
+
*/
|
|
12
|
+
export interface AIProviderConfig {
|
|
13
|
+
apiKey: string;
|
|
14
|
+
maxRetries?: number;
|
|
15
|
+
baseDelay?: number;
|
|
16
|
+
maxDelay?: number;
|
|
17
|
+
defaultTimeoutMs?: number;
|
|
18
|
+
/** Text generation model ID */
|
|
19
|
+
textModel?: string;
|
|
20
|
+
/** Text-to-image generation model ID */
|
|
21
|
+
textToImageModel?: string;
|
|
22
|
+
/** Image editing model ID */
|
|
23
|
+
imageEditModel?: string;
|
|
24
|
+
/** Video generation model ID */
|
|
25
|
+
videoGenerationModel?: string;
|
|
26
|
+
/** Video feature model mapping - app provides models for each feature */
|
|
27
|
+
videoFeatureModels?: Partial<Record<VideoFeatureType, string>>;
|
|
28
|
+
/** Image feature model mapping - app provides models for each feature */
|
|
29
|
+
imageFeatureModels?: Partial<Record<ImageFeatureType, string>>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Provider Feature Types
|
|
3
|
+
* Defines feature type enumerations for image and video processing
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Feature types for image processing (output: image)
|
|
8
|
+
*/
|
|
9
|
+
export type ImageFeatureType =
|
|
10
|
+
| "upscale"
|
|
11
|
+
| "photo-restore"
|
|
12
|
+
| "face-swap"
|
|
13
|
+
| "anime-selfie"
|
|
14
|
+
| "remove-background"
|
|
15
|
+
| "remove-object"
|
|
16
|
+
| "hd-touch-up"
|
|
17
|
+
| "replace-background";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Feature types for video generation (output: video)
|
|
21
|
+
*/
|
|
22
|
+
export type VideoFeatureType = "image-to-video" | "text-to-video";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Provider Input Data Types
|
|
3
|
+
* Input data structures for feature execution
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Input data for image processing features
|
|
8
|
+
*/
|
|
9
|
+
export interface ImageFeatureInputData {
|
|
10
|
+
imageBase64: string;
|
|
11
|
+
targetImageBase64?: string;
|
|
12
|
+
prompt?: string;
|
|
13
|
+
options?: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Input data for video generation features
|
|
18
|
+
*/
|
|
19
|
+
export interface VideoFeatureInputData {
|
|
20
|
+
/** Source image (required for image-to-video, optional for text-to-video) */
|
|
21
|
+
sourceImageBase64?: string;
|
|
22
|
+
/** Target image (optional, used for dual-image features) */
|
|
23
|
+
targetImageBase64?: string;
|
|
24
|
+
/** Generation prompt (required for text-to-video) */
|
|
25
|
+
prompt?: string;
|
|
26
|
+
/** Additional generation options */
|
|
27
|
+
options?: Record<string, unknown>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Provider Progress & Options Types
|
|
3
|
+
* Progress tracking and execution option types
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { AIJobStatusType, JobStatus } from "./ai-provider-status.types";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Provider progress information
|
|
10
|
+
*/
|
|
11
|
+
export interface ProviderProgressInfo {
|
|
12
|
+
/** Progress percentage (0-100) */
|
|
13
|
+
progress: number;
|
|
14
|
+
/** Current job status */
|
|
15
|
+
status?: AIJobStatusType;
|
|
16
|
+
/** Human-readable message */
|
|
17
|
+
message?: string;
|
|
18
|
+
/** Estimated time remaining in ms */
|
|
19
|
+
estimatedTimeRemaining?: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Subscription options for job tracking
|
|
24
|
+
*/
|
|
25
|
+
export interface SubscribeOptions<T = unknown> {
|
|
26
|
+
timeoutMs?: number;
|
|
27
|
+
onQueueUpdate?: (status: JobStatus) => void;
|
|
28
|
+
onProgress?: (progress: ProviderProgressInfo) => void;
|
|
29
|
+
onResult?: (result: T) => void;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Basic run options
|
|
34
|
+
*/
|
|
35
|
+
export interface RunOptions {
|
|
36
|
+
onProgress?: (progress: ProviderProgressInfo) => void;
|
|
37
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Provider Status Types
|
|
3
|
+
* Job status tracking and logging types
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* AI Job Status States
|
|
8
|
+
*/
|
|
9
|
+
export type AIJobStatusType =
|
|
10
|
+
| "IN_QUEUE"
|
|
11
|
+
| "IN_PROGRESS"
|
|
12
|
+
| "COMPLETED"
|
|
13
|
+
| "FAILED";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Log entry for AI job events
|
|
17
|
+
*/
|
|
18
|
+
export interface AILogEntry {
|
|
19
|
+
message: string;
|
|
20
|
+
level: "info" | "warn" | "error";
|
|
21
|
+
timestamp?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Job submission response
|
|
26
|
+
*/
|
|
27
|
+
export interface JobSubmission {
|
|
28
|
+
requestId: string;
|
|
29
|
+
statusUrl?: string;
|
|
30
|
+
responseUrl?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Job status information
|
|
35
|
+
*/
|
|
36
|
+
export interface JobStatus {
|
|
37
|
+
status: AIJobStatusType;
|
|
38
|
+
logs?: AILogEntry[];
|
|
39
|
+
queuePosition?: number;
|
|
40
|
+
eta?: number;
|
|
41
|
+
}
|