@umituz/react-native-ai-generation-content 1.83.1 → 1.83.3

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.
Files changed (83) hide show
  1. package/package.json +1 -1
  2. package/src/core/constants/duration-options.constants.ts +1 -0
  3. package/src/core/constants/index.ts +11 -44
  4. package/src/core/constants/preset-styles.constants.ts +1 -0
  5. package/src/core/constants/script-durations.constants.ts +5 -0
  6. package/src/core/constants/style-options.constants.ts +1 -0
  7. package/src/domains/access-control/hooks/useAIFeatureGate.ts +0 -1
  8. package/src/domains/background/infrastructure/services/job-poller.service.ts +0 -1
  9. package/src/domains/background/infrastructure/utils/result-validation-logic.ts +0 -1
  10. package/src/domains/content-moderation/infrastructure/services/moderators/text.moderator.ts +0 -1
  11. package/src/domains/creations/infrastructure/repositories/CreationsQuery.ts +0 -1
  12. package/src/domains/creations/infrastructure/repositories/CreationsSubscription.ts +0 -1
  13. package/src/domains/creations/infrastructure/repositories/creation-error-handler.util.ts +0 -1
  14. package/src/domains/creations/infrastructure/repositories/creation-update.operations.ts +0 -1
  15. package/src/domains/creations/presentation/components/GalleryHeader.tsx +0 -1
  16. package/src/domains/creations/presentation/hooks/useCreationPersistence.ts +0 -1
  17. package/src/domains/creations/presentation/hooks/useCreationRating.ts +0 -1
  18. package/src/domains/creations/presentation/hooks/useCreations.ts +0 -1
  19. package/src/domains/creations/presentation/hooks/useDeleteCreation.ts +0 -1
  20. package/src/domains/creations/presentation/hooks/useGalleryCallbacks.ts +0 -1
  21. package/src/domains/creations/presentation/hooks/useProcessingJobsPoller.ts +0 -1
  22. package/src/domains/generation/application/feature-registry.ts +0 -1
  23. package/src/domains/generation/application/generation-strategy.factory.ts +0 -1
  24. package/src/domains/generation/infrastructure/executors/executor-factory.ts +0 -1
  25. package/src/domains/generation/infrastructure/executors/image-executor.ts +0 -1
  26. package/src/domains/generation/infrastructure/executors/text-to-image-executor.ts +0 -1
  27. package/src/domains/generation/infrastructure/executors/video-executor.ts +0 -1
  28. package/src/domains/generation/infrastructure/flow/useFlowStore.ts +0 -1
  29. package/src/domains/generation/presentation/useAIGeneration.hook.ts +0 -1
  30. package/src/domains/generation/wizard/infrastructure/strategies/image-generation.executor.ts +0 -1
  31. package/src/domains/generation/wizard/infrastructure/strategies/shared/photo-extraction.utils.ts +0 -1
  32. package/src/domains/generation/wizard/infrastructure/strategies/video-generation.executor.ts +0 -1
  33. package/src/domains/generation/wizard/infrastructure/strategies/video-generation.strategy.ts +0 -1
  34. package/src/domains/generation/wizard/infrastructure/strategies/video-generation.utils.ts +0 -1
  35. package/src/domains/generation/wizard/infrastructure/utils/creation-save-operations.ts +0 -1
  36. package/src/domains/generation/wizard/infrastructure/utils/creation-update-operations.ts +0 -1
  37. package/src/domains/generation/wizard/presentation/components/GenericWizardFlow.tsx +0 -1
  38. package/src/domains/generation/wizard/presentation/components/step-renderers/renderSelectionStep.tsx +0 -1
  39. package/src/domains/generation/wizard/presentation/hooks/generationExecutor.ts +0 -1
  40. package/src/domains/generation/wizard/presentation/hooks/usePhotoBlockingGeneration.ts +0 -1
  41. package/src/domains/generation/wizard/presentation/hooks/usePhotoUploadState.ts +0 -1
  42. package/src/domains/generation/wizard/presentation/hooks/useVideoQueueGeneration.ts +0 -1
  43. package/src/domains/generation/wizard/presentation/hooks/videoQueuePoller.ts +0 -1
  44. package/src/domains/generation/wizard/presentation/screens/SelectionScreen.tsx +0 -1
  45. package/src/domains/generation/wizard/presentation/utilities/validateScenario.ts +0 -1
  46. package/src/domains/image-to-video/presentation/hooks/imageToVideoStrategy.ts +0 -1
  47. package/src/domains/image-to-video/presentation/hooks/useImageToVideoForm.ts +0 -1
  48. package/src/domains/result-preview/presentation/hooks/useResultActions.ts +0 -1
  49. package/src/domains/scenarios/configs/wizard-config-resolver.ts +0 -1
  50. package/src/domains/scenarios/infrastructure/scenario-registry.ts +0 -1
  51. package/src/domains/text-to-image/presentation/hooks/useGeneration.ts +0 -1
  52. package/src/domains/text-to-video/infrastructure/services/text-to-video-executor.ts +0 -1
  53. package/src/domains/text-to-video/presentation/hooks/textToVideoStrategy.ts +0 -1
  54. package/src/domains/text-to-video/presentation/hooks/useTextToVideoForm.ts +0 -1
  55. package/src/exports/domain.ts +4 -0
  56. package/src/infrastructure/config/app-services.config.ts +0 -1
  57. package/src/infrastructure/executors/base-executor.ts +0 -1
  58. package/src/infrastructure/http/http-fetch-handler.ts +1 -2
  59. package/src/infrastructure/logging/debug.util.ts +2 -3
  60. package/src/infrastructure/logging/index.ts +1 -1
  61. package/src/infrastructure/providers/generation-config.provider.tsx +0 -1
  62. package/src/infrastructure/services/generation-orchestrator.service.ts +0 -1
  63. package/src/infrastructure/services/multi-image-generation.executor.ts +0 -1
  64. package/src/infrastructure/services/provider-registry.service.ts +0 -2
  65. package/src/infrastructure/services/provider-validator.ts +0 -1
  66. package/src/infrastructure/utils/classifier-helpers.ts +0 -1
  67. package/src/infrastructure/utils/error-classification.ts +0 -1
  68. package/src/infrastructure/utils/error-handlers.ts +1 -2
  69. package/src/infrastructure/utils/error-retry.ts +1 -1
  70. package/src/infrastructure/utils/feature-utils.ts +0 -1
  71. package/src/infrastructure/utils/index.ts +0 -1
  72. package/src/infrastructure/utils/message-extractor.ts +18 -1
  73. package/src/infrastructure/utils/provider-validator.util.ts +0 -1
  74. package/src/infrastructure/utils/url-extractor/rule-executor.ts +0 -1
  75. package/src/presentation/components/buttons/GenerateButton.tsx +0 -1
  76. package/src/presentation/hooks/generation/orchestrator.ts +0 -1
  77. package/src/presentation/hooks/generation/useImagePicker.ts +0 -1
  78. package/src/core/constants/model.constants.ts +0 -11
  79. package/src/core/constants/polling.constants.ts +0 -12
  80. package/src/core/constants/status.constants.ts +0 -24
  81. package/src/core/constants/text-to-image-models.constants.ts +0 -18
  82. package/src/infrastructure/logging/logger.ts +0 -174
  83. package/src/infrastructure/utils/error-extractors.ts +0 -24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-ai-generation-content",
3
- "version": "1.83.1",
3
+ "version": "1.83.3",
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",
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Duration Options Constants
3
+ * Generic video duration choices — reusable across all apps
3
4
  */
4
5
 
5
6
  export interface DurationOption {
@@ -1,49 +1,16 @@
1
1
  /**
2
2
  * AI Generation Constants
3
- * Generic constants reusable across any AI generation app
4
3
  *
5
- * Note: AspectRatio, StyleOption, DurationOption, AnimationStyle, VideoDuration
6
- * already exist in the feature domains with their own names.
7
- * Here we export the raw config constants (not UI-specific types).
4
+ * Generic, provider-agnostic constants single source of truth for all apps.
5
+ * Model IDs and pricing are NOT here: those are always app-level decisions.
8
6
  */
9
7
 
10
- // Video resolution options
11
- export {
12
- VIDEO_RESOLUTION,
13
- VIDEO_RESOLUTION_OPTIONS,
14
- DEFAULT_MOTION_STRENGTH,
15
- DEFAULT_GUIDANCE_SCALE,
16
- } from "./video.constants";
17
- export type { VideoResolution } from "./video.constants";
18
-
19
- // Video duration options
20
- export {
21
- VIDEO_DURATION,
22
- VIDEO_DURATION_OPTIONS,
23
- VIDEO_DURATION_OPTIONS_WITH_LABELS,
24
- VIDEO_ASPECT_RATIO,
25
- VIDEO_ASPECT_RATIO_OPTIONS,
26
- } from "./video.constants";
27
- export type { VideoAspectRatio } from "./video.constants";
28
-
29
- // Image constants
30
- export {
31
- IMAGE_SIZE,
32
- DEFAULT_NUM_IMAGES,
33
- DEFAULT_IMAGE_GUIDANCE_SCALE,
34
- } from "./image.constants";
35
-
36
- // Aspect ratio config
37
- export { ASPECT_RATIO, DEFAULT_IMAGE_SIZES } from "./aspect-ratio.constants";
38
-
39
- // Status constants
40
- export { FAL_AI_STATUS, CREATION_STATUS, PROVIDER } from "./status.constants";
41
-
42
- // Validation limits
43
- export { VALIDATION_LIMITS } from "./validation.constants";
44
-
45
- // Polling config
46
- export { POLLING_CONFIG } from "./polling.constants";
47
-
48
- // Animation style options
49
- export { ANIMATION_STYLE } from "./animation.constants";
8
+ export * from "./video.constants";
9
+ export * from "./aspect-ratio.constants";
10
+ export * from "./image.constants";
11
+ export * from "./animation.constants";
12
+ export * from "./validation.constants";
13
+ export * from "./preset-styles.constants";
14
+ export * from "./style-options.constants";
15
+ export * from "./duration-options.constants";
16
+ export * from "./script-durations.constants";
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Preset Styles Constants
3
+ * Generic video content presets — reusable across all apps
3
4
  */
4
5
 
5
6
  export interface PresetStyle {
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Script Duration Constants
3
+ * Generic script duration values — reusable across all apps
4
+ */
5
+
1
6
  export const SCRIPT_DURATIONS = [4] as const;
2
7
 
3
8
  export type ScriptDuration = (typeof SCRIPT_DURATIONS)[number];
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Style Options Constants
3
+ * Generic UI style choices — reusable across all apps
3
4
  */
4
5
 
5
6
  export interface StyleOption {
@@ -17,7 +17,6 @@ import type {
17
17
  AIFeatureGateReturn,
18
18
  } from "../types/access-control.types";
19
19
 
20
- declare const __DEV__: boolean;
21
20
 
22
21
  const handlePromiseResult = (
23
22
  result: void | Promise<void>,
@@ -10,7 +10,6 @@ import { checkStatusForErrors, isJobComplete } from "../utils/status-checker.uti
10
10
  import { validateResult } from "../utils/result-validator.util";
11
11
  import type { PollJobOptions, PollJobResult } from "./job-poller.types";
12
12
 
13
- declare const __DEV__: boolean;
14
13
 
15
14
  /**
16
15
  * Wraps a promise with abort signal support
@@ -6,7 +6,6 @@
6
6
  import type { ResultValidation, ValidateResultOptions } from "./result-validator.types";
7
7
  import { DEFAULT_OUTPUT_FIELDS } from "./result-validator-constants";
8
8
 
9
- declare const __DEV__: boolean;
10
9
 
11
10
  /**
12
11
  * Validate job result and detect errors
@@ -11,7 +11,6 @@ import { DEFAULT_MAX_TEXT_LENGTH } from "../../constants/moderation.constants";
11
11
  import { containsMaliciousPatterns } from "../../utils/content-security.util";
12
12
  import { containsPromptInjection } from "../../utils/prompt-injection.util";
13
13
 
14
- declare const __DEV__: boolean;
15
14
 
16
15
  class TextModerator extends BaseModerator {
17
16
  private maxLength = DEFAULT_MAX_TEXT_LENGTH;
@@ -10,7 +10,6 @@ import type { DocumentMapper } from "../../domain/value-objects/CreationsConfig"
10
10
  import type { Creation, CreationDocument } from "../../domain/entities/Creation";
11
11
  import { CREATION_FIELDS } from "../../domain/constants";
12
12
 
13
- declare const __DEV__: boolean;
14
13
 
15
14
  export class CreationsQuery {
16
15
  constructor(
@@ -11,7 +11,6 @@ import type { CreationDocument } from "../../domain/entities/Creation";
11
11
  import type { CreationsSubscriptionCallback, UnsubscribeFunction } from "../../domain/repositories/ICreationsRepository";
12
12
  import { CREATION_FIELDS } from "../../domain/constants";
13
13
 
14
- declare const __DEV__: boolean;
15
14
 
16
15
  export class CreationsSubscription {
17
16
  constructor(
@@ -3,7 +3,6 @@
3
3
  * Single Responsibility: Centralized error logging
4
4
  */
5
5
 
6
- declare const __DEV__: boolean;
7
6
 
8
7
  export function logOperationError(
9
8
  operation: string,
@@ -7,7 +7,6 @@ import type { IPathResolver } from "@umituz/react-native-firebase";
7
7
  import type { Creation } from "../../domain/entities/Creation";
8
8
  import { UPDATABLE_FIELDS } from "../../domain/constants";
9
9
 
10
- declare const __DEV__: boolean;
11
10
 
12
11
  export { UPDATABLE_FIELDS };
13
12
 
@@ -1,4 +1,3 @@
1
- declare const __DEV__: boolean;
2
1
 
3
2
  import React from "react";
4
3
  import { View, TouchableOpacity, StyleSheet, type ViewStyle } from "react-native";
@@ -4,7 +4,6 @@
4
4
 
5
5
  import { useCallback, useMemo } from "react";
6
6
 
7
- declare const __DEV__: boolean;
8
7
  import { useAuth } from "@umituz/react-native-auth";
9
8
  import { createCreationsRepository } from "../../infrastructure/adapters";
10
9
  import type { Creation } from "../../domain/entities/Creation";
@@ -7,7 +7,6 @@
7
7
  import { useState, useCallback } from "react";
8
8
  import type { ICreationsRepository } from "../../domain/repositories/ICreationsRepository";
9
9
 
10
- declare const __DEV__: boolean;
11
10
 
12
11
  interface UseCreationRatingProps {
13
12
  readonly userId: string | null;
@@ -8,7 +8,6 @@ import { useState, useEffect, useCallback } from "react";
8
8
  import type { ICreationsRepository } from "../../domain/repositories/ICreationsRepository";
9
9
  import type { Creation } from "../../domain/entities/Creation";
10
10
 
11
- declare const __DEV__: boolean;
12
11
 
13
12
  interface UseCreationsProps {
14
13
  readonly userId: string | null;
@@ -7,7 +7,6 @@
7
7
  import { useState, useCallback } from "react";
8
8
  import type { ICreationsRepository } from "../../domain/repositories/ICreationsRepository";
9
9
 
10
- declare const __DEV__: boolean;
11
10
 
12
11
  interface UseDeleteCreationProps {
13
12
  readonly userId: string | null;
@@ -3,7 +3,6 @@
3
3
  * Extracts callback handlers from CreationsGalleryScreen
4
4
  */
5
5
 
6
- declare const __DEV__: boolean;
7
6
 
8
7
  import { useCallback } from "react";
9
8
  import { useAlert, AlertType, AlertMode, useSharing } from "@umituz/react-native-design-system";
@@ -16,7 +16,6 @@ import {
16
16
  import type { Creation } from "../../domain/entities/Creation";
17
17
  import type { ICreationsRepository } from "../../domain/repositories/ICreationsRepository";
18
18
 
19
- declare const __DEV__: boolean;
20
19
 
21
20
  export interface UseProcessingJobsPollerConfig {
22
21
  readonly userId?: string | null;
@@ -9,7 +9,6 @@ import type {
9
9
  FeatureRegistration,
10
10
  } from "../domain/feature-config.types";
11
11
 
12
- declare const __DEV__: boolean;
13
12
 
14
13
  class FeatureRegistryImpl implements FeatureRegistration {
15
14
  private features = new Map<string, FeatureConfig>();
@@ -12,7 +12,6 @@ import type {
12
12
  import { ExecutorFactory } from "../infrastructure/executors/executor-factory";
13
13
  import { featureRegistry } from "./feature-registry";
14
14
 
15
- declare const __DEV__: boolean;
16
15
 
17
16
  interface CreationRepository {
18
17
  create(userId: string, creation: unknown): Promise<void>;
@@ -8,7 +8,6 @@ import { ImageExecutor } from "./image-executor";
8
8
  import { VideoExecutor } from "./video-executor";
9
9
  import { TextToImageExecutor } from "./text-to-image-executor";
10
10
 
11
- declare const __DEV__: boolean;
12
11
 
13
12
  export type GenerationType = "image" | "video" | "text-to-image" | "text-to-video" | "image-to-video" | "meme";
14
13
 
@@ -13,7 +13,6 @@ import type { GenerationResult } from "../../../../domain/entities/generation.ty
13
13
  import { providerRegistry } from "../../../../infrastructure/services/provider-registry.service";
14
14
  import { env } from "../../../../infrastructure/config/env.config";
15
15
 
16
- declare const __DEV__: boolean;
17
16
 
18
17
  export class ImageExecutor
19
18
  implements GenerationExecutor<ImageGenerationInput, ImageGenerationOutput>
@@ -12,7 +12,6 @@ import { providerRegistry } from "../../../../infrastructure/services/provider-r
12
12
  import type { TextToImageInput, TextToImageOutput } from "./text-to-image-executor.types";
13
13
  import { buildModelInput, extractResult } from "./text-to-image-executor.helpers";
14
14
 
15
- declare const __DEV__: boolean;
16
15
 
17
16
  export class TextToImageExecutor
18
17
  implements GenerationExecutor<TextToImageInput, TextToImageOutput>
@@ -13,7 +13,6 @@ import type { GenerationResult } from "../../../../domain/entities/generation.ty
13
13
  import { providerRegistry } from "../../../../infrastructure/services/provider-registry.service";
14
14
  import { env } from "../../../../infrastructure/config/env.config";
15
15
 
16
- declare const __DEV__: boolean;
17
16
 
18
17
  export class VideoExecutor
19
18
  implements GenerationExecutor<VideoGenerationInput, VideoGenerationOutput>
@@ -4,7 +4,6 @@
4
4
 
5
5
  import { createStore } from "@umituz/react-native-design-system";
6
6
 
7
- declare const __DEV__: boolean;
8
7
  import type {
9
8
  FlowState,
10
9
  FlowActions,
@@ -9,7 +9,6 @@ import type { AlertMessages } from "../../../presentation/hooks/generation/types
9
9
  import { DEFAULT_ALERT_MESSAGES } from "../../../presentation/constants/alert-messages";
10
10
  import { createGenerationStrategy } from "../application/generation-strategy.factory";
11
11
 
12
- declare const __DEV__: boolean;
13
12
 
14
13
  // ============================================================================
15
14
  // Types
@@ -12,7 +12,6 @@ import {
12
12
  MODEL_INPUT_DEFAULTS,
13
13
  } from "./wizard-strategy.constants";
14
14
 
15
- declare const __DEV__: boolean;
16
15
 
17
16
  interface ExecutionResult {
18
17
  success: boolean;
@@ -8,7 +8,6 @@ import { manipulateAsync, SaveFormat } from "expo-image-manipulator";
8
8
  import { Image } from "react-native";
9
9
  import { PHOTO_KEY_PREFIX } from "../wizard-strategy.constants";
10
10
 
11
- declare const __DEV__: boolean;
12
11
 
13
12
  const MIN_IMAGE_DIMENSION = 300;
14
13
 
@@ -10,7 +10,6 @@ import type { VideoModelConfig } from "../../../../../domain/interfaces/video-mo
10
10
  import { GENERATION_TIMEOUT_MS, BASE64_IMAGE_PREFIX } from "./wizard-strategy.constants";
11
11
  import { createGenerationError, GenerationErrorType } from "../../../../../infrastructure/utils/error-factory";
12
12
 
13
- declare const __DEV__: boolean;
14
13
 
15
14
  interface ExecutionResult {
16
15
  success: boolean;
@@ -13,7 +13,6 @@ import type { WizardVideoInput, CreateVideoStrategyOptions } from "./video-gener
13
13
  import { validatePhotoCount, validateWizardVideoInput } from "./video-generation.types";
14
14
  import { executeVideoGeneration, submitVideoGenerationToQueue } from "./video-generation.executor";
15
15
 
16
- declare const __DEV__: boolean;
17
16
 
18
17
  export type { WizardVideoInput, WizardVideoResult, CreateVideoStrategyOptions } from "./video-generation.types";
19
18
 
@@ -7,7 +7,6 @@ import type { VideoFeatureType } from "../../../../../domain/interfaces";
7
7
  import type { WizardScenarioData } from "../../presentation/hooks/wizard-generation.types";
8
8
  import { VIDEO_FEATURE_PATTERNS } from "./wizard-strategy.constants";
9
9
 
10
- declare const __DEV__: boolean;
11
10
 
12
11
  /**
13
12
  * Determines the video feature type from scenario
@@ -6,7 +6,6 @@
6
6
  import type { ICreationsRepository } from "../../../../creations/domain/repositories";
7
7
  import type { ProcessingCreationData } from "./creation-persistence.types";
8
8
 
9
- declare const __DEV__: boolean;
10
9
 
11
10
  /**
12
11
  * Save creation with status="processing" when generation starts
@@ -6,7 +6,6 @@
6
6
  import type { ICreationsRepository } from "../../../../creations/domain/repositories";
7
7
  import type { CompletedCreationData } from "./creation-persistence.types";
8
8
 
9
- declare const __DEV__: boolean;
10
9
 
11
10
  /**
12
11
  * Update creation to status="completed" when generation finishes
@@ -19,7 +19,6 @@ import {
19
19
  getDefaultOutputType,
20
20
  } from "../../../../scenarios/infrastructure/scenario-registry";
21
21
 
22
- declare const __DEV__: boolean;
23
22
 
24
23
  export interface GenericWizardFlowProps {
25
24
  readonly featureConfig: WizardFeatureConfig;
@@ -19,7 +19,6 @@ export interface SelectionStepProps {
19
19
  readonly creditCost?: number;
20
20
  }
21
21
 
22
- declare const __DEV__: boolean;
23
22
 
24
23
  export function renderSelectionStep({
25
24
  step,
@@ -2,7 +2,6 @@ import { buildWizardInput } from "../../infrastructure/strategies";
2
2
  import type { WizardScenarioData } from "./wizard-generation.types";
3
3
  import type { GenerationAction } from "./generationStateMachine";
4
4
 
5
- declare const __DEV__: boolean;
6
5
 
7
6
  interface ExecuteGenerationParams {
8
7
  wizardData: Record<string, unknown>;
@@ -13,7 +13,6 @@ import type { WizardStrategy } from "../../infrastructure/strategies/wizard-stra
13
13
  import type { WizardScenarioData } from "./wizard-generation.types";
14
14
  import type { AlertMessages } from "../../../../../presentation/hooks/generation/types";
15
15
 
16
- declare const __DEV__: boolean;
17
16
 
18
17
  export interface UsePhotoBlockingGenerationProps {
19
18
  readonly userId?: string;
@@ -6,7 +6,6 @@
6
6
 
7
7
  import { useState, useCallback, useEffect, useRef } from "react";
8
8
 
9
- declare const __DEV__: boolean;
10
9
  import { useMedia, MediaQuality, MediaValidationError, MEDIA_CONSTANTS } from "@umituz/react-native-design-system";
11
10
  import type { UploadedImage } from "../../../../../presentation/hooks/generation/useAIGenerateState";
12
11
 
@@ -4,7 +4,6 @@
4
4
 
5
5
  import { useEffect, useRef, useCallback, useState } from "react";
6
6
 
7
- declare const __DEV__: boolean;
8
7
  import { pollQueueStatus } from "./videoQueuePoller";
9
8
  import {
10
9
  DEFAULT_POLL_INTERVAL_MS,
@@ -3,7 +3,6 @@ import { extractResultUrl, type GenerationUrls, type GenerationResult } from "./
3
3
  import { QUEUE_STATUS } from "../../../../../domain/constants/queue-status.constants";
4
4
  import { DEFAULT_MAX_CONSECUTIVE_ERRORS } from "../../../../../infrastructure/constants/polling.constants";
5
5
 
6
- declare const __DEV__: boolean;
7
6
 
8
7
  /**
9
8
  * Extract meaningful error message from various error formats.
@@ -23,7 +23,6 @@ export type {
23
23
  SelectionScreenProps,
24
24
  } from "./SelectionScreen.types";
25
25
 
26
- declare const __DEV__: boolean;
27
26
 
28
27
  export const SelectionScreen: React.FC<SelectionScreenProps> = ({
29
28
  stepId,
@@ -6,7 +6,6 @@
6
6
 
7
7
  import type { WizardScenarioData } from "../hooks/useWizardGeneration";
8
8
 
9
- declare const __DEV__: boolean;
10
9
 
11
10
  export interface ScenarioValidationResult {
12
11
  isValid: boolean;
@@ -1,6 +1,5 @@
1
1
  import { executeImageToVideo } from "../../infrastructure/services";
2
2
 
3
- declare const __DEV__: boolean;
4
3
  import type { GenerationStrategy } from "../../../../presentation/hooks/generation";
5
4
  import type {
6
5
  ImageToVideoFeatureConfig,
@@ -5,7 +5,6 @@
5
5
 
6
6
  import { useMemo, useCallback } from "react";
7
7
 
8
- declare const __DEV__: boolean;
9
8
  import { useFormState, type UseFormStateOptions } from "./useFormState";
10
9
  import { useGeneration } from "./useGeneration";
11
10
  import type {
@@ -5,7 +5,6 @@
5
5
 
6
6
  import { useState, useCallback } from "react";
7
7
 
8
- declare const __DEV__: boolean;
9
8
  import * as MediaLibrary from "expo-media-library";
10
9
  import * as Sharing from "expo-sharing";
11
10
  import {
@@ -9,7 +9,6 @@ import { WizardInputType, type WizardConfigOptions } from "./wizard-input.types"
9
9
  import { detectWizardInputType, SCENARIO_TO_WIZARD_INPUT_MAP } from "./wizard-input-detector";
10
10
  import { getConfigFactory } from "./wizard-step-factories";
11
11
 
12
- declare const __DEV__: boolean;
13
12
 
14
13
  const scenarioWizardConfigs: Record<string, WizardFeatureConfig> = {};
15
14
 
@@ -6,7 +6,6 @@
6
6
 
7
7
  import type { Scenario, ScenarioOutputType } from "../domain/Scenario";
8
8
 
9
- declare const __DEV__: boolean;
10
9
 
11
10
  /** Configured scenario with required outputType */
12
11
  export interface ConfiguredScenario extends Scenario {
@@ -16,7 +16,6 @@ import type {
16
16
  TextToImageGenerationRequest,
17
17
  } from "../../domain/types";
18
18
 
19
- declare const __DEV__: boolean;
20
19
 
21
20
  export interface UseGenerationOptions {
22
21
  formState: TextToImageFormState;
@@ -17,7 +17,6 @@ import type {
17
17
  TextToVideoResultExtractor,
18
18
  } from "../../domain/types";
19
19
 
20
- declare const __DEV__: boolean;
21
20
 
22
21
  /**
23
22
  * Options for text-to-video execution
@@ -1,6 +1,5 @@
1
1
  import { executeTextToVideo } from "../../infrastructure/services";
2
2
 
3
- declare const __DEV__: boolean;
4
3
  import type { GenerationStrategy } from "../../../../presentation/hooks/generation";
5
4
  import type {
6
5
  TextToVideoConfig,
@@ -10,7 +10,6 @@ import type {
10
10
  } from "../../domain/types";
11
11
  import { INITIAL_FORM_STATE } from "../../domain/types";
12
12
 
13
- declare const __DEV__: boolean;
14
13
 
15
14
  export interface UseTextToVideoFormProps {
16
15
  initialValues?: Partial<TextToVideoFormState>;
@@ -28,6 +28,10 @@ export type {
28
28
  } from "../domain/entities";
29
29
  export { DEFAULT_POLLING_CONFIG, DEFAULT_QUEUE_CONFIG } from "../domain/entities";
30
30
 
31
+ // Queue & Creation Status — canonical values used across all apps
32
+ export { QUEUE_STATUS, CREATION_STATUS } from "../domain/constants/queue-status.constants";
33
+ export type { QueueStatus, CreationStatus } from "../domain/constants/queue-status.constants";
34
+
31
35
  // Processing Modes
32
36
  export type { ImageProcessingMode, ModeConfig, ModeCatalog } from "../domain/entities/processing-modes.types";
33
37
  export {
@@ -5,7 +5,6 @@
5
5
 
6
6
  import type { IAppServices, PartialAppServices } from "../../domain/interfaces/app-services.interface";
7
7
 
8
- declare const __DEV__: boolean;
9
8
 
10
9
  let appServices: IAppServices | null = null;
11
10
 
@@ -7,7 +7,6 @@ import { failure, success, type Result } from "../../domain/types/result.types";
7
7
  import type { IAIProvider } from "../../domain/interfaces";
8
8
  import type { BaseExecutorOptions } from "./base-executor.types";
9
9
 
10
- declare const __DEV__: boolean;
11
10
 
12
11
  export abstract class BaseExecutor<TRequest, TResult, TOutput> {
13
12
  protected readonly logPrefix: string;
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import { withErrorHandling } from "../utils/error-handlers";
7
- import { getErrorMessage } from "../utils/error-extractors";
7
+ import { getErrorMessage } from "../utils/message-extractor";
8
8
  import { retryWithBackoff } from "../utils/error-retry";
9
9
  import { isNetworkError } from "../utils/error-classifiers";
10
10
  import { env } from "../config/env.config";
@@ -12,7 +12,6 @@ import type { RequestOptions, ApiResponse } from "./api-client.types";
12
12
  import { executeRequest, isSuccessResponse, extractErrorMessage } from "./http-request-executor";
13
13
  import { parseResponse, createSuccessResponse, createErrorResponse } from "./http-response-parser";
14
14
 
15
- declare const __DEV__: boolean;
16
15
 
17
16
  /**
18
17
  * Fetches data with timeout, retry, and error handling
@@ -9,9 +9,8 @@ export interface DebugOptions {
9
9
  readonly tag?: string;
10
10
  }
11
11
 
12
- declare const __DEV__: boolean;
13
-
14
- const isDev = typeof __DEV__ !== "undefined" && __DEV__;
12
+ /** Single source of truth for development environment detection */
13
+ export const isDev = typeof __DEV__ !== "undefined" && __DEV__;
15
14
 
16
15
  function formatMessage(tag: string | undefined, message: string): string {
17
16
  return tag ? `[${tag}] ${message}` : message;
@@ -2,5 +2,5 @@
2
2
  * Logging utilities
3
3
  */
4
4
 
5
- export { debug } from "./debug.util";
5
+ export { debug, isDev } from "./debug.util";
6
6
  export type { DebugOptions } from "./debug.util";
@@ -6,7 +6,6 @@
6
6
 
7
7
  import React, { createContext, useContext, useCallback, useMemo, type ReactNode } from "react";
8
8
 
9
- declare const __DEV__: boolean;
10
9
 
11
10
  export interface GenerationModels {
12
11
  readonly imageMultiRef?: string;
@@ -13,7 +13,6 @@ import { classifyError } from "../utils/error-classification";
13
13
  import { pollJob } from "../../domains/background/infrastructure/services/job-poller.service";
14
14
  import { ProviderValidator } from "./provider-validator";
15
15
 
16
- declare const __DEV__: boolean;
17
16
 
18
17
  export interface OrchestratorConfig {
19
18
  polling?: Partial<PollingConfig>;
@@ -8,7 +8,6 @@ import { formatBase64 } from "../utils/base64.util";
8
8
  import { validateURL } from "../validation/base-validator";
9
9
  import { env } from "../config/env.config";
10
10
 
11
- declare const __DEV__: boolean;
12
11
 
13
12
  /** Generation timeout in milliseconds */
14
13
  const GENERATION_TIMEOUT_MS = env.generationMultiImageTimeoutMs;
@@ -5,8 +5,6 @@
5
5
 
6
6
  import type { IAIProvider } from "../../domain/interfaces";
7
7
 
8
- declare const __DEV__: boolean | undefined;
9
-
10
8
  class ProviderRegistry {
11
9
  private providers: Map<string, IAIProvider> = new Map();
12
10
  private activeProviderId: string | null = null;
@@ -6,7 +6,6 @@
6
6
  import type { IAIProvider } from "../../domain/interfaces";
7
7
  import { providerRegistry } from "./provider-registry.service";
8
8
 
9
- declare const __DEV__: boolean;
10
9
 
11
10
  export class ProviderValidator {
12
11
  getProvider(): IAIProvider {
@@ -4,7 +4,6 @@
4
4
 
5
5
  import type { AIErrorInfo } from "../../domain/entities";
6
6
 
7
- declare const __DEV__: boolean;
8
7
 
9
8
  export function matchesPatterns(message: string, patterns: readonly string[]): boolean {
10
9
  const lowerMessage = message.toLowerCase();
@@ -13,7 +13,6 @@ import {
13
13
  } from "./error-patterns.constants";
14
14
  import { matchesPatterns, getStatusCode, logClassification } from "./classifier-helpers";
15
15
 
16
- declare const __DEV__: boolean;
17
16
 
18
17
  export function classifyError(error: unknown): AIErrorInfo {
19
18
  const message = error instanceof Error ? error.message : String(error);
@@ -2,7 +2,7 @@
2
2
  * Error Handling Utilities
3
3
  */
4
4
 
5
- import { getErrorMessage } from "./error-extractors";
5
+ import { getErrorMessage } from "./message-extractor";
6
6
 
7
7
  /**
8
8
  * Sanitizes error message to prevent information disclosure
@@ -50,5 +50,4 @@ export async function withErrorHandling<T>(
50
50
  }
51
51
  }
52
52
 
53
- declare const __DEV__: boolean;
54
53
 
@@ -2,7 +2,7 @@
2
2
  * Error Retry Utilities
3
3
  */
4
4
 
5
- import { getErrorMessage } from "./error-extractors";
5
+ import { getErrorMessage } from "./message-extractor";
6
6
 
7
7
  /**
8
8
  * Retry function with exponential backoff
@@ -7,7 +7,6 @@ import { readFileAsBase64 } from "@umituz/react-native-design-system";
7
7
  import { getAuthService, getCreditService, getPaywallService, isAppServicesConfigured } from "../config/app-services.config";
8
8
  import { env } from "../config/env.config";
9
9
 
10
- declare const __DEV__: boolean;
11
10
 
12
11
  export type ImageSelector = () => Promise<string | null>;
13
12
  export type VideoSaver = (uri: string) => Promise<void>;
@@ -4,7 +4,6 @@
4
4
 
5
5
  export * from "./error-classification";
6
6
  export * from "./error-classifiers";
7
- export * from "./error-extractors";
8
7
  export * from "./error-handlers";
9
8
  export * from "./error-factory";
10
9
  export * from "./error-types";
@@ -4,7 +4,24 @@
4
4
 
5
5
  import { GenerationErrorType, isGenerationError } from "./error-factory";
6
6
 
7
- declare const __DEV__: boolean;
7
+ /**
8
+ * Safely extracts error message from unknown error type
9
+ * Generic utility for any error - no domain-specific logic
10
+ */
11
+ export function getErrorMessage(error: unknown, prefix?: string): string {
12
+ let message = "An unknown error occurred";
13
+
14
+ if (error instanceof Error) {
15
+ message = error.message;
16
+ } else if (typeof error === "string") {
17
+ message = error;
18
+ } else if (error && typeof error === "object" && "message" in error) {
19
+ message = String((error as { message: unknown }).message);
20
+ }
21
+
22
+ return prefix ? `${prefix}: ${message}` : message;
23
+ }
24
+
8
25
 
9
26
  /**
10
27
  * Get translation key from error (returns key if GenerationError, null otherwise)
@@ -7,7 +7,6 @@ import { providerRegistry } from "../services/provider-registry.service";
7
7
  import { cleanBase64 } from "./index";
8
8
  import type { IAIProvider, VideoFeatureInputData, ImageFeatureInputData } from "../../domain/interfaces";
9
9
 
10
- declare const __DEV__: boolean;
11
10
 
12
11
  export type ProviderValidationResult =
13
12
  | { success: true; provider: IAIProvider }
@@ -6,7 +6,6 @@
6
6
 
7
7
  import type { ExtractionRule } from "./extraction-rules";
8
8
 
9
- declare const __DEV__: boolean;
10
9
 
11
10
  /**
12
11
  * Get value from object by path array
@@ -27,7 +27,6 @@ export interface GenerateButtonProps {
27
27
  readonly style?: ViewStyle;
28
28
  }
29
29
 
30
- declare const __DEV__: boolean;
31
30
 
32
31
  export const GenerateButton: React.FC<GenerateButtonProps> = ({
33
32
  isDisabled = false,
@@ -15,7 +15,6 @@ import type {
15
15
  UseGenerationOrchestratorReturn,
16
16
  } from "./types";
17
17
 
18
- declare const __DEV__: boolean;
19
18
 
20
19
  const INITIAL_STATE = { status: "idle" as const, isGenerating: false, result: null, error: null };
21
20
 
@@ -7,7 +7,6 @@ import { useState, useCallback } from "react";
7
7
  import { MediaPickerService, MediaQuality } from "@umituz/react-native-design-system";
8
8
  import { prepareImage } from "../../../infrastructure/utils/feature-utils";
9
9
 
10
- declare const __DEV__: boolean;
11
10
 
12
11
  export interface ImagePickerState {
13
12
  readonly uri: string | null;
@@ -1,11 +0,0 @@
1
- /**
2
- * AI Model Constants
3
- * Single Source of Truth for all AI model IDs
4
- */
5
-
6
- export const DEFAULT_MODELS = {
7
- TEXT_TO_IMAGE: "xai/grok-imagine-image",
8
- TEXT_TO_VIDEO: "fal-ai/ltx-video",
9
- IMAGE_TO_VIDEO: "fal-ai/ltx-video",
10
- SCENARIO_VIDEO: "fal-ai/ltx-video",
11
- } as const;
@@ -1,12 +0,0 @@
1
- /**
2
- * Job Polling Constants
3
- * Single Responsibility: Define polling configuration constants
4
- */
5
-
6
- export const POLLING_CONFIG = {
7
- MAX_ATTEMPTS: 60,
8
- INTERVAL_MS: 5000,
9
- INITIAL_PROGRESS: 20,
10
- FINAL_PROGRESS: 90,
11
- COMPLETION_PROGRESS: 100,
12
- } as const;
@@ -1,24 +0,0 @@
1
- /**
2
- * AI Generation Status Constants
3
- */
4
-
5
- export const FAL_AI_STATUS = {
6
- IN_QUEUE: "IN_QUEUE",
7
- QUEUED: "QUEUED",
8
- IN_PROGRESS: "IN_PROGRESS",
9
- PROCESSING: "PROCESSING",
10
- COMPLETED: "COMPLETED",
11
- FAILED: "FAILED",
12
- } as const;
13
-
14
- export const CREATION_STATUS = {
15
- PENDING: "pending",
16
- QUEUED: "queued",
17
- PROCESSING: "processing",
18
- COMPLETED: "completed",
19
- FAILED: "failed",
20
- } as const;
21
-
22
- export const PROVIDER = {
23
- FAL: "fal",
24
- } as const;
@@ -1,18 +0,0 @@
1
- /**
2
- * Text-to-Image Models Configuration
3
- */
4
-
5
- import type { FalModelConfig } from "@umituz/react-native-ai-fal-provider";
6
-
7
- export const TEXT_TO_IMAGE_MODELS: FalModelConfig[] = [
8
- {
9
- id: "xai/grok-imagine-image",
10
- name: "Grok Imagine",
11
- type: "text-to-image",
12
- isDefault: true,
13
- isActive: true,
14
- pricing: { freeUserCost: 0.5, premiumUserCost: 0.25 },
15
- description: "X.AI's cost-effective text-to-image generation ($0.02/image)",
16
- order: 1,
17
- },
18
- ];
@@ -1,174 +0,0 @@
1
- /**
2
- * Production-Ready Logging Utility
3
- * Provides structured logging with levels and context
4
- */
5
-
6
- declare const __DEV__: boolean;
7
-
8
- export enum LogLevel {
9
- DEBUG = 0,
10
- INFO = 1,
11
- WARN = 2,
12
- ERROR = 3,
13
- NONE = 4,
14
- }
15
-
16
- export interface LogContext {
17
- readonly [key: string]: unknown;
18
- }
19
-
20
- export interface LogEntry {
21
- readonly level: LogLevel;
22
- readonly timestamp: number;
23
- readonly message: string;
24
- readonly context?: LogContext;
25
- readonly error?: Error;
26
- }
27
-
28
- class Logger {
29
- private minLevel: LogLevel;
30
- private logs: LogEntry[] = [];
31
- private maxLogs = 1000;
32
-
33
- constructor() {
34
- // In production, only log WARN and ERROR
35
- this.minLevel =
36
- typeof __DEV__ !== "undefined" && __DEV__ ? LogLevel.DEBUG : LogLevel.WARN;
37
- }
38
-
39
- setMinLevel(level: LogLevel): void {
40
- this.minLevel = level;
41
- }
42
-
43
- private shouldLog(level: LogLevel): boolean {
44
- return level >= this.minLevel;
45
- }
46
-
47
- private addLog(entry: LogEntry): void {
48
- this.logs.push(entry);
49
- // Keep only last maxLogs entries
50
- if (this.logs.length > this.maxLogs) {
51
- this.logs.shift();
52
- }
53
- }
54
-
55
- debug(message: string, context?: LogContext): void {
56
- if (!this.shouldLog(LogLevel.DEBUG)) return;
57
-
58
- const entry: LogEntry = {
59
- level: LogLevel.DEBUG,
60
- timestamp: Date.now(),
61
- message,
62
- context,
63
- };
64
-
65
- this.addLog(entry);
66
-
67
- if (typeof __DEV__ !== "undefined" && __DEV__) {
68
- console.log(`[DEBUG] ${message}`, context || "");
69
- }
70
- }
71
-
72
- info(message: string, context?: LogContext): void {
73
- if (!this.shouldLog(LogLevel.INFO)) return;
74
-
75
- const entry: LogEntry = {
76
- level: LogLevel.INFO,
77
- timestamp: Date.now(),
78
- message,
79
- context,
80
- };
81
-
82
- this.addLog(entry);
83
-
84
- if (typeof __DEV__ !== "undefined" && __DEV__) {
85
- console.info(`[INFO] ${message}`, context || "");
86
- }
87
- }
88
-
89
- warn(message: string, context?: LogContext): void {
90
- if (!this.shouldLog(LogLevel.WARN)) return;
91
-
92
- const entry: LogEntry = {
93
- level: LogLevel.WARN,
94
- timestamp: Date.now(),
95
- message,
96
- context,
97
- };
98
-
99
- this.addLog(entry);
100
- console.warn(`[WARN] ${message}`, context || "");
101
- }
102
-
103
- error(message: string, error?: Error | unknown, context?: LogContext): void {
104
- if (!this.shouldLog(LogLevel.ERROR)) return;
105
-
106
- const errorObj =
107
- error instanceof Error ? error : error ? new Error(String(error)) : undefined;
108
-
109
- const entry: LogEntry = {
110
- level: LogLevel.ERROR,
111
- timestamp: Date.now(),
112
- message,
113
- context,
114
- error: errorObj,
115
- };
116
-
117
- this.addLog(entry);
118
- console.error(`[ERROR] ${message}`, errorObj || "", context || "");
119
- }
120
-
121
- getLogs(level?: LogLevel): readonly LogEntry[] {
122
- if (level !== undefined) {
123
- return this.logs.filter((log) => log.level >= level);
124
- }
125
- return this.logs;
126
- }
127
-
128
- clearLogs(): void {
129
- this.logs = [];
130
- }
131
-
132
- // Convenience methods for specific domains
133
- processing(message: string, context?: LogContext): void {
134
- this.debug(`[Processing] ${message}`, context);
135
- }
136
-
137
- generation(message: string, context?: LogContext): void {
138
- this.debug(`[Generation] ${message}`, context);
139
- }
140
-
141
- polling(message: string, context?: LogContext): void {
142
- this.debug(`[Polling] ${message}`, context);
143
- }
144
-
145
- moderation(message: string, context?: LogContext): void {
146
- this.info(`[Moderation] ${message}`, context);
147
- }
148
-
149
- network(message: string, context?: LogContext): void {
150
- this.info(`[Network] ${message}`, context);
151
- }
152
-
153
- storage(message: string, context?: LogContext): void {
154
- this.debug(`[Storage] ${message}`, context);
155
- }
156
-
157
- validation(message: string, context?: LogContext): void {
158
- this.warn(`[Validation] ${message}`, context);
159
- }
160
- }
161
-
162
- // Singleton instance
163
- export const logger = new Logger();
164
-
165
- // Development helper
166
- export function setDevelopmentMode(): void {
167
- logger.setMinLevel(LogLevel.DEBUG);
168
- }
169
-
170
- // Production helper
171
- export function setProductionMode(): void {
172
- logger.setMinLevel(LogLevel.WARN);
173
- }
174
-
@@ -1,24 +0,0 @@
1
- /**
2
- * Error Message Extraction
3
- */
4
-
5
- /**
6
- * Safely extracts error message from unknown error type
7
- * @param error - The error to extract message from
8
- * @param prefix - Optional prefix to prepend to error message
9
- * @returns The extracted error message with optional prefix
10
- */
11
- export function getErrorMessage(error: unknown, prefix?: string): string {
12
- let message = "An unknown error occurred";
13
-
14
- if (error instanceof Error) {
15
- message = error.message;
16
- } else if (typeof error === "string") {
17
- message = error;
18
- } else if (error && typeof error === "object" && "message" in error) {
19
- message = String(error.message);
20
- }
21
-
22
- return prefix ? `${prefix}: ${message}` : message;
23
- }
24
-