mulmocast 1.2.39 → 1.2.41

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.
@@ -288,8 +288,8 @@ export const audio = async (context, args) => {
288
288
  writingMessage(audioArtifactFilePath);
289
289
  return result.combineFiles;
290
290
  }
291
- catch (__error) {
291
+ catch (error) {
292
292
  MulmoStudioContextMethods.setSessionState(context, "audio", false, false);
293
- throw __error;
293
+ throw error;
294
294
  }
295
295
  };
@@ -8,4 +8,4 @@ export declare const getAudioPart: (inputIndex: number, duration: number, delay:
8
8
  audioPart: string;
9
9
  };
10
10
  export declare const movieFilePath: (context: MulmoStudioContext) => string;
11
- export declare const movie: (context: MulmoStudioContext) => Promise<void>;
11
+ export declare const movie: (context: MulmoStudioContext) => Promise<boolean>;
@@ -252,8 +252,10 @@ export const movie = async (context) => {
252
252
  writingMessage(outputVideoPath);
253
253
  }
254
254
  MulmoStudioContextMethods.setSessionState(context, "video", false, true);
255
+ return true;
255
256
  }
256
- catch (__error) {
257
+ catch (error) {
257
258
  MulmoStudioContextMethods.setSessionState(context, "video", false, false);
259
+ throw error;
258
260
  }
259
261
  };
@@ -41,7 +41,7 @@ export const MulmoPresentationStyleMethods = {
41
41
  return [...defaultTextSlideStyles, ...[styles], ...[extraStyles]].flat().join("\n");
42
42
  },
43
43
  getDefaultSpeaker(presentationStyle) {
44
- const speakers = presentationStyle.speechParams.speakers ?? {};
44
+ const speakers = presentationStyle?.speechParams?.speakers ?? {};
45
45
  const keys = Object.keys(speakers).sort();
46
46
  userAssert(keys.length !== 0, "presentationStyle.speechParams.speakers is not set!!");
47
47
  const defaultSpeaker = keys.find((key) => speakers[key].isDefault);
@@ -57,7 +57,7 @@ export const MulmoPresentationStyleMethods = {
57
57
  userAssert(!!speaker, `speaker is not set: speaker "${speakerId}"`);
58
58
  // Check if the speaker has a language-specific version.
59
59
  // Normally, lang is determined by the context, but lang may be specified when using the API.
60
- const lang = targetLang ?? context.lang ?? context.studio.script.lang;
60
+ const lang = targetLang ?? context.lang ?? context?.studio?.script?.lang;
61
61
  if (speaker.lang && lang && speaker.lang[lang]) {
62
62
  return speaker.lang[lang];
63
63
  }
@@ -3,7 +3,8 @@
3
3
  * (No Node.js built-ins like fs, path, dotenv, etc.)
4
4
  * Works in both Node.js and modern browsers.
5
5
  */
6
- import { BeatSessionType, MulmoStudioContext, SessionProgressCallback, SessionType, MulmoBeat } from "../types/index.js";
6
+ import { BeatSessionType, MulmoStudioContext, SessionProgressCallback, SessionType, MulmoBeat, SpeechOptions } from "../types/index.js";
7
+ import { provider2TTSAgent } from "../utils/provider2agent.js";
7
8
  export declare const addSessionProgressCallback: (cb: SessionProgressCallback) => void;
8
9
  export declare const removeSessionProgressCallback: (cb: SessionProgressCallback) => void;
9
10
  export declare const MulmoStudioContextMethods: {
@@ -18,12 +19,9 @@ export declare const MulmoStudioContextMethods: {
18
19
  needTranslate(context: MulmoStudioContext, includeCaption?: boolean): boolean | "" | undefined;
19
20
  getIntroPadding(context: MulmoStudioContext): number;
20
21
  getAudioParam(context: MulmoStudioContext, beat: MulmoBeat, lang?: string): {
22
+ provider: keyof typeof provider2TTSAgent;
21
23
  voiceId: string;
22
- provider: "google" | "mock" | "nijivoice" | "openai" | "elevenlabs";
23
- speechOptions: {
24
- speed?: number | undefined;
25
- instruction?: string | undefined;
26
- };
27
- model: string | undefined;
24
+ model?: string;
25
+ speechOptions: SpeechOptions;
28
26
  };
29
27
  };
@@ -3,7 +3,7 @@
3
3
  * (No Node.js built-ins like fs, path, dotenv, etc.)
4
4
  * Works in both Node.js and modern browsers.
5
5
  */
6
- import { text2SpeechProviderSchema } from "../types/index.js";
6
+ import { text2SpeechProviderSchema, } from "../types/index.js";
7
7
  import { beatId } from "../utils/utils.js";
8
8
  import { GraphAILogger } from "graphai";
9
9
  import { MulmoPresentationStyleMethods } from "./mulmo_presentation_style.js";
@@ -1127,12 +1127,32 @@ export declare const mulmoGoogleImageModelSchema: z.ZodObject<{
1127
1127
  provider: "google";
1128
1128
  model?: string | undefined;
1129
1129
  }>;
1130
+ export declare const mulmoBeatImageParamsSchema: z.ZodObject<{
1131
+ provider: z.ZodOptional<z.ZodEnum<[string, ...string[]]>>;
1132
+ model: z.ZodOptional<z.ZodString>;
1133
+ quality: z.ZodOptional<z.ZodString>;
1134
+ style: z.ZodOptional<z.ZodString>;
1135
+ moderation: z.ZodOptional<z.ZodString>;
1136
+ }, "strict", z.ZodTypeAny, {
1137
+ provider?: string | undefined;
1138
+ model?: string | undefined;
1139
+ style?: string | undefined;
1140
+ quality?: string | undefined;
1141
+ moderation?: string | undefined;
1142
+ }, {
1143
+ provider?: string | undefined;
1144
+ model?: string | undefined;
1145
+ style?: string | undefined;
1146
+ quality?: string | undefined;
1147
+ moderation?: string | undefined;
1148
+ }>;
1130
1149
  export declare const mulmoImageParamsSchema: z.ZodObject<{
1131
1150
  provider: z.ZodOptional<z.ZodEnum<[string, ...string[]]>>;
1132
1151
  model: z.ZodOptional<z.ZodString>;
1133
1152
  quality: z.ZodOptional<z.ZodString>;
1134
1153
  style: z.ZodOptional<z.ZodString>;
1135
1154
  moderation: z.ZodOptional<z.ZodString>;
1155
+ } & {
1136
1156
  images: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
1137
1157
  type: z.ZodLiteral<"image">;
1138
1158
  source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
@@ -1954,130 +1974,13 @@ export declare const mulmoBeatSchema: z.ZodObject<{
1954
1974
  quality: z.ZodOptional<z.ZodString>;
1955
1975
  style: z.ZodOptional<z.ZodString>;
1956
1976
  moderation: z.ZodOptional<z.ZodString>;
1957
- images: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
1958
- type: z.ZodLiteral<"image">;
1959
- source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1960
- kind: z.ZodLiteral<"url">;
1961
- url: z.ZodString;
1962
- }, "strict", z.ZodTypeAny, {
1963
- url: string;
1964
- kind: "url";
1965
- }, {
1966
- url: string;
1967
- kind: "url";
1968
- }>, z.ZodObject<{
1969
- kind: z.ZodLiteral<"base64">;
1970
- data: z.ZodString;
1971
- }, "strict", z.ZodTypeAny, {
1972
- kind: "base64";
1973
- data: string;
1974
- }, {
1975
- kind: "base64";
1976
- data: string;
1977
- }>, z.ZodObject<{
1978
- kind: z.ZodLiteral<"text">;
1979
- text: z.ZodString;
1980
- }, "strict", z.ZodTypeAny, {
1981
- text: string;
1982
- kind: "text";
1983
- }, {
1984
- text: string;
1985
- kind: "text";
1986
- }>, z.ZodObject<{
1987
- kind: z.ZodLiteral<"path">;
1988
- path: z.ZodString;
1989
- }, "strict", z.ZodTypeAny, {
1990
- path: string;
1991
- kind: "path";
1992
- }, {
1993
- path: string;
1994
- kind: "path";
1995
- }>]>;
1996
- }, "strict", z.ZodTypeAny, {
1997
- type: "image";
1998
- source: {
1999
- url: string;
2000
- kind: "url";
2001
- } | {
2002
- kind: "base64";
2003
- data: string;
2004
- } | {
2005
- text: string;
2006
- kind: "text";
2007
- } | {
2008
- path: string;
2009
- kind: "path";
2010
- };
2011
- }, {
2012
- type: "image";
2013
- source: {
2014
- url: string;
2015
- kind: "url";
2016
- } | {
2017
- kind: "base64";
2018
- data: string;
2019
- } | {
2020
- text: string;
2021
- kind: "text";
2022
- } | {
2023
- path: string;
2024
- kind: "path";
2025
- };
2026
- }>, z.ZodObject<{
2027
- type: z.ZodLiteral<"imagePrompt">;
2028
- prompt: z.ZodString;
2029
- }, "strict", z.ZodTypeAny, {
2030
- type: "imagePrompt";
2031
- prompt: string;
2032
- }, {
2033
- type: "imagePrompt";
2034
- prompt: string;
2035
- }>]>>>;
2036
1977
  }, "strict", z.ZodTypeAny, {
2037
- images?: Record<string, {
2038
- type: "image";
2039
- source: {
2040
- url: string;
2041
- kind: "url";
2042
- } | {
2043
- kind: "base64";
2044
- data: string;
2045
- } | {
2046
- text: string;
2047
- kind: "text";
2048
- } | {
2049
- path: string;
2050
- kind: "path";
2051
- };
2052
- } | {
2053
- type: "imagePrompt";
2054
- prompt: string;
2055
- }> | undefined;
2056
1978
  provider?: string | undefined;
2057
1979
  model?: string | undefined;
2058
1980
  style?: string | undefined;
2059
1981
  quality?: string | undefined;
2060
1982
  moderation?: string | undefined;
2061
1983
  }, {
2062
- images?: Record<string, {
2063
- type: "image";
2064
- source: {
2065
- url: string;
2066
- kind: "url";
2067
- } | {
2068
- kind: "base64";
2069
- data: string;
2070
- } | {
2071
- text: string;
2072
- kind: "text";
2073
- } | {
2074
- path: string;
2075
- kind: "path";
2076
- };
2077
- } | {
2078
- type: "imagePrompt";
2079
- prompt: string;
2080
- }> | undefined;
2081
1984
  provider?: string | undefined;
2082
1985
  model?: string | undefined;
2083
1986
  style?: string | undefined;
@@ -2334,25 +2237,6 @@ export declare const mulmoBeatSchema: z.ZodObject<{
2334
2237
  speaker?: string | undefined;
2335
2238
  description?: string | undefined;
2336
2239
  imageParams?: {
2337
- images?: Record<string, {
2338
- type: "image";
2339
- source: {
2340
- url: string;
2341
- kind: "url";
2342
- } | {
2343
- kind: "base64";
2344
- data: string;
2345
- } | {
2346
- text: string;
2347
- kind: "text";
2348
- } | {
2349
- path: string;
2350
- kind: "path";
2351
- };
2352
- } | {
2353
- type: "imagePrompt";
2354
- prompt: string;
2355
- }> | undefined;
2356
2240
  provider?: string | undefined;
2357
2241
  model?: string | undefined;
2358
2242
  style?: string | undefined;
@@ -2538,25 +2422,6 @@ export declare const mulmoBeatSchema: z.ZodObject<{
2538
2422
  speaker?: string | undefined;
2539
2423
  description?: string | undefined;
2540
2424
  imageParams?: {
2541
- images?: Record<string, {
2542
- type: "image";
2543
- source: {
2544
- url: string;
2545
- kind: "url";
2546
- } | {
2547
- kind: "base64";
2548
- data: string;
2549
- } | {
2550
- text: string;
2551
- kind: "text";
2552
- } | {
2553
- path: string;
2554
- kind: "path";
2555
- };
2556
- } | {
2557
- type: "imagePrompt";
2558
- prompt: string;
2559
- }> | undefined;
2560
2425
  provider?: string | undefined;
2561
2426
  model?: string | undefined;
2562
2427
  style?: string | undefined;
@@ -2696,6 +2561,7 @@ export declare const mulmoMovieParamsSchema: z.ZodObject<{
2696
2561
  duration?: number | undefined;
2697
2562
  } | undefined;
2698
2563
  }>;
2564
+ export declare const defaultSpeaker = "Presenter";
2699
2565
  export declare const mulmoPresentationStyleSchema: z.ZodObject<{
2700
2566
  $mulmocast: z.ZodObject<{
2701
2567
  version: z.ZodLiteral<"1.1">;
@@ -2868,6 +2734,7 @@ export declare const mulmoPresentationStyleSchema: z.ZodObject<{
2868
2734
  quality: z.ZodOptional<z.ZodString>;
2869
2735
  style: z.ZodOptional<z.ZodString>;
2870
2736
  moderation: z.ZodOptional<z.ZodString>;
2737
+ } & {
2871
2738
  images: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
2872
2739
  type: z.ZodLiteral<"image">;
2873
2740
  source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
@@ -3586,6 +3453,7 @@ export declare const mulmoScriptSchema: z.ZodObject<{
3586
3453
  quality: z.ZodOptional<z.ZodString>;
3587
3454
  style: z.ZodOptional<z.ZodString>;
3588
3455
  moderation: z.ZodOptional<z.ZodString>;
3456
+ } & {
3589
3457
  images: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
3590
3458
  type: z.ZodLiteral<"image">;
3591
3459
  source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
@@ -4454,130 +4322,13 @@ export declare const mulmoScriptSchema: z.ZodObject<{
4454
4322
  quality: z.ZodOptional<z.ZodString>;
4455
4323
  style: z.ZodOptional<z.ZodString>;
4456
4324
  moderation: z.ZodOptional<z.ZodString>;
4457
- images: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
4458
- type: z.ZodLiteral<"image">;
4459
- source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
4460
- kind: z.ZodLiteral<"url">;
4461
- url: z.ZodString;
4462
- }, "strict", z.ZodTypeAny, {
4463
- url: string;
4464
- kind: "url";
4465
- }, {
4466
- url: string;
4467
- kind: "url";
4468
- }>, z.ZodObject<{
4469
- kind: z.ZodLiteral<"base64">;
4470
- data: z.ZodString;
4471
- }, "strict", z.ZodTypeAny, {
4472
- kind: "base64";
4473
- data: string;
4474
- }, {
4475
- kind: "base64";
4476
- data: string;
4477
- }>, z.ZodObject<{
4478
- kind: z.ZodLiteral<"text">;
4479
- text: z.ZodString;
4480
- }, "strict", z.ZodTypeAny, {
4481
- text: string;
4482
- kind: "text";
4483
- }, {
4484
- text: string;
4485
- kind: "text";
4486
- }>, z.ZodObject<{
4487
- kind: z.ZodLiteral<"path">;
4488
- path: z.ZodString;
4489
- }, "strict", z.ZodTypeAny, {
4490
- path: string;
4491
- kind: "path";
4492
- }, {
4493
- path: string;
4494
- kind: "path";
4495
- }>]>;
4496
- }, "strict", z.ZodTypeAny, {
4497
- type: "image";
4498
- source: {
4499
- url: string;
4500
- kind: "url";
4501
- } | {
4502
- kind: "base64";
4503
- data: string;
4504
- } | {
4505
- text: string;
4506
- kind: "text";
4507
- } | {
4508
- path: string;
4509
- kind: "path";
4510
- };
4511
- }, {
4512
- type: "image";
4513
- source: {
4514
- url: string;
4515
- kind: "url";
4516
- } | {
4517
- kind: "base64";
4518
- data: string;
4519
- } | {
4520
- text: string;
4521
- kind: "text";
4522
- } | {
4523
- path: string;
4524
- kind: "path";
4525
- };
4526
- }>, z.ZodObject<{
4527
- type: z.ZodLiteral<"imagePrompt">;
4528
- prompt: z.ZodString;
4529
- }, "strict", z.ZodTypeAny, {
4530
- type: "imagePrompt";
4531
- prompt: string;
4532
- }, {
4533
- type: "imagePrompt";
4534
- prompt: string;
4535
- }>]>>>;
4536
4325
  }, "strict", z.ZodTypeAny, {
4537
- images?: Record<string, {
4538
- type: "image";
4539
- source: {
4540
- url: string;
4541
- kind: "url";
4542
- } | {
4543
- kind: "base64";
4544
- data: string;
4545
- } | {
4546
- text: string;
4547
- kind: "text";
4548
- } | {
4549
- path: string;
4550
- kind: "path";
4551
- };
4552
- } | {
4553
- type: "imagePrompt";
4554
- prompt: string;
4555
- }> | undefined;
4556
4326
  provider?: string | undefined;
4557
4327
  model?: string | undefined;
4558
4328
  style?: string | undefined;
4559
4329
  quality?: string | undefined;
4560
4330
  moderation?: string | undefined;
4561
4331
  }, {
4562
- images?: Record<string, {
4563
- type: "image";
4564
- source: {
4565
- url: string;
4566
- kind: "url";
4567
- } | {
4568
- kind: "base64";
4569
- data: string;
4570
- } | {
4571
- text: string;
4572
- kind: "text";
4573
- } | {
4574
- path: string;
4575
- kind: "path";
4576
- };
4577
- } | {
4578
- type: "imagePrompt";
4579
- prompt: string;
4580
- }> | undefined;
4581
4332
  provider?: string | undefined;
4582
4333
  model?: string | undefined;
4583
4334
  style?: string | undefined;
@@ -4834,25 +4585,6 @@ export declare const mulmoScriptSchema: z.ZodObject<{
4834
4585
  speaker?: string | undefined;
4835
4586
  description?: string | undefined;
4836
4587
  imageParams?: {
4837
- images?: Record<string, {
4838
- type: "image";
4839
- source: {
4840
- url: string;
4841
- kind: "url";
4842
- } | {
4843
- kind: "base64";
4844
- data: string;
4845
- } | {
4846
- text: string;
4847
- kind: "text";
4848
- } | {
4849
- path: string;
4850
- kind: "path";
4851
- };
4852
- } | {
4853
- type: "imagePrompt";
4854
- prompt: string;
4855
- }> | undefined;
4856
4588
  provider?: string | undefined;
4857
4589
  model?: string | undefined;
4858
4590
  style?: string | undefined;
@@ -5038,25 +4770,6 @@ export declare const mulmoScriptSchema: z.ZodObject<{
5038
4770
  speaker?: string | undefined;
5039
4771
  description?: string | undefined;
5040
4772
  imageParams?: {
5041
- images?: Record<string, {
5042
- type: "image";
5043
- source: {
5044
- url: string;
5045
- kind: "url";
5046
- } | {
5047
- kind: "base64";
5048
- data: string;
5049
- } | {
5050
- text: string;
5051
- kind: "text";
5052
- } | {
5053
- path: string;
5054
- kind: "path";
5055
- };
5056
- } | {
5057
- type: "imagePrompt";
5058
- prompt: string;
5059
- }> | undefined;
5060
4773
  provider?: string | undefined;
5061
4774
  model?: string | undefined;
5062
4775
  style?: string | undefined;
@@ -5331,25 +5044,6 @@ export declare const mulmoScriptSchema: z.ZodObject<{
5331
5044
  speaker?: string | undefined;
5332
5045
  description?: string | undefined;
5333
5046
  imageParams?: {
5334
- images?: Record<string, {
5335
- type: "image";
5336
- source: {
5337
- url: string;
5338
- kind: "url";
5339
- } | {
5340
- kind: "base64";
5341
- data: string;
5342
- } | {
5343
- text: string;
5344
- kind: "text";
5345
- } | {
5346
- path: string;
5347
- kind: "path";
5348
- };
5349
- } | {
5350
- type: "imagePrompt";
5351
- prompt: string;
5352
- }> | undefined;
5353
5047
  provider?: string | undefined;
5354
5048
  model?: string | undefined;
5355
5049
  style?: string | undefined;
@@ -5578,25 +5272,6 @@ export declare const mulmoScriptSchema: z.ZodObject<{
5578
5272
  speaker?: string | undefined;
5579
5273
  description?: string | undefined;
5580
5274
  imageParams?: {
5581
- images?: Record<string, {
5582
- type: "image";
5583
- source: {
5584
- url: string;
5585
- kind: "url";
5586
- } | {
5587
- kind: "base64";
5588
- data: string;
5589
- } | {
5590
- text: string;
5591
- kind: "text";
5592
- } | {
5593
- path: string;
5594
- kind: "path";
5595
- };
5596
- } | {
5597
- type: "imagePrompt";
5598
- prompt: string;
5599
- }> | undefined;
5600
5275
  provider?: string | undefined;
5601
5276
  model?: string | undefined;
5602
5277
  style?: string | undefined;
@@ -6303,6 +5978,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
6303
5978
  quality: z.ZodOptional<z.ZodString>;
6304
5979
  style: z.ZodOptional<z.ZodString>;
6305
5980
  moderation: z.ZodOptional<z.ZodString>;
5981
+ } & {
6306
5982
  images: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
6307
5983
  type: z.ZodLiteral<"image">;
6308
5984
  source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
@@ -7171,130 +6847,13 @@ export declare const mulmoStudioSchema: z.ZodObject<{
7171
6847
  quality: z.ZodOptional<z.ZodString>;
7172
6848
  style: z.ZodOptional<z.ZodString>;
7173
6849
  moderation: z.ZodOptional<z.ZodString>;
7174
- images: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
7175
- type: z.ZodLiteral<"image">;
7176
- source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
7177
- kind: z.ZodLiteral<"url">;
7178
- url: z.ZodString;
7179
- }, "strict", z.ZodTypeAny, {
7180
- url: string;
7181
- kind: "url";
7182
- }, {
7183
- url: string;
7184
- kind: "url";
7185
- }>, z.ZodObject<{
7186
- kind: z.ZodLiteral<"base64">;
7187
- data: z.ZodString;
7188
- }, "strict", z.ZodTypeAny, {
7189
- kind: "base64";
7190
- data: string;
7191
- }, {
7192
- kind: "base64";
7193
- data: string;
7194
- }>, z.ZodObject<{
7195
- kind: z.ZodLiteral<"text">;
7196
- text: z.ZodString;
7197
- }, "strict", z.ZodTypeAny, {
7198
- text: string;
7199
- kind: "text";
7200
- }, {
7201
- text: string;
7202
- kind: "text";
7203
- }>, z.ZodObject<{
7204
- kind: z.ZodLiteral<"path">;
7205
- path: z.ZodString;
7206
- }, "strict", z.ZodTypeAny, {
7207
- path: string;
7208
- kind: "path";
7209
- }, {
7210
- path: string;
7211
- kind: "path";
7212
- }>]>;
7213
- }, "strict", z.ZodTypeAny, {
7214
- type: "image";
7215
- source: {
7216
- url: string;
7217
- kind: "url";
7218
- } | {
7219
- kind: "base64";
7220
- data: string;
7221
- } | {
7222
- text: string;
7223
- kind: "text";
7224
- } | {
7225
- path: string;
7226
- kind: "path";
7227
- };
7228
- }, {
7229
- type: "image";
7230
- source: {
7231
- url: string;
7232
- kind: "url";
7233
- } | {
7234
- kind: "base64";
7235
- data: string;
7236
- } | {
7237
- text: string;
7238
- kind: "text";
7239
- } | {
7240
- path: string;
7241
- kind: "path";
7242
- };
7243
- }>, z.ZodObject<{
7244
- type: z.ZodLiteral<"imagePrompt">;
7245
- prompt: z.ZodString;
7246
- }, "strict", z.ZodTypeAny, {
7247
- type: "imagePrompt";
7248
- prompt: string;
7249
- }, {
7250
- type: "imagePrompt";
7251
- prompt: string;
7252
- }>]>>>;
7253
6850
  }, "strict", z.ZodTypeAny, {
7254
- images?: Record<string, {
7255
- type: "image";
7256
- source: {
7257
- url: string;
7258
- kind: "url";
7259
- } | {
7260
- kind: "base64";
7261
- data: string;
7262
- } | {
7263
- text: string;
7264
- kind: "text";
7265
- } | {
7266
- path: string;
7267
- kind: "path";
7268
- };
7269
- } | {
7270
- type: "imagePrompt";
7271
- prompt: string;
7272
- }> | undefined;
7273
6851
  provider?: string | undefined;
7274
6852
  model?: string | undefined;
7275
6853
  style?: string | undefined;
7276
6854
  quality?: string | undefined;
7277
6855
  moderation?: string | undefined;
7278
6856
  }, {
7279
- images?: Record<string, {
7280
- type: "image";
7281
- source: {
7282
- url: string;
7283
- kind: "url";
7284
- } | {
7285
- kind: "base64";
7286
- data: string;
7287
- } | {
7288
- text: string;
7289
- kind: "text";
7290
- } | {
7291
- path: string;
7292
- kind: "path";
7293
- };
7294
- } | {
7295
- type: "imagePrompt";
7296
- prompt: string;
7297
- }> | undefined;
7298
6857
  provider?: string | undefined;
7299
6858
  model?: string | undefined;
7300
6859
  style?: string | undefined;
@@ -7551,25 +7110,6 @@ export declare const mulmoStudioSchema: z.ZodObject<{
7551
7110
  speaker?: string | undefined;
7552
7111
  description?: string | undefined;
7553
7112
  imageParams?: {
7554
- images?: Record<string, {
7555
- type: "image";
7556
- source: {
7557
- url: string;
7558
- kind: "url";
7559
- } | {
7560
- kind: "base64";
7561
- data: string;
7562
- } | {
7563
- text: string;
7564
- kind: "text";
7565
- } | {
7566
- path: string;
7567
- kind: "path";
7568
- };
7569
- } | {
7570
- type: "imagePrompt";
7571
- prompt: string;
7572
- }> | undefined;
7573
7113
  provider?: string | undefined;
7574
7114
  model?: string | undefined;
7575
7115
  style?: string | undefined;
@@ -7755,25 +7295,6 @@ export declare const mulmoStudioSchema: z.ZodObject<{
7755
7295
  speaker?: string | undefined;
7756
7296
  description?: string | undefined;
7757
7297
  imageParams?: {
7758
- images?: Record<string, {
7759
- type: "image";
7760
- source: {
7761
- url: string;
7762
- kind: "url";
7763
- } | {
7764
- kind: "base64";
7765
- data: string;
7766
- } | {
7767
- text: string;
7768
- kind: "text";
7769
- } | {
7770
- path: string;
7771
- kind: "path";
7772
- };
7773
- } | {
7774
- type: "imagePrompt";
7775
- prompt: string;
7776
- }> | undefined;
7777
7298
  provider?: string | undefined;
7778
7299
  model?: string | undefined;
7779
7300
  style?: string | undefined;
@@ -8048,25 +7569,6 @@ export declare const mulmoStudioSchema: z.ZodObject<{
8048
7569
  speaker?: string | undefined;
8049
7570
  description?: string | undefined;
8050
7571
  imageParams?: {
8051
- images?: Record<string, {
8052
- type: "image";
8053
- source: {
8054
- url: string;
8055
- kind: "url";
8056
- } | {
8057
- kind: "base64";
8058
- data: string;
8059
- } | {
8060
- text: string;
8061
- kind: "text";
8062
- } | {
8063
- path: string;
8064
- kind: "path";
8065
- };
8066
- } | {
8067
- type: "imagePrompt";
8068
- prompt: string;
8069
- }> | undefined;
8070
7572
  provider?: string | undefined;
8071
7573
  model?: string | undefined;
8072
7574
  style?: string | undefined;
@@ -8295,25 +7797,6 @@ export declare const mulmoStudioSchema: z.ZodObject<{
8295
7797
  speaker?: string | undefined;
8296
7798
  description?: string | undefined;
8297
7799
  imageParams?: {
8298
- images?: Record<string, {
8299
- type: "image";
8300
- source: {
8301
- url: string;
8302
- kind: "url";
8303
- } | {
8304
- kind: "base64";
8305
- data: string;
8306
- } | {
8307
- text: string;
8308
- kind: "text";
8309
- } | {
8310
- path: string;
8311
- kind: "path";
8312
- };
8313
- } | {
8314
- type: "imagePrompt";
8315
- prompt: string;
8316
- }> | undefined;
8317
7800
  provider?: string | undefined;
8318
7801
  model?: string | undefined;
8319
7802
  style?: string | undefined;
@@ -8779,25 +8262,6 @@ export declare const mulmoStudioSchema: z.ZodObject<{
8779
8262
  speaker?: string | undefined;
8780
8263
  description?: string | undefined;
8781
8264
  imageParams?: {
8782
- images?: Record<string, {
8783
- type: "image";
8784
- source: {
8785
- url: string;
8786
- kind: "url";
8787
- } | {
8788
- kind: "base64";
8789
- data: string;
8790
- } | {
8791
- text: string;
8792
- kind: "text";
8793
- } | {
8794
- path: string;
8795
- kind: "path";
8796
- };
8797
- } | {
8798
- type: "imagePrompt";
8799
- prompt: string;
8800
- }> | undefined;
8801
8265
  provider?: string | undefined;
8802
8266
  model?: string | undefined;
8803
8267
  style?: string | undefined;
@@ -9048,25 +8512,6 @@ export declare const mulmoStudioSchema: z.ZodObject<{
9048
8512
  speaker?: string | undefined;
9049
8513
  description?: string | undefined;
9050
8514
  imageParams?: {
9051
- images?: Record<string, {
9052
- type: "image";
9053
- source: {
9054
- url: string;
9055
- kind: "url";
9056
- } | {
9057
- kind: "base64";
9058
- data: string;
9059
- } | {
9060
- text: string;
9061
- kind: "text";
9062
- } | {
9063
- path: string;
9064
- kind: "path";
9065
- };
9066
- } | {
9067
- type: "imagePrompt";
9068
- prompt: string;
9069
- }> | undefined;
9070
8515
  provider?: string | undefined;
9071
8516
  model?: string | undefined;
9072
8517
  style?: string | undefined;
@@ -9410,6 +8855,7 @@ export declare const mulmoPromptTemplateSchema: z.ZodObject<{
9410
8855
  quality: z.ZodOptional<z.ZodString>;
9411
8856
  style: z.ZodOptional<z.ZodString>;
9412
8857
  moderation: z.ZodOptional<z.ZodString>;
8858
+ } & {
9413
8859
  images: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
9414
8860
  type: z.ZodLiteral<"image">;
9415
8861
  source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
@@ -10352,6 +9798,7 @@ export declare const mulmoPromptTemplateFileSchema: z.ZodObject<{
10352
9798
  quality: z.ZodOptional<z.ZodString>;
10353
9799
  style: z.ZodOptional<z.ZodString>;
10354
9800
  moderation: z.ZodOptional<z.ZodString>;
9801
+ } & {
10355
9802
  images: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
10356
9803
  type: z.ZodLiteral<"image">;
10357
9804
  source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
@@ -194,13 +194,17 @@ export const mulmoGoogleImageModelSchema = z
194
194
  model: z.enum(provider2ImageAgent["google"].models).optional(),
195
195
  })
196
196
  .strict();
197
- export const mulmoImageParamsSchema = z
197
+ export const mulmoBeatImageParamsSchema = z
198
198
  .object({
199
199
  provider: text2ImageProviderSchema, // has no default value (do not change it)
200
200
  model: z.string().optional(), // default: provider specific
201
201
  quality: z.string().optional(), // optional image quality (model specific)
202
202
  style: z.string().optional(), // optional image style
203
203
  moderation: z.string().optional(), // optional image style
204
+ })
205
+ .strict();
206
+ export const mulmoImageParamsSchema = mulmoBeatImageParamsSchema
207
+ .extend({
204
208
  images: mulmoImageParamsImagesSchema.optional(),
205
209
  })
206
210
  .strict();
@@ -260,7 +264,7 @@ export const mulmoBeatSchema = z
260
264
  image: mulmoImageAssetSchema.optional(),
261
265
  audio: mulmoAudioAssetSchema.optional(),
262
266
  duration: z.number().optional().describe("Duration of the beat. Used only when the text is empty"),
263
- imageParams: mulmoImageParamsSchema.optional(), // beat specific parameters
267
+ imageParams: mulmoBeatImageParamsSchema.optional(), // beat specific parameters
264
268
  audioParams: beatAudioParamsSchema.optional(), // beat specific parameters
265
269
  movieParams: z
266
270
  .object({
@@ -324,7 +328,7 @@ export const mulmoMovieParamsSchema = z
324
328
  fillOption: mulmoFillOptionSchema.optional(), // for movie.ts
325
329
  })
326
330
  .strict();
327
- const defaultSpeaker = "Presenter";
331
+ export const defaultSpeaker = "Presenter";
328
332
  export const mulmoPresentationStyleSchema = z.object({
329
333
  $mulmocast: mulmoCastCreditSchema,
330
334
  canvasSize: mulmoCanvasDimensionSchema, // has default value
@@ -244,25 +244,6 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
244
244
  speaker?: string | undefined;
245
245
  description?: string | undefined;
246
246
  imageParams?: {
247
- images?: Record<string, {
248
- type: "image";
249
- source: {
250
- url: string;
251
- kind: "url";
252
- } | {
253
- kind: "base64";
254
- data: string;
255
- } | {
256
- text: string;
257
- kind: "text";
258
- } | {
259
- path: string;
260
- kind: "path";
261
- };
262
- } | {
263
- type: "imagePrompt";
264
- prompt: string;
265
- }> | undefined;
266
247
  provider?: string | undefined;
267
248
  model?: string | undefined;
268
249
  style?: string | undefined;
@@ -598,25 +579,6 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
598
579
  speaker?: string | undefined;
599
580
  description?: string | undefined;
600
581
  imageParams?: {
601
- images?: Record<string, {
602
- type: "image";
603
- source: {
604
- url: string;
605
- kind: "url";
606
- } | {
607
- kind: "base64";
608
- data: string;
609
- } | {
610
- text: string;
611
- kind: "text";
612
- } | {
613
- path: string;
614
- kind: "path";
615
- };
616
- } | {
617
- type: "imagePrompt";
618
- prompt: string;
619
- }> | undefined;
620
582
  provider?: string | undefined;
621
583
  model?: string | undefined;
622
584
  style?: string | undefined;
package/lib/utils/file.js CHANGED
@@ -199,7 +199,9 @@ const getPromptTemplates = (dirPath, schema) => {
199
199
  return [];
200
200
  }
201
201
  const files = fs.readdirSync(templatesDir);
202
- return files.map((file) => {
202
+ return files
203
+ .filter((file) => file.endsWith(".json"))
204
+ .map((file) => {
203
205
  try {
204
206
  const promptTemplate = JSON.parse(fs.readFileSync(path.resolve(templatesDir, file), "utf-8"));
205
207
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mulmocast",
3
- "version": "1.2.39",
3
+ "version": "1.2.41",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "lib/index.node.js",
@@ -115,6 +115,6 @@
115
115
  "typescript-eslint": "^8.44.1"
116
116
  },
117
117
  "engines": {
118
- "node": ">=18.0.0"
118
+ "node": ">=20.0.0"
119
119
  }
120
120
  }