mulmocast 1.1.0 → 1.1.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.
Files changed (48) hide show
  1. package/assets/templates/ani.json +2 -2
  2. package/assets/templates/ani_ja.json +2 -2
  3. package/lib/actions/image_agents.d.ts +21 -0
  4. package/lib/actions/image_agents.js +7 -0
  5. package/lib/actions/images.js +33 -4
  6. package/lib/actions/movie.js +3 -2
  7. package/lib/agents/index.d.ts +2 -1
  8. package/lib/agents/index.js +2 -1
  9. package/lib/agents/lipsync_replicate_agent.d.ts +5 -0
  10. package/lib/agents/lipsync_replicate_agent.js +57 -0
  11. package/lib/data/index.d.ts +2 -0
  12. package/lib/data/index.js +2 -0
  13. package/lib/data/promptTemplates.d.ts +695 -0
  14. package/lib/data/promptTemplates.js +957 -0
  15. package/lib/data/scriptTemplates.d.ts +233 -0
  16. package/lib/data/scriptTemplates.js +580 -0
  17. package/lib/index.browser.d.ts +2 -1
  18. package/lib/index.browser.js +2 -1
  19. package/lib/methods/mulmo_presentation_style.d.ts +8 -0
  20. package/lib/methods/mulmo_presentation_style.js +8 -1
  21. package/lib/tools/story_to_script.js +2 -2
  22. package/lib/types/agent.d.ts +10 -0
  23. package/lib/types/schema.d.ts +230 -0
  24. package/lib/types/schema.js +9 -0
  25. package/lib/types/type.d.ts +1 -1
  26. package/lib/utils/context.d.ts +15 -0
  27. package/lib/utils/context.js +1 -0
  28. package/lib/utils/file.d.ts +8 -3
  29. package/lib/utils/file.js +46 -20
  30. package/lib/utils/preprocess.d.ts +10 -0
  31. package/lib/utils/provider2agent.d.ts +11 -0
  32. package/lib/utils/provider2agent.js +13 -0
  33. package/lib/utils/utils.js +3 -0
  34. package/package.json +8 -4
  35. package/scripts/templates/business.json +1 -1
  36. package/scripts/templates/children_book.json +1 -1
  37. package/scripts/templates/coding.json +1 -1
  38. package/scripts/templates/html.json +1 -1
  39. package/scripts/templates/image_prompt_only_template.json +1 -1
  40. package/scripts/templates/image_prompts_template.json +1 -1
  41. package/scripts/templates/image_refs.json +1 -1
  42. package/scripts/templates/movie_prompts_no_text_template.json +1 -1
  43. package/scripts/templates/movie_prompts_template.json +1 -1
  44. package/scripts/templates/presentation.json +1 -1
  45. package/scripts/templates/sensei_and_taro.json +1 -1
  46. package/scripts/templates/shorts_template.json +1 -1
  47. package/scripts/templates/text_only_template.json +1 -1
  48. package/scripts/templates/voice_over.json +1 -1
@@ -0,0 +1,580 @@
1
+ export const scriptTemplates = [
2
+ {
3
+ $mulmocast: {
4
+ credit: "closing",
5
+ version: "1.1",
6
+ },
7
+ audioParams: {
8
+ audioVolume: 1,
9
+ bgmVolume: 0.2,
10
+ closingPadding: 0.8,
11
+ introPadding: 1,
12
+ outroPadding: 1,
13
+ padding: 0.3,
14
+ suppressSpeech: false,
15
+ },
16
+ canvasSize: {
17
+ height: 720,
18
+ width: 1280,
19
+ },
20
+ filename: "business",
21
+ imageParams: {
22
+ images: {},
23
+ provider: "openai",
24
+ },
25
+ movieParams: {
26
+ provider: "replicate",
27
+ },
28
+ soundEffectParams: {
29
+ provider: "replicate",
30
+ },
31
+ speechParams: {
32
+ speakers: {
33
+ Presenter: {
34
+ displayName: {
35
+ en: "Presenter",
36
+ },
37
+ voiceId: "shimmer",
38
+ },
39
+ },
40
+ },
41
+ },
42
+ {
43
+ $mulmocast: {
44
+ credit: "closing",
45
+ version: "1.1",
46
+ },
47
+ audioParams: {
48
+ audioVolume: 1,
49
+ bgmVolume: 0.2,
50
+ closingPadding: 0.8,
51
+ introPadding: 1,
52
+ outroPadding: 1,
53
+ padding: 0.3,
54
+ suppressSpeech: false,
55
+ },
56
+ canvasSize: {
57
+ height: 720,
58
+ width: 1280,
59
+ },
60
+ filename: "children_book",
61
+ imageParams: {
62
+ images: {},
63
+ provider: "openai",
64
+ },
65
+ movieParams: {
66
+ provider: "replicate",
67
+ },
68
+ soundEffectParams: {
69
+ provider: "replicate",
70
+ },
71
+ speechParams: {
72
+ speakers: {
73
+ Presenter: {
74
+ displayName: {
75
+ en: "Presenter",
76
+ },
77
+ voiceId: "shimmer",
78
+ },
79
+ },
80
+ },
81
+ },
82
+ {
83
+ $mulmocast: {
84
+ credit: "closing",
85
+ version: "1.1",
86
+ },
87
+ audioParams: {
88
+ audioVolume: 1,
89
+ bgmVolume: 0.2,
90
+ closingPadding: 0.8,
91
+ introPadding: 1,
92
+ outroPadding: 1,
93
+ padding: 0.3,
94
+ suppressSpeech: false,
95
+ },
96
+ canvasSize: {
97
+ height: 720,
98
+ width: 1280,
99
+ },
100
+ filename: "coding",
101
+ imageParams: {
102
+ images: {},
103
+ provider: "openai",
104
+ },
105
+ movieParams: {
106
+ provider: "replicate",
107
+ },
108
+ soundEffectParams: {
109
+ provider: "replicate",
110
+ },
111
+ speechParams: {
112
+ speakers: {
113
+ Presenter: {
114
+ displayName: {
115
+ en: "Presenter",
116
+ },
117
+ voiceId: "shimmer",
118
+ },
119
+ },
120
+ },
121
+ },
122
+ {
123
+ $mulmocast: {
124
+ credit: "closing",
125
+ version: "1.1",
126
+ },
127
+ audioParams: {
128
+ audioVolume: 1,
129
+ bgmVolume: 0.2,
130
+ closingPadding: 0.8,
131
+ introPadding: 1,
132
+ outroPadding: 1,
133
+ padding: 0.3,
134
+ suppressSpeech: false,
135
+ },
136
+ canvasSize: {
137
+ height: 720,
138
+ width: 1280,
139
+ },
140
+ filename: "html",
141
+ htmlImageParams: {
142
+ model: "claude-3-7-sonnet-20250219",
143
+ provider: "anthropic",
144
+ },
145
+ imageParams: {
146
+ images: {},
147
+ provider: "openai",
148
+ },
149
+ movieParams: {
150
+ provider: "replicate",
151
+ },
152
+ soundEffectParams: {
153
+ provider: "replicate",
154
+ },
155
+ speechParams: {
156
+ speakers: {
157
+ Presenter: {
158
+ displayName: {
159
+ en: "Presenter",
160
+ },
161
+ voiceId: "shimmer",
162
+ },
163
+ },
164
+ },
165
+ },
166
+ {
167
+ $mulmocast: {
168
+ credit: "closing",
169
+ version: "1.1",
170
+ },
171
+ audioParams: {
172
+ audioVolume: 1,
173
+ bgmVolume: 0.2,
174
+ closingPadding: 0.8,
175
+ introPadding: 1,
176
+ outroPadding: 1,
177
+ padding: 0.3,
178
+ suppressSpeech: false,
179
+ },
180
+ canvasSize: {
181
+ height: 720,
182
+ width: 1280,
183
+ },
184
+ filename: "image_prompt_only_template",
185
+ imageParams: {
186
+ images: {},
187
+ provider: "openai",
188
+ },
189
+ movieParams: {
190
+ provider: "replicate",
191
+ },
192
+ soundEffectParams: {
193
+ provider: "replicate",
194
+ },
195
+ speechParams: {
196
+ speakers: {
197
+ Presenter: {
198
+ displayName: {
199
+ en: "Presenter",
200
+ },
201
+ voiceId: "shimmer",
202
+ },
203
+ },
204
+ },
205
+ },
206
+ {
207
+ $mulmocast: {
208
+ credit: "closing",
209
+ version: "1.1",
210
+ },
211
+ audioParams: {
212
+ audioVolume: 1,
213
+ bgmVolume: 0.2,
214
+ closingPadding: 0.8,
215
+ introPadding: 1,
216
+ outroPadding: 1,
217
+ padding: 0.3,
218
+ suppressSpeech: false,
219
+ },
220
+ canvasSize: {
221
+ height: 720,
222
+ width: 1280,
223
+ },
224
+ filename: "image_prompts_template",
225
+ imageParams: {
226
+ images: {},
227
+ provider: "openai",
228
+ },
229
+ movieParams: {
230
+ provider: "replicate",
231
+ },
232
+ soundEffectParams: {
233
+ provider: "replicate",
234
+ },
235
+ speechParams: {
236
+ speakers: {
237
+ Presenter: {
238
+ displayName: {
239
+ en: "Presenter",
240
+ },
241
+ voiceId: "shimmer",
242
+ },
243
+ },
244
+ },
245
+ },
246
+ {
247
+ $mulmocast: {
248
+ version: "1.1",
249
+ },
250
+ audioParams: {
251
+ audioVolume: 1,
252
+ bgmVolume: 0.2,
253
+ closingPadding: 0.8,
254
+ introPadding: 1,
255
+ outroPadding: 1,
256
+ padding: 0.3,
257
+ suppressSpeech: false,
258
+ },
259
+ canvasSize: {
260
+ height: 720,
261
+ width: 1280,
262
+ },
263
+ filename: "image_refs",
264
+ imageParams: {
265
+ images: {
266
+ "[CHARACTER_ID_1]": {
267
+ prompt: "[IMAGE PROMPT FOR THIS CHARACTER]",
268
+ type: "imagePrompt",
269
+ },
270
+ "[CHARACTER_ID_2]": {
271
+ prompt: "[IMAGE PROMPT FOR THIS CHARACTER]",
272
+ type: "imagePrompt",
273
+ },
274
+ },
275
+ provider: "openai",
276
+ },
277
+ movieParams: {
278
+ provider: "replicate",
279
+ },
280
+ soundEffectParams: {
281
+ provider: "replicate",
282
+ },
283
+ speechParams: {
284
+ speakers: {
285
+ Presenter: {
286
+ displayName: {
287
+ en: "Presenter",
288
+ },
289
+ voiceId: "shimmer",
290
+ },
291
+ },
292
+ },
293
+ },
294
+ {
295
+ $mulmocast: {
296
+ credit: "closing",
297
+ version: "1.1",
298
+ },
299
+ audioParams: {
300
+ audioVolume: 1,
301
+ bgmVolume: 0.2,
302
+ closingPadding: 0.8,
303
+ introPadding: 1,
304
+ outroPadding: 1,
305
+ padding: 0.3,
306
+ suppressSpeech: false,
307
+ },
308
+ canvasSize: {
309
+ height: 720,
310
+ width: 1280,
311
+ },
312
+ filename: "movie_prompts_no_text_template",
313
+ imageParams: {
314
+ images: {},
315
+ provider: "openai",
316
+ },
317
+ movieParams: {
318
+ provider: "google",
319
+ },
320
+ soundEffectParams: {
321
+ provider: "replicate",
322
+ },
323
+ speechParams: {
324
+ speakers: {
325
+ Presenter: {
326
+ displayName: {
327
+ en: "Presenter",
328
+ },
329
+ voiceId: "shimmer",
330
+ },
331
+ },
332
+ },
333
+ },
334
+ {
335
+ $mulmocast: {
336
+ credit: "closing",
337
+ version: "1.1",
338
+ },
339
+ audioParams: {
340
+ audioVolume: 1,
341
+ bgmVolume: 0.2,
342
+ closingPadding: 0.8,
343
+ introPadding: 1,
344
+ outroPadding: 1,
345
+ padding: 0.3,
346
+ suppressSpeech: false,
347
+ },
348
+ canvasSize: {
349
+ height: 720,
350
+ width: 1280,
351
+ },
352
+ filename: "movie_prompts_template",
353
+ imageParams: {
354
+ images: {},
355
+ provider: "openai",
356
+ },
357
+ movieParams: {
358
+ provider: "google",
359
+ },
360
+ soundEffectParams: {
361
+ provider: "replicate",
362
+ },
363
+ speechParams: {
364
+ speakers: {
365
+ Presenter: {
366
+ displayName: {
367
+ en: "Presenter",
368
+ },
369
+ voiceId: "shimmer",
370
+ },
371
+ },
372
+ },
373
+ },
374
+ {
375
+ $mulmocast: {
376
+ credit: "closing",
377
+ version: "1.1",
378
+ },
379
+ audioParams: {
380
+ audioVolume: 1,
381
+ bgmVolume: 0.2,
382
+ closingPadding: 0.8,
383
+ introPadding: 1,
384
+ outroPadding: 1,
385
+ padding: 0.3,
386
+ suppressSpeech: false,
387
+ },
388
+ canvasSize: {
389
+ height: 720,
390
+ width: 1280,
391
+ },
392
+ filename: "presentation",
393
+ htmlImageParams: {
394
+ model: "claude-3-7-sonnet-20250219",
395
+ provider: "anthropic",
396
+ },
397
+ imageParams: {
398
+ images: {},
399
+ provider: "openai",
400
+ },
401
+ movieParams: {
402
+ provider: "replicate",
403
+ },
404
+ soundEffectParams: {
405
+ provider: "replicate",
406
+ },
407
+ speechParams: {
408
+ speakers: {
409
+ Presenter: {
410
+ displayName: {
411
+ en: "Presenter",
412
+ },
413
+ voiceId: "shimmer",
414
+ },
415
+ },
416
+ },
417
+ },
418
+ {
419
+ $mulmocast: {
420
+ credit: "closing",
421
+ version: "1.1",
422
+ },
423
+ audioParams: {
424
+ audioVolume: 1,
425
+ bgmVolume: 0.2,
426
+ closingPadding: 0.8,
427
+ introPadding: 1,
428
+ outroPadding: 1,
429
+ padding: 0.3,
430
+ suppressSpeech: false,
431
+ },
432
+ canvasSize: {
433
+ height: 720,
434
+ width: 1280,
435
+ },
436
+ filename: "sensei_and_taro",
437
+ imageParams: {
438
+ images: {},
439
+ provider: "openai",
440
+ },
441
+ movieParams: {
442
+ provider: "replicate",
443
+ },
444
+ soundEffectParams: {
445
+ provider: "replicate",
446
+ },
447
+ speechParams: {
448
+ speakers: {
449
+ Presenter: {
450
+ displayName: {
451
+ en: "Presenter",
452
+ },
453
+ voiceId: "shimmer",
454
+ },
455
+ },
456
+ },
457
+ },
458
+ {
459
+ $mulmocast: {
460
+ version: "1.1",
461
+ },
462
+ audioParams: {
463
+ audioVolume: 1,
464
+ bgmVolume: 0.2,
465
+ closingPadding: 0.8,
466
+ introPadding: 1,
467
+ outroPadding: 1,
468
+ padding: 0.3,
469
+ suppressSpeech: false,
470
+ },
471
+ canvasSize: {
472
+ height: 720,
473
+ width: 1280,
474
+ },
475
+ filename: "shorts_template",
476
+ imageParams: {
477
+ images: {},
478
+ provider: "openai",
479
+ },
480
+ movieParams: {
481
+ provider: "google",
482
+ },
483
+ soundEffectParams: {
484
+ provider: "replicate",
485
+ },
486
+ speechParams: {
487
+ speakers: {
488
+ Presenter: {
489
+ displayName: {
490
+ en: "Presenter",
491
+ },
492
+ voiceId: "shimmer",
493
+ },
494
+ },
495
+ },
496
+ },
497
+ {
498
+ $mulmocast: {
499
+ credit: "closing",
500
+ version: "1.1",
501
+ },
502
+ audioParams: {
503
+ audioVolume: 1,
504
+ bgmVolume: 0.2,
505
+ closingPadding: 0.8,
506
+ introPadding: 1,
507
+ outroPadding: 1,
508
+ padding: 0.3,
509
+ suppressSpeech: false,
510
+ },
511
+ canvasSize: {
512
+ height: 720,
513
+ width: 1280,
514
+ },
515
+ filename: "text_only_template",
516
+ imageParams: {
517
+ images: {},
518
+ provider: "openai",
519
+ },
520
+ movieParams: {
521
+ provider: "replicate",
522
+ },
523
+ soundEffectParams: {
524
+ provider: "replicate",
525
+ },
526
+ speechParams: {
527
+ speakers: {
528
+ Presenter: {
529
+ displayName: {
530
+ en: "Presenter",
531
+ },
532
+ voiceId: "shimmer",
533
+ },
534
+ },
535
+ },
536
+ },
537
+ {
538
+ $mulmocast: {
539
+ version: "1.1",
540
+ },
541
+ audioParams: {
542
+ audioVolume: 1,
543
+ bgmVolume: 0.2,
544
+ closingPadding: 0.8,
545
+ introPadding: 1,
546
+ outroPadding: 1,
547
+ padding: 0.3,
548
+ suppressSpeech: false,
549
+ },
550
+ canvasSize: {
551
+ height: 2064,
552
+ width: 1552,
553
+ },
554
+ captionParams: {
555
+ lang: "en",
556
+ styles: [],
557
+ },
558
+ filename: "voice_over",
559
+ imageParams: {
560
+ images: {},
561
+ provider: "openai",
562
+ },
563
+ movieParams: {
564
+ provider: "replicate",
565
+ },
566
+ soundEffectParams: {
567
+ provider: "replicate",
568
+ },
569
+ speechParams: {
570
+ speakers: {
571
+ Presenter: {
572
+ displayName: {
573
+ en: "Presenter",
574
+ },
575
+ voiceId: "shimmer",
576
+ },
577
+ },
578
+ },
579
+ },
580
+ ];
@@ -1,2 +1,3 @@
1
1
  export * from "./index.common.js";
2
- export * from "./agents/validate_schema_agent.js";
2
+ import validateSchemaAgent from "./agents/validate_schema_agent.js";
3
+ export { validateSchemaAgent };
@@ -1,3 +1,4 @@
1
1
  // Entry point for browser code
2
2
  export * from "./index.common.js";
3
- export * from "./agents/validate_schema_agent.js";
3
+ import validateSchemaAgent from "./agents/validate_schema_agent.js";
4
+ export { validateSchemaAgent };
@@ -32,6 +32,14 @@ export declare const MulmoPresentationStyleMethods: {
32
32
  identifier?: `${string}/${string}:${string}`;
33
33
  }>;
34
34
  };
35
+ getLipSyncAgentInfo(presentationStyle: MulmoPresentationStyle, beat: MulmoBeat): {
36
+ agentName: string;
37
+ defaultModel: import("../utils/provider2agent.js").ReplicateModel;
38
+ models: import("../utils/provider2agent.js").ReplicateModel[];
39
+ modelParams: Record<import("../utils/provider2agent.js").ReplicateModel, {
40
+ identifier?: `${string}/${string}:${string}`;
41
+ }>;
42
+ };
35
43
  getConcurrency(presentationStyle: MulmoPresentationStyle): 4 | 16;
36
44
  getHtmlImageAgentInfo(presentationStyle: MulmoPresentationStyle): Text2HtmlAgentInfo;
37
45
  getImageType(_: MulmoPresentationStyle, beat: MulmoBeat): BeatMediaType;
@@ -2,7 +2,7 @@ import "dotenv/config";
2
2
  import { isNull } from "graphai";
3
3
  import { userAssert } from "../utils/utils.js";
4
4
  import { text2ImageProviderSchema, text2HtmlImageProviderSchema, text2MovieProviderSchema, text2SpeechProviderSchema, mulmoCanvasDimensionSchema, } from "../types/schema.js";
5
- import { provider2ImageAgent, provider2MovieAgent, provider2LLMAgent, provider2SoundEffectAgent, defaultProviders, } from "../utils/provider2agent.js";
5
+ import { provider2ImageAgent, provider2MovieAgent, provider2LLMAgent, provider2SoundEffectAgent, provider2LipSyncAgent, defaultProviders, } from "../utils/provider2agent.js";
6
6
  const defaultTextSlideStyles = [
7
7
  '*,*::before,*::after{box-sizing:border-box}body,h1,h2,h3,h4,p,figure,blockquote,dl,dd{margin:0}ul[role="list"],ol[role="list"]{list-style:none}html:focus-within{scroll-behavior:smooth}body{min-height:100vh;text-rendering:optimizeSpeed;line-height:1.5}a:not([class]){text-decoration-skip-ink:auto}img,picture{max-width:100%;display:block}input,button,textarea,select{font:inherit}@media(prefers-reduced-motion:reduce){html:focus-within{scroll-behavior:auto}*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}',
8
8
  "body { margin: 60px; margin-top: 40px; color:#333; font-size: 30px; font-family: Arial, sans-serif; box-sizing: border-box; height: 100vh }",
@@ -93,6 +93,13 @@ export const MulmoPresentationStyleMethods = {
93
93
  const agentInfo = provider2SoundEffectAgent[soundEffectProvider];
94
94
  return agentInfo;
95
95
  },
96
+ getLipSyncAgentInfo(presentationStyle, beat) {
97
+ const lipSyncProvider = (beat.lipSyncParams?.provider ??
98
+ presentationStyle.lipSyncParams?.provider ??
99
+ defaultProviders.lipSync);
100
+ const agentInfo = provider2LipSyncAgent[lipSyncProvider];
101
+ return agentInfo;
102
+ },
96
103
  getConcurrency(presentationStyle) {
97
104
  const imageAgentInfo = MulmoPresentationStyleMethods.getImageAgentInfo(presentationStyle);
98
105
  if (imageAgentInfo.imageParams.provider === "openai") {
@@ -1,4 +1,4 @@
1
- import { getTemplateFilePath, readAndParseJson, readScriptTemplateFile, writingMessage } from "../utils/file.js";
1
+ import { getPromptTemplateFilePath, readAndParseJson, readScriptTemplateFile, writingMessage } from "../utils/file.js";
2
2
  import { mulmoScriptSchema, mulmoScriptTemplateSchema } from "../types/schema.js";
3
3
  import { GraphAI, GraphAILogger } from "graphai";
4
4
  import { openAIAgent } from "@graphai/openai_agent";
@@ -249,7 +249,7 @@ const generateScriptPrompt = async (template, beatsPerScene, story) => {
249
249
  return storyToScriptPrompt(script, beatsPerScene, story);
250
250
  };
251
251
  export const storyToScript = async ({ story, beatsPerScene, templateName, outdir, fileName, llm, llmModel, generateMode, }) => {
252
- const template = readAndParseJson(getTemplateFilePath(templateName), mulmoScriptTemplateSchema);
252
+ const template = readAndParseJson(getPromptTemplateFilePath(templateName), mulmoScriptTemplateSchema);
253
253
  const { agent, model, max_tokens } = llmPair(llm, llmModel);
254
254
  const beatsPrompt = await generateBeatsPrompt(template, beatsPerScene, story);
255
255
  const scriptInfoPrompt = await generateScriptInfoPrompt(template, story);
@@ -66,9 +66,19 @@ export type SoundEffectAgentInputs = AgentPromptInputs & {
66
66
  soundEffectFile: string;
67
67
  movieFile: string;
68
68
  };
69
+ export type ReplicateLipSyncAgentParams = {
70
+ model: `${string}/${string}` | undefined;
71
+ duration?: number;
72
+ };
73
+ export type LipSyncAgentInputs = {
74
+ lipSyncFile: string;
75
+ movieFile: string;
76
+ audioFile: string;
77
+ };
69
78
  export type GoogleMovieAgentConfig = GoogleImageAgentConfig;
70
79
  export type ReplicateMovieAgentConfig = AgentConfig;
71
80
  export type ReplicateSoundEffectAgentConfig = AgentConfig;
81
+ export type ReplicateLipSyncAgentConfig = AgentConfig;
72
82
  export type TTSAgentParams = {
73
83
  suppressError: boolean;
74
84
  voice: string;