mulmocast 0.0.28 → 0.1.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.
- package/README.md +15 -8
- package/assets/templates/ghibli_shorts.json +1 -1
- package/assets/templates/sensei_and_taro.json +1 -1
- package/lib/actions/captions.js +16 -2
- package/lib/actions/images.d.ts +5 -2
- package/lib/actions/images.js +12 -16
- package/lib/actions/movie.d.ts +1 -1
- package/lib/actions/movie.js +61 -17
- package/lib/agents/combine_audio_files_agent.js +53 -5
- package/lib/agents/tts_openai_agent.js +2 -1
- package/lib/cli/commands/tool/scripting/handler.js +1 -0
- package/lib/methods/mulmo_presentation_style.d.ts +3 -2
- package/lib/methods/mulmo_presentation_style.js +8 -4
- package/lib/types/schema.d.ts +227 -53
- package/lib/types/schema.js +30 -7
- package/lib/types/type.d.ts +3 -2
- package/lib/utils/context.d.ts +11 -2
- package/lib/utils/image_plugins/index.d.ts +2 -1
- package/lib/utils/image_plugins/index.js +2 -1
- package/lib/utils/image_plugins/voice_over.d.ts +5 -0
- package/lib/utils/image_plugins/voice_over.js +9 -0
- package/lib/utils/preprocess.d.ts +11 -2
- package/package.json +1 -1
package/lib/types/schema.js
CHANGED
|
@@ -117,6 +117,12 @@ export const mulmoBeatReferenceMediaSchema = z
|
|
|
117
117
|
id: z.string().optional().describe("Specifies the beat to reference."),
|
|
118
118
|
})
|
|
119
119
|
.strict();
|
|
120
|
+
export const mulmoVoiceOverMediaSchema = z
|
|
121
|
+
.object({
|
|
122
|
+
type: z.literal("voice_over"),
|
|
123
|
+
startAt: z.number().optional().describe("The time to start the voice over the video in seconds."),
|
|
124
|
+
})
|
|
125
|
+
.strict();
|
|
120
126
|
export const mulmoImageAssetSchema = z.union([
|
|
121
127
|
mulmoMarkdownMediaSchema,
|
|
122
128
|
mulmoWebMediaSchema,
|
|
@@ -131,6 +137,7 @@ export const mulmoImageAssetSchema = z.union([
|
|
|
131
137
|
mulmoMermaidMediaSchema,
|
|
132
138
|
mulmoHtmlTailwindMediaSchema,
|
|
133
139
|
mulmoBeatReferenceMediaSchema,
|
|
140
|
+
mulmoVoiceOverMediaSchema,
|
|
134
141
|
]);
|
|
135
142
|
const mulmoAudioMediaSchema = z
|
|
136
143
|
.object({
|
|
@@ -152,8 +159,24 @@ export const mulmoFillOptionSchema = z
|
|
|
152
159
|
style: z.enum(["aspectFit", "aspectFill"]).default("aspectFit"),
|
|
153
160
|
})
|
|
154
161
|
.describe("How to handle aspect ratio differences between image and canvas");
|
|
162
|
+
export const text2ImageProviderSchema = z.union([z.literal("openai"), z.literal("google")]).default("openai");
|
|
163
|
+
// NOTE: This is for UI only. (until we figure out how to use it in mulmoImageParamsSchema)
|
|
164
|
+
export const mulmoOpenAIImageModelSchema = z
|
|
165
|
+
.object({
|
|
166
|
+
provider: z.literal("openai"),
|
|
167
|
+
model: z.union([z.literal("dall-e-3"), z.literal("gpt-image-1")]).optional(),
|
|
168
|
+
})
|
|
169
|
+
.strict();
|
|
170
|
+
// NOTE: This is for UI only. (until we figure out how to use it in mulmoImageParamsSchema)
|
|
171
|
+
export const mulmoGoogleImageModelSchema = z
|
|
172
|
+
.object({
|
|
173
|
+
provider: z.literal("google"),
|
|
174
|
+
model: z.union([z.literal("imagen-3.0-fast-generate-001"), z.literal("imagen-3.0-generate-002"), z.literal("imagen-3.0-capability-001")]).optional(),
|
|
175
|
+
})
|
|
176
|
+
.strict();
|
|
155
177
|
export const mulmoImageParamsSchema = z
|
|
156
178
|
.object({
|
|
179
|
+
provider: text2ImageProviderSchema, // has default value
|
|
157
180
|
model: z.string().optional(), // default: provider specific
|
|
158
181
|
style: z.string().optional(), // optional image style
|
|
159
182
|
moderation: z.string().optional(), // optional image style
|
|
@@ -209,7 +232,8 @@ export const mulmoBeatSchema = z
|
|
|
209
232
|
audioParams: beatAudioParamsSchema.optional(), // beat specific parameters
|
|
210
233
|
movieParams: z
|
|
211
234
|
.object({
|
|
212
|
-
fillOption: mulmoFillOptionSchema,
|
|
235
|
+
fillOption: mulmoFillOptionSchema.optional(),
|
|
236
|
+
speed: z.number().optional().describe("Speed of the video. 1.0 is normal speed. 0.5 is half speed. 2.0 is double speed."),
|
|
213
237
|
})
|
|
214
238
|
.optional(),
|
|
215
239
|
htmlImageParams: mulmoHtmlImageParamsSchema.optional(),
|
|
@@ -241,7 +265,6 @@ export const mulmoSpeechParamsSchema = z
|
|
|
241
265
|
speakers: speakerDictionarySchema,
|
|
242
266
|
})
|
|
243
267
|
.strict();
|
|
244
|
-
export const text2ImageProviderSchema = z.union([z.literal("openai"), z.literal("google")]).default("openai");
|
|
245
268
|
export const text2HtmlImageProviderSchema = z.union([z.literal("openai"), z.literal("anthropic")]).default("openai");
|
|
246
269
|
export const text2MovieProviderSchema = z.union([z.literal("openai"), z.literal("google"), z.literal("replicate")]).default("google");
|
|
247
270
|
export const mulmoTransitionSchema = z.object({
|
|
@@ -269,11 +292,7 @@ export const mulmoPresentationStyleSchema = z.object({
|
|
|
269
292
|
},
|
|
270
293
|
},
|
|
271
294
|
}),
|
|
272
|
-
imageParams: mulmoImageParamsSchema
|
|
273
|
-
.extend({
|
|
274
|
-
provider: text2ImageProviderSchema, // has default value
|
|
275
|
-
})
|
|
276
|
-
.optional(),
|
|
295
|
+
imageParams: mulmoImageParamsSchema.optional(),
|
|
277
296
|
movieParams: mulmoMovieParamsSchema.optional(),
|
|
278
297
|
htmlImageParams: mulmoHtmlImageParamsSchema
|
|
279
298
|
.extend({
|
|
@@ -315,6 +334,10 @@ export const mulmoStudioBeatSchema = z
|
|
|
315
334
|
.object({
|
|
316
335
|
hash: z.string().optional(),
|
|
317
336
|
duration: z.number().optional(),
|
|
337
|
+
startAt: z.number().optional(),
|
|
338
|
+
audioDuration: z.number().optional(),
|
|
339
|
+
movieDuration: z.number().optional(),
|
|
340
|
+
silenceDuration: z.number().optional(),
|
|
318
341
|
audioFile: z.string().optional(),
|
|
319
342
|
imageFile: z.string().optional(), // path to the image
|
|
320
343
|
movieFile: z.string().optional(), // path to the movie file
|
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, mulmoSpeechParamsSchema, textSlideParamsSchema, speechOptionsSchema, speakerDataSchema, mulmoCanvasDimensionSchema, mulmoScriptTemplateSchema, mulmoScriptTemplateFileSchema, text2ImageProviderSchema, text2HtmlImageProviderSchema, text2MovieProviderSchema, text2SpeechProviderSchema, mulmoPresentationStyleSchema, multiLingualTextsSchema, mulmoMermaidMediaSchema, mulmoTextSlideMediaSchema, mulmoMarkdownMediaSchema, mulmoImageMediaSchema, mulmoChartMediaSchema, mediaSourceSchema, mulmoSessionStateSchema } from "./schema.js";
|
|
1
|
+
import { langSchema, localizedTextSchema, mulmoBeatSchema, mulmoScriptSchema, mulmoStudioSchema, mulmoStudioBeatSchema, mulmoStoryboardSchema, mulmoStoryboardSceneSchema, mulmoStudioMultiLingualSchema, mulmoStudioMultiLingualDataSchema, speakerDictionarySchema, mulmoImageParamsSchema, mulmoImageParamsImagesSchema, mulmoFillOptionSchema, mulmoMovieParamsSchema, mulmoSpeechParamsSchema, textSlideParamsSchema, speechOptionsSchema, speakerDataSchema, mulmoCanvasDimensionSchema, mulmoScriptTemplateSchema, mulmoScriptTemplateFileSchema, text2ImageProviderSchema, text2HtmlImageProviderSchema, text2MovieProviderSchema, text2SpeechProviderSchema, mulmoPresentationStyleSchema, multiLingualTextsSchema, mulmoMermaidMediaSchema, mulmoTextSlideMediaSchema, mulmoMarkdownMediaSchema, mulmoImageMediaSchema, mulmoChartMediaSchema, mediaSourceSchema, mulmoSessionStateSchema, mulmoOpenAIImageModelSchema, mulmoGoogleImageModelSchema } from "./schema.js";
|
|
2
2
|
import { pdf_modes, pdf_sizes, storyToScriptGenerateMode } from "../utils/const.js";
|
|
3
3
|
import { LLM } from "../utils/utils.js";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -31,6 +31,8 @@ export type MulmoStudioMultiLingual = z.infer<typeof mulmoStudioMultiLingualSche
|
|
|
31
31
|
export type MulmoStudioMultiLingualData = z.infer<typeof mulmoStudioMultiLingualDataSchema>;
|
|
32
32
|
export type MultiLingualTexts = z.infer<typeof multiLingualTextsSchema>;
|
|
33
33
|
export type MulmoMovieParams = z.infer<typeof mulmoMovieParamsSchema>;
|
|
34
|
+
export type MulmoOpenAIImageModel = z.infer<typeof mulmoOpenAIImageModelSchema>;
|
|
35
|
+
export type MulmoGoogleImageModel = z.infer<typeof mulmoGoogleImageModelSchema>;
|
|
34
36
|
export type MulmoTextSlideMedia = z.infer<typeof mulmoTextSlideMediaSchema>;
|
|
35
37
|
export type MulmoMarkdownMedia = z.infer<typeof mulmoMarkdownMediaSchema>;
|
|
36
38
|
export type MulmoImageMedia = z.infer<typeof mulmoImageMediaSchema>;
|
|
@@ -74,7 +76,6 @@ export type ImageProcessorParams = {
|
|
|
74
76
|
export type PDFMode = (typeof pdf_modes)[number];
|
|
75
77
|
export type PDFSize = (typeof pdf_sizes)[number];
|
|
76
78
|
export type Text2ImageAgentInfo = {
|
|
77
|
-
provider: Text2ImageProvider;
|
|
78
79
|
agent: string;
|
|
79
80
|
imageParams: MulmoImageParams;
|
|
80
81
|
};
|
package/lib/utils/context.d.ts
CHANGED
|
@@ -7,7 +7,11 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
7
7
|
studio: {
|
|
8
8
|
beats: {
|
|
9
9
|
duration?: number | undefined;
|
|
10
|
+
startAt?: number | undefined;
|
|
10
11
|
hash?: string | undefined;
|
|
12
|
+
audioDuration?: number | undefined;
|
|
13
|
+
movieDuration?: number | undefined;
|
|
14
|
+
silenceDuration?: number | undefined;
|
|
11
15
|
audioFile?: string | undefined;
|
|
12
16
|
imageFile?: string | undefined;
|
|
13
17
|
movieFile?: string | undefined;
|
|
@@ -149,6 +153,9 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
149
153
|
} | {
|
|
150
154
|
type: "beat";
|
|
151
155
|
id?: string | undefined;
|
|
156
|
+
} | {
|
|
157
|
+
type: "voice_over";
|
|
158
|
+
startAt?: number | undefined;
|
|
152
159
|
} | {
|
|
153
160
|
type: "movie";
|
|
154
161
|
source: {
|
|
@@ -188,6 +195,7 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
188
195
|
} | undefined;
|
|
189
196
|
description?: string | undefined;
|
|
190
197
|
imageParams?: {
|
|
198
|
+
provider: "openai" | "google";
|
|
191
199
|
style?: string | undefined;
|
|
192
200
|
model?: string | undefined;
|
|
193
201
|
moderation?: string | undefined;
|
|
@@ -212,9 +220,10 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
212
220
|
padding?: number | undefined;
|
|
213
221
|
} | undefined;
|
|
214
222
|
movieParams?: {
|
|
215
|
-
|
|
223
|
+
speed?: number | undefined;
|
|
224
|
+
fillOption?: {
|
|
216
225
|
style: "aspectFit" | "aspectFill";
|
|
217
|
-
};
|
|
226
|
+
} | undefined;
|
|
218
227
|
} | undefined;
|
|
219
228
|
htmlImageParams?: {
|
|
220
229
|
model?: string | undefined;
|
|
@@ -6,4 +6,5 @@ import * as pluginHtmlTailwind from "./html_tailwind.js";
|
|
|
6
6
|
import * as pluginImage from "./image.js";
|
|
7
7
|
import * as pluginMovie from "./movie.js";
|
|
8
8
|
import * as pluginBeat from "./beat.js";
|
|
9
|
-
|
|
9
|
+
import * as pluginVoiceOver from "./voice_over.js";
|
|
10
|
+
export declare const findImagePlugin: (imageType?: string) => typeof pluginTextSlide | typeof pluginMarkdown | typeof pluginChart | typeof pluginMermaid | typeof pluginHtmlTailwind | typeof pluginImage | typeof pluginMovie | typeof pluginBeat | typeof pluginVoiceOver | undefined;
|
|
@@ -6,7 +6,8 @@ import * as pluginHtmlTailwind from "./html_tailwind.js";
|
|
|
6
6
|
import * as pluginImage from "./image.js";
|
|
7
7
|
import * as pluginMovie from "./movie.js";
|
|
8
8
|
import * as pluginBeat from "./beat.js";
|
|
9
|
-
|
|
9
|
+
import * as pluginVoiceOver from "./voice_over.js";
|
|
10
|
+
const imagePlugins = [pluginTextSlide, pluginMarkdown, pluginImage, pluginChart, pluginMermaid, pluginMovie, pluginHtmlTailwind, pluginBeat, pluginVoiceOver];
|
|
10
11
|
export const findImagePlugin = (imageType) => {
|
|
11
12
|
return imagePlugins.find((plugin) => plugin.imageType === imageType);
|
|
12
13
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ImageProcessorParams } from "../../types/index.js";
|
|
2
|
+
export declare const imageType = "voice_over";
|
|
3
|
+
export declare const processBeatReference: (__: ImageProcessorParams) => Promise<undefined>;
|
|
4
|
+
export declare const process: (__: ImageProcessorParams) => Promise<undefined>;
|
|
5
|
+
export declare const path: (__: ImageProcessorParams) => undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const imageType = "voice_over";
|
|
2
|
+
export const processBeatReference = async (__) => {
|
|
3
|
+
// For voice-over, return undefined to indicate no image should be generated
|
|
4
|
+
return undefined;
|
|
5
|
+
};
|
|
6
|
+
export const process = processBeatReference;
|
|
7
|
+
export const path = (__) => {
|
|
8
|
+
return undefined;
|
|
9
|
+
};
|
|
@@ -2,7 +2,11 @@ import { MulmoStudio, MulmoScript } from "../types/index.js";
|
|
|
2
2
|
export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, currentStudio: MulmoStudio | undefined, fileName: string, videoCaption?: string) => {
|
|
3
3
|
beats: {
|
|
4
4
|
duration?: number | undefined;
|
|
5
|
+
startAt?: number | undefined;
|
|
5
6
|
hash?: string | undefined;
|
|
7
|
+
audioDuration?: number | undefined;
|
|
8
|
+
movieDuration?: number | undefined;
|
|
9
|
+
silenceDuration?: number | undefined;
|
|
6
10
|
audioFile?: string | undefined;
|
|
7
11
|
imageFile?: string | undefined;
|
|
8
12
|
movieFile?: string | undefined;
|
|
@@ -144,6 +148,9 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
|
|
|
144
148
|
} | {
|
|
145
149
|
type: "beat";
|
|
146
150
|
id?: string | undefined;
|
|
151
|
+
} | {
|
|
152
|
+
type: "voice_over";
|
|
153
|
+
startAt?: number | undefined;
|
|
147
154
|
} | {
|
|
148
155
|
type: "movie";
|
|
149
156
|
source: {
|
|
@@ -183,6 +190,7 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
|
|
|
183
190
|
} | undefined;
|
|
184
191
|
description?: string | undefined;
|
|
185
192
|
imageParams?: {
|
|
193
|
+
provider: "openai" | "google";
|
|
186
194
|
style?: string | undefined;
|
|
187
195
|
model?: string | undefined;
|
|
188
196
|
moderation?: string | undefined;
|
|
@@ -207,9 +215,10 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
|
|
|
207
215
|
padding?: number | undefined;
|
|
208
216
|
} | undefined;
|
|
209
217
|
movieParams?: {
|
|
210
|
-
|
|
218
|
+
speed?: number | undefined;
|
|
219
|
+
fillOption?: {
|
|
211
220
|
style: "aspectFit" | "aspectFill";
|
|
212
|
-
};
|
|
221
|
+
} | undefined;
|
|
213
222
|
} | undefined;
|
|
214
223
|
htmlImageParams?: {
|
|
215
224
|
model?: string | undefined;
|