mulmocast 0.1.4 → 0.1.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 (40) hide show
  1. package/lib/actions/audio.js +8 -5
  2. package/lib/actions/image_agents.d.ts +3 -3
  3. package/lib/actions/image_references.js +2 -1
  4. package/lib/actions/images.js +19 -11
  5. package/lib/actions/movie.js +3 -2
  6. package/lib/actions/translate.d.ts +4 -1
  7. package/lib/actions/translate.js +6 -3
  8. package/lib/agents/add_bgm_agent.js +1 -1
  9. package/lib/agents/combine_audio_files_agent.js +116 -93
  10. package/lib/agents/movie_replicate_agent.js +1 -1
  11. package/lib/agents/tts_elevenlabs_agent.d.ts +2 -1
  12. package/lib/agents/tts_elevenlabs_agent.js +5 -4
  13. package/lib/agents/tts_google_agent.d.ts +2 -9
  14. package/lib/agents/tts_nijivoice_agent.d.ts +2 -1
  15. package/lib/agents/tts_nijivoice_agent.js +4 -5
  16. package/lib/agents/tts_openai_agent.d.ts +2 -13
  17. package/lib/agents/tts_openai_agent.js +4 -3
  18. package/lib/index.browser.d.ts +1 -2
  19. package/lib/index.browser.js +2 -3
  20. package/lib/index.common.d.ts +2 -0
  21. package/lib/index.common.js +3 -0
  22. package/lib/index.js +1 -0
  23. package/lib/index.node.d.ts +7 -0
  24. package/lib/index.node.js +8 -0
  25. package/lib/methods/mulmo_presentation_style.d.ts +1 -0
  26. package/lib/methods/mulmo_presentation_style.js +4 -0
  27. package/lib/types/agent.d.ts +29 -2
  28. package/lib/types/agent.js +0 -1
  29. package/lib/types/schema.d.ts +344 -254
  30. package/lib/types/schema.js +5 -3
  31. package/lib/utils/context.d.ts +24 -19
  32. package/lib/utils/ffmpeg_utils.d.ts +4 -1
  33. package/lib/utils/ffmpeg_utils.js +2 -1
  34. package/lib/utils/image_plugins/image.d.ts +2 -2
  35. package/lib/utils/image_plugins/movie.d.ts +2 -2
  36. package/lib/utils/preprocess.d.ts +21 -18
  37. package/lib/utils/provider2agent.d.ts +4 -0
  38. package/lib/utils/provider2agent.js +6 -0
  39. package/lib/utils/utils.js +6 -0
  40. package/package.json +6 -6
@@ -28,6 +28,7 @@ export const speakerDataSchema = z
28
28
  voiceId: z.string(),
29
29
  speechOptions: speechOptionsSchema.optional(),
30
30
  provider: text2SpeechProviderSchema.optional(),
31
+ model: z.string().optional().describe("TTS model to use for this speaker"),
31
32
  })
32
33
  .strict();
33
34
  export const speakerDictionarySchema = z.record(speakerIdSchema, speakerDataSchema);
@@ -130,9 +131,7 @@ export const mulmoImageAssetSchema = z.union([
130
131
  mulmoPdfMediaSchema,
131
132
  mulmoImageMediaSchema,
132
133
  mulmoSvgMediaSchema,
133
- mulmoMovieMediaSchema.extend({
134
- mixAudio: z.number().default(1.0),
135
- }),
134
+ mulmoMovieMediaSchema,
136
135
  mulmoTextSlideMediaSchema,
137
136
  mulmoChartMediaSchema,
138
137
  mulmoMermaidMediaSchema,
@@ -198,6 +197,7 @@ export const textSlideParamsSchema = z
198
197
  export const beatAudioParamsSchema = z
199
198
  .object({
200
199
  padding: z.number().optional().describe("Padding between beats"), // seconds
200
+ movieVolume: z.number().default(1.0).describe("Audio volume of the imported or generated movie"),
201
201
  })
202
202
  .strict();
203
203
  export const mulmoHtmlImageParamsSchema = z
@@ -271,6 +271,7 @@ export const mulmoSpeechParamsSchema = z
271
271
  .object({
272
272
  provider: text2SpeechProviderSchema, // has default value
273
273
  speakers: speakerDictionarySchema,
274
+ model: z.string().optional().describe("Default TTS model to use"),
274
275
  })
275
276
  .strict();
276
277
  export const text2HtmlImageProviderSchema = z.enum(htmlLLMProvider).default(defaultProviders.text2Html);
@@ -360,6 +361,7 @@ export const mulmoStudioBeatSchema = z
360
361
  audioDuration: z.number().optional(),
361
362
  movieDuration: z.number().optional(),
362
363
  silenceDuration: z.number().optional(),
364
+ hasMovieAudio: z.boolean().optional(),
363
365
  audioFile: z.string().optional(),
364
366
  imageFile: z.string().optional(), // path to the image
365
367
  movieFile: z.string().optional(), // path to the movie file
@@ -12,6 +12,7 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
12
12
  audioDuration?: number | undefined;
13
13
  movieDuration?: number | undefined;
14
14
  silenceDuration?: number | undefined;
15
+ hasMovieAudio?: boolean | undefined;
15
16
  audioFile?: string | undefined;
16
17
  imageFile?: string | undefined;
17
18
  movieFile?: string | undefined;
@@ -58,7 +59,9 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
58
59
  instruction?: string | undefined;
59
60
  } | undefined;
60
61
  provider?: string | undefined;
62
+ model?: string | undefined;
61
63
  }>;
64
+ model?: string | undefined;
62
65
  };
63
66
  beats: {
64
67
  text: string;
@@ -119,6 +122,21 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
119
122
  path: string;
120
123
  kind: "path";
121
124
  };
125
+ } | {
126
+ type: "movie";
127
+ source: {
128
+ url: string;
129
+ kind: "url";
130
+ } | {
131
+ kind: "base64";
132
+ data: string;
133
+ } | {
134
+ text: string;
135
+ kind: "text";
136
+ } | {
137
+ path: string;
138
+ kind: "path";
139
+ };
122
140
  } | {
123
141
  type: "textSlide";
124
142
  slide: {
@@ -156,22 +174,6 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
156
174
  } | {
157
175
  type: "voice_over";
158
176
  startAt?: number | undefined;
159
- } | {
160
- type: "movie";
161
- source: {
162
- url: string;
163
- kind: "url";
164
- } | {
165
- kind: "base64";
166
- data: string;
167
- } | {
168
- text: string;
169
- kind: "text";
170
- } | {
171
- path: string;
172
- kind: "path";
173
- };
174
- mixAudio: number;
175
177
  } | undefined;
176
178
  id?: string | undefined;
177
179
  audio?: {
@@ -197,8 +199,8 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
197
199
  description?: string | undefined;
198
200
  imageParams?: {
199
201
  provider: string;
200
- style?: string | undefined;
201
202
  model?: string | undefined;
203
+ style?: string | undefined;
202
204
  moderation?: string | undefined;
203
205
  images?: Record<string, {
204
206
  type: "image";
@@ -221,6 +223,7 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
221
223
  }> | undefined;
222
224
  } | undefined;
223
225
  audioParams?: {
226
+ movieVolume: number;
224
227
  padding?: number | undefined;
225
228
  } | undefined;
226
229
  movieParams?: {
@@ -254,8 +257,8 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
254
257
  description?: string | undefined;
255
258
  imageParams?: {
256
259
  provider: string;
257
- style?: string | undefined;
258
260
  model?: string | undefined;
261
+ style?: string | undefined;
259
262
  moderation?: string | undefined;
260
263
  images?: Record<string, {
261
264
  type: "image";
@@ -373,12 +376,14 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
373
376
  instruction?: string | undefined;
374
377
  } | undefined;
375
378
  provider?: string | undefined;
379
+ model?: string | undefined;
376
380
  }>;
381
+ model?: string | undefined;
377
382
  };
378
383
  imageParams?: {
379
384
  provider: string;
380
- style?: string | undefined;
381
385
  model?: string | undefined;
386
+ style?: string | undefined;
382
387
  moderation?: string | undefined;
383
388
  images?: Record<string, {
384
389
  type: "image";
@@ -11,5 +11,8 @@ export declare const FfmpegContextAddInput: (context: FfmpegContext, input: stri
11
11
  export declare const FfmpegContextPushFormattedAudio: (context: FfmpegContext, sourceId: string, outputId: string, duration?: number | undefined) => void;
12
12
  export declare const FfmpegContextInputFormattedAudio: (context: FfmpegContext, input: string, duration?: number | undefined, inputOptions?: string[]) => string;
13
13
  export declare const FfmpegContextGenerateOutput: (context: FfmpegContext, output: string, options?: string[]) => Promise<number>;
14
- export declare const ffmpegGetMediaDuration: (filePath: string) => Promise<number>;
14
+ export declare const ffmpegGetMediaDuration: (filePath: string) => Promise<{
15
+ duration: number;
16
+ hasAudio: boolean;
17
+ }>;
15
18
  export declare const extractImageFromMovie: (movieFile: string, imagePath: string) => Promise<object>;
@@ -67,7 +67,8 @@ export const ffmpegGetMediaDuration = (filePath) => {
67
67
  reject(err);
68
68
  }
69
69
  else {
70
- resolve(metadata.format.duration);
70
+ const hasAudio = metadata.streams?.some((stream) => stream.codec_type === "audio") ?? false;
71
+ resolve({ duration: metadata.format.duration, hasAudio });
71
72
  }
72
73
  });
73
74
  });
@@ -1,3 +1,3 @@
1
1
  export declare const imageType = "image";
2
- export declare const process: (params: import("../../index.browser.js").ImageProcessorParams) => string | undefined;
3
- export declare const path: (params: import("../../index.browser.js").ImageProcessorParams) => string | undefined;
2
+ export declare const process: (params: import("../../index.common.js").ImageProcessorParams) => string | undefined;
3
+ export declare const path: (params: import("../../index.common.js").ImageProcessorParams) => string | undefined;
@@ -1,3 +1,3 @@
1
1
  export declare const imageType = "movie";
2
- export declare const process: (params: import("../../index.browser.js").ImageProcessorParams) => string | undefined;
3
- export declare const path: (params: import("../../index.browser.js").ImageProcessorParams) => string | undefined;
2
+ export declare const process: (params: import("../../index.common.js").ImageProcessorParams) => string | undefined;
3
+ export declare const path: (params: import("../../index.common.js").ImageProcessorParams) => string | undefined;
@@ -7,6 +7,7 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
7
7
  audioDuration?: number | undefined;
8
8
  movieDuration?: number | undefined;
9
9
  silenceDuration?: number | undefined;
10
+ hasMovieAudio?: boolean | undefined;
10
11
  audioFile?: string | undefined;
11
12
  imageFile?: string | undefined;
12
13
  movieFile?: string | undefined;
@@ -53,7 +54,9 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
53
54
  instruction?: string | undefined;
54
55
  } | undefined;
55
56
  provider?: string | undefined;
57
+ model?: string | undefined;
56
58
  }>;
59
+ model?: string | undefined;
57
60
  };
58
61
  beats: {
59
62
  text: string;
@@ -114,6 +117,21 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
114
117
  path: string;
115
118
  kind: "path";
116
119
  };
120
+ } | {
121
+ type: "movie";
122
+ source: {
123
+ url: string;
124
+ kind: "url";
125
+ } | {
126
+ kind: "base64";
127
+ data: string;
128
+ } | {
129
+ text: string;
130
+ kind: "text";
131
+ } | {
132
+ path: string;
133
+ kind: "path";
134
+ };
117
135
  } | {
118
136
  type: "textSlide";
119
137
  slide: {
@@ -151,22 +169,6 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
151
169
  } | {
152
170
  type: "voice_over";
153
171
  startAt?: number | undefined;
154
- } | {
155
- type: "movie";
156
- source: {
157
- url: string;
158
- kind: "url";
159
- } | {
160
- kind: "base64";
161
- data: string;
162
- } | {
163
- text: string;
164
- kind: "text";
165
- } | {
166
- path: string;
167
- kind: "path";
168
- };
169
- mixAudio: number;
170
172
  } | undefined;
171
173
  id?: string | undefined;
172
174
  audio?: {
@@ -192,8 +194,8 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
192
194
  description?: string | undefined;
193
195
  imageParams?: {
194
196
  provider: string;
195
- style?: string | undefined;
196
197
  model?: string | undefined;
198
+ style?: string | undefined;
197
199
  moderation?: string | undefined;
198
200
  images?: Record<string, {
199
201
  type: "image";
@@ -216,6 +218,7 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
216
218
  }> | undefined;
217
219
  } | undefined;
218
220
  audioParams?: {
221
+ movieVolume: number;
219
222
  padding?: number | undefined;
220
223
  } | undefined;
221
224
  movieParams?: {
@@ -249,8 +252,8 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
249
252
  description?: string | undefined;
250
253
  imageParams?: {
251
254
  provider: string;
252
- style?: string | undefined;
253
255
  model?: string | undefined;
256
+ style?: string | undefined;
254
257
  moderation?: string | undefined;
255
258
  images?: Record<string, {
256
259
  type: "image";
@@ -13,6 +13,8 @@ export declare const provider2TTSAgent: {
13
13
  openai: {
14
14
  agentName: string;
15
15
  hasLimitedConcurrency: boolean;
16
+ defaultModel: string;
17
+ defaultVoice: string;
16
18
  };
17
19
  google: {
18
20
  agentName: string;
@@ -21,6 +23,8 @@ export declare const provider2TTSAgent: {
21
23
  elevenlabs: {
22
24
  agentName: string;
23
25
  hasLimitedConcurrency: boolean;
26
+ defaultModel: string;
27
+ models: string[];
24
28
  };
25
29
  };
26
30
  export declare const provider2ImageAgent: {
@@ -13,6 +13,8 @@ export const provider2TTSAgent = {
13
13
  openai: {
14
14
  agentName: "ttsOpenaiAgent",
15
15
  hasLimitedConcurrency: false,
16
+ defaultModel: "gpt-4o-mini-tts",
17
+ defaultVoice: "shimmer",
16
18
  },
17
19
  google: {
18
20
  agentName: "ttsGoogleAgent",
@@ -21,6 +23,10 @@ export const provider2TTSAgent = {
21
23
  elevenlabs: {
22
24
  agentName: "ttsElevenlabsAgent",
23
25
  hasLimitedConcurrency: true,
26
+ defaultModel: "eleven_multilingual_v2",
27
+ // Models | ElevenLabs Documentation
28
+ // https://elevenlabs.io/docs/models
29
+ models: ["eleven_multilingual_v2", "eleven_turbo_v2_5", "eleven_turbo_v2", "eleven_flash_v2_5", "eleven_flash_v2"],
24
30
  },
25
31
  };
26
32
  export const provider2ImageAgent = {
@@ -56,12 +56,18 @@ export const settings2GraphAIConfig = (settings, env) => {
56
56
  apiKey: getKey("IMAGE", "OPENAI_API_KEY"),
57
57
  baseURL: getKey("IMAGE", "OPENAI_BASE_URL"),
58
58
  },
59
+ imageGoogleAgent: {
60
+ projectId: getKey("IMAGE", "GOOGLE_PROJECT_ID"),
61
+ },
59
62
  anthropicAgent: {
60
63
  apiKey: getKey("LLM", "ANTHROPIC_API_TOKEN"),
61
64
  },
62
65
  movieReplicateAgent: {
63
66
  apiKey: getKey("MOVIE", "REPLICATE_API_TOKEN"),
64
67
  },
68
+ movieGoogleAgent: {
69
+ projectId: getKey("MOVIE", "GOOGLE_PROJECT_ID"),
70
+ },
65
71
  ttsNijivoiceAgent: {
66
72
  apiKey: getKey("TTS", "NIJIVOICE_API_KEY"),
67
73
  },
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "mulmocast",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "",
5
5
  "type": "module",
6
- "main": "lib/index.js",
6
+ "main": "lib/index.node.js",
7
7
  "exports": {
8
8
  ".": {
9
- "types": "./lib/index.d.ts",
10
- "default": "./lib/index.js"
9
+ "types": "./lib/index.node.d.ts",
10
+ "default": "./lib/index.node.js"
11
11
  },
12
12
  "./browser": {
13
13
  "types": "./lib/index.browser.d.ts",
@@ -75,7 +75,7 @@
75
75
  "clipboardy": "^4.0.0",
76
76
  "dotenv": "^17.2.0",
77
77
  "fluent-ffmpeg": "^2.1.3",
78
- "google-auth-library": "^9.15.1",
78
+ "google-auth-library": "^10.1.0",
79
79
  "graphai": "^2.0.12",
80
80
  "inquirer": "^12.7.0",
81
81
  "marked": "^16.0.0",
@@ -101,7 +101,7 @@
101
101
  "ts-node": "^10.9.2",
102
102
  "tsx": "^4.20.3",
103
103
  "typescript": "^5.7.3",
104
- "typescript-eslint": "^8.36.0"
104
+ "typescript-eslint": "^8.37.0"
105
105
  },
106
106
  "engines": {
107
107
  "node": ">=18.0.0"