@umituz/web-ai 0.0.0-stage → 1.0.0

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 (65) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +98 -2
  3. package/dist/ABTesting-DDqNhHtP.d.ts +184 -0
  4. package/dist/ABTesting-DWBtKTMQ.d.cts +184 -0
  5. package/dist/ContentGeneration-B6iK2B33.d.cts +93 -0
  6. package/dist/ContentGeneration-B6iK2B33.d.ts +93 -0
  7. package/dist/ProviderConfig-a55tLhWT.d.cts +99 -0
  8. package/dist/ProviderConfig-a55tLhWT.d.ts +99 -0
  9. package/dist/cache-manager-Df9LLYGA.d.cts +31 -0
  10. package/dist/cache-manager-Df9LLYGA.d.ts +31 -0
  11. package/dist/chat/index.cjs +534 -0
  12. package/dist/chat/index.cjs.map +1 -0
  13. package/dist/chat/index.d.cts +25 -0
  14. package/dist/chat/index.d.ts +25 -0
  15. package/dist/chat/index.js +527 -0
  16. package/dist/chat/index.js.map +1 -0
  17. package/dist/chat.service-DBKq9I2c.d.cts +124 -0
  18. package/dist/chat.service-RQn8UTXD.d.ts +124 -0
  19. package/dist/content/index.cjs +3769 -0
  20. package/dist/content/index.cjs.map +1 -0
  21. package/dist/content/index.d.cts +225 -0
  22. package/dist/content/index.d.ts +225 -0
  23. package/dist/content/index.js +3738 -0
  24. package/dist/content/index.js.map +1 -0
  25. package/dist/core/index.cjs +1040 -0
  26. package/dist/core/index.cjs.map +1 -0
  27. package/dist/core/index.d.cts +232 -0
  28. package/dist/core/index.d.ts +232 -0
  29. package/dist/core/index.js +969 -0
  30. package/dist/core/index.js.map +1 -0
  31. package/dist/create-ai-BhNaz86i.d.ts +268 -0
  32. package/dist/create-ai-DGZFBOA1.d.cts +268 -0
  33. package/dist/hooks/index.cjs +5056 -0
  34. package/dist/hooks/index.cjs.map +1 -0
  35. package/dist/hooks/index.d.cts +210 -0
  36. package/dist/hooks/index.d.ts +210 -0
  37. package/dist/hooks/index.js +5045 -0
  38. package/dist/hooks/index.js.map +1 -0
  39. package/dist/index-DjX9ZKuM.d.cts +14 -0
  40. package/dist/index-DxLvE588.d.ts +14 -0
  41. package/dist/index-fXjxTR5W.d.cts +66 -0
  42. package/dist/index-fXjxTR5W.d.ts +66 -0
  43. package/dist/index.cjs +3158 -0
  44. package/dist/index.cjs.map +1 -0
  45. package/dist/index.d.cts +11 -0
  46. package/dist/index.d.ts +11 -0
  47. package/dist/index.js +3048 -0
  48. package/dist/index.js.map +1 -0
  49. package/dist/provider.factory-COsnprLH.d.cts +110 -0
  50. package/dist/provider.factory-CpWFyjbw.d.ts +110 -0
  51. package/dist/providers/index.cjs +2410 -0
  52. package/dist/providers/index.cjs.map +1 -0
  53. package/dist/providers/index.d.cts +333 -0
  54. package/dist/providers/index.d.ts +333 -0
  55. package/dist/providers/index.js +2376 -0
  56. package/dist/providers/index.js.map +1 -0
  57. package/dist/request-deduplicator.util-NDo0_n1y.d.cts +50 -0
  58. package/dist/request-deduplicator.util-NDo0_n1y.d.ts +50 -0
  59. package/dist/wizard/index.cjs +230 -0
  60. package/dist/wizard/index.cjs.map +1 -0
  61. package/dist/wizard/index.d.cts +86 -0
  62. package/dist/wizard/index.d.ts +86 -0
  63. package/dist/wizard/index.js +223 -0
  64. package/dist/wizard/index.js.map +1 -0
  65. package/package.json +111 -4
@@ -0,0 +1,99 @@
1
+ type ProviderHealth = 'healthy' | 'degraded' | 'exhausted' | 'unavailable';
2
+ type ProviderType = 'text' | 'image' | 'video' | 'multimodal';
3
+ interface BaseProviderConfig {
4
+ enabled: boolean;
5
+ apiKey: string;
6
+ baseUrl?: string;
7
+ timeout?: number;
8
+ retryAttempts?: number;
9
+ }
10
+ interface GroqConfig extends BaseProviderConfig {
11
+ models?: {
12
+ text?: string;
13
+ chat?: string;
14
+ };
15
+ reasoningEffort?: 'low' | 'medium' | 'high';
16
+ }
17
+ interface FalConfig extends BaseProviderConfig {
18
+ models?: {
19
+ image?: string;
20
+ video?: string;
21
+ imageToVideo?: string;
22
+ };
23
+ }
24
+ interface PrunaConfig extends BaseProviderConfig {
25
+ models?: {
26
+ textToImage?: string;
27
+ textToVideo?: string;
28
+ };
29
+ }
30
+ interface GeminiConfig extends BaseProviderConfig {
31
+ models?: {
32
+ text?: string;
33
+ image?: string;
34
+ video?: string;
35
+ };
36
+ }
37
+ interface ProviderConfig {
38
+ priority: string[];
39
+ groq?: GroqConfig;
40
+ fal?: FalConfig;
41
+ pruna?: PrunaConfig;
42
+ gemini?: GeminiConfig;
43
+ fallbackEnabled: boolean;
44
+ retryAttempts: number;
45
+ timeout: number;
46
+ }
47
+ interface GenerationRequest {
48
+ type: 'text' | 'image' | 'video';
49
+ provider?: string;
50
+ }
51
+ interface TextGenerationRequest extends GenerationRequest {
52
+ type: 'text';
53
+ prompt: string;
54
+ model?: string;
55
+ maxTokens?: number;
56
+ temperature?: number;
57
+ topP?: number;
58
+ }
59
+ interface ImageGenerationRequest extends GenerationRequest {
60
+ type: 'image';
61
+ prompt: string;
62
+ style?: 'realistic' | 'cartoon' | 'abstract' | 'minimalist' | 'vintage';
63
+ format?: 'square' | 'landscape' | 'portrait' | 'story' | 'banner';
64
+ quality?: 'standard' | 'high' | 'ultra';
65
+ quantity?: number;
66
+ }
67
+ interface VideoGenerationRequest extends GenerationRequest {
68
+ type: 'video';
69
+ prompt: string;
70
+ duration?: number;
71
+ aspectRatio?: '16:9' | '9:16' | '1:1';
72
+ style?: 'realistic' | 'animated' | 'cinematic' | 'documentary';
73
+ quality?: 'standard' | 'high' | 'ultra';
74
+ }
75
+ interface ImageToVideoRequest extends GenerationRequest {
76
+ type: 'video';
77
+ imageUrl: string;
78
+ prompt?: string;
79
+ duration?: number;
80
+ motion?: 'slow' | 'medium' | 'fast';
81
+ camera?: 'static' | 'pan' | 'zoom' | 'tracking';
82
+ }
83
+ interface VideoToVideoRequest extends GenerationRequest {
84
+ type: 'video';
85
+ sourceVideoUrl: string;
86
+ prompt: string;
87
+ styleTransfer?: 'cinematic' | 'anime' | 'cartoon' | 'vintage';
88
+ enhanceQuality?: boolean;
89
+ }
90
+ interface GeneratedContent {
91
+ id: string;
92
+ type: 'text' | 'image' | 'video';
93
+ url?: string;
94
+ content?: string;
95
+ metadata?: Record<string, unknown>;
96
+ createdAt: string;
97
+ }
98
+
99
+ export type { BaseProviderConfig as B, FalConfig as F, GeneratedContent as G, ImageGenerationRequest as I, PrunaConfig as P, TextGenerationRequest as T, VideoGenerationRequest as V, ImageToVideoRequest as a, VideoToVideoRequest as b, GeminiConfig as c, ProviderConfig as d, GenerationRequest as e, GroqConfig as f, ProviderHealth as g, ProviderType as h };
@@ -0,0 +1,99 @@
1
+ type ProviderHealth = 'healthy' | 'degraded' | 'exhausted' | 'unavailable';
2
+ type ProviderType = 'text' | 'image' | 'video' | 'multimodal';
3
+ interface BaseProviderConfig {
4
+ enabled: boolean;
5
+ apiKey: string;
6
+ baseUrl?: string;
7
+ timeout?: number;
8
+ retryAttempts?: number;
9
+ }
10
+ interface GroqConfig extends BaseProviderConfig {
11
+ models?: {
12
+ text?: string;
13
+ chat?: string;
14
+ };
15
+ reasoningEffort?: 'low' | 'medium' | 'high';
16
+ }
17
+ interface FalConfig extends BaseProviderConfig {
18
+ models?: {
19
+ image?: string;
20
+ video?: string;
21
+ imageToVideo?: string;
22
+ };
23
+ }
24
+ interface PrunaConfig extends BaseProviderConfig {
25
+ models?: {
26
+ textToImage?: string;
27
+ textToVideo?: string;
28
+ };
29
+ }
30
+ interface GeminiConfig extends BaseProviderConfig {
31
+ models?: {
32
+ text?: string;
33
+ image?: string;
34
+ video?: string;
35
+ };
36
+ }
37
+ interface ProviderConfig {
38
+ priority: string[];
39
+ groq?: GroqConfig;
40
+ fal?: FalConfig;
41
+ pruna?: PrunaConfig;
42
+ gemini?: GeminiConfig;
43
+ fallbackEnabled: boolean;
44
+ retryAttempts: number;
45
+ timeout: number;
46
+ }
47
+ interface GenerationRequest {
48
+ type: 'text' | 'image' | 'video';
49
+ provider?: string;
50
+ }
51
+ interface TextGenerationRequest extends GenerationRequest {
52
+ type: 'text';
53
+ prompt: string;
54
+ model?: string;
55
+ maxTokens?: number;
56
+ temperature?: number;
57
+ topP?: number;
58
+ }
59
+ interface ImageGenerationRequest extends GenerationRequest {
60
+ type: 'image';
61
+ prompt: string;
62
+ style?: 'realistic' | 'cartoon' | 'abstract' | 'minimalist' | 'vintage';
63
+ format?: 'square' | 'landscape' | 'portrait' | 'story' | 'banner';
64
+ quality?: 'standard' | 'high' | 'ultra';
65
+ quantity?: number;
66
+ }
67
+ interface VideoGenerationRequest extends GenerationRequest {
68
+ type: 'video';
69
+ prompt: string;
70
+ duration?: number;
71
+ aspectRatio?: '16:9' | '9:16' | '1:1';
72
+ style?: 'realistic' | 'animated' | 'cinematic' | 'documentary';
73
+ quality?: 'standard' | 'high' | 'ultra';
74
+ }
75
+ interface ImageToVideoRequest extends GenerationRequest {
76
+ type: 'video';
77
+ imageUrl: string;
78
+ prompt?: string;
79
+ duration?: number;
80
+ motion?: 'slow' | 'medium' | 'fast';
81
+ camera?: 'static' | 'pan' | 'zoom' | 'tracking';
82
+ }
83
+ interface VideoToVideoRequest extends GenerationRequest {
84
+ type: 'video';
85
+ sourceVideoUrl: string;
86
+ prompt: string;
87
+ styleTransfer?: 'cinematic' | 'anime' | 'cartoon' | 'vintage';
88
+ enhanceQuality?: boolean;
89
+ }
90
+ interface GeneratedContent {
91
+ id: string;
92
+ type: 'text' | 'image' | 'video';
93
+ url?: string;
94
+ content?: string;
95
+ metadata?: Record<string, unknown>;
96
+ createdAt: string;
97
+ }
98
+
99
+ export type { BaseProviderConfig as B, FalConfig as F, GeneratedContent as G, ImageGenerationRequest as I, PrunaConfig as P, TextGenerationRequest as T, VideoGenerationRequest as V, ImageToVideoRequest as a, VideoToVideoRequest as b, GeminiConfig as c, ProviderConfig as d, GenerationRequest as e, GroqConfig as f, ProviderHealth as g, ProviderType as h };
@@ -0,0 +1,31 @@
1
+ interface CacheOptions {
2
+ readonly maxSize?: number;
3
+ readonly ttl?: number;
4
+ }
5
+ declare class CacheManager {
6
+ private readonly cache;
7
+ private readonly maxSize;
8
+ private readonly ttl;
9
+ constructor(options?: CacheOptions);
10
+ get<T>(key: string): T | null;
11
+ set<T>(key: string, value: T): void;
12
+ has(key: string): boolean;
13
+ delete(key: string): boolean;
14
+ clear(): void;
15
+ generateKey(params: Readonly<Record<string, unknown>>): string;
16
+ getStats(): CacheStats;
17
+ private isExpired;
18
+ }
19
+ interface CacheStats {
20
+ readonly size: number;
21
+ readonly maxSize: number;
22
+ readonly hitRate: number;
23
+ readonly entries: ReadonlyArray<{
24
+ readonly key: string;
25
+ readonly accessCount: number;
26
+ readonly ageMs: number;
27
+ }>;
28
+ }
29
+ declare const cacheManager: CacheManager;
30
+
31
+ export { CacheManager as C, type CacheOptions as a, type CacheStats as b, cacheManager as c };
@@ -0,0 +1,31 @@
1
+ interface CacheOptions {
2
+ readonly maxSize?: number;
3
+ readonly ttl?: number;
4
+ }
5
+ declare class CacheManager {
6
+ private readonly cache;
7
+ private readonly maxSize;
8
+ private readonly ttl;
9
+ constructor(options?: CacheOptions);
10
+ get<T>(key: string): T | null;
11
+ set<T>(key: string, value: T): void;
12
+ has(key: string): boolean;
13
+ delete(key: string): boolean;
14
+ clear(): void;
15
+ generateKey(params: Readonly<Record<string, unknown>>): string;
16
+ getStats(): CacheStats;
17
+ private isExpired;
18
+ }
19
+ interface CacheStats {
20
+ readonly size: number;
21
+ readonly maxSize: number;
22
+ readonly hitRate: number;
23
+ readonly entries: ReadonlyArray<{
24
+ readonly key: string;
25
+ readonly accessCount: number;
26
+ readonly ageMs: number;
27
+ }>;
28
+ }
29
+ declare const cacheManager: CacheManager;
30
+
31
+ export { CacheManager as C, type CacheOptions as a, type CacheStats as b, cacheManager as c };