@umituz/web-ai 1.0.3 → 1.0.5
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/dist/{AIErrors-B2ogd1PB.d.ts → AIErrors-CLjXRty-.d.ts} +99 -92
- package/dist/{AIErrors-C5EasV_c.d.cts → AIErrors-DjZXUiLT.d.cts} +99 -92
- package/dist/{cancellation-error-DwHrDKBz.d.cts → cancellation-error-Cj7fJyCg.d.cts} +3 -3
- package/dist/{cancellation-error-CKcZRhFg.d.ts → cancellation-error-CkMn5Kft.d.ts} +3 -3
- package/dist/chat/index.cjs.map +1 -1
- package/dist/chat/index.d.cts +3 -3
- package/dist/chat/index.d.ts +3 -3
- package/dist/chat/index.js.map +1 -1
- package/dist/{chat.service-CL1qtYxe.d.cts → chat.service-9M-KpLo-.d.cts} +1 -1
- package/dist/{chat.service-q05GnhEm.d.ts → chat.service-B4FLFxR1.d.ts} +1 -1
- package/dist/content/index.cjs +1047 -490
- package/dist/content/index.cjs.map +1 -1
- package/dist/content/index.d.cts +165 -219
- package/dist/content/index.d.ts +165 -219
- package/dist/content/index.js +983 -491
- package/dist/content/index.js.map +1 -1
- package/dist/{create-ai-9PW752z8.d.ts → create-ai-0eZFFqTw.d.ts} +1 -1
- package/dist/{create-ai-CXYKPK6G.d.cts → create-ai-BrKR_5fQ.d.cts} +1 -1
- package/dist/hooks/index.cjs +66 -8
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.cts +21 -11
- package/dist/hooks/index.d.ts +21 -11
- package/dist/hooks/index.js +65 -9
- package/dist/hooks/index.js.map +1 -1
- package/dist/index-BUVULo3h.d.ts +177 -0
- package/dist/index-BulSkB2L.d.cts +177 -0
- package/dist/index.cjs +1800 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -5
- package/dist/index.d.ts +8 -5
- package/dist/index.js +1757 -15
- package/dist/index.js.map +1 -1
- package/dist/{provider.factory-DfDfk0dK.d.ts → provider.factory-BwPnqSEU.d.ts} +3 -1
- package/dist/{provider.factory-BxsfK4WW.d.cts → provider.factory-DyfJtR8M.d.cts} +3 -1
- package/dist/providers/index.cjs +9 -0
- package/dist/providers/index.cjs.map +1 -1
- package/dist/providers/index.d.cts +10 -8
- package/dist/providers/index.d.ts +10 -8
- package/dist/providers/index.js +7 -1
- package/dist/providers/index.js.map +1 -1
- package/dist/requestQueue-CkJ6Xc9K.d.cts +261 -0
- package/dist/requestQueue-CvxWxC-z.d.ts +261 -0
- package/dist/wizard/index.d.cts +2 -86
- package/dist/wizard/index.d.ts +2 -86
- package/package.json +16 -1
- package/dist/ContentGeneration-B6iK2B33.d.cts +0 -93
- package/dist/ContentGeneration-B6iK2B33.d.ts +0 -93
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { f as AspectRatio, o as ImageQuality, w as VideoQuality, t as SentimentAnalysisResult, C as ContentAnalysisRequest, g as ContentAnalysisResult, S as SEOOptimizationRequest, q as SEOOptimizationResult, r as SEOScoreBreakdown, K as KeywordAnalysis, b as ABTestRequest, a as ABTestPrediction, A as ABTestComparison } from './AIErrors-DjZXUiLT.cjs';
|
|
2
|
+
import { B as BlogGenerationRequest, G as GeneratedBlog, m as SocialContentRequest, h as GeneratedSocialContent, q as VideoScriptRequest, i as GeneratedVideoScript, c as ContentTone, b as ContentCalendarEntry, n as SocialPlatform, E as Emotion } from './index-BulSkB2L.cjs';
|
|
3
|
+
import { c as ITextGenerator, e as ProviderFactory, T as TextGenerationOptions } from './provider.factory-DyfJtR8M.cjs';
|
|
4
|
+
import { d as ProviderConfig, I as ImageGenerationRequest, G as GeneratedContent, V as VideoGenerationRequest, a as ImageToVideoRequest, b as VideoToVideoRequest } from './ProviderConfig-DIFa9nmG.cjs';
|
|
5
|
+
import { A as AIProviderConfig } from './create-ai-BrKR_5fQ.cjs';
|
|
6
|
+
import { T as TextRequest, G as GenerationResult } from './index-fXjxTR5W.cjs';
|
|
7
|
+
|
|
8
|
+
declare function resolveDimensionsForAspectRatio(ratio: AspectRatio): {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
declare function recommendQualityForAspectRatio(ratio: AspectRatio): ImageQuality | VideoQuality;
|
|
14
|
+
|
|
15
|
+
declare const ASPECT_RATIO_VALUES: AspectRatio[];
|
|
16
|
+
declare const IMAGE_QUALITY_VALUES: ImageQuality[];
|
|
17
|
+
declare const VIDEO_QUALITY_VALUES: VideoQuality[];
|
|
18
|
+
declare const VIDEO_DURATION_OPTIONS: readonly number[];
|
|
19
|
+
|
|
20
|
+
declare const getDimensionsForAspectRatio: typeof resolveDimensionsForAspectRatio;
|
|
21
|
+
declare const getRecommendedQuality: typeof recommendQualityForAspectRatio;
|
|
22
|
+
|
|
23
|
+
interface IAIContentService {
|
|
24
|
+
generateBlogPost(request: BlogGenerationRequest): Promise<GeneratedBlog>;
|
|
25
|
+
generateSocialContent(request: SocialContentRequest): Promise<GeneratedSocialContent>;
|
|
26
|
+
generateVideoScript(request: VideoScriptRequest): Promise<GeneratedVideoScript>;
|
|
27
|
+
generateForAllPlatforms(topic: string, tone: ContentTone): Promise<GeneratedSocialContent[]>;
|
|
28
|
+
generateContentCalendar(niche: string, days: number): Promise<ContentCalendarEntry[]>;
|
|
29
|
+
analyzeSentiment(content: string): Promise<SentimentAnalysisResult>;
|
|
30
|
+
analyzeContent(request: ContentAnalysisRequest): Promise<ContentAnalysisResult>;
|
|
31
|
+
optimizeSEO(request: SEOOptimizationRequest): Promise<SEOOptimizationResult>;
|
|
32
|
+
calculateSEOScore(content: string, keywords: string[]): Promise<SEOScoreBreakdown>;
|
|
33
|
+
analyzeKeywords(content: string, keywords: string[]): Promise<KeywordAnalysis[]>;
|
|
34
|
+
predictABTest(request: ABTestRequest): Promise<ABTestPrediction[]>;
|
|
35
|
+
compareVariants(variantA: string, variantB: string): Promise<ABTestComparison>;
|
|
36
|
+
generateHashtags(content: string, count: number): Promise<string[]>;
|
|
37
|
+
optimizeHashtags(hashtags: string[], platform: SocialPlatform): Promise<string[]>;
|
|
38
|
+
generateImagePrompt(description: string, style: string): Promise<string>;
|
|
39
|
+
generateImagePromptsForBlog(blogContent: string): Promise<string[]>;
|
|
40
|
+
generateVoiceScript(topic: string, emotion: Emotion, duration: number): Promise<GeneratedVideoScript>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare class AIContentService implements IAIContentService {
|
|
44
|
+
private readonly providerFactory;
|
|
45
|
+
private readonly blogService;
|
|
46
|
+
private readonly socialService;
|
|
47
|
+
private readonly videoScriptService;
|
|
48
|
+
private readonly analysisService;
|
|
49
|
+
private readonly seoService;
|
|
50
|
+
private readonly abTestService;
|
|
51
|
+
private readonly imagePromptService;
|
|
52
|
+
private readonly contentCalendarService;
|
|
53
|
+
private readonly mediaGenerationService;
|
|
54
|
+
constructor(configOrGenerator: AIProviderConfig | ProviderConfig | ITextGenerator | string, model?: string, textGenerator?: ITextGenerator);
|
|
55
|
+
/** The composed factory — chat()/chatStream() with usage, health, fallback. */
|
|
56
|
+
get providers(): ProviderFactory;
|
|
57
|
+
generateBlogPost(request: BlogGenerationRequest): Promise<GeneratedBlog>;
|
|
58
|
+
generateSocialContent(request: SocialContentRequest): Promise<GeneratedSocialContent>;
|
|
59
|
+
generateForAllPlatforms(topic: string, tone: ContentTone): Promise<GeneratedSocialContent[]>;
|
|
60
|
+
generateHashtags(content: string, count: number): Promise<string[]>;
|
|
61
|
+
optimizeHashtags(hashtags: string[], platform: SocialPlatform): Promise<string[]>;
|
|
62
|
+
generateVideoScript(request: VideoScriptRequest): Promise<GeneratedVideoScript>;
|
|
63
|
+
generateVoiceScript(topic: string, emotion: Emotion, duration: number): Promise<GeneratedVideoScript>;
|
|
64
|
+
generateContentCalendar(niche: string, days: number): Promise<ContentCalendarEntry[]>;
|
|
65
|
+
analyzeSentiment(content: string): Promise<SentimentAnalysisResult>;
|
|
66
|
+
analyzeContent(request: ContentAnalysisRequest): Promise<ContentAnalysisResult>;
|
|
67
|
+
optimizeSEO(request: SEOOptimizationRequest): Promise<SEOOptimizationResult>;
|
|
68
|
+
calculateSEOScore(content: string, keywords: string[]): Promise<SEOScoreBreakdown>;
|
|
69
|
+
analyzeKeywords(content: string, keywords: string[]): Promise<KeywordAnalysis[]>;
|
|
70
|
+
predictABTest(request: ABTestRequest): Promise<ABTestPrediction[]>;
|
|
71
|
+
compareVariants(variantA: string, variantB: string): Promise<ABTestComparison>;
|
|
72
|
+
generateImagePrompt(description: string, style: string): Promise<string>;
|
|
73
|
+
generateImagePromptsForBlog(blogContent: string): Promise<string[]>;
|
|
74
|
+
generateImage(request: ImageGenerationRequest): Promise<GeneratedContent>;
|
|
75
|
+
generateVideo(request: VideoGenerationRequest): Promise<GeneratedContent>;
|
|
76
|
+
convertImageToVideo(request: ImageToVideoRequest): Promise<GeneratedContent>;
|
|
77
|
+
transformVideo(request: VideoToVideoRequest): Promise<GeneratedContent>;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The single LLM seam for the content services. runJson/runText keep the
|
|
82
|
+
* string facade the nine services were built against; runChat passes a full
|
|
83
|
+
* TextRequest through to the factory and returns the usage-complete
|
|
84
|
+
* GenerationResult.
|
|
85
|
+
*/
|
|
86
|
+
declare class GenerationExecutor {
|
|
87
|
+
private readonly generator;
|
|
88
|
+
constructor(generator: ITextGenerator | ProviderFactory);
|
|
89
|
+
runJson<T>(prompt: string, fallback: T, generationOptions?: TextGenerationOptions): Promise<T>;
|
|
90
|
+
runText(prompt: string, options?: TextGenerationOptions): Promise<string>;
|
|
91
|
+
/** Usage-complete pass-through; requires a ProviderFactory engine. */
|
|
92
|
+
runChat(request: TextRequest): Promise<GenerationResult>;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
declare class BlogService {
|
|
96
|
+
private readonly executor;
|
|
97
|
+
constructor(executor: GenerationExecutor);
|
|
98
|
+
generateBlogPost(request: BlogGenerationRequest): Promise<GeneratedBlog>;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
declare class SocialService {
|
|
102
|
+
private readonly executor;
|
|
103
|
+
constructor(executor: GenerationExecutor);
|
|
104
|
+
generateSocialContent(request: SocialContentRequest): Promise<GeneratedSocialContent>;
|
|
105
|
+
generateForAllPlatforms(topic: string, tone: ContentTone): Promise<GeneratedSocialContent[]>;
|
|
106
|
+
generateHashtags(content: string, count: number): Promise<string[]>;
|
|
107
|
+
optimizeHashtags(hashtags: string[], platform: SocialPlatform): string[];
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
declare class VideoScriptService {
|
|
111
|
+
private readonly executor;
|
|
112
|
+
constructor(executor: GenerationExecutor);
|
|
113
|
+
generateVideoScript(request: VideoScriptRequest): Promise<GeneratedVideoScript>;
|
|
114
|
+
generateVoiceScript(topic: string, emotion: Emotion, duration: number): Promise<GeneratedVideoScript>;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
declare class AnalysisService {
|
|
118
|
+
private readonly executor;
|
|
119
|
+
constructor(executor: GenerationExecutor);
|
|
120
|
+
analyzeSentiment(content: string): Promise<SentimentAnalysisResult>;
|
|
121
|
+
analyzeContent(request: ContentAnalysisRequest): Promise<ContentAnalysisResult>;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
declare class SeoService {
|
|
125
|
+
private readonly executor;
|
|
126
|
+
constructor(executor: GenerationExecutor);
|
|
127
|
+
optimizeSEO(request: SEOOptimizationRequest): Promise<SEOOptimizationResult>;
|
|
128
|
+
calculateSEOScore(content: string, keywords: string[]): Promise<SEOScoreBreakdown>;
|
|
129
|
+
analyzeKeywords(content: string, keywords: string[]): KeywordAnalysis[];
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
declare class ABTestService {
|
|
133
|
+
private readonly executor;
|
|
134
|
+
constructor(executor: GenerationExecutor);
|
|
135
|
+
predictABTest(request: ABTestRequest): Promise<ABTestPrediction[]>;
|
|
136
|
+
compareVariants(variantA: string, variantB: string): Promise<ABTestComparison>;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
declare class ImagePromptService {
|
|
140
|
+
private readonly executor;
|
|
141
|
+
constructor(executor: GenerationExecutor);
|
|
142
|
+
generateImagePrompt(description: string, style: string): Promise<string>;
|
|
143
|
+
generateImagePromptsForBlog(blogContent: string): Promise<string[]>;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
declare class ContentCalendarService {
|
|
147
|
+
private readonly executor;
|
|
148
|
+
constructor(executor: GenerationExecutor);
|
|
149
|
+
generateContentCalendar(niche: string, days: number): Promise<ContentCalendarEntry[]>;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
declare class MediaGenerationService {
|
|
153
|
+
private readonly providerFactory;
|
|
154
|
+
constructor(providerFactory: ProviderFactory);
|
|
155
|
+
generateImage(request: ImageGenerationRequest): Promise<GeneratedContent>;
|
|
156
|
+
generateVideo(request: VideoGenerationRequest): Promise<GeneratedContent>;
|
|
157
|
+
convertImageToVideo(request: ImageToVideoRequest): Promise<GeneratedContent>;
|
|
158
|
+
transformVideo(request: VideoToVideoRequest): Promise<GeneratedContent>;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
declare class PromptBuilder {
|
|
162
|
+
static blogPost(input: {
|
|
163
|
+
topic: string;
|
|
164
|
+
blogType: string;
|
|
165
|
+
keywords: string[];
|
|
166
|
+
tone: string;
|
|
167
|
+
targetAudience: string;
|
|
168
|
+
wordCount: number;
|
|
169
|
+
language?: string;
|
|
170
|
+
seoOptimization: boolean;
|
|
171
|
+
includeSchema: boolean;
|
|
172
|
+
includeImages: boolean;
|
|
173
|
+
}): string;
|
|
174
|
+
static socialPost(input: {
|
|
175
|
+
topic: string;
|
|
176
|
+
platform: string;
|
|
177
|
+
tone: string;
|
|
178
|
+
style: string;
|
|
179
|
+
maxLength: number;
|
|
180
|
+
includeHashtags: boolean;
|
|
181
|
+
includeCallToAction: boolean;
|
|
182
|
+
}): string;
|
|
183
|
+
static videoScript(input: {
|
|
184
|
+
topic: string;
|
|
185
|
+
tone: string;
|
|
186
|
+
duration: number;
|
|
187
|
+
targetAudience: string;
|
|
188
|
+
includeVisuals: boolean;
|
|
189
|
+
includeCallToAction: boolean;
|
|
190
|
+
}): string;
|
|
191
|
+
static voiceScript(input: {
|
|
192
|
+
topic: string;
|
|
193
|
+
emotion: string;
|
|
194
|
+
duration: number;
|
|
195
|
+
}): string;
|
|
196
|
+
static contentCalendar(niche: string, days: number): string;
|
|
197
|
+
static sentiment(content: string): string;
|
|
198
|
+
static contentAnalysis(content: string): string;
|
|
199
|
+
static seoOptimization(content: string, keywords: string[]): string;
|
|
200
|
+
static seoScore(content: string, keywords: string[]): string;
|
|
201
|
+
static abTestVariant(input: {
|
|
202
|
+
content: string;
|
|
203
|
+
contentType: string;
|
|
204
|
+
tone: string;
|
|
205
|
+
targetAudience: string;
|
|
206
|
+
platform: string;
|
|
207
|
+
goals: string[];
|
|
208
|
+
}): string;
|
|
209
|
+
static hashtags(content: string, count: number): string;
|
|
210
|
+
static imagePrompt(description: string, style: string): string;
|
|
211
|
+
static blogImagePrompts(blogContent: string): string;
|
|
212
|
+
static maxTokensForDuration(durationSeconds: number): number;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
declare function safeJSONParse<T>(text: string, fallback: T, onError?: (context: string) => void): T;
|
|
216
|
+
declare function extractJSON(text: string): string | null;
|
|
217
|
+
declare function parseAIResponse<T>(response: string, fallback: T, onError?: (context: string) => void): T;
|
|
218
|
+
declare function isValidJSON(text: string): boolean;
|
|
219
|
+
|
|
220
|
+
declare enum RequestPriority {
|
|
221
|
+
LOW = 0,
|
|
222
|
+
NORMAL = 1,
|
|
223
|
+
HIGH = 2,
|
|
224
|
+
URGENT = 3
|
|
225
|
+
}
|
|
226
|
+
interface QueueConfig {
|
|
227
|
+
maxConcurrent: number;
|
|
228
|
+
maxQueueSize: number;
|
|
229
|
+
defaultTimeout: number;
|
|
230
|
+
retryDelay: number;
|
|
231
|
+
enableRateLimit: boolean;
|
|
232
|
+
rateLimitWindow: number;
|
|
233
|
+
rateLimitMaxRequests: number;
|
|
234
|
+
}
|
|
235
|
+
declare class RequestQueue {
|
|
236
|
+
private queue;
|
|
237
|
+
private running;
|
|
238
|
+
private config;
|
|
239
|
+
private requestHistory;
|
|
240
|
+
private isProcessing;
|
|
241
|
+
constructor(config?: Partial<QueueConfig>);
|
|
242
|
+
add<T>(fn: (signal: AbortSignal) => Promise<T>, priority?: RequestPriority, maxRetries?: number): Promise<T>;
|
|
243
|
+
private sortQueue;
|
|
244
|
+
private process;
|
|
245
|
+
private canMakeRequest;
|
|
246
|
+
private executeRequest;
|
|
247
|
+
private withTimeout;
|
|
248
|
+
getStats(): {
|
|
249
|
+
queued: number;
|
|
250
|
+
running: number;
|
|
251
|
+
rateLimitRemaining: number;
|
|
252
|
+
};
|
|
253
|
+
clear(): void;
|
|
254
|
+
drain(): Promise<void>;
|
|
255
|
+
}
|
|
256
|
+
declare function batchRequest<T>(requests: Array<() => Promise<T>>, options?: {
|
|
257
|
+
concurrency?: number;
|
|
258
|
+
stopOnError?: boolean;
|
|
259
|
+
}): Promise<T[]>;
|
|
260
|
+
|
|
261
|
+
export { ABTestService as A, BlogService as B, ContentCalendarService as C, GenerationExecutor as G, type IAIContentService as I, MediaGenerationService as M, PromptBuilder as P, type QueueConfig as Q, RequestPriority as R, SeoService as S, VIDEO_DURATION_OPTIONS as V, AIContentService as a, ASPECT_RATIO_VALUES as b, AnalysisService as c, IMAGE_QUALITY_VALUES as d, ImagePromptService as e, SocialService as f, VIDEO_QUALITY_VALUES as g, VideoScriptService as h, batchRequest as i, extractJSON as j, getDimensionsForAspectRatio as k, getRecommendedQuality as l, isValidJSON as m, RequestQueue as n, resolveDimensionsForAspectRatio as o, parseAIResponse as p, recommendQualityForAspectRatio as r, safeJSONParse as s };
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { f as AspectRatio, o as ImageQuality, w as VideoQuality, t as SentimentAnalysisResult, C as ContentAnalysisRequest, g as ContentAnalysisResult, S as SEOOptimizationRequest, q as SEOOptimizationResult, r as SEOScoreBreakdown, K as KeywordAnalysis, b as ABTestRequest, a as ABTestPrediction, A as ABTestComparison } from './AIErrors-CLjXRty-.js';
|
|
2
|
+
import { B as BlogGenerationRequest, G as GeneratedBlog, m as SocialContentRequest, h as GeneratedSocialContent, q as VideoScriptRequest, i as GeneratedVideoScript, c as ContentTone, b as ContentCalendarEntry, n as SocialPlatform, E as Emotion } from './index-BUVULo3h.js';
|
|
3
|
+
import { c as ITextGenerator, e as ProviderFactory, T as TextGenerationOptions } from './provider.factory-BwPnqSEU.js';
|
|
4
|
+
import { d as ProviderConfig, I as ImageGenerationRequest, G as GeneratedContent, V as VideoGenerationRequest, a as ImageToVideoRequest, b as VideoToVideoRequest } from './ProviderConfig-DIFa9nmG.js';
|
|
5
|
+
import { A as AIProviderConfig } from './create-ai-0eZFFqTw.js';
|
|
6
|
+
import { T as TextRequest, G as GenerationResult } from './index-fXjxTR5W.js';
|
|
7
|
+
|
|
8
|
+
declare function resolveDimensionsForAspectRatio(ratio: AspectRatio): {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
declare function recommendQualityForAspectRatio(ratio: AspectRatio): ImageQuality | VideoQuality;
|
|
14
|
+
|
|
15
|
+
declare const ASPECT_RATIO_VALUES: AspectRatio[];
|
|
16
|
+
declare const IMAGE_QUALITY_VALUES: ImageQuality[];
|
|
17
|
+
declare const VIDEO_QUALITY_VALUES: VideoQuality[];
|
|
18
|
+
declare const VIDEO_DURATION_OPTIONS: readonly number[];
|
|
19
|
+
|
|
20
|
+
declare const getDimensionsForAspectRatio: typeof resolveDimensionsForAspectRatio;
|
|
21
|
+
declare const getRecommendedQuality: typeof recommendQualityForAspectRatio;
|
|
22
|
+
|
|
23
|
+
interface IAIContentService {
|
|
24
|
+
generateBlogPost(request: BlogGenerationRequest): Promise<GeneratedBlog>;
|
|
25
|
+
generateSocialContent(request: SocialContentRequest): Promise<GeneratedSocialContent>;
|
|
26
|
+
generateVideoScript(request: VideoScriptRequest): Promise<GeneratedVideoScript>;
|
|
27
|
+
generateForAllPlatforms(topic: string, tone: ContentTone): Promise<GeneratedSocialContent[]>;
|
|
28
|
+
generateContentCalendar(niche: string, days: number): Promise<ContentCalendarEntry[]>;
|
|
29
|
+
analyzeSentiment(content: string): Promise<SentimentAnalysisResult>;
|
|
30
|
+
analyzeContent(request: ContentAnalysisRequest): Promise<ContentAnalysisResult>;
|
|
31
|
+
optimizeSEO(request: SEOOptimizationRequest): Promise<SEOOptimizationResult>;
|
|
32
|
+
calculateSEOScore(content: string, keywords: string[]): Promise<SEOScoreBreakdown>;
|
|
33
|
+
analyzeKeywords(content: string, keywords: string[]): Promise<KeywordAnalysis[]>;
|
|
34
|
+
predictABTest(request: ABTestRequest): Promise<ABTestPrediction[]>;
|
|
35
|
+
compareVariants(variantA: string, variantB: string): Promise<ABTestComparison>;
|
|
36
|
+
generateHashtags(content: string, count: number): Promise<string[]>;
|
|
37
|
+
optimizeHashtags(hashtags: string[], platform: SocialPlatform): Promise<string[]>;
|
|
38
|
+
generateImagePrompt(description: string, style: string): Promise<string>;
|
|
39
|
+
generateImagePromptsForBlog(blogContent: string): Promise<string[]>;
|
|
40
|
+
generateVoiceScript(topic: string, emotion: Emotion, duration: number): Promise<GeneratedVideoScript>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare class AIContentService implements IAIContentService {
|
|
44
|
+
private readonly providerFactory;
|
|
45
|
+
private readonly blogService;
|
|
46
|
+
private readonly socialService;
|
|
47
|
+
private readonly videoScriptService;
|
|
48
|
+
private readonly analysisService;
|
|
49
|
+
private readonly seoService;
|
|
50
|
+
private readonly abTestService;
|
|
51
|
+
private readonly imagePromptService;
|
|
52
|
+
private readonly contentCalendarService;
|
|
53
|
+
private readonly mediaGenerationService;
|
|
54
|
+
constructor(configOrGenerator: AIProviderConfig | ProviderConfig | ITextGenerator | string, model?: string, textGenerator?: ITextGenerator);
|
|
55
|
+
/** The composed factory — chat()/chatStream() with usage, health, fallback. */
|
|
56
|
+
get providers(): ProviderFactory;
|
|
57
|
+
generateBlogPost(request: BlogGenerationRequest): Promise<GeneratedBlog>;
|
|
58
|
+
generateSocialContent(request: SocialContentRequest): Promise<GeneratedSocialContent>;
|
|
59
|
+
generateForAllPlatforms(topic: string, tone: ContentTone): Promise<GeneratedSocialContent[]>;
|
|
60
|
+
generateHashtags(content: string, count: number): Promise<string[]>;
|
|
61
|
+
optimizeHashtags(hashtags: string[], platform: SocialPlatform): Promise<string[]>;
|
|
62
|
+
generateVideoScript(request: VideoScriptRequest): Promise<GeneratedVideoScript>;
|
|
63
|
+
generateVoiceScript(topic: string, emotion: Emotion, duration: number): Promise<GeneratedVideoScript>;
|
|
64
|
+
generateContentCalendar(niche: string, days: number): Promise<ContentCalendarEntry[]>;
|
|
65
|
+
analyzeSentiment(content: string): Promise<SentimentAnalysisResult>;
|
|
66
|
+
analyzeContent(request: ContentAnalysisRequest): Promise<ContentAnalysisResult>;
|
|
67
|
+
optimizeSEO(request: SEOOptimizationRequest): Promise<SEOOptimizationResult>;
|
|
68
|
+
calculateSEOScore(content: string, keywords: string[]): Promise<SEOScoreBreakdown>;
|
|
69
|
+
analyzeKeywords(content: string, keywords: string[]): Promise<KeywordAnalysis[]>;
|
|
70
|
+
predictABTest(request: ABTestRequest): Promise<ABTestPrediction[]>;
|
|
71
|
+
compareVariants(variantA: string, variantB: string): Promise<ABTestComparison>;
|
|
72
|
+
generateImagePrompt(description: string, style: string): Promise<string>;
|
|
73
|
+
generateImagePromptsForBlog(blogContent: string): Promise<string[]>;
|
|
74
|
+
generateImage(request: ImageGenerationRequest): Promise<GeneratedContent>;
|
|
75
|
+
generateVideo(request: VideoGenerationRequest): Promise<GeneratedContent>;
|
|
76
|
+
convertImageToVideo(request: ImageToVideoRequest): Promise<GeneratedContent>;
|
|
77
|
+
transformVideo(request: VideoToVideoRequest): Promise<GeneratedContent>;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The single LLM seam for the content services. runJson/runText keep the
|
|
82
|
+
* string facade the nine services were built against; runChat passes a full
|
|
83
|
+
* TextRequest through to the factory and returns the usage-complete
|
|
84
|
+
* GenerationResult.
|
|
85
|
+
*/
|
|
86
|
+
declare class GenerationExecutor {
|
|
87
|
+
private readonly generator;
|
|
88
|
+
constructor(generator: ITextGenerator | ProviderFactory);
|
|
89
|
+
runJson<T>(prompt: string, fallback: T, generationOptions?: TextGenerationOptions): Promise<T>;
|
|
90
|
+
runText(prompt: string, options?: TextGenerationOptions): Promise<string>;
|
|
91
|
+
/** Usage-complete pass-through; requires a ProviderFactory engine. */
|
|
92
|
+
runChat(request: TextRequest): Promise<GenerationResult>;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
declare class BlogService {
|
|
96
|
+
private readonly executor;
|
|
97
|
+
constructor(executor: GenerationExecutor);
|
|
98
|
+
generateBlogPost(request: BlogGenerationRequest): Promise<GeneratedBlog>;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
declare class SocialService {
|
|
102
|
+
private readonly executor;
|
|
103
|
+
constructor(executor: GenerationExecutor);
|
|
104
|
+
generateSocialContent(request: SocialContentRequest): Promise<GeneratedSocialContent>;
|
|
105
|
+
generateForAllPlatforms(topic: string, tone: ContentTone): Promise<GeneratedSocialContent[]>;
|
|
106
|
+
generateHashtags(content: string, count: number): Promise<string[]>;
|
|
107
|
+
optimizeHashtags(hashtags: string[], platform: SocialPlatform): string[];
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
declare class VideoScriptService {
|
|
111
|
+
private readonly executor;
|
|
112
|
+
constructor(executor: GenerationExecutor);
|
|
113
|
+
generateVideoScript(request: VideoScriptRequest): Promise<GeneratedVideoScript>;
|
|
114
|
+
generateVoiceScript(topic: string, emotion: Emotion, duration: number): Promise<GeneratedVideoScript>;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
declare class AnalysisService {
|
|
118
|
+
private readonly executor;
|
|
119
|
+
constructor(executor: GenerationExecutor);
|
|
120
|
+
analyzeSentiment(content: string): Promise<SentimentAnalysisResult>;
|
|
121
|
+
analyzeContent(request: ContentAnalysisRequest): Promise<ContentAnalysisResult>;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
declare class SeoService {
|
|
125
|
+
private readonly executor;
|
|
126
|
+
constructor(executor: GenerationExecutor);
|
|
127
|
+
optimizeSEO(request: SEOOptimizationRequest): Promise<SEOOptimizationResult>;
|
|
128
|
+
calculateSEOScore(content: string, keywords: string[]): Promise<SEOScoreBreakdown>;
|
|
129
|
+
analyzeKeywords(content: string, keywords: string[]): KeywordAnalysis[];
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
declare class ABTestService {
|
|
133
|
+
private readonly executor;
|
|
134
|
+
constructor(executor: GenerationExecutor);
|
|
135
|
+
predictABTest(request: ABTestRequest): Promise<ABTestPrediction[]>;
|
|
136
|
+
compareVariants(variantA: string, variantB: string): Promise<ABTestComparison>;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
declare class ImagePromptService {
|
|
140
|
+
private readonly executor;
|
|
141
|
+
constructor(executor: GenerationExecutor);
|
|
142
|
+
generateImagePrompt(description: string, style: string): Promise<string>;
|
|
143
|
+
generateImagePromptsForBlog(blogContent: string): Promise<string[]>;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
declare class ContentCalendarService {
|
|
147
|
+
private readonly executor;
|
|
148
|
+
constructor(executor: GenerationExecutor);
|
|
149
|
+
generateContentCalendar(niche: string, days: number): Promise<ContentCalendarEntry[]>;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
declare class MediaGenerationService {
|
|
153
|
+
private readonly providerFactory;
|
|
154
|
+
constructor(providerFactory: ProviderFactory);
|
|
155
|
+
generateImage(request: ImageGenerationRequest): Promise<GeneratedContent>;
|
|
156
|
+
generateVideo(request: VideoGenerationRequest): Promise<GeneratedContent>;
|
|
157
|
+
convertImageToVideo(request: ImageToVideoRequest): Promise<GeneratedContent>;
|
|
158
|
+
transformVideo(request: VideoToVideoRequest): Promise<GeneratedContent>;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
declare class PromptBuilder {
|
|
162
|
+
static blogPost(input: {
|
|
163
|
+
topic: string;
|
|
164
|
+
blogType: string;
|
|
165
|
+
keywords: string[];
|
|
166
|
+
tone: string;
|
|
167
|
+
targetAudience: string;
|
|
168
|
+
wordCount: number;
|
|
169
|
+
language?: string;
|
|
170
|
+
seoOptimization: boolean;
|
|
171
|
+
includeSchema: boolean;
|
|
172
|
+
includeImages: boolean;
|
|
173
|
+
}): string;
|
|
174
|
+
static socialPost(input: {
|
|
175
|
+
topic: string;
|
|
176
|
+
platform: string;
|
|
177
|
+
tone: string;
|
|
178
|
+
style: string;
|
|
179
|
+
maxLength: number;
|
|
180
|
+
includeHashtags: boolean;
|
|
181
|
+
includeCallToAction: boolean;
|
|
182
|
+
}): string;
|
|
183
|
+
static videoScript(input: {
|
|
184
|
+
topic: string;
|
|
185
|
+
tone: string;
|
|
186
|
+
duration: number;
|
|
187
|
+
targetAudience: string;
|
|
188
|
+
includeVisuals: boolean;
|
|
189
|
+
includeCallToAction: boolean;
|
|
190
|
+
}): string;
|
|
191
|
+
static voiceScript(input: {
|
|
192
|
+
topic: string;
|
|
193
|
+
emotion: string;
|
|
194
|
+
duration: number;
|
|
195
|
+
}): string;
|
|
196
|
+
static contentCalendar(niche: string, days: number): string;
|
|
197
|
+
static sentiment(content: string): string;
|
|
198
|
+
static contentAnalysis(content: string): string;
|
|
199
|
+
static seoOptimization(content: string, keywords: string[]): string;
|
|
200
|
+
static seoScore(content: string, keywords: string[]): string;
|
|
201
|
+
static abTestVariant(input: {
|
|
202
|
+
content: string;
|
|
203
|
+
contentType: string;
|
|
204
|
+
tone: string;
|
|
205
|
+
targetAudience: string;
|
|
206
|
+
platform: string;
|
|
207
|
+
goals: string[];
|
|
208
|
+
}): string;
|
|
209
|
+
static hashtags(content: string, count: number): string;
|
|
210
|
+
static imagePrompt(description: string, style: string): string;
|
|
211
|
+
static blogImagePrompts(blogContent: string): string;
|
|
212
|
+
static maxTokensForDuration(durationSeconds: number): number;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
declare function safeJSONParse<T>(text: string, fallback: T, onError?: (context: string) => void): T;
|
|
216
|
+
declare function extractJSON(text: string): string | null;
|
|
217
|
+
declare function parseAIResponse<T>(response: string, fallback: T, onError?: (context: string) => void): T;
|
|
218
|
+
declare function isValidJSON(text: string): boolean;
|
|
219
|
+
|
|
220
|
+
declare enum RequestPriority {
|
|
221
|
+
LOW = 0,
|
|
222
|
+
NORMAL = 1,
|
|
223
|
+
HIGH = 2,
|
|
224
|
+
URGENT = 3
|
|
225
|
+
}
|
|
226
|
+
interface QueueConfig {
|
|
227
|
+
maxConcurrent: number;
|
|
228
|
+
maxQueueSize: number;
|
|
229
|
+
defaultTimeout: number;
|
|
230
|
+
retryDelay: number;
|
|
231
|
+
enableRateLimit: boolean;
|
|
232
|
+
rateLimitWindow: number;
|
|
233
|
+
rateLimitMaxRequests: number;
|
|
234
|
+
}
|
|
235
|
+
declare class RequestQueue {
|
|
236
|
+
private queue;
|
|
237
|
+
private running;
|
|
238
|
+
private config;
|
|
239
|
+
private requestHistory;
|
|
240
|
+
private isProcessing;
|
|
241
|
+
constructor(config?: Partial<QueueConfig>);
|
|
242
|
+
add<T>(fn: (signal: AbortSignal) => Promise<T>, priority?: RequestPriority, maxRetries?: number): Promise<T>;
|
|
243
|
+
private sortQueue;
|
|
244
|
+
private process;
|
|
245
|
+
private canMakeRequest;
|
|
246
|
+
private executeRequest;
|
|
247
|
+
private withTimeout;
|
|
248
|
+
getStats(): {
|
|
249
|
+
queued: number;
|
|
250
|
+
running: number;
|
|
251
|
+
rateLimitRemaining: number;
|
|
252
|
+
};
|
|
253
|
+
clear(): void;
|
|
254
|
+
drain(): Promise<void>;
|
|
255
|
+
}
|
|
256
|
+
declare function batchRequest<T>(requests: Array<() => Promise<T>>, options?: {
|
|
257
|
+
concurrency?: number;
|
|
258
|
+
stopOnError?: boolean;
|
|
259
|
+
}): Promise<T[]>;
|
|
260
|
+
|
|
261
|
+
export { ABTestService as A, BlogService as B, ContentCalendarService as C, GenerationExecutor as G, type IAIContentService as I, MediaGenerationService as M, PromptBuilder as P, type QueueConfig as Q, RequestPriority as R, SeoService as S, VIDEO_DURATION_OPTIONS as V, AIContentService as a, ASPECT_RATIO_VALUES as b, AnalysisService as c, IMAGE_QUALITY_VALUES as d, ImagePromptService as e, SocialService as f, VIDEO_QUALITY_VALUES as g, VideoScriptService as h, batchRequest as i, extractJSON as j, getDimensionsForAspectRatio as k, getRecommendedQuality as l, isValidJSON as m, RequestQueue as n, resolveDimensionsForAspectRatio as o, parseAIResponse as p, recommendQualityForAspectRatio as r, safeJSONParse as s };
|
package/dist/wizard/index.d.cts
CHANGED
|
@@ -1,86 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
interface WizardStep<T extends string = string> {
|
|
5
|
-
id: T;
|
|
6
|
-
label: string;
|
|
7
|
-
icon?: string;
|
|
8
|
-
description?: string;
|
|
9
|
-
optional?: boolean;
|
|
10
|
-
validate?: (data: Record<string, unknown>) => boolean | {
|
|
11
|
-
valid: boolean;
|
|
12
|
-
errors: Record<string, string>;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
interface ValidationResult {
|
|
16
|
-
valid: boolean;
|
|
17
|
-
errors: Record<string, string>;
|
|
18
|
-
}
|
|
19
|
-
type WizardData = Record<string, unknown>;
|
|
20
|
-
interface WizardConfig<T extends string = string> {
|
|
21
|
-
steps: WizardStep<T>[];
|
|
22
|
-
initialStep?: T;
|
|
23
|
-
data?: WizardData;
|
|
24
|
-
onStepChange?: (from: T, to: T) => void;
|
|
25
|
-
onComplete?: (data: WizardData) => void;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
type ContentType = 'blog' | 'social' | 'script' | 'news' | 'ebook' | 'podcast';
|
|
29
|
-
type ContentWizardStep = 'select-type' | 'input-topic' | 'configure' | 'advanced' | 'preview' | 'generating' | 'results';
|
|
30
|
-
interface ContentWizardData {
|
|
31
|
-
contentType?: ContentType;
|
|
32
|
-
topic?: string;
|
|
33
|
-
description?: string;
|
|
34
|
-
tone?: 'professional' | 'casual' | 'enthusiastic' | 'humorous' | 'dramatic' | 'educational';
|
|
35
|
-
platform?: 'twitter' | 'linkedin' | 'instagram' | 'threads' | 'tiktok' | 'facebook';
|
|
36
|
-
targetAudience?: string;
|
|
37
|
-
wordCount?: number;
|
|
38
|
-
duration?: number;
|
|
39
|
-
keywords?: string[];
|
|
40
|
-
includeImages?: boolean;
|
|
41
|
-
includeCallToAction?: boolean;
|
|
42
|
-
seoOptimization?: boolean;
|
|
43
|
-
language?: string;
|
|
44
|
-
generatedContent?: string;
|
|
45
|
-
generatedId?: string;
|
|
46
|
-
}
|
|
47
|
-
declare const CONTENT_WIZARD_STEPS: ReadonlyArray<WizardStep<ContentWizardStep>>;
|
|
48
|
-
declare function buildContentRequest(data: ContentWizardData): BlogGenerationRequest | SocialContentRequest | VideoScriptRequest;
|
|
49
|
-
|
|
50
|
-
type ImageWizardStep = 'input-prompt' | 'select-style' | 'configure' | 'advanced' | 'preview' | 'generating' | 'results';
|
|
51
|
-
interface ImageWizardData {
|
|
52
|
-
prompt?: string;
|
|
53
|
-
style?: 'realistic' | 'cartoon' | 'abstract' | 'minimalist' | 'vintage';
|
|
54
|
-
format?: 'square' | 'landscape' | 'portrait' | 'story' | 'banner';
|
|
55
|
-
quality?: 'standard' | 'high' | 'ultra';
|
|
56
|
-
quantity?: number;
|
|
57
|
-
colorPalette?: string[];
|
|
58
|
-
platform?: 'instagram' | 'youtube' | 'facebook' | 'twitter' | 'general';
|
|
59
|
-
generatedImageUrl?: string;
|
|
60
|
-
generatedId?: string;
|
|
61
|
-
}
|
|
62
|
-
declare const IMAGE_WIZARD_STEPS: ReadonlyArray<WizardStep<ImageWizardStep>>;
|
|
63
|
-
declare function buildImageRequest(data: ImageWizardData): ImageGenerationRequest;
|
|
64
|
-
|
|
65
|
-
type VideoGenerationType = 'text-to-video' | 'image-to-video' | 'video-to-video';
|
|
66
|
-
type VideoWizardStep = 'select-type' | 'input-source' | 'configure' | 'advanced' | 'preview' | 'generating' | 'results';
|
|
67
|
-
interface VideoWizardData {
|
|
68
|
-
generationType?: VideoGenerationType;
|
|
69
|
-
prompt?: string;
|
|
70
|
-
imageUrl?: string;
|
|
71
|
-
sourceVideoUrl?: string;
|
|
72
|
-
duration?: number;
|
|
73
|
-
aspectRatio?: '16:9' | '9:16' | '1:1';
|
|
74
|
-
style?: 'realistic' | 'animated' | 'cinematic' | 'documentary';
|
|
75
|
-
quality?: 'standard' | 'high' | 'ultra';
|
|
76
|
-
motion?: 'slow' | 'medium' | 'fast';
|
|
77
|
-
camera?: 'static' | 'pan' | 'zoom' | 'tracking';
|
|
78
|
-
styleTransfer?: 'cinematic' | 'anime' | 'cartoon' | 'vintage';
|
|
79
|
-
enhanceQuality?: boolean;
|
|
80
|
-
generatedVideoUrl?: string;
|
|
81
|
-
generatedId?: string;
|
|
82
|
-
}
|
|
83
|
-
declare const VIDEO_WIZARD_STEPS: ReadonlyArray<WizardStep<VideoWizardStep>>;
|
|
84
|
-
declare function buildVideoRequest(data: VideoWizardData): VideoGenerationRequest | ImageToVideoRequest | VideoToVideoRequest;
|
|
85
|
-
|
|
86
|
-
export { CONTENT_WIZARD_STEPS, type ContentType, type ContentWizardData, type ContentWizardStep, IMAGE_WIZARD_STEPS, type ImageWizardData, type ImageWizardStep, VIDEO_WIZARD_STEPS, type ValidationResult, type VideoGenerationType, type VideoWizardData, type VideoWizardStep, type WizardConfig, type WizardData, type WizardStep, buildContentRequest, buildImageRequest, buildVideoRequest };
|
|
1
|
+
export { C as CONTENT_WIZARD_STEPS, g as ContentType, e as ContentWizardData, f as ContentWizardStep, I as IMAGE_WIZARD_STEPS, j as ImageWizardData, k as ImageWizardStep, V as VIDEO_WIZARD_STEPS, o as ValidationResult, p as VideoGenerationType, r as VideoWizardData, s as VideoWizardStep, W as WizardConfig, t as WizardData, u as WizardStep, v as buildContentRequest, w as buildImageRequest, x as buildVideoRequest } from '../index-BulSkB2L.cjs';
|
|
2
|
+
import '../ProviderConfig-DIFa9nmG.cjs';
|