mulmocast 1.1.5 → 1.1.7
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/lib/actions/audio.js +10 -1
- package/lib/actions/image_agents.d.ts +3 -12
- package/lib/actions/image_agents.js +12 -8
- package/lib/actions/images.js +2 -1
- package/lib/actions/translate.d.ts +51 -2
- package/lib/actions/translate.js +193 -148
- package/lib/agents/combine_audio_files_agent.js +1 -1
- package/lib/agents/lipsync_replicate_agent.js +10 -3
- package/lib/agents/tts_nijivoice_agent.js +1 -1
- package/lib/cli/commands/audio/handler.js +1 -1
- package/lib/cli/commands/image/handler.js +1 -1
- package/lib/cli/commands/movie/handler.js +1 -1
- package/lib/cli/commands/pdf/handler.js +1 -1
- package/lib/cli/helpers.d.ts +1 -4
- package/lib/cli/helpers.js +3 -2
- package/lib/index.common.d.ts +1 -0
- package/lib/index.common.js +1 -0
- package/lib/mcp/server.js +1 -1
- package/lib/methods/mulmo_presentation_style.d.ts +3 -2
- package/lib/methods/mulmo_script.d.ts +4 -1
- package/lib/methods/mulmo_script.js +18 -2
- package/lib/methods/mulmo_studio_context.d.ts +1 -0
- package/lib/methods/mulmo_studio_context.js +8 -0
- package/lib/types/agent.d.ts +1 -0
- package/lib/types/schema.d.ts +326 -230
- package/lib/types/schema.js +10 -3
- package/lib/types/type.d.ts +3 -2
- package/lib/utils/const.d.ts +1 -0
- package/lib/utils/const.js +2 -1
- package/lib/utils/context.d.ts +393 -50
- package/lib/utils/context.js +90 -57
- package/lib/utils/filters.d.ts +1 -0
- package/lib/utils/filters.js +8 -0
- package/lib/utils/image_plugins/mermaid.js +1 -1
- package/lib/utils/image_plugins/source.js +1 -1
- package/lib/utils/preprocess.d.ts +2 -2
- package/lib/utils/preprocess.js +3 -3
- package/lib/utils/provider2agent.d.ts +3 -2
- package/lib/utils/provider2agent.js +20 -2
- package/lib/utils/string.d.ts +1 -1
- package/lib/utils/string.js +12 -8
- package/lib/utils/utils.js +2 -6
- package/package.json +2 -2
- package/scripts/templates/image_refs.json +1 -0
- package/scripts/templates/voice_over.json +1 -0
- package/scripts/test/gpt.json +1 -0
- package/scripts/test/test1.json +1 -0
- package/scripts/test/test_audio.json +1 -0
- package/scripts/test/test_audio_instructions.json +1 -0
- package/scripts/test/test_beats.json +1 -0
- package/scripts/test/test_captions.json +1 -0
- package/scripts/test/test_elevenlabs_models.json +1 -0
- package/scripts/test/test_hello.json +1 -0
- package/scripts/test/test_hello_google.json +1 -0
- package/scripts/test/test_html.json +1 -0
- package/scripts/test/test_image_refs.json +1 -0
- package/scripts/test/test_images.json +1 -0
- package/scripts/test/test_lang.json +58 -2
- package/scripts/test/test_layout.json +1 -0
- package/scripts/test/test_lipsync.json +9 -0
- package/scripts/test/test_loop.json +1 -0
- package/scripts/test/test_media.json +1 -0
- package/scripts/test/test_mixed_providers.json +1 -0
- package/scripts/test/test_movie.json +1 -0
- package/scripts/test/test_no_audio.json +1 -0
- package/scripts/test/test_no_audio_with_credit.json +1 -0
- package/scripts/test/test_order.json +1 -0
- package/scripts/test/test_order_portrait.json +1 -0
- package/scripts/test/test_replicate.json +19 -0
- package/scripts/test/test_slideout_left_no_audio.json +1 -0
- package/scripts/test/test_spillover.json +1 -0
- package/scripts/test/test_transition.json +1 -0
- package/scripts/test/test_transition_no_audio.json +1 -0
- package/scripts/test/test_video_speed.json +1 -0
- package/scripts/test/test_voice_over.json +1 -0
- package/scripts/test/test_voices.json +1 -0
- package/scripts/templates/image_prompt_only_template.ts +0 -95
package/lib/types/schema.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { htmlLLMProvider, provider2TTSAgent, provider2ImageAgent, provider2MovieAgent, defaultProviders, provider2SoundEffectAgent, } from "../utils/provider2agent.js";
|
|
3
|
+
import { currentMulmoScriptVersion } from "../utils/const.js";
|
|
3
4
|
export const langSchema = z.string();
|
|
4
5
|
const URLStringSchema = z.string().url();
|
|
5
6
|
export const localizedTextSchema = z
|
|
@@ -8,7 +9,8 @@ export const localizedTextSchema = z
|
|
|
8
9
|
lang: langSchema,
|
|
9
10
|
// caption: z.string(),
|
|
10
11
|
texts: z.array(z.string()).optional(),
|
|
11
|
-
ttsTexts: z.array(z.string()).optional(),
|
|
12
|
+
ttsTexts: z.array(z.string()).optional(), // TODO remove
|
|
13
|
+
cacheKey: z.string(),
|
|
12
14
|
duration: z.number().optional(), // generated // video duration time(ms)
|
|
13
15
|
// filename: z.string().optional(), // generated //
|
|
14
16
|
})
|
|
@@ -283,7 +285,7 @@ export const mulmoCanvasDimensionSchema = z
|
|
|
283
285
|
// export const voiceMapSchema = z.record(speakerIdSchema, z.string())
|
|
284
286
|
export const mulmoCastCreditSchema = z
|
|
285
287
|
.object({
|
|
286
|
-
version: z.literal(
|
|
288
|
+
version: z.literal(currentMulmoScriptVersion),
|
|
287
289
|
credit: z.literal("closing").optional(),
|
|
288
290
|
})
|
|
289
291
|
.strict();
|
|
@@ -371,7 +373,7 @@ export const mulmoScriptSchema = mulmoPresentationStyleSchema
|
|
|
371
373
|
title: z.string().optional(),
|
|
372
374
|
description: z.string().optional(),
|
|
373
375
|
references: z.array(mulmoReferenceSchema).optional(),
|
|
374
|
-
lang: langSchema
|
|
376
|
+
lang: langSchema, // required (default WAS "en")
|
|
375
377
|
beats: z.array(mulmoBeatSchema).min(1),
|
|
376
378
|
// TODO: Delete it later
|
|
377
379
|
imagePath: z.string().optional(), // for keynote images movie ??
|
|
@@ -398,8 +400,13 @@ export const mulmoStudioBeatSchema = z
|
|
|
398
400
|
.strict();
|
|
399
401
|
export const mulmoStudioMultiLingualDataSchema = z.object({
|
|
400
402
|
multiLingualTexts: multiLingualTextsSchema,
|
|
403
|
+
cacheKey: z.string().optional(),
|
|
401
404
|
});
|
|
402
405
|
export const mulmoStudioMultiLingualSchema = z.array(mulmoStudioMultiLingualDataSchema).min(1);
|
|
406
|
+
export const mulmoStudioMultiLingualFileSchema = z.object({
|
|
407
|
+
version: z.literal(currentMulmoScriptVersion),
|
|
408
|
+
multiLingual: mulmoStudioMultiLingualSchema,
|
|
409
|
+
});
|
|
403
410
|
export const mulmoSessionStateSchema = z.object({
|
|
404
411
|
inSession: z.object({
|
|
405
412
|
audio: z.boolean(),
|
package/lib/types/type.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { langSchema, localizedTextSchema, mulmoBeatSchema, mulmoScriptSchema, mulmoStudioSchema, mulmoStudioBeatSchema, mulmoStoryboardSchema, mulmoStoryboardSceneSchema, mulmoStudioMultiLingualSchema, mulmoStudioMultiLingualDataSchema, speakerDictionarySchema, mulmoImageParamsSchema, mulmoImageParamsImagesSchema, mulmoFillOptionSchema, mulmoMovieParamsSchema, textSlideParamsSchema, speechOptionsSchema, speakerDataSchema, mulmoCanvasDimensionSchema, mulmoPromptTemplateSchema, mulmoPromptTemplateFileSchema, text2ImageProviderSchema, text2HtmlImageProviderSchema, text2MovieProviderSchema, text2SpeechProviderSchema, mulmoPresentationStyleSchema, multiLingualTextsSchema, mulmoImageAssetSchema, mulmoMermaidMediaSchema, mulmoTextSlideMediaSchema, mulmoMarkdownMediaSchema, mulmoImageMediaSchema, mulmoChartMediaSchema, mediaSourceSchema, mulmoSessionStateSchema, mulmoOpenAIImageModelSchema, mulmoGoogleImageModelSchema, mulmoGoogleMovieModelSchema, mulmoReplicateMovieModelSchema, mulmoImagePromptMediaSchema } from "./schema.js";
|
|
1
|
+
import { langSchema, localizedTextSchema, mulmoBeatSchema, mulmoScriptSchema, mulmoStudioSchema, mulmoStudioBeatSchema, mulmoStoryboardSchema, mulmoStoryboardSceneSchema, mulmoStudioMultiLingualSchema, mulmoStudioMultiLingualDataSchema, mulmoStudioMultiLingualFileSchema, speakerDictionarySchema, mulmoImageParamsSchema, mulmoImageParamsImagesSchema, mulmoFillOptionSchema, mulmoMovieParamsSchema, textSlideParamsSchema, speechOptionsSchema, speakerDataSchema, mulmoCanvasDimensionSchema, mulmoPromptTemplateSchema, mulmoPromptTemplateFileSchema, text2ImageProviderSchema, text2HtmlImageProviderSchema, text2MovieProviderSchema, text2SpeechProviderSchema, mulmoPresentationStyleSchema, multiLingualTextsSchema, mulmoImageAssetSchema, mulmoMermaidMediaSchema, mulmoTextSlideMediaSchema, mulmoMarkdownMediaSchema, mulmoImageMediaSchema, mulmoChartMediaSchema, mediaSourceSchema, mulmoSessionStateSchema, mulmoOpenAIImageModelSchema, mulmoGoogleImageModelSchema, mulmoGoogleMovieModelSchema, mulmoReplicateMovieModelSchema, mulmoImagePromptMediaSchema } from "./schema.js";
|
|
2
2
|
import { pdf_modes, pdf_sizes, storyToScriptGenerateMode } from "../utils/const.js";
|
|
3
3
|
import type { LLM } from "../utils/provider2agent.js";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -28,6 +28,7 @@ export type MulmoPromptTemplate = z.infer<typeof mulmoPromptTemplateSchema>;
|
|
|
28
28
|
export type MulmoPromptTemplateFile = z.infer<typeof mulmoPromptTemplateFileSchema>;
|
|
29
29
|
export type MulmoStudioMultiLingual = z.infer<typeof mulmoStudioMultiLingualSchema>;
|
|
30
30
|
export type MulmoStudioMultiLingualData = z.infer<typeof mulmoStudioMultiLingualDataSchema>;
|
|
31
|
+
export type MulmoStudioMultiLingualFile = z.infer<typeof mulmoStudioMultiLingualFileSchema>;
|
|
31
32
|
export type MultiLingualTexts = z.infer<typeof multiLingualTextsSchema>;
|
|
32
33
|
export type MulmoMovieParams = z.infer<typeof mulmoMovieParamsSchema>;
|
|
33
34
|
export type MulmoOpenAIImageModel = z.infer<typeof mulmoOpenAIImageModelSchema>;
|
|
@@ -53,7 +54,7 @@ export type FileDirs = {
|
|
|
53
54
|
export type MulmoStudioContext = {
|
|
54
55
|
fileDirs: FileDirs;
|
|
55
56
|
studio: MulmoStudio;
|
|
56
|
-
lang
|
|
57
|
+
lang: string;
|
|
57
58
|
force: boolean;
|
|
58
59
|
sessionState: MulmoSessionState;
|
|
59
60
|
presentationStyle: MulmoPresentationStyle;
|
package/lib/utils/const.d.ts
CHANGED
package/lib/utils/const.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
export const currentMulmoScriptVersion = "1.1";
|
|
1
2
|
export const outDirName = "output";
|
|
2
3
|
export const audioDirName = "audio";
|
|
3
4
|
export const imageDirName = "images";
|
|
4
5
|
export const cacheDirName = "cache";
|
|
5
6
|
export const pdf_modes = ["slide", "talk", "handout"];
|
|
6
7
|
export const pdf_sizes = ["letter", "a4"];
|
|
7
|
-
export const languages = ["en", "ja"];
|
|
8
|
+
export const languages = ["en", "ja", "fr", "es"];
|
|
8
9
|
export const storyToScriptGenerateMode = {
|
|
9
10
|
stepWise: "step_wise",
|
|
10
11
|
oneStep: "one_step",
|
package/lib/utils/context.d.ts
CHANGED
|
@@ -1,9 +1,350 @@
|
|
|
1
|
-
import type { MulmoScript, MulmoPresentationStyle, MulmoStudioMultiLingual } from "../types/type.js";
|
|
2
|
-
|
|
1
|
+
import type { MulmoScript, MulmoPresentationStyle, MulmoStudioMultiLingual, FileObject } from "../types/type.js";
|
|
2
|
+
export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: string, videoCaptionLang?: string, presentationStyle?: MulmoPresentationStyle | null) => {
|
|
3
|
+
beats: {
|
|
4
|
+
duration?: number | undefined;
|
|
5
|
+
startAt?: number | undefined;
|
|
6
|
+
hash?: string | undefined;
|
|
7
|
+
audioDuration?: number | undefined;
|
|
8
|
+
movieDuration?: number | undefined;
|
|
9
|
+
silenceDuration?: number | undefined;
|
|
10
|
+
hasMovieAudio?: boolean | undefined;
|
|
11
|
+
audioFile?: string | undefined;
|
|
12
|
+
imageFile?: string | undefined;
|
|
13
|
+
movieFile?: string | undefined;
|
|
14
|
+
soundEffectFile?: string | undefined;
|
|
15
|
+
lipSyncFile?: string | undefined;
|
|
16
|
+
captionFile?: string | undefined;
|
|
17
|
+
}[];
|
|
18
|
+
script: {
|
|
19
|
+
lang: string;
|
|
20
|
+
imageParams: {
|
|
21
|
+
provider: string;
|
|
22
|
+
images?: Record<string, {
|
|
23
|
+
type: "image";
|
|
24
|
+
source: {
|
|
25
|
+
url: string;
|
|
26
|
+
kind: "url";
|
|
27
|
+
} | {
|
|
28
|
+
kind: "base64";
|
|
29
|
+
data: string;
|
|
30
|
+
} | {
|
|
31
|
+
text: string;
|
|
32
|
+
kind: "text";
|
|
33
|
+
} | {
|
|
34
|
+
path: string;
|
|
35
|
+
kind: "path";
|
|
36
|
+
};
|
|
37
|
+
} | {
|
|
38
|
+
type: "imagePrompt";
|
|
39
|
+
prompt: string;
|
|
40
|
+
}> | undefined;
|
|
41
|
+
model?: string | undefined;
|
|
42
|
+
style?: string | undefined;
|
|
43
|
+
quality?: string | undefined;
|
|
44
|
+
moderation?: string | undefined;
|
|
45
|
+
};
|
|
46
|
+
audioParams: {
|
|
47
|
+
padding: number;
|
|
48
|
+
introPadding: number;
|
|
49
|
+
closingPadding: number;
|
|
50
|
+
outroPadding: number;
|
|
51
|
+
bgmVolume: number;
|
|
52
|
+
audioVolume: number;
|
|
53
|
+
suppressSpeech: boolean;
|
|
54
|
+
bgm?: {
|
|
55
|
+
url: string;
|
|
56
|
+
kind: "url";
|
|
57
|
+
} | {
|
|
58
|
+
kind: "base64";
|
|
59
|
+
data: string;
|
|
60
|
+
} | {
|
|
61
|
+
text: string;
|
|
62
|
+
kind: "text";
|
|
63
|
+
} | {
|
|
64
|
+
path: string;
|
|
65
|
+
kind: "path";
|
|
66
|
+
} | undefined;
|
|
67
|
+
};
|
|
68
|
+
movieParams: {
|
|
69
|
+
provider?: string | undefined;
|
|
70
|
+
model?: string | undefined;
|
|
71
|
+
fillOption?: {
|
|
72
|
+
style: "aspectFit" | "aspectFill";
|
|
73
|
+
} | undefined;
|
|
74
|
+
transition?: {
|
|
75
|
+
type: "fade" | "slideout_left";
|
|
76
|
+
duration: number;
|
|
77
|
+
} | undefined;
|
|
78
|
+
};
|
|
79
|
+
soundEffectParams: {
|
|
80
|
+
provider?: string | undefined;
|
|
81
|
+
model?: string | undefined;
|
|
82
|
+
};
|
|
83
|
+
$mulmocast: {
|
|
84
|
+
version: "1.1";
|
|
85
|
+
credit?: "closing" | undefined;
|
|
86
|
+
};
|
|
87
|
+
canvasSize: {
|
|
88
|
+
width: number;
|
|
89
|
+
height: number;
|
|
90
|
+
};
|
|
91
|
+
speechParams: {
|
|
92
|
+
speakers: Record<string, {
|
|
93
|
+
voiceId: string;
|
|
94
|
+
lang?: Record<string, {
|
|
95
|
+
voiceId: string;
|
|
96
|
+
displayName?: Record<string, string> | undefined;
|
|
97
|
+
isDefault?: boolean | undefined;
|
|
98
|
+
speechOptions?: {
|
|
99
|
+
speed?: number | undefined;
|
|
100
|
+
instruction?: string | undefined;
|
|
101
|
+
} | undefined;
|
|
102
|
+
provider?: string | undefined;
|
|
103
|
+
model?: string | undefined;
|
|
104
|
+
}> | undefined;
|
|
105
|
+
displayName?: Record<string, string> | undefined;
|
|
106
|
+
isDefault?: boolean | undefined;
|
|
107
|
+
speechOptions?: {
|
|
108
|
+
speed?: number | undefined;
|
|
109
|
+
instruction?: string | undefined;
|
|
110
|
+
} | undefined;
|
|
111
|
+
provider?: string | undefined;
|
|
112
|
+
model?: string | undefined;
|
|
113
|
+
}>;
|
|
114
|
+
};
|
|
115
|
+
beats: {
|
|
116
|
+
text: string;
|
|
117
|
+
image?: {
|
|
118
|
+
type: "markdown";
|
|
119
|
+
markdown: string | string[];
|
|
120
|
+
} | {
|
|
121
|
+
type: "web";
|
|
122
|
+
url: string;
|
|
123
|
+
} | {
|
|
124
|
+
type: "pdf";
|
|
125
|
+
source: {
|
|
126
|
+
url: string;
|
|
127
|
+
kind: "url";
|
|
128
|
+
} | {
|
|
129
|
+
kind: "base64";
|
|
130
|
+
data: string;
|
|
131
|
+
} | {
|
|
132
|
+
text: string;
|
|
133
|
+
kind: "text";
|
|
134
|
+
} | {
|
|
135
|
+
path: string;
|
|
136
|
+
kind: "path";
|
|
137
|
+
};
|
|
138
|
+
} | {
|
|
139
|
+
type: "image";
|
|
140
|
+
source: {
|
|
141
|
+
url: string;
|
|
142
|
+
kind: "url";
|
|
143
|
+
} | {
|
|
144
|
+
kind: "base64";
|
|
145
|
+
data: string;
|
|
146
|
+
} | {
|
|
147
|
+
text: string;
|
|
148
|
+
kind: "text";
|
|
149
|
+
} | {
|
|
150
|
+
path: string;
|
|
151
|
+
kind: "path";
|
|
152
|
+
};
|
|
153
|
+
} | {
|
|
154
|
+
type: "svg";
|
|
155
|
+
source: {
|
|
156
|
+
url: string;
|
|
157
|
+
kind: "url";
|
|
158
|
+
} | {
|
|
159
|
+
kind: "base64";
|
|
160
|
+
data: string;
|
|
161
|
+
} | {
|
|
162
|
+
text: string;
|
|
163
|
+
kind: "text";
|
|
164
|
+
} | {
|
|
165
|
+
path: string;
|
|
166
|
+
kind: "path";
|
|
167
|
+
};
|
|
168
|
+
} | {
|
|
169
|
+
type: "movie";
|
|
170
|
+
source: {
|
|
171
|
+
url: string;
|
|
172
|
+
kind: "url";
|
|
173
|
+
} | {
|
|
174
|
+
kind: "base64";
|
|
175
|
+
data: string;
|
|
176
|
+
} | {
|
|
177
|
+
text: string;
|
|
178
|
+
kind: "text";
|
|
179
|
+
} | {
|
|
180
|
+
path: string;
|
|
181
|
+
kind: "path";
|
|
182
|
+
};
|
|
183
|
+
} | {
|
|
184
|
+
slide: {
|
|
185
|
+
title: string;
|
|
186
|
+
subtitle?: string | undefined;
|
|
187
|
+
bullets?: string[] | undefined;
|
|
188
|
+
};
|
|
189
|
+
type: "textSlide";
|
|
190
|
+
} | {
|
|
191
|
+
type: "chart";
|
|
192
|
+
title: string;
|
|
193
|
+
chartData: Record<string, any>;
|
|
194
|
+
} | {
|
|
195
|
+
code: {
|
|
196
|
+
url: string;
|
|
197
|
+
kind: "url";
|
|
198
|
+
} | {
|
|
199
|
+
kind: "base64";
|
|
200
|
+
data: string;
|
|
201
|
+
} | {
|
|
202
|
+
text: string;
|
|
203
|
+
kind: "text";
|
|
204
|
+
} | {
|
|
205
|
+
path: string;
|
|
206
|
+
kind: "path";
|
|
207
|
+
};
|
|
208
|
+
type: "mermaid";
|
|
209
|
+
title: string;
|
|
210
|
+
appendix?: string[] | undefined;
|
|
211
|
+
} | {
|
|
212
|
+
type: "html_tailwind";
|
|
213
|
+
html: string | string[];
|
|
214
|
+
} | {
|
|
215
|
+
type: "beat";
|
|
216
|
+
id?: string | undefined;
|
|
217
|
+
} | {
|
|
218
|
+
type: "voice_over";
|
|
219
|
+
startAt?: number | undefined;
|
|
220
|
+
} | undefined;
|
|
221
|
+
audio?: {
|
|
222
|
+
type: "audio";
|
|
223
|
+
source: {
|
|
224
|
+
url: string;
|
|
225
|
+
kind: "url";
|
|
226
|
+
} | {
|
|
227
|
+
kind: "base64";
|
|
228
|
+
data: string;
|
|
229
|
+
} | {
|
|
230
|
+
text: string;
|
|
231
|
+
kind: "text";
|
|
232
|
+
} | {
|
|
233
|
+
path: string;
|
|
234
|
+
kind: "path";
|
|
235
|
+
};
|
|
236
|
+
} | {
|
|
237
|
+
type: "midi";
|
|
238
|
+
source: string;
|
|
239
|
+
} | undefined;
|
|
240
|
+
duration?: number | undefined;
|
|
241
|
+
speechOptions?: {
|
|
242
|
+
speed?: number | undefined;
|
|
243
|
+
instruction?: string | undefined;
|
|
244
|
+
} | undefined;
|
|
245
|
+
id?: string | undefined;
|
|
246
|
+
imagePrompt?: string | undefined;
|
|
247
|
+
speaker?: string | undefined;
|
|
248
|
+
description?: string | undefined;
|
|
249
|
+
imageParams?: {
|
|
250
|
+
provider: string;
|
|
251
|
+
images?: Record<string, {
|
|
252
|
+
type: "image";
|
|
253
|
+
source: {
|
|
254
|
+
url: string;
|
|
255
|
+
kind: "url";
|
|
256
|
+
} | {
|
|
257
|
+
kind: "base64";
|
|
258
|
+
data: string;
|
|
259
|
+
} | {
|
|
260
|
+
text: string;
|
|
261
|
+
kind: "text";
|
|
262
|
+
} | {
|
|
263
|
+
path: string;
|
|
264
|
+
kind: "path";
|
|
265
|
+
};
|
|
266
|
+
} | {
|
|
267
|
+
type: "imagePrompt";
|
|
268
|
+
prompt: string;
|
|
269
|
+
}> | undefined;
|
|
270
|
+
model?: string | undefined;
|
|
271
|
+
style?: string | undefined;
|
|
272
|
+
quality?: string | undefined;
|
|
273
|
+
moderation?: string | undefined;
|
|
274
|
+
} | undefined;
|
|
275
|
+
audioParams?: {
|
|
276
|
+
movieVolume: number;
|
|
277
|
+
padding?: number | undefined;
|
|
278
|
+
} | undefined;
|
|
279
|
+
movieParams?: {
|
|
280
|
+
speed?: number | undefined;
|
|
281
|
+
provider?: string | undefined;
|
|
282
|
+
model?: string | undefined;
|
|
283
|
+
fillOption?: {
|
|
284
|
+
style: "aspectFit" | "aspectFill";
|
|
285
|
+
} | undefined;
|
|
286
|
+
} | undefined;
|
|
287
|
+
soundEffectParams?: {
|
|
288
|
+
provider?: string | undefined;
|
|
289
|
+
model?: string | undefined;
|
|
290
|
+
} | undefined;
|
|
291
|
+
lipSyncParams?: {
|
|
292
|
+
provider?: string | undefined;
|
|
293
|
+
model?: string | undefined;
|
|
294
|
+
} | undefined;
|
|
295
|
+
htmlImageParams?: {
|
|
296
|
+
model?: string | undefined;
|
|
297
|
+
} | undefined;
|
|
298
|
+
textSlideParams?: {
|
|
299
|
+
cssStyles: string | string[];
|
|
300
|
+
} | undefined;
|
|
301
|
+
captionParams?: {
|
|
302
|
+
styles: string[];
|
|
303
|
+
lang?: string | undefined;
|
|
304
|
+
} | undefined;
|
|
305
|
+
imageNames?: string[] | undefined;
|
|
306
|
+
moviePrompt?: string | undefined;
|
|
307
|
+
soundEffectPrompt?: string | undefined;
|
|
308
|
+
htmlPrompt?: {
|
|
309
|
+
prompt: string;
|
|
310
|
+
images?: Record<string, any> | undefined;
|
|
311
|
+
data?: any;
|
|
312
|
+
systemPrompt?: string | undefined;
|
|
313
|
+
} | undefined;
|
|
314
|
+
enableLipSync?: boolean | undefined;
|
|
315
|
+
}[];
|
|
316
|
+
title?: string | undefined;
|
|
317
|
+
description?: string | undefined;
|
|
318
|
+
lipSyncParams?: {
|
|
319
|
+
provider?: string | undefined;
|
|
320
|
+
model?: string | undefined;
|
|
321
|
+
} | undefined;
|
|
322
|
+
htmlImageParams?: {
|
|
323
|
+
provider: string;
|
|
324
|
+
model?: string | undefined;
|
|
325
|
+
} | undefined;
|
|
326
|
+
textSlideParams?: {
|
|
327
|
+
cssStyles: string | string[];
|
|
328
|
+
} | undefined;
|
|
329
|
+
captionParams?: {
|
|
330
|
+
styles: string[];
|
|
331
|
+
lang?: string | undefined;
|
|
332
|
+
} | undefined;
|
|
333
|
+
references?: {
|
|
334
|
+
type: string;
|
|
335
|
+
url: string;
|
|
336
|
+
title?: string | undefined;
|
|
337
|
+
description?: string | undefined;
|
|
338
|
+
}[] | undefined;
|
|
339
|
+
imagePath?: string | undefined;
|
|
340
|
+
__test_invalid__?: boolean | undefined;
|
|
341
|
+
};
|
|
342
|
+
filename: string;
|
|
343
|
+
};
|
|
3
344
|
export declare const fetchScript: (isHttpPath: boolean, mulmoFilePath: string, fileOrUrl: string) => Promise<MulmoScript | null>;
|
|
4
345
|
export declare const getMultiLingual: (multilingualFilePath: string, studioBeatsLength: number) => MulmoStudioMultiLingual;
|
|
5
346
|
export declare const getPresentationStyle: (presentationStylePath: string | undefined) => MulmoPresentationStyle | null;
|
|
6
|
-
export declare const initializeContextFromFiles: (files: FileObject, raiseError: boolean, force?: boolean,
|
|
347
|
+
export declare const initializeContextFromFiles: (files: FileObject, raiseError: boolean, force?: boolean, captionLang?: string, targetLang?: string) => Promise<{
|
|
7
348
|
studio: {
|
|
8
349
|
beats: {
|
|
9
350
|
duration?: number | undefined;
|
|
@@ -21,12 +362,9 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
21
362
|
captionFile?: string | undefined;
|
|
22
363
|
}[];
|
|
23
364
|
script: {
|
|
365
|
+
lang: string;
|
|
24
366
|
imageParams: {
|
|
25
367
|
provider: string;
|
|
26
|
-
model?: string | undefined;
|
|
27
|
-
style?: string | undefined;
|
|
28
|
-
quality?: string | undefined;
|
|
29
|
-
moderation?: string | undefined;
|
|
30
368
|
images?: Record<string, {
|
|
31
369
|
type: "image";
|
|
32
370
|
source: {
|
|
@@ -46,6 +384,10 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
46
384
|
type: "imagePrompt";
|
|
47
385
|
prompt: string;
|
|
48
386
|
}> | undefined;
|
|
387
|
+
model?: string | undefined;
|
|
388
|
+
style?: string | undefined;
|
|
389
|
+
quality?: string | undefined;
|
|
390
|
+
moderation?: string | undefined;
|
|
49
391
|
};
|
|
50
392
|
audioParams: {
|
|
51
393
|
padding: number;
|
|
@@ -185,12 +527,12 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
185
527
|
kind: "path";
|
|
186
528
|
};
|
|
187
529
|
} | {
|
|
188
|
-
type: "textSlide";
|
|
189
530
|
slide: {
|
|
190
531
|
title: string;
|
|
191
532
|
subtitle?: string | undefined;
|
|
192
533
|
bullets?: string[] | undefined;
|
|
193
534
|
};
|
|
535
|
+
type: "textSlide";
|
|
194
536
|
} | {
|
|
195
537
|
type: "chart";
|
|
196
538
|
title: string;
|
|
@@ -252,10 +594,6 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
252
594
|
description?: string | undefined;
|
|
253
595
|
imageParams?: {
|
|
254
596
|
provider: string;
|
|
255
|
-
model?: string | undefined;
|
|
256
|
-
style?: string | undefined;
|
|
257
|
-
quality?: string | undefined;
|
|
258
|
-
moderation?: string | undefined;
|
|
259
597
|
images?: Record<string, {
|
|
260
598
|
type: "image";
|
|
261
599
|
source: {
|
|
@@ -275,6 +613,10 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
275
613
|
type: "imagePrompt";
|
|
276
614
|
prompt: string;
|
|
277
615
|
}> | undefined;
|
|
616
|
+
model?: string | undefined;
|
|
617
|
+
style?: string | undefined;
|
|
618
|
+
quality?: string | undefined;
|
|
619
|
+
moderation?: string | undefined;
|
|
278
620
|
} | undefined;
|
|
279
621
|
audioParams?: {
|
|
280
622
|
movieVolume: number;
|
|
@@ -311,13 +653,12 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
311
653
|
soundEffectPrompt?: string | undefined;
|
|
312
654
|
htmlPrompt?: {
|
|
313
655
|
prompt: string;
|
|
314
|
-
data?: any;
|
|
315
656
|
images?: Record<string, any> | undefined;
|
|
657
|
+
data?: any;
|
|
316
658
|
systemPrompt?: string | undefined;
|
|
317
659
|
} | undefined;
|
|
318
660
|
enableLipSync?: boolean | undefined;
|
|
319
661
|
}[];
|
|
320
|
-
lang?: string | undefined;
|
|
321
662
|
title?: string | undefined;
|
|
322
663
|
description?: string | undefined;
|
|
323
664
|
lipSyncParams?: {
|
|
@@ -346,37 +687,21 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
346
687
|
};
|
|
347
688
|
filename: string;
|
|
348
689
|
};
|
|
690
|
+
multiLingual: {
|
|
691
|
+
multiLingualTexts: Record<string, {
|
|
692
|
+
text: string;
|
|
693
|
+
lang: string;
|
|
694
|
+
cacheKey: string;
|
|
695
|
+
texts?: string[] | undefined;
|
|
696
|
+
ttsTexts?: string[] | undefined;
|
|
697
|
+
duration?: number | undefined;
|
|
698
|
+
}>;
|
|
699
|
+
cacheKey?: string | undefined;
|
|
700
|
+
}[];
|
|
349
701
|
fileDirs: FileObject;
|
|
350
|
-
force: boolean;
|
|
351
|
-
lang: string | undefined;
|
|
352
|
-
sessionState: {
|
|
353
|
-
inSession: {
|
|
354
|
-
audio: boolean;
|
|
355
|
-
image: boolean;
|
|
356
|
-
video: boolean;
|
|
357
|
-
multiLingual: boolean;
|
|
358
|
-
caption: boolean;
|
|
359
|
-
pdf: boolean;
|
|
360
|
-
};
|
|
361
|
-
inBeatSession: {
|
|
362
|
-
audio: {};
|
|
363
|
-
image: {};
|
|
364
|
-
movie: {};
|
|
365
|
-
multiLingual: {};
|
|
366
|
-
caption: {};
|
|
367
|
-
html: {};
|
|
368
|
-
imageReference: {};
|
|
369
|
-
soundEffect: {};
|
|
370
|
-
lipSync: {};
|
|
371
|
-
};
|
|
372
|
-
};
|
|
373
702
|
presentationStyle: {
|
|
374
703
|
imageParams: {
|
|
375
704
|
provider: string;
|
|
376
|
-
model?: string | undefined;
|
|
377
|
-
style?: string | undefined;
|
|
378
|
-
quality?: string | undefined;
|
|
379
|
-
moderation?: string | undefined;
|
|
380
705
|
images?: Record<string, {
|
|
381
706
|
type: "image";
|
|
382
707
|
source: {
|
|
@@ -396,6 +721,10 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
396
721
|
type: "imagePrompt";
|
|
397
722
|
prompt: string;
|
|
398
723
|
}> | undefined;
|
|
724
|
+
model?: string | undefined;
|
|
725
|
+
style?: string | undefined;
|
|
726
|
+
quality?: string | undefined;
|
|
727
|
+
moderation?: string | undefined;
|
|
399
728
|
};
|
|
400
729
|
audioParams: {
|
|
401
730
|
padding: number;
|
|
@@ -482,13 +811,27 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
482
811
|
lang?: string | undefined;
|
|
483
812
|
} | undefined;
|
|
484
813
|
};
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
814
|
+
sessionState: {
|
|
815
|
+
inSession: {
|
|
816
|
+
audio: boolean;
|
|
817
|
+
image: boolean;
|
|
818
|
+
video: boolean;
|
|
819
|
+
multiLingual: boolean;
|
|
820
|
+
caption: boolean;
|
|
821
|
+
pdf: boolean;
|
|
822
|
+
};
|
|
823
|
+
inBeatSession: {
|
|
824
|
+
audio: {};
|
|
825
|
+
image: {};
|
|
826
|
+
movie: {};
|
|
827
|
+
multiLingual: {};
|
|
828
|
+
caption: {};
|
|
829
|
+
html: {};
|
|
830
|
+
imageReference: {};
|
|
831
|
+
soundEffect: {};
|
|
832
|
+
lipSync: {};
|
|
833
|
+
};
|
|
834
|
+
};
|
|
835
|
+
force: boolean;
|
|
836
|
+
lang: string;
|
|
494
837
|
} | null>;
|