@mux/ai 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/index.cjs +1773 -0
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.d.cts +164 -0
  4. package/dist/index.d.ts +164 -9
  5. package/dist/index.js +1757 -8
  6. package/dist/index.js.map +1 -1
  7. package/package.json +8 -6
  8. package/dist/audio-translation.d.ts +0 -21
  9. package/dist/audio-translation.d.ts.map +0 -1
  10. package/dist/audio-translation.js +0 -229
  11. package/dist/audio-translation.js.map +0 -1
  12. package/dist/burned-in-captions.d.ts +0 -19
  13. package/dist/burned-in-captions.d.ts.map +0 -1
  14. package/dist/burned-in-captions.js +0 -243
  15. package/dist/burned-in-captions.js.map +0 -1
  16. package/dist/chapters.d.ts +0 -18
  17. package/dist/chapters.d.ts.map +0 -1
  18. package/dist/chapters.js +0 -255
  19. package/dist/chapters.js.map +0 -1
  20. package/dist/index.d.ts.map +0 -1
  21. package/dist/moderation.d.ts +0 -39
  22. package/dist/moderation.d.ts.map +0 -1
  23. package/dist/moderation.js +0 -341
  24. package/dist/moderation.js.map +0 -1
  25. package/dist/summarization.d.ts +0 -26
  26. package/dist/summarization.d.ts.map +0 -1
  27. package/dist/summarization.js +0 -337
  28. package/dist/summarization.js.map +0 -1
  29. package/dist/translation.d.ts +0 -22
  30. package/dist/translation.d.ts.map +0 -1
  31. package/dist/translation.js +0 -196
  32. package/dist/translation.js.map +0 -1
  33. package/dist/types.d.ts +0 -12
  34. package/dist/types.d.ts.map +0 -1
  35. package/dist/types.js +0 -2
  36. package/dist/types.js.map +0 -1
  37. package/dist/utils/image-download.d.ts +0 -65
  38. package/dist/utils/image-download.d.ts.map +0 -1
  39. package/dist/utils/image-download.js +0 -150
  40. package/dist/utils/image-download.js.map +0 -1
  41. package/dist/utils/storyboard-processor.d.ts +0 -40
  42. package/dist/utils/storyboard-processor.d.ts.map +0 -1
  43. package/dist/utils/storyboard-processor.js +0 -202
  44. package/dist/utils/storyboard-processor.js.map +0 -1
  45. package/dist/utils/vtt-parser.d.ts +0 -8
  46. package/dist/utils/vtt-parser.d.ts.map +0 -1
  47. package/dist/utils/vtt-parser.js +0 -43
  48. package/dist/utils/vtt-parser.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,9 +1,164 @@
1
- export * from './types';
2
- export * from './moderation';
3
- export * from './summarization';
4
- export * from './translation';
5
- export * from './audio-translation';
6
- export * from './chapters';
7
- export * from './burned-in-captions';
8
- export declare const version = "0.1.0";
9
- //# sourceMappingURL=index.d.ts.map
1
+ interface MuxAIConfig {
2
+ muxTokenId?: string;
3
+ muxTokenSecret?: string;
4
+ openaiApiKey?: string;
5
+ anthropicApiKey?: string;
6
+ baseUrl?: string;
7
+ }
8
+ interface MuxAIOptions extends MuxAIConfig {
9
+ timeout?: number;
10
+ }
11
+ type ToneType = 'normal' | 'sassy' | 'professional';
12
+
13
+ interface ImageDownloadOptions {
14
+ /** Request timeout in milliseconds (default: 10000) */
15
+ timeout?: number;
16
+ /** Maximum number of retry attempts (default: 3) */
17
+ retries?: number;
18
+ /** Base delay between retries in milliseconds (default: 1000) */
19
+ retryDelay?: number;
20
+ /** Maximum delay between retries in milliseconds (default: 10000) */
21
+ maxRetryDelay?: number;
22
+ /** Whether to use exponential backoff (default: true) */
23
+ exponentialBackoff?: boolean;
24
+ }
25
+
26
+ interface ThumbnailModerationScore {
27
+ url: string;
28
+ sexual: number;
29
+ violence: number;
30
+ error: boolean;
31
+ }
32
+ interface ModerationResult {
33
+ assetId: string;
34
+ thumbnailScores: ThumbnailModerationScore[];
35
+ maxScores: {
36
+ sexual: number;
37
+ violence: number;
38
+ };
39
+ exceedsThreshold: boolean;
40
+ thresholds: {
41
+ sexual: number;
42
+ violence: number;
43
+ };
44
+ }
45
+ interface ModerationOptions extends MuxAIOptions {
46
+ provider?: 'openai' | 'hive';
47
+ model?: string;
48
+ thresholds?: {
49
+ sexual?: number;
50
+ violence?: number;
51
+ };
52
+ thumbnailInterval?: number;
53
+ thumbnailWidth?: number;
54
+ maxConcurrent?: number;
55
+ /** Method for submitting images to AI providers (default: 'url') */
56
+ imageSubmissionMode?: 'url' | 'base64';
57
+ /** Options for image download when using base64 submission mode */
58
+ imageDownloadOptions?: ImageDownloadOptions;
59
+ hiveApiKey?: string;
60
+ }
61
+ declare function getModerationScores(assetId: string, options?: ModerationOptions): Promise<ModerationResult>;
62
+
63
+ interface SummaryAndTagsResult {
64
+ assetId: string;
65
+ title: string;
66
+ description: string;
67
+ tags: string[];
68
+ storyboardUrl?: string;
69
+ }
70
+ interface SummarizationOptions extends MuxAIOptions {
71
+ provider?: 'openai' | 'anthropic';
72
+ model?: string;
73
+ maxSummaryLength?: number;
74
+ maxTags?: number;
75
+ customPrompt?: string;
76
+ tone?: ToneType;
77
+ includeTranscript?: boolean;
78
+ /** Whether to clean VTT timestamps and formatting from transcript (default: true) */
79
+ cleanTranscript?: boolean;
80
+ /** Method for submitting storyboard to AI providers (default: 'url') */
81
+ imageSubmissionMode?: 'url' | 'base64';
82
+ /** Options for image download when using base64 submission mode */
83
+ imageDownloadOptions?: ImageDownloadOptions;
84
+ }
85
+ declare function getSummaryAndTags(assetId: string, promptOrOptions?: string | SummarizationOptions, options?: SummarizationOptions): Promise<SummaryAndTagsResult>;
86
+
87
+ interface TranslationResult {
88
+ assetId: string;
89
+ sourceLanguageCode: string;
90
+ targetLanguageCode: string;
91
+ originalVtt: string;
92
+ translatedVtt: string;
93
+ uploadedTrackId?: string;
94
+ presignedUrl?: string;
95
+ }
96
+ interface TranslationOptions extends MuxAIOptions {
97
+ provider?: 'anthropic';
98
+ model?: string;
99
+ s3Endpoint?: string;
100
+ s3Region?: string;
101
+ s3Bucket?: string;
102
+ s3AccessKeyId?: string;
103
+ s3SecretAccessKey?: string;
104
+ uploadToMux?: boolean;
105
+ }
106
+ declare function translateCaptions(assetId: string, fromLanguageCode: string, toLanguageCode: string, options?: TranslationOptions): Promise<TranslationResult>;
107
+
108
+ interface AudioTranslationResult {
109
+ assetId: string;
110
+ targetLanguageCode: string;
111
+ dubbingId: string;
112
+ uploadedTrackId?: string;
113
+ presignedUrl?: string;
114
+ }
115
+ interface AudioTranslationOptions extends MuxAIOptions {
116
+ provider?: 'elevenlabs';
117
+ numSpeakers?: number;
118
+ s3Endpoint?: string;
119
+ s3Region?: string;
120
+ s3Bucket?: string;
121
+ s3AccessKeyId?: string;
122
+ s3SecretAccessKey?: string;
123
+ uploadToMux?: boolean;
124
+ elevenLabsApiKey?: string;
125
+ }
126
+ declare function translateAudio(assetId: string, toLanguageCode: string, options?: AudioTranslationOptions): Promise<AudioTranslationResult>;
127
+
128
+ interface Chapter {
129
+ /** Start time in seconds */
130
+ startTime: number;
131
+ /** Chapter title */
132
+ title: string;
133
+ }
134
+ interface ChaptersResult {
135
+ assetId: string;
136
+ languageCode: string;
137
+ chapters: Chapter[];
138
+ }
139
+ interface ChaptersOptions extends MuxAIOptions {
140
+ provider?: 'openai' | 'anthropic';
141
+ model?: string;
142
+ }
143
+ declare function generateChapters(assetId: string, languageCode: string, options?: ChaptersOptions): Promise<ChaptersResult>;
144
+
145
+ interface BurnedInCaptionsResult {
146
+ assetId: string;
147
+ hasBurnedInCaptions: boolean;
148
+ confidence: number;
149
+ detectedLanguage: string | null;
150
+ storyboardUrl?: string;
151
+ }
152
+ interface BurnedInCaptionsOptions extends MuxAIOptions {
153
+ provider?: 'openai' | 'anthropic';
154
+ model?: string;
155
+ /** Method for submitting storyboard to AI providers (default: 'url') */
156
+ imageSubmissionMode?: 'url' | 'base64';
157
+ /** Options for image download when using base64 submission mode */
158
+ imageDownloadOptions?: ImageDownloadOptions;
159
+ }
160
+ declare function hasBurnedInCaptions(assetId: string, options?: BurnedInCaptionsOptions): Promise<BurnedInCaptionsResult>;
161
+
162
+ declare const version = "0.1.0";
163
+
164
+ export { type AudioTranslationOptions, type AudioTranslationResult, type BurnedInCaptionsOptions, type BurnedInCaptionsResult, type Chapter, type ChaptersOptions, type ChaptersResult, type ModerationOptions, type ModerationResult, type MuxAIConfig, type MuxAIOptions, type SummarizationOptions, type SummaryAndTagsResult, type ThumbnailModerationScore, type ToneType, type TranslationOptions, type TranslationResult, generateChapters, getModerationScores, getSummaryAndTags, hasBurnedInCaptions, translateAudio, translateCaptions, version };