@umituz/web-ai 0.0.0-stage → 1.0.1
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/LICENSE +21 -0
- package/README.md +98 -2
- package/dist/AIErrors-B2ogd1PB.d.ts +197 -0
- package/dist/AIErrors-C5EasV_c.d.cts +197 -0
- package/dist/ContentGeneration-B6iK2B33.d.cts +93 -0
- package/dist/ContentGeneration-B6iK2B33.d.ts +93 -0
- package/dist/ProviderConfig-DIFa9nmG.d.cts +108 -0
- package/dist/ProviderConfig-DIFa9nmG.d.ts +108 -0
- package/dist/cache-manager-Df9LLYGA.d.cts +31 -0
- package/dist/cache-manager-Df9LLYGA.d.ts +31 -0
- package/dist/chat/index.cjs +625 -0
- package/dist/chat/index.cjs.map +1 -0
- package/dist/chat/index.d.cts +25 -0
- package/dist/chat/index.d.ts +25 -0
- package/dist/chat/index.js +618 -0
- package/dist/chat/index.js.map +1 -0
- package/dist/chat.service-CL1qtYxe.d.cts +124 -0
- package/dist/chat.service-q05GnhEm.d.ts +124 -0
- package/dist/content/index.cjs +3976 -0
- package/dist/content/index.cjs.map +1 -0
- package/dist/content/index.d.cts +224 -0
- package/dist/content/index.d.ts +224 -0
- package/dist/content/index.js +3945 -0
- package/dist/content/index.js.map +1 -0
- package/dist/core/index.cjs +1137 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +204 -0
- package/dist/core/index.d.ts +204 -0
- package/dist/core/index.js +1064 -0
- package/dist/core/index.js.map +1 -0
- package/dist/create-ai-DOI9jD3v.d.cts +251 -0
- package/dist/create-ai-DXEoke8-.d.ts +251 -0
- package/dist/hooks/index.cjs +5246 -0
- package/dist/hooks/index.cjs.map +1 -0
- package/dist/hooks/index.d.cts +210 -0
- package/dist/hooks/index.d.ts +210 -0
- package/dist/hooks/index.js +5235 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/index-DIHz8_OJ.d.ts +48 -0
- package/dist/index-DKHNcMbl.d.cts +48 -0
- package/dist/index-fXjxTR5W.d.cts +66 -0
- package/dist/index-fXjxTR5W.d.ts +66 -0
- package/dist/index.cjs +3309 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +3197 -0
- package/dist/index.js.map +1 -0
- package/dist/provider.factory-BxsfK4WW.d.cts +110 -0
- package/dist/provider.factory-DfDfk0dK.d.ts +110 -0
- package/dist/providers/index.cjs +2567 -0
- package/dist/providers/index.cjs.map +1 -0
- package/dist/providers/index.d.cts +332 -0
- package/dist/providers/index.d.ts +332 -0
- package/dist/providers/index.js +2533 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/request-deduplicator.util-NDo0_n1y.d.cts +50 -0
- package/dist/request-deduplicator.util-NDo0_n1y.d.ts +50 -0
- package/dist/wizard/index.cjs +230 -0
- package/dist/wizard/index.cjs.map +1 -0
- package/dist/wizard/index.d.cts +86 -0
- package/dist/wizard/index.d.ts +86 -0
- package/dist/wizard/index.js +223 -0
- package/dist/wizard/index.js.map +1 -0
- package/package.json +114 -4
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
type SocialPlatform = 'twitter' | 'linkedin' | 'instagram' | 'threads' | 'tiktok' | 'facebook';
|
|
2
|
+
type ContentTone = 'professional' | 'casual' | 'enthusiastic' | 'humorous' | 'dramatic' | 'educational' | 'inspirational';
|
|
3
|
+
type ContentType = 'blog' | 'video' | 'social' | 'email' | 'advertisement' | 'caption' | 'script';
|
|
4
|
+
type Emotion = 'happy' | 'excited' | 'calm' | 'sad' | 'angry' | 'surprised' | 'fearful' | 'disgusted' | 'neutral';
|
|
5
|
+
type Sentiment = 'positive' | 'neutral' | 'negative';
|
|
6
|
+
type BlogType = 'tutorial' | 'listicle' | 'review' | 'opinion' | 'howto';
|
|
7
|
+
interface PlatformSpecs {
|
|
8
|
+
maxLength: number;
|
|
9
|
+
style: string;
|
|
10
|
+
emojiSupport: boolean;
|
|
11
|
+
hashtagSupport: boolean;
|
|
12
|
+
imageSupport: boolean;
|
|
13
|
+
videoSupport: boolean;
|
|
14
|
+
maxHashtags: number;
|
|
15
|
+
}
|
|
16
|
+
declare const PLATFORM_SPECS: Record<SocialPlatform, PlatformSpecs>;
|
|
17
|
+
|
|
18
|
+
interface BlogGenerationRequest {
|
|
19
|
+
topic: string;
|
|
20
|
+
blogType: 'tutorial' | 'listicle' | 'review' | 'opinion' | 'howto';
|
|
21
|
+
targetKeywords: string[];
|
|
22
|
+
tone: ContentTone;
|
|
23
|
+
wordCount: number;
|
|
24
|
+
targetAudience: string;
|
|
25
|
+
seoOptimization: boolean;
|
|
26
|
+
includeImages: boolean;
|
|
27
|
+
includeSchema: boolean;
|
|
28
|
+
language?: string;
|
|
29
|
+
}
|
|
30
|
+
interface GeneratedBlog {
|
|
31
|
+
id: string;
|
|
32
|
+
title: string;
|
|
33
|
+
content: string;
|
|
34
|
+
metaDescription: string;
|
|
35
|
+
blogType: string;
|
|
36
|
+
tone: string;
|
|
37
|
+
wordCount: number;
|
|
38
|
+
createdAt: string;
|
|
39
|
+
seoScore: number;
|
|
40
|
+
readabilityScore: number;
|
|
41
|
+
keywords: string[];
|
|
42
|
+
performance: {
|
|
43
|
+
readingTime: number;
|
|
44
|
+
shareability: number;
|
|
45
|
+
seoRank: number;
|
|
46
|
+
};
|
|
47
|
+
schemaMarkup?: string;
|
|
48
|
+
imagePrompts?: string[];
|
|
49
|
+
}
|
|
50
|
+
interface SocialContentRequest {
|
|
51
|
+
topic: string;
|
|
52
|
+
platform: SocialPlatform;
|
|
53
|
+
tone: ContentTone;
|
|
54
|
+
hashtags?: boolean;
|
|
55
|
+
maxLength?: number;
|
|
56
|
+
targetAudience?: string;
|
|
57
|
+
includeCallToAction?: boolean;
|
|
58
|
+
}
|
|
59
|
+
interface GeneratedSocialContent {
|
|
60
|
+
content: string;
|
|
61
|
+
platform: SocialPlatform;
|
|
62
|
+
hashtags: string[];
|
|
63
|
+
emojis: string[];
|
|
64
|
+
characterCount: number;
|
|
65
|
+
estimatedEngagement: number;
|
|
66
|
+
}
|
|
67
|
+
interface VideoScriptRequest {
|
|
68
|
+
topic: string;
|
|
69
|
+
tone: ContentTone;
|
|
70
|
+
duration: number;
|
|
71
|
+
targetAudience: string;
|
|
72
|
+
includeVisuals: boolean;
|
|
73
|
+
includeCallToAction: boolean;
|
|
74
|
+
}
|
|
75
|
+
interface GeneratedVideoScript {
|
|
76
|
+
script: string;
|
|
77
|
+
visualCues: string[];
|
|
78
|
+
duration: number;
|
|
79
|
+
wordCount: number;
|
|
80
|
+
estimatedEngagement: number;
|
|
81
|
+
callToAction?: string;
|
|
82
|
+
}
|
|
83
|
+
interface ContentCalendarEntry {
|
|
84
|
+
date: Date;
|
|
85
|
+
topic: string;
|
|
86
|
+
contentType: ContentType;
|
|
87
|
+
platform: SocialPlatform;
|
|
88
|
+
description: string;
|
|
89
|
+
estimatedEngagement: number;
|
|
90
|
+
priority: 'high' | 'medium' | 'low';
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export { type BlogGenerationRequest as B, type ContentType as C, type Emotion as E, type GeneratedBlog as G, PLATFORM_SPECS as P, type Sentiment as S, type VideoScriptRequest as V, type ContentTone as a, type SocialContentRequest as b, type GeneratedSocialContent as c, type GeneratedVideoScript as d, type ContentCalendarEntry as e, type SocialPlatform as f, type BlogType as g, type PlatformSpecs as h };
|
|
@@ -0,0 +1,108 @@
|
|
|
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 AnthropicConfig extends BaseProviderConfig {
|
|
38
|
+
models?: {
|
|
39
|
+
fast?: string;
|
|
40
|
+
balanced?: string;
|
|
41
|
+
powerful?: string;
|
|
42
|
+
};
|
|
43
|
+
effort?: 'low' | 'medium' | 'high';
|
|
44
|
+
}
|
|
45
|
+
interface ProviderConfig {
|
|
46
|
+
priority: string[];
|
|
47
|
+
anthropic?: AnthropicConfig;
|
|
48
|
+
groq?: GroqConfig;
|
|
49
|
+
fal?: FalConfig;
|
|
50
|
+
pruna?: PrunaConfig;
|
|
51
|
+
gemini?: GeminiConfig;
|
|
52
|
+
fallbackEnabled: boolean;
|
|
53
|
+
retryAttempts: number;
|
|
54
|
+
timeout: number;
|
|
55
|
+
}
|
|
56
|
+
interface GenerationRequest {
|
|
57
|
+
type: 'text' | 'image' | 'video';
|
|
58
|
+
provider?: string;
|
|
59
|
+
}
|
|
60
|
+
interface TextGenerationRequest extends GenerationRequest {
|
|
61
|
+
type: 'text';
|
|
62
|
+
prompt: string;
|
|
63
|
+
model?: string;
|
|
64
|
+
maxTokens?: number;
|
|
65
|
+
temperature?: number;
|
|
66
|
+
topP?: number;
|
|
67
|
+
}
|
|
68
|
+
interface ImageGenerationRequest extends GenerationRequest {
|
|
69
|
+
type: 'image';
|
|
70
|
+
prompt: string;
|
|
71
|
+
style?: 'realistic' | 'cartoon' | 'abstract' | 'minimalist' | 'vintage';
|
|
72
|
+
format?: 'square' | 'landscape' | 'portrait' | 'story' | 'banner';
|
|
73
|
+
quality?: 'standard' | 'high' | 'ultra';
|
|
74
|
+
quantity?: number;
|
|
75
|
+
}
|
|
76
|
+
interface VideoGenerationRequest extends GenerationRequest {
|
|
77
|
+
type: 'video';
|
|
78
|
+
prompt: string;
|
|
79
|
+
duration?: number;
|
|
80
|
+
aspectRatio?: '16:9' | '9:16' | '1:1';
|
|
81
|
+
style?: 'realistic' | 'animated' | 'cinematic' | 'documentary';
|
|
82
|
+
quality?: 'standard' | 'high' | 'ultra';
|
|
83
|
+
}
|
|
84
|
+
interface ImageToVideoRequest extends GenerationRequest {
|
|
85
|
+
type: 'video';
|
|
86
|
+
imageUrl: string;
|
|
87
|
+
prompt?: string;
|
|
88
|
+
duration?: number;
|
|
89
|
+
motion?: 'slow' | 'medium' | 'fast';
|
|
90
|
+
camera?: 'static' | 'pan' | 'zoom' | 'tracking';
|
|
91
|
+
}
|
|
92
|
+
interface VideoToVideoRequest extends GenerationRequest {
|
|
93
|
+
type: 'video';
|
|
94
|
+
sourceVideoUrl: string;
|
|
95
|
+
prompt: string;
|
|
96
|
+
styleTransfer?: 'cinematic' | 'anime' | 'cartoon' | 'vintage';
|
|
97
|
+
enhanceQuality?: boolean;
|
|
98
|
+
}
|
|
99
|
+
interface GeneratedContent {
|
|
100
|
+
id: string;
|
|
101
|
+
type: 'text' | 'image' | 'video';
|
|
102
|
+
url?: string;
|
|
103
|
+
content?: string;
|
|
104
|
+
metadata?: Record<string, unknown>;
|
|
105
|
+
createdAt: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export type { AnthropicConfig as A, 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,108 @@
|
|
|
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 AnthropicConfig extends BaseProviderConfig {
|
|
38
|
+
models?: {
|
|
39
|
+
fast?: string;
|
|
40
|
+
balanced?: string;
|
|
41
|
+
powerful?: string;
|
|
42
|
+
};
|
|
43
|
+
effort?: 'low' | 'medium' | 'high';
|
|
44
|
+
}
|
|
45
|
+
interface ProviderConfig {
|
|
46
|
+
priority: string[];
|
|
47
|
+
anthropic?: AnthropicConfig;
|
|
48
|
+
groq?: GroqConfig;
|
|
49
|
+
fal?: FalConfig;
|
|
50
|
+
pruna?: PrunaConfig;
|
|
51
|
+
gemini?: GeminiConfig;
|
|
52
|
+
fallbackEnabled: boolean;
|
|
53
|
+
retryAttempts: number;
|
|
54
|
+
timeout: number;
|
|
55
|
+
}
|
|
56
|
+
interface GenerationRequest {
|
|
57
|
+
type: 'text' | 'image' | 'video';
|
|
58
|
+
provider?: string;
|
|
59
|
+
}
|
|
60
|
+
interface TextGenerationRequest extends GenerationRequest {
|
|
61
|
+
type: 'text';
|
|
62
|
+
prompt: string;
|
|
63
|
+
model?: string;
|
|
64
|
+
maxTokens?: number;
|
|
65
|
+
temperature?: number;
|
|
66
|
+
topP?: number;
|
|
67
|
+
}
|
|
68
|
+
interface ImageGenerationRequest extends GenerationRequest {
|
|
69
|
+
type: 'image';
|
|
70
|
+
prompt: string;
|
|
71
|
+
style?: 'realistic' | 'cartoon' | 'abstract' | 'minimalist' | 'vintage';
|
|
72
|
+
format?: 'square' | 'landscape' | 'portrait' | 'story' | 'banner';
|
|
73
|
+
quality?: 'standard' | 'high' | 'ultra';
|
|
74
|
+
quantity?: number;
|
|
75
|
+
}
|
|
76
|
+
interface VideoGenerationRequest extends GenerationRequest {
|
|
77
|
+
type: 'video';
|
|
78
|
+
prompt: string;
|
|
79
|
+
duration?: number;
|
|
80
|
+
aspectRatio?: '16:9' | '9:16' | '1:1';
|
|
81
|
+
style?: 'realistic' | 'animated' | 'cinematic' | 'documentary';
|
|
82
|
+
quality?: 'standard' | 'high' | 'ultra';
|
|
83
|
+
}
|
|
84
|
+
interface ImageToVideoRequest extends GenerationRequest {
|
|
85
|
+
type: 'video';
|
|
86
|
+
imageUrl: string;
|
|
87
|
+
prompt?: string;
|
|
88
|
+
duration?: number;
|
|
89
|
+
motion?: 'slow' | 'medium' | 'fast';
|
|
90
|
+
camera?: 'static' | 'pan' | 'zoom' | 'tracking';
|
|
91
|
+
}
|
|
92
|
+
interface VideoToVideoRequest extends GenerationRequest {
|
|
93
|
+
type: 'video';
|
|
94
|
+
sourceVideoUrl: string;
|
|
95
|
+
prompt: string;
|
|
96
|
+
styleTransfer?: 'cinematic' | 'anime' | 'cartoon' | 'vintage';
|
|
97
|
+
enhanceQuality?: boolean;
|
|
98
|
+
}
|
|
99
|
+
interface GeneratedContent {
|
|
100
|
+
id: string;
|
|
101
|
+
type: 'text' | 'image' | 'video';
|
|
102
|
+
url?: string;
|
|
103
|
+
content?: string;
|
|
104
|
+
metadata?: Record<string, unknown>;
|
|
105
|
+
createdAt: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export type { AnthropicConfig as A, 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 };
|