mulmocast 2.6.4 → 2.6.6

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 (39) hide show
  1. package/lib/actions/graph_option.d.ts +3 -0
  2. package/lib/actions/graph_option.js +18 -0
  3. package/lib/actions/image_references.d.ts +1 -0
  4. package/lib/actions/image_references.js +50 -12
  5. package/lib/actions/images.d.ts +2 -3
  6. package/lib/actions/images.js +4 -17
  7. package/lib/actions/movie.d.ts +3 -0
  8. package/lib/actions/movie.js +38 -5
  9. package/lib/agents/add_bgm_agent.d.ts +10 -0
  10. package/lib/agents/add_bgm_agent.js +26 -4
  11. package/lib/agents/movie_genai_agent.js +1 -1
  12. package/lib/agents/movie_replicate_agent.js +29 -5
  13. package/lib/types/provider2agent.d.ts +2 -0
  14. package/lib/types/provider2agent.js +78 -5
  15. package/lib/types/schema.d.ts +166 -4
  16. package/lib/types/schema.js +11 -1
  17. package/lib/utils/context.d.ts +72 -2
  18. package/lib/utils/image_plugins/html_tailwind.d.ts +5 -0
  19. package/lib/utils/image_plugins/html_tailwind.js +56 -5
  20. package/package.json +13 -12
  21. package/scripts/test/fixtures/movie_tone_high.mov +0 -0
  22. package/scripts/test/fixtures/movie_tone_low.mov +0 -0
  23. package/scripts/test/fixtures/movie_tone_mid.mov +0 -0
  24. package/scripts/test/glb/sample_2026-03-15T172907.296_compat.glb +0 -0
  25. package/scripts/test/test_audio_mix.json +91 -0
  26. package/scripts/test/test_audio_mix_beat_vol.json +100 -0
  27. package/scripts/test/test_audio_mix_ducking.json +91 -0
  28. package/scripts/test/test_audio_mix_legacy.json +90 -0
  29. package/scripts/test/test_grok.json +57 -0
  30. package/scripts/test/test_image_prompt_reference.json +55 -0
  31. package/scripts/test/test_image_references.json +74 -0
  32. package/scripts/test/test_kling_v3.json +54 -0
  33. package/scripts/test/test_kling_v3_omni.json +54 -0
  34. package/scripts/test/test_lipsync2.json +48 -52
  35. package/scripts/test/test_lipsync5.json +66 -0
  36. package/scripts/test/test_runway.json +54 -0
  37. package/scripts/test/test_threejs.json +241 -0
  38. package/scripts/test/test_threejs_glb.json +154 -0
  39. package/scripts/test/test_veo31_lite.json +39 -0
@@ -3075,6 +3075,17 @@ export declare const mulmoImagePromptMediaSchema: z.ZodObject<{
3075
3075
  width: z.ZodNumber;
3076
3076
  height: z.ZodNumber;
3077
3077
  }, z.core.$strict>>;
3078
+ referenceImageName: z.ZodOptional<z.ZodString>;
3079
+ referenceImage: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
3080
+ kind: z.ZodLiteral<"url">;
3081
+ url: z.ZodURL;
3082
+ }, z.core.$strict>, z.ZodObject<{
3083
+ kind: z.ZodLiteral<"base64">;
3084
+ data: z.ZodString;
3085
+ }, z.core.$strict>, z.ZodObject<{
3086
+ kind: z.ZodLiteral<"path">;
3087
+ path: z.ZodString;
3088
+ }, z.core.$strict>], "kind">>;
3078
3089
  }, z.core.$strict>;
3079
3090
  export declare const mulmoImageParamsImagesValueSchema: z.ZodUnion<readonly [z.ZodObject<{
3080
3091
  type: z.ZodLiteral<"image">;
@@ -3095,6 +3106,17 @@ export declare const mulmoImageParamsImagesValueSchema: z.ZodUnion<readonly [z.Z
3095
3106
  width: z.ZodNumber;
3096
3107
  height: z.ZodNumber;
3097
3108
  }, z.core.$strict>>;
3109
+ referenceImageName: z.ZodOptional<z.ZodString>;
3110
+ referenceImage: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
3111
+ kind: z.ZodLiteral<"url">;
3112
+ url: z.ZodURL;
3113
+ }, z.core.$strict>, z.ZodObject<{
3114
+ kind: z.ZodLiteral<"base64">;
3115
+ data: z.ZodString;
3116
+ }, z.core.$strict>, z.ZodObject<{
3117
+ kind: z.ZodLiteral<"path">;
3118
+ path: z.ZodString;
3119
+ }, z.core.$strict>], "kind">>;
3098
3120
  }, z.core.$strict>, z.ZodObject<{
3099
3121
  type: z.ZodLiteral<"movie">;
3100
3122
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -3131,6 +3153,17 @@ export declare const mulmoImageParamsImagesSchema: z.ZodRecord<z.ZodString, z.Zo
3131
3153
  width: z.ZodNumber;
3132
3154
  height: z.ZodNumber;
3133
3155
  }, z.core.$strict>>;
3156
+ referenceImageName: z.ZodOptional<z.ZodString>;
3157
+ referenceImage: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
3158
+ kind: z.ZodLiteral<"url">;
3159
+ url: z.ZodURL;
3160
+ }, z.core.$strict>, z.ZodObject<{
3161
+ kind: z.ZodLiteral<"base64">;
3162
+ data: z.ZodString;
3163
+ }, z.core.$strict>, z.ZodObject<{
3164
+ kind: z.ZodLiteral<"path">;
3165
+ path: z.ZodString;
3166
+ }, z.core.$strict>], "kind">>;
3134
3167
  }, z.core.$strict>, z.ZodObject<{
3135
3168
  type: z.ZodLiteral<"movie">;
3136
3169
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -3219,6 +3252,17 @@ export declare const mulmoImageParamsSchema: z.ZodObject<{
3219
3252
  width: z.ZodNumber;
3220
3253
  height: z.ZodNumber;
3221
3254
  }, z.core.$strict>>;
3255
+ referenceImageName: z.ZodOptional<z.ZodString>;
3256
+ referenceImage: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
3257
+ kind: z.ZodLiteral<"url">;
3258
+ url: z.ZodURL;
3259
+ }, z.core.$strict>, z.ZodObject<{
3260
+ kind: z.ZodLiteral<"base64">;
3261
+ data: z.ZodString;
3262
+ }, z.core.$strict>, z.ZodObject<{
3263
+ kind: z.ZodLiteral<"path">;
3264
+ path: z.ZodString;
3265
+ }, z.core.$strict>], "kind">>;
3222
3266
  }, z.core.$strict>, z.ZodObject<{
3223
3267
  type: z.ZodLiteral<"movie">;
3224
3268
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -3326,7 +3370,7 @@ export declare const mulmoSlideParamsSchema: z.ZodObject<{
3326
3370
  }, z.core.$strict>;
3327
3371
  export declare const beatAudioParamsSchema: z.ZodObject<{
3328
3372
  padding: z.ZodOptional<z.ZodNumber>;
3329
- movieVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
3373
+ movieVolume: z.ZodOptional<z.ZodNumber>;
3330
3374
  }, z.core.$strict>;
3331
3375
  export declare const mulmoHtmlImageParamsSchema: z.ZodObject<{
3332
3376
  model: z.ZodOptional<z.ZodString>;
@@ -3349,6 +3393,11 @@ export declare const audioParamsSchema: z.ZodObject<{
3349
3393
  bgmVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
3350
3394
  audioVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
3351
3395
  suppressSpeech: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
3396
+ movieVolume: z.ZodOptional<z.ZodNumber>;
3397
+ ttsVolume: z.ZodOptional<z.ZodNumber>;
3398
+ ducking: z.ZodOptional<z.ZodObject<{
3399
+ ratio: z.ZodOptional<z.ZodNumber>;
3400
+ }, z.core.$strip>>;
3352
3401
  }, z.core.$strict>;
3353
3402
  export declare const htmlPromptParamsSchema: z.ZodObject<{
3354
3403
  systemPrompt: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -6292,7 +6341,7 @@ export declare const mulmoBeatSchema: z.ZodObject<{
6292
6341
  }, z.core.$strict>>;
6293
6342
  audioParams: z.ZodOptional<z.ZodObject<{
6294
6343
  padding: z.ZodOptional<z.ZodNumber>;
6295
- movieVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
6344
+ movieVolume: z.ZodOptional<z.ZodNumber>;
6296
6345
  }, z.core.$strict>>;
6297
6346
  movieParams: z.ZodOptional<z.ZodObject<{
6298
6347
  provider: z.ZodOptional<z.ZodEnum<{
@@ -6591,6 +6640,17 @@ export declare const mulmoBeatSchema: z.ZodObject<{
6591
6640
  width: z.ZodNumber;
6592
6641
  height: z.ZodNumber;
6593
6642
  }, z.core.$strict>>;
6643
+ referenceImageName: z.ZodOptional<z.ZodString>;
6644
+ referenceImage: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
6645
+ kind: z.ZodLiteral<"url">;
6646
+ url: z.ZodURL;
6647
+ }, z.core.$strict>, z.ZodObject<{
6648
+ kind: z.ZodLiteral<"base64">;
6649
+ data: z.ZodString;
6650
+ }, z.core.$strict>, z.ZodObject<{
6651
+ kind: z.ZodLiteral<"path">;
6652
+ path: z.ZodString;
6653
+ }, z.core.$strict>], "kind">>;
6594
6654
  }, z.core.$strict>, z.ZodObject<{
6595
6655
  type: z.ZodLiteral<"movie">;
6596
6656
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -6722,6 +6782,17 @@ export declare const mulmoPresentationStyleSchema: z.ZodObject<{
6722
6782
  width: z.ZodNumber;
6723
6783
  height: z.ZodNumber;
6724
6784
  }, z.core.$strict>>;
6785
+ referenceImageName: z.ZodOptional<z.ZodString>;
6786
+ referenceImage: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
6787
+ kind: z.ZodLiteral<"url">;
6788
+ url: z.ZodURL;
6789
+ }, z.core.$strict>, z.ZodObject<{
6790
+ kind: z.ZodLiteral<"base64">;
6791
+ data: z.ZodString;
6792
+ }, z.core.$strict>, z.ZodObject<{
6793
+ kind: z.ZodLiteral<"path">;
6794
+ path: z.ZodString;
6795
+ }, z.core.$strict>], "kind">>;
6725
6796
  }, z.core.$strict>, z.ZodObject<{
6726
6797
  type: z.ZodLiteral<"movie">;
6727
6798
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -7115,6 +7186,11 @@ export declare const mulmoPresentationStyleSchema: z.ZodObject<{
7115
7186
  bgmVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
7116
7187
  audioVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
7117
7188
  suppressSpeech: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
7189
+ movieVolume: z.ZodOptional<z.ZodNumber>;
7190
+ ttsVolume: z.ZodOptional<z.ZodNumber>;
7191
+ ducking: z.ZodOptional<z.ZodObject<{
7192
+ ratio: z.ZodOptional<z.ZodNumber>;
7193
+ }, z.core.$strip>>;
7118
7194
  }, z.core.$strict>>;
7119
7195
  }, z.core.$strip>;
7120
7196
  export declare const mulmoReferenceSchema: z.ZodObject<{
@@ -7207,6 +7283,17 @@ export declare const mulmoScriptSchema: z.ZodObject<{
7207
7283
  width: z.ZodNumber;
7208
7284
  height: z.ZodNumber;
7209
7285
  }, z.core.$strict>>;
7286
+ referenceImageName: z.ZodOptional<z.ZodString>;
7287
+ referenceImage: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
7288
+ kind: z.ZodLiteral<"url">;
7289
+ url: z.ZodURL;
7290
+ }, z.core.$strict>, z.ZodObject<{
7291
+ kind: z.ZodLiteral<"base64">;
7292
+ data: z.ZodString;
7293
+ }, z.core.$strict>, z.ZodObject<{
7294
+ kind: z.ZodLiteral<"path">;
7295
+ path: z.ZodString;
7296
+ }, z.core.$strict>], "kind">>;
7210
7297
  }, z.core.$strict>, z.ZodObject<{
7211
7298
  type: z.ZodLiteral<"movie">;
7212
7299
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -7600,6 +7687,11 @@ export declare const mulmoScriptSchema: z.ZodObject<{
7600
7687
  bgmVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
7601
7688
  audioVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
7602
7689
  suppressSpeech: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
7690
+ movieVolume: z.ZodOptional<z.ZodNumber>;
7691
+ ttsVolume: z.ZodOptional<z.ZodNumber>;
7692
+ ducking: z.ZodOptional<z.ZodObject<{
7693
+ ratio: z.ZodOptional<z.ZodNumber>;
7694
+ }, z.core.$strip>>;
7603
7695
  }, z.core.$strict>>;
7604
7696
  title: z.ZodOptional<z.ZodString>;
7605
7697
  description: z.ZodOptional<z.ZodString>;
@@ -10268,7 +10360,7 @@ export declare const mulmoScriptSchema: z.ZodObject<{
10268
10360
  }, z.core.$strict>>;
10269
10361
  audioParams: z.ZodOptional<z.ZodObject<{
10270
10362
  padding: z.ZodOptional<z.ZodNumber>;
10271
- movieVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
10363
+ movieVolume: z.ZodOptional<z.ZodNumber>;
10272
10364
  }, z.core.$strict>>;
10273
10365
  movieParams: z.ZodOptional<z.ZodObject<{
10274
10366
  provider: z.ZodOptional<z.ZodEnum<{
@@ -10567,6 +10659,17 @@ export declare const mulmoScriptSchema: z.ZodObject<{
10567
10659
  width: z.ZodNumber;
10568
10660
  height: z.ZodNumber;
10569
10661
  }, z.core.$strict>>;
10662
+ referenceImageName: z.ZodOptional<z.ZodString>;
10663
+ referenceImage: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
10664
+ kind: z.ZodLiteral<"url">;
10665
+ url: z.ZodURL;
10666
+ }, z.core.$strict>, z.ZodObject<{
10667
+ kind: z.ZodLiteral<"base64">;
10668
+ data: z.ZodString;
10669
+ }, z.core.$strict>, z.ZodObject<{
10670
+ kind: z.ZodLiteral<"path">;
10671
+ path: z.ZodString;
10672
+ }, z.core.$strict>], "kind">>;
10570
10673
  }, z.core.$strict>, z.ZodObject<{
10571
10674
  type: z.ZodLiteral<"movie">;
10572
10675
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -10773,6 +10876,17 @@ export declare const mulmoStudioSchema: z.ZodObject<{
10773
10876
  width: z.ZodNumber;
10774
10877
  height: z.ZodNumber;
10775
10878
  }, z.core.$strict>>;
10879
+ referenceImageName: z.ZodOptional<z.ZodString>;
10880
+ referenceImage: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
10881
+ kind: z.ZodLiteral<"url">;
10882
+ url: z.ZodURL;
10883
+ }, z.core.$strict>, z.ZodObject<{
10884
+ kind: z.ZodLiteral<"base64">;
10885
+ data: z.ZodString;
10886
+ }, z.core.$strict>, z.ZodObject<{
10887
+ kind: z.ZodLiteral<"path">;
10888
+ path: z.ZodString;
10889
+ }, z.core.$strict>], "kind">>;
10776
10890
  }, z.core.$strict>, z.ZodObject<{
10777
10891
  type: z.ZodLiteral<"movie">;
10778
10892
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -11166,6 +11280,11 @@ export declare const mulmoStudioSchema: z.ZodObject<{
11166
11280
  bgmVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
11167
11281
  audioVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
11168
11282
  suppressSpeech: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
11283
+ movieVolume: z.ZodOptional<z.ZodNumber>;
11284
+ ttsVolume: z.ZodOptional<z.ZodNumber>;
11285
+ ducking: z.ZodOptional<z.ZodObject<{
11286
+ ratio: z.ZodOptional<z.ZodNumber>;
11287
+ }, z.core.$strip>>;
11169
11288
  }, z.core.$strict>>;
11170
11289
  title: z.ZodOptional<z.ZodString>;
11171
11290
  description: z.ZodOptional<z.ZodString>;
@@ -13834,7 +13953,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
13834
13953
  }, z.core.$strict>>;
13835
13954
  audioParams: z.ZodOptional<z.ZodObject<{
13836
13955
  padding: z.ZodOptional<z.ZodNumber>;
13837
- movieVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
13956
+ movieVolume: z.ZodOptional<z.ZodNumber>;
13838
13957
  }, z.core.$strict>>;
13839
13958
  movieParams: z.ZodOptional<z.ZodObject<{
13840
13959
  provider: z.ZodOptional<z.ZodEnum<{
@@ -14133,6 +14252,17 @@ export declare const mulmoStudioSchema: z.ZodObject<{
14133
14252
  width: z.ZodNumber;
14134
14253
  height: z.ZodNumber;
14135
14254
  }, z.core.$strict>>;
14255
+ referenceImageName: z.ZodOptional<z.ZodString>;
14256
+ referenceImage: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
14257
+ kind: z.ZodLiteral<"url">;
14258
+ url: z.ZodURL;
14259
+ }, z.core.$strict>, z.ZodObject<{
14260
+ kind: z.ZodLiteral<"base64">;
14261
+ data: z.ZodString;
14262
+ }, z.core.$strict>, z.ZodObject<{
14263
+ kind: z.ZodLiteral<"path">;
14264
+ path: z.ZodString;
14265
+ }, z.core.$strict>], "kind">>;
14136
14266
  }, z.core.$strict>, z.ZodObject<{
14137
14267
  type: z.ZodLiteral<"movie">;
14138
14268
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -14275,6 +14405,17 @@ export declare const mulmoPromptTemplateSchema: z.ZodObject<{
14275
14405
  width: z.ZodNumber;
14276
14406
  height: z.ZodNumber;
14277
14407
  }, z.core.$strict>>;
14408
+ referenceImageName: z.ZodOptional<z.ZodString>;
14409
+ referenceImage: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
14410
+ kind: z.ZodLiteral<"url">;
14411
+ url: z.ZodURL;
14412
+ }, z.core.$strict>, z.ZodObject<{
14413
+ kind: z.ZodLiteral<"base64">;
14414
+ data: z.ZodString;
14415
+ }, z.core.$strict>, z.ZodObject<{
14416
+ kind: z.ZodLiteral<"path">;
14417
+ path: z.ZodString;
14418
+ }, z.core.$strict>], "kind">>;
14278
14419
  }, z.core.$strict>, z.ZodObject<{
14279
14420
  type: z.ZodLiteral<"movie">;
14280
14421
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -14668,6 +14809,11 @@ export declare const mulmoPromptTemplateSchema: z.ZodObject<{
14668
14809
  bgmVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
14669
14810
  audioVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
14670
14811
  suppressSpeech: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
14812
+ movieVolume: z.ZodOptional<z.ZodNumber>;
14813
+ ttsVolume: z.ZodOptional<z.ZodNumber>;
14814
+ ducking: z.ZodOptional<z.ZodObject<{
14815
+ ratio: z.ZodOptional<z.ZodNumber>;
14816
+ }, z.core.$strip>>;
14671
14817
  }, z.core.$strict>>;
14672
14818
  }, z.core.$strip>>;
14673
14819
  }, z.core.$strict>;
@@ -14754,6 +14900,17 @@ export declare const mulmoPromptTemplateFileSchema: z.ZodObject<{
14754
14900
  width: z.ZodNumber;
14755
14901
  height: z.ZodNumber;
14756
14902
  }, z.core.$strict>>;
14903
+ referenceImageName: z.ZodOptional<z.ZodString>;
14904
+ referenceImage: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
14905
+ kind: z.ZodLiteral<"url">;
14906
+ url: z.ZodURL;
14907
+ }, z.core.$strict>, z.ZodObject<{
14908
+ kind: z.ZodLiteral<"base64">;
14909
+ data: z.ZodString;
14910
+ }, z.core.$strict>, z.ZodObject<{
14911
+ kind: z.ZodLiteral<"path">;
14912
+ path: z.ZodString;
14913
+ }, z.core.$strict>], "kind">>;
14757
14914
  }, z.core.$strict>, z.ZodObject<{
14758
14915
  type: z.ZodLiteral<"movie">;
14759
14916
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -15147,6 +15304,11 @@ export declare const mulmoPromptTemplateFileSchema: z.ZodObject<{
15147
15304
  bgmVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
15148
15305
  audioVolume: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
15149
15306
  suppressSpeech: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
15307
+ movieVolume: z.ZodOptional<z.ZodNumber>;
15308
+ ttsVolume: z.ZodOptional<z.ZodNumber>;
15309
+ ducking: z.ZodOptional<z.ZodObject<{
15310
+ ratio: z.ZodOptional<z.ZodNumber>;
15311
+ }, z.core.$strip>>;
15150
15312
  }, z.core.$strict>>;
15151
15313
  }, z.core.$strip>>;
15152
15314
  filename: z.ZodString;
@@ -344,6 +344,8 @@ export const mulmoImagePromptMediaSchema = z
344
344
  type: z.literal("imagePrompt"),
345
345
  prompt: z.string().min(1),
346
346
  canvasSize: z.object({ width: z.number(), height: z.number() }).strict().optional(),
347
+ referenceImageName: imageIdSchema.optional().describe("Reference another imageRefs key as input for image generation"),
348
+ referenceImage: mediaSourceSchema.optional().describe("Direct source (path/url/base64) as reference image for generation"),
347
349
  })
348
350
  .strict();
349
351
  export const mulmoImageParamsImagesValueSchema = z.union([
@@ -407,7 +409,7 @@ export const mulmoSlideParamsSchema = z
407
409
  export const beatAudioParamsSchema = z
408
410
  .object({
409
411
  padding: z.number().optional().describe("Padding between beats"), // seconds
410
- movieVolume: z.number().optional().default(1.0).describe("Audio volume of the imported or generated movie"),
412
+ movieVolume: z.number().min(0).max(1).optional().describe("Audio volume of the imported or generated movie"),
411
413
  })
412
414
  .strict();
413
415
  export const mulmoHtmlImageParamsSchema = z
@@ -426,6 +428,14 @@ export const audioParamsSchema = z
426
428
  bgmVolume: z.number().optional().default(0.2).describe("Volume of the background music"),
427
429
  audioVolume: z.number().optional().default(1.0).describe("Volume of the audio"),
428
430
  suppressSpeech: z.boolean().optional().default(false).describe("Suppress speech generation"),
431
+ movieVolume: z.number().min(0).max(1).optional().describe("Default movie audio volume for all beats"),
432
+ ttsVolume: z.number().min(0).max(2).optional().describe("TTS narration volume before mixing with BGM/movie audio"),
433
+ ducking: z
434
+ .object({
435
+ ratio: z.number().min(0).max(1).optional().describe("Movie volume ratio during TTS beats (default 0.3)"),
436
+ })
437
+ .optional()
438
+ .describe("Auto-reduce movie audio when TTS is playing"),
429
439
  })
430
440
  .strict();
431
441
  export const htmlPromptParamsSchema = z
@@ -89,6 +89,17 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
89
89
  width: number;
90
90
  height: number;
91
91
  } | undefined;
92
+ referenceImageName?: string | undefined;
93
+ referenceImage?: {
94
+ kind: "url";
95
+ url: string;
96
+ } | {
97
+ kind: "base64";
98
+ data: string;
99
+ } | {
100
+ kind: "path";
101
+ path: string;
102
+ } | undefined;
92
103
  }> | undefined;
93
104
  backgroundImage?: string | {
94
105
  source: {
@@ -292,6 +303,11 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
292
303
  kind: "path";
293
304
  path: string;
294
305
  } | undefined;
306
+ movieVolume?: number | undefined;
307
+ ttsVolume?: number | undefined;
308
+ ducking?: {
309
+ ratio?: number | undefined;
310
+ } | undefined;
295
311
  };
296
312
  lang: string;
297
313
  beats: {
@@ -1835,8 +1851,8 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
1835
1851
  vertexai_location?: string | undefined;
1836
1852
  } | undefined;
1837
1853
  audioParams?: {
1838
- movieVolume: number;
1839
1854
  padding?: number | undefined;
1855
+ movieVolume?: number | undefined;
1840
1856
  } | undefined;
1841
1857
  movieParams?: {
1842
1858
  provider?: string | undefined;
@@ -2072,6 +2088,17 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
2072
2088
  width: number;
2073
2089
  height: number;
2074
2090
  } | undefined;
2091
+ referenceImageName?: string | undefined;
2092
+ referenceImage?: {
2093
+ kind: "url";
2094
+ url: string;
2095
+ } | {
2096
+ kind: "base64";
2097
+ data: string;
2098
+ } | {
2099
+ kind: "path";
2100
+ path: string;
2101
+ } | undefined;
2075
2102
  }> | undefined;
2076
2103
  imageNames?: string[] | undefined;
2077
2104
  imagePrompt?: string | undefined;
@@ -2294,6 +2321,17 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
2294
2321
  width: number;
2295
2322
  height: number;
2296
2323
  } | undefined;
2324
+ referenceImageName?: string | undefined;
2325
+ referenceImage?: {
2326
+ kind: "url";
2327
+ url: string;
2328
+ } | {
2329
+ kind: "base64";
2330
+ data: string;
2331
+ } | {
2332
+ kind: "path";
2333
+ path: string;
2334
+ } | undefined;
2297
2335
  }> | undefined;
2298
2336
  backgroundImage?: string | {
2299
2337
  source: {
@@ -2497,6 +2535,11 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
2497
2535
  kind: "path";
2498
2536
  path: string;
2499
2537
  } | undefined;
2538
+ movieVolume?: number | undefined;
2539
+ ttsVolume?: number | undefined;
2540
+ ducking?: {
2541
+ ratio?: number | undefined;
2542
+ } | undefined;
2500
2543
  };
2501
2544
  lang: string;
2502
2545
  beats: {
@@ -4040,8 +4083,8 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
4040
4083
  vertexai_location?: string | undefined;
4041
4084
  } | undefined;
4042
4085
  audioParams?: {
4043
- movieVolume: number;
4044
4086
  padding?: number | undefined;
4087
+ movieVolume?: number | undefined;
4045
4088
  } | undefined;
4046
4089
  movieParams?: {
4047
4090
  provider?: string | undefined;
@@ -4277,6 +4320,17 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
4277
4320
  width: number;
4278
4321
  height: number;
4279
4322
  } | undefined;
4323
+ referenceImageName?: string | undefined;
4324
+ referenceImage?: {
4325
+ kind: "url";
4326
+ url: string;
4327
+ } | {
4328
+ kind: "base64";
4329
+ data: string;
4330
+ } | {
4331
+ kind: "path";
4332
+ path: string;
4333
+ } | undefined;
4280
4334
  }> | undefined;
4281
4335
  imageNames?: string[] | undefined;
4282
4336
  imagePrompt?: string | undefined;
@@ -4506,6 +4560,17 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
4506
4560
  width: number;
4507
4561
  height: number;
4508
4562
  } | undefined;
4563
+ referenceImageName?: string | undefined;
4564
+ referenceImage?: {
4565
+ kind: "url";
4566
+ url: string;
4567
+ } | {
4568
+ kind: "base64";
4569
+ data: string;
4570
+ } | {
4571
+ kind: "path";
4572
+ path: string;
4573
+ } | undefined;
4509
4574
  }> | undefined;
4510
4575
  backgroundImage?: string | {
4511
4576
  source: {
@@ -4709,6 +4774,11 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
4709
4774
  kind: "path";
4710
4775
  path: string;
4711
4776
  } | undefined;
4777
+ movieVolume?: number | undefined;
4778
+ ttsVolume?: number | undefined;
4779
+ ducking?: {
4780
+ ratio?: number | undefined;
4781
+ } | undefined;
4712
4782
  };
4713
4783
  lipSyncParams?: {
4714
4784
  provider?: string | undefined;
@@ -15,6 +15,11 @@ export declare const resolveMovieRefs: (html: string, movieRefs: Record<string,
15
15
  * Paths starting with http://, https://, file://, data:, image:, or / are left unchanged.
16
16
  */
17
17
  export declare const resolveRelativeImagePaths: (html: string, baseDirPath: string) => string;
18
+ /**
19
+ * Resolve relative modelUrl assignment in user scripts to file:// absolute paths.
20
+ * e.g. const modelUrl = "models/a.glb" -> const modelUrl = "file:///abs/models/a.glb"
21
+ */
22
+ export declare const resolveRelativeModelPathsInScript: (html: string, baseDirPath: string) => string;
18
23
  export declare const process: (params: ImageProcessorParams) => Promise<string | undefined>;
19
24
  export declare const path: (params: ImageProcessorParams) => string;
20
25
  export declare const html: (params: ImageProcessorParams) => Promise<string | undefined>;
@@ -38,8 +38,16 @@ export const resolveMovieRefs = (html, movieRefs) => {
38
38
  * Paths starting with http://, https://, file://, data:, image:, or / are left unchanged.
39
39
  */
40
40
  export const resolveRelativeImagePaths = (html, baseDirPath) => {
41
- return html.replace(/(\bsrc\s*=\s*)(["'])((?!https?:\/\/|file:\/\/|data:|image:|\/)[^"']+)\2/gi, (_, prefix, quote, relativePath) => {
42
- const absolutePath = nodePath.resolve(baseDirPath, relativePath);
41
+ return html.replace(/(\bsrc\s*=\s*)(["'])([^"']+)\2/gi, (_, prefix, quote, pathValue) => {
42
+ const isAbsoluteLike = pathValue.startsWith("http://") ||
43
+ pathValue.startsWith("https://") ||
44
+ pathValue.startsWith("file://") ||
45
+ pathValue.startsWith("data:") ||
46
+ pathValue.startsWith("image:") ||
47
+ pathValue.startsWith("/");
48
+ if (isAbsoluteLike)
49
+ return `${prefix}${quote}${pathValue}${quote}`;
50
+ const absolutePath = nodePath.resolve(baseDirPath, pathValue);
43
51
  return `${prefix}${quote}file://${absolutePath}${quote}`;
44
52
  });
45
53
  };
@@ -52,7 +60,48 @@ const buildUserScript = (script) => {
52
60
  if (!script)
53
61
  return "";
54
62
  const code = Array.isArray(script) ? script.join("\n") : script;
55
- return `<script>\n${code}\n</script>`;
63
+ // If user script contains ESM import/export, emit module script so imports work.
64
+ const isModule = code.split("\n").some((line) => {
65
+ const trimmed = line.trimStart();
66
+ return trimmed.startsWith("import ") || trimmed.startsWith("export ");
67
+ });
68
+ return isModule ? `<script type="module">\n${code}\n</script>` : `<script>\n${code}\n</script>`;
69
+ };
70
+ /**
71
+ * Resolve relative modelUrl assignment in user scripts to file:// absolute paths.
72
+ * e.g. const modelUrl = "models/a.glb" -> const modelUrl = "file:///abs/models/a.glb"
73
+ */
74
+ export const resolveRelativeModelPathsInScript = (html, baseDirPath) => {
75
+ const lines = html.split("\n");
76
+ return lines
77
+ .map((line) => {
78
+ const hasModelDeclaration = line.includes("modelUrl") && (line.includes("const ") || line.includes("let ") || line.includes("var "));
79
+ if (!hasModelDeclaration || !line.includes("="))
80
+ return line;
81
+ const eqIndex = line.indexOf("=");
82
+ const afterEq = line.slice(eqIndex + 1);
83
+ const singleQuoteIndex = afterEq.indexOf("'");
84
+ const doubleQuoteIndex = afterEq.indexOf('"');
85
+ const quoteIndex = singleQuoteIndex >= 0 && (doubleQuoteIndex < 0 || singleQuoteIndex < doubleQuoteIndex) ? singleQuoteIndex : doubleQuoteIndex;
86
+ if (quoteIndex < 0)
87
+ return line;
88
+ const quoteChar = afterEq[quoteIndex];
89
+ const start = eqIndex + 1 + quoteIndex;
90
+ const end = line.indexOf(quoteChar, start + 1);
91
+ if (end < 0)
92
+ return line;
93
+ const rawPath = line.slice(start + 1, end);
94
+ const isAbsoluteLike = rawPath.startsWith("http://") ||
95
+ rawPath.startsWith("https://") ||
96
+ rawPath.startsWith("file://") ||
97
+ rawPath.startsWith("data:") ||
98
+ rawPath.startsWith("/");
99
+ if (isAbsoluteLike)
100
+ return line;
101
+ const absolutePath = nodePath.resolve(baseDirPath, rawPath);
102
+ return `${line.slice(0, start + 1)}file://${absolutePath}${line.slice(end)}`;
103
+ })
104
+ .join("\n");
56
105
  };
57
106
  /**
58
107
  * Resolve HTML and script from beat image data.
@@ -106,7 +155,8 @@ const buildAnimatedHtml = (params, totalFrames, fps) => {
106
155
  });
107
156
  const resolvedImageRefs = resolveImageRefs(rawHtmlData, params.imageRefs ?? {});
108
157
  const resolvedAllRefs = resolveMovieRefs(resolvedImageRefs, params.movieRefs ?? {});
109
- return resolveRelativeImagePaths(resolvedAllRefs, context.fileDirs.mulmoFileDirPath);
158
+ const resolvedImages = resolveRelativeImagePaths(resolvedAllRefs, context.fileDirs.mulmoFileDirPath);
159
+ return resolveRelativeModelPathsInScript(resolvedImages, context.fileDirs.mulmoFileDirPath);
110
160
  };
111
161
  const processHtmlTailwindAnimated = async (params) => {
112
162
  const { beat, imagePath, canvasSize } = params;
@@ -163,7 +213,8 @@ const processHtmlTailwindStatic = async (params) => {
163
213
  });
164
214
  const resolvedImageRefs = resolveImageRefs(rawHtmlData, params.imageRefs ?? {});
165
215
  const resolvedAllRefs = resolveMovieRefs(resolvedImageRefs, params.movieRefs ?? {});
166
- const htmlData = resolveRelativeImagePaths(resolvedAllRefs, context.fileDirs.mulmoFileDirPath);
216
+ const resolvedImages = resolveRelativeImagePaths(resolvedAllRefs, context.fileDirs.mulmoFileDirPath);
217
+ const htmlData = resolveRelativeModelPathsInScript(resolvedImages, context.fileDirs.mulmoFileDirPath);
167
218
  await renderHTMLToImage(htmlData, imagePath, canvasSize.width, canvasSize.height);
168
219
  return imagePath;
169
220
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mulmocast",
3
- "version": "2.6.4",
3
+ "version": "2.6.6",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "lib/index.node.js",
@@ -88,7 +88,7 @@
88
88
  "homepage": "https://github.com/receptron/mulmocast-cli#readme",
89
89
  "dependencies": {
90
90
  "@google-cloud/text-to-speech": "^6.4.0",
91
- "@google/genai": "^1.45.0",
91
+ "@google/genai": "^1.48.0",
92
92
  "@graphai/anthropic_agent": "^2.0.12",
93
93
  "@graphai/browserless_agent": "^2.0.2",
94
94
  "@graphai/gemini_agent": "^2.0.5",
@@ -100,21 +100,21 @@
100
100
  "@graphai/vanilla_node_agents": "^2.0.4",
101
101
  "@inquirer/input": "^5.0.10",
102
102
  "@inquirer/select": "^5.1.2",
103
- "@modelcontextprotocol/sdk": "^1.27.1",
103
+ "@modelcontextprotocol/sdk": "^1.29.0",
104
104
  "@mozilla/readability": "^0.6.0",
105
105
  "@tavily/core": "^0.5.11",
106
106
  "archiver": "^7.0.1",
107
107
  "clipboardy": "^5.3.1",
108
- "dotenv": "^17.3.1",
108
+ "dotenv": "^17.4.0",
109
109
  "fluent-ffmpeg": "^2.1.3",
110
110
  "graphai": "^2.0.16",
111
- "jsdom": "^29.0.0",
112
- "marked": "^17.0.4",
111
+ "jsdom": "^29.0.1",
112
+ "marked": "^17.0.5",
113
113
  "mulmocast-vision": "^1.0.9",
114
114
  "ora": "^9.3.0",
115
- "puppeteer": "^24.39.1",
115
+ "puppeteer": "^24.40.0",
116
116
  "replicate": "^1.4.0",
117
- "yaml": "^2.8.2",
117
+ "yaml": "^2.8.3",
118
118
  "yargs": "^18.0.0",
119
119
  "zod": "^4.3.6"
120
120
  },
@@ -123,18 +123,19 @@
123
123
  "@receptron/test_utils": "^2.0.3",
124
124
  "@types/archiver": "^7.0.0",
125
125
  "@types/fluent-ffmpeg": "^2.1.28",
126
- "@types/jsdom": "^28.0.0",
126
+ "@types/jsdom": "^28.0.1",
127
127
  "@types/yargs": "^17.0.35",
128
128
  "cross-env": "^10.1.0",
129
- "eslint": "^10.0.3",
129
+ "eslint": "^10.1.0",
130
130
  "eslint-config-prettier": "^10.1.8",
131
+ "eslint-plugin-import": "^2.32.0",
131
132
  "eslint-plugin-prettier": "^5.5.5",
132
133
  "eslint-plugin-sonarjs": "^4.0.2",
133
134
  "globals": "^17.4.0",
134
135
  "prettier": "^3.8.1",
135
136
  "tsx": "^4.21.0",
136
- "typescript": "6.0.1-rc",
137
- "typescript-eslint": "^8.57.1"
137
+ "typescript": "6.0.2",
138
+ "typescript-eslint": "^8.58.0"
138
139
  },
139
140
  "engines": {
140
141
  "node": ">=22.0.0"